diff --git a/build.gradle b/build.gradle index 617b9d0fa..cbc6d696c 100644 --- a/build.gradle +++ b/build.gradle @@ -60,6 +60,10 @@ allprojects { implementation 'com.fr.third:jxbrowser:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23' implementation 'com.fr.third:jxbrowser-win64:6.23' + implementation 'com.fr.third:jxbrowser-v7:7.5' + implementation 'com.fr.third:jxbrowser-mac-v7:7.5' + implementation 'com.fr.third:jxbrowser-win64-v7:7.5' + implementation 'com.fr.third:jxbrowser-swing:7.5' implementation 'com.fr.third.server:servlet-api:3.0' implementation 'org.swingexplorer:swexpl:2.0.1' implementation 'org.swingexplorer:swag:1.0' diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index e5a8e7cf4..97b4d0f6c 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -17,6 +17,9 @@ import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.ProductImproveMark; +import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; +import com.fr.design.login.DesignerLoginType; +import com.fr.design.login.config.DesignerLoginConfigManager; import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.notification.SnapChatConfig; import com.fr.design.port.DesignerPortContext; @@ -192,6 +195,12 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { // 开启内嵌web页面的调试窗口 private boolean openDebug = false; + private ComponentReuseNotificationInfo notificationInfo = ComponentReuseNotificationInfo.getInstance(); + + private DesignerLoginConfigManager designerLoginConfigManager = DesignerLoginConfigManager.getInstance(); + + private boolean showTemplateMissingPlugin = true; + /** * DesignerEnvManager. */ @@ -308,8 +317,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { } LogHandler handler = new LogHandler() { final FileAppender appender = new FileAppender( - new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"), - fileName + new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"), + fileName ); @Override @@ -614,6 +623,24 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.templateTreePaneExpanded = templateTreePaneExpanded; } + /** + * 是否提示模板缺少插件 + * + * @return 提示返回true + */ + public boolean isShowTemplateMissingPlugin() { + return showTemplateMissingPlugin; + } + + /** + * 设置是否提示模板缺少插件 + * + * @param showTemplateMissingPlugin 是否提示 + */ + public void setShowTemplateMissingPlugin(boolean showTemplateMissingPlugin) { + this.showTemplateMissingPlugin = showTemplateMissingPlugin; + } + /** * 知否自动备份 * @@ -735,6 +762,113 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { designerPushUpdateConfigManager.setAutoPushUpdateEnabled(autoPushUpdateEnabled); } + /** + * 设计器登录相关配置 + */ + public void setDesignerLoginUid(int uid) { + designerLoginConfigManager.setUid(uid); + } + + public int getDesignerLoginUid() { + return designerLoginConfigManager.getUid(); + } + + public void setDesignerLoginUsername(String username) { + designerLoginConfigManager.setUsername(username); + } + + public String getDesignerLoginUsername() { + return designerLoginConfigManager.getUsername(); + } + + public void setDesignerLoginAppId(String appId) { + designerLoginConfigManager.setAppId(appId); + } + + public String getDesignerLoginAppId() { + return designerLoginConfigManager.getAppId(); + } + + public void setDesignerLoginRefreshToken(String refreshToken) { + designerLoginConfigManager.setRefreshToken(refreshToken); + } + + public String getDesignerLoginRefreshToken() { + return designerLoginConfigManager.getRefreshToken(); + } + + public void setDesignerLoginDoNotRemind(boolean doNotRemind) { + designerLoginConfigManager.setDoNotRemind(doNotRemind); + } + + public boolean isDesignerLoginDoNotRemind() { + return designerLoginConfigManager.isDoNotRemind(); + } + + public void setDesignerLoginDoNotRemindSelectedTime(long doNotRemindSelectedTime) { + designerLoginConfigManager.setDoNotRemindSelectedTime(doNotRemindSelectedTime); + } + + public long getDesignerLoginDoNotRemindSelectedTime() { + return designerLoginConfigManager.getDoNotRemindSelectedTime(); + } + + public void setDesignerActivatedTime(long designerActivatedTime) { + designerLoginConfigManager.setDesignerActivatedTime(designerActivatedTime); + } + + public long getDesignerActivatedTime() { + return designerLoginConfigManager.getDesignerActivatedTime(); + } + + public void setDesignerLastLoginTime(long lastLoginTime) { + designerLoginConfigManager.setLastLoginTime(lastLoginTime); + } + + public long getDesignerLastLoginTime() { + return designerLoginConfigManager.getLastLoginTime(); + } + + public void setCurrentVersionFirstLaunch(boolean currentVersionFirstLaunch) { + designerLoginConfigManager.setCurrentVersionFirstLaunch(currentVersionFirstLaunch); + } + + public boolean isCurrentVersionFirstLaunch() { + return designerLoginConfigManager.isCurrentVersionFirstLaunch(); + } + + public DesignerLoginType getLastLoginType() { + return designerLoginConfigManager.getLastLoginType(); + } + + public void setLastLoginType(DesignerLoginType lastLoginType) { + designerLoginConfigManager.setLastLoginType(lastLoginType); + } + + public String getLastLoginAccount() { + return designerLoginConfigManager.getLastLoginAccount(); + } + + public void setLastLoginAccount(String lastLoginAccount) { + designerLoginConfigManager.setLastLoginAccount(lastLoginAccount); + } + + public boolean isLoginRemindBeforeJumpBBS() { + return designerLoginConfigManager.isLoginRemindBeforeJumpBBS(); + } + + public void setLoginRemindBeforeJumpBBS(boolean loginRemindBeforeJumpBBS) { + designerLoginConfigManager.setLoginRemindBeforeJumpBBS(loginRemindBeforeJumpBBS); + } + + public boolean isPluginRemindOnFirstLaunch() { + return designerLoginConfigManager.isPluginRemindOnFirstLaunch(); + } + + public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) { + designerLoginConfigManager.setPluginRemindOnFirstLaunch(pluginRemindOnFirstLaunch); + } + /** * 内置服务器是否使用时启动 * @@ -1566,20 +1700,29 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { readRecentColor(reader); } else if ("OpenDebug".equals(name)) { readOpenDebug(reader); + } else if (name.equals(ComponentReuseNotificationInfo.XML_TAG)) { + readComponentReuseNotificationInfo(reader); } else if (name.equals(DesignerPushUpdateConfigManager.XML_TAG)) { readDesignerPushUpdateAttr(reader); } else if (name.equals(vcsConfigManager.XML_TAG)) { readVcsAttr(reader); } else if (DesignerPort.XML_TAG.equals(name)) { readDesignerPort(reader); - }else if (name.equals(SnapChatConfig.XML_TAG)) { + } else if (name.equals(SnapChatConfig.XML_TAG)) { readSnapChatConfig(reader); + } else if (name.equals(DesignerLoginConfigManager.XML_TAG)) { + readDesignerLoginAttr(reader); } else { readLayout(reader, name); } } } + private void readComponentReuseNotificationInfo(XMLableReader reader) { + reader.readXMLObject(this.notificationInfo); + + } + private void readSnapChatConfig(XMLableReader reader) { reader.readXMLObject(this.snapChatConfig = SnapChatConfig.getInstance()); } @@ -1669,6 +1812,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.setRecentSelectedConnection(tmpVal); } this.setEmbedServerLazyStartup(reader.getAttrAsBoolean("embedServerLazyStartup", false)); + this.setShowTemplateMissingPlugin(reader.getAttrAsBoolean("showTemplateMissingPlugin", true)); } private void readReportPaneAttributions(XMLableReader reader) { @@ -1800,9 +1944,17 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { writeVcsAttr(writer); writeDesignerPort(writer); writeSnapChatConfig(writer); + writeComponentReuseNotificationInfo(writer); + writeDesignerLoginAttr(writer); writer.end(); } + private void writeComponentReuseNotificationInfo(XMLPrintWriter writer) { + if (this.notificationInfo != null) { + this.notificationInfo.writeXML(writer); + } + } + private void writeSnapChatConfig(XMLPrintWriter writer) { if (this.snapChatConfig != null) { @@ -1929,6 +2081,9 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { if (this.isEmbedServerLazyStartup()) { writer.attr("embedServerLazyStartup", this.isEmbedServerLazyStartup()); } + if (!this.isShowTemplateMissingPlugin()) { + writer.attr("showTemplateMissingPlugin", this.isShowTemplateMissingPlugin()); + } writer.end(); } @@ -2071,13 +2226,22 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { this.vcsConfigManager = vcsConfigManager; } + private void readDesignerLoginAttr(XMLableReader reader) { + reader.readXMLObject(designerLoginConfigManager); + } + + private void writeDesignerLoginAttr(XMLPrintWriter writer) { + this.designerLoginConfigManager.writeXML(writer); + } + enum XmlHandler { Self; + public void handle(Throwable throwable) { ErrorDialog dialog = new ErrorDialog(null, - Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), - Toolkit.i18nText("Fine-Design_Error_Start_Report"), - throwable.getMessage()) { + Toolkit.i18nText("Fine-Design_Error_Start_Apology_Message"), + Toolkit.i18nText("Fine-Design_Error_Start_Report"), + throwable.getMessage()) { @Override protected void okEvent() { dispose(); @@ -2093,5 +2257,5 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { dialog.setVisible(true); DesignerExiter.getInstance().execute(); } - }; + } } diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 5196c783a..14145d119 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -17,8 +17,9 @@ import com.fr.design.file.TemplateTreePane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; +import com.fr.design.notification.NotificationCenter; import com.fr.design.utils.DesignUtils; -import com.fr.env.CheckServiceDialog; +import com.fr.design.versioncheck.VersionCheckUtils; import com.fr.env.EnvListPane; import com.fr.env.RemoteWorkspaceURL; import com.fr.env.TestConnectionResult; @@ -95,7 +96,9 @@ public class EnvChangeEntrance { * @param envName 目标工作目录名称 */ public void switch2Env(final String envName) { - switch2Env(envName, PopTipStrategy.LATER); + if (switch2Env(envName, PopTipStrategy.LATER)) { + VersionCheckUtils.showVersionCheckDialog(envName); + } } /** @@ -145,7 +148,6 @@ public class EnvChangeEntrance { if (template != null) { template.refreshToolArea(); } - showServiceDialog(selectedEnv); pluginErrorRemind(); } catch (WorkspaceAuthException | RegistEditionException e) { // String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed"); @@ -182,6 +184,7 @@ public class EnvChangeEntrance { if (model != null) { model.envChanged(); } + NotificationCenter.getInstance().clearAllNotifications(); return true; } @@ -294,8 +297,7 @@ public class EnvChangeEntrance { if(StringUtils.isEmpty(areaText)){ return; } - CheckServiceDialog dialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), areaText, localBranch, remoteBranch); - dialog.setVisible(true); + } } } @@ -444,9 +446,12 @@ public class EnvChangeEntrance { @Override public void doOk() { - envListOkAction(envListPane, PopTipStrategy.LATER); + boolean changeResult = envListOkAction(envListPane, PopTipStrategy.LATER); // 切换完成后清理密码 updateNotRememberPwdEnv(); + if (changeResult) { + VersionCheckUtils.showVersionCheckDialog(envListPane.updateEnvManager()); + } } @Override @@ -478,6 +483,7 @@ public class EnvChangeEntrance { DesignerExiter.getInstance().execute(); } else { updateNotRememberPwdEnv(); + VersionCheckUtils.showVersionCheckDialog(envListPane.updateEnvManager()); } } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java index 05a1d2b20..1acbbe417 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BBSAction.java @@ -1,54 +1,43 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; +public class BBSAction extends AbstractDesignerSSO { -public class BBSAction extends UpdateAction -{ + public BBSAction() { + this.setMenuKeySet(BBS); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/bbs"); - public BBSAction() - { - this.setMenuKeySet(BBS); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/bbs"); + } - } - - /** - * 动作 - * @param arg0 事件 - */ @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs"); - BrowseUtils.browser(url); + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs", "http://bbs.fanruan.com/"); } - public static final MenuKeySet BBS = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'B'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bbs"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; + + public static final MenuKeySet BBS = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'B'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bbs"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index cebaa6956..a16257100 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -1,50 +1,42 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; +public class BugAction extends AbstractDesignerSSO { -public class BugAction extends UpdateAction -{ + public BugAction() { + this.setMenuKeySet(BUG); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/bug"); + } - public BugAction() - { this.setMenuKeySet(BUG); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/bug"); -} - -@Override -public void actionPerformed(ActionEvent arg0) -{ - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.bugs"); - BrowseUtils.browser(url); + @Override + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs", "http://bbs.fanruan.com/forum-156-1.html"); + } -} - public static final MenuKeySet BUG = new MenuKeySet() { + public static final MenuKeySet BUG = new MenuKeySet() { - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bug"); - } + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Bug"); + } - @Override - public KeyStroke getKeyStroke() { - return null; - } + @Override + public KeyStroke getKeyStroke() { + return null; + } - @Override - public char getMnemonic() - { + @Override + public char getMnemonic() { - return 'U'; - } - }; + return 'U'; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java index 64288b9c9..6ae03f1a8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CenterAction.java @@ -1,33 +1,26 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.KeyStroke; -import java.awt.event.ActionEvent; /** * Created by XINZAI on 2018/8/23. */ -public class CenterAction extends UpAction{ - public CenterAction() - { +public class CenterAction extends UpAction { + public CenterAction() { this.setMenuKeySet(CENTER); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon("/com/fr/design/images/bbs/center"); - } @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.center"); - BrowseUtils.browser(url); - + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.center", "http://bbs.fanruan.com/events/"); } + public static final MenuKeySet CENTER = new MenuKeySet() { @Override public char getMnemonic() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java index 9e294d859..007eeb9ab 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/CusDemandAction.java @@ -25,7 +25,7 @@ public class CusDemandAction extends UpAction{ @Override public void actionPerformed(ActionEvent arg0) { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.demand"); + String url = CloudCenter.getInstance().acquireUrlByKind("bbs.demand", "https://market.fanruan.com/demand"); BrowseUtils.browser(url); } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java b/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java index 192d921fa..e5ff4dd47 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/FacebookFansAction.java @@ -18,7 +18,7 @@ public class FacebookFansAction extends UpAction { @Override public void actionPerformed(ActionEvent arg0) { - BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("facebook.fans.tw")); + BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("facebook.fans.tw", "https://www.facebook.com/twfinereport")); } public static final MenuKeySet FACEBOOKFANS = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index 61834547f..c8b2ccdae 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -1,49 +1,41 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; - -public class NeedAction extends UpdateAction -{ - - public NeedAction() - { - this.setMenuKeySet(NEED); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/need"); - - } - - @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.needs"); - BrowseUtils.browser(url); - - } - public static final MenuKeySet NEED = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'N'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Need"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; +public class NeedAction extends AbstractDesignerSSO { + + public NeedAction() { + this.setMenuKeySet(NEED); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/need"); + + } + + @Override + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.needs", "http://bbs.fanruan.com/forum-56-1.html"); + } + + public static final MenuKeySet NEED = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'N'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Commuinity_Need"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java index 94234b1bc..5b4411225 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/QuestionAction.java @@ -1,16 +1,12 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; - -public class QuestionAction extends UpdateAction { +public class QuestionAction extends AbstractDesignerSSO { public QuestionAction() { this.setMenuKeySet(QUESTIONS); @@ -21,9 +17,8 @@ public class QuestionAction extends UpdateAction { } @Override - public void actionPerformed(ActionEvent arg0) { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.questions"); - BrowseUtils.browser(url); + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.questions", "http://bbs.fanruan.com/wenda"); } public static final MenuKeySet QUESTIONS = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java index 4944ecc3c..8c29ee5e6 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/SignAction.java @@ -1,49 +1,41 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; import javax.swing.*; -import java.awt.event.ActionEvent; - -public class SignAction extends UpdateAction -{ - - public SignAction() - { - this.setMenuKeySet(SIGN); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/sign"); - } - - @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.aut"); - BrowseUtils.browser(url); - - } - public static final MenuKeySet SIGN = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'S'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_sign"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; +public class SignAction extends AbstractDesignerSSO { + + public SignAction() { + this.setMenuKeySet(SIGN); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/sign"); + } + + @Override + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.aut", "https://bbs.fanruan.com/certification/"); + } + + public static final MenuKeySet SIGN = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'S'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_sign"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java index 740ca2387..897555578 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/TechSolutionAction.java @@ -1,23 +1,16 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; - import javax.swing.KeyStroke; -import java.awt.event.ActionEvent; - - /** * Created by XINZAI on 2018/8/23. */ -public class TechSolutionAction extends UpdateAction{ - public TechSolutionAction() - { +public class TechSolutionAction extends AbstractDesignerSSO { + public TechSolutionAction() { this.setMenuKeySet(TSO); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); @@ -26,12 +19,10 @@ public class TechSolutionAction extends UpdateAction{ } @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.solution"); - BrowseUtils.browser(url); - + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.solution", "http://bbs.fanruan.com/forum-113-1.html"); } + public static final MenuKeySet TSO = new MenuKeySet() { @Override public char getMnemonic() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java b/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java new file mode 100644 index 000000000..eec904ebd --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/TemplateStoreAction.java @@ -0,0 +1,52 @@ +package com.fr.design.actions.community; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; + +import javax.swing.KeyStroke; +import java.awt.event.ActionEvent; + +/** + * created by Harrison on 2020/03/24 + **/ +public class TemplateStoreAction extends AbstractDesignerSSO { + + public TemplateStoreAction() { + + this.setMenuKeySet(TEMPLATE); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/share/template_store.png")); + } + + public static final MenuKeySet TEMPLATE = new MenuKeySet() { + + @Override + public String getMenuName() { + + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Template_Store"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + + @Override + public char getMnemonic() { + + return 'T'; + } + }; + + @Override + public String getJumpUrl() { + ComponentCollector.getInstance().collectTepMenuEnterClick(); + return CloudCenter.getInstance().acquireUrlByKind("design.market.template", "https://market.fanruan.com/template"); + } +} diff --git a/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java b/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java index 9e550377f..05022ecf8 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/UpAction.java @@ -1,69 +1,41 @@ package com.fr.design.actions.community; import com.fr.base.BaseUtils; -import com.fr.design.actions.UpdateAction; -import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; -import javax.swing.JOptionPane; import javax.swing.KeyStroke; -import java.awt.Desktop; -import java.awt.event.ActionEvent; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -public class UpAction extends UpdateAction -{ +public class UpAction extends AbstractDesignerSSO { - public UpAction() - { - this.setMenuKeySet(UPDATE); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update.png")); - - } + public UpAction() { + this.setMenuKeySet(UPDATE); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update.png")); + } @Override - public void actionPerformed(ActionEvent arg0) - { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.update"); - if (StringUtils.isEmpty(url)) { - FineLoggerFactory.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } - + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.update", "http://bbs.fanruan.com/forum.php?mod=collection&action=view&ctid=10"); } - public static final MenuKeySet UPDATE = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'U'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Update"); - } - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; + public static final MenuKeySet UPDATE = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'U'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Update"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java index 62ccf845e..609884635 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/VideoAction.java @@ -1,49 +1,43 @@ package com.fr.design.actions.community; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; import com.fr.design.locale.impl.VideoMark; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; -import com.fr.design.utils.BrowseUtils; import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; import javax.swing.*; -import java.awt.event.ActionEvent; +public class VideoAction extends AbstractDesignerSSO { -public class VideoAction extends UpdateAction -{ - - public VideoAction() - { - this.setMenuKeySet(VIDEO); - this.setName(getMenuKeySet().getMenuName()); - this.setMnemonic(getMenuKeySet().getMnemonic()); - this.setSmallIcon("/com/fr/design/images/bbs/video"); - } + public VideoAction() { + this.setMenuKeySet(VIDEO); + this.setName(getMenuKeySet().getMenuName()); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon("/com/fr/design/images/bbs/video"); + } @Override - public void actionPerformed(ActionEvent arg0) - { + public String getJumpUrl() { LocaleMark localeMark = LocaleCenter.getMark(VideoMark.class); - BrowseUtils.browser(localeMark.getValue()); + return localeMark.getValue(); } - public static final MenuKeySet VIDEO = new MenuKeySet() { - @Override - public char getMnemonic() { - return 'V'; - } - - @Override - public String getMenuName() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Video"); - } - - @Override - public KeyStroke getKeyStroke() { - return null; - } - }; + + public static final MenuKeySet VIDEO = new MenuKeySet() { + @Override + public char getMnemonic() { + return 'V'; + } + + @Override + public String getMenuName() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Community_Video"); + } + + @Override + public KeyStroke getKeyStroke() { + return null; + } + }; } diff --git a/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java b/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java index d556548c1..d1168eca7 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/WorkOrderCenterAction.java @@ -1,12 +1,8 @@ package com.fr.design.actions.community; - import com.fr.design.i18n.Toolkit; -import com.fr.design.utils.BrowseUtils; import com.fr.general.CloudCenter; -import java.awt.event.ActionEvent; - /** * @Description 工单中心 * @Author Henry.Wang @@ -19,8 +15,7 @@ public class WorkOrderCenterAction extends UpAction { } @Override - public void actionPerformed(ActionEvent arg0) { - String url = CloudCenter.getInstance().acquireUrlByKind("bbs.work.order.center"); - BrowseUtils.browser(url); + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.work.order.center", "https://service.fanruan.com/ticket"); } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 5afe58ad3..133bbb03f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -40,7 +40,6 @@ import com.fr.general.log.Log4jConfig; import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; -import com.fr.stable.StableUtils; import com.fr.stable.os.OperatingSystem; import com.fr.third.apache.log4j.Level; import com.fr.transaction.Configurations; @@ -141,6 +140,8 @@ public class PreferencePane extends BasicPane { private UIComboBox maxUndoLimit; //是非支持自动计算父格 private UICheckBox supportDefaultParentCalculateCheckBox; + //打开模板是否提示缺少插件 + private UICheckBox showTemplateMissingPlugin; //是否自动转化为公式 private UICheckBox supportStringToFormulaBox; @@ -361,6 +362,11 @@ public class PreferencePane extends BasicPane { supportDefaultParentCalculateCheckBox = new UICheckBox( i18nText("Fine-Design_Basic_Preference_Support_Default_Parent_Calculate")); functionPane.add(supportDefaultParentCalculateCheckBox); + + //添加是否展示打开模板提示缺少插件选择项 + showTemplateMissingPlugin = new UICheckBox( + i18nText("Fine-Design_Basic_Preference_Show-Template-Missing-Plugin")); + functionPane.add(showTemplateMissingPlugin); } private void createEditPane(JPanel generalPane) { @@ -644,6 +650,8 @@ public class PreferencePane extends BasicPane { supportDefaultParentCalculateCheckBox.setSelected(designerEnvManager.isSupportDefaultParentCalculate()); + showTemplateMissingPlugin.setSelected(designerEnvManager.isShowTemplateMissingPlugin()); + supportStringToFormulaBox.setSelected(designerEnvManager.isSupportStringToFormula()); shortCutLabel.setText(getDisplayShortCut(designerEnvManager.getAutoCompleteShortcuts())); @@ -744,6 +752,8 @@ public class PreferencePane extends BasicPane { designerEnvManager.setSupportDefaultParentCalculate(supportDefaultParentCalculateCheckBox.isSelected()); + designerEnvManager.setShowTemplateMissingPlugin(showTemplateMissingPlugin.isSelected()); + designerEnvManager.setSupportStringToFormula(supportStringToFormulaBox.isSelected()); designerEnvManager.setDefaultStringToFormula(defaultStringToFormulaBox.isSelected()); diff --git a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java index 8f8d4ae13..2503db1de 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java @@ -76,7 +76,7 @@ public final class WebPreviewUtils { browserTemplate(jt, baseRoute, map, actionType); } }); - worker.start(jt.getTarget().getTemplateID()); + worker.start(jt.getRuntimeId()); return; } browserTemplate(jt, baseRoute, map, actionType); @@ -97,7 +97,7 @@ public final class WebPreviewUtils { ); if (OK_OPTION == selVal) { CallbackSaveWorker worker = jt.saveAs(); - worker.start(jt.getTarget().getTemplateID()); + worker.start(jt.getRuntimeId()); worker.addSuccessCallback(new Runnable() { @Override public void run() { @@ -125,7 +125,7 @@ public final class WebPreviewUtils { browseUrl(jt.getEditingFILE(), baseRoute, map, actionType, jt); } }); - worker.start(jt.getTarget().getTemplateID()); + worker.start(jt.getRuntimeId()); } } } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java index af0ea605f..cf4f02f40 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/TutorialAction.java @@ -1,12 +1,10 @@ package com.fr.design.actions.help; -import com.fr.base.svg.IconUtils; -import com.fr.design.actions.UpdateAction; +import com.fr.design.login.AbstractDesignerSSO; import com.fr.design.menu.MenuKeySet; import com.fr.general.CloudCenter; import com.fr.general.GeneralContext; import com.fr.general.http.HttpToolbox; -import com.fr.log.FineLoggerFactory; import com.fr.stable.CommonUtils; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; @@ -15,14 +13,9 @@ import com.fr.third.org.apache.http.StatusLine; import com.fr.third.org.apache.http.client.methods.HttpGet; import javax.swing.KeyStroke; -import java.awt.Desktop; -import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; -import java.net.URI; -public class TutorialAction extends UpdateAction { - - private static final String URL_FOR_TEST_NETWORK = "https://www.baidu.com"; +public class TutorialAction extends AbstractDesignerSSO { public TutorialAction() { this.setMenuKeySet(HELP_TUTORIAL); @@ -32,29 +25,15 @@ public class TutorialAction extends UpdateAction { this.setAccelerator(getMenuKeySet().getKeyStroke()); } - /** - * 动作 - * @param evt 事件 - */ @Override - public void actionPerformed(ActionEvent evt) { - String helpURL = CloudCenter.getInstance().acquireUrlByKind(createDocKey()); - // 用第三方网址去判断是否处在离线状态 - if (isServerOnline(URL_FOR_TEST_NETWORK)) { - try { - Desktop.getDesktop().browse(new URI(helpURL)); - return; - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - } - FineLoggerFactory.getLogger().warn(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Offline_Helptutorial_Msg")); + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind(createDocKey()); } // 生成帮助文档 sitecenter key, help.zh_CN.10 protected String createDocKey() { String locale = GeneralContext.getLocale().toString(); - return CommonUtils.join(new String[]{ "help", locale, ProductConstants.MAIN_VERSION }, "."); + return CommonUtils.join(new String[]{"help", locale, ProductConstants.MAIN_VERSION}, "."); } // 判断是否可以访问在线文档 diff --git a/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java b/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java index e9b6b3e0f..140a46579 100644 --- a/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java +++ b/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java @@ -4,6 +4,7 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.fun.ClipboardHandlerProvider; import com.fr.plugin.injectable.PluginModule; +import java.util.HashSet; import java.util.Set; /** @@ -11,11 +12,25 @@ import java.util.Set; **/ @SuppressWarnings({"rawtypes", "unchecked"}) public abstract class ClipboardFilter { + public static Set clipboardHandlerProviders = new HashSet(); + + public static void registerClipboardHandler(ClipboardHandlerProvider provider) { + if (!clipboardHandlerProviders.contains(provider)) { + clipboardHandlerProviders.add(provider); + } + } + + public static void removeClipboardHandler(ClipboardHandlerProvider provider) { + if (clipboardHandlerProviders.contains(provider)) { + clipboardHandlerProviders.remove(provider); + } + } public static T cut(T selection) { - + ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); + providers.addAll(clipboardHandlerProviders); for (ClipboardHandlerProvider provider : providers) { if (provider.support(selection)) { selection = ((ClipboardHandlerProvider) provider).cut(selection); @@ -25,9 +40,9 @@ public abstract class ClipboardFilter { } public static T copy(T selection) { - ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); + providers.addAll(clipboardHandlerProviders); for (ClipboardHandlerProvider provider : providers) { if (provider.support(selection)) { selection = ((ClipboardHandlerProvider) provider).copy(selection); @@ -37,9 +52,10 @@ public abstract class ClipboardFilter { } public static T paste(T selection) { - ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign); Set providers = manager.getArray(ClipboardHandlerProvider.XML_TAG); + providers.addAll(clipboardHandlerProviders); + for (ClipboardHandlerProvider provider : providers) { if (provider.support(selection)) { selection = ((ClipboardHandlerProvider) provider).paste(selection); diff --git a/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardHandler.java b/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardHandler.java new file mode 100644 index 000000000..25ab24a32 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardHandler.java @@ -0,0 +1,35 @@ +package com.fr.design.base.clipboard; + +public interface ClipboardHandler { + /** + * 剪切 + * + * @param selection 选中 + * @return 处理后的内容 + */ + T cut(T selection); + + /** + * 复制 + * + * @param selection 选中 + * @return 处理后的内容 + */ + T copy(T selection); + + /** + * 粘贴 + * + * @param selection 选中 + * @return 处理后的内容 + */ + T paste(T selection); + + /** + * 支持的类型 + * + * @param selection 内容 + * @return 是否 + */ + boolean support(Object selection); +} diff --git a/designer-base/src/main/java/com/fr/design/bridge/exec/JSExecutor.java b/designer-base/src/main/java/com/fr/design/bridge/exec/JSExecutor.java index 1efa613ab..a3135c15f 100644 --- a/designer-base/src/main/java/com/fr/design/bridge/exec/JSExecutor.java +++ b/designer-base/src/main/java/com/fr/design/bridge/exec/JSExecutor.java @@ -7,5 +7,12 @@ public interface JSExecutor { String CALLBACK_FUNCTION_NAME = "action"; + JSExecutor DEFAULT = new JSExecutor() { + @Override + public void executor(String newValue) { + // do nothing + } + }; + void executor(String newValue); } diff --git a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java index fdc92a937..b10d3f9e5 100644 --- a/designer-base/src/main/java/com/fr/design/constants/UIConstants.java +++ b/designer-base/src/main/java/com/fr/design/constants/UIConstants.java @@ -148,7 +148,8 @@ public interface UIConstants { public static final Color TAB_BUTTON_PRESS_SELECTED = new Color(236, 236, 238); public static final Color POPUP_TITLE_BACKGROUND = new Color(0xd8f2fd); public static final Color LIST_ITEM_SPLIT_LINE = new Color(0xf0f0f3); - + public static final Color DESIGNER_LOGIN_BACKGROUND = new Color(0xf1ad14); + public static final Color DESIGNER_LOGIN_BACKGROUND_ONCLICK = new Color(0xd89600); public static final BufferedImage DRAG_BAR = IOUtils.readImage("com/fr/design/images/control/bar.png"); public static final BufferedImage DRAG_BAR_LIGHT = IOUtils.readImage("com/fr/design/images/control/bar-light.png"); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 433182823..c1afbe137 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -5,10 +5,10 @@ import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.design.border.UITitledBorder; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ipasswordfield.UIPasswordFieldWithFixedLength; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; @@ -21,17 +21,13 @@ import com.fr.general.ComparatorUtils; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; -import java.awt.event.InputMethodEvent; -import java.awt.event.InputMethodListener; -import java.awt.event.KeyAdapter; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; -import java.util.regex.Matcher; -import java.util.regex.Pattern; + import javax.swing.BorderFactory; import javax.swing.JFileChooser; import javax.swing.JPanel; import javax.swing.JPasswordField; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -39,13 +35,18 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.InputMethodEvent; +import java.awt.event.InputMethodListener; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; import java.io.File; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; -import javax.swing.event.DocumentEvent; -import javax.swing.event.DocumentListener; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class JDBCDefPane extends JPanel { public static final String DRIVER_TYPE = "driver_type"; @@ -291,7 +292,7 @@ public class JDBCDefPane extends JPanel { jdbcDatabase = new JDBCDatabaseConnection(); } Object driveItem = this.driverComboBox.getSelectedItem(); - jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString()); + jdbcDatabase.setDriver(driveItem == null ? null : driveItem.toString().trim()); jdbcDatabase.setURL(this.urlTextField.getText().trim()); jdbcDatabase.setUser(this.userNameTextField.getText().trim()); jdbcDatabase.setPassword(new String(this.passwordTextField.getPassword()).trim()); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java new file mode 100644 index 000000000..c0239c8fa --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/sql/PreviewPerformedSqlPane.java @@ -0,0 +1,298 @@ +package com.fr.design.data.datapane.preview.sql; + +import com.fr.base.Parameter; +import com.fr.base.ParameterHelper; +import com.fr.base.ParameterMapNameSpace; +import com.fr.data.impl.DBTableData; +import com.fr.data.impl.EscapeSqlHelper; +import com.fr.data.operator.DataOperator; +import com.fr.decision.webservice.v10.config.ConfigService; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.link.MessageWithLink; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.parameter.ParameterInputPane; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.injectable.PluginModule; +import com.fr.script.Calculator; +import com.fr.stable.ArrayUtils; +import com.fr.stable.ParameterProvider; +import com.fr.stable.StringUtils; +import com.fr.stable.fun.TableDataProvider; +import com.fr.stable.plugin.ExtraClassManagerProvider; +import com.fr.stable.script.NameSpace; + +import javax.swing.BorderFactory; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.UIManager; +import javax.swing.text.BadLocationException; +import javax.swing.text.DefaultHighlighter; +import javax.swing.text.Highlighter; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Frame; +import java.awt.datatransfer.StringSelection; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +public class PreviewPerformedSqlPane extends JDialog implements ActionListener { + + private JPanel topPanel; + private JPanel centerPanel; + private JPanel bottomPanel; + + private UILabel imageLabel; + + public PreviewPerformedSqlPane(Frame frame, String sql) { + this(frame, sql, null, null, false); + } + + public PreviewPerformedSqlPane(Frame frame, String sql, List selectedSpecialCharIndex, String[] selectedSpecialChar, boolean highlight) { + super(frame, true); + // 提示信息 + topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + JPanel imagePanel = new JPanel(); + JPanel messagePanel; + + if (isShowSpecialCharSqlPane(selectedSpecialCharIndex)) { + imageLabel = new UILabel(UIManager.getIcon("OptionPane.warningIcon")); + messagePanel = new JPanel(); + messagePanel.setLayout(FRGUIPaneFactory.createBorderLayout()); + messagePanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 0)); + // 日韩取消超链,直接显示文字 + if (isNotShowLink()) { + JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql_Message") + Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention") + Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Back_Message")); + messagePanel.add(label); + } else { + MessageWithLink message = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Front_Message"), Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention"), CloudCenter.getInstance().acquireConf(Toolkit.i18nText("Fine-Design_Basic_Sql_Injection_Prevention_Help"), "https://help.fanruan.com/finereport/doc-view-2219.html"), Toolkit.i18nText("Fine-Design_Basic_Preview_Special_Char_Sql_Back_Message")); + messagePanel.add(message); + } + // 提示图标 + JPanel tipPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + UILabel tipLabel = new UILabel(UIManager.getIcon("OptionPane.tipIcon")); + StringBuilder textBuilder = new StringBuilder(); + textBuilder.append("").append(Toolkit.i18nText("Fine-Design_Basic_Processed_Special_Char")).append("
"); + for (String sChar : selectedSpecialChar) { + textBuilder.append(sChar).append("
"); + } + textBuilder.append(""); + tipLabel.setToolTipText(textBuilder.toString()); + tipPanel.add(tipLabel, BorderLayout.SOUTH); + topPanel.add(tipPanel, BorderLayout.EAST); + } else { + imageLabel = new UILabel(UIManager.getIcon("OptionPane.informationIcon")); + messagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); + JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql_Message")); + messagePanel.add(label); + } + imagePanel.add(imageLabel); + + topPanel.add(imagePanel, BorderLayout.WEST); + topPanel.add(messagePanel, BorderLayout.CENTER); + topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); + + //中间的SQL面板 + centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + JScrollPane scrollPane = new JScrollPane(); + JTextArea checkArea = new JTextArea(sql); + checkArea.setEditable(false); + checkArea.setCursor(new Cursor(Cursor.TEXT_CURSOR)); + if (highlight) { + Highlighter highLighter = checkArea.getHighlighter(); + DefaultHighlighter.DefaultHighlightPainter p = new DefaultHighlighter.DefaultHighlightPainter(Color.ORANGE); + for (int[] specialCharIndex : selectedSpecialCharIndex) { + try { + highLighter.addHighlight(specialCharIndex[0], specialCharIndex[1], p); + } catch (BadLocationException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + scrollPane.setViewportView(checkArea); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + centerPanel.add(scrollPane); + + //底部的按钮面板 + UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); + okButton.addActionListener(this); + bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + bottomPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + bottomPanel.add(okButton, BorderLayout.EAST); + + this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql")); + this.setResizable(false); + this.add(topPanel, BorderLayout.NORTH); + this.add(centerPanel, BorderLayout.CENTER); + this.add(bottomPanel, BorderLayout.SOUTH); + this.setSize(600, 400); + this.addWindowListener(new WindowAdapter() { + @Override + public void windowClosing(WindowEvent e) { + close(); + } + }); + + GUICoreUtils.centerWindow(this); + } + + private boolean isNotShowLink() { + return GeneralContext.getLocale().equals(Locale.JAPAN) || GeneralContext.getLocale().equals(Locale.KOREA); + } + + public static void previewPerformedSql(DBTableData tableData) { + Calculator calculator = Calculator.createCalculator(); + //参数 + ParameterProvider[] parameters = DataOperator.getInstance().getTableDataParameters(tableData); + if (ArrayUtils.isEmpty(parameters)) { + parameters = tableData.getParameters(calculator); + } + Map parameterMap = new HashMap<>(); + if (needInputParams(parameters)) { + showParaWindow(parameterMap, parameters); + } else { + for (ParameterProvider parameter : parameters) { + parameterMap.put(parameter.getName(), parameter.getValue()); + } + } + for (ParameterProvider parameter : DataOperator.getInstance().getTableDataParameters(tableData)) { + if (parameterMap.containsKey(parameter.getName())) { + parameter.setValue(parameterMap.get(parameter.getName())); + } + } + String sql; + // 计算高亮文本位置 + List specialCharParamIndex = null; + boolean highlight = true; + NameSpace ns = ParameterMapNameSpace.create(parameterMap); + calculator.pushNameSpace(ns); + Parameter[] paras = processParameters(tableData, calculator); + // 所有被转义参数的集合 + refreshEscapeSqlHelper(); + Set specialCharParam = EscapeSqlHelper.getInstance().getSpecialCharParam(paras); + // 将参数转义等 + Set tableDataProviders = getTableDataProviders(); + for (TableDataProvider provider : tableDataProviders) { + provider.processParametersBeforeAnalyzeSQL(paras, calculator); + } + + if (!specialCharParam.isEmpty()) { + specialCharParamIndex = ParameterHelper.analyzeCurrentContextTableData4Template(tableData.getQuery(), paras, specialCharParam); + } + String oldSql = ParameterHelper.analyzeCurrentContextTableData4Templatee(tableData.getQuery(), paras); + sql = processExtraSQL(paras, oldSql, calculator, tableDataProviders); + if (!StringUtils.equals(oldSql, sql)) { + highlight = false; + } + // sql内容复制到剪切板 + StringSelection selection = new StringSelection(sql); + java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection); + // 弹窗 + if (isShowSpecialCharSqlPane(specialCharParamIndex)) { + showSpecialCharSqlPane(sql, specialCharParamIndex, highlight); + } else { + showNormalPreviewPane(sql); + } + } + + // 埋点方法 + private static void showNormalPreviewPane(String sql) { + PreviewPerformedSqlPane pane = new PreviewPerformedSqlPane(DesignerContext.getDesignerFrame(), sql); + pane.setVisible(true); + } + + // 埋点方法 + private static void showSpecialCharSqlPane(String sql, List specialCharParamIndex, boolean highlight) { + PreviewPerformedSqlPane pane = new PreviewPerformedSqlPane(DesignerContext.getDesignerFrame(), sql, specialCharParamIndex, ConfigService.getInstance().getPSIConfig().getSelectedSpecialChar(), highlight); + pane.setVisible(true); + } + + private static void refreshEscapeSqlHelper() { + EscapeSqlHelper.getInstance().setUseForbidWord(ConfigService.getInstance().getPSIConfig().isUseForbidWord()); + EscapeSqlHelper.getInstance().setSelectedForbidWord(ConfigService.getInstance().getPSIConfig().getSelectedForbidWord()); + EscapeSqlHelper.getInstance().setUseEscapeSpecialChar(ConfigService.getInstance().getPSIConfig().isUseEscapeSpecialChar()); + EscapeSqlHelper.getInstance().setSelectedSpecialChar(ConfigService.getInstance().getPSIConfig().getSelectedSpecialChar()); + } + + private static boolean isShowSpecialCharSqlPane(List specialCharParamIndex) { + return specialCharParamIndex != null && !specialCharParamIndex.isEmpty(); + } + + private static Parameter[] processParameters(DBTableData tableData, Calculator calculator) { + ParameterProvider[] parameters = tableData.getParameters(); + if (parameters == null || parameters.length == 0) { + tableData.setParameters(ParameterHelper.analyze4Parameters(tableData.getQuery(), false)); + return new Parameter[0]; + } + return Parameter.providers2Parameter(Calculator.processParameters(calculator, parameters)); + } + + private static String processExtraSQL(Parameter[] ps, String sql, Calculator ca, Set tableDataProviders) { + for (TableDataProvider provider : tableDataProviders) { + String newSql = provider.processTableDataSQL(ps, sql, ca); + if (StringUtils.isNotEmpty(newSql)) { + sql = newSql; + } + } + return sql; + } + + private static boolean needInputParams(ParameterProvider[] parameters) { + if (ArrayUtils.isNotEmpty(parameters)) { + return true; + } + for (ParameterProvider parameter : parameters) { + if (parameter.getValue() == null || StringUtils.EMPTY.equals(parameter.getValue())) { + return true; + } + } + return false; + } + + private static void showParaWindow(final Map parameterMap, ParameterProvider[] inParameters) { + final ParameterInputPane pPane = new ParameterInputPane(inParameters); + pPane.showSmallWindow(new JFrame(), new DialogActionAdapter() { + @Override + public void doOk() { + parameterMap.putAll(pPane.update()); + } + }).setVisible(true); + } + + private static Set getTableDataProviders() { + ExtraClassManagerProvider classManagerProvider = PluginModule.getAgent(PluginModule.ExtraCore); + if (classManagerProvider == null) { + return new HashSet<>(); + } + return classManagerProvider.getArray(TableDataProvider.XML_TAG, EscapeSqlHelper.getInstance()); + } + + @Override + public void actionPerformed(ActionEvent e) { + this.dispose(); + } + + private void close() { + this.dispose(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 6065d0485..fecf9c079 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -16,6 +16,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.data.datapane.connect.ConnectionTableProcedurePane; import com.fr.design.data.datapane.connect.ConnectionTableProcedurePane.DoubleClickSelectedNodeOnTreeListener; import com.fr.design.data.datapane.preview.PreviewTablePane; +import com.fr.design.data.datapane.preview.sql.PreviewPerformedSqlPane; import com.fr.design.data.datapane.sqlpane.SQLEditPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; @@ -35,6 +36,7 @@ import com.fr.design.menu.ToolBarDef; import com.fr.design.utils.ParameterUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.general.sql.SqlUtils; import com.fr.log.FineLoggerFactory; import com.fr.script.Calculator; @@ -227,6 +229,7 @@ public class DBTableDataPane extends AbstractTableDataPane { // p:工具栏. ToolBarDef toolBarDef = new ToolBarDef(); toolBarDef.addShortCut(new PreviewAction()); + toolBarDef.addShortCut(new PreviewPerformedSQLAction()); toolBarDef.addShortCut(SeparatorDef.DEFAULT); toolBarDef.addShortCut(new EditPageQueryAction()); dbTableDataMenuHandler = ExtraDesignClassManager.getInstance().getSingle(DBTableDataMenuHandler.MARK_STRING); @@ -368,6 +371,20 @@ public class DBTableDataPane extends AbstractTableDataPane { } } + private class PreviewPerformedSQLAction extends UpdateAction { + + public PreviewPerformedSQLAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview_Performed_Sql")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/preview_sql.png")); + } + + @Override + public void actionPerformed(ActionEvent e) { + checkParameter(); + PreviewPerformedSqlPane.previewPerformedSql(DBTableDataPane.this.updateBean()); + } + } + private class EditPageQueryAction extends UpdateAction { public EditPageQueryAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Layer_Page_Report_Page_Query")); diff --git a/designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java b/designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java new file mode 100644 index 000000000..b136f50c8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/dialog/NotificationDialog.java @@ -0,0 +1,240 @@ +package com.fr.design.dialog; + + +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.notification.Notification; +import com.fr.design.notification.NotificationCenter; +import com.fr.module.ModuleContext; +import com.fr.stable.StringUtils; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.ScrollPaneConstants; +import javax.swing.UIManager; + +/** + * 带查看详情的简要通知框 + */ +public class NotificationDialog extends JDialog { + public static final int ERROR_MESSAGE = 0; + public static final int NEW_MESSAGE = 1; + public static final int WARNING_MESSAGE = 2; + public static final String HTML_TAG_1 = ""; + public static final String HTML_TAG_2 = ""; + private static final String HIDE_MSG = "HIDE_MSG_TIMER"; + private UILabel messageText; + private NotificationDialogAction notificationDialogAction; + private ScheduledExecutorService TIMER; + + public NotificationDialog(Frame owner, String title, boolean isModal, int messageType, String message, NotificationDialogAction action) { + super(owner); + setTitle(title); + initComponents(StringUtils.EMPTY, messageType, message, isModal, action); + } + + public NotificationDialog(Builder builder) { + super(builder.owner); + setTitle(builder.title); + initComponents(builder.messageId, builder.messageType, builder.message, builder.modal, builder.action); + } + + public void initComponents(String messageId, int messageType, String message, boolean isModal, NotificationDialogAction action) { + NotificationCenter.getInstance().addNotification(new Notification(messageId, messageType, message, action)); + notificationDialogAction = action; + setModal(isModal); + setFocusable(false); + setAutoRequestFocus(false); + setResizable(false); + JPanel body = FRGUIPaneFactory.createBorderLayout_L_Pane(); + body.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + + //消息内容 + UILabel icon = new UILabel(getIconForType(messageType)); + JPanel iconPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + iconPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 8)); + iconPanel.add(icon); + body.add(iconPanel, BorderLayout.WEST); + + messageText = new UILabel(HTML_TAG_1 + message + HTML_TAG_2); + messageText.setForeground(new Color(51, 51, 52)); + JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + centerPanel.setBorder(BorderFactory.createEmptyBorder(8, 0, 5, 20)); + JScrollPane jScrollPane = new JScrollPane(messageText, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + jScrollPane.setBorder(BorderFactory.createEmptyBorder()); + centerPanel.add(jScrollPane, BorderLayout.CENTER); + centerPanel.setPreferredSize(new Dimension(230, 95)); + body.add(centerPanel, BorderLayout.CENTER); + + //查看详情 + UILabel detailLabel = new UILabel(); + detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); + detailLabel.setForeground(Color.BLUE); + JPanel detailPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + detailPanel.add(detailLabel, BorderLayout.EAST); + body.add(detailPanel, BorderLayout.SOUTH); + + detailLabel.addMouseListener(detailClickListener); + messageText.addMouseListener(detailClickListener); + addMouseListener(bodyMouseListener); + + add(body); + Dimension dimension = body.getPreferredSize(); + setSize(dimension.width, dimension.height); + setLocation((DesignerContext.getDesignerFrame().getWidth() - dimension.width - 30 + DesignerContext.getDesignerFrame().getX()), + DesignerContext.getDesignerFrame().getY() + DesignerContext.getDesignerFrame().getHeight() - dimension.height - 30); + disappear(); + } + + private MouseListener detailClickListener = new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (notificationDialogAction != null) { + hideDialog(); + notificationDialogAction.doClick(); + } + } + }; + + private MouseListener bodyMouseListener = new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + if (TIMER != null) { + TIMER.shutdownNow(); + } + } + + @Override + public void mouseExited(MouseEvent e) { + disappear(); + } + }; + + public void disappear() { + TIMER = createScheduleExecutorService(); + TIMER.schedule(new Runnable() { + @Override + public void run() { + hideDialog(); + } + }, 10000, TimeUnit.MILLISECONDS); + } + + private ScheduledExecutorService createScheduleExecutorService() { + return ModuleContext.getExecutor().newSingleThreadScheduledExecutor(new NamedThreadFactory(HIDE_MSG)); + } + + /** + * 设置通知消息 + */ + public void setMessage(String message) { + messageText.setText(HTML_TAG_1 + message + HTML_TAG_2); + } + + private void hideDialog() { + this.setVisible(false); + this.dispose(); + } + + protected Icon getIconForType(int messageType) { + String propertyName; + switch (messageType) { + case 0: + propertyName = "OptionPane.circularErrorIcon"; + break; + case 1: + propertyName = "OptionPane.newMessageIcon"; + break; + case 2: + propertyName = "OptionPane.circularWarningIcon"; + break; + default: + return null; + } + return UIManager.getIcon(propertyName); + } + + public static Builder Builder() { + return new NotificationDialog.Builder(); + } + + public static final class Builder { + public int messageType = WARNING_MESSAGE; + public String messageId; + public String message; + public boolean modal = true; + public Frame owner = null; + public String title; + public NotificationDialogAction action; + + private Builder() { + + } + + public NotificationDialog build() { + return new NotificationDialog(this); + } + + public Builder messageId(String messageId) { + this.messageId = messageId; + return this; + } + + public Builder owner(Frame owner) { + this.owner = owner; + return this; + } + + public Builder messageType(int messageType) { + this.messageType = messageType; + return this; + } + + public Builder message(String message) { + this.message = message; + return this; + } + + public Builder modal(boolean modal) { + this.modal = modal; + return this; + } + + public Builder title(String title) { + this.title = title; + return this; + } + + public Builder notificationDialogAction(NotificationDialogAction action) { + this.action = action; + return this; + } + } + + public static void defaultPopup(String messageId, String title, String body, NotificationDialogAction action) { + NotificationDialog.Builder() + .messageId(messageId) + .owner(DesignerContext.getDesignerFrame()) + .title(title) + .modal(false) + .messageType(NotificationDialog.NEW_MESSAGE) + .message(body) + .notificationDialogAction(action) + .build() + .setVisible(true); + } +} diff --git a/designer-base/src/main/java/com/fr/design/dialog/NotificationDialogAction.java b/designer-base/src/main/java/com/fr/design/dialog/NotificationDialogAction.java new file mode 100644 index 000000000..350354cf4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/dialog/NotificationDialogAction.java @@ -0,0 +1,8 @@ +package com.fr.design.dialog; + +public interface NotificationDialogAction { + + String name(); + + void doClick(); +} diff --git a/designer-base/src/main/java/com/fr/design/dialog/UIExpandDialog.java b/designer-base/src/main/java/com/fr/design/dialog/UIExpandDialog.java new file mode 100644 index 000000000..328b59f72 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/dialog/UIExpandDialog.java @@ -0,0 +1,337 @@ +package com.fr.design.dialog; + +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextarea.UITextArea; +import com.fr.design.i18n.Toolkit; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.UIManager; +import java.awt.BorderLayout; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +/** + * 可展开对话框 + * + *
+ *  UIExpandDialog.Builder()
+ *                  .owner(jf)
+ *                  .title("title")
+ *                  .messageType(UIExpandDialog.WARNING_MESSAGE)
+ *                  .message("message text")
+ *                  .detail("detail")
+ *                  .expand(false)
+ *                  .modal(false)
+ *                  .dialogActionListener(new DialogActionAdapter(){
+ *                      public void doOk() {
+ *                          System.out.println("OK");
+ *                      }
+ *                  }).build().setVisible(true);
+ *  
+ * + * @author vito + * @version 10.0 + * Created by vito on 2021/5/19 + */ +public class UIExpandDialog extends UIDialog { + public static final int MARGIN = 10; + public static final int TEXT_AREA_ROW = 5; + public static final int GAP = 5; + + public static final int ERROR_MESSAGE = 0; + public static final int INFORMATION_MESSAGE = 1; + public static final int WARNING_MESSAGE = 2; + public static final int QUESTION_MESSAGE = 3; + + public static final String HTML_TAG_1 = ""; + public static final String HTML_TAG_2 = ""; + + private final JPanel foldBar = new JPanel(); + private final JPanel expandableContentPane = new JPanel(); + private final UILabel narrow = new UILabel(); + private final UILabel narrowHit = new UILabel(); + private final UIButton buttonOK; + private UIButton buttonCancel = null; + private JLabel msg; + private final UITextArea textArea = new UITextArea(); + + public UIExpandDialog(Frame owner, String title, boolean isModal, + int messageType, String message, String detail, + String okText, String cancelText, boolean isExpand) { + super(owner); + buttonOK = new UIButton(okText); + if (!StringUtils.isEmpty(cancelText)) { + buttonCancel = new UIButton(cancelText); + } + setTitle(title); + setModal(isModal); + initComponents(messageType, message, detail, isModal, isExpand, null); + } + + public UIExpandDialog(Builder builder) { + super(builder.owner); + buttonOK = new UIButton(builder.okText); + if (!StringUtils.isEmpty(builder.cancelText)) { + buttonCancel = new UIButton(builder.cancelText); + } + setTitle(builder.title); + setModal(builder.modal); + initComponents(builder.messageType, builder.message, builder.detail, + builder.modal, builder.expand, builder.dialogActionListener); + } + + public void initComponents(int messageType, String message, String detail, + boolean isModal, boolean isExpand, DialogActionListener l) { + applyClosingAction(); + setLayout(new BorderLayout(GAP, GAP)); + setResizable(false); + setModal(isModal); + getRootPane().setDefaultButton(buttonOK); + + // 标题面板 + UILabel icon = new UILabel(getIconForType(messageType)); + msg = new JLabel(HTML_TAG_1 + message + HTML_TAG_2); + msg.setPreferredSize(new Dimension(300, 50)); + JPanel mainMsg = new JPanel(); + mainMsg.setLayout(new FlowLayout(FlowLayout.LEFT, MARGIN, MARGIN)); + mainMsg.setPreferredSize(new Dimension(380, 60)); + mainMsg.add(icon); + mainMsg.add(msg); + add(mainMsg, BorderLayout.NORTH); + + // 内容面板 + JPanel contentPanel = new JPanel(); + contentPanel.setLayout(new BorderLayout(GAP, GAP)); + foldBar.setLayout(new FlowLayout(FlowLayout.LEFT, MARGIN, 0)); + foldBar.add(narrow); + foldBar.add(narrowHit); + contentPanel.add(foldBar, BorderLayout.NORTH); + + textArea.setEditable(false); + textArea.setRows(TEXT_AREA_ROW); + textArea.setMargin(new Insets(GAP, GAP, GAP, GAP)); + textArea.setEditable(false); + textArea.setText(detail); + UIScrollPane scrollPane = new UIScrollPane(textArea); + expandableContentPane.setLayout(new BorderLayout()); + expandableContentPane.setBorder(BorderFactory.createEmptyBorder(0, MARGIN, 0, MARGIN)); + expandableContentPane.add(scrollPane, BorderLayout.CENTER); + changeExpand(isExpand); + contentPanel.add(expandableContentPane, BorderLayout.CENTER); + add(contentPanel, BorderLayout.CENTER); + + + // 操作面板 + JPanel actionPanel = new JPanel(); + actionPanel.setLayout(new FlowLayout(FlowLayout.CENTER, MARGIN, MARGIN)); + if (buttonCancel != null) { + actionPanel.add(buttonCancel); + } + actionPanel.add(buttonOK); + add(actionPanel, BorderLayout.SOUTH); + + initListener(); + if (l != null) { + addDialogActionListener(l); + } + pack(); + if (getOwner() != null) { + GUICoreUtils.setWindowCenter(getOwner(), this); + } + + } + + private void changeExpand(boolean isExpand) { + if (isExpand) { + expandableContentPane.setVisible(true); + narrow.setIcon(UIManager.getIcon("OptionPane.narrow.down")); + narrowHit.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail")); + } else { + expandableContentPane.setVisible(false); + narrow.setIcon(UIManager.getIcon("OptionPane.narrow.right")); + narrowHit.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); + } + } + + private void initListener() { + + foldBar.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + changeExpand(!expandableContentPane.isShowing()); + pack(); + } + + @Override + public void mouseEntered(MouseEvent e) { + foldBar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } + + @Override + public void mouseExited(MouseEvent e) { + foldBar.setCursor(Cursor.getDefaultCursor()); + } + }); + buttonOK.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + doOK(); + } + }); + + if (buttonCancel != null) { + buttonCancel.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + doCancel(); + } + }); + } + } + + protected Icon getIconForType(int messageType) { + if (messageType < 0 || messageType > 3) + return null; + String propertyName; + switch (messageType) { + case 0: + propertyName = "OptionPane.errorIcon"; + break; + case 1: + default: + propertyName = "OptionPane.informationIcon"; + break; + case 2: + propertyName = "OptionPane.warningIcon"; + break; + case 3: + propertyName = "OptionPane.questionIcon"; + break; + } + return UIManager.getIcon(propertyName); + } + + /** + * 设置对话框主消息 + * + * @param message 消息内容 + */ + public void setMessage(String message) { + msg.setText(HTML_TAG_1 + message + HTML_TAG_2); + } + + /** + * 设置对话框消息详情 + * + * @param detail 消息详情 + */ + public void setDetail(String detail) { + textArea.setText(detail); + } + + /** + * 设置详情面板展开关闭 + * + * @param expand 展开或关闭 + */ + public void setExpand(boolean expand) { + changeExpand(expand); + } + + @Override + public void setVisible(boolean b) { + super.setVisible(b); + } + + public static Builder Builder() { + return new UIExpandDialog.Builder(); + } + + public static final class Builder { + + public int messageType = ERROR_MESSAGE; + public String title; + public String message; + public String detail; + public String okText = Toolkit.i18nText("Fine-Design_Report_OK"); + public String cancelText = Toolkit.i18nText("Fine-Design_Basic_Cancel"); + public boolean modal = true; + public boolean expand = true; + public Frame owner = null; + public DialogActionListener dialogActionListener = null; + + private Builder() { + } + + public UIExpandDialog build() { + return new UIExpandDialog(this); + } + + public Builder owner(Frame owner) { + this.owner = owner; + return this; + } + + public Builder messageType(int messageType) { + this.messageType = messageType; + return this; + } + + public Builder title(String title) { + this.title = title; + return this; + } + + public Builder message(String message) { + this.message = message; + return this; + } + + public Builder detail(String detail) { + this.detail = detail; + return this; + } + + public Builder okText(String okText) { + this.okText = okText; + return this; + } + + public Builder cancelText(String cancelText) { + this.cancelText = cancelText; + return this; + } + + public Builder modal(boolean modal) { + this.modal = modal; + return this; + } + + public Builder expand(boolean expand) { + this.expand = expand; + return this; + } + + public Builder dialogActionListener(DialogActionListener dialogActionListener) { + this.dialogActionListener = dialogActionListener; + return this; + } + } + + @Override + public void checkValid() throws Exception { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/dialog/link/MessageWithLink.java b/designer-base/src/main/java/com/fr/design/dialog/link/MessageWithLink.java index 889a0c3c9..f73ec77df 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/link/MessageWithLink.java +++ b/designer-base/src/main/java/com/fr/design/dialog/link/MessageWithLink.java @@ -3,13 +3,14 @@ package com.fr.design.dialog.link; import com.fr.design.gui.ilable.UILabel; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; + +import javax.swing.JEditorPane; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; import java.awt.Color; import java.awt.Desktop; import java.awt.Font; import java.net.URI; -import javax.swing.JEditorPane; -import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; /** * 用来构建JOptionPane带超链的消息提示 @@ -35,8 +36,16 @@ public class MessageWithLink extends JEditorPane { this(message, linkName, link, color, LABEL.getFont()); } + public MessageWithLink(String frontMessage, String linkName, String link, String backMessage) { + this(frontMessage, linkName, link, backMessage, LABEL.getBackground(), LABEL.getFont()); + } + public MessageWithLink(String message, String linkName, String link, Color color, Font font) { - super("text/html", "" + message + "" + linkName + "" + ""); + this(message, linkName, link, StringUtils.EMPTY, color, font); + } + + public MessageWithLink(String frontMessage, String linkName, String link, String backMessage, Color color, Font font) { + super("text/html", "" + frontMessage + "" + linkName + "" + backMessage + ""); initListener(link); setEditable(false); setBorder(null); diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java index f31954964..24b79e418 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteWorkspace.java @@ -34,11 +34,20 @@ public class RemoteWorkspace implements Workspace { private volatile Boolean warDeploy; + private final SwingWorker swingWorker; + RemoteWorkspace(WorkspaceClient client, WorkspaceConnectionInfo connection) { this.client = client; this.address = connection.getUrl(); this.connection = connection; + this.swingWorker = new SwingWorker() { + @Override + protected Void doInBackground() throws Exception { + client.close(); + return null; + } + }; } @Override @@ -125,13 +134,7 @@ public class RemoteWorkspace implements Workspace { @Override public void close() { - new SwingWorker() { - @Override - protected Void doInBackground() throws Exception { - client.close(); - return null; - } - }.execute(); + swingWorker.execute(); } @Override diff --git a/designer-base/src/main/java/com/fr/design/extra/LoginContextListener.java b/designer-base/src/main/java/com/fr/design/extra/LoginContextListener.java index ca1354443..50d9c1a01 100644 --- a/designer-base/src/main/java/com/fr/design/extra/LoginContextListener.java +++ b/designer-base/src/main/java/com/fr/design/extra/LoginContextListener.java @@ -1,8 +1,10 @@ package com.fr.design.extra; +import com.fr.design.login.DesignerLoginSource; + /** * Created by lp on 2016/8/16. */ public interface LoginContextListener { - void showLoginContext(); + void showLoginContext(DesignerLoginSource source); } diff --git a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java index 81e34335a..0ec65001c 100644 --- a/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java +++ b/designer-base/src/main/java/com/fr/design/extra/LoginWebBridge.java @@ -1,13 +1,15 @@ package com.fr.design.extra; -import com.fr.base.passport.FinePassportManager; import com.fr.concurrent.NamedThreadFactory; import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.UIDialog; import com.fr.design.extra.exe.PluginLoginExecutor; import com.fr.design.gui.ilable.UILabel; import com.fr.design.locale.impl.BbsRegisterMark; import com.fr.design.locale.impl.BbsResetMark; +import com.fr.design.login.service.DesignerLoginClient; +import com.fr.design.login.service.DesignerLoginResult; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; import com.fr.general.locale.LocaleCenter; @@ -80,17 +82,15 @@ public class LoginWebBridge { */ public void setMessageCount(int count) { if (count == MIN_MESSAGE_COUNT) { - uiLabel.setText(MarketConfig.getInstance().getBbsUsername()); - MarketConfig.getInstance().setInShowBBsName(MarketConfig.getInstance().getBbsUsername()); + MarketConfig.getInstance().setInShowBBsName(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()); return; } this.messageCount = count; StringBuilder sb = new StringBuilder(); - sb.append(StringUtils.BLANK).append(MarketConfig.getInstance().getBbsUsername()) + sb.append(StringUtils.BLANK).append(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()) .append("(").append(this.messageCount) .append(")").append(StringUtils.BLANK); MarketConfig.getInstance().setInShowBBsName(sb.toString()); - uiLabel.setText(sb.toString()); } public void setQQDialog(UIDialog qqDialog) { @@ -163,20 +163,11 @@ public class LoginWebBridge { * @return 登录信息标志 */ public String login(String userInfo, String password) { - if (!StringUtils.isNotBlank(userInfo) && !StringUtils.isNotBlank(password)) { - return LOGIN_INFO_EMPTY; - } - if (!testConnection()) { - return NET_FAILED; - } - int uid = 0; - try { - uid = FinePassportManager.getInstance().login(userInfo, password); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + DesignerLoginClient client = new DesignerLoginClient(); + DesignerLoginResult result = client.login(userInfo, password); + int uid = result.getUid(); if (uid > 0) { - loginSuccess(MarketConfig.getInstance().getBbsUsername()); + closeWindow(); } return String.valueOf(uid); } @@ -191,17 +182,6 @@ public class LoginWebBridge { } } - /** - * 关闭窗口并且重新赋值 - * - * @param username 用户名 - */ - private void loginSuccess(String username) { - closeWindow(); - uiLabel.setText(username); - uiLabel.setBackground(LOGIN_BACKGROUND); - } - /** * 关闭QQ授权窗口 */ diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java b/designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java index 5f76dbafc..4a6d5e0dc 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginFromStorePane.java @@ -1,6 +1,6 @@ package com.fr.design.extra; -import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.tradition.callback.UpdateOnlineCallback; import com.fr.design.gui.frpane.UITabbedPane; @@ -9,6 +9,7 @@ import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.plugin.context.PluginMarker; import com.fr.plugin.manage.PluginManager; +import com.fr.plugin.manage.control.PluginExtraInfo; import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.manage.control.ProgressCallback; import com.fr.plugin.view.PluginView; @@ -190,10 +191,10 @@ public class PluginFromStorePane extends PluginAbstractLoadingViewPane config; private WebEngine webEngine; - private UILabel uiLabel; - private ExecutorService threadPoolExecutor = new ThreadPoolExecutor(COREPOOLSIZE, MAXPOOLSIZE, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(COREPOOLSIZE), @@ -423,7 +420,7 @@ public class PluginWebBridge { */ public String getLoginInfo(final JSObject callback) { registerLoginInfo(callback); - return MarketConfig.getInstance().getBbsUsername(); + return DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); } /** @@ -433,7 +430,7 @@ public class PluginWebBridge { */ public void registerLoginInfo(final JSObject callback) { JSCallback jsCallback = new JSCallback(PluginJavaFxExecutor.create(webEngine, callback)); - PluginOperateUtils.getLoginInfo(jsCallback, uiLabel); + PluginOperateUtils.getLoginInfo(jsCallback); } /** @@ -455,7 +452,7 @@ public class PluginWebBridge { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { - UserLoginContext.fireLoginContextListener(); + UserLoginContext.fireLoginContextListener(DesignerLoginSource.NORMAL); } }); } @@ -526,10 +523,6 @@ public class PluginWebBridge { } } - public void setUILabel(UILabel uiLabel) { - this.uiLabel = uiLabel; - } - /** * 设计器端的用户登录 * @@ -546,7 +539,7 @@ public class PluginWebBridge { * 通过QQ登录后通知登录 */ public void ucsynLogin(long uid, String username, String password, final JSONObject callback) { - uiLabel.setText(username); + } /** @@ -554,8 +547,6 @@ public class PluginWebBridge { */ public void clearUserInfo() { MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY); - FinePassportManager.getInstance().logout(); - uiLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_UnSignIn")); } public void getPackInfo(final JSObject callback){ diff --git a/designer-base/src/main/java/com/fr/design/extra/UserLoginContext.java b/designer-base/src/main/java/com/fr/design/extra/UserLoginContext.java index 354a9177f..6f41c3340 100644 --- a/designer-base/src/main/java/com/fr/design/extra/UserLoginContext.java +++ b/designer-base/src/main/java/com/fr/design/extra/UserLoginContext.java @@ -1,5 +1,6 @@ package com.fr.design.extra; +import com.fr.design.login.DesignerLoginSource; import java.util.ArrayList; /** @@ -11,9 +12,9 @@ public class UserLoginContext { /** * 触发登录框弹出的监听器 */ - public static void fireLoginContextListener() { + public static void fireLoginContextListener(DesignerLoginSource source) { for (LoginContextListener l : fireLoginContextListener) { - l.showLoginContext(); + l.showLoginContext(source); } } diff --git a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java index 628adfec6..f35fbdf11 100644 --- a/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java @@ -5,6 +5,7 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.frpane.UITabbedPane; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.general.CloudCenter; import com.fr.general.CommonIOUtils; @@ -206,6 +207,7 @@ public class WebViewDlgHelper { UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane); PluginWebBridge.getHelper().setDialogHandle(dlg); dlg.setVisible(true); + DesignerLoginUtils.showPluginRemindOnFirstLaunch(dlg); } catch (Exception e) { // ignored FineLoggerFactory.getLogger().error(e.getMessage(), e); diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/PluginLoginExecutor.java b/designer-base/src/main/java/com/fr/design/extra/exe/PluginLoginExecutor.java index 1ce13f25c..7c6de0e06 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/PluginLoginExecutor.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/PluginLoginExecutor.java @@ -2,6 +2,7 @@ package com.fr.design.extra.exe; import com.fr.design.extra.LoginWebBridge; import com.fr.design.extra.Process; +import com.fr.design.login.service.DesignerPassportManager; /** * @author vito @@ -34,7 +35,11 @@ public class PluginLoginExecutor implements Executor { @Override public void run(Process process) { - result = LoginWebBridge.getHelper().login(username, password); + int uid = DesignerPassportManager.getInstance().login(username, password); + if (uid > 0) { + LoginWebBridge.getHelper().closeWindow(); + } + result = String.valueOf(uid); } } }; diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index 4c94a9f42..0b1eb33fb 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -1,6 +1,7 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; +import com.fr.design.bridge.exec.JSExecutor; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.i18n.Toolkit; @@ -17,17 +18,22 @@ import com.fr.plugin.manage.control.PluginTaskResult; * Created by ibm on 2017/5/26. */ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { - protected JSCallback jsCallback; + protected JSCallback jsCallback = new JSCallback(JSExecutor.DEFAULT); + private static int HUNDRED_PERCENT = 100; - public InstallOnlineCallback(PluginTask pluginTask, JSCallback jsCallback){ + public InstallOnlineCallback(PluginTask pluginTask) { + super(pluginTask); + } + + public InstallOnlineCallback(PluginTask pluginTask, JSCallback jsCallback) { super(pluginTask); this.jsCallback = jsCallback; } @Override public void updateProgress(String description, double aProgress) { - jsCallback.execute(String.valueOf(aProgress * HUNDRED_PERCENT + "%")); + jsCallback.execute(aProgress * HUNDRED_PERCENT + "%"); } @@ -37,10 +43,10 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { if (result.isSuccess()) { String switchedInfo = PluginOperateUtils.getSwitchedInfo(result); jsCallback.execute("success"); - String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo; + String successInfo = pluginInfo + Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Success") + switchedInfo; FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); - } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ + } else if (result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall) { int rv = FineJOptionPane.showConfirmDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), @@ -51,8 +57,7 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { if (rv == FineJOptionPane.OK_OPTION) { PluginMarker pluginMarker = result.getCurrentTask().getMarker(); PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); - } - else { + } else { jsCallback.execute("success"); } } else { @@ -63,5 +68,4 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { } - } diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java index 78e338f8c..434be685d 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/ModifyStatusCallback.java @@ -1,6 +1,7 @@ package com.fr.design.extra.exe.callback; import com.fr.design.bridge.exec.JSCallback; +import com.fr.design.bridge.exec.JSExecutor; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.extra.PluginOperateUtils; import com.fr.design.i18n.Toolkit; @@ -15,14 +16,20 @@ import javax.swing.JOptionPane; /** * Created by ibm on 2017/5/27. */ -public class ModifyStatusCallback implements PluginTaskCallback{ +public class ModifyStatusCallback implements PluginTaskCallback { private boolean isActive; - private JSCallback jsCallback; + private JSCallback jsCallback = new JSCallback(JSExecutor.DEFAULT); + ; - public ModifyStatusCallback (boolean isActive, JSCallback jsCallback){ + public ModifyStatusCallback(boolean isActive) { + this.isActive = isActive; + } + + public ModifyStatusCallback(boolean isActive, JSCallback jsCallback) { this.isActive = isActive; this.jsCallback = jsCallback; } + @Override public void done(PluginTaskResult result) { String pluginInfo = PluginOperateUtils.getSuccessInfo(result); diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 9fa676f94..87b7f2f25 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -706,7 +706,7 @@ public class MutilTempalteTabPane extends JComponent { closeTpl(specifiedTemplate); } }); - worker.start(specifiedTemplate.getTarget().getTemplateID()); + worker.start(specifiedTemplate.getRuntimeId()); } else if (returnVal == JOptionPane.NO_OPTION) { closeTpl(specifiedTemplate); } diff --git a/designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java b/designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java index c04d80634..6c998f4ef 100644 --- a/designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java +++ b/designer-base/src/main/java/com/fr/design/file/filter/ClassFilter.java @@ -5,6 +5,8 @@ import java.util.HashSet; import java.util.Set; /** + * classloader查找过滤器 + * * 过滤无需遍历的jdk class * * @author hades @@ -26,6 +28,7 @@ public class ClassFilter implements Filter { FILTER_SET.add("java.awt.image.BufferedImage"); FILTER_SET.add("sun.awt.AppContext"); FILTER_SET.add("com.fr.poly.creator.ECBlockCreator"); + FILTER_SET.add("com.fr.form.ui.ElementCaseImage"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java b/designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java index 4dbbc1af3..488cbad37 100644 --- a/designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java +++ b/designer-base/src/main/java/com/fr/design/gui/UILookAndFeel.java @@ -176,7 +176,12 @@ public class UILookAndFeel extends MetalLookAndFeel { table.put("OptionPane.narrow.right", loadIcon("Icon_Narrow_Right_16x16.png", this)); table.put("OptionPane.narrow.down", loadIcon("Icon_Narrow_Down_16x16.png", this)); table.put("OptionPane.warningIcon", loadIcon("WarningIcon.png", this)); + table.put("OptionPane.circularWarningIcon", loadIcon("circularWarningIcon.png", this)); + table.put("OptionPane.newMessageIcon", loadIcon("newMessageIcon.png", this)); + table.put("OptionPane.circularErrorIcon", loadIcon("circularErrorIcon.png", this)); + table.put("OptionPane.deleteIcon", loadIcon("deleteIcon.png", this)); table.put("OptionPane.questionIcon", loadIcon("QuestionIcon.png", this)); + table.put("OptionPane.tipIcon", loadIcon("TipIcon.png", this)); table.put("ScrollPane.border", new UIScrollPaneBorder()); table.put("ProgressBar.border", new UIProgressBarBorder()); table.put("Spinner.border", new UITextFieldBorder(new Insets(2, 2, 2, 2))); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java index c5d2a51dd..094ef1c22 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/CommonShortCutHandlers.java @@ -21,11 +21,9 @@ import java.util.Comparator; */ public class CommonShortCutHandlers { ListControlPaneProvider listControlPane; - JNameEdList nameableList; private CommonShortCutHandlers(ListControlPaneProvider listControlPane) { this.listControlPane = listControlPane; - this.nameableList = listControlPane.getNameableList(); } public static CommonShortCutHandlers newInstance(ListControlPaneProvider listControlPane) { @@ -43,19 +41,19 @@ public class CommonShortCutHandlers { public void onRemoveItem() { try { - nameableList.getCellEditor() + listControlPane.getNameableList().getCellEditor() .stopCellEditing(); } catch (Exception ignored) { } if (GUICoreUtils.removeJListSelectedNodes(SwingUtilities - .getWindowAncestor((Component) listControlPane), nameableList)) { + .getWindowAncestor((Component) listControlPane), listControlPane.getNameableList())) { listControlPane.checkButtonEnabled(); } } public void onCopyItem() { // p:选中的值. - ListModelElement selectedValue = (ListModelElement) nameableList.getSelectedValue(); + ListModelElement selectedValue = (ListModelElement) listControlPane.getNameableList().getSelectedValue(); if (selectedValue == null) { return; } @@ -76,47 +74,51 @@ public class CommonShortCutHandlers { } public void onMoveUpItem() { - int selectedIndex = nameableList.getSelectedIndex(); + int selectedIndex = listControlPane.getNameableList().getSelectedIndex(); if (selectedIndex == -1) { return; } // 上移 if (selectedIndex > 0) { - DefaultListModel listModel = (DefaultListModel) nameableList.getModel(); + DefaultListModel listModel = (DefaultListModel) listControlPane.getNameableList().getModel(); Object selecteObj1 = listModel.get(selectedIndex - 1); listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); listModel.set(selectedIndex, selecteObj1); - nameableList.setSelectedIndex(selectedIndex - 1); - nameableList.ensureIndexIsVisible(selectedIndex - 1); + listControlPane.getNameableList().setSelectedIndex(selectedIndex - 1); + listControlPane.getNameableList().ensureIndexIsVisible(selectedIndex - 1); } } public void onMoveDownItem() { - int selectedIndex = nameableList.getSelectedIndex(); + int selectedIndex = listControlPane.getNameableList().getSelectedIndex(); if (selectedIndex == -1) { return; } - if (selectedIndex < nameableList.getModel().getSize() - 1) { - DefaultListModel listModel = (DefaultListModel) nameableList + if (selectedIndex < listControlPane.getNameableList().getModel().getSize() - 1) { + DefaultListModel listModel = (DefaultListModel) listControlPane.getNameableList() .getModel(); Object selecteObj1 = listModel.get(selectedIndex + 1); listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); listModel.set(selectedIndex, selecteObj1); - nameableList.setSelectedIndex(selectedIndex + 1); - nameableList.ensureIndexIsVisible(selectedIndex + 1); + listControlPane.getNameableList().setSelectedIndex(selectedIndex + 1); + listControlPane.getNameableList().ensureIndexIsVisible(selectedIndex + 1); } } public void onSortItem(boolean isAtoZ) { + onSortItem(isAtoZ, listControlPane.getNameableList()); + } + + public void onSortItem(boolean isAtoZ, JNameEdList nameEdList) { // p:选中的值. - Object selectedValue = nameableList.getSelectedValue(); + Object selectedValue = nameEdList.getSelectedValue(); - DefaultListModel listModel = (DefaultListModel) nameableList + DefaultListModel listModel = (DefaultListModel) nameEdList .getModel(); Nameable[] nameableArray = new Nameable[listModel.getSize()]; if (nameableArray.length <= 0) { @@ -156,12 +158,12 @@ public class CommonShortCutHandlers { // p:需要选中以前的那个值. if (selectedValue != null) { - nameableList.setSelectedValue(selectedValue, true); + nameEdList.setSelectedValue(selectedValue, true); } listControlPane.checkButtonEnabled(); // p:需要repaint. - nameableList.repaint(); + nameEdList.repaint(); } private String createUnrepeatedCopyName(String suffix) { diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java index 76255d96b..7fe1a27ef 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/ListControlPaneHelper.java @@ -4,18 +4,41 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; +import com.fr.design.gui.ilist.UINameEdList; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.os.impl.PopupDialogSaveAction; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.event.Listener; +import com.fr.general.NameObject; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; +import com.fr.stable.os.support.OSSupportCenter; import javax.swing.DefaultListModel; -import javax.swing.JOptionPane; +import javax.swing.JList; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; import java.awt.Component; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.InputEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * 存放一些公用的方法 * Created by plough on 2018/8/13. */ class ListControlPaneHelper { + private static final int EDIT_RANGE = 25; // 编辑按钮的x坐标范围 + private ListControlPaneProvider listControlPane; private ListControlPaneHelper(ListControlPaneProvider listControlPane) { @@ -110,4 +133,123 @@ class ListControlPaneHelper { } + protected void popupEditDialog(Point mousePos, UINameEdList nameableList, UIControlPane controlPane) { + int editingIndex = nameableList.getSelectedIndex(); + Rectangle currentCellBounds = nameableList.getCellBounds(editingIndex, editingIndex); + if (editingIndex < 0 || (mousePos != null && !currentCellBounds.contains(mousePos))) { + return; + } + Window popupEditDialog = controlPane.getPopupEditDialog(); + popupEditDialog.setLocation(getPopupDialogLocation(nameableList, popupEditDialog)); + if (popupEditDialog instanceof UIControlPane.PopupEditDialog) { + ((UIControlPane.PopupEditDialog) popupEditDialog).setTitle(getSelectedName()); + } + popupEditDialog.setVisible(true); + PopupDialogSaveAction osBasedAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); + osBasedAction.register(controlPane, popupEditDialog); + } + + private Point getPopupDialogLocation(UINameEdList nameableList, Window popupEditDialog) { + Point resultPos = new Point(0, 0); + Point listPos = nameableList.getLocationOnScreen(); + resultPos.x = listPos.x - popupEditDialog.getWidth(); + resultPos.y = listPos.y + (nameableList.getSelectedIndex() - 1) * EDIT_RANGE; + + // 当对象在屏幕上的位置比较靠下时,往下移动弹窗至与属性面板平齐 + Window frame = DesignerContext.getDesignerFrame(); + // 不能太低 + int maxY = frame.getLocationOnScreen().y + frame.getHeight() - popupEditDialog.getHeight(); + if (resultPos.y > maxY) { + resultPos.y = maxY; + } + // 也不能太高 + int minY = frame.getLocationOnScreen().y + EDIT_RANGE; + if (resultPos.y < minY) { + resultPos.y = minY; + } + + // 当在左侧显示不下时,在右侧弹出弹窗 + if (resultPos.x < 0) { + resultPos.x = listPos.x + nameableList.getParent().getWidth(); + } + // 如果右侧显示不下,可以向左移动 + int maxX = frame.getLocationOnScreen().x + frame.getWidth() - popupEditDialog.getWidth() - EDIT_RANGE; + if (resultPos.x > maxX) { + resultPos.x = maxX; + } + + return resultPos; + } + + /* + * UINameEdList的鼠标事件 + */ + protected MouseListener getListMouseListener(UINameEdList nameableList, UIControlPane controlPane) { + return new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent evt) { + nameableList.stopEditing(); + if (evt.getClickCount() >= 2 + && SwingUtilities.isLeftMouseButton(evt) && evt.getX() > EDIT_RANGE) { + nameableList.editItemAt(nameableList.getSelectedIndex()); + } else if (SwingUtilities.isLeftMouseButton(evt) && evt.getX() <= EDIT_RANGE) { + popupEditDialog(evt.getPoint(), nameableList, controlPane); + } + + // peter:处理右键的弹出菜单 + if (!SwingUtilities.isRightMouseButton(evt)) { + return; + } + + // peter: 注意,在checkButtonEnabled()方法里面,设置了所有的Action的Enabled. + checkButtonEnabled(); + + // p:右键菜单. + JPopupMenu popupMenu = new JPopupMenu(); + + for (ShortCut4JControlPane sj : listControlPane.getShorts()) { + sj.getShortCut().intoJPopupMenu(popupMenu); + } + + // peter: 只有弹出菜单有子菜单的时候,才需要弹出来. + GUICoreUtils.showPopupMenu(popupMenu, nameableList, evt.getX() - 1, + evt.getY() - 1); + } + + @Override + public void mouseClicked(MouseEvent e) { + JList list = (JList) e.getSource(); + if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown() + && !isMenuShortcutKeyDown(e)) { + list.clearSelection(); + } + } + + private boolean isMenuShortcutKeyDown(InputEvent event) { + return (event.getModifiers() & Toolkit.getDefaultToolkit() + .getMenuShortcutKeyMask()) != 0; + } + + @Override + public void mouseMoved(MouseEvent e) { + + } + }; + } + + public Map> processCatalog(List nameObjectList) { + Map> map = new HashMap<>(); + for (NameObject nameObject : nameObjectList) { + Listener listener = (Listener) nameObject.getObject(); + if (StringUtils.isNotEmpty(listener.getName())) { + nameObject.setName(listener.getName()); + } + List list = map.computeIfAbsent(listener.getEventName(), k -> new ArrayList<>()); + list.add(nameObject); + } + return map; + } + + + } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 04427b337..b15b9eab9 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -49,7 +49,7 @@ import java.awt.event.WindowEvent; /** * Created by plough on 2017/7/21. */ -abstract class UIControlPane extends JControlPane { +public abstract class UIControlPane extends JControlPane { private UIToolbar topToolBar; protected Window popupEditDialog; private static final int TOP_TOOLBAR_HEIGHT = 20; @@ -78,7 +78,7 @@ abstract class UIControlPane extends JControlPane { initCardPane(); if (isNewStyle()) { - getPopupEditDialog(cardPane); + createPopupEditDialog(cardPane); this.add(getLeftPane(), BorderLayout.CENTER); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 15, 10)); } else { @@ -100,7 +100,11 @@ abstract class UIControlPane extends JControlPane { this.checkButtonEnabled(); } - private void getPopupEditDialog(JPanel cardPane) { + protected Window getPopupEditDialog(){ + return this.popupEditDialog; + } + + private void createPopupEditDialog(JPanel cardPane) { popupEditDialog = new PopupEditDialog(cardPane); } @@ -400,4 +404,4 @@ abstract class UIControlPane extends JControlPane { return new Dimension(super.getPreferredSize().width, 28); } } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index ec76f5bf7..b7b8674be 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -6,32 +6,18 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.UINameEdList; -import com.fr.design.mainframe.DesignerContext; -import com.fr.design.os.impl.PopupDialogSaveAction; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; -import com.fr.stable.os.support.OSSupportCenter; import javax.swing.DefaultListModel; -import javax.swing.JList; import javax.swing.JPanel; -import javax.swing.JPopupMenu; import javax.swing.ListSelectionModel; -import javax.swing.SwingUtilities; import javax.swing.event.ListDataEvent; import javax.swing.event.ListDataListener; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.BorderLayout; import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Toolkit; -import java.awt.Window; -import java.awt.event.InputEvent; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; @@ -41,11 +27,8 @@ import java.lang.reflect.InvocationTargetException; public abstract class UIListControlPane extends UIControlPane implements ListControlPaneProvider { private static final String LIST_NAME = "UIControl_List"; - private static final int EDIT_RANGE = 25; // 编辑按钮的x坐标范围 protected UINameEdList nameableList; - private int editingIndex; - protected String selectedName; protected boolean isPopulating = false; private CommonShortCutHandlers commonHandlers; private ListControlPaneHelper helper; @@ -93,7 +76,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - nameableList.addMouseListener(getListMouseListener()); + nameableList.addMouseListener(getHelper().getListMouseListener(nameableList, this)); nameableList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { // richie:避免多次update和populate大大降低效率 @@ -139,7 +122,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon saveSettings(); } }; - nameEdList.setCellRenderer(new UINameableListCellRenderer(this)); + nameEdList.setCellRenderer(new UINameableListCellRenderer(this.isNewStyle(), this.creators)); return nameEdList; } @@ -181,13 +164,6 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon } - /** - * 获取选中的名字 - */ - public String getSelectedName() { - return getHelper().getSelectedName(); - } - /** * 添加 Nameable * @@ -209,51 +185,10 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon protected void popupEditDialog(Point mousePos) { if (isNewStyle()) { - Rectangle currentCellBounds = nameableList.getCellBounds(editingIndex, editingIndex); - if (editingIndex < 0 || (mousePos != null && !currentCellBounds.contains(mousePos))) { - return; - } - popupEditDialog.setLocation(getPopupDialogLocation()); - if (popupEditDialog instanceof PopupEditDialog) { - ((PopupEditDialog)popupEditDialog).setTitle(getSelectedName()); - } - popupEditDialog.setVisible(true); - PopupDialogSaveAction osBasedAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); - osBasedAction.register(this, popupEditDialog); + getHelper().popupEditDialog(mousePos, nameableList, this); } } - private Point getPopupDialogLocation() { - Point resultPos = new Point(0, 0); - Point listPos = nameableList.getLocationOnScreen(); - resultPos.x = listPos.x - popupEditDialog.getWidth(); - resultPos.y = listPos.y + (nameableList.getSelectedIndex() - 1) * EDIT_RANGE; - - // 当对象在屏幕上的位置比较靠下时,往下移动弹窗至与属性面板平齐 - Window frame = DesignerContext.getDesignerFrame(); - // 不能太低 - int maxY = frame.getLocationOnScreen().y + frame.getHeight() - popupEditDialog.getHeight(); - if (resultPos.y > maxY) { - resultPos.y = maxY; - } - // 也不能太高 - int minY = frame.getLocationOnScreen().y + EDIT_RANGE; - if (resultPos.y < minY) { - resultPos.y = minY; - } - - // 当在左侧显示不下时,在右侧弹出弹窗 - if (resultPos.x < 0) { - resultPos.x = listPos.x + nameableList.getParent().getWidth(); - } - // 如果右侧显示不下,可以向左移动 - int maxX = frame.getLocationOnScreen().x + frame.getWidth() - popupEditDialog.getWidth() - EDIT_RANGE; - if (resultPos.x > maxX) { - resultPos.x = maxX; - } - - return resultPos; - } /** * 生成不重复的名字 @@ -301,65 +236,6 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon return getModel().getSize() > 0 && nameableList.getSelectedIndex() != -1; } - /* - * UINameEdList的鼠标事件 - */ - private MouseListener getListMouseListener() { - return new MouseAdapter() { - @Override - public void mouseReleased(MouseEvent evt) { - nameableList.stopEditing(); - if (evt.getClickCount() >= 2 - && SwingUtilities.isLeftMouseButton(evt) && evt.getX() > EDIT_RANGE) { - editingIndex = nameableList.getSelectedIndex(); - selectedName = nameableList.getNameAt(editingIndex); - nameableList.editItemAt(nameableList.getSelectedIndex()); - } else if (SwingUtilities.isLeftMouseButton(evt) && evt.getX() <= EDIT_RANGE) { - editingIndex = nameableList.getSelectedIndex(); - selectedName = nameableList.getNameAt(editingIndex); - popupEditDialog(evt.getPoint()); - } - - // peter:处理右键的弹出菜单 - if (!SwingUtilities.isRightMouseButton(evt)) { - return; - } - - // peter: 注意,在checkButtonEnabled()方法里面,设置了所有的Action的Enabled. - checkButtonEnabled(); - - // p:右键菜单. - JPopupMenu popupMenu = new JPopupMenu(); - - for (ShortCut4JControlPane sj : getShorts()) { - sj.getShortCut().intoJPopupMenu(popupMenu); - } - - // peter: 只有弹出菜单有子菜单的时候,才需要弹出来. - GUICoreUtils.showPopupMenu(popupMenu, nameableList, evt.getX() - 1, - evt.getY() - 1); - } - - @Override - public void mouseClicked(MouseEvent e) { - JList list = (JList) e.getSource(); - if (list.locationToIndex(e.getPoint()) == -1 && !e.isShiftDown() - && !isMenuShortcutKeyDown(e)) { - list.clearSelection(); - } - } - - private boolean isMenuShortcutKeyDown(InputEvent event) { - return (event.getModifiers() & Toolkit.getDefaultToolkit() - .getMenuShortcutKeyMask()) != 0; - } - - @Override - public void mouseMoved(MouseEvent e) { - - } - }; - } /** * 检查按钮可用状态 Check button enabled. diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java new file mode 100644 index 000000000..82bf99bf3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -0,0 +1,550 @@ +package com.fr.design.gui.controlpane; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ilist.JNameEdList; +import com.fr.design.gui.ilist.ListModelElement; +import com.fr.design.gui.ilist.ModNameActionListener; +import com.fr.design.gui.ilist.UIList; +import com.fr.design.gui.ilist.UINameEdList; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.widget.EventCreator; +import com.fr.form.event.Listener; +import com.fr.form.ui.Widget; +import com.fr.general.NameObject; +import com.fr.report.web.util.ReportEngineEventMapping; +import com.fr.stable.ArrayUtils; +import com.fr.stable.Nameable; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.DefaultListModel; +import javax.swing.JPanel; +import javax.swing.ListModel; +import javax.swing.ListSelectionModel; +import javax.swing.event.ListDataEvent; +import javax.swing.event.ListDataListener; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.AlphaComposite; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/** + * Created by kerry on 5/31/21 + */ +public abstract class UIListGroupControlPane extends UIControlPane implements ListControlPaneProvider { + private boolean isPopulating = false; + private UINameEdList selectNameEdList; + + private Map nameEdListMap = new HashMap<>(); + + private CommonShortCutHandlers commonHandlers; + + private ListControlPaneHelper helper; + + private JPanel contentPane; + + public JPanel getContentPane() { + return contentPane; + } + + private ListControlPaneHelper getHelper() { + if (helper == null) { + helper = ListControlPaneHelper.newInstance(this); + } + return helper; + } + + private CommonShortCutHandlers getCommonHandlers() { + if (commonHandlers == null) { + commonHandlers = CommonShortCutHandlers.newInstance(this); + } + return commonHandlers; + } + + public boolean isPopulating() { + return isPopulating; + } + + @Override + protected void initLeftPane(JPanel leftPane) { + leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER); + } + + + protected void refreshPane(Widget widget, NameableCreator[] creators) { + refreshContentPane(widget.supportedEvents()); + refreshNameableCreator(creators); + populateNameObjects(widget); + } + + + private void refreshContentPane(String[] supportedEvents) { + for (String event : supportedEvents) { + if (nameEdListMap.containsKey(event)) { + continue; + } + UINameEdList list = createJNameList(event); + ListWrapperPane wrapperPane = new ListWrapperPane(switchLang(event), list); + if (this.selectNameEdList == null) { + this.selectNameEdList = wrapperPane.getNameEdList(); + } + contentPane.add(wrapperPane); + nameEdListMap.put(event, wrapperPane); + } + contentPane.addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + if (selectNameEdList != null) { + selectNameEdList.stopEditing(); + } + } + }); + } + + protected void populateNameObjects(Widget widget) { + ArrayList nameObjectList = new ArrayList<>(); + for (int i = 0, size = widget.getListenerSize(); i < size; i++) { + Listener listener = widget.getListener(i); + if (!listener.isDefault()) { + nameObjectList.add(i, new NameObject(switchLang(listener.getEventName()) + (i + 1), listener)); + } + } + populate(getHelper().processCatalog(nameObjectList)); + checkButtonEnabled(); + this.repaint(); + } + + private void populate(Map> map) { + isPopulating = true; // 加一个标识位,避免切换单元格时,触发 saveSettings + Iterator>> iterator = map.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry> entry = iterator.next(); + List valueList = entry.getValue(); + ListWrapperPane eventListWrapperPane = nameEdListMap.get(entry.getKey()); + populateChildNameList(eventListWrapperPane.getNameEdList(), valueList.toArray(new NameObject[valueList.size()])); + } + this.checkButtonEnabled(); + refreshEventListWrapperPane(); + this.checkGroupPaneSize(); + isPopulating = false; + } + + private void refreshEventListWrapperPane() { + Iterator> iterator = nameEdListMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + ListWrapperPane eventListWrapperPane = entry.getValue(); + UINameEdList nameEdList = eventListWrapperPane.getNameEdList(); + int listSize = nameEdList.getModel().getSize(); + if (this.selectNameEdList.getModel().getSize() == 0 && listSize > 0) { + this.selectNameEdList = nameEdList; + } + eventListWrapperPane.setVisible(listSize > 0); + } + if (this.selectNameEdList != null) { + this.selectNameEdList.setSelectedIndex(0); + } + this.repaint(); + } + + + private void populateChildNameList(UINameEdList nameableList, Nameable[] nameableArray) { + nameableList.getCellEditor().stopCellEditing(); + DefaultListModel listModel = (DefaultListModel) nameableList.getModel(); + listModel.removeAllElements(); + if (ArrayUtils.isEmpty(nameableArray)) { + isPopulating = false; + return; + } + + listModel.setSize(nameableArray.length); + for (int i = 0; i < nameableArray.length; i++) { + listModel.set(i, new ListModelElement(nameableArray[i])); + } + + } + + + private UINameEdList createJNameList(String text) { + UINameEdList nameEdList = new UINameEdList(new DefaultListModel()) { + @Override + protected void doAfterLostFocus() { + ((JControlUpdatePane) controlUpdatePane).update(); + } + + @Override + protected void doAfterStopEditing() { + saveSettings(); + } + }; + + nameEdList.setCellRenderer(new UINameableListCellRenderer(true, this.creators)); + nameEdList.setName(text); + nameEdList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS); + nameEdList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); + nameEdList.addMouseListener(new MouseAdapter() { + @Override + public void mouseReleased(MouseEvent e) { + selectNameEdList = nameEdList; + updateUINameListSelect(); + } + }); + nameEdList.addMouseListener(getHelper().getListMouseListener(nameEdList, this)); + nameEdList.addModNameActionListener(new ModNameActionListener() { + @Override + public void nameModed(int index, String oldName, String newName) { + checkGroupPaneSize(); + saveSettings(); + } + }); + nameEdList.addListSelectionListener(new ListSelectionListener() { + public void valueChanged(ListSelectionEvent evt) { + // richie:避免多次update和populate大大降低效率 + if (!evt.getValueIsAdjusting()) { + // shoc 切换的时候加检验 + if (hasInvalid(false)) { + return; + } + ((JControlUpdatePane) UIListGroupControlPane.this.controlUpdatePane).update(); + ((JControlUpdatePane) UIListGroupControlPane.this.controlUpdatePane).populate(); + UIListGroupControlPane.this.checkButtonEnabled(); + } + } + }); + nameEdList.getModel().addListDataListener(new ListDataListener() { + @Override + public void intervalAdded(ListDataEvent e) { + saveSettings(); + } + + @Override + public void intervalRemoved(ListDataEvent e) { + saveSettings(); + } + + @Override + public void contentsChanged(ListDataEvent e) { + saveSettings(); + } + }); + return nameEdList; + } + + private void updateUINameListSelect() { + Iterator> iterator = nameEdListMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + UINameEdList nameEdList = entry.getValue().getNameEdList(); + if (nameEdList != selectNameEdList) { + nameEdList.clearSelection(); + } + } + } + + @Override + public void checkButtonEnabled() { + getHelper().checkButtonEnabled(); + } + + + private String switchLang(String eventName) { + // 在 properties 文件中找到相应的 key 值 + String localeKey = ReportEngineEventMapping.getLocaleName(eventName); + return com.fr.design.i18n.Toolkit.i18nText(localeKey); + } + + + /** + * 生成不重复的名字 + * + * @param prefix 名字前缀 + * @return 名字 + */ + @Override + public String createUnrepeatedName(String prefix) { + return getCommonHandlers().createUnrepeatedName(prefix); + } + + private void updateSelectedNameList(NameableCreator creator) { + String eventName = ((EventCreator) creator).getEventName(); + ListWrapperPane wrapperPane = nameEdListMap.get(eventName); + wrapperPane.setVisible(true); + setSelectNameEdList(wrapperPane.getNameEdList()); + } + + private void setSelectNameEdList(UINameEdList nameEdList) { + if (this.selectNameEdList != null) { + this.selectNameEdList.clearSelection(); + } + this.selectNameEdList = nameEdList; + } + + @Override + public void onAddItem(NameableCreator creator) { + updateSelectedNameList(creator); + getCommonHandlers().onAddItem(creator); + checkGroupPaneSize(); + } + + @Override + public void onRemoveItem() { + getCommonHandlers().onRemoveItem(); + refreshEventListWrapperPane(); + checkGroupPaneSize(); + } + + @Override + public void onCopyItem() { + getCommonHandlers().onCopyItem(); + checkGroupPaneSize(); + } + + + private void checkGroupPaneSize() { + int width = 180; + Iterator> iterator = nameEdListMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + ListWrapperPane wrapperPane = entry.getValue(); + UIList uiList = wrapperPane.getNameEdList(); + width = Math.max(width, calculateUIListMaxCellWidth(uiList.getModel(), uiList.getFontMetrics(uiList.getFont()))); + } + iterator = nameEdListMap.entrySet().iterator(); + width += 40; + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + ListWrapperPane wrapperPane = entry.getValue(); + UIList uiList = wrapperPane.getNameEdList(); + uiList.setFixedCellWidth(width); + } + } + + private int calculateUIListMaxCellWidth(ListModel model, FontMetrics fontMetrics) { + int width = 0; + for (int i = 0; i < model.getSize(); i++) { + Object element = model.getElementAt(i); + if (element != null) { + String text; + if (element instanceof ListModelElement) { + text = ((ListModelElement) element).wrapper.getName(); + } else { + text = element.toString(); + } + width = Math.max(width, fontMetrics.stringWidth(text)); + } + } + return width; + } + + + @Override + public void onMoveUpItem() { + getCommonHandlers().onMoveUpItem(); + } + + @Override + public void onMoveDownItem() { + getCommonHandlers().onMoveDownItem(); + } + + @Override + public void onSortItem(boolean isAtoZ) { + Iterator> iterator = nameEdListMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + UINameEdList nameEdList = entry.getValue().getNameEdList(); + getCommonHandlers().onSortItem(isAtoZ, nameEdList); + } + + } + + @Override + public boolean isItemSelected() { + return getModel().getSize() > 0 && getSelectedIndex() != -1; + } + + + @Override + protected JPanel createControlUpdatePane() { + return JControlUpdatePane.newInstance(this); + } + + + @Override + public Nameable[] update() { + java.util.List res = new java.util.ArrayList(); + getControlUpdatePane().update(); + Iterator> iterator = nameEdListMap.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + UINameEdList nameEdList = entry.getValue().getNameEdList(); + DefaultListModel listModel = (DefaultListModel) nameEdList.getModel(); + for (int i = 0, len = listModel.getSize(); i < len; i++) { + res.add(((ListModelElement) listModel.getElementAt(i)).wrapper); + } + } + return res.toArray(new Nameable[0]); + } + + + @Override + public abstract NameableCreator[] createNameableCreators(); + + @Override + public abstract void saveSettings(); + + + public BasicBeanPane createPaneByCreators(NameableCreator creator) { + try { + return creator.getUpdatePane().newInstance(); + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + public BasicBeanPane createPaneByCreators(NameableCreator creator, String string) { + Constructor constructor = null; + try { + constructor = creator.getUpdatePane().getDeclaredConstructor(new Class[]{String.class}); + constructor.setAccessible(true); + return (BasicBeanPane) constructor.newInstance(string); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } + } + + @Override + public DefaultListModel getModel() { + if (this.selectNameEdList == null) { + return new DefaultListModel(); + } + return (DefaultListModel) this.selectNameEdList.getModel(); + } + + /** + * 检查是否符合规范 + * + * @throws Exception + */ + @Override + public void checkValid() throws Exception { + ((JControlUpdatePane) this.controlUpdatePane).checkValid(); + } + + @Override + public boolean hasInvalid(boolean isAdd) { + return getHelper().hasInvalid(isAdd); + } + + public void addNameable(Nameable nameable, int index) { + getHelper().addNameable(nameable, index); + popupEditDialog(); + } + + + /** + * 设置选中项 + * + * @param index 选中项的序列号 + */ + public void setSelectedIndex(int index) { + if (this.selectNameEdList != null) { + this.selectNameEdList.setSelectedIndex(index); + + } + } + + @Override + public int getSelectedIndex() { + if (this.selectNameEdList == null) { + return -1; + } + return this.selectNameEdList.getSelectedIndex(); + } + + + @Override + public ListModelElement getSelectedValue() { + if (this.selectNameEdList == null) { + return null; + } + return (ListModelElement) this.selectNameEdList.getSelectedValue(); + } + + @Override + public JControlUpdatePane getControlUpdatePane() { + return (JControlUpdatePane) controlUpdatePane; + } + + @Override + public JNameEdList getNameableList() { + return this.selectNameEdList; + } + + private void popupEditDialog() { + getHelper().popupEditDialog(null, this.selectNameEdList, this); + } + + protected String getWrapperLabelText() { + return StringUtils.EMPTY; + } + + + private class ListWrapperPane extends JPanel { + private UINameEdList nameEdList; + + public ListWrapperPane(String labelText, UINameEdList nameEdList) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + UILabel label = new UILabel(labelText + getWrapperLabelText()) { + @Override + public void paint(Graphics g) { + ((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f)); + super.paint(g); + } + }; + label.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0)); + label.setOpaque(true); + label.setBackground(Color.WHITE); + label.setForeground(Color.decode("#333334")); + label.setFont(label.getFont().deriveFont(11F)); + label.setPreferredSize(new Dimension(224, 26)); + this.nameEdList = nameEdList; + this.add(label, BorderLayout.NORTH); + this.add(this.nameEdList, BorderLayout.CENTER); + } + + public UINameEdList getNameEdList() { + return this.nameEdList; + } + + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UINameableListCellRenderer.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UINameableListCellRenderer.java index b66ee1ef2..40d8d98fa 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UINameableListCellRenderer.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UINameableListCellRenderer.java @@ -1,12 +1,8 @@ package com.fr.design.gui.controlpane; -import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilist.ListModelElement; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.Nameable; import sun.swing.DefaultLookup; @@ -14,8 +10,6 @@ import javax.swing.*; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; /** * Nameable的ListCellRenerer @@ -32,12 +26,14 @@ public class UINameableListCellRenderer extends private static final int BUTTON_WIDTH = 25; private UILabel editButton; // "编辑按钮",实际上是一个 UILabel,由列表项(UIListControlPane)统一处理点击事件 private UILabel label; - private UIListControlPane listControlPane; + private boolean isNewStyle; + private NameableCreator[] creators; private Color initialLabelForeground; - public UINameableListCellRenderer(UIListControlPane listControlPane) { + public UINameableListCellRenderer( boolean isNewStyle, NameableCreator[] creators) { super(); - this.listControlPane = listControlPane; + this.isNewStyle = isNewStyle; + this.creators = creators; initComponents(); setOpaque(true); setBorder(getNoFocusBorder()); @@ -50,7 +46,7 @@ public class UINameableListCellRenderer extends return new Dimension(BUTTON_WIDTH, BUTTON_WIDTH); } }; - editButton.setIcon(listControlPane.isNewStyle() ? UIConstants.LIST_EDIT_ICON : UIConstants.CPT_ICON); + editButton.setIcon(isNewStyle ? UIConstants.LIST_EDIT_ICON : UIConstants.CPT_ICON); editButton.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 1, UIConstants.LIST_ITEM_SPLIT_LINE)); editButton.setHorizontalAlignment(SwingConstants.CENTER); label = new UILabel(); @@ -92,7 +88,7 @@ public class UINameableListCellRenderer extends setBackground(bg == null ? list.getSelectionBackground() : bg); setForeground(fg == null ? list.getSelectionForeground() : fg); label.setForeground(Color.WHITE); - if (listControlPane.isNewStyle()) { + if (isNewStyle) { editButton.setIcon(UIConstants.LIST_EDIT_WHITE_ICON); } } @@ -100,7 +96,7 @@ public class UINameableListCellRenderer extends setBackground(list.getBackground()); setForeground(list.getForeground()); label.setForeground(initialLabelForeground); - if (listControlPane.isNewStyle()) { + if (isNewStyle) { editButton.setIcon(UIConstants.LIST_EDIT_ICON); } } @@ -114,7 +110,7 @@ public class UINameableListCellRenderer extends Nameable wrappee = ((ListModelElement) value).wrapper; this.setText(((ListModelElement) value).wrapper.getName()); - for (NameableCreator creator : listControlPane.creators()) { + for (NameableCreator creator : creators) { if (creator.menuIcon() != null && creator.acceptObject2Populate(wrappee) != null) { this.setToolTipText(creator.createTooltip()); break; @@ -124,4 +120,4 @@ public class UINameableListCellRenderer extends return this; } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 77407a3ed..125cd3aa1 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -172,7 +172,7 @@ public class UIEastResizableContainer extends JPanel { leftPane.setBounds(0, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight); // parameterPane.setBounds(20, 0, 230, getParameterPaneHeight());//10,0,230,462 - rightPane.setBounds(leftPaneWidth, 0, containerWidth-leftPaneWidth, getHeight());//20,0,230,0 + rightPane.setBounds(leftPaneWidth, 0, containerWidth - leftPaneWidth, getHeight());//20,0,230,0 } @Override @@ -242,7 +242,27 @@ public class UIEastResizableContainer extends JPanel { * 伸缩右子面板时,触发此方法 */ public void onResize() { - // do nothing here + refreshContainer(); + if (DesignModeContext.isAuthorityEditing()) { + DesignerContext.getDesignerFrame().doResize(); + } + } + + public void showContainer() { + if (containerWidth != leftPaneWidth) { + return; + } + containerWidth = preferredWidth; + onResize(); + } + + public void hideContainer() { + if (containerWidth == leftPaneWidth) { + return; + } + setPreferredWidth(containerWidth); + containerWidth = leftPaneWidth; + onResize(); } private class TopToolPane extends JPanel { @@ -281,15 +301,9 @@ public class UIEastResizableContainer extends JPanel { public void mouseClicked(MouseEvent e) { if (e.getX() <= ARROW_RANGE) { if (containerWidth == leftPaneWidth) { - containerWidth = preferredWidth; + showContainer(); } else { - setPreferredWidth(containerWidth); - containerWidth = leftPaneWidth; - } - onResize(); - refreshContainer(); - if (DesignModeContext.isAuthorityEditing()) { - DesignerContext.getDesignerFrame().doResize(); + hideContainer(); } } } @@ -316,5 +330,4 @@ public class UIEastResizableContainer extends JPanel { g.drawImage(button, 18, 7, 5, 10, null); } } - } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java index d5afe26db..6c97b1e6b 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsRegisterMark.java @@ -16,11 +16,11 @@ import java.util.Map; public class BbsRegisterMark implements LocaleMark { private final Map map = new HashMap<>(); - private static final String BBS_REGISTER_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.register"); - private static final String BBS_REGISTER_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.register"); - private static final String BBS_REGISTER_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); - private static final String BBS_REGISTER_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); - private static final String BBS_REGISTER_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US"); + private static final String BBS_REGISTER_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.register", "http://id.fanruan.com/register/register.php?clueSource=activityfr"); + private static final String BBS_REGISTER_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.register", "http://id.fanruan.com/register/register.php?clueSource=activityfr"); + private static final String BBS_REGISTER_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US", "https://id.fanruan.com/en/register/register.php"); + private static final String BBS_REGISTER_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US", "https://id.fanruan.com/en/register/register.php"); + private static final String BBS_REGISTER_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.register.en_US", "https://id.fanruan.com/en/register/register.php"); public BbsRegisterMark() { map.put(Locale.CHINA, BBS_REGISTER_CN); diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java index 4573aac3a..b44a4e691 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsResetMark.java @@ -16,11 +16,11 @@ import java.util.Map; public class BbsResetMark implements LocaleMark { private final Map map = new HashMap<>(); - private static final String BBS_RESET_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset"); - private static final String BBS_RESET_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.reset"); - private static final String BBS_RESET_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); - private static final String BBS_RESET_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); - private static final String BBS_RESET_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US"); + private static final String BBS_RESET_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset", "http://id.fanruan.com/forget/forget.php?clue=activityfr"); + private static final String BBS_RESET_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.reset", "http://id.fanruan.com/forget/forget.php?clue=activityfr"); + private static final String BBS_RESET_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US", "https://id.fanruan.com/en/forget/forget.php"); + private static final String BBS_RESET_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US", "https://id.fanruan.com/en/forget/forget.php"); + private static final String BBS_RESET_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.reset.en_US", "https://id.fanruan.com/en/forget/forget.php"); public BbsResetMark() { map.put(Locale.CHINA, BBS_RESET_CN); diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java index 2303dc250..999c73284 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BbsSpaceMark.java @@ -16,11 +16,11 @@ import java.util.Map; public class BbsSpaceMark implements LocaleMark { private final Map map = new HashMap<>(); - private static final String BBS_SPACE_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); - private static final String BBS_SPACE_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.default"); - private static final String BBS_SPACE_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); - private static final String BBS_SPACE_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); - private static final String BBS_SPACE_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US"); + private static final String BBS_SPACE_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.default", "http://bbs.fanruan.com/home.php?mod=space&do=pm"); + private static final String BBS_SPACE_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.default", "http://bbs.fanruan.com/home.php?mod=space&do=pm"); + private static final String BBS_SPACE_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US", "https://community.finereport.com/home.php?mod=space&do=pm"); + private static final String BBS_SPACE_KR = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US", "https://community.finereport.com/home.php?mod=space&do=pm"); + private static final String BBS_SPACE_JP = CloudCenter.getInstance().acquireUrlByKind("bbs.default.en_US", "https://community.finereport.com/home.php?mod=space&do=pm"); public BbsSpaceMark() { map.put(Locale.CHINA, BBS_SPACE_CN); diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java index 41822d19c..f67b4e6fe 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/BugNeedMark.java @@ -14,7 +14,7 @@ import java.util.Map; */ public class BugNeedMark implements LocaleMark { private Map map = new HashMap<>(); - private static final String TW_BUG_AND_NEEDS = CloudCenter.getInstance().acquireUrlByKind("bbs.bug.needs.zh_TW"); + private static final String TW_BUG_AND_NEEDS = CloudCenter.getInstance().acquireUrlByKind("bbs.bug.needs.zh_TW", "https://fanruanhelp.zendesk.com/hc/zh-tw/requests/new"); public BugNeedMark() { map.put(Locale.TAIWAN, TW_BUG_AND_NEEDS); diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java index 6d15764b5..2ffb9f230 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/TechSupportMark.java @@ -14,8 +14,8 @@ import java.util.Map; */ public class TechSupportMark implements LocaleMark { private Map map = new HashMap<>(); - private static final String EN_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.en_US"); - private static final String TW_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.zh_TW"); + private static final String EN_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.en_US", "https://fanruanhelp.zendesk.com/hc/en-us"); + private static final String TW_TECH_SUPPORT = CloudCenter.getInstance().acquireUrlByKind("bbs.tech.support.zh_TW", "https://fanruanhelp.zendesk.com/hc/zh-tw"); public TechSupportMark() { map.put(Locale.US, EN_TECH_SUPPORT); diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java index c72f6a4ff..a7b45b490 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/UserInfoMark.java @@ -15,11 +15,11 @@ import java.util.Map; public class UserInfoMark implements LocaleMark { private Map map = new HashMap<>(); - private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn"); - private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en"); - private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw"); - private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp"); - private static final String KR_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.kr"); + private static final String CN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.cn", "http://www.finereport.com/product/active?utm_source=direct&utm_medium=exe"); + private static final String EN_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.en", "http://www.finereport.com/en/activation"); + private static final String TW_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.tw", "http://www.finereport.com/tw/products/frlogin"); + private static final String JP_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.jp", "http://www.finereport.com/jp/trial/"); + private static final String KR_LOGIN_HTML = CloudCenter.getInstance().acquireUrlByKind("frlogin.kr", "http://www.finereport.com/kr/activation/"); public UserInfoMark() { map.put(Locale.CHINA, CN_LOGIN_HTML); diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java b/designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java index 8e086a569..2521c82c2 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/VideoMark.java @@ -15,9 +15,9 @@ import java.util.Map; public class VideoMark implements LocaleMark { private Map map = new HashMap<>(); - private static final String VIDEO_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en_US"); - private static final String VIDEO_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_CN"); - private static final String VIDEO_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_TW"); + private static final String VIDEO_EN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.en_US", "http://www.finereport.com/en/Learning-path"); + private static final String VIDEO_CN = CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_CN", "https://edu.fanruan.com/video?class1=16&class2=0"); + private static final String VIDEO_TW = CloudCenter.getInstance().acquireUrlByKind("bbs.video.zh_TW", "http://www.finereport.com/tw/video"); public VideoMark() { map.put(Locale.CHINA, VIDEO_CN); diff --git a/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java b/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java new file mode 100644 index 000000000..6fc3c817b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/AbstractDesignerSSO.java @@ -0,0 +1,46 @@ +package com.fr.design.login; + +import com.fr.base.FRContext; +import com.fr.design.DesignerEnvManager; +import com.fr.design.actions.UpdateAction; +import com.fr.design.login.utils.DesignerLoginUtils; +import com.fr.design.os.impl.SupportOSImpl; +import com.fr.design.utils.BrowseUtils; +import java.awt.event.ActionEvent; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/7 + */ +public abstract class AbstractDesignerSSO extends UpdateAction { + + @Override + public void actionPerformed(ActionEvent event) { + String url = getJumpUrl(); + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + int uid = manager.getDesignerLoginUid(); + if (uid > 0) { + String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(url); + BrowseUtils.browser(ssoUrl); + } else { + if (!SupportOSImpl.DESIGNER_LOGIN.support() || !FRContext.isChineseEnv()) { + BrowseUtils.browser(url); + return; + } + boolean loginRemindBeforeJumpBBS = manager.isLoginRemindBeforeJumpBBS(); + if (loginRemindBeforeJumpBBS) { + Map params = new HashMap<>(); + params.put("bbsJumpUrl", url); + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.BBS_JUMP, params); + manager.setLoginRemindBeforeJumpBBS(false); + } else { + BrowseUtils.browser(url); + } + } + } + + public abstract String getJumpUrl(); +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java new file mode 100644 index 000000000..4d0ba8a41 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginBridge.java @@ -0,0 +1,280 @@ +package com.fr.design.login; + +import com.fr.design.bridge.exec.JSBridge; +import com.fr.design.bridge.exec.JSCallback; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ilable.ActionLabel; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.locale.impl.BbsResetMark; +import com.fr.design.login.executor.DesignerLoginBrowserExecutor; +import com.fr.design.login.executor.DesignerLoginExecutor; +import com.fr.design.login.executor.DesignerSendCaptchaExecutor; +import com.fr.design.login.executor.DesignerSmsLoginExecutor; +import com.fr.design.login.executor.DesignerSmsRegisterExecutor; +import com.fr.design.login.task.DesignerLoginTaskWorker; +import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; +import com.fr.general.locale.LocaleCenter; +import com.fr.general.locale.LocaleMark; +import com.fr.log.FineLoggerFactory; +import com.teamdev.jxbrowser.chromium.Browser; +import com.teamdev.jxbrowser.chromium.JSFunction; +import com.teamdev.jxbrowser.chromium.JSObject; +import java.awt.Desktop; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.net.URI; +import java.util.Map; +import java.util.Set; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginBridge { + + private Map params; + + public static DesignerLoginBridge getBridge(Browser browser, Map params) { + return new DesignerLoginBridge(browser, params); + } + + private JSObject window; + + private DesignerLoginBridge(Browser browser, Map params) { + this.params = params; + this.window = browser.executeJavaScriptAndReturnValue("window").asObject(); + Set> entries = params.entrySet(); + for (Map.Entry entry : entries) { + this.window.setProperty(entry.getKey(), entry.getValue()); + } + } + + @JSBridge + public String i18nText(String key) { + return Toolkit.i18nText(key); + } + + @JSBridge + public void closeWindow(boolean loginSuccess) { + DesignerLoginSource source = DesignerLoginSource.valueOf(Integer.parseInt(params.get("designerLoginSource"))); + if (loginSuccess) { + if (source == DesignerLoginSource.GUIDE) { + DesignerToastMsgUtil.toastPrompt( + getHyperlinkPane( + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Guide_Login_Success_Title"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Guide_Login_Success_Hyperlink_Text"), + CloudCenter.getInstance().acquireUrlByKind("designer.premium.template", "https://market.fanruan.com/template") + ) + ); + } else if (source == DesignerLoginSource.BBS_JUMP) { + String bbsJumpUrl = params.get("bbsJumpUrl"); + BrowseUtils.browser(bbsJumpUrl); + } + DesignerLoginHelper.closeWindow(); + return; + } + if (source == DesignerLoginSource.SWITCH_ACCOUNT) { + DesignerLoginHelper.closeWindow(); + return; + } + if (source == DesignerLoginSource.BBS_JUMP) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + String bbsJumpUrl = params.get("bbsJumpUrl"); + String[] options = new String[]{ + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_BBS_Go_Directly"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Return_Login") + }; + int rv = FineJOptionPane.showConfirmDialog( + DesignerLoginHelper.getDialog(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_BBS_Quit_Tip"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[1] + ); + if (rv == JOptionPane.YES_OPTION) { + BrowseUtils.browser(bbsJumpUrl); + DesignerLoginHelper.closeWindow(); + } + } + }); + } else { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + String[] options = new String[]{ + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Quit"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Return_Login") + }; + int rv = FineJOptionPane.showConfirmDialog( + DesignerLoginHelper.getDialog(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Quit_Tip"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[1] + ); + if (rv == JOptionPane.OK_OPTION) { + DesignerLoginHelper.closeWindow(); + } + } + }); + } + } + + /** + * 服务条款 + */ + @JSBridge + public void serviceHref() { + try { + String url = CloudCenter.getInstance().acquireUrlByKind("designer.bbs.service.terms", "https://bbs.fanruan.com/thread-102821-1-1.html"); + Desktop.getDesktop().browse(new URI(url)); + } catch (Exception e) { + FineLoggerFactory.getLogger().info(e.getMessage()); + } + } + + /** + * 忘记密码 + */ + @JSBridge + public void forgetHref() { + try { + LocaleMark resetMark = LocaleCenter.getMark(BbsResetMark.class); + Desktop.getDesktop().browse(new URI(resetMark.getValue())); + } catch (Exception e) { + FineLoggerFactory.getLogger().info(e.getMessage()); + } + } + + + /** + * 设计器端的用户登录 + * + * @param username 用户名 + * @param password 密码 + * @param callback 回调函数 + */ + @JSBridge + public void normalLogin(String username, String password, final JSFunction callback) { + DesignerLoginTaskWorker worker = new DesignerLoginTaskWorker<>( + new JSCallback(DesignerLoginBrowserExecutor.create(window, callback)), + new DesignerLoginExecutor(username, password)); + worker.execute(); + } + + /** + * 发送短信验证码 + * + * @param regionCode 区号 + * @param phone 手机 + * @param callback 回调函数 + */ + @JSBridge + public void sendCaptcha(String regionCode, String phone, final JSFunction callback) { + DesignerLoginTaskWorker worker = new DesignerLoginTaskWorker<>( + new JSCallback(DesignerLoginBrowserExecutor.create(window, callback)), + new DesignerSendCaptchaExecutor(regionCode, phone)); + worker.execute(); + } + + /** + * 设计器端的短信登录 + * + * @param regionCode 区号 + * @param phone 手机 + * @param code 验证码 + * @param callback 回调函数 + */ + @JSBridge + public void smsLogin(String regionCode, String phone, String code, final JSFunction callback) { + DesignerLoginTaskWorker worker = new DesignerLoginTaskWorker<>( + new JSCallback(DesignerLoginBrowserExecutor.create(window, callback)), + new DesignerSmsLoginExecutor(regionCode, phone, code)); + worker.execute(); + } + + /** + * 设计器端的用户注册 + * + * @param regionCode 区号 + * @param phone 手机 + * @param password 密码 + * @param regToken 注册令牌 + * @param callback 回调函数 + */ + @JSBridge + public void smsRegister(String regionCode, String phone, String password, String regToken, final JSFunction callback) { + DesignerLoginTaskWorker worker = new DesignerLoginTaskWorker<>( + new JSCallback(DesignerLoginBrowserExecutor.create(window, callback)), + new DesignerSmsRegisterExecutor(regionCode, phone, password, regToken)); + worker.execute(); + } + + /** + * 使用系统浏览器打开网页 + * + * @param url 要打开的网页 + */ + @JSBridge + public void openShopUrlAtWebBrowser(String url) { + if (Desktop.isDesktopSupported()) { + try { + //创建一个URI实例,注意不是URL + URI uri = URI.create(url); + //获取当前系统桌面扩展 + Desktop desktop = Desktop.getDesktop(); + //判断系统桌面是否支持要执行的功能 + if (desktop.isSupported(Desktop.Action.BROWSE)) { + //获取系统默认浏览器打开链接 + desktop.browse(uri); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + + /** + * 调整面板大小 + * + * @param width 宽 + * @param height 高 + */ + @JSBridge + public void resize(int width, int height) { + DesignerLoginHelper.getDialog().setSize(width, height); + } + + private JPanel getHyperlinkPane(String title, String hyperlinkText, String hyperlink) { + ActionLabel actionLabel = new ActionLabel(hyperlinkText); + actionLabel.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + try { + Desktop.getDesktop().browse(new URI(hyperlink)); + } catch (Exception ignore) { + } + } + }); + JPanel panel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + panel.add(new UILabel(title)); + panel.add(actionLabel); + return panel; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java new file mode 100644 index 000000000..5da006fa7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginHelper.java @@ -0,0 +1,101 @@ +package com.fr.design.login; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.UIDialog; +import com.fr.design.extra.WebViewDlgHelper; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.os.impl.SupportOSImpl; +import com.fr.design.update.ui.dialog.UpdateMainDialog; +import com.fr.general.GeneralContext; +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Window; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import javax.swing.JOptionPane; +import javax.swing.WindowConstants; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginHelper { + + private static final String MAIN_RESOURCE_PATH = "/com/fr/design/login/login.html"; + private static final String JXBROWSER = "com.teamdev.jxbrowser.chromium.Browser"; + + private static UIDialog dialog = null; + + public static String getMainResourcePath() { + return MAIN_RESOURCE_PATH; + } + + public static UIDialog getDialog() { + return dialog; + } + + public static void showLoginDialog(DesignerLoginSource source) { + showLoginDialog(source, new HashMap<>()); + } + + public static void showLoginDialog(DesignerLoginSource source, Map params) { + showLoginDialog(source, params, DesignerContext.getDesignerFrame()); + } + + public static void showLoginDialog(DesignerLoginSource source, Map params, Window window) { + if (!SupportOSImpl.DESIGNER_LOGIN.support()) { + WebViewDlgHelper.createLoginDialog(window); + return; + } + boolean hasJxBrowser = true; + try { + Class.forName(JXBROWSER); + } catch (ClassNotFoundException e) { + hasJxBrowser = false; + } + if (hasJxBrowser) { + showLoginPane(source, params, window); + } else { + showUpdatePane(); + } + } + + private static void showLoginPane(DesignerLoginSource source, Map params, Window window) { + DesignerLoginPane designerLoginPane = new DesignerLoginPane(source, params); + if (dialog == null) { + if (window instanceof Dialog) { + dialog = new DesignerLoginShowDialog((Dialog) window, designerLoginPane); + } else { + dialog = new DesignerLoginShowDialog((Frame) window, designerLoginPane); + } + } + dialog.setVisible(true); + } + + + private static void showUpdatePane() { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Update_Info_Login_Message")); + if (!GeneralContext.getLocale().equals(Locale.JAPANESE) && !GeneralContext.getLocale().equals(Locale.JAPAN) + && !Locale.getDefault().equals(Locale.JAPAN) && !Locale.getDefault().equals(Locale.JAPANESE)) { + UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); + dialog.setAutoUpdateAfterInit(); + dialog.showDialog(); + } + } + + public static void closeWindow() { + if (dialog != null) { + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.setVisible(false); + dialog = null; + } + } + + public static void main(String[] args) { + DesignerEnvManager.getEnvManager().setOpenDebug(true); + showLoginDialog(DesignerLoginSource.NORMAL); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginPane.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginPane.java new file mode 100644 index 000000000..be5df3a84 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginPane.java @@ -0,0 +1,42 @@ +package com.fr.design.login; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.BasicPane; +import com.fr.design.login.utils.DesignerLoginUtils; +import com.fr.design.ui.ModernUIPane; +import com.teamdev.jxbrowser.chromium.JSValue; +import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; +import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.awt.BorderLayout; +import java.util.Map; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginPane extends BasicPane { + + @Override + protected String title4PopupWindow() { + return "DESIGNER_LOGIN"; + } + + public DesignerLoginPane(DesignerLoginSource source, Map params) { + params.put("designerLoginSource", String.valueOf(source.getSource())); + params.put("lastLoginType", String.valueOf(DesignerEnvManager.getEnvManager().getLastLoginType().getType())); + params.put("lastLoginAccount", DesignerEnvManager.getEnvManager().getLastLoginAccount()); + setLayout(new BorderLayout()); + ModernUIPane modernUIPane = new ModernUIPane.Builder<>() + .prepare(new ScriptContextAdapter() { + @Override + public void onScriptContextCreated(ScriptContextEvent event) { + JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); + window.asObject().setProperty("DesignerLoginHelper", DesignerLoginBridge.getBridge(event.getBrowser(), params)); + } + }) + .withEMB(DesignerLoginHelper.getMainResourcePath(), DesignerLoginUtils.renderMap()) + .build(); + add(modernUIPane, BorderLayout.CENTER); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginShowDialog.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginShowDialog.java new file mode 100644 index 000000000..031ec4941 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginShowDialog.java @@ -0,0 +1,45 @@ +package com.fr.design.login; + +import com.fr.design.dialog.UIDialog; +import com.fr.design.utils.gui.GUICoreUtils; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.Frame; +import javax.swing.JPanel; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginShowDialog extends UIDialog { + + private static final Dimension DEFAULT = new Dimension(422, 478); + + public DesignerLoginShowDialog(Frame frame, Component pane) { + super(frame); + init(pane); + } + + public DesignerLoginShowDialog(Dialog dialog, Component pane) { + super(dialog); + init(pane); + } + + private void init(Component pane) { + setUndecorated(true); + JPanel panel = (JPanel) getContentPane(); + panel.setLayout(new BorderLayout()); + add(pane, BorderLayout.CENTER); + setSize(DEFAULT); + GUICoreUtils.centerWindow(this); + setResizable(false); + } + + @Override + public void checkValid() throws Exception { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginSource.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginSource.java new file mode 100644 index 000000000..c369df1d2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginSource.java @@ -0,0 +1,29 @@ +package com.fr.design.login; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/7 + */ +public enum DesignerLoginSource { + NORMAL(0), GUIDE(1), SWITCH_ACCOUNT(2), BBS_JUMP(3), UNKNOWN(-1); + + private int source; + + DesignerLoginSource(int source) { + this.source = source; + } + + public int getSource() { + return source; + } + + public static DesignerLoginSource valueOf(int source) { + for(DesignerLoginSource value : DesignerLoginSource.values()) { + if(value.getSource() == source) { + return value; + } + } + return UNKNOWN; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/DesignerLoginType.java b/designer-base/src/main/java/com/fr/design/login/DesignerLoginType.java new file mode 100644 index 000000000..deba6ce6a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/DesignerLoginType.java @@ -0,0 +1,29 @@ +package com.fr.design.login; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/4 + */ +public enum DesignerLoginType { + NORMAL_LOGIN(0), SMS_LOGIN(1), UNKNOWN(-1); + + private int type; + + DesignerLoginType(int type) { + this.type = type; + } + + public int getType() { + return type; + } + + public static DesignerLoginType valueOf(int type) { + for(DesignerLoginType value : DesignerLoginType.values()) { + if(value.getType() == type) { + return value; + } + } + return UNKNOWN; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/bean/BBSAccountLogin.java b/designer-base/src/main/java/com/fr/design/login/bean/BBSAccountLogin.java new file mode 100644 index 000000000..b52fe5dec --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/bean/BBSAccountLogin.java @@ -0,0 +1,49 @@ +package com.fr.design.login.bean; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/3 + */ +public class BBSAccountLogin { + + private int uid; + + private String username; + + private String appId; + + private String refreshToken; + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java b/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java new file mode 100644 index 000000000..a0ab68109 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/config/DesignerLoginConfigManager.java @@ -0,0 +1,226 @@ +package com.fr.design.login.config; + +import com.fr.design.login.DesignerLoginType; +import com.fr.stable.StringUtils; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLReadable; +import com.fr.stable.xml.XMLWriter; +import com.fr.stable.xml.XMLableReader; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/2 + */ +public class DesignerLoginConfigManager implements XMLReadable, XMLWriter { + + public static final String XML_TAG = "DesignerLoginConfigManager"; + + private static DesignerLoginConfigManager singleton; + + /** + * bbs uid + */ + private int uid = -1; + /** + * bbs 用户名 + */ + private String username = StringUtils.EMPTY; + /** + * bbs 应用Id + */ + private String appId = StringUtils.EMPTY; + /** + * bbs refreshToken + */ + private String refreshToken = StringUtils.EMPTY; + /** + * 登录引导页一个月内不再提醒 + */ + private boolean doNotRemind = false; + /** + * 登录引导页一个月内不再提醒 + */ + private long doNotRemindSelectedTime = -1L; + /** + * 设计器激活时间 + */ + private long designerActivatedTime = -1L; + /** + * bbs 上次登录时间 + */ + private long lastLoginTime = -1L; + /** + * bbs 上次登录方式 + */ + private DesignerLoginType lastLoginType = DesignerLoginType.UNKNOWN; + /** + * bbs 上次登录账号 + */ + private String lastLoginAccount = StringUtils.EMPTY; + /** + * 当前版本第一次启动 + */ + private boolean currentVersionFirstLaunch = true; + /** + * bbs跳转前的登录提醒 + */ + private boolean loginRemindBeforeJumpBBS = true; + /** + * 插件管理第一次启动时的提醒 + */ + private boolean pluginRemindOnFirstLaunch = true; + + private DesignerLoginConfigManager() { + + } + + public static DesignerLoginConfigManager getInstance() { + if (singleton == null) { + singleton = new DesignerLoginConfigManager(); + } + return singleton; + } + + @Override + public void readXML(XMLableReader reader) { + if (reader.isAttr()) { + this.setUid(reader.getAttrAsInt("uid", -1)); + this.setUsername(reader.getAttrAsString("username", StringUtils.EMPTY)); + this.setAppId(reader.getAttrAsString("appId", StringUtils.EMPTY)); + this.setRefreshToken(reader.getAttrAsString("refreshToken", StringUtils.EMPTY)); + this.setDoNotRemind(reader.getAttrAsBoolean("doNotRemind", false)); + this.setDoNotRemindSelectedTime(reader.getAttrAsLong("doNotRemindSelectedTime", -1L)); + this.setDesignerActivatedTime(reader.getAttrAsLong("designerActivatedTime", -1L)); + this.setLastLoginTime(reader.getAttrAsLong("lastLoginTime", -1L)); + this.setCurrentVersionFirstLaunch(reader.getAttrAsBoolean("currentVersionFirstLaunch", true)); + this.setLastLoginType(DesignerLoginType.valueOf(reader.getAttrAsInt("lastLoginType", -1))); + this.setLastLoginAccount(reader.getAttrAsString("lastLoginAccount", StringUtils.EMPTY)); + this.setLoginRemindBeforeJumpBBS(reader.getAttrAsBoolean("loginRemindBeforeJumpBBS", true)); + this.setPluginRemindOnFirstLaunch(reader.getAttrAsBoolean("pluginRemindOnFirstLaunch", true)); + } + } + + @Override + public void writeXML(XMLPrintWriter writer) { + writer.startTAG(XML_TAG); + writer.attr("uid", uid); + writer.attr("username", username); + writer.attr("appId", appId); + writer.attr("refreshToken", refreshToken); + writer.attr("doNotRemind", doNotRemind); + writer.attr("doNotRemindSelectedTime", doNotRemindSelectedTime); + writer.attr("designerActivatedTime", designerActivatedTime); + writer.attr("lastLoginTime", lastLoginTime); + writer.attr("currentVersionFirstLaunch", currentVersionFirstLaunch); + writer.attr("lastLoginType", lastLoginType.getType()); + writer.attr("lastLoginAccount", lastLoginAccount); + writer.attr("loginRemindBeforeJumpBBS", loginRemindBeforeJumpBBS); + writer.attr("pluginRemindOnFirstLaunch", pluginRemindOnFirstLaunch); + writer.end(); + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public long getDoNotRemindSelectedTime() { + return doNotRemindSelectedTime; + } + + public void setDoNotRemindSelectedTime(long doNotRemindSelectedTime) { + this.doNotRemindSelectedTime = doNotRemindSelectedTime; + } + + public boolean isDoNotRemind() { + return doNotRemind; + } + + public void setDoNotRemind(boolean doNotRemind) { + this.doNotRemind = doNotRemind; + } + + public long getDesignerActivatedTime() { + return designerActivatedTime; + } + + public void setDesignerActivatedTime(long designerActivatedTime) { + this.designerActivatedTime = designerActivatedTime; + } + + public long getLastLoginTime() { + return lastLoginTime; + } + + public void setLastLoginTime(long lastLoginTime) { + this.lastLoginTime = lastLoginTime; + } + + public boolean isCurrentVersionFirstLaunch() { + return currentVersionFirstLaunch; + } + + public void setCurrentVersionFirstLaunch(boolean currentVersionFirstLaunch) { + this.currentVersionFirstLaunch = currentVersionFirstLaunch; + } + + public DesignerLoginType getLastLoginType() { + return lastLoginType; + } + + public void setLastLoginType(DesignerLoginType lastLoginType) { + this.lastLoginType = lastLoginType; + } + + public String getLastLoginAccount() { + return lastLoginAccount; + } + + public void setLastLoginAccount(String lastLoginAccount) { + this.lastLoginAccount = lastLoginAccount; + } + + public boolean isLoginRemindBeforeJumpBBS() { + return loginRemindBeforeJumpBBS; + } + + public void setLoginRemindBeforeJumpBBS(boolean loginRemindBeforeJumpBBS) { + this.loginRemindBeforeJumpBBS = loginRemindBeforeJumpBBS; + } + + public boolean isPluginRemindOnFirstLaunch() { + return pluginRemindOnFirstLaunch; + } + + public void setPluginRemindOnFirstLaunch(boolean pluginRemindOnFirstLaunch) { + this.pluginRemindOnFirstLaunch = pluginRemindOnFirstLaunch; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginBrowserExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginBrowserExecutor.java new file mode 100644 index 000000000..fa7fa6487 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginBrowserExecutor.java @@ -0,0 +1,30 @@ +package com.fr.design.login.executor; + +import com.fr.design.bridge.exec.JSExecutor; +import com.teamdev.jxbrowser.chromium.JSFunction; +import com.teamdev.jxbrowser.chromium.JSObject; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2019-04-18 + */ +public class DesignerLoginBrowserExecutor implements JSExecutor { + + public static DesignerLoginBrowserExecutor create(JSObject window, JSFunction callback) { + return new DesignerLoginBrowserExecutor(window, callback); + } + + private JSObject window; + private JSFunction callback; + + private DesignerLoginBrowserExecutor(JSObject window, JSFunction callback) { + this.window = window; + this.callback = callback; + } + + @Override + public void executor(String newValue) { + callback.invoke(window, newValue); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginExecutor.java new file mode 100644 index 000000000..6aff424d1 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerLoginExecutor.java @@ -0,0 +1,45 @@ +package com.fr.design.login.executor; + +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.design.login.service.DesignerPassportManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerLoginExecutor implements Executor { + private String result = "[]"; + + private String username; + private String password; + + public DesignerLoginExecutor(String username, String password) { + this.username = username; + this.password = password; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + result = String.valueOf(DesignerPassportManager.getInstance().login(username, password)); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerSendCaptchaExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSendCaptchaExecutor.java new file mode 100644 index 000000000..0e64f33d2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSendCaptchaExecutor.java @@ -0,0 +1,45 @@ +package com.fr.design.login.executor; + +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.design.login.service.DesignerPassportManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerSendCaptchaExecutor implements Executor { + private String result = "[]"; + + private String regionCode; + private String phone; + + public DesignerSendCaptchaExecutor(String regionCode, String phone) { + this.regionCode = regionCode; + this.phone = phone; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + result = String.valueOf(DesignerPassportManager.getInstance().sendCaptcha(regionCode, phone)); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsLoginExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsLoginExecutor.java new file mode 100644 index 000000000..cfc2c115d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsLoginExecutor.java @@ -0,0 +1,47 @@ +package com.fr.design.login.executor; + +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.design.login.service.DesignerPassportManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerSmsLoginExecutor implements Executor { + private String result = "[]"; + + private String regionCode; + private String phone; + private String code; + + public DesignerSmsLoginExecutor(String regionCode, String phone, String code) { + this.regionCode = regionCode; + this.phone = phone; + this.code = code; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + result = DesignerPassportManager.getInstance().smsLogin(regionCode, phone, code); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsRegisterExecutor.java b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsRegisterExecutor.java new file mode 100644 index 000000000..dde25c29c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/executor/DesignerSmsRegisterExecutor.java @@ -0,0 +1,49 @@ +package com.fr.design.login.executor; + +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.design.login.service.DesignerPassportManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerSmsRegisterExecutor implements Executor { + private String result = "[]"; + + private String regionCode; + private String phone; + private String password; + private String regToken; + + public DesignerSmsRegisterExecutor(String regionCode, String phone, String password, String regToken) { + this.regionCode = regionCode; + this.phone = phone; + this.password = password; + this.regToken = regToken; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[]{ + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + result = String.valueOf(DesignerPassportManager.getInstance().smsRegister(regionCode, phone, password, regToken)); + } + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideBridge.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideBridge.java new file mode 100644 index 000000000..9b9c561e7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideBridge.java @@ -0,0 +1,83 @@ +package com.fr.design.login.guide; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.bridge.exec.JSBridge; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.login.DesignerLoginHelper; +import com.fr.design.login.DesignerLoginSource; +import com.teamdev.jxbrowser.chromium.Browser; +import com.teamdev.jxbrowser.chromium.JSObject; +import javax.swing.JOptionPane; +import javax.swing.SwingUtilities; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuideBridge { + + public static DesignerGuideBridge getBridge(Browser browser) { + return new DesignerGuideBridge(browser); + } + + private JSObject window; + + private DesignerGuideBridge(Browser browser) { + this.window = browser.executeJavaScriptAndReturnValue("window").asObject(); + } + + @JSBridge + public String i18nText(String key) { + return Toolkit.i18nText(key); + } + + @JSBridge + public void closeWindow(boolean doNotRemind, boolean login) { + if (login) { + DesignerGuideHelper.closeWindow(); + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.GUIDE); + checkDoNotRemind(doNotRemind); + } else { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + String[] options = new String[]{ + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Quit"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Return_Login") + }; + int rv = FineJOptionPane.showConfirmDialog( + DesignerGuideHelper.getDialog(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Quit_Tip"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + JOptionPane.YES_NO_OPTION, + JOptionPane.WARNING_MESSAGE, + null, + options, + options[1] + ); + if (rv == JOptionPane.YES_OPTION) { + DesignerGuideHelper.closeWindow(); + checkDoNotRemind(doNotRemind); + } else if (rv == JOptionPane.NO_OPTION) { + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.GUIDE); + DesignerGuideHelper.closeWindow(); + checkDoNotRemind(doNotRemind); + } + } + }); + } + } + + /** + * 用户勾选了一个月内不再提醒 + */ + private void checkDoNotRemind(boolean doNotRemind) { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + manager.setDesignerLoginDoNotRemind(doNotRemind); + if (doNotRemind) { + manager.setDesignerLoginDoNotRemindSelectedTime(System.currentTimeMillis()); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java new file mode 100644 index 000000000..8adebba4f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideHelper.java @@ -0,0 +1,123 @@ +package com.fr.design.login.guide; + +import com.fr.base.FRContext; +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.UIDialog; +import com.fr.design.event.DesignerOpenedListener; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.os.impl.SupportOSImpl; +import com.fr.design.update.push.DesignerPushUpdateManager; +import com.fr.stable.StringUtils; +import javax.swing.WindowConstants; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuideHelper { + + private static final String MAIN_RESOURCE_PATH = "/com/fr/design/login/guide.html"; + private static final String JXBROWSER = "com.teamdev.jxbrowser.chromium.Browser"; + private static final long ONE_WEEK = 7 * 24 * 3600 * 1000L; + private static final long ONE_MONTH = 30 * 24 * 3600 * 1000L; + private static final long SIX_MONTH = 6 * ONE_MONTH; + + private static UIDialog dialog = null; + + public static String getMainResourcePath() { + return MAIN_RESOURCE_PATH; + } + + public static UIDialog getDialog() { + return dialog; + } + + public static void prepareShowGuideDialog() { + // 如果存在更新升级的弹窗,则不显示引导页面 + if (!SupportOSImpl.DESIGNER_LOGIN.support() || !FRContext.isChineseEnv() || DesignerPushUpdateManager.getInstance().isShouldPopUp()) { + return; + } + if (isActivatedForOneWeek()) { + if (isLogin() && !isLoginForSixMonths()) { + return; + } + if (selectedDoNotRemindInOneMonth()) { + return; + } + DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { + @Override + public void designerOpened() { + showGuideDialog(); + } + }); + } + } + + /** + * 激活满一周 + */ + private static boolean isActivatedForOneWeek() { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + String key = manager.getActivationKey(); + if (StringUtils.isEmpty(key)) { + return false; + } + return (System.currentTimeMillis() - manager.getDesignerActivatedTime()) > ONE_WEEK; + } + + /** + * 已经登录 + */ + private static boolean isLogin() { + return DesignerEnvManager.getEnvManager().getDesignerLoginUid() > 0; + } + + /** + * 已经登录满六个月 + */ + private static boolean isLoginForSixMonths() { + return isLogin() && (System.currentTimeMillis() - DesignerEnvManager.getEnvManager().getDesignerLastLoginTime()) > SIX_MONTH; + } + + /** + * 一个月内不再提醒 + */ + private static boolean selectedDoNotRemindInOneMonth() { + return DesignerEnvManager.getEnvManager().isDesignerLoginDoNotRemind() + && (System.currentTimeMillis() - DesignerEnvManager.getEnvManager().getDesignerLoginDoNotRemindSelectedTime()) <= ONE_MONTH; + } + + private static void showGuideDialog() { + boolean hasJxBrowser = true; + try { + Class.forName(JXBROWSER); + } catch (ClassNotFoundException e) { + hasJxBrowser = false; + } + if (hasJxBrowser) { + showGuidePane(); + } + } + + private static void showGuidePane() { + DesignerGuidePane designerGuidePane = new DesignerGuidePane(); + if (dialog == null) { + dialog = new DesignerGuideShowDialog(DesignerContext.getDesignerFrame(), designerGuidePane); + } + dialog.setVisible(true); + } + + public static void closeWindow() { + if (dialog != null) { + dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + dialog.setVisible(false); + dialog = null; + } + } + + public static void main(String[] args) { + DesignerEnvManager.getEnvManager().setOpenDebug(true); + showGuideDialog(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuidePane.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuidePane.java new file mode 100644 index 000000000..64bd316ef --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuidePane.java @@ -0,0 +1,37 @@ +package com.fr.design.login.guide; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.login.guide.utils.DesignerGuideUtils; +import com.fr.design.ui.ModernUIPane; +import com.teamdev.jxbrowser.chromium.JSValue; +import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; +import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent; +import java.awt.BorderLayout; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuidePane extends BasicPane { + + @Override + protected String title4PopupWindow() { + return "DESIGNER_GUIDE"; + } + + public DesignerGuidePane() { + setLayout(new BorderLayout()); + ModernUIPane modernUIPane = new ModernUIPane.Builder<>() + .prepare(new ScriptContextAdapter() { + @Override + public void onScriptContextCreated(ScriptContextEvent event) { + JSValue window = event.getBrowser().executeJavaScriptAndReturnValue("window"); + window.asObject().setProperty("DesignerGuideHelper", DesignerGuideBridge.getBridge(event.getBrowser())); + } + }) + .withEMB(DesignerGuideHelper.getMainResourcePath(), DesignerGuideUtils.renderMap()) + .build(); + add(modernUIPane, BorderLayout.CENTER); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideShowDialog.java b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideShowDialog.java new file mode 100644 index 000000000..f50c3c0b8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/DesignerGuideShowDialog.java @@ -0,0 +1,35 @@ +package com.fr.design.login.guide; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.UIDialog; +import com.fr.design.utils.gui.GUICoreUtils; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Frame; +import javax.swing.JPanel; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuideShowDialog extends UIDialog { + + private static final Dimension DEFAULT = new Dimension(700, 577); + + public DesignerGuideShowDialog(Frame frame, BasicPane pane) { + super(frame); + setUndecorated(true); + JPanel panel = (JPanel) getContentPane(); + panel.setLayout(new BorderLayout()); + add(pane, BorderLayout.CENTER); + setSize(DEFAULT); + GUICoreUtils.centerWindow(this); + setResizable(false); + } + + @Override + public void checkValid() throws Exception { + + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/guide/utils/DesignerGuideUtils.java b/designer-base/src/main/java/com/fr/design/login/guide/utils/DesignerGuideUtils.java new file mode 100644 index 000000000..81901b182 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/guide/utils/DesignerGuideUtils.java @@ -0,0 +1,19 @@ +package com.fr.design.login.guide.utils; + +import com.fr.general.GeneralContext; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerGuideUtils { + + public static Map renderMap() { + Map map4Tpl = new HashMap<>(); + map4Tpl.put("language", GeneralContext.getLocale().toString()); + return map4Tpl; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java b/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java new file mode 100644 index 000000000..c053fc0e5 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/message/DesignerMessageHelper.java @@ -0,0 +1,112 @@ +package com.fr.design.login.message; + +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.NotificationDialog; +import com.fr.design.dialog.NotificationDialogAction; +import com.fr.design.event.DesignerOpenedListener; +import com.fr.design.login.utils.DesignerLoginUtils; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.utils.BrowseUtils; +import com.fr.general.CloudCenter; +import com.fr.general.http.HttpToolbox; +import com.fr.json.JSON; +import com.fr.json.JSONFactory; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/11 + */ +public class DesignerMessageHelper { + + private static final long DELAY = 7L; + private static final String STATUS = "status"; + private static final String DATA = "data"; + private static final String SUCCESS = "success"; + private static final String MESSAGE_ID = "messageId"; + private static final String TITLE = "title"; + private static final String BODY = "body"; + private static final String JUMP_TYPE = "jumpType"; + private static final String JUMP_TO = "jumpTo"; + + private static DesignerMessageHelper instance; + + private DesignerMessageHelper() { + } + + public static DesignerMessageHelper getInstance() { + if (instance == null) { + instance = new DesignerMessageHelper(); + } + return instance; + } + + public void prepareShowMessage() { + DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { + @Override + public void designerOpened() { + ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("DesignerMessageHelper")); + service.schedule(new Runnable() { + @Override + public void run() { + try { + pullLatestMessage(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }, DELAY, TimeUnit.MINUTES); + service.shutdown(); + } + }); + } + + private void pullLatestMessage() throws Exception { + String url = CloudCenter.getInstance().acquireUrlByKind("designer.message.push", "https://market.fanruan.com/api/v1/message/designer"); + Map params = new HashMap<>(); + params.put("designerId", DesignerEnvManager.getEnvManager().getUUID()); + String result = HttpToolbox.post(url, params); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + String status = response.optString(STATUS); + if (SUCCESS.equals(status)) { + parseLatestMessage(response.optJSONObject(DATA)); + } + } + + private void parseLatestMessage(JSONObject data) { + String messageId = data.optString(MESSAGE_ID); + String title = data.optString(TITLE); + String body = data.optString(BODY); + int jumpType = data.optInt(JUMP_TYPE); + String jumpTo = data.optString(JUMP_TO); + if (StringUtils.isNotEmpty(messageId) && StringUtils.isNotEmpty(title) && StringUtils.isNotEmpty(body) && jumpType > 0 && StringUtils.isNotEmpty(jumpTo)) { + NotificationJumpType notificationJumpType = NotificationJumpType.valueOf(jumpType); + if (notificationJumpType == NotificationJumpType.WEB_URL) { + NotificationDialog.defaultPopup(messageId, title, body, new NotificationDialogAction() { + @Override + public String name() { + return jumpTo; + } + + @Override + public void doClick() { + String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(jumpTo); + BrowseUtils.browser(ssoUrl); + } + }); + } else if (notificationJumpType == NotificationJumpType.DESIGNER_MODULE) { + NotificationActionType notificationActionType = NotificationActionType.valueOf(jumpTo); + NotificationDialog.defaultPopup(messageId, title, body, notificationActionType.getAction()); + } + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/message/NotificationActionType.java b/designer-base/src/main/java/com/fr/design/login/message/NotificationActionType.java new file mode 100644 index 000000000..e34caa745 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/message/NotificationActionType.java @@ -0,0 +1,92 @@ +package com.fr.design.login.message; + +import com.fr.config.ServerPreferenceConfig; +import com.fr.design.dialog.NotificationDialogAction; +import com.fr.design.extra.WebViewDlgHelper; +import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.os.impl.SupportOSImpl; +import com.fr.design.upm.UpmFinder; +import com.fr.design.utils.DesignUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; +import com.fr.stable.bridge.StableFactory; +import com.fr.stable.os.Arch; +import com.fr.stable.os.OperatingSystem; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/11 + */ +public enum NotificationActionType { + PLUGIN("PLUGIN", new NotificationDialogAction() { + @Override + public String name() { + return "PLUGIN"; + } + + @Override + public void doClick() { + try { + if (Arch.getArch() == Arch.ARM || OperatingSystem.isLinux() || SupportOSImpl.MACOS_WEB_PLUGIN_MANAGEMENT.support()) { + DesignUtils.visitEnvServerByParameters("#management/plugin", null, null); + return; + } + if (ServerPreferenceConfig.getInstance().isUseOptimizedUPM() || SupportOSImpl.MACOS_NEW_PLUGIN_MANAGEMENT.support()) { + UpmFinder.showUPMDialog(); + } else { + WebViewDlgHelper.createPluginDialog(); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }), + REUSE("REUSE", new NotificationDialogAction() { + @Override + public String name() { + return "REUSE"; + } + + @Override + public void doClick() { + try { + BaseJForm jform = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, BaseJForm.class); + DesignerContext.getDesignerFrame().addAndActivateJTemplate((JTemplate) jform); + EastRegionContainerPane.getInstance().showContainer(); + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }), + UNKNOWN(StringUtils.EMPTY, new NotificationDialogAction() { + @Override + public String name() { + return "UNKNOWN"; + } + + @Override + public void doClick() { + } + }); + + private String jumpTo; + private NotificationDialogAction action; + + NotificationActionType(String jumpTo, NotificationDialogAction action) { + this.jumpTo = jumpTo; + this.action = action; + } + + public String getJumpTo() { + return jumpTo; + } + + public NotificationDialogAction getAction() { + return action; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/message/NotificationJumpType.java b/designer-base/src/main/java/com/fr/design/login/message/NotificationJumpType.java new file mode 100644 index 000000000..e1b8f04ac --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/message/NotificationJumpType.java @@ -0,0 +1,31 @@ +package com.fr.design.login.message; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/11 + */ +public enum NotificationJumpType { + WEB_URL(1), + DESIGNER_MODULE(2), + UNKNOWN(-1); + + private int jumpType; + + NotificationJumpType(int jumpType) { + this.jumpType = jumpType; + } + + public int getJumpType() { + return jumpType; + } + + public static NotificationJumpType valueOf(int jumpType) { + for(NotificationJumpType value : NotificationJumpType.values()) { + if(value.getJumpType() == jumpType) { + return value; + } + } + return UNKNOWN; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginClient.java b/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginClient.java new file mode 100644 index 000000000..8e68128c8 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginClient.java @@ -0,0 +1,167 @@ +package com.fr.design.login.service; + +import com.fr.general.CloudCenter; +import com.fr.general.http.HttpToolbox; +import com.fr.general.log.MessageFormatter; +import com.fr.json.JSON; +import com.fr.json.JSONFactory; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; +import com.fr.third.org.apache.commons.lang3.RandomStringUtils; +import java.util.HashMap; +import java.util.UUID; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerLoginClient { + + private static final String LOGIN_API = CloudCenter.getInstance().acquireUrlByKind("designer.login.api", "http://api.shequ.fanruan.com/v1/user/login/"); + private static final String SEND_CAPTCHA_API = CloudCenter.getInstance().acquireUrlByKind("designer.send.captcha.api", "http://api.shequ.fanruan.com/v1/code/getsmscaptcha/?location={}&phone={}&smstype={}"); + private static final String SMS_LOGIN_API = CloudCenter.getInstance().acquireUrlByKind("designer.sms.login.api", "http://api.shequ.fanruan.com/v1/user/smslogin/"); + private static final String SMS_REGISTER_API = CloudCenter.getInstance().acquireUrlByKind("designer.sms.register.api", "http://api.shequ.fanruan.com/v1/user/register/"); + private static final String USERNAME = "username"; + private static final String PASSWORD = "password"; + private static final String SMS_TYPE_LOGIN_AND_REGISTER = "1"; + private static final String LOCATION = "location"; + private static final String PHONE = "phone"; + private static final String CODE = "code"; + private static final String STATUS = "status"; + private static final String DATA = "data"; + private static final String CLIENT = "client"; + private static final String UID = "uid"; + private static final String APP_ID = "appid"; + private static final String REFRESH_TOKEN = "refresh_token"; + private static final String REGISTER = "register"; + private static final String REG_TOKEN = "regtoken"; + private static final String REG_PHONE = "regphone"; + private static final String DEVICE = "device"; + private static final String REG_FROM = "reg_from"; + private static final String PRODUCT_FINEREPORT = "product-finereport"; + + /** + * 服务器内部错误 + */ + private static final int INTERNAL_ERROR = 0; + + /** + * 未知错误 + */ + private static final int UNKNOWN_ERROR = -3; + + /** + * 网络连接失败 + */ + private static final int NETWORK_CONNECTED_FAILED = -4; + + public DesignerLoginResult login(String username, String password) { + try { + HashMap params = new HashMap<>(); + params.put(USERNAME, username); + params.put(PASSWORD, password); + String result = HttpToolbox.post(LOGIN_API, params); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + int status = response.optInt(STATUS); + if (status < 0) { + return DesignerLoginResult.create(status, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + JSONObject data = response.optJSONObject(DATA); + if (data != null) { + JSONObject client = data.optJSONObject(CLIENT); + if (client != null) { + int uid = client.optInt(UID); + if (uid > 0) { + return DesignerLoginResult.create(uid, client.optString(USERNAME), client.optString(APP_ID), data.optString(REFRESH_TOKEN), false, StringUtils.EMPTY); + } + } + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return DesignerLoginResult.create(NETWORK_CONNECTED_FAILED, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + return DesignerLoginResult.create(UNKNOWN_ERROR, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + + public int sendCaptcha(String regionCode, String phone) { + try { + String url = MessageFormatter.arrayFormat(SEND_CAPTCHA_API, new String[]{regionCode, phone, SMS_TYPE_LOGIN_AND_REGISTER}).getMessage(); + String result = HttpToolbox.get(url); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + return response.optInt(STATUS); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return INTERNAL_ERROR; + } + + public DesignerLoginResult smsLogin(String regionCode, String phone, String code) { + try { + HashMap params = new HashMap<>(); + params.put(LOCATION, regionCode); + params.put(PHONE, phone); + params.put(CODE, code); + String result = HttpToolbox.post(SMS_LOGIN_API, params); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + int status = response.optInt(STATUS); + if (status < 0) { + return DesignerLoginResult.create(status, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + JSONObject data = response.optJSONObject(DATA); + if (data != null) { + boolean register = data.optBoolean(REGISTER); + if (register) { + String regToken = data.optString(REG_TOKEN); + if (regToken != null) { + return DesignerLoginResult.create(status, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, true, regToken); + } + } else { + JSONObject client = data.optJSONObject(CLIENT); + if (client != null) { + int uid = client.optInt(UID); + if (uid > 0) { + return DesignerLoginResult.create(uid, client.optString(USERNAME), client.optString(APP_ID), data.optString(REFRESH_TOKEN), false, StringUtils.EMPTY); + } + } + } + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return DesignerLoginResult.create(INTERNAL_ERROR, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + + public DesignerLoginResult smsRegister(String regionCode, String phone, String password, String regToken) { + try { + HashMap params = new HashMap<>(); + params.put(USERNAME, RandomStringUtils.randomAlphabetic(8)); + params.put(PASSWORD, password); + params.put(REG_TOKEN, regToken); + params.put(LOCATION, regionCode); + params.put(REG_PHONE, phone); + params.put(DEVICE, PRODUCT_FINEREPORT); + params.put(REG_FROM, PRODUCT_FINEREPORT); + String result = HttpToolbox.post(SMS_REGISTER_API, params); + JSONObject response = JSONFactory.createJSON(JSON.OBJECT, result); + int status = response.optInt(STATUS); + if (status < 0) { + return DesignerLoginResult.create(status, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } + JSONObject data = response.optJSONObject(DATA); + if (data != null) { + JSONObject client = data.optJSONObject(CLIENT); + if (client != null) { + int uid = client.optInt(UID); + if (uid > 0) { + return DesignerLoginResult.create(uid, client.optString(USERNAME), client.optString(APP_ID), data.optString(REFRESH_TOKEN), false, StringUtils.EMPTY); + } + } + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return DesignerLoginResult.create(INTERNAL_ERROR, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY, false, StringUtils.EMPTY); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginResult.java b/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginResult.java new file mode 100644 index 000000000..891285520 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/service/DesignerLoginResult.java @@ -0,0 +1,82 @@ +package com.fr.design.login.service; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerLoginResult { + + private int uid; + + private String username; + + private String appId; + + private String refreshToken; + + private boolean register; + + private String regToken; + + private DesignerLoginResult(int uid, String username, String appId, String refreshToken, boolean register, String regToken) { + this.uid = uid; + this.username = username; + this.appId = appId; + this.refreshToken = refreshToken; + this.regToken = regToken; + this.register = register; + } + + public static DesignerLoginResult create(int uid, String username, String appId, String refreshToken, boolean register, String regToken) { + return new DesignerLoginResult(uid, username, appId, refreshToken, register, regToken); + } + + public int getUid() { + return uid; + } + + public void setUid(int uid) { + this.uid = uid; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + + public boolean isRegister() { + return register; + } + + public void setRegister(boolean register) { + this.register = register; + } + + public String getRegToken() { + return regToken; + } + + public void setRegToken(String regToken) { + this.regToken = regToken; + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/service/DesignerPassportManager.java b/designer-base/src/main/java/com/fr/design/login/service/DesignerPassportManager.java new file mode 100644 index 000000000..446a30f8b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/service/DesignerPassportManager.java @@ -0,0 +1,114 @@ +package com.fr.design.login.service; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.login.DesignerLoginType; +import com.fr.design.upm.event.CertificateEvent; +import com.fr.event.EventDispatcher; +import com.fr.json.JSONObject; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/28 + */ +public class DesignerPassportManager { + + private static final String STATUS = "status"; + private static final String REGISTER = "register"; + private static final String REG_TOKEN = "regtoken"; + + private static volatile DesignerPassportManager instance = null; + + public static DesignerPassportManager getInstance() { + if (instance == null) { + synchronized (DesignerPassportManager.class) { + if (instance == null) { + instance = new DesignerPassportManager(); + } + } + } + return instance; + } + + /** + * 账号密码登录帆软通行证 + * + * @param username 论坛账号 + * @param password 密码 + */ + public int login(String username, String password) { + DesignerLoginClient client = new DesignerLoginClient(); + DesignerLoginResult result = client.login(username, password); + int uid = result.getUid(); + if (uid > 0) { + saveUserInfo(uid, result.getUsername(), result.getAppId(), result.getRefreshToken(), DesignerLoginType.NORMAL_LOGIN, username); + } + return uid; + } + + /** + * 发送短信验证码 + * + * @param regionCode 区号 + * @param phone 手机 + */ + public int sendCaptcha(String regionCode, String phone) { + DesignerLoginClient client = new DesignerLoginClient(); + return client.sendCaptcha(regionCode, phone); + } + + /** + * 短信登录帆软通行证 + * + * @param regionCode 区号 + * @param phone 手机 + * @param code 验证码 + */ + public String smsLogin(String regionCode, String phone, String code) { + DesignerLoginClient client = new DesignerLoginClient(); + DesignerLoginResult result = client.smsLogin(regionCode, phone, code); + int uid = result.getUid(); + if (uid > 0) { + saveUserInfo(uid, result.getUsername(), result.getAppId(), result.getRefreshToken(), DesignerLoginType.SMS_LOGIN, regionCode + "-" + phone); + } + JSONObject jo = new JSONObject(); + jo.put(STATUS, result.getUid()); + jo.put(REGISTER, result.isRegister()); + jo.put(REG_TOKEN, result.getRegToken()); + return jo.toString(); + } + + /** + * 注册帆软通行证 + * + * @param regionCode 区号 + * @param phone 手机 + * @param password 密码 + * @param regToken 注册令牌 + */ + public int smsRegister(String regionCode, String phone, String password, String regToken) { + DesignerLoginClient client = new DesignerLoginClient(); + DesignerLoginResult result = client.smsRegister(regionCode, phone, password, regToken); + int uid = result.getUid(); + if (uid > 0) { + saveUserInfo(uid, result.getUsername(), result.getAppId(), result.getRefreshToken(), DesignerLoginType.SMS_LOGIN, regionCode + "-" + phone); + } + return uid; + } + + /** + * 保存登录信息 + */ + private void saveUserInfo(int uid, String username, String appId, String refreshToken, DesignerLoginType type, String account) { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + manager.setDesignerLoginUid(uid); + manager.setDesignerLoginUsername(username); + manager.setDesignerLoginAppId(appId); + manager.setDesignerLoginRefreshToken(refreshToken); + manager.setDesignerLastLoginTime(System.currentTimeMillis()); + manager.setLastLoginType(type); + manager.setLastLoginAccount(account); + DesignerEnvManager.getEnvManager().saveXMLFile(); + EventDispatcher.fire(CertificateEvent.LOGIN, username); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java b/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java new file mode 100644 index 000000000..d60b97d0f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/socketio/LoginAuthServer.java @@ -0,0 +1,87 @@ +package com.fr.design.login.socketio; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.login.DesignerLoginType; +import com.fr.design.login.bean.BBSAccountLogin; +import com.fr.design.upm.event.CertificateEvent; +import com.fr.event.EventDispatcher; +import com.fr.log.FineLoggerFactory; +import com.fr.third.socketio.AckRequest; +import com.fr.third.socketio.Configuration; +import com.fr.third.socketio.SocketIOClient; +import com.fr.third.socketio.SocketIOServer; +import com.fr.third.socketio.listener.DataListener; +import java.net.URLDecoder; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/3 + */ +public class LoginAuthServer { + + private SocketIOServer server; + + private static final String HOSTNAME = "localhost"; + private static final int PORT = 41925; + + private static volatile LoginAuthServer instance = null; + + public static LoginAuthServer getInstance() { + if (instance == null) { + synchronized (LoginAuthServer.class) { + if (instance == null) { + instance = new LoginAuthServer(); + } + } + } + return instance; + } + + private LoginAuthServer() { + Configuration config = new Configuration(); + config.setHostname(HOSTNAME); + config.setPort(PORT); + server = new SocketIOServer(config); + initEventListener(); + } + + public void start() { + try { + server.start(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + public void stop() { + try { + server.stop(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + private void initEventListener() { + server.addEventListener("bbsAccountLogin", BBSAccountLogin.class, new DataListener() { + @Override + public void onData(SocketIOClient client, BBSAccountLogin data, AckRequest ackRequest) throws Exception { + // 保存登录信息到.FineReport100配置中 + int uid = data.getUid(); + if (uid > 0) { + String username = URLDecoder.decode(data.getUsername(), "UTF-8"); + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + manager.setDesignerLoginUid(data.getUid()); + manager.setDesignerLoginUsername(username); + manager.setDesignerLoginAppId(data.getAppId()); + manager.setDesignerLoginRefreshToken(data.getRefreshToken()); + manager.setDesignerLastLoginTime(System.currentTimeMillis()); + manager.setLastLoginType(DesignerLoginType.NORMAL_LOGIN); + manager.setLastLoginAccount(username); + DesignerEnvManager.getEnvManager().saveXMLFile(); + EventDispatcher.fire(CertificateEvent.LOGIN, username); + } + } + }); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/task/DesignerLoginTaskWorker.java b/designer-base/src/main/java/com/fr/design/login/task/DesignerLoginTaskWorker.java new file mode 100644 index 000000000..df47d71f6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/task/DesignerLoginTaskWorker.java @@ -0,0 +1,51 @@ +package com.fr.design.login.task; + +import com.fr.design.bridge.exec.JSCallback; +import com.fr.design.bridge.exec.JSUtils; +import com.fr.design.extra.Process; +import com.fr.design.extra.exe.Command; +import com.fr.design.extra.exe.Executor; +import com.fr.stable.StringUtils; +import javax.swing.SwingWorker; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/27 + */ +public class DesignerLoginTaskWorker extends SwingWorker { + + private Executor executor; + private JSCallback callback; + + public DesignerLoginTaskWorker(final JSCallback callback, final Executor executor) { + this.executor = executor; + this.callback = callback; + } + + @Override + protected V doInBackground() throws Exception { + Command[] commands = executor.getCommands(); + for (Command command : commands) { + String message = command.getExecuteMessage(); + if (StringUtils.isNotBlank(message)) { + publish(message); + } + command.run(new Process() { + @Override + public void process(String s) { + if (StringUtils.isNotBlank(s)) { + publish(JSUtils.trimText(s)); + } + } + }); + } + return null; + } + + @Override + protected void done() { + String result = executor.getTaskFinishMessage(); + callback.execute(result); + } +} diff --git a/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java b/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java new file mode 100644 index 000000000..26e095df6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/login/utils/DesignerLoginUtils.java @@ -0,0 +1,89 @@ +package com.fr.design.login.utils; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.log.MessageFormatter; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.third.org.bouncycastle.util.encoders.Hex; +import java.awt.Window; +import java.security.SecureRandom; +import java.util.HashMap; +import java.util.Map; +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/5/21 + */ +public class DesignerLoginUtils { + + private static final String PRODUCT_FINEREPORT = "product-finereport"; + + private static final String KEY = "i7hP48WAcuTrmxfN"; + + public static Map renderMap() { + Map map4Tpl = new HashMap<>(); + map4Tpl.put("language", GeneralContext.getLocale().toString()); + return map4Tpl; + } + + public static void showPluginRemindOnFirstLaunch(Window parent) { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + int uid = manager.getDesignerLoginUid(); + if (uid > 0) { + boolean pluginRemindOnFirstLaunch = manager.isPluginRemindOnFirstLaunch(); + if (pluginRemindOnFirstLaunch) { + DesignerToastMsgUtil.toastWarning( + com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Plugin_Tip"), + parent + ); + manager.setPluginRemindOnFirstLaunch(false); + } + } + } + + public static String generateDesignerSSOUrl(String referrer) { + String ssoTemplate = CloudCenter.getInstance().acquireUrlByKind("designer.sso.api", "https://id.fanruan.com/api/app/?code={}&referrer={}"); + try { + String code = generateLoginCode(); + MessageFormatter.FormattingTuple tuple = MessageFormatter.arrayFormat(ssoTemplate, new String[]{code, referrer}); + return tuple.getMessage(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return referrer; + } + + private static String generateLoginCode() throws Exception { + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + JSONObject jo = JSONObject.create(); + jo.put("uid", manager.getDesignerLoginUid()); + jo.put("username", manager.getDesignerLoginUsername()); + jo.put("source", PRODUCT_FINEREPORT); + byte[] iv = randomIv(); + return new String(Hex.encode(iv)) + encrypt(jo.toString(), KEY.getBytes(), iv); + } + + private static byte[] randomIv() { + byte[] salt = new byte[16]; + SecureRandom secureRandom = new SecureRandom(); + secureRandom.setSeed(System.currentTimeMillis()); + secureRandom.nextBytes(salt); + return salt; + } + + private static String encrypt(String content, byte[] key, byte[] iv) throws Exception { + SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES"); + Cipher cipher = Cipher.getInstance("AES/CTR/PKCS5Padding"); + IvParameterSpec ivParameterSpec = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec); + byte[] resultBytes = cipher.doFinal(content.getBytes()); + return new String(Hex.encode(resultBytes)); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java b/designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java new file mode 100644 index 000000000..2175804dc --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/ComponentReuseNotifyUtil.java @@ -0,0 +1,39 @@ +package com.fr.design.mainframe; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; +import com.fr.design.mainframe.toast.DesignerToastMsgUtil; +import com.fr.design.notification.SnapChat; +import com.fr.design.notification.SnapChatFactory; +import com.fr.design.notification.SnapChatKey; + +/** + * Created by kerry on 5/8/21 + */ +public class ComponentReuseNotifyUtil { + private static final String COMPONENT_SNAP_CHAT_KEY = "com.fr.component.share-components"; + + private ComponentReuseNotifyUtil() { + + } + + public static void enterWidgetLibExtraAction() { + if (ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib()) { + return; + } + SnapChat snapChat = SnapChatFactory.createSnapChat(false, new SnapChatKey() { + @Override + public String calc() { + return COMPONENT_SNAP_CHAT_KEY; + } + }); + if (snapChat.hasRead()) { + DesignerToastMsgUtil.toastPrompt(Toolkit.i18nText("Fine-Design_Component_Reuse_Merge_Prompt")); + } + ComponentReuseNotificationInfo.getInstance().setClickedWidgetLib(true); + DesignerEnvManager.getEnvManager().saveXMLFile(); + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignOperationEvent.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignOperationEvent.java new file mode 100644 index 000000000..5357cefbd --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignOperationEvent.java @@ -0,0 +1,15 @@ +package com.fr.design.mainframe; + +import com.fr.event.Event; +import com.fr.event.Null; + +/** + * Created by kerry on 4/28/21 + */ +public enum DesignOperationEvent implements Event { + + CELL_STYLE_MODIFY, + + CELL_IMAGE_VALUE_MODIFY + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java index 3d7fb8c48..25948b62c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java @@ -52,6 +52,7 @@ import com.fr.file.FILEFactory; import com.fr.file.FileFILE; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; +import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; import com.fr.invoke.Reflect; import com.fr.log.FineLoggerFactory; @@ -71,6 +72,7 @@ import com.fr.start.OemHandler; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import java.util.concurrent.CopyOnWriteArrayList; import org.jetbrains.annotations.Nullable; import javax.swing.Icon; @@ -132,7 +134,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta private static final Integer TOP_LAYER = 200; - private List designerOpenedListenerList = new ArrayList<>(); + private List designerOpenedListenerList = new CopyOnWriteArrayList<>(); private ToolBarMenuDock ad; @@ -484,6 +486,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta if (!DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isEnabled()) { ad.createAlphaFinePane().setVisible(false); } + northEastPane.add(ad.createNotificationCenterPane()); + OSSupportCenter.buildAction(new OSBasedAction() { @Override public void execute(Object... objects) { @@ -863,7 +867,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta JTemplate editingTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); StringBuilder defaultTitleSB = new StringBuilder(); - defaultTitleSB.append(ProductConstants.PRODUCT_NAME); + defaultTitleSB.append(ProductConstants.APP_NAME); + defaultTitleSB.append(" "); + defaultTitleSB.append(GeneralUtils.getVersion()); defaultTitleSB.append(" "); defaultTitleSB.append(ProductConstants.BRANCH); defaultTitleSB.append(" "); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java index 8361016ca..f540832d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java @@ -11,10 +11,10 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; -import java.awt.BorderLayout; -import java.awt.Component; import javax.swing.JComponent; import javax.swing.JLayeredPane; +import java.awt.BorderLayout; +import java.awt.Component; /** @@ -53,12 +53,11 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener // 判断是否切换设计器状态到禁止拷贝剪切 if (jt.getTarget().getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) { DesignModeContext.switchTo(DesignerMode.BAN_COPY_AND_CUT); - } else if (!DesignModeContext.isVcsMode() && !DesignModeContext.isAuthorityEditing()){ + } else if (!DesignModeContext.isVcsMode() && !DesignModeContext.isAuthorityEditing()) { DesignModeContext.switchTo(DesignerMode.NORMAL); } DesignerFrameFileDealerPane.getInstance().setCurrentEditingTemplate(jt); if (component != null) { - component.onLostFocus(); layeredPane.remove(component); } component = jt; @@ -69,7 +68,6 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener repaint(); revalidate(); component.requestGridFocus(); - component.onGetFocus(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 3bf9848de..847a2dcba 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -13,8 +13,12 @@ import com.fr.design.gui.ibutton.UIButtonUI; import com.fr.design.gui.icontainer.UIEastResizableContainer; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.mainframe.reuse.ReuseGuideDialog; +import com.fr.design.mainframe.reuse.SnapChatKeys; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.menu.SnapChatUtil; import com.fr.design.notification.SnapChat; +import com.fr.design.notification.SnapChatFactory; import com.fr.design.ui.util.UIUtil; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; @@ -97,6 +101,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private JPanel defaultPane; // "无可用配置项"面板 private JPanel defaultAuthorityPane; // "该元素不支持权限编辑" private PropertyItem selectedItem; // 当前被选中的属性配置项 + private SnapChat widgetLibSnapChat; public enum PropertyMode { REPORT, // 报表 @@ -297,9 +302,22 @@ public class EastRegionContainerPane extends UIEastResizableContainer { "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); // 组件库 - PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"), - "widgetlib", new PropertyMode[]{PropertyMode.FORM}, - new PropertyMode[]{PropertyMode.FORM}); + widgetLibSnapChat = SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT); + PropertyItem widgetLib = new PropertyItem( + KEY_WIDGET_LIB, + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Library"), + "widgetlib", + new PropertyMode[]{PropertyMode.FORM}, + new PropertyMode[]{PropertyMode.FORM}, + getWidgetLibSnapChat(), + getWidgetLibPromptWindow(), + new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + ComponentCollector.getInstance().collectCmpBoardClick(); + ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); + } + }); // 权限编辑 PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Permissions_Edition"), "authorityedit", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION_DISABLED}, @@ -514,6 +532,17 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyItemMap.get(KEY_WIDGET_LIB).replaceContentPane(pane); } + public SnapChat getWidgetLibSnapChat() { + return widgetLibSnapChat; + } + + public PromptWindow getWidgetLibPromptWindow() { + if (!getWidgetLibSnapChat().hasRead()) { + return new ReuseGuideDialog(DesignerContext.getDesignerFrame()); + } + return null; + } + public JComponent getWidgetLibPane() { return propertyItemMap.get(KEY_WIDGET_LIB).getContentPane(); } @@ -595,6 +624,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { if (propertyItem.isVisible() && propertyItem.isEnabled() && !propertyItem.isPoppedOut()) { propertyCard.show(rightPane, tabName); propertyItem.setTabButtonSelected(); + propertyItem.processSnapChat(); //从单元格菜单过来也要关闭弹出窗 hideCurrentPopupPane(); } @@ -713,19 +743,33 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private String iconSuffix = ICON_SUFFIX_NORMAL; // normal, diabled, selected, 三者之一 private final Color selectedBtnBackground = new Color(0xF5F5F7); private Color originBtnBackground; + private ActionListener actionListener; public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes) { this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null, null); } + public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow, ActionListener actionListener) { + this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, snapChat, promptWindow, actionListener); + } + + public PropertyItem(String name, String title, String btnIconName, PropertyMode[] visibleModes, PropertyMode[] enableModes, ActionListener actionListener) { + this(name, title, btnIconName, ICON_BASE_DIR, visibleModes, enableModes, null, null, actionListener); + } + public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow) { + this(name, title, btnIconName, iconBaseDir, visibleModes, enableModes, snapChat, promptWindow, null); + } + + public PropertyItem(String name, String title, String btnIconName, String iconBaseDir, PropertyMode[] visibleModes, PropertyMode[] enableModes, SnapChat snapChat, PromptWindow promptWindow, ActionListener actionListener) { this.name = name; this.title = title; this.btnIconName = btnIconName; this.iconBaseDir = iconBaseDir; this.snapChat = snapChat; this.promptWindow = promptWindow; + this.actionListener = actionListener; initButton(); initPropertyPanel(); initModes(visibleModes, enableModes); @@ -925,9 +969,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer { @Override public void paintComponent(Graphics g) { super.paintComponent(g); - if (snapChat != null && !snapChat.hasRead()) { - SnapChatUtil.paintPropertyItemPoint(g, getBounds()); - } } }; button.setDisabledIcon(IconUtils.readIcon(getIconBaseDir() + btnIconName + ICON_SUFFIX_DISABLED)); @@ -956,17 +997,25 @@ public class EastRegionContainerPane extends UIEastResizableContainer { popupFixedPane(); } setTabButtonSelected(); - if (snapChat != null && !snapChat.hasRead()) { - snapChat.markRead(); - if (promptWindow != null) { - promptWindow.showWindow(); - } - } + processSnapChat(); } }); + if (actionListener != null) { + button.addActionListener(actionListener); + } button.setToolTipText(title); } + public void processSnapChat(){ + if (snapChat != null && !snapChat.hasRead()) { + snapChat.markRead(); + if (promptWindow != null) { + promptWindow.showWindow(); + } + } + } + + public UIButton getButton() { return button; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 6c64e1eb6..9e8df6b85 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -39,7 +39,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.check.CheckButton; -import com.fr.design.mainframe.template.info.TemplateInfoCollector; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TimeConsumeTimer; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; @@ -79,7 +78,6 @@ import com.fr.stable.core.UUID; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; -import java.util.concurrent.Callable; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JComponent; @@ -91,6 +89,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Set; +import java.util.concurrent.Callable; /** * 报表设计和表单设计的编辑区域(设计器编辑的IO文件) @@ -107,16 +106,34 @@ public abstract class JTemplate> protected U undoState; protected U authorityUndoState = null; protected T template; // 当前模板 - protected TemplateProcessInfo processInfo; // 模板过程的相关信息 + /** + * 模板过程的相关信息 + * + * @deprecated move to cloud ops plugin,left only for compatible + */ + @Deprecated + protected TemplateProcessInfo processInfo; + private JComponent centerPane; private static short currentIndex = 0;// 此变量用于多次新建模板时,让名字不重复 private DesignModelAdapter designModel; private PreviewProvider previewType; + /** + * 统计模板制作耗时 + * + * @deprecated move to cloud ops plugin,left only for compatible + */ + @Deprecated protected TimeConsumeTimer consumeTimer = new TimeConsumeTimer(); private volatile boolean saving = false; private volatile boolean opening = false; private volatile boolean openFailed = false; + /** + * UI界面模板运行时唯一的id 不存储在模板中 仅在运行时使用 模板界面上关闭就不关注了 + */ + private final String runtimeId = UUID.randomUUID().toString(); + private PluginEventListener pluginListener; public JTemplate() { @@ -161,7 +178,6 @@ public abstract class JTemplate> addCenterPane(); this.undoState = createUndoState(); - consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); initAndStartPlugin(); } @@ -206,21 +222,22 @@ public abstract class JTemplate> } + /** + * @deprecated move to cloud ops plugin,left only for compatible + */ + @Deprecated void onGetFocus() { consumeTimer.start(); } + /** + * @deprecated move to cloud ops plugin,left only for compatible + */ + @Deprecated void onLostFocus() { consumeTimer.stop(); } - private boolean shouldInitForCollectInfo(boolean isNewFile) { - if (isNewFile) { - return true; - } - // 不是新建模板,但是已经在收集列表中 - return TemplateInfoCollector.getInstance().contains(template.getTemplateID()); - } // 刷新右侧属性面板 public abstract void refreshEastPropertiesPane(); @@ -229,30 +246,33 @@ public abstract class JTemplate> public abstract JComponent getCurrentReportComponentPane(); - // 为收集模版信息作准备 - private void initForCollect() { + /** + * 为另存的模板创建新的模板id + */ + private void generateNewTemplateIdForSaveAs() { generateTemplateId(); - consumeTimer.setEnabled(true); - consumeTimer.start(); } - private void collectInfo() { // 执行收集操作 - collectInfo(StringUtils.EMPTY); + /** + * 收集图表信息 + */ + private void collectInfo() { + ChartInfoCollector.getInstance().collectInfo(template.getTemplateID(), StringUtils.EMPTY, getProcessInfo(), 0); } - private void collectInfo(String originID) { // 执行收集操作 + /** + * 另存模板时收集图表信息 + * + * @param originID 原始模板id + */ + private void collectInfoWhenSaveAs(String originID) { ChartInfoCollector.getInstance().collectInfo(template.getTemplateID(), originID, getProcessInfo(), 0); - if (!consumeTimer.isEnabled()) { - return; - } - try { - int timeConsume = consumeTimer.popTime(); - TemplateInfoCollector.getInstance().collectInfo(template.getTemplateID(), originID, getProcessInfo(), timeConsume); - } catch (Throwable th) { // 不管收集过程中出现任何异常,都不应该影响模版保存 - } - consumeTimer.start(); // 准备下一次计算 } + /** + * @deprecated move to cloud ops plugin + */ + @Deprecated public abstract TemplateProcessInfo getProcessInfo(); public U getUndoState() { @@ -347,7 +367,7 @@ public abstract class JTemplate> /** * 刷新内部资源 - * + *

* 刷新资源的同时。 * CenterPane 负责监听改动。 * 所以需要同步处理 @@ -415,7 +435,7 @@ public abstract class JTemplate> protected abstract DesignModelAdapter createDesignModel(); - protected DesignModelAdapter createDesignModel(Parameter[] parameters) { + protected DesignModelAdapter createDesignModel(Parameter[] parameters) { // 空实现 兼容下 return null; } @@ -675,6 +695,7 @@ public abstract class JTemplate> /** * Web预览的时候需要隐藏掉除“报表运行环境”外的路径(C盘D盘等) isShowLoc = false + * 被云端运维插件修改用于收集埋点 * * @param isShowLoc 是否本地 * @return 保存成功返回true @@ -767,20 +788,24 @@ public abstract class JTemplate> } - // 保存新模板时会进入此方法(新建模板直接保存,或者另存为) + /** + * 保存新模板时会进入此方法(新建模板直接保存,或者另存为) + * 被云端运维插件修改用于收集埋点 + */ protected boolean saveNewFile(FILE editingFILE, String oldName) { String originID = StringUtils.EMPTY; - if (StringUtils.isNotEmpty(this.template.getTemplateID())) { - originID = this.template.getTemplateID(); + String currentId = this.template.getTemplateID(); + if (StringUtils.isNotEmpty(currentId)) { + originID = currentId; } // 在保存之前,初始化 templateID - initForCollect(); + generateNewTemplateIdForSaveAs(); this.editingFILE = editingFILE; boolean result = this.saveToNewFile(oldName); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); - collectInfo(originID); + collectInfoWhenSaveAs(originID); } return result; } @@ -792,7 +817,7 @@ public abstract class JTemplate> result = result || provider.saveToNewFile(this.editingFILE.getPath(), this); } if (!result) { - result = result || this.saveFile(); + result = this.saveFile(); //更换最近打开 DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getPath()); this.refreshToolArea(); @@ -871,10 +896,10 @@ public abstract class JTemplate> } /** + * @return java.lang.Integer WorkBook11.cpt则返回11,如果没有找到index返回null * @Description 返回文件名中的index * @param: prefix 前缀 * @param: fileName 文件名称全名 - * @return java.lang.Integer WorkBook11.cpt则返回11,如果没有找到index返回null * @Author Henry.Wang * @Date 2021/4/9 11:13 **/ @@ -1411,8 +1436,7 @@ public abstract class JTemplate> CallbackSaveWorker worker = new CallbackSaveWorker(new Callable() { @Override public Boolean call() throws Exception { - collectInfo(); - return JTemplate.this.saveRealFile(); + return saveRealFileByWorker(); } }, this); @@ -1426,6 +1450,14 @@ public abstract class JTemplate> return worker; } + /** + * 被云端运维插件修改用于收集埋点 + */ + private boolean saveRealFileByWorker() throws Exception { + collectInfo(); + return saveRealFile(); + } + private void callBackForSave() { JTemplate.this.saved = true; JTemplate.this.authoritySaved = true; @@ -1465,9 +1497,6 @@ public abstract class JTemplate> editingFILE = fileChooser.getSelectedFILE(); } - //收集和生成templateID 因为是另存为操作 无论怎么样都需要重新生成templateID - initForCollect(); - FILE finalEditingFILE = editingFILE; CallbackSaveWorker worker = new CallbackSaveWorker(new Callable() { @Override @@ -1482,7 +1511,7 @@ public abstract class JTemplate> callBackForSave(); // 当前打开的是正在保存的模板才刷新 if (ComparatorUtils.equals(JTemplate.this.template.getTemplateID(), - HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().template.getTemplateID())) { + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().template.getTemplateID())) { refreshToolArea(); } DesignerFrameFileDealerPane.getInstance().refresh(); @@ -1511,13 +1540,23 @@ public abstract class JTemplate> } } + /** + * 另存为时在 save worker 中保存实际的文件; + * 被云端运维插件修改用于收集埋点 + */ private boolean saveNewRealFile(FILE editingFILE, String oldName) throws Exception { - consumeTimer.setEnabled(true); - consumeTimer.start(); + + String originID = StringUtils.EMPTY; + String currentId = this.template.getTemplateID(); + if (StringUtils.isNotEmpty(currentId)) { + originID = currentId; + } + // 在保存之前,初始化 templateID + generateNewTemplateIdForSaveAs(); this.editingFILE = editingFILE; boolean result = this.saveToNewRealFile(oldName); if (result) { - collectInfo(this.template.getTemplateID()); + collectInfoWhenSaveAs(originID); } return result; } @@ -1549,13 +1588,13 @@ public abstract class JTemplate> @Override public void saveDirectly() { CallbackSaveWorker worker = save(); - worker.start(this.template.getTemplateID()); + worker.start(getRuntimeId()); } @Override public void saveAsDirectly() { CallbackSaveWorker worker = saveAs(); - worker.start(this.template.getTemplateID()); + worker.start(getRuntimeId()); } @Override @@ -1596,4 +1635,7 @@ public abstract class JTemplate> return !isSaving() && !isOpening() && !isOpenFailed(); } + public String getRuntimeId() { + return runtimeId; + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java index 15291211c..bd91a0b42 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointCollector.java @@ -29,7 +29,9 @@ import java.util.concurrent.ConcurrentHashMap; * @author Bjorn * @version 10.0 * Created by Bjorn on 2020-02-21 + * @deprecated moved to Cloud Ops plugin */ +@Deprecated public abstract class AbstractPointCollector implements BasePointCollector { protected Map pointInfoMap; diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java index 11058af5c..a1806981b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/AbstractPointInfo.java @@ -6,7 +6,9 @@ import java.util.List; * @author Bjorn * @version 10.0 * Created by Bjorn on 2020-02-21 + * @deprecated moved to Cloud Ops plugin */ +@Deprecated public abstract class AbstractPointInfo implements BasePointInfo { protected int idleDayCount; // 到现在为止,埋点闲置的天数 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java index f10f1682e..254d2344d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointCollector.java @@ -8,7 +8,9 @@ import com.fr.stable.xml.XMLWriter; * @author Bjorn * @version 10.0 * Created by Bjorn on 2020-02-21 + * @deprecated moved to Cloud Ops plugin */ +@Deprecated public interface BasePointCollector extends XMLReadable, XMLWriter { /** diff --git a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointInfo.java index b45f1cb6a..43d24108c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/burying/point/BasePointInfo.java @@ -10,7 +10,9 @@ import java.util.Map; * @author Bjorn * @version 10.0 * Created by Bjorn on 2020-02-21 + * @deprecated moved to Cloud Ops plugin */ +@Deprecated public interface BasePointInfo extends XMLReadable, XMLWriter { /** diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java index 262ccc877..7d687ac14 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfo.java @@ -5,7 +5,6 @@ import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.config.info.AbstractConfig; import com.fr.chartx.config.info.ChartConfigInfo; import com.fr.chartx.config.info.constant.ConfigType; -import com.fr.config.MarketConfig; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignerEnvManager; import com.fr.design.file.HistoryTemplateListCache; @@ -132,8 +131,8 @@ public class ChartInfo extends AbstractPointInfo implements Comparable chartConsumingMap = new HashMap<>(); - String username = MarketConfig.getInstance().getBbsUsername(); - String userId = String.valueOf(MarketConfig.getInstance().getBbsUid()); + String username = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); + String userId = String.valueOf(DesignerEnvManager.getEnvManager().getDesignerLoginUid()); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); String chartId = chartProvider.getChartUuid(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java index 1b34722e6..7c19278c2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/chart/info/ChartInfoCollector.java @@ -5,7 +5,6 @@ import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.config.info.AbstractConfig; import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.mainframe.burying.point.AbstractPointCollector; -import com.fr.design.mainframe.template.info.TemplateInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -31,6 +30,9 @@ public class ChartInfoCollector extends AbstractPointCollector { private static final String XML_CHART_INFO_LIST = "ChartInfoList"; private static final String XML_FILE_NAME = "chart.info"; + private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数 + private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 + private static ChartInfoCollector instance; private Map chartInfoCacheMap; @@ -217,10 +219,10 @@ public class ChartInfoCollector extends AbstractPointCollector { int floatCount = processInfo.getFloatCount(); int blockCount = processInfo.getBlockCount(); int widgetCount = processInfo.getWidgetCount(); - - return TemplateInfo.isTestTemplate(reportType, cellCount, floatCount, blockCount, widgetCount); + return isTestTemplate(reportType, cellCount, floatCount, blockCount, widgetCount); } + /** * 更新 day_count:打开设计器却未编辑图表的连续日子 */ @@ -282,4 +284,16 @@ public class ChartInfoCollector extends AbstractPointCollector { writer.end(); } + + private boolean isTestTemplate(int reportType, int cellCount, int floatCount, int blockCount, int widgetCount) { + boolean isTestTemplate; + if (reportType == 0) { // 普通报表 + isTestTemplate = cellCount <= VALID_CELL_COUNT && floatCount <= 1 && widgetCount <= VALID_WIDGET_COUNT; + } else if (reportType == 1) { // 聚合报表 + isTestTemplate = blockCount <= 1 && widgetCount <= VALID_WIDGET_COUNT; + } else { // 表单(reportType == 2) + isTestTemplate = widgetCount <= 1; + } + return isTestTemplate; + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java index 7757ea2f4..0ec50ef24 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java @@ -116,7 +116,7 @@ public class CheckButton extends UIButton { startCheck(checkThread); } }); - worker.start(jtemplate.getTarget().getTemplateID()); + worker.start(jtemplate.getRuntimeId()); } } else { if (!jtemplate.isSaved()) { @@ -127,7 +127,7 @@ public class CheckButton extends UIButton { startCheck(checkThread); } }); - worker.start(jtemplate.getTarget().getTemplateID()); + worker.start(jtemplate.getRuntimeId()); } else { startCheck(checkThread); } @@ -148,7 +148,7 @@ public class CheckButton extends UIButton { startCheck(checkThread); } }); - worker.start(jtemplate.getTarget().getTemplateID()); + worker.start(jtemplate.getRuntimeId()); } } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java new file mode 100644 index 000000000..0ec6f26ad --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfo.java @@ -0,0 +1,87 @@ +package com.fr.design.mainframe.reuse; + +import com.fr.design.DesignerEnvManager; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLable; +import com.fr.stable.xml.XMLableReader; + +/** + * Created by kerry on 5/8/21 + */ +public class ComponentReuseNotificationInfo implements XMLable { + public static final String XML_TAG = "ComponentReuseNotificationInfo"; + + private static final ComponentReuseNotificationInfo INSTANCE = new ComponentReuseNotificationInfo(); + + public static ComponentReuseNotificationInfo getInstance() { + return INSTANCE; + } + + private long lastNotifyTime = 0; + + private int notifiedNumber = 0; + + private boolean clickedWidgetLib = false; + + private long lastGuidePopUpTime = 0; + + public long getLastNotifyTime() { + return lastNotifyTime; + } + + public void setLastNotifyTime(long lastNotifyTime) { + this.lastNotifyTime = lastNotifyTime; + } + + public int getNotifiedNumber() { + return notifiedNumber; + } + + public void setNotifiedNumber(int notifiedNumber) { + this.notifiedNumber = notifiedNumber; + } + + public boolean isClickedWidgetLib() { + return clickedWidgetLib; + } + + public void setClickedWidgetLib(boolean clickedWidgetLib) { + this.clickedWidgetLib = clickedWidgetLib; + } + + public long getLastGuidePopUpTime() { + return lastGuidePopUpTime; + } + + public void setLastGuidePopUpTime(long lastGuidePopUpTime) { + this.lastGuidePopUpTime = lastGuidePopUpTime; + } + + public void updateLastGuidePopUpTime() { + this.setLastGuidePopUpTime(System.currentTimeMillis()); + DesignerEnvManager.getEnvManager().saveXMLFile(); + } + + @Override + public void readXML(XMLableReader reader) { + this.setLastNotifyTime(reader.getAttrAsLong("lastNotifyTime", 0L)); + this.setNotifiedNumber(reader.getAttrAsInt("notifiedNumber", 0)); + this.setClickedWidgetLib(reader.getAttrAsBoolean("clickedWidgetLib", false)); + this.setLastGuidePopUpTime(reader.getAttrAsLong("lastGuidePopUpTime", 0L)); + } + + @Override + public void writeXML(XMLPrintWriter writer) { + writer.startTAG("ComponentReuseNotificationInfo"); + writer.attr("lastNotifyTime", this.lastNotifyTime) + .attr("notifiedNumber", this.notifiedNumber) + .attr("clickedWidgetLib", this.clickedWidgetLib) + .attr("lastGuidePopUpTime", this.lastGuidePopUpTime); + writer.end(); + } + + @Override + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java new file mode 100644 index 000000000..a0e916659 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/reuse/ReuseGuideDialog.java @@ -0,0 +1,169 @@ +package com.fr.design.mainframe.reuse; + +import com.fr.base.background.ColorBackground; +import com.fr.design.dialog.UIDialog; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.PromptWindow; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.IOUtils; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.RenderingHints; +import java.awt.geom.RoundRectangle2D; + +public class ReuseGuideDialog extends UIDialog implements PromptWindow { + InnerDialog innerDialog; + private static final Dimension DEFAULT = new Dimension(735, 510); + + public ReuseGuideDialog(Frame parent) { + super(parent); + } + + @Override + public void showWindow() { + innerDialog = new InnerDialog(this); + JPanel backGroundPane = new JPanel() { + @Override + protected void paintComponent(Graphics g) { + Image icon = IOUtils.readImage("com/fr/base/images/share/background.png");// 003.jpg是测试图片在项目的根目录下 + g.drawImage(icon, 0, 0, getSize().width, getSize().height, this);// 图片会自动缩放 + } + }; + add(backGroundPane, BorderLayout.CENTER); + initStyle(); + innerDialog.showWindow(); + } + + private void initStyle() { + setSize(DEFAULT); + setUndecorated(true); + setBackground(new Color(0, 0, 0, 0)); + GUICoreUtils.centerWindow(this); + } + + @Override + public void hideWindow() { + ComponentReuseNotificationInfo.getInstance().updateLastGuidePopUpTime(); + this.setVisible(false); + if (innerDialog != null) { + innerDialog.setVisible(false); + innerDialog.dispose(); + innerDialog = null; + } + this.dispose(); + } + + @Override + public void checkValid() { + + } + + class InnerDialog extends UIDialog { + private final Dimension DEFAULT = new Dimension(700, 475); + private static final int TITLE_FONT_SIZE = 20; + + public InnerDialog(Dialog dialog) { + super(dialog); + } + + public void showWindow() { + add(createCenterPanel(), BorderLayout.CENTER); + add(createSouthPanel(), BorderLayout.SOUTH); + add(createNorthPanel(), BorderLayout.NORTH); + showDialog(); + } + + private JPanel createNorthPanel() { + JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + + //右上角关闭按钮 + JButton button = new JButton(new ImageIcon(IOUtils.readImage("/com/fr/base/images/share/close.png").getScaledInstance(15, 15, Image.SCALE_SMOOTH))); + button.setBorder(null); + button.setOpaque(false); + button.addActionListener(e -> ReuseGuideDialog.this.hideWindow()); + + northPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 15)); + northPanel.setOpaque(false); + northPanel.add(button); + return northPanel; + } + + private JPanel createCenterPanel() { + JPanel centerPanel = new JPanel(new BorderLayout()); + + UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Drag_And_Make_Component")); + UILabel imageLabel = new UILabel(new ImageIcon(IOUtils.readImage("com/fr/design/images/dashboard/guide.png").getScaledInstance(DEFAULT.width, DEFAULT.height, Image.SCALE_SMOOTH))); + titleLabel.setFont(new Font(titleLabel.getFont().getName(), Font.BOLD, TITLE_FONT_SIZE)); + titleLabel.setBorder(BorderFactory.createEmptyBorder()); + + JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER)); + panel.setOpaque(false); + panel.add(titleLabel); + + centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + centerPanel.setOpaque(false); + centerPanel.add(imageLabel, BorderLayout.CENTER); + centerPanel.add(panel, BorderLayout.NORTH); + return centerPanel; + } + + private JPanel createSouthPanel() { + JPanel southPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + JButton button = new JButton(Toolkit.i18nText("Fine-Design_Share_Try_Drag")) { + @Override + public void paint(Graphics g) { + ColorBackground buttonBackground = ColorBackground.getInstance(Color.decode("#419BF9")); + Graphics2D g2d = (Graphics2D) g; + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + buttonBackground.paint(g2d, new RoundRectangle2D.Double(0, 0, getWidth(), getHeight(), 8, 8)); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); + super.paint(g); + } + }; + button.setBorder(null); + button.setForeground(Color.WHITE); + button.setOpaque(false); + button.addActionListener(e -> ReuseGuideDialog.this.hideWindow()); + + southPanel.setBorder(BorderFactory.createEmptyBorder(0, 290, 19, 290)); + southPanel.setPreferredSize(new Dimension(DEFAULT.width, 51)); + southPanel.setOpaque(false); + southPanel.add(button); + return southPanel; + } + + /** + * 显示窗口 + */ + private void showDialog() { + setSize(DEFAULT); + setUndecorated(true); + GUICoreUtils.centerWindow(this); + setModalityType(ModalityType.APPLICATION_MODAL); + ReuseGuideDialog.this.setVisible(true); + setVisible(true); + } + + @Override + public void checkValid() { + + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/reuse/SnapChatKeys.java b/designer-base/src/main/java/com/fr/design/mainframe/reuse/SnapChatKeys.java new file mode 100644 index 000000000..8f07f503b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/reuse/SnapChatKeys.java @@ -0,0 +1,32 @@ +package com.fr.design.mainframe.reuse; + +import com.fr.design.notification.SnapChatKey; + +/** + * created by Harrison on 2020/03/24 + **/ +public enum SnapChatKeys implements SnapChatKey { + + /** + * 组件 + */ + COMPONENT("components"), + + /** + * 模板 + */ + TEMPLATE("template"); + + private String sign; + + private static final String PREFIX = "com.fr.component.share"; + + SnapChatKeys(String sign) { + this.sign = sign; + } + + @Override + public String calc() { + return PREFIX + "-" + sign; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java new file mode 100644 index 000000000..3ea805deb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentCollector.java @@ -0,0 +1,610 @@ +package com.fr.design.mainframe.share.collect; + +import com.fr.base.io.XMLReadHelper; +import com.fr.config.MarketConfig; +import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.constants.ComponentPath; +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; +import com.fr.form.share.group.filter.DirFilter; +import com.fr.form.share.group.filter.ReuFilter; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralUtils; +import com.fr.json.JSON; +import com.fr.json.JSONArray; +import com.fr.json.JSONException; +import com.fr.json.JSONFactory; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.context.PluginContexts; +import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLTools; +import com.fr.stable.xml.XMLable; +import com.fr.stable.xml.XMLableReader; +import com.fr.third.javax.xml.stream.XMLStreamException; +import com.fr.third.joda.time.DateTime; +import com.fr.third.joda.time.Days; +import com.fr.third.org.apache.commons.io.FileUtils; +import com.fr.workspace.WorkContext; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Iterator; + +/** + * created by Harrison on 2020/03/25 + **/ +public class ComponentCollector implements XMLable { + private static final long ONE_MINUTE = 60 * 1000L; + + private static final int REUSE_INFO_FIRST_POPUP = 1; + + private static final int REUSE_INFO_SECOND_POPUP = 2; + + private static final String SIMPLE_DATE_PATTERN = "yyyy-MM-dd"; + + private static final String XML = "ComponentCollector"; + + private static final String ACTIVATE_VALUE = "activateValue"; + + private static final String COMP_PKT_CLICK = "cmpPktClick"; + + private static final String DOWNLOAD_PKT_NUM = "downloadPktNum"; + + private static final String DOWNLOAD_CMP = "downloadCmp"; + + private static final int ACTIVATE_INITIAL_VALUE = 1; + + private static final String ACTIVATE_DATE = "date"; + + private static final String GENERATE_CMP_RECORD_NAME = "name"; + + private static final String GENERATE_CMP_RECORD_TYPE = "type"; + + private static final String GENERATE_CMP_RECORD_UUID = "uuid"; + + private static final String HELP_CONFIG_INFO = "helpConfigInfo"; + + private static final String HELP_CONFIG_USE_INFO = "helpConfigUseInfo"; + + private static final String TEMPLATE_ID = "templateId"; + + private static final String SHOW_COUNT = "showCount"; + + private static final String USE_COUNT = "useCount"; + + private static final String GROUPING_DETAIL = "groupingDetail"; + + private static final String GROUP_NAME = "groupName"; + + private static final String CONTAIN_AMOUNT = "containAmount"; + + private static final String SEARCH_CONTENT = "searchContent"; + + private static final String FILTER_CONTENT = "filterContent"; + + private static final String SORT_TYPE = "sortType"; + + private static final String MARKET_CLICK = "marketClick"; + + private static final String PROMPT_JUMP = "promptJump"; + + private static final String TOOLBAR_JUMP = "toolbarJump"; + + private static final String POPUP_JUMP = "popupJump"; + + private static final String uuid = DesignerEnvManager.getEnvManager().getUUID(); + + private int localCmpNumber = 0; + + private int remoteCmpNumber = 0; + + private int generateCmpNumber = 0; + + private int uploadCmpNumber = 0; + + private int cmpBoardClick = 0; + + private int promptJump = 0; + + private int toolbarJump = 0; + + private int popupJump = 0; + + private JSONArray activateRecord = JSONFactory.createJSON(JSON.ARRAY); + + private JSONArray generateCmpRecord = JSONFactory.createJSON(JSON.ARRAY); + + private JSONArray helpConfigInfo = JSONFactory.createJSON(JSON.ARRAY); + + private JSONArray searchContent = JSONFactory.createJSON(JSON.ARRAY); + + private JSONArray filterContent = JSONFactory.createJSON(JSON.ARRAY); + + private JSONArray sortType = JSONFactory.createJSON(JSON.ARRAY); + + private String startTime = StringUtils.EMPTY; + + private String lastTime = StringUtils.EMPTY; + + private JSONArray helpConfigUseInfo = JSONFactory.createJSON(JSON.ARRAY); + + private static class ComponentCollectorHolder { + + private static ComponentCollector collector = new ComponentCollector(); + } + + public static ComponentCollector getInstance() { + return ComponentCollectorHolder.collector; + } + + private ComponentCollector() { + + loadFromFile(); + if (StringUtils.isEmpty(startTime)) { + startTime = DateTime.now().toString(SIMPLE_DATE_PATTERN); + } + } + + public void collectGenerateCmpNumber() { + + generateCmpNumber++; + saveInfo(); + } + + public void collectUploadCmpNumber() { + + uploadCmpNumber++; + saveInfo(); + } + + public void collectTepMenuEnterClick() { + + saveInfo(); + } + + public void collectCmpBoardClick() { + collectActivateRecord(); + cmpBoardClick++; + saveInfo(); + } + + public void collectCmpNumber() { + int count = 0; + //默认分组组件数量 + String[] reus = WorkContext.getWorkResource().list(ComponentPath.SHARE_PATH.path(), new ReuFilter()); + count += reus.length; + + //其他分组组件数量 + String[] groups = WorkContext.getWorkResource().list(ComponentPath.SHARE_PATH.path(), new DirFilter()); + for (String groupName : groups) { + String relativePath = StableUtils.pathJoin(ComponentPath.SHARE_PATH.path(), groupName); + String[] groupReus = WorkContext.getWorkResource().list(relativePath, new ReuFilter()); + count += groupReus.length; + } + + if (WorkContext.getCurrent().isLocal()) { + localCmpNumber = count; + } else { + remoteCmpNumber = count; + } + saveInfo(); + } + + public void collectCmpPktClick() { + collectAttrActiveCount(COMP_PKT_CLICK); + saveInfo(); + } + + public void collectDownloadPktNum() { + collectAttrActiveCount(DOWNLOAD_PKT_NUM); + saveInfo(); + } + + public void collectMarkerClick() { + collectAttrActiveCount(MARKET_CLICK); + } + + public void clearActiveRecord() { + String currentDate = DateTime.now().toString(SIMPLE_DATE_PATTERN); + Iterator iterator = activateRecord.iterator(); + while (iterator.hasNext()) { + JSONObject jo = (JSONObject) iterator.next(); + if (!ComparatorUtils.equals(currentDate, jo.getString(ACTIVATE_DATE))) { + iterator.remove(); + } + } + } + + public void collectGenerateCmpRecord(SharableWidgetProvider bindInfo) { + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); + jo.put(GENERATE_CMP_RECORD_NAME, bindInfo.getName()) + .put(GENERATE_CMP_RECORD_TYPE, ((DefaultSharableWidget) bindInfo).getChildClassify()) + .put(GENERATE_CMP_RECORD_UUID, bindInfo.getId()); + generateCmpRecord.add(jo); + } + + public void clearGenerateCmpRecord() { + generateCmpRecord = JSONFactory.createJSON(JSON.ARRAY); + } + + public void collectCmpDownLoad(String uuid) { + String currentDate = DateTime.now().toString(SIMPLE_DATE_PATTERN); + for (int i = 0; i < activateRecord.size(); i++) { + JSONObject jo = activateRecord.getJSONObject(i); + if (ComparatorUtils.equals(currentDate, jo.getString(ACTIVATE_DATE))) { + JSONArray downloadComp = jo.containsKey(DOWNLOAD_CMP) ? jo.getJSONArray(DOWNLOAD_CMP) : JSONFactory.createJSON(JSON.ARRAY); + downloadComp.add(uuid); + jo.put(DOWNLOAD_CMP, downloadComp); + saveInfo(); + return; + } + } + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); + jo.put(ACTIVATE_DATE, currentDate).put(DOWNLOAD_CMP, JSONFactory.createJSON(JSON.ARRAY).add(uuid)); + activateRecord.add(jo); + saveInfo(); + } + + public JSONArray getActivateRecord() { + return activateRecord; + } + + public JSONArray getGenerateCmpRecord() { + return generateCmpRecord; + } + + private void collectActivateRecord() { + collectAttrActiveCount(ACTIVATE_VALUE); + } + + private void collectAttrActiveCount(String attrName) { + String currentDate = DateTime.now().toString(SIMPLE_DATE_PATTERN); + for (int i = 0; i < activateRecord.size(); i++) { + JSONObject jo = activateRecord.getJSONObject(i); + if (ComparatorUtils.equals(currentDate, jo.getString(ACTIVATE_DATE))) { + int attrNum = jo.getInt(attrName); + attrNum++; + jo.put(attrName, attrNum); + return; + } + } + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); + jo.put(ACTIVATE_DATE, currentDate).put(attrName, ACTIVATE_INITIAL_VALUE); + activateRecord.add(jo); + } + + + private JSONArray getGroupingDetail() { + JSONArray ja = JSONFactory.createJSON(JSON.ARRAY); + Group[] groups = DefaultShareGroupManager.getInstance().getAllGroup(); + for(Group group : groups) { + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); + jo.put(GROUP_NAME, group.getGroupName()); + jo.put(CONTAIN_AMOUNT, group.getAllBindInfoList().length); + ja.add(jo); + } + return ja; + } + + public void collectHelpConfigInfo(String templateId, int showCount, int useCount) { + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); + jo.put(TEMPLATE_ID, templateId); + jo.put(SHOW_COUNT, showCount); + jo.put(USE_COUNT, useCount); + helpConfigInfo.add(jo); + saveInfo(); + } + + public void clearHelpConfigInfo() { + helpConfigInfo = JSONFactory.createJSON(JSON.ARRAY); + } + + public void collectSearchContent(String search) { + searchContent.add(search); + } + + public void clearSearchContent() { + searchContent = JSONFactory.createJSON(JSON.ARRAY); + } + + public void collectFilterContent(String filter) { + filterContent.add(filter); + saveInfo(); + } + + public void clearFilterContent() { + filterContent = JSONFactory.createJSON(JSON.ARRAY); + } + + public void collectSortType(String type) { + sortType.add(type); + saveInfo(); + } + + public void collectPromptJumpWhenJump(){ + if (ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_FIRST_POPUP) { + this.promptJump = 1; + saveInfo(); + }else if(ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_SECOND_POPUP){ + this.promptJump = 2; + saveInfo(); + } + } + + + public void collectPromptJumpWhenShow() { + if (ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() == REUSE_INFO_SECOND_POPUP) { + this.promptJump = -1; + saveInfo(); + } + } + + public void collectToolbarJump() { + if (this.toolbarJump == 0) { + this.toolbarJump = 1; + saveInfo(); + } + + } + + public void collectPopupJump() { + long currentTime = System.currentTimeMillis(); + long lastGuidePopUpTime = ComponentReuseNotificationInfo.getInstance().getLastGuidePopUpTime(); + if (currentTime - lastGuidePopUpTime <= ONE_MINUTE && this.popupJump == 0) { + this.popupJump = 1; + saveInfo(); + } + } + + public void clearSortType() { + sortType = JSONFactory.createJSON(JSON.ARRAY); + } + + private int cmpBoardClickDaily() { + + DateTime dateTime = DateTime.parse(startTime); + DateTime currTime = DateTime.now(); + int days = (Days.daysBetween(dateTime, currTime).getDays() + 1); + return cmpBoardClick / days; + } + + public String getLastTime() { + return lastTime; + } + + public void setLastTime(String lastTime) { + this.lastTime = lastTime; + } + + /** + * 保存埋点信息到文件中 + */ + public void saveInfo() { + + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + XMLTools.writeOutputStreamXML(this, out); + out.flush(); + out.close(); + String fileContent = new String(out.toByteArray(), StandardCharsets.UTF_8); + FileUtils.writeStringToFile(getInfoFile(), fileContent, StandardCharsets.UTF_8); + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage()); + } + } + + /** + * 从文件中读取埋点信息 + */ + private void loadFromFile() { + + if (!getInfoFile().exists()) { + return; + } + XMLableReader reader = null; + try (InputStream in = new FileInputStream(getInfoFile())) { + // XMLableReader 还是应该考虑实现 Closable 接口的,这样就能使用 try-with 语句了 + reader = XMLReadHelper.createXMLableReader(in, XMLPrintWriter.XML_ENCODER); + if (reader == null) { + return; + } + reader.readXMLObject(this); + } catch (FileNotFoundException e) { + // do nothing + } catch (XMLStreamException | IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } finally { + try { + if (reader != null) { + reader.close(); + } + } catch (XMLStreamException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + } + + + private File getInfoFile() { + + File file = new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), "component.info")); + try { + if (!file.exists()) { + file.createNewFile(); + } + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + } + return file; + } + + @Override + public void readXML(XMLableReader reader) { + + String tagName = reader.getTagName(); + if (tagName.equals(XML)) { + this.cmpBoardClick = reader.getAttrAsInt("cmpBoardClick", 0); + this.startTime = reader.getAttrAsString("startTime", StringUtils.EMPTY); + this.lastTime = reader.getAttrAsString("lastTime", StringUtils.EMPTY); + this.localCmpNumber = reader.getAttrAsInt("localCmpNumber", 0); + this.remoteCmpNumber = reader.getAttrAsInt("remoteCmpNumber", 0); + this.generateCmpNumber = reader.getAttrAsInt("generateCmpNumber", 0); + this.uploadCmpNumber = reader.getAttrAsInt("uploadCmpNumber", 0); + + String activateRecordStr = reader.getAttrAsString("activateRecord", StringUtils.EMPTY); + activateRecord = parseJSONArray(activateRecordStr); + String generateCmpRecordStr = reader.getAttrAsString("generateCmpRecord", StringUtils.EMPTY); + generateCmpRecord = parseJSONArray(generateCmpRecordStr); + + this.helpConfigInfo = parseJSONArray(reader.getAttrAsString(HELP_CONFIG_INFO, StringUtils.EMPTY)); + this.helpConfigUseInfo = parseJSONArray(reader.getAttrAsString(HELP_CONFIG_USE_INFO, StringUtils.EMPTY)); + this.searchContent = parseJSONArray(reader.getAttrAsString(SEARCH_CONTENT,StringUtils.EMPTY)); + this.filterContent = parseJSONArray(reader.getAttrAsString(FILTER_CONTENT, StringUtils.EMPTY)); + this.sortType = parseJSONArray(reader.getAttrAsString(SORT_TYPE, StringUtils.EMPTY)); + this.promptJump = reader.getAttrAsInt(PROMPT_JUMP, 0); + this.toolbarJump = reader.getAttrAsInt(TOOLBAR_JUMP, 0); + this.popupJump = reader.getAttrAsInt(POPUP_JUMP, 0); + + } + } + + private JSONArray parseJSONArray(String value) { + JSONArray ja; + try { + ja = new JSONArray(value); + } catch (JSONException e) { + ja = JSONFactory.createJSON(JSON.ARRAY); + + } + return ja; + } + + + @Override + public void writeXML(XMLPrintWriter writer) { + + writer.startTAG(XML) + .attr("cmpBoardClick", cmpBoardClick) + .attr("startTime", startTime) + .attr("lastTime", lastTime) + .attr("localCmpNumber", localCmpNumber) + .attr("remoteCmpNumber", remoteCmpNumber) + .attr("uploadCmpNumber", uploadCmpNumber) + .attr("generateCmpNumber", generateCmpNumber) + .attr("activateRecord", activateRecord.toString()) + .attr("generateCmpRecord", generateCmpRecord.toString()) + .attr(HELP_CONFIG_INFO, helpConfigInfo.toString()) + .attr(HELP_CONFIG_USE_INFO, helpConfigUseInfo.toString()) + .attr(SEARCH_CONTENT, searchContent.toString()) + .attr(FILTER_CONTENT, filterContent.toString()) + .attr(SORT_TYPE, sortType.toString()) + .attr(PROMPT_JUMP, promptJump) + .attr(TOOLBAR_JUMP, toolbarJump) + .attr(POPUP_JUMP, popupJump) + .end(); + } + + /** + * 累计信息 + */ + public String generateTotalInfo() { + collectCmpNumber(); + JSONObject jo = JSONObject.create(); + jo.put("userId", MarketConfig.getInstance().getBBSAttr().getBbsUid()); + jo.put("uuid", uuid); + jo.put("cmpBoardClickDaily", cmpBoardClickDaily()); + jo.put("pluginVersion", GeneralUtils.readBuildNO()); + jo.put("localCmpNumber", localCmpNumber); + jo.put("remoteCmpNumber", remoteCmpNumber); + jo.put("uploadCmpNumber", uploadCmpNumber); + jo.put("generateCmpNumber", generateCmpNumber); + jo.put("activateRecord", getValidActivateRecord()); + jo.put("generateCmpRecord", generateCmpRecord.toString()); + jo.put(HELP_CONFIG_INFO, helpConfigInfo.toString()); + jo.put(GROUPING_DETAIL, getGroupingDetail().toString()); + jo.put(SEARCH_CONTENT, searchContent.toString()); + jo.put(FILTER_CONTENT, filterContent.toString()); + jo.put(SORT_TYPE, sortType.toString()); + jo.put("guideInfo", assembleGuideInfo()); + return jo.toString(); + } + + private String assembleGuideInfo() { + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); + jo.put(PROMPT_JUMP, promptJump) + .put(TOOLBAR_JUMP, toolbarJump) + .put(POPUP_JUMP, popupJump); + return jo.toString(); + } + + public String getValidActivateRecord() { + JSONArray result = JSONFactory.createJSON(JSON.ARRAY); + String currentDate = DateTime.now().toString(SIMPLE_DATE_PATTERN); + for (Object o : activateRecord) { + JSONObject jo = (JSONObject) o; + if (!ComparatorUtils.equals(currentDate, jo.getString(ACTIVATE_DATE))) { + result.add(jo); + } + } + return result.toString(); + } + + @Override + public Object clone() throws CloneNotSupportedException { + + return null; + } + + public void setHelpConfigUseInfo(String templateId, String widgetId) { + for (int i = 0; i < helpConfigUseInfo.size(); i++) { + JSONObject jo = helpConfigUseInfo.getJSONObject(i); + if (ComparatorUtils.equals(templateId, jo.getString(TEMPLATE_ID))) { + JSONArray useInfo = jo.getJSONArray(HELP_CONFIG_USE_INFO); + if (!useInfo.contains(widgetId)) { + useInfo.add(widgetId); + } + jo.put(HELP_CONFIG_USE_INFO, useInfo); + return; + } + } + JSONObject jo = JSONFactory.createJSON(JSON.OBJECT); + JSONArray ja = JSONFactory.createJSON(JSON.ARRAY); + ja.add(widgetId); + jo.put(TEMPLATE_ID, templateId); + jo.put(HELP_CONFIG_USE_INFO, ja); + helpConfigUseInfo.add(jo); + saveInfo(); + } + + public JSONArray getHelpConfigUseInfoWithTemplate(String templateId) { + for (int i = 0; i < helpConfigUseInfo.size(); i++) { + JSONObject jo = helpConfigUseInfo.getJSONObject(i); + if (ComparatorUtils.equals(templateId, jo.getString(TEMPLATE_ID))) { + return jo.getJSONArray(HELP_CONFIG_USE_INFO); + } + } + return JSONFactory.createJSON(JSON.ARRAY); + } + + public void clear(){ + clearActiveRecord(); + clearGenerateCmpRecord(); + clearFilterContent(); + clearHelpConfigInfo(); + clearSearchContent(); + clearSortType(); + saveInfo(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java new file mode 100644 index 000000000..5043e5fb7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/ComponentSender.java @@ -0,0 +1,45 @@ +package com.fr.design.mainframe.share.collect; + +import com.fr.design.mainframe.SiteCenterToken; +import com.fr.general.ComparatorUtils; +import com.fr.general.http.HttpToolbox; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; + +import java.util.HashMap; +import java.util.Map; + +/** + * created by Harrison on 2020/03/25 + **/ +public class ComponentSender { + + private static final String CLOUD_REUSE_URL = "https://cloud.fanruan.com/api/monitor/record_of_reusePlugin/single"; + + public static boolean send() { + + long start = System.currentTimeMillis(); + + String content = ComponentCollector.getInstance().generateTotalInfo(); + + long end = System.currentTimeMillis(); + FineLoggerFactory.getLogger().error("cal time cost {} ms", end - start); + return sendInfo(CLOUD_REUSE_URL, content); + } + + private static boolean sendInfo(String url, String content) { + + Map para = new HashMap<>(); + para.put("token", SiteCenterToken.generateToken()); + para.put("content", content); + + try { + String res = HttpToolbox.post(url, para); + return ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); + } catch (Throwable e) { + // 客户不需要关心,错误等级为 debug 就行了 + FineLoggerFactory.getLogger().debug(e.getMessage(), e); + } + return false; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/share/collect/SharableCollectorManager.java b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/SharableCollectorManager.java new file mode 100644 index 000000000..2ea982001 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/share/collect/SharableCollectorManager.java @@ -0,0 +1,89 @@ +package com.fr.design.mainframe.share.collect; + +import com.fr.concurrent.NamedThreadFactory; +import com.fr.stable.StringUtils; +import com.fr.third.joda.time.DateTime; +import com.fr.third.joda.time.Days; +import com.fr.third.joda.time.format.DateTimeFormat; +import com.fr.third.joda.time.format.DateTimeFormatter; + +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * created by Harrison on 2020/03/25 + **/ +public class SharableCollectorManager { + + /** + * 1 天 + */ + private static final int DELTA = 1; + + /** + * 发送间隔 5 分钟 + */ + private static final long SEND_DELAY = 300 * 1000L; + + /** + * 线程 + */ + private ScheduledExecutorService service; + + private static class ConfigManagerHolder { + private static SharableCollectorManager instance = new SharableCollectorManager(); + } + + public static SharableCollectorManager getInstance() { + + return ConfigManagerHolder.instance; + } + + public void execute() { + + service = Executors + .newSingleThreadScheduledExecutor(new NamedThreadFactory("SharableComponentCollectorManager", true)); + service.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + sendCloudCenter(); + } + }, SEND_DELAY, SEND_DELAY, TimeUnit.MILLISECONDS); + } + + public void shutdown() { + + ComponentCollector.getInstance().saveInfo(); + if (service != null) { + service.shutdown(); + } + } + + private void sendCloudCenter() { + + String lastTime = ComponentCollector.getInstance().getLastTime(); + if (validate(lastTime)) { + boolean sendSuccess = ComponentSender.send(); + String currentTime = DateTime.now().toString("yyyy-MM-dd"); + ComponentCollector.getInstance().setLastTime(currentTime); + if (sendSuccess) { + ComponentCollector.getInstance().clear(); + } + } + ComponentCollector.getInstance().saveInfo(); + } + + private boolean validate(String lastTime) { + + if (StringUtils.isEmpty(lastTime)) { + return true; + } + DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM-dd"); + DateTime last = formatter.parseDateTime(lastTime); + DateTime current = DateTime.now(); + return Days.daysBetween(last, current).getDays() >= DELTA; + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java deleted file mode 100644 index 78eddb00f..000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfo.java +++ /dev/null @@ -1,253 +0,0 @@ -package com.fr.design.mainframe.template.info; - -import com.fr.config.MarketConfig; -import com.fr.design.DesignerEnvManager; -import com.fr.design.mainframe.burying.point.AbstractPointInfo; -import com.fr.general.CloudCenter; -import com.fr.json.JSON; -import com.fr.json.JSONFactory; -import com.fr.json.JSONObject; -import com.fr.stable.StringUtils; -import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLableReader; -import com.fr.third.joda.time.DateTime; - -import java.util.HashMap; -import java.util.Map; - -/** - * 对应一张模版的记录 - * Created by plough on 2019/4/18. - */ -public class TemplateInfo extends AbstractPointInfo { - static final String XML_TAG = "TemplateInfo"; - private static final String SIMPLE_DATE_PATTRN = "yyyy-MM-dd HH:mm"; - - private static final String CONSUMING_URL = CloudCenter.getInstance().acquireUrlByKind("tempinfo.consuming") + "/single"; - private static final String PROCESS_URL = CloudCenter.getInstance().acquireUrlByKind("tempinfo.process") + "/single"; - - private static final String XML_PROCESS_MAP = "processMap"; - private static final String XML_CONSUMING_MAP = "consumingMap"; - private static final String ATTR_DAY_COUNT = "day_count"; - private static final String ATTR_TEMPLATE_ID = "templateID"; - private static final String ATTR_ORIGIN_ID = "originID"; - private static final String ATTR_PROCESS = "process"; - private static final String ATTR_FLOAT_COUNT = "float_count"; - private static final String ATTR_WIDGET_COUNT = "widget_count"; - private static final String ATTR_CELL_COUNT = "cell_count"; - private static final String ATTR_BLOCK_COUNT = "block_count"; - private static final String ATTR_REPORT_TYPE = "report_type"; - private static final String ATTR_CREATE_TIME = "create_time"; - private static final String ATTR_UUID = "uuid"; - private static final String ATTR_UID = "uid"; - private static final String ATTR_SAVE_RECORD = "saveRecord"; - private static final String ATTR_PARA_APPLY = "paraApply"; - private static final String ATTR_COMPONENTS_INFO = "components_info"; - private static final String ATTR_REUSE_CMP_LIST = "reuseCmptList"; - - - private static final String TEST_TEMPLATE_FLAG = "test_template"; - private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数 - private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 - - private String templateID = StringUtils.EMPTY; - private String originID = StringUtils.EMPTY; - // todo: processMap 和 consumingMap 还可以再拆解为小类,以后继续重构 - private Map processMap = new HashMap<>(); - private Map consumingMap = new HashMap<>(); - - private TemplateInfo() { - } - - private TemplateInfo(String templateID, String originID) { - this.templateID = templateID; - this.originID = originID; - } - - @Override - protected String key() { - return templateID; - } - - public static TemplateInfo newInstanceByRead(XMLableReader reader) { - TemplateInfo templateInfo = new TemplateInfo(); - reader.readXMLObject(templateInfo); - return templateInfo; - } - - public static TemplateInfo newInstance(String templateID) { - return newInstance(templateID, StringUtils.EMPTY, StringUtils.EMPTY, StringUtils.EMPTY); - } - - public static TemplateInfo newInstance(String templateID, String originID, String saveRecord) { - String createTime = DateTime.now().toString(SIMPLE_DATE_PATTRN); - return newInstance(templateID, originID, saveRecord, createTime); - } - - public static TemplateInfo newInstance(String templateID, String originID, String saveRecord, String createTime) { - HashMap consumingMap = new HashMap<>(); - - String uuid = DesignerEnvManager.getEnvManager().getUUID(); - MarketConfig config = MarketConfig.getInstance(); - consumingMap.put(ATTR_UUID, uuid); - consumingMap.put(ATTR_TEMPLATE_ID, templateID); - consumingMap.put(ATTR_ORIGIN_ID, originID); - consumingMap.put(ATTR_CREATE_TIME, createTime); - consumingMap.put(ATTR_UID, config.getBBSAttr().getBbsUid()); - consumingMap.put(ATTR_SAVE_RECORD, saveRecord); - - TemplateInfo templateInfo = new TemplateInfo(templateID, originID); - templateInfo.consumingMap = consumingMap; - - return templateInfo; - } - - String getTemplateID() { - return templateID; - } - - public String getTemplateInfoID() { - return templateID + "_" + getSaveTime(); - } - - public long getSaveTime() { - String saveRecord = (String) consumingMap.get(ATTR_SAVE_RECORD); - JSONObject jo = JSONFactory.createJSON(JSON.OBJECT, saveRecord); - return jo.getLong("time"); - } - - public String getTemplateCreateTime() { - return (String) consumingMap.get(ATTR_CREATE_TIME); - } - - - @Override - public void writeXML(XMLPrintWriter writer) { - writer.startTAG(XML_TAG); - if (StringUtils.isNotEmpty(templateID)) { - writer.attr(ATTR_TEMPLATE_ID, this.templateID); - } - if (StringUtils.isNotEmpty(originID)) { - writer.attr(ATTR_ORIGIN_ID, this.originID); - } - if (idleDayCount >= 0) { - writer.attr(ATTR_DAY_COUNT, this.idleDayCount); - } - writer.attr(TEST_TEMPLATE_FLAG, this.testTemplate); - writeProcessMap(writer); - writeConsumingMap(writer); - - writer.end(); - } - - private void writeProcessMap(XMLPrintWriter writer) { - writer.startTAG(XML_PROCESS_MAP); - writer.attr(ATTR_PROCESS, (String) processMap.get(ATTR_PROCESS)); - writer.attr(ATTR_FLOAT_COUNT, (int) processMap.get(ATTR_FLOAT_COUNT)); - writer.attr(ATTR_WIDGET_COUNT, (int) processMap.get(ATTR_WIDGET_COUNT)); - writer.attr(ATTR_CELL_COUNT, (int) processMap.get(ATTR_CELL_COUNT)); - writer.attr(ATTR_BLOCK_COUNT, (int) processMap.get(ATTR_BLOCK_COUNT)); - writer.attr(ATTR_REPORT_TYPE, (int) processMap.get(ATTR_REPORT_TYPE)); - writer.attr(ATTR_PARA_APPLY, (int) processMap.get(ATTR_PARA_APPLY)); - writer.attr(ATTR_COMPONENTS_INFO, (String) processMap.get(ATTR_COMPONENTS_INFO)); - writer.attr(ATTR_REUSE_CMP_LIST, (String) processMap.get(ATTR_REUSE_CMP_LIST)); - writer.end(); - } - - private void writeConsumingMap(XMLPrintWriter writer) { - writer.startTAG(XML_CONSUMING_MAP); - writer.attr(ATTR_CREATE_TIME, (String) consumingMap.get(ATTR_CREATE_TIME)); - writer.attr(ATTR_UUID, (String) consumingMap.get(ATTR_UUID)); - writer.attr(ATTR_UID, (int) consumingMap.get(ATTR_UID)); - writer.attr(ATTR_SAVE_RECORD, (String) consumingMap.get(ATTR_SAVE_RECORD)); - writer.end(); - } - - @Override - public void readXML(XMLableReader reader) { - if (!reader.isChildNode()) { - idleDayCount = reader.getAttrAsInt(ATTR_DAY_COUNT, 0); - testTemplate = reader.getAttrAsBoolean(TEST_TEMPLATE_FLAG, false); - templateID = reader.getAttrAsString(ATTR_TEMPLATE_ID, StringUtils.EMPTY); - originID = reader.getAttrAsString(ATTR_ORIGIN_ID, StringUtils.EMPTY); - } else { - try { - String name = reader.getTagName(); - if (XML_PROCESS_MAP.equals(name)) { - processMap.put(ATTR_PROCESS, reader.getAttrAsString(ATTR_PROCESS, StringUtils.EMPTY)); - processMap.put(ATTR_FLOAT_COUNT, reader.getAttrAsInt(ATTR_FLOAT_COUNT, 0)); - processMap.put(ATTR_WIDGET_COUNT, reader.getAttrAsInt(ATTR_WIDGET_COUNT, 0)); - processMap.put(ATTR_CELL_COUNT, reader.getAttrAsInt(ATTR_CELL_COUNT, 0)); - processMap.put(ATTR_BLOCK_COUNT, reader.getAttrAsInt(ATTR_BLOCK_COUNT, 0)); - processMap.put(ATTR_REPORT_TYPE, reader.getAttrAsInt(ATTR_REPORT_TYPE, 0)); - processMap.put(ATTR_PARA_APPLY, reader.getAttrAsInt(ATTR_PARA_APPLY, 0)); - processMap.put(ATTR_COMPONENTS_INFO, reader.getAttrAsString(ATTR_COMPONENTS_INFO, StringUtils.EMPTY)); - processMap.put(ATTR_REUSE_CMP_LIST, reader.getAttrAsString(ATTR_REUSE_CMP_LIST, StringUtils.EMPTY)); - processMap.put(ATTR_TEMPLATE_ID, templateID); - } else if (XML_CONSUMING_MAP.equals(name)) { - consumingMap.put(ATTR_CREATE_TIME, reader.getAttrAsString(ATTR_CREATE_TIME, StringUtils.EMPTY)); - consumingMap.put(ATTR_TEMPLATE_ID, templateID); - consumingMap.put(ATTR_ORIGIN_ID, originID); - consumingMap.put(ATTR_UUID, reader.getAttrAsString(ATTR_UUID, StringUtils.EMPTY)); - consumingMap.put(ATTR_UID, reader.getAttrAsInt(ATTR_UID, 0)); - consumingMap.put(ATTR_SAVE_RECORD, reader.getAttrAsString(ATTR_SAVE_RECORD, StringUtils.EMPTY)); - } - } catch (Exception ex) { - // 什么也不做,使用默认值 - } - } - } - - @Override - public boolean isTestTemplate() { - return testTemplate; - } - - public static boolean isTestTemplate(int reportType, int cellCount, int floatCount, int blockCount, int widgetCount) { - boolean isTestTemplate; - if (reportType == 0) { // 普通报表 - isTestTemplate = cellCount <= VALID_CELL_COUNT && floatCount <= 1 && widgetCount <= VALID_WIDGET_COUNT; - } else if (reportType == 1) { // 聚合报表 - isTestTemplate = blockCount <= 1 && widgetCount <= VALID_WIDGET_COUNT; - } else { // 表单(reportType == 2) - isTestTemplate = widgetCount <= 1; - } - return isTestTemplate; - } - - @Override - protected boolean isComplete() { - return true; - } - - @Override - public Map getSendInfo() { - Map sendMap = new HashMap<>(); - sendMap.put(CONSUMING_URL, JSONFactory.createJSON(JSON.OBJECT, consumingMap).toString()); - sendMap.put(PROCESS_URL, JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); - return sendMap; - } - - - void updateProcessMap(TemplateProcessInfo processInfo) { - HashMap processMap = new HashMap<>(); - - // 暂不支持模版制作过程的收集 - processMap.put(ATTR_PROCESS, StringUtils.EMPTY); - - processMap.put(ATTR_REPORT_TYPE, processInfo.getReportType()); - processMap.put(ATTR_CELL_COUNT, processInfo.getCellCount()); - processMap.put(ATTR_FLOAT_COUNT, processInfo.getFloatCount()); - processMap.put(ATTR_BLOCK_COUNT, processInfo.getBlockCount()); - processMap.put(ATTR_WIDGET_COUNT, processInfo.getWidgetCount()); - processMap.put(ATTR_PARA_APPLY, processInfo.useParaPane() ? 1 : 0); - processMap.put(ATTR_COMPONENTS_INFO, processInfo.getComponentsInfo().toString()); - processMap.put(ATTR_REUSE_CMP_LIST, processInfo.getReuseCmpList().toString()); - this.processMap = processMap; - } - - - int getIdleDayCount() { - return this.idleDayCount; - } -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java deleted file mode 100644 index 23c07ea3a..000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateInfoCollector.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.fr.design.mainframe.template.info; - -import com.fr.design.mainframe.burying.point.AbstractPointCollector; -import com.fr.design.mainframe.burying.point.AbstractPointInfo; -import com.fr.json.JSON; -import com.fr.json.JSONFactory; -import com.fr.json.JSONObject; -import com.fr.stable.StringUtils; -import com.fr.stable.xml.XMLPrintWriter; -import com.fr.stable.xml.XMLableReader; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * 做模板的过程和耗时收集,辅助类 - * Created by plough on 2017/2/21. - */ -public class TemplateInfoCollector extends AbstractPointCollector { - private static final String XML_TAG = "TplInfo"; - private static final String XML_TEMPLATE_INFO_LIST = "TemplateInfoList"; - private static final String XML_FILE_NAME = "tpl.info"; - private static TemplateInfoCollector instance; - private DesignerOpenHistory designerOpenHistory = DesignerOpenHistory.getInstance(); - //记录指定模板最新的模板耗时信息ID - private Map latestTemplateInfo; - - private TemplateInfoCollector() { - super(); - } - - public static TemplateInfoCollector getInstance() { - if (instance == null) { - instance = new TemplateInfoCollector(); - } - return instance; - } - - /** - * 根据模板ID是否在收集列表中,判断是否需要收集当前模板的信息 - */ - public boolean contains(String templateID) { - return StringUtils.isNotEmpty(templateID) && latestTemplateInfo.containsKey(templateID); - } - - /** - * 收集模板信息。如果之前没有记录,则新增;如果已有记录,则更新。 - * 同时将最新数据保存到文件中。 - * - * @param templateID 模版id - * @param originID 模版的原始id,仅对另存为的模版有效,对于非另存为的模版,值总是为空 - * @param processInfo 包含模版的一些基本信息(如模版类型、包含控件数量等) - * @param timeConsume 本次制作耗时,单位为 s - */ - @Override - public void collectInfo(String templateID, String originID, TemplateProcessInfo processInfo, int timeConsume) { - if (!shouldCollectInfo()) { - return; - } - long saveTime = System.currentTimeMillis(); - - TemplateInfo templateInfo = createTemplateInfo(templateID, originID, saveTime, timeConsume); - - pointInfoMap.put(templateInfo.getTemplateInfoID(), templateInfo); - - //更新下此模板最新保存记录 - updateLatestTemplateInfo(templateID, saveTime); - - // 收集模版基本信息 - templateInfo.updateProcessMap(processInfo); - //设置是否是测试模板 - templateInfo.setTestTemplate(processInfo.isTestTemplate()); - // 刷新闲置日计数器 - templateInfo.resetIdleDayCount(); - - - // 每次更新之后,都同步到暂存文件中 - saveInfo(); - } - - private TemplateInfo createTemplateInfo(String templateID, String originID, long saveTime, int timeConsume){ - JSONObject saveRecord = JSONFactory.createJSON(JSON.OBJECT); - saveRecord.put("time", saveTime); - saveRecord.put("consume", timeConsume); - if (this.contains(templateID)){ - return TemplateInfo.newInstance(templateID, originID, saveRecord.toString(), getTemplateCreateTime(templateID)); - } - return TemplateInfo.newInstance(templateID, originID, saveRecord.toString()); - } - - private String getTemplateCreateTime(String templateID) { - long latestSaveTime = latestTemplateInfo.get(templateID); - TemplateInfo latestTemplateInfo = pointInfoMap.get(templateID + "_" + latestSaveTime); - return latestTemplateInfo.getTemplateCreateTime(); - } - - /** - * 更新 day_count:打开设计器却未编辑模板的连续日子 - */ - @Override - protected void addIdleDayCount() { - // 判断今天是否第一次打开设计器,为了防止同一天内,多次 addIdleDayCount - if (designerOpenHistory.hasOpenedToday()) { - return; - } - for (TemplateInfo templateInfo : pointInfoMap.values()) { - templateInfo.addIdleDayCountByOne(); - } - designerOpenHistory.update(); - } - - private void updateLatestTemplateInfo(TemplateInfo templateInfo) { - String templateID = templateInfo.getTemplateID(); - if (latestTemplateInfo.containsKey(templateID)) { - long latestSaveTime = latestTemplateInfo.get(templateID); - updateLatestTemplateInfo(templateID, Math.max(latestSaveTime, templateInfo.getSaveTime())); - } else { - updateLatestTemplateInfo(templateID, templateInfo.getSaveTime()); - } - } - - private void updateLatestTemplateInfo(String templateID, long saveTime) { - latestTemplateInfo.put(templateID, saveTime); - } - - @Override - public void readXML(XMLableReader reader) { - if (reader.isChildNode()) { - try { - String name = reader.getTagName(); - if (DesignerOpenHistory.XML_TAG.equals(name)) { - if (designerOpenHistory == null) { - designerOpenHistory = DesignerOpenHistory.getInstance(); - } - reader.readXMLObject(designerOpenHistory); - } else if (TemplateInfo.XML_TAG.equals(name)) { - TemplateInfo templateInfo = TemplateInfo.newInstanceByRead(reader); - updateLatestTemplateInfo(templateInfo); - pointInfoMap.put(templateInfo.getTemplateInfoID(), templateInfo); - } - } catch (Exception ex) { - // 什么也不做,使用默认值 - } - } - } - - @Override - public void writeXML(XMLPrintWriter writer) { - writer.startTAG(XML_TAG); - - designerOpenHistory.writeXML(writer); - - writer.startTAG(XML_TEMPLATE_INFO_LIST); - for (TemplateInfo templateInfo : pointInfoMap.values()) { - templateInfo.writeXML(writer); - } - writer.end(); - - writer.end(); - } - - /** - * 获取缓存文件存放路径 - */ - @Override - protected String getInfoFilePath() { - return XML_FILE_NAME; - } - - @Override - public void sendPointInfo() { - addIdleDayCount(); - List removeList = new ArrayList<>(); - List sendList = new ArrayList<>(); - for (String latestTemplateInfokey : latestTemplateInfo.keySet()) { - AbstractPointInfo pointInfo = pointInfoMap.get(latestTemplateInfokey + "_" + latestTemplateInfo.get(latestTemplateInfokey)); - if (pointInfo.isTestTemplate()) { - continue; - } - for (String key : pointInfoMap.keySet()) { - if (key.startsWith(latestTemplateInfokey)) { - sendList.add(key); - } - } - } - // 发送记录 - for (String key : sendList) { - if (SendHelper.sendPointInfo(pointInfoMap.get(key))) { - removeList.add(key); - } - } - - // 清空记录 - for (String key : removeList) { - pointInfoMap.remove(key); - } - - saveInfo(); - } - - - @Override - protected void loadFromFile() { - latestTemplateInfo = new ConcurrentHashMap<>(); - super.loadFromFile(); - } - -} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateOperate.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateOperate.java index 5c2cfb071..be8eeaba2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateOperate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateOperate.java @@ -4,7 +4,9 @@ import com.fr.json.JSONObject; /** * Created by kerry on 2020-05-08 + * @deprecated moved to Cloud Ops plugin */ +@Deprecated public interface TemplateOperate { /** * 获取模板操作类型 diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java index ea484e532..81f1b6a10 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TemplateProcessInfo.java @@ -8,11 +8,11 @@ import com.fr.json.JSONArray; /** * Created by plough on 2017/3/17. + * + * @deprecated moved to cloud ops plugin */ -// todo: 重构 -// 1. 命名不好,表意不清晰。 -// 2. 逻辑混乱,到底是一个 Info 类,还是一个 InfoCollector 类? -// 3. 耦合太强,用组合替代继承 + +@Deprecated public abstract class TemplateProcessInfo { protected T template; @@ -35,31 +35,28 @@ public abstract class TemplateProcessInfo { // 获取模板控件数 public abstract int getWidgetCount(); - + //是否是测试模板 public abstract boolean isTestTemplate(); - + //是否使用参数面板 public abstract boolean useParaPane(); - + //获取组件信息 public abstract JSONArray getComponentsInfo(); - + //获取重用组件数 public abstract JSONArray getReuseCmpList(); - - + + public abstract void updateTemplateOperationInfo(TemplateOperate templateOption); - - + + protected boolean isTestCell(Object value, Style style) { if (value instanceof ChartCollection && isTestChartCollection((ChartCollection) value)) { return true; } - if (value == null && Style.getInstance().equals(style)) { - return true; - } - return false; + return value == null && Style.getInstance().equals(style); } protected boolean isTestChartCollection(ChartCollection chartCollection) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TimeConsumeTimer.java b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TimeConsumeTimer.java index 527341411..edef80f6c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/template/info/TimeConsumeTimer.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/template/info/TimeConsumeTimer.java @@ -2,7 +2,9 @@ package com.fr.design.mainframe.template.info; /** * Created by plough on 2019/4/19. + * @deprecated moved to Cloud Ops plugin */ +@Deprecated public class TimeConsumeTimer { private static final int ONE_THOUSAND = 1000; private enum State { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java b/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java new file mode 100644 index 000000000..4e69c34c5 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/toast/DesignerToastMsgUtil.java @@ -0,0 +1,121 @@ +package com.fr.design.mainframe.toast; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.stable.Constants; + +import java.awt.Dialog; +import java.awt.Frame; +import java.awt.Window; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JEditorPane; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Font; + +/** + * Created by kerry on 5/6/21 + */ +public class DesignerToastMsgUtil { + private static final int MIN_WIDTH = 134; + private static final int MAX_WIDTH = 454; + private static final Icon PROMPT_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/toast_prompt.png"); + private static final Icon WARNING_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/toast_warning.png"); + + private DesignerToastMsgUtil() { + + } + + + public static void toastPrompt(JPanel contendPane) { + toastPane(PROMPT_ICON, contendPane, DesignerContext.getDesignerFrame()); + } + + public static void toastWarning(JPanel contendPane) { + toastPane(WARNING_ICON, contendPane, DesignerContext.getDesignerFrame()); + } + + public static void toastWarning(JPanel contendPane, Window parent) { + toastPane(WARNING_ICON, contendPane, parent); + } + + public static void toastPrompt(String promptInfo) { + toastPrompt(toastPane(promptInfo)); + } + + public static void toastWarning(String warningInfo) { + toastWarning(toastPane(warningInfo)); + } + + public static void toastWarning(String warningInfo, Window parent) { + toastWarning(toastPane(warningInfo), parent); + } + + private static JPanel toastPane(String text) { + UILabel promptLabel = new UILabel("" + text + ""); + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + int width = promptLabel.getPreferredSize().width; + if (width > MAX_WIDTH) { + Dimension dimension = calculatePreferSize(text, promptLabel.getFont(), width); + jPanel.setPreferredSize(dimension); + } + jPanel.add(promptLabel, BorderLayout.NORTH); + return jPanel; + } + + private static void toastPane(Icon icon, JPanel contendPane, Window parent) { + JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel uiLabel = new UILabel(icon); + uiLabel.setVerticalAlignment(SwingConstants.TOP); + uiLabel.setBorder(BorderFactory.createEmptyBorder(3, 0, 0, 0)); + pane.add(uiLabel, BorderLayout.WEST); + pane.add(contendPane, BorderLayout.CENTER); + pane.setBorder(BorderFactory.createEmptyBorder(8, 15, 8, 15)); + contendPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); + ToastMsgDialog dialog; + if (parent instanceof Dialog) { + dialog = new ToastMsgDialog((Dialog) parent, pane); + } else { + dialog = new ToastMsgDialog((Frame) parent, pane); + } + dialog.setVisible(true); + } + + + private static Dimension calculatePreferSize(String text, Font font, int width) { + int limitWidth = Math.max(MIN_WIDTH, width); + limitWidth = Math.min(MAX_WIDTH, limitWidth); + return new Dimension(limitWidth, getHtmlHeight(text, limitWidth, font)); + } + + + private static int getHtmlHeight(String content, int width, Font font) { + StringBuffer limitDiv = new StringBuffer("
"); + return getHtmlContentDimension(content, limitDiv).height; + } + + + private static Dimension getHtmlContentDimension(String content, StringBuffer limitDiv) { + content = limitDiv.append(content).append("
").toString(); + JEditorPane editorPane = new JEditorPane(); + editorPane.setContentType("text/html"); + editorPane.setText(content); + return editorPane.getPreferredSize(); + } + + private static String getFontWrapStyle(Font font) { + double dpi96 = Constants.FR_PAINT_RESOLUTION; + double dpi72 = Constants.DEFAULT_FONT_PAINT_RESOLUTION; + return new StringBuilder() + .append(";font-size:").append(font.getSize() * dpi96 / dpi72) + .append("pt;font-family:").append(font.getFontName()) + .toString(); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java new file mode 100644 index 000000000..00f4f95ea --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/toast/ToastMsgDialog.java @@ -0,0 +1,163 @@ +package com.fr.design.mainframe.toast; + +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.dialog.UIDialog; +import com.fr.design.mainframe.DesignerContext; +import com.fr.module.ModuleContext; + +import java.awt.Dialog; +import javax.swing.JPanel; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Point; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * Created by kerry on 4/29/21 + */ +public class ToastMsgDialog extends UIDialog { + private static final int MIN_HEIGHT = 36; + private static final String TOAST_MSG_TIMER = "TOAST_MSG_TIMER"; + private ScheduledExecutorService TIMER; + private int hide_height = 0; + private JPanel contentPane; + + public ToastMsgDialog(Frame parent, JPanel panel) { + super(parent); + init(panel); + } + + public ToastMsgDialog(Dialog parent, JPanel panel) { + super(parent); + init(panel); + } + + private void init(JPanel panel) { + setFocusable(false); + setAutoRequestFocus(false); + setUndecorated(true); + contentPane = panel; + initComponent(); + } + + private void initComponent() { + this.getContentPane().setLayout(null); + this.getContentPane().add(contentPane); + Dimension dimension = calculatePreferSize(); + hide_height = dimension.height; + setSize(new Dimension(dimension.width, 0)); + contentPane.setSize(dimension); + setLocationRelativeTo(DesignerContext.getDesignerFrame().getContentFrame()); + int positionY = DesignerContext.getDesignerFrame().getContentFrame().getLocationOnScreen().y + 10; + setLocation((DesignerContext.getDesignerFrame().getWidth() - dimension.width) / 2, positionY); + addMouseEvent(contentPane); + } + + + private Dimension calculatePreferSize() { + Dimension contentDimension = contentPane.getPreferredSize(); + int height = Math.max(MIN_HEIGHT, contentDimension.height); + return new Dimension(contentDimension.width, height); + } + + + public void display(JPanel outerJPanel) { + outerJPanel.setLocation(0, -hide_height); + ScheduledExecutorService TIP_TOOL_TIMER = createToastScheduleExecutorService(); + TIP_TOOL_TIMER.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + Point point = outerJPanel.getLocation(); + if (point.y >= 0) { + TIP_TOOL_TIMER.shutdown(); + disappear(outerJPanel); + } + int showDistance = 5 + point.y < 0 ? 5 : -point.y; + outerJPanel.setLocation(point.x, point.y + showDistance); + Dimension dimension = ToastMsgDialog.this.getSize(); + ToastMsgDialog.this.setSize(new Dimension(dimension.width, dimension.height + showDistance)); + } + }, 0, 50, TimeUnit.MILLISECONDS); + + } + + private void disappear(JPanel outerJPanel) { + TIMER = createToastScheduleExecutorService(); + TIMER.schedule(new Runnable() { + @Override + public void run() { + ScheduledExecutorService TIP_TOOL_TIMER = createToastScheduleExecutorService(); + TIP_TOOL_TIMER.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + Point point = outerJPanel.getLocation(); + if (point.y <= -hide_height) { + TIP_TOOL_TIMER.shutdown(); + ToastMsgDialog.this.setVisible(false); + ToastMsgDialog.this.dispose(); + } + outerJPanel.setLocation(point.x, point.y - 5); + Dimension dimension = ToastMsgDialog.this.getSize(); + ToastMsgDialog.this.setSize(new Dimension(dimension.width, dimension.height - 5)); + } + }, 0,50, TimeUnit.MILLISECONDS); + + } + }, 5000, TimeUnit.MILLISECONDS); + } + + private ScheduledExecutorService createToastScheduleExecutorService() { + return ModuleContext.getExecutor().newSingleThreadScheduledExecutor(new NamedThreadFactory(TOAST_MSG_TIMER)); + } + + private void addMouseEvent(JPanel jPanel) { + jPanel.addMouseListener(new MouseListener() { + @Override + public void mouseClicked(MouseEvent e) { + + } + + @Override + public void mousePressed(MouseEvent e) { + + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + + @Override + public void mouseEntered(MouseEvent e) { + TIMER.shutdownNow(); + } + + @Override + public void mouseExited(MouseEvent e) { + disappear(jPanel); + } + }); + } + + + @Override + public void checkValid() throws Exception { + } + + public void setVisible(boolean visible) { + super.setVisible(visible); + if (visible) { + display(contentPane); + } + } + + @Override + public void dispose() { + super.dispose(); + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 3dbdac094..a2d0ec83f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -465,6 +465,10 @@ public abstract class ToolBarMenuDock { return new UILabel(); } + public Component createNotificationCenterPane(){ + return new UILabel(); + } + protected MenuDef createServerMenuDef(ToolBarMenuDockPlus plus) { MenuDef menuDef = new MenuDef(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic__M_Server"), 'S'); @@ -591,6 +595,7 @@ public abstract class ToolBarMenuDock { shortCuts.add(new TechSolutionAction()); shortCuts.add(SeparatorDef.DEFAULT); + shortCuts.add(new TemplateStoreAction()); LocaleCenter.buildAction(new LocaleAction() { @Override diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentChange.java b/designer-base/src/main/java/com/fr/design/mod/ContentChange.java new file mode 100644 index 000000000..8361d8609 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/ContentChange.java @@ -0,0 +1,29 @@ +package com.fr.design.mod; + +import com.fr.design.mod.bean.ChangeItem; + +import java.util.Map; + +/** + * + * @author hades + * @version 10.0 + * Created by hades on 2021/4/27 + */ +public interface ContentChange { + + /** + * 标识内容替换类型 + * + * @return + */ + String type(); + + /** + * 替换详情信息 + * + * @return + */ + Map> changeInfo(); + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java new file mode 100644 index 000000000..6c8a123fd --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/ContentObjectManager.java @@ -0,0 +1,123 @@ +package com.fr.design.mod; + +import com.fr.base.Formula; +import com.fr.base.headerfooter.FormulaHFElement; +import com.fr.base.present.FormulaPresent; +import com.fr.chart.web.ChartHyperRelateCellLink; +import com.fr.chart.web.ChartHyperRelateFloatLink; +import com.fr.data.SimpleDSColumn; +import com.fr.data.condition.FormulaCondition; +import com.fr.data.impl.FormulaDictionary; +import com.fr.data.impl.NameTableData; +import com.fr.design.mod.impl.repalce.JavaScriptContentReplacer; +import com.fr.design.mod.impl.repalce.VanChartHtmlLabelContentReplacer; +import com.fr.form.main.FormHyperlink; +import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.WidgetTitle; +import com.fr.invoke.ClassHelper; +import com.fr.js.JavaScriptImpl; +import com.fr.plugin.chart.base.VanChartHtmlLabel; +import com.fr.report.cell.cellattr.CellExpandAttr; +import com.fr.report.cell.cellattr.CellGUIAttr; +import com.fr.report.cell.cellattr.core.RichChar; +import com.fr.report.cell.cellattr.core.group.DSColumn; +import com.fr.report.cell.cellattr.core.group.FunctionGrouper; +import com.fr.report.cell.cellattr.core.group.SelectCount; +import com.fr.stable.Filter; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import org.jetbrains.annotations.Nullable; + +/** + * 管理所有需要替换内容的对象 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/4/28 + */ +public class ContentObjectManager { + + private static ContentObjectManager INSTANCE = new ContentObjectManager(); + + public static ContentObjectManager getInstance() { + return INSTANCE; + } + + /** + * 放置所有需要替换内容的对象 + */ + private Map> objectMap; + + private final Set set = new HashSet<>(); + + private final Map map = new HashMap<>(); + + private ContentObjectManager() { + set.add(Formula.class.getName()); + set.add(JavaScriptImpl.class.getName()); + set.add(ChartHyperRelateCellLink.class.getName()); + set.add(ChartHyperRelateFloatLink.class.getName()); + set.add(VanChartHtmlLabel.class.getName()); + set.add(NameTableData.class.getName()); + set.add(SimpleDSColumn.class.getName()); + set.add(DSColumn.class.getName()); + set.add(FormHyperlink.class.getName()); + set.add(CellExpandAttr.class.getName()); + set.add(FormulaCondition.class.getName()); + set.add(FormulaDictionary.class.getName()); + set.add(FormulaHFElement.class.getName()); + set.add(FormulaPresent.class.getName()); + set.add(RichChar.class.getName()); + set.add(CardSwitchButton.class.getName()); + set.add(CellGUIAttr.class.getName()); + set.add(SelectCount.class.getName()); + set.add(WidgetTitle.class.getName()); + set.add(FunctionGrouper.class.getName()); + map.put(JavaScriptImpl.class.getName(), new JavaScriptContentReplacer()); + map.put(VanChartHtmlLabel.class.getName(), new VanChartHtmlLabelContentReplacer()); + } + + public void searchObject(Object ob) { + objectMap = ClassHelper.searchObject(ob, set, ModClassFilter.getInstance()); + } + + public void searchObject(Object ob, Filter filter) { + objectMap = ClassHelper.searchObject(ob, set, filter); + } + + public void searchObject(Object ob, Set set, Filter filter) { + objectMap = ClassHelper.searchObject(ob, set, filter); + } + public void clearObject() { + if (objectMap != null) { + objectMap.clear(); + } + objectMap = null; + } + + @Nullable + public Map> getObjectMap() { + return objectMap; + } + + public boolean needContentTip(Object ob, Set nameSet) { + objectMap = ClassHelper.searchObject(ob, set, ModClassFilter.getInstance()); + for (Map.Entry> entry : objectMap.entrySet()) { + for (Object o : entry.getValue()) { + for (String name : nameSet) { + ContentReplacer contentReplacer = map.get(entry.getKey()); + if (contentReplacer!= null && contentReplacer.contain(o, name)) { + clearObject(); + return true; + } + } + } + } + clearObject(); + return false; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java new file mode 100644 index 000000000..f2afd5d8d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplaceUtil.java @@ -0,0 +1,179 @@ +package com.fr.design.mod; + +import com.fr.parser.FRFormulaTransformer; +import com.fr.stable.StringUtils; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/31 + */ +public class ContentReplaceUtil { + + public static final String EQ_STRING = "="; + + public static final String LEFT_BRACKET = "${"; + + public static final String RIGHT_BRACKET = "}"; + + public static String replaceContent(String content, String oldName, String newName) { + String oldNameUpper = oldName.toUpperCase(); + Matcher m = Pattern.compile(oldName + "|" + oldNameUpper).matcher(content); + StringBuilder sb = new StringBuilder(); + int last = 0; + while (m.find()) { + sb.append(content, last, m.start()); + if (oldNameUpper.equals(m.group())) { + // 处理大写情况 + sb.append(newName.toUpperCase()); + } else { + // 默认情况 + sb.append(newName); + } + last = m.end(); + } + sb.append(content.substring(last)); + + return sb.toString(); + } + + private static String generateStr(String str) { + return "\"" + str + "\""; + } + + public static String getFormulaPureContent(String content) { + if (content.startsWith(EQ_STRING)) { + return content.substring(1); + } else { + return content; + } + } + + /** + * 通过公式编辑框框输入的且带有"=" + * + * @param content + * @param oldName + * @param newName + * @return + */ + public static String replaceFormulaContent4WidgetName(String content, String oldName, String newName) { + if (StringUtils.isNotEmpty(content)) { + return replaceFormulaContent4WidgetName0(content, oldName, newName); + } + return content; + } + + public static String replaceFormulaContent4TableDataName(String content, String oldName, String newName) { + if (StringUtils.isNotEmpty(content)) { + return replaceFormulaContent4TableDataName0(content, oldName, newName); + } + return content; + } + + private static String replaceFormulaContent4WidgetName0(String content, String oldName, String newName) { + content = getFormulaPureContent(content); + FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer(); + frFormulaTransformer.addRenamedWidget(oldName, newName); + return EQ_STRING + frFormulaTransformer.transform(content); + } + + private static String replaceFormulaContent4TableDataName0(String content, String oldName, String newName) { + content = getFormulaPureContent(content); + FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer(); + frFormulaTransformer.addRenamedDataset(oldName, newName); + return EQ_STRING + frFormulaTransformer.transform(content); + } + + public static String getRichCharFormulaPureContent(String content) { + if (content.startsWith(LEFT_BRACKET)) { + return content.substring(LEFT_BRACKET.length() + 1, content.length() - 1); + } else { + return content; + } + } + + public static String replaceRichCharFormulaContent4TableDataName(String content, String oldName, String newName) { + if (StringUtils.isNotEmpty(content)) { + content = getRichCharFormulaPureContent(content); + FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer(); + frFormulaTransformer.addRenamedDataset(oldName, newName); + return LEFT_BRACKET + EQ_STRING + frFormulaTransformer.transform(content) + RIGHT_BRACKET; + } + return content; + } + + public static String replaceRichCharFormulaContent4WidgetName(String content, String oldName, String newName) { + if (StringUtils.isNotEmpty(content)) { + content = getRichCharFormulaPureContent(content); + FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer(); + frFormulaTransformer.addRenamedWidget(oldName, newName); + return LEFT_BRACKET + EQ_STRING + frFormulaTransformer.transform(content) + RIGHT_BRACKET; + } + return content; + } + + private static boolean isFormula(String content) { + return StringUtils.isNotEmpty(content) && content.startsWith(EQ_STRING); + } + + /** + * 适用于替换非显示使用的公式的地方 有可能只是文本 需要先判断下 + * 可通过使用位置是否使用公式编辑框区分 + * + * @param content + * @param oldName + * @param newName + * @return + */ + public static String replaceFormulaString4WidgetName(String content, String oldName, String newName) { + if (isFormula(content)) { + return replaceFormulaContent4WidgetName0(content, oldName, newName); + } + return content; + } + + public static String replaceFormulaString4TableDataName(String content, String oldName, String newName ) { + if (isFormula(content)) { + return replaceFormulaContent4TableDataName0(content, oldName, newName); + } + return content; + } + + /** + * 替换纯公式内容 无 "=" + * + * @param content + * @param oldName + * @param newName + * @return + */ + public static String replacePureFormula4WidgetName(String content, String oldName, String newName ) { + if (StringUtils.isNotEmpty(content)) { + FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer(); + frFormulaTransformer.addRenamedWidget(oldName, newName); + return frFormulaTransformer.transform(content); + } + return content; + } + + public static String replacePureFormula4TableDataName(String content, String oldName, String newName ) { + if (StringUtils.isNotEmpty(content)) { + FRFormulaTransformer frFormulaTransformer = new FRFormulaTransformer(); + frFormulaTransformer.addRenamedDataset(oldName, newName); + return frFormulaTransformer.transform(content); + } + return content; + } + + public static boolean containsName(String content, String name) { + if (StringUtils.isNotEmpty(content)) { + return content.contains(name); + } + return false; + } + + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java new file mode 100644 index 000000000..a9d54b6a4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplacer.java @@ -0,0 +1,18 @@ +package com.fr.design.mod; + +/** + * + * @author hades + * @version 10.0 + * Created by hades on 2021/5/27 + */ +public interface ContentReplacer { + + void replace(T t, String oldName, String newName); + + + default boolean contain(T t, String name) { + return false; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java new file mode 100644 index 000000000..91f9bf3dc --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/ContentReplacerCenter.java @@ -0,0 +1,139 @@ +package com.fr.design.mod; + +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.bean.ContentChangeItem; +import com.fr.design.mod.event.TableDataModifyEvent; +import com.fr.design.mod.event.WidgetNameModifyEvent; +import com.fr.design.mod.impl.change.ChartHyperRelateCellLinkContentChange; +import com.fr.design.mod.impl.change.ChartHyperRelateFloatLinkContentChange; +import com.fr.design.mod.impl.change.DSColumnContentChange; +import com.fr.design.mod.impl.change.FormHyperlinkContentChange; +import com.fr.design.mod.impl.change.formula.CardSwitchButtonContentChange; +import com.fr.design.mod.impl.change.formula.CellExpandAttrContentChange; +import com.fr.design.mod.impl.change.formula.CellGUIAttrContentChange; +import com.fr.design.mod.impl.change.formula.FormulaConditionContentChange; +import com.fr.design.mod.impl.change.formula.FormulaContentChange; +import com.fr.design.mod.impl.change.JavaScriptContentChange; +import com.fr.design.mod.impl.change.NameTableDataContentChange; +import com.fr.design.mod.impl.change.SimpleDSColumnContentChange; +import com.fr.design.mod.impl.change.VanChartHtmlLabelContentChange; +import com.fr.design.mod.impl.change.formula.FormulaDictionaryContentChange; +import com.fr.design.mod.impl.change.formula.FormulaHFElementContentChange; +import com.fr.design.mod.impl.change.formula.FormulaPresentContentChange; +import com.fr.design.mod.impl.change.formula.FunctionGrouperContentChange; +import com.fr.design.mod.impl.change.formula.RichCharContentChange; +import com.fr.design.mod.impl.change.formula.SelectCountContentChange; +import com.fr.design.mod.impl.change.formula.WidgetTitleContentChange; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; +import com.fr.log.FineLoggerFactory; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 默认联动内容替换器实现 + * + * 当前替换顺序:组件名-> 数据集名 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/5/27 + */ +public class ContentReplacerCenter { + + private static final ContentReplacerCenter INSTANCE = new ContentReplacerCenter(); + + public static ContentReplacerCenter getInstance() { + return INSTANCE; + } + + private List contentChangeList = new ArrayList<>(); + private Map itemsMap = new HashMap<>(); + + private ContentReplacerCenter() { + + EventDispatcher.listen(WidgetNameModifyEvent.INSTANCE, new Listener() { + @Override + public void on(Event event, ContentChangeItem param) { + if (param.getChangeMap().isEmpty()) { + return; + } + itemsMap.put(param.getChangeItem(), param); + } + }); + + EventDispatcher.listen(TableDataModifyEvent.INSTANCE, new Listener() { + @Override + public void on(Event event, ContentChangeItem param) { + itemsMap.put(param.getChangeItem(), param); + long start = System.currentTimeMillis(); + ContentObjectManager.getInstance().searchObject(param.getObject()); + FineLoggerFactory.getLogger().debug("search object spend {} ms", (System.currentTimeMillis() - start)); + FineLoggerFactory.getLogger().debug("search result: {}", ContentObjectManager.getInstance().getObjectMap() == null + ? null : ContentObjectManager.getInstance().getObjectMap().keySet()); + List itemsCopy = new ArrayList<>(itemsMap.values()); + itemsMap.clear(); + onRename(itemsCopy, contentChangeList); + } + }); + + } + + public void register() { + contentChangeList.add(new ChartHyperRelateCellLinkContentChange()); + contentChangeList.add(new ChartHyperRelateFloatLinkContentChange()); + contentChangeList.add(new FormulaContentChange()); + contentChangeList.add(new JavaScriptContentChange()); + contentChangeList.add(new VanChartHtmlLabelContentChange()); + contentChangeList.add(new NameTableDataContentChange()); + contentChangeList.add(new SimpleDSColumnContentChange()); + contentChangeList.add(new DSColumnContentChange()); + contentChangeList.add(new FormHyperlinkContentChange()); + contentChangeList.add(new CellExpandAttrContentChange()); + contentChangeList.add(new FormulaConditionContentChange()); + contentChangeList.add(new FormulaDictionaryContentChange()); + contentChangeList.add(new FormulaHFElementContentChange()); + contentChangeList.add(new FormulaPresentContentChange()); + contentChangeList.add(new RichCharContentChange()); + contentChangeList.add(new CardSwitchButtonContentChange()); + contentChangeList.add(new CellGUIAttrContentChange()); + contentChangeList.add(new SelectCountContentChange()); + contentChangeList.add(new WidgetTitleContentChange()); + contentChangeList.add(new FunctionGrouperContentChange()); + } + + private void onRename(List contentChangeItemList, List contentChangeList) { + Map> objectMap = ContentObjectManager.getInstance().getObjectMap(); + if (objectMap != null) { + long start = System.currentTimeMillis(); + for (ContentChange contentChange : contentChangeList) { + Collection objects = objectMap.get(contentChange.type()); + // 所有需要处理的js等对象 + if (objects != null) { + for (Object ob : objects) { + fireChange(ob, contentChange, contentChangeItemList); + } + } + } + objectMap.clear(); + FineLoggerFactory.getLogger().debug("replace all content spend {} ms", (System.currentTimeMillis() - start)); + } + } + + private void fireChange(Object o, ContentChange contentChange, List itemList) { + // 当前两项存在两项: 数据集名称和组件名称 + for (ContentChangeItem contentChangeItem : itemList) { + Map map = contentChange.changeInfo(); + if (map.containsKey(contentChangeItem.getChangeItem())) { + // 具体重命名取决于复用组件存在多少个组件或数据集 + for (Map.Entry entry : contentChangeItem.getChangeMap().entrySet()) { + map.get(contentChangeItem.getChangeItem()).replace(o, entry.getKey(), entry.getValue()); + } + } + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/ModClassFilter.java b/designer-base/src/main/java/com/fr/design/mod/ModClassFilter.java new file mode 100644 index 000000000..6ed0b367f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/ModClassFilter.java @@ -0,0 +1,39 @@ +package com.fr.design.mod; + +import com.fr.stable.Filter; +import java.util.HashSet; +import java.util.Set; + +/** + * 联动修改的类过滤器 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/5/31 + */ +public class ModClassFilter implements Filter { + + private static final Set FILTER_SET = new HashSet<>(); + + private static final Filter INSTANCE = new ModClassFilter(); + + private static final String DESIGN_PREFIX = "com.fr.design"; + + public static Filter getInstance() { + return INSTANCE; + } + + static { + FILTER_SET.add("java.awt.image.BufferedImage"); + FILTER_SET.add("sun.awt.AppContext"); + FILTER_SET.add("com.fr.poly.creator.ECBlockCreator"); + FILTER_SET.add("io.netty.channel.nio.SelectedSelectionKeySet"); + FILTER_SET.add("com.fr.form.ui.ElementCaseImage"); + FILTER_SET.add("this$0"); + } + + @Override + public boolean accept(String s) { + return FILTER_SET.contains(s) || s.startsWith(DESIGN_PREFIX); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/bean/ChangeItem.java b/designer-base/src/main/java/com/fr/design/mod/bean/ChangeItem.java new file mode 100644 index 000000000..179a3819b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/bean/ChangeItem.java @@ -0,0 +1,14 @@ +package com.fr.design.mod.bean; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public enum ChangeItem { + + TABLE_DATA_NAME, + + WIDGET_NAME + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/bean/ContentChangeItem.java b/designer-base/src/main/java/com/fr/design/mod/bean/ContentChangeItem.java new file mode 100644 index 000000000..8904a0c45 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/bean/ContentChangeItem.java @@ -0,0 +1,33 @@ +package com.fr.design.mod.bean; + +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public class ContentChangeItem { + + private final Map changeMap; + private final ChangeItem changeItem; + private final Object object; + + public ContentChangeItem(Map changeMap,Object object, ChangeItem changeItem) { + this.changeMap = changeMap; + this.changeItem = changeItem; + this.object = object; + } + + public Map getChangeMap() { + return changeMap; + } + + public ChangeItem getChangeItem() { + return changeItem; + } + + public Object getObject() { + return object; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/event/ModifyEvent.java b/designer-base/src/main/java/com/fr/design/mod/event/ModifyEvent.java new file mode 100644 index 000000000..a5debb430 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/event/ModifyEvent.java @@ -0,0 +1,13 @@ +package com.fr.design.mod.event; + +import com.fr.design.mod.bean.ContentChangeItem; +import com.fr.event.Event; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public class ModifyEvent implements Event { + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/event/TableDataModifyEvent.java b/designer-base/src/main/java/com/fr/design/mod/event/TableDataModifyEvent.java new file mode 100644 index 000000000..6359682cf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/event/TableDataModifyEvent.java @@ -0,0 +1,12 @@ +package com.fr.design.mod.event; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public class TableDataModifyEvent extends ModifyEvent { + + public static final TableDataModifyEvent INSTANCE = new TableDataModifyEvent(); + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/event/WidgetNameModifyEvent.java b/designer-base/src/main/java/com/fr/design/mod/event/WidgetNameModifyEvent.java new file mode 100644 index 000000000..d3d8a9164 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/event/WidgetNameModifyEvent.java @@ -0,0 +1,12 @@ +package com.fr.design.mod.event; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public class WidgetNameModifyEvent extends ModifyEvent { + + public static final WidgetNameModifyEvent INSTANCE = new WidgetNameModifyEvent(); + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateCellLinkContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateCellLinkContentChange.java new file mode 100644 index 000000000..8b8b32e81 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateCellLinkContentChange.java @@ -0,0 +1,16 @@ +package com.fr.design.mod.impl.change; + +import com.fr.chart.web.ChartHyperRelateCellLink; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public class ChartHyperRelateCellLinkContentChange extends ChartHyperRelateLinkContentChange { + + @Override + public String type() { + return ChartHyperRelateCellLink.class.getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateFloatLinkContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateFloatLinkContentChange.java new file mode 100644 index 000000000..dc3cf04ae --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateFloatLinkContentChange.java @@ -0,0 +1,16 @@ +package com.fr.design.mod.impl.change; + +import com.fr.chart.web.ChartHyperRelateFloatLink; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public class ChartHyperRelateFloatLinkContentChange extends ChartHyperRelateLinkContentChange{ + + @Override + public String type() { + return ChartHyperRelateFloatLink.class.getName(); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateLinkContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateLinkContentChange.java new file mode 100644 index 000000000..139bda0c2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/ChartHyperRelateLinkContentChange.java @@ -0,0 +1,30 @@ +package com.fr.design.mod.impl.change; + +import com.fr.chart.web.ChartHyperRelateLink; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.ChartHyperRelateLink4WidgetNameContentReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/27 + */ +public abstract class ChartHyperRelateLinkContentChange implements ContentChange { + + private final Map> map; + + public ChartHyperRelateLinkContentChange() { + this.map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, new ChartHyperRelateLink4WidgetNameContentReplacer()); + } + + @Override + public Map> changeInfo() { + return map; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java new file mode 100644 index 000000000..4ca627637 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/DSColumnContentChange.java @@ -0,0 +1,36 @@ +package com.fr.design.mod.impl.change; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.DSColumn4TableDataNameContentReplacer; +import com.fr.design.mod.impl.repalce.DSColumn4WidgetNameContentReplacer; +import com.fr.report.cell.cellattr.core.group.DSColumn; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class DSColumnContentChange implements ContentChange { + + private final Map> map; + + public DSColumnContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.TABLE_DATA_NAME, new DSColumn4TableDataNameContentReplacer()); + map.put(ChangeItem.WIDGET_NAME, new DSColumn4WidgetNameContentReplacer()); + } + + @Override + public String type() { + return DSColumn.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/FormHyperlinkContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/FormHyperlinkContentChange.java new file mode 100644 index 000000000..1ad89e1ad --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/FormHyperlinkContentChange.java @@ -0,0 +1,34 @@ +package com.fr.design.mod.impl.change; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormHyperlinkContentReplacer; +import com.fr.form.main.FormHyperlink; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class FormHyperlinkContentChange implements ContentChange { + + private final Map> map; + + public FormHyperlinkContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, new FormHyperlinkContentReplacer()); + } + + @Override + public String type() { + return FormHyperlink.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/JavaScriptContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/JavaScriptContentChange.java new file mode 100644 index 000000000..62653349c --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/JavaScriptContentChange.java @@ -0,0 +1,36 @@ +package com.fr.design.mod.impl.change; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.JavaScriptContentReplacer; +import com.fr.js.JavaScriptImpl; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/27 + */ +public class JavaScriptContentChange implements ContentChange { + + private final Map> map; + + public JavaScriptContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, new JavaScriptContentReplacer()); + map.put(ChangeItem.TABLE_DATA_NAME, new JavaScriptContentReplacer()); + } + + @Override + public String type() { + return JavaScriptImpl.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java new file mode 100644 index 000000000..a0a036cdf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/NameTableDataContentChange.java @@ -0,0 +1,34 @@ +package com.fr.design.mod.impl.change; + +import com.fr.data.impl.NameTableData; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.NameTableDataContentReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class NameTableDataContentChange implements ContentChange { + + private final Map> map; + + public NameTableDataContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.TABLE_DATA_NAME, new NameTableDataContentReplacer()); + } + + @Override + public String type() { + return NameTableData.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java new file mode 100644 index 000000000..b85eb3a2f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/SimpleDSColumnContentChange.java @@ -0,0 +1,34 @@ +package com.fr.design.mod.impl.change; + +import com.fr.data.SimpleDSColumn; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.SimpleDSColumnContentReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class SimpleDSColumnContentChange implements ContentChange { + + private Map> map; + + public SimpleDSColumnContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.TABLE_DATA_NAME, new SimpleDSColumnContentReplacer()); + } + + @Override + public String type() { + return SimpleDSColumn.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/VanChartHtmlLabelContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/VanChartHtmlLabelContentChange.java new file mode 100644 index 000000000..a51fd732d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/VanChartHtmlLabelContentChange.java @@ -0,0 +1,35 @@ +package com.fr.design.mod.impl.change; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.VanChartHtmlLabelContentReplacer; +import com.fr.plugin.chart.base.VanChartHtmlLabel; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/31 + */ +public class VanChartHtmlLabelContentChange implements ContentChange { + + private final Map> map; + + public VanChartHtmlLabelContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, new VanChartHtmlLabelContentReplacer()); + map.put(ChangeItem.TABLE_DATA_NAME, new VanChartHtmlLabelContentReplacer()); + } + + @Override + public String type() { + return VanChartHtmlLabel.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CardSwitchButtonContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CardSwitchButtonContentChange.java new file mode 100644 index 000000000..0f785892d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CardSwitchButtonContentChange.java @@ -0,0 +1,36 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import com.fr.form.ui.CardSwitchButton; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/3 + */ +public class CardSwitchButtonContentChange implements ContentChange { + + + private final Map> map; + + public CardSwitchButtonContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.CardSwitchButton4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.CardSwitchButton4TableDataNameContentReplacer); + } + + @Override + public String type() { + return CardSwitchButton.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellExpandAttrContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellExpandAttrContentChange.java new file mode 100644 index 000000000..4204108c6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellExpandAttrContentChange.java @@ -0,0 +1,37 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import com.fr.report.cell.cellattr.CellExpandAttr; +import java.util.HashMap; +import java.util.Map; + +/** + * 扩展后排序公式 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class CellExpandAttrContentChange implements ContentChange { + + private final Map> map; + + public CellExpandAttrContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.CellExpandAttr4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.CellExpandAttr4TableDataNameContentReplacer); + } + + @Override + public String type() { + return CellExpandAttr.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellGUIAttrContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellGUIAttrContentChange.java new file mode 100644 index 000000000..c969a1e05 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/CellGUIAttrContentChange.java @@ -0,0 +1,35 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import com.fr.report.cell.cellattr.CellGUIAttr; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/3 + */ +public class CellGUIAttrContentChange implements ContentChange { + + private Map> map; + + public CellGUIAttrContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.CellGUIAttr4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.CellGUIAttr4TableDataNameContentReplacer); + } + + @Override + public String type() { + return CellGUIAttr.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaConditionContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaConditionContentChange.java new file mode 100644 index 000000000..e67d5dfbd --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaConditionContentChange.java @@ -0,0 +1,37 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.data.condition.FormulaCondition; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * 公式条件 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class FormulaConditionContentChange implements ContentChange { + + private final Map> map; + + public FormulaConditionContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FormulaCondition4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FormulaCondition4TableDataNameContentReplacer); + } + + @Override + public String type() { + return FormulaCondition.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaContentChange.java new file mode 100644 index 000000000..d6edff530 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaContentChange.java @@ -0,0 +1,36 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.base.Formula; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/27 + */ +public class FormulaContentChange implements ContentChange { + + private final Map> map; + + public FormulaContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.Formula4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.Formula4TableDataNameContentReplacer); + } + + @Override + public String type() { + return Formula.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaDictionaryContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaDictionaryContentChange.java new file mode 100644 index 000000000..d0cd674ef --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaDictionaryContentChange.java @@ -0,0 +1,37 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.data.impl.FormulaDictionary; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * 数据字典——公式 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class FormulaDictionaryContentChange implements ContentChange { + + private final Map> map; + + public FormulaDictionaryContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FormulaDictionary4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FormulaDictionary4TableDataNameContentReplacer); + } + + @Override + public String type() { + return FormulaDictionary.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaHFElementContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaHFElementContentChange.java new file mode 100644 index 000000000..53ec9c34a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaHFElementContentChange.java @@ -0,0 +1,38 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.base.headerfooter.FormulaHFElement; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * 页面/页脚——公式 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ + +public class FormulaHFElementContentChange implements ContentChange { + + private final Map> map; + + public FormulaHFElementContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FormulaHFElement4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FormulaHFElement4TableDataNameContentReplacer); + } + + @Override + public String type() { + return FormulaHFElement.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaPresentContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaPresentContentChange.java new file mode 100644 index 000000000..eaca94c7a --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FormulaPresentContentChange.java @@ -0,0 +1,38 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.base.present.FormulaPresent; +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import java.util.HashMap; +import java.util.Map; + +/** + * 公式形态 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ + +public class FormulaPresentContentChange implements ContentChange { + + private final Map> map; + + public FormulaPresentContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FormulaPresent4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FormulaPresent4TableDataNameContentReplacer); + } + + @Override + public String type() { + return FormulaPresent.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FunctionGrouperContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FunctionGrouperContentChange.java new file mode 100644 index 000000000..33947c832 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/FunctionGrouperContentChange.java @@ -0,0 +1,35 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import com.fr.report.cell.cellattr.core.group.FunctionGrouper; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/3 + */ +public class FunctionGrouperContentChange implements ContentChange { + + private final Map> map; + + public FunctionGrouperContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.FunctionGrouper4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.FunctionGrouper4TableDataNameContentReplacer); + } + + @Override + public String type() { + return FunctionGrouper.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/RichCharContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/RichCharContentChange.java new file mode 100644 index 000000000..45c06a342 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/RichCharContentChange.java @@ -0,0 +1,37 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import com.fr.report.cell.cellattr.core.RichChar; +import java.util.HashMap; +import java.util.Map; + +/** + * 富文本 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class RichCharContentChange implements ContentChange { + + private final Map> map; + + public RichCharContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.RichChar4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.RichChar4TableDataNameContentReplacer); + } + + @Override + public String type() { + return RichChar.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/SelectCountContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/SelectCountContentChange.java new file mode 100644 index 000000000..705bfc51b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/SelectCountContentChange.java @@ -0,0 +1,35 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import com.fr.report.cell.cellattr.core.group.SelectCount; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/3 + */ +public class SelectCountContentChange implements ContentChange { + + private final Map> map; + + public SelectCountContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.SelectCount4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.SelectCount4TableDataNameContentReplacer); + } + + @Override + public String type() { + return SelectCount.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/WidgetTitleContentChange.java b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/WidgetTitleContentChange.java new file mode 100644 index 000000000..f4d8ff764 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/change/formula/WidgetTitleContentChange.java @@ -0,0 +1,35 @@ +package com.fr.design.mod.impl.change.formula; + +import com.fr.design.mod.ContentChange; +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.impl.repalce.FormulaReplacer; +import com.fr.form.ui.WidgetTitle; +import java.util.HashMap; +import java.util.Map; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/3 + */ +public class WidgetTitleContentChange implements ContentChange { + + private final Map> map; + + public WidgetTitleContentChange() { + map = new HashMap<>(); + map.put(ChangeItem.WIDGET_NAME, FormulaReplacer.WidgetTitle4WidgetNameContentReplacer); + map.put(ChangeItem.TABLE_DATA_NAME, FormulaReplacer.WidgetTitle4TableDataNameContentReplacer); + } + + @Override + public String type() { + return WidgetTitle.class.getName(); + } + + @Override + public Map> changeInfo() { + return map; + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/ChartHyperRelateLink4WidgetNameContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/ChartHyperRelateLink4WidgetNameContentReplacer.java new file mode 100644 index 000000000..9fa32280f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/ChartHyperRelateLink4WidgetNameContentReplacer.java @@ -0,0 +1,21 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.chart.web.ChartHyperRelateLink; +import com.fr.design.mod.ContentReplacer; +import com.fr.general.ComparatorUtils; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public class ChartHyperRelateLink4WidgetNameContentReplacer implements ContentReplacer { + + @Override + public void replace(ChartHyperRelateLink chartHyperRelateLink, String oldName, String newName) { + if (ComparatorUtils.equals(chartHyperRelateLink.getRelateCCName(), oldName)) { + chartHyperRelateLink.setRelateCCName(newName); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4TableDataNameContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4TableDataNameContentReplacer.java new file mode 100644 index 000000000..548e2f4ee --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4TableDataNameContentReplacer.java @@ -0,0 +1,23 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.design.mod.ContentReplaceUtil; +import com.fr.design.mod.ContentReplacer; +import com.fr.general.ComparatorUtils; +import com.fr.report.cell.cellattr.core.group.DSColumn; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class DSColumn4TableDataNameContentReplacer implements ContentReplacer { + + @Override + public void replace(DSColumn dsColumn, String oldName, String newName) { + if (ComparatorUtils.equals(dsColumn.getDSName(), oldName)) { + dsColumn.setDSName(newName); + } + dsColumn.setResult(ContentReplaceUtil.replacePureFormula4TableDataName(dsColumn.getResult(), oldName, newName)); + dsColumn.setSortFormula(ContentReplaceUtil.replacePureFormula4TableDataName(dsColumn.getSortFormula(), oldName, newName)); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4WidgetNameContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4WidgetNameContentReplacer.java new file mode 100644 index 000000000..ec1418705 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/DSColumn4WidgetNameContentReplacer.java @@ -0,0 +1,19 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.design.mod.ContentReplaceUtil; +import com.fr.design.mod.ContentReplacer; +import com.fr.report.cell.cellattr.core.group.DSColumn; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/3 + */ +public class DSColumn4WidgetNameContentReplacer implements ContentReplacer { + + @Override + public void replace(DSColumn dsColumn, String oldName, String newName) { + dsColumn.setResult(ContentReplaceUtil.replacePureFormula4WidgetName(dsColumn.getResult(), oldName, newName)); + dsColumn.setSortFormula(ContentReplaceUtil.replacePureFormula4WidgetName(dsColumn.getSortFormula(), oldName, newName)); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormHyperlinkContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormHyperlinkContentReplacer.java new file mode 100644 index 000000000..9da4ee047 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormHyperlinkContentReplacer.java @@ -0,0 +1,20 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.design.mod.ContentReplacer; +import com.fr.form.main.FormHyperlink; +import com.fr.general.ComparatorUtils; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class FormHyperlinkContentReplacer implements ContentReplacer { + + @Override + public void replace(FormHyperlink formHyperlink, String oldName, String newName) { + if (ComparatorUtils.equals(formHyperlink.getRelateEditorName(), oldName)) { + formHyperlink.setRelateEditorName(newName); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormulaReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormulaReplacer.java new file mode 100644 index 000000000..7ed57b284 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/FormulaReplacer.java @@ -0,0 +1,247 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.base.Formula; +import com.fr.base.headerfooter.FormulaHFElement; +import com.fr.base.present.FormulaPresent; +import com.fr.data.condition.FormulaCondition; +import com.fr.data.impl.FormulaDictionary; +import com.fr.design.mod.ContentReplaceUtil; +import com.fr.design.mod.ContentReplacer; +import com.fr.form.ui.CardSwitchButton; +import com.fr.form.ui.WidgetTitle; +import com.fr.report.cell.cellattr.CellExpandAttr; +import com.fr.report.cell.cellattr.CellGUIAttr; +import com.fr.report.cell.cellattr.core.RichChar; +import com.fr.report.cell.cellattr.core.group.FunctionGrouper; +import com.fr.report.cell.cellattr.core.group.SelectCount; + +/** + * 持有公式内容对象汇总 + * + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class FormulaReplacer { + + /** + * 扩展后排序公式 + */ + public static final ContentReplacer CellExpandAttr4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(CellExpandAttr cellExpandAttr, String oldName, String newName) { + cellExpandAttr.setSortFormula(ContentReplaceUtil.replaceFormulaContent4TableDataName(cellExpandAttr.getSortFormula(), oldName, newName)); + } + }; + + public static final ContentReplacer CellExpandAttr4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(CellExpandAttr cellExpandAttr, String oldName, String newName) { + cellExpandAttr.setSortFormula(ContentReplaceUtil.replaceFormulaContent4WidgetName(cellExpandAttr.getSortFormula(), oldName, newName)); + } + }; + + /** + * 典型单元格公式 + */ + public static final ContentReplacer Formula4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(Formula formula, String oldName, String newName) { + formula.setContent(ContentReplaceUtil.replaceFormulaContent4TableDataName(formula.getPureContent(), oldName, newName)); + } + }; + + + public static final ContentReplacer Formula4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(Formula formula, String oldName, String newName) { + formula.setContent(ContentReplaceUtil.replaceFormulaContent4WidgetName(formula.getPureContent(), oldName, newName)); + } + }; + + /** + * 公式条件 + */ + public static final ContentReplacer FormulaCondition4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FormulaCondition formulaCondition, String oldName, String newName) { + formulaCondition.setFormula(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaCondition.getFormula(), oldName, newName)); + } + }; + + public static final ContentReplacer FormulaCondition4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FormulaCondition formulaCondition, String oldName, String newName) { + formulaCondition.setFormula(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaCondition.getFormula(), oldName, newName)); + } + }; + + /** + * 数据字典——公式 + */ + + public static final ContentReplacer FormulaDictionary4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FormulaDictionary formulaDictionary, String oldName, String newName) { + formulaDictionary.setExcuteFormula(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaDictionary.getExcuteFormula(), oldName, newName)); + formulaDictionary.setProduceFormula(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaDictionary.getProduceFormula(), oldName, newName)); + } + }; + + public static final ContentReplacer FormulaDictionary4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FormulaDictionary formulaDictionary, String oldName, String newName) { + formulaDictionary.setExcuteFormula(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaDictionary.getExcuteFormula(), oldName, newName)); + formulaDictionary.setProduceFormula(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaDictionary.getProduceFormula(), oldName, newName)); + } + }; + + /** + * 页面/页脚——公式 + */ + + public static final ContentReplacer FormulaHFElement4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FormulaHFElement formulaHFElement, String oldName, String newName) { + formulaHFElement.setFormulaContent(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaHFElement.getFormulaContent(), oldName, newName)); + } + }; + + public static final ContentReplacer FormulaHFElement4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FormulaHFElement formulaHFElement, String oldName, String newName) { + formulaHFElement.setFormulaContent(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaHFElement.getFormulaContent(), oldName, newName)); + } + }; + + /** + * 公式形态 + */ + + public static final ContentReplacer FormulaPresent4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FormulaPresent formulaPresent, String oldName, String newName) { + formulaPresent.setFormulaContent(ContentReplaceUtil.replaceFormulaContent4TableDataName(formulaPresent.getFormulaContent(), oldName, newName)); + } + }; + + public static final ContentReplacer FormulaPresent4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FormulaPresent formulaPresent, String oldName, String newName) { + formulaPresent.setFormulaContent(ContentReplaceUtil.replaceFormulaContent4WidgetName(formulaPresent.getFormulaContent(), oldName, newName)); + } + }; + + /** + * 富文本公式 + */ + public static final ContentReplacer RichChar4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(RichChar richChar, String oldName, String newName) { + if (richChar.isFormula()) { + richChar.setText(ContentReplaceUtil.replaceRichCharFormulaContent4TableDataName(richChar.getText(), oldName, newName)); + } + } + }; + + public static final ContentReplacer RichChar4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(RichChar richChar, String oldName, String newName) { + if (richChar.isFormula()) { + richChar.setText(ContentReplaceUtil.replaceRichCharFormulaContent4WidgetName(richChar.getText(), oldName, newName)); + } + } + }; + + /** + * 公式分组 + * + */ + public static final ContentReplacer FunctionGrouper4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FunctionGrouper functionGrouper, String oldName, String newName) { + functionGrouper.setFormulaContent(ContentReplaceUtil.replacePureFormula4TableDataName(functionGrouper.getFormulaContent(), oldName, newName)); + } + }; + + public static final ContentReplacer FunctionGrouper4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(FunctionGrouper functionGrouper, String oldName, String newName) { + functionGrouper.setFormulaContent(ContentReplaceUtil.replacePureFormula4WidgetName(functionGrouper.getFormulaContent(), oldName, newName)); + } + }; + + /** + * 结果集筛选 + */ + public static final ContentReplacer SelectCount4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(SelectCount selectCount, String oldName, String newName) { + selectCount.setFormulaCount(ContentReplaceUtil.replacePureFormula4TableDataName(selectCount.getFormulaCount(), oldName, newName)); + } + }; + public static final ContentReplacer SelectCount4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(SelectCount selectCount, String oldName, String newName) { + selectCount.setFormulaCount(ContentReplaceUtil.replacePureFormula4WidgetName(selectCount.getFormulaCount(), oldName, newName)); + } + }; + + /** + * tab块标题 + */ + public static final ContentReplacer CardSwitchButton4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(CardSwitchButton cardSwitchButton, String oldName, String newName) { + cardSwitchButton.setText(ContentReplaceUtil.replaceFormulaString4TableDataName(cardSwitchButton.getText(), oldName, newName)); + } + }; + + public static final ContentReplacer CardSwitchButton4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(CardSwitchButton cardSwitchButton, String oldName, String newName) { + cardSwitchButton.setText(ContentReplaceUtil.replaceFormulaString4WidgetName(cardSwitchButton.getText(), oldName, newName)); + } + }; + + /** + * 悬浮提示 + */ + public static final ContentReplacer CellGUIAttr4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(CellGUIAttr cellGUIAttr, String oldName, String newName) { + cellGUIAttr.setTooltipText(ContentReplaceUtil.replaceFormulaString4TableDataName(cellGUIAttr.getTooltipText(), oldName, newName)); + } + }; + + public static final ContentReplacer CellGUIAttr4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(CellGUIAttr cellGUIAttr, String oldName, String newName) { + cellGUIAttr.setTooltipText(ContentReplaceUtil.replaceFormulaString4WidgetName(cellGUIAttr.getTooltipText(), oldName, newName)); + } + }; + + /** + * 图表/报表块等标题 + */ + public static final ContentReplacer WidgetTitle4TableDataNameContentReplacer = new ContentReplacer() { + @Override + public void replace(WidgetTitle widgetTitle, String oldName, String newName) { + if (widgetTitle.getTextObject() instanceof String) { + String content = (String) widgetTitle.getTextObject(); + widgetTitle.setTextObject(ContentReplaceUtil.replaceFormulaString4TableDataName(content, oldName, newName)); + } + } + }; + + public static final ContentReplacer WidgetTitle4WidgetNameContentReplacer = new ContentReplacer() { + @Override + public void replace(WidgetTitle widgetTitle, String oldName, String newName) { + if (widgetTitle.getTextObject() instanceof String) { + String content = (String) widgetTitle.getTextObject(); + widgetTitle.setTextObject(ContentReplaceUtil.replaceFormulaString4WidgetName(content, oldName, newName)); + } + } + }; + +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java new file mode 100644 index 000000000..763b0b4a0 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/JavaScriptContentReplacer.java @@ -0,0 +1,26 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.ContentReplaceUtil; +import com.fr.js.JavaScriptImpl; +import com.fr.stable.StringUtils; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/28 + */ +public class JavaScriptContentReplacer implements ContentReplacer { + + @Override + public void replace(JavaScriptImpl javaScript, String oldName, String newName) { + if (StringUtils.isNotEmpty(javaScript.getContent())) { + javaScript.setContent(ContentReplaceUtil.replaceContent(javaScript.getContent(), oldName, newName)); + } + } + + @Override + public boolean contain(JavaScriptImpl javaScript, String name) { + return ContentReplaceUtil.containsName(javaScript.getContent(), name); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java new file mode 100644 index 000000000..eae4344d7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/NameTableDataContentReplacer.java @@ -0,0 +1,17 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.data.impl.NameTableData; +import com.fr.design.mod.ContentReplacer; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class NameTableDataContentReplacer implements ContentReplacer { + + @Override + public void replace(NameTableData nameTableData, String oldName, String newName) { + nameTableData.rename(oldName, newName); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java new file mode 100644 index 000000000..0aa9fdd3d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/SimpleDSColumnContentReplacer.java @@ -0,0 +1,20 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.data.SimpleDSColumn; +import com.fr.design.mod.ContentReplacer; +import com.fr.general.ComparatorUtils; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class SimpleDSColumnContentReplacer implements ContentReplacer { + + @Override + public void replace(SimpleDSColumn simpleDSColumn, String oldName, String newName) { + if (ComparatorUtils.equals(simpleDSColumn.getDsName(), oldName)) { + simpleDSColumn.setDsName(newName); + } + } +} diff --git a/designer-base/src/main/java/com/fr/design/mod/impl/repalce/VanChartHtmlLabelContentReplacer.java b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/VanChartHtmlLabelContentReplacer.java new file mode 100644 index 000000000..b99572cce --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mod/impl/repalce/VanChartHtmlLabelContentReplacer.java @@ -0,0 +1,27 @@ +package com.fr.design.mod.impl.repalce; + +import com.fr.design.mod.ContentReplacer; +import com.fr.design.mod.ContentReplaceUtil; +import com.fr.plugin.chart.base.VanChartHtmlLabel; +import com.fr.stable.StringUtils; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/5/31 + */ +public class VanChartHtmlLabelContentReplacer implements ContentReplacer { + + @Override + public void replace(VanChartHtmlLabel vanChartHtmlLabel, String oldName, String newName) { + if (StringUtils.isNotEmpty(vanChartHtmlLabel.getCustomText())) { + vanChartHtmlLabel.setCustomText( + ContentReplaceUtil.replaceContent(vanChartHtmlLabel.getCustomText(), oldName, newName)); + } + } + + @Override + public boolean contain(VanChartHtmlLabel vanChartHtmlLabel, String name) { + return ContentReplaceUtil.containsName(vanChartHtmlLabel.getCustomText(), name); + } +} diff --git a/designer-base/src/main/java/com/fr/design/notification/Notification.java b/designer-base/src/main/java/com/fr/design/notification/Notification.java new file mode 100644 index 000000000..e45dd17fa --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/Notification.java @@ -0,0 +1,53 @@ +package com.fr.design.notification; + +import com.fr.design.dialog.NotificationDialogAction; +import com.fr.stable.StringUtils; + +public class Notification { + private String messageId; + private int type; + private String message; + private NotificationDialogAction notificationDialogAction; + public static final int ERROR_MESSAGE = 0; + public static final int NEW_MESSAGE = 1; + public static final int WARNING_MESSAGE = 2; + + public Notification(String messageId, int type, String message, NotificationDialogAction notificationDialogAction) { + this.messageId = messageId; + this.type = type; + this.message = message; + this.notificationDialogAction = notificationDialogAction; + } + + public Notification(String message) { + this.type = WARNING_MESSAGE; + this.message = message; + this.notificationDialogAction = new NotificationDialogAction() { + @Override + public String name() { + return StringUtils.EMPTY; + } + + @Override + public void doClick() { + //do nothing + } + }; + } + + public NotificationDialogAction getNotificationDialogAction() { + return notificationDialogAction; + } + + public int getType() { + return type; + } + + public String getMessage() { + return message; + } + + public String getMessageId() { + return messageId; + } +} diff --git a/designer-base/src/main/java/com/fr/design/notification/NotificationCenter.java b/designer-base/src/main/java/com/fr/design/notification/NotificationCenter.java new file mode 100644 index 000000000..3faadf795 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/NotificationCenter.java @@ -0,0 +1,42 @@ +package com.fr.design.notification; + + +import com.fr.design.notification.ui.NotificationCenterPane; +import java.util.ArrayList; +import java.util.List; + +public class NotificationCenter { + private static NotificationCenter notificationCenter = new NotificationCenter(); + private List notifications; + private NotificationCenter(){ + notifications = new ArrayList<>(); + } + + public static NotificationCenter getInstance(){ + return notificationCenter; + } + + public void addNotification(Notification message){ + notifications.add(message); + NotificationCenterPane.getNotificationCenterPane().refreshButton(); + } + + public int getNotificationsCount(){ + return notifications.size(); + } + + public void removeNotification(int index){ + notifications.remove(index); + NotificationCenterPane.getNotificationCenterPane().refreshButton(); + } + + public Notification getNotification(int index){ + return notifications.get(index); + } + + public void clearAllNotifications(){ + notifications.clear(); + NotificationCenterPane.getNotificationCenterPane().refreshButton(); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java b/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java new file mode 100644 index 000000000..10e10ecdb --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterDialog.java @@ -0,0 +1,125 @@ +package com.fr.design.notification.ui; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.notification.Notification; +import com.fr.design.notification.NotificationCenter; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.Toolkit; +import java.awt.Window; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.util.ArrayList; +import javax.swing.JDialog; +import javax.swing.JPanel; + +public class NotificationCenterDialog extends JDialog { + + private ArrayList notificationNeedShow; + private JPanel centerPanel; + private UILabel deleteLabel; + private static final int NOTIFICATIONCOUNT = 5; + + + public NotificationCenterDialog(Frame parent) { + super(parent); + setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Notification")); + setResizable(false); + notificationNeedShow = new ArrayList<>(); + addWindowFocusListener(new WindowAdapter() { + @Override + public void windowLostFocus(WindowEvent e) { + hideDialog(); + } + }); + initComponents(); + } + + private void initComponents() { + centerPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); + addNotification(); + deleteLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); + deleteLabel.setForeground(Color.BLUE); + + deleteLabel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + NotificationCenter.getInstance().clearAllNotifications(); + centerPanel.removeAll(); + addNotification(); + pack(); + deleteLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); + if (notificationNeedShow.size() == 0) { + hideDialog(); + } + } + }); + JPanel deletePane = new JPanel(FRGUIPaneFactory.createCenterFlowLayout()); + deletePane.add(deleteLabel); + deletePane.setPreferredSize(new Dimension(240, 30)); + add(centerPanel, BorderLayout.CENTER); + add(deletePane, BorderLayout.SOUTH); + pack(); + centerWindow(); + } + + public ArrayList getNotificationNeedShow() { + return notificationNeedShow; + } + + public JPanel getCenterPanel() { + return centerPanel; + } + + public UILabel getDeleteLabel() { + return deleteLabel; + } + + + public void hideDialog() { + this.dispose(); + } + + public void showDialog() { + this.setVisible(true); + } + + public void addNotification() { + notificationNeedShow.clear(); + + int size = NotificationCenter.getInstance().getNotificationsCount(); + for (int i = NOTIFICATIONCOUNT; i > 0; i--) { + int j = size - i; + if (j >= 0) { + Notification notification = NotificationCenter.getInstance().getNotification(j); + NotificationPane notificationPane = new NotificationPane(this, notification.getMessageId(), notification.getType(), notification.getMessage(), i, notification.getNotificationDialogAction()); + notificationNeedShow.add(notificationPane); + } + } + size = notificationNeedShow.size(); + for (int i = size - 1; i >= 0; i--) { + centerPanel.add(notificationNeedShow.get(i)); + } + } + + private void centerWindow() { + Window win = this; + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + + Dimension winSize = win.getSize(); + + if (winSize.height > screenSize.height) { + winSize.height = screenSize.height; + } + if (winSize.width > screenSize.width) { + winSize.width = screenSize.width; + } + //这里设置位置:水平居中,竖直偏上 + win.setLocation(screenSize.width - winSize.width - 90, 50); + } +} diff --git a/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java b/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java new file mode 100644 index 000000000..3ec5a53a9 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/ui/NotificationCenterPane.java @@ -0,0 +1,54 @@ +package com.fr.design.notification.ui; + +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.notification.NotificationCenter; +import com.fr.general.IOUtils; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +public class NotificationCenterPane extends BasicPane { + private static NotificationCenterPane notificationCenterPane = new NotificationCenterPane(); + private static UIButton notificationCenterButton; + + private NotificationCenterPane() { + setPreferredSize(new Dimension(24, 24)); + setLayout(new BorderLayout()); + notificationCenterButton = new UIButton(); + notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/notification/ui/notificationCenter.png")); + notificationCenterButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Show_Notification")); + notificationCenterButton.set4ToolbarButton(); + notificationCenterButton.setRolloverEnabled(false); + this.add(notificationCenterButton); + notificationCenterButton.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + NotificationCenterDialog notificationCenterDialog = new NotificationCenterDialog(DesignerContext.getDesignerFrame()); + notificationCenterDialog.showDialog(); + } + }); + this.setBackground(UIConstants.TEMPLATE_TAB_PANE_BACKGROUND); + } + + public static NotificationCenterPane getNotificationCenterPane() { + return notificationCenterPane; + } + + public void refreshButton() { + if (NotificationCenter.getInstance().getNotificationsCount() > 0) { + notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/notification/ui/notificationCenterDot.png")); + } else { + notificationCenterButton.setIcon(IOUtils.readIcon("/com/fr/design/notification/ui/notificationCenter.png")); + } + } + + @Override + protected String title4PopupWindow() { + return "NotificationCenter"; + } +} diff --git a/designer-base/src/main/java/com/fr/design/notification/ui/NotificationPane.java b/designer-base/src/main/java/com/fr/design/notification/ui/NotificationPane.java new file mode 100644 index 000000000..23de246cd --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/notification/ui/NotificationPane.java @@ -0,0 +1,148 @@ +package com.fr.design.notification.ui; + +import com.fr.design.dialog.NotificationDialogAction; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.notification.NotificationCenter; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.UIManager; + +/** + * @author Lanlan + * @version 10.0 + * Created by Lanlan on 2021/6/21 + */ +public class NotificationPane extends JPanel { + private NotificationCenterDialog parent; + private String messageId; + private int index; + private UILabel messageLabel; + private UILabel messageIcon; + private NotificationDialogAction notificationDialogAction; + + public NotificationPane(NotificationCenterDialog parent, String messageId, int type, String message, int index, NotificationDialogAction notificationDialogAction) { + this.parent = parent; + this.index = index; + this.messageId = messageId; + this.notificationDialogAction = notificationDialogAction; + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + setTypeIcon(getIconForType(type)); + setNotification(message); + setDeleteIcon(); + } + + public void setTypeIcon(Icon icon) { + messageIcon = new UILabel(icon); + messageIcon.addMouseListener(messageAndIconListener); + JPanel messageIconPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + messageIconPanel.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); + messageIconPanel.add(messageIcon); + add(messageIconPanel, BorderLayout.WEST); + } + + public void setDeleteIcon() { + UILabel deleteIcon = new UILabel(UIManager.getIcon("OptionPane.deleteIcon")); + JPanel deleteIconPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + deleteIconPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 7)); + deleteIconPane.add(deleteIcon); + deleteIconPane.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + NotificationCenter.getInstance().removeNotification(NotificationCenter.getInstance().getNotificationsCount() - index); + parent.getCenterPanel().removeAll(); + parent.addNotification(); + parent.getDeleteLabel().setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_Notifications") + "(" + NotificationCenter.getInstance().getNotificationsCount() + ")"); + parent.pack(); + if (parent.getNotificationNeedShow().size() == 0) { + parent.hideDialog(); + } + NotificationCenterPane.getNotificationCenterPane().refreshButton(); + } + + @Override + public void mouseEntered(MouseEvent e) { + deleteIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + + } + + @Override + public void mouseExited(MouseEvent e) { + deleteIcon.setCursor(Cursor.getDefaultCursor()); + } + }); + add(deleteIconPane, BorderLayout.EAST); + } + + public int getIndex() { + return index; + } + + public String getMessageId() { + return messageId; + } + + public NotificationDialogAction getNotificationDialogAction() { + return notificationDialogAction; + } + + public void setNotification(String message) { + messageLabel = new UILabel("" + message + ""); + messageLabel.addMouseListener(messageAndIconListener); + JPanel labelPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + labelPanel.add(messageLabel); + this.add(labelPanel, BorderLayout.CENTER); + } + + protected Icon getIconForType(int messageType) { + String propertyName; + switch (messageType) { + case 0: + propertyName = "OptionPane.circularErrorIcon"; + break; + case 1: + propertyName = "OptionPane.newMessageIcon"; + break; + case 2: + propertyName = "OptionPane.circularWarningIcon"; + break; + default: + return null; + } + return UIManager.getIcon(propertyName); + } + + private void performTargetAction() { + parent.hideDialog(); + notificationDialogAction.doClick(); + } + + private MouseListener messageAndIconListener = new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + performTargetAction(); + } + + @Override + public void mouseEntered(MouseEvent e) { + messageLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + messageIcon.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + messageLabel.setForeground(new Color(250, 170, 57)); + + } + + @Override + public void mouseExited(MouseEvent e) { + messageLabel.setCursor(Cursor.getDefaultCursor()); + messageIcon.setCursor(Cursor.getDefaultCursor()); + messageLabel.setForeground(Color.BLACK); + } + }; +} diff --git a/designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java b/designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java index 019ee3d97..c0b060005 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java @@ -1,6 +1,6 @@ package com.fr.design.os.impl; -import com.fr.design.gui.controlpane.UIListControlPane; +import com.fr.design.gui.controlpane.UIControlPane; import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.support.OSBasedAction; @@ -15,7 +15,7 @@ import java.awt.*; */ public class PopupDialogSaveAction implements OSBasedAction { - private UIListControlPane currentControlPane; + private UIControlPane currentControlPane; private Window popupDialog; @Override @@ -26,7 +26,7 @@ public class PopupDialogSaveAction implements OSBasedAction { } } - public void register(UIListControlPane currentControlPane, Window popupDialog) { + public void register(UIControlPane currentControlPane, Window popupDialog) { this.currentControlPane = currentControlPane; this.popupDialog = popupDialog; } diff --git a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java index a25d2606a..949d77045 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/SupportOSImpl.java @@ -140,6 +140,16 @@ public enum SupportOSImpl implements SupportOS { public boolean support() { return JdkVersion.GE_9.support() && OperatingSystem.isMacos() && getMacOsVersion() >= BIG_SUR_VERSION_NUMBER; } + }, + + DESIGNER_LOGIN { + @Override + public boolean support() { + if (OperatingSystem.isLinux()) { + return false; + } + return !OperatingSystem.isMacos() || getMacOsVersion() < BIG_SUR_VERSION_NUMBER; + } }; private static final int BIG_SUR_VERSION_NUMBER = 16; diff --git a/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java b/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java index 04d2f0f85..b6bed69ca 100644 --- a/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java +++ b/designer-base/src/main/java/com/fr/design/ui/EmbProtocolHandler.java @@ -80,6 +80,11 @@ public class EmbProtocolHandler implements ProtocolHandler { path = path.substring(4); } inputStream = IOUtils.readResource(path); + if (path.endsWith(".html")) { + String text = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); + text = TemplateUtils.renderParameter4Tpl(text, map); + return Assistant.inputStream2Response(new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)), path); + } return Assistant.inputStream2Response(inputStream, path); } } catch (Exception e) { diff --git a/designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java b/designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java index ed6fb542e..8f7bf0703 100644 --- a/designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java +++ b/designer-base/src/main/java/com/fr/design/ui/ModernUIConstants.java @@ -7,9 +7,9 @@ import com.fr.general.IOUtils; * @version 10.0 * Created by richie on 2019-03-05 */ -class ModernUIConstants { +public class ModernUIConstants { - static final String SCRIPT_INIT_NAME_SPACE = IOUtils.readResourceAsString("/com/fr/design/ui/InitNameSpace.js"); + public static final String SCRIPT_INIT_NAME_SPACE = IOUtils.readResourceAsString("/com/fr/design/ui/InitNameSpace.js"); - static final String HTML_TPL = IOUtils.readResourceAsString("/com/fr/design/ui/tpl.html"); + public static final String HTML_TPL = IOUtils.readResourceAsString("/com/fr/design/ui/tpl.html"); } diff --git a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java index 745c56ea7..084820a13 100644 --- a/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java +++ b/designer-base/src/main/java/com/fr/design/ui/ModernUIPane.java @@ -8,6 +8,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.web.struct.AssembleComponent; import com.teamdev.jxbrowser.chromium.Browser; +import com.teamdev.jxbrowser.chromium.BrowserType; import com.teamdev.jxbrowser.chromium.JSValue; import com.teamdev.jxbrowser.chromium.events.LoadListener; import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter; @@ -18,11 +19,11 @@ import com.teamdev.jxbrowser.chromium.swing.BrowserView; import javax.swing.JDialog; import javax.swing.SwingUtilities; import javax.swing.WindowConstants; +import java.util.Map; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.Map; /** * @author richie @@ -37,11 +38,11 @@ public class ModernUIPane extends BasicPane { private String variable = "data"; private String expression = "update()"; - private ModernUIPane() { - initialize(); + private ModernUIPane(BrowserType browserType) { + initialize(browserType); } - private void initialize() { + private void initialize(BrowserType browserType) { if (browser == null) { setLayout(new BorderLayout()); Assistant.addChromiumSwitches("--disable-google-traffic"); @@ -76,10 +77,10 @@ public class ModernUIPane extends BasicPane { } }); Assistant.addChromiumSwitches("--remote-debugging-port=9222"); - initializeBrowser(); + initializeBrowser(browserType); add(new BrowserView(browser), BorderLayout.CENTER); } else { - initializeBrowser(); + initializeBrowser(browserType); add(new BrowserView(browser), BorderLayout.CENTER); } } @@ -97,8 +98,8 @@ public class ModernUIPane extends BasicPane { debugger.loadURL(browser.getRemoteDebuggingURL()); } - private void initializeBrowser() { - browser = new Browser(); + private void initializeBrowser(BrowserType browserType) { + browser = new Browser(browserType); // 初始化的时候,就把命名空间对象初始化好,确保window.a.b.c("a.b.c"为命名空间)对象都是初始化过的 browser.addScriptContextListener(new ScriptContextAdapter() { @Override @@ -145,14 +146,22 @@ public class ModernUIPane extends BasicPane { public T update() { JSValue jsValue = browser.executeJavaScriptAndReturnValue("window." + namespace + "." + expression); if (jsValue.isObject()) { - return (T)jsValue.asJavaObject(); + return (T) jsValue.asJavaObject(); } return null; } public static class Builder { - private ModernUIPane pane = new ModernUIPane<>(); + private ModernUIPane pane; + + public Builder() { + this(BrowserType.HEAVYWEIGHT); + } + + public Builder(BrowserType browserType) { + this.pane = new ModernUIPane<>(browserType); + } public Builder prepare(ScriptContextListener contextListener) { pane.browser.addScriptContextListener(contextListener); @@ -174,6 +183,16 @@ public class ModernUIPane extends BasicPane { return this; } + /** + * 加载jar包中的资源 + * @param path 资源路径 + */ + public Builder withEMB(final String path, Map map) { + Assistant.setEmbProtocolHandler(pane.browser, new EmbProtocolHandler(map)); + pane.browser.loadURL("emb:" + path); + return this; + } + /** * 加载url指向的资源 * @param url 文件的地址 diff --git a/designer-base/src/main/java/com/fr/design/ui/compatible/NxComplexInterceptRequestCallback.java b/designer-base/src/main/java/com/fr/design/ui/compatible/NxComplexInterceptRequestCallback.java new file mode 100644 index 000000000..2c430bd34 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/ui/compatible/NxComplexInterceptRequestCallback.java @@ -0,0 +1,87 @@ +package com.fr.design.ui.compatible; + +import com.fr.design.ui.ModernRequestClient; +import com.fr.design.ui.ModernUIConstants; +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; +import com.fr.web.struct.AssembleComponent; +import com.fr.web.struct.AtomBuilder; +import com.fr.web.struct.PathGroup; +import com.fr.web.struct.category.ScriptPath; +import com.fr.web.struct.category.StylePath; +import com.teamdev.jxbrowser.net.Network; +import com.teamdev.jxbrowser.net.UrlRequest; +import com.teamdev.jxbrowser.net.callback.InterceptRequestCallback; + +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Map; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2020/3/25 + */ +public class NxComplexInterceptRequestCallback extends NxInterceptRequestCallback { + + private AssembleComponent component; + + public NxComplexInterceptRequestCallback(Network network, AssembleComponent component) { + super(network); + this.component = component; + } + + public NxComplexInterceptRequestCallback(Network network, AssembleComponent component, Map map) { + super(network, map); + this.component = component; + } + + @Override + protected Response next(UrlRequest urlRequest, String path) { + if (path.startsWith("emb:dynamic")) { + String text = htmlText(map); + return InterceptRequestCallback.Response.intercept(generateBasicUrlRequestJob(urlRequest, "text/html", text.getBytes(StandardCharsets.UTF_8))); + } else { + int index = path.indexOf("="); + if (index > 0) { + path = path.substring(index + 1); + } else { + path = path.substring(4); + } + InputStream inputStream = IOUtils.readResource(path); + return InterceptRequestCallback.Response.intercept(generateBasicUrlRequestJob(urlRequest, getMimeType(path), IOUtils.inputStream2Bytes(inputStream))); + } + } + + private String htmlText(Map map) { + PathGroup pathGroup = AtomBuilder.create().buildAssembleFilePath(ModernRequestClient.KEY, component); + StylePath[] stylePaths = pathGroup.toStylePathGroup(); + StringBuilder styleText = new StringBuilder(); + for (StylePath path : stylePaths) { + if (StringUtils.isNotBlank(path.toFilePath())) { + styleText.append(""); + } + } + String result = ModernUIConstants.HTML_TPL.replaceAll("##style##", styleText.toString()); + ScriptPath[] scriptPaths = pathGroup.toScriptPathGroup(); + StringBuilder scriptText = new StringBuilder(); + for (ScriptPath path : scriptPaths) { + if (StringUtils.isNotBlank(path.toFilePath())) { + scriptText.append(""); + } + } + result = result.replaceAll("##script##", scriptText.toString()); + if (map != null) { + for (Map.Entry entry : map.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue(); + result = result.replaceAll("\\$\\{" + key + "}", value); + } + } + return result; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/ui/compatible/NxInterceptRequestCallback.java b/designer-base/src/main/java/com/fr/design/ui/compatible/NxInterceptRequestCallback.java new file mode 100644 index 000000000..7b4977e77 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/ui/compatible/NxInterceptRequestCallback.java @@ -0,0 +1,134 @@ +package com.fr.design.ui.compatible; + +import com.fr.base.TemplateUtils; +import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ArrayUtils; +import com.fr.stable.EncodeConstants; +import com.fr.stable.StringUtils; +import com.fr.third.org.apache.commons.codec.net.URLCodec; +import com.teamdev.jxbrowser.net.HttpHeader; +import com.teamdev.jxbrowser.net.HttpStatus; +import com.teamdev.jxbrowser.net.Network; +import com.teamdev.jxbrowser.net.UrlRequest; +import com.teamdev.jxbrowser.net.UrlRequestJob; +import com.teamdev.jxbrowser.net.callback.InterceptRequestCallback; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Map; +import java.util.Optional; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2020/3/25 + */ +public class NxInterceptRequestCallback implements InterceptRequestCallback { + + Network network; + Map map; + + public NxInterceptRequestCallback(Network network) { + this.network = network; + } + + public NxInterceptRequestCallback(Network network, Map map) { + this.network = network; + this.map = map; + } + + @Override + public Response on(Params params) { + UrlRequest urlRequest = params.urlRequest(); + String path = urlRequest.url(); + if (path.startsWith("file:")) { + Optional optional = generateFileProtocolUrlRequestJob(urlRequest, path); + if (optional.isPresent()) { + return InterceptRequestCallback.Response.intercept(optional.get()); + } + } else { + return next(urlRequest, path); + } + return Response.proceed(); + } + + Response next(UrlRequest urlRequest, String path) { + return Response.proceed(); + } + + private Optional generateFileProtocolUrlRequestJob(UrlRequest urlRequest, String path) { + try { + String url = new URLCodec().decode(path); + String filePath = TemplateUtils.renderParameter4Tpl(url, map); + File file = new File(URI.create(filePath).getPath()); + InputStream inputStream = IOUtils.readResource(file.getAbsolutePath()); + String mimeType = getMimeType(path); + byte[] bytes; + if (isPlainText(mimeType)) { + String text = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8); + text = TemplateUtils.renderParameter4Tpl(text, map); + bytes = text.getBytes(StandardCharsets.UTF_8); + } else { + bytes = IOUtils.inputStream2Bytes(inputStream); + } + return Optional.of(generateBasicUrlRequestJob(urlRequest, mimeType, bytes)); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return Optional.empty(); + } + + private boolean isPlainText(String mimeType) { + return ArrayUtils.contains(new String[]{"text/html", "text/javascript", "text/css"}, mimeType); + } + + UrlRequestJob generateBasicUrlRequestJob(UrlRequest urlRequest, String mimeType, byte[] bytes) { + UrlRequestJob.Options options = UrlRequestJob.Options + .newBuilder(urlRequest.id(), HttpStatus.OK) + .addHttpHeader(HttpHeader.of("Content-Type", mimeType)) + .build(); + UrlRequestJob urlRequestJob = network.newUrlRequestJob(options); + urlRequestJob.write(bytes); + urlRequestJob.complete(); + return urlRequestJob; + } + + String getMimeType(String path) { + if (StringUtils.isBlank(path)) { + return "text/html"; + } + if (path.endsWith(".html")) { + return "text/html"; + } + if (path.endsWith(".css")) { + return "text/css"; + } + if (path.endsWith(".js")) { + return "text/javascript"; + } + if (path.endsWith(".svg")) { + return "image/svg+xml"; + } + if (path.endsWith(".png")) { + return "image/png"; + } + if (path.endsWith(".jpeg")) { + return "image/jpeg"; + } + if (path.endsWith(".gif")) { + return "image/gif"; + } + Path file = new File(path).toPath(); + try { + return Files.probeContentType(file); + } catch (IOException e) { + return "text/html"; + } + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java b/designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java new file mode 100644 index 000000000..304cae1ba --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/update/actions/SyncFileProcess.java @@ -0,0 +1,74 @@ +package com.fr.design.update.actions; + +import com.fr.decision.update.SyncExecutor; +import com.fr.decision.update.info.UpdateCallBack; +import com.fr.decision.update.info.UpdateProgressCallBack; +import com.fr.design.i18n.Toolkit; +import com.fr.design.versioncheck.VersionCheckUtils; +import com.fr.env.SyncFailedPluginsDialog; +import com.fr.json.JSONArray; +import com.fr.log.FineLoggerFactory; +import java.util.concurrent.ExecutionException; +import javax.swing.JProgressBar; +import javax.swing.SwingWorker; + +public abstract class SyncFileProcess extends SwingWorker { + private String buildNo; + private JProgressBar bar; + private SyncFailedPluginsDialog syncFailedPluginsDialog; + + public SyncFileProcess(JProgressBar bar, String buildNo, SyncFailedPluginsDialog syncFailedPluginsDialog) { + this.bar = bar; + this.buildNo = buildNo; + this.syncFailedPluginsDialog = syncFailedPluginsDialog; + } + + @Override + protected Boolean doInBackground() throws Exception { + UpdateCallBack callBack = new UpdateProgressCallBack(bar); + bar.setValue(0); + bar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); + JSONArray syncFailedPlugins = VersionCheckUtils.syncPlugins(VersionCheckUtils.checkLocalAndRemotePlugin()); + if (syncFailedPlugins.size() > 0) { + syncFailedPluginsDialog.showSyncFailedPluginsInfo(syncFailedPlugins); + } + RecoverForDesigner recoverForDesigner = new RecoverForDesigner(); + if (!recoverForDesigner.backup()) { + return false; + } + boolean result = SyncExecutor.getInstance().execute(callBack, buildNo); + if (!result) { + recoverForDesigner.recover(); + } + return result; + } + + @Override + protected void done() { + boolean success = false; + try { + success = get(); + } catch (InterruptedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); + } catch (ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + if (success) { + onDownloadSuccess(); + } else { + onDownloadFailed(); + } + } + + + /** + * 下载成功 + */ + public abstract void onDownloadSuccess(); + + /** + * 下载失败 + */ + public abstract void onDownloadFailed(); +} diff --git a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java index efd809e79..6214f1cfa 100644 --- a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java +++ b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java @@ -27,6 +27,8 @@ public class DesignerPushUpdateManager { private DesignerUpdateInfo updateInfo; + private boolean shouldPopUp = false; + private DesignerPushUpdateManager() { } @@ -91,13 +93,14 @@ public class DesignerPushUpdateManager { * 检查更新,如果有合适的更新版本,则弹窗 */ private void checkAndPop() { + if (!shouldPopUp()) { + this.shouldPopUp = true; + FineLoggerFactory.getLogger().debug("skip push update"); + return; + } checkUpdateService.execute(new Runnable() { @Override public void run() { - if (!shouldPopUp()) { - FineLoggerFactory.getLogger().debug("skip push update"); - return; - } final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); DesignerPushUpdateDialog.createAndShow(designerFrame, updateInfo); } @@ -139,6 +142,10 @@ public class DesignerPushUpdateManager { return StringUtils.isNotEmpty(prefix) && fullCurrentVersion.contains(SPLIT_CHAR); } + public boolean isShouldPopUp() { + return shouldPopUp; + } + /** * 跳转到更新升级窗口,并自动开始更新 */ diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java index 0c25281d5..ad933d7d2 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmBridge.java @@ -1,9 +1,8 @@ package com.fr.design.upm; -import com.fr.base.passport.FinePassportManager; -import com.fr.config.MarketConfig; import com.fr.config.ServerPreferenceConfig; import com.fr.decision.webservice.v10.plugin.helper.category.impl.UpmResourceLoader; +import com.fr.design.DesignerEnvManager; import com.fr.design.bridge.exec.JSBridge; import com.fr.design.bridge.exec.JSCallback; import com.fr.design.extra.PluginOperateUtils; @@ -19,12 +18,12 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.locale.impl.BbsRegisterMark; import com.fr.design.locale.impl.BbsResetMark; import com.fr.design.locale.impl.BbsSpaceMark; -import com.fr.design.upm.event.CertificateEvent; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.upm.event.DownloadEvent; import com.fr.design.upm.exec.UpmBrowserExecutor; import com.fr.design.upm.task.UpmTaskWorker; +import com.fr.design.utils.BrowseUtils; import com.fr.event.EventDispatcher; -import com.fr.general.CloudCenter; import com.fr.general.GeneralUtils; import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; @@ -379,7 +378,7 @@ public class UpmBridge { @JSBridge public String getLoginInfo(final JSFunction callback) { registerLoginInfo(callback); - return MarketConfig.getInstance().getBbsUsername(); + return DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); } /** @@ -390,13 +389,11 @@ public class UpmBridge { @JSBridge public void registerLoginInfo(final JSFunction callback) { JSCallback jsCallback = new JSCallback(UpmBrowserExecutor.create(window, callback)); - String username = MarketConfig.getInstance().getBbsUsername(); + String username = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isEmpty(username)) { jsCallback.execute(StringUtils.EMPTY); - EventDispatcher.fire(CertificateEvent.LOGOUT, StringUtils.EMPTY); } else { jsCallback.execute(username); - EventDispatcher.fire(CertificateEvent.LOGIN, username); } } @@ -417,10 +414,9 @@ public class UpmBridge { /** * 清除用户信息 */ + @JSBridge public void clearUserInfo() { - MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY); - FinePassportManager.getInstance().logout(); - EventDispatcher.fire(CertificateEvent.LOGOUT, StringUtils.EMPTY); + } /** @@ -430,7 +426,8 @@ public class UpmBridge { public void getPriviteMessage() { try { LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); - Desktop.getDesktop().browse(new URI(spaceMark.getValue())); + String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(spaceMark.getValue()); + BrowseUtils.browser(ssoUrl); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } diff --git a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java index 36e558d17..2ea539faf 100644 --- a/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java +++ b/designer-base/src/main/java/com/fr/design/upm/UpmFinder.java @@ -5,6 +5,7 @@ import com.fr.decision.webservice.v10.plugin.helper.category.impl.UpmResourceLoa import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.UIDialog; import com.fr.design.i18n.Toolkit; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.design.plugin.DesignerPluginContext; import com.fr.design.update.ui.dialog.UpdateMainDialog; @@ -97,6 +98,7 @@ public class UpmFinder { dialog = new UpmShowDialog(DesignerContext.getDesignerFrame(), upmPane); } dialog.setVisible(true); + DesignerLoginUtils.showPluginRemindOnFirstLaunch(dialog); } } diff --git a/designer-base/src/main/java/com/fr/design/upm/event/CertificateEvent.java b/designer-base/src/main/java/com/fr/design/upm/event/CertificateEvent.java index 571076844..f3c2a4bf4 100644 --- a/designer-base/src/main/java/com/fr/design/upm/event/CertificateEvent.java +++ b/designer-base/src/main/java/com/fr/design/upm/event/CertificateEvent.java @@ -7,6 +7,6 @@ import com.fr.event.Event; * @version 10.0 * Created by richie on 2019-04-18 */ -public enum CertificateEvent implements Event { - LOGIN,LOGOUT +public enum CertificateEvent implements Event { + LOGIN, LOGOUT } diff --git a/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java new file mode 100644 index 000000000..e63395ff6 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java @@ -0,0 +1,362 @@ +package com.fr.design.versioncheck; + +import com.fr.base.FRContext; +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.NotificationDialog; +import com.fr.design.dialog.NotificationDialogAction; +import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.env.DesignerWorkspaceType; +import com.fr.design.env.RemoteWorkspace; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.env.CheckServiceDialog; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralUtils; +import com.fr.invoke.Reflect; +import com.fr.json.JSONArray; +import com.fr.json.JSONObject; +import com.fr.locale.InterProviderFactory; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.context.PluginMarker; +import com.fr.plugin.manage.PluginManager; +import com.fr.plugin.manage.control.PluginControllerHelper; +import com.fr.plugin.manage.control.PluginExtraInfo; +import com.fr.plugin.manage.control.PluginTaskCallback; +import com.fr.plugin.manage.control.PluginTaskResult; +import com.fr.plugin.manage.control.ProgressCallback; +import com.fr.report.ReportHelper; +import com.fr.rpc.Result; +import com.fr.stable.StringUtils; +import com.fr.workspace.WorkContext; +import com.fr.workspace.base.WorkspaceAPI; +import com.fr.workspace.connect.WorkspaceConnectionInfo; +import com.fr.workspace.engine.base.FineObjectPool; +import com.fr.workspace.engine.channel.http.FunctionalHttpRequest; +import com.fr.workspace.engine.exception.WorkspaceConnectionException; +import com.fr.workspace.engine.rpc.WorkspaceProxyPool; +import java.lang.reflect.Method; +import java.text.ParsePosition; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +/** + * @author pengda + * @version 10.0 + * Created on 2021-06-02 + */ +public class VersionCheckUtils { + public static final String INCONSISTENCY = "inconsistency"; + public static final String MISSING = "missing"; + private static final String ID = "id"; + private static final String VERSION = "version"; + private static final String NAME = "name"; + + + public static boolean versionCheck(String envName) { + return checkLocalAndRemoteJartime(envName) && checkLocalAndRemotePlugin().size() == 0; + } + + public static boolean versionCheck(DesignerWorkspaceInfo selectedEnv) { + return checkLocalAndRemoteJartime(selectedEnv) && checkLocalAndRemotePlugin().size() == 0; + } + + public static void showVersionCheckDialog(String envName) { + if (!VersionCheckUtils.versionCheck(envName)) { + NotificationDialog notificationDialog = new NotificationDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Sync_Prompt"), + false, NotificationDialog.WARNING_MESSAGE, Toolkit.i18nText("Fine-Design_Basic_Sync_Check_Brief_Info"), new NotificationDialogAction() { + @Override + public String name() { + return "VERSION_CHECK"; + } + + @Override + public void doClick() { + CheckServiceDialog checkServiceDialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), GeneralUtils.readFullBuildNO(), getRemoteBranch(envName),getNoExistServiceDescription(envName)); + checkServiceDialog.setVisible(true); + } + }); + notificationDialog.setVisible(true); + } + } + + public static boolean checkLocalAndRemoteJartime(String envName) { + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); + DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName); + return checkLocalAndRemoteJartime(selectedEnv); + } + + public static boolean checkLocalAndRemoteJartime(DesignerWorkspaceInfo selectedEnv) { + //是否需要做服务校验 + if (needCheckBranch(selectedEnv)) { + String localBranch; + String remoteBranch = getRemoteBranch(selectedEnv); + localBranch = GeneralUtils.readFullBuildNO(); + //通过是否包含#来避免当前版本为非安装版本(主要是内部开发版本) + if (localBranch.contains("#") && ComparatorUtils.equals(localBranch, remoteBranch)) { + //说明版本一致,仅做日志记录 + FineLoggerFactory.getLogger().info("Remote Designer version consistency"); + return true; + } else { + return false; + } + } + return true; + } + + public static List getNoExistServiceDescription(String envName) { + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); + DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName); + WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); + List noExistServiceDescription = new ArrayList<>(); + Set noExistServiceSet = getNoExistServiceSet(connectionInfo); + for (Class clazz : noExistServiceSet) { + WorkspaceAPI workspaceAPI = (WorkspaceAPI) clazz.getAnnotation(WorkspaceAPI.class); + if (workspaceAPI == null) { + FineLoggerFactory.getLogger().info("workspace service {} get annotation failed", clazz); + continue; + } + if (workspaceAPI.ignore()) { + continue; + } + String descriptionOfCN = InterProviderFactory.getProvider().getLocText(workspaceAPI.description()); + noExistServiceDescription.add(descriptionOfCN); + } + return noExistServiceDescription; + } + + public static String getRemoteBranch(String envName) { + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); + DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName); + return getRemoteBranch(selectedEnv); + } + + public static String getRemoteBranch(DesignerWorkspaceInfo selectedEnv) { + String remoteBranch = StringUtils.EMPTY; + WorkspaceConnectionInfo connectionInfo = selectedEnv.getConnection(); + try { + remoteBranch = new FunctionalHttpRequest(connectionInfo).getServerBranch(); + } catch (WorkspaceConnectionException e) { + remoteBranch = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + formatBranch(GeneralUtils.readFullBuildNO()); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return remoteBranch; + } + + /** + * 获取不存在的服务列表 + * + * @param info 环境连接信息 + * @return 以Set形式返回不存在的服务 + */ + public static Set getNoExistServiceSet(WorkspaceConnectionInfo info) { + Set noExistServiceSet = new HashSet(); + Set remoteServiceSet = new HashSet(); + Set localServiceSet = FineObjectPool.getInstance().getServerPool().keySet(); + + try { + JSONArray serviceArray = new FunctionalHttpRequest(info).getServiceList(); + for (int i = 0; i < serviceArray.size(); i++) { + try { + Class clazz = Class.forName((String) serviceArray.get(i)); + remoteServiceSet.add(clazz); + } catch (Exception e) { + continue; + } + } + noExistServiceSet.addAll(localServiceSet); + noExistServiceSet.removeAll(remoteServiceSet); + return noExistServiceSet; + } catch (WorkspaceConnectionException e) { + FineLoggerFactory.getLogger().info(e.getMessage()); + //根据本地的服务列表做逐一检测 + for (Class clazz : localServiceSet) { + Method testMethod = Reflect.on(Method.class).create(clazz, "connectTest", new Class[0], String.class, new Class[0], 1025, 8, null, null, null, null).get(); + WorkspaceProxyPool proxyPool = (WorkspaceProxyPool) (((RemoteWorkspace) WorkContext.getCurrent()).getClient()).getPool(); + Result result = proxyPool.testInvoker(testMethod); + Exception invokeException = (Exception) result.getException(); + if (invokeException != null) { + Exception cause = (Exception) invokeException.getCause(); + //获取被包装最底层的异常 + while (cause != null) { + invokeException = cause; + cause = (Exception) invokeException.getCause(); + } + //该异常表示服务不存在 + if (invokeException instanceof ClassNotFoundException) { + noExistServiceSet.add(clazz); + } + } + } + return noExistServiceSet; + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return noExistServiceSet; + } + } + + /** + * 格式化分支版本号 + * + * @param buildNO 初始的分支版本号 + * @return 格式化后的版本号 + */ + private static String formatBranch(String buildNO) { + Date jarDate = (new SimpleDateFormat("yyyy.MM.dd")).parse(buildNO, new ParsePosition(buildNO.indexOf("-") + 1)); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + return df.format(jarDate); + } + + private static boolean needCheckBranch(DesignerWorkspaceInfo selectedEnv) { + return selectedEnv.getType() == DesignerWorkspaceType.Remote; + } + + public static JSONArray checkLocalAndRemotePlugin() { + JSONArray differentPlugins = new JSONArray(); + JSONArray remotePlugins = FRContext.getCommonOperator().getPluginStatus(); + Map localPluginsMap = new HashMap<>(); + List localPlugins = PluginManager.getContexts(); + for (PluginContext pluginContext : localPlugins) { + localPluginsMap.put(pluginContext.getID(), pluginContext); + } + JSONObject remotePlugin; + Map pluginsNameMap = ReportHelper.getPluginNameMap(); + for (int i = 0; i < remotePlugins.size(); i++) { + remotePlugin = remotePlugins.getJSONObject(i); + if (ComparatorUtils.equals(remotePlugin.getString("running"), "false")) { + continue; + } + String remotePluginID = remotePlugin.getString(ID); + if (localPluginsMap.containsKey(remotePluginID)) { + if (ComparatorUtils.equals(localPluginsMap.get(remotePluginID).getVersion(), remotePlugin.getString(VERSION))) { + continue; + } else { + if (remotePlugin.getString(NAME) == null) { + remotePlugin.put(NAME, localPluginsMap.get(remotePluginID).getName()); + } + remotePlugin.put("type", INCONSISTENCY); + } + } else { + remotePlugin.put("type", MISSING); + if (remotePlugin.getString(NAME) == null) { + remotePlugin.put(NAME, pluginsNameMap.getOrDefault(remotePluginID, remotePluginID)); + } + } + differentPlugins.put(remotePlugin); + } + return differentPlugins; + } + + public static JSONArray syncPlugins(JSONArray differentPlugins) { + Set uninstallFailed = uninstallPlugins(differentPlugins); + List plugins = getSyncPlugins(differentPlugins, uninstallFailed); + installPlugins(plugins); + return getPluginsSyncFailed(differentPlugins); + } + + private static List getSyncPlugins(JSONArray differentPlugins, Set uninstallFailed) { + JSONObject differentPlugin; + String id; + String version; + List plugins = new ArrayList<>(); + if (differentPlugins != null) { + for (int i = 0; i < differentPlugins.size(); i++) { + differentPlugin = differentPlugins.getJSONObject(i); + id = differentPlugin.getString(ID); + if (uninstallFailed.contains(id)) { + continue; + } + version = differentPlugin.getString(VERSION); + plugins.add(PluginMarker.create(id, version)); + } + } + return plugins; + } + + private static Set uninstallPlugins(JSONArray differentPlugins) { + Set pluginsNeedUninstall = new HashSet<>(); + Map localPluginsMap = new HashMap<>(); + List localPlugins = PluginManager.getContexts(); + for (PluginContext pluginContext : localPlugins) { + localPluginsMap.put(pluginContext.getID(), pluginContext); + } + for (int i = 0; i < differentPlugins.size(); i++) { + String id = differentPlugins.getJSONObject(i).getString(ID); + if (localPluginsMap.containsKey(id)) { + pluginsNeedUninstall.add(localPluginsMap.get(id).getMarker()); + } + } + Set uninstallFailedID = new HashSet<>(); + CountDownLatch latch = new CountDownLatch(pluginsNeedUninstall.size()); + for (PluginMarker pluginMarker : pluginsNeedUninstall) { + PluginManager.getController().uninstall(pluginMarker, true, new PluginTaskCallback() { + @Override + public void done(PluginTaskResult result) { + latch.countDown(); + if (!result.isSuccess()) { + uninstallFailedID.add(pluginMarker.getPluginID()); + } + } + }); + } + try { + latch.await(5000, TimeUnit.MILLISECONDS); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return uninstallFailedID; + } + + private static JSONArray getPluginsSyncFailed(JSONArray differentPlugins) { + JSONArray pluginsNeedSync = JSONArray.create(); + List localPlugins = PluginManager.getContexts(); + Map localPluginsInfo = new HashMap<>(); + for (int i = 0; i < localPlugins.size(); i++) { + localPluginsInfo.put(localPlugins.get(i).getID(), localPlugins.get(i).getVersion()); + } + for (int i = 0; i < differentPlugins.size(); i++) { + JSONObject plugin = differentPlugins.getJSONObject(i); + String id = plugin.getString(ID); + if (localPluginsInfo.containsKey(id) && ComparatorUtils.equals(plugin.getString(VERSION), localPluginsInfo.get(id))) { + continue; + } + pluginsNeedSync.add(plugin); + } + return pluginsNeedSync; + } + + private static void installPlugins(List plugins) { + CountDownLatch latch = new CountDownLatch(plugins.size()); + for (int i = 0; i < plugins.size(); i++) { + PluginControllerHelper.installOnline(plugins.get(i), new ProgressCallback() { + @Override + public void updateProgress(String description, double progress) { + + } + + @Override + public void done(PluginTaskResult result) { + latch.countDown(); + if(result.isSuccess()) { + FineLoggerFactory.getLogger().info("installPlugin: " + result.getCurrentTask().getMarker().getPluginID()); + } + } + }, PluginExtraInfo.newBuilder().username(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()).build()); + } + try { + latch.await(); + } catch (InterruptedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + + } +} diff --git a/designer-base/src/main/java/com/fr/design/widget/EventCreator.java b/designer-base/src/main/java/com/fr/design/widget/EventCreator.java index 4fdfd7ed8..63d40515c 100644 --- a/designer-base/src/main/java/com/fr/design/widget/EventCreator.java +++ b/designer-base/src/main/java/com/fr/design/widget/EventCreator.java @@ -18,6 +18,10 @@ public class EventCreator extends NameableSelfCreator { this.eventName = eventName; } + public String getEventName() { + return eventName; + } + @Override public Nameable createNameable(UnrepeatedNameHelper helper) { return new NameObject(helper.createUnrepeatedName(this.menuName()),new Listener(this.eventName)) ; @@ -47,13 +51,17 @@ public class EventCreator extends NameableSelfCreator { return eventName; } } + @Override - public void saveUpdatedBean(ListModelElement wrapper, Object bean) { - ((NameObject)wrapper.wrapper).setObject(bean); + public void saveUpdatedBean(ListModelElement element, Object bean) { + if (bean instanceof Listener){ + ((Listener)bean).setName(element.wrapper.getName()); + } + ((NameObject)element.wrapper).setObject(bean); } @Override public String createTooltip() { return null; } -} \ No newline at end of file +} diff --git a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java index efee9bfdf..ef4b0e032 100644 --- a/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java +++ b/designer-base/src/main/java/com/fr/env/CheckServiceDialog.java @@ -1,32 +1,64 @@ package com.fr.env; -import com.fr.design.DesignerEnvManager; -import com.fr.design.env.RemoteDesignerWorkspaceInfo; +import com.fr.decision.update.data.UpdateConstants; +import com.fr.design.RestartHelper; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.update.actions.SyncFileProcess; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.env.utils.DisplayUtils; +import com.fr.design.versioncheck.VersionCheckUtils; +import com.fr.general.CloudCenter; +import com.fr.general.CloudCenterConfig; +import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; +import com.fr.general.http.HttpToolbox; +import com.fr.json.JSONArray; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.process.engine.core.FineProcessContext; +import com.fr.process.engine.core.FineProcessEngineEvent; +import com.fr.stable.CommonUtils; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; +import com.fr.stable.project.ProjectConstants; +import com.sun.java.swing.plaf.motif.MotifProgressBarUI; +import java.awt.Color; +import java.awt.Component; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.io.File; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JDialog; +import javax.swing.JFrame; import javax.swing.JLabel; +import javax.swing.JOptionPane; import javax.swing.JPanel; -import javax.swing.JTextArea; -import javax.swing.JTextPane; +import javax.swing.JProgressBar; +import javax.swing.JScrollPane; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.Locale; +import javax.swing.ScrollPaneConstants; +import javax.swing.SwingWorker; +import javax.swing.UIManager; + + +import static javax.swing.JOptionPane.QUESTION_MESSAGE; /** * @author: Maksim @@ -36,11 +68,34 @@ import java.util.Locale; public class CheckServiceDialog extends JDialog implements ActionListener { private JPanel topPanel; private JPanel centerPanel; - private JPanel bottomPanel; - private UICheckBox remindBox; + private UIButton ignoreButton; + private UIButton syncButton; + private JProgressBar progressBar; + private String remoteBuildNo; + private static final Dimension PROGRESSBAR = new Dimension(120, 15); + private JSONArray differentPlugins; + private UILabel affectedFunctionsLabel; + private UILabel jarCheckResultLabel; + private UILabel jarCheckTitleLabel; + private UILabel pluginCheckTitleLabel; + + private JPanel affectedFunctionsDetailsPane; + private JPanel pluginsCheckResultPanel; + private JPanel detailsInnerPane; + private JPanel detailsPane; + private JScrollPane jScrollPane; + private Component[][] detailsComponents; + private Component[][] hideAffectedFunctionsComponents; + private boolean showAffectedFunctions = true; + private boolean jarConsistency; + private double p = TableLayout.PREFERRED; + private double f = TableLayout.FILL; - public CheckServiceDialog(Frame parent, String areaText, String localBranch, String remoteBranch){ - super(parent,true); + public CheckServiceDialog(Frame parent, String localBranch, String remoteBranch, List noExistServiceDescription) { + super(parent, true); + this.remoteBuildNo = remoteBranch; + this.differentPlugins = VersionCheckUtils.checkLocalAndRemotePlugin(); + this.jarConsistency = ComparatorUtils.equals(localBranch, remoteBranch); //上面的标签面板 topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel imagePanel = new JPanel(); @@ -49,90 +104,296 @@ public class CheckServiceDialog extends JDialog implements ActionListener { JLabel imageLabel = new JLabel(); imageLabel.setIcon(icon); imagePanel.add(imageLabel); - imagePanel.setPreferredSize(new Dimension(110,100)); + imagePanel.setPreferredSize(new Dimension(110, 100)); JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); FRFont font = FRFont.getInstance(); font = font.applySize(15).applyStyle(1); - JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Inconsistency")); + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_Branch_Inconsistency")); label.setFont(font); - label.setPreferredSize(new Dimension(650,30)); - - String text = Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") + localBranch - + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + - Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old") + - localBranch; - String delimiter = DisplayUtils.getDisplayLength(text) > 70? "
":"/"; - JLabel label2 = new JLabel(""+Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Local_Designer") - + localBranch + delimiter + Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remote_Server") + - Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Is_Old")+ localBranch +""); - label2.setPreferredSize(new Dimension(600,30)); - - JTextPane tipsPane = new JTextPane(); - tipsPane.setEditable(false); - tipsPane.setBackground(verticalPanel.getBackground()); - tipsPane.setPreferredSize(new Dimension(500,40)); - tipsPane.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Branch_Need_Update")); + label.setPreferredSize(new Dimension(650, 30)); + UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_Inconsistency_Risk")); + label2.setPreferredSize(new Dimension(600, 30)); verticalPanel.add(label); verticalPanel.add(label2); - verticalPanel.add(tipsPane); - topPanel.add(imagePanel,BorderLayout.WEST); - topPanel.add(verticalPanel,BorderLayout.CENTER); - topPanel.setBorder(BorderFactory.createEmptyBorder(10,10,0,10)); + topPanel.add(imagePanel, BorderLayout.WEST); + topPanel.add(verticalPanel, BorderLayout.CENTER); + topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); //中间的文本域面板 centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - centerPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10)); - centerPanel.setPreferredSize(new Dimension(480,320)); - - JLabel titleLabel = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Affected_Function")); - titleLabel.setPreferredSize(new Dimension(400,40)); - JTextArea checkArea = new JTextArea(areaText); - checkArea.setEnabled(false); - centerPanel.add(titleLabel,BorderLayout.NORTH); - centerPanel.add(checkArea,BorderLayout.CENTER); - - //下面的按钮面板 - remindBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Remind_Show")); - remindBox.addActionListener(remindCheckboxListener); - UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm")); - JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - buttonPanel.setBorder(BorderFactory.createEmptyBorder(0,10,10,10)); - buttonPanel.add(remindBox, BorderLayout.WEST); - buttonPanel.add(okButton,BorderLayout.EAST); - okButton.addActionListener(this ); - bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); - bottomPanel.add(buttonPanel); + centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + centerPanel.setPreferredSize(new Dimension(480, 320)); + + UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_Details")); + titleLabel.setPreferredSize(new Dimension(400, 40)); + //详情面板 + detailsPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); + detailsPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 0)); + detailsPane.setBackground(Color.WHITE); + + jarCheckTitleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_JAR_Check_title")); + jarCheckTitleLabel.setBackground(Color.WHITE); + + //插件的检测结果相关面板 + pluginCheckTitleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Check_title")); + pluginCheckTitleLabel.setBackground(Color.WHITE); + initPluginsCheckResultPanel(differentPlugins); + + //jar包检测结果相关面板 + initJarCheckResultPanel(remoteBranch, noExistServiceDescription); + + double[] detailsRowSize; + double[] detailsColumnSize = {f}; + + detailsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {affectedFunctionsDetailsPane}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}}; + hideAffectedFunctionsComponents = new Component[][]{{jarCheckTitleLabel}, {jarCheckResultLabel}, {affectedFunctionsLabel}, {pluginCheckTitleLabel}, {pluginsCheckResultPanel}}; + if (noExistServiceDescription.size() > 0 && !ComparatorUtils.equals(remoteBranch, localBranch)) { + detailsRowSize = new double[]{p, p, p, p, p, p}; + detailsInnerPane = TableLayoutHelper.createTableLayoutPane(detailsComponents, detailsRowSize, detailsColumnSize); + } else { + detailsRowSize = new double[]{p, p, 0, 0, p, p}; + detailsInnerPane = TableLayoutHelper.createTableLayoutPane(detailsComponents, detailsRowSize, detailsColumnSize); + } + detailsInnerPane.setBackground(Color.WHITE); + jScrollPane = new JScrollPane(detailsInnerPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + jScrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + detailsPane.add(jScrollPane); + + centerPanel.add(titleLabel, BorderLayout.NORTH); + centerPanel.add(detailsPane, BorderLayout.CENTER); + JPanel buttonPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); + buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); + boolean Sync = false; + if (Sync && isOnline()) { + ignoreButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Sync_Ignore")); + ignoreButton.addActionListener(this); + syncButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Sync_To_Local")); + syncButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Sync_To_Local_Tip")); + syncButton.addMouseListener(syncButtonClickListener); + progressBar = new JProgressBar(); + progressBar.setUI(new MotifProgressBarUI()); + progressBar.setForeground(UpdateConstants.BAR_COLOR); + progressBar.setVisible(false); + progressBar.setStringPainted(true); + progressBar.setPreferredSize(PROGRESSBAR); + buttonPanel.add(ignoreButton, BorderLayout.WEST); + buttonPanel.add(progressBar, BorderLayout.CENTER); + buttonPanel.add(syncButton, BorderLayout.EAST); + } else { + UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Button_Confirm")); + okButton.addActionListener(this); + buttonPanel.add(okButton, BorderLayout.EAST); + } this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Title_Hint")); this.setResizable(false); - - this.add(topPanel,BorderLayout.NORTH); + this.add(topPanel, BorderLayout.NORTH); this.add(centerPanel, BorderLayout.CENTER); - this.add(buttonPanel,BorderLayout.SOUTH); - this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 750:600, 500)); - + this.add(buttonPanel, BorderLayout.SOUTH); + this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 750 : 600, 500)); GUICoreUtils.centerWindow(this); } + + /** + * 插件检测的结果 + */ + private void initPluginsCheckResultPanel(JSONArray differentPlugins) { + + if (differentPlugins.size() > 0) { + int size = differentPlugins.size(); + Component[][] pluginCheckResultComponents = new Component[size][1]; + double[] pluginCheckResultColumnSize = new double[size]; + for (int i = 0; i < size; i++) { + JSONObject plugin = differentPlugins.getJSONObject(i); + JLabel pluginLabel; + if (ComparatorUtils.equals(VersionCheckUtils.INCONSISTENCY, plugin.getString("type"))) { + pluginLabel = new JLabel("\"" + plugin.getString("name") + "\"" + Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Inconsistency_Info") + plugin.getString("version")); + } else if (ComparatorUtils.equals(VersionCheckUtils.MISSING, plugin.getString("type"))) { + pluginLabel = new JLabel("\"" + plugin.getString("name") + "\"" + Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Missing_Info") + plugin.getString("version")); + } else { + continue; + } + pluginLabel.setIcon(IOUtils.readIcon("com/fr/design/icon/versioncheck/fail.png")); + pluginCheckResultComponents[i][0] = pluginLabel; + pluginCheckResultColumnSize[i] = p; + } + double[] pluginCheckResultRowSize = {f}; + pluginsCheckResultPanel = TableLayoutHelper.createTableLayoutPane(pluginCheckResultComponents, pluginCheckResultColumnSize, pluginCheckResultRowSize); + } else { + UILabel pluginCheckResultLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Consistency")); + pluginCheckResultLabel.setIcon(IOUtils.readIcon("com/fr/design/icon/versioncheck/success.png")); + pluginsCheckResultPanel = TableLayoutHelper.createTableLayoutPane(new Component[][]{{pluginCheckResultLabel}}, new double[]{p}, new double[]{f}); + } + pluginsCheckResultPanel.setBackground(Color.WHITE); + } + + /** + * jar包检测的结果 + */ + private void initJarCheckResultPanel(String remoteBranch, List noExistServiceDescription) { + jarCheckResultLabel = new UILabel(); + jarCheckResultLabel.setBackground(Color.WHITE); + if (jarConsistency) { + jarCheckResultLabel.setText(Toolkit.i18nText("Fine-Design_Basic_Sync_JAR_Consistency")); + jarCheckResultLabel.setIcon(IOUtils.readIcon("com/fr/design/icon/versioncheck/success.png")); + } else { + jarCheckResultLabel.setText(Toolkit.i18nText("Fine-Design_Basic_Sync_JAR_Inconsistency_Info") + remoteBranch); + jarCheckResultLabel.setIcon(IOUtils.readIcon("com/fr/design/icon/versioncheck/fail.png")); + Component[][] noExistServiceComponents; + int noExistService = noExistServiceDescription.size(); + if (noExistService > 0) { + affectedFunctionsLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Affected_Function")); + affectedFunctionsLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); + affectedFunctionsLabel.setBackground(Color.WHITE); + affectedFunctionsLabel.addMouseListener(affectedFunctionsClickListener); + noExistServiceComponents = new Component[noExistServiceDescription.size()][1]; + double[] noExistServiceColumnSize = new double[noExistService]; + for (int i = 0; i < noExistService; i++) { + JLabel noExitServiceLabel = new JLabel(" " + noExistServiceDescription.get(i)); + noExistServiceComponents[i][0] = noExitServiceLabel; + noExistServiceColumnSize[i] = p; + } + double[] noExistServiceRowSize = {f}; + affectedFunctionsDetailsPane = TableLayoutHelper.createTableLayoutPane(noExistServiceComponents, noExistServiceColumnSize, noExistServiceRowSize); + affectedFunctionsDetailsPane.setBackground(Color.WHITE); + } + } + } + @Override public void actionPerformed(ActionEvent e) { this.dispose(); } + private boolean isOnline() { + if (CloudCenterConfig.getInstance().isOnline()) { + String ping = CloudCenter.getInstance().acquireConf("ping", StringUtils.EMPTY); + if (StringUtils.isNotEmpty(ping)) { + try { + return StringUtils.isEmpty(HttpToolbox.get(ping)); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return false; + } + } + } + return false; + } - private ActionListener remindCheckboxListener = new ActionListener() { + private MouseListener affectedFunctionsClickListener = new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (showAffectedFunctions) { + showAffectedFunctions = false; + detailsInnerPane.removeAll(); + affectedFunctionsLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right")); + TableLayoutHelper.addComponent2ResultPane(hideAffectedFunctionsComponents, new double[]{p, p, p, p, p}, new double[]{f}, detailsInnerPane); + jScrollPane.validate(); + jScrollPane.repaint(); + } else { + showAffectedFunctions = true; + detailsInnerPane.removeAll(); + affectedFunctionsLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); + TableLayoutHelper.addComponent2ResultPane(detailsComponents, new double[]{p, p, p, p, p, p}, new double[]{f}, detailsInnerPane); + jScrollPane.validate(); + jScrollPane.repaint(); + } + } + }; + private MouseListener syncButtonClickListener = new MouseAdapter() { @Override - public void actionPerformed(ActionEvent e) { - SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); - String remindTime = format.format(new Date()); - //环境已切换,通过当前环境获取,一定是远程环境 - String currentEnvName = DesignerEnvManager.getEnvManager().getCurEnvName(); - RemoteDesignerWorkspaceInfo currentEnv = (RemoteDesignerWorkspaceInfo)DesignerEnvManager.getEnvManager().getWorkspaceInfo(currentEnvName); - currentEnv.setRemindTime(remindBox.isSelected()? remindTime : ""); + public void mouseClicked(MouseEvent e) { + ignoreButton.setEnabled(false); + String[] option = {Toolkit.i18nText("Fine-Design_Report_Yes"), Toolkit.i18nText("Fine-Design_Report_No")}; + if (!jarConsistency) { + int a = FineJOptionPane.showOptionDialog(getParent(), Toolkit.i18nText("Fine-Design_Basic_Sync_Info_Information"), + Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION, QUESTION_MESSAGE, IOUtils.readIcon("com/fr/design/icon/versioncheck/question.png"), option, 1); + if (0 == a) { + progressBar.setVisible(true); + progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); + syncButton.setEnabled(false); + deletePreviousPropertyFile(); + final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB); + final JFrame frame = DesignerContext.getDesignerFrame(); + final RestartHelper helper = new RestartHelper(); + FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); + SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(frame, JSONArray.create()); + new SyncFileProcess(progressBar, remoteBuildNo, syncFailedPluginsDialog) { + @Override + public void onDownloadSuccess() { + deleteForDesignerUpdate(installLib); + progressBar.setVisible(false); + syncFailedPluginsDialog.showDialog(); + if (!syncFailedPluginsDialog.restartClicked()) { + helper.restartForUpdate(frame); + } + } + + @Override + public void onDownloadFailed() { + progressBar.setVisible(false); + deleteForDesignerUpdate(installLib); + ErrorDialog errorDialog = new ErrorDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Sync_Fail")); + errorDialog.setVisible(true); + helper.restartForUpdate(frame); + } + }.execute(); + } + } else { + //到这边说明主jar是一致的,就只尝试同步插件 + new SwingWorker() { + + @Override + protected JSONArray doInBackground() { + progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); + progressBar.setValue(0); + return VersionCheckUtils.syncPlugins(differentPlugins); + } + + @Override + protected void done() { + progressBar.setVisible(false); + JSONArray syncFailedPlugins = null; + try { + syncFailedPlugins = get(); + } catch (Exception ex) { + FineLoggerFactory.getLogger().error(ex.getMessage(), ex); + } + if (syncFailedPlugins != null && syncFailedPlugins.size() > 0) { + SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); + syncFailedPluginsDialog.setVisible(true); + } else { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Basic_Sync_Success"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + FineJOptionPane.INFORMATION_MESSAGE); + } + close(); + } + }.execute(); + } } }; + private boolean deletePreviousPropertyFile() { + File moveFile = new File(RestartHelper.MOVE_FILE); + File delFile = new File(RestartHelper.RECORD_FILE); + if (StableUtils.mkdirs(moveFile) && StableUtils.mkdirs(delFile)) { + return StableUtils.deleteFile(moveFile) && StableUtils.deleteFile(delFile); + } + return false; + } + + private void close() { + this.dispose(); + } + + private void deleteForDesignerUpdate(String installLib) { + File dir = new File(installLib); + CommonUtils.deleteFile(dir); + } } diff --git a/designer-base/src/main/java/com/fr/env/ErrorDialog.java b/designer-base/src/main/java/com/fr/env/ErrorDialog.java new file mode 100644 index 000000000..be91955f2 --- /dev/null +++ b/designer-base/src/main/java/com/fr/env/ErrorDialog.java @@ -0,0 +1,73 @@ +package com.fr.env; + +import com.fr.design.dialog.link.MessageWithLink; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.CloudCenter; +import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Locale; +import javax.swing.BorderFactory; +import javax.swing.JDialog; +import javax.swing.JPanel; + +/** + * 主jar下载失败的弹出框 + * + * */ + +public class ErrorDialog extends JDialog implements ActionListener { + public ErrorDialog(Frame parent, String message) { + super(parent, true); + init(message); + } + + private void init(String message){ + //主体内容 + JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + + //带超链的提示信息 + JPanel messagePanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + messagePanel.setBorder(BorderFactory.createEmptyBorder(5,0,0,0)); + + MessageWithLink messageWithLink = new MessageWithLink(message + ",", Toolkit.i18nText("Fine-Design_Basic_Sync_Help"), CloudCenter.getInstance().acquireUrlByKind("help.replacejars", "https://help.fanruan.com/finereport/doc-view-3268.html")); + messageWithLink.setPreferredSize(new Dimension(108, 20)); + JPanel messageLinkPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + messageLinkPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 5, 0)); + messageLinkPane.add(messageWithLink); + + //错误提示图标 + UILabel imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/icon/versioncheck/bigfail.png")); + messagePanel.add(imageLabel); + messagePanel.add(messageLinkPane); + + //确定按钮 + UIButton ok = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Button_OK")); + ok.addActionListener(this); + ok.setSize(new Dimension(44, 20)); + JPanel okPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); + okPanel.add(ok); + + centerPanel.add(messagePanel, BorderLayout.CENTER); + centerPanel.add(okPanel, BorderLayout.SOUTH); + + this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")); + this.setResizable(false); + this.add(centerPanel, BorderLayout.CENTER); + this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 282 : 262, 118)); + GUICoreUtils.centerWindow(this); + } + + @Override + public void actionPerformed(ActionEvent e) { + this.dispose(); + } +} diff --git a/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java new file mode 100644 index 000000000..a93ea0460 --- /dev/null +++ b/designer-base/src/main/java/com/fr/env/SyncFailedPluginsDialog.java @@ -0,0 +1,152 @@ +package com.fr.env; + +import com.fr.design.RestartHelper; +import com.fr.design.dialog.link.MessageWithLink; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextarea.UITextArea; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.CloudCenter; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; +import com.fr.general.IOUtils; +import com.fr.json.JSONArray; +import com.fr.json.JSONObject; +import com.fr.stable.StringUtils; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.Locale; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JDialog; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.UIManager; + +/** + * @author pengda + * @version 10.0 + * Created on 2021-06-02 + */ +public class SyncFailedPluginsDialog extends JDialog { + private UILabel detailsLabel; + private JScrollPane scrollPane; + private UITextArea detailsTextArea; + private JFrame frame = DesignerContext.getDesignerFrame(); + private RestartHelper restartHelper = new RestartHelper(); + private UIButton restartButton; + private boolean show = false; + public SyncFailedPluginsDialog(JFrame parent, JSONArray syncFailedPlugins) { + super(parent, true); + JPanel body = FRGUIPaneFactory.createBorderLayout_L_Pane(); + + JPanel northPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + northPane.setBorder(BorderFactory.createEmptyBorder(0,0,5,0)); + JPanel imagePanel = new JPanel(); + Icon icon = IOUtils.readIcon("com/fr/design/icon/versioncheck/warning.png"); + JLabel imageLabel = new JLabel(); + imageLabel.setIcon(icon); + imagePanel.add(imageLabel); + imagePanel.setPreferredSize(new Dimension(20, 20)); + + JPanel messagePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + MessageWithLink messageWithLink = new MessageWithLink(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugin_Fail_Suggestion"),Toolkit.i18nText("Fine-Design_Basic_Sync_Deal_Immediately"), + CloudCenter.getInstance().acquireUrlByKind("help.installplugins", "https://help.fanruan.com/finereport/doc-view-2198.html")); + messageWithLink.setPreferredSize(new Dimension(316, 20)); + + messagePane.add(messageWithLink); + messagePane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0)); + + northPane.add(imageLabel, BorderLayout.WEST); + northPane.add(messagePane, BorderLayout.CENTER); + + JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + detailsLabel = new UILabel(Toolkit.i18nText("Fine_Designer_Look_Detail")); + detailsLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); + detailsLabel.addMouseListener(detailsLabelClickListener); + JPanel detailsTitlePanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + detailsTitlePanel.add(detailsLabel); + detailsTitlePanel.setBorder(BorderFactory.createEmptyBorder(0,0,5,0)); + + detailsTextArea = new UITextArea(); + detailsTextArea.setEditable(false); + showSyncFailedPluginsInfo(syncFailedPlugins); + scrollPane = new JScrollPane(detailsTextArea); + centerPanel.add(detailsTitlePanel,BorderLayout.NORTH); + centerPanel.add(scrollPane,BorderLayout.CENTER); + + JPanel southPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); + restartButton = new UIButton(Toolkit.i18nText("Fine-Design_Updater_Restart_Designer")); + restartButton.addMouseListener(restartButtonClickListener); + southPane.add(restartButton); + + body.add(northPane,BorderLayout.NORTH); + body.add(centerPanel,BorderLayout.CENTER); + body.add(southPane,BorderLayout.SOUTH); + + this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")); + this.setResizable(false); + this.add(body, BorderLayout.CENTER); + this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 400 : 380, 225)); + GUICoreUtils.centerWindow(this); + } + + public void showSyncFailedPluginsInfo(JSONArray syncFailedPlugins){ + if(null == syncFailedPlugins){ + return; + } + StringBuilder detailsText = new StringBuilder(StringUtils.EMPTY); + for (int i = 0; i < syncFailedPlugins.size(); i++) { + JSONObject plugin = syncFailedPlugins.getJSONObject(i); + detailsText.append(plugin.getString("name")).append(",").append(Toolkit.i18nText("Fine-Design_Basic_Sync_Server_Version")).append(plugin.getString("version")).append("\n"); + } + detailsTextArea.setText(detailsText.toString()); + if(!ComparatorUtils.equals(detailsTextArea.getText(),StringUtils.EMPTY)){ + show = true; + } + } + + public void showDialog(){ + if(show){ + this.setVisible(true); + } + } + + private MouseListener detailsLabelClickListener = new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if(scrollPane.isVisible()){ + scrollPane.setVisible(false); + detailsLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right")); + }else{ + scrollPane.setVisible(true); + detailsLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); + } + } + }; + + public boolean restartClicked(){ + return !restartButton.isEnabled(); + } + + private void hideDialog(){ + this.dispose(); + } + + private MouseListener restartButtonClickListener = new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + hideDialog(); + restartButton.setEnabled(false); + restartHelper.restartForUpdate(frame); + } + }; +} diff --git a/designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java b/designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java new file mode 100644 index 000000000..5fd4c9ec0 --- /dev/null +++ b/designer-base/src/main/java/com/fr/env/VersionCheckMessageDialog.java @@ -0,0 +1,105 @@ +package com.fr.env; + +import com.fr.design.versioncheck.VersionCheckUtils; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; +import com.fr.general.GeneralUtils; +import com.fr.general.IOUtils; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import javax.swing.BorderFactory; +import javax.swing.JDialog; +import javax.swing.JPanel; + +/** + * @author pengda + * @version 10.0 + * Created on 2021-06-02 + */ +public class VersionCheckMessageDialog extends JDialog implements ActionListener { + private UILabel imageLabel; + private UILabel detailLabel; + private JPanel centerPanel; + private JPanel detailPanel; + private JPanel body; + private String envName; + + public VersionCheckMessageDialog(Frame parent, String message, String envName) { + super(parent, true); + this.envName = envName; + init(message); + } + + private void init(String message) { + JPanel imagePanel = new JPanel(); + imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/warnings/warning32.png")); + imagePanel.add(imageLabel); + JPanel messagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); + UILabel messageText = new UILabel(); + messageText.setText("" + message + ""); + messagePanel.add(messageText); + + centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + centerPanel.setBorder(BorderFactory.createEmptyBorder(15, 10, 10, 10)); + centerPanel.add(imagePanel, BorderLayout.WEST); + centerPanel.add(messagePanel, BorderLayout.CENTER); + + detailLabel = new UILabel(); + detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); + detailLabel.setForeground(Color.BLUE); + + detailPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + detailPanel.add(detailLabel, BorderLayout.EAST); + + String localBranch = GeneralUtils.readFullBuildNO(); + String remoteBranch = VersionCheckUtils.getRemoteBranch(envName); + List noExistServiceDescription; + if(ComparatorUtils.equals(localBranch,remoteBranch)) { + noExistServiceDescription = new ArrayList<>(); + }else{ + noExistServiceDescription = VersionCheckUtils.getNoExistServiceDescription(this.envName); + } + + detailPanel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + hideDialog(); + CheckServiceDialog checkServiceDialog = new CheckServiceDialog(DesignerContext.getDesignerFrame(), localBranch, remoteBranch, noExistServiceDescription); + checkServiceDialog.setVisible(true); + } + }); + + body = FRGUIPaneFactory.createBorderLayout_S_Pane(); + body.add(centerPanel, BorderLayout.CENTER); + body.add(detailPanel, BorderLayout.SOUTH); + + this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Sync_Prompt")); + this.setResizable(false); + this.add(body, BorderLayout.NORTH); + this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 300 : 280, 135)); + GUICoreUtils.centerWindow(this); + } + + private void hideDialog(){ + this.dispose(); + } + + @Override + public void actionPerformed(ActionEvent e) { + hideDialog(); + } +} diff --git a/designer-base/src/main/resources/com/fr/design/icon/versioncheck/arrowright.png b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/arrowright.png new file mode 100644 index 000000000..faa3f898d Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/arrowright.png differ diff --git a/designer-base/src/main/resources/com/fr/design/icon/versioncheck/bigfail.png b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/bigfail.png new file mode 100644 index 000000000..0f09b2cba Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/bigfail.png differ diff --git a/designer-base/src/main/resources/com/fr/design/icon/versioncheck/fail.png b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/fail.png new file mode 100644 index 000000000..611cab720 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/fail.png differ diff --git a/designer-base/src/main/resources/com/fr/design/icon/versioncheck/question.png b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/question.png new file mode 100644 index 000000000..cf46cd468 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/question.png differ diff --git a/designer-base/src/main/resources/com/fr/design/icon/versioncheck/success.png b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/success.png new file mode 100644 index 000000000..f88e68ece Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/success.png differ diff --git a/designer-base/src/main/resources/com/fr/design/icon/versioncheck/warning.png b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/warning.png new file mode 100644 index 000000000..4d2a189b6 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/icon/versioncheck/warning.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/dashboard/guide.png b/designer-base/src/main/resources/com/fr/design/images/dashboard/guide.png index fbd5593bb..c45c9262c 100644 Binary files a/designer-base/src/main/resources/com/fr/design/images/dashboard/guide.png and b/designer-base/src/main/resources/com/fr/design/images/dashboard/guide.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/form/designer/widget_apply_icon.png b/designer-base/src/main/resources/com/fr/design/images/form/designer/widget_apply_icon.png new file mode 100644 index 000000000..3817f4c47 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/form/designer/widget_apply_icon.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/lookandfeel/TipIcon.png b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/TipIcon.png new file mode 100644 index 000000000..5c9492502 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/TipIcon.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/lookandfeel/circularErrorIcon.png b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/circularErrorIcon.png new file mode 100644 index 000000000..bcd2b0611 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/circularErrorIcon.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/lookandfeel/circularWarningIcon.png b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/circularWarningIcon.png new file mode 100644 index 000000000..69fc1527d Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/circularWarningIcon.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/lookandfeel/deleteIcon.png b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/deleteIcon.png new file mode 100644 index 000000000..71c71fc82 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/deleteIcon.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/lookandfeel/newMessageIcon.png b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/newMessageIcon.png new file mode 100644 index 000000000..5ee181668 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/lookandfeel/newMessageIcon.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/m_file/preview_sql.png b/designer-base/src/main/resources/com/fr/design/images/m_file/preview_sql.png new file mode 100644 index 000000000..ba62d487a Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/m_file/preview_sql.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/toast/reuse_icon.png b/designer-base/src/main/resources/com/fr/design/images/toast/reuse_icon.png new file mode 100644 index 000000000..90f59aa1d Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/toast/reuse_icon.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/toast/toast_prompt.png b/designer-base/src/main/resources/com/fr/design/images/toast/toast_prompt.png new file mode 100644 index 000000000..5662a88a4 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/toast/toast_prompt.png differ diff --git a/designer-base/src/main/resources/com/fr/design/images/toast/toast_warning.png b/designer-base/src/main/resources/com/fr/design/images/toast/toast_warning.png new file mode 100644 index 000000000..6499c48e0 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/images/toast/toast_warning.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/designer_login.properties b/designer-base/src/main/resources/com/fr/design/login/designer_login.properties new file mode 100644 index 000000000..853adb77d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/designer_login.properties @@ -0,0 +1,2 @@ +VERSION=1.0 +ENV_VERSION=10.0 diff --git a/designer-base/src/main/resources/com/fr/design/login/guide.css b/designer-base/src/main/resources/com/fr/design/login/guide.css new file mode 100644 index 000000000..12af5f6c3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/guide.css @@ -0,0 +1,57 @@ +.background-login-close { + color: white !important; + font-weight: bold; + font-size: 14px; +} +.background-guide-close { + background: url(./img/icon_install_normal.png) no-repeat center center; + background-size: cover; + width: 20px; + height: 20px; + cursor: pointer; +} +.background-guide-close:hover { + background-color: #E8E8E9; +} +.background-login-loading { + background: url(./img/login_loading.gif) no-repeat center center; +} +.background-plugin-need-update { + background: url(./img/icon_new.png) no-repeat center center; +} +.background-plugin-cant-use { + background: url(./img/icon_cantuse.png) no-repeat center center; +} +.background-plugin-is-disable { + background: url(./img/icon_disable.png) no-repeat center center; +} +.background-plugin-is-disable-new { + background: url(./img/icon_disable-new.png) no-repeat center center; +} +.background-plugin-selected { + background: url(./img/icon_marked.png) no-repeat center center; +} +.background-shop-title-close { + background: url(./img/icon_close40x40_normal.svg) no-repeat center center; +} +.background-dialog-confirm { + background: url(./img/warning.png) no-repeat center center; + background-size: contain; +} +.background-close-button { + background: url(./img/icon_close9x9_normal.png) no-repeat center center; +} +.background-close-button:hover { + background: url(./img/icon_close9x9_hover.png) no-repeat center center; +} +.designer-login-guide { + background: url(./img/login_guide.png) no-repeat center center; + background-size: cover; +} +.designer-guide-login-button { + font-size: 14px; + color: white; + border-radius: 4px; + background-color: #3685F2; +} + diff --git a/designer-base/src/main/resources/com/fr/design/login/guide.html b/designer-base/src/main/resources/com/fr/design/login/guide.html new file mode 100644 index 000000000..aada842a1 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/guide.html @@ -0,0 +1,26 @@ + + + + + + title + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/guide.js b/designer-base/src/main/resources/com/fr/design/login/guide.js new file mode 100644 index 000000000..697878e1d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/guide.js @@ -0,0 +1 @@ +!function(e){var t={};function i(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(o,n,function(t){return e[t]}.bind(null,n));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(e,t,i){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,i,o){o===undefined&&(o=i),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,o){o===undefined&&(o=i),e[o]=t[i]}),n=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||t.hasOwnProperty(i)||o(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),n(i(2),t)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),n=i(3);BI.addI18n(Store.i18n),BI.createWidget({type:o.Vertical,element:"body",items:[{type:n["default"]}]})},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListView=t.VirtualGroup=t.LeftRightVerticalAdapt=t.Left=t.Horizontal=t.Vertical=t.Absolute=t.Layout=t.Htape=t.CenterAdapt=t.Vtape=t.HorizontalAdapt=t.VerticalAdapt=t.BubbleCombo=t.Img=t.Tab=t.SingleSelectInsertCombo=t.SingleSelectRadioItem=t.MultiTreePopupView=t.Editor=t.NicEditor=t.RichEditor=t.MultiTreeCombo=t.DynamicDateTimeCombo=t.DynamicDateCombo=t.BarPopOver=t.MultiSelectItem=t.TextAreaEditor=t.AllValueChooserCombo=t.ButtonGroup=t.MultiSelectInsertCombo=t.TextEditor=t.Button=t.SignEditor=t.MultiFileEditor=t.SmallTextEditor=t.HtmlLabel=t.Label=t.DownListCombo=t.TextButton=t.IconChangeButton=t.IconButton=t.IconTextIconItem=t.IconTextItem=void 0,t.IconTextItem="bi.icon_text_item",t.IconTextIconItem="bi.icon_text_icon_item",t.IconButton="bi.icon_button",t.IconChangeButton="bi.icon_change_button",t.TextButton="bi.text_button",t.DownListCombo="bi.down_list_combo",t.Label="bi.label",t.HtmlLabel="bi.html_label",t.SmallTextEditor="bi.small_text_editor",t.MultiFileEditor="bi.multifile_editor",t.SignEditor="bi.sign_editor",t.Button="bi.button",t.TextEditor="bi.text_editor",t.MultiSelectInsertCombo="bi.multi_select_insert_combo",t.ButtonGroup="bi.button_group",t.AllValueChooserCombo="bi.all_value_chooser_combo",t.TextAreaEditor="bi.textarea_editor",t.MultiSelectItem="bi.multi_select_item",t.BarPopOver="bi.bar_popover",t.DynamicDateCombo="bi.dynamic_date_combo",t.DynamicDateTimeCombo="bi.dynamic_date_time_combo",t.MultiTreeCombo="bi.multi_tree_combo",t.RichEditor="bi.rich_editor",t.NicEditor="bi.nic_editor",t.Editor="bi.editor",t.MultiTreePopupView="bi.multi_tree_popup_view",t.SingleSelectRadioItem="bi.single_select_radio_item",t.SingleSelectInsertCombo="bi.single_select_insert_combo",t.Tab="bi.tab",t.Img="bi.img",t.BubbleCombo="bi.bubble_combo",t.VerticalAdapt="bi.vertical_adapt",t.HorizontalAdapt="bi.horizontal_adapt",t.Vtape="bi.vtape",t.CenterAdapt="bi.center_adapt",t.Htape="bi.htape",t.Layout="bi.layout",t.Absolute="bi.absolute",t.Vertical="bi.vertical",t.Horizontal="bi.horizontal",t.Left="bi.left",t.LeftRightVerticalAdapt="bi.left_right_vertical_adapt",t.VirtualGroup="bi.virtual_group",t.ListView="bi.list_view"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0);i(4);var n=i(5),r=i(6);t.className="designer.login.guide",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-guide",width:700,height:557},_store:function(){return BI.Models.getModel(r["default"])},render:function(){var e=this;return{type:o.Vertical,items:[{el:{type:o.HorizontalAdapt,items:[{type:o.IconButton,cls:"background-guide-close",rgap:19,tgap:17,handler:function(){n["default"].closeWindow(e.model.doNotRemind,!1)}}]}},{el:{type:o.Vertical,items:[{type:o.Horizontal,items:[{type:o.MultiSelectItem,lgap:33,width:240,text:BI.i18nText("Designer-Guide_Do_Not_Remind"),handler:function(){e.store.setDoNotRemind(this.isSelected())}},{type:o.TextButton,width:122,height:38,cls:"designer-guide-login-button",text:BI.i18nText("Designer-Guide_Login"),handler:function(){n["default"].closeWindow(e.model.doNotRemind,!0)}}]}]},tgap:460}]}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=window.DesignerGuideHelper,n=function(){function e(){}return e.prototype.closeWindow=function(e,t){o&&o.closeWindow(e,t)},e}();t["default"]=new n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});BI.model("designer.login.guide.model",BI.inherit(Fix.Model,{state:function(){return{doNotRemind:!1}},setDoNotRemind:function(e){this.model.doNotRemind=e}})),t["default"]="designer.login.guide.model"}]); \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_cantuse.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_cantuse.png new file mode 100644 index 000000000..278f2c09b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_cantuse.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_close40x40_normal.svg b/designer-base/src/main/resources/com/fr/design/login/img/icon_close40x40_normal.svg new file mode 100644 index 000000000..cc6e8d233 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/img/icon_close40x40_normal.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_hover.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_hover.png new file mode 100644 index 000000000..91a39fe96 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_hover.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_normal.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_normal.png new file mode 100644 index 000000000..198afc837 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_close9x9_normal.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_disable-new.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_disable-new.png new file mode 100644 index 000000000..f645f8a7d Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_disable-new.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_disable.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_disable.png new file mode 100644 index 000000000..2d34fd865 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_disable.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_install_normal.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_install_normal.png new file mode 100644 index 000000000..a729d7173 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_install_normal.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_marked.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_marked.png new file mode 100644 index 000000000..7f16d5e39 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_marked.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/icon_new.png b/designer-base/src/main/resources/com/fr/design/login/img/icon_new.png new file mode 100644 index 000000000..eb240987b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/icon_new.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/login_guide.png b/designer-base/src/main/resources/com/fr/design/login/img/login_guide.png new file mode 100644 index 000000000..cdc7e085f Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/login_guide.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/login_loading.gif b/designer-base/src/main/resources/com/fr/design/login/img/login_loading.gif new file mode 100644 index 000000000..5bb90fd6a Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/login_loading.gif differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/product-01.png b/designer-base/src/main/resources/com/fr/design/login/img/product-01.png new file mode 100644 index 000000000..8a6a096d9 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/product-01.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/img/warning.png b/designer-base/src/main/resources/com/fr/design/login/img/warning.png new file mode 100644 index 000000000..9e14cb51b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/img/warning.png differ diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/bluebird.js b/designer-base/src/main/resources/com/fr/design/login/lib/bluebird.js new file mode 100644 index 000000000..0b823f7ce --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/bluebird.js @@ -0,0 +1,5619 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2017 Petka Antonov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +/** + * bluebird build version 3.5.0 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],4:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":22}],5:[function(_dereq_,module,exports){ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!true) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var args = [].slice.call(arguments, 1);; + if (!true) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; + +},{"./util":36}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise._isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent._isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + promise._setWillBeCancelled(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this._isCancellable()) return; + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype._isCancellable = function() { + return this.isPending() && !this._isCancelled(); +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this._isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":36}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var nodeFramePattern = /\((?:timers\.js):\d+:\d+\)/; +var parseLinePattern = /[\/<\(](.+?):(\d+):(\d+)\)?\s*$/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); + +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); + +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +var wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 && + (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN")); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 524288); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 524288) !== 0) return; + this._setRejectionIsUnhandled(); + async.invokeLater(this._notifyUnhandledRejection, this, undefined); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._setReturnedNonUndefined = function() { + this._bitField = this._bitField | 268435456; +}; + +Promise.prototype._returnedNonUndefined = function() { + return (this._bitField & 268435456) !== 0; +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? + fn : util.domainBind(domain, fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +var fireDomEvent = (function() { + try { + if (typeof CustomEvent === "function") { + var event = new CustomEvent("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new CustomEvent(name.toLowerCase(), { + detail: event, + cancelable: true + }); + return !util.global.dispatchEvent(domEvent); + }; + } else if (typeof Event === "function") { + var event = new Event("CustomEvent"); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = new Event(name.toLowerCase(), { + cancelable: true + }); + domEvent.detail = event; + return !util.global.dispatchEvent(domEvent); + }; + } else { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + util.global.dispatchEvent(event); + return function(name, event) { + var domEvent = document.createEvent("CustomEvent"); + domEvent.initCustomEvent(name.toLowerCase(), false, true, + event); + return !util.global.dispatchEvent(domEvent); + }; + } + } catch (e) {} + return function() { + return false; + }; +})(); + +var fireGlobalEvent = (function() { + if (util.isNode) { + return function() { + return process.emit.apply(process, arguments); + }; + } else { + if (!util.global) { + return function() { + return false; + }; + } + return function(name) { + var methodName = "on" + name.toLowerCase(); + var method = util.global[methodName]; + if (!method) return false; + method.apply(util.global, [].slice.call(arguments, 1)); + return true; + }; + } +})(); + +function generatePromiseLifecycleEventObject(name, promise) { + return {promise: promise}; +} + +var eventToObjectGenerator = { + promiseCreated: generatePromiseLifecycleEventObject, + promiseFulfilled: generatePromiseLifecycleEventObject, + promiseRejected: generatePromiseLifecycleEventObject, + promiseResolved: generatePromiseLifecycleEventObject, + promiseCancelled: generatePromiseLifecycleEventObject, + promiseChained: function(name, promise, child) { + return {promise: promise, child: child}; + }, + warning: function(name, warning) { + return {warning: warning}; + }, + unhandledRejection: function (name, reason, promise) { + return {reason: reason, promise: promise}; + }, + rejectionHandled: generatePromiseLifecycleEventObject +}; + +var activeFireEvent = function (name) { + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent.apply(null, arguments); + } catch (e) { + async.throwLater(e); + globalEventFired = true; + } + + var domEventFired = false; + try { + domEventFired = fireDomEvent(name, + eventToObjectGenerator[name].apply(null, arguments)); + } catch (e) { + async.throwLater(e); + domEventFired = true; + } + + return domEventFired || globalEventFired; +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + var warningsOption = opts.warnings; + config.warnings = !!warningsOption; + wForgottenReturn = config.warnings; + + if (util.isObject(warningsOption)) { + if ("wForgottenReturn" in warningsOption) { + wForgottenReturn = !!warningsOption.wForgottenReturn; + } + } + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } + if ("monitoring" in opts) { + if (opts.monitoring && !config.monitoring) { + config.monitoring = true; + Promise.prototype._fireEvent = activeFireEvent; + } else if (!opts.monitoring && config.monitoring) { + config.monitoring = false; + Promise.prototype._fireEvent = defaultFireEvent; + } + } + return Promise; +}; + +function defaultFireEvent() { return false; } + +Promise.prototype._fireEvent = defaultFireEvent; +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this._isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise, + parent) { + if (returnValue === undefined && promiseCreated !== null && + wForgottenReturn) { + if (parent !== undefined && parent._returnedNonUndefined()) return; + if ((promise._bitField & 65535) === 0) return; + + if (name) name = name + " "; + var handlerLine = ""; + var creatorLine = ""; + if (promiseCreated._trace) { + var traceLines = promiseCreated._trace.stack.split("\n"); + var stack = cleanStack(traceLines); + for (var i = stack.length - 1; i >= 0; --i) { + var line = stack[i]; + if (!nodeFramePattern.test(line)) { + var lineMatches = line.match(parseLinePattern); + if (lineMatches) { + handlerLine = "at " + lineMatches[1] + + ":" + lineMatches[2] + ":" + lineMatches[3] + " "; + } + break; + } + } + + if (stack.length > 0) { + var firstUserLine = stack[0]; + for (var i = 0; i < traceLines.length; ++i) { + + if (traceLines[i] === firstUserLine) { + if (i > 0) { + creatorLine = "\n" + traceLines[i - 1]; + } + break; + } + } + + } + } + var msg = "a promise was created in a " + name + + "handler " + handlerLine + "but was not returned from it, " + + "see http://goo.gl/rRqMUw" + + creatorLine; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + + if (!activeFireEvent("warning", warning)) { + formatAndLogError(warning, "", true); + } +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0 && error.name != "SyntaxError") { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: error.name == "SyntaxError" ? stack : cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + if (name === "unhandledRejection") { + if (!activeFireEvent(name, reason, promise) && !localEventFired) { + formatAndLogError(reason, "Unhandled rejection "); + } + } else { + activeFireEvent(name, promise); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false, + monitoring: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + monitoring: function() { + return config.monitoring; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace, + fireDomEvent: fireDomEvent, + fireGlobalEvent: fireGlobalEvent +}; +}; + +},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return PromiseReduce(this, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, 0) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; + + +},{}],12:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + es5.defineProperty(Error, "__BluebirdErrorTypes__", { + value: errorTypes, + writable: false, + enumerable: false, + configurable: false + }); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],14:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; + +},{}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise, NEXT_FILTER) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); + +function PassThroughHandlerContext(promise, type, handler) { + this.promise = promise; + this.type = type; + this.handler = handler; + this.called = false; + this.cancelPromise = null; +} + +PassThroughHandlerContext.prototype.isFinallyHandler = function() { + return this.type === 0; +}; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.isFinallyHandler() + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret === NEXT_FILTER) { + return ret; + } else if (ret !== undefined) { + promise._setReturnedNonUndefined(); + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise._isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, + fail, + undefined, + new PassThroughHandlerContext(this, type, handler), + undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +Promise.prototype.tapCatch = function (handlerOrPredicate) { + var len = arguments.length; + if(len === 1) { + return this._passThrough(handlerOrPredicate, + 1, + undefined, + finallyHandler); + } else { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return Promise.reject(new TypeError( + "tapCatch statement predicate: " + + "expecting an object but got " + util.classString(item) + )); + } + } + catchInstances.length = j; + var handler = arguments[i]; + return this._passThrough(catchFilter(catchInstances, handler, this), + 1, + undefined, + finallyHandler); + } + +}; + +return PassThroughHandlerContext; +}; + +},{"./catch_filter":7,"./util":36}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = _dereq_("./errors"); +var TypeError = errors.TypeError; +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + if (debug.cancellation()) { + var internal = new Promise(INTERNAL); + var _finallyPromise = this._finallyPromise = new Promise(INTERNAL); + this._promise = internal.lastly(function() { + return _finallyPromise; + }); + internal._captureStackTrace(); + internal._setOnCancel(this); + } else { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + } + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; + this._cancellationPhase = false; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this._promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; + if (debug.cancellation() && this._finallyPromise !== null) { + this._finallyPromise._fulfill(); + this._finallyPromise = null; + } +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + this._cancellationPhase = true; + this._yieldedPromise = null; + this._continue(result); +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._rejectCallback(result.e, false); + } + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + if (this._cancellationPhase) { + return promise.cancel(); + } else { + return promise._resolveCallback(value); + } + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", String(value)) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + Promise._async.invoke( + this._promiseFulfilled, this, maybePromise._value() + ); + } else if (((bitField & 16777216) !== 0)) { + Promise._async.invoke( + this._promiseRejected, this, maybePromise._reason() + ); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; + +},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, + getDomain) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise, async) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.asyncNeeded = true; \n\ + this.now = 0; \n\ + } \n\ + \n\ + [TheName].prototype._callFunction = function(promise) { \n\ + promise._pushContext(); \n\ + var ret = tryCatch(this.fn)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + if (this.asyncNeeded) { \n\ + async.invoke(this._callFunction, this, promise); \n\ + } else { \n\ + this._callFunction(promise); \n\ + } \n\ + \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise, async); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", "async", code) + (tryCatch, errorObj, Promise, async); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + holder.asyncNeeded = false; + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + + if (!ret._isFateSealed()) { + if (holder.asyncNeeded) { + var domain = getDomain(); + if (domain !== null) { + holder.fn = util.domainBind(domain, holder.fn); + } + } + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":36}],18:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var domain = getDomain(); + this._callback = domain === null ? fn : util.domainBind(domain, fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = []; + async.invoke(this._asyncInit, this, undefined); +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._asyncInit = function() { + this._init$(undefined, -2); +}; + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + + var limit = 0; + if (options !== undefined) { + if (typeof options === "object" && options !== null) { + if (typeof options.concurrency !== "number") { + return Promise.reject( + new TypeError("'concurrency' must be a number but it is " + + util.classString(options.concurrency))); + } + limit = options.concurrency; + } else { + return Promise.reject(new TypeError( + "options argument must be an object but it is " + + util.classString(options))); + } + } + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; + +},{"./util":36}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":36}],20:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var util = _dereq_("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; + +},{"./util":36}],22:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = _dereq_("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var PassThroughHandlerContext = + _dereq_("./finally")(Promise, tryConvertToPromise, NEXT_FILTER); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (self == null || self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + +} + +function Promise(executor) { + if (executor !== INTERNAL) { + check(this, executor); + } + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + this._resolveFromExecutor(executor); + this._promiseCreated(); + this._fireEvent("promiseCreated", this); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("Catch statement predicate: " + + "expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.getNewLibraryCopy = module.exports; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + return async.setScheduler(fn); +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + this._fireEvent("promiseChained", this, promise); + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && + util.domainBind(domain, handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; + this._fireEvent("promiseFulfilled", this); +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; + this._fireEvent("promiseRejected", this); +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; + this._fireEvent("promiseResolved", this); +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; + this._fireEvent("promiseCancelled", this); +}; + +Promise.prototype._setWillBeCancelled = function() { + this._bitField = this._bitField | 8388608; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + if (async.hasCustomScheduler()) return; + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : util.domainBind(domain, reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : util.domainBind(domain, fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : util.domainBind(domain, reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + + if (promise === this) { + this._reject(makeSelfResolutionError()); + return; + } + + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + if (executor === INTERNAL) return; + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj) { + promise._rejectCallback(x.e, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise, this); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (receiver instanceof PassThroughHandlerContext && + receiver.isFinallyHandler()) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + async.settlePromises(this); + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, async, getDomain); +Promise.Promise = Promise; +Promise.version = "3.5.0"; +_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./call_get.js')(Promise); +_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +_dereq_('./timers.js')(Promise, INTERNAL, debug); +_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +_dereq_('./nodeify.js')(Promise); +_dereq_('./promisify.js')(Promise, INTERNAL); +_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./settle.js')(Promise, PromiseArray, debug); +_dereq_('./some.js')(Promise, PromiseArray, apiRejection); +_dereq_('./filter.js')(Promise, INTERNAL); +_dereq_('./each.js')(Promise, INTERNAL); +_dereq_('./any.js')(Promise); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + case -6: return new Map(); + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise._isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":36}],24:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = _dereq_("./util"); +var nodebackForPromise = _dereq_("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = _dereq_("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!true) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + + +},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); +var isObject = util.isObject; +var es5 = _dereq_("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, isMap ? -6 : -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; + +},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],27:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; + +},{"./util":36}],28:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var domain = getDomain(); + this._fn = domain === null ? fn : util.domainBind(domain, fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + if(_each === INTERNAL) { + this._eachValues = Array(this._length); + } else if (_each === 0) { + this._eachValues = null; + } else { + this._eachValues = undefined; + } + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && + this._eachValues !== null && + accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + if (this._eachValues !== null) { + this._eachValues.push(value); + } + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; + +},{"./util":36}],29:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var NativePromise = util.getNativePromise(); +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if (typeof NativePromise === "function" && + typeof NativePromise.resolve === "function") { + var nativePromise = NativePromise.resolve(); + schedule = function(fn) { + nativePromise.then(fn); + }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + (window.navigator.standalone || window.cordova))) { + schedule = (function() { + var div = document.createElement("div"); + var opts = {attributes: true}; + var toggleScheduled = false; + var div2 = document.createElement("div"); + var o2 = new MutationObserver(function() { + div.classList.toggle("foo"); + toggleScheduled = false; + }); + o2.observe(div2, opts); + + var scheduleToggle = function() { + if (toggleScheduled) return; + toggleScheduled = true; + div2.classList.toggle("foo"); + }; + + return function schedule(fn) { + var o = new MutationObserver(function() { + o.disconnect(); + fn(); + }); + o.observe(div, opts); + scheduleToggle(); + }; + })(); +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":36}],30:[function(_dereq_,module,exports){ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = _dereq_("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; + +},{"./util":36}],31:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = _dereq_("./util"); +var RangeError = _dereq_("./errors").RangeError; +var AggregateError = _dereq_("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; + +},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = function() { + return (this._bitField & 8454144) !== 0; +}; + +Promise.prototype.__isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype._isCancelled = function() { + return this._target().__isCancelled(); +}; + +Promise.prototype.isCancelled = function() { + return (this._target()._bitField & 8454144) !== 0; +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],33:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + try { + return hasProp.call(obj, "_promise0"); + } catch (e) { + return false; + } +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":36}],34:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, debug) { +var util = _dereq_("./util"); +var TimeoutError = Promise.TimeoutError; + +function HandleWrapper(handle) { + this.handle = handle; +} + +HandleWrapper.prototype._resultCancelled = function() { + clearTimeout(this.handle); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + var handle; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + if (debug.cancellation() && value instanceof Promise) { + ret._setOnCancel(value); + } + } else { + ret = new Promise(INTERNAL); + handle = setTimeout(function() { ret._fulfill(); }, +ms); + if (debug.cancellation()) { + ret._setOnCancel(new HandleWrapper(handle)); + } + ret._captureStackTrace(); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +var afterTimeout = function (promise, message, parent) { + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + + if (parent != null) { + parent.cancel(); + } +}; + +function successClear(value) { + clearTimeout(this.handle); + return value; +} + +function failureClear(reason) { + clearTimeout(this.handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var ret, parent; + + var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() { + if (ret.isPending()) { + afterTimeout(ret, message, parent); + } + }, ms)); + + if (debug.cancellation()) { + parent = this.then(); + ret = parent._then(successClear, failureClear, + undefined, handleWrapper, undefined); + ret._setOnCancel(handleWrapper); + } else { + ret = this._then(successClear, failureClear, + undefined, handleWrapper, undefined); + } + + return ret; +}; + +}; + +},{"./util":36}],35:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = _dereq_("./util"); + var TypeError = _dereq_("./errors").TypeError; + var inherits = _dereq_("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + var NULL = {}; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return NULL; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== NULL + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; + +},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +var globalObject = typeof self !== "undefined" ? self : + typeof window !== "undefined" ? window : + typeof global !== "undefined" ? global : + this !== undefined ? this : null; + +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function isError(obj) { + return obj !== null && + typeof obj === "object" && + typeof obj.message === "string" && + typeof obj.name === "string"; +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return isError(obj) && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +var hasEnvVariables = typeof process !== "undefined" && + typeof process.env !== "undefined"; + +function env(key) { + return hasEnvVariables ? process.env[key] : undefined; +} + +function getNativePromise() { + if (typeof Promise === "function") { + try { + var promise = new Promise(function(){}); + if ({}.toString.call(promise) === "[object Promise]") { + return Promise; + } + } catch (e) {} + } +} + +function domainBind(self, cb) { + return self.bind(cb); +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + isError: isError, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + hasEnvVariables: hasEnvVariables, + env: env, + global: globalObject, + getNativePromise: getNativePromise, + domainBind: domainBind +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":13}]},{},[4])(4) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/bundle.css b/designer-base/src/main/resources/com/fr/design/login/lib/bundle.css new file mode 100644 index 000000000..f9d1e0cd2 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/bundle.css @@ -0,0 +1,6540 @@ +/*! normalize.css v1.0.0 | MIT License | git.io/normalize */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +nav, +section, +summary { + display: block; +} +audio, +canvas, +video { + display: inline-block; + *display: inline; + *zoom: 1; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden] { + display: none; +} +html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} +body { + margin: 0; +} +a:focus { + outline: thin dotted; +} +a:active, +a:hover { + outline: 0; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +h2 { + font-size: 1.5em; + margin: 0.83em 0; +} +h3 { + font-size: 1.17em; + margin: 1em 0; +} +h4 { + font-size: 1em; + margin: 1.33em 0; +} +h5 { + font-size: .83em; + margin: 1.67em 0; +} +h6 { + font-size: .75em; + margin: 2.33em 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +blockquote { + margin: 1em 40px; +} +dfn { + font-style: italic; +} +mark { + background: #ff0; + color: #000; +} +p, +pre { + margin: 1em 0; +} +code, +kbd, +pre, +samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} +q { + quotes: none; +} +q:before, +q:after { + content: ''; + content: none; +} +small { + font-size: 75%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +dl, +menu, +ol, +ul { + margin: 1em 0; +} +dd { + margin: 0 0 0 40px; +} +menu, +ol, +ul { + padding: 0 0 0 40px; +} +nav ul, +nav ol { + list-style: none; + list-style-image: none; +} +img { + border: 0; + -ms-interpolation-mode: bicubic; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 0; +} +form { + margin: 0; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; + white-space: normal; + *margin-left: -7px; +} +button, +input, +select, +textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; +} +button, +input { + line-height: normal; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; + *overflow: visible; +} +button[disabled], +input[disabled] { + cursor: default; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; + *height: 13px; + *width: 13px; +} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +textarea { + overflow: auto; + vertical-align: top; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +html, +body, +div, +ul, +ol, +li, +img, +a, +span, +p, +* { + margin: 0; + padding: 0; +} +a { + outline: none; + text-decoration: none; +} +a:focus { + outline: 0; +} +div:focus { + outline: none; +} +input::-webkit-contacts-auto-fill-button { + visibility: hidden; + display: none !important; + pointer-events: none; + position: absolute; + right: 0; +} +input::-ms-clear { + display: none; +} +input, +textarea { + margin: 0; + padding: 0; + outline: none; +} +ul { + list-style: disc; +} +li { + list-style-type: none; +} +i { + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/** 循环旋转动画 **/ +.anim-rotate { + -webkit-animation: rotate 1s infinite linear both; + -moz-animation: rotate 1s infinite linear both; + -ms-animation: rotate 1s infinite linear both; + -o-animation: rotate 1s infinite linear both; + animation: rotate 1s infinite linear both; +} +@-webkit-keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +@-moz-keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +@-ms-keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +@-o-keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +@keyframes rotate { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} +input, +textarea { + border: 1px solid #e8eaed; +} +.bi-theme-dark input, +.bi-theme-dark textarea { + border: 1px solid #363e55; +} +.base-disabled { + cursor: not-allowed !important; + color: #9ea6b2 !important; +} +.base-disabled .bi-input { + color: #9ea6b2 !important; +} +.base-disabled .bi-textarea { + color: #9ea6b2 !important; +} +.base-disabled .b-font:before { + color: #d0d4da !important; +} +.bi-theme-dark .base-disabled { + color: #878d9f !important; +} +.bi-theme-dark .base-disabled .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .base-disabled .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .base-disabled .b-font:before { + color: #606479 !important; +} +.bi-focus-shadow:focus-within, +.bi-focus-shadow:focus, +.bi-focus-shadow:hover { + border-color: #3685f2; +} +.bi-focus-shadow.disabled:hover { + border-color: #e8eaed; +} +.bi-theme-dark .bi-focus-shadow.disabled:hover { + border-color: #363e55; +} +.base-invalid { + cursor: default !important; +} +.clearfix { + *zoom: 1; +} +.clearfix:before, +.clearfix:after { + content: " "; + display: table; + line-height: 0; +} +.clearfix:after { + clear: both; +} +.bi-background { + background-color: #f7f8fa; + color: #3d4d66; +} +.bi-background .bi-input { + color: #3d4d66; +} +.bi-background .bi-textarea { + color: #3d4d66; +} +.bi-theme-dark .bi-background { + background-color: #191b2b; + color: #d6e0dc; +} +.bi-theme-dark .bi-background .bi-input { + color: #d6e0dc; +} +.bi-theme-dark .bi-background .bi-textarea { + color: #d6e0dc; +} +.bi-header-background { + background-color: #f2f4f7; + color: #647185; +} +.bi-header-background .bi-input { + color: #647185; +} +.bi-header-background .bi-textarea { + color: #647185; +} +.bi-theme-dark .bi-header-background { + background-color: #292f45; + color: #afb7c6; +} +.bi-theme-dark .bi-header-background .bi-input { + color: #afb7c6; +} +.bi-theme-dark .bi-header-background .bi-textarea { + color: #afb7c6; +} +.bi-card { + background-color: #ffffff; + color: #3d4d66; +} +.bi-card .bi-input { + color: #3d4d66; +} +.bi-card .bi-textarea { + color: #3d4d66; +} +.bi-theme-dark .bi-card { + background-color: #20263b; + color: #d6e0dc; +} +.bi-theme-dark .bi-card .bi-input { + color: #d6e0dc; +} +.bi-theme-dark .bi-card .bi-textarea { + color: #d6e0dc; +} +.bi-disabled { + color: #9ea6b2; +} +.bi-disabled .bi-input { + color: #9ea6b2; +} +.bi-disabled .bi-textarea { + color: #9ea6b2; +} +.bi-theme-dark .bi-disabled { + color: #878d9f; +} +.bi-theme-dark .bi-disabled .bi-input { + color: #878d9f; +} +.bi-theme-dark .bi-disabled .bi-textarea { + color: #878d9f; +} +.bi-tips { + color: #9ea6b2; +} +.bi-tips .bi-input { + color: #9ea6b2; +} +.bi-tips .bi-textarea { + color: #9ea6b2; +} +.bi-border { + border: 1px solid #e8eaed; +} +.bi-border.disabled { + border-color: #d0d4da !important; +} +.bi-border-top { + border-top: 1px solid #e8eaed; +} +.bi-border-top.disabled { + border-color: #d0d4da !important; +} +.bi-border-right { + border-right: 1px solid #e8eaed; +} +.bi-border-right.disabled { + border-color: #d0d4da !important; +} +.bi-border-bottom { + border-bottom: 1px solid #e8eaed; +} +.bi-border-bottom.disabled { + border-color: #d0d4da !important; +} +.bi-border-left { + border-left: 1px solid #e8eaed; +} +.bi-border-left.disabled { + border-color: #d0d4da !important; +} +.bi-theme-dark .bi-border { + border: 1px solid #363e55; +} +.bi-theme-dark .bi-border.disabled { + border-color: #606479 !important; +} +.bi-theme-dark .bi-border-top { + border-top: 1px solid #363e55; +} +.bi-theme-dark .bi-border-top.disabled { + border-color: #606479 !important; +} +.bi-theme-dark .bi-border-right { + border-right: 1px solid #363e55; +} +.bi-theme-dark .bi-border-right.disabled { + border-color: #606479 !important; +} +.bi-theme-dark .bi-border-bottom { + border-bottom: 1px solid #363e55; +} +.bi-theme-dark .bi-border-bottom.disabled { + border-color: #606479 !important; +} +.bi-theme-dark .bi-border-left { + border-left: 1px solid #363e55; +} +.bi-theme-dark .bi-border-left.disabled { + border-color: #606479 !important; +} +.bi-split { + border: 1px solid #f2f4f7; +} +.bi-split-top { + border-top: 1px solid #f2f4f7; +} +.bi-split-right { + border-right: 1px solid #f2f4f7; +} +.bi-split-bottom { + border-bottom: 1px solid #f2f4f7; +} +.bi-split-left { + border-left: 1px solid #f2f4f7; +} +.bi-theme-dark .bi-split { + border: 1px solid #292f45; +} +.bi-theme-dark .bi-split-top { + border-top: 1px solid #292f45; +} +.bi-theme-dark .bi-split-right { + border-right: 1px solid #292f45; +} +.bi-theme-dark .bi-split-bottom { + border-bottom: 1px solid #292f45; +} +.bi-theme-dark .bi-split-left { + border-left: 1px solid #292f45; +} +.bi-font-helvetica-neue { + font-family: "Helvetica Neue", Arial, Verdana, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Heiti, serif; +} +.bi-font-verdana { + font-family: Verdana, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Heiti, serif; +} +.bi-font-arial { + font-family: Arial, "Helvetica Neue", Verdana, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Heiti, serif; +} +.bi-font-PingFang { + font-family: "PingFang SC", "Helvetica Neue", Verdana, Arial, "Hiragino Sans GB", "Microsoft YaHei", Heiti, serif; +} +.bi-font-hiragino-sans { + font-family: "Hiragino Sans GB", "Helvetica Neue", Verdana, Arial, "PingFang SC", "Microsoft YaHei", Heiti, serif; +} +.bi-font-microsoft-yaHei { + font-family: "Microsoft YaHei", "Helvetica Neue", Verdana, Arial, "PingFang SC", "Hiragino Sans GB", Heiti, serif; +} +.bi-font-heiti { + font-family: Heiti, "Helvetica Neue", Verdana, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif; +} +.bi-border-radius { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-font-bold { + font-weight: 700; +} +.bi-keyword-red-mark { + color: #faaa39; +} +.bi-keyword-red-mark .bi-input { + color: #faaa39; +} +.bi-keyword-red-mark .bi-textarea { + color: #faaa39; +} +.bi-high-light { + color: #3685f2; +} +.bi-high-light .bi-input { + color: #3685f2; +} +.bi-high-light .bi-textarea { + color: #3685f2; +} +.bi-error { + color: #e65251; +} +.bi-error .bi-input { + color: #e65251; +} +.bi-error .bi-textarea { + color: #e65251; +} +.bi-high-light-background { + background-color: #3685f2; + color: #ffffff; +} +.bi-high-light-background .bi-input { + color: #ffffff; +} +.bi-high-light-background .bi-textarea { + color: #ffffff; +} +.bi-error-background { + background-color: #e65251; + color: #ffffff; +} +.bi-error-background .bi-input { + color: #ffffff; +} +.bi-error-background .bi-textarea { + color: #ffffff; +} +.bi-high-light-border { + border: 1px solid #3685f2; +} +.bi-high-light-border.disabled { + border-color: #d0d4da !important; +} +.bi-high-light-border-top { + border-top: 1px solid #3685f2; +} +.bi-high-light-border-top.disabled { + border-color: #d0d4da !important; +} +.bi-high-light-border-right { + border-right: 1px solid #3685f2; +} +.bi-high-light-border-right.disabled { + border-color: #d0d4da !important; +} +.bi-high-light-border-bottom { + border-bottom: 1px solid #3685f2; +} +.bi-high-light-border-bottom.disabled { + border-color: #d0d4da !important; +} +.bi-high-light-border-left { + border-left: 1px solid #3685f2; +} +.bi-high-light-border-left.disabled { + border-color: #d0d4da !important; +} +.bi-water-mark { + color: #9ea6b2; + cursor: text; +} +.bi-water-mark .bi-input { + color: #9ea6b2; +} +.bi-water-mark .bi-textarea { + color: #9ea6b2; +} +.bi-theme-dark .bi-water-mark { + color: #6b7084; +} +.bi-theme-dark .bi-water-mark .bi-input { + color: #6b7084; +} +.bi-theme-dark .bi-water-mark .bi-textarea { + color: #6b7084; +} +.bi-resizer { + background: #232E40; + opacity: 0.2; + filter: alpha(opacity=20); + z-index: 1000000000 !important; +} +.bi-theme-dark .bi-resizer { + background: #ffffff; +} +.bi-mask { + color: #ffffff; + background-color: rgba(35, 46, 64, 0.2); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33232e40,endColorstr=#33232e40); +} +.bi-mask .bi-input { + color: #ffffff; +} +.bi-mask .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-mask { + color: #20263b; + background-color: rgba(255, 255, 255, 0.2); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33ffffff,endColorstr=#33ffffff); +} +.bi-theme-dark .bi-mask .bi-input { + color: #20263b; +} +.bi-theme-dark .bi-mask .bi-textarea { + color: #20263b; +} +.bi-z-index-mask { + background-color: rgba(35, 46, 64, 0.5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#80232e40,endColorstr=#80232e40); +} +.bi-theme-dark .bi-z-index-mask { + background-color: rgba(96, 100, 121, 0.5); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#80606479,endColorstr=#80606479); +} +.bi-list-item:hover, +.bi-list-item.hover { + color: #232e40; + background-color: rgba(54, 133, 242, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d3685f2,endColorstr=#0d3685f2); +} +.bi-list-item:hover .bi-input, +.bi-list-item.hover .bi-input { + color: #232e40; +} +.bi-list-item:hover .bi-textarea, +.bi-list-item.hover .bi-textarea { + color: #232e40; +} +.bi-list-item.disabled, +.bi-list-item.disabled:hover, +.bi-list-item.disabled:active { + background-color: transparent !important; + color: #9ea6b2 !important; +} +.bi-list-item.disabled .bi-input, +.bi-list-item.disabled:hover .bi-input, +.bi-list-item.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item.disabled .bi-textarea, +.bi-list-item.disabled:hover .bi-textarea, +.bi-list-item.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item.disabled .bi-high-light, +.bi-list-item.disabled:hover .bi-high-light, +.bi-list-item.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item:hover, +.bi-theme-dark .bi-list-item.hover { + color: #ffffff; + background-color: rgba(54, 133, 242, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d3685f2,endColorstr=#0d3685f2); +} +.bi-theme-dark .bi-list-item:hover .bi-input, +.bi-theme-dark .bi-list-item.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item:hover .bi-textarea, +.bi-theme-dark .bi-list-item.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item.disabled, +.bi-theme-dark .bi-list-item.disabled:hover, +.bi-theme-dark .bi-list-item.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item.disabled .bi-input, +.bi-theme-dark .bi-list-item.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item.disabled .bi-textarea, +.bi-theme-dark .bi-list-item.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item.disabled .bi-high-light, +.bi-theme-dark .bi-list-item.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-border:active, +.bi-list-item-border.active { + border: 1px solid #3685f2; +} +.bi-list-item-simple:hover, +.bi-list-item-simple.hover { + color: #3685f2; +} +.bi-list-item-simple:hover .bi-input, +.bi-list-item-simple.hover .bi-input { + color: #3685f2; +} +.bi-list-item-simple:hover .bi-textarea, +.bi-list-item-simple.hover .bi-textarea { + color: #3685f2; +} +.bi-list-item-simple.disabled, +.bi-list-item-simple.disabled:hover, +.bi-list-item-simple.disabled:active { + color: #9ea6b2 !important; +} +.bi-list-item-simple.disabled .bi-input, +.bi-list-item-simple.disabled:hover .bi-input, +.bi-list-item-simple.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-simple.disabled .bi-textarea, +.bi-list-item-simple.disabled:hover .bi-textarea, +.bi-list-item-simple.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-simple.disabled .bi-high-light, +.bi-list-item-simple.disabled:hover .bi-high-light, +.bi-list-item-simple.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-list-item-effect:hover { + color: #232e40; +} +.bi-list-item-effect:hover .bi-input { + color: #232e40; +} +.bi-list-item-effect:hover .bi-textarea { + color: #232e40; +} +.bi-list-item-effect.active, +.bi-list-item-effect:active { + color: #3685f2; +} +.bi-list-item-effect.active .bi-input, +.bi-list-item-effect:active .bi-input { + color: #3685f2; +} +.bi-list-item-effect.active .bi-textarea, +.bi-list-item-effect:active .bi-textarea { + color: #3685f2; +} +.bi-list-item-effect.disabled, +.bi-list-item-effect.disabled:hover, +.bi-list-item-effect.disabled:active { + color: #9ea6b2 !important; +} +.bi-list-item-effect.disabled .bi-input, +.bi-list-item-effect.disabled:hover .bi-input, +.bi-list-item-effect.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-effect.disabled .bi-textarea, +.bi-list-item-effect.disabled:hover .bi-textarea, +.bi-list-item-effect.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-effect.disabled .bi-high-light, +.bi-list-item-effect.disabled:hover .bi-high-light, +.bi-list-item-effect.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-effect:hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-effect:hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-effect:hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-effect.active, +.bi-theme-dark .bi-list-item-effect:active { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-effect.active .bi-input, +.bi-theme-dark .bi-list-item-effect:active .bi-input { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-effect.active .bi-textarea, +.bi-theme-dark .bi-list-item-effect:active .bi-textarea { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-effect.disabled, +.bi-theme-dark .bi-list-item-effect.disabled:hover, +.bi-theme-dark .bi-list-item-effect.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-effect.disabled .bi-input, +.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-effect.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-effect.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-effect.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-effect.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-effect.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-effect.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-active:hover, +.bi-list-item-active.hover { + color: #232e40; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-active:hover .bi-input, +.bi-list-item-active.hover .bi-input { + color: #232e40; +} +.bi-list-item-active:hover .bi-textarea, +.bi-list-item-active.hover .bi-textarea { + color: #232e40; +} +.bi-list-item-active:active { + color: #3685f2; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-active:active .bi-input { + color: #3685f2; +} +.bi-list-item-active:active .bi-textarea { + color: #3685f2; +} +.bi-list-item-active.active { + color: #3685f2; +} +.bi-list-item-active.active .bi-input { + color: #3685f2; +} +.bi-list-item-active.active .bi-textarea { + color: #3685f2; +} +.bi-list-item-active.disabled, +.bi-list-item-active.disabled:hover, +.bi-list-item-active.disabled:active { + background-color: transparent !important; + color: #9ea6b2 !important; +} +.bi-list-item-active.disabled .bi-input, +.bi-list-item-active.disabled:hover .bi-input, +.bi-list-item-active.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-active.disabled .bi-textarea, +.bi-list-item-active.disabled:hover .bi-textarea, +.bi-list-item-active.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-active.disabled .bi-high-light, +.bi-list-item-active.disabled:hover .bi-high-light, +.bi-list-item-active.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-active:hover, +.bi-theme-dark .bi-list-item-active.hover { + color: #ffffff; + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark .bi-list-item-active:hover .bi-input, +.bi-theme-dark .bi-list-item-active.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active:hover .bi-textarea, +.bi-theme-dark .bi-list-item-active.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active.active, +.bi-theme-dark .bi-list-item-active:active { + color: #3685f2; + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark .bi-list-item-active.active .bi-input, +.bi-theme-dark .bi-list-item-active:active .bi-input { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-active.active .bi-textarea, +.bi-theme-dark .bi-list-item-active:active .bi-textarea { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-active.disabled, +.bi-theme-dark .bi-list-item-active.disabled:hover, +.bi-theme-dark .bi-list-item-active.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active.disabled .bi-input, +.bi-theme-dark .bi-list-item-active.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-active.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-active.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-active.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-active.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-active.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-active2:hover, +.bi-list-item-active2.hover { + color: #232e40; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-active2:hover .bi-input, +.bi-list-item-active2.hover .bi-input { + color: #232e40; +} +.bi-list-item-active2:hover .bi-textarea, +.bi-list-item-active2.hover .bi-textarea { + color: #232e40; +} +.bi-list-item-active2:active, +.bi-list-item-active2.active { + color: #3685f2; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-active2:active .bi-input, +.bi-list-item-active2.active .bi-input { + color: #3685f2; +} +.bi-list-item-active2:active .bi-textarea, +.bi-list-item-active2.active .bi-textarea { + color: #3685f2; +} +.bi-list-item-active2.disabled, +.bi-list-item-active2.disabled:hover, +.bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #9ea6b2 !important; +} +.bi-list-item-active2.disabled .bi-input, +.bi-list-item-active2.disabled:hover .bi-input, +.bi-list-item-active2.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-active2.disabled .bi-textarea, +.bi-list-item-active2.disabled:hover .bi-textarea, +.bi-list-item-active2.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-active2.disabled .bi-high-light, +.bi-list-item-active2.disabled:hover .bi-high-light, +.bi-list-item-active2.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-active2:hover, +.bi-theme-dark .bi-list-item-active2.hover { + color: #ffffff; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-theme-dark .bi-list-item-active2:hover .bi-input, +.bi-theme-dark .bi-list-item-active2.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active2:hover .bi-textarea, +.bi-theme-dark .bi-list-item-active2.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-active2:active, +.bi-theme-dark .bi-list-item-active2.active { + color: #3685f2; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-theme-dark .bi-list-item-active2:active .bi-input, +.bi-theme-dark .bi-list-item-active2.active .bi-input { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-active2:active .bi-textarea, +.bi-theme-dark .bi-list-item-active2.active .bi-textarea { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-active2.disabled, +.bi-theme-dark .bi-list-item-active2.disabled:hover, +.bi-theme-dark .bi-list-item-active2.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-input, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-active2.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-active2.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-select:hover, +.bi-list-item-select.hover { + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.bi-list-item-select:active, +.bi-list-item-select.active { + color: #ffffff; + background-color: #3685f2; +} +.bi-list-item-select:active .bi-input, +.bi-list-item-select.active .bi-input { + color: #ffffff; +} +.bi-list-item-select:active .bi-textarea, +.bi-list-item-select.active .bi-textarea { + color: #ffffff; +} +.bi-list-item-select:active .bi-high-light, +.bi-list-item-select.active .bi-high-light { + color: #ffffff; +} +.bi-list-item-select.button-success:active, +.bi-list-item-select.button-success.active { + color: #ffffff; + background-color: #13cd66; +} +.bi-list-item-select.button-success:active .bi-input, +.bi-list-item-select.button-success.active .bi-input { + color: #ffffff; +} +.bi-list-item-select.button-success:active .bi-textarea, +.bi-list-item-select.button-success.active .bi-textarea { + color: #ffffff; +} +.bi-list-item-select.button-success:active .bi-high-light, +.bi-list-item-select.button-success.active .bi-high-light { + color: #ffffff; +} +.bi-list-item-select.button-success:active.bi-high-light-border, +.bi-list-item-select.button-success.active.bi-high-light-border { + border-color: #13cd66; +} +.bi-list-item-select.button-warning { + color: #e65251; +} +.bi-list-item-select.button-warning .bi-input { + color: #e65251; +} +.bi-list-item-select.button-warning .bi-textarea { + color: #e65251; +} +.bi-list-item-select.button-warning .bi-high-light { + color: #e65251; +} +.bi-list-item-select.button-warning.bi-high-light-border { + border-color: #e65251; +} +.bi-list-item-select.button-warning:hover, +.bi-list-item-select.button-warning.hover { + color: #e65251; + background-color: #ffecec; +} +.bi-list-item-select.button-warning:hover .bi-input, +.bi-list-item-select.button-warning.hover .bi-input { + color: #e65251; +} +.bi-list-item-select.button-warning:hover .bi-textarea, +.bi-list-item-select.button-warning.hover .bi-textarea { + color: #e65251; +} +.bi-list-item-select.button-warning:hover .bi-high-light, +.bi-list-item-select.button-warning.hover .bi-high-light { + color: #e65251; +} +.bi-list-item-select.button-warning:hover.bi-high-light-border, +.bi-list-item-select.button-warning.hover.bi-high-light-border { + border-color: #e65251; +} +.bi-list-item-select.button-warning:active, +.bi-list-item-select.button-warning.active { + color: #ffffff; + background-color: #e65251; +} +.bi-list-item-select.button-warning:active .bi-input, +.bi-list-item-select.button-warning.active .bi-input { + color: #ffffff; +} +.bi-list-item-select.button-warning:active .bi-textarea, +.bi-list-item-select.button-warning.active .bi-textarea { + color: #ffffff; +} +.bi-list-item-select.button-warning:active .bi-high-light, +.bi-list-item-select.button-warning.active .bi-high-light { + color: #ffffff; +} +.bi-list-item-select.button-warning:active.bi-high-light-border, +.bi-list-item-select.button-warning.active.bi-high-light-border { + border-color: #e65251; +} +.bi-list-item-select.disabled { + color: #9ea6b2 !important; + background-color: transparent !important; +} +.bi-list-item-select.disabled .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-select.disabled .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-select.disabled .bi-high-light { + color: #9ea6b2 !important; +} +.bi-list-item-select.disabled.bi-high-light-border { + border-color: #d0d4da; +} +.bi-list-item-select.disabled.hover, +.bi-list-item-select.disabled.active { + color: #ffffff !important; + background-color: #d0d4da !important; +} +.bi-list-item-select.disabled.hover .bi-input, +.bi-list-item-select.disabled.active .bi-input { + color: #ffffff !important; +} +.bi-list-item-select.disabled.hover .bi-textarea, +.bi-list-item-select.disabled.active .bi-textarea { + color: #ffffff !important; +} +.bi-list-item-select.disabled.hover .bi-high-light, +.bi-list-item-select.disabled.active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-list-item-select.disabled.hover.bi-high-light-border, +.bi-list-item-select.disabled.active.bi-high-light-border { + border-color: #d0d4da; +} +.bi-list-item-select2:hover, +.bi-list-item-select2.hover { + color: #232e40; +} +.bi-list-item-select2:hover .bi-input, +.bi-list-item-select2.hover .bi-input { + color: #232e40; +} +.bi-list-item-select2:hover .bi-textarea, +.bi-list-item-select2.hover .bi-textarea { + color: #232e40; +} +.bi-list-item-select2:hover.bi-border, +.bi-list-item-select2.hover.bi-border { + border-color: #3685f2; +} +.bi-list-item-select2:active { + color: #3685f2; +} +.bi-list-item-select2:active .bi-input { + color: #3685f2; +} +.bi-list-item-select2:active .bi-textarea { + color: #3685f2; +} +.bi-list-item-select2:active.bi-border { + border-color: #3685f2; +} +.bi-list-item-select2.active { + color: #ffffff; + background-color: #3685f2; +} +.bi-list-item-select2.active .bi-input { + color: #ffffff; +} +.bi-list-item-select2.active .bi-textarea { + color: #ffffff; +} +.bi-list-item-select2.active.bi-border { + border-color: #3685f2; +} +.bi-list-item-select2.disabled, +.bi-list-item-select2.disabled:hover, +.bi-list-item-select2.disabled:active { + background-color: transparent !important; + color: #9ea6b2 !important; +} +.bi-list-item-select2.disabled .bi-input, +.bi-list-item-select2.disabled:hover .bi-input, +.bi-list-item-select2.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-select2.disabled .bi-textarea, +.bi-list-item-select2.disabled:hover .bi-textarea, +.bi-list-item-select2.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-select2.disabled .bi-high-light, +.bi-list-item-select2.disabled:hover .bi-high-light, +.bi-list-item-select2.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-select2:hover, +.bi-theme-dark .bi-list-item-select2.hover { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select2:hover .bi-input, +.bi-theme-dark .bi-list-item-select2.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select2:hover .bi-textarea, +.bi-theme-dark .bi-list-item-select2.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select2.active { + background-color: #20263b; +} +.bi-theme-dark .bi-list-item-select2.disabled, +.bi-theme-dark .bi-list-item-select2.disabled:hover, +.bi-theme-dark .bi-list-item-select2.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select2.disabled .bi-input, +.bi-theme-dark .bi-list-item-select2.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-select2.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select2.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-select2.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-select2.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select2.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-select2.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-select2.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-select3:hover, +.bi-list-item-select3.hover { + background-color: #f7f8fa; +} +.bi-list-item-select3:active, +.bi-list-item-select3.active { + color: #3685f2; + background-color: #f7f8fa; +} +.bi-list-item-select3:active .bi-input, +.bi-list-item-select3.active .bi-input { + color: #3685f2; +} +.bi-list-item-select3:active .bi-textarea, +.bi-list-item-select3.active .bi-textarea { + color: #3685f2; +} +.bi-list-item-select3.disabled:hover, +.bi-list-item-select3.disabled.hover, +.bi-list-item-select3.disabled:active, +.bi-list-item-select3.disabled.active { + background-color: #ffffff !important; +} +.bi-theme-dark .bi-list-item-select3:hover, +.bi-theme-dark .bi-list-item-select3.hover { + background-color: #191b2b; +} +.bi-theme-dark .bi-list-item-select3:active, +.bi-theme-dark .bi-list-item-select3.active { + color: #3685f2; + background-color: #191b2b; +} +.bi-theme-dark .bi-list-item-select3:active .bi-input, +.bi-theme-dark .bi-list-item-select3.active .bi-input { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-select3:active .bi-textarea, +.bi-theme-dark .bi-list-item-select3.active .bi-textarea { + color: #3685f2; +} +.bi-theme-dark .bi-list-item-select3.disabled:hover, +.bi-theme-dark .bi-list-item-select3.disabled.hover, +.bi-theme-dark .bi-list-item-select3.disabled:active, +.bi-theme-dark .bi-list-item-select3.disabled.active { + background-color: #20263b !important; +} +.bi-theme-dark .bi-list-item-select:hover, +.bi-theme-dark .bi-list-item-select.hover { + color: #ffffff; + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark .bi-list-item-select:hover .bi-input, +.bi-theme-dark .bi-list-item-select.hover .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select:hover .bi-textarea, +.bi-theme-dark .bi-list-item-select.hover .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select:active, +.bi-theme-dark .bi-list-item-select.active { + color: #ffffff; + background-color: #3685f2; +} +.bi-theme-dark .bi-list-item-select:active .bi-input, +.bi-theme-dark .bi-list-item-select.active .bi-input { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select:active .bi-textarea, +.bi-theme-dark .bi-list-item-select.active .bi-textarea { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select:active .bi-high-light, +.bi-theme-dark .bi-list-item-select.active .bi-high-light { + color: #ffffff; +} +.bi-theme-dark .bi-list-item-select.disabled, +.bi-theme-dark .bi-list-item-select.disabled:hover, +.bi-theme-dark .bi-list-item-select.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select.disabled .bi-input, +.bi-theme-dark .bi-list-item-select.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-select.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-select.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-select.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-select.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-select.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-select.disabled:active .bi-high-light { + color: #878d9f !important; +} +.bi-list-item-none:hover, +.bi-list-item-none.hover { + color: inherit; + background-color: transparent; +} +.bi-list-item-none:hover .bi-input, +.bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-list-item-none:hover .bi-textarea, +.bi-list-item-none.hover .bi-textarea { + color: inherit; +} +.bi-list-item-none:active, +.bi-list-item-none.active { + color: inherit; + background-color: transparent; +} +.bi-list-item-none:active .bi-input, +.bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-list-item-none:active .bi-textarea, +.bi-list-item-none.active .bi-textarea { + color: inherit; +} +.bi-list-item-none:active .bi-high-light, +.bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-list-item-none.disabled, +.bi-list-item-none.disabled:hover, +.bi-list-item-none.disabled:active { + color: #9ea6b2 !important; + background-color: transparent !important; +} +.bi-list-item-none.disabled .bi-input, +.bi-list-item-none.disabled:hover .bi-input, +.bi-list-item-none.disabled:active .bi-input { + color: #9ea6b2 !important; +} +.bi-list-item-none.disabled .bi-textarea, +.bi-list-item-none.disabled:hover .bi-textarea, +.bi-list-item-none.disabled:active .bi-textarea { + color: #9ea6b2 !important; +} +.bi-list-item-none.disabled .bi-high-light, +.bi-list-item-none.disabled:hover .bi-high-light, +.bi-list-item-none.disabled:active .bi-high-light { + color: #9ea6b2 !important; +} +.bi-theme-dark .bi-list-item-none:hover, +.bi-theme-dark .bi-list-item-none.hover { + color: inherit; + background-color: transparent; +} +.bi-theme-dark .bi-list-item-none:hover .bi-input, +.bi-theme-dark .bi-list-item-none.hover .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:hover .bi-textarea, +.bi-theme-dark .bi-list-item-none.hover .bi-textarea { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active, +.bi-theme-dark .bi-list-item-none.active { + color: inherit; + background-color: transparent; +} +.bi-theme-dark .bi-list-item-none:active .bi-input, +.bi-theme-dark .bi-list-item-none.active .bi-input { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-textarea, +.bi-theme-dark .bi-list-item-none.active .bi-textarea { + color: inherit; +} +.bi-theme-dark .bi-list-item-none:active .bi-high-light, +.bi-theme-dark .bi-list-item-none.active .bi-high-light { + color: inherit; +} +.bi-theme-dark .bi-list-item-none.disabled, +.bi-theme-dark .bi-list-item-none.disabled:hover, +.bi-theme-dark .bi-list-item-none.disabled:active { + background-color: transparent !important; + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-input, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-input { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-textarea, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-textarea, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-textarea { + color: #878d9f !important; +} +.bi-theme-dark .bi-list-item-none.disabled .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:hover .bi-high-light, +.bi-theme-dark .bi-list-item-none.disabled:active .bi-high-light { + color: #878d9f !important; +} +/*****************cursor*****************/ +.cursor-pointer { + cursor: pointer; +} +.cursor-default { + cursor: default; +} +.cursor-move { + cursor: move; +} +/*****************cursor*****************/ +.y-overflow-auto { + overflow-y: auto; + overflow-x: hidden; +} +.x-overflow-auto { + overflow-y: hidden; + overflow-x: auto; +} +.y-overflow-scroll { + overflow-y: scroll; + overflow-x: hidden; +} +.x-overflow-scroll { + overflow-y: hidden; + overflow-x: scroll; +} +.overflow-auto { + overflow-x: auto; + overflow-y: auto; +} +.overflow-scroll { + overflow-x: scroll; + overflow-y: scroll; +} +.overflow-hidden { + overflow-x: hidden; + overflow-y: hidden; +} +.td-overflow { + white-space: normal; + word-break: break-all; +} +.overflow-dot { + text-overflow: ellipsis; + overflow-x: hidden; + overflow-y: hidden; + white-space: nowrap; +} +.display-block { + display: block; +} +.display-inline { + display: inline-block; + *display: inline; + *zoom: 1; +} +.display-table { + display: table; +} +/**常用于span元素在与combo并列时**/ +.vertical-super { + vertical-align: super; +} +.vertical-top { + vertical-align: top; +} +.horizon-center { + text-align: center; +} +.horizon-left { + text-align: left; +} +/*类似ie6的盒子模型 可以在有百分比的时候加border 支持到ie8*/ +.border-sizing { + -webkit-box-sizing: border-box; + /*Safari3.2+*/ + -moz-box-sizing: border-box; + /*Firefox3.5+*/ + -ms-box-sizing: border-box; + /*IE8*/ + box-sizing: border-box; + /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ +} +.content-sizing { + -webkit-box-sizing: content-box; + /*Safari3.2+*/ + -moz-box-sizing: content-box; + /*Firefox3.5+*/ + -ms-box-sizing: content-box; + /*IE8*/ + box-sizing: content-box; + /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ +} +.bi-flex-center-adapt-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -o-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-flex-align: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} + +.bi-flex-horizontal-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -ms-flex-align: start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.bi-flex-horizontal-layout.v-middle { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-horizontal-layout.v-bottom { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -ms-flex-align: end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-horizontal-layout.v-stretch { + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-flex-horizontal-layout.h-stretch { + /* 09版 */ + -webkit-box-orient: vertical; + /* 12版 */ + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} + +.bi-flex-vertical-layout { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: vertical; + /* 12版 */ + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + -ms-flex-pack: start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -ms-flex-align: start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; +} +.bi-flex-vertical-layout.h-center { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-vertical-layout.h-right { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -ms-flex-align: end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-vertical-layout.h-stretch { + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-flex-vertical-layout.v-stretch { + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} + +.bi-flex-scrollable-center-adapt-layout .flex-scrollable-center-adapt-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; + min-width: 100%; + min-height: 100%; + float: left; +} + +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -ms-flex-pack: start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: flex-start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -ms-flex-align: start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; + min-height: 100%; +} +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper.v-middle { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper.v-bottom { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper.v-stretch { + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-flex-scrollable-horizontal-layout .flex-scrollable-horizontal-layout-wrapper.h-stretch { + /* 09版 */ + -webkit-box-orient: vertical; + /* 12版 */ + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} + +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper { + display: box; + /* OLD - Android 4.4- */ + display: -webkit-box; + /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; + /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; + /* TWEENER - IE 10 */ + display: -webkit-flex; + /* NEW - Chrome */ + display: flex; + /* NEW, Spec - Opera 12.1, Firefox 20+ */ + /* 09版 */ + -webkit-box-orient: vertical; + /* 12版 */ + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + /* 09版 */ + -webkit-box-pack: flex-start; + /* 12版 */ + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -ms-flex-pack: start; + -o-justify-content: flex-start; + justify-content: flex-start; + /* 09版 */ + -webkit-box-align: flex-start; + /* 12版 */ + -webkit-align-items: flex-start; + -moz-align-items: flex-start; + -ms-align-items: flex-start; + -ms-flex-align: start; + -o-align-items: flex-start; + align-items: flex-start; + /* 09版 */ + /*-webkit-box-lines: multiple;*/ + /* 12版 */ + -webkit-flex-wrap: nowrap; + -moz-flex-wrap: nowrap; + -ms-flex-wrap: nowrap; + -o-flex-wrap: nowrap; + flex-wrap: nowrap; + min-width: 100%; +} +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper.h-center { + /* 09版 */ + -webkit-box-align: center; + /* 12版 */ + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -ms-flex-align: center; + -o-align-items: center; + align-items: center; +} +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper.h-right { + /* 09版 */ + -webkit-box-align: flex-end; + /* 12版 */ + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -ms-flex-align: end; + -o-align-items: flex-end; + align-items: flex-end; +} +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper.h-stretch { + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-flex-scrollable-vertical-layout .flex-scrollable-vertical-layout-wrapper.v-stretch { + /* 09版 */ + -webkit-box-orient: horizontal; + /* 12版 */ + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; + /* 09版 */ + -webkit-box-pack: center; + /* 12版 */ + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -ms-flex-pack: center; + -o-justify-content: center; + justify-content: center; + /* 09版 */ + -webkit-box-align: stretch; + /* 12版 */ + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -ms-flex-align: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.bi-inline-center-adapt-layout:after { + display: inline-block; + width: 0; + min-height: 100%; + vertical-align: middle; + content: ' '; +} +.bi-inline-center-adapt-layout > .inline-center-adapt-item { + display: inline-block; +} +.bi-inline-center-adapt-layout > .inline-center-adapt-item.x-icon { + display: inline-block !important; +} +.bi-inline-center-adapt-layout > .bi-combo.bi-combo-popup { + display: inline-block !important; +} + +.bi-inline-vertical-adapt-layout:after { + display: inline-block; + width: 0; + min-height: 100%; + vertical-align: middle; + content: ' '; +} +.bi-inline-vertical-adapt-layout > .inline-vertical-adapt-item { + display: inline-block; +} +.bi-inline-vertical-adapt-layout > .inline-vertical-adapt-item.x-icon { + display: inline-block !important; +} +.bi-inline-vertical-adapt-layout > .bi-combo.bi-combo-popup { + display: inline-block !important; +} +.bi-theme-dark { + color: #d6e0dc; +} +.bi-theme-dark .bi-input { + color: #ffffff; +} +.bi-year-calendar { + padding-top: 5px; + padding-bottom: 5px; +} +.bi-color-chooser-popup .disable-mask { + opacity: 0.5; + filter: alpha(opacity=50); + background-color: #ffffff; +} + +.bi-color-chooser-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-color-picker-button .color-picker-button-mask { + border: 1px solid #232e40; +} +.bi-theme-dark .bi-color-picker-button .color-picker-button-mask { + border: 1px solid #ffffff; +} +.bi-farbtastic .wheel { + background: url('images/1x/background/wheel.png') no-repeat center center; +} +.bi-farbtastic .overlay { + background: url('images/1x/background/mask.png') no-repeat center center; +} +.bi-farbtastic .marker { + background: url('images/1x/background/marker.png') no-repeat center center; +} +.bi-display-tree .ztree li span.button.switch.center_open { + background: url('images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree li span.button.switch.roots_open { + background: url('images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree li span.button.switch.bottom_open { + background: url('images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree.hack li span.button.switch.center_open { + background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-display-tree .ztree.hack li span.button.switch.roots_open { + background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-display-tree .ztree.hack li span.button.switch.bottom_open { + background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.ztree li ul.line { + position: relative; +} +.ztree li ul.line:before { + position: absolute; + content: ''; + border-left: 1px dashed #D0D4DA; + height: calc(100% - 3px); + left: 12px; + margin-top: 1px; +} +.ztree.hack li ul.line { + background: url('images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0; +} +.bi-theme-dark .ztree li ul.line:before { + border-left: 1px dashed #606479; +} +.bi-theme-dark .ztree.hack li ul.line { + background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0; +} +.ztree li span.button.chk.checkbox_false_full { + background: url('images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_full_focus { + background: url('images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_part { + background: url('images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_part_focus { + background: url('images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_full { + background: url('images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_full_focus { + background: url('images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_part { + background: url('images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_part_focus { + background: url('images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.chk.checkbox_false_full { + background: url('images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_full_focus { + background: url('images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_part { + background: url('images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_part_focus { + background: url('images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_full { + background: url('images/1x/icon/check_box_active.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_full_focus { + background: url('images/1x/icon/check_box_active.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_part { + background: url('images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_part_focus { + background: url('images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree li span.button.root_open { + background: url('images/2x/icon/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.root_open { + background: url('images/1x/icon/tree_expand_1.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.root_open { + background: url('images/2x/icon/dark/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.root_open { + background: url('images/1x/icon/dark/tree_expand_1.png') no-repeat center center; +} +.ztree li span.button.root_close { + background: url('images/2x/icon/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.root_close { + background: url('images/1x/icon/tree_collapse_1.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.root_close { + background: url('images/2x/icon/dark/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.root_close { + background: url('images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; +} +.ztree li span.button.roots_open { + background: url('images/2x/icon/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_open { + background: url('images/1x/icon/tree_expand_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_open { + background: url('images/2x/icon/dark/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_open { + background: url('images/1x/icon/dark/tree_expand_2.png') no-repeat center center; +} +.ztree li span.button.roots_close { + background: url('images/2x/icon/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_close { + background: url('images/1x/icon/tree_collapse_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_close { + background: url('images/2x/icon/dark/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_close { + background: url('images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; +} +.ztree li span.button.center_open { + background: url('images/2x/icon/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_open { + background: url('images/1x/icon/tree_expand_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_open { + background: url('images/2x/icon/dark/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_open { + background: url('images/1x/icon/dark/tree_expand_3.png') no-repeat center center; +} +.ztree li span.button.center_close { + background: url('images/2x/icon/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_close { + background: url('images/1x/icon/tree_collapse_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_close { + background: url('images/2x/icon/dark/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_close { + background: url('images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; +} +.ztree li span.button.bottom_open { + background: url('images/2x/icon/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_open { + background: url('images/1x/icon/tree_expand_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_open { + background: url('images/2x/icon/dark/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_open { + background: url('images/1x/icon/dark/tree_expand_4.png') no-repeat center center; +} +.ztree li span.button.bottom_close { + background: url('images/2x/icon/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_close { + background: url('images/1x/icon/tree_collapse_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_close { + background: url('images/2x/icon/dark/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_close { + background: url('images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; +} +.ztree li span.button.roots_docu { + background: url('images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_docu { + background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_docu { + background: url('images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_docu { + background: url('images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.ztree li span.button.center_docu { + background: url('images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_docu { + background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_docu { + background: url('images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_docu { + background: url('images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.ztree li span.button.bottom_docu { + background: url('images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_docu { + background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_docu { + background: url('images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_docu { + background: url('images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.ztree li span.button.ico_loading { + background: url('images/2x/icon/loading.gif') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.ico_loading { + background: url('images/1x/icon/loading.gif') no-repeat center center; +} +.base-line-conn-background { + background: url('images/1x/icon/tree_vertical_line_1.png') repeat-y 0 0; +} +.bi-theme-dark .base-line-conn-background { + background: url('images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 0 0; +} +.first-line-conn-background { + background: url('images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .first-line-conn-background { + background: url('images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.mid-line-conn-background { + background: url('images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .mid-line-conn-background { + background: url('images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.last-line-conn-background { + background: url('images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .last-line-conn-background { + background: url('images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.loading-background { + background: url('images/2x/icon/loading.gif') no-repeat center center; + background-size: contain; +} +.auto-color-background { + background: url('images/2x/background/auto_color.png') no-repeat center center; + background-size: contain; +} +.auto-color-normal-background { + background: url('images/2x/background/auto_color_normal.png') no-repeat center center; + background-size: contain; +} +.auto-color-normal-disabled-background { + background: url('images/2x/background/auto_color_normal_disable.png') no-repeat center center; + background-size: contain; +} +.trans-color-background { + background: url('images/2x/background/trans_normal.png') no-repeat center center; + background-size: contain; +} +.trans-color-disabled-background { + background: url('images/2x/background/trans_disable.png') no-repeat center center; + background-size: contain; +} +.auto-color-background.hack { + background: url('images/1x/background/auto_color.png') no-repeat center center; +} +.auto-color-normal-background.hack { + background: url('images/1x/background/auto_color_normal.png') no-repeat center center; +} +.auto-color-normal-disabled-background.hack { + background: url('images/1x/background/auto_color_normal_disable.png') no-repeat center center; +} +.trans-color-background.hack { + background: url('images/1x/background/trans_normal.png') no-repeat center center; +} +.trans-color-disabled-background.hack { + background: url('images/1x/background/trans_disable.png') no-repeat center center; +} +.wave-loading { + background: url('images/2x/icon/wave_loading.gif') no-repeat center center; + background-size: contain; +} +.wave-loading.hack { + background: url('images/1x/icon/wave_loading.gif') no-repeat center center; +} +.bi-color-picker-editor .color-picker-editor-display { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-color-picker-editor.disabled .auto-color-normal-background { + background: url('images/2x/background/auto_color_normal_disable.png') no-repeat center center; + background-size: contain; +} +.bi-color-picker-editor.disabled .auto-color-normal-background.hack { + background: url('images/1x/background/auto_color_normal_disable.png') no-repeat center center; +} +.bi-color-picker-editor.disabled .trans-color-background { + background: url('images/2x/background/trans_disable.png') no-repeat center center; + background-size: contain; +} +.bi-color-picker-editor.disabled .trans-color-background.hack { + background: url('images/1x/background/trans_disable.png') no-repeat center center; +} +.bi-farbtastic * { + cursor: crosshair; +} +.bi-farbtastic .marker { + margin: -8px 0 0 -8px; +} +.bi-bubble-combo .button-combo-triangle-wrapper { + position: fixed !important; + line-height: 0; + z-index: 10000000; + background-color: rgba(255, 255, 255, 0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00ffffff,endColorstr=#00ffffff); +} +.bi-bubble-combo .bubble-combo-triangle-left { + z-index: 1; + position: absolute; + width: 6px; + height: 16px; + text-align: left; +} +.bi-bubble-combo .bubble-combo-triangle-left:before { + position: absolute; + width: 6px; + height: 6px; + margin-left: -3px; + margin-top: 4px; + content: ""; + transform: rotate(-45deg); +} +.bi-bubble-combo .bubble-combo-triangle-right { + z-index: 1; + position: absolute; + width: 6px; + height: 16px; + text-align: left; +} +.bi-bubble-combo .bubble-combo-triangle-right:before { + position: absolute; + width: 6px; + height: 6px; + margin-left: 2px; + margin-top: 3px; + content: ""; + transform: rotate(135deg); +} +.bi-bubble-combo .bubble-combo-triangle-top { + z-index: 1; + position: absolute; + width: 16px; + height: 6px; + text-align: left; +} +.bi-bubble-combo .bubble-combo-triangle-top:before { + position: absolute; + width: 6px; + height: 6px; + margin-left: 4px; + margin-top: -3px; + content: ""; + transform: rotate(45deg); +} +.bi-bubble-combo .bubble-combo-triangle-bottom { + z-index: 1; + position: absolute; + width: 16px; + height: 6px; + text-align: left; +} +.bi-bubble-combo .bubble-combo-triangle-bottom:before { + position: absolute; + width: 6px; + height: 6px; + margin-left: 4px; + margin-top: 2px; + content: ""; + transform: rotate(-135deg); +} +.bi-bubble-combo .bubble-combo-triangle-left:before, +.bi-bubble-combo .bubble-combo-triangle-right:before, +.bi-bubble-combo .bubble-combo-triangle-top:before, +.bi-bubble-combo .bubble-combo-triangle-bottom:before { + background-color: #ffffff; + border-bottom: 1px solid #f2f4f7; + border-right: 1px solid #f2f4f7; +} +.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-left:before, +.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-right:before, +.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-top:before, +.bi-theme-dark .bi-bubble-combo .bubble-combo-triangle-bottom:before { + background-color: #20263b; + border-bottom: 1px solid #292f45; + border-right: 1px solid #292f45; +} + +.bi-combo > .bi-trigger .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-combo.bi-combo-popup { + display: block !important; + visibility: visible !important; +} +.bi-combo.bi-combo-popup > .bi-trigger .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-combo.bi-combo-popup > .bi-border, +.bi-combo.bi-combo-hover > .bi-border, +.bi-combo:hover > .bi-border { + border-color: #3685f2; +} +.bi-combo.disabled.bi-combo-hover > .bi-border, +.bi-combo.disabled:hover > .bi-border { + border-color: #e8eaed; +} +.bi-theme-dark .bi-combo.disabled.bi-combo-hover > .bi-border, +.bi-theme-dark .bi-combo.disabled:hover > .bi-border { + border-color: #363e55; +} + +.bi-search-text-value-combo .trigger-icon-button { + font-size: 16px; +} +.bi-search-text-value-combo .search-text-value-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-search-text-value-combo.combo-error .bi-search-text-value-trigger .bi-text-button { + color: #e65251; +} +.bi-search-text-value-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-search-text-value-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.bi-icon-text-value-combo.combo-error .bi-text-trigger .select-text-label { + color: #e65251; +} + +.bi-text-value-combo.combo-error .bi-select-text-trigger .select-text-label { + color: #e65251; +} + +.bi-text-value-check-combo.bi-combo-popup > .bi-border, +.bi-text-value-check-combo:hover > .bi-border { + border-color: #3685f2; +} + +.bi-text-value-down-list-combo.bi-combo-popup > .bi-border, +.bi-text-value-down-list-combo:hover > .bi-border { + border-color: #3685f2; +} +.bi-bubble-bar-popup-view .bar-popup-container { + max-height: 456px; +} + +/*************BI.SearchEditor******************/ +.bi-search-editor { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-search-editor .circle-close-font { + font-size: 18px; +} +.bi-search-editor .search-font { + font-size: 18px; +} + +/*************BI.SearchEditor******************/ +.bi-small-search-editor .bi-editor { + font-size: 12px; +} +.bi-small-search-editor .bi-editor .bi-input { + font-size: 12px; +} +.bi-small-search-editor .bi-editor .bi-label { + font-size: 12px; +} +.bi-small-search-editor .close-font { + font-size: 16px; +} +.bi-small-search-editor .search-font { + font-size: 16px; +} +.bi-message-title { + font-size: 14px; + cursor: pointer; +} +.bi-message-text { + font-size: 16px; + -webkit-user-select: text; + -khtml-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + -o-user-select: text; + user-select: text; +} +.bi-message-content { + font-size: 16px; +} +.bi-message-close { + font-size: 16px; +} +.bi-message-animate { + -webkit-transition: opacity 0.3s, transform 0.3s, left 0.3s, right 0.3s, top 0.4s, bottom 0.3s; + -moz-transition: opacity 0.3s, transform 0.3s, left 0.3s, right 0.3s, top 0.4s, bottom 0.3s; + -o-transition: opacity 0.3s, transform 0.3s, left 0.3s, right 0.3s, top 0.4s, bottom 0.3s; + transition: opacity 0.3s, transform 0.3s, left 0.3s, right 0.3s, top 0.4s, bottom 0.3s; +} +.bi-message-enter { + opacity: 1; +} +.bi-message-leave { + opacity: 0; + transform: translateY(-100%); +} +.bi-multi-list-view .bi-button-mask { + opacity: 0.1; + filter: alpha(opacity=10); +} +.bi-panel { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-panel .panel-title .panel-title-text { + cursor: text; + font-size: 14px; +} +.bi-sortable-holder { + border: 1px dashed #e8eaed; +} +.bi-all-count-pager .all-pager-prev { + font-size: 16px; +} +.bi-all-count-pager .all-pager-next { + font-size: 16px; +} +.bi-all-count-pager .row-count { + color: #3685f2; +} + +.bi-direction-pager .direction-pager-prev { + font-size: 16px; +} +.bi-direction-pager .direction-pager-next { + font-size: 16px; +} + +.bi-pager .page-item { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-pane { + min-height: 25px; +} +.bi-pane.loading-status { + min-height: 55px; +} +.bi-pane .loading-container { + background-color: rgba(247, 248, 250, 0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00f7f8fa,endColorstr=#00f7f8fa); +} +.bi-loading-widget { + font-size: 0; +} +.bi-loading-widget .animate-rect { + background-color: rgba(54, 133, 242, 0.9); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#e63685f2,endColorstr=#e63685f2); + -webkit-border-radius: 1.5px; + -moz-border-radius: 1.5px; + border-radius: 1.5px; + -webkit-animation: loading-widget 0.8s infinite linear; + -moz-animation: loading-widget 0.8s infinite linear; + -ms-animation: loading-widget 0.8s infinite linear; + -o-animation: loading-widget 0.8s infinite linear; + animation: loading-widget 0.8s infinite linear; +} +.bi-loading-widget .rect2 { + -webkit-animation-delay: -0.2s; + -moz-animation-delay: -0.2s; + -ms-animation-delay: -0.2s; + -o-animation-delay: -0.2s; + animation-delay: -0.2s; +} +.bi-loading-widget .rect3 { + -webkit-animation-delay: -0.4s; + -moz-animation-delay: -0.4s; + -ms-animation-delay: -0.4s; + -o-animation-delay: -0.4s; + animation-delay: -0.4s; +} +@-webkit-keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +@-moz-keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +@-ms-keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +@-o-keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +@keyframes loading-widget { + 0%, + 100% { + -webkit-transform: scaleY(0.3); + -moz-transform: scaleY(0.3); + -o-transform: scaleY(0.3); + -ms-transform: scaleY(0.3); + transform: scaleY(0.3); + } + 50% { + -webkit-transform: scaleY(1); + -moz-transform: scaleY(1); + -o-transform: scaleY(1); + -ms-transform: scaleY(1); + transform: scaleY(1); + } +} +.bi-segment-button { + color: #3685f2; +} +.bi-segment > .center-element { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + background: #ffffff; + border-right: 1px solid #3685f2; + border-top: 1px solid #3685f2; + border-bottom: 1px solid #3685f2; +} +.bi-segment > .first-element { + border-left: 1px solid #3685f2; + -webkit-border-radius: 2px 0px 0px 2px; + -moz-border-radius: 2px 0px 0px 2px; + border-radius: 2px 0px 0px 2px; +} +.bi-segment > .last-element { + -webkit-border-radius: 0px 2px 2px 0px; + -moz-border-radius: 0px 2px 2px 0px; + border-radius: 0px 2px 2px 0px; +} +.bi-segment.disabled > .center-element, +.bi-segment.disabled > .first-element { + border-color: #d0d4da; +} +.bi-theme-dark .bi-segment > .center-element { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + background: #20263b; + border-right: 1px solid #363e55; + border-top: 1px solid #363e55; + border-bottom: 1px solid #363e55; +} +.bi-theme-dark .bi-segment > .first-element { + border-left: 1px solid #20263b; +} +.bi-half-button { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +body .bi-button, +#body .bi-button { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + border: 1px solid #3685f2; + background-color: #3685f2; + -webkit-box-sizing: border-box; + /*Safari3.2+*/ + -moz-box-sizing: border-box; + /*Firefox3.5+*/ + -ms-box-sizing: border-box; + /*IE8*/ + box-sizing: border-box; + /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ + text-align: center; + vertical-align: middle; + cursor: pointer; +} +body .bi-button.hack, +#body .bi-button.hack { + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +body .bi-button.block, +#body .bi-button.block { + font-size: inherit; + border-width: 0; + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +body .bi-button.clear, +#body .bi-button.clear { + font-size: inherit; + border-width: 0; + background-color: transparent; +} +body .bi-button.clear:hover, +#body .bi-button.clear:hover { + opacity: 0.9; + filter: alpha(opacity=90); +} +body .bi-button.clear:active, +#body .bi-button.clear:active { + opacity: 0.8; + filter: alpha(opacity=80); +} +body .bi-button.clear:after, +#body .bi-button.clear:after { + display: none; +} +body .bi-button.ghost, +#body .bi-button.ghost { + font-size: inherit; + background-color: transparent; +} +body .bi-button.button-common, +#body .bi-button.button-common, +body .bi-button.button-common .b-font:before, +#body .bi-button.button-common .b-font:before { + color: #ffffff; +} +body .bi-button.button-common.clear, +#body .bi-button.button-common.clear, +body .bi-button.button-common.clear .b-font:before, +#body .bi-button.button-common.clear .b-font:before { + color: #3685f2; +} +body .bi-button.button-common.ghost, +#body .bi-button.button-common.ghost, +body .bi-button.button-common.ghost .b-font:before, +#body .bi-button.button-common.ghost .b-font:before { + color: #3685f2; +} +body .bi-button.button-common.ghost:hover, +#body .bi-button.button-common.ghost:hover { + color: #ffffff; + background-color: #3685f2; +} +body .bi-button.button-common.ghost:active, +#body .bi-button.button-common.ghost:active { + background-color: #3685f2; +} +body .bi-button.button-ignore, +#body .bi-button.button-ignore { + background-color: transparent; + border-color: #3685f2; +} +body .bi-button.button-ignore, +#body .bi-button.button-ignore, +body .bi-button.button-ignore .b-font:before, +#body .bi-button.button-ignore .b-font:before { + color: #3685f2; +} +body .bi-button.button-ignore.clear, +#body .bi-button.button-ignore.clear { + background-color: transparent; + border-width: 0; +} +body .bi-button.button-success, +#body .bi-button.button-success { + background-color: #13cd66; + border-color: #13cd66; +} +body .bi-button.button-success, +#body .bi-button.button-success, +body .bi-button.button-success .b-font:before, +#body .bi-button.button-success .b-font:before { + color: #ffffff; +} +body .bi-button.button-success.clear, +#body .bi-button.button-success.clear { + background-color: transparent; + border-width: 0; +} +body .bi-button.button-success.clear, +#body .bi-button.button-success.clear, +body .bi-button.button-success.clear .b-font:before, +#body .bi-button.button-success.clear .b-font:before { + color: #13cd66; +} +body .bi-button.button-warning, +#body .bi-button.button-warning { + background-color: #faaa39; + border-color: #fbb03b; +} +body .bi-button.button-warning, +#body .bi-button.button-warning, +body .bi-button.button-warning .b-font:before, +#body .bi-button.button-warning .b-font:before { + color: #ffffff; +} +body .bi-button.button-warning.clear, +#body .bi-button.button-warning.clear { + background-color: transparent; + border-width: 0; +} +body .bi-button.button-warning.clear, +#body .bi-button.button-warning.clear, +body .bi-button.button-warning.clear .b-font:before, +#body .bi-button.button-warning.clear .b-font:before { + color: #faaa39; +} +body .bi-button.button-error, +#body .bi-button.button-error { + background-color: #e65251; + border-color: #e65251; +} +body .bi-button.button-error, +#body .bi-button.button-error, +body .bi-button.button-error .b-font:before, +#body .bi-button.button-error .b-font:before { + color: #ffffff; +} +body .bi-button.button-error.clear, +#body .bi-button.button-error.clear { + background-color: transparent; + border-width: 0; +} +body .bi-button.button-error.clear, +#body .bi-button.button-error.clear, +body .bi-button.button-error.clear .b-font:before, +#body .bi-button.button-error.clear .b-font:before { + color: #e65251; +} +body .bi-button.button-common.disabled, +#body .bi-button.button-common.disabled, +body .bi-button.button-success.disabled, +#body .bi-button.button-success.disabled, +body .bi-button.button-error.disabled, +#body .bi-button.button-error.disabled, +body .bi-button.button-warning.disabled, +#body .bi-button.button-warning.disabled, +body .bi-button.button-common.disabled.base-disabled, +#body .bi-button.button-common.disabled.base-disabled, +body .bi-button.button-success.disabled.base-disabled, +#body .bi-button.button-success.disabled.base-disabled, +body .bi-button.button-error.disabled.base-disabled, +#body .bi-button.button-error.disabled.base-disabled, +body .bi-button.button-warning.disabled.base-disabled, +#body .bi-button.button-warning.disabled.base-disabled { + background-color: rgba(158, 166, 178, 0.2) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#339ea6b2,endColorstr=#339ea6b2); + border-color: #d0d4da !important; +} +body .bi-button.button-common.disabled, +#body .bi-button.button-common.disabled, +body .bi-button.button-success.disabled, +#body .bi-button.button-success.disabled, +body .bi-button.button-error.disabled, +#body .bi-button.button-error.disabled, +body .bi-button.button-warning.disabled, +#body .bi-button.button-warning.disabled, +body .bi-button.button-common.disabled.base-disabled, +#body .bi-button.button-common.disabled.base-disabled, +body .bi-button.button-success.disabled.base-disabled, +#body .bi-button.button-success.disabled.base-disabled, +body .bi-button.button-error.disabled.base-disabled, +#body .bi-button.button-error.disabled.base-disabled, +body .bi-button.button-warning.disabled.base-disabled, +#body .bi-button.button-warning.disabled.base-disabled, +body .bi-button.button-common.disabled .b-font:before, +#body .bi-button.button-common.disabled .b-font:before, +body .bi-button.button-success.disabled .b-font:before, +#body .bi-button.button-success.disabled .b-font:before, +body .bi-button.button-error.disabled .b-font:before, +#body .bi-button.button-error.disabled .b-font:before, +body .bi-button.button-warning.disabled .b-font:before, +#body .bi-button.button-warning.disabled .b-font:before, +body .bi-button.button-common.disabled.base-disabled .b-font:before, +#body .bi-button.button-common.disabled.base-disabled .b-font:before, +body .bi-button.button-success.disabled.base-disabled .b-font:before, +#body .bi-button.button-success.disabled.base-disabled .b-font:before, +body .bi-button.button-error.disabled.base-disabled .b-font:before, +#body .bi-button.button-error.disabled.base-disabled .b-font:before, +body .bi-button.button-warning.disabled.base-disabled .b-font:before, +#body .bi-button.button-warning.disabled.base-disabled .b-font:before { + color: #9ea6b2 !important; +} +body .bi-button.button-common.disabled:after, +#body .bi-button.button-common.disabled:after, +body .bi-button.button-success.disabled:after, +#body .bi-button.button-success.disabled:after, +body .bi-button.button-error.disabled:after, +#body .bi-button.button-error.disabled:after, +body .bi-button.button-warning.disabled:after, +#body .bi-button.button-warning.disabled:after { + display: none; +} +body .bi-button.button-ignore.disabled, +#body .bi-button.button-ignore.disabled { + background: #ffffff !important; + border-color: #e8eaed !important; +} +body .bi-button.button-ignore.disabled, +#body .bi-button.button-ignore.disabled, +body .bi-button.button-ignore.disabled .b-font:before, +#body .bi-button.button-ignore.disabled .b-font:before { + color: #9ea6b2 !important; +} +body .bi-button.button-ignore.disabled:after, +#body .bi-button.button-ignore.disabled:after { + display: none; +} +body .bi-button.button-common.disabled.clear, +#body .bi-button.button-common.disabled.clear, +body .bi-button.button-success.disabled.clear, +#body .bi-button.button-success.disabled.clear, +body .bi-button.button-warning.disabled.clear, +#body .bi-button.button-warning.disabled.clear, +body .bi-button.button-error.disabled.clear, +#body .bi-button.button-error.disabled.clear, +body .bi-button.button-ignore.disabled.clear, +#body .bi-button.button-ignore.disabled.clear { + background: transparent !important; + border-width: 0 !important; +} +body .bi-button.button-common.disabled.clear, +#body .bi-button.button-common.disabled.clear, +body .bi-button.button-success.disabled.clear, +#body .bi-button.button-success.disabled.clear, +body .bi-button.button-warning.disabled.clear, +#body .bi-button.button-warning.disabled.clear, +body .bi-button.button-error.disabled.clear, +#body .bi-button.button-error.disabled.clear, +body .bi-button.button-ignore.disabled.clear, +#body .bi-button.button-ignore.disabled.clear, +body .bi-button.button-common.disabled.clear .b-font:before, +#body .bi-button.button-common.disabled.clear .b-font:before, +body .bi-button.button-success.disabled.clear .b-font:before, +#body .bi-button.button-success.disabled.clear .b-font:before, +body .bi-button.button-warning.disabled.clear .b-font:before, +#body .bi-button.button-warning.disabled.clear .b-font:before, +body .bi-button.button-error.disabled.clear .b-font:before, +#body .bi-button.button-error.disabled.clear .b-font:before, +body .bi-button.button-ignore.disabled.clear .b-font:before, +#body .bi-button.button-ignore.disabled.clear .b-font:before { + color: #9ea6b2 !important; +} +body .bi-button.button-common.disabled.clear:hover, +#body .bi-button.button-common.disabled.clear:hover, +body .bi-button.button-success.disabled.clear:hover, +#body .bi-button.button-success.disabled.clear:hover, +body .bi-button.button-warning.disabled.clear:hover, +#body .bi-button.button-warning.disabled.clear:hover, +body .bi-button.button-error.disabled.clear:hover, +#body .bi-button.button-error.disabled.clear:hover, +body .bi-button.button-ignore.disabled.clear:hover, +#body .bi-button.button-ignore.disabled.clear:hover, +body .bi-button.button-common.disabled.clear:active, +#body .bi-button.button-common.disabled.clear:active, +body .bi-button.button-success.disabled.clear:active, +#body .bi-button.button-success.disabled.clear:active, +body .bi-button.button-warning.disabled.clear:active, +#body .bi-button.button-warning.disabled.clear:active, +body .bi-button.button-error.disabled.clear:active, +#body .bi-button.button-error.disabled.clear:active, +body .bi-button.button-ignore.disabled.clear:active, +#body .bi-button.button-ignore.disabled.clear:active { + opacity: 1; + filter: alpha(opacity=100); +} +body .bi-button.button-common.disabled.ghost, +#body .bi-button.button-common.disabled.ghost, +body .bi-button.button-success.disabled.ghost, +#body .bi-button.button-success.disabled.ghost, +body .bi-button.button-warning.disabled.ghost, +#body .bi-button.button-warning.disabled.ghost, +body .bi-button.button-error.disabled.ghost, +#body .bi-button.button-error.disabled.ghost, +body .bi-button.button-ignore.disabled.ghost, +#body .bi-button.button-ignore.disabled.ghost { + background: transparent !important; + border-color: #3685f2 !important; + opacity: 0.5; + filter: alpha(opacity=50); +} +body .bi-button.button-common.disabled.ghost, +#body .bi-button.button-common.disabled.ghost, +body .bi-button.button-success.disabled.ghost, +#body .bi-button.button-success.disabled.ghost, +body .bi-button.button-warning.disabled.ghost, +#body .bi-button.button-warning.disabled.ghost, +body .bi-button.button-error.disabled.ghost, +#body .bi-button.button-error.disabled.ghost, +body .bi-button.button-ignore.disabled.ghost, +#body .bi-button.button-ignore.disabled.ghost, +body .bi-button.button-common.disabled.ghost .b-font:before, +#body .bi-button.button-common.disabled.ghost .b-font:before, +body .bi-button.button-success.disabled.ghost .b-font:before, +#body .bi-button.button-success.disabled.ghost .b-font:before, +body .bi-button.button-warning.disabled.ghost .b-font:before, +#body .bi-button.button-warning.disabled.ghost .b-font:before, +body .bi-button.button-error.disabled.ghost .b-font:before, +#body .bi-button.button-error.disabled.ghost .b-font:before, +body .bi-button.button-ignore.disabled.ghost .b-font:before, +#body .bi-button.button-ignore.disabled.ghost .b-font:before { + color: #3685f2 !important; +} +.bi-basic-button.button-common:after, +.bi-basic-button.button-success:after, +.bi-basic-button.button-warning:after, +.bi-basic-button.button-error:after { + content: ""; + background-color: #232E40; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + display: block; + width: 100%; + height: 100%; + position: absolute; + transform: scale(1, 1); + opacity: 0; + filter: alpha(opacity=0); + -webkit-transition: transform 0.5s ease, opacity 1s ease; + -moz-transition: transform 0.5s ease, opacity 1s ease; + -o-transition: transform 0.5s ease, opacity 1s ease; + transition: transform 0.5s ease, opacity 1s ease; + left: 0; + top: 0; + pointer-events: none; +} +.bi-basic-button.button-common.hack:after, +.bi-basic-button.button-success.hack:after, +.bi-basic-button.button-warning.hack:after, +.bi-basic-button.button-error.hack:after { + content: none; +} +.bi-basic-button.button-common:active:after, +.bi-basic-button.button-success:active:after, +.bi-basic-button.button-warning:active:after, +.bi-basic-button.button-error:active:after { + transform: scale(0, 1); + opacity: 0.1; + filter: alpha(opacity=10); + -webkit-transition: transform 0s; + -moz-transition: transform 0s; + -o-transition: transform 0s; + transition: transform 0s; +} +.bi-basic-button.button-common:hover .bi-button-mask, +.bi-basic-button.button-success:hover .bi-button-mask, +.bi-basic-button.button-warning:hover .bi-button-mask, +.bi-basic-button.button-error:hover .bi-button-mask { + opacity: 0.1; + filter: alpha(opacity=10); + background-color: #ffffff; + -webkit-transition: opacity 0.3s ease; + -moz-transition: opacity 0.3s ease; + -o-transition: opacity 0.3s ease; + transition: opacity 0.3s ease; +} +.bi-basic-button.button-ignore:after { + content: ""; + background-color: #3685f2; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + display: block; + width: 100%; + height: 100%; + position: absolute; + transform: scale(1, 1); + opacity: 0; + filter: alpha(opacity=0); + -webkit-transition: transform 0.5s ease, opacity 1s ease; + -moz-transition: transform 0.5s ease, opacity 1s ease; + -o-transition: transform 0.5s ease, opacity 1s ease; + transition: transform 0.5s ease, opacity 1s ease; + left: 0; + top: 0; + pointer-events: none; +} +.bi-basic-button.button-ignore.hack:after { + content: none; +} +.bi-basic-button.button-ignore:active:after { + transform: scale(0, 1); + opacity: 0.1; + filter: alpha(opacity=10); + -webkit-transition: transform 0s; + -moz-transition: transform 0s; + -o-transition: transform 0s; + transition: transform 0s; +} +.bi-basic-button.button-ignore:hover { + background-color: rgba(54, 133, 242, 0.05); + -webkit-transition: opacity 0.3s ease; + -moz-transition: opacity 0.3s ease; + -o-transition: opacity 0.3s ease; + transition: opacity 0.3s ease; +} +.bi-basic-button .popup-content { + font-size: 14px; +} +.bi-theme-dark body .bi-button.button-common.ghost, +.bi-theme-dark #body .bi-button.button-common.ghost, +.bi-theme-dark body .bi-button.button-common.ghost .b-font:before, +.bi-theme-dark #body .bi-button.button-common.ghost .b-font:before { + color: #ffffff; + border-color: #ffffff; +} +.bi-theme-dark body .bi-button.button-common.ghost:hover, +.bi-theme-dark #body .bi-button.button-common.ghost:hover { + color: #3d4d66; + background-color: #ffffff; +} +.bi-theme-dark body .bi-button.button-common.ghost:active, +.bi-theme-dark #body .bi-button.button-common.ghost:active { + background-color: rgba(255, 255, 255, 0.9); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#e6ffffff,endColorstr=#e6ffffff); +} +.bi-theme-dark body .bi-button.button-ignore:hover, +.bi-theme-dark #body .bi-button.button-ignore:hover { + background-color: rgba(54, 133, 242, 0.05); +} +.bi-theme-dark body .bi-button.button-ignore:active, +.bi-theme-dark #body .bi-button.button-ignore:active { + background-color: rgba(54, 133, 242, 0.1); +} +.bi-theme-dark body .bi-button.button-common.disabled.ghost, +.bi-theme-dark #body .bi-button.button-common.disabled.ghost { + background: transparent !important; + border-color: #ffffff !important; + opacity: 0.5; + filter: alpha(opacity=50); +} +.bi-theme-dark body .bi-button.button-common.disabled.ghost, +.bi-theme-dark #body .bi-button.button-common.disabled.ghost, +.bi-theme-dark body .bi-button.button-common.disabled.ghost .b-font:before, +.bi-theme-dark #body .bi-button.button-common.disabled.ghost .b-font:before { + color: #ffffff !important; +} +.bi-theme-dark body .bi-button.button-success.disabled, +.bi-theme-dark #body .bi-button.button-success.disabled, +.bi-theme-dark body .bi-button.button-error.disabled, +.bi-theme-dark #body .bi-button.button-error.disabled, +.bi-theme-dark body .bi-button.button-warning.disabled, +.bi-theme-dark #body .bi-button.button-warning.disabled, +.bi-theme-dark body .bi-button.button-ignore.disabled, +.bi-theme-dark #body .bi-button.button-ignore.disabled, +.bi-theme-dark body .bi-button.button-success.disabled.base-disabled, +.bi-theme-dark #body .bi-button.button-success.disabled.base-disabled, +.bi-theme-dark body .bi-button.button-error.disabled.base-disabled, +.bi-theme-dark #body .bi-button.button-error.disabled.base-disabled, +.bi-theme-dark body .bi-button.button-warning.disabled.base-disabled, +.bi-theme-dark #body .bi-button.button-warning.disabled.base-disabled, +.bi-theme-dark body .bi-button.button-ignore.disabled.base-disabled, +.bi-theme-dark #body .bi-button.button-ignore.disabled.base-disabled { + background-color: rgba(135, 141, 159, 0.2) !important; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#33878d9f,endColorstr=#33878d9f); +} +.bi-single-select-icon-text-item:active .b-font:before, +.bi-single-select-icon-text-item.active .b-font:before { + color: #3685f2; +} +.bi-switch { + -webkit-border-radius: 40px 40px 40px 40px; + -moz-border-radius: 40px 40px 40px 40px; + border-radius: 40px 40px 40px 40px; + background-color: #d0d4da; +} +.bi-switch:active, +.bi-switch.active { + background-color: #3685f2; +} +.bi-switch .circle-button { + -webkit-border-radius: 9px 9px 9px 9px; + -moz-border-radius: 9px 9px 9px 9px; + border-radius: 9px 9px 9px 9px; +} +.bi-switch.disabled { + background-color: #f2f4f7; +} +.bi-switch.disabled:active { + background-color: #f2f4f7; +} +.bi-theme-dark .bi-switch { + background-color: #606479; +} +.bi-theme-dark .bi-switch:active, +.bi-theme-dark .bi-switch.active { + background-color: #3685f2; +} +.bi-theme-dark .bi-switch.disabled { + background-color: #292f45; +} +.bi-theme-dark .bi-switch.disabled:active { + background-color: #292f45; +} +.bi-multifile-editor .multifile-editor { + text-align: right; + cursor: pointer; + font-size: 100px; + z-index: 2; + margin-left: -5px; +} + +.bi-textarea-editor { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; +} +.bi-textarea-editor .textarea-editor-content { + white-space: pre-wrap; + font-size: 12px; + line-height: 21px; + border: none; +} +.bi-html article, +.bi-html aside, +.bi-html details, +.bi-html figcaption, +.bi-html figure, +.bi-html footer, +.bi-html header, +.bi-html hgroup, +.bi-html nav, +.bi-html section, +.bi-html summary { + display: block; +} +.bi-html audio, +.bi-html canvas, +.bi-html video { + display: inline-block; + *display: inline; + *zoom: 1; +} +.bi-html audio:not([controls]) { + display: none; + height: 0; +} +.bi-html [hidden] { + display: none; +} +.bi-html html { + font-size: 100%; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} +.bi-html html, +.bi-html button, +.bi-html input, +.bi-html select, +.bi-html textarea { + font-family: sans-serif; +} +.bi-html body { + margin: 0; +} +.bi-html a:focus { + outline: thin dotted; +} +.bi-html a:active, +.bi-html a:hover { + outline: 0; +} +.bi-html h1 { + font-size: 2em; + margin: 0.67em 0; +} +.bi-html h2 { + font-size: 1.5em; + margin: 0.83em 0; +} +.bi-html h3 { + font-size: 1.17em; + margin: 1em 0; +} +.bi-html h4 { + font-size: 1em; + margin: 1.33em 0; +} +.bi-html h5 { + font-size: .83em; + margin: 1.67em 0; +} +.bi-html h6 { + font-size: .75em; + margin: 2.33em 0; +} +.bi-html abbr[title] { + border-bottom: 1px dotted; +} +.bi-html b, +.bi-html strong { + font-weight: bold; +} +.bi-html blockquote { + margin: 1em 40px; +} +.bi-html dfn { + font-style: italic; +} +.bi-html mark { + background: #ff0; + color: #000; +} +.bi-html p, +.bi-html pre { + margin: 1em 0; +} +.bi-html code, +.bi-html kbd, +.bi-html pre, +.bi-html samp { + font-family: monospace, serif; + _font-family: 'courier new', monospace; + font-size: 1em; +} +.bi-html pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} +.bi-html q { + quotes: none; +} +.bi-html q:before, +.bi-html q:after { + content: ''; + content: none; +} +.bi-html small { + font-size: 75%; +} +.bi-html sub, +.bi-html sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +.bi-html sup { + top: -0.5em; +} +.bi-html sub { + bottom: -0.25em; +} +.bi-html dl, +.bi-html menu, +.bi-html ol, +.bi-html ul { + margin: 1em 0; +} +.bi-html dd { + margin: 0 0 0 40px; +} +.bi-html menu, +.bi-html ol, +.bi-html ul { + padding: 0 0 0 40px; +} +.bi-html nav ul, +.bi-html nav ol { + list-style: none; + list-style-image: none; +} +.bi-html ul { + list-style: disc; +} +.bi-html li { + list-style-type: disc; +} +.bi-html img { + border: 0; + -ms-interpolation-mode: bicubic; +} +.bi-html svg:not(:root) { + overflow: hidden; +} +.bi-html figure { + margin: 0; +} +.bi-html form { + margin: 0; +} +.bi-html fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +.bi-html legend { + border: 0; + padding: 0; + white-space: normal; + *margin-left: -7px; +} +.bi-html button, +.bi-html input, +.bi-html select, +.bi-html textarea { + font-size: 100%; + margin: 0; + vertical-align: baseline; + *vertical-align: middle; +} +.bi-html button, +.bi-html input { + line-height: normal; +} +.bi-html button, +.bi-html html input[type="button"], +.bi-html input[type="reset"], +.bi-html input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; + *overflow: visible; +} +.bi-html button[disabled], +.bi-html input[disabled] { + cursor: default; +} +.bi-html input[type="checkbox"], +.bi-html input[type="radio"] { + box-sizing: border-box; + padding: 0; + *height: 13px; + *width: 13px; +} +.bi-html input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +.bi-html input[type="search"]::-webkit-search-cancel-button, +.bi-html input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +.bi-html button::-moz-focus-inner, +.bi-html input::-moz-focus-inner { + border: 0; + padding: 0; +} +.bi-html textarea { + overflow: auto; + vertical-align: top; +} +.bi-html table { + border-collapse: collapse; + border-spacing: 0; +} +.x-icon.b-font { + margin: auto; + width: 100%; +} +.bi-checkbox .checkbox-content { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + border: 1px solid #9EA6B2; +} +.bi-checkbox .checkbox-content:after { + position: absolute; + display: table; + top: 50%; + left: 20%; + border: 2px solid transparent; + border-top: 0; + border-left: 0; + width: 4px; + height: 8px; + -webkit-transform: rotate(45deg) scale(1) translate(-50%, -50%); + -moz-transform: rotate(45deg) scale(1) translate(-50%, -50%); + -o-transform: rotate(45deg) scale(1) translate(-50%, -50%); + -ms-transform: rotate(45deg) scale(1) translate(-50%, -50%); + transform: rotate(45deg) scale(1) translate(-50%, -50%); + content: ''; +} +.bi-checkbox .checkbox-content.hover, +.bi-checkbox .checkbox-content:hover { + border-color: #3685f2; +} +.bi-checkbox.active .checkbox-content, +.bi-checkbox:active .checkbox-content { + border-color: #3685f2; +} +.bi-checkbox.active .checkbox-content:after, +.bi-checkbox:active .checkbox-content:after { + border-color: #ffffff; + opacity: 1; +} +.bi-checkbox.disabled .checkbox-content { + background-color: #f2f4f7; + border-color: #d0d4da; +} +.bi-checkbox.disabled .checkbox-content:after { + opacity: 0; +} +.bi-checkbox.disabled.active .checkbox-content { + background-color: #d0d4da; +} +.bi-checkbox.disabled.active .checkbox-content:after { + opacity: 1; +} +.bi-theme-dark .bi-checkbox .checkbox-content { + border-color: #878D9F; +} +.bi-theme-dark .bi-checkbox .checkbox-content.hover, +.bi-theme-dark .bi-checkbox .checkbox-content:hover { + border-color: #3685f2; +} +.bi-theme-dark .bi-checkbox.active .checkbox-content, +.bi-theme-dark .bi-checkbox:active .checkbox-content { + border-color: #3685f2; +} +.bi-theme-dark .bi-checkbox.disabled .checkbox-content { + background-color: #292f45; +} +.bi-theme-dark .bi-checkbox.disabled.active .checkbox-content { + background-color: #606479; + border-color: #606479; +} +.bi-file { + opacity: 0; + filter: alpha(opacity=0); + z-index: 2; +} +.bi-input, +.bi-textarea { + border: none; + outline: none; + background-color: transparent; + padding: 0; + margin: 0; + width: 100%; + height: 100%; +} +.bi-input.bi-input-focus, +.bi-textarea.bi-input-focus { + border: none; +} +.bi-input.bi-input-error, +.bi-textarea.bi-input-error { + border: none; + color: #e65251 !important; +} +.bi-radio .radio-content { + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + border: 1px solid #9EA6B2; +} +.bi-radio .radio-content:after { + content: ""; +} +.bi-radio .radio-content.hover, +.bi-radio .radio-content:hover { + border-color: #3685f2; +} +.bi-radio:active .radio-content, +.bi-radio.active .radio-content { + border-color: #3685f2; +} +.bi-radio:active .radio-content:after, +.bi-radio.active .radio-content:after { + width: 6px; + height: 6px; + display: table; + position: absolute; + top: 50%; + left: 50%; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + background-color: #ffffff; + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} +.bi-radio.disabled .radio-content { + background-color: #f2f4f7; + border-color: #d0d4da; +} +.bi-radio.disabled .radio-content:after { + background-color: transparent; +} +.bi-radio.disabled.active .radio-content { + background-color: #d0d4da; +} +.bi-radio.disabled.active .radio-content:after { + background-color: #ffffff; +} +.bi-theme-dark .bi-radio .radio-content { + border-color: #878D9F; +} +.bi-theme-dark .bi-radio .radio-content.hover, +.bi-theme-dark .bi-radio .radio-content:hover { + border-color: #3685f2; +} +.bi-theme-dark .bi-radio.active .radio-content, +.bi-theme-dark .bi-radio:active .radio-content { + border-color: #3685f2; +} +.bi-theme-dark .bi-radio.disabled .radio-content { + background-color: #292f45; +} +.bi-theme-dark .bi-radio.disabled .radio-content.hover, +.bi-theme-dark .bi-radio.disabled .radio-content:hover { + border-color: #878D9F; +} +.bi-theme-dark .bi-radio.disabled.active .radio-content { + background-color: #606479; + border-color: #606479; +} +.bi-label { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + word-break: break-all; +} +.bi-text { + overflow: hidden; + overflow-x: hidden; + overflow-y: hidden; + -webkit-box-sizing: border-box; + /*Safari3.2+*/ + -moz-box-sizing: border-box; + /*Firefox3.5+*/ + -ms-box-sizing: border-box; + /*IE8*/ + box-sizing: border-box; + /*W3C标准(IE9+,Safari5.1+,Chrome10.0+,Opera10.6+都符合box-sizing的w3c标准语法)*/ + word-break: break-word; +} +.bi-bubble .bubble-text { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-bubble .bubble-error { + background: #ffecec; + color: #e65251; +} +.bi-theme-dark .bi-bubble .bubble-error { + background: #3A2940; +} +.bi-bubble .bubble-common { + background: #eaf2fd; + color: #3685f2; +} +.bi-bubble .bubble-success { + background: #e1f4e7; + color: #13cd66; +} +.bi-bubble .bubble-warning { + background: #feeed7; + color: #faaa39; +} + +.bi-tip { + position: fixed !important; +} + +.bi-toast { + color: #ffffff; + max-width: 400px; + min-width: 150px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-toast.toast-success { + background: #13cd66; +} +.bi-toast.toast-warning { + background: #faaa39; +} +.bi-toast.toast-error { + background: #e65251; +} +.bi-toast.toast-normal { + background: #3685f2; +} +.bi-toast .toast-icon { + font-size: 16px; +} + +.bi-tooltip { + max-width: 250px; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + font-size: 12px; + color: #ffffff; +} +.bi-tooltip.tooltip-success { + background: #647185; + border: 1px solid #647185; +} +.bi-tooltip.tooltip-warning { + background: #e65251; + border: 1px solid #e65251; +} +.bi-branch-tree .bi-branch-tree-view { + min-width: 300px; +} + +.bi-display-tree .ztree * { + color: #999999; +} +.bi-display-tree .ztree li a, +.bi-display-tree .ztree li span { + cursor: default !important; +} +.bi-display-tree .ztree li a:hover { + text-decoration: none; +} +.bi-display-tree .ztree li a.curSelectedNode { + padding-top: 1px; + border: none; + background-color: inherit; + opacity: 1; + filter: alpha(opacity=100); +} + +.bi-list-display-tree .ztree li a, +.bi-list-display-tree .ztree li span { + cursor: default !important; +} +.bi-list-display-tree .ztree li a:hover { + text-decoration: none; +} +.bi-list-display-tree .ztree li a.curSelectedNode { + padding-top: 1px; + border: none; + background-color: inherit; + opacity: 1; + filter: alpha(opacity=100); +} +.ztree * { + padding: 0; + margin: 0; +} +.ztree { + margin: 0; + padding: 5px; +} +.ztree li { + padding: 0; + margin: 0; + list-style: none; + line-height: 14px; + text-align: left; + white-space: nowrap; + outline: 0; +} +.ztree li ul { + margin: 0; + padding: 0 0 0 18px; +} +.ztree li a { + padding: 1px 3px 0 0; + margin: 0; + cursor: pointer; + height: 24px; + background-color: transparent; + text-decoration: none; + vertical-align: top; + display: inline-block; +} +.ztree li a:hover { + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.ztree li a:active { + color: #3685f2; + background-color: rgba(54, 133, 242, 0.06); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0f3685f2,endColorstr=#0f3685f2); +} +.ztree li a.curSelectedNode_Edit { + padding-top: 0px; + background-color: #FFE6B0; + color: black; + height: 16px; + border: 1px #FFB951 solid; + opacity: 0.8; +} +.ztree li a.tmpTargetNode_inner { + padding-top: 0px; + background-color: #316AC5; + color: white; + height: 16px; + border: 1px #316AC5 solid; + opacity: 0.8; + filter: alpha(opacity=80); +} +.ztree li a input.rename { + height: 14px; + width: 80px; + padding: 0; + margin: 0; + font-size: 12px; + border: 1px #7EC4CC solid; + *border: 0px; +} +.ztree li span { + line-height: 24px; + margin-right: 2px; +} +.ztree li span.bi-keyword-red-mark { + margin-right: 0px; +} +.ztree li span.button { + line-height: 0; + margin: 0; + width: 16px; + height: 16px; + display: inline-block; + vertical-align: middle; + border: 0 none; + cursor: pointer; + outline: none; + background-color: transparent; + background-repeat: no-repeat; + background-attachment: scroll; +} +.ztree li span.button.chk { + width: 16px; + height: 16px; + margin: 0 3px 0 0; + cursor: auto; +} +.ztree li span.button.chk.checkbox_false_disable { + background-position: 0 -56px; +} +.ztree li span.button.chk.checkbox_true_disable { + background-position: -14px -56px; +} +.ztree li span.button.chk.radio_false_full { + background-position: -28px 0; +} +.ztree li span.button.chk.radio_false_full_focus { + background-position: -28px -14px; +} +.ztree li span.button.chk.radio_false_part { + background-position: -28px -28px; +} +.ztree li span.button.chk.radio_false_part_focus { + background-position: -28px -42px; +} +.ztree li span.button.chk.radio_false_disable { + background-position: -28px -56px; +} +.ztree li span.button.chk.radio_true_full { + background-position: -42px 0; +} +.ztree li span.button.chk.radio_true_full_focus { + background-position: -42px -14px; +} +.ztree li span.button.chk.radio_true_part { + background-position: -42px -28px; +} +.ztree li span.button.chk.radio_true_part_focus { + background-position: -42px -42px; +} +.ztree li span.button.chk.checkbox_true_full + a { + color: #3685f2; +} +.ztree li span.button.chk.checkbox_true_full_focus + a { + color: #3685f2; +} +.ztree li span.button.chk.checkbox_true_part + a { + color: #3685f2; +} +.ztree li span.button.chk.checkbox_true_part_focus + a { + color: #3685f2; +} +.ztree li span.button.chk.radio_true_disable { + background-position: -42px -56px; +} +.ztree li span.button.switch { + width: 25px; + height: 25px; +} +.ztree li span.button.noline_open { + background-position: -92px -72px; +} +.ztree li span.button.noline_close { + background-position: -74px -72px; +} +.ztree li span.button.root_docu { + background: none; +} +.ztree li span.button.noline_docu { + background: none; +} +.ztree li span.button.ico_open { + margin-right: 2px; + background-position: -110px -16px; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.ico_close { + margin-right: 2px; + background-position: -110px 0; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.ico_docu { + margin-right: 2px; + background-position: -110px -32px; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.edit { + margin-right: 2px; + background-position: -110px -48px; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.remove { + margin-right: 2px; + background-position: -110px -64px; + vertical-align: top; + *vertical-align: middle; +} +.ztree li span.button.ico_loading { + width: 0px; + margin-right: 2px; + vertical-align: top; + *vertical-align: middle; +} +ul.tmpTargetzTree { + background-color: #FFE6B0; + opacity: 0.8; + filter: alpha(opacity=80); +} +span.tmpzTreeMove_arrow { + width: 16px; + height: 16px; + display: inline-block; + padding: 0; + margin: 2px 0 0 1px; + border: 0 none; + position: absolute; + background-color: transparent; + background-repeat: no-repeat; + background-attachment: scroll; + background-position: -110px -80px; +} +ul.ztree.zTreeDragUL { + margin: 0; + padding: 0; + position: absolute; + width: auto; + height: auto; + overflow: hidden; + background-color: #cfcfcf; + border: 1px #00B83F dotted; + opacity: 0.8; + filter: alpha(opacity=80); +} +.zTreeMask { + z-index: 10000; + background-color: #cfcfcf; + opacity: 0.0; + filter: alpha(opacity=0); + position: absolute; +} +/* level style*/ +/*.ztree li span.button.level0 { + display:none; +} +.ztree li ul.level0 { + padding:0; + background:none; +}*/ + + +.bi-trigger .bi-trigger-icon-button { + font-size: 16px; +} + +.bi-select-text-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +.bi-small-select-text-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-popover { + border: 1px solid transparent; +} +/**********BI.BIListView*************/ +.bi-popup-view { + position: fixed !important; + overflow-y: visible !important; + overflow-x: visible !important; + overflow: visible !important; + cursor: default; +} +.bi-popup-view .list-view-outer { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-popup-view .padding-outer { + padding-top: 5px; + padding-bottom: 5px; +} +.bi-popup-view .list-view-shadow { + -webkit-box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); + -moz-box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); + box-shadow: 0 1px 5px 0 rgba(35, 46, 64, 0.2); +} +.bi-popup-view .list-view-toolbar { + line-height: 24px; +} +.bi-popup-view .list-view-toolbar > .center-element { + border-left: 1px solid #e8eaed; +} +.bi-popup-view .list-view-toolbar > .first-element { + border-left: none; +} +.bi-theme-dark .bi-popup-view .list-view-toolbar > .center-element { + border-left: 1px solid #363e55; +} +.bi-theme-dark .bi-popup-view .list-view-toolbar > .first-element { + border-left: none; +} +.bi-theme-dark .list-view-shadow { + -webkit-box-shadow: 0 1px 5px 0 rgba(25, 27, 43, 0.8); + -moz-box-shadow: 0 1px 5px 0 rgba(25, 27, 43, 0.8); + box-shadow: 0 1px 5px 0 rgba(25, 27, 43, 0.8); +} +.bi-date-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-down-list-popup .list-group-item-text { + max-width: 203px; +} +.bi-down-list-popup .bi-down-list-item .list-item-text { + max-width: 203px; +} +.bi-dynamic-date-combo .date-font { + font-size: 16px; +} +.bi-interactive-arrangement .interactive-arrangement-dragtag-line { + z-index: 1000000000; + background-color: #faaa39; +} +.bi-interactive-arrangement .interactive-arrangement-dragtag-icon { + z-index: 1000000000; +} +.bi-interval-slider-label { + min-height: 50px; +} + +.bi-interval-slider { + min-height: 50px; +} +.bi-month-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-multilayer-select-tree-combo .trigger-icon-button { + font-size: 16px; +} +.bi-multilayer-select-tree-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multilayer-select-tree-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.bi-multilayer-select-level-tree .tree-view { + min-width: 100%; +} +.bi-multilayer-single-tree-combo .trigger-icon-button { + font-size: 16px; +} +.bi-multilayer-single-tree-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multilayer-single-tree-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.bi-multilayer-single-level-tree .tree-view { + min-width: 100%; +} +.bi-multi-select-check-pane .multi-select-check-selected { + text-decoration: underline; +} + +.bi-multi-select-combo .multi-select-trigger-icon-button { + font-size: 16px; +} +.bi-multi-select-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multi-select-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + +.bi-multi-select-insert-combo .multi-select-trigger-icon-button { + font-size: 16px; +} +.bi-multi-select-insert-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multi-select-insert-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} + + +.bi-multi-select-search-pane .multi-select-toolbar { + color: #faaa39; +} +.bi-multi-select-check-selected-button { + z-index: 1; + min-width: 16px; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; +} +.bi-multi-select-insert-list .bi-search-editor { + -moz-border-radius-bottomleft: 0px; + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + border-bottom-right-radius: 0px; + border-bottom-left-radius: 0px; +} + +.bi-multi-select-list .bi-search-editor { + -moz-border-radius-bottomleft: 0px; + -webkit-border-bottom-left-radius: 0px; + -moz-border-radius-bottomright: 0px; + -webkit-border-bottom-right-radius: 0px; + border-bottom-right-radius: 0px; + border-bottom-left-radius: 0px; +} +.bi-multi-tree-check-pane .multi-tree-check-selected { + color: #3685f2; +} +.bi-multi-tree-combo .multi-select-trigger-icon-button { + font-size: 16px; +} +.bi-multi-tree-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multi-tree-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-multi-tree-popup .popup-view-tree { + min-height: 170px; +} +.bi-multi-tree-check-selected-button .trigger-check-selected { + color: #3685f2; + z-index: 1; +} +.bi-number-editor { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-number-editor .pull-down-font { + font-size: 12px; +} +.bi-number-editor .pull-up-font { + font-size: 12px; +} +.bi-number-interval.hack { + -webkit-border-radius: 0px; + -moz-border-radius: 0px; + border-radius: 0px; +} +.bi-number-interval .number-interval-small-editor { + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + -moz-border-radius-bottomleft: 2px; + -webkit-border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} +.bi-number-interval .number-interval-big-editor { + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + -moz-border-radius-bottomright: 2px; + -webkit-border-bottom-right-radius: 2px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; +} +.bi-number-interval .number-interval-big-combo { + -moz-border-radius-topleft: 2px; + -webkit-border-top-left-radius: 2px; + -moz-border-radius-bottomleft: 2px; + -webkit-border-bottom-left-radius: 2px; + border-top-left-radius: 2px; + border-bottom-left-radius: 2px; +} +.bi-number-interval .number-interval-big-combo .bi-icon-combo-trigger .icon-combo-trigger-icon { + font-size: 14px; +} +.bi-number-interval .number-interval-small-combo { + -moz-border-radius-topright: 2px; + -webkit-border-top-right-radius: 2px; + -moz-border-radius-bottomright: 2px; + -webkit-border-bottom-right-radius: 2px; + border-top-right-radius: 2px; + border-bottom-right-radius: 2px; +} +.bi-number-interval .number-interval-small-combo .bi-icon-combo-trigger .icon-combo-trigger-icon { + font-size: 14px; +} +.bi-number-interval.number-error .bi-input { + color: #e65251 !important; +} +.bi-quarter-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-search-multi-text-value-combo .multi-select-trigger-icon-button { + font-size: 16px; +} +.bi-search-multi-text-value-combo.combo-error .bi-multi-select-searcher .tip-text-style { + color: #e65251; +} +.bi-single-select-combo .single-select-trigger-icon-button { + font-size: 16px; +} +.bi-single-select-combo .bi-combo.bi-combo-popup + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(180deg); + -moz-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-single-select-combo .bi-combo + .bi-trigger-icon-button .x-icon { + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + transform: rotate(0deg); + -webkit-transition: transform 0.3s ease; + -moz-transition: transform 0.3s ease; + -o-transition: transform 0.3s ease; + transition: transform 0.3s ease; +} +.bi-single-slider-label { + min-height: 50px; +} + +.bi-single-slider-normal { + min-height: 30px; +} +.bi-single-slider { + min-height: 50px; +} +.bi-single-slider-button .slider-button { + cursor: ew-resize; + border-width: 2px; + border-style: solid; + -webkit-border-radius: 8px; + -moz-border-radius: 8px; + border-radius: 8px; + background-color: #ffffff; + height: 12px; + width: 12px; + top: 6px; + left: -8px; +} +.bi-single-slider-button .slider-button:hover, +.bi-single-slider-button .slider-button.hover { + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + background-color: #f7f8fa; + width: 16px; + height: 16px; + top: 4px; + left: -10px; +} +.bi-single-slider-button .slider-button.disabled { + border-color: #d0d4da; +} +.bi-single-slider-button .slider-button.disabled:hover, +.bi-single-slider-button .slider-button.disabled.hover { + background-color: #f7f8fa; + width: 12px; + height: 12px; + top: 6px; + left: -8px; +} +.bi-theme-dark .bi-single-slider-button .slider-button { + background-color: #20263b; +} +.bi-theme-dark .bi-single-slider-button .slider-button:hover, +.bi-theme-dark .bi-single-slider-button .slider-button.hover { + background-color: #191b2b; +} +.bi-theme-dark .bi-single-slider-button .slider-button.disabled:hover, +.bi-theme-dark .bi-single-slider-button .slider-button.disabled.hover { + background-color: #191b2b; +} +.bi-slider-track .gray-track { + background-color: rgba(61, 77, 102, 0.1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#1a3d4d66,endColorstr=#1a3d4d66); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-slider-track .blue-track { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-slider-track .disabled-blue-track { + background-color: #d0d4da; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-theme-dark .bi-slider-track .gray-track { + background-color: rgba(214, 224, 220, 0.1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#1ad6e0dc,endColorstr=#1ad6e0dc); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-theme-dark .bi-slider-track .disabled-blue-track { + background-color: #606479; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.bi-time-trigger .show-text { + background-color: rgba(255, 255, 255, 0); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00ffffff,endColorstr=#00ffffff); +} +.bi-date-interval.time-error .bi-input { + color: #e65251; +} +.bi-date-interval.time-error .sign-editor-text { + color: #e65251; +} +.bi-time-interval .bi-date-time-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-time-interval.time-error .bi-date-time-trigger .bi-input { + color: #e65251; +} +.bi-time-interval.time-error .bi-date-time-trigger .sign-editor-text { + color: #e65251; +} +.bi-year-popup .year-popup-navigation { + line-height: 30px; +} +.bi-year-popup .year-popup-navigation > .center-element { + border-left: 1px solid #e8eaed; +} +.bi-year-popup .year-popup-navigation > .first-element { + border-left: none; +} +.bi-theme-dark .bi-year-popup .year-popup-navigation > .center-element { + border-left: 1px solid #363e55; +} +.bi-theme-dark .bi-year-popup .year-popup-navigation > .first-element { + border-left: none; +} +.bi-year-trigger { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} +.bi-year-month-interval.time-error .bi-input { + color: #e65251; +} +.bi-year-month-interval.time-error .sign-editor-text { + color: #e65251; +} +html { + height: 100%; + overflow: hidden; +} +body { + position: absolute; + width: 100%; + height: 100%; + margin: 0; + padding: 0; + top: 0; + left: 0; + background-repeat: repeat; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + color: #3d4d66; + font: normal 12px "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Heiti, "黑体", sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + text-decoration: none; + -kthml-user-focus: normal; + -moz-user-focus: normal; + -moz-outline: 0 none; + outline: 0 none; +} +div::-webkit-scrollbar, +textarea::-webkit-scrollbar { + -webkit-appearance: none; + width: 10px; + height: 10px; +} +div::-webkit-scrollbar-track, +textarea::-webkit-scrollbar-track { + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + background-color: rgba(35, 46, 64, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d232e40,endColorstr=#0d232e40); +} +div::-webkit-scrollbar-track:hover, +textarea::-webkit-scrollbar-track:hover { + background-color: rgba(35, 46, 64, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0d232e40,endColorstr=#0d232e40); +} +div::-webkit-scrollbar-thumb, +textarea::-webkit-scrollbar-thumb { + border: 2px solid transparent; + background-clip: padding-box; + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + background-color: rgba(35, 46, 64, 0.1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#1a232e40,endColorstr=#1a232e40); +} +div::-webkit-scrollbar-thumb:hover, +textarea::-webkit-scrollbar-thumb:hover { + background-color: rgba(35, 46, 64, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d232e40,endColorstr=#4d232e40); +} +div::-webkit-scrollbar-corner, +textarea::-webkit-scrollbar-corner { + background-color: transparent; +} +.bi-theme-dark div::-webkit-scrollbar, +.bi-theme-dark textarea::-webkit-scrollbar { + -webkit-appearance: none; +} +.bi-theme-dark div::-webkit-scrollbar-track, +.bi-theme-dark textarea::-webkit-scrollbar-track { + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark div::-webkit-scrollbar-track:hover, +.bi-theme-dark textarea::-webkit-scrollbar-track:hover { + background-color: rgba(255, 255, 255, 0.05); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#0dffffff,endColorstr=#0dffffff); +} +.bi-theme-dark div::-webkit-scrollbar-thumb, +.bi-theme-dark textarea::-webkit-scrollbar-thumb { + background-color: rgba(255, 255, 255, 0.1); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#1affffff,endColorstr=#1affffff); +} +.bi-theme-dark div::-webkit-scrollbar-thumb:hover, +.bi-theme-dark textarea::-webkit-scrollbar-thumb:hover { + background-color: rgba(255, 255, 255, 0.3); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4dffffff,endColorstr=#4dffffff); +} +.bi-farbtastic .wheel { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/wheel.png') no-repeat center center; +} +.bi-farbtastic .overlay { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/mask.png') no-repeat center center; +} +.bi-farbtastic .marker { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/marker.png') no-repeat center center; +} +.bi-display-tree .ztree li span.button.switch.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree li span.button.switch.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree li span.button.switch.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-display-tree .ztree.hack li span.button.switch.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-display-tree .ztree.hack li span.button.switch.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-display-tree .ztree.hack li span.button.switch.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.ztree li ul.line { + position: relative; +} +.ztree li ul.line:before { + position: absolute; + content: ''; + border-left: 1px dashed #D0D4DA; + height: calc(100% - 3px); + left: 12px; + margin-top: 1px; +} +.ztree.hack li ul.line { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_1.png') repeat-y 1px 0; +} +.bi-theme-dark .ztree li ul.line:before { + border-left: 1px dashed #606479; +} +.bi-theme-dark .ztree.hack li ul.line { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 1px 0; +} +.ztree li span.button.chk.checkbox_false_full { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_full_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_part { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_false_part_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_full { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_full_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_part { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree li span.button.chk.checkbox_true_part_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.chk.checkbox_false_full { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_full_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_part { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_false_part_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_full { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_active.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_full_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_active.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_part { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree.hack li span.button.chk.checkbox_true_part_focus { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; +} +.ztree li span.button.root_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.root_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_1.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.root_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.root_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_1.png') no-repeat center center; +} +.ztree li span.button.root_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.root_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_1.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.root_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.root_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; +} +.ztree li span.button.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_2.png') no-repeat center center; +} +.ztree li span.button.roots_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; +} +.ztree li span.button.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_3.png') no-repeat center center; +} +.ztree li span.button.center_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; +} +.ztree li span.button.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_open { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_4.png') no-repeat center center; +} +.ztree li span.button.bottom_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_close { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; +} +.ztree li span.button.roots_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.roots_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.roots_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.roots_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.ztree li span.button.center_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.center_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.center_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.center_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.ztree li span.button.bottom_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.bottom_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .ztree li span.button.bottom_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .ztree.hack li span.button.bottom_docu { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.ztree li span.button.ico_loading { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/loading.gif') no-repeat center center; + background-size: contain; +} +.ztree.hack li span.button.ico_loading { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/loading.gif') no-repeat center center; +} +.base-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_1.png') repeat-y 0 0; +} +.bi-theme-dark .base-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_1.png') repeat-y 0 0; +} +.first-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .first-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.mid-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .mid-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.last-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .last-line-conn-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.loading-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/loading.gif') no-repeat center center; + background-size: contain; +} +.auto-color-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/auto_color.png') no-repeat center center; + background-size: contain; +} +.auto-color-normal-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/auto_color_normal.png') no-repeat center center; + background-size: contain; +} +.auto-color-normal-disabled-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/auto_color_normal_disable.png') no-repeat center center; + background-size: contain; +} +.trans-color-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/trans_normal.png') no-repeat center center; + background-size: contain; +} +.trans-color-disabled-background { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/background/trans_disable.png') no-repeat center center; + background-size: contain; +} +.auto-color-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/auto_color.png') no-repeat center center; +} +.auto-color-normal-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/auto_color_normal.png') no-repeat center center; +} +.auto-color-normal-disabled-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/auto_color_normal_disable.png') no-repeat center center; +} +.trans-color-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/trans_normal.png') no-repeat center center; +} +.trans-color-disabled-background.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/background/trans_disable.png') no-repeat center center; +} +.wave-loading { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/wave_loading.gif') no-repeat center center; + background-size: contain; +} +.wave-loading.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/wave_loading.gif') no-repeat center center; +} +@font-face { + font-family: "fineui"; + src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot'); + src: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.woff') format('woff'), /* chrome、firefox */ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/font/iconfont.svg#svgFontName') format('svg'); + /* iOS 4.1- */ +} +.b-font { + font-family: 'fineui'; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.close-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.close-font .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-font.disabled .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.close-h-font .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-h-font:hover .b-font:before, +.close-h-font.hover .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-h-font.disabled .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.close-ha-font .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-ha-font:hover .b-font:before, +.close-ha-font.hover .b-font:before { + content: "\e6d0"; + color: inherit; +} +.close-ha-font:active .b-font:before, +.close-ha-font.active .b-font:before { + content: "\e6d0"; + color: #3f8ce8; +} +.close-ha-font.disabled .b-font:before { + content: "\e6d0"; + color: inherit; +} +.circle-close-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.circle-close-font .b-font:before { + content: "\e6d5"; + color: inherit; +} +.circle-close-font.disabled .b-font:before { + content: "\e6d5"; + color: inherit; +} +.search-close-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.search-close-h-font .b-font:before { + content: "\e6d0"; + color: inherit; +} +.search-close-h-font:hover .b-font:before, +.search-close-h-font.hover .b-font:before { + content: "\e6d0"; + color: #e65251; +} +.search-close-h-font.disabled .b-font:before { + content: "\e6d0"; + color: inherit; +} +.pre-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pre-page-h-font .b-font:before { + content: "\e70d"; + color: inherit; +} +.pre-page-h-font:hover .b-font:before, +.pre-page-h-font.hover .b-font:before { + content: "\e70d"; + color: inherit; +} +.pre-page-h-font.disabled .b-font:before { + content: "\e70d"; + color: inherit; +} +.next-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.next-page-h-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.next-page-h-font:hover .b-font:before, +.next-page-h-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.next-page-h-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.search-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.search-font .b-font:before { + content: "\e6dc"; + color: inherit; +} +.search-font.disabled .b-font:before { + content: "\e6dc"; + color: inherit; +} +.date-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.date-font .b-font:before { + content: "\e733"; + color: inherit; +} +.date-font.disabled .b-font:before { + content: "\e733"; + color: inherit; +} +.time-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.time-font .b-font:before { + content: "\e6b1"; + color: inherit; +} +.time-font.disabled .b-font:before { + content: "\e6b1"; + color: inherit; +} +.date-change-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.date-change-h-font .b-font:before { + content: "\e72f"; + color: inherit; +} +.date-change-h-font:hover .b-font:before, +.date-change-h-font.hover .b-font:before { + content: "\e72f"; + color: inherit; +} +.date-change-h-font.disabled .b-font:before { + content: "\e72f"; + color: inherit; +} +.dot-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.dot-font .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-font.disabled .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.dot-h-font .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-h-font:hover .b-font:before, +.dot-h-font.hover .b-font:before { + content: "\e762"; + color: inherit; +} +.dot-h-font.disabled .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.dot-ha-font .b-font:before { + content: "\e762"; + color: #ffffff; +} +.dot-ha-font:hover .b-font:before, +.dot-ha-font.hover .b-font:before { + content: "\e762"; + color: #999999; +} +.dot-ha-font:active .b-font:before, +.dot-ha-font.active .b-font:before { + content: "\e762"; + color: #232e40; +} +.dot-ha-font.disabled .b-font:before { + content: "\e762"; + color: #ffffff; +} +.dot-e-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.dot-e-font .b-font:before { + content: "\e762"; + color: transparent; +} +.dot-e-font:hover .b-font:before, +.dot-e-font.hover .b-font:before { + content: "\e762"; + color: transparent; +} +.dot-e-font:active .b-font:before { + content: "\e762"; + color: transparent; +} +.dot-e-font.active .b-font:before { + content: "\e762"; + color: #3685f2; +} +.dot-e-font.disabled .b-font:before { + content: "\e762"; + color: transparent; +} +.pull-right-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-right-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-right-h-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-h-font:hover .b-font:before, +.pull-right-h-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-h-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-right-ha-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-ha-font:hover .b-font:before, +.pull-right-ha-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-ha-font:active .b-font:before, +.pull-right-ha-font.active .b-font:before { + content: "\e70c"; + color: #3f8ce8; +} +.pull-right-ha-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-e-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-right-e-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-e-font:hover .b-font:before, +.pull-right-e-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.pull-right-e-font:active .b-font:before { + content: "\e70c"; + color: #3f8ce8; +} +.pull-right-e-font.active .b-font:before { + content: "\e70c"; + color: #3f8ce8; +} +.pull-right-e-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.copy-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.copy-font .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-font.disabled .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.copy-h-font .b-font:before { + content: "\e6bd"; + color: #232e40; +} +.copy-h-font:hover .b-font:before, +.copy-h-font.hover .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-h-font.disabled .b-font:before { + content: "\e6bd"; + color: #232e40; +} +.copy-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.copy-ha-font .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-ha-font:hover .b-font:before, +.copy-ha-font.hover .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-ha-font:active .b-font:before, +.copy-ha-font.active .b-font:before { + content: "\e6bd"; + color: #3f8ce8; +} +.copy-ha-font.disabled .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-e-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.copy-e-font .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-e-font:hover .b-font:before, +.copy-e-font.hover .b-font:before { + content: "\e6bd"; + color: inherit; +} +.copy-e-font:active .b-font:before { + content: "\e6bd"; + color: #3f8ce8; +} +.copy-e-font.active .b-font:before { + content: "\e6bd"; + color: #3f8ce8; +} +.copy-e-font.disabled .b-font:before { + content: "\e6bd"; + color: inherit; +} +.check-mark-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-mark-font .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-font.disabled .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-mark-h-font .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-h-font:hover .b-font:before, +.check-mark-h-font.hover .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-h-font.disabled .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-mark-ha-font .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-ha-font:hover .b-font:before, +.check-mark-ha-font.hover .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-ha-font:active .b-font:before, +.check-mark-ha-font.active .b-font:before { + content: "\e6cf"; + color: #3f8ce8; +} +.check-mark-ha-font.disabled .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-e-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-mark-e-font .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-e-font:hover .b-font:before, +.check-mark-e-font.hover .b-font:before { + content: "\e6cf"; + color: inherit; +} +.check-mark-e-font:active .b-font:before { + content: "\e6cf"; + color: #3f8ce8; +} +.check-mark-e-font.active .b-font:before { + content: "\e6cf"; + color: #3f8ce8; +} +.check-mark-e-font.disabled .b-font:before { + content: "\e6cf"; + color: inherit; +} +/** dashboard组件/控件 下拉列表图标字体 ~end~**/ +.row-pre-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.row-pre-page-h-font .b-font:before { + content: "\e70d"; + color: inherit; +} +.row-pre-page-h-font:hover .b-font:before, +.row-pre-page-h-font.hover .b-font:before { + content: "\e70d"; + color: inherit; +} +.row-pre-page-h-font.disabled .b-font:before { + content: "\e70d"; + color: inherit; +} +.row-next-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.row-next-page-h-font .b-font:before { + content: "\e70c"; + color: inherit; +} +.row-next-page-h-font:hover .b-font:before, +.row-next-page-h-font.hover .b-font:before { + content: "\e70c"; + color: inherit; +} +.row-next-page-h-font.disabled .b-font:before { + content: "\e70c"; + color: inherit; +} +.column-pre-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.column-pre-page-h-font .b-font:before { + content: "\e70a"; + color: inherit; +} +.column-pre-page-h-font:hover .b-font:before, +.column-pre-page-h-font.hover .b-font:before { + content: "\e70a"; + color: inherit; +} +.column-pre-page-h-font.disabled .b-font:before { + content: "\e70a"; + color: inherit; +} +.column-next-page-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.column-next-page-h-font .b-font:before { + content: "\e70b"; + color: inherit; +} +.column-next-page-h-font:hover .b-font:before, +.column-next-page-h-font.hover .b-font:before { + content: "\e70b"; + color: inherit; +} +.column-next-page-h-font.disabled .b-font:before { + content: "\e70b"; + color: inherit; +} +.expander-right-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.expander-right-font .b-font:before { + content: "\e6d8"; + color: inherit; +} +.expander-right-font.disabled .b-font:before { + content: "\e6d8"; + color: inherit; +} +.expander-down-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.expander-down-font .b-font:before { + content: "\e6d7"; + color: inherit; +} +.expander-down-font.disabled .b-font:before { + content: "\e6d7"; + color: inherit; +} +.solid-triangle-top-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.solid-triangle-top-font .b-font:before { + content: "\e6d6"; + color: inherit; +} +.solid-triangle-top-font:hover .b-font:before, +.solid-triangle-top-font.hover .b-font:before { + content: "\e6d6"; + color: inherit; +} +.solid-triangle-top-font.disabled .b-font:before { + content: "\e6d6"; + color: inherit; +} +.solid-triangle-bottom-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.solid-triangle-bottom-font .b-font:before { + content: "\e6d7"; + color: inherit; +} +.solid-triangle-bottom-font:hover .b-font:before, +.solid-triangle-bottom-font.hover .b-font:before { + content: "\e6d7"; + color: inherit; +} +.solid-triangle-bottom-font.disabled .b-font:before { + content: "\e6d7"; + color: inherit; +} +.trigger-triangle-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.trigger-triangle-font .b-font:before { + content: "\e64e"; + color: inherit; +} +.trigger-triangle-font.disabled .b-font:before { + content: "\e64e"; + color: inherit; +} +.pull-up-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-up-font .b-font:before { + content: "\e70a"; + color: inherit; +} +.pull-up-font.disabled .b-font:before { + content: "\e70a"; + color: inherit; +} +.pull-down-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-down-font .b-font:before { + content: "\e70b"; + color: inherit; +} +.pull-down-font.disabled .b-font:before { + content: "\e70b"; + color: inherit; +} +.pull-down-h-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-down-h-font .b-font:before { + content: "\e70b"; + color: #647185; +} +.pull-down-h-font:hover .b-font:before, +.pull-down-h-font.hover .b-font:before { + content: "\e70b"; + color: inherit; +} +.pull-down-h-font.disabled .b-font:before { + content: "\e70b"; + color: #647185; +} +.pull-down-ha-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.pull-down-ha-font .b-font:before { + content: "\e70b"; + color: #647185; +} +.pull-down-ha-font:hover .b-font:before, +.pull-down-ha-font.hover .b-font:before { + content: "\e70b"; + color: inherit; +} +.pull-down-ha-font:active .b-font:before, +.pull-down-ha-font.active .b-font:before { + content: "\e70b"; + color: #3f8ce8; +} +.pull-down-ha-font.disabled .b-font:before { + content: "\e70b"; + color: #647185; +} +.check-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.check-font .b-font:before { + content: "\e6cf"; + color: #3685f2; +} +.check-font.disabled .b-font:before { + content: "\e6cf"; + color: #3685f2; +} +.item-check-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.item-check-font .b-font:before { + content: "\e6cf"; + color: #ffffff; +} +.item-check-font:hover .b-font:before, +.item-check-font.hover .b-font:before { + content: "\e6cf"; + color: #999999; +} +.item-check-font:active .b-font:before, +.item-check-font.active .b-font:before { + content: "\e6cf"; + color: #3f8ce8; +} +.item-check-font.disabled .b-font:before { + content: "\e6cf"; + color: #ffffff; +} +.primary-key-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.primary-key-font .b-font:before { + content: "\e740"; + color: inherit; +} +.primary-key-font:hover .b-font:before, +.primary-key-font.hover .b-font:before { + content: "\e740"; + color: inherit; +} +.primary-key-font.disabled .b-font:before { + content: "\e740"; + color: inherit; +} +.drag-tag-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.drag-tag-font .b-font:before { + content: "\e6d0"; + color: #faaa39; +} +.drag-tag-font.disabled .b-font:before { + content: "\e6d0"; + color: #faaa39; +} +.less-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.less-font .b-font:before { + content: "\e75e"; + color: inherit; +} +.less-font.disabled .b-font:before { + content: "\e75e"; + color: inherit; +} +.less-equal-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.less-equal-font .b-font:before { + content: "\e761"; + color: inherit; +} +.less-equal-font.disabled .b-font:before { + content: "\e761"; + color: inherit; +} +.text-bold-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-bold-font .b-font:before { + content: "\e697"; + color: inherit; +} +.text-bold-font.disabled .b-font:before { + content: "\e697"; + color: inherit; +} +.text-italic-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-italic-font .b-font:before { + content: "\e69d"; + color: inherit; +} +.text-italic-font.disabled .b-font:before { + content: "\e69d"; + color: inherit; +} +.text-underline-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-underline-font .b-font:before { + content: "\e69c"; + color: inherit; +} +.text-underline-font.disabled .b-font:before { + content: "\e69c"; + color: inherit; +} +.text-color-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-color-font .b-font:before { + content: "\e698"; + color: inherit; +} +.text-color-font.disabled .b-font:before { + content: "\e698"; + color: inherit; +} +.text-background-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-background-font .b-font:before { + content: "\e699"; + color: inherit; +} +.text-background-font.disabled .b-font:before { + content: "\e699"; + color: inherit; +} +.text-color-underline-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-color-underline-font .b-font:before { + content: "\e69a"; + color: inherit; +} +.text-color-underline-font.disabled .b-font:before { + content: "\e69a"; + color: inherit; +} +.text-align-left-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-align-left-font .b-font:before { + content: "\e6ca"; + color: inherit; +} +.text-align-left-font.disabled .b-font:before { + content: "\e6ca"; + color: inherit; +} +.text-align-center-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-align-center-font .b-font:before { + content: "\e6bf"; + color: inherit; +} +.text-align-center-font.disabled .b-font:before { + content: "\e6bf"; + color: inherit; +} +.text-align-right-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-align-right-font .b-font:before { + content: "\e6c8"; + color: inherit; +} +.text-align-right-font.disabled .b-font:before { + content: "\e6c8"; + color: inherit; +} +.toast-error-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.toast-error-font .b-font:before { + content: "\e757"; + color: inherit; +} +.toast-error-font.disabled .b-font:before { + content: "\e757"; + color: inherit; +} +.toast-success-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.toast-success-font .b-font:before { + content: "\e756"; + color: inherit; +} +.toast-success-font.disabled .b-font:before { + content: "\e756"; + color: inherit; +} +.toast-warning-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.toast-warning-font .b-font:before { + content: "\e755"; + color: inherit; +} +.toast-warning-font.disabled .b-font:before { + content: "\e755"; + color: inherit; +} +.toast-message-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.toast-message-font .b-font:before { + content: "\e74b"; + color: inherit; +} +.toast-message-font.disabled .b-font:before { + content: "\e74b"; + color: inherit; +} +.text-add-tip-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.text-add-tip-font .b-font:before { + content: "\e6dd"; + color: #13cd66; +} +.text-add-tip-font.disabled .b-font:before { + content: "\e6dd"; + color: #13cd66; +} +.add-up-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.add-up-font .b-font:before { + content: "\e70a"; + color: inherit; +} +.add-up-font.disabled .b-font:before { + content: "\e70a"; + color: inherit; +} +.minus-down-font .b-font { + *zoom: expression( this.runtimeStyle['zoom'] = '1',this.innerHTML = ''); +} +.minus-down-font .b-font:before { + content: "\e70b"; + color: inherit; +} +.minus-down-font.disabled .b-font:before { + content: "\e70b"; + color: inherit; +} +.tree-collapse-icon-type1 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.tree-collapse-icon-type1 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_1.png') no-repeat center center; +} +.tree-collapse-icon-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.tree-collapse-icon-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_2.png') no-repeat center center; +} +.tree-collapse-icon-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.tree-collapse-icon-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_3.png') no-repeat center center; +} +.tree-collapse-icon-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.tree-collapse-icon-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_collapse_4.png') no-repeat center center; +} +.tree-expand-icon-type1 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.tree-expand-icon-type1 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_1.png') no-repeat center center; +} +.tree-expand-icon-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.tree-expand-icon-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_2.png') no-repeat center center; +} +.tree-expand-icon-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.tree-expand-icon-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_3.png') no-repeat center center; +} +.tree-expand-icon-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.tree-expand-icon-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_expand_4.png') no-repeat center center; +} +.tree-vertical-line-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.tree-vertical-line-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_2.png') no-repeat center center; +} +.tree-vertical-line-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.tree-vertical-line-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_3.png') no-repeat center center; +} +.tree-vertical-line-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.tree-vertical-line-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/tree_vertical_line_4.png') no-repeat center center; +} +.bi-theme-dark .tree-collapse-icon-type1 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-collapse-icon-type1 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_1.png') no-repeat center center; +} +.bi-theme-dark .tree-collapse-icon-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-collapse-icon-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_2.png') no-repeat center center; +} +.bi-theme-dark .tree-collapse-icon-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-collapse-icon-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_3.png') no-repeat center center; +} +.bi-theme-dark .tree-collapse-icon-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_collapse_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-collapse-icon-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_collapse_4.png') no-repeat center center; +} +.bi-theme-dark .tree-expand-icon-type1 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_1.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-expand-icon-type1 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_1.png') no-repeat center center; +} +.bi-theme-dark .tree-expand-icon-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-expand-icon-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_2.png') no-repeat center center; +} +.bi-theme-dark .tree-expand-icon-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-expand-icon-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_3.png') no-repeat center center; +} +.bi-theme-dark .tree-expand-icon-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_expand_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-expand-icon-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_expand_4.png') no-repeat center center; +} +.bi-theme-dark .tree-vertical-line-type2 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_2.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-vertical-line-type2 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_2.png') no-repeat center center; +} +.bi-theme-dark .tree-vertical-line-type3 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_3.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-vertical-line-type3 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_3.png') no-repeat center center; +} +.bi-theme-dark .tree-vertical-line-type4 .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/dark/tree_vertical_line_4.png') no-repeat center center; + background-size: contain; +} +.bi-theme-dark .tree-vertical-line-type4 .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/dark/tree_vertical_line_4.png') no-repeat center center; +} +.check-box-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.check-box-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.check-box-icon:hover .x-icon, +.check-box-icon.hover .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.check-box-icon:hover .x-icon.hack, +.check-box-icon.hover .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.check-box-icon:active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_normal.png') no-repeat center center; + background-size: contain; +} +.check-box-icon:active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_normal.png') no-repeat center center; +} +.check-box-icon.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_active.png') no-repeat center center; + background-size: contain; +} +.check-box-icon.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_active.png') no-repeat center center; +} +.check-box-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_disable.png') no-repeat center center; + background-size: contain; +} +.check-box-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_disable.png') no-repeat center center; +} +.check-box-icon.disabled.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/check_box_disable2.png') no-repeat center center; + background-size: contain; +} +.check-box-icon.disabled.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/check_box_disable2.png') no-repeat center center; +} +.radio-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_normal.png') no-repeat center center; + background-size: contain; +} +.radio-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_normal.png') no-repeat center center; +} +.radio-icon:hover .x-icon, +.radio-icon.hover .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_normal.png') no-repeat center center; + background-size: contain; +} +.radio-icon:hover .x-icon.hack, +.radio-icon.hover .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_normal.png') no-repeat center center; +} +.radio-icon:active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_normal.png') no-repeat center center; + background-size: contain; +} +.radio-icon:active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_normal.png') no-repeat center center; +} +.radio-icon.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_active.png') no-repeat center center; + background-size: contain; +} +.radio-icon.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_active.png') no-repeat center center; +} +.radio-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_disable.png') no-repeat center center; + background-size: contain; +} +.radio-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_disable.png') no-repeat center center; +} +.radio-icon.disabled.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/radio_disable2.png') no-repeat center center; + background-size: contain; +} +.radio-icon.disabled.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/radio_disable2.png') no-repeat center center; +} +.check-half-select-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected.png') no-repeat center center; + background-size: contain; +} +.check-half-select-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected.png') no-repeat center center; +} +.check-half-select-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/half_selected_disable.png') no-repeat center center; + background-size: contain; +} +.check-half-select-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/half_selected_disable.png') no-repeat center center; +} +.slider-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/slider_normal_small.png') no-repeat center center; + background-size: contain; +} +.slider-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/slider_normal_small.png') no-repeat center center; +} +.slider-icon:hover .x-icon, +.slider-icon.hover .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/slider_active_small.png') no-repeat center center; + background-size: contain; +} +.slider-icon:hover .x-icon.hack, +.slider-icon.hover .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/slider_active_small.png') no-repeat center center; +} +.slider-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/slider_normal_small.png') no-repeat center center; + background-size: contain; +} +.slider-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/slider_normal_small.png') no-repeat center center; +} +.auto-color-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/auto_normal.png') no-repeat center center; + background-size: contain; +} +.auto-color-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/auto_normal.png') no-repeat center center; +} +.auto-color-icon.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/auto_select.png') no-repeat center center; + background-size: contain; +} +.auto-color-icon.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/auto_select.png') no-repeat center center; +} +.auto-color-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/auto_disable.png') no-repeat center center; + background-size: contain; +} +.auto-color-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/auto_disable.png') no-repeat center center; +} +.trans-color-icon .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/trans_normal.png') no-repeat center center; + background-size: contain; +} +.trans-color-icon .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/trans_normal.png') no-repeat center center; +} +.trans-color-icon.active .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/trans_select.png') no-repeat center center; + background-size: contain; +} +.trans-color-icon.active .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/trans_select.png') no-repeat center center; +} +.trans-color-icon.disabled .x-icon { + display: block; + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/2x/icon/trans_disable.png') no-repeat center center; + background-size: contain; +} +.trans-color-icon.disabled .x-icon.hack { + background: url('http://fine-design-storage.oss-cn-shanghai.aliyuncs.com/fineui/2.0/images/1x/icon/trans_disable.png') no-repeat center center; +} +.icon-size-12 .b-font { + font-size: 12px; +} +.icon-size-16 .b-font { + font-size: 16px; +} +.icon-size-24 .b-font { + font-size: 24px; +} +.icon-size-40 .b-font { + font-size: 40px; +} +.icon-size-50 .b-font { + font-size: 50px; +} +.icon-size-70 .b-font { + font-size: 70px; +} diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/fineui.ie.min.js b/designer-base/src/main/resources/com/fr/design/login/lib/fineui.ie.min.js new file mode 100644 index 000000000..02e3facce --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/fineui.ie.min.js @@ -0,0 +1,53 @@ +/*! fineui 2019-10-24 10:46:55 */ + +function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,null==_global.BI&&(_global.BI={prepares:[]}),null==_global.BI.prepares&&(_global.BI.prepares=[]),Array.prototype.indexOf||(Array.prototype.indexOf=function(searchElement,fromIndex){var k;if(null==this)throw new TypeError('"this" is null or not defined');var o=Object(this),len=o.length>>>0;if(0===len)return-1;var n=0|fromIndex;if(n>=len)return-1;for(k=Math.max(n>=0?n:len-Math.abs(n),0);k>>0;if(0===len)return-1;for(n=len-1,arguments.length>1&&(n=Number(arguments[1]),n!=n?n=0:0!=n&&n!=1/0&&n!=-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),k=n>=0?Math.min(n,len-1):len-Math.abs(n);k>=0;k--)if(k in t&&t[k]===searchElement)return k;return-1}),_global.console=_global.console||function(){var c={};return c.log=c.warn=c.debug=c.info=c.error=c.time=c.dir=c.profile=c.clear=c.exception=c.trace=c.assert=function(){},c}(),_global.localStorage||(_global.localStorage={items:{},setItem:function(k,v){BI.Cache.addCookie(k,v)},getItem:function(k){return BI.Cache.getCookie(k)},removeItem:function(k){BI.Cache.deleteCookie(k)},key:function(){},clear:function(){this.items={}}}),Object.keys||(Object.keys=function(o){if(o!==Object(o))throw new TypeError("Object.keys called on a non-object");var falsy,skipArray={__ob__:falsy,$accessors:falsy,$vbthis:falsy,$vbsetter:falsy},k=[],p;for(p in o)p in skipArray||Object.prototype.hasOwnProperty.call(o,p)&&k.push(p);return k}),Array.isArray||(Array.isArray=function(arg){return"[object Array]"===Object.prototype.toString.call(arg)}),"function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="".__proto__===String.prototype?function(object){return object.__proto__}:function(object){return object.constructor.prototype}),Date.now||(Date.now=function(){return(new Date).valueOf()}),"undefined"!=typeof Set&&Set.toString().match(/native code/)||(Set=function(){this.set={}},Set.prototype.has=function(key){return void 0!==this.set[key]},Set.prototype.add=function(key){this.set[key]=1},Set.prototype.clear=function(){this.set={}}),!function(window){var ua=window.navigator.userAgent.toLowerCase(),reg=/msie/;if(reg.test(ua)){var _sort=Array.prototype.sort;Array.prototype.sort=function(fn){if(fn&&"function"==typeof fn){if(this.length<2)return this;for(var i=0,j=i+1,l=this.length,tmp,r=!1,t=0;i0,r===!0&&(tmp=this[i],this[i]=this[j],this[j]=tmp);return this}return _sort.call(this)}}}(window);var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,null==_global.BI&&(_global.BI={prepares:[]}),null==_global.BI.prepares&&(_global.BI.prepares=[]),function(){function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayAggregator(array,setter,iteratee,accumulator){for(var index=-1,length=null==array?0:array.length;++index-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=null==array?0:array.length;++index-1;);return index}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function countHolders(array,placeholder){for(var length=array.length,result=0;length--;)array[length]===placeholder&&++result;return result}function getValue(object,key){return null==object?undefined:object[key]}function hasUnicode(string){return reHasUnicode.test(string)}function iteratorToArray(iterator){for(var data,result=[];!(data=iterator.next()).done;)result.push(data.value);return result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function replaceHolders(array,placeholder){for(var index=-1,length=array.length,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index=lower?number:lower)),number}function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),result!==undefined)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):copySymbols(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;if(stack.set(value,result),isSet(value))return value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))}),result;if(isMap(value))return value.forEach(function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack))}),result;var keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys,props=isArr?undefined:keysFunc(value);return arrayEach(props||value,function(subValue,key){props&&(key=subValue,subValue=value[key]),assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack))}),result}function baseDelay(func,wait,args){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return setTimeout(function(){func.apply(undefined,args)},wait)}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=LARGE_ARRAY_SIZE&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys)}function baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key])})}function baseGet(object,path){path=castPath(path,object);for(var index=0,length=path.length;null!=object&&indexother}function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function baseHasIn(object,key){return null!=object&&key in Object(object)}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++indexlength?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index=length?array:baseSlice(array,start,end)}function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)), +result}function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{}}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined,valIsNull=null===value,valIsReflexive=value===value,valIsSymbol=isSymbol(value),othIsDefined=other!==undefined,othIsNull=null===other,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;var order=orders[index];return result*("desc"==order?-1:1)}}return object.index-other.index}function composeArgs(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;++leftIndex1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):undefined,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?undefined:customizer,length=1),object=Object(object);++index-1?iterable[iteratee?collection[index]:index]:undefined}}function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){function wrapper(){for(var length=arguments.length,args=Array(length),index=length;index--;)args[index]=arguments[index];if(isCurried)var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);if(partials&&(args=composeArgs(args,partials,holders,isCurried)),partialsRight&&(args=composeArgsRight(args,partialsRight,holdersRight,isCurried)),length-=holdersCount,isCurried&&length1&&args.reverse(),isAry&&aryarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:undefined;for(stack.set(array,other),stack.set(other,array);++index1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isIndex(value,length){var type=typeof value;return length=null==length?MAX_SAFE_INTEGER:length,!!length&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value0){if(++count>=HOT_COUNT)return arguments[0]}else count=0;return func.apply(undefined,arguments)}}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function updateWrapDetails(details,bitmask){return arrayEach(wrapFlags,function(pair){var value="_."+pair[0];bitmask&pair[1]&&!arrayIncludes(details,value)&&details.push(value)}),details.sort()}function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper)return wrapper.clone();var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);return result.__actions__=copyArray(wrapper.__actions__),result.__index__=wrapper.__index__,result.__values__=wrapper.__values__,result}function compact(array){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index=this.__values__.length,value=done?undefined:this.__values__[this.__index__++];return{done:done,value:value}}function wrapperToIterator(){return this}function wrapperPlant(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=undefined,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result}function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),wrapped=wrapped.reverse(),wrapped.__actions__.push({func:thru,args:[reverse],thisArg:undefined}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,baseIteratee(predicate,3))}function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,baseIteratee(iteratee,3))}function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,baseIteratee(iteratee,3))}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee,4),accumulator,initAccum,baseEach)}function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(baseIteratee(predicate,3)))}function size(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length}function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),n<=1&&(func=undefined),result}}function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=undefined,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();return shouldInvoke(time)?trailingEdge(time):void(timerId=setTimeout(timerExpired,remainingWait(time)))}function trailingEdge(time){return timerId=undefined,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=undefined,result)}function cancel(){timerId!==undefined&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=undefined}function flush(){return timerId===undefined?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(timerId===undefined)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return timerId===undefined&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache), +memoized}function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}function once(func){return before(2,func)}function rest(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=start===undefined?start:toInteger(start),baseRest(func,start)}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG)}function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}function eq(value,other){return value===other||value!==value&&other!==other}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isBoolean(value){return value===!0||value===!1||isObjectLike(value)&&baseGetTag(value)==boolTag}function isEmpty(value){if(null==value)return!0;if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if(tag==mapTag||tag==setTag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0}function isEqual(value,other){return baseIsEqual(value,other)}function isFinite(value){return"number"==typeof value&&nativeIsFinite(value)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return null===value}function isNumber(value){return"number"==typeof value||isObjectLike(value)&&baseGetTag(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}function isUndefined(value){return value===undefined}function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(symIterator&&value[symIterator])return iteratorToArray(value[symIterator]());var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value)}function toFinite(value){if(!value)return 0===value?value:0;if(value=toNumber(value),value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toPlainObject(value){return copyObject(value,keysIn(value))}function toString(value){return null==value?"":baseToString(value)}function create(prototype,properties){var result=baseCreate(prototype);return null==properties?result:baseAssign(result,properties)}function findKey(object,predicate){return baseFindKey(object,baseIteratee(predicate,3),baseForOwn)}function findLastKey(object,predicate){return baseFindKey(object,baseIteratee(predicate,3),baseForOwnRight)}function get(object,path,defaultValue){var result=null==object?undefined:baseGet(object,path);return result===undefined?defaultValue:result}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}function omitBy(object,predicate){return pickBy(object,negate(baseIteratee(predicate)))}function pickBy(object,predicate){if(null==object)return{};var props=arrayMap(getAllKeysIn(object),function(prop){return[prop]});return predicate=baseIteratee(predicate),basePickBy(object,props,function(value,path){return predicate(value,path[0])})}function result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;for(length||(length=1,object=undefined);++indexupper){var temp=lower;lower=upper,upper=temp}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat("1e-"+((rand+"").length-1))),upper)}return baseRandom(lower,upper)}function escape(string){return string=toString(string),string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}function trim(string,chars,guard){if(string=toString(string),string&&(guard||chars===undefined))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join("")}function constant(value){return function(){return value}}function identity(value){return value}function iteratee(func){return baseIteratee("function"==typeof func?func:baseClone(func,CLONE_DEEP_FLAG))}function matches(source){return baseMatches(baseClone(source,CLONE_DEEP_FLAG))}function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);null!=options||isObject(source)&&(methodNames.length||!props.length)||(options=source,source=object,object=this,methodNames=baseFunctions(source,keys(source)));var chain=!(isObject(options)&&"chain"in options&&!options.chain),isFunc=isFunction(object);return arrayEach(methodNames,function(methodName){var func=source[methodName];object[methodName]=func,isFunc&&(object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);return actions.push({func:func,args:arguments,thisArg:object}),result.__chain__=chainAll,result}return func.apply(object,arrayPush([this.value()],arguments))})}),object}function noConflict(){return root._===this&&(root._=oldDash),this}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}function stubArray(){return[]}function stubFalse(){return!1}function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined}function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined}var undefined,VERSION="4.17.5",LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",MAX_MEMOIZE_SIZE=500,PLACEHOLDER="__lodash_placeholder__",CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512,HOT_COUNT=800,HOT_SPAN=16,LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,MAX_ARRAY_LENGTH=4294967295,wrapFlags=[["ary",WRAP_ARY_FLAG],["bind",WRAP_BIND_FLAG],["bindKey",WRAP_BIND_KEY_FLAG],["curry",WRAP_CURRY_FLAG],["curryRight",WRAP_CURRY_RIGHT_FLAG],["flip",WRAP_FLIP_FLAG],["partial",WRAP_PARTIAL_FLAG],["partialRight",WRAP_PARTIAL_RIGHT_FLAG],["rearg",WRAP_REARG_FLAG]],argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",promiseTag="[object Promise]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reUnescapedHtml=/[&<>"']/g,reHasUnescapedHtml=RegExp(reUnescapedHtml.source),reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reTrim=/^\s+|\s+$/g,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /,reEscapeChar=/\\(\\)?/g,reFlags=/\w*$/,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reHasUnicode=RegExp("["+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+"]"),typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"},freeParseFloat=parseFloat,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,asciiSize=baseProperty("length"),escapeHtmlChar=basePropertyOf(htmlEscapes),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,idCounter=0,maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),nativeObjectToString=objectProto.toString,objectCtorString=funcToString.call(Object),oldDash=root._,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:undefined,Symbol=root.Symbol,Uint8Array=root.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:undefined,symIterator=Symbol?Symbol.iterator:undefined,symToStringTag=Symbol?Symbol.toStringTag:undefined,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=root.isFinite,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeRandom=Math.random,nativeReverse=arrayProto.reverse,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),metaMap=WeakMap&&new WeakMap,realNames={},dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined,baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=undefined,result}}();lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=baseCreate(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=baseCreate(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=hashClear,Hash.prototype["delete"]=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype["delete"]=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype["delete"]=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype["delete"]=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=createBaseEach(baseForOwn),baseFor=createBaseFor(),baseForRight=createBaseFor(!0),baseSetData=metaMap?function(func,data){return metaMap.set(func,data),func}:identity,baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity,createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getData=metaMap?function(func){return metaMap.get(func)}:noop,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray,getSymbolsIn=nativeGetSymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var setData=shortOut(baseSetData),setToString=shortOut(baseSetToString),stringToPath=memoizeCapped(function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result}),difference=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]}),intersection=baseRest(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]}),union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))}),without=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[]}),zip=baseRest(unzip),wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths)};return!(length>1||this.__actions__.length)&&value instanceof LazyWrapper&&isIndex(start)?(value=value.slice(start,+start+(length?1:0)),value.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(value,this.__chain__).thru(function(array){return length&&!array.length&&array.push(undefined),array})):this.thru(interceptor)}),countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:baseAssignValue(result,key,1)}),find=createFind(findIndex),groupBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key].push(value):baseAssignValue(result,key,[value])}),sortBy=baseRest(function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])}),now=function(){return root.Date.now()},bind=baseRest(function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG}return createWrap(func,bitmask,thisArg,partials,holders)}),defer=baseRest(function(func,args){return baseDelay(func,1,args)}),delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args)});memoize.Cache=MapCache;var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isBuffer=nativeIsBuffer||stubFalse,isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object)}),defaults=baseRest(function(object,sources){object=Object(object);var index=-1,length=sources.length,guard=length>2?sources[2]:undefined;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index1),path}),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result}),pick=flatRest(function(object,paths){return null==object?{}:basePick(object,paths)}),range=createRange();lodash.assignIn=assignIn,lodash.before=before,lodash.bind=bind,lodash.chain=chain,lodash.compact=compact,lodash.concat=concat,lodash.countBy=countBy,lodash.create=create,lodash.debounce=debounce,lodash.defaults=defaults,lodash.defaultsDeep=defaultsDeep,lodash.defer=defer,lodash.delay=delay,lodash.difference=difference,lodash.drop=drop,lodash.filter=filter,lodash.flatten=flatten,lodash.flattenDeep=flattenDeep,lodash.groupBy=groupBy,lodash.initial=initial,lodash.intersection=intersection,lodash.invert=invert,lodash.invertBy=invertBy,lodash.iteratee=iteratee,lodash.keys=keys,lodash.map=map,lodash.matches=matches,lodash.merge=merge,lodash.mixin=mixin,lodash.negate=negate,lodash.omit=omit,lodash.omitBy=omitBy,lodash.once=once,lodash.pick=pick,lodash.range=range,lodash.reject=reject,lodash.rest=rest,lodash.slice=slice,lodash.sortBy=sortBy,lodash.take=take,lodash.takeRight=takeRight,lodash.tap=tap,lodash.throttle=throttle,lodash.thru=thru,lodash.toArray=toArray,lodash.union=union,lodash.uniq=uniq,lodash.uniqBy=uniqBy,lodash.unzip=unzip,lodash.values=values,lodash.without=without,lodash.zip=zip,lodash.zipObject=zipObject,lodash.extend=assignIn,mixin(lodash,lodash),lodash.clamp=clamp,lodash.clone=clone,lodash.cloneDeep=cloneDeep,lodash.escape=escape,lodash.every=every,lodash.find=find,lodash.findIndex=findIndex,lodash.findKey=findKey,lodash.findLastIndex=findLastIndex,lodash.findLastKey=findLastKey,lodash.forEach=forEach,lodash.get=get,lodash.has=has,lodash.head=head,lodash.identity=identity,lodash.indexOf=indexOf,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isArrayLike=isArrayLike,lodash.isBoolean=isBoolean,lodash.isDate=isDate,lodash.isEmpty=isEmpty,lodash.isEqual=isEqual,lodash.isFinite=isFinite,lodash.isFunction=isFunction,lodash.isNaN=isNaN,lodash.isNull=isNull,lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isPlainObject=isPlainObject,lodash.isRegExp=isRegExp,lodash.isString=isString,lodash.isUndefined=isUndefined,lodash.last=last,lodash.max=max,lodash.min=min,lodash.noConflict=noConflict,lodash.noop=noop,lodash.random=random,lodash.reduce=reduce,lodash.result=result,lodash.size=size,lodash.some=some,lodash.trim=trim,lodash.uniqueId=uniqueId,lodash.each=forEach,lodash.first=head,mixin(lodash,function(){var source={};return baseForOwn(lodash,function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)}),source}(),{chain:!1}),lodash.VERSION=VERSION,arrayEach(["drop","take"],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__filtered__?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,MAX_ARRAY_LENGTH),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}}),arrayEach(["filter","map","takeWhile"],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}}),arrayEach(["head","last"],function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}}),arrayEach(["initial","tail"],function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}}),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest(function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map(function(value){return baseInvoke(value,path,args)})}),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),end!==undefined&&(end=toInteger(end),result=end<0?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH)},baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})}),arrayEach(["pop","push","shift","sort","splice","unshift"],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args)}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args)})}}),baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+"",names=realNames[key]||(realNames[key]=[]);names.push({name:methodName,func:lodashFunc})}}),realNames[createHybrid(undefined,WRAP_BIND_KEY_FLAG).name]=[{name:"wrapper",func:undefined}],LazyWrapper.prototype.clone=lazyClone,LazyWrapper.prototype.reverse=lazyReverse,LazyWrapper.prototype.value=lazyValue,lodash.prototype.first=lodash.prototype.head,symIterator&&(lodash.prototype[symIterator]=wrapperToIterator),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(root._=lodash,define(function(){return lodash})):freeModule?((freeModule.exports=lodash)._=lodash,freeExports._=lodash):root._=lodash}.call(this);var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),!function(undefined){var traverse=function(func,context){return function(value,key,obj){return func.call(context,key,value,obj); +}},_apply=function(name){return function(){return _[name].apply(_,arguments)}},_applyFunc=function(name){return function(){var args=Array.prototype.slice.call(arguments,0);return args[1]=_.isFunction(args[1])?traverse(args[1],args[2]):args[1],_[name].apply(_,args)}};_.extend(BI,{assert:function(v,is){if(this.isFunction(is)){if(is(v))return!0;throw new Error(v+" error")}if(this.isArray(is)||(is=[is]),!this.deepContains(is,v))throw new Error(v+" error")},warn:function(message){console.warn(message)},UUID:function(){for(var f=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],str="",i=0;i<16;i++){var r=parseInt(f.length*Math.random(),10);str+=f[r]}return str},isWidget:function(widget){return widget instanceof BI.Widget||BI.View&&widget instanceof BI.View},createWidgets:function(items,options,context){if(!BI.isArray(items))throw new Error("cannot create Widgets");return BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.map(BI.flatten(items),function(i,item){return BI.createWidget(item,BI.deepClone(options))})},createItems:function(data,innerAttr,outerAttr){return innerAttr=BI.isArray(innerAttr)?innerAttr:BI.makeArray(BI.flatten(data).length,innerAttr||{}),outerAttr=BI.isArray(outerAttr)?outerAttr:BI.makeArray(BI.flatten(data).length,outerAttr||{}),BI.map(data,function(i,item){return BI.isArray(item)?BI.createItems(item,innerAttr,outerAttr):item instanceof BI.Widget?BI.extend({},innerAttr.shift(),outerAttr.shift(),{type:null,el:item}):innerAttr[0]instanceof BI.Widget?(outerAttr.shift(),BI.extend({},item,{el:innerAttr.shift()})):item.el instanceof BI.Widget||BI.View&&item.el instanceof BI.View?(innerAttr.shift(),BI.extend({},outerAttr.shift(),{type:null},item)):item.el?BI.extend({},outerAttr.shift(),item,{el:BI.extend({},innerAttr.shift(),item.el)}):BI.extend({},outerAttr.shift(),{el:BI.extend({},innerAttr.shift(),item)})})},packageItems:function(items,layouts){for(var i=layouts.length-1;i>=0;i--)items=BI.map(items,function(k,it){return BI.extend({},layouts[i],{items:[BI.extend({},layouts[i].el,{el:it})]})});return items},formatEL:function(obj){return obj&&!obj.type&&obj.el?obj:{el:obj}},stripEL:function(obj){return obj.type&&obj||obj.el||obj},trans2Element:function(widgets){return BI.map(widgets,function(i,wi){return wi.element})}}),_.each(["where","findWhere","invoke","pluck","shuffle","sample","toArray","size"],function(name){BI[name]=_apply(name)}),_.each(["get","each","map","reduce","reduceRight","find","filter","reject","every","all","some","any","max","min","sortBy","groupBy","indexBy","countBy","partition","clamp"],function(name){"any"===name?BI[name]=_applyFunc("some"):BI[name]=_applyFunc(name)}),_.extend(BI,{count:function(from,to,predicate){var t;if(predicate)for(t=from;t=0;index--)predicate(index,obj[index],obj);return!1},backAny:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var index=obj.length-1;index>=0;index--)if(predicate(index,obj[index],obj))return!0;return!1},backEvery:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var index=obj.length-1;index>=0;index--)if(!predicate(index,obj[index],obj))return!1;return!0},backFindKey:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var keys=_.keys(obj),key,i=keys.length-1;i>=0;i--)if(key=keys[i],predicate(obj[key],key,obj))return key},backFind:function(obj,predicate,context){var key;if(key=BI.isArray(obj)?BI.findLastIndex(obj,predicate,context):BI.backFindKey(obj,predicate,context),void 0!==key&&key!==-1)return obj[key]},remove:function(obj,target,context){var isFunction=BI.isFunction(target);target=isFunction||BI.isArray(target)?target:[target];var i;if(BI.isArray(obj))for(i=0;i(2147483646-str.charAt(i).charCodeAt(0)+start.charCodeAt(0))/26)return 0;return idx},int2Abc:function(num){var DIGITS=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],idx=num,str="";if(0===num)return"";for(;0!==idx;){var t=idx%26;0===t&&(t=26),str=DIGITS[t-1]+str,idx=(idx-t)/26}return str}}),_.each(["first","initial","last","rest","compact","flatten","without","union","intersection","difference","zip","unzip","object","indexOf","lastIndexOf","sortedIndex","range","take","takeRight","uniqBy"],function(name){BI[name]=_apply(name)}),_.each(["findIndex","findLastIndex"],function(name){BI[name]=_applyFunc(name)}),_.extend(BI,{makeArray:function(length,value){for(var res=[],i=0;i0;)BI.prepares.shift()()},has:function(obj,keys){return BI.isArray(keys)?0!==keys.length&&BI.every(keys,function(i,key){return _.has(obj,key)}):_.has.apply(_,arguments)},freeze:function(value){return Object.freeze&&BI.isObject(value)?Object.freeze(value):value},isKey:function(key){return BI.isNumber(key)||BI.isString(key)&&key.length>0},isCapitalEqual:function(a,b){return a=BI.isNull(a)?a:(""+a).toLowerCase(),b=BI.isNull(b)?b:(""+b).toLowerCase(),BI.isEqual(a,b)},isWidthOrHeight:function(w){return"number"==typeof w?w>=0:"string"==typeof w?/^\d{1,3}%$/.exec(w)||"auto"==w||/^\d+px$/.exec(w):void 0},isNotNull:function(obj){return!BI.isNull(obj)},isNull:function(obj){return"undefined"==typeof obj||null===obj},isEmptyArray:function(arr){return BI.isArray(arr)&&BI.isEmpty(arr)},isNotEmptyArray:function(arr){return BI.isArray(arr)&&!BI.isEmpty(arr)},isEmptyObject:function(obj){return BI.isEqual(obj,{})},isNotEmptyObject:function(obj){return BI.isPlainObject(obj)&&!BI.isEmptyObject(obj)},isEmptyString:function(obj){return BI.isString(obj)&&0===obj.length},isNotEmptyString:function(obj){return BI.isString(obj)&&!BI.isEmptyString(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window}}),_.extend(BI,{deepClone:_.cloneDeep,deepExtend:_.merge,isDeepMatch:function(object,attrs){var keys=BI.keys(attrs),length=keys.length;if(null==object)return!length;for(var obj=Object(object),i=0;i=0},deepContains:function(obj,copy){return BI.isObject(copy)?BI.any(obj,function(i,v){if(BI.isEqual(v,copy))return!0}):BI.contains(obj,copy)},deepIndexOf:function(obj,target){for(var i=0;imaxDate[0]?back=["y",1]:YY>=minDate[0]&&YY<=maxDate[0]&&(YY==minDate[0]&&(MMmaxDate[1]?back=["m",1]:MM==maxDate[1]&&DD>maxDate[2]&&(back=["d",1]))),back},checkDateLegal:function(str){var ar=str.match(/\d+/g),YY=0|ar[0],MM=0|ar[1],DD=0|ar[2];if(ar.length<=1)return!0;if(ar.length<=2)return MM>=1&&MM<=12;var MD=BI.Date._MD.slice(0);return MD[1]=BI.isLeapYear(YY)?29:28,MM>=1&&MM<=12&&DD<=MD[MM-1]},parseDateTime:function(str,fmt){var today=BI.getDate(),y=0,m=0,d=1,a=str.split(/\W+/);if("%y%x"==fmt.toLowerCase()||"%y%x%d"==fmt.toLowerCase()){var yearlength=4,otherlength=2;a[0]=str.substring(0,yearlength),a[1]=str.substring(yearlength,yearlength+otherlength),a[2]=str.substring(yearlength+otherlength,yearlength+2*otherlength)}var b=fmt.match(/%./g),i=0,j=0,hr=0,min=0,sec=0;for(i=0;i29?1900:2e3);break;case"%b":case"%B":for(j=0;j<12;++j)if(BI.Date._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break}break;case"%H":case"%I":case"%k":case"%l":hr=parseInt(a[i],10);break;case"%P":case"%p":/pm/i.test(a[i])&&hr<12?hr+=12:/am/i.test(a[i])&&hr>=12&&(hr-=12);break;case"%M":min=parseInt(a[i],10);case"%S":sec=parseInt(a[i],10)}if(isNaN(y)&&(y=today.getFullYear()),isNaN(m)&&(m=today.getMonth()),isNaN(d)&&(d=today.getDate()),isNaN(hr)&&(hr=today.getHours()),isNaN(min)&&(min=today.getMinutes()),isNaN(sec)&&(sec=today.getSeconds()),0!=y)return BI.getDate(y,m,d,hr,min,sec);for(y=0,m=-1,d=0,i=0;i31&&0==y?(y=parseInt(a[i],10),y<100&&(y+=y>29?1900:2e3)):0==d&&(d=a[i]);return 0==y&&(y=today.getFullYear()),m!=-1&&0!=d?BI.getDate(y,m,d,hr,min,sec):today},getDate:function(){var length=arguments.length,args=arguments,dt;switch(length){case 0:dt=new Date;break;case 1:dt=new Date(args[0]);break;case 2:dt=new Date(args[0],args[1]);break;case 3:dt=new Date(args[0],args[1],args[2]);break;case 4:dt=new Date(args[0],args[1],args[2],args[3]);break;case 5:dt=new Date(args[0],args[1],args[2],args[3],args[4]);break;case 6:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;default:dt=new Date}if(BI.isNotNull(BI.timeZone)&&(0===arguments.length||1===arguments.length&&BI.isNumber(arguments[0]))){var localTime=dt.getTime(),localOffset=6e4*dt.getTimezoneOffset(),utc=localTime+localOffset;return new Date(utc+BI.timeZone)}return dt},getTime:function(){var length=arguments.length,args=arguments,dt;switch(length){case 0:dt=new Date;break;case 1:dt=new Date(args[0]);break;case 2:dt=new Date(args[0],args[1]);break;case 3:dt=new Date(args[0],args[1],args[2]);break;case 4:dt=new Date(args[0],args[1],args[2],args[3]);break;case 5:dt=new Date(args[0],args[1],args[2],args[3],args[4]);break;case 6:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;default:dt=new Date}return BI.isNotNull(BI.timeZone)?dt.getTime()-BI.timeZone-6e4*(new Date).getTimezoneOffset():dt.getTime()}})}(),!function(){function extend(){for(var target=arguments[0]||{},length=arguments.length,i=1,options,name,src,copy;i0;)BI.prepares.shift()();var el,w;if(item||(item={}),BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.isEmpty(item)&&BI.isEmpty(options))return BI.createWidget({type:"bi.layout"});if(BI.isWidget(item))return item;if(item.type||options.type)return el=BI.extend({},options,item),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(item.el&&(item.el.type||options.type))return el=BI.extend({},options,item.el),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(BI.isWidget(item.el))return item.el;throw new Error("无法根据item创建组件")},BI.createElement=function(){var widget=BI.createWidget.apply(this,arguments);return widget.element}}(),!function(){BI.CRYPT_TYPE=BI.CRYPT_TYPE||{},BI.CRYPT_TYPE.AES="aes";var CryptoJS=CryptoJS||function(Math,undefined){var C={},C_lib=C.lib={},Base=C_lib.Base=function(){function F(){}return{extend:function(overrides){F.prototype=this;var subtype=new F;return overrides&&subtype.mixIn(overrides),subtype.hasOwnProperty("init")||(subtype.init=function(){subtype.$super.init.apply(this,arguments)}),subtype.init.prototype=subtype,subtype.$super=this,subtype},create:function(){var instance=this.extend();return instance.init.apply(instance,arguments),instance},init:function(){},mixIn:function(properties){for(var propertyName in properties)properties.hasOwnProperty(propertyName)&&(this[propertyName]=properties[propertyName]);properties.hasOwnProperty("toString")&&(this.toString=properties.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),WordArray=C_lib.WordArray=Base.extend({init:function(words,sigBytes){words=this.words=words||[],sigBytes!=undefined?this.sigBytes=sigBytes:this.sigBytes=4*words.length},toString:function(encoder){return(encoder||Hex).stringify(this)},concat:function(wordArray){var thisWords=this.words,thatWords=wordArray.words,thisSigBytes=this.sigBytes,thatSigBytes=wordArray.sigBytes;if(this.clamp(),thisSigBytes%4)for(var i=0;i>>2]>>>24-i%4*8&255;thisWords[thisSigBytes+i>>>2]|=thatByte<<24-(thisSigBytes+i)%4*8}else if(thatWords.length>65535)for(var i=0;i>>2]=thatWords[i>>>2];else thisWords.push.apply(thisWords,thatWords);return this.sigBytes+=thatSigBytes,this},clamp:function(){var words=this.words,sigBytes=this.sigBytes;words[sigBytes>>>2]&=4294967295<<32-sigBytes%4*8,words.length=Math.ceil(sigBytes/4); +},clone:function(){var clone=Base.clone.call(this);return clone.words=this.words.slice(0),clone},random:function(nBytes){for(var words=[],i=0;i>>2]>>>24-i%4*8&255;hexChars.push((bite>>>4).toString(16)),hexChars.push((15&bite).toString(16))}return hexChars.join("")},parse:function(hexStr){for(var hexStrLength=hexStr.length,words=[],i=0;i>>3]|=parseInt(hexStr.substr(i,2),16)<<24-i%8*4;return new WordArray.init(words,hexStrLength/2)}},Latin1=C_enc.Latin1={stringify:function(wordArray){for(var words=wordArray.words,sigBytes=wordArray.sigBytes,latin1Chars=[],i=0;i>>2]>>>24-i%4*8&255;latin1Chars.push(String.fromCharCode(bite))}return latin1Chars.join("")},parse:function(latin1Str){for(var latin1StrLength=latin1Str.length,words=[],i=0;i>>2]|=(255&latin1Str.charCodeAt(i))<<24-i%4*8;return new WordArray.init(words,latin1StrLength)}},Utf8=C_enc.Utf8={stringify:function(wordArray){try{return decodeURIComponent(escape(Latin1.stringify(wordArray)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(utf8Str){return Latin1.parse(unescape(encodeURIComponent(utf8Str)))}},BufferedBlockAlgorithm=C_lib.BufferedBlockAlgorithm=Base.extend({reset:function(){this._data=new WordArray.init,this._nDataBytes=0},_append:function(data){"string"==typeof data&&(data=Utf8.parse(data)),this._data.concat(data),this._nDataBytes+=data.sigBytes},_process:function(doFlush){var data=this._data,dataWords=data.words,dataSigBytes=data.sigBytes,blockSize=this.blockSize,blockSizeBytes=4*blockSize,nBlocksReady=dataSigBytes/blockSizeBytes;nBlocksReady=doFlush?Math.ceil(nBlocksReady):Math.max((0|nBlocksReady)-this._minBufferSize,0);var nWordsReady=nBlocksReady*blockSize,nBytesReady=Math.min(4*nWordsReady,dataSigBytes);if(nWordsReady){for(var offset=0;offset>>2]>>>24-i%4*8&255,byte2=words[i+1>>>2]>>>24-(i+1)%4*8&255,byte3=words[i+2>>>2]>>>24-(i+2)%4*8&255,triplet=byte1<<16|byte2<<8|byte3,j=0;j<4&&i+.75*j>>6*(3-j)&63));var paddingChar=map.charAt(64);if(paddingChar)for(;base64Chars.length%4;)base64Chars.push(paddingChar);return base64Chars.join("")},parse:function(base64Str){var base64StrLength=base64Str.length,map=this._map,paddingChar=map.charAt(64);if(paddingChar){var paddingIndex=base64Str.indexOf(paddingChar);paddingIndex!=-1&&(base64StrLength=paddingIndex)}for(var words=[],nBytes=0,i=0;i>>6-i%4*2;words[nBytes>>>2]|=(bits1|bits2)<<24-nBytes%4*8,nBytes++}return WordArray.create(words,nBytes)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(Math){function FF(a,b,c,d,x,s,t){var n=a+(b&c|~b&d)+x+t;return(n<>>32-s)+b}function GG(a,b,c,d,x,s,t){var n=a+(b&d|c&~d)+x+t;return(n<>>32-s)+b}function HH(a,b,c,d,x,s,t){var n=a+(b^c^d)+x+t;return(n<>>32-s)+b}function II(a,b,c,d,x,s,t){var n=a+(c^(b|~d))+x+t;return(n<>>32-s)+b}var C=CryptoJS,C_lib=C.lib,WordArray=C_lib.WordArray,Hasher=C_lib.Hasher,C_algo=C.algo,T=[];!function(){for(var i=0;i<64;i++)T[i]=4294967296*Math.abs(Math.sin(i+1))|0}();var MD5=C_algo.MD5=Hasher.extend({_doReset:function(){this._hash=new WordArray.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(M,offset){for(var i=0;i<16;i++){var offset_i=offset+i,M_offset_i=M[offset_i];M[offset_i]=16711935&(M_offset_i<<8|M_offset_i>>>24)|4278255360&(M_offset_i<<24|M_offset_i>>>8)}var H=this._hash.words,M_offset_0=M[offset+0],M_offset_1=M[offset+1],M_offset_2=M[offset+2],M_offset_3=M[offset+3],M_offset_4=M[offset+4],M_offset_5=M[offset+5],M_offset_6=M[offset+6],M_offset_7=M[offset+7],M_offset_8=M[offset+8],M_offset_9=M[offset+9],M_offset_10=M[offset+10],M_offset_11=M[offset+11],M_offset_12=M[offset+12],M_offset_13=M[offset+13],M_offset_14=M[offset+14],M_offset_15=M[offset+15],a=H[0],b=H[1],c=H[2],d=H[3];a=FF(a,b,c,d,M_offset_0,7,T[0]),d=FF(d,a,b,c,M_offset_1,12,T[1]),c=FF(c,d,a,b,M_offset_2,17,T[2]),b=FF(b,c,d,a,M_offset_3,22,T[3]),a=FF(a,b,c,d,M_offset_4,7,T[4]),d=FF(d,a,b,c,M_offset_5,12,T[5]),c=FF(c,d,a,b,M_offset_6,17,T[6]),b=FF(b,c,d,a,M_offset_7,22,T[7]),a=FF(a,b,c,d,M_offset_8,7,T[8]),d=FF(d,a,b,c,M_offset_9,12,T[9]),c=FF(c,d,a,b,M_offset_10,17,T[10]),b=FF(b,c,d,a,M_offset_11,22,T[11]),a=FF(a,b,c,d,M_offset_12,7,T[12]),d=FF(d,a,b,c,M_offset_13,12,T[13]),c=FF(c,d,a,b,M_offset_14,17,T[14]),b=FF(b,c,d,a,M_offset_15,22,T[15]),a=GG(a,b,c,d,M_offset_1,5,T[16]),d=GG(d,a,b,c,M_offset_6,9,T[17]),c=GG(c,d,a,b,M_offset_11,14,T[18]),b=GG(b,c,d,a,M_offset_0,20,T[19]),a=GG(a,b,c,d,M_offset_5,5,T[20]),d=GG(d,a,b,c,M_offset_10,9,T[21]),c=GG(c,d,a,b,M_offset_15,14,T[22]),b=GG(b,c,d,a,M_offset_4,20,T[23]),a=GG(a,b,c,d,M_offset_9,5,T[24]),d=GG(d,a,b,c,M_offset_14,9,T[25]),c=GG(c,d,a,b,M_offset_3,14,T[26]),b=GG(b,c,d,a,M_offset_8,20,T[27]),a=GG(a,b,c,d,M_offset_13,5,T[28]),d=GG(d,a,b,c,M_offset_2,9,T[29]),c=GG(c,d,a,b,M_offset_7,14,T[30]),b=GG(b,c,d,a,M_offset_12,20,T[31]),a=HH(a,b,c,d,M_offset_5,4,T[32]),d=HH(d,a,b,c,M_offset_8,11,T[33]),c=HH(c,d,a,b,M_offset_11,16,T[34]),b=HH(b,c,d,a,M_offset_14,23,T[35]),a=HH(a,b,c,d,M_offset_1,4,T[36]),d=HH(d,a,b,c,M_offset_4,11,T[37]),c=HH(c,d,a,b,M_offset_7,16,T[38]),b=HH(b,c,d,a,M_offset_10,23,T[39]),a=HH(a,b,c,d,M_offset_13,4,T[40]),d=HH(d,a,b,c,M_offset_0,11,T[41]),c=HH(c,d,a,b,M_offset_3,16,T[42]),b=HH(b,c,d,a,M_offset_6,23,T[43]),a=HH(a,b,c,d,M_offset_9,4,T[44]),d=HH(d,a,b,c,M_offset_12,11,T[45]),c=HH(c,d,a,b,M_offset_15,16,T[46]),b=HH(b,c,d,a,M_offset_2,23,T[47]),a=II(a,b,c,d,M_offset_0,6,T[48]),d=II(d,a,b,c,M_offset_7,10,T[49]),c=II(c,d,a,b,M_offset_14,15,T[50]),b=II(b,c,d,a,M_offset_5,21,T[51]),a=II(a,b,c,d,M_offset_12,6,T[52]),d=II(d,a,b,c,M_offset_3,10,T[53]),c=II(c,d,a,b,M_offset_10,15,T[54]),b=II(b,c,d,a,M_offset_1,21,T[55]),a=II(a,b,c,d,M_offset_8,6,T[56]),d=II(d,a,b,c,M_offset_15,10,T[57]),c=II(c,d,a,b,M_offset_6,15,T[58]),b=II(b,c,d,a,M_offset_13,21,T[59]),a=II(a,b,c,d,M_offset_4,6,T[60]),d=II(d,a,b,c,M_offset_11,10,T[61]),c=II(c,d,a,b,M_offset_2,15,T[62]),b=II(b,c,d,a,M_offset_9,21,T[63]),H[0]=H[0]+a|0,H[1]=H[1]+b|0,H[2]=H[2]+c|0,H[3]=H[3]+d|0},_doFinalize:function(){var data=this._data,dataWords=data.words,nBitsTotal=8*this._nDataBytes,nBitsLeft=8*data.sigBytes;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;var nBitsTotalH=Math.floor(nBitsTotal/4294967296),nBitsTotalL=nBitsTotal;dataWords[(nBitsLeft+64>>>9<<4)+15]=16711935&(nBitsTotalH<<8|nBitsTotalH>>>24)|4278255360&(nBitsTotalH<<24|nBitsTotalH>>>8),dataWords[(nBitsLeft+64>>>9<<4)+14]=16711935&(nBitsTotalL<<8|nBitsTotalL>>>24)|4278255360&(nBitsTotalL<<24|nBitsTotalL>>>8),data.sigBytes=4*(dataWords.length+1),this._process();for(var hash=this._hash,H=hash.words,i=0;i<4;i++){var H_i=H[i];H[i]=16711935&(H_i<<8|H_i>>>24)|4278255360&(H_i<<24|H_i>>>8)}return hash},clone:function(){var clone=Hasher.clone.call(this);return clone._hash=this._hash.clone(),clone}});C.MD5=Hasher._createHelper(MD5),C.HmacMD5=Hasher._createHmacHelper(MD5)}(Math),function(){var C=CryptoJS,C_lib=C.lib,Base=C_lib.Base,WordArray=C_lib.WordArray,C_algo=C.algo,MD5=C_algo.MD5,EvpKDF=C_algo.EvpKDF=Base.extend({cfg:Base.extend({keySize:4,hasher:MD5,iterations:1}),init:function(cfg){this.cfg=this.cfg.extend(cfg)},compute:function(password,salt){for(var cfg=this.cfg,hasher=cfg.hasher.create(),derivedKey=WordArray.create(),derivedKeyWords=derivedKey.words,keySize=cfg.keySize,iterations=cfg.iterations;derivedKeyWords.length>>2];data.sigBytes-=nPaddingBytes}},BlockCipher=C_lib.BlockCipher=Cipher.extend({cfg:Cipher.cfg.extend({mode:CBC,padding:Pkcs7}),reset:function(){Cipher.reset.call(this);var cfg=this.cfg,iv=cfg.iv,mode=cfg.mode;if(this._xformMode==this._ENC_XFORM_MODE)var modeCreator=mode.createEncryptor;else{var modeCreator=mode.createDecryptor;this._minBufferSize=1}this._mode=modeCreator.call(mode,this,iv&&iv.words)},_doProcessBlock:function(words,offset){this._mode.processBlock(words,offset)},_doFinalize:function(){var padding=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){padding.pad(this._data,this.blockSize);var finalProcessedBlocks=this._process(!0)}else{var finalProcessedBlocks=this._process(!0);padding.unpad(finalProcessedBlocks)}return finalProcessedBlocks},blockSize:4}),CipherParams=C_lib.CipherParams=Base.extend({init:function(cipherParams){this.mixIn(cipherParams)},toString:function(formatter){return(formatter||this.formatter).stringify(this)}}),C_format=C.format={},OpenSSLFormatter=C_format.OpenSSL={stringify:function(cipherParams){var ciphertext=cipherParams.ciphertext,salt=cipherParams.salt;if(salt)var wordArray=WordArray.create([1398893684,1701076831]).concat(salt).concat(ciphertext);else var wordArray=ciphertext;return wordArray.toString(Base64)},parse:function(openSSLStr){var ciphertext=Base64.parse(openSSLStr),ciphertextWords=ciphertext.words;if(1398893684==ciphertextWords[0]&&1701076831==ciphertextWords[1]){var salt=WordArray.create(ciphertextWords.slice(2,4));ciphertextWords.splice(0,4),ciphertext.sigBytes-=16}return CipherParams.create({ciphertext:ciphertext,salt:salt})}},SerializableCipher=C_lib.SerializableCipher=Base.extend({cfg:Base.extend({format:OpenSSLFormatter}),encrypt:function(cipher,message,key,cfg){cfg=this.cfg.extend(cfg);var encryptor=cipher.createEncryptor(key,cfg),ciphertext=encryptor.finalize(message),cipherCfg=encryptor.cfg;return CipherParams.create({ciphertext:ciphertext,key:key,iv:cipherCfg.iv,algorithm:cipher,mode:cipherCfg.mode,padding:cipherCfg.padding,blockSize:cipher.blockSize,formatter:cfg.format})},decrypt:function(cipher,ciphertext,key,cfg){cfg=this.cfg.extend(cfg),ciphertext=this._parse(ciphertext,cfg.format);var plaintext=cipher.createDecryptor(key,cfg).finalize(ciphertext.ciphertext);return plaintext},_parse:function(ciphertext,format){return"string"==typeof ciphertext?format.parse(ciphertext,this):ciphertext}}),C_kdf=C.kdf={},OpenSSLKdf=C_kdf.OpenSSL={execute:function(password,keySize,ivSize,salt){salt||(salt=WordArray.random(8));var key=EvpKDF.create({keySize:keySize+ivSize}).compute(password,salt),iv=WordArray.create(key.words.slice(keySize),4*ivSize);return key.sigBytes=4*keySize,CipherParams.create({key:key,iv:iv,salt:salt})}},PasswordBasedCipher=C_lib.PasswordBasedCipher=SerializableCipher.extend({cfg:SerializableCipher.cfg.extend({kdf:OpenSSLKdf}),encrypt:function(cipher,message,password,cfg){cfg=this.cfg.extend(cfg);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize);cfg.iv=derivedParams.iv;var ciphertext=SerializableCipher.encrypt.call(this,cipher,message,derivedParams.key,cfg);return ciphertext.mixIn(derivedParams),ciphertext},decrypt:function(cipher,ciphertext,password,cfg){cfg=this.cfg.extend(cfg),ciphertext=this._parse(ciphertext,cfg.format);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize,ciphertext.salt);cfg.iv=derivedParams.iv;var plaintext=SerializableCipher.decrypt.call(this,cipher,ciphertext,derivedParams.key,cfg);return plaintext}})}(),CryptoJS.mode.ECB=function(){var ECB=CryptoJS.lib.BlockCipherMode.extend();return ECB.Encryptor=ECB.extend({processBlock:function(words,offset){this._cipher.encryptBlock(words,offset)}}),ECB.Decryptor=ECB.extend({processBlock:function(words,offset){this._cipher.decryptBlock(words,offset)}}),ECB}(),function(){var C=CryptoJS,C_lib=C.lib,BlockCipher=C_lib.BlockCipher,C_algo=C.algo,SBOX=[],INV_SBOX=[],SUB_MIX_0=[],SUB_MIX_1=[],SUB_MIX_2=[],SUB_MIX_3=[],INV_SUB_MIX_0=[],INV_SUB_MIX_1=[],INV_SUB_MIX_2=[],INV_SUB_MIX_3=[];!function(){for(var d=[],i=0;i<256;i++)i<128?d[i]=i<<1:d[i]=i<<1^283;for(var x=0,xi=0,i=0;i<256;i++){var sx=xi^xi<<1^xi<<2^xi<<3^xi<<4;sx=sx>>>8^255&sx^99,SBOX[x]=sx,INV_SBOX[sx]=x;var x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx;SUB_MIX_0[x]=t<<24|t>>>8,SUB_MIX_1[x]=t<<16|t>>>16,SUB_MIX_2[x]=t<<8|t>>>24,SUB_MIX_3[x]=t;var t=16843009*x8^65537*x4^257*x2^16843008*x;INV_SUB_MIX_0[sx]=t<<24|t>>>8,INV_SUB_MIX_1[sx]=t<<16|t>>>16,INV_SUB_MIX_2[sx]=t<<8|t>>>24,INV_SUB_MIX_3[sx]=t,x?(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]):x=xi=1}}();var RCON=[0,1,2,4,8,16,32,64,128,27,54],AES=C_algo.AES=BlockCipher.extend({_doReset:function(){for(var key=this._key,keyWords=key.words,keySize=key.sigBytes/4,nRounds=this._nRounds=keySize+6,ksRows=4*(nRounds+1),keySchedule=this._keySchedule=[],ksRow=0;ksRow6&&ksRow%keySize==4&&(t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[255&t]):(t=t<<8|t>>>24,t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[255&t],t^=RCON[ksRow/keySize|0]<<24),keySchedule[ksRow]=keySchedule[ksRow-keySize]^t}for(var invKeySchedule=this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^INV_SUB_MIX_1[SBOX[t>>>16&255]]^INV_SUB_MIX_2[SBOX[t>>>8&255]]^INV_SUB_MIX_3[SBOX[255&t]]}},encryptBlock:function(M,offset){this._doCryptBlock(M,offset,this._keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX)},decryptBlock:function(M,offset){var t=M[offset+1];M[offset+1]=M[offset+3],M[offset+3]=t,this._doCryptBlock(M,offset,this._invKeySchedule,INV_SUB_MIX_0,INV_SUB_MIX_1,INV_SUB_MIX_2,INV_SUB_MIX_3,INV_SBOX);var t=M[offset+1];M[offset+1]=M[offset+3],M[offset+3]=t},_doCryptBlock:function(M,offset,keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX){for(var nRounds=this._nRounds,s0=M[offset]^keySchedule[0],s1=M[offset+1]^keySchedule[1],s2=M[offset+2]^keySchedule[2],s3=M[offset+3]^keySchedule[3],ksRow=4,round=1;round>>24]^SUB_MIX_1[s1>>>16&255]^SUB_MIX_2[s2>>>8&255]^SUB_MIX_3[255&s3]^keySchedule[ksRow++],t1=SUB_MIX_0[s1>>>24]^SUB_MIX_1[s2>>>16&255]^SUB_MIX_2[s3>>>8&255]^SUB_MIX_3[255&s0]^keySchedule[ksRow++],t2=SUB_MIX_0[s2>>>24]^SUB_MIX_1[s3>>>16&255]^SUB_MIX_2[s0>>>8&255]^SUB_MIX_3[255&s1]^keySchedule[ksRow++],t3=SUB_MIX_0[s3>>>24]^SUB_MIX_1[s0>>>16&255]^SUB_MIX_2[s1>>>8&255]^SUB_MIX_3[255&s2]^keySchedule[ksRow++];s0=t0,s1=t1,s2=t2,s3=t3}var t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++];M[offset]=t0,M[offset+1]=t1,M[offset+2]=t2,M[offset+3]=t3},keySize:8});C.AES=BlockCipher._createHelper(AES)}(),_.extend(BI,{aesEncrypt:function(text,key){key=CryptoJS.enc.Utf8.parse(key);var cipher=CryptoJS.AES.encrypt(text,key,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7}),base64Cipher=cipher.ciphertext.toString(CryptoJS.enc.Base64);return base64Cipher}})}(),!function(){function aspect(type){return function(target,methodName,advice){var exist=target[methodName],dispatcher;exist&&exist.target==target||(dispatcher=target[methodName]=function(){for(var beforeArr=dispatcher.before,args=arguments,next,l=beforeArr.length;l--;){if(next=beforeArr[l].advice.apply(this,args),next===!1)return!1;args=next||args}for(var rs=dispatcher.method.apply(this,args),afterArr=dispatcher.after,i=0,ii=afterArr.length;i127&&c<2048?(utftext+=String.fromCharCode(c>>6|192),utftext+=String.fromCharCode(63&c|128)):(utftext+=String.fromCharCode(c>>12|224),utftext+=String.fromCharCode(c>>6&63|128),utftext+=String.fromCharCode(63&c|128))}return utftext},_utf8_decode=function(utftext){for(var string="",i=0,c=0,c3=0,c2=0;i191&&c<224?(c2=utftext.charCodeAt(i+1),string+=String.fromCharCode((31&c)<<6|63&c2),i+=2):(c2=utftext.charCodeAt(i+1),c3=utftext.charCodeAt(i+2),string+=String.fromCharCode((15&c)<<12|(63&c2)<<6|63&c3),i+=3);return string};_.extend(BI,{encode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;for(input=_utf8_encode(input);i>2,enc2=(3&chr1)<<4|chr2>>4,enc3=(15&chr2)<<2|chr3>>6,enc4=63&chr3,isNaN(chr2)?enc3=enc4=64:isNaN(chr3)&&(enc4=64),output=output+_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4);return output},decode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;for(input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");i>4,chr2=(15&enc2)<<4|enc3>>2,chr3=(3&enc3)<<6|enc4,output+=String.fromCharCode(chr1),64!=enc3&&(output+=String.fromCharCode(chr2)),64!=enc4&&(output+=String.fromCharCode(chr3));return output=_utf8_decode(output)}})}(),BI.Cache={_prefix:"bi",setUsername:function(username){localStorage.setItem(BI.Cache._prefix+".username",(username+""||"").toUpperCase())},getUsername:function(){return localStorage.getItem(BI.Cache._prefix+".username")||""},_getKeyPrefix:function(){return BI.Cache.getUsername()+"."+BI.Cache._prefix+"."},_generateKey:function(key){return BI.Cache._getKeyPrefix()+(key||"")},getItem:function(key){return localStorage.getItem(BI.Cache._generateKey(key))},setItem:function(key,value){localStorage.setItem(BI.Cache._generateKey(key),value)},removeItem:function(key){localStorage.removeItem(BI.Cache._generateKey(key))},clear:function(){for(var i=localStorage.length;i>=0;i--){var key=localStorage.key(i);key&&0===key.indexOf(BI.Cache._getKeyPrefix())&&localStorage.removeItem(key)}},keys:function(){for(var result=[],i=localStorage.length;i>=0;i--){var key=localStorage.key(i);if(key){var prefix=BI.Cache._getKeyPrefix();0===key.indexOf(prefix)&&(result[result.length]=key.substring(prefix.length))}}return result},addCookie:function(name,value,path,expiresHours){var cookieString=name+"="+escape(value);if(expiresHours&&expiresHours>0){var date=new Date;date.setTime(BI.getTime()+3600*expiresHours*1e3),cookieString=cookieString+"; expires="+date.toGMTString()}path&&(cookieString=cookieString+"; path="+path),document.cookie=cookieString},getCookie:function(name){var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");return(arr=document.cookie.match(reg))?unescape(arr[2]):null},deleteCookie:function(name,path){var date=new Date;date.setTime(BI.getTime()-1e4);var cookieString=name+"=v; expires="+date.toGMTString();path&&(cookieString=cookieString+"; path="+path),document.cookie=cookieString}},BI.CellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize){this._cellSizeGetter=cellSizeGetter,this._cellCount=cellCount,this._estimatedCellSize=estimatedCellSize,this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1},BI.CellSizeAndPositionManager.prototype={constructor:BI.CellSizeAndPositionManager,configure:function(cellCount,estimatedCellSize){this._cellCount=cellCount,this._estimatedCellSize=estimatedCellSize},getCellCount:function(){return this._cellCount},getEstimatedCellSize:function(){return this._estimatedCellSize},getLastMeasuredIndex:function(){return this._lastMeasuredIndex},getSizeAndPositionOfCell:function(index){if(!(index<0||index>=this._cellCount)){if(index>this._lastMeasuredIndex){for(var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell(),offset=lastMeasuredCellSizeAndPosition.offset+lastMeasuredCellSizeAndPosition.size,i=this._lastMeasuredIndex+1;i<=index;i++){var size=this._cellSizeGetter(i);null==size||isNaN(size)||(this._cellSizeAndPositionData[i]={offset:offset,size:size},offset+=size)}this._lastMeasuredIndex=index}return this._cellSizeAndPositionData[index]}},getSizeAndPositionOfLastMeasuredCell:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}},getTotalSize:function(){var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell();return lastMeasuredCellSizeAndPosition.offset+lastMeasuredCellSizeAndPosition.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){var datum=this.getSizeAndPositionOfCell(targetIndex),maxOffset=datum.offset,minOffset=maxOffset-containerSize+datum.size,idealOffset;switch(align){case"start":idealOffset=maxOffset;break;case"end":idealOffset=minOffset;break;case"center":idealOffset=maxOffset-(containerSize-datum.size)/2;break;default:idealOffset=Math.max(minOffset,Math.min(maxOffset,currentOffset))}var totalSize=this.getTotalSize();return Math.max(0,Math.min(totalSize-containerSize,idealOffset))},getVisibleCellRange:function(containerSize,offset){var totalSize=this.getTotalSize();if(0===totalSize)return{};var maxOffset=offset+containerSize,start=this._findNearestCell(offset),datum=this.getSizeAndPositionOfCell(start);offset=datum.offset+datum.size;for(var stop=start;offsetoffset&&(high=middle-1)}if(low>0)return low-1},_exponentialSearch:function(index,offset){for(var interval=1;index=offset?this._binarySearch(lastMeasuredIndex,0,offset):this._exponentialSearch(lastMeasuredIndex,offset)}}},BI.ScalingCellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize,maxScrollSize){this._cellSizeAndPositionManager=new BI.CellSizeAndPositionManager(cellCount,cellSizeGetter,estimatedCellSize),this._maxScrollSize=maxScrollSize||1e7},BI.ScalingCellSizeAndPositionManager.prototype={constructor:BI.ScalingCellSizeAndPositionManager,configure:function(){this._cellSizeAndPositionManager.configure.apply(this._cellSizeAndPositionManager,arguments)},getCellCount:function(){return this._cellSizeAndPositionManager.getCellCount()},getEstimatedCellSize:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()},getLastMeasuredIndex:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()},getOffsetAdjustment:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize(),offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(safeTotalSize-totalSize))},getSizeAndPositionOfCell:function(index){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index)},getSizeAndPositionOfLastMeasuredCell:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()},getTotalSize:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){currentOffset=this._safeOffsetToOffset(containerSize,currentOffset);var offset=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex(align,containerSize,currentOffset,targetIndex);return this._offsetToSafeOffset(containerSize,offset)},getVisibleCellRange:function(containerSize,offset){return offset=this._safeOffsetToOffset(containerSize,offset),this._cellSizeAndPositionManager.getVisibleCellRange(containerSize,offset)},resetCell:function(index){this._cellSizeAndPositionManager.resetCell(index)},_getOffsetPercentage:function(containerSize,offset,totalSize){return totalSize<=containerSize?0:offset/(totalSize-containerSize)},_offsetToSafeOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,totalSize);return Math.round(offsetPercentage*(safeTotalSize-containerSize))},_safeOffsetToOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(totalSize-containerSize))}},!function(){var _ChineseFirstPY="YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSCYYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZJJBRCFTLECZSTZFXXZHTRQHYBDLYCZSSYMMRFMYQZPWWJJYFCRWFDFZQPYDDWYXKYJAWJFFXYPSFTZYHHYZYSWCJYXSCLCXXWZZXNBGNNXBXLZSZSBSGPYSYZDHMDZBQBZCWDZZYYTZHBTSYYBZGNTNXQYWQSKBPHHLXGYBFMJEBJHHGQTJCYSXSTKZHLYCKGLYSMZXYALMELDCCXGZYRJXSDLTYZCQKCNNJWHJTZZCQLJSTSTBNXBTYXCEQXGKWJYFLZQLYHYXSPSFXLMPBYSXXXYDJCZYLLLSJXFHJXPJBTFFYABYXBHZZBJYZLWLCZGGBTSSMDTJZXPTHYQTGLJSCQFZKJZJQNLZWLSLHDZBWJNCJZYZSQQYCQYRZCJJWYBRTWPYFTWEXCSKDZCTBZHYZZYYJXZCFFZZMJYXXSDZZOTTBZLQWFCKSZSXFYRLNYJMBDTHJXSQQCCSBXYYTSYFBXDZTGBCNSLCYZZPSAZYZZSCJCSHZQYDXLBPJLLMQXTYDZXSQJTZPXLCGLQTZWJBHCTSYJSFXYEJJTLBGXSXJMYJQQPFZASYJNTYDJXKJCDJSZCBARTDCLYJQMWNQNCLLLKBYBZZSYHQQLTWLCCXTXLLZNTYLNEWYZYXCZXXGRKRMTCNDNJTSYYSSDQDGHSDBJGHRWRQLYBGLXHLGTGXBQJDZPYJSJYJCTMRNYMGRZJCZGJMZMGXMPRYXKJNYMSGMZJYMKMFXMLDTGFBHCJHKYLPFMDXLQJJSMTQGZSJLQDLDGJYCALCMZCSDJLLNXDJFFFFJCZFMZFFPFKHKGDPSXKTACJDHHZDDCRRCFQYJKQCCWJDXHWJLYLLZGCFCQDSMLZPBJJPLSBCJGGDCKKDEZSQCCKJGCGKDJTJDLZYCXKLQSCGJCLTFPCQCZGWPJDQYZJJBYJHSJDZWGFSJGZKQCCZLLPSPKJGQJHZZLJPLGJGJJTHJJYJZCZMLZLYQBGJWMLJKXZDZNJQSYZMLJLLJKYWXMKJLHSKJGBMCLYYMKXJQLBMLLKMDXXKWYXYSLMLPSJQQJQXYXFJTJDXMXXLLCXQBSYJBGWYMBGGBCYXPJYGPEPFGDJGBHBNSQJYZJKJKHXQFGQZKFHYGKHDKLLSDJQXPQYKYBNQSXQNSZSWHBSXWHXWBZZXDMNSJBSBKBBZKLYLXGWXDRWYQZMYWSJQLCJXXJXKJEQXSCYETLZHLYYYSDZPAQYZCMTLSHTZCFYZYXYLJSDCJQAGYSLCQLYYYSHMRQQKLDXZSCSSSYDYCJYSFSJBFRSSZQSBXXPXJYSDRCKGJLGDKZJZBDKTCSYQPYHSTCLDJDHMXMCGXYZHJDDTMHLTXZXYLYMOHYJCLTYFBQQXPFBDFHHTKSQHZYYWCNXXCRWHOWGYJLEGWDQCWGFJYCSNTMYTOLBYGWQWESJPWNMLRYDZSZTXYQPZGCWXHNGPYXSHMYQJXZTDPPBFYHZHTJYFDZWKGKZBLDNTSXHQEEGZZYLZMMZYJZGXZXKHKSTXNXXWYLYAPSTHXDWHZYMPXAGKYDXBHNHXKDPJNMYHYLPMGOCSLNZHKXXLPZZLBMLSFBHHGYGYYGGBHSCYAQTYWLXTZQCEZYDQDQMMHTKLLSZHLSJZWFYHQSWSCWLQAZYNYTLSXTHAZNKZZSZZLAXXZWWCTGQQTDDYZTCCHYQZFLXPSLZYGPZSZNGLNDQTBDLXGTCTAJDKYWNSYZLJHHZZCWNYYZYWMHYCHHYXHJKZWSXHZYXLYSKQYSPSLYZWMYPPKBYGLKZHTYXAXQSYSHXASMCHKDSCRSWJPWXSGZJLWWSCHSJHSQNHCSEGNDAQTBAALZZMSSTDQJCJKTSCJAXPLGGXHHGXXZCXPDMMHLDGTYBYSJMXHMRCPXXJZCKZXSHMLQXXTTHXWZFKHCCZDYTCJYXQHLXDHYPJQXYLSYYDZOZJNYXQEZYSQYAYXWYPDGXDDXSPPYZNDLTWRHXYDXZZJHTCXMCZLHPYYYYMHZLLHNXMYLLLMDCPPXHMXDKYCYRDLTXJCHHZZXZLCCLYLNZSHZJZZLNNRLWHYQSNJHXYNTTTKYJPYCHHYEGKCTTWLGQRLGGTGTYGYHPYHYLQYQGCWYQKPYYYTTTTLHYHLLTYTTSPLKYZXGZWGPYDSSZZDQXSKCQNMJJZZBXYQMJRTFFBTKHZKBXLJJKDXJTLBWFZPPTKQTZTGPDGNTPJYFALQMKGXBDCLZFHZCLLLLADPMXDJHLCCLGYHDZFGYDDGCYYFGYDXKSSEBDHYKDKDKHNAXXYBPBYYHXZQGAFFQYJXDMLJCSQZLLPCHBSXGJYNDYBYQSPZWJLZKSDDTACTBXZDYZYPJZQSJNKKTKNJDJGYYPGTLFYQKASDNTCYHBLWDZHBBYDWJRYGKZYHEYYFJMSDTYFZJJHGCXPLXHLDWXXJKYTCYKSSSMTWCTTQZLPBSZDZWZXGZAGYKTYWXLHLSPBCLLOQMMZSSLCMBJCSZZKYDCZJGQQDSMCYTZQQLWZQZXSSFPTTFQMDDZDSHDTDWFHTDYZJYQJQKYPBDJYYXTLJHDRQXXXHAYDHRJLKLYTWHLLRLLRCXYLBWSRSZZSYMKZZHHKYHXKSMDSYDYCJPBZBSQLFCXXXNXKXWYWSDZYQOGGQMMYHCDZTTFJYYBGSTTTYBYKJDHKYXBELHTYPJQNFXFDYKZHQKZBYJTZBXHFDXKDASWTAWAJLDYJSFHBLDNNTNQJTJNCHXFJSRFWHZFMDRYJYJWZPDJKZYJYMPCYZNYNXFBYTFYFWYGDBNZZZDNYTXZEMMQBSQEHXFZMBMFLZZSRXYMJGSXWZJSPRYDJSJGXHJJGLJJYNZZJXHGXKYMLPYYYCXYTWQZSWHWLYRJLPXSLSXMFSWWKLCTNXNYNPSJSZHDZEPTXMYYWXYYSYWLXJQZQXZDCLEEELMCPJPCLWBXSQHFWWTFFJTNQJHJQDXHWLBYZNFJLALKYYJLDXHHYCSTYYWNRJYXYWTRMDRQHWQCMFJDYZMHMYYXJWMYZQZXTLMRSPWWCHAQBXYGZYPXYYRRCLMPYMGKSJSZYSRMYJSNXTPLNBAPPYPYLXYYZKYNLDZYJZCZNNLMZHHARQMPGWQTZMXXMLLHGDZXYHXKYXYCJMFFYYHJFSBSSQLXXNDYCANNMTCJCYPRRNYTYQNYYMBMSXNDLYLYSLJRLXYSXQMLLYZLZJJJKYZZCSFBZXXMSTBJGNXYZHLXNMCWSCYZYFZLXBRNNNYLBNRTGZQYSATSWRYHYJZMZDHZGZDWYBSSCSKXSYHYTXXGCQGXZZSHYXJSCRHMKKBXCZJYJYMKQHZJFNBHMQHYSNJNZYBKNQMCLGQHWLZNZSWXKHLJHYYBQLBFCDSXDLDSPFZPSKJYZWZXZDDXJSMMEGJSCSSMGCLXXKYYYLNYPWWWGYDKZJGGGZGGSYCKNJWNJPCXBJJTQTJWDSSPJXZXNZXUMELPXFSXTLLXCLJXJJLJZXCTPSWXLYDHLYQRWHSYCSQYYBYAYWJJJQFWQCQQCJQGXALDBZZYJGKGXPLTZYFXJLTPADKYQHPMATLCPDCKBMTXYBHKLENXDLEEGQDYMSAWHZMLJTWYGXLYQZLJEEYYBQQFFNLYXRDSCTGJGXYYNKLLYQKCCTLHJLQMKKZGCYYGLLLJDZGYDHZWXPYSJBZKDZGYZZHYWYFQYTYZSZYEZZLYMHJJHTSMQWYZLKYYWZCSRKQYTLTDXWCTYJKLWSQZWBDCQYNCJSRSZJLKCDCDTLZZZACQQZZDDXYPLXZBQJYLZLLLQDDZQJYJYJZYXNYYYNYJXKXDAZWYRDLJYYYRJLXLLDYXJCYWYWNQCCLDDNYYYNYCKCZHXXCCLGZQJGKWPPCQQJYSBZZXYJSQPXJPZBSBDSFNSFPZXHDWZTDWPPTFLZZBZDMYYPQJRSDZSQZSQXBDGCPZSWDWCSQZGMDHZXMWWFYBPDGPHTMJTHZSMMBGZMBZJCFZWFZBBZMQCFMBDMCJXLGPNJBBXGYHYYJGPTZGZMQBQTCGYXJXLWZKYDPDYMGCFTPFXYZTZXDZXTGKMTYBBCLBJASKYTSSQYYMSZXFJEWLXLLSZBQJJJAKLYLXLYCCTSXMCWFKKKBSXLLLLJYXTYLTJYYTDPJHNHNNKBYQNFQYYZBYYESSESSGDYHFHWTCJBSDZZTFDMXHCNJZYMQWSRYJDZJQPDQBBSTJGGFBKJBXTGQHNGWJXJGDLLTHZHHYYYYYYSXWTYYYCCBDBPYPZYCCZYJPZYWCBDLFWZCWJDXXHYHLHWZZXJTCZLCDPXUJCZZZLYXJJTXPHFXWPYWXZPTDZZBDZCYHJHMLXBQXSBYLRDTGJRRCTTTHYTCZWMXFYTWWZCWJWXJYWCSKYBZSCCTZQNHXNWXXKHKFHTSWOCCJYBCMPZZYKBNNZPBZHHZDLSYDDYTYFJPXYNGFXBYQXCBHXCPSXTYZDMKYSNXSXLHKMZXLYHDHKWHXXSSKQYHHCJYXGLHZXCSNHEKDTGZXQYPKDHEXTYKCNYMYYYPKQYYYKXZLTHJQTBYQHXBMYHSQCKWWYLLHCYYLNNEQXQWMCFBDCCMLJGGXDQKTLXKGNQCDGZJWYJJLYHHQTTTNWCHMXCXWHWSZJYDJCCDBQCDGDNYXZTHCQRXCBHZTQCBXWGQWYYBXHMBYMYQTYEXMQKYAQYRGYZSLFYKKQHYSSQYSHJGJCNXKZYCXSBXYXHYYLSTYCXQTHYSMGSCPMMGCCCCCMTZTASMGQZJHKLOSQYLSWTMXSYQKDZLJQQYPLSYCZTCQQPBBQJZCLPKHQZYYXXDTDDTSJCXFFLLCHQXMJLWCJCXTSPYCXNDTJSHJWXDQQJSKXYAMYLSJHMLALYKXCYYDMNMDQMXMCZNNCYBZKKYFLMCHCMLHXRCJJHSYLNMTJZGZGYWJXSRXCWJGJQHQZDQJDCJJZKJKGDZQGJJYJYLXZXXCDQHHHEYTMHLFSBDJSYYSHFYSTCZQLPBDRFRZTZYKYWHSZYQKWDQZRKMSYNBCRXQBJYFAZPZZEDZCJYWBCJWHYJBQSZYWRYSZPTDKZPFPBNZTKLQYHBBZPNPPTYZZYBQNYDCPJMMCYCQMCYFZZDCMNLFPBPLNGQJTBTTNJZPZBBZNJKLJQYLNBZQHKSJZNGGQSZZKYXSHPZSNBCGZKDDZQANZHJKDRTLZLSWJLJZLYWTJNDJZJHXYAYNCBGTZCSSQMNJPJYTYSWXZFKWJQTKHTZPLBHSNJZSYZBWZZZZLSYLSBJHDWWQPSLMMFBJDWAQYZTCJTBNNWZXQXCDSLQGDSDPDZHJTQQPSWLYYJZLGYXYZLCTCBJTKTYCZJTQKBSJLGMGZDMCSGPYNJZYQYYKNXRPWSZXMTNCSZZYXYBYHYZAXYWQCJTLLCKJJTJHGDXDXYQYZZBYWDLWQCGLZGJGQRQZCZSSBCRPCSKYDZNXJSQGXSSJMYDNSTZTPBDLTKZWXQWQTZEXNQCZGWEZKSSBYBRTSSSLCCGBPSZQSZLCCGLLLZXHZQTHCZMQGYZQZNMCOCSZJMMZSQPJYGQLJYJPPLDXRGZYXCCSXHSHGTZNLZWZKJCXTCFCJXLBMQBCZZWPQDNHXLJCTHYZLGYLNLSZZPCXDSCQQHJQKSXZPBAJYEMSMJTZDXLCJYRYYNWJBNGZZTMJXLTBSLYRZPYLSSCNXPHLLHYLLQQZQLXYMRSYCXZLMMCZLTZSDWTJJLLNZGGQXPFSKYGYGHBFZPDKMWGHCXMSGDXJMCJZDYCABXJDLNBCDQYGSKYDQTXDJJYXMSZQAZDZFSLQXYJSJZYLBTXXWXQQZBJZUFBBLYLWDSLJHXJYZJWTDJCZFQZQZZDZSXZZQLZCDZFJHYSPYMPQZMLPPLFFXJJNZZYLSJEYQZFPFZKSYWJJJHRDJZZXTXXGLGHYDXCSKYSWMMZCWYBAZBJKSHFHJCXMHFQHYXXYZFTSJYZFXYXPZLCHMZMBXHZZSXYFYMNCWDABAZLXKTCSHHXKXJJZJSTHYGXSXYYHHHJWXKZXSSBZZWHHHCWTZZZPJXSNXQQJGZYZYWLLCWXZFXXYXYHXMKYYSWSQMNLNAYCYSPMJKHWCQHYLAJJMZXHMMCNZHBHXCLXTJPLTXYJHDYYLTTXFSZHYXXSJBJYAYRSMXYPLCKDUYHLXRLNLLSTYZYYQYGYHHSCCSMZCTZQXKYQFPYYRPFFLKQUNTSZLLZMWWTCQQYZWTLLMLMPWMBZSSTZRBPDDTLQJJBXZCSRZQQYGWCSXFWZLXCCRSZDZMCYGGDZQSGTJSWLJMYMMZYHFBJDGYXCCPSHXNZCSBSJYJGJMPPWAFFYFNXHYZXZYLREMZGZCYZSSZDLLJCSQFNXZKPTXZGXJJGFMYYYSNBTYLBNLHPFZDCYFBMGQRRSSSZXYSGTZRNYDZZCDGPJAFJFZKNZBLCZSZPSGCYCJSZLMLRSZBZZLDLSLLYSXSQZQLYXZLSKKBRXBRBZCYCXZZZEEYFGKLZLYYHGZSGZLFJHGTGWKRAAJYZKZQTSSHJJXDCYZUYJLZYRZDQQHGJZXSSZBYKJPBFRTJXLLFQWJHYLQTYMBLPZDXTZYGBDHZZRBGXHWNJTJXLKSCFSMWLSDQYSJTXKZSCFWJLBXFTZLLJZLLQBLSQMQQCGCZFPBPHZCZJLPYYGGDTGWDCFCZQYYYQYSSCLXZSKLZZZGFFCQNWGLHQYZJJCZLQZZYJPJZZBPDCCMHJGXDQDGDLZQMFGPSYTSDYFWWDJZJYSXYYCZCYHZWPBYKXRYLYBHKJKSFXTZJMMCKHLLTNYYMSYXYZPYJQYCSYCWMTJJKQYRHLLQXPSGTLYYCLJSCPXJYZFNMLRGJJTYZBXYZMSJYJHHFZQMSYXRSZCWTLRTQZSSTKXGQKGSPTGCZNJSJCQCXHMXGGZTQYDJKZDLBZSXJLHYQGGGTHQSZPYHJHHGYYGKGGCWJZZYLCZLXQSFTGZSLLLMLJSKCTBLLZZSZMMNYTPZSXQHJCJYQXYZXZQZCPSHKZZYSXCDFGMWQRLLQXRFZTLYSTCTMJCXJJXHJNXTNRZTZFQYHQGLLGCXSZSJDJLJCYDSJTLNYXHSZXCGJZYQPYLFHDJSBPCCZHJJJQZJQDYBSSLLCMYTTMQTBHJQNNYGKYRQYQMZGCJKPDCGMYZHQLLSLLCLMHOLZGDYYFZSLJCQZLYLZQJESHNYLLJXGJXLYSYYYXNBZLJSSZCQQCJYLLZLTJYLLZLLBNYLGQCHXYYXOXCXQKYJXXXYKLXSXXYQXCYKQXQCSGYXXYQXYGYTQOHXHXPYXXXULCYEYCHZZCBWQBBWJQZSCSZSSLZYLKDESJZWMYMCYTSDSXXSCJPQQSQYLYYZYCMDJDZYWCBTJSYDJKCYDDJLBDJJSODZYSYXQQYXDHHGQQYQHDYXWGMMMAJDYBBBPPBCMUUPLJZSMTXERXJMHQNUTPJDCBSSMSSSTKJTSSMMTRCPLZSZMLQDSDMJMQPNQDXCFYNBFSDQXYXHYAYKQYDDLQYYYSSZBYDSLNTFQTZQPZMCHDHCZCWFDXTMYQSPHQYYXSRGJCWTJTZZQMGWJJTJHTQJBBHWZPXXHYQFXXQYWYYHYSCDYDHHQMNMTMWCPBSZPPZZGLMZFOLLCFWHMMSJZTTDHZZYFFYTZZGZYSKYJXQYJZQBHMBZZLYGHGFMSHPZFZSNCLPBQSNJXZSLXXFPMTYJYGBXLLDLXPZJYZJYHHZCYWHJYLSJEXFSZZYWXKZJLUYDTMLYMQJPWXYHXSKTQJEZRPXXZHHMHWQPWQLYJJQJJZSZCPHJLCHHNXJLQWZJHBMZYXBDHHYPZLHLHLGFWLCHYYTLHJXCJMSCPXSTKPNHQXSRTYXXTESYJCTLSSLSTDLLLWWYHDHRJZSFGXTSYCZYNYHTDHWJSLHTZDQDJZXXQHGYLTZPHCSQFCLNJTCLZPFSTPDYNYLGMJLLYCQHYSSHCHYLHQYQTMZYPBYWRFQYKQSYSLZDQJMPXYYSSRHZJNYWTQDFZBWWTWWRXCWHGYHXMKMYYYQMSMZHNGCEPMLQQMTCWCTMMPXJPJJHFXYYZSXZHTYBMSTSYJTTQQQYYLHYNPYQZLCYZHZWSMYLKFJXLWGXYPJYTYSYXYMZCKTTWLKSMZSYLMPWLZWXWQZSSAQSYXYRHSSNTSRAPXCPWCMGDXHXZDZYFJHGZTTSBJHGYZSZYSMYCLLLXBTYXHBBZJKSSDMALXHYCFYGMQYPJYCQXJLLLJGSLZGQLYCJCCZOTYXMTMTTLLWTGPXYMZMKLPSZZZXHKQYSXCTYJZYHXSHYXZKXLZWPSQPYHJWPJPWXQQYLXSDHMRSLZZYZWTTCYXYSZZSHBSCCSTPLWSSCJCHNLCGCHSSPHYLHFHHXJSXYLLNYLSZDHZXYLSXLWZYKCLDYAXZCMDDYSPJTQJZLNWQPSSSWCTSTSZLBLNXSMNYYMJQBQHRZWTYYDCHQLXKPZWBGQYBKFCMZWPZLLYYLSZYDWHXPSBCMLJBSCGBHXLQHYRLJXYSWXWXZSLDFHLSLYNJLZYFLYJYCDRJLFSYZFSLLCQYQFGJYHYXZLYLMSTDJCYHBZLLNWLXXYGYYHSMGDHXXHHLZZJZXCZZZCYQZFNGWPYLCPKPYYPMCLQKDGXZGGWQBDXZZKZFBXXLZXJTPJPTTBYTSZZDWSLCHZHSLTYXHQLHYXXXYYZYSWTXZKHLXZXZPYHGCHKCFSYHUTJRLXFJXPTZTWHPLYXFCRHXSHXKYXXYHZQDXQWULHYHMJTBFLKHTXCWHJFWJCFPQRYQXCYYYQYGRPYWSGSUNGWCHKZDXYFLXXHJJBYZWTSXXNCYJJYMSWZJQRMHXZWFQSYLZJZGBHYNSLBGTTCSYBYXXWXYHXYYXNSQYXMQYWRGYQLXBBZLJSYLPSYTJZYHYZAWLRORJMKSCZJXXXYXCHDYXRYXXJDTSQFXLYLTSFFYXLMTYJMJUYYYXLTZCSXQZQHZXLYYXZHDNBRXXXJCTYHLBRLMBRLLAXKYLLLJLYXXLYCRYLCJTGJCMTLZLLCYZZPZPCYAWHJJFYBDYYZSMPCKZDQYQPBPCJPDCYZMDPBCYYDYCNNPLMTMLRMFMMGWYZBSJGYGSMZQQQZTXMKQWGXLLPJGZBQCDJJJFPKJKCXBLJMSWMDTQJXLDLPPBXCWRCQFBFQJCZAHZGMYKPHYYHZYKNDKZMBPJYXPXYHLFPNYYGXJDBKXNXHJMZJXSTRSTLDXSKZYSYBZXJLXYSLBZYSLHXJPFXPQNBYLLJQKYGZMCYZZYMCCSLCLHZFWFWYXZMWSXTYNXJHPYYMCYSPMHYSMYDYSHQYZCHMJJMZCAAGCFJBBHPLYZYLXXSDJGXDHKXXTXXNBHRMLYJSLTXMRHNLXQJXYZLLYSWQGDLBJHDCGJYQYCMHWFMJYBMBYJYJWYMDPWHXQLDYGPDFXXBCGJSPCKRSSYZJMSLBZZJFLJJJLGXZGYXYXLSZQYXBEXYXHGCXBPLDYHWETTWWCJMBTXCHXYQXLLXFLYXLLJLSSFWDPZSMYJCLMWYTCZPCHQEKCQBWLCQYDPLQPPQZQFJQDJHYMMCXTXDRMJWRHXCJZYLQXDYYNHYYHRSLSRSYWWZJYMTLTLLGTQCJZYABTCKZCJYCCQLJZQXALMZYHYWLWDXZXQDLLQSHGPJFJLJHJABCQZDJGTKHSSTCYJLPSWZLXZXRWGLDLZRLZXTGSLLLLZLYXXWGDZYGBDPHZPBRLWSXQBPFDWOFMWHLYPCBJCCLDMBZPBZZLCYQXLDOMZBLZWPDWYYGDSTTHCSQSCCRSSSYSLFYBFNTYJSZDFNDPDHDZZMBBLSLCMYFFGTJJQWFTMTPJWFNLBZCMMJTGBDZLQLPYFHYYMJYLSDCHDZJWJCCTLJCLDTLJJCPDDSQDSSZYBNDBJLGGJZXSXNLYCYBJXQYCBYLZCFZPPGKCXZDZFZTJJFJSJXZBNZYJQTTYJYHTYCZHYMDJXTTMPXSPLZCDWSLSHXYPZGTFMLCJTYCBPMGDKWYCYZCDSZZYHFLYCTYGWHKJYYLSJCXGYWJCBLLCSNDDBTZBSCLYZCZZSSQDLLMQYYHFSLQLLXFTYHABXGWNYWYYPLLSDLDLLBJCYXJZMLHLJDXYYQYTDLLLBUGBFDFBBQJZZMDPJHGCLGMJJPGAEHHBWCQXAXHHHZCHXYPHJAXHLPHJPGPZJQCQZGJJZZUZDMQYYBZZPHYHYBWHAZYJHYKFGDPFQSDLZMLJXKXGALXZDAGLMDGXMWZQYXXDXXPFDMMSSYMPFMDMMKXKSYZYSHDZKXSYSMMZZZMSYDNZZCZXFPLSTMZDNMXCKJMZTYYMZMZZMSXHHDCZJEMXXKLJSTLWLSQLYJZLLZJSSDPPMHNLZJCZYHMXXHGZCJMDHXTKGRMXFWMCGMWKDTKSXQMMMFZZYDKMSCLCMPCGMHSPXQPZDSSLCXKYXTWLWJYAHZJGZQMCSNXYYMMPMLKJXMHLMLQMXCTKZMJQYSZJSYSZHSYJZJCDAJZYBSDQJZGWZQQXFKDMSDJLFWEHKZQKJPEYPZYSZCDWYJFFMZZYLTTDZZEFMZLBNPPLPLPEPSZALLTYLKCKQZKGENQLWAGYXYDPXLHSXQQWQCQXQCLHYXXMLYCCWLYMQYSKGCHLCJNSZKPYZKCQZQLJPDMDZHLASXLBYDWQLWDNBQCRYDDZTJYBKBWSZDXDTNPJDTCTQDFXQQMGNXECLTTBKPWSLCTYQLPWYZZKLPYGZCQQPLLKCCYLPQMZCZQCLJSLQZDJXLDDHPZQDLJJXZQDXYZQKZLJCYQDYJPPYPQYKJYRMPCBYMCXKLLZLLFQPYLLLMBSGLCYSSLRSYSQTMXYXZQZFDZUYSYZTFFMZZSMZQHZSSCCMLYXWTPZGXZJGZGSJSGKDDHTQGGZLLBJDZLCBCHYXYZHZFYWXYZYMSDBZZYJGTSMTFXQYXQSTDGSLNXDLRYZZLRYYLXQHTXSRTZNGZXBNQQZFMYKMZJBZYMKBPNLYZPBLMCNQYZZZSJZHJCTZKHYZZJRDYZHNPXGLFZTLKGJTCTSSYLLGZRZBBQZZKLPKLCZYSSUYXBJFPNJZZXCDWXZYJXZZDJJKGGRSRJKMSMZJLSJYWQSKYHQJSXPJZZZLSNSHRNYPZTWCHKLPSRZLZXYJQXQKYSJYCZTLQZYBBYBWZPQDWWYZCYTJCJXCKCWDKKZXSGKDZXWWYYJQYYTCYTDLLXWKCZKKLCCLZCQQDZLQLCSFQCHQHSFSMQZZLNBJJZBSJHTSZDYSJQJPDLZCDCWJKJZZLPYCGMZWDJJBSJQZSYZYHHXJPBJYDSSXDZNCGLQMBTSFSBPDZDLZNFGFJGFSMPXJQLMBLGQCYYXBQKDJJQYRFKZTJDHCZKLBSDZCFJTPLLJGXHYXZCSSZZXSTJYGKGCKGYOQXJPLZPBPGTGYJZGHZQZZLBJLSQFZGKQQJZGYCZBZQTLDXRJXBSXXPZXHYZYCLWDXJJHXMFDZPFZHQHQMQGKSLYHTYCGFRZGNQXCLPDLBZCSCZQLLJBLHBZCYPZZPPDYMZZSGYHCKCPZJGSLJLNSCDSLDLXBMSTLDDFJMKDJDHZLZXLSZQPQPGJLLYBDSZGQLBZLSLKYYHZTTNTJYQTZZPSZQZTLLJTYYLLQLLQYZQLBDZLSLYYZYMDFSZSNHLXZNCZQZPBWSKRFBSYZMTHBLGJPMCZZLSTLXSHTCSYZLZBLFEQHLXFLCJLYLJQCBZLZJHHSSTBRMHXZHJZCLXFNBGXGTQJCZTMSFZKJMSSNXLJKBHSJXNTNLZDNTLMSJXGZJYJCZXYJYJWRWWQNZTNFJSZPZSHZJFYRDJSFSZJZBJFZQZZHZLXFYSBZQLZSGYFTZDCSZXZJBQMSZKJRHYJZCKMJKHCHGTXKXQGLXPXFXTRTYLXJXHDTSJXHJZJXZWZLCQSBTXWXGXTXXHXFTSDKFJHZYJFJXRZSDLLLTQSQQZQWZXSYQTWGWBZCGZLLYZBCLMQQTZHZXZXLJFRMYZFLXYSQXXJKXRMQDZDMMYYBSQBHGZMWFWXGMXLZPYYTGZYCCDXYZXYWGSYJYZNBHPZJSQSYXSXRTFYZGRHZTXSZZTHCBFCLSYXZLZQMZLMPLMXZJXSFLBYZMYQHXJSXRXSQZZZSSLYFRCZJRCRXHHZXQYDYHXSJJHZCXZBTYNSYSXJBQLPXZQPYMLXZKYXLXCJLCYSXXZZLXDLLLJJYHZXGYJWKJRWYHCPSGNRZLFZWFZZNSXGXFLZSXZZZBFCSYJDBRJKRDHHGXJLJJTGXJXXSTJTJXLYXQFCSGSWMSBCTLQZZWLZZKXJMLTMJYHSDDBXGZHDLBMYJFRZFSGCLYJBPMLYSMSXLSZJQQHJZFXGFQFQBPXZGYYQXGZTCQWYLTLGWSGWHRLFSFGZJMGMGBGTJFSYZZGZYZAFLSSPMLPFLCWBJZCLJJMZLPJJLYMQDMYYYFBGYGYZMLYZDXQYXRQQQHSYYYQXYLJTYXFSFSLLGNQCYHYCWFHCCCFXPYLYPLLZYXXXXXKQHHXSHJZCFZSCZJXCPZWHHHHHAPYLQALPQAFYHXDYLUKMZQGGGDDESRNNZLTZGCHYPPYSQJJHCLLJTOLNJPZLJLHYMHEYDYDSQYCDDHGZUNDZCLZYZLLZNTNYZGSLHSLPJJBDGWXPCDUTJCKLKCLWKLLCASSTKZZDNQNTTLYYZSSYSSZZRYLJQKCQDHHCRXRZYDGRGCWCGZQFFFPPJFZYNAKRGYWYQPQXXFKJTSZZXSWZDDFBBXTBGTZKZNPZZPZXZPJSZBMQHKCYXYLDKLJNYPKYGHGDZJXXEAHPNZKZTZCMXCXMMJXNKSZQNMNLWBWWXJKYHCPSTMCSQTZJYXTPCTPDTNNPGLLLZSJLSPBLPLQHDTNJNLYYRSZFFJFQWDPHZDWMRZCCLODAXNSSNYZRESTYJWJYJDBCFXNMWTTBYLWSTSZGYBLJPXGLBOCLHPCBJLTMXZLJYLZXCLTPNCLCKXTPZJSWCYXSFYSZDKNTLBYJCYJLLSTGQCBXRYZXBXKLYLHZLQZLNZCXWJZLJZJNCJHXMNZZGJZZXTZJXYCYYCXXJYYXJJXSSSJSTSSTTPPGQTCSXWZDCSYFPTFBFHFBBLZJCLZZDBXGCXLQPXKFZFLSYLTUWBMQJHSZBMDDBCYSCCLDXYCDDQLYJJWMQLLCSGLJJSYFPYYCCYLTJANTJJPWYCMMGQYYSXDXQMZHSZXPFTWWZQSWQRFKJLZJQQYFBRXJHHFWJJZYQAZMYFRHCYYBYQWLPEXCCZSTYRLTTDMQLYKMBBGMYYJPRKZNPBSXYXBHYZDJDNGHPMFSGMWFZMFQMMBCMZZCJJLCNUXYQLMLRYGQZCYXZLWJGCJCGGMCJNFYZZJHYCPRRCMTZQZXHFQGTJXCCJEAQCRJYHPLQLSZDJRBCQHQDYRHYLYXJSYMHZYDWLDFRYHBPYDTSSCNWBXGLPZMLZZTQSSCPJMXXYCSJYTYCGHYCJWYRXXLFEMWJNMKLLSWTXHYYYNCMMCWJDQDJZGLLJWJRKHPZGGFLCCSCZMCBLTBHBQJXQDSPDJZZGHGLFQYWBZYZJLTSTDHQHCTCBCHFLQMPWDSHYYTQWCNZZJTLBYMBPDYYYXSQKXWYYFLXXNCWCXYPMAELYKKJMZZZBRXYYQJFLJPFHHHYTZZXSGQQMHSPGDZQWBWPJHZJDYSCQWZKTXXSQLZYYMYSDZGRXCKKUJLWPYSYSCSYZLRMLQSYLJXBCXTLWDQZPCYCYKPPPNSXFYZJJRCEMHSZMSXLXGLRWGCSTLRSXBZGBZGZTCPLUJLSLYLYMTXMTZPALZXPXJTJWTCYYZLBLXBZLQMYLXPGHDSLSSDMXMBDZZSXWHAMLCZCPJMCNHJYSNSYGCHSKQMZZQDLLKABLWJXSFMOCDXJRRLYQZKJMYBYQLYHETFJZFRFKSRYXFJTWDSXXSYSQJYSLYXWJHSNLXYYXHBHAWHHJZXWMYLJCSSLKYDZTXBZSYFDXGXZJKHSXXYBSSXDPYNZWRPTQZCZENYGCXQFJYKJBZMLJCMQQXUOXSLYXXLYLLJDZBTYMHPFSTTQQWLHOKYBLZZALZXQLHZWRRQHLSTMYPYXJJXMQSJFNBXYXYJXXYQYLTHYLQYFMLKLJTMLLHSZWKZHLJMLHLJKLJSTLQXYLMBHHLNLZXQJHXCFXXLHYHJJGBYZZKBXSCQDJQDSUJZYYHZHHMGSXCSYMXFEBCQWWRBPYYJQTYZCYQYQQZYHMWFFHGZFRJFCDPXNTQYZPDYKHJLFRZXPPXZDBBGZQSTLGDGYLCQMLCHHMFYWLZYXKJLYPQHSYWMQQGQZMLZJNSQXJQSYJYCBEHSXFSZPXZWFLLBCYYJDYTDTHWZSFJMQQYJLMQXXLLDTTKHHYBFPWTYYSQQWNQWLGWDEBZWCMYGCULKJXTMXMYJSXHYBRWFYMWFRXYQMXYSZTZZTFYKMLDHQDXWYYNLCRYJBLPSXCXYWLSPRRJWXHQYPHTYDNXHHMMYWYTZCSQMTSSCCDALWZTCPQPYJLLQZYJSWXMZZMMYLMXCLMXCZMXMZSQTZPPQQBLPGXQZHFLJJHYTJSRXWZXSCCDLXTYJDCQJXSLQYCLZXLZZXMXQRJMHRHZJBHMFLJLMLCLQNLDXZLLLPYPSYJYSXCQQDCMQJZZXHNPNXZMEKMXHYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZYPFDWFGZZRPYMTNGXZQBYXNBUFNQKRJQZMJEGRZGYCLKXZDSKKNSXKCLJSPJYYZLQQJYBZSSQLLLKJXTBKTYLCCDDBLSPPFYLGYDTZJYQGGKQTTFZXBDKTYYHYBBFYTYYBCLPDYTGDHRYRNJSPTCSNYJQHKLLLZSLYDXXWBCJQSPXBPJZJCJDZFFXXBRMLAZHCSNDLBJDSZBLPRZTSWSBXBCLLXXLZDJZSJPYLYXXYFTFFFBHJJXGBYXJPMMMPSSJZJMTLYZJXSWXTYLEDQPJMYGQZJGDJLQJWJQLLSJGJGYGMSCLJJXDTYGJQJQJCJZCJGDZZSXQGSJGGCXHQXSNQLZZBXHSGZXCXYLJXYXYYDFQQJHJFXDHCTXJYRXYSQTJXYEFYYSSYYJXNCYZXFXMSYSZXYYSCHSHXZZZGZZZGFJDLTYLNPZGYJYZYYQZPBXQBDZTZCZYXXYHHSQXSHDHGQHJHGYWSZTMZMLHYXGEBTYLZKQWYTJZRCLEKYSTDBCYKQQSAYXCJXWWGSBHJYZYDHCSJKQCXSWXFLTYNYZPZCCZJQTZWJQDZZZQZLJJXLSBHPYXXPSXSHHEZTXFPTLQYZZXHYTXNCFZYYHXGNXMYWXTZSJPTHHGYMXMXQZXTSBCZYJYXXTYYZYPCQLMMSZMJZZLLZXGXZAAJZYXJMZXWDXZSXZDZXLEYJJZQBHZWZZZQTZPSXZTDSXJJJZNYAZPHXYYSRNQDTHZHYYKYJHDZXZLSWCLYBZYECWCYCRYLCXNHZYDZYDYJDFRJJHTRSQTXYXJRJHOJYNXELXSFSFJZGHPZSXZSZDZCQZBYYKLSGSJHCZSHDGQGXYZGXCHXZJWYQWGYHKSSEQZZNDZFKWYSSTCLZSTSYMCDHJXXYWEYXCZAYDMPXMDSXYBSQMJMZJMTZQLPJYQZCGQHXJHHLXXHLHDLDJQCLDWBSXFZZYYSCHTYTYYBHECXHYKGJPXHHYZJFXHWHBDZFYZBCAPNPGNYDMSXHMMMMAMYNBYJTMPXYYMCTHJBZYFCGTYHWPHFTWZZEZSBZEGPFMTSKFTYCMHFLLHGPZJXZJGZJYXZSBBQSCZZLZCCSTPGXMJSFTCCZJZDJXCYBZLFCJSYZFGSZLYBCWZZBYZDZYPSWYJZXZBDSYUXLZZBZFYGCZXBZHZFTPBGZGEJBSTGKDMFHYZZJHZLLZZGJQZLSFDJSSCBZGPDLFZFZSZYZYZSYGCXSNXXCHCZXTZZLJFZGQSQYXZJQDCCZTQCDXZJYQJQCHXZTDLGSCXZSYQJQTZWLQDQZTQCHQQJZYEZZZPBWKDJFCJPZTYPQYQTTYNLMBDKTJZPQZQZZFPZSBNJLGYJDXJDZZKZGQKXDLPZJTCJDQBXDJQJSTCKNXBXZMSLYJCQMTJQWWCJQNJNLLLHJCWQTBZQYDZCZPZZDZYDDCYZZZCCJTTJFZDPRRTZTJDCQTQZDTJNPLZBCLLCTZSXKJZQZPZLBZRBTJDCXFCZDBCCJJLTQQPLDCGZDBBZJCQDCJWYNLLZYZCCDWLLXWZLXRXNTQQCZXKQLSGDFQTDDGLRLAJJTKUYMKQLLTZYTDYYCZGJWYXDXFRSKSTQTENQMRKQZHHQKDLDAZFKYPBGGPZREBZZYKZZSPEGJXGYKQZZZSLYSYYYZWFQZYLZZLZHWCHKYPQGNPGBLPLRRJYXCCSYYHSFZFYBZYYTGZXYLXCZWXXZJZBLFFLGSKHYJZEYJHLPLLLLCZGXDRZELRHGKLZZYHZLYQSZZJZQLJZFLNBHGWLCZCFJYSPYXZLZLXGCCPZBLLCYBBBBUBBCBPCRNNZCZYRBFSRLDCGQYYQXYGMQZWTZYTYJXYFWTEHZZJYWLCCNTZYJJZDEDPZDZTSYQJHDYMBJNYJZLXTSSTPHNDJXXBYXQTZQDDTJTDYYTGWSCSZQFLSHLGLBCZPHDLYZJYCKWTYTYLBNYTSDSYCCTYSZYYEBHEXHQDTWNYGYCLXTSZYSTQMYGZAZCCSZZDSLZCLZRQXYYELJSBYMXSXZTEMBBLLYYLLYTDQYSHYMRQWKFKBFXNXSBYCHXBWJYHTQBPBSBWDZYLKGZSKYHXQZJXHXJXGNLJKZLYYCDXLFYFGHLJGJYBXQLYBXQPQGZTZPLNCYPXDJYQYDYMRBESJYYHKXXSTMXRCZZYWXYQYBMCLLYZHQYZWQXDBXBZWZMSLPDMYSKFMZKLZCYQYCZLQXFZZYDQZPZYGYJYZMZXDZFYFYTTQTZHGSPCZMLCCYTZXJCYTJMKSLPZHYSNZLLYTPZCTZZCKTXDHXXTQCYFKSMQCCYYAZHTJPCYLZLYJBJXTPNYLJYYNRXSYLMMNXJSMYBCSYSYLZYLXJJQYLDZLPQBFZZBLFNDXQKCZFYWHGQMRDSXYCYTXNQQJZYYPFZXDYZFPRXEJDGYQBXRCNFYYQPGHYJDYZXGRHTKYLNWDZNTSMPKLBTHBPYSZBZTJZSZZJTYYXZPHSSZZBZCZPTQFZMYFLYPYBBJQXZMXXDJMTSYSKKBJZXHJCKLPSMKYJZCXTMLJYXRZZQSLXXQPYZXMKYXXXJCLJPRMYYGADYSKQLSNDHYZKQXZYZTCGHZTLMLWZYBWSYCTBHJHJFCWZTXWYTKZLXQSHLYJZJXTMPLPYCGLTBZZTLZJCYJGDTCLKLPLLQPJMZPAPXYZLKKTKDZCZZBNZDYDYQZJYJGMCTXLTGXSZLMLHBGLKFWNWZHDXUHLFMKYSLGXDTWWFRJEJZTZHYDXYKSHWFZCQSHKTMQQHTZHYMJDJSKHXZJZBZZXYMPAGQMSTPXLSKLZYNWRTSQLSZBPSPSGZWYHTLKSSSWHZZLYYTNXJGMJSZSUFWNLSOZTXGXLSAMMLBWLDSZYLAKQCQCTMYCFJBSLXCLZZCLXXKSBZQCLHJPSQPLSXXCKSLNHPSFQQYTXYJZLQLDXZQJZDYYDJNZPTUZDSKJFSLJHYLZSQZLBTXYDGTQFDBYAZXDZHZJNHHQBYKNXJJQCZMLLJZKSPLDYCLBBLXKLELXJLBQYCXJXGCNLCQPLZLZYJTZLJGYZDZPLTQCSXFDMNYCXGBTJDCZNBGBQYQJWGKFHTNPYQZQGBKPBBYZMTJDYTBLSQMPSXTBNPDXKLEMYYCJYNZCTLDYKZZXDDXHQSHDGMZSJYCCTAYRZLPYLTLKXSLZCGGEXCLFXLKJRTLQJAQZNCMBYDKKCXGLCZJZXJHPTDJJMZQYKQSECQZDSHHADMLZFMMZBGNTJNNLGBYJBRBTMLBYJDZXLCJLPLDLPCQDHLXZLYCBLCXZZJADJLNZMMSSSMYBHBSQKBHRSXXJMXSDZNZPXLGBRHWGGFCXGMSKLLTSJYYCQLTSKYWYYHYWXBXQYWPYWYKQLSQPTNTKHQCWDQKTWPXXHCPTHTWUMSSYHBWCRWXHJMKMZNGWTMLKFGHKJYLSYYCXWHYECLQHKQHTTQKHFZLDXQWYZYYDESBPKYRZPJFYYZJCEQDZZDLATZBBFJLLCXDLMJSSXEGYGSJQXCWBXSSZPDYZCXDNYXPPZYDLYJCZPLTXLSXYZYRXCYYYDYLWWNZSAHJSYQYHGYWWAXTJZDAXYSRLTDPSSYYFNEJDXYZHLXLLLZQZSJNYQYQQXYJGHZGZCYJCHZLYCDSHWSHJZYJXCLLNXZJJYYXNFXMWFPYLCYLLABWDDHWDXJMCXZTZPMLQZHSFHZYNZTLLDYWLSLXHYMMYLMBWWKYXYADTXYLLDJPYBPWUXJMWMLLSAFDLLYFLBHHHBQQLTZJCQJLDJTFFKMMMBYTHYGDCQRDDWRQJXNBYSNWZDBYYTBJHPYBYTTJXAAHGQDQTMYSTQXKBTZPKJLZRBEQQSSMJJBDJOTGTBXPGBKTLHQXJJJCTHXQDWJLWRFWQGWSHCKRYSWGFTGYGBXSDWDWRFHWYTJJXXXJYZYSLPYYYPAYXHYDQKXSHXYXGSKQHYWFDDDPPLCJLQQEEWXKSYYKDYPLTJTHKJLTCYYHHJTTPLTZZCDLTHQKZXQYSTEEYWYYZYXXYYSTTJKLLPZMCYHQGXYHSRMBXPLLNQYDQHXSXXWGDQBSHYLLPJJJTHYJKYPPTHYYKTYEZYENMDSHLCRPQFDGFXZPSFTLJXXJBSWYYSKSFLXLPPLBBBLBSFXFYZBSJSSYLPBBFFFFSSCJDSTZSXZRYYSYFFSYZYZBJTBCTSBSDHRTJJBYTCXYJEYLXCBNEBJDSYXYKGSJZBXBYTFZWGENYHHTHZHHXFWGCSTBGXKLSXYWMTMBYXJSTZSCDYQRCYTWXZFHMYMCXLZNSDJTTTXRYCFYJSBSDYERXJLJXBBDEYNJGHXGCKGSCYMBLXJMSZNSKGXFBNBPTHFJAAFXYXFPXMYPQDTZCXZZPXRSYWZDLYBBKTYQPQJPZYPZJZNJPZJLZZFYSBTTSLMPTZRTDXQSJEHBZYLZDHLJSQMLHTXTJECXSLZZSPKTLZKQQYFSYGYWPCPQFHQHYTQXZKRSGTTSQCZLPTXCDYYZXSQZSLXLZMYCPCQBZYXHBSXLZDLTCDXTYLZJYYZPZYZLTXJSJXHLPMYTXCQRBLZSSFJZZTNJYTXMYJHLHPPLCYXQJQQKZZSCPZKSWALQSBLCCZJSXGWWWYGYKTJBBZTDKHXHKGTGPBKQYSLPXPJCKBMLLXDZSTBKLGGQKQLSBKKTFXRMDKBFTPZFRTBBRFERQGXYJPZSSTLBZTPSZQZSJDHLJQLZBPMSMMSXLQQNHKNBLRDDNXXDHDDJCYYGYLXGZLXSYGMQQGKHBPMXYXLYTQWLWGCPBMQXCYZYDRJBHTDJYHQSHTMJSBYPLWHLZFFNYPMHXXHPLTBQPFBJWQDBYGPNZTPFZJGSDDTQSHZEAWZZYLLTYYBWJKXXGHLFKXDJTMSZSQYNZGGSWQSPHTLSSKMCLZXYSZQZXNCJDQGZDLFNYKLJCJLLZLMZZNHYDSSHTHZZLZZBBHQZWWYCRZHLYQQJBEYFXXXWHSRXWQHWPSLMSSKZTTYGYQQWRSLALHMJTQJSMXQBJJZJXZYZKXBYQXBJXSHZTSFJLXMXZXFGHKZSZGGYLCLSARJYHSLLLMZXELGLXYDJYTLFBHBPNLYZFBBHPTGJKWETZHKJJXZXXGLLJLSTGSHJJYQLQZFKCGNNDJSSZFDBCTWWSEQFHQJBSAQTGYPQLBXBMMYWXGSLZHGLZGQYFLZBYFZJFRYSFMBYZHQGFWZSYFYJJPHZBYYZFFWODGRLMFTWLBZGYCQXCDJYGZYYYYTYTYDWEGAZYHXJLZYYHLRMGRXXZCLHNELJJTJTPWJYBJJBXJJTJTEEKHWSLJPLPSFYZPQQBDLQJJTYYQLYZKDKSQJYYQZLDQTGJQYZJSUCMRYQTHTEJMFCTYHYPKMHYZWJDQFHYYXWSHCTXRLJHQXHCCYYYJLTKTTYTMXGTCJTZAYYOCZLYLBSZYWJYTSJYHBYSHFJLYGJXXTMZYYLTXXYPZLXYJZYZYYPNHMYMDYYLBLHLSYYQQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZGLHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY",oMultiDiff={ +19969:"DZ",19975:"WM",19988:"QJ",20048:"YL",20056:"SC",20060:"NM",20094:"QG",20127:"QJ",20167:"QC",20193:"YG",20250:"KH",20256:"ZC",20282:"SC",20285:"QJG",20291:"TD",20314:"YD",20315:"BF",20340:"NE",20375:"TD",20389:"YJ",20391:"CZ",20415:"PB",20446:"YS",20447:"SQ",20504:"TC",20608:"KG",20854:"QJ",20857:"ZC",20911:"PF",20985:"AW",21032:"PB",21048:"XQ",21049:"SC",21089:"YS",21119:"JC",21242:"SB",21273:"SC",21305:"YP",21306:"QO",21330:"ZC",21333:"SDC",21345:"QK",21378:"CA",21397:"SC",21414:"XS",21442:"SC",21477:"JG",21480:"TD",21484:"ZS",21494:"YX",21505:"YX",21512:"HG",21523:"XH",21537:"PB",21542:"PF",21549:"KH",21571:"E",21574:"DA",21588:"TD",21589:"O",21618:"ZC",21621:"KHA",21632:"ZJ",21654:"KG",21679:"LKG",21683:"KH",21710:"A",21719:"YH",21734:"WOE",21769:"A",21780:"WN",21804:"XH",21834:"A",21899:"ZD",21903:"RN",21908:"WO",21939:"ZC",21956:"SA",21964:"YA",21970:"TD",22003:"A",22031:"JG",22040:"XS",22060:"ZC",22066:"ZC",22079:"MH",22129:"XJ",22179:"XA",22237:"NJ",22244:"TD",22280:"JQ",22300:"YH",22313:"XW",22331:"YQ",22343:"YJ",22351:"PH",22395:"DC",22412:"TD",22484:"PB",22500:"PB",22534:"ZD",22549:"DH",22561:"PB",22612:"TD",22771:"KQ",22831:"HB",22841:"JG",22855:"QJ",22865:"XQ",23013:"ML",23081:"WM",23487:"SX",23558:"QJ",23561:"YW",23586:"YW",23614:"YW",23615:"SN",23631:"PB",23646:"ZS",23663:"ZT",23673:"YG",23762:"TD",23769:"ZS",23780:"QJ",23884:"QK",24055:"XH",24113:"DC",24162:"ZC",24191:"GA",24273:"QJ",24324:"NL",24377:"TD",24378:"QJ",24439:"PF",24554:"ZS",24683:"TD",24694:"WE",24733:"LK",24925:"TN",25094:"ZG",25100:"XQ",25103:"XH",25153:"PB",25170:"PB",25179:"KG",25203:"PB",25240:"ZS",25282:"FB",25303:"NA",25324:"KG",25341:"ZY",25373:"WZ",25375:"XJ",25384:"A",25457:"A",25528:"SD",25530:"SC",25552:"TD",25774:"ZC",25874:"ZC",26044:"YW",26080:"WM",26292:"PB",26333:"PB",26355:"ZY",26366:"CZ",26397:"ZC",26399:"QJ",26415:"ZS",26451:"SB",26526:"ZC",26552:"JG",26561:"TD",26588:"JG",26597:"CZ",26629:"ZS",26638:"YL",26646:"XQ",26653:"KG",26657:"XJ",26727:"HG",26894:"ZC",26937:"ZS",26946:"ZC",26999:"KJ",27099:"KJ",27449:"YQ",27481:"XS",27542:"ZS",27663:"ZS",27748:"TS",27784:"SC",27788:"ZD",27795:"TD",27812:"O",27850:"PB",27852:"MB",27895:"SL",27898:"PL",27973:"QJ",27981:"KH",27986:"HX",27994:"XJ",28044:"YC",28065:"WG",28177:"SM",28267:"QJ",28291:"KH",28337:"ZQ",28463:"TL",28548:"DC",28601:"TD",28689:"PB",28805:"JG",28820:"QG",28846:"PB",28952:"TD",28975:"ZC",29100:"A",29325:"QJ",29575:"SL",29602:"FB",30010:"TD",30044:"CX",30058:"PF",30091:"YSP",30111:"YN",30229:"XJ",30427:"SC",30465:"SX",30631:"YQ",30655:"QJ",30684:"QJG",30707:"SD",30729:"XH",30796:"LG",30917:"PB",31074:"NM",31085:"JZ",31109:"SC",31181:"ZC",31192:"MLB",31293:"JQ",31400:"YX",31584:"YJ",31896:"ZN",31909:"ZY",31995:"XJ",32321:"PF",32327:"ZY",32418:"HG",32420:"XQ",32421:"HG",32438:"LG",32473:"GJ",32488:"TD",32521:"QJ",32527:"PB",32562:"ZSQ",32564:"JZ",32735:"ZD",32793:"PB",33071:"PF",33098:"XL",33100:"YA",33152:"PB",33261:"CX",33324:"BP",33333:"TD",33406:"YA",33426:"WM",33432:"PB",33445:"JG",33486:"ZN",33493:"TS",33507:"QJ",33540:"QJ",33544:"ZC",33564:"XQ",33617:"YT",33632:"QJ",33636:"XH",33637:"YX",33694:"WG",33705:"PF",33728:"YW",33882:"SR",34067:"WM",34074:"YW",34121:"QJ",34255:"ZC",34259:"XL",34425:"JH",34430:"XH",34485:"KH",34503:"YS",34532:"HG",34552:"XS",34558:"YE",34593:"ZL",34660:"YQ",34892:"XH",34928:"SC",34999:"QJ",35048:"PB",35059:"SC",35098:"ZC",35203:"TQ",35265:"JX",35299:"JX",35782:"SZ",35828:"YS",35830:"E",35843:"TD",35895:"YG",35977:"MH",36158:"JG",36228:"QJ",36426:"XQ",36466:"DC",36710:"JC",36711:"ZYG",36767:"PB",36866:"SK",36951:"YW",37034:"YX",37063:"XH",37218:"ZC",37325:"ZC",38063:"PB",38079:"TD",38085:"QY",38107:"DC",38116:"TD",38123:"YD",38224:"HG",38241:"XTC",38271:"ZC",38415:"YE",38426:"KH",38461:"YD",38463:"AE",38466:"PB",38477:"XJ",38518:"YT",38551:"WK",38585:"ZC",38704:"XS",38739:"LJ",38761:"GJ",38808:"SQ",39048:"JG",39049:"XJ",39052:"HG",39076:"CZ",39271:"XT",39534:"TD",39552:"TD",39584:"PB",39647:"SB",39730:"LG",39748:"TPB",40109:"ZQ",40479:"ND",40516:"HG",40536:"HG",40583:"QJ",40765:"YQ",40784:"QJ",40840:"YK",40863:"QJG"},_checkPYCh=function(ch){var uni=ch.charCodeAt(0);return uni>40869||uni<19968?ch:oMultiDiff[uni]?oMultiDiff[uni]:_ChineseFirstPY.charAt(uni-19968)},_mkPYRslt=function(arr,ignoreMulti){for(var arrRslt=[""],k,multiLen=0,i=0,len=arr.length;i14||ignoreMulti){var tmpStr=str.substring(0,1);for(k=0;k0&&(this._items[0]=lastElt,this._sinkDown(0)),elt}},push:function(item){this._items[this._size++]=item,this._bubbleUp(this._size-1)},size:function(){return this._size},peek:function(){if(0!==this._size)return this._items[0]},_heapify:function(){for(var index=Math.floor((this._size+1)/2);index>=0;index--)this._sinkDown(index)},_bubbleUp:function(index){for(var elt=this._items[index];index>0;){var parentIndex=Math.floor((index+1)/2)-1,parentElt=this._items[parentIndex];if(this._comparator(parentElt,elt))return;this._items[parentIndex]=elt,this._items[index]=parentElt,index=parentIndex}},_sinkDown:function(index){for(var elt=this._items[index];;){var leftChildIndex=2*(index+1)-1,rightChildIndex=2*(index+1),swapIndex=-1;if(leftChildIndex=0;--i)xs[i]=0;return xs},ceilLog2=function(x){for(var y=1;y0;--i)this._heap[i]=this._heap[2*i]+this._heap[2*i+1]},BI.PrefixIntervalTree.prototype={constructor:BI.PrefixIntervalTree,set:function(index,value){var node=this._half+index;for(this._heap[node]=value,node=parent(node);0!==node;node=parent(node))this._heap[node]=this._heap[2*node]+this._heap[2*node+1]},get:function(index){var node=this._half+index;return this._heap[node]},getSize:function(){return this._size},sumUntil:function(end){if(0===end)return 0;for(var node=this._half+end-1,sum=this._heap[node];1!==node;node=parent(node))node%2===1&&(sum+=this._heap[node-1]);return sum},sumTo:function(inclusiveEnd){return this.sumUntil(inclusiveEnd+1)},sum:function(begin,end){return this.sumUntil(end)-this.sumUntil(begin)},greatestLowerBound:function(t){if(t<0)return-1;var node=1;if(this._heap[node]<=t)return this._size;for(;node=0;--i)xs[i]=initialValue;return new BI.PrefixIntervalTree(xs)},BI.PrefixIntervalTree.empty=function(size){return BI.PrefixIntervalTree.uniform(size,0)}}(),!function(){BI.Queue=function(capacity){this.capacity=capacity,this.array=[]},BI.Queue.prototype={constructor:BI.Queue,contains:function(v){return BI.contains(this.array,v)},indexOf:function(v){return BI.contains(this.array,v)},getElementByIndex:function(index){return this.array[index]},push:function(v){this.array.push(v),this.capacity&&this.array.length>this.capacity&&this.array.shift()},pop:function(){this.array.pop()},shift:function(){this.array.shift()},unshift:function(v){this.array.unshift(v),this.capacity&&this.array.length>this.capacity&&this.array.pop()},remove:function(v){BI.remove(this.array,v)},splice:function(){this.array.splice.apply(this.array,arguments)},slice:function(){this.array.slice.apply(this.array,arguments)},size:function(){return this.array.length},each:function(fn,scope){var scope=scope||window,fn=fn||null;if(null!=fn&&"function"==typeof fn)for(var i=0;i0?{children:children}:{})},toJSON:function(node){var self=this,result=[];return BI.each((node||this.root).getChildren(),function(i,child){result.push(self._toJSON(child))}),result},_toJSONWithNode:function(node){var self=this,children=[];return BI.each(node.getChildren(),function(i,child){children.push(self._toJSONWithNode(child))}),BI.extend({id:node.id},BI.deepClone(node.get("data")),{node:node},children.length>0?{children:children}:{})},toJSONWithNode:function(node){var self=this,result=[];return BI.each((node||this.root).getChildren(),function(i,child){result.push(self._toJSONWithNode(child))}),result},search:function(root,target,param){if(!(root instanceof BI.Node))return arguments.callee.apply(this,[this.root,root,target]);var self=this,next=null;return BI.isNull(target)?null:BI.isEqual(root[param||"id"],target)?root:(BI.any(root.getChildren(),function(i,child){if(next=self.search(child,target,param),null!==next)return!0}),next)},_traverse:function(node,callback){var queue=[];for(queue.push(node);!BI.isEmpty(queue);){var temp=queue.shift(),b=callback&&callback(temp);if(b===!1)break;b!==!0&&null!=temp&&(queue=queue.concat(temp.getChildren()))}},traverse:function(callback){this._traverse(this.root,callback)},_recursion:function(node,route,callback){var self=this;return BI.every(node.getChildren(),function(i,child){var next=BI.clone(route);next.push(child.id);var b=callback&&callback(child,next);return b!==!1&&(b===!0||self._recursion(child,next,callback))})},recursion:function(callback){this._recursion(this.root,[],callback)},inOrderTraverse:function(callback){this._inOrderTraverse(this.root,callback)},_inOrderTraverse:function(node,callback){null!=node&&(this._inOrderTraverse(node.getLeft()),callback&&callback(node),this._inOrderTraverse(node.getRight()))},nrInOrderTraverse:function(callback){for(var stack=[],node=this.root;null!=node||!BI.isEmpty(stack);){for(;null!=node;)stack.push(node),node=node.getLeft();node=stack.pop(),callback&&callback(node),node=node.getRight()}},preOrderTraverse:function(callback){this._preOrderTraverse(this.root,callback)},_preOrderTraverse:function(node,callback){null!=node&&(callback&&callback(node),this._preOrderTraverse(node.getLeft()),this._preOrderTraverse(node.getRight()))},nrPreOrderTraverse:function(callback){for(var stack=[],node=this.root;null!=node||!BI.isEmpty(stack);){for(;null!=node;)callback&&callback(node),stack.push(node),node=node.getLeft();node=stack.pop(),node=node.getRight()}},postOrderTraverse:function(callback){this._postOrderTraverse(this.root,callback)},_postOrderTraverse:function(node,callback){null!=node&&(this._postOrderTraverse(node.getLeft()),this._postOrderTraverse(node.getRight()),callback&&callback(node))},nrPostOrderTraverse:function(callback){for(var stack=[],node=this.root,preNode=null;null!=node||!BI.isEmpty(stack);){for(;null!=node;)stack.push(node),node=node.getLeft();node=BI.last(stack),null==node.getRight()||node.getRight()==preNode?(callback&&callback(node),node=stack.pop(),preNode=node,node=null):node=node.getRight()}}},BI.Node=function(id){BI.isObject(id)?BI.extend(this,id):this.id=id,this.clear.apply(this,arguments)},BI.Node.prototype={constructor:BI.Node,set:function(key,value){return BI.isObject(key)?void BI.extend(this,key):void(this[key]=value)},get:function(key){return this[key]},isLeaf:function(){return BI.isEmpty(this.children)},getChildren:function(){return this.children},getChildrenLength:function(){return this.children.length},getFirstChild:function(){return BI.first(this.children)},getLastChild:function(){return BI.last(this.children)},setLeft:function(left){this.left=left},getLeft:function(){return this.left},setRight:function(right){this.right=right},getRight:function(){return this.right},setParent:function(parent){this.parent=parent},getParent:function(){return this.parent},getChild:function(index){return this.children[index]},getChildIndex:function(id){return BI.findIndex(this.children,function(i,ch){return ch.get("id")===id})},removeChild:function(id){this.removeChildByIndex(this.getChildIndex(id))},removeChildByIndex:function(index){var before=this.getChild(index-1),behind=this.getChild(index+1);null!=before&&before.setRight(behind||null),null!=behind&&behind.setLeft(before||null),this.children.splice(index,1)},removeAllChilds:function(){this.children=[]},addChild:function(child,index){var cur=null;cur=BI.isUndefined(index)?this.children.length-1:index-1,child.setParent(this),cur>=0&&(this.getChild(cur)&&this.getChild(cur).setRight(child),child.setLeft(this.getChild(cur))),BI.isUndefined(index)?this.children.push(child):this.children.splice(index,0,child)},equals:function(obj){return this===obj||this.id===obj.id},clear:function(){this.parent=null,this.left=null,this.right=null,this.children=[]}},BI.extend(BI.Tree,{transformToArrayFormat:function(nodes,pId){if(!nodes)return[];var r=[];if(BI.isArray(nodes))for(var i=0,l=nodes.length;i=this.x&&x<=this.x+this.w&&y>=this.y&&y<=this.y+this.h)},getPosition:function(){var pos=[];return pos.push(this.x+this.w/2),pos.push(this.y+this.h/2),pos}},BI.BehaviorFactory={createBehavior:function(key,options){var behavior;switch(key){case"highlight":behavior=BI.HighlightBehavior;break;case"redmark":behavior=BI.RedMarkBehavior}return new behavior(options)}},BI.Behavior=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Behavior.superclass._defaultConfig.apply(this,arguments),{rule:function(){return!0}})},_init:function(){BI.Behavior.superclass._init.apply(this,arguments)},doBehavior:function(){}}),BI.Layout=BI.inherit(BI.Widget,{props:function(){return{scrollable:null,scrollx:!1,scrolly:!1,items:[]}},render:function(){this._init4Margin(),this._init4Scroll()},_init4Margin:function(){this.options.top&&this.element.css("top",this.options.top),this.options.left&&this.element.css("left",this.options.left),this.options.bottom&&this.element.css("bottom",this.options.bottom),this.options.right&&this.element.css("right",this.options.right)},_init4Scroll:function(){switch(this.options.scrollable){case!0:this.element.css("overflow","auto");break;case!1:this.element.css("overflow","hidden")}this.options.scrollx&&this.element.css({"overflow-x":"auto","overflow-y":"hidden"}),this.options.scrolly&&this.element.css({"overflow-x":"hidden","overflow-y":"auto"})},appendFragment:function(frag){this.element.append(frag)},_mountChildren:function(){var self=this,frag=BI.Widget._renderEngine.createFragment(),hasChild=!1;BI.each(this._children,function(i,widget){widget.element!==self.element&&(frag.appendChild(widget.element[0]),hasChild=!0)}),hasChild===!0&&this.appendFragment(frag)},_getChildName:function(index){return index+""},_addElement:function(i,item,context){var self=this,w;return this.hasWidget(this._getChildName(i))?w=this.getWidgetByName(this._getChildName(i)):(w=BI.createWidget(item,context),w.on(BI.Events.DESTROY,function(){BI.each(self._children,function(name,child){child===w&&(BI.remove(self._children,child),self.removeItemAt(0|name))})}),this.addWidget(this._getChildName(i),w)),w},_getOptions:function(item){return item instanceof BI.Widget&&(item=item.options),item=BI.stripEL(item),item instanceof BI.Widget&&(item=item.options),item},_compare:function(item1,item2){function eq(a,b,aStack,bStack){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;var className=Object.prototype.toString.call(a);switch(className){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var areArrays="[object Array]"===className;if(!areArrays){if(BI.isFunction(a)&&BI.isFunction(b))return!0;a=self._getOptions(a),b=self._getOptions(b)}aStack=aStack||[],bStack=bStack||[];for(var length=aStack.length;length--;)if(aStack[length]===a)return bStack[length]===b;if(aStack.push(a),bStack.push(b),areArrays){if(length=a.length,length!==b.length)return!1;for(;length--;)if(!eq(a[length],b[length],aStack,bStack))return!1}else{var keys=_.keys(a),key;if(length=keys.length,_.keys(b).length!==length)return!1;for(;length--;)if(key=keys[length],!_.has(b,key)||!eq(a[key],b[key],aStack,bStack))return!1}return aStack.pop(),bStack.pop(),!0}var self=this;return eq(item1,item2)},_getWrapper:function(){return this.element},_addItemAt:function(index,item){for(var i=this.options.items.length;i>index;i--)this._children[this._getChildName(i)]=this._children[this._getChildName(i-1)];delete this._children[this._getChildName(index)],this.options.items.splice(index,0,item)},_removeItemAt:function(index){for(var i=index;ithis.options.items.length)){this._addItemAt(index,item);var w=this._addElement(index,item);return index>0?this._children[this._getChildName(index-1)].element.after(w.element):w.element.prependTo(this._getWrapper()),w._mount(),w}},removeItemAt:function(indexes){indexes=BI.isArray(indexes)?indexes:[indexes];for(var deleted=[],newItems=[],newChildren={},i=0,len=this.options.items.length;ithis.options.items.length-1)return!1;var child=this._children[this._getChildName(index)];return child.shouldUpdate?child.shouldUpdate(this._getOptions(item))===!0:null},updateItemAt:function(index,item){if(!(index<0||index>this.options.items.length-1)){ +var child=this._children[this._getChildName(index)],updated;if(updated=child.update(this._getOptions(item)))return updated;var del=this._children[this._getChildName(index)];delete this._children[this._getChildName(index)],this.options.items.splice(index,1);var w=this._addElement(index,item);this.options.items.splice(index,0,item),this._children[this._getChildName(index)]=w,index>0?this._children[this._getChildName(index-1)].element.after(w.element):w.element.prependTo(this._getWrapper()),del._destroy(),w._mount()}},addItems:function(items,context){var self=this,o=this.options,fragment=BI.Widget._renderEngine.createFragment(),added=[];BI.each(items,function(i,item){var w=self._addElement(o.items.length,item,context);self._children[self._getChildName(o.items.length)]=w,o.items.push(item),added.push(w),fragment.appendChild(w.element[0])}),this._isMounted&&(this._getWrapper().append(fragment),BI.each(added,function(i,w){w._mount()}))},prependItems:function(items,context){var self=this;items=items||[];for(var fragment=BI.Widget._renderEngine.createFragment(),added=[],i=items.length-1;i>=0;i--){this._addItemAt(0,items[i]);var w=this._addElement(0,items[i],context);self._children[self._getChildName(0)]=w,this.options.items.unshift(items[i]),added.push(w),fragment.appendChild(w.element[0])}this._isMounted&&(this._getWrapper().prepend(fragment),BI.each(added,function(i,w){w._mount()}))},getValue:function(){var self=this,value=[],child;return BI.each(this.options.items,function(i){if(child=self._children[self._getChildName(i)]){var v=child.getValue();v=BI.isArray(v)?v:[v],value=value.concat(v)}}),value},setValue:function(v){var self=this,child;BI.each(this.options.items,function(i){(child=self._children[self._getChildName(i)])&&child.setValue(v)})},setText:function(v){var self=this,child;BI.each(this.options.items,function(i){(child=self._children[self._getChildName(i)])&&child.setText(v)})},patchItem:function(oldVnode,vnode,index){var shouldUpdate=this.shouldUpdateItem(index,vnode);if(shouldUpdate===!0||null===shouldUpdate&&!this._compare(oldVnode,vnode))return this.updateItemAt(index,vnode)},updateChildren:function(oldCh,newCh){function sameVnode(vnode1,vnode2,oldIndex,newIndex){return vnode1=self._getOptions(vnode1),vnode2=self._getOptions(vnode2),BI.isKey(vnode1.key)?vnode1.key===vnode2.key:oldIndex>=0?oldIndex===newIndex:void 0}function addNode(vnode,index){var opt=self._getOptions(vnode),key=null==opt.key?self._getChildName(index):opt.key;return children[key]=self._addElement(key,vnode)}function addVnodes(before,vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var node=addNode(vnodes[startIdx],startIdx);insertBefore(node,before,!1,startIdx)}}function removeVnodes(vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var ch=vnodes[startIdx];if(BI.isNotNull(ch)){var node=self._getOptions(ch),key=null==node.key?self._getChildName(startIdx):node.key;delete self._children[self._getChildName(key)],children[key]._destroy()}}}function insertBefore(insert,before,isNext,index){insert=self._getOptions(insert),before=before&&self._getOptions(before);var insertKey=BI.isKey(insert.key)?insert.key:self._getChildName(index);if(before&&children[before.key]){var beforeKey=BI.isKey(before.key)?before.key:self._getChildName(index),next;next=isNext?children[beforeKey].element.next():children[beforeKey].element,next.length>0?next.before(children[insertKey].element):self._getWrapper().append(children[insertKey].element)}else self._getWrapper().append(children[insertKey].element)}function findOldVnode(vnodes,vNode,beginIdx,endIdx){var i,found;for(i=beginIdx;i<=endIdx;++i)vnodes[i]&&sameVnode(vnodes[i],vNode)&&(found=vnodes[i]);return found}var self=this,oldStartIdx=0,newStartIdx=0,oldEndIdx=oldCh.length-1,oldStartVnode=oldCh[0],oldEndVnode=oldCh[oldEndIdx],newEndIdx=newCh.length-1,newStartVnode=newCh[0],newEndVnode=newCh[newEndIdx],before,updated,children={};for(BI.each(oldCh,function(i,child){child=self._getOptions(child);var key=null==child.key?i:child.key;BI.isKey(key)&&(children[key]=self._children[self._getChildName(i)])});oldStartIdx<=oldEndIdx&&newStartIdx<=newEndIdx;)if(BI.isNull(oldStartVnode))oldStartVnode=oldCh[++oldStartIdx];else if(BI.isNull(oldEndVnode))oldEndVnode=oldCh[--oldEndIdx];else if(sameVnode(oldStartVnode,newStartVnode,oldStartIdx,newStartIdx))updated=this.patchItem(oldStartVnode,newStartVnode,oldStartIdx)||updated,children[null==oldStartVnode.key?this._getChildName(oldStartIdx):oldStartVnode.key]=this._children[this._getChildName(oldStartIdx)],oldStartVnode=oldCh[++oldStartIdx],newStartVnode=newCh[++newStartIdx];else if(sameVnode(oldEndVnode,newEndVnode,oldEndIdx,newEndIdx))updated=this.patchItem(oldEndVnode,newEndVnode,oldEndIdx)||updated,children[null==oldEndVnode.key?this._getChildName(oldEndIdx):oldEndVnode.key]=this._children[this._getChildName(oldEndIdx)],oldEndVnode=oldCh[--oldEndIdx],newEndVnode=newCh[--newEndIdx];else if(sameVnode(oldStartVnode,newEndVnode))updated=this.patchItem(oldStartVnode,newEndVnode,oldStartIdx)||updated,children[null==oldStartVnode.key?this._getChildName(oldStartIdx):oldStartVnode.key]=this._children[this._getChildName(oldStartIdx)],insertBefore(oldStartVnode,oldEndVnode,!0),oldStartVnode=oldCh[++oldStartIdx],newEndVnode=newCh[--newEndIdx];else if(sameVnode(oldEndVnode,newStartVnode))updated=this.patchItem(oldEndVnode,newStartVnode,oldEndIdx)||updated,children[null==oldEndVnode.key?this._getChildName(oldEndIdx):oldEndVnode.key]=this._children[this._getChildName(oldEndIdx)],insertBefore(oldEndVnode,oldStartVnode),oldEndVnode=oldCh[--oldEndIdx],newStartVnode=newCh[++newStartIdx];else{var sameOldVnode=findOldVnode(oldCh,newStartVnode,oldStartIdx,oldEndIdx);if(BI.isNull(sameOldVnode)){var node=addNode(newStartVnode);insertBefore(node,oldStartVnode),newStartVnode=newCh[++newStartIdx]}else BI.each(oldCh,function(index,child){child&&sameVnode(child,newStartVnode)&&(updated=self.patchItem(sameOldVnode,newStartVnode,index)||updated,children[null==sameOldVnode.key?self._getChildName(index):sameOldVnode.key]=self._children[self._getChildName(index)],oldCh[index]=void 0,insertBefore(sameOldVnode,oldStartVnode))}),newStartVnode=newCh[++newStartIdx]}return oldStartIdx>oldEndIdx?(before=BI.isNull(newCh[newEndIdx+1])?null:newCh[newEndIdx+1],addVnodes(before,newCh,newStartIdx,newEndIdx)):newStartIdx>newEndIdx&&removeVnodes(oldCh,oldStartIdx,oldEndIdx),this._children={},BI.each(newCh,function(i,child){var node=self._getOptions(child),key=null==node.key?self._getChildName(i):node.key;children[key]._mount(),self._children[self._getChildName(i)]=children[key]}),updated},update:function(opt){var o=this.options,items=opt.items||[],updated=this.updateChildren(o.items,items);return this.options.items=items,updated},stroke:function(items){var self=this;BI.each(items,function(i,item){item&&self._addElement(i,item)})},removeWidget:function(nameOrWidget){var removeIndex;BI.isWidget(nameOrWidget)?BI.each(this._children,function(name,child){child===nameOrWidget&&(removeIndex=name)}):removeIndex=nameOrWidget,removeIndex&&this._removeItemAt(0|removeIndex)},empty:function(){BI.Layout.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.Layout.superclass.destroy.apply(this,arguments),this.options.items=[]},populate:function(items){var self=this,o=this.options;return items=items||[],this._isMounted?void this.update({items:items}):(this.options.items=items,void this.stroke(items))},resize:function(){}}),BI.shortcut("bi.layout",BI.Layout),BI.Plugin=BI.Plugin||{},!function(){var _WidgetsPlugin={},_ObjectPlugin={},_ConfigPlugin={},_GlobalWidgetConfigFn,_GlobalObjectConfigFn;BI.extend(BI.Plugin,{getWidget:function(type,options){if(_GlobalWidgetConfigFn&&_GlobalWidgetConfigFn(type,options),_ConfigPlugin[type])for(var i=_ConfigPlugin[type].length-1;i>=0;i--)_ConfigPlugin[type][i](options);if(_WidgetsPlugin[type])for(var res,i=_WidgetsPlugin[type].length-1;i>=0;i--)if(res=_WidgetsPlugin[type][i](options))return res;return options},config:function(widgetConfigFn,objectConfigFn){_GlobalWidgetConfigFn=widgetConfigFn,_GlobalObjectConfigFn=objectConfigFn},configWidget:function(type,fn){_ConfigPlugin[type]||(_ConfigPlugin[type]=[]),_ConfigPlugin[type].push(fn)},registerWidget:function(type,fn){_WidgetsPlugin[type]||(_WidgetsPlugin[type]=[]),_WidgetsPlugin[type].length>0&&console.log("组件已经注册过了!"),_WidgetsPlugin[type].push(fn)},relieveWidget:function(type){delete _WidgetsPlugin[type]},getObject:function(type,object){if(_GlobalObjectConfigFn&&_GlobalObjectConfigFn(type,object),_ObjectPlugin[type])for(var res,i=0,len=_ObjectPlugin[type].length;i0&&console.log("对象已经注册过了!"),_ObjectPlugin[type].push(fn)},relieveObject:function(type){delete _ObjectPlugin[type]}})}(),BI.Action=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Action.superclass._defaultConfig.apply(this,arguments),{src:null,tar:null})},_init:function(){BI.Action.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){},actionBack:function(tar,src,callback){}}),BI.ActionFactory={createAction:function(key,options){var action;switch(key){case"show":action=BI.ShowAction}return new action(options)}},BI.ShowAction=BI.inherit(BI.Action,{_defaultConfig:function(){return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ShowAction.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){tar=tar||this.options.tar,tar.setVisible(!0),callback&&callback()},actionBack:function(tar,src,callback){tar=tar||this.options.tar,tar.setVisible(!1),callback&&callback()}}),function(){function isEmpty(value){var result=""===value||null===value||void 0===value;return result}function isInvalidDate(date){return"Invalid Date"==date||"NaN"==date}function _eFormat(text,fmt){function eFormat(num,format){var neg=num<0?(num*=-1,"-"):"",magnitudeNeg="",funcName=num>0&&num<1?"floor":"ceil",magnitude=Math[funcName](Math.log(num)/Math.log(10));if(!isFinite(magnitude))return format.replace(/#/gi,"").replace(/\.e/gi,"E");num/=Math.pow(10,magnitude),num>0&&num<1&&(num*=10,magnitude-=1);var integerLen=getInteger(magnitude,format);integerLen>1&&(magnitude-=integerLen-1,num*=Math.pow(10,integerLen-1)),magnitude<0&&(magnitudeNeg="-",magnitude*=-1);var precision=getPrecision(format),isValueCarry=isValueCarried(num);return num*=Math.pow(10,precision),num=Math.round(num),isValueCarry&&(num/=10,magnitude+="-"===magnitudeNeg?-1:1),num/=Math.pow(10,precision),num=num.toFixed(precision),magnitude=formatExponential(format,magnitude,magnitudeNeg),neg+num+"E"+magnitude}function formatExponential(format,num,magnitudeNeg){if(num+="",!/e/gi.test(format))return num;for(format=format.split(/e/gi)[1];num.length1?arr[1].length:0}function getInteger(magnitude,format){if(!/e/gi.test(format))return 0;var formatLeft=format.split(/e/gi)[0].split(".")[0],i,f,len=formatLeft.length,valueLeftLen=0;for(i=0;i-1)return text>=0?_numberFormat(text+"",format.substring(0,numMod)):_numberFormat(-text+"",format.substr(numMod+1));if(+text<0&&"-"!==format.charAt(0))return _numberFormat(-text+"","-"+format);var fp=format.split("."),fleft=fp[0]||"",fright=fp[1]||"";text=_dealNumberPrecision(text,fright);var tp=text.split("."),tleft=tp[0]||"",tright=tp[1]||"";if(/[%‰]$/.test(format)){var paddingZero=/[%]$/.test(format)?"00":"000";tright+=paddingZero,tleft+=tright.substr(0,paddingZero.length),tleft=tleft.replace(/^0+/gi,""),tright=tright.substr(paddingZero.length).replace(/0+$/gi,"")}var right=_dealWithRight(tright,fright);right.leftPlus&&(tleft=parseInt(tleft)+1+"",tleft=isNaN(tleft)?"1":tleft),right=right.num;var left=_dealWithLeft(tleft,fleft);return/[0-9]/.test(left)||(left+="0"),/[0-9]/.test(right)?left+"."+right:left+right}function _dealWithRight(tright,fright){for(var right="",j=0,i=0,len=fright.length;i4){result.leftPlus=!0;var numReg=right.match(/^[0-9]+/);if(numReg){var num=numReg[0],orilen=num.length,newnum=parseInt(num)+1+"";newnum.length>orilen?newnum=newnum.substr(1):(newnum=BI.leftPad(newnum,orilen,"0"),result.leftPlus=!1),right=right.replace(/^[0-9]+/,newnum)}}return result.num=right,result}function _dealWithLeft(tleft,fleft){for(var left="",j=tleft.length-1,combo=-1,last=-1,i=fleft.length-1;i>=0;i--){var ch=fleft.charAt(i),c=tleft.charAt(j);switch(ch){case"0":isEmpty(c)&&(c="0"),last=-1,left=c+left,j--;break;case"#":last=i,left=c+left,j--;break;case",":if(!isEmpty(c)){var com=fleft.match(/,[#0]+/);com&&(combo=com[0].length-1),left=","+left}break;default:left=ch+left}}if(last>-1){var tll=tleft.substr(0,j+1);left=left.substr(0,last)+tll+left.substr(last)}if(combo>0){var res=left.match(/[0-9]+,/);if(res){res=res[0];for(var newstr="",n=res.length-1-combo;n>=0;n-=combo)newstr=res.substr(n,combo)+","+newstr;var lres=res.substr(0,n+combo);isEmpty(lres)||(newstr=lres+","+newstr)}left=left.replace(/[0-9]+,/,newstr)}return left}var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),BI.cjkEncode=function(text){if("string"!=typeof text)return text;for(var newText="",i=0;i=128||91===code||93===code?"["+code.toString(16)+"]":text.charAt(i)}return newText},BI.cjkDecode=function(text){if(null==text)return"";if(!isNaN(text)||text.indexOf("[")==-1)return text;for(var newText="",i=0;ii+1){var subText=text.substring(i+1,rightIdx);subText.length>0&&(ch=String.fromCharCode(eval("0x"+subText))),i=rightIdx}}newText+=ch}return newText};var SPECIAL_TAGS={"&":"&",'"':""","<":"<",">":">"," ":" "};BI.htmlEncode=function(text){return BI.isNull(text)?"":BI.replaceAll(text+"",'&|"|<|>|\\s',function(v){return SPECIAL_TAGS[v]?SPECIAL_TAGS[v]:" "})},BI.htmlDecode=function(text){return BI.isNull(text)?"":BI.replaceAll(text+"","&|"|<|>| ",function(v){switch(v){case"&":return"&";case""":return'"';case"<":return"<";case">":return">";case" ":default:return" "}})},BI.cjkEncodeDO=function(o){if(BI.isPlainObject(o)){var result={};return _.each(o,function(v,k){"string"!=typeof v&&(v=BI.jsonEncode(v)),k=BI.cjkEncode(k),result[k]=BI.cjkEncode(v)}),result}return o},BI.jsonEncode=function(o){var useHasOwn=!!{}.hasOwnProperty,m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){return/["\\\x00-\x1f]/.test(s)?'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];return c?c:(c=b.charCodeAt(),"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16))})+'"':'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i2?BI.Date._MN[date.getMonth()]:len<2?date.getMonth()+1:BI.leftPad(date.getMonth()+1+"",2,"0");break;case"d":str=len>1?BI.leftPad(date.getDate()+"",2,"0"):date.getDate();break;case"h":var hour=date.getHours()%12;0===hour&&(hour=12),str=len>1?BI.leftPad(hour+"",2,"0"):hour;break;case"H":str=len>1?BI.leftPad(date.getHours()+"",2,"0"):date.getHours();break;case"m":str=len>1?BI.leftPad(date.getMinutes()+"",2,"0"):date.getMinutes();break;case"s":str=len>1?BI.leftPad(date.getSeconds()+"",2,"0"):date.getSeconds();break;case"a":str=date.getHours()<12?"am":"pm";break;case"z":str=BI.getTimezone(date);break;default:str=jfmt.str}return str}if(!date)return"";var len=format.length,result="";if(len>0){for(var flagch=format.charAt(0),start=0,str=flagch,i=1;iBI.Widget._renderEngine.createElement("body").outerWidth()&&(x-=tooltip.element.outerWidth()+15);var bodyHeight=BI.Widget._renderEngine.createElement("body").outerHeight();return y+tooltip.element.outerHeight()>bodyHeight||top+tooltip.element.outerHeight()>bodyHeight?(y-=tooltip.element.outerHeight()+15,!opt.belowMouse&&(y=Math.min(y,offset.top-tooltip.element.outerHeight()-5))):!opt.belowMouse&&(y=Math.max(y,top)),tooltip.element.css({left:x<0?0:x+"px",top:y<0?0:y+"px"}),tooltip.element.hover(function(){self.remove(name),context.element.trigger("mouseleave.title"+context.getName())}),this},add:function(name,bubble){return this.has(name)?this:(this.set(name,bubble),this)},get:function(name){return this.tooltipsManager[name]},set:function(name,bubble){this.tooltipsManager[name]=bubble},has:function(name){return null!=this.tooltipsManager[name]},remove:function(name){return this.has(name)?(this.tooltipsManager[name].destroy(),delete this.tooltipsManager[name],this):this}}),_.extend(BI,{Events:{KEYDOWN:"_KEYDOWN",BACKSPACE:"_BACKSPACE",SPACE:"_SPACE",ENTER:"_ENTER",CONFIRM:"_CONFIRM",ERROR:"_ERROR",PAUSE:"_PAUSE",DESTROY:"_DESTROY",MOUNT:"_MOUNT",UNMOUNT:"_UNMOUNT",CLEAR:"_CLEAR",ADD:"_ADD",EDITING:"_EDITING",EMPTY:"_EMPTY",VIEW:"_VIEW",RESIZE:"_RESIZE",BEFOREEDIT:"_BEFOREEDIT",AFTEREDIT:"_AFTEREDIT",STARTEDIT:"_STARTEDIT",STOPEDIT:"_STOPEDIT",CHANGE:"_CHANGE",EXPAND:"_EXPAND",COLLAPSE:"_COLLAPSE",CALLBACK:"_CALLBACK",CLICK:"_CLICK",STATECHANGE:"_STATECHANGE",BEFORESTATECHANGE:"_BEFORESTATECHANGE",INIT:"_INIT",AFTERINIT:"_AFTERINIT",SCROLL:"_SCROLL",STARTLOAD:"_STARTLOAD",AFTERLOAD:"_AFTERLOAD",BS:"beforesubmit",AS:"aftersubmit",SC:"submitcomplete",SF:"submitfailure",SS:"submitsuccess",BVW:"beforeverifywrite",AVW:"afterverifywrite",AV:"afterverify",BW:"beforewrite",AW:"afterwrite",WS:"writesuccess",WF:"writefailure",BA:"beforeappend",AA:"afterappend",BD:"beforedelete",AD:"beforedelete",UC:"unloadcheck",BTOPDF:"beforetopdf",ATOPDF:"aftertopdf",BTOEXCEL:"beforetoexcel",ATOEXCEL:"aftertoexcel",BTOWORD:"beforetoword",ATOWORD:"aftertoword",BTOIMAGE:"beforetoimage",ATOIMAGE:"aftertoimage",BTOHTML:"beforetohtml",ATOHTML:"aftertohtml",BIMEXCEL:"beforeimportexcel",AIMEXCEL:"afterimportexcel",BPDFPRINT:"beforepdfprint",APDFPRINT:"afterpdfprint",BFLASHPRINT:"beforeflashprint",AFLASHPRINT:"afterflashprint",BAPPLETPRINT:"beforeappletprint",AAPPLETPRINT:"afterappletprint",BSEVERPRINT:"beforeserverprint",ASERVERPRINT:"afterserverprint",BEMAIL:"beforeemail",AEMAIL:"afteremail"}}),_.extend(BI,{pushArray:function(sArray,array){for(var i=0;imonthDay&&(day=monthDay),dt.setDate(day),dt.setMonth(dt.getMonth()+3*parseInt(n)),dt},getQuarterStartMonth:function(date){var quarterStartMonth=0,nowMonth=date.getMonth();return nowMonth<3&&(quarterStartMonth=0),28&&(quarterStartMonth=9),quarterStartMonth},getQuarterStartDate:function(date){return BI.getDate(date.getFullYear(),BI.getQuarterStartMonth(date),1)},getQuarterEndDate:function(date){var quarterEndMonth=BI.getQuarterStartMonth(date)+2;return BI.getDate(date.getFullYear(),quarterEndMonth,BI.getMonthDays(date,quarterEndMonth))},getOffsetMonth:function(date,n){var dt=BI.getDate(BI.getTime(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds())),day=dt.getDate(),monthDay=BI.getMonthDays(BI.getDate(dt.getFullYear(),dt.getMonth()+parseInt(n),1));return day>monthDay&&(day=monthDay),dt.setDate(day),dt.setMonth(dt.getMonth()+parseInt(n)),dt},getWeekStartDate:function(date){var w=date.getDay(),startOfWeek=BI.StartOfWeek%7;return BI.getOffsetDate(date,BI.Date._OFFSET[w=12,ir=pm?hr-12:hr,dy=BI.getDayOfYear(date);0==ir&&(ir=12);var min=date.getMinutes(),sec=date.getSeconds();s["%a"]=BI.Date._SDN[w],s["%A"]=BI.Date._DN[w],s["%b"]=BI.Date._SMN[m],s["%B"]=BI.Date._MN[m],s["%C"]=1+Math.floor(y/100),s["%d"]=d<10?"0"+d:d,s["%e"]=d,s["%H"]=hr<10?"0"+hr:hr,s["%I"]=ir<10?"0"+ir:ir,s["%j"]=dy<100?dy<10?"00"+dy:"0"+dy:dy,s["%k"]=hr+"",s["%l"]=ir+"",s["%X"]=m<9?"0"+(1+m):1+m,s["%x"]=m+1,s["%M"]=min<10?"0"+min:min,s["%n"]="\n",s["%p"]=pm?"PM":"AM",s["%P"]=pm?"pm":"am",s["%s"]=Math.floor(date.getTime()/1e3),s["%S"]=sec<10?"0"+sec:sec,s["%t"]="\t",s["%U"]=s["%W"]=s["%V"]=wn<10?"0"+wn:wn,s["%u"]=w+1,s["%w"]=w,s["%y"]=yWith4number.substr(2,2),s["%Y"]=yWith4number,s["%%"]="%",s["%Q"]=qr;var re=/%./g;if(BI.isKhtml=BI.isKhtml||function(){return!!_global.navigator&&/Konqueror|Safari|KHTML/i.test(navigator.userAgent)},!(str.indexOf("%Y")===-1&&str.indexOf("%y")===-1||str.indexOf("%W")===-1&&str.indexOf("%U")===-1&&str.indexOf("%V")===-1))switch(wn){case 1:11===m&&(s["%y"]=parseInt(s["%y"])+1,s["%Y"]=parseInt(s["%Y"])+1);break;case 53:0===m&&(s["%y"]=parseInt(s["%y"])-1,s["%Y"]=parseInt(s["%Y"])-1)}if(!BI.isKhtml())return str.replace(re,function(par){return s[par]||par});for(var a=str.match(re),i=0;i-1?text===keyword?isArray?matched.push(item):matched[i]=item:isArray?find.push(item):find[i]=item:(pidx=py.indexOf(keyword),pidx>-1&&Math.floor(pidx/text.length)===Math.floor((pidx+keyword.length-1)/text.length)&&(text===keyword||keyword.length===text.length?isArray?matched.push(item):matched[i]=item:isArray?find.push(item):find[i]=item))}}),{match:matched,find:find}}}),_.extend(BI,{beforeFunc:function(sFunc,func){var __self=sFunc;return function(){return func.apply(sFunc,arguments)!==!1&&__self.apply(sFunc,arguments)}},afterFunc:function(sFunc,func){var __self=sFunc;return function(){var ret=__self.apply(sFunc,arguments);return ret!==!1&&(func.apply(sFunc,arguments),ret)}}}),_.extend(BI,{add:function(num,arg){function accAdd(arg1,arg2){var r1,r2,m,c;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}if(c=Math.abs(r1-r2),m=Math.pow(10,Math.max(r1,r2)),c>0){var cm=Math.pow(10,c);r1>r2?(arg1=Number(arg1.toString().replace(".","")),arg2=Number(arg2.toString().replace(".",""))*cm):(arg1=Number(arg1.toString().replace(".",""))*cm,arg2=Number(arg2.toString().replace(".","")))}else arg1=Number(arg1.toString().replace(".","")),arg2=Number(arg2.toString().replace(".",""));return(arg1+arg2)/m}return accAdd(arg,num)},sub:function(num,arg){function accSub(arg1,arg2){var r1,r2,m,n;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}return m=Math.pow(10,Math.max(r1,r2)),n=r1>=r2?r1:r2,((arg1*m-arg2*m)/m).toFixed(n)}return accSub(num,arg)},mul:function(num,arg){function accMul(arg1,arg2){var m=0,s1=arg1.toString(),s2=arg2.toString();try{m+=s1.split(".")[1].length}catch(e){}try{m+=s2.split(".")[1].length}catch(e){}return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)}return accMul(arg,num)},div:function(num,arg){function digitLength(num){var eSplit=num.toString().split(/[eE]/),len=(eSplit[0].split(".")[1]||"").length-+(eSplit[1]||0);return len>0?len:0}function float2Fixed(num){if(num.toString().indexOf("e")===-1)return Number(num.toString().replace(".",""));var dLen=digitLength(num);return dLen>0?num*Math.pow(10,dLen):num}function times(num1,num2){for(var others=[],_i=2;_i0)return times.apply(void 0,[times(num1,num2),others[0]].concat(others.slice(1)));var num1Changed=float2Fixed(num1),num2Changed=float2Fixed(num2),baseNum=digitLength(num1)+digitLength(num2),leftValue=num1Changed*num2Changed;return leftValue/Math.pow(10,baseNum)}function accDivide(num1,num2){for(var others=[],_i=2;_i0)return accDivide.apply(void 0,[accDivide(num1,num2),others[0]].concat(others.slice(1)));var num1Changed=float2Fixed(num1),num2Changed=float2Fixed(num2);return times(num1Changed/num2Changed,Math.pow(10,digitLength(num2)-digitLength(num1)))}return accDivide(num,arg)}}),_.extend(BI,{startWith:function(str,startTag){return str=str||"",!(null==startTag||""==startTag||0===str.length||startTag.length>str.length)&&str.substr(0,startTag.length)==startTag},endWith:function(str,endTag){return!(null==endTag||""==endTag||0===str.length||endTag.length>str.length)&&str.substring(str.length-endTag.length)==endTag},getQuery:function(str,name){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)"),r=str.substr(str.indexOf("?")+1).match(reg);return r?unescape(r[2]):null},appendQuery:function(str,paras){if(!paras)return str;var src=str;return src.indexOf("?")===-1&&(src+="?"),src.endWith("?")!==!1||(src+="&"),_.each(paras,function(value,name){"string"==typeof name&&(src+=name+"="+value+"&")}),src=src.substr(0,src.length-1)},replaceAll:function(str,s1,s2){return str.replace(new RegExp(s1,"gm"),s2)},perfectStart:function(str,start){return str.startWith(start)?str:start+str},allIndexOf:function(str,sub){if("string"!=typeof sub)return[];for(var location=[],offset=0;str.length>0;){var loc=str.indexOf(sub);if(loc===-1)break;location.push(offset+loc),str=str.substring(loc+sub.length,str.length),offset+=loc+sub.length}return location}}),!function(){var i18nStore={};_.extend(BI,{addI18n:function(i18n){BI.extend(i18nStore,i18n)},i18nText:function(key){var localeText=i18nStore[key]||BI.i18n&&BI.i18n[key]||"";localeText||(localeText=key);var len=arguments.length;if(len>1){if(!(localeText.indexOf("{R1}")>-1)){var args=Array.prototype.slice.call(arguments),count=1;return BI.replaceAll(localeText,"\\{\\s*\\}",function(){return args[count++]+""})}for(var i=1;i1?v.toString():v[0]:v,BI.isNull(v))throw new Error("value cannot be null");var cardName=o.cardNameCreator(v);if(!o.cardLayout.isCardExisted(cardName)){var card=o.cardCreator(cardName);o.cardLayout.addCardByName(cardName,card),o.afterCardCreated(cardName)}o.cardLayout.showCardByName(cardName),BI.nextTick(function(){o.afterCardShow(cardName),self.fireEvent(BI.ShowListener.EVENT_CHANGE,cardName)})}})}}),BI.ShowListener.EVENT_CHANGE="EVENT_CHANGE",BI.StyleLoaderManager=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.StyleLoaderManager.superclass._init.apply(this,arguments),this.stylesManager={}},loadStyle:function(name,styleString){if(_global.document){var d=document,styles=d.createElement("style");return d.getElementsByTagName("head")[0].appendChild(styles),styles.setAttribute("type","text/css"),styles.styleSheet?styles.styleSheet.cssText=styleString:styles.appendChild(document.createTextNode(styleString)),this.stylesManager[name]=styles,this}},get:function(name){return this.stylesManager[name]},has:function(name){return null!=this.stylesManager[name]},removeStyle:function(name){return this.has(name)?(this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]),delete this.stylesManager[name],this):this}}),BI.Logic=BI.inherit(BI.OB,{createLogic:function(){return this.options||{}}}),BI.LogicFactory={Type:{Vertical:"vertical",Horizontal:"horizontal",Table:"table",HorizontalFill:"horizontal_fill"},createLogic:function(key,options){var logic;switch(key){case BI.LogicFactory.Type.Vertical:logic=BI.VerticalLayoutLogic;break;case BI.LogicFactory.Type.Horizontal:logic=BI.HorizontalLayoutLogic;break;case BI.LogicFactory.Type.Table:logic=BI.TableLayoutLogic;break;case BI.LogicFactory.Type.HorizontalFill:logic=BI.HorizontalFillLayoutLogic;break;default:logic=BI.Logic}return new logic(options).createLogic()},createLogicTypeByDirection:function(direction){switch(direction){case BI.Direction.Top:case BI.Direction.Bottom:case BI.Direction.Custom:return BI.LogicFactory.Type.Vertical;case BI.Direction.Left:case BI.Direction.Right:return BI.LogicFactory.Type.Horizontal}},createLogicItemsByDirection:function(direction){var layout,items=Array.prototype.slice.call(arguments,1);switch(items=BI.map(items,function(i,item){return BI.isWidget(item)?{el:item,width:item.options.width,height:item.options.height}:item}),direction){case BI.Direction.Bottom:layout=BI.LogicFactory.Type.Vertical,items.reverse();break;case BI.Direction.Right:layout=BI.LogicFactory.Type.Horizontal,items.reverse();break;case BI.Direction.Custom:items=items.slice(1)}return items}},BI.VerticalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.vertical":"bi.vtape",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.VerticalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.vertical_adapt":"bi.htape",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.HorizontalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.TableLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,columns:0,rows:0,columnSize:[],rowSize:[],hgap:0,vgap:0,items:[]})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.table":"bi.window",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,columns:o.columns,rows:o.rows,columnSize:o.columnSize,rowSize:o.rowSize,hgap:o.hgap,vgap:o.vgap,items:o.items}},_init:function(){BI.TableLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalFillLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options,columnSize=[];return BI.each(o.items,function(i,item){columnSize.push(item.width||0)}),layout=o.dynamic?"bi.horizontal_adapt":"bi.htape",{type:layout,columnSize:columnSize,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.HorizontalFillLayoutLogic.superclass._init.apply(this,arguments)}}),BI.prepares.push(function(){var _isSupportFlex,isSupportFlex=function(){return null==_isSupportFlex&&(_isSupportFlex=!(!BI.isSupportCss3||!BI.isSupportCss3("flex"))),_isSupportFlex};BI.Plugin.registerWidget("bi.horizontal",function(ob){var isIE=BI.isIE(),supportFlex=isSupportFlex(),isLessIE8=isIE&&BI.getIEVersion()<8;return ob.verticalAlign===BI.VerticalAlign.Middle&&ob.horizontalAlign===BI.HorizontalAlign.Center?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):ob.verticalAlign===BI.VerticalAlign.Middle&&ob.horizontalAlign===BI.HorizontalAlign.Left?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):ob.verticalAlign===BI.VerticalAlign.Top&&ob.horizontalAlign===BI.HorizontalAlign.Center?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):isIE?ob:supportFlex?BI.extend(ob,{type:"bi.flex_horizontal"}):BI.extend(ob,{type:"bi.table_adapt"})}),BI.Plugin.registerWidget("bi.center_adapt",function(ob){var isIE=BI.isIE(),supportFlex=isSupportFlex(),justOneItem=ob.items&&ob.items.length<=1;return!isIE&&supportFlex&&justOneItem?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend(ob,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(ob,{type:"bi.flex_center_adapt"}):justOneItem?BI.extend(ob,{type:"bi.inline_center_adapt"}):ob}),BI.Plugin.registerWidget("bi.vertical_adapt",function(ob){ +var isIE=BI.isIE(),supportFlex=isSupportFlex();return!isIE&&supportFlex?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend({},ob,{type:"bi.flex_scrollable_vertical_center_adapt"}):BI.extend(ob,{type:"bi.flex_vertical_center_adapt"}):BI.extend(ob,{type:"bi.inline_vertical_adapt"})}),BI.Plugin.registerWidget("bi.horizontal_adapt",function(ob){return ob.items&&ob.items.length<=1?BI.extend(ob,{type:"bi.horizontal_auto"}):ob}),BI.Plugin.registerWidget("bi.float_center_adapt",function(ob){return!BI.isIE()&&isSupportFlex()?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend({},ob,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(ob,{type:"bi.flex_center_adapt"}):BI.extend(ob,{type:"bi.inline_center_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal"})}),BI.Plugin.registerWidget("bi.flex_vertical",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical"})}),BI.Plugin.registerWidget("bi.flex_horizontal_adapt",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_center_adapt"})}),BI.Plugin.registerWidget("bi.radio",function(ob){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(ob,{type:"bi.image_radio"}):ob}),BI.Plugin.registerWidget("bi.checkbox",function(ob){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(ob,{type:"bi.image_checkbox"}):ob}),BI.Plugin.registerWidget("bi.half_icon_button",function(ob){return BI.isIE()&&BI.getIEVersion()<9?ob:BI.extend(ob,{type:"bi.half_button"})})}),!function(){var attachEvent=_global.document&&_global.document.attachEvent,stylesCreated=!1;if(_global.document&&!attachEvent){var requestFrame=function(){var raf=_global.requestAnimationFrame||_global.mozRequestAnimationFrame||_global.webkitRequestAnimationFrame||function(fn){return _global.setTimeout(fn,20)};return function(fn){return raf(fn)}}(),cancelFrame=function(){var cancel=_global.cancelAnimationFrame||_global.mozCancelAnimationFrame||_global.webkitCancelAnimationFrame||_global.clearTimeout;return function(id){return cancel(id)}}(),resetTriggers=function(element){var triggers=element.__resizeTriggers__,expand=triggers.firstElementChild,contract=triggers.lastElementChild,expandChild=expand.firstElementChild;contract.scrollLeft=contract.scrollWidth,contract.scrollTop=contract.scrollHeight,expandChild.style.width=expand.offsetWidth+1+"px",expandChild.style.height=expand.offsetHeight+1+"px",expand.scrollLeft=expand.scrollWidth,expand.scrollTop=expand.scrollHeight},checkTriggers=function(element){return element.offsetWidth!==element.__resizeLast__.width||element.offsetHeight!==element.__resizeLast__.height},scrollListener=function(e){var element=this;resetTriggers(this),this.__resizeRAF__&&cancelFrame(this.__resizeRAF__),this.__resizeRAF__=requestFrame(function(){checkTriggers(element)&&(element.__resizeLast__.width=element.offsetWidth,element.__resizeLast__.height=element.offsetHeight,element.__resizeListeners__.forEach(function(fn){fn.call(element,e)}))})},animation=!1,animationstring="animation",keyframeprefix="",animationstartevent="animationstart",domPrefixes="Webkit Moz O ms".split(" "),startEvents="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),pfx="",elm=document.createElement("fakeelement");if(void 0!==elm.style.animationName&&(animation=!0),animation===!1)for(var i=0;i div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css",style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css)),head.appendChild(style),stylesCreated=!0}},addResizeListener=function(element,fn){attachEvent?(element.attachEvent("onresize",fn),BI.nextTick(fn)):(element.__resizeTriggers__||("static"===getComputedStyle(element).position&&(element.style.position="relative"),createStyles(),element.__resizeLast__={},element.__resizeListeners__=[],(element.__resizeTriggers__=document.createElement("div")).className="resize-triggers",element.__resizeTriggers__.innerHTML='
',element.appendChild(element.__resizeTriggers__),resetTriggers(element),element.addEventListener("scroll",scrollListener,!0),animationstartevent&&element.__resizeTriggers__.addEventListener(animationstartevent,function(e){e.animationName===animationName&&resetTriggers(element)})),element.__resizeListeners__.push(fn))},removeResizeListener=function(element,fn){attachEvent?element.detachEvent("onresize",fn):(element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn),1),element.__resizeListeners__.length||(element.removeEventListener("scroll",scrollListener),element.__resizeTriggers__=!element.removeChild(element.__resizeTriggers__)))};BI.ResizeDetector={addResizeListener:function(widget,fn){return addResizeListener(widget.element[0],fn),function(){removeResizeListener(widget.element[0],fn)}},removeResizeListener:function(widget,fn){removeResizeListener(widget.element[0],fn)}}}(),!function(){BI.DOM={},BI.extend(BI.DOM,{ready:function(fn){BI.Widget._renderEngine.createElement(document).ready(fn)}}),BI.extend(BI.DOM,{patchProps:function(fromElement,toElement){var elemData=BI.jQuery._data(fromElement[0]),events=elemData.events;BI.each(events,function(eventKey,event){BI.each(event,function(i,handler){toElement.on(eventKey+(handler.namespace?"."+handler.namespace:""),handler)})});var fromChildren=fromElement.children(),toChildren=toElement.children();if(fromChildren.length!==toChildren.length)throw new Error("不匹配");BI.each(fromChildren,function(i,child){BI.DOM.patchProps(BI.jQuery(child),BI.jQuery(toChildren[i]))}),BI.each(fromElement.data("__widgets"),function(i,widget){widget.element=toElement})},hang:function(doms){if(!BI.isEmpty(doms)){var frag=BI.Widget._renderEngine.createFragment();return BI.each(doms,function(i,dom){dom instanceof BI.Widget&&(dom=dom.element),dom instanceof BI.$&&dom[0]&&frag.appendChild(dom[0])}),frag}},isExist:function(obj){return BI.Widget._renderEngine.createElement("body").find(obj.element).length>0},preloadImages:function(srcArray,onload){function complete(){count++,count>=srcArray.length&&onload()}var count=0,images=[];BI.each(srcArray,function(i,src){images[i]=new Image,images[i].src=src,images[i].onload=function(){complete()},images[i].onerror=function(){complete()}})},getTextSizeWidth:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var width=span.width();return span.remove(),width},getTextSizeHeight:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var height=span.height();return span.remove(),height},getScrollWidth:function(){if(BI.isNull(this._scrollWidth)||0===this._scrollWidth){var ul=BI.Widget._renderEngine.createElement("
").width(50).height(50).css({position:"absolute",top:"-9999px",overflow:"scroll"}).appendTo("body");this._scrollWidth=ul[0].offsetWidth-ul[0].clientWidth,ul.destroy()}return this._scrollWidth},getImage:function(param,fillStyle,backgroundColor){var canvas=document.createElement("canvas"),ratio=2;BI.Widget._renderEngine.createElement("body").append(canvas);var ctx=canvas.getContext("2d");ctx.font="12px Georgia";var w=ctx.measureText(param).width+4;canvas.width=w*ratio,canvas.height=16*ratio,ctx.font=12*ratio+"px Georgia",ctx.fillStyle=fillStyle||"#3685f2",ctx.textBaseline="middle",ctx.fillText(param,2*ratio,9*ratio),BI.Widget._renderEngine.createElement(canvas).destroy();var backColor=backgroundColor||"rgba(54, 133, 242, 0.1)";return{width:w,height:16,src:canvas.toDataURL("image/png"),style:"background-color: "+backColor+";vertical-align: middle; margin: 0 1px; width:"+w+"px;height: 16px; max-width:"+w+"px;max-height: 16px; min-width:"+w+"px;min-height: 16px",param:param}}}),BI.extend(BI.DOM,{isColor:function(color){return color&&(this.isRGBColor(color)||this.isHexColor(color))},isRGBColor:function(color){return!!color&&"rgb"===color.substr(0,3)},isHexColor:function(color){return!!color&&("#"===color[0]&&7===color.length)},isDarkColor:function(hex){if(!hex||!this.isHexColor(hex))return!1;var rgb=this.rgb2json(this.hex2rgb(hex)),grayLevel=Math.round(.299*rgb.r+.587*rgb.g+.114*rgb.b);return grayLevel<192},getContrastColor:function(color){return color&&this.isColor(color)?this.isDarkColor(color)?"#ffffff":"#1a1a1a":""},rgb2hex:function(rgbColour){if(!rgbColour||"rgb"!=rgbColour.substr(0,3))return"";var rgbValues=rgbColour.match(/\d+(\.\d+)?/g),red=BI.parseInt(rgbValues[0]),green=BI.parseInt(rgbValues[1]),blue=BI.parseInt(rgbValues[2]),hexColour="#"+this.int2hex(red)+this.int2hex(green)+this.int2hex(blue);return hexColour},rgb2json:function(rgbColour){if(!rgbColour)return{};if(!this.isRGBColor(rgbColour))return{};var rgbValues=rgbColour.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(rgbValues[0]),g:BI.parseInt(rgbValues[1]),b:BI.parseInt(rgbValues[2])}},rgba2json:function(rgbColour){if(!rgbColour)return{};var rgbValues=rgbColour.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(rgbValues[0]),g:BI.parseInt(rgbValues[1]),b:BI.parseInt(rgbValues[2]),a:BI.parseFloat(rgbValues[3])}},json2rgb:function(rgb){return BI.isKey(rgb.r)&&BI.isKey(rgb.g)&&BI.isKey(rgb.b)?"rgb("+rgb.r+","+rgb.g+","+rgb.b+")":""},json2rgba:function(rgba){return BI.isKey(rgba.r)&&BI.isKey(rgba.g)&&BI.isKey(rgba.b)?"rgba("+rgba.r+","+rgba.g+","+rgba.b+","+rgba.a+")":""},int2hex:function(strNum){var hexdig=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return hexdig[strNum>>>4]+""+hexdig[15&strNum]},hex2rgb:function(color){if(!color)return"";if(!this.isHexColor(color))return color;var tempValue="rgb(",colorArray;return 7===color.length?colorArray=[BI.parseInt("0x"+color.substring(1,3)),BI.parseInt("0x"+color.substring(3,5)),BI.parseInt("0x"+color.substring(5,7))]:4===color.length&&(colorArray=[BI.parseInt("0x"+color.substring(1,2)),BI.parseInt("0x"+color.substring(2,3)),BI.parseInt("0x"+color.substring(3,4))]),tempValue+=colorArray[0]+",",tempValue+=colorArray[1]+",",tempValue+=colorArray[2]+")"},rgba2rgb:function(rgbColor,bgColor){if(BI.isNull(bgColor)&&(bgColor=1),"rgba"!=rgbColor.substr(0,4))return"";var rgbValues=rgbColor.match(/\d+(\.\d+)?/g);if(rgbValues.length<4)return"";var R=BI.parseFloat(rgbValues[0]),G=BI.parseFloat(rgbValues[1]),B=BI.parseFloat(rgbValues[2]),A=BI.parseFloat(rgbValues[3]);return"rgb("+Math.floor(255*(bgColor*(1-A))+R*A)+","+Math.floor(255*(bgColor*(1-A))+G*A)+","+Math.floor(255*(bgColor*(1-A))+B*A)+")"}}),BI.extend(BI.DOM,{getLeftPosition:function(combo,popup,extraWidth){return{left:combo.element.offset().left-popup.element.outerWidth()-(extraWidth||0)}},getInnerLeftPosition:function(combo,popup,extraWidth){return{left:combo.element.offset().left+(extraWidth||0)}},getRightPosition:function(combo,popup,extraWidth){var el=combo.element;return{left:el.offset().left+el.outerWidth()+(extraWidth||0)}},getInnerRightPosition:function(combo,popup,extraWidth){var el=combo.element,viewBounds=popup.element.bounds();return{left:el.offset().left+el.outerWidth()-viewBounds.width-(extraWidth||0)}},getTopPosition:function(combo,popup,extraHeight){return{top:combo.element.offset().top-popup.element.outerHeight()-(extraHeight||0)}},getBottomPosition:function(combo,popup,extraHeight){var el=combo.element;return{top:el.offset().top+el.outerHeight()+(extraHeight||0)}},isLeftSpaceEnough:function(combo,popup,extraWidth){return BI.DOM.getLeftPosition(combo,popup,extraWidth).left>=0},isInnerLeftSpaceEnough:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getInnerLeftPosition(combo,popup,extraWidth).left+viewBounds.width<=windowBounds.width},isRightSpaceEnough:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getRightPosition(combo,popup,extraWidth).left+viewBounds.width<=windowBounds.width},isInnerRightSpaceEnough:function(combo,popup,extraWidth){return BI.DOM.getInnerRightPosition(combo,popup,extraWidth).left>=0},isTopSpaceEnough:function(combo,popup,extraHeight){return BI.DOM.getTopPosition(combo,popup,extraHeight).top>=0},isBottomSpaceEnough:function(combo,popup,extraHeight){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getBottomPosition(combo,popup,extraHeight).top+viewBounds.height<=windowBounds.height},isRightSpaceLarger:function(combo){var windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return windowBounds.width-combo.element.offset().left-combo.element.bounds().width>=combo.element.offset().left},isBottomSpaceLarger:function(combo){var windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return windowBounds.height-combo.element.offset().top-combo.element.bounds().height>=combo.element.offset().top},getLeftAlignPosition:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),left=combo.element.offset().left+extraWidth;return left+viewBounds.width>windowBounds.width&&(left=windowBounds.width-viewBounds.width),left<0&&(left=0),{left:left}},getLeftAdaptPosition:function(combo,popup,extraWidth){return BI.DOM.isLeftSpaceEnough(combo,popup,extraWidth)?BI.DOM.getLeftPosition(combo,popup,extraWidth):{left:0}},getRightAlignPosition:function(combo,popup,extraWidth){var comboBounds=combo.element.bounds(),viewBounds=popup.element.bounds(),left=combo.element.offset().left+comboBounds.width-viewBounds.width-extraWidth;return left<0&&(left=0),{left:left}},getRightAdaptPosition:function(combo,popup,extraWidth){return BI.DOM.isRightSpaceEnough(combo,popup,extraWidth)?BI.DOM.getRightPosition(combo,popup,extraWidth):{left:BI.Widget._renderEngine.createElement("body").bounds().width-popup.element.bounds().width}},getTopAlignPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top,adaptHeight;return BI.DOM.isBottomSpaceEnough(combo,popup,-1*comboBounds.height+extraHeight)?top=comboOffset.top+extraHeight:needAdaptHeight?(top=comboOffset.top+extraHeight,adaptHeight=windowBounds.height-top):(top=windowBounds.height-popupBounds.height,topwindowBounds.height?{top:0,adaptHeight:windowBounds.height-extraHeight}:{top:0}},getBottomAlignPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top,adaptHeight;return BI.DOM.isTopSpaceEnough(combo,popup,-1*comboBounds.height+extraHeight)?top=comboOffset.top+comboBounds.height-popupBounds.height-extraHeight:needAdaptHeight?(top=0,adaptHeight=comboOffset.top+comboBounds.height-extraHeight):(top=0,popupBounds.height+extraHeight>windowBounds.height&&(adaptHeight=windowBounds.height-extraHeight)),top<0&&(top=0),adaptHeight?{top:top,adaptHeight:adaptHeight}:{top:top}},getBottomAdaptPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.isBottomSpaceEnough(combo,popup,extraHeight)?BI.DOM.getBottomPosition(combo,popup,extraHeight):needAdaptHeight?{top:comboOffset.top+comboBounds.height+extraHeight,adaptHeight:windowBounds.height-comboOffset.top-comboBounds.height-extraHeight}:popupBounds.height+extraHeight>windowBounds.height?{top:extraHeight,adaptHeight:windowBounds.height-extraHeight}:{top:windowBounds.height-popupBounds.height-extraHeight}},getCenterAdaptPosition:function(combo,popup){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),left;return left=comboOffset.left+comboBounds.width/2+popupBounds.width/2>windowBounds.width?windowBounds.width-popupBounds.width:comboOffset.left+comboBounds.width/2-popupBounds.width/2,left<0&&(left=0),{left:left}},getMiddleAdaptPosition:function(combo,popup){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top;return top=comboOffset.top+comboBounds.height/2+popupBounds.height/2>windowBounds.height?windowBounds.height-popupBounds.height:comboOffset.top+comboBounds.height/2-popupBounds.height/2,top<0&&(top=0),{top:top}},getComboPositionByDirections:function(combo,popup,extraWidth,extraHeight,needAdaptHeight,directions){extraWidth||(extraWidth=0),extraHeight||(extraHeight=0);var i,direct,leftRight=[],topBottom=[],innerLeftRight=[],isNeedAdaptHeight=!1,tbFirst=!1,lrFirst=!1,left,top,pos,firstDir=directions[0];for(i=0;i0&&length-1 in obj)))}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(core_rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function internalData(elem,name,data,pvt){if(jQuery.acceptData(elem)){var thisCache,ret,internalKey=jQuery.expando,getByName="string"==typeof name,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if(id&&cache[id]&&(pvt||cache[id].data)||!getByName||data!==undefined)return id||(isNode?elem[internalKey]=id=core_deletedIds.pop()||jQuery.guid++:id=internalKey),cache[id]||(cache[id]={},isNode||(cache[id].toJSON=jQuery.noop)),"object"!=typeof name&&"function"!=typeof name||(pvt?cache[id]=jQuery.extend(cache[id],name):cache[id].data=jQuery.extend(cache[id].data,name)),thisCache=cache[id],pvt||(thisCache.data||(thisCache.data={}),thisCache=thisCache.data),data!==undefined&&(thisCache[jQuery.camelCase(name)]=data),getByName?(ret=thisCache[name],null==ret&&(ret=thisCache[jQuery.camelCase(name)])):ret=thisCache,ret}}function internalRemoveData(elem,name,pvt){if(jQuery.acceptData(elem)){var i,l,thisCache,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(cache[id]){if(name&&(thisCache=pvt?cache[id]:cache[id].data)){jQuery.isArray(name)?name=name.concat(jQuery.map(name,jQuery.camelCase)):name in thisCache?name=[name]:(name=jQuery.camelCase(name),name=name in thisCache?[name]:name.split(" "));for(i=0,l=name.length;i=0===keep})}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement)for(;list.length;)safeFrag.createElement(list.pop());return safeFrag}function findOrAppend(elem,tag){return elem.getElementsByTagName(tag)[0]||elem.appendChild(elem.ownerDocument.createElement(tag))}function disableScript(elem){var attr=elem.getAttributeNode("type");return elem.type=(attr&&attr.specified)+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var elem,i=0;null!=(elem=elems[i]);i++)jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){if(1===dest.nodeType&&jQuery.hasData(src)){var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle,curData.events={};for(type in events)for(i=0,l=events[type].length;i").css("cssText","display:block !important")).appendTo(doc.documentElement),doc=(iframe[0].contentWindow||iframe[0].contentDocument).document,doc.write(""),doc.close(),display=actualDisplay(nodeName,doc),iframe.detach()),elemdisplay[nodeName]=display),display}function actualDisplay(name,doc){var elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=jQuery.css(elem[0],"display");return elem.remove(),display}function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj))jQuery.each(obj,function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v?i:"")+"]",v,traditional,add)});else if(traditional||"object"!==jQuery.type(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(core_rnotwhite)||[];if(jQuery.isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType[0]?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)}),selected}var inspected={},seekingTransport=structure===transports;return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)src[key]!==undefined&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields;for(type in responseFields)type in responses&&(jqXHR[responseFields[type]]=responses[type]);for(;"*"===dataTypes[0];)dataTypes.shift(),ct===undefined&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function ajaxConvert(s,response){var conv2,current,conv,tmp,converters={},i=0,dataTypes=s.dataTypes.slice(),prev=dataTypes[0];if(s.dataFilter&&(response=s.dataFilter(response,s.dataType)),dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(;current=dataTypes[++i];)if("*"!==current){if("*"!==prev&&prev!==current){if(conv=converters[prev+" "+current]||converters["* "+current],!conv)for(conv2 in converters)if(tmp=conv2.split(" "),tmp[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){conv===!0?conv=converters[conv2]:converters[conv2]!==!0&&(current=tmp[0],dataTypes.splice(i--,0,current));break}if(conv!==!0)if(conv&&s["throws"])response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}prev=current}return{state:"success",data:response}}function createStandardXHR(){try{return new window.XMLHttpRequest}catch(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function createFxNow(){return setTimeout(function(){fxNow=undefined}),fxNow=jQuery.now()}function createTweens(animation,props){jQuery.each(props,function(prop,value){for(var collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;index)[^>]*|#([\w-]*))$/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rvalidchars=/^[\],:{}\s]*$/,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rvalidescape=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,rvalidtokens=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase()},completed=function(event){(document.addEventListener||"load"===event.type||"complete"===document.readyState)&&(detach(),jQuery.ready())},detach=function(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1)):(document.detachEvent("onreadystatechange",completed),window.detachEvent("onload",completed))};jQuery.fn=jQuery.prototype={jquery:core_version,constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem;if(!selector)return this;if("string"==typeof selector){if(match="<"===selector.charAt(0)&&">"===selector.charAt(selector.length-1)&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector),!match||!match[1]&&context)return!context||context.jquery?(context||rootjQuery).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)jQuery.isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}if(elem=document.getElementById(match[2]),elem&&elem.parentNode){if(elem.id!==match[2])return rootjQuery.find(selector);this.length=1,this[0]=elem}return this.context=document,this.selector=selector,this}return selector.nodeType?(this.context=this[0]=selector,this.length=1,this):jQuery.isFunction(selector)?rootjQuery.ready(selector):(selector.selector!==undefined&&(this.selector=selector.selector,this.context=selector.context),jQuery.makeArray(selector,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return core_slice.call(this)},get:function(num){return null==num?this.toArray():num<0?this[this.length+num]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret.context=this.context,ret},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){return jQuery.ready.promise().done(fn),this},slice:function(){return this.pushStack(core_slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j0||(readyList.resolveWith(document,[jQuery]),jQuery.fn.trigger&&jQuery(document).trigger("ready").off("ready"))}},isFunction:function(obj){return"function"===jQuery.type(obj)},isArray:Array.isArray||function(obj){return"array"===jQuery.type(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj)},type:function(obj){return null==obj?String(obj):"object"==typeof obj||"function"==typeof obj?class2type[core_toString.call(obj)]||"object":typeof obj},isPlainObject:function(obj){if(!obj||"object"!==jQuery.type(obj)||obj.nodeType||jQuery.isWindow(obj))return!1;try{if(obj.constructor&&!core_hasOwn.call(obj,"constructor")&&!core_hasOwn.call(obj.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var key;for(key in obj);return key===undefined||core_hasOwn.call(obj,key)},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},error:function(msg){throw new Error(msg)},parseHTML:function(data,context,keepScripts){if(!data||"string"!=typeof data)return null;"boolean"==typeof context&&(keepScripts=context,context=!1),context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];return parsed?[context.createElement(parsed[1])]:(parsed=jQuery.buildFragment([data],context,scripts),scripts&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes))},parseJSON:function(data){return window.JSON&&window.JSON.parse?window.JSON.parse(data):null===data?data:"string"==typeof data&&(data=jQuery.trim(data),data&&rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,"")))?new Function("return "+data)():void jQuery.error("Invalid JSON: "+data)},parseXML:function(data){var xml,tmp;if(!data||"string"!=typeof data)return null;try{window.DOMParser?(tmp=new DOMParser,xml=tmp.parseFromString(data,"text/xml")):(xml=new ActiveXObject("Microsoft.XMLDOM"),xml.async="false",xml.loadXML(data))}catch(e){xml=undefined}return xml&&xml.documentElement&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml},noop:function(){},globalEval:function(data){data&&jQuery.trim(data)&&(window.execScript||function(data){window.eval.call(window,data)})(data)},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()},each:function(obj,callback,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray)for(;i-1;)list.splice(index,1),firing&&(index<=firingLength&&firingLength--,index<=firingIndex&&firingIndex--)}),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!(!list||!list.length)},empty:function(){return list=[],this},disable:function(){return list=stack=memory=undefined,this},disabled:function(){return!list},lock:function(){return stack=undefined,memory||self.disable(),this},locked:function(){return!stack},fireWith:function(context,args){return args=args||[],args=[context,args.slice?args.slice():args],!list||fired&&!stack||(firing?stack.push(args):fire(args)),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var action=tuple[0],fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);returned&&jQuery.isFunction(returned.promise)?returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify):newDefer[action+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments)})}),fns=null}).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return promise.pipe=promise.then,jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add,stateString&&list.add(function(){state=stateString},tuples[1^i][2].disable,tuples[2][2].lock),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?promise:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith}),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(subordinate){var i=0,resolveValues=core_slice.call(arguments),length=resolveValues.length,remaining=1!==length||subordinate&&jQuery.isFunction(subordinate.promise)?length:0,deferred=1===remaining?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this,values[i]=arguments.length>1?core_slice.call(arguments):value,values===progressValues?deferred.notifyWith(contexts,values):--remaining||deferred.resolveWith(contexts,values)}},progressValues,progressContexts,resolveContexts;if(length>1)for(progressValues=new Array(length),progressContexts=new Array(length),resolveContexts=new Array(length);i
a",all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0],!all||!a||!all.length)return{};select=document.createElement("select"),opt=select.appendChild(document.createElement("option")),input=div.getElementsByTagName("input")[0],a.style.cssText="top:1px;float:left;opacity:.5",support={getSetAttribute:"t"!==div.className,leadingWhitespace:3===div.firstChild.nodeType,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/top/.test(a.getAttribute("style")),hrefNormalized:"/a"===a.getAttribute("href"),opacity:/^0.5/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:!!input.value,optSelected:opt.selected,enctype:!!document.createElement("form").enctype,html5Clone:"<:nav>"!==document.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===document.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},input.checked=!0,support.noCloneChecked=input.cloneNode(!0).checked,select.disabled=!0,support.optDisabled=!opt.disabled;try{delete div.test}catch(e){support.deleteExpando=!1}input=document.createElement("input"),input.setAttribute("value",""),support.input=""===input.getAttribute("value"),input.value="t",input.setAttribute("type","radio"),support.radioValue="t"===input.value,input.setAttribute("checked","t"),input.setAttribute("name","t"),fragment=document.createDocumentFragment(),fragment.appendChild(input),support.appendChecked=input.checked,support.checkClone=fragment.cloneNode(!0).cloneNode(!0).lastChild.checked,div.attachEvent&&(div.attachEvent("onclick",function(){support.noCloneEvent=!1}),div.cloneNode(!0).click());for(i in{submit:!0,change:!0,focusin:!0})div.setAttribute(eventName="on"+i,"t"),support[i+"Bubbles"]=eventName in window||div.attributes[eventName].expando===!1;return div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,jQuery(function(){var container,marginDiv,tds,divReset="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",body=document.getElementsByTagName("body")[0];body&&(container=document.createElement("div"),container.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",body.appendChild(container).appendChild(div),div.innerHTML="
t
",tds=div.getElementsByTagName("td"),tds[0].style.cssText="padding:0;margin:0;border:0;display:none",isSupported=0===tds[0].offsetHeight,tds[0].style.display="",tds[1].style.display="none",support.reliableHiddenOffsets=isSupported&&0===tds[0].offsetHeight,div.innerHTML="",div.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",support.boxSizing=4===div.offsetWidth,support.doesNotIncludeMarginInBodyOffset=1!==body.offsetTop,window.getComputedStyle&&(support.pixelPosition="1%"!==(window.getComputedStyle(div,null)||{}).top,support.boxSizingReliable="4px"===(window.getComputedStyle(div,null)||{width:"4px"}).width,marginDiv=div.appendChild(document.createElement("div")),marginDiv.style.cssText=div.style.cssText=divReset,marginDiv.style.marginRight=marginDiv.style.width="0",div.style.width="1px",support.reliableMarginRight=!parseFloat((window.getComputedStyle(marginDiv,null)||{}).marginRight)),typeof div.style.zoom!==core_strundefined&&(div.innerHTML="",div.style.cssText=divReset+"width:1px;padding:1px;display:inline;zoom:1",support.inlineBlockNeedsLayout=3===div.offsetWidth,div.style.display="block",div.innerHTML="
",div.firstChild.style.width="5px", +support.shrinkWrapBlocks=3!==div.offsetWidth,support.inlineBlockNeedsLayout&&(body.style.zoom=1)),body.removeChild(container),container=div=tds=marginDiv=null)}),all=select=fragment=opt=a=input=null,support}();var rbrace=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,rmultiDash=/([A-Z])/g;jQuery.extend({cache:{},expando:"jQuery"+(core_version+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(elem){return elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando],!!elem&&!isEmptyDataObject(elem)},data:function(elem,name,data){return internalData(elem,name,data)},removeData:function(elem,name){return internalRemoveData(elem,name)},_data:function(elem,name,data){return internalData(elem,name,data,!0)},_removeData:function(elem,name){return internalRemoveData(elem,name,!0)},acceptData:function(elem){if(elem.nodeType&&1!==elem.nodeType&&9!==elem.nodeType)return!1;var noData=elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()];return!noData||noData!==!0&&elem.getAttribute("classid")===noData}}),jQuery.fn.extend({data:function(key,value){var attrs,name,elem=this[0],i=0,data=null;if(key===undefined){if(this.length&&(data=jQuery.data(elem),1===elem.nodeType&&!jQuery._data(elem,"parsedAttrs"))){for(attrs=elem.attributes;i1,null,!0)},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=jQuery._data(elem,type),data&&(!queue||jQuery.isArray(data)?queue=jQuery._data(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),hooks.cur=fn,fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return jQuery._data(elem,key)||jQuery._data(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){jQuery._removeData(elem,type+"queue"),jQuery._removeData(elem,key)})})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})},prop:function(name,value){return jQuery.access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return name=jQuery.propFix[name]||name,this.each(function(){try{this[name]=undefined,delete this[name]}catch(e){}})},addClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed="string"==typeof value&&value;if(jQuery.isFunction(value))return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className))});if(proceed)for(classes=(value||"").match(core_rnotwhite)||[];i=0;)cur=cur.replace(" "+clazz+" "," ");elem.className=value?jQuery.trim(cur):""}return this},toggleClass:function(value,stateVal){var type=typeof value,isBool="boolean"==typeof stateVal;return jQuery.isFunction(value)?this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal)}):this.each(function(){if("string"===type)for(var className,i=0,self=jQuery(this),state=stateVal,classNames=value.match(core_rnotwhite)||[];className=classNames[i++];)state=isBool?state:!self.hasClass(className),self[state?"addClass":"removeClass"](className);else type!==core_strundefined&&"boolean"!==type||(this.className&&jQuery._data(this,"__className__",this.className),this.className=this.className||value===!1?"":jQuery._data(this,"__className__")||"")})},hasClass:function(selector){for(var className=" "+selector+" ",i=0,l=this.length;i=0)return!0;return!1},val:function(value){var ret,hooks,isFunction,elem=this[0];{if(arguments.length)return isFunction=jQuery.isFunction(value),this.each(function(i){var val,self=jQuery(this);1===this.nodeType&&(val=isFunction?value.call(this,i,self.val()):value,null==val?val="":"number"==typeof val?val+="":jQuery.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()],hooks&&"set"in hooks&&hooks.set(this,val,"value")!==undefined||(this.value=val))});if(elem)return hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()],hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=elem.attributes.value;return!val||val.specified?elem.value:elem.text}},select:{get:function(elem){for(var value,option,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;i=0}),values.length||(elem.selectedIndex=-1),values}}},attr:function(elem,name,value){var hooks,notxml,ret,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return typeof elem.getAttribute===core_strundefined?jQuery.prop(elem,name,value):(notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=name.toLowerCase(),hooks=jQuery.attrHooks[name]||(rboolean.test(name)?boolHook:nodeHook)),value===undefined?hooks&¬xml&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(typeof elem.getAttribute!==core_strundefined&&(ret=elem.getAttribute(name)),null==ret?undefined:ret):null!==value?hooks&¬xml&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:(elem.setAttribute(name,value+""),value):void jQuery.removeAttr(elem,name))},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(core_rnotwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)propName=jQuery.propFix[name]||name,rboolean.test(name)?!getSetAttribute&&ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]=elem[propName]=!1:elem[propName]=!1:jQuery.attr(elem,name,""),elem.removeAttribute(getSetAttribute?name:propName)},attrHooks:{type:{set:function(elem,value){if(!jQuery.support.radioValue&&"radio"===value&&jQuery.nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),value!==undefined?hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var attributeNode=elem.getAttributeNode("tabindex");return attributeNode&&attributeNode.specified?parseInt(attributeNode.value,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}}}}),boolHook={get:function(elem,name){var prop=jQuery.prop(elem,name),attr="boolean"==typeof prop&&elem.getAttribute(name),detail="boolean"==typeof prop?getSetInput&&getSetAttribute?null!=attr:ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]:!!attr:elem.getAttributeNode(name);return detail&&detail.value!==!1?name.toLowerCase():undefined},set:function(elem,value,name){return value===!1?jQuery.removeAttr(elem,name):getSetInput&&getSetAttribute||!ruseDefault.test(name)?elem.setAttribute(!getSetAttribute&&jQuery.propFix[name]||name,name):elem[jQuery.camelCase("default-"+name)]=elem[name]=!0,name}},getSetInput&&getSetAttribute||(jQuery.attrHooks.value={get:function(elem,name){var ret=elem.getAttributeNode(name);return jQuery.nodeName(elem,"input")?elem.defaultValue:ret&&ret.specified?ret.value:undefined},set:function(elem,value,name){return jQuery.nodeName(elem,"input")?void(elem.defaultValue=value):nodeHook&&nodeHook.set(elem,value,name)}}),getSetAttribute||(nodeHook=jQuery.valHooks.button={get:function(elem,name){var ret=elem.getAttributeNode(name);return ret&&("id"===name||"name"===name||"coords"===name?""!==ret.value:ret.specified)?ret.value:undefined},set:function(elem,value,name){var ret=elem.getAttributeNode(name);return ret||elem.setAttributeNode(ret=elem.ownerDocument.createAttribute(name)),ret.value=value+="","value"===name||value===elem.getAttribute(name)?value:undefined}},jQuery.attrHooks.contenteditable={get:nodeHook.get,set:function(elem,value,name){nodeHook.set(elem,""!==value&&value,name)}},jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{set:function(elem,value){if(""===value)return elem.setAttribute(name,"auto"),value}})})),jQuery.support.hrefNormalized||(jQuery.each(["href","src","width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{get:function(elem){var ret=elem.getAttribute(name,2);return null==ret?undefined:ret}})}),jQuery.each(["href","src"],function(i,name){jQuery.propHooks[name]={get:function(elem){return elem.getAttribute(name,4)}}})),jQuery.support.style||(jQuery.attrHooks.style={get:function(elem){return elem.style.cssText||undefined},set:function(elem,value){return elem.style.cssText=value+""}}),jQuery.support.optSelected||(jQuery.propHooks.selected=jQuery.extend(jQuery.propHooks.selected,{get:function(elem){var parent=elem.parentNode;return parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex),null}})),jQuery.support.enctype||(jQuery.propFix.enctype="encoding"),jQuery.support.checkOn||jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={get:function(elem){return null===elem.getAttribute("value")?"on":elem.value}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]=jQuery.extend(jQuery.valHooks[this],{set:function(elem,value){if(jQuery.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0}})});var rformElems=/^(?:input|select|textarea)$/i,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;jQuery.event={global:{},add:function(elem,types,handler,data,selector){var tmp,events,t,handleObjIn,special,eventHandle,handleObj,handlers,type,namespaces,origType,elemData=jQuery._data(elem);if(elemData){for(handler.handler&&(handleObjIn=handler,handler=handleObjIn.handler,selector=handleObjIn.selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return typeof jQuery===core_strundefined||e&&jQuery.event.triggered===e.type?undefined:jQuery.event.dispatch.apply(eventHandle.elem,arguments)},eventHandle.elem=elem),types=(types||"").match(core_rnotwhite)||[""],t=types.length;t--;)tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||(handlers=events[type]=[],handlers.delegateCount=0,special.setup&&special.setup.call(elem,data,namespaces,eventHandle)!==!1||(elem.addEventListener?elem.addEventListener(type,eventHandle,!1):elem.attachEvent&&elem.attachEvent("on"+type,eventHandle))),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0;elem=null}},remove:function(elem,types,handler,selector,mappedTypes){var j,handleObj,tmp,origCount,t,events,special,handlers,type,namespaces,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem);if(elemData&&(events=elemData.events)){for(types=(types||"").match(core_rnotwhite)||[""],t=types.length;t--;)if(tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,handlers=events[type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&special.teardown.call(elem,namespaces,elemData.handle)!==!1||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&(delete elemData.handle,jQuery._removeData(elem,"events"))}},trigger:function(event,data,elem,onlyHandlers){var handle,ontype,cur,bubbleType,special,tmp,i,eventPath=[elem||document],type=core_hasOwn.call(event,"type")?event.type:event,namespaces=core_hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>=0&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event),event.isTrigger=!0,event.namespace=namespaces.join("."),event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=undefined,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||special.trigger.apply(elem,data)!==!1)){if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)event.type=i>1?bubbleType:special.bindType||type,handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle"),handle&&handle.apply(cur,data),handle=ontype&&cur[ontype],handle&&jQuery.acceptData(cur)&&handle.apply&&handle.apply(cur,data)===!1&&event.preventDefault();if(event.type=type,!onlyHandlers&&!event.isDefaultPrevented()&&(!special._default||special._default.apply(elem.ownerDocument,data)===!1)&&("click"!==type||!jQuery.nodeName(elem,"a"))&&jQuery.acceptData(elem)&&ontype&&elem[type]&&!jQuery.isWindow(elem)){tmp=elem[ontype],tmp&&(elem[ontype]=null),jQuery.event.triggered=type;try{elem[type]()}catch(e){}jQuery.event.triggered=undefined,tmp&&(elem[ontype]=tmp)}return event.result}},dispatch:function(event){event=jQuery.event.fix(event);var i,ret,handleObj,matched,j,handlerQueue=[],args=core_slice.call(arguments),handlers=(jQuery._data(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};if(args[0]=event,event.delegateTarget=this,!special.preDispatch||special.preDispatch.call(this,event)!==!1){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj,event.data=handleObj.data;var obj=(jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler;obj.apply&&(ret=obj.apply(matched.elem,args)),ret!==undefined&&(event.result=ret)===!1&&(event.preventDefault(),event.stopPropagation())}return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var sel,handleObj,matches,i,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||"click"!==event.type))for(;cur!=this;cur=cur.parentNode||this)if(1===cur.nodeType&&(cur.disabled!==!0||"click"!==event.type)){for(matches=[],i=0;i=0:jQuery.find(sel,this,null,[cur]).length),matches[sel]&&matches.push(handleObj);matches.length&&handlerQueue.push({elem:cur,handlers:matches})}return delegateCountExpr.cacheLength&&delete cache[keys.shift()],cache[key]=value}}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var div=document.createElement("div");try{return fn(div)}catch(e){return!1}finally{div=null}}function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document&&setDocument(context),context=context||document,results=results||[],!selector||"string"!=typeof selector)return results;if(1!==(nodeType=context.nodeType)&&9!==nodeType)return[];if(!documentIsXML&&!seed){if(match=rquickExpr.exec(selector))if(m=match[1]){if(9===nodeType){if(elem=context.getElementById(m),!elem||!elem.parentNode)return results;if(elem.id===m)return results.push(elem),results}else if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,slice.call(context.getElementsByTagName(selector),0)),results;if((m=match[3])&&support.getByClassName&&context.getElementsByClassName)return push.apply(results,slice.call(context.getElementsByClassName(m),0)),results}if(support.qsa&&!rbuggyQSA.test(selector)){if(old=!0,nid=expando,newContext=context,newSelector=9===nodeType&&selector,1===nodeType&&"object"!==context.nodeName.toLowerCase()){for(groups=tokenize(selector),(old=context.getAttribute("id"))?nid=old.replace(rescape,"\\$&"):context.setAttribute("id",nid),nid="[id='"+nid+"'] ",i=groups.length;i--;)groups[i]=nid+toSelector(groups[i]);newContext=rsibling.test(selector)&&context.parentNode||context,newSelector=groups.join(",")}if(newSelector)try{return push.apply(results,slice.call(newContext.querySelectorAll(newSelector),0)),results}catch(qsaError){}finally{old||context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function siblingCheck(a,b){var cur=b&&a,diff=cur&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function tokenize(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached)return parseOnly?0:cached.slice(0);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){ +matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length));for(type in Expr.filter)!(match=matchExpr[type].exec(soFar))||preFilters[type]&&!(match=preFilters[type](match))||(matched=match.shift(),tokens.push({value:matched,type:type,matches:match}),soFar=soFar.slice(matched.length));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;i-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){return!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml))}];i1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1)).replace(rtrim,"$1"),matcher,i0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,expandContext){var elem,j,matcher,setMatched=[],matchedCount=0,i="0",unmatched=seed&&[],outermost=null!=expandContext,contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",expandContext&&context.parentNode||context),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1;for(outermost&&(outermostContext=context!==document&&context,cachedruns=matcherCachedRuns);null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0;matcher=elementMatchers[j++];)if(matcher(elem,context,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique,cachedruns=++matcherCachedRuns)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i2&&"ID"===(token=tokens[0]).type&&9===context.nodeType&&!documentIsXML&&Expr.relative[tokens[1].type]){if(context=Expr.find.ID(token.matches[0].replace(runescape,funescape),context)[0],!context)return results;selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&context.parentNode||context))){if(tokens.splice(i,1),selector=seed.length&&toSelector(tokens),!selector)return push.apply(results,slice.call(seed,0)),results;break}}return compile(selector,match)(seed,context,documentIsXML,results,rsibling.test(selector)),results}function setFilters(){}var i,cachedruns,Expr,getText,isXML,compile,hasDuplicate,outermostContext,setDocument,document,docElem,documentIsXML,rbuggyQSA,rbuggyMatches,matches,contains,sortOrder,expando="sizzle"+-new Date,preferredDoc=window.document,support={},dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),strundefined=typeof undefined,MAX_NEGATIVE=1<<31,arr=[],pop=arr.pop,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){for(var i=0,len=this.length;i+~])"+whitespace+"*"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+characterEncoding+")"),CLASS:new RegExp("^\\.("+characterEncoding+")"),NAME:new RegExp("^\\[name=['\"]?("+characterEncoding+")['\"]?\\]"),TAG:new RegExp("^("+characterEncoding.replace("w","w*")+")"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rsibling=/[\x20\t\r\n\f]*[+~]/,rnative=/^[^{]+\{\s*\[native code/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rescape=/'|\\/g,rattributeQuotes=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,runescape=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,funescape=function(_,escaped){var high="0x"+escaped-65536;return high!==high?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)};try{slice.call(preferredDoc.documentElement.childNodes,0)[0].nodeType}catch(e){slice=function(i){for(var elem,results=[];elem=this[i++];)results.push(elem);return results}}isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=doc.documentElement,documentIsXML=isXML(doc),support.tagNameNoComments=assert(function(div){return div.appendChild(doc.createComment("")),!div.getElementsByTagName("*").length}),support.attributes=assert(function(div){div.innerHTML="";var type=typeof div.lastChild.getAttribute("multiple");return"boolean"!==type&&"string"!==type}),support.getByClassName=assert(function(div){return div.innerHTML="",!(!div.getElementsByClassName||!div.getElementsByClassName("e").length)&&(div.lastChild.className="e",2===div.getElementsByClassName("e").length)}),support.getByName=assert(function(div){div.id=expando+0,div.innerHTML="
",docElem.insertBefore(div,docElem.firstChild);var pass=doc.getElementsByName&&doc.getElementsByName(expando).length===2+doc.getElementsByName(expando+0).length;return support.getIdNotName=!doc.getElementById(expando),docElem.removeChild(div),pass}),Expr.attrHandle=assert(function(div){return div.innerHTML="",div.firstChild&&typeof div.firstChild.getAttribute!==strundefined&&"#"===div.firstChild.getAttribute("href")})?{}:{href:function(elem){return elem.getAttribute("href",2)},type:function(elem){return elem.getAttribute("type")}},support.getIdNotName?(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&!documentIsXML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}):(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&!documentIsXML){var m=context.getElementById(id);return m?m.id===id||typeof m.getAttributeNode!==strundefined&&m.getAttributeNode("id").value===id?[m]:undefined:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId}}),Expr.find.TAG=support.tagNameNoComments?function(tag,context){if(typeof context.getElementsByTagName!==strundefined)return context.getElementsByTagName(tag)}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.NAME=support.getByName&&function(tag,context){if(typeof context.getElementsByName!==strundefined)return context.getElementsByName(name)},Expr.find.CLASS=support.getByClassName&&function(className,context){if(typeof context.getElementsByClassName!==strundefined&&!documentIsXML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[":focus"],(support.qsa=isNative(doc.querySelectorAll))&&(assert(function(div){div.innerHTML="",div.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),div.querySelectorAll(":checked").length||rbuggyQSA.push(":checked")}),assert(function(div){div.innerHTML="",div.querySelectorAll("[i^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:\"\"|'')"),div.querySelectorAll(":enabled").length||rbuggyQSA.push(":enabled",":disabled"),div.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=isNative(matches=docElem.matchesSelector||docElem.mozMatchesSelector||docElem.webkitMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(div){support.disconnectedMatch=matches.call(div,"div"),matches.call(div,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=new RegExp(rbuggyQSA.join("|")),rbuggyMatches=new RegExp(rbuggyMatches.join("|")),contains=isNative(docElem.contains)||docElem.compareDocumentPosition?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=docElem.compareDocumentPosition?function(a,b){var compare;return a===b?(hasDuplicate=!0,0):(compare=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b))?1&compare||a.parentNode&&11===a.parentNode.nodeType?a===doc||contains(preferredDoc,a)?-1:b===doc||contains(preferredDoc,b)?1:0:4&compare?-1:1:a.compareDocumentPosition?-1:1}:function(a,b){var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(a===b)return hasDuplicate=!0,0;if(!aup||!bup)return a===doc?-1:b===doc?1:aup?-1:bup?1:0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},hasDuplicate=!1,[0,0].sort(sortOrder),support.detectDuplicates=hasDuplicate,document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),support.matchesSelector&&!documentIsXML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&!rbuggyQSA.test(expr))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){var val;return(elem.ownerDocument||elem)!==document&&setDocument(elem),documentIsXML||(name=name.toLowerCase()),(val=Expr.attrHandle[name])?val(elem):documentIsXML||support.attributes?elem.getAttribute(name):((val=elem.getAttributeNode(name))||elem.getAttribute(name))&&elem[name]===!0?name:val&&val.specified?val.value:null},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],i=1,j=0;if(hasDuplicate=!support.detectDuplicates,results.sort(sortOrder),hasDuplicate){for(;elem=results[i];i++)elem===results[i-1]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i];i++)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[5]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[4]?match[2]=match[4]:unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeName){return"*"===nodeName?function(){return!0}:(nodeName=nodeName.replace(runescape,funescape).toLowerCase(),function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName})},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(outerCache=parent[expando]||(parent[expando]={}),cache=outerCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=cache[0]===dirruns&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns)diff=cache[1];else for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&((node[expando]||(node[expando]={}))[type]=[dirruns,diff]),node!==elem)););return diff-=last,diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf.call(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do if(elemLang=documentIsXML?elem.getAttribute("xml:lang")||elem.getAttribute("lang"):elem.lang)return elemLang=elemLang.toLowerCase(),elemLang===lang||0===elemLang.indexOf(lang+"-");while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:function(elem){return elem.disabled===!1},disabled:function(elem){return elem.disabled===!0},checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeName>"@"||3===elem.nodeType||4===elem.nodeType)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||attr.toLowerCase()===elem.type)},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){for(var i=0;i=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i1?jQuery.unique(ret):ret),ret.selector=(this.selector?this.selector+" ":"")+selector,ret},has:function(target){var i,targets=jQuery(target,this),len=targets.length;return this.filter(function(){for(i=0;i=0:jQuery.filter(selector,this).length>0:this.filter(selector).length>0)},closest:function(selectors,context){for(var cur,i=0,l=this.length,ret=[],pos=rneedsContext.test(selectors)||"string"!=typeof selectors?jQuery(selectors,context||this.context):0;i-1:jQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break}cur=cur.parentNode}return this.pushStack(ret.length>1?jQuery.unique(ret):ret)},index:function(elem){return elem?"string"==typeof elem?jQuery.inArray(this[0],jQuery(elem)):jQuery.inArray(elem.jquery?elem[0]:elem,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){var set="string"==typeof selector?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(jQuery.unique(all))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.fn.andSelf=jQuery.fn.addBack,jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);return runtil.test(name)||(selector=until),selector&&"string"==typeof selector&&(ret=jQuery.filter(selector,ret)),ret=this.length>1&&!guaranteedUnique[name]?jQuery.unique(ret):ret,this.length>1&&rparentsprev.test(name)&&(ret=ret.reverse()),this.pushStack(ret)}}),jQuery.extend({filter:function(expr,elems,not){return not&&(expr=":not("+expr+")"),1===elems.length?jQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:jQuery.find.matches(expr,elems)},dir:function(elem,dir,until){for(var matched=[],cur=elem[dir];cur&&9!==cur.nodeType&&(until===undefined||1!==cur.nodeType||!jQuery(cur).is(until));)1===cur.nodeType&&matched.push(cur),cur=cur[dir];return matched},sibling:function(n,elem){for(var r=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&r.push(n);return r}});var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:null|\d+)"/g,rnoshimcache=new RegExp("<(?:"+nodeNames+")[\\s/>]","i"),rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rtbody=/\s*$/g,wrapMap={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:jQuery.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},safeFragment=createSafeFragment(document),fragmentDiv=safeFragment.appendChild(document.createElement("div"));wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td,jQuery.fn.extend({text:function(value){return jQuery.access(this,function(value){return value===undefined?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value))},null,value,arguments.length)},wrapAll:function(html){if(jQuery.isFunction(html))return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))});if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map(function(){for(var elem=this;elem.firstChild&&1===elem.firstChild.nodeType;)elem=elem.firstChild;return elem}).append(this)}return this},wrapInner:function(html){return jQuery.isFunction(html)?this.each(function(i){jQuery(this).wrapInner(html.call(this,i))}):this.each(function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)})},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function(){return this.parent().each(function(){jQuery.nodeName(this,"body")||jQuery(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(elem){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.appendChild(elem)})},prepend:function(){return this.domManip(arguments,!0,function(elem){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.insertBefore(elem,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,!1,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)})},remove:function(selector,keepData){for(var elem,i=0;null!=(elem=this[i]);i++)(!selector||jQuery.filter(selector,[elem]).length>0)&&(keepData||1!==elem.nodeType||jQuery.cleanData(getAll(elem)), +elem.parentNode&&(keepData&&jQuery.contains(elem.ownerDocument,elem)&&setGlobalEval(getAll(elem,"script")),elem.parentNode.removeChild(elem)));return this},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++){for(1===elem.nodeType&&jQuery.cleanData(getAll(elem,!1));elem.firstChild;)elem.removeChild(elem.firstChild);elem.options&&jQuery.nodeName(elem,"select")&&(elem.options.length=0)}return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return jQuery.access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined)return 1===elem.nodeType?elem.innerHTML.replace(rinlinejQuery,""):undefined;if("string"==typeof value&&!rnoInnerhtml.test(value)&&(jQuery.support.htmlSerialize||!rnoshimcache.test(value))&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1>");try{for(;i")?clone=elem.cloneNode(!0):(fragmentDiv.innerHTML=elem.outerHTML,fragmentDiv.removeChild(clone=fragmentDiv.firstChild)),!(jQuery.support.noCloneEvent&&jQuery.support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),srcElements=getAll(elem),i=0;null!=(node=srcElements[i]);++i)destElements[i]&&fixCloneNodeIssues(node,destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0;null!=(node=srcElements[i]);i++)cloneCopyEvent(node,destElements[i]);else cloneCopyEvent(elem,clone);return destElements=getAll(clone,"script"),destElements.length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),destElements=srcElements=node=null,clone},buildFragment:function(elems,context,scripts,selection){for(var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;i")+wrap[2],j=wrap[0];j--;)tmp=tmp.lastChild;if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)&&nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0])),!jQuery.support.tbody)for(elem="table"!==tag||rtbody.test(elem)?""!==wrap[1]||rtbody.test(elem)?0:tmp:tmp.firstChild,j=elem&&elem.childNodes.length;j--;)jQuery.nodeName(tbody=elem.childNodes[j],"tbody")&&!tbody.childNodes.length&&elem.removeChild(tbody);for(jQuery.merge(nodes,tmp.childNodes),tmp.textContent="";tmp.firstChild;)tmp.removeChild(tmp.firstChild);tmp=safe.lastChild}else nodes.push(context.createTextNode(elem));for(tmp&&safe.removeChild(tmp),jQuery.support.appendChecked||jQuery.grep(getAll(nodes,"input"),fixDefaultChecked),i=0;elem=nodes[i++];)if((!selection||jQuery.inArray(elem,selection)===-1)&&(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(safe.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts))for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return tmp=null,safe},cleanData:function(elems,acceptData){for(var elem,type,id,data,i=0,internalKey=jQuery.expando,cache=jQuery.cache,deleteExpando=jQuery.support.deleteExpando,special=jQuery.event.special;null!=(elem=elems[i]);i++)if((acceptData||jQuery.acceptData(elem))&&(id=elem[internalKey],data=id&&cache[id])){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);cache[id]&&(delete cache[id],deleteExpando?delete elem[internalKey]:typeof elem.removeAttribute!==core_strundefined?elem.removeAttribute(internalKey):elem[internalKey]=null,core_deletedIds.push(id))}}});var iframe,getStyles,curCSS,ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rposition=/^(top|right|bottom|left)$/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rmargin=/^margin/,rnumsplit=new RegExp("^("+core_pnum+")(.*)$","i"),rnumnonpx=new RegExp("^("+core_pnum+")(?!px)[a-z%]+$","i"),rrelNum=new RegExp("^([+-])=("+core_pnum+")","i"),elemdisplay={BODY:"block"},cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:0,fontWeight:400},cssExpand=["Top","Right","Bottom","Left"],cssPrefixes=["Webkit","O","Moz","ms"];jQuery.fn.extend({css:function(name,value){return jQuery.access(this,function(elem,name,value){var len,styles,map={},i=0;if(jQuery.isArray(name)){for(styles=getStyles(elem),len=name.length;i1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){var bool="boolean"==typeof state;return this.each(function(){(bool?state:isHidden(this))?jQuery(this).show():jQuery(this).hide()})}}),jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;if(name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],value===undefined)return hooks&&"get"in hooks&&(ret=hooks.get(elem,!1,extra))!==undefined?ret:style[name];if(type=typeof value,"string"===type&&(ret=rrelNum.exec(value))&&(value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name)),type="number"),!(null==value||"number"===type&&isNaN(value)||("number"!==type||jQuery.cssNumber[origName]||(value+="px"),jQuery.support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&(value=hooks.set(elem,value,extra))===undefined)))try{style[name]=value}catch(e){}}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);return name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],hooks&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),val===undefined&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),extra===!0||jQuery.isNumeric(num)?num||0:val):val},swap:function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];ret=callback.apply(elem,args||[]);for(name in options)elem.style[name]=old[name];return ret}}),window.getComputedStyle?(getStyles=function(elem){return window.getComputedStyle(elem,null)},curCSS=function(elem,name,_computed){var width,minWidth,maxWidth,computed=_computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:undefined,style=elem.style;return computed&&(""!==ret||jQuery.contains(elem.ownerDocument,elem)||(ret=jQuery.style(elem,name)),rnumnonpx.test(ret)&&rmargin.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),ret}):document.documentElement.currentStyle&&(getStyles=function(elem){return elem.currentStyle},curCSS=function(elem,name,_computed){var left,rs,rsLeft,computed=_computed||getStyles(elem),ret=computed?computed[name]:undefined,style=elem.style;return null==ret&&style&&style[name]&&(ret=style[name]),rnumnonpx.test(ret)&&!rposition.test(name)&&(left=style.left,rs=elem.runtimeStyle,rsLeft=rs&&rs.left,rsLeft&&(rs.left=elem.currentStyle.left),style.left="fontSize"===name?"1em":ret,ret=style.pixelLeft+"px",style.left=left,rsLeft&&(rs.left=rsLeft)),""===ret?"auto":ret}),jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed)return 0===elem.offsetWidth&&rdisplayswap.test(jQuery.css(elem,"display"))?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)}):getWidthOrHeight(elem,name,extra)},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.support.boxSizing&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),styles):0)}}}),jQuery.support.opacity||(jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":computed?"1":""},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+100*value+")":"",filter=currentStyle&¤tStyle.filter||style.filter||"";style.zoom=1,(value>=1||""===value)&&""===jQuery.trim(filter.replace(ralpha,""))&&style.removeAttribute&&(style.removeAttribute("filter"),""===value||currentStyle&&!currentStyle.filter)||(style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity)}}),jQuery(function(){jQuery.support.reliableMarginRight||(jQuery.cssHooks.marginRight={get:function(elem,computed){if(computed)return jQuery.swap(elem,{display:"inline-block"},curCSS,[elem,"marginRight"])}}),!jQuery.support.pixelPosition&&jQuery.fn.position&&jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]={get:function(elem,computed){if(computed)return computed=curCSS(elem,prop),rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}}})}),jQuery.expr&&jQuery.expr.filters&&(jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0||!jQuery.support.reliableHiddenOffsets&&"none"===(elem.style&&elem.style.display||jQuery.css(elem,"display"))},jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)}),jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];i<4;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},rmargin.test(prefix)||(jQuery.cssHooks[prefix+suffix].set=setPositiveNumber)});var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!manipulation_rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return null==val?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}}),jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():null==value?"":value,s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(traditional===undefined&&(traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional),jQuery.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,function(){add(this.name,this.value)});else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&").replace(r20,"+")},jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}}),jQuery.fn.hover=function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)};var ajaxLocParts,ajaxLocation,ajax_nonce=jQuery.now(),ajax_rquery=/\?/,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,_load=jQuery.fn.load,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href}catch(e){ajaxLocation=document.createElement("a"),ajaxLocation.href="",ajaxLocation=ajaxLocation.href}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[],jQuery.fn.load=function(url,params,callback){if("string"!=typeof url&&_load)return _load.apply(this,arguments);var selector,response,type,self=this,off=url.indexOf(" ");return off>=0&&(selector=url.slice(off,url.length),url=url.slice(0,off)),jQuery.isFunction(params)?(callback=params,params=undefined):params&&"object"==typeof params&&(type="POST"),self.length>0&&jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments,self.html(selector?jQuery("
").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR])}),this},jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}}),jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){return jQuery.isFunction(data)&&(type=type||callback,callback=data,data=undefined),jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback})}}),jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":window.String,"text html":!0,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;2!==state&&(state=2,timeoutTimer&&clearTimeout(timeoutTimer),transport=undefined,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),status>=200&&status<300||304===status?(s.ifModified&&(modified=jqXHR.getResponseHeader("Last-Modified"),modified&&(jQuery.lastModified[cacheURL]=modified),modified=jqXHR.getResponseHeader("etag"),modified&&(jQuery.etag[cacheURL]=modified)),204===status?(isSuccess=!0,statusText="nocontent"):304===status?(isSuccess=!0,statusText="notmodified"):(isSuccess=ajaxConvert(s,response),statusText=isSuccess.state,success=isSuccess.data,error=isSuccess.error,isSuccess=!error)):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=undefined,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}"object"==typeof url&&(options=url,url=undefined),options=options||{};var parts,i,cacheURL,responseHeadersString,timeoutTimer,fireGlobals,transport,responseHeaders,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(2===state){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()]=match[2];match=responseHeaders[key.toLowerCase()]}return null==match?null:match},getAllResponseHeaders:function(){return 2===state?responseHeadersString:null},setRequestHeader:function(name,value){var lname=name.toLowerCase();return state||(name=requestHeadersNames[lname]=requestHeadersNames[lname]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return state||(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(state<2)for(code in map)statusCode[code]=[statusCode[code],map[code]];else jqXHR.always(map[jqXHR.status]);return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR).complete=completeDeferred.add,jqXHR.success=jqXHR.done,jqXHR.error=jqXHR.fail,s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(core_rnotwhite)||[""],null==s.crossDomain&&(parts=rurl.exec(s.url.toLowerCase()),s.crossDomain=!(!parts||parts[1]===ajaxLocParts[1]&&parts[2]===ajaxLocParts[2]&&(parts[3]||("http:"===parts[1]?80:443))==(ajaxLocParts[3]||("http:"===ajaxLocParts[1]?80:443)))),s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),2===state)return jqXHR;fireGlobals=s.global,fireGlobals&&0===jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url,s.hasContent||(s.data&&(cacheURL=s.url+=(ajax_rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),s.cache===!1&&(s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+ajax_nonce++):cacheURL+(ajax_rquery.test(cacheURL)?"&":"?")+"_="+ajax_nonce++)),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&s.contentType!==!1||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===!1||2===state))return jqXHR.abort();strAbort="abort";for(i in{success:1,error:1,complete:1})jqXHR[i](s[i]);if(transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),s.async&&s.timeout>0&&(timeoutTimer=setTimeout(function(){jqXHR.abort("timeout")},s.timeout));try{state=1,transport.send(requestHeaders,done)}catch(e){if(!(state<2))throw e;done(-1,e)}}else done(-1,"No Transport");return jqXHR},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")}}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",function(s){s.cache===undefined&&(s.cache=!1),s.crossDomain&&(s.type="GET",s.global=!1)}),jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||jQuery("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script"),script.async=!0,s.scriptCharset&&(script.charset=s.scriptCharset),script.src=s.url,script.onload=script.onreadystatechange=function(_,isAbort){(isAbort||!script.readyState||/loaded|complete/.test(script.readyState))&&(script.onload=script.onreadystatechange=null,script.parentNode&&script.parentNode.removeChild(script),script=null,isAbort||callback(200,"success"))},head.insertBefore(script,head.firstChild)},abort:function(){script&&script.onload(undefined,!0)}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+ajax_nonce++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==!1&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||"jsonp"===s.dataTypes[0])return callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):s.jsonp!==!1&&(s.url+=(ajax_rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always(function(){window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&jQuery.isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=undefined}),"script"});var xhrCallbacks,xhrSupported,xhrId=0,xhrOnUnloadAbort=window.ActiveXObject&&function(){var key;for(key in xhrCallbacks)xhrCallbacks[key](undefined,!0)};jQuery.ajaxSettings.xhr=window.ActiveXObject?function(){return!this.isLocal&&createStandardXHR()||createActiveXHR()}:createStandardXHR,xhrSupported=jQuery.ajaxSettings.xhr(),jQuery.support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,xhrSupported=jQuery.support.ajax=!!xhrSupported,xhrSupported&&jQuery.ajaxTransport(function(s){if(!s.crossDomain||jQuery.support.cors){var callback;return{send:function(headers,complete){var handle,i,xhr=s.xhr();if(s.username?xhr.open(s.type,s.url,s.async,s.username,s.password):xhr.open(s.type,s.url,s.async),s.xhrFields)for(i in s.xhrFields)xhr[i]=s.xhrFields[i];s.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(s.mimeType),s.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest");try{for(i in headers)xhr.setRequestHeader(i,headers[i])}catch(err){}xhr.send(s.hasContent&&s.data||null),callback=function(_,isAbort){var status,responseHeaders,statusText,responses;try{if(callback&&(isAbort||4===xhr.readyState))if(callback=undefined,handle&&(xhr.onreadystatechange=jQuery.noop,xhrOnUnloadAbort&&delete xhrCallbacks[handle]),isAbort)4!==xhr.readyState&&xhr.abort();else{responses={},status=xhr.status,responseHeaders=xhr.getAllResponseHeaders(),"string"==typeof xhr.responseText&&(responses.text=xhr.responseText);try{statusText=xhr.statusText}catch(e){statusText=""}status||!s.isLocal||s.crossDomain?1223===status&&(status=204):status=responses.text?200:404}}catch(firefoxAccessException){isAbort||complete(-1,firefoxAccessException)}responses&&complete(status,statusText,responses,responseHeaders)},s.async?4===xhr.readyState?setTimeout(callback):(handle=++xhrId,xhrOnUnloadAbort&&(xhrCallbacks||(xhrCallbacks={},jQuery(window).unload(xhrOnUnloadAbort)),xhrCallbacks[handle]=callback),xhr.onreadystatechange=callback):callback()},abort:function(){callback&&callback(undefined,!0)}}}});var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+core_pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var end,unit,tween=this.createTween(prop,value),parts=rfxnum.exec(value),target=tween.cur(),start=+target||0,scale=1,maxIterations=20;if(parts){if(end=+parts[2],unit=parts[3]||(jQuery.cssNumber[prop]?"":"px"),"px"!==unit&&start){start=jQuery.css(tween.elem,prop,!0)||end||1;do scale=scale||".5",start/=scale,jQuery.style(tween.elem,prop,start+unit);while(scale!==(scale=tween.cur()/target)&&1!==scale&&--maxIterations)}tween.unit=unit,tween.start=start,tween.end=parts[1]?start+(parts[1]+1)*end:end}return tween}]};jQuery.Animation=jQuery.extend(Animation,{tweener:function(props,callback){jQuery.isFunction(props)?(callback=props,props=["*"]):props=props.split(" ");for(var prop,index=0,length=props.length;index-1,props={},curPosition={},curTop,curLeft;calculatePosition?(curPosition=curElem.position(),curTop=curPosition.top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),jQuery.isFunction(options)&&(options=options.call(elem,i,curOffset)),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({position:function(){if(this[0]){var offsetParent,offset,parentOffset={top:0,left:0},elem=this[0];return"fixed"===jQuery.css(elem,"position")?offset=elem.getBoundingClientRect():(offsetParent=this.offsetParent(),offset=this.offset(),jQuery.nodeName(offsetParent[0],"html")||(parentOffset=offsetParent.offset()),parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",!0),parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",!0)),{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var offsetParent=this.offsetParent||document.documentElement;offsetParent&&!jQuery.nodeName(offsetParent,"html")&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||document.documentElement})}}),jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top=/Y/.test(prop);jQuery.fn[method]=function(val){return jQuery.access(this,function(elem,method,val){var win=getWindow(elem);return val===undefined?win?prop in win?win[prop]:win.document.documentElement[method]:elem[method]:void(win?win.scrollTo(top?jQuery(win).scrollLeft():val,top?val:jQuery(win).scrollTop()):elem[method]=val)},method,val,arguments.length,null)}}),jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||"boolean"!=typeof margin),extra=defaultExtra||(margin===!0||value===!0?"margin":"border");return jQuery.access(this,function(elem,type,value){var doc;return jQuery.isWindow(elem)?elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable,null)}})}),BI.jQuery=BI.$=jQuery,window.$=window.$||jQuery,window.jQuery=window.jQuery||jQuery,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return jQuery})}(window),BI.$.extend(BI.$.Event.prototype,{stopEvent:function(){this.stopPropagation(),this.preventDefault()}}),BI.jQuery&&(!function($){$.fn.insets||($.fn.insets=function(){var p=this.padding(),b=this.border();return{top:p.top,bottom:p.bottom+b.bottom+b.top,left:p.left,right:p.right+b.right+b.left}}),$.fn.bounds||($.fn.bounds=function(value){var tmp={hasIgnoredBounds:!0};return value?(isNaN(value.x)||(tmp.left=value.x),isNaN(value.y)||(tmp.top=value.y),null!=value.width&&(tmp.width=value.width-(this.outerWidth(!0)-this.width()),tmp.width=tmp.width>=0?tmp.width:value.width),null!=value.height&&(tmp.height=value.height-(this.outerHeight(!0)-this.height()),tmp.height=tmp.height>=0?tmp.height:value.height),this.css(tmp),this):(tmp=this.position(),{x:tmp.left,y:tmp.top,width:this.outerWidth(),height:this.outerHeight()})})}(BI.jQuery),BI.extend(BI.jQuery.fn,{destroy:function(){this.remove(),BI.isIE()===!0&&(this[0].outerHTML="")},__textKeywordMarked__:function(text,keyword,py){if(!BI.isKey(keyword)||(text+"").length>100)return this.html(BI.htmlEncode(text));keyword+="",keyword=BI.toUpperCase(keyword);var textLeft=(text||"")+"";for(py=(py||BI.makeFirstPY(text))+"",null!=py&&(py=BI.toUpperCase(py)),this.empty();py.length>0&&textLeft.length>0;){var tidx=BI.toUpperCase(textLeft).indexOf(keyword),pidx=null;if(null!=py&&(pidx=py.indexOf(keyword),pidx>=0&&(pidx%=text.length)),tidx>=0)this.append(BI.htmlEncode(textLeft.substr(0,tidx))),this.append(BI.$("").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(tidx,keyword.length)))),textLeft=textLeft.substr(tidx+keyword.length),null!=py&&(py=py.substr(tidx+keyword.length));else{if(!(null!=pidx&&pidx>=0&&Math.floor(pidx/text.length)===Math.floor((pidx+keyword.length-1)/text.length))){this.append(BI.htmlEncode(textLeft));break}this.append(BI.htmlEncode(textLeft.substr(0,pidx))),this.append(BI.$("").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(pidx,keyword.length)))),null!=py&&(py=py.substr(pidx+keyword.length)),textLeft=textLeft.substr(pidx+keyword.length)}}return this},getDomHeight:function(parent){var clone=BI.$(this).clone();clone.appendTo(BI.$(parent||"body"));var height=clone.height();return clone.remove(),height},hasVerticalScroll:function(){return this.height()>0&&this[0].clientWidth0&&this[0].clientHeightoffset2Body.left+width||e.pageYoffset2Body.top+height)},__hasZIndexMask__:function(zindex){return zindex&&null!=this.zIndexMask[zindex]},__buildZIndexMask__:function(zindex,domArray){this.zIndexMask=this.zIndexMask||{},this.indexMask=this.indexMask||[];var mask=BI.createWidget({type:"bi.center_adapt",cls:"bi-z-index-mask",items:domArray});return mask.element.css({"z-index":zindex}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:mask,left:0,right:0,top:0,bottom:0}]}),this.indexMask.push(mask),zindex&&(this.zIndexMask[zindex]=mask),mask.element},__releaseZIndexMask__:function(zindex){if(zindex&&this.zIndexMask[zindex])return BI.remove(this.indexMask,this.zIndexMask[zindex]),void this.zIndexMask[zindex].destroy();this.indexMask=this.indexMask||[];var indexMask=this.indexMask.pop();indexMask&&indexMask.destroy()}})),_.extend(BI,{$import:function(){function loadReady(src,must){var $scripts=BI.$("head script, body script");BI.$.each($scripts,function(i,item){item.src.indexOf(src)!=-1&&(_LOADED[src]=!0)});var $links=BI.$("head link");BI.$.each($links,function(i,item){item.href.indexOf(src)!=-1&&must&&(_LOADED[src]=!1,BI.$(item).remove())})}var _LOADED={};return function(src,ext,must){if(loadReady(src,must),_LOADED[src]!==!0)if("css"===ext){var link=document.createElement("link");link.rel="stylesheet",link.type="text/css",link.href=src;var head=document.getElementsByTagName("head")[0];head.appendChild(link),_LOADED[src]=!0}else BI.$.ajax({url:src,dataType:"script",async:!1,cache:!0,complete:function(res,status){"success"==status&&(_LOADED[src]=!0)}})}}()}),Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===(0xde0b6b3a7640080).toFixed(0)||!function(){function multiply(n,c){for(var i=-1;++i=0;)c+=data[i],data[i]=Math.floor(c/n),c=c%n*base}function toString(){for(var i=size,s="";--i>=0;)if(""!==s||0===i||0!==data[i]){var t=String(data[i]);""===s?s=t:s+="0000000".slice(0,7-t.length)+t}return s}function pow(x,n,acc){return 0===n?acc:n%2===1?pow(x,n-1,acc*x):pow(x*x,n/2,acc)}function log(x){for(var n=0;x>=4096;)n+=12,x/=4096;for(;x>=2;)n+=1,x/=2;return n}var base,size,data,i;base=1e7,size=6,data=[0,0,0,0,0,0],Number.prototype.toFixed=function(fractionDigits){var f,x,s,m,e,z,j,k;if(f=Number(fractionDigits),f=f!==f?0:Math.floor(f),f<0||f>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(x=Number(this),x!==x)return"NaN";if(x<=-1e21||x>1e21)return String(x);if(s="",x<0&&(s="-",x=-x),m="0",x>1e-21)if(e=log(x*pow(2,69,1))-69,z=e<0?x*pow(2,-e,1):x/pow(2,e,1),z*=4503599627370496,e=52-e,e>0){for(multiply(0,z),j=f;j>=7;)multiply(1e7,0),j-=7;for(multiply(pow(10,j,1),0),j=e-1;j>=23;)divide(1<<23),j-=23;divide(1<0?(k=m.length,m=k<=f?s+"0.0000000000000000000".slice(0,f-k+2)+m:s+m.slice(0,k-f)+"."+m.slice(k-f)):m=s+m,m}}(),_.extend(BI,{MAX:0x1000000000000000,MIN:-0x1000000000000000,EVENT_RESPONSE_TIME:200,zIndex_layer:1e5,zIndex_popover:1e6,zIndex_popup:1e7,zIndex_masker:1e8,zIndex_tip:1e9,emptyStr:"",emptyFn:function(){},empty:null,Key:{48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/"},KeyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},Status:{SUCCESS:1,WRONG:2,START:3,END:4,WAITING:5,READY:6,RUNNING:7,OUTOFBOUNDS:8,NULL:-1},Direction:{Top:"top",Bottom:"bottom",Left:"left",Right:"right",Custom:"custom"},Axis:{Vertical:"vertical",Horizontal:"horizontal"},Selection:{Default:-2,None:-1,Single:0,Multi:1,All:2},HorizontalAlign:{Left:"left",Right:"right",Center:"center",Stretch:"stretch"},VerticalAlign:{Middle:"middle",Top:"top",Bottom:"bottom",Stretch:"stretch"},StartOfWeek:1}),BI.version="2.0",BI.AbsoluteCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-center-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0),right:o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0),top:o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0),bottom:o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0),margin:"auto"}),w},resize:function(){},populate:function(items){BI.AbsoluteCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_center_adapt",BI.AbsoluteCenterLayout),BI.AbsoluteHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-horizontal-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0),right:o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0),margin:"auto"}),o.vgap+o.tgap+(item.vgap||0)+(item.tgap||0)!==0&&w.element.css("top",o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)),o.vgap+o.bgap+(item.vgap||0)+(item.bgap||0)!==0&&w.element.css("bottom",o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)),w},resize:function(){},populate:function(items){BI.AbsoluteHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_horizontal_adapt",BI.AbsoluteHorizontalLayout),BI.AbsoluteVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-vertical-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteVerticalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:item.lgap,right:item.rgap,top:o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0),bottom:o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0),margin:"auto"}),o.hgap+o.lgap+(item.hgap||0)+(item.lgap||0)!==0&&w.element.css("left",o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)),o.hgap+o.rgap+(item.hgap||0)+(item.rgap||0)!==0&&w.element.css("right",o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)),w},resize:function(){},populate:function(items){BI.AbsoluteVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_vertical_adapt",BI.AbsoluteVerticalLayout),BI.CenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var o=this.options,self=this;return BI.CenterAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,items:o.items,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.center_adapt",BI.CenterAdaptLayout),BI.HorizontalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-adapt-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return BI.HorizontalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,items:o.items,scrollx:o.scrollx,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.horizontal_adapt",BI.HorizontalAdaptLayout),BI.LeftRightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-right-vertical-adapt-layout",items:{},llgap:0,lrgap:0,lhgap:0,rlgap:0,rrgap:0,rhgap:0})},render:function(){var o=this.options,self=this;BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this,arguments);var layoutArray=[];return"left"in o.items&&layoutArray.push({type:"bi.left",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items.left,hgap:o.lhgap,lgap:o.llgap,rgap:o.lrgap}}]}),"right"in o.items&&layoutArray.push({type:"bi.right",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items.right,textAlign:"right",hgap:o.rhgap,lgap:o.rlgap,rgap:o.rrgap}}]}),layoutArray},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_right_vertical_adapt",BI.LeftRightVerticalAdaptLayout),BI.LeftVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var o=this.options,self=this;return BI.LeftVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.left",ref:function(_ref){self.layout=_ref},items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items,lgap:o.lgap,hgap:o.hgap,rgap:o.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.left_vertical_adapt",BI.LeftVerticalAdaptLayout),BI.RightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-right-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var o=this.options,self=this;return BI.RightVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.right",ref:function(_ref){self.layout=_ref},items:[{el:{type:"bi.vertical_adapt",height:"100%",textAlign:"right",items:o.items,lgap:o.lgap,hgap:o.hgap,rgap:o.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.right_vertical_adapt",BI.RightVerticalAdaptLayout),BI.TableAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-center-adapt-layout",columnSize:[],verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var o=this.options;BI.TableAdaptLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("
").css({position:"relative",display:"table",height:o.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:o.horizontalAlign===BI.HorizontalAlign.Center?"100%":"auto","white-space":"nowrap"}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,td,width=o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i];if(this.hasWidget(this._getChildName(i)))td=this.getWidgetByName(this._getChildName(i)),td.element.width(width);else{var w=BI.createWidget(item);w.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),td=BI.createWidget({type:"bi.default",width:width,items:[w]}),this.addWidget(this._getChildName(i),td)}return td.element.css({"max-width":o.columnSize[i]<=1?width:width+"px"}),0===i&&td.element.addClass("first-element"),td.element.css({position:"relative",display:"table-cell","vertical-align":o.verticalAlign,margin:"0",padding:"0",height:"100%"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),td},appendFragment:function(frag){this.$table.append(frag),this.element.append(this.$table)},resize:function(){},populate:function(items){BI.TableAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table_adapt",BI.TableAdaptLayout),BI.VerticalAdaptLayout=BI.inherit(BI.Layout,{props:{baseCls:"bi-vertical-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0},render:function(){var self=this,o=this.options;return BI.VerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,items:o.items,scrollx:o.scrollx,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.vertical_adapt",BI.VerticalAdaptLayout),BI.HorizontalAutoLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAutoLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizon-auto-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAutoLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.HorizontalAutoLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",margin:"0px auto"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_auto",BI.HorizontalAutoLayout),BI.FloatHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-horizontal-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},mounted:function(){var self=this,width=this.left.element.width(),height=this.left.element.height();this.left.element.width(width).height(height).css("float","none"),BI.remove(this._children,function(i,wi){wi===self.container&&delete self._children[i]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.left]})},_addElement:function(i,item){var self=this,o=this.options;return this.left=BI.createWidget({type:"bi.vertical",items:[item],hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,lgap:o.lgap,rgap:o.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]}),this.left},populate:function(items){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_float",BI.FloatHorizontalLayout),BI.InlineCenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-center-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineCenterAdaptLayout.superclass.render.apply(this,arguments),this.element.css({whiteSpace:"nowrap",textAlign:"center"}),this.populate(this.options.items)},_addElement:function(i,item,length){var o=this.options,w=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","vertical-align":"middle"}),w.element.addClass("inline-center-adapt-item"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("不能添加元素")},stroke:function(items){var self=this;BI.each(items,function(i,item){item&&self._addElement(i,item,items.length)})},populate:function(items){BI.InlineCenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_center_adapt",BI.InlineCenterAdaptLayout),BI.InlineVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-vertical-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,textAlign:"left"})},render:function(){BI.InlineVerticalAdaptLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.css({whiteSpace:"nowrap",textAlign:o.textAlign}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","vertical-align":"middle"}),w.element.addClass("inline-vertical-adapt-item"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.InlineVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_vertical_adapt",BI.InlineVerticalAdaptLayout),BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-center-adapt-layout",hgap:0,vgap:0})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0","margin-left":(0===i?o.hgap:0)+"px","margin-right":o.hgap+"px","margin-top":o.vgap+"px","margin-bottom":o.vgap+"px"}),w},resize:function(){},populate:function(items){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_center_adapt",BI.FlexCenterLayout),BI.FlexHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-center-adapt-layout",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_vertical",ref:function(_ref){self.wrapper=_ref},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:o.verticalAlign,rowSize:o.rowSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},resize:function(){},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_horizontal_adapt",BI.FlexHorizontalCenter),BI.shortcut("bi.flex_horizontal_center_adapt",BI.FlexHorizontalCenter),BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.addClass("v-"+o.verticalAlign).addClass("h-"+o.horizontalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.columnSize[i]>0&&w.element.width(o.columnSize[i]),"fill"===o.columnSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({ +"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_horizontal",BI.FlexHorizontalLayout),BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,hgap:o.hgap,items:o.items}},resize:function(){},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_vertical_adapt",BI.FlexVerticalCenter),BI.shortcut("bi.flex_vertical_center_adapt",BI.FlexVerticalCenter),BI.FlexVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-layout",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.addClass("h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var w=BI.FlexVerticalLayout.superclass._addElement.apply(this,arguments),o=this.options;return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.FlexVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_vertical",BI.FlexVerticalLayout),BI.FlexWrapperCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-center-adapt-layout clearfix",scrollable:!0})},render:function(){BI.FlexWrapperCenterLayout.superclass.render.apply(this,arguments),this.$wrapper=BI.Widget._renderEngine.createElement("
").addClass("flex-scrollable-center-adapt-layout-wrapper"),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","margin-left":(0===i?o.hgap:0)+"px","margin-right":o.hgap+"px","margin-top":o.vgap+"px","margin-bottom":o.vgap+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_center_adapt",BI.FlexWrapperCenterLayout),BI.FlexWrapperHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:!0,scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_vertical",ref:function(_ref){self.wrapper=_ref},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:o.verticalAlign,rowSize:o.rowSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_horizontal_adapt",BI.FlexWrapperHorizontalCenter),BI.shortcut("bi.flex_scrollable_horizontal_center_adapt",BI.FlexWrapperHorizontalCenter),BI.FlexWrapperHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-horizontal-layout clearfix",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollable:null,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperHorizontalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("
").addClass("flex-scrollable-horizontal-layout-wrapper v-"+o.verticalAlign).addClass("h-"+o.horizontalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.columnSize[i]>0&&w.element.width(o.columnSize[i]),"fill"===o.columnSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_horizontal",BI.FlexWrapperHorizontalLayout),BI.FlexWrapperVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_vertical_adapt",BI.FlexWrapperVerticalCenter),BI.shortcut("bi.flex_scrollable_vertical_center_adapt",BI.FlexWrapperVerticalCenter),BI.FlexWrapperVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:null,scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("
").addClass("flex-scrollable-vertical-layout-wrapper h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_vertical",BI.FlexWrapperVerticalLayout),BI.AbsoluteLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AbsoluteLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteLayout.superclass._addElement.apply(this,arguments),left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&(w.element.css({left:item.left}),left+=item.left),BI.isNotNull(item.right)&&(w.element.css({right:item.right}),right+=item.right),BI.isNotNull(item.top)&&(w.element.css({top:item.top}),top+=item.top),BI.isNotNull(item.bottom)&&(w.element.css({bottom:item.bottom}),bottom+=item.bottom),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({left:left}),right+=o.hgap,w.element.css({right:right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({top:top}),bottom+=o.vgap,w.element.css({bottom:bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({left:left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({right:right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({top:top})),BI.isNotNull(o.bgap)&&(bottom+=o.bgap,w.element.css({bottom:bottom})),BI.isNotNull(item.width)&&w.element.css({width:item.width}),BI.isNotNull(item.height)&&w.element.css({height:item.height}),w.element.css({position:"absolute"}),w},resize:function(){this.stroke(this.options.items)},stroke:function(items){this.options.items=items||[];var self=this;BI.each(items,function(i,item){if(item){if(!BI.isWidget(item)&&!item.el)throw new Error("el must be exist");self._addElement(i,item)}})},populate:function(items){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute",BI.AbsoluteLayout),BI.AdaptiveLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this,arguments),{baseCls:"bi-adaptive-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AdaptiveLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AdaptiveLayout.superclass._addElement.apply(this,arguments);w.element.css({position:"relative"});var left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({"margin-left":left}),right+=o.hgap,w.element.css({"margin-right":right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({"margin-top":top}),bottom+=o.vgap,w.element.css({"margin-bottom":bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({"margin-left":left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({"margin-right":right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({"margin-top":top})),BI.isNotNull(o.bgap)&&(bottom+=o.bgap,w.element.css({"margin-bottom":bottom})),BI.isNotNull(item.width)&&w.element.css({width:item.width}),BI.isNotNull(item.height)&&w.element.css({height:item.height}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.adaptive",BI.AdaptiveLayout),BI.BorderLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.BorderLayout.superclass.props.apply(this,arguments),{baseCls:"bi-border-layout",items:{}})},render:function(){BI.BorderLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(regions){var item,top=0,bottom=0,left=0,right=0;if("north"in regions&&(item=regions.north,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"north")){var w=BI.createWidget(item);this.addWidget(this.getName()+"north",w)}this.getWidgetByName(this.getName()+"north").element.height(item.height).css({position:"absolute",top:item.top||0,left:item.left||0,right:item.right||0,bottom:"initial"})}top=(item.height||0)+(item.top||0)+(item.bottom||0)}if("south"in regions&&(item=regions.south,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"south")){var w=BI.createWidget(item);this.addWidget(this.getName()+"south",w)}this.getWidgetByName(this.getName()+"south").element.height(item.height).css({position:"absolute",bottom:item.bottom||0,left:item.left||0,right:item.right||0,top:"initial"})}bottom=(item.height||0)+(item.top||0)+(item.bottom||0)}if("west"in regions&&(item=regions.west,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"west")){var w=BI.createWidget(item);this.addWidget(this.getName()+"west",w)}this.getWidgetByName(this.getName()+"west").element.width(item.width).css({position:"absolute",left:item.left||0,top:top,bottom:bottom,right:"initial"})}left=(item.width||0)+(item.left||0)+(item.right||0)}if("east"in regions&&(item=regions.east,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"east")){var w=BI.createWidget(item);this.addWidget(this.getName()+"east",w)}this.getWidgetByName(this.getName()+"east").element.width(item.width).css({position:"absolute",right:item.right||0,top:top,bottom:bottom,left:"initial"})}right=(item.width||0)+(item.left||0)+(item.right||0)}if("center"in regions&&(item=regions.center,null!=item)){if(!this.hasWidget(this.getName()+"center")){var w=BI.createWidget(item);this.addWidget(this.getName()+"center",w)}this.getWidgetByName(this.getName()+"center").element.css({position:"absolute",top:top,bottom:bottom,left:left,right:right})}},update:function(opt){},populate:function(items){BI.BorderLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.border",BI.BorderLayout),BI.CardLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CardLayout.superclass.props.apply(this,arguments),{baseCls:"bi-card-layout",items:[]})},render:function(){BI.CardLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},stroke:function(items){var self=this,o=this.options;this.showIndex=void 0,BI.each(items,function(i,item){if(item){if(self.hasWidget(item.cardName))var w=self.getWidgetByName(item.cardName);else{var w=BI.createWidget(item);w.on(BI.Events.DESTROY,function(){var index=BI.findIndex(o.items,function(i,tItem){return tItem.cardName==item.cardName});index>-1&&o.items.splice(index,1)}),self.addWidget(item.cardName,w)}w.element.css({position:"absolute",top:"0",right:"0",bottom:"0",left:"0"}),w.setVisible(!1)}})},update:function(){},empty:function(){BI.CardLayout.superclass.empty.apply(this,arguments),this.options.items=[]},populate:function(items){BI.CardLayout.superclass.populate.apply(this,arguments),this._mount(),this.options.defaultShowName&&this.showCardByName(this.options.defaultShowName)},isCardExisted:function(cardName){return BI.some(this.options.items,function(i,item){return item.cardName==cardName&&item.el})},getCardByName:function(cardName){if(!this.isCardExisted(cardName))throw new Error("cardName is not exist");return this._children[cardName]},_deleteCardByName:function(cardName){delete this._children[cardName];var index=BI.findIndex(this.options.items,function(i,item){return item.cardName==cardName});index>-1&&this.options.items.splice(index,1)},deleteCardByName:function(cardName){if(!this.isCardExisted(cardName))throw new Error("cardName is not exist");var child=this._children[cardName];this._deleteCardByName(cardName),child&&child._destroy()},addCardByName:function(cardName,cardItem){if(this.isCardExisted(cardName))throw new Error("cardName is already exist");var widget=BI.createWidget(cardItem,this);return widget.element.css({position:"relative",top:"0",left:"0",width:"100%",height:"100%"}).appendTo(this.element),widget.invisible(),this.addWidget(cardName,widget),this.options.items.push({el:cardItem,cardName:cardName}),widget},showCardByName:function(name,action,callback){var self=this,exist=this.isCardExisted(name);null!=this.showIndex&&(this.lastShowIndex=this.showIndex),this.showIndex=name;var flag=!1;BI.each(this.options.items,function(i,item){var el=self._children[item.cardName];el&&(name!=item.cardName?!flag&&!exist&&BI.Action&&action instanceof BI.Action?(action.actionBack(el),flag=!0):el.invisible():BI.Action&&action instanceof BI.Action?action.actionPerformed(void 0,el,callback):(el.visible(),callback&&callback()))})},showLastCard:function(){var self=this;this.showIndex=this.lastShowIndex,BI.each(this.options.items,function(i,item){self._children[item.cardName].setVisible(self.showIndex==i)})},setDefaultShowName:function(name){return this.options.defaultShowName=name,this},getDefaultShowName:function(){return this.options.defaultShowName},getAllCardNames:function(){return BI.map(this.options.items,function(i,item){return item.cardName})},getShowingCard:function(){if(BI.isKey(this.showIndex))return this.getWidgetByName(this.showIndex)},deleteAllCard:function(){var self=this;BI.each(this.getAllCardNames(),function(i,name){self.deleteCardByName(name)})},hideAllCard:function(){var self=this;BI.each(this.options.items,function(i,item){self._children[item.cardName].invisible()})},isAllCardHide:function(){var self=this,flag=!0;return BI.some(this.options.items,function(i,item){if(self._children[item.cardName].isVisible())return flag=!1,!1}),flag},removeWidget:function(nameOrWidget){var removeName;BI.isWidget(nameOrWidget)?BI.each(this._children,function(name,child){child===nameOrWidget&&(removeName=name)}):removeName=nameOrWidget,removeName&&this._deleteCardByName(removeName)}}),BI.shortcut("bi.card",BI.CardLayout),BI.DefaultLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DefaultLayout.superclass.props.apply(this,arguments),{hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[]})},render:function(){BI.DefaultLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.DefaultLayout.superclass._addElement.apply(this,arguments);return o.vgap+o.tgap+(item.tgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.DefaultLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.default",BI.DefaultLayout),BI.DivisionLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DivisionLayout.superclass.props.apply(this,arguments),{baseCls:"bi-division-layout",columns:null,rows:null,items:[]})},render:function(){BI.DivisionLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.opitons.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}var o=this.options,rows=o.rows||o.items.length,columns=o.columns||0|(o.items[0]&&o.items[0].length),map=BI.makeArray(rows),widths={},heights={};BI.each(map,function(i){map[i]=BI.makeArray(columns)}),BI.each(items,function(i,item){return BI.isArray(item)?void BI.each(item,function(j,el){widths[i]=(widths[i]||0)+item.width,heights[j]=(heights[j]||0)+item.height,map[i][j]=el}):(widths[item.row]=(widths[item.row]||0)+item.width,heights[item.column]=(heights[item.column]||0)+item.height,void(map[item.row][item.column]=item))});for(var i=0;i0){var lastW=this.getWidgetByName(this.getName()+i+"_"+(j-1));lastW.element.css({right:100-left+"%"})}j==o.columns-1&&w.element.css({right:"0%"}),first(w,i,j),totalW+=map[i][j].width}for(var j=0;j0){var lastW=this.getWidgetByName(this.getName()+(i-1)+"_"+j);lastW.element.css({bottom:100-top+"%"})}i==o.rows-1&&w.element.css({bottom:"0%"}),totalH+=map[i][j].height}},update:function(){},populate:function(items){BI.DivisionLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.division",BI.DivisionLayout),BI.FloatLeftLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-left-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatLeftLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FloatLeftLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","float":"left"}),BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.FloatLeftLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left",BI.FloatLeftLayout),BI.FloatRightLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatRightLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-right-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatRightLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FloatRightLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","float":"right"}),BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":(0===i?o.hgap:0)+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.FloatRightLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.right",BI.FloatRightLayout),BI.GridLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.GridLayout.superclass.props.apply(this,arguments),{baseCls:"bi-grid-layout",columns:null,rows:null,items:[]})},render:function(){BI.GridLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(items){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var self=this,o=this.options,rows=o.rows||o.items.length,columns=o.columns||0|(o.items[0]&&o.items[0].length),width=100/columns,height=100/rows,els=[],i=0;i").attr({cellspacing:0,cellpadding:0}).css({position:"relative","white-space":"nowrap",height:o.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:o.horizontalAlign===BI.HorizontalAlign.Center||o.horizontalAlign===BI.HorizontalAlign.Stretch?"100%":"auto","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=BI.Widget._renderEngine.createElement("
"),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,td,width=o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i];if(this.hasWidget(this._getChildName(i)))td=this.getWidgetByName(this._getChildName(i)),td.element.attr("width",width);else{var w=BI.createWidget(item);w.element.css({position:"relative",margin:"0px auto"}),td=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:width},items:[w]}),this.addWidget(this._getChildName(i),td)}return td.element.css({"max-width":o.columnSize[i]<=1?width:width+"px"}),0===i&&td.element.addClass("first-element"),td.element.css({position:"relative","vertical-align":o.verticalAlign,margin:"0",padding:"0",border:"none"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),td},appendFragment:function(frag){this.$tr.append(frag),this.element.append(this.$table)},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(items){BI.HorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal",BI.HorizontalLayout),BI.HorizontalCellLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalCellLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-cell-layout",scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalCellLayout.superclass.render.apply(this,arguments),this.element.css({display:"table","vertical-align":"top"}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.HorizontalCellLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",display:"table-cell","vertical-align":"middle"}),o.hgap+o.lgap>0&&w.element.css({"margin-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&w.element.css({"margin-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&w.element.css({"margin-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&w.element.css({"margin-bottom":o.vgap+o.bgap+"px"}),w},resize:function(){},populate:function(items){BI.HorizontalCellLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_cell",BI.HorizontalCellLayout),BI.InlineLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.InlineLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",display:"inline-block","*display":"inline","*zoom":1}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px" +}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.InlineLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline",BI.InlineLayout),BI.LatticeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LatticeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-lattice-layout clearfix"})},render:function(){BI.LatticeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.LatticeLayout.superclass._addElement.apply(this,arguments);if(o.columnSize&&o.columnSize[i])var width=o.columnSize[i]/BI.sum(o.columnSize)*100+"%";else var width=1/this.options.items.length*100+"%";return w.element.css({position:"relative","float":"left",width:width}),w},addItem:function(item){var w=BI.LatticeLayout.superclass.addItem.apply(this,arguments);return this.resize(),w},addItemAt:function(item){var w=BI.LatticeLayout.superclass.addItemAt.apply(this,arguments);return this.resize(),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.LatticeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.lattice",BI.LatticeLayout),BI.TableLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-layout",scrolly:!0,columnSize:[200,200,"fill"],rowSize:30,hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TableLayout.superclass.render.apply(this,arguments),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}var o=this.options,abs=[],left=0,right=0,i,j;for(i=0;ii;j--){if(!BI.isNumber(o.columnSize[j]))throw new Error("item with fill can only be one");first(arr[j],this.rows,j),abs.push(BI.extend({top:0,bottom:0,right:o.columnSize[j]<=1?100*right+"%":right,width:o.columnSize[j]<=1?100*o.columnSize[j]+"%":o.columnSize[j]},arr[j])),right+=o.columnSize[j]+(o.columnSize[j]<1?0:o.hgap)}i>=0&&i0&&this.getWidgetByName(this.getName()+(this.rows-1)).element.css({"margin-bottom":o.vgap}),w.element.css({position:"relative"}),this.addWidget(this.getName()+this.rows++,w),w},resize:function(){},addItem:function(arr){if(!BI.isArray(arr))throw new Error("item must be array");return BI.TableLayout.superclass.addItem.apply(this,arguments)},update:function(){},populate:function(items){BI.TableLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table",BI.TableLayout),BI.HTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-h-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{width:100,el:{type:"bi.button",text:"button1"}},{width:"fill",el:{type:"bi.button",text:"button2"}},{width:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.HTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",top:(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",bottom:(item.bgap||0)+(item.vgap||0)+o.vgap+o.bgap+"px"})});var left={},right={};left[0]=0,right[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(left[i])&&(left[i]=left[i-1]+items[i-1].width+(items[i-1].lgap||0)+2*(items[i-1].hgap||0)+o.hgap+o.lgap+o.rgap),item.width<1&&item.width>=0?w.element.css({left:100*left[i]+"%",width:100*item.width+"%"}):w.element.css({left:left[i]+(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",width:BI.isNumber(item.width)?item.width:""}),!BI.isNumber(item.width))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(right[i])&&(right[i]=right[i+1]+items[i+1].width+(items[i+1].rgap||0)+2*(items[i+1].hgap||0)+o.hgap+o.lgap+o.rgap),item.width<1&&item.width>=0?w.element.css({right:100*right[i]+"%",width:100*item.width+"%"}):w.element.css({right:right[i]+(item.rgap||0)+(item.hgap||0)+o.hgap+o.rgap+"px",width:BI.isNumber(item.width)?item.width:""}),!BI.isNumber(item.width))return!0})},update:function(){var updated;return BI.each(this._children,function(i,child){updated=child.update()||updated}),updated},populate:function(items){BI.HTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.htape",BI.HTapeLayout),BI.VTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.VTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-v-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{height:100,el:{type:"bi.button",text:"button1"}},{height:"fill",el:{type:"bi.button",text:"button2"}},{height:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.VTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",left:(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",right:+(item.hgap||0)+(item.rgap||0)+o.hgap+o.rgap+"px"})});var top={},bottom={};top[0]=0,bottom[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(top[i])&&(top[i]=top[i-1]+items[i-1].height+(items[i-1].tgap||0)+2*(items[i-1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({top:100*top[i]+"%",height:100*item.height+"%"}):w.element.css({top:top[i]+(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(bottom[i])&&(bottom[i]=bottom[i+1]+items[i+1].height+(items[i+1].bgap||0)+2*(items[i+1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({bottom:100*bottom[i]+"%",height:100*item.height+"%"}):w.element.css({bottom:bottom[i]+(item.vgap||0)+(item.bgap||0)+o.vgap+o.bgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0})},update:function(){},populate:function(items){BI.VTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vtape",BI.VTapeLayout),BI.TdLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TdLayout.superclass.props.apply(this,arguments),{baseCls:"bi-td-layout",columnSize:[200,200,200],hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TdLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("
").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var o=this.options,tr=BI.createWidget({type:"bi.default",tagName:"tr"}),i=0;i=0;i--){for(var j=0;j=0;j--){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:"bi";return String(Math.random()+Math.random()).replace(rhashcode,prefix)}function isIE(){return"undefined"!=typeof navigator&&/(msie|trident)/i.test(navigator.userAgent.toLowerCase())}function getIEVersion(){var version=0;if("undefined"==typeof navigator)return!1;var agent=navigator.userAgent.toLowerCase(),v1=agent.match(/(?:msie\s([\w.]+))/),v2=agent.match(/(?:trident.*rv:([\w.]+))/);return version=v1&&v2&&v1[1]&&v2[1]?Math.max(1*v1[1],1*v2[1]):v1&&v1[1]?1*v1[1]:v2&&v2[1]?1*v2[1]:0}function isPlainObject(obj){return"[object Object]"===_toString.call(obj)}function parsePath(path){if(!bailRE.test(path)){var segments=path.split(".");return function(obj){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:{},model=vm;!model.$watch&&model.$vm&&(model=model.$vm),isPlainObject(cb)&&(options=cb,cb=cb.handler),"string"==typeof cb&&(cb=model[cb]),options=options||{},options.user=!0;var exps=void 0;if(_$1.isFunction(expOrFn)||!(exps=expOrFn.match(/[a-zA-Z0-9_.*]+|[|][|]|[&][&]|[(]|[)]/g))||1===exps.length&&!/\*/.test(expOrFn))return model.$watch(expOrFn,cb,options),[];var watchers=[],fns=exps.slice(),complete=!1,running=!1,callback=function callback(index,newValue,oldValue,attrs){complete!==!0&&(fns[index]=!0,runBinaryFunction(fns)&&(complete=!0,cb.call(vm,newValue,oldValue,attrs)),options&&options.sync?(complete=!1,running=!1,fns=exps.slice()):running||(running=!0,nextTick(function(){complete=!1,running=!1,fns=exps.slice()})))};return _$1.each(exps,function(exp,i){if(!_$1.has(operators,exp)){if(/^[1-9a-zA-Z.]+(\*\*$|\*$)/.test(exp)||"**"===exp){var isGlobal=/\*\*$/.test(exp);exp=isGlobal?exp.replace(".**",""):exp.replace(".*","");var getter=isGlobal?exp:function(){var result={};return _$1.each(model.model,function(v,key){key in $$skipArray||(result[key]=v)}),result};return void model.$watch(getter,function(newValue,oldValue,attrs){callback(i,newValue,oldValue,_$1.extend({index:i},attrs))},_$1.extend(options,{deep:isGlobal}))}if(/\*\*$|\*$/.test(exp))throw new Error("not support");if(/\*/.test(exp)){var paths=exp.split("."),_getter=function _getter(){for(var currentModels={root:model.model},_loop=(function _loop(len,_i){var models={};"*"===paths[_i]?_$1.each(currentModels,function(model,key){_$1.each(model,function(v,k){key+k in $$skipArray||(models[key+k]=v)})}):_$1.each(currentModels,function(model,key){key+paths[_i]in $$skipArray||(models[key+paths[_i]]=model[paths[_i]])}),currentModels=models}),_i=0,len=paths.length;_i3&&void 0!==arguments[3]?arguments[3]:{};isPlainObject(cb)&&(options=cb,cb=cb.handler),"string"==typeof cb&&(cb=vm[cb]);var getter=_$1.isFunction(expOrFn)?_$1.bind(expOrFn,vm):_$1.bind(function(){return parsePath("model."+expOrFn)(vm)},vm);return new Watcher({get:getter,listener:_$1.bind(cb,vm),last:getter(),sync:options.sync,deep:options.deep,id:options.id})}function injectMethod(method,vm){return function(){var result=method.apply(vm,[].concat(Array.prototype.slice.call(arguments)));return vm.$digest(),result}}function initMethods(vm,methods){for(var key in methods)vm[key]=null==methods[key]?noop:injectMethod(methods[key],vm)}function initMixins(vm){var mixins=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];_$1.each(mixins.reverse(),function(mixinType){var mixin$$1=getMixins(mixinType);for(var key in mixin$$1)"function"==typeof mixin$$1[key]&&(_$1.has(vm,key)||(vm[key]=injectMethod(mixin$$1[key],vm)))})}function defineContext(vm,keys){function getSingleContext(key){for(var p=vm._parent;p;){if(p.childContext&&p.childContext.indexOf(key)>-1)return p.$watch(key,function(cur,last,p){vm._contextWatchers[key]&&(vm.model[key]=cur,vm._contextWatchers[key].last=cloneShadow(cur),vm.$digest())},{id:vm._modelHashId+"-"+key}),{p:p,value:p.model[key]};p=p._parent}}var watchers=vm._contextWatchers={};_$1.each(keys,function(key){var context=getSingleContext(key);context&&(vm.model[key]=context.p?context.p.model[key]:void 0,watchers[key]=new Watcher({id:context.p._modelHashId+"-"+key,get:function get(){return vm.model[key]},last:vm.model[key],listener:_$1.bind(function(c){context.p.model[key]=c,context.p.$digest()},context.p)}))})}function digestState(vm){var dirty=!1;return _$1.each(vm._stateWatchers,function(watcher,key){var cur=watcher.get(),last=watcher.last;isShadowEqual(cur,last)||(vm.model[key]=cur,dirty=!0,watcher.last=cloneShadow(cur))}),dirty}function digestComputed(vm){var dirty=!1,dirtyQueue=[],cleanQueue=[];return _$1.each(vm._computedOrder,function(key){var watcher=vm._computedWatchers[key];try{var cur=watcher.get(),last=watcher.last;isShadowEqual(cur,last)?cleanQueue.push(key):(vm.model[key]=cur,dirty=!0,dirtyQueue.push(key),watcher.last=cloneShadow(cur))}catch(err){dirty=!0,dirtyQueue.push(key)}}),vm._computedOrder=[].concat(cleanQueue,dirtyQueue),dirty}function digestContext(vm){var dirty=!1;return _$1.each(vm._contextWatchers,function(watcher,key){var cur=watcher.get(),last=watcher.last;if(!isShadowEqual(cur,last)){var listener={id:watcher.id,cb:_$1.bind(watcher.listener,vm,cur,last,vm)};vm.contextListeners.push(listener),vm.model[key]=cur,dirty=!0,watcher.last=cloneShadow(cur)}}),dirty}function digest(vm){for(var stateDirty=!0,contextDirty=!0,computedDirty=!0,ttl=TTL;stateDirty&&ttl>0;ttl--)stateDirty=digestState(vm);for(var _ttl=TTL;contextDirty&&_ttl>0;_ttl--)contextDirty=digestContext(vm);for(var _ttl2=TTL;computedDirty&&_ttl2>0;_ttl2--)computedDirty=digestComputed(vm)}function executeWatchListeners(vm){var syncListeners=[].concat(vm.syncListeners||[]),asyncListeners=[].concat(vm.asyncListeners||[]),contextListeners=[].concat(vm.contextListeners||[]);vm.asyncListeners=[],vm.syncListeners=[];var watchers=[].concat(vm._watchers);_$1.each(watchers,function(watcher){if(watcher){var cur=watcher.get(),last=watcher.last;if(!isShadowEqual(cur,last)){var listner={id:watcher.id,cb:_$1.bind(watcher.listener,vm,cur,last,vm)};watcher.sync===!0?syncListeners.push(listner):asyncListeners.push(listner),watcher.last=cloneShadow(cur)}}}),_$1.each(syncListeners,function(listener){listener.cb()}),0===contextListeners.length&&0===asyncListeners.length||nextTick(function(){_$1.each(BI.uniqBy(contextListeners.reverse(),"id").reverse(),function(listener){listener.cb()}),_$1.each(asyncListeners,function(listener){listener.cb()})})}function refreshAllDefineModel(){_$1.each(allDefineModelInstances,function(insta){insta&&insta.$digest&&insta.$digest()})}function getAllModelInstances(){return allModelInstances}function refreshAll(){_$1.each(getAllModelInstances(),function(insta){insta&&insta.$digest&&insta.$digest()})}function define(model){var OB=inherit(Model,{state:function state(){return model}}),ob=new OB;return ob._constructor({define:!0}),allDefineModelInstances[ob.getModelID()]=ob,ob.model}_$1="default"in _$1?_$1["default"]:_$1;var falsy=void 0,$$skipArray={$accessors:falsy,$vbthis:falsy,$vbsetter:falsy, +$vm:falsy},$$skips=["$accessors","$vbthis","$vbsetter","$vm"],originalMethods=[];_$1.each(["slice","splice"],function(method){originalMethods[method]=Array.prototype[method]}),Array.prototype.splice=function(){this.__ref__=makeHashCode();for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];return originalMethods.splice.apply(this,args)};var rhashcode=/\d\.\d{4}/,isIE9Below=isIE()&&getIEVersion()<9,_toString=Object.prototype.toString,bailRE=/[^\w.$]/,nextTick=function(){function nextTickHandler(){pending=!1;var copies=callbacks.slice(0);callbacks.length=0;for(var i=0;i=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left,offsetY=event.clientY-boundingRect.top}return event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.offsetX=offsetX,event.offsetY=offsetY,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120===0}var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})}),BI.Pane=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Pane.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-pane",tipText:BI.i18nText("BI-No_Selected_Item"),overlap:!0,onLoaded:BI.emptyFn})},_assertTip:function(){var o=this.options;this._tipText||(this._tipText=BI.createWidget({type:"bi.label",cls:"bi-tips",text:o.tipText,height:25}),BI.createWidget({type:"bi.absolute_center_adapt",element:this,items:[this._tipText]}))},loading:function(){var self=this,o=this.options,isIE=BI.isIE(),loadingAnimation=BI.createWidget({type:"bi.horizontal",cls:"bi-loading-widget"+(isIE?" wave-loading hack":""),height:30,width:30,hgap:5,vgap:2.5,items:isIE?[]:[{type:"bi.layout",cls:"animate-rect rect1",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect2",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect3",height:25,width:3}]});this.setTipVisible(!1),o.overlap===!0?(BI.Layers.has(this.getName())||BI.createWidget({type:"bi.absolute_center_adapt",cls:"loading-container",items:[{el:loadingAnimation}],element:BI.Layers.make(this.getName(),this)}),BI.Layers.show(self.getName())):BI.isNull(this._loading)&&(this._loading=loadingAnimation,this._loading.element.css("zIndex",1),BI.createWidget({type:"bi.absolute_center_adapt",element:this,cls:"loading-container",items:[{el:this._loading,left:0,right:0,top:0}]})),this.element.addClass("loading-status")},loaded:function(){var self=this,o=this.options;BI.Layers.remove(self.getName()),this._loading&&this._loading.destroy(),this._loading&&(this._loading=null),o.onLoaded(),self.fireEvent(BI.Pane.EVENT_LOADED),this.element.removeClass("loading-status")},check:function(){this.setTipVisible(BI.isEmpty(this.options.items))},setTipVisible:function(b){b===!0?(this._assertTip(),this._tipText.setVisible(!0)):this._tipText&&this._tipText.setVisible(!1)},populate:function(items){this.options.items=items||[],this.check()},empty:function(){}}),BI.Pane.EVENT_LOADED="EVENT_LOADED",BI.Single=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Single.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-single",readonly:!1,title:null,warningTitle:null,tipType:null,value:null,belowMouse:!1})},_showToolTip:function(e,opt){opt||(opt={});var self=this,o=this.options,type=this.getTipType()||(this.isEnabled()?"success":"warning"),title="success"===type?this.getTitle():this.getWarningTitle()||this.getTitle();BI.isKey(title)&&(BI.Tooltips.show(e,this.getName(),title,type,this,opt),o.action&&BI.Actions.runAction(o.action,"hover",o,this),BI.Actions.runGlobalAction("hover",o,this))},_hideTooltip:function(){var self=this,tooltip=BI.Tooltips.get(this.getName());BI.isNotNull(tooltip)&&tooltip.element.fadeOut(200,function(){BI.Tooltips.remove(self.getName())})},_init:function(){BI.Single.superclass._init.apply(this,arguments);var self=this,o=this.options;(BI.isKey(o.title)||BI.isKey(o.warningTitle)||BI.isFunction(o.title)||BI.isFunction(o.warningTitle))&&this.enableHover({belowMouse:o.belowMouse,container:o.container})},_clearTimeOut:function(){BI.isNotNull(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=null),BI.isNotNull(this.hideTimeout)&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},enableHover:function(opt){opt||(opt={});var self=this;this._hoverBinded||(this.element.on("mouseenter.title"+this.getName(),function(e){self._e=e,"warning"===self.getTipType()||BI.isKey(self.getWarningTitle())&&!self.isEnabled()?self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&self._showToolTip(self._e||e,opt)},200):("success"===self.getTipType()||self.isEnabled())&&(self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&self._showToolTip(self._e||e,opt)},500))}),this.element.on("mousemove.title"+this.getName(),function(e){self._e=e,BI.isNotNull(self.showTimeout)&&(clearTimeout(self.showTimeout),self.showTimeout=null),BI.isNull(self.hideTimeout)&&(self.hideTimeout=BI.delay(function(){BI.isNotNull(self.hideTimeout)&&self._hideTooltip()},500)),self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&(BI.isNotNull(self.hideTimeout)&&(clearTimeout(self.hideTimeout),self.hideTimeout=null),self.element.__isMouseInBounds__(self._e||e)&&self._showToolTip(self._e||e,opt))},500)}),this.element.on("mouseleave.title"+this.getName(),function(e){self._e=null,self._clearTimeOut(),self._hideTooltip()}),this._hoverBinded=!0)},disabledHover:function(){this._clearTimeOut(),this._hideTooltip(),this.element.unbind("mouseenter.title"+this.getName()).unbind("mousemove.title"+this.getName()).unbind("mouseleave.title"+this.getName()),this._hoverBinded=!1},populate:function(items){this.items=items||[]},setTitle:function(title,opt){this.options.title=title,BI.isKey(title)||BI.isFunction(title)?this.enableHover(opt):this.disabledHover()},setWarningTitle:function(title,opt){this.options.warningTitle=title,BI.isKey(title)||BI.isFunction(title)?this.enableHover(opt):this.disabledHover()},getTipType:function(){return this.options.tipType},isReadOnly:function(){return!!this.options.readonly},getTitle:function(){var title=this.options.title;return BI.isFunction(title)?title():title},getWarningTitle:function(){var title=this.options.warningTitle;return BI.isFunction(title)?title():title},setValue:function(val){this.options.readonly||(this.options.value=val)},getValue:function(){return this.options.value},_unMount:function(){BI.Single.superclass._unMount.apply(this,arguments),BI.Tooltips.remove(this.getName())}}),BI.Text=BI.inherit(BI.Single,{props:{baseCls:"bi-text",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",py:"",highLight:!1},render:function(){var self=this,o=this.options;o.hgap+o.lgap>0&&this.element.css({"padding-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&this.element.css({"padding-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&this.element.css({"padding-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&this.element.css({"padding-bottom":o.vgap+o.bgap+"px"}),BI.isNumber(o.height)&&this.element.css({lineHeight:o.height+"px"}),BI.isNumber(o.lineHeight)&&this.element.css({lineHeight:o.lineHeight+"px"}),BI.isWidthOrHeight(o.maxWidth)&&this.element.css({maxWidth:o.maxWidth}),this.element.css({textAlign:o.textAlign,whiteSpace:o.whiteSpace,textOverflow:"nowrap"===o.whiteSpace?"ellipsis":"",overflow:"nowrap"===o.whiteSpace?"":BI.isWidthOrHeight(o.height)?"auto":""}),o.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){o.handler(self.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this;var text=this._getShowText();BI.isKey(text)?this.setText(text):BI.isKey(o.value)&&this.setText(o.value),BI.isKey(o.keyword)&&this.doRedMark(o.keyword),o.highLight&&this.doHighLight()},_getShowText:function(){var o=this.options;return BI.isFunction(o.text)?o.text():o.text},doRedMark:function(keyword){var o=this.options;o.keyword=keyword,this.text.element.__textKeywordMarked__(this._getShowText()||o.value,keyword,o.py)},unRedMark:function(){var o=this.options;o.keyword="",this.text.element.__textKeywordMarked__(this._getShowText()||o.value,"",o.py)},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(text){BI.Text.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(text)},setStyle:function(css){this.text.element.css(css)},setText:function(text){return BI.Text.superclass.setText.apply(this,arguments),this.options.text=BI.isNotNull(text)?text:"",BI.isIE9Below()?void this.text.element.html(BI.htmlEncode(this._getShowText())):void(/\s/.test(text)?this.text.element[0].innerHTML=BI.htmlEncode(this._getShowText()):this.text.element[0].textContent=this._getShowText())}}),BI.shortcut("bi.text",BI.Text),BI.BasicButton=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.BasicButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-basic-button"+(conf.invalid?"":" cursor-pointer")+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),value:"",text:"",stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn,bubble:null})},_init:function(){BI.BasicButton.superclass._init.apply(this,arguments);var opts=this.options;opts.selected===!0&&BI.nextTick(BI.bind(function(){this.setSelected(opts.selected)},this)),BI.nextTick(BI.bind(this.bindEvent,this)),opts.shadow&&this._createShadow(),opts.level&&this.element.addClass("button-"+opts.level)},_createShadow:function(){var self=this,o=this.options,assertMask=function(){self.$mask||(self.$mask=BI.createWidget(BI.isObject(o.shadow)?o.shadow:{},{type:"bi.layout",cls:"bi-button-mask"}),self.$mask.invisible(),BI.createWidget({type:"bi.absolute",element:self,items:[{el:self.$mask,left:0,right:0,top:0,bottom:0}]}))};this.element.mouseup(function(){self._hover||o.isShadowShowingOnSelected||(assertMask(),self.$mask.invisible())}),this.element.on("mouseenter."+this.getName(),function(e){self.element.__isMouseInBounds__(e)&&(!self.isEnabled()||self._hover||!o.isShadowShowingOnSelected&&self.isSelected()||(assertMask(),self.$mask.visible()))}),this.element.on("mousemove."+this.getName(),function(e){self.element.__isMouseInBounds__(e)||self.isEnabled()&&!self._hover&&(assertMask(),self.$mask.invisible())}),this.element.on("mouseleave."+this.getName(),function(){self.isEnabled()&&!self._hover&&(assertMask(),self.$mask.invisible())})},bindEvent:function(){function ev(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()}function clk(e){if(ev(e),!(!self.isEnabled()||self.isOnce()&&self.isSelected())){if(BI.isKey(o.bubble)||BI.isFunction(o.bubble)){if(BI.isNull(self.combo)){var popup;BI.createWidget({type:"bi.absolute",element:self,items:[{el:{type:"bi.bubble_combo",trigger:"",destroyWhenHide:!0,ref:function(){self.combo=this},el:{type:"bi.layout",height:"100%"},popup:{type:"bi.text_bubble_bar_popup_view",text:getBubble(),ref:function(){popup=this},listeners:[{eventName:BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,action:function(v){self.combo.hideView(),v&&onClick.apply(self,arguments)}}]},listeners:[{eventName:BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,action:function(){popup.populate(getBubble())}}]},left:0,right:0,bottom:0,top:0}]})}return void(self.combo.isViewVisible()?self.combo.hideView():self.combo.showView())}onClick.apply(self,arguments)}}function getBubble(){var bubble=self.options.bubble;return BI.isFunction(bubble)?bubble():bubble}var self=this,o=this.options,hand=this.handle();if(hand){hand=hand.element;var triggerArr=(o.trigger||"").split(",");BI.each(triggerArr,function(idx,trigger){switch(trigger){case"mouseup":var mouseDown=!1;hand.mousedown(function(){mouseDown=!0}),hand.mouseup(function(e){mouseDown===!0&&clk(e),mouseDown=!1,ev(e)});break;case"mousedown":var mouseDown=!1,selected=!1;hand.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+self.getName(),function(e){!BI.DOM.isExist(self)||hand.__isMouseInBounds__(e)||mouseDown!==!0||selected||self._trigger(),mouseDown=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())}),mouseDown!==!0&&(self.isSelected()?selected=!0:clk(e),mouseDown=!0,ev(e))}),hand.mouseup(function(e){BI.DOM.isExist(self)&&mouseDown===!0&&selected===!0&&clk(e),mouseDown=!1,selected=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())});break;case"dblclick":hand.dblclick(clk);break;case"lclick":var mouseDown=!1,interval;hand.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+self.getName(),function(e){interval&&clearInterval(interval),interval=null,mouseDown=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())}),mouseDown!==!0&&(!self.isEnabled()||self.isOnce()&&self.isSelected()||(interval=setInterval(function(){self.isEnabled()&&self.doClick()},180),mouseDown=!0,ev(e)))});break;default:(o.stopEvent||o.stopPropagation)&&hand.mousedown(function(e){ev(e)}),hand.click(clk)}});var onClick=BI.debounce(this._doClick,BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1})}},_trigger:function(e){var o=this.options;if(this.isEnabled()&&(this.isDisableSelected()||(this.isForceSelected()?this.setSelected(!0):this.isForceNotSelected()?this.setSelected(!1):this.setSelected(!this.isSelected())),this.isValid())){o.handler.call(this,this.getValue(),this,e);var v=this.getValue();this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,v,this,e),this.fireEvent(BI.BasicButton.EVENT_CHANGE,v,this),o.action&&BI.Actions.runAction(o.action,"click",o,this),BI.Actions.runGlobalAction("click",o,this)}},_doClick:function(e){this.isValid()&&this.beforeClick(e),this._trigger(e),this.isValid()&&this.doClick(e)},beforeClick:function(){},doClick:function(){},handle:function(){return this},hover:function(){this._hover=!0,this.handle().element.addClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!0)},dishover:function(){this._hover=!1,this.handle().element.removeClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},setSelected:function(b){var o=this.options;o.selected=b,b?this.handle().element.addClass("active"):this.handle().element.removeClass("active"),o.shadow&&!o.isShadowShowingOnSelected&&this.$mask&&this.$mask.setVisible(!1)},isSelected:function(){return this.options.selected},isOnce:function(){return this.options.once},isForceSelected:function(){return this.options.forceSelected},isForceNotSelected:function(){return this.options.forceNotSelected},isDisableSelected:function(){return this.options.disableSelected},setText:function(text){this.options.text=text},getText:function(){return this.options.text},_setEnable:function(enable){BI.BasicButton.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled"),enable||this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},empty:function(){BI.Widget._renderEngine.createElement(document).unbind("mouseup."+this.getName()),BI.BasicButton.superclass.empty.apply(this,arguments)},destroy:function(){BI.BasicButton.superclass.destroy.apply(this,arguments)}}),BI.BasicButton.EVENT_CHANGE="BasicButton.EVENT_CHANGE",BI.NodeButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.NodeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-node",open:!1})},_init:function(){BI.NodeButton.superclass._init.apply(this,arguments);var self=this;BI.nextTick(function(){self.setOpened(self.isOpened())})},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.setOpened(!this.isOpened())},isOnce:function(){return!1},isOpened:function(){return!!this.options.open},setOpened:function(b){this.options.open=!!b},triggerCollapse:function(){this.isOpened()&&(this.setOpened(!1),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,this.getValue(),this))},triggerExpand:function(){this.isOpened()||(this.setOpened(!0),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,this.getValue(),this))}}),BI.Tip=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Tip.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-tip",zIndex:BI.zIndex_tip})},_init:function(){BI.Tip.superclass._init.apply(this,arguments),this.element.css({zIndex:this.options.zIndex})}}),BI.ButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-group",behaviors:{},items:[],value:"",chooseType:BI.Selection.Single,layouts:[{type:"bi.center",hgap:0,vgap:0}]})},_init:function(){BI.ButtonGroup.superclass._init.apply(this,arguments);var o=this.options,behaviors={};BI.each(o.behaviors,function(key,rule){behaviors[key]=BI.BehaviorFactory.createBehavior(key,{rule:rule})}),this.behaviors=behaviors,this.populate(o.items),(BI.isKey(o.value)||BI.isNotEmptyArray(o.value))&&this.setValue(o.value)},_createBtns:function(items){var o=this.options;return BI.createWidgets(BI.createItems(items,{type:"bi.text_button"}))},_btnsCreator:function(items){var self=this,args=Array.prototype.slice.call(arguments),o=this.options,buttons=this._createBtns(items);return args[0]=buttons,BI.each(this.behaviors,function(i,behavior){behavior.doBehavior.apply(behavior,args)}),BI.each(buttons,function(i,btn){btn.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){if(type===BI.Events.CLICK){switch(o.chooseType){case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:self.setValue(btn.getValue());break;case BI.ButtonGroup.CHOOSE_TYPE_NONE:self.setValue([])}self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.ButtonGroup.EVENT_CHANGE,value,obj)}else self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),btn.on(BI.Events.DESTROY,function(){BI.remove(self.buttons,btn)})}),buttons},_packageBtns:function(btns){for(var o=this.options,i=o.layouts.length-1;i>0;i--)btns=BI.map(btns,function(k,it){return BI.extend({},o.layouts[i],{items:[BI.extend({},o.layouts[i].el,{el:it})]})});return btns},_packageSimpleItems:function(btns){var o=this.options;return BI.map(o.items,function(i,item){return BI.stripEL(item)===item?btns[i]:BI.extend({},item,{el:btns[i]})})},_packageItems:function(items,packBtns){return BI.createItems(BI.makeArrayByArray(items,{}),BI.clone(packBtns))},_packageLayout:function(items){for(var o=this.options,layout=BI.deepClone(o.layouts[0]),lay=BI.formatEL(layout).el;lay&&lay.items&&!BI.isEmpty(lay.items);)lay=BI.formatEL(lay.items[0]).el;return lay.items=items,layout},_isSimpleLayout:function(){var o=this.options;return 1===o.layouts.length&&!BI.isArray(o.items[0])},doBehavior:function(){var args=Array.prototype.slice.call(arguments);args.unshift(this.buttons),BI.each(this.behaviors,function(i,behavior){behavior.doBehavior.apply(behavior,args)})},prependItems:function(items){var o=this.options,btns=this._btnsCreator.apply(this,arguments);return this.buttons=BI.concat(btns,this.buttons),this._isSimpleLayout()&&this.layouts&&this.layouts.prependItems?void this.layouts.prependItems(btns):(items=this._packageItems(items,this._packageBtns(btns)),void this.layouts.prependItems(this._packageLayout(items).items))},addItems:function(items){var o=this.options,btns=this._btnsCreator.apply(this,arguments);return this.buttons=BI.concat(this.buttons,btns),this._isSimpleLayout()&&this.layouts&&this.layouts.addItems?void this.layouts.addItems(btns):(items=this._packageItems(items,this._packageBtns(btns)),void this.layouts.addItems(this._packageLayout(items).items))},removeItemAt:function(indexes){BI.removeAt(this.buttons,indexes),this.layouts.removeItemAt(indexes)},removeItems:function(values){values=BI.isArray(values)?values:[values];var deleted=[];BI.each(this.buttons,function(i,button){BI.deepContains(values,button.getValue())&&deleted.push(i)}),BI.removeAt(this.buttons,deleted),this.layouts.removeItemAt(deleted)},populate:function(items){items=items||[],this.empty(),this.options.items=items,this.buttons=this._btnsCreator.apply(this,arguments),items=this._isSimpleLayout()?this._packageSimpleItems(this.buttons):this._packageItems(items,this._packageBtns(this.buttons)),this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(items)))},setNotSelectedValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setSelected&&item.setSelected(!1):item.setSelected&&item.setSelected(!0)})},setEnabledValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setEnable(!0):item.setEnable(!1)})},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setSelected&&item.setSelected(!0):item.setSelected&&item.setSelected(!1)})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttons,function(i,item){!item.isEnabled()||item.isSelected&&item.isSelected()||v.push(item.getValue())}),v},getValue:function(){var v=[];return BI.each(this.buttons,function(i,item){item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue())}),v},getAllButtons:function(){return this.buttons},getAllLeaves:function(){return this.buttons},getSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){item.isSelected&&item.isSelected()&&btns.push(item)}),btns},getNotSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){item.isSelected&&!item.isSelected()&&btns.push(item)}),btns},getIndexByValue:function(value){var index=-1;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.getValue()===value)return index=i,!0}),index},getNodeById:function(id){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.options.id===id)return node=item,!0}),node},getNodeByValue:function(value){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.getValue()===value)return node=item,!0}),node},empty:function(){BI.ButtonGroup.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.ButtonGroup.superclass.destroy.apply(this,arguments),this.options.items=[]}}),BI.extend(BI.ButtonGroup,{CHOOSE_TYPE_SINGLE:BI.Selection.Single,CHOOSE_TYPE_MULTI:BI.Selection.Multi,CHOOSE_TYPE_ALL:BI.Selection.All,CHOOSE_TYPE_NONE:BI.Selection.None,CHOOSE_TYPE_DEFAULT:BI.Selection.Default}),BI.ButtonGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_group",BI.ButtonGroup),BI.ButtonTree=BI.inherit(BI.ButtonGroup,{_defaultConfig:function(){return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-tree"})},_init:function(){BI.ButtonTree.superclass._init.apply(this,arguments)},setNotSelectedValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setSelected)?void(BI.deepContains(v,item.getValue())?item.setSelected(!1):item.setSelected(!0)):void item.setNotSelectedValue(v)})},setEnabledValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setEnabledValue)?void item.setEnabledValue(v):void(BI.deepContains(v,item.getValue())?item.setEnable(!0):item.setEnable(!1))})},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setSelected)?void(BI.deepContains(v,item.getValue())?item.setSelected(!0):item.setSelected(!1)):void item.setValue(v)})},getNotSelectedValue:function(){ +var v=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(v=BI.concat(v,item.getNotSelectedValue())):void(item.isEnabled()&&item.isSelected&&!item.isSelected()&&v.push(item.getValue()))}),v},getValue:function(){var v=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(v=BI.concat(v,item.getValue())):void(item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue()))}),v},getSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(btns=btns.concat(item.getSelectedButtons())):void(item.isSelected&&item.isSelected()&&btns.push(item))}),btns},getNotSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(btns=btns.concat(item.getNotSelectedButtons())):void(item.isSelected&&!item.isSelected()&&btns.push(item))}),btns},getAllLeaves:function(){var leaves=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(leaves=leaves.concat(item.getAllLeaves())):void(item.isEnabled()&&leaves.push(item))}),leaves},getIndexByValue:function(value){var index=-1;return BI.any(this.buttons,function(i,item){var vs=item.getValue();if(item.isEnabled()&&(vs===value||BI.contains(vs,value)))return index=i,!0}),index},getNodeById:function(id){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()){if(item.attr("id")===id)return node=item,!0;if(BI.isFunction(item.getNodeById)&&(node=item.getNodeById(id)))return!0}}),node},getNodeByValue:function(value){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled())if(BI.isFunction(item.getNodeByValue)){if(node=item.getNodeByValue(value))return!0}else if(item.attr("value")===value)return node=item,!0}),node}}),BI.ButtonTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_tree",BI.ButtonTree),BI.TreeView=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-tree",paras:{selectedValues:{}},itemsCreator:BI.emptyFn})},_init:function(){BI.TreeView.superclass._init.apply(this,arguments);var o=this.options;this._stop=!1,this._createTree(),this.tip=BI.createWidget({type:"bi.loading_bar",invisible:!0,handler:BI.bind(this._loadMore,this)}),BI.createWidget({type:"bi.vertical",scrollable:!0,scrolly:!1,element:this,items:[this.tip]}),BI.isNotNull(o.value)&&this.setSelectedValue(o.value),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")},_createTree:function(){this.id="bi-tree"+BI.UUID(),this.nodes&&this.nodes.destroy(),this.tree&&this.tree.destroy(),this.tree=BI.createWidget({type:"bi.layout",element:"
    "}),BI.createWidget({type:"bi.default",element:this.element,items:[this.tree]})},_selectTreeNode:function(treeId,treeNode){this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,treeNode,this),this.fireEvent(BI.TreeView.EVENT_CHANGE,treeNode,this)},_configSetting:function(){function onClick(event,treeId,treeNode){var checked=treeNode.checked,status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(checked=!1),self.nodes.checkNode(treeNode,!checked,!0,!0)}function getUrl(treeId,treeNode){var parentNode=self._getParentValues(treeNode);treeNode.times=treeNode.times||1;var param="id="+treeNode.id+"×="+treeNode.times++ +"&parentValues= "+_global.encodeURIComponent(BI.jsonEncode(parentNode))+"&checkState="+_global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));return"&"+param}function beforeExpand(treeId,treeNode){return treeNode.isAjaxing?(BI.Msg.toast("Please Wait。","warning"),!1):(treeNode.children||(treeNode.times=1,ajaxGetNodes(treeNode,"refresh")),!0)}function onAsyncSuccess(event,treeId,treeNode,msg){if(treeNode.halfCheck=!1,msg&&0!==msg.length&&!/^[\s,\S]*<\/html>$/gi.test(msg)&&!self._stop){var zTree=self.nodes,totalCount=treeNode.count||0;treeNode.children.length>totalCount?(treeNode.count=treeNode.children.length,BI.delay(function(){ajaxGetNodes(treeNode)},perTime)):(zTree.updateNode(treeNode),zTree.selectNode(treeNode.children[0]))}}function onAsyncError(event,treeId,treeNode,XMLHttpRequest,textStatus,errorThrown){var zTree=self.nodes;BI.Msg.toast("Error!","warning")}function ajaxGetNodes(treeNode,reloadType){var zTree=self.nodes;"refresh"==reloadType&&zTree.updateNode(treeNode),zTree.reAsyncChildNodes(treeNode,reloadType,!0)}function beforeCheck(treeId,treeNode){function track(children){BI.each(children,function(i,ch){ch.halfCheck===!0&&(ch.halfCheck=!1,track(ch.children))})}if(treeNode.halfCheck=!1,treeNode.checked===!0){track(treeNode.children);var treeObj=self.nodes,nodes=treeObj.getSelectedNodes();BI.$.each(nodes,function(index,node){node.halfCheck=!1})}var status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(treeNode.checked=!1)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}function onExpand(event,treeId,treeNode){treeNode.halfCheck=!1}function onCollapse(event,treeId,treeNode){}var paras=this.options.paras,self=this,setting={async:{enable:!0,url:getUrl,autoParam:["id","name"],otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeExpand:beforeExpand,onAsyncSuccess:onAsyncSuccess,onAsyncError:onAsyncError,beforeCheck:beforeCheck,onCheck:onCheck,onExpand:onExpand,onCollapse:onCollapse,onClick:onClick}},className="dark",perTime=100;return setting},_getParentValues:function(treeNode){if(!treeNode.getParentNode())return[];var parentNode=treeNode.getParentNode(),result=this._getParentValues(parentNode);return result=result.concat([this._getNodeValue(parentNode)])},_getNodeValue:function(node){return null==node.value?BI.replaceAll(node.text.replace(/<[^>]+>/g,"")," "," "):node.value},_getHalfSelectedValues:function(map,node){var self=this,checkState=node.getCheckStatus();if(checkState.checked!==!1||checkState.half!==!1){if(BI.isNotEmptyArray(node.children)&&checkState.half===!0){var children=node.children;return void BI.each(children,function(i,ch){self._getHalfSelectedValues(map,ch)})}var parent=node.parentValues||self._getParentValues(node),path=parent.concat(this._getNodeValue(node));if(BI.isNotEmptyArray(node.children)||checkState.half===!1)return void this._buildTree(map,path);var storeValues=BI.deepClone(this.options.paras.selectedValues),treeNode=this._getTree(storeValues,path);this._addTreeNode(map,parent,this._getNodeValue(node),treeNode)}},_getTree:function(map,values){var cur=map;return BI.any(values,function(i,value){return null==cur[value]||void(cur=cur[value])}),cur},_addTreeNode:function(map,values,key,value){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]}),cur[key]=value},_buildTree:function(map,values){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]})},_getSelectedValues:function(){function track(nodes){BI.each(nodes,function(i,node){var checkState=node.getCheckStatus();if(checkState.checked===!0||checkState.half===!0)if(checkState.half===!0)self._getHalfSelectedValues(hashMap,node);else{var parentValues=node.parentValues||self._getParentValues(node),values=parentValues.concat([self._getNodeValue(node)]);self._buildTree(hashMap,values)}})}var self=this,hashMap={},rootNoots=this.nodes.getNodes();return track(rootNoots),hashMap},_dealWidthNodes:function(nodes){var self=this,o=this.options,ns=BI.Tree.arrayFormat(nodes);return BI.each(ns,function(i,n){n.title=n.title||n.text||n.value,n.isParent=n.isParent||n.parent,BI.isKey(o.paras.keyword)?n.text=BI.$("
    ").__textKeywordMarked__(n.text,o.paras.keyword,n.py).html():n.text=BI.htmlEncode(n.text+"")}),nodes},_loadMore:function(){var self=this,o=this.options;this.tip.setLoading();var op=BI.extend({},o.paras,{times:++this.times});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes))}})},_initTree:function(setting){var self=this,o=this.options;self.fireEvent(BI.Events.INIT),this.times=1;var tree=this.tree;tree.empty(),this.loading(),this.tip.setVisible(!1);var callback=function(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))},op=BI.extend({},o.paras,{times:1});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes)),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),1===op.times&&self.fireEvent(BI.Events.AFTERINIT)}})},initTree:function(nodes,setting){var setting=setting||{async:{enable:!1},check:{enable:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0},callback:{}};this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},start:function(){this._stop=!1},stop:function(){this._stop=!0},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._createTree(),this.start(),this._initTree(setting)},populate:function(){this.stroke.apply(this,arguments)},hasChecked:function(){var treeObj=this.nodes;return treeObj.getCheckedNodes(!0).length>0},checkAll:function(checked){function setNode(children){BI.each(children,function(i,child){child.halfCheck=!1,setNode(child.children)})}this.nodes&&(BI.each(this.nodes.getNodes(),function(i,node){node.halfCheck=!1,setNode(node.children)}),this.nodes.checkAllNodes(checked))},expandAll:function(flag){this.nodes&&this.nodes.expandAll(flag)},setValue:function(value,param){this.checkAll(!1),this.updateValue(value,param),this.refresh()},setSelectedValue:function(value){this.options.paras.selectedValues=BI.deepClone(value||{})},updateValue:function(values,param){if(this.nodes){param||(param="value");var treeObj=this.nodes;BI.each(values,function(v,op){var nodes=treeObj.getNodesByParam(param,v,null);BI.each(nodes,function(j,node){BI.extend(node,{checked:!0},op),treeObj.updateNode(node)})})}},refresh:function(){this.nodes&&this.nodes.refresh()},getValue:function(){return this.nodes?this._getSelectedValues():null},destroyed:function(){this.stop(),this.nodes&&this.nodes.destroy()}}),BI.extend(BI.TreeView,{REQ_TYPE_INIT_DATA:1,REQ_TYPE_ADJUST_DATA:2,REQ_TYPE_SELECT_DATA:3,REQ_TYPE_GET_SELECTED_DATA:4}),BI.TreeView.EVENT_CHANGE="EVENT_CHANGE",BI.TreeView.EVENT_INIT=BI.Events.INIT,BI.TreeView.EVENT_AFTERINIT=BI.Events.AFTERINIT,BI.shortcut("bi.tree_view",BI.TreeView),BI.AsyncTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.AsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked,status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(checked=!1),zTree.checkNode(treeNode,!checked,!0,!0)}function beforeCheck(treeId,treeNode){function track(children){BI.each(children,function(i,ch){ch.halfCheck===!0&&(ch.halfCheck=!1,track(ch.children))})}if(treeNode.halfCheck=!1,treeNode.checked===!0){track(treeNode.children);var treeObj=BI.$.fn.zTree.getZTreeObj(treeId),nodes=treeObj.getSelectedNodes();BI.each(nodes,function(index,node){node.halfCheck=!1})}var status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(treeNode.checked=!1)}function beforeExpand(treeId,treeNode){self._beforeExpandNode(treeId,treeNode)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}function onExpand(event,treeId,treeNode){treeNode.halfCheck=!1}function onCollapse(event,treeId,treeNode){treeNode.halfCheck=!1}var paras=this.options.paras,self=this,setting={async:{enable:!1,otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeCheck:beforeCheck,onCheck:onCheck,beforeExpand:beforeExpand,onExpand:onExpand,onCollapse:onCollapse,onClick:onClick}};return setting},_selectTreeNode:function(treeId,treeNode){var self=this,o=this.options,parentValues=BI.deepClone(treeNode.parentValues||self._getParentValues(treeNode)),name=this._getNodeValue(treeNode);if(treeNode.checked===!0);else{var tNode=treeNode,pNode=this._getTree(this.options.paras.selectedValues,parentValues);for(BI.isNotNull(pNode[name])&&delete pNode[name];null!=tNode&&BI.isEmpty(pNode);)parentValues=parentValues.slice(0,parentValues.length-1),tNode=tNode.getParentNode(),null!=tNode&&(pNode=this._getTree(this.options.paras.selectedValues,parentValues),name=this._getNodeValue(tNode),delete pNode[name])}BI.AsyncTree.superclass._selectTreeNode.apply(self,arguments)},_beforeExpandNode:function(treeId,treeNode){function callback(nodes,hasNext){self.nodes.addNodes(treeNode,nodes),hasNext===!0&&BI.delay(function(){times++,op.times=times,o.itemsCreator(op,complete)},100)}var self=this,o=this.options,parentValues=treeNode.parentValues||self._getParentValues(treeNode),op=BI.extend({},o.paras,{id:treeNode.id,times:1,parentValues:parentValues.concat(this._getNodeValue(treeNode)),checkState:treeNode.getCheckStatus()}),complete=function(d){var nodes=d.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes),!!d.hasNext)},times=1;treeNode.children||setTimeout(function(){o.itemsCreator(op,complete)},17)},_join:function(valueA,valueB){function track(parent,node,compare){BI.each(node,function(n,item){BI.isNull(compare[n])?self._addTreeNode(map,parent,n,item):BI.isEmpty(compare[n])?self._addTreeNode(map,parent,n,{}):track(parent.concat([n]),node[n],compare[n])})}var self=this,map={};return track([],valueA,valueB),track([],valueB,valueA),map},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.AsyncTree.superclass.hasChecked.apply(this,arguments)},_getJoinValue:function(){if(!this.nodes)return{};var checkedValues=this._getSelectedValues();return BI.isEmpty(checkedValues)?BI.deepClone(this.options.paras.selectedValues):BI.isEmpty(this.options.paras.selectedValues)?checkedValues:this._join(checkedValues,this.options.paras.selectedValues)},getValue:function(){return this._getJoinValue()},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._initTree(setting)}}),BI.shortcut("bi.async_tree",BI.AsyncTree),BI.PartTree=BI.inherit(BI.AsyncTree,{_defaultConfig:function(){return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.PartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var self=this,o=this.options,op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),o.itemsCreator(op,function(d){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,self._stop!==!0&&(hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes)))})},_selectTreeNode:function(treeId,treeNode){var self=this,o=this.options,parentValues=BI.deepClone(treeNode.parentValues||self._getParentValues(treeNode)),name=this._getNodeValue(treeNode);if(treeNode.checked===!0)this.options.paras.selectedValues=this._getJoinValue(),o.itemsCreator(BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_ADJUST_DATA,curSelectedValue:name,parentValues:parentValues}),function(res){self.options.paras.selectedValues=res,BI.AsyncTree.superclass._selectTreeNode.apply(self,arguments)});else{for(var t=this.options.paras.selectedValues,p=parentValues.concat(name),i=0,len=p.length;i0?self._dealWidthNodes(nodes):[]),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),self.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){o.itemsCreator(op,complete)},100)},getValue:function(){return BI.deepClone(this.options.paras.selectedValues||{})},stroke:function(config){var o=this.options;delete o.paras.keyword,BI.extend(o.paras,config),delete o.paras.lastSearchValue;var setting=this._configSetting();this._initTree(setting,o.paras.keyword)}}),BI.shortcut("bi.part_tree",BI.PartTree),BI.ListTreeView=BI.inherit(BI.TreeView,{_constants:{SPLIT:"<|>"},_defaultConfig:function(){return BI.extend(BI.ListTreeView.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListTreeView.superclass._init.apply(this,arguments);var o=this.options;this.storeValue=o.value||{}},_configSetting:function(){function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked;self._checkValue(treeNode,!checked),zTree.checkNode(treeNode,!checked,!0,!0)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}var paras=this.options.paras,self=this,setting={async:{enable:!1},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:onCheck,onClick:onClick}};return setting},_selectTreeNode:function(treeId,treeNode){this._checkValue(treeNode,treeNode.checked),BI.ListTreeView.superclass._selectTreeNode.apply(this,arguments)},_transArrayToMap:function(treeArrays){var self=this,map={};return BI.each(treeArrays,function(idx,array){var key=array.join(self._constants.SPLIT);map[key]=!0}),map},_transMapToArray:function(treeMap){var self=this,array=[];return BI.each(treeMap,function(key){var item=key.split(self._constants.SPLIT);array.push(item)}),array},_checkValue:function(treeNode,checked){var key=BI.concat(this._getParentValues(treeNode),this._getNodeValue(treeNode)).join(this._constants.SPLIT);checked?this.storeValue[key]=!0:delete this.storeValue[key]},setSelectedValue:function(value){this.options.paras.selectedValues=value||[],this.storeValue=this._transArrayToMap(value)},getValue:function(){return this._transMapToArray(this.storeValue)}}),BI.shortcut("bi.list_tree_view",BI.ListTreeView),BI.ListAsyncTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListAsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListAsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCheck(treeId,treeNode){treeNode.half=!1}function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked;self._checkValue(treeNode,!checked),zTree.checkNode(treeNode,!checked,!0,!0)}function beforeExpand(treeId,treeNode){self._beforeExpandNode(treeId,treeNode)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}var paras=this.options.paras,self=this,setting={async:{enable:!1,otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:onCheck,beforeExpand:beforeExpand,beforeCheck:beforeCheck,onClick:onClick}};return setting},_beforeExpandNode:function(treeId,treeNode){function callback(nodes,hasNext){self.nodes.addNodes(treeNode,nodes),hasNext===!0&&BI.delay(function(){times++,op.times=times,o.itemsCreator(op,complete)},100)}var self=this,o=this.options,parentValues=treeNode.parentValues||self._getParentValues(treeNode),op=BI.extend({},o.paras,{id:treeNode.id,times:1,parentValues:parentValues.concat(this._getNodeValue(treeNode))}),complete=function(d){var nodes=d.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes),!!d.hasNext)},times=1;treeNode.children||setTimeout(function(){o.itemsCreator(op,complete)},17)},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.ListAsyncTree.superclass.hasChecked.apply(this,arguments)},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._initTree(setting)}}),BI.shortcut("bi.list_async_tree",BI.ListAsyncTree),BI.ListPartTree=BI.inherit(BI.ListAsyncTree,{_defaultConfig:function(){return BI.extend(BI.ListPartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListPartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var self=this,o=this.options,op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),o.itemsCreator(op,function(d){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,self._stop!==!0&&(hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes)))})},_initTree:function(setting,keyword){function callback(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))}var self=this,o=this.options;this.times=1;var tree=this.tree;tree.empty(),self.tip.setVisible(!1),this.loading();var op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:this.times}),complete=function(d){if(self._stop!==!0&&keyword==o.paras.keyword){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,callback(nodes.length>0?self._dealWidthNodes(nodes):[]),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),self.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){o.itemsCreator(op,complete)},100)},stroke:function(config){var o=this.options;delete o.paras.keyword,BI.extend(o.paras,config),delete o.paras.lastSearchValue;var setting=this._configSetting();this._initTree(setting,o.paras.keyword)}}),BI.shortcut("bi.list_part_tree",BI.ListPartTree),BI.prepares.push(function(){BI.Resizers=new BI.ResizeController,BI.Layers=new BI.LayerController,BI.Maskers=new BI.MaskersController,BI.Bubbles=new BI.BubblesController,BI.Tooltips=new BI.TooltipsController,BI.Popovers=new BI.PopoverController,BI.Broadcasts=new BI.BroadcastController,BI.StyleLoaders=new BI.StyleLoaderManager}),BI.CollectionView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CollectionView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-collection",overflowX:!0,overflowY:!0,cellSizeAndPositionGetter:BI.emptyFn,horizontalOverscanSize:0,verticalOverscanSize:0,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.CollectionView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){self._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){self._scrollLock!==!0&&(o.scrollLeft=self.element.scrollLeft(),o.scrollTop=self.element.scrollTop(),self._calculateChildrenToRender(),self.fireEvent(BI.CollectionView.EVENT_SCROLL,{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:o.overflowX===!0&&o.overflowY===!0,scrolly:o.overflowX===!1&&o.overflowY===!0,scrollx:o.overflowX===!0&&o.overflowY===!1,items:[this.container]}),o.items.length>0&&(this._calculateSizeAndPositionData(),this._populate())},mounted:function(){var o=this.options;0===o.scrollLeft&&0===o.scrollTop||(this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft))},_calculateSizeAndPositionData:function(){for(var o=this.options,cellMetadata=[],sectionManager=new BI.SectionManager,height=0,width=0,index=0,len=o.items.length;index0&&bottom>0){if(top>=this.renderRange.minY&&bottom<=this.renderRange.maxY&&left>=this.renderRange.minX&&right<=this.renderRange.maxX)return;for(var childrenToDisplay=this._cellRenderers(bottom-top,right-left,left,top),renderedCells=[],renderedKeys={},renderedWidgets={},lefts={},tops={},i=0,len=childrenToDisplay.length;i=0?(datum.width!==this.renderedCells[index]._width&&(this.renderedCells[index]._width=datum.width,this.renderedCells[index].el.setWidth(datum.width)),datum.height!==this.renderedCells[index]._height&&(this.renderedCells[index]._height=datum.height,this.renderedCells[index].el.setHeight(datum.height)),this.renderedCells[index]._left!==datum.x&&this.renderedCells[index].el.element.css("left",datum.x+"px"),this.renderedCells[index]._top!==datum.y&&this.renderedCells[index].el.element.css("top",datum.y+"px"),renderedCells.push(child=this.renderedCells[index])):(child=BI.createWidget(BI.extend({type:"bi.label",width:datum.width,height:datum.height},o.items[datum.index],{cls:(o.items[datum.index].cls||"")+" container-cell"+(0===datum.y?" first-row":"")+(0===datum.x?" first-col":""),_left:datum.x,_top:datum.y})),renderedCells.push({el:child,left:datum.x,top:datum.y,_left:datum.x,_top:datum.y,_width:datum.width,_height:datum.height}));for(var startTopIndex=0|topMap[datum.y],endTopIndex=0|topMap[datum.y+datum.height],k=startTopIndex;k<=endTopIndex;k++){var t=tops[k];assertMinBorder(leftBorder,t),assertMaxBorder(rightBorder,t),leftBorder[t]=Math.min(leftBorder[t],datum.x),rightBorder[t]=Math.max(rightBorder[t],datum.x+datum.width)}for(var startLeftIndex=0|leftMap[datum.x],endLeftIndex=0|leftMap[datum.x+datum.width],k=startLeftIndex;k<=endLeftIndex;k++){var l=lefts[k];assertMinBorder(topBorder,l),assertMaxBorder(bottomBorder,l),topBorder[l]=Math.min(topBorder[l],datum.y),bottomBorder[l]=Math.max(bottomBorder[l],datum.y+datum.height)}renderedKeys[datum.index]=[datum.index,i],renderedWidgets[i]=child}var existSet={},addSet={},deleteArray=[];BI.each(renderedKeys,function(i,key){self.renderedKeys[i]?existSet[i]=key:addSet[i]=key}),BI.each(this.renderedKeys,function(i,key){existSet[i]||addSet[i]||deleteArray.push(key[1])}),BI.each(deleteArray,function(i,index){self.renderedCells[index].el._destroy()});var addedItems=[];BI.each(addSet,function(index,key){addedItems.push(renderedCells[key[1]])}),this.container.addItems(addedItems),this.container._children=renderedWidgets,this.container.attr("items",renderedCells),this.renderedCells=renderedCells,this.renderedKeys=renderedKeys;var minX=BI.min(leftBorder),maxX=BI.max(rightBorder),minY=BI.max(topBorder),maxY=BI.min(bottomBorder);this.renderRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY}}},_getMaxScrollLeft:function(){return Math.max(0,this._width-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._height-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(items){var o=this.options;if(this._reRange(),items&&items!==this.options.items&&(this.options.items=items,this._calculateSizeAndPositionData()),o.items.length>0){this.container.setWidth(this._width),this.container.setHeight(this._height),this._calculateChildrenToRender();try{this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft)}catch(e){}}},setScrollLeft:function(scrollLeft){this.options.scrollLeft!==scrollLeft&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(scrollLeft||0,0,this._getMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(scrollTop){this.options.scrollTop!==scrollTop&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(scrollTop||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setOverflowX:function(b){var self=this;this.options.overflowX!==!!b&&(this.options.overflowX=!!b,BI.nextTick(function(){self.element.css({overflowX:b?"auto":"hidden"})}))},setOverflowY:function(b){var self=this;this.options.overflowY!==!!b&&(this.options.overflowY=!!b,BI.nextTick(function(){self.element.css({overflowY:b?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(i,cell){cell.el._destroy()}),this._clearChildren(), +this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(items){items&&items!==this.options.items&&this.restore(),this._populate(items)}}),BI.CollectionView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.collection_view",BI.CollectionView),BI.Combo=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Combo.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-combo",trigger:"click",toggle:!0,direction:"bottom",logic:{dynamic:!0},container:null,isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopEvent:!1,stopPropagation:!1,adjustLength:0,adjustXOffset:0,adjustYOffset:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{},comboClass:"bi-combo-popup",hoverClass:"bi-combo-hover"})},_init:function(){BI.Combo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._initCombo(),this._initPullDownAction(),this.combo.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Combo.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Combo.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE,obj))}),self.element.on("mouseenter."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&self.element.addClass(o.hoverClass)}),self.element.on("mouseleave."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&self.element.removeClass(o.hoverClass)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(o.logic,{items:[{el:this.combo}]})))),o.isDefaultInit&&this._assertPopupView(),BI.Resizers.add(this.getName(),BI.bind(function(){this.isViewVisible()&&this._hideView()},this))},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){function hide(){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&o.toggle===!0&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.combo),self.fireEvent(BI.Combo.EVENT_COLLAPSE)),self.popupView&&self.popupView.element.off("mouseenter."+self.getName()).off("mouseleave."+self.getName()),enterPopup=!1}var self=this,o=this.options,evs=(this.options.trigger||"").split(","),st=function(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()},enterPopup=!1;BI.each(evs,function(i,ev){switch(ev){case"hover":self.element.on("mouseenter."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND))}),self.element.on("mouseleave."+self.getName(),function(e){self.popupView&&(self.popupView.element.on("mouseenter."+self.getName(),function(e){enterPopup=!0,self.popupView.element.on("mouseleave."+self.getName(),function(e){hide()}),self.popupView.element.off("mouseenter."+self.getName())}),BI.defer(function(){enterPopup||hide()},50))});break;case"click":var debounce=BI.debounce(function(e){self.combo.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(o.toggle?self._toggle():self._popupView(),self.isViewVisible()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.combo),self.fireEvent(BI.Combo.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});self.element.off(ev+"."+self.getName()).on(ev+"."+self.getName(),function(e){debounce(e),st(e)});break;case"click-hover":var debounce=BI.debounce(function(e){self.combo.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(self._popupView(),self.isViewVisible()&&(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});self.element.off("click."+self.getName()).on("click."+self.getName(),function(e){debounce(e),st(e)}),self.element.on("mouseleave."+self.getName(),function(e){self.popupView&&(self.popupView.element.on("mouseenter."+self.getName(),function(e){enterPopup=!0,self.popupView.element.on("mouseleave."+self.getName(),function(e){hide()}),self.popupView.element.off("mouseenter."+self.getName())}),BI.defer(function(){enterPopup||hide()},50))})}})},_initCombo:function(){this.combo=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.popup_view",value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&(self.combo.setValue(self.getValue()),self.fireEvent(BI.Combo.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popupView.setVisible(!1),BI.nextTick(function(){self.fireEvent(BI.Combo.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this.options.container||this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideIf:function(e){if(this.element.find(e.target).length>0||this.popupView&&this.popupView.element.find(e.target).length>0||"CodeMirror-cursor"===e.target.className||BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length>0){var directions=this.options.direction.split(",");return void((BI.contains(directions,"innerLeft")||BI.contains(directions,"innerRight"))&&(this.adjustWidth(),this.adjustHeight()))}var isHide=this.options.hideChecker.apply(this,[e]);isHide!==!1&&this._hideView()},_hideView:function(){this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW),this.options.destroyWhenHide===!0?(this.popupView&&this.popupView.destroy(),this.popupView=null,this._rendered=!1):this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW)},_popupView:function(e){this._assertPopupViewRender(),this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW),this.popupView.visible(),this.adjustWidth(e),this.adjustHeight(e),this.element.addClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),BI.Widget._renderEngine.createElement(document).bind("mousedown."+this.getName(),BI.bind(this._hideIf,this)).bind("mousewheel."+this.getName(),BI.bind(this._hideIf,this)),this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW)},adjustWidth:function(e){var o=this.options;if(this.popupView&&o.isNeedAdjustWidth===!0){this.resetListWidth("");var width=this.popupView.element.outerWidth(),maxW=this.element.outerWidth()||o.width;width>maxW+80?maxW+=80:width>maxW&&(maxW=width),this.resetListWidth(maxW<100?100:maxW)}},adjustHeight:function(e){var o=this.options,p={};if(this.popupView){var isVisible=this.popupView.isVisible();this.popupView.visible();var combo=BI.isNotNull(e)?{element:{offset:function(){return{left:e.pageX,top:e.pageY}},bounds:function(){return{x:e.offsetX,y:e.offsetY,width:0,height:24}},outerWidth:function(){return 0},outerHeight:function(){return 24}}}:this.combo;switch(o.direction){case"bottom":case"bottom,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","right","left"],o.offsetStyle);break;case"top":case"top,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","right","left"],o.offsetStyle);break;case"left":case"left,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","bottom","top"],o.offsetStyle);break;case"right":case"right,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","bottom","top"],o.offsetStyle);break;case"top,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","left","right"],o.offsetStyle);break;case"bottom,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","left","right"],o.offsetStyle);break;case"left,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","top","bottom"],o.offsetStyle);break;case"right,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","top","bottom"],o.offsetStyle);break;case"right,innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerRight","innerLeft","bottom","top"],o.offsetStyle);break;case"right,innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerLeft","innerRight","bottom","top"],o.offsetStyle);break;case"innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerRight","innerLeft","right","left","bottom","top"],o.offsetStyle);break;case"innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerLeft","innerRight","left","right","bottom","top"],o.offsetStyle);break;case"top,custom":case"custom,top":p=BI.DOM.getTopAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"custom,bottom":case"bottom,custom":p=BI.DOM.getBottomAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"left,custom":case"custom,left":p=BI.DOM.getLeftAdaptPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength),delete p.top,delete p.adaptHeight;break;case"custom,right":case"right,custom":p=BI.DOM.getRightAdaptPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength),delete p.top,delete p.adaptHeight}"adaptHeight"in p&&this.resetListHeight(p.adaptHeight),"left"in p&&this.popupView.element.css({left:p.left}),"top"in p&&this.popupView.element.css({top:p.top}),this.position=p,this.popupView.setVisible(isVisible)}},resetListHeight:function(h){this._assertPopupView(),this.popupView.resetHeight&&this.popupView.resetHeight(h)},resetListWidth:function(w){this._assertPopupView(),this.popupView.resetWidth&&this.popupView.resetWidth(w)},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.combo.populate.apply(this.combo,arguments)},_setEnable:function(arg){BI.Combo.superclass._setEnable.apply(this,arguments),arg===!0?this.element.removeClass("base-disabled disabled"):arg===!1&&this.element.addClass("base-disabled disabled"),!arg&&this.element.removeClass(this.options.hoverClass),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.combo.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.combo.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},showView:function(e){this.isEnabled()&&this.combo.isEnabled()&&!this.isViewVisible()&&this._popupView(e)},hideView:function(){this._hideView()},getView:function(){return this.popupView},getPopupPosition:function(){return this.position},toggle:function(){this._toggle()},destroyed:function(){BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()).unbind("mouseenter."+this.getName()).unbind("mousemove."+this.getName()).unbind("mouseleave."+this.getName()),BI.Resizers.remove(this.getName())}}),BI.Combo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Combo.EVENT_CHANGE="EVENT_CHANGE",BI.Combo.EVENT_EXPAND="EVENT_EXPAND",BI.Combo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Combo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Combo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Combo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Combo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Combo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.combo",BI.Combo),BI.Expander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Expander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-expander",trigger:"click",toggle:!0,isDefaultInit:!1,el:{},popup:{},expanderClass:"bi-expander-popup",hoverClass:"bi-expander-hover"})},_init:function(){BI.Expander.superclass._init.apply(this,arguments);var self=this,o=this.options;this._expanded=!!o.el.open,this._initExpander(),this._initPullDownAction(),this.expander.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Expander.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Expander.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE,value,obj))}),this.element.hover(function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&self.element.addClass(o.hoverClass)},function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&self.element.removeClass(o.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.expander}]}),o.isDefaultInit&&this._assertPopupView(),this.expander.isOpened()===!0&&this._popupView()},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var self=this,o=this.options,evs=this.options.trigger.split(",");BI.each(evs,function(i,e){switch(e){case"hover":self.element[e](function(e){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.expander),self.fireEvent(BI.Expander.EVENT_EXPAND))},function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&o.toggle&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.expander),self.fireEvent(BI.Expander.EVENT_COLLAPSE))});break;case"click":e&&self.element.off(e+"."+self.getName()).on(e+"."+self.getName(),BI.debounce(function(e){self.expander.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.expander),self.fireEvent(BI.Expander.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.expander),self.fireEvent(BI.Expander.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initExpander:function(){this.expander=BI.createWidget(this.options.el)},_assertPopupView:function(){var self=this,o=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.button_group",cls:"expander-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Expander.EVENT_CHANGE,value,obj)}),this.popupView.setVisible(this.isExpanded()),BI.nextTick(function(){self.fireEvent(BI.Expander.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideView:function(){this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW),this._expanded=!1,this.expander.setOpened(!1),this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW)},_popupView:function(){this._assertPopupViewRender(),this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW),this._expanded=!0,this.expander.setOpened(!0),this.popupView.visible(),this.element.addClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW)},populate:function(items){this.popupView&&this.popupView.populate.apply(this.popupView,arguments),this.expander.populate.apply(this.expander,arguments)},_setEnable:function(arg){BI.Expander.superclass._setEnable.apply(this,arguments),!arg&&this.element.removeClass(this.options.hoverClass),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.expander.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.expander.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},isExpanded:function(){return this._expanded},showView:function(){this.isEnabled()&&this.expander.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.expander.options.id===id?this.expander:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.expander.getValue()===value?this.expander:this.popupView&&this.popupView.getNodeByValue(value)},destroy:function(){BI.Expander.superclass.destroy.apply(this,arguments)}}),BI.Expander.EVENT_EXPAND="EVENT_EXPAND",BI.Expander.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Expander.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Expander.EVENT_CHANGE="EVENT_CHANGE",BI.Expander.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Expander.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Expander.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Expander.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Expander.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.expander",BI.Expander),BI.ComboGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-combo-group bi-list-item",trigger:"click,hover",direction:"right",adjustLength:0,isDefaultInit:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.text_button",text:"",value:""},children:[],popup:{el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}}})},_init:function(){BI.ComboGroup.superclass._init.apply(this,arguments),this._populate(this.options.el)},_populate:function(item){var self=this,o=this.options,children=o.children;if(BI.isEmpty(children))throw new Error("ComboGroup构造错误");BI.each(children,function(i,ch){var son=BI.formatEL(ch).el.children;ch=BI.formatEL(ch).el,BI.isEmpty(son)||(ch.el=BI.clone(ch),ch.children=son,ch.type="bi.combo_group",ch.action=o.action,ch.height=o.height,ch.direction=o.direction,ch.isDefaultInit=o.isDefaultInit,ch.isNeedAdjustHeight=o.isNeedAdjustHeight,ch.isNeedAdjustWidth=o.isNeedAdjustWidth,ch.adjustLength=o.adjustLength,ch.popup=o.popup)}),this.combo=BI.createWidget({type:"bi.combo",element:this,container:o.container,height:o.height,trigger:o.trigger,direction:o.direction,isDefaultInit:o.isDefaultInit,isNeedAdjustWidth:o.isNeedAdjustWidth,isNeedAdjustHeight:o.isNeedAdjustHeight,adjustLength:o.adjustLength,el:item,popup:BI.extend({},o.popup,{el:BI.extend({items:children},o.popup.el)})}),this.combo.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.ComboGroup.EVENT_CHANGE,obj)})},getValue:function(){return this.combo.getValue()},setValue:function(v){this.combo.setValue(v)}}),BI.ComboGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.combo_group",BI.ComboGroup),BI.VirtualGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.VirtualGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-virtual-group",items:[],layouts:[{type:"bi.center",hgap:0,vgap:0}]})},render:function(){var o=this.options;this.populate(o.items),BI.isKey(o.value)&&this.setValue(o.value)},_packageBtns:function(items){for(var o=this.options,map=this.buttonMap={},i=o.layouts.length-1;i>0;i--)items=BI.map(items,function(k,it){var el=BI.stripEL(it);return BI.extend({},o.layouts[i],{items:[BI.extend({},o.layouts[i].el,{el:BI.extend({ref:function(_ref){BI.isKey(map[el.value])&&(map[el.value]=_ref)}},el)})]})});return items},_packageLayout:function(items){for(var o=this.options,layout=BI.deepClone(o.layouts[0]),lay=BI.formatEL(layout).el;lay&&lay.items&&!BI.isEmpty(lay.items);)lay=BI.formatEL(lay.items[0]).el;return lay.items=items,layout},addItems:function(items){this.layouts.addItems(items)},prependItems:function(items){this.layouts.prependItems(items)},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttonMap,function(key,item){item&&(v.deepContains(key)?item.setSelected&&item.setSelected(!0):item.setSelected&&item.setSelected(!1))})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttonMap,function(i,item){item&&(!item.isEnabled()||item.isSelected&&item.isSelected()||v.push(item.getValue()))}),v},getValue:function(){var v=[];return BI.each(this.buttonMap,function(i,item){item&&item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue())}),v},populate:function(items){var self=this;items=items||[],this.options.items=items,items=this._packageBtns(items),this.layouts?this.layouts.populate(items):this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(items)))}}),BI.VirtualGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.virtual_group",BI.VirtualGroup),BI.Loader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Loader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-loader",direction:"top",isDefaultInit:!0,logic:{dynamic:!0,scrolly:!0},el:{type:"bi.button_group"},items:[],itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn,count:!1,prev:!1,next:{},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_prevLoad:function(){var self=this,o=this.options;this.prev.setLoading(),o.itemsCreator.apply(this,[{times:--this.times},function(){self.prev.setLoaded(),self.prependItems.apply(self,arguments)}])},_nextLoad:function(){var self=this,o=this.options;this.next.setLoading(),o.itemsCreator.apply(this,[{times:++this.times},function(){self.next.setLoaded(),self.addItems.apply(self,arguments)}])},_init:function(){BI.Loader.superclass._init.apply(this,arguments);var self=this,o=this.options;o.itemsCreator===!1&&(o.prev=!1,o.next=!1),o.prev!==!1&&(this.prev=BI.createWidget(BI.extend({type:"bi.loading_bar"},o.prev)),this.prev.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self._prevLoad()})),this.button_group=BI.createWidget(o.el,{type:"bi.button_group",chooseType:0,items:o.items,behaviors:{},layouts:[{type:"bi.vertical"}],value:o.value}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Loader.EVENT_CHANGE,obj)}),o.next!==!1&&(this.next=BI.createWidget(BI.extend({type:"bi.loading_bar"},o.next)),this.next.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self._nextLoad()})),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.prev,this.button_group,this.next)})))),o.isDefaultInit&&BI.isEmpty(o.items)&&BI.nextTick(BI.bind(function(){o.isDefaultInit&&BI.isEmpty(o.items)&&this._populate()},this)),BI.isNotEmptyArray(o.items)&&this._populate(o.items)},hasPrev:function(){var o=this.options;return BI.isNumber(o.count)?this.count0&&args.push(keyword),BI.Maskers.show(self.getName()),self.popupView.populate.apply(self.popupView,args),o.isAutoSync&&o.adapter&&o.adapter.getValue&&self.popupView.setValue(o.adapter.getValue()),self.popupView.loaded&&self.popupView.loaded(),self.fireEvent(BI.Searcher.EVENT_SEARCHING)}})}},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},doSearch:function(){this.isSearching()&&this._search()},stopSearch:function(){this._stopSearch();try{this.editor.blur()}catch(e){if(!this.editor.blur)throw new Error("editor没有实现blur方法")}finally{this.editor.setValue("")}},isSearching:function(){return this._isSearching},isViewVisible:function(){return this.editor.isEnabled()&&BI.Maskers.isVisible(this.getName())},getView:function(){return this.popupView},hasMatched:function(){return this._assertPopupView(),this.popupView.hasMatched()},adjustHeight:function(){BI.Maskers.has(this.getName())&&BI.Maskers.get(this.getName()).isVisible()&&BI.Maskers.show(this.getName())},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},setValue:function(v){BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getKeyword:function(){return this.editor.getValue()},getKeywords:function(){return this.editor.getKeywords()},getValue:function(){var o=this.options;return o.isAutoSync&&o.adapter&&o.adapter.getValue?o.adapter.getValue():this.isSearching()?this.popupView.getValue():o.adapter&&o.adapter.getValue?o.adapter.getValue():BI.isNull(this.popupView)?o.popup.value:this.popupView.getValue()},populate:function(result,searchResult,keyword){var o=this.options;this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),o.isAutoSync&&o.adapter&&o.adapter.getValue&&this.popupView.setValue(o.adapter.getValue())},empty:function(){this.popupView&&this.popupView.empty()},destroyed:function(){BI.Maskers.remove(this.getName())}}),BI.Searcher.EVENT_CHANGE="EVENT_CHANGE",BI.Searcher.EVENT_START="EVENT_START",BI.Searcher.EVENT_STOP="EVENT_STOP",BI.Searcher.EVENT_PAUSE="EVENT_PAUSE",BI.Searcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.Searcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.shortcut("bi.searcher",BI.Searcher),BI.Switcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Switcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-switcher",direction:BI.Direction.Top,trigger:"click",toggle:!0,el:{},popup:{},adapter:null,masker:{},switcherClass:"bi-switcher-popup",hoverClass:"bi-switcher-hover"})},_init:function(){BI.Switcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this._initSwitcher(),this._initPullDownAction(),this.switcher.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Switcher.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Switcher.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_TRIGGER_CHANGE,value,obj))}),this.element.hover(function(){self.isEnabled()&&self.switcher.isEnabled()&&self.element.addClass(o.hoverClass)},function(){self.isEnabled()&&self.switcher.isEnabled()&&self.element.removeClass(o.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.switcher}]}),o.isDefaultInit&&this._assertPopupView()},_toggle:function(){this._assertPopupView(),this.isExpanded()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var self=this,o=this.options,evs=this.options.trigger.split(",");BI.each(evs,function(i,e){switch(e){case"hover":self.element[e](function(e){self.isEnabled()&&self.switcher.isEnabled()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND))},function(){self.isEnabled()&&self.switcher.isEnabled()&&o.toggle&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE))});break;default:e&&self.element.off(e+"."+self.getName()).on(e+"."+self.getName(),BI.debounce(function(e){self.switcher.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.switcher.isEnabled()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initSwitcher:function(){this.switcher=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;this._created||(this.popupView=BI.createWidget(o.popup,{type:"bi.button_group",element:o.adapter&&BI.Maskers.create(this.getName(),o.adapter,BI.extend({container:this},o.masker)),cls:"switcher-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_CHANGE,value,obj)}),o.direction===BI.Direction.Custom||o.adapter||BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._created=!0,BI.nextTick(function(){self.fireEvent(BI.Switcher.EVENT_AFTER_INIT)}))},_hideView:function(){this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW);var self=this,o=this.options;o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),BI.nextTick(function(){o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),self.element.removeClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW)})},_popupView:function(){var self=this,o=this.options;this._assertPopupView(),this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW),o.adapter?BI.Maskers.show(this.getName()):self.popupView.setVisible(!0),BI.nextTick(function(name){o.adapter?BI.Maskers.show(name):self.popupView.setVisible(!0),self.element.addClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW)},this.getName())},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.switcher.populate.apply(this.switcher,arguments)},_setEnable:function(arg){BI.Switcher.superclass._setEnable.apply(this,arguments),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.switcher.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},isViewVisible:function(){return this.isEnabled()&&this.switcher.isEnabled()&&(this.options.adapter?BI.Maskers.isVisible(this.getName()):this.popupView&&this.popupView.isVisible())},isExpanded:function(){return this.isViewVisible()},showView:function(){this.isEnabled()&&this.switcher.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.switcher.attr("id")===id?this.switcher:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.switcher.getValue()===value?this.switcher:this.popupView&&this.popupView.getNodeByValue(value)},empty:function(){this.popupView&&this.popupView.empty()},destroy:function(){BI.Switcher.superclass.destroy.apply(this,arguments)}}),BI.Switcher.EVENT_EXPAND="EVENT_EXPAND",BI.Switcher.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Switcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Switcher.EVENT_CHANGE="EVENT_CHANGE",BI.Switcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Switcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Switcher.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Switcher.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Switcher.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.switcher",BI.Switcher),BI.Tab=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Tab.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tab",direction:"top",single:!1,logic:{dynamic:!1},showIndex:!1,tab:!1,cardCreator:function(v){return BI.createWidget()}})},render:function(){var self=this,o=this.options;BI.isObject(o.tab)&&(this.tab=BI.createWidget(this.options.tab,{type:"bi.button_group"}),this.tab.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})),this.cardMap={},this.layout=BI.createWidget({type:"bi.card"}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.tab,this.layout)}))));var listener=new BI.ShowListener({eventObj:this.tab,cardLayout:this.layout,cardCreator:function(v){var card=o.cardCreator.apply(self,arguments);return self.cardMap[v]=card,card},afterCardShow:function(v){self._deleteOtherCards(v),self.curr=v}});listener.on(BI.ShowListener.EVENT_CHANGE,function(value){self.fireEvent(BI.Tab.EVENT_CHANGE,value,self)})},_deleteOtherCards:function(currCardName){var self=this,o=this.options;o.single===!0&&BI.each(this.cardMap,function(name,card){name!==currCardName+""&&(self.layout.deleteCardByName(name),delete self.cardMap[name])})},_assertCard:function(v){if(!this.layout.isCardExisted(v)){var card=this.options.cardCreator(v);this.cardMap[v]=card,this.layout.addCardByName(v,card)}},mounted:function(){var o=this.options;o.showIndex!==!1&&this.setSelect(o.showIndex)},setSelect:function(v){this.tab&&this.tab.setValue(v),this._assertCard(v),this.layout.showCardByName(v),this._deleteOtherCards(v),this.curr!==v&&(this.curr=v)},removeTab:function(cardname){var self=this,o=this.options;BI.any(this.cardMap,function(name,card){if(BI.isEqual(name,cardname+""))return self.layout.deleteCardByName(name),delete self.cardMap[name],!0})},getSelect:function(){return this.curr},getSelectedTab:function(){return this.layout.getShowingCard()},getTab:function(v){return this._assertCard(v),this.layout.getCardByName(v)},setValue:function(v){var card=this.layout.getShowingCard();card&&card.setValue(v)},getValue:function(){var card=this.layout.getShowingCard();if(card)return card.getValue()},populate:function(){var card=this.layout.getShowingCard();if(card)return card.populate&&card.populate.apply(card,arguments)},empty:function(){this.layout.deleteAllCard(),this.cardMap={}},destroy:function(){this.cardMap={},BI.Tab.superclass.destroy.apply(this,arguments)}}),BI.Tab.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tab",BI.Tab),BI.EL=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EL.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-el",el:{},layout:{}})},_init:function(){BI.EL.superclass._init.apply(this,arguments);var self=this,o=this.options;this.ele=BI.createWidget(o.el),BI.createWidget(o.layout,{type:"bi.adaptive",element:this,items:[this.ele]}),this.ele.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},setValue:function(v){this.ele.setValue(v)},getValue:function(){return this.ele.getValue()},populate:function(){this.ele.populate.apply(this,arguments)}}),BI.shortcut("bi.el",BI.EL),BI.Msg=function(){var messageShow,$mask,$pop,toastStack=[];return{alert:function(title,message,callback){this._show(!1,title,message,callback)},confirm:function(title,message,callback){this._show(!0,title,message,callback)},prompt:function(title,message,value,callback,min_width){},toast:function(message,options,context){options=options||{},context=context||BI.Widget._renderEngine.createElement("body");var level=options.level||"normal",autoClose=!!BI.isNull(options.autoClose)||options.autoClose,toast=BI.createWidget({type:"bi.toast",cls:"bi-message-animate bi-message-leave",level:level,autoClose:autoClose,text:message,listeners:[{eventName:BI.Toast.EVENT_DESTORY,action:function(){BI.remove(toastStack,toast.element);var _height=10;BI.each(toastStack,function(i,element){element.css({top:_height}),_height+=element.outerHeight()+10})}}]}),height=10;BI.each(toastStack,function(i,element){height+=element.outerHeight()+10}),BI.createWidget({type:"bi.absolute",element:context,items:[{el:toast,left:"50%",top:height}]}),toastStack.push(toast.element),toast.element.css({"margin-left":-1*toast.element.outerWidth()/2}),toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"),autoClose&&BI.delay(function(){toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"),toast.destroy()},5e3)},_show:function(hasCancel,title,message,callback){$mask=BI.Widget._renderEngine.createElement('
    ').css({position:"absolute",zIndex:BI.zIndex_tip-2,top:0,left:0,right:0,bottom:0,opacity:.5}).appendTo("body"),$pop=BI.Widget._renderEngine.createElement('
    ').css({position:"absolute",zIndex:BI.zIndex_tip-1,top:0,left:0,right:0,bottom:0}).appendTo("body");var close=function(){messageShow.destroy(),$mask.remove()},controlItems=[];hasCancel===!0&&controlItems.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_Cancel"),level:"ignore",handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!1])}}}),controlItems.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_OK"),handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!0])}}});var conf={element:$pop,type:"bi.center_adapt",items:[{type:"bi.border",cls:"bi-card",items:{north:{el:{type:"bi.border",cls:"bi-message-title bi-background",items:{center:{el:{type:"bi.label",cls:"bi-font-bold",text:title||BI.i18nText("BI-Basic_Prompt"),textAlign:"left",hgap:20,height:40}},east:{el:{type:"bi.icon_button",cls:"bi-message-close close-font",handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!1])}},width:60}}},height:40},center:{el:{type:"bi.label",vgap:10,hgap:20,whiteSpace:"normal",text:message}},south:{el:{type:"bi.absolute",items:[{el:{type:"bi.right_vertical_adapt",lgap:10,items:controlItems},top:0,left:20,right:20,bottom:0}]},height:44}},width:450,height:200}]};messageShow=BI.createWidget(conf)}}}(),BI.GridView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.GridView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-grid-view",overflowX:!0,overflowY:!0,overscanColumnCount:0,overscanRowCount:0,rowHeightGetter:BI.emptyFn,columnWidthGetter:BI.emptyFn,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.GridView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){self._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){self._scrollLock!==!0&&(o.scrollLeft=self.element.scrollLeft(),o.scrollTop=self.element.scrollTop(),self._calculateChildrenToRender(),self.fireEvent(BI.GridView.EVENT_SCROLL,{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:o.overflowX===!0&&o.overflowY===!0,scrolly:o.overflowX===!1&&o.overflowY===!0,scrollx:o.overflowX===!0&&o.overflowY===!1,items:[this.container]}),o.items.length>0&&this._populate()},mounted:function(){var o=this.options;0===o.scrollLeft&&0===o.scrollTop||(this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft))},_getOverscanIndices:function(cellCount,overscanCellsCount,startIndex,stopIndex){return{overscanStartIndex:Math.max(0,startIndex-overscanCellsCount),overscanStopIndex:Math.min(cellCount-1,stopIndex+overscanCellsCount)}},_calculateChildrenToRender:function(){var self=this,o=this.options,width=o.width,height=o.height,scrollLeft=BI.clamp(o.scrollLeft,0,this._getMaxScrollLeft()),scrollTop=BI.clamp(o.scrollTop,0,this._getMaxScrollTop()),overscanColumnCount=o.overscanColumnCount,overscanRowCount=o.overscanRowCount;if(height>0&&width>0){var visibleColumnIndices=this._columnSizeAndPositionManager.getVisibleCellRange(width,scrollLeft),visibleRowIndices=this._rowSizeAndPositionManager.getVisibleCellRange(height,scrollTop);if(BI.isEmpty(visibleColumnIndices)||BI.isEmpty(visibleRowIndices))return;var horizontalOffsetAdjustment=this._columnSizeAndPositionManager.getOffsetAdjustment(width,scrollLeft),verticalOffsetAdjustment=this._rowSizeAndPositionManager.getOffsetAdjustment(height,scrollTop);this._renderedColumnStartIndex=visibleColumnIndices.start,this._renderedColumnStopIndex=visibleColumnIndices.stop,this._renderedRowStartIndex=visibleRowIndices.start,this._renderedRowStopIndex=visibleRowIndices.stop;var overscanColumnIndices=this._getOverscanIndices(this.columnCount,overscanColumnCount,this._renderedColumnStartIndex,this._renderedColumnStopIndex),overscanRowIndices=this._getOverscanIndices(this.rowCount,overscanRowCount,this._renderedRowStartIndex,this._renderedRowStopIndex),columnStartIndex=overscanColumnIndices.overscanStartIndex,columnStopIndex=overscanColumnIndices.overscanStopIndex,rowStartIndex=overscanRowIndices.overscanStartIndex,rowStopIndex=overscanRowIndices.overscanStopIndex,minRowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStartIndex),minColumnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStartIndex),maxRowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStopIndex),maxColumnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStopIndex),top=minRowDatum.offset+verticalOffsetAdjustment,left=minColumnDatum.offset+horizontalOffsetAdjustment,bottom=maxRowDatum.offset+verticalOffsetAdjustment+maxRowDatum.size,right=maxColumnDatum.offset+horizontalOffsetAdjustment+maxColumnDatum.size;if(top>=this.renderRange.minY&&bottom<=this.renderRange.maxY&&left>=this.renderRange.minX&&right<=this.renderRange.maxX)return;for(var renderedCells=[],renderedKeys={},renderedWidgets={},minX=this._getMaxScrollLeft(),minY=this._getMaxScrollTop(),maxX=0,maxY=0,count=0,rowIndex=rowStartIndex;rowIndex<=rowStopIndex;rowIndex++)for(var rowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex),columnIndex=columnStartIndex;columnIndex<=columnStopIndex;columnIndex++){var key=rowIndex+"-"+columnIndex,columnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex),index=this.renderedKeys[key]&&this.renderedKeys[key][2],child;index>=0?(columnDatum.size!==this.renderedCells[index]._width&&(this.renderedCells[index]._width=columnDatum.size,this.renderedCells[index].el.setWidth(columnDatum.size)),rowDatum.size!==this.renderedCells[index]._height&&(this.renderedCells[index]._height=rowDatum.size,this.renderedCells[index].el.setHeight(rowDatum.size)),this.renderedCells[index]._left!==columnDatum.offset+horizontalOffsetAdjustment&&this.renderedCells[index].el.element.css("left",columnDatum.offset+horizontalOffsetAdjustment+"px"),this.renderedCells[index]._top!==rowDatum.offset+verticalOffsetAdjustment&&this.renderedCells[index].el.element.css("top",rowDatum.offset+verticalOffsetAdjustment+"px"),renderedCells.push(child=this.renderedCells[index])):(child=BI.createWidget(BI.extend({type:"bi.label",width:columnDatum.size,height:rowDatum.size},o.items[rowIndex][columnIndex],{cls:(o.items[rowIndex][columnIndex].cls||"")+" grid-cell"+(0===rowIndex?" first-row":"")+(0===columnIndex?" first-col":""),_rowIndex:rowIndex,_columnIndex:columnIndex,_left:columnDatum.offset+horizontalOffsetAdjustment,_top:rowDatum.offset+verticalOffsetAdjustment}),this),renderedCells.push({el:child,left:columnDatum.offset+horizontalOffsetAdjustment,top:rowDatum.offset+verticalOffsetAdjustment,_left:columnDatum.offset+horizontalOffsetAdjustment,_top:rowDatum.offset+verticalOffsetAdjustment,_width:columnDatum.size,_height:rowDatum.size})),minX=Math.min(minX,columnDatum.offset+horizontalOffsetAdjustment),maxX=Math.max(maxX,columnDatum.offset+horizontalOffsetAdjustment+columnDatum.size),minY=Math.min(minY,rowDatum.offset+verticalOffsetAdjustment),maxY=Math.max(maxY,rowDatum.offset+verticalOffsetAdjustment+rowDatum.size),renderedKeys[key]=[rowIndex,columnIndex,count],renderedWidgets[count]=child,count++}var existSet={},addSet={},deleteArray=[];BI.each(renderedKeys,function(i,key){self.renderedKeys[i]?existSet[i]=key:addSet[i]=key}),BI.each(this.renderedKeys,function(i,key){existSet[i]||addSet[i]||deleteArray.push(key[2])}),BI.each(deleteArray,function(i,index){self.renderedCells[index].el._destroy()});var addedItems=[];BI.each(addSet,function(index,key){addedItems.push(renderedCells[key[2]])}),this.container.addItems(addedItems,this),this.container._children=renderedWidgets,this.container.attr("items",renderedCells),this.renderedCells=renderedCells,this.renderedKeys=renderedKeys,this.renderRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY}}},_getRealMaxScrollLeft:function(){var o=this.options,totalWidth=0;return BI.count(0,this.columnCount,function(index){totalWidth+=o.columnWidthGetter(index)}),Math.max(0,totalWidth-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollLeft:function(){return Math.max(0,this._columnSizeAndPositionManager.getTotalSize()-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._rowSizeAndPositionManager.getTotalSize()-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(items){var self=this,o=this.options;this._reRange(),this.columnCount=0,this.rowCount=0,items&&items!==this.options.items&&(this.options.items=items),BI.isNumber(o.columnCount)?this.columnCount=o.columnCount:o.items.length>0&&(this.columnCount=o.items[0].length),BI.isNumber(o.rowCount)?this.rowCount=o.rowCount:this.rowCount=o.items.length,this.container.setWidth(this.columnCount*o.estimatedColumnSize),this.container.setHeight(this.rowCount*o.estimatedRowSize),this._columnSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.columnCount,o.columnWidthGetter,o.estimatedColumnSize),this._rowSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.rowCount,o.rowHeightGetter,o.estimatedRowSize),this._calculateChildrenToRender();try{this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft)}catch(e){}},setScrollLeft:function(scrollLeft){this.options.scrollLeft!==scrollLeft&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(scrollLeft||0,0,this._getRealMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(scrollTop){this.options.scrollTop!==scrollTop&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(scrollTop||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setColumnCount:function(columnCount){this.options.columnCount=columnCount},setRowCount:function(rowCount){this.options.rowCount=rowCount},setOverflowX:function(b){var self=this;this.options.overflowX!==!!b&&(this.options.overflowX=!!b,BI.nextTick(function(){self.element.css({overflowX:b?"auto":"hidden"})}))},setOverflowY:function(b){var self=this;this.options.overflowY!==!!b&&(this.options.overflowY=!!b,BI.nextTick(function(){self.element.css({overflowY:b?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},setEstimatedColumnSize:function(width){this.options.estimatedColumnSize=width},setEstimatedRowSize:function(height){this.options.estimatedRowSize=height},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(i,cell){cell.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(items){items&&items!==this.options.items&&this.restore(),this._populate(items)}}),BI.GridView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.grid_view",BI.GridView),BI.Popover=BI.inherit(BI.Widget,{_constant:{SIZE:{SMALL:"small",NORMAL:"normal",BIG:"big"},HEADER_HEIGHT:40},_defaultConfig:function(){return BI.extend(BI.Popover.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-popover bi-card bi-border-radius",size:"normal",logic:{dynamic:!1},header:null,body:null,footer:null,closable:!0})},render:function(){var self=this,o=this.options;this.startX=0,this.startY=0,this.tracker=new BI.MouseMoveTracker(function(deltaX,deltaY){var size=self._calculateSize(),W=BI.Widget._renderEngine.createElement("body").width(),H=BI.Widget._renderEngine.createElement("body").height();self.startX+=deltaX,self.startY+=deltaY,self.element.css({left:BI.clamp(self.startX,0,W-self.element.width())+"px",top:BI.clamp(self.startY,0,H-self.element.height())+"px"}),BI.Resizers._resize()},function(){self.tracker.releaseMouseMoves()},_global);var items=[{el:{type:"bi.htape",cls:"bi-message-title bi-header-background",ref:function(_ref){self.dragger=_ref},items:[{type:"bi.absolute",items:[{el:BI.isPlainObject(o.header)?BI.createWidget(o.header,{extraCls:"bi-font-bold"}):{type:"bi.label",cls:"bi-font-bold",height:this._constant.HEADER_HEIGHT,text:o.header,title:o.header,textAlign:"left"},left:20,top:0,right:0,bottom:0}]},{el:o.closable?{type:"bi.icon_button",cls:"bi-message-close close-font",height:this._constant.HEADER_HEIGHT,handler:function(){self.close()}}:{type:"bi.layout"},width:56}],height:this._constant.HEADER_HEIGHT},height:this._constant.HEADER_HEIGHT},{el:o.logic.dynamic?{type:"bi.vertical",scrolly:!1,cls:"popover-body",ref:function(){self.body=this},hgap:20,tgap:10,items:[{el:BI.createWidget(o.body)}]}:{type:"bi.absolute",items:[{el:BI.createWidget(o.body),left:20,top:10,right:20,bottom:0}]}}];o.footer&&items.push({el:{type:"bi.absolute",items:[{el:BI.createWidget(o.footer),left:20,top:0,right:20,bottom:0}],height:44},height:44});var size=this._calculateSize();return BI.extend({type:o.logic.dynamic?"bi.vertical":"bi.vtape",items:items,width:size.width},o.logic.dynamic?{type:"bi.vertical",scrolly:!1}:{type:"bi.vtape",height:size.height})},mounted:function(){var self=this,o=this.options;if(this.dragger.element.mousedown(function(e){var pos=self.element.offset();self.startX=pos.left,self.startY=pos.top,self.tracker.captureMouseMoves(e)}),o.logic.dynamic){var size=this._calculateSize(),height=this.element.height(),compareHeight=BI.clamp(height,size.height,600)-(o.footer?84:44);this.body.element.height(compareHeight)}},_calculateSize:function(){var o=this.options,size={};if(BI.isNotNull(o.size))switch(o.size){case this._constant.SIZE.SMALL:size.width=450,size.height=200;break;case this._constant.SIZE.BIG:size.width=900,size.height=500;break;default:size.width=550,size.height=500}return{width:o.width||size.width,height:o.height||size.height}},hide:function(){},open:function(){this.show(),this.fireEvent(BI.Popover.EVENT_OPEN,arguments)},close:function(){this.hide(),this.fireEvent(BI.Popover.EVENT_CLOSE,arguments)},setZindex:function(zindex){this.element.css({"z-index":zindex})},destroyed:function(){}}),BI.shortcut("bi.popover",BI.Popover),BI.BarPopover=BI.inherit(BI.Popover,{_defaultConfig:function(){return BI.extend(BI.BarPopover.superclass._defaultConfig.apply(this,arguments),{btns:[BI.i18nText("BI-Basic_Sure"),BI.i18nText("BI-Basic_Cancel")]})},beforeCreate:function(){var self=this,o=this.options;o.footer||(o.footer={type:"bi.right_vertical_adapt",lgap:10,items:[{type:"bi.button",text:this.options.btns[1],value:1,level:"ignore",handler:function(v){self.fireEvent(BI.Popover.EVENT_CANCEL,v),self.close(v)}},{type:"bi.button",text:this.options.btns[0],warningTitle:o.warningTitle,value:0,handler:function(v){self.fireEvent(BI.Popover.EVENT_CONFIRM,v),self.close(v)}}]})}}),BI.shortcut("bi.bar_popover",BI.BarPopover),BI.Popover.EVENT_CLOSE="EVENT_CLOSE",BI.Popover.EVENT_OPEN="EVENT_OPEN",BI.Popover.EVENT_CANCEL="EVENT_CANCEL",BI.Popover.EVENT_CONFIRM="EVENT_CONFIRM",BI.PopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-popup-view",maxWidth:"auto",minWidth:100,minHeight:24,lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,innerVGap:0,direction:BI.Direction.Top,stopEvent:!1,stopPropagation:!1,logic:{dynamic:!0},tool:!1,tabs:[],buttons:[],el:{type:"bi.button_group",items:[],chooseType:0,behaviors:{},layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.PopupView.superclass._init.apply(this,arguments);var self=this,o=this.options,fn=function(e){e.stopPropagation()},stop=function(e){return e.stopEvent(),!1};this.element.css({"z-index":BI.zIndex_popup,"min-width":o.minWidth+"px","max-width":o.maxWidth+"px"}).bind({click:fn}),this.element.bind("mousewheel",fn),o.stopPropagation&&this.element.bind({mousedown:fn,mouseup:fn,mouseover:fn}),o.stopEvent&&this.element.bind({mousedown:stop,mouseup:stop,mouseover:stop}),this.tool=this._createTool(),this.tab=this._createTab(),this.view=this._createView(),this.toolbar=this._createToolBar(),this.view.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.PopupView.EVENT_CHANGE)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{ +scrolly:!1,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,vgap:o.vgap,hgap:o.hgap,items:BI.LogicFactory.createLogicItemsByDirection(o.direction,BI.extend({cls:"list-view-outer bi-card list-view-shadow"},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.tool,this.tab,this.view,this.toolbar)}))))}))))},_createView:function(){var o=this.options;return this.button_group=BI.createWidget(o.el,{type:"bi.button_group",value:o.value}),this.button_group.element.css({"min-height":o.minHeight+"px","padding-top":o.innerVGap+"px","padding-bottom":o.innerVGap+"px"}),this.button_group},_createTool:function(){var o=this.options;if(!1!==o.tool)return BI.createWidget(o.tool)},_createTab:function(){var o=this.options;if(0!==o.tabs.length)return BI.createWidget({type:"bi.center",cls:"list-view-tab",height:25,items:o.tabs,value:o.value})},_createToolBar:function(){var o=this.options;if(0!==o.buttons.length)return BI.createWidget({type:"bi.center",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(o.buttons,{once:!1,shadow:!0,isShadowShowingOnSelected:!0})})},getView:function(){return this.view},populate:function(items){this.view.populate.apply(this.view,arguments)},resetWidth:function(w){this.options.width=w,this.element.width(w)},resetHeight:function(h){var tbHeight=this.toolbar?this.toolbar.attr("height")||24:0,tabHeight=this.tab?this.tab.attr("height")||24:0,toolHeight=(this.tool&&this.tool.attr("height")||24)*(this.tool&&this.tool.isVisible()?1:0),resetHeight=h-tbHeight-tabHeight-toolHeight-2*this.options.innerVGap;this.view.resetHeight?this.view.resetHeight(resetHeight):this.view.element.css({"max-height":resetHeight+"px"})},setValue:function(selectedValues){this.tab&&this.tab.setValue(selectedValues),this.view.setValue(selectedValues)},getValue:function(){return this.view.getValue()}}),BI.PopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.popup_view",BI.PopupView),BI.SearcherView=BI.inherit(BI.Pane,{_defaultConfig:function(){var conf=BI.SearcherView.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-searcher-view bi-card",tipText:BI.i18nText("BI-No_Select"),chooseType:BI.Selection.Single,matcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]},searcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.SearcherView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.matcher=BI.createWidget(o.matcher,{type:"bi.button_group",chooseType:o.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:o.value}),this.matcher.on(BI.Controller.EVENT_CHANGE,function(type,val,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearcherView.EVENT_CHANGE,val,ob)}),this.spliter=BI.createWidget({type:"bi.vertical",height:1,hgap:10,items:[{type:"bi.layout",height:1,cls:"searcher-view-spliter bi-background"}]}),this.searcher=BI.createWidget(o.searcher,{type:"bi.button_group",chooseType:o.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:o.value}),this.searcher.on(BI.Controller.EVENT_CHANGE,function(type,val,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearcherView.EVENT_CHANGE,val,ob)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.matcher,this.spliter,this.searcher]})},startSearch:function(){},stopSearch:function(){},setValue:function(v){this.matcher.setValue(v),this.searcher.setValue(v)},getValue:function(){return this.matcher.getValue().concat(this.searcher.getValue())},populate:function(searchResult,matchResult,keyword){searchResult||(searchResult=[]),matchResult||(matchResult=[]),this.setTipVisible(searchResult.length+matchResult.length===0),this.spliter.setVisible(BI.isNotEmptyArray(matchResult)&&BI.isNotEmptyArray(searchResult)),this.matcher.populate(matchResult,keyword),this.searcher.populate(searchResult,keyword)},empty:function(){this.searcher.empty(),this.matcher.empty()},hasMatched:function(){return this.matcher.getAllButtons().length>0}}),BI.SearcherView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.searcher_view",BI.SearcherView),BI.ListView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-list-view",overscanHeight:100,blockSize:10,scrollTop:0,el:{},items:[]}},init:function(){var self=this;this.renderedIndex=-1,this.cache={}},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[BI.extend({type:"bi.vertical",scrolly:!1,ref:function(){self.container=this}},o.el)],element:this}},mounted:function(){var self=this,o=this.options;this._populate(),this.element.scroll(function(e){o.scrollTop=self.element.scrollTop(),self._calculateBlocksToRender()});var lastWidth=this.element.width(),lastHeight=this.element.height();BI.ResizeDetector.addResizeListener(this,function(){var width=self.element.width(),height=self.element.height();width===lastWidth&&height===lastHeight||(lastWidth=width,lastHeight=height,self._calculateBlocksToRender())})},_renderMoreIf:function(){for(var self=this,o=this.options,height=this.element.height(),minContentHeight=o.scrollTop+height+o.overscanHeight,index=this.cache[this.renderedIndex]&&this.cache[this.renderedIndex].index+o.blockSize||0,cnt=this.renderedIndex+1,lastHeight,getElementHeight=function(){return self.container.element.height()};(lastHeight=getElementHeight())pages&&(groups=pages),dict.index=Math.ceil((curr+(groups>1&&groups!==pages?1:0))/(0===groups?1:groups)),(!o.dynamicShow&&!o.dynamicShowPrevNext||curr>1)&&prev!==!1&&(BI.isKey(prev)?view.push({text:prev,value:"prev",disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)}):view.push(BI.extend({disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)},prev))),(!o.dynamicShow&&!o.dynamicShowFirstLast||dict.index>1&&0!==groups)&&first&&(view.push({text:first,value:"first",disabled:!(dict.index>1&&0!==groups)}),dict.index>1&&0!==groups&&view.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),dict.poor=Math.floor((groups-1)/2),dict.start=dict.index>1?curr-dict.poor:1,dict.end=dict.index>1?function(){var max=curr+(groups-dict.poor-1);return max>pages?pages:max}():groups,dict.end-dict.start1&&0!==groups&&pages>groups&&dict.endgroups&&dict.endgroups&&dict.endgroups&&dict.end1},hasNext:function(v){v||(v=1);var o=this.options,pages=this.options.pages;return pages===!1?o.hasNext(v):vlastPage?lastPage:(firstPage=BI.result(o,"firstPage"),vo.pages?o.pages:v,this.currPage=v;this._populate()},getValue:function(){var val=this.button_group.getValue()[0];switch(val){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return val}},attr:function(key,value){BI.Pager.superclass.attr.apply(this,arguments),"curr"===key&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.Pager.EVENT_CHANGE="EVENT_CHANGE",BI.Pager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.pager",BI.Pager),BI.A=BI.inherit(BI.Text,{_defaultConfig:function(){var conf=BI.A.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-a display-block",href:"",target:"_blank",el:null,tagName:"a"})},_init:function(){var o=this.options;BI.A.superclass._init.apply(this,arguments),this.element.attr({href:o.href,target:o.target}),o.el&&BI.createWidget(o.el,{element:this})}}),BI.shortcut("bi.a",BI.A),BI.LoadingBar=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.LoadingBar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-loading-bar bi-tips",height:30,handler:BI.emptyFn})},_init:function(){BI.LoadingBar.superclass._init.apply(this,arguments);var self=this;this.loaded=BI.createWidget({type:"bi.text_button",cls:"loading-text bi-list-item-simple",text:BI.i18nText("BI-Load_More"),width:120,handler:this.options.handler}),this.loaded.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.loading=BI.createWidget({type:"bi.layout",width:this.options.height,height:this.options.height,cls:"loading-background cursor-default"});var loaded=BI.createWidget({type:"bi.center_adapt",items:[this.loaded]}),loading=BI.createWidget({type:"bi.center_adapt",items:[this.loading]});this.cardLayout=BI.createWidget({type:"bi.card",element:this,items:[{el:loaded,cardName:"loaded"},{el:loading,cardName:"loading"}]}),this.invisible()},_reset:function(){this.visible(),this.loaded.setText(BI.i18nText("BI-Load_More")),this.loaded.enable()},setLoaded:function(){this._reset(),this.cardLayout.showCardByName("loaded")},setEnd:function(){this.setLoaded(),this.loaded.setText(BI.i18nText("BI-No_More_Data")),this.loaded.disable()},setLoading:function(){this._reset(),this.cardLayout.showCardByName("loading")}}),BI.shortcut("bi.loading_bar",BI.LoadingBar),BI.IconButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-icon-button horizon-center",iconWidth:null,iconHeight:null})},_init:function(){BI.IconButton.superclass._init.apply(this,arguments);var o=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:o.iconWidth,height:o.iconHeight}),BI.isNumber(o.height)&&o.height>0&&BI.isNull(o.iconWidth)&&BI.isNull(o.iconHeight)?(this.element.css("lineHeight",o.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))},doClick:function(){BI.IconButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconButton.EVENT_CHANGE,this)}}),BI.IconButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_button",BI.IconButton),BI.ImageButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.ImageButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-image-button",src:"",iconWidth:"100%",iconHeight:"100%"})},_init:function(){BI.ImageButton.superclass._init.apply(this,arguments);var o=this.options;this.image=BI.createWidget({type:"bi.img",width:o.iconWidth,height:o.iconHeight,src:o.src}),BI.isNumber(o.iconWidth)||BI.isNumber(o.iconHeight)?BI.createWidget({type:"bi.center_adapt",element:this,items:[this.image]}):BI.createWidget({type:"bi.adaptive",element:this,items:[this.image],scrollable:!1})},setWidth:function(w){BI.ImageButton.superclass.setWidth.apply(this,arguments),this.options.width=w},setHeight:function(h){BI.ImageButton.superclass.setHeight.apply(this,arguments),this.options.height=h},setImageWidth:function(w){this.image.setWidth(w)},setImageHeight:function(h){this.image.setHeight(h)},getImageWidth:function(){return this.image.element.width()},getImageHeight:function(){return this.image.element.height()},setSrc:function(src){this.options.src=src,this.image.setSrc(src)},getSrc:function(){return this.image.getSrc()},doClick:function(){BI.ImageButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageButton.EVENT_CHANGE,this)}}),BI.ImageButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.image_button",BI.ImageButton),BI.Button=BI.inherit(BI.BasicButton,{_defaultConfig:function(props){var conf=BI.Button.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-button"+(BI.isIE()&&BI.isIE9Below()?" hack":""),minWidth:props.block===!0||props.clear===!0?0:80,height:24,shadow:props.clear!==!0,isShadowShowingOnSelected:!0,readonly:!0,iconCls:"",level:"common",block:!1,clear:!1,ghost:!1,textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:props.clear?0:10,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},_init:function(){BI.Button.superclass._init.apply(this,arguments);var o=this.options,self=this;!BI.isNumber(o.height)||o.clear||o.block?o.clear||o.block?this.element.css({lineHeight:o.height+"px"}):this.element.css({lineHeight:o.height-2+"px"}):this.element.css({height:o.height+"px",lineHeight:o.height-2+"px"}),BI.isKey(o.iconCls)?(this.icon=BI.createWidget({type:"bi.icon_label",cls:o.iconCls,width:18,height:o.height-2,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),this.text=BI.createWidget({type:"bi.label",text:o.text,value:o.value,height:o.height-2}),BI.createWidget({type:"bi.center_adapt",element:this,hgap:o.hgap,vgap:o.vgap,items:[{type:"bi.horizontal",items:[this.icon,this.text]}]})):this.text=BI.createWidget({type:"bi.label",textAlign:o.textAlign,whiteSpace:o.whiteSpace,textWidth:o.textWidth,textHeight:o.textHeight,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,lgap:o.lgap,rgap:o.rgap,element:this,text:o.text,value:o.value}),o.block===!0&&this.element.addClass("block"),o.clear===!0&&this.element.addClass("clear"),o.ghost===!0&&this.element.addClass("ghost"),o.minWidth>0&&this.element.css({"min-width":o.minWidth+"px"})},doClick:function(){BI.Button.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Button.EVENT_CHANGE,this)},setText:function(text){BI.Button.superclass.setText.apply(this,arguments),this.text.setText(text)},setValue:function(text){BI.Button.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(text)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},destroy:function(){BI.Button.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.button",BI.Button),BI.Button.EVENT_CHANGE="EVENT_CHANGE",BI.TextButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-button",textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,lgap:0,rgap:0,text:"",py:""})},_init:function(){BI.TextButton.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textWidth:o.textWidth,textHeight:o.textHeight,width:o.width,height:o.height,hgap:o.hgap,lgap:o.lgap,rgap:o.rgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword})},doClick:function(){BI.TextButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextButton.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(text){BI.TextButton.superclass.setText.apply(this,arguments),text=BI.isArray(text)?text.join(","):text,this.text.setText(text)},setStyle:function(style){this.text.setStyle(style)},setValue:function(text){BI.TextButton.superclass.setValue.apply(this,arguments),this.isReadOnly()||(text=BI.isArray(text)?text.join(","):text,this.text.setValue(text))}}),BI.TextButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_button",BI.TextButton),BI.BlankIconIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconIconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const,blank=BI.createWidget({type:"bi.layout",width:o.blankWidth,height:o.height});this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:o.iconCls1,forceNotSelected:!0,width:o.height,height:o.height}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:o.iconCls2,forceNotSelected:!0,width:o.height,height:o.height}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",blank,this.icon1,this.icon2,this.text)}))))},doClick:function(){BI.BlankIconIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(b){BI.BlankIconIconTextItem.superclass.setSelected.apply(this,arguments),this.icon1.setSelected(b),this.icon2.setSelected(b)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_icon_text_item",BI.BlankIconIconTextItem),BI.BlankIconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.layout",width:o.blankWidth},icon1,this.text,{type:"bi.layout",width:o.height})}))))},doClick:function(){BI.BlankIconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.BlankIconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_icon_item",BI.BlankIconTextIconItem),BI.BlankIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},cls:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const,blank=BI.createWidget({type:"bi.layout",width:o.blankWidth});this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",blank,this.icon,this.text)}))))},doClick:function(){BI.BlankIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_item",BI.BlankIconTextItem),BI.IconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.leftIconWrapperWidth,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),blank=BI.createWidget({type:"bi.layout",width:o.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.rightIconWrapperWidth,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",icon1,this.text,blank)}))))},doClick:function(){BI.IconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_item",BI.IconTextIconItem),BI.IconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-item",direction:BI.Direction.Left,logic:{dynamic:!1},iconWrapperWidth:null,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextItem.superclass._init.apply(this,arguments); +var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.iconWrapperWidth||o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.IconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_item",BI.IconTextItem),BI.TextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-item",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.TextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_item",BI.TextIconItem),BI.TextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-item",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextItem.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})},doClick:function(){BI.TextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_item",BI.TextItem),BI.IconTextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-icon-node",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),blank=BI.createWidget({type:"bi.layout",width:o.height,height:o.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",icon1,this.text,blank)}))))},doClick:function(){BI.IconTextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_node",BI.IconTextIconNode),BI.IconTextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.IconTextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_node",BI.IconTextNode),BI.TextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconNode.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.TextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_node",BI.TextIconNode),BI.TextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-node",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextNode.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})},doClick:function(){BI.TextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_node",BI.TextNode),BI.Editor=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Editor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-editor bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,tipType:"warning",inputType:"text",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){BI.Editor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=this.addWidget(BI.createWidget({type:"bi.input",element:"",root:!0,value:o.value,watermark:o.watermark,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank})),this.editor.element.css({width:"100%",height:"100%",border:"none",outline:"none",padding:"0",margin:"0"}),BI.isKey(this.options.watermark)&&this._assertWaterMark();var _items=[];this.watermark&&_items.push({el:this.watermark,left:3,right:3,top:0,bottom:0}),_items.push({el:this.editor,left:0,right:0,top:0,bottom:0});var items=[{el:{type:"bi.absolute",ref:function(_ref){self.contentWrapper=_ref},items:_items},left:o.hgap+o.lgap,right:o.hgap+o.rgap,top:o.vgap+o.tgap,bottom:o.vgap+o.bgap}];BI.createWidget({type:"bi.absolute",element:this,items:items}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_FOCUS,function(){self._checkError(),self.element.addClass("bi-editor-focus"),self.fireEvent(BI.Editor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Input.EVENT_BLUR,function(){self._setErrorVisible(!1),self.element.removeClass("bi-editor-focus"),self.fireEvent(BI.Editor.EVENT_BLUR,arguments)}),this.editor.on(BI.Input.EVENT_CLICK,function(){self.fireEvent(BI.Editor.EVENT_CLICK,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE,function(){self.fireEvent(BI.Editor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.Editor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Input.EVENT_QUICK_DOWN,function(e){e.keyCode!==BI.KeyCode.TAB&&self.watermark&&self.watermark.invisible()}),this.editor.on(BI.Input.EVENT_VALID,function(){self._checkWaterMark(),self._setErrorVisible(!1),self.fireEvent(BI.Editor.EVENT_VALID,arguments)}),this.editor.on(BI.Input.EVENT_ERROR,function(){self._checkWaterMark(),self.fireEvent(BI.Editor.EVENT_ERROR,arguments),self._setErrorVisible(self.isEditing())}),this.editor.on(BI.Input.EVENT_RESTRICT,function(){self._checkWaterMark();var tip=self._setErrorVisible(!0);tip&&tip.element.fadeOut(100,function(){tip.element.fadeIn(100)}),self.fireEvent(BI.Editor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Input.EVENT_EMPTY,function(){self._checkWaterMark(),self.fireEvent(BI.Editor.EVENT_EMPTY,arguments)}),this.editor.on(BI.Input.EVENT_ENTER,function(){self.fireEvent(BI.Editor.EVENT_ENTER,arguments)}),this.editor.on(BI.Input.EVENT_SPACE,function(){self.fireEvent(BI.Editor.EVENT_SPACE,arguments)}),this.editor.on(BI.Input.EVENT_BACKSPACE,function(){self.fireEvent(BI.Editor.EVENT_BACKSPACE,arguments)}),this.editor.on(BI.Input.EVENT_REMOVE,function(){self.fireEvent(BI.Editor.EVENT_REMOVE,arguments)}),this.editor.on(BI.Input.EVENT_START,function(){self.fireEvent(BI.Editor.EVENT_START,arguments)}),this.editor.on(BI.Input.EVENT_PAUSE,function(){self.fireEvent(BI.Editor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Input.EVENT_STOP,function(){self.fireEvent(BI.Editor.EVENT_STOP,arguments)}),this.editor.on(BI.Input.EVENT_CONFIRM,function(){self.fireEvent(BI.Editor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.Editor.EVENT_CHANGE_CONFIRM,arguments)}),this.element.click(function(e){return e.stopPropagation(),!1}),BI.isKey(this.options.value)||BI.isEmptyString(this.options.value)?(this._checkError(),this._checkWaterMark()):this._checkWaterMark()},_checkToolTip:function(){var o=this.options,errorText=o.errorText;BI.isFunction(errorText)&&(errorText=errorText(this.editor.getValue())),BI.isKey(errorText)&&(!this.isEnabled()||this.isValid()||BI.Bubbles.has(this.getName())&&BI.Bubbles.get(this.getName()).isVisible()?this.setTitle(""):this.setTitle(errorText))},_assertWaterMark:function(){var self=this,o=this.options;BI.isNull(this.watermark)&&(this.watermark=BI.createWidget({type:"bi.label",cls:"bi-water-mark",text:this.options.watermark,height:o.height-2*(o.vgap+o.tgap),whiteSpace:"nowrap",textAlign:"left"}),this.watermark.element.bind({mousedown:function(e){self.isEnabled()?self.editor.isEditing()||self.editor.focus():self.editor.isEditing()&&self.editor.blur(),e.stopEvent()}}),this.watermark.element.bind("click",function(e){self.isEnabled()?self.editor.isEditing()||self.editor.focus():self.editor.isEditing()&&self.editor.blur(),e.stopEvent()}))},_checkError:function(){this._setErrorVisible(this.isEnabled()&&!this.isValid()),this._checkToolTip()},_checkWaterMark:function(){var o=this.options;!this.disabledWaterMark&&""===this.editor.getValue()&&BI.isKey(o.watermark)?this.watermark&&this.watermark.visible():this.watermark&&this.watermark.invisible()},setErrorText:function(text){this.options.errorText=text},getErrorText:function(){return this.options.errorText},setWaterMark:function(v){this.options.watermark=v,BI.isNull(this.watermark)&&(this._assertWaterMark(),BI.createWidget({type:"bi.absolute",element:this.contentWrapper,items:[{el:this.watermark,left:3,right:3,top:0,bottom:0}]})),BI.isKey(v)&&this.watermark.setText(v)},_setErrorVisible:function(b){var o=this.options,errorText=o.errorText;if(BI.isFunction(errorText)&&(errorText=errorText(BI.trim(this.editor.getValue()))),!this.disabledError&&BI.isKey(errorText))return BI.Bubbles[b?"show":"hide"](this.getName(),errorText,this,{adjustYOffset:2}),this._checkToolTip(),BI.Bubbles.get(this.getName())},disableError:function(){this.disabledError=!0,this._checkError()},enableError:function(){this.disabledError=!1,this._checkError()},disableWaterMark:function(){this.disabledWaterMark=!0,this._checkWaterMark()},enableWaterMark:function(){this.disabledWaterMark=!1,this._checkWaterMark()},focus:function(){this.element.addClass("text-editor-focus"),this.editor.focus()},blur:function(){this.element.removeClass("text-editor-focus"),this.editor.blur()},selectAll:function(){this.editor.selectAll()},onKeyDown:function(k){this.editor.onKeyDown(k)},setValue:function(v){BI.Editor.superclass.setValue.apply(this,arguments),this.editor.setValue(v),this._checkError(),this._checkWaterMark()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.isValid()?BI.trim(this.editor.getValue()):BI.trim(this.editor.getLastValidValue())},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()},destroyed:function(){BI.Bubbles.remove(this.getName())}}),BI.Editor.EVENT_CHANGE="EVENT_CHANGE",BI.Editor.EVENT_FOCUS="EVENT_FOCUS",BI.Editor.EVENT_BLUR="EVENT_BLUR",BI.Editor.EVENT_CLICK="EVENT_CLICK",BI.Editor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Editor.EVENT_SPACE="EVENT_SPACE",BI.Editor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Editor.EVENT_START="EVENT_START",BI.Editor.EVENT_PAUSE="EVENT_PAUSE",BI.Editor.EVENT_STOP="EVENT_STOP",BI.Editor.EVENT_CONFIRM="EVENT_CONFIRM",BI.Editor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Editor.EVENT_VALID="EVENT_VALID",BI.Editor.EVENT_ERROR="EVENT_ERROR",BI.Editor.EVENT_ENTER="EVENT_ENTER",BI.Editor.EVENT_RESTRICT="EVENT_RESTRICT",BI.Editor.EVENT_REMOVE="EVENT_REMOVE",BI.Editor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.editor",BI.Editor),BI.MultifileEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.MultifileEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-multifile-editor",multiple:!1,maxSize:-1,accept:"",url:""})},_init:function(){var self=this,o=this.options;BI.MultifileEditor.superclass._init.apply(this,arguments),this.file=BI.createWidget({type:"bi.file",cls:"multifile-editor",width:"100%",height:"100%",name:o.name,url:o.url,multiple:o.multiple,accept:o.accept,maxSize:o.maxSize,title:o.title}),this.file.on(BI.File.EVENT_CHANGE,function(){self.fireEvent(BI.MultifileEditor.EVENT_CHANGE,arguments)}),this.file.on(BI.File.EVENT_UPLOADSTART,function(){self.fireEvent(BI.MultifileEditor.EVENT_UPLOADSTART,arguments)}),this.file.on(BI.File.EVENT_ERROR,function(){self.fireEvent(BI.MultifileEditor.EVENT_ERROR,arguments)}),this.file.on(BI.File.EVENT_PROGRESS,function(){self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS,arguments)}),this.file.on(BI.File.EVENT_UPLOADED,function(){self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED,arguments)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",scrollable:!1,items:[this.file]},top:0,right:0,left:0,bottom:0}]})},select:function(){this.file.select()},getValue:function(){return this.file.getValue()},upload:function(){this.file.upload()},reset:function(){this.file.reset()}}),BI.MultifileEditor.EVENT_CHANGE="EVENT_CHANGE",BI.MultifileEditor.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.MultifileEditor.EVENT_ERROR="EVENT_ERROR",BI.MultifileEditor.EVENT_PROGRESS="EVENT_PROGRESS",BI.MultifileEditor.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.multifile_editor",BI.MultifileEditor),BI.TextAreaEditor=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(),{baseCls:"bi-textarea-editor",value:""})},render:function(){var o=this.options,self=this;this.content=BI.createWidget({type:"bi.layout",tagName:"textarea",width:"100%",height:"100%",cls:"bi-textarea textarea-editor-content display-block"}),this.content.element.css({resize:"none"}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",items:[this.content]},left:4,right:4,top:4,bottom:8}]}),this.content.element.on("input propertychange",function(e){self._checkWaterMark(),self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE)}),this.content.element.focus(function(){self.isValid()&&(self._focus(),self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS)),BI.Widget._renderEngine.createElement(document).bind("mousedown."+self.getName(),function(e){BI.DOM.isExist(self)&&!self.element.__isMouseInBounds__(e)&&(BI.Widget._renderEngine.createElement(document).unbind("mousedown."+self.getName()),self.content.element.blur())})}),this.content.element.blur(function(){self.isValid()&&(self._blur(),self.fireEvent(BI.TextAreaEditor.EVENT_BLUR)),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+self.getName())}),BI.isKey(o.value)&&this.setValue(o.value),BI.isNotNull(o.style)&&this.setStyle(o.style),this._checkWaterMark()},_checkWaterMark:function(){var self=this,o=this.options,val=this.getValue();BI.isNotEmptyString(val)?(this.watermark&&this.watermark.destroy(),this.watermark=null):BI.isNotEmptyString(o.watermark)&&(this.watermark?(this.watermark.setText(o.watermark),this.watermark.setValid(!o.invalid),this.watermark.setEnable(!o.disabled)):(this.watermark=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark cursor-default",textAlign:"left",whiteSpace:"normal",text:o.watermark,invalid:o.invalid,disabled:o.disabled}),this.watermark.on(BI.TextButton.EVENT_CHANGE,function(){self.focus()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.watermark,left:4,top:4,right:0}]})))},_focus:function(){this.content.element.addClass("textarea-editor-focus"),this._checkWaterMark()},_blur:function(){this.content.element.removeClass("textarea-editor-focus"),this._checkWaterMark()},focus:function(){this._focus(),this.content.element.focus()},blur:function(){this._blur(),this.content.element.blur()},getValue:function(){return this.content.element.val()},setValue:function(value){this.content.element.val(value),this._checkWaterMark()},setStyle:function(style){this.style=style,this.element.css(style),this.content.element.css(BI.extend({},style,{color:style.color||BI.DOM.getContrastColor(BI.DOM.isRGBColor(style.backgroundColor)?BI.DOM.rgb2hex(style.backgroundColor):style.backgroundColor)}))},getStyle:function(){return this.style},_setValid:function(b){BI.TextAreaEditor.superclass._setValid.apply(this,arguments)},_setEnable:function(b){BI.TextAreaEditor.superclass._setEnable.apply(this,[b]),this.content&&(this.content.element[0].disabled=!b)}}),BI.TextAreaEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextAreaEditor.EVENT_BLUR="EVENT_BLUR",BI.TextAreaEditor.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.textarea_editor",BI.TextAreaEditor),BI.Html=BI.inherit(BI.Single,{props:{baseCls:"bi-html",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1},render:function(){var self=this,o=this.options;o.hgap+o.lgap>0&&this.element.css({"padding-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&this.element.css({"padding-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&this.element.css({"padding-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&this.element.css({"padding-bottom":o.vgap+o.bgap+"px"}),BI.isNumber(o.height)&&this.element.css({lineHeight:o.height+"px"}),BI.isNumber(o.lineHeight)&&this.element.css({lineHeight:o.lineHeight+"px"}),BI.isWidthOrHeight(o.maxWidth)&&this.element.css({maxWidth:o.maxWidth}),this.element.css({textAlign:o.textAlign,whiteSpace:o.whiteSpace,textOverflow:"nowrap"===o.whiteSpace?"ellipsis":"",overflow:"nowrap"===o.whiteSpace?"":"auto"}),o.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){o.handler(self.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this,BI.isKey(o.text)?this.setText(o.text):BI.isKey(o.value)&&this.setText(o.value),o.highLight&&this.doHighLight()},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(text){BI.Html.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(text)},setStyle:function(css){this.text.element.css(css)},setText:function(text){BI.Html.superclass.setText.apply(this,arguments),this.options.text=text,this.text.element.html(text)}}),BI.shortcut("bi.html",BI.Html),BI.Icon=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Icon.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"i",baseCls:(conf.baseCls||"")+" x-icon b-font horizon-center display-block"})},_init:function(){BI.Icon.superclass._init.apply(this,arguments),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")}}),BI.shortcut("bi.icon",BI.Icon),BI.Iframe=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Iframe.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"iframe",baseCls:(conf.baseCls||"")+" bi-iframe",src:"",name:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var o=this.options;o.attributes.frameborder="0",o.attributes.src=o.src,o.attributes.name=o.name,BI.Iframe.superclass._init.apply(this,arguments)},setSrc:function(src){this.options.src=src,this.element.attr("src",src)},getSrc:function(){return this.options.src},setName:function(name){this.options.name=name,this.element.attr("name",name)},getName:function(){return this.options.name}}),BI.shortcut("bi.iframe",BI.Iframe),BI.Img=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Img.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"img",baseCls:(conf.baseCls||"")+" bi-img display-block",src:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var o=this.options;o.attributes.src=o.src,BI.Img.superclass._init.apply(this,arguments)},setSrc:function(src){this.options.src=src,this.element.attr("src",src)},getSrc:function(){return this.options.src}}),BI.shortcut("bi.img",BI.Img),BI.ImageCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.ImageCheckbox.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-image-checkbox check-box-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})}}),BI.ImageCheckbox.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_checkbox",BI.ImageCheckbox),BI.Checkbox=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-checkbox",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16},render:function(){var self=this,o=this.options;return{type:"bi.center_adapt",items:[{type:"bi.default",ref:function(_ref){self.checkbox=_ref},cls:"checkbox-content",width:o.iconWidth-2,height:o.iconHeight-2}]}},_setEnable:function(enable){BI.Checkbox.superclass._setEnable.apply(this,arguments),enable===!0?this.checkbox.element.removeClass("base-disabled disabled"):this.checkbox.element.addClass("base-disabled disabled")},doClick:function(){BI.Checkbox.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Checkbox.EVENT_CHANGE)},setSelected:function(b){BI.Checkbox.superclass.setSelected.apply(this,arguments),b?this.checkbox.element.addClass("bi-high-light-background"):this.checkbox.element.removeClass("bi-high-light-background")}}),BI.Checkbox.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.checkbox",BI.Checkbox),function(document){var F=function(item){return function(input){var files=input.files||[input];return files.item||(files.item=item),files}}(function(i){return this[i]}),event={add:document.addEventListener?function(node,name,callback){return node.addEventListener(name,callback,!1),this}:function(node,name,callback){return node.attachEvent("on"+name,callback),this},del:document.removeEventListener?function(node,name,callback){return node.removeEventListener(name,callback,!1),this}:function(node,name,callback){return node.detachEvent("on"+name,callback),this},stop:function(e){return e?(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1):self.event&&(event.returnValue=!(event.cancelBubble=!0)),!1}},sendFile=function(toString){var multipart=function(boundary,name,file){return"--".concat(boundary,CRLF,'Content-Disposition: form-data; name="',name,'"; filename="',_global.encodeURIComponent(file.fileName),'"',CRLF,"Content-Type: application/octet-stream",CRLF,CRLF,file.getAsBinary(),CRLF,"--",boundary,"--",CRLF)},isFunction=function(Function){return"[object Function]"===toString.call(Function)},split="onabort.onerror.onloadstart.onprogress".split("."),length=split.length,CRLF="\r\n",xhr=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),sendFile;return sendFile=xhr.upload||xhr.sendAsBinary?function(handler,maxSize,width,height){if(-1'),iframe=handler.iframe||(handler.iframe=document.createElement(''))}catch(e){var form=document.createElement("form"),iframe=handler.iframe||(handler.iframe=document.createElement("iframe"));form.setAttribute("enctype","multipart/form-data"),iframe.setAttribute("name",iframe.id=target),iframe.setAttribute("src",url)}with(iframe.style.position="absolute",iframe.style.left=iframe.style.top="-10000px",iframe.onload=onload,iframe.onerror=function(event){isFunction(handler.onerror)&&handler.onerror(rpe,event||_global.event)},iframe.onreadystatechange=function(){/loaded|complete/i.test(iframe.readyState)?onload():isFunction(handler.onloadprogress)&&(rpe.loadedxhr.status||xhr.status>399)return BI.Msg.toast(BI.i18nText("BI-Upload_File_Error"),{level:"error"}),void self.fireEvent(BI.File.EVENT_ERROR);var error=BI.some(_wrap.attach_array,function(index,attach){if(attach.errorCode)return BI.Msg.toast(attach.errorMsg,{level:"error"}),self.fireEvent(BI.File.EVENT_ERROR,attach),!0});!error&&self.fireEvent(BI.File.EVENT_UPLOADED)},1e3)},_wrap.url=o.url,_wrap.fileType=o.accept,_wrap.attach_array=[],_wrap.attach_names=[],_wrap.attachNum=0},_events:function(wrap){var self=this;return event.add(wrap.dom.input,"change",function(){event.del(wrap.dom.input,"change",arguments.callee);for(var input=wrap.dom.input.cloneNode(!0),i=0,files=F(wrap.dom.input);i0&&self.fireEvent(BI.File.EVENT_CHANGE,{files:wrap.files}),input.value="",wrap.dom.input.parentNode.replaceChild(input,wrap.dom.input),wrap.dom.input=input,event.add(wrap.dom.input,"change",arguments.callee)}),wrap},_wrap:function(){var self=this,o=this.options,input=this.element[0];return o.multiple===!0&&this.element.attr("multiple","multiple"),input.value="",this._events({dom:{input:input,disabled:!1},name:input.name,maxSize:o.maxSize?o.maxSize>>0:-1,files:[],clean:function(){this.files=[]},upload:function(handler){if(handler)for(var key in handler)this[key]=handler[key];return sendFiles(this,this.maxSize),this},hide:function(){this.dom.disabled&&(this.dom.disabled=!1,this.dom.input.removeAttribute("disabled"))},show:function(total,current,totalProp,currentProp){this.dom.disabled||(this.dom.disabled=!0,this.dom.input.setAttribute("disabled","disabled"))}})},select:function(){this.wrap&&BI.Widget._renderEngine.createElement(this.wrap.dom.input).click()},upload:function(handler){this.wrap&&this.wrap.upload(handler)},getValue:function(){return this.wrap?this.wrap.attach_array:[]},reset:function(){this.wrap&&(this.wrap.attach_array=[],this.wrap.attach_names=[],this.wrap.attachNum=0)},_setEnable:function(enable){BI.File.superclass._setEnable.apply(this,arguments),enable===!0?this.element.attr("disabled","disabled"):this.element.removeAttr("disabled")}}),BI.File.EVENT_CHANGE="EVENT_CHANGE",BI.File.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.File.EVENT_ERROR="EVENT_ERROR",BI.File.EVENT_PROGRESS="EVENT_PROGRESS",BI.File.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.file",BI.File)}(_global.document||{}),BI.Input=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Input.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-input display-block overflow-dot",tagName:"input",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1})},_init:function(){BI.Input.superclass._init.apply(this,arguments);var self=this,ctrlKey=!1,keyCode=null,inputEventValid=!1,_keydown=BI.debounce(function(keyCode){self.onKeyDown(keyCode,ctrlKey),self._keydown_=!1},300),_clk=BI.debounce(BI.bind(this._click,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});this._focusDebounce=BI.debounce(BI.bind(this._focus,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this._blurDebounce=BI.debounce(BI.bind(this._blur,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this.element.keydown(function(e){inputEventValid=!1,ctrlKey=e.ctrlKey||e.metaKey,keyCode=e.keyCode,self.fireEvent(BI.Input.EVENT_QUICK_DOWN,arguments)}).keyup(function(e){keyCode=null,inputEventValid&&e.keyCode===BI.KeyCode.ENTER||(self._keydown_=!0,_keydown(e.keyCode))}).on("input propertychange",function(e){var originalEvent=e.originalEvent;(BI.isNull(originalEvent.propertyName)||"value"===originalEvent.propertyName)&&(inputEventValid=!0,self._keydown_=!0,_keydown(keyCode),keyCode=null)}).click(function(e){e.stopPropagation(),_clk()}).mousedown(function(e){self.element.val(self.element.val())}).focus(function(e){self._focusDebounce()}).focusout(function(e){self._blurDebounce()}),(BI.isKey(this.options.value)||BI.isEmptyString(this.options.value))&&this.setValue(this.options.value)},_focus:function(){this.element.addClass("bi-input-focus"),this._checkValidationOnValueChange(),this._isEditing=!0,""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this.fireEvent(BI.Input.EVENT_FOCUS)},_blur:function(){function blur(){if(self.isValid()||self.options.quitChecker.apply(self,[BI.trim(self.getValue())])===!1||(self.element.val(self._lastValidValue?self._lastValidValue:""),self._checkValidationOnValueChange(),self._defaultState()),self.element.removeClass("bi-input-focus"),self._isEditing=!1,self._start=!1,self.isValid()){var lastValidValue=self._lastValidValue;self._lastValidValue=self.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CONFIRM,self.getValue(),self),self.fireEvent(BI.Input.EVENT_CONFIRM),self._lastValidValue!==lastValidValue&&self.fireEvent(BI.Input.EVENT_CHANGE_CONFIRM)}self.fireEvent(BI.Input.EVENT_BLUR)}var self=this;self._keydown_===!0?BI.delay(blur,300):blur()},_click:function(){this._isEditing!==!0&&(this.selectAll(),this.fireEvent(BI.Input.EVENT_CLICK))},onClick:function(){this._click()},onKeyDown:function(keyCode,ctrlKey){this.isValid()&&BI.trim(this._lastChangedValue)===BI.trim(this.getValue())||this._checkValidationOnValueChange(),this.isValid()&&""!==BI.trim(this.getValue())&&((BI.trim(this.getValue())===this._lastValue||this._start&&null!=this._lastValue&&""!==this._lastValue)&&(this._pause!==!0||/(\s|\u00A0)$/.test(this.getValue()))||(this._start=!0,this._pause=!1,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STARTEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_START))),keyCode==BI.KeyCode.ENTER&&(this.isValid()||this.options.quitChecker.apply(this,[BI.trim(this.getValue())])!==!1?(this.blur(),this.fireEvent(BI.Input.EVENT_ENTER)):this.fireEvent(BI.Input.EVENT_RESTRICT)),keyCode==BI.KeyCode.SPACE&&this.fireEvent(BI.Input.EVENT_SPACE),keyCode==BI.KeyCode.BACKSPACE&&""==this._lastValue&&this.fireEvent(BI.Input.EVENT_REMOVE),keyCode!=BI.KeyCode.BACKSPACE&&keyCode!=BI.KeyCode.DELETE||this.fireEvent(BI.Input.EVENT_BACKSPACE),this.fireEvent(BI.Input.EVENT_KEY_DOWN,arguments);var lastValue=this._lastValue;BI.trim(this.getValue())!==BI.trim(this._lastValue||"")&&this._valueChange(),BI.isEndWithBlank(this.getValue())?(this._pause=!0,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.PAUSE,"",this),this.fireEvent(BI.Input.EVENT_PAUSE),this._defaultState()):keyCode!==BI.KeyCode.BACKSPACE&&keyCode!==BI.KeyCode.DELETE||""!==BI.trim(this.getValue())||null===lastValue||""===BI.trim(lastValue)||(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_STOP))},_defaultState:function(){""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue(),this._lastSubmitValue=null},_valueChange:function(){this.isValid()&&BI.trim(this.getValue())!==this._lastSubmitValue&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CHANGE,this.getValue(),this),this.fireEvent(BI.Input.EVENT_CHANGE),this._lastSubmitValue=BI.trim(this.getValue())),""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue()},_checkValidationOnValueChange:function(){var o=this.options,v=this.getValue();this.setValid(o.allowBlank===!0&&""==BI.trim(v)||BI.isNotEmptyString(BI.trim(v))&&o.validationChecker.apply(this,[BI.trim(v)])!==!1)},focus:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能focus");!this._isEditing==!0&&(this.element.focus(),this.selectAll())},blur:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能blur");this._isEditing===!0&&(this.element.blur(),this._blurDebounce())},selectAll:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能select");this.element.select(),this._isEditing=!0},setValue:function(textValue){this.element.val(textValue),BI.nextTick(BI.bind(function(){this._checkValidationOnValueChange(),this._defaultState(),this.isValid()&&(this._lastValidValue=this._lastSubmitValue=this.getValue())},this))},getValue:function(){return this.element.val()||""},isEditing:function(){return this._isEditing},getLastValidValue:function(){return this._lastValidValue},getLastChangedValue:function(){return this._lastChangedValue},_setValid:function(){BI.Input.superclass._setValid.apply(this,arguments),this.isValid()?(this._lastChangedValue=this.getValue(),this.element.removeClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_VALID,BI.trim(this.getValue()),this)):(this._lastChangedValue===this.getValue()&&(this._lastChangedValue=null),this.element.addClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_ERROR,BI.trim(this.getValue()),this))},_setEnable:function(b){BI.Input.superclass._setEnable.apply(this,[b]),this.element[0].disabled=!b}}),BI.Input.EVENT_CHANGE="EVENT_CHANGE",BI.Input.EVENT_FOCUS="EVENT_FOCUS",BI.Input.EVENT_CLICK="EVENT_CLICK",BI.Input.EVENT_BLUR="EVENT_BLUR",BI.Input.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Input.EVENT_QUICK_DOWN="EVENT_QUICK_DOWN",BI.Input.EVENT_SPACE="EVENT_SPACE",BI.Input.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Input.EVENT_START="EVENT_START",BI.Input.EVENT_PAUSE="EVENT_PAUSE",BI.Input.EVENT_STOP="EVENT_STOP",BI.Input.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Input.EVENT_CONFIRM="EVENT_CONFIRM",BI.Input.EVENT_REMOVE="EVENT_REMOVE",BI.Input.EVENT_EMPTY="EVENT_EMPTY",BI.Input.EVENT_VALID="EVENT_VALID",BI.Input.EVENT_ERROR="EVENT_ERROR",BI.Input.EVENT_ENTER="EVENT_ENTER",BI.Input.EVENT_RESTRICT="EVENT_RESTRICT",BI.shortcut("bi.input",BI.Input),BI.ImageRadio=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.ImageRadio.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-radio radio-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})},_init:function(){BI.ImageRadio.superclass._init.apply(this,arguments)},doClick:function(){BI.ImageRadio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageRadio.EVENT_CHANGE)}}),BI.ImageRadio.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_radio",BI.ImageRadio),BI.Radio=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-radio",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:14,iconHeight:14},render:function(){var self=this,o=this.options;return{type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"radio-content",ref:function(_ref){self.radio=_ref},width:o.iconWidth,height:o.iconHeight}]}},_setEnable:function(enable){BI.Radio.superclass._setEnable.apply(this,arguments),enable===!0?this.radio.element.removeClass("base-disabled disabled"):this.radio.element.addClass("base-disabled disabled")},doClick:function(){BI.Radio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Radio.EVENT_CHANGE)},setSelected:function(b){BI.Radio.superclass.setSelected.apply(this,arguments),b?this.radio.element.addClass("bi-high-light-background"):this.radio.element.removeClass("bi-high-light-background")}}),BI.Radio.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.radio",BI.Radio),BI.AbstractLabel=BI.inherit(BI.Single,{_defaultConfig:function(props){var conf=BI.AbstractLabel.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1})},_createJson:function(){var o=this.options;return{type:"bi.text",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value,py:o.py,keyword:o.keyword,highLight:o.highLight}},_init:function(){BI.AbstractLabel.superclass._init.apply(this,arguments),"center"===this.options.textAlign?this._createCenterEl():this._createNotCenterEl()},_createCenterEl:function(){var o=this.options,json=this._createJson();return json.textAlign="left",BI.isNumber(o.width)&&o.width>0?BI.isNumber(o.textWidth)&&o.textWidth>0?(json.maxWidth=o.textWidth,BI.isNumber(o.height)&&o.height>0?void BI.createWidget({type:"bi.center_adapt",height:o.height,scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]}):void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]})):"normal"==o.whiteSpace?(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[this.text]})):BI.isNumber(o.height)&&o.height>0?(this.element.css({"line-height":o.height+"px"}),json.textAlign=o.textAlign,void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,maxWidth:"100%"}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[this.text]})):BI.isNumber(o.textWidth)&&o.textWidth>0?(json.maxWidth=o.textWidth,void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]})):"normal"==o.whiteSpace?(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[this.text]})):BI.isNumber(o.height)&&o.height>0?(this.element.css({"line-height":o.height+"px"}),json.textAlign=o.textAlign,void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(BI.extend(json,{maxWidth:"100%"})),void BI.createWidget({type:"bi.center_adapt",element:this,items:[this.text]}))},_createNotCenterEl:function(){var o=this.options,adaptLayout="right"===o.textAlign?"bi.right_vertical_adapt":"bi.vertical_adapt",json=this._createJson();return BI.isNumber(o.width)&&o.width>0?BI.isNumber(o.textWidth)&&o.textWidth>0?(json.width=o.textWidth,BI.isNumber(o.height)&&o.height>0?void BI.createWidget({type:adaptLayout,height:o.height,scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]}):void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.height)&&o.height>0?(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})),void("normal"!==o.whiteSpace&&this.element.css({"line-height":o.height-2*o.vgap+"px"}))):(json.width=o.width-2*o.hgap-o.lgap-o.rgap,void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.textWidth)&&o.textWidth>0?(json.width=o.textWidth,void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.height)&&o.height>0?("normal"!==o.whiteSpace&&this.element.css({"line-height":o.height-2*o.vgap+"px"}),void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(BI.extend(json,{maxWidth:"100%"})),void BI.createWidget({type:adaptLayout,element:this,items:[this.text]}))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(v){this.options.text=v,this.text.setText(v)},getText:function(){return this.options.text},setStyle:function(css){this.text.setStyle(css)},setValue:function(v){BI.AbstractLabel.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(v)},populate:function(){BI.AbstractLabel.superclass.populate.apply(this,arguments)}}),BI.HtmlLabel=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-html-label"},_createJson:function(){var o=this.options;return{type:"bi.html",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value}}}),BI.shortcut("bi.html_label",BI.HtmlLabel),BI.IconLabel=BI.inherit(BI.Single,{props:{baseCls:"bi-icon-label horizon-center",iconWidth:null,iconHeight:null},_init:function(){BI.IconLabel.superclass._init.apply(this,arguments);var o=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:o.iconWidth,height:o.iconHeight}),BI.isNumber(o.height)&&o.height>0&&BI.isNull(o.iconWidth)&&BI.isNull(o.iconHeight)?(this.element.css("lineHeight",o.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))}}),BI.shortcut("bi.icon_label",BI.IconLabel),BI.Label=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-label",py:"",keyword:""},_createJson:function(){var o=this.options;return{type:"bi.text",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value,py:o.py,keyword:o.keyword,highLight:o.highLight}},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.shortcut("bi.label",BI.Label),BI.Link=BI.inherit(BI.Label,{_defaultConfig:function(){var conf=BI.Link.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-link display-block",tagName:"a",href:"",target:"_blank"})},_createJson:function(){var o=this.options;return{type:"bi.a",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,keyword:o.keyword,value:o.value,py:o.py,href:o.href,target:o.target}},_init:function(){BI.Link.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.link",BI.Link),BI.Bubble=BI.inherit(BI.Tip,{_defaultConfig:function(){return BI.extend(BI.Bubble.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble",direction:"top",text:"",level:"error",height:18})},_init:function(){BI.Bubble.superclass._init.apply(this,arguments);var fn=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn}),BI.createWidget({type:"bi.left",element:this,items:[this["_"+this.options.direction]()]})},_createBubbleText:function(){var o=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"bubble-text bubble-"+o.level,text:o.text,hgap:5,height:18})},_top:function(){return BI.createWidget({type:"bi.vertical",items:[{el:this._createBubbleText(),height:18},{el:{type:"bi.layout"},height:3}]})},_bottom:function(){return BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout"},height:3},{el:this._createBubbleText(),height:18}]})},_left:function(){return BI.createWidget({type:"bi.right",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},_right:function(){return BI.createWidget({type:"bi.left",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.bubble",BI.Bubble),BI.Toast=BI.inherit(BI.Tip,{_const:{minWidth:200,hgap:10},_defaultConfig:function(){return BI.extend(BI.Toast.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-toast",text:"",level:"success"})},_init:function(){BI.Toast.superclass._init.apply(this,arguments);var self=this,o=this.options;this.element.css({minWidth:this._const.minWidth+"px"}),this.element.addClass("toast-"+o.level);var fn=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn});var cls="close-font";switch(o.level){case"success":cls="toast-success-font";break;case"error":cls="toast-error-font";break;case"warning":cls="toast-warning-font";break;case"normal":default:cls="toast-message-font"}var items=[{type:"bi.icon_label",cls:cls+" toast-icon",width:36},{el:{type:"bi.label",whiteSpace:"normal",text:o.text,textHeight:16,textAlign:"left"},rgap:o.autoClose?this._const.hgap:0}],columnSize=[36,""];o.autoClose===!1&&(items.push({type:"bi.icon_button",cls:"close-font toast-icon",handler:function(){self.destroy()},width:36}),columnSize.push(36)),this.text=BI.createWidget({type:"bi.horizontal_adapt",element:this,items:items,vgap:7,columnSize:columnSize})},setText:function(text){this.text.setText(text)},beforeDestroy:function(){this.fireEvent(BI.Toast.EVENT_DESTORY)}}),BI.Toast.EVENT_DESTORY="EVENT_DESTORY",BI.shortcut("bi.toast",BI.Toast),BI.Tooltip=BI.inherit(BI.Tip,{_const:{hgap:5,vgap:3},_defaultConfig:function(){return BI.extend(BI.Tooltip.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tooltip",text:"",level:"success",stopEvent:!1,stopPropagation:!1})},_init:function(){BI.Tooltip.superclass._init.apply(this,arguments);var self=this,o=this.options;this.element.addClass("tooltip-"+o.level);var fn=function(e){o.stopPropagation&&e.stopPropagation(),o.stopEvent&&e.stopEvent()};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn});var texts=(o.text+"").split("\n");texts.length>1?BI.createWidget({type:"bi.vertical",element:this,hgap:this._const.hgap,items:BI.map(texts,function(i,text){return{type:"bi.label",textAlign:"left",whiteSpace:"normal",text:text,textHeight:18}})}):this.text=BI.createWidget({type:"bi.label",element:this,textAlign:"left",whiteSpace:"normal",text:o.text,textHeight:18,hgap:this._const.hgap})},setWidth:function(width){this.element.width(width-2*this._const.hgap)},setText:function(text){this.text&&this.text.setText(text)},setLevel:function(level){this.element.removeClass("tooltip-success").removeClass("tooltip-warning"),this.element.addClass("tooltip-"+level)}}),BI.shortcut("bi.tooltip",BI.Tooltip),BI.Trigger=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Trigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-trigger cursor-pointer",height:24})},_init:function(){BI.Trigger.superclass._init.apply(this,arguments)},setKey:function(){},getKey:function(){}}),BI.CustomTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-tree",expander:{el:{},popup:{type:"bi.custom_tree"}},items:[],itemsCreator:BI.emptyFn,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.CustomTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(nodes){var self=this,o=this.options;nodes=BI.Tree.transformToTreeFormat(nodes);var items=[];return BI.each(nodes,function(i,node){if(BI.isNotEmptyArray(node.children)||node.isParent===!0){var item=BI.extend({type:"bi.expander",el:{value:node.value},popup:{type:"bi.custom_tree"}},BI.deepClone(o.expander),{id:node.id,pId:node.pId}),el=BI.stripEL(node);BI.isWidget(el)?item.el=el:(el=BI.clone(el),delete el.children,BI.extend(item.el,el)),item.popup.expander=BI.deepClone(o.expander),item.items=item.popup.items=node.children,item.itemsCreator=item.popup.itemsCreator=function(op){if(BI.isNotNull(op.node))return o.itemsCreator.apply(self,arguments);var args=Array.prototype.slice.call(arguments,0);return args[0].node=node,o.itemsCreator.apply(self,args)},BI.isNull(item.popup.el)&&(item.popup.el=BI.deepClone(o.el)),items.push(item)}else items.push(node)}),items},initTree:function(nodes){var self=this,o=this.options;this.tree=BI.createWidget(o.el,{element:this,items:this._formatItems(nodes),itemsCreator:function(op,callback){o.itemsCreator.apply(this,[op,function(items){var args=Array.prototype.slice.call(arguments,0);args[0]=self._formatItems(items),callback.apply(null,args)}])},value:o.value}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.CustomTree.EVENT_CHANGE,val,obj)})},stroke:function(nodes){this.populate.apply(this,arguments)},populate:function(nodes){var args=Array.prototype.slice.call(arguments,0);arguments.length>0&&(args[0]=this._formatItems(nodes)),this.tree.populate.apply(this.tree,args)},setValue:function(v){this.tree&&this.tree.setValue(v)},getValue:function(){return this.tree?this.tree.getValue():[]},getAllButtons:function(){return this.tree?this.tree.getAllButtons():[]},getAllLeaves:function(){return this.tree?this.tree.getAllLeaves():[]},getNodeById:function(id){return this.tree&&this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree&&this.tree.getNodeByValue(id)},empty:function(){this.tree.empty()}}),BI.CustomTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_tree",BI.CustomTree),function($){var settings={},roots={},caches={},_consts={className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"},id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_setting={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast", +fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},_initRoot=function(setting){var r=data.getRoot(setting);r||(r={},data.setRoot(setting,r)),r[setting.data.key.children]=[],r.expandTriggerFlag=!1,r.curSelectedList=[],r.noSelection=!0,r.createdNodes=[],r.zId=0,r._ver=(new Date).getTime()},_initCache=function(setting){var c=data.getCache(setting);c||(c={},data.setCache(setting,c)),c.nodes=[],c.doms=[]},_bindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.bind(c.NODECREATED,function(event,treeId,node){tools.apply(setting.callback.onNodeCreated,[event,treeId,node])}),o.bind(c.CLICK,function(event,srcEvent,treeId,node,clickFlag){tools.apply(setting.callback.onClick,[srcEvent,treeId,node,clickFlag])}),o.bind(c.EXPAND,function(event,treeId,node){tools.apply(setting.callback.onExpand,[event,treeId,node])}),o.bind(c.COLLAPSE,function(event,treeId,node){tools.apply(setting.callback.onCollapse,[event,treeId,node])}),o.bind(c.ASYNC_SUCCESS,function(event,treeId,node,msg){tools.apply(setting.callback.onAsyncSuccess,[event,treeId,node,msg])}),o.bind(c.ASYNC_ERROR,function(event,treeId,node,XMLHttpRequest,textStatus,errorThrown){tools.apply(setting.callback.onAsyncError,[event,treeId,node,XMLHttpRequest,textStatus,errorThrown])}),o.bind(c.REMOVE,function(event,treeId,treeNode){tools.apply(setting.callback.onRemove,[event,treeId,treeNode])}),o.bind(c.SELECTED,function(event,srcEvent,treeId,node){tools.apply(setting.callback.onSelected,[srcEvent,treeId,node])}),o.bind(c.UNSELECTED,function(event,srcEvent,treeId,node){tools.apply(setting.callback.onUnSelected,[srcEvent,treeId,node])})},_unbindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.unbind(c.NODECREATED).unbind(c.CLICK).unbind(c.EXPAND).unbind(c.COLLAPSE).unbind(c.ASYNC_SUCCESS).unbind(c.ASYNC_ERROR).unbind(c.REMOVE).unbind(c.SELECTED).unbind(c.UNSELECTED)},_eventProxy=function(event){var target=event.target,setting=data.getSetting(event.data.treeId),tId="",node=null,nodeEventType="",treeEventType="",nodeEventCallback=null,treeEventCallback=null,tmp=null;if(tools.eqs(event.type,"mousedown")?treeEventType="mousedown":tools.eqs(event.type,"mouseup")?treeEventType="mouseup":tools.eqs(event.type,"contextmenu")?treeEventType="contextmenu":tools.eqs(event.type,"click")?tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.SWITCH)?(tId=tools.getNodeMainDom(target).id,nodeEventType="switchNode"):(tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id,nodeEventType="clickNode")):tools.eqs(event.type,"dblclick")&&(treeEventType="dblclick",tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id,nodeEventType="switchNode")),treeEventType.length>0&&0==tId.length&&(tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id)),tId.length>0)switch(node=data.getNodeCache(setting,tId),nodeEventType){case"switchNode":node.isParent&&(tools.eqs(event.type,"click")||tools.eqs(event.type,"dblclick")&&tools.apply(setting.view.dblClickExpand,[setting.treeId,node],setting.view.dblClickExpand))?nodeEventCallback=handler.onSwitchNode:nodeEventType="";break;case"clickNode":nodeEventCallback=handler.onClickNode}switch(treeEventType){case"mousedown":treeEventCallback=handler.onZTreeMousedown;break;case"mouseup":treeEventCallback=handler.onZTreeMouseup;break;case"dblclick":treeEventCallback=handler.onZTreeDblclick;break;case"contextmenu":treeEventCallback=handler.onZTreeContextmenu}var proxyResult={stop:!1,node:node,nodeEventType:nodeEventType,nodeEventCallback:nodeEventCallback,treeEventType:treeEventType,treeEventCallback:treeEventCallback};return proxyResult},_initNode=function(setting,level,n,parentNode,isFirstNode,isLastNode,openFlag){if(n){var r=data.getRoot(setting),childKey=setting.data.key.children;n.level=level,n.tId=setting.treeId+"_"+ ++r.zId,n.parentTId=parentNode?parentNode.tId:null,n.open="string"==typeof n.open?tools.eqs(n.open,"true"):!!n.open,n[childKey]&&n[childKey].length>0?(n.isParent=!0,n.zAsync=!0):(n.isParent="string"==typeof n.isParent?tools.eqs(n.isParent,"true"):!!n.isParent,n.open=!(!n.isParent||setting.async.enable)&&n.open,n.zAsync=!n.isParent),n.isFirstNode=isFirstNode,n.isLastNode=isLastNode,n.getParentNode=function(){return data.getNodeCache(setting,n.parentTId)},n.getPreNode=function(){return data.getPreNode(setting,n)},n.getNextNode=function(){return data.getNextNode(setting,n)},n.isAjaxing=!1,data.fixPIdKeyValue(setting,n)}},_init={bind:[_bindEvent],unbind:[_unbindEvent],caches:[_initCache],nodes:[_initNode],proxys:[_eventProxy],roots:[_initRoot],beforeA:[],afterA:[],innerBeforeA:[],innerAfterA:[],zTreeTools:[]},data={addNodeCache:function(setting,node){data.getCache(setting).nodes[data.getNodeCacheId(node.tId)]=node},getNodeCacheId:function(tId){return tId.substring(tId.lastIndexOf("_")+1)},addAfterA:function(afterA){_init.afterA.push(afterA)},addBeforeA:function(beforeA){_init.beforeA.push(beforeA)},addInnerAfterA:function(innerAfterA){_init.innerAfterA.push(innerAfterA)},addInnerBeforeA:function(innerBeforeA){_init.innerBeforeA.push(innerBeforeA)},addInitBind:function(bindEvent){_init.bind.push(bindEvent)},addInitUnBind:function(unbindEvent){_init.unbind.push(unbindEvent)},addInitCache:function(initCache){_init.caches.push(initCache)},addInitNode:function(initNode){_init.nodes.push(initNode)},addInitProxy:function(initProxy,isFirst){isFirst?_init.proxys.splice(0,0,initProxy):_init.proxys.push(initProxy)},addInitRoot:function(initRoot){_init.roots.push(initRoot)},addNodesData:function(setting,parentNode,nodes){var childKey=setting.data.key.children;parentNode[childKey]||(parentNode[childKey]=[]),parentNode[childKey].length>0&&(parentNode[childKey][parentNode[childKey].length-1].isLastNode=!1,view.setNodeLineIcos(setting,parentNode[childKey][parentNode[childKey].length-1])),parentNode.isParent=!0,parentNode[childKey]=parentNode[childKey].concat(nodes)},addSelectedNode:function(setting,node){var root=data.getRoot(setting);data.isSelectedNode(setting,node)||root.curSelectedList.push(node)},addCreatedNode:function(setting,node){if(setting.callback.onNodeCreated||setting.view.addDiyDom){var root=data.getRoot(setting);root.createdNodes.push(node)}},addZTreeTools:function(zTreeTools){_init.zTreeTools.push(zTreeTools)},exSetting:function(s){$.extend(!0,_setting,s)},fixPIdKeyValue:function(setting,node){setting.data.simpleData.enable&&(node[setting.data.simpleData.pIdKey]=node.parentTId?node.getParentNode()[setting.data.simpleData.idKey]:setting.data.simpleData.rootPId)},getAfterA:function(setting,node,array){for(var i=0,j=_init.afterA.length;i-1&&result.push(nodes[i]),result=result.concat(data.getNodesByParamFuzzy(setting,nodes[i][childKey],key,value));return result},getNodesByFilter:function(setting,nodes,filter,isSingle,invokeParam){if(!nodes)return isSingle?null:[];for(var childKey=setting.data.key.children,result=isSingle?null:[],i=0,l=nodes.length;i0)},clone:function(obj){if(null===obj)return null;var o=tools.isArray(obj)?[]:{};for(var i in obj)o[i]=obj[i]instanceof Date?new Date(obj[i].getTime()):"object"==typeof obj[i]?arguments.callee(obj[i]):obj[i];return o},eqs:function(str1,str2){return str1.toLowerCase()===str2.toLowerCase()},isArray:function(arr){return"[object Array]"===Object.prototype.toString.apply(arr)},$:function(node,exp,setting){return exp&&"string"!=typeof exp&&(setting=exp,exp=""),"string"==typeof node?$(node,setting?setting.treeObj.get(0).ownerDocument:null):$("#"+node.tId+exp,setting?setting.treeObj:null)},getMDom:function(setting,curDom,targetExpr){if(!curDom)return null;for(;curDom&&curDom.id!==setting.treeId;){for(var i=0,l=targetExpr.length;curDom.tagName&&i0},uCanDo:function(setting,e){return!0}},view={addNodes:function(setting,parentNode,newNodes,isSilent){if(!setting.data.keep.leaf||!parentNode||parentNode.isParent)if(tools.isArray(newNodes)||(newNodes=[newNodes]),setting.data.simpleData.enable&&(newNodes=data.transformTozTreeFormat(setting,newNodes)),parentNode){var target_switchObj=$$(parentNode,consts.id.SWITCH,setting),target_icoObj=$$(parentNode,consts.id.ICON,setting),target_ulObj=$$(parentNode,consts.id.UL,setting);parentNode.open||(view.replaceSwitchClass(parentNode,target_switchObj,consts.folder.CLOSE),view.replaceIcoClass(parentNode,target_icoObj,consts.folder.CLOSE),parentNode.open=!1,target_ulObj.css({display:"none"})),data.addNodesData(setting,parentNode,newNodes),view.createNodes(setting,parentNode.level+1,newNodes,parentNode),isSilent||view.expandCollapseParentNode(setting,parentNode,!0)}else data.addNodesData(setting,data.getRoot(setting),newNodes),view.createNodes(setting,0,newNodes,null)},appendNodes:function(setting,level,nodes,parentNode,initFlag,openFlag){if(!nodes)return[];for(var html=[],childKey=setting.data.key.children,i=0,l=nodes.length;i0&&(childHtml=view.appendNodes(setting,level+1,node[childKey],node,initFlag,openFlag&&node.open)),openFlag&&(view.makeDOMNodeMainBefore(html,setting,node),view.makeDOMNodeLine(html,setting,node),data.getBeforeA(setting,node,html),view.makeDOMNodeNameBefore(html,setting,node),data.getInnerBeforeA(setting,node,html),view.makeDOMNodeIcon(html,setting,node),data.getInnerAfterA(setting,node,html),view.makeDOMNodeNameAfter(html,setting,node),data.getAfterA(setting,node,html),node.isParent&&node.open&&view.makeUlHtml(setting,node,html,childHtml.join("")),view.makeDOMNodeMainAfter(html,setting,node),data.addCreatedNode(setting,node))}return html},appendParentULDom:function(setting,node){var html=[],nObj=$$(node,setting);!nObj.get(0)&&node.parentTId&&(view.appendParentULDom(setting,node.getParentNode()),nObj=$$(node,setting));var ulObj=$$(node,consts.id.UL,setting);ulObj.get(0)&&ulObj.remove();var childKey=setting.data.key.children,childHtml=view.appendNodes(setting,node.level+1,node[childKey],node,!1,!0);view.makeUlHtml(setting,node,html,childHtml.join("")),nObj.append(html.join(""))},asyncNode:function(setting,node,isSilent,callback){var i,l;if(node&&!node.isParent)return tools.apply(callback),!1;if(node&&node.isAjaxing)return!1;if(0==tools.apply(setting.callback.beforeAsync,[setting.treeId,node],!0))return tools.apply(callback),!1;if(node){node.isAjaxing=!0;var icoObj=$$(node,consts.id.ICON,setting);icoObj.attr({style:"","class":consts.className.BUTTON+" "+consts.className.ICO_LOADING})}var tmpParam={};for(i=0,l=setting.async.autoParam.length;node&&i1&&(spKey=pKey[1],pKey=pKey[0]),tmpParam[spKey]=node[pKey]}if(tools.isArray(setting.async.otherParam))for(i=0,l=setting.async.otherParam.length;i=0;i--)if(n=list[i],node===n||!node&&(!excludeNode||excludeNode!==n)){if($$(n,consts.id.A,setting).removeClass(consts.node.CURSELECTED),node){data.removeSelectedNode(setting,node),setting.treeObj.trigger(consts.event.UNSELECTED,[event,setting.treeId,n]);break}list.splice(i,1),setting.treeObj.trigger(consts.event.UNSELECTED,[event,setting.treeId,n])}},createNodeCallback:function(setting){if(setting.callback.onNodeCreated||setting.view.addDiyDom)for(var root=data.getRoot(setting);root.createdNodes.length>0;){var node=root.createdNodes.shift();tools.apply(setting.view.addDiyDom,[setting.treeId,node]),setting.callback.onNodeCreated&&setting.treeObj.trigger(consts.event.NODECREATED,[setting.treeId,node])}},createNodes:function(setting,level,nodes,parentNode){if(nodes&&0!=nodes.length){var root=data.getRoot(setting),childKey=setting.data.key.children,openFlag=!parentNode||parentNode.open||!!$$(parentNode[childKey][0],setting).get(0);root.createdNodes=[];var zTreeHtml=view.appendNodes(setting,level,nodes,parentNode,!0,openFlag);if(parentNode){var ulObj=$$(parentNode,consts.id.UL,setting);ulObj.get(0)&&ulObj.append(zTreeHtml.join(""))}else setting.treeObj.append(zTreeHtml.join(""));view.createNodeCallback(setting)}},destroy:function(setting){setting&&(data.initCache(setting),data.initRoot(setting),event.unbindTree(setting),event.unbindEvent(setting),setting.treeObj.empty(),delete settings[setting.treeId])},expandCollapseNode:function(setting,node,expandFlag,animateFlag,callback){var root=data.getRoot(setting),childKey=setting.data.key.children;if(!node)return void tools.apply(callback,[]);if(root.expandTriggerFlag){var _callback=callback;callback=function(){_callback&&_callback(),node.open?setting.treeObj.trigger(consts.event.EXPAND,[setting.treeId,node]):setting.treeObj.trigger(consts.event.COLLAPSE,[setting.treeId,node])},root.expandTriggerFlag=!1}if(!node.open&&node.isParent&&(!$$(node,consts.id.UL,setting).get(0)||node[childKey]&&node[childKey].length>0&&!$$(node[childKey][0],setting).get(0))&&(view.appendParentULDom(setting,node),view.createNodeCallback(setting)),node.open==expandFlag)return void tools.apply(callback,[]);var ulObj=$$(node,consts.id.UL,setting),switchObj=$$(node,consts.id.SWITCH,setting),icoObj=$$(node,consts.id.ICON,setting);node.isParent?(node.open=!node.open,node.iconOpen&&node.iconClose&&icoObj.attr("style",view.makeNodeIcoStyle(setting,node)),node.open?(view.replaceSwitchClass(node,switchObj,consts.folder.OPEN),view.replaceIcoClass(node,icoObj,consts.folder.OPEN),0==animateFlag||""==setting.view.expandSpeed?(ulObj.show(),tools.apply(callback,[])):node[childKey]&&node[childKey].length>0?ulObj.slideDown(setting.view.expandSpeed,callback):(ulObj.show(),tools.apply(callback,[]))):(view.replaceSwitchClass(node,switchObj,consts.folder.CLOSE),view.replaceIcoClass(node,icoObj,consts.folder.CLOSE),0!=animateFlag&&""!=setting.view.expandSpeed&&node[childKey]&&node[childKey].length>0?ulObj.slideUp(setting.view.expandSpeed,callback):(ulObj.hide(),tools.apply(callback,[])))):tools.apply(callback,[])},expandCollapseParentNode:function(setting,node,expandFlag,animateFlag,callback){if(node){if(!node.parentTId)return void view.expandCollapseNode(setting,node,expandFlag,animateFlag,callback);view.expandCollapseNode(setting,node,expandFlag,animateFlag),node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,animateFlag,callback)}},expandCollapseSonNode:function(setting,node,expandFlag,animateFlag,callback){var root=data.getRoot(setting),childKey=setting.data.key.children,treeNodes=node?node[childKey]:root[childKey],selfAnimateSign=!node&&animateFlag,expandTriggerFlag=data.getRoot(setting).expandTriggerFlag;if(data.getRoot(setting).expandTriggerFlag=!1,treeNodes)for(var i=0,l=treeNodes.length;i=0;i--)if(node===list[i])return!0;return!1},makeDOMNodeIcon:function(html,setting,node){var nameStr=data.getNodeName(setting,node),name=setting.view.nameIsHTML?nameStr:nameStr.replace(/&/g,"&").replace(//g,">");html.push("",name,"")},makeDOMNodeLine:function(html,setting,node){html.push("")},makeDOMNodeMainAfter:function(html,setting,node){html.push("")},makeDOMNodeMainBefore:function(html,setting,node){html.push("
  • ")},makeDOMNodeNameAfter:function(html,setting,node){html.push("")},makeDOMNodeNameBefore:function(html,setting,node){var title=data.getNodeTitle(setting,node),url=view.makeNodeUrl(setting,node),fontcss=view.makeNodeFontCss(setting,node),fontStyle=[];for(var f in fontcss)fontStyle.push(f,":",fontcss[f],";");html.push("0?"href='"+url+"'":""," target='",view.makeNodeTarget(node),"' style='",fontStyle.join(""),"'"),tools.apply(setting.view.showTitle,[setting.treeId,node],setting.view.showTitle)&&title&&html.push("title='",title.replace(/'/g,"'").replace(//g,">"),"'"),html.push(">")},makeNodeFontCss:function(setting,node){var fontCss=tools.apply(setting.view.fontCss,[setting.treeId,node],setting.view.fontCss);return fontCss&&"function"!=typeof fontCss?fontCss:{}},makeNodeIcoClass:function(setting,node){var icoCss=["ico"];return node.isAjaxing||(icoCss[0]=(node.iconSkin?node.iconSkin+"_":"")+icoCss[0],node.isParent?icoCss.push(node.open?consts.folder.OPEN:consts.folder.CLOSE):icoCss.push(consts.folder.DOCU)),consts.className.BUTTON+" "+icoCss.join("_")},makeNodeIcoStyle:function(setting,node){var icoStyle=[];if(!node.isAjaxing){var icon=node.isParent&&node.iconOpen&&node.iconClose?node.open?node.iconOpen:node.iconClose:node.icon;icon&&icoStyle.push("background:url(",icon,") 0 0 no-repeat;"),0!=setting.view.showIcon&&tools.apply(setting.view.showIcon,[setting.treeId,node],!0)||icoStyle.push("width:0px;height:0px;")}return icoStyle.join("")},makeNodeLineClass:function(setting,node){var lineClass=[];return setting.view.showLine?0==node.level&&node.isFirstNode&&node.isLastNode?lineClass.push(consts.line.ROOT):0==node.level&&node.isFirstNode?lineClass.push(consts.line.ROOTS):node.isLastNode?lineClass.push(consts.line.BOTTOM):lineClass.push(consts.line.CENTER):lineClass.push(consts.line.NOLINE),node.isParent?lineClass.push(node.open?consts.folder.OPEN:consts.folder.CLOSE):lineClass.push(consts.folder.DOCU),view.makeNodeLineClassEx(node)+lineClass.join("_")},makeNodeLineClassEx:function(node){return consts.className.BUTTON+" "+consts.className.LEVEL+node.level+" "+consts.className.SWITCH+" "},makeNodeTarget:function(node){return node.target||"_blank"},makeNodeUrl:function(setting,node){var urlKey=setting.data.key.url;return node[urlKey]?node[urlKey]:null},makeUlHtml:function(setting,node,html,content){html.push("
      "),html.push(content),html.push("
    ")},makeUlLineClass:function(setting,node){return setting.view.showLine&&!node.isLastNode?consts.line.LINE:""},removeChildNodes:function(setting,node){if(node){var childKey=setting.data.key.children,nodes=node[childKey];if(nodes){for(var i=0,l=nodes.length;i0&&(parentNode[childKey][0].isFirstNode=!0)},setLastNode:function(setting,parentNode){var childKey=setting.data.key.children,childLength=parentNode[childKey].length;childLength>0&&(parentNode[childKey][childLength-1].isLastNode=!0)},removeNode:function(setting,node){var root=data.getRoot(setting),childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():root;if(node.isFirstNode=!1,node.isLastNode=!1,node.getPreNode=function(){return null},node.getNextNode=function(){return null},data.getNodeCache(setting,node.tId)){$$(node,setting).remove(),data.removeNodeCache(setting,node),data.removeSelectedNode(setting,node); +for(var i=0,l=parentNode[childKey].length;i0){var newLast=parentNode[childKey][childLength-1];if(tmp_ulObj=$$(newLast,consts.id.UL,setting),tmp_switchObj=$$(newLast,consts.id.SWITCH,setting),tmp_icoObj=$$(newLast,consts.id.ICON,setting),parentNode==root)if(1==parentNode[childKey].length)view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.ROOT);else{var tmp_first_switchObj=$$(parentNode[childKey][0],consts.id.SWITCH,setting);view.replaceSwitchClass(parentNode[childKey][0],tmp_first_switchObj,consts.line.ROOTS),view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.BOTTOM)}else view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.BOTTOM);tmp_ulObj.removeClass(consts.line.LINE)}}else parentNode.isParent=!1,parentNode.open=!1,tmp_ulObj=$$(parentNode,consts.id.UL,setting),tmp_switchObj=$$(parentNode,consts.id.SWITCH,setting),tmp_icoObj=$$(parentNode,consts.id.ICON,setting),view.replaceSwitchClass(parentNode,tmp_switchObj,consts.folder.DOCU),view.replaceIcoClass(parentNode,tmp_icoObj,consts.folder.DOCU),tmp_ulObj.css("display","none")}},replaceIcoClass:function(node,obj,newName){if(obj&&!node.isAjaxing){var tmpName=obj.attr("class");if(void 0!=tmpName){var tmpList=tmpName.split("_");switch(newName){case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:tmpList[tmpList.length-1]=newName}obj.attr("class",tmpList.join("_"))}}},replaceSwitchClass:function(node,obj,newName){if(obj){var tmpName=obj.attr("class");if(void 0!=tmpName){var tmpList=tmpName.split("_");switch(newName){case consts.line.ROOT:case consts.line.ROOTS:case consts.line.CENTER:case consts.line.BOTTOM:case consts.line.NOLINE:tmpList[0]=view.makeNodeLineClassEx(node)+newName;break;case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:tmpList[1]=newName}obj.attr("class",tmpList.join("_")),newName!==consts.folder.DOCU?obj.removeAttr("disabled"):obj.attr("disabled","disabled")}}},selectNode:function(setting,node,addFlag){addFlag||view.cancelPreSelectedNode(setting,null,node),$$(node,consts.id.A,setting).addClass(consts.node.CURSELECTED),data.addSelectedNode(setting,node),setting.treeObj.trigger(consts.event.SELECTED,[event,setting.treeId,node])},setNodeFontCss:function(setting,treeNode){var aObj=$$(treeNode,consts.id.A,setting),fontCss=view.makeNodeFontCss(setting,treeNode);fontCss&&aObj.css(fontCss)},setNodeLineIcos:function(setting,node){if(node){var switchObj=$$(node,consts.id.SWITCH,setting),ulObj=$$(node,consts.id.UL,setting),icoObj=$$(node,consts.id.ICON,setting),ulLine=view.makeUlLineClass(setting,node);0==ulLine.length?ulObj.removeClass(consts.line.LINE):ulObj.addClass(ulLine),switchObj.attr("class",view.makeNodeLineClass(setting,node)),node.isParent?switchObj.removeAttr("disabled"):switchObj.attr("disabled","disabled"),icoObj.removeAttr("style"),icoObj.attr("style",view.makeNodeIcoStyle(setting,node)),icoObj.attr("class",view.makeNodeIcoClass(setting,node))}},setNodeName:function(setting,node){var title=data.getNodeTitle(setting,node),nObj=$$(node,consts.id.SPAN,setting);if(nObj.empty(),setting.view.nameIsHTML?nObj.html(data.getNodeName(setting,node)):nObj.text(data.getNodeName(setting,node)),tools.apply(setting.view.showTitle,[setting.treeId,node],setting.view.showTitle)){var aObj=$$(node,consts.id.A,setting);aObj.attr("title",title?title:"")}},setNodeTarget:function(setting,node){var aObj=$$(node,consts.id.A,setting);aObj.attr("target",view.makeNodeTarget(node))},setNodeUrl:function(setting,node){var aObj=$$(node,consts.id.A,setting),url=view.makeNodeUrl(setting,node);null==url||0==url.length?aObj.removeAttr("href"):aObj.attr("href",url)},switchNode:function(setting,node){if(node.open||!tools.canAsync(setting,node))view.expandCollapseNode(setting,node,!node.open);else if(setting.async.enable){if(!view.asyncNode(setting,node))return void view.expandCollapseNode(setting,node,!node.open)}else node&&view.expandCollapseNode(setting,node,!node.open)}};$.fn.zTree={consts:_consts,_z:{tools:tools,view:view,event:event,data:data},getZTreeObj:function(treeId){var o=data.getZTreeTools(treeId);return o?o:null},destroy:function(treeId){if(treeId&&treeId.length>0)view.destroy(data.getSetting(treeId));else for(var s in settings)view.destroy(settings[s])},init:function(obj,zSetting,zNodes){var setting=tools.clone(_setting);$.extend(!0,setting,zSetting),setting.treeId=obj.attr("id"),setting.treeObj=obj,setting.treeObj.empty(),settings[setting.treeId]=setting,"undefined"==typeof document.body.style.maxHeight&&(setting.view.expandSpeed=""),data.initRoot(setting);var root=data.getRoot(setting),childKey=setting.data.key.children;zNodes=zNodes?tools.clone(tools.isArray(zNodes)?zNodes:[zNodes]):[],setting.data.simpleData.enable?root[childKey]=data.transformTozTreeFormat(setting,zNodes):root[childKey]=zNodes,data.initCache(setting),event.unbindTree(setting),event.bindTree(setting),event.unbindEvent(setting),event.bindEvent(setting);var zTreeTools={setting:setting,addNodes:function(parentNode,newNodes,isSilent){function addCallback(){view.addNodes(setting,parentNode,xNewNodes,1==isSilent)}if(!newNodes)return null;if(parentNode||(parentNode=null),parentNode&&!parentNode.isParent&&setting.data.keep.leaf)return null;var xNewNodes=tools.clone(tools.isArray(newNodes)?newNodes:[newNodes]);return tools.canAsync(setting,parentNode)?view.asyncNode(setting,parentNode,isSilent,addCallback):addCallback(),xNewNodes},cancelSelectedNode:function(node){view.cancelPreSelectedNode(setting,node)},destroy:function(){view.destroy(setting)},expandAll:function(expandFlag){return expandFlag=!!expandFlag,view.expandCollapseSonNode(setting,null,expandFlag,!0),expandFlag},expandNode:function(node,expandFlag,sonSign,focus,callbackFlag){if(!node||!node.isParent)return null;if(expandFlag!==!0&&expandFlag!==!1&&(expandFlag=!node.open),callbackFlag=!!callbackFlag,callbackFlag&&expandFlag&&0==tools.apply(setting.callback.beforeExpand,[setting.treeId,node],!0))return null;if(callbackFlag&&!expandFlag&&0==tools.apply(setting.callback.beforeCollapse,[setting.treeId,node],!0))return null;if(expandFlag&&node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,!1),expandFlag===node.open&&!sonSign)return null;if(data.getRoot(setting).expandTriggerFlag=callbackFlag,!tools.canAsync(setting,node)&&sonSign)view.expandCollapseSonNode(setting,node,expandFlag,!0,function(){if(focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}});else if(node.open=!expandFlag,view.switchNode(this.setting,node),focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}return expandFlag},getNodes:function(){return data.getNodes(setting)},getNodeByParam:function(key,value,parentNode){return key?data.getNodeByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodeByTId:function(tId){return data.getNodeCache(setting,tId)},getNodesByParam:function(key,value,parentNode){return key?data.getNodesByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByParamFuzzy:function(key,value,parentNode){return key?data.getNodesByParamFuzzy(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByFilter:function(filter,isSingle,parentNode,invokeParam){return isSingle=!!isSingle,filter&&"function"==typeof filter?data.getNodesByFilter(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),filter,isSingle,invokeParam):isSingle?null:[]},getNodeIndex:function(node){if(!node)return null;for(var childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():data.getRoot(setting),i=0,l=parentNode[childKey].length;i0?view.createNodes(setting,0,root[childKey]):setting.async.enable&&setting.async.url&&""!==setting.async.url&&view.asyncNode(setting),zTreeTools}};var zt=$.fn.zTree,$$=tools.$,consts=zt.consts}(BI.jQuery),function($){var _consts={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},_setting={check:{enable:!1,autoCheckTrigger:!1,chkStyle:_consts.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:_consts.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},_initRoot=function(setting){var r=data.getRoot(setting);r.radioCheckedList=[]},_initCache=function(treeId){},_bindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.bind(c.CHECK,function(event,srcEvent,treeId,node){event.srcEvent=srcEvent,tools.apply(setting.callback.onCheck,[event,treeId,node])})},_unbindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.unbind(c.CHECK)},_eventProxy=function(e){var target=e.target,setting=data.getSetting(e.data.treeId),tId="",node=null,nodeEventType="",treeEventType="",nodeEventCallback=null,treeEventCallback=null;if(tools.eqs(e.type,"mouseover")?setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="mouseoverCheck"):tools.eqs(e.type,"mouseout")?setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="mouseoutCheck"):tools.eqs(e.type,"click")&&setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="checkNode"),tId.length>0)switch(node=data.getNodeCache(setting,tId),nodeEventType){case"checkNode":nodeEventCallback=_handler.onCheckNode;break;case"mouseoverCheck":nodeEventCallback=_handler.onMouseoverCheck;break;case"mouseoutCheck":nodeEventCallback=_handler.onMouseoutCheck}var proxyResult={stop:"checkNode"===nodeEventType,node:node,nodeEventType:nodeEventType,nodeEventCallback:nodeEventCallback,treeEventType:treeEventType,treeEventCallback:treeEventCallback};return proxyResult},_initNode=function(setting,level,n,parentNode,isFirstNode,isLastNode,openFlag){if(n){var checkedKey=setting.data.key.checked;if("string"==typeof n[checkedKey]&&(n[checkedKey]=tools.eqs(n[checkedKey],"true")),n[checkedKey]=!!n[checkedKey],n.checkedOld=n[checkedKey],"string"==typeof n.nocheck&&(n.nocheck=tools.eqs(n.nocheck,"true")),n.nocheck=!!n.nocheck||setting.check.nocheckInherit&&parentNode&&!!parentNode.nocheck,"string"==typeof n.chkDisabled&&(n.chkDisabled=tools.eqs(n.chkDisabled,"true")),n.chkDisabled=!!n.chkDisabled||setting.check.chkDisabledInherit&&parentNode&&!!parentNode.chkDisabled,"string"==typeof n.halfCheck&&(n.halfCheck=tools.eqs(n.halfCheck,"true")),n.halfCheck=!!n.halfCheck,n.check_Child_State=-1,n.check_Focus=!1,n.getCheckStatus=function(){return data.getCheckStatus(setting,n)},setting.check.chkStyle==consts.radio.STYLE&&setting.check.radioType==consts.radio.TYPE_ALL&&n[checkedKey]){var r=data.getRoot(setting);r.radioCheckedList.push(n)}}},_beforeA=function(setting,node,html){var checkedKey=setting.data.key.checked;setting.check.enable&&(data.makeChkFlag(setting,node),html.push(""))},_zTreeTools=function(setting,zTreeTools){zTreeTools.checkNode=function(node,checked,checkTypeFlag,callbackFlag){var checkedKey=this.setting.data.key.checked;if(node.chkDisabled!==!0&&(checked!==!0&&checked!==!1&&(checked=!node[checkedKey]),callbackFlag=!!callbackFlag,(node[checkedKey]!==checked||checkTypeFlag)&&(!callbackFlag||0!=tools.apply(this.setting.callback.beforeCheck,[this.setting.treeId,node],!0))&&tools.uCanDo(this.setting)&&this.setting.check.enable&&node.nocheck!==!0)){node[checkedKey]=checked;var checkObj=$$(node,consts.id.CHECK,this.setting);(checkTypeFlag||this.setting.check.chkStyle===consts.radio.STYLE)&&view.checkNodeRelation(this.setting,node),view.setChkClass(this.setting,checkObj,node),view.repairParentChkClassWithSelf(this.setting,node),callbackFlag&&this.setting.treeObj.trigger(consts.event.CHECK,[null,this.setting.treeId,node])}},zTreeTools.checkAllNodes=function(checked){view.repairAllChk(this.setting,!!checked)},zTreeTools.getCheckedNodes=function(checked){var childKey=this.setting.data.key.children;return checked=checked!==!1,data.getTreeCheckedNodes(this.setting,data.getRoot(this.setting)[childKey],checked)},zTreeTools.getChangeCheckedNodes=function(){var childKey=this.setting.data.key.children;return data.getTreeChangeCheckedNodes(this.setting,data.getRoot(this.setting)[childKey])},zTreeTools.setChkDisabled=function(node,disabled,inheritParent,inheritChildren){disabled=!!disabled,inheritParent=!!inheritParent,inheritChildren=!!inheritChildren,view.repairSonChkDisabled(this.setting,node,disabled,inheritChildren),view.repairParentChkDisabled(this.setting,node.getParentNode(),disabled,inheritParent)};var _updateNode=zTreeTools.updateNode;zTreeTools.updateNode=function(node,checkTypeFlag){if(_updateNode&&_updateNode.apply(zTreeTools,arguments),node&&this.setting.check.enable){var nObj=$$(node,this.setting);if(nObj.get(0)&&tools.uCanDo(this.setting)){var checkObj=$$(node,consts.id.CHECK,this.setting);1!=checkTypeFlag&&this.setting.check.chkStyle!==consts.radio.STYLE||view.checkNodeRelation(this.setting,node),view.setChkClass(this.setting,checkObj,node),view.repairParentChkClassWithSelf(this.setting,node)}}}},_data={getRadioCheckedList:function(setting){for(var checkedList=data.getRoot(setting).radioCheckedList,i=0,j=checkedList.length;i-1&&node.check_Child_State<2:node.check_Child_State>0};return r},getTreeCheckedNodes:function(setting,nodes,checked,results){if(!nodes)return[];var childKey=setting.data.key.children,checkedKey=setting.data.key.checked,onlyOne=checked&&setting.check.chkStyle==consts.radio.STYLE&&setting.check.radioType==consts.radio.TYPE_ALL;results=results?results:[];for(var i=0,l=nodes.length;i0));i++);return results},getTreeChangeCheckedNodes:function(setting,nodes,results){if(!nodes)return[];var childKey=setting.data.key.children,checkedKey=setting.data.key.checked;results=results?results:[];for(var i=0,l=nodes.length;i0?2:0,2==tmp){chkFlag=2;break}0==tmp&&(chkFlag=0)}else if(setting.check.chkStyle==consts.checkbox.STYLE){if(tmp=cNode.nocheck===!0||cNode.chkDisabled===!0?cNode.check_Child_State:cNode.halfCheck===!0?1:cNode[checkedKey]?cNode.check_Child_State===-1||2===cNode.check_Child_State?2:1:cNode.check_Child_State>0?1:0,1===tmp){chkFlag=1;break}if(2===tmp&&chkFlag>-1&&i>0&&tmp!==chkFlag){chkFlag=1;break}if(2===chkFlag&&tmp>-1&&tmp<2){chkFlag=1;break}tmp>-1&&(chkFlag=tmp)}}node.check_Child_State=chkFlag}}},_event={},_handler={onCheckNode:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkedKey=setting.data.key.checked;if(0==tools.apply(setting.callback.beforeCheck,[setting.treeId,node],!0))return!0;node[checkedKey]=!node[checkedKey],view.checkNodeRelation(setting,node);var checkObj=$$(node,consts.id.CHECK,setting);return view.setChkClass(setting,checkObj,node),view.repairParentChkClassWithSelf(setting,node),setting.treeObj.trigger(consts.event.CHECK,[event,setting.treeId,node]),!0},onMouseoverCheck:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkObj=$$(node,consts.id.CHECK,setting);return node.check_Focus=!0,view.setChkClass(setting,checkObj,node),!0},onMouseoutCheck:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkObj=$$(node,consts.id.CHECK,setting);return node.check_Focus=!1,view.setChkClass(setting,checkObj,node),!0}},_tools={},_view={checkNodeRelation:function(setting,node){var pNode,i,l,childKey=setting.data.key.children,checkedKey=setting.data.key.checked,r=consts.radio;if(setting.check.chkStyle==r.STYLE){var checkedList=data.getRadioCheckedList(setting);if(node[checkedKey])if(setting.check.radioType==r.TYPE_ALL){for(i=checkedList.length-1;i>=0;i--)pNode=checkedList[i],pNode[checkedKey]&&pNode!=node&&(pNode[checkedKey]=!1,checkedList.splice(i,1),view.setChkClass(setting,$$(pNode,consts.id.CHECK,setting),pNode),pNode.parentTId!=node.parentTId&&view.repairParentChkClassWithSelf(setting,pNode));checkedList.push(node)}else{var parentNode=node.parentTId?node.getParentNode():data.getRoot(setting);for(i=0,l=parentNode[childKey].length;i-1)&&view.setSonNodeCheckBox(setting,node,!0),node[checkedKey]||node[childKey]&&0!=node[childKey].length&&!(setting.check.chkboxType.N.indexOf("s")>-1)||view.setSonNodeCheckBox(setting,node,!1),node[checkedKey]&&setting.check.chkboxType.Y.indexOf("p")>-1&&view.setParentNodeCheckBox(setting,node,!0),!node[checkedKey]&&setting.check.chkboxType.N.indexOf("p")>-1&&view.setParentNodeCheckBox(setting,node,!1)},makeChkClass:function(setting,node){var checkedKey=setting.data.key.checked,c=consts.checkbox,r=consts.radio,checkboxType=setting.check.chkboxType,notEffectByOtherNode=""===checkboxType.Y&&""===checkboxType.N;fullStyle="",node.chkDisabled===!0?fullStyle=c.DISABLED:node.halfCheck?fullStyle=c.PART:setting.check.chkStyle==r.STYLE?fullStyle=node.check_Child_State<1?c.FULL:c.PART:fullStyle=node[checkedKey]?2===node.check_Child_State||node.check_Child_State===-1||notEffectByOtherNode?c.FULL:c.PART:node.check_Child_State<1||notEffectByOtherNode?c.FULL:c.PART;var chkName=setting.check.chkStyle+"_"+(node[checkedKey]?c.TRUE:c.FALSE)+"_"+fullStyle;return chkName=node.check_Focus&&node.chkDisabled!==!0?chkName+"_"+c.FOCUS:chkName,consts.className.BUTTON+" "+c.DEFAULT+" "+chkName},repairAllChk:function(setting,checked){if(setting.check.enable&&setting.check.chkStyle===consts.checkbox.STYLE)for(var checkedKey=setting.data.key.checked,childKey=setting.data.key.children,root=data.getRoot(setting),i=0,l=root[childKey].length;i0?view.repairParentChkClass(setting,node[childKey][0]):view.repairParentChkClass(setting,node)}},repairSonChkDisabled:function(setting,node,chkDisabled,inherit){if(node){var childKey=setting.data.key.children;if(node.chkDisabled!=chkDisabled&&(node.chkDisabled=chkDisabled),view.repairChkClass(setting,node),node[childKey]&&inherit)for(var i=0,l=node[childKey].length;i0){pSign=!1;break}pSign&&view.setParentNodeCheckBox(setting,node.getParentNode(),value,srcNode)}},setSonNodeCheckBox:function(setting,node,value,srcNode){if(node){var childKey=setting.data.key.children,checkedKey=setting.data.key.checked,checkObj=$$(node,consts.id.CHECK,setting);srcNode||(srcNode=node);var hasDisable=!1;if(node[childKey])for(var i=0,l=node[childKey].length;i0?value?2:0:-1)):node.check_Child_State=-1,view.setChkClass(setting,checkObj,node),setting.check.autoCheckTrigger&&node!=srcNode&&node.nocheck!==!0&&node.chkDisabled!==!0&&setting.treeObj.trigger(consts.event.CHECK,[null,setting.treeId,node]))}}},_z={tools:_tools,view:_view,event:_event,data:_data};$.extend(!0,$.fn.zTree.consts,_consts),$.extend(!0,$.fn.zTree._z,_z);var zt=$.fn.zTree,tools=zt._z.tools,consts=zt.consts,view=zt._z.view,data=zt._z.data,event=zt._z.event,$$=tools.$;data.exSetting(_setting),data.addInitBind(_bindEvent),data.addInitUnBind(_unbindEvent),data.addInitCache(_initCache),data.addInitNode(_initNode),data.addInitProxy(_eventProxy,!0),data.addInitRoot(_initRoot),data.addBeforeA(_beforeA),data.addZTreeTools(_zTreeTools);var _createNodes=view.createNodes;view.createNodes=function(setting,level,nodes,parentNode){_createNodes&&_createNodes.apply(view,arguments),nodes&&view.repairParentChkClassWithSelf(setting,parentNode)};var _removeNode=view.removeNode;view.removeNode=function(setting,node){var parentNode=node.getParentNode();_removeNode&&_removeNode.apply(view,arguments),node&&parentNode&&(view.repairChkClass(setting,parentNode),view.repairParentChkClass(setting,parentNode))};var _appendNodes=view.appendNodes;view.appendNodes=function(setting,level,nodes,parentNode,initFlag,openFlag){var html="";return _appendNodes&&(html=_appendNodes.apply(view,arguments)),parentNode&&data.makeChkFlag(setting,parentNode),html}}(BI.jQuery),BI.IconChangeButton=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.IconChangeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-icon-change-button",iconCls:"",iconWidth:null,iconHeight:null,stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn})},_init:function(){BI.IconChangeButton.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button=BI.createWidget({type:"bi.icon_button",element:this,cls:o.iconCls,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,stopEvent:o.stopEvent,stopPropagation:o.stopPropagation,selected:o.selected,once:o.once,forceSelected:o.forceSelected,forceNotSelected:o.forceNotSelected,disableSelected:o.disableSelected,shadow:o.shadow,isShadowShowingOnSelected:o.isShadowShowingOnSelected,trigger:o.trigger,handler:o.handler}),this.button.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button.on(BI.IconButton.EVENT_CHANGE,function(){self.fireEvent(BI.IconChangeButton.EVENT_CHANGE,arguments)})},isSelected:function(){return this.button.isSelected()},setSelected:function(b){this.button.setSelected(b)},setIcon:function(cls){var o=this.options;o.iconCls!==cls&&(this.element.removeClass(o.iconCls).addClass(cls),o.iconCls=cls)}}),BI.IconChangeButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_change_button",BI.IconChangeButton),BI.TriggerIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.TriggerIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-trigger-icon-button",extraCls:"pull-down-font"})}}),BI.TriggerIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.trigger_icon_button",BI.TriggerIconButton),BI.HalfIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-half-icon-button check-half-select-icon",height:16,width:16,iconWidth:16,iconHeight:16,selected:!1})}}),BI.HalfIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.half_icon_button",BI.HalfIconButton),BI.HalfButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-half-button bi-high-light-border",height:14,width:14,selected:!1})},_init:function(){BI.HalfButton.superclass._init.apply(this,arguments),BI.createWidget({type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"bi-high-light-background",width:8,height:8}]})},doClick:function(){BI.HalfButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.HalfButton.EVENT_CHANGE)}}),BI.HalfButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.half_button",BI.HalfButton),BI.MultiSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-item",height:24,logic:{dynamic:!1},iconWrapperWidth:26})},_init:function(){BI.MultiSelectItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,rgap:o.rgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected())}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.checkbox],width:o.iconWrapperWidth},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MultiSelectItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(v){BI.MultiSelectItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.MultiSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_item",BI.MultiSelectItem),BI.SingleSelectIconTextItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-icon-text-item bi-list-item-active",iconCls:"",height:24})},_init:function(){BI.SingleSelectIconTextItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,cls:o.iconCls,once:o.once,iconWrapperWidth:o.iconWrapperWidth,selected:o.selected,height:o.height,iconHeight:o.iconHeight, +iconWidth:o.iconWidth,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),this.text.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},isSelected:function(){return this.text.isSelected()},setSelected:function(b){this.text.setSelected(b)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectIconTextItem.superclass.doClick.apply(this,arguments)}}),BI.shortcut("bi.single_select_icon_text_item",BI.SingleSelectIconTextItem),BI.SingleSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-item bi-list-item-active",hgap:10,height:24,textAlign:"left"})},_init:function(){BI.SingleSelectItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,title:o.title||o.text,warningTitle:o.warningTitle,py:o.py})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)}}),BI.SingleSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_item",BI.SingleSelectItem),BI.SingleSelectRadioItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectRadioItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},hgap:10,height:24})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:16},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectRadioItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectRadioItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(v)}}),BI.SingleSelectRadioItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_radio_item",BI.SingleSelectRadioItem),BI.ArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.ArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-arrow-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){var self=this,o=this.options;BI.ArrowNode.superclass._init.apply(this,arguments),this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.ArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isOpened())},setText:function(text){BI.ArrowNode.superclass.setText.apply(this,arguments),this.text.setText(text)},setOpened:function(v){BI.ArrowNode.superclass.setOpened.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.arrow_group_node",BI.ArrowNode),BI.FirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.FirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-first-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.FirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.FirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.FirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.first_plus_group_node",BI.FirstPlusGroupNode),BI.IconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-arrow-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24,iconHeight:12,iconWidth:12,iconCls:""})},_init:function(){BI.IconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox",width:24,stopPropagation:!0});var icon=BI.createWidget({type:"bi.icon_label",width:24,cls:o.iconCls,iconWidth:o.iconWidth,iconHeight:o.iconHeight});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},{width:16,el:icon},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,rgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.IconArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.IconArrowNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.icon_arrow_node",BI.IconArrowNode),BI.LastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.LastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-last-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.LastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.LastPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.LastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.last_plus_group_node",BI.LastPlusGroupNode),BI.MidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-mid-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.MidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MidPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.MidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.mid_plus_group_node",BI.MidPlusGroupNode),BI.MultiLayerIconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerIconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-icon-arrow-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24,iconHeight:16,iconWidth:16,iconCls:""})},_init:function(){BI.MultiLayerIconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.icon_arrow_node",iconCls:o.iconCls,cls:"bi-list-item-none",id:o.id,pId:o.pId,open:o.open,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var items=[];BI.count(0,o.layer,function(){items.push({type:"bi.layout",width:15,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,15),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerIconArrowNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerIconArrowNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_icon_arrow_node",BI.MultiLayerIconArrowNode),BI.PlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.PlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.PlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.PlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.PlusGroupNode.superclass.setOpened.apply(this,arguments),this.checkbox&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.plus_group_node",BI.PlusGroupNode),BI.Switch=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-switch",height:22,width:44,logic:{dynamic:!1}},render:function(){var self=this;return{type:"bi.absolute",ref:function(){self.layout=this},items:[{el:{type:"bi.text_button",cls:"circle-button bi-card"},width:18,height:18,top:2,left:this.options.selected?24:2}]}},setSelected:function(v){BI.Switch.superclass.setSelected.apply(this,arguments),this.layout.attr("items")[0].left=v?24:2,this.layout.resize()},doClick:function(){BI.Switch.superclass.doClick.apply(this,arguments),this.fireEvent(BI.Switch.EVENT_CHANGE)}}),BI.Switch.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.switch",BI.Switch),BI.FirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.FirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"first-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.FirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(v){BI.FirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.first_tree_leaf_item",BI.FirstTreeLeafItem),BI.IconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.IconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},height:24,iconWidth:16,iconHeight:16,iconCls:""})},_init:function(){BI.IconTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options,icon=BI.createWidget({type:"bi.center_adapt",width:24,cls:o.iconCls,items:[{type:"bi.icon",width:o.iconWidth,height:o.iconHeight}]});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:icon},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,hgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.IconTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(v){BI.IconTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.icon_tree_leaf_item",BI.IconTreeLeafItem),BI.LastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.LastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"last-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.LastTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(v){BI.LastTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.last_tree_leaf_item",BI.LastTreeLeafItem),BI.MidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.MidTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"mid-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MidTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(v){BI.MidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.mid_tree_leaf_item",BI.MidTreeLeafItem),BI.MultiLayerIconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerIconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-icon-tree-leaf-item bi-list-item-active",layer:0,height:24,iconCls:"",iconHeight:16,iconWidth:16})},_init:function(){BI.MultiLayerIconTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.icon_tree_leaf_item",cls:"bi-list-item-none",iconCls:o.iconCls,id:o.id,pId:o.pId,isFront:!0,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var items=[];BI.count(0,o.layer,function(){items.push({type:"bi.layout",width:15,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,15),items:[items]})},doRedMark:function(){this.item.doRedMark.apply(this.item,arguments)},unRedMark:function(){this.item.unRedMark.apply(this.item,arguments)},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerIconTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerIconTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)},getValue:function(){return this.options.value}}),BI.shortcut("bi.multilayer_icon_tree_leaf_item",BI.MultiLayerIconTreeLeafItem),BI.TreeTextLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.TreeTextLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tree-text-leaf-item bi-list-item-active",id:"",pId:"",height:24,hgap:0,lgap:0,rgap:0})},_init:function(){BI.TreeTextLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,lgap:o.lgap,rgap:o.hgap,text:o.text,value:o.value,py:o.py}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text}]})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.tree_text_leaf_item",BI.TreeTextLeafItem),BI.CalendarDateItem=BI.inherit(BI.BasicButton,{render:function(){var self=this,o=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",text:o.text,value:o.value,ref:function(){self.text=this}},left:o.lgap,right:o.rgap,top:0,bottom:0}]}},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},setSelected:function(b){BI.CalendarDateItem.superclass.setSelected.apply(this,arguments),this.text.setSelected(b)},getValue:function(){return this.text.getValue()}}),BI.shortcut("bi.calendar_date_item",BI.CalendarDateItem),BI.Calendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Calendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-calendar",logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:2015,month:8,day:25})},_dateCreator:function(Y,M,D){var self=this,o=this.options,log={},De=BI.getDate(),mins=o.min.match(/\d+/g),maxs=o.max.match(/\d+/g);Y<(0|mins[0])&&(Y=0|mins[0]),Y>(0|maxs[0])&&(Y=0|maxs[0]),De.setFullYear(Y,M,D),log.ymd=[De.getFullYear(),De.getMonth(),De.getDate()];var MD=BI.Date._MD.slice(0);MD[1]=BI.isLeapYear(log.ymd[0])?29:28,De.setFullYear(log.ymd[0],log.ymd[1],1),log.FDay=De.getDay();var offSetFDay=(7-BI.StartOfWeek+log.FDay)%7;log.PDay=MD[0===M?11:M-1]-offSetFDay+1,log.NDay=1;var items=[];return BI.each(BI.range(42),function(i){var td={},YY=log.ymd[0],MM=log.ymd[1]+1,DD;i=offSetFDay&&i=0?page%12:(12+page%12)%12;return{year:BI.getDate().getFullYear()+year,month:month+1}}}),BI.shortcut("bi.calendar",BI.Calendar),BI.YearCalendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.YearCalendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-year-calendar",behaviors:{},logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:null})},_yearCreator:function(Y){var o=this.options;Y=0|Y;var start=BI.YearCalendar.getStartYear(Y),items=[],startDate=BI.parseDateTime(o.min,"%Y-%X-%d"),endDate=BI.parseDateTime(o.max,"%Y-%X-%d");return BI.each(BI.range(BI.YearCalendar.INTERVAL),function(i){var td={};BI.checkDateVoid(start+i,1,1,BI.print(BI.getDate(startDate.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(endDate.getFullYear(),0,1),"%Y-%X-%d"))[0]&&(td.disabled=!0),td.text=start+i,items.push(td)}),items},_init:function(){BI.YearCalendar.superclass._init.apply(this,arguments);var self=this,o=this.options;this.currentYear=BI.getDate().getFullYear();var years=this._yearCreator(o.year||this.currentYear),len=years.length,tyears=BI.makeArray(len,""),map=[0,6,1,7,2,8,3,9,4,10,5,11];BI.each(years,function(i,y){tyears[i]=years[map[i]]});var items=[];items.push(tyears.slice(0,2)),items.push(tyears.slice(2,4)),items.push(tyears.slice(4,6)),items.push(tyears.slice(6,8)),items.push(tyears.slice(8,10)),items.push(tyears.slice(10,12)),items=BI.map(items,function(i,item){return BI.map(item,function(j,td){return BI.extend(td,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",once:!1,forceSelected:!0,height:24,width:45,value:td.text,disabled:td.disabled})})}),this.years=BI.createWidget({type:"bi.button_group",behaviors:o.behaviors,items:BI.createItems(items,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({},o.logic,{columns:2,rows:6,columnSize:[.5,.5],rowSize:24})),{type:"bi.center_adapt",vgap:1}]}),this.years.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this.years)}))))},isFrontYear:function(){var o=this.options,Y=o.year; +return Y=0|Y,!!BI.checkDateVoid(BI.YearCalendar.getStartYear(Y)-1,1,1,o.min,o.max)[0]},isFinalYear:function(){var o=this.options,c=this._const,Y=o.year;return Y=0|Y,!!BI.checkDateVoid(BI.YearCalendar.getEndYear(Y)+1,1,1,o.min,o.max)[0]},setValue:function(val){this.years.setValue([val])},getValue:function(){return this.years.getValue()[0]}}),BI.extend(BI.YearCalendar,{INTERVAL:12,getStartYear:function(year){var cur=BI.getDate().getFullYear();return year-((year-cur+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(year){return BI.YearCalendar.getStartYear(year)+BI.YearCalendar.INTERVAL-1},getPageByYear:function(year){var cur=BI.getDate().getFullYear();return year=BI.YearCalendar.getStartYear(year),(year-cur+3)/BI.YearCalendar.INTERVAL}}),BI.shortcut("bi.year_calendar",BI.YearCalendar),BI.ArrowTreeGroupNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-arrow-group-node-checkbox"})},setSelected:function(v){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),v?this.element.removeClass("expander-right-font").addClass("expander-down-font"):this.element.removeClass("expander-down-font").addClass("expander-right-font")}}),BI.shortcut("bi.arrow_group_node_checkbox",BI.ArrowTreeGroupNodeCheckbox),BI.CheckingMarkNode=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.CheckingMarkNode.superclass._defaultConfig.apply(this,arguments),{extraCls:"check-mark-font"})},_init:function(){BI.CheckingMarkNode.superclass._init.apply(this,arguments),this.setSelected(this.options.selected)},setSelected:function(v){BI.CheckingMarkNode.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("check-mark-font"):this.element.removeClass("check-mark-font")}}),BI.shortcut("bi.checking_mark_node",BI.CheckingMarkNode),BI.FirstTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type2",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.FirstTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type2"):this.element.removeClass("tree-expand-icon-type2")}}),BI.shortcut("bi.first_tree_node_checkbox",BI.FirstTreeNodeCheckbox),BI.LastTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type4",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.LastTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type4"):this.element.removeClass("tree-expand-icon-type4")}}),BI.shortcut("bi.last_tree_node_checkbox",BI.LastTreeNodeCheckbox),BI.MidTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type3",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.MidTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type3"):this.element.removeClass("tree-expand-icon-type3")}}),BI.shortcut("bi.mid_tree_node_checkbox",BI.MidTreeNodeCheckbox),BI.TreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type1",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.TreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v?this.element.addClass("tree-expand-icon-type1"):this.element.removeClass("tree-expand-icon-type1")}}),BI.shortcut("bi.tree_node_checkbox",BI.TreeNodeCheckbox),BI.CustomColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-color-chooser",width:227,height:245})},_init:function(){BI.CustomColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.editor,{type:"bi.simple_color_picker_editor"}),this.editor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue())}),this.farbtastic=BI.createWidget({type:"bi.farbtastic"}),this.farbtastic.on(BI.Farbtastic.EVENT_CHANGE,function(){self.setValue(this.getValue())}),BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.absolute",items:[{el:this.editor,left:0,top:0,right:0}],height:30},{type:"bi.absolute",items:[{el:this.farbtastic,left:15,right:15,top:7}],height:215}]})},setValue:function(color){this.editor.setValue(color),this.farbtastic.setValue(color)},getValue:function(){return this.editor.getValue()}}),BI.CustomColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_color_chooser",BI.CustomColorChooser),BI.ColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser",value:"",height:24})},_init:function(){BI.ColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:1,isNeedAdjustWidth:!1,isNeedAdjustHeight:!1,el:BI.extend({type:o.width<=24?"bi.color_chooser_trigger":"bi.long_color_chooser_trigger",ref:function(_ref){self.trigger=_ref},width:o.width-2,height:o.height-2},o.el),popup:{el:BI.extend({type:"bi.color_chooser_popup",ref:function(_ref){self.colorPicker=_ref},listeners:[{eventName:BI.ColorChooserPopup.EVENT_VALUE_CHANGE,action:function(){fn(),self._isRGBColor(self.colorPicker.getValue())||self.combo.hideView()}},{eventName:BI.ColorChooserPopup.EVENT_CHANGE,action:function(){fn(),self.combo.hideView()}}]},o.popup),width:230},value:o.value});var fn=function(){var color=self.colorPicker.getValue();self.trigger.setValue(color)};this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.ColorChooser.EVENT_CHANGE,arguments)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.ColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser",BI.ColorChooser),BI.ColorChooserPopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-color-chooser-popup",width:230,height:145,simple:!1},render:function(){var self=this,o=this.options;this.colorEditor=BI.createWidget(o.editor,{type:o.simple?"bi.simple_color_picker_editor":"bi.color_picker_editor",value:o.value,cls:"bi-header-background bi-border-bottom",height:30}),this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue()),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,arguments)}),this.storeColors=BI.createWidget({type:"bi.color_picker",cls:"bi-border-bottom bi-border-right",items:[this._digestStoreColors(this._getStoreColors())],width:210,height:24,value:o.value}),this.storeColors.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.colorPicker=BI.createWidget({type:"bi.color_picker",width:210,height:50,value:o.value}),this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.customColorChooser=BI.createWidget({type:"bi.custom_color_chooser",editor:o.editor});var panel=BI.createWidget({type:"bi.popup_panel",buttons:[BI.i18nText("BI-Basic_Cancel"),BI.i18nText("BI-Basic_Save")],title:BI.i18nText("BI-Custom_Color"),el:this.customColorChooser,stopPropagation:!1,bgap:-1,rgap:1,lgap:1,minWidth:227});return this.more=BI.createWidget({type:"bi.combo",cls:"bi-border-top",container:null,direction:"right,top",isNeedAdjustHeight:!1,el:{type:"bi.text_item",cls:"color-chooser-popup-more bi-list-item",textAlign:"center",height:24,textLgap:10,text:BI.i18nText("BI-Basic_More")+"..."},popup:panel}),this.more.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self.customColorChooser.setValue(self.getValue())}),panel.on(BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.more.hideView();break;case 1:self.setValue(self.customColorChooser.getValue()),self._dealStoreColors(),self.more.hideView(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}}),{type:"bi.absolute",items:[{el:{type:"bi.vtape",items:[this.colorEditor,{el:{type:"bi.absolute",items:[{el:this.storeColors,left:10,right:10,top:5}]},height:29},{el:{type:"bi.absolute",items:[{el:this.colorPicker,left:10,right:10,top:5,bottom:5}]},height:60},{el:this.more,height:24}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"disable-mask",invisible:!o.disabled,ref:function(){self.mask=this}},left:0,right:0,top:0,bottom:0}]}},mounted:function(){var self=this,o=this.options;BI.isNotNull(o.value)&&this.setValue(o.value)},_setEnable:function(enable){BI.ColorChooserPopup.superclass._setEnable.apply(this,arguments),this.mask.setVisible(!enable)},_dealStoreColors:function(){var color=this.getValue(),colors=this._getStoreColors(),que=new BI.Queue(8);que.fromArray(colors),que.remove(color),que.unshift(color);var array=que.toArray();BI.Cache.setItem("colors",BI.array2String(array)),this.setStoreColors(array)},_digestStoreColors:function(colors){var items=BI.map(colors,function(i,color){return{value:color}});return BI.count(colors.length,8,function(i){items.push({value:"",disabled:!0})}),items},_getStoreColors:function(){var self=this,o=this.options,colorsArray=BI.string2Array(BI.Cache.getItem("colors")||"");return BI.filter(colorsArray,function(idx,color){return!o.simple||self._isRGBColor(color)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},setStoreColors:function(colors){BI.isArray(colors)&&this.storeColors.populate([this._digestStoreColors(colors)])},setValue:function(color){this.colorEditor.setValue(color),this.colorPicker.setValue(color),this.storeColors.setValue(color)},getValue:function(){return this.colorEditor.getValue()}}),BI.ColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.ColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_popup",BI.ColorChooserPopup),BI.SimpleColorChooserPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooserPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser-popup"})},_init:function(){BI.SimpleColorChooserPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popup=BI.createWidget({type:"bi.color_chooser_popup",value:o.value,element:this,simple:!0}),this.popup.on(BI.ColorChooserPopup.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleColorChooserPopup.EVENT_CHANGE,arguments)}),this.popup.on(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,function(){self.fireEvent(BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE,arguments)})},setStoreColors:function(colors){this.popup.setStoreColors(colors)},setValue:function(color){this.popup.setValue(color)},getValue:function(){return this.popup.getValue()}}),BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.SimpleColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser_popup",BI.SimpleColorChooserPopup),BI.SimpleColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-color-chooser",value:"#ffffff"})},_init:function(){BI.SimpleColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.color_chooser",element:this,container:o.container,value:o.value,width:o.width,height:o.height,popup:{type:"bi.simple_color_chooser_popup"}}),this.combo.on(BI.ColorChooser.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleColorChooser.EVENT_CHANGE,arguments)})},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.SimpleColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser",BI.SimpleColorChooser),BI.ColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var conf=BI.ColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.ColorChooserTrigger.superclass._init.apply(this,arguments),this.colorContainer=BI.createWidget({type:"bi.layout",cls:"color-chooser-trigger-content"+(BI.isIE9Below&&BI.isIE9Below()?" hack":"")});var down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:down,right:-1,bottom:1}]}),BI.isNotNull(this.options.value)&&this.setValue(this.options.value)},setValue:function(color){BI.ColorChooserTrigger.superclass.setValue.apply(this,arguments),""===color?this.colorContainer.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===color?this.colorContainer.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorContainer.element.css({"background-color":color}).removeClass("auto-color-background").removeClass("trans-color-background")}}),BI.ColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_trigger",BI.ColorChooserTrigger),BI.LongColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var conf=BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.LongColorChooserTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;this.colorContainer=BI.createWidget({type:"bi.htape",cls:"color-chooser-trigger-content",items:[{type:"bi.icon_change_button",ref:function(_ref){self.changeIcon=_ref},disableSelected:!0,iconCls:"auto-color-icon",width:24,iconWidth:16,iconHeight:16},{el:{type:"bi.label",ref:function(_ref){self.label=_ref},textAlign:"left",hgap:5,height:18,text:BI.i18nText("BI-Basic_Auto")}}]});var down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:down,right:3,bottom:3}]}),this.options.value&&this.setValue(this.options.value)},setValue:function(color){BI.LongColorChooserTrigger.superclass.setValue.apply(this,arguments),""===color?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("auto-color-icon"),this.label.setText(BI.i18nText("BI-Basic_Auto"))):"transparent"===color?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("trans-color-icon"),this.label.setText(BI.i18nText("BI-Transparent_Color"))):(this.colorContainer.element.css({"background-color":color}),this.changeIcon.setVisible(!1),this.label.setVisible(!1))}}),BI.LongColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.long_color_chooser_trigger",BI.LongColorChooserTrigger),BI.ColorPickerButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.ColorPickerButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-picker-button bi-background bi-border-top bi-border-left"})},_init:function(){BI.ColorPickerButton.superclass._init.apply(this,arguments);var self=this,o=this.options;if(o.value){this.element.css("background-color",o.value);var name=this.getName();this.element.hover(function(){self._createMask(),self.isEnabled()&&BI.Maskers.show(name)},function(){self.isSelected()||BI.Maskers.hide(name)})}},_createMask:function(){var o=this.options,name=this.getName();if(this.isEnabled()&&!BI.Maskers.has(name)){var w=BI.Maskers.make(name,this,{offset:{left:-1,top:-1,right:-1,bottom:-1}});w.element.addClass("color-picker-button-mask").css("background-color",o.value)}},setSelected:function(b){BI.ColorPickerButton.superclass.setSelected.apply(this,arguments),b&&this._createMask(),BI.Maskers[b?"show":"hide"](this.getName())}}),BI.ColorPickerButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_button",BI.ColorPickerButton),BI.ColorPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorPicker.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker",items:null})},_items:[[{value:"#ffffff"},{value:"#f2f2f2"},{value:"#e5e5e5"},{value:"#d9d9d9"},{value:"#cccccc"},{value:"#bfbfbf"},{value:"#b2b2b2"},{value:"#a6a6a6"},{value:"#999999"},{value:"#8c8c8c"},{value:"#808080"},{value:"#737373"},{value:"#666666"},{value:"#4d4d4d"},{value:"#333333"},{value:"#000000"}],[{value:"#d8b5a6"},{value:"#ff9e9a"},{value:"#ffc17d"},{value:"#f5e56b"},{value:"#d8e698"},{value:"#e0ebaf"},{value:"#c3d825"},{value:"#bce2e8"},{value:"#85d3cd"},{value:"#bce2e8"},{value:"#a0d8ef"},{value:"#89c3eb"},{value:"#bbc8e6"},{value:"#bbbcde"},{value:"#d6b4cc"},{value:"#fbc0d3"}],[{value:"#bb9581"},{value:"#f37d79"},{value:"#fba74f"},{value:"#ffdb4f"},{value:"#c7dc68"},{value:"#b0ca71"},{value:"#99ab4e"},{value:"#84b9cb"},{value:"#00a3af"},{value:"#2ca9e1"},{value:"#0095d9"},{value:"#4c6cb3"},{value:"#8491c3"},{value:"#a59aca"},{value:"#cc7eb1"},{value:"#e89bb4"}],[{value:"#9d775f"},{value:"#dd4b4b"},{value:"#ef8b07"},{value:"#fcc800"},{value:"#aacf53"},{value:"#82ae46"},{value:"#69821b"},{value:"#59b9c6"},{value:"#2a83a2"},{value:"#007bbb"},{value:"#19448e"},{value:"#274a78"},{value:"#4a488e"},{value:"#7058a3"},{value:"#884898"},{value:"#d47596"}]],_init:function(){BI.ColorPicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this.colors=BI.createWidget({type:"bi.button_group",element:this,items:BI.createItems(o.items||this._items,{type:"bi.color_picker_button",once:!1}),layouts:[{type:"bi.grid"}],value:o.value}),this.colors.on(BI.ButtonGroup.EVENT_CHANGE,function(){self.fireEvent(BI.ColorPicker.EVENT_CHANGE,arguments)})},populate:function(items){var args=[].slice.call(arguments);args[0]=BI.createItems(items,{type:"bi.color_picker_button",once:!1}),this.colors.populate.apply(this.colors,args)},setValue:function(color){this.colors.setValue(color)},getValue:function(){return this.colors.getValue()}}),BI.ColorPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker",BI.ColorPicker),BI.ColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.ColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.ColorPickerEditor.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this.constants;this.storeValue={},this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var RGB=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),checker=function(v){return BI.isNumeric(v)&&(0|v)>=0&&(0|v)<=255},Ws=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:checker,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:c.REB_WIDTH,height:20});BI.each(Ws,function(i,w){w.on(BI.TextEditor.EVENT_CHANGE,function(){self._checkEditors(),checker(self.storeValue.r)&&checker(self.storeValue.g)&&checker(self.storeValue.b)&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=Ws[0],this.G=Ws[1],this.B=Ws[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(self.lastColor=self.getValue(),self.setValue("")):self.setValue(self.lastColor||"#ffffff"),(self.R.isValid()&&self.G.isValid()&&self.B.isValid()||self._isEmptyRGB())&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(self.lastColor=self.getValue(),self.setValue("transparent")):("transparent"===self.lastColor&&(self.lastColor=""),self.setValue(self.lastColor||"#ffffff")),(self.R.isValid()&&self.G.isValid()&&self.B.isValid()||self._isEmptyRGB())&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical_adapt",items:[{el:this.colorShow,width:16},{el:RGB[0],width:20},{el:this.R,width:c.REB_WIDTH},{el:RGB[1],width:20},{el:this.G,width:c.REB_WIDTH},{el:RGB[2],width:20},{el:this.B,width:c.REB_WIDTH},{el:this.transparent,width:16,lgap:5},{el:this.none,width:16,lgap:5}]},left:10,right:10,top:0,bottom:0}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(color){""===color?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-normal-background"):"transparent"===color?this.colorShow.element.css("background-color","").removeClass("auto-color-normal-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":color}).removeClass("auto-color-normal-background").removeClass("trans-color-background")},_setEnable:function(enable){BI.ColorPickerEditor.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled")},setValue:function(color){if("transparent"===color)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});color?this.none.setSelected(!1):(color="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(color);var json=BI.DOM.rgb2json(BI.DOM.hex2rgb(color));this.storeValue={r:BI.isNull(json.r)?"":json.r,g:BI.isNull(json.r)?"":json.g,b:BI.isNull(json.r)?"":json.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this._isEmptyRGB()&&this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this.constants;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var RGB=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),checker=function(v){return BI.isNumeric(v)&&(0|v)>=0&&(0|v)<=255},Ws=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:checker,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:c.REB_WIDTH,height:20});BI.each(Ws,function(i,w){w.on(BI.TextEditor.EVENT_CHANGE,function(){self._checkEditors(),self.R.isValid()&&self.G.isValid()&&self.B.isValid()&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=Ws[0],this.G=Ws[1],this.B=Ws[2],BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.colorShow,width:16,lgap:20,rgap:15},{el:RGB[0],width:20},{el:this.R,width:c.REB_WIDTH},{el:RGB[1],width:20},{el:this.G,width:c.REB_WIDTH},{el:RGB[2],width:20},{el:this.B,width:c.REB_WIDTH}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0)},setValue:function(color){this.colorShow.element.css({"background-color":color});var json=BI.DOM.rgb2json(BI.DOM.hex2rgb(color));this.R.setValue(BI.isNull(json.r)?"":json.r),this.G.setValue(BI.isNull(json.g)?"":json.g),this.B.setValue(BI.isNull(json.b)?"":json.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.BasicButton,{constants:{RADIUS:84,SQUARE:100,WIDTH:194},props:{baseCls:"bi-farbtastic",width:195,height:195,stopPropagation:!0,value:"#000000"},render:function(){var self=this;return{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"",ref:function(_ref){self.colorWrapper=_ref}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"wheel",ref:function(_ref){self.wheel=_ref}},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"overlay",ref:function(_ref){self.overlay=_ref}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"marker",ref:function(_ref){self.hMarker=_ref},scrollable:!1,width:17,height:17}},{el:{type:"bi.layout",cls:"marker",ref:function(_ref){self.slMarker=_ref},scrollable:!1,width:17,height:17}}]}},mounted:function(){var o=this.options;BI.isKey(o.value)&&this.setValue(o.value)},_unpack:function(color){return 7===color.length?[parseInt("0x"+color.substring(1,3))/255,parseInt("0x"+color.substring(3,5))/255,parseInt("0x"+color.substring(5,7))/255]:4===color.length?[parseInt("0x"+color.substring(1,2))/15,parseInt("0x"+color.substring(2,3))/15,parseInt("0x"+color.substring(3,4))/15]:void 0},_pack:function(rgb){var r=Math.round(255*rgb[0]),g=Math.round(255*rgb[1]),b=Math.round(255*rgb[2]);return"#"+(r<16?"0":"")+r.toString(16)+(g<16?"0":"")+g.toString(16)+(b<16?"0":"")+b.toString(16)},_setColor:function(color){var unpack=this._unpack(color);this.value!==color&&unpack&&(this.value=color,this.rgb=unpack,this.hsl=this._RGBToHSL(this.rgb),this._updateDisplay())},_setHSL:function(hsl){return this.hsl=hsl,this.rgb=this._HSLToRGB(hsl),this.value=this._pack(this.rgb),this._updateDisplay(),this},_HSLToRGB:function(hsl){var m1,m2,r,g,b,h=hsl[0],s=hsl[1],l=hsl[2];return m2=l<=.5?l*(s+1):l+s-l*s,m1=2*l-m2,[this._hueToRGB(m1,m2,h+.33333),this._hueToRGB(m1,m2,h),this._hueToRGB(m1,m2,h-.33333)]},_hueToRGB:function(m1,m2,h){return h=h<0?h+1:h>1?h-1:h,6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(.66666-h)*6:m1},_RGBToHSL:function(rgb){var min,max,delta,h,s,l,r=rgb[0],g=rgb[1],b=rgb[2];return min=Math.min(r,Math.min(g,b)),max=Math.max(r,Math.max(g,b)),delta=max-min,l=(min+max)/2,s=0,l>0&&l<1&&(s=delta/(l<.5?2*l:2-2*l)),h=0,delta>0&&(max==r&&max!=g&&(h+=(g-b)/delta),max==g&&max!=b&&(h+=2+(b-r)/delta),max==b&&max!=r&&(h+=4+(r-g)/delta),h/=6),[h,s,l]},_updateDisplay:function(){var angle=6.28*this.hsl[0];this.hMarker.element.css({left:Math.round(Math.sin(angle)*this.constants.RADIUS+this.constants.WIDTH/2)+"px",top:Math.round(-Math.cos(angle)*this.constants.RADIUS+this.constants.WIDTH/2)+"px"}),this.slMarker.element.css({left:Math.round(this.constants.SQUARE*(.5-this.hsl[1])+this.constants.WIDTH/2)+"px",top:Math.round(this.constants.SQUARE*(.5-this.hsl[2])+this.constants.WIDTH/2)+"px"}),this.colorWrapper.element.css("backgroundColor",this._pack(this._HSLToRGB([this.hsl[0],1,.5]))),this.fireEvent(BI.Farbtastic.EVENT_CHANGE,this.getValue(),this)},_absolutePosition:function(el){var r={x:el.offsetLeft,y:el.offsetTop};if(el.offsetParent){var tmp=this._absolutePosition(el.offsetParent);r.x+=tmp.x,r.y+=tmp.y}return r},_widgetCoords:function(event){var x,y,el=event.target||event.srcElement,reference=this.wheel.element[0];if("undefined"!=typeof event.offsetX){for(var pos={x:event.offsetX,y:event.offsetY},e=el;e;)e.mouseX=pos.x,e.mouseY=pos.y,pos.x+=e.offsetLeft,pos.y+=e.offsetTop,e=e.offsetParent;for(var e=reference,offset={x:0,y:0};e;){if("undefined"!=typeof e.mouseX){x=e.mouseX-offset.x,y=e.mouseY-offset.y;break}offset.x+=e.offsetLeft,offset.y+=e.offsetTop,e=e.offsetParent}for(e=el;e;)e.mouseX=void 0,e.mouseY=void 0,e=e.offsetParent}else{var pos=this._absolutePosition(reference);x=(event.pageX||0)-pos.x,y=(event.pageY||0)-pos.y}return{x:x-this.constants.WIDTH/2,y:y-this.constants.WIDTH/2}},_doMouseMove:function(event){var pos=this._widgetCoords(event);if(this.circleDrag){var hue=Math.atan2(pos.x,-pos.y)/6.28;hue<0&&(hue+=1),this._setHSL([hue,this.hsl[1],this.hsl[2]])}else{var sat=Math.max(0,Math.min(1,-(pos.x/this.constants.SQUARE)+.5)),lum=Math.max(0,Math.min(1,-(pos.y/this.constants.SQUARE)+.5));this._setHSL([this.hsl[0],sat,lum])}},doClick:function(event){var pos=this._widgetCoords(event);return this.circleDrag=2*Math.max(Math.abs(pos.x),Math.abs(pos.y))>this.constants.SQUARE,this._doMouseMove(event),!1},setValue:function(color){this._setColor(color)},getValue:function(){return this.value}}),BI.Farbtastic.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom,left",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:o.trigger,toggle:o.toggle,container:o.container,direction:o.direction,isDefaultInit:o.isDefaultInit,destroyWhenHide:o.destroyWhenHide,isNeedAdjustHeight:o.isNeedAdjustHeight,isNeedAdjustWidth:o.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:o.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:o.hideChecker,offsetStyle:o.offsetStyle,el:o.el,popup:BI.extend({type:"bi.bubble_popup_view"},o.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){self.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments); +}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){self.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){self.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){self.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self._showTriangle(),self.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){self._hideTriangle(),self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(direction){var pos={},op={},adjustLength=this.options.adjustLength,offset=this.element.offset(),left=offset.left,right=offset.left+this.element.outerWidth(),top=offset.top,bottom=offset.top+this.element.outerHeight();switch(direction){case"left":pos={top:top,height:this.element.outerHeight(),left:left-adjustLength-this._const.TRIANGLE_LENGTH},op={width:this._const.TRIANGLE_LENGTH};break;case"right":pos={top:top,height:this.element.outerHeight(),left:right+adjustLength},op={width:this._const.TRIANGLE_LENGTH};break;case"top":pos={left:left,width:this.element.outerWidth(),top:top-adjustLength-this._const.TRIANGLE_LENGTH},op={height:this._const.TRIANGLE_LENGTH};break;case"bottom":pos={left:left,width:this.element.outerWidth(),top:bottom+adjustLength},op={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(op,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+direction}]}),pos.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[pos]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var pos=this.combo.getPopupPosition();switch(pos.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var config=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(config,{baseCls:config.baseCls+" bi-bubble-popup-view",minWidth:220,maxWidth:300,minHeight:90})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:!1,text:BI.i18nText("BI-Basic_Cancel"),ghost:!0},{text:BI.i18nText(BI.i18nText("BI-Basic_Sure")),value:!0}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var o=this.options,self=this,items=[];return BI.each(o.buttons,function(i,buttonOpt){BI.isWidget(buttonOpt)?items.push(buttonOpt):items.push(BI.extend({type:"bi.button",height:24,handler:function(v){self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,v)}},buttonOpt))}),BI.createWidget({type:"bi.center",height:44,rgap:15,items:[{type:"bi.right_vertical_adapt",lgap:10,items:items}]})},_createView:function(){var o=this.options,button=BI.createWidget({type:"bi.button_group",items:[o.el],layouts:[{type:"bi.vertical",cls:"bar-popup-container",hgap:15,tgap:10}]});return button.element.css("min-height",o.minHeight-44),button}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-text-bubble-bar-popup-view",text:"",buttons:[{level:"ignore",value:!1,stopPropagation:!0,text:BI.i18nText("BI-Basic_Cancel")},{value:!0,stopPropagation:!0,text:BI.i18nText("BI-Basic_Sure")}]}},render:function(){var self=this,o=this.options,buttons=BI.map(o.buttons,function(index,buttonOpt){return BI.isWidget(buttonOpt)?buttonOpt:BI.extend({type:"bi.button",height:24,handler:function(v){self.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE,v)}},buttonOpt)});return{type:"bi.bubble_bar_popup_view",minWidth:o.minWidth,maxWidth:o.maxWidth,minHeight:o.minHeight,ref:function(){self.popup=this},el:{type:"bi.label",text:o.text,whiteSpace:"normal",textAlign:"left",ref:function(){self.text=this}},buttons:buttons}},populate:function(v){this.text.setText(v||this.options.text)}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:o.items,height:o.height,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,value:o.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){self.popup.setValue(this.getValue()),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.editorIconCheckCombo.hideView(),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(v){this.editorIconCheckCombo.setValue(v)},getValue:function(){return this.trigger.getValue()},populate:function(items){this.options.items=items,this.editorIconCheckCombo.populate(items)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:24,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.icon_combo_trigger",iconCls:o.iconCls,title:o.title,items:o.items,width:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,value:o.value}),this.popup=BI.createWidget(o.popup,{type:"bi.icon_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.iconCombo.hideView(),self.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:o.direction,trigger:o.trigger,container:o.container,adjustLength:o.adjustLength,adjustXOffset:o.adjustXOffset,adjustYOffset:o.adjustYOffset,offsetStyle:o.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.iconCombo.populate(items)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_icon_text_item",height:24}),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.IconComboPopup.EVENT_CHANGE,val,obj)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items){BI.IconComboPopup.superclass.populate.apply(this,arguments),items=BI.createItems(items,{type:"bi.single_select_icon_text_item",height:24}),this.popup.populate(items)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:24,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var o=this.options,self=this,iconCls="";BI.isKey(o.value)&&(iconCls=this._digest(o.value,o.items)),this.button=BI.createWidget(o.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:iconCls,disableSelected:!0,width:o.isShowDown?o.width-12:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,selected:BI.isNotEmptyString(iconCls)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font font-size-12",width:12,height:8,selected:BI.isNotEmptyString(iconCls)}),this.down.setVisible(o.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:3,bottom:0}]})},_digest:function(v,items){var iconCls="";return v=BI.isArray(v)?v[0]:v,BI.any(items,function(i,item){if(v===item.value)return iconCls=item.iconCls,!0}),iconCls},populate:function(items){var o=this.options;this.options.items=items||[],this.button.setIcon(o.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(v){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var o=this.options,iconCls=this._digest(v,this.options.items);v=BI.isArray(v)?v[0]:v,BI.isNotEmptyString(iconCls)?(this.button.setIcon(iconCls),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(o.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-value-combo",height:24,iconHeight:null,iconWidth:null,value:"",attributes:{tabIndex:0}})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",cls:"icon-text-value-trigger",items:o.items,height:o.height,text:o.text,iconCls:o.iconCls,value:o.value,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth,title:o.title,warningTitle:o.warningTitle}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:o.items,value:o.value,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCombo.hideView(),self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(o.value)&&this.setValue(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.trigger.options.tipType="warning",this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.options.tipType="success",this.element.removeClass("combo-error"))}},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v),this._checkError(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCombo.populate(items)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup",behaviors:{redmark:function(){return!0}}})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_icon_text_item",height:24,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:o.behaviors,value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,val,obj)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items,keyword){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var o=this.options;items=BI.createItems(items,{type:"bi.single_select_icon_text_item",height:24,iconWrapperWidth:o.iconWrapperWidth,iconHeight:o.iconHeight,iconWidth:o.iconWidth}),this.popup.populate(items,keyword)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:24,text:"",items:[],tipType:"",warningTitle:"",attributes:{tabIndex:0}},render:function(){var self=this,o=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",container:o.container,adjustLength:2,toggle:!1,ref:function(){self.combo=this},el:{type:"bi.search_text_value_trigger",cls:"search-text-value-trigger",ref:function(){self.trigger=this},items:o.items,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:o.value,items:o.items,ref:function(){self.popup=this,self.trigger.getSearcher().setAdapter(self.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:252,minHeight:25},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){self.triggerBtn=this},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var o=this.options;BI.isKey(o.value)&&this._checkError(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.element.removeClass("combo-error").addClass("combo-error"),this.trigger.attr("tipType","warning")):(this.element.removeClass("combo-error"),this.trigger.attr("tipType","success"))}},populate:function(items){this.options.items=items,this.combo.populate(items)},setValue:function(v){this.combo.setValue(v),this._checkError(v)},getValue:function(){var value=this.combo.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var self=this,o=this.options;return{type:"bi.vertical",vgap:5,items:[{type:"bi.button_group",ref:function(){self.popup=this},items:BI.createItems(o.items,{type:"bi.single_select_item",textAlign:o.textAlign,height:24}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:o.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,val,obj)}}]}]}},mounted:function(){this.check()},populate:function(find,match,keyword){var items=BI.concat(find,match);BI.SearchTextValueComboPopup.superclass.populate.apply(this,items),items=BI.createItems(items,{type:"bi.single_select_item",height:24}),this.popup.populate(items,keyword)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{extraCls:"bi-search-text-value-trigger bi-border",height:24},render:function(){var self=this,o=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value,o.items),value:o.value,height:o.height,tipText:""},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(obj,callback){var keyword=obj.keyword,finding=BI.Func.getSearchResult(o.items,keyword),matched=finding.match,find=finding.find;callback(find,matched)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]}},_setState:function(v){this.editor.setState(v)},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?result.join(","):BI.isFunction(o.text)?o.text():o.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items},setValue:function(vals){this._setState(this._digest(vals,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:o.items,height:o.height,text:o.text,value:o.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCheckCombo.hideView(),self.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(o.value)&&this.setValue(o.value)},setTitle:function(title){this.trigger.setTitle(title)},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},setWarningTitle:function(title){this.trigger.setWarningTitle(title)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCheckCombo.populate(items)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(o.items),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,val,obj)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},_formatItems:function(items){return BI.map(items,function(i,item){return BI.extend({type:"bi.single_select_item",cls:"bi-list-item",height:24},item)})},populate:function(items){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(items))},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:o.items,height:o.height,text:o.text,value:o.value,warningTitle:o.warningTitle}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:o.chooseType,value:o.value,items:o.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCombo.hideView(),self.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(o.value)&&this._checkError(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.trigger.setTipType("warning"),this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.setTipType("success"),this.element.removeClass("combo-error"))}},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v),this._checkError(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCombo.populate(items)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:20,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.small_select_text_trigger",items:o.items,height:o.height,text:o.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:o.chooseType,items:o.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.SmallTextValueCombo.hideView(),self.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()},populate:function(items){this.options.items=items,this.SmallTextValueCombo.populate(items)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_item",textAlign:o.textAlign,height:24}),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,val,obj)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),items=BI.createItems(items,{type:"bi.single_select_item",height:24}),this.popup.populate(items)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,watermark:o.watermark,allowBlank:!0,errorText:o.errorText,validationChecker:o.validationChecker,quitChecker:o.quitChecker,value:o.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(""),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),self.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self._checkClear(),self.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,v)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){self.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self._checkClear(),self.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){self.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){ +self.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.ClearEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(o.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var res=this.editor.getValue().match(/[\S]+/g);return BI.isNull(res)?"":res[res.length-1]}},setValue:function(v){this.editor.setValue(v),BI.isKey(v)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:o.textAlign,height:o.height,hgap:o.hgap}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=self,self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText(),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword)},_checkText:function(){var o=this.options;""===this.editor.getValue()?(this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setTextStyle:function(style){this.text.setStyle(style)},setValue:function(k){var o=this.options;this.editor.setValue(k),this._checkText(),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword)},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:"left",height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText(),self.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText()},_checkText:function(){var o=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,defaultText:"",text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark tip-text-style",textAlign:"left",height:o.height,text:o.text,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.setValue("")},title:BI.isNotNull(o.tipText)?o.tipText:function(){var title="";return BI.isString(self.stateValue)&&(title=self.stateValue),BI.isArray(self.stateValue)&&1===self.stateValue.length&&(title=self.stateValue[0]),title},warningTitle:o.warningTitle,tipType:o.tipType}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self.fireEvent(BI.StateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(o.text)&&this.setState(o.text)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(v){var o=this.options;return BI.StateEditor.superclass.setValue.apply(this,arguments),this.stateValue=v,BI.isNumber(v)?void(v===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.element.removeClass("bi-water-mark")):v===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(BI.isKey(o.defaultText)?o.defaultText:o.text),BI.isKey(o.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):BI.isString(v)?(this.text.setText(v),void(BI.isKey(o.defaultText)&&o.defaultText===v?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):void(BI.isArray(v)&&(BI.isEmpty(v)?(this.text.setText(BI.isKey(o.defaultText)?o.defaultText:o.text),BI.isKey(o.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark")):1===v.length?(this.text.setText(v[0]),this.text.element.removeClass("bi-water-mark")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark"))))},setTipType:function(v){this.text.options.tipType=v}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24,text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark",textAlign:"left",text:o.text,height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(o.text)&&this.setState(o.text)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(v){var o=this.options;return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(v)?void(v===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):v===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(o.text),this.text.element.addClass("bi-water-mark"))):void(BI.isArray(v)&&1!==v.length?BI.isEmpty(v)?(this.text.setText(o.text),this.text.element.addClass("bi-water-mark")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(v),this.text.setTitle(v),this.text.element.removeClass("bi-water-mark")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor),BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var conf=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var o=this.options,self=this;if(0!==o.buttons.length){var text=[];return BI.each(o.buttons,function(idx,item){text.push({text:item,value:idx})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(text,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,value,obj)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var conf=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var self=this,o=this.options,close=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return close.on(BI.IconButton.EVENT_CHANGE,function(){self.setVisible(!1),self.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-header-background",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:o.title,height:25,lgap:10}},{el:close,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var conf=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button_group=BI.createWidget(o.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:o.items,itemsCreator:function(op,calback){1===op.times&&(self.empty(),BI.nextTick(function(){self.loading()})),o.itemsCreator(op,function(){calback.apply(self,arguments),1===op.times&&BI.nextTick(function(){self.loaded(),self.check()})})},hasNext:o.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.ListPane.EVENT_CHANGE,value,obj)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,vgap:o.vgap,hgap:o.hgap},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(items){this.options.items=items.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(items){this.options.items=this.options.items.concat(items),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(indexes){indexes=indexes||[],BI.removeAt(this.options.items,indexes),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(items){var self=this,o=this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");self.populate.apply(self,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(value){return this.button_group.getIndexByValue(value)},getNodeById:function(id){return this.button_group.getNodeById(id); +},getNodeByValue:function(value){return this.button_group.getNodeByValue(value)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var o=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var self=this,o=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:o.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:o.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.Panel.EVENT_CHANGE,value,obj)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-header-background bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(title){this.text.setValue(title)}}),BI.Panel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var self=this,o=this.options;return[{type:"bi.label",text:o.text,height:o.height,value:o.value,hgap:o.hgap,ref:function(){self.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:2,ref:function(){self.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(v){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),v?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-split-bottom",items:[],height:29},render:function(){var self=this,o=this.options;return{type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.linear_segment_button",height:o.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){self.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.buttonGroup=this}}},setValue:function(v){this.buttonGroup.setValue(v)},setEnabledValue:function(v){this.buttonGroup.setEnabledValue(v)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar",iconWrapperWidth:36},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.toolbar=BI.createWidget(o.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.allSelected=this.isSelected(),type===BI.Events.CLICK&&(self.setAllSelected(self.allSelected),self.fireEvent(BI.SelectList.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(o.el,{type:"bi.list_pane",items:o.items,itemsCreator:function(op,callback){1===op.times&&self.toolbar.setVisible(!1),o.itemsCreator(op,function(items){callback.apply(self,arguments),1===op.times&&(self.toolbar.setVisible(items&&items.length>0),self.toolbar.setEnable(self.isEnabled()&&items&&items.length>0)),self._checkAllSelected()})},onLoaded:o.onLoaded,hasNext:o.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&(self._checkAllSelected(),self.fireEvent(BI.SelectList.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.toolbar,this.list)})))),o.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(o.value)&&this.setValue(o.value)},_checkAllSelected:function(){var selectLength=this.list.getValue().length,notSelectLength=this.getAllLeaves().length-selectLength,hasNext=this.list.hasNext(),isAlreadyAllSelected=this.toolbar.isSelected(),isHalf=selectLength>0&&(notSelectLength>0||!isAlreadyAllSelected&&hasNext);isHalf=isHalf||notSelectLength>0&&hasNext&&isAlreadyAllSelected,this.toolbar.setHalfSelected(isHalf),!isHalf&&this.toolbar.setSelected(selectLength>0&¬SelectLength<=0&&(!hasNext||isAlreadyAllSelected))},setAllSelected:function(v){BI.each(this.getAllButtons(),function(i,btn){(btn.setSelected||btn.setAllSelected).apply(btn,[v])}),this.allSelected=!!v,this.toolbar.setSelected(v),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(b){this.toolbar.setVisible(b)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(data){var selectAll=data.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(selectAll),this.list[selectAll?"setNotSelectedValue":"setValue"](data.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(items){this.toolbar.setVisible(!BI.isEmptyArray(items)),this.toolbar.setEnable(this.isEnabled()&&!BI.isEmptyArray(items)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(enable){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(enable)},resetHeight:function(h){var toolHeight=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(h-toolHeight):this.list.element.css({"max-height":h-toolHeight+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var self=this,o=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var all=o.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:o.el,itemsCreator:function(options,populate){populate(self._getNextItems(options))},hasNext:function(option){return option.count=1),this.setPagerVisible(v>1)},setValue:function(v){this.pager.setValue(v)},setVPage:function(v){this.pager.setValue(v)},setCount:function(count){this.rowCount.setText(count),this.rowCount.setTitle(count)},getCurrentPage:function(){return this.pager.getCurrentPage()},hasPrev:function(){return this.pager.hasPrev()},hasNext:function(){return this.pager.hasNext()},setPagerVisible:function(b){this.editor.setVisible(b),this.allPages.setVisible(b),this.pager.setVisible(b)},populate:function(){this.pager.populate(),this.setPagerVisible(this.options.pages>1)}}),BI.AllCountPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_count_pager",BI.AllCountPager),BI.DirectionPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-direction-pager",height:24,horizontal:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn},vertical:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn}})},_init:function(){BI.DirectionPager.superclass._init.apply(this,arguments);var self=this,o=this.options,v=o.vertical,h=o.horizontal;this._createVPager(),this._createHPager(),this.layout=BI.createWidget({type:"bi.absolute",scrollable:!1,element:this,items:[{el:this.vpager,top:0,right:86},{el:this.vlabel,top:0,right:110},{el:this.hpager,top:0,right:0},{el:this.hlabel,top:0,right:24}]})},_createVPager:function(){var self=this,o=this.options,v=o.vertical;this.vlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:v.curr,title:v.curr,invisible:!0}),this.vpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:v.pages,curr:v.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Up_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev column-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Down_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next column-next-page-h-font bi-list-item-select2"},hasPrev:v.hasPrev,hasNext:v.hasNext,firstPage:v.firstPage,lastPage:v.lastPage}),this.vpager.on(BI.Pager.EVENT_CHANGE,function(){self.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){self.vlabel.setValue(this.getCurrentPage()),self.vlabel.setTitle(this.getCurrentPage())})},_createHPager:function(){var self=this,o=this.options,h=o.horizontal;this.hlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:h.curr,title:h.curr,invisible:!0}),this.hpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:h.pages,curr:h.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Left_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev row-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Right_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next row-next-page-h-font bi-list-item-select2"},hasPrev:h.hasPrev,hasNext:h.hasNext,firstPage:h.firstPage,lastPage:h.lastPage}),this.hpager.on(BI.Pager.EVENT_CHANGE,function(){self.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){self.hlabel.setValue(this.getCurrentPage()),self.hlabel.setTitle(this.getCurrentPage())})},getVPage:function(){return this.vpager.getCurrentPage()},getHPage:function(){return this.hpager.getCurrentPage()},setVPage:function(v){this.vpager.setValue(v),this.vlabel.setValue(v),this.vlabel.setTitle(v)},setHPage:function(v){this.hpager.setValue(v),this.hlabel.setValue(v),this.hlabel.setTitle(v)},hasVNext:function(){return this.vpager.hasNext()},hasHNext:function(){return this.hpager.hasNext()},hasVPrev:function(){return this.vpager.hasPrev()},hasHPrev:function(){return this.hpager.hasPrev()},setHPagerVisible:function(b){this.hpager.setVisible(b),this.hlabel.setVisible(b)},setVPagerVisible:function(b){this.vpager.setVisible(b),this.vlabel.setVisible(b)},populate:function(){this.vpager.populate(),this.hpager.populate();var vShow=!1,hShow=!1;this.hasHNext()||this.hasHPrev()?(this.setHPagerVisible(!0),hShow=!0):this.setHPagerVisible(!1),this.hasVNext()||this.hasVPrev()?(this.setVPagerVisible(!0),vShow=!0):this.setVPagerVisible(!1),this.setVisible(hShow||vShow);var num=[86,110,0,24],items=this.layout.attr("items");vShow===!0&&hShow===!0?(items[0].right=num[0],items[1].right=num[1],items[2].right=num[2],items[3].right=num[3]):vShow===!0?(items[0].right=num[2],items[1].right=num[3]):hShow===!0&&(items[2].right=num[2],items[3].right=num[3]),this.layout.attr("items",items),this.layout.resize()},clear:function(){this.vpager.attr("curr",1),this.hpager.attr("curr",1)}}),BI.DirectionPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.direction_pager",BI.DirectionPager),BI.DetailPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-detail-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.DetailPager.superclass._init.apply(this,arguments);var self=this;this.currPage=BI.result(this.options,"curr"),this._lock=!1,this._debouce=BI.debounce(function(){self._lock=!1},300),this._populate()},_populate:function(){var self=this,o=this.options,view=[],dict={};this.empty();var pages=BI.result(o,"pages"),curr=BI.result(this,"currPage"),groups=BI.result(o,"groups"),first=BI.result(o,"first"),last=BI.result(o,"last"),prev=BI.result(o,"prev"),next=BI.result(o,"next");pages===!1?(groups=0,first=!1,last=!1):groups>pages&&(groups=pages),dict.index=Math.ceil((curr+(groups>1&&groups!==pages?1:0))/(0===groups?1:groups)),(!o.dynamicShow&&!o.dynamicShowPrevNext||curr>1)&&prev!==!1&&(BI.isKey(prev)?view.push({text:prev,value:"prev",disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)}):view.push(BI.extend({disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)},prev))),(!o.dynamicShow&&!o.dynamicShowFirstLast||dict.index>1&&0!==groups)&&first&&(view.push({text:first,value:"first",disabled:!(dict.index>1&&0!==groups)}),dict.index>1&&0!==groups&&view.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),dict.poor=Math.floor((groups-1)/2),dict.start=dict.index>1?curr-dict.poor:1,dict.end=dict.index>1?function(){var max=curr+(groups-dict.poor-1);return max>pages?pages:max}():groups,dict.end-dict.start1&&0!==groups&&pages>groups&&dict.endgroups&&dict.endgroups&&dict.endgroups&&dict.end1},hasNext:function(v){v||(v=1);var o=this.options,pages=this.options.pages;return pages===!1?o.hasNext(v):vlastPage?lastPage:(firstPage=BI.result(o,"firstPage"),vo.pages?o.pages:v,this.currPage=v;this._populate()},getValue:function(){var val=this.button_group.getValue()[0];switch(val){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return val}},attr:function(key,value){BI.DetailPager.superclass.attr.apply(this,arguments),"curr"===key&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.DetailPager.EVENT_CHANGE="EVENT_CHANGE",BI.DetailPager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.detail_pager",BI.DetailPager),BI.SegmentButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.SegmentButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-segment-button bi-list-item-select",shadow:!0,readonly:!0,hgap:5})},_init:function(){BI.SegmentButton.superclass._init.apply(this,arguments);var opts=this.options,self=this;this.text=BI.createWidget({type:"bi.label",element:this,textHeight:opts.height,whiteSpace:opts.whiteSpace,text:opts.text,value:opts.value,hgap:opts.hgap})},setSelected:function(){BI.SegmentButton.superclass.setSelected.apply(this,arguments)},setText:function(text){BI.SegmentButton.superclass.setText.apply(this,arguments),this.text.setText(text)},destroy:function(){BI.SegmentButton.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.segment_button",BI.SegmentButton),BI.Segment=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Segment.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-segment",items:[],height:24})},_init:function(){BI.Segment.superclass._init.apply(this,arguments);var self=this,o=this.options;this.buttonGroup=BI.createWidget({element:this,type:"bi.button_group",value:o.value,items:BI.createItems(o.items,{type:"bi.segment_button",height:o.height-2,whiteSpace:o.whiteSpace}),layout:[{type:"bi.center"}]}),this.buttonGroup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.Segment.EVENT_CHANGE,value,obj)})},_setEnable:function(enable){BI.Segment.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled")},setValue:function(v){this.buttonGroup.setValue(v)},setEnabledValue:function(v){this.buttonGroup.setEnabledValue(v)},getValue:function(){return this.buttonGroup.getValue()}}),BI.Segment.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.segment",BI.Segment),BI.MultiSelectBar=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectBar.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-bar",height:25,text:BI.i18nText("BI-Select_All"),isAllCheckedBySelectedValue:BI.emptyFn,disableSelected:!0,isHalfCheckedBySelectedValue:function(selectedValues){return selectedValues.length>0},halfSelected:!1,iconWrapperWidth:26})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var self=this,o=this.options,isSelect=o.selected===!0,isHalfSelect=!o.selected&&o.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){self.setSelected(self.isSelected())},selected:isSelect, +invisible:isHalfSelect}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){self.setSelected(!0)},invisible:isSelect||!isHalfSelect}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,self.isSelected(),self)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,self.isSelected(),self)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,self.isSelected(),self)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,self.isSelected(),self)}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget({type:"bi.htape",element:this,items:[{width:o.iconWrapperWidth,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(v){this.checkbox.setSelected(!!v)},beforeClick:function(){var isHalf=this.isHalfSelected(),isSelected=this.isSelected();isHalf===!0?this.setSelected(!0):this.setSelected(!isSelected)},setSelected:function(v){this.checkbox.setSelected(v),this.setHalfSelected(!1)},setHalfSelected:function(b){this.halfSelected=!!b,b===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(selectedValues){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var isAllChecked=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(isAllChecked),!isAllChecked&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,this.isSelected(),this)}}),BI.MultiSelectBar.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};BI.isKey(node.id)||(node.id=BI.UUID()),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){BI.isKey(node.id)||(node.id=BI.UUID())})},initTree:function(nodes){var self=this,o=this.options;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},o.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),value:o.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},o.el)}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,value,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.LevelTree.EVENT_CHANGE,value,ob)})},stroke:function(nodes){this.tree.stroke.apply(this.tree,arguments)},populate:function(items,keyword){items=this._formatItems(BI.Tree.transformToTreeFormat(items),0),this.tree.populate(items,keyword)},setValue:function(v){this.tree.setValue(v)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.ListDisplayTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListDisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-list-display-tree"})},_init:function(){BI.ListDisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}function getFont(treeId,node){return node.isLeaf?{}:{color:"#999999"}}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1,fontCss:getFont},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.ListDisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.ListDisplayTree.superclass.destroy.apply(this,arguments)}}),BI.ListDisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_display_tree",BI.ListDisplayTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(op,callback){var fn=function(items){callback({items:items}),self.structure.initTree(BI.Tree.transformToTreeFormat(items))};BI.isNotNull(o.items)?fn(o.items):o.itemsCreator(op,fn)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(o.items)&&this.populate(),BI.isNotNull(o.value)&&this.setValue(o.value)},populate:function(items,keyword){items&&(this.options.items=items),this.tree.stroke({keyword:keyword})},_digest:function(v){v||(v=[]);var self=this,map={},selected=[];return BI.each(v,function(i,val){var node=self.structure.search(val,"value");if(node){var p=node;for(p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++);p&&p.getChildrenLength()<=map[p.value];)selected.push(p.value),p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++)}}),BI.makeObject(v.concat(selected))},setValue:function(v){this.tree.setValue(this._digest(v))},_getValue:function(){var self=this,result=[],val=this.tree.getValue(),track=function(nodes){BI.each(nodes,function(key,node){BI.isEmpty(node)?result.push(key):track(node)})};return track(val),result},empty:function(){this.tree.empty()},getValue:function(){var self=this,result=[],val=this._getValue();return BI.each(val,function(i,key){var target=self.structure.search(key,"value");target&&self.structure._traverse(target,function(node){node.isLeaf()&&result.push(node.value)})}),result}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,title:function(){return self.getValue()}}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:o.triggerWidth||o.height},width:o.triggerWidth||o.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(value){this.editor.setValue(value)},setText:function(text){this.editor.setState(text)}}),BI.EditorTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-trigger",extraCls:"pull-down-font",el:{},height:24})},_init:function(){var o=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(o.el,{type:"bi.trigger_icon_button",element:this,width:o.width,height:o.height,extraCls:o.extraCls})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null,textCls:""})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(o.textCls)?" "+o.textCls:""),textAlign:"left",height:o.height,text:o.text}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(_ref){self.wrapper=_ref},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:o.iconCls,ref:function(_ref){self.icon=_ref},iconHeight:o.iconHeight,iconWidth:o.iconWidth,disableSelected:!0},width:BI.isEmptyString(o.iconCls)?0:o.iconWrapperWidth||o.height},{el:this.text,lgap:BI.isEmptyString(o.iconCls)?5:0},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setValue:function(value){this.text.setValue(value)},setIcon:function(iconCls){var o=this.options;this.icon.setIcon(iconCls);var iconItem=this.wrapper.attr("items")[0],textItem=this.wrapper.attr("items")[1];BI.isNull(iconCls)||BI.isEmptyString(iconCls)?0!==iconItem.width&&(iconItem.width=0,textItem.lgap=5,this.wrapper.resize()):iconItem.width!==(o.iconWrapperWidth||o.height)&&(iconItem.width=o.iconWrapperWidth||o.height,textItem.lgap=0,this.wrapper.resize())},setTextCls:function(cls){var o=this.options,oldCls=o.textCls;o.textCls=cls,this.text.element.removeClass(oldCls).addClass(cls)},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,iconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digist(o.value,o.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:obj.text,textCls:obj.textCls,iconCls:obj.iconCls,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth})},_digist:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result,formatItems=BI.Tree.transformToArrayFormat(items);return BI.any(formatItems,function(i,item){if(BI.deepContains(vals,item.value))return result={text:item.text||item.value,iconCls:item.iconCls},!0}),BI.isNotNull(result)?{text:result.text,textCls:"",iconCls:result.iconCls}:{text:BI.isFunction(o.text)?o.text():o.text,textCls:"bi-water-mark",iconCls:o.iconCls}},setValue:function(vals){var obj=this._digist(vals,this.options.items);this.trigger.setText(obj.text),this.trigger.setIcon(obj.iconCls),this.trigger.setTextCls(obj.textCls)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:24,textCls:""})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(o.textCls)?" "+o.textCls:""),textAlign:"left",height:o.height,text:o.text,title:function(){return self.text.getText()},tipType:o.tipType,warningTitle:o.warningTitle,hgap:c.hgap,readonly:o.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setTextCls:function(cls){var o=this.options,oldCls=o.textCls;o.textCls=cls,this.text.element.removeClass(oldCls).addClass(cls)},setText:function(text){this.text.setText(text)},setTipType:function(v){this.text.options.tipType=v}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border bi-focus-shadow",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digest(o.value,o.items);this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:o.height,readonly:o.readonly,text:obj.text,textCls:obj.textCls,tipType:o.tipType,warningTitle:o.warningTitle})},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?{textCls:"",text:result.join(",")}:{textCls:"bi-water-mark",text:BI.isFunction(o.text)?o.text():o.text}},setValue:function(vals){var formatValue=this._digest(vals,this.options.items);this.trigger.setTextCls(formatValue.textCls),this.trigger.setText(formatValue.text)},setTipType:function(v){this.trigger.setTipType(v)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digest(o.value,o.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:o.height-2,text:obj.text,cls:obj.cls})},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?{cls:"",text:result.join(",")}:{cls:"bi-water-mark",text:o.text}},setValue:function(vals){var formatValue=this._digest(vals,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(formatValue.cls),this.trigger.setText(formatValue.text)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:o.height,text:o.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setValue:function(value){this.text.setValue(value)},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:24,container:null})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup",behaviors:o.behaviors}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",container:o.container,element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.combo.hideView(),self.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.doBehavior()})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo),BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:24,container:null})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:o.behaviors,min:o.min,max:o.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.doBehavior()})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo),BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-picker",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===self._month?self.setValue({year:self.year.getValue()-1,month:12}):self.setValue({year:self.year.getValue(),month:self.month.getValue()-1}),self.fireEvent(BI.DatePicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===self._month?self.setValue({year:self.year.getValue()+1,month:1}):self.setValue({year:self.year.getValue(),month:self.month.getValue()+1}),self.fireEvent(BI.DatePicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",behaviors:o.behaviors,min:o.min,max:o.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){self.setValue({year:self.year.getValue(),month:self.month.getValue()}),self.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo",behaviors:o.behaviors}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){self.setValue({year:self.year.getValue(),month:self.month.getValue()}),self.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:24},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal",width:120,rgap:10,items:[{el:this.year,lgap:10},this.month]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:24}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var o=this.options,valid=!(1===this._month&&this._year===BI.parseDateTime(o.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!(12===this._month&&this._year===BI.parseDateTime(o.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(valid),valid},setValue:function(ob){this._year=BI.parseInt(ob.year),this._month=BI.parseInt(ob.month),this.year.setValue(ob.year),this.month.setValue(ob.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker),BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-year-picker",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(self.year.getValue()-1),self.fireEvent(BI.YearPicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(self.year.getValue()+1),self.fireEvent(BI.YearPicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:o.min,behaviors:o.behaviors,max:o.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){self.setValue(self.year.getValue()),self.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal_float",width:50,items:[{el:this.year}]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var o=this.options,valid=!(this._year===BI.parseDateTime(o.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!(this._year===BI.parseDateTime(o.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(valid),valid},setValue:function(v){this._year=v,this.year.setValue(v),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker),BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:1});return calendar},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=o.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.calendar=BI.createWidget({direction:"top",logic:{dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(self.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){self.selectedTime=self.datePicker.getValue(),self.selectedTime.day=1,self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=self.calendar.getValue(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.calendar,left:5,right:5},{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},setValue:function(timeOb){this.datePicker.setValue(timeOb),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(timeOb)),this.calendar.setValue(timeOb),this.selectedTime=timeOb},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup),BI.MonthPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-popup",behaviors:{}})},_init:function(){BI.MonthPopup.superclass._init.apply(this,arguments);var self=this,o=this.options,month=[1,7,2,8,3,9,4,10,5,11,6,12],items=[];items.push(month.slice(0,2)),items.push(month.slice(2,4)),items.push(month.slice(4,6)),items.push(month.slice(6,8)),items.push(month.slice(8,10)),items.push(month.slice(10,12)),items=BI.map(items,function(i,item){return BI.map(item,function(j,td){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:td,text:td}})}),this.month=BI.createWidget({type:"bi.button_group",element:this,behaviors:o.behaviors,items:BI.createItems(items,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:o.value}),this.month.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.MonthPopup.EVENT_CHANGE)})},getValue:function(){return this.month.getValue()[0]},setValue:function(v){v=BI.parseInt(v),this.month.setValue([v])}}),BI.MonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_popup",BI.MonthPopup),BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(v){var o=this.options,y=this._year,calendar=BI.createWidget({type:"bi.year_calendar",behaviors:o.behaviors,min:o.min,max:o.max,logic:{dynamic:!0},year:y+12*v});return calendar.setValue(this._year),calendar},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.selectedYear=this._year=BI.getDate().getFullYear();var backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24,value:-1}),preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24,value:1});this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-split-top",height:24,items:[backBtn,preBtn]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(self.selectedYear);var calendar=this.getSelectedCard();backBtn.setEnable(!calendar.isFrontYear()),preBtn.setEnable(!calendar.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedYear=this.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.YearPopup.EVENT_CHANGE,self.selectedYear)}),BI.isKey(o.value)&&this.setValue(o.value)},getValue:function(){return this.selectedYear},setValue:function(v){var o=this.options;v=BI.parseInt(v);var startDate=BI.parseDateTime(o.min,"%Y-%X-%d"),endDate=BI.parseDateTime(o.max,"%Y-%X-%d");BI.checkDateVoid(v,1,1,BI.print(BI.getDate(startDate.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(endDate.getFullYear(),0,1),"%Y-%X-%d"))[0]?(v=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue("")):(this.selectedYear=v,this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue(v))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup),BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:24,iconWidth:12,iconHeight:12},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:24})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:o.text,value:o.value,height:c.height}),BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.text, +rgap:5},{type:"bi.icon_label",width:16}]})},setValue:function(v){this.text.setValue(v)},getValue:function(){return this.text.getValue()},setText:function(v){this.text.setText(v)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger),BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=o.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var value=self.datePicker.getValue(),monthDay=BI.getMonthDays(BI.getDate(value.year,value.month-1,1)),day=self.selectedTime.day||0;day>monthDay&&(day=monthDay),self.selectedTime={year:value.year,month:value.month},0!==day&&(self.selectedTime.day=day),self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)),self.calendar.setValue(self.selectedTime),0!==day&&self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=self.calendar.getValue(),self.calendar.empty(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(o.selectedTime),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.datePicker,height:40},this.calendar],hgap:10}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:this.selectedTime.day});return calendar},_getNewCurrentDate:function(){var today=BI.getDate();return{year:today.getFullYear(),month:today.getMonth()+1}},_setCalenderValue:function(date){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)),this.calendar.setValue(date),this.selectedTime=date},_setDatePicker:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.year)||BI.isNull(timeOb.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(timeOb)},_setCalendar:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(timeOb)},setValue:function(timeOb){this._setDatePicker(timeOb),this._setCalendar(timeOb)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard),BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var value=this.getValue()[0];switch(self.dateTab.setSelect(value),value){case BI.DynamicDatePane.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()});break;case BI.DynamicDatePane.Dynamic:self.dynamicPane.setValue({year:0})}self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateCombo.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2}),BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border bi-border-radius",width:200,height:24,minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var self=this,opts=this.options,date=BI.getDate();this.storeValue=BI.isNotNull(opts.value)?opts.value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:opts.minDate,max:opts.maxDate,value:opts.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value}),self.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){self.storeValue=self.popup.getValue(),self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var triggerBtn=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24});triggerBtn.on(BI.IconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:triggerBtn,top:0,right:0}]}]})},setValue:function(v){this.storeValue=v,this.popup.setValue(v),this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo),BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",behaviors:opts.behaviors,min:self.options.min,max:self.options.max}),self.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",ref:function(_ref){self.timeSelect=_ref}}]},height:50},{el:this.dateButton,height:30}]}),this.setValue(opts.value)},setValue:function(v){var value=v,date;BI.isNull(value)?(date=BI.getDate(),this.dateCombo.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue({hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()})):(this.dateCombo.setValue({year:value.year,month:value.month,day:value.day}),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}))},getValue:function(){return BI.extend({year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day},this.timeSelect.getValue())}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup),BI.DateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){return BI.extend(BI.DateTimeTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,width:200})},_init:function(){BI.DateTimeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:o.height,width:o.width,hgap:c.hgap}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text},{el:BI.createWidget(),width:o.height}]}),this.setValue(o.value)},_printTime:function(v){return v<10?"0"+v:v},setValue:function(v){var self=this,value=v,dateStr;if(BI.isNull(value))value=BI.getDate(),dateStr=BI.print(value,"%Y-%X-%d %H:%M:%S");else{var date=BI.getDate(value.year,value.month-1,value.day,value.hour,value.minute,value.second);dateStr=BI.print(date,"%Y-%X-%d %H:%M:%S")}this.text.setText(dateStr),this.text.setTitle(dateStr)}}),BI.shortcut("bi.date_time_trigger",BI.DateTimeTrigger),BI.StaticDateTimePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StaticDateTimePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-time-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDateTimePaneCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=o.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var value=self.datePicker.getValue(),monthDay=BI.getMonthDays(BI.getDate(value.year,value.month-1,1)),day=self.selectedTime.day||0;day>monthDay&&(day=monthDay),self.selectedTime=BI.extend(self.selectedTime,{year:value.year,month:value.month,day:day}),0!==day&&(self.selectedTime.day=day),self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)),self.calendar.setValue(self.selectedTime),0!==day&&self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=BI.extend(self.calendar.getValue(),self.timeSelect.getValue()),self.calendar.empty(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,hgap:10,items:[{el:this.datePicker,height:40},this.calendar,{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){self.selectedTime=BI.extend(self.calendar.getValue(),self.timeSelect.getValue()),self.fireEvent("EVENT_CHANGE")}}]},height:40}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]}),this.setValue(o.selectedTime)},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:this.selectedTime.day});return calendar},_getNewCurrentDate:function(){var today=BI.getDate();return{year:today.getFullYear(),month:today.getMonth()+1}},_setCalenderValue:function(date){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)),this.calendar.setValue(date),this.selectedTime=BI.extend({},this.timeSelect.getValue(),date)},_setDatePicker:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.year)||BI.isNull(timeOb.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(timeOb)},_setCalendar:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(timeOb)},setValue:function(timeOb){timeOb=timeOb||{},this._setDatePicker(timeOb),this._setCalendar(timeOb),this.timeSelect.setValue({hour:timeOb.hour,minute:timeOb.minute,second:timeOb.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var value=this.getValue()[0];switch(self.dateTab.setSelect(value),value){case BI.DynamicDateTimePane.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()});break;case BI.DynamicDateTimePane.Dynamic:self.dynamicPane.setValue({year:0})}}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateTimePane.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:o.items,chooseType:o.chooseType,value:o.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(value){self.fireEvent(BI.DownListCombo.EVENT_CHANGE,value),self.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(value,fatherValue){self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,value,fatherValue),self.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:o.trigger,isNeedAdjustWidth:!1,container:o.container,adjustLength:o.adjustLength,direction:o.direction,stopPropagation:o.stopPropagation,el:BI.createWidget(o.el,{type:"bi.icon_trigger",extraCls:o.iconCls,width:o.width,height:o.height}),popup:{el:this.popupview,stopPropagation:o.stopPropagation,maxHeight:1e3,minWidth:140}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(items){this.popupview.populate(items)},setValue:function(v){this.popupview.setValue(v)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:o.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(v){this.downlistgroup.setValue(v)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:24,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.center_adapt",width:36,height:o.height,items:[{el:{type:"bi.icon",width:o.iconWidth,height:o.iconHeight}}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.DownListItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var o=this.options,self=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:o.text,value:o.value,height:o.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:o.iconCls1,width:36,disableSelected:!0,selected:this._digest(o.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:o.iconCls2,width:24,forceNotSelected:!0});var blank=BI.createWidget({type:"bi.layout",width:24});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,blank)})))),this.element.hover(function(){self.isEnabled()&&self.hover()},function(){self.isEnabled()&&self.dishover()})},_digest:function(v){var self=this,o=this.options;return v=BI.isArray(v)?v:[v],BI.any(v,function(idx,value){return BI.contains(o.childValues,value)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(v){this.icon1.setSelected(this._digest(v))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:24,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var conf=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var self=this,o=this.options,children=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(children,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(o.value),chooseType:o.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(value,object){var changedValue=value;if(BI.isNotNull(self.childValueMap[value])?(changedValue=self.childValueMap[value],self.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,changedValue,self.fatherValueMap[value])):self.fireEvent(BI.DownListPopup.EVENT_CHANGE,changedValue,object),!BI.contains(self.singleValues,changedValue)){var item=self.getValue(),result=[];BI.each(item,function(i,valueObject){valueObject.value!=changedValue&&result.push(valueObject)}),self.setValue(result)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createChildren:function(items){var self=this,result=[];return BI.each(items,function(i,it){var item_done={type:"bi.down_list_group",items:[]};if(BI.each(it,function(i,item){BI.isNotEmptyArray(item.children)&&!BI.isEmpty(item.el)?(item.type="bi.combo_group",item.isDefaultInit=!0,item.cls="down-list-group",item.trigger="hover",item.isNeedAdjustWidth=!1,item.el.title=item.el.title||item.el.text,item.el.type="bi.down_list_group_item",item.el.logic={dynamic:!0},item.el.height=self.constants.height,item.el.iconCls2=self.constants.nextIcon,item.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5,maxHeight:378},item.el.childValues=[],BI.each(item.children,function(i,child){var fatherValue=BI.deepClone(item.el.value),childValue=BI.deepClone(child.value);self.singleValues.push(child.value),child.type="bi.down_list_item",child.extraCls=" child-down-list-item",child.title=child.title||child.text,child.textRgap=10,child.isNeedAdjustWidth=!1,child.logic={dynamic:!0},child.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,child.value=self._createChildValue(fatherValue,childValue),item.el.childValues.push(child.value)})):(item.type="bi.down_list_item",item.title=item.title||item.text,item.textRgap=10,item.isNeedAdjustWidth=!1,item.logic={dynamic:!0});var el_done={};el_done.el=item,item_done.items.push(el_done)}),self._isGroup(item_done.items)&&BI.each(item_done.items,function(i,item){self.singleValues.push(item.el.value)}),result.push(item_done),self._needSpliter(i,items.length)){var spliter_container=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-split-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10,rgap:0});result.push(spliter_container)}}),result},_isGroup:function(i){return i.length>1},_needSpliter:function(i,itemLength){return i0?1:0}},setValue:function(v){v=v||{},this.position=v.position||BI.DynamicDateCard.OFFSET.CURRENT;var values=[],valuesItems=[];BI.isNotNull(v.year)&&(values.push(BI.DynamicDateCard.TYPE.YEAR),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))),BI.isNotNull(v.quarter)&&(values.push(BI.DynamicDateCard.TYPE.QUARTER),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))),BI.isNotNull(v.month)&&(values.push(BI.DynamicDateCard.TYPE.MONTH),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))),BI.isNotNull(v.week)&&(values.push(BI.DynamicDateCard.TYPE.WEEK),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,v.week))),BI.isNotNull(v.day)&&(values.push(BI.DynamicDateCard.TYPE.DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,v.day))),BI.isNotNull(v.workDay)&&(values.push(BI.DynamicDateCard.TYPE.WORK_DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,v.workDay))),this.checkgroup.setValue(values),this.workDayBox.setSelected(BI.isNotNull(v.workDay)),this.resultPane.populate(this._getParamJson(valuesItems,v.position))},getValue:function(){var self=this,valueMap={},selectValues=this.checkgroup.getValue(),buttons=this.resultPane.getAllButtons();if(0!==selectValues.length&&BI.each(buttons,function(idx,button){var value=button.getValue();switch(value.dateType){case BI.DynamicDateCard.TYPE.YEAR:valueMap.year=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.QUARTER:valueMap.quarter=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.MONTH:valueMap.month=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.WEEK:valueMap.week=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.DAY:valueMap.day=0===value.offset?-value.value:value.value}BI.isNull(value.dateType)&&(valueMap.position=self.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var value=buttons[0].getValue();valueMap.workDay=0===value.offset?-value.value:value.value}return valueMap}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:opts.minDate,max:opts.maxDate,format:opts.format,allowEdit:opts.allowEdit,watermark:opts.watermark,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}},self.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value,ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicDateCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var value=self.popup.getValue();self._checkValue(value)&&self.setValue(value),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:opts.height,height:opts.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(){self.triggerBtn=this}},top:0,right:0}]}],ref:function(_ref){self.comboWrapper=_ref}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(v){var o=this.options,type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=o.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},_defaultState:function(){},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var self=this,o=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(v){return BI.isNaturalNumber(v)},value:o.value,ref:function(){self.editor=this},errorText:function(v){return BI.isEmptyString(v)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Natural_Number")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:o.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){self.offsetCombo=this},container:null,value:o.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var text="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:text=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:text=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:text=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:text=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:text=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:text=BI.i18nText("BI-Basic_Work_Day")}return text},setValue:function(v){v=v||{},v.value=v.value||0,v.offset=v.offset||0,this.editor.setValue(v.value),this.offsetCombo.setValue(v.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,c=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),textHeight:c.buttonHeight-1,listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(opts.value)},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){self.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d"},props:{extraCls:"bi-date-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){var formatStr=self._getStandardDateStr(v),date=formatStr.match(/\d+/g);return!BI.isKey(o.format)&&self._autoAppend(v,date),self._dateCheck(formatStr)&&BI.checkDateLegal(formatStr)&&self._checkVoid({year:0|date[0],month:0|date[1],day:0|date[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var str="";return BI.isKey(o.format)||(str=self.editor.isEditing()?BI.i18nText("BI-Date_Trigger_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),str},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.storeTriggerValue=self.getKey(),self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var formatStr=self._getStandardDateStr(value),date=formatStr.match(/\d+/g);self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|date[0],month:0|date[1],day:0|date[2]}}}self.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){self.editor.isValid()&&self.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(o.value)},_getTitle:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,this._getFormatString());return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return BI.isNull(value)||BI.isNull(value.day)?"":BI.print(BI.getDate(value.year,value.month-1,value.day),this._getFormatString())}},_getStandardDateStr:function(v){var c=this._const,result=[0,1,2],formatArray=this._getFormatString().match(/%./g);BI.each(formatArray,function(idx,v){switch(v){case"%Y":case"%y":result[0]=idx;break;case"%X":case"%x":result[1]=idx;break;case"%d":case"%e":default:result[2]=idx}});var date=BI.parseDateTime(v,this._getFormatString());BI.print(date,this._getFormatString())===v&&(v=BI.print(date,c.compareFormat),result=[0,1,2]);var dateArray=v.match(/\d+/g),newArray=[];return BI.each(dateArray,function(idx){newArray[idx]=dateArray[result[idx]]}),newArray.length===result.length&&2===newArray[0].length?BI.print(BI.parseDateTime(newArray.join("-"),c.compareFormat),c.compareFormat):newArray.join("-")},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){return!BI.checkDateVoid(obj.year,obj.month,obj.day,this.options.min,this.options.max)[0]},_autoAppend:function(v,dateObj){if(BI.isNotNull(dateObj)&&BI.checkDateLegal(v))switch(v.length){case this._const.yearLength:this._yearCheck(v)&&this.editor.setValue(v+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var splitMonth=v.split("-")[1];(BI.isNotNull(splitMonth)&&2===splitMonth.length||this._monthCheck(v))&&this.editor.setValue(v+"-")}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,this._getFormatString()),this._const.compareFormat);return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_monthCheck:function(v){var date=BI.parseDateTime(v,this._getFormatString()),dateStr=BI.print(date,this._const.compareFormat);return date.getMonth()>=0&&(BI.print(BI.parseDateTime(v,"%Y-%X"),"%Y-%X")===v||BI.print(BI.parseDateTime(v,"%Y-%x"),"%Y-%x")===v)&&dateStr>=this.options.min&&dateStr<=this.options.max},_setInnerValue:function(date){var dateStr=BI.print(date,this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)},_getText:function(obj){function getPositionText(baseText,position){switch(position){case BI.DynamicDateCard.OFFSET.BEGIN:return baseText+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return baseText+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var value="",endText="";return BI.isNotNull(obj.year)&&(0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Year"),obj.position)),BI.isNotNull(obj.quarter)&&(0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Single_Quarter"),obj.position)),BI.isNotNull(obj.month)&&(0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Month"),obj.position)),BI.isNotNull(obj.week)&&(0!==BI.parseInt(obj.week)&&(value+=Math.abs(obj.week)+BI.i18nText("BI-Basic_Week")+(obj.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Week"),obj.position)),BI.isNotNull(obj.day)&&(0!==BI.parseInt(obj.day)&&(value+=Math.abs(obj.day)+BI.i18nText("BI-Basic_Day")+(obj.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=1===BI.size(obj)?getPositionText(BI.i18nText("BI-Basic_Month"),obj.position):""),BI.isNotNull(obj.workDay)&&0!==BI.parseInt(obj.workDay)&&(value+=Math.abs(obj.workDay)+BI.i18nText("BI-Basic_Work_Day")+(obj.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value+endText},setValue:function(v){var type,value,self=this,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(value)||BI.isNull(value.day))this.editor.setState(""),this.editor.setValue("");else{var dateStr=BI.print(BI.getDate(value.year,value.month-1,value.day),this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue}}),BI.DynamicDateTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTrigger.EVENT_START="EVENT_START",BI.DynamicDateTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_trigger",BI.DynamicDateTrigger),BI.DynamicDateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_time_trigger",min:opts.minDate,max:opts.maxDate,allowEdit:opts.allowEdit,watermark:opts.watermark,format:opts.format,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,action:function(){self.combo.toggle()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_ERROR,action:function(){self.storeValue={type:BI.DynamicDateTimeCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}},self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_VALID,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CONFIRM,action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value,ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicDateTimeCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:0,minute:0,second:0}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var value=self.popup.getValue();self._checkValue(value)&&self.setValue(value),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length}},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:opts.height,height:opts.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(){self.triggerBtn=this}},top:0,right:0}]}],ref:function(_ref){self.comboWrapper=_ref}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(v){var o=this.options,type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicDateTimeCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=o.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(v){switch(v.type){ +case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicDateTimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_time_combo",BI.DynamicDateTimeCombo),BI.extend(BI.DynamicDateTimeCombo,{Static:1,Dynamic:2}),BI.DynamicDateTimePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-time-popup",width:248,height:385},_init:function(){BI.DynamicDateTimePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,c=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(opts.value)},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,ref:function(){self.ymd=this}},{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this}},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self.timeSelect.setValue(),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue(),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){var type=this.dateTab.getSelect();return{type:type,value:type===BI.DynamicDateTimeCombo.Static?BI.extend(this.ymd.getValue(),this.timeSelect.getValue()):this.dynamicPane.getValue()}}}),BI.DynamicDateTimePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_time_popup",BI.DynamicDateTimePopup),BI.DynamicDateTimeSelect=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-select"},render:function(){var self=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){self.hour=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<24},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-23"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkHour(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(value)}}],width:60,height:24}},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.minute=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<60},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkMinute(value),this.setValue(self._formatValueToDoubleDigit(value),BI.DynamicDateTimeSelect.MINUTE),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.MINUTE);this.setValue(value)}}],width:60,height:24},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.second=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<60},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkSecond(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}}],width:60,height:24}]}]}},_checkBorder:function(v){v=v||{},this._checkHour(v.hour),this._checkMinute(v.minute),this._checkSecond(v.second)},_checkHour:function(value){this.hour.setDownEnable(BI.parseInt(value)>0),this.hour.setUpEnable(BI.parseInt(value)<23)},_checkMinute:function(value){this.minute.setDownEnable(BI.parseInt(value)>0),this.minute.setUpEnable(BI.parseInt(value)<59)},_checkSecond:function(value){this.second.setDownEnable(BI.parseInt(value)>0),this.second.setUpEnable(BI.parseInt(value)<59)},_autoSwitch:function(v,type){var limit=0,value=v+"";switch(type){case BI.DynamicDateTimeSelect.HOUR:limit=2;break;case BI.DynamicDateTimeSelect.MINUTE:limit=5}if(1===value.length&&BI.parseInt(value)>limit&&(value="0"+value),2===value.length)switch(type){case BI.DynamicDateTimeSelect.HOUR:this.hour.isEditing()&&this.minute.focus();break;case BI.DynamicDateTimeSelect.MINUTE:this.minute.isEditing()&&this.second.focus();break;case BI.DynamicDateTimeSelect.SECOND:}return value},_formatValueToDoubleDigit:function(v){(BI.isNull(v)||BI.isEmptyString(v))&&(v=0);var value=BI.parseInt(v);return value<10&&(value="0"+value),value},_assertValue:function(v){return v=v||{},v.hour=this._formatValueToDoubleDigit(v.hour)||"00",v.minute=this._formatValueToDoubleDigit(v.minute)||"00",v.second=this._formatValueToDoubleDigit(v.second)||"00",v},getValue:function(){return{hour:BI.parseInt(this.hour.getValue()),minute:BI.parseInt(this.minute.getValue()),second:BI.parseInt(this.second.getValue())}},setValue:function(v){v=this._assertValue(v),this.hour.setValue(v.hour),this.minute.setValue(v.minute),this.second.setValue(v.second),this._checkBorder(v)}}),BI.DynamicDateTimeSelect.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.dynamic_date_time_select",BI.DynamicDateTimeSelect),BI.extend(BI.DynamicDateTimeSelect,{HOUR:1,MINUTE:2,SECOND:3}),BI.DynamicDateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d %H:%M:%S"},props:{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTimeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){var formatStr=self._getStandardDateStr(v),date=formatStr.match(/\d+/g);return!BI.isKey(o.format)&&self._autoAppend(v,date),self._dateCheck(formatStr)&&BI.checkDateLegal(formatStr)&&self._checkVoid({year:0|date[0],month:0|date[1],day:0|date[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var str="";return BI.isKey(o.format)||(str=self.editor.isEditing()?BI.i18nText("BI-Basic_Date_Time_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),str},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.storeTriggerValue=self.getKey(),self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var formatStr=self._getStandardDateStr(value),date=formatStr.match(/\d+/g);self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|date[0],month:0|date[1],day:0|date[2],hour:0|date[3],minute:0|date[4],second:0|date[5]}}}self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(o.value)},_getTitle:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.DynamicDateHelper.getCalculation(value),dateStr=BI.print(date,this._getFormatString());return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return BI.isNull(value)||BI.isNull(value.day)?"":BI.print(BI.getDate(value.year,value.month-1,value.day,value.hour||0,value.minute||0,value.second||0),this._getFormatString())}},_getStandardDateStr:function(v){var c=this._const,result=[],hasSecond=!1,formatArray=this._getFormatString().match(/%./g);BI.each(formatArray,function(idx,v){switch(v){case"%Y":case"%y":result[0]=idx;break;case"%X":case"%x":result[1]=idx;break;case"%d":case"%e":result[2]=idx;break;case"%S":hasSecond=!0}});var date=BI.parseDateTime(v,this._getFormatString());BI.print(date,this._getFormatString())===v&&(v=BI.print(date,c.compareFormat),result=[0,1,2]);var dateArray=v.match(/\d+/g)||[],newArray=[];BI.each(dateArray.slice(0,3),function(idx){newArray[idx]=dateArray[result[idx]]});var suffixArray=dateArray.slice(3);BI.each(suffixArray,function(idx,v){BI.isNumeric(v)&&1===v.length&&(suffixArray[idx]="0"+v)}),2!==suffixArray.length||hasSecond||suffixArray.push("00");var suffixString=suffixArray.join(":"),dateString=newArray.slice(0,3).join("-");return BI.isNotEmptyString(suffixString)&&(dateString+=" "+suffixString),dateString},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){return!BI.checkDateVoid(obj.year,obj.month,obj.day,this.options.min,this.options.max)[0]},_autoAppend:function(v,dateObj){if(BI.isNotNull(dateObj)&&BI.checkDateLegal(v))switch(v.length){case this._const.yearLength:this._yearCheck(v)&&this.editor.setValue(v+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var splitMonth=v.split("-")[1];(BI.isNotNull(splitMonth)&&2===splitMonth.length||this._monthCheck(v))&&this.editor.setValue(v+"-")}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_monthCheck:function(v){var date=BI.parseDateTime(v,"%Y-%X-%d"),dateStr=BI.print(date,"%Y-%X-%d");return date.getMonth()>0&&(BI.print(BI.parseDateTime(v,"%Y-%X"),"%Y-%X")===v||BI.print(BI.parseDateTime(v,"%Y-%x"),"%Y-%x")===v)&&dateStr>=this.options.min&&dateStr<=this.options.max},_setInnerValue:function(date){var dateStr=BI.print(date,this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)},_getText:function(obj){function getPositionText(baseText,position){switch(position){case BI.DynamicDateCard.OFFSET.BEGIN:return baseText+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return baseText+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var value="",endText="";return BI.isNotNull(obj.year)&&(0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Year"),obj.position)),BI.isNotNull(obj.quarter)&&(0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Single_Quarter"),obj.position)),BI.isNotNull(obj.month)&&(0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Month"),obj.position)),BI.isNotNull(obj.week)&&(0!==BI.parseInt(obj.week)&&(value+=Math.abs(obj.week)+BI.i18nText("BI-Basic_Week")+(obj.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Week"),obj.position)),BI.isNotNull(obj.day)&&(0!==BI.parseInt(obj.day)&&(value+=Math.abs(obj.day)+BI.i18nText("BI-Basic_Day")+(obj.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=1===BI.size(obj)?getPositionText(BI.i18nText("BI-Basic_Month"),obj.position):""),BI.isNotNull(obj.workDay)&&0!==BI.parseInt(obj.workDay)&&(value+=Math.abs(obj.workDay)+BI.i18nText("BI-Basic_Work_Day")+(obj.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value+endText},setValue:function(v){var type,value,self=this,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(value)||BI.isNull(value.day))this.editor.setState(""),this.editor.setValue("");else{var dateStr=BI.print(BI.getDate(value.year,value.month-1,value.day,value.hour||0,value.minute||0,value.second||0),this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue},isValid:function(){return this.editor.isValid()}}),BI.DynamicDateTimeTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeTrigger.EVENT_START="EVENT_START",BI.DynamicDateTimeTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTimeTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_time_trigger",BI.DynamicDateTimeTrigger),BI.SearchEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-search-editor bi-border bi-focus-shadow",height:24,errorText:"",watermark:BI.i18nText("BI-Basic_Search"),validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){this.options.height-=2,BI.SearchEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,watermark:o.watermark,allowBlank:!0,hgap:1,errorText:o.errorText,validationChecker:o.validationChecker,quitChecker:o.quitChecker,value:o.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"close-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(""),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),self.fireEvent(BI.SearchEditor.EVENT_CHANGE),self.fireEvent(BI.SearchEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:{type:"bi.icon_label",cls:"search-font"},width:24},{el:self.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SearchEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SearchEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SearchEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self._checkClear(),self.fireEvent(BI.SearchEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN,v)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SearchEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SearchEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.SearchEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SearchEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SearchEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self._checkClear(),self.fireEvent(BI.SearchEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){self.fireEvent(BI.SearchEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.SearchEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.SearchEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SearchEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SearchEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SearchEditor.EVENT_STOP)}),this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var res=this.editor.getValue().match(/[\S]+/g);return BI.isNull(res)?"":res[res.length-1]}},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(v){this.editor.setValue(v),BI.isKey(v)&&this.clear.visible()},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()}}),BI.SearchEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SearchEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SearchEditor.EVENT_BLUR="EVENT_BLUR",BI.SearchEditor.EVENT_CLICK="EVENT_CLICK",BI.SearchEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SearchEditor.EVENT_SPACE="EVENT_SPACE",BI.SearchEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.SearchEditor.EVENT_CLEAR="EVENT_CLEAR",BI.SearchEditor.EVENT_START="EVENT_START",BI.SearchEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SearchEditor.EVENT_STOP="EVENT_STOP",BI.SearchEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SearchEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SearchEditor.EVENT_VALID="EVENT_VALID",BI.SearchEditor.EVENT_ERROR="EVENT_ERROR",BI.SearchEditor.EVENT_ENTER="EVENT_ENTER",BI.SearchEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SearchEditor.EVENT_REMOVE="EVENT_REMOVE",BI.SearchEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.search_editor",BI.SearchEditor),BI.SmallSearchEditor=BI.inherit(BI.SearchEditor,{_defaultConfig:function(){var conf=BI.SmallSearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-small-search-editor",height:20})},_init:function(){BI.SmallSearchEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_search_editor",BI.SmallSearchEditor),BI.TextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.TextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-text-editor bi-border bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:"",height:24})},_init:function(){BI.TextEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNumber(o.height)&&this.element.css({height:o.height-2}),BI.isNumber(o.width)&&this.element.css({width:o.width-2}),this.editor=BI.createWidget({type:"bi.editor",height:o.height-2,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,title:o.title,tipType:o.tipType,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.TextEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.TextEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.TextEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.TextEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN)}),this.editor.on(BI.Editor.EVENT_SPACE,function(v){self.fireEvent(BI.TextEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(v){self.fireEvent(BI.TextEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.TextEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.TextEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.TextEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(v){self.fireEvent(BI.TextEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.TextEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.TextEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.TextEditor.EVENT_STOP)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.TextEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.TextEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.TextEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.TextEditor.EVENT_EMPTY)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]})},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isValid:function(){return this.editor.isValid()},setValue:function(v){this.editor.setValue(v)},getValue:function(){return this.editor.getValue()}}),BI.TextEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextEditor.EVENT_FOCUS="EVENT_FOCUS",BI.TextEditor.EVENT_BLUR="EVENT_BLUR",BI.TextEditor.EVENT_CLICK="EVENT_CLICK",BI.TextEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TextEditor.EVENT_SPACE="EVENT_SPACE",BI.TextEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.TextEditor.EVENT_START="EVENT_START",BI.TextEditor.EVENT_PAUSE="EVENT_PAUSE",BI.TextEditor.EVENT_STOP="EVENT_STOP",BI.TextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.TextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.TextEditor.EVENT_VALID="EVENT_VALID",BI.TextEditor.EVENT_ERROR="EVENT_ERROR",BI.TextEditor.EVENT_ENTER="EVENT_ENTER",BI.TextEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.TextEditor.EVENT_REMOVE="EVENT_REMOVE",BI.TextEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.text_editor",BI.TextEditor),BI.SmallTextEditor=BI.inherit(BI.TextEditor,{_defaultConfig:function(){var conf=BI.SmallTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-small-text-editor",height:20})},_init:function(){BI.SmallTextEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_text_editor",BI.SmallTextEditor),BI.IntervalSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:58,EDITOR_R_GAP:60,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-interval-slider bi-slider-track",digit:!1,unit:""},render:function(){var self=this,c=this._constant;return this.enable=!1,this.valueOne="",this.valueTwo="",this.calculation=new BI.AccurateCalculationModel,this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.labelOne=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:c.EDITOR_WIDTH,validationChecker:function(v){return self._checkValidation(v)}}),this.labelOne.element.hover(function(){self.labelOne.element.removeClass("bi-border").addClass("bi-border")},function(){self.labelOne.element.removeClass("bi-border")}),this.labelOne.on(BI.Editor.EVENT_CONFIRM,function(){var oldValueOne=self.valueOne,v=BI.parseFloat(this.getValue());self.valueOne=v;var percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderOnePosition(significantPercent),self._setBlueTrack(),self._checkLabelPosition(oldValueOne,self.valueTwo,self.valueOne,self.valueTwo),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.labelTwo=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:c.EDITOR_WIDTH,validationChecker:function(v){return self._checkValidation(v)}}),this.labelTwo.element.hover(function(){self.labelTwo.element.removeClass("bi-border").addClass("bi-border")},function(){self.labelTwo.element.removeClass("bi-border")}),this.labelTwo.on(BI.Editor.EVENT_CONFIRM,function(){var oldValueTwo=self.valueTwo,v=BI.parseFloat(this.getValue());self.valueTwo=v;var percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderTwoPosition(significantPercent),self._setBlueTrack(),self._checkLabelPosition(self.valueOne,oldValueTwo,self.valueOne,self.valueTwo),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.sliderOne=BI.createWidget({type:"bi.single_slider_button"}),this.sliderTwo=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.sliderOne,!0),this._draggable(this.sliderTwo,!1),this._setVisible(!1),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:23,left:0,width:"100%"},this._createLabelWrapper(),this._createSliderWrapper()]}},_rePosBySizeAfterMove:function(size,isLeft){var o=this.options,percent=100*size/this._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1)),v=this._getValueByPercent(significantPercent);v=this._assertValue(v),v=o.digit===!1?v:v.toFixed(o.digit);var oldValueOne=this.valueOne,oldValueTwo=this.valueTwo;isLeft?(this._setSliderOnePosition(significantPercent),this.labelOne.setValue(v),this.valueOne=v,this._checkLabelPosition(oldValueOne,oldValueTwo,v,this.valueTwo)):(this._setSliderTwoPosition(significantPercent),this.labelTwo.setValue(v),this.valueTwo=v,this._checkLabelPosition(oldValueOne,oldValueTwo,this.valueOne,v)),this._setBlueTrack()},_rePosBySizeAfterStop:function(size,isLeft){var percent=100*size/this._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1)); +isLeft?this._setSliderOnePosition(significantPercent):this._setSliderTwoPosition(significantPercent)},_draggable:function(widget,isLeft){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){mouseMoveTracker.isDragging()&&(startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging"),self._rePosBySizeAfterMove(size,isLeft))},function(){startDrag===!0&&(size=optimizeSize(size),self._rePosBySizeAfterStop(size,isLeft),size=0,offset=0,defaultSize=size,startDrag=!1),widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createLabelWrapper:function(){var c=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.labelOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.labelTwo,top:0,left:"100%"}]}],rgap:c.EDITOR_R_GAP,height:c.SLIDER_HEIGHT},top:0,left:0,width:"100%"}},_createSliderWrapper:function(){var c=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.sliderOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.sliderTwo,top:0,left:"100%"}]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT},top:20,left:0,width:"100%"}},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){var o=this.options,valid=!1,dotText=(v+"").split(".")[1];return BI.isEmptyString(dotText)||BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max)&&(o.digit===!1?valid=!0:(dotText=dotText||"",valid=dotText.length===o.digit)),valid},_checkOverlap:function(){var labelOneLeft=this.labelOne.element[0].offsetLeft,labelTwoLeft=this.labelTwo.element[0].offsetLeft;labelOneLeft<=labelTwoLeft?labelTwoLeft-labelOneLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0}):labelOneLeft-labelTwoLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_checkLabelPosition:function(oldValueOne,oldValueTwo,valueOne,valueTwo,isLeft){if(oldValueOne=BI.parseFloat(oldValueOne),oldValueTwo=BI.parseFloat(oldValueTwo),valueOne=BI.parseFloat(valueOne),valueTwo=BI.parseFloat(valueTwo),oldValueOne<=oldValueTwo&&valueOne>valueTwo||oldValueOne>=oldValueTwo&&valueOne-1){arr=pre.split("e");var decimalPartLength=BI.size(arr[0].split(".")[1]),sciencePartLength=BI.parseInt(arr[1].substring(1));return decimalPartLength-sciencePartLength}return arr=pre.split("."),arr.length>1?arr[1].length:0},_assertValue:function(value){return value<=this.min?this.min:value>=this.max?this.max:value},_setEnable:function(b){BI.IntervalSlider.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(v){var minNumber=BI.parseFloat(v.min),maxNumber=BI.parseFloat(v.max);!isNaN(minNumber)&&!isNaN(maxNumber)&&maxNumber>=minNumber&&(this.min=minNumber,this.max=maxNumber,this.valueOne=minNumber,this.valueTwo=maxNumber,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),maxNumber===minNumber&&this._setDraggableEnable(!1)},setValue:function(v){var o=this.options,valueOne=BI.parseFloat(v.min),valueTwo=BI.parseFloat(v.max);valueOne=o.digit===!1?valueOne:valueOne.toFixed(o.digit),valueTwo=o.digit===!1?valueTwo:valueTwo.toFixed(o.digit),isNaN(valueOne)||isNaN(valueTwo)||(this._checkValidation(valueOne)&&(this.valueOne=this.valueOne<=this.valueTwo?valueOne:valueTwo),this._checkValidation(valueTwo)&&(this.valueTwo=this.valueOne<=this.valueTwo?valueTwo:valueOne),valueOnethis.max&&(this.valueTwo=this.max))},reset:function(){this._setVisible(!1),this.enable=!1,this.valueOne="",this.valueTwo="",this.min=NaN,this.max=NaN,this._setBlueTrackWidth(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this.enable=!0,this._setVisible(!0),this._setErrorText(),(BI.isNumeric(this.valueOne)||BI.isNotEmptyString(this.valueOne))&&(BI.isNumeric(this.valueTwo)||BI.isNotEmptyString(this.valueTwo))?(this.labelOne.setValue(this.valueOne),this.labelTwo.setValue(this.valueTwo),this._setAllPosition(this._getPercentByValue(this.valueOne),this._getPercentByValue(this.valueTwo))):(this.labelOne.setValue(this.min),this.labelTwo.setValue(this.max),this._setAllPosition(0,100)))}}),BI.IntervalSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.interval_slider",BI.IntervalSlider),BI.AccurateCalculationModel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this,arguments),{baseCls:""})},_init:function(){BI.AccurateCalculationModel.superclass._init.apply(this,arguments)},_getMagnitude:function(n){for(var magnitude="1",i=0;i0)var needAddZero=stringNumber2;else{var needAddZero=stringNumber1;magnitudeDiff=0-magnitudeDiff}for(var i=0;i=num2.numDecimal.length?num1.numDecimal.length:num2.numDecimal.length}function addZero(resultTemp,length){for(var diff=length-resultTemp.length,i=0;i=BI.parseInt(stringNumber2.numDecimal))var decimalResultTemp=(BI.parseInt(stringNumber1.numDecimal)-BI.parseInt(stringNumber2.numDecimal)).toString(),decimalResult=addZero(decimalResultTemp,decimalMaxLength);else{integerResult--;var borrow=this._getMagnitude(decimalMaxLength),decimalResultTemp=(borrow+BI.parseInt(stringNumber1.numDecimal)-BI.parseInt(stringNumber2.numDecimal)).toString(),decimalResult=addZero(decimalResultTemp,decimalMaxLength)}var result=integerResult+"."+decimalResult;return BI.parseFloat(result)},_accurateAddition:function(num1,num2){function addZero(resultTemp,length){for(var diff=length-resultTemp.length,i=0;in)var integerResult=stringNumber.numInteger.slice(0,stringNumber.numInteger.length-n),partDecimalResult=stringNumber.numInteger.slice(-n);else var integerResult="0",partDecimalResult=addZero(stringNumber.numInteger,n);var result=integerResult+"."+partDecimalResult+stringNumber.numDecimal;return BI.parseFloat(result)},accurateSubtraction:function(num1,num2){return num1>=0&&num2>=0?num1>=num2?this._accurateSubtraction(num1,num2):-this._accurateSubtraction(num2,num1):num1>=0&&num2<0?this._accurateAddition(num1,-num2):num1<0&&num2>=0?-this._accurateAddition(-num1,num2):num1<0&&num2<0?num1>=num2?this._accurateSubtraction(-num2,-num1):this._accurateSubtraction(-num1,-num2):void 0},accurateAddition:function(num1,num2){return num1>=0&&num2>=0?this._accurateAddition(num1,num2):num1>=0&&num2<0?this.accurateSubtraction(num1,-num2):num1<0&&num2>=0?this.accurateSubtraction(num2,-num1):num1<0&&num2<0?-this._accurateAddition(-num1,-num2):void 0},accurateMultiplication:function(num1,num2){return num1>=0&&num2>=0?this._accurateMultiplication(num1,num2):num1>=0&&num2<0?-this._accurateMultiplication(num1,-num2):num1<0&&num2>=0?-this._accurateMultiplication(-num1,num2):num1<0&&num2<0?this._accurateMultiplication(-num1,-num2):void 0},accurateDivisionTenExponent:function(num1,n){return num1>=0?this._accurateDivisionTenExponent(num1,n):-this._accurateDivisionTenExponent(-num1,n)}}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popupview=BI.createWidget({type:"bi.multi_layer_down_list_popup",items:o.items,chooseType:o.chooseType,value:o.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(value){self.fireEvent(BI.DownListCombo.EVENT_CHANGE,value),self.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(value,fatherValue){self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,value,fatherValue),self.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:o.trigger,isNeedAdjustWidth:!1,container:o.container,adjustLength:o.adjustLength,direction:o.direction,stopPropagation:o.stopPropagation,el:BI.createWidget(o.el,{type:"bi.icon_trigger",extraCls:o.iconCls?o.iconCls:"pull-down-font",width:o.width,height:o.height}),popup:{el:this.popupview,stopPropagation:o.stopPropagation,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(items){this.popupview.populate(items)},setValue:function(v){this.popupview.setValue(v)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_layer_down_list_combo",BI.DownListCombo),BI.MultiLayerDownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var conf=BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.MultiLayerDownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={};var self=this,o=this.options,children=this._createPopupItems(o.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(children,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(o.value),chooseType:o.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(value,object){var changedValue=value;if(BI.isNotNull(self.childValueMap[value])){changedValue=self.childValueMap[value];var fatherValue=self.fatherValueMap[value],fatherArrayValue=(fatherValue+"").split("_");self.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE,changedValue,fatherArrayValue.length>1?fatherArrayValue:fatherValue)}else self.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE,changedValue,object);if(!BI.contains(self.singleValues,changedValue)){var item=self.getValue(),result=[];BI.each(item,function(i,valueObject){valueObject.value!=changedValue&&result.push(valueObject)}),self.setValue(result)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createPopupItems:function(items){var self=this,result=[];return BI.each(items,function(i,it){var item_done={type:"bi.down_list_group",items:[]};if(BI.each(it,function(i,item){BI.isNotEmptyArray(item.children)&&!BI.isEmpty(item.el)?(item.type="bi.combo_group",item.cls="down-list-group",item.trigger="hover",item.isNeedAdjustWidth=!1,item.el.title=item.el.title||item.el.text,item.el.type="bi.down_list_group_item",item.el.logic={dynamic:!0},item.el.height=self.constants.height,item.el.iconCls2=self.constants.nextIcon,item.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5},item.el.childValues=[],BI.each(item.children,function(i,child){child=child.el?BI.extend(child.el,{children:child.children}):child;var fatherValue=BI.deepClone(item.el.value),childValue=BI.deepClone(child.value);self.singleValues.push(child.value),child.type="bi.down_list_item",child.extraCls=" child-down-list-item",child.title=child.title||child.text,child.textRgap=10,child.isNeedAdjustWidth=!1,child.logic={dynamic:!0},child.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,child.value=self._createChildValue(fatherValue,childValue),item.el.childValues.push(child.value),BI.isNotEmptyArray(child.children)&&(child.type="bi.down_list_group_item",self._createChildren(child),child.height=self.constants.height,child.iconCls2=self.constants.nextIcon,item.el.childValues=BI.concat(item.el.childValues,child.childValues))})):(item.type="bi.down_list_item",item.title=item.title||item.text,item.textRgap=10,item.isNeedAdjustWidth=!1,item.logic={dynamic:!0});var el_done={};el_done.el=item,item_done.items.push(el_done)}),self._isGroup(item_done.items)&&BI.each(item_done.items,function(i,item){self.singleValues.push(item.el.value)}),result.push(item_done),self._needSpliter(i,items.length)){var spliter_container=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10});result.push(spliter_container)}}),result},_createChildren:function(child){var self=this;child.childValues=[],BI.each(child.children,function(i,c){var fatherValue=BI.deepClone(child.value),childValue=BI.deepClone(c.value);c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0},c.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,c.value=self._createChildValue(fatherValue,childValue),child.childValues.push(c.value)})},_isGroup:function(i){return i.length>1},_needSpliter:function(i,itemLength){return i1?fatherArrayValue:fartherValue}else valueItem.value=value;result.push(valueItem)}),result}}),BI.MultiLayerDownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.multi_layer_down_list_popup",BI.MultiLayerDownListPopup),BI.MultiLayerSelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1})},render:function(){var self=this,o=this.options,combo=o.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return o.allowEdit||o.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:combo,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(_ref){self.triggerBtn=_ref},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}:combo},_getBaseConfig:function(){var self=this,o=this.options;return{type:"bi.combo",container:o.container,adjustLength:2,ref:function(_ref){self.combo=_ref},popup:{el:{type:"bi.multilayer_select_tree_popup",isDefaultInit:o.isDefaultInit,itemsCreator:o.itemsCreator,items:o.items,ref:function(_ref){self.trigger&&self.trigger.getSearcher().setAdapter(_ref)},listeners:[{eventName:BI.MultiLayerSelectTreePopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:400,minHeight:240}}},_getSearchConfig:function(){var self=this,o=this.options;return{el:{type:"bi.multilayer_select_tree_trigger",allowInsertValue:o.allowInsertValue,allowSearchValue:o.allowSearchValue,allowEdit:o.allowEdit,cls:"multilayer-select-tree-trigger",ref:function(_ref){self.trigger=_ref},items:o.items,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,action:function(){var value=self.trigger.getSearcher().getKeyword();self.combo.setValue([value]),self.combo.hideView()}}]},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}}]}},_getSyncConfig:function(){var o=this.options,baseConfig=this._getBaseConfig();return BI.extend(baseConfig,o.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}})},_getAsyncConfig:function(){var config=this._getBaseConfig();return BI.extend(config,this._getSearchConfig())},setValue:function(v){v=BI.isArray(v)?v:[v],this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this.combo.populate(items)}}),BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_combo",BI.MultiLayerSelectTreeCombo),BI.MultiLayerSelectTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var self=this,o=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){o.itemsCreator(op,function(res){callback(res),self.setKeyword(o.keywordGetter())})},keywordGetter:o.keywordGetter,value:o.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(_ref){self.addNotMatchTip=_ref},handler:function(){self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,o.keywordGetter())}},this.tree]}},setKeyword:function(keyword){var showTip=BI.isEmptyArray(this.tree.getAllLeaves());this.addNotMatchTip.setVisible(showTip),showTip&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_insert_search_pane",BI.MultiLayerSelectTreeInsertSearchPane),BI.MultiLayerSelectLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,value:"",scrollable:!0})},_init:function(){var o=this.options;BI.MultiLayerSelectLevelTree.superclass._init.apply(this,arguments),this.storeValue=o.value,this.initTree(this.options.items),this.check()},_formatItems:function(nodes,layer,pNode){var self=this,o=this.options,keyword=o.keywordGetter();return BI.each(nodes,function(i,node){var extend={};node.layer=layer,BI.isKey(node.id)||(node.id=BI.UUID()),node.keyword=node.keyword||keyword,extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.multilayer_select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.multilayer_select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.multilayer_select_tree_first_plus_group_node"),0!==i||i!==nodes.length-1||pNode||(extend.type="bi.multilayer_select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){node.id=node.id||BI.UUID()})},initTree:function(nodes){var self=this,o=this.options,hasNext=!1;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{type:"bi.select_tree_expander",isDefaultInit:o.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),itemsCreator:function(op,callback){1===op.times&&!op.node&&BI.nextTick(function(){self.loading()}),o.itemsCreator(op,function(ob){hasNext=ob.hasNext,1===op.times&&!op.node&&self._populate(ob.items),callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items),op.node?op.node.layer+1:0,op.node)),self.setValue(self.storeValue),1===op.times&&!op.node&&BI.nextTick(function(){self.loaded()})})},value:o.value,el:{type:"bi.loader",isDefaultInit:o.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:o.chooseType,behaviors:o.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return hasNext}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,value){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&(self.setValue(value),self.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,arguments))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:o.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(nodes){this._populate(nodes),BI.isNull(nodes)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes),0))},setValue:function(v){this.options.chooseType===BI.Selection.None||(this.storeValue=v,this.tree.setValue(v))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.MultiLayerSelectLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_level_tree",BI.MultiLayerSelectLevelTree),BI.MultiLayerSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator,keywordGetter:o.keywordGetter,value:o.value,scrollable:null}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE)})},getValue:function(){return this.tree.getValue(); +},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_popup",BI.MultiLayerSelectTreePopup),BI.MultiLayerSelectTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",height:24,valueFormatter:function(v){return v},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1}},render:function(){var self=this,o=this.options;o.itemsCreator===BI.emptyFn&&this._initData();var content={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value),value:o.value,height:o.height,tipText:"",watermark:o.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:o.allowInsertValue?"bi.multilayer_select_tree_insert_search_pane":"bi.multilayer_select_tree_popup",itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},keywordGetter:function(){return self.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){self.options.text=self.getSearcher().getKeyword(),self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(_ref){self.popup=_ref}},onSearch:function(obj,callback){var keyword=obj.keyword;o.itemsCreator===BI.emptyFn?(callback(self._getSearchItems(keyword)),o.allowInsertValue&&self.popup.setKeyword(keyword)):callback()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData(items)},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSelectTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_select_tree_trigger",BI.MultiLayerSelectTreeTrigger),BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_first_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_first_plus_group_node",BI.MultiLayerSelectTreeFirstPlusGroupNode),BI.MultiLayerSelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_last_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_last_plus_group_node",BI.MultiLayerSelectTreeLastPlusGroupNode),BI.MultiLayerSelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-mid-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_mid_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_mid_plus_group_node",BI.MultiLayerSelectTreeMidPlusGroupNode),BI.MultiLayerSelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreePlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_plus_group_node",BI.MultiLayerSelectTreePlusGroupNode),BI.MultiLayerSingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1})},render:function(){var self=this,o=this.options,combo=o.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return o.allowEdit||o.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:combo,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(_ref){self.triggerBtn=_ref},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}:combo},_getBaseConfig:function(){var self=this,o=this.options;return{type:"bi.combo",container:o.container,adjustLength:2,ref:function(_ref){self.combo=_ref},popup:{el:{type:"bi.multilayer_single_tree_popup",isDefaultInit:o.isDefaultInit,itemsCreator:o.itemsCreator,items:o.items,ref:function(_ref){self.trigger&&self.trigger.getSearcher().setAdapter(_ref)},listeners:[{eventName:BI.MultiLayerSingleTreePopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:400,minHeight:240}}},_getSearchConfig:function(){var self=this,o=this.options;return{el:{type:"bi.multilayer_single_tree_trigger",allowInsertValue:o.allowInsertValue,allowSearchValue:o.allowSearchValue,allowEdit:o.allowEdit,cls:"multilayer-single-tree-trigger",ref:function(_ref){self.trigger=_ref},watermark:o.watermark,items:o.items,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,action:function(){var value=self.trigger.getSearcher().getKeyword();self.combo.setValue([value]),self.combo.hideView()}}]},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}}]}},_getSyncConfig:function(){var o=this.options,baseConfig=this._getBaseConfig();return BI.extend(baseConfig,o.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}})},_getAsyncConfig:function(){var config=this._getBaseConfig();return BI.extend(config,this._getSearchConfig())},setValue:function(v){v=BI.isArray(v)?v:[v],this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this.combo.populate(items)}}),BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_combo",BI.MultiLayerSingleTreeCombo),BI.MultiLayerSingleTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-single-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var self=this,o=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){o.itemsCreator(op,function(res){callback(res),self.setKeyword(o.keywordGetter())})},keywordGetter:o.keywordGetter,value:o.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(_ref){self.addNotMatchTip=_ref},handler:function(){self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,o.keywordGetter())}},this.tree]}},setKeyword:function(keyword){var showTip=BI.isEmptyArray(this.tree.getAllLeaves());this.addNotMatchTip.setVisible(showTip),showTip&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_insert_search_pane",BI.MultiLayerSingleTreeInsertSearchPane),BI.MultiLayerSingleLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,chooseType:BI.Selection.Single,scrollable:!0})},_init:function(){var o=this.options;BI.MultiLayerSingleLevelTree.superclass._init.apply(this,arguments),this.storeValue=o.value,this.initTree(this.options.items),this.check()},_formatItems:function(nodes,layer,pNode){var self=this,o=this.options,keyword=o.keywordGetter();return BI.each(nodes,function(i,node){var extend={};node.layer=layer,BI.isKey(node.id)||(node.id=BI.UUID()),node.keyword=node.keyword||keyword,extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.multilayer_single_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_plus_group_node"),0!==i||i!==nodes.length-1||pNode||(extend.type="bi.multilayer_single_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){node.id=node.id||BI.UUID()})},initTree:function(nodes){var self=this,o=this.options,hasNext=!1;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{isDefaultInit:o.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),value:o.value,itemsCreator:function(op,callback){1===op.times&&!op.node&&BI.nextTick(function(){self.loading()}),o.itemsCreator(op,function(ob){hasNext=ob.hasNext,1===op.times&&!op.node&&self._populate(ob.items),callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items),op.node?op.node.layer+1:0,op.node)),self.setValue(self.storeValue),1===op.times&&!op.node&&BI.nextTick(function(){self.loaded()})})},el:{type:"bi.loader",isDefaultInit:o.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:o.chooseType,behaviors:o.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return hasNext}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,v){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&(self.setValue(v),self.fireEvent(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,v))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:o.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(nodes){this._populate(nodes),BI.isNull(nodes)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes),0))},setValue:function(v){this.options.chooseType===BI.Selection.None||(this.storeValue=v,this.tree.setValue(v))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.MultiLayerSingleLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_level_tree",BI.MultiLayerSingleLevelTree),BI.MultiLayerSingleTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-singletree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.MultiLayerSingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.multilayer_single_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator,keywordGetter:o.keywordGetter,value:o.value,scrollable:null}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_popup",BI.MultiLayerSingleTreePopup),BI.MultiLayerSingleTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",height:24,valueFormatter:function(v){return v},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1}},render:function(){var self=this,o=this.options;o.itemsCreator===BI.emptyFn&&this._initData();var content={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value),value:o.value,height:o.height,tipText:"",watermark:o.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:o.allowInsertValue?"bi.multilayer_single_tree_insert_search_pane":"bi.multilayer_single_tree_popup",itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},keywordGetter:function(){return self.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){self.options.text=self.getSearcher().getKeyword(),self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(_ref){self.popup=_ref}},onSearch:function(obj,callback){var keyword=obj.keyword;o.itemsCreator===BI.emptyFn?(callback(self._getSearchItems(keyword)),o.allowInsertValue&&self.popup.setKeyword(keyword)):callback()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData()},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSingleTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_single_tree_trigger",BI.MultiLayerSingleTreeTrigger),BI.MultiLayerSingleTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-first-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.first_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_first_plus_group_node",BI.MultiLayerSingleTreeFirstPlusGroupNode),BI.MultiLayerSingleTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-last-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.last_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_last_plus_group_node",BI.MultiLayerSingleTreeLastPlusGroupNode),BI.MultiLayerSingleTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-mid-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background", +width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.mid_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_mid_plus_group_node",BI.MultiLayerSingleTreeMidPlusGroupNode),BI.MultiLayerSingleTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_plus_group_node",BI.MultiLayerSingleTreePlusGroupNode),BI.MultiLayerSingleTreeFirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.first_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_first_tree_leaf_item",BI.MultiLayerSingleTreeFirstTreeLeafItem),BI.MultiLayerSingleTreeLastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.last_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_last_tree_leaf_item",BI.MultiLayerSingleTreeLastTreeLeafItem),BI.MultiLayerSingleTreeMidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.mid_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_mid_tree_leaf_item",BI.MultiLayerSingleTreeMidTreeLeafItem),BI.MultiSelectCheckPane=BI.inherit(BI.Widget,{constants:{height:12,lgap:10,tgap:10,bgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-pane bi-background",items:[],itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,onClickContinueSelect:BI.emptyFn})},_init:function(){BI.MultiSelectCheckPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.storeValue=opts.value||{},this.display=BI.createWidget({type:"bi.display_selected_list",items:opts.items,itemsCreator:function(op,callback){return op=BI.extend(op||{},{selectedValues:self.storeValue.value}),self.storeValue.type===BI.Selection.Multi?void callback({items:BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt}})}):void opts.itemsCreator(op,callback)}}),this.continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-select-check-selected bi-high-light"}),this.continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){opts.onClickContinueSelect()}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:{type:"bi.vertical_adapt",cls:"multi-select-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap},{el:this.continueSelect,lgap:this.constants.lgap}]},tgap:this.constants.tgap},{height:"fill",el:this.display,tgap:this.constants.bgap}]})},setValue:function(v){this.storeValue=v||{}},empty:function(){this.display.empty()},populate:function(){this.display.populate.apply(this.display,arguments)}}),BI.shortcut("bi.multi_select_check_pane",BI.MultiSelectCheckPane),BI.DisplaySelectedList=BI.inherit(BI.Pane,{constants:{height:24,lgap:10},_defaultConfig:function(){return BI.extend(BI.DisplaySelectedList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-display-list",itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.DisplaySelectedList.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.hasNext=!1,this.button_group=BI.createWidget({type:"bi.list_pane",element:this,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},items:this._createItems(opts.items),chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical",lgap:10}]},itemsCreator:function(options,callback){opts.itemsCreator(options,function(ob){self.hasNext=!!ob.hasNext,callback(self._createItems(ob.items))})},hasNext:function(){return self.hasNext}})},_createItems:function(items){return BI.createItems(items,{type:"bi.icon_text_item",cls:"cursor-default check-font icon-size-12 display-list-item bi-tips",once:!0,invalid:!0,selected:!0,height:this.constants.height,logic:{dynamic:!0}})},empty:function(){this.button_group.empty()},populate:function(items){0===arguments.length?this.button_group.populate():this.button_group.populate(this._createItems(items))}}),BI.shortcut("bi.display_selected_list",BI.DisplaySelectedList),BI.MultiSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue=o.value||{},this._assertValue(this.storeValue),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,height:o.height,text:o.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue(""),self.fireEvent(BI.MultiSelectCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.MultiSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()}),self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()}),self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_combo",BI.MultiSelectCombo),BI.MultiSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue=o.value||{},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",allowEdit:o.allowEdit,height:o.height,text:o.text,watermark:o.watermark,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&self._addItem(assertShowValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){this.getSearcher().hasMatched()||(self._addItem(assertShowValue),self._stopEditing())}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,el:this.trigger,adjustLength:1,container:o.container,popup:{type:"bi.multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectInsertCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_insert_combo",BI.MultiSelectInsertCombo),BI.MultiSelectInsertNoBarCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0}})},_init:function(){BI.MultiSelectInsertNoBarCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue={type:BI.Selection.Multi,value:o.value||[]},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",height:o.height,text:o.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:o.value}}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&self._addItem(assertShowValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){this.getSearcher().hasMatched()||(self._addItem(assertShowValue),self._stopEditing())}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(keywords){ +var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_no_bar_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{type:BI.Selection.Multi,value:o.value},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:o.value}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_insert_no_bar_combo",BI.MultiSelectInsertNoBarCombo),BI.MultiSelectInsertTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectInsertTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.multi_select_insert_searcher",height:o.height,text:o.text,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(width){this.wrapper.attr("items")[1].width=width,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectInsertTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectInsertTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertTrigger.EVENT_START="EVENT_START",BI.MultiSelectInsertTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_trigger",BI.MultiSelectInsertTrigger),BI.MultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",logic:opts.logic,toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,vgap:5},opts.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)})))),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h-10)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.MultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_loader",BI.MultiSelectLoader),BI.MultiSelectNoBarLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget(BI.extend({type:"bi.list_pane",onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}},itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue},opts.el)),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectNoBarLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",cls:"bi-list-item-active",logic:this.options.logic,height:24,iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue.value)},getValue:function(){return{type:BI.Selection.Multi,value:this.button_group.getValue()}},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.element.css({"max-height":h+"px"})},resetWidth:function(){}}),BI.MultiSelectNoBarLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_no_bar_loader",BI.MultiSelectNoBarLoader),BI.MultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.multi_select_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_popup_view",BI.MultiSelectPopupView),BI.MultiSelectNoBarPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.multi_select_no_bar_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM)}})},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiSelectNoBarPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_no_bar_popup_view",BI.MultiSelectNoBarPopupView),BI.MultiSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.multi_select_searcher",height:o.height,text:o.text,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.MultiSelectSearcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(width){this.wrapper.attr("items")[1].width=width,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectTrigger.EVENT_START="EVENT_START",BI.MultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.multi_select_trigger",BI.MultiSelectTrigger),BI.MultiSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_select_search_insert_pane",BI.MultiSelectSearchInsertPane),BI.MultiSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-loader",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=BI.deepClone(opts.value),this.button_group=BI.createWidget({type:"bi.select_list",toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:self.storeValue.value})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:{dynamic:!1},height:24,selected:this.isAllSelected(),cls:"bi-list-item-active",iconWrapperWidth:36})},isAllSelected:function(){return this.button_group.isAllSelected()},_filterValues:function(src){var o=this.options,keyword=o.keywordGetter(),values=BI.deepClone(src.value)||[],newValues=BI.map(values,function(i,v){return{text:o.valueFormatter(v)||v,value:v}});if(BI.isKey(keyword)){var search=BI.Func.getSearchResult(newValues,keyword);values=search.match.concat(search.find)}return BI.map(values,function(i,v){return{text:v.text,title:v.text,value:v.value,selected:src.type===BI.Selection.All}})},setValue:function(v){this.storeValue=BI.deepClone(v),this.button_group.setValue(v)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.MultiSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_loader",BI.MultiSelectSearchLoader),BI.MultiSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(keyword){var btn,isVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();isVisible!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(isVisible),this.resizer.attr("items")[0].height=isVisible?this.constants.height:0,this.resizer.resize())},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_pane",BI.MultiSelectSearchPane),BI.MultiSelectCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-button", +itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectCheckSelectedButton.superclass._init.apply(this,arguments);var self=this,o=this.options;this.numberCounter=BI.createWidget({type:"bi.text_button",element:this,hgap:4,text:"0",textAlign:"center",textHeight:16,cls:"bi-high-light-background count-tip"}),this.numberCounter.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.numberCounter.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),this.numberCounter.element.hover(function(){self.numberCounter.setTag(self.numberCounter.getText()),self.numberCounter.setText(BI.i18nText("BI-Check_Selected"))},function(){self.numberCounter.setText(self.numberCounter.getTag())}),this.setVisible(!1),BI.isNotNull(o.value)&&this.setValue(o.value)},setValue:function(ob){var self=this,o=this.options;return ob||(ob={}),ob.type||(ob.type=BI.Selection.Multi),ob.value||(ob.value=[]),ob.type===BI.Selection.All?void o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_DATA_LENGTH},function(res){var length=res.count-ob.value.length;BI.nextTick(function(){self.numberCounter.setText(length),self.setVisible(length>0)})}):void BI.nextTick(function(){self.numberCounter.setText(ob.value.length),self.setVisible(ob.value.length>0)})},getValue:function(){}}),BI.MultiSelectCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_check_selected_button",BI.MultiSelectCheckSelectedButton),BI.MultiSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-editor",el:{},watermark:BI.i18nText("BI-Basic_Search")})},_init:function(){BI.MultiSelectEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.state_editor",element:this,height:o.height,watermark:o.watermark,allowBlank:!0,value:o.value,defaultText:o.text,text:o.text,tipType:o.tipType,warningTitle:o.warningTitle}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(state){this.editor.setState(state)},setValue:function(v){this.editor.setValue(v)},setTipType:function(v){this.editor.setTipType(v)},getValue:function(){var v=this.editor.getState();return BI.isArray(v)&&v.length>0?v[v.length-1]:""},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},populate:function(items){}}),BI.MultiSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_select_editor",BI.MultiSelectEditor),BI.MultiSelectInsertSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectInsertSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",watermark:o.watermark,height:o.height,text:o.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_insert_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value,listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM)}}]},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(ob){var o=this.options;if(ob||(ob={}),ob.value||(ob.value=[]),ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectInsertSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectInsertSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertSearcher.EVENT_START="EVENT_START",BI.MultiSelectInsertSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_searcher",BI.MultiSelectInsertSearcher),BI.MultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",height:o.height,text:o.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(ob){var o=this.options;if(ob||(ob={}),ob.value||(ob.value=[]),ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearcher.EVENT_START="EVENT_START",BI.MultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_searcher",BI.MultiSelectSearcher),BI.MultiSelectCheckSelectedSwitcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedSwitcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-switcher",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,el:{},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiSelectCheckSelectedSwitcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button=BI.createWidget(o.el,{type:"bi.multi_select_check_selected_button",itemsCreator:o.itemsCreator,value:o.value}),this.button.on(BI.Events.VIEW,function(){self.fireEvent(BI.Events.VIEW,arguments)}),this.switcher=BI.createWidget({type:"bi.switcher",toggle:!1,element:this,el:this.button,popup:BI.extend({type:"bi.multi_select_check_pane",valueFormatter:o.valueFormatter,itemsCreator:o.itemsCreator,onClickContinueSelect:function(){self.switcher.hideView()},ref:function(_ref){self.checkPane=_ref},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.switcher.on(BI.Switcher.EVENT_TRIGGER_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE)}),this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW)}),this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW,function(){var me=this;BI.nextTick(function(){me.populate()})})},adjustView:function(){this.switcher.adjustView()},hideView:function(){this.switcher.empty(),this.switcher.hideView()},setAdapter:function(adapter){this.switcher.setAdapter(adapter)},setValue:function(v){this.switcher.setValue(v)},updateSelectedValue:function(v){this.checkPane.setValue(v)},setButtonChecked:function(v){this.button.setValue(v)},getValue:function(){},populate:function(items){this.switcher.populate.apply(this.switcher,arguments)}}),BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_select_check_selected_switcher",BI.MultiSelectCheckSelectedSwitcher),BI.MultiSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value||{};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var keyword=self.trigger.getKeyword();self.trigger.hasMatched()||(self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self.adapter.populate(),self.storeValue.type===BI.Selection.Multi&&self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),self._showAdapter()}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeywords(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}}],value:o.value}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_list",BI.MultiSelectInsertList),BI.MultiSelectInsertNoBarList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertNoBarList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={type:BI.Selection.Multi,value:o.value||[]};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_no_bar_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{},value:{type:BI.Selection.Multi,value:o.value||[]}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var keyword=self.trigger.getKeyword();self.trigger.hasMatched()||(self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self.adapter.populate(),self.storeValue.type===BI.Selection.Multi&&self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeywords(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}}],value:{type:BI.Selection.Multi,value:o.value||[]}}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_no_bar_list",BI.MultiSelectInsertNoBarList),BI.MultiSelectList=BI.inherit(BI.Widget,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){ +function adjust(){self.storeValue.type===BI.Selection.All&&self.storeValue.value.length>=self._count?self.storeValue={type:BI.Selection.Multi,value:[]}:self.storeValue.type===BI.Selection.Multi&&self.storeValue.value.length>=self._count&&(self.storeValue={type:BI.Selection.All,value:[]})}var self=this,o=this.options;this._count?(adjust(),callback()):o.itemsCreator({type:BI.MultiSelectList.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_list",BI.MultiSelectList),BI.MultiSelectTree=BI.inherit(BI.Single,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTree.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={value:{}},this.adapter=BI.createWidget({type:"bi.multi_select_tree_popup",itemsCreator:o.itemsCreator}),this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE,function(){self.searcher.isSearching()?self.storeValue={value:self.searcherPane.getValue()}:self.storeValue={value:self.adapter.getValue()},self.setSelectedValue(self.storeValue.value),self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_tree_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",keywordGetter:function(){return self.searcher.getKeyword()},itemsCreator:function(op,callback){op.keyword=self.searcher.getKeyword(),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.searcher=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.searcher.getKeyword()})},adapter:this.adapter,popup:this.searcherPane,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane()}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),BI.nextTick(function(){self.adapter.populate()})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.searcher.isSearching()?self.storeValue={value:self.searcherPane.getValue()}:self.storeValue={value:self.adapter.getValue()},self.setSelectedValue(self.storeValue.value),self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){self._showAdapter()}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.searcher,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},resize:function(){},setSelectedValue:function(v){this.storeValue.value=v||{},this.adapter.setSelectedValue(v),this.searcherPane.setSelectedValue(v),this.searcher.setValue({value:v||{}})},setValue:function(v){this.adapter.setValue(v)},stopSearch:function(){this.searcher.stopSearch()},updateValue:function(v){this.adapter.updateValue(v)},getValue:function(){return this.storeValue.value},populate:function(){this.searcher.populate.apply(this.searcher,arguments),this.adapter.populate.apply(this.adapter,arguments)}}),BI.MultiSelectTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree",BI.MultiSelectTree),BI.MultiSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popup=BI.createWidget({type:"bi.async_tree",element:this,itemsCreator:o.itemsCreator}),this.popup.on(BI.TreeView.EVENT_AFTERINIT,function(){self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT)}),this.popup.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE)})},hasChecked:function(){return this.popup.hasChecked()},getValue:function(){return this.popup.getValue()},setValue:function(v){v||(v={}),this.popup.setValue(v)},setSelectedValue:function(v){v||(v={}),this.popup.setSelectedValue(v)},updateValue:function(v){this.popup.updateValue(v),this.popup.refresh()},populate:function(config){this.popup.stroke(config)}}),BI.MultiSelectTreePopup.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.MultiSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree_popup",BI.MultiSelectTreePopup),BI.MultiTreeCheckPane=BI.inherit(BI.Pane,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-pane bi-background",onClickContinueSelect:BI.emptyFn,el:{type:"bi.display_tree"}})},_init:function(){BI.MultiTreeCheckPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.selectedValues={};var continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-tree-check-selected"});continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){opts.onClickContinueSelect(),BI.nextTick(function(){self.empty()})});var backToPopup=BI.createWidget({type:"bi.left",cls:"multi-tree-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap,tgap:this.constants.tgap},{el:continueSelect,lgap:this.constants.lgap,tgap:this.constants.tgap}]});this.display=BI.createWidget(opts.el,{type:"bi.display_tree",cls:"bi-multi-tree-display",itemsCreator:function(op,callback){op.type=BI.TreeView.REQ_TYPE_GET_SELECTED_DATA,opts.itemsCreator(op,callback)},value:(opts.value||{}).value}),this.display.on(BI.Events.AFTERINIT,function(){self.fireEvent(BI.Events.AFTERINIT)}),this.display.on(BI.TreeView.EVENT_INIT,function(){backToPopup.setVisible(!1)}),this.display.on(BI.TreeView.EVENT_AFTERINIT,function(){backToPopup.setVisible(!0)}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:backToPopup},{height:"fill",el:this.display}]})},empty:function(){this.display.empty()},populate:function(configs){this.display.stroke(configs)},setValue:function(v){v||(v={}),this.display.setSelectedValue(v.value)},getValue:function(){}}),BI.MultiTreeCheckPane.EVENT_CONTINUE_CLICK="EVENT_CONTINUE_CLICK",BI.shortcut("bi.multi_tree_check_pane",BI.MultiTreeCheckPane),BI.MultiTreeCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",height:o.height,valueFormatter:o.valueFormatter,text:o.text,watermark:o.watermark,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",itemsCreator:o.itemsCreator},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self._stopEditing(),self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:{}}),self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},masker:{offset:this.constants.offset},itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,value:{value:o.value||{}}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||{},this.combo.setValue({value:v||{}}),this.numberCounter.setValue({value:v||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_combo",BI.MultiTreeCombo),BI.MultiTreeInsertCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,height:o.height,valueFormatter:o.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",text:o.text,watermark:o.watermark,itemsCreator:o.itemsCreator,popup:{type:"bi.multi_tree_search_insert_pane",listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.storeValue.value[self.trigger.getSearcher().getKeyword()]={},self._assertShowValue(),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self._stopEditing()}}]}},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,self.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self._stopEditing(),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:{}}),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:this.constants.offset},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||{},this.combo.setValue({value:v||{}}),this.numberCounter.setValue({value:v||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_insert_combo",BI.MultiTreeInsertCombo),BI.MultiTreeListCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-list-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0,allowInsertValue:!0})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||[]},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,text:o.text,watermark:o.watermark,height:o.height,valueFormatter:o.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_list_tree_searcher",itemsCreator:o.itemsCreator,popup:{type:o.allowInsertValue?"bi.multi_tree_search_insert_pane":"bi.multi_tree_search_pane",el:{type:"bi.list_part_tree"},listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.storeValue.value.unshift([self.trigger.getSearcher().getKeyword()]),self._assertShowValue(),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self._stopEditing()}}]}},switcher:{el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane",el:{type:"bi.list_display_tree"},itemsCreator:o.itemsCreator}},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},el:{type:"bi.list_async_tree"},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():[]};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeListCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self.trigger.stopEditing(),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:[]}),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||[],this.combo.setValue({value:v||[]}),this.numberCounter.setValue({value:v||[]})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeListCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeListCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeListCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeListCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeListCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeListCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_list_combo",BI.MultiTreeListCombo),BI.MultiTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-popup",maxWidth:"auto",minWidth:140,maxHeight:400,onLoaded:BI.emptyFn,el:{type:"bi.async_tree"}})},_init:function(){BI.MultiTreePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,v=opts.value;this.selectedValues={},this.tree=BI.createWidget(opts.el,{type:"bi.async_tree",height:400,cls:"popup-view-tree",itemsCreator:opts.itemsCreator,onLoaded:opts.onLoaded,value:v.value||{}}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",element:this,stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.tree}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CONFIRM)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreePopup.EVENT_CHANGE)}),this.tree.on(BI.TreeView.EVENT_AFTERINIT,function(){self.fireEvent(BI.MultiTreePopup.EVENT_AFTERINIT)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v||(v={}),this.tree.setSelectedValue(v.value)},populate:function(config){this.tree.stroke(config)},hasChecked:function(){return this.tree.hasChecked()},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreePopup.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreePopup.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreePopup.EVENT_AFTERINIT="EVENT_AFTERINIT",BI.shortcut("bi.multi_tree_popup_view",BI.MultiTreePopup),BI.MultiTreeCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-selected-button",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiTreeCheckSelectedButton.superclass._init.apply(this,arguments);var self=this;this.indicator=BI.createWidget({type:"bi.icon_button",cls:"check-font trigger-check-selected icon-size-12",width:15,height:15,stopPropagation:!0}),this.checkSelected=BI.createWidget({type:"bi.text_button",cls:"trigger-check-selected",invisible:!0,hgap:4,text:BI.i18nText("BI-Check_Selected"),textAlign:"center",textHeight:15}),this.checkSelected.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.checkSelected.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.horizontal",element:this,items:[this.indicator,this.checkSelected]}),this.element.hover(function(){self.indicator.setVisible(!1),self.checkSelected.setVisible(!0)},function(){self.indicator.setVisible(!0),self.checkSelected.setVisible(!1)}),this.setVisible(!1)},setValue:function(v){v||(v={});var show=BI.size(v.value)>0;this.setVisible(show),show&&(this.indicator.setVisible(!0),this.checkSelected.setVisible(!1))}}),BI.MultiTreeCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_tree_check_selected_button",BI.MultiTreeCheckSelectedButton),BI.MultiTreeSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24},props:{baseCls:"bi-multi-tree-search-insert-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,el:{type:"bi.part_tree"}},render:function(){var self=this,opts=this.options;return{ +type:"bi.absolute",items:[{el:{type:"bi.text_button",invisible:!0,ref:function(_ref){self.addTip=_ref},text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",handler:function(){self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,opts.keywordGetter())}},top:5,left:0,right:0},{el:BI.extend({type:"bi.part_tree",tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(op,callback){op.keyword=opts.keywordGetter(),opts.itemsCreator(op,function(res){callback(res),self.setKeyword(opts.keywordGetter(),res.items)})},ref:function(_ref){self.partTree=_ref},value:opts.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.TreeView.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE)}}]},opts.el),left:0,top:0,bottom:0,right:0}]}},setKeyword:function(keyword,nodes){var isAddTipVisible=BI.isEmptyArray(nodes);this.addTip.setVisible(isAddTipVisible),this.partTree.setVisible(!isAddTipVisible),isAddTipVisible&&this.addTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(v){this.setSelectedValue(v.value)},setSelectedValue:function(v){v||(v={}),this.partTree.setSelectedValue(v)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(op){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_tree_search_insert_pane",BI.MultiTreeSearchInsertPane),BI.MultiTreeSearchPane=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-search-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiTreeSearchPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.partTree=BI.createWidget({type:"bi.part_tree",element:this,tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(op,callback){op.keyword=opts.keywordGetter(),opts.itemsCreator(op,callback)},value:opts.value}),this.partTree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.partTree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE)})},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(v){this.setSelectedValue(v.value)},setSelectedValue:function(v){v||(v={}),this.partTree.setSelectedValue(v)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(op){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_tree_search_pane",BI.MultiTreeSearchPane),BI.MultiListTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiListTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(v){return v},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiListTreeSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",height:o.height,el:{type:"bi.simple_state_editor",height:o.height}}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiListTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_CHANGE,arguments)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(ob){var o=this.options;ob||(ob={}),ob.value||(ob.value=[]);var count=0;if(BI.isNumber(ob))this.editor.setState(ob);else if(0===BI.size(ob.value))this.editor.setState(BI.Selection.None);else{var text="";BI.each(ob.value,function(idx,path){var childValue=BI.last(path);text+=(o.valueFormatter(childValue+"")||childValue)+"; ",count++}),count>20?this.editor.setState(BI.Selection.Multi):this.editor.setState(text)}},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiListTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiListTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiListTreeSearcher.EVENT_START="EVENT_START",BI.MultiListTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiListTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_list_tree_searcher",BI.MultiListTreeSearcher),BI.MultiTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(v){return v},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiTreeSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",watermark:o.watermark,height:o.height,el:{type:"bi.simple_state_editor",text:o.text,height:o.height},listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiTreeSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(ob){function getChildrenNode(ob){var text="",index=0,size=BI.size(ob);return BI.each(ob,function(name,children){index++;var childNodes=getChildrenNode(children);text+=(o.valueFormatter(name+"")||name)+(""===childNodes?"":":"+childNodes)+(index===size?"":","),""===childNodes&&count++}),text}var o=this.options;ob||(ob={}),ob.value||(ob.value={});var count=0;if(BI.isNumber(ob))this.editor.setState(ob);else if(0===BI.size(ob.value))this.editor.setState(BI.Selection.None);else{var text="";BI.each(ob.value,function(name,children){var childNodes=getChildrenNode(children);text+=(o.valueFormatter(name+"")||name)+(""===childNodes?"":":"+childNodes)+"; ",""===childNodes&&count++}),count>20?this.editor.setState(BI.Selection.Multi):this.editor.setState(text)}},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiTreeSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearcher.EVENT_START="EVENT_START",BI.MultiTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_tree_searcher",BI.MultiTreeSearcher),BI.NumberEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-number-editor bi-border bi-focus-shadow",validationChecker:function(){return!0},valueFormatter:function(v){return v},value:0,allowBlank:!1,errorText:"",step:1})},_init:function(){BI.NumberEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height-2,allowBlank:o.allowBlank,value:o.valueFormatter(o.value),validationChecker:o.validationChecker,errorText:o.errorText}),this.editor.on(BI.TextEditor.EVENT_CHANGE,function(){self.fireEvent(BI.NumberEditor.EVENT_CHANGE)}),this.editor.on(BI.TextEditor.EVENT_ERROR,function(){o.value=BI.parseFloat(this.getLastValidValue())}),this.editor.on(BI.TextEditor.EVENT_VALID,function(){o.value=BI.parseFloat(this.getValue())}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",forceNotSelected:!0,trigger:"lclick,",cls:"add-up-font top-button bi-border-left bi-list-item-active2 icon-size-12"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){self._finetuning(o.step),self.fireEvent(BI.NumberEditor.EVENT_CHANGE),self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",trigger:"lclick,",forceNotSelected:!0,cls:"minus-down-font bottom-button bi-border-left bi-list-item-active2 icon-size-12"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){self._finetuning(-o.step),self.fireEvent(BI.NumberEditor.EVENT_CHANGE),self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),BI.createWidget({type:"bi.htape",height:o.height-2,element:this,items:[this.editor,{el:{type:"bi.grid",columns:1,rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:23}]})},focus:function(){this.editor.focus()},isEditing:function(){return this.editor.isEditing()},_finetuning:function(add){var v=BI.parseFloat(this.getValue());this.setValue(BI.add(v,add))},setUpEnable:function(v){this.topBtn.setEnable(!!v)},setDownEnable:function(v){this.bottomBtn.setEnable(!!v)},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.options.value},setValue:function(v){var o=this.options;o.value=v,this.editor.setValue(o.valueFormatter(v))}}),BI.NumberEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.number_editor",BI.NumberEditor),BI.NumberInterval=BI.inherit(BI.Single,{constants:{typeError:"typeBubble",numberError:"numberBubble",signalError:"signalBubble",editorWidth:114,columns:5,width:24,rows:1,numberErrorCls:"number-error",border:1,less:0,less_equal:1,numTip:"",adjustYOffset:2},_defaultConfig:function(){var conf=BI.NumberInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-number-interval"+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),height:24,validation:"valid",closeMin:!0,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){var self=this,c=this.constants,o=this.options;BI.NumberInterval.superclass._init.apply(this,arguments),this.smallEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.min,level:"warning",tipType:"success",title:function(){return self.smallEditor&&self.smallEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(v){return!!BI.isNumeric(v)||(self.smallEditorBubbleType=c.typeError,!1)},cls:"number-interval-small-editor bi-border"}),this.smallTip=BI.createWidget({type:"bi.label",text:o.numTip,height:o.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.smallEditor.element,items:[{el:this.smallTip,top:0,right:5}]}),this.bigEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.max,level:"warning",tipType:"success",title:function(){return self.bigEditor&&self.bigEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(v){return!!BI.isNumeric(v)||(self.bigEditorBubbleType=c.typeError,!1)},cls:"number-interval-big-editor bi-border"}),this.bigTip=BI.createWidget({type:"bi.label",text:o.numTip,height:o.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.bigEditor.element,items:[{el:this.bigTip,top:0,right:5}]}),this.smallCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-small-combo bi-border-top bi-border-bottom bi-border-right",height:o.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),o.closeMin===!0?this.smallCombo.setValue(1):this.smallCombo.setValue(0),this.bigCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-big-combo bi-border-top bi-border-bottom bi-border-left",height:o.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),o.closeMax===!0?this.bigCombo.setValue(1):this.bigCombo.setValue(0),this.label=BI.createWidget({type:"bi.label",text:BI.i18nText("BI-Basic_Value"),textHeight:o.height-2*c.border,width:c.width-2*c.border,height:o.height-2*c.border,level:"warning",tipType:"warning"}),this.left=BI.createWidget({type:"bi.htape",items:[{el:self.smallEditor},{el:self.smallCombo,width:c.width-c.border}]}),this.right=BI.createWidget({type:"bi.htape",items:[{el:self.bigCombo,width:c.width-c.border},{el:self.bigEditor,lgap:1}]}),BI.createWidget({element:self,type:"bi.center",hgap:15,height:o.height,items:[{type:"bi.absolute",items:[{el:self.left,left:-15,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:0,right:-15,top:0,bottom:0}]}]}),BI.createWidget({element:self,type:"bi.horizontal_auto",items:[self.label]}),self._setValidEvent(self.bigEditor,c.bigEditor),self._setValidEvent(self.smallEditor,c.smallEditor),self._setErrorEvent(self.bigEditor,c.bigEditor),self._setErrorEvent(self.smallEditor,c.smallEditor),self._setBlurEvent(self.bigEditor),self._setBlurEvent(self.smallEditor),self._setFocusEvent(self.bigEditor),self._setFocusEvent(self.smallEditor),self._setComboValueChangedEvent(self.bigCombo),self._setComboValueChangedEvent(self.smallCombo),self._setEditorValueChangedEvent(self.bigEditor),self._setEditorValueChangedEvent(self.smallEditor),self._checkValidation()},_checkValidation:function(){var self=this,c=this.constants,o=this.options;if(self._setTitle(""),BI.Bubbles.hide(c.typeError),BI.Bubbles.hide(c.numberError),BI.Bubbles.hide(c.signalError),!self.smallEditor.isValid()||!self.bigEditor.isValid())return self.element.removeClass("number-error"),o.validation="invalid",c.typeError;if(BI.isEmptyString(self.smallEditor.getValue())||BI.isEmptyString(self.bigEditor.getValue()))return self.element.removeClass("number-error"),o.validation="valid","";var smallValue=parseFloat(self.smallEditor.getValue()),bigValue=parseFloat(self.bigEditor.getValue()),bigComboValue=self.bigCombo.getValue(),smallComboValue=self.smallCombo.getValue();return bigComboValue[0]===c.less_equal&&smallComboValue[0]===c.less_equal?smallValue>bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.numberError):(self.element.removeClass("number-error"),o.validation="valid",""):smallValue>bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.numberError):smallValue===bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.signalError):(self.element.removeClass("number-error"),o.validation="valid","")},_setTitle:function(v){var self=this;self.bigEditor.setTitle(v),self.smallEditor.setTitle(v),self.label.setTitle(v)},_setFocusEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,function(){switch(self._setTitle(""),self._checkValidation()){case c.typeError:BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;default:return}})},_setBlurEvent:function(w){var c=this.constants,self=this;w.on(BI.NumberIntervalSingleEidtor.EVENT_BLUR,function(){switch(BI.Bubbles.hide(c.typeError),BI.Bubbles.hide(c.numberError),BI.Bubbles.hide(c.signalError),self._checkValidation()){case c.typeError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));break;case c.numberError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));break;case c.signalError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));break;default:self._setTitle("")}})},_setErrorEvent:function(w){var c=this.constants,self=this;w.on(BI.NumberIntervalSingleEidtor.EVENT_ERROR,function(){self._checkValidation(),BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR)})},_setValidEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_VALID,function(){switch(self._checkValidation()){case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:self.fireEvent(BI.NumberInterval.EVENT_VALID)}})},_setEditorValueChangedEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,function(){switch(self._checkValidation()){case c.typeError:BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset})}self.fireEvent(BI.NumberInterval.EVENT_CHANGE)}),w.on(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,function(){self.fireEvent(BI.NumberInterval.EVENT_CONFIRM)})},_setComboValueChangedEvent:function(w){var self=this,c=this.constants;w.on(BI.IconCombo.EVENT_CHANGE,function(){switch(self._checkValidation()){case c.typeError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.numberError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.signalError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:self.fireEvent(BI.NumberInterval.EVENT_CHANGE),self.fireEvent(BI.NumberInterval.EVENT_CONFIRM),self.fireEvent(BI.NumberInterval.EVENT_VALID)}})},isStateValid:function(){return"valid"===this.options.validation},setMinEnable:function(b){this.smallEditor.setEnable(b)},setCloseMinEnable:function(b){this.smallCombo.setEnable(b)},setMaxEnable:function(b){this.bigEditor.setEnable(b)},setCloseMaxEnable:function(b){this.bigCombo.setEnable(b)},showNumTip:function(){this.smallTip.setVisible(!0),this.bigTip.setVisible(!0)},hideNumTip:function(){this.smallTip.setVisible(!1),this.bigTip.setVisible(!1)},setNumTip:function(numTip){this.smallTip.setText(numTip),this.bigTip.setText(numTip)},getNumTip:function(){return this.smallTip.getText()},setValue:function(data){data=data||{};var self=this,combo_value;(BI.isNumeric(data.min)||BI.isEmptyString(data.min))&&self.smallEditor.setValue(data.min),BI.isNotNull(data.min)||self.smallEditor.setValue(""),(BI.isNumeric(data.max)||BI.isEmptyString(data.max))&&self.bigEditor.setValue(data.max),BI.isNotNull(data.max)||self.bigEditor.setValue(""),BI.isNull(data.closeMin)||(combo_value=data.closeMin===!0?1:0,self.smallCombo.setValue(combo_value)),BI.isNull(data.closeMax)||(combo_value=data.closeMax===!0?1:0,self.bigCombo.setValue(combo_value)),this._checkValidation()},getValue:function(){var self=this,value={},minComboValue=self.smallCombo.getValue(),maxComboValue=self.bigCombo.getValue();return value.min=self.smallEditor.getValue(),value.max=self.bigEditor.getValue(),0===minComboValue[0]?value.closeMin=!1:value.closeMin=!0,0===maxComboValue[0]?value.closeMax=!1:value.closeMax=!0,value},destroyed:function(){var c=this.constants;BI.Bubbles.remove(c.typeError),BI.Bubbles.remove(c.numberError),BI.Bubbles.remove(c.signalError)}}),BI.NumberInterval.EVENT_CHANGE="EVENT_CHANGE",BI.NumberInterval.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberInterval.EVENT_VALID="EVENT_VALID",BI.NumberInterval.EVENT_ERROR="EVENT_ERROR",BI.shortcut("bi.number_interval",BI.NumberInterval),BI.NumberIntervalSingleEidtor=BI.inherit(BI.Single,{props:{baseCls:"bi-number-interval-single-editor",tipType:"success",title:""},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.editor",ref:function(_ref){self.editor=_ref},height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.value,level:o.level,quitChecker:o.quitChecker,validationChecker:o.validationChecker,listeners:[{eventName:BI.Editor.EVENT_ERROR,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_ERROR,arguments)}},{eventName:BI.Editor.EVENT_FOCUS,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,arguments)}},{eventName:BI.Editor.EVENT_BLUR,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_BLUR,arguments)}},{eventName:BI.Editor.EVENT_VALID,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_VALID,arguments)}},{eventName:BI.Editor.EVENT_CHANGE,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,arguments)}},{eventName:BI.Editor.EVENT_CONFIRM,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,arguments)}},{eventName:BI.Editor.EVENT_CHANGE_CONFIRM,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM,arguments)}}]}]}},isValid:function(){return this.editor.isValid()},getValue:function(){return this.editor.getValue()},setTitle:function(v){return this.editor.setTitle(v)},setValue:function(v){return this.editor.setValue(v)}}),BI.NumberIntervalSingleEidtor.EVENT_FOCUS="EVENT_FOCUS",BI.NumberIntervalSingleEidtor.EVENT_BLUR="EVENT_BLUR",BI.NumberIntervalSingleEidtor.EVENT_ERROR="EVENT_ERROR",BI.NumberIntervalSingleEidtor.EVENT_VALID="EVENT_VALID",BI.NumberIntervalSingleEidtor.EVENT_CHANGE="EVENT_CHANGE",BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.NumberIntervalSingleEidtor.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.number_interval_single_editor",BI.NumberIntervalSingleEidtor),BI.SearchMultiTextValueCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SearchMultiTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo bi-search-multi-text-value-combo",height:24,items:[]})},_init:function(){BI.SearchMultiTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self._updateAllValue(),self._checkError(),self.trigger.getSearcher().setState(self.storeValue),self.trigger.getCounter().setButtonChecked(self.storeValue)};this.storeValue=BI.deepClone(o.value||{}),this._updateAllValue(),this._assertValue(this.storeValue),this._checkError(),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.search_multi_select_trigger",text:o.text,height:o.height,masker:{offset:{left:0,top:0,right:0,bottom:25}},allValueGetter:function(){return self.allValue},valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){self._itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},value:this.storeValue,warningTitle:o.warningTitle}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self._populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){this.getCounter().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.search_multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:BI.bind(self._itemsCreator,this),valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getCounter().adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:(assertShowValue(),self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM))});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.trigger.getCounter().hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]}),this._checkError()},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){var o=this.options;val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[]),BI.remove(val.value,function(idx,value){return!BI.contains(BI.map(o.items,"value"),value)})},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.storeValue.type===BI.Selection.All&&self.storeValue.value.length>=self._count?self.storeValue={type:BI.Selection.Multi,value:[]}:self.storeValue.type===BI.Selection.Multi&&self.storeValue.value.length>=self._count&&(self.storeValue={ +type:BI.Selection.All,value:[]}),self._updateAllValue(),self._checkError(),self.wants2Quit===!0&&(self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;this._count?(adjust(),callback()):this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},_getItemsByTimes:function(items,times){for(var res=[],i=100*(times-1);items[i]&&i<100*times;i++)res.push(items[i]);return res},_hasNextByTimes:function(items,times){return 100*times0&&self.numberCounter.hideView()})},getCounter:function(){return this.numberCounter},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch(),this.numberCounter.hideView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter),this.numberCounter.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob),this.numberCounter.setValue(ob)},setTipType:function(v){this.searcher.setTipType(v)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SearchMultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SearchMultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SearchMultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectTrigger.EVENT_START="EVENT_START",BI.SearchMultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchMultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.shortcut("bi.search_multi_select_trigger",BI.SearchMultiSelectTrigger),BI.SearchMultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",element:this,logic:opts.logic,el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SearchMultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_multi_select_loader",BI.SearchMultiSelectLoader),BI.SearchMultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.search_multi_select_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.SearchMultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.search_multi_select_popup_view",BI.SearchMultiSelectPopupView),BI.SearchMultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{}})},_init:function(){BI.SearchMultiSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",height:o.height,text:o.text,tipType:o.tipType,warningTitle:o.warningTitle}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(obj){var o=this.options,ob={};if(ob.type=obj.type,ob.value=o.allValueGetter()||[],ob.assist=obj.assist,ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setTipType:function(v){this.editor.setTipType(v)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SearchMultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SearchMultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectSearcher.EVENT_START="EVENT_START",BI.SearchMultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.search_multi_select_searcher",BI.SearchMultiSelectSearcher),BI.SelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-first-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_first_plus_group_node",BI.SelectTreeFirstPlusGroupNode),BI.SelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-last-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_last_plus_group_node",BI.SelectTreeLastPlusGroupNode),BI.SelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-mid-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_mid_plus_group_node",BI.SelectTreeMidPlusGroupNode),BI.SelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_plus_group_node",BI.SelectTreePlusGroupNode),BI.SelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-combo",height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SelectTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}),this.popup=BI.createWidget({type:"bi.select_level_tree",items:o.items,value:o.value}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView()})},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()},populate:function(items){this.combo.populate(items)}}),BI.shortcut("bi.select_tree_combo",BI.SelectTreeCombo),BI.SelectTreeExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-expander",trigger:"",toggle:!0,direction:"bottom",isDefaultInit:!0,el:{},popup:{}})},_init:function(){BI.SelectTreeExpander.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el),this.trigger.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&this.isSelected()&&self.expander.setValue([]),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.expander=BI.createWidget({type:"bi.expander",element:this,trigger:o.trigger,toggle:o.toggle,direction:o.direction,isDefaultInit:o.isDefaultInit,el:this.trigger,popup:o.popup}),this.expander.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.trigger.setSelected(!1),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},getAllLeaves:function(){return this.expander.getAllLeaves()},setValue:function(v){BI.contains(v,this.trigger.getValue())?(this.trigger.setSelected(!0),this.expander.setValue([])):(this.trigger.setSelected(!1),this.expander.setValue(v))},getValue:function(){return this.trigger.isSelected()?[this.trigger.getValue()]:this.expander.getValue()},populate:function(items){this.expander.populate(items)}}),BI.shortcut("bi.select_tree_expander",BI.SelectTreeExpander),BI.SelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};node.id=node.id||BI.UUID(),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.select_tree_first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_init:function(){BI.SelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{type:"bi.select_tree_expander",isDefaultInit:!0},items:this._formatItems(BI.Tree.transformToTreeFormat(o.items),0),value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SelectTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(items)))}}),BI.SelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_level_tree",BI.SelectTreePopup),BI.SingleSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-loader",allowNoSelect:!1,itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword||""),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",cls:"bi-list-item-active",logic:{dynamic:!1},height:25,selected:!1})},_filterValues:function(src){var o=this.options,keyword=o.keywordGetter(),values=src||[],newValues=BI.map(BI.isArray(values)?values:[values],function(i,v){return{text:o.valueFormatter(v)||v,value:v}});if(BI.isKey(keyword)){var search=BI.Func.getSearchResult(newValues,keyword);values=search.match.concat(search.find)}return BI.map(values,function(i,v){return{text:v.text,title:v.text,value:v.value,selected:!1}})},setValue:function(v){this.storeValue=v,this.button_group.setValue(v)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SingleSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_loader",BI.SingleSelectSearchLoader),BI.SingleSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:o.allowNoSelect,keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments); +}}),BI.SingleSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.single_select_search_insert_pane",BI.SingleSelectSearchInsertPane),BI.SingleSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:o.allowNoSelect,keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(keyword){var btn,isVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();isVisible!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(isVisible),this.resizer.attr("items")[0].height=isVisible?this.constants.height:0,this.resizer.resize())},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.SingleSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_pane",BI.SingleSelectSearchPane),BI.SingleSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue),self.trigger.getSearcher().setState(self.storeValue)};this.storeValue=o.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:o.height,allowNoSelect:o.allowNoSelect,allowEdit:o.allowEdit,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(self.getValue()),callback.apply(self,arguments)})},text:o.text,value:this.storeValue}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){self._setStartValue(),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){self._setStartValue(),self.fireEvent(BI.SingleSelectCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue()}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue()):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(value,obj){self.storeValue=this.getValue(),assertShowValue(),self._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:o.allowNoSelect,ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self._defaultState()}),self.fireEvent(BI.SingleSelectCombo.EVENT_CLICK_ITEM)}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length},value:o.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"single-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&BI.remove(self.storeValue.value,val)}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;this._count?(adjust(),callback()):o.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this._count=null,this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_combo",BI.SingleSelectCombo),BI.SingleSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue),self.trigger.getSearcher().setState(self.storeValue)};this.storeValue=o.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:o.height,allowNoSelect:o.allowNoSelect,allowEdit:o.allowEdit,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(self.getValue()),callback.apply(self,arguments)})},text:o.text,value:this.storeValue,searcher:{popup:{type:"bi.single_select_search_insert_pane",listeners:[{eventName:BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.trigger.getSearcher().hasMatched()||(self.storeValue=self.trigger.getSearcher().getKeyword(),assertShowValue(),self._defaultState())}}]}}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){self._setStartValue(),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){self._setStartValue(),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self.storeValue=keyword,self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue()}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue()):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(value,obj){self.storeValue=this.getValue(),assertShowValue(),self._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:o.allowNoSelect,ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self._defaultState()}),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM)}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length},value:o.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"single-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&BI.remove(self.storeValue.value,val)}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectInsertCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_insert_combo",BI.SingleSelectInsertCombo),BI.SingleSelectComboItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},height:24})},_init:function(){BI.SingleSelectComboItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:26},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectComboItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectComboItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectComboItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(v)}}),BI.SingleSelectComboItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_combo_item",BI.SingleSelectComboItem),BI.SingleSelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.list_pane"},allowNoSelect:!1})},_init:function(){BI.SingleSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.list=BI.createWidget(o.el,{type:"bi.list_pane",items:o.items,itemsCreator:function(op,callback){1===op.times&&self.toolbar&&self.toolbar.setVisible(!1),o.itemsCreator(op,function(items){callback.apply(self,arguments),1===op.times&&(self.toolbar&&self.toolbar.setVisible(items&&items.length>0),self.toolbar&&self.toolbar.setEnable(items&&items.length>0))})},onLoaded:o.onLoaded,hasNext:o.hasNext,value:o.value}),this.list.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&self.fireEvent(BI.SingleSelectList.EVENT_CHANGE,value,obj),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:o.allowNoSelect?BI.LogicFactory.createLogicItemsByDirection(o.direction,{type:"bi.single_select_item",cls:"bi-list-item-active",height:24,forceNotSelected:!0,text:BI.i18nText("BI-Basic_No_Select"),ref:function(_ref){self.toolbar=_ref},listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type===BI.Events.CLICK&&(self.list.setValue(),self.fireEvent(BI.SingleSelectList.EVENT_CHANGE)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},this.list):BI.LogicFactory.createLogicItemsByDirection(o.direction,this.list)}))))},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(v){this.list.setValue([v])},getValue:function(){return this.list.getValue()[0]},empty:function(){this.list.empty()},populate:function(items){this.list.populate.apply(this.list,arguments)},resetHeight:function(h){this.list.resetHeight?this.list.resetHeight(h):this.list.element.css({"max-height":h+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments)},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),BI.SingleSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_list",BI.SingleSelectList),BI.SingleSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-loader",logic:{dynamic:!0},el:{height:400},allowNoSelect:!1,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value,this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,logic:opts.logic,el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;BI.isNotNull(self.storeValue)&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=BI.map([self.storeValue],function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:!0}});firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue=startValue),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:!1})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},_assertValue:function(val){},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SingleSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_loader",BI.SingleSelectLoader),BI.SingleSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-popup-view",allowNoSelect:!1,maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:opts.allowNoSelect,itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE)})},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.SingleSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_popup_view",BI.SingleSelectPopupView),BI.SingleSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.SingleSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-trigger bi-border bi-border-radius",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.SingleSelectTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.single_select_searcher",allowNoSelect:o.allowNoSelect,text:o.text,height:o.height,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.SingleSelectSearcher.EVENT_START,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_START)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_STOP,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_FOCUS)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_BLUR,arguments)});var wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:BI.createWidget(),width:24}]});!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(v){this.searcher.setValue(v)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SingleSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SingleSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SingleSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectTrigger.EVENT_START="EVENT_START",BI.SingleSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SingleSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.SingleSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.single_select_trigger",BI.SingleSelectTrigger),BI.SingleSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value;var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue)};this.adapter=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:o.allowNoSelect,cls:"popup-single-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.SingleSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,value:o.value,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();self.storeValue=keyword,self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue()):(self.adapter.setValue(self.storeValue),assertShowValue())})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:24,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Single?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),this._allData?digest(this._allData):o.itemsCreator({type:BI.SingleSelectInsertList.REQ_GET_ALL_DATA},function(ob){self._allData=BI.map(ob.items,"value"),digest(self._allData)})},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v,this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this._count=null,this._allData=null,this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.SingleSelectInsertList,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_insert_list",BI.SingleSelectInsertList),BI.SingleSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-editor",el:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.SingleSelectEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.state_editor",element:this,height:o.height,watermark:BI.i18nText("BI-Basic_Search"),allowBlank:!0,value:o.value,defaultText:o.text,text:o.text}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(state){this.editor.setState(state)},setValue:function(v){this.editor.setValue(v)},getValue:function(){var v=this.editor.getState();return BI.isArray(v)&&v.length>0?v[v.length-1]:""},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},populate:function(items){}}),BI.SingleSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.single_select_editor",BI.SingleSelectEditor),BI.SingleSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},allowNoSelect:!1})},_init:function(){BI.SingleSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.single_select_editor", +height:o.height,text:o.text,listeners:[{eventName:BI.SingleSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_FOCUS)}},{eventName:BI.SingleSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.SingleSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(v){var o=this.options;BI.isNull(v)?this.editor.setState(BI.Selection.None):this.editor.setState(o.valueFormatter(v+"")||v+"")},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SingleSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SingleSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearcher.EVENT_START="EVENT_START",BI.SingleSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SingleSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.single_select_searcher",BI.SingleSelectSearcher),BI.SignTextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-sign-initial-editor",validationChecker:BI.emptyFn,text:"",height:24})},_init:function(){BI.SignTextEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:4,vgap:2,value:o.value,validationChecker:o.validationChecker,allowBlank:!1}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:function(){return self.getValue()},textAlign:o.textAlign,height:o.height,hgap:4,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignTextEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText()}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText()},_checkText:function(){var o=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark");else{var v=this.editor.getValue();v=BI.isEmpty(v)||v==o.text?o.text:v+o.text,this.text.setValue(v),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(v){this.editor.setValue(v),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){var o=this.options;this._showHint(),v=BI.isEmpty(v)||v==o.text?o.text:v+o.text,this.text.setValue(v)}}),BI.SignTextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignTextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignTextEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.shortcut("bi.sign_text_editor",BI.SignTextEditor),BI.SliderIconButton=BI.inherit(BI.Widget,{props:{baseCls:"bi-single-slider-button"},constants:{LARGE_SIZE:16,NORMAL_SIZE:12,LARGE_OFFSET:4,NORMAL_OFFSET:6},render:function(){var self=this;return{type:"bi.absolute",ref:function(){self.wrapper=this},items:[{el:{type:"bi.text_button",cls:"slider-button bi-high-light-border",ref:function(){self.slider=this}}}]}}}),BI.shortcut("bi.single_slider_button",BI.SliderIconButton),BI.SingleSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-single-slider bi-slider-track",digit:!1,unit:""},render:function(){var self=this,o=this.options,c=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});return sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v),self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}}),this.label=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:o.unit,width:c.EDITOR_WIDTH-2,allowBlank:!1,textAlign:"center",validationChecker:function(v){return self._checkValidation(v)}}),this.label.element.hover(function(){self.label.element.removeClass("bi-border").addClass("bi-border")},function(){self.label.element.removeClass("bi-border")}),this.label.on(BI.SignEditor.EVENT_CONFIRM,function(){var v=BI.parseFloat(this.getValue()),percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent),this.setValue(v),self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}),this._setVisible(!1),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:23,left:0,width:"100%"},{el:sliderVertical,top:20,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:c.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]}},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setLabelPosition(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v),self.value=v}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){var o=this.options,valid=!1;if(BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max))if(o.digit===!1)valid=!0;else{var dotText=(v+"").split(".")[1]||"";valid=dotText.length===o.digit}return valid},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setLabelPosition:function(percent){},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setLabelPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible),this.label.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},getValue:function(){return this.value},setValue:function(v){var o=this.options;v=BI.parseFloat(v),v=o.digit===!1?v:v.toFixed(o.digit),isNaN(v)||(this._checkValidation(v)&&(this.value=v),v>this.max&&(this.value=this.max),vminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max)),BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max),this._setAllPosition(100)))}}),BI.SingleSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider",BI.SingleSlider),BI.SingleSliderLabel=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:20,HEIGHT:20,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.SingleSliderLabel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-slider-label bi-slider-track",digit:!1,unit:""})},_init:function(){BI.SingleSliderLabel.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setText(v+o.unit),self.value=v,self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)}}),this.label=BI.createWidget({type:"bi.label",height:c.HEIGHT,width:c.EDITOR_WIDTH-2}),this._setVisible(!1),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:13,left:0,width:"100%"},{el:sliderVertical,top:10,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:c.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]})},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setLabelPosition(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v+o.unit),self.value=v,self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){return BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max)},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setLabelPosition:function(percent){},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setLabelPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible),this.label.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setEnable:function(b){BI.SingleSliderLabel.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(v){var o=this.options;v=BI.parseFloat(v),v=o.digit===!1?v:v.toFixed(o.digit),isNaN(v)||(this._checkValidation(v)&&(this.value=v),v>this.max&&(this.value=this.max),vminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){var o=this.options;isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value+o.unit),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max+o.unit),this._setAllPosition(100)))}}),BI.SingleSliderLabel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider_label",BI.SingleSliderLabel),BI.SingleSliderNormal=BI.inherit(BI.Single,{_constant:{HEIGHT:28,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-single-slider-normal bi-slider-track",minMax:{min:0,max:100}},render:function(){var self=this,c=this._constant,track=this._createTrack();this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});return sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}}),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:3,left:0,width:"100%"},{el:sliderVertical,top:0,left:0,width:"100%"}]}},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.value=v,self.fireEvent(BI.SingleSliderNormal.EVENT_DRAG,v)}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrack:function(){var self=this,c=this._constant;return this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.options.color&&this.blueTrack.element.css({"background-color":this.options.color}),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}],ref:function(ref){self.track=ref}}},_checkValidation:function(v){return!(BI.isNull(v)||vthis.max)},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setEnable:function(b){BI.SingleSliderNormal.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(v){var value=BI.parseFloat(v);isNaN(value)||(this._checkValidation(value)&&(this.value=value),value>this.max&&(this.value=this.max),valueminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?this._setAllPosition(this._getPercentByValue(this.value)):this._setAllPosition(100))}}),BI.SingleSliderNormal.EVENT_DRAG="EVENT_DRAG",BI.shortcut("bi.single_slider_normal",BI.SingleSliderNormal),BI.SingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-combo",trigger:{},height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SingleTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(BI.extend({type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value},o.trigger)),this.popup=BI.createWidget({type:"bi.single_level_tree",items:o.items,value:o.value}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.SingleTreeCombo.EVENT_CHANGE)})},populate:function(items){this.combo.populate(items)},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.SingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.single_tree_combo",BI.SingleTreeCombo),BI.SingleTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_init:function(){BI.SingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{isDefaultInit:!0},items:o.items,value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SingleTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SingleTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(items)}}),BI.SingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_level_tree",BI.SingleTreePopup),BI.SingleTreeTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-trigger",height:24,text:"",items:[],value:""})},_init:function(){BI.SingleTreeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,text:o.text,items:o.items,height:o.height,value:o.value})},_checkTitle:function(){var self=this,val=this.getValue();BI.any(this.options.items,function(i,item){if(BI.contains(val,item.value))return self.trigger.setTitle(item.text||item.value),!0})},setValue:function(v){v=BI.isArray(v)?v:[v],this.options.value=v,this.trigger.setValue(v),this._checkTitle()},getValue:function(){return this.options.value||[]},populate:function(items){BI.SingleTreeTrigger.superclass.populate.apply(this,arguments),this.trigger.populate(items)}}),BI.shortcut("bi.single_tree_trigger",BI.SingleTreeTrigger),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:24,attributes:{tabIndex:0}})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._createValueMap();var value;BI.isNotNull(o.value)&&(value=this._digest(o.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",cls:"text-value-down-list-trigger",height:o.height,items:o.items,text:o.text,value:value}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:o.height,el:this.trigger,value:BI.isNull(value)?[]:[value],items:BI.deepClone(o.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){var currentVal=self.combo.getValue()[0].value;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){var currentVal=self.combo.getValue()[0].childValue;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))})},_createValueMap:function(){var self=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(idx,item){BI.has(item,"el")?BI.each(item.children,function(id,it){self.valueMap[it.value]={value:item.el.value,childValue:it.value}}):self.valueMap[item.value]={value:item.value}})},_digest:function(v){return this.value=v,this.valueMap[v]},setValue:function(v){v=this._digest(v),this.combo.setValue([v]),this.trigger.setValue(v)},getValue:function(){var v=this.combo.getValue()[0];return[v.childValue||v.value]},populate:function(items){this.options.items=BI.flatten(items),this.combo.populate(items),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:o.height,items:this._formatItemArray(o.items),text:o.text,value:BI.isNull(o.value)?"":o.value.childValue||o.value.value})},_formatItemArray:function(){var sourceArray=BI.flatten(BI.deepClone(this.options.items)),targetArray=[];return BI.each(sourceArray,function(idx,item){BI.has(item,"el")?(BI.each(item.children,function(id,it){it.text=item.el.text+"("+it.text+")"}),targetArray=BI.concat(targetArray,item.children)):targetArray.push(item)}),targetArray},setValue:function(vals){this.trigger.setValue(vals.childValue||vals.value)},populate:function(items){this.trigger.populate(this._formatItemArray(items))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),!function(){BI.TimePopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-popup",height:68},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",value:o.value,ref:function(_ref){self.timeSelect=_ref}}]},hgap:10,height:44},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clears"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Now"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},setValue:function(value){this._checkValueValid(value)?this.timeSelect.setValue():this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second})},getValue:function(){return this.timeSelect.getValue()},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)}}),BI.TimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE", +BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.TimePopup.BUTTON_NOW_EVENT_CHANGE="BUTTON_NOW_EVENT_CHANGE",BI.TimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.time_popup",BI.TimePopup)}(),!function(){BI.TimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:80,popupWidth:240,comboAdjustHeight:1,border:1},props:{baseCls:"bi-time-combo bi-border bi-border-radius bi-focus-shadow",width:78,height:22,format:"",allowEdit:!1},render:function(){var self=this,opts=this.options;this.storeTriggerValue="",this.storeValue=opts.value;var popup={type:"bi.time_popup",value:opts.value,listeners:[{eventName:BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.hidePopupView(),self.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.hidePopupView(),self.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,action:function(){self._setNowTime()}}],ref:function(_ref){self.popup=_ref}};return{type:"bi.htape",items:[{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.time_trigger",height:opts.height,allowEdit:opts.allowEdit,watermark:opts.watermark,format:opts.format,value:opts.value,ref:function(_ref){self.trigger=_ref},listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.TimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:"EVENT_STOP",action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:"EVENT_FOCUS",action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){self.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_ERROR",action:function(){var date=BI.getDate();self.storeValue={hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},self.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_VALID",action:function(){self.fireEvent("EVENT_VALID")}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}},{eventName:"EVENT_CONFIRM",action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self.fireEvent("EVENT_CONFIRM")}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW)}}],ref:function(_ref){self.combo=_ref}},top:0,left:0,right:22,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button time-font icon-size-16",width:22,height:22,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(_ref){self.triggerBtn=_ref}},top:0,right:0}]}]}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()},_setNowTime:function(){var date=BI.getDate(),nowTome={hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()};this.setValue(nowTome),this.hidePopupView(),this.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}}),BI.TimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.TimeCombo.EVENT_VALID="EVENT_VALID",BI.TimeCombo.EVENT_ERROR="EVENT_ERROR",BI.TimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.time_combo",BI.TimeCombo)}(),!function(){BI.TimeTrigger=BI.inherit(BI.Trigger,{_const:{COMPARE_FORMAT:"%H:%M:%S",COMPLETE_COMPARE_FORMAT:"%Y-%M-%d %H:%M:%S %P",FORMAT_ARRAY:["%H:%M:%S","%I:%M:%S","%l:%M:%S","%k:%M:%S","%l:%M:%S %p","%l:%M:%S %P","%H:%M:%S %p","%H:%M:%S %P","%l:%M","%k:%M","%I:%M","%H:%M","%M:%S"],DEFAULT_DATE_STRING:"2000-01-01"},props:{extraCls:"bi-time-trigger",value:{},format:"",allowEdit:!1},render:function(){var self=this,o=this.options;return this.storeTriggerValue="",this.storeValue=o.value,{type:"bi.absolute",items:[{el:{type:"bi.sign_editor",height:o.height,validationChecker:function(v){return self._dateCheck(v)},quitChecker:function(){return!1},ref:function(_ref){self.editor=_ref},value:this._formatValue(o.value),hgap:4,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),title:BI.bind(this._getTitle,this),listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){self.fireEvent("EVENT_KEY_DOWN",arguments)}},{eventName:"EVENT_FOCUS",action:function(){self.storeTriggerValue=self.getKey(),self.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){self.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_STOP",action:function(){self.fireEvent("EVENT_STOP")}},{eventName:"EVENT_VALID",action:function(){self.fireEvent("EVENT_VALID")}},{eventName:"EVENT_ERROR",action:function(){self.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_CONFIRM",action:function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var date=value.match(/\d+/g);self.storeValue={hour:0|date[0],minute:0|date[1],second:0|date[2]}}self.fireEvent("EVENT_CONFIRM")}},{eventName:"EVENT_START",action:function(){self.fireEvent("EVENT_START")}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.text",invisible:o.allowEdit,cls:"show-text",title:BI.bind(this._getTitle,this),hgap:4},left:0,right:0,top:0,bottom:0}]}},_dateCheck:function(date){var c=this._const;return BI.any(c.FORMAT_ARRAY,function(idx,format){return BI.print(BI.parseDateTime(c.DEFAULT_DATE_STRING+" "+date,c.COMPLETE_COMPARE_FORMAT),format)===date})},_getTitle:function(){var storeValue=this.storeValue||{},date=BI.getDate();return BI.print(BI.getDate(date.getFullYear(),0,1,storeValue.hour,storeValue.minute,storeValue.second),this._getFormatString())},_getFormatString:function(){return this.options.format||this._const.COMPARE_FORMAT},_formatValue:function(v){var now=BI.getDate();return BI.isNotEmptyObject(v)?BI.print(BI.getDate(now.getFullYear(),now.getMonth(),now.getDay(),v.hour,v.minute,v.second),this._getFormatString()):""},getKey:function(){return this.editor.getValue()},setValue:function(v){this.storeValue=v,this.editor.setValue(this._formatValue(v))},getValue:function(){return this.storeValue}}),BI.shortcut("bi.time_trigger",BI.TimeTrigger)}(),BI.DateInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var conf=BI.DateInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-date-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var self=this,o=this.options;BI.DateInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_date_combo",behaviors:o.behaviors,value:v});return combo.on(BI.DynamicDateCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_ERROR)}),combo.on(BI.DynamicDateCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hidePopupView(),self.right.hidePopupView()}),combo.on(BI.DynamicDateCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,obj.day,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g);return this._dateCheck(smallDate)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:smallObj[2]})&&this._dateCheck(bigDate)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:bigObj[2]})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X-%d"),"%Y-%X-%d"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X-%d"),"%Y-%X-%d"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.left.setTitle(v),this.right.setTitle(v),this.label.setTitle(v)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.DateInterval.EVENT_VALID="EVENT_VALID",BI.DateInterval.EVENT_ERROR="EVENT_ERROR",BI.DateInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_interval",BI.DateInterval),BI.TimeInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var conf=BI.TimeInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-time-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var self=this,o=this.options;BI.TimeInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_date_time_combo",behaviors:o.behaviors,value:v});return combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_ERROR)}),combo.on(BI.DynamicDateTimeCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateTimeCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hidePopupView(),self.right.hidePopupView()}),combo.on(BI.DynamicDateTimeCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,obj.day,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g);return this._dateCheck(smallDate)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:smallObj[2]})&&this._dateCheck(bigDate)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:bigObj[2]})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.left.setTitle(v),this.right.setTitle(v),this.label.setTitle(v)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimeInterval.EVENT_VALID="EVENT_VALID",BI.TimeInterval.EVENT_ERROR="EVENT_ERROR",BI.TimeInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_interval",BI.TimeInterval),!function(){BI.TimePeriods=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0},props:{extraCls:"bi-time-interval",value:{}},render:function(){var self=this,o=this.options;return{type:"bi.absolute",height:this.constants.height,items:[{el:{type:"bi.horizontal_auto",items:[{type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-",ref:function(_ref){self.label=_ref}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:BI.extend({ref:function(_ref){self.left=_ref}},this._createCombo(o.value.start)),left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:BI.extend({ref:function(_ref){self.right=_ref}},this._createCombo(o.value.end)),left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]},top:0,left:0,right:0,bottom:0}]}},_createCombo:function(v){var self=this;return{type:"bi.time_combo",value:v,listeners:[{eventName:BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,action:function(){self.left.hidePopupView(),self.right.hidePopupView()}},{eventName:BI.TimeCombo.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePeriods.EVENT_CHANGE)}},{eventName:BI.TimeCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TimePeriods.EVENT_CONFIRM)}}]}},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimePeriods.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimePeriods.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_periods",BI.TimePeriods)}(),BI.DynamicYearCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.item=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0},this.item.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))},getValue:function(){var value=this.item.getValue();return{year:0===value.offset?-value.value:value.value}}}),BI.DynamicYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_card",BI.DynamicYearCard),BI.StaticYearCard=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticYearCard.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-card",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(v){var o=this.options,y=this._year,calendar=BI.createWidget({type:"bi.year_calendar",behaviors:o.behaviors,min:o.min,max:o.max,logic:{dynamic:!0},year:y+12*v});return calendar.setValue(this._year),calendar},_init:function(){BI.StaticYearCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.selectedYear=this._year=BI.getDate().getFullYear(),this.backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.navigation.setSelect(self.navigation.getSelect()-1),self._checkLeftValid(),self._checkRightValid()}}]}),this.preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.navigation.setSelect(self.navigation.getSelect()+1),self._checkLeftValid(),self._checkRightValid()}}]}),this.navigation=BI.createWidget({type:"bi.navigation",direction:"top",element:this,single:!0,logic:{dynamic:!0},tab:{type:"bi.htape",cls:"bi-split-top bi-split-bottom",height:30,items:[{el:{type:"bi.center_adapt",items:[self.backBtn]},width:25},{type:"bi.layout"},{el:{type:"bi.center_adapt",items:[self.preBtn]},width:25}]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(self.selectedYear);var calendar=this.getSelectedCard();self.backBtn.setEnable(!calendar.isFrontYear()),self.preBtn.setEnable(!calendar.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedYear=this.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.StaticYearCard.EVENT_CHANGE,self.selectedYear)}),BI.isKey(o.value)&&this.setValue(o.value)},_checkLeftValid:function(){var o=this.options,valid=!0;return this.backBtn.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!0;return this.preBtn.setEnable(valid),valid},getValue:function(){return{year:this.selectedYear}},setValue:function(obj){var o=this.options;obj=obj||{};var v=obj.year;BI.checkDateVoid(v,1,1,o.min,o.max)[0]?(v=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue("")):(this.selectedYear=BI.parseInt(v),this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue(this.selectedYear)),this._checkLeftValid(),this._checkRightValid()}}),BI.StaticYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_card",BI.StaticYearCard),BI.DynamicYearCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,this.trigger=BI.createWidget({type:"bi.dynamic_year_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=this.getKey()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_CONFIRM,function(){self.combo.isViewVisible()||(this.getKey()&&this.getKey()!==self.storeTriggerValue?(self.storeValue=self.trigger.getValue(),self.setValue(self.storeValue)):this.getKey()||(self.storeValue=null,self.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM))}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearCombo.Static,value:{year:date.getFullYear()}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.min,max:o.max},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue}}),BI.DynamicYearCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_combo",BI.DynamicYearCombo),BI.extend(BI.DynamicYearCombo,{Static:1,Dynamic:2}),BI.DynamicYearPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",textHeight:c.buttonHeight-1,cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Current_Year"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Fen"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear()}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_popup",BI.DynamicYearPopup),BI.DynamicYearTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-year-trigger",min:"1900-01-01",max:"2099-12-31",height:24})},beforeInit:function(callback){var o=this.options;o.title=BI.bind(this._titleCreator,this),callback()},_init:function(){BI.DynamicYearTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,1,1,o.min,o.max)[0]},quitChecker:function(v){return!1},hgap:c.hgap,vgap:c.vgap,watermark:BI.i18nText("BI-Basic_Unrestricted"),allowBlank:!0,errorText:function(){return BI.i18nText("BI-Year_Trigger_Invalid_Text")}}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();BI.isNotNull(value)&&self.editor.setValue(value),BI.isNotEmptyString(value)&&(self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:value}}),self.fireEvent(BI.DynamicYearTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){self.editor.isValid()&&self.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_ERROR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.text_button",baseCls:"bi-trigger-year-text",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){var dateStr=BI.print(date,"%Y");this.editor.setState(dateStr),this.editor.setValue(dateStr)},_titleCreator:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;if(!this.editor.isValid())return"";switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,"%Y");return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return value=value||{},value.year}},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static: +default:value=value||{},this.editor.setState(value.year),this.editor.setValue(value.year)}},getValue:function(){return this.storeValue},getKey:function(){return 0|this.editor.getValue()}}),BI.DynamicYearTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearTrigger.EVENT_START="EVENT_START",BI.DynamicYearTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearTrigger.EVENT_STOP="EVENT_STOP",BI.shortcut("bi.dynamic_year_trigger",BI.DynamicYearTrigger),BI.DynamicYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.MONTH,ref:function(){self.month=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year)),this.month.setValue(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))},getValue:function(){var year=this.year.getValue(),month=this.month.getValue();return{year:0===year.offset?-year.value:year.value,month:0===month.offset?-month.value:month.value}}}),BI.DynamicYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_card",BI.DynamicYearMonthCard),BI.StaticYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-month-card",behaviors:{}},_createMonths:function(){var self=this,month=[1,7,2,8,3,9,4,10,5,11,6,12],items=[];return items.push(month.slice(0,2)),items.push(month.slice(2,4)),items.push(month.slice(4,6)),items.push(month.slice(6,8)),items.push(month.slice(8,10)),items.push(month.slice(10,12)),BI.map(items,function(i,item){return BI.map(item,function(j,td){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:td,text:td,ref:function(_ref){self.monthMap[0===j?i:i+6]=_ref}}})})},render:function(){var self=this,o=this.options;return this.monthMap={},{type:"bi.vertical",items:[{type:"bi.year_picker",min:o.min,max:o.max,ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self._checkMonthStatus(value),self.setValue({year:value,month:self.selectedMonth})}}]},{type:"bi.button_group",cls:"bi-split-top",behaviors:o.behaviors,ref:function(){self.month=this},items:this._createMonths(),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedMonth=this.getValue()[0],self.fireEvent(BI.StaticYearMonthCard.EVENT_CHANGE)}}]}]}},mounted:function(){this._checkMonthStatus(this.selectedYear)},_checkMonthStatus:function(year){var o=this.options,minDate=BI.parseDateTime(o.min,"%Y-%X-%d"),maxDate=BI.parseDateTime(o.max,"%Y-%X-%d"),minYear=minDate.getFullYear(),maxYear=maxDate.getFullYear(),minMonth=0,maxMonth=11;minYear===year&&(minMonth=minDate.getMonth()),maxYear===year&&(maxMonth=maxDate.getMonth());var yearInvalid=yearmaxYear;BI.each(this.monthMap,function(month,obj){var monthInvalid=monthmaxMonth;obj.setEnable(!yearInvalid&&!monthInvalid)})},getValue:function(){return{year:this.selectedYear,month:this.selectedMonth}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.month=obj.month||0,0===newObj.year||0===newObj.month||BI.checkDateVoid(newObj.year,newObj.month,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedMonth="",this.yearPicker.setValue(year),this.month.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedMonth=BI.parseInt(newObj.month),this.yearPicker.setValue(this.selectedYear),this.month.setValue(this.selectedMonth)}}),BI.StaticYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_month_card",BI.StaticYearMonthCard),BI.DynamicYearMonthCombo=BI.inherit(BI.Single,{props:{baseCls:"bi-year-month-combo bi-border bi-focus-shadow",behaviors:{},minDate:"1900-01-01",maxDate:"2099-12-31",height:22},_init:function(){BI.DynamicYearMonthCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,this.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_month_trigger",min:o.minDate,max:o.maxDate,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_ERROR)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_VALID,function(){self.fireEvent(BI.DynamicYearMonthCombo.EVENT_VALID)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS)}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:{type:"bi.dynamic_year_month_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearMonthPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.minDate,max:o.maxDate},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearMonthCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},hideView:function(){this.combo.hideView()},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicYearMonthCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthCombo.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_month_combo",BI.DynamicYearMonthCombo),BI.extend(BI.DynamicYearMonthCombo,{Static:1,Dynamic:2}),BI.DynamicYearMonthPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-month-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearMonthCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Month"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%x"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Month"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_month_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_month_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearMonthCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear(),month:date.getMonth()+1}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearMonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_popup",BI.DynamicYearMonthPopup),BI.DynamicYearMonthTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-month-trigger",min:"1900-01-01",max:"2099-12-31",height:22},beforeInit:function(callback){var o=this.options;o.title=BI.bind(this._titleCreator,this),callback()},_init:function(){BI.DynamicYearMonthTrigger.superclass._init.apply(this,arguments);var o=this.options;this.yearEditor=this._createEditor(!0),this.monthEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height}]},{type:"bi.htape",items:[this.monthEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Month"),width:o.height},width:o.height}]}]},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_createEditor:function(isYear){var self=this,o=this.options,c=this._const,minDate=BI.parseDateTime(o.min,"%Y-%X-%d"),editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return isYear?""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,v===minDate.getFullYear()?minDate.getMonth()+1:1,1,o.min,o.max)[0]:""===v||BI.isPositiveInteger(v)&&v>=1&&v<=12&&!BI.checkDateVoid(BI.getDate().getFullYear(),v,1,o.min,o.max)[0]},quitChecker:function(){return!1},watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(v){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},hgap:c.hgap,vgap:c.vgap,allowBlank:!0});return editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN)}),editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS)}),editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP)}),editor.on(BI.SignEditor.EVENT_CONFIRM,function(){self._doEditorConfirm(editor),self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM)}),editor.on(BI.SignEditor.EVENT_SPACE,function(){editor.isValid()&&editor.blur()}),editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_START)}),editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_ERROR)}),editor.on(BI.SignEditor.EVENT_VALID,function(){var year=self.yearEditor.getValue(),month=self.monthEditor.getValue();BI.isNotEmptyString(year)&&BI.isNotEmptyString(month)&&BI.isPositiveInteger(year)&&month>=1&&month<=12&&!BI.checkDateVoid(year,month,1,o.min,o.max)[0]&&self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_VALID)}),editor.on(BI.SignEditor.EVENT_CHANGE,function(){isYear&&self._autoSwitch(editor)}),editor},_titleCreator:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;if(!this.monthEditor.isValid()||!this.yearEditor.isValid())return"";switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,"%Y-%x");return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return value=value||{},this._getStaticTitle(value)}},_doEditorConfirm:function(editor){var value=editor.getValue();BI.isNotNull(value)&&editor.setValue(value);var monthValue=this.monthEditor.getValue();this.storeValue={type:BI.DynamicDateCombo.Static,value:{year:this.yearEditor.getValue(),month:BI.isEmptyString(this.monthEditor.getValue())?"":monthValue}}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_autoSwitch:function(editor){var v=editor.getValue();BI.isNotEmptyString(v)&&BI.checkDateLegal(v)&&4===v.length&&this._yearCheck(v)&&(this._doEditorConfirm(editor),this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM),this.monthEditor.focus())},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(obj.month)&&0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){this.yearEditor.setValue(date.getFullYear()),this.monthEditor.setValue(date.getMonth()+1)},_getStaticTitle:function(value){value=value||{};var hasYear=!(BI.isNull(value.year)||BI.isEmptyString(value.year)),hasMonth=!(BI.isNull(value.month)||BI.isEmptyString(value.month));switch(hasYear<<1|hasMonth){case 0:return"";case 1:return value.month;case 2:return value.year;case 3:default:return value.year+"-"+value.month}},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:value=value||{};var month=BI.isNull(value.month)?null:value.month;this.yearEditor.setValue(value.year),this.monthEditor.setValue(month)}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.monthEditor.getValue()},isValid:function(){return this.yearEditor.isValid()&&this.monthEditor.isValid()}}),BI.DynamicYearMonthTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthTrigger.EVENT_START="EVENT_START",BI.DynamicYearMonthTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_month_trigger",BI.DynamicYearMonthTrigger),BI.YearMonthInterval=BI.inherit(BI.Single,{constants:{height:24,width:25,lgap:15,offset:-15,timeErrorCls:"time-error"},props:{extraCls:"bi-year-month-interval",minDate:"1900-01-01",maxDate:"2099-12-31"},_init:function(){var self=this,o=this.options;BI.YearMonthInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",hgap:15,height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:0,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_year_month_combo",behaviors:o.behaviors,value:v,listeners:[{eventName:BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,action:function(){self.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW)}}]});return combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)}),combo.on(BI.DynamicYearMonthCombo.EVENT_VALID,function(){self._checkValid()}),combo.on(BI.DynamicYearMonthCombo.EVENT_FOCUS,function(){self._checkValid()}),combo.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hideView(),self.right.hideView()}),combo.on(BI.DynamicYearMonthCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x"),"%Y-%x")===date||BI.print(BI.parseDateTime(date,"%Y-%X"),"%Y-%X")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,1,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g),smallDate4Check="";BI.isNotNull(smallObj)&&(smallDate4Check=(smallObj[0]||"")+"-"+(smallObj[1]||1));var bigDate4Check="";return BI.isNotNull(bigObj)&&(bigDate4Check=(bigObj[0]||"")+"-"+(bigObj[1]||1)),this._dateCheck(smallDate4Check)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:1})&&this._dateCheck(bigDate4Check)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:1})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X"),"%Y-%X"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X"),"%Y-%X"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.setTitle(v)},_clearTitle:function(){this.setTitle("")},_checkValid:function(){var self=this;BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end),this._checkValid()},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.YearMonthInterval.EVENT_VALID="EVENT_VALID",BI.YearMonthInterval.EVENT_ERROR="EVENT_ERROR",BI.YearMonthInterval.EVENT_CHANGE="EVENT_CHANGE",BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.year_month_interval",BI.YearMonthInterval),BI.DynamicYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.QUARTER,ref:function(){self.quarter=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year)),this.quarter.setValue(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))},getValue:function(){var year=this.year.getValue(),quarter=this.quarter.getValue();return{year:0===year.offset?-year.value:year.value,quarter:0===quarter.offset?-quarter.value:quarter.value}}}),BI.DynamicYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_card",BI.DynamicYearQuarterCard),BI.StaticYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-quarter-card",behaviors:{}},_createQuarter:function(){var items=[{text:BI.Date._QN[1],value:1},{text:BI.Date._QN[2],value:2},{text:BI.Date._QN[3],value:3},{text:BI.Date._QN[4],value:4}];return BI.map(items,function(j,item){return BI.extend(item,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:24})})},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.year_picker",ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self.setValue({year:value,quarter:self.selectedQuarter})}}]},{type:"bi.button_group",behaviors:o.behaviors,ref:function(){self.quarter=this},items:this._createQuarter(),layouts:[{type:"bi.vertical",vgap:10}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedQuarter=this.getValue()[0],self.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE)}}]}]}},getValue:function(){return{year:this.selectedYear,quarter:this.selectedQuarter}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.quarter=obj.quarter||0,0===newObj.quarter||0===newObj.year||BI.checkDateVoid(newObj.year,newObj.quarter,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedQuarter="",this.yearPicker.setValue(year),this.quarter.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedQuarter=BI.parseInt(newObj.quarter),this.yearPicker.setValue(this.selectedYear),this.quarter.setValue(this.selectedQuarter)}}),BI.StaticYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_quarter_card",BI.StaticYearQuarterCard),BI.DynamicYearQuarterCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-quarter-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,self.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_quarter_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_quarter_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearQuarterPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),quarter:BI.getQuarter(date)}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.min,max:o.max},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearQuarterCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue}}),BI.DynamicYearQuarterCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_quarter_combo",BI.DynamicYearQuarterCombo),BI.extend(BI.DynamicYearQuarterCombo,{Static:1,Dynamic:2}),BI.DynamicYearQuarterPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-quarter-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearQuarterCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Quarter"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicYearQuarterCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%Q"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Quarter"),value:BI.DynamicYearQuarterCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearQuarterCombo.Dynamic +}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearQuarterCombo.Dynamic:return{type:"bi.dynamic_year_quarter_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearQuarterCombo.Static:default:return{type:"bi.static_year_quarter_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.DynamicYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearQuarterCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear(),quarter:BI.getQuarter(date)}),self._setInnerValue();break;case BI.DynamicYearQuarterCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearQuarterCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearQuarterPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_popup",BI.DynamicYearQuarterPopup),BI.DynamicYearQuarterTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-quarter-trigger",min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterTrigger.superclass._init.apply(this,arguments);var o=this.options;this.yearEditor=this._createEditor(!0),this.quarterEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height}]},{type:"bi.htape",items:[this.quarterEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Quarter"),width:24},width:24}]}]},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_createEditor:function(isYear){var self=this,o=this.options,c=this._const,editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return isYear?""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,1,1,o.min,o.max)[0]:""===v||BI.isPositiveInteger(v)&&v>=1&&v<=4&&!BI.checkDateVoid(BI.getDate().getFullYear(),v,1,o.min,o.max)[0]},quitChecker:function(){return!1},errorText:function(v){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},watermark:BI.i18nText("BI-Basic_Unrestricted"),hgap:c.hgap,vgap:c.vgap,title:"",allowBlank:!0});return editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN)}),editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS)}),editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP)}),editor.on(BI.SignEditor.EVENT_CONFIRM,function(){self._doEditorConfirm(editor),self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM)}),editor.on(BI.SignEditor.EVENT_SPACE,function(){editor.isValid()&&editor.blur()}),editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_START)}),editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_ERROR)}),editor.on(BI.SignEditor.EVENT_CHANGE,function(){isYear&&self._autoSwitch(editor)}),editor},_doEditorConfirm:function(editor){var value=editor.getValue();BI.isNotNull(value)&&editor.setValue(value);var quarterValue=this.quarterEditor.getValue();this.storeValue={type:BI.DynamicYearQuarterCombo.Static,value:{year:this.yearEditor.getValue(),quarter:BI.isEmptyString(this.quarterEditor.getValue())?"":quarterValue}},this.setTitle(this._getStaticTitle(this.storeValue.value))},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_autoSwitch:function(editor){var v=editor.getValue();BI.isNotEmptyString(v)&&BI.checkDateLegal(v)&&4===v.length&&this._yearCheck(v)&&(this._doEditorConfirm(editor),this.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM),this.quarterEditor.focus())},_getStaticTitle:function(value){value=value||{};var hasYear=!(BI.isNull(value.year)||BI.isEmptyString(value.year)),hasMonth=!(BI.isNull(value.quarter)||BI.isEmptyString(value.quarter));switch(hasYear<<1|hasMonth){case 0:return"";case 1:return value.quarter;case 2:return value.year;case 3:default:return value.year+"-"+value.quarter}},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(obj.quarter)&&0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){var dateStr=BI.print(date,"%Y-%Q");this.yearEditor.setValue(date.getFullYear()),this.quarterEditor.setValue(BI.getQuarter(date)),this.setTitle(BI.isEmptyString(text)?dateStr:text+":"+dateStr)},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicYearQuarterCombo.Static,value=v.value||v),type){case BI.DynamicYearQuarterCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicYearQuarterCombo.Static:default:value=value||{};var quarter=BI.isNull(value.quarter)?null:value.quarter;this.yearEditor.setValue(value.year),this.yearEditor.setTitle(value.year),this.quarterEditor.setValue(quarter),this.quarterEditor.setTitle(quarter),this.setTitle(this._getStaticTitle(value))}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.quarterEditor.getValue()}}),BI.DynamicYearQuarterTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearQuarterTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearQuarterTrigger.EVENT_START="EVENT_START",BI.DynamicYearQuarterTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_quarter_trigger",BI.DynamicYearQuarterTrigger),BI.AbstractAllValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractAllValueChooser.superclass._defaultConfig.apply(this,arguments),{width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_itemsCreator:function(options,callback){function call(items){var keywords=(options.keywords||[]).slice();options.keyword&&keywords.push(options.keyword);var resultItems=items;if(BI.isNotEmptyArray(keywords)&&(resultItems=[],BI.each(keywords,function(i,kw){var search=BI.Func.getSearchResult(items,kw);resultItems=resultItems.concat(search.match).concat(search.find)}),resultItems=BI.uniq(resultItems)),options.selectedValues){var filter=BI.makeObject(options.selectedValues,!0);resultItems=BI.filter(resultItems,function(i,ob){return!filter[ob.value]})}return options.type===BI.MultiSelectCombo.REQ_GET_ALL_DATA?void callback({items:resultItems}):options.type===BI.MultiSelectCombo.REQ_GET_DATA_LENGTH?void callback({count:resultItems.length}):void callback({items:resultItems,hasNext:!1})}var self=this,o=this.options;o.cache&&this.items?call(this.items):o.itemsCreator({},function(items){self.items=items,call(items)})}}),BI.AllValueChooserCombo=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&(this.items=o.items),this.combo=BI.createWidget({type:"bi.multi_select_combo",text:o.text,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,value:{type:BI.Selection.Multi,value:o.value||[]}}),this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM,function(){self.fireEvent(BI.AllValueChooserCombo.EVENT_CONFIRM)})},setValue:function(v){this.combo.setValue({type:BI.Selection.Multi,value:v||[]})},getValue:function(){var val=this.combo.getValue()||{};return val.type===BI.Selection.All?val.assist:val.value||[]},populate:function(items){this.items=items,this.combo.populate.apply(this,arguments)}}),BI.AllValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_chooser_combo",BI.AllValueChooserCombo),BI.AllValueChooserPane=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-pane",width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserPane.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&(this.items=o.items),this.list=BI.createWidget({type:"bi.multi_select_list",element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height}),this.list.on(BI.MultiSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.AllValueChooserPane.EVENT_CHANGE)})},setValue:function(v){this.list.setValue({type:BI.Selection.Multi,value:v||[]})},getValue:function(){var val=this.list.getValue()||{};return val.type===BI.Selection.All?val.assist:val.value||[]},populate:function(items){this.items=items,this.list.populate.apply(this.list,arguments)}}),BI.AllValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_value_chooser_pane",BI.AllValueChooserPane),BI.AllValueMultiTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-all-value-multi-text-value-combo",width:200,height:24,items:[]},render:function(){var self=this,o=this.options,value=this._digestValue(o.value);return{type:"bi.search_multi_text_value_combo",text:o.text,height:o.height,items:o.items,value:value,numOfPage:100,valueFormatter:o.valueFormatter,warningTitle:o.warningTitle,listeners:[{eventName:BI.SearchMultiTextValueCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM)}}],ref:function(){self.combo=this}}},setValue:function(v){var value=this._digestValue(v);this.combo.setValue(value)},getValue:function(){var obj=this.combo.getValue()||{};if(obj.value=obj.value||[],obj.type===BI.Selection.All){var values=[];return BI.each(this.options.items,function(idx,item){!BI.contains(obj.value,item.value)&&values.push(item.value)}),values}return obj.value||[]},populate:function(items){this.options.items=items,this.combo.populate.apply(this,arguments)},_digestValue:function(v){return{type:BI.Selection.Multi,value:v||[]}}}),BI.AllValueMultiTextValueCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_multi_text_value_combo",BI.AllValueMultiTextValueCombo),BI.AbstractTreeValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,open:!1})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_initData:function(items){this.items=items;var nodes=BI.Tree.treeFormat(items);this.tree=new BI.Tree,this.tree.initTree(nodes)},_itemsCreator:function(options,callback){function call(){switch(options.type){case BI.TreeView.REQ_TYPE_INIT_DATA:self._reqInitTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_ADJUST_DATA:self._reqAdjustTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_SELECT_DATA:self._reqSelectedTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:self._reqDisplayTreeNode(options,callback);break;default:self._reqTreeNode(options,callback)}}var self=this,o=this.options;this.items?call():o.itemsCreator({},function(items){self._initData(items),call()})},_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){return null==selected||BI.isEmpty(selected)?void BI.each(node.getChildren(),function(i,child){var newParents=BI.clone(parentValues);newParents.push(child.value);var llen=self._getChildCount(newParents);createOneJson(child,node.id,llen),doCheck(newParents,child,{})}):void BI.each(selected,function(k){var node=self._getTreeNode(parentValues,k);if(BI.isNull(node))createOneJson({id:BI.UUID(),text:k,value:k},BI.UUID(),0);else{var newParents=BI.clone(parentValues);newParents.push(node.value),createOneJson(node,node.parent&&node.parent.id,getCount(selected[k],newParents)),doCheck(newParents,node,selected[k])}})}function getCount(jo,parentValues){return null==jo?0:BI.isEmpty(jo)?self._getChildCount(parentValues):BI.size(jo)}function createOneJson(node,pId,llen){result.push({id:node.id,pId:pId,text:node.text+(llen>0?"("+BI.i18nText("BI-Basic_Altogether")+llen+BI.i18nText("BI-Basic_Count")+")":""),value:node.value,open:!0})}var self=this,result=[],selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:result}))},_reqSelectedTreeNode:function(op,callback){function dealWithSelectedValues(selectedValues){var p=parentValues.concat(notSelectedValue);if(canFindKey(selectedValues,p))if(isSearchValueInParent(p))self._deleteNode(selectedValues,p);else{var searched=[],find=search(parentValues,notSelectedValue,[],searched);find&&BI.isNotEmptyArray(searched)&&BI.each(searched,function(i,arr){var node=self._getNode(selectedValues,arr);node?self._deleteNode(selectedValues,arr):expandSelectedValue(selectedValues,arr,BI.last(arr))})}if(isChild(selectedValues,p)){var result=[],find=!1;isSearchValueInParent(p)?find=!0:(find=search(parentValues,notSelectedValue,result),p=parentValues),find===!0&&(expandSelectedValue(selectedValues,p,notSelectedValue),result.length>0&&BI.each(result,function(i,strs){self._buildTree(selectedValues,strs)}))}}function expandSelectedValue(selectedValues,parents,notSelectedValue){var next=selectedValues,childrenCount=[],path=[];BI.some(parents,function(i,v){var t=next[v];if(null==t){if(0===i)return!0;if(!BI.isEmpty(next))return!0;var split=parents.slice(0,i),expanded=self._getChildren(split);if(path.push(split),childrenCount.push(expanded.length),i===parents.length-1&&1===expanded.length&&expanded[0].value===notSelectedValue)for(var j=childrenCount.length-1;j>=0&&1===childrenCount[j];j--)self._deleteNode(selectedValues,path[j]);else BI.each(expanded,function(m,child){return i===parents.length-1&&child.value===notSelectedValue||void(next[child.value]={})});next=next[v]}else next=t})}function search(parents,current,result,searched){var newParents=BI.clone(parents);if(newParents.push(current),self._isMatch(parents,current,keyword))return searched&&searched.push(newParents),!0;var children=self._getChildren(newParents),notSearch=[],can=!1;return BI.each(children,function(i,child){search(newParents,child.value,result,searched)?can=!0:notSearch.push(child.value)}),can===!0&&BI.each(notSearch,function(i,v){var next=BI.clone(newParents);next.push(v),result.push(next)}),can}function isSearchValueInParent(parentValues){for(var i=0,len=parentValues.length;iself._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,isAllSelect,result){if(self._isMatch(parentValues,current,keyword)){var checked=isAllSelect||isSelected(parentValues,current);return createOneJson(parentValues,current,!1,checked,!isAllSelect&&isHalf(parentValues,current),!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1,isCurAllSelected=isAllSelect||isAllSelected(parentValues,current);return BI.each(children,function(i,child){var state=nodeSearch(deep+1,newParents,child.value,isCurAllSelected,result);state[1]===!0&&(checked=!0),state[0]===!0&&(can=!0)}),can===!0&&(checked=isCurAllSelected||isSelected(parentValues,current)&&checked,createOneJson(parentValues,current,!0,checked,!1,!1,result)),[can,checked]}function createOneJson(parentValues,value,isOpen,checked,half,flag,result){var node=self._getTreeNode(parentValues,value);result.push({id:node.id,pId:node.pId,text:node.text,value:node.value,title:node.title,isParent:node.getChildrenLength()>0,open:isOpen,checked:checked,halfCheck:half,flag:flag})}function isHalf(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&!BI.isEmpty(ob))return!0})}function isAllSelected(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&BI.isEmpty(ob))return!0})}function isSelected(parentValues,value){var find=findSelectedObj(parentValues);return null!=find&&BI.any(find,function(v){if(v===value)return!0})}function findSelectedObj(parentValues){var find=selectedValues;return null==find?null:(BI.every(parentValues,function(i,v){return find=find[v],null!=find}),find)}var self=this,result=[],keyword=op.keyword||"",selectedValues=op.selectedValues,lastSearchValue=op.lastSearchValue||"",output=search();BI.nextTick(function(){callback({hasNext:output.length>self._const.perPage,items:result,lastSearchValue:BI.last(output)})})},_reqTreeNode:function(op,callback){function judgeState(parentValues,selected_value,checkState){var checked=checkState.checked,half=checkState.half;return!(parentValues.length>0&&!checked)&&(0===parentValues.length||checked&&half&&!BI.isEmpty(selected_value))}function dealWithSelectedValue(parentValues,selectedValues){var valueMap={};return BI.each(parentValues,function(i,v){selectedValues=selectedValues[v]||{}}),BI.each(selectedValues,function(value,obj){if(BI.isNull(obj))return void(valueMap[value]=[0,0]);if(BI.isEmpty(obj))return void(valueMap[value]=[2,0]);var nextNames={};BI.each(obj,function(t,o){(BI.isNull(o)||BI.isEmpty(o))&&(nextNames[t]=!0)}),valueMap[value]=[1,BI.size(nextNames)]}),valueMap}function getCheckState(current,parentValues,valueMap,checkState){var checked=checkState.checked,half=checkState.half,tempCheck=!1,halfCheck=!1;if(BI.has(valueMap,current))if(1===valueMap[current][0]){var values=BI.clone(parentValues);values.push(current);var childCount=self._getChildCount(values);childCount>0&&childCount!==valueMap[current][1]&&(halfCheck=!0)}else 2===valueMap[current][0]&&(tempCheck=!0);var check;return check=checked||halfCheck||tempCheck?(tempCheck||checked)&&!half||BI.has(valueMap,current):BI.has(valueMap,current),[check,halfCheck]}var self=this,o=this.options,result=[],times=op.times,checkState=op.checkState||{},parentValues=op.parentValues||[],selectedValues=op.selectedValues||{},valueMap={};valueMap=dealWithSelectedValue(parentValues,selectedValues);for(var nodes=this._getChildren(parentValues),i=(times-1)*this._const.perPage;nodes[i]&&i0,checked:state[0],halfCheck:state[1],open:o.open})}if(o.open){var allNodes=[];BI.each(nodes,function(idx,node){allNodes=BI.concat(allNodes,self._getAllChildren(parentValues.concat([node.value])))}),BI.each(allNodes,function(idx,node){var valueMap=dealWithSelectedValue(node.parentValues,selectedValues),state=getCheckState(node.value,node.parentValues,valueMap,checkState);result.push({id:node.id,pId:node.pId,value:node.value,text:node.text,times:1,isParent:node.getChildrenLength()>0,checked:state[0],halfCheck:state[1],open:self.options.open})})}0===parentValues.length&&1===times&&(result=BI.concat(self._getAddedValueNode(parentValues,selectedValues),result)),BI.nextTick(function(){callback({items:result,hasNext:nodes.length>times*self._const.perPage})})},_getAddedValueNode:function(parentValues,selectedValues){var nodes=this._getChildren(parentValues);return BI.map(BI.difference(BI.keys(selectedValues),BI.map(nodes,"value")),function(idx,v){return{id:BI.UUID(),pId:nodes.length>0?nodes[0].pId:BI.UUID(),value:v,text:v,times:1,isParent:!1,checked:!0,halfCheck:!1}})},_getNode:function(selectedValues,parentValues){for(var pNode=selectedValues,i=0,len=parentValues.length;i0&&BI.isEmpty(pNode);)name=p[p.length-1],p=p.slice(0,p.length-1),pNode=this._getNode(selectedValues,p),null!=pNode&&delete pNode[name]},_buildTree:function(jo,values){var t=jo;BI.each(values,function(i,v){BI.has(t,v)||(t[v]={}),t=t[v]})},_isMatch:function(parentValues,value,keyword){var o=this.options,node=this._getTreeNode(parentValues,value);if(!node)return!1;var find=BI.Func.getSearchResult([node.text||node.value],keyword);if(o.allowSearchValue&&node.value){var valueFind=BI.Func.getSearchResult([node.value],keyword);return valueFind.find.length>0||valueFind.match.length>0||find.find.length>0||find.match.length>0}return find.find.length>0||find.match.length>0},_getTreeNode:function(parentValues,v){var self=this,findParentNode,index=0;return this.tree.traverse(function(node){if(!self.tree.isRoot(node))return!(index>parentValues.length)&&(index===parentValues.length&&node.value===v?(findParentNode=node,!1):node.value!==parentValues[index]||void index++)}),findParentNode},_getChildren:function(parentValues){if(parentValues.length>0)var value=BI.last(parentValues),parent=this._getTreeNode(parentValues.slice(0,parentValues.length-1),value);else var parent=this.tree.getRoot();return parent.getChildren()},_getAllChildren:function(parentValues){var children=this._getChildren(parentValues),nodes=[].concat(children);BI.each(nodes,function(idx,node){node.parentValues=parentValues});for(var queue=BI.map(children,function(idx,node){return{parentValues:parentValues,value:node.value}});BI.isNotEmptyArray(queue);){var node=queue.shift(),pValues=node.parentValues.concat(node.value),childNodes=this._getChildren(pValues);BI.each(childNodes,function(idx,node){node.parentValues=pValues}),queue=queue.concat(childNodes),nodes=nodes.concat(childNodes)}return nodes},_getChildCount:function(parentValues){return this._getChildren(parentValues).length}}),BI.AbstractListTreeValueChooser=BI.inherit(BI.AbstractTreeValueChooser,{_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){BI.each(selected,function(idx,path){BI.each(path,function(id,value){var nodeValue=value,node=self._getTreeNode(path.slice(0,id),nodeValue);BI.isNull(node)?createOneJson({id:BI.UUID(),text:nodeValue,value:nodeValue,isLeaf:!0},BI.UUID()):(BI.has(result,node.id)||createOneJson(node,node.parent&&node.parent.id),result[node.id].isLeaf!==!0&&(result[node.id].isLeaf=id===path.length-1))})})}function createOneJson(node,pId){result[node.id]={id:node.id,pId:pId,text:node.text,value:node.value,open:!0,isLeaf:node.isLeaf}}var self=this,result={},selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:BI.values(result)}))},_reqInitTreeNode:function(op,callback){function search(){var children=self._getChildren([]),start=children.length;if(""!==lastSearchValue){for(var j=0,len=start;jself._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,result){if(self._isMatch(parentValues,current,keyword)){var checked=isSelected(current);return createOneJson(parentValues,current,!1,checked,!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1;return BI.each(children,function(i,child){var state=nodeSearch(deep+1,newParents,child.value,result);state[1]===!0&&(checked=!0),state[0]===!0&&(can=!0)}),can===!0&&(checked=isSelected(current),createOneJson(parentValues,current,!0,checked,!1,result)),[can,checked]}function createOneJson(parentValues,value,isOpen,checked,flag,result){var node=self._getTreeNode(parentValues,value);result.push({id:node.id,pId:node.pId,text:node.text,value:node.value,title:node.title,isParent:node.getChildrenLength()>0,open:isOpen,checked:checked,halfCheck:!1,flag:flag})}function isHalf(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&!BI.isEmpty(ob))return!0})}function isAllSelected(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&BI.isEmpty(ob))return!0})}function isSelected(value){return BI.any(selectedValues,function(idx,array){return BI.last(array)===value})}function findSelectedObj(parentValues){var find=selectedValues;return null==find?null:(BI.every(parentValues,function(i,v){return find=find[v],null!=find}),find)}var self=this,result=[],keyword=op.keyword||"",selectedValues=op.selectedValues,lastSearchValue=op.lastSearchValue||"",output=search();BI.nextTick(function(){callback({hasNext:output.length>self._const.perPage,items:result,lastSearchValue:BI.last(output)})})},_reqTreeNode:function(op,callback){function dealWithSelectedValue(selectedValues){var valueMap={};return BI.each(selectedValues,function(idx,v){valueMap[BI.last(v)]=[2,0]}),valueMap}for(var self=this,o=this.options,result=[],times=op.times,parentValues=op.parentValues||[],selectedValues=op.selectedValues||[],valueMap=dealWithSelectedValue(selectedValues),nodes=this._getChildren(parentValues),i=(times-1)*this._const.perPage;nodes[i]&&i0,checked:checked,halfCheck:!1,open:o.open})}if(o.open){var allNodes=[];BI.each(nodes,function(idx,node){allNodes=BI.concat(allNodes,self._getAllChildren(parentValues.concat([node.value])))}),BI.each(allNodes,function(idx,node){var checked=BI.has(valueMap,node.value);result.push({id:node.id,pId:node.pId,value:node.value,text:node.text,times:1,isParent:node.getChildrenLength()>0,checked:checked,halfCheck:!1,open:o.open})})}0===parentValues.length&&1===times&&(result=BI.concat(self._getAddedValueNode(parentValues,selectedValues),result)),BI.nextTick(function(){callback({items:result,hasNext:nodes.length>times*self._const.perPage})})},_getAddedValueNode:function(parentValues,selectedValues){var nodes=this._getChildren(parentValues),values=BI.flatten(BI.filter(selectedValues,function(idx,array){return 1===array.length}));return BI.map(BI.difference(values,BI.map(nodes,"value")),function(idx,v){return{id:BI.UUID(),pId:nodes.length>0?nodes[0].pId:BI.UUID(),value:v,text:v,times:1,isParent:!1,checked:!0,halfCheck:!1}})}}),BI.ListTreeValueChooserInsertCombo=BI.inherit(BI.AbstractListTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.ListTreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-list-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.ListTreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_list_combo",element:this,text:o.text,value:o.value,watermark:o.watermark,allowInsertValue:o.allowInsertValue,allowEdit:o.allowEdit, +itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeListCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeListCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeListCombo.EVENT_STOP,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeListCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeListCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeListCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.ListTreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.ListTreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.list_tree_value_chooser_insert_combo",BI.ListTreeValueChooserInsertCombo),BI.TreeValueChooserInsertCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_insert_combo",text:o.text,value:o.value,watermark:o.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeInsertCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeInsertCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeInsertCombo.EVENT_STOP,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeInsertCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.TreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.tree_value_chooser_insert_combo",BI.TreeValueChooserInsertCombo),BI.TreeValueChooserCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_combo",text:o.text,value:o.value,watermark:o.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeCombo.EVENT_STOP,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_STOP)}},{eventName:BI.MultiTreeCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TreeValueChooserCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.tree_value_chooser_combo",BI.TreeValueChooserCombo),BI.TreeValueChooserPane=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-pane",items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.pane=BI.createWidget({type:"bi.multi_select_tree",element:this,itemsCreator:BI.bind(this._itemsCreator,this)}),this.pane.on(BI.MultiSelectTree.EVENT_CHANGE,function(){self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE)}),BI.isNotNull(o.items)&&(this._initData(o.items),this.populate())},setSelectedValue:function(v){this.pane.setSelectedValue(v)},setValue:function(v){this.pane.setValue(v)},getValue:function(){return this.pane.getValue()},populate:function(){this.pane.populate.apply(this.pane,arguments)}}),BI.TreeValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tree_value_chooser_pane",BI.TreeValueChooserPane),BI.AbstractValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_getItemsByTimes:function(items,times){for(var res=[],i=(times-1)*this._const.perPage;items[i]&&idocument.F=Object"),t.close(),p=t.F;e--;)delete p[a][i[e]];return p()};t.exports=Object.create||function(t,n){var e;return null!==t?(l[a]=r(t),e=new l,l[a]=null,e[f]=t):e=p(),n===undefined?e:o(e,n)},u[f]=!0},function(t,n,e){"use strict";var r=e(25);t.exports=function(t){return Object(r(t))}},function(t,n,e){"use strict";t.exports={}},function(t,n,e){"use strict";var o=e(13),i=function i(t){var e,r;this.promise=new t(function(t,n){if(e!==undefined||r!==undefined)throw TypeError("Bad Promise constructor");e=t,r=n}),this.resolve=o(e),this.reject=o(r)};t.exports.f=function(t){return new i(t)}},function(t,n,e){"use strict";var r=e(4),o=e(35),i=e(18),u=e(14),c=e(37),s=e(8),f=e(47),a=Object.getOwnPropertyDescriptor;n.f=r?a:function(t,n){if(t=u(t),n=c(n,!0),f)try{return a(t,n)}catch(e){}if(s(t,n))return i(!o.f.call(t,n),t[n])}},function(t,n,e){"use strict";t.exports=function(t){if(t==undefined)throw TypeError("Can't call method on "+t);return t}},function(t,n,e){"use strict";var r=e(19),o=e(40),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n,e){"use strict";t.exports={}},function(t,n,e){"use strict";var r=e(29),o=Math.min;t.exports=function(t){return 0o;)u(r,e=n[o++])&&(~s(i,e)||i.push(e));return i}},function(t,n,e){"use strict";var s=e(14),f=e(28),a=e(78),r=function r(c){return function(t,n,e){var r,o=s(t),i=f(o.length),u=a(e,i);if(c&&n!=n){for(;u=e.length?{value:undefined,done:!0}:(t=o(e,r),n.index+=t.length,{value:t,done:!1})})},function(t,n,e){"use strict";var o=e(60).IteratorPrototype,i=e(20),u=e(18),c=e(32),s=e(22),f=function f(){return this};t.exports=function(t,n,e){var r=n+" Iterator";return t.prototype=i(o,{next:u(1,e)}),c(t,r,!1,!0),s[r]=f,t}},function(t,n,e){"use strict";var r=e(5);t.exports=!r(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},function(t,n,e){"use strict";var r=e(7);t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,n,e){"use strict";var r=e(0),o=e(108),i=e(109),u=e(6),c=e(1),s=c("iterator"),f=c("toStringTag"),a=i.values;for(var l in o){var p=r[l],d=p&&p.prototype;if(d){if(d[s]!==a)try{u(d,s,a)}catch(v){d[s]=a}if(d[f]||u(d,f,l),o[l])for(var y in i)if(d[y]!==i[y])try{u(d,y,i[y])}catch(v){d[y]=i[y]}}}},function(t,n,e){"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,n,e){"use strict";var r=e(14),o=e(110),i=e(22),u=e(16),c=e(59),s="Array Iterator",f=u.set,a=u.getterFor(s);t.exports=c(Array,"Array",function(t,n){f(this,{type:s,target:r(t),index:0,kind:n})},function(){var t=a(this),n=t.target,e=t.kind,r=t.index++;return!n||r>=n.length?(t.target=undefined,{value:undefined,done:!0}):"keys"==e?{value:r,done:!1}:"values"==e?{value:n[r],done:!1}:{value:[r,n[r]],done:!1}},"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,n,e){"use strict";var r=e(1),o=e(20),i=e(6),u=r("unscopables"),c=Array.prototype;c[u]==undefined&&i(c,u,o(null)),t.exports=function(t){c[u][t]=!0}},function(t,n,e){"use strict";var r,o,i,u,c=e(2),s=e(15),f=e(0),a=e(11),l=e(62),p=e(10),d=e(112),y=e(32),v=e(113),h=e(7),g=e(13),b=e(114),m=e(12),x=e(33),S=e(118),O=e(63),w=e(64).set,j=e(119),P=e(65),E=e(120),A=e(23),T=e(34),M=e(46),I=e(16),k=e(51),L=e(1)("species"),_="Promise",F=I.get,C=I.set,R=I.getterFor(_),N=l,D=f.TypeError,G=f.document,B=f.process,V=f.fetch,$=B&&B.versions,W=$&&$.v8||"",z=A.f,H=z,q="process"==m(B),U=!!(G&&G.createEvent&&f.dispatchEvent),Y="unhandledrejection",J=k(_,function(){var t=N.resolve(1),n=function n(){},e=(t.constructor={})[L]=function(t){t(n,n)};return!((q||"function"==typeof PromiseRejectionEvent)&&(!s||t["finally"])&&t.then(n)instanceof e&&0!==W.indexOf("6.6")&&-1===M.indexOf("Chrome/66"))}),K=J||!S(function(t){N.all(t)["catch"](function(){})}),Q=function Q(t){var n;return!(!h(t)||"function"!=typeof(n=t.then))&&n},X=function X(p,d,y){if(!d.notified){d.notified=!0;var v=d.reactions;j(function(){for(var t=d.value,n=1==d.state,e=0;v.length>e;){var r,o,i,u=v[e++],c=n?u.ok:u.fail,s=u.resolve,f=u.reject,a=u.domain;try{c?(n||(2===d.rejection&&et(p,d),d.rejection=1),!0===c?r=t:(a&&a.enter(),r=c(t),a&&(a.exit(),i=!0)),r===u.promise?f(D("Promise-chain cycle")):(o=Q(r))?o.call(r,s,f):s(r)):f(t)}catch(l){a&&!i&&a.exit(),f(l)}}d.reactions=[],d.notified=!1,y&&!d.rejection&&tt(p,d)})}},Z=function Z(t,n,e){var r,o;U?((r=G.createEvent("Event")).promise=n,r.reason=e,r.initEvent(t,!1,!0),f.dispatchEvent(r)):r={promise:n,reason:e},(o=f["on"+t])?o(r):t===Y&&E("Unhandled promise rejection",e)},tt=function tt(e,r){w.call(f,function(){var t,n=r.value;if(nt(r)&&(t=T(function(){q?B.emit("unhandledRejection",n,e):Z(Y,e,n)}),r.rejection=q||nt(r)?2:1,t.error))throw t.value})},nt=function nt(t){return 1!==t.rejection&&!t.parent},et=function et(t,n){w.call(f,function(){q?B.emit("rejectionHandled",t):Z("rejectionhandled",t,n.value)})},rt=function rt(n,e,r,o){return function(t){n(e,r,t,o)}},ot=function ot(t,n,e,r){n.done||(n.done=!0,r&&(n=r),n.value=e,n.state=2,X(t,n,!0))},it=function it(e,r,o,t){if(!r.done){r.done=!0,t&&(r=t);try{if(e===o)throw D("Promise can't be resolved itself");var i=Q(o);i?j(function(){var t={done:!1};try{i.call(o,rt(it,e,t,r),rt(ot,e,t,r))}catch(n){ot(e,t,n,r)}}):(r.value=o,r.state=1,X(e,r,!1))}catch(n){ot(e,{done:!1},n,r)}}};J&&(N=function(t){b(this,N,_),g(t),r.call(this);var n=F(this);try{t(rt(it,this,n),rt(ot,this,n))}catch(e){ot(this,n,e)}},(r=function(t){C(this,{type:_,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:undefined})}).prototype=d(N.prototype,{then:function(t,n){var e=R(this),r=z(O(this,N));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=q?B.domain:undefined,e.parent=!0,e.reactions.push(r),0!=e.state&&X(this,e,!1),r.promise},"catch":function(t){return this.then(undefined,t)}}),o=function o(){var t=new r,n=F(t);this.promise=t,this.resolve=rt(it,t,n),this.reject=rt(ot,t,n)},A.f=z=function z(t){return t===N||t===i?new o(t):H(t)},s||"function"!=typeof l||(u=l.prototype.then,p(l.prototype,"then",function(t,n){var e=this;return new N(function(t,n){u.call(e,t,n)}).then(t,n)},{unsafe:!0}),"function"==typeof V&&c({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return P(N,V.apply(f,arguments))}}))),c({global:!0,wrap:!0,forced:J},{Promise:N}),y(N,_,!1,!0),v(_),i=a[_],c({target:_,stat:!0,forced:J},{reject:function(t){var n=z(this);return n.reject.call(undefined,t),n.promise}}),c({target:_,stat:!0,forced:s||J},{resolve:function(t){return P(s&&this===i?N:this,t)}}),c({target:_,stat:!0,forced:K},{all:function(t){var c=this,n=z(c),s=n.resolve,f=n.reject,e=T(function(){var r=g(c.resolve),o=[],i=0,u=1;x(t,function(t){var n=i++,e=!1;o.push(undefined),u++,r.call(c,t).then(function(t){e||(e=!0,o[n]=t,--u||s(o))},f)}),--u||s(o)});return e.error&&f(e.value),n.promise},race:function(t){var e=this,r=z(e),o=r.reject,n=T(function(){var n=g(e.resolve);x(t,function(t){n.call(e,t).then(r.resolve,o)})});return n.error&&o(n.value),r.promise}})},function(t,n,e){"use strict";var o=e(10);t.exports=function(t,n,e){for(var r in n)o(t,r,n[r],e);return t}},function(t,n,e){"use strict";var r=e(17),o=e(9),i=e(1),u=e(4),c=i("species");t.exports=function(t){var n=r(t),e=o.f;u&&n&&!n[c]&&e(n,c,{configurable:!0,get:function(){return this}})}},function(t,n,e){"use strict";t.exports=function(t,n,e){if(!(t instanceof n))throw TypeError("Incorrect "+(e?e+" ":"")+"invocation");return t}},function(t,n,e){"use strict";var r=e(1),o=e(22),i=r("iterator"),u=Array.prototype;t.exports=function(t){return t!==undefined&&(o.Array===t||u[i]===t)}},function(t,n,e){"use strict";var r=e(57),o=e(22),i=e(1)("iterator");t.exports=function(t){if(t!=undefined)return t[i]||t["@@iterator"]||o[r(t)]}},function(t,n,e){"use strict";var u=e(3);t.exports=function(t,n,e,r){try{return r?n(u(e)[0],e[1]):n(e)}catch(i){var o=t["return"];throw o!==undefined&&u(o.call(t)),i}}},function(t,n,e){"use strict";var o=e(1)("iterator"),i=!1;try{var r=0,u={next:function(){return{done:!!r++}},"return":function(){i=!0}};u[o]=function(){return this},Array.from(u,function(){throw 2})}catch(c){}t.exports=function(t,n){if(!n&&!i)return!1;var e=!1;try{var r={};r[o]=function(){return{next:function(){return{done:e=!0}}}},t(r)}catch(c){}return e}},function(t,n,e){"use strict";var r,o,i,u,c,s,f,a,l=e(0),p=e(24).f,d=e(12),y=e(64).set,v=e(46),h=l.MutationObserver||l.WebKitMutationObserver,g=l.process,b=l.Promise,m="process"==d(g),x=p(l,"queueMicrotask"),S=x&&x.value;S||(r=function r(){var t,n;for(m&&(t=g.domain)&&t.exit();o;){n=o.fn,o=o.next;try{n()}catch(e){throw o?u():i=undefined,e}}i=undefined,t&&t.enter()},u=m?function u(){g.nextTick(r)}:h&&!/(iphone|ipod|ipad).*applewebkit/i.test(v)?(c=!0,s=document.createTextNode(""),new h(r).observe(s,{characterData:!0}),function u(){s.data=c=!c}):b&&b.resolve?(f=b.resolve(undefined),a=f.then,function u(){a.call(f,r)}):function u(){y.call(l,r)}),t.exports=S||function(t){var n={fn:t,next:undefined};i&&(i.next=n),o||(o=n,u()),i=n}},function(t,n,e){"use strict";var r=e(0);t.exports=function(t,n){var e=r.console;e&&e.error&&(1===arguments.length?e.error(t):e.error(t,n))}},function(t,n,e){"use strict";var r=e(2),o=e(15),i=e(62),u=e(17),c=e(63),s=e(65),f=e(10);r({target:"Promise",proto:!0,real:!0},{"finally":function(n){var e=c(this,u("Promise")),t="function"==typeof n;return this.then(t?function(t){return s(e,n()).then(function(){return t})}:n,t?function(t){return s(e,n()).then(function(){throw t})}:n)}}),o||"function"!=typeof i||i.prototype["finally"]||f(i.prototype,"finally",u("Promise").prototype["finally"])},function(t,n,e){"use strict";var r=e(2),o=e(4),i=e(45),u=e(61),c=e(20),s=e(9),f=e(18),a=e(33),l=e(6),p=e(3),d=e(16),y=d.set,v=d.getterFor("AggregateError"),h=function(t,n){var e=this;if(!(e instanceof h))return new h(t,n);u&&(e=u(new Error(n),i(e)));var r=[];return a(t,r.push,r),o?y(e,{errors:r,type:"AggregateError"}):e.errors=r,n!==undefined&&l(e,"message",String(n)),e};h.prototype=c(Error.prototype,{constructor:f(5,h),message:f(5,""),name:f(5,"AggregateError"),toString:f(5,function(){var t=p(this).name;t=t===undefined?"AggregateError":String(t);var n=this.message;return t+": "+(n=n===undefined?"":String(n))})}),o&&s.f(h.prototype,"errors",{get:function(){return v(this).errors},configurable:!0}),r({global:!0},{AggregateError:h})},function(t,n,e){"use strict";e(66)},function(t,n,e){"use strict";var r=e(2),o=e(23),i=e(34);r({target:"Promise",stat:!0},{"try":function(t){var n=o.f(this),e=i(t);return(e.error?n.reject:n.resolve)(e.value),n.promise}})},function(t,n,e){"use strict";var r=e(2),l=e(13),p=e(17),o=e(23),i=e(34),d=e(33),y="No one promise resolved";r({target:"Promise",stat:!0},{any:function(t){var s=this,n=o.f(s),f=n.resolve,a=n.reject,e=i(function(){var r=l(s.resolve),o=[],i=0,u=1,c=!1;d(t,function(t){var n=i++,e=!1;o.push(undefined),u++,r.call(s,t).then(function(t){e||c||(c=!0,f(t))},function(t){e||c||(e=!0,o[n]=t,--u||a(new(p("AggregateError"))(o,y)))})}),--u||a(new(p("AggregateError"))(o,y))});return e.error&&a(e.value),n.promise}})},function(t,n,e){"use strict";t.exports=e(127)},function(t,n,e){"use strict";e(128);var r=e(11);t.exports=r.Object.getOwnPropertySymbols},function(t,n,e){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(n,t){h(n);var e=b(t),r=O(e).concat(dt(e));return B(r,function(t){a&&!pt.call(e,t)||lt(n,t,e[t])}),n}function i(t,n){var e=b(t),r=m(n,!0);if(e!==U||!d(nt,r)||d(et,r)){var o=Q(e,r);return!o||!d(nt,r)||d(e,V)&&e[V][r]||(o.enumerable=!0),o}}function u(t){var n=Z(b(t)),e=[];return B(n,function(t){d(nt,t)||d(_,t)||e.push(t)}),e}var c=e(2),s=e(0),f=e(15),a=e(4),l=e(55),p=e(5),d=e(8),y=e(54),v=e(7),h=e(3),g=e(21),b=e(14),m=e(37),x=e(18),S=e(20),O=e(44),w=e(41),j=e(129),P=e(43),E=e(24),A=e(9),T=e(35),M=e(6),I=e(10),k=e(19),L=e(26),_=e(27),F=e(40),C=e(1),R=e(67),N=e(130),D=e(32),G=e(16),B=e(53).forEach,V=L("hidden"),$="Symbol",W="prototype",z=C("toPrimitive"),H=G.set,q=G.getterFor($),U=Object[W],Y=s.Symbol,J=s.JSON,K=J&&J.stringify,Q=E.f,X=A.f,Z=j.f,tt=T.f,nt=k("symbols"),et=k("op-symbols"),rt=k("string-to-symbol-registry"),ot=k("symbol-to-string-registry"),it=k("wks"),ut=s.QObject,ct=!ut||!ut[W]||!ut[W].findChild,st=a&&p(function(){return 7!=S(X({},"a",{get:function(){return X(this,"a",{value:7}).a}})).a})?function(t,n,e){var r=Q(U,n);r&&delete U[n],X(t,n,e),r&&t!==U&&X(U,n,r)}:X,ft=function ft(t,n){var e=nt[t]=S(Y[W]);return H(e,{type:$,tag:t,description:n}),a||(e.description=n),e},at=l&&"symbol"==r(Y.iterator)?function(t){return"symbol"==r(t)}:function(t){return Object(t)instanceof Y},lt=function(t,n,e){t===U&<(et,n,e),h(t);var r=m(n,!0);return h(e),d(nt,r)?(e.enumerable?(d(t,V)&&t[V][r]&&(t[V][r]=!1),e=S(e,{enumerable:x(0,!1)})):(d(t,V)||X(t,V,x(1,{})),t[V][r]=!0),st(t,r,e)):X(t,r,e)},pt=function(t){var n=m(t,!0),e=tt.call(this,n);return!(this===U&&d(nt,n)&&!d(et,n))&&(!(e||!d(this,n)||!d(nt,n)||d(this,V)&&this[V][n])||e)},dt=function(t){var n=t===U,e=Z(n?et:b(t)),r=[];return B(e,function(t){!d(nt,t)||n&&!d(U,t)||r.push(nt[t])}),r};l||(I((Y=function(){if(this instanceof Y)throw TypeError("Symbol is not a constructor");var t=arguments.length&&arguments[0]!==undefined?String(arguments[0]):undefined,n=F(t),e=function e(t){this===U&&e.call(et,t),d(this,V)&&d(this[V],n)&&(this[V][n]=!1),st(this,n,x(1,t))};return a&&ct&&st(U,n,{configurable:!0,set:e}),ft(n,t)})[W],"toString",function(){return q(this).tag}),T.f=pt,A.f=lt,E.f=i,w.f=j.f=u,P.f=dt,a&&(X(Y[W],"description",{configurable:!0,get:function(){return q(this).description}}),f||I(U,"propertyIsEnumerable",pt,{unsafe:!0})),R.f=function(t){return ft(C(t),t)}),c({global:!0,wrap:!0,forced:!l,sham:!l},{Symbol:Y}),B(O(it),function(t){N(t)}),c({target:$,stat:!0,forced:!l},{"for":function(t){var n=String(t);if(d(rt,n))return rt[n];var e=Y(n);return rt[n]=e,ot[e]=n,e},keyFor:function(t){if(!at(t))throw TypeError(t+" is not a symbol");if(d(ot,t))return ot[t]},useSetter:function(){ct=!0},useSimple:function(){ct=!1}}),c({target:"Object",stat:!0,forced:!l,sham:!a},{create:function(t,n){return n===undefined?S(t):o(S(t),n)},defineProperty:lt,defineProperties:o,getOwnPropertyDescriptor:i}),c({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:u,getOwnPropertySymbols:dt}),c({target:"Object",stat:!0,forced:p(function(){P.f(1)})},{getOwnPropertySymbols:function(t){return P.f(g(t))}}),J&&c({target:"JSON",stat:!0,forced:!l||p(function(){var t=Y();return"[null]"!=K([t])||"{}"!=K({a:t})||"{}"!=K(Object(t))})},{stringify:function(t){for(var e,r,n=[t],o=1;o]*>)/g,v=/\$([$&'`]|\d\d?)/g,I=function I(t){return t===undefined?t:String(t)};r("replace",2,function(o,x,S){return[function(t,n){var e=i(this),r=t==undefined?undefined:t[o];return r!==undefined?r.call(t,e,n):x.call(String(e),t,n)},function(t,n){var e=S(x,t,this,n);if(e.done)return e.value;var r=w(t),o=String(this),i="function"==typeof n;i||(n=String(n));var u=r.global;if(u){var c=r.unicode;r.lastIndex=0}for(var s=[];;){var f=A(r,o);if(null===f)break;if(s.push(f),!u)break;""===String(f[0])&&(r.lastIndex=E(o,j(r.lastIndex),c))}for(var a="",l=0,p=0;p")}),b=!d(function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]});t.exports=function(e,t,n,r){var o=y(e),i=!d(function(){var t={};return t[o]=function(){return 7},7!=""[e](t)}),u=i&&!d(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[h]=function(){return n}),n[o](""),!t});if(!i||!u||"replace"===e&&!g||"split"===e&&!b){var c=/./[o],s=n(o,""[e],function(t,n,e,r,o){return n.exec===v?i&&!o?{done:!0,value:c.call(n,e,r)}:{done:!0,value:t.call(e,n,r)}:{done:!1}}),f=s[0],a=s[1];p(String.prototype,e,f),p(RegExp.prototype,o,2==t?function(t,n){return a.call(t,this,n)}:function(t){return a.call(t,this)}),r&&l(RegExp.prototype[o],"sham",!0)}}},function(t,n,e){"use strict";var r=e(3);t.exports=function(){var t=r(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},function(t,n,e){"use strict";var r=e(58).charAt;t.exports=function(t,n,e){return n+(e?r(t,n).length:1)}},function(t,n,e){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=e(12),u=e(68);t.exports=function(t,n){var e=t.exec;if("function"==typeof e){var r=e.call(t,n);if("object"!==o(r))throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==i(t))throw TypeError("RegExp#exec called on incompatible receiver");return u.call(t,n)}},function(t,n,e){"use strict";var r=function c(t){if(t&&t.__esModule)return t;var n=u();if(n&&n.has(t))return n.get(t);var e={};if(null!=t){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var i=r?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(e,o,i):e[o]=t[o]}}e["default"]=t,n&&n.set(t,e);return e}(e(139));function u(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return u=function(){return t},t}BI=BI.extend(BI,{Decorators:r})},function(t,n,e){"use strict";function i(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function c(t,n){t.prototype=Object.create(n.prototype),function u(t,n){for(var e=Object.getOwnPropertyNames(n),r=0;r>>0;if(0===len)return-1;var n=0|fromIndex;if(n>=len)return-1;for(k=Math.max(n>=0?n:len-Math.abs(n),0);k>>0;if(0===len)return-1;for(n=len-1,arguments.length>1&&(n=Number(arguments[1]),n!=n?n=0:0!=n&&n!=1/0&&n!=-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),k=n>=0?Math.min(n,len-1):len-Math.abs(n);k>=0;k--)if(k in t&&t[k]===searchElement)return k;return-1}),_global.console=_global.console||function(){var c={};return c.log=c.warn=c.debug=c.info=c.error=c.time=c.dir=c.profile=c.clear=c.exception=c.trace=c.assert=function(){},c}(),_global.localStorage||(_global.localStorage={items:{},setItem:function(k,v){BI.Cache.addCookie(k,v)},getItem:function(k){return BI.Cache.getCookie(k)},removeItem:function(k){BI.Cache.deleteCookie(k)},key:function(){},clear:function(){this.items={}}}),Object.keys||(Object.keys=function(o){if(o!==Object(o))throw new TypeError("Object.keys called on a non-object");var falsy,skipArray={__ob__:falsy,$accessors:falsy,$vbthis:falsy,$vbsetter:falsy},k=[],p;for(p in o)p in skipArray||Object.prototype.hasOwnProperty.call(o,p)&&k.push(p);return k}),Array.isArray||(Array.isArray=function(arg){return"[object Array]"===Object.prototype.toString.call(arg)}),"function"!=typeof Object.getPrototypeOf&&(Object.getPrototypeOf="".__proto__===String.prototype?function(object){return object.__proto__}:function(object){return object.constructor.prototype}),Date.now||(Date.now=function(){return(new Date).valueOf()}),"undefined"!=typeof Set&&Set.toString().match(/native code/)||(Set=function(){this.set={}},Set.prototype.has=function(key){return void 0!==this.set[key]},Set.prototype.add=function(key){this.set[key]=1},Set.prototype.clear=function(){this.set={}}),!function(window){var ua=window.navigator.userAgent.toLowerCase(),reg=/msie/;if(reg.test(ua)){var _sort=Array.prototype.sort;Array.prototype.sort=function(fn){if(fn&&"function"==typeof fn){if(this.length<2)return this;for(var i=0,j=i+1,l=this.length,tmp,r=!1,t=0;i0,r===!0&&(tmp=this[i],this[i]=this[j],this[j]=tmp);return this}return _sort.call(this)}}}(window);var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,null==_global.BI&&(_global.BI={prepares:[]}),null==_global.BI.prepares&&(_global.BI.prepares=[]),function(){function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)}function arrayAggregator(array,setter,iteratee,accumulator){for(var index=-1,length=null==array?0:array.length;++index-1}function arrayIncludesWith(array,value,comparator){for(var index=-1,length=null==array?0:array.length;++index-1;);return index}function charsEndIndex(strSymbols,chrSymbols){for(var index=strSymbols.length;index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1;);return index}function countHolders(array,placeholder){for(var length=array.length,result=0;length--;)array[length]===placeholder&&++result;return result}function getValue(object,key){return null==object?undefined:object[key]}function hasUnicode(string){return reHasUnicode.test(string)}function iteratorToArray(iterator){for(var data,result=[];!(data=iterator.next()).done;)result.push(data.value);return result}function mapToArray(map){var index=-1,result=Array(map.size);return map.forEach(function(value,key){result[++index]=[key,value]}),result}function overArg(func,transform){return function(arg){return func(transform(arg))}}function replaceHolders(array,placeholder){for(var index=-1,length=array.length,resIndex=0,result=[];++index-1}function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);return index<0?(++this.size,data.push([key,value])):data[index][1]=value,this}function MapCache(entries){var index=-1,length=null==entries?0:entries.length;for(this.clear();++index=lower?number:lower)),number}function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer&&(result=object?customizer(value,key,object,stack):customizer(value)),result!==undefined)return result;if(!isObject(value))return value;var isArr=isArray(value);if(isArr){if(result=initCloneArray(value),!isDeep)return copyArray(value,result)}else{var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value))return cloneBuffer(value,isDeep);if(tag==objectTag||tag==argsTag||isFunc&&!object){if(result=isFlat||isFunc?{}:initCloneObject(value),!isDeep)return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):copySymbols(value,baseAssign(result,value))}else{if(!cloneableTags[tag])return object?value:{};result=initCloneByTag(value,tag,isDeep)}}stack||(stack=new Stack);var stacked=stack.get(value);if(stacked)return stacked;if(stack.set(value,result),isSet(value))return value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack))}),result;if(isMap(value))return value.forEach(function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack))}),result;var keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys,props=isArr?undefined:keysFunc(value);return arrayEach(props||value,function(subValue,key){props&&(key=subValue,subValue=value[key]),assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack))}),result}function baseDelay(func,wait,args){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return setTimeout(function(){func.apply(undefined,args)},wait)}function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=!0,length=array.length,result=[],valuesLength=values.length;if(!length)return result;iteratee&&(values=arrayMap(values,baseUnary(iteratee))),comparator?(includes=arrayIncludesWith,isCommon=!1):values.length>=LARGE_ARRAY_SIZE&&(includes=cacheHas,isCommon=!1,values=new SetCache(values));outer:for(;++index0&&predicate(value)?depth>1?baseFlatten(value,depth-1,predicate,isStrict,result):arrayPush(result,value):isStrict||(result[result.length]=value)}return result}function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys)}function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys)}function baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key])})}function baseGet(object,path){path=castPath(path,object);for(var index=0,length=path.length;null!=object&&indexother}function baseHas(object,key){return null!=object&&hasOwnProperty.call(object,key)}function baseHasIn(object,key){return null!=object&&key in Object(object)}function baseIntersection(arrays,iteratee,comparator){for(var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=1/0,result=[];othIndex--;){var array=arrays[othIndex];othIndex&&iteratee&&(array=arrayMap(array,baseUnary(iteratee))),maxLength=nativeMin(array.length,maxLength),caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined}array=arrays[0];var index=-1,seen=caches[0];outer:for(;++indexlength?0:length+start),end=end>length?length:end,end<0&&(end+=length),length=start>end?0:end-start>>>0,start>>>=0;for(var result=Array(length);++index=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set)return setToArray(set);isCommon=!1,includes=cacheHas,seen=new SetCache}else seen=iteratee?[]:result;outer:for(;++index=length?array:baseSlice(array,start,end)}function cloneBuffer(buffer,isDeep){if(isDeep)return buffer.slice();var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);return buffer.copy(result),result}function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);return new Uint8Array(result).set(new Uint8Array(arrayBuffer)), +result}function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength)}function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));return result.lastIndex=regexp.lastIndex,result}function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{}}function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length)}function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined,valIsNull=null===value,valIsReflexive=value===value,valIsSymbol=isSymbol(value),othIsDefined=other!==undefined,othIsNull=null===other,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive)return 1;if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value=ordersLength)return result;var order=orders[index];return result*("desc"==order?-1:1)}}return object.index-other.index}function composeArgs(args,partials,holders,isCurried){for(var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;++leftIndex1?sources[length-1]:undefined,guard=length>2?sources[2]:undefined;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):undefined,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?undefined:customizer,length=1),object=Object(object);++index-1?iterable[iteratee?collection[index]:index]:undefined}}function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){function wrapper(){for(var length=arguments.length,args=Array(length),index=length;index--;)args[index]=arguments[index];if(isCurried)var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);if(partials&&(args=composeArgs(args,partials,holders,isCurried)),partialsRight&&(args=composeArgsRight(args,partialsRight,holdersRight,isCurried)),length-=holdersCount,isCurried&&length1&&args.reverse(),isAry&&aryarrLength))return!1;var stacked=stack.get(array);if(stacked&&stack.get(other))return stacked==other;var index=-1,result=!0,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache:undefined;for(stack.set(array,other),stack.set(other,array);++index1?"& ":"")+details[lastIndex],details=details.join(length>2?", ":" "),source.replace(reWrapComment,"{\n/* [wrapped with "+details+"] */\n")}function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol])}function isIndex(value,length){var type=typeof value;return length=null==length?MAX_SAFE_INTEGER:length,!!length&&("number"==type||"symbol"!=type&&reIsUint.test(value))&&value>-1&&value%1==0&&value0){if(++count>=HOT_COUNT)return arguments[0]}else count=0;return func.apply(undefined,arguments)}}function toKey(value){if("string"==typeof value||isSymbol(value))return value;var result=value+"";return"0"==result&&1/value==-INFINITY?"-0":result}function toSource(func){if(null!=func){try{return funcToString.call(func)}catch(e){}try{return func+""}catch(e){}}return""}function updateWrapDetails(details,bitmask){return arrayEach(wrapFlags,function(pair){var value="_."+pair[0];bitmask&pair[1]&&!arrayIncludes(details,value)&&details.push(value)}),details.sort()}function wrapperClone(wrapper){if(wrapper instanceof LazyWrapper)return wrapper.clone();var result=new LodashWrapper(wrapper.__wrapped__,wrapper.__chain__);return result.__actions__=copyArray(wrapper.__actions__),result.__index__=wrapper.__index__,result.__values__=wrapper.__values__,result}function compact(array){for(var index=-1,length=null==array?0:array.length,resIndex=0,result=[];++index=this.__values__.length,value=done?undefined:this.__values__[this.__index__++];return{done:done,value:value}}function wrapperToIterator(){return this}function wrapperPlant(value){for(var result,parent=this;parent instanceof baseLodash;){var clone=wrapperClone(parent);clone.__index__=0,clone.__values__=undefined,result?previous.__wrapped__=clone:result=clone;var previous=clone;parent=parent.__wrapped__}return previous.__wrapped__=value,result}function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;return this.__actions__.length&&(wrapped=new LazyWrapper(this)),wrapped=wrapped.reverse(),wrapped.__actions__.push({func:thru,args:[reverse],thisArg:undefined}),new LodashWrapper(wrapped,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,baseIteratee(predicate,3))}function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,baseIteratee(iteratee,3))}function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,baseIteratee(iteratee,3))}function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,baseIteratee(iteratee,4),accumulator,initAccum,baseEach)}function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(baseIteratee(predicate,3)))}function size(collection){if(null==collection)return 0;if(isArrayLike(collection))return isString(collection)?stringSize(collection):collection.length;var tag=getTag(collection);return tag==mapTag||tag==setTag?collection.size:baseKeys(collection).length}function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;return guard&&isIterateeCall(collection,predicate,guard)&&(predicate=undefined),func(collection,baseIteratee(predicate,3))}function before(n,func){var result;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return n=toInteger(n),function(){return--n>0&&(result=func.apply(this,arguments)),n<=1&&(func=undefined),result}}function debounce(func,wait,options){function invokeFunc(time){var args=lastArgs,thisArg=lastThis;return lastArgs=lastThis=undefined,lastInvokeTime=time,result=func.apply(thisArg,args)}function leadingEdge(time){return lastInvokeTime=time,timerId=setTimeout(timerExpired,wait),leading?invokeFunc(time):result}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;return lastCallTime===undefined||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait}function timerExpired(){var time=now();return shouldInvoke(time)?trailingEdge(time):void(timerId=setTimeout(timerExpired,remainingWait(time)))}function trailingEdge(time){return timerId=undefined,trailing&&lastArgs?invokeFunc(time):(lastArgs=lastThis=undefined,result)}function cancel(){timerId!==undefined&&clearTimeout(timerId),lastInvokeTime=0,lastArgs=lastCallTime=lastThis=timerId=undefined}function flush(){return timerId===undefined?result:trailingEdge(now())}function debounced(){var time=now(),isInvoking=shouldInvoke(time);if(lastArgs=arguments,lastThis=this,lastCallTime=time,isInvoking){if(timerId===undefined)return leadingEdge(lastCallTime);if(maxing)return timerId=setTimeout(timerExpired,wait),invokeFunc(lastCallTime)}return timerId===undefined&&(timerId=setTimeout(timerExpired,wait)),result}var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=!1,maxing=!1,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return wait=toNumber(wait)||0,isObject(options)&&(leading=!!options.leading,maxing="maxWait"in options,maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait,trailing="trailing"in options?!!options.trailing:trailing),debounced.cancel=cancel,debounced.flush=flush,debounced}function memoize(func,resolver){if("function"!=typeof func||null!=resolver&&"function"!=typeof resolver)throw new TypeError(FUNC_ERROR_TEXT);var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key))return cache.get(key);var result=func.apply(this,args);return memoized.cache=cache.set(key,result)||cache,result};return memoized.cache=new(memoize.Cache||MapCache), +memoized}function negate(predicate){if("function"!=typeof predicate)throw new TypeError(FUNC_ERROR_TEXT);return function(){var args=arguments;switch(args.length){case 0:return!predicate.call(this);case 1:return!predicate.call(this,args[0]);case 2:return!predicate.call(this,args[0],args[1]);case 3:return!predicate.call(this,args[0],args[1],args[2])}return!predicate.apply(this,args)}}function once(func){return before(2,func)}function rest(func,start){if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return start=start===undefined?start:toInteger(start),baseRest(func,start)}function throttle(func,wait,options){var leading=!0,trailing=!0;if("function"!=typeof func)throw new TypeError(FUNC_ERROR_TEXT);return isObject(options)&&(leading="leading"in options?!!options.leading:leading,trailing="trailing"in options?!!options.trailing:trailing),debounce(func,wait,{leading:leading,maxWait:wait,trailing:trailing})}function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG)}function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG)}function eq(value,other){return value===other||value!==value&&other!==other}function isArrayLike(value){return null!=value&&isLength(value.length)&&!isFunction(value)}function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value)}function isBoolean(value){return value===!0||value===!1||isObjectLike(value)&&baseGetTag(value)==boolTag}function isEmpty(value){if(null==value)return!0;if(isArrayLike(value)&&(isArray(value)||"string"==typeof value||"function"==typeof value.splice||isBuffer(value)||isTypedArray(value)||isArguments(value)))return!value.length;var tag=getTag(value);if(tag==mapTag||tag==setTag)return!value.size;if(isPrototype(value))return!baseKeys(value).length;for(var key in value)if(hasOwnProperty.call(value,key))return!1;return!0}function isEqual(value,other){return baseIsEqual(value,other)}function isFinite(value){return"number"==typeof value&&nativeIsFinite(value)}function isFunction(value){if(!isObject(value))return!1;var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag}function isLength(value){return"number"==typeof value&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER}function isObject(value){var type=typeof value;return null!=value&&("object"==type||"function"==type)}function isObjectLike(value){return null!=value&&"object"==typeof value}function isNaN(value){return isNumber(value)&&value!=+value}function isNull(value){return null===value}function isNumber(value){return"number"==typeof value||isObjectLike(value)&&baseGetTag(value)==numberTag}function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag)return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString}function isString(value){return"string"==typeof value||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag}function isSymbol(value){return"symbol"==typeof value||isObjectLike(value)&&baseGetTag(value)==symbolTag}function isUndefined(value){return value===undefined}function toArray(value){if(!value)return[];if(isArrayLike(value))return isString(value)?stringToArray(value):copyArray(value);if(symIterator&&value[symIterator])return iteratorToArray(value[symIterator]());var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value)}function toFinite(value){if(!value)return 0===value?value:0;if(value=toNumber(value),value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER}return value===value?value:0}function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0}function toNumber(value){if("number"==typeof value)return value;if(isSymbol(value))return NAN;if(isObject(value)){var other="function"==typeof value.valueOf?value.valueOf():value;value=isObject(other)?other+"":other}if("string"!=typeof value)return 0===value?value:+value;value=value.replace(reTrim,"");var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value}function toPlainObject(value){return copyObject(value,keysIn(value))}function toString(value){return null==value?"":baseToString(value)}function create(prototype,properties){var result=baseCreate(prototype);return null==properties?result:baseAssign(result,properties)}function findKey(object,predicate){return baseFindKey(object,baseIteratee(predicate,3),baseForOwn)}function findLastKey(object,predicate){return baseFindKey(object,baseIteratee(predicate,3),baseForOwnRight)}function get(object,path,defaultValue){var result=null==object?undefined:baseGet(object,path);return result===undefined?defaultValue:result}function has(object,path){return null!=object&&hasPath(object,path,baseHas)}function hasIn(object,path){return null!=object&&hasPath(object,path,baseHasIn)}function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object)}function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,!0):baseKeysIn(object)}function omitBy(object,predicate){return pickBy(object,negate(baseIteratee(predicate)))}function pickBy(object,predicate){if(null==object)return{};var props=arrayMap(getAllKeysIn(object),function(prop){return[prop]});return predicate=baseIteratee(predicate),basePickBy(object,props,function(value,path){return predicate(value,path[0])})}function result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;for(length||(length=1,object=undefined);++indexupper){var temp=lower;lower=upper,upper=temp}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat("1e-"+((rand+"").length-1))),upper)}return baseRandom(lower,upper)}function escape(string){return string=toString(string),string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string}function trim(string,chars,guard){if(string=toString(string),string&&(guard||chars===undefined))return string.replace(reTrim,"");if(!string||!(chars=baseToString(chars)))return string;var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join("")}function constant(value){return function(){return value}}function identity(value){return value}function iteratee(func){return baseIteratee("function"==typeof func?func:baseClone(func,CLONE_DEEP_FLAG))}function matches(source){return baseMatches(baseClone(source,CLONE_DEEP_FLAG))}function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);null!=options||isObject(source)&&(methodNames.length||!props.length)||(options=source,source=object,object=this,methodNames=baseFunctions(source,keys(source)));var chain=!(isObject(options)&&"chain"in options&&!options.chain),isFunc=isFunction(object);return arrayEach(methodNames,function(methodName){var func=source[methodName];object[methodName]=func,isFunc&&(object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);return actions.push({func:func,args:arguments,thisArg:object}),result.__chain__=chainAll,result}return func.apply(object,arrayPush([this.value()],arguments))})}),object}function noConflict(){return root._===this&&(root._=oldDash),this}function noop(){}function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path)}function stubArray(){return[]}function stubFalse(){return!1}function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id}function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined}function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined}var undefined,VERSION="4.17.5",LARGE_ARRAY_SIZE=200,FUNC_ERROR_TEXT="Expected a function",HASH_UNDEFINED="__lodash_hash_undefined__",MAX_MEMOIZE_SIZE=500,PLACEHOLDER="__lodash_placeholder__",CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4,COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2,WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512,HOT_COUNT=800,HOT_SPAN=16,LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3,INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e308,NAN=NaN,MAX_ARRAY_LENGTH=4294967295,wrapFlags=[["ary",WRAP_ARY_FLAG],["bind",WRAP_BIND_FLAG],["bindKey",WRAP_BIND_KEY_FLAG],["curry",WRAP_CURRY_FLAG],["curryRight",WRAP_CURRY_RIGHT_FLAG],["flip",WRAP_FLIP_FLAG],["partial",WRAP_PARTIAL_FLAG],["partialRight",WRAP_PARTIAL_RIGHT_FLAG],["rearg",WRAP_REARG_FLAG]],argsTag="[object Arguments]",arrayTag="[object Array]",asyncTag="[object AsyncFunction]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",genTag="[object GeneratorFunction]",mapTag="[object Map]",numberTag="[object Number]",nullTag="[object Null]",objectTag="[object Object]",promiseTag="[object Promise]",proxyTag="[object Proxy]",regexpTag="[object RegExp]",setTag="[object Set]",stringTag="[object String]",symbolTag="[object Symbol]",undefinedTag="[object Undefined]",weakMapTag="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",reUnescapedHtml=/[&<>"']/g,reHasUnescapedHtml=RegExp(reUnescapedHtml.source),reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reTrim=/^\s+|\s+$/g,reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /,reEscapeChar=/\\(\\)?/g,reFlags=/\w*$/,reIsBadHex=/^[-+]0x[0-9a-f]+$/i,reIsBinary=/^0b[01]+$/i,reIsHostCtor=/^\[object .+?Constructor\]$/,reIsOctal=/^0o[0-7]+$/i,reIsUint=/^(?:0|[1-9]\d*)$/,rsAstralRange="\\ud800-\\udfff",rsComboMarksRange="\\u0300-\\u036f",reComboHalfMarksRange="\\ufe20-\\ufe2f",rsComboSymbolsRange="\\u20d0-\\u20ff",rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsVarRange="\\ufe0e\\ufe0f",rsAstral="["+rsAstralRange+"]",rsCombo="["+rsComboRange+"]",rsFitz="\\ud83c[\\udffb-\\udfff]",rsModifier="(?:"+rsCombo+"|"+rsFitz+")",rsNonAstral="[^"+rsAstralRange+"]",rsRegional="(?:\\ud83c[\\udde6-\\uddff]){2}",rsSurrPair="[\\ud800-\\udbff][\\udc00-\\udfff]",rsZWJ="\\u200d",reOptMod=rsModifier+"?",rsOptVar="["+rsVarRange+"]?",rsOptJoin="(?:"+rsZWJ+"(?:"+[rsNonAstral,rsRegional,rsSurrPair].join("|")+")"+rsOptVar+reOptMod+")*",rsSeq=rsOptVar+reOptMod+rsOptJoin,rsSymbol="(?:"+[rsNonAstral+rsCombo+"?",rsCombo,rsRegional,rsSurrPair,rsAstral].join("|")+")",reUnicode=RegExp(rsFitz+"(?="+rsFitz+")|"+rsSymbol+rsSeq,"g"),reHasUnicode=RegExp("["+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+"]"),typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=!1;var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=!0,cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=!1;var htmlEscapes={"&":"&","<":"<",">":">",'"':""","'":"'"},freeParseFloat=parseFloat,freeParseInt=parseInt,freeGlobal="object"==typeof global&&global&&global.Object===Object&&global,freeSelf="object"==typeof self&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),freeExports="object"==typeof exports&&exports&&!exports.nodeType&&exports,freeModule=freeExports&&"object"==typeof module&&module&&!module.nodeType&&module,moduleExports=freeModule&&freeModule.exports===freeExports,freeProcess=moduleExports&&freeGlobal.process,nodeUtil=function(){try{return freeProcess&&freeProcess.binding&&freeProcess.binding("util")}catch(e){}}(),nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,asciiSize=baseProperty("length"),escapeHtmlChar=basePropertyOf(htmlEscapes),arrayProto=Array.prototype,funcProto=Function.prototype,objectProto=Object.prototype,coreJsData=root["__core-js_shared__"],funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,idCounter=0,maskSrcKey=function(){var uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||"");return uid?"Symbol(src)_1."+uid:""}(),nativeObjectToString=objectProto.toString,objectCtorString=funcToString.call(Object),oldDash=root._,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Buffer=moduleExports?root.Buffer:undefined,Symbol=root.Symbol,Uint8Array=root.Uint8Array,allocUnsafe=Buffer?Buffer.allocUnsafe:undefined,getPrototype=overArg(Object.getPrototypeOf,Object),objectCreate=Object.create,propertyIsEnumerable=objectProto.propertyIsEnumerable,splice=arrayProto.splice,spreadableSymbol=Symbol?Symbol.isConcatSpreadable:undefined,symIterator=Symbol?Symbol.iterator:undefined,symToStringTag=Symbol?Symbol.toStringTag:undefined,defineProperty=function(){try{var func=getNative(Object,"defineProperty");return func({},"",{}),func}catch(e){}}(),nativeCeil=Math.ceil,nativeFloor=Math.floor,nativeGetSymbols=Object.getOwnPropertySymbols,nativeIsBuffer=Buffer?Buffer.isBuffer:undefined,nativeIsFinite=root.isFinite,nativeKeys=overArg(Object.keys,Object),nativeMax=Math.max,nativeMin=Math.min,nativeNow=Date.now,nativeRandom=Math.random,nativeReverse=arrayProto.reverse,DataView=getNative(root,"DataView"),Map=getNative(root,"Map"),Promise=getNative(root,"Promise"),Set=getNative(root,"Set"),WeakMap=getNative(root,"WeakMap"),nativeCreate=getNative(Object,"create"),metaMap=WeakMap&&new WeakMap,realNames={},dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),symbolProto=Symbol?Symbol.prototype:undefined,symbolValueOf=symbolProto?symbolProto.valueOf:undefined,symbolToString=symbolProto?symbolProto.toString:undefined,baseCreate=function(){function object(){}return function(proto){if(!isObject(proto))return{};if(objectCreate)return objectCreate(proto);object.prototype=proto;var result=new object;return object.prototype=undefined,result}}();lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=baseCreate(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=baseCreate(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=hashClear,Hash.prototype["delete"]=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet,ListCache.prototype.clear=listCacheClear,ListCache.prototype["delete"]=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet,MapCache.prototype.clear=mapCacheClear,MapCache.prototype["delete"]=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet,SetCache.prototype.add=SetCache.prototype.push=setCacheAdd,SetCache.prototype.has=setCacheHas,Stack.prototype.clear=stackClear,Stack.prototype["delete"]=stackDelete,Stack.prototype.get=stackGet,Stack.prototype.has=stackHas,Stack.prototype.set=stackSet;var baseEach=createBaseEach(baseForOwn),baseFor=createBaseFor(),baseForRight=createBaseFor(!0),baseSetData=metaMap?function(func,data){return metaMap.set(func,data),func}:identity,baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity,createSet=Set&&1/setToArray(new Set([,-0]))[1]==INFINITY?function(values){return new Set(values)}:noop,getData=metaMap?function(func){return metaMap.get(func)}:noop,getSymbols=nativeGetSymbols?function(object){return null==object?[]:(object=Object(object),arrayFilter(nativeGetSymbols(object),function(symbol){return propertyIsEnumerable.call(object,symbol)}))}:stubArray,getSymbolsIn=nativeGetSymbols?function(object){for(var result=[];object;)arrayPush(result,getSymbols(object)),object=getPrototype(object);return result}:stubArray,getTag=baseGetTag;(DataView&&getTag(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag(new Map)!=mapTag||Promise&&getTag(Promise.resolve())!=promiseTag||Set&&getTag(new Set)!=setTag||WeakMap&&getTag(new WeakMap)!=weakMapTag)&&(getTag=function(value){var result=baseGetTag(value),Ctor=result==objectTag?value.constructor:undefined,ctorString=Ctor?toSource(Ctor):"";if(ctorString)switch(ctorString){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return result});var setData=shortOut(baseSetData),setToString=shortOut(baseSetToString),stringToPath=memoizeCapped(function(string){var result=[];return 46===string.charCodeAt(0)&&result.push(""),string.replace(rePropName,function(match,number,quote,subString){result.push(quote?subString.replace(reEscapeChar,"$1"):number||match)}),result}),difference=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,!0)):[]}),intersection=baseRest(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[]}),union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,!0))}),without=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[]}),zip=baseRest(unzip),wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths)};return!(length>1||this.__actions__.length)&&value instanceof LazyWrapper&&isIndex(start)?(value=value.slice(start,+start+(length?1:0)),value.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(value,this.__chain__).thru(function(array){return length&&!array.length&&array.push(undefined),array})):this.thru(interceptor)}),countBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?++result[key]:baseAssignValue(result,key,1)}),find=createFind(findIndex),groupBy=createAggregator(function(result,value,key){hasOwnProperty.call(result,key)?result[key].push(value):baseAssignValue(result,key,[value])}),sortBy=baseRest(function(collection,iteratees){if(null==collection)return[];var length=iteratees.length;return length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])?iteratees=[]:length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])&&(iteratees=[iteratees[0]]),baseOrderBy(collection,baseFlatten(iteratees,1),[])}),now=function(){return root.Date.now()},bind=baseRest(function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG}return createWrap(func,bitmask,thisArg,partials,holders)}),defer=baseRest(function(func,args){return baseDelay(func,1,args)}),delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args)});memoize.Cache=MapCache;var isArguments=baseIsArguments(function(){return arguments}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,"callee")&&!propertyIsEnumerable.call(value,"callee")},isArray=Array.isArray,isBuffer=nativeIsBuffer||stubFalse,isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate,isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap,isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp,isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet,isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object)}),defaults=baseRest(function(object,sources){object=Object(object);var index=-1,length=sources.length,guard=length>2?sources[2]:undefined;for(guard&&isIterateeCall(sources[0],sources[1],guard)&&(length=1);++index1),path}),copyObject(object,getAllKeysIn(object),result),isDeep&&(result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone));for(var length=paths.length;length--;)baseUnset(result,paths[length]);return result}),pick=flatRest(function(object,paths){return null==object?{}:basePick(object,paths)}),range=createRange();lodash.assignIn=assignIn,lodash.before=before,lodash.bind=bind,lodash.chain=chain,lodash.compact=compact,lodash.concat=concat,lodash.countBy=countBy,lodash.create=create,lodash.debounce=debounce,lodash.defaults=defaults,lodash.defaultsDeep=defaultsDeep,lodash.defer=defer,lodash.delay=delay,lodash.difference=difference,lodash.drop=drop,lodash.filter=filter,lodash.flatten=flatten,lodash.flattenDeep=flattenDeep,lodash.groupBy=groupBy,lodash.initial=initial,lodash.intersection=intersection,lodash.invert=invert,lodash.invertBy=invertBy,lodash.iteratee=iteratee,lodash.keys=keys,lodash.map=map,lodash.matches=matches,lodash.merge=merge,lodash.mixin=mixin,lodash.negate=negate,lodash.omit=omit,lodash.omitBy=omitBy,lodash.once=once,lodash.pick=pick,lodash.range=range,lodash.reject=reject,lodash.rest=rest,lodash.slice=slice,lodash.sortBy=sortBy,lodash.take=take,lodash.takeRight=takeRight,lodash.tap=tap,lodash.throttle=throttle,lodash.thru=thru,lodash.toArray=toArray,lodash.union=union,lodash.uniq=uniq,lodash.uniqBy=uniqBy,lodash.unzip=unzip,lodash.values=values,lodash.without=without,lodash.zip=zip,lodash.zipObject=zipObject,lodash.extend=assignIn,mixin(lodash,lodash),lodash.clamp=clamp,lodash.clone=clone,lodash.cloneDeep=cloneDeep,lodash.escape=escape,lodash.every=every,lodash.find=find,lodash.findIndex=findIndex,lodash.findKey=findKey,lodash.findLastIndex=findLastIndex,lodash.findLastKey=findLastKey,lodash.forEach=forEach,lodash.get=get,lodash.has=has,lodash.head=head,lodash.identity=identity,lodash.indexOf=indexOf,lodash.isArguments=isArguments,lodash.isArray=isArray,lodash.isArrayLike=isArrayLike,lodash.isBoolean=isBoolean,lodash.isDate=isDate,lodash.isEmpty=isEmpty,lodash.isEqual=isEqual,lodash.isFinite=isFinite,lodash.isFunction=isFunction,lodash.isNaN=isNaN,lodash.isNull=isNull,lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isPlainObject=isPlainObject,lodash.isRegExp=isRegExp,lodash.isString=isString,lodash.isUndefined=isUndefined,lodash.last=last,lodash.max=max,lodash.min=min,lodash.noConflict=noConflict,lodash.noop=noop,lodash.random=random,lodash.reduce=reduce,lodash.result=result,lodash.size=size,lodash.some=some,lodash.trim=trim,lodash.uniqueId=uniqueId,lodash.each=forEach,lodash.first=head,mixin(lodash,function(){var source={};return baseForOwn(lodash,function(func,methodName){hasOwnProperty.call(lodash.prototype,methodName)||(source[methodName]=func)}),source}(),{chain:!1}),lodash.VERSION=VERSION,arrayEach(["drop","take"],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();return result.__filtered__?result.__takeCount__=nativeMin(n,result.__takeCount__):result.__views__.push({size:nativeMin(n,MAX_ARRAY_LENGTH),type:methodName+(result.__dir__<0?"Right":"")}),result},LazyWrapper.prototype[methodName+"Right"]=function(n){return this.reverse()[methodName](n).reverse()}}),arrayEach(["filter","map","takeWhile"],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();return result.__iteratees__.push({iteratee:getIteratee(iteratee,3),type:type}),result.__filtered__=result.__filtered__||isFilter,result}}),arrayEach(["head","last"],function(methodName,index){var takeName="take"+(index?"Right":"");LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0]}}),arrayEach(["initial","tail"],function(methodName,index){var dropName="drop"+(index?"":"Right");LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1)}}),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head()},LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate)},LazyWrapper.prototype.invokeMap=baseRest(function(path,args){return"function"==typeof path?new LazyWrapper(this):this.map(function(value){return baseInvoke(value,path,args)})}),LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)))},LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;return result.__filtered__&&(start>0||end<0)?new LazyWrapper(result):(start<0?result=result.takeRight(-start):start&&(result=result.drop(start)),end!==undefined&&(end=toInteger(end),result=end<0?result.dropRight(-end):result.take(end-start)),result)},LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH)},baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?"take"+("last"==methodName?"Right":""):methodName],retUnwrapped=isTaker||/^find/.test(methodName);lodashFunc&&(lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value),interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result};useLazy&&checkIteratee&&"function"==typeof iteratee&&1!=iteratee.length&&(isLazy=useLazy=!1);var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);return result.__actions__.push({func:thru,args:[interceptor],thisArg:undefined}),new LodashWrapper(result,chainAll)}return isUnwrapped&&onlyLazy?func.apply(this,args):(result=this.thru(interceptor),isUnwrapped?isTaker?result.value()[0]:result.value():result)})}),arrayEach(["pop","push","shift","sort","splice","unshift"],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?"tap":"thru",retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args)}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args)})}}),baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+"",names=realNames[key]||(realNames[key]=[]);names.push({name:methodName,func:lodashFunc})}}),realNames[createHybrid(undefined,WRAP_BIND_KEY_FLAG).name]=[{name:"wrapper",func:undefined}],LazyWrapper.prototype.clone=lazyClone,LazyWrapper.prototype.reverse=lazyReverse,LazyWrapper.prototype.value=lazyValue,lodash.prototype.first=lodash.prototype.head,symIterator&&(lodash.prototype[symIterator]=wrapperToIterator),"function"==typeof define&&"object"==typeof define.amd&&define.amd?(root._=lodash,define(function(){return lodash})):freeModule?((freeModule.exports=lodash)._=lodash,freeExports._=lodash):root._=lodash}.call(this);var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),!function(undefined){var traverse=function(func,context){return function(value,key,obj){return func.call(context,key,value,obj); +}},_apply=function(name){return function(){return _[name].apply(_,arguments)}},_applyFunc=function(name){return function(){var args=Array.prototype.slice.call(arguments,0);return args[1]=_.isFunction(args[1])?traverse(args[1],args[2]):args[1],_[name].apply(_,args)}};_.extend(BI,{assert:function(v,is){if(this.isFunction(is)){if(is(v))return!0;throw new Error(v+" error")}if(this.isArray(is)||(is=[is]),!this.deepContains(is,v))throw new Error(v+" error")},warn:function(message){console.warn(message)},UUID:function(){for(var f=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],str="",i=0;i<16;i++){var r=parseInt(f.length*Math.random(),10);str+=f[r]}return str},isWidget:function(widget){return widget instanceof BI.Widget||BI.View&&widget instanceof BI.View},createWidgets:function(items,options,context){if(!BI.isArray(items))throw new Error("cannot create Widgets");return BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.map(BI.flatten(items),function(i,item){return BI.createWidget(item,BI.deepClone(options))})},createItems:function(data,innerAttr,outerAttr){return innerAttr=BI.isArray(innerAttr)?innerAttr:BI.makeArray(BI.flatten(data).length,innerAttr||{}),outerAttr=BI.isArray(outerAttr)?outerAttr:BI.makeArray(BI.flatten(data).length,outerAttr||{}),BI.map(data,function(i,item){return BI.isArray(item)?BI.createItems(item,innerAttr,outerAttr):item instanceof BI.Widget?BI.extend({},innerAttr.shift(),outerAttr.shift(),{type:null,el:item}):innerAttr[0]instanceof BI.Widget?(outerAttr.shift(),BI.extend({},item,{el:innerAttr.shift()})):item.el instanceof BI.Widget||BI.View&&item.el instanceof BI.View?(innerAttr.shift(),BI.extend({},outerAttr.shift(),{type:null},item)):item.el?BI.extend({},outerAttr.shift(),item,{el:BI.extend({},innerAttr.shift(),item.el)}):BI.extend({},outerAttr.shift(),{el:BI.extend({},innerAttr.shift(),item)})})},packageItems:function(items,layouts){for(var i=layouts.length-1;i>=0;i--)items=BI.map(items,function(k,it){return BI.extend({},layouts[i],{items:[BI.extend({},layouts[i].el,{el:it})]})});return items},formatEL:function(obj){return obj&&!obj.type&&obj.el?obj:{el:obj}},stripEL:function(obj){return obj.type&&obj||obj.el||obj},trans2Element:function(widgets){return BI.map(widgets,function(i,wi){return wi.element})}}),_.each(["where","findWhere","invoke","pluck","shuffle","sample","toArray","size"],function(name){BI[name]=_apply(name)}),_.each(["get","each","map","reduce","reduceRight","find","filter","reject","every","all","some","any","max","min","sortBy","groupBy","indexBy","countBy","partition","clamp"],function(name){"any"===name?BI[name]=_applyFunc("some"):BI[name]=_applyFunc(name)}),_.extend(BI,{count:function(from,to,predicate){var t;if(predicate)for(t=from;t=0;index--)predicate(index,obj[index],obj);return!1},backAny:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var index=obj.length-1;index>=0;index--)if(predicate(index,obj[index],obj))return!0;return!1},backEvery:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var index=obj.length-1;index>=0;index--)if(!predicate(index,obj[index],obj))return!1;return!0},backFindKey:function(obj,predicate,context){predicate=BI.iteratee(predicate,context);for(var keys=_.keys(obj),key,i=keys.length-1;i>=0;i--)if(key=keys[i],predicate(obj[key],key,obj))return key},backFind:function(obj,predicate,context){var key;if(key=BI.isArray(obj)?BI.findLastIndex(obj,predicate,context):BI.backFindKey(obj,predicate,context),void 0!==key&&key!==-1)return obj[key]},remove:function(obj,target,context){var isFunction=BI.isFunction(target);target=isFunction||BI.isArray(target)?target:[target];var i;if(BI.isArray(obj))for(i=0;i(2147483646-str.charAt(i).charCodeAt(0)+start.charCodeAt(0))/26)return 0;return idx},int2Abc:function(num){var DIGITS=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],idx=num,str="";if(0===num)return"";for(;0!==idx;){var t=idx%26;0===t&&(t=26),str=DIGITS[t-1]+str,idx=(idx-t)/26}return str}}),_.each(["first","initial","last","rest","compact","flatten","without","union","intersection","difference","zip","unzip","object","indexOf","lastIndexOf","sortedIndex","range","take","takeRight","uniqBy"],function(name){BI[name]=_apply(name)}),_.each(["findIndex","findLastIndex"],function(name){BI[name]=_applyFunc(name)}),_.extend(BI,{makeArray:function(length,value){for(var res=[],i=0;i0;)BI.prepares.shift()()},has:function(obj,keys){return BI.isArray(keys)?0!==keys.length&&BI.every(keys,function(i,key){return _.has(obj,key)}):_.has.apply(_,arguments)},freeze:function(value){return Object.freeze&&BI.isObject(value)?Object.freeze(value):value},isKey:function(key){return BI.isNumber(key)||BI.isString(key)&&key.length>0},isCapitalEqual:function(a,b){return a=BI.isNull(a)?a:(""+a).toLowerCase(),b=BI.isNull(b)?b:(""+b).toLowerCase(),BI.isEqual(a,b)},isWidthOrHeight:function(w){return"number"==typeof w?w>=0:"string"==typeof w?/^\d{1,3}%$/.exec(w)||"auto"==w||/^\d+px$/.exec(w):void 0},isNotNull:function(obj){return!BI.isNull(obj)},isNull:function(obj){return"undefined"==typeof obj||null===obj},isEmptyArray:function(arr){return BI.isArray(arr)&&BI.isEmpty(arr)},isNotEmptyArray:function(arr){return BI.isArray(arr)&&!BI.isEmpty(arr)},isEmptyObject:function(obj){return BI.isEqual(obj,{})},isNotEmptyObject:function(obj){return BI.isPlainObject(obj)&&!BI.isEmptyObject(obj)},isEmptyString:function(obj){return BI.isString(obj)&&0===obj.length},isNotEmptyString:function(obj){return BI.isString(obj)&&!BI.isEmptyString(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window}}),_.extend(BI,{deepClone:_.cloneDeep,deepExtend:_.merge,isDeepMatch:function(object,attrs){var keys=BI.keys(attrs),length=keys.length;if(null==object)return!length;for(var obj=Object(object),i=0;i=0},deepContains:function(obj,copy){return BI.isObject(copy)?BI.any(obj,function(i,v){if(BI.isEqual(v,copy))return!0}):BI.contains(obj,copy)},deepIndexOf:function(obj,target){for(var i=0;imaxDate[0]?back=["y",1]:YY>=minDate[0]&&YY<=maxDate[0]&&(YY==minDate[0]&&(MMmaxDate[1]?back=["m",1]:MM==maxDate[1]&&DD>maxDate[2]&&(back=["d",1]))),back},checkDateLegal:function(str){var ar=str.match(/\d+/g),YY=0|ar[0],MM=0|ar[1],DD=0|ar[2];if(ar.length<=1)return!0;if(ar.length<=2)return MM>=1&&MM<=12;var MD=BI.Date._MD.slice(0);return MD[1]=BI.isLeapYear(YY)?29:28,MM>=1&&MM<=12&&DD<=MD[MM-1]},parseDateTime:function(str,fmt){var today=BI.getDate(),y=0,m=0,d=1,a=str.split(/\W+/);if("%y%x"==fmt.toLowerCase()||"%y%x%d"==fmt.toLowerCase()){var yearlength=4,otherlength=2;a[0]=str.substring(0,yearlength),a[1]=str.substring(yearlength,yearlength+otherlength),a[2]=str.substring(yearlength+otherlength,yearlength+2*otherlength)}var b=fmt.match(/%./g),i=0,j=0,hr=0,min=0,sec=0;for(i=0;i29?1900:2e3);break;case"%b":case"%B":for(j=0;j<12;++j)if(BI.Date._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break}break;case"%H":case"%I":case"%k":case"%l":hr=parseInt(a[i],10);break;case"%P":case"%p":/pm/i.test(a[i])&&hr<12?hr+=12:/am/i.test(a[i])&&hr>=12&&(hr-=12);break;case"%M":min=parseInt(a[i],10);case"%S":sec=parseInt(a[i],10)}if(isNaN(y)&&(y=today.getFullYear()),isNaN(m)&&(m=today.getMonth()),isNaN(d)&&(d=today.getDate()),isNaN(hr)&&(hr=today.getHours()),isNaN(min)&&(min=today.getMinutes()),isNaN(sec)&&(sec=today.getSeconds()),0!=y)return BI.getDate(y,m,d,hr,min,sec);for(y=0,m=-1,d=0,i=0;i31&&0==y?(y=parseInt(a[i],10),y<100&&(y+=y>29?1900:2e3)):0==d&&(d=a[i]);return 0==y&&(y=today.getFullYear()),m!=-1&&0!=d?BI.getDate(y,m,d,hr,min,sec):today},getDate:function(){var length=arguments.length,args=arguments,dt;switch(length){case 0:dt=new Date;break;case 1:dt=new Date(args[0]);break;case 2:dt=new Date(args[0],args[1]);break;case 3:dt=new Date(args[0],args[1],args[2]);break;case 4:dt=new Date(args[0],args[1],args[2],args[3]);break;case 5:dt=new Date(args[0],args[1],args[2],args[3],args[4]);break;case 6:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;default:dt=new Date}if(BI.isNotNull(BI.timeZone)&&(0===arguments.length||1===arguments.length&&BI.isNumber(arguments[0]))){var localTime=dt.getTime(),localOffset=6e4*dt.getTimezoneOffset(),utc=localTime+localOffset;return new Date(utc+BI.timeZone)}return dt},getTime:function(){var length=arguments.length,args=arguments,dt;switch(length){case 0:dt=new Date;break;case 1:dt=new Date(args[0]);break;case 2:dt=new Date(args[0],args[1]);break;case 3:dt=new Date(args[0],args[1],args[2]);break;case 4:dt=new Date(args[0],args[1],args[2],args[3]);break;case 5:dt=new Date(args[0],args[1],args[2],args[3],args[4]);break;case 6:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5]);break;case 7:dt=new Date(args[0],args[1],args[2],args[3],args[4],args[5],args[6]);break;default:dt=new Date}return BI.isNotNull(BI.timeZone)?dt.getTime()-BI.timeZone-6e4*(new Date).getTimezoneOffset():dt.getTime()}})}(),!function(){function extend(){for(var target=arguments[0]||{},length=arguments.length,i=1,options,name,src,copy;i0;)BI.prepares.shift()();var el,w;if(item||(item={}),BI.isWidget(options)?(context=options,options={}):options||(options={}),BI.isEmpty(item)&&BI.isEmpty(options))return BI.createWidget({type:"bi.layout"});if(BI.isWidget(item))return item;if(item.type||options.type)return el=BI.extend({},options,item),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(item.el&&(item.el.type||options.type))return el=BI.extend({},options,item.el),w=BI.Plugin.getWidget(el.type,el),w.listeners=(w.listeners||[]).concat([{eventName:BI.Events.MOUNT,action:function(){BI.Plugin.getObject(el.type,this)}}]),w.type===el.type?createWidget(w):BI.createWidget(BI.extend({},item,{type:w.type},options));if(BI.isWidget(item.el))return item.el;throw new Error("无法根据item创建组件")},BI.createElement=function(){var widget=BI.createWidget.apply(this,arguments);return widget.element}}(),!function(){BI.CRYPT_TYPE=BI.CRYPT_TYPE||{},BI.CRYPT_TYPE.AES="aes";var CryptoJS=CryptoJS||function(Math,undefined){var C={},C_lib=C.lib={},Base=C_lib.Base=function(){function F(){}return{extend:function(overrides){F.prototype=this;var subtype=new F;return overrides&&subtype.mixIn(overrides),subtype.hasOwnProperty("init")||(subtype.init=function(){subtype.$super.init.apply(this,arguments)}),subtype.init.prototype=subtype,subtype.$super=this,subtype},create:function(){var instance=this.extend();return instance.init.apply(instance,arguments),instance},init:function(){},mixIn:function(properties){for(var propertyName in properties)properties.hasOwnProperty(propertyName)&&(this[propertyName]=properties[propertyName]);properties.hasOwnProperty("toString")&&(this.toString=properties.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),WordArray=C_lib.WordArray=Base.extend({init:function(words,sigBytes){words=this.words=words||[],sigBytes!=undefined?this.sigBytes=sigBytes:this.sigBytes=4*words.length},toString:function(encoder){return(encoder||Hex).stringify(this)},concat:function(wordArray){var thisWords=this.words,thatWords=wordArray.words,thisSigBytes=this.sigBytes,thatSigBytes=wordArray.sigBytes;if(this.clamp(),thisSigBytes%4)for(var i=0;i>>2]>>>24-i%4*8&255;thisWords[thisSigBytes+i>>>2]|=thatByte<<24-(thisSigBytes+i)%4*8}else if(thatWords.length>65535)for(var i=0;i>>2]=thatWords[i>>>2];else thisWords.push.apply(thisWords,thatWords);return this.sigBytes+=thatSigBytes,this},clamp:function(){var words=this.words,sigBytes=this.sigBytes;words[sigBytes>>>2]&=4294967295<<32-sigBytes%4*8,words.length=Math.ceil(sigBytes/4); +},clone:function(){var clone=Base.clone.call(this);return clone.words=this.words.slice(0),clone},random:function(nBytes){for(var words=[],i=0;i>>2]>>>24-i%4*8&255;hexChars.push((bite>>>4).toString(16)),hexChars.push((15&bite).toString(16))}return hexChars.join("")},parse:function(hexStr){for(var hexStrLength=hexStr.length,words=[],i=0;i>>3]|=parseInt(hexStr.substr(i,2),16)<<24-i%8*4;return new WordArray.init(words,hexStrLength/2)}},Latin1=C_enc.Latin1={stringify:function(wordArray){for(var words=wordArray.words,sigBytes=wordArray.sigBytes,latin1Chars=[],i=0;i>>2]>>>24-i%4*8&255;latin1Chars.push(String.fromCharCode(bite))}return latin1Chars.join("")},parse:function(latin1Str){for(var latin1StrLength=latin1Str.length,words=[],i=0;i>>2]|=(255&latin1Str.charCodeAt(i))<<24-i%4*8;return new WordArray.init(words,latin1StrLength)}},Utf8=C_enc.Utf8={stringify:function(wordArray){try{return decodeURIComponent(escape(Latin1.stringify(wordArray)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(utf8Str){return Latin1.parse(unescape(encodeURIComponent(utf8Str)))}},BufferedBlockAlgorithm=C_lib.BufferedBlockAlgorithm=Base.extend({reset:function(){this._data=new WordArray.init,this._nDataBytes=0},_append:function(data){"string"==typeof data&&(data=Utf8.parse(data)),this._data.concat(data),this._nDataBytes+=data.sigBytes},_process:function(doFlush){var data=this._data,dataWords=data.words,dataSigBytes=data.sigBytes,blockSize=this.blockSize,blockSizeBytes=4*blockSize,nBlocksReady=dataSigBytes/blockSizeBytes;nBlocksReady=doFlush?Math.ceil(nBlocksReady):Math.max((0|nBlocksReady)-this._minBufferSize,0);var nWordsReady=nBlocksReady*blockSize,nBytesReady=Math.min(4*nWordsReady,dataSigBytes);if(nWordsReady){for(var offset=0;offset>>2]>>>24-i%4*8&255,byte2=words[i+1>>>2]>>>24-(i+1)%4*8&255,byte3=words[i+2>>>2]>>>24-(i+2)%4*8&255,triplet=byte1<<16|byte2<<8|byte3,j=0;j<4&&i+.75*j>>6*(3-j)&63));var paddingChar=map.charAt(64);if(paddingChar)for(;base64Chars.length%4;)base64Chars.push(paddingChar);return base64Chars.join("")},parse:function(base64Str){var base64StrLength=base64Str.length,map=this._map,paddingChar=map.charAt(64);if(paddingChar){var paddingIndex=base64Str.indexOf(paddingChar);paddingIndex!=-1&&(base64StrLength=paddingIndex)}for(var words=[],nBytes=0,i=0;i>>6-i%4*2;words[nBytes>>>2]|=(bits1|bits2)<<24-nBytes%4*8,nBytes++}return WordArray.create(words,nBytes)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(Math){function FF(a,b,c,d,x,s,t){var n=a+(b&c|~b&d)+x+t;return(n<>>32-s)+b}function GG(a,b,c,d,x,s,t){var n=a+(b&d|c&~d)+x+t;return(n<>>32-s)+b}function HH(a,b,c,d,x,s,t){var n=a+(b^c^d)+x+t;return(n<>>32-s)+b}function II(a,b,c,d,x,s,t){var n=a+(c^(b|~d))+x+t;return(n<>>32-s)+b}var C=CryptoJS,C_lib=C.lib,WordArray=C_lib.WordArray,Hasher=C_lib.Hasher,C_algo=C.algo,T=[];!function(){for(var i=0;i<64;i++)T[i]=4294967296*Math.abs(Math.sin(i+1))|0}();var MD5=C_algo.MD5=Hasher.extend({_doReset:function(){this._hash=new WordArray.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(M,offset){for(var i=0;i<16;i++){var offset_i=offset+i,M_offset_i=M[offset_i];M[offset_i]=16711935&(M_offset_i<<8|M_offset_i>>>24)|4278255360&(M_offset_i<<24|M_offset_i>>>8)}var H=this._hash.words,M_offset_0=M[offset+0],M_offset_1=M[offset+1],M_offset_2=M[offset+2],M_offset_3=M[offset+3],M_offset_4=M[offset+4],M_offset_5=M[offset+5],M_offset_6=M[offset+6],M_offset_7=M[offset+7],M_offset_8=M[offset+8],M_offset_9=M[offset+9],M_offset_10=M[offset+10],M_offset_11=M[offset+11],M_offset_12=M[offset+12],M_offset_13=M[offset+13],M_offset_14=M[offset+14],M_offset_15=M[offset+15],a=H[0],b=H[1],c=H[2],d=H[3];a=FF(a,b,c,d,M_offset_0,7,T[0]),d=FF(d,a,b,c,M_offset_1,12,T[1]),c=FF(c,d,a,b,M_offset_2,17,T[2]),b=FF(b,c,d,a,M_offset_3,22,T[3]),a=FF(a,b,c,d,M_offset_4,7,T[4]),d=FF(d,a,b,c,M_offset_5,12,T[5]),c=FF(c,d,a,b,M_offset_6,17,T[6]),b=FF(b,c,d,a,M_offset_7,22,T[7]),a=FF(a,b,c,d,M_offset_8,7,T[8]),d=FF(d,a,b,c,M_offset_9,12,T[9]),c=FF(c,d,a,b,M_offset_10,17,T[10]),b=FF(b,c,d,a,M_offset_11,22,T[11]),a=FF(a,b,c,d,M_offset_12,7,T[12]),d=FF(d,a,b,c,M_offset_13,12,T[13]),c=FF(c,d,a,b,M_offset_14,17,T[14]),b=FF(b,c,d,a,M_offset_15,22,T[15]),a=GG(a,b,c,d,M_offset_1,5,T[16]),d=GG(d,a,b,c,M_offset_6,9,T[17]),c=GG(c,d,a,b,M_offset_11,14,T[18]),b=GG(b,c,d,a,M_offset_0,20,T[19]),a=GG(a,b,c,d,M_offset_5,5,T[20]),d=GG(d,a,b,c,M_offset_10,9,T[21]),c=GG(c,d,a,b,M_offset_15,14,T[22]),b=GG(b,c,d,a,M_offset_4,20,T[23]),a=GG(a,b,c,d,M_offset_9,5,T[24]),d=GG(d,a,b,c,M_offset_14,9,T[25]),c=GG(c,d,a,b,M_offset_3,14,T[26]),b=GG(b,c,d,a,M_offset_8,20,T[27]),a=GG(a,b,c,d,M_offset_13,5,T[28]),d=GG(d,a,b,c,M_offset_2,9,T[29]),c=GG(c,d,a,b,M_offset_7,14,T[30]),b=GG(b,c,d,a,M_offset_12,20,T[31]),a=HH(a,b,c,d,M_offset_5,4,T[32]),d=HH(d,a,b,c,M_offset_8,11,T[33]),c=HH(c,d,a,b,M_offset_11,16,T[34]),b=HH(b,c,d,a,M_offset_14,23,T[35]),a=HH(a,b,c,d,M_offset_1,4,T[36]),d=HH(d,a,b,c,M_offset_4,11,T[37]),c=HH(c,d,a,b,M_offset_7,16,T[38]),b=HH(b,c,d,a,M_offset_10,23,T[39]),a=HH(a,b,c,d,M_offset_13,4,T[40]),d=HH(d,a,b,c,M_offset_0,11,T[41]),c=HH(c,d,a,b,M_offset_3,16,T[42]),b=HH(b,c,d,a,M_offset_6,23,T[43]),a=HH(a,b,c,d,M_offset_9,4,T[44]),d=HH(d,a,b,c,M_offset_12,11,T[45]),c=HH(c,d,a,b,M_offset_15,16,T[46]),b=HH(b,c,d,a,M_offset_2,23,T[47]),a=II(a,b,c,d,M_offset_0,6,T[48]),d=II(d,a,b,c,M_offset_7,10,T[49]),c=II(c,d,a,b,M_offset_14,15,T[50]),b=II(b,c,d,a,M_offset_5,21,T[51]),a=II(a,b,c,d,M_offset_12,6,T[52]),d=II(d,a,b,c,M_offset_3,10,T[53]),c=II(c,d,a,b,M_offset_10,15,T[54]),b=II(b,c,d,a,M_offset_1,21,T[55]),a=II(a,b,c,d,M_offset_8,6,T[56]),d=II(d,a,b,c,M_offset_15,10,T[57]),c=II(c,d,a,b,M_offset_6,15,T[58]),b=II(b,c,d,a,M_offset_13,21,T[59]),a=II(a,b,c,d,M_offset_4,6,T[60]),d=II(d,a,b,c,M_offset_11,10,T[61]),c=II(c,d,a,b,M_offset_2,15,T[62]),b=II(b,c,d,a,M_offset_9,21,T[63]),H[0]=H[0]+a|0,H[1]=H[1]+b|0,H[2]=H[2]+c|0,H[3]=H[3]+d|0},_doFinalize:function(){var data=this._data,dataWords=data.words,nBitsTotal=8*this._nDataBytes,nBitsLeft=8*data.sigBytes;dataWords[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;var nBitsTotalH=Math.floor(nBitsTotal/4294967296),nBitsTotalL=nBitsTotal;dataWords[(nBitsLeft+64>>>9<<4)+15]=16711935&(nBitsTotalH<<8|nBitsTotalH>>>24)|4278255360&(nBitsTotalH<<24|nBitsTotalH>>>8),dataWords[(nBitsLeft+64>>>9<<4)+14]=16711935&(nBitsTotalL<<8|nBitsTotalL>>>24)|4278255360&(nBitsTotalL<<24|nBitsTotalL>>>8),data.sigBytes=4*(dataWords.length+1),this._process();for(var hash=this._hash,H=hash.words,i=0;i<4;i++){var H_i=H[i];H[i]=16711935&(H_i<<8|H_i>>>24)|4278255360&(H_i<<24|H_i>>>8)}return hash},clone:function(){var clone=Hasher.clone.call(this);return clone._hash=this._hash.clone(),clone}});C.MD5=Hasher._createHelper(MD5),C.HmacMD5=Hasher._createHmacHelper(MD5)}(Math),function(){var C=CryptoJS,C_lib=C.lib,Base=C_lib.Base,WordArray=C_lib.WordArray,C_algo=C.algo,MD5=C_algo.MD5,EvpKDF=C_algo.EvpKDF=Base.extend({cfg:Base.extend({keySize:4,hasher:MD5,iterations:1}),init:function(cfg){this.cfg=this.cfg.extend(cfg)},compute:function(password,salt){for(var cfg=this.cfg,hasher=cfg.hasher.create(),derivedKey=WordArray.create(),derivedKeyWords=derivedKey.words,keySize=cfg.keySize,iterations=cfg.iterations;derivedKeyWords.length>>2];data.sigBytes-=nPaddingBytes}},BlockCipher=C_lib.BlockCipher=Cipher.extend({cfg:Cipher.cfg.extend({mode:CBC,padding:Pkcs7}),reset:function(){Cipher.reset.call(this);var cfg=this.cfg,iv=cfg.iv,mode=cfg.mode;if(this._xformMode==this._ENC_XFORM_MODE)var modeCreator=mode.createEncryptor;else{var modeCreator=mode.createDecryptor;this._minBufferSize=1}this._mode=modeCreator.call(mode,this,iv&&iv.words)},_doProcessBlock:function(words,offset){this._mode.processBlock(words,offset)},_doFinalize:function(){var padding=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){padding.pad(this._data,this.blockSize);var finalProcessedBlocks=this._process(!0)}else{var finalProcessedBlocks=this._process(!0);padding.unpad(finalProcessedBlocks)}return finalProcessedBlocks},blockSize:4}),CipherParams=C_lib.CipherParams=Base.extend({init:function(cipherParams){this.mixIn(cipherParams)},toString:function(formatter){return(formatter||this.formatter).stringify(this)}}),C_format=C.format={},OpenSSLFormatter=C_format.OpenSSL={stringify:function(cipherParams){var ciphertext=cipherParams.ciphertext,salt=cipherParams.salt;if(salt)var wordArray=WordArray.create([1398893684,1701076831]).concat(salt).concat(ciphertext);else var wordArray=ciphertext;return wordArray.toString(Base64)},parse:function(openSSLStr){var ciphertext=Base64.parse(openSSLStr),ciphertextWords=ciphertext.words;if(1398893684==ciphertextWords[0]&&1701076831==ciphertextWords[1]){var salt=WordArray.create(ciphertextWords.slice(2,4));ciphertextWords.splice(0,4),ciphertext.sigBytes-=16}return CipherParams.create({ciphertext:ciphertext,salt:salt})}},SerializableCipher=C_lib.SerializableCipher=Base.extend({cfg:Base.extend({format:OpenSSLFormatter}),encrypt:function(cipher,message,key,cfg){cfg=this.cfg.extend(cfg);var encryptor=cipher.createEncryptor(key,cfg),ciphertext=encryptor.finalize(message),cipherCfg=encryptor.cfg;return CipherParams.create({ciphertext:ciphertext,key:key,iv:cipherCfg.iv,algorithm:cipher,mode:cipherCfg.mode,padding:cipherCfg.padding,blockSize:cipher.blockSize,formatter:cfg.format})},decrypt:function(cipher,ciphertext,key,cfg){cfg=this.cfg.extend(cfg),ciphertext=this._parse(ciphertext,cfg.format);var plaintext=cipher.createDecryptor(key,cfg).finalize(ciphertext.ciphertext);return plaintext},_parse:function(ciphertext,format){return"string"==typeof ciphertext?format.parse(ciphertext,this):ciphertext}}),C_kdf=C.kdf={},OpenSSLKdf=C_kdf.OpenSSL={execute:function(password,keySize,ivSize,salt){salt||(salt=WordArray.random(8));var key=EvpKDF.create({keySize:keySize+ivSize}).compute(password,salt),iv=WordArray.create(key.words.slice(keySize),4*ivSize);return key.sigBytes=4*keySize,CipherParams.create({key:key,iv:iv,salt:salt})}},PasswordBasedCipher=C_lib.PasswordBasedCipher=SerializableCipher.extend({cfg:SerializableCipher.cfg.extend({kdf:OpenSSLKdf}),encrypt:function(cipher,message,password,cfg){cfg=this.cfg.extend(cfg);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize);cfg.iv=derivedParams.iv;var ciphertext=SerializableCipher.encrypt.call(this,cipher,message,derivedParams.key,cfg);return ciphertext.mixIn(derivedParams),ciphertext},decrypt:function(cipher,ciphertext,password,cfg){cfg=this.cfg.extend(cfg),ciphertext=this._parse(ciphertext,cfg.format);var derivedParams=cfg.kdf.execute(password,cipher.keySize,cipher.ivSize,ciphertext.salt);cfg.iv=derivedParams.iv;var plaintext=SerializableCipher.decrypt.call(this,cipher,ciphertext,derivedParams.key,cfg);return plaintext}})}(),CryptoJS.mode.ECB=function(){var ECB=CryptoJS.lib.BlockCipherMode.extend();return ECB.Encryptor=ECB.extend({processBlock:function(words,offset){this._cipher.encryptBlock(words,offset)}}),ECB.Decryptor=ECB.extend({processBlock:function(words,offset){this._cipher.decryptBlock(words,offset)}}),ECB}(),function(){var C=CryptoJS,C_lib=C.lib,BlockCipher=C_lib.BlockCipher,C_algo=C.algo,SBOX=[],INV_SBOX=[],SUB_MIX_0=[],SUB_MIX_1=[],SUB_MIX_2=[],SUB_MIX_3=[],INV_SUB_MIX_0=[],INV_SUB_MIX_1=[],INV_SUB_MIX_2=[],INV_SUB_MIX_3=[];!function(){for(var d=[],i=0;i<256;i++)i<128?d[i]=i<<1:d[i]=i<<1^283;for(var x=0,xi=0,i=0;i<256;i++){var sx=xi^xi<<1^xi<<2^xi<<3^xi<<4;sx=sx>>>8^255&sx^99,SBOX[x]=sx,INV_SBOX[sx]=x;var x2=d[x],x4=d[x2],x8=d[x4],t=257*d[sx]^16843008*sx;SUB_MIX_0[x]=t<<24|t>>>8,SUB_MIX_1[x]=t<<16|t>>>16,SUB_MIX_2[x]=t<<8|t>>>24,SUB_MIX_3[x]=t;var t=16843009*x8^65537*x4^257*x2^16843008*x;INV_SUB_MIX_0[sx]=t<<24|t>>>8,INV_SUB_MIX_1[sx]=t<<16|t>>>16,INV_SUB_MIX_2[sx]=t<<8|t>>>24,INV_SUB_MIX_3[sx]=t,x?(x=x2^d[d[d[x8^x2]]],xi^=d[d[xi]]):x=xi=1}}();var RCON=[0,1,2,4,8,16,32,64,128,27,54],AES=C_algo.AES=BlockCipher.extend({_doReset:function(){for(var key=this._key,keyWords=key.words,keySize=key.sigBytes/4,nRounds=this._nRounds=keySize+6,ksRows=4*(nRounds+1),keySchedule=this._keySchedule=[],ksRow=0;ksRow6&&ksRow%keySize==4&&(t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[255&t]):(t=t<<8|t>>>24,t=SBOX[t>>>24]<<24|SBOX[t>>>16&255]<<16|SBOX[t>>>8&255]<<8|SBOX[255&t],t^=RCON[ksRow/keySize|0]<<24),keySchedule[ksRow]=keySchedule[ksRow-keySize]^t}for(var invKeySchedule=this._invKeySchedule=[],invKsRow=0;invKsRow>>24]]^INV_SUB_MIX_1[SBOX[t>>>16&255]]^INV_SUB_MIX_2[SBOX[t>>>8&255]]^INV_SUB_MIX_3[SBOX[255&t]]}},encryptBlock:function(M,offset){this._doCryptBlock(M,offset,this._keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX)},decryptBlock:function(M,offset){var t=M[offset+1];M[offset+1]=M[offset+3],M[offset+3]=t,this._doCryptBlock(M,offset,this._invKeySchedule,INV_SUB_MIX_0,INV_SUB_MIX_1,INV_SUB_MIX_2,INV_SUB_MIX_3,INV_SBOX);var t=M[offset+1];M[offset+1]=M[offset+3],M[offset+3]=t},_doCryptBlock:function(M,offset,keySchedule,SUB_MIX_0,SUB_MIX_1,SUB_MIX_2,SUB_MIX_3,SBOX){for(var nRounds=this._nRounds,s0=M[offset]^keySchedule[0],s1=M[offset+1]^keySchedule[1],s2=M[offset+2]^keySchedule[2],s3=M[offset+3]^keySchedule[3],ksRow=4,round=1;round>>24]^SUB_MIX_1[s1>>>16&255]^SUB_MIX_2[s2>>>8&255]^SUB_MIX_3[255&s3]^keySchedule[ksRow++],t1=SUB_MIX_0[s1>>>24]^SUB_MIX_1[s2>>>16&255]^SUB_MIX_2[s3>>>8&255]^SUB_MIX_3[255&s0]^keySchedule[ksRow++],t2=SUB_MIX_0[s2>>>24]^SUB_MIX_1[s3>>>16&255]^SUB_MIX_2[s0>>>8&255]^SUB_MIX_3[255&s1]^keySchedule[ksRow++],t3=SUB_MIX_0[s3>>>24]^SUB_MIX_1[s0>>>16&255]^SUB_MIX_2[s1>>>8&255]^SUB_MIX_3[255&s2]^keySchedule[ksRow++];s0=t0,s1=t1,s2=t2,s3=t3}var t0=(SBOX[s0>>>24]<<24|SBOX[s1>>>16&255]<<16|SBOX[s2>>>8&255]<<8|SBOX[255&s3])^keySchedule[ksRow++],t1=(SBOX[s1>>>24]<<24|SBOX[s2>>>16&255]<<16|SBOX[s3>>>8&255]<<8|SBOX[255&s0])^keySchedule[ksRow++],t2=(SBOX[s2>>>24]<<24|SBOX[s3>>>16&255]<<16|SBOX[s0>>>8&255]<<8|SBOX[255&s1])^keySchedule[ksRow++],t3=(SBOX[s3>>>24]<<24|SBOX[s0>>>16&255]<<16|SBOX[s1>>>8&255]<<8|SBOX[255&s2])^keySchedule[ksRow++];M[offset]=t0,M[offset+1]=t1,M[offset+2]=t2,M[offset+3]=t3},keySize:8});C.AES=BlockCipher._createHelper(AES)}(),_.extend(BI,{aesEncrypt:function(text,key){key=CryptoJS.enc.Utf8.parse(key);var cipher=CryptoJS.AES.encrypt(text,key,{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7}),base64Cipher=cipher.ciphertext.toString(CryptoJS.enc.Base64);return base64Cipher}})}(),!function(){function aspect(type){return function(target,methodName,advice){var exist=target[methodName],dispatcher;exist&&exist.target==target||(dispatcher=target[methodName]=function(){for(var beforeArr=dispatcher.before,args=arguments,next,l=beforeArr.length;l--;){if(next=beforeArr[l].advice.apply(this,args),next===!1)return!1;args=next||args}for(var rs=dispatcher.method.apply(this,args),afterArr=dispatcher.after,i=0,ii=afterArr.length;i127&&c<2048?(utftext+=String.fromCharCode(c>>6|192),utftext+=String.fromCharCode(63&c|128)):(utftext+=String.fromCharCode(c>>12|224),utftext+=String.fromCharCode(c>>6&63|128),utftext+=String.fromCharCode(63&c|128))}return utftext},_utf8_decode=function(utftext){for(var string="",i=0,c=0,c3=0,c2=0;i191&&c<224?(c2=utftext.charCodeAt(i+1),string+=String.fromCharCode((31&c)<<6|63&c2),i+=2):(c2=utftext.charCodeAt(i+1),c3=utftext.charCodeAt(i+2),string+=String.fromCharCode((15&c)<<12|(63&c2)<<6|63&c3),i+=3);return string};_.extend(BI,{encode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;for(input=_utf8_encode(input);i>2,enc2=(3&chr1)<<4|chr2>>4,enc3=(15&chr2)<<2|chr3>>6,enc4=63&chr3,isNaN(chr2)?enc3=enc4=64:isNaN(chr3)&&(enc4=64),output=output+_keyStr.charAt(enc1)+_keyStr.charAt(enc2)+_keyStr.charAt(enc3)+_keyStr.charAt(enc4);return output},decode:function(input){var output="",chr1,chr2,chr3,enc1,enc2,enc3,enc4,i=0;for(input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");i>4,chr2=(15&enc2)<<4|enc3>>2,chr3=(3&enc3)<<6|enc4,output+=String.fromCharCode(chr1),64!=enc3&&(output+=String.fromCharCode(chr2)),64!=enc4&&(output+=String.fromCharCode(chr3));return output=_utf8_decode(output)}})}(),BI.Cache={_prefix:"bi",setUsername:function(username){localStorage.setItem(BI.Cache._prefix+".username",(username+""||"").toUpperCase())},getUsername:function(){return localStorage.getItem(BI.Cache._prefix+".username")||""},_getKeyPrefix:function(){return BI.Cache.getUsername()+"."+BI.Cache._prefix+"."},_generateKey:function(key){return BI.Cache._getKeyPrefix()+(key||"")},getItem:function(key){return localStorage.getItem(BI.Cache._generateKey(key))},setItem:function(key,value){localStorage.setItem(BI.Cache._generateKey(key),value)},removeItem:function(key){localStorage.removeItem(BI.Cache._generateKey(key))},clear:function(){for(var i=localStorage.length;i>=0;i--){var key=localStorage.key(i);key&&0===key.indexOf(BI.Cache._getKeyPrefix())&&localStorage.removeItem(key)}},keys:function(){for(var result=[],i=localStorage.length;i>=0;i--){var key=localStorage.key(i);if(key){var prefix=BI.Cache._getKeyPrefix();0===key.indexOf(prefix)&&(result[result.length]=key.substring(prefix.length))}}return result},addCookie:function(name,value,path,expiresHours){var cookieString=name+"="+escape(value);if(expiresHours&&expiresHours>0){var date=new Date;date.setTime(BI.getTime()+3600*expiresHours*1e3),cookieString=cookieString+"; expires="+date.toGMTString()}path&&(cookieString=cookieString+"; path="+path),document.cookie=cookieString},getCookie:function(name){var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");return(arr=document.cookie.match(reg))?unescape(arr[2]):null},deleteCookie:function(name,path){var date=new Date;date.setTime(BI.getTime()-1e4);var cookieString=name+"=v; expires="+date.toGMTString();path&&(cookieString=cookieString+"; path="+path),document.cookie=cookieString}},BI.CellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize){this._cellSizeGetter=cellSizeGetter,this._cellCount=cellCount,this._estimatedCellSize=estimatedCellSize,this._cellSizeAndPositionData={},this._lastMeasuredIndex=-1},BI.CellSizeAndPositionManager.prototype={constructor:BI.CellSizeAndPositionManager,configure:function(cellCount,estimatedCellSize){this._cellCount=cellCount,this._estimatedCellSize=estimatedCellSize},getCellCount:function(){return this._cellCount},getEstimatedCellSize:function(){return this._estimatedCellSize},getLastMeasuredIndex:function(){return this._lastMeasuredIndex},getSizeAndPositionOfCell:function(index){if(!(index<0||index>=this._cellCount)){if(index>this._lastMeasuredIndex){for(var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell(),offset=lastMeasuredCellSizeAndPosition.offset+lastMeasuredCellSizeAndPosition.size,i=this._lastMeasuredIndex+1;i<=index;i++){var size=this._cellSizeGetter(i);null==size||isNaN(size)||(this._cellSizeAndPositionData[i]={offset:offset,size:size},offset+=size)}this._lastMeasuredIndex=index}return this._cellSizeAndPositionData[index]}},getSizeAndPositionOfLastMeasuredCell:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}},getTotalSize:function(){var lastMeasuredCellSizeAndPosition=this.getSizeAndPositionOfLastMeasuredCell();return lastMeasuredCellSizeAndPosition.offset+lastMeasuredCellSizeAndPosition.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){var datum=this.getSizeAndPositionOfCell(targetIndex),maxOffset=datum.offset,minOffset=maxOffset-containerSize+datum.size,idealOffset;switch(align){case"start":idealOffset=maxOffset;break;case"end":idealOffset=minOffset;break;case"center":idealOffset=maxOffset-(containerSize-datum.size)/2;break;default:idealOffset=Math.max(minOffset,Math.min(maxOffset,currentOffset))}var totalSize=this.getTotalSize();return Math.max(0,Math.min(totalSize-containerSize,idealOffset))},getVisibleCellRange:function(containerSize,offset){var totalSize=this.getTotalSize();if(0===totalSize)return{};var maxOffset=offset+containerSize,start=this._findNearestCell(offset),datum=this.getSizeAndPositionOfCell(start);offset=datum.offset+datum.size;for(var stop=start;offsetoffset&&(high=middle-1)}if(low>0)return low-1},_exponentialSearch:function(index,offset){for(var interval=1;index=offset?this._binarySearch(lastMeasuredIndex,0,offset):this._exponentialSearch(lastMeasuredIndex,offset)}}},BI.ScalingCellSizeAndPositionManager=function(cellCount,cellSizeGetter,estimatedCellSize,maxScrollSize){this._cellSizeAndPositionManager=new BI.CellSizeAndPositionManager(cellCount,cellSizeGetter,estimatedCellSize),this._maxScrollSize=maxScrollSize||1e7},BI.ScalingCellSizeAndPositionManager.prototype={constructor:BI.ScalingCellSizeAndPositionManager,configure:function(){this._cellSizeAndPositionManager.configure.apply(this._cellSizeAndPositionManager,arguments)},getCellCount:function(){return this._cellSizeAndPositionManager.getCellCount()},getEstimatedCellSize:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()},getLastMeasuredIndex:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()},getOffsetAdjustment:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize(),offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(safeTotalSize-totalSize))},getSizeAndPositionOfCell:function(index){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(index)},getSizeAndPositionOfLastMeasuredCell:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()},getTotalSize:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())},getUpdatedOffsetForIndex:function(align,containerSize,currentOffset,targetIndex){currentOffset=this._safeOffsetToOffset(containerSize,currentOffset);var offset=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex(align,containerSize,currentOffset,targetIndex);return this._offsetToSafeOffset(containerSize,offset)},getVisibleCellRange:function(containerSize,offset){return offset=this._safeOffsetToOffset(containerSize,offset),this._cellSizeAndPositionManager.getVisibleCellRange(containerSize,offset)},resetCell:function(index){this._cellSizeAndPositionManager.resetCell(index)},_getOffsetPercentage:function(containerSize,offset,totalSize){return totalSize<=containerSize?0:offset/(totalSize-containerSize)},_offsetToSafeOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,totalSize);return Math.round(offsetPercentage*(safeTotalSize-containerSize))},_safeOffsetToOffset:function(containerSize,offset){var totalSize=this._cellSizeAndPositionManager.getTotalSize(),safeTotalSize=this.getTotalSize();if(totalSize===safeTotalSize)return offset;var offsetPercentage=this._getOffsetPercentage(containerSize,offset,safeTotalSize);return Math.round(offsetPercentage*(totalSize-containerSize))}},!function(){var _ChineseFirstPY="YDYQSXMWZSSXJBYMGCCZQPSSQBYCDSCDQLDYLYBSSJGYZZJJFKCCLZDHWDWZJLJPFYYNWJJTMYHZWZHFLZPPQHGSCYYYNJQYXXGJHHSDSJNKKTMOMLCRXYPSNQSECCQZGGLLYJLMYZZSECYKYYHQWJSSGGYXYZYJWWKDJHYCHMYXJTLXJYQBYXZLDWRDJRWYSRLDZJPCBZJJBRCFTLECZSTZFXXZHTRQHYBDLYCZSSYMMRFMYQZPWWJJYFCRWFDFZQPYDDWYXKYJAWJFFXYPSFTZYHHYZYSWCJYXSCLCXXWZZXNBGNNXBXLZSZSBSGPYSYZDHMDZBQBZCWDZZYYTZHBTSYYBZGNTNXQYWQSKBPHHLXGYBFMJEBJHHGQTJCYSXSTKZHLYCKGLYSMZXYALMELDCCXGZYRJXSDLTYZCQKCNNJWHJTZZCQLJSTSTBNXBTYXCEQXGKWJYFLZQLYHYXSPSFXLMPBYSXXXYDJCZYLLLSJXFHJXPJBTFFYABYXBHZZBJYZLWLCZGGBTSSMDTJZXPTHYQTGLJSCQFZKJZJQNLZWLSLHDZBWJNCJZYZSQQYCQYRZCJJWYBRTWPYFTWEXCSKDZCTBZHYZZYYJXZCFFZZMJYXXSDZZOTTBZLQWFCKSZSXFYRLNYJMBDTHJXSQQCCSBXYYTSYFBXDZTGBCNSLCYZZPSAZYZZSCJCSHZQYDXLBPJLLMQXTYDZXSQJTZPXLCGLQTZWJBHCTSYJSFXYEJJTLBGXSXJMYJQQPFZASYJNTYDJXKJCDJSZCBARTDCLYJQMWNQNCLLLKBYBZZSYHQQLTWLCCXTXLLZNTYLNEWYZYXCZXXGRKRMTCNDNJTSYYSSDQDGHSDBJGHRWRQLYBGLXHLGTGXBQJDZPYJSJYJCTMRNYMGRZJCZGJMZMGXMPRYXKJNYMSGMZJYMKMFXMLDTGFBHCJHKYLPFMDXLQJJSMTQGZSJLQDLDGJYCALCMZCSDJLLNXDJFFFFJCZFMZFFPFKHKGDPSXKTACJDHHZDDCRRCFQYJKQCCWJDXHWJLYLLZGCFCQDSMLZPBJJPLSBCJGGDCKKDEZSQCCKJGCGKDJTJDLZYCXKLQSCGJCLTFPCQCZGWPJDQYZJJBYJHSJDZWGFSJGZKQCCZLLPSPKJGQJHZZLJPLGJGJJTHJJYJZCZMLZLYQBGJWMLJKXZDZNJQSYZMLJLLJKYWXMKJLHSKJGBMCLYYMKXJQLBMLLKMDXXKWYXYSLMLPSJQQJQXYXFJTJDXMXXLLCXQBSYJBGWYMBGGBCYXPJYGPEPFGDJGBHBNSQJYZJKJKHXQFGQZKFHYGKHDKLLSDJQXPQYKYBNQSXQNSZSWHBSXWHXWBZZXDMNSJBSBKBBZKLYLXGWXDRWYQZMYWSJQLCJXXJXKJEQXSCYETLZHLYYYSDZPAQYZCMTLSHTZCFYZYXYLJSDCJQAGYSLCQLYYYSHMRQQKLDXZSCSSSYDYCJYSFSJBFRSSZQSBXXPXJYSDRCKGJLGDKZJZBDKTCSYQPYHSTCLDJDHMXMCGXYZHJDDTMHLTXZXYLYMOHYJCLTYFBQQXPFBDFHHTKSQHZYYWCNXXCRWHOWGYJLEGWDQCWGFJYCSNTMYTOLBYGWQWESJPWNMLRYDZSZTXYQPZGCWXHNGPYXSHMYQJXZTDPPBFYHZHTJYFDZWKGKZBLDNTSXHQEEGZZYLZMMZYJZGXZXKHKSTXNXXWYLYAPSTHXDWHZYMPXAGKYDXBHNHXKDPJNMYHYLPMGOCSLNZHKXXLPZZLBMLSFBHHGYGYYGGBHSCYAQTYWLXTZQCEZYDQDQMMHTKLLSZHLSJZWFYHQSWSCWLQAZYNYTLSXTHAZNKZZSZZLAXXZWWCTGQQTDDYZTCCHYQZFLXPSLZYGPZSZNGLNDQTBDLXGTCTAJDKYWNSYZLJHHZZCWNYYZYWMHYCHHYXHJKZWSXHZYXLYSKQYSPSLYZWMYPPKBYGLKZHTYXAXQSYSHXASMCHKDSCRSWJPWXSGZJLWWSCHSJHSQNHCSEGNDAQTBAALZZMSSTDQJCJKTSCJAXPLGGXHHGXXZCXPDMMHLDGTYBYSJMXHMRCPXXJZCKZXSHMLQXXTTHXWZFKHCCZDYTCJYXQHLXDHYPJQXYLSYYDZOZJNYXQEZYSQYAYXWYPDGXDDXSPPYZNDLTWRHXYDXZZJHTCXMCZLHPYYYYMHZLLHNXMYLLLMDCPPXHMXDKYCYRDLTXJCHHZZXZLCCLYLNZSHZJZZLNNRLWHYQSNJHXYNTTTKYJPYCHHYEGKCTTWLGQRLGGTGTYGYHPYHYLQYQGCWYQKPYYYTTTTLHYHLLTYTTSPLKYZXGZWGPYDSSZZDQXSKCQNMJJZZBXYQMJRTFFBTKHZKBXLJJKDXJTLBWFZPPTKQTZTGPDGNTPJYFALQMKGXBDCLZFHZCLLLLADPMXDJHLCCLGYHDZFGYDDGCYYFGYDXKSSEBDHYKDKDKHNAXXYBPBYYHXZQGAFFQYJXDMLJCSQZLLPCHBSXGJYNDYBYQSPZWJLZKSDDTACTBXZDYZYPJZQSJNKKTKNJDJGYYPGTLFYQKASDNTCYHBLWDZHBBYDWJRYGKZYHEYYFJMSDTYFZJJHGCXPLXHLDWXXJKYTCYKSSSMTWCTTQZLPBSZDZWZXGZAGYKTYWXLHLSPBCLLOQMMZSSLCMBJCSZZKYDCZJGQQDSMCYTZQQLWZQZXSSFPTTFQMDDZDSHDTDWFHTDYZJYQJQKYPBDJYYXTLJHDRQXXXHAYDHRJLKLYTWHLLRLLRCXYLBWSRSZZSYMKZZHHKYHXKSMDSYDYCJPBZBSQLFCXXXNXKXWYWSDZYQOGGQMMYHCDZTTFJYYBGSTTTYBYKJDHKYXBELHTYPJQNFXFDYKZHQKZBYJTZBXHFDXKDASWTAWAJLDYJSFHBLDNNTNQJTJNCHXFJSRFWHZFMDRYJYJWZPDJKZYJYMPCYZNYNXFBYTFYFWYGDBNZZZDNYTXZEMMQBSQEHXFZMBMFLZZSRXYMJGSXWZJSPRYDJSJGXHJJGLJJYNZZJXHGXKYMLPYYYCXYTWQZSWHWLYRJLPXSLSXMFSWWKLCTNXNYNPSJSZHDZEPTXMYYWXYYSYWLXJQZQXZDCLEEELMCPJPCLWBXSQHFWWTFFJTNQJHJQDXHWLBYZNFJLALKYYJLDXHHYCSTYYWNRJYXYWTRMDRQHWQCMFJDYZMHMYYXJWMYZQZXTLMRSPWWCHAQBXYGZYPXYYRRCLMPYMGKSJSZYSRMYJSNXTPLNBAPPYPYLXYYZKYNLDZYJZCZNNLMZHHARQMPGWQTZMXXMLLHGDZXYHXKYXYCJMFFYYHJFSBSSQLXXNDYCANNMTCJCYPRRNYTYQNYYMBMSXNDLYLYSLJRLXYSXQMLLYZLZJJJKYZZCSFBZXXMSTBJGNXYZHLXNMCWSCYZYFZLXBRNNNYLBNRTGZQYSATSWRYHYJZMZDHZGZDWYBSSCSKXSYHYTXXGCQGXZZSHYXJSCRHMKKBXCZJYJYMKQHZJFNBHMQHYSNJNZYBKNQMCLGQHWLZNZSWXKHLJHYYBQLBFCDSXDLDSPFZPSKJYZWZXZDDXJSMMEGJSCSSMGCLXXKYYYLNYPWWWGYDKZJGGGZGGSYCKNJWNJPCXBJJTQTJWDSSPJXZXNZXUMELPXFSXTLLXCLJXJJLJZXCTPSWXLYDHLYQRWHSYCSQYYBYAYWJJJQFWQCQQCJQGXALDBZZYJGKGXPLTZYFXJLTPADKYQHPMATLCPDCKBMTXYBHKLENXDLEEGQDYMSAWHZMLJTWYGXLYQZLJEEYYBQQFFNLYXRDSCTGJGXYYNKLLYQKCCTLHJLQMKKZGCYYGLLLJDZGYDHZWXPYSJBZKDZGYZZHYWYFQYTYZSZYEZZLYMHJJHTSMQWYZLKYYWZCSRKQYTLTDXWCTYJKLWSQZWBDCQYNCJSRSZJLKCDCDTLZZZACQQZZDDXYPLXZBQJYLZLLLQDDZQJYJYJZYXNYYYNYJXKXDAZWYRDLJYYYRJLXLLDYXJCYWYWNQCCLDDNYYYNYCKCZHXXCCLGZQJGKWPPCQQJYSBZZXYJSQPXJPZBSBDSFNSFPZXHDWZTDWPPTFLZZBZDMYYPQJRSDZSQZSQXBDGCPZSWDWCSQZGMDHZXMWWFYBPDGPHTMJTHZSMMBGZMBZJCFZWFZBBZMQCFMBDMCJXLGPNJBBXGYHYYJGPTZGZMQBQTCGYXJXLWZKYDPDYMGCFTPFXYZTZXDZXTGKMTYBBCLBJASKYTSSQYYMSZXFJEWLXLLSZBQJJJAKLYLXLYCCTSXMCWFKKKBSXLLLLJYXTYLTJYYTDPJHNHNNKBYQNFQYYZBYYESSESSGDYHFHWTCJBSDZZTFDMXHCNJZYMQWSRYJDZJQPDQBBSTJGGFBKJBXTGQHNGWJXJGDLLTHZHHYYYYYYSXWTYYYCCBDBPYPZYCCZYJPZYWCBDLFWZCWJDXXHYHLHWZZXJTCZLCDPXUJCZZZLYXJJTXPHFXWPYWXZPTDZZBDZCYHJHMLXBQXSBYLRDTGJRRCTTTHYTCZWMXFYTWWZCWJWXJYWCSKYBZSCCTZQNHXNWXXKHKFHTSWOCCJYBCMPZZYKBNNZPBZHHZDLSYDDYTYFJPXYNGFXBYQXCBHXCPSXTYZDMKYSNXSXLHKMZXLYHDHKWHXXSSKQYHHCJYXGLHZXCSNHEKDTGZXQYPKDHEXTYKCNYMYYYPKQYYYKXZLTHJQTBYQHXBMYHSQCKWWYLLHCYYLNNEQXQWMCFBDCCMLJGGXDQKTLXKGNQCDGZJWYJJLYHHQTTTNWCHMXCXWHWSZJYDJCCDBQCDGDNYXZTHCQRXCBHZTQCBXWGQWYYBXHMBYMYQTYEXMQKYAQYRGYZSLFYKKQHYSSQYSHJGJCNXKZYCXSBXYXHYYLSTYCXQTHYSMGSCPMMGCCCCCMTZTASMGQZJHKLOSQYLSWTMXSYQKDZLJQQYPLSYCZTCQQPBBQJZCLPKHQZYYXXDTDDTSJCXFFLLCHQXMJLWCJCXTSPYCXNDTJSHJWXDQQJSKXYAMYLSJHMLALYKXCYYDMNMDQMXMCZNNCYBZKKYFLMCHCMLHXRCJJHSYLNMTJZGZGYWJXSRXCWJGJQHQZDQJDCJJZKJKGDZQGJJYJYLXZXXCDQHHHEYTMHLFSBDJSYYSHFYSTCZQLPBDRFRZTZYKYWHSZYQKWDQZRKMSYNBCRXQBJYFAZPZZEDZCJYWBCJWHYJBQSZYWRYSZPTDKZPFPBNZTKLQYHBBZPNPPTYZZYBQNYDCPJMMCYCQMCYFZZDCMNLFPBPLNGQJTBTTNJZPZBBZNJKLJQYLNBZQHKSJZNGGQSZZKYXSHPZSNBCGZKDDZQANZHJKDRTLZLSWJLJZLYWTJNDJZJHXYAYNCBGTZCSSQMNJPJYTYSWXZFKWJQTKHTZPLBHSNJZSYZBWZZZZLSYLSBJHDWWQPSLMMFBJDWAQYZTCJTBNNWZXQXCDSLQGDSDPDZHJTQQPSWLYYJZLGYXYZLCTCBJTKTYCZJTQKBSJLGMGZDMCSGPYNJZYQYYKNXRPWSZXMTNCSZZYXYBYHYZAXYWQCJTLLCKJJTJHGDXDXYQYZZBYWDLWQCGLZGJGQRQZCZSSBCRPCSKYDZNXJSQGXSSJMYDNSTZTPBDLTKZWXQWQTZEXNQCZGWEZKSSBYBRTSSSLCCGBPSZQSZLCCGLLLZXHZQTHCZMQGYZQZNMCOCSZJMMZSQPJYGQLJYJPPLDXRGZYXCCSXHSHGTZNLZWZKJCXTCFCJXLBMQBCZZWPQDNHXLJCTHYZLGYLNLSZZPCXDSCQQHJQKSXZPBAJYEMSMJTZDXLCJYRYYNWJBNGZZTMJXLTBSLYRZPYLSSCNXPHLLHYLLQQZQLXYMRSYCXZLMMCZLTZSDWTJJLLNZGGQXPFSKYGYGHBFZPDKMWGHCXMSGDXJMCJZDYCABXJDLNBCDQYGSKYDQTXDJJYXMSZQAZDZFSLQXYJSJZYLBTXXWXQQZBJZUFBBLYLWDSLJHXJYZJWTDJCZFQZQZZDZSXZZQLZCDZFJHYSPYMPQZMLPPLFFXJJNZZYLSJEYQZFPFZKSYWJJJHRDJZZXTXXGLGHYDXCSKYSWMMZCWYBAZBJKSHFHJCXMHFQHYXXYZFTSJYZFXYXPZLCHMZMBXHZZSXYFYMNCWDABAZLXKTCSHHXKXJJZJSTHYGXSXYYHHHJWXKZXSSBZZWHHHCWTZZZPJXSNXQQJGZYZYWLLCWXZFXXYXYHXMKYYSWSQMNLNAYCYSPMJKHWCQHYLAJJMZXHMMCNZHBHXCLXTJPLTXYJHDYYLTTXFSZHYXXSJBJYAYRSMXYPLCKDUYHLXRLNLLSTYZYYQYGYHHSCCSMZCTZQXKYQFPYYRPFFLKQUNTSZLLZMWWTCQQYZWTLLMLMPWMBZSSTZRBPDDTLQJJBXZCSRZQQYGWCSXFWZLXCCRSZDZMCYGGDZQSGTJSWLJMYMMZYHFBJDGYXCCPSHXNZCSBSJYJGJMPPWAFFYFNXHYZXZYLREMZGZCYZSSZDLLJCSQFNXZKPTXZGXJJGFMYYYSNBTYLBNLHPFZDCYFBMGQRRSSSZXYSGTZRNYDZZCDGPJAFJFZKNZBLCZSZPSGCYCJSZLMLRSZBZZLDLSLLYSXSQZQLYXZLSKKBRXBRBZCYCXZZZEEYFGKLZLYYHGZSGZLFJHGTGWKRAAJYZKZQTSSHJJXDCYZUYJLZYRZDQQHGJZXSSZBYKJPBFRTJXLLFQWJHYLQTYMBLPZDXTZYGBDHZZRBGXHWNJTJXLKSCFSMWLSDQYSJTXKZSCFWJLBXFTZLLJZLLQBLSQMQQCGCZFPBPHZCZJLPYYGGDTGWDCFCZQYYYQYSSCLXZSKLZZZGFFCQNWGLHQYZJJCZLQZZYJPJZZBPDCCMHJGXDQDGDLZQMFGPSYTSDYFWWDJZJYSXYYCZCYHZWPBYKXRYLYBHKJKSFXTZJMMCKHLLTNYYMSYXYZPYJQYCSYCWMTJJKQYRHLLQXPSGTLYYCLJSCPXJYZFNMLRGJJTYZBXYZMSJYJHHFZQMSYXRSZCWTLRTQZSSTKXGQKGSPTGCZNJSJCQCXHMXGGZTQYDJKZDLBZSXJLHYQGGGTHQSZPYHJHHGYYGKGGCWJZZYLCZLXQSFTGZSLLLMLJSKCTBLLZZSZMMNYTPZSXQHJCJYQXYZXZQZCPSHKZZYSXCDFGMWQRLLQXRFZTLYSTCTMJCXJJXHJNXTNRZTZFQYHQGLLGCXSZSJDJLJCYDSJTLNYXHSZXCGJZYQPYLFHDJSBPCCZHJJJQZJQDYBSSLLCMYTTMQTBHJQNNYGKYRQYQMZGCJKPDCGMYZHQLLSLLCLMHOLZGDYYFZSLJCQZLYLZQJESHNYLLJXGJXLYSYYYXNBZLJSSZCQQCJYLLZLTJYLLZLLBNYLGQCHXYYXOXCXQKYJXXXYKLXSXXYQXCYKQXQCSGYXXYQXYGYTQOHXHXPYXXXULCYEYCHZZCBWQBBWJQZSCSZSSLZYLKDESJZWMYMCYTSDSXXSCJPQQSQYLYYZYCMDJDZYWCBTJSYDJKCYDDJLBDJJSODZYSYXQQYXDHHGQQYQHDYXWGMMMAJDYBBBPPBCMUUPLJZSMTXERXJMHQNUTPJDCBSSMSSSTKJTSSMMTRCPLZSZMLQDSDMJMQPNQDXCFYNBFSDQXYXHYAYKQYDDLQYYYSSZBYDSLNTFQTZQPZMCHDHCZCWFDXTMYQSPHQYYXSRGJCWTJTZZQMGWJJTJHTQJBBHWZPXXHYQFXXQYWYYHYSCDYDHHQMNMTMWCPBSZPPZZGLMZFOLLCFWHMMSJZTTDHZZYFFYTZZGZYSKYJXQYJZQBHMBZZLYGHGFMSHPZFZSNCLPBQSNJXZSLXXFPMTYJYGBXLLDLXPZJYZJYHHZCYWHJYLSJEXFSZZYWXKZJLUYDTMLYMQJPWXYHXSKTQJEZRPXXZHHMHWQPWQLYJJQJJZSZCPHJLCHHNXJLQWZJHBMZYXBDHHYPZLHLHLGFWLCHYYTLHJXCJMSCPXSTKPNHQXSRTYXXTESYJCTLSSLSTDLLLWWYHDHRJZSFGXTSYCZYNYHTDHWJSLHTZDQDJZXXQHGYLTZPHCSQFCLNJTCLZPFSTPDYNYLGMJLLYCQHYSSHCHYLHQYQTMZYPBYWRFQYKQSYSLZDQJMPXYYSSRHZJNYWTQDFZBWWTWWRXCWHGYHXMKMYYYQMSMZHNGCEPMLQQMTCWCTMMPXJPJJHFXYYZSXZHTYBMSTSYJTTQQQYYLHYNPYQZLCYZHZWSMYLKFJXLWGXYPJYTYSYXYMZCKTTWLKSMZSYLMPWLZWXWQZSSAQSYXYRHSSNTSRAPXCPWCMGDXHXZDZYFJHGZTTSBJHGYZSZYSMYCLLLXBTYXHBBZJKSSDMALXHYCFYGMQYPJYCQXJLLLJGSLZGQLYCJCCZOTYXMTMTTLLWTGPXYMZMKLPSZZZXHKQYSXCTYJZYHXSHYXZKXLZWPSQPYHJWPJPWXQQYLXSDHMRSLZZYZWTTCYXYSZZSHBSCCSTPLWSSCJCHNLCGCHSSPHYLHFHHXJSXYLLNYLSZDHZXYLSXLWZYKCLDYAXZCMDDYSPJTQJZLNWQPSSSWCTSTSZLBLNXSMNYYMJQBQHRZWTYYDCHQLXKPZWBGQYBKFCMZWPZLLYYLSZYDWHXPSBCMLJBSCGBHXLQHYRLJXYSWXWXZSLDFHLSLYNJLZYFLYJYCDRJLFSYZFSLLCQYQFGJYHYXZLYLMSTDJCYHBZLLNWLXXYGYYHSMGDHXXHHLZZJZXCZZZCYQZFNGWPYLCPKPYYPMCLQKDGXZGGWQBDXZZKZFBXXLZXJTPJPTTBYTSZZDWSLCHZHSLTYXHQLHYXXXYYZYSWTXZKHLXZXZPYHGCHKCFSYHUTJRLXFJXPTZTWHPLYXFCRHXSHXKYXXYHZQDXQWULHYHMJTBFLKHTXCWHJFWJCFPQRYQXCYYYQYGRPYWSGSUNGWCHKZDXYFLXXHJJBYZWTSXXNCYJJYMSWZJQRMHXZWFQSYLZJZGBHYNSLBGTTCSYBYXXWXYHXYYXNSQYXMQYWRGYQLXBBZLJSYLPSYTJZYHYZAWLRORJMKSCZJXXXYXCHDYXRYXXJDTSQFXLYLTSFFYXLMTYJMJUYYYXLTZCSXQZQHZXLYYXZHDNBRXXXJCTYHLBRLMBRLLAXKYLLLJLYXXLYCRYLCJTGJCMTLZLLCYZZPZPCYAWHJJFYBDYYZSMPCKZDQYQPBPCJPDCYZMDPBCYYDYCNNPLMTMLRMFMMGWYZBSJGYGSMZQQQZTXMKQWGXLLPJGZBQCDJJJFPKJKCXBLJMSWMDTQJXLDLPPBXCWRCQFBFQJCZAHZGMYKPHYYHZYKNDKZMBPJYXPXYHLFPNYYGXJDBKXNXHJMZJXSTRSTLDXSKZYSYBZXJLXYSLBZYSLHXJPFXPQNBYLLJQKYGZMCYZZYMCCSLCLHZFWFWYXZMWSXTYNXJHPYYMCYSPMHYSMYDYSHQYZCHMJJMZCAAGCFJBBHPLYZYLXXSDJGXDHKXXTXXNBHRMLYJSLTXMRHNLXQJXYZLLYSWQGDLBJHDCGJYQYCMHWFMJYBMBYJYJWYMDPWHXQLDYGPDFXXBCGJSPCKRSSYZJMSLBZZJFLJJJLGXZGYXYXLSZQYXBEXYXHGCXBPLDYHWETTWWCJMBTXCHXYQXLLXFLYXLLJLSSFWDPZSMYJCLMWYTCZPCHQEKCQBWLCQYDPLQPPQZQFJQDJHYMMCXTXDRMJWRHXCJZYLQXDYYNHYYHRSLSRSYWWZJYMTLTLLGTQCJZYABTCKZCJYCCQLJZQXALMZYHYWLWDXZXQDLLQSHGPJFJLJHJABCQZDJGTKHSSTCYJLPSWZLXZXRWGLDLZRLZXTGSLLLLZLYXXWGDZYGBDPHZPBRLWSXQBPFDWOFMWHLYPCBJCCLDMBZPBZZLCYQXLDOMZBLZWPDWYYGDSTTHCSQSCCRSSSYSLFYBFNTYJSZDFNDPDHDZZMBBLSLCMYFFGTJJQWFTMTPJWFNLBZCMMJTGBDZLQLPYFHYYMJYLSDCHDZJWJCCTLJCLDTLJJCPDDSQDSSZYBNDBJLGGJZXSXNLYCYBJXQYCBYLZCFZPPGKCXZDZFZTJJFJSJXZBNZYJQTTYJYHTYCZHYMDJXTTMPXSPLZCDWSLSHXYPZGTFMLCJTYCBPMGDKWYCYZCDSZZYHFLYCTYGWHKJYYLSJCXGYWJCBLLCSNDDBTZBSCLYZCZZSSQDLLMQYYHFSLQLLXFTYHABXGWNYWYYPLLSDLDLLBJCYXJZMLHLJDXYYQYTDLLLBUGBFDFBBQJZZMDPJHGCLGMJJPGAEHHBWCQXAXHHHZCHXYPHJAXHLPHJPGPZJQCQZGJJZZUZDMQYYBZZPHYHYBWHAZYJHYKFGDPFQSDLZMLJXKXGALXZDAGLMDGXMWZQYXXDXXPFDMMSSYMPFMDMMKXKSYZYSHDZKXSYSMMZZZMSYDNZZCZXFPLSTMZDNMXCKJMZTYYMZMZZMSXHHDCZJEMXXKLJSTLWLSQLYJZLLZJSSDPPMHNLZJCZYHMXXHGZCJMDHXTKGRMXFWMCGMWKDTKSXQMMMFZZYDKMSCLCMPCGMHSPXQPZDSSLCXKYXTWLWJYAHZJGZQMCSNXYYMMPMLKJXMHLMLQMXCTKZMJQYSZJSYSZHSYJZJCDAJZYBSDQJZGWZQQXFKDMSDJLFWEHKZQKJPEYPZYSZCDWYJFFMZZYLTTDZZEFMZLBNPPLPLPEPSZALLTYLKCKQZKGENQLWAGYXYDPXLHSXQQWQCQXQCLHYXXMLYCCWLYMQYSKGCHLCJNSZKPYZKCQZQLJPDMDZHLASXLBYDWQLWDNBQCRYDDZTJYBKBWSZDXDTNPJDTCTQDFXQQMGNXECLTTBKPWSLCTYQLPWYZZKLPYGZCQQPLLKCCYLPQMZCZQCLJSLQZDJXLDDHPZQDLJJXZQDXYZQKZLJCYQDYJPPYPQYKJYRMPCBYMCXKLLZLLFQPYLLLMBSGLCYSSLRSYSQTMXYXZQZFDZUYSYZTFFMZZSMZQHZSSCCMLYXWTPZGXZJGZGSJSGKDDHTQGGZLLBJDZLCBCHYXYZHZFYWXYZYMSDBZZYJGTSMTFXQYXQSTDGSLNXDLRYZZLRYYLXQHTXSRTZNGZXBNQQZFMYKMZJBZYMKBPNLYZPBLMCNQYZZZSJZHJCTZKHYZZJRDYZHNPXGLFZTLKGJTCTSSYLLGZRZBBQZZKLPKLCZYSSUYXBJFPNJZZXCDWXZYJXZZDJJKGGRSRJKMSMZJLSJYWQSKYHQJSXPJZZZLSNSHRNYPZTWCHKLPSRZLZXYJQXQKYSJYCZTLQZYBBYBWZPQDWWYZCYTJCJXCKCWDKKZXSGKDZXWWYYJQYYTCYTDLLXWKCZKKLCCLZCQQDZLQLCSFQCHQHSFSMQZZLNBJJZBSJHTSZDYSJQJPDLZCDCWJKJZZLPYCGMZWDJJBSJQZSYZYHHXJPBJYDSSXDZNCGLQMBTSFSBPDZDLZNFGFJGFSMPXJQLMBLGQCYYXBQKDJJQYRFKZTJDHCZKLBSDZCFJTPLLJGXHYXZCSSZZXSTJYGKGCKGYOQXJPLZPBPGTGYJZGHZQZZLBJLSQFZGKQQJZGYCZBZQTLDXRJXBSXXPZXHYZYCLWDXJJHXMFDZPFZHQHQMQGKSLYHTYCGFRZGNQXCLPDLBZCSCZQLLJBLHBZCYPZZPPDYMZZSGYHCKCPZJGSLJLNSCDSLDLXBMSTLDDFJMKDJDHZLZXLSZQPQPGJLLYBDSZGQLBZLSLKYYHZTTNTJYQTZZPSZQZTLLJTYYLLQLLQYZQLBDZLSLYYZYMDFSZSNHLXZNCZQZPBWSKRFBSYZMTHBLGJPMCZZLSTLXSHTCSYZLZBLFEQHLXFLCJLYLJQCBZLZJHHSSTBRMHXZHJZCLXFNBGXGTQJCZTMSFZKJMSSNXLJKBHSJXNTNLZDNTLMSJXGZJYJCZXYJYJWRWWQNZTNFJSZPZSHZJFYRDJSFSZJZBJFZQZZHZLXFYSBZQLZSGYFTZDCSZXZJBQMSZKJRHYJZCKMJKHCHGTXKXQGLXPXFXTRTYLXJXHDTSJXHJZJXZWZLCQSBTXWXGXTXXHXFTSDKFJHZYJFJXRZSDLLLTQSQQZQWZXSYQTWGWBZCGZLLYZBCLMQQTZHZXZXLJFRMYZFLXYSQXXJKXRMQDZDMMYYBSQBHGZMWFWXGMXLZPYYTGZYCCDXYZXYWGSYJYZNBHPZJSQSYXSXRTFYZGRHZTXSZZTHCBFCLSYXZLZQMZLMPLMXZJXSFLBYZMYQHXJSXRXSQZZZSSLYFRCZJRCRXHHZXQYDYHXSJJHZCXZBTYNSYSXJBQLPXZQPYMLXZKYXLXCJLCYSXXZZLXDLLLJJYHZXGYJWKJRWYHCPSGNRZLFZWFZZNSXGXFLZSXZZZBFCSYJDBRJKRDHHGXJLJJTGXJXXSTJTJXLYXQFCSGSWMSBCTLQZZWLZZKXJMLTMJYHSDDBXGZHDLBMYJFRZFSGCLYJBPMLYSMSXLSZJQQHJZFXGFQFQBPXZGYYQXGZTCQWYLTLGWSGWHRLFSFGZJMGMGBGTJFSYZZGZYZAFLSSPMLPFLCWBJZCLJJMZLPJJLYMQDMYYYFBGYGYZMLYZDXQYXRQQQHSYYYQXYLJTYXFSFSLLGNQCYHYCWFHCCCFXPYLYPLLZYXXXXXKQHHXSHJZCFZSCZJXCPZWHHHHHAPYLQALPQAFYHXDYLUKMZQGGGDDESRNNZLTZGCHYPPYSQJJHCLLJTOLNJPZLJLHYMHEYDYDSQYCDDHGZUNDZCLZYZLLZNTNYZGSLHSLPJJBDGWXPCDUTJCKLKCLWKLLCASSTKZZDNQNTTLYYZSSYSSZZRYLJQKCQDHHCRXRZYDGRGCWCGZQFFFPPJFZYNAKRGYWYQPQXXFKJTSZZXSWZDDFBBXTBGTZKZNPZZPZXZPJSZBMQHKCYXYLDKLJNYPKYGHGDZJXXEAHPNZKZTZCMXCXMMJXNKSZQNMNLWBWWXJKYHCPSTMCSQTZJYXTPCTPDTNNPGLLLZSJLSPBLPLQHDTNJNLYYRSZFFJFQWDPHZDWMRZCCLODAXNSSNYZRESTYJWJYJDBCFXNMWTTBYLWSTSZGYBLJPXGLBOCLHPCBJLTMXZLJYLZXCLTPNCLCKXTPZJSWCYXSFYSZDKNTLBYJCYJLLSTGQCBXRYZXBXKLYLHZLQZLNZCXWJZLJZJNCJHXMNZZGJZZXTZJXYCYYCXXJYYXJJXSSSJSTSSTTPPGQTCSXWZDCSYFPTFBFHFBBLZJCLZZDBXGCXLQPXKFZFLSYLTUWBMQJHSZBMDDBCYSCCLDXYCDDQLYJJWMQLLCSGLJJSYFPYYCCYLTJANTJJPWYCMMGQYYSXDXQMZHSZXPFTWWZQSWQRFKJLZJQQYFBRXJHHFWJJZYQAZMYFRHCYYBYQWLPEXCCZSTYRLTTDMQLYKMBBGMYYJPRKZNPBSXYXBHYZDJDNGHPMFSGMWFZMFQMMBCMZZCJJLCNUXYQLMLRYGQZCYXZLWJGCJCGGMCJNFYZZJHYCPRRCMTZQZXHFQGTJXCCJEAQCRJYHPLQLSZDJRBCQHQDYRHYLYXJSYMHZYDWLDFRYHBPYDTSSCNWBXGLPZMLZZTQSSCPJMXXYCSJYTYCGHYCJWYRXXLFEMWJNMKLLSWTXHYYYNCMMCWJDQDJZGLLJWJRKHPZGGFLCCSCZMCBLTBHBQJXQDSPDJZZGHGLFQYWBZYZJLTSTDHQHCTCBCHFLQMPWDSHYYTQWCNZZJTLBYMBPDYYYXSQKXWYYFLXXNCWCXYPMAELYKKJMZZZBRXYYQJFLJPFHHHYTZZXSGQQMHSPGDZQWBWPJHZJDYSCQWZKTXXSQLZYYMYSDZGRXCKKUJLWPYSYSCSYZLRMLQSYLJXBCXTLWDQZPCYCYKPPPNSXFYZJJRCEMHSZMSXLXGLRWGCSTLRSXBZGBZGZTCPLUJLSLYLYMTXMTZPALZXPXJTJWTCYYZLBLXBZLQMYLXPGHDSLSSDMXMBDZZSXWHAMLCZCPJMCNHJYSNSYGCHSKQMZZQDLLKABLWJXSFMOCDXJRRLYQZKJMYBYQLYHETFJZFRFKSRYXFJTWDSXXSYSQJYSLYXWJHSNLXYYXHBHAWHHJZXWMYLJCSSLKYDZTXBZSYFDXGXZJKHSXXYBSSXDPYNZWRPTQZCZENYGCXQFJYKJBZMLJCMQQXUOXSLYXXLYLLJDZBTYMHPFSTTQQWLHOKYBLZZALZXQLHZWRRQHLSTMYPYXJJXMQSJFNBXYXYJXXYQYLTHYLQYFMLKLJTMLLHSZWKZHLJMLHLJKLJSTLQXYLMBHHLNLZXQJHXCFXXLHYHJJGBYZZKBXSCQDJQDSUJZYYHZHHMGSXCSYMXFEBCQWWRBPYYJQTYZCYQYQQZYHMWFFHGZFRJFCDPXNTQYZPDYKHJLFRZXPPXZDBBGZQSTLGDGYLCQMLCHHMFYWLZYXKJLYPQHSYWMQQGQZMLZJNSQXJQSYJYCBEHSXFSZPXZWFLLBCYYJDYTDTHWZSFJMQQYJLMQXXLLDTTKHHYBFPWTYYSQQWNQWLGWDEBZWCMYGCULKJXTMXMYJSXHYBRWFYMWFRXYQMXYSZTZZTFYKMLDHQDXWYYNLCRYJBLPSXCXYWLSPRRJWXHQYPHTYDNXHHMMYWYTZCSQMTSSCCDALWZTCPQPYJLLQZYJSWXMZZMMYLMXCLMXCZMXMZSQTZPPQQBLPGXQZHFLJJHYTJSRXWZXSCCDLXTYJDCQJXSLQYCLZXLZZXMXQRJMHRHZJBHMFLJLMLCLQNLDXZLLLPYPSYJYSXCQQDCMQJZZXHNPNXZMEKMXHYKYQLXSXTXJYYHWDCWDZHQYYBGYBCYSCFGPSJNZDYZZJZXRZRQJJYMCANYRJTLDPPYZBSTJKXXZYPFDWFGZZRPYMTNGXZQBYXNBUFNQKRJQZMJEGRZGYCLKXZDSKKNSXKCLJSPJYYZLQQJYBZSSQLLLKJXTBKTYLCCDDBLSPPFYLGYDTZJYQGGKQTTFZXBDKTYYHYBBFYTYYBCLPDYTGDHRYRNJSPTCSNYJQHKLLLZSLYDXXWBCJQSPXBPJZJCJDZFFXXBRMLAZHCSNDLBJDSZBLPRZTSWSBXBCLLXXLZDJZSJPYLYXXYFTFFFBHJJXGBYXJPMMMPSSJZJMTLYZJXSWXTYLEDQPJMYGQZJGDJLQJWJQLLSJGJGYGMSCLJJXDTYGJQJQJCJZCJGDZZSXQGSJGGCXHQXSNQLZZBXHSGZXCXYLJXYXYYDFQQJHJFXDHCTXJYRXYSQTJXYEFYYSSYYJXNCYZXFXMSYSZXYYSCHSHXZZZGZZZGFJDLTYLNPZGYJYZYYQZPBXQBDZTZCZYXXYHHSQXSHDHGQHJHGYWSZTMZMLHYXGEBTYLZKQWYTJZRCLEKYSTDBCYKQQSAYXCJXWWGSBHJYZYDHCSJKQCXSWXFLTYNYZPZCCZJQTZWJQDZZZQZLJJXLSBHPYXXPSXSHHEZTXFPTLQYZZXHYTXNCFZYYHXGNXMYWXTZSJPTHHGYMXMXQZXTSBCZYJYXXTYYZYPCQLMMSZMJZZLLZXGXZAAJZYXJMZXWDXZSXZDZXLEYJJZQBHZWZZZQTZPSXZTDSXJJJZNYAZPHXYYSRNQDTHZHYYKYJHDZXZLSWCLYBZYECWCYCRYLCXNHZYDZYDYJDFRJJHTRSQTXYXJRJHOJYNXELXSFSFJZGHPZSXZSZDZCQZBYYKLSGSJHCZSHDGQGXYZGXCHXZJWYQWGYHKSSEQZZNDZFKWYSSTCLZSTSYMCDHJXXYWEYXCZAYDMPXMDSXYBSQMJMZJMTZQLPJYQZCGQHXJHHLXXHLHDLDJQCLDWBSXFZZYYSCHTYTYYBHECXHYKGJPXHHYZJFXHWHBDZFYZBCAPNPGNYDMSXHMMMMAMYNBYJTMPXYYMCTHJBZYFCGTYHWPHFTWZZEZSBZEGPFMTSKFTYCMHFLLHGPZJXZJGZJYXZSBBQSCZZLZCCSTPGXMJSFTCCZJZDJXCYBZLFCJSYZFGSZLYBCWZZBYZDZYPSWYJZXZBDSYUXLZZBZFYGCZXBZHZFTPBGZGEJBSTGKDMFHYZZJHZLLZZGJQZLSFDJSSCBZGPDLFZFZSZYZYZSYGCXSNXXCHCZXTZZLJFZGQSQYXZJQDCCZTQCDXZJYQJQCHXZTDLGSCXZSYQJQTZWLQDQZTQCHQQJZYEZZZPBWKDJFCJPZTYPQYQTTYNLMBDKTJZPQZQZZFPZSBNJLGYJDXJDZZKZGQKXDLPZJTCJDQBXDJQJSTCKNXBXZMSLYJCQMTJQWWCJQNJNLLLHJCWQTBZQYDZCZPZZDZYDDCYZZZCCJTTJFZDPRRTZTJDCQTQZDTJNPLZBCLLCTZSXKJZQZPZLBZRBTJDCXFCZDBCCJJLTQQPLDCGZDBBZJCQDCJWYNLLZYZCCDWLLXWZLXRXNTQQCZXKQLSGDFQTDDGLRLAJJTKUYMKQLLTZYTDYYCZGJWYXDXFRSKSTQTENQMRKQZHHQKDLDAZFKYPBGGPZREBZZYKZZSPEGJXGYKQZZZSLYSYYYZWFQZYLZZLZHWCHKYPQGNPGBLPLRRJYXCCSYYHSFZFYBZYYTGZXYLXCZWXXZJZBLFFLGSKHYJZEYJHLPLLLLCZGXDRZELRHGKLZZYHZLYQSZZJZQLJZFLNBHGWLCZCFJYSPYXZLZLXGCCPZBLLCYBBBBUBBCBPCRNNZCZYRBFSRLDCGQYYQXYGMQZWTZYTYJXYFWTEHZZJYWLCCNTZYJJZDEDPZDZTSYQJHDYMBJNYJZLXTSSTPHNDJXXBYXQTZQDDTJTDYYTGWSCSZQFLSHLGLBCZPHDLYZJYCKWTYTYLBNYTSDSYCCTYSZYYEBHEXHQDTWNYGYCLXTSZYSTQMYGZAZCCSZZDSLZCLZRQXYYELJSBYMXSXZTEMBBLLYYLLYTDQYSHYMRQWKFKBFXNXSBYCHXBWJYHTQBPBSBWDZYLKGZSKYHXQZJXHXJXGNLJKZLYYCDXLFYFGHLJGJYBXQLYBXQPQGZTZPLNCYPXDJYQYDYMRBESJYYHKXXSTMXRCZZYWXYQYBMCLLYZHQYZWQXDBXBZWZMSLPDMYSKFMZKLZCYQYCZLQXFZZYDQZPZYGYJYZMZXDZFYFYTTQTZHGSPCZMLCCYTZXJCYTJMKSLPZHYSNZLLYTPZCTZZCKTXDHXXTQCYFKSMQCCYYAZHTJPCYLZLYJBJXTPNYLJYYNRXSYLMMNXJSMYBCSYSYLZYLXJJQYLDZLPQBFZZBLFNDXQKCZFYWHGQMRDSXYCYTXNQQJZYYPFZXDYZFPRXEJDGYQBXRCNFYYQPGHYJDYZXGRHTKYLNWDZNTSMPKLBTHBPYSZBZTJZSZZJTYYXZPHSSZZBZCZPTQFZMYFLYPYBBJQXZMXXDJMTSYSKKBJZXHJCKLPSMKYJZCXTMLJYXRZZQSLXXQPYZXMKYXXXJCLJPRMYYGADYSKQLSNDHYZKQXZYZTCGHZTLMLWZYBWSYCTBHJHJFCWZTXWYTKZLXQSHLYJZJXTMPLPYCGLTBZZTLZJCYJGDTCLKLPLLQPJMZPAPXYZLKKTKDZCZZBNZDYDYQZJYJGMCTXLTGXSZLMLHBGLKFWNWZHDXUHLFMKYSLGXDTWWFRJEJZTZHYDXYKSHWFZCQSHKTMQQHTZHYMJDJSKHXZJZBZZXYMPAGQMSTPXLSKLZYNWRTSQLSZBPSPSGZWYHTLKSSSWHZZLYYTNXJGMJSZSUFWNLSOZTXGXLSAMMLBWLDSZYLAKQCQCTMYCFJBSLXCLZZCLXXKSBZQCLHJPSQPLSXXCKSLNHPSFQQYTXYJZLQLDXZQJZDYYDJNZPTUZDSKJFSLJHYLZSQZLBTXYDGTQFDBYAZXDZHZJNHHQBYKNXJJQCZMLLJZKSPLDYCLBBLXKLELXJLBQYCXJXGCNLCQPLZLZYJTZLJGYZDZPLTQCSXFDMNYCXGBTJDCZNBGBQYQJWGKFHTNPYQZQGBKPBBYZMTJDYTBLSQMPSXTBNPDXKLEMYYCJYNZCTLDYKZZXDDXHQSHDGMZSJYCCTAYRZLPYLTLKXSLZCGGEXCLFXLKJRTLQJAQZNCMBYDKKCXGLCZJZXJHPTDJJMZQYKQSECQZDSHHADMLZFMMZBGNTJNNLGBYJBRBTMLBYJDZXLCJLPLDLPCQDHLXZLYCBLCXZZJADJLNZMMSSSMYBHBSQKBHRSXXJMXSDZNZPXLGBRHWGGFCXGMSKLLTSJYYCQLTSKYWYYHYWXBXQYWPYWYKQLSQPTNTKHQCWDQKTWPXXHCPTHTWUMSSYHBWCRWXHJMKMZNGWTMLKFGHKJYLSYYCXWHYECLQHKQHTTQKHFZLDXQWYZYYDESBPKYRZPJFYYZJCEQDZZDLATZBBFJLLCXDLMJSSXEGYGSJQXCWBXSSZPDYZCXDNYXPPZYDLYJCZPLTXLSXYZYRXCYYYDYLWWNZSAHJSYQYHGYWWAXTJZDAXYSRLTDPSSYYFNEJDXYZHLXLLLZQZSJNYQYQQXYJGHZGZCYJCHZLYCDSHWSHJZYJXCLLNXZJJYYXNFXMWFPYLCYLLABWDDHWDXJMCXZTZPMLQZHSFHZYNZTLLDYWLSLXHYMMYLMBWWKYXYADTXYLLDJPYBPWUXJMWMLLSAFDLLYFLBHHHBQQLTZJCQJLDJTFFKMMMBYTHYGDCQRDDWRQJXNBYSNWZDBYYTBJHPYBYTTJXAAHGQDQTMYSTQXKBTZPKJLZRBEQQSSMJJBDJOTGTBXPGBKTLHQXJJJCTHXQDWJLWRFWQGWSHCKRYSWGFTGYGBXSDWDWRFHWYTJJXXXJYZYSLPYYYPAYXHYDQKXSHXYXGSKQHYWFDDDPPLCJLQQEEWXKSYYKDYPLTJTHKJLTCYYHHJTTPLTZZCDLTHQKZXQYSTEEYWYYZYXXYYSTTJKLLPZMCYHQGXYHSRMBXPLLNQYDQHXSXXWGDQBSHYLLPJJJTHYJKYPPTHYYKTYEZYENMDSHLCRPQFDGFXZPSFTLJXXJBSWYYSKSFLXLPPLBBBLBSFXFYZBSJSSYLPBBFFFFSSCJDSTZSXZRYYSYFFSYZYZBJTBCTSBSDHRTJJBYTCXYJEYLXCBNEBJDSYXYKGSJZBXBYTFZWGENYHHTHZHHXFWGCSTBGXKLSXYWMTMBYXJSTZSCDYQRCYTWXZFHMYMCXLZNSDJTTTXRYCFYJSBSDYERXJLJXBBDEYNJGHXGCKGSCYMBLXJMSZNSKGXFBNBPTHFJAAFXYXFPXMYPQDTZCXZZPXRSYWZDLYBBKTYQPQJPZYPZJZNJPZJLZZFYSBTTSLMPTZRTDXQSJEHBZYLZDHLJSQMLHTXTJECXSLZZSPKTLZKQQYFSYGYWPCPQFHQHYTQXZKRSGTTSQCZLPTXCDYYZXSQZSLXLZMYCPCQBZYXHBSXLZDLTCDXTYLZJYYZPZYZLTXJSJXHLPMYTXCQRBLZSSFJZZTNJYTXMYJHLHPPLCYXQJQQKZZSCPZKSWALQSBLCCZJSXGWWWYGYKTJBBZTDKHXHKGTGPBKQYSLPXPJCKBMLLXDZSTBKLGGQKQLSBKKTFXRMDKBFTPZFRTBBRFERQGXYJPZSSTLBZTPSZQZSJDHLJQLZBPMSMMSXLQQNHKNBLRDDNXXDHDDJCYYGYLXGZLXSYGMQQGKHBPMXYXLYTQWLWGCPBMQXCYZYDRJBHTDJYHQSHTMJSBYPLWHLZFFNYPMHXXHPLTBQPFBJWQDBYGPNZTPFZJGSDDTQSHZEAWZZYLLTYYBWJKXXGHLFKXDJTMSZSQYNZGGSWQSPHTLSSKMCLZXYSZQZXNCJDQGZDLFNYKLJCJLLZLMZZNHYDSSHTHZZLZZBBHQZWWYCRZHLYQQJBEYFXXXWHSRXWQHWPSLMSSKZTTYGYQQWRSLALHMJTQJSMXQBJJZJXZYZKXBYQXBJXSHZTSFJLXMXZXFGHKZSZGGYLCLSARJYHSLLLMZXELGLXYDJYTLFBHBPNLYZFBBHPTGJKWETZHKJJXZXXGLLJLSTGSHJJYQLQZFKCGNNDJSSZFDBCTWWSEQFHQJBSAQTGYPQLBXBMMYWXGSLZHGLZGQYFLZBYFZJFRYSFMBYZHQGFWZSYFYJJPHZBYYZFFWODGRLMFTWLBZGYCQXCDJYGZYYYYTYTYDWEGAZYHXJLZYYHLRMGRXXZCLHNELJJTJTPWJYBJJBXJJTJTEEKHWSLJPLPSFYZPQQBDLQJJTYYQLYZKDKSQJYYQZLDQTGJQYZJSUCMRYQTHTEJMFCTYHYPKMHYZWJDQFHYYXWSHCTXRLJHQXHCCYYYJLTKTTYTMXGTCJTZAYYOCZLYLBSZYWJYTSJYHBYSHFJLYGJXXTMZYYLTXXYPZLXYJZYZYYPNHMYMDYYLBLHLSYYQQLLNJJYMSOYQBZGDLYXYLCQYXTSZEGXHZGLHWBLJHEYXTWQMAKBPQCGYSHHEGQCMWYYWLJYJHYYZLLJJYLHZYHMGSLJLJXCJJYCLYCJPCPZJZJMMYLCQLNQLJQJSXYJMLSZLJQLYCMMHCFMMFPQQMFYLQMCFFQMMMMHMZNFHHJGTTHHKHSLNCHHYQDXTMMQDCYZYXYQMYQYLTDCYYYZAZZCYMZYDLZFFFMMYCQZWZZMABTBYZTDMNZZGGDFTYPCGQYTTSSFFWFDTZQSSYSTWXJHXYTSXXYLBYQHWWKXHZXWZNNZZJZJJQJCCCHYYXBZXZCYZTLLCQXYNJYCYYCYNZZQYYYEWYCZDCJYCCHYJLBTZYYCQWMPWPYMLGKDLDLGKQQBGYCHJXY",oMultiDiff={ +19969:"DZ",19975:"WM",19988:"QJ",20048:"YL",20056:"SC",20060:"NM",20094:"QG",20127:"QJ",20167:"QC",20193:"YG",20250:"KH",20256:"ZC",20282:"SC",20285:"QJG",20291:"TD",20314:"YD",20315:"BF",20340:"NE",20375:"TD",20389:"YJ",20391:"CZ",20415:"PB",20446:"YS",20447:"SQ",20504:"TC",20608:"KG",20854:"QJ",20857:"ZC",20911:"PF",20985:"AW",21032:"PB",21048:"XQ",21049:"SC",21089:"YS",21119:"JC",21242:"SB",21273:"SC",21305:"YP",21306:"QO",21330:"ZC",21333:"SDC",21345:"QK",21378:"CA",21397:"SC",21414:"XS",21442:"SC",21477:"JG",21480:"TD",21484:"ZS",21494:"YX",21505:"YX",21512:"HG",21523:"XH",21537:"PB",21542:"PF",21549:"KH",21571:"E",21574:"DA",21588:"TD",21589:"O",21618:"ZC",21621:"KHA",21632:"ZJ",21654:"KG",21679:"LKG",21683:"KH",21710:"A",21719:"YH",21734:"WOE",21769:"A",21780:"WN",21804:"XH",21834:"A",21899:"ZD",21903:"RN",21908:"WO",21939:"ZC",21956:"SA",21964:"YA",21970:"TD",22003:"A",22031:"JG",22040:"XS",22060:"ZC",22066:"ZC",22079:"MH",22129:"XJ",22179:"XA",22237:"NJ",22244:"TD",22280:"JQ",22300:"YH",22313:"XW",22331:"YQ",22343:"YJ",22351:"PH",22395:"DC",22412:"TD",22484:"PB",22500:"PB",22534:"ZD",22549:"DH",22561:"PB",22612:"TD",22771:"KQ",22831:"HB",22841:"JG",22855:"QJ",22865:"XQ",23013:"ML",23081:"WM",23487:"SX",23558:"QJ",23561:"YW",23586:"YW",23614:"YW",23615:"SN",23631:"PB",23646:"ZS",23663:"ZT",23673:"YG",23762:"TD",23769:"ZS",23780:"QJ",23884:"QK",24055:"XH",24113:"DC",24162:"ZC",24191:"GA",24273:"QJ",24324:"NL",24377:"TD",24378:"QJ",24439:"PF",24554:"ZS",24683:"TD",24694:"WE",24733:"LK",24925:"TN",25094:"ZG",25100:"XQ",25103:"XH",25153:"PB",25170:"PB",25179:"KG",25203:"PB",25240:"ZS",25282:"FB",25303:"NA",25324:"KG",25341:"ZY",25373:"WZ",25375:"XJ",25384:"A",25457:"A",25528:"SD",25530:"SC",25552:"TD",25774:"ZC",25874:"ZC",26044:"YW",26080:"WM",26292:"PB",26333:"PB",26355:"ZY",26366:"CZ",26397:"ZC",26399:"QJ",26415:"ZS",26451:"SB",26526:"ZC",26552:"JG",26561:"TD",26588:"JG",26597:"CZ",26629:"ZS",26638:"YL",26646:"XQ",26653:"KG",26657:"XJ",26727:"HG",26894:"ZC",26937:"ZS",26946:"ZC",26999:"KJ",27099:"KJ",27449:"YQ",27481:"XS",27542:"ZS",27663:"ZS",27748:"TS",27784:"SC",27788:"ZD",27795:"TD",27812:"O",27850:"PB",27852:"MB",27895:"SL",27898:"PL",27973:"QJ",27981:"KH",27986:"HX",27994:"XJ",28044:"YC",28065:"WG",28177:"SM",28267:"QJ",28291:"KH",28337:"ZQ",28463:"TL",28548:"DC",28601:"TD",28689:"PB",28805:"JG",28820:"QG",28846:"PB",28952:"TD",28975:"ZC",29100:"A",29325:"QJ",29575:"SL",29602:"FB",30010:"TD",30044:"CX",30058:"PF",30091:"YSP",30111:"YN",30229:"XJ",30427:"SC",30465:"SX",30631:"YQ",30655:"QJ",30684:"QJG",30707:"SD",30729:"XH",30796:"LG",30917:"PB",31074:"NM",31085:"JZ",31109:"SC",31181:"ZC",31192:"MLB",31293:"JQ",31400:"YX",31584:"YJ",31896:"ZN",31909:"ZY",31995:"XJ",32321:"PF",32327:"ZY",32418:"HG",32420:"XQ",32421:"HG",32438:"LG",32473:"GJ",32488:"TD",32521:"QJ",32527:"PB",32562:"ZSQ",32564:"JZ",32735:"ZD",32793:"PB",33071:"PF",33098:"XL",33100:"YA",33152:"PB",33261:"CX",33324:"BP",33333:"TD",33406:"YA",33426:"WM",33432:"PB",33445:"JG",33486:"ZN",33493:"TS",33507:"QJ",33540:"QJ",33544:"ZC",33564:"XQ",33617:"YT",33632:"QJ",33636:"XH",33637:"YX",33694:"WG",33705:"PF",33728:"YW",33882:"SR",34067:"WM",34074:"YW",34121:"QJ",34255:"ZC",34259:"XL",34425:"JH",34430:"XH",34485:"KH",34503:"YS",34532:"HG",34552:"XS",34558:"YE",34593:"ZL",34660:"YQ",34892:"XH",34928:"SC",34999:"QJ",35048:"PB",35059:"SC",35098:"ZC",35203:"TQ",35265:"JX",35299:"JX",35782:"SZ",35828:"YS",35830:"E",35843:"TD",35895:"YG",35977:"MH",36158:"JG",36228:"QJ",36426:"XQ",36466:"DC",36710:"JC",36711:"ZYG",36767:"PB",36866:"SK",36951:"YW",37034:"YX",37063:"XH",37218:"ZC",37325:"ZC",38063:"PB",38079:"TD",38085:"QY",38107:"DC",38116:"TD",38123:"YD",38224:"HG",38241:"XTC",38271:"ZC",38415:"YE",38426:"KH",38461:"YD",38463:"AE",38466:"PB",38477:"XJ",38518:"YT",38551:"WK",38585:"ZC",38704:"XS",38739:"LJ",38761:"GJ",38808:"SQ",39048:"JG",39049:"XJ",39052:"HG",39076:"CZ",39271:"XT",39534:"TD",39552:"TD",39584:"PB",39647:"SB",39730:"LG",39748:"TPB",40109:"ZQ",40479:"ND",40516:"HG",40536:"HG",40583:"QJ",40765:"YQ",40784:"QJ",40840:"YK",40863:"QJG"},_checkPYCh=function(ch){var uni=ch.charCodeAt(0);return uni>40869||uni<19968?ch:oMultiDiff[uni]?oMultiDiff[uni]:_ChineseFirstPY.charAt(uni-19968)},_mkPYRslt=function(arr,ignoreMulti){for(var arrRslt=[""],k,multiLen=0,i=0,len=arr.length;i14||ignoreMulti){var tmpStr=str.substring(0,1);for(k=0;k0&&(this._items[0]=lastElt,this._sinkDown(0)),elt}},push:function(item){this._items[this._size++]=item,this._bubbleUp(this._size-1)},size:function(){return this._size},peek:function(){if(0!==this._size)return this._items[0]},_heapify:function(){for(var index=Math.floor((this._size+1)/2);index>=0;index--)this._sinkDown(index)},_bubbleUp:function(index){for(var elt=this._items[index];index>0;){var parentIndex=Math.floor((index+1)/2)-1,parentElt=this._items[parentIndex];if(this._comparator(parentElt,elt))return;this._items[parentIndex]=elt,this._items[index]=parentElt,index=parentIndex}},_sinkDown:function(index){for(var elt=this._items[index];;){var leftChildIndex=2*(index+1)-1,rightChildIndex=2*(index+1),swapIndex=-1;if(leftChildIndex=0;--i)xs[i]=0;return xs},ceilLog2=function(x){for(var y=1;y0;--i)this._heap[i]=this._heap[2*i]+this._heap[2*i+1]},BI.PrefixIntervalTree.prototype={constructor:BI.PrefixIntervalTree,set:function(index,value){var node=this._half+index;for(this._heap[node]=value,node=parent(node);0!==node;node=parent(node))this._heap[node]=this._heap[2*node]+this._heap[2*node+1]},get:function(index){var node=this._half+index;return this._heap[node]},getSize:function(){return this._size},sumUntil:function(end){if(0===end)return 0;for(var node=this._half+end-1,sum=this._heap[node];1!==node;node=parent(node))node%2===1&&(sum+=this._heap[node-1]);return sum},sumTo:function(inclusiveEnd){return this.sumUntil(inclusiveEnd+1)},sum:function(begin,end){return this.sumUntil(end)-this.sumUntil(begin)},greatestLowerBound:function(t){if(t<0)return-1;var node=1;if(this._heap[node]<=t)return this._size;for(;node=0;--i)xs[i]=initialValue;return new BI.PrefixIntervalTree(xs)},BI.PrefixIntervalTree.empty=function(size){return BI.PrefixIntervalTree.uniform(size,0)}}(),!function(){BI.Queue=function(capacity){this.capacity=capacity,this.array=[]},BI.Queue.prototype={constructor:BI.Queue,contains:function(v){return BI.contains(this.array,v)},indexOf:function(v){return BI.contains(this.array,v)},getElementByIndex:function(index){return this.array[index]},push:function(v){this.array.push(v),this.capacity&&this.array.length>this.capacity&&this.array.shift()},pop:function(){this.array.pop()},shift:function(){this.array.shift()},unshift:function(v){this.array.unshift(v),this.capacity&&this.array.length>this.capacity&&this.array.pop()},remove:function(v){BI.remove(this.array,v)},splice:function(){this.array.splice.apply(this.array,arguments)},slice:function(){this.array.slice.apply(this.array,arguments)},size:function(){return this.array.length},each:function(fn,scope){var scope=scope||window,fn=fn||null;if(null!=fn&&"function"==typeof fn)for(var i=0;i0?{children:children}:{})},toJSON:function(node){var self=this,result=[];return BI.each((node||this.root).getChildren(),function(i,child){result.push(self._toJSON(child))}),result},_toJSONWithNode:function(node){var self=this,children=[];return BI.each(node.getChildren(),function(i,child){children.push(self._toJSONWithNode(child))}),BI.extend({id:node.id},BI.deepClone(node.get("data")),{node:node},children.length>0?{children:children}:{})},toJSONWithNode:function(node){var self=this,result=[];return BI.each((node||this.root).getChildren(),function(i,child){result.push(self._toJSONWithNode(child))}),result},search:function(root,target,param){if(!(root instanceof BI.Node))return arguments.callee.apply(this,[this.root,root,target]);var self=this,next=null;return BI.isNull(target)?null:BI.isEqual(root[param||"id"],target)?root:(BI.any(root.getChildren(),function(i,child){if(next=self.search(child,target,param),null!==next)return!0}),next)},_traverse:function(node,callback){var queue=[];for(queue.push(node);!BI.isEmpty(queue);){var temp=queue.shift(),b=callback&&callback(temp);if(b===!1)break;b!==!0&&null!=temp&&(queue=queue.concat(temp.getChildren()))}},traverse:function(callback){this._traverse(this.root,callback)},_recursion:function(node,route,callback){var self=this;return BI.every(node.getChildren(),function(i,child){var next=BI.clone(route);next.push(child.id);var b=callback&&callback(child,next);return b!==!1&&(b===!0||self._recursion(child,next,callback))})},recursion:function(callback){this._recursion(this.root,[],callback)},inOrderTraverse:function(callback){this._inOrderTraverse(this.root,callback)},_inOrderTraverse:function(node,callback){null!=node&&(this._inOrderTraverse(node.getLeft()),callback&&callback(node),this._inOrderTraverse(node.getRight()))},nrInOrderTraverse:function(callback){for(var stack=[],node=this.root;null!=node||!BI.isEmpty(stack);){for(;null!=node;)stack.push(node),node=node.getLeft();node=stack.pop(),callback&&callback(node),node=node.getRight()}},preOrderTraverse:function(callback){this._preOrderTraverse(this.root,callback)},_preOrderTraverse:function(node,callback){null!=node&&(callback&&callback(node),this._preOrderTraverse(node.getLeft()),this._preOrderTraverse(node.getRight()))},nrPreOrderTraverse:function(callback){for(var stack=[],node=this.root;null!=node||!BI.isEmpty(stack);){for(;null!=node;)callback&&callback(node),stack.push(node),node=node.getLeft();node=stack.pop(),node=node.getRight()}},postOrderTraverse:function(callback){this._postOrderTraverse(this.root,callback)},_postOrderTraverse:function(node,callback){null!=node&&(this._postOrderTraverse(node.getLeft()),this._postOrderTraverse(node.getRight()),callback&&callback(node))},nrPostOrderTraverse:function(callback){for(var stack=[],node=this.root,preNode=null;null!=node||!BI.isEmpty(stack);){for(;null!=node;)stack.push(node),node=node.getLeft();node=BI.last(stack),null==node.getRight()||node.getRight()==preNode?(callback&&callback(node),node=stack.pop(),preNode=node,node=null):node=node.getRight()}}},BI.Node=function(id){BI.isObject(id)?BI.extend(this,id):this.id=id,this.clear.apply(this,arguments)},BI.Node.prototype={constructor:BI.Node,set:function(key,value){return BI.isObject(key)?void BI.extend(this,key):void(this[key]=value)},get:function(key){return this[key]},isLeaf:function(){return BI.isEmpty(this.children)},getChildren:function(){return this.children},getChildrenLength:function(){return this.children.length},getFirstChild:function(){return BI.first(this.children)},getLastChild:function(){return BI.last(this.children)},setLeft:function(left){this.left=left},getLeft:function(){return this.left},setRight:function(right){this.right=right},getRight:function(){return this.right},setParent:function(parent){this.parent=parent},getParent:function(){return this.parent},getChild:function(index){return this.children[index]},getChildIndex:function(id){return BI.findIndex(this.children,function(i,ch){return ch.get("id")===id})},removeChild:function(id){this.removeChildByIndex(this.getChildIndex(id))},removeChildByIndex:function(index){var before=this.getChild(index-1),behind=this.getChild(index+1);null!=before&&before.setRight(behind||null),null!=behind&&behind.setLeft(before||null),this.children.splice(index,1)},removeAllChilds:function(){this.children=[]},addChild:function(child,index){var cur=null;cur=BI.isUndefined(index)?this.children.length-1:index-1,child.setParent(this),cur>=0&&(this.getChild(cur)&&this.getChild(cur).setRight(child),child.setLeft(this.getChild(cur))),BI.isUndefined(index)?this.children.push(child):this.children.splice(index,0,child)},equals:function(obj){return this===obj||this.id===obj.id},clear:function(){this.parent=null,this.left=null,this.right=null,this.children=[]}},BI.extend(BI.Tree,{transformToArrayFormat:function(nodes,pId){if(!nodes)return[];var r=[];if(BI.isArray(nodes))for(var i=0,l=nodes.length;i=this.x&&x<=this.x+this.w&&y>=this.y&&y<=this.y+this.h)},getPosition:function(){var pos=[];return pos.push(this.x+this.w/2),pos.push(this.y+this.h/2),pos}},BI.BehaviorFactory={createBehavior:function(key,options){var behavior;switch(key){case"highlight":behavior=BI.HighlightBehavior;break;case"redmark":behavior=BI.RedMarkBehavior}return new behavior(options)}},BI.Behavior=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Behavior.superclass._defaultConfig.apply(this,arguments),{rule:function(){return!0}})},_init:function(){BI.Behavior.superclass._init.apply(this,arguments)},doBehavior:function(){}}),BI.Layout=BI.inherit(BI.Widget,{props:function(){return{scrollable:null,scrollx:!1,scrolly:!1,items:[]}},render:function(){this._init4Margin(),this._init4Scroll()},_init4Margin:function(){this.options.top&&this.element.css("top",this.options.top),this.options.left&&this.element.css("left",this.options.left),this.options.bottom&&this.element.css("bottom",this.options.bottom),this.options.right&&this.element.css("right",this.options.right)},_init4Scroll:function(){switch(this.options.scrollable){case!0:this.element.css("overflow","auto");break;case!1:this.element.css("overflow","hidden")}this.options.scrollx&&this.element.css({"overflow-x":"auto","overflow-y":"hidden"}),this.options.scrolly&&this.element.css({"overflow-x":"hidden","overflow-y":"auto"})},appendFragment:function(frag){this.element.append(frag)},_mountChildren:function(){var self=this,frag=BI.Widget._renderEngine.createFragment(),hasChild=!1;BI.each(this._children,function(i,widget){widget.element!==self.element&&(frag.appendChild(widget.element[0]),hasChild=!0)}),hasChild===!0&&this.appendFragment(frag)},_getChildName:function(index){return index+""},_addElement:function(i,item,context){var self=this,w;return this.hasWidget(this._getChildName(i))?w=this.getWidgetByName(this._getChildName(i)):(w=BI.createWidget(item,context),w.on(BI.Events.DESTROY,function(){BI.each(self._children,function(name,child){child===w&&(BI.remove(self._children,child),self.removeItemAt(0|name))})}),this.addWidget(this._getChildName(i),w)),w},_getOptions:function(item){return item instanceof BI.Widget&&(item=item.options),item=BI.stripEL(item),item instanceof BI.Widget&&(item=item.options),item},_compare:function(item1,item2){function eq(a,b,aStack,bStack){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;var className=Object.prototype.toString.call(a);switch(className){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var areArrays="[object Array]"===className;if(!areArrays){if(BI.isFunction(a)&&BI.isFunction(b))return!0;a=self._getOptions(a),b=self._getOptions(b)}aStack=aStack||[],bStack=bStack||[];for(var length=aStack.length;length--;)if(aStack[length]===a)return bStack[length]===b;if(aStack.push(a),bStack.push(b),areArrays){if(length=a.length,length!==b.length)return!1;for(;length--;)if(!eq(a[length],b[length],aStack,bStack))return!1}else{var keys=_.keys(a),key;if(length=keys.length,_.keys(b).length!==length)return!1;for(;length--;)if(key=keys[length],!_.has(b,key)||!eq(a[key],b[key],aStack,bStack))return!1}return aStack.pop(),bStack.pop(),!0}var self=this;return eq(item1,item2)},_getWrapper:function(){return this.element},_addItemAt:function(index,item){for(var i=this.options.items.length;i>index;i--)this._children[this._getChildName(i)]=this._children[this._getChildName(i-1)];delete this._children[this._getChildName(index)],this.options.items.splice(index,0,item)},_removeItemAt:function(index){for(var i=index;ithis.options.items.length)){this._addItemAt(index,item);var w=this._addElement(index,item);return index>0?this._children[this._getChildName(index-1)].element.after(w.element):w.element.prependTo(this._getWrapper()),w._mount(),w}},removeItemAt:function(indexes){indexes=BI.isArray(indexes)?indexes:[indexes];for(var deleted=[],newItems=[],newChildren={},i=0,len=this.options.items.length;ithis.options.items.length-1)return!1;var child=this._children[this._getChildName(index)];return child.shouldUpdate?child.shouldUpdate(this._getOptions(item))===!0:null},updateItemAt:function(index,item){if(!(index<0||index>this.options.items.length-1)){ +var child=this._children[this._getChildName(index)],updated;if(updated=child.update(this._getOptions(item)))return updated;var del=this._children[this._getChildName(index)];delete this._children[this._getChildName(index)],this.options.items.splice(index,1);var w=this._addElement(index,item);this.options.items.splice(index,0,item),this._children[this._getChildName(index)]=w,index>0?this._children[this._getChildName(index-1)].element.after(w.element):w.element.prependTo(this._getWrapper()),del._destroy(),w._mount()}},addItems:function(items,context){var self=this,o=this.options,fragment=BI.Widget._renderEngine.createFragment(),added=[];BI.each(items,function(i,item){var w=self._addElement(o.items.length,item,context);self._children[self._getChildName(o.items.length)]=w,o.items.push(item),added.push(w),fragment.appendChild(w.element[0])}),this._isMounted&&(this._getWrapper().append(fragment),BI.each(added,function(i,w){w._mount()}))},prependItems:function(items,context){var self=this;items=items||[];for(var fragment=BI.Widget._renderEngine.createFragment(),added=[],i=items.length-1;i>=0;i--){this._addItemAt(0,items[i]);var w=this._addElement(0,items[i],context);self._children[self._getChildName(0)]=w,this.options.items.unshift(items[i]),added.push(w),fragment.appendChild(w.element[0])}this._isMounted&&(this._getWrapper().prepend(fragment),BI.each(added,function(i,w){w._mount()}))},getValue:function(){var self=this,value=[],child;return BI.each(this.options.items,function(i){if(child=self._children[self._getChildName(i)]){var v=child.getValue();v=BI.isArray(v)?v:[v],value=value.concat(v)}}),value},setValue:function(v){var self=this,child;BI.each(this.options.items,function(i){(child=self._children[self._getChildName(i)])&&child.setValue(v)})},setText:function(v){var self=this,child;BI.each(this.options.items,function(i){(child=self._children[self._getChildName(i)])&&child.setText(v)})},patchItem:function(oldVnode,vnode,index){var shouldUpdate=this.shouldUpdateItem(index,vnode);if(shouldUpdate===!0||null===shouldUpdate&&!this._compare(oldVnode,vnode))return this.updateItemAt(index,vnode)},updateChildren:function(oldCh,newCh){function sameVnode(vnode1,vnode2,oldIndex,newIndex){return vnode1=self._getOptions(vnode1),vnode2=self._getOptions(vnode2),BI.isKey(vnode1.key)?vnode1.key===vnode2.key:oldIndex>=0?oldIndex===newIndex:void 0}function addNode(vnode,index){var opt=self._getOptions(vnode),key=null==opt.key?self._getChildName(index):opt.key;return children[key]=self._addElement(key,vnode)}function addVnodes(before,vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var node=addNode(vnodes[startIdx],startIdx);insertBefore(node,before,!1,startIdx)}}function removeVnodes(vnodes,startIdx,endIdx){for(;startIdx<=endIdx;++startIdx){var ch=vnodes[startIdx];if(BI.isNotNull(ch)){var node=self._getOptions(ch),key=null==node.key?self._getChildName(startIdx):node.key;delete self._children[self._getChildName(key)],children[key]._destroy()}}}function insertBefore(insert,before,isNext,index){insert=self._getOptions(insert),before=before&&self._getOptions(before);var insertKey=BI.isKey(insert.key)?insert.key:self._getChildName(index);if(before&&children[before.key]){var beforeKey=BI.isKey(before.key)?before.key:self._getChildName(index),next;next=isNext?children[beforeKey].element.next():children[beforeKey].element,next.length>0?next.before(children[insertKey].element):self._getWrapper().append(children[insertKey].element)}else self._getWrapper().append(children[insertKey].element)}function findOldVnode(vnodes,vNode,beginIdx,endIdx){var i,found;for(i=beginIdx;i<=endIdx;++i)vnodes[i]&&sameVnode(vnodes[i],vNode)&&(found=vnodes[i]);return found}var self=this,oldStartIdx=0,newStartIdx=0,oldEndIdx=oldCh.length-1,oldStartVnode=oldCh[0],oldEndVnode=oldCh[oldEndIdx],newEndIdx=newCh.length-1,newStartVnode=newCh[0],newEndVnode=newCh[newEndIdx],before,updated,children={};for(BI.each(oldCh,function(i,child){child=self._getOptions(child);var key=null==child.key?i:child.key;BI.isKey(key)&&(children[key]=self._children[self._getChildName(i)])});oldStartIdx<=oldEndIdx&&newStartIdx<=newEndIdx;)if(BI.isNull(oldStartVnode))oldStartVnode=oldCh[++oldStartIdx];else if(BI.isNull(oldEndVnode))oldEndVnode=oldCh[--oldEndIdx];else if(sameVnode(oldStartVnode,newStartVnode,oldStartIdx,newStartIdx))updated=this.patchItem(oldStartVnode,newStartVnode,oldStartIdx)||updated,children[null==oldStartVnode.key?this._getChildName(oldStartIdx):oldStartVnode.key]=this._children[this._getChildName(oldStartIdx)],oldStartVnode=oldCh[++oldStartIdx],newStartVnode=newCh[++newStartIdx];else if(sameVnode(oldEndVnode,newEndVnode,oldEndIdx,newEndIdx))updated=this.patchItem(oldEndVnode,newEndVnode,oldEndIdx)||updated,children[null==oldEndVnode.key?this._getChildName(oldEndIdx):oldEndVnode.key]=this._children[this._getChildName(oldEndIdx)],oldEndVnode=oldCh[--oldEndIdx],newEndVnode=newCh[--newEndIdx];else if(sameVnode(oldStartVnode,newEndVnode))updated=this.patchItem(oldStartVnode,newEndVnode,oldStartIdx)||updated,children[null==oldStartVnode.key?this._getChildName(oldStartIdx):oldStartVnode.key]=this._children[this._getChildName(oldStartIdx)],insertBefore(oldStartVnode,oldEndVnode,!0),oldStartVnode=oldCh[++oldStartIdx],newEndVnode=newCh[--newEndIdx];else if(sameVnode(oldEndVnode,newStartVnode))updated=this.patchItem(oldEndVnode,newStartVnode,oldEndIdx)||updated,children[null==oldEndVnode.key?this._getChildName(oldEndIdx):oldEndVnode.key]=this._children[this._getChildName(oldEndIdx)],insertBefore(oldEndVnode,oldStartVnode),oldEndVnode=oldCh[--oldEndIdx],newStartVnode=newCh[++newStartIdx];else{var sameOldVnode=findOldVnode(oldCh,newStartVnode,oldStartIdx,oldEndIdx);if(BI.isNull(sameOldVnode)){var node=addNode(newStartVnode);insertBefore(node,oldStartVnode),newStartVnode=newCh[++newStartIdx]}else BI.each(oldCh,function(index,child){child&&sameVnode(child,newStartVnode)&&(updated=self.patchItem(sameOldVnode,newStartVnode,index)||updated,children[null==sameOldVnode.key?self._getChildName(index):sameOldVnode.key]=self._children[self._getChildName(index)],oldCh[index]=void 0,insertBefore(sameOldVnode,oldStartVnode))}),newStartVnode=newCh[++newStartIdx]}return oldStartIdx>oldEndIdx?(before=BI.isNull(newCh[newEndIdx+1])?null:newCh[newEndIdx+1],addVnodes(before,newCh,newStartIdx,newEndIdx)):newStartIdx>newEndIdx&&removeVnodes(oldCh,oldStartIdx,oldEndIdx),this._children={},BI.each(newCh,function(i,child){var node=self._getOptions(child),key=null==node.key?self._getChildName(i):node.key;children[key]._mount(),self._children[self._getChildName(i)]=children[key]}),updated},update:function(opt){var o=this.options,items=opt.items||[],updated=this.updateChildren(o.items,items);return this.options.items=items,updated},stroke:function(items){var self=this;BI.each(items,function(i,item){item&&self._addElement(i,item)})},removeWidget:function(nameOrWidget){var removeIndex;BI.isWidget(nameOrWidget)?BI.each(this._children,function(name,child){child===nameOrWidget&&(removeIndex=name)}):removeIndex=nameOrWidget,removeIndex&&this._removeItemAt(0|removeIndex)},empty:function(){BI.Layout.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.Layout.superclass.destroy.apply(this,arguments),this.options.items=[]},populate:function(items){var self=this,o=this.options;return items=items||[],this._isMounted?void this.update({items:items}):(this.options.items=items,void this.stroke(items))},resize:function(){}}),BI.shortcut("bi.layout",BI.Layout),BI.Plugin=BI.Plugin||{},!function(){var _WidgetsPlugin={},_ObjectPlugin={},_ConfigPlugin={},_GlobalWidgetConfigFn,_GlobalObjectConfigFn;BI.extend(BI.Plugin,{getWidget:function(type,options){if(_GlobalWidgetConfigFn&&_GlobalWidgetConfigFn(type,options),_ConfigPlugin[type])for(var i=_ConfigPlugin[type].length-1;i>=0;i--)_ConfigPlugin[type][i](options);if(_WidgetsPlugin[type])for(var res,i=_WidgetsPlugin[type].length-1;i>=0;i--)if(res=_WidgetsPlugin[type][i](options))return res;return options},config:function(widgetConfigFn,objectConfigFn){_GlobalWidgetConfigFn=widgetConfigFn,_GlobalObjectConfigFn=objectConfigFn},configWidget:function(type,fn){_ConfigPlugin[type]||(_ConfigPlugin[type]=[]),_ConfigPlugin[type].push(fn)},registerWidget:function(type,fn){_WidgetsPlugin[type]||(_WidgetsPlugin[type]=[]),_WidgetsPlugin[type].length>0&&console.log("组件已经注册过了!"),_WidgetsPlugin[type].push(fn)},relieveWidget:function(type){delete _WidgetsPlugin[type]},getObject:function(type,object){if(_GlobalObjectConfigFn&&_GlobalObjectConfigFn(type,object),_ObjectPlugin[type])for(var res,i=0,len=_ObjectPlugin[type].length;i0&&console.log("对象已经注册过了!"),_ObjectPlugin[type].push(fn)},relieveObject:function(type){delete _ObjectPlugin[type]}})}(),BI.Action=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.Action.superclass._defaultConfig.apply(this,arguments),{src:null,tar:null})},_init:function(){BI.Action.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){},actionBack:function(tar,src,callback){}}),BI.ActionFactory={createAction:function(key,options){var action;switch(key){case"show":action=BI.ShowAction}return new action(options)}},BI.ShowAction=BI.inherit(BI.Action,{_defaultConfig:function(){return BI.extend(BI.ShowAction.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ShowAction.superclass._init.apply(this,arguments)},actionPerformed:function(src,tar,callback){tar=tar||this.options.tar,tar.setVisible(!0),callback&&callback()},actionBack:function(tar,src,callback){tar=tar||this.options.tar,tar.setVisible(!1),callback&&callback()}}),function(){function isEmpty(value){var result=""===value||null===value||void 0===value;return result}function isInvalidDate(date){return"Invalid Date"==date||"NaN"==date}function _eFormat(text,fmt){function eFormat(num,format){var neg=num<0?(num*=-1,"-"):"",magnitudeNeg="",funcName=num>0&&num<1?"floor":"ceil",magnitude=Math[funcName](Math.log(num)/Math.log(10));if(!isFinite(magnitude))return format.replace(/#/gi,"").replace(/\.e/gi,"E");num/=Math.pow(10,magnitude),num>0&&num<1&&(num*=10,magnitude-=1);var integerLen=getInteger(magnitude,format);integerLen>1&&(magnitude-=integerLen-1,num*=Math.pow(10,integerLen-1)),magnitude<0&&(magnitudeNeg="-",magnitude*=-1);var precision=getPrecision(format),isValueCarry=isValueCarried(num);return num*=Math.pow(10,precision),num=Math.round(num),isValueCarry&&(num/=10,magnitude+="-"===magnitudeNeg?-1:1),num/=Math.pow(10,precision),num=num.toFixed(precision),magnitude=formatExponential(format,magnitude,magnitudeNeg),neg+num+"E"+magnitude}function formatExponential(format,num,magnitudeNeg){if(num+="",!/e/gi.test(format))return num;for(format=format.split(/e/gi)[1];num.length1?arr[1].length:0}function getInteger(magnitude,format){if(!/e/gi.test(format))return 0;var formatLeft=format.split(/e/gi)[0].split(".")[0],i,f,len=formatLeft.length,valueLeftLen=0;for(i=0;i-1)return text>=0?_numberFormat(text+"",format.substring(0,numMod)):_numberFormat(-text+"",format.substr(numMod+1));if(+text<0&&"-"!==format.charAt(0))return _numberFormat(-text+"","-"+format);var fp=format.split("."),fleft=fp[0]||"",fright=fp[1]||"";text=_dealNumberPrecision(text,fright);var tp=text.split("."),tleft=tp[0]||"",tright=tp[1]||"";if(/[%‰]$/.test(format)){var paddingZero=/[%]$/.test(format)?"00":"000";tright+=paddingZero,tleft+=tright.substr(0,paddingZero.length),tleft=tleft.replace(/^0+/gi,""),tright=tright.substr(paddingZero.length).replace(/0+$/gi,"")}var right=_dealWithRight(tright,fright);right.leftPlus&&(tleft=parseInt(tleft)+1+"",tleft=isNaN(tleft)?"1":tleft),right=right.num;var left=_dealWithLeft(tleft,fleft);return/[0-9]/.test(left)||(left+="0"),/[0-9]/.test(right)?left+"."+right:left+right}function _dealWithRight(tright,fright){for(var right="",j=0,i=0,len=fright.length;i4){result.leftPlus=!0;var numReg=right.match(/^[0-9]+/);if(numReg){var num=numReg[0],orilen=num.length,newnum=parseInt(num)+1+"";newnum.length>orilen?newnum=newnum.substr(1):(newnum=BI.leftPad(newnum,orilen,"0"),result.leftPlus=!1),right=right.replace(/^[0-9]+/,newnum)}}return result.num=right,result}function _dealWithLeft(tleft,fleft){for(var left="",j=tleft.length-1,combo=-1,last=-1,i=fleft.length-1;i>=0;i--){var ch=fleft.charAt(i),c=tleft.charAt(j);switch(ch){case"0":isEmpty(c)&&(c="0"),last=-1,left=c+left,j--;break;case"#":last=i,left=c+left,j--;break;case",":if(!isEmpty(c)){var com=fleft.match(/,[#0]+/);com&&(combo=com[0].length-1),left=","+left}break;default:left=ch+left}}if(last>-1){var tll=tleft.substr(0,j+1);left=left.substr(0,last)+tll+left.substr(last)}if(combo>0){var res=left.match(/[0-9]+,/);if(res){res=res[0];for(var newstr="",n=res.length-1-combo;n>=0;n-=combo)newstr=res.substr(n,combo)+","+newstr;var lres=res.substr(0,n+combo);isEmpty(lres)||(newstr=lres+","+newstr)}left=left.replace(/[0-9]+,/,newstr)}return left}var _global;_global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,_global.BI||(_global.BI={}),BI.cjkEncode=function(text){if("string"!=typeof text)return text;for(var newText="",i=0;i=128||91===code||93===code?"["+code.toString(16)+"]":text.charAt(i)}return newText},BI.cjkDecode=function(text){if(null==text)return"";if(!isNaN(text)||text.indexOf("[")==-1)return text;for(var newText="",i=0;ii+1){var subText=text.substring(i+1,rightIdx);subText.length>0&&(ch=String.fromCharCode(eval("0x"+subText))),i=rightIdx}}newText+=ch}return newText};var SPECIAL_TAGS={"&":"&",'"':""","<":"<",">":">"," ":" "};BI.htmlEncode=function(text){return BI.isNull(text)?"":BI.replaceAll(text+"",'&|"|<|>|\\s',function(v){return SPECIAL_TAGS[v]?SPECIAL_TAGS[v]:" "})},BI.htmlDecode=function(text){return BI.isNull(text)?"":BI.replaceAll(text+"","&|"|<|>| ",function(v){switch(v){case"&":return"&";case""":return'"';case"<":return"<";case">":return">";case" ":default:return" "}})},BI.cjkEncodeDO=function(o){if(BI.isPlainObject(o)){var result={};return _.each(o,function(v,k){"string"!=typeof v&&(v=BI.jsonEncode(v)),k=BI.cjkEncode(k),result[k]=BI.cjkEncode(v)}),result}return o},BI.jsonEncode=function(o){var useHasOwn=!!{}.hasOwnProperty,m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},encodeString=function(s){return/["\\\x00-\x1f]/.test(s)?'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];return c?c:(c=b.charCodeAt(),"\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16))})+'"':'"'+s+'"'},encodeArray=function(o){var a=["["],b,i,l=o.length,v;for(i=0;i2?BI.Date._MN[date.getMonth()]:len<2?date.getMonth()+1:BI.leftPad(date.getMonth()+1+"",2,"0");break;case"d":str=len>1?BI.leftPad(date.getDate()+"",2,"0"):date.getDate();break;case"h":var hour=date.getHours()%12;0===hour&&(hour=12),str=len>1?BI.leftPad(hour+"",2,"0"):hour;break;case"H":str=len>1?BI.leftPad(date.getHours()+"",2,"0"):date.getHours();break;case"m":str=len>1?BI.leftPad(date.getMinutes()+"",2,"0"):date.getMinutes();break;case"s":str=len>1?BI.leftPad(date.getSeconds()+"",2,"0"):date.getSeconds();break;case"a":str=date.getHours()<12?"am":"pm";break;case"z":str=BI.getTimezone(date);break;default:str=jfmt.str}return str}if(!date)return"";var len=format.length,result="";if(len>0){for(var flagch=format.charAt(0),start=0,str=flagch,i=1;iBI.Widget._renderEngine.createElement("body").outerWidth()&&(x-=tooltip.element.outerWidth()+15);var bodyHeight=BI.Widget._renderEngine.createElement("body").outerHeight();return y+tooltip.element.outerHeight()>bodyHeight||top+tooltip.element.outerHeight()>bodyHeight?(y-=tooltip.element.outerHeight()+15,!opt.belowMouse&&(y=Math.min(y,offset.top-tooltip.element.outerHeight()-5))):!opt.belowMouse&&(y=Math.max(y,top)),tooltip.element.css({left:x<0?0:x+"px",top:y<0?0:y+"px"}),tooltip.element.hover(function(){self.remove(name),context.element.trigger("mouseleave.title"+context.getName())}),this},add:function(name,bubble){return this.has(name)?this:(this.set(name,bubble),this)},get:function(name){return this.tooltipsManager[name]},set:function(name,bubble){this.tooltipsManager[name]=bubble},has:function(name){return null!=this.tooltipsManager[name]},remove:function(name){return this.has(name)?(this.tooltipsManager[name].destroy(),delete this.tooltipsManager[name],this):this}}),_.extend(BI,{Events:{KEYDOWN:"_KEYDOWN",BACKSPACE:"_BACKSPACE",SPACE:"_SPACE",ENTER:"_ENTER",CONFIRM:"_CONFIRM",ERROR:"_ERROR",PAUSE:"_PAUSE",DESTROY:"_DESTROY",MOUNT:"_MOUNT",UNMOUNT:"_UNMOUNT",CLEAR:"_CLEAR",ADD:"_ADD",EDITING:"_EDITING",EMPTY:"_EMPTY",VIEW:"_VIEW",RESIZE:"_RESIZE",BEFOREEDIT:"_BEFOREEDIT",AFTEREDIT:"_AFTEREDIT",STARTEDIT:"_STARTEDIT",STOPEDIT:"_STOPEDIT",CHANGE:"_CHANGE",EXPAND:"_EXPAND",COLLAPSE:"_COLLAPSE",CALLBACK:"_CALLBACK",CLICK:"_CLICK",STATECHANGE:"_STATECHANGE",BEFORESTATECHANGE:"_BEFORESTATECHANGE",INIT:"_INIT",AFTERINIT:"_AFTERINIT",SCROLL:"_SCROLL",STARTLOAD:"_STARTLOAD",AFTERLOAD:"_AFTERLOAD",BS:"beforesubmit",AS:"aftersubmit",SC:"submitcomplete",SF:"submitfailure",SS:"submitsuccess",BVW:"beforeverifywrite",AVW:"afterverifywrite",AV:"afterverify",BW:"beforewrite",AW:"afterwrite",WS:"writesuccess",WF:"writefailure",BA:"beforeappend",AA:"afterappend",BD:"beforedelete",AD:"beforedelete",UC:"unloadcheck",BTOPDF:"beforetopdf",ATOPDF:"aftertopdf",BTOEXCEL:"beforetoexcel",ATOEXCEL:"aftertoexcel",BTOWORD:"beforetoword",ATOWORD:"aftertoword",BTOIMAGE:"beforetoimage",ATOIMAGE:"aftertoimage",BTOHTML:"beforetohtml",ATOHTML:"aftertohtml",BIMEXCEL:"beforeimportexcel",AIMEXCEL:"afterimportexcel",BPDFPRINT:"beforepdfprint",APDFPRINT:"afterpdfprint",BFLASHPRINT:"beforeflashprint",AFLASHPRINT:"afterflashprint",BAPPLETPRINT:"beforeappletprint",AAPPLETPRINT:"afterappletprint",BSEVERPRINT:"beforeserverprint",ASERVERPRINT:"afterserverprint",BEMAIL:"beforeemail",AEMAIL:"afteremail"}}),_.extend(BI,{pushArray:function(sArray,array){for(var i=0;imonthDay&&(day=monthDay),dt.setDate(day),dt.setMonth(dt.getMonth()+3*parseInt(n)),dt},getQuarterStartMonth:function(date){var quarterStartMonth=0,nowMonth=date.getMonth();return nowMonth<3&&(quarterStartMonth=0),28&&(quarterStartMonth=9),quarterStartMonth},getQuarterStartDate:function(date){return BI.getDate(date.getFullYear(),BI.getQuarterStartMonth(date),1)},getQuarterEndDate:function(date){var quarterEndMonth=BI.getQuarterStartMonth(date)+2;return BI.getDate(date.getFullYear(),quarterEndMonth,BI.getMonthDays(date,quarterEndMonth))},getOffsetMonth:function(date,n){var dt=BI.getDate(BI.getTime(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds())),day=dt.getDate(),monthDay=BI.getMonthDays(BI.getDate(dt.getFullYear(),dt.getMonth()+parseInt(n),1));return day>monthDay&&(day=monthDay),dt.setDate(day),dt.setMonth(dt.getMonth()+parseInt(n)),dt},getWeekStartDate:function(date){var w=date.getDay(),startOfWeek=BI.StartOfWeek%7;return BI.getOffsetDate(date,BI.Date._OFFSET[w=12,ir=pm?hr-12:hr,dy=BI.getDayOfYear(date);0==ir&&(ir=12);var min=date.getMinutes(),sec=date.getSeconds();s["%a"]=BI.Date._SDN[w],s["%A"]=BI.Date._DN[w],s["%b"]=BI.Date._SMN[m],s["%B"]=BI.Date._MN[m],s["%C"]=1+Math.floor(y/100),s["%d"]=d<10?"0"+d:d,s["%e"]=d,s["%H"]=hr<10?"0"+hr:hr,s["%I"]=ir<10?"0"+ir:ir,s["%j"]=dy<100?dy<10?"00"+dy:"0"+dy:dy,s["%k"]=hr+"",s["%l"]=ir+"",s["%X"]=m<9?"0"+(1+m):1+m,s["%x"]=m+1,s["%M"]=min<10?"0"+min:min,s["%n"]="\n",s["%p"]=pm?"PM":"AM",s["%P"]=pm?"pm":"am",s["%s"]=Math.floor(date.getTime()/1e3),s["%S"]=sec<10?"0"+sec:sec,s["%t"]="\t",s["%U"]=s["%W"]=s["%V"]=wn<10?"0"+wn:wn,s["%u"]=w+1,s["%w"]=w,s["%y"]=yWith4number.substr(2,2),s["%Y"]=yWith4number,s["%%"]="%",s["%Q"]=qr;var re=/%./g;if(BI.isKhtml=BI.isKhtml||function(){return!!_global.navigator&&/Konqueror|Safari|KHTML/i.test(navigator.userAgent)},!(str.indexOf("%Y")===-1&&str.indexOf("%y")===-1||str.indexOf("%W")===-1&&str.indexOf("%U")===-1&&str.indexOf("%V")===-1))switch(wn){case 1:11===m&&(s["%y"]=parseInt(s["%y"])+1,s["%Y"]=parseInt(s["%Y"])+1);break;case 53:0===m&&(s["%y"]=parseInt(s["%y"])-1,s["%Y"]=parseInt(s["%Y"])-1)}if(!BI.isKhtml())return str.replace(re,function(par){return s[par]||par});for(var a=str.match(re),i=0;i-1?text===keyword?isArray?matched.push(item):matched[i]=item:isArray?find.push(item):find[i]=item:(pidx=py.indexOf(keyword),pidx>-1&&Math.floor(pidx/text.length)===Math.floor((pidx+keyword.length-1)/text.length)&&(text===keyword||keyword.length===text.length?isArray?matched.push(item):matched[i]=item:isArray?find.push(item):find[i]=item))}}),{match:matched,find:find}}}),_.extend(BI,{beforeFunc:function(sFunc,func){var __self=sFunc;return function(){return func.apply(sFunc,arguments)!==!1&&__self.apply(sFunc,arguments)}},afterFunc:function(sFunc,func){var __self=sFunc;return function(){var ret=__self.apply(sFunc,arguments);return ret!==!1&&(func.apply(sFunc,arguments),ret)}}}),_.extend(BI,{add:function(num,arg){function accAdd(arg1,arg2){var r1,r2,m,c;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}if(c=Math.abs(r1-r2),m=Math.pow(10,Math.max(r1,r2)),c>0){var cm=Math.pow(10,c);r1>r2?(arg1=Number(arg1.toString().replace(".","")),arg2=Number(arg2.toString().replace(".",""))*cm):(arg1=Number(arg1.toString().replace(".",""))*cm,arg2=Number(arg2.toString().replace(".","")))}else arg1=Number(arg1.toString().replace(".","")),arg2=Number(arg2.toString().replace(".",""));return(arg1+arg2)/m}return accAdd(arg,num)},sub:function(num,arg){function accSub(arg1,arg2){var r1,r2,m,n;try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}return m=Math.pow(10,Math.max(r1,r2)),n=r1>=r2?r1:r2,((arg1*m-arg2*m)/m).toFixed(n)}return accSub(num,arg)},mul:function(num,arg){function accMul(arg1,arg2){var m=0,s1=arg1.toString(),s2=arg2.toString();try{m+=s1.split(".")[1].length}catch(e){}try{m+=s2.split(".")[1].length}catch(e){}return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m)}return accMul(arg,num)},div:function(num,arg){function digitLength(num){var eSplit=num.toString().split(/[eE]/),len=(eSplit[0].split(".")[1]||"").length-+(eSplit[1]||0);return len>0?len:0}function float2Fixed(num){if(num.toString().indexOf("e")===-1)return Number(num.toString().replace(".",""));var dLen=digitLength(num);return dLen>0?num*Math.pow(10,dLen):num}function times(num1,num2){for(var others=[],_i=2;_i0)return times.apply(void 0,[times(num1,num2),others[0]].concat(others.slice(1)));var num1Changed=float2Fixed(num1),num2Changed=float2Fixed(num2),baseNum=digitLength(num1)+digitLength(num2),leftValue=num1Changed*num2Changed;return leftValue/Math.pow(10,baseNum)}function accDivide(num1,num2){for(var others=[],_i=2;_i0)return accDivide.apply(void 0,[accDivide(num1,num2),others[0]].concat(others.slice(1)));var num1Changed=float2Fixed(num1),num2Changed=float2Fixed(num2);return times(num1Changed/num2Changed,Math.pow(10,digitLength(num2)-digitLength(num1)))}return accDivide(num,arg)}}),_.extend(BI,{startWith:function(str,startTag){return str=str||"",!(null==startTag||""==startTag||0===str.length||startTag.length>str.length)&&str.substr(0,startTag.length)==startTag},endWith:function(str,endTag){return!(null==endTag||""==endTag||0===str.length||endTag.length>str.length)&&str.substring(str.length-endTag.length)==endTag},getQuery:function(str,name){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)"),r=str.substr(str.indexOf("?")+1).match(reg);return r?unescape(r[2]):null},appendQuery:function(str,paras){if(!paras)return str;var src=str;return src.indexOf("?")===-1&&(src+="?"),src.endWith("?")!==!1||(src+="&"),_.each(paras,function(value,name){"string"==typeof name&&(src+=name+"="+value+"&")}),src=src.substr(0,src.length-1)},replaceAll:function(str,s1,s2){return str.replace(new RegExp(s1,"gm"),s2)},perfectStart:function(str,start){return str.startWith(start)?str:start+str},allIndexOf:function(str,sub){if("string"!=typeof sub)return[];for(var location=[],offset=0;str.length>0;){var loc=str.indexOf(sub);if(loc===-1)break;location.push(offset+loc),str=str.substring(loc+sub.length,str.length),offset+=loc+sub.length}return location}}),!function(){var i18nStore={};_.extend(BI,{addI18n:function(i18n){BI.extend(i18nStore,i18n)},i18nText:function(key){var localeText=i18nStore[key]||BI.i18n&&BI.i18n[key]||"";localeText||(localeText=key);var len=arguments.length;if(len>1){if(!(localeText.indexOf("{R1}")>-1)){var args=Array.prototype.slice.call(arguments),count=1;return BI.replaceAll(localeText,"\\{\\s*\\}",function(){return args[count++]+""})}for(var i=1;i1?v.toString():v[0]:v,BI.isNull(v))throw new Error("value cannot be null");var cardName=o.cardNameCreator(v);if(!o.cardLayout.isCardExisted(cardName)){var card=o.cardCreator(cardName);o.cardLayout.addCardByName(cardName,card),o.afterCardCreated(cardName)}o.cardLayout.showCardByName(cardName),BI.nextTick(function(){o.afterCardShow(cardName),self.fireEvent(BI.ShowListener.EVENT_CHANGE,cardName)})}})}}),BI.ShowListener.EVENT_CHANGE="EVENT_CHANGE",BI.StyleLoaderManager=BI.inherit(BI.OB,{_defaultConfig:function(){return BI.extend(BI.StyleLoaderManager.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.StyleLoaderManager.superclass._init.apply(this,arguments),this.stylesManager={}},loadStyle:function(name,styleString){if(_global.document){var d=document,styles=d.createElement("style");return d.getElementsByTagName("head")[0].appendChild(styles),styles.setAttribute("type","text/css"),styles.styleSheet?styles.styleSheet.cssText=styleString:styles.appendChild(document.createTextNode(styleString)),this.stylesManager[name]=styles,this}},get:function(name){return this.stylesManager[name]},has:function(name){return null!=this.stylesManager[name]},removeStyle:function(name){return this.has(name)?(this.stylesManager[name].parentNode.removeChild(this.stylesManager[name]),delete this.stylesManager[name],this):this}}),BI.Logic=BI.inherit(BI.OB,{createLogic:function(){return this.options||{}}}),BI.LogicFactory={Type:{Vertical:"vertical",Horizontal:"horizontal",Table:"table",HorizontalFill:"horizontal_fill"},createLogic:function(key,options){var logic;switch(key){case BI.LogicFactory.Type.Vertical:logic=BI.VerticalLayoutLogic;break;case BI.LogicFactory.Type.Horizontal:logic=BI.HorizontalLayoutLogic;break;case BI.LogicFactory.Type.Table:logic=BI.TableLayoutLogic;break;case BI.LogicFactory.Type.HorizontalFill:logic=BI.HorizontalFillLayoutLogic;break;default:logic=BI.Logic}return new logic(options).createLogic()},createLogicTypeByDirection:function(direction){switch(direction){case BI.Direction.Top:case BI.Direction.Bottom:case BI.Direction.Custom:return BI.LogicFactory.Type.Vertical;case BI.Direction.Left:case BI.Direction.Right:return BI.LogicFactory.Type.Horizontal}},createLogicItemsByDirection:function(direction){var layout,items=Array.prototype.slice.call(arguments,1);switch(items=BI.map(items,function(i,item){return BI.isWidget(item)?{el:item,width:item.options.width,height:item.options.height}:item}),direction){case BI.Direction.Bottom:layout=BI.LogicFactory.Type.Vertical,items.reverse();break;case BI.Direction.Right:layout=BI.LogicFactory.Type.Horizontal,items.reverse();break;case BI.Direction.Custom:items=items.slice(1)}return items}},BI.VerticalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.VerticalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.vertical":"bi.vtape",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.VerticalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.vertical_adapt":"bi.htape",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.HorizontalLayoutLogic.superclass._init.apply(this,arguments)}}),BI.TableLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.TableLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,columns:0,rows:0,columnSize:[],rowSize:[],hgap:0,vgap:0,items:[]})},createLogic:function(){var layout,o=this.options;return layout=o.dynamic?"bi.table":"bi.window",{type:layout,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,columns:o.columns,rows:o.rows,columnSize:o.columnSize,rowSize:o.rowSize,hgap:o.hgap,vgap:o.vgap,items:o.items}},_init:function(){BI.TableLayoutLogic.superclass._init.apply(this,arguments)}}),BI.HorizontalFillLayoutLogic=BI.inherit(BI.Logic,{_defaultConfig:function(){return BI.extend(BI.HorizontalFillLayoutLogic.superclass._defaultConfig.apply(this,arguments),{dynamic:!1,scrollable:null,scrolly:!1,scrollx:!1,items:[],hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},createLogic:function(){var layout,o=this.options,columnSize=[];return BI.each(o.items,function(i,item){columnSize.push(item.width||0)}),layout=o.dynamic?"bi.horizontal_adapt":"bi.htape",{type:layout,columnSize:columnSize,scrollable:o.scrollable,scrolly:o.scrolly,scrollx:o.scrollx,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},_init:function(){BI.HorizontalFillLayoutLogic.superclass._init.apply(this,arguments)}}),BI.prepares.push(function(){var _isSupportFlex,isSupportFlex=function(){return null==_isSupportFlex&&(_isSupportFlex=!(!BI.isSupportCss3||!BI.isSupportCss3("flex"))),_isSupportFlex};BI.Plugin.registerWidget("bi.horizontal",function(ob){var isIE=BI.isIE(),supportFlex=isSupportFlex(),isLessIE8=isIE&&BI.getIEVersion()<8;return ob.verticalAlign===BI.VerticalAlign.Middle&&ob.horizontalAlign===BI.HorizontalAlign.Center?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):ob.verticalAlign===BI.VerticalAlign.Middle&&ob.horizontalAlign===BI.HorizontalAlign.Left?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):ob.verticalAlign===BI.VerticalAlign.Top&&ob.horizontalAlign===BI.HorizontalAlign.Center?isLessIE8?ob:BI.extend(ob,{type:"bi.table_adapt"}):isIE?ob:supportFlex?BI.extend(ob,{type:"bi.flex_horizontal"}):BI.extend(ob,{type:"bi.table_adapt"})}),BI.Plugin.registerWidget("bi.center_adapt",function(ob){var isIE=BI.isIE(),supportFlex=isSupportFlex(),justOneItem=ob.items&&ob.items.length<=1;return!isIE&&supportFlex&&justOneItem?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend(ob,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(ob,{type:"bi.flex_center_adapt"}):justOneItem?BI.extend(ob,{type:"bi.inline_center_adapt"}):ob}),BI.Plugin.registerWidget("bi.vertical_adapt",function(ob){ +var isIE=BI.isIE(),supportFlex=isSupportFlex();return!isIE&&supportFlex?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend({},ob,{type:"bi.flex_scrollable_vertical_center_adapt"}):BI.extend(ob,{type:"bi.flex_vertical_center_adapt"}):BI.extend(ob,{type:"bi.inline_vertical_adapt"})}),BI.Plugin.registerWidget("bi.horizontal_adapt",function(ob){return ob.items&&ob.items.length<=1?BI.extend(ob,{type:"bi.horizontal_auto"}):ob}),BI.Plugin.registerWidget("bi.float_center_adapt",function(ob){return!BI.isIE()&&isSupportFlex()?ob.scrollable===!0||ob.scrollx===!0||ob.scrolly===!0?BI.extend({},ob,{type:"bi.flex_scrollable_center_adapt"}):BI.extend(ob,{type:"bi.flex_center_adapt"}):BI.extend(ob,{type:"bi.inline_center_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal"})}),BI.Plugin.registerWidget("bi.flex_vertical",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical"})}),BI.Plugin.registerWidget("bi.flex_horizontal_adapt",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_horizontal_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_horizontal_adapt"})}),BI.Plugin.registerWidget("bi.flex_vertical_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_vertical_adapt"})}),BI.Plugin.registerWidget("bi.flex_center_adapt",function(ob){if(ob.scrollable===!0||ob.scrolly===!0||ob.scrollx===!0)return BI.extend({},ob,{type:"bi.flex_scrollable_center_adapt"})}),BI.Plugin.registerWidget("bi.radio",function(ob){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(ob,{type:"bi.image_radio"}):ob}),BI.Plugin.registerWidget("bi.checkbox",function(ob){return BI.isIE()&&BI.getIEVersion()<9?BI.extend(ob,{type:"bi.image_checkbox"}):ob}),BI.Plugin.registerWidget("bi.half_icon_button",function(ob){return BI.isIE()&&BI.getIEVersion()<9?ob:BI.extend(ob,{type:"bi.half_button"})})}),!function(){var attachEvent=_global.document&&_global.document.attachEvent,stylesCreated=!1;if(_global.document&&!attachEvent){var requestFrame=function(){var raf=_global.requestAnimationFrame||_global.mozRequestAnimationFrame||_global.webkitRequestAnimationFrame||function(fn){return _global.setTimeout(fn,20)};return function(fn){return raf(fn)}}(),cancelFrame=function(){var cancel=_global.cancelAnimationFrame||_global.mozCancelAnimationFrame||_global.webkitCancelAnimationFrame||_global.clearTimeout;return function(id){return cancel(id)}}(),resetTriggers=function(element){var triggers=element.__resizeTriggers__,expand=triggers.firstElementChild,contract=triggers.lastElementChild,expandChild=expand.firstElementChild;contract.scrollLeft=contract.scrollWidth,contract.scrollTop=contract.scrollHeight,expandChild.style.width=expand.offsetWidth+1+"px",expandChild.style.height=expand.offsetHeight+1+"px",expand.scrollLeft=expand.scrollWidth,expand.scrollTop=expand.scrollHeight},checkTriggers=function(element){return element.offsetWidth!==element.__resizeLast__.width||element.offsetHeight!==element.__resizeLast__.height},scrollListener=function(e){var element=this;resetTriggers(this),this.__resizeRAF__&&cancelFrame(this.__resizeRAF__),this.__resizeRAF__=requestFrame(function(){checkTriggers(element)&&(element.__resizeLast__.width=element.offsetWidth,element.__resizeLast__.height=element.offsetHeight,element.__resizeListeners__.forEach(function(fn){fn.call(element,e)}))})},animation=!1,animationstring="animation",keyframeprefix="",animationstartevent="animationstart",domPrefixes="Webkit Moz O ms".split(" "),startEvents="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),pfx="",elm=document.createElement("fakeelement");if(void 0!==elm.style.animationName&&(animation=!0),animation===!1)for(var i=0;i div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',head=document.head||document.getElementsByTagName("head")[0],style=document.createElement("style");style.type="text/css",style.styleSheet?style.styleSheet.cssText=css:style.appendChild(document.createTextNode(css)),head.appendChild(style),stylesCreated=!0}},addResizeListener=function(element,fn){attachEvent?(element.attachEvent("onresize",fn),BI.nextTick(fn)):(element.__resizeTriggers__||("static"===getComputedStyle(element).position&&(element.style.position="relative"),createStyles(),element.__resizeLast__={},element.__resizeListeners__=[],(element.__resizeTriggers__=document.createElement("div")).className="resize-triggers",element.__resizeTriggers__.innerHTML='
    ',element.appendChild(element.__resizeTriggers__),resetTriggers(element),element.addEventListener("scroll",scrollListener,!0),animationstartevent&&element.__resizeTriggers__.addEventListener(animationstartevent,function(e){e.animationName===animationName&&resetTriggers(element)})),element.__resizeListeners__.push(fn))},removeResizeListener=function(element,fn){attachEvent?element.detachEvent("onresize",fn):(element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn),1),element.__resizeListeners__.length||(element.removeEventListener("scroll",scrollListener),element.__resizeTriggers__=!element.removeChild(element.__resizeTriggers__)))};BI.ResizeDetector={addResizeListener:function(widget,fn){return addResizeListener(widget.element[0],fn),function(){removeResizeListener(widget.element[0],fn)}},removeResizeListener:function(widget,fn){removeResizeListener(widget.element[0],fn)}}}(),!function(){BI.DOM={},BI.extend(BI.DOM,{ready:function(fn){BI.Widget._renderEngine.createElement(document).ready(fn)}}),BI.extend(BI.DOM,{patchProps:function(fromElement,toElement){var elemData=BI.jQuery._data(fromElement[0]),events=elemData.events;BI.each(events,function(eventKey,event){BI.each(event,function(i,handler){toElement.on(eventKey+(handler.namespace?"."+handler.namespace:""),handler)})});var fromChildren=fromElement.children(),toChildren=toElement.children();if(fromChildren.length!==toChildren.length)throw new Error("不匹配");BI.each(fromChildren,function(i,child){BI.DOM.patchProps(BI.jQuery(child),BI.jQuery(toChildren[i]))}),BI.each(fromElement.data("__widgets"),function(i,widget){widget.element=toElement})},hang:function(doms){if(!BI.isEmpty(doms)){var frag=BI.Widget._renderEngine.createFragment();return BI.each(doms,function(i,dom){dom instanceof BI.Widget&&(dom=dom.element),dom instanceof BI.$&&dom[0]&&frag.appendChild(dom[0])}),frag}},isExist:function(obj){return BI.Widget._renderEngine.createElement("body").find(obj.element).length>0},preloadImages:function(srcArray,onload){function complete(){count++,count>=srcArray.length&&onload()}var count=0,images=[];BI.each(srcArray,function(i,src){images[i]=new Image,images[i].src=src,images[i].onload=function(){complete()},images[i].onerror=function(){complete()}})},getTextSizeWidth:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var width=span.width();return span.remove(),width},getTextSizeHeight:function(text,fontSize){var span=BI.Widget._renderEngine.createElement("").addClass("text-width-span").appendTo("body");null==fontSize&&(fontSize=12),fontSize+="px",span.css("font-size",fontSize).text(text);var height=span.height();return span.remove(),height},getScrollWidth:function(){if(BI.isNull(this._scrollWidth)||0===this._scrollWidth){var ul=BI.Widget._renderEngine.createElement("
    ").width(50).height(50).css({position:"absolute",top:"-9999px",overflow:"scroll"}).appendTo("body");this._scrollWidth=ul[0].offsetWidth-ul[0].clientWidth,ul.destroy()}return this._scrollWidth},getImage:function(param,fillStyle,backgroundColor){var canvas=document.createElement("canvas"),ratio=2;BI.Widget._renderEngine.createElement("body").append(canvas);var ctx=canvas.getContext("2d");ctx.font="12px Georgia";var w=ctx.measureText(param).width+4;canvas.width=w*ratio,canvas.height=16*ratio,ctx.font=12*ratio+"px Georgia",ctx.fillStyle=fillStyle||"#3685f2",ctx.textBaseline="middle",ctx.fillText(param,2*ratio,9*ratio),BI.Widget._renderEngine.createElement(canvas).destroy();var backColor=backgroundColor||"rgba(54, 133, 242, 0.1)";return{width:w,height:16,src:canvas.toDataURL("image/png"),style:"background-color: "+backColor+";vertical-align: middle; margin: 0 1px; width:"+w+"px;height: 16px; max-width:"+w+"px;max-height: 16px; min-width:"+w+"px;min-height: 16px",param:param}}}),BI.extend(BI.DOM,{isColor:function(color){return color&&(this.isRGBColor(color)||this.isHexColor(color))},isRGBColor:function(color){return!!color&&"rgb"===color.substr(0,3)},isHexColor:function(color){return!!color&&("#"===color[0]&&7===color.length)},isDarkColor:function(hex){if(!hex||!this.isHexColor(hex))return!1;var rgb=this.rgb2json(this.hex2rgb(hex)),grayLevel=Math.round(.299*rgb.r+.587*rgb.g+.114*rgb.b);return grayLevel<192},getContrastColor:function(color){return color&&this.isColor(color)?this.isDarkColor(color)?"#ffffff":"#1a1a1a":""},rgb2hex:function(rgbColour){if(!rgbColour||"rgb"!=rgbColour.substr(0,3))return"";var rgbValues=rgbColour.match(/\d+(\.\d+)?/g),red=BI.parseInt(rgbValues[0]),green=BI.parseInt(rgbValues[1]),blue=BI.parseInt(rgbValues[2]),hexColour="#"+this.int2hex(red)+this.int2hex(green)+this.int2hex(blue);return hexColour},rgb2json:function(rgbColour){if(!rgbColour)return{};if(!this.isRGBColor(rgbColour))return{};var rgbValues=rgbColour.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(rgbValues[0]),g:BI.parseInt(rgbValues[1]),b:BI.parseInt(rgbValues[2])}},rgba2json:function(rgbColour){if(!rgbColour)return{};var rgbValues=rgbColour.match(/\d+(\.\d+)?/g);return{r:BI.parseInt(rgbValues[0]),g:BI.parseInt(rgbValues[1]),b:BI.parseInt(rgbValues[2]),a:BI.parseFloat(rgbValues[3])}},json2rgb:function(rgb){return BI.isKey(rgb.r)&&BI.isKey(rgb.g)&&BI.isKey(rgb.b)?"rgb("+rgb.r+","+rgb.g+","+rgb.b+")":""},json2rgba:function(rgba){return BI.isKey(rgba.r)&&BI.isKey(rgba.g)&&BI.isKey(rgba.b)?"rgba("+rgba.r+","+rgba.g+","+rgba.b+","+rgba.a+")":""},int2hex:function(strNum){var hexdig=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return hexdig[strNum>>>4]+""+hexdig[15&strNum]},hex2rgb:function(color){if(!color)return"";if(!this.isHexColor(color))return color;var tempValue="rgb(",colorArray;return 7===color.length?colorArray=[BI.parseInt("0x"+color.substring(1,3)),BI.parseInt("0x"+color.substring(3,5)),BI.parseInt("0x"+color.substring(5,7))]:4===color.length&&(colorArray=[BI.parseInt("0x"+color.substring(1,2)),BI.parseInt("0x"+color.substring(2,3)),BI.parseInt("0x"+color.substring(3,4))]),tempValue+=colorArray[0]+",",tempValue+=colorArray[1]+",",tempValue+=colorArray[2]+")"},rgba2rgb:function(rgbColor,bgColor){if(BI.isNull(bgColor)&&(bgColor=1),"rgba"!=rgbColor.substr(0,4))return"";var rgbValues=rgbColor.match(/\d+(\.\d+)?/g);if(rgbValues.length<4)return"";var R=BI.parseFloat(rgbValues[0]),G=BI.parseFloat(rgbValues[1]),B=BI.parseFloat(rgbValues[2]),A=BI.parseFloat(rgbValues[3]);return"rgb("+Math.floor(255*(bgColor*(1-A))+R*A)+","+Math.floor(255*(bgColor*(1-A))+G*A)+","+Math.floor(255*(bgColor*(1-A))+B*A)+")"}}),BI.extend(BI.DOM,{getLeftPosition:function(combo,popup,extraWidth){return{left:combo.element.offset().left-popup.element.outerWidth()-(extraWidth||0)}},getInnerLeftPosition:function(combo,popup,extraWidth){return{left:combo.element.offset().left+(extraWidth||0)}},getRightPosition:function(combo,popup,extraWidth){var el=combo.element;return{left:el.offset().left+el.outerWidth()+(extraWidth||0)}},getInnerRightPosition:function(combo,popup,extraWidth){var el=combo.element,viewBounds=popup.element.bounds();return{left:el.offset().left+el.outerWidth()-viewBounds.width-(extraWidth||0)}},getTopPosition:function(combo,popup,extraHeight){return{top:combo.element.offset().top-popup.element.outerHeight()-(extraHeight||0)}},getBottomPosition:function(combo,popup,extraHeight){var el=combo.element;return{top:el.offset().top+el.outerHeight()+(extraHeight||0)}},isLeftSpaceEnough:function(combo,popup,extraWidth){return BI.DOM.getLeftPosition(combo,popup,extraWidth).left>=0},isInnerLeftSpaceEnough:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getInnerLeftPosition(combo,popup,extraWidth).left+viewBounds.width<=windowBounds.width},isRightSpaceEnough:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getRightPosition(combo,popup,extraWidth).left+viewBounds.width<=windowBounds.width},isInnerRightSpaceEnough:function(combo,popup,extraWidth){return BI.DOM.getInnerRightPosition(combo,popup,extraWidth).left>=0},isTopSpaceEnough:function(combo,popup,extraHeight){return BI.DOM.getTopPosition(combo,popup,extraHeight).top>=0},isBottomSpaceEnough:function(combo,popup,extraHeight){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.getBottomPosition(combo,popup,extraHeight).top+viewBounds.height<=windowBounds.height},isRightSpaceLarger:function(combo){var windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return windowBounds.width-combo.element.offset().left-combo.element.bounds().width>=combo.element.offset().left},isBottomSpaceLarger:function(combo){var windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return windowBounds.height-combo.element.offset().top-combo.element.bounds().height>=combo.element.offset().top},getLeftAlignPosition:function(combo,popup,extraWidth){var viewBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),left=combo.element.offset().left+extraWidth;return left+viewBounds.width>windowBounds.width&&(left=windowBounds.width-viewBounds.width),left<0&&(left=0),{left:left}},getLeftAdaptPosition:function(combo,popup,extraWidth){return BI.DOM.isLeftSpaceEnough(combo,popup,extraWidth)?BI.DOM.getLeftPosition(combo,popup,extraWidth):{left:0}},getRightAlignPosition:function(combo,popup,extraWidth){var comboBounds=combo.element.bounds(),viewBounds=popup.element.bounds(),left=combo.element.offset().left+comboBounds.width-viewBounds.width-extraWidth;return left<0&&(left=0),{left:left}},getRightAdaptPosition:function(combo,popup,extraWidth){return BI.DOM.isRightSpaceEnough(combo,popup,extraWidth)?BI.DOM.getRightPosition(combo,popup,extraWidth):{left:BI.Widget._renderEngine.createElement("body").bounds().width-popup.element.bounds().width}},getTopAlignPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top,adaptHeight;return BI.DOM.isBottomSpaceEnough(combo,popup,-1*comboBounds.height+extraHeight)?top=comboOffset.top+extraHeight:needAdaptHeight?(top=comboOffset.top+extraHeight,adaptHeight=windowBounds.height-top):(top=windowBounds.height-popupBounds.height,topwindowBounds.height?{top:0,adaptHeight:windowBounds.height-extraHeight}:{top:0}},getBottomAlignPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top,adaptHeight;return BI.DOM.isTopSpaceEnough(combo,popup,-1*comboBounds.height+extraHeight)?top=comboOffset.top+comboBounds.height-popupBounds.height-extraHeight:needAdaptHeight?(top=0,adaptHeight=comboOffset.top+comboBounds.height-extraHeight):(top=0,popupBounds.height+extraHeight>windowBounds.height&&(adaptHeight=windowBounds.height-extraHeight)),top<0&&(top=0),adaptHeight?{top:top,adaptHeight:adaptHeight}:{top:top}},getBottomAdaptPosition:function(combo,popup,extraHeight,needAdaptHeight){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds();return BI.DOM.isBottomSpaceEnough(combo,popup,extraHeight)?BI.DOM.getBottomPosition(combo,popup,extraHeight):needAdaptHeight?{top:comboOffset.top+comboBounds.height+extraHeight,adaptHeight:windowBounds.height-comboOffset.top-comboBounds.height-extraHeight}:popupBounds.height+extraHeight>windowBounds.height?{top:extraHeight,adaptHeight:windowBounds.height-extraHeight}:{top:windowBounds.height-popupBounds.height-extraHeight}},getCenterAdaptPosition:function(combo,popup){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),left;return left=comboOffset.left+comboBounds.width/2+popupBounds.width/2>windowBounds.width?windowBounds.width-popupBounds.width:comboOffset.left+comboBounds.width/2-popupBounds.width/2,left<0&&(left=0),{left:left}},getMiddleAdaptPosition:function(combo,popup){var comboOffset=combo.element.offset(),comboBounds=combo.element.bounds(),popupBounds=popup.element.bounds(),windowBounds=BI.Widget._renderEngine.createElement("body").bounds(),top;return top=comboOffset.top+comboBounds.height/2+popupBounds.height/2>windowBounds.height?windowBounds.height-popupBounds.height:comboOffset.top+comboBounds.height/2-popupBounds.height/2,top<0&&(top=0),{top:top}},getComboPositionByDirections:function(combo,popup,extraWidth,extraHeight,needAdaptHeight,directions){extraWidth||(extraWidth=0),extraHeight||(extraHeight=0);var i,direct,leftRight=[],topBottom=[],innerLeftRight=[],isNeedAdaptHeight=!1,tbFirst=!1,lrFirst=!1,left,top,pos,firstDir=directions[0];for(i=0;i0&&length-1 in obj)))}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(core_rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function internalData(elem,name,data,pvt){if(jQuery.acceptData(elem)){var thisCache,ret,internalKey=jQuery.expando,getByName="string"==typeof name,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if(id&&cache[id]&&(pvt||cache[id].data)||!getByName||data!==undefined)return id||(isNode?elem[internalKey]=id=core_deletedIds.pop()||jQuery.guid++:id=internalKey),cache[id]||(cache[id]={},isNode||(cache[id].toJSON=jQuery.noop)),"object"!=typeof name&&"function"!=typeof name||(pvt?cache[id]=jQuery.extend(cache[id],name):cache[id].data=jQuery.extend(cache[id].data,name)),thisCache=cache[id],pvt||(thisCache.data||(thisCache.data={}),thisCache=thisCache.data),data!==undefined&&(thisCache[jQuery.camelCase(name)]=data),getByName?(ret=thisCache[name],null==ret&&(ret=thisCache[jQuery.camelCase(name)])):ret=thisCache,ret}}function internalRemoveData(elem,name,pvt){if(jQuery.acceptData(elem)){var i,l,thisCache,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(cache[id]){if(name&&(thisCache=pvt?cache[id]:cache[id].data)){jQuery.isArray(name)?name=name.concat(jQuery.map(name,jQuery.camelCase)):name in thisCache?name=[name]:(name=jQuery.camelCase(name),name=name in thisCache?[name]:name.split(" "));for(i=0,l=name.length;i=0===keep})}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement)for(;list.length;)safeFrag.createElement(list.pop());return safeFrag}function findOrAppend(elem,tag){return elem.getElementsByTagName(tag)[0]||elem.appendChild(elem.ownerDocument.createElement(tag))}function disableScript(elem){var attr=elem.getAttributeNode("type");return elem.type=(attr&&attr.specified)+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var elem,i=0;null!=(elem=elems[i]);i++)jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){if(1===dest.nodeType&&jQuery.hasData(src)){var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle,curData.events={};for(type in events)for(i=0,l=events[type].length;i").css("cssText","display:block !important")).appendTo(doc.documentElement),doc=(iframe[0].contentWindow||iframe[0].contentDocument).document,doc.write(""),doc.close(),display=actualDisplay(nodeName,doc),iframe.detach()),elemdisplay[nodeName]=display),display}function actualDisplay(name,doc){var elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=jQuery.css(elem[0],"display");return elem.remove(),display}function buildParams(prefix,obj,traditional,add){var name;if(jQuery.isArray(obj))jQuery.each(obj,function(i,v){traditional||rbracket.test(prefix)?add(prefix,v):buildParams(prefix+"["+("object"==typeof v?i:"")+"]",v,traditional,add)});else if(traditional||"object"!==jQuery.type(obj))add(prefix,obj);else for(name in obj)buildParams(prefix+"["+name+"]",obj[name],traditional,add)}function addToPrefiltersOrTransports(structure){return function(dataTypeExpression,func){"string"!=typeof dataTypeExpression&&(func=dataTypeExpression,dataTypeExpression="*");var dataType,i=0,dataTypes=dataTypeExpression.toLowerCase().match(core_rnotwhite)||[];if(jQuery.isFunction(func))for(;dataType=dataTypes[i++];)"+"===dataType[0]?(dataType=dataType.slice(1)||"*",(structure[dataType]=structure[dataType]||[]).unshift(func)):(structure[dataType]=structure[dataType]||[]).push(func)}}function inspectPrefiltersOrTransports(structure,options,originalOptions,jqXHR){function inspect(dataType){var selected;return inspected[dataType]=!0,jQuery.each(structure[dataType]||[],function(_,prefilterOrFactory){var dataTypeOrTransport=prefilterOrFactory(options,originalOptions,jqXHR);return"string"!=typeof dataTypeOrTransport||seekingTransport||inspected[dataTypeOrTransport]?seekingTransport?!(selected=dataTypeOrTransport):void 0:(options.dataTypes.unshift(dataTypeOrTransport),inspect(dataTypeOrTransport),!1)}),selected}var inspected={},seekingTransport=structure===transports;return inspect(options.dataTypes[0])||!inspected["*"]&&inspect("*")}function ajaxExtend(target,src){var deep,key,flatOptions=jQuery.ajaxSettings.flatOptions||{};for(key in src)src[key]!==undefined&&((flatOptions[key]?target:deep||(deep={}))[key]=src[key]);return deep&&jQuery.extend(!0,target,deep),target}function ajaxHandleResponses(s,jqXHR,responses){var firstDataType,ct,finalDataType,type,contents=s.contents,dataTypes=s.dataTypes,responseFields=s.responseFields;for(type in responseFields)type in responses&&(jqXHR[responseFields[type]]=responses[type]);for(;"*"===dataTypes[0];)dataTypes.shift(),ct===undefined&&(ct=s.mimeType||jqXHR.getResponseHeader("Content-Type"));if(ct)for(type in contents)if(contents[type]&&contents[type].test(ct)){dataTypes.unshift(type);break}if(dataTypes[0]in responses)finalDataType=dataTypes[0];else{for(type in responses){if(!dataTypes[0]||s.converters[type+" "+dataTypes[0]]){finalDataType=type;break}firstDataType||(firstDataType=type)}finalDataType=finalDataType||firstDataType}if(finalDataType)return finalDataType!==dataTypes[0]&&dataTypes.unshift(finalDataType),responses[finalDataType]}function ajaxConvert(s,response){var conv2,current,conv,tmp,converters={},i=0,dataTypes=s.dataTypes.slice(),prev=dataTypes[0];if(s.dataFilter&&(response=s.dataFilter(response,s.dataType)),dataTypes[1])for(conv in s.converters)converters[conv.toLowerCase()]=s.converters[conv];for(;current=dataTypes[++i];)if("*"!==current){if("*"!==prev&&prev!==current){if(conv=converters[prev+" "+current]||converters["* "+current],!conv)for(conv2 in converters)if(tmp=conv2.split(" "),tmp[1]===current&&(conv=converters[prev+" "+tmp[0]]||converters["* "+tmp[0]])){conv===!0?conv=converters[conv2]:converters[conv2]!==!0&&(current=tmp[0],dataTypes.splice(i--,0,current));break}if(conv!==!0)if(conv&&s["throws"])response=conv(response);else try{response=conv(response)}catch(e){return{state:"parsererror",error:conv?e:"No conversion from "+prev+" to "+current}}}prev=current}return{state:"success",data:response}}function createStandardXHR(){try{return new window.XMLHttpRequest}catch(e){}}function createActiveXHR(){try{return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function createFxNow(){return setTimeout(function(){fxNow=undefined}),fxNow=jQuery.now()}function createTweens(animation,props){jQuery.each(props,function(prop,value){for(var collection=(tweeners[prop]||[]).concat(tweeners["*"]),index=0,length=collection.length;index)[^>]*|#([\w-]*))$/,rsingleTag=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,rvalidchars=/^[\],:{}\s]*$/,rvalidbraces=/(?:^|:|,)(?:\s*\[)+/g,rvalidescape=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,rvalidtokens=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,rmsPrefix=/^-ms-/,rdashAlpha=/-([\da-z])/gi,fcamelCase=function(all,letter){return letter.toUpperCase()},completed=function(event){(document.addEventListener||"load"===event.type||"complete"===document.readyState)&&(detach(),jQuery.ready())},detach=function(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1)):(document.detachEvent("onreadystatechange",completed),window.detachEvent("onload",completed))};jQuery.fn=jQuery.prototype={jquery:core_version,constructor:jQuery,init:function(selector,context,rootjQuery){var match,elem;if(!selector)return this;if("string"==typeof selector){if(match="<"===selector.charAt(0)&&">"===selector.charAt(selector.length-1)&&selector.length>=3?[null,selector,null]:rquickExpr.exec(selector),!match||!match[1]&&context)return!context||context.jquery?(context||rootjQuery).find(selector):this.constructor(context).find(selector);if(match[1]){if(context=context instanceof jQuery?context[0]:context,jQuery.merge(this,jQuery.parseHTML(match[1],context&&context.nodeType?context.ownerDocument||context:document,!0)),rsingleTag.test(match[1])&&jQuery.isPlainObject(context))for(match in context)jQuery.isFunction(this[match])?this[match](context[match]):this.attr(match,context[match]);return this}if(elem=document.getElementById(match[2]),elem&&elem.parentNode){if(elem.id!==match[2])return rootjQuery.find(selector);this.length=1,this[0]=elem}return this.context=document,this.selector=selector,this}return selector.nodeType?(this.context=this[0]=selector,this.length=1,this):jQuery.isFunction(selector)?rootjQuery.ready(selector):(selector.selector!==undefined&&(this.selector=selector.selector,this.context=selector.context),jQuery.makeArray(selector,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return core_slice.call(this)},get:function(num){return null==num?this.toArray():num<0?this[this.length+num]:this[num]},pushStack:function(elems){var ret=jQuery.merge(this.constructor(),elems);return ret.prevObject=this,ret.context=this.context,ret},each:function(callback,args){return jQuery.each(this,callback,args)},ready:function(fn){return jQuery.ready.promise().done(fn),this},slice:function(){return this.pushStack(core_slice.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(i){var len=this.length,j=+i+(i<0?len:0);return this.pushStack(j>=0&&j0||(readyList.resolveWith(document,[jQuery]),jQuery.fn.trigger&&jQuery(document).trigger("ready").off("ready"))}},isFunction:function(obj){return"function"===jQuery.type(obj)},isArray:Array.isArray||function(obj){return"array"===jQuery.type(obj)},isWindow:function(obj){return null!=obj&&obj==obj.window},isNumeric:function(obj){return!isNaN(parseFloat(obj))&&isFinite(obj)},type:function(obj){return null==obj?String(obj):"object"==typeof obj||"function"==typeof obj?class2type[core_toString.call(obj)]||"object":typeof obj},isPlainObject:function(obj){if(!obj||"object"!==jQuery.type(obj)||obj.nodeType||jQuery.isWindow(obj))return!1;try{if(obj.constructor&&!core_hasOwn.call(obj,"constructor")&&!core_hasOwn.call(obj.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}var key;for(key in obj);return key===undefined||core_hasOwn.call(obj,key)},isEmptyObject:function(obj){var name;for(name in obj)return!1;return!0},error:function(msg){throw new Error(msg)},parseHTML:function(data,context,keepScripts){if(!data||"string"!=typeof data)return null;"boolean"==typeof context&&(keepScripts=context,context=!1),context=context||document;var parsed=rsingleTag.exec(data),scripts=!keepScripts&&[];return parsed?[context.createElement(parsed[1])]:(parsed=jQuery.buildFragment([data],context,scripts),scripts&&jQuery(scripts).remove(),jQuery.merge([],parsed.childNodes))},parseJSON:function(data){return window.JSON&&window.JSON.parse?window.JSON.parse(data):null===data?data:"string"==typeof data&&(data=jQuery.trim(data),data&&rvalidchars.test(data.replace(rvalidescape,"@").replace(rvalidtokens,"]").replace(rvalidbraces,"")))?new Function("return "+data)():void jQuery.error("Invalid JSON: "+data)},parseXML:function(data){var xml,tmp;if(!data||"string"!=typeof data)return null;try{window.DOMParser?(tmp=new DOMParser,xml=tmp.parseFromString(data,"text/xml")):(xml=new ActiveXObject("Microsoft.XMLDOM"),xml.async="false",xml.loadXML(data))}catch(e){xml=undefined}return xml&&xml.documentElement&&!xml.getElementsByTagName("parsererror").length||jQuery.error("Invalid XML: "+data),xml},noop:function(){},globalEval:function(data){data&&jQuery.trim(data)&&(window.execScript||function(data){window.eval.call(window,data)})(data)},camelCase:function(string){return string.replace(rmsPrefix,"ms-").replace(rdashAlpha,fcamelCase)},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toLowerCase()===name.toLowerCase()},each:function(obj,callback,args){var value,i=0,length=obj.length,isArray=isArraylike(obj);if(args){if(isArray)for(;i-1;)list.splice(index,1),firing&&(index<=firingLength&&firingLength--,index<=firingIndex&&firingIndex--)}),this},has:function(fn){return fn?jQuery.inArray(fn,list)>-1:!(!list||!list.length)},empty:function(){return list=[],this},disable:function(){return list=stack=memory=undefined,this},disabled:function(){return!list},lock:function(){return stack=undefined,memory||self.disable(),this},locked:function(){return!stack},fireWith:function(context,args){return args=args||[],args=[context,args.slice?args.slice():args],!list||fired&&!stack||(firing?stack.push(args):fire(args)),this},fire:function(){return self.fireWith(this,arguments),this},fired:function(){return!!fired}};return self},jQuery.extend({Deferred:function(func){var tuples=[["resolve","done",jQuery.Callbacks("once memory"),"resolved"],["reject","fail",jQuery.Callbacks("once memory"),"rejected"],["notify","progress",jQuery.Callbacks("memory")]],state="pending",promise={state:function(){return state},always:function(){return deferred.done(arguments).fail(arguments),this},then:function(){var fns=arguments;return jQuery.Deferred(function(newDefer){jQuery.each(tuples,function(i,tuple){var action=tuple[0],fn=jQuery.isFunction(fns[i])&&fns[i];deferred[tuple[1]](function(){var returned=fn&&fn.apply(this,arguments);returned&&jQuery.isFunction(returned.promise)?returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify):newDefer[action+"With"](this===promise?newDefer.promise():this,fn?[returned]:arguments)})}),fns=null}).promise()},promise:function(obj){return null!=obj?jQuery.extend(obj,promise):promise}},deferred={};return promise.pipe=promise.then,jQuery.each(tuples,function(i,tuple){var list=tuple[2],stateString=tuple[3];promise[tuple[1]]=list.add,stateString&&list.add(function(){state=stateString},tuples[1^i][2].disable,tuples[2][2].lock),deferred[tuple[0]]=function(){return deferred[tuple[0]+"With"](this===deferred?promise:this,arguments),this},deferred[tuple[0]+"With"]=list.fireWith}),promise.promise(deferred),func&&func.call(deferred,deferred),deferred},when:function(subordinate){var i=0,resolveValues=core_slice.call(arguments),length=resolveValues.length,remaining=1!==length||subordinate&&jQuery.isFunction(subordinate.promise)?length:0,deferred=1===remaining?subordinate:jQuery.Deferred(),updateFunc=function(i,contexts,values){return function(value){contexts[i]=this,values[i]=arguments.length>1?core_slice.call(arguments):value,values===progressValues?deferred.notifyWith(contexts,values):--remaining||deferred.resolveWith(contexts,values)}},progressValues,progressContexts,resolveContexts;if(length>1)for(progressValues=new Array(length),progressContexts=new Array(length),resolveContexts=new Array(length);i
  • a",all=div.getElementsByTagName("*"),a=div.getElementsByTagName("a")[0],!all||!a||!all.length)return{};select=document.createElement("select"),opt=select.appendChild(document.createElement("option")),input=div.getElementsByTagName("input")[0],a.style.cssText="top:1px;float:left;opacity:.5",support={getSetAttribute:"t"!==div.className,leadingWhitespace:3===div.firstChild.nodeType,tbody:!div.getElementsByTagName("tbody").length,htmlSerialize:!!div.getElementsByTagName("link").length,style:/top/.test(a.getAttribute("style")),hrefNormalized:"/a"===a.getAttribute("href"),opacity:/^0.5/.test(a.style.opacity),cssFloat:!!a.style.cssFloat,checkOn:!!input.value,optSelected:opt.selected,enctype:!!document.createElement("form").enctype,html5Clone:"<:nav>"!==document.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===document.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},input.checked=!0,support.noCloneChecked=input.cloneNode(!0).checked,select.disabled=!0,support.optDisabled=!opt.disabled;try{delete div.test}catch(e){support.deleteExpando=!1}input=document.createElement("input"),input.setAttribute("value",""),support.input=""===input.getAttribute("value"),input.value="t",input.setAttribute("type","radio"),support.radioValue="t"===input.value,input.setAttribute("checked","t"),input.setAttribute("name","t"),fragment=document.createDocumentFragment(),fragment.appendChild(input),support.appendChecked=input.checked,support.checkClone=fragment.cloneNode(!0).cloneNode(!0).lastChild.checked,div.attachEvent&&(div.attachEvent("onclick",function(){support.noCloneEvent=!1}),div.cloneNode(!0).click());for(i in{submit:!0,change:!0,focusin:!0})div.setAttribute(eventName="on"+i,"t"),support[i+"Bubbles"]=eventName in window||div.attributes[eventName].expando===!1;return div.style.backgroundClip="content-box",div.cloneNode(!0).style.backgroundClip="",support.clearCloneStyle="content-box"===div.style.backgroundClip,jQuery(function(){var container,marginDiv,tds,divReset="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",body=document.getElementsByTagName("body")[0];body&&(container=document.createElement("div"),container.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",body.appendChild(container).appendChild(div),div.innerHTML="
    t
    ",tds=div.getElementsByTagName("td"),tds[0].style.cssText="padding:0;margin:0;border:0;display:none",isSupported=0===tds[0].offsetHeight,tds[0].style.display="",tds[1].style.display="none",support.reliableHiddenOffsets=isSupported&&0===tds[0].offsetHeight,div.innerHTML="",div.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",support.boxSizing=4===div.offsetWidth,support.doesNotIncludeMarginInBodyOffset=1!==body.offsetTop,window.getComputedStyle&&(support.pixelPosition="1%"!==(window.getComputedStyle(div,null)||{}).top,support.boxSizingReliable="4px"===(window.getComputedStyle(div,null)||{width:"4px"}).width,marginDiv=div.appendChild(document.createElement("div")),marginDiv.style.cssText=div.style.cssText=divReset,marginDiv.style.marginRight=marginDiv.style.width="0",div.style.width="1px",support.reliableMarginRight=!parseFloat((window.getComputedStyle(marginDiv,null)||{}).marginRight)),typeof div.style.zoom!==core_strundefined&&(div.innerHTML="",div.style.cssText=divReset+"width:1px;padding:1px;display:inline;zoom:1",support.inlineBlockNeedsLayout=3===div.offsetWidth,div.style.display="block",div.innerHTML="
    ",div.firstChild.style.width="5px", +support.shrinkWrapBlocks=3!==div.offsetWidth,support.inlineBlockNeedsLayout&&(body.style.zoom=1)),body.removeChild(container),container=div=tds=marginDiv=null)}),all=select=fragment=opt=a=input=null,support}();var rbrace=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,rmultiDash=/([A-Z])/g;jQuery.extend({cache:{},expando:"jQuery"+(core_version+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(elem){return elem=elem.nodeType?jQuery.cache[elem[jQuery.expando]]:elem[jQuery.expando],!!elem&&!isEmptyDataObject(elem)},data:function(elem,name,data){return internalData(elem,name,data)},removeData:function(elem,name){return internalRemoveData(elem,name)},_data:function(elem,name,data){return internalData(elem,name,data,!0)},_removeData:function(elem,name){return internalRemoveData(elem,name,!0)},acceptData:function(elem){if(elem.nodeType&&1!==elem.nodeType&&9!==elem.nodeType)return!1;var noData=elem.nodeName&&jQuery.noData[elem.nodeName.toLowerCase()];return!noData||noData!==!0&&elem.getAttribute("classid")===noData}}),jQuery.fn.extend({data:function(key,value){var attrs,name,elem=this[0],i=0,data=null;if(key===undefined){if(this.length&&(data=jQuery.data(elem),1===elem.nodeType&&!jQuery._data(elem,"parsedAttrs"))){for(attrs=elem.attributes;i1,null,!0)},removeData:function(key){return this.each(function(){jQuery.removeData(this,key)})}}),jQuery.extend({queue:function(elem,type,data){var queue;if(elem)return type=(type||"fx")+"queue",queue=jQuery._data(elem,type),data&&(!queue||jQuery.isArray(data)?queue=jQuery._data(elem,type,jQuery.makeArray(data)):queue.push(data)),queue||[]},dequeue:function(elem,type){type=type||"fx";var queue=jQuery.queue(elem,type),startLength=queue.length,fn=queue.shift(),hooks=jQuery._queueHooks(elem,type),next=function(){jQuery.dequeue(elem,type)};"inprogress"===fn&&(fn=queue.shift(),startLength--),hooks.cur=fn,fn&&("fx"===type&&queue.unshift("inprogress"),delete hooks.stop,fn.call(elem,next,hooks)),!startLength&&hooks&&hooks.empty.fire()},_queueHooks:function(elem,type){var key=type+"queueHooks";return jQuery._data(elem,key)||jQuery._data(elem,key,{empty:jQuery.Callbacks("once memory").add(function(){jQuery._removeData(elem,type+"queue"),jQuery._removeData(elem,key)})})}}),jQuery.fn.extend({queue:function(type,data){var setter=2;return"string"!=typeof type&&(data=type,type="fx",setter--),arguments.length1)},removeAttr:function(name){return this.each(function(){jQuery.removeAttr(this,name)})},prop:function(name,value){return jQuery.access(this,jQuery.prop,name,value,arguments.length>1)},removeProp:function(name){return name=jQuery.propFix[name]||name,this.each(function(){try{this[name]=undefined,delete this[name]}catch(e){}})},addClass:function(value){var classes,elem,cur,clazz,j,i=0,len=this.length,proceed="string"==typeof value&&value;if(jQuery.isFunction(value))return this.each(function(j){jQuery(this).addClass(value.call(this,j,this.className))});if(proceed)for(classes=(value||"").match(core_rnotwhite)||[];i=0;)cur=cur.replace(" "+clazz+" "," ");elem.className=value?jQuery.trim(cur):""}return this},toggleClass:function(value,stateVal){var type=typeof value,isBool="boolean"==typeof stateVal;return jQuery.isFunction(value)?this.each(function(i){jQuery(this).toggleClass(value.call(this,i,this.className,stateVal),stateVal)}):this.each(function(){if("string"===type)for(var className,i=0,self=jQuery(this),state=stateVal,classNames=value.match(core_rnotwhite)||[];className=classNames[i++];)state=isBool?state:!self.hasClass(className),self[state?"addClass":"removeClass"](className);else type!==core_strundefined&&"boolean"!==type||(this.className&&jQuery._data(this,"__className__",this.className),this.className=this.className||value===!1?"":jQuery._data(this,"__className__")||"")})},hasClass:function(selector){for(var className=" "+selector+" ",i=0,l=this.length;i=0)return!0;return!1},val:function(value){var ret,hooks,isFunction,elem=this[0];{if(arguments.length)return isFunction=jQuery.isFunction(value),this.each(function(i){var val,self=jQuery(this);1===this.nodeType&&(val=isFunction?value.call(this,i,self.val()):value,null==val?val="":"number"==typeof val?val+="":jQuery.isArray(val)&&(val=jQuery.map(val,function(value){return null==value?"":value+""})),hooks=jQuery.valHooks[this.type]||jQuery.valHooks[this.nodeName.toLowerCase()],hooks&&"set"in hooks&&hooks.set(this,val,"value")!==undefined||(this.value=val))});if(elem)return hooks=jQuery.valHooks[elem.type]||jQuery.valHooks[elem.nodeName.toLowerCase()],hooks&&"get"in hooks&&(ret=hooks.get(elem,"value"))!==undefined?ret:(ret=elem.value,"string"==typeof ret?ret.replace(rreturn,""):null==ret?"":ret)}}}),jQuery.extend({valHooks:{option:{get:function(elem){var val=elem.attributes.value;return!val||val.specified?elem.value:elem.text}},select:{get:function(elem){for(var value,option,options=elem.options,index=elem.selectedIndex,one="select-one"===elem.type||index<0,values=one?null:[],max=one?index+1:options.length,i=index<0?max:one?index:0;i=0}),values.length||(elem.selectedIndex=-1),values}}},attr:function(elem,name,value){var hooks,notxml,ret,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return typeof elem.getAttribute===core_strundefined?jQuery.prop(elem,name,value):(notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=name.toLowerCase(),hooks=jQuery.attrHooks[name]||(rboolean.test(name)?boolHook:nodeHook)),value===undefined?hooks&¬xml&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:(typeof elem.getAttribute!==core_strundefined&&(ret=elem.getAttribute(name)),null==ret?undefined:ret):null!==value?hooks&¬xml&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:(elem.setAttribute(name,value+""),value):void jQuery.removeAttr(elem,name))},removeAttr:function(elem,value){var name,propName,i=0,attrNames=value&&value.match(core_rnotwhite);if(attrNames&&1===elem.nodeType)for(;name=attrNames[i++];)propName=jQuery.propFix[name]||name,rboolean.test(name)?!getSetAttribute&&ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]=elem[propName]=!1:elem[propName]=!1:jQuery.attr(elem,name,""),elem.removeAttribute(getSetAttribute?name:propName)},attrHooks:{type:{set:function(elem,value){if(!jQuery.support.radioValue&&"radio"===value&&jQuery.nodeName(elem,"input")){var val=elem.value;return elem.setAttribute("type",value),val&&(elem.value=val),value}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(elem,name,value){var ret,hooks,notxml,nType=elem.nodeType;if(elem&&3!==nType&&8!==nType&&2!==nType)return notxml=1!==nType||!jQuery.isXMLDoc(elem),notxml&&(name=jQuery.propFix[name]||name,hooks=jQuery.propHooks[name]),value!==undefined?hooks&&"set"in hooks&&(ret=hooks.set(elem,value,name))!==undefined?ret:elem[name]=value:hooks&&"get"in hooks&&null!==(ret=hooks.get(elem,name))?ret:elem[name]},propHooks:{tabIndex:{get:function(elem){var attributeNode=elem.getAttributeNode("tabindex");return attributeNode&&attributeNode.specified?parseInt(attributeNode.value,10):rfocusable.test(elem.nodeName)||rclickable.test(elem.nodeName)&&elem.href?0:undefined}}}}),boolHook={get:function(elem,name){var prop=jQuery.prop(elem,name),attr="boolean"==typeof prop&&elem.getAttribute(name),detail="boolean"==typeof prop?getSetInput&&getSetAttribute?null!=attr:ruseDefault.test(name)?elem[jQuery.camelCase("default-"+name)]:!!attr:elem.getAttributeNode(name);return detail&&detail.value!==!1?name.toLowerCase():undefined},set:function(elem,value,name){return value===!1?jQuery.removeAttr(elem,name):getSetInput&&getSetAttribute||!ruseDefault.test(name)?elem.setAttribute(!getSetAttribute&&jQuery.propFix[name]||name,name):elem[jQuery.camelCase("default-"+name)]=elem[name]=!0,name}},getSetInput&&getSetAttribute||(jQuery.attrHooks.value={get:function(elem,name){var ret=elem.getAttributeNode(name);return jQuery.nodeName(elem,"input")?elem.defaultValue:ret&&ret.specified?ret.value:undefined},set:function(elem,value,name){return jQuery.nodeName(elem,"input")?void(elem.defaultValue=value):nodeHook&&nodeHook.set(elem,value,name)}}),getSetAttribute||(nodeHook=jQuery.valHooks.button={get:function(elem,name){var ret=elem.getAttributeNode(name);return ret&&("id"===name||"name"===name||"coords"===name?""!==ret.value:ret.specified)?ret.value:undefined},set:function(elem,value,name){var ret=elem.getAttributeNode(name);return ret||elem.setAttributeNode(ret=elem.ownerDocument.createAttribute(name)),ret.value=value+="","value"===name||value===elem.getAttribute(name)?value:undefined}},jQuery.attrHooks.contenteditable={get:nodeHook.get,set:function(elem,value,name){nodeHook.set(elem,""!==value&&value,name)}},jQuery.each(["width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{set:function(elem,value){if(""===value)return elem.setAttribute(name,"auto"),value}})})),jQuery.support.hrefNormalized||(jQuery.each(["href","src","width","height"],function(i,name){jQuery.attrHooks[name]=jQuery.extend(jQuery.attrHooks[name],{get:function(elem){var ret=elem.getAttribute(name,2);return null==ret?undefined:ret}})}),jQuery.each(["href","src"],function(i,name){jQuery.propHooks[name]={get:function(elem){return elem.getAttribute(name,4)}}})),jQuery.support.style||(jQuery.attrHooks.style={get:function(elem){return elem.style.cssText||undefined},set:function(elem,value){return elem.style.cssText=value+""}}),jQuery.support.optSelected||(jQuery.propHooks.selected=jQuery.extend(jQuery.propHooks.selected,{get:function(elem){var parent=elem.parentNode;return parent&&(parent.selectedIndex,parent.parentNode&&parent.parentNode.selectedIndex),null}})),jQuery.support.enctype||(jQuery.propFix.enctype="encoding"),jQuery.support.checkOn||jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]={get:function(elem){return null===elem.getAttribute("value")?"on":elem.value}}}),jQuery.each(["radio","checkbox"],function(){jQuery.valHooks[this]=jQuery.extend(jQuery.valHooks[this],{set:function(elem,value){if(jQuery.isArray(value))return elem.checked=jQuery.inArray(jQuery(elem).val(),value)>=0}})});var rformElems=/^(?:input|select|textarea)$/i,rkeyEvent=/^key/,rmouseEvent=/^(?:mouse|contextmenu)|click/,rfocusMorph=/^(?:focusinfocus|focusoutblur)$/,rtypenamespace=/^([^.]*)(?:\.(.+)|)$/;jQuery.event={global:{},add:function(elem,types,handler,data,selector){var tmp,events,t,handleObjIn,special,eventHandle,handleObj,handlers,type,namespaces,origType,elemData=jQuery._data(elem);if(elemData){for(handler.handler&&(handleObjIn=handler,handler=handleObjIn.handler,selector=handleObjIn.selector),handler.guid||(handler.guid=jQuery.guid++),(events=elemData.events)||(events=elemData.events={}),(eventHandle=elemData.handle)||(eventHandle=elemData.handle=function(e){return typeof jQuery===core_strundefined||e&&jQuery.event.triggered===e.type?undefined:jQuery.event.dispatch.apply(eventHandle.elem,arguments)},eventHandle.elem=elem),types=(types||"").match(core_rnotwhite)||[""],t=types.length;t--;)tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,special=jQuery.event.special[type]||{},handleObj=jQuery.extend({type:type,origType:origType,data:data,handler:handler,guid:handler.guid,selector:selector,needsContext:selector&&jQuery.expr.match.needsContext.test(selector),namespace:namespaces.join(".")},handleObjIn),(handlers=events[type])||(handlers=events[type]=[],handlers.delegateCount=0,special.setup&&special.setup.call(elem,data,namespaces,eventHandle)!==!1||(elem.addEventListener?elem.addEventListener(type,eventHandle,!1):elem.attachEvent&&elem.attachEvent("on"+type,eventHandle))),special.add&&(special.add.call(elem,handleObj),handleObj.handler.guid||(handleObj.handler.guid=handler.guid)),selector?handlers.splice(handlers.delegateCount++,0,handleObj):handlers.push(handleObj),jQuery.event.global[type]=!0;elem=null}},remove:function(elem,types,handler,selector,mappedTypes){var j,handleObj,tmp,origCount,t,events,special,handlers,type,namespaces,origType,elemData=jQuery.hasData(elem)&&jQuery._data(elem);if(elemData&&(events=elemData.events)){for(types=(types||"").match(core_rnotwhite)||[""],t=types.length;t--;)if(tmp=rtypenamespace.exec(types[t])||[],type=origType=tmp[1],namespaces=(tmp[2]||"").split(".").sort(),type){for(special=jQuery.event.special[type]||{},type=(selector?special.delegateType:special.bindType)||type,handlers=events[type]||[],tmp=tmp[2]&&new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"),origCount=j=handlers.length;j--;)handleObj=handlers[j],!mappedTypes&&origType!==handleObj.origType||handler&&handler.guid!==handleObj.guid||tmp&&!tmp.test(handleObj.namespace)||selector&&selector!==handleObj.selector&&("**"!==selector||!handleObj.selector)||(handlers.splice(j,1),handleObj.selector&&handlers.delegateCount--,special.remove&&special.remove.call(elem,handleObj));origCount&&!handlers.length&&(special.teardown&&special.teardown.call(elem,namespaces,elemData.handle)!==!1||jQuery.removeEvent(elem,type,elemData.handle),delete events[type])}else for(type in events)jQuery.event.remove(elem,type+types[t],handler,selector,!0);jQuery.isEmptyObject(events)&&(delete elemData.handle,jQuery._removeData(elem,"events"))}},trigger:function(event,data,elem,onlyHandlers){var handle,ontype,cur,bubbleType,special,tmp,i,eventPath=[elem||document],type=core_hasOwn.call(event,"type")?event.type:event,namespaces=core_hasOwn.call(event,"namespace")?event.namespace.split("."):[];if(cur=tmp=elem=elem||document,3!==elem.nodeType&&8!==elem.nodeType&&!rfocusMorph.test(type+jQuery.event.triggered)&&(type.indexOf(".")>=0&&(namespaces=type.split("."),type=namespaces.shift(),namespaces.sort()),ontype=type.indexOf(":")<0&&"on"+type,event=event[jQuery.expando]?event:new jQuery.Event(type,"object"==typeof event&&event),event.isTrigger=!0,event.namespace=namespaces.join("."),event.namespace_re=event.namespace?new RegExp("(^|\\.)"+namespaces.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,event.result=undefined,event.target||(event.target=elem),data=null==data?[event]:jQuery.makeArray(data,[event]),special=jQuery.event.special[type]||{},onlyHandlers||!special.trigger||special.trigger.apply(elem,data)!==!1)){if(!onlyHandlers&&!special.noBubble&&!jQuery.isWindow(elem)){for(bubbleType=special.delegateType||type,rfocusMorph.test(bubbleType+type)||(cur=cur.parentNode);cur;cur=cur.parentNode)eventPath.push(cur),tmp=cur;tmp===(elem.ownerDocument||document)&&eventPath.push(tmp.defaultView||tmp.parentWindow||window)}for(i=0;(cur=eventPath[i++])&&!event.isPropagationStopped();)event.type=i>1?bubbleType:special.bindType||type,handle=(jQuery._data(cur,"events")||{})[event.type]&&jQuery._data(cur,"handle"),handle&&handle.apply(cur,data),handle=ontype&&cur[ontype],handle&&jQuery.acceptData(cur)&&handle.apply&&handle.apply(cur,data)===!1&&event.preventDefault();if(event.type=type,!onlyHandlers&&!event.isDefaultPrevented()&&(!special._default||special._default.apply(elem.ownerDocument,data)===!1)&&("click"!==type||!jQuery.nodeName(elem,"a"))&&jQuery.acceptData(elem)&&ontype&&elem[type]&&!jQuery.isWindow(elem)){tmp=elem[ontype],tmp&&(elem[ontype]=null),jQuery.event.triggered=type;try{elem[type]()}catch(e){}jQuery.event.triggered=undefined,tmp&&(elem[ontype]=tmp)}return event.result}},dispatch:function(event){event=jQuery.event.fix(event);var i,ret,handleObj,matched,j,handlerQueue=[],args=core_slice.call(arguments),handlers=(jQuery._data(this,"events")||{})[event.type]||[],special=jQuery.event.special[event.type]||{};if(args[0]=event,event.delegateTarget=this,!special.preDispatch||special.preDispatch.call(this,event)!==!1){for(handlerQueue=jQuery.event.handlers.call(this,event,handlers),i=0;(matched=handlerQueue[i++])&&!event.isPropagationStopped();)for(event.currentTarget=matched.elem,j=0;(handleObj=matched.handlers[j++])&&!event.isImmediatePropagationStopped();)if(!event.namespace_re||event.namespace_re.test(handleObj.namespace)){event.handleObj=handleObj,event.data=handleObj.data;var obj=(jQuery.event.special[handleObj.origType]||{}).handle||handleObj.handler;obj.apply&&(ret=obj.apply(matched.elem,args)),ret!==undefined&&(event.result=ret)===!1&&(event.preventDefault(),event.stopPropagation())}return special.postDispatch&&special.postDispatch.call(this,event),event.result}},handlers:function(event,handlers){var sel,handleObj,matches,i,handlerQueue=[],delegateCount=handlers.delegateCount,cur=event.target;if(delegateCount&&cur.nodeType&&(!event.button||"click"!==event.type))for(;cur!=this;cur=cur.parentNode||this)if(1===cur.nodeType&&(cur.disabled!==!0||"click"!==event.type)){for(matches=[],i=0;i=0:jQuery.find(sel,this,null,[cur]).length),matches[sel]&&matches.push(handleObj);matches.length&&handlerQueue.push({elem:cur,handlers:matches})}return delegateCountExpr.cacheLength&&delete cache[keys.shift()],cache[key]=value}}function markFunction(fn){return fn[expando]=!0,fn}function assert(fn){var div=document.createElement("div");try{return fn(div)}catch(e){return!1}finally{div=null}}function Sizzle(selector,context,results,seed){var match,elem,m,nodeType,i,groups,old,nid,newContext,newSelector;if((context?context.ownerDocument||context:preferredDoc)!==document&&setDocument(context),context=context||document,results=results||[],!selector||"string"!=typeof selector)return results;if(1!==(nodeType=context.nodeType)&&9!==nodeType)return[];if(!documentIsXML&&!seed){if(match=rquickExpr.exec(selector))if(m=match[1]){if(9===nodeType){if(elem=context.getElementById(m),!elem||!elem.parentNode)return results;if(elem.id===m)return results.push(elem),results}else if(context.ownerDocument&&(elem=context.ownerDocument.getElementById(m))&&contains(context,elem)&&elem.id===m)return results.push(elem),results}else{if(match[2])return push.apply(results,slice.call(context.getElementsByTagName(selector),0)),results;if((m=match[3])&&support.getByClassName&&context.getElementsByClassName)return push.apply(results,slice.call(context.getElementsByClassName(m),0)),results}if(support.qsa&&!rbuggyQSA.test(selector)){if(old=!0,nid=expando,newContext=context,newSelector=9===nodeType&&selector,1===nodeType&&"object"!==context.nodeName.toLowerCase()){for(groups=tokenize(selector),(old=context.getAttribute("id"))?nid=old.replace(rescape,"\\$&"):context.setAttribute("id",nid),nid="[id='"+nid+"'] ",i=groups.length;i--;)groups[i]=nid+toSelector(groups[i]);newContext=rsibling.test(selector)&&context.parentNode||context,newSelector=groups.join(",")}if(newSelector)try{return push.apply(results,slice.call(newContext.querySelectorAll(newSelector),0)),results}catch(qsaError){}finally{old||context.removeAttribute("id")}}}return select(selector.replace(rtrim,"$1"),context,results,seed)}function siblingCheck(a,b){var cur=b&&a,diff=cur&&(~b.sourceIndex||MAX_NEGATIVE)-(~a.sourceIndex||MAX_NEGATIVE);if(diff)return diff;if(cur)for(;cur=cur.nextSibling;)if(cur===b)return-1;return a?1:-1}function createInputPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&elem.type===type}}function createButtonPseudo(type){return function(elem){var name=elem.nodeName.toLowerCase();return("input"===name||"button"===name)&&elem.type===type}}function createPositionalPseudo(fn){return markFunction(function(argument){return argument=+argument,markFunction(function(seed,matches){for(var j,matchIndexes=fn([],seed.length,argument),i=matchIndexes.length;i--;)seed[j=matchIndexes[i]]&&(seed[j]=!(matches[j]=seed[j]))})})}function tokenize(selector,parseOnly){var matched,match,tokens,type,soFar,groups,preFilters,cached=tokenCache[selector+" "];if(cached)return parseOnly?0:cached.slice(0);for(soFar=selector,groups=[],preFilters=Expr.preFilter;soFar;){ +matched&&!(match=rcomma.exec(soFar))||(match&&(soFar=soFar.slice(match[0].length)||soFar),groups.push(tokens=[])),matched=!1,(match=rcombinators.exec(soFar))&&(matched=match.shift(),tokens.push({value:matched,type:match[0].replace(rtrim," ")}),soFar=soFar.slice(matched.length));for(type in Expr.filter)!(match=matchExpr[type].exec(soFar))||preFilters[type]&&!(match=preFilters[type](match))||(matched=match.shift(),tokens.push({value:matched,type:type,matches:match}),soFar=soFar.slice(matched.length));if(!matched)break}return parseOnly?soFar.length:soFar?Sizzle.error(selector):tokenCache(selector,groups).slice(0)}function toSelector(tokens){for(var i=0,len=tokens.length,selector="";i1?function(elem,context,xml){for(var i=matchers.length;i--;)if(!matchers[i](elem,context,xml))return!1;return!0}:matchers[0]}function condense(unmatched,map,filter,context,xml){for(var elem,newUnmatched=[],i=0,len=unmatched.length,mapped=null!=map;i-1&&(seed[temp]=!(results[temp]=elem))}}else matcherOut=condense(matcherOut===results?matcherOut.splice(preexisting,matcherOut.length):matcherOut),postFinder?postFinder(null,results,matcherOut,xml):push.apply(results,matcherOut)})}function matcherFromTokens(tokens){for(var checkContext,matcher,j,len=tokens.length,leadingRelative=Expr.relative[tokens[0].type],implicitRelative=leadingRelative||Expr.relative[" "],i=leadingRelative?1:0,matchContext=addCombinator(function(elem){return elem===checkContext},implicitRelative,!0),matchAnyContext=addCombinator(function(elem){return indexOf.call(checkContext,elem)>-1},implicitRelative,!0),matchers=[function(elem,context,xml){return!leadingRelative&&(xml||context!==outermostContext)||((checkContext=context).nodeType?matchContext(elem,context,xml):matchAnyContext(elem,context,xml))}];i1&&elementMatcher(matchers),i>1&&toSelector(tokens.slice(0,i-1)).replace(rtrim,"$1"),matcher,i0,byElement=elementMatchers.length>0,superMatcher=function(seed,context,xml,results,expandContext){var elem,j,matcher,setMatched=[],matchedCount=0,i="0",unmatched=seed&&[],outermost=null!=expandContext,contextBackup=outermostContext,elems=seed||byElement&&Expr.find.TAG("*",expandContext&&context.parentNode||context),dirrunsUnique=dirruns+=null==contextBackup?1:Math.random()||.1;for(outermost&&(outermostContext=context!==document&&context,cachedruns=matcherCachedRuns);null!=(elem=elems[i]);i++){if(byElement&&elem){for(j=0;matcher=elementMatchers[j++];)if(matcher(elem,context,xml)){results.push(elem);break}outermost&&(dirruns=dirrunsUnique,cachedruns=++matcherCachedRuns)}bySet&&((elem=!matcher&&elem)&&matchedCount--,seed&&unmatched.push(elem))}if(matchedCount+=i,bySet&&i!==matchedCount){for(j=0;matcher=setMatchers[j++];)matcher(unmatched,setMatched,context,xml);if(seed){if(matchedCount>0)for(;i--;)unmatched[i]||setMatched[i]||(setMatched[i]=pop.call(results));setMatched=condense(setMatched)}push.apply(results,setMatched),outermost&&!seed&&setMatched.length>0&&matchedCount+setMatchers.length>1&&Sizzle.uniqueSort(results)}return outermost&&(dirruns=dirrunsUnique,outermostContext=contextBackup),unmatched};return bySet?markFunction(superMatcher):superMatcher}function multipleContexts(selector,contexts,results){for(var i=0,len=contexts.length;i2&&"ID"===(token=tokens[0]).type&&9===context.nodeType&&!documentIsXML&&Expr.relative[tokens[1].type]){if(context=Expr.find.ID(token.matches[0].replace(runescape,funescape),context)[0],!context)return results;selector=selector.slice(tokens.shift().value.length)}for(i=matchExpr.needsContext.test(selector)?0:tokens.length;i--&&(token=tokens[i],!Expr.relative[type=token.type]);)if((find=Expr.find[type])&&(seed=find(token.matches[0].replace(runescape,funescape),rsibling.test(tokens[0].type)&&context.parentNode||context))){if(tokens.splice(i,1),selector=seed.length&&toSelector(tokens),!selector)return push.apply(results,slice.call(seed,0)),results;break}}return compile(selector,match)(seed,context,documentIsXML,results,rsibling.test(selector)),results}function setFilters(){}var i,cachedruns,Expr,getText,isXML,compile,hasDuplicate,outermostContext,setDocument,document,docElem,documentIsXML,rbuggyQSA,rbuggyMatches,matches,contains,sortOrder,expando="sizzle"+-new Date,preferredDoc=window.document,support={},dirruns=0,done=0,classCache=createCache(),tokenCache=createCache(),compilerCache=createCache(),strundefined=typeof undefined,MAX_NEGATIVE=1<<31,arr=[],pop=arr.pop,push=arr.push,slice=arr.slice,indexOf=arr.indexOf||function(elem){for(var i=0,len=this.length;i+~])"+whitespace+"*"),rpseudo=new RegExp(pseudos),ridentifier=new RegExp("^"+identifier+"$"),matchExpr={ID:new RegExp("^#("+characterEncoding+")"),CLASS:new RegExp("^\\.("+characterEncoding+")"),NAME:new RegExp("^\\[name=['\"]?("+characterEncoding+")['\"]?\\]"),TAG:new RegExp("^("+characterEncoding.replace("w","w*")+")"),ATTR:new RegExp("^"+attributes),PSEUDO:new RegExp("^"+pseudos),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+whitespace+"*(even|odd|(([+-]|)(\\d*)n|)"+whitespace+"*(?:([+-]|)"+whitespace+"*(\\d+)|))"+whitespace+"*\\)|)","i"),needsContext:new RegExp("^"+whitespace+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+whitespace+"*((?:-\\d)?\\d*)"+whitespace+"*\\)|)(?=[^-]|$)","i")},rsibling=/[\x20\t\r\n\f]*[+~]/,rnative=/^[^{]+\{\s*\[native code/,rquickExpr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,rinputs=/^(?:input|select|textarea|button)$/i,rheader=/^h\d$/i,rescape=/'|\\/g,rattributeQuotes=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,runescape=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,funescape=function(_,escaped){var high="0x"+escaped-65536;return high!==high?escaped:high<0?String.fromCharCode(high+65536):String.fromCharCode(high>>10|55296,1023&high|56320)};try{slice.call(preferredDoc.documentElement.childNodes,0)[0].nodeType}catch(e){slice=function(i){for(var elem,results=[];elem=this[i++];)results.push(elem);return results}}isXML=Sizzle.isXML=function(elem){var documentElement=elem&&(elem.ownerDocument||elem).documentElement;return!!documentElement&&"HTML"!==documentElement.nodeName},setDocument=Sizzle.setDocument=function(node){var doc=node?node.ownerDocument||node:preferredDoc;return doc!==document&&9===doc.nodeType&&doc.documentElement?(document=doc,docElem=doc.documentElement,documentIsXML=isXML(doc),support.tagNameNoComments=assert(function(div){return div.appendChild(doc.createComment("")),!div.getElementsByTagName("*").length}),support.attributes=assert(function(div){div.innerHTML="";var type=typeof div.lastChild.getAttribute("multiple");return"boolean"!==type&&"string"!==type}),support.getByClassName=assert(function(div){return div.innerHTML="",!(!div.getElementsByClassName||!div.getElementsByClassName("e").length)&&(div.lastChild.className="e",2===div.getElementsByClassName("e").length)}),support.getByName=assert(function(div){div.id=expando+0,div.innerHTML="
    ",docElem.insertBefore(div,docElem.firstChild);var pass=doc.getElementsByName&&doc.getElementsByName(expando).length===2+doc.getElementsByName(expando+0).length;return support.getIdNotName=!doc.getElementById(expando),docElem.removeChild(div),pass}),Expr.attrHandle=assert(function(div){return div.innerHTML="",div.firstChild&&typeof div.firstChild.getAttribute!==strundefined&&"#"===div.firstChild.getAttribute("href")})?{}:{href:function(elem){return elem.getAttribute("href",2)},type:function(elem){return elem.getAttribute("type")}},support.getIdNotName?(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&!documentIsXML){var m=context.getElementById(id);return m&&m.parentNode?[m]:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){return elem.getAttribute("id")===attrId}}):(Expr.find.ID=function(id,context){if(typeof context.getElementById!==strundefined&&!documentIsXML){var m=context.getElementById(id);return m?m.id===id||typeof m.getAttributeNode!==strundefined&&m.getAttributeNode("id").value===id?[m]:undefined:[]}},Expr.filter.ID=function(id){var attrId=id.replace(runescape,funescape);return function(elem){var node=typeof elem.getAttributeNode!==strundefined&&elem.getAttributeNode("id");return node&&node.value===attrId}}),Expr.find.TAG=support.tagNameNoComments?function(tag,context){if(typeof context.getElementsByTagName!==strundefined)return context.getElementsByTagName(tag)}:function(tag,context){var elem,tmp=[],i=0,results=context.getElementsByTagName(tag);if("*"===tag){for(;elem=results[i++];)1===elem.nodeType&&tmp.push(elem);return tmp}return results},Expr.find.NAME=support.getByName&&function(tag,context){if(typeof context.getElementsByName!==strundefined)return context.getElementsByName(name)},Expr.find.CLASS=support.getByClassName&&function(className,context){if(typeof context.getElementsByClassName!==strundefined&&!documentIsXML)return context.getElementsByClassName(className)},rbuggyMatches=[],rbuggyQSA=[":focus"],(support.qsa=isNative(doc.querySelectorAll))&&(assert(function(div){div.innerHTML="",div.querySelectorAll("[selected]").length||rbuggyQSA.push("\\["+whitespace+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),div.querySelectorAll(":checked").length||rbuggyQSA.push(":checked")}),assert(function(div){div.innerHTML="",div.querySelectorAll("[i^='']").length&&rbuggyQSA.push("[*^$]="+whitespace+"*(?:\"\"|'')"),div.querySelectorAll(":enabled").length||rbuggyQSA.push(":enabled",":disabled"),div.querySelectorAll("*,:x"),rbuggyQSA.push(",.*:")})),(support.matchesSelector=isNative(matches=docElem.matchesSelector||docElem.mozMatchesSelector||docElem.webkitMatchesSelector||docElem.oMatchesSelector||docElem.msMatchesSelector))&&assert(function(div){support.disconnectedMatch=matches.call(div,"div"),matches.call(div,"[s!='']:x"),rbuggyMatches.push("!=",pseudos)}),rbuggyQSA=new RegExp(rbuggyQSA.join("|")),rbuggyMatches=new RegExp(rbuggyMatches.join("|")),contains=isNative(docElem.contains)||docElem.compareDocumentPosition?function(a,b){var adown=9===a.nodeType?a.documentElement:a,bup=b&&b.parentNode;return a===bup||!(!bup||1!==bup.nodeType||!(adown.contains?adown.contains(bup):a.compareDocumentPosition&&16&a.compareDocumentPosition(bup)))}:function(a,b){if(b)for(;b=b.parentNode;)if(b===a)return!0;return!1},sortOrder=docElem.compareDocumentPosition?function(a,b){var compare;return a===b?(hasDuplicate=!0,0):(compare=b.compareDocumentPosition&&a.compareDocumentPosition&&a.compareDocumentPosition(b))?1&compare||a.parentNode&&11===a.parentNode.nodeType?a===doc||contains(preferredDoc,a)?-1:b===doc||contains(preferredDoc,b)?1:0:4&compare?-1:1:a.compareDocumentPosition?-1:1}:function(a,b){var cur,i=0,aup=a.parentNode,bup=b.parentNode,ap=[a],bp=[b];if(a===b)return hasDuplicate=!0,0;if(!aup||!bup)return a===doc?-1:b===doc?1:aup?-1:bup?1:0;if(aup===bup)return siblingCheck(a,b);for(cur=a;cur=cur.parentNode;)ap.unshift(cur);for(cur=b;cur=cur.parentNode;)bp.unshift(cur);for(;ap[i]===bp[i];)i++;return i?siblingCheck(ap[i],bp[i]):ap[i]===preferredDoc?-1:bp[i]===preferredDoc?1:0},hasDuplicate=!1,[0,0].sort(sortOrder),support.detectDuplicates=hasDuplicate,document):document},Sizzle.matches=function(expr,elements){return Sizzle(expr,null,null,elements)},Sizzle.matchesSelector=function(elem,expr){if((elem.ownerDocument||elem)!==document&&setDocument(elem),expr=expr.replace(rattributeQuotes,"='$1']"),support.matchesSelector&&!documentIsXML&&(!rbuggyMatches||!rbuggyMatches.test(expr))&&!rbuggyQSA.test(expr))try{var ret=matches.call(elem,expr);if(ret||support.disconnectedMatch||elem.document&&11!==elem.document.nodeType)return ret}catch(e){}return Sizzle(expr,document,null,[elem]).length>0},Sizzle.contains=function(context,elem){return(context.ownerDocument||context)!==document&&setDocument(context),contains(context,elem)},Sizzle.attr=function(elem,name){var val;return(elem.ownerDocument||elem)!==document&&setDocument(elem),documentIsXML||(name=name.toLowerCase()),(val=Expr.attrHandle[name])?val(elem):documentIsXML||support.attributes?elem.getAttribute(name):((val=elem.getAttributeNode(name))||elem.getAttribute(name))&&elem[name]===!0?name:val&&val.specified?val.value:null},Sizzle.error=function(msg){throw new Error("Syntax error, unrecognized expression: "+msg)},Sizzle.uniqueSort=function(results){var elem,duplicates=[],i=1,j=0;if(hasDuplicate=!support.detectDuplicates,results.sort(sortOrder),hasDuplicate){for(;elem=results[i];i++)elem===results[i-1]&&(j=duplicates.push(i));for(;j--;)results.splice(duplicates[j],1)}return results},getText=Sizzle.getText=function(elem){var node,ret="",i=0,nodeType=elem.nodeType;if(nodeType){if(1===nodeType||9===nodeType||11===nodeType){if("string"==typeof elem.textContent)return elem.textContent;for(elem=elem.firstChild;elem;elem=elem.nextSibling)ret+=getText(elem)}else if(3===nodeType||4===nodeType)return elem.nodeValue}else for(;node=elem[i];i++)ret+=getText(node);return ret},Expr=Sizzle.selectors={cacheLength:50,createPseudo:markFunction,match:matchExpr,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(match){return match[1]=match[1].replace(runescape,funescape),match[3]=(match[4]||match[5]||"").replace(runescape,funescape),"~="===match[2]&&(match[3]=" "+match[3]+" "),match.slice(0,4)},CHILD:function(match){return match[1]=match[1].toLowerCase(),"nth"===match[1].slice(0,3)?(match[3]||Sizzle.error(match[0]),match[4]=+(match[4]?match[5]+(match[6]||1):2*("even"===match[3]||"odd"===match[3])),match[5]=+(match[7]+match[8]||"odd"===match[3])):match[3]&&Sizzle.error(match[0]),match},PSEUDO:function(match){var excess,unquoted=!match[5]&&match[2];return matchExpr.CHILD.test(match[0])?null:(match[4]?match[2]=match[4]:unquoted&&rpseudo.test(unquoted)&&(excess=tokenize(unquoted,!0))&&(excess=unquoted.indexOf(")",unquoted.length-excess)-unquoted.length)&&(match[0]=match[0].slice(0,excess),match[2]=unquoted.slice(0,excess)),match.slice(0,3))}},filter:{TAG:function(nodeName){return"*"===nodeName?function(){return!0}:(nodeName=nodeName.replace(runescape,funescape).toLowerCase(),function(elem){return elem.nodeName&&elem.nodeName.toLowerCase()===nodeName})},CLASS:function(className){var pattern=classCache[className+" "];return pattern||(pattern=new RegExp("(^|"+whitespace+")"+className+"("+whitespace+"|$)"))&&classCache(className,function(elem){return pattern.test(elem.className||typeof elem.getAttribute!==strundefined&&elem.getAttribute("class")||"")})},ATTR:function(name,operator,check){return function(elem){var result=Sizzle.attr(elem,name);return null==result?"!="===operator:!operator||(result+="","="===operator?result===check:"!="===operator?result!==check:"^="===operator?check&&0===result.indexOf(check):"*="===operator?check&&result.indexOf(check)>-1:"$="===operator?check&&result.slice(-check.length)===check:"~="===operator?(" "+result+" ").indexOf(check)>-1:"|="===operator&&(result===check||result.slice(0,check.length+1)===check+"-"))}},CHILD:function(type,what,argument,first,last){var simple="nth"!==type.slice(0,3),forward="last"!==type.slice(-4),ofType="of-type"===what;return 1===first&&0===last?function(elem){return!!elem.parentNode}:function(elem,context,xml){var cache,outerCache,node,diff,nodeIndex,start,dir=simple!==forward?"nextSibling":"previousSibling",parent=elem.parentNode,name=ofType&&elem.nodeName.toLowerCase(),useCache=!xml&&!ofType;if(parent){if(simple){for(;dir;){for(node=elem;node=node[dir];)if(ofType?node.nodeName.toLowerCase()===name:1===node.nodeType)return!1;start=dir="only"===type&&!start&&"nextSibling"}return!0}if(start=[forward?parent.firstChild:parent.lastChild],forward&&useCache){for(outerCache=parent[expando]||(parent[expando]={}),cache=outerCache[type]||[],nodeIndex=cache[0]===dirruns&&cache[1],diff=cache[0]===dirruns&&cache[2],node=nodeIndex&&parent.childNodes[nodeIndex];node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop();)if(1===node.nodeType&&++diff&&node===elem){outerCache[type]=[dirruns,nodeIndex,diff];break}}else if(useCache&&(cache=(elem[expando]||(elem[expando]={}))[type])&&cache[0]===dirruns)diff=cache[1];else for(;(node=++nodeIndex&&node&&node[dir]||(diff=nodeIndex=0)||start.pop())&&((ofType?node.nodeName.toLowerCase()!==name:1!==node.nodeType)||!++diff||(useCache&&((node[expando]||(node[expando]={}))[type]=[dirruns,diff]),node!==elem)););return diff-=last,diff===first||diff%first===0&&diff/first>=0}}},PSEUDO:function(pseudo,argument){var args,fn=Expr.pseudos[pseudo]||Expr.setFilters[pseudo.toLowerCase()]||Sizzle.error("unsupported pseudo: "+pseudo);return fn[expando]?fn(argument):fn.length>1?(args=[pseudo,pseudo,"",argument],Expr.setFilters.hasOwnProperty(pseudo.toLowerCase())?markFunction(function(seed,matches){for(var idx,matched=fn(seed,argument),i=matched.length;i--;)idx=indexOf.call(seed,matched[i]),seed[idx]=!(matches[idx]=matched[i])}):function(elem){return fn(elem,0,args)}):fn}},pseudos:{not:markFunction(function(selector){var input=[],results=[],matcher=compile(selector.replace(rtrim,"$1"));return matcher[expando]?markFunction(function(seed,matches,context,xml){for(var elem,unmatched=matcher(seed,null,xml,[]),i=seed.length;i--;)(elem=unmatched[i])&&(seed[i]=!(matches[i]=elem))}):function(elem,context,xml){return input[0]=elem,matcher(input,null,xml,results),!results.pop()}}),has:markFunction(function(selector){return function(elem){return Sizzle(selector,elem).length>0}}),contains:markFunction(function(text){return function(elem){return(elem.textContent||elem.innerText||getText(elem)).indexOf(text)>-1}}),lang:markFunction(function(lang){return ridentifier.test(lang||"")||Sizzle.error("unsupported lang: "+lang),lang=lang.replace(runescape,funescape).toLowerCase(),function(elem){var elemLang;do if(elemLang=documentIsXML?elem.getAttribute("xml:lang")||elem.getAttribute("lang"):elem.lang)return elemLang=elemLang.toLowerCase(),elemLang===lang||0===elemLang.indexOf(lang+"-");while((elem=elem.parentNode)&&1===elem.nodeType);return!1}}),target:function(elem){var hash=window.location&&window.location.hash;return hash&&hash.slice(1)===elem.id},root:function(elem){return elem===docElem},focus:function(elem){return elem===document.activeElement&&(!document.hasFocus||document.hasFocus())&&!!(elem.type||elem.href||~elem.tabIndex)},enabled:function(elem){return elem.disabled===!1},disabled:function(elem){return elem.disabled===!0},checked:function(elem){var nodeName=elem.nodeName.toLowerCase();return"input"===nodeName&&!!elem.checked||"option"===nodeName&&!!elem.selected},selected:function(elem){return elem.parentNode&&elem.parentNode.selectedIndex,elem.selected===!0},empty:function(elem){for(elem=elem.firstChild;elem;elem=elem.nextSibling)if(elem.nodeName>"@"||3===elem.nodeType||4===elem.nodeType)return!1;return!0},parent:function(elem){return!Expr.pseudos.empty(elem)},header:function(elem){return rheader.test(elem.nodeName)},input:function(elem){return rinputs.test(elem.nodeName)},button:function(elem){var name=elem.nodeName.toLowerCase();return"input"===name&&"button"===elem.type||"button"===name},text:function(elem){var attr;return"input"===elem.nodeName.toLowerCase()&&"text"===elem.type&&(null==(attr=elem.getAttribute("type"))||attr.toLowerCase()===elem.type)},first:createPositionalPseudo(function(){return[0]}),last:createPositionalPseudo(function(matchIndexes,length){return[length-1]}),eq:createPositionalPseudo(function(matchIndexes,length,argument){return[argument<0?argument+length:argument]}),even:createPositionalPseudo(function(matchIndexes,length){for(var i=0;i=0;)matchIndexes.push(i);return matchIndexes}),gt:createPositionalPseudo(function(matchIndexes,length,argument){for(var i=argument<0?argument+length:argument;++i1?jQuery.unique(ret):ret),ret.selector=(this.selector?this.selector+" ":"")+selector,ret},has:function(target){var i,targets=jQuery(target,this),len=targets.length;return this.filter(function(){for(i=0;i=0:jQuery.filter(selector,this).length>0:this.filter(selector).length>0)},closest:function(selectors,context){for(var cur,i=0,l=this.length,ret=[],pos=rneedsContext.test(selectors)||"string"!=typeof selectors?jQuery(selectors,context||this.context):0;i-1:jQuery.find.matchesSelector(cur,selectors)){ret.push(cur);break}cur=cur.parentNode}return this.pushStack(ret.length>1?jQuery.unique(ret):ret)},index:function(elem){return elem?"string"==typeof elem?jQuery.inArray(this[0],jQuery(elem)):jQuery.inArray(elem.jquery?elem[0]:elem,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(selector,context){var set="string"==typeof selector?jQuery(selector,context):jQuery.makeArray(selector&&selector.nodeType?[selector]:selector),all=jQuery.merge(this.get(),set);return this.pushStack(jQuery.unique(all))},addBack:function(selector){return this.add(null==selector?this.prevObject:this.prevObject.filter(selector))}}),jQuery.fn.andSelf=jQuery.fn.addBack,jQuery.each({parent:function(elem){var parent=elem.parentNode;return parent&&11!==parent.nodeType?parent:null},parents:function(elem){return jQuery.dir(elem,"parentNode")},parentsUntil:function(elem,i,until){return jQuery.dir(elem,"parentNode",until)},next:function(elem){return sibling(elem,"nextSibling")},prev:function(elem){return sibling(elem,"previousSibling")},nextAll:function(elem){return jQuery.dir(elem,"nextSibling")},prevAll:function(elem){return jQuery.dir(elem,"previousSibling")},nextUntil:function(elem,i,until){return jQuery.dir(elem,"nextSibling",until)},prevUntil:function(elem,i,until){return jQuery.dir(elem,"previousSibling",until)},siblings:function(elem){return jQuery.sibling((elem.parentNode||{}).firstChild,elem)},children:function(elem){return jQuery.sibling(elem.firstChild)},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.merge([],elem.childNodes)}},function(name,fn){jQuery.fn[name]=function(until,selector){var ret=jQuery.map(this,fn,until);return runtil.test(name)||(selector=until),selector&&"string"==typeof selector&&(ret=jQuery.filter(selector,ret)),ret=this.length>1&&!guaranteedUnique[name]?jQuery.unique(ret):ret,this.length>1&&rparentsprev.test(name)&&(ret=ret.reverse()),this.pushStack(ret)}}),jQuery.extend({filter:function(expr,elems,not){return not&&(expr=":not("+expr+")"),1===elems.length?jQuery.find.matchesSelector(elems[0],expr)?[elems[0]]:[]:jQuery.find.matches(expr,elems)},dir:function(elem,dir,until){for(var matched=[],cur=elem[dir];cur&&9!==cur.nodeType&&(until===undefined||1!==cur.nodeType||!jQuery(cur).is(until));)1===cur.nodeType&&matched.push(cur),cur=cur[dir];return matched},sibling:function(n,elem){for(var r=[];n;n=n.nextSibling)1===n.nodeType&&n!==elem&&r.push(n);return r}});var nodeNames="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",rinlinejQuery=/ jQuery\d+="(?:null|\d+)"/g,rnoshimcache=new RegExp("<(?:"+nodeNames+")[\\s/>]","i"),rleadingWhitespace=/^\s+/,rxhtmlTag=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,rtagName=/<([\w:]+)/,rtbody=/\s*$/g,wrapMap={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:jQuery.support.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},safeFragment=createSafeFragment(document),fragmentDiv=safeFragment.appendChild(document.createElement("div"));wrapMap.optgroup=wrapMap.option,wrapMap.tbody=wrapMap.tfoot=wrapMap.colgroup=wrapMap.caption=wrapMap.thead,wrapMap.th=wrapMap.td,jQuery.fn.extend({text:function(value){return jQuery.access(this,function(value){return value===undefined?jQuery.text(this):this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(value))},null,value,arguments.length)},wrapAll:function(html){if(jQuery.isFunction(html))return this.each(function(i){jQuery(this).wrapAll(html.call(this,i))});if(this[0]){var wrap=jQuery(html,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&wrap.insertBefore(this[0]),wrap.map(function(){for(var elem=this;elem.firstChild&&1===elem.firstChild.nodeType;)elem=elem.firstChild;return elem}).append(this)}return this},wrapInner:function(html){return jQuery.isFunction(html)?this.each(function(i){jQuery(this).wrapInner(html.call(this,i))}):this.each(function(){var self=jQuery(this),contents=self.contents();contents.length?contents.wrapAll(html):self.append(html)})},wrap:function(html){var isFunction=jQuery.isFunction(html);return this.each(function(i){jQuery(this).wrapAll(isFunction?html.call(this,i):html)})},unwrap:function(){return this.parent().each(function(){jQuery.nodeName(this,"body")||jQuery(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(elem){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.appendChild(elem)})},prepend:function(){return this.domManip(arguments,!0,function(elem){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||this.insertBefore(elem,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this)})},after:function(){return this.domManip(arguments,!1,function(elem){this.parentNode&&this.parentNode.insertBefore(elem,this.nextSibling)})},remove:function(selector,keepData){for(var elem,i=0;null!=(elem=this[i]);i++)(!selector||jQuery.filter(selector,[elem]).length>0)&&(keepData||1!==elem.nodeType||jQuery.cleanData(getAll(elem)), +elem.parentNode&&(keepData&&jQuery.contains(elem.ownerDocument,elem)&&setGlobalEval(getAll(elem,"script")),elem.parentNode.removeChild(elem)));return this},empty:function(){for(var elem,i=0;null!=(elem=this[i]);i++){for(1===elem.nodeType&&jQuery.cleanData(getAll(elem,!1));elem.firstChild;)elem.removeChild(elem.firstChild);elem.options&&jQuery.nodeName(elem,"select")&&(elem.options.length=0)}return this},clone:function(dataAndEvents,deepDataAndEvents){return dataAndEvents=null!=dataAndEvents&&dataAndEvents,deepDataAndEvents=null==deepDataAndEvents?dataAndEvents:deepDataAndEvents,this.map(function(){return jQuery.clone(this,dataAndEvents,deepDataAndEvents)})},html:function(value){return jQuery.access(this,function(value){var elem=this[0]||{},i=0,l=this.length;if(value===undefined)return 1===elem.nodeType?elem.innerHTML.replace(rinlinejQuery,""):undefined;if("string"==typeof value&&!rnoInnerhtml.test(value)&&(jQuery.support.htmlSerialize||!rnoshimcache.test(value))&&(jQuery.support.leadingWhitespace||!rleadingWhitespace.test(value))&&!wrapMap[(rtagName.exec(value)||["",""])[1].toLowerCase()]){value=value.replace(rxhtmlTag,"<$1>");try{for(;i")?clone=elem.cloneNode(!0):(fragmentDiv.innerHTML=elem.outerHTML,fragmentDiv.removeChild(clone=fragmentDiv.firstChild)),!(jQuery.support.noCloneEvent&&jQuery.support.noCloneChecked||1!==elem.nodeType&&11!==elem.nodeType||jQuery.isXMLDoc(elem)))for(destElements=getAll(clone),srcElements=getAll(elem),i=0;null!=(node=srcElements[i]);++i)destElements[i]&&fixCloneNodeIssues(node,destElements[i]);if(dataAndEvents)if(deepDataAndEvents)for(srcElements=srcElements||getAll(elem),destElements=destElements||getAll(clone),i=0;null!=(node=srcElements[i]);i++)cloneCopyEvent(node,destElements[i]);else cloneCopyEvent(elem,clone);return destElements=getAll(clone,"script"),destElements.length>0&&setGlobalEval(destElements,!inPage&&getAll(elem,"script")),destElements=srcElements=node=null,clone},buildFragment:function(elems,context,scripts,selection){for(var j,elem,contains,tmp,tag,tbody,wrap,l=elems.length,safe=createSafeFragment(context),nodes=[],i=0;i")+wrap[2],j=wrap[0];j--;)tmp=tmp.lastChild;if(!jQuery.support.leadingWhitespace&&rleadingWhitespace.test(elem)&&nodes.push(context.createTextNode(rleadingWhitespace.exec(elem)[0])),!jQuery.support.tbody)for(elem="table"!==tag||rtbody.test(elem)?""!==wrap[1]||rtbody.test(elem)?0:tmp:tmp.firstChild,j=elem&&elem.childNodes.length;j--;)jQuery.nodeName(tbody=elem.childNodes[j],"tbody")&&!tbody.childNodes.length&&elem.removeChild(tbody);for(jQuery.merge(nodes,tmp.childNodes),tmp.textContent="";tmp.firstChild;)tmp.removeChild(tmp.firstChild);tmp=safe.lastChild}else nodes.push(context.createTextNode(elem));for(tmp&&safe.removeChild(tmp),jQuery.support.appendChecked||jQuery.grep(getAll(nodes,"input"),fixDefaultChecked),i=0;elem=nodes[i++];)if((!selection||jQuery.inArray(elem,selection)===-1)&&(contains=jQuery.contains(elem.ownerDocument,elem),tmp=getAll(safe.appendChild(elem),"script"),contains&&setGlobalEval(tmp),scripts))for(j=0;elem=tmp[j++];)rscriptType.test(elem.type||"")&&scripts.push(elem);return tmp=null,safe},cleanData:function(elems,acceptData){for(var elem,type,id,data,i=0,internalKey=jQuery.expando,cache=jQuery.cache,deleteExpando=jQuery.support.deleteExpando,special=jQuery.event.special;null!=(elem=elems[i]);i++)if((acceptData||jQuery.acceptData(elem))&&(id=elem[internalKey],data=id&&cache[id])){if(data.events)for(type in data.events)special[type]?jQuery.event.remove(elem,type):jQuery.removeEvent(elem,type,data.handle);cache[id]&&(delete cache[id],deleteExpando?delete elem[internalKey]:typeof elem.removeAttribute!==core_strundefined?elem.removeAttribute(internalKey):elem[internalKey]=null,core_deletedIds.push(id))}}});var iframe,getStyles,curCSS,ralpha=/alpha\([^)]*\)/i,ropacity=/opacity\s*=\s*([^)]*)/,rposition=/^(top|right|bottom|left)$/,rdisplayswap=/^(none|table(?!-c[ea]).+)/,rmargin=/^margin/,rnumsplit=new RegExp("^("+core_pnum+")(.*)$","i"),rnumnonpx=new RegExp("^("+core_pnum+")(?!px)[a-z%]+$","i"),rrelNum=new RegExp("^([+-])=("+core_pnum+")","i"),elemdisplay={BODY:"block"},cssShow={position:"absolute",visibility:"hidden",display:"block"},cssNormalTransform={letterSpacing:0,fontWeight:400},cssExpand=["Top","Right","Bottom","Left"],cssPrefixes=["Webkit","O","Moz","ms"];jQuery.fn.extend({css:function(name,value){return jQuery.access(this,function(elem,name,value){var len,styles,map={},i=0;if(jQuery.isArray(name)){for(styles=getStyles(elem),len=name.length;i1)},show:function(){return showHide(this,!0)},hide:function(){return showHide(this)},toggle:function(state){var bool="boolean"==typeof state;return this.each(function(){(bool?state:isHidden(this))?jQuery(this).show():jQuery(this).hide()})}}),jQuery.extend({cssHooks:{opacity:{get:function(elem,computed){if(computed){var ret=curCSS(elem,"opacity");return""===ret?"1":ret}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":jQuery.support.cssFloat?"cssFloat":"styleFloat"},style:function(elem,name,value,extra){if(elem&&3!==elem.nodeType&&8!==elem.nodeType&&elem.style){var ret,type,hooks,origName=jQuery.camelCase(name),style=elem.style;if(name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],value===undefined)return hooks&&"get"in hooks&&(ret=hooks.get(elem,!1,extra))!==undefined?ret:style[name];if(type=typeof value,"string"===type&&(ret=rrelNum.exec(value))&&(value=(ret[1]+1)*ret[2]+parseFloat(jQuery.css(elem,name)),type="number"),!(null==value||"number"===type&&isNaN(value)||("number"!==type||jQuery.cssNumber[origName]||(value+="px"),jQuery.support.clearCloneStyle||""!==value||0!==name.indexOf("background")||(style[name]="inherit"),hooks&&"set"in hooks&&(value=hooks.set(elem,value,extra))===undefined)))try{style[name]=value}catch(e){}}},css:function(elem,name,extra,styles){var num,val,hooks,origName=jQuery.camelCase(name);return name=jQuery.cssProps[origName]||(jQuery.cssProps[origName]=vendorPropName(elem.style,origName)),hooks=jQuery.cssHooks[name]||jQuery.cssHooks[origName],hooks&&"get"in hooks&&(val=hooks.get(elem,!0,extra)),val===undefined&&(val=curCSS(elem,name,styles)),"normal"===val&&name in cssNormalTransform&&(val=cssNormalTransform[name]),""===extra||extra?(num=parseFloat(val),extra===!0||jQuery.isNumeric(num)?num||0:val):val},swap:function(elem,options,callback,args){var ret,name,old={};for(name in options)old[name]=elem.style[name],elem.style[name]=options[name];ret=callback.apply(elem,args||[]);for(name in options)elem.style[name]=old[name];return ret}}),window.getComputedStyle?(getStyles=function(elem){return window.getComputedStyle(elem,null)},curCSS=function(elem,name,_computed){var width,minWidth,maxWidth,computed=_computed||getStyles(elem),ret=computed?computed.getPropertyValue(name)||computed[name]:undefined,style=elem.style;return computed&&(""!==ret||jQuery.contains(elem.ownerDocument,elem)||(ret=jQuery.style(elem,name)),rnumnonpx.test(ret)&&rmargin.test(name)&&(width=style.width,minWidth=style.minWidth,maxWidth=style.maxWidth,style.minWidth=style.maxWidth=style.width=ret,ret=computed.width,style.width=width,style.minWidth=minWidth,style.maxWidth=maxWidth)),ret}):document.documentElement.currentStyle&&(getStyles=function(elem){return elem.currentStyle},curCSS=function(elem,name,_computed){var left,rs,rsLeft,computed=_computed||getStyles(elem),ret=computed?computed[name]:undefined,style=elem.style;return null==ret&&style&&style[name]&&(ret=style[name]),rnumnonpx.test(ret)&&!rposition.test(name)&&(left=style.left,rs=elem.runtimeStyle,rsLeft=rs&&rs.left,rsLeft&&(rs.left=elem.currentStyle.left),style.left="fontSize"===name?"1em":ret,ret=style.pixelLeft+"px",style.left=left,rsLeft&&(rs.left=rsLeft)),""===ret?"auto":ret}),jQuery.each(["height","width"],function(i,name){jQuery.cssHooks[name]={get:function(elem,computed,extra){if(computed)return 0===elem.offsetWidth&&rdisplayswap.test(jQuery.css(elem,"display"))?jQuery.swap(elem,cssShow,function(){return getWidthOrHeight(elem,name,extra)}):getWidthOrHeight(elem,name,extra)},set:function(elem,value,extra){var styles=extra&&getStyles(elem);return setPositiveNumber(elem,value,extra?augmentWidthOrHeight(elem,name,extra,jQuery.support.boxSizing&&"border-box"===jQuery.css(elem,"boxSizing",!1,styles),styles):0)}}}),jQuery.support.opacity||(jQuery.cssHooks.opacity={get:function(elem,computed){return ropacity.test((computed&&elem.currentStyle?elem.currentStyle.filter:elem.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":computed?"1":""},set:function(elem,value){var style=elem.style,currentStyle=elem.currentStyle,opacity=jQuery.isNumeric(value)?"alpha(opacity="+100*value+")":"",filter=currentStyle&¤tStyle.filter||style.filter||"";style.zoom=1,(value>=1||""===value)&&""===jQuery.trim(filter.replace(ralpha,""))&&style.removeAttribute&&(style.removeAttribute("filter"),""===value||currentStyle&&!currentStyle.filter)||(style.filter=ralpha.test(filter)?filter.replace(ralpha,opacity):filter+" "+opacity)}}),jQuery(function(){jQuery.support.reliableMarginRight||(jQuery.cssHooks.marginRight={get:function(elem,computed){if(computed)return jQuery.swap(elem,{display:"inline-block"},curCSS,[elem,"marginRight"])}}),!jQuery.support.pixelPosition&&jQuery.fn.position&&jQuery.each(["top","left"],function(i,prop){jQuery.cssHooks[prop]={get:function(elem,computed){if(computed)return computed=curCSS(elem,prop),rnumnonpx.test(computed)?jQuery(elem).position()[prop]+"px":computed}}})}),jQuery.expr&&jQuery.expr.filters&&(jQuery.expr.filters.hidden=function(elem){return elem.offsetWidth<=0&&elem.offsetHeight<=0||!jQuery.support.reliableHiddenOffsets&&"none"===(elem.style&&elem.style.display||jQuery.css(elem,"display"))},jQuery.expr.filters.visible=function(elem){return!jQuery.expr.filters.hidden(elem)}),jQuery.each({margin:"",padding:"",border:"Width"},function(prefix,suffix){jQuery.cssHooks[prefix+suffix]={expand:function(value){for(var i=0,expanded={},parts="string"==typeof value?value.split(" "):[value];i<4;i++)expanded[prefix+cssExpand[i]+suffix]=parts[i]||parts[i-2]||parts[0];return expanded}},rmargin.test(prefix)||(jQuery.cssHooks[prefix+suffix].set=setPositiveNumber)});var r20=/%20/g,rbracket=/\[\]$/,rCRLF=/\r?\n/g,rsubmitterTypes=/^(?:submit|button|image|reset|file)$/i,rsubmittable=/^(?:input|select|textarea|keygen)/i;jQuery.fn.extend({serialize:function(){return jQuery.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var elements=jQuery.prop(this,"elements");return elements?jQuery.makeArray(elements):this}).filter(function(){var type=this.type;return this.name&&!jQuery(this).is(":disabled")&&rsubmittable.test(this.nodeName)&&!rsubmitterTypes.test(type)&&(this.checked||!manipulation_rcheckableType.test(type))}).map(function(i,elem){var val=jQuery(this).val();return null==val?null:jQuery.isArray(val)?jQuery.map(val,function(val){return{name:elem.name,value:val.replace(rCRLF,"\r\n")}}):{name:elem.name,value:val.replace(rCRLF,"\r\n")}}).get()}}),jQuery.param=function(a,traditional){var prefix,s=[],add=function(key,value){value=jQuery.isFunction(value)?value():null==value?"":value,s[s.length]=encodeURIComponent(key)+"="+encodeURIComponent(value)};if(traditional===undefined&&(traditional=jQuery.ajaxSettings&&jQuery.ajaxSettings.traditional),jQuery.isArray(a)||a.jquery&&!jQuery.isPlainObject(a))jQuery.each(a,function(){add(this.name,this.value)});else for(prefix in a)buildParams(prefix,a[prefix],traditional,add);return s.join("&").replace(r20,"+")},jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(i,name){jQuery.fn[name]=function(data,fn){return arguments.length>0?this.on(name,null,data,fn):this.trigger(name)}}),jQuery.fn.hover=function(fnOver,fnOut){return this.mouseenter(fnOver).mouseleave(fnOut||fnOver)};var ajaxLocParts,ajaxLocation,ajax_nonce=jQuery.now(),ajax_rquery=/\?/,rhash=/#.*$/,rts=/([?&])_=[^&]*/,rheaders=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,rlocalProtocol=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,rnoContent=/^(?:GET|HEAD)$/,rprotocol=/^\/\//,rurl=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,_load=jQuery.fn.load,prefilters={},transports={},allTypes="*/".concat("*");try{ajaxLocation=location.href}catch(e){ajaxLocation=document.createElement("a"),ajaxLocation.href="",ajaxLocation=ajaxLocation.href}ajaxLocParts=rurl.exec(ajaxLocation.toLowerCase())||[],jQuery.fn.load=function(url,params,callback){if("string"!=typeof url&&_load)return _load.apply(this,arguments);var selector,response,type,self=this,off=url.indexOf(" ");return off>=0&&(selector=url.slice(off,url.length),url=url.slice(0,off)),jQuery.isFunction(params)?(callback=params,params=undefined):params&&"object"==typeof params&&(type="POST"),self.length>0&&jQuery.ajax({url:url,type:type,dataType:"html",data:params}).done(function(responseText){response=arguments,self.html(selector?jQuery("
    ").append(jQuery.parseHTML(responseText)).find(selector):responseText)}).complete(callback&&function(jqXHR,status){self.each(callback,response||[jqXHR.responseText,status,jqXHR])}),this},jQuery.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(i,type){jQuery.fn[type]=function(fn){return this.on(type,fn)}}),jQuery.each(["get","post"],function(i,method){jQuery[method]=function(url,data,callback,type){return jQuery.isFunction(data)&&(type=type||callback,callback=data,data=undefined),jQuery.ajax({url:url,type:method,dataType:type,data:data,success:callback})}}),jQuery.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ajaxLocation,type:"GET",isLocal:rlocalProtocol.test(ajaxLocParts[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":allTypes,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":window.String,"text html":!0,"text json":jQuery.parseJSON,"text xml":jQuery.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(target,settings){return settings?ajaxExtend(ajaxExtend(target,jQuery.ajaxSettings),settings):ajaxExtend(jQuery.ajaxSettings,target)},ajaxPrefilter:addToPrefiltersOrTransports(prefilters),ajaxTransport:addToPrefiltersOrTransports(transports),ajax:function(url,options){function done(status,nativeStatusText,responses,headers){var isSuccess,success,error,response,modified,statusText=nativeStatusText;2!==state&&(state=2,timeoutTimer&&clearTimeout(timeoutTimer),transport=undefined,responseHeadersString=headers||"",jqXHR.readyState=status>0?4:0,responses&&(response=ajaxHandleResponses(s,jqXHR,responses)),status>=200&&status<300||304===status?(s.ifModified&&(modified=jqXHR.getResponseHeader("Last-Modified"),modified&&(jQuery.lastModified[cacheURL]=modified),modified=jqXHR.getResponseHeader("etag"),modified&&(jQuery.etag[cacheURL]=modified)),204===status?(isSuccess=!0,statusText="nocontent"):304===status?(isSuccess=!0,statusText="notmodified"):(isSuccess=ajaxConvert(s,response),statusText=isSuccess.state,success=isSuccess.data,error=isSuccess.error,isSuccess=!error)):(error=statusText,!status&&statusText||(statusText="error",status<0&&(status=0))),jqXHR.status=status,jqXHR.statusText=(nativeStatusText||statusText)+"",isSuccess?deferred.resolveWith(callbackContext,[success,statusText,jqXHR]):deferred.rejectWith(callbackContext,[jqXHR,statusText,error]),jqXHR.statusCode(statusCode),statusCode=undefined,fireGlobals&&globalEventContext.trigger(isSuccess?"ajaxSuccess":"ajaxError",[jqXHR,s,isSuccess?success:error]),completeDeferred.fireWith(callbackContext,[jqXHR,statusText]),fireGlobals&&(globalEventContext.trigger("ajaxComplete",[jqXHR,s]),--jQuery.active||jQuery.event.trigger("ajaxStop")))}"object"==typeof url&&(options=url,url=undefined),options=options||{};var parts,i,cacheURL,responseHeadersString,timeoutTimer,fireGlobals,transport,responseHeaders,s=jQuery.ajaxSetup({},options),callbackContext=s.context||s,globalEventContext=s.context&&(callbackContext.nodeType||callbackContext.jquery)?jQuery(callbackContext):jQuery.event,deferred=jQuery.Deferred(),completeDeferred=jQuery.Callbacks("once memory"),statusCode=s.statusCode||{},requestHeaders={},requestHeadersNames={},state=0,strAbort="canceled",jqXHR={readyState:0,getResponseHeader:function(key){var match;if(2===state){if(!responseHeaders)for(responseHeaders={};match=rheaders.exec(responseHeadersString);)responseHeaders[match[1].toLowerCase()]=match[2];match=responseHeaders[key.toLowerCase()]}return null==match?null:match},getAllResponseHeaders:function(){return 2===state?responseHeadersString:null},setRequestHeader:function(name,value){var lname=name.toLowerCase();return state||(name=requestHeadersNames[lname]=requestHeadersNames[lname]||name,requestHeaders[name]=value),this},overrideMimeType:function(type){return state||(s.mimeType=type),this},statusCode:function(map){var code;if(map)if(state<2)for(code in map)statusCode[code]=[statusCode[code],map[code]];else jqXHR.always(map[jqXHR.status]);return this},abort:function(statusText){var finalText=statusText||strAbort;return transport&&transport.abort(finalText),done(0,finalText),this}};if(deferred.promise(jqXHR).complete=completeDeferred.add,jqXHR.success=jqXHR.done,jqXHR.error=jqXHR.fail,s.url=((url||s.url||ajaxLocation)+"").replace(rhash,"").replace(rprotocol,ajaxLocParts[1]+"//"),s.type=options.method||options.type||s.method||s.type,s.dataTypes=jQuery.trim(s.dataType||"*").toLowerCase().match(core_rnotwhite)||[""],null==s.crossDomain&&(parts=rurl.exec(s.url.toLowerCase()),s.crossDomain=!(!parts||parts[1]===ajaxLocParts[1]&&parts[2]===ajaxLocParts[2]&&(parts[3]||("http:"===parts[1]?80:443))==(ajaxLocParts[3]||("http:"===ajaxLocParts[1]?80:443)))),s.data&&s.processData&&"string"!=typeof s.data&&(s.data=jQuery.param(s.data,s.traditional)),inspectPrefiltersOrTransports(prefilters,s,options,jqXHR),2===state)return jqXHR;fireGlobals=s.global,fireGlobals&&0===jQuery.active++&&jQuery.event.trigger("ajaxStart"),s.type=s.type.toUpperCase(),s.hasContent=!rnoContent.test(s.type),cacheURL=s.url,s.hasContent||(s.data&&(cacheURL=s.url+=(ajax_rquery.test(cacheURL)?"&":"?")+s.data,delete s.data),s.cache===!1&&(s.url=rts.test(cacheURL)?cacheURL.replace(rts,"$1_="+ajax_nonce++):cacheURL+(ajax_rquery.test(cacheURL)?"&":"?")+"_="+ajax_nonce++)),s.ifModified&&(jQuery.lastModified[cacheURL]&&jqXHR.setRequestHeader("If-Modified-Since",jQuery.lastModified[cacheURL]),jQuery.etag[cacheURL]&&jqXHR.setRequestHeader("If-None-Match",jQuery.etag[cacheURL])),(s.data&&s.hasContent&&s.contentType!==!1||options.contentType)&&jqXHR.setRequestHeader("Content-Type",s.contentType),jqXHR.setRequestHeader("Accept",s.dataTypes[0]&&s.accepts[s.dataTypes[0]]?s.accepts[s.dataTypes[0]]+("*"!==s.dataTypes[0]?", "+allTypes+"; q=0.01":""):s.accepts["*"]);for(i in s.headers)jqXHR.setRequestHeader(i,s.headers[i]);if(s.beforeSend&&(s.beforeSend.call(callbackContext,jqXHR,s)===!1||2===state))return jqXHR.abort();strAbort="abort";for(i in{success:1,error:1,complete:1})jqXHR[i](s[i]);if(transport=inspectPrefiltersOrTransports(transports,s,options,jqXHR)){jqXHR.readyState=1,fireGlobals&&globalEventContext.trigger("ajaxSend",[jqXHR,s]),s.async&&s.timeout>0&&(timeoutTimer=setTimeout(function(){jqXHR.abort("timeout")},s.timeout));try{state=1,transport.send(requestHeaders,done)}catch(e){if(!(state<2))throw e;done(-1,e)}}else done(-1,"No Transport");return jqXHR},getScript:function(url,callback){return jQuery.get(url,undefined,callback,"script")},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json")}}),jQuery.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(text){return jQuery.globalEval(text),text}}}),jQuery.ajaxPrefilter("script",function(s){s.cache===undefined&&(s.cache=!1),s.crossDomain&&(s.type="GET",s.global=!1)}),jQuery.ajaxTransport("script",function(s){if(s.crossDomain){var script,head=document.head||jQuery("head")[0]||document.documentElement;return{send:function(_,callback){script=document.createElement("script"),script.async=!0,s.scriptCharset&&(script.charset=s.scriptCharset),script.src=s.url,script.onload=script.onreadystatechange=function(_,isAbort){(isAbort||!script.readyState||/loaded|complete/.test(script.readyState))&&(script.onload=script.onreadystatechange=null,script.parentNode&&script.parentNode.removeChild(script),script=null,isAbort||callback(200,"success"))},head.insertBefore(script,head.firstChild)},abort:function(){script&&script.onload(undefined,!0)}}}});var oldCallbacks=[],rjsonp=/(=)\?(?=&|$)|\?\?/;jQuery.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var callback=oldCallbacks.pop()||jQuery.expando+"_"+ajax_nonce++;return this[callback]=!0,callback}}),jQuery.ajaxPrefilter("json jsonp",function(s,originalSettings,jqXHR){var callbackName,overwritten,responseContainer,jsonProp=s.jsonp!==!1&&(rjsonp.test(s.url)?"url":"string"==typeof s.data&&!(s.contentType||"").indexOf("application/x-www-form-urlencoded")&&rjsonp.test(s.data)&&"data");if(jsonProp||"jsonp"===s.dataTypes[0])return callbackName=s.jsonpCallback=jQuery.isFunction(s.jsonpCallback)?s.jsonpCallback():s.jsonpCallback,jsonProp?s[jsonProp]=s[jsonProp].replace(rjsonp,"$1"+callbackName):s.jsonp!==!1&&(s.url+=(ajax_rquery.test(s.url)?"&":"?")+s.jsonp+"="+callbackName),s.converters["script json"]=function(){return responseContainer||jQuery.error(callbackName+" was not called"),responseContainer[0]},s.dataTypes[0]="json",overwritten=window[callbackName],window[callbackName]=function(){responseContainer=arguments},jqXHR.always(function(){window[callbackName]=overwritten,s[callbackName]&&(s.jsonpCallback=originalSettings.jsonpCallback,oldCallbacks.push(callbackName)),responseContainer&&jQuery.isFunction(overwritten)&&overwritten(responseContainer[0]),responseContainer=overwritten=undefined}),"script"});var xhrCallbacks,xhrSupported,xhrId=0,xhrOnUnloadAbort=window.ActiveXObject&&function(){var key;for(key in xhrCallbacks)xhrCallbacks[key](undefined,!0)};jQuery.ajaxSettings.xhr=window.ActiveXObject?function(){return!this.isLocal&&createStandardXHR()||createActiveXHR()}:createStandardXHR,xhrSupported=jQuery.ajaxSettings.xhr(),jQuery.support.cors=!!xhrSupported&&"withCredentials"in xhrSupported,xhrSupported=jQuery.support.ajax=!!xhrSupported,xhrSupported&&jQuery.ajaxTransport(function(s){if(!s.crossDomain||jQuery.support.cors){var callback;return{send:function(headers,complete){var handle,i,xhr=s.xhr();if(s.username?xhr.open(s.type,s.url,s.async,s.username,s.password):xhr.open(s.type,s.url,s.async),s.xhrFields)for(i in s.xhrFields)xhr[i]=s.xhrFields[i];s.mimeType&&xhr.overrideMimeType&&xhr.overrideMimeType(s.mimeType),s.crossDomain||headers["X-Requested-With"]||(headers["X-Requested-With"]="XMLHttpRequest");try{for(i in headers)xhr.setRequestHeader(i,headers[i])}catch(err){}xhr.send(s.hasContent&&s.data||null),callback=function(_,isAbort){var status,responseHeaders,statusText,responses;try{if(callback&&(isAbort||4===xhr.readyState))if(callback=undefined,handle&&(xhr.onreadystatechange=jQuery.noop,xhrOnUnloadAbort&&delete xhrCallbacks[handle]),isAbort)4!==xhr.readyState&&xhr.abort();else{responses={},status=xhr.status,responseHeaders=xhr.getAllResponseHeaders(),"string"==typeof xhr.responseText&&(responses.text=xhr.responseText);try{statusText=xhr.statusText}catch(e){statusText=""}status||!s.isLocal||s.crossDomain?1223===status&&(status=204):status=responses.text?200:404}}catch(firefoxAccessException){isAbort||complete(-1,firefoxAccessException)}responses&&complete(status,statusText,responses,responseHeaders)},s.async?4===xhr.readyState?setTimeout(callback):(handle=++xhrId,xhrOnUnloadAbort&&(xhrCallbacks||(xhrCallbacks={},jQuery(window).unload(xhrOnUnloadAbort)),xhrCallbacks[handle]=callback),xhr.onreadystatechange=callback):callback()},abort:function(){callback&&callback(undefined,!0)}}}});var fxNow,timerId,rfxtypes=/^(?:toggle|show|hide)$/,rfxnum=new RegExp("^(?:([+-])=|)("+core_pnum+")([a-z%]*)$","i"),rrun=/queueHooks$/,animationPrefilters=[defaultPrefilter],tweeners={"*":[function(prop,value){var end,unit,tween=this.createTween(prop,value),parts=rfxnum.exec(value),target=tween.cur(),start=+target||0,scale=1,maxIterations=20;if(parts){if(end=+parts[2],unit=parts[3]||(jQuery.cssNumber[prop]?"":"px"),"px"!==unit&&start){start=jQuery.css(tween.elem,prop,!0)||end||1;do scale=scale||".5",start/=scale,jQuery.style(tween.elem,prop,start+unit);while(scale!==(scale=tween.cur()/target)&&1!==scale&&--maxIterations)}tween.unit=unit,tween.start=start,tween.end=parts[1]?start+(parts[1]+1)*end:end}return tween}]};jQuery.Animation=jQuery.extend(Animation,{tweener:function(props,callback){jQuery.isFunction(props)?(callback=props,props=["*"]):props=props.split(" ");for(var prop,index=0,length=props.length;index-1,props={},curPosition={},curTop,curLeft;calculatePosition?(curPosition=curElem.position(),curTop=curPosition.top,curLeft=curPosition.left):(curTop=parseFloat(curCSSTop)||0,curLeft=parseFloat(curCSSLeft)||0),jQuery.isFunction(options)&&(options=options.call(elem,i,curOffset)),null!=options.top&&(props.top=options.top-curOffset.top+curTop),null!=options.left&&(props.left=options.left-curOffset.left+curLeft),"using"in options?options.using.call(elem,props):curElem.css(props)}},jQuery.fn.extend({position:function(){if(this[0]){var offsetParent,offset,parentOffset={top:0,left:0},elem=this[0];return"fixed"===jQuery.css(elem,"position")?offset=elem.getBoundingClientRect():(offsetParent=this.offsetParent(),offset=this.offset(),jQuery.nodeName(offsetParent[0],"html")||(parentOffset=offsetParent.offset()),parentOffset.top+=jQuery.css(offsetParent[0],"borderTopWidth",!0),parentOffset.left+=jQuery.css(offsetParent[0],"borderLeftWidth",!0)),{top:offset.top-parentOffset.top-jQuery.css(elem,"marginTop",!0),left:offset.left-parentOffset.left-jQuery.css(elem,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var offsetParent=this.offsetParent||document.documentElement;offsetParent&&!jQuery.nodeName(offsetParent,"html")&&"static"===jQuery.css(offsetParent,"position");)offsetParent=offsetParent.offsetParent;return offsetParent||document.documentElement})}}),jQuery.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(method,prop){var top=/Y/.test(prop);jQuery.fn[method]=function(val){return jQuery.access(this,function(elem,method,val){var win=getWindow(elem);return val===undefined?win?prop in win?win[prop]:win.document.documentElement[method]:elem[method]:void(win?win.scrollTo(top?jQuery(win).scrollLeft():val,top?val:jQuery(win).scrollTop()):elem[method]=val)},method,val,arguments.length,null)}}),jQuery.each({Height:"height",Width:"width"},function(name,type){jQuery.each({padding:"inner"+name,content:type,"":"outer"+name},function(defaultExtra,funcName){jQuery.fn[funcName]=function(margin,value){var chainable=arguments.length&&(defaultExtra||"boolean"!=typeof margin),extra=defaultExtra||(margin===!0||value===!0?"margin":"border");return jQuery.access(this,function(elem,type,value){var doc;return jQuery.isWindow(elem)?elem.document.documentElement["client"+name]:9===elem.nodeType?(doc=elem.documentElement,Math.max(elem.body["scroll"+name],doc["scroll"+name],elem.body["offset"+name],doc["offset"+name],doc["client"+name])):value===undefined?jQuery.css(elem,type,extra):jQuery.style(elem,type,value,extra)},type,chainable?margin:undefined,chainable,null)}})}),BI.jQuery=BI.$=jQuery,window.$=window.$||jQuery,window.jQuery=window.jQuery||jQuery,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return jQuery})}(window),BI.$.extend(BI.$.Event.prototype,{stopEvent:function(){this.stopPropagation(),this.preventDefault()}}),BI.jQuery&&(!function($){$.fn.insets||($.fn.insets=function(){var p=this.padding(),b=this.border();return{top:p.top,bottom:p.bottom+b.bottom+b.top,left:p.left,right:p.right+b.right+b.left}}),$.fn.bounds||($.fn.bounds=function(value){var tmp={hasIgnoredBounds:!0};return value?(isNaN(value.x)||(tmp.left=value.x),isNaN(value.y)||(tmp.top=value.y),null!=value.width&&(tmp.width=value.width-(this.outerWidth(!0)-this.width()),tmp.width=tmp.width>=0?tmp.width:value.width),null!=value.height&&(tmp.height=value.height-(this.outerHeight(!0)-this.height()),tmp.height=tmp.height>=0?tmp.height:value.height),this.css(tmp),this):(tmp=this.position(),{x:tmp.left,y:tmp.top,width:this.outerWidth(),height:this.outerHeight()})})}(BI.jQuery),BI.extend(BI.jQuery.fn,{destroy:function(){this.remove(),BI.isIE()===!0&&(this[0].outerHTML="")},__textKeywordMarked__:function(text,keyword,py){if(!BI.isKey(keyword)||(text+"").length>100)return this.html(BI.htmlEncode(text));keyword+="",keyword=BI.toUpperCase(keyword);var textLeft=(text||"")+"";for(py=(py||BI.makeFirstPY(text))+"",null!=py&&(py=BI.toUpperCase(py)),this.empty();py.length>0&&textLeft.length>0;){var tidx=BI.toUpperCase(textLeft).indexOf(keyword),pidx=null;if(null!=py&&(pidx=py.indexOf(keyword),pidx>=0&&(pidx%=text.length)),tidx>=0)this.append(BI.htmlEncode(textLeft.substr(0,tidx))),this.append(BI.$("").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(tidx,keyword.length)))),textLeft=textLeft.substr(tidx+keyword.length),null!=py&&(py=py.substr(tidx+keyword.length));else{if(!(null!=pidx&&pidx>=0&&Math.floor(pidx/text.length)===Math.floor((pidx+keyword.length-1)/text.length))){this.append(BI.htmlEncode(textLeft));break}this.append(BI.htmlEncode(textLeft.substr(0,pidx))),this.append(BI.$("").addClass("bi-keyword-red-mark").html(BI.htmlEncode(textLeft.substr(pidx,keyword.length)))),null!=py&&(py=py.substr(pidx+keyword.length)),textLeft=textLeft.substr(pidx+keyword.length)}}return this},getDomHeight:function(parent){var clone=BI.$(this).clone();clone.appendTo(BI.$(parent||"body"));var height=clone.height();return clone.remove(),height},hasVerticalScroll:function(){return this.height()>0&&this[0].clientWidth0&&this[0].clientHeightoffset2Body.left+width||e.pageYoffset2Body.top+height)},__hasZIndexMask__:function(zindex){return zindex&&null!=this.zIndexMask[zindex]},__buildZIndexMask__:function(zindex,domArray){this.zIndexMask=this.zIndexMask||{},this.indexMask=this.indexMask||[];var mask=BI.createWidget({type:"bi.center_adapt",cls:"bi-z-index-mask",items:domArray});return mask.element.css({"z-index":zindex}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:mask,left:0,right:0,top:0,bottom:0}]}),this.indexMask.push(mask),zindex&&(this.zIndexMask[zindex]=mask),mask.element},__releaseZIndexMask__:function(zindex){if(zindex&&this.zIndexMask[zindex])return BI.remove(this.indexMask,this.zIndexMask[zindex]),void this.zIndexMask[zindex].destroy();this.indexMask=this.indexMask||[];var indexMask=this.indexMask.pop();indexMask&&indexMask.destroy()}})),_.extend(BI,{$import:function(){function loadReady(src,must){var $scripts=BI.$("head script, body script");BI.$.each($scripts,function(i,item){item.src.indexOf(src)!=-1&&(_LOADED[src]=!0)});var $links=BI.$("head link");BI.$.each($links,function(i,item){item.href.indexOf(src)!=-1&&must&&(_LOADED[src]=!1,BI.$(item).remove())})}var _LOADED={};return function(src,ext,must){if(loadReady(src,must),_LOADED[src]!==!0)if("css"===ext){var link=document.createElement("link");link.rel="stylesheet",link.type="text/css",link.href=src;var head=document.getElementsByTagName("head")[0];head.appendChild(link),_LOADED[src]=!0}else BI.$.ajax({url:src,dataType:"script",async:!1,cache:!0,complete:function(res,status){"success"==status&&(_LOADED[src]=!0)}})}}()}),Number.prototype.toFixed&&"0.000"===8e-5.toFixed(3)&&"0"!==.9.toFixed(0)&&"1.25"===1.255.toFixed(2)&&"1000000000000000128"===(0xde0b6b3a7640080).toFixed(0)||!function(){function multiply(n,c){for(var i=-1;++i=0;)c+=data[i],data[i]=Math.floor(c/n),c=c%n*base}function toString(){for(var i=size,s="";--i>=0;)if(""!==s||0===i||0!==data[i]){var t=String(data[i]);""===s?s=t:s+="0000000".slice(0,7-t.length)+t}return s}function pow(x,n,acc){return 0===n?acc:n%2===1?pow(x,n-1,acc*x):pow(x*x,n/2,acc)}function log(x){for(var n=0;x>=4096;)n+=12,x/=4096;for(;x>=2;)n+=1,x/=2;return n}var base,size,data,i;base=1e7,size=6,data=[0,0,0,0,0,0],Number.prototype.toFixed=function(fractionDigits){var f,x,s,m,e,z,j,k;if(f=Number(fractionDigits),f=f!==f?0:Math.floor(f),f<0||f>20)throw new RangeError("Number.toFixed called with invalid number of decimals");if(x=Number(this),x!==x)return"NaN";if(x<=-1e21||x>1e21)return String(x);if(s="",x<0&&(s="-",x=-x),m="0",x>1e-21)if(e=log(x*pow(2,69,1))-69,z=e<0?x*pow(2,-e,1):x/pow(2,e,1),z*=4503599627370496,e=52-e,e>0){for(multiply(0,z),j=f;j>=7;)multiply(1e7,0),j-=7;for(multiply(pow(10,j,1),0),j=e-1;j>=23;)divide(1<<23),j-=23;divide(1<0?(k=m.length,m=k<=f?s+"0.0000000000000000000".slice(0,f-k+2)+m:s+m.slice(0,k-f)+"."+m.slice(k-f)):m=s+m,m}}(),_.extend(BI,{MAX:0x1000000000000000,MIN:-0x1000000000000000,EVENT_RESPONSE_TIME:200,zIndex_layer:1e5,zIndex_popover:1e6,zIndex_popup:1e7,zIndex_masker:1e8,zIndex_tip:1e9,emptyStr:"",emptyFn:function(){},empty:null,Key:{48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/"},KeyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},Status:{SUCCESS:1,WRONG:2,START:3,END:4,WAITING:5,READY:6,RUNNING:7,OUTOFBOUNDS:8,NULL:-1},Direction:{Top:"top",Bottom:"bottom",Left:"left",Right:"right",Custom:"custom"},Axis:{Vertical:"vertical",Horizontal:"horizontal"},Selection:{Default:-2,None:-1,Single:0,Multi:1,All:2},HorizontalAlign:{Left:"left",Right:"right",Center:"center",Stretch:"stretch"},VerticalAlign:{Middle:"middle",Top:"top",Bottom:"bottom",Stretch:"stretch"},StartOfWeek:1}),BI.version="2.0",BI.AbsoluteCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-center-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0),right:o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0),top:o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0),bottom:o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0),margin:"auto"}),w},resize:function(){},populate:function(items){BI.AbsoluteCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_center_adapt",BI.AbsoluteCenterLayout),BI.AbsoluteHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-horizontal-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0),right:o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0),margin:"auto"}),o.vgap+o.tgap+(item.vgap||0)+(item.tgap||0)!==0&&w.element.css("top",o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)),o.vgap+o.bgap+(item.vgap||0)+(item.bgap||0)!==0&&w.element.css("bottom",o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)),w},resize:function(){},populate:function(items){BI.AbsoluteHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_horizontal_adapt",BI.AbsoluteHorizontalLayout),BI.AbsoluteVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-vertical-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.AbsoluteVerticalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"absolute",left:item.lgap,right:item.rgap,top:o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0),bottom:o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0),margin:"auto"}),o.hgap+o.lgap+(item.hgap||0)+(item.lgap||0)!==0&&w.element.css("left",o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)),o.hgap+o.rgap+(item.hgap||0)+(item.rgap||0)!==0&&w.element.css("right",o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)),w},resize:function(){},populate:function(items){BI.AbsoluteVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute_vertical_adapt",BI.AbsoluteVerticalLayout),BI.CenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CenterAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var o=this.options,self=this;return BI.CenterAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,items:o.items,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.center_adapt",BI.CenterAdaptLayout),BI.HorizontalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-adapt-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Center,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return BI.HorizontalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,items:o.items,scrollx:o.scrollx,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.horizontal_adapt",BI.HorizontalAdaptLayout),BI.LeftRightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-right-vertical-adapt-layout",items:{},llgap:0,lrgap:0,lhgap:0,rlgap:0,rrgap:0,rhgap:0})},render:function(){var o=this.options,self=this;BI.LeftRightVerticalAdaptLayout.superclass.render.apply(this,arguments);var layoutArray=[];return"left"in o.items&&layoutArray.push({type:"bi.left",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items.left,hgap:o.lhgap,lgap:o.llgap,rgap:o.lrgap}}]}),"right"in o.items&&layoutArray.push({type:"bi.right",items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items.right,textAlign:"right",hgap:o.rhgap,lgap:o.rlgap,rgap:o.rrgap}}]}),layoutArray},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){BI.LeftRightVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left_right_vertical_adapt",BI.LeftRightVerticalAdaptLayout),BI.LeftVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LeftRightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-left-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var o=this.options,self=this;return BI.LeftVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.left",ref:function(_ref){self.layout=_ref},items:[{el:{type:"bi.vertical_adapt",height:"100%",items:o.items,lgap:o.lgap,hgap:o.hgap,rgap:o.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.left_vertical_adapt",BI.LeftVerticalAdaptLayout),BI.RightVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.RightVerticalAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-right-vertical-adapt-layout",items:[],lgap:0,rgap:0,hgap:0})},render:function(){var o=this.options,self=this;return BI.RightVerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.right",ref:function(_ref){self.layout=_ref},items:[{el:{type:"bi.vertical_adapt",height:"100%",textAlign:"right",items:o.items,lgap:o.lgap,hgap:o.hgap,rgap:o.rgap}}]}},resize:function(){},addItem:function(){throw new Error("cannot be added")},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.right_vertical_adapt",BI.RightVerticalAdaptLayout),BI.TableAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableAdaptLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-center-adapt-layout",columnSize:[],verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var o=this.options;BI.TableAdaptLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("
    ").css({position:"relative",display:"table",height:o.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:o.horizontalAlign===BI.HorizontalAlign.Center?"100%":"auto","white-space":"nowrap"}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,td,width=o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i];if(this.hasWidget(this._getChildName(i)))td=this.getWidgetByName(this._getChildName(i)),td.element.width(width);else{var w=BI.createWidget(item);w.element.css({position:"relative",top:"0",left:"0",margin:"0px auto"}),td=BI.createWidget({type:"bi.default",width:width,items:[w]}),this.addWidget(this._getChildName(i),td)}return td.element.css({"max-width":o.columnSize[i]<=1?width:width+"px"}),0===i&&td.element.addClass("first-element"),td.element.css({position:"relative",display:"table-cell","vertical-align":o.verticalAlign,margin:"0",padding:"0",height:"100%"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),td},appendFragment:function(frag){this.$table.append(frag),this.element.append(this.$table)},resize:function(){},populate:function(items){BI.TableAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table_adapt",BI.TableAdaptLayout),BI.VerticalAdaptLayout=BI.inherit(BI.Layout,{props:{baseCls:"bi-vertical-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0},render:function(){var self=this,o=this.options;return BI.VerticalAdaptLayout.superclass.render.apply(this,arguments),{type:"bi.horizontal",verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,items:o.items,scrollx:o.scrollx,ref:function(_ref){self.layout=_ref},hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}},resize:function(){},populate:function(items){this.layout.populate.apply(this,arguments)}}),BI.shortcut("bi.vertical_adapt",BI.VerticalAdaptLayout),BI.HorizontalAutoLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalAutoLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizon-auto-layout",hgap:0,lgap:0,rgap:0,vgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalAutoLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.HorizontalAutoLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",margin:"0px auto"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_auto",BI.HorizontalAutoLayout),BI.FloatHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-horizontal-adapt-layout",items:[],hgap:0,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},render:function(){BI.FloatHorizontalLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},mounted:function(){var self=this,width=this.left.element.width(),height=this.left.element.height();this.left.element.width(width).height(height).css("float","none"),BI.remove(this._children,function(i,wi){wi===self.container&&delete self._children[i]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[this.left]})},_addElement:function(i,item){var self=this,o=this.options;return this.left=BI.createWidget({type:"bi.vertical",items:[item],hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,lgap:o.lgap,rgap:o.rgap}),this.container=BI.createWidget({type:"bi.left",element:this,items:[this.left]}),this.left},populate:function(items){BI.HorizontalAutoLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_float",BI.FloatHorizontalLayout),BI.InlineCenterAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-center-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineCenterAdaptLayout.superclass.render.apply(this,arguments),this.element.css({whiteSpace:"nowrap",textAlign:"center"}),this.populate(this.options.items)},_addElement:function(i,item,length){var o=this.options,w=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","vertical-align":"middle"}),w.element.addClass("inline-center-adapt-item"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("不能添加元素")},stroke:function(items){var self=this;BI.each(items,function(i,item){item&&self._addElement(i,item,items.length)})},populate:function(items){BI.InlineCenterAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_center_adapt",BI.InlineCenterAdaptLayout),BI.InlineVerticalAdaptLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-vertical-adapt-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,textAlign:"left"})},render:function(){BI.InlineVerticalAdaptLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.css({whiteSpace:"nowrap",textAlign:o.textAlign}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.InlineVerticalAdaptLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","vertical-align":"middle"}),w.element.addClass("inline-vertical-adapt-item"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.InlineVerticalAdaptLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline_vertical_adapt",BI.InlineVerticalAdaptLayout),BI.FlexCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-center-adapt-layout",hgap:0,vgap:0})},render:function(){BI.FlexCenterLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0","margin-left":(0===i?o.hgap:0)+"px","margin-right":o.hgap+"px","margin-top":o.vgap+"px","margin-bottom":o.vgap+"px"}),w},resize:function(){},populate:function(items){BI.FlexCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_center_adapt",BI.FlexCenterLayout),BI.FlexHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-center-adapt-layout",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_vertical",ref:function(_ref){self.wrapper=_ref},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:o.verticalAlign,rowSize:o.rowSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},resize:function(){},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_horizontal_adapt",BI.FlexHorizontalCenter),BI.shortcut("bi.flex_horizontal_center_adapt",BI.FlexHorizontalCenter),BI.FlexHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-horizontal-layout",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexHorizontalLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.addClass("v-"+o.verticalAlign).addClass("h-"+o.horizontalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.columnSize[i]>0&&w.element.width(o.columnSize[i]),"fill"===o.columnSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({ +"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.FlexHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_horizontal",BI.FlexHorizontalLayout),BI.FlexVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-center-adapt-layout",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,hgap:o.hgap,items:o.items}},resize:function(){},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_vertical_adapt",BI.FlexVerticalCenter),BI.shortcut("bi.flex_vertical_center_adapt",BI.FlexVerticalCenter),BI.FlexVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-vertical-layout",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.element.addClass("h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var w=BI.FlexVerticalLayout.superclass._addElement.apply(this,arguments),o=this.options;return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.FlexVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_vertical",BI.FlexVerticalLayout),BI.FlexWrapperCenterLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperCenterLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-center-adapt-layout clearfix",scrollable:!0})},render:function(){BI.FlexWrapperCenterLayout.superclass.render.apply(this,arguments),this.$wrapper=BI.Widget._renderEngine.createElement("
    ").addClass("flex-scrollable-center-adapt-layout-wrapper"),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperCenterLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","margin-left":(0===i?o.hgap:0)+"px","margin-right":o.hgap+"px","margin-top":o.vgap+"px","margin-bottom":o.vgap+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperCenterLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_center_adapt",BI.FlexWrapperCenterLayout),BI.FlexWrapperHorizontalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:!0,scrolly:!1,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_vertical",ref:function(_ref){self.wrapper=_ref},horizontalAlign:BI.HorizontalAlign.Center,verticalAlign:o.verticalAlign,rowSize:o.rowSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_horizontal_adapt",BI.FlexWrapperHorizontalCenter),BI.shortcut("bi.flex_scrollable_horizontal_center_adapt",BI.FlexWrapperHorizontalCenter),BI.FlexWrapperHorizontalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperHorizontalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-horizontal-layout clearfix",verticalAlign:BI.VerticalAlign.Top,horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollable:null,scrollx:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperHorizontalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("
    ").addClass("flex-scrollable-horizontal-layout-wrapper v-"+o.verticalAlign).addClass("h-"+o.horizontalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.columnSize[i]>0&&w.element.width(o.columnSize[i]),"fill"===o.columnSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperHorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_horizontal",BI.FlexWrapperHorizontalLayout),BI.FlexWrapperVerticalCenter=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalCenter.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-center-adapt-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,columnSize:[],scrollx:!1,scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){var self=this,o=this.options;return{type:"bi.flex_scrollable_horizontal",ref:function(_ref){self.wrapper=_ref},verticalAlign:BI.VerticalAlign.Middle,horizontalAlign:o.horizontalAlign,columnSize:o.columnSize,scrollx:o.scrollx,scrolly:o.scrolly,scrollable:o.scrollable,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,items:o.items}},update:function(opt){return this.wrapper.update(opt)},populate:function(items){this.wrapper.populate(items)}}),BI.shortcut("bi.flex_scrollable_vertical_adapt",BI.FlexWrapperVerticalCenter),BI.shortcut("bi.flex_scrollable_vertical_center_adapt",BI.FlexWrapperVerticalCenter),BI.FlexWrapperVerticalLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FlexWrapperVerticalLayout.superclass.props.apply(this,arguments),{baseCls:"bi-flex-scrollable-vertical-layout clearfix",horizontalAlign:BI.HorizontalAlign.Left,verticalAlign:BI.VerticalAlign.Top,rowSize:[],scrollable:null,scrolly:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FlexWrapperVerticalLayout.superclass.render.apply(this,arguments);var o=this.options;this.$wrapper=BI.Widget._renderEngine.createElement("
    ").addClass("flex-scrollable-vertical-layout-wrapper h-"+o.horizontalAlign).addClass("v-"+o.verticalAlign),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","flex-shrink":"0"}),o.rowSize[i]>0&&w.element.height(o.rowSize[i]),"fill"===o.rowSize[i]&&w.element.css("flex","1"),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":(0===i?o.vgap:0)+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},appendFragment:function(frag){this.$wrapper.append(frag),this.element.append(this.$wrapper)},_getWrapper:function(){return this.$wrapper},resize:function(){},populate:function(items){BI.FlexWrapperVerticalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.flex_scrollable_vertical",BI.FlexWrapperVerticalLayout),BI.AbsoluteLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AbsoluteLayout.superclass.props.apply(this,arguments),{baseCls:"bi-absolute-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AbsoluteLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AbsoluteLayout.superclass._addElement.apply(this,arguments),left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&(w.element.css({left:item.left}),left+=item.left),BI.isNotNull(item.right)&&(w.element.css({right:item.right}),right+=item.right),BI.isNotNull(item.top)&&(w.element.css({top:item.top}),top+=item.top),BI.isNotNull(item.bottom)&&(w.element.css({bottom:item.bottom}),bottom+=item.bottom),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({left:left}),right+=o.hgap,w.element.css({right:right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({top:top}),bottom+=o.vgap,w.element.css({bottom:bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({left:left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({right:right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({top:top})),BI.isNotNull(o.bgap)&&(bottom+=o.bgap,w.element.css({bottom:bottom})),BI.isNotNull(item.width)&&w.element.css({width:item.width}),BI.isNotNull(item.height)&&w.element.css({height:item.height}),w.element.css({position:"absolute"}),w},resize:function(){this.stroke(this.options.items)},stroke:function(items){this.options.items=items||[];var self=this;BI.each(items,function(i,item){if(item){if(!BI.isWidget(item)&&!item.el)throw new Error("el must be exist");self._addElement(i,item)}})},populate:function(items){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.absolute",BI.AbsoluteLayout),BI.AdaptiveLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.AdaptiveLayout.superclass.props.apply(this,arguments),{baseCls:"bi-adaptive-layout",hgap:null,vgap:null,lgap:null,rgap:null,tgap:null,bgap:null})},render:function(){BI.AdaptiveLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.AdaptiveLayout.superclass._addElement.apply(this,arguments);w.element.css({position:"relative"});var left=0,right=0,top=0,bottom=0;return BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),BI.isNotNull(o.hgap)&&(left+=o.hgap,w.element.css({"margin-left":left}),right+=o.hgap,w.element.css({"margin-right":right})),BI.isNotNull(o.vgap)&&(top+=o.vgap,w.element.css({"margin-top":top}),bottom+=o.vgap,w.element.css({"margin-bottom":bottom})),BI.isNotNull(o.lgap)&&(left+=o.lgap,w.element.css({"margin-left":left})),BI.isNotNull(o.rgap)&&(right+=o.rgap,w.element.css({"margin-right":right})),BI.isNotNull(o.tgap)&&(top+=o.tgap,w.element.css({"margin-top":top})),BI.isNotNull(o.bgap)&&(bottom+=o.bgap,w.element.css({"margin-bottom":bottom})),BI.isNotNull(item.width)&&w.element.css({width:item.width}),BI.isNotNull(item.height)&&w.element.css({height:item.height}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.AbsoluteLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.adaptive",BI.AdaptiveLayout),BI.BorderLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.BorderLayout.superclass.props.apply(this,arguments),{baseCls:"bi-border-layout",items:{}})},render:function(){BI.BorderLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(regions){var item,top=0,bottom=0,left=0,right=0;if("north"in regions&&(item=regions.north,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"north")){var w=BI.createWidget(item);this.addWidget(this.getName()+"north",w)}this.getWidgetByName(this.getName()+"north").element.height(item.height).css({position:"absolute",top:item.top||0,left:item.left||0,right:item.right||0,bottom:"initial"})}top=(item.height||0)+(item.top||0)+(item.bottom||0)}if("south"in regions&&(item=regions.south,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"south")){var w=BI.createWidget(item);this.addWidget(this.getName()+"south",w)}this.getWidgetByName(this.getName()+"south").element.height(item.height).css({position:"absolute",bottom:item.bottom||0,left:item.left||0,right:item.right||0,top:"initial"})}bottom=(item.height||0)+(item.top||0)+(item.bottom||0)}if("west"in regions&&(item=regions.west,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"west")){var w=BI.createWidget(item);this.addWidget(this.getName()+"west",w)}this.getWidgetByName(this.getName()+"west").element.width(item.width).css({position:"absolute",left:item.left||0,top:top,bottom:bottom,right:"initial"})}left=(item.width||0)+(item.left||0)+(item.right||0)}if("east"in regions&&(item=regions.east,null!=item)){if(item.el){if(!this.hasWidget(this.getName()+"east")){var w=BI.createWidget(item);this.addWidget(this.getName()+"east",w)}this.getWidgetByName(this.getName()+"east").element.width(item.width).css({position:"absolute",right:item.right||0,top:top,bottom:bottom,left:"initial"})}right=(item.width||0)+(item.left||0)+(item.right||0)}if("center"in regions&&(item=regions.center,null!=item)){if(!this.hasWidget(this.getName()+"center")){var w=BI.createWidget(item);this.addWidget(this.getName()+"center",w)}this.getWidgetByName(this.getName()+"center").element.css({position:"absolute",top:top,bottom:bottom,left:left,right:right})}},update:function(opt){},populate:function(items){BI.BorderLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.border",BI.BorderLayout),BI.CardLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.CardLayout.superclass.props.apply(this,arguments),{baseCls:"bi-card-layout",items:[]})},render:function(){BI.CardLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},stroke:function(items){var self=this,o=this.options;this.showIndex=void 0,BI.each(items,function(i,item){if(item){if(self.hasWidget(item.cardName))var w=self.getWidgetByName(item.cardName);else{var w=BI.createWidget(item);w.on(BI.Events.DESTROY,function(){var index=BI.findIndex(o.items,function(i,tItem){return tItem.cardName==item.cardName});index>-1&&o.items.splice(index,1)}),self.addWidget(item.cardName,w)}w.element.css({position:"absolute",top:"0",right:"0",bottom:"0",left:"0"}),w.setVisible(!1)}})},update:function(){},empty:function(){BI.CardLayout.superclass.empty.apply(this,arguments),this.options.items=[]},populate:function(items){BI.CardLayout.superclass.populate.apply(this,arguments),this._mount(),this.options.defaultShowName&&this.showCardByName(this.options.defaultShowName)},isCardExisted:function(cardName){return BI.some(this.options.items,function(i,item){return item.cardName==cardName&&item.el})},getCardByName:function(cardName){if(!this.isCardExisted(cardName))throw new Error("cardName is not exist");return this._children[cardName]},_deleteCardByName:function(cardName){delete this._children[cardName];var index=BI.findIndex(this.options.items,function(i,item){return item.cardName==cardName});index>-1&&this.options.items.splice(index,1)},deleteCardByName:function(cardName){if(!this.isCardExisted(cardName))throw new Error("cardName is not exist");var child=this._children[cardName];this._deleteCardByName(cardName),child&&child._destroy()},addCardByName:function(cardName,cardItem){if(this.isCardExisted(cardName))throw new Error("cardName is already exist");var widget=BI.createWidget(cardItem,this);return widget.element.css({position:"relative",top:"0",left:"0",width:"100%",height:"100%"}).appendTo(this.element),widget.invisible(),this.addWidget(cardName,widget),this.options.items.push({el:cardItem,cardName:cardName}),widget},showCardByName:function(name,action,callback){var self=this,exist=this.isCardExisted(name);null!=this.showIndex&&(this.lastShowIndex=this.showIndex),this.showIndex=name;var flag=!1;BI.each(this.options.items,function(i,item){var el=self._children[item.cardName];el&&(name!=item.cardName?!flag&&!exist&&BI.Action&&action instanceof BI.Action?(action.actionBack(el),flag=!0):el.invisible():BI.Action&&action instanceof BI.Action?action.actionPerformed(void 0,el,callback):(el.visible(),callback&&callback()))})},showLastCard:function(){var self=this;this.showIndex=this.lastShowIndex,BI.each(this.options.items,function(i,item){self._children[item.cardName].setVisible(self.showIndex==i)})},setDefaultShowName:function(name){return this.options.defaultShowName=name,this},getDefaultShowName:function(){return this.options.defaultShowName},getAllCardNames:function(){return BI.map(this.options.items,function(i,item){return item.cardName})},getShowingCard:function(){if(BI.isKey(this.showIndex))return this.getWidgetByName(this.showIndex)},deleteAllCard:function(){var self=this;BI.each(this.getAllCardNames(),function(i,name){self.deleteCardByName(name)})},hideAllCard:function(){var self=this;BI.each(this.options.items,function(i,item){self._children[item.cardName].invisible()})},isAllCardHide:function(){var self=this,flag=!0;return BI.some(this.options.items,function(i,item){if(self._children[item.cardName].isVisible())return flag=!1,!1}),flag},removeWidget:function(nameOrWidget){var removeName;BI.isWidget(nameOrWidget)?BI.each(this._children,function(name,child){child===nameOrWidget&&(removeName=name)}):removeName=nameOrWidget,removeName&&this._deleteCardByName(removeName)}}),BI.shortcut("bi.card",BI.CardLayout),BI.DefaultLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DefaultLayout.superclass.props.apply(this,arguments),{hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[]})},render:function(){BI.DefaultLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.DefaultLayout.superclass._addElement.apply(this,arguments);return o.vgap+o.tgap+(item.tgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+"px"}),w},resize:function(){},populate:function(items){BI.DefaultLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.default",BI.DefaultLayout),BI.DivisionLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.DivisionLayout.superclass.props.apply(this,arguments),{baseCls:"bi-division-layout",columns:null,rows:null,items:[]})},render:function(){BI.DivisionLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.opitons.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}var o=this.options,rows=o.rows||o.items.length,columns=o.columns||0|(o.items[0]&&o.items[0].length),map=BI.makeArray(rows),widths={},heights={};BI.each(map,function(i){map[i]=BI.makeArray(columns)}),BI.each(items,function(i,item){return BI.isArray(item)?void BI.each(item,function(j,el){widths[i]=(widths[i]||0)+item.width,heights[j]=(heights[j]||0)+item.height,map[i][j]=el}):(widths[item.row]=(widths[item.row]||0)+item.width,heights[item.column]=(heights[item.column]||0)+item.height,void(map[item.row][item.column]=item))});for(var i=0;i0){var lastW=this.getWidgetByName(this.getName()+i+"_"+(j-1));lastW.element.css({right:100-left+"%"})}j==o.columns-1&&w.element.css({right:"0%"}),first(w,i,j),totalW+=map[i][j].width}for(var j=0;j0){var lastW=this.getWidgetByName(this.getName()+(i-1)+"_"+j);lastW.element.css({bottom:100-top+"%"})}i==o.rows-1&&w.element.css({bottom:"0%"}),totalH+=map[i][j].height}},update:function(){},populate:function(items){BI.DivisionLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.division",BI.DivisionLayout),BI.FloatLeftLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatLeftLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-left-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatLeftLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FloatLeftLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","float":"left"}),BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.FloatLeftLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.left",BI.FloatLeftLayout),BI.FloatRightLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.FloatRightLayout.superclass.props.apply(this,arguments),{baseCls:"bi-float-right-layout clearfix",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.FloatRightLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.FloatRightLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative","float":"right"}),BI.isNotNull(item.left)&&w.element.css({left:item.left}),BI.isNotNull(item.right)&&w.element.css({right:item.right}),BI.isNotNull(item.top)&&w.element.css({top:item.top}),BI.isNotNull(item.bottom)&&w.element.css({bottom:item.bottom}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":(0===i?o.hgap:0)+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.FloatRightLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.right",BI.FloatRightLayout),BI.GridLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.GridLayout.superclass.props.apply(this,arguments),{baseCls:"bi-grid-layout",columns:null,rows:null,items:[]})},render:function(){BI.GridLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){},addItem:function(){throw new Error("cannot be added")},stroke:function(items){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var self=this,o=this.options,rows=o.rows||o.items.length,columns=o.columns||0|(o.items[0]&&o.items[0].length),width=100/columns,height=100/rows,els=[],i=0;i").attr({cellspacing:0,cellpadding:0}).css({position:"relative","white-space":"nowrap",height:o.verticalAlign===BI.VerticalAlign.Middle?"100%":"auto",width:o.horizontalAlign===BI.HorizontalAlign.Center||o.horizontalAlign===BI.HorizontalAlign.Stretch?"100%":"auto","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.$tr=BI.Widget._renderEngine.createElement("
    "),this.$tr.appendTo(this.$table),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,td,width=o.columnSize[i]<=1?100*o.columnSize[i]+"%":o.columnSize[i];if(this.hasWidget(this._getChildName(i)))td=this.getWidgetByName(this._getChildName(i)),td.element.attr("width",width);else{var w=BI.createWidget(item);w.element.css({position:"relative",margin:"0px auto"}),td=BI.createWidget({type:"bi.default",tagName:"td",attributes:{width:width},items:[w]}),this.addWidget(this._getChildName(i),td)}return td.element.css({"max-width":o.columnSize[i]<=1?width:width+"px"}),0===i&&td.element.addClass("first-element"),td.element.css({position:"relative","vertical-align":o.verticalAlign,margin:"0",padding:"0",border:"none"}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px"}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),td},appendFragment:function(frag){this.$tr.append(frag),this.element.append(this.$table)},resize:function(){},_getWrapper:function(){return this.$tr},populate:function(items){BI.HorizontalLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal",BI.HorizontalLayout),BI.HorizontalCellLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HorizontalCellLayout.superclass.props.apply(this,arguments),{baseCls:"bi-horizontal-cell-layout",scrollable:!0,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.HorizontalCellLayout.superclass.render.apply(this,arguments),this.element.css({display:"table","vertical-align":"top"}),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.HorizontalCellLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",display:"table-cell","vertical-align":"middle"}),o.hgap+o.lgap>0&&w.element.css({"margin-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&w.element.css({"margin-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&w.element.css({"margin-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&w.element.css({"margin-bottom":o.vgap+o.bgap+"px"}),w},resize:function(){},populate:function(items){BI.HorizontalCellLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.horizontal_cell",BI.HorizontalCellLayout),BI.InlineLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.InlineLayout.superclass.props.apply(this,arguments),{baseCls:"bi-inline-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0})},render:function(){BI.InlineLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.InlineLayout.superclass._addElement.apply(this,arguments);return w.element.css({position:"relative",display:"inline-block","*display":"inline","*zoom":1}),o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-top":o.vgap+o.tgap+(item.tgap||0)+(item.vgap||0)+"px" +}),o.hgap+o.lgap+(item.lgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-left":(0===i?o.hgap:0)+o.lgap+(item.lgap||0)+(item.hgap||0)+"px"}),o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)!==0&&w.element.css({"margin-right":o.hgap+o.rgap+(item.rgap||0)+(item.hgap||0)+"px"}),o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)!==0&&w.element.css({"margin-bottom":o.vgap+o.bgap+(item.bgap||0)+(item.vgap||0)+"px"}),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.InlineLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.inline",BI.InlineLayout),BI.LatticeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.LatticeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-lattice-layout clearfix"})},render:function(){BI.LatticeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},_addElement:function(i,item){var o=this.options,w=BI.LatticeLayout.superclass._addElement.apply(this,arguments);if(o.columnSize&&o.columnSize[i])var width=o.columnSize[i]/BI.sum(o.columnSize)*100+"%";else var width=1/this.options.items.length*100+"%";return w.element.css({position:"relative","float":"left",width:width}),w},addItem:function(item){var w=BI.LatticeLayout.superclass.addItem.apply(this,arguments);return this.resize(),w},addItemAt:function(item){var w=BI.LatticeLayout.superclass.addItemAt.apply(this,arguments);return this.resize(),w},resize:function(){this.stroke(this.options.items)},populate:function(items){BI.LatticeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.lattice",BI.LatticeLayout),BI.TableLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TableLayout.superclass.props.apply(this,arguments),{baseCls:"bi-table-layout",scrolly:!0,columnSize:[200,200,"fill"],rowSize:30,hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TableLayout.superclass.render.apply(this,arguments),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}var o=this.options,abs=[],left=0,right=0,i,j;for(i=0;ii;j--){if(!BI.isNumber(o.columnSize[j]))throw new Error("item with fill can only be one");first(arr[j],this.rows,j),abs.push(BI.extend({top:0,bottom:0,right:o.columnSize[j]<=1?100*right+"%":right,width:o.columnSize[j]<=1?100*o.columnSize[j]+"%":o.columnSize[j]},arr[j])),right+=o.columnSize[j]+(o.columnSize[j]<1?0:o.hgap)}i>=0&&i0&&this.getWidgetByName(this.getName()+(this.rows-1)).element.css({"margin-bottom":o.vgap}),w.element.css({position:"relative"}),this.addWidget(this.getName()+this.rows++,w),w},resize:function(){},addItem:function(arr){if(!BI.isArray(arr))throw new Error("item must be array");return BI.TableLayout.superclass.addItem.apply(this,arguments)},update:function(){},populate:function(items){BI.TableLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.table",BI.TableLayout),BI.HTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.HTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-h-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{width:100,el:{type:"bi.button",text:"button1"}},{width:"fill",el:{type:"bi.button",text:"button2"}},{width:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.HTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",top:(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",bottom:(item.bgap||0)+(item.vgap||0)+o.vgap+o.bgap+"px"})});var left={},right={};left[0]=0,right[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(left[i])&&(left[i]=left[i-1]+items[i-1].width+(items[i-1].lgap||0)+2*(items[i-1].hgap||0)+o.hgap+o.lgap+o.rgap),item.width<1&&item.width>=0?w.element.css({left:100*left[i]+"%",width:100*item.width+"%"}):w.element.css({left:left[i]+(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",width:BI.isNumber(item.width)?item.width:""}),!BI.isNumber(item.width))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(right[i])&&(right[i]=right[i+1]+items[i+1].width+(items[i+1].rgap||0)+2*(items[i+1].hgap||0)+o.hgap+o.lgap+o.rgap),item.width<1&&item.width>=0?w.element.css({right:100*right[i]+"%",width:100*item.width+"%"}):w.element.css({right:right[i]+(item.rgap||0)+(item.hgap||0)+o.hgap+o.rgap+"px",width:BI.isNumber(item.width)?item.width:""}),!BI.isNumber(item.width))return!0})},update:function(){var updated;return BI.each(this._children,function(i,child){updated=child.update()||updated}),updated},populate:function(items){BI.HTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.htape",BI.HTapeLayout),BI.VTapeLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.VTapeLayout.superclass.props.apply(this,arguments),{baseCls:"bi-v-tape-layout",hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,items:[{height:100,el:{type:"bi.button",text:"button1"}},{height:"fill",el:{type:"bi.button",text:"button2"}},{height:200,el:{type:"bi.button",text:"button3"}}]})},render:function(){BI.VTapeLayout.superclass.render.apply(this,arguments),this.populate(this.options.items)},resize:function(){this.stroke(this.options.items)},addItem:function(item){throw new Error("cannot be added")},stroke:function(items){var self=this,o=this.options;items=BI.compact(items),BI.each(items,function(i,item){if(self.hasWidget(self.getName()+i+""))w=self.getWidgetByName(self.getName()+i+"");else{var w=BI.createWidget(item);self.addWidget(self.getName()+i+"",w)}w.element.css({position:"absolute",left:(item.lgap||0)+(item.hgap||0)+o.hgap+o.lgap+"px",right:+(item.hgap||0)+(item.rgap||0)+o.hgap+o.rgap+"px"})});var top={},bottom={};top[0]=0,bottom[items.length-1]=0,BI.any(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(top[i])&&(top[i]=top[i-1]+items[i-1].height+(items[i-1].tgap||0)+2*(items[i-1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({top:100*top[i]+"%",height:100*item.height+"%"}):w.element.css({top:top[i]+(item.vgap||0)+(item.tgap||0)+o.vgap+o.tgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0}),BI.backAny(items,function(i,item){var w=self.getWidgetByName(self.getName()+i+"");if(BI.isNull(bottom[i])&&(bottom[i]=bottom[i+1]+items[i+1].height+(items[i+1].bgap||0)+2*(items[i+1].vgap||0)+o.vgap+o.tgap+o.bgap),item.height<1&&item.height>=0?w.element.css({bottom:100*bottom[i]+"%",height:100*item.height+"%"}):w.element.css({bottom:bottom[i]+(item.vgap||0)+(item.bgap||0)+o.vgap+o.bgap+"px",height:BI.isNumber(item.height)?item.height:""}),!BI.isNumber(item.height))return!0})},update:function(){},populate:function(items){BI.VTapeLayout.superclass.populate.apply(this,arguments),this._mount()}}),BI.shortcut("bi.vtape",BI.VTapeLayout),BI.TdLayout=BI.inherit(BI.Layout,{props:function(){return BI.extend(BI.TdLayout.superclass.props.apply(this,arguments),{baseCls:"bi-td-layout",columnSize:[200,200,200],hgap:0,vgap:0,items:[[{el:{text:"label1"}},{el:{text:"label2"}},{el:{text:"label3"}}]]})},render:function(){BI.TdLayout.superclass.render.apply(this,arguments),this.$table=BI.Widget._renderEngine.createElement("
    ").attr({cellspacing:0,cellpadding:0}).css({position:"relative",width:"100%",height:"100%","border-spacing":"0px",border:"none","border-collapse":"separate"}),this.rows=0,this.populate(this.options.items)},_addElement:function(idx,arr){function firstElement(item,row,col){0===row&&item.addClass("first-row"),0===col&&item.addClass("first-col"),item.addClass(BI.isOdd(row+1)?"odd-row":"even-row"),item.addClass(BI.isOdd(col+1)?"odd-col":"even-col"),item.addClass("center-element")}function firstObject(item,row,col){var cls="";0===row&&(cls+=" first-row"),0===col&&(cls+=" first-col"),cls+=BI.isOdd(row+1)?" odd-row":" even-row",cls+=BI.isOdd(col+1)?" odd-col":" even-col",item.cls=(item.cls||"")+cls+" center-element"}function first(item,row,col){item instanceof BI.Widget?firstElement(item.element,row,col):item.el instanceof BI.Widget?firstElement(item.el.element,row,col):item.el?firstObject(item.el,row,col):firstObject(item,row,col)}for(var o=this.options,tr=BI.createWidget({type:"bi.default",tagName:"tr"}),i=0;i=0;i--){for(var j=0;j=0;j--){for(var i=0;i-1)return arr.splice(_index,1)}}function parsePath(path){if(!bailRE.test(path)){var segments=path.split(".");return function(obj){for(var i=0;iindex&&queue[i].watcher.id>watcher.id;)i--;queue.splice(i+1,0,{watcher:watcher,options:options})}else queue.push({watcher:watcher,options:options});waiting||(waiting=!0,nextTick(flushSchedulerQueue))}}function traverse(val){seenObjects.clear(),_traverse(val,seenObjects)}function _traverse(val,seen){var i=void 0,keys=void 0,isA=_.isArray(val);if(isA||_.isObject(val)){if(val.__ob__){var depId=val.__ob__.dep.id;if(seen.has(depId))return;seen.add(depId)}if(isA)for(i=val.length;i--;)_traverse(val[i],seen);else for(keys=_.keys(val),i=keys.length;i--;)_traverse(val[keys[i]],seen)}}function runBinaryFunction(binarys){for(var expr="",i=0,len=binarys.length;i 0 Then","\t\t["+name+'] = [$vbsetter](Me, [$accessors],"'+name+'")',"\tEnd If","\tOn Error Goto 0","\tEnd Property"));for(name in properties)uniq[name]||(uniq[name]=!0,buffer.push("\tPublic ["+name+"]"));buffer.push("\tPublic [hasOwnProperty]"),buffer.push("End Class");var body=buffer.join("\r\n"),className=VBClassPool[body];className||(className=makeHashCode("VBClass"),window.parseVB("Class "+className+body),window.parseVB(["Function "+className+"Factory(acc, vbm)","\tDim o","\tSet o = (New "+className+")(acc, vbm)","\tSet "+className+"Factory = o","End Function"].join("\r\n")),VBClassPool[body]=className);var ret=window[className+"Factory"](accessors,VBMediator);return ret}}var createViewModel$1=createViewModel,arrayKeys=_.keys(arrayMethods),observerState={shouldConvert:!0},Observer=function(){function Observer(value){if(_classCallCheck(this,Observer),this.value=value,this.dep=new Dep,this.vmCount=0,_.isArray(value)){var augment=hasProto?protoAugment:copyAugment;augment(value,arrayMethods,arrayKeys),this.model=this.observeArray(value)}else this.model=this.walk(value);isIE9Below?this.model.__ob__=this:def(this.model,"__ob__",this)}return Observer.prototype.walk=function walk(obj){return defineReactive(obj,this)},Observer.prototype.observeArray=function observeArray(items){for(var i=0,l=items.length;i=1?"floor":"ceil"](delta/lowestDelta),deltaX=Math[deltaX>=1?"floor":"ceil"](deltaX/lowestDelta),deltaY=Math[deltaY>=1?"floor":"ceil"](deltaY/lowestDelta),special.settings.normalizeOffset&&this.getBoundingClientRect){var boundingRect=this.getBoundingClientRect();offsetX=event.clientX-boundingRect.left,offsetY=event.clientY-boundingRect.top}return event.deltaX=deltaX,event.deltaY=deltaY,event.deltaFactor=lowestDelta,event.offsetX=offsetX,event.offsetY=offsetY,event.deltaMode=0,args.unshift(event,delta,deltaX,deltaY),nullLowestDeltaTimeout&&clearTimeout(nullLowestDeltaTimeout),nullLowestDeltaTimeout=setTimeout(nullLowestDelta,200),($.event.dispatch||$.event.handle).apply(this,args)}}function nullLowestDelta(){lowestDelta=null}function shouldAdjustOldDeltas(orgEvent,absDelta){return special.settings.adjustOldDeltas&&"mousewheel"===orgEvent.type&&absDelta%120===0}var toFix=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],toBind="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],slice=Array.prototype.slice,nullLowestDeltaTimeout,lowestDelta;if($.event.fixHooks)for(var i=toFix.length;i;)$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;var special=$.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=toBind.length;i;)this.addEventListener(toBind[--i],handler,!1);else this.onmousewheel=handler},teardown:function(){if(this.removeEventListener)for(var i=toBind.length;i;)this.removeEventListener(toBind[--i],handler,!1);else this.onmousewheel=null},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel")},unmousewheel:function(fn){return this.unbind("mousewheel",fn)}})}),BI.Pane=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Pane.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-pane",tipText:BI.i18nText("BI-No_Selected_Item"),overlap:!0,onLoaded:BI.emptyFn})},_assertTip:function(){var o=this.options;this._tipText||(this._tipText=BI.createWidget({type:"bi.label",cls:"bi-tips",text:o.tipText,height:25}),BI.createWidget({type:"bi.absolute_center_adapt",element:this,items:[this._tipText]}))},loading:function(){var self=this,o=this.options,isIE=BI.isIE(),loadingAnimation=BI.createWidget({type:"bi.horizontal",cls:"bi-loading-widget"+(isIE?" wave-loading hack":""),height:30,width:30,hgap:5,vgap:2.5,items:isIE?[]:[{type:"bi.layout",cls:"animate-rect rect1",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect2",height:25,width:3},{type:"bi.layout",cls:"animate-rect rect3",height:25,width:3}]});this.setTipVisible(!1),o.overlap===!0?(BI.Layers.has(this.getName())||BI.createWidget({type:"bi.absolute_center_adapt",cls:"loading-container",items:[{el:loadingAnimation}],element:BI.Layers.make(this.getName(),this)}),BI.Layers.show(self.getName())):BI.isNull(this._loading)&&(this._loading=loadingAnimation,this._loading.element.css("zIndex",1),BI.createWidget({type:"bi.absolute_center_adapt",element:this,cls:"loading-container",items:[{el:this._loading,left:0,right:0,top:0}]})),this.element.addClass("loading-status")},loaded:function(){var self=this,o=this.options;BI.Layers.remove(self.getName()),this._loading&&this._loading.destroy(),this._loading&&(this._loading=null),o.onLoaded(),self.fireEvent(BI.Pane.EVENT_LOADED),this.element.removeClass("loading-status")},check:function(){this.setTipVisible(BI.isEmpty(this.options.items))},setTipVisible:function(b){b===!0?(this._assertTip(),this._tipText.setVisible(!0)):this._tipText&&this._tipText.setVisible(!1)},populate:function(items){this.options.items=items||[],this.check()},empty:function(){}}),BI.Pane.EVENT_LOADED="EVENT_LOADED",BI.Single=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Single.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-single",readonly:!1,title:null,warningTitle:null,tipType:null,value:null,belowMouse:!1})},_showToolTip:function(e,opt){opt||(opt={});var self=this,o=this.options,type=this.getTipType()||(this.isEnabled()?"success":"warning"),title="success"===type?this.getTitle():this.getWarningTitle()||this.getTitle();BI.isKey(title)&&(BI.Tooltips.show(e,this.getName(),title,type,this,opt),o.action&&BI.Actions.runAction(o.action,"hover",o,this),BI.Actions.runGlobalAction("hover",o,this))},_hideTooltip:function(){var self=this,tooltip=BI.Tooltips.get(this.getName());BI.isNotNull(tooltip)&&tooltip.element.fadeOut(200,function(){BI.Tooltips.remove(self.getName())})},_init:function(){BI.Single.superclass._init.apply(this,arguments);var self=this,o=this.options;(BI.isKey(o.title)||BI.isKey(o.warningTitle)||BI.isFunction(o.title)||BI.isFunction(o.warningTitle))&&this.enableHover({belowMouse:o.belowMouse,container:o.container})},_clearTimeOut:function(){BI.isNotNull(this.showTimeout)&&(clearTimeout(this.showTimeout),this.showTimeout=null),BI.isNotNull(this.hideTimeout)&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},enableHover:function(opt){opt||(opt={});var self=this;this._hoverBinded||(this.element.on("mouseenter.title"+this.getName(),function(e){self._e=e,"warning"===self.getTipType()||BI.isKey(self.getWarningTitle())&&!self.isEnabled()?self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&self._showToolTip(self._e||e,opt)},200):("success"===self.getTipType()||self.isEnabled())&&(self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&self._showToolTip(self._e||e,opt)},500))}),this.element.on("mousemove.title"+this.getName(),function(e){self._e=e,BI.isNotNull(self.showTimeout)&&(clearTimeout(self.showTimeout),self.showTimeout=null),BI.isNull(self.hideTimeout)&&(self.hideTimeout=BI.delay(function(){BI.isNotNull(self.hideTimeout)&&self._hideTooltip()},500)),self.showTimeout=BI.delay(function(){BI.isNotNull(self.showTimeout)&&(BI.isNotNull(self.hideTimeout)&&(clearTimeout(self.hideTimeout),self.hideTimeout=null),self.element.__isMouseInBounds__(self._e||e)&&self._showToolTip(self._e||e,opt))},500)}),this.element.on("mouseleave.title"+this.getName(),function(e){self._e=null,self._clearTimeOut(),self._hideTooltip()}),this._hoverBinded=!0)},disabledHover:function(){this._clearTimeOut(),this._hideTooltip(),this.element.unbind("mouseenter.title"+this.getName()).unbind("mousemove.title"+this.getName()).unbind("mouseleave.title"+this.getName()),this._hoverBinded=!1},populate:function(items){this.items=items||[]},setTitle:function(title,opt){this.options.title=title,BI.isKey(title)||BI.isFunction(title)?this.enableHover(opt):this.disabledHover()},setWarningTitle:function(title,opt){this.options.warningTitle=title,BI.isKey(title)||BI.isFunction(title)?this.enableHover(opt):this.disabledHover()},getTipType:function(){return this.options.tipType},isReadOnly:function(){return!!this.options.readonly},getTitle:function(){var title=this.options.title;return BI.isFunction(title)?title():title},getWarningTitle:function(){var title=this.options.warningTitle;return BI.isFunction(title)?title():title},setValue:function(val){this.options.readonly||(this.options.value=val)},getValue:function(){return this.options.value},_unMount:function(){BI.Single.superclass._unMount.apply(this,arguments),BI.Tooltips.remove(this.getName())}}),BI.Text=BI.inherit(BI.Single,{props:{baseCls:"bi-text",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",py:"",highLight:!1},render:function(){var self=this,o=this.options;o.hgap+o.lgap>0&&this.element.css({"padding-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&this.element.css({"padding-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&this.element.css({"padding-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&this.element.css({"padding-bottom":o.vgap+o.bgap+"px"}),BI.isNumber(o.height)&&this.element.css({lineHeight:o.height+"px"}),BI.isNumber(o.lineHeight)&&this.element.css({lineHeight:o.lineHeight+"px"}),BI.isWidthOrHeight(o.maxWidth)&&this.element.css({maxWidth:o.maxWidth}),this.element.css({textAlign:o.textAlign,whiteSpace:o.whiteSpace,textOverflow:"nowrap"===o.whiteSpace?"ellipsis":"",overflow:"nowrap"===o.whiteSpace?"":BI.isWidthOrHeight(o.height)?"auto":""}),o.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){o.handler(self.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this;var text=this._getShowText();BI.isKey(text)?this.setText(text):BI.isKey(o.value)&&this.setText(o.value),BI.isKey(o.keyword)&&this.doRedMark(o.keyword),o.highLight&&this.doHighLight()},_getShowText:function(){var o=this.options;return BI.isFunction(o.text)?o.text():o.text},doRedMark:function(keyword){var o=this.options;o.keyword=keyword,this.text.element.__textKeywordMarked__(this._getShowText()||o.value,keyword,o.py)},unRedMark:function(){var o=this.options;o.keyword="",this.text.element.__textKeywordMarked__(this._getShowText()||o.value,"",o.py)},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(text){BI.Text.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(text)},setStyle:function(css){this.text.element.css(css)},setText:function(text){return BI.Text.superclass.setText.apply(this,arguments),this.options.text=BI.isNotNull(text)?text:"",BI.isIE9Below()?void this.text.element.html(BI.htmlEncode(this._getShowText())):void(/\s/.test(text)?this.text.element[0].innerHTML=BI.htmlEncode(this._getShowText()):this.text.element[0].textContent=this._getShowText())}}),BI.shortcut("bi.text",BI.Text),BI.BasicButton=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.BasicButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-basic-button"+(conf.invalid?"":" cursor-pointer")+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),value:"",text:"",stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn,bubble:null})},_init:function(){BI.BasicButton.superclass._init.apply(this,arguments);var opts=this.options;opts.selected===!0&&BI.nextTick(BI.bind(function(){this.setSelected(opts.selected)},this)),BI.nextTick(BI.bind(this.bindEvent,this)),opts.shadow&&this._createShadow(),opts.level&&this.element.addClass("button-"+opts.level)},_createShadow:function(){var self=this,o=this.options,assertMask=function(){self.$mask||(self.$mask=BI.createWidget(BI.isObject(o.shadow)?o.shadow:{},{type:"bi.layout",cls:"bi-button-mask"}),self.$mask.invisible(),BI.createWidget({type:"bi.absolute",element:self,items:[{el:self.$mask,left:0,right:0,top:0,bottom:0}]}))};this.element.mouseup(function(){self._hover||o.isShadowShowingOnSelected||(assertMask(),self.$mask.invisible())}),this.element.on("mouseenter."+this.getName(),function(e){self.element.__isMouseInBounds__(e)&&(!self.isEnabled()||self._hover||!o.isShadowShowingOnSelected&&self.isSelected()||(assertMask(),self.$mask.visible()))}),this.element.on("mousemove."+this.getName(),function(e){self.element.__isMouseInBounds__(e)||self.isEnabled()&&!self._hover&&(assertMask(),self.$mask.invisible())}),this.element.on("mouseleave."+this.getName(),function(){self.isEnabled()&&!self._hover&&(assertMask(),self.$mask.invisible())})},bindEvent:function(){function ev(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()}function clk(e){if(ev(e),!(!self.isEnabled()||self.isOnce()&&self.isSelected())){if(BI.isKey(o.bubble)||BI.isFunction(o.bubble)){if(BI.isNull(self.combo)){var popup;BI.createWidget({type:"bi.absolute",element:self,items:[{el:{type:"bi.bubble_combo",trigger:"",destroyWhenHide:!0,ref:function(){self.combo=this},el:{type:"bi.layout",height:"100%"},popup:{type:"bi.text_bubble_bar_popup_view",text:getBubble(),ref:function(){popup=this},listeners:[{eventName:BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,action:function(v){self.combo.hideView(),v&&onClick.apply(self,arguments)}}]},listeners:[{eventName:BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,action:function(){popup.populate(getBubble())}}]},left:0,right:0,bottom:0,top:0}]})}return void(self.combo.isViewVisible()?self.combo.hideView():self.combo.showView())}onClick.apply(self,arguments)}}function getBubble(){var bubble=self.options.bubble;return BI.isFunction(bubble)?bubble():bubble}var self=this,o=this.options,hand=this.handle();if(hand){hand=hand.element;var triggerArr=(o.trigger||"").split(",");BI.each(triggerArr,function(idx,trigger){switch(trigger){case"mouseup":var mouseDown=!1;hand.mousedown(function(){mouseDown=!0}),hand.mouseup(function(e){mouseDown===!0&&clk(e),mouseDown=!1,ev(e)});break;case"mousedown":var mouseDown=!1,selected=!1;hand.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+self.getName(),function(e){!BI.DOM.isExist(self)||hand.__isMouseInBounds__(e)||mouseDown!==!0||selected||self._trigger(),mouseDown=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())}),mouseDown!==!0&&(self.isSelected()?selected=!0:clk(e),mouseDown=!0,ev(e))}),hand.mouseup(function(e){BI.DOM.isExist(self)&&mouseDown===!0&&selected===!0&&clk(e),mouseDown=!1,selected=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())});break;case"dblclick":hand.dblclick(clk);break;case"lclick":var mouseDown=!1,interval;hand.mousedown(function(e){BI.Widget._renderEngine.createElement(document).bind("mouseup."+self.getName(),function(e){interval&&clearInterval(interval),interval=null,mouseDown=!1,BI.Widget._renderEngine.createElement(document).unbind("mouseup."+self.getName())}),mouseDown!==!0&&(!self.isEnabled()||self.isOnce()&&self.isSelected()||(interval=setInterval(function(){self.isEnabled()&&self.doClick()},180),mouseDown=!0,ev(e)))});break;default:(o.stopEvent||o.stopPropagation)&&hand.mousedown(function(e){ev(e)}),hand.click(clk)}});var onClick=BI.debounce(this._doClick,BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1})}},_trigger:function(e){var o=this.options;if(this.isEnabled()&&(this.isDisableSelected()||(this.isForceSelected()?this.setSelected(!0):this.isForceNotSelected()?this.setSelected(!1):this.setSelected(!this.isSelected())),this.isValid())){o.handler.call(this,this.getValue(),this,e);var v=this.getValue();this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,v,this,e),this.fireEvent(BI.BasicButton.EVENT_CHANGE,v,this),o.action&&BI.Actions.runAction(o.action,"click",o,this),BI.Actions.runGlobalAction("click",o,this)}},_doClick:function(e){this.isValid()&&this.beforeClick(e),this._trigger(e),this.isValid()&&this.doClick(e)},beforeClick:function(){},doClick:function(){},handle:function(){return this},hover:function(){this._hover=!0,this.handle().element.addClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!0)},dishover:function(){this._hover=!1,this.handle().element.removeClass("hover"),this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},setSelected:function(b){var o=this.options;o.selected=b,b?this.handle().element.addClass("active"):this.handle().element.removeClass("active"),o.shadow&&!o.isShadowShowingOnSelected&&this.$mask&&this.$mask.setVisible(!1)},isSelected:function(){return this.options.selected},isOnce:function(){return this.options.once},isForceSelected:function(){return this.options.forceSelected},isForceNotSelected:function(){return this.options.forceNotSelected},isDisableSelected:function(){return this.options.disableSelected},setText:function(text){this.options.text=text},getText:function(){return this.options.text},_setEnable:function(enable){BI.BasicButton.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled"),enable||this.options.shadow&&this.$mask&&this.$mask.setVisible(!1)},empty:function(){BI.Widget._renderEngine.createElement(document).unbind("mouseup."+this.getName()),BI.BasicButton.superclass.empty.apply(this,arguments)},destroy:function(){BI.BasicButton.superclass.destroy.apply(this,arguments)}}),BI.BasicButton.EVENT_CHANGE="BasicButton.EVENT_CHANGE",BI.NodeButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.NodeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-node",open:!1})},_init:function(){BI.NodeButton.superclass._init.apply(this,arguments);var self=this;BI.nextTick(function(){self.setOpened(self.isOpened())})},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.setOpened(!this.isOpened())},isOnce:function(){return!1},isOpened:function(){return!!this.options.open},setOpened:function(b){this.options.open=!!b},triggerCollapse:function(){this.isOpened()&&(this.setOpened(!1),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,this.getValue(),this))},triggerExpand:function(){this.isOpened()||(this.setOpened(!0),this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,this.getValue(),this))}}),BI.Tip=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Tip.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-tip",zIndex:BI.zIndex_tip})},_init:function(){BI.Tip.superclass._init.apply(this,arguments),this.element.css({zIndex:this.options.zIndex})}}),BI.ButtonGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ButtonGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-group",behaviors:{},items:[],value:"",chooseType:BI.Selection.Single,layouts:[{type:"bi.center",hgap:0,vgap:0}]})},_init:function(){BI.ButtonGroup.superclass._init.apply(this,arguments);var o=this.options,behaviors={};BI.each(o.behaviors,function(key,rule){behaviors[key]=BI.BehaviorFactory.createBehavior(key,{rule:rule})}),this.behaviors=behaviors,this.populate(o.items),(BI.isKey(o.value)||BI.isNotEmptyArray(o.value))&&this.setValue(o.value)},_createBtns:function(items){var o=this.options;return BI.createWidgets(BI.createItems(items,{type:"bi.text_button"}))},_btnsCreator:function(items){var self=this,args=Array.prototype.slice.call(arguments),o=this.options,buttons=this._createBtns(items);return args[0]=buttons,BI.each(this.behaviors,function(i,behavior){behavior.doBehavior.apply(behavior,args)}),BI.each(buttons,function(i,btn){btn.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){if(type===BI.Events.CLICK){switch(o.chooseType){case BI.ButtonGroup.CHOOSE_TYPE_SINGLE:self.setValue(btn.getValue());break;case BI.ButtonGroup.CHOOSE_TYPE_NONE:self.setValue([])}self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.ButtonGroup.EVENT_CHANGE,value,obj)}else self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),btn.on(BI.Events.DESTROY,function(){BI.remove(self.buttons,btn)})}),buttons},_packageBtns:function(btns){ +for(var o=this.options,i=o.layouts.length-1;i>0;i--)btns=BI.map(btns,function(k,it){return BI.extend({},o.layouts[i],{items:[BI.extend({},o.layouts[i].el,{el:it})]})});return btns},_packageSimpleItems:function(btns){var o=this.options;return BI.map(o.items,function(i,item){return BI.stripEL(item)===item?btns[i]:BI.extend({},item,{el:btns[i]})})},_packageItems:function(items,packBtns){return BI.createItems(BI.makeArrayByArray(items,{}),BI.clone(packBtns))},_packageLayout:function(items){for(var o=this.options,layout=BI.deepClone(o.layouts[0]),lay=BI.formatEL(layout).el;lay&&lay.items&&!BI.isEmpty(lay.items);)lay=BI.formatEL(lay.items[0]).el;return lay.items=items,layout},_isSimpleLayout:function(){var o=this.options;return 1===o.layouts.length&&!BI.isArray(o.items[0])},doBehavior:function(){var args=Array.prototype.slice.call(arguments);args.unshift(this.buttons),BI.each(this.behaviors,function(i,behavior){behavior.doBehavior.apply(behavior,args)})},prependItems:function(items){var o=this.options,btns=this._btnsCreator.apply(this,arguments);return this.buttons=BI.concat(btns,this.buttons),this._isSimpleLayout()&&this.layouts&&this.layouts.prependItems?void this.layouts.prependItems(btns):(items=this._packageItems(items,this._packageBtns(btns)),void this.layouts.prependItems(this._packageLayout(items).items))},addItems:function(items){var o=this.options,btns=this._btnsCreator.apply(this,arguments);return this.buttons=BI.concat(this.buttons,btns),this._isSimpleLayout()&&this.layouts&&this.layouts.addItems?void this.layouts.addItems(btns):(items=this._packageItems(items,this._packageBtns(btns)),void this.layouts.addItems(this._packageLayout(items).items))},removeItemAt:function(indexes){BI.removeAt(this.buttons,indexes),this.layouts.removeItemAt(indexes)},removeItems:function(values){values=BI.isArray(values)?values:[values];var deleted=[];BI.each(this.buttons,function(i,button){BI.deepContains(values,button.getValue())&&deleted.push(i)}),BI.removeAt(this.buttons,deleted),this.layouts.removeItemAt(deleted)},populate:function(items){items=items||[],this.empty(),this.options.items=items,this.buttons=this._btnsCreator.apply(this,arguments),items=this._isSimpleLayout()?this._packageSimpleItems(this.buttons):this._packageItems(items,this._packageBtns(this.buttons)),this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(items)))},setNotSelectedValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setSelected&&item.setSelected(!1):item.setSelected&&item.setSelected(!0)})},setEnabledValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setEnable(!0):item.setEnable(!1)})},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){BI.deepContains(v,item.getValue())?item.setSelected&&item.setSelected(!0):item.setSelected&&item.setSelected(!1)})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttons,function(i,item){!item.isEnabled()||item.isSelected&&item.isSelected()||v.push(item.getValue())}),v},getValue:function(){var v=[];return BI.each(this.buttons,function(i,item){item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue())}),v},getAllButtons:function(){return this.buttons},getAllLeaves:function(){return this.buttons},getSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){item.isSelected&&item.isSelected()&&btns.push(item)}),btns},getNotSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){item.isSelected&&!item.isSelected()&&btns.push(item)}),btns},getIndexByValue:function(value){var index=-1;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.getValue()===value)return index=i,!0}),index},getNodeById:function(id){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.options.id===id)return node=item,!0}),node},getNodeByValue:function(value){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()&&item.getValue()===value)return node=item,!0}),node},empty:function(){BI.ButtonGroup.superclass.empty.apply(this,arguments),this.options.items=[]},destroy:function(){BI.ButtonGroup.superclass.destroy.apply(this,arguments),this.options.items=[]}}),BI.extend(BI.ButtonGroup,{CHOOSE_TYPE_SINGLE:BI.Selection.Single,CHOOSE_TYPE_MULTI:BI.Selection.Multi,CHOOSE_TYPE_ALL:BI.Selection.All,CHOOSE_TYPE_NONE:BI.Selection.None,CHOOSE_TYPE_DEFAULT:BI.Selection.Default}),BI.ButtonGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_group",BI.ButtonGroup),BI.ButtonTree=BI.inherit(BI.ButtonGroup,{_defaultConfig:function(){return BI.extend(BI.ButtonTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-button-tree"})},_init:function(){BI.ButtonTree.superclass._init.apply(this,arguments)},setNotSelectedValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setSelected)?void(BI.deepContains(v,item.getValue())?item.setSelected(!1):item.setSelected(!0)):void item.setNotSelectedValue(v)})},setEnabledValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setEnabledValue)?void item.setEnabledValue(v):void(BI.deepContains(v,item.getValue())?item.setEnable(!0):item.setEnable(!1))})},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttons,function(i,item){return BI.isFunction(item.setSelected)?void(BI.deepContains(v,item.getValue())?item.setSelected(!0):item.setSelected(!1)):void item.setValue(v)})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(v=BI.concat(v,item.getNotSelectedValue())):void(item.isEnabled()&&item.isSelected&&!item.isSelected()&&v.push(item.getValue()))}),v},getValue:function(){var v=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(v=BI.concat(v,item.getValue())):void(item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue()))}),v},getSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(btns=btns.concat(item.getSelectedButtons())):void(item.isSelected&&item.isSelected()&&btns.push(item))}),btns},getNotSelectedButtons:function(){var btns=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(btns=btns.concat(item.getNotSelectedButtons())):void(item.isSelected&&!item.isSelected()&&btns.push(item))}),btns},getAllLeaves:function(){var leaves=[];return BI.each(this.buttons,function(i,item){return item.isEnabled()&&!BI.isFunction(item.setSelected)?void(leaves=leaves.concat(item.getAllLeaves())):void(item.isEnabled()&&leaves.push(item))}),leaves},getIndexByValue:function(value){var index=-1;return BI.any(this.buttons,function(i,item){var vs=item.getValue();if(item.isEnabled()&&(vs===value||BI.contains(vs,value)))return index=i,!0}),index},getNodeById:function(id){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled()){if(item.attr("id")===id)return node=item,!0;if(BI.isFunction(item.getNodeById)&&(node=item.getNodeById(id)))return!0}}),node},getNodeByValue:function(value){var node;return BI.any(this.buttons,function(i,item){if(item.isEnabled())if(BI.isFunction(item.getNodeByValue)){if(node=item.getNodeByValue(value))return!0}else if(item.attr("value")===value)return node=item,!0}),node}}),BI.ButtonTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.button_tree",BI.ButtonTree),BI.TreeView=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TreeView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-tree",paras:{selectedValues:{}},itemsCreator:BI.emptyFn})},_init:function(){BI.TreeView.superclass._init.apply(this,arguments);var o=this.options;this._stop=!1,this._createTree(),this.tip=BI.createWidget({type:"bi.loading_bar",invisible:!0,handler:BI.bind(this._loadMore,this)}),BI.createWidget({type:"bi.vertical",scrollable:!0,scrolly:!1,element:this,items:[this.tip]}),BI.isNotNull(o.value)&&this.setSelectedValue(o.value),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")},_createTree:function(){this.id="bi-tree"+BI.UUID(),this.nodes&&this.nodes.destroy(),this.tree&&this.tree.destroy(),this.tree=BI.createWidget({type:"bi.layout",element:"
      "}),BI.createWidget({type:"bi.default",element:this.element,items:[this.tree]})},_selectTreeNode:function(treeId,treeNode){this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,treeNode,this),this.fireEvent(BI.TreeView.EVENT_CHANGE,treeNode,this)},_configSetting:function(){function onClick(event,treeId,treeNode){var checked=treeNode.checked,status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(checked=!1),self.nodes.checkNode(treeNode,!checked,!0,!0)}function getUrl(treeId,treeNode){var parentNode=self._getParentValues(treeNode);treeNode.times=treeNode.times||1;var param="id="+treeNode.id+"×="+treeNode.times++ +"&parentValues= "+_global.encodeURIComponent(BI.jsonEncode(parentNode))+"&checkState="+_global.encodeURIComponent(BI.jsonEncode(treeNode.getCheckStatus()));return"&"+param}function beforeExpand(treeId,treeNode){return treeNode.isAjaxing?(BI.Msg.toast("Please Wait。","warning"),!1):(treeNode.children||(treeNode.times=1,ajaxGetNodes(treeNode,"refresh")),!0)}function onAsyncSuccess(event,treeId,treeNode,msg){if(treeNode.halfCheck=!1,msg&&0!==msg.length&&!/^[\s,\S]*<\/html>$/gi.test(msg)&&!self._stop){var zTree=self.nodes,totalCount=treeNode.count||0;treeNode.children.length>totalCount?(treeNode.count=treeNode.children.length,BI.delay(function(){ajaxGetNodes(treeNode)},perTime)):(zTree.updateNode(treeNode),zTree.selectNode(treeNode.children[0]))}}function onAsyncError(event,treeId,treeNode,XMLHttpRequest,textStatus,errorThrown){var zTree=self.nodes;BI.Msg.toast("Error!","warning")}function ajaxGetNodes(treeNode,reloadType){var zTree=self.nodes;"refresh"==reloadType&&zTree.updateNode(treeNode),zTree.reAsyncChildNodes(treeNode,reloadType,!0)}function beforeCheck(treeId,treeNode){function track(children){BI.each(children,function(i,ch){ch.halfCheck===!0&&(ch.halfCheck=!1,track(ch.children))})}if(treeNode.halfCheck=!1,treeNode.checked===!0){track(treeNode.children);var treeObj=self.nodes,nodes=treeObj.getSelectedNodes();BI.$.each(nodes,function(index,node){node.halfCheck=!1})}var status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(treeNode.checked=!1)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}function onExpand(event,treeId,treeNode){treeNode.halfCheck=!1}function onCollapse(event,treeId,treeNode){}var paras=this.options.paras,self=this,setting={async:{enable:!0,url:getUrl,autoParam:["id","name"],otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeExpand:beforeExpand,onAsyncSuccess:onAsyncSuccess,onAsyncError:onAsyncError,beforeCheck:beforeCheck,onCheck:onCheck,onExpand:onExpand,onCollapse:onCollapse,onClick:onClick}},className="dark",perTime=100;return setting},_getParentValues:function(treeNode){if(!treeNode.getParentNode())return[];var parentNode=treeNode.getParentNode(),result=this._getParentValues(parentNode);return result=result.concat([this._getNodeValue(parentNode)])},_getNodeValue:function(node){return null==node.value?BI.replaceAll(node.text.replace(/<[^>]+>/g,"")," "," "):node.value},_getHalfSelectedValues:function(map,node){var self=this,checkState=node.getCheckStatus();if(checkState.checked!==!1||checkState.half!==!1){if(BI.isNotEmptyArray(node.children)&&checkState.half===!0){var children=node.children;return void BI.each(children,function(i,ch){self._getHalfSelectedValues(map,ch)})}var parent=node.parentValues||self._getParentValues(node),path=parent.concat(this._getNodeValue(node));if(BI.isNotEmptyArray(node.children)||checkState.half===!1)return void this._buildTree(map,path);var storeValues=BI.deepClone(this.options.paras.selectedValues),treeNode=this._getTree(storeValues,path);this._addTreeNode(map,parent,this._getNodeValue(node),treeNode)}},_getTree:function(map,values){var cur=map;return BI.any(values,function(i,value){return null==cur[value]||void(cur=cur[value])}),cur},_addTreeNode:function(map,values,key,value){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]}),cur[key]=value},_buildTree:function(map,values){var cur=map;BI.each(values,function(i,value){null==cur[value]&&(cur[value]={}),cur=cur[value]})},_getSelectedValues:function(){function track(nodes){BI.each(nodes,function(i,node){var checkState=node.getCheckStatus();if(checkState.checked===!0||checkState.half===!0)if(checkState.half===!0)self._getHalfSelectedValues(hashMap,node);else{var parentValues=node.parentValues||self._getParentValues(node),values=parentValues.concat([self._getNodeValue(node)]);self._buildTree(hashMap,values)}})}var self=this,hashMap={},rootNoots=this.nodes.getNodes();return track(rootNoots),hashMap},_dealWidthNodes:function(nodes){var self=this,o=this.options,ns=BI.Tree.arrayFormat(nodes);return BI.each(ns,function(i,n){n.title=n.title||n.text||n.value,n.isParent=n.isParent||n.parent,BI.isKey(o.paras.keyword)?n.text=BI.$("
      ").__textKeywordMarked__(n.text,o.paras.keyword,n.py).html():n.text=BI.htmlEncode(n.text+"")}),nodes},_loadMore:function(){var self=this,o=this.options;this.tip.setLoading();var op=BI.extend({},o.paras,{times:++this.times});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes))}})},_initTree:function(setting){var self=this,o=this.options;self.fireEvent(BI.Events.INIT),this.times=1;var tree=this.tree;tree.empty(),this.loading(),this.tip.setVisible(!1);var callback=function(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))},op=BI.extend({},o.paras,{times:1});o.itemsCreator(op,function(res){if(self._stop!==!0){var hasNext=!!res.hasNext,nodes=res.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes)),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),1===op.times&&self.fireEvent(BI.Events.AFTERINIT)}})},initTree:function(nodes,setting){var setting=setting||{async:{enable:!1},check:{enable:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0},callback:{}};this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},start:function(){this._stop=!1},stop:function(){this._stop=!0},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._createTree(),this.start(),this._initTree(setting)},populate:function(){this.stroke.apply(this,arguments)},hasChecked:function(){var treeObj=this.nodes;return treeObj.getCheckedNodes(!0).length>0},checkAll:function(checked){function setNode(children){BI.each(children,function(i,child){child.halfCheck=!1,setNode(child.children)})}this.nodes&&(BI.each(this.nodes.getNodes(),function(i,node){node.halfCheck=!1,setNode(node.children)}),this.nodes.checkAllNodes(checked))},expandAll:function(flag){this.nodes&&this.nodes.expandAll(flag)},setValue:function(value,param){this.checkAll(!1),this.updateValue(value,param),this.refresh()},setSelectedValue:function(value){this.options.paras.selectedValues=BI.deepClone(value||{})},updateValue:function(values,param){if(this.nodes){param||(param="value");var treeObj=this.nodes;BI.each(values,function(v,op){var nodes=treeObj.getNodesByParam(param,v,null);BI.each(nodes,function(j,node){BI.extend(node,{checked:!0},op),treeObj.updateNode(node)})})}},refresh:function(){this.nodes&&this.nodes.refresh()},getValue:function(){return this.nodes?this._getSelectedValues():null},destroyed:function(){this.stop(),this.nodes&&this.nodes.destroy()}}),BI.extend(BI.TreeView,{REQ_TYPE_INIT_DATA:1,REQ_TYPE_ADJUST_DATA:2,REQ_TYPE_SELECT_DATA:3,REQ_TYPE_GET_SELECTED_DATA:4}),BI.TreeView.EVENT_CHANGE="EVENT_CHANGE",BI.TreeView.EVENT_INIT=BI.Events.INIT,BI.TreeView.EVENT_AFTERINIT=BI.Events.AFTERINIT,BI.shortcut("bi.tree_view",BI.TreeView),BI.AsyncTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.AsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.AsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked,status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(checked=!1),zTree.checkNode(treeNode,!checked,!0,!0)}function beforeCheck(treeId,treeNode){function track(children){BI.each(children,function(i,ch){ch.halfCheck===!0&&(ch.halfCheck=!1,track(ch.children))})}if(treeNode.halfCheck=!1,treeNode.checked===!0){track(treeNode.children);var treeObj=BI.$.fn.zTree.getZTreeObj(treeId),nodes=treeObj.getSelectedNodes();BI.each(nodes,function(index,node){node.halfCheck=!1})}var status=treeNode.getCheckStatus();status.half===!0&&status.checked===!0&&(treeNode.checked=!1)}function beforeExpand(treeId,treeNode){self._beforeExpandNode(treeId,treeNode)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}function onExpand(event,treeId,treeNode){treeNode.halfCheck=!1}function onCollapse(event,treeId,treeNode){treeNode.halfCheck=!1}var paras=this.options.paras,self=this,setting={async:{enable:!1,otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{beforeCheck:beforeCheck,onCheck:onCheck,beforeExpand:beforeExpand,onExpand:onExpand,onCollapse:onCollapse,onClick:onClick}};return setting},_selectTreeNode:function(treeId,treeNode){var self=this,o=this.options,parentValues=BI.deepClone(treeNode.parentValues||self._getParentValues(treeNode)),name=this._getNodeValue(treeNode);if(treeNode.checked===!0);else{var tNode=treeNode,pNode=this._getTree(this.options.paras.selectedValues,parentValues);for(BI.isNotNull(pNode[name])&&delete pNode[name];null!=tNode&&BI.isEmpty(pNode);)parentValues=parentValues.slice(0,parentValues.length-1),tNode=tNode.getParentNode(),null!=tNode&&(pNode=this._getTree(this.options.paras.selectedValues,parentValues),name=this._getNodeValue(tNode),delete pNode[name])}BI.AsyncTree.superclass._selectTreeNode.apply(self,arguments)},_beforeExpandNode:function(treeId,treeNode){function callback(nodes,hasNext){self.nodes.addNodes(treeNode,nodes),hasNext===!0&&BI.delay(function(){times++,op.times=times,o.itemsCreator(op,complete)},100)}var self=this,o=this.options,parentValues=treeNode.parentValues||self._getParentValues(treeNode),op=BI.extend({},o.paras,{id:treeNode.id,times:1,parentValues:parentValues.concat(this._getNodeValue(treeNode)),checkState:treeNode.getCheckStatus()}),complete=function(d){var nodes=d.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes),!!d.hasNext)},times=1;treeNode.children||setTimeout(function(){o.itemsCreator(op,complete)},17)},_join:function(valueA,valueB){function track(parent,node,compare){BI.each(node,function(n,item){BI.isNull(compare[n])?self._addTreeNode(map,parent,n,item):BI.isEmpty(compare[n])?self._addTreeNode(map,parent,n,{}):track(parent.concat([n]),node[n],compare[n])})}var self=this,map={};return track([],valueA,valueB),track([],valueB,valueA),map},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.AsyncTree.superclass.hasChecked.apply(this,arguments)},_getJoinValue:function(){if(!this.nodes)return{};var checkedValues=this._getSelectedValues();return BI.isEmpty(checkedValues)?BI.deepClone(this.options.paras.selectedValues):BI.isEmpty(this.options.paras.selectedValues)?checkedValues:this._join(checkedValues,this.options.paras.selectedValues)},getValue:function(){return this._getJoinValue()},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._initTree(setting)}}),BI.shortcut("bi.async_tree",BI.AsyncTree),BI.PartTree=BI.inherit(BI.AsyncTree,{_defaultConfig:function(){return BI.extend(BI.PartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.PartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var self=this,o=this.options,op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),o.itemsCreator(op,function(d){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,self._stop!==!0&&(hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes)))})},_selectTreeNode:function(treeId,treeNode){var self=this,o=this.options,parentValues=BI.deepClone(treeNode.parentValues||self._getParentValues(treeNode)),name=this._getNodeValue(treeNode);if(treeNode.checked===!0)this.options.paras.selectedValues=this._getJoinValue(),o.itemsCreator(BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_ADJUST_DATA,curSelectedValue:name,parentValues:parentValues}),function(res){self.options.paras.selectedValues=res,BI.AsyncTree.superclass._selectTreeNode.apply(self,arguments)});else{for(var t=this.options.paras.selectedValues,p=parentValues.concat(name),i=0,len=p.length;i0?self._dealWidthNodes(nodes):[]),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),self.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){o.itemsCreator(op,complete)},100)},getValue:function(){return BI.deepClone(this.options.paras.selectedValues||{})},stroke:function(config){var o=this.options;delete o.paras.keyword,BI.extend(o.paras,config),delete o.paras.lastSearchValue;var setting=this._configSetting();this._initTree(setting,o.paras.keyword)}}),BI.shortcut("bi.part_tree",BI.PartTree),BI.ListTreeView=BI.inherit(BI.TreeView,{_constants:{SPLIT:"<|>"},_defaultConfig:function(){return BI.extend(BI.ListTreeView.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListTreeView.superclass._init.apply(this,arguments);var o=this.options;this.storeValue=o.value||{}},_configSetting:function(){function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked;self._checkValue(treeNode,!checked),zTree.checkNode(treeNode,!checked,!0,!0)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}var paras=this.options.paras,self=this,setting={async:{enable:!1},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:onCheck,onClick:onClick}};return setting},_selectTreeNode:function(treeId,treeNode){this._checkValue(treeNode,treeNode.checked),BI.ListTreeView.superclass._selectTreeNode.apply(this,arguments)},_transArrayToMap:function(treeArrays){var self=this,map={};return BI.each(treeArrays,function(idx,array){var key=array.join(self._constants.SPLIT);map[key]=!0}),map},_transMapToArray:function(treeMap){var self=this,array=[];return BI.each(treeMap,function(key){var item=key.split(self._constants.SPLIT);array.push(item)}),array},_checkValue:function(treeNode,checked){var key=BI.concat(this._getParentValues(treeNode),this._getNodeValue(treeNode)).join(this._constants.SPLIT);checked?this.storeValue[key]=!0:delete this.storeValue[key]},setSelectedValue:function(value){this.options.paras.selectedValues=value||[],this.storeValue=this._transArrayToMap(value)},getValue:function(){return this._transMapToArray(this.storeValue)}}),BI.shortcut("bi.list_tree_view",BI.ListTreeView),BI.ListAsyncTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListAsyncTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListAsyncTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCheck(treeId,treeNode){treeNode.half=!1}function onClick(event,treeId,treeNode){var zTree=BI.$.fn.zTree.getZTreeObj(treeId),checked=treeNode.checked;self._checkValue(treeNode,!checked),zTree.checkNode(treeNode,!checked,!0,!0)}function beforeExpand(treeId,treeNode){self._beforeExpandNode(treeId,treeNode)}function onCheck(event,treeId,treeNode){self._selectTreeNode(treeId,treeNode)}var paras=this.options.paras,self=this,setting={async:{enable:!1,otherParam:BI.cjkEncodeDO(paras)},check:{enable:!0,chkboxType:{Y:"",N:""}},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},view:{showIcon:!1,expandSpeed:"",nameIsHTML:!0,dblClickExpand:!1},callback:{onCheck:onCheck,beforeExpand:beforeExpand,beforeCheck:beforeCheck,onClick:onClick}};return setting},_beforeExpandNode:function(treeId,treeNode){function callback(nodes,hasNext){self.nodes.addNodes(treeNode,nodes),hasNext===!0&&BI.delay(function(){times++,op.times=times,o.itemsCreator(op,complete)},100)}var self=this,o=this.options,parentValues=treeNode.parentValues||self._getParentValues(treeNode),op=BI.extend({},o.paras,{id:treeNode.id,times:1,parentValues:parentValues.concat(this._getNodeValue(treeNode))}),complete=function(d){var nodes=d.items||[];nodes.length>0&&callback(self._dealWidthNodes(nodes),!!d.hasNext)},times=1;treeNode.children||setTimeout(function(){o.itemsCreator(op,complete)},17)},hasChecked:function(){return!BI.isEmpty(this.options.paras.selectedValues)||BI.ListAsyncTree.superclass.hasChecked.apply(this,arguments)},stroke:function(config){delete this.options.keyword,BI.extend(this.options.paras,config);var setting=this._configSetting();this._initTree(setting)}}),BI.shortcut("bi.list_async_tree",BI.ListAsyncTree),BI.ListPartTree=BI.inherit(BI.ListAsyncTree,{_defaultConfig:function(){return BI.extend(BI.ListPartTree.superclass._defaultConfig.apply(this,arguments),{})},_init:function(){BI.ListPartTree.superclass._init.apply(this,arguments)},_loadMore:function(){var self=this,o=this.options,op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:++this.times});this.tip.setLoading(),o.itemsCreator(op,function(d){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,self._stop!==!0&&(hasNext?self.tip.setLoaded():self.tip.setEnd(),nodes.length>0&&self.nodes.addNodes(null,self._dealWidthNodes(nodes)))})},_initTree:function(setting,keyword){function callback(nodes){self._stop!==!0&&(self.nodes=BI.$.fn.zTree.init(tree.element,setting,nodes))}var self=this,o=this.options;this.times=1;var tree=this.tree;tree.empty(),self.tip.setVisible(!1),this.loading();var op=BI.extend({},o.paras,{type:BI.TreeView.REQ_TYPE_INIT_DATA,times:this.times}),complete=function(d){if(self._stop!==!0&&keyword==o.paras.keyword){var hasNext=!!d.hasNext,nodes=d.items||[];o.paras.lastSearchValue=d.lastSearchValue,callback(nodes.length>0?self._dealWidthNodes(nodes):[]),self.setTipVisible(nodes.length<=0),self.loaded(),hasNext?self.tip.setLoaded():self.tip.invisible(),self.fireEvent(BI.Events.AFTERINIT)}};BI.delay(function(){o.itemsCreator(op,complete)},100)},stroke:function(config){var o=this.options;delete o.paras.keyword,BI.extend(o.paras,config),delete o.paras.lastSearchValue;var setting=this._configSetting();this._initTree(setting,o.paras.keyword)}}),BI.shortcut("bi.list_part_tree",BI.ListPartTree),BI.prepares.push(function(){BI.Resizers=new BI.ResizeController,BI.Layers=new BI.LayerController,BI.Maskers=new BI.MaskersController,BI.Bubbles=new BI.BubblesController,BI.Tooltips=new BI.TooltipsController,BI.Popovers=new BI.PopoverController,BI.Broadcasts=new BI.BroadcastController,BI.StyleLoaders=new BI.StyleLoaderManager}),BI.CollectionView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CollectionView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-collection",overflowX:!0,overflowY:!0,cellSizeAndPositionGetter:BI.emptyFn,horizontalOverscanSize:0,verticalOverscanSize:0,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.CollectionView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){self._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){self._scrollLock!==!0&&(o.scrollLeft=self.element.scrollLeft(),o.scrollTop=self.element.scrollTop(),self._calculateChildrenToRender(),self.fireEvent(BI.CollectionView.EVENT_SCROLL,{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:o.overflowX===!0&&o.overflowY===!0,scrolly:o.overflowX===!1&&o.overflowY===!0,scrollx:o.overflowX===!0&&o.overflowY===!1,items:[this.container]}),o.items.length>0&&(this._calculateSizeAndPositionData(),this._populate())},mounted:function(){var o=this.options;0===o.scrollLeft&&0===o.scrollTop||(this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft))},_calculateSizeAndPositionData:function(){for(var o=this.options,cellMetadata=[],sectionManager=new BI.SectionManager,height=0,width=0,index=0,len=o.items.length;index0&&bottom>0){if(top>=this.renderRange.minY&&bottom<=this.renderRange.maxY&&left>=this.renderRange.minX&&right<=this.renderRange.maxX)return;for(var childrenToDisplay=this._cellRenderers(bottom-top,right-left,left,top),renderedCells=[],renderedKeys={},renderedWidgets={},lefts={},tops={},i=0,len=childrenToDisplay.length;i=0?(datum.width!==this.renderedCells[index]._width&&(this.renderedCells[index]._width=datum.width,this.renderedCells[index].el.setWidth(datum.width)),datum.height!==this.renderedCells[index]._height&&(this.renderedCells[index]._height=datum.height,this.renderedCells[index].el.setHeight(datum.height)),this.renderedCells[index]._left!==datum.x&&this.renderedCells[index].el.element.css("left",datum.x+"px"),this.renderedCells[index]._top!==datum.y&&this.renderedCells[index].el.element.css("top",datum.y+"px"),renderedCells.push(child=this.renderedCells[index])):(child=BI.createWidget(BI.extend({type:"bi.label",width:datum.width,height:datum.height},o.items[datum.index],{cls:(o.items[datum.index].cls||"")+" container-cell"+(0===datum.y?" first-row":"")+(0===datum.x?" first-col":""),_left:datum.x,_top:datum.y})),renderedCells.push({el:child,left:datum.x,top:datum.y,_left:datum.x,_top:datum.y,_width:datum.width,_height:datum.height}));for(var startTopIndex=0|topMap[datum.y],endTopIndex=0|topMap[datum.y+datum.height],k=startTopIndex;k<=endTopIndex;k++){var t=tops[k];assertMinBorder(leftBorder,t),assertMaxBorder(rightBorder,t),leftBorder[t]=Math.min(leftBorder[t],datum.x),rightBorder[t]=Math.max(rightBorder[t],datum.x+datum.width)}for(var startLeftIndex=0|leftMap[datum.x],endLeftIndex=0|leftMap[datum.x+datum.width],k=startLeftIndex;k<=endLeftIndex;k++){var l=lefts[k];assertMinBorder(topBorder,l),assertMaxBorder(bottomBorder,l),topBorder[l]=Math.min(topBorder[l],datum.y),bottomBorder[l]=Math.max(bottomBorder[l],datum.y+datum.height)}renderedKeys[datum.index]=[datum.index,i],renderedWidgets[i]=child}var existSet={},addSet={},deleteArray=[];BI.each(renderedKeys,function(i,key){self.renderedKeys[i]?existSet[i]=key:addSet[i]=key}),BI.each(this.renderedKeys,function(i,key){existSet[i]||addSet[i]||deleteArray.push(key[1])}),BI.each(deleteArray,function(i,index){self.renderedCells[index].el._destroy()});var addedItems=[];BI.each(addSet,function(index,key){addedItems.push(renderedCells[key[1]])}),this.container.addItems(addedItems),this.container._children=renderedWidgets,this.container.attr("items",renderedCells),this.renderedCells=renderedCells,this.renderedKeys=renderedKeys;var minX=BI.min(leftBorder),maxX=BI.max(rightBorder),minY=BI.max(topBorder),maxY=BI.min(bottomBorder);this.renderRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY}}},_getMaxScrollLeft:function(){return Math.max(0,this._width-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._height-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(items){var o=this.options;if(this._reRange(),items&&items!==this.options.items&&(this.options.items=items,this._calculateSizeAndPositionData()),o.items.length>0){this.container.setWidth(this._width),this.container.setHeight(this._height),this._calculateChildrenToRender();try{this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft)}catch(e){}}},setScrollLeft:function(scrollLeft){this.options.scrollLeft!==scrollLeft&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(scrollLeft||0,0,this._getMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(scrollTop){this.options.scrollTop!==scrollTop&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(scrollTop||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setOverflowX:function(b){var self=this;this.options.overflowX!==!!b&&(this.options.overflowX=!!b,BI.nextTick(function(){self.element.css({overflowX:b?"auto":"hidden"})}))},setOverflowY:function(b){var self=this;this.options.overflowY!==!!b&&(this.options.overflowY=!!b,BI.nextTick(function(){self.element.css({overflowY:b?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(i,cell){cell.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(items){items&&items!==this.options.items&&this.restore(),this._populate(items)}}),BI.CollectionView.EVENT_SCROLL="EVENT_SCROLL",BI.shortcut("bi.collection_view",BI.CollectionView),BI.Combo=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Combo.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-combo",trigger:"click",toggle:!0,direction:"bottom",logic:{dynamic:!0},container:null,isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopEvent:!1,stopPropagation:!1,adjustLength:0,adjustXOffset:0,adjustYOffset:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{},comboClass:"bi-combo-popup",hoverClass:"bi-combo-hover"})},_init:function(){BI.Combo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._initCombo(),this._initPullDownAction(),this.combo.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Combo.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Combo.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE,obj))}),self.element.on("mouseenter."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&self.element.addClass(o.hoverClass)}),self.element.on("mouseleave."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&self.element.removeClass(o.hoverClass)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(o.logic,{items:[{el:this.combo}]})))),o.isDefaultInit&&this._assertPopupView(),BI.Resizers.add(this.getName(),BI.bind(function(){this.isViewVisible()&&this._hideView()},this))},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){function hide(){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&o.toggle===!0&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.combo),self.fireEvent(BI.Combo.EVENT_COLLAPSE)),self.popupView&&self.popupView.element.off("mouseenter."+self.getName()).off("mouseleave."+self.getName()),enterPopup=!1}var self=this,o=this.options,evs=(this.options.trigger||"").split(","),st=function(e){o.stopEvent&&e.stopEvent(),o.stopPropagation&&e.stopPropagation()},enterPopup=!1;BI.each(evs,function(i,ev){switch(ev){case"hover":self.element.on("mouseenter."+self.getName(),function(e){self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND))}),self.element.on("mouseleave."+self.getName(),function(e){self.popupView&&(self.popupView.element.on("mouseenter."+self.getName(),function(e){enterPopup=!0,self.popupView.element.on("mouseleave."+self.getName(),function(e){hide()}),self.popupView.element.off("mouseenter."+self.getName())}),BI.defer(function(){enterPopup||hide()},50))});break;case"click":var debounce=BI.debounce(function(e){self.combo.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(o.toggle?self._toggle():self._popupView(),self.isViewVisible()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.combo),self.fireEvent(BI.Combo.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});self.element.off(ev+"."+self.getName()).on(ev+"."+self.getName(),function(e){debounce(e),st(e)});break;case"click-hover":var debounce=BI.debounce(function(e){self.combo.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.combo.isEnabled()&&self.combo.isValid()&&(self._popupView(),self.isViewVisible()&&(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.combo),self.fireEvent(BI.Combo.EVENT_EXPAND)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});self.element.off("click."+self.getName()).on("click."+self.getName(),function(e){debounce(e),st(e)}),self.element.on("mouseleave."+self.getName(),function(e){self.popupView&&(self.popupView.element.on("mouseenter."+self.getName(),function(e){enterPopup=!0,self.popupView.element.on("mouseleave."+self.getName(),function(e){hide()}),self.popupView.element.off("mouseenter."+self.getName())}),BI.defer(function(){enterPopup||hide()},50))})}})},_initCombo:function(){this.combo=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.popup_view",value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&(self.combo.setValue(self.getValue()),self.fireEvent(BI.Combo.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popupView.setVisible(!1),BI.nextTick(function(){self.fireEvent(BI.Combo.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this.options.container||this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideIf:function(e){if(this.element.find(e.target).length>0||this.popupView&&this.popupView.element.find(e.target).length>0||"CodeMirror-cursor"===e.target.className||BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length>0){var directions=this.options.direction.split(",");return void((BI.contains(directions,"innerLeft")||BI.contains(directions,"innerRight"))&&(this.adjustWidth(),this.adjustHeight()))}var isHide=this.options.hideChecker.apply(this,[e]);isHide!==!1&&this._hideView()},_hideView:function(){this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW),this.options.destroyWhenHide===!0?(this.popupView&&this.popupView.destroy(),this.popupView=null,this._rendered=!1):this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW)},_popupView:function(e){this._assertPopupViewRender(),this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW),this.popupView.visible(),this.adjustWidth(e),this.adjustHeight(e),this.element.addClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),BI.Widget._renderEngine.createElement(document).bind("mousedown."+this.getName(),BI.bind(this._hideIf,this)).bind("mousewheel."+this.getName(),BI.bind(this._hideIf,this)),this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW)},adjustWidth:function(e){var o=this.options;if(this.popupView&&o.isNeedAdjustWidth===!0){this.resetListWidth("");var width=this.popupView.element.outerWidth(),maxW=this.element.outerWidth()||o.width;width>maxW+80?maxW+=80:width>maxW&&(maxW=width),this.resetListWidth(maxW<100?100:maxW)}},adjustHeight:function(e){var o=this.options,p={};if(this.popupView){var isVisible=this.popupView.isVisible();this.popupView.visible();var combo=BI.isNotNull(e)?{element:{offset:function(){return{left:e.pageX,top:e.pageY}},bounds:function(){return{x:e.offsetX,y:e.offsetY,width:0,height:24}},outerWidth:function(){return 0},outerHeight:function(){return 24}}}:this.combo;switch(o.direction){case"bottom":case"bottom,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","right","left"],o.offsetStyle);break;case"top":case"top,right":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","right","left"],o.offsetStyle);break;case"left":case"left,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","bottom","top"],o.offsetStyle);break;case"right":case"right,bottom":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","bottom","top"],o.offsetStyle);break;case"top,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["top","bottom","left","right"],o.offsetStyle);break;case"bottom,left":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight,["bottom","top","left","right"],o.offsetStyle);break;case"left,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["left","right","top","bottom"],o.offsetStyle);break;case"right,top":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","top","bottom"],o.offsetStyle);break;case"right,innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerRight","innerLeft","bottom","top"],o.offsetStyle);break;case"right,innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["right","left","innerLeft","innerRight","bottom","top"],o.offsetStyle);break;case"innerRight":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerRight","innerLeft","right","left","bottom","top"],o.offsetStyle);break;case"innerLeft":p=BI.DOM.getComboPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength,o.adjustYOffset,o.isNeedAdjustHeight,["innerLeft","innerRight","left","right","bottom","top"],o.offsetStyle);break;case"top,custom":case"custom,top":p=BI.DOM.getTopAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"custom,bottom":case"bottom,custom":p=BI.DOM.getBottomAdaptPosition(combo,this.popupView,o.adjustYOffset||o.adjustLength,o.isNeedAdjustHeight);break;case"left,custom":case"custom,left":p=BI.DOM.getLeftAdaptPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength),delete p.top,delete p.adaptHeight;break;case"custom,right":case"right,custom":p=BI.DOM.getRightAdaptPosition(combo,this.popupView,o.adjustXOffset||o.adjustLength),delete p.top,delete p.adaptHeight}"adaptHeight"in p&&this.resetListHeight(p.adaptHeight),"left"in p&&this.popupView.element.css({left:p.left}),"top"in p&&this.popupView.element.css({top:p.top}),this.position=p,this.popupView.setVisible(isVisible)}},resetListHeight:function(h){this._assertPopupView(),this.popupView.resetHeight&&this.popupView.resetHeight(h)},resetListWidth:function(w){this._assertPopupView(),this.popupView.resetWidth&&this.popupView.resetWidth(w)},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.combo.populate.apply(this.combo,arguments)},_setEnable:function(arg){BI.Combo.superclass._setEnable.apply(this,arguments),arg===!0?this.element.removeClass("base-disabled disabled"):arg===!1&&this.element.addClass("base-disabled disabled"),!arg&&this.element.removeClass(this.options.hoverClass),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.combo.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.combo.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},showView:function(e){this.isEnabled()&&this.combo.isEnabled()&&!this.isViewVisible()&&this._popupView(e)},hideView:function(){this._hideView()},getView:function(){return this.popupView},getPopupPosition:function(){return this.position},toggle:function(){this._toggle()},destroyed:function(){BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()).unbind("mouseenter."+this.getName()).unbind("mousemove."+this.getName()).unbind("mouseleave."+this.getName()),BI.Resizers.remove(this.getName())}}),BI.Combo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Combo.EVENT_CHANGE="EVENT_CHANGE",BI.Combo.EVENT_EXPAND="EVENT_EXPAND",BI.Combo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Combo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Combo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Combo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Combo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Combo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.combo",BI.Combo),BI.Expander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Expander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-expander",trigger:"click",toggle:!0,isDefaultInit:!1,el:{},popup:{},expanderClass:"bi-expander-popup",hoverClass:"bi-expander-hover"})},_init:function(){BI.Expander.superclass._init.apply(this,arguments);var self=this,o=this.options;this._expanded=!!o.el.open,this._initExpander(),this._initPullDownAction(),this.expander.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Expander.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Expander.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Expander.EVENT_TRIGGER_CHANGE,value,obj))}),this.element.hover(function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&self.element.addClass(o.hoverClass)},function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&self.element.removeClass(o.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.expander}]}),o.isDefaultInit&&this._assertPopupView(),this.expander.isOpened()===!0&&this._popupView()},_toggle:function(){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var self=this,o=this.options,evs=this.options.trigger.split(",");BI.each(evs,function(i,e){switch(e){case"hover":self.element[e](function(e){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.expander),self.fireEvent(BI.Expander.EVENT_EXPAND))},function(){self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&o.toggle&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.expander),self.fireEvent(BI.Expander.EVENT_COLLAPSE))});break;case"click":e&&self.element.off(e+"."+self.getName()).on(e+"."+self.getName(),BI.debounce(function(e){self.expander.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.isValid()&&self.expander.isEnabled()&&self.expander.isValid()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.expander),self.fireEvent(BI.Expander.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.expander),self.fireEvent(BI.Expander.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initExpander:function(){this.expander=BI.createWidget(this.options.el)},_assertPopupView:function(){var self=this,o=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.button_group",cls:"expander-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Expander.EVENT_CHANGE,value,obj)}),this.popupView.setVisible(this.isExpanded()),BI.nextTick(function(){self.fireEvent(BI.Expander.EVENT_AFTER_INIT)}))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideView:function(){this.fireEvent(BI.Expander.EVENT_BEFORE_HIDEVIEW),this._expanded=!1,this.expander.setOpened(!1),this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_HIDEVIEW)},_popupView:function(){this._assertPopupViewRender(),this.fireEvent(BI.Expander.EVENT_BEFORE_POPUPVIEW),this._expanded=!0,this.expander.setOpened(!0),this.popupView.visible(),this.element.addClass(this.options.expanderClass),this.fireEvent(BI.Expander.EVENT_AFTER_POPUPVIEW)},populate:function(items){this.popupView&&this.popupView.populate.apply(this.popupView,arguments),this.expander.populate.apply(this.expander,arguments)},_setEnable:function(arg){BI.Expander.superclass._setEnable.apply(this,arguments),!arg&&this.element.removeClass(this.options.hoverClass),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.expander.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.expander.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},isExpanded:function(){return this._expanded},showView:function(){this.isEnabled()&&this.expander.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.expander.options.id===id?this.expander:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.expander.getValue()===value?this.expander:this.popupView&&this.popupView.getNodeByValue(value)},destroy:function(){BI.Expander.superclass.destroy.apply(this,arguments)}}),BI.Expander.EVENT_EXPAND="EVENT_EXPAND",BI.Expander.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Expander.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Expander.EVENT_CHANGE="EVENT_CHANGE",BI.Expander.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Expander.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Expander.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Expander.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Expander.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.expander",BI.Expander),BI.ComboGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ComboGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-combo-group bi-list-item",trigger:"click,hover",direction:"right",adjustLength:0,isDefaultInit:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.text_button",text:"",value:""},children:[],popup:{el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}}})},_init:function(){BI.ComboGroup.superclass._init.apply(this,arguments),this._populate(this.options.el)},_populate:function(item){var self=this,o=this.options,children=o.children;if(BI.isEmpty(children))throw new Error("ComboGroup构造错误");BI.each(children,function(i,ch){var son=BI.formatEL(ch).el.children;ch=BI.formatEL(ch).el,BI.isEmpty(son)||(ch.el=BI.clone(ch),ch.children=son,ch.type="bi.combo_group",ch.action=o.action,ch.height=o.height,ch.direction=o.direction,ch.isDefaultInit=o.isDefaultInit,ch.isNeedAdjustHeight=o.isNeedAdjustHeight,ch.isNeedAdjustWidth=o.isNeedAdjustWidth,ch.adjustLength=o.adjustLength,ch.popup=o.popup)}),this.combo=BI.createWidget({type:"bi.combo",element:this,container:o.container,height:o.height,trigger:o.trigger,direction:o.direction,isDefaultInit:o.isDefaultInit,isNeedAdjustWidth:o.isNeedAdjustWidth,isNeedAdjustHeight:o.isNeedAdjustHeight,adjustLength:o.adjustLength,el:item,popup:BI.extend({},o.popup,{el:BI.extend({items:children},o.popup.el)})}),this.combo.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.ComboGroup.EVENT_CHANGE,obj)})},getValue:function(){return this.combo.getValue()},setValue:function(v){this.combo.setValue(v)}}),BI.ComboGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.combo_group",BI.ComboGroup),BI.VirtualGroup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.VirtualGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-virtual-group",items:[],layouts:[{type:"bi.center",hgap:0,vgap:0}]})},render:function(){var o=this.options;this.populate(o.items),BI.isKey(o.value)&&this.setValue(o.value)},_packageBtns:function(items){for(var o=this.options,map=this.buttonMap={},i=o.layouts.length-1;i>0;i--)items=BI.map(items,function(k,it){var el=BI.stripEL(it);return BI.extend({},o.layouts[i],{items:[BI.extend({},o.layouts[i].el,{el:BI.extend({ref:function(_ref){BI.isKey(map[el.value])&&(map[el.value]=_ref)}},el)})]})});return items},_packageLayout:function(items){for(var o=this.options,layout=BI.deepClone(o.layouts[0]),lay=BI.formatEL(layout).el;lay&&lay.items&&!BI.isEmpty(lay.items);)lay=BI.formatEL(lay.items[0]).el;return lay.items=items,layout},addItems:function(items){this.layouts.addItems(items)},prependItems:function(items){this.layouts.prependItems(items)},setValue:function(v){v=BI.isArray(v)?v:[v],BI.each(this.buttonMap,function(key,item){item&&(v.deepContains(key)?item.setSelected&&item.setSelected(!0):item.setSelected&&item.setSelected(!1))})},getNotSelectedValue:function(){var v=[];return BI.each(this.buttonMap,function(i,item){item&&(!item.isEnabled()||item.isSelected&&item.isSelected()||v.push(item.getValue()))}),v},getValue:function(){var v=[];return BI.each(this.buttonMap,function(i,item){item&&item.isEnabled()&&item.isSelected&&item.isSelected()&&v.push(item.getValue())}),v},populate:function(items){var self=this;items=items||[],this.options.items=items,items=this._packageBtns(items),this.layouts?this.layouts.populate(items):this.layouts=BI.createWidget(BI.extend({element:this},this._packageLayout(items)))}}),BI.VirtualGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.virtual_group",BI.VirtualGroup),BI.Loader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Loader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-loader",direction:"top",isDefaultInit:!0,logic:{dynamic:!0,scrolly:!0},el:{type:"bi.button_group"},items:[],itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn,count:!1,prev:!1,next:{},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_prevLoad:function(){var self=this,o=this.options;this.prev.setLoading(),o.itemsCreator.apply(this,[{times:--this.times},function(){self.prev.setLoaded(),self.prependItems.apply(self,arguments)}])},_nextLoad:function(){var self=this,o=this.options;this.next.setLoading(),o.itemsCreator.apply(this,[{times:++this.times},function(){self.next.setLoaded(),self.addItems.apply(self,arguments)}])},_init:function(){BI.Loader.superclass._init.apply(this,arguments);var self=this,o=this.options;o.itemsCreator===!1&&(o.prev=!1,o.next=!1),o.prev!==!1&&(this.prev=BI.createWidget(BI.extend({type:"bi.loading_bar"},o.prev)),this.prev.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self._prevLoad()})),this.button_group=BI.createWidget(o.el,{type:"bi.button_group",chooseType:0,items:o.items,behaviors:{},layouts:[{type:"bi.vertical"}],value:o.value}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Loader.EVENT_CHANGE,obj)}),o.next!==!1&&(this.next=BI.createWidget(BI.extend({type:"bi.loading_bar"},o.next)),this.next.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self._nextLoad()})),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.prev,this.button_group,this.next)})))),o.isDefaultInit&&BI.isEmpty(o.items)&&BI.nextTick(BI.bind(function(){o.isDefaultInit&&BI.isEmpty(o.items)&&this._populate()},this)),BI.isNotEmptyArray(o.items)&&this._populate(o.items)},hasPrev:function(){var o=this.options;return BI.isNumber(o.count)?this.count0&&args.push(keyword),BI.Maskers.show(self.getName()),self.popupView.populate.apply(self.popupView,args),o.isAutoSync&&o.adapter&&o.adapter.getValue&&self.popupView.setValue(o.adapter.getValue()),self.popupView.loaded&&self.popupView.loaded(),self.fireEvent(BI.Searcher.EVENT_SEARCHING)}})}},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},doSearch:function(){this.isSearching()&&this._search()},stopSearch:function(){this._stopSearch();try{this.editor.blur()}catch(e){if(!this.editor.blur)throw new Error("editor没有实现blur方法")}finally{this.editor.setValue("")}},isSearching:function(){return this._isSearching},isViewVisible:function(){return this.editor.isEnabled()&&BI.Maskers.isVisible(this.getName())},getView:function(){return this.popupView},hasMatched:function(){return this._assertPopupView(),this.popupView.hasMatched()},adjustHeight:function(){BI.Maskers.has(this.getName())&&BI.Maskers.get(this.getName()).isVisible()&&BI.Maskers.show(this.getName())},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},setValue:function(v){BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getKeyword:function(){return this.editor.getValue()},getKeywords:function(){return this.editor.getKeywords()},getValue:function(){var o=this.options;return o.isAutoSync&&o.adapter&&o.adapter.getValue?o.adapter.getValue():this.isSearching()?this.popupView.getValue():o.adapter&&o.adapter.getValue?o.adapter.getValue():BI.isNull(this.popupView)?o.popup.value:this.popupView.getValue()},populate:function(result,searchResult,keyword){var o=this.options;this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),o.isAutoSync&&o.adapter&&o.adapter.getValue&&this.popupView.setValue(o.adapter.getValue())},empty:function(){this.popupView&&this.popupView.empty()},destroyed:function(){BI.Maskers.remove(this.getName())}}),BI.Searcher.EVENT_CHANGE="EVENT_CHANGE",BI.Searcher.EVENT_START="EVENT_START",BI.Searcher.EVENT_STOP="EVENT_STOP",BI.Searcher.EVENT_PAUSE="EVENT_PAUSE",BI.Searcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.Searcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.shortcut("bi.searcher",BI.Searcher),BI.Switcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Switcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-switcher",direction:BI.Direction.Top,trigger:"click",toggle:!0,el:{},popup:{},adapter:null,masker:{},switcherClass:"bi-switcher-popup",hoverClass:"bi-switcher-hover"})},_init:function(){BI.Switcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this._initSwitcher(),this._initPullDownAction(),this.switcher.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.isEnabled()&&self.isValid()&&(type===BI.Events.EXPAND&&self._popupView(),type===BI.Events.COLLAPSE&&self._hideView(),type===BI.Events.EXPAND&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.Switcher.EVENT_EXPAND)),type===BI.Events.COLLAPSE&&(self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.isViewVisible()&&self.fireEvent(BI.Switcher.EVENT_COLLAPSE)),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_TRIGGER_CHANGE,value,obj))}),this.element.hover(function(){self.isEnabled()&&self.switcher.isEnabled()&&self.element.addClass(o.hoverClass)},function(){self.isEnabled()&&self.switcher.isEnabled()&&self.element.removeClass(o.hoverClass)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.switcher}]}),o.isDefaultInit&&this._assertPopupView()},_toggle:function(){this._assertPopupView(),this.isExpanded()?this._hideView():this.isEnabled()&&this._popupView()},_initPullDownAction:function(){var self=this,o=this.options,evs=this.options.trigger.split(",");BI.each(evs,function(i,e){switch(e){case"hover":self.element[e](function(e){self.isEnabled()&&self.switcher.isEnabled()&&(self._popupView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND))},function(){self.isEnabled()&&self.switcher.isEnabled()&&o.toggle&&(self._hideView(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE))});break;default:e&&self.element.off(e+"."+self.getName()).on(e+"."+self.getName(),BI.debounce(function(e){self.switcher.element.__isMouseInBounds__(e)&&self.isEnabled()&&self.switcher.isEnabled()&&(o.toggle?self._toggle():self._popupView(),self.isExpanded()?(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_EXPAND)):(self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",self.switcher),self.fireEvent(BI.Switcher.EVENT_COLLAPSE)))},BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}))}})},_initSwitcher:function(){this.switcher=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var self=this,o=this.options;this._created||(this.popupView=BI.createWidget(o.popup,{type:"bi.button_group",element:o.adapter&&BI.Maskers.create(this.getName(),o.adapter,BI.extend({container:this},o.masker)),cls:"switcher-popup",layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.Switcher.EVENT_CHANGE,value,obj)}),o.direction===BI.Direction.Custom||o.adapter||BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[{el:this.popupView}]}),this._created=!0,BI.nextTick(function(){self.fireEvent(BI.Switcher.EVENT_AFTER_INIT)}))},_hideView:function(){this.fireEvent(BI.Switcher.EVENT_BEFORE_HIDEVIEW);var self=this,o=this.options;o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),BI.nextTick(function(){o.adapter?BI.Maskers.hide(self.getName()):self.popupView&&self.popupView.setVisible(!1),self.element.removeClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_HIDEVIEW)})},_popupView:function(){var self=this,o=this.options;this._assertPopupView(),this.fireEvent(BI.Switcher.EVENT_BEFORE_POPUPVIEW),o.adapter?BI.Maskers.show(this.getName()):self.popupView.setVisible(!0),BI.nextTick(function(name){o.adapter?BI.Maskers.show(name):self.popupView.setVisible(!0),self.element.addClass(o.switcherClass),self.fireEvent(BI.Switcher.EVENT_AFTER_POPUPVIEW)},this.getName())},populate:function(items){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.switcher.populate.apply(this.switcher,arguments)},_setEnable:function(arg){BI.Switcher.superclass._setEnable.apply(this,arguments),!arg&&this.isViewVisible()&&this._hideView()},setValue:function(v){this.switcher.setValue(v),BI.isNull(this.popupView)?this.options.popup.value=v:this.popupView.setValue(v)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},setAdapter:function(adapter){this.options.adapter=adapter,BI.Maskers.remove(this.getName())},isViewVisible:function(){return this.isEnabled()&&this.switcher.isEnabled()&&(this.options.adapter?BI.Maskers.isVisible(this.getName()):this.popupView&&this.popupView.isVisible())},isExpanded:function(){return this.isViewVisible()},showView:function(){this.isEnabled()&&this.switcher.isEnabled()&&this._popupView()},hideView:function(){this._hideView()},getView:function(){return this.popupView},adjustView:function(){this.isViewVisible()&&BI.Maskers.show(this.getName())},getAllLeaves:function(){return this.popupView&&this.popupView.getAllLeaves()},getNodeById:function(id){return this.switcher.attr("id")===id?this.switcher:this.popupView&&this.popupView.getNodeById(id)},getNodeByValue:function(value){return this.switcher.getValue()===value?this.switcher:this.popupView&&this.popupView.getNodeByValue(value)},empty:function(){this.popupView&&this.popupView.empty()},destroy:function(){BI.Switcher.superclass.destroy.apply(this,arguments)}}),BI.Switcher.EVENT_EXPAND="EVENT_EXPAND",BI.Switcher.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Switcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Switcher.EVENT_CHANGE="EVENT_CHANGE",BI.Switcher.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Switcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Switcher.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Switcher.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Switcher.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.switcher",BI.Switcher),BI.Tab=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Tab.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tab",direction:"top",single:!1,logic:{dynamic:!1},showIndex:!1,tab:!1,cardCreator:function(v){return BI.createWidget()}})},render:function(){var self=this,o=this.options;BI.isObject(o.tab)&&(this.tab=BI.createWidget(this.options.tab,{type:"bi.button_group"}),this.tab.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})),this.cardMap={},this.layout=BI.createWidget({type:"bi.card"}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.tab,this.layout)}))));var listener=new BI.ShowListener({eventObj:this.tab,cardLayout:this.layout,cardCreator:function(v){var card=o.cardCreator.apply(self,arguments);return self.cardMap[v]=card,card},afterCardShow:function(v){self._deleteOtherCards(v),self.curr=v}});listener.on(BI.ShowListener.EVENT_CHANGE,function(value){self.fireEvent(BI.Tab.EVENT_CHANGE,value,self)})},_deleteOtherCards:function(currCardName){var self=this,o=this.options;o.single===!0&&BI.each(this.cardMap,function(name,card){name!==currCardName+""&&(self.layout.deleteCardByName(name),delete self.cardMap[name])})},_assertCard:function(v){if(!this.layout.isCardExisted(v)){var card=this.options.cardCreator(v);this.cardMap[v]=card,this.layout.addCardByName(v,card)}},mounted:function(){var o=this.options;o.showIndex!==!1&&this.setSelect(o.showIndex)},setSelect:function(v){this.tab&&this.tab.setValue(v),this._assertCard(v),this.layout.showCardByName(v),this._deleteOtherCards(v),this.curr!==v&&(this.curr=v)},removeTab:function(cardname){var self=this,o=this.options;BI.any(this.cardMap,function(name,card){if(BI.isEqual(name,cardname+""))return self.layout.deleteCardByName(name),delete self.cardMap[name],!0})},getSelect:function(){return this.curr},getSelectedTab:function(){return this.layout.getShowingCard()},getTab:function(v){return this._assertCard(v),this.layout.getCardByName(v)},setValue:function(v){var card=this.layout.getShowingCard();card&&card.setValue(v)},getValue:function(){var card=this.layout.getShowingCard();if(card)return card.getValue()},populate:function(){var card=this.layout.getShowingCard();if(card)return card.populate&&card.populate.apply(card,arguments)},empty:function(){this.layout.deleteAllCard(),this.cardMap={}},destroy:function(){this.cardMap={},BI.Tab.superclass.destroy.apply(this,arguments)}}),BI.Tab.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tab",BI.Tab),BI.EL=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EL.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-el",el:{},layout:{}})},_init:function(){BI.EL.superclass._init.apply(this,arguments);var self=this,o=this.options;this.ele=BI.createWidget(o.el),BI.createWidget(o.layout,{type:"bi.adaptive",element:this,items:[this.ele]}),this.ele.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},setValue:function(v){this.ele.setValue(v)},getValue:function(){return this.ele.getValue()},populate:function(){this.ele.populate.apply(this,arguments)}}),BI.shortcut("bi.el",BI.EL),BI.Msg=function(){var messageShow,$mask,$pop,toastStack=[];return{alert:function(title,message,callback){this._show(!1,title,message,callback)},confirm:function(title,message,callback){this._show(!0,title,message,callback)},prompt:function(title,message,value,callback,min_width){},toast:function(message,options,context){options=options||{},context=context||BI.Widget._renderEngine.createElement("body");var level=options.level||"normal",autoClose=!!BI.isNull(options.autoClose)||options.autoClose,toast=BI.createWidget({type:"bi.toast",cls:"bi-message-animate bi-message-leave",level:level,autoClose:autoClose,text:message,listeners:[{eventName:BI.Toast.EVENT_DESTORY,action:function(){BI.remove(toastStack,toast.element);var _height=10;BI.each(toastStack,function(i,element){element.css({top:_height}),_height+=element.outerHeight()+10})}}]}),height=10;BI.each(toastStack,function(i,element){height+=element.outerHeight()+10}),BI.createWidget({type:"bi.absolute",element:context,items:[{el:toast,left:"50%",top:height}]}),toastStack.push(toast.element),toast.element.css({"margin-left":-1*toast.element.outerWidth()/2}),toast.element.removeClass("bi-message-leave").addClass("bi-message-enter"),autoClose&&BI.delay(function(){toast.element.removeClass("bi-message-enter").addClass("bi-message-leave"),toast.destroy()},5e3)},_show:function(hasCancel,title,message,callback){$mask=BI.Widget._renderEngine.createElement('
      ').css({position:"absolute",zIndex:BI.zIndex_tip-2,top:0,left:0,right:0,bottom:0,opacity:.5}).appendTo("body"),$pop=BI.Widget._renderEngine.createElement('
      ').css({position:"absolute",zIndex:BI.zIndex_tip-1,top:0,left:0,right:0,bottom:0}).appendTo("body");var close=function(){messageShow.destroy(),$mask.remove()},controlItems=[];hasCancel===!0&&controlItems.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_Cancel"),level:"ignore",handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!1])}}}),controlItems.push({el:{type:"bi.button",text:BI.i18nText("BI-Basic_OK"),handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!0])}}});var conf={element:$pop,type:"bi.center_adapt",items:[{type:"bi.border",cls:"bi-card",items:{north:{el:{type:"bi.border",cls:"bi-message-title bi-background",items:{center:{el:{type:"bi.label",cls:"bi-font-bold",text:title||BI.i18nText("BI-Basic_Prompt"),textAlign:"left",hgap:20,height:40}},east:{el:{type:"bi.icon_button",cls:"bi-message-close close-font",handler:function(){close(),BI.isFunction(callback)&&callback.apply(null,[!1])}},width:60}}},height:40},center:{el:{type:"bi.label",vgap:10,hgap:20,whiteSpace:"normal",text:message}},south:{el:{type:"bi.absolute",items:[{el:{type:"bi.right_vertical_adapt",lgap:10,items:controlItems},top:0,left:20,right:20,bottom:0}]},height:44}},width:450,height:200}]};messageShow=BI.createWidget(conf)}}}(),BI.GridView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.GridView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-grid-view",overflowX:!0,overflowY:!0,overscanColumnCount:0,overscanRowCount:0,rowHeightGetter:BI.emptyFn,columnWidthGetter:BI.emptyFn,scrollLeft:0,scrollTop:0,items:[]})},_init:function(){BI.GridView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1,this._debounceRelease=BI.debounce(function(){self._scrollLock=!1},1e3/60),this.container=BI.createWidget({type:"bi.absolute"}),this.element.scroll(function(){self._scrollLock!==!0&&(o.scrollLeft=self.element.scrollLeft(),o.scrollTop=self.element.scrollTop(),self._calculateChildrenToRender(),self.fireEvent(BI.GridView.EVENT_SCROLL,{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}))}),BI.createWidget({type:"bi.vertical",element:this,scrollable:o.overflowX===!0&&o.overflowY===!0,scrolly:o.overflowX===!1&&o.overflowY===!0,scrollx:o.overflowX===!0&&o.overflowY===!1,items:[this.container]}),o.items.length>0&&this._populate()},mounted:function(){var o=this.options;0===o.scrollLeft&&0===o.scrollTop||(this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft))},_getOverscanIndices:function(cellCount,overscanCellsCount,startIndex,stopIndex){return{overscanStartIndex:Math.max(0,startIndex-overscanCellsCount),overscanStopIndex:Math.min(cellCount-1,stopIndex+overscanCellsCount)}},_calculateChildrenToRender:function(){var self=this,o=this.options,width=o.width,height=o.height,scrollLeft=BI.clamp(o.scrollLeft,0,this._getMaxScrollLeft()),scrollTop=BI.clamp(o.scrollTop,0,this._getMaxScrollTop()),overscanColumnCount=o.overscanColumnCount,overscanRowCount=o.overscanRowCount;if(height>0&&width>0){var visibleColumnIndices=this._columnSizeAndPositionManager.getVisibleCellRange(width,scrollLeft),visibleRowIndices=this._rowSizeAndPositionManager.getVisibleCellRange(height,scrollTop);if(BI.isEmpty(visibleColumnIndices)||BI.isEmpty(visibleRowIndices))return;var horizontalOffsetAdjustment=this._columnSizeAndPositionManager.getOffsetAdjustment(width,scrollLeft),verticalOffsetAdjustment=this._rowSizeAndPositionManager.getOffsetAdjustment(height,scrollTop);this._renderedColumnStartIndex=visibleColumnIndices.start,this._renderedColumnStopIndex=visibleColumnIndices.stop,this._renderedRowStartIndex=visibleRowIndices.start,this._renderedRowStopIndex=visibleRowIndices.stop;var overscanColumnIndices=this._getOverscanIndices(this.columnCount,overscanColumnCount,this._renderedColumnStartIndex,this._renderedColumnStopIndex),overscanRowIndices=this._getOverscanIndices(this.rowCount,overscanRowCount,this._renderedRowStartIndex,this._renderedRowStopIndex),columnStartIndex=overscanColumnIndices.overscanStartIndex,columnStopIndex=overscanColumnIndices.overscanStopIndex,rowStartIndex=overscanRowIndices.overscanStartIndex,rowStopIndex=overscanRowIndices.overscanStopIndex,minRowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStartIndex),minColumnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStartIndex),maxRowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowStopIndex),maxColumnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnStopIndex),top=minRowDatum.offset+verticalOffsetAdjustment,left=minColumnDatum.offset+horizontalOffsetAdjustment,bottom=maxRowDatum.offset+verticalOffsetAdjustment+maxRowDatum.size,right=maxColumnDatum.offset+horizontalOffsetAdjustment+maxColumnDatum.size;if(top>=this.renderRange.minY&&bottom<=this.renderRange.maxY&&left>=this.renderRange.minX&&right<=this.renderRange.maxX)return;for(var renderedCells=[],renderedKeys={},renderedWidgets={},minX=this._getMaxScrollLeft(),minY=this._getMaxScrollTop(),maxX=0,maxY=0,count=0,rowIndex=rowStartIndex;rowIndex<=rowStopIndex;rowIndex++)for(var rowDatum=this._rowSizeAndPositionManager.getSizeAndPositionOfCell(rowIndex),columnIndex=columnStartIndex;columnIndex<=columnStopIndex;columnIndex++){var key=rowIndex+"-"+columnIndex,columnDatum=this._columnSizeAndPositionManager.getSizeAndPositionOfCell(columnIndex),index=this.renderedKeys[key]&&this.renderedKeys[key][2],child;index>=0?(columnDatum.size!==this.renderedCells[index]._width&&(this.renderedCells[index]._width=columnDatum.size,this.renderedCells[index].el.setWidth(columnDatum.size)),rowDatum.size!==this.renderedCells[index]._height&&(this.renderedCells[index]._height=rowDatum.size,this.renderedCells[index].el.setHeight(rowDatum.size)),this.renderedCells[index]._left!==columnDatum.offset+horizontalOffsetAdjustment&&this.renderedCells[index].el.element.css("left",columnDatum.offset+horizontalOffsetAdjustment+"px"),this.renderedCells[index]._top!==rowDatum.offset+verticalOffsetAdjustment&&this.renderedCells[index].el.element.css("top",rowDatum.offset+verticalOffsetAdjustment+"px"),renderedCells.push(child=this.renderedCells[index])):(child=BI.createWidget(BI.extend({type:"bi.label",width:columnDatum.size,height:rowDatum.size},o.items[rowIndex][columnIndex],{cls:(o.items[rowIndex][columnIndex].cls||"")+" grid-cell"+(0===rowIndex?" first-row":"")+(0===columnIndex?" first-col":""),_rowIndex:rowIndex,_columnIndex:columnIndex,_left:columnDatum.offset+horizontalOffsetAdjustment,_top:rowDatum.offset+verticalOffsetAdjustment}),this),renderedCells.push({el:child,left:columnDatum.offset+horizontalOffsetAdjustment,top:rowDatum.offset+verticalOffsetAdjustment,_left:columnDatum.offset+horizontalOffsetAdjustment,_top:rowDatum.offset+verticalOffsetAdjustment,_width:columnDatum.size,_height:rowDatum.size})),minX=Math.min(minX,columnDatum.offset+horizontalOffsetAdjustment),maxX=Math.max(maxX,columnDatum.offset+horizontalOffsetAdjustment+columnDatum.size),minY=Math.min(minY,rowDatum.offset+verticalOffsetAdjustment),maxY=Math.max(maxY,rowDatum.offset+verticalOffsetAdjustment+rowDatum.size),renderedKeys[key]=[rowIndex,columnIndex,count],renderedWidgets[count]=child,count++}var existSet={},addSet={},deleteArray=[];BI.each(renderedKeys,function(i,key){self.renderedKeys[i]?existSet[i]=key:addSet[i]=key}),BI.each(this.renderedKeys,function(i,key){existSet[i]||addSet[i]||deleteArray.push(key[2])}),BI.each(deleteArray,function(i,index){self.renderedCells[index].el._destroy()});var addedItems=[];BI.each(addSet,function(index,key){addedItems.push(renderedCells[key[2]])}),this.container.addItems(addedItems,this),this.container._children=renderedWidgets,this.container.attr("items",renderedCells),this.renderedCells=renderedCells,this.renderedKeys=renderedKeys,this.renderRange={minX:minX,minY:minY,maxX:maxX,maxY:maxY}}},_getRealMaxScrollLeft:function(){var o=this.options,totalWidth=0;return BI.count(0,this.columnCount,function(index){totalWidth+=o.columnWidthGetter(index)}),Math.max(0,totalWidth-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollLeft:function(){return Math.max(0,this._columnSizeAndPositionManager.getTotalSize()-this.options.width+(this.options.overflowX?BI.DOM.getScrollWidth():0))},_getMaxScrollTop:function(){return Math.max(0,this._rowSizeAndPositionManager.getTotalSize()-this.options.height+(this.options.overflowY?BI.DOM.getScrollWidth():0))},_populate:function(items){var self=this,o=this.options;this._reRange(),this.columnCount=0,this.rowCount=0,items&&items!==this.options.items&&(this.options.items=items),BI.isNumber(o.columnCount)?this.columnCount=o.columnCount:o.items.length>0&&(this.columnCount=o.items[0].length),BI.isNumber(o.rowCount)?this.rowCount=o.rowCount:this.rowCount=o.items.length,this.container.setWidth(this.columnCount*o.estimatedColumnSize),this.container.setHeight(this.rowCount*o.estimatedRowSize),this._columnSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.columnCount,o.columnWidthGetter,o.estimatedColumnSize),this._rowSizeAndPositionManager=new BI.ScalingCellSizeAndPositionManager(this.rowCount,o.rowHeightGetter,o.estimatedRowSize),this._calculateChildrenToRender();try{this.element.scrollTop(o.scrollTop),this.element.scrollLeft(o.scrollLeft)}catch(e){}},setScrollLeft:function(scrollLeft){this.options.scrollLeft!==scrollLeft&&(this._scrollLock=!0,this.options.scrollLeft=BI.clamp(scrollLeft||0,0,this._getRealMaxScrollLeft()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollLeft(this.options.scrollLeft))},setScrollTop:function(scrollTop){this.options.scrollTop!==scrollTop&&(this._scrollLock=!0,this.options.scrollTop=BI.clamp(scrollTop||0,0,this._getMaxScrollTop()),this._debounceRelease(),this._calculateChildrenToRender(),this.element.scrollTop(this.options.scrollTop))},setColumnCount:function(columnCount){this.options.columnCount=columnCount},setRowCount:function(rowCount){this.options.rowCount=rowCount},setOverflowX:function(b){var self=this;this.options.overflowX!==!!b&&(this.options.overflowX=!!b,BI.nextTick(function(){self.element.css({overflowX:b?"auto":"hidden"})}))},setOverflowY:function(b){var self=this;this.options.overflowY!==!!b&&(this.options.overflowY=!!b,BI.nextTick(function(){self.element.css({overflowY:b?"auto":"hidden"})}))},getScrollLeft:function(){return this.options.scrollLeft},getScrollTop:function(){return this.options.scrollTop},getMaxScrollLeft:function(){return this._getMaxScrollLeft()},getMaxScrollTop:function(){return this._getMaxScrollTop()},setEstimatedColumnSize:function(width){this.options.estimatedColumnSize=width},setEstimatedRowSize:function(height){this.options.estimatedRowSize=height},_reRange:function(){this.renderRange={}},_clearChildren:function(){this.container._children={},this.container.attr("items",[])},restore:function(){BI.each(this.renderedCells,function(i,cell){cell.el._destroy()}),this._clearChildren(),this.renderedCells=[],this.renderedKeys=[],this.renderRange={},this._scrollLock=!1},populate:function(items){items&&items!==this.options.items&&this.restore(),this._populate(items)}}),BI.GridView.EVENT_SCROLL="EVENT_SCROLL", +BI.shortcut("bi.grid_view",BI.GridView),BI.Popover=BI.inherit(BI.Widget,{_constant:{SIZE:{SMALL:"small",NORMAL:"normal",BIG:"big"},HEADER_HEIGHT:40},_defaultConfig:function(){return BI.extend(BI.Popover.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-popover bi-card bi-border-radius",size:"normal",logic:{dynamic:!1},header:null,body:null,footer:null,closable:!0})},render:function(){var self=this,o=this.options;this.startX=0,this.startY=0,this.tracker=new BI.MouseMoveTracker(function(deltaX,deltaY){var size=self._calculateSize(),W=BI.Widget._renderEngine.createElement("body").width(),H=BI.Widget._renderEngine.createElement("body").height();self.startX+=deltaX,self.startY+=deltaY,self.element.css({left:BI.clamp(self.startX,0,W-self.element.width())+"px",top:BI.clamp(self.startY,0,H-self.element.height())+"px"}),BI.Resizers._resize()},function(){self.tracker.releaseMouseMoves()},_global);var items=[{el:{type:"bi.htape",cls:"bi-message-title bi-header-background",ref:function(_ref){self.dragger=_ref},items:[{type:"bi.absolute",items:[{el:BI.isPlainObject(o.header)?BI.createWidget(o.header,{extraCls:"bi-font-bold"}):{type:"bi.label",cls:"bi-font-bold",height:this._constant.HEADER_HEIGHT,text:o.header,title:o.header,textAlign:"left"},left:20,top:0,right:0,bottom:0}]},{el:o.closable?{type:"bi.icon_button",cls:"bi-message-close close-font",height:this._constant.HEADER_HEIGHT,handler:function(){self.close()}}:{type:"bi.layout"},width:56}],height:this._constant.HEADER_HEIGHT},height:this._constant.HEADER_HEIGHT},{el:o.logic.dynamic?{type:"bi.vertical",scrolly:!1,cls:"popover-body",ref:function(){self.body=this},hgap:20,tgap:10,items:[{el:BI.createWidget(o.body)}]}:{type:"bi.absolute",items:[{el:BI.createWidget(o.body),left:20,top:10,right:20,bottom:0}]}}];o.footer&&items.push({el:{type:"bi.absolute",items:[{el:BI.createWidget(o.footer),left:20,top:0,right:20,bottom:0}],height:44},height:44});var size=this._calculateSize();return BI.extend({type:o.logic.dynamic?"bi.vertical":"bi.vtape",items:items,width:size.width},o.logic.dynamic?{type:"bi.vertical",scrolly:!1}:{type:"bi.vtape",height:size.height})},mounted:function(){var self=this,o=this.options;if(this.dragger.element.mousedown(function(e){var pos=self.element.offset();self.startX=pos.left,self.startY=pos.top,self.tracker.captureMouseMoves(e)}),o.logic.dynamic){var size=this._calculateSize(),height=this.element.height(),compareHeight=BI.clamp(height,size.height,600)-(o.footer?84:44);this.body.element.height(compareHeight)}},_calculateSize:function(){var o=this.options,size={};if(BI.isNotNull(o.size))switch(o.size){case this._constant.SIZE.SMALL:size.width=450,size.height=200;break;case this._constant.SIZE.BIG:size.width=900,size.height=500;break;default:size.width=550,size.height=500}return{width:o.width||size.width,height:o.height||size.height}},hide:function(){},open:function(){this.show(),this.fireEvent(BI.Popover.EVENT_OPEN,arguments)},close:function(){this.hide(),this.fireEvent(BI.Popover.EVENT_CLOSE,arguments)},setZindex:function(zindex){this.element.css({"z-index":zindex})},destroyed:function(){}}),BI.shortcut("bi.popover",BI.Popover),BI.BarPopover=BI.inherit(BI.Popover,{_defaultConfig:function(){return BI.extend(BI.BarPopover.superclass._defaultConfig.apply(this,arguments),{btns:[BI.i18nText("BI-Basic_Sure"),BI.i18nText("BI-Basic_Cancel")]})},beforeCreate:function(){var self=this,o=this.options;o.footer||(o.footer={type:"bi.right_vertical_adapt",lgap:10,items:[{type:"bi.button",text:this.options.btns[1],value:1,level:"ignore",handler:function(v){self.fireEvent(BI.Popover.EVENT_CANCEL,v),self.close(v)}},{type:"bi.button",text:this.options.btns[0],warningTitle:o.warningTitle,value:0,handler:function(v){self.fireEvent(BI.Popover.EVENT_CONFIRM,v),self.close(v)}}]})}}),BI.shortcut("bi.bar_popover",BI.BarPopover),BI.Popover.EVENT_CLOSE="EVENT_CLOSE",BI.Popover.EVENT_OPEN="EVENT_OPEN",BI.Popover.EVENT_CANCEL="EVENT_CANCEL",BI.Popover.EVENT_CONFIRM="EVENT_CONFIRM",BI.PopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.PopupView.superclass._defaultConfig.apply(this,arguments),{_baseCls:"bi-popup-view",maxWidth:"auto",minWidth:100,minHeight:24,lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,innerVGap:0,direction:BI.Direction.Top,stopEvent:!1,stopPropagation:!1,logic:{dynamic:!0},tool:!1,tabs:[],buttons:[],el:{type:"bi.button_group",items:[],chooseType:0,behaviors:{},layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.PopupView.superclass._init.apply(this,arguments);var self=this,o=this.options,fn=function(e){e.stopPropagation()},stop=function(e){return e.stopEvent(),!1};this.element.css({"z-index":BI.zIndex_popup,"min-width":o.minWidth+"px","max-width":o.maxWidth+"px"}).bind({click:fn}),this.element.bind("mousewheel",fn),o.stopPropagation&&this.element.bind({mousedown:fn,mouseup:fn,mouseover:fn}),o.stopEvent&&this.element.bind({mousedown:stop,mouseup:stop,mouseover:stop}),this.tool=this._createTool(),this.tab=this._createTab(),this.view=this._createView(),this.toolbar=this._createToolBar(),this.view.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.PopupView.EVENT_CHANGE)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{scrolly:!1,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,vgap:o.vgap,hgap:o.hgap,items:BI.LogicFactory.createLogicItemsByDirection(o.direction,BI.extend({cls:"list-view-outer bi-card list-view-shadow"},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.tool,this.tab,this.view,this.toolbar)}))))}))))},_createView:function(){var o=this.options;return this.button_group=BI.createWidget(o.el,{type:"bi.button_group",value:o.value}),this.button_group.element.css({"min-height":o.minHeight+"px","padding-top":o.innerVGap+"px","padding-bottom":o.innerVGap+"px"}),this.button_group},_createTool:function(){var o=this.options;if(!1!==o.tool)return BI.createWidget(o.tool)},_createTab:function(){var o=this.options;if(0!==o.tabs.length)return BI.createWidget({type:"bi.center",cls:"list-view-tab",height:25,items:o.tabs,value:o.value})},_createToolBar:function(){var o=this.options;if(0!==o.buttons.length)return BI.createWidget({type:"bi.center",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(o.buttons,{once:!1,shadow:!0,isShadowShowingOnSelected:!0})})},getView:function(){return this.view},populate:function(items){this.view.populate.apply(this.view,arguments)},resetWidth:function(w){this.options.width=w,this.element.width(w)},resetHeight:function(h){var tbHeight=this.toolbar?this.toolbar.attr("height")||24:0,tabHeight=this.tab?this.tab.attr("height")||24:0,toolHeight=(this.tool&&this.tool.attr("height")||24)*(this.tool&&this.tool.isVisible()?1:0),resetHeight=h-tbHeight-tabHeight-toolHeight-2*this.options.innerVGap;this.view.resetHeight?this.view.resetHeight(resetHeight):this.view.element.css({"max-height":resetHeight+"px"})},setValue:function(selectedValues){this.tab&&this.tab.setValue(selectedValues),this.view.setValue(selectedValues)},getValue:function(){return this.view.getValue()}}),BI.PopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.popup_view",BI.PopupView),BI.SearcherView=BI.inherit(BI.Pane,{_defaultConfig:function(){var conf=BI.SearcherView.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-searcher-view bi-card",tipText:BI.i18nText("BI-No_Select"),chooseType:BI.Selection.Single,matcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]},searcher:{type:"bi.button_group",behaviors:{redmark:function(){return!0}},items:[],layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.SearcherView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.matcher=BI.createWidget(o.matcher,{type:"bi.button_group",chooseType:o.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:o.value}),this.matcher.on(BI.Controller.EVENT_CHANGE,function(type,val,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearcherView.EVENT_CHANGE,val,ob)}),this.spliter=BI.createWidget({type:"bi.vertical",height:1,hgap:10,items:[{type:"bi.layout",height:1,cls:"searcher-view-spliter bi-background"}]}),this.searcher=BI.createWidget(o.searcher,{type:"bi.button_group",chooseType:o.chooseType,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}],value:o.value}),this.searcher.on(BI.Controller.EVENT_CHANGE,function(type,val,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearcherView.EVENT_CHANGE,val,ob)}),BI.createWidget({type:"bi.vertical",element:this,items:[this.matcher,this.spliter,this.searcher]})},startSearch:function(){},stopSearch:function(){},setValue:function(v){this.matcher.setValue(v),this.searcher.setValue(v)},getValue:function(){return this.matcher.getValue().concat(this.searcher.getValue())},populate:function(searchResult,matchResult,keyword){searchResult||(searchResult=[]),matchResult||(matchResult=[]),this.setTipVisible(searchResult.length+matchResult.length===0),this.spliter.setVisible(BI.isNotEmptyArray(matchResult)&&BI.isNotEmptyArray(searchResult)),this.matcher.populate(matchResult,keyword),this.searcher.populate(searchResult,keyword)},empty:function(){this.searcher.empty(),this.matcher.empty()},hasMatched:function(){return this.matcher.getAllButtons().length>0}}),BI.SearcherView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.searcher_view",BI.SearcherView),BI.ListView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-list-view",overscanHeight:100,blockSize:10,scrollTop:0,el:{},items:[]}},init:function(){var self=this;this.renderedIndex=-1,this.cache={}},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[BI.extend({type:"bi.vertical",scrolly:!1,ref:function(){self.container=this}},o.el)],element:this}},mounted:function(){var self=this,o=this.options;this._populate(),this.element.scroll(function(e){o.scrollTop=self.element.scrollTop(),self._calculateBlocksToRender()});var lastWidth=this.element.width(),lastHeight=this.element.height();BI.ResizeDetector.addResizeListener(this,function(){var width=self.element.width(),height=self.element.height();width===lastWidth&&height===lastHeight||(lastWidth=width,lastHeight=height,self._calculateBlocksToRender())})},_renderMoreIf:function(){for(var self=this,o=this.options,height=this.element.height(),minContentHeight=o.scrollTop+height+o.overscanHeight,index=this.cache[this.renderedIndex]&&this.cache[this.renderedIndex].index+o.blockSize||0,cnt=this.renderedIndex+1,lastHeight,getElementHeight=function(){return self.container.element.height()};(lastHeight=getElementHeight())pages&&(groups=pages),dict.index=Math.ceil((curr+(groups>1&&groups!==pages?1:0))/(0===groups?1:groups)),(!o.dynamicShow&&!o.dynamicShowPrevNext||curr>1)&&prev!==!1&&(BI.isKey(prev)?view.push({text:prev,value:"prev",disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)}):view.push(BI.extend({disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)},prev))),(!o.dynamicShow&&!o.dynamicShowFirstLast||dict.index>1&&0!==groups)&&first&&(view.push({text:first,value:"first",disabled:!(dict.index>1&&0!==groups)}),dict.index>1&&0!==groups&&view.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),dict.poor=Math.floor((groups-1)/2),dict.start=dict.index>1?curr-dict.poor:1,dict.end=dict.index>1?function(){var max=curr+(groups-dict.poor-1);return max>pages?pages:max}():groups,dict.end-dict.start1&&0!==groups&&pages>groups&&dict.endgroups&&dict.endgroups&&dict.endgroups&&dict.end1},hasNext:function(v){v||(v=1);var o=this.options,pages=this.options.pages;return pages===!1?o.hasNext(v):vlastPage?lastPage:(firstPage=BI.result(o,"firstPage"),vo.pages?o.pages:v,this.currPage=v;this._populate()},getValue:function(){var val=this.button_group.getValue()[0];switch(val){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return val}},attr:function(key,value){BI.Pager.superclass.attr.apply(this,arguments),"curr"===key&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.Pager.EVENT_CHANGE="EVENT_CHANGE",BI.Pager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.pager",BI.Pager),BI.A=BI.inherit(BI.Text,{_defaultConfig:function(){var conf=BI.A.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-a display-block",href:"",target:"_blank",el:null,tagName:"a"})},_init:function(){var o=this.options;BI.A.superclass._init.apply(this,arguments),this.element.attr({href:o.href,target:o.target}),o.el&&BI.createWidget(o.el,{element:this})}}),BI.shortcut("bi.a",BI.A),BI.LoadingBar=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.LoadingBar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-loading-bar bi-tips",height:30,handler:BI.emptyFn})},_init:function(){BI.LoadingBar.superclass._init.apply(this,arguments);var self=this;this.loaded=BI.createWidget({type:"bi.text_button",cls:"loading-text bi-list-item-simple",text:BI.i18nText("BI-Load_More"),width:120,handler:this.options.handler}),this.loaded.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.loading=BI.createWidget({type:"bi.layout",width:this.options.height,height:this.options.height,cls:"loading-background cursor-default"});var loaded=BI.createWidget({type:"bi.center_adapt",items:[this.loaded]}),loading=BI.createWidget({type:"bi.center_adapt",items:[this.loading]});this.cardLayout=BI.createWidget({type:"bi.card",element:this,items:[{el:loaded,cardName:"loaded"},{el:loading,cardName:"loading"}]}),this.invisible()},_reset:function(){this.visible(),this.loaded.setText(BI.i18nText("BI-Load_More")),this.loaded.enable()},setLoaded:function(){this._reset(),this.cardLayout.showCardByName("loaded")},setEnd:function(){this.setLoaded(),this.loaded.setText(BI.i18nText("BI-No_More_Data")),this.loaded.disable()},setLoading:function(){this._reset(),this.cardLayout.showCardByName("loading")}}),BI.shortcut("bi.loading_bar",BI.LoadingBar),BI.IconButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-icon-button horizon-center",iconWidth:null,iconHeight:null})},_init:function(){BI.IconButton.superclass._init.apply(this,arguments);var o=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:o.iconWidth,height:o.iconHeight}),BI.isNumber(o.height)&&o.height>0&&BI.isNull(o.iconWidth)&&BI.isNull(o.iconHeight)?(this.element.css("lineHeight",o.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))},doClick:function(){BI.IconButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconButton.EVENT_CHANGE,this)}}),BI.IconButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_button",BI.IconButton),BI.ImageButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.ImageButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-image-button",src:"",iconWidth:"100%",iconHeight:"100%"})},_init:function(){BI.ImageButton.superclass._init.apply(this,arguments);var o=this.options;this.image=BI.createWidget({type:"bi.img",width:o.iconWidth,height:o.iconHeight,src:o.src}),BI.isNumber(o.iconWidth)||BI.isNumber(o.iconHeight)?BI.createWidget({type:"bi.center_adapt",element:this,items:[this.image]}):BI.createWidget({type:"bi.adaptive",element:this,items:[this.image],scrollable:!1})},setWidth:function(w){BI.ImageButton.superclass.setWidth.apply(this,arguments),this.options.width=w},setHeight:function(h){BI.ImageButton.superclass.setHeight.apply(this,arguments),this.options.height=h},setImageWidth:function(w){this.image.setWidth(w)},setImageHeight:function(h){this.image.setHeight(h)},getImageWidth:function(){return this.image.element.width()},getImageHeight:function(){return this.image.element.height()},setSrc:function(src){this.options.src=src,this.image.setSrc(src)},getSrc:function(){return this.image.getSrc()},doClick:function(){BI.ImageButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageButton.EVENT_CHANGE,this)}}),BI.ImageButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.image_button",BI.ImageButton),BI.Button=BI.inherit(BI.BasicButton,{_defaultConfig:function(props){var conf=BI.Button.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-button"+(BI.isIE()&&BI.isIE9Below()?" hack":""),minWidth:props.block===!0||props.clear===!0?0:80,height:24,shadow:props.clear!==!0,isShadowShowingOnSelected:!0,readonly:!0,iconCls:"",level:"common",block:!1,clear:!1,ghost:!1,textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:props.clear?0:10,vgap:0,tgap:0,bgap:0,lgap:0,rgap:0})},_init:function(){BI.Button.superclass._init.apply(this,arguments);var o=this.options,self=this;!BI.isNumber(o.height)||o.clear||o.block?o.clear||o.block?this.element.css({lineHeight:o.height+"px"}):this.element.css({lineHeight:o.height-2+"px"}):this.element.css({height:o.height+"px",lineHeight:o.height-2+"px"}),BI.isKey(o.iconCls)?(this.icon=BI.createWidget({type:"bi.icon_label",cls:o.iconCls,width:18,height:o.height-2,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),this.text=BI.createWidget({type:"bi.label",text:o.text,value:o.value,height:o.height-2}),BI.createWidget({type:"bi.center_adapt",element:this,hgap:o.hgap,vgap:o.vgap,items:[{type:"bi.horizontal",items:[this.icon,this.text]}]})):this.text=BI.createWidget({type:"bi.label",textAlign:o.textAlign,whiteSpace:o.whiteSpace,textWidth:o.textWidth,textHeight:o.textHeight,hgap:o.hgap,vgap:o.vgap,tgap:o.tgap,bgap:o.bgap,lgap:o.lgap,rgap:o.rgap,element:this,text:o.text,value:o.value}),o.block===!0&&this.element.addClass("block"),o.clear===!0&&this.element.addClass("clear"),o.ghost===!0&&this.element.addClass("ghost"),o.minWidth>0&&this.element.css({"min-width":o.minWidth+"px"})},doClick:function(){BI.Button.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Button.EVENT_CHANGE,this)},setText:function(text){BI.Button.superclass.setText.apply(this,arguments),this.text.setText(text)},setValue:function(text){BI.Button.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(text)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},destroy:function(){BI.Button.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.button",BI.Button),BI.Button.EVENT_CHANGE="EVENT_CHANGE",BI.TextButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-button",textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,lgap:0,rgap:0,text:"",py:""})},_init:function(){BI.TextButton.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textWidth:o.textWidth,textHeight:o.textHeight,width:o.width,height:o.height,hgap:o.hgap,lgap:o.lgap,rgap:o.rgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword})},doClick:function(){BI.TextButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextButton.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(text){BI.TextButton.superclass.setText.apply(this,arguments),text=BI.isArray(text)?text.join(","):text,this.text.setText(text)},setStyle:function(style){this.text.setStyle(style)},setValue:function(text){BI.TextButton.superclass.setValue.apply(this,arguments),this.isReadOnly()||(text=BI.isArray(text)?text.join(","):text,this.text.setValue(text))}}),BI.TextButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_button",BI.TextButton),BI.BlankIconIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconIconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const,blank=BI.createWidget({type:"bi.layout",width:o.blankWidth,height:o.height});this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:o.iconCls1,forceNotSelected:!0,width:o.height,height:o.height}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:o.iconCls2,forceNotSelected:!0,width:o.height,height:o.height}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",blank,this.icon1,this.icon2,this.text)}))))},doClick:function(){BI.BlankIconIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconIconTextItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(b){BI.BlankIconIconTextItem.superclass.setSelected.apply(this,arguments),this.icon1.setSelected(b),this.icon2.setSelected(b)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_icon_text_item",BI.BlankIconIconTextItem),BI.BlankIconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{ +items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.layout",width:o.blankWidth},icon1,this.text,{type:"bi.layout",width:o.height})}))))},doClick:function(){BI.BlankIconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.BlankIconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_icon_item",BI.BlankIconTextIconItem),BI.BlankIconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.BlankIconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-blank-icon-text-item",logic:{dynamic:!1},cls:"close-ha-font",blankWidth:0,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.BlankIconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const,blank=BI.createWidget({type:"bi.layout",width:o.blankWidth});this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",blank,this.icon,this.text)}))))},doClick:function(){BI.BlankIconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.BlankIconTextItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.BlankIconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.blank_icon_text_item",BI.BlankIconTextItem),BI.IconTextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconTextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-icon-item",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.leftIconWrapperWidth,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),blank=BI.createWidget({type:"bi.layout",width:o.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.rightIconWrapperWidth,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",icon1,this.text,blank)}))))},doClick:function(){BI.IconTextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_item",BI.IconTextIconItem),BI.IconTextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.IconTextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-item",direction:BI.Direction.Left,logic:{dynamic:!1},iconWrapperWidth:null,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.iconWrapperWidth||o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.IconTextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_item",BI.IconTextItem),BI.TextIconItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextIconItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-item",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconItem.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconItem.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.TextIconItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_item",BI.TextIconItem),BI.TextItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.TextItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-item",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextItem.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})},doClick:function(){BI.TextItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_item",BI.TextItem),BI.IconTextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-icon-node",logic:{dynamic:!1},iconCls1:"close-ha-font",iconCls2:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height});var icon1=BI.createWidget({type:"bi.icon_label",cls:o.iconCls1,width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),blank=BI.createWidget({type:"bi.layout",width:o.height,height:o.height});BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.icon_label",cls:o.iconCls2,width:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight},top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",icon1,this.text,blank)}))))},doClick:function(){BI.IconTextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextIconNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.IconTextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_icon_node",BI.IconTextIconNode),BI.IconTextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconTextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-text-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.IconTextNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.IconTextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.IconTextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.IconTextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_node",BI.IconTextNode),BI.TextIconNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextIconNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-icon-node",logic:{dynamic:!1},cls:"close-ha-font",iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextIconNode.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.icon_label",width:o.height,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.text,this.icon)}))))},doClick:function(){BI.TextIconNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextIconNode.EVENT_CHANGE,this.getValue(),this)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.TextIconNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_icon_node",BI.TextIconNode),BI.TextNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.TextNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-node",textAlign:"left",whiteSpace:"nowrap",textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.TextNode.superclass._init.apply(this,arguments);var o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:o.whiteSpace,textHeight:"nowrap"==o.whiteSpace?o.height:o.textHeight,height:o.height,hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py})},doClick:function(){BI.TextNode.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.TextNode.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()}}),BI.TextNode.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_node",BI.TextNode),BI.Editor=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Editor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-editor bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,tipType:"warning",inputType:"text",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){BI.Editor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=this.addWidget(BI.createWidget({type:"bi.input",element:"",root:!0,value:o.value,watermark:o.watermark,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank})),this.editor.element.css({width:"100%",height:"100%",border:"none",outline:"none",padding:"0",margin:"0"}),BI.isKey(this.options.watermark)&&this._assertWaterMark();var _items=[];this.watermark&&_items.push({el:this.watermark,left:3,right:3,top:0,bottom:0}),_items.push({el:this.editor,left:0,right:0,top:0,bottom:0});var items=[{el:{type:"bi.absolute",ref:function(_ref){self.contentWrapper=_ref},items:_items},left:o.hgap+o.lgap,right:o.hgap+o.rgap,top:o.vgap+o.tgap,bottom:o.vgap+o.bgap}];BI.createWidget({type:"bi.absolute",element:this,items:items}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_FOCUS,function(){self._checkError(),self.element.addClass("bi-editor-focus"),self.fireEvent(BI.Editor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Input.EVENT_BLUR,function(){self._setErrorVisible(!1),self.element.removeClass("bi-editor-focus"),self.fireEvent(BI.Editor.EVENT_BLUR,arguments)}),this.editor.on(BI.Input.EVENT_CLICK,function(){self.fireEvent(BI.Editor.EVENT_CLICK,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE,function(){self.fireEvent(BI.Editor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Input.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.Editor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Input.EVENT_QUICK_DOWN,function(e){e.keyCode!==BI.KeyCode.TAB&&self.watermark&&self.watermark.invisible()}),this.editor.on(BI.Input.EVENT_VALID,function(){self._checkWaterMark(),self._setErrorVisible(!1),self.fireEvent(BI.Editor.EVENT_VALID,arguments)}),this.editor.on(BI.Input.EVENT_ERROR,function(){self._checkWaterMark(),self.fireEvent(BI.Editor.EVENT_ERROR,arguments),self._setErrorVisible(self.isEditing())}),this.editor.on(BI.Input.EVENT_RESTRICT,function(){self._checkWaterMark();var tip=self._setErrorVisible(!0);tip&&tip.element.fadeOut(100,function(){tip.element.fadeIn(100)}),self.fireEvent(BI.Editor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Input.EVENT_EMPTY,function(){self._checkWaterMark(),self.fireEvent(BI.Editor.EVENT_EMPTY,arguments)}),this.editor.on(BI.Input.EVENT_ENTER,function(){self.fireEvent(BI.Editor.EVENT_ENTER,arguments)}),this.editor.on(BI.Input.EVENT_SPACE,function(){self.fireEvent(BI.Editor.EVENT_SPACE,arguments)}),this.editor.on(BI.Input.EVENT_BACKSPACE,function(){self.fireEvent(BI.Editor.EVENT_BACKSPACE,arguments)}),this.editor.on(BI.Input.EVENT_REMOVE,function(){self.fireEvent(BI.Editor.EVENT_REMOVE,arguments)}),this.editor.on(BI.Input.EVENT_START,function(){self.fireEvent(BI.Editor.EVENT_START,arguments)}),this.editor.on(BI.Input.EVENT_PAUSE,function(){self.fireEvent(BI.Editor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Input.EVENT_STOP,function(){self.fireEvent(BI.Editor.EVENT_STOP,arguments)}),this.editor.on(BI.Input.EVENT_CONFIRM,function(){self.fireEvent(BI.Editor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Input.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.Editor.EVENT_CHANGE_CONFIRM,arguments)}),this.element.click(function(e){return e.stopPropagation(),!1}),BI.isKey(this.options.value)||BI.isEmptyString(this.options.value)?(this._checkError(),this._checkWaterMark()):this._checkWaterMark()},_checkToolTip:function(){var o=this.options,errorText=o.errorText;BI.isFunction(errorText)&&(errorText=errorText(this.editor.getValue())),BI.isKey(errorText)&&(!this.isEnabled()||this.isValid()||BI.Bubbles.has(this.getName())&&BI.Bubbles.get(this.getName()).isVisible()?this.setTitle(""):this.setTitle(errorText))},_assertWaterMark:function(){var self=this,o=this.options;BI.isNull(this.watermark)&&(this.watermark=BI.createWidget({type:"bi.label",cls:"bi-water-mark",text:this.options.watermark,height:o.height-2*(o.vgap+o.tgap),whiteSpace:"nowrap",textAlign:"left"}),this.watermark.element.bind({mousedown:function(e){self.isEnabled()?self.editor.isEditing()||self.editor.focus():self.editor.isEditing()&&self.editor.blur(),e.stopEvent()}}),this.watermark.element.bind("click",function(e){self.isEnabled()?self.editor.isEditing()||self.editor.focus():self.editor.isEditing()&&self.editor.blur(),e.stopEvent()}))},_checkError:function(){this._setErrorVisible(this.isEnabled()&&!this.isValid()),this._checkToolTip()},_checkWaterMark:function(){var o=this.options;!this.disabledWaterMark&&""===this.editor.getValue()&&BI.isKey(o.watermark)?this.watermark&&this.watermark.visible():this.watermark&&this.watermark.invisible()},setErrorText:function(text){this.options.errorText=text},getErrorText:function(){return this.options.errorText},setWaterMark:function(v){this.options.watermark=v,BI.isNull(this.watermark)&&(this._assertWaterMark(),BI.createWidget({type:"bi.absolute",element:this.contentWrapper,items:[{el:this.watermark,left:3,right:3,top:0,bottom:0}]})),BI.isKey(v)&&this.watermark.setText(v)},_setErrorVisible:function(b){var o=this.options,errorText=o.errorText;if(BI.isFunction(errorText)&&(errorText=errorText(BI.trim(this.editor.getValue()))),!this.disabledError&&BI.isKey(errorText))return BI.Bubbles[b?"show":"hide"](this.getName(),errorText,this,{adjustYOffset:2}),this._checkToolTip(),BI.Bubbles.get(this.getName())},disableError:function(){this.disabledError=!0,this._checkError()},enableError:function(){this.disabledError=!1,this._checkError()},disableWaterMark:function(){this.disabledWaterMark=!0,this._checkWaterMark()},enableWaterMark:function(){this.disabledWaterMark=!1,this._checkWaterMark()},focus:function(){this.element.addClass("text-editor-focus"),this.editor.focus()},blur:function(){this.element.removeClass("text-editor-focus"),this.editor.blur()},selectAll:function(){this.editor.selectAll()},onKeyDown:function(k){this.editor.onKeyDown(k)},setValue:function(v){BI.Editor.superclass.setValue.apply(this,arguments),this.editor.setValue(v),this._checkError(),this._checkWaterMark()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.isValid()?BI.trim(this.editor.getValue()):BI.trim(this.editor.getLastValidValue())},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()},destroyed:function(){BI.Bubbles.remove(this.getName())}}),BI.Editor.EVENT_CHANGE="EVENT_CHANGE",BI.Editor.EVENT_FOCUS="EVENT_FOCUS",BI.Editor.EVENT_BLUR="EVENT_BLUR",BI.Editor.EVENT_CLICK="EVENT_CLICK",BI.Editor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Editor.EVENT_SPACE="EVENT_SPACE",BI.Editor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Editor.EVENT_START="EVENT_START",BI.Editor.EVENT_PAUSE="EVENT_PAUSE",BI.Editor.EVENT_STOP="EVENT_STOP",BI.Editor.EVENT_CONFIRM="EVENT_CONFIRM",BI.Editor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Editor.EVENT_VALID="EVENT_VALID",BI.Editor.EVENT_ERROR="EVENT_ERROR",BI.Editor.EVENT_ENTER="EVENT_ENTER",BI.Editor.EVENT_RESTRICT="EVENT_RESTRICT",BI.Editor.EVENT_REMOVE="EVENT_REMOVE",BI.Editor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.editor",BI.Editor),BI.MultifileEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.MultifileEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-multifile-editor",multiple:!1,maxSize:-1,accept:"",url:""})},_init:function(){var self=this,o=this.options;BI.MultifileEditor.superclass._init.apply(this,arguments),this.file=BI.createWidget({type:"bi.file",cls:"multifile-editor",width:"100%",height:"100%",name:o.name,url:o.url,multiple:o.multiple,accept:o.accept,maxSize:o.maxSize,title:o.title}),this.file.on(BI.File.EVENT_CHANGE,function(){self.fireEvent(BI.MultifileEditor.EVENT_CHANGE,arguments)}),this.file.on(BI.File.EVENT_UPLOADSTART,function(){self.fireEvent(BI.MultifileEditor.EVENT_UPLOADSTART,arguments)}),this.file.on(BI.File.EVENT_ERROR,function(){self.fireEvent(BI.MultifileEditor.EVENT_ERROR,arguments)}),this.file.on(BI.File.EVENT_PROGRESS,function(){self.fireEvent(BI.MultifileEditor.EVENT_PROGRESS,arguments)}),this.file.on(BI.File.EVENT_UPLOADED,function(){self.fireEvent(BI.MultifileEditor.EVENT_UPLOADED,arguments)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",scrollable:!1,items:[this.file]},top:0,right:0,left:0,bottom:0}]})},select:function(){this.file.select()},getValue:function(){return this.file.getValue()},upload:function(){this.file.upload()},reset:function(){this.file.reset()}}),BI.MultifileEditor.EVENT_CHANGE="EVENT_CHANGE",BI.MultifileEditor.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.MultifileEditor.EVENT_ERROR="EVENT_ERROR",BI.MultifileEditor.EVENT_PROGRESS="EVENT_PROGRESS",BI.MultifileEditor.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.multifile_editor",BI.MultifileEditor),BI.TextAreaEditor=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.TextAreaEditor.superclass._defaultConfig.apply(),{baseCls:"bi-textarea-editor",value:""})},render:function(){var o=this.options,self=this;this.content=BI.createWidget({type:"bi.layout",tagName:"textarea",width:"100%",height:"100%",cls:"bi-textarea textarea-editor-content display-block"}),this.content.element.css({resize:"none"}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.adaptive",items:[this.content]},left:4,right:4,top:4,bottom:8}]}),this.content.element.on("input propertychange",function(e){self._checkWaterMark(),self.fireEvent(BI.TextAreaEditor.EVENT_CHANGE)}),this.content.element.focus(function(){self.isValid()&&(self._focus(),self.fireEvent(BI.TextAreaEditor.EVENT_FOCUS)),BI.Widget._renderEngine.createElement(document).bind("mousedown."+self.getName(),function(e){BI.DOM.isExist(self)&&!self.element.__isMouseInBounds__(e)&&(BI.Widget._renderEngine.createElement(document).unbind("mousedown."+self.getName()),self.content.element.blur())})}),this.content.element.blur(function(){self.isValid()&&(self._blur(),self.fireEvent(BI.TextAreaEditor.EVENT_BLUR)),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+self.getName())}),BI.isKey(o.value)&&this.setValue(o.value),BI.isNotNull(o.style)&&this.setStyle(o.style),this._checkWaterMark()},_checkWaterMark:function(){var self=this,o=this.options,val=this.getValue();BI.isNotEmptyString(val)?(this.watermark&&this.watermark.destroy(),this.watermark=null):BI.isNotEmptyString(o.watermark)&&(this.watermark?(this.watermark.setText(o.watermark),this.watermark.setValid(!o.invalid),this.watermark.setEnable(!o.disabled)):(this.watermark=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark cursor-default",textAlign:"left",whiteSpace:"normal",text:o.watermark,invalid:o.invalid,disabled:o.disabled}),this.watermark.on(BI.TextButton.EVENT_CHANGE,function(){self.focus()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.watermark,left:4,top:4,right:0}]})))},_focus:function(){this.content.element.addClass("textarea-editor-focus"),this._checkWaterMark()},_blur:function(){this.content.element.removeClass("textarea-editor-focus"),this._checkWaterMark()},focus:function(){this._focus(),this.content.element.focus()},blur:function(){this._blur(),this.content.element.blur()},getValue:function(){return this.content.element.val()},setValue:function(value){this.content.element.val(value),this._checkWaterMark()},setStyle:function(style){this.style=style,this.element.css(style),this.content.element.css(BI.extend({},style,{color:style.color||BI.DOM.getContrastColor(BI.DOM.isRGBColor(style.backgroundColor)?BI.DOM.rgb2hex(style.backgroundColor):style.backgroundColor)}))},getStyle:function(){return this.style},_setValid:function(b){BI.TextAreaEditor.superclass._setValid.apply(this,arguments)},_setEnable:function(b){BI.TextAreaEditor.superclass._setEnable.apply(this,[b]),this.content&&(this.content.element[0].disabled=!b)}}),BI.TextAreaEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextAreaEditor.EVENT_BLUR="EVENT_BLUR",BI.TextAreaEditor.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.textarea_editor",BI.TextAreaEditor),BI.Html=BI.inherit(BI.Single,{props:{baseCls:"bi-html",textAlign:"left",whiteSpace:"normal",lineHeight:null,handler:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1},render:function(){var self=this,o=this.options;o.hgap+o.lgap>0&&this.element.css({"padding-left":o.hgap+o.lgap+"px"}),o.hgap+o.rgap>0&&this.element.css({"padding-right":o.hgap+o.rgap+"px"}),o.vgap+o.tgap>0&&this.element.css({"padding-top":o.vgap+o.tgap+"px"}),o.vgap+o.bgap>0&&this.element.css({"padding-bottom":o.vgap+o.bgap+"px"}),BI.isNumber(o.height)&&this.element.css({lineHeight:o.height+"px"}),BI.isNumber(o.lineHeight)&&this.element.css({lineHeight:o.lineHeight+"px"}),BI.isWidthOrHeight(o.maxWidth)&&this.element.css({maxWidth:o.maxWidth}),this.element.css({textAlign:o.textAlign,whiteSpace:o.whiteSpace,textOverflow:"nowrap"===o.whiteSpace?"ellipsis":"",overflow:"nowrap"===o.whiteSpace?"":"auto"}),o.handler?(this.text=BI.createWidget({type:"bi.layout",tagName:"span"}),this.text.element.click(function(){o.handler(self.getValue())}),BI.createWidget({type:"bi.default",element:this,items:[this.text]})):this.text=this,BI.isKey(o.text)?this.setText(o.text):BI.isKey(o.value)&&this.setText(o.value),o.highLight&&this.doHighLight()},doHighLight:function(){this.text.element.addClass("bi-high-light")},unHighLight:function(){this.text.element.removeClass("bi-high-light")},setValue:function(text){BI.Html.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.setText(text)},setStyle:function(css){this.text.element.css(css)},setText:function(text){BI.Html.superclass.setText.apply(this,arguments),this.options.text=text,this.text.element.html(text)}}),BI.shortcut("bi.html",BI.Html),BI.Icon=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Icon.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"i",baseCls:(conf.baseCls||"")+" x-icon b-font horizon-center display-block"})},_init:function(){BI.Icon.superclass._init.apply(this,arguments),BI.isIE9Below&&BI.isIE9Below()&&this.element.addClass("hack")}}),BI.shortcut("bi.icon",BI.Icon),BI.Iframe=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Iframe.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"iframe",baseCls:(conf.baseCls||"")+" bi-iframe",src:"",name:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var o=this.options;o.attributes.frameborder="0",o.attributes.src=o.src,o.attributes.name=o.name,BI.Iframe.superclass._init.apply(this,arguments)},setSrc:function(src){this.options.src=src,this.element.attr("src",src)},getSrc:function(){return this.options.src},setName:function(name){this.options.name=name,this.element.attr("name",name)},getName:function(){return this.options.name}}),BI.shortcut("bi.iframe",BI.Iframe),BI.Img=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Img.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{tagName:"img",baseCls:(conf.baseCls||"")+" bi-img display-block",src:"",attributes:{},width:"100%",height:"100%"})},_init:function(){var o=this.options;o.attributes.src=o.src,BI.Img.superclass._init.apply(this,arguments); +},setSrc:function(src){this.options.src=src,this.element.attr("src",src)},getSrc:function(){return this.options.src}}),BI.shortcut("bi.img",BI.Img),BI.ImageCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.ImageCheckbox.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-image-checkbox check-box-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})}}),BI.ImageCheckbox.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_checkbox",BI.ImageCheckbox),BI.Checkbox=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-checkbox",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16},render:function(){var self=this,o=this.options;return{type:"bi.center_adapt",items:[{type:"bi.default",ref:function(_ref){self.checkbox=_ref},cls:"checkbox-content",width:o.iconWidth-2,height:o.iconHeight-2}]}},_setEnable:function(enable){BI.Checkbox.superclass._setEnable.apply(this,arguments),enable===!0?this.checkbox.element.removeClass("base-disabled disabled"):this.checkbox.element.addClass("base-disabled disabled")},doClick:function(){BI.Checkbox.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Checkbox.EVENT_CHANGE)},setSelected:function(b){BI.Checkbox.superclass.setSelected.apply(this,arguments),b?this.checkbox.element.addClass("bi-high-light-background"):this.checkbox.element.removeClass("bi-high-light-background")}}),BI.Checkbox.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.checkbox",BI.Checkbox),function(document){var F=function(item){return function(input){var files=input.files||[input];return files.item||(files.item=item),files}}(function(i){return this[i]}),event={add:document.addEventListener?function(node,name,callback){return node.addEventListener(name,callback,!1),this}:function(node,name,callback){return node.attachEvent("on"+name,callback),this},del:document.removeEventListener?function(node,name,callback){return node.removeEventListener(name,callback,!1),this}:function(node,name,callback){return node.detachEvent("on"+name,callback),this},stop:function(e){return e?(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,e.preventDefault?e.preventDefault():e.returnValue=!1):self.event&&(event.returnValue=!(event.cancelBubble=!0)),!1}},sendFile=function(toString){var multipart=function(boundary,name,file){return"--".concat(boundary,CRLF,'Content-Disposition: form-data; name="',name,'"; filename="',_global.encodeURIComponent(file.fileName),'"',CRLF,"Content-Type: application/octet-stream",CRLF,CRLF,file.getAsBinary(),CRLF,"--",boundary,"--",CRLF)},isFunction=function(Function){return"[object Function]"===toString.call(Function)},split="onabort.onerror.onloadstart.onprogress".split("."),length=split.length,CRLF="\r\n",xhr=this.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),sendFile;return sendFile=xhr.upload||xhr.sendAsBinary?function(handler,maxSize,width,height){if(-1'),iframe=handler.iframe||(handler.iframe=document.createElement(''))}catch(e){var form=document.createElement("form"),iframe=handler.iframe||(handler.iframe=document.createElement("iframe"));form.setAttribute("enctype","multipart/form-data"),iframe.setAttribute("name",iframe.id=target),iframe.setAttribute("src",url)}with(iframe.style.position="absolute",iframe.style.left=iframe.style.top="-10000px",iframe.onload=onload,iframe.onerror=function(event){isFunction(handler.onerror)&&handler.onerror(rpe,event||_global.event)},iframe.onreadystatechange=function(){/loaded|complete/i.test(iframe.readyState)?onload():isFunction(handler.onloadprogress)&&(rpe.loadedxhr.status||xhr.status>399)return BI.Msg.toast(BI.i18nText("BI-Upload_File_Error"),{level:"error"}),void self.fireEvent(BI.File.EVENT_ERROR);var error=BI.some(_wrap.attach_array,function(index,attach){if(attach.errorCode)return BI.Msg.toast(attach.errorMsg,{level:"error"}),self.fireEvent(BI.File.EVENT_ERROR,attach),!0});!error&&self.fireEvent(BI.File.EVENT_UPLOADED)},1e3)},_wrap.url=o.url,_wrap.fileType=o.accept,_wrap.attach_array=[],_wrap.attach_names=[],_wrap.attachNum=0},_events:function(wrap){var self=this;return event.add(wrap.dom.input,"change",function(){event.del(wrap.dom.input,"change",arguments.callee);for(var input=wrap.dom.input.cloneNode(!0),i=0,files=F(wrap.dom.input);i0&&self.fireEvent(BI.File.EVENT_CHANGE,{files:wrap.files}),input.value="",wrap.dom.input.parentNode.replaceChild(input,wrap.dom.input),wrap.dom.input=input,event.add(wrap.dom.input,"change",arguments.callee)}),wrap},_wrap:function(){var self=this,o=this.options,input=this.element[0];return o.multiple===!0&&this.element.attr("multiple","multiple"),input.value="",this._events({dom:{input:input,disabled:!1},name:input.name,maxSize:o.maxSize?o.maxSize>>0:-1,files:[],clean:function(){this.files=[]},upload:function(handler){if(handler)for(var key in handler)this[key]=handler[key];return sendFiles(this,this.maxSize),this},hide:function(){this.dom.disabled&&(this.dom.disabled=!1,this.dom.input.removeAttribute("disabled"))},show:function(total,current,totalProp,currentProp){this.dom.disabled||(this.dom.disabled=!0,this.dom.input.setAttribute("disabled","disabled"))}})},select:function(){this.wrap&&BI.Widget._renderEngine.createElement(this.wrap.dom.input).click()},upload:function(handler){this.wrap&&this.wrap.upload(handler)},getValue:function(){return this.wrap?this.wrap.attach_array:[]},reset:function(){this.wrap&&(this.wrap.attach_array=[],this.wrap.attach_names=[],this.wrap.attachNum=0)},_setEnable:function(enable){BI.File.superclass._setEnable.apply(this,arguments),enable===!0?this.element.attr("disabled","disabled"):this.element.removeAttr("disabled")}}),BI.File.EVENT_CHANGE="EVENT_CHANGE",BI.File.EVENT_UPLOADSTART="EVENT_UPLOADSTART",BI.File.EVENT_ERROR="EVENT_ERROR",BI.File.EVENT_PROGRESS="EVENT_PROGRESS",BI.File.EVENT_UPLOADED="EVENT_UPLOADED",BI.shortcut("bi.file",BI.File)}(_global.document||{}),BI.Input=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Input.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-input display-block overflow-dot",tagName:"input",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1})},_init:function(){BI.Input.superclass._init.apply(this,arguments);var self=this,ctrlKey=!1,keyCode=null,inputEventValid=!1,_keydown=BI.debounce(function(keyCode){self.onKeyDown(keyCode,ctrlKey),self._keydown_=!1},300),_clk=BI.debounce(BI.bind(this._click,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});this._focusDebounce=BI.debounce(BI.bind(this._focus,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this._blurDebounce=BI.debounce(BI.bind(this._blur,this),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1}),this.element.keydown(function(e){inputEventValid=!1,ctrlKey=e.ctrlKey||e.metaKey,keyCode=e.keyCode,self.fireEvent(BI.Input.EVENT_QUICK_DOWN,arguments)}).keyup(function(e){keyCode=null,inputEventValid&&e.keyCode===BI.KeyCode.ENTER||(self._keydown_=!0,_keydown(e.keyCode))}).on("input propertychange",function(e){var originalEvent=e.originalEvent;(BI.isNull(originalEvent.propertyName)||"value"===originalEvent.propertyName)&&(inputEventValid=!0,self._keydown_=!0,_keydown(keyCode),keyCode=null)}).click(function(e){e.stopPropagation(),_clk()}).mousedown(function(e){self.element.val(self.element.val())}).focus(function(e){self._focusDebounce()}).focusout(function(e){self._blurDebounce()}),(BI.isKey(this.options.value)||BI.isEmptyString(this.options.value))&&this.setValue(this.options.value)},_focus:function(){this.element.addClass("bi-input-focus"),this._checkValidationOnValueChange(),this._isEditing=!0,""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this.fireEvent(BI.Input.EVENT_FOCUS)},_blur:function(){function blur(){if(self.isValid()||self.options.quitChecker.apply(self,[BI.trim(self.getValue())])===!1||(self.element.val(self._lastValidValue?self._lastValidValue:""),self._checkValidationOnValueChange(),self._defaultState()),self.element.removeClass("bi-input-focus"),self._isEditing=!1,self._start=!1,self.isValid()){var lastValidValue=self._lastValidValue;self._lastValidValue=self.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CONFIRM,self.getValue(),self),self.fireEvent(BI.Input.EVENT_CONFIRM),self._lastValidValue!==lastValidValue&&self.fireEvent(BI.Input.EVENT_CHANGE_CONFIRM)}self.fireEvent(BI.Input.EVENT_BLUR)}var self=this;self._keydown_===!0?BI.delay(blur,300):blur()},_click:function(){this._isEditing!==!0&&(this.selectAll(),this.fireEvent(BI.Input.EVENT_CLICK))},onClick:function(){this._click()},onKeyDown:function(keyCode,ctrlKey){this.isValid()&&BI.trim(this._lastChangedValue)===BI.trim(this.getValue())||this._checkValidationOnValueChange(),this.isValid()&&""!==BI.trim(this.getValue())&&((BI.trim(this.getValue())===this._lastValue||this._start&&null!=this._lastValue&&""!==this._lastValue)&&(this._pause!==!0||/(\s|\u00A0)$/.test(this.getValue()))||(this._start=!0,this._pause=!1,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STARTEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_START))),keyCode==BI.KeyCode.ENTER&&(this.isValid()||this.options.quitChecker.apply(this,[BI.trim(this.getValue())])!==!1?(this.blur(),this.fireEvent(BI.Input.EVENT_ENTER)):this.fireEvent(BI.Input.EVENT_RESTRICT)),keyCode==BI.KeyCode.SPACE&&this.fireEvent(BI.Input.EVENT_SPACE),keyCode==BI.KeyCode.BACKSPACE&&""==this._lastValue&&this.fireEvent(BI.Input.EVENT_REMOVE),keyCode!=BI.KeyCode.BACKSPACE&&keyCode!=BI.KeyCode.DELETE||this.fireEvent(BI.Input.EVENT_BACKSPACE),this.fireEvent(BI.Input.EVENT_KEY_DOWN,arguments);var lastValue=this._lastValue;BI.trim(this.getValue())!==BI.trim(this._lastValue||"")&&this._valueChange(),BI.isEndWithBlank(this.getValue())?(this._pause=!0,this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.PAUSE,"",this),this.fireEvent(BI.Input.EVENT_PAUSE),this._defaultState()):keyCode!==BI.KeyCode.BACKSPACE&&keyCode!==BI.KeyCode.DELETE||""!==BI.trim(this.getValue())||null===lastValue||""===BI.trim(lastValue)||(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT,this.getValue(),this),this.fireEvent(BI.Input.EVENT_STOP))},_defaultState:function(){""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue(),this._lastSubmitValue=null},_valueChange:function(){this.isValid()&&BI.trim(this.getValue())!==this._lastSubmitValue&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CHANGE,this.getValue(),this),this.fireEvent(BI.Input.EVENT_CHANGE),this._lastSubmitValue=BI.trim(this.getValue())),""==this.getValue()&&(this.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EMPTY,this.getValue(),this),this.fireEvent(BI.Input.EVENT_EMPTY)),this._lastValue=this.getValue()},_checkValidationOnValueChange:function(){var o=this.options,v=this.getValue();this.setValid(o.allowBlank===!0&&""==BI.trim(v)||BI.isNotEmptyString(BI.trim(v))&&o.validationChecker.apply(this,[BI.trim(v)])!==!1)},focus:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能focus");!this._isEditing==!0&&(this.element.focus(),this.selectAll())},blur:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能blur");this._isEditing===!0&&(this.element.blur(),this._blurDebounce())},selectAll:function(){if(!this.element.is(":visible"))throw new Error("input输入框在不可见下不能select");this.element.select(),this._isEditing=!0},setValue:function(textValue){this.element.val(textValue),BI.nextTick(BI.bind(function(){this._checkValidationOnValueChange(),this._defaultState(),this.isValid()&&(this._lastValidValue=this._lastSubmitValue=this.getValue())},this))},getValue:function(){return this.element.val()||""},isEditing:function(){return this._isEditing},getLastValidValue:function(){return this._lastValidValue},getLastChangedValue:function(){return this._lastChangedValue},_setValid:function(){BI.Input.superclass._setValid.apply(this,arguments),this.isValid()?(this._lastChangedValue=this.getValue(),this.element.removeClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_VALID,BI.trim(this.getValue()),this)):(this._lastChangedValue===this.getValue()&&(this._lastChangedValue=null),this.element.addClass("bi-input-error"),this.fireEvent(BI.Input.EVENT_ERROR,BI.trim(this.getValue()),this))},_setEnable:function(b){BI.Input.superclass._setEnable.apply(this,[b]),this.element[0].disabled=!b}}),BI.Input.EVENT_CHANGE="EVENT_CHANGE",BI.Input.EVENT_FOCUS="EVENT_FOCUS",BI.Input.EVENT_CLICK="EVENT_CLICK",BI.Input.EVENT_BLUR="EVENT_BLUR",BI.Input.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.Input.EVENT_QUICK_DOWN="EVENT_QUICK_DOWN",BI.Input.EVENT_SPACE="EVENT_SPACE",BI.Input.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.Input.EVENT_START="EVENT_START",BI.Input.EVENT_PAUSE="EVENT_PAUSE",BI.Input.EVENT_STOP="EVENT_STOP",BI.Input.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.Input.EVENT_CONFIRM="EVENT_CONFIRM",BI.Input.EVENT_REMOVE="EVENT_REMOVE",BI.Input.EVENT_EMPTY="EVENT_EMPTY",BI.Input.EVENT_VALID="EVENT_VALID",BI.Input.EVENT_ERROR="EVENT_ERROR",BI.Input.EVENT_ENTER="EVENT_ENTER",BI.Input.EVENT_RESTRICT="EVENT_RESTRICT",BI.shortcut("bi.input",BI.Input),BI.ImageRadio=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.ImageRadio.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-radio radio-icon",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:16,iconHeight:16})},_init:function(){BI.ImageRadio.superclass._init.apply(this,arguments)},doClick:function(){BI.ImageRadio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.ImageRadio.EVENT_CHANGE)}}),BI.ImageRadio.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.image_radio",BI.ImageRadio),BI.Radio=BI.inherit(BI.BasicButton,{props:{baseCls:"bi-radio",selected:!1,handler:BI.emptyFn,width:16,height:16,iconWidth:14,iconHeight:14},render:function(){var self=this,o=this.options;return{type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"radio-content",ref:function(_ref){self.radio=_ref},width:o.iconWidth,height:o.iconHeight}]}},_setEnable:function(enable){BI.Radio.superclass._setEnable.apply(this,arguments),enable===!0?this.radio.element.removeClass("base-disabled disabled"):this.radio.element.addClass("base-disabled disabled")},doClick:function(){BI.Radio.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.Radio.EVENT_CHANGE)},setSelected:function(b){BI.Radio.superclass.setSelected.apply(this,arguments),b?this.radio.element.addClass("bi-high-light-background"):this.radio.element.removeClass("bi-high-light-background")}}),BI.Radio.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.radio",BI.Radio),BI.AbstractLabel=BI.inherit(BI.Single,{_defaultConfig:function(props){var conf=BI.AbstractLabel.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{textAlign:"center",whiteSpace:"nowrap",textWidth:null,textHeight:null,hgap:0,vgap:0,lgap:0,rgap:0,tgap:0,bgap:0,text:"",highLight:!1})},_createJson:function(){var o=this.options;return{type:"bi.text",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value,py:o.py,keyword:o.keyword,highLight:o.highLight}},_init:function(){BI.AbstractLabel.superclass._init.apply(this,arguments),"center"===this.options.textAlign?this._createCenterEl():this._createNotCenterEl()},_createCenterEl:function(){var o=this.options,json=this._createJson();return json.textAlign="left",BI.isNumber(o.width)&&o.width>0?BI.isNumber(o.textWidth)&&o.textWidth>0?(json.maxWidth=o.textWidth,BI.isNumber(o.height)&&o.height>0?void BI.createWidget({type:"bi.center_adapt",height:o.height,scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]}):void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]})):"normal"==o.whiteSpace?(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[this.text]})):BI.isNumber(o.height)&&o.height>0?(this.element.css({"line-height":o.height+"px"}),json.textAlign=o.textAlign,void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,maxWidth:"100%"}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[this.text]})):BI.isNumber(o.textWidth)&&o.textWidth>0?(json.maxWidth=o.textWidth,void BI.createWidget({type:"bi.center_adapt",scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]})):"normal"==o.whiteSpace?(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(json),void BI.createWidget({type:"bi.center_adapt",scrollable:!0,element:this,items:[this.text]})):BI.isNumber(o.height)&&o.height>0?(this.element.css({"line-height":o.height+"px"}),json.textAlign=o.textAlign,void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(BI.extend(json,{maxWidth:"100%"})),void BI.createWidget({type:"bi.center_adapt",element:this,items:[this.text]}))},_createNotCenterEl:function(){var o=this.options,adaptLayout="right"===o.textAlign?"bi.right_vertical_adapt":"bi.vertical_adapt",json=this._createJson();return BI.isNumber(o.width)&&o.width>0?BI.isNumber(o.textWidth)&&o.textWidth>0?(json.width=o.textWidth,BI.isNumber(o.height)&&o.height>0?void BI.createWidget({type:adaptLayout,height:o.height,scrollable:"normal"===o.whiteSpace,element:this,items:[{el:this.text=BI.createWidget(json)}]}):void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.height)&&o.height>0?(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})),void("normal"!==o.whiteSpace&&this.element.css({"line-height":o.height-2*o.vgap+"px"}))):(json.width=o.width-2*o.hgap-o.lgap-o.rgap,void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.textWidth)&&o.textWidth>0?(json.width=o.textWidth,void BI.createWidget({type:adaptLayout,scrollable:"normal"===o.whiteSpace,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,element:this,items:[{el:this.text=BI.createWidget(json)}]})):BI.isNumber(o.height)&&o.height>0?("normal"!==o.whiteSpace&&this.element.css({"line-height":o.height-2*o.vgap+"px"}),void(this.text=BI.createWidget(BI.extend(json,{element:this,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap})))):(BI.extend(json,{hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap}),this.text=BI.createWidget(BI.extend(json,{maxWidth:"100%"})),void BI.createWidget({type:adaptLayout,element:this,items:[this.text]}))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setText:function(v){this.options.text=v,this.text.setText(v)},getText:function(){return this.options.text},setStyle:function(css){this.text.setStyle(css)},setValue:function(v){BI.AbstractLabel.superclass.setValue.apply(this,arguments),this.isReadOnly()||this.text.setValue(v)},populate:function(){BI.AbstractLabel.superclass.populate.apply(this,arguments)}}),BI.HtmlLabel=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-html-label"},_createJson:function(){var o=this.options;return{type:"bi.html",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value}}}),BI.shortcut("bi.html_label",BI.HtmlLabel),BI.IconLabel=BI.inherit(BI.Single,{props:{baseCls:"bi-icon-label horizon-center",iconWidth:null,iconHeight:null},_init:function(){BI.IconLabel.superclass._init.apply(this,arguments);var o=this.options;this.element.css({textAlign:"center"}),this.icon=BI.createWidget({type:"bi.icon",width:o.iconWidth,height:o.iconHeight}),BI.isNumber(o.height)&&o.height>0&&BI.isNull(o.iconWidth)&&BI.isNull(o.iconHeight)?(this.element.css("lineHeight",o.height+"px"),BI.createWidget({type:"bi.default",element:this,items:[this.icon]})):(this.element.css("lineHeight","1"),BI.createWidget({element:this,type:"bi.center_adapt",items:[this.icon]}))}}),BI.shortcut("bi.icon_label",BI.IconLabel),BI.Label=BI.inherit(BI.AbstractLabel,{props:{baseCls:"bi-label",py:"",keyword:""},_createJson:function(){var o=this.options;return{type:"bi.text",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,value:o.value,py:o.py,keyword:o.keyword,highLight:o.highLight}},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)}}),BI.shortcut("bi.label",BI.Label),BI.Link=BI.inherit(BI.Label,{_defaultConfig:function(){var conf=BI.Link.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-link display-block",tagName:"a",href:"",target:"_blank"})},_createJson:function(){var o=this.options;return{type:"bi.a",textAlign:o.textAlign,whiteSpace:o.whiteSpace,lineHeight:o.textHeight,text:o.text,keyword:o.keyword,value:o.value,py:o.py,href:o.href,target:o.target}},_init:function(){BI.Link.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.link",BI.Link),BI.Bubble=BI.inherit(BI.Tip,{_defaultConfig:function(){return BI.extend(BI.Bubble.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble",direction:"top",text:"",level:"error",height:18})},_init:function(){BI.Bubble.superclass._init.apply(this,arguments);var fn=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn}),BI.createWidget({type:"bi.left",element:this,items:[this["_"+this.options.direction]()]})},_createBubbleText:function(){var o=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"bubble-text bubble-"+o.level,text:o.text,hgap:5,height:18})},_top:function(){return BI.createWidget({type:"bi.vertical",items:[{el:this._createBubbleText(),height:18},{el:{type:"bi.layout"},height:3}]})},_bottom:function(){return BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout"},height:3},{el:this._createBubbleText(),height:18}]})},_left:function(){return BI.createWidget({type:"bi.right",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},_right:function(){return BI.createWidget({type:"bi.left",items:[{el:{type:"bi.layout",width:3,height:18}},{el:this._createBubbleText()}]})},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.bubble",BI.Bubble),BI.Toast=BI.inherit(BI.Tip,{_const:{minWidth:200,hgap:10},_defaultConfig:function(){return BI.extend(BI.Toast.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-toast",text:"",level:"success"})},_init:function(){BI.Toast.superclass._init.apply(this,arguments);var self=this,o=this.options;this.element.css({minWidth:this._const.minWidth+"px"}),this.element.addClass("toast-"+o.level);var fn=function(e){return e.stopPropagation(),e.stopEvent(),!1};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn});var cls="close-font";switch(o.level){case"success":cls="toast-success-font";break;case"error":cls="toast-error-font";break;case"warning":cls="toast-warning-font";break;case"normal":default:cls="toast-message-font"}var items=[{type:"bi.icon_label",cls:cls+" toast-icon",width:36},{el:{type:"bi.label",whiteSpace:"normal",text:o.text,textHeight:16,textAlign:"left"},rgap:o.autoClose?this._const.hgap:0}],columnSize=[36,""];o.autoClose===!1&&(items.push({ +type:"bi.icon_button",cls:"close-font toast-icon",handler:function(){self.destroy()},width:36}),columnSize.push(36)),this.text=BI.createWidget({type:"bi.horizontal_adapt",element:this,items:items,vgap:7,columnSize:columnSize})},setText:function(text){this.text.setText(text)},beforeDestroy:function(){this.fireEvent(BI.Toast.EVENT_DESTORY)}}),BI.Toast.EVENT_DESTORY="EVENT_DESTORY",BI.shortcut("bi.toast",BI.Toast),BI.Tooltip=BI.inherit(BI.Tip,{_const:{hgap:5,vgap:3},_defaultConfig:function(){return BI.extend(BI.Tooltip.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tooltip",text:"",level:"success",stopEvent:!1,stopPropagation:!1})},_init:function(){BI.Tooltip.superclass._init.apply(this,arguments);var self=this,o=this.options;this.element.addClass("tooltip-"+o.level);var fn=function(e){o.stopPropagation&&e.stopPropagation(),o.stopEvent&&e.stopEvent()};this.element.bind({click:fn,mousedown:fn,mouseup:fn,mouseover:fn,mouseenter:fn,mouseleave:fn,mousemove:fn});var texts=(o.text+"").split("\n");texts.length>1?BI.createWidget({type:"bi.vertical",element:this,hgap:this._const.hgap,items:BI.map(texts,function(i,text){return{type:"bi.label",textAlign:"left",whiteSpace:"normal",text:text,textHeight:18}})}):this.text=BI.createWidget({type:"bi.label",element:this,textAlign:"left",whiteSpace:"normal",text:o.text,textHeight:18,hgap:this._const.hgap})},setWidth:function(width){this.element.width(width-2*this._const.hgap)},setText:function(text){this.text&&this.text.setText(text)},setLevel:function(level){this.element.removeClass("tooltip-success").removeClass("tooltip-warning"),this.element.addClass("tooltip-"+level)}}),BI.shortcut("bi.tooltip",BI.Tooltip),BI.Trigger=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.Trigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-trigger cursor-pointer",height:24})},_init:function(){BI.Trigger.superclass._init.apply(this,arguments)},setKey:function(){},getKey:function(){}}),BI.CustomTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-tree",expander:{el:{},popup:{type:"bi.custom_tree"}},items:[],itemsCreator:BI.emptyFn,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]}})},_init:function(){BI.CustomTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(nodes){var self=this,o=this.options;nodes=BI.Tree.transformToTreeFormat(nodes);var items=[];return BI.each(nodes,function(i,node){if(BI.isNotEmptyArray(node.children)||node.isParent===!0){var item=BI.extend({type:"bi.expander",el:{value:node.value},popup:{type:"bi.custom_tree"}},BI.deepClone(o.expander),{id:node.id,pId:node.pId}),el=BI.stripEL(node);BI.isWidget(el)?item.el=el:(el=BI.clone(el),delete el.children,BI.extend(item.el,el)),item.popup.expander=BI.deepClone(o.expander),item.items=item.popup.items=node.children,item.itemsCreator=item.popup.itemsCreator=function(op){if(BI.isNotNull(op.node))return o.itemsCreator.apply(self,arguments);var args=Array.prototype.slice.call(arguments,0);return args[0].node=node,o.itemsCreator.apply(self,args)},BI.isNull(item.popup.el)&&(item.popup.el=BI.deepClone(o.el)),items.push(item)}else items.push(node)}),items},initTree:function(nodes){var self=this,o=this.options;this.tree=BI.createWidget(o.el,{element:this,items:this._formatItems(nodes),itemsCreator:function(op,callback){o.itemsCreator.apply(this,[op,function(items){var args=Array.prototype.slice.call(arguments,0);args[0]=self._formatItems(items),callback.apply(null,args)}])},value:o.value}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.CustomTree.EVENT_CHANGE,val,obj)})},stroke:function(nodes){this.populate.apply(this,arguments)},populate:function(nodes){var args=Array.prototype.slice.call(arguments,0);arguments.length>0&&(args[0]=this._formatItems(nodes)),this.tree.populate.apply(this.tree,args)},setValue:function(v){this.tree&&this.tree.setValue(v)},getValue:function(){return this.tree?this.tree.getValue():[]},getAllButtons:function(){return this.tree?this.tree.getAllButtons():[]},getAllLeaves:function(){return this.tree?this.tree.getAllLeaves():[]},getNodeById:function(id){return this.tree&&this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree&&this.tree.getNodeByValue(id)},empty:function(){this.tree.empty()}}),BI.CustomTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_tree",BI.CustomTree),function($){var settings={},roots={},caches={},_consts={className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove",SELECTED:"ztree_selected",UNSELECTED:"ztree_unselected"},id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom",NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_setting={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",url:"",autoParam:[],otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},_initRoot=function(setting){var r=data.getRoot(setting);r||(r={},data.setRoot(setting,r)),r[setting.data.key.children]=[],r.expandTriggerFlag=!1,r.curSelectedList=[],r.noSelection=!0,r.createdNodes=[],r.zId=0,r._ver=(new Date).getTime()},_initCache=function(setting){var c=data.getCache(setting);c||(c={},data.setCache(setting,c)),c.nodes=[],c.doms=[]},_bindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.bind(c.NODECREATED,function(event,treeId,node){tools.apply(setting.callback.onNodeCreated,[event,treeId,node])}),o.bind(c.CLICK,function(event,srcEvent,treeId,node,clickFlag){tools.apply(setting.callback.onClick,[srcEvent,treeId,node,clickFlag])}),o.bind(c.EXPAND,function(event,treeId,node){tools.apply(setting.callback.onExpand,[event,treeId,node])}),o.bind(c.COLLAPSE,function(event,treeId,node){tools.apply(setting.callback.onCollapse,[event,treeId,node])}),o.bind(c.ASYNC_SUCCESS,function(event,treeId,node,msg){tools.apply(setting.callback.onAsyncSuccess,[event,treeId,node,msg])}),o.bind(c.ASYNC_ERROR,function(event,treeId,node,XMLHttpRequest,textStatus,errorThrown){tools.apply(setting.callback.onAsyncError,[event,treeId,node,XMLHttpRequest,textStatus,errorThrown])}),o.bind(c.REMOVE,function(event,treeId,treeNode){tools.apply(setting.callback.onRemove,[event,treeId,treeNode])}),o.bind(c.SELECTED,function(event,srcEvent,treeId,node){tools.apply(setting.callback.onSelected,[srcEvent,treeId,node])}),o.bind(c.UNSELECTED,function(event,srcEvent,treeId,node){tools.apply(setting.callback.onUnSelected,[srcEvent,treeId,node])})},_unbindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.unbind(c.NODECREATED).unbind(c.CLICK).unbind(c.EXPAND).unbind(c.COLLAPSE).unbind(c.ASYNC_SUCCESS).unbind(c.ASYNC_ERROR).unbind(c.REMOVE).unbind(c.SELECTED).unbind(c.UNSELECTED)},_eventProxy=function(event){var target=event.target,setting=data.getSetting(event.data.treeId),tId="",node=null,nodeEventType="",treeEventType="",nodeEventCallback=null,treeEventCallback=null,tmp=null;if(tools.eqs(event.type,"mousedown")?treeEventType="mousedown":tools.eqs(event.type,"mouseup")?treeEventType="mouseup":tools.eqs(event.type,"contextmenu")?treeEventType="contextmenu":tools.eqs(event.type,"click")?tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.SWITCH)?(tId=tools.getNodeMainDom(target).id,nodeEventType="switchNode"):(tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id,nodeEventType="clickNode")):tools.eqs(event.type,"dblclick")&&(treeEventType="dblclick",tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id,nodeEventType="switchNode")),treeEventType.length>0&&0==tId.length&&(tmp=tools.getMDom(setting,target,[{tagName:"a",attrName:"treeNode"+consts.id.A}]),tmp&&(tId=tools.getNodeMainDom(tmp).id)),tId.length>0)switch(node=data.getNodeCache(setting,tId),nodeEventType){case"switchNode":node.isParent&&(tools.eqs(event.type,"click")||tools.eqs(event.type,"dblclick")&&tools.apply(setting.view.dblClickExpand,[setting.treeId,node],setting.view.dblClickExpand))?nodeEventCallback=handler.onSwitchNode:nodeEventType="";break;case"clickNode":nodeEventCallback=handler.onClickNode}switch(treeEventType){case"mousedown":treeEventCallback=handler.onZTreeMousedown;break;case"mouseup":treeEventCallback=handler.onZTreeMouseup;break;case"dblclick":treeEventCallback=handler.onZTreeDblclick;break;case"contextmenu":treeEventCallback=handler.onZTreeContextmenu}var proxyResult={stop:!1,node:node,nodeEventType:nodeEventType,nodeEventCallback:nodeEventCallback,treeEventType:treeEventType,treeEventCallback:treeEventCallback};return proxyResult},_initNode=function(setting,level,n,parentNode,isFirstNode,isLastNode,openFlag){if(n){var r=data.getRoot(setting),childKey=setting.data.key.children;n.level=level,n.tId=setting.treeId+"_"+ ++r.zId,n.parentTId=parentNode?parentNode.tId:null,n.open="string"==typeof n.open?tools.eqs(n.open,"true"):!!n.open,n[childKey]&&n[childKey].length>0?(n.isParent=!0,n.zAsync=!0):(n.isParent="string"==typeof n.isParent?tools.eqs(n.isParent,"true"):!!n.isParent,n.open=!(!n.isParent||setting.async.enable)&&n.open,n.zAsync=!n.isParent),n.isFirstNode=isFirstNode,n.isLastNode=isLastNode,n.getParentNode=function(){return data.getNodeCache(setting,n.parentTId)},n.getPreNode=function(){return data.getPreNode(setting,n)},n.getNextNode=function(){return data.getNextNode(setting,n)},n.isAjaxing=!1,data.fixPIdKeyValue(setting,n)}},_init={bind:[_bindEvent],unbind:[_unbindEvent],caches:[_initCache],nodes:[_initNode],proxys:[_eventProxy],roots:[_initRoot],beforeA:[],afterA:[],innerBeforeA:[],innerAfterA:[],zTreeTools:[]},data={addNodeCache:function(setting,node){data.getCache(setting).nodes[data.getNodeCacheId(node.tId)]=node},getNodeCacheId:function(tId){return tId.substring(tId.lastIndexOf("_")+1)},addAfterA:function(afterA){_init.afterA.push(afterA)},addBeforeA:function(beforeA){_init.beforeA.push(beforeA)},addInnerAfterA:function(innerAfterA){_init.innerAfterA.push(innerAfterA)},addInnerBeforeA:function(innerBeforeA){_init.innerBeforeA.push(innerBeforeA)},addInitBind:function(bindEvent){_init.bind.push(bindEvent)},addInitUnBind:function(unbindEvent){_init.unbind.push(unbindEvent)},addInitCache:function(initCache){_init.caches.push(initCache)},addInitNode:function(initNode){_init.nodes.push(initNode)},addInitProxy:function(initProxy,isFirst){isFirst?_init.proxys.splice(0,0,initProxy):_init.proxys.push(initProxy)},addInitRoot:function(initRoot){_init.roots.push(initRoot)},addNodesData:function(setting,parentNode,nodes){var childKey=setting.data.key.children;parentNode[childKey]||(parentNode[childKey]=[]),parentNode[childKey].length>0&&(parentNode[childKey][parentNode[childKey].length-1].isLastNode=!1,view.setNodeLineIcos(setting,parentNode[childKey][parentNode[childKey].length-1])),parentNode.isParent=!0,parentNode[childKey]=parentNode[childKey].concat(nodes)},addSelectedNode:function(setting,node){var root=data.getRoot(setting);data.isSelectedNode(setting,node)||root.curSelectedList.push(node)},addCreatedNode:function(setting,node){if(setting.callback.onNodeCreated||setting.view.addDiyDom){var root=data.getRoot(setting);root.createdNodes.push(node)}},addZTreeTools:function(zTreeTools){_init.zTreeTools.push(zTreeTools)},exSetting:function(s){$.extend(!0,_setting,s)},fixPIdKeyValue:function(setting,node){setting.data.simpleData.enable&&(node[setting.data.simpleData.pIdKey]=node.parentTId?node.getParentNode()[setting.data.simpleData.idKey]:setting.data.simpleData.rootPId)},getAfterA:function(setting,node,array){for(var i=0,j=_init.afterA.length;i-1&&result.push(nodes[i]),result=result.concat(data.getNodesByParamFuzzy(setting,nodes[i][childKey],key,value));return result},getNodesByFilter:function(setting,nodes,filter,isSingle,invokeParam){if(!nodes)return isSingle?null:[];for(var childKey=setting.data.key.children,result=isSingle?null:[],i=0,l=nodes.length;i0)},clone:function(obj){if(null===obj)return null;var o=tools.isArray(obj)?[]:{};for(var i in obj)o[i]=obj[i]instanceof Date?new Date(obj[i].getTime()):"object"==typeof obj[i]?arguments.callee(obj[i]):obj[i];return o},eqs:function(str1,str2){return str1.toLowerCase()===str2.toLowerCase()},isArray:function(arr){return"[object Array]"===Object.prototype.toString.apply(arr)},$:function(node,exp,setting){return exp&&"string"!=typeof exp&&(setting=exp,exp=""),"string"==typeof node?$(node,setting?setting.treeObj.get(0).ownerDocument:null):$("#"+node.tId+exp,setting?setting.treeObj:null)},getMDom:function(setting,curDom,targetExpr){if(!curDom)return null;for(;curDom&&curDom.id!==setting.treeId;){for(var i=0,l=targetExpr.length;curDom.tagName&&i0},uCanDo:function(setting,e){return!0}},view={addNodes:function(setting,parentNode,newNodes,isSilent){if(!setting.data.keep.leaf||!parentNode||parentNode.isParent)if(tools.isArray(newNodes)||(newNodes=[newNodes]),setting.data.simpleData.enable&&(newNodes=data.transformTozTreeFormat(setting,newNodes)),parentNode){var target_switchObj=$$(parentNode,consts.id.SWITCH,setting),target_icoObj=$$(parentNode,consts.id.ICON,setting),target_ulObj=$$(parentNode,consts.id.UL,setting);parentNode.open||(view.replaceSwitchClass(parentNode,target_switchObj,consts.folder.CLOSE),view.replaceIcoClass(parentNode,target_icoObj,consts.folder.CLOSE),parentNode.open=!1,target_ulObj.css({display:"none"})),data.addNodesData(setting,parentNode,newNodes),view.createNodes(setting,parentNode.level+1,newNodes,parentNode),isSilent||view.expandCollapseParentNode(setting,parentNode,!0)}else data.addNodesData(setting,data.getRoot(setting),newNodes),view.createNodes(setting,0,newNodes,null)},appendNodes:function(setting,level,nodes,parentNode,initFlag,openFlag){if(!nodes)return[];for(var html=[],childKey=setting.data.key.children,i=0,l=nodes.length;i0&&(childHtml=view.appendNodes(setting,level+1,node[childKey],node,initFlag,openFlag&&node.open)),openFlag&&(view.makeDOMNodeMainBefore(html,setting,node),view.makeDOMNodeLine(html,setting,node),data.getBeforeA(setting,node,html),view.makeDOMNodeNameBefore(html,setting,node),data.getInnerBeforeA(setting,node,html),view.makeDOMNodeIcon(html,setting,node),data.getInnerAfterA(setting,node,html),view.makeDOMNodeNameAfter(html,setting,node),data.getAfterA(setting,node,html),node.isParent&&node.open&&view.makeUlHtml(setting,node,html,childHtml.join("")),view.makeDOMNodeMainAfter(html,setting,node),data.addCreatedNode(setting,node))}return html},appendParentULDom:function(setting,node){var html=[],nObj=$$(node,setting);!nObj.get(0)&&node.parentTId&&(view.appendParentULDom(setting,node.getParentNode()),nObj=$$(node,setting));var ulObj=$$(node,consts.id.UL,setting);ulObj.get(0)&&ulObj.remove();var childKey=setting.data.key.children,childHtml=view.appendNodes(setting,node.level+1,node[childKey],node,!1,!0);view.makeUlHtml(setting,node,html,childHtml.join("")),nObj.append(html.join(""))},asyncNode:function(setting,node,isSilent,callback){var i,l;if(node&&!node.isParent)return tools.apply(callback),!1;if(node&&node.isAjaxing)return!1;if(0==tools.apply(setting.callback.beforeAsync,[setting.treeId,node],!0))return tools.apply(callback),!1;if(node){node.isAjaxing=!0;var icoObj=$$(node,consts.id.ICON,setting);icoObj.attr({style:"","class":consts.className.BUTTON+" "+consts.className.ICO_LOADING})}var tmpParam={};for(i=0,l=setting.async.autoParam.length;node&&i1&&(spKey=pKey[1],pKey=pKey[0]),tmpParam[spKey]=node[pKey]}if(tools.isArray(setting.async.otherParam))for(i=0,l=setting.async.otherParam.length;i=0;i--)if(n=list[i],node===n||!node&&(!excludeNode||excludeNode!==n)){if($$(n,consts.id.A,setting).removeClass(consts.node.CURSELECTED),node){data.removeSelectedNode(setting,node),setting.treeObj.trigger(consts.event.UNSELECTED,[event,setting.treeId,n]);break}list.splice(i,1),setting.treeObj.trigger(consts.event.UNSELECTED,[event,setting.treeId,n])}},createNodeCallback:function(setting){if(setting.callback.onNodeCreated||setting.view.addDiyDom)for(var root=data.getRoot(setting);root.createdNodes.length>0;){var node=root.createdNodes.shift();tools.apply(setting.view.addDiyDom,[setting.treeId,node]),setting.callback.onNodeCreated&&setting.treeObj.trigger(consts.event.NODECREATED,[setting.treeId,node])}},createNodes:function(setting,level,nodes,parentNode){if(nodes&&0!=nodes.length){var root=data.getRoot(setting),childKey=setting.data.key.children,openFlag=!parentNode||parentNode.open||!!$$(parentNode[childKey][0],setting).get(0);root.createdNodes=[];var zTreeHtml=view.appendNodes(setting,level,nodes,parentNode,!0,openFlag);if(parentNode){var ulObj=$$(parentNode,consts.id.UL,setting);ulObj.get(0)&&ulObj.append(zTreeHtml.join(""))}else setting.treeObj.append(zTreeHtml.join(""));view.createNodeCallback(setting)}},destroy:function(setting){setting&&(data.initCache(setting),data.initRoot(setting),event.unbindTree(setting),event.unbindEvent(setting),setting.treeObj.empty(),delete settings[setting.treeId])},expandCollapseNode:function(setting,node,expandFlag,animateFlag,callback){var root=data.getRoot(setting),childKey=setting.data.key.children;if(!node)return void tools.apply(callback,[]);if(root.expandTriggerFlag){var _callback=callback;callback=function(){_callback&&_callback(),node.open?setting.treeObj.trigger(consts.event.EXPAND,[setting.treeId,node]):setting.treeObj.trigger(consts.event.COLLAPSE,[setting.treeId,node])},root.expandTriggerFlag=!1}if(!node.open&&node.isParent&&(!$$(node,consts.id.UL,setting).get(0)||node[childKey]&&node[childKey].length>0&&!$$(node[childKey][0],setting).get(0))&&(view.appendParentULDom(setting,node),view.createNodeCallback(setting)),node.open==expandFlag)return void tools.apply(callback,[]);var ulObj=$$(node,consts.id.UL,setting),switchObj=$$(node,consts.id.SWITCH,setting),icoObj=$$(node,consts.id.ICON,setting);node.isParent?(node.open=!node.open,node.iconOpen&&node.iconClose&&icoObj.attr("style",view.makeNodeIcoStyle(setting,node)),node.open?(view.replaceSwitchClass(node,switchObj,consts.folder.OPEN),view.replaceIcoClass(node,icoObj,consts.folder.OPEN),0==animateFlag||""==setting.view.expandSpeed?(ulObj.show(),tools.apply(callback,[])):node[childKey]&&node[childKey].length>0?ulObj.slideDown(setting.view.expandSpeed,callback):(ulObj.show(),tools.apply(callback,[]))):(view.replaceSwitchClass(node,switchObj,consts.folder.CLOSE),view.replaceIcoClass(node,icoObj,consts.folder.CLOSE),0!=animateFlag&&""!=setting.view.expandSpeed&&node[childKey]&&node[childKey].length>0?ulObj.slideUp(setting.view.expandSpeed,callback):(ulObj.hide(),tools.apply(callback,[])))):tools.apply(callback,[])},expandCollapseParentNode:function(setting,node,expandFlag,animateFlag,callback){if(node){if(!node.parentTId)return void view.expandCollapseNode(setting,node,expandFlag,animateFlag,callback);view.expandCollapseNode(setting,node,expandFlag,animateFlag),node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,animateFlag,callback)}},expandCollapseSonNode:function(setting,node,expandFlag,animateFlag,callback){var root=data.getRoot(setting),childKey=setting.data.key.children,treeNodes=node?node[childKey]:root[childKey],selfAnimateSign=!node&&animateFlag,expandTriggerFlag=data.getRoot(setting).expandTriggerFlag;if(data.getRoot(setting).expandTriggerFlag=!1,treeNodes)for(var i=0,l=treeNodes.length;i=0;i--)if(node===list[i])return!0;return!1},makeDOMNodeIcon:function(html,setting,node){var nameStr=data.getNodeName(setting,node),name=setting.view.nameIsHTML?nameStr:nameStr.replace(/&/g,"&").replace(//g,">");html.push("",name,"")},makeDOMNodeLine:function(html,setting,node){html.push("")},makeDOMNodeMainAfter:function(html,setting,node){html.push("")},makeDOMNodeMainBefore:function(html,setting,node){html.push("
    • ")},makeDOMNodeNameAfter:function(html,setting,node){html.push("")},makeDOMNodeNameBefore:function(html,setting,node){var title=data.getNodeTitle(setting,node),url=view.makeNodeUrl(setting,node),fontcss=view.makeNodeFontCss(setting,node),fontStyle=[];for(var f in fontcss)fontStyle.push(f,":",fontcss[f],";");html.push("0?"href='"+url+"'":""," target='",view.makeNodeTarget(node),"' style='",fontStyle.join(""),"'"),tools.apply(setting.view.showTitle,[setting.treeId,node],setting.view.showTitle)&&title&&html.push("title='",title.replace(/'/g,"'").replace(//g,">"),"'"),html.push(">")},makeNodeFontCss:function(setting,node){var fontCss=tools.apply(setting.view.fontCss,[setting.treeId,node],setting.view.fontCss);return fontCss&&"function"!=typeof fontCss?fontCss:{}},makeNodeIcoClass:function(setting,node){var icoCss=["ico"];return node.isAjaxing||(icoCss[0]=(node.iconSkin?node.iconSkin+"_":"")+icoCss[0],node.isParent?icoCss.push(node.open?consts.folder.OPEN:consts.folder.CLOSE):icoCss.push(consts.folder.DOCU)),consts.className.BUTTON+" "+icoCss.join("_")},makeNodeIcoStyle:function(setting,node){var icoStyle=[];if(!node.isAjaxing){var icon=node.isParent&&node.iconOpen&&node.iconClose?node.open?node.iconOpen:node.iconClose:node.icon;icon&&icoStyle.push("background:url(",icon,") 0 0 no-repeat;"),0!=setting.view.showIcon&&tools.apply(setting.view.showIcon,[setting.treeId,node],!0)||icoStyle.push("width:0px;height:0px;")}return icoStyle.join("")},makeNodeLineClass:function(setting,node){var lineClass=[];return setting.view.showLine?0==node.level&&node.isFirstNode&&node.isLastNode?lineClass.push(consts.line.ROOT):0==node.level&&node.isFirstNode?lineClass.push(consts.line.ROOTS):node.isLastNode?lineClass.push(consts.line.BOTTOM):lineClass.push(consts.line.CENTER):lineClass.push(consts.line.NOLINE),node.isParent?lineClass.push(node.open?consts.folder.OPEN:consts.folder.CLOSE):lineClass.push(consts.folder.DOCU),view.makeNodeLineClassEx(node)+lineClass.join("_")},makeNodeLineClassEx:function(node){return consts.className.BUTTON+" "+consts.className.LEVEL+node.level+" "+consts.className.SWITCH+" "},makeNodeTarget:function(node){return node.target||"_blank"},makeNodeUrl:function(setting,node){var urlKey=setting.data.key.url;return node[urlKey]?node[urlKey]:null},makeUlHtml:function(setting,node,html,content){html.push("
        "),html.push(content),html.push("
      ")},makeUlLineClass:function(setting,node){return setting.view.showLine&&!node.isLastNode?consts.line.LINE:""},removeChildNodes:function(setting,node){if(node){var childKey=setting.data.key.children,nodes=node[childKey];if(nodes){for(var i=0,l=nodes.length;i0&&(parentNode[childKey][0].isFirstNode=!0)},setLastNode:function(setting,parentNode){var childKey=setting.data.key.children,childLength=parentNode[childKey].length;childLength>0&&(parentNode[childKey][childLength-1].isLastNode=!0)},removeNode:function(setting,node){var root=data.getRoot(setting),childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():root;if(node.isFirstNode=!1,node.isLastNode=!1,node.getPreNode=function(){return null},node.getNextNode=function(){return null},data.getNodeCache(setting,node.tId)){$$(node,setting).remove(),data.removeNodeCache(setting,node),data.removeSelectedNode(setting,node);for(var i=0,l=parentNode[childKey].length;i0){var newLast=parentNode[childKey][childLength-1];if(tmp_ulObj=$$(newLast,consts.id.UL,setting),tmp_switchObj=$$(newLast,consts.id.SWITCH,setting),tmp_icoObj=$$(newLast,consts.id.ICON,setting),parentNode==root)if(1==parentNode[childKey].length)view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.ROOT);else{var tmp_first_switchObj=$$(parentNode[childKey][0],consts.id.SWITCH,setting);view.replaceSwitchClass(parentNode[childKey][0],tmp_first_switchObj,consts.line.ROOTS),view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.BOTTOM)}else view.replaceSwitchClass(newLast,tmp_switchObj,consts.line.BOTTOM);tmp_ulObj.removeClass(consts.line.LINE)}}else parentNode.isParent=!1,parentNode.open=!1,tmp_ulObj=$$(parentNode,consts.id.UL,setting),tmp_switchObj=$$(parentNode,consts.id.SWITCH,setting),tmp_icoObj=$$(parentNode,consts.id.ICON,setting),view.replaceSwitchClass(parentNode,tmp_switchObj,consts.folder.DOCU),view.replaceIcoClass(parentNode,tmp_icoObj,consts.folder.DOCU),tmp_ulObj.css("display","none")}},replaceIcoClass:function(node,obj,newName){if(obj&&!node.isAjaxing){var tmpName=obj.attr("class");if(void 0!=tmpName){var tmpList=tmpName.split("_");switch(newName){case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:tmpList[tmpList.length-1]=newName}obj.attr("class",tmpList.join("_"))}}},replaceSwitchClass:function(node,obj,newName){if(obj){var tmpName=obj.attr("class");if(void 0!=tmpName){var tmpList=tmpName.split("_");switch(newName){case consts.line.ROOT:case consts.line.ROOTS:case consts.line.CENTER:case consts.line.BOTTOM:case consts.line.NOLINE:tmpList[0]=view.makeNodeLineClassEx(node)+newName;break;case consts.folder.OPEN:case consts.folder.CLOSE:case consts.folder.DOCU:tmpList[1]=newName}obj.attr("class",tmpList.join("_")),newName!==consts.folder.DOCU?obj.removeAttr("disabled"):obj.attr("disabled","disabled")}}},selectNode:function(setting,node,addFlag){addFlag||view.cancelPreSelectedNode(setting,null,node),$$(node,consts.id.A,setting).addClass(consts.node.CURSELECTED),data.addSelectedNode(setting,node),setting.treeObj.trigger(consts.event.SELECTED,[event,setting.treeId,node])},setNodeFontCss:function(setting,treeNode){var aObj=$$(treeNode,consts.id.A,setting),fontCss=view.makeNodeFontCss(setting,treeNode);fontCss&&aObj.css(fontCss)},setNodeLineIcos:function(setting,node){if(node){var switchObj=$$(node,consts.id.SWITCH,setting),ulObj=$$(node,consts.id.UL,setting),icoObj=$$(node,consts.id.ICON,setting),ulLine=view.makeUlLineClass(setting,node);0==ulLine.length?ulObj.removeClass(consts.line.LINE):ulObj.addClass(ulLine),switchObj.attr("class",view.makeNodeLineClass(setting,node)),node.isParent?switchObj.removeAttr("disabled"):switchObj.attr("disabled","disabled"),icoObj.removeAttr("style"),icoObj.attr("style",view.makeNodeIcoStyle(setting,node)),icoObj.attr("class",view.makeNodeIcoClass(setting,node))}},setNodeName:function(setting,node){var title=data.getNodeTitle(setting,node),nObj=$$(node,consts.id.SPAN,setting);if(nObj.empty(),setting.view.nameIsHTML?nObj.html(data.getNodeName(setting,node)):nObj.text(data.getNodeName(setting,node)),tools.apply(setting.view.showTitle,[setting.treeId,node],setting.view.showTitle)){var aObj=$$(node,consts.id.A,setting);aObj.attr("title",title?title:"")}},setNodeTarget:function(setting,node){var aObj=$$(node,consts.id.A,setting);aObj.attr("target",view.makeNodeTarget(node))},setNodeUrl:function(setting,node){var aObj=$$(node,consts.id.A,setting),url=view.makeNodeUrl(setting,node);null==url||0==url.length?aObj.removeAttr("href"):aObj.attr("href",url)},switchNode:function(setting,node){if(node.open||!tools.canAsync(setting,node))view.expandCollapseNode(setting,node,!node.open);else if(setting.async.enable){if(!view.asyncNode(setting,node))return void view.expandCollapseNode(setting,node,!node.open)}else node&&view.expandCollapseNode(setting,node,!node.open)}};$.fn.zTree={consts:_consts,_z:{tools:tools,view:view,event:event,data:data},getZTreeObj:function(treeId){var o=data.getZTreeTools(treeId);return o?o:null},destroy:function(treeId){if(treeId&&treeId.length>0)view.destroy(data.getSetting(treeId));else for(var s in settings)view.destroy(settings[s])},init:function(obj,zSetting,zNodes){var setting=tools.clone(_setting);$.extend(!0,setting,zSetting),setting.treeId=obj.attr("id"),setting.treeObj=obj,setting.treeObj.empty(),settings[setting.treeId]=setting,"undefined"==typeof document.body.style.maxHeight&&(setting.view.expandSpeed=""),data.initRoot(setting);var root=data.getRoot(setting),childKey=setting.data.key.children;zNodes=zNodes?tools.clone(tools.isArray(zNodes)?zNodes:[zNodes]):[],setting.data.simpleData.enable?root[childKey]=data.transformTozTreeFormat(setting,zNodes):root[childKey]=zNodes,data.initCache(setting),event.unbindTree(setting),event.bindTree(setting),event.unbindEvent(setting),event.bindEvent(setting);var zTreeTools={setting:setting,addNodes:function(parentNode,newNodes,isSilent){function addCallback(){view.addNodes(setting,parentNode,xNewNodes,1==isSilent)}if(!newNodes)return null;if(parentNode||(parentNode=null),parentNode&&!parentNode.isParent&&setting.data.keep.leaf)return null;var xNewNodes=tools.clone(tools.isArray(newNodes)?newNodes:[newNodes]);return tools.canAsync(setting,parentNode)?view.asyncNode(setting,parentNode,isSilent,addCallback):addCallback(),xNewNodes},cancelSelectedNode:function(node){view.cancelPreSelectedNode(setting,node)},destroy:function(){view.destroy(setting)},expandAll:function(expandFlag){return expandFlag=!!expandFlag,view.expandCollapseSonNode(setting,null,expandFlag,!0),expandFlag},expandNode:function(node,expandFlag,sonSign,focus,callbackFlag){if(!node||!node.isParent)return null;if(expandFlag!==!0&&expandFlag!==!1&&(expandFlag=!node.open),callbackFlag=!!callbackFlag,callbackFlag&&expandFlag&&0==tools.apply(setting.callback.beforeExpand,[setting.treeId,node],!0))return null;if(callbackFlag&&!expandFlag&&0==tools.apply(setting.callback.beforeCollapse,[setting.treeId,node],!0))return null;if(expandFlag&&node.parentTId&&view.expandCollapseParentNode(setting,node.getParentNode(),expandFlag,!1),expandFlag===node.open&&!sonSign)return null;if(data.getRoot(setting).expandTriggerFlag=callbackFlag,!tools.canAsync(setting,node)&&sonSign)view.expandCollapseSonNode(setting,node,expandFlag,!0,function(){if(focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}});else if(node.open=!expandFlag,view.switchNode(this.setting,node),focus!==!1)try{$$(node,setting).focus().blur()}catch(e){}return expandFlag},getNodes:function(){return data.getNodes(setting)},getNodeByParam:function(key,value,parentNode){return key?data.getNodeByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodeByTId:function(tId){return data.getNodeCache(setting,tId)},getNodesByParam:function(key,value,parentNode){return key?data.getNodesByParam(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByParamFuzzy:function(key,value,parentNode){return key?data.getNodesByParamFuzzy(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),key,value):null},getNodesByFilter:function(filter,isSingle,parentNode,invokeParam){return isSingle=!!isSingle,filter&&"function"==typeof filter?data.getNodesByFilter(setting,parentNode?parentNode[setting.data.key.children]:data.getNodes(setting),filter,isSingle,invokeParam):isSingle?null:[]},getNodeIndex:function(node){if(!node)return null;for(var childKey=setting.data.key.children,parentNode=node.parentTId?node.getParentNode():data.getRoot(setting),i=0,l=parentNode[childKey].length;i0?view.createNodes(setting,0,root[childKey]):setting.async.enable&&setting.async.url&&""!==setting.async.url&&view.asyncNode(setting),zTreeTools}};var zt=$.fn.zTree,$$=tools.$,consts=zt.consts}(BI.jQuery),function($){var _consts={event:{CHECK:"ztree_check"},id:{CHECK:"_check"},checkbox:{STYLE:"checkbox",DEFAULT:"chk",DISABLED:"disable",FALSE:"false",TRUE:"true",FULL:"full",PART:"part",FOCUS:"focus"},radio:{STYLE:"radio",TYPE_ALL:"all",TYPE_LEVEL:"level"}},_setting={check:{enable:!1,autoCheckTrigger:!1,chkStyle:_consts.checkbox.STYLE,nocheckInherit:!1,chkDisabledInherit:!1,radioType:_consts.radio.TYPE_LEVEL,chkboxType:{Y:"ps",N:"ps"}},data:{key:{checked:"checked"}},callback:{beforeCheck:null,onCheck:null}},_initRoot=function(setting){var r=data.getRoot(setting);r.radioCheckedList=[]},_initCache=function(treeId){},_bindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.bind(c.CHECK,function(event,srcEvent,treeId,node){event.srcEvent=srcEvent,tools.apply(setting.callback.onCheck,[event,treeId,node])})},_unbindEvent=function(setting){var o=setting.treeObj,c=consts.event;o.unbind(c.CHECK)},_eventProxy=function(e){var target=e.target,setting=data.getSetting(e.data.treeId),tId="",node=null,nodeEventType="",treeEventType="",nodeEventCallback=null,treeEventCallback=null;if(tools.eqs(e.type,"mouseover")?setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="mouseoverCheck"):tools.eqs(e.type,"mouseout")?setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="mouseoutCheck"):tools.eqs(e.type,"click")&&setting.check.enable&&tools.eqs(target.tagName,"span")&&null!==target.getAttribute("treeNode"+consts.id.CHECK)&&(tId=tools.getNodeMainDom(target).id,nodeEventType="checkNode"),tId.length>0)switch(node=data.getNodeCache(setting,tId),nodeEventType){case"checkNode":nodeEventCallback=_handler.onCheckNode;break;case"mouseoverCheck":nodeEventCallback=_handler.onMouseoverCheck;break;case"mouseoutCheck":nodeEventCallback=_handler.onMouseoutCheck}var proxyResult={stop:"checkNode"===nodeEventType,node:node,nodeEventType:nodeEventType,nodeEventCallback:nodeEventCallback,treeEventType:treeEventType,treeEventCallback:treeEventCallback};return proxyResult},_initNode=function(setting,level,n,parentNode,isFirstNode,isLastNode,openFlag){if(n){var checkedKey=setting.data.key.checked;if("string"==typeof n[checkedKey]&&(n[checkedKey]=tools.eqs(n[checkedKey],"true")),n[checkedKey]=!!n[checkedKey],n.checkedOld=n[checkedKey],"string"==typeof n.nocheck&&(n.nocheck=tools.eqs(n.nocheck,"true")),n.nocheck=!!n.nocheck||setting.check.nocheckInherit&&parentNode&&!!parentNode.nocheck,"string"==typeof n.chkDisabled&&(n.chkDisabled=tools.eqs(n.chkDisabled,"true")),n.chkDisabled=!!n.chkDisabled||setting.check.chkDisabledInherit&&parentNode&&!!parentNode.chkDisabled,"string"==typeof n.halfCheck&&(n.halfCheck=tools.eqs(n.halfCheck,"true")),n.halfCheck=!!n.halfCheck,n.check_Child_State=-1,n.check_Focus=!1,n.getCheckStatus=function(){return data.getCheckStatus(setting,n)},setting.check.chkStyle==consts.radio.STYLE&&setting.check.radioType==consts.radio.TYPE_ALL&&n[checkedKey]){var r=data.getRoot(setting);r.radioCheckedList.push(n)}}},_beforeA=function(setting,node,html){var checkedKey=setting.data.key.checked;setting.check.enable&&(data.makeChkFlag(setting,node),html.push(""))},_zTreeTools=function(setting,zTreeTools){zTreeTools.checkNode=function(node,checked,checkTypeFlag,callbackFlag){var checkedKey=this.setting.data.key.checked;if(node.chkDisabled!==!0&&(checked!==!0&&checked!==!1&&(checked=!node[checkedKey]),callbackFlag=!!callbackFlag,(node[checkedKey]!==checked||checkTypeFlag)&&(!callbackFlag||0!=tools.apply(this.setting.callback.beforeCheck,[this.setting.treeId,node],!0))&&tools.uCanDo(this.setting)&&this.setting.check.enable&&node.nocheck!==!0)){node[checkedKey]=checked;var checkObj=$$(node,consts.id.CHECK,this.setting);(checkTypeFlag||this.setting.check.chkStyle===consts.radio.STYLE)&&view.checkNodeRelation(this.setting,node),view.setChkClass(this.setting,checkObj,node),view.repairParentChkClassWithSelf(this.setting,node),callbackFlag&&this.setting.treeObj.trigger(consts.event.CHECK,[null,this.setting.treeId,node])}},zTreeTools.checkAllNodes=function(checked){view.repairAllChk(this.setting,!!checked)},zTreeTools.getCheckedNodes=function(checked){var childKey=this.setting.data.key.children;return checked=checked!==!1,data.getTreeCheckedNodes(this.setting,data.getRoot(this.setting)[childKey],checked)},zTreeTools.getChangeCheckedNodes=function(){var childKey=this.setting.data.key.children;return data.getTreeChangeCheckedNodes(this.setting,data.getRoot(this.setting)[childKey])},zTreeTools.setChkDisabled=function(node,disabled,inheritParent,inheritChildren){disabled=!!disabled,inheritParent=!!inheritParent,inheritChildren=!!inheritChildren,view.repairSonChkDisabled(this.setting,node,disabled,inheritChildren),view.repairParentChkDisabled(this.setting,node.getParentNode(),disabled,inheritParent)};var _updateNode=zTreeTools.updateNode;zTreeTools.updateNode=function(node,checkTypeFlag){if(_updateNode&&_updateNode.apply(zTreeTools,arguments),node&&this.setting.check.enable){var nObj=$$(node,this.setting);if(nObj.get(0)&&tools.uCanDo(this.setting)){var checkObj=$$(node,consts.id.CHECK,this.setting);1!=checkTypeFlag&&this.setting.check.chkStyle!==consts.radio.STYLE||view.checkNodeRelation(this.setting,node),view.setChkClass(this.setting,checkObj,node),view.repairParentChkClassWithSelf(this.setting,node)}}}},_data={getRadioCheckedList:function(setting){for(var checkedList=data.getRoot(setting).radioCheckedList,i=0,j=checkedList.length;i-1&&node.check_Child_State<2:node.check_Child_State>0};return r},getTreeCheckedNodes:function(setting,nodes,checked,results){if(!nodes)return[];var childKey=setting.data.key.children,checkedKey=setting.data.key.checked,onlyOne=checked&&setting.check.chkStyle==consts.radio.STYLE&&setting.check.radioType==consts.radio.TYPE_ALL;results=results?results:[];for(var i=0,l=nodes.length;i0));i++);return results},getTreeChangeCheckedNodes:function(setting,nodes,results){if(!nodes)return[];var childKey=setting.data.key.children,checkedKey=setting.data.key.checked;results=results?results:[];for(var i=0,l=nodes.length;i0?2:0,2==tmp){chkFlag=2;break}0==tmp&&(chkFlag=0)}else if(setting.check.chkStyle==consts.checkbox.STYLE){if(tmp=cNode.nocheck===!0||cNode.chkDisabled===!0?cNode.check_Child_State:cNode.halfCheck===!0?1:cNode[checkedKey]?cNode.check_Child_State===-1||2===cNode.check_Child_State?2:1:cNode.check_Child_State>0?1:0,1===tmp){chkFlag=1;break}if(2===tmp&&chkFlag>-1&&i>0&&tmp!==chkFlag){chkFlag=1;break}if(2===chkFlag&&tmp>-1&&tmp<2){chkFlag=1;break}tmp>-1&&(chkFlag=tmp)}}node.check_Child_State=chkFlag}}},_event={},_handler={onCheckNode:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkedKey=setting.data.key.checked;if(0==tools.apply(setting.callback.beforeCheck,[setting.treeId,node],!0))return!0;node[checkedKey]=!node[checkedKey],view.checkNodeRelation(setting,node);var checkObj=$$(node,consts.id.CHECK,setting);return view.setChkClass(setting,checkObj,node),view.repairParentChkClassWithSelf(setting,node),setting.treeObj.trigger(consts.event.CHECK,[event,setting.treeId,node]),!0},onMouseoverCheck:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkObj=$$(node,consts.id.CHECK,setting);return node.check_Focus=!0,view.setChkClass(setting,checkObj,node),!0},onMouseoutCheck:function(event,node){if(node.chkDisabled===!0)return!1;var setting=data.getSetting(event.data.treeId),checkObj=$$(node,consts.id.CHECK,setting);return node.check_Focus=!1,view.setChkClass(setting,checkObj,node),!0}},_tools={},_view={checkNodeRelation:function(setting,node){var pNode,i,l,childKey=setting.data.key.children,checkedKey=setting.data.key.checked,r=consts.radio;if(setting.check.chkStyle==r.STYLE){var checkedList=data.getRadioCheckedList(setting);if(node[checkedKey])if(setting.check.radioType==r.TYPE_ALL){for(i=checkedList.length-1;i>=0;i--)pNode=checkedList[i],pNode[checkedKey]&&pNode!=node&&(pNode[checkedKey]=!1,checkedList.splice(i,1),view.setChkClass(setting,$$(pNode,consts.id.CHECK,setting),pNode),pNode.parentTId!=node.parentTId&&view.repairParentChkClassWithSelf(setting,pNode));checkedList.push(node)}else{var parentNode=node.parentTId?node.getParentNode():data.getRoot(setting);for(i=0,l=parentNode[childKey].length;i-1)&&view.setSonNodeCheckBox(setting,node,!0),node[checkedKey]||node[childKey]&&0!=node[childKey].length&&!(setting.check.chkboxType.N.indexOf("s")>-1)||view.setSonNodeCheckBox(setting,node,!1),node[checkedKey]&&setting.check.chkboxType.Y.indexOf("p")>-1&&view.setParentNodeCheckBox(setting,node,!0),!node[checkedKey]&&setting.check.chkboxType.N.indexOf("p")>-1&&view.setParentNodeCheckBox(setting,node,!1)},makeChkClass:function(setting,node){var checkedKey=setting.data.key.checked,c=consts.checkbox,r=consts.radio,checkboxType=setting.check.chkboxType,notEffectByOtherNode=""===checkboxType.Y&&""===checkboxType.N;fullStyle="",node.chkDisabled===!0?fullStyle=c.DISABLED:node.halfCheck?fullStyle=c.PART:setting.check.chkStyle==r.STYLE?fullStyle=node.check_Child_State<1?c.FULL:c.PART:fullStyle=node[checkedKey]?2===node.check_Child_State||node.check_Child_State===-1||notEffectByOtherNode?c.FULL:c.PART:node.check_Child_State<1||notEffectByOtherNode?c.FULL:c.PART;var chkName=setting.check.chkStyle+"_"+(node[checkedKey]?c.TRUE:c.FALSE)+"_"+fullStyle;return chkName=node.check_Focus&&node.chkDisabled!==!0?chkName+"_"+c.FOCUS:chkName,consts.className.BUTTON+" "+c.DEFAULT+" "+chkName},repairAllChk:function(setting,checked){if(setting.check.enable&&setting.check.chkStyle===consts.checkbox.STYLE)for(var checkedKey=setting.data.key.checked,childKey=setting.data.key.children,root=data.getRoot(setting),i=0,l=root[childKey].length;i0?view.repairParentChkClass(setting,node[childKey][0]):view.repairParentChkClass(setting,node)}},repairSonChkDisabled:function(setting,node,chkDisabled,inherit){if(node){var childKey=setting.data.key.children;if(node.chkDisabled!=chkDisabled&&(node.chkDisabled=chkDisabled),view.repairChkClass(setting,node),node[childKey]&&inherit)for(var i=0,l=node[childKey].length;i0){pSign=!1;break}pSign&&view.setParentNodeCheckBox(setting,node.getParentNode(),value,srcNode)}},setSonNodeCheckBox:function(setting,node,value,srcNode){if(node){var childKey=setting.data.key.children,checkedKey=setting.data.key.checked,checkObj=$$(node,consts.id.CHECK,setting);srcNode||(srcNode=node);var hasDisable=!1;if(node[childKey])for(var i=0,l=node[childKey].length;i0?value?2:0:-1)):node.check_Child_State=-1,view.setChkClass(setting,checkObj,node),setting.check.autoCheckTrigger&&node!=srcNode&&node.nocheck!==!0&&node.chkDisabled!==!0&&setting.treeObj.trigger(consts.event.CHECK,[null,setting.treeId,node]))}}},_z={tools:_tools,view:_view,event:_event,data:_data};$.extend(!0,$.fn.zTree.consts,_consts),$.extend(!0,$.fn.zTree._z,_z);var zt=$.fn.zTree,tools=zt._z.tools,consts=zt.consts,view=zt._z.view,data=zt._z.data,event=zt._z.event,$$=tools.$;data.exSetting(_setting),data.addInitBind(_bindEvent),data.addInitUnBind(_unbindEvent),data.addInitCache(_initCache),data.addInitNode(_initNode),data.addInitProxy(_eventProxy,!0),data.addInitRoot(_initRoot),data.addBeforeA(_beforeA),data.addZTreeTools(_zTreeTools);var _createNodes=view.createNodes;view.createNodes=function(setting,level,nodes,parentNode){_createNodes&&_createNodes.apply(view,arguments),nodes&&view.repairParentChkClassWithSelf(setting,parentNode)};var _removeNode=view.removeNode;view.removeNode=function(setting,node){var parentNode=node.getParentNode();_removeNode&&_removeNode.apply(view,arguments),node&&parentNode&&(view.repairChkClass(setting,parentNode),view.repairParentChkClass(setting,parentNode)); +};var _appendNodes=view.appendNodes;view.appendNodes=function(setting,level,nodes,parentNode,initFlag,openFlag){var html="";return _appendNodes&&(html=_appendNodes.apply(view,arguments)),parentNode&&data.makeChkFlag(setting,parentNode),html}}(BI.jQuery),BI.IconChangeButton=BI.inherit(BI.Single,{_defaultConfig:function(){var conf=BI.IconChangeButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-icon-change-button",iconCls:"",iconWidth:null,iconHeight:null,stopEvent:!1,stopPropagation:!1,selected:!1,once:!1,forceSelected:!1,forceNotSelected:!1,disableSelected:!1,shadow:!1,isShadowShowingOnSelected:!1,trigger:null,handler:BI.emptyFn})},_init:function(){BI.IconChangeButton.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button=BI.createWidget({type:"bi.icon_button",element:this,cls:o.iconCls,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,stopEvent:o.stopEvent,stopPropagation:o.stopPropagation,selected:o.selected,once:o.once,forceSelected:o.forceSelected,forceNotSelected:o.forceNotSelected,disableSelected:o.disableSelected,shadow:o.shadow,isShadowShowingOnSelected:o.isShadowShowingOnSelected,trigger:o.trigger,handler:o.handler}),this.button.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button.on(BI.IconButton.EVENT_CHANGE,function(){self.fireEvent(BI.IconChangeButton.EVENT_CHANGE,arguments)})},isSelected:function(){return this.button.isSelected()},setSelected:function(b){this.button.setSelected(b)},setIcon:function(cls){var o=this.options;o.iconCls!==cls&&(this.element.removeClass(o.iconCls).addClass(cls),o.iconCls=cls)}}),BI.IconChangeButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_change_button",BI.IconChangeButton),BI.TriggerIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.TriggerIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-trigger-icon-button",extraCls:"pull-down-font"})}}),BI.TriggerIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.trigger_icon_button",BI.TriggerIconButton),BI.HalfIconButton=BI.inherit(BI.IconButton,{_defaultConfig:function(){var conf=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-half-icon-button check-half-select-icon",height:16,width:16,iconWidth:16,iconHeight:16,selected:!1})}}),BI.HalfIconButton.EVENT_CHANGE=BI.IconButton.EVENT_CHANGE,BI.shortcut("bi.half_icon_button",BI.HalfIconButton),BI.HalfButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.HalfIconButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-half-button bi-high-light-border",height:14,width:14,selected:!1})},_init:function(){BI.HalfButton.superclass._init.apply(this,arguments),BI.createWidget({type:"bi.center_adapt",element:this.element,items:[{type:"bi.layout",cls:"bi-high-light-background",width:8,height:8}]})},doClick:function(){BI.HalfButton.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.HalfButton.EVENT_CHANGE)}}),BI.HalfButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.half_button",BI.HalfButton),BI.MultiSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-item",height:24,logic:{dynamic:!1},iconWrapperWidth:26})},_init:function(){BI.MultiSelectItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,rgap:o.rgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected())}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.checkbox],width:o.iconWrapperWidth},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MultiSelectItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE,this.getValue(),this)},setSelected:function(v){BI.MultiSelectItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.MultiSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_item",BI.MultiSelectItem),BI.SingleSelectIconTextItem=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectIconTextItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-icon-text-item bi-list-item-active",iconCls:"",height:24})},_init:function(){BI.SingleSelectIconTextItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.icon_text_item",element:this,cls:o.iconCls,once:o.once,iconWrapperWidth:o.iconWrapperWidth,selected:o.selected,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),this.text.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},isSelected:function(){return this.text.isSelected()},setSelected:function(b){this.text.setSelected(b)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectIconTextItem.superclass.doClick.apply(this,arguments)}}),BI.shortcut("bi.single_select_icon_text_item",BI.SingleSelectIconTextItem),BI.SingleSelectItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-item bi-list-item-active",hgap:10,height:24,textAlign:"left"})},_init:function(){BI.SingleSelectItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",element:this,textAlign:o.textAlign,whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,title:o.title||o.text,warningTitle:o.warningTitle,py:o.py})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)}}),BI.SingleSelectItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_item",BI.SingleSelectItem),BI.SingleSelectRadioItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectRadioItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},hgap:10,height:24})},_init:function(){BI.SingleSelectRadioItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:16},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectRadioItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectRadioItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectRadioItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(v)}}),BI.SingleSelectRadioItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_radio_item",BI.SingleSelectRadioItem),BI.ArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.ArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-arrow-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){var self=this,o=this.options;BI.ArrowNode.superclass._init.apply(this,arguments),this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.ArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isOpened())},setText:function(text){BI.ArrowNode.superclass.setText.apply(this,arguments),this.text.setText(text)},setOpened:function(v){BI.ArrowNode.superclass.setOpened.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.arrow_group_node",BI.ArrowNode),BI.FirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.FirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-first-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.FirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.FirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.FirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.first_plus_group_node",BI.FirstPlusGroupNode),BI.IconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.IconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-icon-arrow-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24,iconHeight:12,iconWidth:12,iconCls:""})},_init:function(){BI.IconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.arrow_group_node_checkbox",width:24,stopPropagation:!0});var icon=BI.createWidget({type:"bi.icon_label",width:24,cls:o.iconCls,iconWidth:o.iconWidth,iconHeight:o.iconHeight});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:this.checkbox},{width:16,el:icon},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,rgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.IconArrowNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.IconArrowNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.icon_arrow_node",BI.IconArrowNode),BI.LastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.LastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-last-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.LastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.LastPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.LastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.last_plus_group_node",BI.LastPlusGroupNode),BI.MidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-mid-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.MidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.MidPlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.MidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.mid_plus_group_node",BI.MidPlusGroupNode),BI.MultiLayerIconArrowNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerIconArrowNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-icon-arrow-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24,iconHeight:16,iconWidth:16,iconCls:""})},_init:function(){BI.MultiLayerIconArrowNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.icon_arrow_node",iconCls:o.iconCls,cls:"bi-list-item-none",id:o.id,pId:o.pId,open:o.open,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var items=[];BI.count(0,o.layer,function(){items.push({type:"bi.layout",width:15,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,15),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerIconArrowNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerIconArrowNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_icon_arrow_node",BI.MultiLayerIconArrowNode),BI.PlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.PlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-plus-group-node bi-list-item",logic:{dynamic:!1},id:"",pId:"",open:!1,height:24})},_init:function(){BI.PlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.PlusGroupNode.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setOpened:function(v){BI.PlusGroupNode.superclass.setOpened.apply(this,arguments),this.checkbox&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.plus_group_node",BI.PlusGroupNode),BI.Switch=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-switch",height:22,width:44,logic:{dynamic:!1}},render:function(){var self=this;return{type:"bi.absolute",ref:function(){self.layout=this},items:[{el:{type:"bi.text_button",cls:"circle-button bi-card"},width:18,height:18,top:2,left:this.options.selected?24:2}]}},setSelected:function(v){BI.Switch.superclass.setSelected.apply(this,arguments),this.layout.attr("items")[0].left=v?24:2,this.layout.resize()},doClick:function(){BI.Switch.superclass.doClick.apply(this,arguments),this.fireEvent(BI.Switch.EVENT_CHANGE)}}),BI.Switch.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.switch",BI.Switch),BI.FirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.FirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"first-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.FirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(v){BI.FirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.first_tree_leaf_item",BI.FirstTreeLeafItem),BI.IconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.IconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},height:24,iconWidth:16,iconHeight:16,iconCls:""})},_init:function(){BI.IconTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options,icon=BI.createWidget({type:"bi.center_adapt",width:24,cls:o.iconCls,items:[{type:"bi.icon",width:o.iconWidth,height:o.iconHeight}]});this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:16,el:icon},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items,hgap:5}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.IconTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(v){BI.IconTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.icon_tree_leaf_item",BI.IconTreeLeafItem),BI.LastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.LastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"last-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.LastTreeLeafItem.superclass.doClick.apply(this,arguments)},setSelected:function(v){BI.LastTreeLeafItem.superclass.setSelected.apply(this,arguments)}}),BI.shortcut("bi.last_tree_leaf_item",BI.LastTreeLeafItem),BI.MidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",layer:0,height:24})},_init:function(){BI.MidTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.checkbox"}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,0===o.layer?"":{width:12,el:{type:"bi.layout",cls:o.pNode&&o.pNode.isLastNode?"":"base-line-conn-background",width:12,height:o.height}},{width:24,el:{type:"bi.layout",cls:"mid-line-conn-background",width:24,height:o.height}},{el:this.text});BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MidTreeLeafItem.superclass.doClick.apply(this,arguments),this.checkbox.setSelected(this.isSelected())},setSelected:function(v){BI.MidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.checkbox.setSelected(v)}}),BI.shortcut("bi.mid_tree_leaf_item",BI.MidTreeLeafItem),BI.MultiLayerIconTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerIconTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-icon-tree-leaf-item bi-list-item-active",layer:0,height:24,iconCls:"",iconHeight:16,iconWidth:16})},_init:function(){BI.MultiLayerIconTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.icon_tree_leaf_item",cls:"bi-list-item-none",iconCls:o.iconCls,id:o.id,pId:o.pId,isFront:!0,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,iconWidth:o.iconWidth,iconHeight:o.iconHeight}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});var items=[];BI.count(0,o.layer,function(){items.push({type:"bi.layout",width:15,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,15),items:[items]})},doRedMark:function(){this.item.doRedMark.apply(this.item,arguments)},unRedMark:function(){this.item.unRedMark.apply(this.item,arguments)},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerIconTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerIconTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)},getValue:function(){return this.options.value}}),BI.shortcut("bi.multilayer_icon_tree_leaf_item",BI.MultiLayerIconTreeLeafItem),BI.TreeTextLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.TreeTextLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-tree-text-leaf-item bi-list-item-active",id:"",pId:"",height:24,hgap:0,lgap:0,rgap:0})},_init:function(){BI.TreeTextLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,lgap:o.lgap,rgap:o.hgap,text:o.text,value:o.value,py:o.py}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text}]})},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId}}),BI.shortcut("bi.tree_text_leaf_item",BI.TreeTextLeafItem),BI.CalendarDateItem=BI.inherit(BI.BasicButton,{render:function(){var self=this,o=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",text:o.text,value:o.value,ref:function(){self.text=this}},left:o.lgap,right:o.rgap,top:0,bottom:0}]}},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},setSelected:function(b){BI.CalendarDateItem.superclass.setSelected.apply(this,arguments),this.text.setSelected(b)},getValue:function(){return this.text.getValue()}}),BI.shortcut("bi.calendar_date_item",BI.CalendarDateItem),BI.Calendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.Calendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-calendar",logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:2015,month:8,day:25})},_dateCreator:function(Y,M,D){var self=this,o=this.options,log={},De=BI.getDate(),mins=o.min.match(/\d+/g),maxs=o.max.match(/\d+/g);Y<(0|mins[0])&&(Y=0|mins[0]),Y>(0|maxs[0])&&(Y=0|maxs[0]),De.setFullYear(Y,M,D),log.ymd=[De.getFullYear(),De.getMonth(),De.getDate()];var MD=BI.Date._MD.slice(0);MD[1]=BI.isLeapYear(log.ymd[0])?29:28,De.setFullYear(log.ymd[0],log.ymd[1],1),log.FDay=De.getDay();var offSetFDay=(7-BI.StartOfWeek+log.FDay)%7;log.PDay=MD[0===M?11:M-1]-offSetFDay+1, +log.NDay=1;var items=[];return BI.each(BI.range(42),function(i){var td={},YY=log.ymd[0],MM=log.ymd[1]+1,DD;i=offSetFDay&&i=0?page%12:(12+page%12)%12;return{year:BI.getDate().getFullYear()+year,month:month+1}}}),BI.shortcut("bi.calendar",BI.Calendar),BI.YearCalendar=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.YearCalendar.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-year-calendar",behaviors:{},logic:{dynamic:!1},min:"1900-01-01",max:"2099-12-31",year:null})},_yearCreator:function(Y){var o=this.options;Y=0|Y;var start=BI.YearCalendar.getStartYear(Y),items=[],startDate=BI.parseDateTime(o.min,"%Y-%X-%d"),endDate=BI.parseDateTime(o.max,"%Y-%X-%d");return BI.each(BI.range(BI.YearCalendar.INTERVAL),function(i){var td={};BI.checkDateVoid(start+i,1,1,BI.print(BI.getDate(startDate.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(endDate.getFullYear(),0,1),"%Y-%X-%d"))[0]&&(td.disabled=!0),td.text=start+i,items.push(td)}),items},_init:function(){BI.YearCalendar.superclass._init.apply(this,arguments);var self=this,o=this.options;this.currentYear=BI.getDate().getFullYear();var years=this._yearCreator(o.year||this.currentYear),len=years.length,tyears=BI.makeArray(len,""),map=[0,6,1,7,2,8,3,9,4,10,5,11];BI.each(years,function(i,y){tyears[i]=years[map[i]]});var items=[];items.push(tyears.slice(0,2)),items.push(tyears.slice(2,4)),items.push(tyears.slice(4,6)),items.push(tyears.slice(6,8)),items.push(tyears.slice(8,10)),items.push(tyears.slice(10,12)),items=BI.map(items,function(i,item){return BI.map(item,function(j,td){return BI.extend(td,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"normal",once:!1,forceSelected:!0,height:24,width:45,value:td.text,disabled:td.disabled})})}),this.years=BI.createWidget({type:"bi.button_group",behaviors:o.behaviors,items:BI.createItems(items,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({},o.logic,{columns:2,rows:6,columnSize:[.5,.5],rowSize:24})),{type:"bi.center_adapt",vgap:1}]}),this.years.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend({},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this.years)}))))},isFrontYear:function(){var o=this.options,Y=o.year;return Y=0|Y,!!BI.checkDateVoid(BI.YearCalendar.getStartYear(Y)-1,1,1,o.min,o.max)[0]},isFinalYear:function(){var o=this.options,c=this._const,Y=o.year;return Y=0|Y,!!BI.checkDateVoid(BI.YearCalendar.getEndYear(Y)+1,1,1,o.min,o.max)[0]},setValue:function(val){this.years.setValue([val])},getValue:function(){return this.years.getValue()[0]}}),BI.extend(BI.YearCalendar,{INTERVAL:12,getStartYear:function(year){var cur=BI.getDate().getFullYear();return year-((year-cur+3)%BI.YearCalendar.INTERVAL+12)%BI.YearCalendar.INTERVAL},getEndYear:function(year){return BI.YearCalendar.getStartYear(year)+BI.YearCalendar.INTERVAL-1},getPageByYear:function(year){var cur=BI.getDate().getFullYear();return year=BI.YearCalendar.getStartYear(year),(year-cur+3)/BI.YearCalendar.INTERVAL}}),BI.shortcut("bi.year_calendar",BI.YearCalendar),BI.ArrowTreeGroupNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.ArrowTreeGroupNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-arrow-group-node-checkbox"})},setSelected:function(v){BI.ArrowTreeGroupNodeCheckbox.superclass.setSelected.apply(this,arguments),v?this.element.removeClass("expander-right-font").addClass("expander-down-font"):this.element.removeClass("expander-down-font").addClass("expander-right-font")}}),BI.shortcut("bi.arrow_group_node_checkbox",BI.ArrowTreeGroupNodeCheckbox),BI.CheckingMarkNode=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.CheckingMarkNode.superclass._defaultConfig.apply(this,arguments),{extraCls:"check-mark-font"})},_init:function(){BI.CheckingMarkNode.superclass._init.apply(this,arguments),this.setSelected(this.options.selected)},setSelected:function(v){BI.CheckingMarkNode.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("check-mark-font"):this.element.removeClass("check-mark-font")}}),BI.shortcut("bi.checking_mark_node",BI.CheckingMarkNode),BI.FirstTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.FirstTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type2",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.FirstTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type2"):this.element.removeClass("tree-expand-icon-type2")}}),BI.shortcut("bi.first_tree_node_checkbox",BI.FirstTreeNodeCheckbox),BI.LastTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.LastTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type4",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.LastTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type4"):this.element.removeClass("tree-expand-icon-type4")}}),BI.shortcut("bi.last_tree_node_checkbox",BI.LastTreeNodeCheckbox),BI.MidTreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.MidTreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type3",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.MidTreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v===!0?this.element.addClass("tree-expand-icon-type3"):this.element.removeClass("tree-expand-icon-type3")}}),BI.shortcut("bi.mid_tree_node_checkbox",BI.MidTreeNodeCheckbox),BI.TreeNodeCheckbox=BI.inherit(BI.IconButton,{_defaultConfig:function(){return BI.extend(BI.TreeNodeCheckbox.superclass._defaultConfig.apply(this,arguments),{extraCls:"tree-collapse-icon-type1",iconWidth:24,iconHeight:24})},setSelected:function(v){BI.TreeNodeCheckbox.superclass.setSelected.apply(this,arguments),v?this.element.addClass("tree-expand-icon-type1"):this.element.removeClass("tree-expand-icon-type1")}}),BI.shortcut("bi.tree_node_checkbox",BI.TreeNodeCheckbox),BI.CustomColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.CustomColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-custom-color-chooser",width:227,height:245})},_init:function(){BI.CustomColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.editor,{type:"bi.simple_color_picker_editor"}),this.editor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue())}),this.farbtastic=BI.createWidget({type:"bi.farbtastic"}),this.farbtastic.on(BI.Farbtastic.EVENT_CHANGE,function(){self.setValue(this.getValue())}),BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.absolute",items:[{el:this.editor,left:0,top:0,right:0}],height:30},{type:"bi.absolute",items:[{el:this.farbtastic,left:15,right:15,top:7}],height:215}]})},setValue:function(color){this.editor.setValue(color),this.farbtastic.setValue(color)},getValue:function(){return this.editor.getValue()}}),BI.CustomColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.custom_color_chooser",BI.CustomColorChooser),BI.ColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser",value:"",height:24})},_init:function(){BI.ColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:1,isNeedAdjustWidth:!1,isNeedAdjustHeight:!1,el:BI.extend({type:o.width<=24?"bi.color_chooser_trigger":"bi.long_color_chooser_trigger",ref:function(_ref){self.trigger=_ref},width:o.width-2,height:o.height-2},o.el),popup:{el:BI.extend({type:"bi.color_chooser_popup",ref:function(_ref){self.colorPicker=_ref},listeners:[{eventName:BI.ColorChooserPopup.EVENT_VALUE_CHANGE,action:function(){fn(),self._isRGBColor(self.colorPicker.getValue())||self.combo.hideView()}},{eventName:BI.ColorChooserPopup.EVENT_CHANGE,action:function(){fn(),self.combo.hideView()}}]},o.popup),width:230},value:o.value});var fn=function(){var color=self.colorPicker.getValue();self.trigger.setValue(color)};this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.ColorChooser.EVENT_CHANGE,arguments)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.ColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser",BI.ColorChooser),BI.ColorChooserPopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-color-chooser-popup",width:230,height:145,simple:!1},render:function(){var self=this,o=this.options;this.colorEditor=BI.createWidget(o.editor,{type:o.simple?"bi.simple_color_picker_editor":"bi.color_picker_editor",value:o.value,cls:"bi-header-background bi-border-bottom",height:30}),this.colorEditor.on(BI.ColorPickerEditor.EVENT_CHANGE,function(){self.setValue(this.getValue()),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,arguments)}),this.storeColors=BI.createWidget({type:"bi.color_picker",cls:"bi-border-bottom bi-border-right",items:[this._digestStoreColors(this._getStoreColors())],width:210,height:24,value:o.value}),this.storeColors.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.colorPicker=BI.createWidget({type:"bi.color_picker",width:210,height:50,value:o.value}),this.colorPicker.on(BI.ColorPicker.EVENT_CHANGE,function(){self.setValue(this.getValue()[0]),self._dealStoreColors(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}),this.customColorChooser=BI.createWidget({type:"bi.custom_color_chooser",editor:o.editor});var panel=BI.createWidget({type:"bi.popup_panel",buttons:[BI.i18nText("BI-Basic_Cancel"),BI.i18nText("BI-Basic_Save")],title:BI.i18nText("BI-Custom_Color"),el:this.customColorChooser,stopPropagation:!1,bgap:-1,rgap:1,lgap:1,minWidth:227});return this.more=BI.createWidget({type:"bi.combo",cls:"bi-border-top",container:null,direction:"right,top",isNeedAdjustHeight:!1,el:{type:"bi.text_item",cls:"color-chooser-popup-more bi-list-item",textAlign:"center",height:24,textLgap:10,text:BI.i18nText("BI-Basic_More")+"..."},popup:panel}),this.more.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self.customColorChooser.setValue(self.getValue())}),panel.on(BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.more.hideView();break;case 1:self.setValue(self.customColorChooser.getValue()),self._dealStoreColors(),self.more.hideView(),self.fireEvent(BI.ColorChooserPopup.EVENT_CHANGE,arguments)}}),{type:"bi.absolute",items:[{el:{type:"bi.vtape",items:[this.colorEditor,{el:{type:"bi.absolute",items:[{el:this.storeColors,left:10,right:10,top:5}]},height:29},{el:{type:"bi.absolute",items:[{el:this.colorPicker,left:10,right:10,top:5,bottom:5}]},height:60},{el:this.more,height:24}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"disable-mask",invisible:!o.disabled,ref:function(){self.mask=this}},left:0,right:0,top:0,bottom:0}]}},mounted:function(){var self=this,o=this.options;BI.isNotNull(o.value)&&this.setValue(o.value)},_setEnable:function(enable){BI.ColorChooserPopup.superclass._setEnable.apply(this,arguments),this.mask.setVisible(!enable)},_dealStoreColors:function(){var color=this.getValue(),colors=this._getStoreColors(),que=new BI.Queue(8);que.fromArray(colors),que.remove(color),que.unshift(color);var array=que.toArray();BI.Cache.setItem("colors",BI.array2String(array)),this.setStoreColors(array)},_digestStoreColors:function(colors){var items=BI.map(colors,function(i,color){return{value:color}});return BI.count(colors.length,8,function(i){items.push({value:"",disabled:!0})}),items},_getStoreColors:function(){var self=this,o=this.options,colorsArray=BI.string2Array(BI.Cache.getItem("colors")||"");return BI.filter(colorsArray,function(idx,color){return!o.simple||self._isRGBColor(color)})},_isRGBColor:function(color){return BI.isNotEmptyString(color)&&"transparent"!==color},setStoreColors:function(colors){BI.isArray(colors)&&this.storeColors.populate([this._digestStoreColors(colors)])},setValue:function(color){this.colorEditor.setValue(color),this.colorPicker.setValue(color),this.storeColors.setValue(color)},getValue:function(){return this.colorEditor.getValue()}}),BI.ColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.ColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_popup",BI.ColorChooserPopup),BI.SimpleColorChooserPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooserPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-chooser-popup"})},_init:function(){BI.SimpleColorChooserPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popup=BI.createWidget({type:"bi.color_chooser_popup",value:o.value,element:this,simple:!0}),this.popup.on(BI.ColorChooserPopup.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleColorChooserPopup.EVENT_CHANGE,arguments)}),this.popup.on(BI.ColorChooserPopup.EVENT_VALUE_CHANGE,function(){self.fireEvent(BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE,arguments)})},setStoreColors:function(colors){this.popup.setStoreColors(colors)},setValue:function(color){this.popup.setValue(color)},getValue:function(){return this.popup.getValue()}}),BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE="EVENT_VALUE_CHANGE",BI.SimpleColorChooserPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser_popup",BI.SimpleColorChooserPopup),BI.SimpleColorChooser=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleColorChooser.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-color-chooser",value:"#ffffff"})},_init:function(){BI.SimpleColorChooser.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.color_chooser",element:this,container:o.container,value:o.value,width:o.width,height:o.height,popup:{type:"bi.simple_color_chooser_popup"}}),this.combo.on(BI.ColorChooser.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleColorChooser.EVENT_CHANGE,arguments)})},isViewVisible:function(){return this.combo.isViewVisible()},hideView:function(){this.combo.hideView()},showView:function(){this.combo.showView()},setValue:function(color){this.combo.setValue(color)},getValue:function(){return this.combo.getValue()}}),BI.SimpleColorChooser.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_chooser",BI.SimpleColorChooser),BI.ColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var conf=BI.ColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.ColorChooserTrigger.superclass._init.apply(this,arguments),this.colorContainer=BI.createWidget({type:"bi.layout",cls:"color-chooser-trigger-content"+(BI.isIE9Below&&BI.isIE9Below()?" hack":"")});var down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:down,right:-1,bottom:1}]}),BI.isNotNull(this.options.value)&&this.setValue(this.options.value)},setValue:function(color){BI.ColorChooserTrigger.superclass.setValue.apply(this,arguments),""===color?this.colorContainer.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-background"):"transparent"===color?this.colorContainer.element.css("background-color","").removeClass("auto-color-background").addClass("trans-color-background"):this.colorContainer.element.css({"background-color":color}).removeClass("auto-color-background").removeClass("trans-color-background")}}),BI.ColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_chooser_trigger",BI.ColorChooserTrigger),BI.LongColorChooserTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){var conf=BI.LongColorChooserTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-chooser-trigger bi-border",height:22})},_init:function(){BI.LongColorChooserTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;this.colorContainer=BI.createWidget({type:"bi.htape",cls:"color-chooser-trigger-content",items:[{type:"bi.icon_change_button",ref:function(_ref){self.changeIcon=_ref},disableSelected:!0,iconCls:"auto-color-icon",width:24,iconWidth:16,iconHeight:16},{el:{type:"bi.label",ref:function(_ref){self.label=_ref},textAlign:"left",hgap:5,height:18,text:BI.i18nText("BI-Basic_Auto")}}]});var down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font icon-size-12",width:12,height:8});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.colorContainer,left:3,right:3,top:3,bottom:3},{el:down,right:3,bottom:3}]}),this.options.value&&this.setValue(this.options.value)},setValue:function(color){BI.LongColorChooserTrigger.superclass.setValue.apply(this,arguments),""===color?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("auto-color-icon"),this.label.setText(BI.i18nText("BI-Basic_Auto"))):"transparent"===color?(this.colorContainer.element.css("background-color",""),this.changeIcon.setVisible(!0),this.label.setVisible(!0),this.changeIcon.setIcon("trans-color-icon"),this.label.setText(BI.i18nText("BI-Transparent_Color"))):(this.colorContainer.element.css({"background-color":color}),this.changeIcon.setVisible(!1),this.label.setVisible(!1))}}),BI.LongColorChooserTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.long_color_chooser_trigger",BI.LongColorChooserTrigger),BI.ColorPickerButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.ColorPickerButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-color-picker-button bi-background bi-border-top bi-border-left"})},_init:function(){BI.ColorPickerButton.superclass._init.apply(this,arguments);var self=this,o=this.options;if(o.value){this.element.css("background-color",o.value);var name=this.getName();this.element.hover(function(){self._createMask(),self.isEnabled()&&BI.Maskers.show(name)},function(){self.isSelected()||BI.Maskers.hide(name)})}},_createMask:function(){var o=this.options,name=this.getName();if(this.isEnabled()&&!BI.Maskers.has(name)){var w=BI.Maskers.make(name,this,{offset:{left:-1,top:-1,right:-1,bottom:-1}});w.element.addClass("color-picker-button-mask").css("background-color",o.value)}},setSelected:function(b){BI.ColorPickerButton.superclass.setSelected.apply(this,arguments),b&&this._createMask(),BI.Maskers[b?"show":"hide"](this.getName())}}),BI.ColorPickerButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_button",BI.ColorPickerButton),BI.ColorPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.ColorPicker.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker",items:null})},_items:[[{value:"#ffffff"},{value:"#f2f2f2"},{value:"#e5e5e5"},{value:"#d9d9d9"},{value:"#cccccc"},{value:"#bfbfbf"},{value:"#b2b2b2"},{value:"#a6a6a6"},{value:"#999999"},{value:"#8c8c8c"},{value:"#808080"},{value:"#737373"},{value:"#666666"},{value:"#4d4d4d"},{value:"#333333"},{value:"#000000"}],[{value:"#d8b5a6"},{value:"#ff9e9a"},{value:"#ffc17d"},{value:"#f5e56b"},{value:"#d8e698"},{value:"#e0ebaf"},{value:"#c3d825"},{value:"#bce2e8"},{value:"#85d3cd"},{value:"#bce2e8"},{value:"#a0d8ef"},{value:"#89c3eb"},{value:"#bbc8e6"},{value:"#bbbcde"},{value:"#d6b4cc"},{value:"#fbc0d3"}],[{value:"#bb9581"},{value:"#f37d79"},{value:"#fba74f"},{value:"#ffdb4f"},{value:"#c7dc68"},{value:"#b0ca71"},{value:"#99ab4e"},{value:"#84b9cb"},{value:"#00a3af"},{value:"#2ca9e1"},{value:"#0095d9"},{value:"#4c6cb3"},{value:"#8491c3"},{value:"#a59aca"},{value:"#cc7eb1"},{value:"#e89bb4"}],[{value:"#9d775f"},{value:"#dd4b4b"},{value:"#ef8b07"},{value:"#fcc800"},{value:"#aacf53"},{value:"#82ae46"},{value:"#69821b"},{value:"#59b9c6"},{value:"#2a83a2"},{value:"#007bbb"},{value:"#19448e"},{value:"#274a78"},{value:"#4a488e"},{value:"#7058a3"},{value:"#884898"},{value:"#d47596"}]],_init:function(){BI.ColorPicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this.colors=BI.createWidget({type:"bi.button_group",element:this,items:BI.createItems(o.items||this._items,{type:"bi.color_picker_button",once:!1}),layouts:[{type:"bi.grid"}],value:o.value}),this.colors.on(BI.ButtonGroup.EVENT_CHANGE,function(){self.fireEvent(BI.ColorPicker.EVENT_CHANGE,arguments)})},populate:function(items){var args=[].slice.call(arguments);args[0]=BI.createItems(items,{type:"bi.color_picker_button",once:!1}),this.colors.populate.apply(this.colors,args)},setValue:function(color){this.colors.setValue(color)},getValue:function(){return this.colors.getValue()}}),BI.ColorPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker",BI.ColorPicker),BI.ColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.ColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.ColorPickerEditor.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this.constants;this.storeValue={},this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var RGB=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),checker=function(v){return BI.isNumeric(v)&&(0|v)>=0&&(0|v)<=255},Ws=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:checker,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:c.REB_WIDTH,height:20});BI.each(Ws,function(i,w){w.on(BI.TextEditor.EVENT_CHANGE,function(){self._checkEditors(),checker(self.storeValue.r)&&checker(self.storeValue.g)&&checker(self.storeValue.b)&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))})}),this.R=Ws[0],this.G=Ws[1],this.B=Ws[2],this.none=BI.createWidget({type:"bi.icon_button",cls:"auto-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Basic_Auto")}),this.none.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(self.lastColor=self.getValue(),self.setValue("")):self.setValue(self.lastColor||"#ffffff"),(self.R.isValid()&&self.G.isValid()&&self.B.isValid()||self._isEmptyRGB())&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),this.transparent=BI.createWidget({type:"bi.icon_button",cls:"trans-color-icon",width:16,height:16,iconWidth:16,iconHeight:16,title:BI.i18nText("BI-Transparent_Color")}),this.transparent.on(BI.IconButton.EVENT_CHANGE,function(){this.isSelected()?(self.lastColor=self.getValue(),self.setValue("transparent")):("transparent"===self.lastColor&&(self.lastColor=""),self.setValue(self.lastColor||"#ffffff")),(self.R.isValid()&&self.G.isValid()&&self.B.isValid()||self._isEmptyRGB())&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.ColorPickerEditor.EVENT_CHANGE))}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical_adapt",items:[{el:this.colorShow,width:16},{el:RGB[0],width:20},{el:this.R,width:c.REB_WIDTH},{el:RGB[1],width:20},{el:this.G,width:c.REB_WIDTH},{el:RGB[2],width:20},{el:this.B,width:c.REB_WIDTH},{el:this.transparent,width:16,lgap:5},{el:this.none,width:16,lgap:5}]},left:10,right:10,top:0,bottom:0}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0),this.storeValue={r:this.R.getValue()||0,g:this.G.getValue()||0,b:this.B.getValue()||0}},_isEmptyRGB:function(){return BI.isEmptyString(this.storeValue.r)&&BI.isEmptyString(this.storeValue.g)&&BI.isEmptyString(this.storeValue.b)},_showPreColor:function(color){""===color?this.colorShow.element.css("background-color","").removeClass("trans-color-background").addClass("auto-color-normal-background"):"transparent"===color?this.colorShow.element.css("background-color","").removeClass("auto-color-normal-background").addClass("trans-color-background"):this.colorShow.element.css({"background-color":color}).removeClass("auto-color-normal-background").removeClass("trans-color-background")},_setEnable:function(enable){BI.ColorPickerEditor.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled")},setValue:function(color){if("transparent"===color)return this.transparent.setSelected(!0),this.none.setSelected(!1),this._showPreColor("transparent"),this.R.setValue(""),this.G.setValue(""),this.B.setValue(""),void(this.storeValue={r:"",g:"",b:""});color?this.none.setSelected(!1):(color="",this.none.setSelected(!0)),this.transparent.setSelected(!1),this._showPreColor(color);var json=BI.DOM.rgb2json(BI.DOM.hex2rgb(color));this.storeValue={r:BI.isNull(json.r)?"":json.r,g:BI.isNull(json.r)?"":json.g,b:BI.isNull(json.r)?"":json.b},this.R.setValue(this.storeValue.r),this.G.setValue(this.storeValue.g),this.B.setValue(this.storeValue.b)},getValue:function(){return this._isEmptyRGB()&&this.transparent.isSelected()?"transparent":BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.storeValue.r,g:this.storeValue.g,b:this.storeValue.b}))}}),BI.ColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.color_picker_editor",BI.ColorPickerEditor),BI.SimpleColorPickerEditor=BI.inherit(BI.Widget,{constants:{REB_WIDTH:32},_defaultConfig:function(){return BI.extend(BI.SimpleColorPickerEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-color-picker-editor",height:30})},_init:function(){BI.SimpleColorPickerEditor.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this.constants;this.colorShow=BI.createWidget({type:"bi.layout",cls:"color-picker-editor-display bi-card bi-border",height:16,width:16});var RGB=BI.createWidgets(BI.createItems([{text:"R"},{text:"G"},{text:"B"}],{type:"bi.label",cls:"color-picker-editor-label",width:20,height:20})),checker=function(v){return BI.isNumeric(v)&&(0|v)>=0&&(0|v)<=255},Ws=BI.createWidgets([{},{},{}],{type:"bi.small_text_editor",cls:"color-picker-editor-input",validationChecker:checker,errorText:BI.i18nText("BI-Color_Picker_Error_Text"),allowBlank:!0,value:255,width:c.REB_WIDTH,height:20});BI.each(Ws,function(i,w){w.on(BI.TextEditor.EVENT_CHANGE,function(){self._checkEditors(),self.R.isValid()&&self.G.isValid()&&self.B.isValid()&&(self.colorShow.element.css("background-color",self.getValue()),self.fireEvent(BI.SimpleColorPickerEditor.EVENT_CHANGE))})}),this.R=Ws[0],this.G=Ws[1],this.B=Ws[2],BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.colorShow,width:16,lgap:20,rgap:15},{el:RGB[0],width:20},{el:this.R,width:c.REB_WIDTH},{el:RGB[1],width:20},{el:this.G,width:c.REB_WIDTH},{el:RGB[2],width:20},{el:this.B,width:c.REB_WIDTH}]})},_checkEditors:function(){BI.isEmptyString(this.R.getValue())&&this.R.setValue(0),BI.isEmptyString(this.G.getValue())&&this.G.setValue(0),BI.isEmptyString(this.B.getValue())&&this.B.setValue(0)},setValue:function(color){this.colorShow.element.css({"background-color":color});var json=BI.DOM.rgb2json(BI.DOM.hex2rgb(color));this.R.setValue(BI.isNull(json.r)?"":json.r),this.G.setValue(BI.isNull(json.g)?"":json.g),this.B.setValue(BI.isNull(json.b)?"":json.b)},getValue:function(){return BI.DOM.rgb2hex(BI.DOM.json2rgb({r:this.R.getValue(),g:this.G.getValue(),b:this.B.getValue()}))}}),BI.SimpleColorPickerEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_color_picker_editor",BI.SimpleColorPickerEditor),BI.Farbtastic=BI.inherit(BI.BasicButton,{constants:{RADIUS:84,SQUARE:100,WIDTH:194},props:{baseCls:"bi-farbtastic",width:195,height:195,stopPropagation:!0,value:"#000000"},render:function(){var self=this;return{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"",ref:function(_ref){self.colorWrapper=_ref}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"wheel", +ref:function(_ref){self.wheel=_ref}},left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout",cls:"overlay",ref:function(_ref){self.overlay=_ref}},top:47,left:47,width:101,height:101},{el:{type:"bi.layout",cls:"marker",ref:function(_ref){self.hMarker=_ref},scrollable:!1,width:17,height:17}},{el:{type:"bi.layout",cls:"marker",ref:function(_ref){self.slMarker=_ref},scrollable:!1,width:17,height:17}}]}},mounted:function(){var o=this.options;BI.isKey(o.value)&&this.setValue(o.value)},_unpack:function(color){return 7===color.length?[parseInt("0x"+color.substring(1,3))/255,parseInt("0x"+color.substring(3,5))/255,parseInt("0x"+color.substring(5,7))/255]:4===color.length?[parseInt("0x"+color.substring(1,2))/15,parseInt("0x"+color.substring(2,3))/15,parseInt("0x"+color.substring(3,4))/15]:void 0},_pack:function(rgb){var r=Math.round(255*rgb[0]),g=Math.round(255*rgb[1]),b=Math.round(255*rgb[2]);return"#"+(r<16?"0":"")+r.toString(16)+(g<16?"0":"")+g.toString(16)+(b<16?"0":"")+b.toString(16)},_setColor:function(color){var unpack=this._unpack(color);this.value!==color&&unpack&&(this.value=color,this.rgb=unpack,this.hsl=this._RGBToHSL(this.rgb),this._updateDisplay())},_setHSL:function(hsl){return this.hsl=hsl,this.rgb=this._HSLToRGB(hsl),this.value=this._pack(this.rgb),this._updateDisplay(),this},_HSLToRGB:function(hsl){var m1,m2,r,g,b,h=hsl[0],s=hsl[1],l=hsl[2];return m2=l<=.5?l*(s+1):l+s-l*s,m1=2*l-m2,[this._hueToRGB(m1,m2,h+.33333),this._hueToRGB(m1,m2,h),this._hueToRGB(m1,m2,h-.33333)]},_hueToRGB:function(m1,m2,h){return h=h<0?h+1:h>1?h-1:h,6*h<1?m1+(m2-m1)*h*6:2*h<1?m2:3*h<2?m1+(m2-m1)*(.66666-h)*6:m1},_RGBToHSL:function(rgb){var min,max,delta,h,s,l,r=rgb[0],g=rgb[1],b=rgb[2];return min=Math.min(r,Math.min(g,b)),max=Math.max(r,Math.max(g,b)),delta=max-min,l=(min+max)/2,s=0,l>0&&l<1&&(s=delta/(l<.5?2*l:2-2*l)),h=0,delta>0&&(max==r&&max!=g&&(h+=(g-b)/delta),max==g&&max!=b&&(h+=2+(b-r)/delta),max==b&&max!=r&&(h+=4+(r-g)/delta),h/=6),[h,s,l]},_updateDisplay:function(){var angle=6.28*this.hsl[0];this.hMarker.element.css({left:Math.round(Math.sin(angle)*this.constants.RADIUS+this.constants.WIDTH/2)+"px",top:Math.round(-Math.cos(angle)*this.constants.RADIUS+this.constants.WIDTH/2)+"px"}),this.slMarker.element.css({left:Math.round(this.constants.SQUARE*(.5-this.hsl[1])+this.constants.WIDTH/2)+"px",top:Math.round(this.constants.SQUARE*(.5-this.hsl[2])+this.constants.WIDTH/2)+"px"}),this.colorWrapper.element.css("backgroundColor",this._pack(this._HSLToRGB([this.hsl[0],1,.5]))),this.fireEvent(BI.Farbtastic.EVENT_CHANGE,this.getValue(),this)},_absolutePosition:function(el){var r={x:el.offsetLeft,y:el.offsetTop};if(el.offsetParent){var tmp=this._absolutePosition(el.offsetParent);r.x+=tmp.x,r.y+=tmp.y}return r},_widgetCoords:function(event){var x,y,el=event.target||event.srcElement,reference=this.wheel.element[0];if("undefined"!=typeof event.offsetX){for(var pos={x:event.offsetX,y:event.offsetY},e=el;e;)e.mouseX=pos.x,e.mouseY=pos.y,pos.x+=e.offsetLeft,pos.y+=e.offsetTop,e=e.offsetParent;for(var e=reference,offset={x:0,y:0};e;){if("undefined"!=typeof e.mouseX){x=e.mouseX-offset.x,y=e.mouseY-offset.y;break}offset.x+=e.offsetLeft,offset.y+=e.offsetTop,e=e.offsetParent}for(e=el;e;)e.mouseX=void 0,e.mouseY=void 0,e=e.offsetParent}else{var pos=this._absolutePosition(reference);x=(event.pageX||0)-pos.x,y=(event.pageY||0)-pos.y}return{x:x-this.constants.WIDTH/2,y:y-this.constants.WIDTH/2}},_doMouseMove:function(event){var pos=this._widgetCoords(event);if(this.circleDrag){var hue=Math.atan2(pos.x,-pos.y)/6.28;hue<0&&(hue+=1),this._setHSL([hue,this.hsl[1],this.hsl[2]])}else{var sat=Math.max(0,Math.min(1,-(pos.x/this.constants.SQUARE)+.5)),lum=Math.max(0,Math.min(1,-(pos.y/this.constants.SQUARE)+.5));this._setHSL([this.hsl[0],sat,lum])}},doClick:function(event){var pos=this._widgetCoords(event);return this.circleDrag=2*Math.max(Math.abs(pos.x),Math.abs(pos.y))>this.constants.SQUARE,this._doMouseMove(event),!1},setValue:function(color){this._setColor(color)},getValue:function(){return this.value}}),BI.Farbtastic.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.farbtastic",BI.Farbtastic),BI.BubbleCombo=BI.inherit(BI.Widget,{_const:{TRIANGLE_LENGTH:6},_defaultConfig:function(){return BI.extend(BI.BubbleCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-bubble-combo",trigger:"click",toggle:!0,direction:"bottom,left",isDefaultInit:!1,destroyWhenHide:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopPropagation:!1,adjustLength:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{}})},_init:function(){BI.BubbleCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.combo=BI.createWidget({type:"bi.combo",element:this,trigger:o.trigger,toggle:o.toggle,container:o.container,direction:o.direction,isDefaultInit:o.isDefaultInit,destroyWhenHide:o.destroyWhenHide,isNeedAdjustHeight:o.isNeedAdjustHeight,isNeedAdjustWidth:o.isNeedAdjustWidth,adjustLength:this._getAdjustLength(),stopPropagation:o.stopPropagation,adjustXOffset:0,adjustYOffset:0,hideChecker:o.hideChecker,offsetStyle:o.offsetStyle,el:o.el,popup:BI.extend({type:"bi.bubble_popup_view"},o.popup)}),this.combo.on(BI.Combo.EVENT_TRIGGER_CHANGE,function(){self.fireEvent(BI.BubbleCombo.EVENT_TRIGGER_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.fireEvent(BI.BubbleCombo.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_EXPAND,function(){self.fireEvent(BI.BubbleCombo.EVENT_EXPAND,arguments)}),this.combo.on(BI.Combo.EVENT_COLLAPSE,function(){self.fireEvent(BI.BubbleCombo.EVENT_COLLAPSE,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_INIT,function(){self.fireEvent(BI.BubbleCombo.EVENT_AFTER_INIT,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_POPUPVIEW,function(){self._showTriangle(),self.fireEvent(BI.BubbleCombo.EVENT_AFTER_POPUPVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){self._hideTriangle(),self.fireEvent(BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW,arguments)}),this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.fireEvent(BI.BubbleCombo.EVENT_AFTER_HIDEVIEW,arguments)})},_getAdjustLength:function(){return this._const.TRIANGLE_LENGTH+this.options.adjustLength},_createTriangle:function(direction){var pos={},op={},adjustLength=this.options.adjustLength,offset=this.element.offset(),left=offset.left,right=offset.left+this.element.outerWidth(),top=offset.top,bottom=offset.top+this.element.outerHeight();switch(direction){case"left":pos={top:top,height:this.element.outerHeight(),left:left-adjustLength-this._const.TRIANGLE_LENGTH},op={width:this._const.TRIANGLE_LENGTH};break;case"right":pos={top:top,height:this.element.outerHeight(),left:right+adjustLength},op={width:this._const.TRIANGLE_LENGTH};break;case"top":pos={left:left,width:this.element.outerWidth(),top:top-adjustLength-this._const.TRIANGLE_LENGTH},op={height:this._const.TRIANGLE_LENGTH};break;case"bottom":pos={left:left,width:this.element.outerWidth(),top:bottom+adjustLength},op={height:this._const.TRIANGLE_LENGTH}}this.triangle&&this.triangle.destroy(),this.triangle=BI.createWidget(op,{type:"bi.center_adapt",cls:"button-combo-triangle-wrapper",items:[{type:"bi.layout",cls:"bubble-combo-triangle-"+direction}]}),pos.el=this.triangle,BI.createWidget({type:"bi.absolute",element:this,items:[pos]})},_createLeftTriangle:function(){this._createTriangle("left")},_createRightTriangle:function(){this._createTriangle("right")},_createTopTriangle:function(){this._createTriangle("top")},_createBottomTriangle:function(){this._createTriangle("bottom")},_showTriangle:function(){var pos=this.combo.getPopupPosition();switch(pos.dir){case"left,top":case"left,bottom":this._createLeftTriangle();break;case"right,top":case"right,bottom":this._createRightTriangle();break;case"top,left":case"top,right":this._createTopTriangle();break;case"bottom,left":case"bottom,right":this._createBottomTriangle()}},_hideTriangle:function(){this.triangle&&this.triangle.destroy(),this.triangle=null},hideView:function(){this._hideTriangle(),this.combo&&this.combo.hideView()},showView:function(){this.combo&&this.combo.showView()},isViewVisible:function(){return this.combo.isViewVisible()}}),BI.BubbleCombo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.BubbleCombo.EVENT_CHANGE="EVENT_CHANGE",BI.BubbleCombo.EVENT_EXPAND="EVENT_EXPAND",BI.BubbleCombo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.BubbleCombo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.BubbleCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.BubbleCombo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.BubbleCombo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.BubbleCombo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut("bi.bubble_combo",BI.BubbleCombo),BI.BubblePopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var config=BI.BubblePopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(config,{baseCls:config.baseCls+" bi-bubble-popup-view",minWidth:220,maxWidth:300,minHeight:90})},_init:function(){BI.BubblePopupView.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.bubble_popup_view",BI.BubblePopupView),BI.BubblePopupBarView=BI.inherit(BI.BubblePopupView,{_defaultConfig:function(){return BI.extend(BI.BubblePopupBarView.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-bubble-bar-popup-view",buttons:[{value:!1,text:BI.i18nText("BI-Basic_Cancel"),ghost:!0},{text:BI.i18nText(BI.i18nText("BI-Basic_Sure")),value:!0}]})},_init:function(){BI.BubblePopupBarView.superclass._init.apply(this,arguments)},_createToolBar:function(){var o=this.options,self=this,items=[];return BI.each(o.buttons,function(i,buttonOpt){BI.isWidget(buttonOpt)?items.push(buttonOpt):items.push(BI.extend({type:"bi.button",height:24,handler:function(v){self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON,v)}},buttonOpt))}),BI.createWidget({type:"bi.center",height:44,rgap:15,items:[{type:"bi.right_vertical_adapt",lgap:10,items:items}]})},_createView:function(){var o=this.options,button=BI.createWidget({type:"bi.button_group",items:[o.el],layouts:[{type:"bi.vertical",cls:"bar-popup-container",hgap:15,tgap:10}]});return button.element.css("min-height",o.minHeight-44),button}}),BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.bubble_bar_popup_view",BI.BubblePopupBarView),BI.TextBubblePopupBarView=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-text-bubble-bar-popup-view",text:"",buttons:[{level:"ignore",value:!1,stopPropagation:!0,text:BI.i18nText("BI-Basic_Cancel")},{value:!0,stopPropagation:!0,text:BI.i18nText("BI-Basic_Sure")}]}},render:function(){var self=this,o=this.options,buttons=BI.map(o.buttons,function(index,buttonOpt){return BI.isWidget(buttonOpt)?buttonOpt:BI.extend({type:"bi.button",height:24,handler:function(v){self.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE,v)}},buttonOpt)});return{type:"bi.bubble_bar_popup_view",minWidth:o.minWidth,maxWidth:o.maxWidth,minHeight:o.minHeight,ref:function(){self.popup=this},el:{type:"bi.label",text:o.text,whiteSpace:"normal",textAlign:"left",ref:function(){self.text=this}},buttons:buttons}},populate:function(v){this.text.setText(v||this.options.text)}}),BI.TextBubblePopupBarView.EVENT_CHANGE="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.text_bubble_bar_popup_view",BI.TextBubblePopupBarView),BI.EditorIconCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.EditorIconCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseClass:"bi-check-editor-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:""})},_init:function(){BI.EditorIconCheckCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.editor_trigger",items:o.items,height:o.height,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,value:o.value}),this.trigger.on(BI.EditorTrigger.EVENT_CHANGE,function(){self.popup.setValue(this.getValue()),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.editorIconCheckCombo.hideView(),self.fireEvent(BI.EditorIconCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editorIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}})},setValue:function(v){this.editorIconCheckCombo.setValue(v)},getValue:function(){return this.trigger.getValue()},populate:function(items){this.options.items=items,this.editorIconCheckCombo.populate(items)}}),BI.EditorIconCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_icon_check_combo",BI.EditorIconCheckCombo),BI.IconCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-combo",width:24,height:24,el:{},popup:{},minWidth:100,maxWidth:"auto",maxHeight:300,direction:"bottom",adjustLength:3,adjustXOffset:0,adjustYOffset:0,offsetStyle:"left",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.icon_combo_trigger",iconCls:o.iconCls,title:o.title,items:o.items,width:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,value:o.value}),this.popup=BI.createWidget(o.popup,{type:"bi.icon_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.IconComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.iconCombo.hideView(),self.fireEvent(BI.IconCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.iconCombo=BI.createWidget({type:"bi.combo",element:this,direction:o.direction,trigger:o.trigger,container:o.container,adjustLength:o.adjustLength,adjustXOffset:o.adjustXOffset,adjustYOffset:o.adjustYOffset,offsetStyle:o.offsetStyle,el:this.trigger,popup:{el:this.popup,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth}})},showView:function(){this.iconCombo.showView()},hideView:function(){this.iconCombo.hideView()},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.iconCombo.populate(items)}}),BI.IconCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo",BI.IconCombo),BI.IconComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi.icon-combo-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.IconComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_icon_text_item",height:24}),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.IconComboPopup.EVENT_CHANGE,val,obj)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items){BI.IconComboPopup.superclass.populate.apply(this,arguments),items=BI.createItems(items,{type:"bi.single_select_icon_text_item",height:24}),this.popup.populate(items)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.IconComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_popup",BI.IconComboPopup),BI.IconComboTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconComboTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-icon-combo-trigger",el:{},items:[],iconCls:"",width:24,height:24,isShowDown:!0,value:""})},_init:function(){BI.IconComboTrigger.superclass._init.apply(this,arguments);var o=this.options,self=this,iconCls="";BI.isKey(o.value)&&(iconCls=this._digest(o.value,o.items)),this.button=BI.createWidget(o.el,{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:iconCls,disableSelected:!0,width:o.isShowDown?o.width-12:o.width,height:o.height,iconWidth:o.iconWidth,iconHeight:o.iconHeight,selected:BI.isNotEmptyString(iconCls)}),this.down=BI.createWidget({type:"bi.icon_button",disableSelected:!0,cls:"icon-combo-down-icon trigger-triangle-font font-size-12",width:12,height:8,selected:BI.isNotEmptyString(iconCls)}),this.down.setVisible(o.isShowDown),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.button,left:0,right:0,top:0,bottom:0},{el:this.down,right:3,bottom:0}]})},_digest:function(v,items){var iconCls="";return v=BI.isArray(v)?v[0]:v,BI.any(items,function(i,item){if(v===item.value)return iconCls=item.iconCls,!0}),iconCls},populate:function(items){var o=this.options;this.options.items=items||[],this.button.setIcon(o.iconCls),this.button.setSelected(!1),this.down.setSelected(!1)},setValue:function(v){BI.IconComboTrigger.superclass.setValue.apply(this,arguments);var o=this.options,iconCls=this._digest(v,this.options.items);v=BI.isArray(v)?v[0]:v,BI.isNotEmptyString(iconCls)?(this.button.setIcon(iconCls),this.button.setSelected(!0),this.down.setSelected(!0)):(this.button.setIcon(o.iconCls),this.button.setSelected(!1),this.down.setSelected(!1))}}),BI.IconComboTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_combo_trigger",BI.IconComboTrigger),BI.IconTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.IconTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-value-combo",height:24,iconHeight:null,iconWidth:null,value:"",attributes:{tabIndex:0}})},_init:function(){BI.IconTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_icon_text_trigger",cls:"icon-text-value-trigger",items:o.items,height:o.height,text:o.text,iconCls:o.iconCls,value:o.value,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth,title:o.title,warningTitle:o.warningTitle}),this.popup=BI.createWidget({type:"bi.icon_text_value_combo_popup",items:o.items,value:o.value,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth}),this.popup.on(BI.IconTextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCombo.hideView(),self.fireEvent(BI.IconTextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(o.value)&&this.setValue(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.trigger.options.tipType="warning",this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.options.tipType="success",this.element.removeClass("combo-error"))}},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v),this._checkError(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCombo.populate(items)}}),BI.IconTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo",BI.IconTextValueCombo),BI.IconTextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.IconTextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-text-icon-popup",behaviors:{redmark:function(){return!0}}})},_init:function(){BI.IconTextValueComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_icon_text_item",height:24,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:o.behaviors,value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.IconTextValueComboPopup.EVENT_CHANGE,val,obj)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items,keyword){BI.IconTextValueComboPopup.superclass.populate.apply(this,arguments);var o=this.options;items=BI.createItems(items,{type:"bi.single_select_icon_text_item",height:24,iconWrapperWidth:o.iconWrapperWidth,iconHeight:o.iconHeight,iconWidth:o.iconWidth}),this.popup.populate(items,keyword)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.IconTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.icon_text_value_combo_popup",BI.IconTextValueComboPopup),BI.SearchTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-search-text-value-combo",height:24,text:"",items:[],tipType:"",warningTitle:"",attributes:{tabIndex:0}},render:function(){var self=this,o=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.combo",container:o.container,adjustLength:2,toggle:!1,ref:function(){self.combo=this},el:{type:"bi.search_text_value_trigger",cls:"search-text-value-trigger",ref:function(){self.trigger=this},items:o.items,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.SearchTextValueTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},popup:{el:{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:o.value,items:o.items,ref:function(){self.popup=this,self.trigger.getSearcher().setAdapter(self.popup)},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.SearchTextValueCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:252,minHeight:25},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}},{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.fireEvent(BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length}},left:0,right:0,bottom:0,top:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(){self.triggerBtn=this},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}},mounted:function(){var o=this.options;BI.isKey(o.value)&&this._checkError(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.element.removeClass("combo-error").addClass("combo-error"),this.trigger.attr("tipType","warning")):(this.element.removeClass("combo-error"),this.trigger.attr("tipType","success"))}},populate:function(items){this.options.items=items,this.combo.populate(items)},setValue:function(v){this.combo.setValue(v),this._checkError(v)},getValue:function(){var value=this.combo.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]}}),BI.SearchTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SearchTextValueCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.search_text_value_combo",BI.SearchTextValueCombo),BI.SearchTextValueComboPopup=BI.inherit(BI.Pane,{props:{baseCls:"bi-search-text-value-popup"},render:function(){var self=this,o=this.options;return{type:"bi.vertical",vgap:5,items:[{type:"bi.button_group",ref:function(){self.popup=this},items:BI.createItems(o.items,{type:"bi.single_select_item",textAlign:o.textAlign,height:24}),chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,layouts:[{type:"bi.vertical"}],behaviors:{redmark:function(){return!0}},value:o.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.SearchTextValueComboPopup.EVENT_CHANGE,val,obj)}}]}]}},mounted:function(){this.check()},populate:function(find,match,keyword){var items=BI.concat(find,match);BI.SearchTextValueComboPopup.superclass.populate.apply(this,items),items=BI.createItems(items,{type:"bi.single_select_item",height:24}),this.popup.populate(items,keyword)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.SearchTextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_combo_popup",BI.SearchTextValueComboPopup),BI.SearchTextValueTrigger=BI.inherit(BI.Trigger,{props:{extraCls:"bi-search-text-value-trigger bi-border",height:24},render:function(){var self=this,o=this.options;return{type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value,o.items),value:o.value,height:o.height,tipText:""},popup:{type:"bi.search_text_value_combo_popup",cls:"bi-card",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE},onSearch:function(obj,callback){var keyword=obj.keyword,finding=BI.Func.getSearchResult(o.items,keyword),matched=finding.match,find=finding.find;callback(find,matched)},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.SearchTextValueTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]}},_setState:function(v){this.editor.setState(v)},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?result.join(","):BI.isFunction(o.text)?o.text():o.text},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items},setValue:function(vals){this._setState(this._digest(vals,this.options.items))},getValue:function(){return this.searcher.getValue()}}),BI.SearchTextValueTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchTextValueTrigger.EVENT_STOP="EVENT_STOP",BI.SearchTextValueTrigger.EVENT_START="EVENT_START",BI.SearchTextValueTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_text_value_trigger",BI.SearchTextValueTrigger),BI.TextValueCheckCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-check-combo",width:100,height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCheckCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:o.items,height:o.height,text:o.text,value:o.value}),this.popup=BI.createWidget({type:"bi.text_value_check_combo_popup",chooseType:o.chooseType,items:o.items,value:o.value}),this.popup.on(BI.TextValueCheckComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCheckCombo.hideView(),self.fireEvent(BI.TextValueCheckCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCheckCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:300}}),BI.isKey(o.value)&&this.setValue(o.value)},setTitle:function(title){this.trigger.setTitle(title)},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},setWarningTitle:function(title){this.trigger.setWarningTitle(title)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCheckCombo.populate(items)}}),BI.TextValueCheckCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo",BI.TextValueCheckCombo),BI.TextValueCheckComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueCheckComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueCheckComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:this._formatItems(o.items),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.TextValueCheckComboPopup.EVENT_CHANGE,val,obj)}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},_formatItems:function(items){return BI.map(items,function(i,item){return BI.extend({type:"bi.single_select_item",cls:"bi-list-item",height:24},item)})},populate:function(items){BI.TextValueCheckComboPopup.superclass.populate.apply(this,arguments),this.popup.populate(this._formatItems(items))},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.TextValueCheckComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_check_combo_popup",BI.TextValueCheckComboPopup),BI.TextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-combo",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,text:"",value:"",attributes:{tabIndex:0}})},_init:function(){BI.TextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",cls:"text-value-trigger",items:o.items,height:o.height,text:o.text,value:o.value,warningTitle:o.warningTitle}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:o.chooseType,value:o.value,items:o.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.textIconCombo.hideView(),self.fireEvent(BI.TextValueCombo.EVENT_CHANGE,arguments)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.textIconCombo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}}),BI.isKey(o.value)&&this._checkError(o.value)},_checkError:function(v){if(BI.isNotNull(v)){v=BI.isArray(v)?v:[v];var result=BI.find(this.options.items,function(idx,item){return BI.contains(v,item.value)});BI.isNull(result)?(this.trigger.setTipType("warning"),this.element.removeClass("combo-error").addClass("combo-error")):(this.trigger.setTipType("success"),this.element.removeClass("combo-error"))} +},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v),this._checkError(v)},getValue:function(){var value=this.popup.getValue();return BI.isNull(value)?[]:BI.isArray(value)?value:[value]},populate:function(items){this.options.items=items,this.textIconCombo.populate(items)}}),BI.TextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo",BI.TextValueCombo),BI.SmallTextValueCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SmallTextValueCombo.superclass._defaultConfig.apply(this,arguments),{width:100,height:20,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,el:{},text:""})},_init:function(){BI.SmallTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el,{type:"bi.small_select_text_trigger",items:o.items,height:o.height,text:o.text}),this.popup=BI.createWidget({type:"bi.text_value_combo_popup",chooseType:o.chooseType,items:o.items}),this.popup.on(BI.TextValueComboPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.SmallTextValueCombo.hideView(),self.fireEvent(BI.SmallTextValueCombo.EVENT_CHANGE)}),this.popup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.SmallTextValueCombo=BI.createWidget({type:"bi.combo",element:this,container:o.container,adjustLength:2,el:this.trigger,popup:{el:this.popup,maxHeight:240,minHeight:25}})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()},populate:function(items){this.options.items=items,this.SmallTextValueCombo.populate(items)}}),BI.SmallTextValueCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.small_text_value_combo",BI.SmallTextValueCombo),BI.TextValueComboPopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.TextValueComboPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-icon-popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE})},_init:function(){BI.TextValueComboPopup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.popup=BI.createWidget({type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.single_select_item",textAlign:o.textAlign,height:24}),chooseType:o.chooseType,layouts:[{type:"bi.vertical"}],value:o.value}),this.popup.on(BI.Controller.EVENT_CHANGE,function(type,val,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE,val,obj)}),this.check(),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.popup]})},populate:function(items){BI.TextValueComboPopup.superclass.populate.apply(this,arguments),items=BI.createItems(items,{type:"bi.single_select_item",height:24}),this.popup.populate(items)},getValue:function(){return this.popup.getValue()},setValue:function(v){this.popup.setValue(v)}}),BI.TextValueComboPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_combo_popup",BI.TextValueComboPopup),BI.ClearEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.ClearEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-clear-editor",height:24,errorText:"",watermark:"",validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){BI.ClearEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,watermark:o.watermark,allowBlank:!0,errorText:o.errorText,validationChecker:o.validationChecker,quitChecker:o.quitChecker,value:o.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"search-close-h-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(""),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),self.fireEvent(BI.ClearEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.ClearEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.ClearEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.ClearEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self._checkClear(),self.fireEvent(BI.ClearEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.ClearEditor.EVENT_KEY_DOWN,v)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.ClearEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){self.fireEvent(BI.ClearEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.ClearEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.ClearEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.ClearEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.ClearEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self._checkClear(),self.fireEvent(BI.ClearEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){self.fireEvent(BI.ClearEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.ClearEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.ClearEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.ClearEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.ClearEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.ClearEditor.EVENT_STOP)}),BI.isKey(o.value)?this.clear.visible():this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var res=this.editor.getValue().match(/[\S]+/g);return BI.isNull(res)?"":res[res.length-1]}},setValue:function(v){this.editor.setValue(v),BI.isKey(v)&&this.clear.visible()},isValid:function(){return this.editor.isValid()}}),BI.ClearEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ClearEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ClearEditor.EVENT_BLUR="EVENT_BLUR",BI.ClearEditor.EVENT_CLICK="EVENT_CLICK",BI.ClearEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ClearEditor.EVENT_SPACE="EVENT_SPACE",BI.ClearEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.ClearEditor.EVENT_CLEAR="EVENT_CLEAR",BI.ClearEditor.EVENT_START="EVENT_START",BI.ClearEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ClearEditor.EVENT_STOP="EVENT_STOP",BI.ClearEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ClearEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ClearEditor.EVENT_VALID="EVENT_VALID",BI.ClearEditor.EVENT_ERROR="EVENT_ERROR",BI.ClearEditor.EVENT_ENTER="EVENT_ENTER",BI.ClearEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ClearEditor.EVENT_REMOVE="EVENT_REMOVE",BI.ClearEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.clear_editor",BI.ClearEditor),BI.ShelterEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.ShelterEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-shelter-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,textAlign:"left"})},_init:function(){BI.ShelterEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"shelter-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:o.textAlign,height:o.height,hgap:o.hgap}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.text.on(BI.Controller.EVENT_CHANGE,function(){arguments[2]=self,self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.ShelterEditor.EVENT_CLICK_LABEL)}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.ShelterEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.ShelterEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.ShelterEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.ShelterEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.ShelterEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.ShelterEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.ShelterEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.ShelterEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.ShelterEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.ShelterEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText(),self.fireEvent(BI.ShelterEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.ShelterEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.ShelterEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.ShelterEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText(),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword)},_checkText:function(){var o=this.options;""===this.editor.getValue()?(this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setTextStyle:function(style){this.text.setStyle(style)},setValue:function(k){var o=this.options;this.editor.setValue(k),this._checkText(),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword)},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),BI.ShelterEditor.EVENT_CHANGE="EVENT_CHANGE",BI.ShelterEditor.EVENT_FOCUS="EVENT_FOCUS",BI.ShelterEditor.EVENT_BLUR="EVENT_BLUR",BI.ShelterEditor.EVENT_CLICK="EVENT_CLICK",BI.ShelterEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.ShelterEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.ShelterEditor.EVENT_START="EVENT_START",BI.ShelterEditor.EVENT_PAUSE="EVENT_PAUSE",BI.ShelterEditor.EVENT_STOP="EVENT_STOP",BI.ShelterEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.ShelterEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.ShelterEditor.EVENT_VALID="EVENT_VALID",BI.ShelterEditor.EVENT_ERROR="EVENT_ERROR",BI.ShelterEditor.EVENT_ENTER="EVENT_ENTER",BI.ShelterEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.ShelterEditor.EVENT_SPACE="EVENT_SPACE",BI.ShelterEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.shelter_editor",BI.ShelterEditor),BI.SignEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-sign-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24})},_init:function(){BI.SignEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:o.title,warningTitle:o.warningTitle,tipType:o.tipType,textAlign:"left",height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SignEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SignEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SignEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SignEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SignEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SignEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SignEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SignEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SignEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SignEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SignEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText(),self.fireEvent(BI.SignEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SignEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SignEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.SignEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText()},_checkText:function(){var o=this.options;BI.nextTick(BI.bind(function(){""===this.editor.getValue()?(this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark")):(this.text.setValue(this.editor.getValue()),this.text.element.removeClass("bi-water-mark"),BI.isKey(o.keyword)&&this.text.doRedMark(o.keyword))},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){this._showHint(),this.text.setValue(v)}}),BI.SignEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SignEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SignEditor.EVENT_BLUR="EVENT_BLUR",BI.SignEditor.EVENT_CLICK="EVENT_CLICK",BI.SignEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SignEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SignEditor.EVENT_START="EVENT_START",BI.SignEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SignEditor.EVENT_STOP="EVENT_STOP",BI.SignEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignEditor.EVENT_VALID="EVENT_VALID",BI.SignEditor.EVENT_ERROR="EVENT_ERROR",BI.SignEditor.EVENT_ENTER="EVENT_ENTER",BI.SignEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SignEditor.EVENT_SPACE="EVENT_SPACE",BI.SignEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.sign_editor",BI.SignEditor),BI.StateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!0,watermark:"",errorText:"",height:24,defaultText:"",text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.StateEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark tip-text-style",textAlign:"left",height:o.height,text:o.text,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.setValue("")},title:BI.isNotNull(o.tipText)?o.tipText:function(){var title="";return BI.isString(self.stateValue)&&(title=self.stateValue),BI.isArray(self.stateValue)&&1===self.stateValue.length&&(title=self.stateValue[0]),title},warningTitle:o.warningTitle,tipType:o.tipType}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.StateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.StateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.StateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.StateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.StateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.StateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.StateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self.fireEvent(BI.StateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self.fireEvent(BI.StateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.StateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.StateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.StateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.StateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.StateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.StateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.StateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.StateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(o.text)&&this.setState(o.text)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this.options.disabled===!1&&(this._showInput(),this.editor.focus())},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(v){var o=this.options;return BI.StateEditor.superclass.setValue.apply(this,arguments),this.stateValue=v,BI.isNumber(v)?void(v===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Select_All")),this.text.element.removeClass("bi-water-mark")):v===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(BI.isKey(o.defaultText)?o.defaultText:o.text),BI.isKey(o.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):BI.isString(v)?(this.text.setText(v),void(BI.isKey(o.defaultText)&&o.defaultText===v?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark"))):void(BI.isArray(v)&&(BI.isEmpty(v)?(this.text.setText(BI.isKey(o.defaultText)?o.defaultText:o.text),BI.isKey(o.defaultText)?this.text.element.addClass("bi-water-mark"):this.text.element.removeClass("bi-water-mark")):1===v.length?(this.text.setText(v[0]),this.text.element.removeClass("bi-water-mark")):(this.text.setText(BI.i18nText("BI-Select_Part")),this.text.element.removeClass("bi-water-mark"))))},setTipType:function(v){this.text.options.tipType=v}}),BI.StateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.StateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.StateEditor.EVENT_BLUR="EVENT_BLUR",BI.StateEditor.EVENT_CLICK="EVENT_CLICK",BI.StateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.StateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.StateEditor.EVENT_START="EVENT_START",BI.StateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.StateEditor.EVENT_STOP="EVENT_STOP",BI.StateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.StateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.StateEditor.EVENT_VALID="EVENT_VALID",BI.StateEditor.EVENT_ERROR="EVENT_ERROR",BI.StateEditor.EVENT_ENTER="EVENT_ENTER",BI.StateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.StateEditor.EVENT_SPACE="EVENT_SPACE",BI.StateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.state_editor",BI.StateEditor),BI.SimpleStateEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SimpleStateEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-simple-state-editor",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,mouseOut:!1,allowBlank:!0,watermark:"",errorText:"",height:24,text:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){BI.SimpleStateEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.text=BI.createWidget({type:"bi.text_button",cls:"bi-water-mark",textAlign:"left",text:o.text,height:o.height,hgap:o.hgap,handler:function(){self._showInput(),self.editor.focus(),self.editor.setValue("")}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_FOCUS,arguments)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_BLUR,arguments)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CLICK,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SimpleStateEditor.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_VALID,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self.fireEvent(BI.SimpleStateEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self.fireEvent(BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_START,arguments)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_PAUSE,arguments)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_STOP,arguments)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_SPACE,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_ENTER,arguments)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_RESTRICT,arguments)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self.fireEvent(BI.SimpleStateEditor.EVENT_EMPTY,arguments)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),BI.isNotNull(o.text)&&this.setState(o.text)},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint()},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(k){this.editor.setValue(k)},getValue:function(){return this.editor.getValue()},getState:function(){return this.editor.getValue().match(/[^\s]+/g)},setState:function(v){var o=this.options;return BI.SimpleStateEditor.superclass.setValue.apply(this,arguments),BI.isNumber(v)?void(v===BI.Selection.All?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):v===BI.Selection.Multi?(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(o.text),this.text.element.addClass("bi-water-mark"))):void(BI.isArray(v)&&1!==v.length?BI.isEmpty(v)?(this.text.setText(o.text),this.text.element.addClass("bi-water-mark")):(this.text.setText(BI.i18nText("BI-Already_Selected")),this.text.element.removeClass("bi-water-mark")):(this.text.setText(v),this.text.setTitle(v),this.text.element.removeClass("bi-water-mark")))}}),BI.SimpleStateEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SimpleStateEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SimpleStateEditor.EVENT_BLUR="EVENT_BLUR",BI.SimpleStateEditor.EVENT_CLICK="EVENT_CLICK",BI.SimpleStateEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SimpleStateEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.SimpleStateEditor.EVENT_START="EVENT_START",BI.SimpleStateEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SimpleStateEditor.EVENT_STOP="EVENT_STOP",BI.SimpleStateEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SimpleStateEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SimpleStateEditor.EVENT_VALID="EVENT_VALID",BI.SimpleStateEditor.EVENT_ERROR="EVENT_ERROR",BI.SimpleStateEditor.EVENT_ENTER="EVENT_ENTER",BI.SimpleStateEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SimpleStateEditor.EVENT_SPACE="EVENT_SPACE",BI.SimpleStateEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.simple_state_editor",BI.SimpleStateEditor), +BI.MultiPopupView=BI.inherit(BI.PopupView,{_defaultConfig:function(){var conf=BI.MultiPopupView.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{_baseCls:(conf._baseCls||"")+" bi-multi-list-view",buttons:[BI.i18nText("BI-Basic_Sure")]})},_init:function(){BI.MultiPopupView.superclass._init.apply(this,arguments)},_createToolBar:function(){var o=this.options,self=this;if(0!==o.buttons.length){var text=[];return BI.each(o.buttons,function(idx,item){text.push({text:item,value:idx})}),this.buttongroup=BI.createWidget({type:"bi.button_group",cls:"list-view-toolbar bi-high-light bi-split-top",height:24,items:BI.createItems(text,{type:"bi.text_button",once:!1,shadow:!0,isShadowShowingOnSelected:!0}),layouts:[{type:"bi.center",hgap:0,vgap:0}]}),this.buttongroup.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,value,obj)}),this.buttongroup}}}),BI.MultiPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.multi_popup_view",BI.MultiPopupView),BI.PopupPanel=BI.inherit(BI.MultiPopupView,{_defaultConfig:function(){var conf=BI.PopupPanel.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-popup-panel",title:""})},_init:function(){BI.PopupPanel.superclass._init.apply(this,arguments)},_createTool:function(){var self=this,o=this.options,close=BI.createWidget({type:"bi.icon_button",cls:"close-h-font",width:25,height:25});return close.on(BI.IconButton.EVENT_CHANGE,function(){self.setVisible(!1),self.fireEvent(BI.PopupPanel.EVENT_CLOSE)}),BI.createWidget({type:"bi.htape",cls:"popup-panel-title bi-header-background",height:25,items:[{el:{type:"bi.label",textAlign:"left",text:o.title,height:25,lgap:10}},{el:close,width:25}]})}}),BI.PopupPanel.EVENT_CHANGE="EVENT_CHANGE",BI.PopupPanel.EVENT_CLOSE="EVENT_CLOSE",BI.PopupPanel.EVENT_CLICK_TOOLBAR_BUTTON="EVENT_CLICK_TOOLBAR_BUTTON",BI.shortcut("bi.popup_panel",BI.PopupPanel),BI.ListPane=BI.inherit(BI.Pane,{_defaultConfig:function(){var conf=BI.ListPane.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-list-pane",logic:{dynamic:!0},lgap:0,rgap:0,tgap:0,bgap:0,vgap:0,hgap:0,items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.button_group"}})},_init:function(){BI.ListPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button_group=BI.createWidget(o.el,{type:"bi.button_group",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{},items:o.items,itemsCreator:function(op,calback){1===op.times&&(self.empty(),BI.nextTick(function(){self.loading()})),o.itemsCreator(op,function(){calback.apply(self,arguments),1===op.times&&BI.nextTick(function(){self.loaded(),self.check()})})},hasNext:o.hasNext,layouts:[{type:"bi.vertical"}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.ListPane.EVENT_CHANGE,value,obj)}),this.check(),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,vgap:o.vgap,hgap:o.hgap},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)}))))},hasPrev:function(){return this.button_group.hasPrev&&this.button_group.hasPrev()},hasNext:function(){return this.button_group.hasNext&&this.button_group.hasNext()},prependItems:function(items){this.options.items=items.concat(this.options.items),this.button_group.prependItems.apply(this.button_group,arguments),this.check()},addItems:function(items){this.options.items=this.options.items.concat(items),this.button_group.addItems.apply(this.button_group,arguments),this.check()},removeItemAt:function(indexes){indexes=indexes||[],BI.removeAt(this.options.items,indexes),this.button_group.removeItemAt.apply(this.button_group,arguments),this.check()},populate:function(items){var self=this,o=this.options;return 0===arguments.length&&BI.isFunction(this.button_group.attr("itemsCreator"))?void this.button_group.attr("itemsCreator").apply(this,[{times:1},function(){if(0===arguments.length)throw new Error("参数不能为空");self.populate.apply(self,arguments)}]):(BI.ListPane.superclass.populate.apply(this,arguments),void this.button_group.populate.apply(this.button_group,arguments))},empty:function(){this.button_group.empty()},setNotSelectedValue:function(){this.button_group.setNotSelectedValue.apply(this.button_group,arguments)},getNotSelectedValue:function(){return this.button_group.getNotSelectedValue()},setValue:function(){this.button_group.setValue.apply(this.button_group,arguments)},getValue:function(){return this.button_group.getValue.apply(this.button_group,arguments)},getAllButtons:function(){return this.button_group.getAllButtons()},getAllLeaves:function(){return this.button_group.getAllLeaves()},getSelectedButtons:function(){return this.button_group.getSelectedButtons()},getNotSelectedButtons:function(){return this.button_group.getNotSelectedButtons()},getIndexByValue:function(value){return this.button_group.getIndexByValue(value)},getNodeById:function(id){return this.button_group.getNodeById(id)},getNodeByValue:function(value){return this.button_group.getNodeByValue(value)}}),BI.ListPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_pane",BI.ListPane),BI.Panel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Panel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-panel bi-border",title:"",titleButtons:[],el:{},logic:{dynamic:!1}})},_init:function(){BI.Panel.superclass._init.apply(this,arguments);var o=this.options;BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("top",this._createTitle(),this.options.el)}))))},_createTitle:function(){var self=this,o=this.options;return this.text=BI.createWidget({type:"bi.label",cls:"panel-title-text",text:o.title,height:30}),this.button_group=BI.createWidget({type:"bi.button_group",items:o.titleButtons,layouts:[{type:"bi.center_adapt",lgap:10}]}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.Panel.EVENT_CHANGE,value,obj)}),{el:{type:"bi.left_right_vertical_adapt",cls:"panel-title bi-header-background bi-border-bottom",height:29,items:{left:[this.text],right:[this.button_group]},lhgap:10,rhgap:10},height:29}},setTitle:function(title){this.text.setValue(title)}}),BI.Panel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.panel",BI.Panel),BI.LinearSegmentButton=BI.inherit(BI.BasicButton,{props:{extraCls:"bi-line-segment-button bi-list-item-effect",once:!0,readonly:!0,hgap:10,height:25},render:function(){var self=this,o=this.options;return[{type:"bi.label",text:o.text,height:o.height,value:o.value,hgap:o.hgap,ref:function(){self.text=this}},{type:"bi.absolute",items:[{el:{type:"bi.layout",cls:"line-segment-button-line",height:2,ref:function(){self.line=this}},left:0,right:0,bottom:0}]}]},setSelected:function(v){BI.LinearSegmentButton.superclass.setSelected.apply(this,arguments),v?this.line.element.addClass("bi-high-light-background"):this.line.element.removeClass("bi-high-light-background")},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.linear_segment_button",BI.LinearSegmentButton),BI.LinearSegment=BI.inherit(BI.Widget,{props:{baseCls:"bi-linear-segment bi-split-bottom",items:[],height:29},render:function(){var self=this,o=this.options;return{type:"bi.button_group",items:BI.createItems(o.items,{type:"bi.linear_segment_button",height:o.height-1}),layout:[{type:"bi.center"}],listeners:[{eventName:"__EVENT_CHANGE__",action:function(){self.fireEvent("__EVENT_CHANGE__",arguments)}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.buttonGroup=this}}},setValue:function(v){this.buttonGroup.setValue(v)},setEnabledValue:function(v){this.buttonGroup.setEnabledValue(v)},getValue:function(){return this.buttonGroup.getValue()}}),BI.shortcut("bi.linear_segment",BI.LinearSegment),BI.SelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,toolbar:{type:"bi.multi_select_bar",iconWrapperWidth:36},el:{type:"bi.list_pane"}})},_init:function(){BI.SelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.toolbar=BI.createWidget(o.toolbar),this.allSelected=!1,this.toolbar.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){self.allSelected=this.isSelected(),type===BI.Events.CLICK&&(self.setAllSelected(self.allSelected),self.fireEvent(BI.SelectList.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.list=BI.createWidget(o.el,{type:"bi.list_pane",items:o.items,itemsCreator:function(op,callback){1===op.times&&self.toolbar.setVisible(!1),o.itemsCreator(op,function(items){callback.apply(self,arguments),1===op.times&&(self.toolbar.setVisible(items&&items.length>0),self.toolbar.setEnable(self.isEnabled()&&items&&items.length>0)),self._checkAllSelected()})},onLoaded:o.onLoaded,hasNext:o.hasNext}),this.list.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&(self._checkAllSelected(),self.fireEvent(BI.SelectList.EVENT_CHANGE,value,obj)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(o.direction,this.toolbar,this.list)})))),o.items.length<=0&&(this.toolbar.setVisible(!1),this.toolbar.setEnable(!1)),BI.isNotNull(o.value)&&this.setValue(o.value)},_checkAllSelected:function(){var selectLength=this.list.getValue().length,notSelectLength=this.getAllLeaves().length-selectLength,hasNext=this.list.hasNext(),isAlreadyAllSelected=this.toolbar.isSelected(),isHalf=selectLength>0&&(notSelectLength>0||!isAlreadyAllSelected&&hasNext);isHalf=isHalf||notSelectLength>0&&hasNext&&isAlreadyAllSelected,this.toolbar.setHalfSelected(isHalf),!isHalf&&this.toolbar.setSelected(selectLength>0&¬SelectLength<=0&&(!hasNext||isAlreadyAllSelected))},setAllSelected:function(v){BI.each(this.getAllButtons(),function(i,btn){(btn.setSelected||btn.setAllSelected).apply(btn,[v])}),this.allSelected=!!v,this.toolbar.setSelected(v),this.toolbar.setHalfSelected(!1)},setToolBarVisible:function(b){this.toolbar.setVisible(b)},isAllSelected:function(){return this.allSelected},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(data){var selectAll=data.type===BI.ButtonGroup.CHOOSE_TYPE_ALL;this.setAllSelected(selectAll),this.list[selectAll?"setNotSelectedValue":"setValue"](data.value),this._checkAllSelected()},getValue:function(){return this.isAllSelected()===!1?{type:BI.ButtonGroup.CHOOSE_TYPE_MULTI,value:this.list.getValue(),assist:this.list.getNotSelectedValue()}:{type:BI.ButtonGroup.CHOOSE_TYPE_ALL,value:this.list.getNotSelectedValue(),assist:this.list.getValue()}},empty:function(){this.list.empty()},populate:function(items){this.toolbar.setVisible(!BI.isEmptyArray(items)),this.toolbar.setEnable(this.isEnabled()&&!BI.isEmptyArray(items)),this.list.populate.apply(this.list,arguments),this._checkAllSelected()},_setEnable:function(enable){BI.SelectList.superclass._setEnable.apply(this,arguments),this.toolbar.setEnable(enable)},resetHeight:function(h){var toolHeight=(this.toolbar.element.outerHeight()||25)*(this.toolbar.isVisible()?1:0);this.list.resetHeight?this.list.resetHeight(h-toolHeight):this.list.element.css({"max-height":h-toolHeight+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments),this._checkAllSelected()},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),BI.SelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_list",BI.SelectList),BI.LazyLoader=BI.inherit(BI.Widget,{_const:{PAGE:100},_defaultConfig:function(){return BI.extend(BI.LazyLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-lazy-loader",el:{}})},_init:function(){var self=this,o=this.options;BI.LazyLoader.superclass._init.apply(this,arguments);var all=o.items.length;this.loader=BI.createWidget({type:"bi.loader",element:this,el:o.el,itemsCreator:function(options,populate){populate(self._getNextItems(options))},hasNext:function(option){return option.count=1),this.setPagerVisible(v>1)},setValue:function(v){this.pager.setValue(v)},setVPage:function(v){this.pager.setValue(v)},setCount:function(count){this.rowCount.setText(count),this.rowCount.setTitle(count)},getCurrentPage:function(){return this.pager.getCurrentPage()},hasPrev:function(){return this.pager.hasPrev()},hasNext:function(){return this.pager.hasNext()},setPagerVisible:function(b){this.editor.setVisible(b),this.allPages.setVisible(b),this.pager.setVisible(b)},populate:function(){this.pager.populate(),this.setPagerVisible(this.options.pages>1)}}),BI.AllCountPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_count_pager",BI.AllCountPager),BI.DirectionPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DirectionPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-direction-pager",height:24,horizontal:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn},vertical:{pages:!1,curr:1,hasPrev:BI.emptyFn,hasNext:BI.emptyFn,firstPage:1,lastPage:BI.emptyFn}})},_init:function(){BI.DirectionPager.superclass._init.apply(this,arguments);var self=this,o=this.options,v=o.vertical,h=o.horizontal;this._createVPager(),this._createHPager(),this.layout=BI.createWidget({type:"bi.absolute",scrollable:!1,element:this,items:[{el:this.vpager,top:0,right:86},{el:this.vlabel,top:0,right:110},{el:this.hpager,top:0,right:0},{el:this.hlabel,top:0,right:24}]})},_createVPager:function(){var self=this,o=this.options,v=o.vertical;this.vlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:v.curr,title:v.curr,invisible:!0}),this.vpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:v.pages,curr:v.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Up_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev column-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Down_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next column-next-page-h-font bi-list-item-select2"},hasPrev:v.hasPrev,hasNext:v.hasNext,firstPage:v.firstPage,lastPage:v.lastPage}),this.vpager.on(BI.Pager.EVENT_CHANGE,function(){self.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.vpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){self.vlabel.setValue(this.getCurrentPage()),self.vlabel.setTitle(this.getCurrentPage())})},_createHPager:function(){var self=this,o=this.options,h=o.horizontal;this.hlabel=BI.createWidget({type:"bi.label",width:24,height:24,value:h.curr,title:h.curr,invisible:!0}),this.hpager=BI.createWidget({type:"bi.pager",width:72,layouts:[{type:"bi.horizontal",scrollx:!1,rgap:24}],invisible:!0,dynamicShow:!1,pages:h.pages,curr:h.curr,groups:0,first:!1,last:!1,prev:{type:"bi.icon_button",value:"prev",title:BI.i18nText("BI-Left_Page"),warningTitle:BI.i18nText("BI-Current_Is_First_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-prev row-pre-page-h-font bi-list-item-select2"},next:{type:"bi.icon_button",value:"next",title:BI.i18nText("BI-Right_Page"),warningTitle:BI.i18nText("BI-Current_Is_Last_Page"),height:22,width:22,cls:"bi-border bi-border-radius direction-pager-next row-next-page-h-font bi-list-item-select2"},hasPrev:h.hasPrev,hasNext:h.hasNext,firstPage:h.firstPage,lastPage:h.lastPage}),this.hpager.on(BI.Pager.EVENT_CHANGE,function(){self.fireEvent(BI.DirectionPager.EVENT_CHANGE)}),this.hpager.on(BI.Pager.EVENT_AFTER_POPULATE,function(){self.hlabel.setValue(this.getCurrentPage()),self.hlabel.setTitle(this.getCurrentPage())})},getVPage:function(){return this.vpager.getCurrentPage()},getHPage:function(){return this.hpager.getCurrentPage()},setVPage:function(v){this.vpager.setValue(v),this.vlabel.setValue(v),this.vlabel.setTitle(v)},setHPage:function(v){this.hpager.setValue(v),this.hlabel.setValue(v),this.hlabel.setTitle(v)},hasVNext:function(){return this.vpager.hasNext()},hasHNext:function(){return this.hpager.hasNext()},hasVPrev:function(){return this.vpager.hasPrev()},hasHPrev:function(){return this.hpager.hasPrev()},setHPagerVisible:function(b){this.hpager.setVisible(b),this.hlabel.setVisible(b)},setVPagerVisible:function(b){this.vpager.setVisible(b),this.vlabel.setVisible(b)},populate:function(){this.vpager.populate(),this.hpager.populate();var vShow=!1,hShow=!1;this.hasHNext()||this.hasHPrev()?(this.setHPagerVisible(!0),hShow=!0):this.setHPagerVisible(!1),this.hasVNext()||this.hasVPrev()?(this.setVPagerVisible(!0),vShow=!0):this.setVPagerVisible(!1),this.setVisible(hShow||vShow);var num=[86,110,0,24],items=this.layout.attr("items");vShow===!0&&hShow===!0?(items[0].right=num[0],items[1].right=num[1],items[2].right=num[2],items[3].right=num[3]):vShow===!0?(items[0].right=num[2],items[1].right=num[3]):hShow===!0&&(items[2].right=num[2],items[3].right=num[3]),this.layout.attr("items",items),this.layout.resize()},clear:function(){this.vpager.attr("curr",1),this.hpager.attr("curr",1)}}),BI.DirectionPager.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.direction_pager",BI.DirectionPager),BI.DetailPager=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DetailPager.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-detail-pager",behaviors:{},layouts:[{type:"bi.horizontal",hgap:10,vgap:0}],dynamicShow:!0,dynamicShowFirstLast:!1,dynamicShowPrevNext:!1,pages:!1,curr:function(){return 1},groups:0,jump:BI.emptyFn,first:!1,last:!1,prev:"上一页",next:"下一页",firstPage:1,lastPage:function(){return 1},hasPrev:BI.emptyFn,hasNext:BI.emptyFn})},_init:function(){BI.DetailPager.superclass._init.apply(this,arguments);var self=this;this.currPage=BI.result(this.options,"curr"),this._lock=!1,this._debouce=BI.debounce(function(){self._lock=!1},300),this._populate()},_populate:function(){var self=this,o=this.options,view=[],dict={};this.empty();var pages=BI.result(o,"pages"),curr=BI.result(this,"currPage"),groups=BI.result(o,"groups"),first=BI.result(o,"first"),last=BI.result(o,"last"),prev=BI.result(o,"prev"),next=BI.result(o,"next");pages===!1?(groups=0,first=!1,last=!1):groups>pages&&(groups=pages),dict.index=Math.ceil((curr+(groups>1&&groups!==pages?1:0))/(0===groups?1:groups)),(!o.dynamicShow&&!o.dynamicShowPrevNext||curr>1)&&prev!==!1&&(BI.isKey(prev)?view.push({text:prev,value:"prev",disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)}):view.push(BI.extend({disabled:pages===!1?o.hasPrev(curr)===!1:!(curr>1&&prev!==!1)},prev))),(!o.dynamicShow&&!o.dynamicShowFirstLast||dict.index>1&&0!==groups)&&first&&(view.push({text:first,value:"first",disabled:!(dict.index>1&&0!==groups)}),dict.index>1&&0!==groups&&view.push({type:"bi.label",cls:"page-ellipsis",text:"…"})),dict.poor=Math.floor((groups-1)/2),dict.start=dict.index>1?curr-dict.poor:1,dict.end=dict.index>1?function(){var max=curr+(groups-dict.poor-1);return max>pages?pages:max}():groups,dict.end-dict.start1&&0!==groups&&pages>groups&&dict.endgroups&&dict.endgroups&&dict.endgroups&&dict.end1},hasNext:function(v){v||(v=1);var o=this.options,pages=this.options.pages;return pages===!1?o.hasNext(v):vlastPage?lastPage:(firstPage=BI.result(o,"firstPage"),vo.pages?o.pages:v,this.currPage=v;this._populate()},getValue:function(){var val=this.button_group.getValue()[0];switch(val){case"prev":return-1;case"next":return 1;case"first":return BI.MIN;case"last":return BI.MAX;default:return val}},attr:function(key,value){BI.DetailPager.superclass.attr.apply(this,arguments),"curr"===key&&(this.currPage=BI.result(this.options,"curr"))},populate:function(){this._populate()}}),BI.DetailPager.EVENT_CHANGE="EVENT_CHANGE",BI.DetailPager.EVENT_AFTER_POPULATE="EVENT_AFTER_POPULATE",BI.shortcut("bi.detail_pager",BI.DetailPager),BI.SegmentButton=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.SegmentButton.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-segment-button bi-list-item-select",shadow:!0,readonly:!0,hgap:5})},_init:function(){BI.SegmentButton.superclass._init.apply(this,arguments);var opts=this.options,self=this;this.text=BI.createWidget({type:"bi.label",element:this,textHeight:opts.height,whiteSpace:opts.whiteSpace,text:opts.text,value:opts.value,hgap:opts.hgap})},setSelected:function(){BI.SegmentButton.superclass.setSelected.apply(this,arguments)},setText:function(text){BI.SegmentButton.superclass.setText.apply(this,arguments),this.text.setText(text)},destroy:function(){BI.SegmentButton.superclass.destroy.apply(this,arguments)}}),BI.shortcut("bi.segment_button",BI.SegmentButton),BI.Segment=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.Segment.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-segment",items:[],height:24})},_init:function(){BI.Segment.superclass._init.apply(this,arguments);var self=this,o=this.options;this.buttonGroup=BI.createWidget({element:this,type:"bi.button_group",value:o.value,items:BI.createItems(o.items,{type:"bi.segment_button",height:o.height-2,whiteSpace:o.whiteSpace}),layout:[{type:"bi.center"}]}),this.buttonGroup.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.buttonGroup.on(BI.ButtonGroup.EVENT_CHANGE,function(value,obj){self.fireEvent(BI.Segment.EVENT_CHANGE,value,obj)})},_setEnable:function(enable){BI.Segment.superclass._setEnable.apply(this,arguments),enable===!0?this.element.removeClass("base-disabled disabled"):enable===!1&&this.element.addClass("base-disabled disabled")},setValue:function(v){this.buttonGroup.setValue(v)},setEnabledValue:function(v){this.buttonGroup.setEnabledValue(v)},getValue:function(){return this.buttonGroup.getValue()}}),BI.Segment.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.segment",BI.Segment),BI.MultiSelectBar=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiSelectBar.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multi-select-bar",height:25,text:BI.i18nText("BI-Select_All"),isAllCheckedBySelectedValue:BI.emptyFn,disableSelected:!0,isHalfCheckedBySelectedValue:function(selectedValues){return selectedValues.length>0},halfSelected:!1,iconWrapperWidth:26})},_init:function(){BI.MultiSelectBar.superclass._init.apply(this,arguments);var self=this,o=this.options,isSelect=o.selected===!0,isHalfSelect=!o.selected&&o.halfSelected;this.checkbox=BI.createWidget({type:"bi.checkbox",stopPropagation:!0,handler:function(){self.setSelected(self.isSelected())},selected:isSelect,invisible:isHalfSelect}),this.half=BI.createWidget({type:"bi.half_icon_button",stopPropagation:!0,handler:function(){self.setSelected(!0)},invisible:isSelect||!isHalfSelect}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,self.isSelected(),self)}),this.checkbox.on(BI.Checkbox.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,self.isSelected(),self)}),this.half.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.CLICK,self.isSelected(),self)}),this.half.on(BI.HalfIconButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,self.isSelected(),self)}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget({type:"bi.htape",element:this,items:[{width:o.iconWrapperWidth,el:{type:"bi.center_adapt",items:[this.checkbox,this.half]}},{el:this.text}]})},_setSelected:function(v){this.checkbox.setSelected(!!v)},beforeClick:function(){var isHalf=this.isHalfSelected(),isSelected=this.isSelected();isHalf===!0?this.setSelected(!0):this.setSelected(!isSelected)},setSelected:function(v){this.checkbox.setSelected(v),this.setHalfSelected(!1)},setHalfSelected:function(b){this.halfSelected=!!b,b===!0?(this.checkbox.setSelected(!1),this.half.visible(),this.checkbox.invisible()):(this.half.invisible(),this.checkbox.visible())},isHalfSelected:function(){return!this.isSelected()&&!!this.halfSelected},isSelected:function(){return this.checkbox.isSelected()},setValue:function(selectedValues){BI.MultiSelectBar.superclass.setValue.apply(this,arguments);var isAllChecked=this.options.isAllCheckedBySelectedValue.apply(this,arguments);this._setSelected(isAllChecked),!isAllChecked&&this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this,arguments))},doClick:function(){BI.MultiSelectBar.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.MultiSelectBar.EVENT_CHANGE,this.isSelected(),this)}}),BI.MultiSelectBar.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_bar",BI.MultiSelectBar),BI.LevelTree=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.LevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-level-tree",el:{chooseType:0},expander:{},items:[],value:""})},_init:function(){BI.LevelTree.superclass._init.apply(this,arguments),this.initTree(this.options.items)},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};BI.isKey(node.id)||(node.id=BI.UUID()),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){BI.isKey(node.id)||(node.id=BI.UUID())})},initTree:function(nodes){var self=this,o=this.options;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",element:this,expander:BI.extend({el:{},popup:{type:"bi.custom_tree"}},o.expander),items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),value:o.value,el:BI.extend({type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},o.el)}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,value,ob){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.LevelTree.EVENT_CHANGE,value,ob)})},stroke:function(nodes){this.tree.stroke.apply(this.tree,arguments)},populate:function(items,keyword){items=this._formatItems(BI.Tree.transformToTreeFormat(items),0),this.tree.populate(items,keyword)},setValue:function(v){this.tree.setValue(v)},getValue:function(){return this.tree.getValue()},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.LevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.level_tree",BI.LevelTree),BI.DisplayTree=BI.inherit(BI.TreeView,{_defaultConfig:function(){return BI.extend(BI.DisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-display-tree"})},_init:function(){BI.DisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.DisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.DisplayTree.superclass.destroy.apply(this,arguments)}}),BI.DisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.display_tree",BI.DisplayTree),BI.ListDisplayTree=BI.inherit(BI.ListTreeView,{_defaultConfig:function(){return BI.extend(BI.ListDisplayTree.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-list-display-tree"})},_init:function(){BI.ListDisplayTree.superclass._init.apply(this,arguments)},_configSetting:function(){function beforeCollapse(treeId,treeNode){return!1}function getFont(treeId,node){return node.isLeaf?{}:{color:"#999999"}}var setting={view:{selectedMulti:!1,dblClickExpand:!1,showIcon:!1,nameIsHTML:!0,showTitle:!1,fontCss:getFont},data:{key:{title:"title",name:"text"},simpleData:{enable:!0}},callback:{beforeCollapse:beforeCollapse}};return setting},_dealWidthNodes:function(nodes){nodes=BI.ListDisplayTree.superclass._dealWidthNodes.apply(this,arguments);var self=this,o=this.options;return BI.each(nodes,function(i,node){node.isParent=node.isParent||node.parent,null==node.text&&node.count>0&&(node.text=node.value+"("+BI.i18nText("BI-Basic_Altogether")+node.count+BI.i18nText("BI-Basic_Count")+")")}),nodes},initTree:function(nodes,setting){var setting=setting||this._configSetting();this.nodes=BI.$.fn.zTree.init(this.tree.element,setting,nodes)},destroy:function(){BI.ListDisplayTree.superclass.destroy.apply(this,arguments)}}),BI.ListDisplayTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.list_display_tree",BI.ListDisplayTree),BI.SimpleTreeView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SimpleTreeView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-simple-tree",itemsCreator:BI.emptyFn,items:null})},_init:function(){BI.SimpleTreeView.superclass._init.apply(this,arguments);var self=this,o=this.options;this.structure=new BI.Tree,this.tree=BI.createWidget({type:"bi.tree_view",element:this,itemsCreator:function(op,callback){var fn=function(items){callback({items:items}),self.structure.initTree(BI.Tree.transformToTreeFormat(items))};BI.isNotNull(o.items)?fn(o.items):o.itemsCreator(op,fn)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.SimpleTreeView.EVENT_CHANGE,arguments)}),BI.isNotEmptyArray(o.items)&&this.populate(),BI.isNotNull(o.value)&&this.setValue(o.value)},populate:function(items,keyword){items&&(this.options.items=items),this.tree.stroke({keyword:keyword})},_digest:function(v){v||(v=[]);var self=this,map={},selected=[];return BI.each(v,function(i,val){var node=self.structure.search(val,"value");if(node){var p=node;for(p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++);p&&p.getChildrenLength()<=map[p.value];)selected.push(p.value),p=p.getParent(),p&&(map[p.value]||(map[p.value]=0),map[p.value]++)}}),BI.makeObject(v.concat(selected))},setValue:function(v){this.tree.setValue(this._digest(v))},_getValue:function(){var self=this,result=[],val=this.tree.getValue(),track=function(nodes){BI.each(nodes,function(key,node){BI.isEmpty(node)?result.push(key):track(node)})};return track(val),result},empty:function(){this.tree.empty()},getValue:function(){var self=this,result=[],val=this._getValue();return BI.each(val,function(i,key){var target=self.structure.search(key,"value");target&&self.structure._traverse(target,function(node){node.isLeaf()&&result.push(node.value)})}),result}}),BI.SimpleTreeView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.simple_tree",BI.SimpleTreeView),BI.EditorTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.EditorTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-editor-trigger bi-border",height:24,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:""})},_init:function(){this.options.height-=2,BI.EditorTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,value:o.value,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText,title:function(){return self.getValue()}}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.EditorTrigger.EVENT_CHANGE,arguments)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.trigger_icon_button",width:o.triggerWidth||o.height},width:o.triggerWidth||o.height}]})},getValue:function(){return this.editor.getValue()},setValue:function(value){this.editor.setValue(value)},setText:function(text){this.editor.setState(text)}}),BI.EditorTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.editor_trigger",BI.EditorTrigger),BI.IconTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.IconTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-icon-trigger",extraCls:"pull-down-font",el:{},height:24})},_init:function(){var o=this.options;BI.IconTrigger.superclass._init.apply(this,arguments),this.iconButton=BI.createWidget(o.el,{type:"bi.trigger_icon_button",element:this,width:o.width,height:o.height,extraCls:o.extraCls})}}),BI.shortcut("bi.icon_trigger",BI.IconTrigger),BI.IconTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.IconTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:24,iconHeight:null,iconWidth:null,textCls:""})},_init:function(){BI.IconTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(o.textCls)?" "+o.textCls:""),textAlign:"left",height:o.height,text:o.text}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",ref:function(_ref){self.wrapper=_ref},items:[{el:{type:"bi.icon_change_button",cls:"icon-combo-trigger-icon",iconCls:o.iconCls,ref:function(_ref){self.icon=_ref},iconHeight:o.iconHeight,iconWidth:o.iconWidth,disableSelected:!0},width:BI.isEmptyString(o.iconCls)?0:o.iconWrapperWidth||o.height},{el:this.text,lgap:BI.isEmptyString(o.iconCls)?5:0},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setValue:function(value){this.text.setValue(value)},setIcon:function(iconCls){var o=this.options;this.icon.setIcon(iconCls);var iconItem=this.wrapper.attr("items")[0],textItem=this.wrapper.attr("items")[1];BI.isNull(iconCls)||BI.isEmptyString(iconCls)?0!==iconItem.width&&(iconItem.width=0,textItem.lgap=5,this.wrapper.resize()):iconItem.width!==(o.iconWrapperWidth||o.height)&&(iconItem.width=o.iconWrapperWidth||o.height,textItem.lgap=0,this.wrapper.resize())},setTextCls:function(cls){var o=this.options,oldCls=o.textCls;o.textCls=cls,this.text.element.removeClass(oldCls).addClass(cls)},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.icon_text_trigger",BI.IconTextTrigger),BI.SelectIconTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectIconTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border",height:24,iconHeight:null,iconWidth:null,iconCls:""})},_init:function(){this.options.height-=2,BI.SelectIconTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digist(o.value,o.items);this.trigger=BI.createWidget({type:"bi.icon_text_trigger",element:this,text:obj.text,textCls:obj.textCls,iconCls:obj.iconCls,height:o.height,iconHeight:o.iconHeight,iconWidth:o.iconWidth,iconWrapperWidth:o.iconWrapperWidth})},_digist:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result,formatItems=BI.Tree.transformToArrayFormat(items);return BI.any(formatItems,function(i,item){if(BI.deepContains(vals,item.value))return result={text:item.text||item.value,iconCls:item.iconCls},!0}),BI.isNotNull(result)?{text:result.text,textCls:"",iconCls:result.iconCls}:{text:BI.isFunction(o.text)?o.text():o.text,textCls:"bi-water-mark",iconCls:o.iconCls}},setValue:function(vals){var obj=this._digist(vals,this.options.items);this.trigger.setText(obj.text),this.trigger.setIcon(obj.iconCls),this.trigger.setTextCls(obj.textCls)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.select_icon_text_trigger",BI.SelectIconTextTrigger),BI.TextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.TextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:24,textCls:""})},_init:function(){BI.TextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"select-text-label"+(BI.isKey(o.textCls)?" "+o.textCls:""),textAlign:"left",height:o.height,text:o.text,title:function(){return self.text.getText()},tipType:o.tipType,warningTitle:o.warningTitle,hgap:c.hgap,readonly:o.readonly}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setTextCls:function(cls){var o=this.options,oldCls=o.textCls;o.textCls=cls,this.text.element.removeClass(oldCls).addClass(cls)},setText:function(text){this.text.setText(text)},setTipType:function(v){this.text.options.tipType=v}}),BI.shortcut("bi.text_trigger",BI.TextTrigger),BI.SelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-text-trigger bi-border bi-focus-shadow",height:24})},_init:function(){this.options.height-=2,BI.SelectTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digest(o.value,o.items);this.trigger=BI.createWidget({type:"bi.text_trigger",element:this,height:o.height,readonly:o.readonly,text:obj.text,textCls:obj.textCls,tipType:o.tipType,warningTitle:o.warningTitle})},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?{textCls:"",text:result.join(",")}:{textCls:"bi-water-mark",text:BI.isFunction(o.text)?o.text():o.text}},setValue:function(vals){var formatValue=this._digest(vals,this.options.items);this.trigger.setTextCls(formatValue.textCls),this.trigger.setText(formatValue.text)},setTipType:function(v){this.trigger.setTipType(v)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.select_text_trigger",BI.SelectTextTrigger),BI.SmallSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SmallSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-small-select-text-trigger bi-border",height:20})},_init:function(){this.options.height-=2,BI.SmallSelectTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,obj=this._digest(o.value,o.items);this.trigger=BI.createWidget({type:"bi.small_text_trigger",element:this,height:o.height-2,text:obj.text,cls:obj.cls})},_digest:function(vals,items){var o=this.options;vals=BI.isArray(vals)?vals:[vals];var result=[],formatItems=BI.Tree.transformToArrayFormat(items);return BI.each(formatItems,function(i,item){BI.deepContains(vals,item.value)&&!BI.contains(result,item.text||item.value)&&result.push(item.text||item.value)}),result.length>0?{cls:"",text:result.join(",")}:{cls:"bi-water-mark",text:o.text}},setValue:function(vals){var formatValue=this._digest(vals,this.options.items);this.trigger.element.removeClass("bi-water-mark").addClass(formatValue.cls),this.trigger.setText(formatValue.text)},populate:function(items){this.options.items=items}}),BI.shortcut("bi.small_select_text_trigger",BI.SmallSelectTextTrigger),BI.SmallTextTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){var conf=BI.SmallTextTrigger.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-text-trigger",height:20})},_init:function(){BI.SmallTextTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:o.height,text:o.text,hgap:c.hgap}),this.trigerButton=BI.createWidget({type:"bi.trigger_icon_button",width:o.triggerWidth||o.height}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.text},{el:this.trigerButton,width:o.triggerWidth||o.height}]})},setValue:function(value){this.text.setValue(value)},setText:function(text){this.text.setText(text)}}),BI.shortcut("bi.small_text_trigger",BI.SmallTextTrigger),BI.MonthDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.MonthDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-combo",height:24,container:null})},_init:function(){BI.MonthDateCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.month_popup",behaviors:o.behaviors}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue())}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",container:o.container,element:this,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.combo.hideView(),self.fireEvent(BI.MonthDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.doBehavior()})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.MonthDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_date_combo",BI.MonthDateCombo),BI.YearDateCombo=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.YearDateCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-combo",min:"1900-01-01",max:"2099-12-31",behaviors:{},height:24,container:null})},_init:function(){BI.YearDateCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.date_triangle_trigger"}),this.popup=BI.createWidget({type:"bi.year_popup",behaviors:o.behaviors,min:o.min,max:o.max}),this.popup.on(BI.YearPopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo=BI.createWidget({type:"bi.combo",offsetStyle:"center",element:this,container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:this.popup}}),this.combo.on(BI.Combo.EVENT_CHANGE,function(){self.fireEvent(BI.YearDateCombo.EVENT_CHANGE)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.doBehavior()})},setValue:function(v){this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.YearDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_date_combo",BI.YearDateCombo),BI.DatePicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.DatePicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-picker",height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.DatePicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this._year=BI.getDate().getFullYear(),this._month=BI.getDate().getMonth()+1,this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){1===self._month?self.setValue({year:self.year.getValue()-1,month:12}):self.setValue({year:self.year.getValue(),month:self.month.getValue()-1}),self.fireEvent(BI.DatePicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){12===self._month?self.setValue({year:self.year.getValue()+1,month:1}):self.setValue({year:self.year.getValue(),month:self.month.getValue()+1}),self.fireEvent(BI.DatePicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",behaviors:o.behaviors,min:o.min,max:o.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){self.setValue({year:self.year.getValue(),month:self.month.getValue()}),self.fireEvent(BI.DatePicker.EVENT_CHANGE)}),this.month=BI.createWidget({type:"bi.month_date_combo",behaviors:o.behaviors}),this.month.on(BI.MonthDateCombo.EVENT_CHANGE,function(){self.setValue({year:self.year.getValue(),month:self.month.getValue()}),self.fireEvent(BI.DatePicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:24},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal",width:120,rgap:10,items:[{el:this.year,lgap:10},this.month]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:24}]}),this.setValue({year:this._year,month:this._month})},_checkLeftValid:function(){var o=this.options,valid=!(1===this._month&&this._year===BI.parseDateTime(o.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!(12===this._month&&this._year===BI.parseDateTime(o.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(valid),valid},setValue:function(ob){this._year=BI.parseInt(ob.year),this._month=BI.parseInt(ob.month),this.year.setValue(ob.year),this.month.setValue(ob.month),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return{year:this.year.getValue(),month:this.month.getValue()}}}),BI.DatePicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_picker",BI.DatePicker),BI.YearPicker=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.YearPicker.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-year-picker",behaviors:{},height:40,min:"1900-01-01",max:"2099-12-31"})},_init:function(){BI.YearPicker.superclass._init.apply(this,arguments);var self=this,o=this.options;this._year=BI.getDate().getFullYear(),this.left=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25}),this.left.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(self.year.getValue()-1),self.fireEvent(BI.YearPicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.right=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25}),this.right.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(self.year.getValue()+1),self.fireEvent(BI.YearPicker.EVENT_CHANGE),self._checkLeftValid(),self._checkRightValid()}),this.year=BI.createWidget({type:"bi.year_date_combo",min:o.min,behaviors:o.behaviors,max:o.max}),this.year.on(BI.YearDateCombo.EVENT_CHANGE,function(){self.setValue(self.year.getValue()),self.fireEvent(BI.YearPicker.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:{type:"bi.center_adapt",items:[this.left]},width:25},{type:"bi.center_adapt",items:[{el:{type:"bi.horizontal_float",width:50,items:[{el:this.year}]}}]},{el:{type:"bi.center_adapt",items:[this.right]},width:25}]}),this.setValue({year:this._year})},_checkLeftValid:function(){var o=this.options,valid=!(this._year===BI.parseDateTime(o.min,"%Y-%X-%d").getFullYear());return this.left.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!(this._year===BI.parseDateTime(o.max,"%Y-%X-%d").getFullYear());return this.right.setEnable(valid),valid},setValue:function(v){this._year=v,this.year.setValue(v),this._checkLeftValid(),this._checkRightValid()},getValue:function(){return this.year.getValue()}}),BI.YearPicker.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_picker",BI.YearPicker),BI.DateCalendarPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.DateCalendarPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-calendar-popup",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!0},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:1});return calendar},_init:function(){BI.DateCalendarPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this._day=this.today.getDate(),this.selectedTime=o.selectedTime||{year:this._year,month:this._month,day:this._day},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.calendar=BI.createWidget({direction:"top",logic:{ +dynamic:!0},type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this),afterCardCreated:function(){},afterCardShow:function(){this.setValue(self.selectedTime)}}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){self.selectedTime=self.datePicker.getValue(),self.selectedTime.day=1,self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime))}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=self.calendar.getValue(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.calendar,left:5,right:5},{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},setValue:function(timeOb){this.datePicker.setValue(timeOb),this.calendar.setSelect(BI.Calendar.getPageByDateJSON(timeOb)),this.calendar.setValue(timeOb),this.selectedTime=timeOb},getValue:function(){return this.selectedTime}}),BI.DateCalendarPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_calendar_popup",BI.DateCalendarPopup),BI.MonthPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MonthPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-month-popup",behaviors:{}})},_init:function(){BI.MonthPopup.superclass._init.apply(this,arguments);var self=this,o=this.options,month=[1,7,2,8,3,9,4,10,5,11,6,12],items=[];items.push(month.slice(0,2)),items.push(month.slice(2,4)),items.push(month.slice(4,6)),items.push(month.slice(6,8)),items.push(month.slice(8,10)),items.push(month.slice(10,12)),items=BI.map(items,function(i,item){return BI.map(item,function(j,td){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:td,text:td}})}),this.month=BI.createWidget({type:"bi.button_group",element:this,behaviors:o.behaviors,items:BI.createItems(items,{}),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:o.value}),this.month.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.MonthPopup.EVENT_CHANGE)})},getValue:function(){return this.month.getValue()[0]},setValue:function(v){v=BI.parseInt(v),this.month.setValue([v])}}),BI.MonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.month_popup",BI.MonthPopup),BI.YearPopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.YearPopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(v){var o=this.options,y=this._year,calendar=BI.createWidget({type:"bi.year_calendar",behaviors:o.behaviors,min:o.min,max:o.max,logic:{dynamic:!0},year:y+12*v});return calendar.setValue(this._year),calendar},_init:function(){BI.YearPopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.selectedYear=this._year=BI.getDate().getFullYear();var backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:24,height:24,value:-1}),preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:24,height:24,value:1});this.navigation=BI.createWidget({type:"bi.navigation",element:this,single:!0,logic:{dynamic:!0},tab:{cls:"year-popup-navigation bi-high-light bi-split-top",height:24,items:[backBtn,preBtn]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(self.selectedYear);var calendar=this.getSelectedCard();backBtn.setEnable(!calendar.isFrontYear()),preBtn.setEnable(!calendar.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedYear=this.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.YearPopup.EVENT_CHANGE,self.selectedYear)}),BI.isKey(o.value)&&this.setValue(o.value)},getValue:function(){return this.selectedYear},setValue:function(v){var o=this.options;v=BI.parseInt(v);var startDate=BI.parseDateTime(o.min,"%Y-%X-%d"),endDate=BI.parseDateTime(o.max,"%Y-%X-%d");BI.checkDateVoid(v,1,1,BI.print(BI.getDate(startDate.getFullYear(),0,1),"%Y-%X-%d"),BI.print(BI.getDate(endDate.getFullYear(),0,1),"%Y-%X-%d"))[0]?(v=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue("")):(this.selectedYear=v,this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue(v))}}),BI.YearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.year_popup",BI.YearPopup),BI.DateTriangleTrigger=BI.inherit(BI.Trigger,{_const:{height:24,iconWidth:12,iconHeight:12},_defaultConfig:function(){return BI.extend(BI.DateTriangleTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-triangle-trigger pull-down-ha-font cursor-pointer",height:24})},_init:function(){BI.DateTriangleTrigger.superclass._init.apply(this,arguments);var o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"right",text:o.text,value:o.value,height:c.height}),BI.createWidget({type:"bi.vertical_adapt",element:this,items:[{el:this.text,rgap:5},{type:"bi.icon_label",width:16}]})},setValue:function(v){this.text.setValue(v)},getValue:function(){return this.text.getValue()},setText:function(v){this.text.setText(v)},getText:function(){return this.item.getText()},getKey:function(){}}),BI.shortcut("bi.date_triangle_trigger",BI.DateTriangleTrigger),BI.StaticDatePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StaticDatePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDatePaneCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=o.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var value=self.datePicker.getValue(),monthDay=BI.getMonthDays(BI.getDate(value.year,value.month-1,1)),day=self.selectedTime.day||0;day>monthDay&&(day=monthDay),self.selectedTime={year:value.year,month:value.month},0!==day&&(self.selectedTime.day=day),self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)),self.calendar.setValue(self.selectedTime),0!==day&&self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=self.calendar.getValue(),self.calendar.empty(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.setValue(o.selectedTime),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.datePicker,height:40},this.calendar],hgap:10}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]})},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:this.selectedTime.day});return calendar},_getNewCurrentDate:function(){var today=BI.getDate();return{year:today.getFullYear(),month:today.getMonth()+1}},_setCalenderValue:function(date){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)),this.calendar.setValue(date),this.selectedTime=date},_setDatePicker:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.year)||BI.isNull(timeOb.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(timeOb)},_setCalendar:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(timeOb)},setValue:function(timeOb){this._setDatePicker(timeOb),this._setCalendar(timeOb)},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_pane_card",BI.StaticDatePaneCard),BI.DynamicDatePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDatePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDatePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var value=this.getValue()[0];switch(self.dateTab.setSelect(value),value){case BI.DynamicDatePane.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()});break;case BI.DynamicDatePane.Dynamic:self.dynamicPane.setValue({year:0})}self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDatePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDatePane.Static:return{type:"bi.static_date_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDatePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateCombo.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_pane",BI.DynamicDatePane),BI.extend(BI.DynamicDatePane,{Static:1,Dynamic:2}),BI.DateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:290,popupWidth:270,comboAdjustHeight:1,border:1},_defaultConfig:function(){return BI.extend(BI.DateTimeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-combo bi-border bi-border-radius",width:200,height:24,minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){BI.DateTimeCombo.superclass._init.apply(this,arguments);var self=this,opts=this.options,date=BI.getDate();this.storeValue=BI.isNotNull(opts.value)?opts.value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},this.trigger=BI.createWidget({type:"bi.date_time_trigger",min:opts.minDate,max:opts.maxDate,value:opts.value}),this.popup=BI.createWidget({type:"bi.date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value}),self.setValue(this.storeValue),this.popup.on(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE,function(){self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CANCEL)}),this.popup.on(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE,function(){self.storeValue=self.popup.getValue(),self.setValue(self.storeValue),self.hidePopupView(),self.fireEvent(BI.DateTimeCombo.EVENT_CONFIRM)}),this.combo=BI.createWidget({type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,adjustLength:this.constants.comboAdjustHeight,popup:{el:this.popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW)});var triggerBtn=BI.createWidget({type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:24,height:24});triggerBtn.on(BI.IconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),BI.createWidget({type:"bi.htape",element:this,items:[{type:"bi.absolute",items:[{el:this.combo,top:0,left:0,right:0,bottom:0},{el:triggerBtn,top:0,right:0}]}]})},setValue:function(v){this.storeValue=v,this.popup.setValue(v),this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()}}),BI.DateTimeCombo.EVENT_CANCEL="EVENT_CANCEL",BI.DateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.date_time_combo",BI.DateTimeCombo),BI.DateTimePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DateTimePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-date-time-popup",width:268,height:374})},_init:function(){BI.DateTimePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.cancelButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top bi-border-right",shadow:!0,text:BI.i18nText("BI-Basic_Cancel")}),this.cancelButton.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE)}),this.okButton=BI.createWidget({type:"bi.text_button",cls:"multidate-popup-button bi-border-top",shadow:!0,text:BI.i18nText("BI-Basic_OK")}),this.okButton.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE)}),this.dateCombo=BI.createWidget({type:"bi.date_calendar_popup",behaviors:opts.behaviors,min:self.options.min,max:self.options.max}),self.dateCombo.on(BI.DateCalendarPopup.EVENT_CHANGE,function(){self.fireEvent(BI.DateTimePopup.CALENDAR_EVENT_CHANGE)}),this.dateButton=BI.createWidget({type:"bi.grid",items:[[this.cancelButton,this.okButton]]}),BI.createWidget({element:this,type:"bi.vtape",items:[{el:this.dateCombo},{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",ref:function(_ref){self.timeSelect=_ref}}]},height:50},{el:this.dateButton,height:30}]}),this.setValue(opts.value)},setValue:function(v){var value=v,date;BI.isNull(value)?(date=BI.getDate(),this.dateCombo.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue({hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()})):(this.dateCombo.setValue({year:value.year,month:value.month,day:value.day}),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}))},getValue:function(){return BI.extend({year:this.dateCombo.getValue().year,month:this.dateCombo.getValue().month,day:this.dateCombo.getValue().day},this.timeSelect.getValue())}}),BI.DateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DateTimePopup.BUTTON_CANCEL_EVENT_CHANGE="BUTTON_CANCEL_EVENT_CHANGE",BI.DateTimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.date_time_popup",BI.DateTimePopup),BI.DateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4},_defaultConfig:function(){return BI.extend(BI.DateTimeTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,width:200})},_init:function(){BI.DateTimeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.text=BI.createWidget({type:"bi.label",textAlign:"left",height:o.height,width:o.width,hgap:c.hgap}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.text},{el:BI.createWidget(),width:o.height}]}),this.setValue(o.value)},_printTime:function(v){return v<10?"0"+v:v},setValue:function(v){var self=this,value=v,dateStr;if(BI.isNull(value))value=BI.getDate(),dateStr=BI.print(value,"%Y-%X-%d %H:%M:%S");else{var date=BI.getDate(value.year,value.month-1,value.day,value.hour,value.minute,value.second);dateStr=BI.print(date,"%Y-%X-%d %H:%M:%S")}this.text.setText(dateStr),this.text.setTitle(dateStr)}}),BI.shortcut("bi.date_time_trigger",BI.DateTimeTrigger),BI.StaticDateTimePaneCard=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.StaticDateTimePaneCard.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-date-time-pane",min:"1900-01-01",max:"2099-12-31",selectedTime:null})},_init:function(){BI.StaticDateTimePaneCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.today=BI.getDate(),this._year=this.today.getFullYear(),this._month=this.today.getMonth()+1,this.selectedTime=o.selectedTime||{year:this._year,month:this._month},this.datePicker=BI.createWidget({type:"bi.date_picker",behaviors:o.behaviors,min:o.min,max:o.max}),this.datePicker.on(BI.DatePicker.EVENT_CHANGE,function(){var value=self.datePicker.getValue(),monthDay=BI.getMonthDays(BI.getDate(value.year,value.month-1,1)),day=self.selectedTime.day||0;day>monthDay&&(day=monthDay),self.selectedTime=BI.extend(self.selectedTime,{year:value.year,month:value.month,day:day}),0!==day&&(self.selectedTime.day=day),self.calendar.setSelect(BI.Calendar.getPageByDateJSON(self.selectedTime)),self.calendar.setValue(self.selectedTime),0!==day&&self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),this.calendar=BI.createWidget({direction:"custom",type:"bi.navigation",tab:this.datePicker,cardCreator:BI.bind(this._createNav,this)}),this.calendar.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedTime=BI.extend(self.calendar.getValue(),self.timeSelect.getValue()),self.calendar.empty(),self.setValue(self.selectedTime),self.fireEvent(BI.DateCalendarPopup.EVENT_CHANGE)}),BI.createWidget({type:"bi.vtape",element:this,hgap:10,items:[{el:this.datePicker,height:40},this.calendar,{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this},listeners:[{eventName:BI.DynamicDateTimeSelect.EVENT_CONFIRM,action:function(){self.selectedTime=BI.extend(self.calendar.getValue(),self.timeSelect.getValue()),self.fireEvent("EVENT_CHANGE")}}]},height:40}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout",cls:"bi-split-top"},height:1,top:40,left:0,right:0}]}),this.setValue(o.selectedTime)},_createNav:function(v){var date=BI.Calendar.getDateJSONByPage(v),calendar=BI.createWidget({type:"bi.calendar",logic:{dynamic:!1},min:this.options.min,max:this.options.max,year:date.year,month:date.month,day:this.selectedTime.day});return calendar},_getNewCurrentDate:function(){var today=BI.getDate();return{year:today.getFullYear(),month:today.getMonth()+1}},_setCalenderValue:function(date){this.calendar.setSelect(BI.Calendar.getPageByDateJSON(date)),this.calendar.setValue(date),this.selectedTime=BI.extend({},this.timeSelect.getValue(),date)},_setDatePicker:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.year)||BI.isNull(timeOb.month)?this.datePicker.setValue(this._getNewCurrentDate()):this.datePicker.setValue(timeOb)},_setCalendar:function(timeOb){BI.isNull(timeOb)||BI.isNull(timeOb.day)?(this.calendar.empty(),this._setCalenderValue(this._getNewCurrentDate())):this._setCalenderValue(timeOb)},setValue:function(timeOb){timeOb=timeOb||{},this._setDatePicker(timeOb),this._setCalendar(timeOb),this.timeSelect.setValue({hour:timeOb.hour,minute:timeOb.minute,second:timeOb.second})},getValue:function(){return this.selectedTime}}),BI.shortcut("bi.static_date_time_pane_card",BI.StaticDateTimePaneCard),BI.DynamicDateTimePane=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-pane"},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.linear_segment",cls:"bi-split-bottom",height:30,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateTimePane.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateTimePane.Dynamic}],{textAlign:"center"}),listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){var value=this.getValue()[0];switch(self.dateTab.setSelect(value),value){case BI.DynamicDateTimePane.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()});break;case BI.DynamicDateTimePane.Dynamic:self.dynamicPane.setValue({year:0})}}}],ref:function(){self.switcher=this}},height:30},{type:"bi.tab",ref:function(){self.dateTab=this},showIndex:BI.DynamicDateTimePane.Static,cardCreator:function(v){switch(v){case BI.DynamicDateTimePane.Static:return{type:"bi.static_date_time_pane_card",behaviors:o.behaviors,listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.ymd=this}};case BI.DynamicDateTimePane.Dynamic:default:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._checkValue(self.getValue())&&self.fireEvent("EVENT_CHANGE")}}],ref:function(){self.dynamicPane=this}}}}}]}},mounted:function(){this.setValue(this.options.value)},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){v=v||{};var type=v.type||BI.DynamicDateTimePane.Static,value=v.value||v;switch(this.switcher.setValue(type),this.dateTab.setSelect(type),type){case BI.DynamicDateTimePane.Dynamic:this.dynamicPane.setValue(value);break;case BI.DynamicDateTimePane.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1})}else this.ymd.setValue(value)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.shortcut("bi.dynamic_date_time_pane",BI.DynamicDateTimePane),BI.extend(BI.DynamicDateTimePane,{Static:1,Dynamic:2}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popupview=BI.createWidget({type:"bi.down_list_popup",items:o.items,chooseType:o.chooseType,value:o.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(value){self.fireEvent(BI.DownListCombo.EVENT_CHANGE,value),self.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(value,fatherValue){self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,value,fatherValue),self.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:o.trigger,isNeedAdjustWidth:!1,container:o.container,adjustLength:o.adjustLength,direction:o.direction,stopPropagation:o.stopPropagation,el:BI.createWidget(o.el,{type:"bi.icon_trigger",extraCls:o.iconCls,width:o.width,height:o.height}),popup:{el:this.popupview,stopPropagation:o.stopPropagation,maxHeight:1e3,minWidth:140}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(items){this.popupview.populate(items)},setValue:function(v){this.popupview.setValue(v)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.down_list_combo",BI.DownListCombo),BI.DownListGroup=BI.inherit(BI.Widget,{constants:{iconCls:"check-mark-ha-font"},_defaultConfig:function(){return BI.extend(BI.DownListGroup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-group",items:[{el:{}}]})},_init:function(){BI.DownListGroup.superclass._init.apply(this,arguments);var o=this.options,self=this;this.downlistgroup=BI.createWidget({element:this,type:"bi.button_tree",items:o.items,chooseType:0,layouts:[{type:"bi.vertical",hgap:0,vgap:0}],value:o.value}),this.downlistgroup.on(BI.Controller.EVENT_CHANGE,function(type){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&self.fireEvent(BI.DownListGroup.EVENT_CHANGE,arguments)})},getValue:function(){return this.downlistgroup.getValue()},setValue:function(v){this.downlistgroup.setValue(v)}}),BI.DownListGroup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group",BI.DownListGroup),BI.DownListItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.DownListItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-item bi-list-item-active",cls:"",height:24,logic:{dynamic:!0},selected:!1,iconHeight:null,iconWidth:null,textHgap:0,textVgap:0,textLgap:0,textRgap:0})},_init:function(){BI.DownListItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",hgap:o.textHgap,vgap:o.textVgap,lgap:o.textLgap,rgap:o.textRgap,text:o.text,value:o.value,keyword:o.keyword,height:o.height}),this.icon=BI.createWidget({type:"bi.center_adapt",width:36,height:o.height,items:[{el:{type:"bi.icon",width:o.iconWidth,height:o.iconHeight}}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,this.icon,this.text)}))))},setValue:function(){this.isReadOnly()||this.text.setValue.apply(this.text,arguments)},getValue:function(){return this.text.getValue()},setText:function(){this.text.setText.apply(this.text,arguments)},getText:function(){return this.text.getText()},doClick:function(){BI.DownListItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListItem.EVENT_CHANGE,this.getValue(),this)},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)}}),BI.DownListItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_item",BI.DownListItem),BI.DownListGroupItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){var conf=BI.DownListGroupItem.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-down-list-group-item",logic:{dynamic:!1},iconCls1:"dot-e-font",iconCls2:"pull-right-e-font"})},_init:function(){BI.DownListGroupItem.superclass._init.apply(this,arguments);var o=this.options,self=this;this.text=BI.createWidget({type:"bi.label",cls:"list-group-item-text",textAlign:"left",text:o.text,value:o.value,height:o.height}),this.icon1=BI.createWidget({type:"bi.icon_button",cls:o.iconCls1,width:36,disableSelected:!0,selected:this._digest(o.value)}),this.icon2=BI.createWidget({type:"bi.icon_button",cls:o.iconCls2,width:24,forceNotSelected:!0});var blank=BI.createWidget({type:"bi.layout",width:24});BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.icon2,top:0,bottom:0,right:0}]}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",this.icon1,this.text,blank)})))),this.element.hover(function(){self.isEnabled()&&self.hover()},function(){self.isEnabled()&&self.dishover()})},_digest:function(v){var self=this,o=this.options;return v=BI.isArray(v)?v:[v],BI.any(v,function(idx,value){return BI.contains(o.childValues,value)})},hover:function(){BI.DownListGroupItem.superclass.hover.apply(this,arguments),this.icon1.element.addClass("hover"),this.icon2.element.addClass("hover")},dishover:function(){BI.DownListGroupItem.superclass.dishover.apply(this,arguments),this.icon1.element.removeClass("hover"),this.icon2.element.removeClass("hover")},doClick:function(){BI.DownListGroupItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent(BI.DownListGroupItem.EVENT_CHANGE,this.getValue())},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},setValue:function(v){this.icon1.setSelected(this._digest(v))}}),BI.DownListGroupItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.down_list_group_item",BI.DownListGroupItem),BI.DownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:24,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var conf=BI.DownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.DownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={},this.items=BI.deepClone(this.options.items);var self=this,o=this.options,children=this._createChildren(this.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(children,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(o.value),chooseType:o.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(value,object){var changedValue=value;if(BI.isNotNull(self.childValueMap[value])?(changedValue=self.childValueMap[value],self.fireEvent(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,changedValue,self.fatherValueMap[value])):self.fireEvent(BI.DownListPopup.EVENT_CHANGE,changedValue,object),!BI.contains(self.singleValues,changedValue)){var item=self.getValue(),result=[];BI.each(item,function(i,valueObject){valueObject.value!=changedValue&&result.push(valueObject)}),self.setValue(result)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createChildren:function(items){var self=this,result=[];return BI.each(items,function(i,it){var item_done={type:"bi.down_list_group",items:[]};if(BI.each(it,function(i,item){BI.isNotEmptyArray(item.children)&&!BI.isEmpty(item.el)?(item.type="bi.combo_group",item.isDefaultInit=!0,item.cls="down-list-group",item.trigger="hover",item.isNeedAdjustWidth=!1,item.el.title=item.el.title||item.el.text,item.el.type="bi.down_list_group_item",item.el.logic={dynamic:!0},item.el.height=self.constants.height,item.el.iconCls2=self.constants.nextIcon,item.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5,maxHeight:378},item.el.childValues=[],BI.each(item.children,function(i,child){var fatherValue=BI.deepClone(item.el.value),childValue=BI.deepClone(child.value);self.singleValues.push(child.value),child.type="bi.down_list_item",child.extraCls=" child-down-list-item",child.title=child.title||child.text,child.textRgap=10,child.isNeedAdjustWidth=!1,child.logic={dynamic:!0},child.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,child.value=self._createChildValue(fatherValue,childValue),item.el.childValues.push(child.value)})):(item.type="bi.down_list_item", +item.title=item.title||item.text,item.textRgap=10,item.isNeedAdjustWidth=!1,item.logic={dynamic:!0});var el_done={};el_done.el=item,item_done.items.push(el_done)}),self._isGroup(item_done.items)&&BI.each(item_done.items,function(i,item){self.singleValues.push(item.el.value)}),result.push(item_done),self._needSpliter(i,items.length)){var spliter_container=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-split-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10,rgap:0});result.push(spliter_container)}}),result},_isGroup:function(i){return i.length>1},_needSpliter:function(i,itemLength){return i0?1:0}},setValue:function(v){v=v||{},this.position=v.position||BI.DynamicDateCard.OFFSET.CURRENT;var values=[],valuesItems=[];BI.isNotNull(v.year)&&(values.push(BI.DynamicDateCard.TYPE.YEAR),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))),BI.isNotNull(v.quarter)&&(values.push(BI.DynamicDateCard.TYPE.QUARTER),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))),BI.isNotNull(v.month)&&(values.push(BI.DynamicDateCard.TYPE.MONTH),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))),BI.isNotNull(v.week)&&(values.push(BI.DynamicDateCard.TYPE.WEEK),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WEEK,v.week))),BI.isNotNull(v.day)&&(values.push(BI.DynamicDateCard.TYPE.DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.DAY,v.day))),BI.isNotNull(v.workDay)&&(values.push(BI.DynamicDateCard.TYPE.WORK_DAY),valuesItems.push(this._createValue(BI.DynamicDateCard.TYPE.WORK_DAY,v.workDay))),this.checkgroup.setValue(values),this.workDayBox.setSelected(BI.isNotNull(v.workDay)),this.resultPane.populate(this._getParamJson(valuesItems,v.position))},getValue:function(){var self=this,valueMap={},selectValues=this.checkgroup.getValue(),buttons=this.resultPane.getAllButtons();if(0!==selectValues.length&&BI.each(buttons,function(idx,button){var value=button.getValue();switch(value.dateType){case BI.DynamicDateCard.TYPE.YEAR:valueMap.year=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.QUARTER:valueMap.quarter=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.MONTH:valueMap.month=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.WEEK:valueMap.week=0===value.offset?-value.value:value.value;break;case BI.DynamicDateCard.TYPE.DAY:valueMap.day=0===value.offset?-value.value:value.value}BI.isNull(value.dateType)&&(valueMap.position=self.position||BI.DynamicDateCard.OFFSET.CURRENT)}),this.workDayBox.isSelected()){var value=buttons[0].getValue();valueMap.workDay=0===value.offset?-value.value:value.value}return valueMap}}),BI.shortcut("bi.dynamic_date_card",BI.DynamicDateCard),BI.extend(BI.DynamicDateCard,{TYPE:{YEAR:1,QUARTER:2,MONTH:3,WEEK:4,DAY:5,WORK_DAY:6},OFFSET:{CURRENT:1,BEGIN:2,END:3}}),BI.DynamicDateCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_trigger",min:opts.minDate,max:opts.maxDate,format:opts.format,allowEdit:opts.allowEdit,watermark:opts.watermark,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTrigger.EVENT_ERROR,action:function(){self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}},self.fireEvent(BI.DynamicDateCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTrigger.EVENT_VALID,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTrigger.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTrigger.EVENT_CONFIRM,action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value,ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicDateCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var value=self.popup.getValue();self._checkValue(value)&&self.setValue(value),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDatePopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW)}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:opts.height,height:opts.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(){self.triggerBtn=this}},top:0,right:0}]}],ref:function(_ref){self.comboWrapper=_ref}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(v){var o=this.options,type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicDateCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=o.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},_defaultState:function(){},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()}}),BI.DynamicDateCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_combo",BI.DynamicDateCombo),BI.extend(BI.DynamicDateCombo,{Static:1,Dynamic:2}),BI.DynamicDateParamItem=BI.inherit(BI.Widget,{props:{baseCls:"bi-dynamic-date-param-item",dateType:BI.DynamicDateCard.TYPE.YEAR,value:0,offset:0,height:24},render:function(){var self=this,o=this.options;return{type:"bi.htape",items:[{el:{type:"bi.sign_editor",cls:"bi-border",height:22,validationChecker:function(v){return BI.isNaturalNumber(v)},value:o.value,ref:function(){self.editor=this},errorText:function(v){return BI.isEmptyString(v)?BI.i18nText("BI-Basic_Please_Input_Content"):BI.i18nText("BI-Please_Input_Natural_Number")},allowBlank:!1,listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]},width:60},{el:{type:"bi.label",height:24,text:this._getText()},width:o.dateType===BI.DynamicDateCard.TYPE.WORK_DAY?60:20},{type:"bi.text_value_combo",height:24,items:[{text:BI.i18nText("BI-Basic_Front"),value:0},{text:BI.i18nText("BI-Basic_Behind"),value:1}],ref:function(){self.offsetCombo=this},container:null,value:o.offset,listeners:[{eventName:BI.TextValueCombo.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateParamItem.EVENT_CHANGE)}}]}]}},_getText:function(){var text="";switch(this.options.dateType){case BI.DynamicDateCard.TYPE.YEAR:text=BI.i18nText("BI-Basic_Year");break;case BI.DynamicDateCard.TYPE.QUARTER:text=BI.i18nText("BI-Basic_Single_Quarter");break;case BI.DynamicDateCard.TYPE.MONTH:text=BI.i18nText("BI-Basic_Month");break;case BI.DynamicDateCard.TYPE.WEEK:text=BI.i18nText("BI-Basic_Week");break;case BI.DynamicDateCard.TYPE.DAY:text=BI.i18nText("BI-Basic_Day");break;case BI.DynamicDateCard.TYPE.WORK_DAY:default:text=BI.i18nText("BI-Basic_Work_Day")}return text},setValue:function(v){v=v||{},v.value=v.value||0,v.offset=v.offset||0,this.editor.setValue(v.value),this.offsetCombo.setValue(v.offset)},getValue:function(){return{dateType:this.options.dateType,value:this.editor.getValue(),offset:this.offsetCombo.getValue()[0]}}}),BI.DynamicDateParamItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_date_param_item",BI.DynamicDateParamItem),BI.DynamicDatePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-popup",width:248,height:344},_init:function(){BI.DynamicDatePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,c=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clear"),textHeight:c.buttonHeight-1,listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(opts.value)},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.DateCalendarPopup.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDatePopup.EVENT_CHANGE)}}],ref:function(){self.ymd=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicDatePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDatePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_popup",BI.DynamicDatePopup),BI.DynamicDateTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d"},props:{extraCls:"bi-date-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){var formatStr=self._getStandardDateStr(v),date=formatStr.match(/\d+/g);return!BI.isKey(o.format)&&self._autoAppend(v,date),self._dateCheck(formatStr)&&BI.checkDateLegal(formatStr)&&self._checkVoid({year:0|date[0],month:0|date[1],day:0|date[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var str="";return BI.isKey(o.format)||(str=self.editor.isEditing()?BI.i18nText("BI-Date_Trigger_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),str},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.storeTriggerValue=self.getKey(),self.fireEvent(BI.DynamicDateTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var formatStr=self._getStandardDateStr(value),date=formatStr.match(/\d+/g);self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|date[0],month:0|date[1],day:0|date[2]}}}self.fireEvent(BI.DynamicDateTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){self.editor.isValid()&&self.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.DynamicDateTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(o.value)},_getTitle:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,this._getFormatString());return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return BI.isNull(value)||BI.isNull(value.day)?"":BI.print(BI.getDate(value.year,value.month-1,value.day),this._getFormatString())}},_getStandardDateStr:function(v){var c=this._const,result=[0,1,2],formatArray=this._getFormatString().match(/%./g);BI.each(formatArray,function(idx,v){switch(v){case"%Y":case"%y":result[0]=idx;break;case"%X":case"%x":result[1]=idx;break;case"%d":case"%e":default:result[2]=idx}});var date=BI.parseDateTime(v,this._getFormatString());BI.print(date,this._getFormatString())===v&&(v=BI.print(date,c.compareFormat),result=[0,1,2]);var dateArray=v.match(/\d+/g),newArray=[];return BI.each(dateArray,function(idx){newArray[idx]=dateArray[result[idx]]}),newArray.length===result.length&&2===newArray[0].length?BI.print(BI.parseDateTime(newArray.join("-"),c.compareFormat),c.compareFormat):newArray.join("-")},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){return!BI.checkDateVoid(obj.year,obj.month,obj.day,this.options.min,this.options.max)[0]},_autoAppend:function(v,dateObj){if(BI.isNotNull(dateObj)&&BI.checkDateLegal(v))switch(v.length){case this._const.yearLength:this._yearCheck(v)&&this.editor.setValue(v+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var splitMonth=v.split("-")[1];(BI.isNotNull(splitMonth)&&2===splitMonth.length||this._monthCheck(v))&&this.editor.setValue(v+"-")}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,this._getFormatString()),this._const.compareFormat);return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_monthCheck:function(v){var date=BI.parseDateTime(v,this._getFormatString()),dateStr=BI.print(date,this._const.compareFormat);return date.getMonth()>=0&&(BI.print(BI.parseDateTime(v,"%Y-%X"),"%Y-%X")===v||BI.print(BI.parseDateTime(v,"%Y-%x"),"%Y-%x")===v)&&dateStr>=this.options.min&&dateStr<=this.options.max},_setInnerValue:function(date){var dateStr=BI.print(date,this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)},_getText:function(obj){function getPositionText(baseText,position){switch(position){case BI.DynamicDateCard.OFFSET.BEGIN:return baseText+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return baseText+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var value="",endText="";return BI.isNotNull(obj.year)&&(0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Year"),obj.position)),BI.isNotNull(obj.quarter)&&(0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Single_Quarter"),obj.position)),BI.isNotNull(obj.month)&&(0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Month"),obj.position)),BI.isNotNull(obj.week)&&(0!==BI.parseInt(obj.week)&&(value+=Math.abs(obj.week)+BI.i18nText("BI-Basic_Week")+(obj.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Week"),obj.position)),BI.isNotNull(obj.day)&&(0!==BI.parseInt(obj.day)&&(value+=Math.abs(obj.day)+BI.i18nText("BI-Basic_Day")+(obj.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=1===BI.size(obj)?getPositionText(BI.i18nText("BI-Basic_Month"),obj.position):""),BI.isNotNull(obj.workDay)&&0!==BI.parseInt(obj.workDay)&&(value+=Math.abs(obj.workDay)+BI.i18nText("BI-Basic_Work_Day")+(obj.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value+endText},setValue:function(v){var type,value,self=this,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(value)||BI.isNull(value.day))this.editor.setState(""),this.editor.setValue("");else{var dateStr=BI.print(BI.getDate(value.year,value.month-1,value.day),this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue}}),BI.DynamicDateTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTrigger.EVENT_START="EVENT_START",BI.DynamicDateTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTrigger.EVENT_CHANGE="EVENT_CHANGE", +BI.DynamicDateTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_trigger",BI.DynamicDateTrigger),BI.DynamicDateTimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:259,popupWidth:270,comboAdjustHeight:1,border:1},props:{baseCls:"bi-dynamic-date-combo bi-border bi-focus-shadow bi-border-radius",height:22,minDate:"1900-01-01",maxDate:"2099-12-31",format:"",allowEdit:!0},render:function(){var self=this,opts=this.options;this.storeTriggerValue="";var date=BI.getDate();return this.storeValue=opts.value,{type:"bi.htape",items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:opts.height,height:opts.height,ref:function(){self.changeIcon=this}},width:opts.height},{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,ref:function(){self.combo=this},toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.dynamic_date_time_trigger",min:opts.minDate,max:opts.maxDate,allowEdit:opts.allowEdit,watermark:opts.watermark,format:opts.format,height:opts.height,value:opts.value,ref:function(){self.trigger=this},listeners:[{eventName:BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_STOP,action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK,action:function(){self.combo.toggle()}},{eventName:BI.DynamicDateTimeTrigger.EVENT_FOCUS,action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_FOCUS)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BLUR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_ERROR,action:function(){self.storeValue={type:BI.DynamicDateTimeCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}},self.fireEvent(BI.DynamicDateTimeCombo.EVENT_ERROR)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_VALID,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_VALID)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CHANGE)}},{eventName:BI.DynamicDateTimeTrigger.EVENT_CONFIRM,action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:{type:"bi.dynamic_date_time_popup",behaviors:opts.behaviors,min:opts.minDate,max:opts.maxDate,value:opts.value,ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicDateTimeCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate(),hour:0,minute:0,second:0}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){var value=self.popup.getValue();self._checkValue(value)&&self.setValue(value),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicDateTimePopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_CONFIRM)}}]},stopPropagation:!1},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW)}}],hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length}},top:0,left:0,right:0,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-font",width:opts.height,height:opts.height,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(){self.triggerBtn=this}},top:0,right:0}]}],ref:function(_ref){self.comboWrapper=_ref}}},mounted:function(){this._checkDynamicValue(this.storeValue)},_checkDynamicValue:function(v){var o=this.options,type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicDateTimeCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=o.height,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},_checkValue:function(v){switch(v.type){case BI.DynamicDateCombo.Dynamic:return BI.isNotEmptyObject(v.value);case BI.DynamicDateCombo.Static:default:return!0}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},hidePopupView:function(){this.combo.hideView()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicDateTimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.DynamicDateTimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeCombo.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeCombo.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_date_time_combo",BI.DynamicDateTimeCombo),BI.extend(BI.DynamicDateTimeCombo,{Static:1,Dynamic:2}),BI.DynamicDateTimePopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-dynamic-date-time-popup",width:248,height:385},_init:function(){BI.DynamicDateTimePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,c=this.constants;this.storeValue={type:BI.DynamicDateCombo.Static},BI.createWidget({element:this,type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Multi_Date_Today"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}),this.setValue(opts.value)},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Multi_Date_YMD"),value:BI.DynamicDateCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicDateCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicDateCombo.Dynamic:return{type:"bi.dynamic_date_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicDateCombo.Static:default:return{type:"bi.vtape",items:[{type:"bi.date_calendar_popup",behaviors:o.behaviors,min:self.options.min,max:self.options.max,ref:function(){self.ymd=this}},{el:{type:"bi.dynamic_date_time_select",cls:"bi-split-top",ref:function(){self.timeSelect=this}},height:40}]}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicDateCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),self.timeSelect.setValue(),self._setInnerValue();break;case BI.DynamicDateCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicDateCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%X-%d"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:if(this._checkValueValid(value)){var date=BI.getDate();this.ymd.setValue({year:date.getFullYear(),month:date.getMonth()+1,day:date.getDate()}),this.timeSelect.setValue(),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"))}else this.ymd.setValue(value),this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second}),this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));this.textButton.setEnable(!0)}},getValue:function(){var type=this.dateTab.getSelect();return{type:type,value:type===BI.DynamicDateTimeCombo.Static?BI.extend(this.ymd.getValue(),this.timeSelect.getValue()):this.dynamicPane.getValue()}}}),BI.DynamicDateTimePopup.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicDateTimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.shortcut("bi.dynamic_date_time_popup",BI.DynamicDateTimePopup),BI.DynamicDateTimeSelect=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-select"},render:function(){var self=this;return{type:"bi.center_adapt",items:[{type:"bi.vertical_adapt",items:[{el:{type:"bi.number_editor",ref:function(){self.hour=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<24},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-23"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkHour(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.HOUR);this.setValue(value)}}],width:60,height:24}},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.minute=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<60},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkMinute(value),this.setValue(self._formatValueToDoubleDigit(value),BI.DynamicDateTimeSelect.MINUTE),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}},{eventName:BI.SignEditor.EVENT_CHANGE,action:function(){var value=self._autoSwitch(this.getValue(),BI.DynamicDateTimeSelect.MINUTE);this.setValue(value)}}],width:60,height:24},{type:"bi.label",text:":",width:20},{type:"bi.number_editor",ref:function(){self.second=this},validationChecker:function(v){return BI.isNaturalNumber(v)&&BI.parseInt(v)<60},errorText:function(v){return BI.isNumeric(v)?BI.i18nText("BI-Basic_Input_From_To_Number",'"00-59"'):BI.i18nText("BI-Numerical_Interval_Input_Data")},listeners:[{eventName:BI.SignEditor.EVENT_CONFIRM,action:function(){var value=this.getValue();self._checkSecond(value),this.setValue(self._formatValueToDoubleDigit(value)),self.fireEvent(BI.DynamicDateTimeSelect.EVENT_CONFIRM)}}],width:60,height:24}]}]}},_checkBorder:function(v){v=v||{},this._checkHour(v.hour),this._checkMinute(v.minute),this._checkSecond(v.second)},_checkHour:function(value){this.hour.setDownEnable(BI.parseInt(value)>0),this.hour.setUpEnable(BI.parseInt(value)<23)},_checkMinute:function(value){this.minute.setDownEnable(BI.parseInt(value)>0),this.minute.setUpEnable(BI.parseInt(value)<59)},_checkSecond:function(value){this.second.setDownEnable(BI.parseInt(value)>0),this.second.setUpEnable(BI.parseInt(value)<59)},_autoSwitch:function(v,type){var limit=0,value=v+"";switch(type){case BI.DynamicDateTimeSelect.HOUR:limit=2;break;case BI.DynamicDateTimeSelect.MINUTE:limit=5}if(1===value.length&&BI.parseInt(value)>limit&&(value="0"+value),2===value.length)switch(type){case BI.DynamicDateTimeSelect.HOUR:this.hour.isEditing()&&this.minute.focus();break;case BI.DynamicDateTimeSelect.MINUTE:this.minute.isEditing()&&this.second.focus();break;case BI.DynamicDateTimeSelect.SECOND:}return value},_formatValueToDoubleDigit:function(v){(BI.isNull(v)||BI.isEmptyString(v))&&(v=0);var value=BI.parseInt(v);return value<10&&(value="0"+value),value},_assertValue:function(v){return v=v||{},v.hour=this._formatValueToDoubleDigit(v.hour)||"00",v.minute=this._formatValueToDoubleDigit(v.minute)||"00",v.second=this._formatValueToDoubleDigit(v.second)||"00",v},getValue:function(){return{hour:BI.parseInt(this.hour.getValue()),minute:BI.parseInt(this.minute.getValue()),second:BI.parseInt(this.second.getValue())}},setValue:function(v){v=this._assertValue(v),this.hour.setValue(v.hour),this.minute.setValue(v.minute),this.second.setValue(v.second),this._checkBorder(v)}}),BI.DynamicDateTimeSelect.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.dynamic_date_time_select",BI.DynamicDateTimeSelect),BI.extend(BI.DynamicDateTimeSelect,{HOUR:1,MINUTE:2,SECOND:3}),BI.DynamicDateTimeTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2,yearLength:4,yearMonthLength:6,yearFullMonthLength:7,compareFormat:"%Y-%X-%d %H:%M:%S"},props:{extraCls:"bi-date-time-trigger",min:"1900-01-01",max:"2099-12-31",height:24,format:"",allowEdit:!0,watermark:""},_init:function(){BI.DynamicDateTimeTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.storeTriggerValue="",this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){var formatStr=self._getStandardDateStr(v),date=formatStr.match(/\d+/g);return!BI.isKey(o.format)&&self._autoAppend(v,date),self._dateCheck(formatStr)&&BI.checkDateLegal(formatStr)&&self._checkVoid({year:0|date[0],month:0|date[1],day:0|date[2]})},quitChecker:function(){return!1},hgap:c.hgap,vgap:c.vgap,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(){var str="";return BI.isKey(o.format)||(str=self.editor.isEditing()?BI.i18nText("BI-Basic_Date_Time_Error_Text"):BI.i18nText("BI-Year_Trigger_Invalid_Text")),str},title:BI.bind(this._getTitle,this)}),this.editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN,arguments)}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.storeTriggerValue=self.getKey(),self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_BLUR,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_BLUR)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_VALID,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_VALID)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_ERROR)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var formatStr=self._getStandardDateStr(value),date=formatStr.match(/\d+/g);self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:0|date[0],month:0|date[1],day:0|date[2],hour:0|date[3],minute:0|date[4],second:0|date[5]}}}self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_CHANGE,function(){self.fireEvent(BI.DynamicDateTimeTrigger.EVENT_CHANGE)}),BI.createWidget({type:"bi.htape",element:this,items:[{el:this.editor},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.text",title:BI.bind(this._getTitle,this)},left:0,right:24,top:0,bottom:0}]}),this.setValue(o.value)},_getTitle:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.DynamicDateHelper.getCalculation(value),dateStr=BI.print(date,this._getFormatString());return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return BI.isNull(value)||BI.isNull(value.day)?"":BI.print(BI.getDate(value.year,value.month-1,value.day,value.hour||0,value.minute||0,value.second||0),this._getFormatString())}},_getStandardDateStr:function(v){var c=this._const,result=[],hasSecond=!1,formatArray=this._getFormatString().match(/%./g);BI.each(formatArray,function(idx,v){switch(v){case"%Y":case"%y":result[0]=idx;break;case"%X":case"%x":result[1]=idx;break;case"%d":case"%e":result[2]=idx;break;case"%S":hasSecond=!0}});var date=BI.parseDateTime(v,this._getFormatString());BI.print(date,this._getFormatString())===v&&(v=BI.print(date,c.compareFormat),result=[0,1,2]);var dateArray=v.match(/\d+/g)||[],newArray=[];BI.each(dateArray.slice(0,3),function(idx){newArray[idx]=dateArray[result[idx]]});var suffixArray=dateArray.slice(3);BI.each(suffixArray,function(idx,v){BI.isNumeric(v)&&1===v.length&&(suffixArray[idx]="0"+v)}),2!==suffixArray.length||hasSecond||suffixArray.push("00");var suffixString=suffixArray.join(":"),dateString=newArray.slice(0,3).join("-");return BI.isNotEmptyString(suffixString)&&(dateString+=" "+suffixString),dateString},_getFormatString:function(){return this.options.format||this._const.compareFormat},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){return!BI.checkDateVoid(obj.year,obj.month,obj.day,this.options.min,this.options.max)[0]},_autoAppend:function(v,dateObj){if(BI.isNotNull(dateObj)&&BI.checkDateLegal(v))switch(v.length){case this._const.yearLength:this._yearCheck(v)&&this.editor.setValue(v+"-");break;case this._const.yearMonthLength:case this._const.yearFullMonthLength:var splitMonth=v.split("-")[1];(BI.isNotNull(splitMonth)&&2===splitMonth.length||this._monthCheck(v))&&this.editor.setValue(v+"-")}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_monthCheck:function(v){var date=BI.parseDateTime(v,"%Y-%X-%d"),dateStr=BI.print(date,"%Y-%X-%d");return date.getMonth()>0&&(BI.print(BI.parseDateTime(v,"%Y-%X"),"%Y-%X")===v||BI.print(BI.parseDateTime(v,"%Y-%x"),"%Y-%x")===v)&&dateStr>=this.options.min&&dateStr<=this.options.max},_setInnerValue:function(date){var dateStr=BI.print(date,this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)},_getText:function(obj){function getPositionText(baseText,position){switch(position){case BI.DynamicDateCard.OFFSET.BEGIN:return baseText+BI.i18nText("BI-Basic_Begin_Start");case BI.DynamicDateCard.OFFSET.END:return baseText+BI.i18nText("BI-Basic_End_Stop");case BI.DynamicDateCard.OFFSET.CURRENT:default:return BI.i18nText("BI-Basic_Current_Day")}}var value="",endText="";return BI.isNotNull(obj.year)&&(0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Year"),obj.position)),BI.isNotNull(obj.quarter)&&(0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Single_Quarter"),obj.position)),BI.isNotNull(obj.month)&&(0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Month"),obj.position)),BI.isNotNull(obj.week)&&(0!==BI.parseInt(obj.week)&&(value+=Math.abs(obj.week)+BI.i18nText("BI-Basic_Week")+(obj.week<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=getPositionText(BI.i18nText("BI-Basic_Week"),obj.position)),BI.isNotNull(obj.day)&&(0!==BI.parseInt(obj.day)&&(value+=Math.abs(obj.day)+BI.i18nText("BI-Basic_Day")+(obj.day<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),endText=1===BI.size(obj)?getPositionText(BI.i18nText("BI-Basic_Month"),obj.position):""),BI.isNotNull(obj.workDay)&&0!==BI.parseInt(obj.workDay)&&(value+=Math.abs(obj.workDay)+BI.i18nText("BI-Basic_Work_Day")+(obj.workDay<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value+endText},setValue:function(v){var type,value,self=this,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:if(BI.isNull(value)||BI.isNull(value.day))this.editor.setState(""),this.editor.setValue("");else{var dateStr=BI.print(BI.getDate(value.year,value.month-1,value.day,value.hour||0,value.minute||0,value.second||0),this._getFormatString());this.editor.setState(dateStr),this.editor.setValue(dateStr)}}},getKey:function(){return this.editor.getValue()},getValue:function(){return this.storeValue},isValid:function(){return this.editor.isValid()}}),BI.DynamicDateTimeTrigger.EVENT_BLUR="EVENT_BLUR",BI.DynamicDateTimeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicDateTimeTrigger.EVENT_START="EVENT_START",BI.DynamicDateTimeTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicDateTimeTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicDateTimeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.DynamicDateTimeTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicDateTimeTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicDateTimeTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.DynamicDateTimeTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_date_time_trigger",BI.DynamicDateTimeTrigger),BI.SearchEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-search-editor bi-border bi-focus-shadow",height:24,errorText:"",watermark:BI.i18nText("BI-Basic_Search"),validationChecker:BI.emptyFn,quitChecker:BI.emptyFn})},_init:function(){this.options.height-=2,BI.SearchEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,watermark:o.watermark,allowBlank:!0,hgap:1,errorText:o.errorText,validationChecker:o.validationChecker,quitChecker:o.quitChecker,value:o.value}),this.clear=BI.createWidget({type:"bi.icon_button",stopEvent:!0,cls:"close-font"}),this.clear.on(BI.IconButton.EVENT_CHANGE,function(){self.setValue(""),self.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.STOPEDIT),self.fireEvent(BI.SearchEditor.EVENT_CHANGE),self.fireEvent(BI.SearchEditor.EVENT_CLEAR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:{type:"bi.icon_label",cls:"search-font"},width:24},{el:self.editor},{el:this.clear,width:24}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.SearchEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.SearchEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.SearchEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self._checkClear(),self.fireEvent(BI.SearchEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.SearchEditor.EVENT_KEY_DOWN,v)}),this.editor.on(BI.Editor.EVENT_SPACE,function(){self.fireEvent(BI.SearchEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(){self.fireEvent(BI.SearchEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.SearchEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.SearchEditor.EVENT_ERROR)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.SearchEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.SearchEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){self._checkClear(),self.fireEvent(BI.SearchEditor.EVENT_EMPTY)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(){self.fireEvent(BI.SearchEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.SearchEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.SearchEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.SearchEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.SearchEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.SearchEditor.EVENT_STOP)}),this.clear.invisible()},_checkClear:function(){this.getValue()?this.clear.visible():this.clear.invisible()},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},getValue:function(){if(this.isValid()){var res=this.editor.getValue().match(/[\S]+/g);return BI.isNull(res)?"":res[res.length-1]}},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(v){this.editor.setValue(v),BI.isKey(v)&&this.clear.visible()},isEditing:function(){return this.editor.isEditing()},isValid:function(){return this.editor.isValid()}}),BI.SearchEditor.EVENT_CHANGE="EVENT_CHANGE",BI.SearchEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SearchEditor.EVENT_BLUR="EVENT_BLUR",BI.SearchEditor.EVENT_CLICK="EVENT_CLICK",BI.SearchEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.SearchEditor.EVENT_SPACE="EVENT_SPACE",BI.SearchEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.SearchEditor.EVENT_CLEAR="EVENT_CLEAR",BI.SearchEditor.EVENT_START="EVENT_START",BI.SearchEditor.EVENT_PAUSE="EVENT_PAUSE",BI.SearchEditor.EVENT_STOP="EVENT_STOP",BI.SearchEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SearchEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SearchEditor.EVENT_VALID="EVENT_VALID",BI.SearchEditor.EVENT_ERROR="EVENT_ERROR",BI.SearchEditor.EVENT_ENTER="EVENT_ENTER",BI.SearchEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.SearchEditor.EVENT_REMOVE="EVENT_REMOVE",BI.SearchEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.search_editor",BI.SearchEditor),BI.SmallSearchEditor=BI.inherit(BI.SearchEditor,{_defaultConfig:function(){var conf=BI.SmallSearchEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-small-search-editor",height:20})},_init:function(){BI.SmallSearchEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_search_editor",BI.SmallSearchEditor),BI.TextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.TextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-text-editor bi-border bi-focus-shadow",hgap:4,vgap:2,lgap:0,rgap:0,tgap:0,bgap:0,validationChecker:BI.emptyFn,quitChecker:BI.emptyFn,allowBlank:!1,watermark:"",errorText:"",height:24})},_init:function(){BI.TextEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNumber(o.height)&&this.element.css({height:o.height-2}),BI.isNumber(o.width)&&this.element.css({width:o.width-2}),this.editor=BI.createWidget({type:"bi.editor",height:o.height-2,hgap:o.hgap,vgap:o.vgap,lgap:o.lgap,rgap:o.rgap,tgap:o.tgap,bgap:o.bgap,value:o.value,title:o.title,tipType:o.tipType,validationChecker:o.validationChecker,quitChecker:o.quitChecker,allowBlank:o.allowBlank,watermark:o.watermark,errorText:o.errorText}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_FOCUS,function(){self.fireEvent(BI.TextEditor.EVENT_FOCUS)}),this.editor.on(BI.Editor.EVENT_BLUR,function(){self.fireEvent(BI.TextEditor.EVENT_BLUR)}),this.editor.on(BI.Editor.EVENT_CLICK,function(){self.fireEvent(BI.TextEditor.EVENT_CLICK)}),this.editor.on(BI.Editor.EVENT_CHANGE,function(){self.fireEvent(BI.TextEditor.EVENT_CHANGE)}),this.editor.on(BI.Editor.EVENT_KEY_DOWN,function(v){self.fireEvent(BI.TextEditor.EVENT_KEY_DOWN)}),this.editor.on(BI.Editor.EVENT_SPACE,function(v){self.fireEvent(BI.TextEditor.EVENT_SPACE)}),this.editor.on(BI.Editor.EVENT_BACKSPACE,function(v){self.fireEvent(BI.TextEditor.EVENT_BACKSPACE)}),this.editor.on(BI.Editor.EVENT_VALID,function(){self.fireEvent(BI.TextEditor.EVENT_VALID)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self.fireEvent(BI.TextEditor.EVENT_CONFIRM)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self.fireEvent(BI.TextEditor.EVENT_CHANGE_CONFIRM)}),this.editor.on(BI.Editor.EVENT_REMOVE,function(v){self.fireEvent(BI.TextEditor.EVENT_REMOVE)}),this.editor.on(BI.Editor.EVENT_START,function(){self.fireEvent(BI.TextEditor.EVENT_START)}),this.editor.on(BI.Editor.EVENT_PAUSE,function(){self.fireEvent(BI.TextEditor.EVENT_PAUSE)}),this.editor.on(BI.Editor.EVENT_STOP,function(){self.fireEvent(BI.TextEditor.EVENT_STOP)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self.fireEvent(BI.TextEditor.EVENT_ERROR,arguments)}),this.editor.on(BI.Editor.EVENT_ENTER,function(){self.fireEvent(BI.TextEditor.EVENT_ENTER)}),this.editor.on(BI.Editor.EVENT_RESTRICT,function(){self.fireEvent(BI.TextEditor.EVENT_RESTRICT)}),this.editor.on(BI.Editor.EVENT_EMPTY,function(){ +self.fireEvent(BI.TextEditor.EVENT_EMPTY)}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]})},setWaterMark:function(v){this.options.watermark=v,this.editor.setWaterMark(v)},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isValid:function(){return this.editor.isValid()},setValue:function(v){this.editor.setValue(v)},getValue:function(){return this.editor.getValue()}}),BI.TextEditor.EVENT_CHANGE="EVENT_CHANGE",BI.TextEditor.EVENT_FOCUS="EVENT_FOCUS",BI.TextEditor.EVENT_BLUR="EVENT_BLUR",BI.TextEditor.EVENT_CLICK="EVENT_CLICK",BI.TextEditor.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TextEditor.EVENT_SPACE="EVENT_SPACE",BI.TextEditor.EVENT_BACKSPACE="EVENT_BACKSPACE",BI.TextEditor.EVENT_START="EVENT_START",BI.TextEditor.EVENT_PAUSE="EVENT_PAUSE",BI.TextEditor.EVENT_STOP="EVENT_STOP",BI.TextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.TextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.TextEditor.EVENT_VALID="EVENT_VALID",BI.TextEditor.EVENT_ERROR="EVENT_ERROR",BI.TextEditor.EVENT_ENTER="EVENT_ENTER",BI.TextEditor.EVENT_RESTRICT="EVENT_RESTRICT",BI.TextEditor.EVENT_REMOVE="EVENT_REMOVE",BI.TextEditor.EVENT_EMPTY="EVENT_EMPTY",BI.shortcut("bi.text_editor",BI.TextEditor),BI.SmallTextEditor=BI.inherit(BI.TextEditor,{_defaultConfig:function(){var conf=BI.SmallTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-small-text-editor",height:20})},_init:function(){BI.SmallTextEditor.superclass._init.apply(this,arguments)}}),BI.shortcut("bi.small_text_editor",BI.SmallTextEditor),BI.IntervalSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:58,EDITOR_R_GAP:60,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-interval-slider bi-slider-track",digit:!1,unit:""},render:function(){var self=this,c=this._constant;return this.enable=!1,this.valueOne="",this.valueTwo="",this.calculation=new BI.AccurateCalculationModel,this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.labelOne=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:c.EDITOR_WIDTH,validationChecker:function(v){return self._checkValidation(v)}}),this.labelOne.element.hover(function(){self.labelOne.element.removeClass("bi-border").addClass("bi-border")},function(){self.labelOne.element.removeClass("bi-border")}),this.labelOne.on(BI.Editor.EVENT_CONFIRM,function(){var oldValueOne=self.valueOne,v=BI.parseFloat(this.getValue());self.valueOne=v;var percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderOnePosition(significantPercent),self._setBlueTrack(),self._checkLabelPosition(oldValueOne,self.valueTwo,self.valueOne,self.valueTwo),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.labelTwo=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:this.options.unit,allowBlank:!1,width:c.EDITOR_WIDTH,validationChecker:function(v){return self._checkValidation(v)}}),this.labelTwo.element.hover(function(){self.labelTwo.element.removeClass("bi-border").addClass("bi-border")},function(){self.labelTwo.element.removeClass("bi-border")}),this.labelTwo.on(BI.Editor.EVENT_CONFIRM,function(){var oldValueTwo=self.valueTwo,v=BI.parseFloat(this.getValue());self.valueTwo=v;var percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderTwoPosition(significantPercent),self._setBlueTrack(),self._checkLabelPosition(self.valueOne,oldValueTwo,self.valueOne,self.valueTwo),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)}),this.sliderOne=BI.createWidget({type:"bi.single_slider_button"}),this.sliderTwo=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.sliderOne,!0),this._draggable(this.sliderTwo,!1),this._setVisible(!1),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:23,left:0,width:"100%"},this._createLabelWrapper(),this._createSliderWrapper()]}},_rePosBySizeAfterMove:function(size,isLeft){var o=this.options,percent=100*size/this._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1)),v=this._getValueByPercent(significantPercent);v=this._assertValue(v),v=o.digit===!1?v:v.toFixed(o.digit);var oldValueOne=this.valueOne,oldValueTwo=this.valueTwo;isLeft?(this._setSliderOnePosition(significantPercent),this.labelOne.setValue(v),this.valueOne=v,this._checkLabelPosition(oldValueOne,oldValueTwo,v,this.valueTwo)):(this._setSliderTwoPosition(significantPercent),this.labelTwo.setValue(v),this.valueTwo=v,this._checkLabelPosition(oldValueOne,oldValueTwo,this.valueOne,v)),this._setBlueTrack()},_rePosBySizeAfterStop:function(size,isLeft){var percent=100*size/this._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));isLeft?this._setSliderOnePosition(significantPercent):this._setSliderTwoPosition(significantPercent)},_draggable:function(widget,isLeft){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){mouseMoveTracker.isDragging()&&(startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging"),self._rePosBySizeAfterMove(size,isLeft))},function(){startDrag===!0&&(size=optimizeSize(size),self._rePosBySizeAfterStop(size,isLeft),size=0,offset=0,defaultSize=size,startDrag=!1),widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.IntervalSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createLabelWrapper:function(){var c=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.labelOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.labelTwo,top:0,left:"100%"}]}],rgap:c.EDITOR_R_GAP,height:c.SLIDER_HEIGHT},top:0,left:0,width:"100%"}},_createSliderWrapper:function(){var c=this._constant;return{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.sliderOne,top:0,left:"0%"}]},{type:"bi.absolute",items:[{el:this.sliderTwo,top:0,left:"100%"}]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT},top:20,left:0,width:"100%"}},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){var o=this.options,valid=!1,dotText=(v+"").split(".")[1];return BI.isEmptyString(dotText)||BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max)&&(o.digit===!1?valid=!0:(dotText=dotText||"",valid=dotText.length===o.digit)),valid},_checkOverlap:function(){var labelOneLeft=this.labelOne.element[0].offsetLeft,labelTwoLeft=this.labelTwo.element[0].offsetLeft;labelOneLeft<=labelTwoLeft?labelTwoLeft-labelOneLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0}):labelOneLeft-labelTwoLeft<90?this.labelTwo.element.css({top:40}):this.labelTwo.element.css({top:0})},_checkLabelPosition:function(oldValueOne,oldValueTwo,valueOne,valueTwo,isLeft){if(oldValueOne=BI.parseFloat(oldValueOne),oldValueTwo=BI.parseFloat(oldValueTwo),valueOne=BI.parseFloat(valueOne),valueTwo=BI.parseFloat(valueTwo),oldValueOne<=oldValueTwo&&valueOne>valueTwo||oldValueOne>=oldValueTwo&&valueOne-1){arr=pre.split("e");var decimalPartLength=BI.size(arr[0].split(".")[1]),sciencePartLength=BI.parseInt(arr[1].substring(1));return decimalPartLength-sciencePartLength}return arr=pre.split("."),arr.length>1?arr[1].length:0},_assertValue:function(value){return value<=this.min?this.min:value>=this.max?this.max:value},_setEnable:function(b){BI.IntervalSlider.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.valueOne<=this.valueTwo?{min:this.valueOne,max:this.valueTwo}:{min:this.valueTwo,max:this.valueOne}},setMinAndMax:function(v){var minNumber=BI.parseFloat(v.min),maxNumber=BI.parseFloat(v.max);!isNaN(minNumber)&&!isNaN(maxNumber)&&maxNumber>=minNumber&&(this.min=minNumber,this.max=maxNumber,this.valueOne=minNumber,this.valueTwo=maxNumber,this.precision=this._getPrecision(),this._setDraggableEnable(!0)),maxNumber===minNumber&&this._setDraggableEnable(!1)},setValue:function(v){var o=this.options,valueOne=BI.parseFloat(v.min),valueTwo=BI.parseFloat(v.max);valueOne=o.digit===!1?valueOne:valueOne.toFixed(o.digit),valueTwo=o.digit===!1?valueTwo:valueTwo.toFixed(o.digit),isNaN(valueOne)||isNaN(valueTwo)||(this._checkValidation(valueOne)&&(this.valueOne=this.valueOne<=this.valueTwo?valueOne:valueTwo),this._checkValidation(valueTwo)&&(this.valueTwo=this.valueOne<=this.valueTwo?valueTwo:valueOne),valueOnethis.max&&(this.valueTwo=this.max))},reset:function(){this._setVisible(!1),this.enable=!1,this.valueOne="",this.valueTwo="",this.min=NaN,this.max=NaN,this._setBlueTrackWidth(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this.enable=!0,this._setVisible(!0),this._setErrorText(),(BI.isNumeric(this.valueOne)||BI.isNotEmptyString(this.valueOne))&&(BI.isNumeric(this.valueTwo)||BI.isNotEmptyString(this.valueTwo))?(this.labelOne.setValue(this.valueOne),this.labelTwo.setValue(this.valueTwo),this._setAllPosition(this._getPercentByValue(this.valueOne),this._getPercentByValue(this.valueTwo))):(this.labelOne.setValue(this.min),this.labelTwo.setValue(this.max),this._setAllPosition(0,100)))}}),BI.IntervalSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.interval_slider",BI.IntervalSlider),BI.AccurateCalculationModel=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.AccurateCalculationModel.superclass._defaultConfig.apply(this,arguments),{baseCls:""})},_init:function(){BI.AccurateCalculationModel.superclass._init.apply(this,arguments)},_getMagnitude:function(n){for(var magnitude="1",i=0;i0)var needAddZero=stringNumber2;else{var needAddZero=stringNumber1;magnitudeDiff=0-magnitudeDiff}for(var i=0;i=num2.numDecimal.length?num1.numDecimal.length:num2.numDecimal.length}function addZero(resultTemp,length){for(var diff=length-resultTemp.length,i=0;i=BI.parseInt(stringNumber2.numDecimal))var decimalResultTemp=(BI.parseInt(stringNumber1.numDecimal)-BI.parseInt(stringNumber2.numDecimal)).toString(),decimalResult=addZero(decimalResultTemp,decimalMaxLength);else{integerResult--;var borrow=this._getMagnitude(decimalMaxLength),decimalResultTemp=(borrow+BI.parseInt(stringNumber1.numDecimal)-BI.parseInt(stringNumber2.numDecimal)).toString(),decimalResult=addZero(decimalResultTemp,decimalMaxLength)}var result=integerResult+"."+decimalResult;return BI.parseFloat(result)},_accurateAddition:function(num1,num2){function addZero(resultTemp,length){for(var diff=length-resultTemp.length,i=0;in)var integerResult=stringNumber.numInteger.slice(0,stringNumber.numInteger.length-n),partDecimalResult=stringNumber.numInteger.slice(-n);else var integerResult="0",partDecimalResult=addZero(stringNumber.numInteger,n);var result=integerResult+"."+partDecimalResult+stringNumber.numDecimal;return BI.parseFloat(result)},accurateSubtraction:function(num1,num2){return num1>=0&&num2>=0?num1>=num2?this._accurateSubtraction(num1,num2):-this._accurateSubtraction(num2,num1):num1>=0&&num2<0?this._accurateAddition(num1,-num2):num1<0&&num2>=0?-this._accurateAddition(-num1,num2):num1<0&&num2<0?num1>=num2?this._accurateSubtraction(-num2,-num1):this._accurateSubtraction(-num1,-num2):void 0},accurateAddition:function(num1,num2){return num1>=0&&num2>=0?this._accurateAddition(num1,num2):num1>=0&&num2<0?this.accurateSubtraction(num1,-num2):num1<0&&num2>=0?this.accurateSubtraction(num2,-num1):num1<0&&num2<0?-this._accurateAddition(-num1,-num2):void 0},accurateMultiplication:function(num1,num2){return num1>=0&&num2>=0?this._accurateMultiplication(num1,num2):num1>=0&&num2<0?-this._accurateMultiplication(num1,-num2):num1<0&&num2>=0?-this._accurateMultiplication(-num1,num2):num1<0&&num2<0?this._accurateMultiplication(-num1,-num2):void 0},accurateDivisionTenExponent:function(num1,n){return num1>=0?this._accurateDivisionTenExponent(num1,n):-this._accurateDivisionTenExponent(-num1,n)}}),BI.DownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.DownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-down-list-combo",height:24,items:[],adjustLength:0,direction:"bottom",trigger:"click",container:null,stopPropagation:!1,el:{}})},_init:function(){BI.DownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popupview=BI.createWidget({type:"bi.multi_layer_down_list_popup",items:o.items,chooseType:o.chooseType,value:o.value}),this.popupview.on(BI.DownListPopup.EVENT_CHANGE,function(value){self.fireEvent(BI.DownListCombo.EVENT_CHANGE,value),self.downlistcombo.hideView()}),this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE,function(value,fatherValue){self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,value,fatherValue),self.downlistcombo.hideView()}),this.downlistcombo=BI.createWidget({element:this,type:"bi.combo",trigger:o.trigger,isNeedAdjustWidth:!1,container:o.container,adjustLength:o.adjustLength,direction:o.direction,stopPropagation:o.stopPropagation,el:BI.createWidget(o.el,{type:"bi.icon_trigger",extraCls:o.iconCls?o.iconCls:"pull-down-font",width:o.width,height:o.height}),popup:{el:this.popupview,stopPropagation:o.stopPropagation,maxHeight:1e3}}),this.downlistcombo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.DownListCombo.EVENT_BEFORE_POPUPVIEW)})},hideView:function(){this.downlistcombo.hideView()},showView:function(e){this.downlistcombo.showView(e)},populate:function(items){this.popupview.populate(items)},setValue:function(v){this.popupview.setValue(v)},getValue:function(){return this.popupview.getValue()}}),BI.DownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.DownListCombo.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.DownListCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_layer_down_list_combo",BI.DownListCombo),BI.MultiLayerDownListPopup=BI.inherit(BI.Pane,{constants:{nextIcon:"pull-right-e-font",height:25,iconHeight:12,iconWidth:12,hgap:0,vgap:0,border:1},_defaultConfig:function(){var conf=BI.MultiLayerDownListPopup.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:"bi-down-list-popup",items:[],chooseType:BI.Selection.Multi})},_init:function(){BI.MultiLayerDownListPopup.superclass._init.apply(this,arguments),this.singleValues=[],this.childValueMap={},this.fatherValueMap={};var self=this,o=this.options,children=this._createPopupItems(o.items);this.popup=BI.createWidget({type:"bi.button_tree",items:BI.createItems(children,{},{adjustLength:-2}),layouts:[{type:"bi.vertical",hgap:this.constants.hgap,vgap:this.constants.vgap}],value:this._digest(o.value),chooseType:o.chooseType}),this.popup.on(BI.ButtonTree.EVENT_CHANGE,function(value,object){var changedValue=value;if(BI.isNotNull(self.childValueMap[value])){changedValue=self.childValueMap[value];var fatherValue=self.fatherValueMap[value],fatherArrayValue=(fatherValue+"").split("_");self.fireEvent(BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE,changedValue,fatherArrayValue.length>1?fatherArrayValue:fatherValue)}else self.fireEvent(BI.MultiLayerDownListPopup.EVENT_CHANGE,changedValue,object);if(!BI.contains(self.singleValues,changedValue)){var item=self.getValue(),result=[];BI.each(item,function(i,valueObject){valueObject.value!=changedValue&&result.push(valueObject)}),self.setValue(result)}}),BI.createWidget({type:"bi.vertical",element:this,items:[this.popup],vgap:5})},_createPopupItems:function(items){var self=this,result=[];return BI.each(items,function(i,it){var item_done={type:"bi.down_list_group",items:[]};if(BI.each(it,function(i,item){BI.isNotEmptyArray(item.children)&&!BI.isEmpty(item.el)?(item.type="bi.combo_group",item.cls="down-list-group",item.trigger="hover",item.isNeedAdjustWidth=!1,item.el.title=item.el.title||item.el.text,item.el.type="bi.down_list_group_item",item.el.logic={dynamic:!0},item.el.height=self.constants.height,item.el.iconCls2=self.constants.nextIcon,item.popup={lgap:1,el:{type:"bi.button_tree",chooseType:0,layouts:[{type:"bi.vertical"}]},innerVGap:5},item.el.childValues=[],BI.each(item.children,function(i,child){child=child.el?BI.extend(child.el,{children:child.children}):child;var fatherValue=BI.deepClone(item.el.value),childValue=BI.deepClone(child.value);self.singleValues.push(child.value),child.type="bi.down_list_item",child.extraCls=" child-down-list-item",child.title=child.title||child.text,child.textRgap=10,child.isNeedAdjustWidth=!1,child.logic={dynamic:!0},child.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,child.value=self._createChildValue(fatherValue,childValue),item.el.childValues.push(child.value),BI.isNotEmptyArray(child.children)&&(child.type="bi.down_list_group_item",self._createChildren(child),child.height=self.constants.height,child.iconCls2=self.constants.nextIcon,item.el.childValues=BI.concat(item.el.childValues,child.childValues))})):(item.type="bi.down_list_item",item.title=item.title||item.text,item.textRgap=10,item.isNeedAdjustWidth=!1,item.logic={dynamic:!0});var el_done={};el_done.el=item,item_done.items.push(el_done)}),self._isGroup(item_done.items)&&BI.each(item_done.items,function(i,item){self.singleValues.push(item.el.value)}),result.push(item_done),self._needSpliter(i,items.length)){var spliter_container=BI.createWidget({type:"bi.vertical",items:[{el:{type:"bi.layout",cls:"bi-down-list-spliter bi-border-top cursor-pointer",height:0}}],cls:"bi-down-list-spliter-container cursor-pointer",vgap:5,lgap:10});result.push(spliter_container)}}),result},_createChildren:function(child){var self=this;child.childValues=[],BI.each(child.children,function(i,c){var fatherValue=BI.deepClone(child.value),childValue=BI.deepClone(c.value);c.type="bi.down_list_item",c.title=c.title||c.text,c.textRgap=10,c.isNeedAdjustWidth=!1,c.logic={dynamic:!0},c.father=fatherValue,self.fatherValueMap[self._createChildValue(fatherValue,childValue)]=fatherValue,self.childValueMap[self._createChildValue(fatherValue,childValue)]=childValue,c.value=self._createChildValue(fatherValue,childValue),child.childValues.push(c.value)})},_isGroup:function(i){return i.length>1},_needSpliter:function(i,itemLength){return i1?fatherArrayValue:fartherValue}else valueItem.value=value;result.push(valueItem)}),result}}),BI.MultiLayerDownListPopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerDownListPopup.EVENT_SON_VALUE_CHANGE="EVENT_SON_VALUE_CHANGE",BI.shortcut("bi.multi_layer_down_list_popup",BI.MultiLayerDownListPopup),BI.MultiLayerSelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1})},render:function(){var self=this,o=this.options,combo=o.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return o.allowEdit||o.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:combo,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(_ref){self.triggerBtn=_ref},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}:combo},_getBaseConfig:function(){var self=this,o=this.options;return{type:"bi.combo",container:o.container,adjustLength:2,ref:function(_ref){self.combo=_ref},popup:{el:{type:"bi.multilayer_select_tree_popup",isDefaultInit:o.isDefaultInit,itemsCreator:o.itemsCreator,items:o.items,ref:function(_ref){self.trigger&&self.trigger.getSearcher().setAdapter(_ref)},listeners:[{eventName:BI.MultiLayerSelectTreePopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:400,minHeight:240}}},_getSearchConfig:function(){var self=this,o=this.options;return{el:{type:"bi.multilayer_select_tree_trigger",allowInsertValue:o.allowInsertValue,allowSearchValue:o.allowSearchValue,allowEdit:o.allowEdit,cls:"multilayer-select-tree-trigger",ref:function(_ref){self.trigger=_ref},items:o.items,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING,action:function(){self.fireEvent(BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM,action:function(){var value=self.trigger.getSearcher().getKeyword();self.combo.setValue([value]),self.combo.hideView()}}]},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}}]}},_getSyncConfig:function(){var o=this.options,baseConfig=this._getBaseConfig();return BI.extend(baseConfig,o.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}})},_getAsyncConfig:function(){var config=this._getBaseConfig();return BI.extend(config,this._getSearchConfig())},setValue:function(v){v=BI.isArray(v)?v:[v],this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this.combo.populate(items)}}),BI.MultiLayerSelectTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_combo",BI.MultiLayerSelectTreeCombo),BI.MultiLayerSelectTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var self=this,o=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){o.itemsCreator(op,function(res){callback(res),self.setKeyword(o.keywordGetter())})},keywordGetter:o.keywordGetter,value:o.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(_ref){self.addNotMatchTip=_ref},handler:function(){self.fireEvent(BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,o.keywordGetter())}},this.tree]}},setKeyword:function(keyword){var showTip=BI.isEmptyArray(this.tree.getAllLeaves()); +this.addNotMatchTip.setVisible(showTip),showTip&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSelectTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_insert_search_pane",BI.MultiLayerSelectTreeInsertSearchPane),BI.MultiLayerSelectLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,value:"",scrollable:!0})},_init:function(){var o=this.options;BI.MultiLayerSelectLevelTree.superclass._init.apply(this,arguments),this.storeValue=o.value,this.initTree(this.options.items),this.check()},_formatItems:function(nodes,layer,pNode){var self=this,o=this.options,keyword=o.keywordGetter();return BI.each(nodes,function(i,node){var extend={};node.layer=layer,BI.isKey(node.id)||(node.id=BI.UUID()),node.keyword=node.keyword||keyword,extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.multilayer_select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.multilayer_select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.multilayer_select_tree_first_plus_group_node"),0!==i||i!==nodes.length-1||pNode||(extend.type="bi.multilayer_select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){node.id=node.id||BI.UUID()})},initTree:function(nodes){var self=this,o=this.options,hasNext=!1;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{type:"bi.select_tree_expander",isDefaultInit:o.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),itemsCreator:function(op,callback){1===op.times&&!op.node&&BI.nextTick(function(){self.loading()}),o.itemsCreator(op,function(ob){hasNext=ob.hasNext,1===op.times&&!op.node&&self._populate(ob.items),callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items),op.node?op.node.layer+1:0,op.node)),self.setValue(self.storeValue),1===op.times&&!op.node&&BI.nextTick(function(){self.loaded()})})},value:o.value,el:{type:"bi.loader",isDefaultInit:o.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:o.chooseType,behaviors:o.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return hasNext}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,value){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&(self.setValue(value),self.fireEvent(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,arguments))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:o.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(nodes){this._populate(nodes),BI.isNull(nodes)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes),0))},setValue:function(v){this.options.chooseType===BI.Selection.None||(this.storeValue=v,this.tree.setValue(v))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.MultiLayerSelectLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_level_tree",BI.MultiLayerSelectLevelTree),BI.MultiLayerSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-select-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""})},_init:function(){BI.MultiLayerSelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator,keywordGetter:o.keywordGetter,value:o.value,scrollable:null}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSelectLevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.MultiLayerSelectTreePopup.EVENT_CHANGE)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_select_tree_popup",BI.MultiLayerSelectTreePopup),BI.MultiLayerSelectTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-select-tree-trigger bi-border bi-focus-shadow",height:24,valueFormatter:function(v){return v},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1}},render:function(){var self=this,o=this.options;o.itemsCreator===BI.emptyFn&&this._initData();var content={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value),value:o.value,height:o.height,tipText:"",watermark:o.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:o.allowInsertValue?"bi.multilayer_select_tree_insert_search_pane":"bi.multilayer_select_tree_popup",itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},keywordGetter:function(){return self.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSelectTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){self.options.text=self.getSearcher().getKeyword(),self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(_ref){self.popup=_ref}},onSearch:function(obj,callback){var keyword=obj.keyword;o.itemsCreator===BI.emptyFn?(callback(self._getSearchItems(keyword)),o.allowInsertValue&&self.popup.setKeyword(keyword)):callback()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)},stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData(items)},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSelectTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSelectTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSelectTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSelectTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSelectTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSelectTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSelectTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_select_tree_trigger",BI.MultiLayerSelectTreeTrigger),BI.MultiLayerSelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_first_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_first_plus_group_node",BI.MultiLayerSelectTreeFirstPlusGroupNode),BI.MultiLayerSelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-last-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_last_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_last_plus_group_node",BI.MultiLayerSelectTreeLastPlusGroupNode),BI.MultiLayerSelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-mid-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_mid_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_mid_plus_group_node",BI.MultiLayerSelectTreeMidPlusGroupNode),BI.MultiLayerSelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-select-tree-first-plus-group-node bi-list-item-active",layer:0,id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.MultiLayerSelectTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=BI.createWidget({type:"bi.select_tree_plus_group_node",cls:"bi-list-item-none",stopPropagation:!0,logic:{dynamic:!0},id:o.id,pId:o.pId,keyword:o.keyword,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py}),this.node.on(BI.Controller.EVENT_CHANGE,function(type){self.setSelected(self.isSelected()),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},isOnce:function(){return!0},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},isSelected:function(){return this.node.isSelected()},setSelected:function(b){BI.MultiLayerSelectTreePlusGroupNode.superclass.setSelected.apply(this,arguments),this.node.setSelected(b)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),this.node.setOpened(v)}}),BI.shortcut("bi.multilayer_select_tree_plus_group_node",BI.MultiLayerSelectTreePlusGroupNode),BI.MultiLayerSingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-tree-combo",isDefaultInit:!1,height:24,text:"",itemsCreator:BI.emptyFn,items:[],value:"",attributes:{tabIndex:0},allowEdit:!1,allowSearchValue:!1,allowInsertValue:!1})},render:function(){var self=this,o=this.options,combo=o.itemsCreator===BI.emptyFn?this._getSyncConfig():this._getAsyncConfig();return o.allowEdit||o.itemsCreator!==BI.emptyFn?{type:"bi.absolute",items:[{el:combo,left:0,right:0,top:0,bottom:0},{el:{type:"bi.trigger_icon_button",cls:"trigger-icon-button",ref:function(_ref){self.triggerBtn=_ref},width:o.height,height:o.height,handler:function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}},right:0,bottom:0,top:0}]}:combo},_getBaseConfig:function(){var self=this,o=this.options;return{type:"bi.combo",container:o.container,adjustLength:2,ref:function(_ref){self.combo=_ref},popup:{el:{type:"bi.multilayer_single_tree_popup",isDefaultInit:o.isDefaultInit,itemsCreator:o.itemsCreator,items:o.items,ref:function(_ref){self.trigger&&self.trigger.getSearcher().setAdapter(_ref)},listeners:[{eventName:BI.MultiLayerSingleTreePopup.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}}]},value:o.value,maxHeight:400,minHeight:240}}},_getSearchConfig:function(){var self=this,o=this.options;return{el:{type:"bi.multilayer_single_tree_trigger",allowInsertValue:o.allowInsertValue,allowSearchValue:o.allowSearchValue,allowEdit:o.allowEdit,cls:"multilayer-single-tree-trigger",ref:function(_ref){self.trigger=_ref},watermark:o.watermark,items:o.items,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,height:o.height-2,text:o.text,value:o.value,tipType:o.tipType,warningTitle:o.warningTitle,title:o.title,listeners:[{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE,action:function(){self.setValue(this.getValue()),self.combo.hideView(),self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_CHANGE)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_FOCUS)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_BLUR)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING,action:function(){self.fireEvent(BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING)}},{eventName:BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM,action:function(){var value=self.trigger.getSearcher().getKeyword();self.combo.setValue([value]),self.combo.hideView()}}]},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_AFTER_HIDEVIEW,action:function(){self.trigger.stopEditing()}}]}},_getSyncConfig:function(){var o=this.options,baseConfig=this._getBaseConfig();return BI.extend(baseConfig,o.allowEdit?this._getSearchConfig():{el:{type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}})},_getAsyncConfig:function(){var config=this._getBaseConfig();return BI.extend(config,this._getSearchConfig())},setValue:function(v){v=BI.isArray(v)?v:[v],this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this.combo.populate(items)}}),BI.MultiLayerSingleTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_combo",BI.MultiLayerSingleTreeCombo),BI.MultiLayerSingleTreeInsertSearchPane=BI.inherit(BI.Widget,{props:function(){return{baseCls:"bi-multilayer-single-tree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[],value:""}},render:function(){var self=this,o=this.options;return this.tree=BI.createWidget({type:"bi.multilayer_select_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){o.itemsCreator(op,function(res){callback(res),self.setKeyword(o.keywordGetter())})},keywordGetter:o.keywordGetter,value:o.value,scrollable:null,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.MultiLayerSelectLevelTree.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE)}}]}),{type:"bi.vertical",scrolly:!1,scrollable:!0,vgap:5,items:[{type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:24,cls:"bi-high-light",hgap:5,ref:function(_ref){self.addNotMatchTip=_ref},handler:function(){self.fireEvent(BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,o.keywordGetter())}},this.tree]}},setKeyword:function(keyword){var showTip=BI.isEmptyArray(this.tree.getAllLeaves());this.addNotMatchTip.setVisible(showTip),showTip&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiLayerSingleTreeInsertSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_insert_search_pane",BI.MultiLayerSingleTreeInsertSearchPane),BI.MultiLayerSingleLevelTree=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleLevelTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-single-level-tree",isDefaultInit:!1,items:[],itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,chooseType:BI.Selection.Single,scrollable:!0})},_init:function(){var o=this.options;BI.MultiLayerSingleLevelTree.superclass._init.apply(this,arguments),this.storeValue=o.value,this.initTree(this.options.items),this.check()},_formatItems:function(nodes,layer,pNode){var self=this,o=this.options,keyword=o.keywordGetter();return BI.each(nodes,function(i,node){var extend={};node.layer=layer,BI.isKey(node.id)||(node.id=BI.UUID()),node.keyword=node.keyword||keyword,extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.multilayer_single_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_plus_group_node"),0!==i||i!==nodes.length-1||pNode||(extend.type="bi.multilayer_single_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.multilayer_single_tree_mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.multilayer_single_tree_first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.multilayer_single_tree_last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_assertId:function(sNodes){BI.each(sNodes,function(i,node){node.id=node.id||BI.UUID()})},initTree:function(nodes){var self=this,o=this.options,hasNext=!1;this.empty(),this._assertId(nodes),this.tree=BI.createWidget({type:"bi.custom_tree",cls:"tree-view display-table",expander:{isDefaultInit:o.isDefaultInit,el:{},popup:{type:"bi.custom_tree"}},items:this._formatItems(BI.Tree.transformToTreeFormat(nodes),0),value:o.value,itemsCreator:function(op,callback){1===op.times&&!op.node&&BI.nextTick(function(){self.loading()}),o.itemsCreator(op,function(ob){hasNext=ob.hasNext,1===op.times&&!op.node&&self._populate(ob.items),callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items),op.node?op.node.layer+1:0,op.node)),self.setValue(self.storeValue),1===op.times&&!op.node&&BI.nextTick(function(){self.loaded()})})},el:{type:"bi.loader",isDefaultInit:o.itemsCreator!==BI.emptyFn,el:{type:"bi.button_tree",chooseType:o.chooseType,behaviors:o.behaviors,layouts:[{type:"bi.vertical"}]},hasNext:function(){return hasNext}}}),this.tree.on(BI.Controller.EVENT_CHANGE,function(type,v){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),type===BI.Events.CLICK&&(self.setValue(v),self.fireEvent(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,v))}),BI.createWidget({type:"bi.adaptive",element:this,scrollable:o.scrollable,items:[this.tree]})},_populate:function(){BI.MultiLayerSelectLevelTree.superclass.populate.apply(this,arguments)},populate:function(nodes){this._populate(nodes),BI.isNull(nodes)?this.tree.populate():this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(nodes),0))},setValue:function(v){this.options.chooseType===BI.Selection.None||(this.storeValue=v,this.tree.setValue(v))},getValue:function(){return BI.isArray(this.storeValue)?this.storeValue:BI.isNull(this.storeValue)?[]:[this.storeValue]},getAllLeaves:function(){return this.tree.getAllLeaves()},getNodeById:function(id){return this.tree.getNodeById(id)},getNodeByValue:function(id){return this.tree.getNodeByValue(id)}}),BI.MultiLayerSingleLevelTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_level_tree",BI.MultiLayerSingleLevelTree),BI.MultiLayerSingleTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multilayer-singletree-popup",tipText:BI.i18nText("BI-No_Selected_Item"),isDefaultInit:!1,itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.MultiLayerSingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.multilayer_single_level_tree",isDefaultInit:o.isDefaultInit,items:o.items,itemsCreator:o.itemsCreator,keywordGetter:o.keywordGetter,value:o.value,scrollable:null}),BI.createWidget({type:"bi.vertical",scrolly:!1,scrollable:!0,element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.MultiLayerSingleLevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.MultiLayerSingleTreePopup.EVENT_CHANGE)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){this.tree.populate(items)}}),BI.MultiLayerSingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multilayer_single_tree_popup",BI.MultiLayerSingleTreePopup),BI.MultiLayerSingleTreeTrigger=BI.inherit(BI.Trigger,{props:function(){return{extraCls:"bi-multi-layer-single-tree-trigger bi-border bi-focus-shadow",height:24,valueFormatter:function(v){return v},itemsCreator:BI.emptyFn,watermark:BI.i18nText("BI-Basic_Search"),allowSearchValue:!1}},render:function(){var self=this,o=this.options;o.itemsCreator===BI.emptyFn&&this._initData();var content={type:"bi.htape",items:[{el:{type:"bi.searcher",ref:function(){self.searcher=this},isAutoSearch:!1,el:{type:"bi.state_editor",ref:function(){self.editor=this},defaultText:o.text,text:this._digest(o.value),value:o.value,height:o.height,tipText:"",watermark:o.watermark,listeners:[{eventName:BI.StateEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS)}},{eventName:BI.StateEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_BLUR)}},{eventName:BI.StateEditor.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING)}}]},popup:{type:o.allowInsertValue?"bi.multilayer_single_tree_insert_search_pane":"bi.multilayer_single_tree_popup",itemsCreator:o.itemsCreator===BI.emptyFn?BI.emptyFn:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},keywordGetter:function(){return self.editor.getValue()},cls:"bi-card",listeners:[{eventName:BI.MultiLayerSingleTreeInsertSearchPane.EVENT_ADD_ITEM,action:function(){self.options.text=self.getSearcher().getKeyword(),self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM)}}],ref:function(_ref){self.popup=_ref}},onSearch:function(obj,callback){var keyword=obj.keyword;o.itemsCreator===BI.emptyFn?(callback(self._getSearchItems(keyword)),o.allowInsertValue&&self.popup.setKeyword(keyword)):callback()},listeners:[{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE)}}]}},{el:{type:"bi.layout",width:24},width:24}]};return o.allowEdit?content:{type:"bi.absolute",items:[{el:content,left:0,right:0,top:0,bottom:0},{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]}},_initData:function(){var o=this.options;this.tree=new BI.Tree,this.nodes=BI.Tree.treeFormat(BI.deepClone(o.items)),this.tree.initTree(this.nodes)},_getSearchItems:function(keyword){var self=this,o=this.options,items=[];return this.tree.traverse(function(node){var find=BI.Func.getSearchResult(self.tree.isRoot(node)?[]:BI.concat([node.text],o.allowSearchValue?[node.value]:[]),keyword);if(find.find.length>0||find.match.length>0)return items.push(node),!0}),this._fillTreeStructure4Search(items,"id")},_createJson:function(node,open){return{id:node.id,pId:node.pId,text:node.text,value:node.value,isParent:BI.isNotEmptyArray(node.children),open:open}},_getChildren:function(node){var self=this;node.children=node.children||[];var nodes=[];return BI.each(node.children,function(idx,child){var children=self._getChildren(child);nodes=nodes.concat(children)}),node.children.concat(nodes)},_fillTreeStructure4Search:function(leaves){var self=this,result=[],queue=[];for(BI.each(leaves,function(idx,node){queue.push({pId:node.pId}),result.push(node),result=result.concat(self._getChildren(node))});BI.isNotEmptyArray(queue);){var node=queue.pop(),pNode=this.tree.search(this.tree.getRoot(),node.pId,"id");null!=pNode&&(pNode.open=!0,queue.push({pId:pNode.pId}),result.push(pNode))}return BI.uniqBy(BI.map(result,function(idx,node){return self._createJson(node,node.open)}),"id")},_digest:function(v){var o=this.options;if(o.itemsCreator===BI.emptyFn){var result=BI.find(o.items,function(i,item){return item.value===v});return BI.isNotNull(result)?result.text:o.text}return o.valueFormatter(v)}, +stopEditing:function(){this.searcher.stopSearch()},getSearcher:function(){return this.searcher},populate:function(items){this.options.items=items,this._initData()},setValue:function(v){this.editor.setState(this._digest(v[0]))},getValue:function(){return this.searcher.getValue()}}),BI.MultiLayerSingleTreeTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiLayerSingleTreeTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiLayerSingleTreeTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiLayerSingleTreeTrigger.EVENT_STOP="EVENT_STOP",BI.MultiLayerSingleTreeTrigger.EVENT_START="EVENT_START",BI.MultiLayerSingleTreeTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiLayerSingleTreeTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multilayer_single_tree_trigger",BI.MultiLayerSingleTreeTrigger),BI.MultiLayerSingleTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-first-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.first_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_first_plus_group_node",BI.MultiLayerSingleTreeFirstPlusGroupNode),BI.MultiLayerSingleTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-last-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.last_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_last_plus_group_node",BI.MultiLayerSingleTreeLastPlusGroupNode),BI.MultiLayerSingleTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-mid-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.mid_plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_mid_plus_group_node",BI.MultiLayerSingleTreeMidPlusGroupNode),BI.MultiLayerSingleTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.MultiLayerSingleTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-multilayer-single-tree-plus-group-node bi-list-item",layer:0,id:"",pId:"",open:!1,height:24})},_init:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.node=this._createNode();for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.node),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doRedMark:function(){this.node.doRedMark.apply(this.node,arguments)},unRedMark:function(){this.node.unRedMark.apply(this.node,arguments)},doClick:function(){BI.MultiLayerSingleTreePlusGroupNode.superclass.doClick.apply(this,arguments),this.node.setSelected(this.isSelected())},setOpened:function(v){BI.MultiLayerSingleTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.node)&&this.node.setOpened(v)},_createNode:function(){var self=this,o=this.options;return BI.createWidget({type:"bi.plus_group_node",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,open:o.open,isLastNode:o.isLastNode,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]})}}),BI.shortcut("bi.multilayer_single_tree_plus_group_node",BI.MultiLayerSingleTreePlusGroupNode),BI.MultiLayerSingleTreeFirstTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-first-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.first_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeFirstTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_first_tree_leaf_item",BI.MultiLayerSingleTreeFirstTreeLeafItem),BI.MultiLayerSingleTreeLastTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-last-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.last_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeLastTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_last_tree_leaf_item",BI.MultiLayerSingleTreeLastTreeLeafItem),BI.MultiLayerSingleTreeMidTreeLeafItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-multilayer-single-tree-mid-tree-leaf-item bi-list-item-active",logic:{dynamic:!1},layer:0,id:"",pId:"",height:24})},_init:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.item=BI.createWidget({type:"bi.mid_tree_leaf_item",cls:"bi-list-item-none",logic:{dynamic:!0},id:o.id,pId:o.pId,height:o.height,hgap:o.hgap,text:o.text,value:o.value,py:o.py,keyword:o.keyword}),this.item.on(BI.Controller.EVENT_CHANGE,function(type){type!==BI.Events.CLICK&&self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)});for(var needBlankLayers=[],pNode=o.pNode;pNode;)pNode.isLastNode&&needBlankLayers.push(pNode.layer),pNode=pNode.pNode;var items=[];BI.count(0,o.layer,function(index){items.push({type:"bi.layout",cls:BI.contains(needBlankLayers,index)?"":"base-line-conn-background",width:12,height:o.height})}),items.push(this.item),BI.createWidget({type:"bi.td",element:this,columnSize:BI.makeArray(o.layer,12),items:[items]})},doHighLight:function(){this.item.doHighLight.apply(this.item,arguments)},unHighLight:function(){this.item.unHighLight.apply(this.item,arguments)},getId:function(){return this.options.id},getPId:function(){return this.options.pId},doClick:function(){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.doClick.apply(this,arguments),this.item.setSelected(this.isSelected())},setSelected:function(v){BI.MultiLayerSingleTreeMidTreeLeafItem.superclass.setSelected.apply(this,arguments),this.item.setSelected(v)}}),BI.shortcut("bi.multilayer_single_tree_mid_tree_leaf_item",BI.MultiLayerSingleTreeMidTreeLeafItem),BI.MultiSelectCheckPane=BI.inherit(BI.Widget,{constants:{height:12,lgap:10,tgap:10,bgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-pane bi-background",items:[],itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,onClickContinueSelect:BI.emptyFn})},_init:function(){BI.MultiSelectCheckPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.storeValue=opts.value||{},this.display=BI.createWidget({type:"bi.display_selected_list",items:opts.items,itemsCreator:function(op,callback){return op=BI.extend(op||{},{selectedValues:self.storeValue.value}),self.storeValue.type===BI.Selection.Multi?void callback({items:BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt}})}):void opts.itemsCreator(op,callback)}}),this.continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-select-check-selected bi-high-light"}),this.continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){opts.onClickContinueSelect()}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:{type:"bi.vertical_adapt",cls:"multi-select-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap},{el:this.continueSelect,lgap:this.constants.lgap}]},tgap:this.constants.tgap},{height:"fill",el:this.display,tgap:this.constants.bgap}]})},setValue:function(v){this.storeValue=v||{}},empty:function(){this.display.empty()},populate:function(){this.display.populate.apply(this.display,arguments)}}),BI.shortcut("bi.multi_select_check_pane",BI.MultiSelectCheckPane),BI.DisplaySelectedList=BI.inherit(BI.Pane,{constants:{height:24,lgap:10},_defaultConfig:function(){return BI.extend(BI.DisplaySelectedList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-display-list",itemsCreator:BI.emptyFn,items:[]})},_init:function(){BI.DisplaySelectedList.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.hasNext=!1,this.button_group=BI.createWidget({type:"bi.list_pane",element:this,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},items:this._createItems(opts.items),chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,layouts:[{type:"bi.vertical",lgap:10}]},itemsCreator:function(options,callback){opts.itemsCreator(options,function(ob){self.hasNext=!!ob.hasNext,callback(self._createItems(ob.items))})},hasNext:function(){return self.hasNext}})},_createItems:function(items){return BI.createItems(items,{type:"bi.icon_text_item",cls:"cursor-default check-font icon-size-12 display-list-item bi-tips",once:!0,invalid:!0,selected:!0,height:this.constants.height,logic:{dynamic:!0}})},empty:function(){this.button_group.empty()},populate:function(items){0===arguments.length?this.button_group.populate():this.button_group.populate(this._createItems(items))}}),BI.shortcut("bi.display_selected_list",BI.DisplaySelectedList),BI.MultiSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue=o.value||{},this._assertValue(this.storeValue),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,height:o.height,text:o.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue(""),self.fireEvent(BI.MultiSelectCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.MultiSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()}),self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()}),self.fireEvent(BI.MultiSelectCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:this.storeValue}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_combo",BI.MultiSelectCombo),BI.MultiSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.MultiSelectInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue=o.value||{},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",allowEdit:o.allowEdit,height:o.height,text:o.text,watermark:o.watermark,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&self._addItem(assertShowValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){this.getSearcher().hasMatched()||(self._addItem(assertShowValue),self._stopEditing())}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,el:this.trigger,adjustLength:1,container:o.container,popup:{type:"bi.multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()}),self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword), +assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectInsertCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_insert_combo",BI.MultiSelectInsertCombo),BI.MultiSelectInsertNoBarCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0}})},_init:function(){BI.MultiSelectInsertNoBarCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self.trigger.getSearcher().setState(self.storeValue),self.numberCounter.setButtonChecked(self.storeValue)};this.storeValue={type:BI.Selection.Multi,value:o.value||[]},this.requesting=!1,this.trigger=BI.createWidget({type:"bi.multi_select_insert_trigger",height:o.height,text:o.text,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:o.value}}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_START,function(){self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_PAUSE,function(){this.getSearcher().hasMatched()&&self._addItem(assertShowValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM,function(){this.getSearcher().hasMatched()||(self._addItem(assertShowValue),self._stopEditing())}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){self.numberCounter.updateSelectedValue(self.storeValue)}),this.trigger.on(BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_select_no_bar_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{type:BI.Selection.Multi,value:o.value},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self._stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,itemsCreator:BI.bind(this._itemsCreator4Trigger,this),value:{type:BI.Selection.Multi,value:o.value}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){this.updateSelectedValue(self.storeValue)}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_itemsCreator4Trigger:function(op,callback){var self=this,o=this.options;o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},_addItem:function(assertShowValue){var self=this,keyword=this.trigger.getSearcher().getKeyword();this._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue("")})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,o.itemsCreator({type:BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.combo.setValue(this.storeValue),this.numberCounter.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarCombo,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_select_insert_no_bar_combo",BI.MultiSelectInsertNoBarCombo),BI.MultiSelectInsertTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectInsertTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.multi_select_insert_searcher",height:o.height,text:o.text,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectInsertSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectInsertTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(width){this.wrapper.attr("items")[1].width=width,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectInsertTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectInsertTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectInsertTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertTrigger.EVENT_START="EVENT_START",BI.MultiSelectInsertTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectInsertTrigger.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_trigger",BI.MultiSelectInsertTrigger),BI.MultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",logic:opts.logic,toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Top),BI.extend({scrolly:!0,vgap:5},opts.logic,{items:BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Top,this.button_group)})))),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h-10)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.MultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_loader",BI.MultiSelectLoader),BI.MultiSelectNoBarLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget(BI.extend({type:"bi.list_pane",onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}},itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue},opts.el)),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectNoBarLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",cls:"bi-list-item-active",logic:this.options.logic,height:24,iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue.value)},getValue:function(){return{type:BI.Selection.Multi,value:this.button_group.getValue()}},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.element.css({"max-height":h+"px"})},resetWidth:function(){}}),BI.MultiSelectNoBarLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_no_bar_loader",BI.MultiSelectNoBarLoader),BI.MultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.multi_select_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_popup_view",BI.MultiSelectPopupView),BI.MultiSelectNoBarPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectNoBarPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.MultiSelectNoBarPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.multi_select_no_bar_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM)}})},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiSelectNoBarPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiSelectNoBarPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_select_no_bar_popup_view",BI.MultiSelectNoBarPopupView),BI.MultiSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.MultiSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-trigger bi-border bi-border-radius",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.MultiSelectTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.multi_select_searcher",height:o.height,text:o.text,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,watermark:o.watermark,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.MultiSelectSearcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_START)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_BLUR)}),this.searcher.on(BI.MultiSelectSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectTrigger.EVENT_FOCUS)}),this.wrapNumberCounter=BI.createWidget({type:"bi.layout"}),this.wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:this.wrapNumberCounter,width:0},{el:BI.createWidget(),width:24}]}),!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},refreshPlaceHolderWidth:function(width){this.wrapper.attr("items")[1].width=width,this.wrapper.resize()},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.MultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.MultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectTrigger.EVENT_START="EVENT_START",BI.MultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.MultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.MultiSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.shortcut("bi.multi_select_trigger",BI.MultiSelectTrigger),BI.MultiSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments); +}}),BI.MultiSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_select_search_insert_pane",BI.MultiSelectSearchInsertPane),BI.MultiSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-loader",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=BI.deepClone(opts.value),this.button_group=BI.createWidget({type:"bi.select_list",toolbar:{type:"bi.multi_select_bar",cls:"bi-list-item-active",iconWrapperWidth:36},element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:self.storeValue.value})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:{dynamic:!1},height:24,selected:this.isAllSelected(),cls:"bi-list-item-active",iconWrapperWidth:36})},isAllSelected:function(){return this.button_group.isAllSelected()},_filterValues:function(src){var o=this.options,keyword=o.keywordGetter(),values=BI.deepClone(src.value)||[],newValues=BI.map(values,function(i,v){return{text:o.valueFormatter(v)||v,value:v}});if(BI.isKey(keyword)){var search=BI.Func.getSearchResult(newValues,keyword);values=search.match.concat(search.find)}return BI.map(values,function(i,v){return{text:v.text,title:v.text,value:v.value,selected:src.type===BI.Selection.All}})},setValue:function(v){this.storeValue=BI.deepClone(v),this.button_group.setValue(v)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.MultiSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_loader",BI.MultiSelectSearchLoader),BI.MultiSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:24,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-search-pane bi-card",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiSelectSearchPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.multi_select_search_loader",keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(keyword){var btn,isVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();isVisible!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(isVisible),this.resizer.attr("items")[0].height=isVisible?this.constants.height:0,this.resizer.resize())},isAllSelected:function(){return this.loader.isAllSelected()},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.MultiSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_search_pane",BI.MultiSelectSearchPane),BI.MultiSelectCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-button",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectCheckSelectedButton.superclass._init.apply(this,arguments);var self=this,o=this.options;this.numberCounter=BI.createWidget({type:"bi.text_button",element:this,hgap:4,text:"0",textAlign:"center",textHeight:16,cls:"bi-high-light-background count-tip"}),this.numberCounter.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.numberCounter.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),this.numberCounter.element.hover(function(){self.numberCounter.setTag(self.numberCounter.getText()),self.numberCounter.setText(BI.i18nText("BI-Check_Selected"))},function(){self.numberCounter.setText(self.numberCounter.getTag())}),this.setVisible(!1),BI.isNotNull(o.value)&&this.setValue(o.value)},setValue:function(ob){var self=this,o=this.options;return ob||(ob={}),ob.type||(ob.type=BI.Selection.Multi),ob.value||(ob.value=[]),ob.type===BI.Selection.All?void o.itemsCreator({type:BI.MultiSelectCombo.REQ_GET_DATA_LENGTH},function(res){var length=res.count-ob.value.length;BI.nextTick(function(){self.numberCounter.setText(length),self.setVisible(length>0)})}):void BI.nextTick(function(){self.numberCounter.setText(ob.value.length),self.setVisible(ob.value.length>0)})},getValue:function(){}}),BI.MultiSelectCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_check_selected_button",BI.MultiSelectCheckSelectedButton),BI.MultiSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-editor",el:{},watermark:BI.i18nText("BI-Basic_Search")})},_init:function(){BI.MultiSelectEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.state_editor",element:this,height:o.height,watermark:o.watermark,allowBlank:!0,value:o.value,defaultText:o.text,text:o.text,tipType:o.tipType,warningTitle:o.warningTitle}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){self.fireEvent(BI.MultiSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(state){this.editor.setState(state)},setValue:function(v){this.editor.setValue(v)},setTipType:function(v){this.editor.setTipType(v)},getValue:function(){var v=this.editor.getState();return BI.isArray(v)&&v.length>0?v[v.length-1]:""},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},populate:function(items){}}),BI.MultiSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.MultiSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_select_editor",BI.MultiSelectEditor),BI.MultiSelectInsertSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectInsertSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",watermark:o.watermark,height:o.height,text:o.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_insert_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value,listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM)}}]},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(ob){var o=this.options;if(ob||(ob={}),ob.value||(ob.value=[]),ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectInsertSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectInsertSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectInsertSearcher.EVENT_START="EVENT_START",BI.MultiSelectInsertSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectInsertSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectInsertSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.MultiSelectInsertSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectInsertSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_insert_searcher",BI.MultiSelectInsertSearcher),BI.MultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.MultiSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",height:o.height,text:o.text,listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(ob){var o=this.options;if(ob||(ob={}),ob.value||(ob.value=[]),ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiSelectSearcher.EVENT_START="EVENT_START",BI.MultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.MultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.MultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.MultiSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.multi_select_searcher",BI.MultiSelectSearcher),BI.MultiSelectCheckSelectedSwitcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectCheckSelectedSwitcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-check-selected-switcher",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,el:{},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiSelectCheckSelectedSwitcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.button=BI.createWidget(o.el,{type:"bi.multi_select_check_selected_button",itemsCreator:o.itemsCreator,value:o.value}),this.button.on(BI.Events.VIEW,function(){self.fireEvent(BI.Events.VIEW,arguments)}),this.switcher=BI.createWidget({type:"bi.switcher",toggle:!1,element:this,el:this.button,popup:BI.extend({type:"bi.multi_select_check_pane",valueFormatter:o.valueFormatter,itemsCreator:o.itemsCreator,onClickContinueSelect:function(){self.switcher.hideView()},ref:function(_ref){self.checkPane=_ref},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.switcher.on(BI.Switcher.EVENT_TRIGGER_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE)}),this.switcher.on(BI.Switcher.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW)}),this.switcher.on(BI.Switcher.EVENT_AFTER_POPUPVIEW,function(){var me=this;BI.nextTick(function(){me.populate()})})},adjustView:function(){this.switcher.adjustView()},hideView:function(){this.switcher.empty(),this.switcher.hideView()},setAdapter:function(adapter){this.switcher.setAdapter(adapter)},setValue:function(v){this.switcher.setValue(v)},updateSelectedValue:function(v){this.checkPane.setValue(v)},setButtonChecked:function(v){this.button.setValue(v)},getValue:function(){},populate:function(items){this.switcher.populate.apply(this.switcher,arguments)}}),BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.multi_select_check_selected_switcher",BI.MultiSelectCheckSelectedSwitcher),BI.MultiSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value||{};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var keyword=self.trigger.getKeyword();self.trigger.hasMatched()||(self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self.adapter.populate(),self.storeValue.type===BI.Selection.Multi&&self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}),self._showAdapter()}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeywords(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE)})}}],value:o.value}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_list",BI.MultiSelectInsertList),BI.MultiSelectInsertNoBarList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiSelectInsertNoBarList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectInsertNoBarList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={type:BI.Selection.Multi,value:o.value||[]};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_no_bar_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{},value:{type:BI.Selection.Multi,value:o.value||[]}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_insert_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)},listeners:[{eventName:BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){var keyword=self.trigger.getKeyword();self.trigger.hasMatched()||(self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self.adapter.populate(),self.storeValue.type===BI.Selection.Multi&&self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE))}}]}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.storeValue.type===BI.Selection.Multi&&BI.pushDistinct(self.storeValue.value,keyword),self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeywords(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE)})}}],value:{type:BI.Selection.Multi,value:o.value||[]}}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:30,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,keywords:[self.trigger.getKeyword()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void callback()}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void callback()}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue={type:BI.Selection.Multi,value:v||[]},this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectInsertNoBarList,{ +REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectInsertNoBarList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_insert_no_bar_list",BI.MultiSelectInsertNoBarList),BI.MultiSelectList=BI.inherit(BI.Widget,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-list",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.MultiSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={};var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue))};this.adapter=BI.createWidget({type:"bi.multi_select_loader",cls:"popup-multi-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!1},el:{}}),this.adapter.on(BI.MultiSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}),this.searcherPane=BI.createWidget({type:"bi.multi_select_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(""),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(""),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();this.hasMatched()&&self._join({type:BI.Selection.Multi,value:[keyword]},function(){self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(""),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue("")):(self.adapter.setValue(self.storeValue),assertShowValue()),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)}):self._join(this.getValue(),function(){assertShowValue(),self.fireEvent(BI.MultiSelectList.EVENT_CHANGE)})}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),o.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),o.itemsCreator({type:BI.MultiSelectList.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&delete selectedMap[items[i]],BI.isNull(notSelectedMap[items[i]])&&newItems.push(item)}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.storeValue.type===BI.Selection.All&&self.storeValue.value.length>=self._count?self.storeValue={type:BI.Selection.Multi,value:[]}:self.storeValue.type===BI.Selection.Multi&&self.storeValue.value.length>=self._count&&(self.storeValue={type:BI.Selection.All,value:[]})}var self=this,o=this.options;this._count?(adjust(),callback()):o.itemsCreator({type:BI.MultiSelectList.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.MultiSelectList,{REQ_GET_DATA_LENGTH:1,REQ_GET_ALL_DATA:-1}),BI.MultiSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_list",BI.MultiSelectList),BI.MultiSelectTree=BI.inherit(BI.Single,{_constant:{EDITOR_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.MultiSelectTree.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTree.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue={value:{}},this.adapter=BI.createWidget({type:"bi.multi_select_tree_popup",itemsCreator:o.itemsCreator}),this.adapter.on(BI.MultiSelectTreePopup.EVENT_CHANGE,function(){self.searcher.isSearching()?self.storeValue={value:self.searcherPane.getValue()}:self.storeValue={value:self.adapter.getValue()},self.setSelectedValue(self.storeValue.value),self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.multi_tree_search_pane",cls:"bi-border-left bi-border-right bi-border-bottom",keywordGetter:function(){return self.searcher.getKeyword()},itemsCreator:function(op,callback){op.keyword=self.searcher.getKeyword(),o.itemsCreator(op,callback)}}),this.searcherPane.setVisible(!1),this.searcher=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.searcher.getKeyword()})},adapter:this.adapter,popup:this.searcherPane,masker:!1,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane()}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),BI.nextTick(function(){self.adapter.populate()})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.searcher.isSearching()?self.storeValue={value:self.searcherPane.getValue()}:self.storeValue={value:self.adapter.getValue()},self.setSelectedValue(self.storeValue.value),self.fireEvent(BI.MultiSelectTree.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){self._showAdapter()}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.searcher,height:this._constant.EDITOR_HEIGHT},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:this._constant.EDITOR_HEIGHT,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},resize:function(){},setSelectedValue:function(v){this.storeValue.value=v||{},this.adapter.setSelectedValue(v),this.searcherPane.setSelectedValue(v),this.searcher.setValue({value:v||{}})},setValue:function(v){this.adapter.setValue(v)},stopSearch:function(){this.searcher.stopSearch()},updateValue:function(v){this.adapter.updateValue(v)},getValue:function(){return this.storeValue.value},populate:function(){this.searcher.populate.apply(this.searcher,arguments),this.adapter.populate.apply(this.adapter,arguments)}}),BI.MultiSelectTree.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree",BI.MultiSelectTree),BI.MultiSelectTreePopup=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiSelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-tree-popup bi-border-left bi-border-right bi-border-bottom",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiSelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.popup=BI.createWidget({type:"bi.async_tree",element:this,itemsCreator:o.itemsCreator}),this.popup.on(BI.TreeView.EVENT_AFTERINIT,function(){self.fireEvent(BI.MultiSelectTreePopup.EVENT_AFTER_INIT)}),this.popup.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectTreePopup.EVENT_CHANGE)})},hasChecked:function(){return this.popup.hasChecked()},getValue:function(){return this.popup.getValue()},setValue:function(v){v||(v={}),this.popup.setValue(v)},setSelectedValue:function(v){v||(v={}),this.popup.setSelectedValue(v)},updateValue:function(v){this.popup.updateValue(v),this.popup.refresh()},populate:function(config){this.popup.stroke(config)}}),BI.MultiSelectTreePopup.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.MultiSelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_select_tree_popup",BI.MultiSelectTreePopup),BI.MultiTreeCheckPane=BI.inherit(BI.Pane,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-pane bi-background",onClickContinueSelect:BI.emptyFn,el:{type:"bi.display_tree"}})},_init:function(){BI.MultiTreeCheckPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.selectedValues={};var continueSelect=BI.createWidget({type:"bi.text_button",text:BI.i18nText("BI-Continue_Select"),cls:"multi-tree-check-selected"});continueSelect.on(BI.TextButton.EVENT_CHANGE,function(){opts.onClickContinueSelect(),BI.nextTick(function(){self.empty()})});var backToPopup=BI.createWidget({type:"bi.left",cls:"multi-tree-continue-select",items:[{el:{type:"bi.label",text:BI.i18nText("BI-Selected_Data")},lgap:this.constants.lgap,tgap:this.constants.tgap},{el:continueSelect,lgap:this.constants.lgap,tgap:this.constants.tgap}]});this.display=BI.createWidget(opts.el,{type:"bi.display_tree",cls:"bi-multi-tree-display",itemsCreator:function(op,callback){op.type=BI.TreeView.REQ_TYPE_GET_SELECTED_DATA,opts.itemsCreator(op,callback)},value:(opts.value||{}).value}),this.display.on(BI.Events.AFTERINIT,function(){self.fireEvent(BI.Events.AFTERINIT)}),this.display.on(BI.TreeView.EVENT_INIT,function(){backToPopup.setVisible(!1)}),this.display.on(BI.TreeView.EVENT_AFTERINIT,function(){backToPopup.setVisible(!0)}),BI.createWidget({type:"bi.vtape",element:this,items:[{height:this.constants.height,el:backToPopup},{height:"fill",el:this.display}]})},empty:function(){this.display.empty()},populate:function(configs){this.display.stroke(configs)},setValue:function(v){v||(v={}),this.display.setSelectedValue(v.value)},getValue:function(){}}),BI.MultiTreeCheckPane.EVENT_CONTINUE_CLICK="EVENT_CONTINUE_CLICK",BI.shortcut("bi.multi_tree_check_pane",BI.MultiTreeCheckPane),BI.MultiTreeCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",height:o.height,valueFormatter:o.valueFormatter,text:o.text,watermark:o.watermark,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",itemsCreator:o.itemsCreator},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self._stopEditing(),self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:{}}),self.fireEvent(BI.MultiTreeCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},masker:{offset:this.constants.offset},itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,value:{value:o.value||{}}}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||{},this.combo.setValue({value:v||{}}),this.numberCounter.setValue({value:v||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_combo",BI.MultiTreeCombo),BI.MultiTreeInsertCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-insert-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||{}},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,height:o.height,valueFormatter:o.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_tree_searcher",text:o.text,watermark:o.watermark,itemsCreator:o.itemsCreator,popup:{type:"bi.multi_tree_search_insert_pane",listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.storeValue.value[self.trigger.getSearcher().getKeyword()]={},self._assertShowValue(),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self._stopEditing()}}]}},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():{}};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,self.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self._stopEditing(),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:{}}),self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:this.constants.offset},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView()}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||{},this.combo.setValue({value:v||{}}),this.numberCounter.setValue({value:v||{}})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeInsertCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_insert_combo",BI.MultiTreeInsertCombo),BI.MultiTreeListCombo=BI.inherit(BI.Single,{constants:{offset:{top:0,left:0,right:0,bottom:25}},_defaultConfig:function(){return BI.extend(BI.MultiTreeListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-list-combo",itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,allowEdit:!0,allowInsertValue:!0})},_init:function(){function showCounter(){isSearching()?self.storeValue={value:self.trigger.getValue()}:isPopupView()&&(self.storeValue={value:self.combo.getValue()}),self.trigger.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}BI.MultiTreeListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,isInit=!1,want2showCounter=!1;this.storeValue={value:o.value||[]},this.trigger=BI.createWidget({type:"bi.multi_select_trigger",allowEdit:o.allowEdit,text:o.text,watermark:o.watermark,height:o.height,valueFormatter:o.valueFormatter,masker:{offset:this.constants.offset},searcher:{type:"bi.multi_list_tree_searcher",itemsCreator:o.itemsCreator,popup:{type:o.allowInsertValue?"bi.multi_tree_search_insert_pane":"bi.multi_tree_search_pane",el:{type:"bi.list_part_tree"},listeners:[{eventName:BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.storeValue.value.unshift([self.trigger.getSearcher().getKeyword()]),self._assertShowValue(),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self._stopEditing()}}]}},switcher:{el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane",el:{type:"bi.list_display_tree"},itemsCreator:o.itemsCreator}},value:{value:o.value||{}}}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.multi_tree_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this),self.numberCounter.setAdapter(this)},el:{type:"bi.list_async_tree"},listeners:[{eventName:BI.MultiTreePopup.EVENT_AFTERINIT,action:function(){self.numberCounter.adjustView(),isInit=!0,want2showCounter===!0&&showCounter()}},{eventName:BI.MultiTreePopup.EVENT_CHANGE,action:function(){change=!0;var val={type:BI.Selection.Multi,value:this.hasChecked()?this.getValue():[]};self.trigger.getSearcher().setState(val),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CONFIRM,action:function(){self.combo.hideView()}},{eventName:BI.MultiTreePopup.EVENT_CLICK_CLEAR,action:function(){clear=!0,self.setValue(),self._defaultState()}}],itemsCreator:o.itemsCreator,onLoaded:function(){BI.nextTick(function(){self.numberCounter.adjustView(),self.trigger.getSearcher().adjustView()})}},value:{value:o.value||{}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length&&0===self.numberCounter.element.find(e.target).length}});var change=!1,clear=!1,isSearching=function(){return self.trigger.getSearcher().isSearching()},isPopupView=function(){return self.combo.isViewVisible()};this.trigger.on(BI.MultiSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_FOCUS)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_BLUR)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){self.storeValue={value:self.combo.getValue()},this.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self.storeValue={value:this.getValue()},self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),BI.nextTick(function(){isPopupView()&&self.combo.populate()}),self.fireEvent(BI.MultiTreeListCombo.EVENT_STOP)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(){self.fireEvent(BI.MultiTreeListCombo.EVENT_SEARCHING)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_TRIGGER_CLICK,function(){self.combo.toggle()}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(){var checked=this.getSearcher().hasChecked(),val={type:BI.Selection.Multi,value:checked?{1:1}:{}};this.getSearcher().setState(checked?BI.Selection.Multi:BI.Selection.None),self.numberCounter.setButtonChecked(val),self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM,self.combo.getValue())}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){isSearching()||(change===!0&&(self.storeValue={value:self.combo.getValue()},change=!1),self.combo.setValue(self.storeValue),self.numberCounter.setValue(self.storeValue),self.populate())}),this.combo.on(BI.Combo.EVENT_BEFORE_HIDEVIEW,function(){isSearching()?(self.trigger.stopEditing(),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)):isPopupView()&&(self._stopEditing(),self.storeValue={value:self.combo.getValue()},clear===!0&&(self.storeValue={value:[]}),self.fireEvent(BI.MultiTreeListCombo.EVENT_CONFIRM)),clear=!1,change=!1});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.numberCounter.hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),this.numberCounter=BI.createWidget({type:"bi.multi_select_check_selected_switcher",el:{type:"bi.multi_tree_check_selected_button"},popup:{type:"bi.multi_tree_check_pane"},itemsCreator:o.itemsCreator,masker:{offset:{left:0,top:0,right:0,bottom:25}},valueFormatter:o.valueFormatter,value:o.value}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_TRIGGER_CHANGE,function(){self.combo.isViewVisible()||self.combo.showView(); +}),this.numberCounter.on(BI.MultiSelectCheckSelectedSwitcher.EVENT_BEFORE_POPUPVIEW,function(){want2showCounter===!1&&(want2showCounter=!0),isInit===!0&&(want2showCounter=null,showCounter())}),this.numberCounter.on(BI.Events.VIEW,function(b){BI.nextTick(function(){self.trigger.refreshPlaceHolderWidth(b===!0?self.numberCounter.element.outerWidth()+8:0)})}),this.trigger.element.click(function(e){self.trigger.element.find(e.target).length>0&&self.numberCounter.hideView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0},{el:{type:"bi.vertical_adapt",items:[this.numberCounter]},right:o.height,top:0,height:o.height}]})},_assertShowValue:function(){this.trigger.getSearcher().setState(this.storeValue),this.numberCounter.setButtonChecked(this.storeValue)},_stopEditing:function(){this.trigger.stopEditing(),this.numberCounter.hideView()},_defaultState:function(){this._stopEditing(),this.combo.hideView()},setValue:function(v){this.storeValue.value=v||[],this.combo.setValue({value:v||[]}),this.numberCounter.setValue({value:v||[]})},getValue:function(){return BI.deepClone(this.storeValue.value)},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.MultiTreeListCombo.EVENT_FOCUS="EVENT_FOCUS",BI.MultiTreeListCombo.EVENT_BLUR="EVENT_BLUR",BI.MultiTreeListCombo.EVENT_STOP="EVENT_STOP",BI.MultiTreeListCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.MultiTreeListCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeListCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.multi_tree_list_combo",BI.MultiTreeListCombo),BI.MultiTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-popup",maxWidth:"auto",minWidth:140,maxHeight:400,onLoaded:BI.emptyFn,el:{type:"bi.async_tree"}})},_init:function(){BI.MultiTreePopup.superclass._init.apply(this,arguments);var self=this,opts=this.options,v=opts.value;this.selectedValues={},this.tree=BI.createWidget(opts.el,{type:"bi.async_tree",height:400,cls:"popup-view-tree",itemsCreator:opts.itemsCreator,onLoaded:opts.onLoaded,value:v.value||{}}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",element:this,stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.tree}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.MultiTreePopup.EVENT_CLICK_CONFIRM)}}),this.tree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreePopup.EVENT_CHANGE)}),this.tree.on(BI.TreeView.EVENT_AFTERINIT,function(){self.fireEvent(BI.MultiTreePopup.EVENT_AFTERINIT)})},getValue:function(){return this.tree.getValue()},setValue:function(v){v||(v={}),this.tree.setSelectedValue(v.value)},populate:function(config){this.tree.stroke(config)},hasChecked:function(){return this.tree.hasChecked()},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.MultiTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreePopup.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreePopup.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreePopup.EVENT_AFTERINIT="EVENT_AFTERINIT",BI.shortcut("bi.multi_tree_popup_view",BI.MultiTreePopup),BI.MultiTreeCheckSelectedButton=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.MultiTreeCheckSelectedButton.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-check-selected-button",itemsCreator:BI.emptyFn})},_init:function(){BI.MultiTreeCheckSelectedButton.superclass._init.apply(this,arguments);var self=this;this.indicator=BI.createWidget({type:"bi.icon_button",cls:"check-font trigger-check-selected icon-size-12",width:15,height:15,stopPropagation:!0}),this.checkSelected=BI.createWidget({type:"bi.text_button",cls:"trigger-check-selected",invisible:!0,hgap:4,text:BI.i18nText("BI-Check_Selected"),textAlign:"center",textHeight:15}),this.checkSelected.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.checkSelected.on(BI.TextButton.EVENT_CHANGE,function(){self.fireEvent(BI.MultiSelectCheckSelectedButton.EVENT_CHANGE,arguments)}),BI.createWidget({type:"bi.horizontal",element:this,items:[this.indicator,this.checkSelected]}),this.element.hover(function(){self.indicator.setVisible(!1),self.checkSelected.setVisible(!0)},function(){self.indicator.setVisible(!0),self.checkSelected.setVisible(!1)}),this.setVisible(!1)},setValue:function(v){v||(v={});var show=BI.size(v.value)>0;this.setVisible(show),show&&(this.indicator.setVisible(!0),this.checkSelected.setVisible(!1))}}),BI.MultiTreeCheckSelectedButton.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.multi_tree_check_selected_button",BI.MultiTreeCheckSelectedButton),BI.MultiTreeSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:24},props:{baseCls:"bi-multi-tree-search-insert-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,el:{type:"bi.part_tree"}},render:function(){var self=this,opts=this.options;return{type:"bi.absolute",items:[{el:{type:"bi.text_button",invisible:!0,ref:function(_ref){self.addTip=_ref},text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",handler:function(){self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM,opts.keywordGetter())}},top:5,left:0,right:0},{el:BI.extend({type:"bi.part_tree",tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(op,callback){op.keyword=opts.keywordGetter(),opts.itemsCreator(op,function(res){callback(res),self.setKeyword(opts.keywordGetter(),res.items)})},ref:function(_ref){self.partTree=_ref},value:opts.value,listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}},{eventName:BI.TreeView.EVENT_CHANGE,action:function(){self.fireEvent(BI.MultiTreeSearchInsertPane.EVENT_CHANGE)}}]},opts.el),left:0,top:0,bottom:0,right:0}]}},setKeyword:function(keyword,nodes){var isAddTipVisible=BI.isEmptyArray(nodes);this.addTip.setVisible(isAddTipVisible),this.partTree.setVisible(!isAddTipVisible),isAddTipVisible&&this.addTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(v){this.setSelectedValue(v.value)},setSelectedValue:function(v){v||(v={}),this.partTree.setSelectedValue(v)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(op){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchInsertPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.MultiTreeSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.multi_tree_search_insert_pane",BI.MultiTreeSearchInsertPane),BI.MultiTreeSearchPane=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-search-pane bi-card",itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.MultiTreeSearchPane.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.partTree=BI.createWidget({type:"bi.part_tree",element:this,tipText:BI.i18nText("BI-No_Select"),itemsCreator:function(op,callback){op.keyword=opts.keywordGetter(),opts.itemsCreator(op,callback)},value:opts.value}),this.partTree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.partTree.on(BI.TreeView.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreeSearchPane.EVENT_CHANGE)})},hasChecked:function(){return this.partTree.hasChecked()},setValue:function(v){this.setSelectedValue(v.value)},setSelectedValue:function(v){v||(v={}),this.partTree.setSelectedValue(v)},getValue:function(){return this.partTree.getValue()},empty:function(){this.partTree.empty()},populate:function(op){this.partTree.stroke.apply(this.partTree,arguments)}}),BI.MultiTreeSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearchPane.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.MultiTreeSearchPane.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.multi_tree_search_pane",BI.MultiTreeSearchPane),BI.MultiListTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiListTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(v){return v},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiListTreeSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",height:o.height,el:{type:"bi.simple_state_editor",height:o.height}}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiListTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiListTreeSearcher.EVENT_CHANGE,arguments)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(ob){var o=this.options;ob||(ob={}),ob.value||(ob.value=[]);var count=0;if(BI.isNumber(ob))this.editor.setState(ob);else if(0===BI.size(ob.value))this.editor.setState(BI.Selection.None);else{var text="";BI.each(ob.value,function(idx,path){var childValue=BI.last(path);text+=(o.valueFormatter(childValue+"")||childValue)+"; ",count++}),count>20?this.editor.setState(BI.Selection.Multi):this.editor.setState(text)}},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiListTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiListTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiListTreeSearcher.EVENT_START="EVENT_START",BI.MultiListTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiListTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_list_tree_searcher",BI.MultiListTreeSearcher),BI.MultiTreeSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.MultiTreeSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-tree-searcher",itemsCreator:BI.emptyFn,valueFormatter:function(v){return v},popup:{},adapter:null,masker:{}})},_init:function(){BI.MultiTreeSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.multi_select_editor",watermark:o.watermark,height:o.height,el:{type:"bi.simple_state_editor",text:o.text,height:o.height},listeners:[{eventName:BI.MultiSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_FOCUS)}},{eventName:BI.MultiSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.MultiSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback({keyword:self.editor.getValue()})},el:this.editor,popup:BI.extend({type:"bi.multi_tree_search_pane",keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){op.keyword=self.editor.getValue(),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.MultiTreeSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.MultiTreeSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.MultiTreeSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setState:function(ob){function getChildrenNode(ob){var text="",index=0,size=BI.size(ob);return BI.each(ob,function(name,children){index++;var childNodes=getChildrenNode(children);text+=(o.valueFormatter(name+"")||name)+(""===childNodes?"":":"+childNodes)+(index===size?"":","),""===childNodes&&count++}),text}var o=this.options;ob||(ob={}),ob.value||(ob.value={});var count=0;if(BI.isNumber(ob))this.editor.setState(ob);else if(0===BI.size(ob.value))this.editor.setState(BI.Selection.None);else{var text="";BI.each(ob.value,function(name,children){var childNodes=getChildrenNode(children);text+=(o.valueFormatter(name+"")||name)+(""===childNodes?"":":"+childNodes)+"; ",""===childNodes&&count++}),count>20?this.editor.setState(BI.Selection.Multi):this.editor.setState(text)}},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.MultiTreeSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.MultiTreeSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.MultiTreeSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.MultiTreeSearcher.EVENT_START="EVENT_START",BI.MultiTreeSearcher.EVENT_STOP="EVENT_STOP",BI.MultiTreeSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.multi_tree_searcher",BI.MultiTreeSearcher),BI.NumberEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.NumberEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-number-editor bi-border bi-focus-shadow",validationChecker:function(){return!0},valueFormatter:function(v){return v},value:0,allowBlank:!1,errorText:"",step:1})},_init:function(){BI.NumberEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height-2,allowBlank:o.allowBlank,value:o.valueFormatter(o.value),validationChecker:o.validationChecker,errorText:o.errorText}),this.editor.on(BI.TextEditor.EVENT_CHANGE,function(){self.fireEvent(BI.NumberEditor.EVENT_CHANGE)}),this.editor.on(BI.TextEditor.EVENT_ERROR,function(){o.value=BI.parseFloat(this.getLastValidValue())}),this.editor.on(BI.TextEditor.EVENT_VALID,function(){o.value=BI.parseFloat(this.getValue())}),this.editor.on(BI.TextEditor.EVENT_CONFIRM,function(){self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.topBtn=BI.createWidget({type:"bi.icon_button",forceNotSelected:!0,trigger:"lclick,",cls:"add-up-font top-button bi-border-left bi-list-item-active2 icon-size-12"}),this.topBtn.on(BI.IconButton.EVENT_CHANGE,function(){self._finetuning(o.step),self.fireEvent(BI.NumberEditor.EVENT_CHANGE),self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),this.bottomBtn=BI.createWidget({type:"bi.icon_button",trigger:"lclick,",forceNotSelected:!0,cls:"minus-down-font bottom-button bi-border-left bi-list-item-active2 icon-size-12"}),this.bottomBtn.on(BI.IconButton.EVENT_CHANGE,function(){self._finetuning(-o.step),self.fireEvent(BI.NumberEditor.EVENT_CHANGE),self.fireEvent(BI.NumberEditor.EVENT_CONFIRM)}),BI.createWidget({type:"bi.htape",height:o.height-2,element:this,items:[this.editor,{el:{type:"bi.grid",columns:1,rows:2,items:[{column:0,row:0,el:this.topBtn},{column:0,row:1,el:this.bottomBtn}]},width:23}]})},focus:function(){this.editor.focus()},isEditing:function(){return this.editor.isEditing()},_finetuning:function(add){var v=BI.parseFloat(this.getValue());this.setValue(BI.add(v,add))},setUpEnable:function(v){this.topBtn.setEnable(!!v)},setDownEnable:function(v){this.bottomBtn.setEnable(!!v)},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},getValue:function(){return this.options.value},setValue:function(v){var o=this.options;o.value=v,this.editor.setValue(o.valueFormatter(v))}}),BI.NumberEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberEditor.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.number_editor",BI.NumberEditor),BI.NumberInterval=BI.inherit(BI.Single,{constants:{typeError:"typeBubble",numberError:"numberBubble",signalError:"signalBubble",editorWidth:114,columns:5,width:24,rows:1,numberErrorCls:"number-error",border:1,less:0,less_equal:1,numTip:"",adjustYOffset:2},_defaultConfig:function(){var conf=BI.NumberInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-number-interval"+(BI.isIE()&&BI.getIEVersion()<10?" hack":""),height:24,validation:"valid",closeMin:!0,allowBlank:!0,watermark:BI.i18nText("BI-Basic_Unrestricted")})},_init:function(){var self=this,c=this.constants,o=this.options;BI.NumberInterval.superclass._init.apply(this,arguments),this.smallEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.min,level:"warning",tipType:"success",title:function(){return self.smallEditor&&self.smallEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(v){return!!BI.isNumeric(v)||(self.smallEditorBubbleType=c.typeError,!1)},cls:"number-interval-small-editor bi-border"}),this.smallTip=BI.createWidget({type:"bi.label",text:o.numTip,height:o.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.smallEditor.element,items:[{el:this.smallTip,top:0,right:5}]}),this.bigEditor=BI.createWidget({type:"bi.number_interval_single_editor",height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.max,level:"warning",tipType:"success",title:function(){return self.bigEditor&&self.bigEditor.getValue()},quitChecker:function(){return!1},validationChecker:function(v){return!!BI.isNumeric(v)||(self.bigEditorBubbleType=c.typeError,!1)},cls:"number-interval-big-editor bi-border"}),this.bigTip=BI.createWidget({type:"bi.label",text:o.numTip,height:o.height-2,invisible:!0}),BI.createWidget({type:"bi.absolute",element:this.bigEditor.element,items:[{el:this.bigTip,top:0,right:5}]}),this.smallCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-small-combo bi-border-top bi-border-bottom bi-border-right",height:o.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),o.closeMin===!0?this.smallCombo.setValue(1):this.smallCombo.setValue(0),this.bigCombo=BI.createWidget({type:"bi.icon_combo",cls:"number-interval-big-combo bi-border-top bi-border-bottom bi-border-left",height:o.height-2,items:[{text:"("+BI.i18nText("BI-Less_Than")+")",iconCls:"less-font",value:0},{text:"("+BI.i18nText("BI-Less_And_Equal")+")",value:1,iconCls:"less-equal-font"}]}),o.closeMax===!0?this.bigCombo.setValue(1):this.bigCombo.setValue(0),this.label=BI.createWidget({type:"bi.label",text:BI.i18nText("BI-Basic_Value"),textHeight:o.height-2*c.border,width:c.width-2*c.border,height:o.height-2*c.border,level:"warning",tipType:"warning"}),this.left=BI.createWidget({type:"bi.htape",items:[{el:self.smallEditor},{el:self.smallCombo,width:c.width-c.border}]}),this.right=BI.createWidget({type:"bi.htape",items:[{el:self.bigCombo,width:c.width-c.border},{el:self.bigEditor,lgap:1}]}),BI.createWidget({element:self,type:"bi.center",hgap:15,height:o.height,items:[{type:"bi.absolute",items:[{el:self.left,left:-15,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:0,right:-15,top:0,bottom:0}]}]}),BI.createWidget({element:self,type:"bi.horizontal_auto",items:[self.label]}),self._setValidEvent(self.bigEditor,c.bigEditor),self._setValidEvent(self.smallEditor,c.smallEditor),self._setErrorEvent(self.bigEditor,c.bigEditor),self._setErrorEvent(self.smallEditor,c.smallEditor),self._setBlurEvent(self.bigEditor),self._setBlurEvent(self.smallEditor),self._setFocusEvent(self.bigEditor),self._setFocusEvent(self.smallEditor),self._setComboValueChangedEvent(self.bigCombo),self._setComboValueChangedEvent(self.smallCombo),self._setEditorValueChangedEvent(self.bigEditor),self._setEditorValueChangedEvent(self.smallEditor),self._checkValidation()},_checkValidation:function(){var self=this,c=this.constants,o=this.options;if(self._setTitle(""),BI.Bubbles.hide(c.typeError),BI.Bubbles.hide(c.numberError),BI.Bubbles.hide(c.signalError),!self.smallEditor.isValid()||!self.bigEditor.isValid())return self.element.removeClass("number-error"),o.validation="invalid",c.typeError;if(BI.isEmptyString(self.smallEditor.getValue())||BI.isEmptyString(self.bigEditor.getValue()))return self.element.removeClass("number-error"),o.validation="valid","";var smallValue=parseFloat(self.smallEditor.getValue()),bigValue=parseFloat(self.bigEditor.getValue()),bigComboValue=self.bigCombo.getValue(),smallComboValue=self.smallCombo.getValue();return bigComboValue[0]===c.less_equal&&smallComboValue[0]===c.less_equal?smallValue>bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.numberError):(self.element.removeClass("number-error"),o.validation="valid",""):smallValue>bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.numberError):smallValue===bigValue?(self.element.addClass("number-error"),o.validation="invalid",c.signalError):(self.element.removeClass("number-error"),o.validation="valid","")},_setTitle:function(v){var self=this;self.bigEditor.setTitle(v),self.smallEditor.setTitle(v),self.label.setTitle(v)},_setFocusEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,function(){switch(self._setTitle(""),self._checkValidation()){case c.typeError:BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;default:return}})},_setBlurEvent:function(w){var c=this.constants,self=this;w.on(BI.NumberIntervalSingleEidtor.EVENT_BLUR,function(){switch(BI.Bubbles.hide(c.typeError),BI.Bubbles.hide(c.numberError),BI.Bubbles.hide(c.signalError),self._checkValidation()){case c.typeError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data"));break;case c.numberError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value"));break;case c.signalError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value"));break;default:self._setTitle("")}})},_setErrorEvent:function(w){var c=this.constants,self=this;w.on(BI.NumberIntervalSingleEidtor.EVENT_ERROR,function(){self._checkValidation(),BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR)})},_setValidEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_VALID,function(){switch(self._checkValidation()){case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset}),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:self.fireEvent(BI.NumberInterval.EVENT_VALID)}})},_setEditorValueChangedEvent:function(w){var self=this,c=this.constants;w.on(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,function(){switch(self._checkValidation()){case c.typeError:BI.Bubbles.show(c.typeError,BI.i18nText("BI-Numerical_Interval_Input_Data"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.numberError:BI.Bubbles.show(c.numberError,BI.i18nText("BI-Numerical_Interval_Number_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset});break;case c.signalError:BI.Bubbles.show(c.signalError,BI.i18nText("BI-Numerical_Interval_Signal_Value"),self,{offsetStyle:"left",adjustYOffset:c.adjustYOffset})}self.fireEvent(BI.NumberInterval.EVENT_CHANGE)}),w.on(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,function(){self.fireEvent(BI.NumberInterval.EVENT_CONFIRM)})},_setComboValueChangedEvent:function(w){var self=this,c=this.constants;w.on(BI.IconCombo.EVENT_CHANGE,function(){switch(self._checkValidation()){case c.typeError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Input_Data")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.numberError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Number_Value")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;case c.signalError:self._setTitle(BI.i18nText("BI-Numerical_Interval_Signal_Value")),self.fireEvent(BI.NumberInterval.EVENT_ERROR);break;default:self.fireEvent(BI.NumberInterval.EVENT_CHANGE),self.fireEvent(BI.NumberInterval.EVENT_CONFIRM),self.fireEvent(BI.NumberInterval.EVENT_VALID)}})},isStateValid:function(){return"valid"===this.options.validation},setMinEnable:function(b){this.smallEditor.setEnable(b)},setCloseMinEnable:function(b){this.smallCombo.setEnable(b)},setMaxEnable:function(b){this.bigEditor.setEnable(b)},setCloseMaxEnable:function(b){this.bigCombo.setEnable(b)},showNumTip:function(){this.smallTip.setVisible(!0),this.bigTip.setVisible(!0)},hideNumTip:function(){this.smallTip.setVisible(!1),this.bigTip.setVisible(!1)},setNumTip:function(numTip){this.smallTip.setText(numTip),this.bigTip.setText(numTip)},getNumTip:function(){return this.smallTip.getText()},setValue:function(data){data=data||{};var self=this,combo_value;(BI.isNumeric(data.min)||BI.isEmptyString(data.min))&&self.smallEditor.setValue(data.min),BI.isNotNull(data.min)||self.smallEditor.setValue(""),(BI.isNumeric(data.max)||BI.isEmptyString(data.max))&&self.bigEditor.setValue(data.max),BI.isNotNull(data.max)||self.bigEditor.setValue(""),BI.isNull(data.closeMin)||(combo_value=data.closeMin===!0?1:0,self.smallCombo.setValue(combo_value)),BI.isNull(data.closeMax)||(combo_value=data.closeMax===!0?1:0,self.bigCombo.setValue(combo_value)),this._checkValidation()},getValue:function(){var self=this,value={},minComboValue=self.smallCombo.getValue(),maxComboValue=self.bigCombo.getValue();return value.min=self.smallEditor.getValue(),value.max=self.bigEditor.getValue(),0===minComboValue[0]?value.closeMin=!1:value.closeMin=!0,0===maxComboValue[0]?value.closeMax=!1:value.closeMax=!0,value},destroyed:function(){var c=this.constants;BI.Bubbles.remove(c.typeError),BI.Bubbles.remove(c.numberError),BI.Bubbles.remove(c.signalError)}}),BI.NumberInterval.EVENT_CHANGE="EVENT_CHANGE",BI.NumberInterval.EVENT_CONFIRM="EVENT_CONFIRM",BI.NumberInterval.EVENT_VALID="EVENT_VALID",BI.NumberInterval.EVENT_ERROR="EVENT_ERROR",BI.shortcut("bi.number_interval",BI.NumberInterval),BI.NumberIntervalSingleEidtor=BI.inherit(BI.Single,{props:{baseCls:"bi-number-interval-single-editor",tipType:"success",title:""},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.editor",ref:function(_ref){self.editor=_ref},height:o.height-2,watermark:o.watermark,allowBlank:o.allowBlank,value:o.value,level:o.level,quitChecker:o.quitChecker,validationChecker:o.validationChecker,listeners:[{eventName:BI.Editor.EVENT_ERROR,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_ERROR,arguments)}},{eventName:BI.Editor.EVENT_FOCUS,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_FOCUS,arguments)}},{eventName:BI.Editor.EVENT_BLUR,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_BLUR,arguments)}},{eventName:BI.Editor.EVENT_VALID,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_VALID,arguments)}},{eventName:BI.Editor.EVENT_CHANGE,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE,arguments)}},{eventName:BI.Editor.EVENT_CONFIRM,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CONFIRM,arguments)}},{eventName:BI.Editor.EVENT_CHANGE_CONFIRM,action:function(){self.fireEvent(BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM,arguments)}}]}]}},isValid:function(){return this.editor.isValid()},getValue:function(){return this.editor.getValue()},setTitle:function(v){return this.editor.setTitle(v)},setValue:function(v){return this.editor.setValue(v)}}),BI.NumberIntervalSingleEidtor.EVENT_FOCUS="EVENT_FOCUS",BI.NumberIntervalSingleEidtor.EVENT_BLUR="EVENT_BLUR",BI.NumberIntervalSingleEidtor.EVENT_ERROR="EVENT_ERROR",BI.NumberIntervalSingleEidtor.EVENT_VALID="EVENT_VALID",BI.NumberIntervalSingleEidtor.EVENT_CHANGE="EVENT_CHANGE",BI.NumberIntervalSingleEidtor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.NumberIntervalSingleEidtor.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.number_interval_single_editor",BI.NumberIntervalSingleEidtor),BI.SearchMultiTextValueCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SearchMultiTextValueCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-combo bi-search-multi-text-value-combo",height:24,items:[]})},_init:function(){BI.SearchMultiTextValueCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,self._startValue):BI.pushDistinct(self.storeValue.value,self._startValue)),self._updateAllValue(),self._checkError(),self.trigger.getSearcher().setState(self.storeValue),self.trigger.getCounter().setButtonChecked(self.storeValue)};this.storeValue=BI.deepClone(o.value||{}),this._updateAllValue(),this._assertValue(this.storeValue),this._checkError(),this.requesting=!1,this.trigger=BI.createWidget({type:"bi.search_multi_select_trigger",text:o.text,height:o.height,masker:{offset:{left:0,top:0,right:0,bottom:25}},allValueGetter:function(){return self.allValue},valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){self._itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(BI.deepClone(self.getValue())),callback.apply(self,arguments)})},value:this.storeValue,warningTitle:o.warningTitle}),this.trigger.on(BI.MultiSelectTrigger.EVENT_START,function(){ +self._setStartValue(""),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP,function(){self._setStartValue("")}),this.trigger.on(BI.MultiSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self._join({type:BI.Selection.Multi,value:[keyword]},function(){self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self._populate(),self._setStartValue("")})}}),this.trigger.on(BI.MultiSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue("")):(self.combo.setValue(self.storeValue),assertShowValue())})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_CHANGE,function(value,obj){obj instanceof BI.MultiSelectBar?self._joinAll(this.getValue(),function(){assertShowValue()}):self._join(this.getValue(),function(){assertShowValue()})}),this.trigger.on(BI.MultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW,function(){this.getCounter().setValue(self.storeValue)}),this.trigger.on(BI.MultiSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",toggle:!1,container:o.container,el:this.trigger,adjustLength:1,popup:{type:"bi.search_multi_select_popup_view",ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.MultiSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue()})}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CONFIRM,action:function(){self._defaultState()}},{eventName:BI.MultiSelectPopupView.EVENT_CLICK_CLEAR,action:function(){self.setValue(),self._defaultState()}}],itemsCreator:BI.bind(self._itemsCreator,this),valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getCounter().adjustView(),self.trigger.getSearcher().adjustView()})}},value:o.value,hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self._populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:(assertShowValue(),self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM))});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"multi-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.trigger.getCounter().hideView(),self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]}),this._checkError()},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){var o=this.options;val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[]),BI.remove(val.value,function(idx,value){return!BI.contains(BI.map(o.items,"value"),value)})},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Multi?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_joinAll:function(res,callback){var self=this,o=this.options;this._assertValue(res),this.requesting=!0,this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_ALL_DATA,keywords:[this.trigger.getKey()]},function(ob){var items=BI.map(ob.items,"value");if(self.storeValue.type===res.type){var change=!1,map=self._makeMap(self.storeValue.value);return BI.each(items,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(self.storeValue.value=BI.values(map)),void self._adjust(callback)}var selectedMap=self._makeMap(self.storeValue.value),notSelectedMap=self._makeMap(res.value),newItems=[];BI.each(items,function(i,item){BI.isNotNull(selectedMap[items[i]])&&(self.storeValue.assist&&self.storeValue.assist.push(selectedMap[items[i]]),delete selectedMap[items[i]]),BI.isNull(notSelectedMap[items[i]])&&(BI.remove(self.storeValue.assist,item),newItems.push(item))}),self.storeValue.value=newItems.concat(BI.values(selectedMap)),self._adjust(callback)})},_adjust:function(callback){function adjust(){self.storeValue.type===BI.Selection.All&&self.storeValue.value.length>=self._count?self.storeValue={type:BI.Selection.Multi,value:[]}:self.storeValue.type===BI.Selection.Multi&&self.storeValue.value.length>=self._count&&(self.storeValue={type:BI.Selection.All,value:[]}),self._updateAllValue(),self._checkError(),self.wants2Quit===!0&&(self.fireEvent(BI.SearchMultiTextValueCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;this._count?(adjust(),callback()):this._itemsCreator({type:BI.SearchMultiTextValueCombo.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_join:function(res,callback){var self=this,o=this.options;if(this._assertValue(res),this._assertValue(this.storeValue),this.storeValue.type===res.type){var map=this._makeMap(this.storeValue.value);BI.each(res.value,function(i,v){map[v]||(self.storeValue.value.push(v),BI.remove(self.storeValue.assist,v),map[v]=v)});var change=!1;return BI.each(res.assist,function(i,v){BI.isNotNull(map[v])&&(change=!0,self.storeValue.assist&&self.storeValue.assist.push(map[v]),delete map[v])}),change&&(this.storeValue.value=BI.values(map)),void self._adjust(callback)}this._joinAll(res,callback)},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},_getItemsByTimes:function(items,times){for(var res=[],i=100*(times-1);items[i]&&i<100*times;i++)res.push(items[i]);return res},_hasNextByTimes:function(items,times){return 100*times0&&self.numberCounter.hideView()})},getCounter:function(){return this.numberCounter},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch(),this.numberCounter.hideView()},setAdapter:function(adapter){this.searcher.setAdapter(adapter),this.numberCounter.setAdapter(adapter)},setValue:function(ob){this.searcher.setValue(ob),this.numberCounter.setValue(ob)},setTipType:function(v){this.searcher.setTipType(v)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SearchMultiSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SearchMultiSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SearchMultiSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectTrigger.EVENT_START="EVENT_START",BI.SearchMultiSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SearchMultiSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.shortcut("bi.search_multi_select_trigger",BI.SearchMultiSelectTrigger),BI.SearchMultiSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-loader",logic:{dynamic:!0},el:{height:400},valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value||{},this._assertValue(this.storeValue),this.button_group=BI.createWidget({type:"bi.select_list",element:this,logic:opts.logic,el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_MULTI,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;self.storeValue&&(op=BI.extend(op||{},{selectedValues:BI.isKey(startValue)&&self.storeValue.type===BI.Selection.Multi?self.storeValue.value.concat(startValue):self.storeValue.value})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&self.storeValue){var json=BI.map(self.storeValue.value,function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:self.storeValue.type===BI.Selection.Multi}});if(BI.isKey(self._startValue)&&!BI.contains(self.storeValue.value,self._startValue)){var txt=opts.valueFormatter(startValue)||startValue;json.unshift({text:txt,value:startValue,title:txt,selected:!0})}firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue.type===BI.Selection.All?BI.remove(self.storeValue.value,startValue):BI.pushDistinct(self.storeValue.value,startValue)),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:"bi.multi_select_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:this.isAllSelected(),iconWrapperWidth:36})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},isAllSelected:function(){return this.button_group.isAllSelected()},_assertValue:function(val){val||(val={}),val.type||(val.type=BI.Selection.Multi),val.value||(val.value=[])},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v||{},this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){arguments[0]=this._createItems(items),this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SearchMultiSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.search_multi_select_loader",BI.SearchMultiSelectLoader),BI.SearchMultiSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-popup-view",maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SearchMultiSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.search_multi_select_loader",itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.multi_popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,buttons:[BI.i18nText("BI-Basic_Clears"),BI.i18nText("BI-Basic_Sure")],el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CHANGE)}),this.popupView.on(BI.MultiPopupView.EVENT_CLICK_TOOLBAR_BUTTON,function(index){switch(index){case 0:self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR);break;case 1:self.fireEvent(BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM)}})},isAllSelected:function(){return this.loader.isAllSelected()},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.SearchMultiSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectPopupView.EVENT_CLICK_CONFIRM="EVENT_CLICK_CONFIRM",BI.SearchMultiSelectPopupView.EVENT_CLICK_CLEAR="EVENT_CLICK_CLEAR",BI.shortcut("bi.search_multi_select_popup_view",BI.SearchMultiSelectPopupView),BI.SearchMultiSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SearchMultiSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{}})},_init:function(){BI.SearchMultiSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.multi_select_editor",height:o.height,text:o.text,tipType:o.tipType,warningTitle:o.warningTitle}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.multi_select_search_pane",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.SearchMultiSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(obj){var o=this.options,ob={};if(ob.type=obj.type,ob.value=o.allValueGetter()||[],ob.assist=obj.assist,ob.type===BI.Selection.All)if(0===ob.value.length)this.editor.setState(BI.Selection.All);else if(BI.size(ob.assist)<=20){var state="";BI.each(ob.assist,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi);else if(0===ob.value.length)this.editor.setState(BI.Selection.None);else if(BI.size(ob.value)<=20){var state="";BI.each(ob.value,function(i,v){state+=0===i?""+(o.valueFormatter(v+"")||v):","+(o.valueFormatter(v+"")||v)}),this.editor.setState(state)}else this.editor.setState(BI.Selection.Multi)},setTipType:function(v){this.editor.setTipType(v)},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SearchMultiSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SearchMultiSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SearchMultiSelectSearcher.EVENT_START="EVENT_START",BI.SearchMultiSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SearchMultiSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SearchMultiSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.search_multi_select_searcher",BI.SearchMultiSelectSearcher),BI.SelectTreeFirstPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeFirstPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-first-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeFirstPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.first_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeFirstPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_first_plus_group_node",BI.SelectTreeFirstPlusGroupNode),BI.SelectTreeLastPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeLastPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-last-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeLastPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.last_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeLastPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_last_plus_group_node",BI.SelectTreeLastPlusGroupNode),BI.SelectTreeMidPlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreeMidPlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-mid-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreeMidPlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.mid_tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreeMidPlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_mid_plus_group_node",BI.SelectTreeMidPlusGroupNode),BI.SelectTreePlusGroupNode=BI.inherit(BI.NodeButton,{_defaultConfig:function(){var conf=BI.SelectTreePlusGroupNode.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-select-tree-plus-group-node bi-list-item-active",logic:{dynamic:!1},id:"",pId:"",readonly:!0,open:!1,height:24})},_init:function(){BI.SelectTreePlusGroupNode.superclass._init.apply(this,arguments);var self=this,o=this.options;this.checkbox=BI.createWidget({type:"bi.tree_node_checkbox",stopPropagation:!0}),this.text=BI.createWidget({type:"bi.label",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,value:o.value,keyword:o.keyword,py:o.py}),this.checkbox.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&(this.isSelected()?self.triggerExpand():self.triggerCollapse())});var type=BI.LogicFactory.createLogicTypeByDirection(BI.Direction.Left),items=BI.LogicFactory.createLogicItemsByDirection(BI.Direction.Left,{width:24,el:this.checkbox},this.text);BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(type,BI.extend(o.logic,{items:items}))))},isOnce:function(){return!0},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.NodeButton.superclass.doClick.apply(this,arguments)},setOpened:function(v){BI.SelectTreePlusGroupNode.superclass.setOpened.apply(this,arguments),BI.isNotNull(this.checkbox)&&this.checkbox.setSelected(v)}}),BI.shortcut("bi.select_tree_plus_group_node",BI.SelectTreePlusGroupNode),BI.SelectTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-combo",height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SelectTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value}),this.popup=BI.createWidget({type:"bi.select_level_tree",items:o.items,value:o.value}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView()})},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()},populate:function(items){this.combo.populate(items)}}),BI.shortcut("bi.select_tree_combo",BI.SelectTreeCombo),BI.SelectTreeExpander=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SelectTreeExpander.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-tree-expander",trigger:"",toggle:!0,direction:"bottom",isDefaultInit:!0,el:{},popup:{}})},_init:function(){BI.SelectTreeExpander.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(o.el),this.trigger.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&this.isSelected()&&self.expander.setValue([]),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.expander=BI.createWidget({type:"bi.expander",element:this,trigger:o.trigger,toggle:o.toggle,direction:o.direction,isDefaultInit:o.isDefaultInit,el:this.trigger,popup:o.popup}),this.expander.on(BI.Controller.EVENT_CHANGE,function(type){type===BI.Events.CLICK&&self.trigger.setSelected(!1),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})},getAllLeaves:function(){return this.expander.getAllLeaves()},setValue:function(v){BI.contains(v,this.trigger.getValue())?(this.trigger.setSelected(!0),this.expander.setValue([])):(this.trigger.setSelected(!1),this.expander.setValue(v))},getValue:function(){return this.trigger.isSelected()?[this.trigger.getValue()]:this.expander.getValue()},populate:function(items){this.expander.populate(items)}}),BI.shortcut("bi.select_tree_expander",BI.SelectTreeExpander),BI.SelectTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SelectTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_formatItems:function(nodes,layer,pNode){var self=this;return BI.each(nodes,function(i,node){var extend={layer:layer};node.id=node.id||BI.UUID(),extend.pNode=pNode,node.isParent===!0||node.parent===!0||BI.isNotEmptyArray(node.children)?(extend.type="bi.select_tree_mid_plus_group_node",i===nodes.length-1&&(extend.type="bi.select_tree_last_plus_group_node",extend.isLastNode=!0),0!==i||pNode||(extend.type="bi.select_tree_first_plus_group_node"),0===i&&i===nodes.length-1&&(extend.type="bi.select_tree_plus_group_node"),BI.defaults(node,extend),self._formatItems(node.children,layer+1,node)):(extend.type="bi.mid_tree_leaf_item",0!==i||pNode||(extend.type="bi.first_tree_leaf_item"),i===nodes.length-1&&(extend.type="bi.last_tree_leaf_item"),BI.defaults(node,extend))}),nodes},_init:function(){BI.SelectTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{type:"bi.select_tree_expander",isDefaultInit:!0},items:this._formatItems(BI.Tree.transformToTreeFormat(o.items),0),value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SelectTreePopup.EVENT_CHANGE); +}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SelectTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(this._formatItems(BI.Tree.transformToTreeFormat(items)))}}),BI.SelectTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.select_level_tree",BI.SelectTreePopup),BI.SingleSelectSearchLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-loader",allowNoSelect:!1,itemsCreator:BI.emptyFn,keywordGetter:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,element:this,logic:{dynamic:!1},value:opts.value,el:{tipText:BI.i18nText("BI-No_Select"),el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},itemsCreator:function(op,callback){self.storeValue&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){var keyword=ob.keyword=opts.keywordGetter();hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=self._filterValues(self.storeValue);firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),keyword||""),1===op.times&&self.storeValue&&self.setValue(self.storeValue)})},hasNext:function(){return hasNext}}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearchLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",cls:"bi-list-item-active",logic:{dynamic:!1},height:25,selected:!1})},_filterValues:function(src){var o=this.options,keyword=o.keywordGetter(),values=src||[],newValues=BI.map(BI.isArray(values)?values:[values],function(i,v){return{text:o.valueFormatter(v)||v,value:v}});if(BI.isKey(keyword)){var search=BI.Func.getSearchResult(newValues,keyword);values=search.match.concat(search.find)}return BI.map(values,function(i,v){return{text:v.text,title:v.text,value:v.value,selected:!1}})},setValue:function(v){this.storeValue=v,this.button_group.setValue(v)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SingleSelectSearchLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_loader",BI.SingleSelectSearchLoader),BI.SingleSelectSearchInsertPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchInsertPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchInsertPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.addNotMatchTip=BI.createWidget({type:"bi.text_button",invisible:!0,text:BI.i18nText("BI-Basic_Click_To_Add_Text",""),height:this.constants.height,cls:"bi-high-light",hgap:5,handler:function(){self.fireEvent(BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,o.keywordGetter())}}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:o.allowNoSelect,keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{type:"bi.vertical",items:[this.tooltipClick,this.addNotMatchTip],height:this.constants.height},{el:this.loader}]})},setKeyword:function(keyword){var btn,isMatchTipVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();this.tooltipClick.setVisible(isMatchTipVisible),this.addNotMatchTip.setVisible(!isMatchTipVisible),!isMatchTipVisible&&this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text",keyword))},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.SingleSelectSearchInsertPane.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM="EVENT_ADD_ITEM",BI.shortcut("bi.single_select_search_insert_pane",BI.SingleSelectSearchInsertPane),BI.SingleSelectSearchPane=BI.inherit(BI.Widget,{constants:{height:25,lgap:10,tgap:5},_defaultConfig:function(){return BI.extend(BI.SingleSelectSearchPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-search-pane bi-card",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,keywordGetter:BI.emptyFn})},_init:function(){BI.SingleSelectSearchPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tooltipClick=BI.createWidget({type:"bi.label",invisible:!0,text:BI.i18nText("BI-Click_Blank_To_Select"),cls:"multi-select-toolbar",height:this.constants.height}),this.loader=BI.createWidget({type:"bi.single_select_search_loader",allowNoSelect:o.allowNoSelect,keywordGetter:o.keywordGetter,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator.apply(self,[op,function(res){callback(res),self.setKeyword(o.keywordGetter())}])},value:o.value}),this.loader.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.resizer=BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.tooltipClick,height:0},{el:this.loader}]}),this.tooltipClick.setVisible(!1)},setKeyword:function(keyword){var btn,isVisible=this.loader.getAllButtons().length>0&&(btn=this.loader.getAllButtons()[0])&&keyword===btn.getValue();isVisible!==this.tooltipClick.isVisible()&&(this.tooltipClick.setVisible(isVisible),this.resizer.attr("items")[0].height=isVisible?this.constants.height:0,this.resizer.resize())},hasMatched:function(){return this.tooltipClick.isVisible()},setValue:function(v){this.loader.setValue(v)},getValue:function(){return this.loader.getValue()},empty:function(){this.loader.empty()},populate:function(items){this.loader.populate.apply(this.loader,arguments)}}),BI.SingleSelectSearchPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_search_pane",BI.SingleSelectSearchPane),BI.SingleSelectCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue),self.trigger.getSearcher().setState(self.storeValue)};this.storeValue=o.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:o.height,allowNoSelect:o.allowNoSelect,allowEdit:o.allowEdit,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(self.getValue()),callback.apply(self,arguments)})},text:o.text,value:this.storeValue}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){self._setStartValue(),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){self._setStartValue(),self.fireEvent(BI.SingleSelectCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue()}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue()):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.SingleSelectCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(value,obj){self.storeValue=this.getValue(),assertShowValue(),self._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:o.allowNoSelect,ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self._defaultState()}),self.fireEvent(BI.SingleSelectCombo.EVENT_CLICK_ITEM)}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length},value:o.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"single-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&BI.remove(self.storeValue.value,val)}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.SingleSelectCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;this._count?(adjust(),callback()):o.itemsCreator({type:BI.SingleSelectCombo.REQ_GET_DATA_LENGTH},function(res){self._count=res.count,adjust(),callback()})},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this._count=null,this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_combo",BI.SingleSelectCombo),BI.SingleSelectInsertCombo=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-combo",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,height:24,attributes:{tabIndex:0},allowEdit:!0})},_init:function(){BI.SingleSelectInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options,assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue),self.trigger.getSearcher().setState(self.storeValue)};this.storeValue=o.value,this.requesting=!1,this.trigger=BI.createWidget({type:"bi.single_select_trigger",height:o.height,allowNoSelect:o.allowNoSelect,allowEdit:o.allowEdit,valueFormatter:o.valueFormatter,itemsCreator:function(op,callback){o.itemsCreator(op,function(res){1===op.times&&BI.isNotNull(op.keywords)&&self.trigger.setValue(self.getValue()),callback.apply(self,arguments)})},text:o.text,value:this.storeValue,searcher:{popup:{type:"bi.single_select_search_insert_pane",listeners:[{eventName:BI.SingleSelectSearchInsertPane.EVENT_ADD_ITEM,action:function(){self.trigger.getSearcher().hasMatched()||(self.storeValue=self.trigger.getSearcher().getKeyword(),assertShowValue(),self._defaultState())}}]}}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectInsertCombo.EVENT_FOCUS)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectInsertCombo.EVENT_BLUR)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_START,function(){self._setStartValue(),this.getSearcher().setValue(self.storeValue)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_STOP,function(){self._setStartValue(),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_STOP)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_PAUSE,function(){if(this.getSearcher().hasMatched()){var keyword=this.getSearcher().getKeyword();self.storeValue=keyword,self.combo.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.populate(),self._setStartValue()}}),this.trigger.on(BI.SingleSelectTrigger.EVENT_SEARCHING,function(keywords){var last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.combo.setValue(self.storeValue),assertShowValue(),self.combo.populate(),self._setStartValue()):(self.combo.setValue(self.storeValue),assertShowValue())}),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_SEARCHING)}),this.trigger.on(BI.SingleSelectTrigger.EVENT_CHANGE,function(value,obj){self.storeValue=this.getValue(),assertShowValue(),self._defaultState()}),this.trigger.on(BI.SingleSelectTrigger.EVENT_COUNTER_CLICK,function(){self.combo.isViewVisible()||self.combo.showView()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,toggle:!1,el:this.trigger,adjustLength:1,popup:{type:"bi.single_select_popup_view",allowNoSelect:o.allowNoSelect,ref:function(){self.popup=this,self.trigger.setAdapter(this)},listeners:[{eventName:BI.SingleSelectPopupView.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self._adjust(function(){assertShowValue(),self._defaultState()}),self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM)}}],itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,onLoaded:function(){BI.nextTick(function(){self.combo.adjustWidth(),self.combo.adjustHeight(),self.trigger.getSearcher().adjustView()})}},hideChecker:function(e){return 0===triggerBtn.element.find(e.target).length},value:o.value}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){this.setValue(self.storeValue),BI.nextTick(function(){self.populate()})}),this.wants2Quit=!1,this.combo.on(BI.Combo.EVENT_AFTER_HIDEVIEW,function(){self.trigger.stopEditing(),self.requesting===!0?self.wants2Quit=!0:self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM)});var triggerBtn=BI.createWidget({type:"bi.trigger_icon_button",width:o.height,height:o.height,cls:"single-select-trigger-icon-button"});triggerBtn.on(BI.TriggerIconButton.EVENT_CHANGE,function(){self.combo.isViewVisible()?self.combo.hideView():self.combo.showView()}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.combo,left:0,right:0,top:0,bottom:0},{el:triggerBtn,right:0,top:0,bottom:0}]})},_defaultState:function(){this.trigger.stopEditing(),this.combo.hideView()},_assertValue:function(val){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&BI.remove(self.storeValue.value,val)}),self._adjust(callback)}var self=this,o=this.options;this._assertValue(this.storeValue),this.requesting=!0,o.itemsCreator({type:BI.SingleSelectInsertCombo.REQ_GET_ALL_DATA,keywords:keywords},function(ob){var values=BI.map(ob.items,"value");digest(values)})},_adjust:function(callback){function adjust(){self.wants2Quit===!0&&(self.fireEvent(BI.SingleSelectInsertCombo.EVENT_CONFIRM),self.wants2Quit=!1),self.requesting=!1}var self=this,o=this.options;adjust(),callback()},_setStartValue:function(value){this._startValue=value,this.popup.setStartValue(value)},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.combo.setValue(this.storeValue)},getValue:function(){return this.storeValue},populate:function(){this.combo.populate.apply(this.combo,arguments)}}),BI.extend(BI.SingleSelectInsertCombo,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectInsertCombo.EVENT_STOP="EVENT_STOP",BI.SingleSelectInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.SingleSelectInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.single_select_insert_combo",BI.SingleSelectInsertCombo),BI.SingleSelectComboItem=BI.inherit(BI.BasicButton,{_defaultConfig:function(){return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-single-select-radio-item",logic:{dynamic:!1},height:24})},_init:function(){BI.SingleSelectComboItem.superclass._init.apply(this,arguments);var self=this,o=this.options;this.radio=BI.createWidget({type:"bi.radio"}),this.text=BI.createWidget({type:"bi.label",cls:"list-item-text",textAlign:"left",whiteSpace:"nowrap",textHeight:o.height,height:o.height,hgap:o.hgap,text:o.text,keyword:o.keyword,value:o.value,py:o.py}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("horizontal",BI.extend(o.logic,{items:BI.LogicFactory.createLogicItemsByDirection("left",{type:"bi.center_adapt",items:[this.radio],width:26},this.text)}))))},doRedMark:function(){this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doClick:function(){BI.SingleSelectComboItem.superclass.doClick.apply(this,arguments),this.radio.setSelected(this.isSelected()),this.isValid()&&this.fireEvent(BI.SingleSelectComboItem.EVENT_CHANGE,this.isSelected(),this)},setSelected:function(v){BI.SingleSelectComboItem.superclass.setSelected.apply(this,arguments),this.radio.setSelected(v)}}),BI.SingleSelectComboItem.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_combo_item",BI.SingleSelectComboItem),BI.SingleSelectList=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-select-list",direction:BI.Direction.Top,logic:{dynamic:!0},items:[],itemsCreator:BI.emptyFn,hasNext:BI.emptyFn,onLoaded:BI.emptyFn,el:{type:"bi.list_pane"},allowNoSelect:!1})},_init:function(){BI.SingleSelectList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.list=BI.createWidget(o.el,{type:"bi.list_pane",items:o.items,itemsCreator:function(op,callback){1===op.times&&self.toolbar&&self.toolbar.setVisible(!1),o.itemsCreator(op,function(items){callback.apply(self,arguments),1===op.times&&(self.toolbar&&self.toolbar.setVisible(items&&items.length>0),self.toolbar&&self.toolbar.setEnable(items&&items.length>0))})},onLoaded:o.onLoaded,hasNext:o.hasNext,value:o.value}),this.list.on(BI.Controller.EVENT_CHANGE,function(type,value,obj){type===BI.Events.CLICK&&self.fireEvent(BI.SingleSelectList.EVENT_CHANGE,value,obj),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic(BI.LogicFactory.createLogicTypeByDirection(o.direction),BI.extend({scrolly:!0},o.logic,{items:o.allowNoSelect?BI.LogicFactory.createLogicItemsByDirection(o.direction,{type:"bi.single_select_item",cls:"bi-list-item-active",height:24,forceNotSelected:!0,text:BI.i18nText("BI-Basic_No_Select"),ref:function(_ref){self.toolbar=_ref},listeners:[{eventName:BI.Controller.EVENT_CHANGE,action:function(type){type===BI.Events.CLICK&&(self.list.setValue(),self.fireEvent(BI.SingleSelectList.EVENT_CHANGE)),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},this.list):BI.LogicFactory.createLogicItemsByDirection(o.direction,this.list)}))))},hasPrev:function(){return this.list.hasPrev()},hasNext:function(){return this.list.hasNext()},prependItems:function(items){this.list.prependItems.apply(this.list,arguments)},addItems:function(items){this.list.addItems.apply(this.list,arguments)},setValue:function(v){this.list.setValue([v])},getValue:function(){return this.list.getValue()[0]},empty:function(){this.list.empty()},populate:function(items){this.list.populate.apply(this.list,arguments)},resetHeight:function(h){this.list.resetHeight?this.list.resetHeight(h):this.list.element.css({"max-height":h+"px"})},setNotSelectedValue:function(){this.list.setNotSelectedValue.apply(this.list,arguments)},getNotSelectedValue:function(){return this.list.getNotSelectedValue()},getAllButtons:function(){return this.list.getAllButtons()},getAllLeaves:function(){return this.list.getAllLeaves()},getSelectedButtons:function(){return this.list.getSelectedButtons()},getNotSelectedButtons:function(){return this.list.getNotSelectedButtons()},getIndexByValue:function(value){return this.list.getIndexByValue(value)},getNodeById:function(id){return this.list.getNodeById(id)},getNodeByValue:function(value){return this.list.getNodeByValue(value)}}),BI.SingleSelectList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_list",BI.SingleSelectList),BI.SingleSelectLoader=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectLoader.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-loader",logic:{dynamic:!0},el:{height:400},allowNoSelect:!1,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectLoader.superclass._init.apply(this,arguments);var self=this,opts=this.options,hasNext=!1;this.storeValue=opts.value,this.button_group=BI.createWidget({type:"bi.single_select_list",allowNoSelect:opts.allowNoSelect,logic:opts.logic,el:BI.extend({onLoaded:opts.onLoaded,el:{type:"bi.loader",isDefaultInit:!1,logic:{dynamic:!0,scrolly:!0},el:{chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,behaviors:{redmark:function(){return!0}},layouts:[{type:"bi.vertical"}]}}},opts.el),itemsCreator:function(op,callback){var startValue=self._startValue;BI.isNotNull(self.storeValue)&&(op=BI.extend(op||{},{selectedValues:[self.storeValue]})),opts.itemsCreator(op,function(ob){hasNext=ob.hasNext;var firstItems=[];if(1===op.times&&BI.isNotNull(self.storeValue)){var json=BI.map([self.storeValue],function(i,v){var txt=opts.valueFormatter(v)||v;return{text:txt,value:v,title:txt,selected:!0}});firstItems=self._createItems(json)}callback(firstItems.concat(self._createItems(ob.items)),ob.keyword||""),1===op.times&&self.storeValue&&(BI.isKey(startValue)&&(self.storeValue=startValue),self.setValue(self.storeValue)),1===op.times&&self._scrollToTop()})},hasNext:function(){return hasNext},value:this.storeValue}),BI.createWidget({type:"bi.vertical",element:this,items:[this.button_group],vgap:5}),this.button_group.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.button_group.on(BI.SingleSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectLoader.EVENT_CHANGE,arguments)})},_createItems:function(items){return BI.createItems(items,{type:this.options.allowNoSelect?"bi.single_select_item":"bi.single_select_combo_item",logic:this.options.logic,cls:"bi-list-item-active",height:24,selected:!1})},_scrollToTop:function(){var self=this;BI.delay(function(){self.button_group.element.scrollTop(0)},30)},_assertValue:function(val){},setStartValue:function(v){this._startValue=v},setValue:function(v){this.storeValue=v,this._assertValue(this.storeValue),this.button_group.setValue(this.storeValue)},getValue:function(){return this.button_group.getValue()},getAllButtons:function(){return this.button_group.getAllButtons()},empty:function(){this.button_group.empty()},populate:function(items){this.button_group.populate.apply(this.button_group,arguments)},resetHeight:function(h){this.button_group.resetHeight(h)},resetWidth:function(w){this.button_group.resetWidth(w)}}),BI.SingleSelectLoader.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_loader",BI.SingleSelectLoader),BI.SingleSelectPopupView=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectPopupView.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-popup-view",allowNoSelect:!1,maxWidth:"auto",minWidth:135,maxHeight:400,valueFormatter:BI.emptyFn,itemsCreator:BI.emptyFn,onLoaded:BI.emptyFn})},_init:function(){BI.SingleSelectPopupView.superclass._init.apply(this,arguments);var self=this,opts=this.options;this.loader=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:opts.allowNoSelect,itemsCreator:opts.itemsCreator,valueFormatter:opts.valueFormatter,onLoaded:opts.onLoaded,value:opts.value}),this.popupView=BI.createWidget({type:"bi.popup_view",stopPropagation:!1,maxWidth:opts.maxWidth,minWidth:opts.minWidth,maxHeight:opts.maxHeight,element:this,el:this.loader,value:opts.value}),this.popupView.on(BI.MultiPopupView.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectPopupView.EVENT_CHANGE)})},setStartValue:function(v){this.loader.setStartValue(v)},setValue:function(v){this.popupView.setValue(v)},getValue:function(){return this.popupView.getValue()},populate:function(items){this.popupView.populate.apply(this.popupView,arguments)},resetHeight:function(h){this.popupView.resetHeight(h)},resetWidth:function(w){this.popupView.resetWidth(w)}}),BI.SingleSelectPopupView.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_popup_view",BI.SingleSelectPopupView),BI.SingleSelectTrigger=BI.inherit(BI.Trigger,{constants:{height:14,rgap:4,lgap:4},_defaultConfig:function(){return BI.extend(BI.SingleSelectTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-trigger bi-border bi-border-radius",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn,searcher:{},switcher:{},adapter:null,masker:{},allowEdit:!0})},_init:function(){BI.SingleSelectTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options;o.height&&this.setHeight(o.height-2),this.searcher=BI.createWidget(o.searcher,{type:"bi.single_select_searcher",allowNoSelect:o.allowNoSelect,text:o.text,height:o.height,itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,popup:{},adapter:o.adapter,masker:o.masker,value:o.value}),this.searcher.on(BI.SingleSelectSearcher.EVENT_START,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_START)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_PAUSE,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_PAUSE)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_SEARCHING,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_SEARCHING,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_STOP,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_STOP)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_CHANGE,arguments)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_FOCUS)}),this.searcher.on(BI.SingleSelectSearcher.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectTrigger.EVENT_BLUR,arguments)});var wrapper=BI.createWidget({type:"bi.htape",element:this,items:[{el:this.searcher,width:"fill"},{el:BI.createWidget(),width:24}]});!o.allowEdit&&BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.layout"},left:0,right:24,top:0,bottom:0}]})},getSearcher:function(){return this.searcher},stopEditing:function(){this.searcher.stopSearch()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setValue:function(v){this.searcher.setValue(v)},getKey:function(){return this.searcher.getKey()},getValue:function(){return this.searcher.getValue()}}),BI.SingleSelectTrigger.EVENT_TRIGGER_CLICK="EVENT_TRIGGER_CLICK",BI.SingleSelectTrigger.EVENT_COUNTER_CLICK="EVENT_COUNTER_CLICK",BI.SingleSelectTrigger.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectTrigger.EVENT_START="EVENT_START",BI.SingleSelectTrigger.EVENT_STOP="EVENT_STOP",BI.SingleSelectTrigger.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectTrigger.EVENT_SEARCHING="EVENT_SEARCHING",BI.SingleSelectTrigger.EVENT_BEFORE_COUNTER_POPUPVIEW="EVENT_BEFORE_COUNTER_POPUPVIEW",BI.SingleSelectTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectTrigger.EVENT_BLUR="EVENT_BLUR",BI.shortcut("bi.single_select_trigger",BI.SingleSelectTrigger),BI.SingleSelectInsertList=BI.inherit(BI.Single,{_defaultConfig:function(){return BI.extend(BI.SingleSelectInsertList.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-multi-select-insert-list",allowNoSelect:!1,itemsCreator:BI.emptyFn,valueFormatter:BI.emptyFn})},_init:function(){BI.SingleSelectInsertList.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value;var assertShowValue=function(){BI.isKey(self._startValue)&&(self.storeValue=self._startValue)};this.adapter=BI.createWidget({type:"bi.single_select_loader",allowNoSelect:o.allowNoSelect,cls:"popup-single-select-list bi-border-left bi-border-right bi-border-bottom",itemsCreator:o.itemsCreator,valueFormatter:o.valueFormatter,logic:{dynamic:!0},el:{},value:o.value}),this.adapter.on(BI.SingleSelectLoader.EVENT_CHANGE,function(){self.storeValue=this.getValue(),assertShowValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}),this.searcherPane=BI.createWidget({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,cls:"bi-border-left bi-border-right bi-border-bottom",valueFormatter:o.valueFormatter,keywordGetter:function(){return self.trigger.getKeyword()},itemsCreator:function(op,callback){op.keywords=[self.trigger.getKeyword()],this.setKeyword(op.keywords[0]),o.itemsCreator(op,callback); +}}),this.searcherPane.setVisible(!1),this.trigger=BI.createWidget({type:"bi.searcher",isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},adapter:this.adapter,popup:this.searcherPane,height:200,masker:!1,value:o.value,listeners:[{eventName:BI.Searcher.EVENT_START,action:function(){self._showSearcherPane(),self._setStartValue(),this.setValue(BI.deepClone(self.storeValue))}},{eventName:BI.Searcher.EVENT_STOP,action:function(){self._showAdapter(),self._setStartValue(),self.adapter.setValue(self.storeValue),self.adapter.populate()}},{eventName:BI.Searcher.EVENT_PAUSE,action:function(){var keyword=this.getKeyword();self.storeValue=keyword,self._showAdapter(),self.adapter.setValue(self.storeValue),self._setStartValue(keyword),assertShowValue(),self.adapter.populate(),self._setStartValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}},{eventName:BI.Searcher.EVENT_SEARCHING,action:function(){var keywords=this.getKeyword(),last=BI.last(keywords);keywords=BI.initial(keywords||[]),keywords.length>0&&self._joinKeywords(keywords,function(){BI.isEndWithBlank(last)?(self.adapter.setValue(self.storeValue),assertShowValue(),self.adapter.populate(),self._setStartValue()):(self.adapter.setValue(self.storeValue),assertShowValue())})}},{eventName:BI.Searcher.EVENT_CHANGE,action:function(){self.storeValue=this.getValue(),self.fireEvent(BI.SingleSelectInsertList.EVENT_CHANGE)}}]}),BI.createWidget({type:"bi.vtape",element:this,items:[{el:this.trigger,height:24},{el:this.adapter,height:"fill"}]}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.searcherPane,top:24,bottom:0,left:0,right:0}]})},_showAdapter:function(){this.adapter.setVisible(!0),this.searcherPane.setVisible(!1)},_showSearcherPane:function(){this.searcherPane.setVisible(!0),this.adapter.setVisible(!1)},_defaultState:function(){this.trigger.stopEditing()},_assertValue:function(){},_makeMap:function(values){return BI.makeObject(values||[])},_joinKeywords:function(keywords,callback){function digest(items){var selectedMap=self._makeMap(items);BI.each(keywords,function(i,val){BI.isNotNull(selectedMap[val])&&(self.storeValue.type===BI.Selection.Single?BI.pushDistinct(self.storeValue.value,val):BI.remove(self.storeValue.value,val))}),callback()}var self=this,o=this.options;this._assertValue(this.storeValue),this._allData?digest(this._allData):o.itemsCreator({type:BI.SingleSelectInsertList.REQ_GET_ALL_DATA},function(ob){self._allData=BI.map(ob.items,"value"),digest(self._allData)})},_setStartValue:function(value){this._startValue=value,this.adapter.setStartValue(value)},isAllSelected:function(){return this.adapter.isAllSelected()},resize:function(){},setValue:function(v){this.storeValue=v,this.adapter.setValue(this.storeValue),this.trigger.setValue(this.storeValue)},getValue:function(){return BI.deepClone(this.storeValue)},populate:function(){this._count=null,this._allData=null,this.adapter.populate.apply(this.adapter,arguments),this.trigger.populate.apply(this.trigger,arguments)}}),BI.extend(BI.SingleSelectInsertList,{REQ_GET_DATA_LENGTH:0,REQ_GET_ALL_DATA:-1}),BI.SingleSelectInsertList.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_select_insert_list",BI.SingleSelectInsertList),BI.SingleSelectEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectEditor.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-editor",el:{},text:BI.i18nText("BI-Basic_Please_Select")})},_init:function(){BI.SingleSelectEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.state_editor",element:this,height:o.height,watermark:BI.i18nText("BI-Basic_Search"),allowBlank:!0,value:o.value,defaultText:o.text,text:o.text}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.StateEditor.EVENT_PAUSE,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_PAUSE)}),this.editor.on(BI.StateEditor.EVENT_FOCUS,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_FOCUS)}),this.editor.on(BI.StateEditor.EVENT_BLUR,function(){self.fireEvent(BI.SingleSelectEditor.EVENT_BLUR)})},focus:function(){this.editor.focus()},blur:function(){this.editor.blur()},setState:function(state){this.editor.setState(state)},setValue:function(v){this.editor.setValue(v)},getValue:function(){var v=this.editor.getState();return BI.isArray(v)&&v.length>0?v[v.length-1]:""},getKeywords:function(){var val=this.editor.getLastChangedValue(),keywords=val.match(/[\S]+/g);return BI.isEndWithBlank(val)?keywords.concat([" "]):keywords},populate:function(items){}}),BI.SingleSelectEditor.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectEditor.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectEditor.EVENT_PAUSE="EVENT_PAUSE",BI.shortcut("bi.single_select_editor",BI.SingleSelectEditor),BI.SingleSelectSearcher=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleSelectSearcher.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-select-searcher",itemsCreator:BI.emptyFn,el:{},popup:{},valueFormatter:BI.emptyFn,adapter:null,masker:{},allowNoSelect:!1})},_init:function(){BI.SingleSelectSearcher.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget(o.el,{type:"bi.single_select_editor",height:o.height,text:o.text,listeners:[{eventName:BI.SingleSelectEditor.EVENT_FOCUS,action:function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_FOCUS)}},{eventName:BI.SingleSelectEditor.EVENT_BLUR,action:function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_BLUR)}}]}),this.searcher=BI.createWidget({type:"bi.searcher",element:this,height:o.height,isAutoSearch:!1,isAutoSync:!1,onSearch:function(op,callback){callback()},el:this.editor,popup:BI.extend({type:"bi.single_select_search_pane",allowNoSelect:o.allowNoSelect,valueFormatter:o.valueFormatter,keywordGetter:function(){return self.editor.getValue()},itemsCreator:function(op,callback){var keyword=self.editor.getValue();op.keywords=[keyword],this.setKeyword(keyword),o.itemsCreator(op,callback)},value:o.value},o.popup),adapter:o.adapter,masker:o.masker}),this.searcher.on(BI.Searcher.EVENT_START,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_START)}),this.searcher.on(BI.Searcher.EVENT_PAUSE,function(){this.hasMatched(),self.fireEvent(BI.SingleSelectSearcher.EVENT_PAUSE)}),this.searcher.on(BI.Searcher.EVENT_STOP,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_STOP)}),this.searcher.on(BI.Searcher.EVENT_CHANGE,function(){self.fireEvent(BI.SingleSelectSearcher.EVENT_CHANGE,arguments)}),this.searcher.on(BI.Searcher.EVENT_SEARCHING,function(){var keywords=this.getKeywords();self.fireEvent(BI.SingleSelectSearcher.EVENT_SEARCHING,keywords)}),BI.isNotNull(o.value)&&this.setState(o.value)},adjustView:function(){this.searcher.adjustView()},isSearching:function(){return this.searcher.isSearching()},stopSearch:function(){this.searcher.stopSearch()},getKeyword:function(){return this.editor.getValue()},hasMatched:function(){return this.searcher.hasMatched()},hasChecked:function(){return this.searcher.getView()&&this.searcher.getView().hasChecked()},setAdapter:function(adapter){this.searcher.setAdapter(adapter)},setState:function(v){var o=this.options;BI.isNull(v)?this.editor.setState(BI.Selection.None):this.editor.setState(o.valueFormatter(v+"")||v+"")},setValue:function(ob){this.setState(ob),this.searcher.setValue(ob)},getKey:function(){return this.editor.getValue()},getValue:function(){return this.searcher.getValue()},populate:function(items){this.searcher.populate.apply(this.searcher,arguments)}}),BI.SingleSelectSearcher.EVENT_FOCUS="EVENT_FOCUS",BI.SingleSelectSearcher.EVENT_BLUR="EVENT_BLUR",BI.SingleSelectSearcher.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.SingleSelectSearcher.EVENT_CHANGE="EVENT_CHANGE",BI.SingleSelectSearcher.EVENT_START="EVENT_START",BI.SingleSelectSearcher.EVENT_STOP="EVENT_STOP",BI.SingleSelectSearcher.EVENT_PAUSE="EVENT_PAUSE",BI.SingleSelectSearcher.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.single_select_searcher",BI.SingleSelectSearcher),BI.SignTextEditor=BI.inherit(BI.Widget,{_defaultConfig:function(){var conf=BI.SignTextEditor.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{baseCls:(conf.baseCls||"")+" bi-sign-initial-editor",validationChecker:BI.emptyFn,text:"",height:24})},_init:function(){BI.SignTextEditor.superclass._init.apply(this,arguments);var self=this,o=this.options;this.editor=BI.createWidget({type:"bi.editor",height:o.height,hgap:4,vgap:2,value:o.value,validationChecker:o.validationChecker,allowBlank:!1}),this.text=BI.createWidget({type:"bi.text_button",cls:"sign-editor-text",title:function(){return self.getValue()},textAlign:o.textAlign,height:o.height,hgap:4,handler:function(){self._showInput(),self.editor.focus(),self.editor.selectAll()}}),this.text.on(BI.TextButton.EVENT_CHANGE,function(){BI.nextTick(function(){self.fireEvent(BI.SignTextEditor.EVENT_CLICK_LABEL)})}),BI.createWidget({type:"bi.absolute",element:this,items:[{el:this.text,left:0,right:0,top:0,bottom:0}]}),this.editor.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.editor.on(BI.Editor.EVENT_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignTextEditor.EVENT_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_CHANGE_CONFIRM,function(){self._showHint(),self._checkText(),self.fireEvent(BI.SignTextEditor.EVENT_CHANGE_CONFIRM,arguments)}),this.editor.on(BI.Editor.EVENT_ERROR,function(){self._checkText()}),BI.createWidget({type:"bi.vertical",scrolly:!1,element:this,items:[this.editor]}),this._showHint(),self._checkText()},_checkText:function(){var o=this.options;BI.nextTick(BI.bind(function(){if(""===this.editor.getValue())this.text.setValue(o.watermark||""),this.text.element.addClass("bi-water-mark");else{var v=this.editor.getValue();v=BI.isEmpty(v)||v==o.text?o.text:v+o.text,this.text.setValue(v),this.text.element.removeClass("bi-water-mark")}},this))},_showInput:function(){this.editor.visible(),this.text.invisible()},_showHint:function(){this.editor.invisible(),this.text.visible()},setTitle:function(title){this.text.setTitle(title)},setWarningTitle:function(title){this.text.setWarningTitle(title)},focus:function(){this._showInput(),this.editor.focus()},blur:function(){this.editor.blur(),this._showHint(),this._checkText()},doRedMark:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doRedMark.apply(this.text,arguments)},unRedMark:function(){this.text.unRedMark.apply(this.text,arguments)},doHighLight:function(){""===this.editor.getValue()&&BI.isKey(this.options.watermark)||this.text.doHighLight.apply(this.text,arguments)},unHighLight:function(){this.text.unHighLight.apply(this.text,arguments)},isValid:function(){return this.editor.isValid()},setErrorText:function(text){this.editor.setErrorText(text)},getErrorText:function(){return this.editor.getErrorText()},isEditing:function(){return this.editor.isEditing()},getLastValidValue:function(){return this.editor.getLastValidValue()},getLastChangedValue:function(){return this.editor.getLastChangedValue()},setValue:function(v){this.editor.setValue(v),this._checkText()},getValue:function(){return this.editor.getValue()},getState:function(){return this.text.getValue()},setState:function(v){var o=this.options;this._showHint(),v=BI.isEmpty(v)||v==o.text?o.text:v+o.text,this.text.setValue(v)}}),BI.SignTextEditor.EVENT_CONFIRM="EVENT_CONFIRM",BI.SignTextEditor.EVENT_CHANGE_CONFIRM="EVENT_CHANGE_CONFIRM",BI.SignTextEditor.EVENT_CLICK_LABEL="EVENT_CLICK_LABEL",BI.shortcut("bi.sign_text_editor",BI.SignTextEditor),BI.SliderIconButton=BI.inherit(BI.Widget,{props:{baseCls:"bi-single-slider-button"},constants:{LARGE_SIZE:16,NORMAL_SIZE:12,LARGE_OFFSET:4,NORMAL_OFFSET:6},render:function(){var self=this;return{type:"bi.absolute",ref:function(){self.wrapper=this},items:[{el:{type:"bi.text_button",cls:"slider-button bi-high-light-border",ref:function(){self.slider=this}}}]}}}),BI.shortcut("bi.single_slider_button",BI.SliderIconButton),BI.SingleSlider=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:30,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-single-slider bi-slider-track",digit:!1,unit:""},render:function(){var self=this,o=this.options,c=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});return sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v),self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}}),this.label=BI.createWidget({type:"bi.sign_text_editor",cls:"slider-editor-button",text:o.unit,width:c.EDITOR_WIDTH-2,allowBlank:!1,textAlign:"center",validationChecker:function(v){return self._checkValidation(v)}}),this.label.element.hover(function(){self.label.element.removeClass("bi-border").addClass("bi-border")},function(){self.label.element.removeClass("bi-border")}),this.label.on(BI.SignEditor.EVENT_CONFIRM,function(){var v=BI.parseFloat(this.getValue()),percent=self._getPercentByValue(v),significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent),this.setValue(v),self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}),this._setVisible(!1),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:23,left:0,width:"100%"},{el:sliderVertical,top:20,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:c.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]}},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setLabelPosition(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v),self.value=v}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){var o=this.options,valid=!1;if(BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max))if(o.digit===!1)valid=!0;else{var dotText=(v+"").split(".")[1]||"";valid=dotText.length===o.digit}return valid},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setLabelPosition:function(percent){},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setLabelPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible),this.label.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},getValue:function(){return this.value},setValue:function(v){var o=this.options;v=BI.parseFloat(v),v=o.digit===!1?v:v.toFixed(o.digit),isNaN(v)||(this._checkValidation(v)&&(this.value=v),v>this.max&&(this.value=this.max),vminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,this.label.setErrorText(BI.i18nText("BI-Basic_Please_Enter_Number_Between",this.min,this.max)),BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max),this._setAllPosition(100)))}}),BI.SingleSlider.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider",BI.SingleSlider),BI.SingleSliderLabel=BI.inherit(BI.Single,{_constant:{EDITOR_WIDTH:90,EDITOR_HEIGHT:20,HEIGHT:20,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},_defaultConfig:function(){return BI.extend(BI.SingleSliderLabel.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-slider-label bi-slider-track",digit:!1,unit:""})},_init:function(){BI.SingleSliderLabel.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._constant;this.enable=!1,this.value="",this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.track=this._createTrackWrapper(),this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setText(v+o.unit),self.value=v,self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)}}),this.label=BI.createWidget({type:"bi.label",height:c.HEIGHT,width:c.EDITOR_WIDTH-2}),this._setVisible(!1),BI.createWidget({type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:13,left:0,width:"100%"},{el:sliderVertical,top:10,left:0,width:"100%"},{el:{type:"bi.vertical",items:[{type:"bi.horizontal_auto",items:[this.label]}],height:c.EDITOR_HEIGHT},top:0,left:0,width:"100%"}]})},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setLabelPosition(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.label.setValue(v+o.unit),self.value=v,self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrackWrapper:function(){return BI.createWidget({type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}]})},_checkValidation:function(v){return BI.isNumeric(v)&&!(BI.isNull(v)||vthis.max)},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setLabelPosition:function(percent){},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setLabelPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible),this.label.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setEnable:function(b){BI.SingleSliderLabel.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(v){var o=this.options;v=BI.parseFloat(v),v=o.digit===!1?v:v.toFixed(o.digit),isNaN(v)||(this._checkValidation(v)&&(this.value=v),v>this.max&&(this.value=this.max),vminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){var o=this.options;isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?(this.label.setValue(this.value+o.unit),this._setAllPosition(this._getPercentByValue(this.value))):(this.label.setValue(this.max+o.unit),this._setAllPosition(100)))}}),BI.SingleSliderLabel.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_slider_label",BI.SingleSliderLabel),BI.SingleSliderNormal=BI.inherit(BI.Single,{_constant:{HEIGHT:28,SLIDER_WIDTH_HALF:15,SLIDER_WIDTH:30,SLIDER_HEIGHT:30,TRACK_HEIGHT:24},props:{baseCls:"bi-single-slider-normal bi-slider-track",minMax:{min:0,max:100}},render:function(){var self=this,c=this._constant,track=this._createTrack();this.slider=BI.createWidget({type:"bi.single_slider_button"}),this._draggable(this.slider);var sliderVertical=BI.createWidget({type:"bi.vertical",items:[{type:"bi.absolute",items:[this.slider]}],hgap:c.SLIDER_WIDTH_HALF,height:c.SLIDER_HEIGHT});return sliderVertical.element.click(function(e){if(self.enable&&self.isEnabled()){var offset=e.clientX-self.element.offset().left-c.SLIDER_WIDTH_HALF,trackLength=self.track.element[0].scrollWidth,percent=0;offset<0&&(percent=0),offset>0&&offsettrackLength-c.SLIDER_WIDTH&&(percent=100);var significantPercent=BI.parseFloat(percent.toFixed(1));self._setAllPosition(significantPercent);var v=self._getValueByPercent(significantPercent);self.value=v,self.fireEvent(BI.SingleSlider.EVENT_CHANGE)}}),{type:"bi.absolute",element:this,items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:track,width:"100%",height:c.TRACK_HEIGHT}]}],hgap:7,height:c.TRACK_HEIGHT},top:3,left:0,width:"100%"},{el:sliderVertical,top:0,left:0,width:"100%"}]}},_draggable:function(widget){function optimizeSize(s){return BI.clamp(s,0,self._getGrayTrackLength())}var self=this,o=this.options,startDrag=!1,size=0,offset=0,defaultSize=0,mouseMoveTracker=new BI.MouseMoveTracker(function(deltaX){if(mouseMoveTracker.isDragging()){startDrag=!0,offset+=deltaX,size=optimizeSize(defaultSize+offset),widget.element.addClass("dragging");var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setBlueTrack(significantPercent),self._setSliderPosition(significantPercent);var v=self._getValueByPercent(significantPercent);v=o.digit===!1?v:v.toFixed(o.digit),self.value=v,self.fireEvent(BI.SingleSliderNormal.EVENT_DRAG,v)}},function(){if(startDrag===!0){size=optimizeSize(size);var percent=100*size/self._getGrayTrackLength(),significantPercent=BI.parseFloat(percent.toFixed(1));self._setSliderPosition(significantPercent),size=0,offset=0,defaultSize=size,startDrag=!1}widget.element.removeClass("dragging"),mouseMoveTracker.releaseMouseMoves(),self.fireEvent(BI.SingleSlider.EVENT_CHANGE)},window);widget.element.on("mousedown",function(event){widget.isEnabled()&&(defaultSize=this.offsetLeft,optimizeSize(defaultSize),mouseMoveTracker.captureMouseMoves(event))})},_createTrack:function(){var self=this,c=this._constant;return this.grayTrack=BI.createWidget({type:"bi.layout",cls:"gray-track",height:6}),this.blueTrack=BI.createWidget({type:"bi.layout",cls:"blue-track bi-high-light-background",height:6}),this.options.color&&this.blueTrack.element.css({"background-color":this.options.color}),{type:"bi.absolute",items:[{el:{type:"bi.vertical",items:[{type:"bi.absolute",items:[{el:this.grayTrack,top:0,left:0,width:"100%"},{el:this.blueTrack,top:0,left:0,width:"0%"}]}],hgap:8,height:8},top:8,left:0,width:"100%"}],ref:function(ref){self.track=ref}}},_checkValidation:function(v){return!(BI.isNull(v)||vthis.max)},_setBlueTrack:function(percent){this.blueTrack.element.css({width:percent+"%"})},_setSliderPosition:function(percent){this.slider.element.css({left:percent+"%"})},_setAllPosition:function(percent){this._setSliderPosition(percent),this._setBlueTrack(percent)},_setVisible:function(visible){this.slider.setVisible(visible)},_getGrayTrackLength:function(){return this.grayTrack.element[0].scrollWidth},_getValueByPercent:function(percent){var thousandth=BI.parseInt(10*percent);return(this.max-this.min)*thousandth/1e3+this.min},_getPercentByValue:function(v){return 100*(v-this.min)/(this.max-this.min)},_setEnable:function(b){BI.SingleSliderNormal.superclass._setEnable.apply(this,[b]),b?this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"):this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track")},getValue:function(){return this.value},setValue:function(v){var value=BI.parseFloat(v);isNaN(value)||(this._checkValidation(value)&&(this.value=value),value>this.max&&(this.value=this.max),valueminNumber&&(this.min=minNumber,this.max=maxNumber)},reset:function(){this._setVisible(!1),this.enable=!1,this.value="",this.min=0,this.max=0,this._setBlueTrack(0)},populate:function(){isNaN(this.min)||isNaN(this.max)||(this._setVisible(!0),this.enable=!0,BI.isNumeric(this.value)||BI.isNotEmptyString(this.value)?this._setAllPosition(this._getPercentByValue(this.value)):this._setAllPosition(100))}}),BI.SingleSliderNormal.EVENT_DRAG="EVENT_DRAG",BI.shortcut("bi.single_slider_normal",BI.SingleSliderNormal),BI.SingleTreeCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.SingleTreeCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-combo",trigger:{},height:24,text:"",items:[],value:"",attributes:{tabIndex:0}})},_init:function(){BI.SingleTreeCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.trigger=BI.createWidget(BI.extend({type:"bi.single_tree_trigger",text:o.text,height:o.height,items:o.items,value:o.value},o.trigger)),this.popup=BI.createWidget({type:"bi.single_level_tree",items:o.items,value:o.value}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,element:this,adjustLength:2,el:this.trigger,popup:{el:this.popup}}),this.combo.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.fireEvent(BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW,arguments)}),this.popup.on(BI.SingleTreePopup.EVENT_CHANGE,function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.SingleTreeCombo.EVENT_CHANGE)})},populate:function(items){this.combo.populate(items)},setValue:function(v){v=BI.isArray(v)?v:[v],this.trigger.setValue(v),this.popup.setValue(v)},getValue:function(){return this.popup.getValue()}}),BI.SingleTreeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.single_tree_combo",BI.SingleTreeCombo),BI.SingleTreePopup=BI.inherit(BI.Pane,{_defaultConfig:function(){return BI.extend(BI.SingleTreePopup.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-level-tree",tipText:BI.i18nText("BI-No_Selected_Item"),items:[],value:""})},_init:function(){BI.SingleTreePopup.superclass._init.apply(this,arguments);var self=this,o=this.options;this.tree=BI.createWidget({type:"bi.level_tree",expander:{isDefaultInit:!0},items:o.items,value:o.value,chooseType:BI.Selection.Single}),BI.createWidget({type:"bi.vertical",element:this,vgap:5,items:[this.tree]}),this.tree.on(BI.Controller.EVENT_CHANGE,function(){self.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}),this.tree.on(BI.LevelTree.EVENT_CHANGE,function(){self.fireEvent(BI.SingleTreePopup.EVENT_CHANGE)}),this.check()},getValue:function(){return this.tree.getValue()},setValue:function(v){v=BI.isArray(v)?v:[v],this.tree.setValue(v)},populate:function(items){BI.SingleTreePopup.superclass.populate.apply(this,arguments),this.tree.populate(items)}}),BI.SingleTreePopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.single_level_tree",BI.SingleTreePopup),BI.SingleTreeTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.SingleTreeTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-single-tree-trigger",height:24,text:"",items:[],value:""})},_init:function(){BI.SingleTreeTrigger.superclass._init.apply(this,arguments); +var self=this,o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,text:o.text,items:o.items,height:o.height,value:o.value})},_checkTitle:function(){var self=this,val=this.getValue();BI.any(this.options.items,function(i,item){if(BI.contains(val,item.value))return self.trigger.setTitle(item.text||item.value),!0})},setValue:function(v){v=BI.isArray(v)?v:[v],this.options.value=v,this.trigger.setValue(v),this._checkTitle()},getValue:function(){return this.options.value||[]},populate:function(items){BI.SingleTreeTrigger.superclass.populate.apply(this,arguments),this.trigger.populate(items)}}),BI.shortcut("bi.single_tree_trigger",BI.SingleTreeTrigger),BI.TextValueDownListCombo=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.TextValueDownListCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-text-value-down-list-combo",height:24,attributes:{tabIndex:0}})},_init:function(){BI.TextValueDownListCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this._createValueMap();var value;BI.isNotNull(o.value)&&(value=this._digest(o.value)),this.trigger=BI.createWidget({type:"bi.down_list_select_text_trigger",cls:"text-value-down-list-trigger",height:o.height,items:o.items,text:o.text,value:value}),this.combo=BI.createWidget({type:"bi.down_list_combo",element:this,chooseType:BI.Selection.Single,adjustLength:2,height:o.height,el:this.trigger,value:BI.isNull(value)?[]:[value],items:BI.deepClone(o.items)}),this.combo.on(BI.DownListCombo.EVENT_CHANGE,function(){var currentVal=self.combo.getValue()[0].value;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))}),this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE,function(){var currentVal=self.combo.getValue()[0].childValue;currentVal!==self.value&&(self.setValue(currentVal),self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE))})},_createValueMap:function(){var self=this;this.valueMap={},BI.each(BI.flatten(this.options.items),function(idx,item){BI.has(item,"el")?BI.each(item.children,function(id,it){self.valueMap[it.value]={value:item.el.value,childValue:it.value}}):self.valueMap[item.value]={value:item.value}})},_digest:function(v){return this.value=v,this.valueMap[v]},setValue:function(v){v=this._digest(v),this.combo.setValue([v]),this.trigger.setValue(v)},getValue:function(){var v=this.combo.getValue()[0];return[v.childValue||v.value]},populate:function(items){this.options.items=BI.flatten(items),this.combo.populate(items),this._createValueMap()}}),BI.TextValueDownListCombo.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.text_value_down_list_combo",BI.TextValueDownListCombo),BI.DownListSelectTextTrigger=BI.inherit(BI.Trigger,{_defaultConfig:function(){return BI.extend(BI.DownListSelectTextTrigger.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-down-list-select-text-trigger",height:24,text:""})},_init:function(){BI.DownListSelectTextTrigger.superclass._init.apply(this,arguments);var o=this.options;this.trigger=BI.createWidget({type:"bi.select_text_trigger",element:this,height:o.height,items:this._formatItemArray(o.items),text:o.text,value:BI.isNull(o.value)?"":o.value.childValue||o.value.value})},_formatItemArray:function(){var sourceArray=BI.flatten(BI.deepClone(this.options.items)),targetArray=[];return BI.each(sourceArray,function(idx,item){BI.has(item,"el")?(BI.each(item.children,function(id,it){it.text=item.el.text+"("+it.text+")"}),targetArray=BI.concat(targetArray,item.children)):targetArray.push(item)}),targetArray},setValue:function(vals){this.trigger.setValue(vals.childValue||vals.value)},populate:function(items){this.trigger.populate(this._formatItemArray(items))}}),BI.shortcut("bi.down_list_select_text_trigger",BI.DownListSelectTextTrigger),!function(){BI.TimePopup=BI.inherit(BI.Widget,{props:{baseCls:"bi-date-time-popup",height:68},render:function(){var self=this,o=this.options;return{type:"bi.vtape",items:[{el:{type:"bi.center_adapt",cls:"bi-split-top",items:[{type:"bi.dynamic_date_time_select",value:o.value,ref:function(_ref){self.timeSelect=_ref}}]},hgap:10,height:44},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Clears"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Now"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_NOW_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},setValue:function(value){this._checkValueValid(value)?this.timeSelect.setValue():this.timeSelect.setValue({hour:value.hour,minute:value.minute,second:value.second})},getValue:function(){return this.timeSelect.getValue()},_checkValueValid:function(value){return BI.isNull(value)||BI.isEmptyObject(value)||BI.isEmptyString(value)}}),BI.TimePopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.TimePopup.BUTTON_NOW_EVENT_CHANGE="BUTTON_NOW_EVENT_CHANGE",BI.TimePopup.CALENDAR_EVENT_CHANGE="CALENDAR_EVENT_CHANGE",BI.shortcut("bi.time_popup",BI.TimePopup)}(),!function(){BI.TimeCombo=BI.inherit(BI.Single,{constants:{popupHeight:80,popupWidth:240,comboAdjustHeight:1,border:1},props:{baseCls:"bi-time-combo bi-border bi-border-radius bi-focus-shadow",width:78,height:22,format:"",allowEdit:!1},render:function(){var self=this,opts=this.options;this.storeTriggerValue="",this.storeValue=opts.value;var popup={type:"bi.time_popup",value:opts.value,listeners:[{eventName:BI.TimePopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.hidePopupView(),self.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.hidePopupView(),self.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}},{eventName:BI.TimePopup.BUTTON_NOW_EVENT_CHANGE,action:function(){self._setNowTime()}}],ref:function(_ref){self.popup=_ref}};return{type:"bi.htape",items:[{type:"bi.absolute",items:[{el:{type:"bi.combo",container:opts.container,toggle:!1,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:{type:"bi.time_trigger",height:opts.height,allowEdit:opts.allowEdit,watermark:opts.watermark,format:opts.format,value:opts.value,ref:function(_ref){self.trigger=_ref},listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.TimeCombo.EVENT_KEY_DOWN,arguments)}},{eventName:"EVENT_STOP",action:function(){self.combo.isViewVisible()||self.combo.showView()}},{eventName:"EVENT_FOCUS",action:function(){self.storeTriggerValue=self.trigger.getKey(),self.combo.isViewVisible()||self.combo.showView(),self.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){self.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_ERROR",action:function(){var date=BI.getDate();self.storeValue={hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()},self.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_VALID",action:function(){self.fireEvent("EVENT_VALID")}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}},{eventName:"EVENT_CONFIRM",action:function(){if(!self.combo.isViewVisible()){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)?(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())):BI.isEmptyString(dateObj)&&(self.storeValue=null,self.trigger.setValue()),self.fireEvent("EVENT_CONFIRM")}}}]},adjustLength:this.constants.comboAdjustHeight,popup:{el:popup,width:this.constants.popupWidth,stopPropagation:!1},hideChecker:function(e){return 0===self.triggerBtn.element.find(e.target).length},listeners:[{eventName:BI.Combo.EVENT_BEFORE_POPUPVIEW,action:function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.TimeCombo.EVENT_BEFORE_POPUPVIEW)}}],ref:function(_ref){self.combo=_ref}},top:0,left:0,right:22,bottom:0},{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button time-font icon-size-16",width:22,height:22,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.combo.isViewVisible()||self.combo.showView()}}],ref:function(_ref){self.triggerBtn=_ref}},top:0,right:0}]}]}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v)},getValue:function(){return this.storeValue},hidePopupView:function(){this.combo.hideView()},_setNowTime:function(){var date=BI.getDate(),nowTome={hour:date.getHours(),minute:date.getMinutes(),second:date.getSeconds()};this.setValue(nowTome),this.hidePopupView(),this.fireEvent(BI.TimeCombo.EVENT_CONFIRM)}}),BI.TimeCombo.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.TimeCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimeCombo.EVENT_CHANGE="EVENT_CHANGE",BI.TimeCombo.EVENT_VALID="EVENT_VALID",BI.TimeCombo.EVENT_ERROR="EVENT_ERROR",BI.TimeCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.time_combo",BI.TimeCombo)}(),!function(){BI.TimeTrigger=BI.inherit(BI.Trigger,{_const:{COMPARE_FORMAT:"%H:%M:%S",COMPLETE_COMPARE_FORMAT:"%Y-%M-%d %H:%M:%S %P",FORMAT_ARRAY:["%H:%M:%S","%I:%M:%S","%l:%M:%S","%k:%M:%S","%l:%M:%S %p","%l:%M:%S %P","%H:%M:%S %p","%H:%M:%S %P","%l:%M","%k:%M","%I:%M","%H:%M","%M:%S"],DEFAULT_DATE_STRING:"2000-01-01"},props:{extraCls:"bi-time-trigger",value:{},format:"",allowEdit:!1},render:function(){var self=this,o=this.options;return this.storeTriggerValue="",this.storeValue=o.value,{type:"bi.absolute",items:[{el:{type:"bi.sign_editor",height:o.height,validationChecker:function(v){return self._dateCheck(v)},quitChecker:function(){return!1},ref:function(_ref){self.editor=_ref},value:this._formatValue(o.value),hgap:4,allowBlank:!0,watermark:BI.isKey(o.watermark)?o.watermark:BI.i18nText("BI-Basic_Unrestricted"),title:BI.bind(this._getTitle,this),listeners:[{eventName:"EVENT_KEY_DOWN",action:function(){self.fireEvent("EVENT_KEY_DOWN",arguments)}},{eventName:"EVENT_FOCUS",action:function(){self.storeTriggerValue=self.getKey(),self.fireEvent("EVENT_FOCUS")}},{eventName:"EVENT_BLUR",action:function(){self.fireEvent("EVENT_BLUR")}},{eventName:"EVENT_STOP",action:function(){self.fireEvent("EVENT_STOP")}},{eventName:"EVENT_VALID",action:function(){self.fireEvent("EVENT_VALID")}},{eventName:"EVENT_ERROR",action:function(){self.fireEvent("EVENT_ERROR")}},{eventName:"EVENT_CONFIRM",action:function(){var value=self.editor.getValue();if(BI.isNotNull(value)&&self.editor.setState(value),BI.isNotEmptyString(value)&&!BI.isEqual(self.storeTriggerValue,self.getKey())){var date=value.match(/\d+/g);self.storeValue={hour:0|date[0],minute:0|date[1],second:0|date[2]}}self.fireEvent("EVENT_CONFIRM")}},{eventName:"EVENT_START",action:function(){self.fireEvent("EVENT_START")}},{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},left:0,right:0,top:0,bottom:0},{el:{type:"bi.text",invisible:o.allowEdit,cls:"show-text",title:BI.bind(this._getTitle,this),hgap:4},left:0,right:0,top:0,bottom:0}]}},_dateCheck:function(date){var c=this._const;return BI.any(c.FORMAT_ARRAY,function(idx,format){return BI.print(BI.parseDateTime(c.DEFAULT_DATE_STRING+" "+date,c.COMPLETE_COMPARE_FORMAT),format)===date})},_getTitle:function(){var storeValue=this.storeValue||{},date=BI.getDate();return BI.print(BI.getDate(date.getFullYear(),0,1,storeValue.hour,storeValue.minute,storeValue.second),this._getFormatString())},_getFormatString:function(){return this.options.format||this._const.COMPARE_FORMAT},_formatValue:function(v){var now=BI.getDate();return BI.isNotEmptyObject(v)?BI.print(BI.getDate(now.getFullYear(),now.getMonth(),now.getDay(),v.hour,v.minute,v.second),this._getFormatString()):""},getKey:function(){return this.editor.getValue()},setValue:function(v){this.storeValue=v,this.editor.setValue(this._formatValue(v))},getValue:function(){return this.storeValue}}),BI.shortcut("bi.time_trigger",BI.TimeTrigger)}(),BI.DateInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var conf=BI.DateInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-date-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var self=this,o=this.options;BI.DateInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_date_combo",behaviors:o.behaviors,value:v});return combo.on(BI.DynamicDateCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_ERROR)}),combo.on(BI.DynamicDateCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hidePopupView(),self.right.hidePopupView()}),combo.on(BI.DynamicDateCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.DateInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d"),"%Y-%x-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d"),"%Y-%X-%d")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e"),"%Y-%x-%e")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e"),"%Y-%X-%e")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,obj.day,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g);return this._dateCheck(smallDate)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:smallObj[2]})&&this._dateCheck(bigDate)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:bigObj[2]})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X-%d"),"%Y-%X-%d"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X-%d"),"%Y-%X-%d"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.left.setTitle(v),this.right.setTitle(v),this.label.setTitle(v)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.DateInterval.EVENT_VALID="EVENT_VALID",BI.DateInterval.EVENT_ERROR="EVENT_ERROR",BI.DateInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.date_interval",BI.DateInterval),BI.TimeInterval=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0,timeErrorCls:"time-error"},_defaultConfig:function(){var conf=BI.TimeInterval.superclass._defaultConfig.apply(this,arguments);return BI.extend(conf,{extraCls:"bi-time-interval",minDate:"1900-01-01",maxDate:"2099-12-31"})},_init:function(){var self=this,o=this.options;BI.TimeInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_date_time_combo",behaviors:o.behaviors,value:v});return combo.on(BI.DynamicDateTimeCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_ERROR)}),combo.on(BI.DynamicDateTimeCombo.EVENT_VALID,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateTimeCombo.EVENT_FOCUS,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))}),combo.on(BI.DynamicDateTimeCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hidePopupView(),self.right.hidePopupView()}),combo.on(BI.DynamicDateTimeCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.TimeInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x-%d %H:%M:%S"),"%Y-%x-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%x-%e %H:%M:%S"),"%Y-%x-%e %H:%M:%S")===date||BI.print(BI.parseDateTime(date,"%Y-%X-%e %H:%M:%S"),"%Y-%X-%e %H:%M:%S")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,obj.day,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g);return this._dateCheck(smallDate)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:smallObj[2]})&&this._dateCheck(bigDate)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:bigObj[2]})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X-%d %H:%M:%S"),"%Y-%X-%d %H:%M:%S"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.left.setTitle(v),this.right.setTitle(v),this.label.setTitle(v)},_clearTitle:function(){this.left.setTitle(""),this.right.setTitle(""),this.label.setTitle("")},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimeInterval.EVENT_VALID="EVENT_VALID",BI.TimeInterval.EVENT_ERROR="EVENT_ERROR",BI.TimeInterval.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_interval",BI.TimeInterval),!function(){BI.TimePeriods=BI.inherit(BI.Single,{constants:{height:24,width:24,lgap:15,offset:0},props:{extraCls:"bi-time-interval",value:{}},render:function(){var self=this,o=this.options;return{type:"bi.absolute",height:this.constants.height,items:[{el:{type:"bi.horizontal_auto",items:[{type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-",ref:function(_ref){self.label=_ref}}]},top:0,left:0,right:0,bottom:0},{el:{type:"bi.center",height:this.constants.height,items:[{type:"bi.absolute",items:[{el:BI.extend({ref:function(_ref){self.left=_ref}},this._createCombo(o.value.start)),left:this.constants.offset,right:this.constants.width/2,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:BI.extend({ref:function(_ref){self.right=_ref}},this._createCombo(o.value.end)),left:this.constants.width/2,right:this.constants.offset,top:0,bottom:0}]}]},top:0,left:0,right:0,bottom:0}]}},_createCombo:function(v){var self=this;return{type:"bi.time_combo",value:v,listeners:[{eventName:BI.TimeCombo.EVENT_BEFORE_POPUPVIEW,action:function(){self.left.hidePopupView(),self.right.hidePopupView()}},{eventName:BI.TimeCombo.EVENT_CHANGE,action:function(){self.fireEvent(BI.TimePeriods.EVENT_CHANGE)}},{eventName:BI.TimeCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TimePeriods.EVENT_CONFIRM)}}]}},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end)},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.TimePeriods.EVENT_CONFIRM="EVENT_CONFIRM",BI.TimePeriods.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.time_periods",BI.TimePeriods)}(),BI.DynamicYearCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.item=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0},this.item.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year))},getValue:function(){var value=this.item.getValue();return{year:0===value.offset?-value.value:value.value}}}),BI.DynamicYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_card",BI.DynamicYearCard),BI.StaticYearCard=BI.inherit(BI.Widget,{_defaultConfig:function(){return BI.extend(BI.StaticYearCard.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-year-card",behaviors:{},min:"1900-01-01",max:"2099-12-31"})},_createYearCalendar:function(v){var o=this.options,y=this._year,calendar=BI.createWidget({type:"bi.year_calendar",behaviors:o.behaviors,min:o.min,max:o.max,logic:{dynamic:!0},year:y+12*v});return calendar.setValue(this._year),calendar},_init:function(){BI.StaticYearCard.superclass._init.apply(this,arguments);var self=this,o=this.options;this.selectedYear=this._year=BI.getDate().getFullYear(),this.backBtn=BI.createWidget({type:"bi.icon_button",cls:"pre-page-h-font",width:25,height:25,value:-1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.navigation.setSelect(self.navigation.getSelect()-1),self._checkLeftValid(),self._checkRightValid()}}]}),this.preBtn=BI.createWidget({type:"bi.icon_button",cls:"next-page-h-font",width:25,height:25,value:1,listeners:[{eventName:BI.IconButton.EVENT_CHANGE,action:function(){self.navigation.setSelect(self.navigation.getSelect()+1),self._checkLeftValid(),self._checkRightValid()}}]}),this.navigation=BI.createWidget({type:"bi.navigation",direction:"top",element:this,single:!0,logic:{dynamic:!0},tab:{type:"bi.htape",cls:"bi-split-top bi-split-bottom",height:30,items:[{el:{type:"bi.center_adapt",items:[self.backBtn]},width:25},{type:"bi.layout"},{el:{type:"bi.center_adapt",items:[self.preBtn]},width:25}]},cardCreator:BI.bind(this._createYearCalendar,this),afterCardShow:function(){this.setValue(self.selectedYear);var calendar=this.getSelectedCard();self.backBtn.setEnable(!calendar.isFrontYear()),self.preBtn.setEnable(!calendar.isFinalYear())}}),this.navigation.on(BI.Navigation.EVENT_CHANGE,function(){self.selectedYear=this.getValue(),self.fireEvent(BI.Controller.EVENT_CHANGE,arguments),self.fireEvent(BI.StaticYearCard.EVENT_CHANGE,self.selectedYear)}),BI.isKey(o.value)&&this.setValue(o.value)},_checkLeftValid:function(){var o=this.options,valid=!0;return this.backBtn.setEnable(valid),valid},_checkRightValid:function(){var o=this.options,valid=!0;return this.preBtn.setEnable(valid),valid},getValue:function(){return{year:this.selectedYear}},setValue:function(obj){var o=this.options;obj=obj||{};var v=obj.year;BI.checkDateVoid(v,1,1,o.min,o.max)[0]?(v=BI.getDate().getFullYear(),this.selectedYear="",this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue("")):(this.selectedYear=BI.parseInt(v),this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)),this.navigation.setValue(this.selectedYear)),this._checkLeftValid(),this._checkRightValid()}}),BI.StaticYearCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_card",BI.StaticYearCard),BI.DynamicYearCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,this.trigger=BI.createWidget({type:"bi.dynamic_year_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=this.getKey()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearTrigger.EVENT_CONFIRM,function(){self.combo.isViewVisible()||(this.getKey()&&this.getKey()!==self.storeTriggerValue?(self.storeValue=self.trigger.getValue(),self.setValue(self.storeValue)):this.getKey()||(self.storeValue=null,self.setValue()),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM))}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearCombo.Static,value:{year:date.getFullYear()}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.min,max:o.max},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue}}),BI.DynamicYearCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_combo",BI.DynamicYearCombo),BI.extend(BI.DynamicYearCombo,{Static:1,Dynamic:2}),BI.DynamicYearPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",textHeight:c.buttonHeight-1,cls:"bi-split-left bi-split-right bi-high-light bi-split-top",shadow:!0,text:BI.i18nText("BI-Basic_Current_Year"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){ +self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Fen"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear()}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Year")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_popup",BI.DynamicYearPopup),BI.DynamicYearTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},_defaultConfig:function(){return BI.extend(BI.DynamicYearTrigger.superclass._defaultConfig.apply(this,arguments),{extraCls:"bi-year-trigger",min:"1900-01-01",max:"2099-12-31",height:24})},beforeInit:function(callback){var o=this.options;o.title=BI.bind(this._titleCreator,this),callback()},_init:function(){BI.DynamicYearTrigger.superclass._init.apply(this,arguments);var self=this,o=this.options,c=this._const;this.editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,1,1,o.min,o.max)[0]},quitChecker:function(v){return!1},hgap:c.hgap,vgap:c.vgap,watermark:BI.i18nText("BI-Basic_Unrestricted"),allowBlank:!0,errorText:function(){return BI.i18nText("BI-Year_Trigger_Invalid_Text")}}),this.editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_FOCUS)}),this.editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_STOP)}),this.editor.on(BI.SignEditor.EVENT_CONFIRM,function(){var value=self.editor.getValue();BI.isNotNull(value)&&self.editor.setValue(value),BI.isNotEmptyString(value)&&(self.storeValue={type:BI.DynamicDateCombo.Static,value:{year:value}}),self.fireEvent(BI.DynamicYearTrigger.EVENT_CONFIRM)}),this.editor.on(BI.SignEditor.EVENT_SPACE,function(){self.editor.isValid()&&self.editor.blur()}),this.editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_START)}),this.editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearTrigger.EVENT_ERROR)}),BI.createWidget({element:this,type:"bi.htape",items:[{el:this.editor},{el:{type:"bi.text_button",baseCls:"bi-trigger-year-text",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){var dateStr=BI.print(date,"%Y");this.editor.setState(dateStr),this.editor.setValue(dateStr)},_titleCreator:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;if(!this.editor.isValid())return"";switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,"%Y");return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return value=value||{},value.year}},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:value=value||{},this.editor.setState(value.year),this.editor.setValue(value.year)}},getValue:function(){return this.storeValue},getKey:function(){return 0|this.editor.getValue()}}),BI.DynamicYearTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearTrigger.EVENT_START="EVENT_START",BI.DynamicYearTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearTrigger.EVENT_STOP="EVENT_STOP",BI.shortcut("bi.dynamic_year_trigger",BI.DynamicYearTrigger),BI.DynamicYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.MONTH,ref:function(){self.month=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year)),this.month.setValue(this._createValue(BI.DynamicDateCard.TYPE.MONTH,v.month))},getValue:function(){var year=this.year.getValue(),month=this.month.getValue();return{year:0===year.offset?-year.value:year.value,month:0===month.offset?-month.value:month.value}}}),BI.DynamicYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_card",BI.DynamicYearMonthCard),BI.StaticYearMonthCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-month-card",behaviors:{}},_createMonths:function(){var self=this,month=[1,7,2,8,3,9,4,10,5,11,6,12],items=[];return items.push(month.slice(0,2)),items.push(month.slice(2,4)),items.push(month.slice(4,6)),items.push(month.slice(6,8)),items.push(month.slice(8,10)),items.push(month.slice(10,12)),BI.map(items,function(i,item){return BI.map(item,function(j,td){return{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:23,width:38,value:td,text:td,ref:function(_ref){self.monthMap[0===j?i:i+6]=_ref}}})})},render:function(){var self=this,o=this.options;return this.monthMap={},{type:"bi.vertical",items:[{type:"bi.year_picker",min:o.min,max:o.max,ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self._checkMonthStatus(value),self.setValue({year:value,month:self.selectedMonth})}}]},{type:"bi.button_group",cls:"bi-split-top",behaviors:o.behaviors,ref:function(){self.month=this},items:this._createMonths(),layouts:[BI.LogicFactory.createLogic("table",BI.extend({dynamic:!0},{columns:2,rows:6,columnSize:[.5,.5],rowSize:25})),{type:"bi.center_adapt",vgap:1,hgap:2}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedMonth=this.getValue()[0],self.fireEvent(BI.StaticYearMonthCard.EVENT_CHANGE)}}]}]}},mounted:function(){this._checkMonthStatus(this.selectedYear)},_checkMonthStatus:function(year){var o=this.options,minDate=BI.parseDateTime(o.min,"%Y-%X-%d"),maxDate=BI.parseDateTime(o.max,"%Y-%X-%d"),minYear=minDate.getFullYear(),maxYear=maxDate.getFullYear(),minMonth=0,maxMonth=11;minYear===year&&(minMonth=minDate.getMonth()),maxYear===year&&(maxMonth=maxDate.getMonth());var yearInvalid=yearmaxYear;BI.each(this.monthMap,function(month,obj){var monthInvalid=monthmaxMonth;obj.setEnable(!yearInvalid&&!monthInvalid)})},getValue:function(){return{year:this.selectedYear,month:this.selectedMonth}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.month=obj.month||0,0===newObj.year||0===newObj.month||BI.checkDateVoid(newObj.year,newObj.month,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedMonth="",this.yearPicker.setValue(year),this.month.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedMonth=BI.parseInt(newObj.month),this.yearPicker.setValue(this.selectedYear),this.month.setValue(this.selectedMonth)}}),BI.StaticYearMonthCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_month_card",BI.StaticYearMonthCard),BI.DynamicYearMonthCombo=BI.inherit(BI.Single,{props:{baseCls:"bi-year-month-combo bi-border bi-focus-shadow",behaviors:{},minDate:"1900-01-01",maxDate:"2099-12-31",height:22},_init:function(){BI.DynamicYearMonthCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,this.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_month_trigger",min:o.minDate,max:o.maxDate,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_ERROR)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_VALID,function(){self.fireEvent(BI.DynamicYearMonthCombo.EVENT_VALID)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearMonthTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_FOCUS)}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:100,stopPropagation:!1,el:{type:"bi.dynamic_year_month_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearMonthPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),month:date.getMonth()+1}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.minDate,max:o.maxDate},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearMonthCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},hideView:function(){this.combo.hideView()},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue},getKey:function(){return this.trigger.getKey()},isValid:function(){return this.trigger.isValid()}}),BI.DynamicYearMonthCombo.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthCombo.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthCombo.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_month_combo",BI.DynamicYearMonthCombo),BI.extend(BI.DynamicYearMonthCombo,{Static:1,Dynamic:2}),BI.DynamicYearMonthPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-month-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearMonthCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Month"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicDateCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%x"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Month"),value:BI.DynamicYearCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearCombo.Dynamic:return{type:"bi.dynamic_year_month_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearCombo.Static:default:return{type:"bi.static_year_month_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.StaticYearMonthCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearMonthPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear(),month:date.getMonth()+1}),self._setInnerValue();break;case BI.DynamicYearCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Month")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearMonthPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearMonthPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearMonthPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_month_popup",BI.DynamicYearMonthPopup),BI.DynamicYearMonthTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-month-trigger",min:"1900-01-01",max:"2099-12-31",height:22},beforeInit:function(callback){var o=this.options;o.title=BI.bind(this._titleCreator,this),callback()},_init:function(){BI.DynamicYearMonthTrigger.superclass._init.apply(this,arguments);var o=this.options;this.yearEditor=this._createEditor(!0),this.monthEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height}]},{type:"bi.htape",items:[this.monthEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Month"),width:o.height},width:o.height}]}]},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_createEditor:function(isYear){var self=this,o=this.options,c=this._const,minDate=BI.parseDateTime(o.min,"%Y-%X-%d"),editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return isYear?""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,v===minDate.getFullYear()?minDate.getMonth()+1:1,1,o.min,o.max)[0]:""===v||BI.isPositiveInteger(v)&&v>=1&&v<=12&&!BI.checkDateVoid(BI.getDate().getFullYear(),v,1,o.min,o.max)[0]},quitChecker:function(){return!1},watermark:BI.i18nText("BI-Basic_Unrestricted"),errorText:function(v){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},hgap:c.hgap,vgap:c.vgap,allowBlank:!0});return editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN)}),editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_FOCUS)}),editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_STOP)}),editor.on(BI.SignEditor.EVENT_CONFIRM,function(){self._doEditorConfirm(editor),self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM)}),editor.on(BI.SignEditor.EVENT_SPACE,function(){editor.isValid()&&editor.blur()}),editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_START)}),editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_ERROR)}),editor.on(BI.SignEditor.EVENT_VALID,function(){var year=self.yearEditor.getValue(),month=self.monthEditor.getValue();BI.isNotEmptyString(year)&&BI.isNotEmptyString(month)&&BI.isPositiveInteger(year)&&month>=1&&month<=12&&!BI.checkDateVoid(year,month,1,o.min,o.max)[0]&&self.fireEvent(BI.DynamicYearMonthTrigger.EVENT_VALID)}),editor.on(BI.SignEditor.EVENT_CHANGE,function(){isYear&&self._autoSwitch(editor)}),editor},_titleCreator:function(){var storeValue=this.storeValue||{},type=storeValue.type||BI.DynamicDateCombo.Static,value=storeValue.value;if(!this.monthEditor.isValid()||!this.yearEditor.isValid())return"";switch(type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value),date=BI.getDate();date=BI.DynamicDateHelper.getCalculation(value);var dateStr=BI.print(date,"%Y-%x");return BI.isEmptyString(text)?dateStr:text+":"+dateStr;case BI.DynamicDateCombo.Static:default:return value=value||{},this._getStaticTitle(value)}},_doEditorConfirm:function(editor){var value=editor.getValue();BI.isNotNull(value)&&editor.setValue(value);var monthValue=this.monthEditor.getValue();this.storeValue={type:BI.DynamicDateCombo.Static,value:{year:this.yearEditor.getValue(),month:BI.isEmptyString(this.monthEditor.getValue())?"":monthValue}}},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_autoSwitch:function(editor){var v=editor.getValue();BI.isNotEmptyString(v)&&BI.checkDateLegal(v)&&4===v.length&&this._yearCheck(v)&&(this._doEditorConfirm(editor),this.fireEvent(BI.DynamicYearMonthTrigger.EVENT_CONFIRM),this.monthEditor.focus())},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(obj.month)&&0!==BI.parseInt(obj.month)&&(value+=Math.abs(obj.month)+BI.i18nText("BI-Basic_Month")+(obj.month<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){this.yearEditor.setValue(date.getFullYear()),this.monthEditor.setValue(date.getMonth()+1)},_getStaticTitle:function(value){value=value||{};var hasYear=!(BI.isNull(value.year)||BI.isEmptyString(value.year)),hasMonth=!(BI.isNull(value.month)||BI.isEmptyString(value.month));switch(hasYear<<1|hasMonth){case 0:return"";case 1:return value.month;case 2:return value.year;case 3:default:return value.year+"-"+value.month}},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicDateCombo.Static,value=v.value||v),type){case BI.DynamicDateCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicDateCombo.Static:default:value=value||{};var month=BI.isNull(value.month)?null:value.month;this.yearEditor.setValue(value.year),this.monthEditor.setValue(month)}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.monthEditor.getValue()},isValid:function(){return this.yearEditor.isValid()&&this.monthEditor.isValid()}}),BI.DynamicYearMonthTrigger.EVENT_VALID="EVENT_VALID",BI.DynamicYearMonthTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearMonthTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearMonthTrigger.EVENT_START="EVENT_START",BI.DynamicYearMonthTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearMonthTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearMonthTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_month_trigger",BI.DynamicYearMonthTrigger),BI.YearMonthInterval=BI.inherit(BI.Single,{constants:{height:24,width:25,lgap:15,offset:-15,timeErrorCls:"time-error"},props:{extraCls:"bi-year-month-interval",minDate:"1900-01-01",maxDate:"2099-12-31"},_init:function(){var self=this,o=this.options;BI.YearMonthInterval.superclass._init.apply(this,arguments),o.value=o.value||{},this.left=this._createCombo(o.value.start),this.right=this._createCombo(o.value.end),this.label=BI.createWidget({type:"bi.label",height:this.constants.height,width:this.constants.width,text:"-"}),BI.createWidget({element:self,type:"bi.center",hgap:15,height:this.constants.height,items:[{type:"bi.absolute",items:[{el:self.left,left:this.constants.offset,right:0,top:0,bottom:0}]},{type:"bi.absolute",items:[{el:self.right,left:0,right:this.constants.offset,top:0,bottom:0}]}]}),BI.createWidget({type:"bi.horizontal_auto",element:this,items:[self.label]})},_createCombo:function(v){var self=this,o=this.options,combo=BI.createWidget({type:"bi.dynamic_year_month_combo",behaviors:o.behaviors,value:v,listeners:[{eventName:BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,action:function(){self.fireEvent(BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW)}}]});return combo.on(BI.DynamicYearMonthCombo.EVENT_ERROR,function(){self._clearTitle(),BI.Bubbles.hide("error"),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)}),combo.on(BI.DynamicYearMonthCombo.EVENT_VALID,function(){self._checkValid()}),combo.on(BI.DynamicYearMonthCombo.EVENT_FOCUS,function(){self._checkValid()}),combo.on(BI.DynamicYearMonthCombo.EVENT_BEFORE_POPUPVIEW,function(){self.left.hideView(),self.right.hideView()}),combo.on(BI.DynamicYearMonthCombo.EVENT_CONFIRM,function(){BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls),self.fireEvent(BI.YearMonthInterval.EVENT_CHANGE))}),combo},_dateCheck:function(date){return BI.print(BI.parseDateTime(date,"%Y-%x"),"%Y-%x")===date||BI.print(BI.parseDateTime(date,"%Y-%X"),"%Y-%X")===date},_checkVoid:function(obj){var o=this.options;return!BI.checkDateVoid(obj.year,obj.month,1,o.minDate,o.maxDate)[0]},_check:function(smallDate,bigDate){var smallObj=smallDate.match(/\d+/g),bigObj=bigDate.match(/\d+/g),smallDate4Check="";BI.isNotNull(smallObj)&&(smallDate4Check=(smallObj[0]||"")+"-"+(smallObj[1]||1));var bigDate4Check="";return BI.isNotNull(bigObj)&&(bigDate4Check=(bigObj[0]||"")+"-"+(bigObj[1]||1)),this._dateCheck(smallDate4Check)&&BI.checkDateLegal(smallDate)&&this._checkVoid({year:smallObj[0],month:smallObj[1],day:1})&&this._dateCheck(bigDate4Check)&&BI.checkDateLegal(bigDate)&&this._checkVoid({year:bigObj[0],month:bigObj[1],day:1})},_compare:function(smallDate,bigDate){return smallDate=BI.print(BI.parseDateTime(smallDate,"%Y-%X"),"%Y-%X"),bigDate=BI.print(BI.parseDateTime(bigDate,"%Y-%X"),"%Y-%X"),BI.isNotNull(smallDate)&&BI.isNotNull(bigDate)&&smallDate>bigDate},_setTitle:function(v){this.setTitle(v)},_clearTitle:function(){this.setTitle("")},_checkValid:function(){var self=this;BI.Bubbles.hide("error");var smallDate=self.left.getKey(),bigDate=self.right.getKey();self.left.isValid()&&self.right.isValid()&&self._check(smallDate,bigDate)&&self._compare(smallDate,bigDate)?(self._setTitle(BI.i18nText("BI-Time_Interval_Error_Text")),self.element.addClass(self.constants.timeErrorCls),BI.Bubbles.show("error",BI.i18nText("BI-Time_Interval_Error_Text"),self,{offsetStyle:"center"}),self.fireEvent(BI.YearMonthInterval.EVENT_ERROR)):(self._clearTitle(),self.element.removeClass(self.constants.timeErrorCls))},setValue:function(date){date=date||{},this.left.setValue(date.start),this.right.setValue(date.end),this._checkValid()},getValue:function(){return{start:this.left.getValue(),end:this.right.getValue()}}}),BI.YearMonthInterval.EVENT_VALID="EVENT_VALID",BI.YearMonthInterval.EVENT_ERROR="EVENT_ERROR",BI.YearMonthInterval.EVENT_CHANGE="EVENT_CHANGE",BI.YearMonthInterval.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.year_month_interval",BI.YearMonthInterval),BI.DynamicYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-month-card"},render:function(){var self=this;return{type:"bi.vertical",items:[{type:"bi.label",text:BI.i18nText("BI-Multi_Date_Relative_Current_Time"),textAlign:"left",height:24},{type:"bi.dynamic_date_param_item",ref:function(){self.year=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]},{type:"bi.dynamic_date_param_item",dateType:BI.DynamicDateCard.TYPE.QUARTER,ref:function(){self.quarter=this},listeners:[{eventName:"EVENT_CHANGE",action:function(){self.fireEvent("EVENT_CHANGE")}}]}],vgap:10,hgap:10}},_createValue:function(type,v){return{dateType:type,value:Math.abs(v),offset:v>0?1:0}},setValue:function(v){v=v||{year:0,month:0},this.year.setValue(this._createValue(BI.DynamicDateCard.TYPE.YEAR,v.year)),this.quarter.setValue(this._createValue(BI.DynamicDateCard.TYPE.QUARTER,v.quarter))},getValue:function(){var year=this.year.getValue(),quarter=this.quarter.getValue();return{year:0===year.offset?-year.value:year.value,quarter:0===quarter.offset?-quarter.value:quarter.value}}}),BI.DynamicYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_card",BI.DynamicYearQuarterCard),BI.StaticYearQuarterCard=BI.inherit(BI.Widget,{props:{baseCls:"bi-static-year-quarter-card",behaviors:{}},_createQuarter:function(){var items=[{text:BI.Date._QN[1],value:1},{text:BI.Date._QN[2],value:2},{text:BI.Date._QN[3],value:3},{text:BI.Date._QN[4],value:4}];return BI.map(items,function(j,item){return BI.extend(item,{type:"bi.text_item",cls:"bi-list-item-select",textAlign:"center",whiteSpace:"nowrap",once:!1,forceSelected:!0,height:24})})},render:function(){var self=this,o=this.options;return{type:"bi.vertical",items:[{type:"bi.year_picker",ref:function(){self.yearPicker=this},behaviors:o.behaviors,height:30,listeners:[{eventName:BI.YearPicker.EVENT_CHANGE,action:function(){var value=this.getValue();self.setValue({year:value,quarter:self.selectedQuarter})}}]},{type:"bi.button_group",behaviors:o.behaviors,ref:function(){self.quarter=this},items:this._createQuarter(),layouts:[{type:"bi.vertical",vgap:10}],value:o.value,listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(){self.selectedYear=self.yearPicker.getValue(),self.selectedQuarter=this.getValue()[0],self.fireEvent(BI.StaticYearQuarterCard.EVENT_CHANGE)}}]}]}},getValue:function(){return{year:this.selectedYear,quarter:this.selectedQuarter}},setValue:function(obj){var o=this.options,newObj={};if(newObj.year=obj.year||0,newObj.quarter=obj.quarter||0,0===newObj.quarter||0===newObj.year||BI.checkDateVoid(newObj.year,newObj.quarter,1,o.min,o.max)[0]){var year=newObj.year||BI.getDate().getFullYear();this.selectedYear=year,this.selectedQuarter="",this.yearPicker.setValue(year),this.quarter.setValue()}else this.selectedYear=BI.parseInt(newObj.year),this.selectedQuarter=BI.parseInt(newObj.quarter),this.yearPicker.setValue(this.selectedYear),this.quarter.setValue(this.selectedQuarter)}}),BI.StaticYearQuarterCard.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.static_year_quarter_card",BI.StaticYearQuarterCard),BI.DynamicYearQuarterCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-year-quarter-combo bi-border bi-focus-shadow",behaviors:{},min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;this.storeValue=o.value,self.storeTriggerValue="",this.trigger=BI.createWidget({type:"bi.dynamic_year_quarter_trigger",min:o.min,max:o.max,height:o.height,value:o.value||""}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN,function(){ +self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_START,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_STOP,function(){self.combo.showView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_ERROR,function(){self.combo.isViewVisible()&&self.combo.hideView()}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM,function(){var dateStore=self.storeTriggerValue,dateObj=self.trigger.getKey();BI.isNotEmptyString(dateObj)&&!BI.isEqual(dateObj,dateStore)&&(self.storeValue=self.trigger.getValue(),self.setValue(self.trigger.getValue())),self._checkDynamicValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}),this.trigger.on(BI.DynamicYearQuarterTrigger.EVENT_FOCUS,function(){self.storeTriggerValue=self.trigger.getKey()}),this.combo=BI.createWidget({type:"bi.combo",container:o.container,isNeedAdjustHeight:!1,isNeedAdjustWidth:!1,el:this.trigger,popup:{minWidth:85,stopPropagation:!1,el:{type:"bi.dynamic_year_quarter_popup",ref:function(){self.popup=this},listeners:[{eventName:BI.DynamicYearQuarterPopup.EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE,action:function(){self.setValue(),self.combo.hideView(),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE,action:function(){var date=BI.getDate();self.setValue({type:BI.DynamicYearMonthCombo.Static,value:{year:date.getFullYear(),quarter:BI.getQuarter(date)}}),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}},{eventName:BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE,action:function(){self.setValue(self.popup.getValue()),self.combo.hideView(),self.fireEvent(BI.DynamicDateCombo.EVENT_CONFIRM)}}],behaviors:o.behaviors,min:o.min,max:o.max},value:o.value||""}}),this.combo.on(BI.Combo.EVENT_BEFORE_POPUPVIEW,function(){self.popup.setValue(self.storeValue),self.fireEvent(BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW)}),BI.createWidget({type:"bi.htape",element:this,ref:function(){self.comboWrapper=this},items:[{el:{type:"bi.icon_button",cls:"bi-trigger-icon-button date-change-h-font",width:24,height:24,ref:function(){self.changeIcon=this}},width:24},this.combo]}),this._checkDynamicValue(o.value)},_checkDynamicValue:function(v){var type=null;switch(BI.isNotNull(v)&&(type=v.type),type){case BI.DynamicYearQuarterCombo.Dynamic:this.changeIcon.setVisible(!0),this.comboWrapper.attr("items")[0].width=24,this.comboWrapper.resize();break;default:this.comboWrapper.attr("items")[0].width=0,this.comboWrapper.resize(),this.changeIcon.setVisible(!1)}},setValue:function(v){this.storeValue=v,this.trigger.setValue(v),this._checkDynamicValue(v)},getValue:function(){return this.storeValue}}),BI.DynamicYearQuarterCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterCombo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.shortcut("bi.dynamic_year_quarter_combo",BI.DynamicYearQuarterCombo),BI.extend(BI.DynamicYearQuarterCombo,{Static:1,Dynamic:2}),BI.DynamicYearQuarterPopup=BI.inherit(BI.Widget,{constants:{tabHeight:30,buttonHeight:24},props:{baseCls:"bi-year-quarter-popup",behaviors:{},min:"1900-01-01",max:"2099-12-31",width:180,height:240},render:function(){var self=this,opts=this.options,c=this.constants;return this.storeValue={type:BI.DynamicYearQuarterCombo.Static},{type:"bi.vtape",items:[{el:this._getTabJson()},{el:{type:"bi.grid",items:[[{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Basic_Clear"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-left bi-split-right bi-high-light bi-split-top",textHeight:c.buttonHeight-1,shadow:!0,text:BI.i18nText("BI-Basic_Current_Quarter"),ref:function(){self.textButton=this},listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE)}}]},{type:"bi.text_button",cls:"bi-split-top bi-high-light",shadow:!0,textHeight:c.buttonHeight-1,text:BI.i18nText("BI-Basic_OK"),listeners:[{eventName:BI.TextButton.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE)}}]}]]},height:24}]}},_setInnerValue:function(){if(this.dateTab.getSelect()===BI.DynamicYearQuarterCombo.Static)this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0);else{var date=BI.DynamicDateHelper.getCalculation(this.dynamicPane.getValue());date=BI.print(date,"%Y-%Q"),this.textButton.setValue(date),this.textButton.setEnable(!1)}},_getTabJson:function(){var self=this,o=this.options;return{type:"bi.tab",ref:function(){self.dateTab=this},tab:{type:"bi.linear_segment",cls:"bi-split-bottom",height:this.constants.tabHeight,items:BI.createItems([{text:BI.i18nText("BI-Basic_Year_Quarter"),value:BI.DynamicYearQuarterCombo.Static},{text:BI.i18nText("BI-Basic_Dynamic_Title"),value:BI.DynamicYearQuarterCombo.Dynamic}],{textAlign:"center"})},cardCreator:function(v){switch(v){case BI.DynamicYearQuarterCombo.Dynamic:return{type:"bi.dynamic_year_quarter_card",listeners:[{eventName:"EVENT_CHANGE",action:function(){self._setInnerValue(self.year,v)}}],ref:function(){self.dynamicPane=this}};case BI.DynamicYearQuarterCombo.Static:default:return{type:"bi.static_year_quarter_card",behaviors:o.behaviors,min:self.options.min,max:self.options.max,listeners:[{eventName:BI.DynamicYearCard.EVENT_CHANGE,action:function(){self.fireEvent(BI.DynamicYearQuarterPopup.EVENT_CHANGE)}}],ref:function(){self.year=this}}}},listeners:[{eventName:BI.Tab.EVENT_CHANGE,action:function(){var v=self.dateTab.getSelect();switch(v){case BI.DynamicYearQuarterCombo.Static:var date=BI.DynamicDateHelper.getCalculation(self.dynamicPane.getValue());self.year.setValue({year:date.getFullYear(),quarter:BI.getQuarter(date)}),self._setInnerValue();break;case BI.DynamicYearQuarterCombo.Dynamic:default:self.storeValue&&self.storeValue.type===BI.DynamicYearQuarterCombo.Dynamic?self.dynamicPane.setValue(self.storeValue.value):self.dynamicPane.setValue({year:0}),self._setInnerValue()}}}]}},setValue:function(v){this.storeValue=v;var self=this,type,value;switch(v=v||{},type=v.type||BI.DynamicDateCombo.Static,value=v.value||v,this.dateTab.setSelect(type),type){case BI.DynamicDateCombo.Dynamic:this.dynamicPane.setValue(value),self._setInnerValue();break;case BI.DynamicDateCombo.Static:default:this.year.setValue(value),this.textButton.setValue(BI.i18nText("BI-Basic_Current_Quarter")),this.textButton.setEnable(!0)}},getValue:function(){return{type:this.dateTab.getSelect(),value:this.dateTab.getValue()}}}),BI.DynamicYearQuarterPopup.BUTTON_CLEAR_EVENT_CHANGE="BUTTON_CLEAR_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_lABEL_EVENT_CHANGE="BUTTON_lABEL_EVENT_CHANGE",BI.DynamicYearQuarterPopup.BUTTON_OK_EVENT_CHANGE="BUTTON_OK_EVENT_CHANGE",BI.DynamicYearQuarterPopup.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.dynamic_year_quarter_popup",BI.DynamicYearQuarterPopup),BI.DynamicYearQuarterTrigger=BI.inherit(BI.Trigger,{_const:{hgap:4,vgap:2},props:{extraCls:"bi-year-quarter-trigger",min:"1900-01-01",max:"2099-12-31",height:22},_init:function(){BI.DynamicYearQuarterTrigger.superclass._init.apply(this,arguments);var o=this.options;this.yearEditor=this._createEditor(!0),this.quarterEditor=this._createEditor(!1),BI.createWidget({element:this,type:"bi.htape",items:[{type:"bi.center",items:[{type:"bi.htape",items:[this.yearEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Year"),width:o.height},width:o.height}]},{type:"bi.htape",items:[this.quarterEditor,{el:{type:"bi.text_button",text:BI.i18nText("BI-Multi_Date_Quarter"),width:24},width:24}]}]},{el:{type:"bi.trigger_icon_button",width:o.height},width:o.height}]}),this.setValue(o.value)},_createEditor:function(isYear){var self=this,o=this.options,c=this._const,editor=BI.createWidget({type:"bi.sign_editor",height:o.height,validationChecker:function(v){return isYear?""===v||BI.isPositiveInteger(v)&&!BI.checkDateVoid(v,1,1,o.min,o.max)[0]:""===v||BI.isPositiveInteger(v)&&v>=1&&v<=4&&!BI.checkDateVoid(BI.getDate().getFullYear(),v,1,o.min,o.max)[0]},quitChecker:function(){return!1},errorText:function(v){return BI.i18nText("BI-Year_Trigger_Invalid_Text")},watermark:BI.i18nText("BI-Basic_Unrestricted"),hgap:c.hgap,vgap:c.vgap,title:"",allowBlank:!0});return editor.on(BI.SignEditor.EVENT_KEY_DOWN,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN)}),editor.on(BI.SignEditor.EVENT_FOCUS,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_FOCUS)}),editor.on(BI.SignEditor.EVENT_STOP,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_STOP)}),editor.on(BI.SignEditor.EVENT_CONFIRM,function(){self._doEditorConfirm(editor),self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM)}),editor.on(BI.SignEditor.EVENT_SPACE,function(){editor.isValid()&&editor.blur()}),editor.on(BI.SignEditor.EVENT_START,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_START)}),editor.on(BI.SignEditor.EVENT_ERROR,function(){self.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_ERROR)}),editor.on(BI.SignEditor.EVENT_CHANGE,function(){isYear&&self._autoSwitch(editor)}),editor},_doEditorConfirm:function(editor){var value=editor.getValue();BI.isNotNull(value)&&editor.setValue(value);var quarterValue=this.quarterEditor.getValue();this.storeValue={type:BI.DynamicYearQuarterCombo.Static,value:{year:this.yearEditor.getValue(),quarter:BI.isEmptyString(this.quarterEditor.getValue())?"":quarterValue}},this.setTitle(this._getStaticTitle(this.storeValue.value))},_yearCheck:function(v){var date=BI.print(BI.parseDateTime(v,"%Y-%X-%d"),"%Y-%X-%d");return BI.print(BI.parseDateTime(v,"%Y"),"%Y")===v&&date>=this.options.min&&date<=this.options.max},_autoSwitch:function(editor){var v=editor.getValue();BI.isNotEmptyString(v)&&BI.checkDateLegal(v)&&4===v.length&&this._yearCheck(v)&&(this._doEditorConfirm(editor),this.fireEvent(BI.DynamicYearQuarterTrigger.EVENT_CONFIRM),this.quarterEditor.focus())},_getStaticTitle:function(value){value=value||{};var hasYear=!(BI.isNull(value.year)||BI.isEmptyString(value.year)),hasMonth=!(BI.isNull(value.quarter)||BI.isEmptyString(value.quarter));switch(hasYear<<1|hasMonth){case 0:return"";case 1:return value.quarter;case 2:return value.year;case 3:default:return value.year+"-"+value.quarter}},_getText:function(obj){var value="";return BI.isNotNull(obj.year)&&0!==BI.parseInt(obj.year)&&(value+=Math.abs(obj.year)+BI.i18nText("BI-Basic_Year")+(obj.year<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),BI.isNotNull(obj.quarter)&&0!==BI.parseInt(obj.quarter)&&(value+=Math.abs(obj.quarter)+BI.i18nText("BI-Basic_Single_Quarter")+(obj.quarter<0?BI.i18nText("BI-Basic_Front"):BI.i18nText("BI-Basic_Behind"))),value},_setInnerValue:function(date,text){var dateStr=BI.print(date,"%Y-%Q");this.yearEditor.setValue(date.getFullYear()),this.quarterEditor.setValue(BI.getQuarter(date)),this.setTitle(BI.isEmptyString(text)?dateStr:text+":"+dateStr)},setValue:function(v){var type,value,date=BI.getDate();switch(this.storeValue=v,BI.isNotNull(v)&&(type=v.type||BI.DynamicYearQuarterCombo.Static,value=v.value||v),type){case BI.DynamicYearQuarterCombo.Dynamic:var text=this._getText(value);date=BI.DynamicDateHelper.getCalculation(value),this._setInnerValue(date,text);break;case BI.DynamicYearQuarterCombo.Static:default:value=value||{};var quarter=BI.isNull(value.quarter)?null:value.quarter;this.yearEditor.setValue(value.year),this.yearEditor.setTitle(value.year),this.quarterEditor.setValue(quarter),this.quarterEditor.setTitle(quarter),this.setTitle(this._getStaticTitle(value))}},getValue:function(){return this.storeValue},getKey:function(){return this.yearEditor.getValue()+"-"+this.quarterEditor.getValue()}}),BI.DynamicYearQuarterTrigger.EVENT_FOCUS="EVENT_FOCUS",BI.DynamicYearQuarterTrigger.EVENT_ERROR="EVENT_ERROR",BI.DynamicYearQuarterTrigger.EVENT_START="EVENT_START",BI.DynamicYearQuarterTrigger.EVENT_CONFIRM="EVENT_CONFIRM",BI.DynamicYearQuarterTrigger.EVENT_STOP="EVENT_STOP",BI.DynamicYearQuarterTrigger.EVENT_KEY_DOWN="EVENT_KEY_DOWN",BI.shortcut("bi.dynamic_year_quarter_trigger",BI.DynamicYearQuarterTrigger),BI.AbstractAllValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractAllValueChooser.superclass._defaultConfig.apply(this,arguments),{width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_itemsCreator:function(options,callback){function call(items){var keywords=(options.keywords||[]).slice();options.keyword&&keywords.push(options.keyword);var resultItems=items;if(BI.isNotEmptyArray(keywords)&&(resultItems=[],BI.each(keywords,function(i,kw){var search=BI.Func.getSearchResult(items,kw);resultItems=resultItems.concat(search.match).concat(search.find)}),resultItems=BI.uniq(resultItems)),options.selectedValues){var filter=BI.makeObject(options.selectedValues,!0);resultItems=BI.filter(resultItems,function(i,ob){return!filter[ob.value]})}return options.type===BI.MultiSelectCombo.REQ_GET_ALL_DATA?void callback({items:resultItems}):options.type===BI.MultiSelectCombo.REQ_GET_DATA_LENGTH?void callback({count:resultItems.length}):void callback({items:resultItems,hasNext:!1})}var self=this,o=this.options;o.cache&&this.items?call(this.items):o.itemsCreator({},function(items){self.items=items,call(items)})}}),BI.AllValueChooserCombo=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&(this.items=o.items),this.combo=BI.createWidget({type:"bi.multi_select_combo",text:o.text,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,value:{type:BI.Selection.Multi,value:o.value||[]}}),this.combo.on(BI.MultiSelectCombo.EVENT_CONFIRM,function(){self.fireEvent(BI.AllValueChooserCombo.EVENT_CONFIRM)})},setValue:function(v){this.combo.setValue({type:BI.Selection.Multi,value:v||[]})},getValue:function(){var val=this.combo.getValue()||{};return val.type===BI.Selection.All?val.assist:val.value||[]},populate:function(items){this.items=items,this.combo.populate.apply(this,arguments)}}),BI.AllValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_chooser_combo",BI.AllValueChooserCombo),BI.AllValueChooserPane=BI.inherit(BI.AbstractAllValueChooser,{_defaultConfig:function(){return BI.extend(BI.AllValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-all-value-chooser-pane",width:200,height:30,items:null,itemsCreator:BI.emptyFn,cache:!0})},_init:function(){BI.AllValueChooserPane.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&(this.items=o.items),this.list=BI.createWidget({type:"bi.multi_select_list",element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height}),this.list.on(BI.MultiSelectList.EVENT_CHANGE,function(){self.fireEvent(BI.AllValueChooserPane.EVENT_CHANGE)})},setValue:function(v){this.list.setValue({type:BI.Selection.Multi,value:v||[]})},getValue:function(){var val=this.list.getValue()||{};return val.type===BI.Selection.All?val.assist:val.value||[]},populate:function(items){this.items=items,this.list.populate.apply(this.list,arguments)}}),BI.AllValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.all_value_chooser_pane",BI.AllValueChooserPane),BI.AllValueMultiTextValueCombo=BI.inherit(BI.Widget,{props:{baseCls:"bi-all-value-multi-text-value-combo",width:200,height:24,items:[]},render:function(){var self=this,o=this.options,value=this._digestValue(o.value);return{type:"bi.search_multi_text_value_combo",text:o.text,height:o.height,items:o.items,value:value,numOfPage:100,valueFormatter:o.valueFormatter,warningTitle:o.warningTitle,listeners:[{eventName:BI.SearchMultiTextValueCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.AllValueMultiTextValueCombo.EVENT_CONFIRM)}}],ref:function(){self.combo=this}}},setValue:function(v){var value=this._digestValue(v);this.combo.setValue(value)},getValue:function(){var obj=this.combo.getValue()||{};if(obj.value=obj.value||[],obj.type===BI.Selection.All){var values=[];return BI.each(this.options.items,function(idx,item){!BI.contains(obj.value,item.value)&&values.push(item.value)}),values}return obj.value||[]},populate:function(items){this.options.items=items,this.combo.populate.apply(this,arguments)},_digestValue:function(v){return{type:BI.Selection.Multi,value:v||[]}}}),BI.AllValueMultiTextValueCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.all_value_multi_text_value_combo",BI.AllValueMultiTextValueCombo),BI.AbstractTreeValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractTreeValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,open:!1})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_initData:function(items){this.items=items;var nodes=BI.Tree.treeFormat(items);this.tree=new BI.Tree,this.tree.initTree(nodes)},_itemsCreator:function(options,callback){function call(){switch(options.type){case BI.TreeView.REQ_TYPE_INIT_DATA:self._reqInitTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_ADJUST_DATA:self._reqAdjustTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_SELECT_DATA:self._reqSelectedTreeNode(options,callback);break;case BI.TreeView.REQ_TYPE_GET_SELECTED_DATA:self._reqDisplayTreeNode(options,callback);break;default:self._reqTreeNode(options,callback)}}var self=this,o=this.options;this.items?call():o.itemsCreator({},function(items){self._initData(items),call()})},_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){return null==selected||BI.isEmpty(selected)?void BI.each(node.getChildren(),function(i,child){var newParents=BI.clone(parentValues);newParents.push(child.value);var llen=self._getChildCount(newParents);createOneJson(child,node.id,llen),doCheck(newParents,child,{})}):void BI.each(selected,function(k){var node=self._getTreeNode(parentValues,k);if(BI.isNull(node))createOneJson({id:BI.UUID(),text:k,value:k},BI.UUID(),0);else{var newParents=BI.clone(parentValues);newParents.push(node.value),createOneJson(node,node.parent&&node.parent.id,getCount(selected[k],newParents)),doCheck(newParents,node,selected[k])}})}function getCount(jo,parentValues){return null==jo?0:BI.isEmpty(jo)?self._getChildCount(parentValues):BI.size(jo)}function createOneJson(node,pId,llen){result.push({id:node.id,pId:pId,text:node.text+(llen>0?"("+BI.i18nText("BI-Basic_Altogether")+llen+BI.i18nText("BI-Basic_Count")+")":""),value:node.value,open:!0})}var self=this,result=[],selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:result}))},_reqSelectedTreeNode:function(op,callback){function dealWithSelectedValues(selectedValues){var p=parentValues.concat(notSelectedValue);if(canFindKey(selectedValues,p))if(isSearchValueInParent(p))self._deleteNode(selectedValues,p);else{var searched=[],find=search(parentValues,notSelectedValue,[],searched);find&&BI.isNotEmptyArray(searched)&&BI.each(searched,function(i,arr){var node=self._getNode(selectedValues,arr);node?self._deleteNode(selectedValues,arr):expandSelectedValue(selectedValues,arr,BI.last(arr))})}if(isChild(selectedValues,p)){var result=[],find=!1;isSearchValueInParent(p)?find=!0:(find=search(parentValues,notSelectedValue,result),p=parentValues),find===!0&&(expandSelectedValue(selectedValues,p,notSelectedValue),result.length>0&&BI.each(result,function(i,strs){self._buildTree(selectedValues,strs)}))}}function expandSelectedValue(selectedValues,parents,notSelectedValue){var next=selectedValues,childrenCount=[],path=[];BI.some(parents,function(i,v){var t=next[v];if(null==t){if(0===i)return!0;if(!BI.isEmpty(next))return!0;var split=parents.slice(0,i),expanded=self._getChildren(split);if(path.push(split),childrenCount.push(expanded.length),i===parents.length-1&&1===expanded.length&&expanded[0].value===notSelectedValue)for(var j=childrenCount.length-1;j>=0&&1===childrenCount[j];j--)self._deleteNode(selectedValues,path[j]);else BI.each(expanded,function(m,child){return i===parents.length-1&&child.value===notSelectedValue||void(next[child.value]={})});next=next[v]}else next=t})}function search(parents,current,result,searched){var newParents=BI.clone(parents);if(newParents.push(current),self._isMatch(parents,current,keyword))return searched&&searched.push(newParents),!0;var children=self._getChildren(newParents),notSearch=[],can=!1;return BI.each(children,function(i,child){search(newParents,child.value,result,searched)?can=!0:notSearch.push(child.value)}),can===!0&&BI.each(notSearch,function(i,v){var next=BI.clone(newParents);next.push(v),result.push(next)}),can}function isSearchValueInParent(parentValues){for(var i=0,len=parentValues.length;iself._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,isAllSelect,result){if(self._isMatch(parentValues,current,keyword)){var checked=isAllSelect||isSelected(parentValues,current);return createOneJson(parentValues,current,!1,checked,!isAllSelect&&isHalf(parentValues,current),!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1,isCurAllSelected=isAllSelect||isAllSelected(parentValues,current);return BI.each(children,function(i,child){var state=nodeSearch(deep+1,newParents,child.value,isCurAllSelected,result);state[1]===!0&&(checked=!0),state[0]===!0&&(can=!0)}),can===!0&&(checked=isCurAllSelected||isSelected(parentValues,current)&&checked,createOneJson(parentValues,current,!0,checked,!1,!1,result)),[can,checked]}function createOneJson(parentValues,value,isOpen,checked,half,flag,result){var node=self._getTreeNode(parentValues,value);result.push({id:node.id,pId:node.pId,text:node.text,value:node.value,title:node.title,isParent:node.getChildrenLength()>0,open:isOpen,checked:checked,halfCheck:half,flag:flag})}function isHalf(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&!BI.isEmpty(ob))return!0})}function isAllSelected(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&BI.isEmpty(ob))return!0})}function isSelected(parentValues,value){var find=findSelectedObj(parentValues);return null!=find&&BI.any(find,function(v){if(v===value)return!0})}function findSelectedObj(parentValues){var find=selectedValues;return null==find?null:(BI.every(parentValues,function(i,v){return find=find[v],null!=find}),find)}var self=this,result=[],keyword=op.keyword||"",selectedValues=op.selectedValues,lastSearchValue=op.lastSearchValue||"",output=search();BI.nextTick(function(){callback({hasNext:output.length>self._const.perPage,items:result,lastSearchValue:BI.last(output)})})},_reqTreeNode:function(op,callback){function judgeState(parentValues,selected_value,checkState){var checked=checkState.checked,half=checkState.half;return!(parentValues.length>0&&!checked)&&(0===parentValues.length||checked&&half&&!BI.isEmpty(selected_value))}function dealWithSelectedValue(parentValues,selectedValues){var valueMap={};return BI.each(parentValues,function(i,v){selectedValues=selectedValues[v]||{}}),BI.each(selectedValues,function(value,obj){if(BI.isNull(obj))return void(valueMap[value]=[0,0]);if(BI.isEmpty(obj))return void(valueMap[value]=[2,0]);var nextNames={};BI.each(obj,function(t,o){(BI.isNull(o)||BI.isEmpty(o))&&(nextNames[t]=!0)}),valueMap[value]=[1,BI.size(nextNames)]}),valueMap}function getCheckState(current,parentValues,valueMap,checkState){var checked=checkState.checked,half=checkState.half,tempCheck=!1,halfCheck=!1;if(BI.has(valueMap,current))if(1===valueMap[current][0]){var values=BI.clone(parentValues);values.push(current);var childCount=self._getChildCount(values);childCount>0&&childCount!==valueMap[current][1]&&(halfCheck=!0)}else 2===valueMap[current][0]&&(tempCheck=!0);var check;return check=checked||halfCheck||tempCheck?(tempCheck||checked)&&!half||BI.has(valueMap,current):BI.has(valueMap,current),[check,halfCheck]}var self=this,o=this.options,result=[],times=op.times,checkState=op.checkState||{},parentValues=op.parentValues||[],selectedValues=op.selectedValues||{},valueMap={};valueMap=dealWithSelectedValue(parentValues,selectedValues);for(var nodes=this._getChildren(parentValues),i=(times-1)*this._const.perPage;nodes[i]&&i0,checked:state[0],halfCheck:state[1],open:o.open})}if(o.open){var allNodes=[];BI.each(nodes,function(idx,node){allNodes=BI.concat(allNodes,self._getAllChildren(parentValues.concat([node.value])))}),BI.each(allNodes,function(idx,node){var valueMap=dealWithSelectedValue(node.parentValues,selectedValues),state=getCheckState(node.value,node.parentValues,valueMap,checkState);result.push({id:node.id,pId:node.pId,value:node.value,text:node.text,times:1,isParent:node.getChildrenLength()>0,checked:state[0],halfCheck:state[1],open:self.options.open})})}0===parentValues.length&&1===times&&(result=BI.concat(self._getAddedValueNode(parentValues,selectedValues),result)),BI.nextTick(function(){callback({items:result,hasNext:nodes.length>times*self._const.perPage})})},_getAddedValueNode:function(parentValues,selectedValues){var nodes=this._getChildren(parentValues);return BI.map(BI.difference(BI.keys(selectedValues),BI.map(nodes,"value")),function(idx,v){return{id:BI.UUID(),pId:nodes.length>0?nodes[0].pId:BI.UUID(),value:v,text:v,times:1,isParent:!1,checked:!0,halfCheck:!1}})},_getNode:function(selectedValues,parentValues){for(var pNode=selectedValues,i=0,len=parentValues.length;i0&&BI.isEmpty(pNode);)name=p[p.length-1],p=p.slice(0,p.length-1),pNode=this._getNode(selectedValues,p),null!=pNode&&delete pNode[name]},_buildTree:function(jo,values){var t=jo;BI.each(values,function(i,v){BI.has(t,v)||(t[v]={}),t=t[v]})},_isMatch:function(parentValues,value,keyword){var o=this.options,node=this._getTreeNode(parentValues,value);if(!node)return!1;var find=BI.Func.getSearchResult([node.text||node.value],keyword);if(o.allowSearchValue&&node.value){var valueFind=BI.Func.getSearchResult([node.value],keyword);return valueFind.find.length>0||valueFind.match.length>0||find.find.length>0||find.match.length>0}return find.find.length>0||find.match.length>0},_getTreeNode:function(parentValues,v){var self=this,findParentNode,index=0;return this.tree.traverse(function(node){if(!self.tree.isRoot(node))return!(index>parentValues.length)&&(index===parentValues.length&&node.value===v?(findParentNode=node,!1):node.value!==parentValues[index]||void index++)}),findParentNode},_getChildren:function(parentValues){if(parentValues.length>0)var value=BI.last(parentValues),parent=this._getTreeNode(parentValues.slice(0,parentValues.length-1),value);else var parent=this.tree.getRoot();return parent.getChildren()},_getAllChildren:function(parentValues){var children=this._getChildren(parentValues),nodes=[].concat(children);BI.each(nodes,function(idx,node){node.parentValues=parentValues});for(var queue=BI.map(children,function(idx,node){return{parentValues:parentValues,value:node.value}});BI.isNotEmptyArray(queue);){var node=queue.shift(),pValues=node.parentValues.concat(node.value),childNodes=this._getChildren(pValues);BI.each(childNodes,function(idx,node){node.parentValues=pValues}),queue=queue.concat(childNodes),nodes=nodes.concat(childNodes)}return nodes},_getChildCount:function(parentValues){return this._getChildren(parentValues).length}}),BI.AbstractListTreeValueChooser=BI.inherit(BI.AbstractTreeValueChooser,{_reqDisplayTreeNode:function(op,callback){function doCheck(parentValues,node,selected){BI.each(selected,function(idx,path){BI.each(path,function(id,value){var nodeValue=value,node=self._getTreeNode(path.slice(0,id),nodeValue);BI.isNull(node)?createOneJson({id:BI.UUID(),text:nodeValue,value:nodeValue,isLeaf:!0},BI.UUID()):(BI.has(result,node.id)||createOneJson(node,node.parent&&node.parent.id),result[node.id].isLeaf!==!0&&(result[node.id].isLeaf=id===path.length-1))})})}function createOneJson(node,pId){ +result[node.id]={id:node.id,pId:pId,text:node.text,value:node.value,open:!0,isLeaf:node.isLeaf}}var self=this,result={},selectedValues=op.selectedValues;return null==selectedValues||BI.isEmpty(selectedValues)?void callback({}):(doCheck([],this.tree.getRoot(),selectedValues),void callback({items:BI.values(result)}))},_reqInitTreeNode:function(op,callback){function search(){var children=self._getChildren([]),start=children.length;if(""!==lastSearchValue){for(var j=0,len=start;jself._const.perPage)break}if(1===op.times){var nodes=self._getAddedValueNode([],selectedValues);result=BI.concat(BI.filter(nodes,function(idx,node){var find=BI.Func.getSearchResult([node.text||node.value],keyword);return find.find.length>0||find.match.length>0}),result)}return output}function nodeSearch(deep,parentValues,current,result){if(self._isMatch(parentValues,current,keyword)){var checked=isSelected(current);return createOneJson(parentValues,current,!1,checked,!0,result),[!0,checked]}var newParents=BI.clone(parentValues);newParents.push(current);var children=self._getChildren(newParents),can=!1,checked=!1;return BI.each(children,function(i,child){var state=nodeSearch(deep+1,newParents,child.value,result);state[1]===!0&&(checked=!0),state[0]===!0&&(can=!0)}),can===!0&&(checked=isSelected(current),createOneJson(parentValues,current,!0,checked,!1,result)),[can,checked]}function createOneJson(parentValues,value,isOpen,checked,flag,result){var node=self._getTreeNode(parentValues,value);result.push({id:node.id,pId:node.pId,text:node.text,value:node.value,title:node.title,isParent:node.getChildrenLength()>0,open:isOpen,checked:checked,halfCheck:!1,flag:flag})}function isHalf(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&!BI.isEmpty(ob))return!0})}function isAllSelected(parentValues,value){var find=findSelectedObj(parentValues);return null==find?null:BI.any(find,function(v,ob){if(v===value&&null!=ob&&BI.isEmpty(ob))return!0})}function isSelected(value){return BI.any(selectedValues,function(idx,array){return BI.last(array)===value})}function findSelectedObj(parentValues){var find=selectedValues;return null==find?null:(BI.every(parentValues,function(i,v){return find=find[v],null!=find}),find)}var self=this,result=[],keyword=op.keyword||"",selectedValues=op.selectedValues,lastSearchValue=op.lastSearchValue||"",output=search();BI.nextTick(function(){callback({hasNext:output.length>self._const.perPage,items:result,lastSearchValue:BI.last(output)})})},_reqTreeNode:function(op,callback){function dealWithSelectedValue(selectedValues){var valueMap={};return BI.each(selectedValues,function(idx,v){valueMap[BI.last(v)]=[2,0]}),valueMap}for(var self=this,o=this.options,result=[],times=op.times,parentValues=op.parentValues||[],selectedValues=op.selectedValues||[],valueMap=dealWithSelectedValue(selectedValues),nodes=this._getChildren(parentValues),i=(times-1)*this._const.perPage;nodes[i]&&i0,checked:checked,halfCheck:!1,open:o.open})}if(o.open){var allNodes=[];BI.each(nodes,function(idx,node){allNodes=BI.concat(allNodes,self._getAllChildren(parentValues.concat([node.value])))}),BI.each(allNodes,function(idx,node){var checked=BI.has(valueMap,node.value);result.push({id:node.id,pId:node.pId,value:node.value,text:node.text,times:1,isParent:node.getChildrenLength()>0,checked:checked,halfCheck:!1,open:o.open})})}0===parentValues.length&&1===times&&(result=BI.concat(self._getAddedValueNode(parentValues,selectedValues),result)),BI.nextTick(function(){callback({items:result,hasNext:nodes.length>times*self._const.perPage})})},_getAddedValueNode:function(parentValues,selectedValues){var nodes=this._getChildren(parentValues),values=BI.flatten(BI.filter(selectedValues,function(idx,array){return 1===array.length}));return BI.map(BI.difference(values,BI.map(nodes,"value")),function(idx,v){return{id:BI.UUID(),pId:nodes.length>0?nodes[0].pId:BI.UUID(),value:v,text:v,times:1,isParent:!1,checked:!0,halfCheck:!1}})}}),BI.ListTreeValueChooserInsertCombo=BI.inherit(BI.AbstractListTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.ListTreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-list-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.ListTreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_list_combo",element:this,text:o.text,value:o.value,watermark:o.watermark,allowInsertValue:o.allowInsertValue,allowEdit:o.allowEdit,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeListCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeListCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeListCombo.EVENT_STOP,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeListCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeListCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeListCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.ListTreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.ListTreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.ListTreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.ListTreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.ListTreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.ListTreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.list_tree_value_chooser_insert_combo",BI.ListTreeValueChooserInsertCombo),BI.TreeValueChooserInsertCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserInsertCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-insert-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserInsertCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_insert_combo",text:o.text,value:o.value,watermark:o.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeInsertCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeInsertCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeInsertCombo.EVENT_STOP,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_STOP)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeInsertCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeInsertCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TreeValueChooserInsertCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserInsertCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserInsertCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserInsertCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserInsertCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserInsertCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.TreeValueChooserInsertCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.shortcut("bi.tree_value_chooser_insert_combo",BI.TreeValueChooserInsertCombo),BI.TreeValueChooserCombo=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserCombo.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-combo",width:200,height:24,items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserCombo.superclass._init.apply(this,arguments);var self=this,o=this.options;BI.isNotNull(o.items)&&this._initData(o.items),this.combo=BI.createWidget({type:"bi.multi_tree_combo",text:o.text,value:o.value,watermark:o.watermark,element:this,itemsCreator:BI.bind(this._itemsCreator,this),valueFormatter:BI.bind(this._valueFormatter,this),width:o.width,height:o.height,listeners:[{eventName:BI.MultiTreeCombo.EVENT_FOCUS,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_FOCUS)}},{eventName:BI.MultiTreeCombo.EVENT_BLUR,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_BLUR)}},{eventName:BI.MultiTreeCombo.EVENT_STOP,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_STOP)}},{eventName:BI.MultiTreeCombo.EVENT_CLICK_ITEM,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_CLICK_ITEM)}},{eventName:BI.MultiTreeCombo.EVENT_SEARCHING,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_SEARCHING)}},{eventName:BI.MultiTreeCombo.EVENT_CONFIRM,action:function(){self.fireEvent(BI.TreeValueChooserCombo.EVENT_CONFIRM)}}]})},setValue:function(v){this.combo.setValue(v)},getValue:function(){return this.combo.getValue()},populate:function(items){this._initData(items),this.combo.populate.apply(this.combo,arguments)}}),BI.TreeValueChooserCombo.EVENT_CONFIRM="EVENT_CONFIRM",BI.TreeValueChooserCombo.EVENT_FOCUS="EVENT_FOCUS",BI.TreeValueChooserCombo.EVENT_BLUR="EVENT_BLUR",BI.TreeValueChooserCombo.EVENT_STOP="EVENT_STOP",BI.TreeValueChooserCombo.EVENT_CLICK_ITEM="EVENT_CLICK_ITEM",BI.TreeValueChooserCombo.EVENT_SEARCHING="EVENT_SEARCHING",BI.shortcut("bi.tree_value_chooser_combo",BI.TreeValueChooserCombo),BI.TreeValueChooserPane=BI.inherit(BI.AbstractTreeValueChooser,{_defaultConfig:function(){return BI.extend(BI.TreeValueChooserPane.superclass._defaultConfig.apply(this,arguments),{baseCls:"bi-tree-value-chooser-pane",items:null,itemsCreator:BI.emptyFn})},_init:function(){BI.TreeValueChooserPane.superclass._init.apply(this,arguments);var self=this,o=this.options;this.pane=BI.createWidget({type:"bi.multi_select_tree",element:this,itemsCreator:BI.bind(this._itemsCreator,this)}),this.pane.on(BI.MultiSelectTree.EVENT_CHANGE,function(){self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE)}),BI.isNotNull(o.items)&&(this._initData(o.items),this.populate())},setSelectedValue:function(v){this.pane.setSelectedValue(v)},setValue:function(v){this.pane.setValue(v)},getValue:function(){return this.pane.getValue()},populate:function(){this.pane.populate.apply(this.pane,arguments)}}),BI.TreeValueChooserPane.EVENT_CHANGE="EVENT_CHANGE",BI.shortcut("bi.tree_value_chooser_pane",BI.TreeValueChooserPane),BI.AbstractValueChooser=BI.inherit(BI.Widget,{_const:{perPage:100},_defaultConfig:function(){return BI.extend(BI.AbstractValueChooser.superclass._defaultConfig.apply(this,arguments),{items:null,itemsCreator:BI.emptyFn,cache:!0})},_valueFormatter:function(v){var text=v;return BI.isNotNull(this.items)&&BI.some(this.items,function(i,item){if(item.value===v||item.value+""===v)return text=item.text,!0}),text},_getItemsByTimes:function(items,times){for(var res=[],i=(times-1)*this._const.perPage;items[i]&&i"+i+""};t.exports=function(n,t){var r={};r[n]=t(f),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),n===undefined?r:o(r,n)}},function(t,n,r){var e=r(90),i=r(63).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,i)}},function(t,n,r){var e=r(13),i=r(10),o=r(62)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,r){var e=r(5)("unscopables"),i=Array.prototype;i[e]==undefined&&r(14)(i,e,{}),t.exports=function(t){i[e][t]=!0}},function(t,n,r){var e=r(4);t.exports=function(t,n){if(!e(t)||t._t!==n)throw TypeError("Incompatible receiver, "+n+" required!");return t}},function(t,n,r){var e=r(9).f,i=r(13),o=r(5)("toStringTag");t.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},function(t,n,r){var u=r(0),e=r(24),c=r(2),f=r(66),i="["+f+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function s(t,n,r){var e={},i=c(function(){return!!f[t]()||"​…"!="​…"[t]()}),o=e[t]=i?n(l):f[t];r&&(e[r]=o),u(u.P+u.F*i,"String",e)},l=s.trim=function(t,n){return t=String(e(t)),1&n&&(t=t.replace(o,"")),2&n&&(t=t.replace(a,"")),t};t.exports=s},function(t,n){t.exports={}},function(t,n,r){"use strict";var e=r(1),i=r(9),o=r(8),u=r(5)("species");t.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||e!==undefined&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var i=r(11);t.exports=function(t,n,r){for(var e in n)i(t,e,n[e],r);return t}},function(t,n,r){var e=r(23);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var i=r(23),o=r(5)("toStringTag"),u="Arguments"==i(function(){return arguments}()),c=function c(t,n){try{return t[n]}catch(r){}};t.exports=function(t){var n,r,e;return t===undefined?"Undefined":null===t?"Null":"string"==typeof(r=c(n=Object(t),o))?r:u?i(n):"Object"==(e=i(n))&&"function"==typeof n.callee?"Arguments":e}},function(t,n,r){var i=r(3),o=r(18),u=r(5)("species");t.exports=function(t,n){var r,e=i(t).constructor;return e===undefined||(r=i(e)[u])==undefined?n:o(r)}},function(t,n,r){var e=r(7),i=r(1),o="__core-js_shared__",u=i[o]||(i[o]={});(t.exports=function(t,n){return u[t]||(u[t]=n!==undefined?n:{})})("versions",[]).push({version:e.version,mode:r(30)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n,r){var f=r(15),a=r(6),s=r(32);t.exports=function(c){return function(t,n,r){var e,i=f(t),o=a(i.length),u=s(r,o);if(c&&n!=n){for(;u")}),b=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();t.exports=function(r,t,n){var e=d(r),o=!h(function(){var t={};return t[e]=function(){return 7},7!=""[r](t)}),i=o?!h(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===r&&(n.constructor={},n.constructor[y]=function(){return n}),n[e](""),!t}):undefined;if(!o||!i||"replace"===r&&!g||"split"===r&&!b){var u=/./[e],c=n(p,e,""[r],function(t,n,r,e,i){return n.exec===v?o&&!i?{done:!0,value:u.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),f=c[0],a=c[1];s(String.prototype,r,f),l(RegExp.prototype,e,2==t?function(t,n){return a.call(t,this,n)}:function(t){return a.call(t,this)})}}},function(t,n,r){var h=r(17),p=r(103),d=r(76),v=r(3),y=r(6),g=r(78),b={},m={};(n=t.exports=function(t,n,r,e,i){var o,u,c,f,a=i?function(){return t}:g(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof a)throw TypeError(t+" is not iterable!");if(d(a)){for(o=y(t.length);l>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718=t.length?(this._t=undefined,i(1)):i(0,"keys"==n?r:"values"==n?t[r]:[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},function(t,n,r){"use strict";var e,i,u=r(53),c=RegExp.prototype.exec,f=String.prototype.replace,o=c,a="lastIndex",s=(e=/a/,i=/b*/g,c.call(e,"a"),c.call(i,"a"),0!==e[a]||0!==i[a]),l=/()??/.exec("")[1]!==undefined;(s||l)&&(o=function(t){var n,r,e,i,o=this;return l&&(r=new RegExp("^"+o.source+"$(?!\\s)",u.call(o))),s&&(n=o[a]),e=c.call(o,t),s&&e&&(o[a]=o.global?e.index+e[0].length:n),l&&e&&1>1,s=23===n?j(2,-24)-j(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=M(t))!=t||t===P?(i=t!=t?1:0,e=f):(e=A(I(t)/T),t*(o=j(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*j(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*j(2,n),e+=a):(i=t*j(2,a-1)*j(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0>=-c,c+=n;0>8&255]}function V(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function Y(t){return D(t,52,8)}function z(t){return D(t,23,4)}function q(t,n,r){v(t[w],n,{get:function(){return this[r]}})}function K(t,n,r,e){var i=p(+r);if(i+n>t[k])throw O(S);var o=t[R]._b,u=i+t[C],c=o.slice(u,u+n);return e?c:c.reverse()}function $(t,n,r,e,i,o){var u=p(+r);if(u+n>t[k])throw O(S);for(var c=t[R]._b,f=u+t[C],a=e(+i),s=0;sZ;)(J=H[Z++])in x||c(x,J,F[J]);o||(X.constructor=x)}var Q=new _(new x(2)),tt=_[w].setInt8;Q.setInt8(0,2147483648),Q.setInt8(1,2147483649),!Q.getInt8(0)&&Q.getInt8(1)||f(_[w],{setInt8:function(t,n){tt.call(this,t,n<<24>>24)},setUint8:function(t,n){tt.call(this,t,n<<24>>24)}},!0)}else x=function(t){s(this,x,b);var n=p(t);this._b=y.call(new Array(n),0),this[k]=n},_=function(t,n,r){s(this,_,m),s(t,x,m);var e=t[k],i=l(n);if(i<0||e>24},getUint8:function(t){return K(this,1,t)[0]},getInt16:function(t){var n=K(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function(t){var n=K(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function(t){return G(K(this,4,t,arguments[1]))},getUint32:function(t){return G(K(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return U(K(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return U(K(this,8,t,arguments[1]),52,8)},setInt8:function(t,n){$(this,1,t,W,n)},setUint8:function(t,n){$(this,1,t,W,n)},setInt16:function(t,n){$(this,2,t,B,n,arguments[2])},setUint16:function(t,n){$(this,2,t,B,n,arguments[2])},setInt32:function(t,n){$(this,4,t,V,n,arguments[2])},setUint32:function(t,n){$(this,4,t,V,n,arguments[2])},setFloat32:function(t,n){$(this,4,t,z,n,arguments[2])},setFloat64:function(t,n){$(this,8,t,Y,n,arguments[2])}});g(x,b),g(_,m),c(_[w],u.VIEW,!0),n[b]=x,n[m]=_},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n){function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}t.exports=function(t){return"object"===r(t)?null!==t:"function"==typeof t}},function(t,n,r){t.exports=!r(120)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){t.exports=!r(8)&&!r(2)(function(){return 7!=Object.defineProperty(r(60)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(1),i=r(7),o=r(30),u=r(61),c=r(9).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,r){var u=r(13),c=r(15),f=r(49)(!1),a=r(62)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;n.length>i;)u(e,r=n[i++])&&(~f(o,r)||o.push(r));return o}},function(t,n,r){var u=r(9),c=r(3),f=r(31);t.exports=r(8)?Object.defineProperties:function(t,n){c(t);for(var r,e=f(n),i=e.length,o=0;o>>0||(u.test(r)?16:10))}:e},function(t,n,r){var e=r(1).parseFloat,i=r(39).trim;t.exports=1/e(r(66)+"-0")!=-Infinity?function(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},function(t,n,r){var e=r(23);t.exports=function(t,n){if("number"!=typeof t&&"Number"!=e(t))throw TypeError(n);return+t}},function(t,n,r){var e=r(4),i=Math.floor;t.exports=function(t){return!e(t)&&isFinite(t)&&i(t)===t}},function(t,n){t.exports=Math.log1p||function(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n,r){"use strict";var e=r(33),i=r(28),o=r(38),u={};r(14)(u,r(5)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},function(t,n,r){var u=r(3);t.exports=function(t,n,r,e){try{return e?n(u(r)[0],r[1]):n(r)}catch(o){var i=t["return"];throw i!==undefined&&u(i.call(t)),o}}},function(t,n,r){var e=r(216);t.exports=function(t,n){return new(e(t))(n)}},function(t,n,r){var s=r(18),l=r(10),h=r(44),p=r(6);t.exports=function(t,n,r,e,i){s(n);var o=l(t),u=h(o),c=p(o.length),f=i?c-1:0,a=i?-1:1;if(r<2)for(;;){if(f in u){e=u[f],f+=a;break}if(f+=a,i?f<0:c<=f)throw TypeError("Reduce of empty array with no initial value")}for(;i?0<=f:ft;)l(r[t++]);h._c=[],h._n=!1,n&&!h._h&&R(h)})}},R=function R(o){g.call(f,function(){var t,n,r,e=o._v,i=k(o);if(i&&(t=w(function(){j?O.emit("unhandledRejection",e,o):(n=f.onunhandledrejection)?n({promise:o,reason:e}):(r=f.console)&&r.error&&r.error("Unhandled promise rejection",e)}),o._h=j||k(o)?2:1),o._a=undefined,i&&t.e)throw t.v})},k=function k(t){return 1!==t._h&&0===(t._a||t._c).length},C=function C(n){g.call(f,function(){var t;j?O.emit("rejectionHandled",n):(t=f.onrejectionhandled)&&t({promise:n,reason:n._v})})},D=function D(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),L(n,!0))},U=function U(r){var e,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===r)throw E("Promise can't be resolved itself");(e=N(r))?b(function(){var t={_w:i,_d:!1};try{e.call(r,a(U,t,1),a(D,t,1))}catch(n){D.call(t,n)}}):(i._v=r,i._s=1,L(i,!1))}catch(t){D.call({_w:i,_d:!1},t)}}};T||(M=function(t){d(this,M,_,"_h"),p(t),r.call(this);try{t(a(U,this,1),a(D,this,1))}catch(n){D.call(this,n)}},(r=function(t){this._c=[],this._a=undefined,this._s=0,this._d=!1,this._v=undefined,this._h=0,this._n=!1}).prototype=e(43)(M.prototype,{then:function(t,n){var r=I(y(this,M));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=j?O.domain:undefined,this._c.push(r),this._a&&this._a.push(r),this._s&&L(this,!1),r.promise},"catch":function(t){return this.then(undefined,t)}}),o=function o(){var t=new r;this.promise=t,this.resolve=a(U,t,1),this.reject=a(D,t,1)},m.f=I=function I(t){return t===M||t===u?new o(t):i(t)}),l(l.G+l.W+l.F*!T,{Promise:M}),e(38)(M,_),e(41)(_),u=e(7)[_],l(l.S+l.F*!T,_,{reject:function(t){var n=I(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(c||!T),_,{resolve:function(t){return x(c&&this===u?M:this,t)}}),l(l.S+l.F*!(T&&e(52)(function(t){M.all(t)["catch"](A)})),_,{all:function(t){var u=this,n=I(u),c=n.resolve,f=n.reject,r=w(function(){var e=[],i=0,o=1;v(t,!1,function(t){var n=i++,r=!1;e.push(undefined),o++,u.resolve(t).then(function(t){r||(r=!0,e[n]=t,--o||c(e))},f)}),--o||c(e)});return r.e&&f(r.v),n.promise},race:function(t){var n=this,r=I(n),e=r.reject,i=w(function(){v(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i.e&&e(i.v),r.promise}})},function(t,n,r){"use strict";var i=r(18);function e(t){var r,e;this.promise=new t(function(t,n){if(r!==undefined||e!==undefined)throw TypeError("Bad Promise constructor");r=t,e=n}),this.resolve=i(r),this.reject=i(e)}t.exports.f=function(t){return new e(t)}},function(t,n,r){var e=r(3),i=r(4),o=r(111);t.exports=function(t,n){if(e(t),i(n)&&n.constructor===t)return n;var r=o.f(t);return(0,r.resolve)(n),r.promise}},function(t,n,r){"use strict";var u=r(9).f,c=r(33),f=r(43),a=r(17),s=r(42),l=r(56),e=r(72),i=r(107),o=r(41),h=r(8),p=r(27).fastKey,d=r(37),v=h?"_s":"size",y=function y(t,n){var r,e=p(n);if("F"!==e)return t._i[e];for(r=t._f;r;r=r.n)if(r.k==n)return r};t.exports={getConstructor:function(t,o,r,e){var i=t(function(t,n){s(t,i,o,"_i"),t._t=o,t._i=c(null),t._f=undefined,t._l=undefined,t[v]=0,n!=undefined&&l(n,r,t[e],t)});return f(i.prototype,{clear:function(){for(var t=d(this,o),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=undefined),delete n[r.i];t._f=t._l=undefined,t[v]=0},"delete":function(t){var n=d(this,o),r=y(n,t);if(r){var e=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=e),e&&(e.p=i),n._f==r&&(n._f=e),n._l==r&&(n._l=i),n[v]--}return!!r},forEach:function(t){d(this,o);for(var n,r=a(t,1f&&(a=a.slice(0,f)),e?a+i:i+a}},function(t,n,r){var f=r(8),a=r(31),s=r(15),l=r(45).f;t.exports=function(c){return function(t){for(var n,r=s(t),e=a(r),i=e.length,o=0,u=[];oi;)s(K,n=r[i++])||n==V||n==d||e.push(n);return e}function f(t){for(var n,r=t===J,e=D(r?$:F(t)),i=[],o=0;e.length>o;)!s(K,n=e[o++])||r&&!s(J,n)||i.push(K[n]);return i}var a=r(1),s=r(13),l=r(8),h=r(0),p=r(11),d=r(27).KEY,v=r(2),y=r(48),g=r(38),b=r(29),m=r(5),w=r(61),S=r(89),x=r(127),_=r(51),E=r(3),O=r(4),P=r(10),F=r(15),M=r(26),j=r(28),A=r(33),I=r(92),T=r(20),N=r(50),L=r(9),R=r(31),k=T.f,C=L.f,D=I.f,U=a.Symbol,G=a.JSON,W=G&&G.stringify,B="prototype",V=m("_hidden"),Y=m("toPrimitive"),z={}.propertyIsEnumerable,q=y("symbol-registry"),K=y("symbols"),$=y("op-symbols"),J=Object[B],X="function"==typeof U&&!!N.f,H=a.QObject,Z=!H||!H[B]||!H[B].findChild,Q=l&&v(function(){return 7!=A(C({},"a",{get:function(){return C(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=k(J,n);e&&delete J[n],C(t,n,r),e&&t!==J&&C(J,n,e)}:C,tt=function tt(t){var n=K[t]=A(U[B]);return n._k=t,n},nt=X&&"symbol"==e(U.iterator)?function(t){return"symbol"==e(t)}:function(t){return t instanceof U},rt=function(t,n,r){return t===J&&rt($,n,r),E(t),n=M(n,!0),E(r),s(K,n)?(r.enumerable?(s(t,V)&&t[V][n]&&(t[V][n]=!1),r=A(r,{enumerable:j(0,!1)})):(s(t,V)||C(t,V,j(1,{})),t[V][n]=!0),Q(t,n,r)):C(t,n,r)};X||(p((U=function(){if(this instanceof U)throw TypeError("Symbol is not a constructor!");var n=b(0it;)m(et[it++]);for(var ot=R(m.store),ut=0;ot.length>ut;)S(ot[ut++]);h(h.S+h.F*!X,"Symbol",{"for":function(t){return s(q,t+="")?q[t]:q[t]=U(t)},keyFor:function(t){if(!nt(t))throw TypeError(t+" is not a symbol!");for(var n in q)if(q[n]===t)return n},useSetter:function(){Z=!0},useSimple:function(){Z=!1}}),h(h.S+h.F*!X,"Object",{create:function(t,n){return n===undefined?A(t):i(A(t),n)},defineProperty:rt,defineProperties:i,getOwnPropertyDescriptor:u,getOwnPropertyNames:c,getOwnPropertySymbols:f});var ct=v(function(){N.f(1)});h(h.S+h.F*ct,"Object",{getOwnPropertySymbols:function(t){return N.f(P(t))}}),G&&h(h.S+h.F*(!X||v(function(){var t=U();return"[null]"!=W([t])||"{}"!=W({a:t})||"{}"!=W(Object(t))})),"JSON",{stringify:function(t){for(var r,e,n=[t],i=1;iu;)o.call(t,e=i[u++])&&n.push(e);return n}},function(t,n,r){var e=r(0);e(e.S,"Object",{create:r(33)})},function(t,n,r){var e=r(0);e(e.S+e.F*!r(8),"Object",{defineProperty:r(9).f})},function(t,n,r){var e=r(0);e(e.S+e.F*!r(8),"Object",{defineProperties:r(91)})},function(t,n,r){var e=r(15),i=r(20).f;r(21)("getOwnPropertyDescriptor",function(){return function(t,n){return i(e(t),n)}})},function(t,n,r){var e=r(10),i=r(35);r(21)("getPrototypeOf",function(){return function(t){return i(e(t))}})},function(t,n,r){var e=r(10),i=r(31);r(21)("keys",function(){return function(t){return i(e(t))}})},function(t,n,r){r(21)("getOwnPropertyNames",function(){return r(92).f})},function(t,n,r){var e=r(4),i=r(27).onFreeze;r(21)("freeze",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(4),i=r(27).onFreeze;r(21)("seal",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(4),i=r(27).onFreeze;r(21)("preventExtensions",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(4);r(21)("isFrozen",function(n){return function(t){return!e(t)||!!n&&n(t)}})},function(t,n,r){var e=r(4);r(21)("isSealed",function(n){return function(t){return!e(t)||!!n&&n(t)}})},function(t,n,r){var e=r(4);r(21)("isExtensible",function(n){return function(t){return!!e(t)&&(!n||n(t))}})},function(t,n,r){var e=r(0);e(e.S+e.F,"Object",{assign:r(93)})},function(t,n,r){var e=r(0);e(e.S,"Object",{is:r(94)})},function(t,n,r){var e=r(0);e(e.S,"Object",{setPrototypeOf:r(65).set})},function(t,n,r){"use strict";var e=r(46),i={};i[r(5)("toStringTag")]="z",i+""!="[object z]"&&r(11)(Object.prototype,"toString",function(){return"[object "+e(this)+"]"},!0)},function(t,n,r){var e=r(0);e(e.P,"Function",{bind:r(95)})},function(t,n,r){var e=r(9).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||r(8)&&e(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,n,r){"use strict";var e=r(4),i=r(35),o=r(5)("hasInstance"),u=Function.prototype;o in u||r(9).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},function(t,n,r){var e=r(0),i=r(97);e(e.G+e.F*(parseInt!=i),{parseInt:i})},function(t,n,r){var e=r(0),i=r(98);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},function(t,n,r){"use strict";var e=r(1),i=r(13),o=r(23),u=r(67),s=r(26),c=r(2),f=r(34).f,a=r(20).f,l=r(9).f,h=r(39).trim,p="Number",d=e[p],v=d,y=d.prototype,g=o(r(33)(y))==p,b="trim"in String.prototype,m=function m(t){var n=s(t,!1);if("string"==typeof n&&2x;x++)i(v,w=S[x])&&!i(d,w)&&l(d,w,a(v,w));(d.prototype=y).constructor=d,r(11)(e,p,d)}},function(t,n,r){"use strict";var e=r(0),a=r(19),s=r(99),l=r(68),i=1..toFixed,o=Math.floor,u=[0,0,0,0,0,0],h="Number.toFixed: incorrect invocation!",p=function p(t,n){for(var r=-1,e=n;++r<6;)e+=t*u[r],u[r]=e%1e7,e=o(e/1e7)},d=function d(t){for(var n=6,r=0;0<=--n;)r+=u[n],u[n]=o(r/t),r=r%t*1e7},v=function v(){for(var t=6,n="";0<=--t;)if(""!==n||0===t||0!==u[t]){var r=String(u[t]);n=""===n?r:n+l.call("0",7-r.length)+r}return n},y=function y(t,n,r){return 0===n?r:n%2==1?y(t,n-1,r*t):y(t*t,n/2,r)},g=function g(t){for(var n=0,r=t;4096<=r;)n+=12,r/=4096;for(;2<=r;)n+=1,r/=2;return n};e(e.P+e.F*(!!i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r(2)(function(){i.call({})})),"Number",{toFixed:function(t){var n,r,e,i,o=s(this,h),u=a(t),c="",f="0";if(u<0||20>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(0),i=Math.exp;e(e.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(0),i=r(70);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(0);e(e.S,"Math",{fround:r(170)})},function(t,n,r){var o=r(69),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126),s=function s(t){return t+1/u-1/u};t.exports=Math.fround||function(t){var n,r,e=Math.abs(t),i=o(t);return e>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(0);e(e.S,"Math",{log1p:r(101)})},function(t,n,r){var e=r(0);e(e.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(0);e(e.S,"Math",{sign:r(69)})},function(t,n,r){var e=r(0),i=r(70),o=Math.exp;e(e.S+e.F*r(2)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(0),i=r(70),o=Math.exp;e(e.S,"Math",{tanh:function(t){var n=i(t=+t),r=i(-t);return n==Infinity?1:r==Infinity?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(0);e(e.S,"Math",{trunc:function(t){return(0>10),n%1024+56320))}return r.join("")}})},function(t,n,r){var e=r(0),u=r(15),c=r(6);e(e.S,"String",{raw:function(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o=n.length?{value:undefined,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},function(t,n,r){"use strict";var e=r(0),i=r(71)(!1);e(e.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,n,r){"use strict";var e=r(0),u=r(6),c=r(73),f="endsWith",a=""[f];e(e.P+e.F*r(75)(f),"String",{endsWith:function(t){var n=c(this,t,f),r=1g;)v(y[g++]);(l.constructor=a).prototype=l,r(11)(e,"RegExp",a)}r(41)("RegExp")},function(t,n,r){"use strict";r(109);var e=r(3),i=r(53),o=r(8),u="toString",c=/./[u],f=function f(t){r(11)(RegExp.prototype,u,t,!0)};r(2)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?f(function(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):undefined)}):c.name!=u&&f(function(){return c.call(this)})},function(t,n,r){"use strict";var l=r(3),h=r(6),p=r(82),d=r(54);r(55)("match",1,function(e,i,a,s){return[function(t){var n=e(this),r=t==undefined?undefined:t[i];return r!==undefined?r.call(t,n):new RegExp(t)[i](String(n))},function(t){var n=s(a,t,this);if(n.done)return n.value;var r=l(t),e=String(this);if(!r.global)return d(r,e);for(var i,o=r.unicode,u=[],c=r.lastIndex=0;null!==(i=d(r,e));){var f=String(i[0]);""===(u[c]=f)&&(r.lastIndex=p(e,h(r.lastIndex),o)),c++}return 0===c?null:u}]})},function(t,n,r){"use strict";var _=r(3),e=r(10),E=r(6),O=r(19),P=r(82),F=r(54),M=Math.max,j=Math.min,h=Math.floor,p=/\$([$&`']|\d\d?|<[^>]*>)/g,d=/\$([$&`']|\d\d?)/g,A=function A(t){return t===undefined?t:String(t)};r(55)("replace",2,function(i,o,w,S){return[function(t,n){var r=i(this),e=t==undefined?undefined:t[o];return e!==undefined?e.call(t,r,n):w.call(String(r),t,n)},function(t,n){var r=S(w,t,this,n);if(r.done)return r.value;var e=_(t),i=String(this),o="function"==typeof n;o||(n=String(n));var u=e.global;if(u){var c=e.unicode;e.lastIndex=0}for(var f=[];;){var a=F(e,i);if(null===a)break;if(f.push(a),!u)break;""===String(a[0])&&(e.lastIndex=P(i,E(e.lastIndex),c))}for(var s="",l=0,h=0;h>>0,s=new RegExp(t.source,c+"g");(e=h.call(s,r))&&!(f<(i=s[v])&&(u.push(r.slice(f,e.index)),1=a));)s[v]===e.index&&s[v]++;return f===r[d]?!o&&s.test("")||u.push(""):u.push(r.slice(f)),u[d]>a?u.slice(0,a):u}:"0"[u](undefined,0)[d]?function b(t,n){return t===undefined&&0===n?[]:y.call(this,t,n)}:y,[function(t,n){var r=i(this),e=t==undefined?undefined:t[o];return e!==undefined?e.call(t,r,n):b.call(String(r),t,n)},function(t,n){var r=g(b,t,this,n,b!==y);if(r.done)return r.value;var e=m(t),i=String(this),o=w(e,RegExp),u=e.unicode,c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(P?"y":"g"),f=new o(P?e:"^(?:"+e.source+")",c),a=n===undefined?O:n>>>0;if(0==a)return[];if(0===i.length)return null===_(f,i)?[i]:[];for(var s=0,l=0,h=[];l=n.length)return{value:undefined,done:!0}}while(!((t=n[this._i++])in this._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,n,r){var o=r(20),u=r(35),c=r(13),e=r(0),f=r(4),a=r(3);e(e.S,"Reflect",{get:function s(t,n){var r,e,i=arguments.length<3?t:arguments[2];return a(t)===i?t[n]:(r=o.f(t,n))?c(r,"value")?r.value:r.get!==undefined?r.get.call(i):undefined:f(e=u(t))?s(e,n,i):void 0}})},function(t,n,r){var e=r(20),i=r(0),o=r(3);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,n){return e.f(o(t),n)}})},function(t,n,r){var e=r(0),i=r(35),o=r(3);e(e.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},function(t,n,r){var e=r(0);e(e.S,"Reflect",{has:function(t,n){return n in t}})},function(t,n,r){var e=r(0),i=r(3),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},function(t,n,r){var e=r(0);e(e.S,"Reflect",{ownKeys:r(116)})},function(t,n,r){var e=r(0),i=r(3),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(n){return!1}}})},function(t,n,r){var c=r(9),f=r(20),a=r(35),s=r(13),e=r(0),l=r(28),h=r(3),p=r(4);e(e.S,"Reflect",{set:function d(t,n,r){var e,i,o=arguments.length<4?t:arguments[3],u=f.f(h(t),n);if(!u){if(p(i=a(t)))return d(i,n,r,o);u=l(0)}if(s(u,"value")){if(!1===u.writable||!p(o))return!1;if(e=f.f(o,n)){if(e.get||e.set||!1===e.writable)return!1;e.value=r,c.f(o,n,e)}else c.f(o,n,l(0,r));return!0}return u.set!==undefined&&(u.set.call(o,r),!0)}})},function(t,n,r){var e=r(0),i=r(65);i&&e(e.S,"Reflect",{setPrototypeOf:function(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(r){return!1}}})},function(t,n,r){r(268),t.exports=r(7).Array.includes},function(t,n,r){"use strict";var e=r(0),i=r(49)(!0);e(e.P,"Array",{includes:function(t){return i(this,t,1c;)(r=i(e,n=o[c++]))!==undefined&&l(u,n,r);return u}})},function(t,n,r){r(285),t.exports=r(7).Object.values},function(t,n,r){var e=r(0),i=r(118)(!1);e(e.S,"Object",{values:function(t){return i(t)}})},function(t,n,r){r(287),t.exports=r(7).Object.entries},function(t,n,r){var e=r(0),i=r(118)(!0);e(e.S,"Object",{entries:function(t){return i(t)}})},function(t,n,r){"use strict";r(110),r(289),t.exports=r(7).Promise["finally"]},function(t,n,r){"use strict";var e=r(0),i=r(7),o=r(1),u=r(47),c=r(112);e(e.P+e.R,"Promise",{"finally":function(n){var r=u(this,i.Promise||o.Promise),t="function"==typeof n;return this.then(t?function(t){return c(r,n()).then(function(){return t})}:n,t?function(t){return c(r,n()).then(function(){throw t})}:n)}})},function(t,n,r){r(291),r(292),r(293),t.exports=r(7)},function(t,n,r){var e=r(1),i=r(0),o=r(57),u=[].slice,c=/MSIE .\./.test(o),f=function f(i){return function(t,n){var r=2 + + + + +Created by iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.ttf b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.ttf new file mode 100644 index 000000000..d1a7b4f8b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.ttf differ diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff new file mode 100644 index 000000000..e4088c07b Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff differ diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff2 b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff2 new file mode 100644 index 000000000..28f293070 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/login/lib/font/iconfont.woff2 differ diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js new file mode 100644 index 000000000..162f7d1b3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_en_US.js @@ -0,0 +1,59 @@ +var Store = { + i18n : { + 'Designer-Login_User_Name': 'Username/Email/Phone number', + 'Designer-Login_User_Name_Hint': 'Please enter username/email/phone number', + 'Designer-Login_Password': 'Password', + 'Designer-Login_Password_Hint': 'Please enter the password', + 'Designer-Login': 'Login', + 'Designer-Login_Title': 'FanRuan Passport Login', + 'Designer-Login_I_Have_Read': 'I have read', + 'Designer-Login_Service_Terms': 'Terms of Service', + 'Designer-Login_Forget_Password': 'Forgot your password?', + 'Designer-Login_Sms': 'SMS login', + 'Designer-Login_Normal': 'Password login', + 'Designer-Login_Phone': 'Phone number', + 'Designer-Login_Phone_Hint': 'Please enter your phone number', + 'Designer-Login_Code': 'Captcha', + 'Designer-Login_Code_Hint': 'Please enter the captcha', + 'Designer-Login_Code_Request': 'Get captcha', + 'Designer-Login_Code_Request_Again': 'Re-acquire', + 'Designer-Login_Register_Or_Login': 'Register/Login', + 'Designer-Basic_Chinese_Mainland': 'Mainland China', + 'Designer-Basic_Chinese_Hong_Kong': 'Hong Kong', + 'Designer-Basic_Chinese_Macao': 'Macao', + 'Designer-Basic_Chinese_Taiwan': 'Taiwan', + 'Designer-Basic_Turkey': 'Turkey', + 'Designer-Basic_South_Korea': 'South Korea', + 'Designer-Basic_Japan': 'Japan', + 'Designer-Basic_Singapore': 'Singapore', + 'Designer-Basic_Malaysia': 'Malaysia', + 'Designer-Login_Username_Not_Null': 'Username cannot be empty', + 'Designer-Login_Password_Not_Null': 'Password cannot be empty', + 'Designer-Login_Username_Or_Password_Incorrect': 'The username or password is incorrect, please check', + 'Designer-Login_Phone_Not_Null': 'The phone number format is illegal', + 'Designer-Login_Code_Not_Null': 'The captcha cannot be empty', + 'Designer-Login_Code_Incorrect': 'The captcha has expired, please get it again', + 'Designer-Login_Password_Setting_Hint': 'Enter the login password (6-16 digits password can be entered)', + 'Designer-Login_Store_User_Not_Exist': 'The username does not exist', + 'Designer-Login_Store_User_Password_Error': 'Username or password is incorrect', + 'Designer-Login_Token_Request_Failed': 'Failed to get registration token', + 'Designer-Login_Unexpected_Error': 'Unexpected error', + 'Designer-Login_Internal_Error': 'Server internal error', + 'Designer-Guide_Do_Not_Remind': 'No reminders within one month', + 'Designer-Guide_Login': 'Login now', + 'Designer-BBS_Register_Timeout': 'Register timeout, please resend the captcha', + 'Designer-BBS_Phone_Is_Register': 'The phone number is already registered', + 'Designer-BBS_Captcha_Send_Exceed_Limit': 'The captcha can only be sent once every 60s', + 'Designer-BBS_Phone_Format_Error': 'Failed to send, the phone number format is incorrect', + 'Designer-BBS_Captcha_Out_Of_Date': 'The captcha has expired, please get it again', + 'Designer-BBS_Captcha_Try_Exceed_Limit': 'The number of attempts of the captcha has reached the upper limit, please get it again', + 'Designer-BBS_Captcha_Error': 'Captcha error', + 'Designer-BBS_Username_Format_Error': 'The nickname only supports Chinese, English and numbers', + 'Designer-BBS_Username_Too_Short': 'The length of the nickname is too short', + 'Designer-BBS_Username_Too_Long': 'The length of this nickname has reached the upper limit', + 'Designer-BBS_Username_Is_Register': 'The user has been registered', + 'Designer-BBS_Please_Enter_Correct_Phone': 'Please enter the correct phone number', + 'Designer-Login_Network_Connected_Failed': 'Network connection failed', + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js new file mode 100644 index 000000000..455998282 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ja_JP.js @@ -0,0 +1,59 @@ +var Store = { + i18n : { + 'Designer-Login_User_Name': 'ユーザ名/メールアドレス/携帯番号', + 'Designer-Login_User_Name_Hint': 'ユーザ名/メールアドレス/携帯番号を入力してください。', + 'Designer-Login_Password': 'パスワード', + 'Designer-Login_Password_Hint': 'パスワードを入力してください。', + 'Designer-Login': 'ログイン', + 'Designer-Login_Title': 'FanRuanアカウントでログイン', + 'Designer-Login_I_Have_Read': '承認する', + 'Designer-Login_Service_Terms': '利用規約', + 'Designer-Login_Forget_Password': 'パスワードをお忘れですか', + 'Designer-Login_Sms': '認証コードログイン', + 'Designer-Login_Normal': 'パスワードでログイン', + 'Designer-Login_Phone': '携帯番号', + 'Designer-Login_Phone_Hint': '携帯番号を入力してください。', + 'Designer-Login_Code': '認証コード', + 'Designer-Login_Code_Hint': '認証コードを入力してください。', + 'Designer-Login_Code_Request': '認証コードを取得', + 'Designer-Login_Code_Request_Again': '再取得', + 'Designer-Login_Register_Or_Login': '登録/ログイン', + 'Designer-Basic_Chinese_Mainland': '中国大陸', + 'Designer-Basic_Chinese_Hong_Kong': '中国香港', + 'Designer-Basic_Chinese_Macao': '中国澳門', + 'Designer-Basic_Chinese_Taiwan': '中国台湾', + 'Designer-Basic_Turkey': 'トルコ共和国', + 'Designer-Basic_South_Korea': '韓国', + 'Designer-Basic_Japan': '日本', + 'Designer-Basic_Singapore': 'シンガポール', + 'Designer-Basic_Malaysia': 'マレーシア', + 'Designer-Login_Username_Not_Null': 'ユーザ名は空白不可。', + 'Designer-Login_Password_Not_Null': 'パスワードは空白不可。', + 'Designer-Login_Username_Or_Password_Incorrect': 'ユーザ名又はパスワードが間違っています。ご確認ください。', + 'Designer-Login_Phone_Not_Null': '携帯番号の形式が正しくない。', + 'Designer-Login_Code_Not_Null': '認証コードは空白不可。', + 'Designer-Login_Code_Incorrect': '認証コードが無効になりました。再取得してください。', + 'Designer-Login_Password_Setting_Hint': 'パスワードを入力してください。(6‐16桁入力可能)', + 'Designer-Login_Store_User_Not_Exist': 'ユーザ名は存在しません', + 'Designer-Login_Store_User_Password_Error': 'ユーザ名又はパスワードが間違っています。', + 'Designer-Login_Token_Request_Failed': '登録Token取得に失敗', + 'Designer-Login_Unexpected_Error': '未知のエラー', + 'Designer-Login_Internal_Error': 'サーバ内部エラー', + 'Designer-Guide_Do_Not_Remind': '一か月内アラートしません。', + 'Designer-Guide_Login': 'ログイン', + 'Designer-BBS_Register_Timeout': '登録Timeout、検証コードをもう一度取得してください。', + 'Designer-BBS_Phone_Is_Register': 'この携帯は既に登録されています。', + 'Designer-BBS_Captcha_Send_Exceed_Limit': '認証コードは60s内に一回しか送信できません。', + 'Designer-BBS_Phone_Format_Error': '携帯番号の形式が間違っています、検証コード送信失敗。', + 'Designer-BBS_Captcha_Out_Of_Date': '認証コードが無効になりました。再取得してください。', + 'Designer-BBS_Captcha_Try_Exceed_Limit': '認証コードの試行回数が上限に達しています。再取得してください。', + 'Designer-BBS_Captcha_Error': '認証コードが間違っています。', + 'Designer-BBS_Username_Format_Error': 'ユーザ名は漢字、アルバイトと数字しかサポートできません。', + 'Designer-BBS_Username_Too_Short': 'ユーザ名が短すぎます。', + 'Designer-BBS_Username_Too_Long': 'ユーザ名が長すぎます。', + 'Designer-BBS_Username_Is_Register': 'このユーザは登録済みです。', + 'Designer-BBS_Please_Enter_Correct_Phone': '正確な携帯番号を入力してください。', + 'Designer-Login_Network_Connected_Failed': 'インターネット接続失敗', + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js new file mode 100644 index 000000000..162f7d1b3 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_ko_KR.js @@ -0,0 +1,59 @@ +var Store = { + i18n : { + 'Designer-Login_User_Name': 'Username/Email/Phone number', + 'Designer-Login_User_Name_Hint': 'Please enter username/email/phone number', + 'Designer-Login_Password': 'Password', + 'Designer-Login_Password_Hint': 'Please enter the password', + 'Designer-Login': 'Login', + 'Designer-Login_Title': 'FanRuan Passport Login', + 'Designer-Login_I_Have_Read': 'I have read', + 'Designer-Login_Service_Terms': 'Terms of Service', + 'Designer-Login_Forget_Password': 'Forgot your password?', + 'Designer-Login_Sms': 'SMS login', + 'Designer-Login_Normal': 'Password login', + 'Designer-Login_Phone': 'Phone number', + 'Designer-Login_Phone_Hint': 'Please enter your phone number', + 'Designer-Login_Code': 'Captcha', + 'Designer-Login_Code_Hint': 'Please enter the captcha', + 'Designer-Login_Code_Request': 'Get captcha', + 'Designer-Login_Code_Request_Again': 'Re-acquire', + 'Designer-Login_Register_Or_Login': 'Register/Login', + 'Designer-Basic_Chinese_Mainland': 'Mainland China', + 'Designer-Basic_Chinese_Hong_Kong': 'Hong Kong', + 'Designer-Basic_Chinese_Macao': 'Macao', + 'Designer-Basic_Chinese_Taiwan': 'Taiwan', + 'Designer-Basic_Turkey': 'Turkey', + 'Designer-Basic_South_Korea': 'South Korea', + 'Designer-Basic_Japan': 'Japan', + 'Designer-Basic_Singapore': 'Singapore', + 'Designer-Basic_Malaysia': 'Malaysia', + 'Designer-Login_Username_Not_Null': 'Username cannot be empty', + 'Designer-Login_Password_Not_Null': 'Password cannot be empty', + 'Designer-Login_Username_Or_Password_Incorrect': 'The username or password is incorrect, please check', + 'Designer-Login_Phone_Not_Null': 'The phone number format is illegal', + 'Designer-Login_Code_Not_Null': 'The captcha cannot be empty', + 'Designer-Login_Code_Incorrect': 'The captcha has expired, please get it again', + 'Designer-Login_Password_Setting_Hint': 'Enter the login password (6-16 digits password can be entered)', + 'Designer-Login_Store_User_Not_Exist': 'The username does not exist', + 'Designer-Login_Store_User_Password_Error': 'Username or password is incorrect', + 'Designer-Login_Token_Request_Failed': 'Failed to get registration token', + 'Designer-Login_Unexpected_Error': 'Unexpected error', + 'Designer-Login_Internal_Error': 'Server internal error', + 'Designer-Guide_Do_Not_Remind': 'No reminders within one month', + 'Designer-Guide_Login': 'Login now', + 'Designer-BBS_Register_Timeout': 'Register timeout, please resend the captcha', + 'Designer-BBS_Phone_Is_Register': 'The phone number is already registered', + 'Designer-BBS_Captcha_Send_Exceed_Limit': 'The captcha can only be sent once every 60s', + 'Designer-BBS_Phone_Format_Error': 'Failed to send, the phone number format is incorrect', + 'Designer-BBS_Captcha_Out_Of_Date': 'The captcha has expired, please get it again', + 'Designer-BBS_Captcha_Try_Exceed_Limit': 'The number of attempts of the captcha has reached the upper limit, please get it again', + 'Designer-BBS_Captcha_Error': 'Captcha error', + 'Designer-BBS_Username_Format_Error': 'The nickname only supports Chinese, English and numbers', + 'Designer-BBS_Username_Too_Short': 'The length of the nickname is too short', + 'Designer-BBS_Username_Too_Long': 'The length of this nickname has reached the upper limit', + 'Designer-BBS_Username_Is_Register': 'The user has been registered', + 'Designer-BBS_Please_Enter_Correct_Phone': 'Please enter the correct phone number', + 'Designer-Login_Network_Connected_Failed': 'Network connection failed', + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_CN.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_CN.js new file mode 100644 index 000000000..5181aa435 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_CN.js @@ -0,0 +1,59 @@ +var Store = { + i18n : { + 'Designer-Login_User_Name': '用户名/邮箱/手机号', + 'Designer-Login_User_Name_Hint': '请输入用户名/邮箱/手机号', + 'Designer-Login_Password': '密码', + 'Designer-Login_Password_Hint': '请输入密码', + 'Designer-Login': '登录', + 'Designer-Login_Title': '帆软通行证登录', + 'Designer-Login_I_Have_Read': '我已阅读', + 'Designer-Login_Service_Terms': '服务条款', + 'Designer-Login_Forget_Password': '忘记密码?', + 'Designer-Login_Sms': '验证码登录', + 'Designer-Login_Normal': '密码登录', + 'Designer-Login_Phone': '手机号码', + 'Designer-Login_Phone_Hint': '请输入手机号码', + 'Designer-Login_Code': '验证码', + 'Designer-Login_Code_Hint': '请输入验证码', + 'Designer-Login_Code_Request': '获取验证码', + 'Designer-Login_Code_Request_Again': '重新获取', + 'Designer-Login_Register_Or_Login': '注册/登录', + 'Designer-Basic_Chinese_Mainland': '中国大陆', + 'Designer-Basic_Chinese_Hong_Kong': '中国香港', + 'Designer-Basic_Chinese_Macao': '中国澳门', + 'Designer-Basic_Chinese_Taiwan': '中国台湾', + 'Designer-Basic_Turkey': '土耳其', + 'Designer-Basic_South_Korea': '韩国', + 'Designer-Basic_Japan': '日本', + 'Designer-Basic_Singapore': '新加坡', + 'Designer-Basic_Malaysia': '马来西亚', + 'Designer-Login_Username_Not_Null': '用户名不能为空', + 'Designer-Login_Password_Not_Null': '密码不能为空', + 'Designer-Login_Username_Or_Password_Incorrect': '用户名或者密码错误,请检查', + 'Designer-Login_Phone_Not_Null': '手机号码格式非法', + 'Designer-Login_Code_Not_Null': '验证码不能为空', + 'Designer-Login_Code_Incorrect': '验证码已过期,请重新获取', + 'Designer-Login_Password_Setting_Hint': '输入登录密码(可输入6-16位密码)', + 'Designer-Login_Store_User_Not_Exist': '用户名不存在', + 'Designer-Login_Store_User_Password_Error': '用户名或密码错误', + 'Designer-Login_Token_Request_Failed': '注册令牌获取失败', + 'Designer-Login_Unexpected_Error': '未知错误', + 'Designer-Login_Internal_Error': '服务器内部错误', + 'Designer-Guide_Do_Not_Remind': '一个月内不再提醒', + 'Designer-Guide_Login': '立即登录', + 'Designer-BBS_Register_Timeout': '注册超时,请重新发送验证码', + 'Designer-BBS_Phone_Is_Register': '该手机号码已注册', + 'Designer-BBS_Captcha_Send_Exceed_Limit': '验证码每60s只能发送一次', + 'Designer-BBS_Phone_Format_Error': '发送失败,手机号格式错误', + 'Designer-BBS_Captcha_Out_Of_Date': '验证码已过期,请重新获取', + 'Designer-BBS_Captcha_Try_Exceed_Limit': '验证码尝试次数已达上限,请重新获取', + 'Designer-BBS_Captcha_Error': '验证码错误', + 'Designer-BBS_Username_Format_Error': '昵称只支持中英文和数字', + 'Designer-BBS_Username_Too_Short': '昵称长度太短', + 'Designer-BBS_Username_Too_Long': '这个昵称长度已经达到了上限', + 'Designer-BBS_Username_Is_Register': '该用户已被注册', + 'Designer-BBS_Please_Enter_Correct_Phone': '请输入正确的手机号', + 'Designer-Login_Network_Connected_Failed': '网络连接失败', + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js new file mode 100644 index 000000000..2cef83151 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/login_zh_TW.js @@ -0,0 +1,59 @@ +var Store = { + i18n : { + 'Designer-Login_User_Name': '帳號/郵箱/手機號', + 'Designer-Login_User_Name_Hint': '請輸入帳號/郵箱/手機號', + 'Designer-Login_Password': '密碼', + 'Designer-Login_Password_Hint': '請輸入密碼', + 'Designer-Login': '登入', + 'Designer-Login_Title': '帆軟通行證登入', + 'Designer-Login_I_Have_Read': '我已閱讀', + 'Designer-Login_Service_Terms': '服務條款', + 'Designer-Login_Forget_Password': '忘記密碼?', + 'Designer-Login_Sms': '驗證碼登入', + 'Designer-Login_Normal': '密碼登入', + 'Designer-Login_Phone': '手機號碼', + 'Designer-Login_Phone_Hint': '請輸入手機號碼', + 'Designer-Login_Code': '驗證碼', + 'Designer-Login_Code_Hint': '請輸入驗證碼', + 'Designer-Login_Code_Request': '獲取驗證碼', + 'Designer-Login_Code_Request_Again': '重新獲取', + 'Designer-Login_Register_Or_Login': '註冊/登入', + 'Designer-Basic_Chinese_Mainland': '中國大陸', + 'Designer-Basic_Chinese_Hong_Kong': '中國香港', + 'Designer-Basic_Chinese_Macao': '中國澳門', + 'Designer-Basic_Chinese_Taiwan': '中國臺灣', + 'Designer-Basic_Turkey': '土耳其', + 'Designer-Basic_South_Korea': '韓國', + 'Designer-Basic_Japan': '日本', + 'Designer-Basic_Singapore': '新加坡', + 'Designer-Basic_Malaysia': '馬來西亞', + 'Designer-Login_Username_Not_Null': '使用者名稱不能為空', + 'Designer-Login_Password_Not_Null': '密碼不能為空', + 'Designer-Login_Username_Or_Password_Incorrect': '使用者名稱或者密碼錯誤,請檢查', + 'Designer-Login_Phone_Not_Null': '手機號碼格式不正確', + 'Designer-Login_Code_Not_Null': '驗證碼不能為空', + 'Designer-Login_Code_Incorrect': '驗證碼已過期,請重新獲取', + 'Designer-Login_Password_Setting_Hint': '輸入登入密碼(可輸入6-16位密碼)', + 'Designer-Login_Store_User_Not_Exist': '帳號不存在', + 'Designer-Login_Store_User_Password_Error': '帳號或密碼錯誤', + 'Designer-Login_Token_Request_Failed': '註冊令牌獲取失敗', + 'Designer-Login_Unexpected_Error': '未知錯誤', + 'Designer-Login_Internal_Error': '伺服器內部錯誤', + 'Designer-Guide_Do_Not_Remind': '一個月內不再提醒', + 'Designer-Guide_Login': '立即登入', + 'Designer-BBS_Register_Timeout': '註冊超時,請重新發送驗證碼', + 'Designer-BBS_Phone_Is_Register': '該手機號碼已註冊', + 'Designer-BBS_Captcha_Send_Exceed_Limit': '驗證碼每60s只能傳送一次', + 'Designer-BBS_Phone_Format_Error': '傳送失敗,手機號格式錯誤', + 'Designer-BBS_Captcha_Out_Of_Date': '驗證碼已過期,請重新獲取', + 'Designer-BBS_Captcha_Try_Exceed_Limit': '驗證碼嘗試次數已達上限,請重新獲取', + 'Designer-BBS_Captcha_Error': '驗證碼錯誤', + 'Designer-BBS_Username_Format_Error': '暱稱只支援中英文和數字', + 'Designer-BBS_Username_Too_Short': '暱稱長度太短', + 'Designer-BBS_Username_Too_Long': '這個暱稱長度已經達到了上限', + 'Designer-BBS_Username_Is_Register': '該帳號已被註冊', + 'Designer-BBS_Please_Enter_Correct_Phone': '請輸入正確的手機號', + 'Designer-Login_Network_Connected_Failed': '網路連線失敗', + + }} +window.Store = Store; \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/locale/transform-i18n.js b/designer-base/src/main/resources/com/fr/design/login/lib/locale/transform-i18n.js new file mode 100644 index 000000000..3c06bd56d --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/locale/transform-i18n.js @@ -0,0 +1,40 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const fs = require('fs'); +const { resolve } = require('path'); +const propertiesReader = require('properties-reader'); + +function compileSinglePropertiesFile2JS(filename) { + if (!/\.properties/g.test(filename)) { + return; + } + + const filePrefix = filename.split('.')[0].replace('show_', ''); + + let content = ''; + + const properties = propertiesReader(resolve(__dirname, `../../../i18n/${filename}`)); + + properties.each((key, value) => { + content += ` '${key}': '${value}',\n`; + }); + + content = `var Store = { + i18n : { +${content} + }} +window.Store = Store;` + + fs.writeFileSync( + resolve( + __dirname, + `${filePrefix}.js` + ), + content + ); +} +function compilePropertiesFiles2JS() { + fs.readdirSync(resolve(__dirname, '../../../i18n')) + .forEach(file => compileSinglePropertiesFile2JS(file)); +} + +compilePropertiesFiles2JS(); diff --git a/designer-base/src/main/resources/com/fr/design/login/lib/polyfill.min.js b/designer-base/src/main/resources/com/fr/design/login/lib/polyfill.min.js new file mode 100644 index 000000000..d3201b860 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/lib/polyfill.min.js @@ -0,0 +1,3 @@ +/* Disable minification (remove `.min` from URL path) for more info */ + +(function(undefined) {var _DOMTokenList=function(){var n=!0,t=function(t,e,r,o){Object.defineProperty?Object.defineProperty(t,e,{configurable:!1===n||!!o,get:r}):t.__defineGetter__(e,r)};try{t({},"support")}catch(e){n=!1}return function(n,e){var r=this,o=[],i={},a=0,c=0,f=function(n){t(r,n,function(){return u(),o[n]},!1)},l=function(){if(a>=c)for(;c>>0,"object"==typeof n[e]?n[e].baseVal=o.join(" "):n[e]=o.join(" "),l())},r.remove=function(){u.apply(r,t=arguments);for(var t,c={},f=0,g=[];f>>0,"object"==typeof n[e]?n[e].baseVal=o.join(" "):n[e]=o.join(" "),l()},r.toggle=function(n,t){return u.apply(r,[n]),undefined!==t?t?(r.add(n),!0):(r.remove(n),!1):i[n]?(r.remove(n),!1):(r.add(n),!0)},r}}();function ArrayCreate(r){if(1/r==-Infinity&&(r=0),r>Math.pow(2,32)-1)throw new RangeError("Invalid array length");var n=[];return n.length=r,n}function Call(t,l){var n=arguments.length>2?arguments[2]:[];if(!1===IsCallable(t))throw new TypeError(Object.prototype.toString.call(t)+"is not a function.");return t.apply(l,n)}function CreateDataProperty(e,r,t){var a={value:t,writable:!0,enumerable:!0,configurable:!0};try{return Object.defineProperty(e,r,a),!0}catch(n){return!1}}function CreateDataPropertyOrThrow(t,r,o){var e=CreateDataProperty(t,r,o);if(!e)throw new TypeError("Cannot assign value `"+Object.prototype.toString.call(o)+"` to property `"+Object.prototype.toString.call(r)+"` on object `"+Object.prototype.toString.call(t)+"`");return e}function CreateMethodProperty(e,r,t){var a={value:t,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(e,r,a)}function Get(n,t){return n[t]}function HasProperty(n,r){return r in n}function IsArray(r){return"[object Array]"===Object.prototype.toString.call(r)}function IsCallable(n){return"function"==typeof n}function RequireObjectCoercible(e){if(null===e||e===undefined)throw TypeError();return e}function SameValueNonNumber(e,n){return e===n}function ToBoolean(o){return Boolean(o)}function ToInteger(n){var i=Number(n);return isNaN(i)?0:1/i===Infinity||1/i==-Infinity||i===Infinity||i===-Infinity?i:(i<0?-1:1)*Math.floor(Math.abs(i))}function ToLength(n){var t=ToInteger(n);return t<=0?0:Math.min(t,Math.pow(2,53)-1)}function ToNumber(r){return Number(r)}function ToObject(e){if(null===e||e===undefined)throw TypeError();return Object(e)}function GetV(t,e){return ToObject(t)[e]}function GetMethod(e,n){var r=GetV(e,n);if(null===r||r===undefined)return undefined;if(!1===IsCallable(r))throw new TypeError("Method not callable: "+n);return r}function ToUint32(n){var i=Number(n);return isNaN(i)||1/i===Infinity||1/i==-Infinity||i===Infinity||i===-Infinity?0:(i<0?-1:1)*Math.floor(Math.abs(i))>>>0}function Type(e){switch(typeof e){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===e?"null":"Symbol"in this&&e instanceof this.Symbol?"symbol":"object"}}function CreateIterResultObject(e,r){if("boolean"!==Type(r))throw new Error;var t={};return CreateDataProperty(t,"value",e),CreateDataProperty(t,"done",r),t}function EnumerableOwnProperties(e,r){for(var t=Object.keys(e),n=[],s=t.length,a=0;a2?arguments[2]:r,o=arguments.length>1?arguments[1]:[];if(!IsConstructor(r))throw new TypeError("F must be a constructor.");if(!IsConstructor(t))throw new TypeError("newTarget must be a constructor.");if(t===r)return new(Function.prototype.bind.apply(r,[null].concat(o)));var n=OrdinaryCreateFromConstructor(t,Object.prototype);return Call(r,n,o)}function ArraySpeciesCreate(r,e){if(1/e==-Infinity&&(e=0),!1===IsArray(r))return ArrayCreate(e);var t=Get(r,"constructor");if("object"===Type(t)&&null===(t="Symbol"in this&&"species"in this.Symbol?Get(t,this.Symbol.species):undefined)&&(t=undefined),t===undefined)return ArrayCreate(e);if(!IsConstructor(t))throw new TypeError("C must be a constructor");return Construct(t,[e])}function IsRegExp(e){if("object"!==Type(e))return!1;var t="Symbol"in this&&"match"in this.Symbol?Get(e,this.Symbol.match):undefined;if(t!==undefined)return ToBoolean(t);try{var n=e.lastIndex;return e.lastIndex=0,RegExp.prototype.exec.call(e),!0}catch(r){}finally{e.lastIndex=n}return!1}function IteratorClose(r,t){if("object"!==Type(r["[[Iterator]]"]))throw new Error(Object.prototype.toString.call(r["[[Iterator]]"])+"is not an Object.");var e=r["[[Iterator]]"],o=GetMethod(e,"return");if(o===undefined)return t;try{var n=Call(o,e)}catch(c){var a=c}if(t)return t;if(a)throw a;if("object"!==Type(n))throw new TypeError("Iterator's return method returned a non-object.");return t}function IteratorComplete(t){if("object"!==Type(t))throw new Error(Object.prototype.toString.call(t)+"is not an Object.");return ToBoolean(Get(t,"done"))}function IteratorNext(t){if(arguments.length<2)var e=Call(t["[[NextMethod]]"],t["[[Iterator]]"]);else e=Call(t["[[NextMethod]]"],t["[[Iterator]]"],[arguments[1]]);if("object"!==Type(e))throw new TypeError("bad iterator");return e}function IteratorStep(t){var r=IteratorNext(t);return!0!==IteratorComplete(r)&&r}function IteratorValue(t){if("object"!==Type(t))throw new Error(Object.prototype.toString.call(t)+"is not an Object.");return Get(t,"value")}function OrdinaryToPrimitive(r,t){if("string"===t)var e=["toString","valueOf"];else e=["valueOf","toString"];for(var i=0;i1?arguments[1]:undefined;if("object"===Type(e)){if(arguments.length<2)var i="default";else t===String?i="string":t===Number&&(i="number");var r="function"==typeof this.Symbol&&"symbol"==typeof this.Symbol.toPrimitive?GetMethod(e,this.Symbol.toPrimitive):undefined;if(r!==undefined){var n=Call(r,e,[i]);if("object"!==Type(n))return n;throw new TypeError("Cannot convert exotic object to primitive.")}return"default"===i&&(i="number"),OrdinaryToPrimitive(e,i)}return e}function ToString(t){switch(Type(t)){case"symbol":throw new TypeError("Cannot convert a Symbol value to a string");case"object":return ToString(ToPrimitive(t,"string"));default:return String(t)}}function ToPropertyKey(r){var i=ToPrimitive(r,String);return"symbol"===Type(i)?i:ToString(i)}function UTF16Decode(e,n){return 1024*(e-55296)+(n-56320)+65536}function UTF16Encoding(n){return n<=65535?n:[Math.floor((n-65536)/1024)+55296,(n-65536)%1024+56320]}var _mutation=function(){function e(e){return"function"==typeof Node?e instanceof Node:e&&"object"==typeof e&&e.nodeName&&e.nodeType>=1&&e.nodeType<=12}return function n(t){if(1===t.length)return e(t[0])?t[0]:document.createTextNode(t[0]+"");for(var o=document.createDocumentFragment(),r=0;r>0}function f(t){return t>>>0}function u(e){if(!("TYPED_ARRAY_POLYFILL_NO_ARRAY_ACCESSORS"in t)){if(e.length>N)throw RangeError("Array too large for polyfill");var r;for(r=0;r>r}function h(t,e){var r=32-e;return t<>>r}function y(t){return[255&t]}function s(t){return a(t[0],8)}function l(t){return[255&t]}function p(t){return h(t[0],8)}function c(t){return t=x(Number(t)),[t<0?0:t>255?255:255&t]}function b(t){return[255&t,t>>8&255]}function g(t){return a(t[1]<<8|t[0],16)}function E(t){return[255&t,t>>8&255]}function v(t){return h(t[1]<<8|t[0],16)}function _(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function O(t){return a(t[3]<<24|t[2]<<16|t[1]<<8|t[0],32)}function d(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function j(t){return h(t[3]<<24|t[2]<<16|t[1]<<8|t[0],32)}function P(t,e,r){function n(t){var e=m(t),r=t-e;return r<.5?e:r>.5?e+1:e%2?e+1:e}var o,i,f,u=(1<=F(2,1-u)){i=Y(m(I(t)/S),1023);var a=t/F(2,i);a<1&&(i-=1,a*=2),a>=2&&(i+=1,a/=2);var h=F(2,r);f=n(a*h)-h,i+=u,f/h>=1&&(i+=1,f=0),i>2*u&&(i=(1<>=1;return s.reverse(),f=s.join(""),u=(1<0?a*F(2,h-u)*(1+y/F(2,r)):0!==y?a*F(2,-(u-1))*(y/F(2,r)):a<0?-0:0}function w(t){return T(t,11,52)}function A(t){return P(t,11,52)}function L(t){return T(t,8,23)}function R(t){return P(t,8,23)}var B=void 0,N=1e5,S=Math.LN2,M=Math.abs,m=Math.floor,I=Math.log,U=Math.max,Y=Math.min,F=Math.pow,x=Math.round;!function(){var t=Object.defineProperty,e=!function(){try{return Object.defineProperty({},"x",{})}catch(t){return!1}}();t&&!e||(Object.defineProperty=function(e,r,n){if(t)try{return t(e,r,n)}catch(o){}if(e!==Object(e))throw TypeError("Object.defineProperty called on non-object");return Object.prototype.__defineGetter__&&"get"in n&&Object.prototype.__defineGetter__.call(e,r,n.get),Object.prototype.__defineSetter__&&"set"in n&&Object.prototype.__defineSetter__.call(e,r,n.set),"value"in n&&(e[r]=n.value),e})}(),function(){function a(t){if((t=i(t))<0)throw RangeError("ArrayBuffer size is not a small enough positive integer.");Object.defineProperty(this,"byteLength",{value:t}),Object.defineProperty(this,"_bytes",{value:Array(t)});for(var e=0;e=1&&"object"===e(arguments[0])&&arguments[0]instanceof h)return function(t){if(this.constructor!==t.constructor)throw TypeError();var e=t.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new a(e)}),Object.defineProperty(this,"byteLength",{value:e}),Object.defineProperty(this,"byteOffset",{value:0}),Object.defineProperty(this,"length",{value:t.length});for(var r=0;r=1&&"object"===e(arguments[0])&&!(arguments[0]instanceof h)&&!(arguments[0]instanceof a||"ArrayBuffer"===r(arguments[0])))return function(t){var e=t.length*this.BYTES_PER_ELEMENT;Object.defineProperty(this,"buffer",{value:new a(e)}),Object.defineProperty(this,"byteLength",{value:e}),Object.defineProperty(this,"byteOffset",{value:0}),Object.defineProperty(this,"length",{value:t.length});for(var r=0;r=1&&"object"===e(arguments[0])&&(arguments[0]instanceof a||"ArrayBuffer"===r(arguments[0])))return function(t,e,r){if((e=f(e))>t.byteLength)throw RangeError("byteOffset out of range");if(e%this.BYTES_PER_ELEMENT)throw RangeError("buffer length minus the byteOffset is not a multiple of the element size.");if(r===B){var n=t.byteLength-e;if(n%this.BYTES_PER_ELEMENT)throw RangeError("length of buffer minus byteOffset not a multiple of the element size");r=n/this.BYTES_PER_ELEMENT}else r=f(r),n=r*this.BYTES_PER_ELEMENT;if(e+n>t.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:t}),Object.defineProperty(this,"byteLength",{value:n}),Object.defineProperty(this,"byteOffset",{value:e}),Object.defineProperty(this,"length",{value:r})}.apply(this,arguments);throw TypeError()}function P(t,e,r){var n=function(){Object.defineProperty(this,"constructor",{value:n}),h.apply(this,arguments),u(this)};"__proto__"in n?n.__proto__=h:(n.from=h.from,n.of=h.of),n.BYTES_PER_ELEMENT=t;var o=function(){};return o.prototype=T,n.prototype=new o,Object.defineProperty(n.prototype,"BYTES_PER_ELEMENT",{value:t}),Object.defineProperty(n.prototype,"_pack",{value:e}),Object.defineProperty(n.prototype,"_unpack",{value:r}),n}t.ArrayBuffer=t.ArrayBuffer||a,Object.defineProperty(h,"from",{value:function(t){return new this(t)}}),Object.defineProperty(h,"of",{value:function(){return new this(arguments)}});var T={};h.prototype=T,Object.defineProperty(h.prototype,"_getter",{value:function(t){if(arguments.length<1)throw SyntaxError("Not enough arguments");if((t=f(t))>=this.length)return B;var e,r,n=[];for(e=0,r=this.byteOffset+t*this.BYTES_PER_ELEMENT;e=this.length)){var r,n,o=this._pack(e);for(r=0,n=this.byteOffset+t*this.BYTES_PER_ELEMENT;r0;)n._setter(h,n._getter(s)),s+=b,h+=b,g-=1;return n}}),Object.defineProperty(h.prototype,"every",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();for(var o=arguments[1],i=0;i1?arguments[1]:B,a=0;a1?arguments[1]:B,a=0;a0&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*m(M(n)))),n>=r)return-1;for(var o=n>=0?n:U(r-M(n),0);o1&&(n=Number(arguments[1]),n!==n?n=0:0!==n&&n!==1/0&&n!==-1/0&&(n=(n>0||-1)*m(M(n))));for(var o=n>=0?Y(n,r-1):r-M(n);o>=0;o--)if(e._getter(o)===t)return o;return-1}}),Object.defineProperty(h.prototype,"map",{value:function(t){if(this===B||null===this)throw TypeError();var e=Object(this),r=f(e.length);if(!n(t))throw TypeError();var o=[];o.length=r;for(var i=arguments[1],u=0;u=2?arguments[1]:e._getter(i++);i=2?arguments[1]:e._getter(i--);i>=0;)o=t.call(B,o,e._getter(i),i,e),i--;return o}}),Object.defineProperty(h.prototype,"reverse",{value:function(){if(this===B||null===this)throw TypeError();for(var t=Object(this),e=f(t.length),r=m(e/2),n=0,o=e-1;nthis.length)throw RangeError("Offset plus length of array is out of range");if(y=this.byteOffset+o*this.BYTES_PER_ELEMENT,s=r.length*this.BYTES_PER_ELEMENT,r.buffer===this.buffer){for(l=[],u=0,a=r.byteOffset;uthis.length)throw RangeError("Offset plus length of array is out of range");for(u=0;ur?1:0}if(this===B||null===this)throw TypeError();for(var r=Object(this),n=f(r.length),o=Array(n),i=0;ir?r:t}t=i(t),e=i(e),arguments.length<1&&(t=0),arguments.length<2&&(e=this.length),t<0&&(t=this.length+t),e<0&&(e=this.length+e),t=r(t,0,this.length),e=r(e,0,this.length);var n=e-t;return n<0&&(n=0),new this.constructor(this.buffer,this.byteOffset+t*this.BYTES_PER_ELEMENT,n)}});var N=P(1,y,s),S=P(1,l,p),I=P(1,c,p),F=P(2,b,g),x=P(2,E,v),k=P(4,_,O),C=P(4,d,j),z=P(4,R,L),D=P(8,A,w);t.Int8Array=t.Int8Array||N,t.Uint8Array=t.Uint8Array||S,t.Uint8ClampedArray=t.Uint8ClampedArray||I,t.Int16Array=t.Int16Array||F,t.Uint16Array=t.Uint16Array||x,t.Int32Array=t.Int32Array||k,t.Uint32Array=t.Uint32Array||C,t.Float32Array=t.Float32Array||z,t.Float64Array=t.Float64Array||D}(),function(){function e(t,e){return n(t.get)?t.get(e):t[e]}function o(t,e,n){if(!(t instanceof ArrayBuffer||"ArrayBuffer"===r(t)))throw TypeError();if((e=f(e))>t.byteLength)throw RangeError("byteOffset out of range");if(n=n===B?t.byteLength-e:f(n),e+n>t.byteLength)throw RangeError("byteOffset and length reference an area beyond the end of the buffer");Object.defineProperty(this,"buffer",{value:t}),Object.defineProperty(this,"byteLength",{value:n}),Object.defineProperty(this,"byteOffset",{value:e})}function i(t){return function r(n,o){if((n=f(n))+t.BYTES_PER_ELEMENT>this.byteLength)throw RangeError("Array index out of range");n+=this.byteOffset;for(var i=new Uint8Array(this.buffer,n,t.BYTES_PER_ELEMENT),u=[],h=0;hthis.byteLength)throw RangeError("Array index out of range");var u,h,y=new t([o]),s=new Uint8Array(y.buffer),l=[];for(u=0;u0;){var f=String(M),g=String(h);if(HasProperty(n,f)){var l=n[f];n[g]=l}else delete n[g];M+=s,h+=s,d-=1}return n});CreateMethodProperty(Array.prototype,"fill",function t(e){for(var r=arguments[1],n=arguments[2],o=ToObject(this),a=ToLength(Get(o,"length")),h=ToInteger(r),i=h<0?Math.max(a+h,0):Math.min(h,a),g=n===undefined?a:ToInteger(n),M=g<0?Math.max(a+g,0):Math.min(g,a);i1?arguments[1]:undefined,a=0;a1?arguments[1]:undefined,a=0;a=0)var a=n;else(a=o+n)<0&&(a=0);for(;a1?NaN:-1===t?-Infinity:1===t?Infinity:0===t&&1/t===Infinity?0:0===t&&1/t==-Infinity?-0:Math.log((1+t)/(1-t))/2});CreateMethodProperty(Math,"cbrt",function n(t){if(isNaN(t))return NaN;if(0===t&&1/t===Infinity)return 0;if(0===t&&1/t==-Infinity)return-0;if(t===Infinity)return Infinity;if(t===-Infinity)return-Infinity;var i=Math.pow(Math.abs(t),1/3);return t<0?-i:i});CreateMethodProperty(Math,"clz32",function t(r){var e=ToUint32(r);return e?32-e.toString(2).length:32});CreateMethodProperty(Math,"cosh",function n(t){if(isNaN(t))return NaN;if(0===t&&1/t===Infinity)return 1;if(0===t&&1/t==-Infinity)return 1;if(t===Infinity)return Infinity;if(t===-Infinity)return Infinity;if((t=Math.abs(t))>709){var i=Math.exp(.5*t);return i/2*i}var i=Math.exp(t);return(i+1/i)/2});CreateMethodProperty(Math,"expm1",function n(i){return isNaN(i)?NaN:0===i&&1/i===Infinity?0:0===i&&1/i==-Infinity?-0:i===Infinity?Infinity:i===-Infinity?-1:i>-1e-6&&i<1e-6?i+i*i/2:Math.exp(i)-1});CreateMethodProperty(Math,"fround",function(n){return isNaN(n)?NaN:1/n==+Infinity||1/n==-Infinity||n===+Infinity||n===-Infinity?n:new Float32Array([n])[0]});CreateMethodProperty(Math,"hypot",function t(n,r){if(0===arguments.length)return 0;for(var i=0,e=0,a=0;ae&&(i*=Math.pow(e/f,2),e=f),0===f&&0===e||(i+=Math.pow(f/e,2))}return e*Math.sqrt(i)});CreateMethodProperty(Math,"imul",function t(r,e){var n=ToUint32(r),o=ToUint32(e),i=n>>>16&65535,a=65535&n,u=o>>>16&65535,h=65535&o;return a*h+(i*h+a*u<<16>>>0)|0});CreateMethodProperty(Math,"log10",function t(e){return Math.log(e)/Math.LN10});CreateMethodProperty(Math,"log1p",function r(t){if(-1<(t=Number(t))&&t<1){for(var o=t,e=2;e<=300;e++)o+=Math.pow(-1,e-1)*Math.pow(t,e)/e;return o}return Math.log(1+t)});CreateMethodProperty(Math,"log2",function t(e){return Math.log(e)/Math.LN2});CreateMethodProperty(Math,"sign",function i(n){var n=Number(n);return isNaN(n)?NaN:1/n==-Infinity?-0:1/n===Infinity?0:n<0?-1:n>0?1:void 0});CreateMethodProperty(Math,"sinh",function r(t){var a=t<0?-1:1,e=Math.abs(t);if(e<22){if(en&&(r.length=n)}var r=A(n),o=0;return function(n,t){r[o++]=n,r[o++]=t,2===o&&rn.nextTick(e)}}function l(n,t){var e,r,u,c,f=0;if(!n)throw h(Q);var a=n[rn[q][z]];if(o(a))r=a.call(n);else{if(!o(n.next)){if(i(n,A)){for(e=n.length;f1114111)throw new RangeError("Invalid code point "+Object.prototype.toString.call(p));var c=UTF16Encoding(p);IsArray(c)?a=a.concat(c):a.push(c),i+=1,t.push(String.fromCharCode.apply(null,a))}return 0===n?"":t.join("")});CreateMethodProperty(String.prototype,"codePointAt",function e(t){var r=RequireObjectCoercible(this),o=ToString(r),n=ToInteger(t),i=o.length;if(n<0||n>=i)return undefined;var c=String.prototype.charCodeAt.call(o,n);if(c<55296||c>56319||n+1===i)return c;var a=String.prototype.charCodeAt.call(o,n+1);return a<56320||a>57343?c:UTF16Decode(c,a)});CreateMethodProperty(String.prototype,"endsWith",function e(t){"use strict";var r=arguments.length>1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n);if(IsRegExp(t))throw new TypeError("First argument to String.prototype.endsWith must not be a regular expression");var o=ToString(t),s=i.length,g=r===undefined?s:ToInteger(r),h=Math.min(Math.max(g,0),s),u=o.length,a=h-u;return!(a<0)&&i.substr(a,u)===o});CreateMethodProperty(String.prototype,"includes",function e(t){"use strict";var r=arguments.length>1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n);if(IsRegExp(t))throw new TypeError("First argument to String.prototype.includes must not be a regular expression");var o=ToString(t),g=ToInteger(r),a=i.length,p=Math.min(Math.max(g,0),a);return-1!==String.prototype.indexOf.call(i,o,p)});CreateMethodProperty(String.prototype,"padEnd",function e(r){"use strict";var t=arguments.length>1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n),o=ToLength(r),u=i.length;if(o<=u)return i;if(t===undefined)var d=" ";else var d=ToString(t);if(""===d)return i;for(var f=o-u,a="",g=0;g1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n),o=ToLength(r),u=i.length;if(o<=u)return i;if(t===undefined)var a=" ";else var a=ToString(t);if(""===a)return i;for(var f=o-u,d="",g=0;g1?arguments[1]:undefined,n=RequireObjectCoercible(this),i=ToString(n);if(IsRegExp(e))throw new TypeError("First argument to String.prototype.startsWith must not be a regular expression");var o=ToString(e),s=ToInteger(r),a=i.length,g=Math.min(Math.max(s,0),a);return!(o.length+g>a)&&0===i.substr(g).indexOf(e)});!function(t,r,n){"use strict";var e,o=0,u=""+Math.random(),l="__symbol:",c=l.length,a="__symbol@@"+u,i="defineProperty",f="defineProperties",s="getOwnPropertyNames",v="getOwnPropertyDescriptor",b="propertyIsEnumerable",h=t.prototype,y=h.hasOwnProperty,m=h[b],p=h.toString,g=Array.prototype.concat,w=t.getOwnPropertyNames?t.getOwnPropertyNames(window):[],d=t[s],S=function L(t){if("[object Window]"===p.call(t))try{return d(t)}catch(r){return g.call([],w)}return d(t)},P=t[v],j=t.create,O=t.keys,E=t.freeze||t,N=t[i],_=t[f],k=P(t,s),T=function(t,r,n){if(!y.call(t,a))try{N(t,a,{enumerable:!1,configurable:!1,writable:!1,value:{}})}catch(e){t[a]={}}t[a]["@@"+r]=n},z=function(t,r){var n=j(t);return S(r).forEach(function(t){M.call(r,t)&&G(n,t,r[t])}),n},A=function(t){var r=j(t);return r.enumerable=!1,r},D=function Q(){},F=function(t){return t!=a&&!y.call(x,t)},I=function(t){return t!=a&&y.call(x,t)},M=function R(t){var r=""+t;return I(r)?y.call(this,r)&&this[a]["@@"+r]:m.call(this,t)},W=function(r){var n={enumerable:!1,configurable:!0,get:D,set:function(t){e(this,r,{enumerable:!1,configurable:!0,writable:!0,value:t}),T(this,r,!0)}};try{N(h,r,n)}catch(o){h[r]=n.value}return E(x[r]=N(t(r),"constructor",B))},q=function U(){var t=arguments[0];if(this instanceof U)throw new TypeError("Symbol is not a constructor");return W(l.concat(t||"",u,++o))},x=j(null),B={value:q},C=function(t){return x[t]},G=function V(t,r,n){var o=""+r;return I(o)?(e(t,o,n.enumerable?A(n):n),T(t,o,!!n.enumerable)):N(t,r,n),t},H=function(t){return function(r){return y.call(t,a)&&y.call(t[a],"@@"+r)}},J=function X(t){return S(t).filter(t===h?H(t):I).map(C)};k.value=G,N(t,i,k),k.value=J,N(t,"getOwnPropertySymbols",k),k.value=function Y(t){return S(t).filter(F)},N(t,s,k),k.value=function Z(t,r){var n=J(r);return n.length?O(r).concat(n).forEach(function(n){M.call(r,n)&&G(t,n,r[n])}):_(t,r),t},N(t,f,k),k.value=M,N(h,b,k),k.value=q,N(n,"Symbol",k),k.value=function(t){var r=l.concat(l,t,u);return r in h?x[r]:W(r)},N(q,"for",k),k.value=function(t){if(F(t))throw new TypeError(t+" is not a symbol");return y.call(x,t)?t.slice(2*c,-u.length):void 0},N(q,"keyFor",k),k.value=function $(t,r){var n=P(t,r);return n&&I(r)&&(n.enumerable=M.call(t,r)),n},N(t,v,k),k.value=function(t,r){return 1===arguments.length||void 0===r?j(t):z(t,r)},N(t,"create",k);var K=null===function(){return this}.call(null);k.value=K?function(){var t=p.call(this);return"[object String]"===t&&I(this)?"[object Symbol]":t}:function(){if(this===window)return"[object Null]";var t=p.call(this);return"[object String]"===t&&I(this)?"[object Symbol]":t},N(h,"toString",k),e=function(t,r,n){var e=P(h,r);delete h[r],N(t,r,n),t!==h&&N(h,r,e)}}(Object,0,this);CreateMethodProperty(Reflect,"ownKeys",function e(t){if("object"!==Type(t))throw new TypeError(Object.prototype.toString.call(t)+" is not an Object");return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))});CreateMethodProperty(Object,"getOwnPropertyDescriptors",function e(r){for(var t=ToObject(r),o=Reflect.ownKeys(t),n={},c=o.length,a=0;a1?arguments[1]:GetMethod(t,Symbol.iterator),r=Call(e,t);if("object"!==Type(r))throw new TypeError("bad iterator");var o=GetV(r,"next"),a=Object.create(null);return a["[[Iterator]]"]=r,a["[[NextMethod]]"]=o,a["[[Done]]"]=!1,a}Object.defineProperty(Symbol,"match",{value:Symbol("match")});Object.defineProperty(Symbol,"replace",{value:Symbol("replace")});Object.defineProperty(Symbol,"search",{value:Symbol("search")});Object.defineProperty(Symbol,"species",{value:Symbol("species")});!function(e){function t(e,t){if("object"!==Type(e))throw new TypeError("createMapIterator called on incompatible receiver "+Object.prototype.toString.call(e));if(!0!==e._es6Map)throw new TypeError("createMapIterator called on incompatible receiver "+Object.prototype.toString.call(e));var r=Object.create(n);return Object.defineProperty(r,"[[Map]]",{configurable:!0,enumerable:!1,writable:!0,value:e}),Object.defineProperty(r,"[[MapNextIndex]]",{configurable:!0,enumerable:!1,writable:!0,value:0}),Object.defineProperty(r,"[[MapIterationKind]]",{configurable:!0,enumerable:!1,writable:!0,value:t}),r}var r=function(){try{var e={};return Object.defineProperty(e,"t",{configurable:!0,enumerable:!1,get:function(){return!0},set:undefined}),!!e.t}catch(t){return!1}}(),o=Symbol("undef"),a=function p(){if(!(this instanceof p))throw new TypeError('Constructor Map requires "new"');var e=OrdinaryCreateFromConstructor(this,p.prototype,{_keys:[],_values:[],_size:0,_es6Map:!0});r||Object.defineProperty(e,"size",{configurable:!0,enumerable:!1,writable:!0,value:0});var t=arguments.length>0?arguments[0]:undefined;if(null===t||t===undefined)return e;var o=e.set;if(!IsCallable(o))throw new TypeError("Map.prototype.set is not a function");try{for(var a=GetIterator(t);;){var n=IteratorStep(a);if(!1===n)return e;var i=IteratorValue(n);if("object"!==Type(i))try{throw new TypeError("Iterator value "+i+" is not an entry object")}catch(u){return IteratorClose(a,u)}try{var l=i[0],c=i[1];o.call(e,l,c)}catch(f){return IteratorClose(a,f)}}}catch(f){if(Array.isArray(t)||"[object Arguments]"===Object.prototype.toString.call(t)||t.callee){var y,s=t.length;for(y=0;y0?arguments[0]:undefined;if(null===t||t===undefined)return e;var o=e.add;if(!IsCallable(o))throw new TypeError("Set.prototype.add is not a function");try{for(var n=GetIterator(t);;){var a=IteratorStep(n);if(!1===a)return e;var i=IteratorValue(a);try{o.call(e,i)}catch(y){return IteratorClose(n,y)}}}catch(y){if(!Array.isArray(t)&&"[object Arguments]"!==Object.prototype.toString.call(t)&&!t.callee)throw y;var l,p=t.length;for(l=0;l1?arguments[1]:undefined;if(a===undefined)var n=!1;else{if(!1===IsCallable(a))throw new TypeError(Object.prototype.toString.call(a)+" is not a function.");var i=arguments.length>2?arguments[2]:undefined;if(i!==undefined)var l=i;else l=undefined;n=!0}var u=GetMethod(t,Symbol.iterator);if(u!==undefined){if(IsConstructor(o))var f=Construct(o);else f=ArrayCreate(0);for(var c=GetIterator(t,u),s=0;;){if(s>=Math.pow(2,53)-1){var h=new TypeError("Iteration count can not be greater than or equal 9007199254740991.");return IteratorClose(c,h)}var y=ToString(s),C=IteratorStep(c);if(!1===C)return f.length=s,f;var g=IteratorValue(C);if(n)try{var p=Call(a,l,[g,s])}catch(b){return IteratorClose(c,b)}else p=g;try{CreateDataPropertyOrThrow(f,y,p)}catch(b){return IteratorClose(c,b)}s+=1}}if(r(t))var v=e.call(t,/[\uD800-\uDBFF][\uDC00-\uDFFF]?|[^\uD800-\uDFFF]|./g)||[];else v=ToObject(t);var d=ToLength(Get(v,"length"));for(f=IsConstructor(o)?Construct(o,[d]):ArrayCreate(d),s=0;s=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void Object.defineProperty(this,"__redo__",{value:[e],configurable:!0,enumerable:!1,writable:!1});this.__redo__.forEach(function(t,_){t>=e&&(this.__redo__[_]=++t)},this),this.__redo__.push(e)}},configurable:!0,enumerable:!1,writable:!0},_onDelete:{value:function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(t=this.__redo__.indexOf(e),-1!==t&&this.__redo__.splice(t,1),this.__redo__.forEach(function(t,_){t>e&&(this.__redo__[_]=--t)},this)))},configurable:!0,enumerable:!1,writable:!0},_onClear:{value:function(){this.__redo__&&e.call(this.__redo__),this.__nextIndex__=0},configurable:!0,enumerable:!1,writable:!0}})),Object.defineProperty(_.prototype,Symbol.iterator,{value:function(){return this},configurable:!0,enumerable:!1,writable:!0}),Object.defineProperty(_.prototype,Symbol.toStringTag,{value:"Iterator",configurable:!1,enumerable:!1,writable:!0}),_}();var ArrayIterator=function(){var e=function(t,r){if(!(this instanceof e))return new e(t,r);Iterator.call(this,t),r=r?String.prototype.includes.call(r,"key+value")?"key+value":String.prototype.includes.call(r,"key")?"key":"value":"value",Object.defineProperty(this,"__kind__",{value:r,configurable:!1,enumerable:!1,writable:!1})};return Object.setPrototypeOf&&Object.setPrototypeOf(e,Iterator.prototype),e.prototype=Object.create(Iterator.prototype,{constructor:{value:e,configurable:!0,enumerable:!1,writable:!0},_resolve:{value:function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e},configurable:!0,enumerable:!1,writable:!0},toString:{value:function(){return"[object Array Iterator]"},configurable:!0,enumerable:!1,writable:!0}}),e}();CreateMethodProperty(Array.prototype,"entries",function r(){var r=ToObject(this);return new ArrayIterator(r,"key+value")});CreateMethodProperty(Array.prototype,"keys",function r(){var r=ToObject(this);return new ArrayIterator(r,"key")});"Symbol"in this&&"iterator"in Symbol&&"function"==typeof Array.prototype[Symbol.iterator]?CreateMethodProperty(Array.prototype,"values",Array.prototype[Symbol.iterator]):CreateMethodProperty(Array.prototype,"values",function r(){var r=ToObject(this);return new ArrayIterator(r,"value")});CreateMethodProperty(Array.prototype,Symbol.iterator,Array.prototype.values);var StringIterator=function(){var t=function(e){if(!(this instanceof t))return new t(e);e=String(e),Iterator.call(this,e),Object.defineProperty(this,"__length__",{value:e.length,configurable:!1,enumerable:!1,writable:!1})};return Object.setPrototypeOf&&Object.setPrototypeOf(t,Iterator),t.prototype=Object.create(Iterator.prototype,{constructor:{value:t,configurable:!0,enumerable:!1,writable:!0},_next:{value:function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r)},configurable:!0,enumerable:!1,writable:!0},toString:{value:function(){return"[object String Iterator]"},configurable:!0,enumerable:!1,writable:!0}}),t}();CreateMethodProperty(String.prototype,Symbol.iterator,function(){var r=RequireObjectCoercible(this),t=ToString(r);return new StringIterator(t)});Object.defineProperty(Symbol,"unscopables",{value:Symbol("unscopables")});!function(e){"use strict";function t(t){return!!t&&("Symbol"in e&&"iterator"in e.Symbol&&"function"==typeof t[Symbol.iterator]||!!Array.isArray(t))}function n(e){return"from"in Array?Array.from(e):Array.prototype.slice.call(e)}!function(){function r(e){var t="",n=!0;return e.forEach(function(e){var r=encodeURIComponent(e.name),a=encodeURIComponent(e.value);n||(t+="&"),t+=r+"="+a,n=!1}),t.replace(/%20/g,"+")}function a(e,t){var n=e.split("&");t&&-1===n[0].indexOf("=")&&(n[0]="="+n[0]);var r=[];n.forEach(function(e){if(0!==e.length){var t=e.indexOf("=");if(-1!==t)var n=e.substring(0,t),a=e.substring(t+1);else n=e,a="";n=n.replace(/\+/g," "),a=a.replace(/\+/g," "),r.push({name:n,value:a})}});var a=[];return r.forEach(function(e){a.push({name:decodeURIComponent(e.name),value:decodeURIComponent(e.value)})}),a}function i(e){if(c)return new s(e);var t=document.createElement("a");return t.href=e,t}function o(e){var i=this;this._list=[],e===undefined||null===e||(e instanceof o?this._list=a(String(e)):"object"==typeof e&&t(e)?n(e).forEach(function(e){if(!t(e))throw TypeError();var r=n(e);if(2!==r.length)throw TypeError();i._list.push({name:String(r[0]),value:String(r[1])})}):"object"==typeof e&&e?Object.keys(e).forEach(function(t){i._list.push({name:String(t),value:String(e[t])})}):(e=String(e),"?"===e.substring(0,1)&&(e=e.substring(1)),this._list=a(e))),this._url_object=null,this._setList=function(e){u||(i._list=e)};var u=!1;this._update_steps=function(){u||(u=!0,i._url_object&&("about:"===i._url_object.protocol&&-1!==i._url_object.pathname.indexOf("?")&&(i._url_object.pathname=i._url_object.pathname.split("?")[0]),i._url_object.search=r(i._list),u=!1))}}function u(e,t){var n=0;this.next=function(){if(n>=e.length)return{done:!0,value:undefined};var r=e[n++];return{done:!1,value:"key"===t?r.name:"value"===t?r.value:[r.name,r.value]}}}function l(t,n){function r(){var e=l.href.replace(/#$|\?$|\?(?=#)/g,"");l.href!==e&&(l.href=e)}function u(){m._setList(l.search?a(l.search.substring(1)):[]),m._update_steps()}if(!(this instanceof e.URL))throw new TypeError("Failed to construct 'URL': Please use the 'new' operator.");n&&(t=function(){if(c)return new s(t,n).href;var e;try{var r;if("[object OperaMini]"===Object.prototype.toString.call(window.operamini)?(e=document.createElement("iframe"),e.style.display="none",document.documentElement.appendChild(e),r=e.contentWindow.document):document.implementation&&document.implementation.createHTMLDocument?r=document.implementation.createHTMLDocument(""):document.implementation&&document.implementation.createDocument?(r=document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),r.documentElement.appendChild(r.createElement("head")),r.documentElement.appendChild(r.createElement("body"))):window.ActiveXObject&&(r=new window.ActiveXObject("htmlfile"),r.write(""),r.close()),!r)throw Error("base not supported");var a=r.createElement("base");a.href=n,r.getElementsByTagName("head")[0].appendChild(a);var i=r.createElement("a");return i.href=t,i.href}finally{e&&e.parentNode.removeChild(e)}}());var l=i(t||""),f=function(){if(!("defineProperties"in Object))return!1;try{var e={};return Object.defineProperties(e,{prop:{get:function(){return!0}}}),e.prop}catch(t){return!1}}(),h=f?this:document.createElement("a"),m=new o(l.search?l.search.substring(1):null);return m._url_object=h,Object.defineProperties(h,{href:{get:function(){return l.href},set:function(e){l.href=e,r(),u()},enumerable:!0,configurable:!0},origin:{get:function(){return"origin"in l?l.origin:this.protocol+"//"+this.host},enumerable:!0,configurable:!0},protocol:{get:function(){return l.protocol},set:function(e){l.protocol=e},enumerable:!0,configurable:!0},username:{get:function(){return l.username},set:function(e){l.username=e},enumerable:!0,configurable:!0},password:{get:function(){return l.password},set:function(e){l.password=e},enumerable:!0,configurable:!0},host:{get:function(){var e={"http:":/:80$/,"https:":/:443$/,"ftp:":/:21$/}[l.protocol];return e?l.host.replace(e,""):l.host},set:function(e){l.host=e},enumerable:!0,configurable:!0},hostname:{get:function(){return l.hostname},set:function(e){l.hostname=e},enumerable:!0,configurable:!0},port:{get:function(){return l.port},set:function(e){l.port=e},enumerable:!0,configurable:!0},pathname:{get:function(){return"/"!==l.pathname.charAt(0)?"/"+l.pathname:l.pathname},set:function(e){l.pathname=e},enumerable:!0,configurable:!0},search:{get:function(){return l.search},set:function(e){l.search!==e&&(l.search=e,r(),u())},enumerable:!0,configurable:!0},searchParams:{get:function(){return m},enumerable:!0,configurable:!0},hash:{get:function(){return l.hash},set:function(e){l.hash=e,r()},enumerable:!0,configurable:!0},toString:{value:function(){return l.toString()},enumerable:!1,configurable:!0},valueOf:{value:function(){return l.valueOf()},enumerable:!1,configurable:!0}}),h}var c,s=e.URL;try{if(s){if("searchParams"in(c=new e.URL("http://example.com"))){var f=new l("http://example.com");if(f.search="a=1&b=2","http://example.com/?a=1&b=2"===f.href&&(f.search="","http://example.com/"===f.href))return}"href"in c||(c=undefined),c=undefined}}catch(m){}if(Object.defineProperties(o.prototype,{append:{value:function(e,t){this._list.push({name:e,value:t}),this._update_steps()},writable:!0,enumerable:!0,configurable:!0},"delete":{value:function(e){for(var t=0;t1?arguments[1]:undefined;this._list.forEach(function(n){e.call(t,n.value,n.name)})},writable:!0,enumerable:!0,configurable:!0},toString:{value:function(){return r(this._list)},writable:!0,enumerable:!1,configurable:!0}}),"Symbol"in e&&"iterator"in e.Symbol&&(Object.defineProperty(o.prototype,e.Symbol.iterator,{value:o.prototype.entries,writable:!0,enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,e.Symbol.iterator,{value:function(){return this},writable:!0,enumerable:!0,configurable:!0})),s)for(var h in s)s.hasOwnProperty(h)&&"function"==typeof s[h]&&(l[h]=s[h]);e.URL=l,e.URLSearchParams=o}(),function(){if("1"!==new e.URLSearchParams([["a",1]]).get("a")||"1"!==new e.URLSearchParams({a:1}).get("a")){var r=e.URLSearchParams;e.URLSearchParams=function(e){if(e&&"object"==typeof e&&t(e)){var a=new r;return n(e).forEach(function(e){if(!t(e))throw TypeError();var r=n(e);if(2!==r.length)throw TypeError();a.append(r[0],r[1])}),a}return e&&"object"==typeof e?(a=new r,Object.keys(e).forEach(function(t){a.set(t,e[t])}),a):new r(e)}}}()}(self);!function(e){var t=Symbol("undef"),r=function a(){if(!(this instanceof a))throw new TypeError('Constructor WeakMap requires "new"');var e=OrdinaryCreateFromConstructor(this,a.prototype,{_keys:[],_values:[],_es6WeakMap:!0}),t=arguments.length>0?arguments[0]:undefined;if(null===t||t===undefined)return e;var r=Get(e,"set");if(!IsCallable(r))throw new TypeError("WeakMap.prototype.set is not a function");try{for(var o=GetIterator(t);;){var p=IteratorStep(o);if(!1===p)return e;var n=IteratorValue(p);if("object"!==Type(n))try{throw new TypeError("Iterator value "+n+" is not an entry object")}catch(s){return IteratorClose(o,s)}try{var i=Get(n,"0"),l=Get(n,"1");Call(r,e,[i,l])}catch(u){return IteratorClose(o,u)}}}catch(u){if(Array.isArray(t)||"[object Arguments]"===Object.prototype.toString.call(t)||t.callee){var y,c=t.length;for(y=0;y0?arguments[0]:undefined;if(null===t||t===undefined)return e;var r=Get(e,"add");if(!IsCallable(r))throw new TypeError("WeakSet.prototype.add is not a function");try{for(var o=GetIterator(t);;){var n=IteratorStep(o);if(!1===n)return e;var l=IteratorValue(n);try{Call(r,e,[l])}catch(c){return IteratorClose(o,c)}}}catch(c){if(IsArray(t)||"[object Arguments]"===Object.prototype.toString.call(t)||t.callee){var i,p=t.length;for(i=0;i + + + + + title + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/login/login.js b/designer-base/src/main/resources/com/fr/design/login/login.js new file mode 100644 index 000000000..8691cf1e5 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/login/login.js @@ -0,0 +1 @@ +!function(e){var t={};function i(o){if(t[o])return t[o].exports;var s=t[o]={i:o,l:!1,exports:{}};return e[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=t,i.d=function(e,t,o){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(o,s,function(t){return e[t]}.bind(null,s));return o},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=4)}([function(e,t,i){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,i,o){o===undefined&&(o=i),Object.defineProperty(e,o,{enumerable:!0,get:function(){return t[i]}})}:function(e,t,i,o){o===undefined&&(o=i),e[o]=t[i]}),s=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||t.hasOwnProperty(i)||o(t,e,i)};Object.defineProperty(t,"__esModule",{value:!0}),s(i(5),t)},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=window.DesignerLoginHelper,s=function(){function e(){}return e.prototype.getParams=function(){return{designerLoginSource:window.designerLoginSource||"0",lastLoginType:window.lastLoginType||"-1",lastLoginAccount:window.lastLoginAccount||""}},e.prototype.closeWindow=function(e){o&&o.closeWindow(e)},e.prototype.serviceHref=function(){o?o.serviceHref():window.open("https://bbs.fanruan.com/thread-102821-1-1.html")},e.prototype.forgetHref=function(){o?o.forgetHref():window.open("https://id.fanruan.com/forget/forget.php?clue=activityf")},e.prototype.normalLogin=function(e,t,i){o?o.normalLogin(e,t,i):i(-1)},e.prototype.sendCaptcha=function(e,t,i){o?o.sendCaptcha(e,t,i):i(-1)},e.prototype.smsLogin=function(e,t,i,s){o?o.smsLogin(e,t,i,s):s(null)},e.prototype.smsRegister=function(e,t,i,s,n){o?o.smsRegister(e,t,i,s,n):n(-1)},e.prototype.resize=function(e,t){o&&o.resize(e,t)},e}();t["default"]=new s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BBS_ERROR_CODE=t.NORMAL_LOGIN_RESULT=t.REGION=t.LOGIN=void 0,t.LOGIN={NORMAL_METHOD:"normal",SMS_METHOD:"sms",TABS:{LOGIN:"login",FORGET_PASSWORD:"forget",RESET_PASSWORD:"reset",REGISTER:"register"}},t.REGION=[{value:"+86",text:"Designer-Basic_Chinese_Mainland"},{value:"+886",text:"Designer-Basic_Chinese_Taiwan"},{value:"+852",text:"Designer-Basic_Chinese_Hong_Kong"},{value:"+853",text:"Designer-Basic_Chinese_Macao"},{value:"+90",text:"Designer-Basic_Turkey"},{value:"+82",text:"Designer-Basic_South_Korea"},{value:"+81",text:"Designer-Basic_Japan"},{value:"+65",text:"Designer-Basic_Singapore"},{value:"+60",text:"Designer-Basic_Malaysia"}],t.NORMAL_LOGIN_RESULT=[{status:0,message:"Designer-Login_Internal_Error"},{status:-1,message:"Designer-Login_Store_User_Not_Exist"},{status:-2,message:"Designer-Login_Store_User_Password_Error"},{status:-3,message:"Designer-Login_Unexpected_Error"},{status:-4,message:"Designer-Login_Network_Connected_Failed"}],t.BBS_ERROR_CODE=[{status:0,message:"Designer-Login_Internal_Error"},{status:-1,message:"Designer-BBS_Register_Timeout"},{status:-2,message:"Designer-BBS_Phone_Is_Register"},{status:-3,message:"Designer-BBS_Captcha_Send_Exceed_Limit"},{status:-4,message:"Designer-BBS_Phone_Format_Error"},{status:-100,message:"Designer-BBS_Captcha_Out_Of_Date"},{status:-101,message:"Designer-BBS_Captcha_Try_Exceed_Limit"},{status:-102,message:"Designer-BBS_Captcha_Error"},{status:-104,message:"Designer-BBS_Username_Format_Error"},{status:-103,message:"Designer-BBS_Please_Enter_Correct_Phone"},{status:-105,message:"Designer-BBS_Username_Too_Short"},{status:-106,message:"Designer-BBS_Username_Too_Long"},{status:-107,message:"Designer-BBS_Phone_Is_Register"},{status:-108,message:"Designer-BBS_Username_Is_Register"}]},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getError=void 0,t.getError=function(e,t){var i=BI.find(e,(function(e,i){return i.status===t}));return i&&i.message?i.message:""}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(6);BI.addI18n(Store.i18n),BI.createWidget({type:o.Vertical,element:"body",items:[{type:s["default"]}]})},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListView=t.VirtualGroup=t.LeftRightVerticalAdapt=t.Left=t.Horizontal=t.Vertical=t.Absolute=t.Layout=t.Htape=t.CenterAdapt=t.Vtape=t.HorizontalAdapt=t.VerticalAdapt=t.BubbleCombo=t.Img=t.Tab=t.SingleSelectInsertCombo=t.SingleSelectRadioItem=t.MultiTreePopupView=t.Editor=t.NicEditor=t.RichEditor=t.MultiTreeCombo=t.DynamicDateTimeCombo=t.DynamicDateCombo=t.BarPopOver=t.MultiSelectItem=t.TextAreaEditor=t.AllValueChooserCombo=t.ButtonGroup=t.MultiSelectInsertCombo=t.TextEditor=t.Button=t.SignEditor=t.MultiFileEditor=t.SmallTextEditor=t.HtmlLabel=t.Label=t.DownListCombo=t.TextButton=t.IconChangeButton=t.IconButton=t.IconTextIconItem=t.IconTextItem=void 0,t.IconTextItem="bi.icon_text_item",t.IconTextIconItem="bi.icon_text_icon_item",t.IconButton="bi.icon_button",t.IconChangeButton="bi.icon_change_button",t.TextButton="bi.text_button",t.DownListCombo="bi.down_list_combo",t.Label="bi.label",t.HtmlLabel="bi.html_label",t.SmallTextEditor="bi.small_text_editor",t.MultiFileEditor="bi.multifile_editor",t.SignEditor="bi.sign_editor",t.Button="bi.button",t.TextEditor="bi.text_editor",t.MultiSelectInsertCombo="bi.multi_select_insert_combo",t.ButtonGroup="bi.button_group",t.AllValueChooserCombo="bi.all_value_chooser_combo",t.TextAreaEditor="bi.textarea_editor",t.MultiSelectItem="bi.multi_select_item",t.BarPopOver="bi.bar_popover",t.DynamicDateCombo="bi.dynamic_date_combo",t.DynamicDateTimeCombo="bi.dynamic_date_time_combo",t.MultiTreeCombo="bi.multi_tree_combo",t.RichEditor="bi.rich_editor",t.NicEditor="bi.nic_editor",t.Editor="bi.editor",t.MultiTreePopupView="bi.multi_tree_popup_view",t.SingleSelectRadioItem="bi.single_select_radio_item",t.SingleSelectInsertCombo="bi.single_select_insert_combo",t.Tab="bi.tab",t.Img="bi.img",t.BubbleCombo="bi.bubble_combo",t.VerticalAdapt="bi.vertical_adapt",t.HorizontalAdapt="bi.horizontal_adapt",t.Vtape="bi.vtape",t.CenterAdapt="bi.center_adapt",t.Htape="bi.htape",t.Layout="bi.layout",t.Absolute="bi.absolute",t.Vertical="bi.vertical",t.Horizontal="bi.horizontal",t.Left="bi.left",t.LeftRightVerticalAdapt="bi.left_right_vertical_adapt",t.VirtualGroup="bi.virtual_group",t.ListView="bi.list_view"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0),s=i(7),n=i(8),r=i(9),a=i(11);i(25),t.className="designer.login.login",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login",width:420},_store:function(){return BI.Models.getModel(s["default"])},watch:{loading:function(e){this.loading.setVisible(e)}},render:function(){return{type:o.Vertical,cls:"designer-login",items:[{el:{type:o.HorizontalAdapt,items:[{type:n["default"],rgap:14,tgap:14}]}},{el:{type:o.Vertical,items:[{type:r["default"]},{type:a["default"]}]},lgap:15,rgap:15,bgap:15}]}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});BI.model("designer.login.login.model",BI.inherit(Fix.Model,{childContext:["loading"],state:function(){return{loading:!1}}})),t["default"]="designer.login.login.model"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0),s=i(1);t.className="designer.login.login.close.button",t.Widget=BI.inherit(BI.Widget,{render:function(){return{type:o.TextButton,text:String.fromCharCode(10005),cls:"background-login-close",width:18.38,height:18.38,handler:function(){s["default"].closeWindow(!1)}}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0);i(10),t.className="designer.login.login.title",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-title"},render:function(){return{type:o.Label,text:BI.i18nText("Designer-Login_Title"),cls:"bi-font-bold",bgap:10}}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0),s=i(12);i(13);var n=i(14),r=i(16),a=i(18),l=i(2),u=i(1),d=249.64,g=331.64,c=422,p=478,h=560;t.className="designer.login.login.body",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(s["default"])},watch:{loginMethod:function(e){this.tabOption.setValue(e),this.tab.setSelect(e),this.foot.setLoginMethod(e),this.refreshLoginButton(),e===l.LOGIN.NORMAL_METHOD?(this.tab.setHeight(d),u["default"].resize(c,p)):this.model.expand&&(u["default"].resize(c,h),this.tab.setHeight(g))},approve:function(e){this.refreshLoginButton()},expand:function(e){e&&(u["default"].resize(c,h),this.tab.setHeight(g))}},render:function(){var e=this;return{type:o.Vertical,cls:"designer-login-body",items:[{type:o.ButtonGroup,value:this.model.loginMethod,ref:function(t){e.tabOption=t},layouts:[{type:o.HorizontalAdapt}],items:[{cls:"designer-login-change-mode bi-list-item-effect bi-border-bottom bi-font-bold",width:70,height:28,value:l.LOGIN.SMS_METHOD,text:BI.i18nText("Designer-Login_Sms")},{cls:"designer-login-change-mode bi-list-item-effect bi-border-bottom bi-font-bold",width:70,height:28,value:l.LOGIN.NORMAL_METHOD,text:BI.i18nText("Designer-Login_Normal")}],listeners:[{eventName:BI.ButtonGroup.EVENT_CHANGE,action:function(t){e.store.setLoginMethod(t)}}],tgap:24,lgap:75,rgap:75},{type:o.CenterAdapt,tgap:35,items:[{type:o.Tab,cardCreator:BI.bind(this.createCard,this),showIndex:this.model.loginMethod,ref:function(t){e.tab=t},height:d,width:280}]},{type:n["default"],lgap:50,rgap:50,bgap:30,ref:function(t){e.foot=t},refreshStatus:function(t){e.store.setApprove(t)}}]}},mounted:function(){var e=u["default"].getParams(),t=e.designerLoginSource,i=e.lastLoginType;if("2"===t){var o="0"===i?l.LOGIN.NORMAL_METHOD:l.LOGIN.SMS_METHOD;this.store.setLoginMethod(o)}},createCard:function(e){var t=this;switch(e){case l.LOGIN.NORMAL_METHOD:return{type:r["default"],ref:function(e){t.normalMethod=e}};case l.LOGIN.SMS_METHOD:default:return{type:a["default"],ref:function(e){t.smsMethod=e},expand:function(){t.store.setExpand(!0)}}}},refreshLoginButton:function(){this.model.loginMethod===l.LOGIN.NORMAL_METHOD?this.normalMethod.setApprove(this.model.approve):this.smsMethod.setApprove(this.model.approve)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0;var o=i(2);t.className="designer.login.model.login.body",t.Model=BI.inherit(Fix.Model,{context:["loading"],state:function(){return{loginMethod:o.LOGIN.SMS_METHOD,approve:!0,expand:!1}},actions:{setLoginMethod:function(e){this.model.loginMethod=e},setApprove:function(e){this.model.approve=e},setExpand:function(e){this.model.expand=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(1),s=i(0);i(15);var n=i(2);t.className="designer.login.login.foot",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-foot"},render:function(){var e=this,t=this.options;return{type:s.LeftRightVerticalAdapt,items:{left:[{type:s.MultiSelectItem,width:30,selected:!0,handler:function(){t.refreshStatus(this.isSelected())}},{type:s.Label,cls:"login-foot-text",textAlign:"left",text:BI.i18nText("Designer-Login_I_Have_Read")},{type:s.Label,cls:"login-foot-text",textAlign:"left",text:"《"},{type:s.TextButton,cls:"login-link",textAlign:"left",text:BI.i18nText("Designer-Login_Service_Terms"),handler:function(){o["default"].serviceHref()}},{type:s.Label,cls:"login-foot-text",textAlign:"left",text:"》"}],right:[{type:s.TextButton,cls:"login-link",textAlign:"right",text:BI.i18nText("Designer-Login_Forget_Password"),invisible:!0,tgap:2,ref:function(t){e.forgetPassword=t},handler:function(){o["default"].forgetHref()}}]}}},setLoginMethod:function(e){e===n.LOGIN.NORMAL_METHOD?this.forgetPassword.setVisible(!0):this.forgetPassword.setVisible(!1)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0),s=i(3),n=i(1),r=i(17),a=i(2);t.className="designer.login.login.normal",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(r["default"])},watch:{errMessage:function(e){this.errMessage.setText(e)}},render:function(){var e=this;return{type:o.Vertical,items:[{type:o.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_User_Name"),bgap:3},{type:o.Editor,cls:"bi-border-bottom designer-login-editor-username",watermark:BI.i18nText("Designer-Login_User_Name_Hint"),inputType:"text",allowBlank:!0,height:40,ref:function(t){e.userName=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:o.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Password"),bgap:3},{type:o.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Password_Hint"),inputType:"password",allowBlank:!0,height:40,ref:function(t){e.password=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:o.Label,cls:"designer-login-error-message",textAlign:"center",text:"",height:20,bgap:10,ref:function(t){e.errMessage=t}},{type:o.Button,cls:"login-login-button bi-font-bold",text:BI.i18nText("Designer-Login"),level:"common",height:40,ref:function(t){e.loginButton=t},handler:function(){e.login()}}]}},mounted:function(){var e=this;this.element.keyup((function(t){13===t.keyCode&&e.login()}));var t=n["default"].getParams(),i=t.designerLoginSource,o=t.lastLoginType,s=t.lastLoginAccount;"2"===i&&"0"===o&&e.userName.setValue(s)},checkUsername:function(){var e=this.userName.getValue();e&&this.userName.setValue(e.replace(/\s+/g,""))},login:function(){var e=this;e.checkUsername();var t=this.userName.getValue(),i=this.password.getValue();t?i?n["default"].normalLogin(t,i,(function(t){var i=parseInt(t,10);if(i>0)n["default"].closeWindow(!0);else{var o=s.getError(a.NORMAL_LOGIN_RESULT,i);o&&e.store.setErrMessage(BI.i18nText(o))}})):this.store.setErrMessage(BI.i18nText("Designer-Login_Password_Not_Null")):this.store.setErrMessage(BI.i18nText("Designer-Login_Username_Not_Null"))},setApprove:function(e){this.loginButton.setEnable(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0,t.className="designer.login.model.normal_method",t.Model=BI.inherit(Fix.Model,{context:[""],state:function(){return{errMessage:""}},actions:{setErrMessage:function(e){this.model.errMessage=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0),s=i(19),n=i(22),r=i(23),a=i(2),l=i(24),u=i(1),d=i(3);t.className="designer.login.login.sms",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},_store:function(){return BI.Stores.getStore(l["default"])},watch:{errMessage:function(e){this.errMessage.setText(e)},isRegister:function(e){var t=this.options;e&&(t.expand(),this.password.setVisible(!0),this.passwordLabel.setVisible(!0))}},render:function(){var e=this,t=this;return{type:o.Vertical,items:[{type:o.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Phone"),bgap:3},{type:o.HorizontalAdapt,bgap:7,items:[{type:s["default"],height:42,textFormatter:function(e){var i=t.getNumberTypeItem(e);return{value:i.value,text:BI.i18nText(i.text)}},value:a.REGION[0].value,items:BI.map(a.REGION,(function(e,t){return{type:n["default"],value:t.value,label:BI.i18nText(t.text),text:t.value}})),ref:function(t){e.regionCode=t}},{type:o.Editor,cls:"bi-border-bottom designer-login-editor-username",watermark:BI.i18nText("Designer-Login_Phone_Hint"),inputType:"text",allowBlank:!0,height:40,ref:function(t){e.phone=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]}]},{type:o.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Code"),bgap:3},{type:o.Horizontal,bgap:7,items:[{type:o.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Code_Hint"),inputType:"text",allowBlank:!0,height:40,width:190,ref:function(t){e.code=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:r["default"],height:40,width:90,ref:function(t){e.accountCaptcha=t},listeners:[{eventName:"EVENT_SEND",action:function(){t.sendCaptcha()}}]}]},{type:o.Label,textAlign:"left",cls:"designer-login-text",text:BI.i18nText("Designer-Login_Password"),bgap:3,invisible:!0,ref:function(t){e.passwordLabel=t}},{type:o.Editor,cls:"bi-border-bottom designer-login-editor-password",watermark:BI.i18nText("Designer-Login_Password_Setting_Hint"),inputType:"password",allowBlank:!0,height:40,invisible:!0,ref:function(t){e.password=t},listeners:[{eventName:"EVENT_CHANGE",action:function(){e.store.setErrMessage("")}}]},{type:o.Label,cls:"designer-login-error-message",textAlign:"center",text:"",height:20,bgap:11,ref:function(t){e.errMessage=t}},{type:o.Button,cls:"login-login-button bi-font-bold",text:BI.i18nText("Designer-Login_Register_Or_Login"),level:"common",height:40,ref:function(t){e.loginButton=t},handler:function(){e.login()}}]}},mounted:function(){var e=this;this.element.keyup((function(t){13===t.keyCode&&e.login()}));var t=u["default"].getParams(),i=t.designerLoginSource,o=t.lastLoginType,s=t.lastLoginAccount;if("2"===i&&"1"===o){var n=s.split("-")[0],r=s.split("-")[1];e.regionCode.setValue(n),e.phone.setValue(r)}},getNumberTypeItem:function(e){return BI.find(a.REGION,(function(t,i){return e===i.value}))||{}},checkPhone:function(){var e=this.phone.getValue();e&&this.phone.setValue(e.replace(/\s+/g,""))},login:function(){var e=this,t=this;t.checkPhone();var i=this.phone.getValue(),o=this.code.getValue();if(i)if(o)if(6==o.length){var s=this.regionCode.getValue();if(this.model.isRegister){var n=this.password.getValue();if(!n)return void this.store.setErrMessage(BI.i18nText("Designer-Login_Password_Not_Null"));var r=this.model.regToken;if(!r)return void this.store.setErrMessage(BI.i18nText("Designer-Login_Token_Request_Failed"));u["default"].smsRegister(s,i,n,r,(function(e){var i=parseInt(e,10);if(i>0)u["default"].closeWindow(!0);else{var o=d.getError(a.BBS_ERROR_CODE,i);o&&t.store.setErrMessage(BI.i18nText(o))}}))}else u["default"].smsLogin(s,i,o,(function(i){var o=JSON.parse(i);if(o.status>0)if(!0===o.register){var s=o.regtoken;s?(t.store.setRegister(!0),t.store.setRegToken(s)):e.store.setErrMessage(BI.i18nText("Designer-Login_Token_Request_Failed"))}else u["default"].closeWindow(!0);else{var n=d.getError(a.BBS_ERROR_CODE,o.status);n&&t.store.setErrMessage(BI.i18nText(n))}}))}else this.store.setErrMessage(BI.i18nText("Designer-BBS_Captcha_Error"));else this.store.setErrMessage(BI.i18nText("Designer-Login_Code_Not_Null"));else this.store.setErrMessage(BI.i18nText("Designer-Login_Phone_Not_Null"))},sendCaptcha:function(){var e=this;e.checkPhone();var t=this.phone.getValue();if(!t)return e.accountCaptcha.setButtonEnable(!0),void this.store.setErrMessage(BI.i18nText("Designer-Login_Phone_Not_Null"));var i=this.regionCode.getValue();u["default"].sendCaptcha(i,t,(function(t){var i=parseInt(t,10);if(1===i)e.accountCaptcha.regainCaptcha();else{if(e.accountCaptcha.setButtonEnable(!0),0===i)return void e.store.setErrMessage(BI.i18nText("Designer-BBS_Please_Enter_Correct_Phone"));var o=d.getError(a.BBS_ERROR_CODE,i);o&&e.store.setErrMessage(BI.i18nText(o))}}))},setApprove:function(e){this.loginButton.setEnable(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(20),s=i(21);t.className="designer.left_right_text_value_combo",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"",height:24,chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,textFormatter:function(e){return e},value:""},render:function(){var e=this,t=this.options;return{type:s["default"],container:t.container,adjustLength:2,ref:function(t){e.combo=t},el:{type:o["default"],cls:"text-value-trigger",items:t.items,height:t.height-2,value:t.textFormatter(t.value),ref:function(t){e.trigger=t}},popup:{el:{type:"bi.text_value_combo_popup",chooseType:t.chooseType,value:t.value,items:t.items,ref:function(t){e.popup=t},listeners:[{eventName:BI.TextValueComboPopup.EVENT_CHANGE,action:function(){e.setValue(e.getValue()),e.combo.hideView(),e.fireEvent("EVENT_CHANGE",arguments)}},{eventName:BI.Controller.EVENT_CHANGE,action:function(){e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)}}]},value:t.value,maxHeight:240,minHeight:25}}},setValue:function(e){this.combo.setValue(e),this.trigger.setValue(this.options.textFormatter(e))},getValue:function(){var e=this.combo.getValue();return BI.isNull(e)?"":BI.isArray(e)?e[0]:e},populate:function(e){this.options.items=e,this.combo.populate(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0,t.className="designer.left_right_text_value_combo_trigger",t.Widget=BI.inherit(BI.Trigger,{props:{baseCls:"",value:{}},render:function(){var e=this,t=this.options,i=t.value;return{type:"bi.htape",cls:"bi-border-bottom bi-border-radius",items:[{type:"bi.label",text:i.text,title:function(){return e.textRow.getText()},height:t.height,hgap:3,textAlign:"left",ref:function(t){e.textRow=t}},{type:"bi.label",text:i.value,height:t.height,width:32,textAlign:"right",ref:function(t){e.valueRow=t}},{type:"bi.trigger_icon_button",width:t.triggerWidth||t.height}]}},setValue:function(e){this.textRow.setText(e.text),this.valueRow.setText(e.value)},setText:function(e){this.textRow.setText(e)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o={};t.className="designer.login_combo",t.Widget=BI.inherit(BI.Widget,{_defaultConfig:function(){var e=BI.Combo.superclass._defaultConfig.apply(this,arguments);return BI.extend(e,{baseCls:(e.baseCls||"")+" bi-combo"+(BI.isIE()?" hack":""),attributes:{tabIndex:-1},trigger:"click",toggle:!0,direction:"bottom",logic:{dynamic:!0},container:null,isDefaultInit:!1,destroyWhenHide:!1,hideWhenAnotherComboOpen:!1,isNeedAdjustHeight:!0,isNeedAdjustWidth:!0,stopEvent:!1,stopPropagation:!1,adjustLength:0,adjustXOffset:0,adjustYOffset:0,hideChecker:BI.emptyFn,offsetStyle:"left",el:{},popup:{},comboClass:"bi-combo-popup",hoverClass:"bi-combo-hover",belowMouse:!1})},_init:function(){BI.Combo.superclass._init.apply(this,arguments);var e=this,t=this.options;this._initCombo(),this._initPullDownAction(),this.combo.on(BI.Controller.EVENT_CHANGE,(function(t,i,o){e.isEnabled()&&e.isValid()&&(t===BI.Events.EXPAND&&e._popupView(),t===BI.Events.COLLAPSE&&e._hideView(),t===BI.Events.EXPAND&&(e.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e.fireEvent(BI.Combo.EVENT_EXPAND)),t===BI.Events.COLLAPSE&&(e.fireEvent(BI.Controller.EVENT_CHANGE,arguments),e.isViewVisible()&&e.fireEvent(BI.Combo.EVENT_COLLAPSE)),t===BI.Events.CLICK&&e.fireEvent(BI.Combo.EVENT_TRIGGER_CHANGE,o))})),e.element.on("mouseenter."+e.getName(),(function(i){e.isEnabled()&&e.isValid()&&e.combo.isEnabled()&&e.combo.isValid()&&e.element.addClass(t.hoverClass)})),e.element.on("mouseleave."+e.getName(),(function(i){e.isEnabled()&&e.isValid()&&e.combo.isEnabled()&&e.combo.isValid()&&e.element.removeClass(t.hoverClass)})),BI.createWidget(BI.extend({element:this},BI.LogicFactory.createLogic("vertical",BI.extend(t.logic,{items:[{el:this.combo}]})))),t.isDefaultInit&&this._assertPopupView(),BI.Resizers.add(this.getName(),BI.bind((function(e){this.isViewVisible()&&(BI.isNotNull(e)?this._hideIf(e):this._hideView())}),this))},_toggle:function(e){this._assertPopupViewRender(),this.popupView.isVisible()?this._hideView(e):this.isEnabled()&&this._popupView(e)},_initPullDownAction:function(){var e=this,t=this.options,i=(this.options.trigger||"").split(","),o=function(e){t.stopEvent&&e.stopEvent(),t.stopPropagation&&e.stopPropagation()},s=!1;function n(i){e.isEnabled()&&e.isValid()&&e.combo.isEnabled()&&e.combo.isValid()&&!0===t.toggle&&(e._hideView(i),e.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",e.combo),e.fireEvent(BI.Combo.EVENT_COLLAPSE)),e.popupView&&e.popupView.element.off("mouseenter."+e.getName()).off("mouseleave."+e.getName()),s=!1}BI.each(i,(function(i,r){switch(r){case"hover":e.element.on("mouseenter."+e.getName(),(function(t){e.isEnabled()&&e.isValid()&&e.combo.isEnabled()&&e.combo.isValid()&&(e._popupView(t),e.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",e.combo),e.fireEvent(BI.Combo.EVENT_EXPAND))})),e.element.on("mouseleave."+e.getName(),(function(t){e.popupView&&(e.popupView.element.on("mouseenter."+e.getName(),(function(t){s=!0,e.popupView.element.on("mouseleave."+e.getName(),(function(e){n(e)})),e.popupView.element.off("mouseenter."+e.getName())})),BI.defer((function(){s||n(t)}),50))}));break;case"click":var a=BI.debounce((function(i){e.isEnabled()&&e.isValid()&&e.combo.isEnabled()&&e.combo.isValid()&&(t.toggle?e._toggle(i):e._popupView(i),e.isViewVisible()?(e.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",e.combo),e.fireEvent(BI.Combo.EVENT_EXPAND)):(e.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.COLLAPSE,"",e.combo),e.fireEvent(BI.Combo.EVENT_COLLAPSE)))}),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});e.element.off(r+"."+e.getName()).on(r+"."+e.getName(),(function(e){a(e),o(e)}));break;case"click-hover":a=BI.debounce((function(t){e.isEnabled()&&e.isValid()&&e.combo.isEnabled()&&e.combo.isValid()&&(e._popupView(t),e.isViewVisible()&&(e.fireEvent(BI.Controller.EVENT_CHANGE,BI.Events.EXPAND,"",e.combo),e.fireEvent(BI.Combo.EVENT_EXPAND)))}),BI.EVENT_RESPONSE_TIME,{leading:!0,trailing:!1});e.element.off("click."+e.getName()).on("click."+e.getName(),(function(e){a(e),o(e)})),e.element.on("mouseleave."+e.getName(),(function(t){e.popupView&&(e.popupView.element.on("mouseenter."+e.getName(),(function(t){s=!0,e.popupView.element.on("mouseleave."+e.getName(),(function(e){n(e)})),e.popupView.element.off("mouseenter."+e.getName())})),BI.delay((function(){s||n(t)}),50))}))}}))},_initCombo:function(){this.combo=BI.createWidget(this.options.el,{value:this.options.value})},_assertPopupView:function(){var e=this,t=this.options;null==this.popupView&&(this.popupView=BI.createWidget(this.options.popup,{type:"bi.popup_view",value:t.value},this),this.popupView.on(BI.Controller.EVENT_CHANGE,(function(t,i,o){t===BI.Events.CLICK&&(e.combo.setValue(e.getValue()),e.fireEvent(BI.Combo.EVENT_CHANGE,i,o)),e.fireEvent(BI.Controller.EVENT_CHANGE,arguments)})),this.popupView.setVisible(!1),BI.nextTick((function(){e.fireEvent(BI.Combo.EVENT_AFTER_INIT)})))},_assertPopupViewRender:function(){this._assertPopupView(),this._rendered||(BI.createWidget({type:"bi.vertical",scrolly:!1,element:this.options.container||this,items:[{el:this.popupView}]}),this._rendered=!0)},_hideIf:function(e,t){if(e&&(!0!==t&&this.element.find(e.target).length>0||this.popupView&&this.popupView.element.find(e.target).length>0||"CodeMirror-cursor"===e.target.className||BI.Widget._renderEngine.createElement(e.target).closest(".CodeMirror-hints").length>0)){var i=this.options.direction.split(",");(BI.contains(i,"innerLeft")||BI.contains(i,"innerRight"))&&(this.adjustWidth(),this.adjustHeight())}else{if(!1!==this.options.hideChecker.apply(this,[e]))return this._hideView(),!0}},_hideView:function(){this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW),!0===this.options.destroyWhenHide?(this.popupView&&this.popupView.destroy(),this.popupView=null,this._rendered=!1):this.popupView&&this.popupView.invisible(),this.element.removeClass(this.options.comboClass),delete o[this.getName()],BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW)},_popupView:function(e){var t=this;this._assertPopupViewRender(),this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW),this.popupView.css({left:-999999999,top:-99999999}),this.popupView.visible(),BI.each(o,(function(i,s){i!==t.getName()&&s&&!0===s._hideIf(e,!0)&&delete o[i]})),this.options.hideWhenAnotherComboOpen&&(o[this.getName()]=this),this.adjustWidth(e),this.adjustHeight(e),this.element.addClass(this.options.comboClass),BI.Widget._renderEngine.createElement(document).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()),BI.Widget._renderEngine.createElement(document).bind("mousedown."+this.getName(),BI.bind(this._hideIf,this)).bind("mousewheel."+this.getName(),BI.bind(this._hideIf,this)),this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW)},adjustWidth:function(e){var t=this.options;if(this.popupView&&!0===t.isNeedAdjustWidth){this.resetListWidth("");var i=this.popupView.element.outerWidth(),o=this.element.outerWidth()||t.width;i>o+80?o+=80:i>o&&(o=i),this.resetListWidth(o<100?100:o)}},adjustHeight:function(e){var t=this.options,i={top:0,adaptHeight:0,left:0};if(this.popupView){var o=this.popupView.isVisible();this.popupView.visible();var s=t.belowMouse&&BI.isNotNull(e)?{element:{offset:function(){return{left:e.pageX,top:e.pageY}},bounds:function(){return{x:e.offsetX,y:e.offsetY,width:0,height:24}},outerWidth:function(){return 0},outerHeight:function(){return 24}}}:this.combo;switch(t.direction){case"bottom":case"bottom,right":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight,["bottom","top","right","left"],t.offsetStyle);break;case"top":case"top,right":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight,["top","bottom","right","left"],t.offsetStyle);break;case"left":case"left,bottom":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["left","right","bottom","top"],t.offsetStyle);break;case"right":case"right,bottom":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["right","left","bottom","top"],t.offsetStyle);break;case"top,left":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight,["top","bottom","left","right"],t.offsetStyle);break;case"bottom,left":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight,["bottom","top","left","right"],t.offsetStyle);break;case"left,top":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["left","right","top","bottom"],t.offsetStyle);break;case"right,top":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["right","left","top","bottom"],t.offsetStyle);break;case"right,innerRight":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["right","left","innerRight","innerLeft","bottom","top"],t.offsetStyle);break;case"right,innerLeft":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["right","left","innerLeft","innerRight","bottom","top"],t.offsetStyle);break;case"innerRight":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["innerRight","innerLeft","right","left","bottom","top"],t.offsetStyle);break;case"innerLeft":i=BI.DOM.getComboPosition(s,this.popupView,t.adjustXOffset||t.adjustLength,t.adjustYOffset,t.isNeedAdjustHeight,["innerLeft","innerRight","left","right","bottom","top"],t.offsetStyle);break;case"top,custom":case"custom,top":i=BI.DOM.getTopAdaptPosition(s,this.popupView,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight);break;case"custom,bottom":case"bottom,custom":i=BI.DOM.getBottomAdaptPosition(s,this.popupView,t.adjustYOffset||t.adjustLength,t.isNeedAdjustHeight);break;case"left,custom":case"custom,left":delete(i=BI.DOM.getLeftAdaptPosition(s,this.popupView,t.adjustXOffset||t.adjustLength)).top,delete i.adaptHeight;break;case"custom,right":case"right,custom":delete(i=BI.DOM.getRightAdaptPosition(s,this.popupView,t.adjustXOffset||t.adjustLength)).top,delete i.adaptHeight}"adaptHeight"in i&&this.resetListHeight(i.adaptHeight),"left"in i&&this.popupView.element.css({left:i.left}),"top"in i&&this.popupView.element.css({top:i.top}),this.position=i,this.popupView.setVisible(o)}},resetListHeight:function(e){this._assertPopupView(),this.popupView.resetHeight&&this.popupView.resetHeight(e)},resetListWidth:function(e){this._assertPopupView(),this.popupView.resetWidth&&this.popupView.resetWidth(e)},populate:function(e){this._assertPopupView(),this.popupView.populate.apply(this.popupView,arguments),this.combo.populate&&this.combo.populate.apply(this.combo,arguments)},_setEnable:function(e){BI.Combo.superclass._setEnable.apply(this,arguments),!0===e?this.element.removeClass("base-disabled disabled"):!1===e&&this.element.addClass("base-disabled disabled"),!e&&this.element.removeClass(this.options.hoverClass),!e&&this.isViewVisible()&&this._hideView()},setValue:function(e){this.combo.setValue(e),BI.isNull(this.popupView)?this.options.popup.value=e:this.popupView.setValue(e)},getValue:function(){return BI.isNull(this.popupView)?this.options.popup.value:this.popupView.getValue()},isViewVisible:function(){return this.isEnabled()&&this.combo.isEnabled()&&!!this.popupView&&this.popupView.isVisible()},showView:function(e){this.isEnabled()&&this.combo.isEnabled()&&!this.isViewVisible()&&this._popupView(e)},hideView:function(){this._hideView()},getView:function(){return this.popupView},getPopupPosition:function(){return this.position},toggle:function(){this._toggle()},destroyed:function(){BI.Widget._renderEngine.createElement(document).unbind("click."+this.getName()).unbind("mousedown."+this.getName()).unbind("mousewheel."+this.getName()).unbind("mouseenter."+this.getName()).unbind("mousemove."+this.getName()).unbind("mouseleave."+this.getName()).unbind("blur."+this.getName()),BI.Resizers.remove(this.getName()),this.popupView&&this.popupView._destroy(),delete o[this.getName()]}}),BI.Combo.EVENT_TRIGGER_CHANGE="EVENT_TRIGGER_CHANGE",BI.Combo.EVENT_CHANGE="EVENT_CHANGE",BI.Combo.EVENT_EXPAND="EVENT_EXPAND",BI.Combo.EVENT_COLLAPSE="EVENT_COLLAPSE",BI.Combo.EVENT_AFTER_INIT="EVENT_AFTER_INIT",BI.Combo.EVENT_BEFORE_POPUPVIEW="EVENT_BEFORE_POPUPVIEW",BI.Combo.EVENT_AFTER_POPUPVIEW="EVENT_AFTER_POPUPVIEW",BI.Combo.EVENT_BEFORE_HIDEVIEW="EVENT_BEFORE_HIDEVIEW",BI.Combo.EVENT_AFTER_HIDEVIEW="EVENT_AFTER_HIDEVIEW",BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0,t.className="designer.components.phone.editor.item",t.Widget=BI.inherit(BI.BasicButton,{props:{baseCls:"designer-login-login-body",label:"",text:""},render:function(){var e=this.options;return{type:"bi.htape",items:[{el:{type:"bi.label",text:e.label,title:e.label,textAlign:"left"},lgap:10,rgap:5},{el:{type:"bi.label",text:e.text,textAlign:"right"},width:32,rgap:10}]}},doClick:function(){BI.SingleSelectItem.superclass.doClick.apply(this,arguments),this.isValid()&&this.fireEvent("EVENT_CHANGE",this.isSelected(),this)},setSelected:function(e){BI.SingleSelectItem.superclass.setSelected.apply(this,arguments)},getValue:function(){return this.options.value}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Widget=t.className=void 0;var o=i(0);t.className="designer.user.account.setting.captcha",t.Widget=BI.inherit(BI.Widget,{props:{baseCls:"designer-login-login-body"},render:function(){var e=this;this.options;return{type:o.TextButton,text:BI.i18nText("Designer-Login_Code_Request"),cls:"designer-login-border-bottom designer-login-code-text",handler:function(){e.setButtonEnable(!1),e.fireEvent("EVENT_SEND")},ref:function(t){e.getButton=t}}},setButtonEnable:function(e){this.captchaTime&&(e=!1),this.getButton.setEnable(e)},regainCaptcha:function(){var e=this,t=0;window.clearInterval(e.captchaTime),this.captchaTime=window.setInterval((function(){if(60===t)return window.clearInterval(e.captchaTime),e.captchaTime=null,e.getButton.setText(BI.i18nText("Designer-Login_Code_Request")),void e.setButtonEnable(!0);e.getButton.setText(BI.i18nText("Designer-Login_Code_Request_Again")+"("+(60-t)+")"),t++}),1e3),this.setButtonEnable(!1)}}),BI.shortcut(t.className,t.Widget),t["default"]=t.className},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=t.className=void 0,t.className="designer.login.model.sms_method",t.Model=BI.inherit(Fix.Model,{context:[""],state:function(){return{errMessage:"",isRegister:!1,regToken:""}},actions:{setErrMessage:function(e){this.model.errMessage=e},setRegister:function(e){this.model.isRegister=e},setRegToken:function(e){this.model.regToken=e}}}),BI.store(t.className,t.Model),t["default"]=t.className},function(e,t,i){}]); \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/notification/ui/notificationCenter.png b/designer-base/src/main/resources/com/fr/design/notification/ui/notificationCenter.png new file mode 100644 index 000000000..0445f3134 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/notification/ui/notificationCenter.png differ diff --git a/designer-base/src/main/resources/com/fr/design/notification/ui/notificationCenterDot.png b/designer-base/src/main/resources/com/fr/design/notification/ui/notificationCenterDot.png new file mode 100644 index 000000000..599a9ba64 Binary files /dev/null and b/designer-base/src/main/resources/com/fr/design/notification/ui/notificationCenterDot.png differ diff --git a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java index 07a1d54f8..090838fd0 100644 --- a/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java +++ b/designer-base/src/test/java/com/fr/design/EnvChangeEntranceTest.java @@ -60,7 +60,7 @@ public class EnvChangeEntranceTest { EasyMock.replay(request, selectedEnv, connectionInfo); PowerMock.replayAll(); - entrance.showServiceDialog(selectedEnv); + //entrance.showServiceDialog(selectedEnv); }catch (Exception e){ Assert.fail(); diff --git a/designer-base/src/test/java/com/fr/design/gui/controlpane/ListControlPaneHelperTest.java b/designer-base/src/test/java/com/fr/design/gui/controlpane/ListControlPaneHelperTest.java new file mode 100644 index 000000000..8f113089e --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/gui/controlpane/ListControlPaneHelperTest.java @@ -0,0 +1,41 @@ +package com.fr.design.gui.controlpane; + +import com.fr.form.event.Listener; +import com.fr.general.NameObject; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** + * Created by kerry on 5/17/21 + */ +public class ListControlPaneHelperTest { + + @Test + public void testProcessCatalog() { + ListControlPaneHelper helper = ListControlPaneHelper.newInstance(EasyMock.mock(ListControlPaneProvider.class)); + List nameObjectList = new ArrayList<>(); + Listener listener1 = new Listener(); + listener1.setEventName("click"); + Listener listener2 = new Listener(); + listener2.setEventName("afterInit"); + Listener listener3 = new Listener(); + listener3.setEventName("click"); + Listener listener4 = new Listener(); + listener4.setEventName("afterInit"); + listener4.setName("test"); + nameObjectList.add(new NameObject("click", listener1)); + nameObjectList.add(new NameObject("afterInit", listener2)); + nameObjectList.add(new NameObject("click", listener3)); + nameObjectList.add(new NameObject("afterInit", listener4)); + Map> map = helper.processCatalog(nameObjectList); + Assert.assertEquals(2, map.size()); + Assert.assertEquals(2, map.get("afterInit").size()); + Assert.assertEquals(2, map.get("click").size()); + + } +} diff --git a/designer-base/src/test/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfoTest.java b/designer-base/src/test/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfoTest.java new file mode 100644 index 000000000..c90e7a8b0 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/mainframe/reuse/ComponentReuseNotificationInfoTest.java @@ -0,0 +1,46 @@ +package com.fr.design.mainframe.reuse; + +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLableReader; +import com.fr.third.javax.xml.stream.XMLStreamException; +import org.junit.Assert; +import org.junit.Test; + +import java.io.PrintWriter; +import java.io.StringReader; +import java.io.StringWriter; + +/** + * Created by kerry on 5/10/21 + */ +public class ComponentReuseNotificationInfoTest { + + @Test + public void testReadXML() { + try { + XMLableReader xmlReader = XMLableReader.createXMLableReader(new StringReader("\n")); + ComponentReuseNotificationInfo notificationInfo = ComponentReuseNotificationInfo.getInstance(); + notificationInfo.readXML(xmlReader); + xmlReader.close(); + Assert.assertEquals(2, notificationInfo.getNotifiedNumber()); + Assert.assertEquals(true, notificationInfo.isClickedWidgetLib()); + Assert.assertEquals(1620612153215L, notificationInfo.getLastNotifyTime()); + } catch (XMLStreamException e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void testWriteXML() { + StringWriter sw = new StringWriter(); + XMLPrintWriter writer = XMLPrintWriter.create(new PrintWriter(sw)); + ComponentReuseNotificationInfo notificationInfo = ComponentReuseNotificationInfo.getInstance(); + notificationInfo.setNotifiedNumber(1); + notificationInfo.writeXML(writer); + writer.flush(); + writer.close(); + Assert.assertEquals("\n" + + "\n", sw.toString()); + } + +} diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/SendHelperTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/SendHelperTest.java index 8da46557c..d2dd2f669 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/SendHelperTest.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/SendHelperTest.java @@ -1,38 +1,7 @@ package com.fr.design.mainframe.template.info; -import com.fr.invoke.Reflect; -import com.fr.json.JSONObject; -import com.fr.stable.xml.XMLableReader; -import com.fr.third.javax.xml.stream.XMLStreamException; - -import java.io.StringReader; -import java.util.Map; - -import static org.junit.Assert.assertTrue; - /** * Created by plough on 2019/4/25. */ public class SendHelperTest { - private static final String CONSUMING_URL = "http://cloud.fanruan.com/api/monitor/record_of_reports_consuming/single"; - private static final String PROCESS_URL = "http://cloud.fanruan.com/api/monitor/record_of_reports_process/single"; - - private static final String NORMAL_INFO = "\n" + - "\n" + - "\n" + - ""; - - // 只在调试的时候运行,不需要每次都自动运行 - public static void main(String[] args) throws XMLStreamException { - StringReader sr = new StringReader(NORMAL_INFO); - XMLableReader xmlReader = XMLableReader.createXMLableReader(sr); - TemplateInfo templateInfo = TemplateInfo.newInstanceByRead(xmlReader); - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - Map processMap = Reflect.on(templateInfo).field("processMap").get(); - boolean res = Reflect.on(SendHelper.class).call("sendSinglePointInfo", CONSUMING_URL, new JSONObject(consumingMap).toString()).get(); - assertTrue(res); - - boolean res2 = Reflect.on(SendHelper.class).call("sendSinglePointInfo", PROCESS_URL, new JSONObject(processMap).toString()).get(); - assertTrue(res2); - } } diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java deleted file mode 100644 index 9395ef5b3..000000000 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoCollectorTest.java +++ /dev/null @@ -1,252 +0,0 @@ -package com.fr.design.mainframe.template.info; - -import com.fr.config.MarketConfig; -import com.fr.design.DesignerEnvManager; -import com.fr.invoke.Reflect; -import com.fr.json.JSON; -import com.fr.json.JSONArray; -import com.fr.json.JSONFactory; -import com.fr.stable.ProductConstants; -import com.fr.stable.StringUtils; -import com.fr.third.org.apache.commons.io.FileUtils; -import org.easymock.EasyMock; -import org.junit.After; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.api.easymock.PowerMock; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; -import org.powermock.modules.junit4.PowerMockRunner; - -import java.io.File; -import java.io.IOException; -import java.util.Map; - -import static com.fr.design.mainframe.template.info.TemplateInfoTestHelper.assertJsonStringEquals; -import static com.fr.design.mainframe.template.info.TemplateInfoTestHelper.setUpMockForNewInstance; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -/** - * Created by plough on 2019/4/18. - */ -@RunWith(PowerMockRunner.class) -@PrepareForTest({ProductConstants.class, MarketConfig.class, DesignerEnvManager.class}) -@SuppressStaticInitializationFor({"com.fr.jvm.assist.FineAssist"}) -public class TemplateInfoCollectorTest { - private String filePath; - private String initialFileContent; - private TemplateProcessInfo mockProcessInfo; - - @Before - public void setUp() throws IOException { - PowerMock.mockStatic(ProductConstants.class); - - filePath = getClass().getResource("tpl.info").getPath(); - String dirPath = filePath.substring(0, filePath.indexOf("tpl.info")); - EasyMock.expect(ProductConstants.getEnvHome()).andReturn(dirPath).anyTimes(); - EasyMock.replay(); - PowerMock.replayAll(); - - mockProcessInfo = EasyMock.mock(TemplateProcessInfo.class); - EasyMock.expect(mockProcessInfo.getBlockCount()).andReturn(3).anyTimes(); - EasyMock.expect(mockProcessInfo.getCellCount()).andReturn(13).anyTimes(); - EasyMock.expect(mockProcessInfo.getFloatCount()).andReturn(1).anyTimes(); - EasyMock.expect(mockProcessInfo.getReportType()).andReturn(0).anyTimes(); - EasyMock.expect(mockProcessInfo.getWidgetCount()).andReturn(0).anyTimes(); - EasyMock.expect(mockProcessInfo.useParaPane()).andReturn(false).anyTimes(); - EasyMock.expect(mockProcessInfo.getComponentsInfo()).andReturn(new JSONArray()).anyTimes(); - EasyMock.expect(mockProcessInfo.isTestTemplate()).andReturn(true).anyTimes(); - EasyMock.expect(mockProcessInfo.getReuseCmpList()).andReturn(JSONArray.create().add("reuse-id-1")).anyTimes(); - EasyMock.replay(mockProcessInfo); - - // 缓存 tpl.info - initialFileContent = FileUtils.readFileToString(new File(filePath), "utf-8"); - - Reflect.on(TemplateInfoCollector.class).set("instance", null); - // 后执行 testReadXML 用例时,之前保留的单例会造成影响 - Reflect.on(DesignerOpenHistory.class).set("singleton", null); - } - - @After - public void tearDown() throws IOException { - // 恢复 tpl.info - FileUtils.writeStringToFile(new File(filePath), initialFileContent, "utf-8"); - } - - @Test - public void testReadXML() { - assertEquals(",,", DesignerOpenHistory.getInstance().toString()); - - TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - - assertEquals("2020-05-07,2020-05-06,2020-04-30", DesignerOpenHistory.getInstance().toString()); - } - - @Test - public void testCollectInfo() throws Exception { - setUpMockForNewInstance(); - TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - - String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; - int timeConsume = 200; - - collector.collectInfo(templateID, StringUtils.EMPTY, mockProcessInfo, timeConsume); - - // 检查是否写入成功 - Reflect.on(collector).call("loadFromFile"); - TemplateInfo templateInfo = getTemplateInfoByID(templateID); - - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - Map processMap = Reflect.on(templateInfo).field("processMap").get(); - - assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + - "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\",\"reuseCmptList\":\"[\\\"reuse-id-1\\\"]\"" + - "}", - JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); - - Assert.assertEquals(71113, consumingMap.get("uid")); - Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); - Assert.assertEquals("e5d7dbb2-d1df-43d4-b974-67acb5ecbffa", consumingMap.get("templateID")); - Assert.assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); - } - - @Test - public void testCollectInfoForNewTemplate() throws Exception { - setUpMockForNewInstance(); - - TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - - String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; - int timeConsume = 200; - - collector.collectInfo(templateID, StringUtils.EMPTY, mockProcessInfo, timeConsume); - - // 检查是否写入成功 - Reflect.on(collector).call("loadFromFile"); - assertTrue(collector.contains(templateID)); - - TemplateInfo templateInfo = getTemplateInfoByID(templateID); - Map processMap = Reflect.on(templateInfo).field("processMap").get(); - - assertEquals(templateID, templateInfo.getTemplateID()); - - assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + - "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\",\"reuseCmptList\":\"[\\\"reuse-id-1\\\"]\"" + - "}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); - - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - Assert.assertEquals(71113, consumingMap.get("uid")); - Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); - Assert.assertEquals("e5d7dbb2-d1df-43d4-b974-67acb5ecbffa", consumingMap.get("templateID")); - Assert.assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); - } - - @Test - public void testCollectInfoWhenSaveAs() throws Exception { - setUpMockForNewInstance(); - - TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - - String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; - String originID = "16a988ce-8529-42f5-b17c-2ee849355071"; - int timeConsume = 200; - - collector.collectInfo(templateID, originID, mockProcessInfo, timeConsume); - - // 检查是否写入成功 - Reflect.on(collector).call("loadFromFile"); - TemplateInfo templateInfo = getTemplateInfoByID(templateID); - Map processMap = Reflect.on(templateInfo).field("processMap").get(); - - assertJsonStringEquals("{\"process\":\"\",\"float_count\":1,\"widget_count\":0," + - "\"cell_count\":13,\"paraApply\":0,\"block_count\":3,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"e5d7dbb2-d1df-43d4-b974-67acb5ecbffa\",\"reuseCmptList\":\"[\\\"reuse-id-1\\\"]\"" + - "}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); - - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - Assert.assertEquals(71113, consumingMap.get("uid")); - Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); - Assert.assertEquals("e5d7dbb2-d1df-43d4-b974-67acb5ecbffa", consumingMap.get("templateID")); - Assert.assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); - Assert.assertEquals("16a988ce-8529-42f5-b17c-2ee849355071", consumingMap.get("originID")); - } - - @Test - public void testCollectInfoWhenSaveAsWithNoTrackOriginID() throws Exception { - setUpMockForNewInstance(); - - TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - - String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; - String originID = "3kha8jcs-31xw-42f5-h2ww-2ee84935312z"; - int timeConsume = 200; - - collector.collectInfo(templateID, originID, mockProcessInfo, timeConsume); - - TemplateInfo templateInfo = getTemplateInfoByID(templateID); - assertEquals(templateID, templateInfo.getTemplateID()); - - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - Assert.assertEquals(71113, consumingMap.get("uid")); - Assert.assertEquals("2020-05-07 17:25", consumingMap.get("create_time")); - Assert.assertEquals("e5d7dbb2-d1df-43d4-b974-67acb5ecbffa", consumingMap.get("templateID")); - Assert.assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); - Assert.assertEquals("3kha8jcs-31xw-42f5-h2ww-2ee84935312z", consumingMap.get("originID")); - } - - @Test - public void testAddIdleDateCount() { - String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; - TemplateInfoCollector collecter = TemplateInfoCollector.getInstance(); - TemplateInfo templateInfo = getTemplateInfoByID(templateID); - - assertEquals(0, templateInfo.getIdleDayCount()); - - Reflect.on(collecter).call("addIdleDayCount"); - assertEquals(1, templateInfo.getIdleDayCount()); - - // 同一天内多次调用无效 - Reflect.on(collecter).call("addIdleDayCount"); - assertEquals(1, templateInfo.getIdleDayCount()); - } - - @Test - public void testContains() { - TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - String templateID1 = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; - Assert.assertTrue(collector.contains(templateID1)); - String templateID2 = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffb"; - Assert.assertFalse(collector.contains(templateID2)); - } - - @Test - public void testGetTemplateCreateTime() throws Exception { - setUpMockForNewInstance(); - TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - String templateID = "e5d7dbb2-d1df-43d4-b974-67acb5ecbffa"; - String createTime = Reflect.on(collector).call("getTemplateCreateTime", templateID).get(); - Assert.assertEquals("2020-05-07 17:25", createTime); - - templateID = "2521d03c-b238-41a5-9a1d-2498efff3a97"; - createTime = Reflect.on(collector).call("getTemplateCreateTime", templateID).get(); - Assert.assertEquals("2020-05-07 17:45", createTime); - } - - - private TemplateInfo getTemplateInfoByID(String templateID) { - TemplateInfoCollector collector = TemplateInfoCollector.getInstance(); - Map latestTemplateInfo = Reflect.on(collector).field("latestTemplateInfo").get(); - Map pointInfoMap = Reflect.on(collector).field("pointInfoMap").get(); - if (latestTemplateInfo.containsKey(templateID)) { - long latestSaveTime = latestTemplateInfo.get(templateID); - return pointInfoMap.get(templateID + "_" + latestSaveTime); - } else { - return TemplateInfo.newInstance(templateID); - } - } -} diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java deleted file mode 100644 index 1808736f3..000000000 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTest.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.fr.design.mainframe.template.info; - -import com.fr.config.MarketConfig; -import com.fr.design.DesignerEnvManager; -import com.fr.invoke.Reflect; -import com.fr.json.JSON; -import com.fr.json.JSONFactory; -import com.fr.json.JSONObject; -import com.fr.stable.StringUtils; -import com.fr.stable.xml.XMLableReader; -import com.fr.third.javax.xml.stream.XMLStreamException; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; - -import java.io.StringReader; -import java.util.Map; - -import static com.fr.design.mainframe.template.info.TemplateInfoTestHelper.assertJsonStringEquals; -import static com.fr.design.mainframe.template.info.TemplateInfoTestHelper.setUpMockForNewInstance; -import static org.junit.Assert.assertEquals; - -/** - * Created by plough on 2019/4/19. - */ -@RunWith(PowerMockRunner.class) -@PrepareForTest({MarketConfig.class, DesignerEnvManager.class}) -public class TemplateInfoTest { - - private static final String NORMAL_INFO = "\n" + - "\n" + - "\n" + - ""; - - private static final String SAVE_AS_INFO = "\n" + - "\n" + - "\n" + - ""; - - private TemplateInfo templateInfo; - private TemplateInfo templateInfoSaveAs; // 另存为的模版记录 - - @Before - public void setUp() throws XMLStreamException { - templateInfo = createTemplateInfo(NORMAL_INFO); - templateInfoSaveAs = createTemplateInfo(SAVE_AS_INFO); - } - - @Test - public void testNewInstance() throws Exception { - setUpMockForNewInstance(); - - String templateID = "24avc8n2-1iq8-iuj2-wx24-8yy0i8132302"; - TemplateInfo templateInfo = TemplateInfo.newInstance(templateID); - assertEquals(templateID, templateInfo.getTemplateID()); - assertEquals(StringUtils.EMPTY, Reflect.on(templateInfo).field("originID").get()); - assertEquals(0, (int) Reflect.on(templateInfo).field("idleDayCount").get()); - assertEquals(false, templateInfo.isTestTemplate()); - - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - assertEquals(templateID, consumingMap.get("templateID")); - assertEquals(StringUtils.EMPTY, consumingMap.get("originID")); - assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); - assertEquals(71113, consumingMap.get("uid")); - assertEquals(StringUtils.EMPTY, consumingMap.get("saveRecord")); - } - - @Test - public void testNewInstanceWithMoreArgs() throws Exception { - setUpMockForNewInstance(); - - String templateID = "24121212-u2c8-ncd2-82nx-8ud0i8138888"; - String originID = "24avc8n2-1iq8-iuj2-wx24-8yy0i8132302"; - String saveRecord = "{\"time\";:1588843629000,\"consume\":81}"; - String createTime = "2020-05-07 17:25"; - TemplateInfo templateInfo = TemplateInfo.newInstance(templateID, originID, saveRecord, createTime); - assertEquals(templateID, templateInfo.getTemplateID()); - assertEquals(originID, Reflect.on(templateInfo).field("originID").get()); - assertEquals(0, (int) Reflect.on(templateInfo).field("idleDayCount").get()); - assertEquals(false, templateInfo.isTestTemplate()); - - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - assertEquals(templateID, consumingMap.get("templateID")); - assertEquals(originID, consumingMap.get("originID")); - assertEquals("6b6699ff-ec63-43b0-9deb-b580a5f10411", consumingMap.get("uuid")); - assertEquals(71113, consumingMap.get("uid")); - assertEquals(saveRecord, consumingMap.get("saveRecord")); - assertEquals(createTime, consumingMap.get("create_time")); - } - - @Test - public void testGetTemplateID() { - assertEquals("aac1139e-018b-4481-867a-a18fc6d6f3e6", templateInfo.getTemplateID()); - assertEquals("2521d03c-b238-41a5-9a1d-2498efff3a97", templateInfoSaveAs.getTemplateID()); - } - - @Test - public void testGetSendInfo() { - - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - Map processMap = Reflect.on(templateInfo).field("processMap").get(); - Map consumingMap1 = Reflect.on(templateInfoSaveAs).field("consumingMap").get(); - Map processMap1 = Reflect.on(templateInfoSaveAs).field("processMap").get(); - assertJsonStringEquals("{\"uid\":71113,\"originID\":\"\",\"create_time\":\"2020-05-07 17:28\"," + - "\"saveRecord\":\"{\\\"time\\\":1588843693000,\\\"consume\\\":4}\"," + - "\"templateID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"," + - "\"uuid\":\"6b6699ff-ec63-43b0-9deb-b580a5f10411\"}", JSONFactory.createJSON(JSON.OBJECT, consumingMap).toString()); - - assertJsonStringEquals("{\"uid\":71113,\"originID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"," + - "\"create_time\":\"2020-05-07 17:45\",\"saveRecord\":\"{\\\"time\\\":1588844751000,\\\"consume\\\":1058}\"," + - "\"templateID\":\"2521d03c-b238-41a5-9a1d-2498efff3a97\"," + - "\"uuid\":\"6b6699ff-ec63-43b0-9deb-b580a5f10411\"}", JSONFactory.createJSON(JSON.OBJECT, consumingMap1).toString()); - assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":3," + - "\"paraApply\":0,\"block_count\":0,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"aac1139e-018b-4481-867a-a18fc6d6f3e6\"}", JSONFactory.createJSON(JSON.OBJECT, processMap).toString()); - assertJsonStringEquals("{\"process\":\"\",\"float_count\":0,\"widget_count\":0,\"cell_count\":3," + - "\"paraApply\":0,\"block_count\":0,\"report_type\":0,\"components_info\":\"[]\"," + - "\"templateID\":\"2521d03c-b238-41a5-9a1d-2498efff3a97\"}", JSONFactory.createJSON(JSON.OBJECT, processMap1).toString()); - } - - private TemplateInfo createTemplateInfo(String xmlContent) throws XMLStreamException { - StringReader sr = new StringReader(xmlContent); - XMLableReader xmlReader = XMLableReader.createXMLableReader(sr); - return TemplateInfo.newInstanceByRead(xmlReader); - } - - @Test - public void testGetSaveTime() { - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - String saveRecord = (String) consumingMap.get("saveRecord"); - JSONObject object = JSONFactory.createJSON(JSON.OBJECT, saveRecord); - Assert.assertEquals(1588843693000L, object.optLong("time")); - } - - @Test - public void testGetTemplateCreateTime() { - Map consumingMap = Reflect.on(templateInfo).field("consumingMap").get(); - Assert.assertEquals("2020-05-07 17:28", (String) consumingMap.get("create_time")); - } -} diff --git a/designer-base/src/test/java/com/fr/design/mod/ContentReplaceUtilTest.java b/designer-base/src/test/java/com/fr/design/mod/ContentReplaceUtilTest.java new file mode 100644 index 000000000..cf67c69b6 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/mod/ContentReplaceUtilTest.java @@ -0,0 +1,65 @@ +package com.fr.design.mod; + +import junit.framework.TestCase; +import org.junit.Assert; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2021/6/2 + */ +public class ContentReplaceUtilTest extends TestCase { + + public void testReplaceContent() { + String text = "setTimeout(function() {\n" + + "\n" + + "\t$(\"div[widgetname=DATEEDITOR0]\").css({\n" + + "\n" + + "\t\t'opacity': '0.3'\n" + + "\n" + + "\t});\n" + + "\n" + + "}, 50);\n" + + "var a = \"dateEditor0\""; + String oldName = "dateEditor0"; + String newName = "dateEditor00"; + String result = "setTimeout(function() {\n" + + "\n" + + "\t$(\"div[widgetname=DATEEDITOR00]\").css({\n" + + "\n" + + "\t\t'opacity': '0.3'\n" + + "\n" + + "\t});\n" + + "\n" + + "}, 50);\n" + + "var a = \"dateEditor00\""; + Assert.assertEquals(result, ContentReplaceUtil.replaceContent(text, oldName, newName)); + + String text1 = "setInterval(function() {\n" + + "\t//获取当前body中tab的索引位置\n" + + " var aa = _g().getWidgetByName(\"tabpane00\").getShowIndex();\n" + + " //根据tab索引轮播tab块,索引从0开始,到最后一个tab块后跳转到第一个\n" + + "\tif(aa == TAB轮播-测试-2) {\n" + + " _g().getWidgetByName('tabpane00').showCardByIndex(0);\n" + + " } else {\n" + + "\n" + + " _g().getWidgetByName('tabpane00').showCardByIndex(aa + TAB轮播-测试-1);\n" + + " }\n" + + "}, TAB轮播-测试-2000);"; + String oldName1 = "tabpane00"; + String newName1 = "tabpane0"; + String result1 = "setInterval(function() {\n" + + "\t//获取当前body中tab的索引位置\n" + + " var aa = _g().getWidgetByName(\"tabpane0\").getShowIndex();\n" + + " //根据tab索引轮播tab块,索引从0开始,到最后一个tab块后跳转到第一个\n" + + "\tif(aa == TAB轮播-测试-2) {\n" + + " _g().getWidgetByName('tabpane0').showCardByIndex(0);\n" + + " } else {\n" + + "\n" + + " _g().getWidgetByName('tabpane0').showCardByIndex(aa + TAB轮播-测试-1);\n" + + " }\n" + + "}, TAB轮播-测试-2000);"; + Assert.assertEquals(result1, ContentReplaceUtil.replaceContent(text1, oldName1, newName1)); + } + +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithMaxMin.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithMaxMin.java new file mode 100644 index 000000000..c6ac36a0c --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/ColorPickerPaneWithMaxMin.java @@ -0,0 +1,121 @@ +package com.fr.design.mainframe.chart.gui.style.series; + +import com.fr.base.BaseFormula; +import com.fr.chart.chartglyph.MapHotAreaColor; +import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; + +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.Color; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-05-18 + */ +public class ColorPickerPaneWithMaxMin extends ColorPickerPaneWithFormula { + + private double MAX = Double.MAX_VALUE / 2; + private double MIN = -(Double.MAX_VALUE / 2); + private BaseFormula[] valueArray; + private JPanel autoPane; + + public ColorPickerPaneWithMaxMin(AbstractAttrNoScrollPane container, String meterString) { + this(container, meterString, null); + } + + public ColorPickerPaneWithMaxMin(AbstractAttrNoScrollPane container, String meterString, JPanel autoPane) { + super(container, meterString); + if (autoPane == null) { + return; + } + this.autoPane = autoPane; + this.getDesignTypeButtonGroup().addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + checkAutoPane(); + } + }); + } + + private void checkAutoPane() { + if (getDesignTypeButtonGroup().getSelectedIndex() == 0) { + autoPane.setVisible(true); + } else { + autoPane.setVisible(false); + } + } + + public void refreshGroupPane(Color[] colorArray, BaseFormula[] valueArray) { + this.valueArray = valueArray; + super.refreshGroupPane(colorArray, valueArray); + } + + protected void setTextValue4Index(int index, String value) { + TinyFormulaPane tinyFormulaPane = (TinyFormulaPane) textFieldList.get(index); + setTextState(tinyFormulaPane, index, textFieldList.size() - 1, value); + } + + protected JComponent getNewTextFieldComponent(int i, String value) { + TinyFormulaPane textField = new TinyFormulaPaneWithEnable(); + textField.setBounds(0, i * 2 * TEXTFIELD_HEIGHT, TEXTFIELD_WIDTH, TEXTFIELD_HEIGHT); + setTextState(textField, i, valueArray.length - 1, value); + return textField; + } + + protected String getValue4Index(int i) { + if (i == 0) { + return String.valueOf(MAX); + } + if (i == textFieldList.size() - 1) { + return String.valueOf(MIN); + } + return ((TinyFormulaPane) textFieldList.get(i)).getUITextField().getText(); + } + + protected BaseFormula[] getValueArray(int count) { + BaseFormula[] valueArray = new BaseFormula[count + 1]; + valueArray[0] = BaseFormula.createFormulaBuilder().build(MAX); + valueArray[count] = BaseFormula.createFormulaBuilder().build(MIN); + for (int i = 1; i < count; i++) { + if (i >= textFieldList.size() - 1) { + valueArray[i] = BaseFormula.createFormulaBuilder().build((count - i) * VALUE); + } else { + valueArray[i] = BaseFormula.createFormulaBuilder().build(getValue4Index(i)); + } + } + return valueArray; + } + + private void setTextState(TinyFormulaPane tinyFormulaPane, int index, int maxIndex, String value) { + boolean enable = false; + if (index == 0) { + value = "=∞"; + } else if (index == maxIndex) { + value = "=-∞"; + } else { + enable = true; + } + tinyFormulaPane.getUITextField().setText(value); + tinyFormulaPane.setEnabled(enable); + } + + public void populateBean(MapHotAreaColor hotAreaColor) { + super.populateBean(hotAreaColor); + if (autoPane != null) { + checkAutoPane(); + } + } + + public class TinyFormulaPaneWithEnable extends TinyFormulaPane { + @Override + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + formulaTextField.setEnabled(enabled); + formulaTextFieldButton.setEnabled(enabled); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java index 25b876033..fb2d1c31a 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java @@ -13,6 +13,7 @@ import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ipoppane.PopupHider; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.ColorControlWindow; @@ -53,7 +54,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { protected static final int TEXTFIELD_WIDTH = 130; protected static final int UPCONTROLPANE_WIDTH = 230; private static final int LAYOUR_DET = 6; - private static final double VALUE = 100; + public static final double VALUE = 100; protected ArrayList textFieldList; private List colorRecList = new ArrayList(); @@ -171,7 +172,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { regionNumPane.updateBean().intValue()), getValueArray(regionNumPane.updateBean().intValue())); } }); - designTypeButtonGroup = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")}, new Integer[]{0, 1}); + designTypeButtonGroup = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"), Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")}, new Integer[]{0, 1}); designTypeButtonGroup.setSelectedIndex(0); designTypeButtonGroup.addChangeListener(new ChangeListener() { @Override @@ -201,11 +202,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { }; double p = TableLayout.PREFERRED; - double e = getEditAreaWidth (); - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + double e = getEditAreaWidth(); + double d = getDescriptionWidth(); double[] columnSize = {d, e}; double[] rowSize = {p}; - Component[][] tmpComp = new Component[][]{new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), regionNumPane}}; + Component[][] tmpComp = new Component[][]{new Component[]{new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")), regionNumPane}}; stagePanel = TableLayout4VanChartHelper.createGapTableLayoutPane(tmpComp, rowSize, columnSize); @@ -226,10 +227,14 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { refreshGroupPane(colors, getValueArray(number)); } - protected double getEditAreaWidth () { + protected double getEditAreaWidth() { return TableLayout4VanChartHelper.EDIT_AREA_WIDTH; } + protected double getDescriptionWidth() { + return TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; + } + protected ArrayList getTextFieldList(){ return new ArrayList(); } @@ -272,11 +277,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { */ public Dimension getPreferredSize() { if (designTypeButtonGroup.getSelectedIndex() == 0) { - return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, upControlPane.getPreferredSize().height + MARGIN_TOP); + return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, upControlPane.getPreferredSize().height + getBoundY()); } else { - int extra = stagePanel == null ? 0 : stagePanel.getPreferredSize().height + MARGIN_TOP; + int extra = stagePanel == null ? 0 : stagePanel.getPreferredSize().height + getBoundY(); return new Dimension(colorGroup.getPreferredSize().width + textGroup.getPreferredSize().width, - extra + textGroup.getPreferredSize().height + upControlPane.getPreferredSize().height + OFF_HEIGHT + MARGIN_TOP); + extra + textGroup.getPreferredSize().height + upControlPane.getPreferredSize().height + OFF_HEIGHT + getBoundY()); } } @@ -604,10 +609,10 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { @Override public void layoutContainer(Container parent) { - upControlPane.setBounds(MARGIN_LEFT, MARGIN_TOP, UPCONTROLPANE_WIDTH, upControlPane.getPreferredSize().height + MARGIN_TOP); - stagePanel.setBounds(MARGIN_LEFT, upControlPane.getPreferredSize().height + LAYOUR_DET + MARGIN_TOP, UPCONTROLPANE_WIDTH, stagePanel.getPreferredSize().height); - colorGroup.setBounds( getColorgroupMarginLeft (), 2 * MARGIN_TOP + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); - textGroup.setBounds(colorGroup.getPreferredSize().width + getColorgroupMarginLeft (), upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET + MARGIN_TOP, textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); + upControlPane.setBounds(getBoundX(), getBoundY(), UPCONTROLPANE_WIDTH, upControlPane.getPreferredSize().height + MARGIN_TOP); + stagePanel.setBounds(getBoundX(), upControlPane.getPreferredSize().height + LAYOUR_DET + getBoundY(), UPCONTROLPANE_WIDTH, stagePanel.getPreferredSize().height); + colorGroup.setBounds( getColorgroupMarginLeft (), 2 * getBoundY() + upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET, colorGroup.getPreferredSize().width, colorGroup.getPreferredSize().height + upControlPane.getPreferredSize().height); + textGroup.setBounds(colorGroup.getPreferredSize().width + getColorgroupMarginLeft (), upControlPane.getPreferredSize().height + stagePanel.getPreferredSize().height + 2 * LAYOUR_DET + getBoundY(), textGroup.getPreferredSize().width, textGroup.getPreferredSize().height); } @Override @@ -693,7 +698,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { refreshPane(); } - private void initContainerLister(){ + protected void initContainerLister(){ this.container.initAllListeners(); } @@ -761,7 +766,7 @@ public class UIColorPickerPane extends BasicPane implements UIObserver { return ChartBaseUtils.createColorsWithHSB(color, sum); } - private BaseFormula[] getValueArray(int count) { + protected BaseFormula[] getValueArray(int count) { BaseFormula[] valueArray = new BaseFormula[count + 1]; for (int i = 0; i < valueArray.length; i++) { if (i >= textFieldList.size()) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java index 7725d9a0c..0fefa406e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java @@ -44,7 +44,7 @@ public class VanChartBeautyPane extends BasicBeanPane { double[] rowSize = {p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gradient_Style")), gradientTypeBox}, + new Component[]{new UILabel(labelName()), gradientTypeBox}, }; return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); @@ -57,6 +57,10 @@ public class VanChartBeautyPane extends BasicBeanPane { }; } + protected String labelName() { + return Toolkit.i18nText("Fine-Design_Chart_Gradient_Style"); + } + public void populateBean(GradientStyle gradientStyle) { gradientTypeBox.setSelectedIndex(this.convertGradientTypeToIndex(gradientStyle.getGradientType())); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java index 40f85dcb4..0e9cc416f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java @@ -11,9 +11,9 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; - import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.van.chart.designer.style.VanChartStylePane; @@ -32,7 +32,7 @@ import java.awt.event.ActionListener; /** * Created by Mitisky on 16/2/19. */ -public class VanChartHtmlLabelPane extends JPanel{ +public class VanChartHtmlLabelPane extends JPanel { private static final long serialVersionUID = -5512128966013558611L; private static final int JS_HEIGHT = 100; @@ -47,7 +47,9 @@ public class VanChartHtmlLabelPane extends JPanel{ private VanChartStylePane parent; - public void setCustomFormatterText(String text){ + private JPanel widthAndHeightPane; + + public void setCustomFormatterText(String text) { contentTextArea.setText(text); } @@ -56,24 +58,28 @@ public class VanChartHtmlLabelPane extends JPanel{ } public VanChartHtmlLabelPane() { - useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); + useHtml = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Html")); UIComponentUtils.setLineWrap(useHtml); - JPanel widthAndHeightPane = createWidthAndHeightPane(); + useHtml.addChangeListener(e -> checkWidthAndHeightPane()); + widthAndHeightPane = createWidthAndHeightPane(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f}; - double[] rowSize = {p, p, p}; + double[] rowSize = {p, p, p, p}; - Component[][] components = new Component[][]{ + Component[][] components = new Component[][]{ new Component[]{createJSContentPane()}, new Component[]{useHtml}, - new Component[]{widthAndHeightPane} + new Component[]{null, null}, }; JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); this.setLayout(new BorderLayout()); - this.add(contentPane, BorderLayout.CENTER); + this.add(contentPane, BorderLayout.NORTH); + if (widthAndHeightPane != null) { + this.add(widthAndHeightPane, BorderLayout.CENTER); + } } private JComponent createJSContentPane() { @@ -112,7 +118,7 @@ public class VanChartHtmlLabelPane extends JPanel{ ac.setTriggerKey(KeyStroke.getKeyStroke(shortCuts.replace("+", "pressed"))); ac.install(contentTextArea); - return new UIScrollPane(contentTextArea){ + return new UIScrollPane(contentTextArea) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, JS_HEIGHT); @@ -121,15 +127,15 @@ public class VanChartHtmlLabelPane extends JPanel{ } private void fireJSChange() { - if(parent != null){ + if (parent != null) { parent.attributeChanged(); } } protected JPanel createWidthAndHeightPane() { - isCustomWidth = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Width")); + isCustomWidth = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Width")); customWidth = new UITextField(6); - isCustomHeight = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Height")); + isCustomHeight = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_Height")); customHeight = new UITextField(6); isCustomWidth.addActionListener(new ActionListener() { @@ -147,13 +153,13 @@ public class VanChartHtmlLabelPane extends JPanel{ }); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = { p, f }; + double[] columnSize = {p, f}; double[] rowSize = {p, p, p}; - Component[][] components = new Component[][]{ + Component[][] components = new Component[][]{ new Component[]{isCustomWidth, customWidth}, new Component[]{isCustomHeight, customHeight}, - new Component[] {null, null} + new Component[]{null, null} }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } @@ -171,8 +177,14 @@ public class VanChartHtmlLabelPane extends JPanel{ checkWidth(); } - public void populate(VanChartHtmlLabel htmlLabel){ - if(htmlLabel == null){ + private void checkWidthAndHeightPane() { + if (widthAndHeightPane != null) { + widthAndHeightPane.setVisible(useHtml.isSelected()); + } + } + + public void populate(VanChartHtmlLabel htmlLabel) { + if (htmlLabel == null) { return; } setCustomFormatterText(htmlLabel.getCustomText()); @@ -186,10 +198,11 @@ public class VanChartHtmlLabelPane extends JPanel{ isCustomHeight.setSelected(htmlLabel.isCustomHeight()); customHeight.setText(htmlLabel.getHeight()); checkBoxUse(); + checkWidthAndHeightPane(); } public void update(VanChartHtmlLabel htmlLabel) { - if(htmlLabel == null){ + if (htmlLabel == null) { return; } htmlLabel.setCustomText(contentTextArea.getText()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java index f9c9f7d49..4e29e3c82 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithBackGroundLabel.java @@ -22,6 +22,6 @@ public class VanChartHtmlLabelPaneWithBackGroundLabel extends VanChartHtmlLabelP new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Background")), panel}, }; - return TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{d, f}); + return TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p}, new double[]{d, f}); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java index 48cc423c8..37a52fa16 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPaneWithOutWidthAndHeight.java @@ -12,7 +12,7 @@ public class VanChartHtmlLabelPaneWithOutWidthAndHeight extends VanChartHtmlLabe private static final long serialVersionUID = -9213286452724939880L; protected JPanel createWidthAndHeightPane() { - return new JPanel(); + return null; } protected void populateWidthAndHeight(VanChartHtmlLabel htmlLabel) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index 86086abdd..d7c590e64 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -39,6 +39,10 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingUtilities; +import java.util.Arrays; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -47,10 +51,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.Arrays; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; /** * 数据点提示内容界面,含有通用设置、富文本编辑器、自定义JS界面 @@ -411,10 +411,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane fieldNames; + private static final boolean USE_LIGHT_WEIGHT = SystemUtils.IS_OS_WINDOWS_10; + public static List getFieldNames() { return fieldNames; } @@ -152,7 +156,8 @@ public class VanChartRichEditorPane { } public static ModernUIPane initPane(VanChartRichEditorModel model) { - return new ModernUIPane.Builder() + BrowserType type = USE_LIGHT_WEIGHT ? BrowserType.LIGHTWEIGHT : BrowserType.HEAVYWEIGHT; + return new ModernUIPane.Builder(type) .prepare(new ScriptContextAdapter() { public void onScriptContextCreated(ScriptContextEvent event) { browser = event.getBrowser(); @@ -229,4 +234,11 @@ public class VanChartRichEditorPane { return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());"; } + + public static void checkDispose() { + if (USE_LIGHT_WEIGHT) { + browser.dispose(); + richEditorPane = null; + } + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java index 993c4bc2e..29598fa29 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextDialog.java @@ -10,7 +10,7 @@ import java.awt.Frame; public class VanChartRichTextDialog extends BasicDialog { - public static final Dimension DEFAULT = new Dimension(960, 800); + public static final Dimension DEFAULT = new Dimension(960, 700); public VanChartRichTextDialog(Frame parent, BasicPane pane) { super(parent, pane); @@ -18,7 +18,7 @@ public class VanChartRichTextDialog extends BasicDialog { this.setTitle(Toolkit.i18nText("Fine-Design_Report_RichTextEditor")); this.setBasicDialogSize(DEFAULT); GUICoreUtils.centerWindow(this); - this.setResizable(false); + this.setResizable(true); this.setModal(true); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java index b6bce1145..8b3d06396 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichTextPane.java @@ -20,7 +20,7 @@ public class VanChartRichTextPane extends BasicBeanPane { private static final int FIELD_PANE_H = 270; private static final int RICH_EDITOR_W = 940; - private static final int RICH_EDITOR_H = 460; + private static final int RICH_EDITOR_H = 400; private VanChartFieldListPane fieldListPane; private VanChartFieldAttrPane fieldAttrPane; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLabelConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLabelConditionPane.java index 115bdb948..87d89e8f0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLabelConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartLabelConditionPane.java @@ -3,11 +3,14 @@ package com.fr.van.chart.designer.other.condition.item; import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Plot; import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.base.AttrLabel; import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.style.label.VanChartPlotLabelPane; import javax.swing.JPanel; +import java.awt.Component; public class VanChartLabelConditionPane extends AbstractNormalMultiLineConditionPane { @@ -22,7 +25,15 @@ public class VanChartLabelConditionPane extends AbstractNormalMultiLineCondition @Override protected JPanel initContentPane() { dataLabelContentsPane = createLabelPane(); - return dataLabelContentsPane; + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = 220; + + Component[][] components = new Component[][]{ + new Component[]{null, dataLabelContentsPane} + }; + + return TableLayoutHelper.createTableLayoutPane(components, new double[]{p}, new double[]{f, e}); } protected VanChartPlotLabelPane createLabelPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index 5188912bf..849507e05 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java @@ -147,7 +147,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } } - private void checkFillStylePane(GradientStyle gradientStyle) { + protected void checkFillStylePane(GradientStyle gradientStyle) { if (vanChartFillStylePane != null) { vanChartFillStylePane.setVisible(gradientStyle.getGradientType() != GradientType.CUSTOM); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartColorValueSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartColorValueSeriesPane.java index 34f86d020..78bc20667 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartColorValueSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartColorValueSeriesPane.java @@ -2,42 +2,27 @@ package com.fr.van.chart.designer.style.series; import com.fr.chart.chartattr.Plot; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.widget.FRWidgetFactory; import com.fr.plugin.chart.range.VanChartRangeLegend; import com.fr.plugin.chart.type.LegendType; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartValueColorPane; import com.fr.van.chart.designer.style.VanChartStylePane; -import javax.swing.BorderFactory; import javax.swing.JPanel; -import java.awt.BorderLayout; import java.awt.CardLayout; -import java.awt.Component; import java.awt.Dimension; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; /** * @author Bjorn * @version 10.0 * Created by Bjorn on 2020-08-03 */ -public abstract class VanChartColorValueSeriesPane extends VanChartAbstractPlotSeriesPane { - - //颜色划分切换 - private UIButtonGroup colorDivideButton; +public abstract class VanChartColorValueSeriesPane extends VanChartMultiColorSeriesPane { private VanChartValueColorPane vanChartValueColorPane; - private JPanel colorDividePane; - public VanChartColorValueSeriesPane(ChartStylePane parent, Plot plot) { super(parent, plot); } @@ -51,79 +36,36 @@ public abstract class VanChartColorValueSeriesPane extends VanChartAbstractPlotS this.vanChartValueColorPane = vanChartValueColorPane; } - //获取颜色面板 - protected JPanel getColorPane() { - JPanel panel = new JPanel(new BorderLayout()); - JPanel colorChoosePane = createColorChoosePane(); - if (colorChoosePane != null) { - panel.add(colorChoosePane, BorderLayout.CENTER); - } - - stylePane = createStylePane(); - setColorPaneContent(panel); - JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); - panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0)); - return panel.getComponentCount() == 0 ? null : colorPane; - } - protected JPanel createColorChoosePane() { vanChartFillStylePane = getVanChartFillStylePane(); if (vanChartFillStylePane != null) { - JPanel divideButtonPane = initDivideButtonPane(); - vanChartValueColorPane = new VanChartValueColorPane((VanChartStylePane) parentPane); - - colorDividePane = new JPanel(new CardLayout()) { - @Override - public Dimension getPreferredSize() { - if (colorDivideButton.getSelectedIndex() == 0) { - return vanChartFillStylePane.getPreferredSize(); - } else { - return vanChartValueColorPane.getPreferredSize(); - } - } - }; - colorDividePane.add(vanChartFillStylePane, "series"); - colorDividePane.add(vanChartValueColorPane, "value"); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] col = {f}; - double[] row = {p, p, p}; - Component[][] components = new Component[][]{ - new Component[]{divideButtonPane}, - new Component[]{colorDividePane} - }; - return TableLayoutHelper.createCommonTableLayoutPane(components, row, col, 0); + return super.createColorChoosePane(); } return null; } - private JPanel initDivideButtonPane() { - colorDivideButton = new UIButtonGroup<>(new String[]{ + protected UIButtonGroup createDivideButton() { + return new UIButtonGroup<>(new String[]{ Toolkit.i18nText("Fine-Design_Chart_Series"), Toolkit.i18nText("Fine-Design_Chart_Use_Value") }, new String[]{"series", "value"}); - colorDivideButton.addActionListener(new ActionListener() { + } + + protected JPanel createColorDividePane() { + vanChartValueColorPane = new VanChartValueColorPane((VanChartStylePane) parentPane); + JPanel colorDividePane = new JPanel(new CardLayout()) { @Override - public void actionPerformed(ActionEvent e) { - checkCardPane(); + public Dimension getPreferredSize() { + if (getColorDivideButton().getSelectedIndex() == 0) { + return vanChartFillStylePane.getPreferredSize(); + } else { + return vanChartValueColorPane.getPreferredSize(); + } } - }); - colorDivideButton.setSelectedIndex(0); - UILabel label = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Color_Divide")); - Component[][] labelComponent = new Component[][]{ - new Component[]{label, colorDivideButton}, }; - JPanel gapTableLayoutPane = TableLayout4VanChartHelper.createGapTableLayoutPane(labelComponent); - gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); - return gapTableLayoutPane; - } - - private void checkCardPane() { - CardLayout cardLayout = (CardLayout) colorDividePane.getLayout(); - cardLayout.show(colorDividePane, colorDivideButton.getSelectedItem()); - colorDividePane.validate(); - colorDividePane.repaint(); + colorDividePane.add(vanChartFillStylePane, "series"); + colorDividePane.add(vanChartValueColorPane, "value"); + return colorDividePane; } //风格 @@ -139,9 +81,9 @@ public abstract class VanChartColorValueSeriesPane extends VanChartAbstractPlotS return; } super.updateBean(plot); - if (colorDivideButton != null) { + if (getColorDivideButton() != null) { VanChartRangeLegend legend = (VanChartRangeLegend) plot.getLegend(); - int selectedIndex = colorDivideButton.getSelectedIndex(); + int selectedIndex = getColorDivideButton().getSelectedIndex(); if (selectedIndex == 0) { legend.setLegendType(LegendType.ORDINARY); } else { @@ -158,13 +100,13 @@ public abstract class VanChartColorValueSeriesPane extends VanChartAbstractPlotS return; } super.populateBean(plot); - if (colorDivideButton != null) { + if (getColorDivideButton() != null) { VanChartRangeLegend legend = (VanChartRangeLegend) plot.getLegend(); LegendType legendType = legend.getLegendType(); if (legendType == LegendType.ORDINARY) { - colorDivideButton.setSelectedIndex(0); + getColorDivideButton().setSelectedIndex(0); } else { - colorDivideButton.setSelectedIndex(1); + getColorDivideButton().setSelectedIndex(1); } vanChartValueColorPane.populateBean(legend); checkCardPane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartMultiColorSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartMultiColorSeriesPane.java new file mode 100644 index 000000000..ec87d3675 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartMultiColorSeriesPane.java @@ -0,0 +1,92 @@ +package com.fr.van.chart.designer.style.series; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.design.widget.FRWidgetFactory; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-05-19 + */ +public abstract class VanChartMultiColorSeriesPane extends VanChartAbstractPlotSeriesPane { + + //颜色划分切换 + private UIButtonGroup colorDivideButton; + + private JPanel colorDividePane; + + public VanChartMultiColorSeriesPane(ChartStylePane parent, Plot plot) { + super(parent, plot); + } + + public UIButtonGroup getColorDivideButton() { + return colorDivideButton; + } + + //获取颜色面板 + protected JPanel getColorPane() { + JPanel panel = new JPanel(new BorderLayout()); + JPanel colorChoosePane = createColorChoosePane(); + if (colorChoosePane != null) { + panel.add(colorChoosePane, BorderLayout.CENTER); + } + + stylePane = createStylePane(); + setColorPaneContent(panel); + JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); + panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0)); + return panel.getComponentCount() == 0 ? null : colorPane; + } + + protected JPanel createColorChoosePane() { + JPanel divideButtonPane = initDivideButtonPane(); + colorDividePane = createColorDividePane(); + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] col = {f}; + double[] row = {p, p, p, p}; + Component[][] components = new Component[][]{ + new Component[]{divideButtonPane}, + new Component[]{colorDividePane} + }; + return TableLayoutHelper.createCommonTableLayoutPane(components, row, col, 0); + } + + private JPanel initDivideButtonPane() { + colorDivideButton = createDivideButton(); + colorDivideButton.addActionListener(e -> checkCardPane()); + colorDivideButton.setSelectedIndex(0); + UILabel label = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Color_Divide")); + Component[][] labelComponent = new Component[][]{ + new Component[]{label, colorDivideButton}, + }; + JPanel gapTableLayoutPane = TableLayout4VanChartHelper.createGapTableLayoutPane(labelComponent); + gapTableLayoutPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + return gapTableLayoutPane; + } + + protected abstract UIButtonGroup createDivideButton(); + + protected abstract JPanel createColorDividePane(); + + protected void checkCardPane() { + CardLayout cardLayout = (CardLayout) colorDividePane.getLayout(); + cardLayout.show(colorDividePane, String.valueOf(colorDivideButton.getSelectedItem())); + colorDividePane.validate(); + colorDividePane.repaint(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java new file mode 100644 index 000000000..61a1fc5e3 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java @@ -0,0 +1,115 @@ +package com.fr.van.chart.gauge; + +import com.fr.chart.base.ChartConstants; +import com.fr.chart.base.GradientStyle; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.style.background.gradient.FixedGradientBar; +import com.fr.plugin.chart.type.GradientType; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.VanChartBeautyPane; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2021-05-20 + */ +public class VanChartGaugeBeautyPane extends VanChartBeautyPane { + + private FixedGradientBar colorGradient; + private JPanel gradientBarPane; + + public VanChartGaugeBeautyPane() { + super(); + this.add(initGradientBarPane(), BorderLayout.SOUTH); + this.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); + initListener(); + } + + private JPanel initGradientBarPane() { + colorGradient = new FixedGradientBar(4, 140); + + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; + double[] columnSize = {f, e}; + double[] rowSize = {p, p}; + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{null, colorGradient}, + }; + + gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + colorGradient.updateColor(ChartConstants.GRADIENT_END, ChartConstants.GRADIENT_START); + return gradientBarPane; + } + + private void initListener() { + getGradientTypeBox().addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkGradientBarVisible(); + } + }); + } + + protected String labelName() { + return Toolkit.i18nText("Fine-Design_Chart_Color_Style"); + } + + private void checkGradientBarVisible() { + gradientBarPane.setVisible(getGradientTypeBox().getSelectedIndex() == 1); + } + + protected String[] getNameArray() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Solid_Color"), + Toolkit.i18nText("Fine-Design_Chart_Legend_Gradual"), + }; + } + + public void populateBean(GradientStyle gradientStyle) { + super.populateBean(gradientStyle); + + if (gradientStyle.getGradientType() == GradientType.CUSTOM) { + colorGradient.updateColor(gradientStyle.getStartColor(), gradientStyle.getEndColor()); + } + + checkGradientBarVisible(); + } + + @Override + public GradientStyle updateBean() { + GradientStyle gradientStyle = super.updateBean(); + + if (gradientStyle.getGradientType() == GradientType.CUSTOM) { + gradientStyle.setStartColor(colorGradient.getSelectColorPointBtnP1().getColorInner()); + gradientStyle.setEndColor(colorGradient.getSelectColorPointBtnP2().getColorInner()); + } + return gradientStyle; + } + + protected int convertGradientTypeToIndex(GradientType gradientType) { + switch (gradientType) { + case CUSTOM: + return 1; + default: + return 0; + } + } + + protected GradientType convertIndexToGradientType(int index) { + switch (index) { + case 1: + return GradientType.CUSTOM; + default: + return GradientType.AUTO; + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java index aab8f3cf2..afdd2d4ca 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java @@ -1,5 +1,7 @@ package com.fr.van.chart.gauge; +import com.fr.chart.base.AttrFillStyle; +import com.fr.chart.base.GradientStyle; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.design.gui.frpane.UINumberDragPane; @@ -12,7 +14,7 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithFormula; +import com.fr.design.mainframe.chart.gui.style.series.ColorPickerPaneWithMaxMin; import com.fr.design.mainframe.chart.gui.style.series.UIColorPickerPane; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; @@ -21,15 +23,17 @@ import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; +import com.fr.plugin.chart.type.GradientType; import com.fr.stable.Constants; import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import com.fr.van.chart.designer.component.VanChartBeautyPane; -import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; +import com.fr.van.chart.designer.component.VanChartFillStylePane; +import com.fr.van.chart.designer.style.series.VanChartMultiColorSeriesPane; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ActionEvent; @@ -38,7 +42,7 @@ import java.awt.event.ActionListener; /** * Created by Mitisky on 15/11/27. */ -public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { +public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane { private static final long serialVersionUID = -4414343926082129759L; private UIButtonGroup gaugeLayout;//布局:横向、纵向 @@ -61,6 +65,10 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private UISpinner thermometerWidth; private UINumberDragPane chutePercent; + private VanChartFillStylePane valueFillStylePane; + + private JPanel colorChoosePane; + public VanChartGaugeSeriesPane(ChartStylePane parent, Plot plot) { super(parent, plot); } @@ -71,16 +79,86 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f}; //TODO Bjorn - double[] rowSize = {p,p,p,p,p,p,p}; + double[] rowSize = {p, p, p, p, p, p, p}; Component[][] components = new Component[][]{ new Component[]{createGaugeLayoutPane()}, - new Component[]{createGaugeStylePane(rowSize, new double[]{f,e})}, + new Component[]{createGaugeStylePane(rowSize, new double[]{f, e})}, new Component[]{createGaugeBandsPane()} }; return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } + protected JPanel createColorChoosePane() { + vanChartFillStylePane = getVanChartFillStylePane(); + GaugeStyle style = getGaugeStyle(); + switch (style) { + case RING: + case SLOT: + case THERMOMETER: + colorChoosePane = super.createColorChoosePane(); + break; + default: + colorChoosePane = vanChartFillStylePane; + break; + } + return colorChoosePane; + } + + protected void checkFillStylePane(GradientStyle gradientStyle) { + if (colorChoosePane != null) { + colorChoosePane.setVisible(gradientStyle.getGradientType() != GradientType.CUSTOM); + } + } + + protected UIButtonGroup createDivideButton() { + return new UIButtonGroup<>(new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Style_Category"), + Toolkit.i18nText("Fine-Design_Chart_Use_Value") + }, new String[]{"category", "value"}); + } + + protected JPanel createColorDividePane() { + JPanel panel = new JPanel(new BorderLayout(0, 0)); + valueFillStylePane = getVanChartFillStylePane(); + JPanel stylePane = valueFillStylePane == null ? new JPanel() : valueFillStylePane; + + colorPickerPane = new ColorPickerPaneWithMaxMin(parentPane, "meterString", valueFillStylePane) { + protected int getBoundX() { + return 0; + } + + protected int getBoundY() { + return 10; + } + + protected double getDescriptionWidth() { + double descriptionWidth = super.getDescriptionWidth(); + if (valueFillStylePane == null) { + descriptionWidth += 3; + } + return descriptionWidth; + } + }; + panel.add(colorPickerPane, BorderLayout.NORTH); + panel.add(stylePane, BorderLayout.CENTER); + + JPanel categoryFillPane = vanChartFillStylePane == null ? new JPanel() : vanChartFillStylePane; + JPanel colorDividePane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (getColorDivideButton().getSelectedIndex() == 0) { + return categoryFillPane.getPreferredSize(); + } else { + return panel.getPreferredSize(); + } + } + }; + colorDividePane.add(categoryFillPane, "category"); + colorDividePane.add(panel, "value"); + return colorDividePane; + } + private JPanel createGaugeLayoutPane() { gaugeLayout = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical")}); @@ -105,20 +183,20 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { } private void changeLabelPosition() { - if(plot instanceof VanChartGaugePlot){ - VanChartGaugePlot gaugePlot = (VanChartGaugePlot)plot; - if (ComparatorUtils.equals(gaugePlot.getGaugeStyle(), GaugeStyle.THERMOMETER)){ + if (plot instanceof VanChartGaugePlot) { + VanChartGaugePlot gaugePlot = (VanChartGaugePlot) plot; + if (ComparatorUtils.equals(gaugePlot.getGaugeStyle(), GaugeStyle.THERMOMETER)) { ConditionAttr attrList = gaugePlot.getConditionCollection().getDefaultAttr(); - AttrLabel attrLabel = (AttrLabel)attrList.getExisted(AttrLabel.class); - if(attrLabel == null){ + AttrLabel attrLabel = (AttrLabel) attrList.getExisted(AttrLabel.class); + if (attrLabel == null) { return; } AttrLabelDetail attrLabelDetail = attrLabel.getAttrLabelDetail(); - if(attrLabelDetail == null || attrLabelDetail.getTextAttr() == null){ + if (attrLabelDetail == null || attrLabelDetail.getTextAttr() == null) { return; } attrLabelDetail.getTextAttr().setFRFont(VanChartGaugePlot.THERMOMETER_LABEL_FONT); - if(gaugeLayout.getSelectedIndex() == 0){ + if (gaugeLayout.getSelectedIndex() == 0) { attrLabel.getAttrLabelDetail().setPosition(Constants.LEFT); attrLabel.getGaugeValueLabelDetail().setPosition(Constants.LEFT); } else { @@ -133,7 +211,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { JPanel panel = new JPanel(new BorderLayout(0, 6)); JPanel centerPanel = TableLayoutHelper.createTableLayoutPane(getDiffComponentsWithGaugeStyle(), row, col); panel.add(centerPanel, BorderLayout.CENTER); - if(rotate != null){ + if (rotate != null) { JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Rotation_Direction"), rotate); panel.add(panel1, BorderLayout.NORTH); } @@ -141,7 +219,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { } private Component[][] getDiffComponentsWithGaugeStyle() { - GaugeStyle style = plot == null ? GaugeStyle.POINTER : ((VanChartGaugePlot)plot).getGaugeStyle(); + GaugeStyle style = getGaugeStyle(); switch (style) { //TODO Bjorn 仪表盘样式自动逻辑 case RING: @@ -149,8 +227,8 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return new Component[][]{ new Component[]{null, null}, getPaneBackgroundColor(), - /* getPaneBackgroundColorAuto(), - new Component[]{null, paneBackgroundColor},*/ + /* getPaneBackgroundColorAuto(), + new Component[]{null, paneBackgroundColor},*/ getInnerPaneBackgroundColor(), new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, getChutePercent() @@ -160,8 +238,8 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{null, null}, getNeedleColor(), getSlotBackgroundColor(), - /* getSlotBackgroundColorAuto(), - new Component[]{null, slotBackgroundColor},*/ + /* getSlotBackgroundColorAuto(), + new Component[]{null, slotBackgroundColor},*/ new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null}, getChutePercent() }; @@ -179,13 +257,13 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { return new Component[][]{ new Component[]{null, null}, getHingeColor(), - /* getHingeColorAuto(), - new Component[]{null, hingeColor},*/ + /* getHingeColorAuto(), + new Component[]{null, hingeColor},*/ getHingeBackgroundColor(), getNeedleColor(), getPaneBackgroundColor(), - /* getPaneBackgroundColorAuto(), - new Component[]{null, paneBackgroundColor},*/ + /* getPaneBackgroundColorAuto(), + new Component[]{null, paneBackgroundColor},*/ new Component[]{createRadiusPane(Toolkit.i18nText("Fine-Design_Chart_Radius_Set")), null} }; } @@ -212,12 +290,12 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private Component[] getHingeBackgroundColor() { hingeBackgroundColor = new ColorSelectBox(120); - return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Hinge_Background")),hingeBackgroundColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Hinge_Background")), hingeBackgroundColor}; } private Component[] getNeedleColor() { needleColor = new ColorSelectBox(120); - return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Needle")),needleColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Needle")), needleColor}; } private Component[] getPaneBackgroundColorAuto() { @@ -236,7 +314,7 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private Component[] getPaneBackgroundColor() { paneBackgroundColor = new ColorSelectBox(120); - return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Pane_Background")),paneBackgroundColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Pane_Background")), paneBackgroundColor}; } private Component[] getSlotBackgroundColorAuto() { @@ -255,17 +333,17 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private Component[] getSlotBackgroundColor() { slotBackgroundColor = new ColorSelectBox(120); - return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Slot_Background")),slotBackgroundColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Slot_Background")), slotBackgroundColor}; } private Component[] getThermometerWidth() { thermometerWidth = new UISpinnerWithPx(0, Double.MAX_VALUE, 0.1, 10); - return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Thermometer_Width")),thermometerWidth}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Thermometer_Width")), thermometerWidth}; } private Component[] getChutePercent() { chutePercent = new UINumberDragPaneWithPercent(0, 100, 1); - return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Chute_Percent")),chutePercent}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Chute_Percent")), chutePercent}; } private void initRotate() { @@ -274,12 +352,16 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { private Component[] getInnerPaneBackgroundColor() { innerPaneBackgroundColor = new ColorSelectBox(120); - return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Inner_Pane_Background")),innerPaneBackgroundColor}; + return new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Inner_Pane_Background")), innerPaneBackgroundColor}; } private JPanel createGaugeBandsPane() { - colorPickerPane = new ColorPickerPaneWithFormula(parentPane, "meterString"); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Range"), colorPickerPane); + GaugeStyle gaugeStyle = getGaugeStyle(); + if (gaugeStyle == GaugeStyle.POINTER || gaugeStyle == GaugeStyle.POINTER_SEMI) { + colorPickerPane = new ColorPickerPaneWithMaxMin(parentPane, "meterString"); + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Range"), colorPickerPane); + } + return null; } private void checkHingeColorAutoButton() { @@ -298,12 +380,12 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { } public void populateBean(Plot plot) { - if(plot == null) { + if (plot == null) { return; } super.populateBean(plot); - if(plot instanceof VanChartGaugePlot){ - VanChartGaugePlot gaugePlot = (VanChartGaugePlot)plot; + if (plot instanceof VanChartGaugePlot) { + VanChartGaugePlot gaugePlot = (VanChartGaugePlot) plot; GaugeDetailStyle detailStyle = gaugePlot.getGaugeDetailStyle(); gaugeLayout.setSelectedIndex(detailStyle.isHorizontalLayout() ? 0 : 1); @@ -319,46 +401,53 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { slotBackgroundColorAuto.setSelectedIndex(detailStyle.isSlotBackgroundColorAuto() ? 0 : 1); checkSlotBackgroundColorAutoButton(); } - if(hingeColor != null){ + if (hingeColor != null) { hingeColor.setSelectObject(detailStyle.getHingeColor()); } - if(hingeBackgroundColor != null){ + if (hingeBackgroundColor != null) { hingeBackgroundColor.setSelectObject(detailStyle.getHingeBackgroundColor()); } - if(needleColor != null){ + if (needleColor != null) { needleColor.setSelectObject(detailStyle.getNeedleColor()); } - if(paneBackgroundColor != null){ + if (paneBackgroundColor != null) { paneBackgroundColor.setSelectObject(detailStyle.getPaneBackgroundColor()); } - if(slotBackgroundColor != null){ + if (slotBackgroundColor != null) { slotBackgroundColor.setSelectObject(detailStyle.getSlotBackgroundColor()); } - if(rotate != null){ + if (rotate != null) { rotate.setSelectedIndex(detailStyle.isAntiClockWise() ? 0 : 1); } - if(innerPaneBackgroundColor != null){ + if (innerPaneBackgroundColor != null) { innerPaneBackgroundColor.setSelectObject(detailStyle.getInnerPaneBackgroundColor()); } - if(thermometerWidth != null){ + if (thermometerWidth != null) { thermometerWidth.setValue(detailStyle.getThermometerWidth()); } - if(chutePercent != null){ + if (chutePercent != null) { chutePercent.populateBean(detailStyle.getChutePercent()); } + if (getColorDivideButton() != null) { + getColorDivideButton().setSelectedIndex(detailStyle.isColorUseCategory() ? 0 : 1); + checkCardPane(); + } colorPickerPane.populateBean(detailStyle.getHotAreaColor()); + if (valueFillStylePane != null) { + valueFillStylePane.populateBean(plot.getPlotFillStyle()); + } } } @Override public void updateBean(Plot plot) { - if(plot == null){ + if (plot == null) { return; } super.updateBean(plot); - if(plot instanceof VanChartGaugePlot){ - VanChartGaugePlot gaugePlot = (VanChartGaugePlot)plot; + if (plot instanceof VanChartGaugePlot) { + VanChartGaugePlot gaugePlot = (VanChartGaugePlot) plot; GaugeDetailStyle detailStyle = gaugePlot.getGaugeDetailStyle(); detailStyle.setHorizontalLayout(gaugeLayout.getSelectedIndex() == 0); @@ -372,40 +461,65 @@ public class VanChartGaugeSeriesPane extends VanChartAbstractPlotSeriesPane { if (slotBackgroundColorAuto != null) { detailStyle.setSlotBackgroundColorAuto(slotBackgroundColorAuto.getSelectedIndex() == 0); } - if(hingeColor != null){ + if (hingeColor != null) { detailStyle.setHingeColor(hingeColor.getSelectObject()); } - if(hingeBackgroundColor != null){ + if (hingeBackgroundColor != null) { detailStyle.setHingeBackgroundColor(hingeBackgroundColor.getSelectObject()); } - if(needleColor != null){ + if (needleColor != null) { detailStyle.setNeedleColor(needleColor.getSelectObject()); } - if(paneBackgroundColor != null){ + if (paneBackgroundColor != null) { detailStyle.setPaneBackgroundColor(paneBackgroundColor.getSelectObject()); } - if(slotBackgroundColor != null){ + if (slotBackgroundColor != null) { detailStyle.setSlotBackgroundColor(slotBackgroundColor.getSelectObject()); } - if(rotate != null){ + if (rotate != null) { detailStyle.setAntiClockWise(rotate.getSelectedIndex() == 0); } - if(innerPaneBackgroundColor != null){ + if (innerPaneBackgroundColor != null) { detailStyle.setInnerPaneBackgroundColor(innerPaneBackgroundColor.getSelectObject()); } - if(thermometerWidth != null){ + if (thermometerWidth != null) { detailStyle.setThermometerWidth(thermometerWidth.getValue()); } - if(chutePercent != null){ + if (chutePercent != null) { detailStyle.setChutePercent(chutePercent.updateBean()); } colorPickerPane.updateBean(detailStyle.getHotAreaColor()); + if (getColorDivideButton() != null) { + int selectedIndex = getColorDivideButton().getSelectedIndex(); + detailStyle.setColorUseCategory(selectedIndex == 0); + } + if (!detailStyle.isColorUseCategory()) { + if (valueFillStylePane != null) { + AttrFillStyle plotFillStyle = plot.getPlotFillStyle(); + if (plotFillStyle == null) { + plotFillStyle = new AttrFillStyle(); + plot.setPlotFillStyle(plotFillStyle); + } + valueFillStylePane.updateBean(plotFillStyle); + } + } } } @Override - protected VanChartBeautyPane createStylePane() { - return null; + protected VanChartGaugeBeautyPane createStylePane() { + GaugeStyle gaugeStyle = getGaugeStyle(); + switch (gaugeStyle) { + case POINTER: + case POINTER_SEMI: + return null; + default: + return new VanChartGaugeBeautyPane(); + } + } + + private GaugeStyle getGaugeStyle() { + return plot == null ? GaugeStyle.POINTER : ((VanChartGaugePlot) plot).getGaugeStyle(); } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java index 32d217adc..0f75896e1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/ModelUtil.java @@ -2,11 +2,17 @@ package com.fr.design.designer.beans.models; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.bean.ContentChangeItem; +import com.fr.design.mod.event.WidgetNameModifyEvent; +import com.fr.event.EventDispatcher; import com.fr.form.main.Form; import com.fr.form.ui.Widget; import com.fr.stable.StringUtils; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; import java.util.Set; /** @@ -25,10 +31,24 @@ abstract class ModelUtil { Set nameRelatedCreators = new HashSet<>(); //直接遍历出来目标值,然后按需处理 xCreator.traversalNameRelatedXCreators(nameRelatedCreators); + Map renameMap = new HashMap<>(); + // 避免与旧名称重复 + initDuplicated(nameRelatedCreators, duplicated); for (XCreator target : nameRelatedCreators) { String uniqueName = uniqueName(form, target, duplicated); + String oldName = target.toData().getWidgetName(); + if (StringUtils.isNotEmpty(oldName)) { + renameMap.put(oldName, uniqueName); + } target.resetCreatorName(uniqueName); } + EventDispatcher.fire(WidgetNameModifyEvent.INSTANCE, new ContentChangeItem(renameMap, xCreator.toData(), ChangeItem.WIDGET_NAME)); + } + + private static void initDuplicated(Set nameRelatedCreators, Set duplicated) { + for (XCreator xCreator : nameRelatedCreators) { + duplicated.add(xCreator.toData().getWidgetName()); + } } private static String uniqueName(Form form, XCreator xCreator, Set duplicated) { diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index dc74087c4..d105aaf48 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -25,6 +25,7 @@ import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormSelection; import com.fr.design.mainframe.FormSelectionUtils; +import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.general.ComparatorUtils; diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java index fdefc019a..e4b5377ba 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XBorderStyleWidgetCreator.java @@ -1,6 +1,7 @@ package com.fr.design.designer.creator; import com.fr.base.BaseFormula; +import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.design.border.UIRoundedBorder; import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.Label; @@ -31,6 +32,11 @@ public class XBorderStyleWidgetCreator extends XWidgetCreator{ public XBorderStyleWidgetCreator(Widget widget, Dimension initSize) { super(widget, initSize); + + ExtendSharableAttrMark sharableAttrMark = this.toData().getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); + if (sharableAttrMark != null) { + this.setShareId(sharableAttrMark.getShareId()); + } } /** diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index a6a29339e..682dcc4d4 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -17,7 +17,6 @@ import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.HelpDialogManager; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.module.DesignModuleFactory; import com.fr.form.ui.BaseChartEditor; @@ -256,6 +255,10 @@ public class XChartEditor extends XBorderStyleWidgetCreator { * @param e 鼠标点击事件 */ public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { + if (this.isShareConfigButtonFocus()) { + CoverReportPane.showShareConfig(((XCreator) this.getParent()).toData()); + return; + } FormDesigner designer = editingMouseListener.getDesigner(); SelectionModel selectionModel = editingMouseListener.getSelectionModel(); isEditing = e.getButton() == MouseEvent.BUTTON1 && @@ -273,10 +276,6 @@ public class XChartEditor extends XBorderStyleWidgetCreator { } } } - HelpDialogManager.getInstance().setPane(coverPanel); - if (this.isHelpBtnOnFocus()) { - coverPanel.setMsgDisplay(e); - } } @Override @@ -315,23 +314,6 @@ public class XChartEditor extends XBorderStyleWidgetCreator { return editor; } - /** - * 是否展现覆盖的pane - * - * @param display 是否 - */ - public void displayCoverPane(boolean display) { - isHovering = display; - coverPanel.setVisible(display); - coverPanel.setPreferredSize(editor.getPreferredSize()); - coverPanel.setBounds(editor.getBounds()); - editor.repaint(); - } - - public JComponent getCoverPane() { - return coverPanel; - } - /** * 是否支持设置可用 * return boolean diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index c7c91d9aa..01d53f850 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -5,11 +5,13 @@ package com.fr.design.designer.creator; import com.fr.base.GraphHelper; import com.fr.base.vcs.DesignerMode; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.events.DesignerEditor; import com.fr.design.designer.beans.models.SelectionModel; +import com.fr.design.fun.ShareWidgetUIProcessor; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.layout.FRGUIPaneFactory; @@ -24,16 +26,11 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WTitleLayout; import com.fr.stable.Constants; -import com.fr.stable.CoreGraphHelper; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import com.fr.third.javax.annotation.Nullable; import javax.swing.BorderFactory; -import javax.swing.Icon; -import javax.swing.ImageIcon; import javax.swing.JComponent; -import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.border.Border; import java.awt.BorderLayout; @@ -43,7 +40,6 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Rectangle; import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; import java.beans.IntrospectionException; import java.util.ArrayList; import java.util.List; @@ -71,7 +67,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo private int[] directions; private Rectangle backupBound; private String shareId = StringUtils.EMPTY;//如果组件是共享的会有这个属性 - private boolean isHelpBtnOnFocus = false;//焦点是否在帮助按钮上 + private boolean isShareConfigButtonFocus = false;//焦点是否在帮助按钮上 private static final int SHORTS_SEPARATOR_POS = 4; // 弹出菜单分割的位置 public XCreator(Widget ob, Dimension initSize) { @@ -304,6 +300,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo @Override public JComponent createToolPane(BaseJForm jform, FormDesigner formEditor) { if (!DesignerMode.isAuthorityEditing()) { + ShareWidgetUIProcessor exportProcessor = ExtraDesignClassManager.getInstance().getSingle(ShareWidgetUIProcessor.MARK_STRING); + if (exportProcessor != null) { + return exportProcessor.createToolPane(this, jform, formEditor); + } if (isDedicateContainer() && this.getComponentCount() > 0) { // 图表块和报表块由于控件树处不显示,但对应的属性表要显示,此处处理下 XCreator child = ((XLayoutContainer) this).getXCreator(0); @@ -658,6 +658,9 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public void setShareId(String shareId) { this.shareId = shareId; + if (coverPanel != null) { + coverPanel.setShared(isShared()); + } } public String getShareId() { @@ -668,54 +671,31 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo * 焦点是否在帮助按钮上 * @return 焦点是否在帮助按钮上 */ - public boolean isHelpBtnOnFocus() { - return isHelpBtnOnFocus; + public boolean isShareConfigButtonFocus() { + return isShareConfigButtonFocus; } - public void setHelpBtnOnFocus(boolean helpBtnOnFocus) { - isHelpBtnOnFocus = helpBtnOnFocus; + public void setShareConfigButtonFocus(boolean shareConfigButtonFocus) { + isShareConfigButtonFocus = shareConfigButtonFocus; } - /** - * 设置描述信息 - * @param msg 帮助信息 - */ - public void setXDescrption(String msg){ - if (coverPanel != null) { - coverPanel.setHelpMsg(msg); - } - } - public JComponent getCoverPane(){ + public CoverReportPane getCoverPane(){ return coverPanel; } - /** - * 销毁帮助提示框 - */ - public void destroyHelpDialog(){ - if (coverPanel != null) { - coverPanel.destroyHelpDialog(); - } - } - /** * 是否展现覆盖的pane * @param display 是否 */ public void displayCoverPane(boolean display){ - } - - /** - * 根据widget设置Xcreator描述信息 - * @param widget - */ - public void setXDescrption(Widget widget){ - if (widget != null) { - setXDescrption(widget.getDescription()); + if (coverPanel != null) { + coverPanel.setVisible(display); + coverPanel.setPreferredSize(editor.getPreferredSize()); + coverPanel.setBounds(editor.getBounds()); + editor.repaint(); } } - /** * 按照比例调整组件的宽度 * @param percent 比例 @@ -815,7 +795,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public boolean isTopable() { return true; } - + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 260318023..945d3bfdd 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -257,7 +257,6 @@ public class XCreatorUtils { FineLoggerFactory.getLogger().error("Error to create xcreator!"); creator = new NullCreator(widget, d); } - creator.setXDescrption(widget);//设置描述信息 return creator; } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index 14e0a6511..9c459e986 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -32,345 +32,324 @@ import java.beans.IntrospectionException; import java.beans.PropertyDescriptor; import java.util.Set; -public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider{ - private UILabel imageLable; - private CoverReportPane coverPanel; - private FormDesigner designer; - private static BufferedImage DEFAULT_BACKGROUND; - private boolean isHovering = false; - - static{ - try{ - DEFAULT_BACKGROUND = BaseUtils.readImageWithCache("com/fr/base/images/report/elementcase.png"); - }catch (Throwable e) { - //IBM jdk 1.5.0_22 并发下读取图片有时会异常(EOFException), 这个图片反正只有设计器用到, 捕获住 - DEFAULT_BACKGROUND = CoreGraphHelper.createBufferedImage(0, 0); - } - } - - public XElementCase(ElementCaseEditor widget, Dimension initSize) { - super(widget, initSize); - - - } - - protected void initXCreatorProperties() { - super.initXCreatorProperties(); - - // 报表块初始化时要加载对应的borderStyle - initBorderStyle(); - } - - /** - * 是否支持设置标题 - * @return 是返回true - */ - public boolean hasTitleStyle() { - return true; - } - - /** - * 返回组件属性值 - * @return 返回组件属性值 - * @throws IntrospectionException 异常 - */ - public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { - - CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ - new CRPropertyDescriptor("widgetName", this.data.getClass()) - .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), - new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - makeVisible(toData().isVisible()); - } - }), - new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( - WLayoutBorderStyleEditor.class).setI18NName( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") - .setPropertyChangeListener(new PropertyChangeAdapter() { - - @Override - public void propertyChange() { - initStyle(); - } - }), - new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) - .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), - new CRPropertyDescriptor("toolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) - .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_EC_Toolbar")) - .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") - - - }; - CRPropertyDescriptor[] extraTableEditor = getExtraTableEditor(); - return ArrayUtils.addAll(propertyTableEditor, extraTableEditor); - } - - - public CRPropertyDescriptor[] getExtraTableEditor(){ - CRPropertyDescriptor[] extraTableEditor = resolveCompatible(); - CRPropertyDescriptor reportFitEditor = getReportFitEditor(); - if (reportFitEditor == null) { - return extraTableEditor; - } - return ArrayUtils.add(extraTableEditor, reportFitEditor); - } - - @Override - public boolean supportMobileStyle() { - return false; - } - - private CRPropertyDescriptor getReportFitEditor() { - this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - FitProvider wbTpl = designer.getTarget(); - ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); - ElementCaseEditor editor = this.toData(); - //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) - if (editor.getFitStateInPC() == 0) { - editor.setReportFitAttr(null); - } - ReportFitAttr reportFit = editor.getReportFitAttr(); - if(fitAttr != null){ - reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; - } - ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; - BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); - CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); - if (editor.getReportFitAttr() == null) { - editor.setReportFitInPc(browserFitPropertyEditor.getFitStateInPC(fitAttr)); - } - return extraEditor; - } - - - private CRPropertyDescriptor[] resolveCompatible() { - CRPropertyDescriptor[] extraProperty = new CRPropertyDescriptor[0]; - //这边有个插件兼容问题,之后还是要改回process才行 - Set set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); - for (FormElementCaseEditorProvider provider : set) { - if (provider == null) { - continue; - } - this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - FormProvider formProvider = designer.getTarget(); - ElementCaseEditorProvider elementCaseEditorProvider = this.toData(); - PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider); - extraProperty = (CRPropertyDescriptor[]) ArrayUtils.addAll(extraProperty, extraEditor); - } - return extraProperty; - } - - @Override - protected String getIconName() { - return "text_field_16.png"; - } - - /** - * 返回组件默认名 - * @return 组件类名(小写) - */ - public String createDefaultName() { - return "report"; - } - - @Override - protected JComponent initEditor() { - if (editor == null) { - setBorder(DEFALUTBORDER); - editor = new JPanel(); - editor.setBackground(null); - editor.setLayout(null); - imageLable = initImageBackground(); - - coverPanel = new CoverReportPane(); - coverPanel.setPreferredSize(imageLable.getPreferredSize()); - coverPanel.setBounds(imageLable.getBounds()); - - editor.add(coverPanel); - coverPanel.setVisible(false); - editor.add(imageLable); - } - return editor; - } - - /** - * 从data中获取到图片背景, 并设置到Label上 - */ - private UILabel initImageBackground(){ - UILabel imageLable = new UILabel(); - BufferedImage image = toData().getECImage(); - if (image == null) { - image = DEFAULT_BACKGROUND; - } - setLabelBackground(image, imageLable); - - return imageLable; - } - - /** - * 设置指定Label的背景 - */ - private void setLabelBackground(Image image, UILabel imageLable){ - ImageIcon icon = new ImageIcon(image); - imageLable.setIcon(icon); - imageLable.setOpaque(true); - imageLable.setLayout(null); - imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); - } - - /** - * 是否展现覆盖的pane - * @param display 是否 - */ - public void displayCoverPane(boolean display){ - isHovering = display; - coverPanel.setVisible(display); - coverPanel.setBounds(1, 1, (int) editor.getBounds().getWidth(), (int) editor.getBounds().getHeight()); - editor.repaint(); - } - - /** - * 销毁帮助提示框 - */ - public void destroyHelpDialog(){ - coverPanel.destroyHelpDialog(); - } - - public JComponent getCoverPane(){ - return coverPanel; - } - - @Override - public void paintBorder(Graphics g, Rectangle bounds){ - if (!isHovering) { - super.paintBorder(g, bounds); - } - } - - - /** - * 初始化大小 - * @return 尺寸 - */ - public Dimension initEditorSize() { - return BORDER_PREFERRED_SIZE; - } - - /** - * 是否是报表块 - * @return 是 - */ - public boolean isReport() { - return true; - } - - /** - * 该组件是否可以拖入参数面板 - * @return 是则返回true - */ - public boolean canEnterIntoParaPane(){ - return false; - } - - /** - * 返回报表块对应的widget - * @return 返回ElementCaseEditor - */ - public ElementCaseEditor toData() { - return ((ElementCaseEditor) data); - } - - public FormElementCaseProvider getElementCase() { - return toData().getElementCase(); - } - - public String getElementCaseContainerName() { - return toData().getWidgetName(); - } - - public void setElementCase(FormElementCaseProvider el) { - toData().setElementCase(el); - } - - public void setBackground(BufferedImage image){ - toData().setECImage(image); - setEditorIcon(image); - } - - private void setEditorIcon(BufferedImage image){ - setLabelBackground(image, imageLable); - } - - public Dimension getSize(){ - return new Dimension(this.getWidth(), this.getHeight()); - } - - /** - * 响应点击事件 - * @param editingMouseListener 事件处理器 - * @param e 点击事件 - */ - public void respondClick(EditingMouseListener editingMouseListener,MouseEvent e){ - HelpDialogManager.getInstance().setPane(coverPanel); - super.respondClick(editingMouseListener, e); - editingMouseListener.refreshTopXCreator(); - if (this.isHelpBtnOnFocus()) { - coverPanel.setMsgDisplay(e); - } else { - switchTab(e, editingMouseListener); - } - } - - - private void switchTab(MouseEvent e,EditingMouseListener editingMouseListener){ - FormDesigner designer = editingMouseListener.getDesigner(); - if (e.getButton() == MouseEvent.BUTTON1 && - (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR)){ - FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e); - //切换设计器 - designer.switchTab(component); - } - } - - @Override - public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { - return new WidgetPropertyUIProvider[]{ new ElementCasePropertyUI(this)}; - } - - @Override - public void setXDescrption(String msg) { - coverPanel.setHelpMsg(msg); - } - - /** - * data属性改变触发其他操作 - * - */ - public void firePropertyChange(){ - initStyle(); - } - - /** - * 是否支持设置可用 - * return boolean - */ - public boolean supportSetEnable(){ - return false; - } - - /** - * 是否支持共享-现只支持报表块、图表、tab块、绝对布局 - * @return - */ - public boolean isSupportShared() { - return true; - } - - - +public class XElementCase extends XBorderStyleWidgetCreator implements FormElementCaseContainerProvider { + private UILabel imageLable; + private FormDesigner designer; + private static BufferedImage DEFAULT_BACKGROUND; + private boolean isHovering = false; + + static { + try { + DEFAULT_BACKGROUND = BaseUtils.readImageWithCache("com/fr/base/images/report/elementcase.png"); + } catch (Throwable e) { + //IBM jdk 1.5.0_22 并发下读取图片有时会异常(EOFException), 这个图片反正只有设计器用到, 捕获住 + DEFAULT_BACKGROUND = CoreGraphHelper.createBufferedImage(0, 0); + } + } + + public XElementCase(ElementCaseEditor widget, Dimension initSize) { + super(widget, initSize); + + + } + + protected void initXCreatorProperties() { + super.initXCreatorProperties(); + + // 报表块初始化时要加载对应的borderStyle + initBorderStyle(); + } + + /** + * 是否支持设置标题 + * @return 是返回true + */ + public boolean hasTitleStyle() { + return true; + } + + /** + * 返回组件属性值 + * @return 返回组件属性值 + * @throws IntrospectionException 异常 + */ + public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { + + CRPropertyDescriptor[] propertyTableEditor = new CRPropertyDescriptor[]{ + new CRPropertyDescriptor("widgetName", this.data.getClass()) + .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Form_Widget_Name")), + new CRPropertyDescriptor("visible", this.data.getClass()).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Visible")).setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + makeVisible(toData().isVisible()); + } + }), + new CRPropertyDescriptor("borderStyle", this.data.getClass()).setEditorClass( + WLayoutBorderStyleEditor.class).setI18NName( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + .setPropertyChangeListener(new PropertyChangeAdapter() { + + @Override + public void propertyChange() { + initStyle(); + } + }), + new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) + .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced"), + new CRPropertyDescriptor("toolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) + .setI18NName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_EC_Toolbar")) + .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Fine-Design_Basic_Advanced") + + + }; + CRPropertyDescriptor[] extraTableEditor = getExtraTableEditor(); + return ArrayUtils.addAll(propertyTableEditor, extraTableEditor); + } + + + public CRPropertyDescriptor[] getExtraTableEditor() { + CRPropertyDescriptor[] extraTableEditor = resolveCompatible(); + CRPropertyDescriptor reportFitEditor = getReportFitEditor(); + if (reportFitEditor == null) { + return extraTableEditor; + } + return ArrayUtils.add(extraTableEditor, reportFitEditor); + } + + @Override + public boolean supportMobileStyle() { + return false; + } + + private CRPropertyDescriptor getReportFitEditor() { + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + FitProvider wbTpl = designer.getTarget(); + ReportFitAttr fitAttr = wbTpl.getReportFitAttr(); + ElementCaseEditor editor = this.toData(); + //兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) + if (editor.getFitStateInPC() == 0) { + editor.setReportFitAttr(null); + } + ReportFitAttr reportFit = editor.getReportFitAttr(); + if (fitAttr != null) { + reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr; + } + ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit; + BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); + CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); + if (editor.getReportFitAttr() == null) { + editor.setReportFitInPc(browserFitPropertyEditor.getFitStateInPC(fitAttr)); + } + return extraEditor; + } + + + private CRPropertyDescriptor[] resolveCompatible() { + CRPropertyDescriptor[] extraProperty = new CRPropertyDescriptor[0]; + //这边有个插件兼容问题,之后还是要改回process才行 + Set set = ExtraDesignClassManager.getInstance().getArray(AbstractFormElementCaseEditorProvider.MARK_STRING); + for (FormElementCaseEditorProvider provider : set) { + if (provider == null) { + continue; + } + this.designer = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + FormProvider formProvider = designer.getTarget(); + ElementCaseEditorProvider elementCaseEditorProvider = this.toData(); + PropertyDescriptor[] extraEditor = provider.createPropertyDescriptor(this.data.getClass(), formProvider, elementCaseEditorProvider); + extraProperty = (CRPropertyDescriptor[]) ArrayUtils.addAll(extraProperty, extraEditor); + } + return extraProperty; + } + + @Override + protected String getIconName() { + return "text_field_16.png"; + } + + /** + * 返回组件默认名 + * @return 组件类名(小写) + */ + public String createDefaultName() { + return "report"; + } + + @Override + protected JComponent initEditor() { + if (editor == null) { + setBorder(DEFALUTBORDER); + editor = new JPanel(); + editor.setBackground(null); + editor.setLayout(null); + imageLable = initImageBackground(); + + coverPanel = new CoverReportPane(); + coverPanel.setPreferredSize(imageLable.getPreferredSize()); + coverPanel.setBounds(imageLable.getBounds()); + + editor.add(coverPanel); + coverPanel.setVisible(false); + editor.add(imageLable); + } + return editor; + } + + /** + * 从data中获取到图片背景, 并设置到Label上 + */ + private UILabel initImageBackground() { + UILabel imageLable = new UILabel(); + BufferedImage image = toData().getECImage(); + if (image == null) { + image = DEFAULT_BACKGROUND; + } + setLabelBackground(image, imageLable); + + return imageLable; + } + + /** + * 设置指定Label的背景 + */ + private void setLabelBackground(Image image, UILabel imageLable) { + ImageIcon icon = new ImageIcon(image); + imageLable.setIcon(icon); + imageLable.setOpaque(true); + imageLable.setLayout(null); + imageLable.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight()); + } + + @Override + public void paintBorder(Graphics g, Rectangle bounds) { + if (!isHovering) { + super.paintBorder(g, bounds); + } + } + + + /** + * 初始化大小 + * @return 尺寸 + */ + public Dimension initEditorSize() { + return BORDER_PREFERRED_SIZE; + } + + /** + * 是否是报表块 + * @return 是 + */ + public boolean isReport() { + return true; + } + + /** + * 该组件是否可以拖入参数面板 + * @return 是则返回true + */ + public boolean canEnterIntoParaPane() { + return false; + } + + /** + * 返回报表块对应的widget + * @return 返回ElementCaseEditor + */ + public ElementCaseEditor toData() { + return ((ElementCaseEditor) data); + } + + public FormElementCaseProvider getElementCase() { + return toData().getElementCase(); + } + + public String getElementCaseContainerName() { + return toData().getWidgetName(); + } + + public void setElementCase(FormElementCaseProvider el) { + toData().setElementCase(el); + } + + public void setBackground(BufferedImage image) { + toData().getElementCaseImage().adjustImageBytes(image); + setEditorIcon(toData().getECImage() == null ? DEFAULT_BACKGROUND : toData().getECImage()); + } + + public void updateECImage() { + XElementCase self = this; + self.toData().getElementCaseImage().updateImage(() -> { + self.setEditorIcon(self.toData().getECImage() == null ? DEFAULT_BACKGROUND : self.toData().getECImage()); + if (self.designer != null) { + self.designer.repaint(); + } + }); + } + + + private void setEditorIcon(BufferedImage image) { + setLabelBackground(image, imageLable); + } + + public Dimension getSize() { + return new Dimension(this.getWidth(), this.getHeight()); + } + + /** + * 响应点击事件 + * @param editingMouseListener 事件处理器 + * @param e 点击事件 + */ + public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { + super.respondClick(editingMouseListener, e); + editingMouseListener.refreshTopXCreator(); + if (this.isShareConfigButtonFocus()) { + CoverReportPane.showShareConfig(((XCreator) this.getParent()).toData()); + } else { + switchTab(e, editingMouseListener); + } + } + + + private void switchTab(MouseEvent e, EditingMouseListener editingMouseListener) { + FormDesigner designer = editingMouseListener.getDesigner(); + if (e.getButton() == MouseEvent.BUTTON1 && + (e.getClickCount() == 2 || designer.getCursor().getType() == Cursor.HAND_CURSOR)) { + FormElementCaseContainerProvider component = (FormElementCaseContainerProvider) designer.getComponentAt(e); + //切换设计器 + designer.switchTab(component); + } + } + + @Override + public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() { + return new WidgetPropertyUIProvider[]{new ElementCasePropertyUI(this)}; + } + + /** + * data属性改变触发其他操作 + * + */ + public void firePropertyChange() { + initStyle(); + } + + /** + * 是否支持设置可用 + * return boolean + */ + public boolean supportSetEnable() { + return false; + } + + /** + * 是否支持共享-现只支持报表块、图表、tab块、绝对布局 + * @return + */ + public boolean isSupportShared() { + return true; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index da268b0e6..32273ca08 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -4,8 +4,6 @@ package com.fr.design.designer.creator; import com.fr.base.GraphHelper; -import com.fr.base.iofile.attr.SharableAttrMark; -import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.LayoutAdapter; @@ -16,14 +14,11 @@ import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; import com.fr.design.form.layout.FRAbsoluteLayout; import com.fr.design.form.util.FormDesignerUtils; -import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; -import com.fr.design.icon.IconPathConstants; -import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.WidgetHelpDialog; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.form.ui.Connector; import com.fr.form.ui.Widget; @@ -31,26 +26,17 @@ import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WLayout; import com.fr.general.FRScreen; -import com.fr.general.IOUtils; - -import com.fr.share.ShareConstants; import com.fr.stable.AssistUtils; import com.fr.stable.Constants; -import javax.swing.Icon; -import java.awt.AlphaComposite; import java.awt.Color; -import java.awt.Composite; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.Rectangle; -import java.awt.RenderingHints; import java.awt.Toolkit; import java.awt.event.ContainerEvent; import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; import java.beans.IntrospectionException; import java.util.ArrayList; import java.util.HashMap; @@ -61,20 +47,14 @@ import java.util.HashMap; */ public class XWAbsoluteLayout extends XLayoutContainer { - private static final int EDIT_BTN_WIDTH = 75; - private static final int EDIT_BTN_HEIGHT = 20; private int minWidth = WLayout.MIN_WIDTH; private int minHeight = WLayout.MIN_HEIGHT; private static final Color OUTER_BORDER_COLOR = new Color(65, 155, 249, 30); private static final Color INNER_BORDER_COLOR = new Color(65, 155, 249); - private static final int BORDER_WIDTH = 1; - private Icon controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH); //由于屏幕分辨率不同,界面上的容器大小可能不是默认的100%,此时拖入组件时,保存的大小按照100%时的计算 protected double containerPercent = 1.0; - private boolean isHovering = false; - private HashMap xConnectorMap; public XWAbsoluteLayout() { @@ -462,52 +442,10 @@ public class XWAbsoluteLayout extends XLayoutContainer { super.paint(g); //如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层 if (isMouseEnter && !this.editable) { - int x = 0; - int y = 0; - int w = getWidth(); - int h = getHeight(); - - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - //画白色的编辑层 - g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 50 / 100.0F)); - g2d.setColor(XCreatorConstants.COVER_COLOR); - g2d.fillRect(x, y, w, h); - //画编辑按钮所在框 - FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - AlphaComposite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, formDesigner.getCursor().getType() != Cursor.DEFAULT_CURSOR ? 0.9f : 0.7f); - g2d.setColor(XCreatorConstants.EDIT_COLOR); - g2d.setComposite(alphaComposite); - g2d.fillRoundRect((x + w / 2 - EDIT_BTN_WIDTH / 2), (y + h / 2 - EDIT_BTN_HEIGHT / 2), EDIT_BTN_WIDTH, EDIT_BTN_HEIGHT, 4, 4); - g2d.setComposite(oldComposite); - //画编辑按钮图标 - BufferedImage image = IOUtils.readImage(IconPathConstants.EDIT_ICON_PATH); - g2d.drawImage( - image, - (x + w / 2 - 23), - (y + h / 2 - image.getHeight() / 2), - image.getWidth(), - image.getHeight(), - null, - this - ); - g2d.setColor(Color.WHITE); - //画编辑文字 - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"), x + w / 2 - 2, y + h / 2 + 5); - g.setColor(XCreatorConstants.FORM_BORDER_COLOR); - GraphHelper.draw(g, new Rectangle(BORDER_WIDTH, BORDER_WIDTH, getWidth() - BORDER_WIDTH * 2, getHeight() - BORDER_WIDTH * 2), Constants.LINE_MEDIUM); - paintExtro(g); - } - } - - public void paintExtro(Graphics g) { - if (this.toData().getWidgetAttrMark(SharableAttrMark.XML_TAG) != null) { - int width = getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW; - g.setColor(UIConstants.NORMAL_BACKGROUND); - g.fillArc(width, 0, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, - 0, 360); - controlMode.paintIcon(this, g, width, 0); + CoverReportPane.paintEditButton(g, this); + if (isShared()) { + CoverReportPane.paintShareButton(g, this); + } } } @@ -529,9 +467,8 @@ public class XWAbsoluteLayout extends XLayoutContainer { * @param e 鼠标点击事件 */ public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e) { - //帮助弹窗 - if (this.isHelpBtnOnFocus()) { - new WidgetHelpDialog(DesignerContext.getDesignerFrame(), this.toData().getDescription()).showWindow(e); + if (this.isShareConfigButtonFocus()) { + CoverReportPane.showShareConfig(this.toData()); return; } FormDesigner designer = editingMouseListener.getDesigner(); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java index 964f0aa03..bfa841a4a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java @@ -13,6 +13,7 @@ import com.fr.form.ui.WidgetTitle; import com.fr.form.ui.container.WTitleLayout; import com.fr.general.ComparatorUtils; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; +import com.fr.stable.StringUtils; import java.awt.*; import java.awt.event.ContainerEvent; @@ -111,6 +112,21 @@ public class XWTitleLayout extends DedicateLayoutContainer { return null; } + + /** + * 返回body组件 + * @return body组件 + */ + public XCreator getBodyCreator() { + for (int i=0; i < getXCreatorCount(); i++) { + XCreator creator = getXCreator(i); + if (creator.hasTitleStyle()) { + return creator; + } + } + return null; + } + /** * 编辑状态的时候需要重新绘制下边框 * @@ -190,4 +206,9 @@ public class XWTitleLayout extends DedicateLayoutContainer { return creator.getWidgetPropertyUIProviders(); } -} \ No newline at end of file + @Override + public void setShareId(String shareId) { + super.setShareId(shareId); + this.getEditingChildCreator().setShareId(shareId); + } +} diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java index 5b37ad313..2d5b5ba91 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardMainBorderLayout.java @@ -3,9 +3,6 @@ */ package com.fr.design.designer.creator.cardlayout; -import com.fr.base.GraphHelper; -import com.fr.base.iofile.attr.SharableAttrMark; -import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.ComponentAdapter; import com.fr.design.designer.beans.LayoutAdapter; @@ -16,13 +13,9 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWBorderLayout; import com.fr.design.designer.creator.XWidgetCreator; -import com.fr.design.form.util.XCreatorConstants; -import com.fr.design.icon.IconPathConstants; -import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.CoverReportPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.WidgetHelpDialog; -import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.form.event.Listener; import com.fr.form.ui.CardSwitchButton; import com.fr.form.ui.LayoutBorderStyle; @@ -36,25 +29,15 @@ import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.form.ui.container.cardlayout.WCardTitleLayout; import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; import com.fr.general.act.BorderPacker; -import com.fr.share.ShareConstants; -import com.fr.stable.Constants; -import javax.swing.Icon; -import java.awt.AlphaComposite; -import java.awt.Color; import java.awt.Component; -import java.awt.Composite; import java.awt.Cursor; import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.Rectangle; -import java.awt.RenderingHints; import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.List; @@ -67,15 +50,10 @@ import java.util.List; */ public class XWCardMainBorderLayout extends XWBorderLayout { - private Icon controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH); private static final int CENTER = 1; private static final int NORTH = 0; private static final int TITLE_STYLE = 2; - private static final int EDIT_BTN_WIDTH = 75; - private static final int EDIT_BTN_HEIGHT = 20; - private static final int BORDER_WIDTH = 1; - private final int CARDMAINLAYOUT_CHILD_COUNT = 1; /** @@ -358,53 +336,10 @@ public class XWCardMainBorderLayout extends XWBorderLayout { super.paint(g); //如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层 if (isMouseEnter && !editable) { - int x = 0; - int y = 0; - int w = getWidth(); - int h = getHeight(); - - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - //画白色的编辑层 - g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 50 / 100.0F)); - g2d.setColor(XCreatorConstants.COVER_COLOR); - g2d.fillRect(x, y, w, h); - //画编辑按钮所在框 - FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - AlphaComposite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, formDesigner.getCursor().getType() != Cursor.DEFAULT_CURSOR ? 0.9f : 0.7f); - g2d.setColor(XCreatorConstants.EDIT_COLOR); - g2d.setComposite(alphaComposite); - g2d.fillRoundRect((x + w / 2 - EDIT_BTN_WIDTH / 2), (y + h / 2 - EDIT_BTN_HEIGHT / 2), EDIT_BTN_WIDTH, EDIT_BTN_HEIGHT, 4, 4); - g2d.setComposite(oldComposite); - - //画编辑按钮图标 - BufferedImage image = IOUtils.readImage(IconPathConstants.EDIT_ICON_PATH); - g2d.drawImage( - image, - (x + w / 2 - 23), - (y + h / 2 - image.getHeight() / 2), - image.getWidth(), - image.getHeight(), - null, - this - ); - g2d.setColor(Color.WHITE); - //画编辑文字 - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2d.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"), x + w / 2 - 2, y + h / 2 + 5); - g.setColor(XCreatorConstants.FORM_BORDER_COLOR); - GraphHelper.draw(g, new Rectangle(BORDER_WIDTH, BORDER_WIDTH, getWidth() - BORDER_WIDTH * 2, getHeight() - BORDER_WIDTH * 2), Constants.LINE_MEDIUM); - paintExtro(g); - } - } - - public void paintExtro(Graphics g) { - if (this.toData().getWidgetAttrMark(SharableAttrMark.XML_TAG) != null) { - int width = getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW; - g.setColor(UIConstants.NORMAL_BACKGROUND); - g.fillArc(width, 0, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, - 0, 360); - controlMode.paintIcon(this, g, width, 0); + CoverReportPane.paintEditButton(g, this); + if (isShared()) { + CoverReportPane.paintShareButton(g, this); + } } } @@ -423,9 +358,8 @@ public class XWCardMainBorderLayout extends XWBorderLayout { */ @Override public void respondClick(EditingMouseListener editingMouseListener, MouseEvent e){ - //帮助弹窗 - if (this.isHelpBtnOnFocus()) { - new WidgetHelpDialog(DesignerContext.getDesignerFrame(), this.toData().getDescription()).showWindow(e); + if (this.isShareConfigButtonFocus()) { + CoverReportPane.showShareConfig(this.toData()); return; } FormDesigner designer = editingMouseListener.getDesigner(); diff --git a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java index 48938dcee..e3b9b8175 100644 --- a/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java +++ b/designer-form/src/main/java/com/fr/design/designer/treeview/ComponentTreeCellRenderer.java @@ -1,8 +1,10 @@ package com.fr.design.designer.treeview; +import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.mainframe.share.util.ShareComponentUtils; import com.fr.log.FineLoggerFactory; import javax.swing.BorderFactory; @@ -10,8 +12,11 @@ import javax.swing.Icon; import javax.swing.JTree; import javax.swing.tree.DefaultTreeCellRenderer; import java.awt.Component; +import java.awt.Graphics; public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer { + private boolean needAddShareIcon = false; + private static final Icon SHARE_ICON = BaseUtils.readIcon("/com/fr/design/images/toast/reuse_icon.png"); public ComponentTreeCellRenderer() { } @@ -31,13 +36,23 @@ public class ComponentTreeCellRenderer extends DefaultTreeCellRenderer { } if (icon != null) { setIcon(icon); + this.needAddShareIcon = ShareComponentUtils.isShareWidgetWithChild((XCreator) value); } + } this.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 0)); this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); return this; } + + public void paint(Graphics g) { + super.paint(g); + if (needAddShareIcon) { + SHARE_ICON.paintIcon(this, g, 10, 0); + } + } + @Override public Icon getClosedIcon() { return getIcon(); diff --git a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java index 3e248f3ba..ded4e7c99 100644 --- a/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java +++ b/designer-form/src/main/java/com/fr/design/form/util/FormDesignerUtils.java @@ -11,6 +11,7 @@ import com.fr.design.mainframe.template.info.ComponentCreateOperate; import com.fr.design.mainframe.template.info.ComponentDeleteOperate; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WFitLayout; + import java.awt.Container; @@ -40,11 +41,19 @@ public class FormDesignerUtils { } + /** + * 添加控件 + * 被云端运维插件修改用于收集埋点 + */ public static void addWidgetProcessInfo(Widget widget) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); jTemplate.getProcessInfo().updateTemplateOperationInfo(new ComponentCreateOperate(widget)); } + /** + * 删除控件 + * 被云端运维插件修改用于收集埋点 + */ public static void removeWidgetProcessInfo(Widget widget) { JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); jTemplate.getProcessInfo().updateTemplateOperationInfo(new ComponentDeleteOperate(widget)); diff --git a/designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java b/designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java new file mode 100644 index 000000000..510b2cddd --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/fun/ShareWidgetUIProcessor.java @@ -0,0 +1,29 @@ +package com.fr.design.fun; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.FormDesigner; +import com.fr.stable.fun.mark.Immutable; + +import javax.swing.JComponent; + + +/** + * Created by kerry on 5/28/21 + */ +public interface ShareWidgetUIProcessor extends Immutable { + + String MARK_STRING = "ShareWidgetUIProcessor"; + + int CURRENT_LEVEL = 1; + + /** + * 生成属性配置界面 + * + * @param xCreator 选中的Xcreator + * @param formDesigner 表单设计器 + * @return 属性配置界面 + */ + JComponent createToolPane(XCreator xCreator, BaseJForm jform, FormDesigner formDesigner); + +} diff --git a/designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java b/designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java new file mode 100644 index 000000000..e0eddd09d --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/fun/impl/AbstractShareWidgetUIProcessor.java @@ -0,0 +1,19 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.ShareWidgetUIProcessor; +import com.fr.stable.fun.mark.API; + +/** + * Created by kerry on 5/28/21 + */ +@API(level = ShareWidgetUIProcessor.CURRENT_LEVEL) +public abstract class AbstractShareWidgetUIProcessor implements ShareWidgetUIProcessor { + + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } +} diff --git a/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java b/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java new file mode 100644 index 000000000..72ff96982 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/gui/controlpane/EventPropertyPane.java @@ -0,0 +1,100 @@ +package com.fr.design.gui.controlpane; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.properties.EventPropertyTable; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.widget.EventCreator; +import com.fr.form.event.Listener; +import com.fr.form.ui.Widget; +import com.fr.general.NameObject; +import com.fr.stable.Nameable; + +/** + * Created by kerry on 5/17/21 + */ +public class EventPropertyPane extends UIListGroupControlPane { + private XCreator creator; + + private FormDesigner designer; + + + public EventPropertyPane(FormDesigner designer) { + super(); + this.designer = designer; + } + + + /** + * 刷新 + */ + public void refresh() { + int selectionSize = designer.getSelectionModel().getSelection().size(); + if (selectionSize == 0 || selectionSize == 1) { + this.creator = selectionSize == 0 ? designer.getRootComponent() : designer.getSelectionModel() + .getSelection().getSelectedCreator(); + } else { + this.creator = null; + this.getContentPane().removeAll(); + checkButtonEnabled(); + return; + } + Widget widget = creator.toData(); + refreshPane(widget, EventCreator.createEventCreator(widget.supportedEvents(), EventPropertyTable.WidgetEventListenerUpdatePane.class)); + } + + + + public void populateNameObjects() { + Widget widget = creator.toData(); + populateNameObjects(widget); + } + + /** + * 更新控件事件 + * + * @param creator 控件 + */ + public void updateWidgetListener(XCreator creator) { + (creator.toData()).clearListeners(); + Nameable[] res = this.update(); + for (int i = 0; i < res.length; i++) { + NameObject nameObject = (NameObject) res[i]; + (creator.toData()).addListener((Listener) nameObject.getObject()); + } + + designer.fireTargetModified(); + checkButtonEnabled(); + } + + + @Override + public NameableCreator[] createNameableCreators() { + return new NameableCreator[]{ + new EventCreator(Widget.EVENT_STATECHANGE, EventPropertyTable.WidgetEventListenerUpdatePane.class) + }; + } + + @Override + public void saveSettings() { + if (isPopulating()) { + return; + } + updateWidgetListener(creator); + } + + @Override + protected String title4PopupWindow() { + return "Event"; + } + + @Override + public String getAddItemText() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_Event"); + } + + protected String getWrapperLabelText(){ + return Toolkit.i18nText("Fine-Design_Report_Event"); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java b/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java index a4c401440..f63c43055 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/CoverPane.java @@ -13,13 +13,12 @@ import java.awt.AlphaComposite; import java.awt.Color; import java.awt.Component; import java.awt.Composite; -import java.awt.Container; import java.awt.Cursor; -import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; -import java.awt.LayoutManager; import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; /** @@ -29,29 +28,52 @@ import java.awt.Rectangle; * Time: 上午9:09 */ public class CoverPane extends JComponent { - - private UIButton editButton; private AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f); - private static final int BORDER_WIDTH = 2; - private static final Color COVER_COLOR = new Color(216, 242, 253); - private static final int EDIT_BTN_WIDTH = 75; - private static final int EDIT_BTN_HEIGHT = 20; + protected static final int BORDER_WIDTH = 2; + public static final int EDIT_BTN_W = 75; + public static final int EDIT_BTN_H = 20; + + public static void paintEditButton(Graphics g, Component component) { + int x = 0; + int y = 0; + int w = component.getWidth(); + int h = component.getHeight(); + + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + //画白色的编辑层 + g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 50 / 100.0F)); + g2d.setColor(XCreatorConstants.COVER_COLOR); + g2d.fillRect(x, y, w, h); + //画编辑按钮所在框 + FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + AlphaComposite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, formDesigner.getCursor().getType() != Cursor.DEFAULT_CURSOR ? 0.9f : 0.7f); + g2d.setColor(XCreatorConstants.EDIT_COLOR); + g2d.setComposite(alphaComposite); + g2d.fillRoundRect((x + w / 2 - EDIT_BTN_W / 2), (y + h / 2 - EDIT_BTN_H / 2), EDIT_BTN_W, EDIT_BTN_H, 4, 4); + g2d.setComposite(oldComposite); + //画编辑按钮图标 + BufferedImage image = IOUtils.readImage(IconPathConstants.EDIT_ICON_PATH); + g2d.drawImage( + image, + (x + w / 2 - 23), + (y + h / 2 - image.getHeight() / 2), + image.getWidth(), + image.getHeight(), + null + ); + g2d.setColor(Color.WHITE); + //画编辑文字 + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.drawString(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"), x + w / 2 - 2, y + h / 2 + 5); + + g.setColor(XCreatorConstants.FORM_BORDER_COLOR); + GraphHelper.draw(g, new Rectangle(BORDER_WIDTH, BORDER_WIDTH, w - BORDER_WIDTH * 2, h - BORDER_WIDTH * 2), Constants.LINE_MEDIUM); + } public CoverPane() { - setLayout(getCoverLayout()); setBackground(null); setOpaque(false); - - editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Edit"), IOUtils.readIcon(IconPathConstants.EDIT_ICON_PATH)) { - @Override - public Dimension getPreferredSize() { - return new Dimension(60, 24); - } - }; - editButton.setBorderPainted(false); - editButton.setExtraPainted(false); - editButton.setForeground(Color.WHITE); - add(editButton); } public AlphaComposite getComposite() { @@ -62,72 +84,9 @@ public class CoverPane extends JComponent { this.composite = composite; } - public UIButton getEditButton() { - return editButton; - } - - public void setEditButton(UIButton editButton) { - this.editButton = editButton; - } - - protected LayoutManager getCoverLayout() { - return new LayoutManager() { - - @Override - public void removeLayoutComponent(Component comp) { - } - - @Override - public Dimension preferredLayoutSize(Container parent) { - return parent.getPreferredSize(); - } - - @Override - public Dimension minimumLayoutSize(Container parent) { - return null; - } - - @Override - public void layoutContainer(Container parent) { - int width = parent.getParent().getWidth(); - int height = parent.getParent().getHeight(); - int preferWidth = editButton.getPreferredSize().width; - int preferHeight = editButton.getPreferredSize().height; - editButton.setBounds((width - preferWidth) / 2, (height - preferHeight) / 2, preferWidth, preferHeight); - } - - @Override - public void addLayoutComponent(String name, Component comp) { - } - }; - } - public void paint(Graphics g) { - int x = 0; - int y = 0; - int w = getWidth(); - int h = getHeight(); - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - g2d.setComposite(composite); - g2d.setColor(COVER_COLOR); - g2d.fillRect(0, 0, getWidth(), getHeight()); - FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - g2d.setColor(XCreatorConstants.EDIT_COLOR); - boolean editHover = formDesigner.getCursor().getType() != Cursor.DEFAULT_CURSOR; - AlphaComposite alphaComposite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, editHover ? 0.9f : 0.7f); - g2d.setComposite(alphaComposite); - g2d.fillRoundRect((x + w / 2 - EDIT_BTN_WIDTH / 2), (y + h / 2 - EDIT_BTN_HEIGHT / 2), EDIT_BTN_WIDTH, EDIT_BTN_HEIGHT, 4, 4); - g2d.setComposite(oldComposite); - g.setColor(XCreatorConstants.FORM_BORDER_COLOR); - GraphHelper.draw(g, getPaintBorderBounds(), Constants.LINE_MEDIUM); - - super.paint(g); - } - - protected Rectangle getPaintBorderBounds(){ - return new Rectangle(BORDER_WIDTH, BORDER_WIDTH, getWidth() - BORDER_WIDTH * 2 , getHeight() - BORDER_WIDTH * 2); + paintEditButton(g, this); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/CoverReportPane.java b/designer-form/src/main/java/com/fr/design/mainframe/CoverReportPane.java index d976691c6..14b8aed7a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/CoverReportPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/CoverReportPane.java @@ -1,18 +1,20 @@ package com.fr.design.mainframe; -import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.icon.IconPathConstants; -import com.fr.share.ShareConstants; -import com.fr.general.FRScreen; -import com.fr.general.IOUtils; -import com.fr.stable.StringUtils; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; +import com.fr.base.BaseUtils; +import com.fr.design.dialog.BasicPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.constants.ShareEntryKey; +import com.fr.form.ui.Widget; +import com.fr.stable.Constants; +import com.fr.stable.bridge.StableFactory; + +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; +import java.awt.image.BufferedImage; +import java.util.HashMap; /** * 报表块的封面(如果后面所有的组件都有帮助信息的话就抽接口吧) @@ -20,123 +22,61 @@ import java.awt.event.WindowEvent; * Date: 2016/11/2 * Time: 11:32 */ -public class CoverReportPane extends CoverPane implements HelpDialogHandler{ - private static final int BORDER_WIDTH = 1; - private Icon controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH); - private JComponent controlButton = new JComponent() { - protected void paintComponent(Graphics g) { - g.setColor(UIConstants.NORMAL_BACKGROUND); - g.fillArc(0, 0, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, ShareConstants.SHARE_EL_CONTROL_BUTTON_HW, - 0, 360); - controlMode.paintIcon(this, g, 0, 0); - } - }; - - - private String helpMsg;//帮助信息(后续帮助信息可能会变成标配,就直接放这边了) - - private WidgetHelpDialog helpDialog = null; - - public CoverReportPane() { - this(StringUtils.EMPTY); - } - - public CoverReportPane(String helpMsg) { - super(); - this.helpMsg = helpMsg; +public class CoverReportPane extends CoverPane{ + public static final int SHARE_CONF_BTN_W = 90; + public static final int SHARE_CONF_BTN_H = 24; + + public static final Color SHARE_BTN_BG = new Color(152, 193, 250); + + public static void showShareConfig(Widget widget) { + Object[] compositeArg = new Object[]{widget}; + HashMap compoClass = new HashMap(); + compoClass.put(Constants.ARG_0, Widget.class); + BasicPane shareGuidePane = StableFactory.getMarkedInstanceObjectFromClass(ShareEntryKey.SHARE_CONFIG, compositeArg, compoClass, BasicPane.class); + shareGuidePane.show(); } - public String getHelpMsg() { - return helpMsg; + public static void paintShareButton(Graphics g, Component component) { + int x = component.getWidth() - SHARE_CONF_BTN_W; + int y = 0; + + Graphics2D g2d = (Graphics2D) g; + g2d.setColor(SHARE_BTN_BG); + g2d.fillRoundRect(x ,y, SHARE_CONF_BTN_W, SHARE_CONF_BTN_H,5,5); + g2d.setColor(Color.WHITE); + + // 画配置文字 + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + g2d.drawString(Toolkit.i18nText("Fine-Design_Share_Help_Settings"),x + 30, 17); + // 画图标 + BufferedImage image = BaseUtils.readImage("com/fr/base/images/share/config.png"); + g2d.drawImage(image, x + 10, 5, image.getWidth(), image.getHeight(), null); } - public void setHelpMsg(String helpMsg) { - this.helpMsg = helpMsg; - //帮助信息为空就不显示帮助按钮 - if (StringUtils.isNotEmpty(helpMsg)) { - add(controlButton); - } - } + private boolean isShared = false; - public void setMsgDisplay(MouseEvent e) { - if (helpDialog == null) { -// controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_CLOSE_ICON_PATH); - controlButton.setVisible(false); - helpDialog = new WidgetHelpDialog(DesignerContext.getDesignerFrame(), helpMsg); - double screenValue = FRScreen.getDesignScreenByDimension(Toolkit.getDefaultToolkit().getScreenSize()).getValue(); - int offsetX = 0; - if (screenValue < FormArea.DEFAULT_SLIDER) { - offsetX = (int) ((1 - screenValue / FormArea.DEFAULT_SLIDER) - * WidgetPropertyPane.getInstance().getEditingFormDesigner().getRootComponent().getWidth() / 2); - } - int rX = WestRegionContainerPane.getInstance().getWidth() + e.getX() + offsetX - 227;//弹出框宽度190加上图标的宽度27加上10的偏移 - int rY = 165 + e.getY();//165是设计器最上面几个面板的高度 - helpDialog.setLocationRelativeTo(DesignerContext.getDesignerFrame(), rX, rY); - helpDialog.showWindow(); - helpDialog.addWindowListener(new WindowAdapter() { - @Override - public void windowClosed(WindowEvent e) { - helpDialog = null; - controlButton.setVisible(true); - } - }); - HelpDialogManager.getInstance().setPane(this); - } + public CoverReportPane() { + this(false); } - protected LayoutManager getCoverLayout() { - return new LayoutManager() { - - @Override - public void removeLayoutComponent(Component comp) { - } - - @Override - public Dimension preferredLayoutSize(Container parent) { - return parent.getPreferredSize(); - } - - @Override - public Dimension minimumLayoutSize(Container parent) { - return null; - } - - @Override - public void layoutContainer(Container parent) { - UIButton editButton = getEditButton(); - int width = parent.getParent().getWidth(); - int height = parent.getParent().getHeight(); - int preferWidth = editButton.getPreferredSize().width; - int preferHeight = editButton.getPreferredSize().height; - editButton.setBounds((width - preferWidth) / 2, (height - preferHeight) / 2, preferWidth, preferHeight); - controlButton.setBounds((width - 28), 0, 27, 27); - } - - @Override - public void addLayoutComponent(String name, Component comp) { - } - }; + public CoverReportPane(boolean shared) { + super(); + isShared = shared; } - public void destroyHelpDialog() { - if (helpDialog != null) { - controlMode = IOUtils.readIcon(IconPathConstants.TD_EL_SHARE_HELP_ICON_PATH); - controlButton.repaint(); - helpDialog.dispose(); - helpDialog = null; - } + public boolean isShared() { + return isShared; } - @Override - protected Rectangle getPaintBorderBounds(){ - return new Rectangle(BORDER_WIDTH, BORDER_WIDTH, getWidth() - 3 * BORDER_WIDTH , getHeight() - 3 * BORDER_WIDTH); + public void setShared(boolean shared) { + isShared = shared; } @Override - public void setVisible(boolean aFlag) { - super.setVisible(aFlag); -// if (aFlag) { -// HelpDialogManager.getInstance().setPane(this); -// } + public void paint(Graphics g) { + super.paint(g); + if (isShared()) { + paintShareButton(g, this); + } } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 524dd8bf1..fd1236091 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -11,6 +11,7 @@ import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Location; import com.fr.design.designer.beans.models.SelectionModel; import com.fr.design.designer.beans.models.StateModel; +import com.fr.design.designer.creator.XBorderStyleWidgetCreator; import com.fr.design.designer.creator.XChartEditor; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; @@ -28,9 +29,7 @@ import com.fr.design.icon.IconPathConstants; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.LayoutUtils; -import com.fr.share.ShareConstants; import com.fr.stable.Constants; -import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JComponent; @@ -41,6 +40,7 @@ import javax.swing.event.MouseInputAdapter; import java.awt.Color; import java.awt.Container; import java.awt.Cursor; +import java.awt.Insets; import java.awt.Rectangle; import java.awt.event.MouseEvent; @@ -106,10 +106,10 @@ public class EditingMouseListener extends MouseInputAdapter { private int minDragSize = 5; private int minMoveSize = 8; - private static final int EDIT_BTN_WIDTH = 60; - private static final int EDIT_BTN_HEIGHT = 24; + private static final Insets DEEFAULT_INSETS = new Insets(0,0,0,0); + //报表块的编辑按钮不灵敏,范围扩大一点 - private static final int GAP = 10; + private static final int GAP = 5; private XElementCase xElementCase; private XChartEditor xChartEditor; @@ -353,62 +353,48 @@ public class EditingMouseListener extends MouseInputAdapter { } - private void elementCaseMouseMoved(MouseEvent e, XCreator component) { - xElementCase = (XElementCase) component; - UIButton button = (UIButton) xElementCase.getCoverPane().getComponent(0); - if (designer.getCursor().getType() == Cursor.HAND_CURSOR) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } // component.getParent() 是报表块所在的XWTitleLayout - int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xElementCase.getY(); - if (e.getX() + GAP - xElementCase.getInsets().left > minX && e.getX() - GAP - xElementCase.getInsets().left < minX + button.getWidth()) { - if (e.getY() + GAP - xElementCase.getInsets().top > minY && e.getY() - GAP - xElementCase.getInsets().top < minY + button.getHeight()) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + private boolean isShareConfigButton(MouseEvent e, XCreator component, Insets insets) { + if (component.isShared()) { + int minX = getParentPositionX(component, component.getX()) + component.getWidth() - insets.right - CoverReportPane.SHARE_CONF_BTN_W - designer.getHorizontalScaleValue(); + int maxX = minX + CoverReportPane.SHARE_CONF_BTN_W; + int minY = getParentPositionY(component, component.getY()) + insets.top - designer.getVerticalScaleValue(); + int maxY = minY + CoverReportPane.SHARE_CONF_BTN_H; + + if ((e.getX() > minX - GAP) && e.getX() < maxX + GAP) { + if (e.getY() > minY - GAP && e.getY() < maxY + GAP) { + return true; + } } } - setHelpBtnFocus(e, xElementCase); + return false; } - private void setHelpBtnFocus(MouseEvent e, XCreator component) { - component.setHelpBtnOnFocus(false); - if (component.getCoverPane() != null) { - if (component.getCoverPane().getComponentCount() > 1) { - JComponent button1 = (JComponent) component.getCoverPane().getComponent(1); - int minX1 = button1.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY1 = button1.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + component.getY(); - if (e.getX() + GAP - component.getInsets().left > minX1 && e.getX() - GAP - component.getInsets().left < minX1 + button1.getWidth()) { - if (e.getY() + GAP - component.getInsets().top > minY1 && e.getY() - GAP - component.getInsets().top < minY1 + button1.getHeight()) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - component.setHelpBtnOnFocus(true); - } - } - } - component.displayCoverPane(true); - component.setDirections(Direction.TOP_BOTTOM_LEFT_RIGHT); - } else { - //没有帮助信息时,不显示帮助图标 - if (StringUtils.isEmpty(component.toData().getDescription())) { - return; - } - int minX1 = getParentPositionX(component, component.getX()) + component.getWidth() - ShareConstants.SHARE_EL_CONTROL_BUTTON_HW - designer.getHorizontalScaleValue(); - int minY1 = getParentPositionY(component, component.getY()) - designer.getVerticalScaleValue(); - if (e.getX() + GAP - component.getInsets().left > minX1 && e.getX() - GAP - component.getInsets().left < minX1 + ShareConstants.SHARE_EL_CONTROL_BUTTON_HW) { - if (e.getY() + GAP - component.getInsets().top > minY1 && e.getY() - GAP - component.getInsets().top < minY1 + ShareConstants.SHARE_EL_CONTROL_BUTTON_HW) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - component.setHelpBtnOnFocus(true); - } + private boolean isEditButton(MouseEvent e, XCreator component, Insets insets) { + int innerWidth = component.getWidth() - insets.left - insets.right; + int innerHeight = component.getHeight() - insets.top - insets.bottom; + + int minX = getParentPositionX(component, component.getX()) + insets.left + (innerWidth - CoverReportPane.EDIT_BTN_W) / 2 - designer.getHorizontalScaleValue(); + int maxX = minX + CoverReportPane.EDIT_BTN_W; + int minY = getParentPositionY(component, component.getY()) + insets.top + (innerHeight - CoverReportPane.EDIT_BTN_H) / 2 - designer.getVerticalScaleValue(); + int maxY = minY + CoverReportPane.EDIT_BTN_H; + if (e.getX() > minX - GAP && e.getX() < maxX + GAP) { + if (e.getY() > minY - GAP && e.getY() < maxY + GAP) { + return true; } } + return false; } - private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { + private void elementCaseMouseMoved(MouseEvent e, XCreator component) { + xElementCase = (XElementCase) component; + component.displayCoverPane(true); + processCoverMouseMove(component, e); + } + private void setCoverPaneNotDisplay(XCreator component, MouseEvent e, boolean isLinkedHelpDialog) { if (xChartEditor != null) { xChartEditor.displayCoverPane(false); } - if (isLinkedHelpDialog) { - component.destroyHelpDialog(); - } component.displayCoverPane(false); if (xTopLayoutContainer != null) { xTopLayoutContainer.setMouseEnter(false); @@ -432,19 +418,7 @@ public class EditingMouseListener extends MouseInputAdapter { xTopLayoutContainer.setMouseEnter(true); designer.repaint(); if (!xTopLayoutContainer.isEditable()) { - if (designer.getCursor().getType() == Cursor.HAND_CURSOR) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - int minX = getParentPositionX(parent, parent.getX()) + parent.getWidth() / 2; - int minY = getParentPositionY(parent, parent.getY()) + parent.getHeight() / 2; - int offsetX = EDIT_BTN_WIDTH / 2 + GAP; - int offsetY = EDIT_BTN_HEIGHT / 2 + GAP; - if (e.getX() > (minX - offsetX) && e.getX() < (minX + offsetX)) { - if (e.getY() > (minY - offsetY) && e.getY() < (minY + offsetY + designer.getParaHeight())) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - } - } - setHelpBtnFocus(e, xTopLayoutContainer); + processCoverMouseMove(parent, e); return true; } } @@ -454,19 +428,28 @@ public class EditingMouseListener extends MouseInputAdapter { private void processChartEditorMouseMove(XCreator component, MouseEvent e) { if (component instanceof XChartEditor) { xChartEditor = (XChartEditor) component; - UIButton button = (UIButton) xChartEditor.getCoverPane().getComponent(0); - if (designer.getCursor().getType() == Cursor.HAND_CURSOR) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); - } - int minX = button.getX() + getParentPositionX(component, 0) - designer.getHorizontalScaleValue(); - int minY = button.getY() + getParentPositionY(component, 0) - designer.getVerticalScaleValue() + xChartEditor.getY(); - if (e.getX() + GAP > minX && e.getX() - GAP < minX + button.getWidth()) { - if (e.getY() + GAP > minY && e.getY() - GAP < minY + button.getHeight()) { - designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); - } - } - setHelpBtnFocus(e, xChartEditor); - designer.repaint(); + component.displayCoverPane(true); + processCoverMouseMove(component, e); + + } + } + + private void processCoverMouseMove(XCreator component, MouseEvent e) { + component.setShareConfigButtonFocus(false); + Insets insets; + if (component instanceof XBorderStyleWidgetCreator) { + insets = ((XBorderStyleWidgetCreator) component).getInsets(); + } else { + insets = DEEFAULT_INSETS; + } + if (designer.getCursor().getType() == Cursor.HAND_CURSOR) { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + if (isShareConfigButton(e, component, insets)) { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + component.setShareConfigButtonFocus(true); + } else if (isEditButton(e, component, insets)) { + designer.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index e35580b91..01a46d25b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -5,6 +5,7 @@ import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; import com.fr.chartx.attr.ChartProvider; import com.fr.design.DesignModelAdapter; +import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.HoverPainter; @@ -21,15 +22,20 @@ import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; import com.fr.design.mainframe.chart.info.ChartInfoCollector; +import com.fr.design.mod.bean.ChangeItem; +import com.fr.design.mod.bean.ContentChangeItem; +import com.fr.design.mod.event.TableDataModifyEvent; import com.fr.design.utils.ComponentUtils; -import com.fr.form.share.SharableEditorProvider; +import com.fr.event.EventDispatcher; +import com.fr.form.share.editor.SharableEditorProvider; import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.ShareLoader; -import com.fr.form.ui.ChartEditor; import com.fr.form.ui.Widget; import com.fr.stable.Constants; import com.fr.stable.StringUtils; +import java.util.Collections; +import java.util.HashMap; import javax.swing.BorderFactory; import javax.swing.JWindow; import java.util.List; @@ -43,7 +49,6 @@ import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; -import java.util.Map; /** * 添加模式下鼠标事件处理器。 @@ -104,14 +109,21 @@ public class FormCreatorDropTarget extends DropTarget { String shareId = addingXCreator.getShareId(); SharableEditorProvider sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId); SharableWidgetProvider bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId); + Map tdNameMap = Collections.emptyMap(); if (sharableEditor != null && bindInfo != null) { - Map tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource(), true); + tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource(), true); //合并数据集之后,可能会有数据集名称变化,做一下联动 //共享的组件拿的时候都是克隆的,这边改拖拽中克隆的对象而非新克隆对象,上面这个新克隆的对象只是为了拿数据集 + Map map = new HashMap<>(); for (Map.Entry entry : tdNameMap.entrySet()) { designer.getTarget().renameTableData(widget, entry.getKey(), entry.getValue()); + map.put(entry.getKey(), entry.getValue()); + } + if (!map.isEmpty()) { + DesignTableDataManager.fireDSChanged(map); } } + EventDispatcher.fire(TableDataModifyEvent.INSTANCE, new ContentChangeItem(tdNameMap, widget, ChangeItem.TABLE_DATA_NAME)); } designer.getSelectionModel().setSelectedCreators( FormSelectionUtils.rebuildSelection(xCreator, new Widget[]{widget})); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index ddd78c13f..b8f3ff638 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -15,6 +15,8 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.UserDefinedWidgetConfig; @@ -31,10 +33,13 @@ import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; import com.fr.stable.ArrayUtils; +import javax.swing.BorderFactory; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JSeparator; import javax.swing.SwingConstants; +import java.awt.Cursor; +import java.awt.event.MouseListener; import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; @@ -233,8 +238,50 @@ public class FormParaWidgetPane extends JPanel { } add(createWidgetCombinationPane(widgetPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_ToolBar_Widget"))); add(createJSeparator()); + + add(createComponentReuseToolPane()); + add(createJSeparator()); } + private JPanel createComponentReuseToolPane() { + JPanel jPanel = new JPanel(new BorderLayout(17, 10)); + UILabel uiLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/form/designer/widget_apply_icon.png")); + uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 0 ,5, 0)); + jPanel.addMouseListener(new MouseListener() { + @Override + public void mouseClicked(MouseEvent e) { + FormWidgetDetailPane.getInstance().enterWidgetLib(); + ComponentCollector.getInstance().collectToolbarJump(); + } + + @Override + public void mousePressed(MouseEvent e) { + jPanel.setBackground(Color.decode("#419BF9")); + } + + @Override + public void mouseReleased(MouseEvent e) { + jPanel.setBackground(null); + } + + @Override + public void mouseEntered(MouseEvent e) { + + } + + @Override + public void mouseExited(MouseEvent e) { + + } + }); + jPanel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + jPanel.add(uiLabel, BorderLayout.NORTH); + jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Component_Reuse_Apply_Widget")), BorderLayout.CENTER); + jPanel.setToolTipText(Toolkit.i18nText("Fine-Design_Share_Component")); + return jPanel; + } + + private void loadPredefinedWidget() { predifinedwidgeList.clear(); if (designer != null) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java index 97228209a..d1d0a2f83 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java @@ -6,10 +6,12 @@ import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.creator.XComponent; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XElementCase; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.file.HistoryTemplateListCache; @@ -18,6 +20,7 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; import com.fr.log.FineLoggerFactory; +import java.awt.Component; import java.awt.LayoutManager; import java.awt.Rectangle; import java.util.ArrayList; @@ -278,11 +281,32 @@ public class FormSelection { creator.setBackupBound(backupBounds); } layoutAdapter.fix(creator); + resetElementCaseImage(creator); } i++; } } + /** + * @Description 重置报表块缩略图 + * @param: creator + * @return void + * @Author Henry.Wang + * @Date 2021/5/21 14:59 + **/ + public void resetElementCaseImage(XCreator creator) { + if (creator instanceof XWTitleLayout) { + XWTitleLayout xwTitleLayout = (XWTitleLayout) creator; + for (int i = 0; i < xwTitleLayout.getComponentCount(); i++) { + Component component = xwTitleLayout.getComponent(i); + if (component instanceof XElementCase) { + XElementCase xElementCase = (XElementCase) component; + xElementCase.updateECImage(); + } + } + } + } + /** * 检查下有没有参数面板,如果存在,处理下参数面板造成的偏移量 * @param rectangle diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java index 311ea4cb7..2c47e1e07 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java @@ -1,45 +1,28 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.base.FRContext; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.gui.ifilechooser.UINativeFileChooser; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.os.impl.SupportOSImpl; -import com.fr.design.widget.FRWidgetFactory; -import com.fr.form.share.SharableWidgetProvider; -import com.fr.form.share.ShareLoader; -import com.fr.general.CloudCenter; -import com.fr.log.FineLoggerFactory; -import com.fr.share.ShareConstants; -import com.fr.stable.ArrayUtils; -import com.fr.stable.StringUtils; +import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; +import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; import javax.swing.BorderFactory; -import javax.swing.DefaultComboBoxModel; import javax.swing.Icon; -import javax.swing.JFileChooser; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.SwingWorker; -import javax.swing.filechooser.FileNameExtensionFilter; +import javax.swing.SwingConstants; import java.awt.BorderLayout; +import java.awt.CardLayout; import java.awt.Color; -import java.awt.Desktop; import java.awt.Dimension; import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; +import java.util.ArrayList; +import java.util.List; /** * Created with IntelliJ IDEA. @@ -48,19 +31,13 @@ import java.net.URISyntaxException; * Time: 下午8:18 */ public class FormWidgetDetailPane extends FormDockView{ - private static final int LOCAL_WIDGET_LABEL_WIDTH = 90; + private static final int ONLINE_TAB = 1; - private UIScrollPane downPane; - private JPanel reuWidgetPanel; - private UIComboBox comboBox; - private SharableWidgetProvider[] elCaseBindInfoList; - private UIButton deleteButton; - private JPanel editPanel; - private JPanel resetPanel; - private JPanel menutPanelNorthPane; - private SwingWorker sw; - //组件面板是否可以编辑 - private boolean isEdit; + private JPanel centerPane; + private UIHeadGroup headGroup; + private List paneList; + + private boolean isEmptyPane = false; public static FormWidgetDetailPane getInstance() { if (HOLDER.singleton == null) { @@ -85,7 +62,7 @@ public class FormWidgetDetailPane extends FormDockView{ } public String getViewTitle() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Tree_And_Table"); + return Toolkit.i18nText("Fine-Design_Form_Widget_Tree_And_Table"); } @Override @@ -97,351 +74,43 @@ public class FormWidgetDetailPane extends FormDockView{ * 初始化 */ public void refreshDockingView(){ + if (isEmptyPane) { + return; + } FormDesigner designer = this.getEditingFormDesigner(); removeAll(); - if(designer == null){ + if (designer == null) { clearDockingView(); return; } - reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); - reuWidgetPanel.setBorder(null); - if (elCaseBindInfoList == null) { - if (sw != null) { - sw.cancel(true); - } - sw = new SwingWorker() { - @Override - protected Object doInBackground() throws Exception { - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - refreshDownPanel(false); - return null; - } - }; - sw.execute(); - } - initReuWidgetPanel(); - initMenuPanel(); - - add(reuWidgetPanel, BorderLayout.CENTER); - - } - - /** - * 初始化组件共享和复用面板 - */ - private void initReuWidgetPanel() { - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false)); - downPane.setBorder(null); - reuWidgetPanel.add(downPane); - } - - /** - * 初始化菜单栏面板 - */ - private void initMenuPanel() { - JPanel menutPanel = new JPanel(); - menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15)); - - menutPanelNorthPane = new JPanel(new BorderLayout()); - UILabel localWidgetLabel = FRWidgetFactory.createLineWrapLabel( - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Local_Widget"), - LOCAL_WIDGET_LABEL_WIDTH); - menutPanelNorthPane.add(localWidgetLabel, BorderLayout.WEST); - menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); - menutPanelNorthPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); - - menutPanel.add(menutPanelNorthPane, BorderLayout.NORTH); - comboBox = new UIComboBox(getFormCategories()); - comboBox.setPreferredSize(new Dimension(240, comboBox.getPreferredSize().height)); - initComboBoxSelectedListener(); - menutPanel.add(comboBox, BorderLayout.CENTER); - reuWidgetPanel.add(menutPanel, BorderLayout.NORTH); - - } - - /** - * 创建菜单栏按钮面板 - */ - private JPanel initEditButtonPane() { - editPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); - - editPanel.add(createRefreshButton()); - editPanel.add(createDownloadButton()); - editPanel.add(createInstallButton()); - editPanel.add(createDeleteButton()); - return editPanel; - } - - /** - * 创建取消删除面板 - */ - private JPanel initResetButtonPane() { - resetPanel = new JPanel(); - UIButton resetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Reset")); - resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); - resetButton.setBackground(Color.white); - resetButton.setForeground(new Color(0x333334)); - resetButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - refreshDownPanel(false); - replaceButtonPanel(false); - reuWidgetPanel.remove(deleteButton); - } - }); - - deleteButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Remove_Item")); - deleteButton.setBackground(Color.white); - deleteButton.setForeground(new Color(0xeb1d1f)); - deleteButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (ShareLoader.getLoader().removeModulesFromList()) { - refreshShareMoudule(); - reuWidgetPanel.remove(deleteButton); - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Successful")); - refreshDownPanel(false); - replaceButtonPanel(false); - refreshComboxData(); - } else { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Failed")); - } - - } - }); - JPanel deletePane = new JPanel(new BorderLayout()); - deletePane.add(deleteButton, BorderLayout.CENTER); - deletePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); - - resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - resetPanel.add(resetButton, BorderLayout.CENTER); - resetPanel.add(deletePane, BorderLayout.WEST); - - refreshDownPanel(true); - - return resetPanel; - - } - - - private void initComboBoxSelectedListener() { - comboBox.addItemListener(new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - ShareLoader.getLoader().resetRemovedModuleList(); - int filterIndex = comboBox.getSelectedIndex(); - if (filterIndex == 0) { - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - } else { - String filterName = comboBox.getSelectedItem().toString(); - elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); - } - refreshDownPanel(isEdit); - - } - }); - } - - /** - * 创建工具条按钮 - */ - private UIButton createToolButton(Icon icon, String toolTip, ActionListener actionListener) { - UIButton toolButton = new UIButton(); - toolButton.setIcon(icon); - toolButton.setToolTipText(toolTip); - toolButton.set4ToolbarButton(); - toolButton.addActionListener(actionListener); - return toolButton; - - } - - /** - * 创建刷新按钮 - */ - private UIButton createRefreshButton() { - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/refresh.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (sw != null) { - sw.cancel(true); - } - sw = new SwingWorker() { - @Override - protected Object doInBackground() throws Exception { - ShareLoader.getLoader().refreshModule(); - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - refreshComboxData(); - refreshDownPanel(false); - return null; - } - }; - sw.execute(); - } - } - ); - } - - private void refreshComboxData() { - comboBox.setSelectedIndex(0); - comboBox.setModel(new DefaultComboBoxModel(getFormCategories())); - } - - /** - * 创建下载模板的按钮 - */ - private UIButton createDownloadButton() { - UIButton downloadButton = new UIButton(); - downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); - downloadButton.set4ToolbarButton(); - downloadButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Download_Template")); - downloadButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - String url = CloudCenter.getInstance().acquireUrlByKind("reuse.url"); - if (StringUtils.isEmpty(url)) { - FRContext.getLogger().info("The URL is empty!"); - return; - } - try { - Desktop.getDesktop().browse(new URI(url)); - } catch (IOException exp) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Default_Browser_Duplicate")); - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (URISyntaxException exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - } catch (Exception exp) { - FineLoggerFactory.getLogger().error(exp.getMessage(), exp); - FineLoggerFactory.getLogger().error("Can not open the browser for URL: " + url); - } - } - }); - return downloadButton; - } - - /** - * 创建安装模板的按钮 - */ - private UIButton createInstallButton() { - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/install icon.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Install_Template"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - if (SupportOSImpl.NATIVE_CHOOSER.support()) { - UINativeFileChooser nativeFileChooser = new UINativeFileChooser(); - nativeFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); - nativeFileChooser.setMultiSelectionEnabled(true); - nativeFileChooser.setExtensionFilter("*.reu"); - nativeFileChooser.setDialogTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - int returnValue = nativeFileChooser.showOpenDialog(new UILabel()); - if (returnValue == JFileChooser.APPROVE_OPTION) { - final File[] chosenFiles = nativeFileChooser.getSelectedFiles(); - for (File file : chosenFiles) { - installFromDiskZipFile(file); - } - } - } else { - JFileChooser fileChooser = new JFileChooser(); - fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); - fileChooser.setMultiSelectionEnabled(true); - fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); - int returnValue = fileChooser.showDialog(new UILabel(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - if (returnValue == JFileChooser.APPROVE_OPTION) { - final File[] chosenFiles = fileChooser.getSelectedFiles(); - for (File file : chosenFiles) { - installFromDiskZipFile(file); - } - } - } - } - } - ); - } - - /** - * 创建删除模板的按钮 - */ - private UIButton createDeleteButton() { - return createToolButton( - BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Delete_Template"), - new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - replaceButtonPanel(true); - } - } - ); - } - - private void replaceButtonPanel(boolean isEdit) { - this.isEdit = isEdit; - if (isEdit) { - menutPanelNorthPane.remove(editPanel); - menutPanelNorthPane.add(initResetButtonPane(), BorderLayout.EAST); - } else { - menutPanelNorthPane.remove(resetPanel); - menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); - ShareLoader.getLoader().resetRemovedModuleList(); + initPaneList(); + this.setBorder(null); + final CardLayout cardLayout = new CardLayout(); + centerPane = new JPanel(cardLayout); + String[] paneNames = new String[paneList.size()]; + for (int i = 0; i < paneList.size(); i++) { + String title = paneList.get(i).getTitle(); + paneNames[i] = title; + centerPane.add(paneList.get(i), title); } - } - - private void installFromDiskZipFile(File chosenFile) { - if (chosenFile != null && chosenFile.getName().endsWith(ShareConstants.SUFFIX_MODULE)) { - try { - if (ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile)) { - refreshShareMoudule(); - elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); - refreshDownPanel(false); - refreshComboxData(); - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Share_Module_OK")); - } else { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); + headGroup = new UIHeadGroup(paneNames) { + protected void tabChanged(int newSelectedIndex) { + if (newSelectedIndex == 1) { + ComponentCollector.getInstance().collectMarkerClick(); } - } catch (IOException e) { - JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Share_Module_Error")); - FineLoggerFactory.getLogger().error(e.getMessage(), e); + cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle()); } - } - } - - private void refreshShareMoudule() { - try { - ShareLoader.getLoader().refreshModule(); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } + }; + headGroup.setSelectedIndex(ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib() ? 0 : ONLINE_TAB); + this.add(headGroup, BorderLayout.NORTH); + this.add(centerPane, BorderLayout.CENTER); } - /** - * 获取报表块组件分类 - */ - public String[] getFormCategories() { - return ArrayUtils.addAll(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_AllCategories")}, ShareLoader.getLoader().getModuleCategory()); + public void resetEmptyPane(){ + this.isEmptyPane = false; } - public void refreshDownPanel(boolean isEdit) { - reuWidgetPanel.remove(downPane); - downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit)); - downPane.setBorder(null); - reuWidgetPanel.add(downPane); - repaintContainer(); - - } - - public void repaintContainer() { - validate(); - repaint(); - revalidate(); - } /** * 清除数据 @@ -452,15 +121,50 @@ public class FormWidgetDetailPane extends FormDockView{ this.add(psp, BorderLayout.CENTER); } + public void switch2Empty(){ + isEmptyPane = true; + this.removeAll(); + JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); + UILabel imagePanel = new UILabel(BaseUtils.readIcon("/com/fr/base/images/share/version_not_match.png")); + imagePanel.setPreferredSize(new Dimension(240, 96)); + imagePanel.setHorizontalAlignment(SwingConstants.CENTER); + panel.add(imagePanel); + UILabel uiLabel1 = tipLabel(Toolkit.i18nText("Fine-Design_Share_Version_Not_Match_Tip1")); + UILabel uiLabel2 = tipLabel(Toolkit.i18nText("Fine-Design_Share_Version_Not_Match_Tip2")); + panel.add(uiLabel1); + panel.add(uiLabel2); + panel.setBorder(BorderFactory.createEmptyBorder(240, 0, 0, 0)); + this.add(panel, BorderLayout.CENTER); + } + private UILabel tipLabel(String text) { + UILabel tipLabel = new UILabel(text); + tipLabel.setHorizontalAlignment(SwingConstants.CENTER); + tipLabel.setPreferredSize(new Dimension(240, 20)); + tipLabel.setForeground(Color.decode("#8F8F92")); + return tipLabel; + } + + + public void enterWidgetLib() { + ComponentReuseNotifyUtil.enterWidgetLibExtraAction(); + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_LIB); + } /** * 定位 - * @return 位置 + * + * @return 位置 */ + @Override public Location preferredLocation() { return Location.WEST_BELOW; } + private void initPaneList() { + paneList = new ArrayList<>(); + paneList.add(LocalWidgetRepoPane.getInstance()); + paneList.add(OnlineWidgetRepoPane.getInstance()); + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index a851074be..3ddc16c9c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -4,6 +4,7 @@ import com.fr.base.BaseUtils; import com.fr.base.PaperSize; import com.fr.base.Parameter; import com.fr.base.extension.FileExtension; +import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignModelAdapter; import com.fr.design.DesignState; @@ -44,6 +45,8 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.util.ShareComponentUtils; import com.fr.design.mainframe.template.info.JFormProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; @@ -64,10 +67,16 @@ import com.fr.file.filter.ChooseFileFilter; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; +import com.fr.form.main.WidgetGatherAdapter; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.editor.SharableEditorProvider; +import com.fr.form.share.utils.ShareUtils; +import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBorderLayout; import com.fr.form.ui.container.WLayout; import com.fr.general.ComparatorUtils; +import com.fr.json.JSONArray; import com.fr.log.FineLoggerFactory; import com.fr.page.PaperSettingProvider; import com.fr.plugin.observer.PluginEventListener; @@ -77,6 +86,7 @@ import com.fr.report.worksheet.FormElementCase; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; import com.fr.stable.ProductConstants; +import com.fr.stable.StringUtils; import com.fr.stable.bridge.StableFactory; import com.fr.web.controller.ViewRequestConstants; @@ -96,6 +106,7 @@ import java.awt.event.ActionListener; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import javax.swing.tree.TreePath; @@ -174,6 +185,7 @@ public class JForm extends JTemplate implements BaseJForm getProcessInfo() { //这边需要判空,图表的埋点信息收集时可能没有初始化processInfo if (processInfo == null) { @@ -305,6 +317,7 @@ public class JForm extends JTemplate implements BaseJForm implements BaseJForm jt) { + ReuseTriggerPointManager.getInstance().registerJForm(JForm.this); + + } + + @Override + public void templateSaved(JTemplate jt) { + if (jt == null) { + return; + } } + }); return tabCenterPane; } @@ -1031,4 +1059,35 @@ public class JForm extends JTemplate implements BaseJForm map = new HashMap<>(); + + private List listeners = new ArrayList<>(); + + private ReuseTriggerPointManager() { + if (!hasNotifiedTwice()) { + List list = getTriggerPoints(); + for (TriggerPointProvider triggerPoint : list) { + Listener listener = new Listener() { + @Override + public void on(Event event, Null o) { + triggerPoint.triggerAction(); + } + }; + EventDispatcher.listen(triggerPoint.triggerEvent(), listener); + listeners.add(listener); + } + + } + } + + private List getTriggerPoints() { + List list = new ArrayList<>(); + list.add(new CellStyleTriggerPoint()); + list.add(new CellValueImageChangeTriggerPoint()); + return list; + } + + + public boolean hasNotifiedTwice() { + return ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() >= 2; + } + + + private void reCount() { + //重新计次数 + Iterator> iterator = map.entrySet().iterator(); + while (iterator.hasNext()) { + iterator.next().getValue().reset(); + } + } + + private void writeTriggerInfo2xml() { + int number = ComponentReuseNotificationInfo.getInstance().getNotifiedNumber() + 1; + ComponentReuseNotificationInfo.getInstance().setNotifiedNumber(number); + ComponentReuseNotificationInfo.getInstance().setLastNotifyTime(System.currentTimeMillis()); + DesignerEnvManager.getEnvManager().saveXMLFile(); + //如果已经提示过两次了 + if (hasNotifiedTwice()) { + for (Listener listener : listeners) { + EventDispatcher.stopListen(listener); + } + this.map.clear(); + } + } + + public boolean needTrigger() { + boolean result = true; + if (ComponentReuseNotificationInfo.getInstance().getLastNotifyTime() > 0L) { + result = System.currentTimeMillis() - ComponentReuseNotificationInfo.getInstance().getLastNotifyTime() > ONE_WEEK_TIME; + } + return !hasNotifiedTwice() && result; + } + + + public void registerJForm(JForm jForm) { + if (!hasNotifiedTwice()) { + this.map.put(jForm, new ReuseNotifyInfo()); + } + + } + + public void removeJForm(JForm jForm) { + if (!hasNotifiedTwice()) { + this.map.remove(jForm); + } + } + + + public ReuseNotifyInfo getReuseNotifyInfo() { + JTemplate currentJTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (!(currentJTemplate instanceof JForm && hasUseReuseComponent((JForm) currentJTemplate)) + && !ReuseTriggerPointManager.getInstance().needTrigger()) { + return null; + } + return map.get(currentJTemplate); + } + + public void reuseNotify(ReuseNotifyInfo notifyInfo) { + if (notifyInfo.matchCondition()) { + ReuseTriggerPointManager.getInstance().reCount(); + //弹出提示框 + JTemplate currentJTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + DesignerToastMsgUtil.toastPrompt(createReusePrompt((JForm) currentJTemplate)); + ReuseTriggerPointManager.getInstance().writeTriggerInfo2xml(); + ComponentCollector.getInstance().collectPromptJumpWhenShow(); + } + } + + + private boolean hasUseReuseComponent(JForm jForm) { + Form form = jForm.getTarget(); + List extendSharableWidgetList = new ArrayList<>(); + Form.traversalWidget(form.getContainer(), new WidgetGather() { + @Override + public void dealWith(Widget widget) { + ExtendSharableAttrMark attrMark = ((AbstractBorderStyleWidget) widget).getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); + if (attrMark != null && StringUtils.isNotEmpty(attrMark.getShareId())) { + extendSharableWidgetList.add(widget); + } + } + + @Override + public boolean dealWithAllCards() { + return true; + } + }, AbstractBorderStyleWidget.class); + return extendSharableWidgetList.size() > 0; + } + + + private JPanel createReusePrompt(JForm jForm) { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.add(new UILabel(Toolkit.i18nText("Fine-Design_Component_Reuse_Try_Prompt")), BorderLayout.WEST); + UILabel reuseLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Component")); + reuseLabel.addMouseListener(new MouseListener() { + @Override + public void mouseClicked(MouseEvent e) { + jForm.tabChanged(0); + FormWidgetDetailPane.getInstance().enterWidgetLib(); + ComponentCollector.getInstance().collectPromptJumpWhenJump(); + } + + @Override + public void mousePressed(MouseEvent e) { + + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + + @Override + public void mouseEntered(MouseEvent e) { + + } + + @Override + public void mouseExited(MouseEvent e) { + + } + }); + reuseLabel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0)); + reuseLabel.setForeground(Color.BLUE); + reuseLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + jPanel.add(reuseLabel, BorderLayout.CENTER); + return jPanel; + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java b/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java deleted file mode 100644 index cdfa095bf..000000000 --- a/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetButton.java +++ /dev/null @@ -1,314 +0,0 @@ -package com.fr.design.mainframe; - -import com.fr.base.iofile.attr.SharableAttrMark; -import com.fr.base.vcs.DesignerMode; -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XCreatorUtils; -import com.fr.design.gui.ilable.UILabel; -import com.fr.form.share.SharableWidgetProvider; -import com.fr.form.share.ShareLoader; -import com.fr.form.ui.AbstractBorderStyleWidget; -import com.fr.form.ui.Widget; -import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; -import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; -import com.fr.share.ShareConstants; -import com.fr.stable.StringUtils; -import org.jetbrains.annotations.NotNull; - -import javax.swing.Icon; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import javax.swing.JPanel; -import java.awt.AlphaComposite; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; -import java.awt.Composite; -import java.awt.Container; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.LayoutManager; -import java.awt.Rectangle; -import java.awt.datatransfer.DataFlavor; -import java.awt.datatransfer.Transferable; -import java.awt.datatransfer.UnsupportedFlavorException; -import java.awt.dnd.DnDConstants; -import java.awt.dnd.DragGestureEvent; -import java.awt.dnd.DragGestureListener; -import java.awt.dnd.DragSource; -import java.awt.dnd.DragSourceAdapter; -import java.awt.dnd.DragSourceDragEvent; -import java.awt.event.MouseEvent; -import java.awt.event.MouseListener; -import java.awt.event.MouseMotionListener; -import java.io.IOException; -import java.io.Serializable; - -/** - * Coder: zack - * Date: 2016/10/9 - * Time: 16:14 - */ -public class ShareWidgetButton extends JPanel implements MouseListener, MouseMotionListener, Serializable { - - protected SharableWidgetProvider bindInfo; - protected MouseEvent lastPressEvent; - protected JPanel reportPane; - protected boolean isEdit; - protected boolean isMarked; - private ShareWidgetUI ui; - private Icon markedMode = IOUtils.readIcon("/com/fr/design/form/images/marked.png"); - private Icon unMarkedMode = IOUtils.readIcon("/com/fr/design/form/images/unmarked.png"); - private AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 60 / 100.0F); - private JComponent markedButton = new JComponent() { - protected void paintComponent(Graphics g) { - markedMode.paintIcon(this, g, 0, 0); - } - }; - private JComponent unMarkedButton = new JComponent() { - protected void paintComponent(Graphics g) { - unMarkedMode.paintIcon(this, g, 0, 0); - } - }; - - public ShareWidgetButton(SharableWidgetProvider bindInfo, ShareWidgetUI ui) { - - this.bindInfo = bindInfo; - this.ui = ui; - this.setPreferredSize(new Dimension(108, 68)); - initUI(); - this.setLayout(getCoverLayout()); - this.addMouseListener(this); - this.addMouseMotionListener(this); - new DragAndDropDragGestureListener(this, DnDConstants.ACTION_COPY_OR_MOVE); - } - - public ShareWidgetButton(SharableWidgetProvider bindInfo) { - - this(bindInfo, new ShareWidgetUI()); - } - - public void paint(Graphics g) { - Graphics2D g2d = (Graphics2D) g; - Composite oldComposite = g2d.getComposite(); - g2d.setComposite(composite); - g2d.setColor(Color.WHITE); - g2d.fillRect(0, 0, getWidth(), getHeight()); - g2d.setComposite(oldComposite); - super.paint(g); - } - - public void setElementCaseEdit(boolean isEdit) { - this.isEdit = isEdit; - if (isEdit) { - this.add(unMarkedButton, 0); - repaint(); - } - - - } - - private void initUI() { - - reportPane = new JPanel(new BorderLayout()); - reportPane.add(new UILabel(new ImageIcon(bindInfo.getCover())), BorderLayout.CENTER); - JPanel labelPane = new JPanel(new BorderLayout()); - UILabel label = new UILabel(bindInfo.getName(), UILabel.CENTER); - labelPane.setBackground(new Color(184, 220, 242)); - labelPane.add(label, BorderLayout.CENTER); - reportPane.add(labelPane, BorderLayout.SOUTH); - add(reportPane); - } - - protected LayoutManager getCoverLayout() { - return new LayoutManager() { - - @Override - public void removeLayoutComponent(Component comp) { - } - - @Override - public Dimension preferredLayoutSize(Container parent) { - return parent.getPreferredSize(); - } - - @Override - public Dimension minimumLayoutSize(Container parent) { - return null; - } - - @Override - public void layoutContainer(Container parent) { - int width = parent.getWidth(); - int height = parent.getHeight(); - markedButton.setBounds((width - 25), 0, 25, 25); - unMarkedButton.setBounds((width - 25), 0, 25, 25); - reportPane.setBounds(0, 0, width, height); - - - - } - - @Override - public void addLayoutComponent(String name, Component comp) { - } - }; - } - - public SharableWidgetProvider getBindInfo() { - return bindInfo; - } - - public void setBindInfo(SharableWidgetProvider bindInfo) { - this.bindInfo = bindInfo; - } - - public String getFileName() { - return bindInfo.getName() +"." + bindInfo.getId() + ShareConstants.SUFFIX_MODULE; - } - - @Override - public void mouseClicked(MouseEvent e) { - if (isEdit) { - if (isMarked) { - remove(markedButton); - ShareLoader.getLoader().removeModuleForList(getFileName()); - isMarked = false; - } else { - add(markedButton,0); - ShareLoader.getLoader().addModuleToList(getFileName()); - isMarked = true; - } - } - - repaint(); - } - - @Override - public void mousePressed(MouseEvent e) { - lastPressEvent = e; - } - - @Override - public void mouseReleased(MouseEvent e) { - - } - - @Override - public void mouseEntered(MouseEvent e) { - - } - - @Override - public void mouseExited(MouseEvent e) { - - } - - @Override - public void mouseDragged(MouseEvent e) { - if (DesignerMode.isAuthorityEditing()) { - return; - } - if (lastPressEvent == null) { - return; - } - Object source = e.getSource(); - Widget creatorSource = null; - String shareId = StringUtils.EMPTY; - if (source instanceof ShareWidgetButton) { - ShareWidgetButton no = (ShareWidgetButton) e.getSource(); - if (no == null) { - return; - } - shareId = no.getBindInfo().getId(); - creatorSource = ShareLoader.getLoader().getElCaseEditorById(shareId); - if (creatorSource != null) { - ((AbstractBorderStyleWidget)creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); - //tab布局WCardMainBorderLayout通过反射出来的大小是960*480 - XCreator xCreator = ui.createXCreator(creatorSource, shareId, no.getBindInfo()); - WidgetToolBarPane.getTarget().startDraggingBean(xCreator); - lastPressEvent = null; - this.setBorder(null); - } - } - } - - @Override - public void mouseMoved(MouseEvent e) { - - } - - public class DragAndDropDragGestureListener extends DragSourceAdapter implements DragGestureListener { - private DragSource source; - - public DragAndDropDragGestureListener(ShareWidgetButton tt, int actions) { - source = new DragSource(); - source.createDefaultDragGestureRecognizer(tt, actions, this); - } - - public void dragGestureRecognized(DragGestureEvent dge) { - ShareWidgetButton shareWidgetButton = (ShareWidgetButton) dge.getComponent(); - if (shareWidgetButton != null) { - Widget widget = ShareLoader.getLoader().getElCaseEditorById(shareWidgetButton.getBindInfo().getId()); - DragAndDropTransferable dragAndDropTransferable = new DragAndDropTransferable(widget); - dge.startDrag(DragSource.DefaultCopyDrop, dragAndDropTransferable, this); - } - } - - @Override - public void dragEnter(DragSourceDragEvent dragSourceDragEvent) { - - } - } - - public class DragAndDropTransferable implements Transferable { - private Widget widget; - - public DragAndDropTransferable(Widget widget) { - this.widget = widget; - } - - DataFlavor[] flavors = {new DataFlavor(Widget.class, "Widget")}; - - public DataFlavor[] getTransferDataFlavors() { - return flavors; - } - - public boolean isDataFlavorSupported(DataFlavor flavor) { - for (DataFlavor df : flavors) { - if (ComparatorUtils.equals(df, flavor)) { - return true; - } - } - return false; - } - - public Object getTransferData(DataFlavor df) throws UnsupportedFlavorException, IOException { - return widget; - } - } - - /** - * 抽出来,专门为了创建 ui 来搞 - */ - public static class ShareWidgetUI { - - private static final Dimension TAB_DEFAULT_SIZE = new Dimension(500, 300); - - @NotNull - public XCreator createXCreator(Widget creatorSource, String shareId, SharableWidgetProvider provider) { - - XCreator xCreator = null; - if (creatorSource instanceof WCardMainBorderLayout) { - xCreator = XCreatorUtils.createXCreator(creatorSource, TAB_DEFAULT_SIZE); - } else { - xCreator = XCreatorUtils.createXCreator(creatorSource, new Dimension(provider.getWidth(), provider.getHeight())); - } - xCreator.setBackupBound(new Rectangle(provider.getWidth(), provider.getHeight())); - xCreator.setShareId(shareId); - return xCreator; - } - } -} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java deleted file mode 100644 index 549a4b174..000000000 --- a/designer-form/src/main/java/com/fr/design/mainframe/ShareWidgetPane.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.fr.design.mainframe; - - - -import com.fr.form.share.SharableWidgetProvider; - -import javax.swing.*; -import java.awt.*; - - -/** - * Created by xiaxiang on 2016/10/10. - */ -public class ShareWidgetPane extends JPanel { - - public ShareWidgetPane(SharableWidgetProvider[] elCaseBindInfoList, boolean isEdit) { - this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离 - if (elCaseBindInfoList != null) { - int rowCount = (elCaseBindInfoList.length + 1) / 2; - this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10)); - for (SharableWidgetProvider rbModuleInfo : elCaseBindInfoList) { - ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo); - widgetButton.setElementCaseEdit(isEdit); - this.add(widgetButton); - } - this.setPreferredSize(new Dimension(240, rowCount * 80)); - } - } -} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java index c37b4ba9a..fd64d3aab 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/WidgetPropertyPane.java @@ -6,13 +6,12 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.creator.*; -import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; -import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; import com.fr.design.designer.properties.mobile.MobileStylePropertyUI; import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.fun.WidgetPropertyUIProvider; +import com.fr.design.gui.controlpane.EventPropertyPane; import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -38,7 +37,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper private static final int PADDING = 10; private static final int PADDING_M = 12; private FormWidgetCardPane formWidgetCardPane; // 控件的属性表 - private EventPropertyTable eventTable; // 控件的事件表 + private EventPropertyPane eventTable; // 控件的事件表 private List widgetPropertyTables; // 这个变量应该是保存控件拓展的属性tab private List mobileExtraPropertyPanes; // 保存9.0设计器下移动端拓展的属性tab,舍弃JTable private FormDesigner designer; // 当前designer @@ -141,7 +140,7 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper * 创建事件表(事件选项卡不是JTable) */ private void createEventTable() { - eventTable = new EventPropertyTable(designer); + eventTable = new EventPropertyPane(designer); designer.addDesignerEditListener(new EventPropertyDesignerAdapter(eventTable)); } @@ -337,9 +336,9 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper * 事件表监听界面事件(编辑,选中) */ private class EventPropertyDesignerAdapter implements DesignerEditListener { - EventPropertyTable propertyTable; + EventPropertyPane propertyTable; - EventPropertyDesignerAdapter(EventPropertyTable eventTable) { + EventPropertyDesignerAdapter(EventPropertyPane eventTable) { this.propertyTable = eventTable; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/ReuseNotifyInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/ReuseNotifyInfo.java new file mode 100644 index 000000000..17aa1a631 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/ReuseNotifyInfo.java @@ -0,0 +1,30 @@ +package com.fr.design.mainframe.adaptve.config; + +/** + * Created by kerry on 5/7/21 + */ +public class ReuseNotifyInfo { + private static final int CELL_STYLE_MODIFY_MAX_NUMBER = 3; + private static final int CELL_IMAGE_VALUE_MODIFY_MAX_NUMBER = 1; + private int cellStyleModifiedNumber = 0; + private int cellImageValueNumber = 0; + + public void addCellStyleModify() { + cellStyleModifiedNumber++; + } + + + public void addCellImageValueModify() { + cellImageValueNumber++; + } + + public boolean matchCondition() { + return cellStyleModifiedNumber >= CELL_STYLE_MODIFY_MAX_NUMBER + || cellImageValueNumber >= CELL_IMAGE_VALUE_MODIFY_MAX_NUMBER; + } + + public void reset() { + this.cellImageValueNumber = 0; + this.cellStyleModifiedNumber = 0; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/TriggerPointProvider.java b/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/TriggerPointProvider.java new file mode 100644 index 000000000..5fa4db80f --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/TriggerPointProvider.java @@ -0,0 +1,20 @@ +package com.fr.design.mainframe.adaptve.config; + + +import com.fr.event.Event; + +/** + * Created by kerry on 4/29/21 + */ +public interface TriggerPointProvider { + /** + * 触发后的操作 + */ + void triggerAction(); + + /** + * 触发事件 + * @return + */ + Event triggerEvent(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/impl/CellStyleTriggerPoint.java b/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/impl/CellStyleTriggerPoint.java new file mode 100644 index 000000000..47055eec1 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/impl/CellStyleTriggerPoint.java @@ -0,0 +1,28 @@ +package com.fr.design.mainframe.adaptve.config.impl; + +import com.fr.design.mainframe.DesignOperationEvent; +import com.fr.design.mainframe.ReuseTriggerPointManager; +import com.fr.design.mainframe.adaptve.config.ReuseNotifyInfo; +import com.fr.design.mainframe.adaptve.config.TriggerPointProvider; +import com.fr.event.Event; + +/** + * Created by kerry on 5/7/21 + */ +public class CellStyleTriggerPoint implements TriggerPointProvider { + @Override + public void triggerAction() { + ReuseNotifyInfo notifyInfo = ReuseTriggerPointManager.getInstance().getReuseNotifyInfo(); + if (notifyInfo == null) { + return; + } + notifyInfo.addCellStyleModify(); + ReuseTriggerPointManager.getInstance().reuseNotify(notifyInfo); + + } + + @Override + public Event triggerEvent() { + return DesignOperationEvent.CELL_STYLE_MODIFY; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/impl/CellValueImageChangeTriggerPoint.java b/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/impl/CellValueImageChangeTriggerPoint.java new file mode 100644 index 000000000..1429ebeab --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/adaptve/config/impl/CellValueImageChangeTriggerPoint.java @@ -0,0 +1,27 @@ +package com.fr.design.mainframe.adaptve.config.impl; + +import com.fr.design.mainframe.DesignOperationEvent; +import com.fr.design.mainframe.ReuseTriggerPointManager; +import com.fr.design.mainframe.adaptve.config.ReuseNotifyInfo; +import com.fr.design.mainframe.adaptve.config.TriggerPointProvider; +import com.fr.event.Event; + +/** + * Created by kerry on 5/7/21 + */ +public class CellValueImageChangeTriggerPoint implements TriggerPointProvider { + @Override + public void triggerAction() { + ReuseNotifyInfo notifyInfo = ReuseTriggerPointManager.getInstance().getReuseNotifyInfo(); + if (notifyInfo == null) { + return; + } + notifyInfo.addCellImageValueModify(); + ReuseTriggerPointManager.getInstance().reuseNotify(notifyInfo); + } + + @Override + public Event triggerEvent() { + return DesignOperationEvent.CELL_IMAGE_VALUE_MODIFY; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/AbstractWidgetSelectPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/AbstractWidgetSelectPane.java new file mode 100644 index 000000000..96b321c93 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/AbstractWidgetSelectPane.java @@ -0,0 +1,62 @@ +package com.fr.design.mainframe.share; + +import com.fr.design.mainframe.share.ui.base.PopupPreviewPane; +import com.fr.design.mainframe.share.ui.block.PreviewWidgetBlock; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; +import com.fr.stable.StringUtils; + +import javax.swing.JPanel; +import java.awt.Container; + +/** + * @Author: Yuan.Wang + * @Date: 2021/1/15 + */ +public abstract class AbstractWidgetSelectPane extends JPanel { + private static final int SCROLL_BAR_HEIGHT = 10; + private final PopupPreviewPane previewPane; + private String currentShowWidgetID; + + public AbstractWidgetSelectPane() { + this.previewPane = new PopupPreviewPane(); + } + + public void showPreviewPane(PreviewWidgetBlock comp, String showWidgetID) { + if (ComparatorUtils.equals(currentShowWidgetID, showWidgetID)) { + return; + } + popupPreviewPane(comp, showWidgetID); + } + + public void hidePreviewPane() { + if (previewPane != null && previewPane.isVisible()) { + previewPane.setVisible(false); + } + this.currentShowWidgetID = StringUtils.EMPTY; + } + + private void popupPreviewPane(PreviewWidgetBlock comp, String showWidgetID) { + if (previewPane.isVisible()) { + previewPane.setVisible(false); + } + + if (!previewPane.isVisible() && comp.getWidth() != 0 && comp.getHeight() != 0) { + //父容器是GroupPane,要获得的是GroupPane的父容器 + Container parentContainer =getParentContainer(); + previewPane.setComp(comp.getPreviewImage()); + int popupPosY = comp.getLocationOnScreen().y - parentContainer.getLocationOnScreen().y; + if (previewPane.getHeight() + popupPosY > parentContainer.getHeight() + SCROLL_BAR_HEIGHT) { + popupPosY -= (previewPane.getHeight() + popupPosY - parentContainer.getHeight() - SCROLL_BAR_HEIGHT); + } + int popupPosX = -previewPane.getPreferredSize().width; + if (parentContainer.getLocationOnScreen().x < previewPane.getPreferredSize().width) { + popupPosX = parentContainer.getWidth(); + } + GUICoreUtils.showPopupMenu(previewPane, parentContainer, popupPosX, popupPosY); + this.currentShowWidgetID = showWidgetID; + } + } + + abstract protected Container getParentContainer(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/Bean/ComponentGenerateInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/share/Bean/ComponentGenerateInfo.java new file mode 100644 index 000000000..a5bd419a2 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/Bean/ComponentGenerateInfo.java @@ -0,0 +1,59 @@ +package com.fr.design.mainframe.share.Bean; + +import com.fr.design.mainframe.JTemplate; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.ui.Widget; + +import java.util.Map; + +/** + * created by Harrison on 2020/04/13 + * + * 组件生成信息 + **/ +public class ComponentGenerateInfo { + + private boolean autoUpload; + + private JTemplate jt; + + private Map paraMap; + + private Widget widget; + + private DefaultSharableWidget info; + + public ComponentGenerateInfo(boolean autoUpload, JTemplate jt, Map paraMap, Widget widget, DefaultSharableWidget info) { + + this.autoUpload = autoUpload; + this.jt = jt; + this.paraMap = paraMap; + this.widget = widget; + this.info = info; + } + + public boolean isAutoUpload() { + + return autoUpload; + } + + public JTemplate getJt() { + + return jt; + } + + public Map getParaMap() { + + return paraMap; + } + + public Widget getWidget() { + + return widget; + } + + public DefaultSharableWidget getInfo() { + + return info; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/Bean/LinkageChangeBean.java b/designer-form/src/main/java/com/fr/design/mainframe/share/Bean/LinkageChangeBean.java new file mode 100644 index 000000000..b286cfb41 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/Bean/LinkageChangeBean.java @@ -0,0 +1,114 @@ +package com.fr.design.mainframe.share.Bean; + +import com.fr.design.mainframe.share.constants.ComponentTypes; +import com.fr.form.share.bean.WidgetDeviceBean; +import com.fr.form.share.bean.WidgetTypeBean; +import com.fr.design.mainframe.share.constants.DisplayDevice; +import com.fr.stable.AssistUtils; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 下拉框与下拉复现框联动状态 + * @author hades + * @version 10.0 + * Created by hades on 2020/6/9 + */ +public class LinkageChangeBean { + + private static final Map> STATE_MAP = new HashMap<>(); + + static { + // all or default + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(false, false), new WidgetTypeBean(false, false)), ComponentTypes.allTypes()); + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(true, true), new WidgetTypeBean(true, true)), ComponentTypes.allTypes()); + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(false, false), new WidgetTypeBean(true, true)), ComponentTypes.allTypes()); + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(true, true), new WidgetTypeBean(false, false)), ComponentTypes.allTypes()); + + // pc + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(false, true), new WidgetTypeBean(false, false)), ComponentTypes.allTypesByDevice(DisplayDevice.PC.getType())); + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(false, true), new WidgetTypeBean(true, true)), ComponentTypes.allTypesByDevice(DisplayDevice.PC.getType())); + + // mobile + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(true, false), new WidgetTypeBean(false, false)), ComponentTypes.allTypesByDevice(DisplayDevice.MOBILE.getType())); + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(true, false), new WidgetTypeBean(true, true)), ComponentTypes.allTypesByDevice(DisplayDevice.MOBILE.getType())); + + // report + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(false, false), new WidgetTypeBean(true, false)), ComponentTypes.REPORT.types()); + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(true, true), new WidgetTypeBean(true, false)), ComponentTypes.REPORT.types()); + + // chart + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(false, false), new WidgetTypeBean(false, true)), ComponentTypes.CHART.types()); + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(true, true), new WidgetTypeBean(false, true)), ComponentTypes.CHART.types()); + + // pc-report + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(false, true), new WidgetTypeBean(true, false)), ComponentTypes.REPORT.children(DisplayDevice.PC.getType())); + + // pc-chart + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(false, true), new WidgetTypeBean(false, true)), ComponentTypes.CHART.children(DisplayDevice.PC.getType())); + + // mobile-report + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(true, false), new WidgetTypeBean(true, false)), ComponentTypes.REPORT.children(DisplayDevice.MOBILE.getType())); + + // mobile-chart + STATE_MAP.put(new LinkageChangeBean(new WidgetDeviceBean(true, false), new WidgetTypeBean(false, true)), ComponentTypes.CHART.children(DisplayDevice.MOBILE.getType())); + + } + + public static List getComboBoxItems(LinkageChangeBean bean) { + return STATE_MAP.get(bean); + } + + private LinkageChangeBean(WidgetDeviceBean widgetDeviceBean, WidgetTypeBean widgetTypeBean) { + this.widgetDeviceBean = widgetDeviceBean; + this.widgetTypeBean = widgetTypeBean; + } + + private WidgetTypeBean widgetTypeBean; + private WidgetDeviceBean widgetDeviceBean; + + public static class Builder { + private boolean report; + private boolean chart; + private boolean mobile; + private boolean pc; + + public Builder setReport(boolean report) { + this.report = report; + return this; + } + + public Builder setChart(boolean chart) { + this.chart = chart; + return this; + } + + public Builder setMobile(boolean mobile) { + this.mobile = mobile; + return this; + } + + public Builder setPc(boolean pc) { + this.pc = pc; + return this; + } + + public LinkageChangeBean build() { + return new LinkageChangeBean(new WidgetDeviceBean(this.mobile, this.pc), new WidgetTypeBean(this.report, this.chart)); + } + } + + @Override + public boolean equals(Object o) { + return o instanceof LinkageChangeBean + && AssistUtils.equals(this.widgetDeviceBean, ((LinkageChangeBean) o).widgetDeviceBean) + && AssistUtils.equals(this.widgetTypeBean, ((LinkageChangeBean) o).widgetTypeBean); + } + + @Override + public int hashCode() { + return AssistUtils.hashCode(this.widgetDeviceBean, this.widgetTypeBean); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java new file mode 100644 index 000000000..1baac868f --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -0,0 +1,398 @@ +package com.fr.design.mainframe.share.action; + +import com.fr.base.Parameter; +import com.fr.base.ParameterMapNameSpace; +import com.fr.base.TableData; +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartdata.TableDataDefinition; +import com.fr.data.impl.NameTableData; +import com.fr.data.impl.TableDataDictionary; +import com.fr.design.actions.UpdateAction; +import com.fr.design.data.DesignTableDataManager; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.FormSelection; +import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.share.constants.ShareEntryKey; +import com.fr.design.mainframe.share.select.ComponentTransformerFactory; +import com.fr.design.parameter.ParameterInputPane; +import com.fr.form.FormElementCaseProvider; +import com.fr.form.main.Form; +import com.fr.form.main.FormIO; +import com.fr.form.main.WidgetGather; +import com.fr.form.ui.BaseChartEditor; +import com.fr.form.ui.ChartEditor; +import com.fr.form.ui.DataControl; +import com.fr.form.ui.DictionaryContainer; +import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.ui.Widget; +import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.report.cell.DefaultTemplateCellElement; +import com.fr.report.cell.cellattr.core.group.DSColumn; +import com.fr.script.Calculator; +import com.fr.stable.ArrayUtils; +import com.fr.stable.Constants; +import com.fr.stable.CoreGraphHelper; +import com.fr.stable.DependenceProvider; +import com.fr.stable.ParameterProvider; +import com.fr.stable.StringUtils; +import com.fr.stable.bridge.StableFactory; +import com.fr.stable.script.CalculatorProvider; +import com.fr.stable.script.NameSpace; +import com.fr.third.guava.base.Preconditions; +import com.fr.third.org.apache.commons.lang3.tuple.ImmutableTriple; +import com.fr.third.org.apache.commons.lang3.tuple.Triple; + +import javax.swing.Action; +import javax.swing.UIManager; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.Callable; +import java.util.concurrent.FutureTask; +import java.util.concurrent.TimeUnit; + +import static javax.swing.JOptionPane.ERROR_MESSAGE; + +/** + * @Author: Yuan.Wang + * @Date: 2020/11/3 + * 创建组件事件 + */ +public class CreateComponentAction extends UpdateAction { + ShareUIAspect aspect; + /** + * 等待时间 500 ms. + */ + private static final int WAIT_TIME = 500; + + private final HashMap parameterMap = new HashMap<>(); + private String[] widgetPara = new String[]{}; + + + public CreateComponentAction(ShareUIAspect aspect) { + this.putValue(Action.SMALL_ICON, null); + this.setName(Toolkit.i18nText("Fine-Design_Share_Create")); + this.aspect = aspect; + } + + @Override + public void actionPerformed(ActionEvent event) { + DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); + // 停止编辑 + JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); + jt.stopEditing(); + Form form = null; + try { + form = (Form) jt.getTarget().clone(); + } catch (CloneNotSupportedException e1) { + FineLoggerFactory.getLogger().error(e1.getMessage(), e1); + } + FormSelection selection = ((JForm) jt).getFormDesign().getSelectionModel().getSelection(); + + // 获取选中的组件 + Triple sharedTriple = ComponentTransformerFactory.getInstance().transform(selection); + if (sharedTriple == null) { + FineJOptionPane.showMessageDialog(designerFrame, Toolkit.i18nText("Fine-Design_Share_Select_Error_Tip"), + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), ERROR_MESSAGE, IOUtils.readIcon("/com/fr/base/images/share/Information_Icon_warning_normal_32x32.png")); + return; + } + + Widget widget = sharedTriple.getLeft(); + + try { + + if (form == null) { + throw new NullPointerException("tpl get failed"); + } + //准备参数 + prepareParameter(widget, designerFrame); + + //准备的封面大小 + //组件大小 + Rectangle reportRec = FormIO.getContentRect(form); + Image coverImage = toCoverImage(form, sharedTriple, parameterMap, reportRec); + + Object[] compositeArg = new Object[]{jt, widget, sharedTriple.getRight(), coverImage, parameterMap, (ShareUIAspect)aspect}; + HashMap compoClass = new HashMap(); + compoClass.put(Constants.ARG_0, JTemplate.class); + compoClass.put(Constants.ARG_1, Widget.class); + compoClass.put(Constants.ARG_2, Rectangle.class); + compoClass.put(Constants.ARG_3, Image.class); + compoClass.put(Constants.ARG_4, HashMap.class); + compoClass.put(Constants.ARG_5, ShareUIAspect.class); + + BasicPane ShareGuidePane = StableFactory.getMarkedInstanceObjectFromClass(ShareEntryKey.SHARE_GENERATE, compositeArg, compoClass, BasicPane.class); +// ShareGuidePane moduleGuidePane = new ShareGuidePane(jt, widget, sharedTriple.getRight(), coverImage, parameterMap, aspect); + ShareGuidePane.show(); + } catch (Exception e) { + FineJOptionPane.showMessageDialog(designerFrame, Toolkit.i18nText("Fine-Design_Share_Create_Share_Pane_Failed"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + /** + * 准备参数 + */ + private void prepareParameter(Widget widget, DesignerFrame designerFrame) { + + final Calculator ca = Calculator.createCalculator(); + Parameter[] tplParameters = ((Form)HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getTarget()).getParameters(); + widgetPara = new String[]{}; + calWidgetParameter(widget, ca); + List tplPList = new ArrayList(); + //只弹出使用到参数,其他的不要 + for (String wp : widgetPara) { + for (Parameter tplParameter : tplParameters) { + if (wp.length() > 0 && StringUtils.equals(wp, tplParameter.getName())) { + tplPList.add(tplParameter); + } else if (wp.contains("$") && StringUtils.equals(wp.substring(1, wp.length()), tplParameter.getName())){ + tplPList.add(tplParameter); + } + } + } + Parameter[] parameters = new Parameter[tplPList.size()]; + tplPList.toArray(parameters); + if (ArrayUtils.isNotEmpty(parameters)) {// 检查Parameter. + final ParameterInputPane pPane = new ParameterInputPane(parameters); + pPane.showSmallWindow(designerFrame, new DialogActionAdapter() { + + @Override + public void doOk() { + parameterMap.putAll(pPane.update()); + } + }).setVisible(true); + } + } + + private Triple prepareImageArgs(Triple pair, Rectangle reportRec) { + + Widget widget = pair.getLeft(); + XCreator xCreator = pair.getMiddle(); + Rectangle rectangle = pair.getRight(); + + if (widget instanceof ElementCaseEditor) { + rectangle = reportRec; + } + return new ImmutableTriple<>(widget, xCreator, rectangle); + } + + /** + * 准备封面 + *

      + * 操作可能会很耗时,所以加个时间限制 + */ + private Image toCoverImage(final Form form, + final Triple triple, + final Map parameterMap, + Rectangle reportRec) { + + final Triple imageArgs = prepareImageArgs(triple, reportRec); + FutureTask task = new FutureTask<>(new Callable() { + @Override + public Image call() throws Exception { + + Preconditions.checkNotNull(imageArgs); + Widget widget = imageArgs.getLeft(); + XCreator xCreator = imageArgs.getMiddle(); + Rectangle rectangle = imageArgs.getRight(); + if (widget instanceof ElementCaseEditor) { + return moduleToImage(form, (ElementCaseEditor) widget, parameterMap, rectangle); + } else { + return componentToImage(xCreator, rectangle); + } + } + }); + Thread imgThread = new Thread(task, "img-thread"); + try { + imgThread.start(); + //等待一段时间 + return task.get(WAIT_TIME, TimeUnit.MILLISECONDS); + } catch (Throwable throwable) { + + FineLoggerFactory.getLogger().debug("--- img generate failed ---"); + FineLoggerFactory.getLogger().debug(throwable.getMessage(), throwable); + FineLoggerFactory.getLogger().debug("--- prepare use default img ---"); + try (InputStream in = this.getClass().getResourceAsStream("/com/fr/base/images/share/default_cover.png")) { + //读取默认图表 + return IOUtils.readImage(in); + } catch (Throwable e) { + //随便画一个 + Rectangle realRec = triple.getRight(); + BufferedImage allInOne = CoreGraphHelper.createBufferedImage(realRec.width, realRec.height); + Graphics2D g2d = allInOne.createGraphics(); + g2d.setBackground(Color.white); + return allInOne; + } + } + } + + private Image componentToImage(Component comp, Rectangle rect) { + + BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); + comp.paint(im.getGraphics()); + return im; + } + + //画报表块的缩略图 + private Image moduleToImage(Form form, ElementCaseEditor editor, Map parameterMap, Rectangle rect) { + + if (editor == null) { + return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); + } + FormElementCaseProvider provider = editor.getElementCase(); + provider.setName(editor.getWidgetName()); + provider.setTabledataSource(form); + final Calculator ca = Calculator.createCalculator(); + NameSpace ns = ParameterMapNameSpace.create(parameterMap); + ca.pushNameSpace(ns); + BufferedImage image = provider.toImage(ca, (int) rect.getWidth(), (int) rect.getHeight(), parameterMap, true); + return image; + + } + + //计算容器内使用到的参数 + private void calWidgetParameter(Widget widget, final Calculator ca) { + + Form.traversalWidget(widget, new WidgetGather() { + + @Override + public void dealWith(Widget widget) { + DataControl dc = (DataControl) widget; + TableData tableData = null; + try { + tableData = ((TableDataDictionary)(((DictionaryContainer) dc).getDictionary())).getTableData(); + } catch (Exception ignore) { + //ignore + } + widgetPara = ArrayUtils.addAll(widgetPara, getTableDataPara(tableData)); + + } + + @Override + public boolean dealWithAllCards() { + return true; + } + + }, DataControl.class); + + Form.traversalWidget(widget, new WidgetGather() { + + @Override + public void dealWith(Widget widget) { + ElementCaseEditor el = (ElementCaseEditor) widget; + widgetPara = ArrayUtils.addAll(widgetPara, getCellParameters(el.getElementCase(), ca)); + widgetPara = ArrayUtils.addAll(widgetPara, el.getElementCase().dependence(ca)); + } + + public boolean dealWithAllCards() { + return true; + } + + }, ElementCaseEditor.class); + + Form.traversalWidget(widget, new WidgetGather() { + + @Override + public void dealWith(Widget widget) { + //算的好麻烦,本来直接用dependence就好了,但是表单的selectedChart中的tabledata只有一个name,里面的_tableData是null、、所以从环境中重新取一下 + Chart selectedChart = ((ChartCollection) ((ChartEditor) widget).getChartCollection()).getSelectedChart(); + TableData tableData = null; + try { + tableData = ((TableDataDefinition)selectedChart.getFilterDefinition()).getTableData(); + } catch (Exception ignore) { + //ignore + } + widgetPara = ArrayUtils.addAll(widgetPara, getTableDataPara(tableData)); + } + + public boolean dealWithAllCards() { + return true; + } + + }, BaseChartEditor.class); + } + + private ArrayList getTableDataName(FormElementCaseProvider el, CalculatorProvider ca) { + Iterator it = el.cellIterator(); + ArrayList allECDepends = new ArrayList(); + while(it.hasNext()){ + DefaultTemplateCellElement ce = it.next(); + Object value = ce.getValue(); + //先处理单元格值(图表, 公式) + if(value instanceof DSColumn){ + String[] valueDep = ((DependenceProvider) value).dependence(ca); + allECDepends.addAll(Arrays.asList(valueDep)); + } + } + return allECDepends; + } + + private String[] getTableDataPara(TableData tableData) { + try { + return getTableParameters(((NameTableData) tableData).getName()); + } catch (Exception ignore) { + return new String[]{}; + } + } + + private String[] getCellParameters(FormElementCaseProvider formElementCase,Calculator ca) { + Iterator it = formElementCase.cellIterator(); + ArrayList allECDepends = new ArrayList(); + while(it.hasNext()){ + DefaultTemplateCellElement ce = it.next(); + Object value = ce.getValue(); + //处理单元格值(图表, 公式) + if(value instanceof DependenceProvider){ + String[] valueDep = ((DependenceProvider) value).dependence(ca); + allECDepends.addAll(Arrays.asList(valueDep)); + if (value instanceof DSColumn) { + String[] dsPara = getTableParameters(((DSColumn) value).getDSName()); + allECDepends.addAll(Arrays.asList(dsPara)); + } + } + } + //去掉重复的dependence + HashSet removeRepeat = new HashSet(allECDepends); + return removeRepeat.toArray(new String[removeRepeat.size()]); + } + + //通过tableName获取所用参数 + private String[] getTableParameters(String name) { + final Calculator ca = Calculator.createCalculator(); + ParameterProvider[] parameterProviders = new ParameterProvider[]{}; + TableData tableData = DesignTableDataManager.getEditingTableDataSource().getTableData(name); + //只使用自定义数据集的数据 + if (tableData == null) { + return new String[]{}; + } + parameterProviders = tableData.getParameters(ca); + String[] paras = new String[parameterProviders.length]; + for (int i = 0; i < parameterProviders.length; i++) { + paras[i] = parameterProviders[0].getName(); + } + return paras; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java new file mode 100644 index 000000000..d3173e36b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/InstallComponentAction.java @@ -0,0 +1,163 @@ +package com.fr.design.mainframe.share.action; + +import com.fr.design.actions.UpdateAction; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ifilechooser.UINativeFileChooser; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.share.ui.base.FailureMessagePane; +import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; +import com.fr.design.mainframe.share.util.InstallUtils; +import com.fr.design.mainframe.share.util.ShareComponentUtils; +import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.design.os.impl.SupportOSImpl; +import com.fr.form.share.record.ShareWidgetInfoManager; +import com.fr.form.share.utils.ReuxUtils; +import com.fr.log.FineLoggerFactory; + +import javax.swing.Action; +import javax.swing.JFileChooser; +import javax.swing.SwingWorker; +import javax.swing.filechooser.FileNameExtensionFilter; +import java.awt.event.ActionEvent; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/8 + */ + +public class InstallComponentAction extends UpdateAction { + + public InstallComponentAction() { + this.putValue(Action.SMALL_ICON, null); + this.setName(Toolkit.i18nText("Fine-Design_Share_Install")); + } + + @Override + public void actionPerformed(ActionEvent e) { + + if (SupportOSImpl.NATIVE_CHOOSER.support()) { + UINativeFileChooser nativeFileChooser = new UINativeFileChooser(); + nativeFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + nativeFileChooser.setMultiSelectionEnabled(true); + nativeFileChooser.setFileFilter(new FileNameExtensionFilter("reu reus", "reu", "reus")); + nativeFileChooser.setDialogTitle(Toolkit.i18nText("Fine-Design_Basic_Select")); + int returnValue = nativeFileChooser.showOpenDialog(new UILabel()); + installComponent(returnValue, nativeFileChooser.getSelectedFiles()); + } else { + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + fileChooser.setMultiSelectionEnabled(true); + fileChooser.setFileFilter(new FileNameExtensionFilter("reu reus", "reu", "reus")); + int returnValue = fileChooser.showDialog(new UILabel(), Toolkit.i18nText("Fine-Design_Basic_Select")); + installComponent(returnValue, fileChooser.getSelectedFiles()); + } + } + + private void installComponent(int returnValue, File[] selectedFiles) { + if (returnValue != JFileChooser.APPROVE_OPTION) { + return; + } + LocalWidgetRepoPane.getInstance().switch2InstallingPane(); + final File[] chosenFiles = selectedFiles; + new SwingWorker() { + @Override + protected InstallBackInfo doInBackground() { + return batchInstallZipFiles(chosenFiles); + } + + @Override + protected void done() { + try { + InstallBackInfo info = get(); + LocalWidgetRepoPane.getInstance().refreshAllGroupPane(); + showMessageDialog(info); + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + } + } + }.execute(); + } + + private InstallBackInfo batchInstallZipFiles(File[] chosenFiles) { + try { + long installTime = System.currentTimeMillis(); + boolean installStatus = true; + //记录安装失败的组件 + List failureList = new ArrayList<>(); + for (File file : chosenFiles) { + installStatus &= installFromDiskZipFile(file, installTime, failureList); + } + ShareWidgetInfoManager.getInstance().saveXmlInfo(); + + boolean needShowMessage = (chosenFiles.length > 1 && chosenFiles.length != failureList.size()) || containRues(chosenFiles); + return new InstallBackInfo(installStatus, needShowMessage, failureList); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return new InstallBackInfo(false, false, new ArrayList<>()); + } + } + + private void showMessageDialog(InstallBackInfo info) { + if (info.success) { + FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Form_Share_Module_OK")); + return; + } + if (info.needShowMessage) { + final FailureMessagePane failureMessagePane = new FailureMessagePane(appendString(info.failureInfo)); + BasicDialog dialog = failureMessagePane.showSmallWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() { + }); + dialog.setVisible(true); + } else { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Share_Module_Install_Error")); + } + } + + private boolean containRues(File[] chosenFiles) { + for (File file : chosenFiles) { + if (file.getName().endsWith(ReuxUtils.REUS_SUFFIX)) + return true; + } + return false; + } + + private String appendString(List list) { + StringBuilder builder = new StringBuilder(); + for (String str : list) { + builder.append(str).append("\n"); + } + return builder.toString(); + } + + /** + * 安装选中文件 + */ + private boolean installFromDiskZipFile(File chosenFile, long installTime, List failList) { + if (chosenFile == null) { + return false; + } + ShareComponentUtils.checkReadMe(); + boolean isReus = chosenFile.getName().endsWith(ReuxUtils.REUS_SUFFIX); + return isReus ? InstallUtils.installReusFile(chosenFile, installTime, failList) : InstallUtils.installReuFile(chosenFile, installTime, failList); + } + + private static class InstallBackInfo { + final boolean success; + final boolean needShowMessage; + final List failureInfo; + + public InstallBackInfo(boolean success, boolean needShowMessage, List failureInfo) { + this.success = success; + this.needShowMessage = needShowMessage; + this.failureInfo = failureInfo; + } + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/ShareUIAspect.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/ShareUIAspect.java new file mode 100644 index 000000000..27643e06a --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/ShareUIAspect.java @@ -0,0 +1,9 @@ +package com.fr.design.mainframe.share.action; + +/** + * created by Harrison on 2020/04/22 + **/ +public interface ShareUIAspect { + + void afterOk(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ComponentType.java b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ComponentType.java new file mode 100644 index 000000000..bb1f1976d --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ComponentType.java @@ -0,0 +1,18 @@ +package com.fr.design.mainframe.share.constants; + +import java.util.List; + +/** + * created by Harrison on 2020/04/20 + **/ +public interface ComponentType { + + List children(int device); + + /** + * 返回子类型所有 + * + * @return + */ + List types(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ComponentTypes.java b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ComponentTypes.java new file mode 100644 index 000000000..e7f30c7a2 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ComponentTypes.java @@ -0,0 +1,193 @@ +package com.fr.design.mainframe.share.constants; + +import com.fr.design.i18n.Toolkit; + +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +/** + * created by Harrison on 2020/04/20 + **/ +public enum ComponentTypes implements ComponentType { + + CHART("Fine-Design_Share_Type_Basic_Element") { + @Override + public List children(int device) { + + return ChartChildTypes.support(device); + } + + @Override + public List types() { + List list = new ArrayList<>(); + for (ChartChildTypes types : ChartChildTypes.values()) { + list.add(types.getLocText()); + } + return list; + } + }, + + REPORT("Fine-Design_Share_Type_Report") { + @Override + public List children(int device) { + + if (DisplayDevice.supportMobile(device)) { + return ReportChildTypes.support(DisplayDevice.MOBILE.getType()); + } + return ReportChildTypes.support(DisplayDevice.PC.getType()); + } + + @Override + public List types() { + List list = new ArrayList<>(); + for (ReportChildTypes types : ReportChildTypes.values()) { + list.add(types.getLocText()); + } + return list; + } + }; + + /** + * 所有类型 + * + * @return + */ + public static List allTypes() { + List allTypes = new ArrayList<>(); + Set set = new LinkedHashSet<>(); + for (ComponentTypes types : values()) { + set.addAll(types.children(DisplayDevice.MOBILE.getType())); + set.addAll(types.children(DisplayDevice.PC.getType())); + } + allTypes.addAll(set); + return allTypes; + } + + /** + * 根据终端返回所有类型 + * + * @param device + * @return + */ + public static List allTypesByDevice(int device) { + List allTypes = new ArrayList<>(); + for (ComponentTypes types : values()) { + allTypes.addAll(types.children(device)); + } + return allTypes; + } + + private enum ReportChildTypes { + + INDICATOR_CARD("Fine-Design_Share_Type_Indicator_Card"), + + TITLE("Fine-Design_Share_Type_Title"), + + DIMENSION_CHANGE("Fine-Design_Share_Type_Dimension_Change"), + + FILL("Fine-Design_Share_Type_Fill", DisplayDevice.MOBILE), + + Directory_Navigation("Fine-Design_Share_Type_Mobile_Directory_Navigation", DisplayDevice.MOBILE), + + + SPECIAL_CARD("Fine-Design_Share_Type_Special_Card"); + + private String locale; + + /** + * @see DisplayDevice + */ + private int support; + + ReportChildTypes(String locale) { + this(locale, DisplayDevice.buildAll()); + } + + ReportChildTypes(String locale, DisplayDevice device) { + this(locale, device.getType()); + } + + ReportChildTypes(String locale, int support) { + this.locale = locale; + this.support = support; + } + + public static List support(int device) { + + List list = new ArrayList<>(); + ReportChildTypes[] values = ReportChildTypes.values(); + for (ReportChildTypes value : values) { + //支持当前设备 + if (DisplayDevice.supportDevice(device, value.support)) { + list.add(value.getLocText()); + } + } + return list; + } + + public String getLocText() { + + return Toolkit.i18nText(this.locale); + } + } + + private enum ChartChildTypes { + + COLUMN_CHART("Fine-Design_Share_Type_Chart_Column"), + + PIE_CHART("Fine-Design_Share_Type_Chart_Pie"), + + FOLD_LINE_CHART("Fine-Design_Share_Type_Chart_Fold_Line"), + + COMBINE_CHART("Fine-Design_Share_Type_Chart_Combine"), + + METER_CHART("Fine-Design_Share_Type_Chart_Meter"), + + MAP_CHART("Fine-Design_Share_Type_Chart_Map"), + + OTHERS("Fine-Design_Share_Type_Chart_Other"), + + DETAIL_LIST("Fine-Design_Share_Type_Detail_List"), + + BASIC_WIDGET("Fine-Design_Share_Type_Basic_Widget"); + + private String locale; + + ChartChildTypes(String locale) { + this.locale = locale; + } + + public static List support(int device) { + + List list = new ArrayList<>(); + ChartChildTypes[] values = ChartChildTypes.values(); + for (ChartChildTypes value : values) { + list.add(value.getLocText()); + } + return list; + } + + public String getLocText() { + + return Toolkit.i18nText(this.locale); + } + } + + private String locale; + + ComponentTypes(String locale) { + this.locale = locale; + } + + public String getLocText() { + + return Toolkit.i18nText(this.locale); + } + + @Override + public String toString() { + return getLocText(); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/constants/DisplayDevice.java b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/DisplayDevice.java new file mode 100644 index 000000000..87f77241c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/DisplayDevice.java @@ -0,0 +1,66 @@ +package com.fr.design.mainframe.share.constants; + +/** + * created by Harrison on 2020/04/21 + **/ +public enum DisplayDevice { + + NONE(0), + + MOBILE(1), + + PC(2); + + private int type; + + DisplayDevice(int type) { + this.type = type; + } + + public int getType() { + return type; + } + + public static int buildAll() { + + int support = 0; + DisplayDevice[] values = DisplayDevice.values(); + for (DisplayDevice value : values) { + support |= value.getType(); + } + return support; + } + + public static int buildDevice(Iterable devices) { + + int support = 0; + if (devices == null) { + return support; + } + for (DisplayDevice device : devices) { + support |= device.type; + } + return support; + } + + public static boolean supportDevice(int device, int support) { + + return device == buildAll() || (support & device) == device; + } + + public static boolean supportMobile(int device) { + + return (device & MOBILE.getType()) == MOBILE.getType(); + } + + public static boolean supportPC(int device) { + + return (device & PC.getType()) == PC.getType(); + } + + private static int calVal(DisplayDevice device) { + + return 1 << device.type; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ShareEntryKey.java b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ShareEntryKey.java new file mode 100644 index 000000000..a873325f5 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/ShareEntryKey.java @@ -0,0 +1,6 @@ +package com.fr.design.mainframe.share.constants; + +public class ShareEntryKey { + static public final String SHARE_GENERATE = "ShareGeneratePane"; + static public final String SHARE_CONFIG = "ShareConfigPane"; +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/constants/StyleTheme.java b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/StyleTheme.java new file mode 100644 index 000000000..1738eb5cb --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/constants/StyleTheme.java @@ -0,0 +1,81 @@ +package com.fr.design.mainframe.share.constants; + +import com.fr.design.i18n.Toolkit; +import com.fr.form.share.bean.StyleThemeBean; +import com.fr.form.share.bean.WidgetFilterInfo; +import com.fr.form.share.bean.WidgetFilterTypeInfo; +import com.fr.form.share.constants.ShareComponentConstants; +import com.fr.form.share.utils.ShareUtils; +import com.fr.general.ComparatorUtils; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * Created by kerry on 2020-12-09 + */ +public enum StyleTheme { + + SIMPLE_FRESH("Fine-Design_Share_Style_Theme_Simple", "1"), + BUSINESS_STABLE("Fine-Design_Share_Style_Theme_Business", "2"), + LIVE_GORGEOUS("Fine-Design_Share_Style_Theme_Live", "3"), + COOL_TECHNOLOGY("Fine-Design_Share_Style_Theme_Cool", "4"), + OTHER_THEME("Fine-Design_Share_Style_Theme_Other", "5"); + + + private final String local; + private final String id; + + StyleTheme(String name, String id) { + this.local = name; + this.id = id; + } + + public String getLocText() { + return Toolkit.i18nText(this.local); + } + + public String getId() { + return this.id; + } + + private static List types() { + List list = new ArrayList<>(); + for (StyleTheme type : StyleTheme.values()) { + list.add(new StyleThemeBean(type.getId(), type.getLocText())); + } + return list; + } + + /** + * 获取样式风格属性list + * + * @return List + */ + public static List getStyleThemeTypeInfo() { + List widgetFilterTypeInfos = ShareUtils.getWidgetFilterTypeInfos(); + if (widgetFilterTypeInfos.isEmpty()) { + return types(); + } + WidgetFilterTypeInfo styleThemeFilterInfo = new WidgetFilterTypeInfo(); + for (WidgetFilterTypeInfo typeInfo : widgetFilterTypeInfos) { + if (ComparatorUtils.equals(ShareComponentConstants.STYLE_THEME_KEY, typeInfo.getKey())) { + styleThemeFilterInfo = typeInfo; + break; + } + } + List resultList = new ArrayList<>(); + List filterInfoList = styleThemeFilterInfo.getFilterItems(); + Iterator infoIterator = filterInfoList.iterator(); + while (infoIterator.hasNext()) { + WidgetFilterInfo filterInfo = infoIterator.next(); + if (!ComparatorUtils.equals(ShareComponentConstants.ALL_STYLE_THEME, filterInfo.getId())) { + resultList.add(new StyleThemeBean(filterInfo.getId(), filterInfo.getName())); + } + } + return resultList; + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/AbstractCrossClipBoardState.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/AbstractCrossClipBoardState.java new file mode 100644 index 000000000..f99349134 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/AbstractCrossClipBoardState.java @@ -0,0 +1,62 @@ +package com.fr.design.mainframe.share.encrypt.clipboard; + +import com.fr.stable.StringUtils; + +import java.util.concurrent.atomic.AtomicReference; + +/** + * 跨模版禁用 + *

      + * created by Harrison on 2020/05/14 + **/ +public abstract class AbstractCrossClipBoardState implements CrossClipboardState { + private final AtomicReference sourceId = new AtomicReference<>(); + + @Override + public synchronized boolean isBan() { + + String sourceId = this.sourceId.get(); + if (StringUtils.isEmpty(sourceId)) { + return false; + } + //这里只获取新的,不能更新 + //因为新的模板可能不是限制模板,然而剪贴板中的内容没有清空。 + //所以,直接在新的模板中再一次粘贴,就可以避过限制 + String targetId = get(); + return isCross(sourceId, targetId) && isRestrict(sourceId); + } + + protected boolean isRestrict(String sourceId) { + + return true; + } + + @Override + public synchronized void mark() { + + update(); + } + + private String get() { + + return currentId(); + } + + private void update() { + + String templateId = currentId(); + sourceId.set(templateId); + } + + private boolean isCross(String sourceId, String targetId) { + + //源 id 不等于 null + //如果源 id 等于 null , 两种情况 + //1-之前没有 + //2-是从其他地方,复制过来,这样的话,直接通过就好了。 + return StringUtils.isNotEmpty(sourceId) + && !StringUtils.equals(sourceId, targetId); + } + + protected abstract String currentId(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/CrossClipboardHandler.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/CrossClipboardHandler.java new file mode 100644 index 000000000..f00ab8302 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/CrossClipboardHandler.java @@ -0,0 +1,79 @@ +package com.fr.design.mainframe.share.encrypt.clipboard; + +import com.fr.design.fun.impl.AbstractClipboardHandlerProvider; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * created by Harrison on 2020/05/14 + **/ +public abstract class CrossClipboardHandler extends AbstractClipboardHandlerProvider { + + private List states = new ArrayList<>(8); + + public CrossClipboardHandler(CrossClipboardState... states) { + + init(states); + } + + private void init(CrossClipboardState... states) { + + if (states == null) { + return; + } + Collections.addAll(this.states, states); + } + + @Override + public T cut(T selection) { + + mark(); + return cut0(selection); + } + + protected T cut0(T selection) { + + return selection; + } + + @Override + public T copy(T selection) { + + mark(); + return copy0(selection); + } + + protected T copy0(T selection) { + + return selection; + } + + @Override + public T paste(T selection) { + + return isBan() ? null : paste0(selection); + } + + protected T paste0(T selection) { + + return selection; + } + + private void mark() { + + for (CrossClipboardState state : states) { + state.mark(); + } + } + + private boolean isBan() { + + boolean isBan = false; + for (CrossClipboardState state : states) { + isBan |= state.isBan(); + } + return isBan; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/CrossClipboardState.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/CrossClipboardState.java new file mode 100644 index 000000000..4458ded3a --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/CrossClipboardState.java @@ -0,0 +1,22 @@ +package com.fr.design.mainframe.share.encrypt.clipboard; + +/** + * created by Harrison on 2020/05/18 + **/ +public interface CrossClipboardState { + + + /** + * 是否禁用 + * + * @return y/n + */ + boolean isBan(); + + /** + * 标记状态 + */ + void mark(); +} + + diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/RestrictTemplateSet.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/RestrictTemplateSet.java new file mode 100644 index 000000000..bd781641c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/RestrictTemplateSet.java @@ -0,0 +1,72 @@ +package com.fr.design.mainframe.share.encrypt.clipboard; + +import com.fr.form.main.Form; +import com.fr.form.main.WidgetUtil; +import com.fr.base.iofile.attr.EncryptSharableAttrMark; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.container.WLayout; +import com.fr.stable.fun.IOFileAttrMark; + +import java.util.HashMap; +import java.util.Map; + +/** + * created by Harrison on 2020/05/14 + **/ +public abstract class RestrictTemplateSet { + + private static Map restrictMap = new HashMap<>(8); + + public static void monitorGracefully(Form form) { + monitor(form, true); + } + + public static void monitorForcefully(Form form) { + monitor(form, false); + } + + private static void monitor(Form form, boolean useCache) { + + String templateID = form.getTemplateID(); + if (useCache) { + if (restrictMap.containsKey(templateID)) { + return; + } + } + //检测 + 缓存 + monitor0(form); + } + + private static void monitor0(Form form) { + + final String templateID = form.getTemplateID(); + WLayout container = form.getContainer(); + WidgetUtil.bfsTraversalWidget(container, new WidgetUtil.BfsWidgetGather() { + @Override + public boolean dealWith(AbstractBorderStyleWidget widget) { + IOFileAttrMark mark = widget.getWidgetAttrMark(EncryptSharableAttrMark.XML_TAG); + boolean existEncrypt = mark != null; + if (existEncrypt) { + restrictMap.put(templateID, existEncrypt); + } + return existEncrypt; + } + }, AbstractBorderStyleWidget.class); + + initIfAbsent(templateID); + } + + private static void initIfAbsent(String templateID) { + + if (!restrictMap.containsKey(templateID)) { + restrictMap.put(templateID, false); + } + } + + public static boolean isRestrict(String templateId) { + + Boolean restrict = restrictMap.get(templateId); + return restrict == null ? false : restrict; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/TemplateStateListenerProvider.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/TemplateStateListenerProvider.java new file mode 100644 index 000000000..d46ba0f55 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/TemplateStateListenerProvider.java @@ -0,0 +1,116 @@ +package com.fr.design.mainframe.share.encrypt.clipboard; + +import com.fr.base.io.BaseBook; +import com.fr.base.iofile.attr.ExtendSharableAttrMark; +import com.fr.design.DesignModelAdapter; +import com.fr.design.data.datapane.TableDataTreePane; +import com.fr.design.designer.beans.events.DesignerEvent; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XWTitleLayout; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.fun.impl.AbstractDesignerEditListenerProvider; +import com.fr.design.mainframe.JTemplate; +import com.fr.form.main.Form; +import com.fr.form.main.WidgetGatherAdapter; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.editor.SharableEditorProvider; +import com.fr.form.share.utils.ShareUtils; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WLayout; +import com.fr.general.ComparatorUtils; +import com.fr.stable.StringUtils; + +import java.util.Iterator; + +/** + * 创建,删除的时候要初始化部分状态 + *

      + * created by Harrison on 2020/05/19 + **/ +public class TemplateStateListenerProvider extends AbstractDesignerEditListenerProvider { + + public static final int CREATOR_ADDED = 1; + + public static final int CREATOR_DELETED = 2; + + private static final String SEPARATOR = "-"; + + private String lastAffectedCreatorShareID; + + + @Override + public void fireCreatorModified(DesignerEvent evt) { + + int eventId = evt.getCreatorEventID(); + if (eventId == CREATOR_ADDED || eventId == CREATOR_DELETED) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + BaseBook book = template.getTarget(); + if (book instanceof Form) { + Form form = (Form) book; + RestrictTemplateSet.monitorForcefully(form); + refreshTableDataTree(form, evt); + } + } + if (eventId == DesignerEvent.CREATOR_SELECTED) { + XCreator lastAffectedCreator = (XCreator) evt.getAffectedCreator(); + if (lastAffectedCreator == null) { + return; + } + lastAffectedCreatorShareID = lastAffectedCreator.getShareId(); + //做下兼容处理,有标题的老的组件其外层的creator上是没有shareID的,新生成的组件是有的 + if (!lastAffectedCreator.acceptType(XWTitleLayout.class) || StringUtils.isNotEmpty(lastAffectedCreatorShareID)) { + return; + } + XCreator body = getBodyCreator((XWTitleLayout) lastAffectedCreator); + if (body != null) { + lastAffectedCreatorShareID = body.getShareId(); + } + + } + } + + private XCreator getBodyCreator(XWTitleLayout titleLayout) { + for (int i = 0; i < titleLayout.getXCreatorCount(); i++) { + XCreator creator = titleLayout.getXCreator(i); + if (creator.hasTitleStyle()) { + return creator; + } + } + return null; + } + + private void refreshTableDataTree(Form form, DesignerEvent evt) { + if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED && StringUtils.isNotEmpty(lastAffectedCreatorShareID)) { + if (!needDeleteTableData(form.getContainer(), lastAffectedCreatorShareID)) { + return; + } + //TODO 目前组件没版本号,可以直接遍历,之后可能还是要改的 + SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(lastAffectedCreatorShareID); + SharableEditorProvider sharableEditor = ShareUtils.getSharedElCaseEditorById(lastAffectedCreatorShareID); + if (sharableEditor == null || bindInfo == null) { + return; + } + Iterator tdIterator = sharableEditor.getTableDataSource().getTableDataNameIterator(); + while (tdIterator.hasNext()) { + String tdName = bindInfo.getName() + SEPARATOR + tdIterator.next(); + TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).removeTableData(tdName); + } + } + } + + private boolean needDeleteTableData(WLayout widget, final String shareId) { + final boolean[] needDeleteTableData = {true}; + Form.traversalWidget(widget, new WidgetGatherAdapter() { + @Override + public void dealWith(Widget widget) { + AbstractBorderStyleWidget borderStyleWidget = (AbstractBorderStyleWidget) widget; + ExtendSharableAttrMark attrMark = borderStyleWidget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); + if (attrMark != null) { + needDeleteTableData[0] &= !ComparatorUtils.equals(shareId, attrMark.getShareId()); + } + } + }, AbstractBorderStyleWidget.class); + return needDeleteTableData[0]; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossLayoutClipBoardState.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossLayoutClipBoardState.java new file mode 100644 index 000000000..63d3c3293 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossLayoutClipBoardState.java @@ -0,0 +1,86 @@ +package com.fr.design.mainframe.share.encrypt.clipboard.impl; + +import com.fr.base.io.BaseBook; +import com.fr.base.iofile.attr.ExtendSharableAttrMark; +import com.fr.design.designer.beans.models.SelectionModel; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.FormSelection; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.form.main.Form; +import com.fr.design.mainframe.share.encrypt.clipboard.AbstractCrossClipBoardState; +import com.fr.base.iofile.attr.EncryptSharableAttrMark; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.container.WLayout; +import com.fr.stable.StringUtils; +import com.fr.stable.fun.IOFileAttrMark; +import org.jetbrains.annotations.Nullable; + +import java.util.concurrent.atomic.AtomicReference; + +/** + * 只需要看是否跨布局去粘贴。 + *

      + * created by Harrison on 2020/06/04 + **/ +public class CrossLayoutClipBoardState extends AbstractCrossClipBoardState { + + @Override + protected String currentId() { + //默认id + final AtomicReference finalId = new AtomicReference<>(StringUtils.EMPTY); + WidgetPropertyPane pane = WidgetPropertyPane.getInstance(); + FormDesigner designer = pane.getEditingFormDesigner(); + if (designer == null) { + return null; + } + Form target = designer.getTarget(); + BaseBook current = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget(); + //如果不是同一个 + if (!StringUtils.equals(target.getTemplateID(), current.getTemplateID())) { + return null; + } + SelectionModel selectionModel = designer.getSelectionModel(); + if (selectionModel == null) { + return null; + } + FormSelection selection = selectionModel.getSelection(); + if (selection == null) { + return null; + } + XCreator[] xCreators = selection.getSelectedCreators(); + if (xCreators != null) { + XCreator xCreator = xCreators[0]; + if (StringUtils.isEmpty(finalId.get())) { + XLayoutContainer layout = XCreatorUtils.getParentXLayoutContainer(xCreator); + if (layout != null) { + WLayout wLayout = layout.toData(); + String encryptWidgetId = findEncryptWidgetId(wLayout); + boolean hasId = StringUtils.isNotEmpty(encryptWidgetId); + if (hasId) { + finalId.set(encryptWidgetId); + } + } + } + + } + return finalId.get(); + } + + @Nullable + private String findEncryptWidgetId(AbstractBorderStyleWidget widget) { + + IOFileAttrMark widgetAttrMark = widget.getWidgetAttrMark(EncryptSharableAttrMark.XML_TAG); + boolean isEncrypt = widgetAttrMark != null; + if (isEncrypt) { + ExtendSharableAttrMark sharableAttrMark = widget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); + if (sharableAttrMark != null) { + return (sharableAttrMark.getShareId()); + } + } + return null; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossTemplateClipBoardState.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossTemplateClipBoardState.java new file mode 100644 index 000000000..f232deafc --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossTemplateClipBoardState.java @@ -0,0 +1,32 @@ +package com.fr.design.mainframe.share.encrypt.clipboard.impl; + +import com.fr.base.io.BaseBook; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.share.encrypt.clipboard.AbstractCrossClipBoardState; +import com.fr.design.mainframe.share.encrypt.clipboard.RestrictTemplateSet; +import com.fr.form.main.Form; + +/** + * created by Harrison on 2020/05/18 + **/ +public class CrossTemplateClipBoardState extends AbstractCrossClipBoardState { + + @Override + protected String currentId() { + + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + BaseBook book = template.getTarget(); + if (book instanceof Form) { + Form form = (Form) book; + RestrictTemplateSet.monitorGracefully(form); + } + return book.getTemplateID(); + } + + @Override + protected boolean isRestrict(String sourceId) { + + return RestrictTemplateSet.isRestrict(sourceId); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossWidgetClipBoardState.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossWidgetClipBoardState.java new file mode 100644 index 000000000..4a2ea776f --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/CrossWidgetClipBoardState.java @@ -0,0 +1,68 @@ +package com.fr.design.mainframe.share.encrypt.clipboard.impl; + +import com.fr.base.io.BaseBook; +import com.fr.base.iofile.attr.ExtendSharableAttrMark; +import com.fr.design.designer.beans.models.SelectionModel; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.FormSelection; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.share.encrypt.clipboard.AbstractCrossClipBoardState; +import com.fr.form.main.Form; +import com.fr.form.main.WidgetUtil; +import com.fr.base.iofile.attr.EncryptSharableAttrMark; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.Widget; +import com.fr.stable.StringUtils; +import com.fr.stable.fun.IOFileAttrMark; + +/** + * created by Harrison on 2020/05/18 + **/ +public class CrossWidgetClipBoardState extends AbstractCrossClipBoardState { + + @Override + protected String currentId() { + + final String[] finalIds = new String[]{null}; + WidgetPropertyPane pane = WidgetPropertyPane.getInstance(); + FormDesigner designer = pane.getEditingFormDesigner(); + if (designer == null) { + return null; + } + Form target = designer.getTarget(); + BaseBook current = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getTarget(); + //如果不是同一个 + if (!StringUtils.equals(target.getTemplateID(), current.getTemplateID())) { + return null; + } + SelectionModel selectionModel = designer.getSelectionModel(); + if (selectionModel == null) { + return null; + } + FormSelection selection = selectionModel.getSelection(); + if (selection == null) { + return null; + } + Widget[] selectedWidgets = selection.getSelectedWidgets(); + if (selectedWidgets != null && selectedWidgets.length == 1) { + final Widget selectedWidget = selectedWidgets[0]; + WidgetUtil.bfsTraversalWidget(selectedWidget, new WidgetUtil.BfsWidgetGather() { + @Override + public boolean dealWith(AbstractBorderStyleWidget widget) { + + IOFileAttrMark widgetAttrMark = widget.getWidgetAttrMark(EncryptSharableAttrMark.XML_TAG); + boolean isEncrypt = widgetAttrMark != null; + if (isEncrypt) { + ExtendSharableAttrMark sharableAttrMark = widget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); + if (sharableAttrMark != null) { + finalIds[0] = sharableAttrMark.getShareId(); + } + } + return isEncrypt; + } + }, AbstractBorderStyleWidget.class); + } + return finalIds[0]; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/EncryptSelectionClipboardHandler.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/EncryptSelectionClipboardHandler.java new file mode 100644 index 000000000..81e1f25e7 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/EncryptSelectionClipboardHandler.java @@ -0,0 +1,31 @@ +package com.fr.design.mainframe.share.encrypt.clipboard.impl; + +import com.fr.design.mainframe.FormSelection; +import com.fr.design.mainframe.share.encrypt.clipboard.CrossClipboardHandler; + +/** + * 组件选择 + *

      + * created by Harrison on 2020/05/18 + **/ +public class EncryptSelectionClipboardHandler extends CrossClipboardHandler { + private static EncryptSelectionClipboardHandler selectionClipboardHandler; + + public static EncryptSelectionClipboardHandler getInstance() { + if (selectionClipboardHandler == null) { + selectionClipboardHandler = new EncryptSelectionClipboardHandler(); + } + return selectionClipboardHandler; + } + + public EncryptSelectionClipboardHandler() { + + super(new CrossTemplateClipBoardState(), new CrossLayoutClipBoardState()); + } + + @Override + public boolean support(Object selection) { + + return selection instanceof FormSelection; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/EncryptTransferableClipboardHandler.java b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/EncryptTransferableClipboardHandler.java new file mode 100644 index 000000000..cfce3eb77 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/encrypt/clipboard/impl/EncryptTransferableClipboardHandler.java @@ -0,0 +1,32 @@ +package com.fr.design.mainframe.share.encrypt.clipboard.impl; + +import com.fr.design.mainframe.share.encrypt.clipboard.CrossClipboardHandler; + +import java.awt.datatransfer.Transferable; + +/** + * 单元格 + *

      + * created by Harrison on 2020/05/18 + **/ +public class EncryptTransferableClipboardHandler extends CrossClipboardHandler { + private static EncryptTransferableClipboardHandler transferableClipboardHandler; + + public static EncryptTransferableClipboardHandler getInstance() { + if (transferableClipboardHandler == null) { + transferableClipboardHandler = new EncryptTransferableClipboardHandler(); + } + return transferableClipboardHandler; + } + + public EncryptTransferableClipboardHandler() { + + super(new CrossTemplateClipBoardState(), new CrossWidgetClipBoardState()); + } + + @Override + public boolean support(Object selection) { + + return selection instanceof Transferable; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/exception/LackOfValueException.java b/designer-form/src/main/java/com/fr/design/mainframe/share/exception/LackOfValueException.java new file mode 100644 index 000000000..53d0b1258 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/exception/LackOfValueException.java @@ -0,0 +1,14 @@ +package com.fr.design.mainframe.share.exception; + +import com.fr.design.i18n.Toolkit; + +/** + * created by Harrison on 2020/04/21 + **/ +public class LackOfValueException extends RuntimeException{ + + public LackOfValueException() { + + super(Toolkit.i18nText("Fine-Design_Share_Lack_Val")); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/AbstractComponentTask.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/AbstractComponentTask.java new file mode 100644 index 000000000..0e88a5bf9 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/AbstractComponentTask.java @@ -0,0 +1,9 @@ +package com.fr.design.mainframe.share.generate; + +/** + * created by Harrison on 2020/04/23 + **/ +public abstract class AbstractComponentTask implements ComponentTask { + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentBanner.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentBanner.java new file mode 100644 index 000000000..aa812b82a --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentBanner.java @@ -0,0 +1,14 @@ +package com.fr.design.mainframe.share.generate; + +/** + * created by Harrison on 2020/04/13 + **/ +public interface ComponentBanner { + + /** + * 加载文字 + * + * @return 加载 + */ + String getLoadingText(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentCreatorProcessor.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentCreatorProcessor.java new file mode 100644 index 000000000..4d38dc98a --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentCreatorProcessor.java @@ -0,0 +1,20 @@ +package com.fr.design.mainframe.share.generate; + +import com.fr.design.mainframe.JTemplate; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.bean.ComponentReuBean; +import com.fr.form.ui.Widget; +import com.fr.stable.fun.mark.Immutable; + +import java.util.Map; + +/** + * Created by kerry on 2020-07-30 + */ +public interface ComponentCreatorProcessor extends ComponentBanner, Immutable { + + String MARK_STRING = "ComponentCreatorProcessor"; + int CURRENT_LEVEL = 1; + + ComponentReuBean create(JTemplate jt, Map paraMap, Widget widget, DefaultSharableWidget info) throws Exception; +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentGenerator.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentGenerator.java new file mode 100644 index 000000000..5728f8fee --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentGenerator.java @@ -0,0 +1,22 @@ +package com.fr.design.mainframe.share.generate; + +/** + * created by Harrison on 2020/04/16 + **/ +public interface ComponentGenerator { + + /** + * 生成组件 + * + * @return 组件 + */ + boolean generate() throws Throwable; + + /** + * 耗时/速率 + * + * @return 时间 + */ + int speed(); + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentGeneratorCenter.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentGeneratorCenter.java new file mode 100644 index 000000000..739ad2390 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentGeneratorCenter.java @@ -0,0 +1,68 @@ +package com.fr.design.mainframe.share.generate; + +import com.fr.design.mainframe.share.Bean.ComponentGenerateInfo; +import com.fr.design.mainframe.share.generate.impl.ComponentPureGenerator; +import com.fr.design.mainframe.share.generate.impl.ComponentUploadGenerator; +import com.fr.design.mainframe.share.ui.base.ShareProgressBar; +import com.fr.log.FineLoggerFactory; + +import java.util.concurrent.Future; + +/** + * created by Harrison on 2020/04/13 + **/ +public class ComponentGeneratorCenter { + + private ComponentGenerateInfo info; + + public ComponentGeneratorCenter(ComponentGenerateInfo info) { + + this.info = info; + } + + public boolean generate() throws Exception { + + try { + + return generate0(); + } catch (RuntimeException e) { + throw e; + } catch (Throwable throwable) { + FineLoggerFactory.getLogger().error(throwable.getMessage(), throwable); + return false; + } finally { + ShareProgressBar.getInstance().completeNow(); + } + } + + private boolean generate0() throws Throwable{ + + ComponentGenerator generator = innerGenerator(); + + //ui + ShareProgressBar progressBar = ShareProgressBar.getInstance(); + progressBar.prepare(generator.speed()); + progressBar.monitor(); + + return generator.generate(); + } + + private void waitComplete(Future complete) { + + try { + complete.get(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + private ComponentGenerator innerGenerator() { + + if (info.isAutoUpload()) { + return ComponentUploadGenerator.create(info); + } else { + return ComponentPureGenerator.create(info); + } + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentTask.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentTask.java new file mode 100644 index 000000000..3fb8521f7 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentTask.java @@ -0,0 +1,13 @@ +package com.fr.design.mainframe.share.generate; + +/** + * created by Harrison on 2020/04/23 + **/ +public interface ComponentTask { + + T execute() throws Exception; + + double indicator(); + + String getLoadingText(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentTaskAdaptor.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentTaskAdaptor.java new file mode 100644 index 000000000..16b8f9774 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/ComponentTaskAdaptor.java @@ -0,0 +1,26 @@ +package com.fr.design.mainframe.share.generate; + +/** + * created by Harrison on 2020/04/23 + **/ +public abstract class ComponentTaskAdaptor extends AbstractComponentTask { + + private double indicator; + + private String loadingText; + + public ComponentTaskAdaptor(double indicator, String loadingText) { + this.indicator = indicator; + this.loadingText = loadingText; + } + + @Override + public double indicator() { + return this.indicator; + } + + @Override + public String getLoadingText() { + return this.loadingText; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/AbstractComponentCreatorProcessor.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/AbstractComponentCreatorProcessor.java new file mode 100644 index 000000000..e0d17bfed --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/AbstractComponentCreatorProcessor.java @@ -0,0 +1,24 @@ +package com.fr.design.mainframe.share.generate.impl; + +import com.fr.design.mainframe.share.generate.ComponentCreatorProcessor; +import com.fr.stable.fun.mark.API; + +/** + * Created by kerry on 2020-07-30 + */ +@API(level = ComponentCreatorProcessor.CURRENT_LEVEL) +public abstract class AbstractComponentCreatorProcessor implements ComponentCreatorProcessor { + + + @Override + public int currentAPILevel() { + return CURRENT_LEVEL; + } + + @Override + public int layerIndex() { + return DEFAULT_LAYER_INDEX; + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/AbstractComponentGenerator.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/AbstractComponentGenerator.java new file mode 100644 index 000000000..6fb514117 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/AbstractComponentGenerator.java @@ -0,0 +1,161 @@ +package com.fr.design.mainframe.share.generate.impl; + +import com.fr.design.mainframe.share.Bean.ComponentGenerateInfo; +import com.fr.design.mainframe.share.generate.ComponentBanner; +import com.fr.design.mainframe.share.generate.ComponentCreatorProcessor; +import com.fr.design.mainframe.share.generate.ComponentGenerator; +import com.fr.design.mainframe.share.generate.ComponentTask; +import com.fr.design.mainframe.share.generate.task.ComponentCreator; +import com.fr.design.mainframe.share.ui.base.ShareProgressBar; +import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.report.ExtraReportClassManager; +import com.fr.third.org.apache.commons.lang3.time.StopWatch; + +import javax.swing.SwingWorker; +import java.util.concurrent.BrokenBarrierException; +import java.util.concurrent.Callable; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; +import java.util.concurrent.TimeUnit; + +/** + * created by Harrison on 2020/04/16 + **/ +public abstract class AbstractComponentGenerator implements ComponentGenerator { + + /** + * 默认 40 ms + */ + private static final int DEFAULT_SPEED = 40; + + /** + * 进度 100 + */ + private static final int PROGRESS = 100; + + /** + * 每一个任务平均耗时 2000 ms + */ + private static final int PER_TIME = 2000; + + private final int speed; + + private ComponentGenerateInfo info; + + public AbstractComponentGenerator(ComponentGenerateInfo info, ComponentBanner... banners) { + this.info = info; + this.speed = calSpeed(banners); + } + + public ComponentGenerateInfo getInfo() { + return info; + } + + private int calSpeed(ComponentBanner... banners) { + + if (banners == null || banners.length == 0) { + return DEFAULT_SPEED; + } + return PER_TIME / (PROGRESS / banners.length); + } + + /** + * 进度条 100 + * 目前有 n 个任务 + * 每个任务至少 2000 ms + *

      + * 则平均速度为 2000 / (100/n) + */ + @Override + public int speed() { + + return this.speed; + } + + @Override + public boolean generate() throws Throwable { + + try { + return generate0(); + } catch (ExecutionException e) { + //抛出根本原因 + throw e.getCause(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return false; + } + } + + protected abstract boolean generate0() throws InterruptedException, ExecutionException; + + protected T execute(final ComponentTask componentTask) throws InterruptedException, ExecutionException { + + final CyclicBarrier barrier = new CyclicBarrier(2); + Thread UIThread = new Thread(new FutureTask(new Callable() { + @Override + public Void call() throws Exception { + SwingWorker worker = new SwingWorker() { + @Override + protected Void doInBackground() throws Exception { + + StopWatch stopWatch = new StopWatch(); + stopWatch.start(); + + //ui更新 + doUIUpdate(); + + stopWatch.stop(); + long time = stopWatch.getTime(TimeUnit.MILLISECONDS); + if (time < 2000L) { + //不到 2 s + ShareUIUtils.wait((int) (2000L - time)); + } + + //完成更新 + finishUpdate(); + return null; + } + + private int finishUpdate() throws InterruptedException, BrokenBarrierException { + return barrier.await(); + } + + private void doUIUpdate() throws Exception { + ShareProgressBar.getInstance().updateProgress(componentTask.indicator(), componentTask.getLoadingText()); + } + }; + worker.execute(); + return null; + } + })); + UIThread.setName("Component-UIThread"); + + FutureTask task = new FutureTask<>(new Callable() { + @Override + public T call() throws Exception { + T result = componentTask.execute(); + barrier.await(); + return result; + } + }); + Thread workThread = new Thread(task); + workThread.setName("Component-WorkThread"); + parallel(UIThread, workThread); + return task.get(); + } + + private void parallel(Thread UIThread, Thread workThread) { + + UIThread.start(); + workThread.start(); + } + + + public static ComponentCreatorProcessor getComponentCreator(){ + ComponentCreatorProcessor processor = ExtraReportClassManager.getInstance().getSingle(ComponentCreatorProcessor.MARK_STRING, ComponentCreator.class); + return processor; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/ComponentPureGenerator.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/ComponentPureGenerator.java new file mode 100644 index 000000000..d03f55240 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/ComponentPureGenerator.java @@ -0,0 +1,57 @@ +package com.fr.design.mainframe.share.generate.impl; + +import com.fr.design.mainframe.share.Bean.ComponentGenerateInfo; +import com.fr.design.mainframe.share.generate.ComponentCreatorProcessor; +import com.fr.design.mainframe.share.generate.ComponentTaskAdaptor; +import com.fr.design.mainframe.share.generate.task.ComponentGenerateComplete; +import com.fr.form.share.bean.ComponentReuBean; + +import java.util.concurrent.ExecutionException; + +/** + * created by Harrison on 2020/04/16 + **/ +public class ComponentPureGenerator extends AbstractComponentGenerator { + + private ComponentCreatorProcessor creator; + + private ComponentGenerateComplete complete; + + private ComponentPureGenerator(ComponentGenerateInfo info, ComponentCreatorProcessor creator, ComponentGenerateComplete complete) { + + super(info, creator, complete); + this.creator = creator; + this.complete = complete; + } + + public static ComponentPureGenerator create(ComponentGenerateInfo info) { + + ComponentCreatorProcessor creator = getComponentCreator(); + ComponentGenerateComplete complete = new ComponentGenerateComplete(); + return new ComponentPureGenerator(info, creator, complete); + } + + @Override + protected boolean generate0() throws InterruptedException, ExecutionException { + + final ComponentGenerateInfo info = getInfo(); + ComponentTaskAdaptor createTest = new ComponentTaskAdaptor(1.0, creator.getLoadingText()) { + @Override + public ComponentReuBean execute() throws Exception { + return creator.create(info.getJt(), info.getParaMap(), info.getWidget(), info.getInfo()); + } + }; + ComponentReuBean bean = execute(createTest); + + ComponentTaskAdaptor completeTask = new ComponentTaskAdaptor(1.0, complete.getLoadingText()) { + @Override + public Void execute() throws Exception { + complete.execute(); + return null; + } + }; + Void result = execute(completeTask); + return true; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/ComponentUploadGenerator.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/ComponentUploadGenerator.java new file mode 100644 index 000000000..58084c344 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/impl/ComponentUploadGenerator.java @@ -0,0 +1,99 @@ +package com.fr.design.mainframe.share.generate.impl; + +import com.fr.design.mainframe.share.Bean.ComponentGenerateInfo; +import com.fr.design.mainframe.share.generate.ComponentCreatorProcessor; +import com.fr.design.mainframe.share.generate.ComponentTaskAdaptor; +import com.fr.design.mainframe.share.generate.task.ComponentDesensitize; +import com.fr.design.mainframe.share.generate.task.ComponentEncrypt; +import com.fr.design.mainframe.share.generate.task.ComponentUploadComplete; +import com.fr.design.mainframe.share.generate.task.ComponentUploader; +import com.fr.form.share.bean.ComponentReuBean; + +import java.util.concurrent.ExecutionException; + +/** + * created by Harrison on 2020/04/16 + **/ +public class ComponentUploadGenerator extends AbstractComponentGenerator { + + private ComponentCreatorProcessor creator; + + private ComponentEncrypt encrypt; + + private ComponentDesensitize desensitize; + + private ComponentUploader uploader; + + private ComponentUploadComplete complete; + + private ComponentUploadGenerator(ComponentGenerateInfo info, ComponentCreatorProcessor creator, ComponentEncrypt encrypt, ComponentDesensitize desensitize, ComponentUploader uploader, ComponentUploadComplete complete) { + + super(info, creator, desensitize, encrypt, uploader); + this.creator = creator; + this.encrypt = encrypt; + this.desensitize = desensitize; + this.uploader = uploader; + this.complete = complete; + } + + public static ComponentUploadGenerator create(ComponentGenerateInfo info) { + + ComponentCreatorProcessor creator = getComponentCreator(); + ComponentUploader uploader = new ComponentUploader(); + ComponentEncrypt encrypt = new ComponentEncrypt(); + ComponentDesensitize desensitize = new ComponentDesensitize(); + ComponentUploadComplete complete = new ComponentUploadComplete(); + return new ComponentUploadGenerator(info, creator, encrypt, desensitize, uploader, complete); + } + + @Override + protected boolean generate0() throws InterruptedException, ExecutionException { + final ComponentGenerateInfo info = getInfo(); + //创建 + ComponentTaskAdaptor createTask = new ComponentTaskAdaptor(0.20, creator.getLoadingText()) { + @Override + public ComponentReuBean execute() throws Exception { + return creator.create(info.getJt(), info.getParaMap(), info.getWidget(), info.getInfo()); + } + }; + final ComponentReuBean plainBean = execute(createTask); + + //脱敏 + ComponentTaskAdaptor desensitizeTask = new ComponentTaskAdaptor(0.60, desensitize.getLoadingText()) { + @Override + public Object execute() throws Exception { + desensitize.execute(); + return null; + } + }; + execute(desensitizeTask); + + //加密 + ComponentTaskAdaptor encryptTask = new ComponentTaskAdaptor(0.85, encrypt.getLoadingText()) { + @Override + public ComponentReuBean execute() throws Exception { + return encrypt.execute(plainBean); + } + }; + final ComponentReuBean encryptBean = execute(encryptTask); + + //上传 + ComponentTaskAdaptor uploadTask = new ComponentTaskAdaptor(1.0, uploader.getLoadingText()) { + @Override + public Boolean execute() throws Exception { + return uploader.upload(encryptBean.getPath()); + } + }; + Boolean success = execute(uploadTask); + + //完成 + final ComponentTaskAdaptor completeTask = new ComponentTaskAdaptor(1.0, complete.getLoadingText()) { + @Override + public Boolean execute() throws Exception { + return complete.execute(); + } + }; + return success && execute(completeTask); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java new file mode 100644 index 000000000..62570e513 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentCreator.java @@ -0,0 +1,122 @@ +package com.fr.design.mainframe.share.generate.task; + +import com.fr.base.TableData; +import com.fr.base.iofile.attr.ExtendSharableAttrMark; +import com.fr.base.iofile.attr.SharableAttrMark; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.share.generate.impl.AbstractComponentCreatorProcessor; +import com.fr.form.main.Form; +import com.fr.form.main.WidgetGatherAdapter; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.ShareEmbeddedConverter; +import com.fr.form.share.bean.ComponentReuBean; +import com.fr.form.share.editor.DefaultSharableEditor; +import com.fr.form.share.editor.PlainSharableEditor; +import com.fr.form.share.utils.ShareUtils; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.Widget; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.fun.IOFileAttrMark; +import com.fr.workspace.WorkContext; +import org.jetbrains.annotations.NotNull; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +/** + * created by Harrison on 2020/04/13 + **/ +public class ComponentCreator extends AbstractComponentCreatorProcessor { + + /** + * 生成组件 + * 返回组件的路径 + * + * @return 路径 + */ + @Override + public ComponentReuBean create(JTemplate jt, Map paraMap, Widget widget, DefaultSharableWidget info) throws Exception { + + + // 遍历判断是否存在共享组件 + checkOriginStatus(widget, info); + + // 导出内置数据集 + Form form = embeddedForm(jt, paraMap); + + // 创建组件 + DefaultSharableEditor editor = createSharableEditor(form, paraMap, widget, info); + + // 生成组件 + String generatePath = generate(editor, info); + + + return new ComponentReuBean(generatePath, editor, info); + } + + protected void checkOriginStatus(Widget widget, final DefaultSharableWidget info) { + + Form.traversalWidget(widget, new WidgetGatherAdapter() { + @Override + public void dealWith(Widget widget) { + + AbstractBorderStyleWidget borderStyleWidget = (AbstractBorderStyleWidget) widget; + IOFileAttrMark attrMark = borderStyleWidget.getWidgetAttrMark(SharableAttrMark.XML_TAG); + if (attrMark != null) { + info.setTransform(); + } + } + }, AbstractBorderStyleWidget.class); + } + + @Override + public String getLoadingText() { + + return Toolkit.i18nText("Fine-Design_Share_Generate_Ing"); + } + + /** + * 内置数据集处理 + * + * @return 返回 + */ + protected Form embeddedForm(JTemplate jt, Map paraMap) throws Exception { + + jt.stopEditing(); + + Form tpl = null; + try { + tpl = (Form) jt.getTarget().clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + + //内置数据集 + if (tpl != null) { + ShareEmbeddedConverter embeddedConverter = WorkContext.getCurrent().get(ShareEmbeddedConverter.class); + Map map = embeddedConverter.convertToEmbeddedTableData(tpl, paraMap); + Iterator> iterator = map.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + tpl.putTableData(entry.getKey(), entry.getValue()); + } + } + return tpl; + } + + @NotNull + protected DefaultSharableEditor createSharableEditor(Form form, Map paraMap, Widget widget, DefaultSharableWidget info) { + + String uuid = info.getId(); + ((AbstractBorderStyleWidget) widget).addWidgetAttrMark(new SharableAttrMark()); + ((AbstractBorderStyleWidget) widget).addWidgetAttrMark(new ExtendSharableAttrMark(uuid)); + return new PlainSharableEditor(uuid, widget, form, (HashMap) paraMap); + } + + protected String generate(Widget editor, DefaultSharableWidget info) throws Exception { + + return ShareUtils.generateModule(editor, info); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentDesensitize.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentDesensitize.java new file mode 100644 index 000000000..5c12877ee --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentDesensitize.java @@ -0,0 +1,44 @@ +package com.fr.design.mainframe.share.generate.task; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.generate.ComponentBanner; +import com.fr.form.share.exception.NetWorkFailedException; +import com.fr.general.http.HttpRequest; +import com.fr.general.http.HttpToolbox; +import com.fr.log.FineLoggerFactory; +import com.fr.third.org.apache.http.HttpStatus; +import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; + +/** + * created by Harrison on 2020/04/22 + **/ +public class ComponentDesensitize implements ComponentBanner { + + private static final String TEST_URL = "http://www.baidu.com"; + + public void execute() { + + if (!testNet()) { + throw new NetWorkFailedException(); + } + } + + private boolean testNet() { + + try { + HttpRequest httpRequest = HttpRequest.custom().url(TEST_URL).build(); + CloseableHttpResponse response = HttpToolbox.execute(httpRequest); + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + return true; + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return false; + } + + @Override + public String getLoadingText() { + return Toolkit.i18nText("Fine-Design_Share_Desensitize"); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentEncrypt.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentEncrypt.java new file mode 100644 index 000000000..b0cd6ef57 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentEncrypt.java @@ -0,0 +1,28 @@ +package com.fr.design.mainframe.share.generate.task; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.generate.ComponentBanner; +import com.fr.form.share.bean.ComponentReuBean; +import com.fr.workspace.WorkContext; + +/** + * created by Harrison on 2020/04/22 + **/ +public class ComponentEncrypt implements ComponentBanner { + + public ComponentReuBean execute(ComponentReuBean bean) throws Exception { + + try { + return bean; + } catch (Exception e) { + String path = bean.getPath(); + WorkContext.getWorkResource().delete(path); + throw e; + } + } + + @Override + public String getLoadingText() { + return Toolkit.i18nText("Fine-Design_Share_Encrypt"); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentGenerateComplete.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentGenerateComplete.java new file mode 100644 index 000000000..47909b849 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentGenerateComplete.java @@ -0,0 +1,19 @@ +package com.fr.design.mainframe.share.generate.task; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.generate.ComponentBanner; + +/** + * created by Harrison on 2020/04/13 + **/ +public class ComponentGenerateComplete implements ComponentBanner { + + public void execute() throws InterruptedException { + } + + @Override + public String getLoadingText() { + + return Toolkit.i18nText("Fine-Design_Share_Generate_Success"); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentUploadComplete.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentUploadComplete.java new file mode 100644 index 000000000..289e2074c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentUploadComplete.java @@ -0,0 +1,19 @@ +package com.fr.design.mainframe.share.generate.task; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.share.generate.ComponentBanner; + +/** + * created by Harrison on 2020/06/16 + **/ +public class ComponentUploadComplete implements ComponentBanner { + + public boolean execute() throws InterruptedException { + return true; + } + + @Override + public String getLoadingText() { + return Toolkit.i18nText("Fine-Design_Share_Upload_Success"); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentUploader.java b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentUploader.java new file mode 100644 index 000000000..ef74d3420 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/generate/task/ComponentUploader.java @@ -0,0 +1,153 @@ +package com.fr.design.mainframe.share.generate.task; + +import com.fr.config.MarketConfig; +import com.fr.design.i18n.Toolkit; +import com.fr.form.share.config.ComponentReuseConfigManager; +import com.fr.design.mainframe.share.generate.ComponentBanner; +import com.fr.io.utils.ResourceIOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.third.org.apache.http.HttpEntity; +import com.fr.third.org.apache.http.HttpStatus; +import com.fr.third.org.apache.http.client.config.CookieSpecs; +import com.fr.third.org.apache.http.client.config.RequestConfig; +import com.fr.third.org.apache.http.client.entity.UrlEncodedFormEntity; +import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; +import com.fr.third.org.apache.http.client.methods.HttpPost; +import com.fr.third.org.apache.http.conn.ssl.NoopHostnameVerifier; +import com.fr.third.org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import com.fr.third.org.apache.http.entity.mime.HttpMultipartMode; +import com.fr.third.org.apache.http.entity.mime.MultipartEntityBuilder; +import com.fr.third.org.apache.http.entity.mime.content.ByteArrayBody; +import com.fr.third.org.apache.http.impl.client.BasicCookieStore; +import com.fr.third.org.apache.http.impl.client.CloseableHttpClient; +import com.fr.third.org.apache.http.impl.client.HttpClients; +import com.fr.third.org.apache.http.message.BasicNameValuePair; +import com.fr.third.org.apache.http.ssl.SSLContextBuilder; +import com.fr.third.org.apache.http.ssl.TrustStrategy; +import com.fr.workspace.WorkContext; +import org.jetbrains.annotations.NotNull; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; + +/** + * 组件上传 + *

      + * created by Harrison on 2020/04/13 + **/ +public class ComponentUploader implements ComponentBanner { + + //private static final String MARKET_LOGIN = CloudCenter.getInstance().acquireUrlByKind("market.login", "https://market.fanruan.com/ShopServer?pg=login&_=1590635085629"); + //private static final String MARKET_REU_FILE_UPLOAD = CloudCenter.getInstance().acquireUrlByKind("market.reuses.upload", "https://market.fanruan.com/reuses/upload"); + + /** + * 先用临时的。 暂时不上线 + */ + private static final String URL_MARKET_LOGIN = ComponentReuseConfigManager.getInstance().getMarketLoginUrl(); + private static final String URL_MARKET_REU_FILE_UPLOAD = ComponentReuseConfigManager.getInstance().getComponentUploadUrl(); + + private static final String KEY_USERNAME = "username"; + private static final String KEY_PASSWORD = "password"; + private static final String KEY_FILE = "file"; + + public boolean upload(String path) { + + boolean success = false; + try { + success = upload0(path); + } catch (Exception e) { + WorkContext.getWorkResource().delete(path); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return success; + } + + @Override + public String getLoadingText() { + + return Toolkit.i18nText("Fine-Design_Share_Encrypt"); + } + + private boolean upload0(String path) throws Exception { + + CloseableHttpClient client = createClient(); + if (login(client)) { + HttpPost uploadRequest = new HttpPost(URL_MARKET_REU_FILE_UPLOAD); + byte[] bytes = WorkContext.getWorkResource().readFully(path); + String fileName = ResourceIOUtils.getName(path); + HttpEntity reqEntity = MultipartEntityBuilder.create() + .setCharset(StandardCharsets.UTF_8) + .setMode(HttpMultipartMode.BROWSER_COMPATIBLE) + // 相当于 + .addPart(KEY_FILE, new ByteArrayBody(bytes, fileName)) + .build(); + uploadRequest.setEntity(reqEntity); + + // 发起请求 并返回请求的响应 + CloseableHttpResponse uploadResponse = client.execute(uploadRequest); + FineLoggerFactory.getLogger().info(uploadResponse.toString()); + return uploadResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK; + } + return false; + } + + private boolean login(CloseableHttpClient client) throws IOException { + + String bbsUsername = MarketConfig.getInstance().getBbsUsername(); + String bbsPassword = MarketConfig.getInstance().getBbsPassword(); + List pairs = new ArrayList<>(); + pairs.add(new BasicNameValuePair(KEY_USERNAME, bbsUsername)); + pairs.add(new BasicNameValuePair(KEY_PASSWORD, bbsPassword)); + + HttpPost login = new HttpPost(URL_MARKET_LOGIN); + login.setEntity(new UrlEncodedFormEntity(pairs, StandardCharsets.UTF_8)); + login.addHeader("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"); + login.addHeader("Connection", "keep-alive"); + CloseableHttpResponse loginResponse = client.execute(login); + FineLoggerFactory.getLogger().info(loginResponse.toString()); + return loginResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK; + } + + private static CloseableHttpClient createClient() throws Exception { + + SSLConnectionSocketFactory connectionFactory = createSSL(); + + BasicCookieStore cookieStore = new BasicCookieStore(); + return HttpClients.custom() + .setDefaultRequestConfig(RequestConfig.custom() + .setCookieSpec(CookieSpecs.STANDARD) + .setSocketTimeout(2000) + .setConnectTimeout(5000) + .setConnectionRequestTimeout(5000) + .setAuthenticationEnabled(false) + .build()) + .setDefaultCookieStore(cookieStore) + .setSSLSocketFactory(connectionFactory) + .build(); + } + + @NotNull + private static SSLConnectionSocketFactory createSSL() throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException { + SSLContext sslContext = SSLContextBuilder + .create() + .loadTrustMaterial(new TrustStrategy() { + @Override + public boolean isTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + return true; + } + }) + .build(); + HostnameVerifier allowAllHosts = new NoopHostnameVerifier(); + return new SSLConnectionSocketFactory(sslContext, allowAllHosts); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/BaseGroupDialog.java b/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/BaseGroupDialog.java new file mode 100644 index 000000000..e9d5d490b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/BaseGroupDialog.java @@ -0,0 +1,59 @@ +package com.fr.design.mainframe.share.group.ui; + +import com.fr.base.BaseUtils; +import com.fr.design.dialog.UIDialog; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.i18n.Toolkit; +import com.fr.design.utils.gui.GUICoreUtils; + +import javax.swing.JDialog; +import java.awt.Dimension; +import java.awt.Frame; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/9 + */ +abstract public class BaseGroupDialog extends UIDialog { + public BaseGroupDialog(Frame parent) { + super(parent); + } + + protected UIButton createConfirmButton() { + UIButton confirmButton; + + confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); + confirmButton.setPreferredSize(new Dimension(60, 25)); + confirmButton.setEnabled(false); + confirmButton.addActionListener(e -> confirmClose()); + return confirmButton; + } + + protected UIButton createCancelButton() { + UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); + cancelButton.setPreferredSize(new Dimension(60, 25)); + + cancelButton.addActionListener(e -> dispose()); + return cancelButton; + } + + /** + * 点击确定后的处理方法 + */ + abstract protected void confirmClose(); + + protected void initStyle() { + this.setSize(340, 180); + this.setResizable(false); + this.setAlwaysOnTop(true); + this.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); + this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + GUICoreUtils.centerWindow(this); + this.setVisible(true); + } + + @Override + public void checkValid() throws Exception { + // do nothing + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/GroupFileDialog.java b/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/GroupFileDialog.java new file mode 100644 index 000000000..f4b79944e --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/GroupFileDialog.java @@ -0,0 +1,173 @@ +package com.fr.design.mainframe.share.group.ui; + +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +/** + * @Author: Yuan.Wang + * @Date: 2020/10/29 + */ +abstract public class GroupFileDialog extends BaseGroupDialog { + + private UITextField nameField; + + private UILabel warnLabel; + + private final UIButton confirmButton; + + public GroupFileDialog(Frame frame, String title) { + this(frame, title, StringUtils.EMPTY); + + } + + public GroupFileDialog(Frame frame, String title, String defaultName) { + super(frame); + this.setLayout(new BorderLayout()); + this.setModal(true); + + setTitle(title); + // 标签 + UILabel newNameLabel = creteNewNameLabel(); + // 输入框 + createNameField(defaultName); + // 重名提示 + createWarnLabel(); + // 确认按钮 + confirmButton = createConfirmButton(); + // 取消按钮 + UIButton cancelButton = createCancelButton(); + + JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); + topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15)); + topPanel.add(newNameLabel); + topPanel.add(nameField); + + JPanel midPanel = new JPanel(new BorderLayout()); + midPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15)); + midPanel.add(warnLabel, BorderLayout.WEST); + + JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15)); + bottomPanel.add(confirmButton); + bottomPanel.add(cancelButton); + + this.add( + TableLayoutHelper.createTableLayoutPane( + new Component[][]{ + new Component[]{topPanel}, + new Component[]{midPanel}, + new Component[]{bottomPanel} + }, + new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, + new double[]{TableLayout.FILL} + ), BorderLayout.CENTER); + initStyle(); + } + + protected String getFileName() { + return nameField.getText().trim(); + } + + protected void validInput() { + //抽成模板方法 + String userInput = getFileName(); + + if (StringUtils.isEmpty(userInput)) { + confirmButton.setEnabled(false); + return; + } + String name = nameField.getText().trim(); + + if (isDuplicate(name)) { + nameField.selectAll(); + // 如果文件名已存在,则灰掉确认按钮 + warnLabel.setText(Toolkit.i18nText("Fine-Design_Share_Group_Repeat_Name_Info")); + warnLabel.setVisible(true); + confirmButton.setEnabled(false); + } else { + warnLabel.setVisible(false); + confirmButton.setEnabled(true); + } + } + + /** + * 点击确定后的处理方法 + */ + abstract protected void confirmClose(); + + /** + * 是否重名 + */ + abstract protected boolean isDuplicate(String fileName); + + + private UILabel creteNewNameLabel() { + // 输入框前提示 + UILabel newNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Group_Enter_New_Folder_Name")); + newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); + newNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); + newNameLabel.setPreferredSize(new Dimension(84, 16)); + return newNameLabel; + } + + private void createNameField(String name) { + // 文件名输入框 + nameField = new UITextField(name); + nameField.getDocument().addDocumentListener(new DocumentListener() { + + public void changedUpdate(DocumentEvent e) { + validInput(); + } + + public void insertUpdate(DocumentEvent e) { + validInput(); + } + + public void removeUpdate(DocumentEvent e) { + validInput(); + } + }); + nameField.selectAll(); + nameField.setPreferredSize(new Dimension(200, 20)); + // 增加enter以及esc快捷键的支持 + nameField.addKeyListener(new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { + dispose(); + } else if (e.getKeyCode() == KeyEvent.VK_ENTER) { + if (confirmButton.isEnabled()) { + confirmClose(); + } + } + } + }); + } + + private void createWarnLabel() { + warnLabel = new UILabel(); + warnLabel.setPreferredSize(new Dimension(300, 30)); + warnLabel.setHorizontalAlignment(SwingConstants.LEFT); + warnLabel.setForeground(Color.RED); + warnLabel.setVisible(false); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/GroupMoveDialog.java b/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/GroupMoveDialog.java new file mode 100644 index 000000000..c39f195a0 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/group/ui/GroupMoveDialog.java @@ -0,0 +1,79 @@ +package com.fr.design.mainframe.share.group.ui; + +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.form.share.group.DefaultShareGroupManager; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Frame; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/9 + */ +abstract public class GroupMoveDialog extends BaseGroupDialog { + private UIComboBox selectGroupBox; + + public GroupMoveDialog(Frame frame) { + super(frame); + this.setLayout(new BorderLayout()); + this.setModal(true); + + setTitle(Toolkit.i18nText("Fine-Design_Share_Group_Move")); + // 标签 + UILabel newNameLabel = creteNewNameLabel(); + // 输入框 + createSwitchGroupBox(); + + // 确认按钮 + UIButton confirmButton = createConfirmButton(); + confirmButton.setEnabled(true); + // 取消按钮 + UIButton cancelButton = createCancelButton(); + + JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); + topPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 0, 15)); + topPanel.add(newNameLabel); + topPanel.add(selectGroupBox); + + JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 15)); + bottomPanel.setPreferredSize(new Dimension(340, 45)); + bottomPanel.add(confirmButton); + bottomPanel.add(cancelButton); + this.add(topPanel, BorderLayout.CENTER); + this.add(bottomPanel, BorderLayout.SOUTH); + + initStyle(); + + + } + + private void createSwitchGroupBox() { + // 文件名输入框 + selectGroupBox = new UIComboBox(DefaultShareGroupManager.getInstance().getAllGroup()); + selectGroupBox.setPreferredSize(new Dimension(225, 20)); + } + + + private UILabel creteNewNameLabel() { + // 输入框前提示 + UILabel newNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Group_Select")); + newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); + newNameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); + newNameLabel.setPreferredSize(new Dimension(60, 16)); + return newNameLabel; + } + + protected UIComboBox getSelectGroupBox() { + return selectGroupBox; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformer.java b/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformer.java new file mode 100644 index 000000000..de61f29d2 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformer.java @@ -0,0 +1,25 @@ +package com.fr.design.mainframe.share.select; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.FormSelection; +import com.fr.form.ui.Widget; +import com.fr.third.org.apache.commons.lang3.tuple.Triple; + +import java.awt.Rectangle; + +/** + * 组件选择器 + *

      + * created by Harrison on 2020/06/11 + **/ +public interface ComponentTransformer { + + /** + * 获取选择到组件 + * + * @return 组件相关信息 + */ + Triple transform(FormSelection selection); + +} + diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformerFactory.java b/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformerFactory.java new file mode 100644 index 000000000..bf9e6ea61 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformerFactory.java @@ -0,0 +1,53 @@ +package com.fr.design.mainframe.share.select; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.FormSelection; +import com.fr.form.ui.Widget; +import com.fr.stable.AssistUtils; +import com.fr.third.org.apache.commons.lang3.tuple.Triple; +import org.jetbrains.annotations.Nullable; + +import java.awt.Rectangle; + +/** + * created by Harrison on 2020/06/11 + **/ +public class ComponentTransformerFactory { + + private TransformerKey lastKey; + private Triple lastCache; + + private ComponentTransformer transformer = new ComponentTransformerImpl(); + + private static class InstanceHolder { + + private static ComponentTransformerFactory INSTANCE = new ComponentTransformerFactory(); + } + + public static ComponentTransformerFactory getInstance() { + + return InstanceHolder.INSTANCE; + } + + @Nullable + public Triple transform(FormSelection selection) { + + if (selection == null) { + return null; + } + TransformerKey transformerKey = new TransformerKey(selection); + if (AssistUtils.equals(lastKey, transformerKey)) { + return lastCache; + } + Triple triple = transformer.transform(selection); + //缓存一下。 + cache(transformerKey, triple); + return triple; + } + + private void cache(TransformerKey transformerKey, Triple triple) { + + this.lastKey = transformerKey; + this.lastCache = triple; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformerImpl.java b/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformerImpl.java new file mode 100644 index 000000000..af8612608 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/select/ComponentTransformerImpl.java @@ -0,0 +1,156 @@ +package com.fr.design.mainframe.share.select; + +import com.fr.base.FRContext; +import com.fr.design.designer.beans.adapters.component.CompositeComponentAdapter; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWAbsoluteLayout; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.mainframe.FormSelection; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.form.main.Form; +import com.fr.form.share.bean.ShareLayoutWidget; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WAbsoluteBodyLayout; +import com.fr.form.ui.container.WAbsoluteLayout; +import com.fr.form.ui.container.WBorderLayout; +import com.fr.form.ui.container.WFitLayout; +import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.container.WParameterLayout; +import com.fr.form.ui.widget.CRBoundsWidget; +import com.fr.general.Inter; +import com.fr.log.FineLoggerFactory; +import com.fr.third.org.apache.commons.lang3.tuple.ImmutableTriple; +import com.fr.third.org.apache.commons.lang3.tuple.Triple; +import com.fr.web.FormCompVisibleUtils; +import org.jetbrains.annotations.Nullable; + +import java.awt.Dimension; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.util.Comparator; +import java.util.Map; +import java.util.TreeMap; + +/** + * created by Harrison on 2020/06/11 + **/ +public class ComponentTransformerImpl implements ComponentTransformer { + + @Override + @Nullable + public Triple transform(FormSelection selection) { + + XCreator selectedCreator; + Widget selectedWidget; + if (selection == null) { + return null; + } + Rectangle selectionBounds = selection.getSelctionBounds(); + Rectangle selectedTriple = new Rectangle(0, 0, selectionBounds.width, selectionBounds.height); + XCreator[] xCreators = selection.getSelectedCreators(); + if (xCreators.length == 1) { + selectedCreator = xCreators[0]; + selectedWidget = selectedCreator.toData(); + } else { + + WAbsoluteLayout wAbsoluteLayout = new WAbsoluteLayout("absolute"); + wAbsoluteLayout.setCompState(WAbsoluteLayout.STATE_FIT); + Map widgetMap = new TreeMap<>( + new Comparator() { + @Override + public int compare(Integer o1, Integer o2) { + return o2.compareTo(o1); + } + } + ); + //控件上下层关系需要继承下来 + for (XCreator xCreator : xCreators) { + XLayoutContainer container = (XLayoutContainer) xCreator.getParent(); + int i = container.getComponentZOrder(xCreator); + widgetMap.put(i, xCreator.toData()); + } + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + Form form = (Form) jt.getTarget(); + for (Widget innerWidget : widgetMap.values()) { + WLayout parentWLayout = getParentLayout(form, innerWidget); + if (parentWLayout == null){ + continue; + } + try { + CRBoundsWidget boundsWidget = (CRBoundsWidget) parentWLayout.getBoundsWidget(innerWidget).clone(); + adaptBounds(boundsWidget, selectionBounds); + wAbsoluteLayout.addWidget(boundsWidget); + } catch (CloneNotSupportedException e1) { + FRContext.getLogger().error(e1.getMessage(), e1); + } + } + wAbsoluteLayout.setDesigningResolution(Toolkit.getDefaultToolkit().getScreenSize()); + + selectedCreator = new XWAbsoluteLayout(wAbsoluteLayout, new Dimension(selectedTriple.width, selectedTriple.height)); + selectedWidget = selectedCreator.toData(); + + //将选中的类型初始化一下。 + CompositeComponentAdapter adapter = new CompositeComponentAdapter(WidgetPropertyPane.getInstance().getEditingFormDesigner(), selectedCreator); + adapter.initialize(); + //并且初始化一次。缓存一下值。 + selectedCreator.repaint(); + } + try { + if (!supportShared(selectedWidget)) { + return null; + } + if (!(selectedWidget instanceof AbstractBorderStyleWidget)) { + selectedWidget = new ShareLayoutWidget(selectedWidget); + } + selectedWidget = (Widget) selectedWidget.clone(); + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + FineJOptionPane.showMessageDialog(null, Inter.getLocText("Fine-Design_Share_Module_Failed")); + } + return new ImmutableTriple<>(selectedWidget, selectedCreator, selectedTriple); + } + + //先从body中找,如果找不到再从参数面板中找 + @Nullable + private WLayout getParentLayout(Form form, Widget innerWidget) { + WLayout bodyLayout = (WLayout) ((WBorderLayout) form.getContainer()).getLayoutWidget(WBorderLayout.CENTER); + WLayout paraLayout = (WLayout) ((WBorderLayout) form.getContainer()).getLayoutWidget(WBorderLayout.NORTH); + WLayout parentLayout = FormCompVisibleUtils.findFitLayout(bodyLayout, innerWidget); + if (parentLayout == null && paraLayout != null) { + parentLayout = FormCompVisibleUtils.findFitLayout(paraLayout, innerWidget); + } + return parentLayout; + } + + //组件集合产生绝对布局的时候,子组件的bounds需要去掉主框架的xy值,保证边界和绝对布局对齐 + private static void adaptBounds(CRBoundsWidget cRBoundsWidget, Rectangle delRec) { + Rectangle rec = cRBoundsWidget.getBounds(); + int originX = rec.x; + int originY = rec.y; + int delX = delRec.x; + int delY = delRec.y; + cRBoundsWidget.setBounds(new Rectangle(originX - delX, originY - delY, rec.width, rec.height)); + } + + private static boolean supportShared(Widget widget) { + + return notBody(widget) && notForm(widget); + } + + private static boolean notBody(Widget widget) { + return !(widget instanceof WAbsoluteBodyLayout || widget instanceof WFitLayout || widget instanceof WParameterLayout); + } + + private static boolean notForm(Widget widget) { + if (!(widget instanceof WBorderLayout)) { + return true; + } + Widget centerWidget = ((WBorderLayout) widget).getLayoutWidget(WBorderLayout.CENTER); + return notBody(centerWidget); + + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/select/TransformerKey.java b/designer-form/src/main/java/com/fr/design/mainframe/share/select/TransformerKey.java new file mode 100644 index 000000000..221870272 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/select/TransformerKey.java @@ -0,0 +1,112 @@ +package com.fr.design.mainframe.share.select; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.mainframe.FormSelection; +import com.fr.form.ui.Widget; +import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.AssistUtils; +import org.jetbrains.annotations.Nullable; + +import java.awt.Rectangle; +import java.util.Arrays; +import java.util.Objects; +import java.util.UUID; + +/** + * created by Harrison on 2020/06/11 + **/ +public class TransformerKey { + + private Rectangle selectionBounds; + + private Widget[] widgets; + + public TransformerKey(FormSelection selection) { + this.selectionBounds = selection.getSelctionBounds(); + this.widgets = deepData(selection.getSelectedCreators()); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + TransformerKey that = (TransformerKey) o; + return Objects.equals(selectionBounds, that.selectionBounds) && + Arrays.equals(widgets, that.widgets); + } + + @Override + public int hashCode() { + int result = Objects.hash(selectionBounds); + result = 31 * result + + Arrays.hashCode(widgets); + return result; + } + + private Widget[] deepData(XCreator[] xCreators) { + if (xCreators == null) { + return new UniqueWidgetWrapper[0]; + } + Widget[] widgets = new Widget[xCreators.length]; + int i = 0; + for (XCreator xCreator : xCreators) { + widgets[i++] = new UniqueWidgetWrapper(cloneWidget(xCreator)); + } + return widgets; + } + + @Nullable + private Widget cloneWidget(XCreator xCreator) { + + try { + return xCreator.toData() != null ? (Widget) xCreator.toData().clone() : null; + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return null; + } + } + + private static class UniqueWidgetWrapper extends Widget { + private String uuid; + private Widget widget; + + public UniqueWidgetWrapper(Widget widget) { + this.widget = widget; + this.uuid = UUID.randomUUID().toString(); + } + + @Override + public String getXType() { + return "UniqueWidgetWrapper"; + } + + @Override + public boolean isEditor() { + return false; + } + + @Override + public String[] supportedEvents() { + return new String[0]; + } + + /** + * hash码 + * + * @return 返回int + */ + @Override + public int hashCode() { + return 31 * super.hashCode() + AssistUtils.hashCode(this.uuid, this.widget); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof UniqueWidgetWrapper + && super.equals(obj) + && ComparatorUtils.equals(((UniqueWidgetWrapper) obj).uuid, this.uuid) + && ComparatorUtils.equals(((UniqueWidgetWrapper) obj).widget, this.widget); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java b/designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java new file mode 100644 index 000000000..437835662 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java @@ -0,0 +1,153 @@ +package com.fr.design.mainframe.share.sort; + +import com.fr.design.i18n.Toolkit; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.bean.SortParameter; +import com.fr.form.share.utils.ShareUtils; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; + +import java.text.Collator; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Date; +import java.util.Map; + + +/** + * Created by kerry on 2020-10-22 + */ +public enum OnlineWidgetSortType implements SortType { + COMPOSITE { + @Override + public void sort(OnlineShareWidget[] widgetProviders) { + Map parameterMap = ShareUtils.getCompositeSortPara(); + Arrays.sort(widgetProviders, new Comparator() { + @Override + public int compare(OnlineShareWidget o1, OnlineShareWidget o2) { + double t1 = getSortValue(o1, parameterMap); + double t2 = getSortValue(o2, parameterMap); + return ComparatorUtils.compareCommonType(t2, t1); + } + }); + } + + private double getSortValue(OnlineShareWidget o, Map parameterMap) { + double a1 = getParaValue("a1", parameterMap), + a2 = getParaValue("a2", parameterMap), + a3 = getParaValue("a3", parameterMap), + b1 = getParaValue("b1", parameterMap), + b2 = getParaValue("b2", parameterMap), + k = getParaValue("k", parameterMap), + q1 = getParaValue("q1", parameterMap), + q2 = getParaValue("q2", parameterMap); + String[] hot2 = new String[]{"report-1", "report-2"}; + String[] hot1 = new String[]{"chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "chart-6"}; + int commentNumber = o.getCommentNumber(), weight = o.getWeight(), downloadTimes = o.getDownloadTimes(); + + double hotValue = a3; + String cid = o.getCid(); + for (String str2 : hot2) { + if (ComparatorUtils.equals(str2, cid)) { + hotValue = a2; + break; + } + } + for (String str1 : hot1) { + if (ComparatorUtils.equals(str1, cid)) { + hotValue = a1; + break; + } + } + + double t = (new Date().getTime() - o.getUploadTime().getTime()) / (3600 * 1000 * 24D); + return q1 * hotValue * Math.pow(2.718, (0 - k) * t) + q2 * (b1 * commentNumber + b2 * downloadTimes) * Math.pow(2.718, (0 - k) * t) + weight; + } + + private double getParaValue(String parameter, Map parameterMap) { + SortParameter sortParameter = parameterMap.get(parameter); + if (sortParameter == null) { + return 0.0D; + } + return sortParameter.getValue(); + } + + + @Override + public String getDisplayName() { + return Toolkit.i18nText("Fine-Design_Share_Composite"); + } + }, + + + SALES { + @Override + public void sort(OnlineShareWidget[] widgetProviders) { + Arrays.sort(widgetProviders, new Comparator() { + @Override + public int compare(OnlineShareWidget o1, OnlineShareWidget o2) { + int t1 = o1.getDownloadTimes(); + int t2 = o2.getDownloadTimes(); + int result = ComparatorUtils.compareCommonType(t2, t1); + if (result == 0) { + result = Collator.getInstance(GeneralContext.getLocale()).compare(o1.getName(), o2.getName()); + } + return result; + } + }); + } + + @Override + public String getDisplayName() { + return Toolkit.i18nText("Fine-Design_Share_Sale"); + } + }, + + NEW_PRODUCT { + @Override + public void sort(OnlineShareWidget[] widgetProviders) { + Arrays.sort(widgetProviders, new Comparator() { + @Override + public int compare(OnlineShareWidget o1, OnlineShareWidget o2) { + long t1 = o1.getUploadTime().getTime(); + long t2 = o2.getUploadTime().getTime(); + int result = ComparatorUtils.compareCommonType(t2, t1); + if (result == 0) { + result = Collator.getInstance(GeneralContext.getLocale()).compare(o1.getName(), o2.getName()); + } + return result; + } + }); + } + + @Override + public String getDisplayName() { + return Toolkit.i18nText("Fine-Design_Share_New_Product"); + } + } + //现在不用,以后可能会用,先注释掉 + /*, + PRICE { + @Override + public void sort(OnlineShareWidget[] widgetProviders) { + Arrays.sort(widgetProviders, new Comparator() { + @Override + public int compare(OnlineShareWidget o1, OnlineShareWidget o2) { + double t1 = o1.getPrice(); + double t2 = o2.getPrice(); + int result = ComparatorUtils.compareCommonType(t2, t1); + if (result == 0) { + result = Collator.getInstance(GeneralContext.getLocale()).compare(o1.getName(), o2.getName()); + } + return result; + } + }); + } + + @Override + public String getDisplayName() { + return Toolkit.i18nText("Fine-Design_Share_Price"); + } + };*/ + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/sort/SortType.java b/designer-form/src/main/java/com/fr/design/mainframe/share/sort/SortType.java new file mode 100644 index 000000000..316bb3c10 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/sort/SortType.java @@ -0,0 +1,12 @@ +package com.fr.design.mainframe.share.sort; + +/** + * @Author: Yuan.Wang + * @Date: 2020/11/19 + */ +public interface SortType { + + void sort(T[] widgetProviders); + + String getDisplayName(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/sort/WidgetSortType.java b/designer-form/src/main/java/com/fr/design/mainframe/share/sort/WidgetSortType.java new file mode 100644 index 000000000..a6b8d49b2 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/sort/WidgetSortType.java @@ -0,0 +1,55 @@ +package com.fr.design.mainframe.share.sort; + +import com.fr.design.i18n.Toolkit; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.record.ShareWidgetInfoManager; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralContext; + +import java.text.Collator; +import java.util.Arrays; +import java.util.Comparator; + +/** + * Created by kerry on 2020-07-01 + */ +public enum WidgetSortType implements SortType { + INSTALL_TIME { + @Override + public void sort(SharableWidgetProvider[] widgetProviders) { + Arrays.sort(widgetProviders, new Comparator() { + @Override + public int compare(SharableWidgetProvider o1, SharableWidgetProvider o2) { + long t1 = ShareWidgetInfoManager.getInstance().getCompInstallTime(o1.getName() + "." + o1.getId()); + long t2 = ShareWidgetInfoManager.getInstance().getCompInstallTime(o2.getName() + "." + o2.getId()); + int result = ComparatorUtils.compareCommonType(t2, t1); + if (result == 0) { + result = Collator.getInstance(GeneralContext.getLocale()).compare(o1.getName(), o2.getName()); + } + return result; + } + }); + } + + @Override + public String getDisplayName() { + return Toolkit.i18nText("Fine-Design_Share_Install_Time"); + } + }, + COMPONENT_NAME { + @Override + public void sort(SharableWidgetProvider[] widgetProviders) { + Arrays.sort(widgetProviders, new Comparator() { + @Override + public int compare(SharableWidgetProvider o1, SharableWidgetProvider o2) { + return Collator.getInstance(GeneralContext.getLocale()).compare(o1.getName(), o2.getName()); + } + }); + } + + @Override + public String getDisplayName() { + return Toolkit.i18nText("Fine-Design_Share_Sort_Name"); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ChartIcon.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ChartIcon.java new file mode 100644 index 000000000..b52916f9c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ChartIcon.java @@ -0,0 +1,91 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.base.chart.BaseChartCollection; +import com.fr.base.chart.BaseChartPainter; +import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.base.chart.result.WebChartIDInfo; +import com.fr.script.Calculator; + +import javax.swing.Icon; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Paint; + +public class ChartIcon implements Icon { + private BaseChartCollection chartCollection; + private CallbackEvent callbackEvent; + + private int width; + private int height; + + /** + * 构造Chart的缩略图Icon + */ + public ChartIcon(BaseChartCollection chartCollection, int width, int height) { + try { + this.chartCollection = (BaseChartCollection) chartCollection.clone(); + } catch (CloneNotSupportedException e) { + this.chartCollection = chartCollection; + } + this.width = width; + this.height = height; + } + + public void registerCallBackEvent(CallbackEvent callbackEvent) { + this.callbackEvent = callbackEvent; + } + + /** + * 画出缩略图Icon + * + * @param g 图形的上下文 + * @param c 所在的Component + * @param x 缩略图的起始坐标x + * @param y 缩略图的起始坐标y + */ + @Override + public void paintIcon(Component c, Graphics g, int x, int y) { + + BaseChartPainter chartPainter = getChartPainter(); + + Graphics2D g2d = (Graphics2D) g; + Paint oldPaint = g2d.getPaint(); + g.translate(x, y); + g2d.setPaint(Color.white); + g2d.fillRect(0, 0, getIconWidth(), getIconHeight()); + + chartPainter.paint(g2d, getIconWidth(), getIconHeight(), 0, null, callbackEvent); + + g.translate(-x, -y); + g2d.setPaint(oldPaint); + } + + protected BaseChartPainter getChartPainter() { + BaseChartPainter painter = chartCollection.createResultChartPainterWithOutDealFormula(Calculator.createCalculator(), + WebChartIDInfo.createEmptyDesignerInfo(), getIconWidth(), getIconHeight()); + return painter; + } + + + /** + * 返回缩略图的宽度 + * + * @return int 缩略图宽度 + */ + @Override + public int getIconWidth() { + return width; + } + + /** + * 返回缩略图的高度 + * + * @return int 缩略图高度 + */ + @Override + public int getIconHeight() { + return height; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/DictionaryComboCheckBox.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/DictionaryComboCheckBox.java new file mode 100644 index 000000000..2a4fedddb --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/DictionaryComboCheckBox.java @@ -0,0 +1,92 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.design.gui.icombocheckbox.UIComboCheckBox; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.stable.StringUtils; + +import java.awt.Component; +import java.util.ArrayList; +import java.util.List; + +/** + * created by Harrison on 2020/04/21 + **/ +public class DictionaryComboCheckBox extends UIComboCheckBox { + + private static final String DEFAULT_VALUE_SEPARATOR = ","; + + private static final String EDITOR_FIELD = "editor"; + + private Object[] values; + + private Object[] displays; + + private String locale; + + private UITextField newEditor = null; + + public DictionaryComboCheckBox(Object[] values, String[] displays, String locale) { + super(displays); + init(values, displays); + this.locale = locale; + + installUI(); + } + + private void init(Object[] keys, String[] displays) { + + this.displays = displays; + this.values = keys; + } + + /** + * 这里是有问题的, 这里本身直接获取比较好。 + */ + @Deprecated + private void installUI() { + + Component[] components = getComponents(); + UITextField editor = (UITextField) components[0]; + editor.setPlaceholder(Toolkit.i18nText(locale)); + } + + @Override + public String getText() { + + Object[] selectedValues = getSelectedValues(); + StringBuilder builder = new StringBuilder(); + if (selectedValues != null) { + for (Object value : selectedValues) { + builder.append(value); + builder.append(DEFAULT_VALUE_SEPARATOR); + } + } + //去掉末尾多余的逗号 + return builder.length() > 0 ? builder.substring(0, builder.length() - 1) : StringUtils.EMPTY; + } + + @Override + public Object[] getSelectedValues() { + + Object[] selectedValues = super.getSelectedValues(); + List realValues = new ArrayList<>(); + for (Object selectedValue : selectedValues) { + Object realValue = matchValue(selectedValue); + if (realValue != null) { + realValues.add(realValue); + } + } + return realValues.toArray(); + } + + protected Object matchValue(Object key) { + + for (int i = 0; i < displays.length; i++) { + if (displays[i].equals(key)) { + return values[i]; + } + } + return null; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/DownloadProgressPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/DownloadProgressPane.java new file mode 100644 index 000000000..c7f09f453 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/DownloadProgressPane.java @@ -0,0 +1,129 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.iprogressbar.ModernUIProgressBarUI; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.IOUtils; + +import javax.swing.BorderFactory; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/24 + * 下载组件包的时候用到的进度条 + */ +public class DownloadProgressPane extends JPanel { + private static final int MAX_NUM = 1000; + + private final UILabel tipLabel; + private final UILabel closeLabel; + private final JProgressBar processBar; + + public DownloadProgressPane(MouseClickListener listener) { + this.setLayout(new BorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(200, 25, 0, 25)); + + processBar = createProgressBar(); + tipLabel = createTipLabel(); + + JPanel panel = new JPanel(new BorderLayout()); + panel.setOpaque(false); + panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + panel.setPreferredSize(new Dimension(240, 60)); + panel.add(processBar, BorderLayout.CENTER); + + closeLabel = new UILabel(IOUtils.readIcon("/com/fr/base/images/share/close_small.png")); + closeLabel.addMouseListener(listener); + + JPanel labelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + labelPane.setOpaque(false); + labelPane.add(tipLabel, BorderLayout.CENTER); + labelPane.add(closeLabel, BorderLayout.EAST); + labelPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 7)); + + UILabel downloadTipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Package_Downloading_Tip")); + downloadTipLabel.setPreferredSize(new Dimension(240, 90)); + downloadTipLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + downloadTipLabel.setForeground(Color.WHITE); + downloadTipLabel.setHorizontalTextPosition(UILabel.CENTER); + + + JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + centerPane.setPreferredSize(new Dimension(240, 138)); + centerPane.add(labelPane, BorderLayout.NORTH); + centerPane.add(panel, BorderLayout.CENTER); + centerPane.add(downloadTipLabel, BorderLayout.SOUTH); + centerPane.setOpaque(false); + + this.add(centerPane, BorderLayout.NORTH); + this.setSize(new Dimension(240, 800)); + this.setBackground(new Color(0, 0, 0, 0)); + this.setOpaque(false); + } + + private UILabel createTipLabel() { + UILabel label = new UILabel(ProcessState.DOWNLOADING.tip); + label.setPreferredSize(new Dimension(200, 20)); + label.setHorizontalAlignment(UILabel.CENTER); + label.setOpaque(false); + label.setForeground(Color.WHITE); + return label; + } + + private JProgressBar createProgressBar() { + JProgressBar jProgressBar = new JProgressBar(); + jProgressBar.setUI(new ModernUIProgressBarUI()); + jProgressBar.setBorderPainted(false); + jProgressBar.setOpaque(false); + jProgressBar.setBorder(null); + jProgressBar.setMaximum(MAX_NUM); + return jProgressBar; + } + + public void changeState() { + tipLabel.setText(ProcessState.INSTALLING.tip); + closeLabel.setVisible(false); + this.validate(); + this.repaint(); + } + + public void updateProgress(double process) { + if (process < 0 || process > 1) { + throw new IllegalArgumentException(); + } + processBar.setValue((int) (process * MAX_NUM)); + } + + + private enum ProcessState { + DOWNLOADING(Toolkit.i18nText("Fine-Design_Share_Package_Downloading")), + INSTALLING(Toolkit.i18nText("Fine-Design_Share_Package_Installing")); + + private final String tip; + + ProcessState(String tip) { + this.tip = tip; + } + } + + public static void main(String[] args) { + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.setBounds(600, 200, 240, 500); + + DownloadProgressPane pane = new DownloadProgressPane(null); + pane.updateProgress(0.5); + frame.add(pane); + frame.setVisible(true); + + } +} + + diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/FailureMessagePane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/FailureMessagePane.java new file mode 100644 index 000000000..52a57ed4b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/FailureMessagePane.java @@ -0,0 +1,58 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.frpane.UITextPane; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.general.IOUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.text.Style; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyleContext; +import java.awt.BorderLayout; +import java.awt.FlowLayout; + +/** + * @Author: Yuan.Wang + * @Date: 2020/9/14 + */ +public class FailureMessagePane extends BasicPane { + public FailureMessagePane(String str) { + UILabel imageLabel = new UILabel(IOUtils.readIcon("/com/fr/base/images/share/error_icon.png")); + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Share_Share_Modules_Error")); + UITextPane textPane = new UITextPane(); + UIScrollPane jScrollPane = new UIScrollPane(textPane); + JPanel panel = new JPanel(); + + Style style = new StyleContext().new NamedStyle(); + StyleConstants.setLineSpacing(style, 0.1f); + StyleConstants.setFontSize(style, 12); + textPane.setLogicalStyle(style); + textPane.setText(str); + textPane.setCaretPosition(0); + textPane.setEditable(false); + textPane.setBorder(BorderFactory.createEmptyBorder(3, 5, 3, 5)); + + jScrollPane.setBorder(BorderFactory.createEmptyBorder()); + label.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + + setLayout(new BorderLayout()); + setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); + + panel.add(imageLabel); + panel.add(label); + panel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + panel.setBorder(BorderFactory.createEmptyBorder(4, 0, 4, 0)); + add(panel, BorderLayout.NORTH); + add(jScrollPane, BorderLayout.CENTER); + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Share_Dialog_Message"); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/FlexSearchFieldPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/FlexSearchFieldPane.java new file mode 100644 index 000000000..91b2ce358 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/FlexSearchFieldPane.java @@ -0,0 +1,172 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.base.BaseUtils; +import com.fr.design.event.ChangeEvent; +import com.fr.design.event.ChangeListener; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by kerry on 2020-10-19 + */ +public class FlexSearchFieldPane extends JPanel { + private static final String SEARCH = "SEARCH"; + private static final String OTHER = "OTHER"; + + private static final Color SEARCH_BORDER_COLOR = Color.decode("#F5F5F7"); + private static final Color SEARCH_BORDER_INPUT_COLOR = Color.decode("#419BF9"); + private UITextField searchTextField; + private CardLayout cardLayout; + private JPanel centerPane; + private List changeListenerList = new ArrayList<>(); + private List focusListeners = new ArrayList<>(); + private List deleteIconMouseListener = new ArrayList<>(); + private List fieldDocumentListener = new ArrayList<>(); + + public FlexSearchFieldPane(JPanel otherPane) { + JPanel searchFieldPane = createSearchField(); + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.add(otherPane, BorderLayout.CENTER); + jPanel.add(createSearchLabel(), BorderLayout.EAST); + cardLayout = new CardLayout(); + centerPane = new JPanel(cardLayout); + centerPane.add(searchFieldPane, SEARCH); + centerPane.add(jPanel, OTHER); + cardLayout.show(centerPane, OTHER); + this.add(centerPane, BorderLayout.CENTER); + } + + + private JPanel createSearchLabel() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel label = new UILabel(IOUtils.readIcon("/com/fr/base/images/share/search_icon.png")); + label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jPanel.add(label, BorderLayout.EAST); + label.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + cardLayout.show(centerPane, SEARCH); + searchTextField.requestFocus(); + } + }); + return jPanel; + } + + private JPanel createSearchField() { + final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setPreferredSize(new Dimension(228, 20)); + jPanel.setBorder(BorderFactory.createLineBorder(SEARCH_BORDER_COLOR)); + jPanel.setBackground(Color.WHITE); + UILabel label = new UILabel(IOUtils.readIcon("/com/fr/base/images/share/search_icon.png")); + label.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0)); + jPanel.add(label, BorderLayout.WEST); + this.searchTextField = new UITextField(); + this.searchTextField.setBorderPainted(false); + this.searchTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Basic_Plugin_Search")); + this.searchTextField.addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + jPanel.setBorder(BorderFactory.createLineBorder(SEARCH_BORDER_INPUT_COLOR)); + jPanel.repaint(); + for (FocusListener focusListener : focusListeners) { + focusListener.focusGained(e); + } + } + + @Override + public void focusLost(FocusEvent e) { + jPanel.setBorder(BorderFactory.createLineBorder(SEARCH_BORDER_COLOR)); + jPanel.repaint(); + for (FocusListener focusListener : focusListeners) { + focusListener.focusLost(e); + } + } + }); + this.searchTextField.getDocument().addDocumentListener(new DocumentListener() { + @Override + public void insertUpdate(DocumentEvent e) { + filterByName(); + for (DocumentListener listener : fieldDocumentListener) { + listener.insertUpdate(e); + } + } + + @Override + public void removeUpdate(DocumentEvent e) { + filterByName(); + for (DocumentListener listener : fieldDocumentListener) { + listener.removeUpdate(e); + } + } + + @Override + public void changedUpdate(DocumentEvent e) { + filterByName(); + for (DocumentListener listener : fieldDocumentListener) { + listener.changedUpdate(e); + } + } + }); + jPanel.add(this.searchTextField, BorderLayout.CENTER); + UILabel xLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/buttonicon/close_icon.png")); + xLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + searchTextField.setText(StringUtils.EMPTY); + cardLayout.show(centerPane, OTHER); + for (MouseListener listener : deleteIconMouseListener) { + listener.mouseClicked(e); + } + } + }); + xLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jPanel.add(xLabel, BorderLayout.EAST); + + + return jPanel; + } + + private void filterByName() { + String text = searchTextField.getText(); + for (ChangeListener listener : changeListenerList) { + listener.fireChanged(new ChangeEvent(text)); + } + } + + public void registerChangeListener(ChangeListener changeListener) { + changeListenerList.add(changeListener); + } + + public void registerSearchTextFieldFocusListener(FocusListener focusListener) { + focusListeners.add(focusListener); + } + + public void registerDeleteIconMouseListener(MouseListener mouseListener) { + deleteIconMouseListener.add(mouseListener); + } + + public void registerFieldDocumentListener(DocumentListener documentListener) { + fieldDocumentListener.add(documentListener); + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImageBackgroundPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImageBackgroundPane.java new file mode 100644 index 000000000..073dee103 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImageBackgroundPane.java @@ -0,0 +1,226 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.base.Style; +import com.fr.base.background.ImageBackground; +import com.fr.base.background.ImageFileBackground; +import com.fr.design.gui.frpane.ImgChooseWrapper; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.style.background.BackgroundDetailPane; +import com.fr.design.style.background.image.ImageFileChooser; +import com.fr.design.style.background.image.ImagePreviewPane; +import com.fr.general.Background; +import com.fr.stable.Constants; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.GridLayout; +import java.awt.Image; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Image background pane. + */ +public class ImageBackgroundPane extends BackgroundDetailPane { + + protected ImagePreviewPane previewPane = null; + private Style imageStyle = null; + private ChangeListener changeListener = null; + private ImageFileChooser imageFileChooser = null; + protected UILabel imageSizeLabel = new UILabel(); + + protected UIRadioButton defaultRadioButton = null; + protected UIRadioButton tiledRadioButton = null; + private UIRadioButton extendRadioButton = null; + private UIRadioButton adjustRadioButton = null; + + public ImageBackgroundPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + + // preview pane + JPanel previewContainerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + this.add(previewContainerPane, BorderLayout.CENTER); + + JPanel previewOwnerPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); + previewOwnerPane.setLayout(new BorderLayout()); + previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER); + previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST); + previewPane = new ImagePreviewPane(); + previewOwnerPane.add(new JScrollPane(previewPane)); + previewPane.addChangeListener(imageSizeChangeListener); + + + // init image file chooser. + imageFileChooser = new ImageFileChooser(); + imageFileChooser.setMultiSelectionEnabled(false); + } + + public JPanel initSelectFilePane() { + JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + + selectFilePane.setBorder(BorderFactory.createEmptyBorder(8, 2, 4, 0)); + + UIButton selectPictureButton = new UIButton( + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Image_Select")); + selectFilePane.add(selectPictureButton, BorderLayout.NORTH); + selectPictureButton.setMnemonic('S'); + selectPictureButton.addActionListener(selectPictureActionListener); + JPanel layoutPane = FRGUIPaneFactory.createMediumHGapHighTopFlowInnerContainer_M_Pane(); + selectFilePane.add(layoutPane, BorderLayout.CENTER); + + //布局 + defaultRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Default")); + tiledRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Titled")); + extendRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Extend")); + adjustRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Adjust")); + + defaultRadioButton.addActionListener(layoutActionListener); + tiledRadioButton.addActionListener(layoutActionListener); + extendRadioButton.addActionListener(layoutActionListener); + adjustRadioButton.addActionListener(layoutActionListener); + + JPanel jp = new JPanel(new GridLayout(4, 1, 15, 15)); + for (UIRadioButton button : imageLayoutButtons()) { + jp.add(button); + } + layoutPane.add(jp); + + ButtonGroup layoutBG = new ButtonGroup(); + layoutBG.add(defaultRadioButton); + layoutBG.add(tiledRadioButton); + layoutBG.add(extendRadioButton); + layoutBG.add(adjustRadioButton); + + defaultRadioButton.setSelected(true); + return selectFilePane; + } + + protected UIRadioButton[] imageLayoutButtons() { + return new UIRadioButton[]{ + defaultRadioButton, + tiledRadioButton, + extendRadioButton, + adjustRadioButton + }; + } + + /** + * Select picture. + */ + ActionListener selectPictureActionListener = new ActionListener() { + + public void actionPerformed(ActionEvent evt) { + int returnVal = imageFileChooser.showOpenDialog(ImageBackgroundPane.this); + setImageStyle(); + ImgChooseWrapper.getInstance(previewPane, imageFileChooser, imageStyle, changeListener).dealWithImageFile(returnVal); + } + }; + + protected void setImageStyle() { + if (tiledRadioButton.isSelected()) { + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_TILED); + } else if (adjustRadioButton.isSelected()) { + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_ADJUST); + } else if (extendRadioButton.isSelected()) { + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_EXTEND); + } else { + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_CENTER); + } + } + + ActionListener layoutActionListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent evt) { + setImageStyle(); + changeImageStyle(); + } + + private void changeImageStyle() { + previewPane.setImageStyle(ImageBackgroundPane.this.imageStyle); + previewPane.repaint(); + } + }; + + @Override + public void populate(Background background) { + + if (background instanceof ImageBackground) { + ImageBackground imageBackground = (ImageBackground) background; + + if (imageBackground.getLayout() == Constants.IMAGE_CENTER) { + defaultRadioButton.setSelected(true); + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_CENTER); + } else if (imageBackground.getLayout() == Constants.IMAGE_EXTEND) { + extendRadioButton.setSelected(true); + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_EXTEND); + } else if (imageBackground.getLayout() == Constants.IMAGE_ADJUST) { + adjustRadioButton.setSelected(true); + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_ADJUST); + } else { + tiledRadioButton.setSelected(true); + imageStyle = Style.DEFAULT_STYLE.deriveImageLayout(Constants.IMAGE_TILED); + } + + previewPane.setImageStyle(ImageBackgroundPane.this.imageStyle); + if (imageBackground.getImage() != null) { + previewPane.setImageWithSuffix(imageBackground.getImageWithSuffix()); + imageSizeLabel.setText(previewPane.getImage().getWidth(null) + + " X " + previewPane.getImage().getHeight(null)); + } + + if (imageBackground.getImage() != null) { + previewPane.setImage(imageBackground.getImage()); + } + } else { + previewPane.setImage(null); + tiledRadioButton.setSelected(true); + + imageSizeLabel.setText(""); + } + + fireChagneListener(); + } + + @Override + public Background update() throws Exception { + ImageBackground imageBackground = new ImageFileBackground(previewPane.getImageWithSuffix()); + setImageStyle(); + imageBackground.setLayout(imageStyle.getImageLayout()); + return imageBackground; + } + + @Override + public void addChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + private void fireChagneListener() { + if (this.changeListener != null) { + ChangeEvent evt = new ChangeEvent(this); + this.changeListener.stateChanged(evt); + } + } + + ChangeListener imageSizeChangeListener = new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent evt) { + Image image = ((ImagePreviewPane) evt.getSource()).getImage(); + + if (image == null) { + imageSizeLabel.setText(""); + } else { + imageSizeLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Size_Detail", image.getWidth(null) + "x" + image.getHeight(null))); + } + } + }; +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImagePanel.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImagePanel.java new file mode 100644 index 000000000..a9bc8b787 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImagePanel.java @@ -0,0 +1,28 @@ +package com.fr.design.mainframe.share.ui.base; + +import javax.swing.JPanel; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Toolkit; + +/** + * Created by kerry on 2020-10-23 + */ +public class ImagePanel extends JPanel { + + + private Image image; + + public ImagePanel(String imagePath) { + image = Toolkit.getDefaultToolkit().createImage(ImagePanel.class + .getResource(imagePath)); + } + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + if (image != null) { + g.drawImage(image, 0, 0, 45, 45, this); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImitationProgress.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImitationProgress.java new file mode 100644 index 000000000..062ca9293 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ImitationProgress.java @@ -0,0 +1,129 @@ +package com.fr.design.mainframe.share.ui.base; + + +import java.util.concurrent.atomic.AtomicReference; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/23 + */ +public class ImitationProgress { + private final com.fr.design.extra.Process process; + private static final double TOTAL_NUM = 1000; + private static final double FIRST_STAGE_RATE = 0.8; + private static final int SLEEP_TIME = 600; + + private final AtomicReference state = new AtomicReference<>(ImitationState.NEW); + + private final int num; + private final double initSpeed; + private int currentProgressRate = 0; + + public ImitationProgress(com.fr.design.extra.Process process, int num) { + this.process = process; + this.num = num; + initSpeed = TOTAL_NUM * FIRST_STAGE_RATE / num; + } + + public void start() { + if (!state.compareAndSet(ImitationState.NEW, ImitationState.FIRST_STAGE)) { + return; + } + firstState(); + if (state.compareAndSet(ImitationState.FIRST_STAGE, ImitationState.SECOND_STATE)) { + secondState(); + } + if (state.get() == ImitationState.COMPLETE) { + thirdState(); + } + } + + /** + * 按照预先估计的速度跑完80% + */ + private void firstState() { + int i = 0; + for (; i < num; i++) { + try { + Thread.sleep(SLEEP_TIME); + currentProgressRate += initSpeed; + process.process(currentProgressRate / TOTAL_NUM); + if (state.get() != ImitationState.FIRST_STAGE) { + return; + } + } catch (InterruptedException ignore) { + } + } + } + + /** + * 第一阶段结束但是还没有下载完,则减慢速度跑第二阶段 + */ + private void secondState() { + double speed = TOTAL_NUM * 0.1 / 30; + //70%-90%,30s + int i = 0; + for (; i < 30; i++) { + try { + Thread.sleep(1000); + currentProgressRate += speed; + process.process(currentProgressRate / (TOTAL_NUM)); + if (state.get() != ImitationState.SECOND_STATE) { + return; + } + } catch (InterruptedException ignore) { + return; + } + } + //90%-95%,三分钟 + speed = TOTAL_NUM * 0.05 / 60; + for (i = 0; i < 60; i++) { + try { + Thread.sleep(3000); + currentProgressRate += speed; + process.process(currentProgressRate / (TOTAL_NUM)); + } catch (InterruptedException ignore) { + return; + } + } + //线程睡眠1h + try { + Thread.sleep(1000 * 3600); + } catch (InterruptedException ignore) { + } + } + + + /** + * 下载完,则跑第三阶段,即1s内跑完剩下所有进度 + */ + private void thirdState() { + int localSpeed = (int) (TOTAL_NUM - currentProgressRate) / 10; + for (int i = 0; i < 10; i++) { + try { + Thread.sleep(100); + currentProgressRate += localSpeed; + process.process((currentProgressRate) / TOTAL_NUM); + } catch (InterruptedException ignore) { + return; + } + } + + } + + public void completed() { + state.set(ImitationState.COMPLETE); + } + + public void stop() { + state.set(ImitationState.STOP); + } + + private enum ImitationState { + NEW, + FIRST_STAGE, + SECOND_STATE, + COMPLETE, + STOP + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/LeftWordsTextArea.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/LeftWordsTextArea.java new file mode 100644 index 000000000..df9dd8aac --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/LeftWordsTextArea.java @@ -0,0 +1,44 @@ +package com.fr.design.mainframe.share.ui.base; + +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; + +/** + * created by Harrison on 2020/04/21 + **/ +public class LeftWordsTextArea extends PlaceholderTextArea { + + /** + * 默认值 200 + */ + private int limitedLen = 200; + + public LeftWordsTextArea() { + } + + public LeftWordsTextArea(String s, String placeholder) { + super(s, placeholder); + } + + public void setLimitedLen(int len) { + this.limitedLen = len; + } + + @Override + protected void paintComponent(Graphics pG) { + super.paintComponent(pG); + + char[] text = getText().toCharArray(); + int currentLen = text.length; + int leftLen = limitedLen - currentLen; + String leftWordsLen = String.valueOf(leftLen); + + final Graphics2D g = (Graphics2D) pG; + g.setRenderingHint( + RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(getDisabledTextColor()); + g.drawString(leftWordsLen, getWidth() - getInsets().right - leftWordsLen.length() * 8 - 5, getHeight() - getInsets().bottom - 5); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/LoadingPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/LoadingPane.java new file mode 100644 index 000000000..ee0f37774 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/LoadingPane.java @@ -0,0 +1,49 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; + +/** + * Created by kerry on 2020-10-23 + */ +public class LoadingPane extends JPanel { + + public LoadingPane() { + this(Toolkit.i18nText("Fine-Design_Share_Online_Loading")); + } + + public LoadingPane(String message) { + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + borderPane.setPreferredSize(new Dimension(120, 120)); + ImagePanel imagePanel = new ImagePanel("/com/fr/base/images/share/loading.gif"); + imagePanel.setPreferredSize(new Dimension(45, 45)); + borderPane.setBorder(BorderFactory.createEmptyBorder(150, 95, 5, 75)); + borderPane.add(imagePanel); + + panel.add(borderPane, BorderLayout.CENTER); + + JPanel labelPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel topLabel = new UILabel(Toolkit.i18nText(message), SwingConstants.CENTER); + topLabel.setForeground(Color.GRAY); + labelPanel.add(topLabel, BorderLayout.CENTER); + labelPanel.setPreferredSize(new Dimension(240, 20)); + panel.add(labelPanel, BorderLayout.SOUTH); + + panel.setPreferredSize(new Dimension(240, 230)); + + + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0)); + this.add(panel, BorderLayout.NORTH); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/MouseClickListener.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/MouseClickListener.java new file mode 100644 index 000000000..ae5247d21 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/MouseClickListener.java @@ -0,0 +1,34 @@ +package com.fr.design.mainframe.share.ui.base; + +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +/** + * Created by kerry on 2020-10-22 + */ +public abstract class MouseClickListener implements MouseListener { + @Override + public void mouseClicked(MouseEvent e) { + + } + + @Override + public void mousePressed(MouseEvent e) { + + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + + @Override + public void mouseEntered(MouseEvent e) { + + } + + @Override + public void mouseExited(MouseEvent e) { + + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/NoMatchPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/NoMatchPane.java new file mode 100644 index 000000000..856bfd299 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/NoMatchPane.java @@ -0,0 +1,41 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; + +/** + * @Author: Yuan.Wang + * @Date: 2021/1/14 + */ +public class NoMatchPane extends JPanel { + public NoMatchPane() { + init(); + } + + private void init() { + JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); + UILabel picLabel = new UILabel(); + picLabel.setIcon(BaseUtils.readIcon("com/fr/base/images/share/no_match_icon.png")); + picLabel.setHorizontalAlignment(SwingConstants.CENTER); + picLabel.setPreferredSize(new Dimension(240, 100)); + UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_No_Match_Result"), SwingConstants.CENTER); + label.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + label.setForeground(Color.gray); + label.setPreferredSize(new Dimension(240, 20)); + label.setHorizontalAlignment(SwingConstants.CENTER); + panel.add(picLabel); + panel.add(label); + panel.setBorder(BorderFactory.createEmptyBorder(250, 0, 0, 0)); + this.setLayout(new BorderLayout()); + this.add(panel, BorderLayout.CENTER); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PageableButton.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PageableButton.java new file mode 100644 index 000000000..781797e07 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PageableButton.java @@ -0,0 +1,128 @@ +package com.fr.design.mainframe.share.ui.base; + +import javax.swing.SwingConstants; +import javax.swing.plaf.ColorUIResource; +import javax.swing.plaf.basic.BasicArrowButton; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Shape; +import java.awt.geom.Path2D; +import java.awt.geom.RoundRectangle2D; + +public class PageableButton extends BasicArrowButton { + + static final private Color BORDER_COLOR = new ColorUIResource(198, 198, 198); + static final private Color ARROW_DISABLED_COLOR = new ColorUIResource(193, 193, 193); + static final private Color ARROW_COLOR = new ColorUIResource(112, 112, 112); + static final private Color BUTTON_COLOR = new ColorUIResource(255, 255, 255); + static final private Color BUTTON_DISABLED_COLOR = new ColorUIResource(242, 242, 242); + static final private Color BUTTON_PRESS_COLOR = new ColorUIResource(96, 189, 246); + static final private Color BUTTON_ROLLOVER_COLOR = new ColorUIResource(0xd2d2d2); + static final private int CONNER = 2; + + + public PageableButton(int direction) { + super(direction); + } + + public void paint(Graphics g) { + paintButton(g); + paintArrow(g); + paintButtonBorder(g); + } + + private void paintButton(Graphics g) { + + int width = this.getWidth(); + int height = this.getHeight(); + if (!isEnabled()) { + g.setColor(PageableButton.BUTTON_DISABLED_COLOR); + } else if (getModel().isPressed()) { + g.setColor(PageableButton.BUTTON_PRESS_COLOR); + } else if (getModel().isRollover()){ + g.setColor(PageableButton.BUTTON_ROLLOVER_COLOR); + } else { + g.setColor(PageableButton.BUTTON_COLOR); + } + + g.fillRoundRect(1, 1, width -2, height - 2, PageableButton.CONNER, PageableButton.CONNER); + } + + private void paintArrow(Graphics g) { + if (!this.isEnabled()) { + g.setColor(PageableButton.ARROW_DISABLED_COLOR); + } else { + g.setColor(PageableButton.ARROW_COLOR); + } + switch (direction) { + case SwingConstants.NORTH: + g.drawLine(8, 5, 8, 5); + g.drawLine(7, 6, 9, 6); + g.drawLine(6, 7, 10, 7); + g.drawLine(5, 8, 7, 8); + g.drawLine(9, 8, 11, 8); + g.drawLine(4, 9, 6, 9); + g.drawLine(10, 9, 12, 9); + g.drawLine(5, 10, 5, 10); + g.drawLine(11, 10, 11, 10); + break; + case SwingConstants.SOUTH: + g.drawLine(5, 6, 5, 6); + g.drawLine(11, 6, 11, 6); + g.drawLine(4, 7, 6, 7); + g.drawLine(10, 7, 12, 7); + g.drawLine(5, 8, 7, 8); + g.drawLine(9, 8, 11, 8); + g.drawLine(6, 9, 10, 9); + g.drawLine(7, 10, 9, 10); + g.drawLine(8, 11, 8, 11); + break; + case SwingConstants.EAST: + g.drawLine(6, 5, 6, 5); + g.drawLine(6, 11, 6, 11); + g.drawLine(7, 4, 7, 6); + g.drawLine(7, 10, 7, 12); + g.drawLine(8, 5, 8, 7); + g.drawLine(8, 9, 8, 11); + g.drawLine(9, 6, 9, 10); + g.drawLine(10, 7, 10, 9); + g.drawLine(11, 8, 11, 8); + break; + case SwingConstants.WEST: + g.drawLine(4, 8, 4, 8); + g.drawLine(5, 7, 5, 9); + g.drawLine(6, 6, 6, 10); + g.drawLine(7, 5, 7, 7); + g.drawLine(7, 9, 7, 11); + g.drawLine(8, 4, 8, 6); + g.drawLine(8, 10, 8, 12); + g.drawLine(9, 5, 9, 5); + g.drawLine(9, 11, 9, 11); + break; + } + } + + private void paintButtonBorder(Graphics g) { + int offs = 1; + int width = this.getWidth(); + int height = this.getHeight(); + + Graphics2D g2d = (Graphics2D) g; + Color oldColor = g2d.getColor(); + g2d.setColor(PageableButton.BORDER_COLOR); + + Shape outer; + Shape inner; + int size = offs + offs; + + outer = new RoundRectangle2D.Float(0, 0, width, height, offs, offs); + inner = new RoundRectangle2D.Float(offs, offs, width - size, height - size, PageableButton.CONNER, PageableButton.CONNER); + + Path2D path = new Path2D.Float(Path2D.WIND_EVEN_ODD); + path.append(outer, false); + path.append(inner, false); + g2d.fill(path); + g2d.setColor(oldColor); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PagingFiledPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PagingFiledPane.java new file mode 100644 index 000000000..b5cfcd53a --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PagingFiledPane.java @@ -0,0 +1,213 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.base.BaseUtils; +import com.fr.design.event.ChangeEvent; +import com.fr.design.event.ChangeListener; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.stable.ArrayUtils; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JSeparator; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Insets; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; + +/** + * Created by kerry on 2020-10-20 + */ +public class PagingFiledPane extends JPanel { + private static final Dimension PAGING_BTN_SIZE = new Dimension(20, 20); + private int currentPageNum = 1; + private int totalPageNum; + private int numPerPage; + + private ChangeListener changeListener; + + private UIButton lastPageBtn; + private UIButton nextPageBtn; + private UINumberField pagingEditField; + + public PagingFiledPane(int totalItems, int numPerPage) { + this.setOpaque(false); + this.numPerPage = numPerPage; + this.totalPageNum = totalItems / numPerPage + ((totalItems % numPerPage) == 0 ? 0 : 1); + this.totalPageNum = this.totalPageNum > 0 ? this.totalPageNum : 1; + initPane(totalPageNum); + } + + private void initPane(int totalPageNum) { + + this.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 15)); + initLastPageBtn(); + + JSeparator jSeparator1 = new JSeparator(); + + pagingEditField = new UINumberField(); + registerPagingEditFieldListener(); + pagingEditField.canFillNegativeNumber(false); + pagingEditField.setMinValue(1); + pagingEditField.setMaxValue(totalPageNum); + pagingEditField.setPreferredSize(new Dimension(50, 20)); + + UILabel totalPageLabel = new UILabel("/" + totalPageNum); + + JSeparator jSeparator2 = new JSeparator(); + + initNextPageBtn(); + + checkPageStatus(); + + this.add(lastPageBtn); + this.add(jSeparator1); + this.add(pagingEditField); + this.add(totalPageLabel); + this.add(jSeparator2); + this.add(nextPageBtn); + } + + public void setEnable(boolean enable) { + lastPageBtn.setEnabled(enable); + nextPageBtn.setEnabled(enable); + pagingEditField.setEnabled(enable); + } + + private void initLastPageBtn() { + lastPageBtn = new UIButton(BaseUtils.readIcon("/com/fr/base/images/share/left_page_normal.png")); + lastPageBtn.setRolloverEnabled(true); + lastPageBtn.setFocusPainted(false); + lastPageBtn.setContentAreaFilled(true); + lastPageBtn.setMargin(new Insets(0, 0, 0, 0)); + lastPageBtn.setPressedIcon(BaseUtils.readIcon("/com/fr/base/images/share/left_page_click.png")); + lastPageBtn.setRolloverIcon(BaseUtils.readIcon("/com/fr/base/images/share/left_page_hover.png")); + lastPageBtn.setDisabledIcon(BaseUtils.readIcon("/com/fr/base/images/share/left_page_disable.png")); + lastPageBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + clickLastPage(); + } + }); + lastPageBtn.setPreferredSize(PAGING_BTN_SIZE); + + } + + private void initNextPageBtn() { + nextPageBtn = new UIButton(BaseUtils.readIcon("/com/fr/base/images/share/right_page_normal.png")); + nextPageBtn.setRolloverEnabled(true); + nextPageBtn.setFocusPainted(false); + nextPageBtn.setContentAreaFilled(true); + nextPageBtn.setMargin(new Insets(0, 0, 0, 0)); + nextPageBtn.setPressedIcon(BaseUtils.readIcon("/com/fr/base/images/share/right_page_click.png")); + nextPageBtn.setRolloverIcon(BaseUtils.readIcon("/com/fr/base/images/share/right_page_hover.png")); + nextPageBtn.setDisabledIcon(BaseUtils.readIcon("/com/fr/base/images/share/right_page_disable.png")); + nextPageBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + clickNextPage(); + } + }); + nextPageBtn.setPreferredSize(PAGING_BTN_SIZE); + + } + + private void registerPagingEditFieldListener() { + pagingEditField.addKeyListener(new KeyListener() { + @Override + public void keyTyped(KeyEvent e) { + + } + + @Override + public void keyPressed(KeyEvent e) { + + } + + @Override + public void keyReleased(KeyEvent evt) { + int code = evt.getKeyCode(); + if (code == KeyEvent.VK_ENTER) { + jumpPage((int) pagingEditField.getValue()); + } + } + }); + pagingEditField.addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + + } + + @Override + public void focusLost(FocusEvent e) { + jumpPage((int) pagingEditField.getValue()); + } + }); + } + + public int getCurrentPageNum() { + return currentPageNum; + } + + public void registerChangeListener(ChangeListener changeListener) { + this.changeListener = changeListener; + } + + private void checkPageStatus() { + lastPageBtn.setEnabled(currentPageNum > 1); + nextPageBtn.setEnabled(currentPageNum < totalPageNum); + pagingEditField.setText(String.valueOf(currentPageNum)); + if (changeListener != null) { + changeListener.fireChanged(new ChangeEvent(currentPageNum)); + } + } + + private void clickNextPage() { + if (currentPageNum < totalPageNum) { + currentPageNum++; + checkPageStatus(); + } + } + + private void clickLastPage() { + if (currentPageNum > 1) { + currentPageNum--; + checkPageStatus(); + } + } + + private void jumpPage(int pageNum) { + if (pageNum > 0 && pageNum <= totalPageNum) { + currentPageNum = pageNum; + checkPageStatus(); + } + } + + public T[] getShowItems(T[] items) { + int startIndex = Math.max(0, currentPageNum - 1); + T[] resultArr = ArrayUtils.subarray(items, startIndex * this.numPerPage, this.currentPageNum * this.numPerPage); + return resultArr; + } + + + /** + * 测试程序 + */ + public static void main(String[] args) { + JFrame frame = new JFrame(""); + frame.setSize(400, 320); + Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); + frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2); + PagingFiledPane tt = new PagingFiledPane(10, 3); + frame.getContentPane().add(tt); + frame.setVisible(true); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PlaceholderTextArea.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PlaceholderTextArea.java new file mode 100644 index 000000000..c463a4903 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PlaceholderTextArea.java @@ -0,0 +1,42 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.design.gui.itextarea.UITextArea; + +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; + +/** + * created by Harrison on 2020/04/21 + **/ +public class PlaceholderTextArea extends UITextArea { + + private String placeholder; + + public PlaceholderTextArea() { + } + + public PlaceholderTextArea(String s, String placeholder) { + super(s); + this.placeholder = placeholder; + } + + public void setPlaceholder(String placeholder) { + + this.placeholder = placeholder; + } + + @Override + protected void paintComponent(final Graphics pG) { + super.paintComponent(pG); + if (placeholder.length() == 0 || getText().length() > 0) { + return; + } + final Graphics2D g = (Graphics2D) pG; + g.setRenderingHint( + RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(getDisabledTextColor()); + g.drawString(placeholder, getInsets().left, pG.getFontMetrics() + .getMaxAscent() + getInsets().top + 1); + }} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PopupMenuItem.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PopupMenuItem.java new file mode 100644 index 000000000..4ef1cffc6 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PopupMenuItem.java @@ -0,0 +1,31 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.design.constants.UIConstants; +import com.fr.design.mainframe.share.ui.base.ui.SharePopupMenuItemUI; +import com.fr.stable.StringUtils; + +import javax.swing.Action; +import javax.swing.JMenuItem; +import java.awt.Dimension; + +/** + * @Author: Yuan.Wang + * @Date: 2020/10/30 + * 弹窗菜单项 + */ +public class PopupMenuItem extends JMenuItem { + + public PopupMenuItem(Action action) { + super(StringUtils.EMPTY, null); + setBackground(UIConstants.DEFAULT_BG_RULER); + setAction(action); + setUI(new SharePopupMenuItemUI()); + this.setPreferredSize(new Dimension(60, 21)); + } + + @Override + public String getText() { + return StringUtils.EMPTY + super.getText(); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PopupPreviewPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PopupPreviewPane.java new file mode 100644 index 000000000..91b1eae89 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/PopupPreviewPane.java @@ -0,0 +1,83 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.design.constants.UIConstants; +import com.fr.general.IOUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Toolkit; + +/** + * Created by kerry on 2020-06-23 + */ +public class PopupPreviewPane extends JPopupMenu { + private Container contentPane; + private Image compImage; + private static final int WIDTH = 400; + private static final int STANDARD_DPI = 128; + private static final int MAX_HEIGHT = 400; + private static final int HEIGHT = 210; + + public PopupPreviewPane() { + setFocusable(false); + contentPane = new JPanel(); + contentPane.setBackground(Color.white); + this.setLayout(new BorderLayout()); + this.add(contentPane, BorderLayout.CENTER); + this.setOpaque(false); + setPreferredSize(new Dimension(WIDTH, MAX_HEIGHT)); + setBorder(BorderFactory.createLineBorder(UIConstants.LINE_COLOR)); + } + + public void setComp(Image compImage) { + try { + this.compImage = compImage; + this.updateSize(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void paint(Graphics g) { + super.paint(g); + if (compImage != null) { + g.drawImage(compImage, 0, 0, getWidth(), getHeight(), null); + } + } + + @Override + public void setVisible(boolean visible) { + super.setVisible(visible); + } + + public void menuSelectionChanged(boolean isIncluded) { + } + + + // 根据控件内容,更新弹出框大小 + private void updateSize() { + int dpi = Toolkit.getDefaultToolkit().getScreenResolution(); + int width; + int height; + if (compImage == null) { + compImage = IOUtils.readImage("com/fr/base/images/share/component_error.png"); + width = WIDTH; + height = HEIGHT; + } else { + width = compImage.getWidth(null); + height = compImage.getHeight(null); + } + double aspectRatio = (double) width / height; + width = (WIDTH * dpi) / STANDARD_DPI; + height = (int) (width / aspectRatio); + this.setPreferredSize(new Dimension(width, height)); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ShareProgressBar.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ShareProgressBar.java new file mode 100644 index 000000000..49fd3173b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ShareProgressBar.java @@ -0,0 +1,231 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.concurrent.NamedThreadFactory; +import com.fr.design.gui.iprogressbar.ProgressDialog; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.ui.util.UIUtil; +import com.fr.stable.StringUtils; + +import java.util.concurrent.Callable; +import java.util.concurrent.Executors; +import java.util.concurrent.FutureTask; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +public class ShareProgressBar { + + private static final int STEP = 20; + + private ProgressDialog progressBar = null; + + private LimitProgress loadingProgress = new LimitProgress(); + + /** + * 默认 40 ms更新进度 + */ + private int stepHeartbeat = 40; + + private volatile int progress = 0; + + private final AtomicBoolean TERMINATE = new AtomicBoolean(false); + + private final AtomicBoolean RUNNING = new AtomicBoolean(false); + + private ShareProgressBar() { + } + + private static class InstanceHolder { + + private static final ShareProgressBar INSTANCE = new ShareProgressBar(); + } + + public static ShareProgressBar getInstance() { + + return InstanceHolder.INSTANCE; + } + + public void prepare(int stepHeartbeat) { + + this.progressBar = createNewBar(); + this.stepHeartbeat = stepHeartbeat; + } + + public void updateProgress(double rate, String loadingText) throws Exception { + int maximum = progressBar.getProgressMaximum(); + double progress = maximum * rate; + int maxProgress = (int) Math.floor(progress); + loadingProgress.lock(maxProgress, loadingText); + + RUNNING.compareAndSet(false, true); + //终止条件 + TERMINATE.compareAndSet(true, false); + + loadingProgress.get(); + + } + + public void monitor() { + + final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1, + new NamedThreadFactory("ShareProgressMonitor", true)); + scheduler.scheduleAtFixedRate(new Runnable() { + @Override + public void run() { + if (!isRunning()) { + return; + } + if (isComplete()) { + shutdown(scheduler); + return; + } + updateUI(); + } + }, 0, stepHeartbeat, TimeUnit.MILLISECONDS); + } + + + /** + * 延迟关闭 + */ + public void complete(String loadingText) throws Exception { + + updateProgress(1.0, loadingText); + } + + /** + * 立刻关闭 + */ + public void completeNow() { + + if (RUNNING.get()) { + this.progress = progressBar.getProgressMaximum(); + this.TERMINATE.compareAndSet(false, true); + } + } + + /** + * 完成条件。不只是达到目标值,还要确保当前已经可以终止了。 + * + * @return 是否终止了。 + */ + public boolean isComplete() { + + return this.progress >= progressBar.getProgressMaximum() && this.TERMINATE.get(); + } + + private ProgressDialog createNewBar() { + return new ProgressDialog(DesignerContext.getDesignerFrame()); + } + + /** + * 小于当前最大时, 每次递增 1 + * 大于等于时, 停止 + * + * @return 当前最大值 + */ + private int incrementProgress() { + if (progress >= loadingProgress.getLimitKey()) { + progress = loadingProgress.getLimitKey(); + loadingProgress.release(); + return progress; + } else { + progress += STEP; + return progress; + } + } + + private String getLoadingText() { + + return loadingProgress.getLimitText(); + } + + + private boolean isRunning() { + + return RUNNING.get(); + } + + + private void shutdown(ScheduledExecutorService scheduler) { + + //停止运行 + RUNNING.compareAndSet(true, false); + reset(); + scheduler.shutdown(); + } + + private void reset() { + + this.progress = 0; + this.loadingProgress.reset(); + this.progressBar.setVisible(false); + this.progressBar.dispose(); + this.progressBar = null; + } + + private void updateUI() { + String text = getLoadingText(); + int value = incrementProgress(); + UIUtil.invokeLaterIfNeeded(new Runnable() { + @Override + public void run() { + if (!progressBar.isVisible()) { + progressBar.setVisible(true); + } + progressBar.updateLoadingText(text); + progressBar.setProgressValue(value); + } + }); + } + + private static class LimitProgress { + + private int limitKey = 0; + + private String limitText = StringUtils.EMPTY; + + private FutureTask lock; + + public void lock(int key, String loadingText) { + + this.limitKey = key; + this.limitText = loadingText; + this.lock = new FutureTask<>(new Callable() { + @Override + public Void call() throws Exception { + return null; + } + }); + } + + public void release() { + + this.lock.run(); + } + + public void get() throws Exception { + + this.lock.get(); + } + + public void reset() { + + this.limitKey = 0; + this.limitText = StringUtils.EMPTY; + //防止卡住。 + this.lock.run(); + } + + public int getLimitKey() { + return limitKey; + } + + public String getLimitText() { + return limitText; + } + + + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/SortPopupMenuItem.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/SortPopupMenuItem.java new file mode 100644 index 000000000..2b3c5703c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/SortPopupMenuItem.java @@ -0,0 +1,104 @@ +package com.fr.design.mainframe.share.ui.base; + +import com.fr.design.constants.UIConstants; +import com.fr.design.utils.gui.GUIPaintUtils; +import com.fr.stable.Constants; +import com.fr.stable.StringUtils; +import sun.swing.SwingUtilities2; + +import javax.swing.Action; +import javax.swing.ButtonModel; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.UIManager; +import javax.swing.plaf.basic.BasicMenuItemUI; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; + +/** + * Created by kerry on 2020-06-30 + */ +public class SortPopupMenuItem extends JMenuItem { + + + public SortPopupMenuItem(Action action) { + super(StringUtils.EMPTY, null); + setBackground(UIConstants.DEFAULT_BG_RULER); + setAction(action); + setUI(new SortPopupMenuItemUI()); + this.setPreferredSize(new Dimension(60, 21)); + } + + @Override + public String getText() { + return StringUtils.EMPTY + super.getText(); + } + + + private class SortPopupMenuItemUI extends BasicMenuItemUI { + + @Override + protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { + if (menuItem.getIcon() == null) { + super.paintBackground(g, menuItem, bgColor); + return; + } + ButtonModel model = menuItem.getModel(); + Color oldColor = g.getColor(); + int menuWidth = menuItem.getWidth(); + int menuHeight = menuItem.getHeight(); + + g.setColor(UIConstants.DEFAULT_BG_RULER); + g.fillRect(0, 0, menuWidth, menuHeight); + if (menuItem.isOpaque()) { + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + } else { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); + } + g.setColor(oldColor); + } else if (model.isArmed() || (menuItem instanceof JMenu && + model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + g.setColor(oldColor); + } + } + + protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { + ButtonModel model = menuItem.getModel(); + FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); + int mnemIndex = menuItem.getDisplayedMnemonicIndex(); + + if (!model.isEnabled()) { + // *** paint the text disabled + if (UIManager.get("MenuItem.disabledForeground") instanceof Color) { + g.setColor(UIManager.getColor("MenuItem.disabledForeground")); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + } else { + g.setColor(menuItem.getBackground().brighter()); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + g.setColor(menuItem.getBackground().darker()); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x - 1, textRect.y + + fm.getAscent() - 1); + } + } else { + // *** paint the text normally + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + g.setColor(Color.WHITE); // Uses protected field. + } + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + } + } + + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ui/PlaceHolderUI.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ui/PlaceHolderUI.java new file mode 100644 index 000000000..5c4c39eae --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ui/PlaceHolderUI.java @@ -0,0 +1,48 @@ +package com.fr.design.mainframe.share.ui.base.ui; + +import javax.swing.JComponent; +import javax.swing.plaf.ComponentUI; +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.RenderingHints; + +/** + * created by Harrison on 2020/04/22 + **/ +public abstract class PlaceHolderUI extends ComponentUI { + + private static final Color DEFAULT_COLOR = new Color(143, 142, 139); + + private String placeholder; + + + public PlaceHolderUI(String placeholder) { + this.placeholder = placeholder; + } + + @Override + public void paint(Graphics pG, JComponent c) { + @SuppressWarnings("unchecked") T realType = (T) c; + if (placeholder.length() == 0 || validate(realType)) { + return; + } + final Graphics2D g = (Graphics2D) pG; + g.setRenderingHint( + RenderingHints.KEY_ANTIALIASING, + RenderingHints.VALUE_ANTIALIAS_ON); + g.setColor(getDisabledTextColor()); + g.drawString(placeholder, c.getInsets().left + 10, pG.getFontMetrics() + .getMaxAscent() + c.getInsets().top + 3); + + } + + + protected abstract boolean validate(T t); + + protected Color getDisabledTextColor() { + + return DEFAULT_COLOR; + }; + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ui/SharePopupMenuItemUI.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ui/SharePopupMenuItemUI.java new file mode 100644 index 000000000..16a5a58bd --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/base/ui/SharePopupMenuItemUI.java @@ -0,0 +1,82 @@ +package com.fr.design.mainframe.share.ui.base.ui; + +import com.fr.design.constants.UIConstants; +import com.fr.design.utils.gui.GUIPaintUtils; +import com.fr.stable.Constants; +import sun.swing.SwingUtilities2; + +import javax.swing.ButtonModel; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.UIManager; +import javax.swing.plaf.basic.BasicMenuItemUI; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; + +/** + * @Author: Yuan.Wang + * @Date: 2020/10/30 + */ +public class SharePopupMenuItemUI extends BasicMenuItemUI { + + @Override + protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { + if (menuItem.getIcon() == null) { + super.paintBackground(g, menuItem, bgColor); + return; + } + ButtonModel model = menuItem.getModel(); + Color oldColor = g.getColor(); + int menuWidth = menuItem.getWidth(); + int menuHeight = menuItem.getHeight(); + + g.setColor(UIConstants.DEFAULT_BG_RULER); + g.fillRect(0, 0, menuWidth, menuHeight); + if (menuItem.isOpaque()) { + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + } else { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); + } + g.setColor(oldColor); + } else if (model.isArmed() || (menuItem instanceof JMenu && + model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + g.setColor(oldColor); + } + } + + protected void paintText(Graphics g, JMenuItem menuItem, Rectangle textRect, String text) { + ButtonModel model = menuItem.getModel(); + FontMetrics fm = SwingUtilities2.getFontMetrics(menuItem, g); + + if (!model.isEnabled()) { + // *** paint the text disabled + if (UIManager.get("MenuItem.disabledForeground") instanceof Color) { + g.setColor(UIManager.getColor("MenuItem.disabledForeground")); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + } else { + g.setColor(menuItem.getBackground().brighter()); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + g.setColor(menuItem.getBackground().darker()); + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x - 1, textRect.y + + fm.getAscent() - 1); + } + } else { + g.setColor(Color.BLACK); + // *** paint the text normally + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + g.setColor(Color.WHITE); // Uses protected field. + } + + SwingUtilities2.drawStringUnderlineCharAt(menuItem, g, text, + -1, textRect.x, textRect.y + fm.getAscent()); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java new file mode 100644 index 000000000..06e513b80 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java @@ -0,0 +1,94 @@ +package com.fr.design.mainframe.share.ui.block; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.share.ui.online.OnlineResourceManager; +import com.fr.design.mainframe.share.ui.online.OnlineWidgetSelectPane; +import com.fr.design.mainframe.share.ui.online.ResourceLoader; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.constants.ShareComponentConstants; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.EncodeConstants; +import com.fr.third.springframework.web.util.UriUtils; +import org.jetbrains.annotations.NotNull; + +import javax.imageio.ImageIO; +import javax.swing.ImageIcon; +import java.awt.Dimension; +import java.awt.Image; +import java.io.IOException; +import java.net.URL; + +/** + * Created by kerry on 2020-11-22 + */ +public abstract class AbstractOnlineWidgetBlock extends PreviewWidgetBlock implements ResourceLoader { + + private final OnlineWidgetSelectPane parentPane; + private UILabel coverLabel; + + public AbstractOnlineWidgetBlock(OnlineShareWidget widget, OnlineWidgetSelectPane parentPane) { + super(widget); + this.parentPane = parentPane; + } + + protected UILabel initCoverLabel(Image image) { + coverLabel = new UILabel(new ImageIcon(image)); + return coverLabel; + } + + @Override + protected String getWidgetUuid() { + return widget.getUuid(); + } + + protected void showPreview(OnlineShareWidget widget) { + parentPane.showPreviewPane(this, widget.getId()); + } + + protected void hidePreview() { + parentPane.hidePreviewPane(); + } + + @Override + @NotNull + protected Image getCoverImage() { + OnlineResourceManager.getInstance().addLoader(this); + return getDefaultDisplayImage(); + } + + public Image getPreviewImage() { + try { + return ImageIO.read(new URL(UriUtils.encodePath(widget.getPicPath(), EncodeConstants.ENCODING_UTF_8))); + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return getDefaultDisplayImage(); + } + } + + public void load() { + Image image; + try { + + Dimension coverDimension = getCoverDimension(); + String previewURI = UriUtils.encodePath(widget.getPicPath(), EncodeConstants.ENCODING_UTF_8) + "?x-oss-process=image/resize,m_fixed," + "w_" + coverDimension.width + + ",h_" + coverDimension.height; + image = ImageIO.read(new URL(previewURI)); + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + image = getDefaultDisplayImage(); + } + resetCover(image); + } + + private Image getDefaultDisplayImage(){ + return ShareComponentConstants.DEFAULT_COVER; + } + + + public void resetCover(Image image) { + coverLabel.setIcon(new ImageIcon(image)); + this.parentPane.validate(); + this.parentPane.repaint(); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/DragAndDropDragGestureListener.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/DragAndDropDragGestureListener.java new file mode 100644 index 000000000..3fe0fc388 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/DragAndDropDragGestureListener.java @@ -0,0 +1,72 @@ +package com.fr.design.mainframe.share.ui.block; + +import com.fr.form.share.utils.ShareUtils; +import com.fr.form.ui.Widget; +import com.fr.general.ComparatorUtils; +import org.jetbrains.annotations.NotNull; + +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.Transferable; +import java.awt.dnd.DragGestureEvent; +import java.awt.dnd.DragGestureListener; +import java.awt.dnd.DragSource; +import java.awt.dnd.DragSourceAdapter; +import java.awt.dnd.DragSourceDragEvent; + +/** + * @Author: Yuan.Wang + * @Date: 2021/1/15 + */ +public class DragAndDropDragGestureListener extends DragSourceAdapter implements DragGestureListener { + private final PreviewWidgetBlock block; + + public DragAndDropDragGestureListener(PreviewWidgetBlock tt, int actions) { + block = tt; + DragSource source = new DragSource(); + source.createDefaultDragGestureRecognizer(tt, actions, this); + } + + public void dragGestureRecognized(DragGestureEvent dge) { + PreviewWidgetBlock onlineWidgetBlock = (PreviewWidgetBlock) dge.getComponent(); + if (onlineWidgetBlock != null) { + String uuid = block.getWidgetUuid(); + Widget widget = ShareUtils.getElCaseEditorById(uuid); + if (widget != null) { + DragAndDropTransferable dragAndDropTransferable = new DragAndDropTransferable(widget); + dge.startDrag(DragSource.DefaultCopyDrop, dragAndDropTransferable, this); + } + } + } + + @Override + public void dragEnter(DragSourceDragEvent dragSourceDragEvent) { + + } + + private static class DragAndDropTransferable implements Transferable { + private final Widget widget; + + public DragAndDropTransferable(Widget widget) { + this.widget = widget; + } + + DataFlavor[] flavors = {new DataFlavor(Widget.class, "Widget")}; + + public DataFlavor[] getTransferDataFlavors() { + return flavors; + } + + public boolean isDataFlavorSupported(DataFlavor flavor) { + for (DataFlavor df : flavors) { + if (ComparatorUtils.equals(df, flavor)) { + return true; + } + } + return false; + } + @NotNull + public Object getTransferData(DataFlavor df) { + return widget; + } + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java new file mode 100644 index 000000000..911ff7b77 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java @@ -0,0 +1,315 @@ +package com.fr.design.mainframe.share.ui.block; + +import com.fr.base.GraphHelper; +import com.fr.base.iofile.attr.SharableAttrMark; +import com.fr.design.actions.UpdateAction; +import com.fr.design.base.mode.DesignModeContext; +import com.fr.design.constants.UIConstants; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.WidgetToolBarPane; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.group.ui.GroupMoveDialog; +import com.fr.design.mainframe.share.ui.base.PopupMenuItem; +import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; +import com.fr.design.mainframe.share.ui.local.LocalWidgetSelectPane; +import com.fr.design.mainframe.share.ui.local.WidgetSelectedManager; +import com.fr.design.mainframe.share.util.ShareComponentUtils; +import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.constants.ShareComponentConstants; +import com.fr.form.share.Group; +import com.fr.form.share.record.ShareWidgetInfoManager; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.Widget; +import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; +import com.fr.stable.Constants; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.dnd.DnDConstants; +import java.awt.event.ActionEvent; +import java.awt.event.MouseEvent; +import java.util.UUID; + +/** + * created by Harrison on 2020/06/12 + * 本地组件块 + **/ +public class LocalWidgetBlock extends PreviewWidgetBlock { + private static final int MARK_START_X = 83; + + private boolean mouseHover = false; + private final LocalWidgetSelectPane parentPane; + + private MouseEvent lastPressEvent; + private boolean isEdit; + private boolean isMarked; + private boolean pressed; + private boolean hover; + private final Icon markedMode = IOUtils.readIcon("/com/fr/base/images/share/marked.png"); + private final Icon unMarkedMode = IOUtils.readIcon("/com/fr/base/images/share/unmarked.png"); + + public LocalWidgetBlock(DefaultSharableWidget provider, LocalWidgetSelectPane parentPane) { + super(provider); + this.parentPane = parentPane; + new DragAndDropDragGestureListener(this, DnDConstants.ACTION_COPY_OR_MOVE); + initUI(); + } + + + private void initUI() { + JPanel labelPane = new JPanel(new BorderLayout()); + UILabel label = new UILabel(this.getBindInfo().getName(), UILabel.CENTER); + label.setPreferredSize(new Dimension(ShareComponentConstants.SHARE_THUMB_WIDTH, ShareComponentConstants.SHARE_BLOCK_LABEL_HEIGHT)); + labelPane.setBackground(Color.WHITE); + labelPane.add(label, BorderLayout.CENTER); + this.add(labelPane, BorderLayout.SOUTH); + } + + public void setElementCaseEdit(boolean isEdit) { + this.isEdit = isEdit; + if (isEdit) { + isMarked = WidgetSelectedManager.getInstance().isSelected(getGroup().getGroupName(), this.getWidget().getId()); + } + repaint(); + } + + public String getFileName() { + //插件里面, 所有的值都是插件值。可以强转的。 + DefaultSharableWidget provider = (DefaultSharableWidget) getBindInfo(); + return provider.getFileName(); + } + + public SharableWidgetProvider getBindInfo() { + return this.getWidget(); + } + + @Override + protected void showPreview(DefaultSharableWidget widget) { + this.parentPane.showPreviewPane(this, widget.getId()); + } + + @Override + protected void hidePreview() { + this.parentPane.hidePreviewPane(); + } + + @Override + @NotNull + public Image getCoverImage() { + return this.getWidget().getCover(); + } + + @Override + protected String getWidgetUuid() { + return widget.getId(); + } + + @Nullable + public Image getPreviewImage() { + String id = this.getWidget().getId(); + return getGroup().getPreviewImage(id); + } + + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + if (e.getButton() == MouseEvent.BUTTON3 && !isEdit) { + this.parentPane.hidePreviewPane(); + UIPopupMenu popupMenu = new UIPopupMenu(); + popupMenu.setOnlyText(true); + popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER); + popupMenu.add(new PopupMenuItem(new MoveGroupAction())); + popupMenu.add(new PopupMenuItem(new RemoveAction())); + GUICoreUtils.showPopupMenu(popupMenu, this, e.getX(), e.getY()); + } + + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + lastPressEvent = e; + pressed = true; + } + + @Override + public void mouseReleased(MouseEvent e) { + super.mouseReleased(e); + if (pressed && hover) { + dealClickAction(e); + } + pressed = false; + } + + @Override + public void mouseMoved(MouseEvent e) { + super.mouseMoved(e); + this.mouseHover = true; + if (!isEdit) { + setCursor(new Cursor(Cursor.MOVE_CURSOR)); + } + this.repaint(); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + hover = true; + } + + @Override + public void mouseExited(MouseEvent e) { + super.mouseExited(e); + this.mouseHover = false; + setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); + hover = false; + this.repaint(); + } + + + @Override + public void mouseDragged(MouseEvent e) { + if (DesignModeContext.isAuthorityEditing() || lastPressEvent == null || isEdit) { + return; + } + hidePreview(); + ComponentCollector.getInstance().collectPopupJump(); + Object source = e.getSource(); + Widget creatorSource; + String shareId; + if (source instanceof LocalWidgetBlock) { + LocalWidgetBlock no = (LocalWidgetBlock) e.getSource(); + if (no == null) { + return; + } + shareId = no.getBindInfo().getId(); + creatorSource = getGroup().getElCaseEditorById(shareId); + if (creatorSource == null) { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info")); + return; + } + creatorSource.setWidgetID(UUID.randomUUID().toString()); + ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); + //tab布局WCardMainBorderLayout通过反射出来的大小是960*480 + XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, no.getBindInfo()); + WidgetToolBarPane.getTarget().startDraggingBean(xCreator); + lastPressEvent = null; + this.setBorder(null); + } + } + + @Override + public void paint(Graphics g) { + super.paint(g); + //绘制删除标志 + if (isEdit) { + Icon icon = isMarked ? markedMode : unMarkedMode; + icon.paintIcon(this, g, MARK_START_X, 0); + } + if (ComparatorUtils.equals(this, this.parentPane.getSelectedBlock()) || this.mouseHover) { + g.setColor(XCreatorConstants.FORM_BORDER_COLOR); + Rectangle rectangle = new Rectangle(); + rectangle.width = this.getWidth(); + rectangle.height = this.getHeight(); + GraphHelper.draw(g, rectangle, Constants.LINE_LARGE); + } + } + + /** + * 由鼠标释放时调用该方法来触发左键点击事件 + */ + private void dealClickAction(MouseEvent e) { + this.parentPane.setSelectBlock(this); + if (e.getButton() == MouseEvent.BUTTON1) { + if (isEdit) { + if (isMarked) { + WidgetSelectedManager.getInstance().removeSelect(getGroup().getGroupName(), this.getWidget().getId()); + isMarked = false; + } else { + WidgetSelectedManager.getInstance().addSelect(getGroup().getGroupName(), this.getWidget().getId()); + isMarked = true; + } + } + //没有组件被选择则禁用按钮 + LocalWidgetRepoPane.getInstance().setManageButtonEnable(hasComponentSelected()); + repaint(); + } + } + + private Group getGroup() { + return parentPane.getGroup(); + } + + private boolean hasComponentSelected() { + return !WidgetSelectedManager.getInstance().isSelectEmpty(); + } + + private class MoveGroupAction extends UpdateAction { + public MoveGroupAction() { + this.putValue(Action.SMALL_ICON, null); + this.setName(Toolkit.i18nText("Fine-Design_Share_Group_Move")); + } + + @Override + public void actionPerformed(ActionEvent e) { + new GroupMoveDialog(DesignerContext.getDesignerFrame()) { + @Override + protected void confirmClose() { + this.dispose(); + Group group = (Group) getSelectGroupBox().getSelectedItem(); + assert group != null; + if (WidgetSelectedManager.getInstance().moveSelect(getGroup().getGroupName(), group.getGroupName(), getWidget().getId())) { + ShareWidgetInfoManager.getInstance().saveXmlInfo(); + LocalWidgetRepoPane.getInstance().refreshShowPanel(false); + } else { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Group_Move_Fail_Message")); + } + } + + }; + } + } + + private class RemoveAction extends UpdateAction { + public RemoveAction() { + this.putValue(Action.SMALL_ICON, null); + this.setName(Toolkit.i18nText("Fine-Design_Share_Remove")); + } + + @Override + public void actionPerformed(ActionEvent e) { + int rv = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Share_Remove_Info"), + Toolkit.i18nText("Fine-Design_Share_Group_Confirm"), + FineJOptionPane.YES_NO_OPTION + ); + if (rv == FineJOptionPane.YES_OPTION) { + if (!WidgetSelectedManager.getInstance().unInstallSelect(getGroup().getGroupName(), getWidget().getId())) { + FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Share_Remove_Failure")); + } + LocalWidgetRepoPane.getInstance().refreshShowPanel(getGroup()); + } + } + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java new file mode 100644 index 000000000..b8cb0e678 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -0,0 +1,305 @@ +package com.fr.design.mainframe.share.ui.block; + +import com.fr.base.iofile.attr.SharableAttrMark; +import com.fr.design.DesignerEnvManager; +import com.fr.design.base.mode.DesignModeContext; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.form.util.XCreatorConstants; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.login.DesignerLoginHelper; +import com.fr.design.login.DesignerLoginSource; +import com.fr.design.mainframe.WidgetToolBarPane; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.form.share.group.DefaultShareGroup; +import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; +import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; +import com.fr.design.mainframe.share.ui.online.OnlineWidgetSelectPane; +import com.fr.design.mainframe.share.util.DownloadUtils; +import com.fr.design.mainframe.share.util.ShareComponentUtils; +import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.design.ui.util.UIUtil; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.constants.ShareComponentConstants; +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; +import com.fr.form.share.utils.ShareUtils; +import com.fr.form.ui.AbstractBorderStyleWidget; +import com.fr.form.ui.Widget; +import com.fr.general.IOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; + +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import javax.swing.SwingWorker; +import java.awt.AlphaComposite; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Stroke; +import java.awt.dnd.DnDConstants; +import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.util.UUID; +import java.util.concurrent.ExecutionException; + +/** + * Created by kerry on 2020-10-19 + * 商城组件块 + */ +public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { + private boolean isMouseEnter = false; + private boolean downloading = false; + private static final Color COVER_COLOR = Color.decode("#333334"); + protected MouseEvent lastPressEvent; + private double process = 0D; + private static final BufferedImage WIDGET_INSTALLED_ICON = IOUtils.readImage("/com/fr/base/images/share/widget_installed.png"); + private static final BufferedImage WIDGET_DOWNLOAD_ICON = IOUtils.readImage("/com/fr/base/images/share/download.png"); + private static final BufferedImage WIDGET_DOWNLOADING_ICON = IOUtils.readImage("/com/fr/base/images/share/downloading.png"); + + public OnlineWidgetBlock(OnlineShareWidget widget, OnlineWidgetSelectPane parentPane) { + super(widget, parentPane); + this.add(createSouthPane(widget), BorderLayout.SOUTH); + new DragAndDropDragGestureListener(this, DnDConstants.ACTION_COPY_OR_MOVE); + } + + protected JPanel createSouthPane(OnlineShareWidget widget) { + JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel label = new UILabel(widget.getName(), UILabel.CENTER); + label.setToolTipText(widget.getName()); + label.setHorizontalTextPosition(SwingConstants.LEFT); + southPane.add(label, BorderLayout.CENTER); + UILabel emptyLabel = new UILabel(); + emptyLabel.setPreferredSize(new Dimension(25, 20)); + southPane.add(emptyLabel, BorderLayout.EAST); + southPane.setBackground(Color.WHITE); + return southPane; + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + this.isMouseEnter = true; + this.repaint(); + } + + @Override + public void mouseExited(MouseEvent e) { + super.mouseExited(e); + this.isMouseEnter = false; + this.repaint(); + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + this.lastPressEvent = e; + } + + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + if (!checkWidgetInstalled() && getDownloadIconRec().contains(e.getX(), e.getY())) { + downLoadWidget(); + } + } + + @Override + public void mouseDragged(MouseEvent e) { + if (DesignModeContext.isAuthorityEditing() || !checkWidgetInstalled()) { + return; + } + if (lastPressEvent == null) { + return; + } + ComponentCollector.getInstance().collectPopupJump(); + Object source = e.getSource(); + Widget creatorSource; + String shareId; + if (source instanceof OnlineWidgetBlock) { + OnlineWidgetBlock no = (OnlineWidgetBlock) e.getSource(); + if (no == null) { + return; + } + shareId = widget.getUuid(); + creatorSource = ShareUtils.getElCaseEditorById(shareId); + if (creatorSource == null) { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info")); + return; + } + creatorSource.setWidgetID(UUID.randomUUID().toString()); + ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); + SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(shareId); + //tab布局WCardMainBorderLayout通过反射出来的大小是960*480 + XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, bindInfo); + WidgetToolBarPane.getTarget().startDraggingBean(xCreator); + lastPressEvent = null; + this.setBorder(null); + } + } + + private void downLoadWidget() { + if (OnlineWidgetRepoPane.getInstance().isShowPackagePanel()) { + ComponentCollector.getInstance().collectDownloadPktNum(); + } + final WidgetDownloadProcess process = new WidgetDownloadProcess(); + downloading = true; + process.process(0.0D); + String userName = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); + if (StringUtils.isEmpty(userName)) { + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.NORMAL); + downloading = false; + return; + } + + new SwingWorker() { + + @Override + protected Boolean doInBackground() { + String filePath; + try { + filePath = DownloadUtils.download(widget.getId(), widget.getName() + "." + widget.getUuid(), process); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return false; + } + ShareComponentUtils.checkReadMe(); + //安装 + File file = new File(filePath); + try { + if (file.exists() && getDefaultGroup().installModule(file)) { + ShareUtils.recordInstallTime(file.getName(), System.currentTimeMillis()); + ComponentCollector.getInstance().collectCmpDownLoad(widget.getUuid()); + } + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } finally { + //删掉下载组件的目录 + StableUtils.deleteFile(file); + } + return true; + + } + + @Override + protected void done() { + downloading = false; + OnlineWidgetBlock.this.process = 0.0D; + try { + if (get()) { + LocalWidgetRepoPane.getInstance().refreshShowPanel(); + } else { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Download_Failed")); + } + } catch (InterruptedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); + } catch (ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }.execute(); + + + } + + + @Override + public void mouseMoved(MouseEvent e) { + super.mouseMoved(e); + if (checkWidgetInstalled()) { + this.setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); + } else if (getDownloadIconRec().contains(e.getX(), e.getY())) { + this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } else { + this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + } + + private Rectangle getDownloadIconRec() { + return new Rectangle(ShareComponentConstants.SHARE_THUMB_WIDTH / 2 - 12, ShareComponentConstants.SHARE_BLOCK_HEIGHT / 2 - 16, 24, 24); + } + + private boolean checkWidgetInstalled() { + return ShareUtils.getElCaseBindInfoById(widget.getUuid()) != null; + } + + private Group getDefaultGroup() { + return DefaultShareGroupManager.getInstance().getGroup(DefaultShareGroup.GROUP_NAME); + } + + public void paint(Graphics g) { + super.paint(g); + ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); + int x = 0; + int y = 0; + int w = getWidth(); + int h = getHeight(); + if (process == 1 || checkWidgetInstalled()) { + Graphics2D g2d = (Graphics2D) g; + g2d.drawImage( + WIDGET_INSTALLED_ICON, + w - 20, + h - 20, + WIDGET_INSTALLED_ICON.getWidth(), + WIDGET_INSTALLED_ICON.getHeight(), + null, + this + ); + return; + } + //如果鼠标移动到布局内且布局不可编辑,画出编辑蒙层 + if (isMouseEnter || downloading) { + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + //画白色的编辑层 + g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 20 / 100.0F)); + g2d.setColor(COVER_COLOR); + g2d.fillRect(x, y, w, h); + g2d.setComposite(oldComposite); + //画编辑按钮图标 + BufferedImage image = (process > 0 || downloading) ? WIDGET_DOWNLOADING_ICON : WIDGET_DOWNLOAD_ICON; + g2d.drawImage( + image, + (x + w / 2 - 12), + (y + h / 2 - 16), + image.getWidth(), + image.getHeight(), + null, + this + ); + Stroke oldStroke = g2d.getStroke(); + g2d.setStroke(XCreatorConstants.STROKE); + g2d.setColor(Color.decode("#419BF9")); + double arcAngle = downloading ? (36 + 360 * 0.9 * process) : 0.0; + g2d.drawArc(x + w / 2 - 12, y + h / 2 - 16, 24, 24, 90, -(int) arcAngle); + g2d.setColor(Color.WHITE); + g2d.setStroke(oldStroke); + } + } + + + class WidgetDownloadProcess implements com.fr.design.extra.Process { + + @Override + public void process(Double aDouble) { + OnlineWidgetBlock.this.process = aDouble; + final Dimension dimension = OnlineWidgetBlock.this.getSize(); + UIUtil.invokeAndWaitIfNeeded(() -> OnlineWidgetBlock.this.paintImmediately(0, 0, dimension.width, dimension.height)); + } + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetPackageBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetPackageBlock.java new file mode 100644 index 000000000..4b8458594 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetPackageBlock.java @@ -0,0 +1,57 @@ +package com.fr.design.mainframe.share.ui.block; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.design.mainframe.share.ui.online.widgetpackage.OnlineWidgetPackageSelectPane; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.constants.ShareComponentConstants; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.event.MouseEvent; + +/** + * Created by kerry on 2020-10-21 + * 商城组件包块 + */ +public class OnlineWidgetPackageBlock extends AbstractOnlineWidgetBlock { + private static final int IMAGE_HEIGHT = 167; + private static final Color TEXT_COLOR = Color.decode("#419BF9"); + + protected JPanel createSouthPane(final OnlineShareWidget widget, final OnlineWidgetPackageSelectPane parentPane) { + JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + southPane.setBackground(Color.WHITE); + UILabel label = new UILabel(widget.getName(), UILabel.CENTER); + label.setToolTipText(widget.getName()); + southPane.add(label, BorderLayout.CENTER); + UILabel detailLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Online_Package_Detail")); + detailLabel.setForeground(TEXT_COLOR); + detailLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + detailLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + parentPane.showWidgetDetailPane(widget.getId()); + } + }); + southPane.add(detailLabel, BorderLayout.EAST); + return southPane; + } + + protected Dimension getCoverDimension() { + return new Dimension(ShareComponentConstants.SHARE_PACKAGE_BLOCK_WIDTH, IMAGE_HEIGHT); + } + + public OnlineWidgetPackageBlock(OnlineShareWidget widget, OnlineWidgetPackageSelectPane parentPane) { + super(widget, parentPane); + this.setPreferredSize(new Dimension(ShareComponentConstants.SHARE_PACKAGE_BLOCK_WIDTH, ShareComponentConstants.SHARE_PACKAGE_BLOCK_HEIGHT)); + this.add(createSouthPane(widget, parentPane), BorderLayout.SOUTH); + } + +} + + diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java new file mode 100644 index 000000000..8ad9e2b11 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java @@ -0,0 +1,138 @@ +package com.fr.design.mainframe.share.ui.block; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.share.constants.ShareComponentConstants; +import org.jetbrains.annotations.NotNull; + +import javax.swing.ImageIcon; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.io.Serializable; + +/** + * Created by kerry on 2020-10-21 + */ +public abstract class PreviewWidgetBlock extends JPanel implements MouseListener, MouseMotionListener, Serializable { + protected T widget; + private boolean showing = false; + + public PreviewWidgetBlock(T widget) { + this.widget = widget; + initPane(); + this.addMouseListener(this); + this.addMouseMotionListener(this); + } + + protected void initPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setPreferredSize(new Dimension(ShareComponentConstants.SHARE_THUMB_WIDTH, ShareComponentConstants.SHARE_BLOCK_HEIGHT)); + JPanel labelPane = new JPanel(new BorderLayout()); + Image image = getCoverImage(); + labelPane.add(initCoverLabel(image)); + labelPane.setBackground(Color.WHITE); + this.add(labelPane, BorderLayout.CENTER); + } + + protected UILabel initCoverLabel(Image image) { + return new UILabel(new ImageIcon(image)); + } + + public T getWidget() { + return widget; + } + + + @NotNull + protected abstract Image getCoverImage(); + + protected Dimension getCoverDimension() { + return new Dimension(ShareComponentConstants.SHARE_THUMB_WIDTH, ShareComponentConstants.SHARE_THUMB_HEIGHT); + } + + private void showPreviewPane() { + synchronized (this) { + if (!showing) { + showPreview(widget); + showing = true; + } + } + } + protected abstract String getWidgetUuid(); + + protected abstract void showPreview(T widget); + + protected abstract void hidePreview(); + + private void hidePreviewPane() { + if (showing) { + hidePreview(); + showing = false; + } + } + + public abstract Image getPreviewImage(); + + @Override + public void mouseClicked(MouseEvent e) { + this.hidePreviewPane(); + } + + @Override + public void mousePressed(MouseEvent e) { + + } + + @Override + public void mouseReleased(MouseEvent e) { + + } + + @Override + public void mouseEntered(MouseEvent e) { + + } + + @Override + public void mouseExited(MouseEvent e) { + this.hidePreviewPane(); + } + + @Override + public void mouseDragged(MouseEvent e) { + + } + + @Override + public void mouseMoved(MouseEvent e) { + Dimension dimension = getCoverDimension(); + Rectangle containerRec = new Rectangle(0, 0, dimension.width, dimension.height); + if (containerRec.contains(e.getX(), e.getY())) { + this.showPreviewPane(); + } else { + this.hidePreviewPane(); + } + } + + @Override + public void paint(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + g2d.setColor(Color.WHITE); + g2d.fillRect(0, 0, getWidth(), getHeight()); + super.paint(g); + } + + protected void removeListener() { + this.removeMouseListener(this); + this.removeMouseMotionListener(this); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/SimpleWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/SimpleWidgetBlock.java new file mode 100644 index 000000000..cf5e948de --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/SimpleWidgetBlock.java @@ -0,0 +1,17 @@ +package com.fr.design.mainframe.share.ui.block; + +import com.fr.design.mainframe.share.ui.online.OnlineWidgetSelectPane; +import com.fr.form.share.bean.OnlineShareWidget; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/22 + * 只能显示,无其他功能的组件块 + */ +public class SimpleWidgetBlock extends OnlineWidgetBlock { + public SimpleWidgetBlock(OnlineShareWidget widget, OnlineWidgetSelectPane parentPane) { + super(widget, parentPane); + this.removeListener(); + this.setFocusable(false); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java new file mode 100644 index 000000000..05507a786 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java @@ -0,0 +1,386 @@ +package com.fr.design.mainframe.share.ui.local; + +import com.fr.design.actions.UpdateAction; +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.share.group.ui.GroupFileDialog; +import com.fr.design.mainframe.share.sort.SortType; +import com.fr.design.mainframe.share.sort.WidgetSortType; +import com.fr.design.mainframe.share.ui.base.PopupMenuItem; +import com.fr.design.mainframe.share.ui.widgetfilter.LocalWidgetFilter; +import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; +import com.fr.form.share.record.ShareWidgetInfoManager; +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; + +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author: Yuan.Wang + * @Date: 2020/11/5 + */ +class GroupPane extends JPanel { + private static final Icon downIcon = IOUtils.readIcon("/com/fr/base/images/share/arrow_down.png"); + private static final Icon rightIcon = IOUtils.readIcon("/com/fr/base/images/share/arrow_right.png"); + private static final int DEFAULT_HEIGHT = 24; + private final Group group; + private LocalWidgetSelectPane contentPanel; + private UIHeaderPane headerPanel; + private final int headHeight; + //是否展开 + private boolean expendStatus; + private SharableWidgetProvider[] elCaseBindInfoList; + private SortType sortType = WidgetSortType.INSTALL_TIME; + + private GroupPane(Group group) { + this(group, DEFAULT_HEIGHT, group.isDefaultExpend()); + } + + private GroupPane(Group group, boolean expendStatus) { + this(group, DEFAULT_HEIGHT, expendStatus); + } + + private GroupPane(Group group, int headHeight, boolean expendStatus) { + this.group = group; + this.headHeight = headHeight; + this.expendStatus = expendStatus; + initComponents(); + } + + public boolean isComponentEditable() { + return LocalWidgetRepoPane.getInstance().isEditable(); + } + + private void initComponents() { + this.setLayout(new BorderLayout()); + this.setOpaque(false); + + headerPanel = new UIHeaderPane(group.getGroupName(), headHeight); + JPanel head = new JPanel(new BorderLayout()); + head.add(headerPanel, BorderLayout.NORTH); + head.setPreferredSize(new Dimension(240, 24)); + this.add(head, BorderLayout.NORTH); + refreshShowPanel(); + } + + public void refreshShowPanel() { + this.setVisible(true); + refreshBindInfoList(); + + //按照筛选条件进行过滤 + elCaseBindInfoList = LocalWidgetFilter.getInstance().filter(elCaseBindInfoList); + boolean needExpendGroup = expendStatus || (isFiltering() && elCaseBindInfoList.length > 0); + if (elCaseBindInfoList.length == 0 && isFiltering()) { + this.setVisible(false); + } + + //刷新面板的时候可能还有查询条件,如果有的话走一遍查询的逻辑 + String keyWord = LocalWidgetRepoPane.getInstance().getKeyWord4Searching(); + if (StringUtils.isNotEmpty(keyWord)) { + searchByKeyword(keyWord); + return; + } + ShareWidgetInfoManager.getInstance().checkInstallCompInfo(elCaseBindInfoList); + sortType.sort(elCaseBindInfoList); + reCreateShowPane(elCaseBindInfoList); + expendGroup(needExpendGroup); + } + + public void reCreateShowPane(SharableWidgetProvider[] widgets) { + if (contentPanel != null) { + contentPanel.hidePreviewPane(); + GroupPane.this.remove(contentPanel); + } + contentPanel = new LocalWidgetSelectPane(group, widgets, isComponentEditable()); + GroupPane.this.add(contentPanel, BorderLayout.CENTER); + headerPanel.setMenuItemVisible(!isComponentEditable()); + validate(); + repaint(); + revalidate(); + } + + private void expendGroup(boolean expendStatus) { + headerPanel.showExpand(expendStatus); + contentPanel.setVisible(expendStatus); + } + + protected void setExpendStatus(boolean expendStatus) { + //在筛选或者搜索状态,调用这个方法直接返回 + if (isFiltering() || isSearching()) { + return; + } + this.expendStatus = expendStatus; + } + + public SharableWidgetProvider[] getAllBindInfoList() { + SharableWidgetProvider[] widgetProviders = group.getAllBindInfoList(); + if (widgetProviders == null) { + widgetProviders = new SharableWidgetProvider[0]; + } + sortType.sort(widgetProviders); + return widgetProviders; + } + + public void sortWidget(WidgetSortType sortType) { + this.sortType = sortType; + sortType.sort(elCaseBindInfoList); + reCreateShowPane(elCaseBindInfoList); + } + + public void searchByKeyword(String text) { + this.setVisible(true); + SharableWidgetProvider[] sharableWidgetArr = elCaseBindInfoList; + List widgets = new ArrayList<>(); + if (StringUtils.isNotEmpty(text)) { + for (SharableWidgetProvider provider : elCaseBindInfoList) { + if (provider.getName().toLowerCase().contains(text)) { + widgets.add(provider); + } + } + sharableWidgetArr = widgets.toArray(new SharableWidgetProvider[widgets.size()]); + } + + boolean needExpendGroup = expendStatus || (isSearching() && sharableWidgetArr.length > 0); + if (isSearching() && sharableWidgetArr.length == 0) { + setVisible(false); + } + reCreateShowPane(sharableWidgetArr); + expendGroup(needExpendGroup); + } + + public void refreshBindInfoList() { + elCaseBindInfoList = getAllBindInfoList(); + } + + private boolean isFiltering() { + return LocalWidgetRepoPane.getInstance().isFiltering(); + } + + private boolean isSearching() { + return LocalWidgetRepoPane.getInstance().isSearching(); + } + + private class UIHeaderPane extends JPanel { + private static final long serialVersionUID = 1L; + + private final UILabel arrow; + private final UILabel menuItem; + private final UILabel titleLabel; + private final int headHeight; + private boolean pressed; + private boolean hover; + + private final MouseAdapter mouseAdapter = new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (e.getButton() == MouseEvent.BUTTON3 && group.isEditable() && !GroupPane.this.isComponentEditable()) { + UIPopupMenu popupMenu = new UIPopupMenu(); + popupMenu.setOnlyText(true); + popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER); + popupMenu.add(new PopupMenuItem(new RenameAction())); + popupMenu.add(new PopupMenuItem(new RemoveAction())); + + GUICoreUtils.showPopupMenu(popupMenu, UIHeaderPane.this, e.getX(), e.getY()); + } + } + + @Override + public void mousePressed(MouseEvent e) { + pressed = true; + } + + @Override + public void mouseReleased(MouseEvent e) { + if (pressed && hover) { + dealClickAction(e); + } + pressed = false; + } + + @Override + public void mouseEntered(MouseEvent e) { + hover = true; + } + + @Override + public void mouseExited(MouseEvent e) { + hover = false; + } + }; + + public UIHeaderPane(String title, int headHeight) { + this.setLayout(new BorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(0, 10, 1, 2)); + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.setBackground(Color.decode("#EDEDEE")); + this.headHeight = headHeight; + arrow = new UILabel(downIcon); + arrow.setOpaque(false); + menuItem = createMenuItem(); + titleLabel = new UILabel(title); + titleLabel.setOpaque(false); + + JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); + leftPanel.add(arrow); + leftPanel.add(titleLabel); + leftPanel.setOpaque(false); + + panel.add(leftPanel, BorderLayout.CENTER); + + if (group.isEditable()) { + panel.add(menuItem, BorderLayout.EAST); + } + add(panel, BorderLayout.CENTER); + addListener(); + } + + public void showExpand(boolean expend) { + Icon showIcon = expend ? downIcon : rightIcon; + arrow.setIcon(showIcon); + } + + @Override + public Dimension getPreferredSize() { + return new Dimension(this.getWidth(), headHeight); + } + + @Override + public Dimension getSize() { + return new Dimension(this.getWidth(), headHeight); + } + + public UILabel createMenuItem() { + UILabel label = new UILabel(IOUtils.readIcon("/com/fr/base/images/share/menu_item.png")); + label.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + UIPopupMenu popupMenu = new UIPopupMenu(); + popupMenu.setOnlyText(true); + popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER); + popupMenu.add(new PopupMenuItem(new RenameAction())); + popupMenu.add(new PopupMenuItem(new RemoveAction())); + + GUICoreUtils.showPopupMenu(popupMenu, menuItem, 0, menuItem.getSize().height); + } + }); + label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); + label.setOpaque(false); + return label; + } + + protected void setMenuItemVisible(boolean visible) { + menuItem.setVisible(visible); + } + + private void addListener() { + this.addMouseListener(mouseAdapter); + } + + /** + * 由鼠标释放时调用该方法来触发左键点击事件 + */ + private void dealClickAction(MouseEvent e) { + if (e.getButton() == MouseEvent.BUTTON1) { + boolean isShow = contentPanel.isShowing(); + contentPanel.setVisible(!isShow); + GroupPane.this.setExpendStatus(!isShow); + showExpand(!isShow); + + getParent().validate(); + getParent().repaint(); + } + } + + private class RenameAction extends UpdateAction { + public RenameAction() { + this.putValue(Action.SMALL_ICON, null); + this.setName(Toolkit.i18nText("Fine-Design_Share_Group_Rename")); + } + + @Override + public void actionPerformed(ActionEvent e) { + new GroupFileDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Share_Group_Rename", group.getGroupName())) { + @Override + protected void confirmClose() { + this.dispose(); + String groupName = getFileName().replaceAll("[\\\\/:*?\"<>|]", StringUtils.EMPTY); + if (DefaultShareGroupManager.getInstance().renameGroup(group, groupName)) { + titleLabel.setText(groupName); + repaint(); + } else { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Group_Rename_Failure")); + } + } + + @Override + protected boolean isDuplicate(String fileName) { + return DefaultShareGroupManager.getInstance().exist(fileName); + } + }; + + } + } + + private class RemoveAction extends UpdateAction { + public RemoveAction() { + this.putValue(Action.SMALL_ICON, null); + this.setName(Toolkit.i18nText("Fine-Design_Share_Group_Remove")); + } + + @Override + public void actionPerformed(ActionEvent e) { + int rv = FineJOptionPane.showConfirmDialog( + DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Share_Group_Remove_Info"), + Toolkit.i18nText("Fine-Design_Share_Group_Confirm"), + FineJOptionPane.YES_NO_OPTION + ); + if (rv == FineJOptionPane.YES_OPTION) { + if (DefaultShareGroupManager.getInstance().removeGroup(group)) { + LocalWidgetRepoPane.getInstance().removeGroup(group.getGroupName()); + } else { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Group_Remove_Failure")); + } + } + } + } + } + + public enum GroupCreateStrategy { + DEFAULT { + @Override + public GroupPane creteGroupPane(Group group) { + return new GroupPane(group); + } + }, + CLOSURE { + @Override + public GroupPane creteGroupPane(Group group) { + return new GroupPane(group, false); + } + }; + + abstract public GroupPane creteGroupPane(Group group); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalPaneStatus.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalPaneStatus.java new file mode 100644 index 000000000..d56807245 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalPaneStatus.java @@ -0,0 +1,87 @@ +package com.fr.design.mainframe.share.ui.local; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.ui.base.LoadingPane; +import com.fr.design.mainframe.share.ui.base.NoMatchPane; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/1 + */ +enum LocalPaneStatus { + + //无匹配 + NO_MATCH { + @Override + public JPanel getPanel() { + return new NoMatchPane(); + } + }, + + //正常 + NORMAL { + @Override + public JPanel getPanel() { + return new JPanel(); + } + }, + + //空 + EMPTY { + @Override + public JPanel getPanel() { + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel picLabel = new UILabel(); + picLabel.setIcon(BaseUtils.readIcon("com/fr/base/images/share/empty.png")); + picLabel.setHorizontalAlignment(SwingConstants.CENTER); + + panel.add(picLabel, BorderLayout.CENTER); + + JPanel labelPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel topLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Empty_First"), SwingConstants.CENTER); + topLabel.setForeground(Color.GRAY); + UILabel bottomLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Empty_Second"), SwingConstants.CENTER); + bottomLabel.setForeground(Color.GRAY); + labelPanel.add(topLabel, BorderLayout.CENTER); + labelPanel.add(bottomLabel, BorderLayout.SOUTH); + labelPanel.setPreferredSize(new Dimension(240, 40)); + panel.add(labelPanel, BorderLayout.SOUTH); + + panel.setPreferredSize(new Dimension(240, 180)); + + + JPanel emptyPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + emptyPanel.setBorder(BorderFactory.createEmptyBorder(100, 0, 0, 0)); + emptyPanel.add(panel, BorderLayout.NORTH); + return emptyPanel; + } + }, + + //加载 + LOADING { + @Override + public JPanel getPanel() { + return new LoadingPane(); + } + }, + + //安装 + INSTALLING { + @Override + public JPanel getPanel() { + return new LoadingPane(Toolkit.i18nText("Fine-Design_Share_installing")); + } + }; + + public abstract JPanel getPanel(); +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java new file mode 100644 index 000000000..fad64627f --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java @@ -0,0 +1,268 @@ +package com.fr.design.mainframe.share.ui.local; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.mainframe.FormWidgetDetailPane; +import com.fr.design.mainframe.share.sort.WidgetSortType; +import com.fr.design.mainframe.share.ui.widgetfilter.LocalWidgetFilter; +import com.fr.design.mainframe.share.util.InstallComponentHelper; +import com.fr.design.mainframe.share.util.ShareComponentUtils; +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * Created by kerry on 2020-10-16 + */ +public class LocalWidgetRepoPane extends BasicPane { + + private JPanel centerPane; + private UIScrollPane groupsScrollPane; + private JPanel groupsPane; + private ManagePane managePane; + + private final Map groupPaneMap = new HashMap<>(); + private final AtomicBoolean isRefreshing = new AtomicBoolean(false); + private boolean editable; + private CardLayout cardLayout; + private String keyWord4Searching = StringUtils.EMPTY; + + private LocalWidgetRepoPane() { + setLayout(FRGUIPaneFactory.createBorderLayout()); + initPane(); + } + + public static LocalWidgetRepoPane getInstance() { + return HOLDER.singleton; + } + + private static class HOLDER { + private static final LocalWidgetRepoPane singleton = new LocalWidgetRepoPane(); + } + + public boolean isEditable() { + return editable; + } + + public String getKeyWord4Searching() { + return keyWord4Searching; + } + + /** + * 初始化 + */ + public void initPane() { + //新用户预装组件 + InstallComponentHelper.installPreComponent(); + JPanel componentLibPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + componentLibPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 15, 0)); + + ToolbarPane toolbarPane = new ToolbarPane(); + managePane = new ManagePane(); + + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + northPane.add(toolbarPane, BorderLayout.NORTH); + northPane.add(managePane, BorderLayout.CENTER); + + cardLayout = new CardLayout(); + centerPane = new JPanel(cardLayout); + centerPane.add(LocalPaneStatus.NO_MATCH.getPanel(), LocalPaneStatus.NO_MATCH.name()); + centerPane.add(LocalPaneStatus.EMPTY.getPanel(), LocalPaneStatus.EMPTY.name()); + centerPane.add(LocalPaneStatus.LOADING.getPanel(), LocalPaneStatus.LOADING.name()); + centerPane.add(LocalPaneStatus.INSTALLING.getPanel(), LocalPaneStatus.INSTALLING.name()); + + componentLibPanel.add(northPane, BorderLayout.NORTH); + componentLibPanel.add(centerPane, BorderLayout.CENTER); + add(componentLibPanel, BorderLayout.CENTER); + cardLayout.show(centerPane, LocalPaneStatus.LOADING.name()); + toolbarPane.addFilterPopupStateChangeListener(state -> setWidgetPaneScrollEnable(!state)); + + doRefresh(); + } + + public void refreshAllGroupPane() { + refreshAllGroupPane(GroupPane.GroupCreateStrategy.DEFAULT); + } + + public void refreshAllGroupPane(GroupPane.GroupCreateStrategy createStrategy) { + editable = false; + groupPaneMap.clear(); + if (groupsScrollPane != null) { + centerPane.remove(groupsScrollPane); + } + groupsPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, VerticalFlowLayout.TOP, 0, 5); + + Group[] groups = DefaultShareGroupManager.getInstance().getAllGroup(); + for (Group group : groups) { + GroupPane groupPane = createStrategy.creteGroupPane(group); + groupPaneMap.put(group.getGroupName(), groupPane); + groupsPane.add(groupPane, BorderLayout.NORTH); + } + groupsScrollPane = new UIScrollPane(groupsPane); + groupsScrollPane.setBorder(null); + groupsScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + + centerPane.add(groupsScrollPane, LocalPaneStatus.NORMAL.name()); + switchPane(); + } + + public void refreshPane() { + managePane.switchPanel(false); + switchPane(LocalPaneStatus.LOADING); + doRefresh(); + } + + public void switch2InstallingPane() { + switchPane(LocalPaneStatus.INSTALLING); + } + + public void refreshShowPanel(boolean isEdit) { + this.editable = isEdit; + refreshShowPanel(); + } + + public void refreshShowPanel() { + for (GroupPane groupPane : groupPaneMap.values()) { + groupPane.refreshShowPanel(); + } + switchPane(); + } + + public void refreshShowPanel(Group group) { + if (groupPaneMap.containsKey(group.getGroupName())) { + groupPaneMap.get(group.getGroupName()).refreshShowPanel(); + } + switchPane(); + } + + public void setWidgetPaneScrollEnable(boolean enable) { + groupsScrollPane.setWheelScrollingEnabled(enable); + } + + public void setManageButtonEnable(boolean enable) { + managePane.setButtonEnable(enable); + } + + public void removeGroup(String groupName) { + JPanel jPanel = groupPaneMap.remove(groupName); + groupsPane.remove(jPanel); + switchPane(); + } + + public void addGroup(Group group) { + GroupPane groupPane = GroupPane.GroupCreateStrategy.DEFAULT.creteGroupPane(group); + groupPaneMap.put(group.getGroupName(), groupPane); + groupsPane.add(groupPane); + switchPane(); + } + + public void searchByKeyword(String text) { + keyWord4Searching = text; + for (GroupPane groupPane : groupPaneMap.values()) { + groupPane.searchByKeyword(text); + } + switchPane(); + } + + public void sortWidget(WidgetSortType sortType) { + for (GroupPane groupPane : groupPaneMap.values()) { + groupPane.sortWidget(sortType); + } + } + + + private void doRefresh() { + if (isRefreshing.get()) { + return; + } + new SwingWorker() { + @Override + protected Boolean doInBackground() throws Exception { + if (isRefreshing.compareAndSet(false, true)) { + boolean isRefresh = DefaultShareGroupManager.getInstance().refresh(); + if (isRefresh) { + ShareComponentUtils.checkReadMe(); + } + return isRefresh; + } + return false; + } + + @Override + public void done() { + try { + if (get()) { + refreshAllGroupPane(); + } + } catch (InterruptedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); + } catch (ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + FormWidgetDetailPane.getInstance().switch2Empty(); + } finally { + isRefreshing.set(false); + } + } + }.execute(); + } + + /** + * 切换为要显示的面板 + */ + private void switchPane() { + switchPane(getStatus()); + } + + private void switchPane(LocalPaneStatus status) { + cardLayout.show(centerPane, status.name()); + centerPane.validate(); + centerPane.repaint(); + } + + private LocalPaneStatus getStatus() { + return isEmpty() ? LocalPaneStatus.EMPTY : isNoMatch() ? LocalPaneStatus.NO_MATCH : LocalPaneStatus.NORMAL; + } + + public boolean isFiltering() { + return LocalWidgetFilter.getInstance().hasFilter(); + } + + public boolean isSearching() { + return StringUtils.isNotEmpty(keyWord4Searching); + } + + private boolean isNoMatch() { + for (GroupPane groupPane : groupPaneMap.values()) { + if (groupPane.isVisible()) { + return false; + } + } + return true; + } + + private boolean isEmpty() { + Group[] groups = DefaultShareGroupManager.getInstance().getAllGroup(); + return groups.length == 1 && groups[0].getAllBindInfoList().length == 0; + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Share_Local_Widget"); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetSelectPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetSelectPane.java new file mode 100644 index 000000000..44bdd0fa5 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetSelectPane.java @@ -0,0 +1,112 @@ +package com.fr.design.mainframe.share.ui.local; + +import com.fr.design.mainframe.share.AbstractWidgetSelectPane; +import com.fr.design.mainframe.share.ui.block.LocalWidgetBlock; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.constants.ShareComponentConstants; +import com.fr.form.share.Group; +import com.fr.form.share.record.ShareWidgetInfoManager; +import com.fr.general.ComparatorUtils; +import com.fr.stable.ArrayUtils; + +import javax.swing.BorderFactory; +import java.awt.AWTEvent; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Point; +import java.awt.event.AWTEventListener; +import java.awt.event.MouseEvent; + +/** + * created by Harrison on 2020/03/23 + **/ +public class LocalWidgetSelectPane extends AbstractWidgetSelectPane { + private LocalWidgetBlock selectedBlock; + private final Group group; + + public LocalWidgetSelectPane(Group group, SharableWidgetProvider[] providers, boolean isEdit) { + this.group = group; + // 表示Popup弹窗是否能被点击到 + AWTEventListener awtEventListener = new AWTEventListener() { + @Override + public void eventDispatched(AWTEvent event) { + if (event instanceof MouseEvent) { + MouseEvent mv = (MouseEvent) event; + if (isCanCancelSelect(mv, selectedBlock)) { + LocalWidgetSelectPane.this.selectedBlock = null; + LocalWidgetSelectPane.this.repaint(); + } + } + + } + + private boolean isCanCancelSelect(MouseEvent mv, LocalWidgetBlock selectedBlock) { + if (mv.getClickCount() < 1) { + return false; + } + // 表示Popup弹窗是否能被点击到 + boolean clickFlag = false; + if (selectedBlock != null) { + if (!selectedBlock.isShowing()) { + return false; + } + Point p = selectedBlock.getLocationOnScreen(); + Point clickPoint = mv.getLocationOnScreen(); + clickFlag = clickPoint.getX() >= p.getX() + && clickPoint.getY() >= p.getY() + && clickPoint.getX() <= selectedBlock.getWidth() + p.getX() + && clickPoint.getY() <= p.getY() + selectedBlock.getHeight(); + + } + return selectedBlock != null && !clickFlag && !ComparatorUtils.equals(mv.getSource(), selectedBlock); + } + }; + + java.awt.Toolkit.getDefaultToolkit().addAWTEventListener(awtEventListener, AWTEvent.MOUSE_EVENT_MASK); + + // 设置面板的边框 ,距离上、左、下、右 的距离 + this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + if (ArrayUtils.isNotEmpty(providers)) { + showComponent(providers, isEdit); + } else { + showEmpty(); + } + } + + public Group getGroup() { + return group; + } + + private void showComponent(SharableWidgetProvider[] providers, boolean isEdit) { + + int rowCount = (providers.length + 1) / 2; + int vgap = 10; + this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, vgap)); + for (SharableWidgetProvider provider : providers) { + LocalWidgetBlock widgetButton = new LocalWidgetBlock((DefaultSharableWidget) provider, this); + widgetButton.setElementCaseEdit(isEdit); + this.add(widgetButton); + } + this.setPreferredSize(new Dimension(240, rowCount * (ShareComponentConstants.SHARE_BLOCK_HEIGHT + vgap))); + } + + private void showEmpty() { + this.setPreferredSize(new Dimension(240, 0)); + } + + public void setSelectBlock(LocalWidgetBlock block) { + this.selectedBlock = block; + this.repaint(); + } + + public LocalWidgetBlock getSelectedBlock() { + return selectedBlock; + } + + @Override + protected Container getParentContainer() { + return this.getParent().getParent(); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ManagePane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ManagePane.java new file mode 100644 index 000000000..67e2efe3f --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ManagePane.java @@ -0,0 +1,245 @@ +package com.fr.design.mainframe.share.ui.local; + +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.share.action.CreateComponentAction; +import com.fr.design.mainframe.share.action.InstallComponentAction; +import com.fr.design.mainframe.share.action.ShareUIAspect; +import com.fr.design.mainframe.share.group.ui.GroupFileDialog; +import com.fr.design.mainframe.share.group.ui.GroupMoveDialog; +import com.fr.design.mainframe.share.ui.base.PopupMenuItem; +import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionListener; + +/** + * @Author: Yuan.Wang + * @Date: 2020/10/29 + */ +class ManagePane extends JPanel implements ShareUIAspect { + private static final String NORMAL = "NORMAL"; + private static final String MANAGE = "MANAGE"; + private final UIButton addComponentButton; + + UIButton deleteSelectedButton; + UIButton moveGroupButton; + CardLayout cardLayout; + + public ManagePane() { + //添加组件 + addComponentButton = createAddComponentButton(); + //管理组件 + UIButton manageButton = createManageButton(); + //添加分组 + UIButton addGroupButton = createAddGroupButton(); + //删除选中 + deleteSelectedButton = createDeleteSelectedButton(); + //移动分组 + moveGroupButton = createMoveGroupButton(); + //取消 + UIButton cancelButton = createCancelButton(); + + deleteSelectedButton.setEnabled(false); + moveGroupButton.setEnabled(false); + + JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); + leftPanel.add(addComponentButton); + + JPanel rightPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + rightPanel.add(manageButton); + rightPanel.add(addGroupButton); + + JPanel normalPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + normalPanel.add(leftPanel, BorderLayout.CENTER); + normalPanel.add(rightPanel, BorderLayout.EAST); + + JPanel managePanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 10, 5)); + managePanel.add(deleteSelectedButton); + managePanel.add(moveGroupButton); + managePanel.add(cancelButton); + + cardLayout = new CardLayout(); + this.setLayout(cardLayout); + this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + this.add(normalPanel, NORMAL); + this.add(managePanel, MANAGE); + } + + public void setButtonEnable(boolean enable) { + if (moveGroupButton.isEnabled() != enable) { + deleteSelectedButton.setEnabled(enable); + moveGroupButton.setEnabled(enable); + } + } + + /** + * 添加组件按钮 + */ + private UIButton createAddComponentButton() { + return createManageButton( + Toolkit.i18nText("Fine-Design_Share_Add"), + IOUtils.readIcon("/com/fr/base/images/share/filter_combo.png"), + e -> { + //创建组件和安装组件的弹窗 + UIPopupMenu popupMenu = new UIPopupMenu(); + popupMenu.setPreferredSize(new Dimension(74, 42)); + popupMenu.setOnlyText(true); + popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER); + popupMenu.add(new PopupMenuItem(new CreateComponentAction(this))); + popupMenu.add(new PopupMenuItem(new InstallComponentAction())); + GUICoreUtils.showPopupMenu(popupMenu, addComponentButton, 0, addComponentButton.getSize().height); + } + ); + } + + /** + * 管理组件面板 + */ + private UIButton createManageButton() { + return createManageButton( + Toolkit.i18nText("Fine-Design_Share_Manage"), + e -> replacePanel(true) + ); + } + + /** + * 添加分组面板 + */ + private UIButton createAddGroupButton() { + return createManageButton( + Toolkit.i18nText("Fine-Design_Share_Group_Add"), + e -> new GroupFileDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Share_Group_Add")) { + @Override + protected void confirmClose() { + this.dispose(); + // 处理不合法的文件夹名称 + String userInput = getFileName().replaceAll("[\\\\/:*?\"<>|]", StringUtils.EMPTY); + //新建分组,刷新显示 + if (DefaultShareGroupManager.getInstance().createGroup(userInput)) { + LocalWidgetRepoPane.getInstance().refreshAllGroupPane(GroupPane.GroupCreateStrategy.CLOSURE); + } else { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Basic_Make_Failure")); + } + } + + @Override + protected boolean isDuplicate(String fileName) { + return DefaultShareGroupManager.getInstance().exist(fileName); + } + } + ); + } + + private UIButton createCancelButton() { + return createManageButton( + Toolkit.i18nText("Fine-Design_Share_Group_Cancel"), + e -> replacePanel(false) + ); + } + + /** + * 切换面板并刷新 + */ + public void replacePanel(boolean isEditing) { + switchPanel(isEditing); + LocalWidgetRepoPane.getInstance().refreshShowPanel(isEditing); + } + + /** + * 切换面板 + * + * @param isEditing 是否编辑 + */ + public void switchPanel(boolean isEditing) { + setButtonEnable(false); + WidgetSelectedManager.getInstance().clearSelect(); + cardLayout.show(this, isEditing ? MANAGE : NORMAL); + } + + private UIButton createDeleteSelectedButton() { + return createManageButton( + Toolkit.i18nText("Fine-Design_Share_Select_Remove"), + new Color(0xeb1d1f), + e -> { + int rv = FineJOptionPane.showConfirmDialog( + DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Share_Remove_Info"), + Toolkit.i18nText("Fine-Design_Share_Group_Confirm"), + FineJOptionPane.YES_NO_OPTION + ); + if (rv == FineJOptionPane.YES_OPTION) { + if (WidgetSelectedManager.getInstance().unInstallSelect()) { + //刷新界面的缓存 + FineJOptionPane.showMessageDialog(null, Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Successful")); + replacePanel(false); + } else { + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Form_Share_Module_Removed_Failed")); + } + } + }); + } + + private UIButton createMoveGroupButton() { + return createManageButton( + Toolkit.i18nText("Fine-Design_Share_Group_Move"), + e -> new GroupMoveDialog(DesignerContext.getDesignerFrame()) { + @Override + protected void confirmClose() { + this.dispose(); + Group group = (Group) getSelectGroupBox().getSelectedItem(); + assert group != null; + if (WidgetSelectedManager.getInstance().moveSelect(group.getGroupName())) { + replacePanel(false); + } else { + LocalWidgetRepoPane.getInstance().refreshShowPanel(); + ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Group_Move_Fail_Message")); + } + } + + } + ); + } + + private UIButton createManageButton(String title, Icon icon, ActionListener actionListener) { + UIButton button = createManageButton(title, actionListener); + button.setIcon(icon); + button.setHorizontalTextPosition(SwingConstants.LEFT); + return button; + } + + private UIButton createManageButton(String title, ActionListener actionListener) { + return createManageButton(title, new Color(0x333334), actionListener); + } + + private UIButton createManageButton(String title, Color foregroundColor, ActionListener actionListener) { + UIButton button = new UIButton(title); + button.setBackground(Color.white); + button.setForeground(foregroundColor); + button.addActionListener(actionListener); + return button; + } + + @Override + public void afterOk() { + LocalWidgetRepoPane.getInstance().refreshShowPanel(false); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java new file mode 100644 index 000000000..c720e7f9c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ToolbarPane.java @@ -0,0 +1,226 @@ +package com.fr.design.mainframe.share.ui.local; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.sort.WidgetSortType; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.design.mainframe.share.ui.base.SortPopupMenuItem; +import com.fr.design.mainframe.share.ui.widgetfilter.FilterPane; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; + +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.MouseEvent; + +/** + * @Author: Yuan.Wang + * @Date: 2020/10/29 + */ +class ToolbarPane extends JPanel { + private static final Color SEARCH_BORDER_COLOR = Color.decode("#F5F5F7"); + private static final Color SEARCH_BORDER_INPUT_COLOR = Color.decode("#419BF9"); + + private static final String NORMAL = "NORMAL"; + private static final String SEARCH = "SEARCH"; + + private UITextField searchTextField; + private final JPanel centerPane; + + //查询按钮 + private final UIButton searchButton; + //排序按钮 + private final UIButton sortButton; + //刷新按钮 + private final UIButton refreshButton; + + private final CardLayout cardLayout; + + private FilterPane filterPanel; + + public ToolbarPane() { + cardLayout = new CardLayout(); + centerPane = new JPanel(cardLayout); + + searchButton = createSearchButton(); + sortButton = createSortButton(); + refreshButton = createRefreshButton(); + filterPanel = createFilterPane(); + JPanel normalPanel = createNormalPanel(); + JPanel searchPanel = createSearchField(); + centerPane.add(normalPanel, NORMAL); + centerPane.add(searchPanel, SEARCH); + this.add(centerPane, BorderLayout.CENTER); + } + + public void addFilterPopupStateChangeListener(FilterPane.PopStateChangeListener listener) { + filterPanel.addPopupStateChangeListener(listener); + } + + private UIButton createSearchButton() { + return createToolButton( + IOUtils.readIcon("/com/fr/base/images/share/search_icon.png"), + Toolkit.i18nText("Fine-Design_Share_Search"), + e -> { + cardLayout.show(centerPane, SEARCH); + searchTextField.requestFocus(); + } + ); + } + + private UIButton createSortButton() { + return createToolButton( + IOUtils.readIcon("/com/fr/base/images/share/sort_icon.png"), + Toolkit.i18nText("Fine-Design_Share_Sort"), + e -> { + UIPopupMenu popupMenu = new UIPopupMenu(); + popupMenu.setOnlyText(true); + popupMenu.setBackground(UIConstants.DEFAULT_BG_RULER); + popupMenu.add(new SortPopupMenuItem(new SortAction(WidgetSortType.INSTALL_TIME))); + popupMenu.add(new SortPopupMenuItem(new SortAction(WidgetSortType.COMPONENT_NAME))); + + GUICoreUtils.showPopupMenu(popupMenu, sortButton, 0, sortButton.getSize().height); + } + ); + } + + private UIButton createRefreshButton() { + return createToolButton( + IOUtils.readIcon("/com/fr/base/images/share/refresh.png"), + Toolkit.i18nText("Fine-Design_Basic_Refresh"), + e -> { + filterPanel.reset(); + LocalWidgetRepoPane.getInstance().refreshPane(); + } + ); + } + + private FilterPane createFilterPane() { + filterPanel = FilterPane.createLocalFilterPane(); + filterPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); + filterPanel.registerChangeListener(e -> LocalWidgetRepoPane.getInstance().refreshShowPanel()); + return filterPanel; + } + + private JPanel createNormalPanel() { + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0)); + buttonPane.add(searchButton); + buttonPane.add(sortButton); + buttonPane.add(refreshButton); + panel.add(filterPanel, BorderLayout.CENTER); + panel.add(buttonPane, BorderLayout.EAST); + return panel; + } + + private JPanel createSearchField() { + final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setPreferredSize(new Dimension(228, 10)); + jPanel.setBorder(BorderFactory.createLineBorder(SEARCH_BORDER_COLOR)); + jPanel.setBackground(Color.WHITE); + UILabel label = new UILabel(IOUtils.readIcon("/com/fr/base/images/share/search_icon.png")); + label.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0)); + jPanel.add(label, BorderLayout.WEST); + this.searchTextField = new UITextField(); + this.searchTextField.setBorderPainted(false); + this.searchTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Basic_Plugin_Search")); + this.searchTextField.addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + jPanel.setBorder(BorderFactory.createLineBorder(SEARCH_BORDER_INPUT_COLOR)); + jPanel.repaint(); + } + + @Override + public void focusLost(FocusEvent e) { + jPanel.setBorder(BorderFactory.createLineBorder(SEARCH_BORDER_COLOR)); + jPanel.repaint(); + } + }); + this.searchTextField.getDocument().addDocumentListener(new DocumentListener() { + @Override + public void insertUpdate(DocumentEvent e) { + filterByName(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + filterByName(); + } + + @Override + public void changedUpdate(DocumentEvent e) { + filterByName(); + } + }); + jPanel.add(this.searchTextField, BorderLayout.CENTER); + UILabel xLabel = new UILabel(BaseUtils.readIcon("/com/fr/design/images/buttonicon/close_icon.png")); + xLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + searchTextField.setText(StringUtils.EMPTY); + cardLayout.show(centerPane, NORMAL); + } + }); + xLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + jPanel.add(xLabel, BorderLayout.EAST); + + return jPanel; + } + + private void filterByName() { + String text = searchTextField.getText(); + boolean searchStatus = !StringUtils.isEmpty(text); + sortButton.setEnabled(!searchStatus); + LocalWidgetRepoPane.getInstance().searchByKeyword(text); + } + + private static class SortAction extends UpdateAction { + private final WidgetSortType sortType; + + public SortAction(WidgetSortType sortType) { + this.putValue(Action.SMALL_ICON, null); + this.setName(sortType.getDisplayName()); + this.sortType = sortType; + } + + @Override + public void actionPerformed(ActionEvent e) { + LocalWidgetRepoPane.getInstance().sortWidget(sortType); + } + } + + /** + * 创建工具条按钮 + */ + private UIButton createToolButton(Icon icon, String toolTip, ActionListener actionListener) { + UIButton toolButton = new UIButton(); + toolButton.setIcon(icon); + toolButton.setToolTipText(toolTip); + toolButton.set4ToolbarButton(); + toolButton.addActionListener(actionListener); + return toolButton; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/WidgetSelectedManager.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/WidgetSelectedManager.java new file mode 100644 index 000000000..d211887f5 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/WidgetSelectedManager.java @@ -0,0 +1,121 @@ +package com.fr.design.mainframe.share.ui.local; + +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * @Author: Yuan.Wang + * @Date: 2021/1/15 + */ +public class WidgetSelectedManager { + private final Map> selectedWidgetMap = new HashMap<>(); + + private WidgetSelectedManager() { + + } + + private static class Holder { + private static final WidgetSelectedManager INSTANCE = new WidgetSelectedManager(); + } + + public static WidgetSelectedManager getInstance() { + return Holder.INSTANCE; + } + + /** + * 添加选中组件 + */ + public synchronized void addSelect(String groupName, String uuid) { + if (selectedWidgetMap.containsKey(groupName)) { + selectedWidgetMap.get(groupName).add(uuid); + } else { + selectedWidgetMap.put(groupName, Stream.of(uuid).collect(Collectors.toList())); + } + } + + /** + * 删除选中组件 + */ + public synchronized void removeSelect(String groupName, String uuid) { + if (selectedWidgetMap.containsKey(groupName)) { + selectedWidgetMap.get(groupName).remove(uuid); + } + } + + /** + * 卸载单个选中组件 + */ + public synchronized boolean unInstallSelect(String groupName, String uuid) { + Group group = DefaultShareGroupManager.getInstance().getGroup(groupName); + return group != null && group.unInstallSelect(Stream.of(uuid).collect(Collectors.toList())); + } + + /** + * 卸载所有选中组件 + */ + public synchronized boolean unInstallSelect() { + boolean result = true; + for (String groupName : selectedWidgetMap.keySet()) { + Group group = DefaultShareGroupManager.getInstance().getGroup(groupName); + result &= group != null && group.unInstallSelect(selectedWidgetMap.get(groupName)); + } + selectedWidgetMap.clear(); + return result; + } + + /** + * 是否选中某组件 + */ + public synchronized boolean isSelected(String groupName, String uuid) { + return selectedWidgetMap.containsKey(groupName) && selectedWidgetMap.get(groupName).contains(uuid); + } + + /** + * 清空选中组件 + */ + public synchronized void clearSelect() { + selectedWidgetMap.clear(); + } + + /** + * 被选中是否为空 + */ + public synchronized boolean isSelectEmpty() { + return selectedWidgetMap.isEmpty() || selectedWidgetMap.values().stream().noneMatch(list -> (list.size() > 0)); + } + + /** + * 移动所有选中到某分组 + */ + public synchronized boolean moveSelect(String toGroupName) { + boolean result = true; + Group toGroup = DefaultShareGroupManager.getInstance().getGroup(toGroupName); + if (toGroup == null) { + return false; + } + for (String groupName : selectedWidgetMap.keySet()) { + Group fromGroup = DefaultShareGroupManager.getInstance().getGroup(groupName); + result &= fromGroup != null && fromGroup.moveModule(toGroup, selectedWidgetMap.get(groupName)); + } + selectedWidgetMap.clear(); + return result; + } + + /** + * 移动单独组件到某分组 + */ + public synchronized boolean moveSelect(String formGroupName, String toGroupName, String uuid) { + Group fromGroup = DefaultShareGroupManager.getInstance().getGroup(formGroupName); + Group toGroup = DefaultShareGroupManager.getInstance().getGroup(toGroupName); + if (fromGroup == null || toGroup == null) { + return false; + } + return fromGroup.moveModule(toGroup, Stream.of(uuid).collect(Collectors.toList())); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java new file mode 100644 index 000000000..7c090cac3 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetShowPane.java @@ -0,0 +1,273 @@ +package com.fr.design.mainframe.share.ui.online; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.sort.OnlineWidgetSortType; +import com.fr.design.mainframe.share.ui.base.FlexSearchFieldPane; +import com.fr.design.mainframe.share.ui.base.LoadingPane; +import com.fr.design.mainframe.share.ui.widgetfilter.FilterPane; +import com.fr.form.share.base.DataLoad; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.utils.ShareUtils; +import com.fr.general.IOUtils; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by kerry on 2020-10-19 + */ +public abstract class AbstractOnlineWidgetShowPane extends JPanel { + private static final String SEARCH_RESULT_PANE = "SEARCH_RESULT_PANE"; + private static final String MAIN_FILTER_TAB_PANE = "MAIN_FILTER_TAB_PANE"; + + private JPanel componentSelectPane; + private JPanel searchResultShowPane; + private JPanel mainCenterPane; + private FilterPane filterPane; + private JPanel centerPane; + private SortTabPane sortTabPane; + + private final JPanel loadingPane = new LoadingPane(); + + private OnlineShareWidget[] sharableWidgetProviders; + + //缓存一份用于搜索 + private final OnlineShareWidget[] sharableWidgetCache; + //主面板和搜索面板的cardLayout + private CardLayout mainCardLayout; + + + public AbstractOnlineWidgetShowPane(OnlineShareWidget[] sharableWidgetProviders) { + this.sharableWidgetCache = sharableWidgetProviders; + this.sharableWidgetProviders = sharableWidgetProviders; + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel contentPane = initContentPane(); + this.add(contentPane, BorderLayout.CENTER); + } + + protected JPanel initContentPane() { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + OnlineWidgetSortType.COMPOSITE.sort(sharableWidgetProviders); + componentSelectPane = createOnlineWidgetSelectPane(sharableWidgetProviders); + centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + centerPane.add(componentSelectPane, BorderLayout.CENTER); + filterPane = createFilterPane(); + filterPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 8)); + initFilterPaneListener(filterPane); + sortTabPane = new SortTabPane(); + initSortTabPane(sortTabPane); + FlexSearchFieldPane flexSearchPane = new FlexSearchFieldPane(filterPane); + initSearchTextFieldPaneListener(flexSearchPane); + + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + northPane.add(flexSearchPane, BorderLayout.CENTER); + northPane.add(sortTabPane, BorderLayout.SOUTH); + initNorthPane(jPanel, northPane); + + searchResultShowPane = createOnlineWidgetSelectPane(new OnlineShareWidget[]{}); + mainCardLayout = new CardLayout(); + mainCenterPane = new JPanel(mainCardLayout); + mainCenterPane.add(centerPane, MAIN_FILTER_TAB_PANE); + mainCenterPane.add(searchResultShowPane, SEARCH_RESULT_PANE); + jPanel.add(mainCenterPane, BorderLayout.CENTER); + + filterPane.addPopupStateChangeListener(state -> setWidgetPaneScrollEnable(!state)); + return jPanel; + } + + protected void initNorthPane(JPanel jPanel, JPanel northPane) { + jPanel.add(northPane, BorderLayout.NORTH); + } + + + protected OnlineWidgetSelectPane createOnlineWidgetSelectPane(OnlineShareWidget[] sharableWidgetProviders) { + return new OnlineWidgetSelectPane(sharableWidgetProviders, filterPane, 50); + } + + protected OnlineWidgetSelectPane createOnlineWidgetSelectPane(DataLoad dataLoad) { + return new OnlineWidgetSelectPane(dataLoad, filterPane, 50); + } + + protected FilterPane createFilterPane() { + return FilterPane.createOnlineFilterPane(); + } + + protected OnlineShareWidget[] getSharableWidgetProviders() { + return sharableWidgetProviders; + } + + public void searchByKeyword(String text) { + if (StringUtils.isEmpty(text)) { + this.mainCardLayout.show(mainCenterPane, MAIN_FILTER_TAB_PANE); + return; + } + List widgets = new ArrayList<>(); + if (StringUtils.isNotEmpty(text)) { + for (OnlineShareWidget provider : sharableWidgetCache) { + if (provider.getName().toLowerCase().contains(text)) { + widgets.add(provider); + } + } + } + + if (searchResultShowPane != null) { + mainCenterPane.remove(searchResultShowPane); + } + this.searchResultShowPane = createOnlineWidgetSelectPane(widgets.toArray(new OnlineShareWidget[widgets.size()])); + this.mainCenterPane.add(searchResultShowPane, SEARCH_RESULT_PANE); + this.mainCardLayout.show(mainCenterPane, SEARCH_RESULT_PANE); + this.validate(); + this.repaint(); + + } + + public void initFilterPaneListener(FilterPane filterPane) { + filterPane.registerChangeListener(new ChangeListener() { + @Override + public void stateChanged(final ChangeEvent e) { + String filterStr = e.getSource().toString(); + centerPane.remove(componentSelectPane); + componentSelectPane = createOnlineWidgetSelectPane(() -> { + sharableWidgetProviders = new OnlineShareWidget[0]; + sharableWidgetProviders = getSharableWidgetArr(filterStr); + return sharableWidgetProviders; + }); + centerPane.add(componentSelectPane, BorderLayout.CENTER); + AbstractOnlineWidgetShowPane.this.validate(); + AbstractOnlineWidgetShowPane.this.repaint(); + } + }); + } + + protected OnlineShareWidget[] getSharableWidgetArr( String filterStr){ + return ShareUtils.getFilterWidgets(filterStr); + } + + public void initSearchTextFieldPaneListener(FlexSearchFieldPane searchFieldPane) { + searchFieldPane.registerChangeListener(event -> { + Object object = event.getSource(); + if (object instanceof String) { + String text = (String) object; + sortTabPane.setVisible(StringUtils.isEmpty(text)); + searchByKeyword(text); + } + }); + } + + public void initSortTabPane(SortTabPane sortTabPane) { + + } + + private void setWidgetPaneScrollEnable(boolean enable) { + if (componentSelectPane instanceof OnlineWidgetSelectPane) { + ((OnlineWidgetSelectPane) componentSelectPane).setWidgetPaneScrollEnable(enable); + } + } + + public class SortTabPane extends JPanel { + private final Color BLUE = Color.decode("#419BF9"); + private int index; + private final UILabel[] labels; + private final Map recordMap; + private List mouseListeners = new ArrayList<>(); + + public SortTabPane() { + setLayout(new FlowLayout(FlowLayout.LEFT)); + setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + OnlineWidgetSortType[] sortTypes = OnlineWidgetSortType.values(); + recordMap = new HashMap<>(); + labels = new UILabel[sortTypes.length]; + int i = 0; + for (OnlineWidgetSortType sortType : sortTypes) { + labels[i] = createTab(sortType); + recordMap.put(sortType.getDisplayName(), i); + add(labels[i]); + i++; + if (i != sortTypes.length) { + add(createSeparator()); + } + } + setIndex(0); + } + + public void setIndex(int index) { + labels[this.index].setForeground(Color.black); + labels[index].setForeground(BLUE); + this.index = index; + repaint(); + } + + public int getIndex() { + return index; + } + + private UILabel createTab(OnlineWidgetSortType sortType) { + UILabel label = new UILabel(sortType.getDisplayName()); + label.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (sharableWidgetProviders.length == 0) { + return; + } + String title = label.getText(); + if (index != recordMap.get(title)) { + setIndex(recordMap.get(title)); + } + if (componentSelectPane != null) { + centerPane.remove(componentSelectPane); + centerPane.add(loadingPane); + } + AbstractOnlineWidgetShowPane.this.validate(); + AbstractOnlineWidgetShowPane.this.repaint(); + new SwingWorker() { + @Override + protected Boolean doInBackground() { + sortType.sort(sharableWidgetProviders); + componentSelectPane = createOnlineWidgetSelectPane(sharableWidgetProviders); + return true; + } + + @Override + protected void done() { + centerPane.removeAll(); + centerPane.add(componentSelectPane, BorderLayout.CENTER); + AbstractOnlineWidgetShowPane.this.validate(); + AbstractOnlineWidgetShowPane.this.repaint(); + } + }.execute(); + + for (MouseListener listener : mouseListeners) { + listener.mouseClicked(e); + } + } + }); + return label; + } + + private UILabel createSeparator() { + UILabel label = new UILabel(IOUtils.readIcon("/com/fr/base/images/share/separator.png")); + label.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2)); + return label; + } + + public void registerSortTabMouseListener(MouseListener listener) { + mouseListeners.add(listener); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java new file mode 100644 index 000000000..59a09c466 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineDownloadPackagePane.java @@ -0,0 +1,253 @@ +package com.fr.design.mainframe.share.ui.online; + +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.share.ui.base.DownloadProgressPane; +import com.fr.design.mainframe.share.ui.base.ImitationProgress; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.design.mainframe.share.ui.block.OnlineWidgetBlock; +import com.fr.design.mainframe.share.ui.block.SimpleWidgetBlock; +import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; +import com.fr.design.mainframe.share.ui.online.widgetpackage.OnlineWidgetPackagesShowPane; +import com.fr.design.mainframe.share.util.DownloadUtils; +import com.fr.design.mainframe.share.util.InstallUtils; +import com.fr.design.mainframe.share.util.ShareComponentUtils; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.Group; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StableUtils; +import org.jetbrains.annotations.Nullable; + +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingWorker; +import java.awt.AlphaComposite; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.event.MouseEvent; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/22 + */ +public class OnlineDownloadPackagePane extends OnlineWidgetSelectPane { + private final String packageId; + private volatile double process; + + + private ImitationThread imitationThread; + private SwingWorker downloadWorker; + private DownloadProgressPane downloadProgressPane; + private final OnlineWidgetPackagesShowPane parentPane; + + + public OnlineDownloadPackagePane(OnlineWidgetPackagesShowPane parentPane, OnlineShareWidget[] providers, int widgetsPerNum) { + super(providers, widgetsPerNum); + this.parentPane = parentPane; + this.packageId = parentPane.getCurrentPackageId(); + } + + protected OnlineWidgetBlock createWidgetBlock(OnlineShareWidget provider) { + return new SimpleWidgetBlock(provider, this); + } + + protected void setScrollPaneStyle(UIScrollPane scrollPane) { + scrollPane.setBorder(null); + scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); + scrollPane.setWheelScrollingEnabled(false); + } + + @Override + protected boolean pagePaneEnable() { + return false; + } + + protected JPanel createWidgetPane() { + return new JPanel() { + @Override + public void paint(Graphics g) { + super.paint(g); + Graphics2D g2d = (Graphics2D) g; + Composite oldComposite = g2d.getComposite(); + AlphaComposite composite = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.65f); + g2d.setComposite(composite); + g2d.setColor(Color.DARK_GRAY); + g2d.fillRect(0, 0, getWidth(), getHeight()); + g2d.setComposite(oldComposite); + } + }; + } + + protected JPanel createContentPane(JPanel widgetPane) { + JPanel panel = new JPanel() { + @Override + public void paint(Graphics g) { + for (int i = 0; i < getComponentCount(); i++) { + getComponent(i).setSize(getSize()); + } + super.paint(g); + } + }; + panel.setLayout(null); + downloadProgressPane = new DownloadProgressPane(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + int returnVal = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Share_Download_Cancel_Confirm"), Toolkit.i18nText("Fine-Design_Share_Group_Confirm"), + FineJOptionPane.OK_CANCEL_OPTION); + if (returnVal == FineJOptionPane.OK_OPTION) { + //取消下载线程 + imitationThread.interrupt(); + downloadWorker.cancel(false); + + //切换面板 + parentPane.resetWidgetDetailPane(packageId, getSharableWidgetProviders()); + } + } + }); + panel.add(downloadProgressPane); + panel.add(widgetPane, BorderLayout.CENTER); + return panel; + } + + public void downloadWidget(OnlineShareWidget onlineShareWidget) { + + final com.fr.design.extra.Process downloadProcess = aDouble -> { + OnlineDownloadPackagePane.this.process = 0.8 * aDouble; + downloadProgressPane.updateProgress(process); + }; + final com.fr.design.extra.Process installProcess = aDouble -> { + OnlineDownloadPackagePane.this.process = 0.8 + 0.2 * aDouble; + downloadProgressPane.updateProgress(process); + }; + + downloadProcess.process(0.0D); + + //假进度线程 + final ImitationProgress imitationProgress = new ImitationProgress(downloadProcess, getSharableWidgetNum()); + imitationThread = new ImitationThread(imitationProgress); + imitationThread.setName("Component-ImitationProcessThread"); + + //下载线程 + downloadWorker = new DownLoadSwingWorker(installProcess, onlineShareWidget); + + parallel(imitationThread, downloadWorker); + } + + private void parallel(Thread imitationProcessThread, SwingWorker worker) { + imitationProcessThread.start(); + worker.execute(); + } + + /** + * 假进度线程 + */ + private static class ImitationThread extends Thread { + + private final ImitationProgress imitationProgress; + + public ImitationThread(ImitationProgress progress) { + imitationProgress = progress; + } + + @Override + public void run() { + imitationProgress.start(); + } + + public void complete() { + imitationProgress.completed(); + this.interrupt(); + } + + public void stopThread() { + imitationProgress.stop(); + this.interrupt(); + } + } + + private class DownLoadSwingWorker extends SwingWorker { + final com.fr.design.extra.Process installProcess; + final OnlineShareWidget onlineShareWidget; + + public DownLoadSwingWorker(com.fr.design.extra.Process installProcess, OnlineShareWidget onlineShareWidget) { + this.installProcess = installProcess; + this.onlineShareWidget = onlineShareWidget; + } + + @Override + @Nullable + protected Group doInBackground() { + final String filePath; + List failureList = new ArrayList<>(); + try { + filePath = DownloadUtils.downloadPackage(onlineShareWidget.getId(), onlineShareWidget.getName(), DownLoadSwingWorker.this::isCancelled); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + imitationThread.stopThread(); + return null; + } + if (this.isCancelled()) { + imitationThread.stopThread(); + StableUtils.deleteFile(new File(filePath)); + return null; + } + + //等待假进度线程结束 + imitationThread.complete(); + try { + imitationThread.join(); + } catch (InterruptedException ignore) { + } + + //再判断一次 + if (this.isCancelled()) { + StableUtils.deleteFile(new File(filePath)); + return null; + } + ShareComponentUtils.checkReadMe(); + //安装 + File file = new File(filePath); + installProcess.process(0.0D); + downloadProgressPane.changeState(); + InstallUtils.InstallResult result = null; + try { + if (file.exists()) { + result = InstallUtils.installReusFile(file, System.currentTimeMillis(), failureList, installProcess); + } + } finally { + //删掉下载组件的目录 + StableUtils.deleteFile(file); + } + return result == null ? null : result.group; + } + + @Override + protected void done() { + OnlineDownloadPackagePane.this.process = 0.0D; + //替换面板,显示下载label + parentPane.resetWidgetDetailPane(packageId, getSharableWidgetProviders()); + parentPane.repaint(); + if (!isCancelled()) { + try { + Group group = get(); + if (group != null) { + LocalWidgetRepoPane.getInstance().addGroup(group); + } + } catch (InterruptedException | ExecutionException e) { + FineLoggerFactory.getLogger().error(e, e.getMessage()); + } + } + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineResourceManager.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineResourceManager.java new file mode 100644 index 000000000..6a99209d3 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineResourceManager.java @@ -0,0 +1,53 @@ +package com.fr.design.mainframe.share.ui.online; + +import javax.swing.SwingWorker; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by kerry on 2020-12-10 + */ +public class OnlineResourceManager { + private static class HOLDER { + private static final OnlineResourceManager singleton = new OnlineResourceManager(); + } + + private OnlineResourceManager(){ + + } + + public static OnlineResourceManager getInstance() { + return HOLDER.singleton; + } + + private SwingWorker swingWorker; + + private final List loaderList = new ArrayList<>(); + + public void cancelLoad() { + if (swingWorker != null) { + swingWorker.cancel(true); + } + this.loaderList.clear(); + } + + public void addLoader(ResourceLoader loader) { + this.loaderList.add(loader); + } + + public void loadImage() { + swingWorker = new SwingWorker() { + @Override + protected Boolean doInBackground() { + for (ResourceLoader loader : loaderList) { + loader.load(); + } + return true; + } + }; + swingWorker.execute(); + + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java new file mode 100644 index 000000000..af329cde8 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java @@ -0,0 +1,189 @@ +package com.fr.design.mainframe.share.ui.online; + +import com.fr.base.BaseUtils; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.ui.base.LoadingPane; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.utils.ShareUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; + + +/** + * Created by kerry on 2020-10-16 + */ +public class OnlineWidgetRepoPane extends BasicPane { + private static final String MARKET_URL = "https://market.fanruan.com/reuse"; + private OnlineWidgetTabPane componentTabPane; + private JPanel centerPane; + private boolean isShowPackagePanel = false; + private CardLayout cardLayout; + + enum Status {LOADING, DISCONNECTED, NORMAL} + + public static OnlineWidgetRepoPane getInstance() { + return OnlineWidgetRepoPane.HOLDER.singleton; + } + + private static class HOLDER { + private static final OnlineWidgetRepoPane singleton = new OnlineWidgetRepoPane(); + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Share_Online"); + } + + public OnlineWidgetRepoPane() { + initPane(); + } + + public boolean isShowPackagePanel() { + return isShowPackagePanel; + } + + public void setShowPackagePanel(boolean showPackagePanel) { + isShowPackagePanel = showPackagePanel; + } + + private void initPane() { + cardLayout = new CardLayout(); + this.setLayout(cardLayout); + this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + this.centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + this.add(new LoadingPane(), Status.LOADING.name()); + this.add(this.centerPane, Status.NORMAL.name()); + this.add(createInternetErrorPane(), Status.DISCONNECTED.name()); + + switchPane(Status.LOADING); + synchronizedLoadingContent(); + } + + private void addCenterPane() { + this.centerPane.removeAll(); + this.centerPane.add(this.componentTabPane, BorderLayout.CENTER); + this.switchPane(Status.NORMAL); + } + + public void switch2InternetErrorPane() { + switchPane(Status.DISCONNECTED); + } + + private void switchPane(Status status) { + cardLayout.show(this, status.name()); + } + + private void synchronizedLoadingContent() { + new SwingWorker() { + @Override + protected Boolean doInBackground() throws Exception { + return initContentPane(); + } + + @Override + protected void done() { + try { + if (get()) { + addCenterPane(); + } + } catch (InterruptedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); + } catch (ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }.execute(); + } + + private boolean initContentPane() { + List sharableWidgets = new ArrayList<>(); + List sharableWidgetPackage = new ArrayList<>(); + + try { + ShareUtils.getAllSharableWidgetsFromShop(sharableWidgets, sharableWidgetPackage); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + switchPane(Status.DISCONNECTED); + return false; + } + this.componentTabPane = new OnlineWidgetTabPane(sharableWidgets.toArray(new OnlineShareWidget[sharableWidgets.size()]), + sharableWidgetPackage.toArray(new OnlineShareWidget[sharableWidgetPackage.size()])); + + return true; + } + + private void reload() { + this.removeAll(); + initPane(); + this.validate(); + this.repaint(); + } + + private JPanel createInternetErrorPane() { + JPanel panel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 5); + UILabel imagePanel = new UILabel(BaseUtils.readIcon("/com/fr/base/images/share/internet_error.png")); + imagePanel.setPreferredSize(new Dimension(240, 96)); + imagePanel.setHorizontalAlignment(SwingConstants.CENTER); + panel.add(imagePanel); + UILabel uiLabel = tipLabel(Toolkit.i18nText("Fine-Design_Share_Internet_Connect_Failed")); + uiLabel.setForeground(Color.decode("#8F8F92")); + UILabel reloadLabel = tipLabel(Toolkit.i18nText("Fine-Design_Share_Online_Reload")); + reloadLabel.setForeground(Color.decode("#419BF9")); + reloadLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + reloadLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + reload(); + } + }); + + + UILabel tipLabel1 = tipLabel(Toolkit.i18nText("Fine-Design_Share_Internet_Connect_Failed_Tip1")); + tipLabel1.setForeground(Color.decode("#8F8F92")); + UILabel tipLabel2 = tipLabel(Toolkit.i18nText("Fine-Design_Share_Internet_Connect_Failed_Tip2")); + tipLabel2.setForeground(Color.decode("#8F8F92")); + UILabel tipLabel3 = tipLabel(MARKET_URL); + tipLabel3.setForeground(Color.decode("#8F8F92")); + + + UILabel emptyLabel = tipLabel(StringUtils.EMPTY); + panel.add(uiLabel); + panel.add(reloadLabel); + panel.add(emptyLabel); + panel.add(tipLabel1); + panel.add(tipLabel2); + panel.add(tipLabel3); + panel.setBorder(BorderFactory.createEmptyBorder(240, 0, 0, 0)); + return panel; + } + + private UILabel tipLabel(String text) { + UILabel tipLabel = new UILabel(text); + tipLabel.setHorizontalAlignment(SwingConstants.CENTER); + tipLabel.setPreferredSize(new Dimension(240, 20)); + return tipLabel; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetSelectPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetSelectPane.java new file mode 100644 index 000000000..61e3ced83 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetSelectPane.java @@ -0,0 +1,225 @@ +package com.fr.design.mainframe.share.ui.online; + +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.AbstractWidgetSelectPane; +import com.fr.design.mainframe.share.ui.base.LoadingPane; +import com.fr.design.mainframe.share.ui.base.NoMatchPane; +import com.fr.design.mainframe.share.ui.base.PagingFiledPane; +import com.fr.design.mainframe.share.ui.block.OnlineWidgetBlock; +import com.fr.design.mainframe.share.ui.block.PreviewWidgetBlock; +import com.fr.design.mainframe.share.ui.widgetfilter.FilterPane; +import com.fr.form.share.base.DataLoad; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.constants.ShareComponentConstants; +import com.fr.form.share.utils.ShareUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ArrayUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.util.concurrent.ExecutionException; + +/** + * Created by kerry on 2020-10-19 + */ +public class OnlineWidgetSelectPane extends AbstractWidgetSelectPane { + protected static final int H_GAP = 5; + protected static final int V_GAP = 10; + + enum PaneStatue {NORMAL, NO_MATCH, LOADING, DISCONNECTED} + + private OnlineShareWidget[] sharableWidgetProviders; + private PagingFiledPane pagingFiledPane; + private JPanel contentPane; + private UIScrollPane scrollPane; + private FilterPane filterPane; + private final int widgetsPerNum; + private CardLayout cardLayout; + + public OnlineWidgetSelectPane(OnlineShareWidget[] providers, FilterPane filterPane, int widgetsPerNum) { + this(providers, widgetsPerNum); + this.filterPane = filterPane; + } + + public OnlineWidgetSelectPane(final DataLoad dataLoad, FilterPane filterPane, final int widgetsPerNum) { + this(dataLoad, widgetsPerNum); + this.filterPane = filterPane; + } + + public OnlineWidgetSelectPane(OnlineShareWidget[] providers, int widgetsPerNum) { + this.widgetsPerNum = widgetsPerNum; + sharableWidgetProviders = providers; + init(); + initPagingPane(); + switchPane(createComponents()); + } + + public OnlineWidgetSelectPane(final DataLoad dataLoad, final int widgetsPerNum) { + this.widgetsPerNum = widgetsPerNum; + init(); + //异步获取组件信息 + new SwingWorker() { + @Override + protected PaneStatue doInBackground() { + sharableWidgetProviders = dataLoad.load(); + initPagingPane(); + return createComponents(); + } + + @Override + protected void done() { + try { + switchPane(get()); + } catch (InterruptedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); + } catch (ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }.execute(); + } + + private void init() { + cardLayout = new CardLayout(); + this.setLayout(cardLayout); + // 设置面板的边框 ,距离上、左、下、右 的距离 + this.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.add(new LoadingPane(), PaneStatue.LOADING.name()); + this.add(new NoMatchPane(), PaneStatue.NO_MATCH.name()); + this.add(contentPane, PaneStatue.NORMAL.name()); + switchPane(PaneStatue.LOADING); + } + + public int getSharableWidgetNum() { + return sharableWidgetProviders == null ? 0 : sharableWidgetProviders.length; + } + + public OnlineShareWidget[] getSharableWidgetProviders() { + return sharableWidgetProviders; + } + + /** + * 切换需要显示的面板 + */ + private void switchPane(PaneStatue statue) { + if (statue == PaneStatue.DISCONNECTED) { + OnlineWidgetRepoPane.getInstance().switch2InternetErrorPane(); + return; + } + cardLayout.show(this, statue.name()); + if (statue == PaneStatue.NORMAL) { + //异步加载组件缩略图 + OnlineResourceManager.getInstance().loadImage(); + } + } + + private void synchronizedLoadingContent() { + new SwingWorker() { + @Override + protected PaneStatue doInBackground() { + return createComponents(); + } + + @Override + protected void done() { + try { + switchPane(get()); + } catch (InterruptedException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + Thread.currentThread().interrupt(); + } catch (ExecutionException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + }.execute(); + } + + private void initPagingPane() { + this.pagingFiledPane = new PagingFiledPane(sharableWidgetProviders.length, widgetsPerNum); + this.pagingFiledPane.registerChangeListener(event -> { + OnlineWidgetSelectPane.this.switchPane(PaneStatue.LOADING); + synchronizedLoadingContent(); + }); + pagingFiledPane.setEnable(pagePaneEnable()); + } + + private PaneStatue createComponents() { + if (ArrayUtils.isEmpty(sharableWidgetProviders)) { + return PaneStatue.NO_MATCH; + } + if (!ShareUtils.testConnection()) { + return PaneStatue.DISCONNECTED; + } + OnlineResourceManager.getInstance().cancelLoad(); + + contentPane.removeAll(); + scrollPane = createScrollPane(); + + contentPane.add(scrollPane, BorderLayout.CENTER); + contentPane.add(this.pagingFiledPane, BorderLayout.SOUTH); + return PaneStatue.NORMAL; + } + + private UIScrollPane createScrollPane() { + OnlineShareWidget[] showWidgets = this.pagingFiledPane.getShowItems(this.sharableWidgetProviders); + JPanel widgetPane = createWidgetPane(); + widgetPane.setLayout(new FlowLayout(FlowLayout.LEFT, H_GAP, V_GAP)); + for (OnlineShareWidget provider : showWidgets) { + PreviewWidgetBlock widgetButton = createWidgetBlock(provider); + widgetPane.add(widgetButton); + } + widgetPane.setPreferredSize(new Dimension(240, getPaneHeight(showWidgets.length))); + + UIScrollPane scrollPane = new UIScrollPane(createContentPane(widgetPane)); + setScrollPaneStyle(scrollPane); + return scrollPane; + } + + protected JPanel createWidgetPane() { + return new JPanel(); + } + + protected JPanel createContentPane(JPanel widgetPane) { + JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.add(widgetPane, BorderLayout.CENTER); + return panel; + } + + protected boolean pagePaneEnable() { + return true; + } + + protected void setScrollPaneStyle(UIScrollPane scrollPane) { + scrollPane.setBorder(null); + scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); + scrollPane.setWheelScrollingEnabled(filterPane == null || !filterPane.isShowPopup()); + } + + protected PreviewWidgetBlock createWidgetBlock(OnlineShareWidget provider) { + return new OnlineWidgetBlock(provider, this); + } + + protected int getPaneHeight(int count) { + return (count + 1) / 2 * (ShareComponentConstants.SHARE_BLOCK_HEIGHT + V_GAP); + } + + public void setWidgetPaneScrollEnable(boolean enable) { + if (scrollPane != null) { + scrollPane.setWheelScrollingEnabled(enable); + } + } + + protected Container getParentContainer() { + return this.getParent(); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java new file mode 100644 index 000000000..a599980ce --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetShowPane.java @@ -0,0 +1,152 @@ +package com.fr.design.mainframe.share.ui.online; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.sort.OnlineWidgetSortType; +import com.fr.design.mainframe.share.ui.base.FlexSearchFieldPane; +import com.fr.design.mainframe.share.ui.widgetfilter.FilterPane; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.utils.ShareUtils; +import com.fr.stable.StringUtils; + +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + + +/** + * Created by kerry on 2020-10-19 + */ +public class OnlineWidgetShowPane extends AbstractOnlineWidgetShowPane { + private String lastSearch = StringUtils.EMPTY; + private String lastFilter = StringUtils.EMPTY; + private int lastSortTabSelectedIndex = 0; + + public OnlineWidgetShowPane(OnlineShareWidget[] sharableWidgetProviders) { + super(sharableWidgetProviders); + } + + @Override + public void initSearchTextFieldPaneListener(FlexSearchFieldPane searchFieldPane) { + super.initSearchTextFieldPaneListener(searchFieldPane); + + searchFieldPane.registerSearchTextFieldFocusListener(new FocusAdapter() { + private KeyListener keyListener = new KeyAdapter() { + @Override + public void keyPressed(KeyEvent e) { + if (e.getKeyCode() == KeyEvent.VK_DELETE) { + collectSearchText(false); + } + } + }; + public void focusGained(FocusEvent e) { + searchFieldPane.addKeyListener(keyListener); + } + @Override + public void focusLost(FocusEvent e) { + searchFieldPane.removeKeyListener(keyListener); + collectSearchText(true); + + } + }); + + searchFieldPane.registerDeleteIconMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + collectSearchText(false); + } + }); + + searchFieldPane.registerFieldDocumentListener(new DocumentListener() { + @Override + public void insertUpdate(DocumentEvent e) { + try { + lastSearch = e.getDocument().getText(0, e.getDocument().getLength()); + } catch (BadLocationException ex) { + ex.printStackTrace(); + } + } + @Override + public void removeUpdate(DocumentEvent e) { + textChanged(e); + } + + @Override + public void changedUpdate(DocumentEvent e) { + textChanged(e); + } + + public void textChanged(DocumentEvent e) {}; + }); + } + + @Override + public void initFilterPaneListener(FilterPane filterPane) { + super.initFilterPaneListener(filterPane); + filterPane.registerChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + lastFilter = e.getSource().toString(); + } + }); + filterPane.addPopupStateChangeListener(new FilterPane.PopStateChangeListener() { + @Override + public void stateChange(boolean state) { + if (!state) { + collectFilterContent(); + } + } + }); + } + + protected OnlineShareWidget[] getSharableWidgetArr( String filterStr){ + OnlineShareWidget[] onlineShareWidgets = ShareUtils.getFilterWidgets(filterStr); + OnlineWidgetSortType.values()[lastSortTabSelectedIndex].sort(onlineShareWidgets); + return onlineShareWidgets; + } + + @Override + public void initSortTabPane(SortTabPane sortTabPane) { + super.initSortTabPane(sortTabPane); + lastSortTabSelectedIndex = sortTabPane.getIndex(); + sortTabPane.registerSortTabMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (sortTabPane.getIndex() != lastSortTabSelectedIndex) { + collectSortType(((UILabel) e.getSource()).getText()); + lastSortTabSelectedIndex = sortTabPane.getIndex(); + } + } + }); + } + + private void collectSearchText(boolean isSaveInfo) { + if (StringUtils.isNotEmpty(lastSearch)) { + ComponentCollector.getInstance().collectSearchContent(this.lastSearch); + if (isSaveInfo) { + ComponentCollector.getInstance().saveInfo(); + } + lastSearch = StringUtils.EMPTY; + } + } + + private void collectFilterContent() { + if (StringUtils.isNotEmpty(lastFilter)) { + ComponentCollector.getInstance().collectFilterContent(lastFilter); + lastSearch = StringUtils.EMPTY; + } + } + + private void collectSortType(String sortType) { + ComponentCollector.getInstance().collectSortType(sortType); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java new file mode 100644 index 000000000..96837fd3c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java @@ -0,0 +1,58 @@ +package com.fr.design.mainframe.share.ui.online; + +import com.fr.design.gui.ibutton.UITabGroup; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.ui.online.widgetpackage.OnlineWidgetPackagesShowPane; +import com.fr.form.share.bean.OnlineShareWidget; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; + +/** + * Created by kerry on 2020-10-19 + */ +public class OnlineWidgetTabPane extends JPanel { + private static final String COMPONENT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share"); + private static final String COMPONENT_PACKAGE = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Package"); + private CardLayout cardLayout; + private JPanel centerPane; + private boolean packagePaneCreated = false; + + public OnlineWidgetTabPane(OnlineShareWidget[] sharableWidgets, OnlineShareWidget[] sharableWidgetPackage) { + initPane(sharableWidgets, sharableWidgetPackage); + } + + private void initPane(OnlineShareWidget[] sharableWidgets, OnlineShareWidget[] sharableWidgetPackages) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.cardLayout = new CardLayout(); + this.centerPane = new JPanel(cardLayout); + this.centerPane.add(new OnlineWidgetShowPane(sharableWidgets), COMPONENT); + //延迟组件包面板的初始化,防止组件面板里组件的缩略图和组件包面板里组件的缩略图一起加载 + UITabGroup headGroup = new UITabGroup(new String[]{COMPONENT, COMPONENT_PACKAGE}) { + public void tabChanged(int newSelectedIndex) { + OnlineWidgetRepoPane.getInstance().setShowPackagePanel(newSelectedIndex != 0); + if (newSelectedIndex == 0) { + cardLayout.show(centerPane, COMPONENT); + } else { + ComponentCollector.getInstance().collectCmpPktClick(); + //延迟组件包面板的初始化,防止组件面板里组件和缩略图和组件包面板里组件的缩略图一起加载 + if (!packagePaneCreated) { + centerPane.add(new OnlineWidgetPackagesShowPane(sharableWidgetPackages), COMPONENT_PACKAGE); + packagePaneCreated = true; + } + cardLayout.show(centerPane, COMPONENT_PACKAGE); + } + } + }; + headGroup.setSelectedIndex(0); + this.centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + jPanel.add(headGroup, BorderLayout.CENTER); + this.add(jPanel, BorderLayout.NORTH); + this.add(centerPane, BorderLayout.CENTER); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/ResourceLoader.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/ResourceLoader.java new file mode 100644 index 000000000..a57a64588 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/ResourceLoader.java @@ -0,0 +1,13 @@ +package com.fr.design.mainframe.share.ui.online; + +/** + * Created by kerry on 2020-12-10 + * todo 后面看看能不能和DataLoad合并起来 + */ +public interface ResourceLoader { + /** + * 加载资源文件 + */ + void load(); + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackageSelectPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackageSelectPane.java new file mode 100644 index 000000000..2271f0c89 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackageSelectPane.java @@ -0,0 +1,40 @@ +package com.fr.design.mainframe.share.ui.online.widgetpackage; + +import com.fr.design.mainframe.share.ui.block.OnlineWidgetPackageBlock; +import com.fr.design.mainframe.share.ui.block.PreviewWidgetBlock; +import com.fr.design.mainframe.share.ui.online.OnlineWidgetSelectPane; +import com.fr.form.share.base.DataLoad; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.constants.ShareComponentConstants; + +/** + * Created by kerry on 2020-10-21 + */ +public class OnlineWidgetPackageSelectPane extends OnlineWidgetSelectPane { + private final OnlineWidgetPackagesShowPane parentPane; + + public OnlineWidgetPackageSelectPane(OnlineShareWidget[] providers, int widgetsPerNum, OnlineWidgetPackagesShowPane parentPane) { + super(providers, widgetsPerNum); + this.parentPane = parentPane; + + } + + public OnlineWidgetPackageSelectPane(DataLoad dataLoad, int widgetsPerNum, OnlineWidgetPackagesShowPane parentPane) { + super(dataLoad, widgetsPerNum); + this.parentPane = parentPane; + + } + + public void showWidgetDetailPane(String id) { + this.parentPane.showWidgetDetailPane(id); + } + + protected PreviewWidgetBlock createWidgetBlock(OnlineShareWidget provider) { + return new OnlineWidgetPackageBlock(provider, this); + } + + protected int getPaneHeight(int count) { + return count * (ShareComponentConstants.SHARE_PACKAGE_BLOCK_HEIGHT + V_GAP); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackagesShowPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackagesShowPane.java new file mode 100644 index 000000000..d9697495b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/widgetpackage/OnlineWidgetPackagesShowPane.java @@ -0,0 +1,183 @@ +package com.fr.design.mainframe.share.ui.online.widgetpackage; + + +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.design.mainframe.share.ui.online.AbstractOnlineWidgetShowPane; +import com.fr.design.mainframe.share.ui.online.OnlineDownloadPackagePane; +import com.fr.design.mainframe.share.ui.online.OnlineWidgetSelectPane; +import com.fr.design.mainframe.share.ui.widgetfilter.FilterPane; +import com.fr.form.share.base.DataLoad; +import com.fr.form.share.bean.OnlineShareWidget; +import com.fr.form.share.utils.ShareUtils; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by kerry on 2020-10-19 + */ +public class OnlineWidgetPackagesShowPane extends AbstractOnlineWidgetShowPane { + private static final Color TEXT_COLOR = Color.decode("#419BF9"); + private static final String WIDGETS_INFO = "WIDGETS_INFO"; + private static final String WIDGET_DETAIL = "WIDGET_DETAIL"; + + private CardLayout cardLayout; + private JPanel centerPane; + private JPanel detailPane; + private String currentPackageId; + private OnlineWidgetSelectPane onlineWidgetSelectPane; + private UILabel downloadLabel; + private final Map cachePanelMap = new HashMap<>(); + + public OnlineWidgetPackagesShowPane(OnlineShareWidget[] sharableWidgetProviders) { + super(sharableWidgetProviders); + } + + protected JPanel initContentPane() { + JPanel firstPane = super.initContentPane(); + cardLayout = new CardLayout(); + centerPane = new JPanel(cardLayout); + centerPane.add(firstPane, WIDGETS_INFO); + + JPanel secondPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel backLabel = createLabel(Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back"), new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + cardLayout.show(centerPane, WIDGETS_INFO); + } + }); + downloadLabel = createLabel(Toolkit.i18nText("Fine-Design_Share_Download_All_Component"), new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + String message = Toolkit.i18nText("Fine-Design_Share_Download_All_Component_Message") + + "\n" + + Toolkit.i18nText("Fine-Design_Share_Total") + + onlineWidgetSelectPane.getSharableWidgetNum() + + Toolkit.i18nText("Fine-Design_Share_Piece"); + int returnValue = FineJOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), message, Toolkit.i18nText("Fine-Design_Basic_Confirm"), FineJOptionPane.YES_NO_OPTION); + if (returnValue == FineJOptionPane.OK_OPTION && onlineWidgetSelectPane.getSharableWidgetNum() != 0) { + downLoadPackage(); + } + } + }); + + JPanel downloadPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + downloadPane.setBorder(BorderFactory.createEmptyBorder(0, 130, 0, 0)); + downloadPane.add(downloadLabel, BorderLayout.CENTER); + + JPanel labelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + labelPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + labelPane.add(backLabel, BorderLayout.WEST); + labelPane.add(downloadPane, BorderLayout.CENTER); + + secondPane.add(labelPane, BorderLayout.NORTH); + detailPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + detailPane.add(new OnlineWidgetSelectPane(new OnlineShareWidget[]{}, 50), BorderLayout.CENTER); + secondPane.add(detailPane, BorderLayout.CENTER); + centerPane.add(secondPane, WIDGET_DETAIL); + cardLayout.show(centerPane, WIDGETS_INFO); + return centerPane; + } + + private void downLoadPackage() { + downloadLabel.setVisible(false); + detailPane.removeAll(); + OnlineDownloadPackagePane widgetSelectPane = new OnlineDownloadPackagePane(this, onlineWidgetSelectPane.getSharableWidgetProviders(), 50); + detailPane.add(widgetSelectPane, BorderLayout.CENTER); + cardLayout.show(centerPane, WIDGET_DETAIL); + + cachePanelMap.put(currentPackageId, widgetSelectPane); + + for (OnlineShareWidget onlineShareWidget : getSharableWidgetProviders()) { + if (StringUtils.equals(onlineShareWidget.getId(), currentPackageId)) { + widgetSelectPane.downloadWidget(onlineShareWidget); + break; + } + } + } + + private UILabel createLabel(String i18nText, MouseClickListener clickListener) { + UILabel label = new UILabel(i18nText); + label.setForeground(TEXT_COLOR); + label.addMouseListener(clickListener); + label.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + return label; + } + + protected void initNorthPane(JPanel jPanel, JPanel northPane) { + //暂时隐藏,以后会展示出来 + } + + + protected OnlineWidgetSelectPane createOnlineWidgetSelectPane(OnlineShareWidget[] sharableWidgetProviders) { + return new OnlineWidgetPackageSelectPane(filterPackageWidget(sharableWidgetProviders), 10, this); + } + + protected OnlineWidgetSelectPane createOnlineWidgetSelectPane(DataLoad dataLoad) { + return new OnlineWidgetPackageSelectPane(dataLoad, 10, this); + } + + private OnlineShareWidget[] filterPackageWidget(OnlineShareWidget[] sharableWidgetProviders) { + List onlineShareWidgets = new ArrayList<>(); + for (OnlineShareWidget widget : sharableWidgetProviders) { + if (widget.isWidgetPackage()) { + onlineShareWidgets.add(widget); + } + } + return onlineShareWidgets.toArray(new OnlineShareWidget[onlineShareWidgets.size()]); + } + + public void showWidgetDetailPane(final String id) { + currentPackageId = id; + boolean containsCache = cachePanelMap.containsKey(id); + onlineWidgetSelectPane = containsCache ? cachePanelMap.get(id) : new OnlineWidgetSelectPane(() -> ShareUtils.getPackageWidgets(id), 50); + downloadLabel.setVisible(!containsCache); + showWidgetDetailPane(onlineWidgetSelectPane); + } + + + public void resetWidgetDetailPane(String id, final OnlineShareWidget[] onlineShareWidgets) { + if (StringUtils.equals(id, currentPackageId)) { + showWidgetDetailPane(new OnlineWidgetSelectPane(onlineShareWidgets, 50)); + setDownloadLabelVisible(true); + } + removeCachePane(id); + } + + private void showWidgetDetailPane(OnlineWidgetSelectPane onlineWidgetSelectPane) { + detailPane.removeAll(); + detailPane.add(onlineWidgetSelectPane, BorderLayout.CENTER); + cardLayout.show(centerPane, WIDGET_DETAIL); + } + + public void setDownloadLabelVisible(boolean visible) { + downloadLabel.setVisible(visible); + } + + public String getCurrentPackageId() { + return currentPackageId; + } + + public void removeCachePane(String packageId) { + cachePanelMap.remove(packageId); + } + + protected FilterPane createFilterPane() { + return FilterPane.createOnlinePackageFilterPane(); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java new file mode 100644 index 000000000..4e8f9ffc5 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPane.java @@ -0,0 +1,237 @@ +package com.fr.design.mainframe.share.ui.widgetfilter; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.ui.base.MouseClickListener; +import com.fr.form.share.bean.WidgetFilterTypeInfo; +import com.fr.form.share.utils.ShareUtils; +import com.fr.general.ComparatorUtils; +import com.fr.invoke.Reflect; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.Popup; +import javax.swing.PopupFactory; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.AWTEvent; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Point; +import java.awt.event.AWTEventListener; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.EventListener; +import java.util.List; + +/** + * Created by kerry on 2020-10-21 + */ +public class FilterPane extends JPanel { + public static final String SOURCE_FILTER_KEY = "2@source"; + public static final String CHART_FILTER_KEY = "3@chart"; + public static final String REPORT_FILTER_KEY = "4@report"; + + private static final Icon FILTER_COMBO = BaseUtils.readIcon("/com/fr/base/images/share/filter_combo.png"); + private static final Icon FILTER_COMBO_UP = BaseUtils.readIcon("/com/fr/base/images/share/filter_combo_up.png"); + private final UILabel filterLabel; + private UILabel arrowButton; + private Popup popup; + private boolean showPopup = false; + private FilterPopupPane filterPopupPane; + private List changeListenerList = new ArrayList<>(); + private final AWTEventListener awtEventListener; + List listenerList = new ArrayList<>(); + + private FilterPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + final JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBorder(BorderFactory.createLineBorder(Color.decode("#D9DADD"))); + this.add(jPanel, BorderLayout.CENTER); + jPanel.setBackground(Color.WHITE); + this.filterLabel = new UILabel(Toolkit.i18nText("Fine-Design_Share_Online_No_Filter"), SwingConstants.LEFT); + filterLabel.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0)); + filterLabel.setPreferredSize(new Dimension(80, 20)); + filterLabel.setForeground(Color.decode("#8F8F92")); + filterLabel.addMouseListener(new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + if (filterPopupPane != null) { + if (filterPopupPane.hasFilter()) { + filterPopupPane.reset(); + } else { + controlFilterPopUp(); + } + } + + } + }); + jPanel.addMouseListener( + new MouseClickListener() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + controlFilterPopUp(); + } + } + ); + JPanel subPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + subPane.add(filterLabel); + subPane.setBackground(Color.WHITE); + jPanel.add(subPane, BorderLayout.CENTER); + arrowButton = new UILabel(FILTER_COMBO); + awtEventListener = event -> { + if (event instanceof MouseEvent) { + MouseEvent mv = (MouseEvent) event; + if (isCanHide(mv, jPanel)) { + hideFilterPopUp(); + } + } + + }; + jPanel.add(arrowButton, BorderLayout.EAST); + } + + public static FilterPane createLocalFilterPane() { + FilterPane pane = new FilterPane(); + pane.filterPopupPane = new LocalFilterPopupPane(pane, LocalWidgetFilterCategory.getLocalCategory()); + return pane; + } + + public static FilterPane createOnlineFilterPane() { + FilterPane pane = new FilterPane(); + pane.filterPopupPane = new OnlineFilterPopupPane(pane, pane.loadFilterCategories()); + return pane; + } + + public static FilterPane createOnlinePackageFilterPane() { + FilterPane pane = new FilterPane() { + @Override + protected List loadFilterCategories() { + List filterTypeInfos = super.loadFilterCategories(); + filterTypeInfos.removeIf(info -> ComparatorUtils.equals(FilterPane.CHART_FILTER_KEY, info.getKey()) + || ComparatorUtils.equals(FilterPane.REPORT_FILTER_KEY, info.getKey())); + return filterTypeInfos; + } + }; + pane.filterPopupPane = new LocalFilterPopupPane(pane, pane.loadFilterCategories()); + return pane; + } + + public void changeFilterButtonStatus(boolean hasFilter) { + if (hasFilter) { + switchToClearFilter(); + } else { + switchToNoFilter(); + } + } + + public boolean isShowPopup() { + return showPopup; + } + + private void controlFilterPopUp() { + if (!showPopup) { + showFilterPopUp(); + } else { + hideFilterPopUp(); + } + } + + private synchronized void showFilterPopUp() { + PopupFactory pf = PopupFactory.getSharedInstance(); + Point p = FilterPane.this.getLocationOnScreen(); + popup = pf.getPopup(FilterPane.this, filterPopupPane, p.x, p.y + FilterPane.this.getHeight()); + popup.show(); + filterPopupPane.setPreferredSize(new Dimension(228, filterPopupPane.getHeight())); + showPopup = true; + arrowButton.setIcon(FILTER_COMBO_UP); + firePopupStateChange(true); + java.awt.Toolkit.getDefaultToolkit().addAWTEventListener(awtEventListener, AWTEvent.MOUSE_EVENT_MASK); + } + + private void hideFilterPopUp() { + popup.hide(); + showPopup = false; + arrowButton.setIcon(FILTER_COMBO); + firePopupStateChange(false); + java.awt.Toolkit.getDefaultToolkit().removeAWTEventListener(awtEventListener); + } + + protected List loadFilterCategories() { + return ShareUtils.getWidgetFilterTypeInfos(); + } + + private boolean isCanHide(MouseEvent mv, JPanel jPanel) { + if (mv.getClickCount() < 1) { + return false; + } + // 表示Popup弹窗是否能被点击到 + boolean clickFlag = false; + if (popup != null && showPopup) { + Component component = Reflect.on(popup).call("getComponent").get(); + Point p = component.getLocationOnScreen(); + Point clickPoint = mv.getLocationOnScreen(); + clickFlag = clickPoint.getX() >= p.getX() + && clickPoint.getY() >= p.getY() + && clickPoint.getX() <= component.getWidth() + p.getX() + && clickPoint.getY() <= p.getY() + component.getHeight(); + + } + return popup != null && showPopup + && !clickFlag && !ComparatorUtils.equals(mv.getSource(), jPanel) + && !ComparatorUtils.equals(mv.getSource(), filterLabel); + } + + public void registerChangeListener(ChangeListener changeListener) { + changeListenerList.add(changeListener); + } + + public void fireChangeListener(ChangeEvent e) { + for (ChangeListener changeListener : changeListenerList) { + changeListener.stateChanged(e); + } + } + + public void reset() { + if (filterPopupPane != null && filterPopupPane.hasFilter()) { + filterPopupPane.reset(); + } + switchToNoFilter(); + } + + private void switchToNoFilter() { + filterLabel.setText(Toolkit.i18nText("Fine-Design_Share_Online_No_Filter")); + filterLabel.setForeground(Color.decode("#8F8F92")); + filterLabel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + + private void switchToClearFilter() { + filterLabel.setText(Toolkit.i18nText("Fine-Design_Share_Online_Clear_Filter")); + filterLabel.setForeground(Color.decode("#419BF9")); + filterLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); + } + + public void firePopupStateChange(boolean PopupState) { + for (PopStateChangeListener listener : listenerList) { + listener.stateChange(PopupState); + } + } + + public void addPopupStateChangeListener(PopStateChangeListener listener) { + listenerList.add(listener); + } + + public interface PopStateChangeListener extends EventListener { + void stateChange(boolean state); + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPopupPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPopupPane.java new file mode 100644 index 000000000..e2bcd5344 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/FilterPopupPane.java @@ -0,0 +1,201 @@ +package com.fr.design.mainframe.share.ui.widgetfilter; + +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.form.share.bean.WidgetFilterInfo; +import com.fr.form.share.bean.WidgetFilterTypeInfo; +import com.fr.general.ComparatorUtils; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.event.ChangeEvent; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author: Yuan.Wang + * @Date: 2020/11/11 + */ +public abstract class FilterPopupPane extends JPanel { + private static final Color BORDER_COLOR = Color.decode("#D9DADD"); + private static final String FILTER_ALL_ID = "0"; + + FilterPane filterPane; + private List filterList = new ArrayList<>(); + private final List checkBoxList = new ArrayList<>(); + private boolean reset = false; + + + public FilterPopupPane(FilterPane filterPane, List widgetFilterCategories) { + this.filterPane = filterPane; + initPane(widgetFilterCategories); + } + + private void initPane(List widgetFilterCategories) { + this.setBackground(Color.WHITE); + this.setBorder(BorderFactory.createLineBorder(BORDER_COLOR)); + this.setForeground(Color.decode("#FFFFFF")); + this.setLayout(new BorderLayout()); + this.add(createVerticalFlowPane(widgetFilterCategories), BorderLayout.CENTER); + } + + public boolean hasFilter() { + return filterList.size() > 0; + } + + protected List getFilterList() { + return filterList; + } + + private JPanel createVerticalFlowPane(List widgetFilterCategories) { + + List topWidgetTypeFilter = new ArrayList<>(); + List widgetTypeFilter = new ArrayList<>(); + List otherWidgetTypeFilter = new ArrayList<>(); + + for (WidgetFilterTypeInfo info : widgetFilterCategories) { + if (ComparatorUtils.equals(FilterPane.CHART_FILTER_KEY, info.getKey()) + || ComparatorUtils.equals(FilterPane.REPORT_FILTER_KEY, info.getKey())) { + widgetTypeFilter.add(info); + } else if (ComparatorUtils.equals(FilterPane.SOURCE_FILTER_KEY, info.getKey())) { + topWidgetTypeFilter.add(info); + } else { + otherWidgetTypeFilter.add(info); + } + } + + JPanel verticalFlowPane = new JPanel(); + verticalFlowPane.setBackground(Color.WHITE); + VerticalFlowLayout layout = new VerticalFlowLayout(FlowLayout.LEADING, 0, 10); + layout.setAlignLeft(true); + verticalFlowPane.setLayout(layout); + + verticalFlowPane.setBackground(Color.WHITE); + verticalFlowPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + + for (WidgetFilterTypeInfo info : topWidgetTypeFilter) { + verticalFlowPane.add(createOtherCategoryPane(info)); + } + if (widgetTypeFilter.size() > 0) { + verticalFlowPane.add(createWidgetTypeFilterPane(widgetTypeFilter)); + } + for (WidgetFilterTypeInfo info : otherWidgetTypeFilter) { + verticalFlowPane.add(createOtherCategoryPane(info)); + } + return verticalFlowPane; + } + + private JPanel createWidgetTypeFilterPane(List widgetTypeFilter) { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBackground(Color.WHITE); + UILabel titleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Type")); + titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + titleLabel.setPreferredSize(new Dimension(226, 20)); + titleLabel.setOpaque(true); + titleLabel.setBackground(Color.decode("#EDEDEE")); + jPanel.add(titleLabel, BorderLayout.NORTH); + + JPanel contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); + contentPane.setBackground(Color.WHITE); + for (WidgetFilterTypeInfo info : widgetTypeFilter) { + contentPane.add(createTypeFilterPane(info)); + } + jPanel.add(contentPane, BorderLayout.CENTER); + return jPanel; + } + + private JPanel createTypeFilterPane(WidgetFilterTypeInfo widgetFilterTypeInfo) { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBackground(Color.WHITE); + UILabel titleLabel = new UILabel(widgetFilterTypeInfo.getTitle() + ":"); + titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + titleLabel.setFont(new Font(titleLabel.getFont().getName(), Font.BOLD, titleLabel.getFont().getSize())); + jPanel.add(titleLabel, BorderLayout.NORTH); + jPanel.add(createCategoryDetailPane(widgetFilterTypeInfo), BorderLayout.CENTER); + return jPanel; + } + + private JPanel createOtherCategoryPane(WidgetFilterTypeInfo filterTypeInfo) { + JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + jPanel.setBackground(Color.WHITE); + UILabel titleLabel = new UILabel(filterTypeInfo.getTitle()); + titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + titleLabel.setPreferredSize(new Dimension(226, 20)); + titleLabel.setOpaque(true); + titleLabel.setBackground(Color.decode("#EDEDEE")); + jPanel.add(titleLabel, BorderLayout.NORTH); + jPanel.add(createCategoryDetailPane(filterTypeInfo), BorderLayout.CENTER); + return jPanel; + } + + private JPanel createCategoryDetailPane(WidgetFilterTypeInfo filterTypeInfo) { + JPanel contentPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2); + contentPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + contentPane.setBackground(Color.WHITE); + int displayCount = 0; + for (final WidgetFilterInfo filterInfo : filterTypeInfo.getFilterItems()) { + if (!ComparatorUtils.equals(FILTER_ALL_ID, filterInfo.getId())) { + displayCount++; + } + } + int contentPaneHeight = ((displayCount + 1) / 2) * 27; + contentPane.setPreferredSize(new Dimension(228, contentPaneHeight)); + for (final WidgetFilterInfo filterInfo : filterTypeInfo.getFilterItems()) { + if (ComparatorUtils.equals(FILTER_ALL_ID, filterInfo.getId())) { + continue; + } + final UICheckBox checkBox = new UICheckBox(filterInfo.getName()); + checkBox.setBackground(Color.WHITE); + + checkBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + if (reset) { + return; + } + if (checkBox.isSelected()) { + filterList.add(filterInfo); + } else if (filterList.contains(filterInfo)) { + filterList.remove(filterInfo); + } + checkFilterButtonStatus(); + filterPane.fireChangeListener(new ChangeEvent(assembleFilter())); + } + }); + + + checkBoxList.add(checkBox); + contentPane.add(checkBox); + } + return contentPane; + } + + protected abstract String assembleFilter(); + + private void checkFilterButtonStatus() { + filterPane.changeFilterButtonStatus(hasFilter()); + } + + public void reset() { + reset = true; + for (UICheckBox checkBox : checkBoxList) { + checkBox.setSelected(false); + } + filterList.clear(); + checkFilterButtonStatus(); + filterPane.fireChangeListener(new ChangeEvent(StringUtils.EMPTY)); + reset = false; + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalFilterPopupPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalFilterPopupPane.java new file mode 100644 index 000000000..5a589d32c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalFilterPopupPane.java @@ -0,0 +1,23 @@ +package com.fr.design.mainframe.share.ui.widgetfilter; + +import com.fr.form.share.bean.WidgetFilterTypeInfo; +import com.fr.stable.StringUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author: Yuan.Wang + * @Date: 2020/11/11 + */ +public class LocalFilterPopupPane extends FilterPopupPane { + public LocalFilterPopupPane(FilterPane pane, List loadFilterCategories) { + super(pane, loadFilterCategories); + } + + @Override + protected String assembleFilter() { + LocalWidgetFilter.getInstance().setFilterList(getFilterList() == null ? new ArrayList<>() : getFilterList()); + return StringUtils.EMPTY; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalWidgetFilter.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalWidgetFilter.java new file mode 100644 index 000000000..259e6fcc9 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalWidgetFilter.java @@ -0,0 +1,139 @@ +package com.fr.design.mainframe.share.ui.widgetfilter; + +import com.fr.design.i18n.Toolkit; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.bean.WidgetFilterInfo; +import com.fr.design.mainframe.share.constants.DisplayDevice; +import com.fr.stable.ArrayUtils; +import com.fr.stable.StringUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author: Yuan.Wang + * @Date: 2020/11/11 + */ +public class LocalWidgetFilter { + private List filterList; + + private LocalWidgetFilter() { + filterList = new ArrayList<>(); + } + + private static class Holder { + private static final LocalWidgetFilter HOLDER = new LocalWidgetFilter(); + } + + public static LocalWidgetFilter getInstance() { + return Holder.HOLDER; + } + + public void setFilterList(List filterList) { + this.filterList = filterList; + } + + public boolean shouldShow(SharableWidgetProvider provider) { + if (filterList == null || filterList.size() == 0) { + return true; + } + if (provider instanceof DefaultSharableWidget) { + DefaultSharableWidget bindInfo = (DefaultSharableWidget) provider; + //类型,即图表类型或报表类型 + boolean sameType = true; + //展示终端,即PC端、移动端 + boolean sameDisplayDevice = true; + //价格,即免费或者付费 + boolean sameSource = true; + + //如果有筛选条件,先初始化为false + for (WidgetFilterInfo filterInfo : filterList) { + if (StringUtils.equals(filterInfo.getType(), "chart") | StringUtils.equals(filterInfo.getType(), "report")) { + sameType = false; + } + if (StringUtils.equals(filterInfo.getType(), "displayDevice")) { + sameDisplayDevice = false; + } + if (StringUtils.equals(filterInfo.getType(), "source")) { + sameSource = false; + } + } + //符合条件,设置为true + for (WidgetFilterInfo filterInfo : filterList) { + //类型 + sameType |= filterType(filterInfo, bindInfo); + //展示终端 + sameDisplayDevice |= filterDisplayDevice(filterInfo, bindInfo); + //来源 + sameSource |= filterSource(filterInfo, bindInfo); + } + return sameDisplayDevice & sameSource & sameType; + } + return false; + } + + public SharableWidgetProvider[] filter(SharableWidgetProvider[] elCaseBindInfoList) { + SharableWidgetProvider[] result = elCaseBindInfoList; + for (SharableWidgetProvider provider : result) { + if (!LocalWidgetFilter.getInstance().shouldShow(provider)) { + result = ArrayUtils.removeElement(result, provider); + } + } + return result; + } + + public boolean hasFilter() { + return filterList != null && filterList.size() != 0; + } + + private boolean filterType(WidgetFilterInfo filterInfo, DefaultSharableWidget bindInfo) { + //图表报表类型 + if (StringUtils.equals(filterInfo.getType(), "chart") | StringUtils.equals(filterInfo.getType(), "report")) { + //图表、报表类型改名之后的兼容 + if (sameType(filterInfo, bindInfo)) { + return true; + } + return StringUtils.equals(bindInfo.getChildClassify(), filterInfo.getName()); + } + return false; + } + + private boolean filterDisplayDevice(WidgetFilterInfo filterInfo, DefaultSharableWidget bindInfo) { + if (StringUtils.equals(filterInfo.getType(), "displayDevice")) { + boolean sameMobile = StringUtils.equals(filterInfo.getName(), "移动端") & DisplayDevice.supportMobile(bindInfo.getDisplayDevice()); + boolean samePC = StringUtils.equals(filterInfo.getName(), "PC端") & DisplayDevice.supportPC(bindInfo.getDisplayDevice()); + //filterInfo的设备信息 = bindInfo的设备信息,为true + return sameMobile | samePC; + } + return false; + } + + private boolean filterSource(WidgetFilterInfo filterInfo, DefaultSharableWidget bindInfo) { + if (StringUtils.equals(filterInfo.getType(), "source")) { + boolean sameMarket = StringUtils.equals(filterInfo.getName(), "商城") && StringUtils.equals(bindInfo.getSource(), DefaultSharableWidget.MARKET); + boolean sameLocal = StringUtils.equals(filterInfo.getName(), "本地") && StringUtils.equals(bindInfo.getSource(), DefaultSharableWidget.LOCAL); + return sameMarket | sameLocal; + } + return false; + } + + private boolean sameType(WidgetFilterInfo filterInfo, DefaultSharableWidget bindInfo) { + //旧:其他 新:其它图表 + boolean other = StringUtils.equals(filterInfo.getName(), Toolkit.i18nText("Fine-Design_Share_Type_Chart_Other")) + && (StringUtils.equals(bindInfo.getChildClassify(), Toolkit.i18nText("Fine-Design_Share_Type_Chart_Other")) + || StringUtils.equals(bindInfo.getChildClassify(), Toolkit.i18nText("Fine-Design_Share_Type_Others"))); + + //旧:移动维度切换 新:多维度切换 + boolean dimensionChange = StringUtils.equals(filterInfo.getName(), Toolkit.i18nText("Fine-Design_Share_Type_Dimension_Change")) + && (StringUtils.equals(bindInfo.getChildClassify(), Toolkit.i18nText("Fine-Design_Share_Type_Mobile_Dimension_Change")) + || StringUtils.equals(bindInfo.getChildClassify(), Toolkit.i18nText("Fine-Design_Share_Type_Dimension_Change"))); + + //旧:移动填报 新:填报 + boolean fill = StringUtils.equals(filterInfo.getName(), Toolkit.i18nText("Fine-Design_Share_Type_Fill")) + && (StringUtils.equals(bindInfo.getChildClassify(), Toolkit.i18nText("Fine-Design_Share_Type_Fill")) + || StringUtils.equals(bindInfo.getChildClassify(), Toolkit.i18nText("Fine-Design_Share_Type_Mobile_Fill"))); + + return other | dimensionChange | fill; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalWidgetFilterCategory.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalWidgetFilterCategory.java new file mode 100644 index 000000000..9e5d4f34e --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/LocalWidgetFilterCategory.java @@ -0,0 +1,82 @@ +package com.fr.design.mainframe.share.ui.widgetfilter; + +import com.fr.form.share.bean.WidgetFilterInfo; +import com.fr.form.share.bean.WidgetFilterTypeInfo; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author: Yuan.Wang + * @Date: 2020/11/12 + */ +public class LocalWidgetFilterCategory { + + public static List getLocalCategory() { + List category = new ArrayList<>(); + + WidgetFilterTypeInfo source = new WidgetFilterTypeInfo(); + source.setTitle("来源"); + source.setKey("2@source"); + source.addFilterItem(new WidgetFilterInfo("本地", "1", "source")); + source.addFilterItem(new WidgetFilterInfo("商城", "2", "source")); + source.addFilterItem(new WidgetFilterInfo("全部", "0", "source")); + + WidgetFilterTypeInfo displayDevice = new WidgetFilterTypeInfo(); + displayDevice.setTitle("展示终端"); + displayDevice.setKey("1@displayDevice"); + displayDevice.addFilterItem(new WidgetFilterInfo("PC端", "1", "displayDevice")); + displayDevice.addFilterItem(new WidgetFilterInfo("移动端", "2", "displayDevice")); + displayDevice.addFilterItem(new WidgetFilterInfo("全部", "0", "displayDevice")); + + WidgetFilterTypeInfo fee = new WidgetFilterTypeInfo(); + fee.setTitle("价格"); + fee.setKey("2@fee"); + fee.addFilterItem(new WidgetFilterInfo("付费", "2", "fee")); + fee.addFilterItem(new WidgetFilterInfo("免费", "1", "fee")); + fee.addFilterItem(new WidgetFilterInfo("全部", "0", "fee")); + + WidgetFilterTypeInfo chart = new WidgetFilterTypeInfo(); + chart.setTitle("基础元素"); + chart.setKey("3@chart"); + chart.addFilterItem(new WidgetFilterInfo("柱形图/条形图", "1", "chart")); + chart.addFilterItem(new WidgetFilterInfo("折线图", "3", "chart")); + chart.addFilterItem(new WidgetFilterInfo("组合图", "4", "chart")); + chart.addFilterItem(new WidgetFilterInfo("饼图", "2", "chart")); + chart.addFilterItem(new WidgetFilterInfo("仪表盘", "5", "chart")); + chart.addFilterItem(new WidgetFilterInfo("地图", "6", "chart")); + chart.addFilterItem(new WidgetFilterInfo("其他图表", "7", "chart")); + chart.addFilterItem(new WidgetFilterInfo("明细表", "8", "chart")); + chart.addFilterItem(new WidgetFilterInfo("基础控件", "9", "chart")); + chart.addFilterItem(new WidgetFilterInfo("全部", "0", "chart")); + + WidgetFilterTypeInfo report = new WidgetFilterTypeInfo(); + report.setTitle("综合应用"); + report.setKey("4@report"); + report.addFilterItem(new WidgetFilterInfo("指标卡", "1", "report")); + report.addFilterItem(new WidgetFilterInfo("标题头", "2", "report")); + report.addFilterItem(new WidgetFilterInfo("特殊功能卡", "4", "report")); + report.addFilterItem(new WidgetFilterInfo("多维度切换", "5", "report")); + report.addFilterItem(new WidgetFilterInfo("移动目录导航", "6", "report")); + report.addFilterItem(new WidgetFilterInfo("填报", "8", "report")); + report.addFilterItem(new WidgetFilterInfo("全部", "0", "report")); + + WidgetFilterTypeInfo style = new WidgetFilterTypeInfo(); + style.setTitle("风格"); + style.setKey("5@style"); + style.addFilterItem(new WidgetFilterInfo("简约清新", "1", "style")); + style.addFilterItem(new WidgetFilterInfo("商务稳重", "2", "style")); + style.addFilterItem(new WidgetFilterInfo("活泼绚丽", "3", "style")); + style.addFilterItem(new WidgetFilterInfo("酷炫科技", "4", "style")); + style.addFilterItem(new WidgetFilterInfo("其他风格", "5", "style")); + style.addFilterItem(new WidgetFilterInfo("全部", "0", "style")); + + category.add(displayDevice); + category.add(source); + category.add(chart); + category.add(report); + return category; + + } + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/OnlineFilterPopupPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/OnlineFilterPopupPane.java new file mode 100644 index 000000000..2543b4a77 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/widgetfilter/OnlineFilterPopupPane.java @@ -0,0 +1,23 @@ +package com.fr.design.mainframe.share.ui.widgetfilter; + +import com.fr.form.share.bean.WidgetFilterTypeInfo; +import com.fr.form.share.utils.ShareUtils; + +import java.util.List; + +/** + * @Author: Yuan.Wang + * @Date: 2020/11/11 + */ +public class OnlineFilterPopupPane extends FilterPopupPane { + + public OnlineFilterPopupPane(FilterPane filterPane, List widgetFilterCategories) { + super(filterPane, widgetFilterCategories); + } + + protected String assembleFilter() { + return ShareUtils.assembleFilter(getFilterList()); + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java new file mode 100644 index 000000000..96c2cc28c --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/DownloadUtils.java @@ -0,0 +1,169 @@ +package com.fr.design.mainframe.share.util; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.extra.PluginConstants; +import com.fr.form.share.base.CancelCheck; +import com.fr.form.share.constants.ShareComponentConstants; +import com.fr.ftp.util.Base64; +import com.fr.general.CloudCenter; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; +import com.fr.third.org.apache.http.HttpEntity; +import com.fr.third.org.apache.http.HttpException; +import com.fr.third.org.apache.http.HttpStatus; +import com.fr.third.org.apache.http.client.config.CookieSpecs; +import com.fr.third.org.apache.http.client.config.RequestConfig; +import com.fr.third.org.apache.http.client.methods.CloseableHttpResponse; +import com.fr.third.org.apache.http.client.methods.HttpUriRequest; +import com.fr.third.org.apache.http.client.methods.RequestBuilder; +import com.fr.third.org.apache.http.impl.client.BasicCookieStore; +import com.fr.third.org.apache.http.impl.client.CloseableHttpClient; +import com.fr.third.org.apache.http.impl.client.HttpClients; +import org.jetbrains.annotations.NotNull; + +import javax.crypto.Cipher; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.security.KeyFactory; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.X509EncodedKeySpec; + +/** + * created by Harrison on 2020/05/27 + **/ +public class DownloadUtils { + private static final String REUSES_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo") + "file/download"; + private static final String PACKAGE_REUSES_URL = CloudCenter.getInstance().acquireUrlByKind("af.reuseInfo") + "package/download/"; + private static final String CERTIFICATE_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCtsz62CPSWXZE/IYZRiAuTSZkw\n" + + "1WOwer8+JFktK0uKLAUuQoBr+UjAMFtRA8W7JgKMDwZy/2liEAiXEOSPU/hrdV8D\n" + + "tT541LnGi1X/hXiRwuttPWYN3L2GYm/d5blU+FBNwghBIrdAxXTzYBc6P4KL/oYX\n" + + "nMdTIrkz8tYkG3QoFQIDAQAB"; + + + private static CloseableHttpClient createClient() { + + BasicCookieStore cookieStore = new BasicCookieStore(); + return HttpClients.custom() + .setDefaultRequestConfig(RequestConfig.custom() + .setCookieSpec(CookieSpecs.STANDARD).build()) + .setDefaultCookieStore(cookieStore) + .build(); + } + + @NotNull + public static String download(String id, String fileName, com.fr.design.extra.Process process) throws Exception { + CloseableHttpResponse fileRes = getHttpResponse(REUSES_URL, id); + if (fileRes.getStatusLine().getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY) { + fileRes = getHttpResponse(fileRes.getHeaders("Location")[0].getValue()); + } + if (fileRes.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + String realPath = StableUtils.pathJoin(ProductConstants.getEnvHome(), ShareComponentConstants.PLUGIN_CACHE, ShareComponentConstants.DOWNLOAD_SHARE); + String filePath; + + HttpEntity entity = fileRes.getEntity(); + long totalSize = entity.getContentLength(); + + InputStream content = entity.getContent(); + filePath = StableUtils.pathJoin(realPath, fileName + ".reu"); + StableUtils.makesureFileExist(new File(filePath)); + FileOutputStream writer = new FileOutputStream(filePath); + byte[] data = new byte[PluginConstants.BYTES_NUM]; + int bytesRead; + int totalBytesRead = 0; + + while ((bytesRead = content.read(data)) > 0) { + writer.write(data, 0, bytesRead); + data = new byte[PluginConstants.BYTES_NUM]; + totalBytesRead += bytesRead; + process.process(totalBytesRead / (double) totalSize); + } + content.close(); + writer.flush(); + writer.close(); + FineLoggerFactory.getLogger().info("download widget{} success", id); + return filePath; + } else { + FineLoggerFactory.getLogger().info("download widget{} failed", id); + throw new HttpException(); + } + } + + public static String downloadPackage(String id, String fileName, CancelCheck cancelCheck) throws Exception { + + CloseableHttpResponse fileRes = getHttpResponse(PACKAGE_REUSES_URL, id); + if (fileRes.getStatusLine().getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY) { + fileRes = getHttpResponse(fileRes.getHeaders("Location")[0].getValue()); + } + String realPath = StableUtils.pathJoin(ProductConstants.getEnvHome(), ShareComponentConstants.PLUGIN_CACHE, ShareComponentConstants.DOWNLOAD_PACKAGE_SHARE); + String filePath; + if (fileRes.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + HttpEntity entity = fileRes.getEntity(); + filePath = StableUtils.pathJoin(realPath, fileName + ".reus"); + StableUtils.makesureFileExist(new File(filePath)); + + InputStream content = entity.getContent(); + FileOutputStream writer = new FileOutputStream(filePath); + + byte[] data = new byte[PluginConstants.BYTES_NUM * 20]; + int bytesRead; + + while (!cancelCheck.isCanceled() && (bytesRead = content.read(data)) > 0) { + writer.write(data, 0, bytesRead); + data = new byte[PluginConstants.BYTES_NUM * 20]; + } + + content.close(); + writer.flush(); + writer.close(); + if (cancelCheck.isCanceled()) { + FineLoggerFactory.getLogger().info("download widget{} canceled", id); + } else { + FineLoggerFactory.getLogger().info("download widget{} failed", id); + } + return filePath; + } else { + FineLoggerFactory.getLogger().info("download widget{} failed", id); + throw new HttpException(); + } + } + + private static CloseableHttpResponse getHttpResponse(String url, String id) throws Exception { + //先登录一下。不然可能失败 + CloseableHttpClient client = createClient(); + FineLoggerFactory.getLogger().info("login fr-market"); + FineLoggerFactory.getLogger().info("start download widget {}", id); + HttpUriRequest file = RequestBuilder.post() + .setHeader("User-Agent", "Mozilla/5.0") + .setUri(url).addParameter("id", encrypt(id)).addParameter("userId", + String.valueOf(DesignerEnvManager.getEnvManager().getDesignerLoginUid())) + .build(); + return client.execute(file); + } + + + private static CloseableHttpResponse getHttpResponse(String url) throws Exception { + //先登录一下。不然可能失败 + CloseableHttpClient client = createClient(); + HttpUriRequest file = RequestBuilder.get() + .setUri(url) + .build(); + return client.execute(file); + } + + + private static String encrypt(String str) throws Exception { + //base64编码的公钥 + byte[] decoded = Base64.decodeBase64(CERTIFICATE_PUBLIC_KEY); + RSAPublicKey pubKey = (RSAPublicKey) KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(decoded)); + //RSA加密 + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, pubKey); + String outStr = Base64.encodeBase64String(cipher.doFinal(str.getBytes(StandardCharsets.UTF_8))); + return outStr; + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java new file mode 100644 index 000000000..8c88de20b --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallComponentHelper.java @@ -0,0 +1,69 @@ +package com.fr.design.mainframe.share.util; + +import com.fr.design.mainframe.reuse.SnapChatKeys; +import com.fr.design.notification.SnapChat; +import com.fr.design.notification.SnapChatFactory; +import com.fr.form.share.constants.ComponentPath; +import com.fr.form.share.group.filter.DirFilter; +import com.fr.form.share.group.filter.ReuFilter; +import com.fr.io.utils.ResourceIOUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ArrayUtils; +import com.fr.stable.StableUtils; +import com.fr.workspace.WorkContext; + +import java.io.InputStream; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/4 + */ +public class InstallComponentHelper { + + private static final String PRE_INSTALL_PATH = "/com/fr/form/share/components"; + private static final String[] PRE_INSTALL_COMPONENTS = new String[]{ + "单行指标卡.f3df58b3-4302-4cab-ab77-caaf225de60a.reu", + "分层雷达图-深色.49f8397c-e6a6-482a-acc7-46d8cec353a4.reu", + "红绿灯表格-浅色.d0466992-328a-4ccf-ad67-6cbc844d669c.reu", + "进度表格-深色.de4141ce-5c25-4506-9424-f5aa15fbf6d0.reu", + "三列指标卡.61a83d18-a162-4dc3-aa57-3b954edaf82e.reu", + "透明按钮切换图表.e373e13a-3da0-4c29-91bc-9ae804241023.reu" + }; + + public static void installPreComponent() { + if (needPreInstallComponent()) { + for (String componentPath : PRE_INSTALL_COMPONENTS) { + try { + InputStream inputStream = InstallComponentHelper.class.getResourceAsStream(StableUtils.pathJoin(PRE_INSTALL_PATH, componentPath)); + byte[] data = ResourceIOUtils.inputStream2Bytes(inputStream); + WorkContext.getWorkResource().write(StableUtils.pathJoin(ComponentPath.SHARE_PATH.path(), componentPath), data); + } catch (Exception e) { + FineLoggerFactory.getLogger().error("install Component filed" + e.getMessage(), e); + } + } + } + + } + + private static boolean needPreInstallComponent() { + try { + //老用户或者组件库里已有组件,不预装组件 + SnapChat snapChat = SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT); + return !snapChat.hasRead() && !hasComponentInstalled(); + } catch (Throwable e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + return false; + } + + /** + * 判断是否已有组件被安装 + */ + private static boolean hasComponentInstalled() { + String sharePath = ComponentPath.SHARE_PATH.path(); + String[] components = WorkContext.getWorkResource().list(sharePath, new ReuFilter()); + String[] dirs = WorkContext.getWorkResource().list(sharePath, new DirFilter()); + return components != null && ArrayUtils.isNotEmpty(components) + || (dirs != null && ArrayUtils.isNotEmpty(dirs)); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java new file mode 100644 index 000000000..c25f53f51 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/InstallUtils.java @@ -0,0 +1,150 @@ +package com.fr.design.mainframe.share.util; + +import com.fr.form.share.group.DefaultShareGroup; +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; +import com.fr.form.share.group.TempFileOperator; +import com.fr.form.share.utils.ReuxUtils; +import com.fr.form.share.utils.ShareUtils; +import com.fr.io.repository.base.fs.FileSystemRepository; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; +import com.fr.stable.project.ProjectConstants; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author: Yuan.Wang + * @Date: 2020/12/21 + */ +public class InstallUtils { + + private static final String DOT = "."; + + /** + * 安装组件包 + */ + public static boolean installReusFile(File chosenFile, long installTime, List list) { + return installReusFile(chosenFile, installTime, list, o -> { + //do nothing + }).installStatus; + } + + /** + * 安装组件包 + */ + public static InstallResult installReusFile(File chosenFile, long installTime, List list, com.fr.design.extra.Process process) { + Group group = createComponentGroup(chosenFile.getName()); + if (group == null) { + return new InstallResult(false, null); + } + int totalFileNum; + int installedFileNum = 0; + try (TempFileOperator tempFilOperator = new TempFileOperator(getUnZipCacheDir())) { + File[] files = unZipReuxsFile(chosenFile, tempFilOperator.getTempFilePath()); + totalFileNum = files.length; + boolean installStatus = true; + for (File file : files) { + boolean success = installReuFile(group, file, installTime); + if (!success) { + list.add(getFilePrefix(chosenFile) + ": " + getFilePrefix(file)); + } + installedFileNum++; + process.process(installedFileNum / (double) totalFileNum); + installStatus &= success; + } + return new InstallResult(installStatus, group); + } catch (Exception e) { + process.process(1.0); + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return new InstallResult(false, group); + } + + } + + /** + * 安装组件 + */ + public static boolean installReuFile(File chosenFile, long installTime, List list) { + Group defaultGroup = DefaultShareGroupManager.getInstance().getGroup(DefaultShareGroup.GROUP_NAME); + if (defaultGroup == null) { + return false; + } + boolean success = installReuFile(defaultGroup, chosenFile, installTime); + if (!success) { + list.add(getFilePrefix(chosenFile)); + } + return success; + } + + @Nullable + private static Group createComponentGroup(String fileName) { + String groupName = fileName.substring(0, fileName.indexOf(DOT + ReuxUtils.REUS_SUFFIX)); + + //有重名分组则加后缀 + if (DefaultShareGroupManager.getInstance().getGroup(groupName) != null) { + int suffix = 1; + while (DefaultShareGroupManager.getInstance().getGroup(groupName + suffix) != null) { + suffix++; + } + groupName = groupName + suffix; + } + + if (!DefaultShareGroupManager.getInstance().createGroup(groupName)) { + return null; + } + return DefaultShareGroupManager.getInstance().getGroup(groupName); + } + + private static boolean installReuFile(Group group, File chosenFile, long installTime) { + try { + if (!group.installModule(chosenFile)) { + return false; + } + ShareUtils.recordInstallTime(chosenFile.getName(), installTime); + return true; + } catch (IOException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + return false; + } + } + + private static File[] unZipReuxsFile(File chosenFile, String tempFilePath) throws IOException { + List files = new ArrayList<>(); + ReuxUtils.unzipRueFile(chosenFile, tempFilePath); + String[] components = FileSystemRepository.getSingleton().list(tempFilePath, s -> s.endsWith(ProjectConstants.REU)); + for (String component : components) { + files.add(new File(StableUtils.pathJoin(tempFilePath, component))); + } + return files.toArray(new File[files.size()]); + } + + private static String getUnZipCacheDir() { + return StableUtils.pathJoin(ProductConstants.getEnvHome(), "plugin_cache", "reu_share_temp"); + } + + private static String getFilePrefix(File file) { + String fileName = file.getName(); + return fileName.contains(DOT) ? fileName.substring(0, fileName.indexOf(DOT)) : fileName; + } + + /** + * 安装的返回结果 + */ + public static class InstallResult { + public final boolean installStatus; + public final Group group; + + public InstallResult(boolean installStatus, Group group) { + this.installStatus = installStatus; + this.group = group; + } + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java new file mode 100644 index 000000000..80162a406 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java @@ -0,0 +1,123 @@ +package com.fr.design.mainframe.share.util; + +import com.fr.base.io.IOFile; +import com.fr.base.iofile.attr.ExtendSharableAttrMark; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XCreatorUtils; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWTitleLayout; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.FormSelection; +import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.JTemplate; +import com.fr.form.share.SharableWidgetProvider; +import com.fr.form.share.bean.ShareLayoutWidget; +import com.fr.form.share.constants.ComponentPath; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; +import com.fr.workspace.WorkContext; +import org.jetbrains.annotations.NotNull; + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +/** + * Coder: zack + * Date: 2016/9/20 + * Time: 12:00 + */ +public class ShareComponentUtils { + + @NotNull + public static XCreator createXCreator(Widget creatorSource, String shareId, SharableWidgetProvider provider) { + + XCreator xCreator; + if (creatorSource instanceof WCardMainBorderLayout) { + xCreator = XCreatorUtils.createXCreator(creatorSource, new Dimension(500, 300)); + } else if (creatorSource instanceof ShareLayoutWidget) { + xCreator = XCreatorUtils.createXCreator(((ShareLayoutWidget) creatorSource).getWidget(), new Dimension(provider.getWidth(), provider.getHeight())); + } else { + xCreator = XCreatorUtils.createXCreator(creatorSource, new Dimension(provider.getWidth(), provider.getHeight())); + } + xCreator.setBackupBound(new Rectangle(provider.getWidth(), provider.getHeight())); + xCreator.setShareId(shareId); + return xCreator; + } + + /** + * 检查readme.txt文件 + */ + public static void checkReadMe() { + String shareDir = ComponentPath.SHARE_PATH.path(); + String readmePath = StableUtils.pathJoin(shareDir, "readme.txt"); + if (WorkContext.getWorkResource().exist(readmePath)) { + return; + } + String msg = Toolkit.i18nText("Fine-Design_Share_Share_Read_Me_Tip"); + WorkContext.getWorkResource().write(readmePath, msg.getBytes()); + } + + public static String getWidgetId(Widget widget) { + if (StringUtils.isEmpty(widget.getWidgetID())) { + // 做下兼容处理,之前的插件创建的组件没有对应的widgetId + return widget.getWidgetName(); + } + return widget.getWidgetID(); + } + + public static String getCurrentTemplateID() { + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + IOFile target = (IOFile) jt.getTarget(); + return target.getTemplateID(); + } + + public static boolean isShareWidget(XCreator xCreator) { + if (xCreator == null) { + return false; + } + if (xCreator.isShared()) { + return true; + } + if (xCreator instanceof XLayoutContainer) { + XLayoutContainer xLayoutContainer = (XLayoutContainer) xCreator; + ExtendSharableAttrMark sharableAttrMark = xLayoutContainer.toData().getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); + return sharableAttrMark != null && StringUtils.isNotEmpty(sharableAttrMark.getShareId()); + } + return false; + } + + public static boolean isShareWidgetWithChild(XCreator xCreator) { + boolean result = isShareWidget(xCreator); + if (result) { + return true; + } + //做下兼容处理,老的组件结构的共享信息存储在子组件上 + if (xCreator instanceof XWTitleLayout) { + XCreator child = ((XWTitleLayout) xCreator).getBodyCreator(); + return isShareWidget(child); + } + return false; + } + + + public static List getHelpConfigXCreatorList(XCreator root) { + List helpConfigXCreatorList = new ArrayList<>(); + if (isShareWidget(root)) { + helpConfigXCreatorList.add(root); + return helpConfigXCreatorList; + } + Component[] components = root.getComponents(); + for (Component component : components) { + if (component instanceof XCreator) { + helpConfigXCreatorList.addAll(getHelpConfigXCreatorList((XCreator) component)); + } + } + return helpConfigXCreatorList; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareUIUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareUIUtils.java new file mode 100644 index 000000000..204553f1d --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareUIUtils.java @@ -0,0 +1,189 @@ +package com.fr.design.mainframe.share.util; + +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.invoke.Reflect; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.ArrayUtils; +import com.fr.third.net.sf.cglib.proxy.Callback; +import com.fr.third.net.sf.cglib.proxy.CallbackFilter; +import com.fr.third.net.sf.cglib.proxy.Enhancer; +import com.fr.third.net.sf.cglib.proxy.MethodInterceptor; +import com.fr.third.net.sf.cglib.proxy.MethodProxy; +import com.fr.third.net.sf.cglib.proxy.NoOp; +import org.jetbrains.annotations.NotNull; + +import javax.swing.AbstractButton; +import javax.swing.JComponent; +import javax.swing.SwingConstants; +import javax.swing.plaf.ComponentUI; +import java.awt.Graphics; +import java.awt.event.ActionEvent; +import java.lang.reflect.Constructor; +import java.lang.reflect.Method; + +/** + * created by Harrison on 2020/04/20 + **/ +public class ShareUIUtils { + + private static final String PAINT_METHOD = "paint"; + + private static final String widthStyle = "%s"; + + /** + * 停止当前线程 xx s + * + * @param limit 限制 + * @throws InterruptedException 中断异常 + */ + public static void wait(int limit) throws InterruptedException { + + long start = System.currentTimeMillis(); + while (System.currentTimeMillis() - start < limit) { + Thread.sleep(50); + } + } + + public static String formatWidthString(String msg, int width) { + + return String.format(widthStyle, width, msg); + } + + public static UILabel createTipsLabel(String msg) { + + String tips = "" + msg + ""; + return new UILabel(tips); + } + + public static UILabel createTopRightUILabel(String msg) { + + UILabel label = new UILabel(msg, SwingConstants.RIGHT); + label.setVerticalAlignment(SwingConstants.TOP); + return label; + } + + public static UILabel createCenterRightUILabel(String msg) { + + UILabel label = new UILabel(msg, SwingConstants.RIGHT); + label.setVerticalAlignment(SwingConstants.CENTER); + return label; + } + + public static UILabel createHyperlinkLabel(String msg) { + + String hyperlink = ("") + msg + ""; + return new UILabel(hyperlink); + } + + public static String convertStateChange(int stateChange) { + + return String.valueOf(stateChange); + } + + public static void simulateAction(AbstractButton button) { + + ActionEvent event = new ActionEvent(button, + ActionEvent.ACTION_PERFORMED, + button.getActionCommand()); + button.dispatchEvent(event); + } + + public static T wrapUI(final ComponentUI newUI, final T component, Object... constructArgs) { + + try { + return warpUI0(newUI, component, constructArgs); + } catch (Exception e) { + //虽然没渲染上,但是不影响使用。 使用 warn 吧 + FineLoggerFactory.getLogger().warn(e.getMessage(), e); + return component; + } + } + + @SuppressWarnings("unchecked") + private static T warpUI0(final ComponentUI newUI, final T component, Object... constructArgs) throws NoSuchMethodException { + + Enhancer enhancer = new Enhancer(); + enhancer.setSuperclass(component.getClass()); + enhancer.setCallbacks(new Callback[]{ + NoOp.INSTANCE, + new MethodInterceptor() { + @Override + public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { + + Object value = methodProxy.invokeSuper(o, objects); + newUI.paint((Graphics) objects[0], component); + return value; + } + } + }); + enhancer.setCallbackFilter(new CallbackFilter() { + @Override + public int accept(Method method) { + return method.getName().equals(PAINT_METHOD) ? 1 : 0; + } + }); + + + Constructor constructor = constructor(component.getClass(), constructArgs); + if (constructArgs.length == 0 || constructor == null) { + return (T) enhancer.create(); + } + return (T) enhancer.create(constructor.getParameterTypes(), constructArgs); + } + + + public static Constructor constructor(Class type, Object... args) { + + Class[] types = argumentTypes(args); + try { + return type.getDeclaredConstructor(types); + } catch (NoSuchMethodException e) { + for (Constructor constructor : type.getDeclaredConstructors()) { + if (match(constructor.getParameterTypes(), types)) { + return constructor; + } + } + } + return null; + } + + public static void showErrorMessageDialog(String message) { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + message, + Toolkit.i18nText("Fine-Design_Share_Dialog_Message"), + FineJOptionPane.ERROR_MESSAGE); + } + + private static boolean match(Class[] declaredTypes, Class[] actualTypes) { + if (declaredTypes.length == actualTypes.length) { + for (int i = 0; i < actualTypes.length; i++) { + if (Reflect.wrapper(declaredTypes[i]).isAssignableFrom(Reflect.wrapper(actualTypes[i]))) { + continue; + } + return false; + } + return true; + } else { + return false; + } + } + + @NotNull + private static Class[] argumentTypes(Object[] constructArgs) { + + if (ArrayUtils.isEmpty(constructArgs)) { + return new Class[0]; + } + int length = constructArgs.length; + Class[] classes = new Class[length]; + for (int i = 0; i < length; i++) { + classes[i] = constructArgs[i].getClass(); + } + return classes; + } + + +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java index c8d52dae7..6d37ba136 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/template/info/JFormProcessInfo.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.template.info; import com.fr.base.iofile.attr.ExtendSharableAttrMark; - import com.fr.chart.chartattr.ChartCollection; import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; @@ -21,6 +20,7 @@ import com.fr.general.ComparatorUtils; import com.fr.json.JSONArray; import com.fr.json.JSONObject; import com.fr.report.cell.DefaultTemplateCellElement; + import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; @@ -30,7 +30,10 @@ import java.util.regex.Pattern; /** * Created by plough on 2017/3/17. + * + * @deprecated moved to cloud ops plugin */ +@Deprecated public class JFormProcessInfo extends TemplateProcessInfo
      { private static final String REGEX = "^" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Title") + "\\d+$"; diff --git a/designer-form/src/test/java/com/fr/design/mainframe/ReuseTriggerPointManagerTest.java b/designer-form/src/test/java/com/fr/design/mainframe/ReuseTriggerPointManagerTest.java new file mode 100644 index 000000000..8a80e7f7d --- /dev/null +++ b/designer-form/src/test/java/com/fr/design/mainframe/ReuseTriggerPointManagerTest.java @@ -0,0 +1,45 @@ +package com.fr.design.mainframe; + +import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 5/10/21 + */ +public class ReuseTriggerPointManagerTest { + private static final long ONE_WEEK_TIME = 7 * 24 * 3600 * 1000L; + + + @Test + public void testNeedTrigger() { + ComponentReuseNotificationInfo notificationInfo = ComponentReuseNotificationInfo.getInstance(); + notificationInfo.setNotifiedNumber(0); + Assert.assertTrue(ReuseTriggerPointManager.getInstance().needTrigger()); + + notificationInfo.setNotifiedNumber(1); + Assert.assertTrue(ReuseTriggerPointManager.getInstance().needTrigger()); + + notificationInfo.setNotifiedNumber(2); + Assert.assertFalse(ReuseTriggerPointManager.getInstance().needTrigger()); + + notificationInfo.setNotifiedNumber(0); + notificationInfo.setLastNotifyTime(System.currentTimeMillis()); + Assert.assertFalse(ReuseTriggerPointManager.getInstance().needTrigger()); + + notificationInfo.setNotifiedNumber(1); + notificationInfo.setLastNotifyTime(System.currentTimeMillis()); + Assert.assertFalse(ReuseTriggerPointManager.getInstance().needTrigger()); + + + notificationInfo.setNotifiedNumber(1); + notificationInfo.setLastNotifyTime(System.currentTimeMillis() - ONE_WEEK_TIME - 1); + Assert.assertTrue(ReuseTriggerPointManager.getInstance().needTrigger()); + + + notificationInfo.setNotifiedNumber(2); + notificationInfo.setLastNotifyTime(System.currentTimeMillis()); + Assert.assertFalse(ReuseTriggerPointManager.getInstance().needTrigger()); + } + +} diff --git a/designer-form/src/test/java/com/fr/design/mainframe/ShareWidgetButtonTest.java b/designer-form/src/test/java/com/fr/design/mainframe/ShareWidgetButtonTest.java deleted file mode 100644 index 50f8afc18..000000000 --- a/designer-form/src/test/java/com/fr/design/mainframe/ShareWidgetButtonTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.fr.design.mainframe; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.designer.creator.XCreator; -import com.fr.form.share.SharableWidgetProvider; -import com.fr.form.ui.ChartEditor; -import com.fr.general.ImageWithSuffix; -import com.fr.invoke.Reflect; -import org.easymock.EasyMock; -import org.junit.Assert; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.modules.junit4.PowerMockRunner; - -@RunWith(PowerMockRunner.class) -@PowerMockIgnore({"com.fr.jvm.assist.*", "javax.swing.*"}) -public class ShareWidgetButtonTest { - - @Test - public void testCreateXCreator() throws Exception { - - SharableWidgetProvider provider = EasyMock.mock(SharableWidgetProvider.class); - EasyMock.expect(provider.getWidth()).andReturn(300).anyTimes(); - EasyMock.expect(provider.getHeight()).andReturn(400).anyTimes(); - EasyMock.expect(provider.getName()).andReturn("test-drag").anyTimes(); - EasyMock.expect(provider.getCover()).andReturn(new ImageWithSuffix("utf-8")).anyTimes(); - EasyMock.replay(provider); - - ShareWidgetButton.ShareWidgetUI ui = new ShareWidgetButton.ShareWidgetUI(); - - ChartEditor editor = new ChartEditor(); - Reflect.on(editor).set("chartCollection", new ChartCollection()); - XCreator xCreator = ui.createXCreator(editor, "333", provider); - Assert.assertEquals(300, xCreator.getWidth()); - Assert.assertEquals(400, xCreator.getHeight()); - } -} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java b/designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java index 7f4a51394..2c0b73fe9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java +++ b/designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java @@ -2,7 +2,9 @@ package com.fr.design.actions.utils; import com.fr.base.Style; import com.fr.design.actions.cell.style.StyleActionInterface; +import com.fr.design.mainframe.DesignOperationEvent; import com.fr.design.mainframe.ElementCasePane; +import com.fr.event.EventDispatcher; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; @@ -50,9 +52,7 @@ public class ReportActionUtils { @Override public void dealWith(CellElement editCellElement) { Style style2Mod = editCellElement.getStyle(); - editCellElement.setStyle( - styleActionInterface.executeStyle(style2Mod, selectedStyle)); - + updateCellStyle(editCellElement, styleActionInterface.executeStyle(style2Mod, selectedStyle)); } }); } @@ -119,4 +119,9 @@ public class ReportActionUtils { //peter:直接返回当前编辑元素的Style return editCellElement.getStyle(); } -} \ No newline at end of file + + public static void updateCellStyle(CellElement cellElement, Style style){ + cellElement.setStyle(style); + EventDispatcher.fire(DesignOperationEvent.CELL_STYLE_MODIFY); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ActiveKeyGenerator.java b/designer-realize/src/main/java/com/fr/design/mainframe/ActiveKeyGenerator.java index 8b6c3ce4c..68496a76b 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ActiveKeyGenerator.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ActiveKeyGenerator.java @@ -1,5 +1,4 @@ package com.fr.design.mainframe; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.general.CloudCenter; import com.fr.general.http.HttpClient; @@ -101,7 +100,7 @@ public class ActiveKeyGenerator { HashMap para = new HashMap(); para.put("uuid", envManager.getUUID()); para.put("key", key); - para.put("username", MarketConfig.getInstance().getBbsUsername()); + para.put("username", DesignerEnvManager.getEnvManager().getDesignerLoginUsername()); HttpClient hc = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("verify.code"), para); if (timeout != -1) { hc.setTimeout(timeout); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java index 246bb72aa..0ddfdd3d7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java @@ -106,6 +106,9 @@ public class CellWidgetPropertyPane extends BasicPane { final CellSelection finalCS = (CellSelection) ePane.getSelection(); final TemplateElementCase tplEC = ePane.getEditingElementCase(); final Widget cellWidget = cellEditorDefPane.update(); + if(cellWidget == null){ + return; + } if (finalCS.isSelectedOneCell(ePane)) { if (tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow()) == null) {//cellElement未加入到report中时要添加进去 tplEC.addCellElement(cellElement); @@ -141,6 +144,9 @@ public class CellWidgetPropertyPane extends BasicPane { final CellSelection finalCS = (CellSelection) selection; final TemplateElementCase tplEC = ePane.getEditingElementCase(); final Widget cellWidget = cellEditorDefPane.update(); + if(cellWidget == null){ + return; + } if(finalCS.isSelectedOneCell(ePane)){ if(tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow())== null){//cellElement未加入到report中时要添加进去 tplEC.addCellElement(cellElement); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java index cb11ad0fb..615ee2a96 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java @@ -1,26 +1,16 @@ -/** - * - */ package com.fr.design.mainframe; import com.fr.base.FRContext; +import com.fr.common.annotations.Compatible; import com.fr.concurrent.NamedThreadFactory; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.errorinfo.ErrorInfoUploader; import com.fr.design.mainframe.messagecollect.impl.FocusPointMessageUploader; import com.fr.design.mainframe.messagecollect.solid.SolidCollector; -import com.fr.design.mainframe.template.info.TemplateInfoCollector; -import com.fr.general.CloudCenter; -import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; import com.fr.general.DesUtils; -import com.fr.general.GeneralUtils; import com.fr.general.IOUtils; -import com.fr.general.http.HttpToolbox; -import com.fr.json.JSONArray; -import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; import com.fr.stable.ProductConstants; @@ -32,7 +22,6 @@ import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLWriter; import com.fr.stable.xml.XMLableReader; import com.fr.third.javax.xml.stream.XMLStreamException; -import com.sun.management.OperatingSystemMXBean; import java.io.BufferedWriter; import java.io.ByteArrayInputStream; @@ -46,12 +35,10 @@ import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; -import java.lang.management.ManagementFactory; import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.util.ArrayList; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Objects; import java.util.concurrent.Executors; @@ -60,8 +47,9 @@ import java.util.concurrent.TimeUnit; /** * @author neil - * @date: 2015-4-8-下午5:11:46 + * @date 2015-4-8-下午5:11:46 */ +@Compatible public class InformationCollector implements XMLReadable, XMLWriter { /** @@ -69,35 +57,26 @@ public class InformationCollector implements XMLReadable, XMLWriter { */ private static final long DELTA = 24 * 3600 * 1000L; private static final long SEND_DELAY = 300 * 1000L; - private static final int BYTE_TO_MB = 1024 * 1024; private static final String FILE_NAME = "fr.info"; private static final String XML_START_STOP_LIST = "StartStopList"; private static final String XML_START_STOP = "StartStop"; private static final String XML_LAST_TIME = "LastTime"; private static final String ATTR_START = "start"; private static final String ATTR_STOP = "stop"; - private static final String XML_JAR = "JarInfo"; - private static final String XML_VERSION = "Version"; - private static final String XML_USERNAME = "Username"; - private static final String XML_UUID = "UUID"; - private static final String XML_KEY = "ActiveKey"; - private static final String XML_OS = "OS"; - private static final String XML_ARCH = "arch"; - private static final String XML_AVAILABLE_PROCESSORS = "cpu"; - private static final String XML_PHYSICAL_MEMORY = "systemMemory"; private static InformationCollector collector; /** * 启动时间与关闭时间列表 */ - private List startStop = new ArrayList(); + private final List startStop = new ArrayList(); /** * 上一次的发送时间 */ private String lastTime; - private StartStopTime current = new StartStopTime(); + + private final StartStopTime current = new StartStopTime(); public static InformationCollector getInstance() { if (collector == null) { @@ -125,11 +104,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { xmlReader.readXMLObject(xmlReadable); } xmlInputStream.close(); - } catch (FileNotFoundException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } catch (IOException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } catch (XMLStreamException e) { + } catch (IOException | XMLStreamException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -143,77 +118,24 @@ public class InformationCollector implements XMLReadable, XMLWriter { private long getLastTimeMillis() { if (StringUtils.isEmpty(this.lastTime)) { - return 0; + return 0L; } - try { return Objects.requireNonNull(DateUtils.string2Date(this.lastTime, true)).getTime(); } catch (Exception e) { - return -1; + return -1L; } - } - private JSONObject getJSONContentAsByte() { - JSONObject content = new JSONObject(); - JSONArray startStopArray = new JSONArray(); - for (StartStopTime startStopTime : startStop) { - JSONObject jo = new JSONObject(); - jo.put(ATTR_START, startStopTime.getStartDate()); - jo.put(ATTR_STOP, startStopTime.getStopDate()); - startStopArray.put(jo); - } - DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - content.put(XML_START_STOP, startStopArray); - content.put(XML_UUID, envManager.getUUID()); - content.put(XML_JAR, GeneralUtils.readBuildNO()); - content.put(XML_VERSION, ProductConstants.RELEASE_VERSION); - content.put(XML_USERNAME, MarketConfig.getInstance().getBbsUsername()); - content.put(XML_KEY, envManager.getActivationKey()); - content.put(XML_OS, System.getProperty("os.name")); - content.put(XML_ARCH, System.getProperty("os.arch")); - content.put(XML_AVAILABLE_PROCESSORS, Runtime.getRuntime().availableProcessors()); - content.put(XML_PHYSICAL_MEMORY, getTotalPhysicalMemorySize()); - return content; - } - - /** - * 获取物理内存,单位GB - * - * @return 物理内存 - */ - private static long getTotalPhysicalMemorySize() { - OperatingSystemMXBean bean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); - return bean.getTotalPhysicalMemorySize() / BYTE_TO_MB; - } - - - private void sendUserInfo() { + private void sendInfoSuccessCallback() { long currentTime = System.currentTimeMillis(); long lastTime = getLastTimeMillis(); if (currentTime - lastTime <= DELTA) { return; } - JSONObject content = getJSONContentAsByte(); - String url = CloudCenter.getInstance().acquireUrlByKind("user.info.v10"); - if (StringUtils.isBlank(url)) { - return; - } - boolean success = false; - try { - HashMap para = new HashMap<>(); - para.put("token", SiteCenterToken.generateToken()); - para.put("content", content); - String res = HttpToolbox.post(url, para); - success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - } - if (success) { - this.reset(); - } + this.reset(); } /** @@ -221,27 +143,22 @@ public class InformationCollector implements XMLReadable, XMLWriter { */ public void collectStartTime() { this.current.setStartDate(dateToString()); - - sendUserInfoInOtherThread(); + sendInfo(); } - private void sendUserInfoInOtherThread() { + private void sendInfo() { if (!DesignerEnvManager.getEnvManager().isJoinProductImprove() || !FRContext.isChineseEnv()) { return; } ScheduledExecutorService service = Executors .newSingleThreadScheduledExecutor(new NamedThreadFactory("InformationCollector")); - service.schedule(new Runnable() { - @Override - public void run() { - SolidCollector.getInstance().sendToCloudCenterAndDeleteFile(); - sendUserInfo(); - FocusPointMessageUploader.getInstance().sendToCloudCenter(); - TemplateInfoCollector.getInstance().sendPointInfo(); - ChartInfoCollector.getInstance().sendPointInfo(); - ErrorInfoUploader.getInstance().sendErrorInfo(); - } + service.schedule(() -> { + SolidCollector.getInstance().sendToCloudCenterAndDeleteFile(); + FocusPointMessageUploader.getInstance().sendToCloudCenter(); + ChartInfoCollector.getInstance().sendPointInfo(); + ErrorInfoUploader.getInstance().sendErrorInfo(); + sendInfoSuccessCallback(); }, SEND_DELAY, TimeUnit.MILLISECONDS); service.shutdown(); } @@ -306,7 +223,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { //启停信息 writeStartStopList(writer); //上一次更新的时间 - writeTag(XML_LAST_TIME, this.lastTime, writer); + writeLastTime(this.lastTime, writer); writer.end(); } @@ -320,12 +237,11 @@ public class InformationCollector implements XMLReadable, XMLWriter { writer.end(); } - private void writeTag(String tag, String content, XMLPrintWriter writer) { + private void writeLastTime(String content, XMLPrintWriter writer) { if (StringUtils.isEmpty(content)) { return; } - - writer.startTAG(tag); + writer.startTAG(InformationCollector.XML_LAST_TIME); writer.textNode(content); writer.end(); } @@ -364,7 +280,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { }); } - private class StartStopTime implements XMLReadable, XMLWriter { + private static class StartStopTime implements XMLReadable, XMLWriter { private String startDate; private String stopDate; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index acfcdb4d3..c708960d7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.alphafine.component; import com.bulenkov.iconloader.IconLoader; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.actions.help.alphafine.AlphaFineConfigManager; import com.fr.design.dialog.UIDialog; @@ -952,7 +951,7 @@ public class AlphaFineDialog extends UIDialog { */ private void sendDataToServer(String searchKey, AlphaCellModel cellModel) { if (cellModel.isNeedToSendToServer()) { - String username = MarketConfig.getInstance().getBbsUsername(); + String username = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activityKey = DesignerEnvManager.getEnvManager().getActivationKey(); String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/AbstractWorkBookApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/AbstractWorkBookApp.java index 3fd12d81a..60ce295a3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/AbstractWorkBookApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/AbstractWorkBookApp.java @@ -10,20 +10,21 @@ import com.fr.file.FILE; import com.fr.log.FineLoggerFactory; import com.fr.main.impl.WorkBook; import com.fr.report.worksheet.WorkSheet; + import java.util.concurrent.Callable; /** * Created by juhaoyu on 2018/6/27. */ abstract class AbstractWorkBookApp implements App { - - + + @Override public int currentAPILevel() { - + return CURRENT_LEVEL; } - + @Override public JTemplate openTemplate(FILE tplFile) { JWorkBook emptyTemplate = new JWorkBook(new WorkBook(new WorkSheet()), tplFile); @@ -32,6 +33,7 @@ abstract class AbstractWorkBookApp implements App { @Override public OpenResult call() { WorkBook workBook = asIOFile(tplFile); + DesignerAppUtils.dealWithTemplateIOError(tplFile.getPath()); return new OpenResult<>(workBook, workBook.getParameters()); } }, emptyTemplate); @@ -50,20 +52,20 @@ abstract class AbstractWorkBookApp implements App { } return emptyTemplate; } - + @Override public String mark4Provider() { - + return getClass().getName(); } - + @Override public void process() { - + } - + @Override public void undo() { - + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java index ec425847d..e4038ab42 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java @@ -19,6 +19,7 @@ public class DesignerAppActivator extends Activator implements Prepare { for (App app : appList) { JTemplateFactory.register(app); } + PluginRemote.getInstance().start(); } @Override @@ -28,6 +29,7 @@ public class DesignerAppActivator extends Activator implements Prepare { for (App app : appList) { JTemplateFactory.remove(app); } + PluginRemote.getInstance().stop(); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java new file mode 100644 index 000000000..4680a8a25 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java @@ -0,0 +1,211 @@ +package com.fr.design.mainframe.app; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.UIExpandDialog; +import com.fr.design.extra.exe.callback.InstallOnlineCallback; +import com.fr.design.extra.exe.callback.ModifyStatusCallback; +import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.app.PluginRemote.PluginStatus; +import com.fr.design.ui.util.UIUtil; +import com.fr.locale.InterProviderFactory; +import com.fr.plugin.context.PluginMarker; +import com.fr.plugin.context.PluginMarkerAdapter; +import com.fr.plugin.manage.PluginManager; +import com.fr.plugin.manage.control.PluginControllerHelper; +import com.fr.plugin.manage.control.PluginExtraInfo; +import com.fr.plugin.manage.control.PluginTask; +import com.fr.stable.StringUtils; +import com.fr.stable.TemplateIOErrorContextHolder; +import com.fr.third.guava.cache.Cache; +import com.fr.third.guava.cache.CacheBuilder; +import com.fr.third.guava.collect.Multimap; +import com.fr.workspace.WorkContext; + +import java.time.Duration; +import java.util.Collection; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 设计器app共用工具类 + * + * @author vito + * @version 10.0 + * Created by vito on 2021/5/27 + */ +public class DesignerAppUtils { + private static final int DEFAULT_MAX_CACHE_SIZE = 50; + private static final int DEFAULT_CONCURRENCY_LEVEL = 8; + private static final long DEFAULT_EXPIRE_HOURS = 1; + + private static final Cache> ERROR_CACHE = CacheBuilder.newBuilder() + .maximumSize(DEFAULT_MAX_CACHE_SIZE) + .expireAfterAccess(Duration.ofHours(DEFAULT_EXPIRE_HOURS)) + .concurrencyLevel(DEFAULT_CONCURRENCY_LEVEL) + .build(); + + /** + * 弹出指定的插件信息, + * 并失效缓存 + * + * @param key 指定key + * @return 插件安装信息 + */ + public static Multimap popPluginInfoMap(String key) { + Multimap ifPresent = ERROR_CACHE.getIfPresent(key); + ERROR_CACHE.invalidate(key); + return ifPresent; + } + + /** + * 失效指定的插件信息缓存 + * + * @param key 指定key + */ + public static void invalidatePlugins(String key) { + ERROR_CACHE.invalidate(key); + } + + + /** + * 格式化多行插件错误信息详情并缓存, + * 用于界面展示 + * + * @param key 缓存key + * @return 格式化后的多行插件错误信息详情 + */ + public static String dealWithErrorDetailMultiLineAndCache(String key) { + if (!DesignerEnvManager.getEnvManager().isShowTemplateMissingPlugin()) { + // 直接清空不提示 + TemplateIOErrorContextHolder.reset(); + return StringUtils.EMPTY; + } + Multimap pendingPlugins = TemplateIOErrorContextHolder.getPendingPlugin(); + if (pendingPlugins.isEmpty()) { + return StringUtils.EMPTY; + } + dealWithRemote(pendingPlugins); + StringBuilder sb = new StringBuilder(); + if (WorkContext.getCurrent().isLocal()) { + // 缓存等待后续处理 + ERROR_CACHE.put(key, pendingPlugins); + } + Collection unknownPlugins = pendingPlugins.get(TemplateIOErrorContextHolder.UNKNOWN_PLUGIN); + if (!unknownPlugins.isEmpty()) { + sb.append(InterProviderFactory.getProvider().getLocText("Fine-Core_Plugin_Error_UnknownPlugin")).append(":\n"); + for (PluginMarkerAdapter pluginMarker : unknownPlugins) { + sb.append("\"").append(pluginMarker.getPluginID()).append("\"") + .append(InterProviderFactory.getProvider().getLocText("Fine-Dec_Platform_Plugin")).append('\n'); + } + } + Collection notInstalledPlugins = pendingPlugins.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN); + if (!notInstalledPlugins.isEmpty()) { + sb.append(InterProviderFactory.getProvider().getLocText("Fine-Core_Plugin_Error_UninstalledPlugins")).append(":\n"); + for (PluginMarkerAdapter pluginMarker : notInstalledPlugins) { + sb.append("\"").append(pluginMarker.getPluginName()).append("\"") + .append(InterProviderFactory.getProvider().getLocText("Fine-Dec_Platform_Plugin")).append('\n'); + } + } + Collection disablePlugins = pendingPlugins.get(TemplateIOErrorContextHolder.DISABLE_PLUGIN); + if (!disablePlugins.isEmpty()) { + sb.append(InterProviderFactory.getProvider().getLocText("Fine-Core_Plugin_Error_InactivePlugins")).append(":\n"); + for (PluginMarkerAdapter pluginMarker : disablePlugins) { + sb.append("\"").append(pluginMarker.getPluginName()).append("\"") + .append(InterProviderFactory.getProvider().getLocText("Fine-Dec_Platform_Plugin")).append('\n'); + + } + } + return sb.toString(); + } + + /** + * 远程环境下需要特殊处理远程服务器尚未安装的插件 + * + * @param pendingPlugins 待处理插件 + */ + private static void dealWithRemote(Multimap pendingPlugins) { + if (!WorkContext.getCurrent().isLocal()) { + rearrange(pendingPlugins); + } + } + + /** + * 远程设计重新整理下列表 + * + * @param pendingPlugins 待处理列表 + */ + public static void rearrange(Multimap pendingPlugins) { + Map pluginRemoteStatus = PluginRemote.getInstance().getPluginRemoteStatus(); + Collection unknownPlugins = pendingPlugins.get(TemplateIOErrorContextHolder.UNKNOWN_PLUGIN); + Collection notInstall = pendingPlugins.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN); + Collection disable = pendingPlugins.get(TemplateIOErrorContextHolder.DISABLE_PLUGIN); + unknownPlugins.removeIf(adapter -> pluginRemoteStatus.containsKey(adapter.getPluginID())); + // 本地未启用名单不准确添加到一起之后重新分配 + notInstall.addAll(disable); + disable.clear(); + // 从所有未安装中过滤远程未启用的,添加到未启用列表 + disable.addAll(notInstall.stream().filter(plugin -> + pluginRemoteStatus.containsKey(plugin.getPluginID()) + && !pluginRemoteStatus.get(plugin.getPluginID()).isRunning()) + .collect(Collectors.toList())); + // 清理未安装中所有远程安装过的插件(包含启用和未启用) + notInstall.removeIf(adapter -> pluginRemoteStatus.containsKey(adapter.getPluginID())); + } + + /** + * 处理模板读取时的异常 + * + * @param path 模板路径 + */ + public static void dealWithTemplateIOError(String path) { + // 试图获取多行读取错误提示并缓存待处理列表 + String detail = dealWithErrorDetailMultiLineAndCache(path); + if (detail.length() > 0) { + UIUtil.invokeLaterIfNeeded(() -> { + if (WorkContext.getCurrent().isLocal()) { + UIExpandDialog.Builder() + .owner(DesignerContext.getDesignerFrame()) + .title(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")) + .message(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_Message_Local")) + .detail(detail) + .okText(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_OK_Btn")) + .cancelText(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_Cancel_Btn")) + .dialogActionListener(new DialogActionAdapter() { + public void doOk() { + installAndEnablePlugin(path); + } + + @Override + public void doCancel() { + invalidatePlugins(path); + } + }).build().setVisible(true); + } else { + UIExpandDialog.Builder().owner(DesignerContext.getDesignerFrame()) + .title(Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")) + .cancelText(StringUtils.EMPTY) + .message(Toolkit.i18nText("Fine-Design_Template_Plugin_Error_Message_Remote")) + .detail(detail) + .build() + .setVisible(true); + } + }); + } + } + + private static void installAndEnablePlugin(String key) { + Multimap stringPluginMarkerAdapterMultimap = popPluginInfoMap(key); + Collection disablePlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.DISABLE_PLUGIN); + for (PluginMarkerAdapter disablePlugin : disablePlugins) { + PluginManager.getController().enable(disablePlugin, new ModifyStatusCallback(false)); + } + + Collection uninstallPlugins = stringPluginMarkerAdapterMultimap.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN); + for (PluginMarker uninstallPlugin : uninstallPlugins) { + PluginTask pluginTask = PluginTask.installTask(uninstallPlugin); + PluginControllerHelper.installOnline(uninstallPlugin, new InstallOnlineCallback(pluginTask), PluginExtraInfo.newBuilder().username(DesignerEnvManager.getEnvManager().getDesignerLoginUsername()).build()); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java index 5d828713f..f28e2c984 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java @@ -23,6 +23,7 @@ import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.bridge.StableFactory; +import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.concurrent.Callable; @@ -62,7 +63,7 @@ class FormApp extends AbstractAppProvider { new Callable>() { @Override public OpenResult call() throws Exception { - Form form = asIOFile(tplFile); + Form form = getForm(tplFile); return new OpenResult<>(form, form.getParameters()); } }, emptyForm); @@ -71,22 +72,31 @@ class FormApp extends AbstractAppProvider { public JTemplate call() throws Exception { OpenResult result = worker.getResult(); return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class); + new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class); } }); worker.start(tplFile.getPath()); OpenResult result = worker.getResult(); if (result != null) { return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class); + new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class); } return emptyForm; } else { return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{asIOFile(tplFile), tplFile}, classType, BaseJForm.class); + new Object[]{getForm(tplFile), tplFile}, classType, BaseJForm.class); } } + @Nullable + private Form getForm(FILE tplFile) { + Form form = asIOFile(tplFile); + if (form != null) { + DesignerAppUtils.dealWithTemplateIOError(tplFile.getPath()); + } + return form; + } + @Override public Form asIOFile(FILE file) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/PluginRemote.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/PluginRemote.java new file mode 100644 index 000000000..4bd4bdccc --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/PluginRemote.java @@ -0,0 +1,138 @@ +package com.fr.design.mainframe.app; + +import com.fr.base.FRContext; +import com.fr.json.JSONArray; +import com.fr.json.JSONException; +import com.fr.json.JSONObject; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.context.PluginMarker; +import com.fr.stable.StringUtils; +import com.fr.value.AtomicClearableLazyValue; +import com.fr.workspace.WorkContext; +import org.jetbrains.annotations.NotNull; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; + +/** + * 获取远程插件情况,定时刷新 + * + * @author vito + * @version 10.0 + * Created by vito on 2021/6/1 + */ +public class PluginRemote { + + private static final PluginRemote INSTANCE = new PluginRemote(); + private final AtomicClearableLazyValue> lazyValue = new AtomicClearableLazyValue>() { + @NotNull + @Override + protected Map compute() { + return getRemoteStatus(); + } + }; + + /** + * 时间间隔两分钟 + */ + private static final int INTERVAL = 2; + + private ScheduledExecutorService executor; + + public static PluginRemote getInstance() { + + return INSTANCE; + } + + /** + * 获取远程插件状态 + * @return 远程插件状态 + */ + public Map getPluginRemoteStatus() { + return lazyValue.getValue(); + } + + private Map getRemoteStatus() { + + JSONArray statusArray = FRContext.getCommonOperator().getPluginStatus(); + JSONObject status; + String id; + String version; + boolean running; + Map statusMap = new HashMap<>(); + for (int i = 0; i < statusArray.length(); i++) { + try { + status = statusArray.getJSONObject(i); + id = status.getString("id"); + version = status.getString("version"); + running = status.getBoolean("running"); + if(StringUtils.isBlank(id)){ + continue; + } + PluginStatus pluginStatus = PluginStatus.create(id, version, running); + if (pluginStatus != null) { + statusMap.put(id, pluginStatus); + } + } catch (JSONException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + return statusMap; + } + + + public void start() { + // 远程环境下开始同步插件情况 + if (!WorkContext.getCurrent().isLocal()) { + executor = Executors.newSingleThreadScheduledExecutor(); + executor.scheduleAtFixedRate(() -> { + lazyValue.drop(); + lazyValue.getValue(); + }, 0, INTERVAL, TimeUnit.MINUTES); + } + } + + public void stop() { + + if (executor != null) { + executor.shutdown(); + executor = null; + lazyValue.drop(); + } + } + + public static class PluginStatus { + + private final PluginMarker marker; + + private final boolean running; + + private PluginStatus(PluginMarker marker, boolean running) { + + this.marker = marker; + this.running = running; + } + + static PluginStatus create(String id, String version, boolean running) { + + PluginMarker marker = PluginMarker.create(id, version); + if (marker != null && marker.valid()) { + return new PluginStatus(marker, running); + } + return null; + } + + public PluginMarker getMarker() { + + return marker; + } + + public boolean isRunning() { + + return running; + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java index 92a288254..29180c09d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -3,27 +3,23 @@ */ package com.fr.design.mainframe.bbs; -import com.fr.base.FRContext; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.bbs.BBSLoginUtils; +import com.fr.design.constants.UIConstants; import com.fr.design.extra.LoginContextListener; -import com.fr.design.extra.LoginWebBridge; -import com.fr.design.extra.PluginWebBridge; import com.fr.design.extra.UserLoginContext; -import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.locale.impl.BbsSpaceMark; +import com.fr.design.login.DesignerLoginHelper; +import com.fr.design.login.DesignerLoginSource; +import com.fr.design.login.utils.DesignerLoginUtils; import com.fr.design.mainframe.DesignerContext; import com.fr.design.os.impl.SupportOSImpl; -import com.fr.design.upm.event.CertificateEvent; +import com.fr.design.utils.BrowseUtils; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.event.Event; -import com.fr.event.EventDispatcher; -import com.fr.event.Listener; import com.fr.general.CloudCenter; import com.fr.general.ComparatorUtils; import com.fr.general.DateUtils; @@ -32,18 +28,15 @@ import com.fr.general.locale.LocaleCenter; import com.fr.general.locale.LocaleMark; import com.fr.log.FineLoggerFactory; import com.fr.stable.EncodeConstants; -import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import javax.swing.SwingConstants; import java.awt.Cursor; -import java.awt.Desktop; import java.awt.Frame; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.UnsupportedEncodingException; import java.lang.reflect.Constructor; import java.lang.reflect.Method; -import java.net.URI; import java.net.URLEncoder; import java.text.SimpleDateFormat; import java.util.Date; @@ -82,11 +75,21 @@ public class UserInfoLabel extends UILabel { @Override public void mouseEntered(MouseEvent e) { UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR)); + if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) { + UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND_ONCLICK); + } + } + + @Override + public void mouseExited(MouseEvent e) { + if (StringUtils.isEmpty(DesignerEnvManager.getEnvManager().getDesignerLoginUsername())) { + UserInfoLabel.this.setBackground(UIConstants.DESIGNER_LOGIN_BACKGROUND); + } } @Override public void mouseClicked(MouseEvent e) { - userName = MarketConfig.getInstance().getBbsUsername(); + userName = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isNotEmpty(userName)) { UIPopupMenu menu = new UIPopupMenu(); menu.setOnlyText(true); @@ -100,7 +103,8 @@ public class UserInfoLabel extends UILabel { if (StringUtils.isNotEmpty(userName)) { try { LocaleMark spaceMark = LocaleCenter.getMark(BbsSpaceMark.class); - Desktop.getDesktop().browse(new URI(spaceMark.getValue())); + String ssoUrl = DesignerLoginUtils.generateDesignerSSOUrl(spaceMark.getValue()); + BrowseUtils.browser(ssoUrl); } catch (Exception exp) { FineLoggerFactory.getLogger().info(exp.getMessage()); } @@ -113,15 +117,14 @@ public class UserInfoLabel extends UILabel { closeOther.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { - BBSLoginUtils.bbsLogout(); - UserLoginContext.fireLoginContextListener(); + UserLoginContext.fireLoginContextListener(DesignerLoginSource.SWITCH_ACCOUNT); } }); menu.add(priviteMessage); menu.add(closeOther); GUICoreUtils.showPopupMenu(menu, UserInfoLabel.this, 0, MENU_HEIGHT); } else { - UserLoginContext.fireLoginContextListener(); + UserLoginContext.fireLoginContextListener(DesignerLoginSource.NORMAL); } } }; @@ -202,29 +205,10 @@ public class UserInfoLabel extends UILabel { this.addMouseListener(userInfoAdapter); this.setHorizontalAlignment(SwingConstants.CENTER); - if (StableUtils.getMajorJavaVersion() >= VERSION_8) { - LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this); - PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); - } - UserLoginContext.addLoginContextListener(new LoginContextListener() { @Override - public void showLoginContext() { - WebViewDlgHelper.createLoginDialog(); - clearLoginInformation(); - updateInfoPane(); - } - }); - EventDispatcher.listen(CertificateEvent.LOGIN, new Listener() { - @Override - public void on(Event event, String text) { - setText(text); - } - }); - EventDispatcher.listen(CertificateEvent.LOGOUT, new Listener() { - @Override - public void on(Event event, String text) { - setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_UnSignIn")); + public void showLoginContext(DesignerLoginSource source) { + DesignerLoginHelper.showLoginDialog(source); } }); } @@ -233,10 +217,6 @@ public class UserInfoLabel extends UILabel { BBSLoginUtils.bbsLogout(); } - private void updateInfoPane() { - userInfoPane.markUnSignIn(); - } - private void sleep(long millis) { try { Thread.sleep(millis); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java index 24ae13eda..e6ae079aa 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/bbs/UserInfoPane.java @@ -5,11 +5,14 @@ package com.fr.design.mainframe.bbs; import com.fr.base.FRContext; import com.fr.concurrent.NamedThreadFactory; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.upm.event.CertificateEvent; +import com.fr.event.Event; +import com.fr.event.EventDispatcher; +import com.fr.event.Listener; import com.fr.general.DateUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -34,7 +37,7 @@ public class UserInfoPane extends BasicPane { /** * 默认未登录颜色 */ - private static final Color UN_LOGIN_BACKGROUND = UIConstants.TEMPLATE_TAB_PANE_BACKGROUND; + private static final Color UN_LOGIN_BACKGROUND = UIConstants.DESIGNER_LOGIN_BACKGROUND; private static final Color LOGIN_BACKGROUND = new Color(184, 220, 242); private static final int WIDTH = 104; private static final int HEIGHT = 24; @@ -76,6 +79,13 @@ public class UserInfoPane extends BasicPane { autoPushLoginDialog(); this.add(userInfoLabel, BorderLayout.CENTER); + + EventDispatcher.listen(CertificateEvent.LOGIN, new Listener() { + @Override + public void on(Event event, String text) { + markSignIn(text); + } + }); } public UserInfoLabel getUserInfoLabel() { @@ -91,7 +101,8 @@ public class UserInfoPane extends BasicPane { * 标志未登录状态, 面板设置为灰色 */ public void markUnSignIn() { - this.userInfoLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_UnSignIn")); + this.userInfoLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Designer_Login_Onclick")); + this.userInfoLabel.setForeground(Color.WHITE); this.userInfoLabel.setOpaque(true); this.userInfoLabel.setBackground(UN_LOGIN_BACKGROUND); this.userInfoLabel.resetUserName(); @@ -104,6 +115,7 @@ public class UserInfoPane extends BasicPane { */ public void markSignIn(String userName) { this.userInfoLabel.setText(userName); + this.userInfoLabel.setForeground(Color.BLACK); this.userInfoLabel.setUserName(userName); this.userInfoLabel.setOpaque(true); this.userInfoLabel.setBackground(LOGIN_BACKGROUND); @@ -115,7 +127,7 @@ public class UserInfoPane extends BasicPane { } public void updateBBSUserInfo() { - String username = MarketConfig.getInstance().getBbsUsername(); + String username = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isEmpty(username)) { markUnSignIn(); } else { @@ -173,7 +185,7 @@ public class UserInfoPane extends BasicPane { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - String userName = MarketConfig.getInstance().getBbsUsername(); + String userName = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); if (StringUtils.isNotEmpty(userName)) { return; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java index 4bfd9fa46..049b0111a 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellStylePane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fr.base.Style; +import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.cell.settingpane.style.StylePane; import com.fr.design.style.BorderUtils; @@ -63,7 +64,7 @@ public class CellStylePane extends AbstractCellAttrPane { @Override public void updateBean(TemplateCellElement cellElement) { - cellElement.setStyle(stylePane.updateBean()); + ReportActionUtils.updateCellStyle(cellElement, stylePane.updateBean()); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java index dd9c50c9e..2626193a4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/errorinfo/ErrorInfoLogAppender.java @@ -2,7 +2,6 @@ package com.fr.design.mainframe.errorinfo; import com.fr.base.io.IOFile; import com.fr.base.io.XMLReadHelper; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.design.i18n.Toolkit; import com.fr.web.session.SessionLocalManager; @@ -43,7 +42,7 @@ public class ErrorInfoLogAppender extends AppenderSkeleton { this.layout = new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"); DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - this.username = MarketConfig.getInstance().getBbsUsername(); + this.username = envManager.getDesignerLoginUsername(); this.uuid = envManager.getUUID(); this.activekey = envManager.getActivationKey(); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java index 358672d23..09bf17d95 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/entity/FileEntityBuilder.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.messagecollect.entity; -import com.fr.config.MarketConfig; import com.fr.design.DesignerEnvManager; import com.fr.general.CloudClient; import com.fr.general.IOUtils; @@ -103,7 +102,7 @@ public class FileEntityBuilder { CloudClient client = CloudClient.getInstance(); String today = new JDateTime().toString("YYYY-MM-DD"); String filePath = FOCUS_POINT_FILE_ROOT_PATH + CoreConstants.SEPARATOR + today + CoreConstants.SEPARATOR + keyFileName; - String bbsUserName = MarketConfig.getInstance().getBbsUsername(); + String bbsUserName = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String name = StringUtils.isEmpty(bbsUserName) ? uuid : bbsUserName; diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JPolyWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JPolyWorkBookProcessInfo.java index ec5d05c7f..6b79bf78f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JPolyWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JPolyWorkBookProcessInfo.java @@ -11,7 +11,10 @@ import java.util.Iterator; /** * Created by kerry on 2020-05-06 + * + * @deprecated moved to plugin ops plugin */ +@Deprecated public class JPolyWorkBookProcessInfo extends JWorkBookProcessInfo { public JPolyWorkBookProcessInfo(WorkBook template) { super(template); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java index c23a03f1c..5d127954f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/template/info/JWorkBookProcessInfo.java @@ -17,7 +17,10 @@ import java.util.Iterator; /** * Created by plough on 2017/3/17. + * + * @deprecated moved to cloud ops plugin */ +@Deprecated public class JWorkBookProcessInfo extends TemplateProcessInfo { public JWorkBookProcessInfo(WorkBook wb) { diff --git a/designer-realize/src/main/java/com/fr/design/share/SharableManager.java b/designer-realize/src/main/java/com/fr/design/share/SharableManager.java new file mode 100644 index 000000000..b84349be4 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/SharableManager.java @@ -0,0 +1,64 @@ +package com.fr.design.share; + +import com.fr.design.base.clipboard.ClipboardFilter; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.mainframe.FormWidgetDetailPane; +import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.collect.SharableCollectorManager; +import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptSelectionClipboardHandler; +import com.fr.design.mainframe.share.encrypt.clipboard.impl.EncryptTransferableClipboardHandler; +import com.fr.design.mainframe.share.ui.block.LocalWidgetBlock; +import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; +import com.fr.design.mainframe.share.util.ShareComponentUtils; +import com.fr.design.share.utils.EffectItemUtils; +import com.fr.form.share.ShareLoader; +import com.fr.general.GeneralContext; +import com.fr.json.JSONArray; +import com.fr.stable.EnvChangedListener; + +import java.util.List; + +public class SharableManager { + public static void start() { + SharableCollectorManager.getInstance().execute(); + listenEnv(); + ClipboardFilter.registerClipboardHandler(EncryptSelectionClipboardHandler.getInstance()); + ClipboardFilter.registerClipboardHandler(EncryptTransferableClipboardHandler.getInstance()); + } + + public static void saveTemplate(JTemplate jt) { + if (jt instanceof JForm) { + int showCount = 0; + int useCount = 0; + if (!jt.getProcessInfo().isTestTemplate()) { + JForm jForm = (JForm) jt; + XLayoutContainer root = jForm.getFormDesign().getRootComponent(); + List xCreators = ShareComponentUtils.getHelpConfigXCreatorList(root); + JSONArray helpConfigUseInfo = ComponentCollector.getInstance().getHelpConfigUseInfoWithTemplate(jForm.getTarget().getTemplateID()); + for (XCreator xCreator : xCreators) { + if (EffectItemUtils.hasEffectItem(xCreator.toData())) { + showCount ++; + if (helpConfigUseInfo.contains(ShareComponentUtils.getWidgetId(xCreator.toData()))) { + useCount++; + } + } + } + + ComponentCollector.getInstance().collectHelpConfigInfo(jForm.getTarget().getTemplateID(), showCount, useCount); + } + } + } + + private static void listenEnv() { + GeneralContext.addEnvChangedListenerToLast(new EnvChangedListener() { + @Override + public void envChanged() { + FormWidgetDetailPane.getInstance().resetEmptyPane(); + LocalWidgetRepoPane.getInstance().refreshPane(); + } + }); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/BaseEffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/BaseEffectItem.java new file mode 100644 index 000000000..20d562621 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/BaseEffectItem.java @@ -0,0 +1,115 @@ +package com.fr.design.share.effect; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.share.effect.source.SourceNode; +import com.fr.stable.StringUtils; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +public class BaseEffectItem implements EffectItem{ + private String name = StringUtils.EMPTY; + private String description = StringUtils.EMPTY; + private NameableCreator creator; + private T object; + private SourceNode sourceNode; + + @Override + public SourceNode getSourceNode() { + return sourceNode; + } + + @Override + public String getConfigPath() { + return getSourceNode().toString(); + } + + public void setSourceNode(SourceNode sourceNode) { + this.sourceNode = sourceNode; + } + + @Override + public String getName() { + return name; + } + + @Override + public void setName(String name) { + this.name = name; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public void setDescription(String description) { + this.description = description; + } + + + @Override + public void save() { + + } + + @Override + public Object getPopulateBean(){ + return getObject(); + } + + @Override + public void updateBean(Object bean) { + + } + + @Override + public T getObject() { + return object; + } + + @Override + public void setObject(T ob) { + this.object = ob; + } + + @Override + public NameableCreator creator() { + return this.creator; + } + + public void setNameableCreator(NameableCreator creator) { + this.creator = creator; + } + + @Override + public BasicBeanPane createPaneByCreators(NameableCreator creator) { + try { + return creator.getUpdatePane().newInstance(); + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + + @Override + public BasicBeanPane createPaneByCreators(NameableCreator creator, String string) { + Constructor constructor; + try { + constructor = creator.getUpdatePane().getDeclaredConstructor(new Class[]{String.class}); + constructor.setAccessible(true); + return (BasicBeanPane) constructor.newInstance(string); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/ConditionEffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/ConditionEffectItem.java new file mode 100644 index 000000000..ea5096085 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/ConditionEffectItem.java @@ -0,0 +1,86 @@ +package com.fr.design.share.effect; + +import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.design.ChartTypeInterfaceManager; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.share.effect.source.SourceNode; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; + +public class ConditionEffectItem extends BaseEffectItem { + private ConditionAttr condition; + private Plot plot; + public ConditionEffectItem(ConditionAttr condition, SourceNode sourceNode, Plot plot) { + this.condition = condition; + this.plot = plot; + this.setSourceNode(sourceNode); + init(); + } + + private void init() { + ConditionAttr object; + try { + object = (ConditionAttr) condition.clone(); + } catch (CloneNotSupportedException e) { + object = new ConditionAttr(); + object.setName(condition.getName()); + object.setCondition(condition.getCondition()); + for (int i = 0; i < condition.getDataSeriesConditionCount(); i++) { + object.addDataSeriesCondition(condition.getDataSeriesCondition(i)); + } + } + setObject(object); + this.setName(condition.getName()); + this.setNameableCreator(new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), ConditionAttr.class, getPlotConditionPane(this.plot))); + } + + private Class getPlotConditionPane(Plot plot) { + return ChartTypeInterfaceManager.getInstance().getPlotConditionPane(plot).getClass(); + } + + @Override + public void setName(String name) { + super.setName(name); + getObject().setName(name); + } + + @Override + public BasicBeanPane createPaneByCreators(NameableCreator creator) { + Constructor constructor = null; + try { + constructor = creator.getUpdatePane().getConstructor(Plot.class); + return constructor.newInstance(this.plot); + + } catch (InstantiationException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } + return null; + } + + @Override + public void updateBean(Object bean) { + ConditionAttr conditionAttr = (ConditionAttr) bean; + conditionAttr.setName(this.getName()); + setObject(conditionAttr); + } + + public void save() { + condition.setName(getObject().getName()); + condition.setCondition(getObject().getCondition()); + condition.removeAll(); + for (int i = 0; i < getObject().getDataSeriesConditionCount(); i++) { + condition.addDataSeriesCondition(getObject().getDataSeriesCondition(i)); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItem.java new file mode 100644 index 000000000..33bfe7fe5 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItem.java @@ -0,0 +1,32 @@ +package com.fr.design.share.effect; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.share.effect.source.SourceNode; +import com.fr.stable.Nameable; + +public interface EffectItem extends Nameable { + SourceNode getSourceNode(); + + String getConfigPath(); + + String getDescription(); + + void setDescription(String description); + + T getObject(); + + void setObject(T ob); + + Object getPopulateBean(); + + void save(); + + void updateBean(Object bean); + + NameableCreator creator(); + + BasicBeanPane createPaneByCreators(NameableCreator creator); + + BasicBeanPane createPaneByCreators(NameableCreator creator, String string); +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java new file mode 100644 index 000000000..c04932d0d --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/EffectItemGroup.java @@ -0,0 +1,284 @@ +package com.fr.design.share.effect; + +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.chart.chartattr.Plot; +import com.fr.chart.chartglyph.ConditionCollection; +import com.fr.chartx.attr.ChartProvider; +import com.fr.design.share.effect.source.SourceNode; +import com.fr.design.share.effect.source.SourceNodeUtils; +import com.fr.form.FormElementCaseProvider; +import com.fr.form.event.Listener; +import com.fr.form.ui.ChartEditor; +import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WTitleLayout; +import com.fr.js.NameJavaScript; +import com.fr.js.NameJavaScriptGroup; +import com.fr.plugin.chart.attr.axis.VanChartAlertValue; +import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartPlot; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.custom.VanChartCustomPlot; +import com.fr.report.cell.DefaultTemplateCellElement; +import com.fr.report.cell.cellattr.highlight.DefaultHighlight; +import com.fr.report.cell.cellattr.highlight.HighlightGroup; +import com.fr.report.web.util.ReportEngineEventMapping; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; + +public class EffectItemGroup { + private List conditionEffectItems = new ArrayList(); + private List highlightEffectItems = new ArrayList(); + private List hyperlinkEffectItems = new ArrayList(); + private List listenerEffectItems = new ArrayList(); + private List stackAndAxisConditionEffectItems = new ArrayList(); + private List vanChartAlertValueEffectItems = new ArrayList(); + private List effectItems = new ArrayList(); + private LinkedHashMap> effectItemsMap; + private Widget widget; + + public EffectItemGroup() { + + } + + public EffectItemGroup(Widget widget) { + this.widget = widget; + initListener(widget); + if (widget instanceof WTitleLayout) { + WTitleLayout wTitleLayout = (WTitleLayout) widget; + this.widget = wTitleLayout.getBodyBoundsWidget().getWidget(); + if (this.widget instanceof ElementCaseEditor) { + initElementCase(); + } else if (this.widget instanceof ChartEditor) { + initChartEditor(); + } + } + } + + public Widget getWidget() { + return widget; + } + + private void initListener(Widget widget) { + int listenerSize = widget.getListenerSize(); + for (int index = 0; index < listenerSize; index ++) { + Listener listener = widget.getListener(index); + SourceNode sourceNode = SourceNodeUtils.createSourceNode(widget, null); + this.add(new ListenerEffectItem(listener, sourceNode)); + } + } + + private String switchLang(String eventName) { + // 在 properties 文件中找到相应的 key 值 + String localeKey = ReportEngineEventMapping.getLocaleName(eventName); + return com.fr.design.i18n.Toolkit.i18nText(localeKey); + } + + private void initElementCase() { + ElementCaseEditor editor = (ElementCaseEditor) this.widget; + FormElementCaseProvider elementCase = editor.getElementCase(); + Iterator cellIterator = elementCase.cellIterator(); + + while(cellIterator.hasNext()) { + DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) cellIterator.next(); + SourceNode cellSourceNode = SourceNodeUtils.createSourceNode(cellElement, null); + + // 条件属性 + if (cellElement.getHighlightGroup() != null) { + HighlightGroup highlightGroup = cellElement.getHighlightGroup(); + for (int index = 0; index < highlightGroup.size(); index ++) { + DefaultHighlight highlight=(DefaultHighlight) highlightGroup.getHighlight(index); + this.add(new HighlightEffectItem(highlight, cellSourceNode)); + } + } + + // 超链 + if (cellElement.getNameHyperlinkGroup() != null) { + NameJavaScriptGroup nameHyperlinkGroup = cellElement.getNameHyperlinkGroup(); + for (int index = 0; index < nameHyperlinkGroup.size(); index ++) { + NameJavaScript nameJavaScript = nameHyperlinkGroup.getNameHyperlink(index); + this.add(new HyperlinkEffectItem(nameJavaScript, cellSourceNode)); + } + } + + // 图表内部 + Object value = cellElement.getValue(); + if (value instanceof ChartCollection) { + ChartCollection chartCollection = (ChartCollection) value; + for (int index = 0; index < chartCollection.getChartCount(); index++) { + Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); + Plot plot = chart.getPlot(); + if (plot == null) { + continue; + } + SourceNode chartSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), cellSourceNode); + initChartPlot(plot, chartSourceNode, false); + } + + } + } + + } + + private void initChartEditor() { + ChartEditor editor = (ChartEditor) this.widget; + ChartCollection chartCollection = (ChartCollection) editor.getChartCollection(); + for (int index = 0; index < chartCollection.getChartCount(); index++) { + Chart chart= (Chart) chartCollection.getChart(index, ChartProvider.class); + Plot plot = chart.getPlot(); + if (plot == null) { + continue; + } + SourceNode plotSourceNode = SourceNodeUtils.createSourceNode(plot, chartCollection.getChartName(index), null); + initChartPlot(plot, plotSourceNode, false); + } + + } + + private void initChartPlot(Plot plot, SourceNode sourceNode, boolean isSubChart) { + if (plot.getConditionCollection() != null) { + // 图表条件属性 + ConditionCollection conditionCollection = plot.getConditionCollection(); + for (int j = 0; j < conditionCollection.getConditionAttrSize(); j ++) { + this.add(new ConditionEffectItem(conditionCollection.getConditionAttr(j), sourceNode, plot)); + } + } + + if (plot.getHotHyperLink() != null) { + // 图表超链 + NameJavaScriptGroup nameHyperlinkGroup = plot.getHotHyperLink(); + for (int j = 0; j < nameHyperlinkGroup.size(); j ++) { + NameJavaScript nameJavaScript = nameHyperlinkGroup.getNameHyperlink(j); + this.add(new HyperlinkEffectItem(nameJavaScript, sourceNode)); + } + } + + if (plot instanceof VanChartRectanglePlot) { + VanChartRectanglePlot rectanglePlot = (VanChartRectanglePlot) plot; + // 堆积和坐标轴 + ConditionCollection stackAndAxisCondition= rectanglePlot.getStackAndAxisCondition(); + + for(int index = 0; index < stackAndAxisCondition.getConditionAttrSize(); index ++) { + this.add(new StackAndAxisConditionEffectItem(stackAndAxisCondition.getConditionAttr(index), sourceNode, (VanChartRectanglePlot) plot)); + } + if (!isSubChart) { + // 警戒线 + List xAxisList = rectanglePlot.getXAxisList(); + List yAxisList = rectanglePlot.getYAxisList(); + for(VanChartAxis axis : xAxisList) { + for(VanChartAlertValue alertValue: axis.getAlertValues()) { + this.add(new VanChartAlertValueEffectItem(alertValue, sourceNode, (VanChartRectanglePlot) plot)); + } + } + for(VanChartAxis axis : yAxisList) { + for(VanChartAlertValue alertValue: axis.getAlertValues()) { + this.add(new VanChartAlertValueEffectItem(alertValue, sourceNode, (VanChartRectanglePlot) plot)); + } + } + } + } + + if (plot instanceof VanChartCustomPlot) { + VanChartCustomPlot customPlot = (VanChartCustomPlot) plot; + List plotList= customPlot.getCustomPlotList(); + for(VanChartPlot innerPlot : plotList) { + initChartPlot(innerPlot, SourceNodeUtils.createSourceNode(innerPlot, sourceNode), true); + } + } + } + + public List getConditionEffectItems() { + return conditionEffectItems; + } + + public List getHighlightEffectItems() { + return highlightEffectItems; + } + + public List getHyperlinkEffectItems() { + return hyperlinkEffectItems; + } + + public List getListenerEffectItems() { + return listenerEffectItems; + } + + public List getStackAndAxisConditionEffectItems() { + return stackAndAxisConditionEffectItems; + } + + public List getVanChartAlertLineEffectItems() { + return vanChartAlertValueEffectItems; + } + + public List getEffectItems() { + return effectItems; + } + + public void add(ConditionEffectItem conditionEffectItem) { + conditionEffectItems.add(conditionEffectItem); + effectItems.add(conditionEffectItem); + } + + public void add(HighlightEffectItem highlightEffectItem) { + highlightEffectItems.add(highlightEffectItem); + effectItems.add(highlightEffectItem); + } + + public void add(HyperlinkEffectItem hyperlinkEffectItem) { + hyperlinkEffectItems.add(hyperlinkEffectItem); + effectItems.add(hyperlinkEffectItem); + } + + public void add(ListenerEffectItem listenerEffectItem) { + listenerEffectItems.add(listenerEffectItem); + effectItems.add(listenerEffectItem); + } + + public void add(StackAndAxisConditionEffectItem stackAndAxisConditionEffectItem) { + stackAndAxisConditionEffectItems.add(stackAndAxisConditionEffectItem); + effectItems.add(stackAndAxisConditionEffectItem); + } + + public void add(VanChartAlertValueEffectItem vanChartAlertLineEffectItem) { + vanChartAlertValueEffectItems.add(vanChartAlertLineEffectItem); + effectItems.add(vanChartAlertLineEffectItem); + } + + public LinkedHashMap> getEffectItemsWithClassify() { + if (effectItemsMap != null) { + return effectItemsMap; + } + effectItemsMap = new LinkedHashMap>(); + + if (listenerEffectItems.size() > 0) { + effectItemsMap.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), listenerEffectItems); + } + if (highlightEffectItems.size() > 0 || conditionEffectItems.size() > 0) { + List tmpEffectItems = new ArrayList<>(); + tmpEffectItems.addAll(highlightEffectItems); + tmpEffectItems.addAll(conditionEffectItems); + effectItemsMap.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), tmpEffectItems); + } + if (hyperlinkEffectItems.size() > 0) { + effectItemsMap.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hyperlink"), hyperlinkEffectItems); + } + if (vanChartAlertValueEffectItems.size() > 0 || stackAndAxisConditionEffectItems.size() > 0) { + List tmpEffectItems = new ArrayList<>(); + tmpEffectItems.addAll(vanChartAlertValueEffectItems); + tmpEffectItems.addAll(stackAndAxisConditionEffectItems); + effectItemsMap.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"), tmpEffectItems); + } + return effectItemsMap; + } + + public void save() { + for (EffectItem effectItem : this.effectItems) { + effectItem.save(); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/HighlightEffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/HighlightEffectItem.java new file mode 100644 index 000000000..806e2e51a --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/HighlightEffectItem.java @@ -0,0 +1,56 @@ +package com.fr.design.share.effect; + +import com.fr.design.condition.HighLightConditionAttributesPane; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.share.effect.source.SourceNode; +import com.fr.report.cell.cellattr.highlight.DefaultHighlight; + +public class HighlightEffectItem extends BaseEffectItem{ + private DefaultHighlight highlight; + + public HighlightEffectItem(DefaultHighlight highlight, SourceNode sourceNode) { + this.highlight = highlight; + this.setSourceNode(sourceNode); + this.init(); + } + + private void init() { + DefaultHighlight object; + try { + object = (DefaultHighlight) highlight.clone(); + } catch (CloneNotSupportedException e) { + object = new DefaultHighlight(); + object.setName(highlight.getName()); + object.setCondition(highlight.getCondition()); + for (int i = 0; i < highlight.actionCount(); i++) { + object.addHighlightAction(highlight.getHighlightAction(i)); + } + } + setObject(object); + + this.setName(highlight.getName()); + this.setNameableCreator(new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), DefaultHighlight.class, HighLightConditionAttributesPane.class)); + } + + public void setName(String name) { + super.setName(name); + getObject().setName(name); + } + + @Override + public void updateBean(Object bean) { + DefaultHighlight highlight = (DefaultHighlight) bean; + highlight.setName(this.getName()); + setObject(highlight); + } + + @Override + public void save() { + highlight.setCondition(getObject().getCondition()); + highlight.setName(getObject().getName()); + highlight.removeActions(); + for (int i = 0; i < getObject().actionCount(); i++) { + highlight.addHighlightAction(getObject().getHighlightAction(i)); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/HyperlinkEffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/HyperlinkEffectItem.java new file mode 100644 index 000000000..d7a572664 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/HyperlinkEffectItem.java @@ -0,0 +1,93 @@ +package com.fr.design.share.effect; + +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.form.javascript.FormEmailPane; +import com.fr.design.fun.HyperlinkProvider; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.module.DesignModuleFactory; +import com.fr.design.share.effect.source.SourceNode; +import com.fr.general.ComparatorUtils; +import com.fr.js.EmailJavaScript; +import com.fr.js.JavaScript; +import com.fr.js.NameJavaScript; +import com.fr.stable.ListMap; + +import java.util.Map; +import java.util.Set; + +public class HyperlinkEffectItem extends BaseEffectItem{ + private NameJavaScript javaScript; + + public HyperlinkEffectItem(NameJavaScript javaScript, SourceNode sourceNode) { + this.javaScript = javaScript; + this.setSourceNode(sourceNode); + this.init(); + } + + private void init() { + NameJavaScript object; + try { + object = (NameJavaScript) javaScript.clone(); + } catch (CloneNotSupportedException e) { + object = new NameJavaScript(javaScript.getName(), javaScript.getJavaScript()); + } + setObject(object); + + this.setName(this.javaScript.getName()); + NameableCreator[] creators = createNameableCreator(); + for (NameableCreator creator : creators) { + if (creator.acceptObject2Populate(javaScript.getJavaScript()) != null) { + this.setNameableCreator(creator); + return; + } + } + } + + public void setName(String name) { + super.setName(name); + getObject().setName(name); + } + + private NameableCreator[] createNameableCreator() { + Map nameCreators = new ListMap<>(); + NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators(); + for (NameableCreator creator : creators) { + nameCreators.put(creator.menuName(), creator); + } + Set providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); + for (HyperlinkProvider provider : providers) { + NameableCreator nc = provider.createHyperlinkCreator(); + nameCreators.put(nc.menuName(), nc); + } + + creators = nameCreators.values().toArray(new NameableCreator[nameCreators.size()]); + for (int i = 0; i < creators.length; i++) { + if (ComparatorUtils.equals(creators[i].menuName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"))) { + creators[i] = new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), EmailJavaScript.class, FormEmailPane.class); + break; + } + } + + return creators; + } + + @Override + public Object getPopulateBean() { + return getObject().getObject(); + } + + @Override + public void updateBean(Object bean) { + JavaScript javaScript = (JavaScript) bean; + getObject().setJavaScript(javaScript); + getObject().setObject(bean); + } + + @Override + public void save() { + javaScript.setName(getObject().getName()); + javaScript.setObject(getObject().getObject()); + javaScript.setJavaScript(getObject().getJavaScript()); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/ListenerEffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/ListenerEffectItem.java new file mode 100644 index 000000000..55b53ad72 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/ListenerEffectItem.java @@ -0,0 +1,48 @@ +package com.fr.design.share.effect; + +import com.fr.design.designer.properties.EventPropertyTable; +import com.fr.design.share.effect.source.SourceNode; +import com.fr.design.widget.EventCreator; +import com.fr.form.event.Listener; +import com.fr.form.ui.Widget; + +public class ListenerEffectItem extends BaseEffectItem { + private Listener listener; + + public ListenerEffectItem(Listener listener, SourceNode sourceNode) { + this.listener = listener; + this.setSourceNode(sourceNode); + init(); + } + + private void init() { + Listener object; + try { + object = (Listener) listener.clone(); + } catch (CloneNotSupportedException e) { + object = new Listener(listener.getTargetWidget(), listener.getEventName(), listener.getAction(), listener.isInvokeOnce()); + } + setObject(object); + + setName(listener.getName()); + this.setNameableCreator(new EventCreator(Widget.EVENT_STATECHANGE, EventPropertyTable.WidgetEventListenerUpdatePane.class)); + } + + @Override + public void updateBean(Object bean) { + setObject((Listener) bean); + } + + public void setName(String name) { + super.setName(name); + getObject().setName(name); + } + + public void save() { + listener.setName(getObject().getName()); + listener.setEventName(getObject().getEventName()); + listener.setAction(getObject().getAction()); + listener.setInvokeOnce(getObject().isInvokeOnce()); + listener.setTargetWidget(getObject().getTargetWidget()); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/StackAndAxisConditionEffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/StackAndAxisConditionEffectItem.java new file mode 100644 index 000000000..a4b8804ae --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/StackAndAxisConditionEffectItem.java @@ -0,0 +1,73 @@ +package com.fr.design.share.effect; + +import com.fr.chart.chartglyph.ConditionAttr; +import com.fr.design.share.effect.source.SourceNode; +import com.fr.plugin.chart.attr.DefaultAxisHelper; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.plugin.chart.base.AttrSeriesStackAndAxis; +import com.fr.van.chart.column.VanChartCustomStackAndAxisConditionPane; +import com.fr.van.chart.designer.style.series.StackedAndAxisNameObjectCreator; + +public class StackAndAxisConditionEffectItem extends BaseEffectItem { + private ConditionAttr condition; + private VanChartRectanglePlot plot; + + public StackAndAxisConditionEffectItem(ConditionAttr condition, SourceNode sourceNode, VanChartRectanglePlot plot) { + this.condition = condition; + this.plot = plot; + this.setSourceNode(sourceNode); + + init(); + } + + private void init() { + setAxisNamesArray(condition); + + ConditionAttr object; + try { + object = (ConditionAttr) condition.clone(); + } catch (CloneNotSupportedException e) { + object = new ConditionAttr(); + object.setName(condition.getName()); + object.setCondition(condition.getCondition()); + for (int i = 0; i < condition.getDataSeriesConditionCount(); i++) { + object.addDataSeriesCondition(condition.getDataSeriesCondition(i)); + } + } + setObject(object); + + this.setName(condition.getName()); + this.setNameableCreator(new StackedAndAxisNameObjectCreator(new AttrSeriesStackAndAxis(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Stack_And_Series"), ConditionAttr.class, VanChartCustomStackAndAxisConditionPane.class)); + } + + @Override + public void setName(String name) { + super.setName(name); + getObject().setName(name); + } + + @Override + public void updateBean(Object bean) { + ConditionAttr conditionAttr = (ConditionAttr) bean; + conditionAttr.setName(getName()); + setAxisNamesArray(conditionAttr); + setObject(conditionAttr); + } + + public void save() { + condition.setName(getObject().getName()); + condition.setCondition(getObject().getCondition()); + condition.removeAll(); + for (int i = 0; i < getObject().getDataSeriesConditionCount(); i++) { + condition.addDataSeriesCondition(getObject().getDataSeriesCondition(i)); + } + } + + private void setAxisNamesArray(ConditionAttr conditionAttr) { + String[] axisXNames = DefaultAxisHelper.getXAxisNames(plot); + String[] axisYNames = DefaultAxisHelper.getYAxisNames(plot); + AttrSeriesStackAndAxis stackAndAxis = (AttrSeriesStackAndAxis) conditionAttr.getExisted(AttrSeriesStackAndAxis.class); + stackAndAxis.setXAxisNamesArray(axisXNames); + stackAndAxis.setYAxisNameArray(axisYNames); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/VanChartAlertValueEffectItem.java b/designer-realize/src/main/java/com/fr/design/share/effect/VanChartAlertValueEffectItem.java new file mode 100644 index 000000000..349ec91eb --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/VanChartAlertValueEffectItem.java @@ -0,0 +1,94 @@ +package com.fr.design.share.effect; + +import com.fr.design.share.effect.source.SourceNode; +import com.fr.plugin.chart.attr.DefaultAxisHelper; +import com.fr.plugin.chart.attr.axis.VanChartAlertValue; +import com.fr.plugin.chart.attr.axis.VanChartAxis; +import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; +import com.fr.van.chart.designer.style.background.ChartNameObjectCreator; +import com.fr.van.chart.designer.style.background.VanChartAlertValuePane; + +import java.util.List; + +public class VanChartAlertValueEffectItem extends BaseEffectItem { + private VanChartAlertValue alertValue; + private VanChartRectanglePlot plot; + + public VanChartAlertValueEffectItem(VanChartAlertValue alertValue, SourceNode sourceNode, VanChartRectanglePlot plot) { + this.alertValue = alertValue; + this.plot = plot; + this.setSourceNode(sourceNode); + init(); + } + + private void init() { + List xAxisList = plot.getXAxisList(); + List yAxisList = plot.getYAxisList(); + String[] axisNames = DefaultAxisHelper.getAllAxisNames(plot); + for (VanChartAxis axis : xAxisList) { + List values = axis.getAlertValues(); + for (VanChartAlertValue alertValue : values) { + alertValue.setAxisNamesArray(axisNames); + alertValue.setAxisName(plot.getXAxisName(axis)); + } + } + for (VanChartAxis axis : yAxisList) { + List values = axis.getAlertValues(); + for (VanChartAlertValue alertValue : values) { + alertValue.setAxisNamesArray(axisNames); + alertValue.setAxisName(plot.getYAxisName(axis)); + } + } + + VanChartAlertValue object; + try{ + object = (VanChartAlertValue) alertValue.clone(); + }catch (CloneNotSupportedException e) { + object = new VanChartAlertValue(); + object.setAxisNamesArray(alertValue.getAxisNamesArray()); + object.setAxisName(alertValue.getAxisName()); + object.setAlertContentFormula(alertValue.getAlertContentFormula()); + object.setAlertContent(alertValue.getAlertContent()); + object.setAlertPosition(alertValue.getAlertPosition()); + object.setAlertValueFormula(alertValue.getAlertValueFormula()); + object.setAlertFont(alertValue.getAlertFont()); + object.setAlertLineAlpha(alertValue.getAlertLineAlpha()); + object.setAlertPaneSelectName(alertValue.getAlertPaneSelectName()); + object.setLineColor(alertValue.getLineColor()); + object.setLineStyle(alertValue.getLineStyle()); + } + setObject(object); + + this.setName(alertValue.getAlertPaneSelectName()); + this.setNameableCreator(new ChartNameObjectCreator(axisNames, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Alert_Line"), VanChartAlertValue.class, VanChartAlertValuePane.class)); + } + + @Override + public void setName(String name) { + super.setName(name); + getObject().setAlertPaneSelectName(name); + } + + @Override + public void updateBean(Object bean) { + VanChartAlertValue alertValue = (VanChartAlertValue) bean; + alertValue.setAlertPaneSelectName(getName()); + setObject(alertValue); + } + + @Override + public void save() { + VanChartAlertValue object = getObject(); + alertValue.setAxisNamesArray(object.getAxisNamesArray()); + alertValue.setAxisName(object.getAxisName()); + alertValue.setAlertContentFormula(object.getAlertContentFormula()); + alertValue.setAlertContent(object.getAlertContent()); + alertValue.setAlertPosition(object.getAlertPosition()); + alertValue.setAlertValueFormula(object.getAlertValueFormula()); + alertValue.setAlertFont(object.getAlertFont()); + alertValue.setAlertLineAlpha(object.getAlertLineAlpha()); + alertValue.setAlertPaneSelectName(object.getAlertPaneSelectName()); + alertValue.setLineColor(object.getLineColor()); + alertValue.setLineStyle(object.getLineStyle()); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/source/BaseSourceNode.java b/designer-realize/src/main/java/com/fr/design/share/effect/source/BaseSourceNode.java new file mode 100644 index 000000000..feac2413b --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/source/BaseSourceNode.java @@ -0,0 +1,42 @@ +package com.fr.design.share.effect.source; + +public class BaseSourceNode implements SourceNode { + private String path; + private SourceNode parent; + private T target; + + @Override + public String toString() { + if (getParent() != null) { + return getParent().toString() + "-" + path; + } + return path; + } + + @Override + public T getTarget() { + return target; + } + + public void setTarget(T target) { + this.target = target; + } + + @Override + public SourceNode getParent() { + return parent; + } + + @Override + public void setParent(SourceNode parent) { + this.parent = parent; + } + + public void setPath(String path) { + this.path = path; + } + + public String getPath() { + return path; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/source/CellSourceNode.java b/designer-realize/src/main/java/com/fr/design/share/effect/source/CellSourceNode.java new file mode 100644 index 000000000..52cff5251 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/source/CellSourceNode.java @@ -0,0 +1,21 @@ +package com.fr.design.share.effect.source; + + +import com.fr.report.cell.DefaultTemplateCellElement; + +public class CellSourceNode extends BaseSourceNode { + + public CellSourceNode(DefaultTemplateCellElement cellElement) { + this(cellElement, null); + } + + public CellSourceNode(DefaultTemplateCellElement cellElement, SourceNode parent) { + this(cellElement, cellElement.toString(), parent); + } + + public CellSourceNode(DefaultTemplateCellElement cellElement, String path, SourceNode parent) { + this.setTarget(cellElement); + this.setPath(path); + this.setParent(parent); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/source/EventSourceNode.java b/designer-realize/src/main/java/com/fr/design/share/effect/source/EventSourceNode.java new file mode 100644 index 000000000..7f30a2d8a --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/source/EventSourceNode.java @@ -0,0 +1,25 @@ +package com.fr.design.share.effect.source; + +import com.fr.form.ui.Widget; + +public class EventSourceNode extends BaseSourceNode { + static final private String DEFAULT_PATH = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"); + + public EventSourceNode(Widget widget) { + this(widget, DEFAULT_PATH, null); + } + + public EventSourceNode(Widget widget, String path) { + this(widget, path, null); + } + + public EventSourceNode(Widget widget, SourceNode parent) { + this(widget, DEFAULT_PATH, parent); + } + + public EventSourceNode(Widget widget, String path, SourceNode parent) { + this.setTarget(widget); + this.setPath(path); + this.setParent(parent); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/source/PlotSourceNode.java b/designer-realize/src/main/java/com/fr/design/share/effect/source/PlotSourceNode.java new file mode 100644 index 000000000..c4698fd24 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/source/PlotSourceNode.java @@ -0,0 +1,31 @@ +package com.fr.design.share.effect.source; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.ChartTypeInterfaceManager; +import com.fr.stable.StringUtils; + +public class PlotSourceNode extends BaseSourceNode { + + public PlotSourceNode(Plot plot) { + this(plot, StringUtils.EMPTY, null); + } + + public PlotSourceNode(Plot plot, SourceNode parent) { + this(plot, StringUtils.EMPTY, parent); + } + + public PlotSourceNode(Plot plot, String chartName) { + this(plot, chartName, null); + } + + public PlotSourceNode(Plot plot, String chartName, SourceNode parent) { + String path = ChartTypeInterfaceManager.getInstance().getName(plot.getPlotID()); + if (StringUtils.isNotEmpty(chartName)) { + path = path + "-" + chartName; + } + this.setPath(path); + this.setTarget(plot); + this.setParent(parent); + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/source/SourceNode.java b/designer-realize/src/main/java/com/fr/design/share/effect/source/SourceNode.java new file mode 100644 index 000000000..7094a6959 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/source/SourceNode.java @@ -0,0 +1,14 @@ +package com.fr.design.share.effect.source; + + + +public interface SourceNode { + String toString(); + + T getTarget(); + + SourceNode getParent(); + + void setParent(SourceNode parent); +} + diff --git a/designer-realize/src/main/java/com/fr/design/share/effect/source/SourceNodeUtils.java b/designer-realize/src/main/java/com/fr/design/share/effect/source/SourceNodeUtils.java new file mode 100644 index 000000000..9d988710f --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/effect/source/SourceNodeUtils.java @@ -0,0 +1,34 @@ +package com.fr.design.share.effect.source; + +import com.fr.chart.chartattr.Plot; +import com.fr.form.ui.Widget; +import com.fr.report.cell.DefaultTemplateCellElement; + +public class SourceNodeUtils { + static public SourceNode createSourceNode(Widget widget, SourceNode parent) { + return new EventSourceNode(widget, parent); + } + + static public SourceNode createSourceNode(DefaultTemplateCellElement cellElement, SourceNode parent) { + return new CellSourceNode(cellElement, parent); + } + + + static public SourceNode createSourceNode(Plot plot, SourceNode parent) { + return new PlotSourceNode(plot, parent); + } + + static public SourceNode createSourceNode(Plot plot, String chartName, SourceNode parent) { + return new PlotSourceNode(plot, chartName, parent); + } + + static public SourceNode getCellSourceNode(SourceNode sourceNode) { + if (sourceNode instanceof CellSourceNode) { + return sourceNode; + } + if (sourceNode.getParent() != null) { + return getCellSourceNode(sourceNode.getParent()); + } + return null; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigContentPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigContentPane.java new file mode 100644 index 000000000..fefb5649d --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigContentPane.java @@ -0,0 +1,175 @@ +package com.fr.design.share.ui.config; + +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.mainframe.share.ui.base.PlaceholderTextArea; +import com.fr.design.share.effect.EffectItem; +import com.fr.design.share.effect.EffectItemGroup; +import com.fr.design.share.effect.source.SourceNode; +import com.fr.design.share.effect.source.SourceNodeUtils; +import com.fr.design.share.ui.config.table.ExpandEffectTable; +import com.fr.design.share.ui.effect.PreviewPane; +import com.fr.form.ui.Widget; +import com.fr.grid.selection.CellSelection; +import com.fr.locale.InterProviderFactory; +import com.fr.report.cell.DefaultTemplateCellElement; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class ShareConfigContentPane extends JPanel { + private EffectItemGroup effectItemGroup; + private PreviewPane previewPane; + private String info; + private List expandEffectTables = new ArrayList<>(); + + public ShareConfigContentPane(EffectItemGroup effectItemGroup, String info) { + this.effectItemGroup = effectItemGroup; + this.info = info; + initComponent(); + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel leftPane = createLeftPane(); + JPanel rightPane = createRightPane(); + this.add(leftPane, BorderLayout.WEST); + this.add(rightPane, BorderLayout.CENTER); + } + + private JPanel createLeftPane() { + JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + leftPane.add(createPreviewPane(), BorderLayout.NORTH); + leftPane.add(createInfoPane(), BorderLayout.CENTER); + return leftPane; + } + + private JPanel createRightPane() { + JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + rightPane.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0)); + rightPane.add(createEffectPane(), BorderLayout.CENTER); + return rightPane; + } + + private JPanel createPreviewPane() { + + JPanel pane= FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText(Toolkit.i18nText("Fine-Design_Share_Preview"))); + previewPane = new PreviewPane(getWidget()); + pane.add(previewPane, BorderLayout.CENTER); + return pane; + } + + private JPanel createInfoPane() { + JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Share_Introduce")); + PlaceholderTextArea textArea = new PlaceholderTextArea(); + textArea.setText(this.info); + textArea.setPlaceholder(Toolkit.i18nText("Fine-Design_Share_No_Introduction")); + textArea.setEditable(false); + UIScrollPane scrollPane = new UIScrollPane(textArea); + scrollPane.setPreferredSize(new Dimension(373, 176)); + infoPane.add(scrollPane, BorderLayout.CENTER); + return infoPane; + } + + private JPanel createEffectPane() { + JPanel effectPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText(Toolkit.i18nText("Fine-Design_Share_Effects"))); + JPanel effectContainer = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, VerticalFlowLayout.TOP,0, 0); + + EffectItemGroup effectItemGroup = getEffectItemGroup(); + LinkedHashMap> effectItemsMap = effectItemGroup.getEffectItemsWithClassify(); + + Set>> entrySet = effectItemsMap.entrySet(); + Iterator>> iterator = entrySet.iterator(); + + expandEffectTables.clear(); + while (iterator.hasNext()) { + Map.Entry> entry= iterator.next(); + String title = entry.getKey(); + List effectItems = entry.getValue(); + ExpandEffectTable expandEffectTable= new ExpandEffectTable(effectItems, title); + expandEffectTables.add(expandEffectTable); + JTable table = expandEffectTable.getTable(); + if (previewPane.isElementCaseEditor()) { + table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent e) { + if (table.getSelectedRow() >= 0) { + EffectItem effectItem= effectItems.get(table.getSelectedRow()); + SourceNode cellSourceNode = SourceNodeUtils.getCellSourceNode(effectItem.getSourceNode()); + if (cellSourceNode != null) { + DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) cellSourceNode.getTarget(); + previewPane.getElementCasePane().setSelection(new CellSelection(cellElement.getColumn(), cellElement.getRow(), cellElement.getColumnSpan(), cellElement.getRowSpan())); + } + } + } + }); + } + effectContainer.add(expandEffectTable); + + } + + UIScrollPane scrollPane = new UIScrollPane(effectContainer); + scrollPane.setPreferredSize(new Dimension(465, 545)); + scrollPane.getViewport().addComponentListener(new ComponentListener() { + @Override + public void componentResized(ComponentEvent e) { + Component component = e.getComponent(); + if (component != null) { + for(ExpandEffectTable expandEffectTable : expandEffectTables) { + for(Component co : expandEffectTable.getComponents()) { + co.setPreferredSize(new Dimension(component.getWidth(), co.getHeight())); + co.setSize(new Dimension(component.getWidth(), co.getHeight())); + } + } + } + } + @Override + public void componentMoved(ComponentEvent e) { + + } + @Override + public void componentShown(ComponentEvent e) { + + } + @Override + public void componentHidden(ComponentEvent e) { + + } + }); + scrollPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + + effectPane.add(scrollPane, BorderLayout.CENTER); + return effectPane; + } + + private Widget getWidget() { + return getEffectItemGroup().getWidget(); + } + + private EffectItemGroup getEffectItemGroup() { + return effectItemGroup; + } + + public void reset() { + if (previewPane.isElementCaseEditor() && (previewPane.getElementCasePane() != null)) { + previewPane.getElementCasePane().setSelection(new CellSelection(0, 0, 0, 0)); + } + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java new file mode 100644 index 000000000..81d91c471 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/config/ShareConfigPane.java @@ -0,0 +1,241 @@ +package com.fr.design.share.ui.config; + +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIButtonUI; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.ui.base.PlaceholderTextArea; +import com.fr.design.mainframe.share.util.ShareComponentUtils; +import com.fr.design.share.SharableManager; +import com.fr.design.share.effect.EffectItemGroup; +import com.fr.design.share.utils.EffectItemUtils; +import com.fr.design.share.utils.ShareDialogUtils; +import com.fr.design.utils.gui.GUIPaintUtils; +import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WTitleLayout; +import com.fr.locale.InterProviderFactory; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.border.Border; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics2D; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.HashMap; +import java.util.List; + +public class ShareConfigPane extends BasicPane { + private static final Dimension DIALOG_SIZE = new Dimension(900, 680); + private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); + private static final Color EMPTY_TEXT_COLOR = new Color(51, 51, 51, 128); + + private Widget widget; + private List effectItemGroups; + private HashMap quickConfigContentPaneMap = new HashMap(); + + private BasicDialog dialog; + private int selectIndex = 0; + private CardLayout cardLayout; + private JPanel contentPane; + private UILabel nameLabel; + private UIButton preButton; + private UIButton nextButton; + + + + public ShareConfigPane(Widget widget) { + this.widget = widget; + effectItemGroups = EffectItemUtils.getEffectItemGroupsByWidget(widget); + initComponent(); + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(DIALOG_BORDER); + this.setPreferredSize(DIALOG_SIZE); + + if (effectItemGroups.size() > 0) { + this.add(createNaviPane(), BorderLayout.NORTH); + this.add(createContentPane(), BorderLayout.CENTER); + } else { + this.add(createInfoPane(), BorderLayout.WEST); + this.add(createEffectEmptyPane(), BorderLayout.EAST); + } + + } + + private JPanel createNaviPane() { + JPanel naviPane = new JPanel(); + naviPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); + naviPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); + + preButton = new UIButton(Toolkit.i18nText("Fine-Design_Share_Prev")); + preButton.setPreferredSize(new Dimension(62, 20)); + preButton.setUI(disabledUIButtonUI); + preButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + quickConfigContentPaneMap.get(getSelectWidget().getWidgetName()).reset(); + selectIndex--; + TogglePage(); + } + }); + preButton.setEnabled(hasPreview()); + + nextButton = new UIButton(Toolkit.i18nText("Fine-Design_Share_Next")); + nextButton.setPreferredSize(new Dimension(62, 20)); + nextButton.setUI(disabledUIButtonUI); + nextButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + quickConfigContentPaneMap.get(getSelectWidget().getWidgetName()).reset(); + selectIndex++; + TogglePage(); + } + }); + nextButton.setEnabled(hasNext()); + + nameLabel = new UILabel(""); + nameLabel.setPreferredSize(new Dimension(nameLabel.getFont().getSize() * 20, 15)); + + naviPane.add(preButton); + naviPane.add(nextButton); + naviPane.add(nameLabel); + + return naviPane; + } + + private JPanel createContentPane() { + contentPane = new JPanel(); + cardLayout = new CardLayout(); + contentPane.setLayout(cardLayout); + addContent(); + return contentPane; + } + + private void addContent() { + ShareConfigContentPane content = new ShareConfigContentPane(getSelectEffectItemGroup(), getDescription()); + contentPane.add(getSelectWidget().getWidgetName(), content); + quickConfigContentPaneMap.put(getSelectWidget().getWidgetName(), content); + updateContent(); + } + + private void updateContent() { + cardLayout.show(contentPane, getSelectWidget().getWidgetName()); + nameLabel.setText(getSelectWidget().getWidgetName()); + nameLabel.setToolTipText(getSelectWidget().getWidgetName()); + } + + private void TogglePage() { + preButton.setEnabled(hasPreview()); + nextButton.setEnabled(hasNext()); + if (quickConfigContentPaneMap.containsKey(getSelectWidget().getWidgetName())) { + updateContent(); + } else { + addContent(); + } + } + + private JPanel createInfoPane() { + JPanel infoPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Share_Introduce")); + PlaceholderTextArea textArea = new PlaceholderTextArea(); + textArea.setText(getDescription()); + textArea.setPlaceholder(Toolkit.i18nText("Fine-Design_Share_No_Introduction")); + textArea.setEditable(false); + UIScrollPane scrollPane = new UIScrollPane(textArea); + scrollPane.setPreferredSize(new Dimension(373, 176)); + infoPane.add(scrollPane, BorderLayout.CENTER); + return infoPane; + } + + private String getDescription() { + if (this.widget instanceof WTitleLayout) { + return ((WTitleLayout) this.widget).getBodyBoundsWidget().getWidget().getDescription(); + } + return this.widget.getDescription(); + } + + private JPanel createEffectEmptyPane() { + JPanel effectPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Share_Effects")); + effectPane.setLayout(new VerticalFlowLayout(FlowLayout.CENTER,0 , 0)); + effectPane.setPreferredSize(new Dimension(480, 545)); + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Share_Empty")); + label.setAlignmentX(Component.CENTER_ALIGNMENT); + label.setPreferredSize(new Dimension(480, 22)); + label.setHorizontalAlignment(UILabel.CENTER); + label.setForeground(EMPTY_TEXT_COLOR); + effectPane.add(label); + return effectPane; + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Share_Help_Settings"); + } + + public void show() { + final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); + dialog = this.showWindowWithCustomSize(designerFrame, null, DIALOG_SIZE); + ShareDialogUtils.getInstance().setConfigDialog(dialog); + dialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + for(EffectItemGroup effectItemGroup : effectItemGroups) { + effectItemGroup.save(); + } + HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().saveTemplate(); + ComponentCollector.getInstance().setHelpConfigUseInfo(ShareComponentUtils.getCurrentTemplateID(), ShareComponentUtils.getWidgetId(widget)); + SharableManager.saveTemplate(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate()); + } + }); + dialog.setVisible(true); + } + + private boolean hasPreview() { + return selectIndex > 0; + } + + private boolean hasNext() { + return selectIndex < effectItemGroups.size() - 1; + } + + private Widget getSelectWidget() { + return getSelectEffectItemGroup().getWidget(); + } + + private EffectItemGroup getSelectEffectItemGroup() { + return effectItemGroups.get(selectIndex); + } + + private UIButtonUI disabledUIButtonUI = new UIButtonUI() { + protected void doExtraPainting(UIButton b, Graphics2D g2d, int w, int h, String selectedRoles) { + if (!b.isEnabled()) { + GUIPaintUtils.fillPaint(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), new Color(240, 240, 241), UIConstants.ARC); + } else if (isPressed(b) && b.isPressedPainted()) { + GUIPaintUtils.fillPressed(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles)); + } else if (isRollOver(b)) { + GUIPaintUtils.fillRollOver(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); + } else if (b.isNormalPainted()) { + GUIPaintUtils.fillNormal(g2d, 0, 0, w, h, b.isRoundBorder(), b.getRectDirection(), b.isDoneAuthorityEdited(selectedRoles), b.isPressedPainted()); + } + } + }; + +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigItemRender.java b/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigItemRender.java new file mode 100644 index 000000000..1d8874afa --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigItemRender.java @@ -0,0 +1,87 @@ +package com.fr.design.share.ui.config.table; + +import com.fr.base.BaseUtils; +import com.fr.design.i18n.Toolkit; +import com.fr.locale.InterProviderFactory; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JComponent; +import javax.swing.JTable; +import javax.swing.border.Border; +import javax.swing.table.DefaultTableCellRenderer; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; + +public class ConfigItemRender extends DefaultTableCellRenderer { + static final private Color PLACEHOLDER_COLOR = new Color(193, 193, 193); + static final private Color NO_EDITABLE_BG = new Color(240, 240, 241); + + static final private Border DEFAULT_NO_FOCUS_BORDER = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(1, 5, 1, 5), BorderFactory.createEmptyBorder(0, 4, 0, 4)); + static final private Border SELECTED_BORDER = BorderFactory.createLineBorder(new Color(160,190,240)); + + private final Icon editIcon = BaseUtils.readIcon("com/fr/base/images/share/edit.png"); + + public ConfigItemRender() { + super(); + setBorder(DEFAULT_NO_FOCUS_BORDER); + } + + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + setText(StringUtils.EMPTY); + setToolTipText(null); + setBorder(DEFAULT_NO_FOCUS_BORDER); + setBackground(null); + setForeground(null); + setIcon(null); + setAlignmentX(JComponent.LEFT_ALIGNMENT); + + if (column == 2) { + setIcon(editIcon); + setAlignmentX(JComponent.CENTER_ALIGNMENT); + return this; + } + + if (value == null) { + return this; + } + + if (StringUtils.isNotEmpty(value.toString())) { + setValue(value); + } + setForeground(Color.black); + + if (column == 1) { + if (!table.isCellEditable(row, column)) { + setForeground(PLACEHOLDER_COLOR); + setBackground(NO_EDITABLE_BG); + setToolTipText(Toolkit.i18nText("Fine-Design_Share_Not_Support_Rename")); + } + if (StringUtils.isEmpty(value.toString())) { + setValue(Toolkit.i18nText("Fine-Design_Share_Need_Rename")); + setForeground(PLACEHOLDER_COLOR); + } + } + + if (table.getSelectedRow() == row && table.getSelectedColumn() == column && table.isCellEditable(row, column) ) { + setBorder(SELECTED_BORDER); + setBackground(null); + table.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); + } else { + if (isSelected) { + setBackground(table.getSelectionBackground()); + } + table.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + + return this; + } + + + public void setValue(Object value) { + super.setValue(value); + setToolTipText((value == null) ? null : value.toString()); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigTableModel.java b/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigTableModel.java new file mode 100644 index 000000000..b9b3f15d2 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ConfigTableModel.java @@ -0,0 +1,69 @@ +package com.fr.design.share.ui.config.table; + +import com.fr.design.share.effect.EffectItem; +import com.fr.design.share.effect.ListenerEffectItem; + +import javax.swing.table.AbstractTableModel; +import java.util.List; + +public class ConfigTableModel extends AbstractTableModel { + private Object[] columnNames; + private List effectItems; + + public ConfigTableModel(List effectItems, Object[] columnNames) { + this.effectItems = effectItems; + this.columnNames = columnNames; + } + @Override + public int getRowCount() { + return this.effectItems.size(); + } + + @Override + public int getColumnCount() { + return this.columnNames.length; + } + + @Override + public String getColumnName(int columnIndex) { + if (columnNames == null) { + return null; + } + return columnNames[columnIndex].toString(); + } + + @Override + public Class getColumnClass(int columnIndex) { + return ConfigTableModel.class; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return columnIndex == 1; + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + if (rowIndex >= getRowCount() || columnIndex >= getColumnCount()) { + return null; + } + EffectItem effectItem = effectItems.get(rowIndex); + if (columnIndex == 0) { + return effectItem.getConfigPath(); + } else if (columnIndex == 1) { + return effectItem.getName(); + } + return null; + } + + @Override + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + if (rowIndex >= effectItems.size() || columnIndex >= getColumnCount()) { + return; + } + EffectItem effectItem = effectItems.get(rowIndex); + if (columnIndex == 1) { + effectItem.setName(aValue.toString()); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ExpandEffectTable.java b/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ExpandEffectTable.java new file mode 100644 index 000000000..1479d8437 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/config/table/ExpandEffectTable.java @@ -0,0 +1,163 @@ +package com.fr.design.share.ui.config.table; + +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.VerticalFlowLayout; +import com.fr.design.share.effect.EffectItem; +import com.fr.design.share.ui.effect.EffectControlUpdatePane; +import com.fr.design.share.ui.effect.EffectPopupEditDialog; +import com.fr.design.share.ui.table.EffectItemEditor; +import com.fr.design.share.utils.ShareDialogUtils; +import com.fr.general.IOUtils; +import com.fr.locale.InterProviderFactory; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.JPanel; +import javax.swing.JTable; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +import java.util.List; + +public class ExpandEffectTable extends JPanel { + private static final Icon downIcon = IOUtils.readIcon("com/fr/base/images/share/arrow_down.png"); + private static final Icon rightIcon = IOUtils.readIcon("com/fr/base/images/share/arrow_left.png"); + private static final int WIDTH = 460; + private List effectItems; + private String title; + private boolean expand; + private UILabel arrow; + private JPanel contentPane; + private EffectPopupEditDialog effectPopupEditDialog; + private EffectControlUpdatePane effectControlUpdatePane; + private JTable table; + + public ExpandEffectTable(List effectItems, String title) { + this.effectItems = effectItems; + this.title = title; + + initComponent(); + } + + private void initComponent() { + VerticalFlowLayout layout = new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 4); + this.setLayout(layout); + this.expand = true; + + JPanel headerPane = createHeader(); + contentPane = createContent(); + + this.add(headerPane); + this.add(contentPane); + + this.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + setExpand(!expand); + } + }); + } + + private JPanel createHeader() { + JPanel headerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + headerPane.setPreferredSize(new Dimension(WIDTH, 24)); + headerPane.setBackground(new Color(232,232,232)); + UILabel headerTitle = new UILabel(this.title); + headerTitle.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + + arrow = new UILabel(downIcon); + arrow.setOpaque(false); + arrow.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); + + headerPane.add(headerTitle, BorderLayout.WEST); + headerPane.add(arrow, BorderLayout.EAST); + return headerPane; + } + + + private JPanel createContent() { + JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + // 效果列表 + Object[] columnNames = { + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_From"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Rename"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Edit") + }; + ConfigTableModel tableModel = new ConfigTableModel(effectItems, columnNames); + table = new JTable(tableModel); + + table.setRowHeight(24); + table.getColumnModel().getColumn(0).setPreferredWidth(180); + table.getColumnModel().getColumn(1).setPreferredWidth(252); + table.getColumnModel().getColumn(2).setPreferredWidth(33); + + table.setDefaultEditor(ConfigTableModel.class, new EffectItemEditor(table)); + table.setDefaultRenderer(ConfigTableModel.class, new ConfigItemRender()); + table.getTableHeader().setResizingAllowed(false); + table.getTableHeader().setReorderingAllowed(false); + table.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + int selectColumn = table.getSelectedColumn(); + if (selectColumn == 2) { + int selectRow = table.getSelectedRow(); + EffectItem selectEffectItem = effectItems.get(selectRow); + + effectControlUpdatePane = EffectControlUpdatePane.newInstance(selectEffectItem); + effectControlUpdatePane.populate(); + effectPopupEditDialog = EffectPopupEditDialog.newInstance(ShareDialogUtils.getInstance().getConfigDialog(), effectControlUpdatePane); + effectPopupEditDialog.setTitle(selectEffectItem.getName()); + Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); + effectPopupEditDialog.setLocation((d.width - effectPopupEditDialog.getSize().width) / 2, (d.height - effectPopupEditDialog.getSize().height) / 2); + effectPopupEditDialog.setVisible(true); + effectPopupEditDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + effectControlUpdatePane.update(); + } + }); + } + } + public void mouseExited(MouseEvent e) { + int row = table.rowAtPoint(e.getPoint()); + int col = table.columnAtPoint(e.getPoint()); + if ((e.getPoint().getY() < 0) || row < 0 || col < 0) { + table.clearSelection(); + } + } + }); + table.addMouseMotionListener(new MouseMotionAdapter() { + @Override + public void mouseMoved(MouseEvent e) { + int row = table.rowAtPoint(e.getPoint()); + int col = table.columnAtPoint(e.getPoint()); + table.setRowSelectionInterval(row, row); + table.setColumnSelectionInterval(col, col); + } + }); + content.add(table.getTableHeader(), BorderLayout.NORTH); + content.add(table,BorderLayout.CENTER); + return content; + } + + public void setExpand(boolean isExpand) { + this.expand = isExpand; + arrow.setIcon(isExpand ? downIcon : rightIcon); + contentPane.setVisible(isExpand); + } + + public JTable getTable() { + return table; + } + + public boolean isExpand() { + return expand; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/effect/EffectControlUpdatePane.java b/designer-realize/src/main/java/com/fr/design/share/ui/effect/EffectControlUpdatePane.java new file mode 100644 index 000000000..46a9de7fb --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/effect/EffectControlUpdatePane.java @@ -0,0 +1,85 @@ +package com.fr.design.share.ui.effect; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.data.tabledata.tabledatapane.GlobalMultiTDTableDataPane; +import com.fr.design.data.tabledata.tabledatapane.GlobalTreeTableDataPane; +import com.fr.design.data.tabledata.tabledatapane.MultiTDTableDataPane; +import com.fr.design.data.tabledata.tabledatapane.TreeTableDataPane; +import com.fr.design.env.DesignerWorkspaceInfo; +import com.fr.design.env.RemoteDesignerWorkspaceInfo; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.share.effect.EffectItem; +import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; + +import javax.swing.JPanel; +import java.awt.BorderLayout; + +public class EffectControlUpdatePane extends JPanel { + private EffectItem effectItem; + private BasicBeanPane updatePane; + + private EffectControlUpdatePane(EffectItem effectItem) { + this.effectItem = effectItem; + initUpdatePane(); + } + + public static EffectControlUpdatePane newInstance(EffectItem effectItem) { + return new EffectControlUpdatePane(effectItem); + } + + private void initUpdatePane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + NameableCreator creator = effectItem.creator(); + if (creator == null) { + return; + } else { + if (isMulti(creator.getUpdatePane()) || isTree(creator.getUpdatePane())) { + updatePane = effectItem.createPaneByCreators(creator, effectItem.getName()); + } else { + updatePane = effectItem.createPaneByCreators(creator); + } + this.add(updatePane, BorderLayout.CENTER); + } + } + + public void populate() { + try{ + updatePane.populateBean(effectItem.getPopulateBean()); + }catch (Exception e){ + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + + + public boolean isMulti(Class _class) { + return ComparatorUtils.equals(_class, GlobalMultiTDTableDataPane.class) || ComparatorUtils.equals(_class, MultiTDTableDataPane.class); + } + + public boolean isTree(Class _class) { + return ComparatorUtils.equals(_class, GlobalTreeTableDataPane.class) || ComparatorUtils.equals(_class, TreeTableDataPane.class); + } + + public void update() { + BasicBeanPane pane = updatePane; + if (pane != null && pane.isVisible()) { + Object bean = pane.updateBean(); + try { + if (bean instanceof RemoteDesignerWorkspaceInfo) { + DesignerWorkspaceInfo info = DesignerEnvManager.getEnvManager().getWorkspaceInfo(effectItem.getName()); + String remindTime = info.getRemindTime(); + ((RemoteDesignerWorkspaceInfo) bean).setRemindTime(remindTime); + } + }catch (Exception e){ + FineLoggerFactory.getLogger().info("remindTime is not exist"); + } + effectItem.updateBean(bean); + } + } + + public void checkValid() throws Exception { + updatePane.checkValid(); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/effect/EffectPopupEditDialog.java b/designer-realize/src/main/java/com/fr/design/share/ui/effect/EffectPopupEditDialog.java new file mode 100644 index 000000000..9abd9ba61 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/effect/EffectPopupEditDialog.java @@ -0,0 +1,206 @@ +package com.fr.design.share.ui.effect; + +import com.fr.design.constants.UIConstants; +import com.fr.design.dialog.UIDialog; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JDialog; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.GraphicsEnvironment; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; + +public class EffectPopupEditDialog extends UIDialog { + private JComponent editPane; + private PopupToolPane popupToolPane; + private UIButton okButton; + private static final int WIDTH = 570; + private static final int HEIGHT = 510; + + public EffectPopupEditDialog(Dialog parent, JComponent pane) { + super(parent); + setUndecorated(true); + pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10)); + + this.editPane = pane; + JPanel editPaneWrapper = new JPanel(new BorderLayout()); + popupToolPane = new PopupToolPane(this); + editPaneWrapper.add(popupToolPane, BorderLayout.NORTH); + editPaneWrapper.add(editPane, BorderLayout.CENTER); + editPaneWrapper.setBorder(BorderFactory.createLineBorder(UIConstants.POP_DIALOG_BORDER, 1)); + editPaneWrapper.add(this.createControlButtonPane(), BorderLayout.SOUTH); + this.getContentPane().add(editPaneWrapper, BorderLayout.CENTER); + + setSize(WIDTH, HEIGHT); +// pack(); + this.setVisible(false); + } + + public static EffectPopupEditDialog newInstance(Dialog parent, JComponent pane) { + return new EffectPopupEditDialog(parent, pane); + } + + + @Override + public void setTitle(String title) { + popupToolPane.setTitle(title); + } + + + @Override + public void checkValid() throws Exception { + + } + + // 移动弹出编辑面板的工具条 + private class PopupToolPane extends JPanel { + private JDialog parentDialog; // 如果不在对话框中,值为null + private Color originColor; // 初始背景 + private JPanel contentPane; + private UILabel titleLabel; + private Point mouseDownCompCoords; // 存储按下左键的位置,移动对话框时会用到 + + private static final int MIN_X = -150; + private static final int MAX_X_SHIFT = 50; + private static final int MAX_Y_SHIFT = 50; + + private MouseListener mouseListener = new MouseAdapter() { + @Override + public void mouseExited(MouseEvent e) { + setCursor(Cursor.getDefaultCursor()); + if (mouseDownCompCoords == null) { + contentPane.setBackground(originColor); + } + repaint(); + } + + @Override + public void mouseReleased(MouseEvent e) { + mouseDownCompCoords = null; + if (!getBounds().contains(e.getPoint())) { + contentPane.setBackground(originColor); + } + } + + @Override + public void mousePressed(MouseEvent e) { + mouseDownCompCoords = e.getPoint(); + } + }; + + private MouseMotionListener mouseMotionListener = new MouseMotionListener() { + @Override + public void mouseMoved(MouseEvent e) { + setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); + contentPane.setBackground(UIConstants.POPUP_TITLE_BACKGROUND); + repaint(); + } + + @Override + public void mouseDragged(MouseEvent e) { + if (mouseDownCompCoords != null) { + Point currCoords = e.getLocationOnScreen(); + int x = currCoords.x - mouseDownCompCoords.x; + int y = currCoords.y - mouseDownCompCoords.y; + //屏幕可用区域 + Rectangle screen = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds(); + + int minY = screen.y; + int maxX = Toolkit.getDefaultToolkit().getScreenSize().width - MAX_X_SHIFT; + int maxY = Toolkit.getDefaultToolkit().getScreenSize().height - MAX_Y_SHIFT; + if (x < MIN_X) { + x = MIN_X; + } else if (x > maxX) { + x = maxX; + } + if (y < minY) { + y = minY; + } else if (y > maxY) { + y = maxY; + } + // 移动到屏幕边缘时,需要校正位置 + parentDialog.setLocation(x, y); + } + } + }; + + PopupToolPane(JDialog parentDialog) { + this(StringUtils.EMPTY, parentDialog); + } + + PopupToolPane(String title, JDialog parentDialog) { + super(); + this.parentDialog = parentDialog; + originColor = UIConstants.DIALOG_TITLEBAR_BACKGROUND; + + contentPane = new JPanel(); + contentPane.setBackground(originColor); + contentPane.setLayout(new BorderLayout()); + titleLabel = new UILabel(title); + Font font = new Font("SimSun", Font.PLAIN, 12); + titleLabel.setFont(font); + contentPane.add(titleLabel, BorderLayout.WEST); + contentPane.setBorder(new EmptyBorder(5, 14, 6, 0)); + + setLayout(new BorderLayout()); + add(contentPane, BorderLayout.CENTER); + setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); + + addMouseListener(mouseListener); + addMouseMotionListener(mouseMotionListener); + } + + public void setTitle(String title) { + titleLabel.setText(title); + } + + @Override + public Dimension getPreferredSize() { + return new Dimension(super.getPreferredSize().width, 28); + } + } + + private JPanel createControlButtonPane() { + JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 10, 5)); + controlPane.add(buttonsPane, BorderLayout.EAST); + + //确定 + addOkButton(buttonsPane); + + return controlPane; + } + + private void addOkButton(JPanel buttonsPane) { + okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); + okButton.setName(OK_BUTTON); + okButton.setMnemonic('O'); + buttonsPane.add(okButton); + okButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + doOK(); + } + }); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/effect/PreviewPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/effect/PreviewPane.java new file mode 100644 index 000000000..68cd025e3 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/effect/PreviewPane.java @@ -0,0 +1,356 @@ +package com.fr.design.share.ui.effect; + +import com.fr.base.BaseUtils; +import com.fr.base.DynamicUnitList; +import com.fr.base.ScreenResolution; +import com.fr.base.chart.BaseChartCollection; +import com.fr.base.chart.chartdata.CallbackEvent; +import com.fr.common.inputevent.InputEventBaseOnOS; +import com.fr.design.cell.bar.DynamicScrollBar; +import com.fr.design.designer.creator.XCreator; +import com.fr.design.file.HistoryTemplateListCache; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.FormSelection; +import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.form.FormElementCaseDesigner; +import com.fr.design.mainframe.share.ui.base.ChartIcon; +import com.fr.design.utils.DesignUtils; +import com.fr.form.main.Form; +import com.fr.form.ui.ChartEditor; +import com.fr.form.ui.ElementCaseEditor; +import com.fr.form.ui.Widget; +import com.fr.general.IOUtils; +import com.fr.grid.Grid; +import com.fr.grid.GridUtils; +import com.fr.grid.selection.CellSelection; +import com.fr.report.ReportHelper; +import com.fr.report.worksheet.FormElementCase; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JPanel; +import javax.swing.JScrollBar; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Image; +import java.awt.Point; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import java.awt.image.BufferedImage; + +public class PreviewPane extends JPanel implements CallbackEvent{ + public static final Cursor SCALE_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor( + IOUtils.readImage("com/fr/base/images/share/scale.png"), + new Point(16, 16), "ScaleCursor"); + private static final Icon PLUS_ICON = BaseUtils.readIcon("com/fr/base/images/share/add.png"); + private static final Icon PLUS_CLICK_ICON = BaseUtils.readIcon("com/fr/base/images/share/add_click.png"); + private static final Icon PLUS_HOVER_ICON = BaseUtils.readIcon("com/fr/base/images/share/add_hover.png"); + private static final Icon PLUS_DISABLED_ICON = BaseUtils.readIcon("com/fr/base/images/share/add_disabled.png"); + private static final Icon MINUS_CLICK_ICON = BaseUtils.readIcon("com/fr/base/images/share/minus_click.png"); + private static final Icon MINUS_HOVER_ICON = BaseUtils.readIcon("com/fr/base/images/share/minus_hover.png"); + private static final Icon MINUS_ICON = BaseUtils.readIcon("com/fr/base/images/share/minus.png"); + private static final Icon MINUS_DISABLED_ICON = BaseUtils.readIcon("com/fr/base/images/share/minus_disabled.png"); + private static final Dimension BUTTON_SIZE = new Dimension(20, 20); + private static final Dimension PREVIEW_SIZE = new Dimension(373, 310); + private static final int MAX = 400; + private static final int HUND = 100; + private static final int MIN = 10; + private static final int DIR = 10; + private static final double MIN_TIME = 0.4; + + private Widget widget; + private UIButton plusButton; + private UIButton minusButton; + private JPanel preview; + private int scaleValue = 100; + private ElementCasePane elementCasePane; + private Image previewImage; + private int resolution; + private Dimension previewSize; + private boolean enabled; + + public PreviewPane(Widget widget) { + this(widget, PREVIEW_SIZE, true); + } + + public PreviewPane(Widget widget, Dimension previewSize, boolean enabled) { + this.widget = widget; + + this.enabled = enabled; + this.previewSize = previewSize; + this.resolution = ScreenResolution.getScreenResolution(); + initComponent(); + } + + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + + if (enabled) { + this.add(createTopToolbarPane(), BorderLayout.NORTH); + } else { + this.add(createRightToolbarPane(), BorderLayout.EAST); + } + this.add(createViewPane(), BorderLayout.CENTER); + + } + + private JPanel createTopToolbarPane() { + JPanel toolbarPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); + FlowLayout layout = new FlowLayout(FlowLayout.RIGHT, 10 ,0); + toolbarPane.setLayout(layout); + toolbarPane.setPreferredSize(new Dimension(previewSize.width, 22)); + addScaleButton(toolbarPane); + return toolbarPane; + } + + private JPanel createRightToolbarPane() { + JPanel toolbarPane = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); + FlowLayout layout = new FlowLayout(FlowLayout.LEFT, 10 ,0); + toolbarPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 0, 0)); + toolbarPane.setLayout(layout); + addScaleButton(toolbarPane); + return toolbarPane; + } + + private void addScaleButton(JPanel toolbarPane) { + if (isElementCaseEditor()) { + plusButton = new UIButton(PLUS_ICON); + plusButton.setDisabledIcon(PLUS_DISABLED_ICON); + plusButton.setPressedIcon(PLUS_CLICK_ICON); + plusButton.setRolloverIcon(PLUS_HOVER_ICON); + plusButton.setPreferredSize(BUTTON_SIZE); + plusButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + addScale(10); + } + }); + + minusButton = new UIButton(MINUS_ICON); + minusButton.setDisabledIcon(MINUS_DISABLED_ICON); + minusButton.setPressedIcon(MINUS_CLICK_ICON); + minusButton.setRolloverIcon(MINUS_HOVER_ICON); + minusButton.setPreferredSize(BUTTON_SIZE); + minusButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + addScale(-10); + } + }); + + toolbarPane.add(minusButton); + toolbarPane.add(plusButton); + } + } + + private JPanel createViewPane() { + preview = FRGUIPaneFactory.createBorderLayout_S_Pane(); + preview.setBorder(BorderFactory.createEmptyBorder(5, 0 , 0 , 0)); + preview.setPreferredSize(this.previewSize); + preview.setSize(previewSize); + + if (isElementCaseEditor()) { + elementCasePreview(); + } else if (isChartEditor()) { + chartPreview(); + } else { + widgetPreview(); + } + + return preview; + } + + private void elementCasePreview() { + ElementCaseEditor editor = (ElementCaseEditor) widget; + FormElementCase elementCase = (FormElementCase) editor.getElementCase(); + FormElementCaseDesigner designer = new FormElementCaseDesigner(elementCase, new Form()); + designer.setForeground(Color.BLACK); + designer.setBackground(new Color(245, 245, 247)); + designer.setFont(DesignUtils.getDefaultGUIFont().applySize(12)); + elementCasePane = designer.getEditingElementCasePane(); + + elementCasePane.setPreferredSize(new Dimension(previewSize.width, getInnerPreviewSize().height)); + elementCasePane.setSelection(new CellSelection(0, 0, 0, 0)); + + Grid grid = elementCasePane.getGrid(); + grid.setEditable(false); + grid.removeMouseWheelListener(grid.getGridMouseAdapter()); + grid.removeMouseMotionListener(grid.getGridMouseAdapter()); + grid.removeMouseListener(grid.getGridMouseAdapter()); + + grid.addMouseWheelListener(new MouseWheelListener() { + @Override + public void mouseWheelMoved(MouseWheelEvent e) { + if (!InputEventBaseOnOS.isControlDown(e)) { + ElementCasePane reportPane = grid.getElementCasePane(); + if (reportPane.isVerticalScrollBarVisible()) { + JScrollBar scrollBar = reportPane.getVerticalScrollBar(); + int maxValue = scrollBar.getModel().getMaximum(); + int newValue = reportPane.getVerticalScrollBar().getValue() + e.getWheelRotation(); + int extendValue = GridUtils.getExtentValue(newValue, elementCase.getRowHeightList_DEC(), grid.getHeight(), getResolution()); + if (extendValue <= maxValue) { + reportPane.getVerticalScrollBar().setValue(newValue); + } + } + } else { + int dir = e.getWheelRotation(); + addScale( - dir * DIR); + grid.setCursor(SCALE_CURSOR); + } + } + }); + + grid.addMouseMotionListener(new MouseMotionAdapter() { + @Override + public void mouseMoved(MouseEvent e) { + grid.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + }); + + elementCasePane.getGridColumn().setEnabled(false); + elementCasePane.getGridRow().setEnabled(false); + + preview.add(designer, BorderLayout.CENTER); + preview.add(elementCasePane.getHorizontalScrollBar(), BorderLayout.SOUTH); + } + + private Dimension getInnerPreviewSize() { + if (isElementCaseEditor()) { + int width = previewSize.width - (enabled ? elementCasePane.getVerticalScrollBar().getPreferredSize().width : 0); + int height = previewSize.height - (enabled ? elementCasePane.getHorizontalScrollBar().getPreferredSize().height : 0); + return new Dimension(width, height); + } + return previewSize; + } + + private void chartPreview() { + ChartEditor editor = (ChartEditor) widget; + BaseChartCollection chartCollection = editor.getChartCollection(); + ChartIcon chartIcon = new ChartIcon(chartCollection, previewSize.width, previewSize.height); + chartIcon.registerCallBackEvent(PreviewPane.this); + UILabel label = new UILabel(chartIcon); + preview.add(label, BorderLayout.CENTER); + } + + private void widgetPreview(){ + JPanel widgetView = new JPanel(FRGUIPaneFactory.createBorderLayout()); + widgetView.setPreferredSize(previewSize); + widgetView.setBackground(Color.WHITE); + + XCreator xCreator = getWidgetXCreator(); + if (xCreator != null) { + previewImage = new BufferedImage(xCreator.getWidth(), xCreator.getHeight(), BufferedImage.TYPE_INT_RGB); + xCreator.paint(previewImage.getGraphics()); + Icon icon = new ImageIcon(previewImage); + UILabel label = new UILabel(icon); + label.setAlignmentY(SwingConstants.CENTER); + widgetView.add(label, BorderLayout.CENTER); + } + + preview.add(widgetView, BorderLayout.CENTER); + } + + private XCreator getWidgetXCreator() { + JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + FormSelection selection = ((JForm) jt).getFormDesign().getSelectionModel().getSelection(); + XCreator[] xCreators = selection.getSelectedCreators(); + return getWidgetXCreator(xCreators, widget); + } + private XCreator getWidgetXCreator(Component[] components, Widget widget) { + for (Component component : components) { + if (component instanceof XCreator) { + XCreator xCreator = (XCreator) component; + if (xCreator.toData().getWidgetName() == widget.getWidgetName()) { + return xCreator; + } + XCreator subXCreator = getWidgetXCreator(xCreator.getComponents(), widget); + if (subXCreator != null) { + return subXCreator; + } + } + } + return null; + } + + @Override + public void callback() { + this.repaint(); + } + + private void setScale(int resolution) { + //网格线 + if (resolution < ScreenResolution.getScreenResolution() * MIN_TIME) { + elementCasePane.getGrid().setShowGridLine(false); + } else { + elementCasePane.getGrid().setShowGridLine(true); + } + elementCasePane.setResolution(resolution); + elementCasePane.getGrid().getGridMouseAdapter().setResolution(resolution); + elementCasePane.getGrid().setResolution(resolution); + //更新Grid + Grid grid = elementCasePane.getGrid(); + DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(elementCasePane.getEditingElementCase()); + DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(elementCasePane.getEditingElementCase()); + grid.setVerticalExtent(GridUtils.getExtentValue(0, rowHeightList, grid.getHeight(), resolution)); + grid.setHorizontalExtent(GridUtils.getExtentValue(0, columnWidthList, grid.getWidth(), resolution)); + elementCasePane.getGrid().updateUI(); + //更新Column和Row + ((DynamicScrollBar) elementCasePane.getVerticalScrollBar()).setDpi(resolution); + ((DynamicScrollBar) elementCasePane.getHorizontalScrollBar()).setDpi(resolution); + elementCasePane.getGridColumn().setResolution(resolution); + elementCasePane.getGridColumn().updateUI(); + elementCasePane.getGridRow().setResolution(resolution); + elementCasePane.getGridRow().updateUI(); + elementCasePane.repaint(); + } + + private void addScale(int step) { + scaleValue += step; + scaleValue = fixedScale(scaleValue); + plusButton.setEnabled(scaleValue < MAX); + minusButton.setEnabled(scaleValue > MIN); + setScale(getResolution()); + } + + private int fixedScale(int value) { + if (value < MIN) { + value = MIN; + } + if (value > MAX) { + value = MAX; + } + return value; + } + + private int getResolution() { + return (int) (resolution * scaleValue / HUND); + } + + public boolean isElementCaseEditor() { + return widget instanceof ElementCaseEditor; + } + + public boolean isChartEditor() { + return widget instanceof ChartEditor; + } + + public ElementCasePane getElementCasePane() { + return elementCasePane; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/CoverUploadPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/CoverUploadPane.java new file mode 100644 index 000000000..01d0c06a0 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/CoverUploadPane.java @@ -0,0 +1,59 @@ +package com.fr.design.share.ui.generate; + +import com.fr.base.background.ImageBackground; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.ui.base.ImageBackgroundPane; +import com.fr.log.FineLoggerFactory; + +import javax.swing.BorderFactory; +import javax.swing.border.Border; +import javax.swing.border.MatteBorder; +import javax.swing.plaf.ColorUIResource; +import java.awt.BorderLayout; +import java.awt.Image; + +/** + * 上传封面的面板 + * Coder: zack + * Date: 2016/10/11 + * Time: 21:36 + */ +public class CoverUploadPane extends BasicBeanPane { + private static final ColorUIResource BORDER_COLOR = new ColorUIResource(168, 172, 180); + private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); + private ImageBackgroundPane backgroundPane; + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Share_Select_Upload_Cover"); + } + + public CoverUploadPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + backgroundPane = new ImageBackgroundPane(); + backgroundPane.setBorder(new MatteBorder(1, 1, 1, 1, BORDER_COLOR)); + this.add(backgroundPane, BorderLayout.CENTER); + this.setBorder(DIALOG_BORDER); + } + + @Override + public void populateBean(Image ob) { + if (ob != null) { + backgroundPane.populate(new ImageBackground(ob)); + } + } + + @Override + public Image updateBean() { + ImageBackground imageBackground = new ImageBackground(); + try { + imageBackground = (ImageBackground) backgroundPane.update(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + //返回原图 + return imageBackground.getImage(); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java new file mode 100644 index 000000000..0eeda7731 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectContent.java @@ -0,0 +1,170 @@ +package com.fr.design.share.ui.generate; + +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.share.effect.EffectItem; +import com.fr.design.share.effect.EffectItemGroup; +import com.fr.design.share.ui.effect.PreviewPane; +import com.fr.design.share.ui.effect.EffectControlUpdatePane; +import com.fr.design.share.ui.effect.EffectPopupEditDialog; +import com.fr.design.share.ui.generate.table.EffectItemRender; +import com.fr.design.share.ui.generate.table.EffectTableModel; +import com.fr.design.share.ui.table.EffectItemEditor; +import com.fr.design.share.utils.ShareDialogUtils; +import com.fr.form.ui.Widget; +import com.fr.locale.InterProviderFactory; + +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTree; +import javax.swing.event.TreeSelectionListener; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Toolkit; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; +import java.util.List; + +public class EffectContent extends JPanel { + static final private Dimension PREVIEW_SIZE = new Dimension(340, 120); + + private EffectItemGroup effectItemGroup; + private EffectPopupEditDialog effectPopupEditDialog; + private EffectControlUpdatePane effectControlUpdatePane; + + public EffectContent(EffectItemGroup effectItemGroup) { + this.effectItemGroup = effectItemGroup; + this.init(); + } + + private void init() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + + if (getEffectItems().size() > 0) { + // 预览图 + JPanel imageContainer = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); + PreviewPane previewPane = new PreviewPane(getWidget(), PREVIEW_SIZE, false); + imageContainer.add(previewPane); + this.add(imageContainer, BorderLayout.NORTH); + + // 效果列表 + Object[] columnNames = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_From"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Rename")}; + JTable table = new JTable(new EffectTableModel(effectItemGroup, columnNames)); + table.setRowHeight(25); + table.getColumnModel().getColumn(0).setPreferredWidth(230); + table.getColumnModel().getColumn(1).setPreferredWidth(320); + + + table.setDefaultEditor(EffectTableModel.class, new EffectItemEditor(table)); + table.setDefaultRenderer(EffectTableModel.class, new EffectItemRender()); + table.getTableHeader().setResizingAllowed(false); + table.getTableHeader().setReorderingAllowed(false); + table.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + int selectColumn = table.getSelectedColumn(); + if (selectColumn == 0) { + int selectRow = table.getSelectedRow(); + EffectItem selectEffectItem = getEffectItems().get(selectRow); + effectControlUpdatePane = EffectControlUpdatePane.newInstance(selectEffectItem); + effectControlUpdatePane.populate(); + setPaneDisabled(effectControlUpdatePane); + effectPopupEditDialog = EffectPopupEditDialog.newInstance(ShareDialogUtils.getInstance().getShareDialog(), effectControlUpdatePane); + effectPopupEditDialog.setTitle(selectEffectItem.getName()); + Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); + effectPopupEditDialog.setLocation((d.width - effectPopupEditDialog.getSize().width) / 2, (d.height - effectPopupEditDialog.getSize().height) / 2); + effectPopupEditDialog.setVisible(true); + } + } + public void mouseExited(MouseEvent e) { + int tableContentHeight = table.getParent().getHeight() - table.getTableHeader().getHeight(); + if ((e.getPoint().getY() < 0) || (e.getPoint().getY() > tableContentHeight)) { + table.clearSelection(); + } + int row = table.rowAtPoint(e.getPoint()); + int col = table.columnAtPoint(e.getPoint()); + if (row < 0 || col < 0) { + table.clearSelection(); + } + } + }); + table.addMouseMotionListener(new MouseMotionAdapter() { + @Override + public void mouseMoved(MouseEvent e) { + int row = table.rowAtPoint(e.getPoint()); + int col = table.columnAtPoint(e.getPoint()); + table.setRowSelectionInterval(row, row); + table.setColumnSelectionInterval(col, col); + } + }); + +// if (previewPane.isElementCaseEditor()) { +// table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { +// @Override +// public void valueChanged(ListSelectionEvent e) { +// if (table.getSelectedRow() >= 0) { +// EffectItem effectItem= getEffectItems().get(table.getSelectedRow()); +// SourceNode cellSourceNode = SourceNodeUtils.getCellSourceNode(effectItem.getSourceNode()); +// if (cellSourceNode != null) { +// DefaultTemplateCellElement cellElement = (DefaultTemplateCellElement) cellSourceNode.getTarget(); +// previewPane.getElementCasePane().setSelection(new CellSelection(cellElement.getColumn(), cellElement.getRow(), cellElement.getColumnSpan(), cellElement.getRowSpan())); +// } +// } +// } +// }); +// } + + JPanel tableContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); + tableContainer.setBorder(BorderFactory.createEmptyBorder(10,0,5,0)); + if (getEffectItems().size() > 5) { + UIScrollPane scrollPane = new UIScrollPane(table); + scrollPane.setPreferredSize(new Dimension(550, 160)); + tableContainer.add(scrollPane, BorderLayout.CENTER); + } else { + JPanel tablePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + tablePane.add(table.getTableHeader(), BorderLayout.NORTH); + tablePane.add(table, BorderLayout.CENTER); + tableContainer.add(tablePane, BorderLayout.CENTER); + } + this.add(tableContainer, BorderLayout.CENTER); + + } + } + + private List getEffectItems() { + return effectItemGroup.getEffectItems(); + } + + private Widget getWidget() { + return effectItemGroup.getWidget(); + } + + private void setPaneDisabled(Component component) { + if (component instanceof JScrollPane) { + JScrollPane pane = (JScrollPane) component; + setPaneDisabled(pane.getViewport().getView()); + return; + } + if (component instanceof JTree) { + JTree tree = (JTree) component; + TreeSelectionListener[] treeSelectionListeners = tree.getTreeSelectionListeners(); + for (TreeSelectionListener treeSelectionListener : treeSelectionListeners) { + tree.removeTreeSelectionListener(treeSelectionListener); + } + return; + } + component.setEnabled(false); + if (component instanceof JComponent) { + Component[] components = ((JComponent) component).getComponents(); + for (Component co : components) { + setPaneDisabled(co); + } + } + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectPane.java new file mode 100644 index 000000000..f5ebd5edc --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/EffectPane.java @@ -0,0 +1,147 @@ +package com.fr.design.share.ui.generate; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.share.ui.base.PageableButton; +import com.fr.design.share.effect.EffectItemGroup; +import com.fr.form.ui.Widget; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import javax.swing.plaf.basic.BasicArrowButton; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; + + +public class EffectPane extends JPanel { + private List effectItemGroups; + private JPanel contentPane; + private int selectIndex = 0; + private BasicArrowButton previewButton; + private BasicArrowButton nextButton; + private UILabel nameLabel; + private List contents = new ArrayList<>(); + + + public EffectPane(List effectItemGroups) { + this.effectItemGroups = effectItemGroups; + if (effectItemGroups.size() > 0) { + initComponent(); + } + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + createContentPane(); + + JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + JPanel headerPane = createHeaderPane(); + contentPane = createContentPane(); + addContent(); + rightPane.add(headerPane, BorderLayout.NORTH); + rightPane.add(contentPane, BorderLayout.CENTER); + this.add(rightPane, BorderLayout.CENTER); + } + + private JPanel createHeaderPane() { + JPanel headerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel naviPane = createNaviPane(); + headerPane.add(naviPane, BorderLayout.EAST); + return headerPane; + } + + private JPanel createNaviPane() { + JPanel naviPane = new JPanel(FRGUIPaneFactory.createRightFlowLayout()); + nameLabel = new UILabel(""); + nameLabel.setPreferredSize(new Dimension(nameLabel.getFont().getSize() * 20, 15)); + nameLabel.setHorizontalAlignment(SwingConstants.RIGHT); + + previewButton = new PageableButton(SwingConstants.WEST) { + @Override + public Dimension getPreferredSize() { + return new Dimension(15, 15); + } + }; + previewButton.setEnabled(hasPreview()); + previewButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + selectIndex--; + EffectPane.this.TogglePage(); + } + }); + + nextButton = new PageableButton(SwingConstants.EAST) { + @Override + public Dimension getPreferredSize() { + return new Dimension(15, 15); + } + }; + nextButton.setEnabled(hasNext()); + nextButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + selectIndex++; + EffectPane.this.TogglePage(); + } + }); + + naviPane.add(nameLabel); + naviPane.add(previewButton); + naviPane.add(nextButton); + return naviPane; + } + + private JPanel createContentPane() { + JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + contentPane.setBorder(BorderFactory.createEmptyBorder(10, 0 , 0, 0)); + return contentPane; + } + + private void addContent() { + JPanel content = new EffectContent(getSelectEffectItemGroup()); + contents.add(selectIndex, content); + updateContent(); + } + + private Widget getSelectWidget() { + return getSelectEffectItemGroup().getWidget(); + } + + private EffectItemGroup getSelectEffectItemGroup() { + return effectItemGroups.get(selectIndex); + } + + private boolean hasPreview() { + return selectIndex > 0; + } + + private boolean hasNext() { + return selectIndex < effectItemGroups.size() - 1; + } + + private void TogglePage() { + previewButton.setEnabled(hasPreview()); + nextButton.setEnabled(hasNext()); + if (selectIndex < contents.size()) { + updateContent(); + } else { + addContent(); + } + } + + private void updateContent() { + // 添加contentPane + contentPane.removeAll(); + contentPane.add(contents.get(selectIndex)); + nameLabel.setText(getSelectWidget().getWidgetName()); + nameLabel.setToolTipText(getSelectWidget().getWidgetName()); + this.repaint(); + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/PriceExpectPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/PriceExpectPane.java new file mode 100644 index 000000000..7371c8e53 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/PriceExpectPane.java @@ -0,0 +1,87 @@ +package com.fr.design.share.ui.generate; + +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.stable.StringUtils; + +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import java.awt.Dimension; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by kerry on 2020-06-23 + */ +public class PriceExpectPane extends JPanel { + private static final int TEXT_FILED_WIDTH = 160; + private static final int TEXT_FILED_HEIGHT = 20; + private static final String FREE_PRICE = "0"; + private static final String PRICE_FORMAT = "%.2f"; + private UITextField priceFiled; + private UIRadioButton freeRadio; + private UIRadioButton chargeRadio; + + public PriceExpectPane() { + freeRadio = new UIRadioButton(Toolkit.i18nText("Fine-Design_Share_Price_Free")); + chargeRadio = new UIRadioButton(Toolkit.i18nText("Fine-Design_Share_Price_Charge")); + priceFiled = new UITextField(); + priceFiled.setPlaceholder(Toolkit.i18nText("Fine-Design_Share_Price_Charge_Tip")); + ButtonGroup radioGroup = new ButtonGroup(); + radioGroup.add(freeRadio); + radioGroup.add(chargeRadio); + this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); + this.add(freeRadio); + this.add(chargeRadio); + final JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + panel.add(priceFiled); + this.add(panel); + panel.setPreferredSize(new Dimension(TEXT_FILED_WIDTH, TEXT_FILED_HEIGHT)); + panel.setVisible(false); + this.freeRadio.setSelected(true); + freeRadio.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + panel.setVisible(false); + + } + }); + chargeRadio.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + panel.setVisible(true); + } + }); + } + + public String getPrice() { + if (this.freeRadio.isSelected()) { + return FREE_PRICE; + } + float priceNumber = Float.parseFloat(this.priceFiled.getText()); + return String.format(PRICE_FORMAT, priceNumber); + } + + + public boolean check() { + if (freeRadio.isSelected()) { + return true; + } + String price = this.priceFiled.getText(); + if (StringUtils.isEmpty(price)) { + return false; + } + try { + float priceNumber = Float.parseFloat(price); + if (priceNumber <= 0) { + return false; + } + } catch (NumberFormatException e) { + return false; + } + return true; + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java new file mode 100644 index 000000000..93f07b260 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java @@ -0,0 +1,330 @@ +package com.fr.design.share.ui.generate; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.DesignerFrame; +import com.fr.design.mainframe.JTemplate; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.design.mainframe.share.Bean.ComponentGenerateInfo; +import com.fr.design.mainframe.share.action.ShareUIAspect; +import com.fr.design.mainframe.share.collect.ComponentCollector; +import com.fr.design.mainframe.share.exception.LackOfValueException; +import com.fr.design.mainframe.share.generate.ComponentGeneratorCenter; +import com.fr.design.mainframe.share.select.ComponentTransformerFactory; +import com.fr.design.mod.ContentObjectManager; +import com.fr.form.share.exception.NetWorkFailedException; +import com.fr.form.share.group.DefaultShareGroup; +import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.design.share.effect.EffectItemGroup; +import com.fr.design.share.utils.EffectItemUtils; +import com.fr.design.share.utils.ShareDialogUtils; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.config.ComponentReuseConfigManager; +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; +import com.fr.form.share.record.ShareWidgetInfoManager; +import com.fr.form.ui.Widget; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; + +import java.util.HashSet; +import java.util.Set; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import javax.swing.UIManager; +import javax.swing.border.Border; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Dimension; +import java.awt.Image; +import java.awt.Rectangle; +import java.awt.event.ItemEvent; +import java.util.HashMap; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static javax.swing.JOptionPane.ERROR_MESSAGE; + +/** + * created by Harrison on 2020/04/20 + **/ +public class ShareGeneratePane extends BasicPane { + + private static final Dimension DIALOG_SIZE = new Dimension(670, 760); + private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610); + private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); + + private JPanel mainPane = null; + private ShareMainPane uploadPane = null; + private ShareMainPane simplePane = null; + + private UICheckBox uploadCheckbox = null; + + private BasicDialog dialog; + + private final JTemplate jt; + //报表块控件 + private final Widget shareWidget; + //报表块数据集相关的参数 + private final HashMap paraMap; + + private List effectItemGroups; + + private final ShareUIAspect aspect; + + private final boolean supportUpload = ComponentReuseConfigManager.getInstance().supportUploadReu(); + + public ShareGeneratePane(JTemplate jt, Widget shareWidget, Rectangle rec, Image shareCover, HashMap paraMap, ShareUIAspect aspect) { + this.jt = jt; + this.shareWidget = shareWidget; + effectItemGroups = EffectItemUtils.getEffectItemGroupsByWidget(shareWidget); + this.paraMap = paraMap; + this.aspect = aspect; + + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(DIALOG_BORDER); + this.setPreferredSize(getDialogSize()); + + JPanel guidePane = initGuidePane(shareCover, rec); + this.add(guidePane, BorderLayout.CENTER); + } + + private JPanel initGuidePane(Image shareCover, Rectangle rec) { + + JPanel pane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + this.mainPane = FRGUIPaneFactory.createCardLayout_S_Pane(); + boolean needContentTip = needContentTip(); + this.simplePane = new ShareMainPane(shareCover, rec, false, effectItemGroups, needContentTip); + this.uploadPane = new ShareMainPane(shareCover, rec, true, effectItemGroups, needContentTip); + //暂时换一下,目前不用上传 + this.mainPane.add(simplePane, ShareUIUtils.convertStateChange(ItemEvent.DESELECTED)); + this.mainPane.add(uploadPane, ShareUIUtils.convertStateChange(ItemEvent.SELECTED)); + + simplePane.getNameField().getDocument().addDocumentListener(new DocumentListener() { + + @Override + public void changedUpdate(DocumentEvent e) { + validInput(); + } + + @Override + public void insertUpdate(DocumentEvent e) { + validInput(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + validInput(); + } + }); + + uploadPane.getNameField().getDocument().addDocumentListener(new DocumentListener() { + + @Override + public void changedUpdate(DocumentEvent e) { + validInput(); + } + + @Override + public void insertUpdate(DocumentEvent e) { + validInput(); + } + + @Override + public void removeUpdate(DocumentEvent e) { + validInput(); + } + }); + + //后面创建,因为需要依赖 mainPane 的创建 + JPanel uploadCheckBox = createUploadCheckBox(); + if (supportUpload) { + pane.add(uploadCheckBox, BorderLayout.NORTH); + } + pane.add(mainPane, BorderLayout.CENTER); + return pane; + } + + private void validInput() { + String userInput = getSelectMainPane().getNameField().getText().trim(); + + if (StringUtils.isEmpty(userInput)) { + dialog.setButtonEnabled(false); + } else { + dialog.setButtonEnabled(true); + } + } + + + private boolean needContentTip() { + long start = System.currentTimeMillis(); + XCreator xCreator = ComponentTransformerFactory.getInstance().transform(WidgetPropertyPane.getInstance().getEditingFormDesigner().getSelectionModel().getSelection()).getMiddle(); + Set xCreators = new HashSet<>(); + xCreator.traversalNameRelatedXCreators(xCreators); + Set nameSet = new HashSet<>(); + for (XCreator creator : xCreators) { + nameSet.add(creator.toData().getWidgetName()); + } + boolean result = ContentObjectManager.getInstance().needContentTip(shareWidget, nameSet); + FineLoggerFactory.getLogger().debug("needContentTip spend {} ms", (System.currentTimeMillis() - start)); + return result; + } + + private JPanel createUploadCheckBox() { + + JPanel panel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); + String label = Toolkit.i18nText("Fine-Design_Share_Upload_Meanwhile"); + this.uploadCheckbox = new UICheckBox(label); + uploadCheckbox.addItemListener(e -> { + int stateChange = e.getStateChange(); + CardLayout cl = (CardLayout) (mainPane.getLayout()); + cl.show(mainPane, ShareUIUtils.convertStateChange(stateChange)); + repaint(); + }); + uploadCheckbox.setSelected(false); + + UILabel tipsLabel = ShareUIUtils.createTipsLabel(Toolkit.i18nText("Fine-Design_Share_Upload_Meanwhile_Tips")); + panel.add(uploadCheckbox); + panel.add(tipsLabel); + panel.setPreferredSize(new Dimension(585, 30)); + return panel; + } + + /* show 相关 */ + @Override + public void show() { + final DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); + dialog = this.showWindowWithCustomSize(designerFrame, null, getDialogSize()); + dialog.setButtonEnabled(false); + ShareDialogUtils.getInstance().setShareDialog(dialog); + dialog.addDialogActionListener(new DialogActionAdapter() { + + @Override + public void doOk() { + ShareMainPane mainPane = getSelectMainPane(); + if (doCheck(mainPane)) { + dialog.setVisible(false); + doOk0(mainPane); + } else { + // 抛出,从而防止页面关闭 + throw new LackOfValueException(); + } + } + }); + dialog.setVisible(true); + } + + private ShareMainPane getSelectMainPane() { + + ShareMainPane mainPane; + if (uploadCheckbox.isSelected()) { + mainPane = uploadPane; + } else { + mainPane = simplePane; + } + return mainPane; + } + + private boolean doCheck(ShareMainPane mainPane) { + + return mainPane.check(); + } + + private void doOk0(final ShareMainPane mainPane) { + for(EffectItemGroup effectItemGroup : effectItemGroups) { + effectItemGroup.save(); + } + SwingWorker worker = new SwingWorker() { + @Override + protected Void doInBackground() throws Exception { + DefaultSharableWidget provider = mainPane.generate(); + Group selectGroup = mainPane.getSelectGroup(); + boolean success = false; + try { + success = generateModule(provider); + if (success) { + //先读文件然后移动到指定分组 + Group defaultGroup = DefaultShareGroupManager.getInstance().getGroup(DefaultShareGroup.GROUP_NAME); + if (defaultGroup != null) { + defaultGroup.loadModule(provider.getFileName()); + defaultGroup.moveModule(selectGroup, Stream.of(provider.getId()).collect(Collectors.toList())); + } + collect(provider); + ShareWidgetInfoManager.getInstance().addCompCreateInfo(provider); + } + } catch (NetWorkFailedException exception) { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), ShareUIUtils.formatWidthString(Toolkit.i18nText("Fine-Design_Share_NetWorkError"), 200), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + return null; + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } finally { + //成功失败,都要处理 + aspect.afterOk(); + } + if (!success) { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Share_Module_Failed"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + } + return null; + } + }; + worker.execute(); + } + + private void collect(DefaultSharableWidget provider) { + + ComponentCollector.getInstance().collectGenerateCmpNumber(); + ComponentCollector.getInstance().collectGenerateCmpRecord(provider); + if (uploadCheckbox.isSelected()) { + ComponentCollector.getInstance().collectUploadCmpNumber(); + } + } + + private boolean generateModule(DefaultSharableWidget info) throws Exception { + + DefaultSharableWidget transformInfo = transform(info); + ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, transformInfo); + ComponentGeneratorCenter center = new ComponentGeneratorCenter(generateInfo); + return center.generate(); + } + + private DefaultSharableWidget transform(DefaultSharableWidget info) { + + //先屏蔽 + //if (shareWidget instanceof AbstractBorderStyleWidget) { + // AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) shareWidget; + // ExtendSharableAttrMark attrMark = styleWidget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); + // if (attrMark != null) { + // String shareId = attrMark.getShareId(); + // info.setId(shareId); + // } + //} + return info; + } + + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Share_Module_Msg"); + } + + private Dimension getDialogSize() { + return effectItemGroups.size() > 0 ? DIALOG_SIZE : DIALOG_NORMAL_SIZE; + } + + +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareLoginLabel.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareLoginLabel.java new file mode 100644 index 000000000..47612c850 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareLoginLabel.java @@ -0,0 +1,50 @@ +package com.fr.design.share.ui.generate; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.bbs.UserInfoPane; +import com.fr.stable.StringUtils; + +import javax.swing.JPanel; + +/** + * created by Harrison on 2020/04/20 + **/ +public class ShareLoginLabel extends UILabel { + + private JPanel vendorPane; + + private UILabel unLoginLabel; + + private UILabel loginLabel; + + public ShareLoginLabel(JPanel vendorPane, UILabel unLoginLabel, UILabel loginLabel) { + this.vendorPane = vendorPane; + this.unLoginLabel = unLoginLabel; + this.loginLabel = loginLabel; + setVisible(false); + } + + @Override + public void setText(String text) { + super.setText(text); + if (StringUtils.isNotEmpty(text)) { + tryGetLogin(); + } + } + + private void tryGetLogin() { + + String bbsUsername = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); + if (StringUtils.isNotEmpty(bbsUsername)) { + vendorPane.remove(unLoginLabel); + loginLabel.setText(bbsUsername); + vendorPane.add(loginLabel); + // 像这种 remove , 再 add 的, 需要 validate() + vendorPane.validate(); + vendorPane.repaint(); + //同步刷新页面 + UserInfoPane.getInstance().updateBBSUserInfo(); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java new file mode 100644 index 000000000..a4fc73fbe --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareMainPane.java @@ -0,0 +1,713 @@ +package com.fr.design.share.ui.generate; + +import com.fr.design.DesignerEnvManager; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.extra.LoginWebBridge; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.icombocheckbox.UIComboCheckBox; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.login.DesignerLoginHelper; +import com.fr.design.login.DesignerLoginSource; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.share.constants.ComponentType; +import com.fr.design.mainframe.share.constants.ComponentTypes; +import com.fr.design.mainframe.share.constants.DisplayDevice; +import com.fr.design.mainframe.share.constants.StyleTheme; +import com.fr.design.mainframe.share.ui.base.DictionaryComboCheckBox; +import com.fr.design.mainframe.share.ui.base.LeftWordsTextArea; +import com.fr.design.mainframe.share.ui.base.PlaceholderTextArea; +import com.fr.design.mainframe.share.ui.base.ui.PlaceHolderUI; +import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.design.share.effect.EffectItemGroup; +import com.fr.design.share.utils.ShareDialogUtils; +import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.bean.StyleThemeBean; +import com.fr.form.share.constants.ShareComponentConstants; +import com.fr.form.share.group.DefaultShareGroupManager; +import com.fr.form.share.Group; +import com.fr.plugin.context.PluginContext; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.manage.PluginManager; +import com.fr.stable.ArrayUtils; +import com.fr.stable.ProductConstants; +import com.fr.stable.StringUtils; +import com.fr.stable.collections.combination.Pair; +import com.fr.stable.pinyin.PinyinHelper; +import java.util.HashMap; +import org.jetbrains.annotations.NotNull; + +import javax.swing.BorderFactory; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.UIManager; +import javax.swing.border.MatteBorder; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.PlainDocument; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Dialog; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Image; +import java.awt.ItemSelectable; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.LinkedList; +import java.util.List; +import java.util.UUID; + +import static javax.swing.JOptionPane.ERROR_MESSAGE; + +/** + * created by Harrison on 2020/04/20 + **/ +public class ShareMainPane extends JPanel { + + private static final int COLUMN_ITEM_SIZE = 60; + private static final int COLUMN_FIELD_WIDTH = 555; + private static final int TEXT_FIELD_WIDTH = 160; + private static final int TEXT_FIELD_HEIGHT = 21; + private static final int NAME_MAX_LENGTH = 50; + private static final int GROUP_WIDTH = 160; + private static final int COMBO_WIDTH = 90; + private static final int COMBO_WIDTH_PLUS = 150; + private static final int COMBO_HEIGHT = 20; + private static final int BTN_WIDTH = 70; + private static final int BTN_HEIGHT = 20; + private static final int BASEPANE_VERTICAL_GAP = 2; + + private UIScrollPane mainPane = null; + + private UICheckBox pluginCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Share_Make_Relate_To_Plugin")); + private PriceExpectPane priceExpectPane = null; + + private UIComboBox parentClassify = null; + private UIComboBox childClassify = null; + + private UIComboBox localGroup = null; + + private UILabel loginLabel = ShareUIUtils.createCenterRightUILabel(StringUtils.EMPTY); + + private UICheckBox pc = new UICheckBox(Toolkit.i18nText("Fine-Design_Share_PC_Device")); + private UICheckBox mobile = new UICheckBox(Toolkit.i18nText("Fine-Design_Share_Mobile_Device")); + + private UIComboCheckBox pluginComboCheckBox = null; + + private UIComboBox styleComboBox = null; + + private UITextField nameField = new UITextField(); + + private PlaceholderTextArea content = new LeftWordsTextArea(); + + private PlaceholderTextArea help = new PlaceholderTextArea(); + private UILabel cover; + private UIButton uploadBtn; + //控件的缩略图 + private Image shareCover; + private Rectangle rec; + private boolean upload; + + private List effectItemGroups; + private final boolean needContentTip; + + public ShareMainPane(Image shareCover, Rectangle rec, boolean upload, List effectItemGroups, boolean needContentTip) { + + this.shareCover = shareCover; + this.rec = rec; + this.upload = upload; + this.effectItemGroups = effectItemGroups; + this.needContentTip = needContentTip; + + initCover(shareCover); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder()); + + this.mainPane = createMainPane(upload); + this.add(this.mainPane, BorderLayout.CENTER); + } + + private void initCover(Image shareCover) { + this.cover = new UILabel(getShowIcon(shareCover)); + MatteBorder matteBorder = BorderFactory.createMatteBorder(3, 3, 3, 3, Color.WHITE); + this.cover.setBorder(matteBorder); + this.cover.setHorizontalAlignment(JLabel.CENTER); + } + + private Icon getShowIcon(Image image) { + Image scaleImage = image.getScaledInstance(ShareComponentConstants.SHARE_THUMB_WIDTH, ShareComponentConstants.SHARE_THUMB_HEIGHT, Image.SCALE_SMOOTH); + return new ImageIcon(scaleImage); + } + + + @NotNull + private UIScrollPane createMainPane(boolean upload) { + JPanel mainPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UIScrollPane scrollPane = new UIScrollPane(mainPane); + JPanel overviewPane = createOverviewPane(upload); + JPanel basePane = createBasePane(upload); + mainPane.add(basePane, BorderLayout.NORTH); + mainPane.add(overviewPane, BorderLayout.CENTER); + return scrollPane; + } + + private JPanel createOverviewPane(boolean upload) { + JPanel componentPane = createComponentOverviewPane(upload); + String title = Toolkit.i18nText("Fine-Design_Share_Overview"); + JPanel overviewPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(title); + if (needContentTip) { + UILabel tipsLabel = ShareUIUtils.createTipsLabel(Toolkit.i18nText("Fine-Design_Share_Generate_Content_Tip")); + tipsLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + JPanel panel = new JPanel(FRGUIPaneFactory.createBorderLayout()); + panel.add(tipsLabel); + overviewPane.add(panel, BorderLayout.NORTH); + } + overviewPane.add(componentPane, BorderLayout.CENTER); + + return overviewPane; + + } + + private JPanel createBasePane(boolean upload) { + // 提示 + UILabel tipsLabel = ShareUIUtils.createTipsLabel(Toolkit.i18nText("Fine-Design_Share_Generate_Help_Tips")); + tipsLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + // 组件名称 + UILabel nameLabel = ShareUIUtils.createTopRightUILabel(Toolkit.i18nText("Fine-Design_Share_Name")); + JPanel symbolTextField = createNameFiledPane(); + //显示封面 + UILabel coverLabel = ShareUIUtils.createTopRightUILabel(Toolkit.i18nText("Fine-Design_Share_Show_Cover")); + JPanel coverImagePane = getCoverImagePane(); + //制作者 + UILabel vendorLabel = ShareUIUtils.createCenterRightUILabel(Toolkit.i18nText("Fine-Design_Share_Share_Vendor")); + JPanel vendorPane = createVendorPane(); + //适用终端 + UILabel deviceLabel = ShareUIUtils.createCenterRightUILabel(Toolkit.i18nText("Fine-Design_Share_Device")); + JPanel devicePane = createDevicePane(); + //组件分类 + UILabel classifyLabel = ShareUIUtils.createCenterRightUILabel(Toolkit.i18nText("Fine-Design_Share_Classify")); + JPanel classifyPane = createClassifyPane(); + + //样式风格 + UILabel styleThemeLabel = ShareUIUtils.createCenterRightUILabel(Toolkit.i18nText("Fine-Design_Share_Style_Theme")); + JPanel styleThemePane = createStyleThemePane(); + //本地分组 + UILabel localGroupLabel = ShareUIUtils.createCenterRightUILabel(Toolkit.i18nText("Fine-Design_Share_Local_Group")); + JPanel localGroupPane = createLocalGroupPane(); + //使用插件 + UILabel pluginLabel = ShareUIUtils.createCenterRightUILabel(Toolkit.i18nText("Fine-Design_Share_Use_Plugin")); + JPanel pluginPane = createPluginPane(); + //期望价格 + UILabel priceLabel = ShareUIUtils.createCenterRightUILabel(Toolkit.i18nText("Fine-Design_Share_Expect_Price")); + JPanel pricePane = createPricePane(); + + double p = TableLayout.PREFERRED; + + JPanel innerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel infoPane; + if (upload) { + Component[][] components = new Component[][]{ + new Component[]{nameLabel, symbolTextField}, + new Component[]{coverLabel, coverImagePane}, + new Component[]{vendorLabel, vendorPane}, + new Component[]{deviceLabel, devicePane}, + new Component[]{classifyLabel, classifyPane}, + new Component[]{styleThemeLabel, styleThemePane}, + new Component[]{pluginLabel, pluginPane}, + new Component[]{priceLabel, pricePane}, + }; + double[] rowSize = {p, p, p, p, p, p, p, p}; + double[] columnSize = {COLUMN_ITEM_SIZE, p}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1},{1, 1}, {1, 1}}; + infoPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.HGAP_SMALL, BASEPANE_VERTICAL_GAP); + } else { + Component[][] components = new Component[][]{ + new Component[]{nameLabel, symbolTextField}, + new Component[]{coverLabel, coverImagePane}, + new Component[]{deviceLabel, devicePane}, + new Component[]{classifyLabel, classifyPane}, + new Component[]{localGroupLabel, localGroupPane} + }; + double[] rowSize = {p, p, p, p, p}; + double[] columnSize = {COLUMN_ITEM_SIZE, p}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1},{1, 1}, {1, 1}}; + infoPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.HGAP_SMALL, BASEPANE_VERTICAL_GAP); + } + + String title = Toolkit.i18nText("Fine-Design_Share_Base_Info"); + JPanel overviewPane = FRGUIPaneFactory.createTitledBorderPane(title); + + innerPane.add(tipsLabel, BorderLayout.NORTH); + innerPane.add(infoPane, BorderLayout.CENTER); + overviewPane.add(innerPane, BorderLayout.CENTER); + + return overviewPane; + } + + private JPanel createEffectPane(List effectItemGroups) { + return new EffectPane(effectItemGroups); + } + + private JPanel createPricePane() { + + JPanel pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); + this.priceExpectPane = new PriceExpectPane(); + pane.add(priceExpectPane); + return pane; + } + + private JPanel createStyleThemePane() { + JPanel pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); + PlaceHolderUI placeHolderUI = new PlaceHolderUI( + Toolkit.i18nText("Fine-Design_Share_Style_Theme_Place_Holder")) { + @Override + protected boolean validate(UIComboBox uiComboBox) { + return styleComboBox.getSelectedItem() != null; + } + }; + this.styleComboBox = ShareUIUtils.wrapUI(placeHolderUI, new UIComboBox()); + this.styleComboBox.refreshBoxItems(StyleTheme.getStyleThemeTypeInfo()); + styleComboBox.setPreferredSize(new Dimension(COMBO_WIDTH, COMBO_HEIGHT)); + pane.add(styleComboBox); + return pane; + } + + private JPanel createPluginPane() { + + JPanel pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); + + List contexts = PluginManager.getContexts(new PluginFilter() { + @Override + public boolean accept(PluginContext pluginContext) { + + return pluginContext.isRunning(); + } + }); + String[] displays = new String[contexts.size()]; + String[] values = new String[contexts.size()]; + Pair[] pairs = new Pair[contexts.size()]; + for (int i = 0; i < contexts.size(); i++) { + PluginContext context = contexts.get(i); + String display = context.getName(); + String value = context.getID() + "-" + context.getVersion(); + pairs[i] = new Pair<>(display, value); + } + //按照顺序展示 + //转换一下中文为拼音 + Arrays.sort(pairs, new Comparator>() { + @Override + public int compare(Pair pair1, Pair pair2) { + String o1 = pair1.getFirst(); + String o2 = pair2.getFirst(); + String pinyin1 = PinyinHelper.getShortPinyin(o1); + String pinyin2 = PinyinHelper.getShortPinyin(o2); + return pinyin1.compareToIgnoreCase(pinyin2); + } + }); + for (int i = 0; i < pairs.length; i++) { + displays[i] = pairs[i].getFirst(); + values[i] = pairs[i].getSecond(); + } + this.pluginComboCheckBox = new DictionaryComboCheckBox(values, displays, "Fine-Design_Share_Select_Plugin"); + + pluginComboCheckBox.setPopupMaxDisplayNumber(10); + pluginComboCheckBox.setVisible(false); + + pluginCheckBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + int stateChange = e.getStateChange(); + pluginComboCheckBox.setVisible(stateChange == ItemEvent.SELECTED); + pluginComboCheckBox.repaint(); + } + }); + + pane.add(pluginCheckBox); + pane.add(pluginComboCheckBox); + return pane; + } + + private JPanel createClassifyPane() { + + JPanel pane = new JPanel(); + //距离远一点 + pane.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 5)); + this.parentClassify = new UIComboBox(ComponentTypes.values()); + this.parentClassify.setPreferredSize(new Dimension(COMBO_WIDTH, COMBO_HEIGHT)); + + List children = ComponentTypes.CHART.children(-1); + final String placeHolderText = Toolkit.i18nText("Fine-Design_Share_Select_Type"); + PlaceHolderUI placeHolderUI = new PlaceHolderUI(placeHolderText) { + @Override + protected boolean validate(UIComboBox comboBox) { + return childClassify.getSelectedItem() != null; + } + }; + this.childClassify = ShareUIUtils.wrapUI(placeHolderUI, new UIComboBox()); + this.childClassify.refreshBoxItems(children); + this.childClassify.setPreferredSize(new Dimension(COMBO_WIDTH_PLUS, COMBO_HEIGHT)); + this.childClassify.setBorder(BorderFactory.createEmptyBorder()); + + parentClassify.addItemListener(new ItemListener() { + + @Override + public void itemStateChanged(ItemEvent e) { + + ItemSelectable itemSelectable = e.getItemSelectable(); + ComponentType selectedItem = (ComponentType) ((UIComboBox) itemSelectable).getSelectedItem(); + if (selectedItem != null) { + int device = displayDevice(); + List children = selectedItem.children(device); + childClassify.clearBoxItems(); + childClassify.refreshBoxItems(children); + } + } + }); + + //设置默认值 + this.parentClassify.setSelectedItem(ComponentTypes.CHART); + + pane.add(parentClassify); + pane.add(childClassify); + return pane; + } + + private JPanel createLocalGroupPane() { + + JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 2)); + this.localGroup = new UIComboBox(DefaultShareGroupManager.getInstance().getAllGroup()); + this.localGroup.setPreferredSize(new Dimension(GROUP_WIDTH, COMBO_HEIGHT)); + + panel.add(localGroup); + return panel; + } + + private JPanel createDevicePane() { + + JPanel pane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); + pc.setSelected(true); + mobile.setSelected(true); + + ItemListener parentClassifyRefresh = new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + parentClassify.setSelectedItem(ComponentTypes.CHART); + } + }; + + pc.addItemListener(parentClassifyRefresh); + + mobile.addItemListener(parentClassifyRefresh); + pane.add(pc); + pane.add(mobile); + return pane; + } + + @NotNull + private JPanel createVendorPane() { + + final JPanel vendorPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); + + String bbsUsername = DesignerEnvManager.getEnvManager().getDesignerLoginUsername(); + if (StringUtils.isEmpty(bbsUsername)) { + UILabel unLoginLabel = ShareUIUtils.createHyperlinkLabel(Toolkit.i18nText("Fine-Design_Share_Click_Login")); + + final UILabel hidden = new ShareLoginLabel(vendorPane, unLoginLabel, loginLabel); + + unLoginLabel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + LoginWebBridge.getHelper().setUILabel(hidden); + Dialog shareDialog = ShareDialogUtils.getInstance().getShareDialog(); + //必须这样创建,不然窗口优先级不对 + DesignerLoginHelper.showLoginDialog(DesignerLoginSource.NORMAL, new HashMap<>(), shareDialog); + } + }); + vendorPane.add(unLoginLabel); + } else { + loginLabel.setText(bbsUsername); + vendorPane.add(loginLabel); + } + + return vendorPane; + } + + @NotNull + private JPanel createComponentOverviewPane(boolean upload) { + //功能介绍 + UILabel effectLabel = ShareUIUtils.createTopRightUILabel(Toolkit.i18nText("Fine-Design_Share_Special_Effects")); + JPanel effectPane = createEffectPane(effectItemGroups); + + content.setDocument( + new LimitedDocument(200, 500) + ); + String contentTip = Toolkit.i18nText("Fine-Design_Share_Content_Introduction_Placeholder"); + content.setAutoscrolls(true); + content.setPlaceholder(contentTip); + UIScrollPane contentPane = new UIScrollPane(content); + contentPane.setPreferredSize(new Dimension(COLUMN_FIELD_WIDTH, 50)); + contentPane.setBorder(null); + + help.setDocument( + new LimitedDocument(1000) + ); + String helpTip = Toolkit.i18nText("Fine-Design_Share_Help_Msg_Placeholder"); + help.setPlaceholder(helpTip); + UIScrollPane helpPane = new UIScrollPane(help); + helpPane.setPreferredSize(new Dimension(COLUMN_FIELD_WIDTH, 50)); + helpPane.setBorder(null); + + UILabel helpLabel = ShareUIUtils.createTopRightUILabel(Toolkit.i18nText("Fine-Design_Share_Help_Msg")); + UILabel contentLabel = ShareUIUtils.createTopRightUILabel(Toolkit.i18nText("Fine-Design_Share_Content_Introduction")); + + + double p = TableLayout.PREFERRED; + int[] row = {1, 1}; + double[] columnSize = {COLUMN_ITEM_SIZE, p}; + List componentList= new LinkedList(); + List rowSizeList = new LinkedList(); + List rowCountList = new LinkedList(); + + if (effectItemGroups.size() > 0 ) { + componentList.add(new Component[]{effectLabel, effectPane}); + } + + componentList.add(new Component[]{helpLabel, helpPane}); + + if (upload) { + componentList.add(new Component[]{contentLabel, contentPane}); + } + for (int i = 0; i < componentList.size(); i++) { + rowSizeList.add(p); + rowCountList.add(row); + } + + return TableLayoutHelper.createGapTableLayoutPane( + componentList.toArray(new Component[componentList.size()][]), + ArrayUtils.toPrimitive(rowSizeList.toArray(new Double[rowSizeList.size()])), + columnSize, + rowCountList.toArray(new int[rowCountList.size()][]), + LayoutConstants.HGAP_SMALL, LayoutConstants.VGAP_MEDIUM); + } + + private JPanel createNameFiledPane() { + LimitedDocument nameLimited = new LimitedDocument(NAME_MAX_LENGTH); + nameField.setPlaceholder(Toolkit.i18nText("Fine-Design_Share_Name_Placeholder")); + nameField.setPreferredSize(new Dimension(TEXT_FIELD_WIDTH, TEXT_FIELD_HEIGHT)); + nameField.setDocument(nameLimited); + JPanel symbolTextFiled = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UILabel validSymbol = new UILabel(" *"); + symbolTextFiled.add(nameField, BorderLayout.CENTER); + symbolTextFiled.add(validSymbol, BorderLayout.EAST); + + return symbolTextFiled; + } + + + private void initUploadCoverBtn() { + + this.uploadBtn = new UIButton(Toolkit.i18nText("Fine-Design_Share_Select_Upload_Cover")); + this.uploadBtn.setPreferredSize(new Dimension(BTN_WIDTH, BTN_HEIGHT)); + uploadBtn.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + final CoverUploadPane pane = new CoverUploadPane(); + BasicDialog basicDialog = pane.showWindow(DesignerContext.getDesignerFrame(), true); + pane.setSize(BasicDialog.MEDIUM); + pane.populateBean(shareCover); + basicDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + shareCover = pane.updateBean(); + cover.setIcon(getShowIcon(shareCover)); + cover.repaint(); + } + }); + basicDialog.setVisible(true); + } + }); + } + + private JPanel getCoverImagePane() { + + initUploadCoverBtn(); + JPanel coverImagePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + cover.setPreferredSize(new Dimension(ShareComponentConstants.SHARE_THUMB_WIDTH, ShareComponentConstants.SHARE_THUMB_HEIGHT)); + coverImagePane.add(cover); + + JPanel uploadBtnPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + uploadBtnPane.setPreferredSize(new Dimension(BTN_WIDTH, ShareComponentConstants.SHARE_THUMB_HEIGHT)); + uploadBtnPane.add(uploadBtn, BorderLayout.SOUTH); + coverImagePane.add(uploadBtnPane); + + return coverImagePane; + + } + + /* 校验 */ + + public boolean check() { + + Dialog shareDialog = ShareDialogUtils.getInstance().getShareDialog(); + String name = nameField.getText(); + if (StringUtils.isEmpty(name)) { + FineJOptionPane.showMessageDialog(shareDialog, Toolkit.i18nText("Fine-Design_Share_Lack_Name"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + return false; + } + if (upload && StringUtils.isEmpty(content.getText())) { + FineJOptionPane.showMessageDialog(shareDialog, Toolkit.i18nText("Fine-Design_Share_Lack_Content"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + return false; + } + if (upload && StringUtils.isEmpty(loginLabel.getText())) { + FineJOptionPane.showMessageDialog(shareDialog, Toolkit.i18nText("Fine-Design_Share_Lack_Login"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + return false; + } + if (upload && styleComboBox.getSelectedItem() == null) { + FineJOptionPane.showMessageDialog(shareDialog, Toolkit.i18nText("Fine-Design_Share_Style_Theme_Tip"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + return false; + } + if (!pc.isSelected() && !mobile.isSelected()) { + FineJOptionPane.showMessageDialog(shareDialog, Toolkit.i18nText("Fine-Design_Share_Lack_Device"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + return false; + } + if (pluginCheckBox.isSelected() && ArrayUtils.isEmpty(pluginComboCheckBox.getSelectedValues())) { + FineJOptionPane.showMessageDialog(shareDialog, Toolkit.i18nText("Fine-Design_Share_Lack_Plugins"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + return false; + } + if (!priceExpectPane.check()) { + FineJOptionPane.showMessageDialog(shareDialog, Toolkit.i18nText("Fine-Design_Share_Lack_Price"), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + return false; + } + return true; + } + + /* 生成 */ + + public DefaultSharableWidget generate() { + + String uuid = UUID.randomUUID().toString(); + DefaultSharableWidget provider = new DefaultSharableWidget(uuid, nameField.getText(), help.getText(), shareCover, rec.width, rec.height); + provider.setDisplayDevice(displayDevice()); + provider.setParentClassify(classify(parentClassify.getSelectedItem())); + provider.setChildClassify(classify(childClassify.getSelectedItem())); + provider.setDesignerVersion(ProductConstants.VERSION); + provider.setVendor(loginLabel.getText()); + provider.setFileName(provider.getNameWithID()); + + if (upload) { + provider.setSummary(content.getText()); + Object selectStyle = styleComboBox.getSelectedItem(); + provider.setStyleTheme(selectStyle == null ? null : ((StyleThemeBean) selectStyle).getId()); + provider.setInvolvePlugins(pluginComboCheckBox.getText()); + provider.setPriceExpect(priceExpectPane.getPrice()); + } + + return provider; + } + + public Group getSelectGroup() { + return (Group) localGroup.getSelectedItem(); + } + + public UITextField getNameField() { + return nameField; + } + + private String classify(Object classify) { + + return classify == null ? StringUtils.EMPTY : classify.toString(); + } + + private int displayDevice() { + + List types = new ArrayList<>(8); + if (pc.isSelected()) { + types.add(DisplayDevice.PC); + } + if (mobile.isSelected()) { + types.add(DisplayDevice.MOBILE); + } + return DisplayDevice.buildDevice(types); + } + + private class LimitedDocument extends PlainDocument { + private static final long serialVersionUID = 1L; + private int maxLength = -1;// 允许的最大长度 + private int errorLength = -1; + private int loop = 5; + private String allowCharAsString = null;// 允许的字符串格式(0123456789) + + public LimitedDocument(int maxLength) { + this(-1, maxLength); + } + + public LimitedDocument(int errorLength, int maxLength) { + super(); + this.errorLength = errorLength; + this.maxLength = maxLength; + } + + @Override + public void insertString(int offset, String str, AttributeSet attrSet) throws BadLocationException { + if (str == null) { + return; + } + if (allowCharAsString != null && str.length() == 1) { + if (allowCharAsString.indexOf(str) == -1) { + java.awt.Toolkit.getDefaultToolkit().beep();// 发出一个警告声 + return;// 不是所要求的字符格式,就直接返回,不进行下面的添加 + } + } + char[] charVal = str.toCharArray(); + String strOldValue = getText(0, getLength()); + char[] tmp = strOldValue.toCharArray(); + int currentLength = tmp.length + charVal.length; + if (errorLength != -1 && currentLength > errorLength && ++loop >= 5) { + this.loop = 0; + FineJOptionPane.showMessageDialog(ShareDialogUtils.getInstance().getShareDialog(), + ShareUIUtils.formatWidthString(Toolkit.i18nText("Fine-Design_Share_Input_Errors", String.valueOf(errorLength)), 200), + Toolkit.i18nText("Fine-Design_Basic_Error"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + //只提示,不报错 + } + if (maxLength != -1 && (currentLength > maxLength)) { + java.awt.Toolkit.getDefaultToolkit().beep();// 发出一个警告声 + return;// 长度大于指定的长度maxLength,也直接返回,不进行下面的添加 + } + super.insertString(offset, str, attrSet); + } + + public void setAllowChar(String str) { + allowCharAsString = str; + } + } + +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectItemRender.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectItemRender.java new file mode 100644 index 000000000..f31169da1 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectItemRender.java @@ -0,0 +1,117 @@ +package com.fr.design.share.ui.generate.table; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.border.Border; +import javax.swing.table.DefaultTableCellRenderer; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Image; +import java.awt.Rectangle; + +public class EffectItemRender extends DefaultTableCellRenderer { + static final private Color HEADER_COLOR = new Color(221, 221, 221); + static final private Color PLACEHOLDER_COLOR = new Color(193, 193, 193); + static final private Color NO_EDITABLE_BG = new Color(240, 240, 241); + static final private Border DEFAULT_NO_FOCUS_BORDER = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(1, 5, 1, 5), BorderFactory.createEmptyBorder(0, 4, 0, 4)); + static final private Border SELECTED_BORDER = BorderFactory.createLineBorder(new Color(160,190,240)); + + private PreviewPanel preViewPanel; + + public EffectItemRender() { + setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 10)); + setLayout(new FlowLayout()); + preViewPanel = new PreviewPanel(StringUtils.EMPTY); + } + + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + setText(StringUtils.EMPTY); + setToolTipText(null); + setBorder(DEFAULT_NO_FOCUS_BORDER); + setBackground(null); + if (column > 0) { + if (StringUtils.isNotEmpty(value.toString())) { + setValue(value); + setToolTipText(value); + if (!table.isCellEditable(row, column)) { + setForeground(PLACEHOLDER_COLOR); + setBackground(NO_EDITABLE_BG); + setToolTipText(Toolkit.i18nText("Fine-Design_Share_Not_Support_Rename")); + } else { + setForeground(Color.black); + } + + if (table.getSelectedRow() == row && table.getSelectedColumn() == column && table.isCellEditable(row, column) ) { + setBorder(SELECTED_BORDER); + setBackground(null); + table.setCursor(Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR)); + } else { + if (isSelected) { + setBackground(table.getSelectionBackground()); + } + + table.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + } else { + setValue(Toolkit.i18nText("Fine-Design_Share_Need_Rename")); + setForeground(PLACEHOLDER_COLOR); + } + return this; + } else { + Rectangle rect = table.getCellRect(row, column, false); + preViewPanel.populate(value.toString()); + preViewPanel.getTextLabel().setPreferredSize(new Dimension(rect.width - preViewPanel.ICON_SIZE - 20, rect.height)); + return preViewPanel; + } + } + + public void setValue(Object value) { + setText((value == null) ? "" : value.toString()); + } + + private void setToolTipText(Object value) { setToolTipText((value == null) ? "" : value.toString()); } + + private class PreviewPanel extends JPanel { + public static final int ICON_SIZE = 10; + private UILabel textLabel; + + public PreviewPanel(String text) { + init(text); + } + + private void init(String text) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBackground(HEADER_COLOR); + textLabel = new UILabel(text); + textLabel.setToolTipText(text); + textLabel.setBorder(BorderFactory.createEmptyBorder(0,5,0,0)); + Image image = BaseUtils.readImage("com/fr/base/images/share/view.png"); + image.getScaledInstance(ICON_SIZE, ICON_SIZE, Image.SCALE_DEFAULT); + UILabel imageLabel = new UILabel(new ImageIcon(image)); + imageLabel.setBorder(BorderFactory.createEmptyBorder(0,10,0,10)); + this.add(textLabel, BorderLayout.WEST); + this.add(imageLabel, BorderLayout.EAST); + } + + public UILabel getTextLabel() { + return textLabel; + } + + public void populate(String text) { + textLabel.setText(text); + this.setToolTipText(text); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectTableModel.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectTableModel.java new file mode 100644 index 000000000..f9d4ecb2b --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/table/EffectTableModel.java @@ -0,0 +1,75 @@ +package com.fr.design.share.ui.generate.table; + +import com.fr.design.share.effect.EffectItem; +import com.fr.design.share.effect.EffectItemGroup; +import com.fr.design.share.effect.ListenerEffectItem; + +import javax.swing.table.AbstractTableModel; +import java.util.List; + +public class EffectTableModel extends AbstractTableModel { + private Object[] columnNames; + private List effectItems; + + public EffectTableModel(EffectItemGroup itemGroup, Object[] columnNames) { + if (itemGroup == null) { + this.effectItems = new EffectItemGroup().getEffectItems(); + } else { + this.effectItems = itemGroup.getEffectItems(); + } + this.columnNames = columnNames; + } + @Override + public int getRowCount() { + return this.effectItems.size(); + } + + @Override + public int getColumnCount() { + return this.columnNames.length; + } + + @Override + public String getColumnName(int columnIndex) { + if (columnNames == null) { + return null; + } + return columnNames[columnIndex].toString(); + } + + @Override + public Class getColumnClass(int columnIndex) { + return EffectTableModel.class; + } + + @Override + public boolean isCellEditable(int rowIndex, int columnIndex) { + return columnIndex == 1; + } + + @Override + public Object getValueAt(int rowIndex, int columnIndex) { + + if (rowIndex >= getRowCount() || columnIndex >= getColumnCount()) { + return null; + } + EffectItem effectItem = effectItems.get(rowIndex); + if (columnIndex == 0) { + return effectItem.getConfigPath(); + } else if (columnIndex == 1) { + return effectItem.getName(); + } + return null; + } + + @Override + public void setValueAt(Object aValue, int rowIndex, int columnIndex) { + if (rowIndex >= effectItems.size() || columnIndex >= getColumnCount()) { + return; + } + EffectItem effectItem = effectItems.get(rowIndex); + if (columnIndex == 1) { + effectItem.setName(aValue.toString()); + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/table/EffectItemEditor.java b/designer-realize/src/main/java/com/fr/design/share/ui/table/EffectItemEditor.java new file mode 100644 index 000000000..8fc0464e2 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/ui/table/EffectItemEditor.java @@ -0,0 +1,65 @@ +package com.fr.design.share.ui.table; + +import com.fr.design.gui.itextfield.UITextField; + +import javax.swing.AbstractCellEditor; +import javax.swing.JTable; +import javax.swing.table.TableCellEditor; +import java.awt.Component; +import java.awt.event.FocusAdapter; +import java.awt.event.FocusEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; + +public class EffectItemEditor extends AbstractCellEditor implements TableCellEditor { + private UITextField textField; + + public EffectItemEditor(JTable table) { + textField = new UITextField(); + textField.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + table.setRowSelectionInterval(table.getEditingRow(), table.getEditingRow()); + table.setColumnSelectionInterval(table.getEditingColumn(), table.getEditingColumn()); + } + @Override + public void mouseExited(MouseEvent e) { + table.clearSelection(); + } + + }); + textField.addMouseMotionListener(new MouseMotionAdapter() { + @Override + public void mouseMoved(MouseEvent e) { + table.setRowSelectionInterval(table.getEditingRow(), table.getEditingRow()); + table.setColumnSelectionInterval(table.getEditingColumn(), table.getEditingColumn()); + } + }); + textField.addFocusListener(new FocusAdapter() { + public void focusGained(FocusEvent e) { + table.setRowSelectionInterval(table.getEditingRow(), table.getEditingRow()); + table.setColumnSelectionInterval(table.getEditingColumn(), table.getEditingColumn()); + } + @Override + public void focusLost(FocusEvent e) { + if ((table.getSelectedRow() < 0) || (table.getSelectedColumn() < 0)) { + table.getCellEditor().stopCellEditing(); + } + } + }); + } + @Override + public Object getCellEditorValue() { + return textField.getText(); + } + + private void setValue(Object value) { + textField.setText((value != null) ? value.toString() : ""); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + setValue(value); + return textField; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java b/designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java new file mode 100644 index 000000000..99391d8c9 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/utils/EffectItemUtils.java @@ -0,0 +1,27 @@ +package com.fr.design.share.utils; + +import com.fr.design.share.effect.EffectItemGroup; +import com.fr.form.share.utils.ShareUtils; +import com.fr.form.ui.Widget; + +import java.util.ArrayList; +import java.util.List; + +public class EffectItemUtils { + public static List getEffectItemGroupsByWidget(Widget widget) { + List widgetList = ShareUtils.getAllLeafWidget(widget); + List effectItemGroupList = new ArrayList(); + for (Widget w : widgetList) { + EffectItemGroup effectItemGroup = new EffectItemGroup(w); + if (effectItemGroup.getEffectItems().size() > 0) { + effectItemGroupList.add(effectItemGroup); + } + } + return effectItemGroupList; + } + + public static boolean hasEffectItem(Widget widget) { + EffectItemGroup effectItemGroup = new EffectItemGroup(widget); + return effectItemGroup.getEffectItems().size() > 0; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/share/utils/ShareDialogUtils.java b/designer-realize/src/main/java/com/fr/design/share/utils/ShareDialogUtils.java new file mode 100644 index 000000000..4b7cfb845 --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/share/utils/ShareDialogUtils.java @@ -0,0 +1,36 @@ +package com.fr.design.share.utils; + +import java.awt.Dialog; + +public class ShareDialogUtils { + private static class InstanceHolder { + + private static ShareDialogUtils helper = new ShareDialogUtils(); + } + + public static ShareDialogUtils getInstance() { + + return InstanceHolder.helper; + } + + private Dialog shareDialog; + private Dialog ConfigDialog; + + public void setShareDialog(Dialog shareDialog) { + + this.shareDialog = shareDialog; + } + + public Dialog getShareDialog() { + + return this.shareDialog; + } + + public void setConfigDialog(Dialog configDialog) { + ConfigDialog = configDialog; + } + + public Dialog getConfigDialog() { + return ConfigDialog; + } +} diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java index 79673c11d..936001d70 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetEventPane.java @@ -1,10 +1,10 @@ package com.fr.design.widget; -import java.util.ArrayList; -import java.util.List; - -import com.fr.design.gui.controlpane.ObjectUIControlPane; +import java.lang.reflect.Constructor; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.UIListGroupControlPane; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.CellWidgetPropertyPane; import com.fr.design.write.submit.DBManipulationPane; import com.fr.design.write.submit.SmartInsertDBManipulationInWidgetEventPane; @@ -20,18 +20,20 @@ import com.fr.grid.selection.Selection; import com.fr.general.NameObject; import com.fr.grid.selection.CellSelection; +import com.fr.stable.AssistUtils; import com.fr.stable.Nameable; import javax.swing.*; -public class WidgetEventPane extends ObjectUIControlPane { +public class WidgetEventPane extends UIListGroupControlPane { private static final Selection NO_SELECTION = new CellSelection(-1, -1, -1, -1); private Selection selection = NO_SELECTION; + private ElementCasePane object; + public WidgetEventPane(ElementCasePane pane) { - super(pane); - this.setNameListEditable(false); + this.object = pane; if(pane != null){ selection = pane.getSelection(); } @@ -62,7 +64,7 @@ public class WidgetEventPane extends ObjectUIControlPane { protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"); } - + public static class WidgetEventListenerUpdatePane extends ListenerUpdatePane { private ElementCasePane epane; // 反射会用到 @@ -91,8 +93,8 @@ public class WidgetEventPane extends ObjectUIControlPane { protected DBManipulationPane createDBManipulationPane() { if(epane == null && DesignerContext.getDesignerFrame().getSelectedJTemplate() != null) { return autoCreateDBManipulationInWidgetEventPane(); - } - + } + return new SmartInsertDBManipulationInWidgetEventPane(epane); } @@ -100,7 +102,7 @@ public class WidgetEventPane extends ObjectUIControlPane { protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Callback_Function"); } - + @Override protected boolean isForm() { return false; @@ -116,26 +118,14 @@ public class WidgetEventPane extends ObjectUIControlPane { protected boolean supportCellAction() { return false; } - + } public void populate(Widget widget) { if (widget == null) { return; } - - this.refreshNameableCreator(EventCreator.createEventCreator(widget.supportedEvents(), WidgetEventListenerUpdatePane.class)); - - List list = new ArrayList(); - Listener listener; - for (int i = 0, size = widget.getListenerSize(); i < size; i++) { - listener = widget.getListener(i); - if (!listener.isDefault()) //name+(i+1)需要确保名字不重复 - { - list.add(new NameObject(EventCreator.switchLang(listener.getEventName()) + (i + 1), listener)); - } - } - this.populate(list.toArray(new NameObject[list.size()])); + refreshPane(widget, EventCreator.createEventCreator(widget.supportedEvents(), WidgetEventListenerUpdatePane.class)); } /** @@ -150,4 +140,49 @@ public class WidgetEventPane extends ObjectUIControlPane { } return res_array; } + + @Override + public BasicBeanPane createPaneByCreators(NameableCreator creator) { + try { + if (object == null) { + return super.createPaneByCreators(creator); + } else if (object.getClass().isArray()) { + return creator.getUpdatePane().getConstructor(object.getClass()).newInstance(object); + } else { + Constructor constructor = getConstructor(creator.getUpdatePane(), object.getClass()); + return constructor == null ? super.createPaneByCreators(creator) : constructor.newInstance(object); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * 传进BasicBeanPane的构造函数的参数,可能是 + * + * @param clazz + * @param cls + * @return + */ + private Constructor getConstructor(Class clazz, Class cls) { + Constructor constructor = null; + try { + constructor = clazz.getConstructor(cls); + } catch (SecurityException e) { + } catch (NoSuchMethodException e) { + } + if (constructor != null) { + return constructor; + } else { + if (AssistUtils.equals(cls.getName(),Object.class.getName())) { + return null; + } + return getConstructor(clazz, cls.getSuperclass()); + } + } + + protected String getWrapperLabelText(){ + return Toolkit.i18nText("Fine-Design_Report_Event"); + } + } diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 3fe126879..7b7867372 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -249,8 +249,13 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { while (dialog.getParent() != null) { dialog = dialog.getParent(); if (dialog instanceof Dialog) { + final Dialog finalDialog = (Dialog) dialog; + // 非模态的 直接设置可见 不会阻塞 + if (!finalDialog.isModal()) { + finalDialog.setVisible(true); + continue; + } //这边需要另起一个线程设置可见,防止阻塞 - final Container finalDialog = dialog; SwingWorker worker = new SwingWorker() { @Override protected Object doInBackground() throws Exception { diff --git a/designer-realize/src/main/java/com/fr/grid/Grid.java b/designer-realize/src/main/java/com/fr/grid/Grid.java index dc414f673..abbd60928 100644 --- a/designer-realize/src/main/java/com/fr/grid/Grid.java +++ b/designer-realize/src/main/java/com/fr/grid/Grid.java @@ -15,9 +15,11 @@ import com.fr.design.constants.UIConstants; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.fun.GridUIProcessor; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.mainframe.DesignOperationEvent; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.event.EventDispatcher; import com.fr.general.ComparatorUtils; import com.fr.grid.event.CellEditorEvent; import com.fr.grid.event.CellEditorListener; @@ -1083,6 +1085,7 @@ public class Grid extends BaseGridComponent { imageChange = true; } if (styleChange || imageChange) { + EventDispatcher.fire(DesignOperationEvent.CELL_IMAGE_VALUE_MODIFY); return true; } } else { diff --git a/designer-realize/src/main/java/com/fr/poly/creator/PolyElementCasePane.java b/designer-realize/src/main/java/com/fr/poly/creator/PolyElementCasePane.java index af6918de2..cf93aa74a 100644 --- a/designer-realize/src/main/java/com/fr/poly/creator/PolyElementCasePane.java +++ b/designer-realize/src/main/java/com/fr/poly/creator/PolyElementCasePane.java @@ -13,12 +13,18 @@ import com.fr.report.poly.PolyECBlock; */ public abstract class PolyElementCasePane extends ElementCasePane { + /** + * 水平方向在一个屏幕内可见的可扩展的列数 + */ + private static final int HORIZONTAL_EXTENT_VALUE = 200; + public PolyElementCasePane(PolyECBlock block) { super(block); setSelection(new CellSelection(0, 0, 1, 1)); // 都不加这两个组件,当然他们也就没可见性了 setHorizontalScrollBarVisible(false); setVerticalScrollBarVisible(false); + this.getGrid().setHorizontalExtent(HORIZONTAL_EXTENT_VALUE); } @Override diff --git a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java index ba89eeb99..692245eb4 100644 --- a/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java +++ b/designer-realize/src/main/java/com/fr/start/CollectUserInformationDialog.java @@ -52,6 +52,7 @@ public class CollectUserInformationDialog extends UIDialog { FineJOptionPane.showMessageDialog(CollectUserInformationDialog.this, message); DesignerEnvManager.getEnvManager().setActivationKey(keyValue); DesignerEnvManager.getEnvManager().saveXMLFile(); + DesignerEnvManager.getEnvManager().setDesignerActivatedTime(System.currentTimeMillis()); doOK(); } else { message = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Activate_Activation_Code_Invalid"); diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 5d3964771..5c8c57987 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/designer-realize/src/main/java/com/fr/start/MainDesigner.java @@ -29,6 +29,7 @@ import com.fr.design.mainframe.JWorkBook; import com.fr.design.mainframe.alphafine.component.AlphaFinePane; import com.fr.design.mainframe.bbs.UserInfoLabel; import com.fr.design.mainframe.bbs.UserInfoPane; +import com.fr.design.notification.ui.NotificationCenterPane; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; @@ -38,6 +39,7 @@ import com.fr.design.module.ChartEmptyDataStyleAction; import com.fr.design.module.ChartPreStyleAction; import com.fr.design.module.DesignModuleFactory; import com.fr.design.monitor.DesignerLifecycleMonitorContext; +import com.fr.design.share.SharableManager; import com.fr.design.utils.concurrent.ThreadFactoryBuilder; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.event.Event; @@ -235,6 +237,7 @@ public class MainDesigner extends BaseDesigner { jt.stopEditing(); jt.saveDirectly(); jt.requestFocus(); + SharableManager.saveTemplate(jt); } }); } @@ -411,6 +414,10 @@ public class MainDesigner extends BaseDesigner { return AlphaFinePane.getAlphaFinePane(); } + public Component createNotificationCenterPane(){ + return NotificationCenterPane.getNotificationCenterPane(); + } + /** * 收集用户信息吗 */ diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index eb3f577cc..3c9b4dc9d 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -39,8 +39,11 @@ import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ProcessTransitionAdapter; +import com.fr.design.login.DesignerLoginType; +import com.fr.design.login.guide.DesignerGuideHelper; +import com.fr.design.login.message.DesignerMessageHelper; +import com.fr.design.login.socketio.LoginAuthServer; import com.fr.design.mainframe.BaseJForm; -import com.fr.design.mainframe.ElementCaseThumbnail; import com.fr.design.mainframe.FormHierarchyTreePane; import com.fr.design.mainframe.InformationCollector; import com.fr.design.mainframe.JForm; @@ -54,16 +57,20 @@ import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormElementCaseDesigner; import com.fr.design.mainframe.form.FormReportComponentComposite; import com.fr.design.mainframe.loghandler.DesignerLogAppender; +import com.fr.design.mainframe.share.constants.ShareEntryKey; import com.fr.design.mainframe.socketio.DesignerSocketIO; +import com.fr.design.mod.ContentReplacerCenter; import com.fr.design.module.DesignModuleFactory; import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.parameter.FormParameterReader; import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.WorkBookParameterReader; +import com.fr.design.share.SharableManager; +import com.fr.design.share.ui.config.ShareConfigPane; +import com.fr.design.share.ui.generate.ShareGeneratePane; import com.fr.design.update.actions.RecoverForDesigner; import com.fr.design.update.push.DesignerPushUpdateManager; import com.fr.design.widget.ui.btn.FormSubmitButtonDetailPane; -import com.fr.form.stable.ElementCaseThumbnailProcessor; import com.fr.general.GeneralContext; import com.fr.general.xml.GeneralXMLTools; import com.fr.js.EmailJavaScript; @@ -77,6 +84,7 @@ import com.fr.locale.LocaleScope; import com.fr.log.FineLoggerFactory; import com.fr.log.LogHandler; import com.fr.module.Activator; +import com.fr.module.extension.Prepare; import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.manage.PluginFilter; @@ -111,6 +119,7 @@ import com.fr.stable.xml.ObjectTokenizer; import com.fr.stable.xml.ObjectXMLWriterFinder; import com.fr.start.BBSGuestPaneProvider; import com.fr.task.Once; +import com.fr.workspace.WorkContext; import com.fr.xml.ReportXMLUtils; import java.util.ArrayList; @@ -124,7 +133,7 @@ import java.awt.image.BufferedImage; * 触发原来的DesignerModule的启动 * 之后慢慢将DesignerModule拆成Activator */ -public class DesignerActivator extends Activator { +public class DesignerActivator extends Activator implements Prepare { private LogHandler logHandler = null; @@ -132,11 +141,14 @@ public class DesignerActivator extends Activator { @Override public void run() { DesignerPushUpdateManager.getInstance().preparePushUpdate(); + DesignerGuideHelper.prepareShowGuideDialog(); + DesignerMessageHelper.getInstance().prepareShowMessage(); } }); @Override public void start() { + migrateBBSInfoFromFineDB(); List markers = findMutable(InterMutableKey.Path); for (LocaleMarker marker : markers) { if (marker.match(LocaleScope.DESIGN)) { @@ -203,6 +215,7 @@ public class DesignerActivator extends Activator { designerRegister(); InformationCollector.getInstance().collectStartTime(); + SharableManager.start(); } private void createPluginListener() { @@ -382,6 +395,8 @@ public class DesignerActivator extends Activator { private static void registerData4Form() { StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class); + StableFactory.registerMarkedClass(ShareEntryKey.SHARE_GENERATE, ShareGeneratePane.class); + StableFactory.registerMarkedClass(ShareEntryKey.SHARE_CONFIG, ShareConfigPane.class); DesignModuleFactory.registerParameterReader(new WorkBookParameterReader()); } @@ -399,23 +414,52 @@ public class DesignerActivator extends Activator { DesignModuleFactory.registerParameterReader(new FormParameterReader()); StableFactory.registerMarkedClass(BaseJForm.XML_TAG, JForm.class); - - StableFactory.registerMarkedObject(ElementCaseThumbnailProcessor.MARK_STRING, new ElementCaseThumbnail()); } private static void storePassport() { - FinePassportManager.getInstance().storePassport(MarketConfig.getInstance().getBbsUsername(), DesignerEnvManager.getEnvManager().getActivationKey()); + FinePassportManager.getInstance().storePassport(DesignerEnvManager.getEnvManager().getDesignerLoginUsername(), DesignerEnvManager.getEnvManager().getActivationKey()); FinePassportManager.getInstance().addPassportListener(new FinePassportListenerAdapter() { @Override public void onLoginSuccess() { - FinePassportManager.getInstance().storePassport(MarketConfig.getInstance().getBbsUsername(), DesignerEnvManager.getEnvManager().getActivationKey()); + FinePassportManager.getInstance().storePassport(DesignerEnvManager.getEnvManager().getDesignerLoginUsername(), DesignerEnvManager.getEnvManager().getActivationKey()); } }); } + private void migrateBBSInfoFromFineDB() { + if (!WorkContext.getCurrent().isLocal()) { + return; + } + DesignerEnvManager manager = DesignerEnvManager.getEnvManager(); + if (manager.isCurrentVersionFirstLaunch()) { + int newUid = manager.getDesignerLoginUid(); + if (newUid > 0) { + return; + } + int oldUid = MarketConfig.getInstance().getBbsUid(); + if (oldUid > 0) { + manager.setDesignerLoginUid(oldUid); + manager.setDesignerLoginUsername(MarketConfig.getInstance().getBbsUsername()); + manager.setDesignerLoginAppId(MarketConfig.getInstance().getBbsAppId()); + manager.setDesignerLoginRefreshToken(MarketConfig.getInstance().getBbsRefreshToken()); + manager.setDesignerLastLoginTime(System.currentTimeMillis()); + manager.setLastLoginType(DesignerLoginType.NORMAL_LOGIN); + manager.setLastLoginAccount(MarketConfig.getInstance().getBbsUsername()); + manager.setCurrentVersionFirstLaunch(false); + DesignerEnvManager.getEnvManager().saveXMLFile(); + } + } + } + @Override public void stop() { unloadLogAppender(); DesignerSocketIO.close(); } + + @Override + public void prepare() { + LoginAuthServer.getInstance().start(); + ContentReplacerCenter.getInstance().register(); + } } diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java index 0a572e672..220a4e39e 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerWorkspaceProvider.java @@ -9,6 +9,7 @@ import com.fr.design.env.DesignerWorkspaceGenerator; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.i18n.Toolkit; +import com.fr.design.versioncheck.VersionCheckUtils; import com.fr.env.TestConnectionResult; import com.fr.event.Event; import com.fr.event.EventDispatcher; @@ -69,7 +70,7 @@ public class DesignerWorkspaceProvider extends Activator { @Override public void on(Event event, Null aNull) { try { - EnvChangeEntrance.getInstance().showServiceDialog(selectEnv); + VersionCheckUtils.showVersionCheckDialog(selectEnv.getName()); } catch (Exception e) { FineLoggerFactory.getLogger().warn("Check Service Failed"); } diff --git a/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch.png b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch.png index 63012b282..3daece322 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch.png and b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/smallsearch.png differ diff --git a/designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java b/designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java new file mode 100644 index 000000000..c2f7ef769 --- /dev/null +++ b/designer-realize/src/test/java/com/fr/design/mainframe/app/DesignerAppUtilsTest.java @@ -0,0 +1,106 @@ +package com.fr.design.mainframe.app; + +import com.fr.invoke.Reflect; +import com.fr.plugin.context.PluginMarker; +import com.fr.plugin.context.PluginMarkerAdapter; +import com.fr.plugin.engine.remote.PluginRemoteSync; +import com.fr.stable.TemplateIOErrorContextHolder; +import com.fr.third.guava.collect.Multimap; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.powermock.api.easymock.PowerMock; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.modules.junit4.PowerMockRunner; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; + +/** + * @author vito + * @version 10.0 + * Created by vito on 2021/5/31 + */ +@RunWith(PowerMockRunner.class) +@PrepareForTest({PluginRemoteSync.class}) +public class DesignerAppUtilsTest { + @Test + public void testDealWithErrorDetailMultiLineAndCache() { + TemplateIOErrorContextHolder.registerPluginNameMap(new HashMap() {{ + put("2", "好用的插件"); + }},new HashSet<>()); + TemplateIOErrorContextHolder.addNeedEnablePlugin(PluginMarkerAdapter.create("1", "1.0", "1插件")); + TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("2", "1.0")); + TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("3", "1.0")); + String log = DesignerAppUtils.dealWithErrorDetailMultiLineAndCache("template1"); + Assert.assertTrue(log.contains("1插件")); + Assert.assertTrue(log.contains("好用的插件")); + Assert.assertTrue(log.contains("3")); + Multimap map = DesignerAppUtils.popPluginInfoMap("template1"); + Assert.assertEquals(3, map.size()); + Assert.assertNull(DesignerAppUtils.popPluginInfoMap("template1")); + } + + @Test + public void testInvalidatePlugins() { + TemplateIOErrorContextHolder.registerPluginNameMap(new HashMap() {{ + put("2", "好用的插件"); + }},new HashSet<>()); + TemplateIOErrorContextHolder.addNeedEnablePlugin(PluginMarkerAdapter.create("1", "1.0", "1插件")); + TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("2", "1.0")); + TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("3", "1.0")); + String log = DesignerAppUtils.dealWithErrorDetailMultiLineAndCache("template1"); + Assert.assertTrue(log.contains("1插件")); + Assert.assertTrue(log.contains("好用的插件")); + Assert.assertTrue(log.contains("3")); + DesignerAppUtils.invalidatePlugins("template1"); + Assert.assertNull(DesignerAppUtils.popPluginInfoMap("template1")); + } + + @Test + public void testRearrange(){ + // 远程插件模拟注册 + PluginRemoteSync pluginRemoteSync = EasyMock.createMock(PluginRemoteSync.class); + EasyMock.expect(pluginRemoteSync.getPluginRemoteStatusByIdIndex()).andReturn(new HashMap(){{ + put("com.fr.plugin1", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin1","1",true).get()); + put("com.fr.plugin2", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin2","1",true).get()); + put("com.fr.plugin3", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin3","1",false).get()); + put("com.fr.plugin4", Reflect.on(PluginRemoteSync.PluginStatus.class).call("create","com.fr.plugin4","1",false).get()); + }}).anyTimes(); + EasyMock.replay(pluginRemoteSync); + PowerMock.mockStaticPartial(PluginRemoteSync.class, "getInstance"); + EasyMock.expect(PluginRemoteSync.getInstance()).andReturn(pluginRemoteSync).anyTimes(); + PowerMock.replay(PluginRemoteSync.class); + + // 本地插件模拟检查 + TemplateIOErrorContextHolder.registerPluginNameMap(new HashMap() {{ + put("com.fr.plugin1", "好用的插件1"); + put("com.fr.plugin2", "好用的插件2"); + put("com.fr.plugin3", "好用的插件3"); + put("com.fr.plugin4", "好用的插件4"); + put("com.fr.plugin5", "好用的插件5"); + }},new HashSet<>()); + // unknown + TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("com.fr.plugin7", "1")); + // disable + TemplateIOErrorContextHolder.addNeedEnablePlugin(PluginMarkerAdapter.create("com.fr.plugin5", "1", "plugin5")); + TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("com.fr.plugin3", "1")); + // not install + TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("com.fr.plugin1", "1")); + TemplateIOErrorContextHolder.addNeedInstallPlugin(PluginMarker.create("com.fr.plugin4", "1")); + + Multimap pendingPlugins = TemplateIOErrorContextHolder.getPendingPlugin(); + + Reflect.on(DesignerAppUtils.class).call("rearrange",pendingPlugins).get(); + Assert.assertEquals(1,pendingPlugins.get(TemplateIOErrorContextHolder.UNKNOWN_PLUGIN).size()); + Collection pluginMarkerAdapters = pendingPlugins.get(TemplateIOErrorContextHolder.DISABLE_PLUGIN); + Assert.assertEquals(2, pluginMarkerAdapters.size()); + pluginMarkerAdapters.contains(PluginMarker.create("com.fr.plugin3", "1")); + pluginMarkerAdapters.contains(PluginMarker.create("com.fr.plugin4", "1")); + Collection pluginMarkerAdapters1 = pendingPlugins.get(TemplateIOErrorContextHolder.NOT_INSTALLED_PLUGIN); + Assert.assertEquals(1, pluginMarkerAdapters1.size()); + pluginMarkerAdapters1.contains(PluginMarker.create("com.fr.plugin5","1")); + } +}