diff --git a/.alloy.json b/.alloy.json index 69b3de9fa9c..8e4b7bbcada 100644 --- a/.alloy.json +++ b/.alloy.json @@ -2,5 +2,5 @@ "alloycore": [ "aui-base-core" ], "alloyregex": "(aui|yui(", "yuiversion": "patched-v3.18.1", - "version": "4.1.1" + "version": "4.2.0" } diff --git a/README.md b/README.md index e9d4a11fb6f..5e8eb1e8e24 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This fork starts from version 3.1.0 and is born out of the necessity to create new features for alloy diagram-builder to apply Threat Modeling diagraming standards. ## Version -Current diagram-builder version 4.1.1 +Current diagram-builder version 4.2.0 ## Features Features added to ContinuumSecurity diagram-builder Fork: diff --git a/bower.json b/bower.json index da0afdb9344..ed8c135d654 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "alloy-ui", - "version": "4.1.1", + "version": "4.2.0", "homepage": "http://alloyui.com", "authors": [ "Eduardo Lundgren " diff --git a/build/aui-aria-table-sortable/aui-aria-table-sortable-min.js b/build/aui-aria-table-sortable/aui-aria-table-sortable-min.js index 7e42dc42306..9b08d9a7c92 100644 --- a/build/aui-aria-table-sortable/aui-aria-table-sortable-min.js +++ b/build/aui-aria-table-sortable/aui-aria-table-sortable-min.js @@ -1 +1 @@ -YUI.add("aui-aria-table-sortable",function(e,t){function r(){}var n=e.Lang;r.ATTRS={captionCss:{validator:n.isString,value:""},captionLive:{validator:n.isString,value:"polite"},captionNode:{setter:function(t){var r=this;return t||(t=e.Node.create(n.sub(r.TPL_CAPTION,{captionCss:r.get("captionCss")}))),e.one(t)},value:null},captionRole:{validator:n.isString,value:"alert"},captionVisible:{validator:n.isBoolean,value:!1},screenReaderClass:{validator:n.isString,value:"sr-only"},stringsSortable:{value:{asc:"ascending",desc:"descending",sorted:"sorted",sortedBy:"sorted by",notSorted:"not sorted"}},tableNode:{setter:e.one,valueFn:function(){return this.get("host").get("boundingBox").one("table")},writeOnce:!0}},r.prototype={TPL_CAPTION:'',initializer:function(){var t=this;t.after("captionVisibleChange",e.bind(t._afterCaptionVisibleChange,t)),t.get("host").after("sort",e.bind(t._afterSort,t))},syncCaption:function(e,t){var r=this,i=r._getCaption(),s=r.get("stringsSortable");i.text(n.sub(s.sortedBy+": {columnName} {direction}",{columnName:e,direction:t?s.asc:s.desc}))},_afterCaptionVisibleChange:function(){var e=this;e._toggleScreenReaderClass()},_afterSort:function(t){var n=this,r,i,s=t.sortBy[0];i=e.Object.keys(s)[0],r=e.Object.values(s)[0]>0,n.syncCaption(i,r)},_getCaption:function(){var e=this,t=e.get("captionNode");return t.inDoc()||(e.get("tableNode").prepend(t),t.setAttribute("aria-live",e.get("captionLive")),t.setAttribute("role",e.get("captionRole")),e._toggleScreenReaderClass()),t},_toggleScreenReaderClass:function(){var e=this,t=e._getCaption();t.toggleClass(e.get("screenReaderClass"),!e.get("captionVisible"))}},e.Base.mix(e.Plugin.Aria,[r])},"4.1.1",{requires:["aui-aria"]}); +YUI.add("aui-aria-table-sortable",function(e,t){function r(){}var n=e.Lang;r.ATTRS={captionCss:{validator:n.isString,value:""},captionLive:{validator:n.isString,value:"polite"},captionNode:{setter:function(t){var r=this;return t||(t=e.Node.create(n.sub(r.TPL_CAPTION,{captionCss:r.get("captionCss")}))),e.one(t)},value:null},captionRole:{validator:n.isString,value:"alert"},captionVisible:{validator:n.isBoolean,value:!1},screenReaderClass:{validator:n.isString,value:"sr-only"},stringsSortable:{value:{asc:"ascending",desc:"descending",sorted:"sorted",sortedBy:"sorted by",notSorted:"not sorted"}},tableNode:{setter:e.one,valueFn:function(){return this.get("host").get("boundingBox").one("table")},writeOnce:!0}},r.prototype={TPL_CAPTION:'',initializer:function(){var t=this;t.after("captionVisibleChange",e.bind(t._afterCaptionVisibleChange,t)),t.get("host").after("sort",e.bind(t._afterSort,t))},syncCaption:function(e,t){var r=this,i=r._getCaption(),s=r.get("stringsSortable");i.text(n.sub(s.sortedBy+": {columnName} {direction}",{columnName:e,direction:t?s.asc:s.desc}))},_afterCaptionVisibleChange:function(){var e=this;e._toggleScreenReaderClass()},_afterSort:function(t){var n=this,r,i,s=t.sortBy[0];i=e.Object.keys(s)[0],r=e.Object.values(s)[0]>0,n.syncCaption(i,r)},_getCaption:function(){var e=this,t=e.get("captionNode");return t.inDoc()||(e.get("tableNode").prepend(t),t.setAttribute("aria-live",e.get("captionLive")),t.setAttribute("role",e.get("captionRole")),e._toggleScreenReaderClass()),t},_toggleScreenReaderClass:function(){var e=this,t=e._getCaption();t.toggleClass(e.get("screenReaderClass"),!e.get("captionVisible"))}},e.Base.mix(e.Plugin.Aria,[r])},"4.2.0",{requires:["aui-aria"]}); diff --git a/build/aui-aria/aui-aria-min.js b/build/aui-aria/aui-aria-min.js index e065c15d7cf..288c54bd0f9 100644 --- a/build/aui-aria/aui-aria-min.js +++ b/build/aui-aria/aui-aria-min.js @@ -1 +1 @@ -YUI.add("aui-aria",function(e,t){var n=e.Lang,r=n.isBoolean,i=n.isFunction,s=n.isObject,o=n.isString,u=/([^a-z])/ig,a=e.cached(function(e){return e.replace(u,function(){return""}).toLowerCase()}),f=e.Component.create({NAME:"aria",NS:"aria",ATTRS:{attributes:{value:{},validator:s},attributeValueFormat:{value:function(e){return e},validator:i},attributeNode:{writeOnce:!0,setter:e.one,valueFn:function(){return this.get("host").get("boundingBox")}},roleName:{valueFn:function(){var e=this,t=e.get("host"),n=a(t.constructor.NAME||"");return e.isValidRole(n)?n:""},validator:o},roleNode:{writeOnce:!0,setter:e.one,valueFn:function(){return this.get("host").get("boundingBox")}},validateW3C:{value:!0,validator:r}},EXTENDS:e.Plugin.Base,prototype:{initializer:function(){var e=this;e.publish("aria:processAttribute",{defaultFn:e._defProcessFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"aria"}),e._uiSetRoleName(e.get("roleName")),e.after("roleNameChange",e._afterRoleNameChange),e._bindHostAttributes()},isValidAttribute:function(t){var n=this;return n.get("validateW3C")?e.Plugin.Aria.W3C_ATTRIBUTES[t]:!0},isValidRole:function(t){var n=this;return n.get("validateW3C")?e.Plugin.Aria.W3C_ROLES[t]:!0},setAttribute:function(e,t,n){var r=this;return r.isValidAttribute(e)?((n||r.get("attributeNode")).set("aria-"+e,t),!0):!1},setAttributes:function(t){var n=this;e.Array.each(t,function(e){n.setAttribute(e.name,e.value,e.node)})},setRole:function(e,t){var n=this;return n.isValidRole(e)?((t||n.get("roleNode")).set("role",e),!0):!1},setRoles:function(t){var n=this;e.Array.each(t,function(e){n.setRole(e.name,e.node)})},_afterHostAttributeChange:function(e){var t=this;t._handleProcessAttribute(e)},_afterRoleNameChange:function(e){var t=this;t._uiSetRoleName(e.newVal)},_bindHostAttributes:function(){var t=this,n=t.get("attributes");e.each(n,function(e,n){var r=t._getAriaAttribute(e,n);t._handleProcessAttribute({aria:r}),t.afterHostEvent(n+"Change",function(e){e.aria=r,t._afterHostAttributeChange(e)})})},_defProcessFn:function(e){var t=this;t._setAttribute(e.aria)},_getAriaAttribute:function(t,n){var r=this,i=r.get("attributeValueFormat"),u={};return o(t)?u=e.merge(u,{ariaName:t,attrName:n,format:i,node:null}):s(t)&&(u=e.mix(t,{ariaName:"",attrName:n,format:i,node:null})),u},_handleProcessAttribute:function(e){var t=this;t.fire("aria:processAttribute",{aria:e.aria})},_setAttribute:function(e){var t=this,n=t.get("host"),r=n.get(e.attrName),s=e.node;i(s)&&(s=s.apply(t,[e])),t.setAttribute(e.ariaName,e.format.apply(t,[r,e]),s)},_uiSetRoleName:function(e){var t=this;t.setRole(e)}}});e.Plugin.Aria=f,e.Plugin.Aria.W3C_ROLES={alert:1,alertdialog:1,application:1,article:1,banner:1,button:1,checkbox:1,columnheader:1,combobox:1,command:1,complementary:1,composite:1,contentinfo:1,definition:1,dialog:1,directory:1,document:1,form:1,grid:1,gridcell:1,group:1,heading:1,img:1,input:1,landmark:1,link:1,list:1,listbox:1,listitem:1,log:1,main:1,marquee:1,math:1,menu:1,menubar:1,menuitem:1,menuitemcheckbox:1,menuitemradio:1,navigation:1,note:1,option:1,presentation:1,progressbar:1,radio:1,radiogroup:1,range:1,region:1,roletype:1,row:1,rowheader:1,scrollbar:1,search:1,section:1,sectionhead:1,select:1,separator:1,slider:1,spinbutton:1,status:1,structure:1,tab:1,tablist:1,tabpanel:1,textbox:1,timer:1,toolbar:1,tooltip:1,tree:1,treegrid:1,treeitem:1,widget:1,window:1},e.Plugin.Aria.W3C_ATTRIBUTES={activedescendant:1,atomic:1,autocomplete:1,busy:1,checked:1,controls:1,describedby:1,disabled:1,dropeffect:1,expanded:1,flowto:1,grabbed:1,haspopup:1,hidden:1,invalid:1,label:1,labelledby:1,level:1,live:1,multiline:1,multiselectable:1,orientation:1,owns:1,posinset:1,pressed:1,readonly:1,relevant:1,required:1,selected:1,setsize:1,sort:1,valuemax:1,valuemin:1,valuenow:1,valuetext:1}},"4.1.1",{requires:["plugin","aui-component"]}); +YUI.add("aui-aria",function(e,t){var n=e.Lang,r=n.isBoolean,i=n.isFunction,s=n.isObject,o=n.isString,u=/([^a-z])/ig,a=e.cached(function(e){return e.replace(u,function(){return""}).toLowerCase()}),f=e.Component.create({NAME:"aria",NS:"aria",ATTRS:{attributes:{value:{},validator:s},attributeValueFormat:{value:function(e){return e},validator:i},attributeNode:{writeOnce:!0,setter:e.one,valueFn:function(){return this.get("host").get("boundingBox")}},roleName:{valueFn:function(){var e=this,t=e.get("host"),n=a(t.constructor.NAME||"");return e.isValidRole(n)?n:""},validator:o},roleNode:{writeOnce:!0,setter:e.one,valueFn:function(){return this.get("host").get("boundingBox")}},validateW3C:{value:!0,validator:r}},EXTENDS:e.Plugin.Base,prototype:{initializer:function(){var e=this;e.publish("aria:processAttribute",{defaultFn:e._defProcessFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"aria"}),e._uiSetRoleName(e.get("roleName")),e.after("roleNameChange",e._afterRoleNameChange),e._bindHostAttributes()},isValidAttribute:function(t){var n=this;return n.get("validateW3C")?e.Plugin.Aria.W3C_ATTRIBUTES[t]:!0},isValidRole:function(t){var n=this;return n.get("validateW3C")?e.Plugin.Aria.W3C_ROLES[t]:!0},setAttribute:function(e,t,n){var r=this;return r.isValidAttribute(e)?((n||r.get("attributeNode")).set("aria-"+e,t),!0):!1},setAttributes:function(t){var n=this;e.Array.each(t,function(e){n.setAttribute(e.name,e.value,e.node)})},setRole:function(e,t){var n=this;return n.isValidRole(e)?((t||n.get("roleNode")).set("role",e),!0):!1},setRoles:function(t){var n=this;e.Array.each(t,function(e){n.setRole(e.name,e.node)})},_afterHostAttributeChange:function(e){var t=this;t._handleProcessAttribute(e)},_afterRoleNameChange:function(e){var t=this;t._uiSetRoleName(e.newVal)},_bindHostAttributes:function(){var t=this,n=t.get("attributes");e.each(n,function(e,n){var r=t._getAriaAttribute(e,n);t._handleProcessAttribute({aria:r}),t.afterHostEvent(n+"Change",function(e){e.aria=r,t._afterHostAttributeChange(e)})})},_defProcessFn:function(e){var t=this;t._setAttribute(e.aria)},_getAriaAttribute:function(t,n){var r=this,i=r.get("attributeValueFormat"),u={};return o(t)?u=e.merge(u,{ariaName:t,attrName:n,format:i,node:null}):s(t)&&(u=e.mix(t,{ariaName:"",attrName:n,format:i,node:null})),u},_handleProcessAttribute:function(e){var t=this;t.fire("aria:processAttribute",{aria:e.aria})},_setAttribute:function(e){var t=this,n=t.get("host"),r=n.get(e.attrName),s=e.node;i(s)&&(s=s.apply(t,[e])),t.setAttribute(e.ariaName,e.format.apply(t,[r,e]),s)},_uiSetRoleName:function(e){var t=this;t.setRole(e)}}});e.Plugin.Aria=f,e.Plugin.Aria.W3C_ROLES={alert:1,alertdialog:1,application:1,article:1,banner:1,button:1,checkbox:1,columnheader:1,combobox:1,command:1,complementary:1,composite:1,contentinfo:1,definition:1,dialog:1,directory:1,document:1,form:1,grid:1,gridcell:1,group:1,heading:1,img:1,input:1,landmark:1,link:1,list:1,listbox:1,listitem:1,log:1,main:1,marquee:1,math:1,menu:1,menubar:1,menuitem:1,menuitemcheckbox:1,menuitemradio:1,navigation:1,note:1,option:1,presentation:1,progressbar:1,radio:1,radiogroup:1,range:1,region:1,roletype:1,row:1,rowheader:1,scrollbar:1,search:1,section:1,sectionhead:1,select:1,separator:1,slider:1,spinbutton:1,status:1,structure:1,tab:1,tablist:1,tabpanel:1,textbox:1,timer:1,toolbar:1,tooltip:1,tree:1,treegrid:1,treeitem:1,widget:1,window:1},e.Plugin.Aria.W3C_ATTRIBUTES={activedescendant:1,atomic:1,autocomplete:1,busy:1,checked:1,controls:1,describedby:1,disabled:1,dropeffect:1,expanded:1,flowto:1,grabbed:1,haspopup:1,hidden:1,invalid:1,label:1,labelledby:1,level:1,live:1,multiline:1,multiselectable:1,orientation:1,owns:1,posinset:1,pressed:1,readonly:1,relevant:1,required:1,selected:1,setsize:1,sort:1,valuemax:1,valuemin:1,valuenow:1,valuetext:1}},"4.2.0",{requires:["plugin","aui-component"]}); diff --git a/build/aui-base-core/aui-base-core-min.js b/build/aui-base-core/aui-base-core-min.js index 32206bcdc6f..9c7505c0464 100644 --- a/build/aui-base-core/aui-base-core-min.js +++ b/build/aui-base-core/aui-base-core-min.js @@ -1,2 +1,2 @@ YUI.add("aui-base-core",function(e,t){var n=e;YUI.Env.aliases=YUI.Env.aliases||{},n.mix(YUI.Env.aliases,{"aui-base":["oop","yui-throttle","aui-classnamemanager","aui-debounce","aui-base-core","aui-base-lang","aui-node-base"],"aui-button":["aui-button-core"],"aui-collection":["aui-map","aui-set","aui-linkedset"],"aui-datatable":["aui-datatable-edit","aui-datatable-highlight","aui-datatable-selection","aui-datatable-property-list"],"aui-datatable-edit":["datatable-base","calendar","overlay","sortable","aui-datatype","aui-toolbar","aui-form-validator","aui-datatable-base-cell-editor","aui-datatable-base-options-cell-editor","aui-datatable-cell-editor-support","aui-datatable-core","aui-datatable-checkbox-cell-editor","aui-datatable-date-cell-editor","aui-datatable-dropdown-cell-editor","aui-datatable-radio-cell-editor","aui-datatable-text-cell-editor","aui-datatable-text-area-cell-editor"],"aui-event":["aui-event-base"],"aui-node":["aui-node-base"],"aui-toggler":["aui-toggler-base","aui-toggler-delegate"],"aui-widget":["aui-widget-cssclass","aui-widget-toolbars"],"aui-widget-core":["aui-widget-cssclass"]}),YUI.Env[n.version].modules=YUI.Env[n.version].modules||{},n.mix(YUI.Env[n.version].modules,{"aui-aria":{requires:["plugin","aui-component"]},"aui-aria-table-sortable":{requires:["aui-aria"]},"aui-base":{use:["oop","yui-throttle","aui-classnamemanager","aui-debounce","aui-base-core","aui-base-lang","aui-node-base"]},"aui-base-core":{},"aui-base-html5-shiv":{condition:{name:"aui-base-html5-shiv",trigger:"node-base",ua:"ie"}},"aui-base-lang":{},"aui-button":{use:["aui-button-core"]},"aui-button-core":{requires:["button","button-group","button-plugin","aui-component","aui-widget-cssclass","aui-widget-toggle"],skinnable:!0},"aui-button-search-cancel":{requires:["array-invoke","base","base-build","event-focus","event-move","event-resize","node-screen","node-event-delegate","aui-node-base","aui-classnamemanager","aui-event-input"]},"aui-button-switch":{requires:["aui-node-base","base-build","event-key","transition","widget"],skinnable:!0},"aui-classnamemanager":{requires:["classnamemanager"]},"aui-collection":{use:["aui-map","aui-set","aui-linkedset"]},"aui-component":{requires:["aui-classnamemanager","aui-widget-cssclass","aui-widget-toggle","base-build","widget-base"]},"aui-css":{type:"css"},"aui-datatable":{use:["aui-datatable-edit","aui-datatable-highlight","aui-datatable-selection","aui-datatable-property-list"]},"aui-datatable-base-cell-editor":{requires:["datatable-base","overlay"],skinnable:!0},"aui-datatable-base-options-cell-editor":{requires:["aui-datatable-base-cell-editor","escape"],skinnable:!0},"aui-datatable-body":{requires:["aui-classnamemanager","datatable-base","event-key","aui-event-base"]},"aui-datatable-cell-editor-support":{requires:["datatable-base"]},"aui-datatable-checkbox-cell-editor":{requires:["aui-datatable-base-options-cell-editor"]},"aui-datatable-core":{requires:["aui-datatable-body","datatable-base","event-key","aui-event-base"],skinnable:!0},"aui-datatable-date-cell-editor":{requires:["aui-datatable-base-options-cell-editor"]},"aui-datatable-dropdown-cell-editor":{requires:["aui-datatable-base-options-cell-editor"]},"aui-datatable-edit":{use:["datatable-base","calendar","overlay","sortable","aui-datatype","aui-toolbar","aui-form-validator","aui-datatable-base-cell-editor","aui-datatable-base-options-cell-editor","aui-datatable-cell-editor-support","aui-datatable-core","aui-datatable-checkbox-cell-editor","aui-datatable-date-cell-editor","aui-datatable-dropdown-cell-editor","aui-datatable-radio-cell-editor","aui-datatable-text-cell-editor","aui-datatable-text-area-cell-editor"]},"aui-datatable-highlight":{requires:["aui-datatable-selection"],skinnable:!0},"aui-datatable-property-list":{requires:["datatable-scroll","datatable-sort","aui-datatable-core","aui-datatable-edit","aui-datatable-highlight","aui-datatable-selection","aui-widget-cssclass","aui-widget-toggle"],skinnable:!0},"aui-datatable-radio-cell-editor":{requires:["aui-datatable-base-options-cell-editor"]},"aui-datatable-selection":{requires:["aui-datatable-core"],skinnable:!0},"aui-datatable-text-area-cell-editor":{requires:["aui-datatable-base-options-cell-editor"]},"aui-datatable-text-cell-editor":{requires:["aui-datatable-base-options-cell-editor"]},"aui-datatype":{requires:["datatype","aui-datatype-date-parse"]},"aui-datatype-date-parse":{requires:["aui-base-lang","datatype-date-format","datatype-date-parse","intl"]},"aui-diagram-builder":{requires:["aui-aria","aui-map","aui-property-builder","aui-diagram-builder-connector","aui-property-builder-settings","aui-diagram-node-condition","aui-diagram-node-end","aui-diagram-node-fork","aui-diagram-node-join","aui-diagram-node-start","aui-diagram-node-state","aui-diagram-node-task","aui-diagram-node-group","overlay"],skinnable:!0},"aui-diagram-builder-connector":{requires:["arraylist-add","arraylist-filter","escape","json","graphics","dd"],skinnable:!0},"aui-diagram-node":{requires:["aui-aria","aui-diagram-node-manager-base","escape","overlay"]},"aui-diagram-node-condition":{requires:["aui-diagram-node-state"]},"aui-diagram-node-end":{requires:["aui-diagram-node-state"]},"aui-diagram-node-fork":{requires:["aui-diagram-node-state"]},"aui-diagram-node-group":{requires:["aui-diagram-node-state"]},"aui-diagram-node-join":{requires:["aui-diagram-node-state"]},"aui-diagram-node-manager-base":{requires:["base"]},"aui-diagram-node-start":{requires:["aui-diagram-node-state"]},"aui-diagram-node-state":{requires:["aui-diagram-node"]},"aui-diagram-node-task":{requires:["aui-diagram-node-state"]},"aui-event":{use:["aui-event-base"]},"aui-event-base":{requires:["event-base"]},"aui-event-delegate-change":{condition:{name:"aui-event-delegate-change",trigger:"event-base-ie",ua:"ie"},requires:["aui-event-base","event-delegate","event-synthetic"]},"aui-event-delegate-submit":{condition:{name:"aui-event-delegate-submit",trigger:"event-base-ie",ua:"ie"},requires:["aui-event-base" -,"event-delegate","event-synthetic"]},"aui-event-input":{condition:{name:"aui-event-input",test:function(e){var t=e.supportsDOMEvent,n=e.Features.test,r=e.Features.add;return n("event","input")===undefined&&r("event","input",{test:function(){return t(document.createElement("textarea"),"input")&&(!e.UA.ie||e.UA.ie>9)}}),!n("event","input")},trigger:"aui-event-base"},requires:["aui-event-base","event-delegate","event-synthetic","timers"]},"aui-form-builder":{requires:["aui-modal","aui-layout","aui-form-builder-field-list","aui-form-builder-field-toolbar","aui-form-builder-field-type","aui-form-builder-field-types","aui-form-builder-layout-builder","aui-form-builder-page-manager","aui-form-builder-settings-modal","event-focus","event-tap"],skinnable:!0},"aui-form-builder-field-base":{requires:["aui-classnamemanager","aui-node-base","aui-text-data-editor","aui-toggler","base","node-base"],skinnable:!0},"aui-form-builder-field-choice":{requires:["aui-boolean-data-editor","aui-options-data-editor","aui-tabs-data-editor","aui-form-builder-field-base","aui-form-field-choice"]},"aui-form-builder-field-list":{requires:["aui-form-builder-field-type","aui-form-builder-field-types","aui-form-builder-layout-builder"],skinnable:!0},"aui-form-builder-field-sentence":{requires:["aui-form-builder-field-base","aui-form-field"]},"aui-form-builder-field-text":{requires:["aui-boolean-data-editor","aui-radio-group-data-editor","aui-form-builder-field-base","aui-form-field-text"]},"aui-form-builder-field-toolbar":{requires:["aui-classnamemanager","base","node-base"],skinnable:!0},"aui-form-builder-field-type":{requires:["base","node-base"],skinnable:!0},"aui-form-builder-field-types":{requires:["aui-classnamemanager","aui-form-builder-field-types-modal","base","node-base"],skinnable:!0},"aui-form-builder-field-types-modal":{requires:["aui-modal"],skinnable:!0},"aui-form-builder-layout-builder":{requires:["aui-classnamemanager","aui-layout-builder","aui-modal","base","node-base"],skinnable:!0},"aui-form-builder-page-manager":{requires:["aui-pagination","aui-popover","aui-tabview","base","event-valuechange","node-base"],skinnable:!0},"aui-form-builder-settings-modal":{requires:["aui-classnamemanager","aui-modal","base","node-base"],skinnable:!0},"aui-form-field":{requires:["aui-classnamemanager","aui-node-base","base-build"],skinnable:!0},"aui-form-field-choice":{requires:["aui-form-field-required"],skinnable:!0},"aui-form-field-required":{requires:["aui-form-field"]},"aui-form-field-text":{requires:["aui-form-field-required"],skinnable:!0},"aui-form-validator":{requires:["escape","selector-css3","node-event-delegate","aui-node","aui-component","aui-event-input"]},"aui-linkedset":{requires:["aui-set"]},"aui-map":{requires:["base-build"]},"aui-node":{use:["aui-node-base"]},"aui-node-accessible":{requires:["aui-node-base","event-custom-base"]},"aui-node-base":{requires:["array-extras","aui-base-lang","aui-classnamemanager","aui-debounce","node"]},"aui-node-html5":{condition:{name:"aui-node-html5",trigger:"aui-node",ua:"ie"},requires:["collection","aui-node-base"]},"aui-property-builder":{requires:["dd","collection","aui-property-builder-available-field","aui-property-builder-field-support","aui-property-builder-settings","aui-tabview"],skinnable:!0},"aui-property-builder-available-field":{requires:["base","aui-component","aui-node"]},"aui-property-builder-field-support":{},"aui-property-builder-settings":{requires:["aui-tabview","aui-datatable-property-list"]},"aui-set":{requires:["aui-map"]},"aui-tabview":{requires:["selector-css3","tabview","aui-component","aui-widget-css"],skinnable:!0},"aui-toggler":{use:["aui-toggler-base","aui-toggler-delegate"]},"aui-toggler-accessibility":{requires:["aui-toggler-base"]},"aui-toggler-base":{requires:["transition","aui-selector","aui-event-base","aui-node","aui-component","event-tap"],skinnable:!0},"aui-toggler-delegate":{requires:["array-invoke","node-event-delegate","aui-toggler-base"]},"aui-toolbar":{requires:["arraylist","arraylist-add","aui-component","aui-button-core"]},"aui-widget":{use:["aui-widget-cssclass","aui-widget-toolbars"]},"aui-widget-core":{use:["aui-widget-cssclass"]},"aui-widget-cssclass":{requires:["widget-base"]},"aui-widget-position-align-suggestion":{requires:["widget-position-align","widget-stdmod"]},"aui-widget-responsive":{requires:["event-resize","widget-base"]},"aui-widget-shortcut":{requires:["base"]},"aui-widget-swipe":{requires:["classnamemanager","scrollview-base","scrollview-paginator","timers"]},"aui-widget-toggle":{},"aui-widget-toolbars":{requires:["widget-stdmod","aui-toolbar"]},"aui-widget-transition":{requires:["transition"]},"aui-widget-trigger":{requires:["node"]}}),YUI.Env[n.version].md5="1d62d4c2795aab25e1361c26968f0c27",e.UA.edge=function(){var t=e.UA.userAgent.match(/Edge\/(.[0-9.]+)/);return t?t[1]:0}(),e.supportsDOMEvent=function(t,n){n="on"+n;if(!(n in t)){t.setAttribute||(t=e.config.doc.createElement("div"));if(t.setAttribute)return t.setAttribute(n,""),typeof t[n]=="function"}return t=null,!0},function(){var e=Array.prototype.slice;YUI.prototype.ready=function(){var t=this,n=arguments,r=n.length-1,i=e.call(arguments,0,r);i.unshift("event-base"),i.push(function(e){var t=arguments;e.on("domready",function(){n[r].apply(this,t)})}),t.use.apply(t,i)}}()},"4.1.1"); +,"event-delegate","event-synthetic"]},"aui-event-input":{condition:{name:"aui-event-input",test:function(e){var t=e.supportsDOMEvent,n=e.Features.test,r=e.Features.add;return n("event","input")===undefined&&r("event","input",{test:function(){return t(document.createElement("textarea"),"input")&&(!e.UA.ie||e.UA.ie>9)}}),!n("event","input")},trigger:"aui-event-base"},requires:["aui-event-base","event-delegate","event-synthetic","timers"]},"aui-form-builder":{requires:["aui-modal","aui-layout","aui-form-builder-field-list","aui-form-builder-field-toolbar","aui-form-builder-field-type","aui-form-builder-field-types","aui-form-builder-layout-builder","aui-form-builder-page-manager","aui-form-builder-settings-modal","event-focus","event-tap"],skinnable:!0},"aui-form-builder-field-base":{requires:["aui-classnamemanager","aui-node-base","aui-text-data-editor","aui-toggler","base","node-base"],skinnable:!0},"aui-form-builder-field-choice":{requires:["aui-boolean-data-editor","aui-options-data-editor","aui-tabs-data-editor","aui-form-builder-field-base","aui-form-field-choice"]},"aui-form-builder-field-list":{requires:["aui-form-builder-field-type","aui-form-builder-field-types","aui-form-builder-layout-builder"],skinnable:!0},"aui-form-builder-field-sentence":{requires:["aui-form-builder-field-base","aui-form-field"]},"aui-form-builder-field-text":{requires:["aui-boolean-data-editor","aui-radio-group-data-editor","aui-form-builder-field-base","aui-form-field-text"]},"aui-form-builder-field-toolbar":{requires:["aui-classnamemanager","base","node-base"],skinnable:!0},"aui-form-builder-field-type":{requires:["base","node-base"],skinnable:!0},"aui-form-builder-field-types":{requires:["aui-classnamemanager","aui-form-builder-field-types-modal","base","node-base"],skinnable:!0},"aui-form-builder-field-types-modal":{requires:["aui-modal"],skinnable:!0},"aui-form-builder-layout-builder":{requires:["aui-classnamemanager","aui-layout-builder","aui-modal","base","node-base"],skinnable:!0},"aui-form-builder-page-manager":{requires:["aui-pagination","aui-popover","aui-tabview","base","event-valuechange","node-base"],skinnable:!0},"aui-form-builder-settings-modal":{requires:["aui-classnamemanager","aui-modal","base","node-base"],skinnable:!0},"aui-form-field":{requires:["aui-classnamemanager","aui-node-base","base-build"],skinnable:!0},"aui-form-field-choice":{requires:["aui-form-field-required"],skinnable:!0},"aui-form-field-required":{requires:["aui-form-field"]},"aui-form-field-text":{requires:["aui-form-field-required"],skinnable:!0},"aui-form-validator":{requires:["escape","selector-css3","node-event-delegate","aui-node","aui-component","aui-event-input"]},"aui-linkedset":{requires:["aui-set"]},"aui-map":{requires:["base-build"]},"aui-node":{use:["aui-node-base"]},"aui-node-accessible":{requires:["aui-node-base","event-custom-base"]},"aui-node-base":{requires:["array-extras","aui-base-lang","aui-classnamemanager","aui-debounce","node"]},"aui-node-html5":{condition:{name:"aui-node-html5",trigger:"aui-node",ua:"ie"},requires:["collection","aui-node-base"]},"aui-property-builder":{requires:["dd","collection","aui-property-builder-available-field","aui-property-builder-field-support","aui-property-builder-settings","aui-tabview"],skinnable:!0},"aui-property-builder-available-field":{requires:["base","aui-component","aui-node"]},"aui-property-builder-field-support":{},"aui-property-builder-settings":{requires:["aui-tabview","aui-datatable-property-list"]},"aui-set":{requires:["aui-map"]},"aui-tabview":{requires:["selector-css3","tabview","aui-component","aui-widget-css"],skinnable:!0},"aui-toggler":{use:["aui-toggler-base","aui-toggler-delegate"]},"aui-toggler-accessibility":{requires:["aui-toggler-base"]},"aui-toggler-base":{requires:["transition","aui-selector","aui-event-base","aui-node","aui-component","event-tap"],skinnable:!0},"aui-toggler-delegate":{requires:["array-invoke","node-event-delegate","aui-toggler-base"]},"aui-toolbar":{requires:["arraylist","arraylist-add","aui-component","aui-button-core"]},"aui-widget":{use:["aui-widget-cssclass","aui-widget-toolbars"]},"aui-widget-core":{use:["aui-widget-cssclass"]},"aui-widget-cssclass":{requires:["widget-base"]},"aui-widget-position-align-suggestion":{requires:["widget-position-align","widget-stdmod"]},"aui-widget-responsive":{requires:["event-resize","widget-base"]},"aui-widget-shortcut":{requires:["base"]},"aui-widget-swipe":{requires:["classnamemanager","scrollview-base","scrollview-paginator","timers"]},"aui-widget-toggle":{},"aui-widget-toolbars":{requires:["widget-stdmod","aui-toolbar"]},"aui-widget-transition":{requires:["transition"]},"aui-widget-trigger":{requires:["node"]}}),YUI.Env[n.version].md5="1d62d4c2795aab25e1361c26968f0c27",e.UA.edge=function(){var t=e.UA.userAgent.match(/Edge\/(.[0-9.]+)/);return t?t[1]:0}(),e.supportsDOMEvent=function(t,n){n="on"+n;if(!(n in t)){t.setAttribute||(t=e.config.doc.createElement("div"));if(t.setAttribute)return t.setAttribute(n,""),typeof t[n]=="function"}return t=null,!0},function(){var e=Array.prototype.slice;YUI.prototype.ready=function(){var t=this,n=arguments,r=n.length-1,i=e.call(arguments,0,r);i.unshift("event-base"),i.push(function(e){var t=arguments;e.on("domready",function(){n[r].apply(this,t)})}),t.use.apply(t,i)}}()},"4.2.0"); diff --git a/build/aui-base-html5-shiv/aui-base-html5-shiv-min.js b/build/aui-base-html5-shiv/aui-base-html5-shiv-min.js index 68779d5f169..e9ad069f1fe 100644 --- a/build/aui-base-html5-shiv/aui-base-html5-shiv-min.js +++ b/build/aui-base-html5-shiv/aui-base-html5-shiv-min.js @@ -1 +1 @@ -YUI.add("aui-base-html5-shiv",function(e,t){e.HTML5_ELEMENTS=["abbr","article","aside","audio","canvas","command","datalist","details","figure","figcaption","footer","header","hgroup","keygen","mark","meter","nav","output","progress","section","source","summary","time","video"],e.html5shiv=function(t){var n=t||e.config.doc;if(e.UA.ie&&n&&n.createElement){var r=e.HTML5_ELEMENTS,i=r.length;while(i--)n.createElement(r[i])}return t}},"4.1.1"); +YUI.add("aui-base-html5-shiv",function(e,t){e.HTML5_ELEMENTS=["abbr","article","aside","audio","canvas","command","datalist","details","figure","figcaption","footer","header","hgroup","keygen","mark","meter","nav","output","progress","section","source","summary","time","video"],e.html5shiv=function(t){var n=t||e.config.doc;if(e.UA.ie&&n&&n.createElement){var r=e.HTML5_ELEMENTS,i=r.length;while(i--)n.createElement(r[i])}return t}},"4.2.0"); diff --git a/build/aui-base-lang/aui-base-lang-min.js b/build/aui-base-lang/aui-base-lang-min.js index dd6193c8e8a..06f91ffe2fd 100644 --- a/build/aui-base-lang/aui-base-lang-min.js +++ b/build/aui-base-lang/aui-base-lang-min.js @@ -1 +1 @@ -YUI.add("aui-base-lang",function(e,t){(function(){var t=e.Lang,n=e.Array,r=e.Object,i=t.isArray,s=t.isNumber,o=t.isString,u=t.isUndefined,a=r.owns;e.fn=function(e,t,r){var i,u;if(!s(e)){var a=arguments;a.length>2&&(a=n(a,2,!0)),u=o(e)&&t,i=function(){var n=u?t[e]:e;return n.apply(t||e,a)}}else{var f=e;e=t,t=r,u=o(e)&&t,i=function(){var r=u?t[e]:e,i;return t=t||r,f>0?i=r.apply(t,n(arguments,0,!0).slice(0,f)):i=r.call(t),i}}return i},e.mix(t,{constrain:function(e,t,n){return Math.min(Math.max(e,t),n)},emptyFn:function(){},emptyFnFalse:function(){return!1},emptyFnTrue:function(){return!0},isGuid:function(t){return String(t).indexOf(e.Env._guidp)===0},isInteger:function(e){return typeof e=="number"&&isFinite(e)&&e>-9007199254740992&&e<9007199254740992&&Math.floor(e)===e},isNode:function(t){return e.instanceOf(t,e.Node)},isNodeList:function(t){return e.instanceOf(t,e.NodeList)},toFloat:function(e,t){return parseFloat(e)||t||0},toInt:function(e,t,n){return parseInt(e,t||10)||n||0}}),e.mix(n,{remove:function(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,r)},removeItem:function(e,t){var r=n.indexOf(e,t);return r>-1?n.remove(e,r):e}});var f=e.namespace("Lang.String"),l=e.config.doc,c=/-([a-z])/gi,h=/([.*+?^$(){}|[\]\/\\])/g,p=/\r?\n/g,d=/(?:)((\n|\r|.)*?)(?:<\/script>)/gi,v=/<\/?[^>]+>/gi,m=/([a-zA-Z][a-zA-Z])([A-Z])([a-z])/g,g=/([a-z])([A-Z])/g,y="...",b=[],w={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"},E,S={};for(E in w)if(w.hasOwnProperty(E)){var x=w[E];S[x]=E,b.push(E)}var T=new RegExp("["+b.join("")+"]","g"),N=/&([^;]+);/g;e.mix(f,{camelize:e.cached(function(e,t){var n=c;return e=String(e),t&&(n=new RegExp(t+"([a-z])","gi")),e.replace(n,f._camelize)}),capitalize:e.cached(function(e){return e&&(e=String(e),e=e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),e}),contains:function(e,t){return e.indexOf(t)!==-1},defaultValue:function(e,t){if(u(e)||e==="")u(t)&&(t=""),e=t;return e},endsWith:function(e,t){var n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n},escapeHTML:function(e){return e.replace(T,f._escapeHTML)},escapeRegEx:function(e){return e.replace(h,"\\$1")},nl2br:function(e){return String(e).replace(p,"
")},padNumber:function(e,t,n){var r=n?Number(e).toFixed(n):String(e),i=r.indexOf(".");return i===-1&&(i=r.length),f.repeat("0",Math.max(0,t-i))+r},pluralize:function(e,t,n){var r;return e===1?r=t:r=n||t+"s",e+" "+r},prefix:function(e,t){return t=String(t),t.indexOf(e)!==0&&(t=e+t),t},remove:function(e,t,n){var r=new RegExp(f.escapeRegEx(t),n?"g":"");return e.replace(r,"")},removeAll:function(e,t){return f.remove(e,t,!0)},repeat:function(e,t){return(new Array(t+1)).join(e)},round:function(e,t){return e=Number(e),s(t)&&(t=Math.pow(10,t),e=Math.round(e*t)/t),e},startsWith:function(e,t){return e.lastIndexOf(t,0)===0},stripScripts:function(e){return e&&(e=String(e).replace(d,"")),e},stripTags:function(e){return e&&(e=String(e).replace(v,"")),e},substr:function(e,t,n){return String(e).substr(t,n)},uncamelize:e.cached(function(e,t){return t=t||" ",e=String(e),e=e.replace(m,"$1"+t+"$2$3"),e=e.replace(g,"$1"+t+"$2"),e}),toLowerCase:function(e){return String(e).toLowerCase()},toUpperCase:function(e){return String(e).toUpperCase()},trim:t.trim,truncate:function(e,t,n){e=String(e);var r=y.length,i=e.length;if(t>3){if(e&&i>t){n=n||"end";if(n==="end")e=e.substr(0,t-r)+y;else if(n==="middle"){var s=Math.floor((t-r)/2),o=s;t%2===0&&(s=Math.ceil((t-r)/2),o=Math.floor((t-r)/2)),e=e.substr(0,s)+y+e.substr(i-o)}else n==="start"&&(e=y+e.substr(i-t+r))}}else e=y;return e},undef:function(e){return u(e)&&(e=""),e},unescapeEntities:function(e){return f.contains(e,"&")&&(l&&!f.contains(e,"<")?e=f._unescapeEntitiesUsingDom(e):e=f.unescapeHTML(e)),e},unescapeHTML:function(e){return e.replace(N,f._unescapeHTML)},_camelize:function(e,t){return t.toUpperCase()},_escapeHTML:function(e){return w[e]},_unescapeHTML:function(e,t){var n=S[e]||e;if(!n&&t.charAt(0)==="#"){var r=Number("0"+n.substr(1));isNaN(r)||(n=String.fromCharCode(r))}return n},_unescapeEntitiesUsingDom:function(e){var t=l.createElement("a");return t.innerHTML=e,t.normalize&&t.normalize(),e=t.firstChild.nodeValue,t.innerHTML="",e}}),r.map=function(e,t,n){var r=[],i;for(i in e)a(e,i)&&(r[r.length]=t.call(n,e[i],i,e));return r},e.map=function(e){var t=r;return i(e)&&(t=n),t.map.apply(this,arguments)}})()},"4.1.1"); +YUI.add("aui-base-lang",function(e,t){(function(){var t=e.Lang,n=e.Array,r=e.Object,i=t.isArray,s=t.isNumber,o=t.isString,u=t.isUndefined,a=r.owns;e.fn=function(e,t,r){var i,u;if(!s(e)){var a=arguments;a.length>2&&(a=n(a,2,!0)),u=o(e)&&t,i=function(){var n=u?t[e]:e;return n.apply(t||e,a)}}else{var f=e;e=t,t=r,u=o(e)&&t,i=function(){var r=u?t[e]:e,i;return t=t||r,f>0?i=r.apply(t,n(arguments,0,!0).slice(0,f)):i=r.call(t),i}}return i},e.mix(t,{constrain:function(e,t,n){return Math.min(Math.max(e,t),n)},emptyFn:function(){},emptyFnFalse:function(){return!1},emptyFnTrue:function(){return!0},isGuid:function(t){return String(t).indexOf(e.Env._guidp)===0},isInteger:function(e){return typeof e=="number"&&isFinite(e)&&e>-9007199254740992&&e<9007199254740992&&Math.floor(e)===e},isNode:function(t){return e.instanceOf(t,e.Node)},isNodeList:function(t){return e.instanceOf(t,e.NodeList)},toFloat:function(e,t){return parseFloat(e)||t||0},toInt:function(e,t,n){return parseInt(e,t||10)||n||0}}),e.mix(n,{remove:function(e,t,n){var r=e.slice((n||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,r)},removeItem:function(e,t){var r=n.indexOf(e,t);return r>-1?n.remove(e,r):e}});var f=e.namespace("Lang.String"),l=e.config.doc,c=/-([a-z])/gi,h=/([.*+?^$(){}|[\]\/\\])/g,p=/\r?\n/g,d=/(?:)((\n|\r|.)*?)(?:<\/script>)/gi,v=/<\/?[^>]+>/gi,m=/([a-zA-Z][a-zA-Z])([A-Z])([a-z])/g,g=/([a-z])([A-Z])/g,y="...",b=[],w={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"},E,S={};for(E in w)if(w.hasOwnProperty(E)){var x=w[E];S[x]=E,b.push(E)}var T=new RegExp("["+b.join("")+"]","g"),N=/&([^;]+);/g;e.mix(f,{camelize:e.cached(function(e,t){var n=c;return e=String(e),t&&(n=new RegExp(t+"([a-z])","gi")),e.replace(n,f._camelize)}),capitalize:e.cached(function(e){return e&&(e=String(e),e=e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()),e}),contains:function(e,t){return e.indexOf(t)!==-1},defaultValue:function(e,t){if(u(e)||e==="")u(t)&&(t=""),e=t;return e},endsWith:function(e,t){var n=e.length-t.length;return n>=0&&e.indexOf(t,n)===n},escapeHTML:function(e){return e.replace(T,f._escapeHTML)},escapeRegEx:function(e){return e.replace(h,"\\$1")},nl2br:function(e){return String(e).replace(p,"
")},padNumber:function(e,t,n){var r=n?Number(e).toFixed(n):String(e),i=r.indexOf(".");return i===-1&&(i=r.length),f.repeat("0",Math.max(0,t-i))+r},pluralize:function(e,t,n){var r;return e===1?r=t:r=n||t+"s",e+" "+r},prefix:function(e,t){return t=String(t),t.indexOf(e)!==0&&(t=e+t),t},remove:function(e,t,n){var r=new RegExp(f.escapeRegEx(t),n?"g":"");return e.replace(r,"")},removeAll:function(e,t){return f.remove(e,t,!0)},repeat:function(e,t){return(new Array(t+1)).join(e)},round:function(e,t){return e=Number(e),s(t)&&(t=Math.pow(10,t),e=Math.round(e*t)/t),e},startsWith:function(e,t){return e.lastIndexOf(t,0)===0},stripScripts:function(e){return e&&(e=String(e).replace(d,"")),e},stripTags:function(e){return e&&(e=String(e).replace(v,"")),e},substr:function(e,t,n){return String(e).substr(t,n)},uncamelize:e.cached(function(e,t){return t=t||" ",e=String(e),e=e.replace(m,"$1"+t+"$2$3"),e=e.replace(g,"$1"+t+"$2"),e}),toLowerCase:function(e){return String(e).toLowerCase()},toUpperCase:function(e){return String(e).toUpperCase()},trim:t.trim,truncate:function(e,t,n){e=String(e);var r=y.length,i=e.length;if(t>3){if(e&&i>t){n=n||"end";if(n==="end")e=e.substr(0,t-r)+y;else if(n==="middle"){var s=Math.floor((t-r)/2),o=s;t%2===0&&(s=Math.ceil((t-r)/2),o=Math.floor((t-r)/2)),e=e.substr(0,s)+y+e.substr(i-o)}else n==="start"&&(e=y+e.substr(i-t+r))}}else e=y;return e},undef:function(e){return u(e)&&(e=""),e},unescapeEntities:function(e){return f.contains(e,"&")&&(l&&!f.contains(e,"<")?e=f._unescapeEntitiesUsingDom(e):e=f.unescapeHTML(e)),e},unescapeHTML:function(e){return e.replace(N,f._unescapeHTML)},_camelize:function(e,t){return t.toUpperCase()},_escapeHTML:function(e){return w[e]},_unescapeHTML:function(e,t){var n=S[e]||e;if(!n&&t.charAt(0)==="#"){var r=Number("0"+n.substr(1));isNaN(r)||(n=String.fromCharCode(r))}return n},_unescapeEntitiesUsingDom:function(e){var t=l.createElement("a");return t.innerHTML=e,t.normalize&&t.normalize(),e=t.firstChild.nodeValue,t.innerHTML="",e}}),r.map=function(e,t,n){var r=[],i;for(i in e)a(e,i)&&(r[r.length]=t.call(n,e[i],i,e));return r},e.map=function(e){var t=r;return i(e)&&(t=n),t.map.apply(this,arguments)}})()},"4.2.0"); diff --git a/build/aui-button-core/aui-button-core-min.js b/build/aui-button-core/aui-button-core-min.js index f9be607a382..d1aafe480f4 100644 --- a/build/aui-button-core/aui-button-core-min.js +++ b/build/aui-button-core/aui-button-core-min.js @@ -1 +1 @@ -YUI.add("aui-button-core",function(e,t){var n={BUTTON:e.getClassName("btn"),BUTTON_DEFAULT:e.getClassName("btn","default"),BUTTON_GROUP:e.getClassName("btn","group"),DISABLED:e.getClassName("disabled"),LABEL:e.getClassName("label"),PRIMARY:e.getClassName("btn","primary"),SELECTED:e.getClassName("active"),TOGGLE:e.getClassName("togglebtn")},r=function(e){e&&e.domType&&this._domTypeValidator(e.domType)&&this._setEarlyButtonDomType(e.domType)};r.ATTRS={cssClass:{validator:e.Lang.isString,value:""},discardDefaultButtonCssClasses:{validator:e.Lang.isBoolean,value:!1,writeOnce:!0},domType:{validator:"_domTypeValidator",writeOnce:!0},icon:{},iconElement:{valueFn:function(){return e.Node.create(this.ICON_TEMPLATE)}},iconAlign:{validator:e.Lang.isString,value:"left"}},r.HTML_PARSER={iconElement:"span"},r.getTypedButtonTemplate=function(t,n){return e.Lang.sub(t,{type:' type="'+n+'"'})},r.prototype={ICON_TEMPLATE:"",TEMPLATE:"",initializer:function(){this.before(this.renderButtonExtUI,this,"renderUI"),this.after(this.syncButtonExtUI,this,"syncUI"),this.after({iconChange:this._afterIconChange,iconAlignChange:this._afterIconAlignChange})},renderButtonExtUI:function(){var e=this.get("cssClass");this.get("discardDefaultButtonCssClasses")||(e=[e,n.BUTTON_DEFAULT,n.BUTTON].join(" "),this.set("cssClass",e))},syncButtonExtUI:function(){this._uiSetIcon(this.get("icon")),this._setButtonRole()},_afterIconAlignChange:function(e){this._uiSetIconAlign(e.newVal)},_afterIconChange:function(e){this._uiSetIcon(e.newVal)},_domTypeValidator:function(e){return e.toLowerCase()==="button"||e.toLowerCase()==="submit"},_setButtonRole:function(){this.get("boundingBox").setAttribute("role","button")},_setEarlyButtonDomType:function(t){this.BOUNDING_TEMPLATE=e.ButtonExt.getTypedButtonTemplate(r.prototype.TEMPLATE,t)},_uiSetIcon:function(e){e&&(this.get("iconElement").set("className",e),this._uiSetIconAlign(this.get("iconAlign")))},_uiSetIconAlign:function(t){var n=this.getNode().one(e.ButtonExt.HTML_PARSER.iconElement);n||(n=this.get("iconElement")),e.Button.syncIconUI(this.get("boundingBox"),n,t)}},e.ButtonExt=r,e.ButtonCore.CLASS_NAMES=n;var i=e.Button;i.NAME="aui-button",i.CSS_PREFIX="aui-button",i.CLASS_NAMES=n,e.Button=e.Base.create(i.NAME,i,[r,e.WidgetCssClass,e.WidgetToggle],{},{getWidgetLazyConstructorFromNodeData:function(e){var t=e.getData("widgetConstructor")||{};return t.boundingBox=e,t.render=!0,t},hasWidgetLazyConstructorData:function(e){return e.getData("widgetConstructor")!==undefined},setWidgetLazyConstructorNodeData:function(e,t){e.setData("widgetConstructor",t)},syncIconUI:function(t,n,r){var i=0,s=e.config.doc.createTextNode(" ");r==="right"&&(i=null),t.insert(s,i),t.insert(n,i)}});var s=e.ToggleButton;s.NAME="togglebtn",s.CSS_PREFIX=n.TOGGLE,s.CLASS_NAMES=n,e.ToggleButton=e.Base.create(s.NAME,s,[r,e.WidgetCssClass],{},{});var o=e.ButtonGroup;o.NAME="btngroup",o.CSS_PREFIX=n.BUTTON_GROUP,o.CLASS_NAMES=n,e.mix(o.prototype,{CONTENT_TEMPLATE:null,initializer:function(){this.after("selectionChange",this._afterSelectionChange)},renderUI:function(){var t=this.get("boundingBox"),n=this.get("type");this.getButtons().each(function(t){!t.button&&!e.instanceOf(e.Widget.getByNode(t),e.Button)&&(t.addClass(e.ButtonCore.CLASS_NAMES.BUTTON_DEFAULT),t.setAttribute("role","option"),e.Button.hasWidgetLazyConstructorData(t)?(new e.Button(e.Button.getWidgetLazyConstructorFromNodeData(t)),e.Button.setWidgetLazyConstructorNodeData(t,null)):t.plug(e.Plugin.Button))}),t.setAttrs({"aria-multiselectable":n==="checkbox"?!0:!1,role:"listbox"}),this.syncAriaSelected(this.getButtons())},item:function(t){var n,r;return r=this.getButtons().item(t),n=e.Widget.getByNode(r),e.instanceOf(n,i)?n:r},select:function(e){return this.toggleSelect(e,!0)},syncAriaSelected:function(t){var n;t.each(function(t){n=t.hasClass(e.ButtonGroup.CLASS_NAMES.SELECTED),t.setAttribute("aria-selected",n)})},toggleSelect:function(t,n){var r=this.getButtons(),i=this,s=this.get("type");e.Lang.isUndefined(t)&&(t=r.getDOMNodes()),e.Lang.isArray(t)||(t=e.Array(t)),e.Array.each(t,function(t){e.Lang.isNumber(t)&&(t=r.item(t)),t=e.one(t);if(s==="checkbox")if(t.hasClass(e.ButtonGroup.CLASS_NAMES.SELECTED)){if(n===!0)return}else if(n===!1)return;i._handleClick({target:t})})},unselect:function(e){return this.toggleSelect(e,!1)},_afterSelectionChange:function(){this.syncAriaSelected(this.getButtons())}},!0)},"4.1.1",{requires:["button","button-group","button-plugin","aui-component","aui-widget-cssclass","aui-widget-toggle"],skinnable:!0}); +YUI.add("aui-button-core",function(e,t){var n={BUTTON:e.getClassName("btn"),BUTTON_DEFAULT:e.getClassName("btn","default"),BUTTON_GROUP:e.getClassName("btn","group"),DISABLED:e.getClassName("disabled"),LABEL:e.getClassName("label"),PRIMARY:e.getClassName("btn","primary"),SELECTED:e.getClassName("active"),TOGGLE:e.getClassName("togglebtn")},r=function(e){e&&e.domType&&this._domTypeValidator(e.domType)&&this._setEarlyButtonDomType(e.domType)};r.ATTRS={cssClass:{validator:e.Lang.isString,value:""},discardDefaultButtonCssClasses:{validator:e.Lang.isBoolean,value:!1,writeOnce:!0},domType:{validator:"_domTypeValidator",writeOnce:!0},icon:{},iconElement:{valueFn:function(){return e.Node.create(this.ICON_TEMPLATE)}},iconAlign:{validator:e.Lang.isString,value:"left"}},r.HTML_PARSER={iconElement:"span"},r.getTypedButtonTemplate=function(t,n){return e.Lang.sub(t,{type:' type="'+n+'"'})},r.prototype={ICON_TEMPLATE:"",TEMPLATE:"",initializer:function(){this.before(this.renderButtonExtUI,this,"renderUI"),this.after(this.syncButtonExtUI,this,"syncUI"),this.after({iconChange:this._afterIconChange,iconAlignChange:this._afterIconAlignChange})},renderButtonExtUI:function(){var e=this.get("cssClass");this.get("discardDefaultButtonCssClasses")||(e=[e,n.BUTTON_DEFAULT,n.BUTTON].join(" "),this.set("cssClass",e))},syncButtonExtUI:function(){this._uiSetIcon(this.get("icon")),this._setButtonRole()},_afterIconAlignChange:function(e){this._uiSetIconAlign(e.newVal)},_afterIconChange:function(e){this._uiSetIcon(e.newVal)},_domTypeValidator:function(e){return e.toLowerCase()==="button"||e.toLowerCase()==="submit"},_setButtonRole:function(){this.get("boundingBox").setAttribute("role","button")},_setEarlyButtonDomType:function(t){this.BOUNDING_TEMPLATE=e.ButtonExt.getTypedButtonTemplate(r.prototype.TEMPLATE,t)},_uiSetIcon:function(e){e&&(this.get("iconElement").set("className",e),this._uiSetIconAlign(this.get("iconAlign")))},_uiSetIconAlign:function(t){var n=this.getNode().one(e.ButtonExt.HTML_PARSER.iconElement);n||(n=this.get("iconElement")),e.Button.syncIconUI(this.get("boundingBox"),n,t)}},e.ButtonExt=r,e.ButtonCore.CLASS_NAMES=n;var i=e.Button;i.NAME="aui-button",i.CSS_PREFIX="aui-button",i.CLASS_NAMES=n,e.Button=e.Base.create(i.NAME,i,[r,e.WidgetCssClass,e.WidgetToggle],{},{getWidgetLazyConstructorFromNodeData:function(e){var t=e.getData("widgetConstructor")||{};return t.boundingBox=e,t.render=!0,t},hasWidgetLazyConstructorData:function(e){return e.getData("widgetConstructor")!==undefined},setWidgetLazyConstructorNodeData:function(e,t){e.setData("widgetConstructor",t)},syncIconUI:function(t,n,r){var i=0,s=e.config.doc.createTextNode(" ");r==="right"&&(i=null),t.insert(s,i),t.insert(n,i)}});var s=e.ToggleButton;s.NAME="togglebtn",s.CSS_PREFIX=n.TOGGLE,s.CLASS_NAMES=n,e.ToggleButton=e.Base.create(s.NAME,s,[r,e.WidgetCssClass],{},{});var o=e.ButtonGroup;o.NAME="btngroup",o.CSS_PREFIX=n.BUTTON_GROUP,o.CLASS_NAMES=n,e.mix(o.prototype,{CONTENT_TEMPLATE:null,initializer:function(){this.after("selectionChange",this._afterSelectionChange)},renderUI:function(){var t=this.get("boundingBox"),n=this.get("type");this.getButtons().each(function(t){!t.button&&!e.instanceOf(e.Widget.getByNode(t),e.Button)&&(t.addClass(e.ButtonCore.CLASS_NAMES.BUTTON_DEFAULT),t.setAttribute("role","option"),e.Button.hasWidgetLazyConstructorData(t)?(new e.Button(e.Button.getWidgetLazyConstructorFromNodeData(t)),e.Button.setWidgetLazyConstructorNodeData(t,null)):t.plug(e.Plugin.Button))}),t.setAttrs({"aria-multiselectable":n==="checkbox"?!0:!1,role:"listbox"}),this.syncAriaSelected(this.getButtons())},item:function(t){var n,r;return r=this.getButtons().item(t),n=e.Widget.getByNode(r),e.instanceOf(n,i)?n:r},select:function(e){return this.toggleSelect(e,!0)},syncAriaSelected:function(t){var n;t.each(function(t){n=t.hasClass(e.ButtonGroup.CLASS_NAMES.SELECTED),t.setAttribute("aria-selected",n)})},toggleSelect:function(t,n){var r=this.getButtons(),i=this,s=this.get("type");e.Lang.isUndefined(t)&&(t=r.getDOMNodes()),e.Lang.isArray(t)||(t=e.Array(t)),e.Array.each(t,function(t){e.Lang.isNumber(t)&&(t=r.item(t)),t=e.one(t);if(s==="checkbox")if(t.hasClass(e.ButtonGroup.CLASS_NAMES.SELECTED)){if(n===!0)return}else if(n===!1)return;i._handleClick({target:t})})},unselect:function(e){return this.toggleSelect(e,!1)},_afterSelectionChange:function(){this.syncAriaSelected(this.getButtons())}},!0)},"4.2.0",{requires:["button","button-group","button-plugin","aui-component","aui-widget-cssclass","aui-widget-toggle"],skinnable:!0}); diff --git a/build/aui-button-search-cancel/aui-button-search-cancel-min.js b/build/aui-button-search-cancel/aui-button-search-cancel-min.js index 4b0ae8c0c97..76988ff96ae 100644 --- a/build/aui-button-search-cancel/aui-button-search-cancel-min.js +++ b/build/aui-button-search-cancel/aui-button-search-cancel-min.js @@ -1 +1 @@ -YUI.add("aui-button-search-cancel",function(e,t){var n=e.Lang,r=e.Array,i=e.one(e.config.doc),s=e.Base.create("btn-search-cancel",e.Base,[],{TEMPLATE:'
'+''+"
",_buttons:null,_eventHandles:null,initializer:function(){var e=this;e._buttons=[],e.bindUI()},destroy:function(){var t=this;r.each(t._buttons,function(e){e.getData("btn-search-cancel").clearData("btn-search-cancel"),e.remove()}),(new e.EventHandle(t._eventHandles)).detach()},bindUI:function(){var t=this,n=t.get("container"),r=t.get("trigger");t._eventHandles=[n.delegate(["focus","input"],e.debounce(t._onUserInteraction,50,t),r),n.delegate("blur",e.debounce(t._onBlur,25,t),r),e.on("windowresize",e.bind(t._onWindowResize,t))]},getButtonForElement:function(t){var n=this,r=t.getData("btn-search-cancel");return r||(r=e.Node.create(e.Lang.sub(n.TEMPLATE,{iconClass:n.get("iconClass"),zIndex:n.get("zIndex")})),n._buttons.push(r.hide()),r.setData("btn-search-cancel",t),t.setData("btn-search-cancel",r),r.on("gesturemovestart",e.rbind("_onButtonClick",n,t))),r},_onBlur:function(e){var t=this,n=t.getButtonForElement(e.target);n&&n.hide()},_onButtonClick:function(t,n){var r=this;r._syncButtonUI(n.val("")),e.soon(function(){n.focus()})},_onUserInteraction:function(e){var t=this;t._syncButtonUI(e.target)},_onWindowResize:function(){var e=this;r.each(e._buttons,function(t){t.hasClass("hide")||e._syncButtonUI(t.getData("btn-search-cancel"))})},_syncButtonUI:function(e){var t=this,r=t.getButtonForElement(e),i,s,o,u;if(!e.val()){r.hide();return}e.insert(r.show(),"before"),i=t.get("gutter"),u=e.get("region"),s=this.get("iconHeight"),n.isNumber(s)||(s=r.get("offsetHeight")),o=this.get("iconWidth"),n.isNumber(o)||(o=r.get("offsetWidth")),r.setXY([u.right-o+i[0],u.top+u.height/2-s/2+i[1]])}},{ATTRS:{container:{setter:e.one,value:i,writeOnce:!0},gutter:{value:[-5,0]},iconClass:{validator:n.isString,value:"glyphicon glyphicon-remove"},iconWidth:{value:24},iconHeight:{value:30},trigger:{validator:n.isString,writeOnce:!0},zIndex:{value:2,writeOnce:!0}}});e.ButtonSearchCancel=s},"4.1.1",{requires:["array-invoke","base","base-build","event-focus","event-move","event-resize","node-screen","node-event-delegate","aui-node-base","aui-classnamemanager","aui-event-input"]}); +YUI.add("aui-button-search-cancel",function(e,t){var n=e.Lang,r=e.Array,i=e.one(e.config.doc),s=e.Base.create("btn-search-cancel",e.Base,[],{TEMPLATE:'
'+''+"
",_buttons:null,_eventHandles:null,initializer:function(){var e=this;e._buttons=[],e.bindUI()},destroy:function(){var t=this;r.each(t._buttons,function(e){e.getData("btn-search-cancel").clearData("btn-search-cancel"),e.remove()}),(new e.EventHandle(t._eventHandles)).detach()},bindUI:function(){var t=this,n=t.get("container"),r=t.get("trigger");t._eventHandles=[n.delegate(["focus","input"],e.debounce(t._onUserInteraction,50,t),r),n.delegate("blur",e.debounce(t._onBlur,25,t),r),e.on("windowresize",e.bind(t._onWindowResize,t))]},getButtonForElement:function(t){var n=this,r=t.getData("btn-search-cancel");return r||(r=e.Node.create(e.Lang.sub(n.TEMPLATE,{iconClass:n.get("iconClass"),zIndex:n.get("zIndex")})),n._buttons.push(r.hide()),r.setData("btn-search-cancel",t),t.setData("btn-search-cancel",r),r.on("gesturemovestart",e.rbind("_onButtonClick",n,t))),r},_onBlur:function(e){var t=this,n=t.getButtonForElement(e.target);n&&n.hide()},_onButtonClick:function(t,n){var r=this;r._syncButtonUI(n.val("")),e.soon(function(){n.focus()})},_onUserInteraction:function(e){var t=this;t._syncButtonUI(e.target)},_onWindowResize:function(){var e=this;r.each(e._buttons,function(t){t.hasClass("hide")||e._syncButtonUI(t.getData("btn-search-cancel"))})},_syncButtonUI:function(e){var t=this,r=t.getButtonForElement(e),i,s,o,u;if(!e.val()){r.hide();return}e.insert(r.show(),"before"),i=t.get("gutter"),u=e.get("region"),s=this.get("iconHeight"),n.isNumber(s)||(s=r.get("offsetHeight")),o=this.get("iconWidth"),n.isNumber(o)||(o=r.get("offsetWidth")),r.setXY([u.right-o+i[0],u.top+u.height/2-s/2+i[1]])}},{ATTRS:{container:{setter:e.one,value:i,writeOnce:!0},gutter:{value:[-5,0]},iconClass:{validator:n.isString,value:"glyphicon glyphicon-remove"},iconWidth:{value:24},iconHeight:{value:30},trigger:{validator:n.isString,writeOnce:!0},zIndex:{value:2,writeOnce:!0}}});e.ButtonSearchCancel=s},"4.2.0",{requires:["array-invoke","base","base-build","event-focus","event-move","event-resize","node-screen","node-event-delegate","aui-node-base","aui-classnamemanager","aui-event-input"]}); diff --git a/build/aui-button-switch/aui-button-switch-min.js b/build/aui-button-switch/aui-button-switch-min.js index 45180b14e34..699577d0e2f 100644 --- a/build/aui-button-switch/aui-button-switch-min.js +++ b/build/aui-button-switch/aui-button-switch-min.js @@ -1 +1 @@ -YUI.add("aui-button-switch",function(e,t){var n=e.getClassName("button","switch"),r=e.getClassName("button","switch","left"),i=e.getClassName("button","switch","right"),s=e.getClassName("button","switch","inner","circle"),o=e.getClassName("button","switch","inner","label","left"),u=e.getClassName("button","switch","inner","label","right"),a=2,f='
'+''+'
',l='';e.ButtonSwitch=e.Base.create("button-switch",e.Widget,[],{bindUI:function(){var e=this.get("content");e.on("click",this._onButtonSwitchClick,this),e.on("key",this._onButtonSwitchKey,"enter,space",this),this.after("activatedChange",this._afterActivatedChange,this),this.after("innerLabelLeftChange",this._afterInnerLabelLeftChange,this),this.after("innerLabelRightChange",this._afterInnerLabelRightChange,this)},renderUI:function(){var e=this.get("content");this.get("contentBox").append(e),this._uiSetActivate(this.get("activated")),this._uiSetInnerLabelLeft(this.get("innerLabelLeft")),this._uiSetInnerLabelRight(this.get("innerLabelRight"))},_afterActivatedChange:function(){this._uiSetActivate(this.get("activated"))},_afterInnerLabelLeftChange:function(e){this._uiSetInnerLabelLeft(e.newVal)},_afterInnerLabelRightChange:function(e){this._uiSetInnerLabelRight(e.newVal)},_getInnerCircle:function(){return this._innerCircle||(this._innerCircle=e.Node.create(l),this.get("content").append(this._innerCircle)),this._innerCircle},_onButtonSwitchClick:function(){this._onButtonSwitchInteraction()},_onButtonSwitchInteraction:function(){this.set("activated",!this.get("activated"))},_onButtonSwitchKey:function(){this._onButtonSwitchInteraction()},_uiSetActivate:function(e){var t=this.get("content"),n=t.get("offsetWidth"),s=this._getInnerCircle(),f=s.get("offsetWidth");t.one("."+u).toggleClass("hide",e),t.one("."+o).toggleClass("hide",!e),t.toggleClass("activated",e),f?(s.removeClass(r),s.removeClass(i),e?(s.setStyle("left",a+"px"),s.transition({duration:.6,left:n-f-a+"px"})):(s.setStyle("left",n-f-a+"px"),s.transition({duration:.6,left:a+"px"}))):this._setInnerCirclePosition(e)},_setInnerCirclePosition:function(e){var t=this._getInnerCircle();t.setStyle("left",""),e?(t.removeClass(r),t.addClass(i)):(t.removeClass(i),t.addClass(r))},_uiSetInnerLabelLeft:function(e){return this.get("content").one("."+o).set("text",e)},_uiSetInnerLabelRight:function(e){return this.get("content").one("."+u).set("text",e)}},{ATTRS:{activated:{value:!1},content:{validator:function(t){return e.instanceOf(t,e.Node)},valueFn:function(){return e.Node.create(f)},writeOnce:"initOnly"},innerLabelLeft:{value:"",validator:e.Lang.isString},innerLabelRight:{value:"",validator:e.Lang.isString}}})},"4.1.1",{requires:["aui-node-base","base-build","event-key","transition","widget"],skinnable:!0}); +YUI.add("aui-button-switch",function(e,t){var n=e.getClassName("button","switch"),r=e.getClassName("button","switch","left"),i=e.getClassName("button","switch","right"),s=e.getClassName("button","switch","inner","circle"),o=e.getClassName("button","switch","inner","label","left"),u=e.getClassName("button","switch","inner","label","right"),a=2,f='
'+''+'
',l='';e.ButtonSwitch=e.Base.create("button-switch",e.Widget,[],{bindUI:function(){var e=this.get("content");e.on("click",this._onButtonSwitchClick,this),e.on("key",this._onButtonSwitchKey,"enter,space",this),this.after("activatedChange",this._afterActivatedChange,this),this.after("innerLabelLeftChange",this._afterInnerLabelLeftChange,this),this.after("innerLabelRightChange",this._afterInnerLabelRightChange,this)},renderUI:function(){var e=this.get("content");this.get("contentBox").append(e),this._uiSetActivate(this.get("activated")),this._uiSetInnerLabelLeft(this.get("innerLabelLeft")),this._uiSetInnerLabelRight(this.get("innerLabelRight"))},_afterActivatedChange:function(){this._uiSetActivate(this.get("activated"))},_afterInnerLabelLeftChange:function(e){this._uiSetInnerLabelLeft(e.newVal)},_afterInnerLabelRightChange:function(e){this._uiSetInnerLabelRight(e.newVal)},_getInnerCircle:function(){return this._innerCircle||(this._innerCircle=e.Node.create(l),this.get("content").append(this._innerCircle)),this._innerCircle},_onButtonSwitchClick:function(){this._onButtonSwitchInteraction()},_onButtonSwitchInteraction:function(){this.set("activated",!this.get("activated"))},_onButtonSwitchKey:function(){this._onButtonSwitchInteraction()},_uiSetActivate:function(e){var t=this.get("content"),n=t.get("offsetWidth"),s=this._getInnerCircle(),f=s.get("offsetWidth");t.one("."+u).toggleClass("hide",e),t.one("."+o).toggleClass("hide",!e),t.toggleClass("activated",e),f?(s.removeClass(r),s.removeClass(i),e?(s.setStyle("left",a+"px"),s.transition({duration:.6,left:n-f-a+"px"})):(s.setStyle("left",n-f-a+"px"),s.transition({duration:.6,left:a+"px"}))):this._setInnerCirclePosition(e)},_setInnerCirclePosition:function(e){var t=this._getInnerCircle();t.setStyle("left",""),e?(t.removeClass(r),t.addClass(i)):(t.removeClass(i),t.addClass(r))},_uiSetInnerLabelLeft:function(e){return this.get("content").one("."+o).set("text",e)},_uiSetInnerLabelRight:function(e){return this.get("content").one("."+u).set("text",e)}},{ATTRS:{activated:{value:!1},content:{validator:function(t){return e.instanceOf(t,e.Node)},valueFn:function(){return e.Node.create(f)},writeOnce:"initOnly"},innerLabelLeft:{value:"",validator:e.Lang.isString},innerLabelRight:{value:"",validator:e.Lang.isString}}})},"4.2.0",{requires:["aui-node-base","base-build","event-key","transition","widget"],skinnable:!0}); diff --git a/build/aui-classnamemanager/aui-classnamemanager-min.js b/build/aui-classnamemanager/aui-classnamemanager-min.js index 859e2b72400..6228810525c 100644 --- a/build/aui-classnamemanager/aui-classnamemanager-min.js +++ b/build/aui-classnamemanager/aui-classnamemanager-min.js @@ -1 +1 @@ -YUI.add("aui-classnamemanager",function(e,t){var n=e.ClassNameManager,r=n.getClassName;e.getClassName=e.cached(function(){var t=e.Array(arguments,0,!0);return t[t.length]=!0,r.apply(n,t)})},"4.1.1",{requires:["classnamemanager"]}); +YUI.add("aui-classnamemanager",function(e,t){var n=e.ClassNameManager,r=n.getClassName;e.getClassName=e.cached(function(){var t=e.Array(arguments,0,!0);return t[t.length]=!0,r.apply(n,t)})},"4.2.0",{requires:["classnamemanager"]}); diff --git a/build/aui-component/aui-component-min.js b/build/aui-component/aui-component-min.js index 465c4c7475b..658591bac11 100644 --- a/build/aui-component/aui-component-min.js +++ b/build/aui-component/aui-component-min.js @@ -1 +1 @@ -YUI.add("aui-component",function(e,t){var n=e.Lang,r=e.Array,i=function(e,t){return(e||[]).concat(t||[])},s={},o=e.config.win.Object.prototype.constructor,u=e.ClassNameManager,a=u.getClassName,f=e.Widget.getClassName,l=e.getClassName,c=l("hide"),h=e.Base.create("component",e.Widget,[e.WidgetCssClass,e.WidgetToggle],{initializer:function(e){var t=this;t._originalConfig=e,t._setRender(e),s[t.get("id")]=t},clone:function(t){var n=this;return t=t||{},t.id=t.id||e.guid(),e.mix(t,n._originalConfig),new n.constructor(t)},_uiSetVisible:function(e){var t=this,n=h.superclass._uiSetVisible;n&&n.apply(t,arguments);var r=t.get("hideClass");if(r!==!1){var i=t.get("boundingBox");i.toggleClass(r||c,!e)}},_renderBoxClassNames:function(){var e=this,t=e.get("boundingBox")._node,n=e.get("contentBox")._node,i=t.className,s=n.className,o=i?i.split(" "):[],u=s?s.split(" "):[],c=e._getClasses(),h=c.length,p=h-4,d,v;o.push(f());for(var m=h-3;m>=0;m--)d=c[m],v=String(d.NAME).toLowerCase(),o.push(d.CSS_PREFIX||a(v)),m<=p&&(v=v,u.push(l(v,"content")));u.push(e.getClassName("content")),t===n?s=r.dedupe(u.concat(o)).join(" "):(t.className=r.dedupe(o).join(" "),s=r.dedupe(u).join(" ")),n.className=s},_renderInteraction:function(e,t){var n=this;n.render(t);var r=n._renderHandles;for(var i=r.length-1;i>=0;i--){var s=r.pop();s.detach()}},_setRender:function(t){var r=this,i=t&&t.render;if(i&&i.constructor===o){var s=i.eventType||"mousemove",u=i.parentNode,a=i.selector||u;if(a){r._renderHandles=[];var f=r._renderHandles;n.isArray(s)||(s=[s]);var l=e.rbind(r._renderInteraction,r,u),c=e.one(a);for(var h=s.length-1;h>=0;h--)f[h]=c.once(s[h],l);delete t.render}}}},{ATTRS:{useARIA:{writeOnce:!0,value:!1,validator:n.isBoolean},hideClass:{value:c},render:{value:!1,writeOnce:!0}}});h._INSTANCES=s,h.getById=function(e){return s[e]};var p=e.Widget.prototype._UI_ATTRS;h._applyCssPrefix=function(t){return t&&t.NAME&&!("CSS_PREFIX"in t)&&(t.CSS_PREFIX=e.getClassName(String(t.NAME).toLowerCase())),t},h.create=function(t){t=t||{};var r=t.EXTENDS||e.Component,s=t.constructor;e.Object.owns(t,"constructor")||(s=function(){s.superclass.constructor.apply(this,arguments)});var o=t.prototype;if(o)if(t.UI_ATTRS||t.BIND_UI_ATTRS||t.SYNC_UI_ATTRS){var u=i(t.BIND_UI_ATTRS,t.UI_ATTRS),a=i(t.SYNC_UI_ATTRS,t.UI_ATTRS),f=r.prototype,l=f&&f._UI_ATTRS||p;u=i(l.BIND,u),a=i(l.SYNC,a);var c=o._UI_ATTRS;c||(c=o._UI_ATTRS={}),u.length&&(c.BIND=u),a.length&&(c.SYNC=a)}var d=t.AUGMENTS;return d&&!n.isArray(d)&&(d=[d]),e.mix(s,t),delete s.prototype,e.extend(s,r,o),d&&(s=e.Base.build(t.NAME,s,d,{dynamic:!1})),h._applyCssPrefix(s),s},h.CSS_PREFIX=l("component");var d=e.Base;h.build=function(){var e=d.build.apply(d,arguments);return h._applyCssPrefix(e),e},e.Component=h},"4.1.1",{requires:["aui-classnamemanager","aui-widget-cssclass","aui-widget-toggle","base-build","widget-base"]}); +YUI.add("aui-component",function(e,t){var n=e.Lang,r=e.Array,i=function(e,t){return(e||[]).concat(t||[])},s={},o=e.config.win.Object.prototype.constructor,u=e.ClassNameManager,a=u.getClassName,f=e.Widget.getClassName,l=e.getClassName,c=l("hide"),h=e.Base.create("component",e.Widget,[e.WidgetCssClass,e.WidgetToggle],{initializer:function(e){var t=this;t._originalConfig=e,t._setRender(e),s[t.get("id")]=t},clone:function(t){var n=this;return t=t||{},t.id=t.id||e.guid(),e.mix(t,n._originalConfig),new n.constructor(t)},_uiSetVisible:function(e){var t=this,n=h.superclass._uiSetVisible;n&&n.apply(t,arguments);var r=t.get("hideClass");if(r!==!1){var i=t.get("boundingBox");i.toggleClass(r||c,!e)}},_renderBoxClassNames:function(){var e=this,t=e.get("boundingBox")._node,n=e.get("contentBox")._node,i=t.className,s=n.className,o=i?i.split(" "):[],u=s?s.split(" "):[],c=e._getClasses(),h=c.length,p=h-4,d,v;o.push(f());for(var m=h-3;m>=0;m--)d=c[m],v=String(d.NAME).toLowerCase(),o.push(d.CSS_PREFIX||a(v)),m<=p&&(v=v,u.push(l(v,"content")));u.push(e.getClassName("content")),t===n?s=r.dedupe(u.concat(o)).join(" "):(t.className=r.dedupe(o).join(" "),s=r.dedupe(u).join(" ")),n.className=s},_renderInteraction:function(e,t){var n=this;n.render(t);var r=n._renderHandles;for(var i=r.length-1;i>=0;i--){var s=r.pop();s.detach()}},_setRender:function(t){var r=this,i=t&&t.render;if(i&&i.constructor===o){var s=i.eventType||"mousemove",u=i.parentNode,a=i.selector||u;if(a){r._renderHandles=[];var f=r._renderHandles;n.isArray(s)||(s=[s]);var l=e.rbind(r._renderInteraction,r,u),c=e.one(a);for(var h=s.length-1;h>=0;h--)f[h]=c.once(s[h],l);delete t.render}}}},{ATTRS:{useARIA:{writeOnce:!0,value:!1,validator:n.isBoolean},hideClass:{value:c},render:{value:!1,writeOnce:!0}}});h._INSTANCES=s,h.getById=function(e){return s[e]};var p=e.Widget.prototype._UI_ATTRS;h._applyCssPrefix=function(t){return t&&t.NAME&&!("CSS_PREFIX"in t)&&(t.CSS_PREFIX=e.getClassName(String(t.NAME).toLowerCase())),t},h.create=function(t){t=t||{};var r=t.EXTENDS||e.Component,s=t.constructor;e.Object.owns(t,"constructor")||(s=function(){s.superclass.constructor.apply(this,arguments)});var o=t.prototype;if(o)if(t.UI_ATTRS||t.BIND_UI_ATTRS||t.SYNC_UI_ATTRS){var u=i(t.BIND_UI_ATTRS,t.UI_ATTRS),a=i(t.SYNC_UI_ATTRS,t.UI_ATTRS),f=r.prototype,l=f&&f._UI_ATTRS||p;u=i(l.BIND,u),a=i(l.SYNC,a);var c=o._UI_ATTRS;c||(c=o._UI_ATTRS={}),u.length&&(c.BIND=u),a.length&&(c.SYNC=a)}var d=t.AUGMENTS;return d&&!n.isArray(d)&&(d=[d]),e.mix(s,t),delete s.prototype,e.extend(s,r,o),d&&(s=e.Base.build(t.NAME,s,d,{dynamic:!1})),h._applyCssPrefix(s),s},h.CSS_PREFIX=l("component");var d=e.Base;h.build=function(){var e=d.build.apply(d,arguments);return h._applyCssPrefix(e),e},e.Component=h},"4.2.0",{requires:["aui-classnamemanager","aui-widget-cssclass","aui-widget-toggle","base-build","widget-base"]}); diff --git a/build/aui-datatable-base-cell-editor/aui-datatable-base-cell-editor-min.js b/build/aui-datatable-base-cell-editor/aui-datatable-base-cell-editor-min.js index f34a9f047dc..a5cfb745ec8 100644 --- a/build/aui-datatable-base-cell-editor/aui-datatable-base-cell-editor-min.js +++ b/build/aui-datatable-base-cell-editor/aui-datatable-base-cell-editor-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-base-cell-editor",function(e,t){var n,r=//gi,i=/[\r\n]/g,s="
";n=e.Component.create({NAME:"baseCellEditor",ATTRS:{constrain:{value:!0},editable:{value:!1,validator:e.Lang.isBoolean},elementName:{value:"value",validator:e.Lang.isString},footerContent:{value:""},hideOnSave:{value:!0,validator:e.Lang.isBoolean},inputFormatter:{value:function(t){return e.Lang.isString(t)&&(t=t.replace(i,s)),t}},outputFormatter:{value:function(t){var n=this;return e.Lang.isString(t)&&(n.get("unescapeValue")&&(t=e.Lang.String.unescapeEntities(t)),t=t.replace(r,"\n")),t}},showToolbar:{value:!0,validator:e.Lang.isBoolean},strings:{value:{edit:"Edit",save:"Save",cancel:"Cancel"}},tabIndex:{value:1},toolbar:{setter:"_setToolbar",validator:e.Lang.isObject,value:null},unescapeValue:{value:!0,validator:e.Lang.isBoolean},validator:{setter:"_setValidator",validator:e.Lang.isObject,value:null},value:{value:""},visible:{value:!1}},EXTENDS:e.Overlay,UI_ATTRS:["editable","showToolbar","value"],prototype:{CONTENT_TEMPLATE:"
",ELEMENT_TEMPLATE:null,elements:null,validator:null,_hDocEscKeyEv:null,_hDocMouseDownEv:null,initializer:function(){this._initEvents()},destructor:function(){var e=this._hDocEscKeyEv,t=this._hDocMouseDownEv,n=this.toolbar,r=this.validator;e&&e.detach(),t&&t.detach(),n&&n.destroy(),r&&r.destroy()},formatValue:function(t,n){var r=this;return e.Lang.isFunction(t)&&(n=t.call(r,n)),n},getValue:function(){var e=this;return e.formatValue(e.get("inputFormatter"),e.getElementsValue())},_initEvents:function(){var t=this;t.publish({cancel:{defaultFn:t._defCancelFn},initEdit:{defaultFn:t._defInitEditFn,fireOnce:!0},initValidator:{defaultFn:t._defInitValidatorFn,fireOnce:!0},initToolbar:{defaultFn:t._defInitToolbarFn,fireOnce:!0},save:{defaultFn:t._defSaveFn}}),t.after({render:t._afterRender,visibleChange:e.debounce(t._debounceVisibleChange,350,t)}),t.on({"form-validator:submit":e.bind(t._onSubmit,t)})},_afterRender:function(){var e=this;e._handleInitValidatorEvent(),e._handleInitToolbarEvent()},_defCancelFn:function(){this.hide()},_defInitValidatorFn:function(){var t=this;t.validator=new e.FormValidator(t.get("validator"))},_defInitToolbarFn:function(){var t=this,n=t.get("editable");t.toolbar=(new e.Toolbar(t.get("toolbar"))).render(t.footerNode),n&&t._uiSetEditable(n)},_defSaveFn:function(){var e=this;e.get("hideOnSave")&&e.hide()},_debounceVisibleChange:function(t){var n=this,r=n._hDocEscKeyEv,i=n._hDocMouseDownEv;t.newVal?(r||(n._hDocEscKeyEv=e.getDoc().on("key",e.bind(n._onEscKey,n),"down:27")),i||(n._hDocMouseDownEv=e.getDoc().on("mousedown",e.bind(n._onDocMouseDownExt,n)))):(r&&(r.detach(),n._hDocEscKeyEv=null),i&&(i.detach(),n._hDocMouseDownEv=null))},_handleCancelEvent:function(){var e=this;e.fire("cancel")},_handleEditEvent:function(){var e=this;e.fire("edit")},_handleInitEditEvent:function(){var e=this;e.get("rendered")&&this.fire("initEdit")},_handleInitValidatorEvent:function(){var e=this;e.get("rendered")&&this.fire("initValidator")},_handleInitToolbarEvent:function(){var e=this;e.get("rendered")&&e.get("showToolbar")&&this.fire("initToolbar")},_handleSaveEvent:function(){var e=this;e.validator.validate(),e.validator.hasErrors()||e.fire("save",{newVal:e.getValue(),prevVal:e.get("value")})},_onDocMouseDownExt:function(e){var t=this,n=t.get("boundingBox");n.contains(e.target)||t._handleCancelEvent()},_onEscKey:function(){var e=this;e._handleCancelEvent()},_onSubmit:function(e){var t=e.validator;t&&t.formEvent.halt()},_setToolbar:function(t){var n=this,r=n.getStrings();return e.merge({activeState:!1,children:[[{on:{click:e.bind(n._handleSaveEvent,n)},label:r.save,icon:"glyphicon glyphicon-ok-sign"},{on:{click:e.bind(n._handleCancelEvent,n)},label:r.cancel}]]},t)},_setValidator:function(t){var n=this;return e.merge({boundingBox:n.get("contentBox"),bubbleTargets:n},t)},_uiSetShowToolbar:function(e){var t=this,n=t.footerNode;e?n.show():n.hide(),t._handleInitToolbarEvent()},getElementsValue:function(){var e=this,t=e.elements;return t?t.get("value"):""},renderUI:function(){var t=this;t.ELEMENT_TEMPLATE&&(t.elements=e.Node.create(t.ELEMENT_TEMPLATE),t._syncElementsName(),t.setStdModContent(e.WidgetStdMod.BODY,t.elements))},_defInitEditFn:function(){},_syncElementsFocus:function(){var e=this;e.elements.selectText()},_syncElementsName:function(){var e=this;e.elements.setAttribute("name",e.get("elementName"))},_syncFocus:function(){var t=this;e.later(0,t,t._syncElementsFocus)},_uiSetEditable:function(t){var n=this,r=n.toolbar;n.get("rendered")&&r&&(t?r.add([{icon:"glyphicon glyphicon-edit",label:n.getString("edit"),on:{click:e.bind(n._handleEditEvent,n)}}],1):r.remove(1))},_uiSetValue:function(e){var t=this,n=t.elements;n&&n.val(t.formatValue(t.get("outputFormatter"),e))}}}),e.BaseCellEditor=n},"4.1.1",{requires:["datatable-base","overlay"],skinnable:!0}); +YUI.add("aui-datatable-base-cell-editor",function(e,t){var n,r=//gi,i=/[\r\n]/g,s="
";n=e.Component.create({NAME:"baseCellEditor",ATTRS:{constrain:{value:!0},editable:{value:!1,validator:e.Lang.isBoolean},elementName:{value:"value",validator:e.Lang.isString},footerContent:{value:""},hideOnSave:{value:!0,validator:e.Lang.isBoolean},inputFormatter:{value:function(t){return e.Lang.isString(t)&&(t=t.replace(i,s)),t}},outputFormatter:{value:function(t){var n=this;return e.Lang.isString(t)&&(n.get("unescapeValue")&&(t=e.Lang.String.unescapeEntities(t)),t=t.replace(r,"\n")),t}},showToolbar:{value:!0,validator:e.Lang.isBoolean},strings:{value:{edit:"Edit",save:"Save",cancel:"Cancel"}},tabIndex:{value:1},toolbar:{setter:"_setToolbar",validator:e.Lang.isObject,value:null},unescapeValue:{value:!0,validator:e.Lang.isBoolean},validator:{setter:"_setValidator",validator:e.Lang.isObject,value:null},value:{value:""},visible:{value:!1}},EXTENDS:e.Overlay,UI_ATTRS:["editable","showToolbar","value"],prototype:{CONTENT_TEMPLATE:"
",ELEMENT_TEMPLATE:null,elements:null,validator:null,_hDocEscKeyEv:null,_hDocMouseDownEv:null,initializer:function(){this._initEvents()},destructor:function(){var e=this._hDocEscKeyEv,t=this._hDocMouseDownEv,n=this.toolbar,r=this.validator;e&&e.detach(),t&&t.detach(),n&&n.destroy(),r&&r.destroy()},formatValue:function(t,n){var r=this;return e.Lang.isFunction(t)&&(n=t.call(r,n)),n},getValue:function(){var e=this;return e.formatValue(e.get("inputFormatter"),e.getElementsValue())},_initEvents:function(){var t=this;t.publish({cancel:{defaultFn:t._defCancelFn},initEdit:{defaultFn:t._defInitEditFn,fireOnce:!0},initValidator:{defaultFn:t._defInitValidatorFn,fireOnce:!0},initToolbar:{defaultFn:t._defInitToolbarFn,fireOnce:!0},save:{defaultFn:t._defSaveFn}}),t.after({render:t._afterRender,visibleChange:e.debounce(t._debounceVisibleChange,350,t)}),t.on({"form-validator:submit":e.bind(t._onSubmit,t)})},_afterRender:function(){var e=this;e._handleInitValidatorEvent(),e._handleInitToolbarEvent()},_defCancelFn:function(){this.hide()},_defInitValidatorFn:function(){var t=this;t.validator=new e.FormValidator(t.get("validator"))},_defInitToolbarFn:function(){var t=this,n=t.get("editable");t.toolbar=(new e.Toolbar(t.get("toolbar"))).render(t.footerNode),n&&t._uiSetEditable(n)},_defSaveFn:function(){var e=this;e.get("hideOnSave")&&e.hide()},_debounceVisibleChange:function(t){var n=this,r=n._hDocEscKeyEv,i=n._hDocMouseDownEv;t.newVal?(r||(n._hDocEscKeyEv=e.getDoc().on("key",e.bind(n._onEscKey,n),"down:27")),i||(n._hDocMouseDownEv=e.getDoc().on("mousedown",e.bind(n._onDocMouseDownExt,n)))):(r&&(r.detach(),n._hDocEscKeyEv=null),i&&(i.detach(),n._hDocMouseDownEv=null))},_handleCancelEvent:function(){var e=this;e.fire("cancel")},_handleEditEvent:function(){var e=this;e.fire("edit")},_handleInitEditEvent:function(){var e=this;e.get("rendered")&&this.fire("initEdit")},_handleInitValidatorEvent:function(){var e=this;e.get("rendered")&&this.fire("initValidator")},_handleInitToolbarEvent:function(){var e=this;e.get("rendered")&&e.get("showToolbar")&&this.fire("initToolbar")},_handleSaveEvent:function(){var e=this;e.validator.validate(),e.validator.hasErrors()||e.fire("save",{newVal:e.getValue(),prevVal:e.get("value")})},_onDocMouseDownExt:function(e){var t=this,n=t.get("boundingBox");n.contains(e.target)||t._handleCancelEvent()},_onEscKey:function(){var e=this;e._handleCancelEvent()},_onSubmit:function(e){var t=e.validator;t&&t.formEvent.halt()},_setToolbar:function(t){var n=this,r=n.getStrings();return e.merge({activeState:!1,children:[[{on:{click:e.bind(n._handleSaveEvent,n)},label:r.save,icon:"glyphicon glyphicon-ok-sign"},{on:{click:e.bind(n._handleCancelEvent,n)},label:r.cancel}]]},t)},_setValidator:function(t){var n=this;return e.merge({boundingBox:n.get("contentBox"),bubbleTargets:n},t)},_uiSetShowToolbar:function(e){var t=this,n=t.footerNode;e?n.show():n.hide(),t._handleInitToolbarEvent()},getElementsValue:function(){var e=this,t=e.elements;return t?t.get("value"):""},renderUI:function(){var t=this;t.ELEMENT_TEMPLATE&&(t.elements=e.Node.create(t.ELEMENT_TEMPLATE),t._syncElementsName(),t.setStdModContent(e.WidgetStdMod.BODY,t.elements))},_defInitEditFn:function(){},_syncElementsFocus:function(){var e=this;e.elements.selectText()},_syncElementsName:function(){var e=this;e.elements.setAttribute("name",e.get("elementName"))},_syncFocus:function(){var t=this;e.later(0,t,t._syncElementsFocus)},_uiSetEditable:function(t){var n=this,r=n.toolbar;n.get("rendered")&&r&&(t?r.add([{icon:"glyphicon glyphicon-edit",label:n.getString("edit"),on:{click:e.bind(n._handleEditEvent,n)}}],1):r.remove(1))},_uiSetValue:function(e){var t=this,n=t.elements;n&&n.val(t.formatValue(t.get("outputFormatter"),e))}}}),e.BaseCellEditor=n},"4.2.0",{requires:["datatable-base","overlay"],skinnable:!0}); diff --git a/build/aui-datatable-base-options-cell-editor/aui-datatable-base-options-cell-editor-min.js b/build/aui-datatable-base-options-cell-editor/aui-datatable-base-options-cell-editor-min.js index aa41d35cbb1..b944d870f20 100644 --- a/build/aui-datatable-base-options-cell-editor/aui-datatable-base-options-cell-editor-min.js +++ b/build/aui-datatable-base-options-cell-editor/aui-datatable-base-options-cell-editor-min.js @@ -1,2 +1,2 @@ YUI.add("aui-datatable-base-options-cell-editor",function(e,t){var n,r=e.Lang,i=e.Escape,s=e.getClassName("celleditor","edit"),o=e.getClassName("celleditor","edit","add","option"),u=e.getClassName("celleditor","edit","dd","handle"),a=e.getClassName("celleditor","edit","delete","option"),f=e.getClassName("celleditor","edit","hide","option"),l=e.getClassName("celleditor","edit","input","name"),c=e.getClassName("celleditor","edit","input","value"),h=e.getClassName("celleditor","edit","label"),p=e.getClassName("celleditor","edit","link"),d=e.getClassName("celleditor","edit","option","row"),v=e.getClassName("glyphicon"),m=e.getClassName("glyphicon","resize","vertical");n=e.Component.create({NAME:"optionsCellEditor",ATTRS:{inputFormatter:{value:null},hideEditContainerOnSave:{value:!0,validator:e.Lang.isBoolean},options:{setter:"_setOptions",value:{},validator:r.isObject},optionsValidatorCustomRules:{validator:e.Lang.isObject,valueFn:function(){var e=this;return{uniqueValue:{condition:function(e,t){var n=this,r=t.ancestor("."+s),i=r.all("."+c),o=function(e,t,r){var s=!1;return t.each(function(t){e!==t&&(e.val()===t.val()&&(n.highlight(e),n.addFieldError(e,"uniqueValue"),s=!0),r&&o(t,i,!1))}),s||(n.resetField(e),n.highlight(e,!0)),!s};return o(t,i,!0)},errorMessage:e.getStrings().valueNotUnique}}}},optionsValidatorInputRules:{validator:e.Lang.isObject,value:{custom:!0,uniqueValue:!0}},outputFormatter:{value:null},selectedAttrName:{value:"selected",validator:r.isString},strings:{value:{add:"Add",addOption:"Add option",cancel:"Cancel",edit:"Edit options",editOptions:"Edit option(s)",name:"Name",optionName:"Option Name",optionValue:"Option Value",remove:"Remove",save:"Save",stopEditing:"Stop editing",value:"Value",valueNotUnique:"Value not unique."}}},EXTENDS:e.BaseCellEditor,UI_ATTRS:["options"],prototype:{EDIT_TEMPLATE:'
',EDIT_OPTION_ROW_TEMPLATE:'
'+'
'+''+"
"+'
'+''+' '+"
"+'
'+''+' '+"
"+'
'+''+"
"+"
"+"",EDIT_ADD_LINK_TEMPLATE:' ',EDIT_LABEL_TEMPLATE:'
{editOptions}
',editContainer:null,editSortable:null,options:null,initializer:function(){var t=this;t.on("edit",t._onEditEvent),t.on("save",t._onSave),t.after("initToolbar",t._afterInitToolbar),e.FormValidator.addCustomRules(t.get("optionsValidatorCustomRules"))},addNewOption:function(t,n){var r=this,i=r.editContainer.one("."+o),s=e.Node.create(r._createEditOption(t||"",n||""));i.placeBefore(s),s.one("input").focus()},removeOption:function(e){e.remove()},saveOptions:function(){var e=this,t=e.editContainer;if(t&&!t.hasAttribute("hidden")){var n=t.all("."+l),r=t.all("."+c),i={};n.each(function(e,t){var n=e.val(),s=r.item(t).val();i[s]=n}),e.set("options",i),e.get("hideEditContainerOnSave")&&e.toggleEdit()}},toggleEdit:function(){var e=this;e.editContainer.toggle()},_createOptions:function(t){var n=this,s=n.elements,o=[],u=[],a=n.OPTION_TEMPLATE,f=n.OPTION_WRAPPER;e.each(t,function(t,n){var s={id:e.guid(),label:i.html(t),name:i.html(n),value:i.html(n)};a&&o.push(r.sub(a,s)),f&&u.push(r.sub(f,s))});var l=e.NodeList.create(o.join("")),c=e.NodeList.create(u.join(""));c.size()?(c.each(function(e,t){e.prepend(l.item(t))}),s.setContent(c)):s.setContent(l),n.options=l},_createEditBuffer:function(){var t=this,n=t.getStrings(),i=[];return i.push(r.sub(t.EDIT_LABEL_TEMPLATE,{editOptions:n.editOptions})),e.each(t.get("options"),function(e,n){i.push(t._createEditOption(e,n))}),i.push(r.sub(t.EDIT_ADD_LINK_TEMPLATE,{addOption:n.addOption})),i.join("")},_createEditOption:function(t,n){var s=this,o=e.guid()+"_value",u=s.getStrings();return s.validator.get("rules")[o]=s.get("optionsValidatorInputRules"),r.sub(s.EDIT_OPTION_ROW_TEMPLATE,{labelOptionName:i.html(u.optionName),labelOptionValue:i.html(u.optionValue),optionValueName:i.html(o),remove:u.remove,titleName:i.html(u.name),titleValue:i.html(u.value),valueName:i.html(t),valueValue:i.html(n)})},_defInitEditFn:function(){var t=this,n=e.Node.create(t.EDIT_TEMPLATE);n.delegate("click",e.bind(t._onEditLinkClickEvent,t),"."+p),n.delegate("keydown",e.bind(t._onEditKeyEvent,t),"input"),t.editContainer=n,t.setStdModContent(e.WidgetStdMod.BODY,n.hide(),e.WidgetStdMod.AFTER),t.editSortable=(new e.Sortable({container:n,handles:["."+u],nodes:"."+d,opacity:".3"})).delegate.dd.plug(e.Plugin.DDConstrained,{constrain:n,stickY:!0}),t._syncEditOptionsUI()},_getSelectedOptions:function(){var t=this,n=[];return t.options.each(function(e){e.get(t.get("selectedAttrName"))&&n.push(e)}),e.all(n)},_onEditEvent:function(){var e=this;e._handleInitEditEvent(),e.toggleEdit(),e._syncEditOptionsUI()},_onEditLinkClickEvent:function(e){var t=this,n=e.currentTarget;n.test("."+o)?t.addNewOption():n.test("."+f)?t.toggleEdit():n.test("."+a)&&t.removeOption(n.ancestor("."+d)),e.halt()},_onEditKeyEvent:function(e){var t=this,n=e.currentTarget;if(e.isKey("return")){var r=n.next("input");r?r.selectText():t.addNewOption(),e.halt()}},_onSave:function(){var e=this;e.saveOptions()},_setOptions:function(t){var n={};return r.isArray(t)?e.Array.each(t,function(e){n[e]=e}):r.isObject(t)&&(n=t),n},_syncEditOptionsUI -:function(){var e=this;e.editContainer.setContent(e._createEditBuffer())},_uiSetOptions:function(e){var t=this;t._createOptions(e),t._uiSetValue(t.get("value")),t._syncElementsName()},_uiSetValue:function(t){var n=this,s=n.options;return s&&s.size()&&(s.set(n.get("selectedAttrName"),!1),r.isValue(t)&&(r.isArray(t)||(t=String(t).split(",")),e.Array.each(t,function(e){s.filter('[value="'+i.html(r.trim(e))+'"]').set(n.get("selectedAttrName"),!0)}))),t}}}),e.BaseOptionsCellEditor=n},"4.1.1",{requires:["aui-datatable-base-cell-editor","escape"],skinnable:!0}); +:function(){var e=this;e.editContainer.setContent(e._createEditBuffer())},_uiSetOptions:function(e){var t=this;t._createOptions(e),t._uiSetValue(t.get("value")),t._syncElementsName()},_uiSetValue:function(t){var n=this,s=n.options;return s&&s.size()&&(s.set(n.get("selectedAttrName"),!1),r.isValue(t)&&(r.isArray(t)||(t=String(t).split(",")),e.Array.each(t,function(e){s.filter('[value="'+i.html(r.trim(e))+'"]').set(n.get("selectedAttrName"),!0)}))),t}}}),e.BaseOptionsCellEditor=n},"4.2.0",{requires:["aui-datatable-base-cell-editor","escape"],skinnable:!0}); diff --git a/build/aui-datatable-body/aui-datatable-body-min.js b/build/aui-datatable-body/aui-datatable-body-min.js index 3b45483a08d..d3fdd1d9be2 100644 --- a/build/aui-datatable-body/aui-datatable-body-min.js +++ b/build/aui-datatable-body/aui-datatable-body-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-body",function(e,t){function i(){}var n=e.getClassName,r=n("table");i.NAME="dataTableBody",i.prototype={initializer:function(){e.after(this._afterRenderBody,this,"render")},_afterRenderBody:function(){this._setTableClass()},_setTableClass:function(){var e=this.get("container"),t=this.get("cssClass");e.addClass(t),e.addClass(r)}},e.Base.mix(e.DataTable.BodyView,[i])},"4.1.1",{requires:["aui-classnamemanager","datatable-base","event-key","aui-event-base"]}); +YUI.add("aui-datatable-body",function(e,t){function i(){}var n=e.getClassName,r=n("table");i.NAME="dataTableBody",i.prototype={initializer:function(){e.after(this._afterRenderBody,this,"render")},_afterRenderBody:function(){this._setTableClass()},_setTableClass:function(){var e=this.get("container"),t=this.get("cssClass");e.addClass(t),e.addClass(r)}},e.Base.mix(e.DataTable.BodyView,[i])},"4.2.0",{requires:["aui-classnamemanager","datatable-base","event-key","aui-event-base"]}); diff --git a/build/aui-datatable-cell-editor-support/aui-datatable-cell-editor-support-min.js b/build/aui-datatable-cell-editor-support/aui-datatable-cell-editor-support-min.js index 8f08f03b40c..3fb4c80119b 100644 --- a/build/aui-datatable-cell-editor-support/aui-datatable-cell-editor-support-min.js +++ b/build/aui-datatable-cell-editor-support/aui-datatable-cell-editor-support-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-cell-editor-support",function(e,t){var n,r;n=function(t){return t instanceof e.BaseCellEditor},r=function(){},r.NAME="dataTableCellEditorSupport",r.EDITOR_ZINDEX=9999,r.ATTRS={editEvent:{setter:"_setEditEvent",validator:e.Lang.isString,value:"click"}},e.mix(r.prototype,{initializer:function(){var t=this,n=t.get("editEvent");t.CLASS_NAMES_CELL_EDITOR_SUPPORT={cell:t.getClassName("cell"),readOnly:t.getClassName("read","only")},t.after("render",t._afterCellEditorSupportRender),t.delegate(n,t._onEditCell,"."+t.CLASS_NAMES_CELL_EDITOR_SUPPORT.cell,t),e.after(t._afterSelectionKey,t,"_onSelectionKey")},getEditor:function(e,t){var n=t.editor,r=e.get("editor");return n===!1||r===!1?null:r||n},_afterCellEditorSupportRender:function(){var t=this;t._syncModelsReadOnlyUI(),t.body.after(e.bind(t._syncModelsReadOnlyUI,t),t.body,"render")},_afterSelectionKey:function(e){var t=this,n=t.get("activeCell");n&&e.keyCode===13&&t._onEditCell(n)},_onEditCell:function(t){var i=this,s=i.get("activeCell"),o=t.alignNode||s,u=i.getColumn(o),a=i.getRecord(o),f=i.getEditor(a,u);n(f)&&!a.get("readOnly")&&(f.get("rendered")||(f.on({visibleChange:e.bind(i._onEditorVisibleChange,i),save:e.bind(i._onEditorSave,i),cancel:e.bind(i._onEditorCancel,i)}),f.set("zIndex",r.EDITOR_ZINDEX),f.render()),f.set("value",a.get(u.key)),f.show().move(o.getXY()))},_onEditorCancel:function(){var e=this;e._refocusActiveCell()},_onEditorSave:function(e){var t=this,n=e.currentTarget,r=t.getActiveColumn(),i=t.getActiveRecord();n.set("value",e.newVal),i.set(r.key,n.formatValue(n.get("inputFormatter"),e.newVal)),t._refocusActiveCell()},_onEditorVisibleChange:function(e){var t=e.currentTarget;e.newVal&&t._syncFocus()},_refocusActiveCell:function(){var e=this,t=e.get("activeCell"),n=e.getCoord(t);e.set("activeCoord",n),e.set("selection",n)},_syncModelReadOnlyUI:function(e){var t=this,n=t.getRow(e);n.toggleClass(t.CLASS_NAMES_CELL_EDITOR_SUPPORT.readOnly,e.get("readOnly")===!0)},_syncModelsReadOnlyUI:function(){var e=this;e.get("data").each(function(t){e._syncModelReadOnlyUI(t)})},getCellEditor:function(){return this.getEditor.apply(this,arguments)},getRecordColumnValue:function(e,t){return e.get(t.key)}}),e.DataTable.CellEditorSupport=r,e.Base.mix(e.DataTable,[r])},"4.1.1",{requires:["datatable-base"]}); +YUI.add("aui-datatable-cell-editor-support",function(e,t){var n,r;n=function(t){return t instanceof e.BaseCellEditor},r=function(){},r.NAME="dataTableCellEditorSupport",r.EDITOR_ZINDEX=9999,r.ATTRS={editEvent:{setter:"_setEditEvent",validator:e.Lang.isString,value:"click"}},e.mix(r.prototype,{initializer:function(){var t=this,n=t.get("editEvent");t.CLASS_NAMES_CELL_EDITOR_SUPPORT={cell:t.getClassName("cell"),readOnly:t.getClassName("read","only")},t.after("render",t._afterCellEditorSupportRender),t.delegate(n,t._onEditCell,"."+t.CLASS_NAMES_CELL_EDITOR_SUPPORT.cell,t),e.after(t._afterSelectionKey,t,"_onSelectionKey")},getEditor:function(e,t){var n=t.editor,r=e.get("editor");return n===!1||r===!1?null:r||n},_afterCellEditorSupportRender:function(){var t=this;t._syncModelsReadOnlyUI(),t.body.after(e.bind(t._syncModelsReadOnlyUI,t),t.body,"render")},_afterSelectionKey:function(e){var t=this,n=t.get("activeCell");n&&e.keyCode===13&&t._onEditCell(n)},_onEditCell:function(t){var i=this,s=i.get("activeCell"),o=t.alignNode||s,u=i.getColumn(o),a=i.getRecord(o),f=i.getEditor(a,u);n(f)&&!a.get("readOnly")&&(f.get("rendered")||(f.on({visibleChange:e.bind(i._onEditorVisibleChange,i),save:e.bind(i._onEditorSave,i),cancel:e.bind(i._onEditorCancel,i)}),f.set("zIndex",r.EDITOR_ZINDEX),f.render()),f.set("value",a.get(u.key)),f.show().move(o.getXY()))},_onEditorCancel:function(){var e=this;e._refocusActiveCell()},_onEditorSave:function(e){var t=this,n=e.currentTarget,r=t.getActiveColumn(),i=t.getActiveRecord();n.set("value",e.newVal),i.set(r.key,n.formatValue(n.get("inputFormatter"),e.newVal)),t._refocusActiveCell()},_onEditorVisibleChange:function(e){var t=e.currentTarget;e.newVal&&t._syncFocus()},_refocusActiveCell:function(){var e=this,t=e.get("activeCell"),n=e.getCoord(t);e.set("activeCoord",n),e.set("selection",n)},_syncModelReadOnlyUI:function(e){var t=this,n=t.getRow(e);n.toggleClass(t.CLASS_NAMES_CELL_EDITOR_SUPPORT.readOnly,e.get("readOnly")===!0)},_syncModelsReadOnlyUI:function(){var e=this;e.get("data").each(function(t){e._syncModelReadOnlyUI(t)})},getCellEditor:function(){return this.getEditor.apply(this,arguments)},getRecordColumnValue:function(e,t){return e.get(t.key)}}),e.DataTable.CellEditorSupport=r,e.Base.mix(e.DataTable,[r])},"4.2.0",{requires:["datatable-base"]}); diff --git a/build/aui-datatable-checkbox-cell-editor/aui-datatable-checkbox-cell-editor-min.js b/build/aui-datatable-checkbox-cell-editor/aui-datatable-checkbox-cell-editor-min.js index 8f2f98cb5f2..766b0fe453b 100644 --- a/build/aui-datatable-checkbox-cell-editor/aui-datatable-checkbox-cell-editor-min.js +++ b/build/aui-datatable-checkbox-cell-editor/aui-datatable-checkbox-cell-editor-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-checkbox-cell-editor",function(e,t){var n,r=e.getClassName("celleditor","element"),i=e.getClassName("celleditor","option"),n=e.Component.create({NAME:"checkboxCellEditor",ATTRS:{selectedAttrName:{value:"checked"}},EXTENDS:e.BaseOptionsCellEditor,prototype:{ELEMENT_TEMPLATE:'
',OPTION_TEMPLATE:'',OPTION_WRAPPER:'',getElementsValue:function(){var e=this;return e._getSelectedOptions().get("value")},_syncElementsFocus:function(){var e=this,t=e.options;t&&t.size()&&t.item(0).focus()},_syncElementsName:function(){var e=this,t=e.options;t&&t.setAttribute("name",e.get("elementName"))}}});e.CheckboxCellEditor=n},"4.1.1",{requires:["aui-datatable-base-options-cell-editor"]}); +YUI.add("aui-datatable-checkbox-cell-editor",function(e,t){var n,r=e.getClassName("celleditor","element"),i=e.getClassName("celleditor","option"),n=e.Component.create({NAME:"checkboxCellEditor",ATTRS:{selectedAttrName:{value:"checked"}},EXTENDS:e.BaseOptionsCellEditor,prototype:{ELEMENT_TEMPLATE:'
',OPTION_TEMPLATE:'',OPTION_WRAPPER:'',getElementsValue:function(){var e=this;return e._getSelectedOptions().get("value")},_syncElementsFocus:function(){var e=this,t=e.options;t&&t.size()&&t.item(0).focus()},_syncElementsName:function(){var e=this,t=e.options;t&&t.setAttribute("name",e.get("elementName"))}}});e.CheckboxCellEditor=n},"4.2.0",{requires:["aui-datatable-base-options-cell-editor"]}); diff --git a/build/aui-datatable-core/aui-datatable-core-min.js b/build/aui-datatable-core/aui-datatable-core-min.js index fbbbac0d0ee..8ac8740da25 100644 --- a/build/aui-datatable-core/aui-datatable-core-min.js +++ b/build/aui-datatable-core/aui-datatable-core-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-core",function(e,t){e.DataTable.NAME="datatable",e.DataTable.CSS_PREFIX="table"},"4.1.1",{requires:["aui-datatable-body","datatable-base","event-key","aui-event-base"],skinnable:!0}); +YUI.add("aui-datatable-core",function(e,t){e.DataTable.NAME="datatable",e.DataTable.CSS_PREFIX="table"},"4.2.0",{requires:["aui-datatable-body","datatable-base","event-key","aui-event-base"],skinnable:!0}); diff --git a/build/aui-datatable-date-cell-editor/aui-datatable-date-cell-editor-min.js b/build/aui-datatable-date-cell-editor/aui-datatable-date-cell-editor-min.js index 4e473e1135c..af70782f718 100644 --- a/build/aui-datatable-date-cell-editor/aui-datatable-date-cell-editor-min.js +++ b/build/aui-datatable-date-cell-editor/aui-datatable-date-cell-editor-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-date-cell-editor",function(e,t){var n=e.getClassName("celleditor","element"),r;r=e.Component.create({NAME:"dateCellEditor",EXTENDS:e.BaseCellEditor,ATTRS:{bodyContent:{value:""},calendar:{setter:"_setCalendar",validator:e.Lang.isObject,value:null},dateFormat:{value:"%Y-%m-%d",validator:e.Lang.isString},inputFormatter:{value:function(t){var n=this,r=[];return e.Array.each(t,function(e){r.push(n.formatDate(e).toString())}),r}},outputFormatter:{value:function(t){var n=this,r=[];return e.Array.each(t,function(t){r.push(e.DataType.Date.parse(n.get("dateFormat"),t))}),r}}},prototype:{ELEMENT_TEMPLATE:'',initializer:function(){var t=this;t.after("calendar:dateClick",e.bind(t._afterDateSelect,t))},getElementsValue:function(){var e=this;return e.calendar.get("selectedDates")},formatDate:function(t){var n=this,r=n.get("dateFormat"),i=n.get("locale");return e.DataType.Date.format(t,{format:r,locale:i})},_afterDateSelect:function(){var t=this,n=t.calendar.get("selectedDates");t.elements.val(e.Array.invoke(n,"getTime").join(","))},_afterRender:function(){var t=this;e.DateCellEditor.superclass._afterRender.apply(t,arguments),t.calendar=(new e.Calendar(t.get("calendar"))).render(t.bodyNode)},_setCalendar:function(t){var n=this;return e.merge({bubbleTargets:n},t)},_syncElementsFocus:function(){var t=this,n=t.calendar,r=n.get("selectedDates")[0];e.DateCellEditor.superclass._syncElementsFocus.apply(t,arguments),r||(r=n.get("date")),n.focus(),n._highlightDateNode(r)},_uiSetValue:function(t){var n=this,r=n.calendar,i;r&&(e.Lang.isArray(t)||(t=[t]),i=n.formatValue(n.get("outputFormatter"),t),r._clearSelection(),i[0]?(r.set("date",i[0]),r.selectDates(i)):r.set("date",new Date))}}}),e.DateCellEditor=r},"4.1.1",{requires:["aui-datatable-base-options-cell-editor"]}); +YUI.add("aui-datatable-date-cell-editor",function(e,t){var n=e.getClassName("celleditor","element"),r;r=e.Component.create({NAME:"dateCellEditor",EXTENDS:e.BaseCellEditor,ATTRS:{bodyContent:{value:""},calendar:{setter:"_setCalendar",validator:e.Lang.isObject,value:null},dateFormat:{value:"%Y-%m-%d",validator:e.Lang.isString},inputFormatter:{value:function(t){var n=this,r=[];return e.Array.each(t,function(e){r.push(n.formatDate(e).toString())}),r}},outputFormatter:{value:function(t){var n=this,r=[];return e.Array.each(t,function(t){r.push(e.DataType.Date.parse(n.get("dateFormat"),t))}),r}}},prototype:{ELEMENT_TEMPLATE:'',initializer:function(){var t=this;t.after("calendar:dateClick",e.bind(t._afterDateSelect,t))},getElementsValue:function(){var e=this;return e.calendar.get("selectedDates")},formatDate:function(t){var n=this,r=n.get("dateFormat"),i=n.get("locale");return e.DataType.Date.format(t,{format:r,locale:i})},_afterDateSelect:function(){var t=this,n=t.calendar.get("selectedDates");t.elements.val(e.Array.invoke(n,"getTime").join(","))},_afterRender:function(){var t=this;e.DateCellEditor.superclass._afterRender.apply(t,arguments),t.calendar=(new e.Calendar(t.get("calendar"))).render(t.bodyNode)},_setCalendar:function(t){var n=this;return e.merge({bubbleTargets:n},t)},_syncElementsFocus:function(){var t=this,n=t.calendar,r=n.get("selectedDates")[0];e.DateCellEditor.superclass._syncElementsFocus.apply(t,arguments),r||(r=n.get("date")),n.focus(),n._highlightDateNode(r)},_uiSetValue:function(t){var n=this,r=n.calendar,i;r&&(e.Lang.isArray(t)||(t=[t]),i=n.formatValue(n.get("outputFormatter"),t),r._clearSelection(),i[0]?(r.set("date",i[0]),r.selectDates(i)):r.set("date",new Date))}}}),e.DateCellEditor=r},"4.2.0",{requires:["aui-datatable-base-options-cell-editor"]}); diff --git a/build/aui-datatable-dropdown-cell-editor/aui-datatable-dropdown-cell-editor-min.js b/build/aui-datatable-dropdown-cell-editor/aui-datatable-dropdown-cell-editor-min.js index 98a2a36cc3a..4516476b911 100644 --- a/build/aui-datatable-dropdown-cell-editor/aui-datatable-dropdown-cell-editor-min.js +++ b/build/aui-datatable-dropdown-cell-editor/aui-datatable-dropdown-cell-editor-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-dropdown-cell-editor",function(e,t){var n=e.getClassName("form","control"),r=e.getClassName("celleditor","element"),i;i=e.Component.create({NAME:"dropDownCellEditor",ATTRS:{multiple:{value:!1,validator:e.Lang.isBoolean}},EXTENDS:e.BaseOptionsCellEditor,UI_ATTRS:["multiple"],prototype:{ELEMENT_TEMPLATE:'',OPTION_TEMPLATE:'',getElementsValue:function(){var e=this;return e.get("multiple")?e._getSelectedOptions().get("value"):e.elements.get("value")},_syncElementsFocus:function(){var e=this;e.elements.focus()},_uiSetMultiple:function(e){var t=this,n=t.elements;e?n.setAttribute("multiple","multiple"):n.removeAttribute("multiple")}}}),e.DropDownCellEditor=i},"4.1.1",{requires:["aui-datatable-base-options-cell-editor"]}); +YUI.add("aui-datatable-dropdown-cell-editor",function(e,t){var n=e.getClassName("form","control"),r=e.getClassName("celleditor","element"),i;i=e.Component.create({NAME:"dropDownCellEditor",ATTRS:{multiple:{value:!1,validator:e.Lang.isBoolean}},EXTENDS:e.BaseOptionsCellEditor,UI_ATTRS:["multiple"],prototype:{ELEMENT_TEMPLATE:'',OPTION_TEMPLATE:'',getElementsValue:function(){var e=this;return e.get("multiple")?e._getSelectedOptions().get("value"):e.elements.get("value")},_syncElementsFocus:function(){var e=this;e.elements.focus()},_uiSetMultiple:function(e){var t=this,n=t.elements;e?n.setAttribute("multiple","multiple"):n.removeAttribute("multiple")}}}),e.DropDownCellEditor=i},"4.2.0",{requires:["aui-datatable-base-options-cell-editor"]}); diff --git a/build/aui-datatable-highlight/aui-datatable-highlight-min.js b/build/aui-datatable-highlight/aui-datatable-highlight-min.js index a6ef5c5681a..2c1cf593b28 100644 --- a/build/aui-datatable-highlight/aui-datatable-highlight-min.js +++ b/build/aui-datatable-highlight/aui-datatable-highlight-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-highlight",function(e,t){var n=e.Lang,r=n.isArray,i=n.isString,s=n.isBoolean,o=function(t){var s=0,o;i(t)?t=n.trim(t).replace(/\s+/g," ").split(" "):r(t)||(t=e.Array(t));for(o=4-t.length;s
',_lastActiveRow:null,_nodes:null,initializer:function(){var t=this,n=t.get("host");t.CLASS_NAMES={active:n.getClassName("active"),border:n.getClassName("highlight","border"),highlight:n.getClassName("highlight"),overlay:n.getClassName("highlight","overlay"),overlayActive:n.getClassName("highlight","overlay","active")},t.afterHostEvent("activeCoordChange",t._afterActiveCoordChange),t.afterHostEvent("blur",t._afterBlur),t.afterHostEvent("dataChange",t._afterDataChange),t.afterHostEvent("selectionChange",t._afterSelectionChange),e.on("windowresize",e.bind(t._afterWindowResize,t))},clear:function(){var e=this,t=e.get("host"),n=t.get("activeCell");n&&n.removeClass(e.CLASS_NAMES.active),e._clearBorders(),e._clearHighlights()},getActiveRegion:function(){var e=this,t=e.get("host"),n=e.get("type"),r=null,i;return n==="rows"?i=t.get("activeRow"):i=t.get("activeCell"),i&&(r=i.get("region")),r},getSelectionRegion:function(){var e=this,t=e._nodes,n=t[0].get("region"),r=t[t.length-1].get("region");return{0:n.top,1:n.left,bottom:r.bottom,height:r.bottom-n.top,left:n.left,right:r.right,top:n.top,width:r.right-n.left}},_afterActiveCoordChange:function(){var e=this,t=e.get("host"),n=e.get("activeBorderWidth"),r=e.get("overlayActiveNode"),i=e.CLASS_NAMES,s=t.get("activeRow"),o=e._lastActiveRow;if(!e.get("type"))return;e.clear(),o&&o.removeClass(i.active),s&&(e._alignBorder(r,e.getActiveRegion(),n),s.addClass(i.active)),e._lastActiveRow=s},_afterBlur:function(){this.clear()},_afterDataChange:function(){this._afterBlur()},_afterSelectionChange:function(t){var n=this,r,i=n.get("highlightRange"),s=n.get("overlayNode"),o=n.get("rangeBorderWidth");if(!n.get("type"))return;n._clearHighlights(),r=n._collectNodes(t.newVal),i&&r&&r.length>1&&(n._alignBorder(s,n.getSelectionRegion(),o),e.Array.each(r,function(e){e.addClass(n.CLASS_NAMES.highlight)}))},_afterWindowResize:function(){var e=this,t=e.get("activeBorderWidth"),n=e.get("overlayActiveNode"),r=e.get("overlayNode"),i=e.get("rangeBorderWidth");n.inDoc()&&e._alignBorder(n,e.getActiveRegion(),t),r.inDoc()&&e._alignBorder(r,e.getSelectionRegion(),i)},_alignBorder:function(e,t,n){var r=this,i=r.get("host");i._tableNode.ancestor().appendChild(e);if(t){var s=e.get("children"),o=s.item(0),u=s.item(1),a=s.item(2),f=s.item(3);e.setXY([t.left,t.top]),o.sizeTo(t.width,n[0]),f.sizeTo(n[3],t.height-n[2]),a.sizeTo(t.width,n[2]),u.sizeTo(n[1],t.height-n[2]),o.setXY([t.left,t.top]),f.setXY([t.left,t.top]),a.setXY([t.left,t.bottom-n[2]]),u.setXY([t.right-n[1],t.top])}},_collectNodes:function(e){var t=this,n=t.get("type");return!n||!e?null:t._nodes=e[n]},_clearBorders:function(){var e=this;e.get("overlayNode").remove(),e.get("overlayActiveNode").remove()},_clearHighlights:function(){var t=this;e.Array.each(t._nodes,function(e){e&&e.removeClass(t.CLASS_NAMES.highlight)})},_validateType:function(e){return e==="cells"||e==="rows"||e===null}},{NS:"highlight",NAME:"datatable-highlight",ATTRS:{activeBorderWidth:{setter:o,value:2},overlayActiveNode:{setter:function(t){var r=this,i=r.CLASS_NAMES;return t||(t=e.Node.create(n.sub(r.TPL_FRAME,i)),t.addClass(i.overlayActive)),t},value:null},overlayNode:{setter:function(t){var r=this;return t||(t=e.Node.create(n.sub(r.TPL_FRAME,r.CLASS_NAMES))),t},value:null},highlightRange:{validator:s,value:!0},rangeBorderWidth:{setter:o,value:1},type:{validator:"_validateType",value:"cells"}}});e.namespace("Plugin").DataTableHighlight=u},"4.1.1",{requires:["aui-datatable-selection"],skinnable:!0}); +YUI.add("aui-datatable-highlight",function(e,t){var n=e.Lang,r=n.isArray,i=n.isString,s=n.isBoolean,o=function(t){var s=0,o;i(t)?t=n.trim(t).replace(/\s+/g," ").split(" "):r(t)||(t=e.Array(t));for(o=4-t.length;s
',_lastActiveRow:null,_nodes:null,initializer:function(){var t=this,n=t.get("host");t.CLASS_NAMES={active:n.getClassName("active"),border:n.getClassName("highlight","border"),highlight:n.getClassName("highlight"),overlay:n.getClassName("highlight","overlay"),overlayActive:n.getClassName("highlight","overlay","active")},t.afterHostEvent("activeCoordChange",t._afterActiveCoordChange),t.afterHostEvent("blur",t._afterBlur),t.afterHostEvent("dataChange",t._afterDataChange),t.afterHostEvent("selectionChange",t._afterSelectionChange),e.on("windowresize",e.bind(t._afterWindowResize,t))},clear:function(){var e=this,t=e.get("host"),n=t.get("activeCell");n&&n.removeClass(e.CLASS_NAMES.active),e._clearBorders(),e._clearHighlights()},getActiveRegion:function(){var e=this,t=e.get("host"),n=e.get("type"),r=null,i;return n==="rows"?i=t.get("activeRow"):i=t.get("activeCell"),i&&(r=i.get("region")),r},getSelectionRegion:function(){var e=this,t=e._nodes,n=t[0].get("region"),r=t[t.length-1].get("region");return{0:n.top,1:n.left,bottom:r.bottom,height:r.bottom-n.top,left:n.left,right:r.right,top:n.top,width:r.right-n.left}},_afterActiveCoordChange:function(){var e=this,t=e.get("host"),n=e.get("activeBorderWidth"),r=e.get("overlayActiveNode"),i=e.CLASS_NAMES,s=t.get("activeRow"),o=e._lastActiveRow;if(!e.get("type"))return;e.clear(),o&&o.removeClass(i.active),s&&(e._alignBorder(r,e.getActiveRegion(),n),s.addClass(i.active)),e._lastActiveRow=s},_afterBlur:function(){this.clear()},_afterDataChange:function(){this._afterBlur()},_afterSelectionChange:function(t){var n=this,r,i=n.get("highlightRange"),s=n.get("overlayNode"),o=n.get("rangeBorderWidth");if(!n.get("type"))return;n._clearHighlights(),r=n._collectNodes(t.newVal),i&&r&&r.length>1&&(n._alignBorder(s,n.getSelectionRegion(),o),e.Array.each(r,function(e){e.addClass(n.CLASS_NAMES.highlight)}))},_afterWindowResize:function(){var e=this,t=e.get("activeBorderWidth"),n=e.get("overlayActiveNode"),r=e.get("overlayNode"),i=e.get("rangeBorderWidth");n.inDoc()&&e._alignBorder(n,e.getActiveRegion(),t),r.inDoc()&&e._alignBorder(r,e.getSelectionRegion(),i)},_alignBorder:function(e,t,n){var r=this,i=r.get("host");i._tableNode.ancestor().appendChild(e);if(t){var s=e.get("children"),o=s.item(0),u=s.item(1),a=s.item(2),f=s.item(3);e.setXY([t.left,t.top]),o.sizeTo(t.width,n[0]),f.sizeTo(n[3],t.height-n[2]),a.sizeTo(t.width,n[2]),u.sizeTo(n[1],t.height-n[2]),o.setXY([t.left,t.top]),f.setXY([t.left,t.top]),a.setXY([t.left,t.bottom-n[2]]),u.setXY([t.right-n[1],t.top])}},_collectNodes:function(e){var t=this,n=t.get("type");return!n||!e?null:t._nodes=e[n]},_clearBorders:function(){var e=this;e.get("overlayNode").remove(),e.get("overlayActiveNode").remove()},_clearHighlights:function(){var t=this;e.Array.each(t._nodes,function(e){e&&e.removeClass(t.CLASS_NAMES.highlight)})},_validateType:function(e){return e==="cells"||e==="rows"||e===null}},{NS:"highlight",NAME:"datatable-highlight",ATTRS:{activeBorderWidth:{setter:o,value:2},overlayActiveNode:{setter:function(t){var r=this,i=r.CLASS_NAMES;return t||(t=e.Node.create(n.sub(r.TPL_FRAME,i)),t.addClass(i.overlayActive)),t},value:null},overlayNode:{setter:function(t){var r=this;return t||(t=e.Node.create(n.sub(r.TPL_FRAME,r.CLASS_NAMES))),t},value:null},highlightRange:{validator:s,value:!0},rangeBorderWidth:{setter:o,value:1},type:{validator:"_validateType",value:"cells"}}});e.namespace("Plugin").DataTableHighlight=u},"4.2.0",{requires:["aui-datatable-selection"],skinnable:!0}); diff --git a/build/aui-datatable-property-list/aui-datatable-property-list-min.js b/build/aui-datatable-property-list/aui-datatable-property-list-min.js index f0d1d9b08d6..ef90f54031d 100644 --- a/build/aui-datatable-property-list/aui-datatable-property-list-min.js +++ b/build/aui-datatable-property-list/aui-datatable-property-list-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-property-list",function(e,t){var n=e.Lang,r=n.isFunction;e.PropertyList=e.Base.create(e.DataTable.NAME,e.DataTable,[e.WidgetCssClass,e.WidgetToggle],{initializer:function(e){var t=this;t.CLASS_NAMES_PROPERTY_LIST={cell:t.getClassName("cell")},t._initHighlight(),t.after(t._afterRenderUI,t,"renderUI"),t.after(t._afterUITriggerSort,t,"_onUITriggerSort"),t.on("activeCellChange",t._onActiveCellChange),e.columns||this.set("columns",t._state.get("columns","initValue"))},getDefaultEditor:function(){return new e.TextCellEditor},_afterRenderUI:function(){var e=this;e.get("boundingBox").addClass(e.getClassName("property-list"))},_afterUITriggerSort:function(){var e=this;e.highlight.clear()},_initHighlight:function(){var t=this;t.plug(e.Plugin.DataTableHighlight,{highlightRange:!1,type:"rows"})},_onActiveCellChange:function(e){var t=this,n=e.newVal,r;n&&(r=t.getColumn(n),r&&r.key==="name"&&(e.newVal=n.next("."+t.CLASS_NAMES_PROPERTY_LIST.cell)))},_onSelectionKey:function(t){var n=this;if(n.get("activeCell")&&n.get("focused")){var r=t.keyCode,i=e.Widget.getByNode(t.target);i instanceof e.DataTable&&(i&&r===13&&n._onEditCell(t),e.PropertyList.superclass._onSelectionKey.apply(this,arguments),n._syncPropertyListScrollUI())}},_syncPropertyListScrollUI:function(){var e=this,t=e.get("activeRow");t&&e.scrollTo&&e.scrollTo(t.get("id"))}},{CSS_PREFIX:e.DataTable.CSS_PREFIX,ATTRS:{columns:{valueFn:function(){var e=this;return[{editor:!1,key:"name",label:e.getString("propertyName"),sortable:!0},{editor:e.getDefaultEditor(),formatter:function(e){var t=this,n=e.data;if(!n)return;var i=n.formatter;return r(i)?i.apply(t,arguments):n.value},key:"value",label:e.getString("value"),sortable:!0,width:"auto"}]}},scrollable:{value:!0},editEvent:{valueFn:function(){return e.UA.touchEnabled&&e.UA.mobile?"click":"dblclick"}},width:{setter:String},strings:{value:{propertyName:"Property Name",value:"Value"}}}})},"4.1.1",{requires:["datatable-scroll","datatable-sort","aui-datatable-core","aui-datatable-edit","aui-datatable-highlight","aui-datatable-selection","aui-widget-cssclass","aui-widget-toggle"],skinnable:!0}); +YUI.add("aui-datatable-property-list",function(e,t){var n=e.Lang,r=n.isFunction;e.PropertyList=e.Base.create(e.DataTable.NAME,e.DataTable,[e.WidgetCssClass,e.WidgetToggle],{initializer:function(e){var t=this;t.CLASS_NAMES_PROPERTY_LIST={cell:t.getClassName("cell")},t._initHighlight(),t.after(t._afterRenderUI,t,"renderUI"),t.after(t._afterUITriggerSort,t,"_onUITriggerSort"),t.on("activeCellChange",t._onActiveCellChange),e.columns||this.set("columns",t._state.get("columns","initValue"))},getDefaultEditor:function(){return new e.TextCellEditor},_afterRenderUI:function(){var e=this;e.get("boundingBox").addClass(e.getClassName("property-list"))},_afterUITriggerSort:function(){var e=this;e.highlight.clear()},_initHighlight:function(){var t=this;t.plug(e.Plugin.DataTableHighlight,{highlightRange:!1,type:"rows"})},_onActiveCellChange:function(e){var t=this,n=e.newVal,r;n&&(r=t.getColumn(n),r&&r.key==="name"&&(e.newVal=n.next("."+t.CLASS_NAMES_PROPERTY_LIST.cell)))},_onSelectionKey:function(t){var n=this;if(n.get("activeCell")&&n.get("focused")){var r=t.keyCode,i=e.Widget.getByNode(t.target);i instanceof e.DataTable&&(i&&r===13&&n._onEditCell(t),e.PropertyList.superclass._onSelectionKey.apply(this,arguments),n._syncPropertyListScrollUI())}},_syncPropertyListScrollUI:function(){var e=this,t=e.get("activeRow");t&&e.scrollTo&&e.scrollTo(t.get("id"))}},{CSS_PREFIX:e.DataTable.CSS_PREFIX,ATTRS:{columns:{valueFn:function(){var e=this;return[{editor:!1,key:"name",label:e.getString("propertyName"),sortable:!0},{editor:e.getDefaultEditor(),formatter:function(e){var t=this,n=e.data;if(!n)return;var i=n.formatter;return r(i)?i.apply(t,arguments):n.value},key:"value",label:e.getString("value"),sortable:!0,width:"auto"}]}},scrollable:{value:!0},editEvent:{valueFn:function(){return e.UA.touchEnabled&&e.UA.mobile?"click":"dblclick"}},width:{setter:String},strings:{value:{propertyName:"Property Name",value:"Value"}}}})},"4.2.0",{requires:["datatable-scroll","datatable-sort","aui-datatable-core","aui-datatable-edit","aui-datatable-highlight","aui-datatable-selection","aui-widget-cssclass","aui-widget-toggle"],skinnable:!0}); diff --git a/build/aui-datatable-radio-cell-editor/aui-datatable-radio-cell-editor-min.js b/build/aui-datatable-radio-cell-editor/aui-datatable-radio-cell-editor-min.js index f21dfab9881..eba0115a16e 100644 --- a/build/aui-datatable-radio-cell-editor/aui-datatable-radio-cell-editor-min.js +++ b/build/aui-datatable-radio-cell-editor/aui-datatable-radio-cell-editor-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-radio-cell-editor",function(e,t){var n=e.Component.create({NAME:"radioCellEditor",EXTENDS:e.CheckboxCellEditor,prototype:{OPTION_TEMPLATE:'',OPTION_WRAPPER:'',getElementsValue:function(){var e=this;return e._getSelectedOptions().get("value")[0]}}});e.RadioCellEditor=n},"4.1.1",{requires:["aui-datatable-base-options-cell-editor"]}); +YUI.add("aui-datatable-radio-cell-editor",function(e,t){var n=e.Component.create({NAME:"radioCellEditor",EXTENDS:e.CheckboxCellEditor,prototype:{OPTION_TEMPLATE:'',OPTION_WRAPPER:'',getElementsValue:function(){var e=this;return e._getSelectedOptions().get("value")[0]}}});e.RadioCellEditor=n},"4.2.0",{requires:["aui-datatable-base-options-cell-editor"]}); diff --git a/build/aui-datatable-selection/aui-datatable-selection-min.js b/build/aui-datatable-selection/aui-datatable-selection-min.js index d7f649d4962..57312e2a86c 100644 --- a/build/aui-datatable-selection/aui-datatable-selection-min.js +++ b/build/aui-datatable-selection/aui-datatable-selection-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-selection",function(e,t){var n=e.Lang,r=n.isArray,i=n.isString,s=n.isObject,o=function(e,t,n){return Math.min(Math.max(e,t),n)},u=function(){};u.ATTRS={activeCell:{getter:"_getActiveCell"},activeCoord:{value:[-1,-1]},activeRow:{getter:"_getActiveRow"},selection:{setter:"_setSelection"},tabIndex:{value:0}},e.mix(u.prototype,{_capturing:!1,_selectionEnd:null,_selectionSeed:null,_selectionStart:null,initializer:function(){var e=this,t=e.get("boundingBox");e.CLASS_NAMES_SELECTION={cell:e.getClassName("cell"),selection:e.getClassName("selection")},e._bindSelectionUI(),t.addClass(e.CLASS_NAMES_SELECTION.selection)},destroy:function(){var e=this;e._selectionKeyHandler.detach()},captureSelection:function(t){var n=this,r=[],i=[],s=[],o=[],u;for(u=0;u-1&&r>-1?e.getCell([n,r]):null},_getActiveRow:function(){var e=this,t=e.get("activeCoord"),n=t[0];return n>-1?e.getRow(n):null},_onSelectionMouseDown:function(e){var t=this,n=e.currentTarget,r=t.get("boundingBox"),i=t.getCoord(n);r.unselectable(),t._capturing=!0,t._selectionSeed=n,t._selectionStart=t._selectionEnd=t.getCoord(n),t.set("activeCoord",i)},_onSelectionMouseEnter:function(e){var t=this,n=e.currentTarget;if(!t._capturing)return;t._selectionSeed=n,t._selectionEnd=t.getCoord(n),t.set("selection",{start:t._selectionStart,end:t._selectionEnd})},_onSelectionMouseUp:function(){var e=this,t=e.get("boundingBox");e.get("focused")&&(e._selectionEnd=e.getCoord(e._selectionSeed),e.set("selection",{start:e._selectionStart,end:e._selectionEnd})),t.selectable(),e._capturing=!1},_onSelectionKey:function(e){var t=this,n=t.body,r=n.tbodyNode,i=e.keyCode,s=t.get("activeCell"),u,a=r.get("children").size(),f=n.get("columns").length,l,c;s&&t.get("focused")&&(u=t.getCoord(s),l=u[0],c=u[1],i===37?c--:i===38?l--:i===39?c++:i===40&&l++,l=o(l,0,a-1),c=o(c,0,f-1),t.set("activeCoord",[l,c]),t.set("selection",[l,c]),e.preventDefault())},_parseRange:function(e){var t=e[0],n=e[1],r=[],i,s;for(i=Math.min(t[0],n[0]);i<=Math.max(t[0],n[0]);i++)for(s=Math.min(t[1],n[1]);s<=Math.max(t[1],n[1]);s++)r.push([i,s]);return r},_setSelection:function(t){var n=this;return r(t)?r(t[0])||(t=[t]):s(t)?t=n._parseRange([t.start,t.end]):e.instanceOf(t,e.Node)&&(t=[n.getCoord(t)]),n.captureSelection(t)}}),e.DataTable.Selection=u,e.Base.mix(e.DataTable,[u]),e.DataTable.prototype.getColumn=function(t){return function(n){var r;return e.instanceOf(n,e.Node)&&(r=this.getCell(n),n=r&&(r.get("className").match(new RegExp(this.getClassName("col","(\\w+)")))||[])[1]),t.call(this,n)}}(e.DataTable.prototype.getColumn),e.DataTable.prototype.getRow=function(t){return function(n){var r=this,i=r.body.tbodyNode,s;return e.instanceOf(n,e.Node)?(s=n.ancestor(function(e){return e.get("parentNode").compareTo(i)},!0),s):t.call(this,n)}}(e.DataTable.prototype.getRow),e.DataTable.prototype._setColumns=function(t){function f(e){var t={},n,i,l;r.push(e),o.push(t);for(n in e)e.hasOwnProperty(n)&&(i=e[n],a(i)?t[n]=i.slice():s(i,!0)&&i.constructor===t.constructor?(l=u(i,r),t[n]=l===-1?f(i):o[l]):t[n]=e[n]);return t}function l(e){return e=e.replace(/\s+/,"-"),n[e]?e+=n[e]++:n[e]=1,e}function c(t,n){var r=[],s,o,u,h;for(s=0,o=t.length;s-1&&r>-1?e.getCell([n,r]):null},_getActiveRow:function(){var e=this,t=e.get("activeCoord"),n=t[0];return n>-1?e.getRow(n):null},_onSelectionMouseDown:function(e){var t=this,n=e.currentTarget,r=t.get("boundingBox"),i=t.getCoord(n);r.unselectable(),t._capturing=!0,t._selectionSeed=n,t._selectionStart=t._selectionEnd=t.getCoord(n),t.set("activeCoord",i)},_onSelectionMouseEnter:function(e){var t=this,n=e.currentTarget;if(!t._capturing)return;t._selectionSeed=n,t._selectionEnd=t.getCoord(n),t.set("selection",{start:t._selectionStart,end:t._selectionEnd})},_onSelectionMouseUp:function(){var e=this,t=e.get("boundingBox");e.get("focused")&&(e._selectionEnd=e.getCoord(e._selectionSeed),e.set("selection",{start:e._selectionStart,end:e._selectionEnd})),t.selectable(),e._capturing=!1},_onSelectionKey:function(e){var t=this,n=t.body,r=n.tbodyNode,i=e.keyCode,s=t.get("activeCell"),u,a=r.get("children").size(),f=n.get("columns").length,l,c;s&&t.get("focused")&&(u=t.getCoord(s),l=u[0],c=u[1],i===37?c--:i===38?l--:i===39?c++:i===40&&l++,l=o(l,0,a-1),c=o(c,0,f-1),t.set("activeCoord",[l,c]),t.set("selection",[l,c]),e.preventDefault())},_parseRange:function(e){var t=e[0],n=e[1],r=[],i,s;for(i=Math.min(t[0],n[0]);i<=Math.max(t[0],n[0]);i++)for(s=Math.min(t[1],n[1]);s<=Math.max(t[1],n[1]);s++)r.push([i,s]);return r},_setSelection:function(t){var n=this;return r(t)?r(t[0])||(t=[t]):s(t)?t=n._parseRange([t.start,t.end]):e.instanceOf(t,e.Node)&&(t=[n.getCoord(t)]),n.captureSelection(t)}}),e.DataTable.Selection=u,e.Base.mix(e.DataTable,[u]),e.DataTable.prototype.getColumn=function(t){return function(n){var r;return e.instanceOf(n,e.Node)&&(r=this.getCell(n),n=r&&(r.get("className").match(new RegExp(this.getClassName("col","(\\w+)")))||[])[1]),t.call(this,n)}}(e.DataTable.prototype.getColumn),e.DataTable.prototype.getRow=function(t){return function(n){var r=this,i=r.body.tbodyNode,s;return e.instanceOf(n,e.Node)?(s=n.ancestor(function(e){return e.get("parentNode").compareTo(i)},!0),s):t.call(this,n)}}(e.DataTable.prototype.getRow),e.DataTable.prototype._setColumns=function(t){function f(e){var t={},n,i,l;r.push(e),o.push(t);for(n in e)e.hasOwnProperty(n)&&(i=e[n],a(i)?t[n]=i.slice():s(i,!0)&&i.constructor===t.constructor?(l=u(i,r),t[n]=l===-1?f(i):o[l]):t[n]=e[n]);return t}function l(e){return e=e.replace(/\s+/,"-"),n[e]?e+=n[e]++:n[e]=1,e}function c(t,n){var r=[],s,o,u,h;for(s=0,o=t.length;s'}});e.TextAreaCellEditor=i},"4.1.1",{requires:["aui-datatable-base-options-cell-editor"]}); +YUI.add("aui-datatable-text-area-cell-editor",function(e,t){var n=e.getClassName("form","control"),r=e.getClassName("celleditor","element"),i=e.Component.create({NAME:"textAreaCellEditor",EXTENDS:e.BaseCellEditor,prototype:{ELEMENT_TEMPLATE:''}});e.TextAreaCellEditor=i},"4.2.0",{requires:["aui-datatable-base-options-cell-editor"]}); diff --git a/build/aui-datatable-text-cell-editor/aui-datatable-text-cell-editor-min.js b/build/aui-datatable-text-cell-editor/aui-datatable-text-cell-editor-min.js index cd73f469d8b..cdc90306188 100644 --- a/build/aui-datatable-text-cell-editor/aui-datatable-text-cell-editor-min.js +++ b/build/aui-datatable-text-cell-editor/aui-datatable-text-cell-editor-min.js @@ -1 +1 @@ -YUI.add("aui-datatable-text-cell-editor",function(e,t){var n=e.getClassName("form","control"),r=e.getClassName("celleditor","element"),i=e.Component.create({NAME:"textCellEditor",EXTENDS:e.BaseCellEditor,prototype:{ELEMENT_TEMPLATE:''}});e.TextCellEditor=i},"4.1.1",{requires:["aui-datatable-base-options-cell-editor"]}); +YUI.add("aui-datatable-text-cell-editor",function(e,t){var n=e.getClassName("form","control"),r=e.getClassName("celleditor","element"),i=e.Component.create({NAME:"textCellEditor",EXTENDS:e.BaseCellEditor,prototype:{ELEMENT_TEMPLATE:''}});e.TextCellEditor=i},"4.2.0",{requires:["aui-datatable-base-options-cell-editor"]}); diff --git a/build/aui-datatype-date-parse/aui-datatype-date-parse-min.js b/build/aui-datatype-date-parse/aui-datatype-date-parse-min.js index cc523ef4eaf..95f4872e5ad 100644 --- a/build/aui-datatype-date-parse/aui-datatype-date-parse-min.js +++ b/build/aui-datatype-date-parse/aui-datatype-date-parse-min.js @@ -1 +1 @@ -YUI.add("aui-datatype-date-parse",function(e,t){function s(e){var t=this;e&&t.compilePattern(e)}var n=e.Lang,r=n.String,i=function(e){e=parseInt(e,10);if(!isNaN(e))return e};s.TOKEN_PREFIX="%",s.TWO_DIGIT_YEAR_BASE=2e3,e.mix(s.prototype,{compiled:null,compilePattern:function(e){var t=this,r,i,o=[],u,a,f,l=e.length,c;for(a=0;a-1,token:i},f=o[o.length-1],f&&!n.isString(f)&&(u.sequence=!0,f.sequence=!0),o.push(u),a++}else o.push(r)}t.compiled=o},parse:function(e,t){var r=this,i={},o=r.compiled,u,a=o.length,f,l,c,h=[0],p;e=n.trim(e),c=e.length;if(!c)return!1;for(u=0;uc)break;if(n.isString(f)){h[0]++;continue}f.sequence?s.HINTS.TZ===f.hints?p=r._subparseTimeZone(e,h):f.numeric?(p=r._getNextNumericValue(e,h),p=r._subparseNumericBlob(p,h,u)):(p=r._getNextValue(e,h,null),p=r._subparseStringBlob(p,h,u)):(l=r._findNextSeparatorPos(o,u,e,h),u=l-1,p=r._getNextValue(e,h,o[l])),f.hints.setter&&f.hints.setter.call(r,i,n.trim(p),f)}return r._getCalendarDate(i,t)},_expandPattern:function(t,n,r){var i=this,s=e.Date.aggregates[r];return s==="locale"&&(s=i._getLangResource(r)),s?t.substring(0,n)+s+t.substring(n+2,t.length):t},_findBestStringMatch:function(e,t,n){var r=-1,i=0,s=t.length,o,u,a,f=e.length;e=e.toLowerCase();for(a=0;ai[0]){o=u;break}return o},_getCalendarDate:function(t,r){var i;return e.Object.isEmpty(t)?!1:(r=r||new Date,i=r.getDate(),n.isValue(t.year)&&r.setFullYear(t.year),r.setDate(1),n.isValue(t.month)&&r.setMonth(t.month),n.isValue(t.day)?r.setDate(t.day):r.setDate(i),n.isValue(t.hours)&&(t.isoTime||(t.ampm?t.hours<12&&(t.hours+=12):t.hours===12&&(t.hours=0)),r.setHours(t.hours)),n.isValue(t.minutes)?r.setMinutes(t.minutes):r.setMinutes(0),n.isValue(t.seconds)?r.setSeconds(t.seconds):r.setSeconds(0),r)},_getNextValue:function(e,t,n,r){var i=e.length,s,o="";while(t[0]-1)break}return s>-1&&(e=o[s],t[0]+=e.length),e},_subparseTimeZone:function(e,t){var n,r;return e=e.substring(t[0]),n=/\b[A-Z]{3}([+\-\s])?(\d{1,2})?:?(\d{1,2})?/.exec(e),n&&(r=n[0],t[0]+=e.indexOf(r)+r.length),r}}),s.HINTS={AGGREGATES:{aggregates:!0},AMPM:{setter:function(e,t){var n=this,r=n._findBestStringMatch(t.toLowerCase(),n._getLangResource("P"));r>-1&&(e.ampm=r)}},YEAR:{numericTokens:"yY",setter:function(e,t,r){var o=i(t);r.token==="y"&&n.isValue(o)&&(o+=o<0?-s.TWO_DIGIT_YEAR_BASE:+s.TWO_DIGIT_YEAR_BASE),n.isNumber(o)&&(e.year=o)},size:4},MONTH:{numericTokens:"m",setter:function(e,t){var r=this,i=parseInt(t,10);n.isNumber(i)?i-=1:i=r._findBestStringMatch(t,r._getLangResource("B")),n.isNumber(i)&&i>-1&&(e.month=i)},size:2},DAY:{numericTokens:"de",setter:function(e,t){t=i(t),n.isNumber(t)&&(e.day=t)},size:2},HOURS:{numericTokens:"HIkl",setter:function(e,t,n){e.hours=i(t),e.isoTime=!1;if(n.token==="H"||n.token==="k")e.isoTime=!0},size:2},MINUTES:{numericTokens:"M",setter:function(e,t){t=i(t),n.isNumber(t)&&(e.minutes=t)},size:2},SECONDS:{numericTokens:"S",setter:function(e,t){t=i(t),n.isNumber(t)&&(e.seconds=t)},size:2},TZ:{setter:function(e,t){e.tz=t}}},e.DateParser=s,e.Date.dateparser=new e.DateParser;var o=e.Date.parse;e.Date.parse=function(t,n,r){return arguments.length===1?o(arguments[0]):(e.Date.dateparser.compilePattern(t),e.Date.dateparser.parse(n,r))},e.Parsers.date=e.Date.parse},"4.1.1",{requires:["aui-base-lang","datatype-date-format","datatype-date-parse","intl"]}); +YUI.add("aui-datatype-date-parse",function(e,t){function s(e){var t=this;e&&t.compilePattern(e)}var n=e.Lang,r=n.String,i=function(e){e=parseInt(e,10);if(!isNaN(e))return e};s.TOKEN_PREFIX="%",s.TWO_DIGIT_YEAR_BASE=2e3,e.mix(s.prototype,{compiled:null,compilePattern:function(e){var t=this,r,i,o=[],u,a,f,l=e.length,c;for(a=0;a-1,token:i},f=o[o.length-1],f&&!n.isString(f)&&(u.sequence=!0,f.sequence=!0),o.push(u),a++}else o.push(r)}t.compiled=o},parse:function(e,t){var r=this,i={},o=r.compiled,u,a=o.length,f,l,c,h=[0],p;e=n.trim(e),c=e.length;if(!c)return!1;for(u=0;uc)break;if(n.isString(f)){h[0]++;continue}f.sequence?s.HINTS.TZ===f.hints?p=r._subparseTimeZone(e,h):f.numeric?(p=r._getNextNumericValue(e,h),p=r._subparseNumericBlob(p,h,u)):(p=r._getNextValue(e,h,null),p=r._subparseStringBlob(p,h,u)):(l=r._findNextSeparatorPos(o,u,e,h),u=l-1,p=r._getNextValue(e,h,o[l])),f.hints.setter&&f.hints.setter.call(r,i,n.trim(p),f)}return r._getCalendarDate(i,t)},_expandPattern:function(t,n,r){var i=this,s=e.Date.aggregates[r];return s==="locale"&&(s=i._getLangResource(r)),s?t.substring(0,n)+s+t.substring(n+2,t.length):t},_findBestStringMatch:function(e,t,n){var r=-1,i=0,s=t.length,o,u,a,f=e.length;e=e.toLowerCase();for(a=0;ai[0]){o=u;break}return o},_getCalendarDate:function(t,r){var i;return e.Object.isEmpty(t)?!1:(r=r||new Date,i=r.getDate(),n.isValue(t.year)&&r.setFullYear(t.year),r.setDate(1),n.isValue(t.month)&&r.setMonth(t.month),n.isValue(t.day)?r.setDate(t.day):r.setDate(i),n.isValue(t.hours)&&(t.isoTime||(t.ampm?t.hours<12&&(t.hours+=12):t.hours===12&&(t.hours=0)),r.setHours(t.hours)),n.isValue(t.minutes)?r.setMinutes(t.minutes):r.setMinutes(0),n.isValue(t.seconds)?r.setSeconds(t.seconds):r.setSeconds(0),r)},_getNextValue:function(e,t,n,r){var i=e.length,s,o="";while(t[0]-1)break}return s>-1&&(e=o[s],t[0]+=e.length),e},_subparseTimeZone:function(e,t){var n,r;return e=e.substring(t[0]),n=/\b[A-Z]{3}([+\-\s])?(\d{1,2})?:?(\d{1,2})?/.exec(e),n&&(r=n[0],t[0]+=e.indexOf(r)+r.length),r}}),s.HINTS={AGGREGATES:{aggregates:!0},AMPM:{setter:function(e,t){var n=this,r=n._findBestStringMatch(t.toLowerCase(),n._getLangResource("P"));r>-1&&(e.ampm=r)}},YEAR:{numericTokens:"yY",setter:function(e,t,r){var o=i(t);r.token==="y"&&n.isValue(o)&&(o+=o<0?-s.TWO_DIGIT_YEAR_BASE:+s.TWO_DIGIT_YEAR_BASE),n.isNumber(o)&&(e.year=o)},size:4},MONTH:{numericTokens:"m",setter:function(e,t){var r=this,i=parseInt(t,10);n.isNumber(i)?i-=1:i=r._findBestStringMatch(t,r._getLangResource("B")),n.isNumber(i)&&i>-1&&(e.month=i)},size:2},DAY:{numericTokens:"de",setter:function(e,t){t=i(t),n.isNumber(t)&&(e.day=t)},size:2},HOURS:{numericTokens:"HIkl",setter:function(e,t,n){e.hours=i(t),e.isoTime=!1;if(n.token==="H"||n.token==="k")e.isoTime=!0},size:2},MINUTES:{numericTokens:"M",setter:function(e,t){t=i(t),n.isNumber(t)&&(e.minutes=t)},size:2},SECONDS:{numericTokens:"S",setter:function(e,t){t=i(t),n.isNumber(t)&&(e.seconds=t)},size:2},TZ:{setter:function(e,t){e.tz=t}}},e.DateParser=s,e.Date.dateparser=new e.DateParser;var o=e.Date.parse;e.Date.parse=function(t,n,r){return arguments.length===1?o(arguments[0]):(e.Date.dateparser.compilePattern(t),e.Date.dateparser.parse(n,r))},e.Parsers.date=e.Date.parse},"4.2.0",{requires:["aui-base-lang","datatype-date-format","datatype-date-parse","intl"]}); diff --git a/build/aui-datatype/aui-datatype-min.js b/build/aui-datatype/aui-datatype-min.js index bb02c98c922..15a1c58d9d6 100644 --- a/build/aui-datatype/aui-datatype-min.js +++ b/build/aui-datatype/aui-datatype-min.js @@ -1,2 +1,2 @@ YUI.add("aui-datatype",function(e,t){var n=e.Lang,r=60,i=1e3,s=24,o=e.namespace("DataType.Boolean"),u=e.namespace("DataType.String");o.parse=function(t){return t=e.Lang.trim(t),t==="false"?!1:!!t},u.evaluate=function(t){var r=e.Lang.trim(t);if(r==="true"||r==="false")return o.parse(t);if(r&&n.isString(r)){var i=+r;if(!isNaN(i))return i}return t};var n=e.Lang,a=e.Lang.String,f=n.isDate,l=n.isValue;e.namespace("DataType.DateMath"),e.mix(e.DataType.DateMath,{DAY:"D",WEEK:"W",YEAR:"Y",MONTH:"M",MINUTES:"MINUTES",HOUR:"HOUR",SECONDS:"SECONDS",MAX_MONTH_LENGTH:31,WEEK_LENGTH:7,ONE_DAY_MS:i*r*r*s,ONE_HOUR_MS:i*r*r,ONE_MINUTE_MS:i*r,ONE_SECOND_MS:i,WEEK_ONE_JAN_DATE:1,add:function(e,t,n){var r=new Date(e.getTime());switch(t){case this.MONTH:var i=e.getMonth()+n,s=0;if(i<0)while(i<0)i+=12,s-=1;else if(i>11)while(i>11)i-=12,s+=1;r.setMonth(i),r.setFullYear(e.getFullYear()+s);break;case this.DAY:this._addDays(r,n);break;case this.YEAR:r.setFullYear(e.getFullYear()+n);break;case this.WEEK:this._addDays(r,n*7);break;case this.HOUR:var o=r.getHours();r.setHours(o+n);break;case this.MINUTES:var u=r.getMinutes();r.setMinutes(u+n);break;case this.SECONDS:var a=r.getSeconds();r.setSeconds(a+n)}return r},_addDays:function(t,n){if(e.UA.webkit&&e.UA.webkit<420)if(n<0)for(var r=-128;ni;n-=i)t.setDate(t.getDate()+i);t.setDate(t.getDate()+n)},compare:function(e,t){return e&&t&&e.getTime()===t.getTime()},copyHours:function(e,t){e.setHours(t.getHours()),e.setMinutes(t.getMinutes()),e.setSeconds(t.getSeconds()),e.setMilliseconds(t.getMilliseconds())},countDays:function(e,t){var n,r,i,s,o;return this.before(e,t)?(i=e,o=t):(i=t,o=e),s=o.getTime()-i.getTime(),r=Math.floor(s/this.ONE_DAY_MS),n=this.toMidnight(this.add(i,this.DAY,r)),o=this.toMidnight(o),this.before(n,o)&&r++,r},subtract:function(e,t,n){return this.add(e,t,n*-1)},before:function(e,t){var n=t.getTime();return e.getTime()n?!0:!1},between:function(e,t,n){return this.after(e,t)&&this.before(e,n)?!0:!1},getJan1:function(e){return this.getDate(e,0,1)},getDayOffsetYear:function(e,t){var n=this.getJan1(t);return this.getDayOffset(e,n,t)},getDayOffset:function(e,t){return this._absFloor(this.getOffset(e,t,this.ONE_DAY_MS))},getHoursOffset:function(e,t){return this._absFloor(this.getOffset(e,t,this.ONE_HOUR_MS))},getMinutesOffset:function(e,t){return this._absFloor(this.getOffset(e,t,this.ONE_MINUTE_MS))},getSecondsOffset:function(e,t){return this._absFloor(this.getOffset(e,t,this.ONE_SECOND_MS))},getOffset:function(e,t,n){var r=(e.getTime()-t.getTime())/(n||0);return r},_absFloor:function(e){var t=Math.floor(Math.abs(e));return e<0&&(t*=-1),t},getWeekNumber:function(e,t,n){t=t||0,n=n||this.WEEK_ONE_JAN_DATE;var r=this.clearTime(e),i,s;r.getDay()===t?i=r:i=this.getFirstDayOfWeek(r,t);var o=i.getFullYear();s=new Date(i.getTime()+6*this.ONE_DAY_MS);var u;if(o!==s.getFullYear()&&s.getDate()>=n)u=1;else{var a=this.clearTime(this.getDate(o,0,n)),f=this.getFirstDayOfWeek(a,t),l=Math.round((r.getTime()-f.getTime())/this.ONE_DAY_MS),c=l%7,h=(l-c)/7;u=h+1}return u},getFirstDayOfWeek:function(e,t){t=t||0;var n=e.getDay(),r=(n-t+7)%7;return this.subtract(e,this.DAY,r)},isWeekDay:function(e){var t=e.getDay();return t>0&&t<6},isTueOrThu:function(e){return this.isWeekDay(e)&&e.getDay()%2===0},isMonWedOrFri:function(e){return this.isWeekDay(e)&&!this.isTueOrThu(e)},isNextDay:function(e,t){return this.getDayOffset(this.safeClearTime(t),this.safeClearTime(e))===1},isDayBoundary:function(e,t){return this.isNextDay(e,t)&&t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0},isDayOverlap:function(e,t){return e.getFullYear()!==t.getFullYear()||e.getMonth()!==t.getMonth()||e.getDate()!==t.getDate()},isToday:function(e){return!this.isDayOverlap(e,new Date)},isSameMonth:function(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()},isYearOverlapWeek:function(e){var t=!1,n=this.add(e,this.DAY,6);return n.getFullYear()!==e.getFullYear()&&(t=!0),t},isMonthOverlapWeek:function(e){var t=!1,n=this.add(e,this.DAY,6);return n.getMonth()!==e.getMonth()&&(t=!0),t},findMonthStart:function(e){var t=this.getDate(e.getFullYear(),e.getMonth(),1);return t},findMonthEnd:function(e){var t=this.findMonthStart(e),n=this.add(t,this.MONTH,1),r=this.subtract(n,this.DAY,1);return r.setHours(23,59,59,999),r},clearTime:function(e){return e.setHours(12,0,0,0),e},safeClearTime:function(e){return this.clearTime(this.clone(e))},toLastHour:function(e){return e=this.clone(e),e.setHours(23,59,59,999),e},toMidnight:function(e){return e=this.clone(e),e.setHours(0,0,0,0),e},clone:function(e){return new Date(e.getTime())},getDate:function(e,t,n){var r=null;return l(n)||(n=1),e>=100?r=new Date(e,t,n):(r=new Date,r.setFullYear(e),r.setMonth(t),r.setDate(n),r.setHours(0,0,0,0)),r},getDaysInMonth:function(e,t){return this.findMonthEnd(this.getDate(e,t)).getDate()},toUsTimeString:function(e,t,n,r){e=f(e)?e:new Date(0,0,0,e);var i=e.getHours(),s=e.getMinutes(),o=!1;i>=12?(o=!0,i>12&&(i-=12)):i===0&&(i=12);var u=t?a.padNumber(i,2):String(i);return n||(u+=":",u+=a.padNumber(s,2)),r||(u+=o?"pm":"am"),u},toIsoTimeString:function(e,t){e=f(e)?e:new Date(0,0,0,e);var n=e.getHours(),r=e.getMinutes(),i=a.padNumber(n,2)+":"+a.padNumber(r,2);if(t){var s=e.getSeconds();i+=":",i+=a.padNumber(s,2)}return i}}),function(e){var t={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};e.namespace("DataType.Date.Locale"),e.DataType.Date.Locale.en=t,e.DataType.Date.Locale["en-US"]=e.merge(t,{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"}),e.DataType.Date -.Locale["en-GB"]=e.merge(t,{r:"%l:%M:%S %P %Z"}),e.DataType.Date.Locale["en-AU"]=e.merge(t)}(e)},"4.1.1",{requires:["datatype","aui-datatype-date-parse"]}); +.Locale["en-GB"]=e.merge(t,{r:"%l:%M:%S %P %Z"}),e.DataType.Date.Locale["en-AU"]=e.merge(t)}(e)},"4.2.0",{requires:["datatype","aui-datatype-date-parse"]}); diff --git a/build/aui-diagram-builder-connector/assets/aui-diagram-builder-connector-core.css b/build/aui-diagram-builder-connector/assets/aui-diagram-builder-connector-core.css index cb115ef7d0f..3dbd822f167 100644 --- a/build/aui-diagram-builder-connector/assets/aui-diagram-builder-connector-core.css +++ b/build/aui-diagram-builder-connector/assets/aui-diagram-builder-connector-core.css @@ -12,6 +12,20 @@ z-index: 500; } +.diagram-builder-connector-tag { + background: none repeat scroll 0 0 #FFFFFF; + border-radius: 3px 3px 3px 3px; + border: 1px solid #666666; + cursor: pointer; + opacity: 0.8; + overflow: hidden; + padding: 0 2px; + position: absolute; + text-align: center; + white-space: nowrap; + z-index: 500; +} + .diagram-node-suggest-connector.popover { display: block; } diff --git a/build/aui-diagram-builder-connector/assets/skins/sam/aui-diagram-builder-connector.css b/build/aui-diagram-builder-connector/assets/skins/sam/aui-diagram-builder-connector.css index 3db13dfae2c..761edecc945 100644 --- a/build/aui-diagram-builder-connector/assets/skins/sam/aui-diagram-builder-connector.css +++ b/build/aui-diagram-builder-connector/assets/skins/sam/aui-diagram-builder-connector.css @@ -1 +1 @@ -.diagram-builder-connector-name{background:none repeat scroll 0 0 #fff;border-radius:3px 3px 3px 3px;border:1px solid #666;cursor:pointer;opacity:.8;overflow:hidden;padding:0 2px;position:absolute;text-align:center;white-space:nowrap;z-index:500}.diagram-node-suggest-connector.popover{display:block}.diagram-node-suggest-connector .property-builder-field:hover{background-color:#f1f1f1}.diagram-node-suggest-connector .property-builder-field{border-radius:4px 4px 4px 4px;cursor:pointer;float:left;height:63px;list-style:none outside none;margin:2px;text-align:center;width:79px}.diagram-builder-anchor-node{cursor:pointer;height:15px;position:absolute;width:15px}.diagram-builder-anchor-node-max-targets{cursor:auto}.diagram-builder-controls{display:none}.diagram-node-selected .diagram-builder-controls{display:block;padding:3px;text-align:center}.diagram-node-state .diagram-builder-controls,.diagram-node-start .diagram-builder-controls,.diagram-node-end .diagram-builder-controls{margin-left:-7px}.diagram-node-selected{border:1px dotted #666}.diagram-node-focused{outline:0}.diagram-node-shape-boundary{cursor:crosshair}#yui3-css-stamp.skin-sam-aui-diagram-builder-connector{display:none} +.diagram-builder-connector-name{background:none repeat scroll 0 0 #fff;border-radius:3px 3px 3px 3px;border:1px solid #666;cursor:pointer;opacity:.8;overflow:hidden;padding:0 2px;position:absolute;text-align:center;white-space:nowrap;z-index:500}.diagram-builder-connector-tag{background:none repeat scroll 0 0 #fff;border-radius:3px 3px 3px 3px;border:1px solid #666;cursor:pointer;opacity:.8;overflow:hidden;padding:0 2px;position:absolute;text-align:center;white-space:nowrap;z-index:500}.diagram-node-suggest-connector.popover{display:block}.diagram-node-suggest-connector .property-builder-field:hover{background-color:#f1f1f1}.diagram-node-suggest-connector .property-builder-field{border-radius:4px 4px 4px 4px;cursor:pointer;float:left;height:63px;list-style:none outside none;margin:2px;text-align:center;width:79px}.diagram-builder-anchor-node{cursor:pointer;height:15px;position:absolute;width:15px}.diagram-builder-anchor-node-max-targets{cursor:auto}.diagram-builder-controls{display:none}.diagram-node-selected .diagram-builder-controls{display:block;padding:3px;text-align:center}.diagram-node-state .diagram-builder-controls,.diagram-node-start .diagram-builder-controls,.diagram-node-end .diagram-builder-controls{margin-left:-7px}.diagram-node-selected{border:1px dotted #666}.diagram-node-focused{outline:0}.diagram-node-shape-boundary{cursor:crosshair}#yui3-css-stamp.skin-sam-aui-diagram-builder-connector{display:none} diff --git a/build/aui-diagram-builder-connector/aui-diagram-builder-connector-min.js b/build/aui-diagram-builder-connector/aui-diagram-builder-connector-min.js index 0b18d76a825..35abcba67ca 100644 --- a/build/aui-diagram-builder-connector/aui-diagram-builder-connector-min.js +++ b/build/aui-diagram-builder-connector/aui-diagram-builder-connector-min.js @@ -1,2 +1,2 @@ -YUI.add("aui-diagram-builder-connector",function(A,NAME){var Lang=A.Lang,isArray=Lang.isArray,isBoolean=Lang.isBoolean,isNumber=Lang.isNumber,isObject=Lang.isObject,isString=Lang.isString,AArray=A.Array,B1=function(e){return e*e*e},B2=function(e){return 3*e*e*(1-e)},B3=function(e){return 3*e*(1-e)*(1-e)},B4=function(e){return(1-e)*(1-e)*(1-e)},getCubicBezier=function(e,t,n,r,i){var s=t[0]*B1(e)+r[0]*B2(e)+i[0]*B3(e)+n[0]*B4(e),o=t[1]*B1(e)+r[1]*B2(e)+i[1]*B3(e)+n[1]*B4(e);return[s,o]},isGraphic=function(e){return A.instanceOf(e,A.Graphic)},toDegrees=function(e){return e*180/Math.PI},sign=function(e){return e===0?0:e<0?-1:1},getCN=A.getClassName,CSS_DIAGRAM_BUILDER_CONNECTOR_NAME=getCN("diagram","builder","connector","name"),CSS_HIDE=getCN("hide");A.PolygonUtil={ARROW_POINTS:[[-12,-6],[-8,0],[-12,6],[6,0]],drawArrow:function(e,t,n,r,i,s){var o=this,u=Math.atan2(i-n,r-t);e.moveTo(r,i),r-=5*Math.cos(u),i-=5*Math.sin(u),o.drawPolygon(e,o.translatePoints(o.rotatePoints(s||o.ARROW_POINTS,u),r,i))},drawPolygon:function(e,t){e.moveTo(t[0][0],t[0][1]),AArray.each(t,function(n,r){r>0&&e.lineTo(t[r][0],t[r][1])}),e.lineTo(t[0][0],t[0][1])},translatePoints:function(e,t,n){var r=[];return AArray.each(e,function(i,s){r.push([e[s][0]+t,e[s][1]+n])}),r},rotatePoints:function(e,t){var n=this,r=[];return AArray.each(e,function(i,s){r.push(n.rotatePoint(t,e[s][0],e[s][1]))}),r},rotatePoint:function(e,t,n){return[t*Math.cos(e)-n*Math.sin(e),t*Math.sin(e)+n*Math.cos(e)]}},A.Connector=A.Base.create("line",A.Base,[],{SERIALIZABLE_ATTRS:["color","lazyDraw","name","shapeSelected","shapeHover","p1","p2"],shape:null,shapeArrow:null,initializer:function(){var e=this,t=e.get("lazyDraw");e.after({nameChange:e._afterNameChange,p1Change:e.draw,p2Change:e.draw,selectedChange:e._afterSelectedChange,showNameChange:e._afterShowNameChange,visibleChange:e._afterVisibleChange}),e._initShapes(),t||e.draw(),e._uiSetVisible(e.get("visible")),e._uiSetName(e.get("name")),e._uiSetSelected(e.get("selected"),!t),e._uiSetShowName(e.get("showName"))},destructor:function(){var e=this;e.shape.destroy(),e.shapeArrow.destroy(),e.get("nodeName").remove()},draw:function(){var e=this,t=e.shape,n=e.shapeArrow,r=e.get("p1"),i=e.get("p2"),s=e.toCoordinate(r),o=e.toCoordinate(i),u=s[0],a=s[1],f=o[0],l=o[1],c=Math.max(Math.abs(u-f)/2,10),h=Math.max(Math.abs(a-l)/2,10),p=null,d=8,v=toDegrees(Math.atan2(l-a,f-u)),m=Math.round(Math.abs(v)/(360/d)),g=e.hasConnectorsInterconnected()?e.get("offsetConnectors"):0;sign(v)<0?p=[[u+c,a+g,f-c,l+g,f,l],[u+c,a,f,a-h-g,f,l],[u,a-h,f-g,a-h-g,f,l],[u-c,a,f,a-h-g,f,l],[u-c,a-g,f+c,l-g,f,l]]:p=[[u+c,a+g,f-c,l+g,f,l],[u+c,a,f,a+h+g,f,l],[u,a+h,f+g,a+h+g,f,l],[u-c,a,f,a+h+g,f,l],[u-c,a-g,f+c,l-g,f,l]];var y=p[m];t.clear(),t.moveTo(u,a),t.curveTo.apply(t,y),t.end();var b=getCubicBezier(0,[u,a],[f,l],[y[0],y[1]],[y[2],y[3]]),w=getCubicBezier(.075,[u,a],[f,l],[y[0],y[1]],[y[2],y[3]]),E=getCubicBezier(.5,[u,a],[f,l],[y[0],y[1]],[y[2],y[3]]);return n.clear(),A.PolygonUtil.drawArrow(n,w[0],w[1],b[0],b[1],e.get("arrowPoints")),n.end(),e.get("showName")&&e.get("nodeName").center(e.toXY(E)),e},getProperties:function(){var e=this,t=e.getPropertyModel();return AArray.each(t,function(t){t.value=e.get(t.attributeName)}),t},getPropertyModel:function(){var e=this,t=e.getStrings();return[{attributeName:"name",editor:new A.TextCellEditor({validator:{rules:{value:{required:!0}}}}),name:t.name}]},getStrings:function(){return A.Connector.STRINGS},hasConnectorsInterconnected:function(){var e=this,t=e.get("builder"),n=!1,r=e.get("p1"),i=e.get("p2");return t.eachConnector(function(t){if(t){var s=t.get("p1"),o=t.get("p2");(s[0]===i[0]&&s[1]===i[1]||o[0]===r[0]&&o[1]===r[1])&&t!==e&&(n=!0)}}),n},hide:function(){var e=this;return e.set("visible",!1),e},show:function(){var e=this;return e.set("visible",!0),e},toCoordinate:function(e){var t=this;return t._offsetXY(e,-1)},toJSON:function(){var e=this,t={};return AArray.each(e.SERIALIZABLE_ATTRS,function(n){t[n]=e.get(n)}),t},toXY:function(e){var t=this;return t._offsetXY(e,1)},_afterNameChange:function(e){var t=this;t._uiSetName(e.newVal),t.draw()},_afterSelectedChange:function(e){var t=this;t._uiSetSelected(e.newVal)},_afterShowNameChange:function(e){var t=this;t._uiSetShowName(e.newVal)},_afterVisibleChange:function(e){var t=this;t._uiSetVisible(e.newVal)},_initShapes:function(){var e=this,t=e.shape=e.get("graphic").addShape(e.get("shape")),n=e.shapeArrow=e.get("graphic").addShape(e.get("shapeArrow"));t.on("click",A.bind(e._onShapeClick,e)),t.on("mouseenter",A.bind(e._onShapeMouseEnter,e)),t.on("mouseleave",A.bind(e._onShapeMouseLeave,e)),t.on("contextmenu",A.bind(e._onShapeRightClick,e)),n.on("click",A.bind(e._onShapeClick,e)),e.get("nodeName").on("click",A.bind(e._onShapeClick,e))},_offsetXY:function(e,t){var n=this,r=n.get("graphic").getXY();return[e[0]+r[0]*t,e[1]+r[1]*t]},_onShapeClick:function(event){var instance=this,builder=instance.get("builder"),selected=instance.get("selected");builder&&(event.hasModifier()?builder.closeEditProperties():(builder.unselectConnectors(),selected?builder.closeEditProperties():builder.editConnector(instance))),instance.set("selected",!selected);var attrs=builder.correctPosition({id:instance.getAttrs().id,clientX:event.clientX,clientY:event.clientY,name:instance.getAttrs().name});eval(instance.get("onLeftClick"))(attrs),event.halt()},_onShapeMouseEnter:function(e){var t=this;if(!t.get("selected")){var n=t.get("shapeHover"),r=t.get("shapeArrowHover");n&&t._updateShape(t.shape,n,!1),r&&t._updateShape(t.shapeArrow,r,!1)}t._onShapeMouseMove("mouseEnter",e)},_onShapeMouseLeave:function(e){var t=this;t.get("selected")||(t._updateShape(t.shape,t.get("shape"),!1),t._updateShape(t.shapeArrow,t.get("shapeArrow"),!1)),t._onShapeMouseMove("mouseLeave",e)},_onShapeMouseMove:function(eventName,event){var instance=this,builder=instance.get("builder"),attrs=builder.correctPosition({event:eventName,id:instance.getAttrs().id,clientX:event.clientX,clientY:event.clientY,name:instance -.getAttrs().name});eval(instance.get("onMouseMove"))(attrs)},_onShapeRightClick:function(event){event.preventDefault();var instance=this,builder=instance.get("builder"),attrs=builder.correctPosition({id:instance.getAttrs().id,clientX:event.clientX,clientY:event.clientY,name:instance.getAttrs().name});eval(instance.get("onRightClick"))(attrs),event.stopPropagation()},_setNodeName:function(e){var t=this;return A.instanceOf(e,A.Node)||(e=new A.Node.create(e),t.get("builder").dropContainer.append(e.unselectable())),e},_setShape:function(e){var t=this;return A.merge({type:"path",stroke:{color:t.get("color"),weight:2,opacity:1}},e)},_setShapeArrow:function(e){var t=this;return A.merge({type:"path",fill:{color:t.get("color"),opacity:1},stroke:{color:t.get("color"),weight:2,opacity:1}},e)},_uiSetName:function(e){var t=this;t.get("nodeName").html(A.Escape.html(e))},_uiSetSelected:function(e,t){var n=this;n._updateShape(n.shape,e?n.get("shapeSelected"):n.get("shape"),t),n._updateShape(n.shapeArrow,e?n.get("shapeArrowSelected"):n.get("shapeArrow"),t)},_uiSetShowName:function(e){var t=this;t.get("nodeName").toggleClass(CSS_HIDE,!e)},_uiSetVisible:function(e){var t=this;t.shape.set("visible",e),t.shapeArrow.set("visible",e),t._uiSetShowName(e&&t.get("showName"))},_updateShape:function(e,t,n){var r=this;t.hasOwnProperty("fill")&&e.set("fill",t.fill),t.hasOwnProperty("stroke")&&e.set("stroke",t.stroke),n!==!1&&r.draw()}},{ATTRS:{onMouseMove:{value:"(function() {})",validator:isString},onRightClick:{value:"(function() {})",validator:isString},onLeftClick:{value:"(function() {})",validator:isString},id:{value:0,validator:isNumber},arrowPoints:{value:A.PolygonUtil.ARROW_POINTS},builder:{},color:{value:"#27aae1",validator:isString},graphic:{validator:isGraphic},lazyDraw:{value:!1,validator:isBoolean},name:{valueFn:function(){return"connector"+ ++A.Env._uidx},validator:isString},nodeName:{setter:"_setNodeName",value:'',writeOnce:!0},offsetConnectors:{value:60,validator:isNumber},p1:{value:[0,0],validator:isArray},p2:{value:[0,0],validator:isArray},selected:{value:!1,validator:isBoolean},shape:{value:null,setter:"_setShape"},shapeArrow:{value:null,setter:"_setShapeArrow"},shapeArrowHover:{value:{fill:{color:"#ffd700"},stroke:{color:"#ffd700",weight:5,opacity:.8}}},shapeArrowSelected:{value:{fill:{color:"#ff6600"},stroke:{color:"#ff6600",weight:5,opacity:.8}}},shapeHover:{value:{stroke:{color:"#ffd700",weight:5,opacity:.8}}},shapeSelected:{value:{stroke:{color:"#ff6600",weight:5,opacity:.8}}},showName:{validator:isBoolean,value:!0},transition:{value:{},validator:isObject},visible:{validator:isBoolean,value:!0}},STRINGS:{name:"Name"}})},"4.1.1",{requires:["arraylist-add","arraylist-filter","escape","json","graphics","dd"],skinnable:!0}); +YUI.add("aui-diagram-builder-connector",function(A,NAME){var Lang=A.Lang,isArray=Lang.isArray,isBoolean=Lang.isBoolean,isNumber=Lang.isNumber,isObject=Lang.isObject,isString=Lang.isString,AArray=A.Array,B1=function(e){return e*e*e},B2=function(e){return 3*e*e*(1-e)},B3=function(e){return 3*e*(1-e)*(1-e)},B4=function(e){return(1-e)*(1-e)*(1-e)},getCubicBezier=function(e,t,n,r,i){var s=t[0]*B1(e)+r[0]*B2(e)+i[0]*B3(e)+n[0]*B4(e),o=t[1]*B1(e)+r[1]*B2(e)+i[1]*B3(e)+n[1]*B4(e);return[s,o]},isGraphic=function(e){return A.instanceOf(e,A.Graphic)},toDegrees=function(e){return e*180/Math.PI},sign=function(e){return e===0?0:e<0?-1:1},getCN=A.getClassName,CSS_DIAGRAM_BUILDER_CONNECTOR_NAME=getCN("diagram","builder","connector","name"),CSS_DIAGRAM_BUILDER_CONNECTOR_TAG=getCN("diagram","builder","connector","tag"),CSS_HIDE=getCN("hide");A.PolygonUtil={ARROW_POINTS:[[-12,-6],[-8,0],[-12,6],[6,0]],drawArrow:function(e,t,n,r,i,s){var o=this,u=Math.atan2(i-n,r-t);e.moveTo(r,i),r-=5*Math.cos(u),i-=5*Math.sin(u),o.drawPolygon(e,o.translatePoints(o.rotatePoints(s||o.ARROW_POINTS,u),r,i))},drawPolygon:function(e,t){e.moveTo(t[0][0],t[0][1]),AArray.each(t,function(n,r){r>0&&e.lineTo(t[r][0],t[r][1])}),e.lineTo(t[0][0],t[0][1])},translatePoints:function(e,t,n){var r=[];return AArray.each(e,function(i,s){r.push([e[s][0]+t,e[s][1]+n])}),r},rotatePoints:function(e,t){var n=this,r=[];return AArray.each(e,function(i,s){r.push(n.rotatePoint(t,e[s][0],e[s][1]))}),r},rotatePoint:function(e,t,n){return[t*Math.cos(e)-n*Math.sin(e),t*Math.sin(e)+n*Math.cos(e)]}},A.Connector=A.Base.create("line",A.Base,[],{SERIALIZABLE_ATTRS:["color","lazyDraw","name","tags","shapeSelected","shapeHover","p1","p2"],shape:null,shapeArrow:null,initializer:function(){var e=this,t=e.get("lazyDraw");e.after({nameChange:e._afterNameChange,p1Change:e.draw,p2Change:e.draw,selectedChange:e._afterSelectedChange,showTagChange:e._afterShowTagChange,visibleChange:e._afterVisibleChange}),e._initShapes(),t||e.draw(),e._uiSetVisible(e.get("visible")),e._uiSetName(e.get("name")),e._uiSetSelected(e.get("selected"),!t),e._uiSetTags(e.get("tags")),e._uiSetShowTag(e.get("showTag"))},destructor:function(){var e=this;e.shape.destroy(),e.shapeArrow.destroy(),e.get("nodeName").remove(),e.get("nodeTag").remove()},draw:function(){var e=this,t=e.shape,n=e.shapeArrow,r=e.get("p1"),i=e.get("p2"),s=e.toCoordinate(r),o=e.toCoordinate(i),u=s[0],a=s[1],f=o[0],l=o[1],c=Math.max(Math.abs(u-f)/2,10),h=Math.max(Math.abs(a-l)/2,10),p=null,d=8,v=toDegrees(Math.atan2(l-a,f-u)),m=Math.round(Math.abs(v)/(360/d)),g=e.hasConnectorsInterconnected()?e.get("offsetConnectors"):0;sign(v)<0?p=[[u+c,a+g,f-c,l+g,f,l],[u+c,a,f,a-h-g,f,l],[u,a-h,f-g,a-h-g,f,l],[u-c,a,f,a-h-g,f,l],[u-c,a-g,f+c,l-g,f,l]]:p=[[u+c,a+g,f-c,l+g,f,l],[u+c,a,f,a+h+g,f,l],[u,a+h,f+g,a+h+g,f,l],[u-c,a,f,a+h+g,f,l],[u-c,a-g,f+c,l-g,f,l]];var y=p[m];t.clear(),t.moveTo(u,a),t.curveTo.apply(t,y),t.end();var b=getCubicBezier(0,[u,a],[f,l],[y[0],y[1]],[y[2],y[3]]),w=getCubicBezier(.075,[u,a],[f,l],[y[0],y[1]],[y[2],y[3]]),E=getCubicBezier(.5,[u,a],[f,l],[y[0],y[1]],[y[2],y[3]]);return n.clear(),A.PolygonUtil.drawArrow(n,w[0],w[1],b[0],b[1],e.get("arrowPoints")),n.end(),e.get("showTag")&&e.get("nodeTag").center(e.toXY(E)),e},getProperties:function(){var e=this,t=e.getPropertyModel();return AArray.each(t,function(t){t.value=e.get(t.attributeName)}),t},getPropertyModel:function(){var e=this,t=e.getStrings();return[{attributeName:"name",editor:new A.TextCellEditor({validator:{rules:{value:{required:!0}}}}),name:t.name}]},getStrings:function(){return A.Connector.STRINGS},hasConnectorsInterconnected:function(){var e=this,t=e.get("builder"),n=!1,r=e.get("p1"),i=e.get("p2");return t.eachConnector(function(t){if(t){var s=t.get("p1"),o=t.get("p2");(s[0]===i[0]&&s[1]===i[1]||o[0]===r[0]&&o[1]===r[1])&&t!==e&&(n=!0)}}),n},hide:function(){var e=this;return e.set("visible",!1),e},show:function(){var e=this;return e.set("visible",!0),e},toCoordinate:function(e){var t=this;return t._offsetXY(e,-1)},toJSON:function(){var e=this,t={};return AArray.each(e.SERIALIZABLE_ATTRS,function(n){t[n]=e.get(n)}),t},toXY:function(e){var t=this;return t._offsetXY(e,1)},_afterNameChange:function(e){var t=this;t._uiSetName(e.newVal),t.draw()},_afterSelectedChange:function(e){var t=this;t._uiSetSelected(e.newVal)},_afterShowTagChange:function(e){var t=this;t._uiSetShowTag(e.newVal)},_afterVisibleChange:function(e){var t=this;t._uiSetVisible(e.newVal)},_initShapes:function(){var e=this,t=e.shape=e.get("graphic").addShape(e.get("shape")),n=e.shapeArrow=e.get("graphic").addShape(e.get("shapeArrow"));t.on("click",A.bind(e._onShapeClick,e)),t.on("mouseenter",A.bind(e._onShapeMouseEnter,e)),t.on("mouseleave",A.bind(e._onShapeMouseLeave,e)),t.on("contextmenu",A.bind(e._onShapeRightClick,e)),n.on("click",A.bind(e._onShapeClick,e)),e.get("nodeName").on("click",A.bind(e._onShapeClick,e)),e.get("nodeTag").on("click",A.bind(e._onShapeClick,e))},_offsetXY:function(e,t){var n=this,r=n.get("graphic").getXY();return[e[0]+r[0]*t,e[1]+r[1]*t]},_onShapeClick:function(event){var instance=this,builder=instance.get("builder"),selected=instance.get("selected");builder&&(event.hasModifier()?builder.closeEditProperties():(builder.unselectConnectors(),selected?builder.closeEditProperties():builder.editConnector(instance))),instance.set("selected",!selected);var attrs=builder.correctPosition({id:instance.getAttrs().id,clientX:event.clientX,clientY:event.clientY,name:instance.getAttrs().name});eval(instance.get("onLeftClick"))(attrs),event.halt()},_onShapeMouseEnter:function(e){var t=this;if(!t.get("selected")){var n=t.get("shapeHover"),r=t.get("shapeArrowHover");n&&t._updateShape(t.shape,n,!1),r&&t._updateShape(t.shapeArrow,r,!1)}t._onShapeMouseMove("mouseEnter",e)},_onShapeMouseLeave:function(e){var t=this;t.get("selected")||(t._updateShape(t.shape,t.get("shape"),!1),t._updateShape(t.shapeArrow,t.get("shapeArrow"),!1)),t._onShapeMouseMove("mouseLeave",e)},_onShapeMouseMove:function(eventName +,event){var instance=this,builder=instance.get("builder"),attrs=builder.correctPosition({event:eventName,id:instance.getAttrs().id,clientX:event.clientX,clientY:event.clientY,name:instance.getAttrs().name});eval(instance.get("onMouseMove"))(attrs)},_onShapeRightClick:function(event){event.preventDefault();var instance=this,builder=instance.get("builder"),attrs=builder.correctPosition({id:instance.getAttrs().id,clientX:event.clientX,clientY:event.clientY,name:instance.getAttrs().name});eval(instance.get("onRightClick"))(attrs),event.stopPropagation()},_setNodeName:function(e){var t=this;return A.instanceOf(e,A.Node)||(e=new A.Node.create(e),t.get("builder").dropContainer.append(e.unselectable())),e},_setNodeTag:function(e){var t=this;return A.instanceOf(e,A.Node)||(e=new A.Node.create(e),t.get("builder").dropContainer.append(e.unselectable())),e},_setShape:function(e){var t=this;return A.merge({type:"path",stroke:{color:t.get("color"),weight:2,opacity:1}},e)},_setShapeArrow:function(e){var t=this;return A.merge({type:"path",fill:{color:t.get("color"),opacity:1},stroke:{color:t.get("color"),weight:2,opacity:1}},e)},_uiSetName:function(e){var t=this;t.get("nodeName").html(A.Escape.html(e)),t.get("nodeName").toggleClass(CSS_HIDE,!0)},_uiSetTags:function(e){var t=this;t.get("nodeTag").html(A.Escape.html(e.join(" | ")))},_uiSetSelected:function(e,t){var n=this;n._updateShape(n.shape,e?n.get("shapeSelected"):n.get("shape"),t),n._updateShape(n.shapeArrow,e?n.get("shapeArrowSelected"):n.get("shapeArrow"),t)},_uiSetShowTag:function(e){var t=this;t.get("nodeTag").toggleClass(CSS_HIDE,!e)},_uiSetVisible:function(e){var t=this;t.shape.set("visible",e),t.shapeArrow.set("visible",e),t._uiSetShowTag(e&&t.get("showTag"))},_updateShape:function(e,t,n){var r=this;t.hasOwnProperty("fill")&&e.set("fill",t.fill),t.hasOwnProperty("stroke")&&e.set("stroke",t.stroke),n!==!1&&r.draw()}},{ATTRS:{onMouseMove:{value:"(function() {})",validator:isString},onRightClick:{value:"(function() {})",validator:isString},onLeftClick:{value:"(function() {})",validator:isString},id:{value:0,validator:isNumber},arrowPoints:{value:A.PolygonUtil.ARROW_POINTS},builder:{},color:{value:"#27aae1",validator:isString},graphic:{validator:isGraphic},lazyDraw:{value:!1,validator:isBoolean},name:{valueFn:function(){return"connector"+ ++A.Env._uidx},validator:isString},tags:{value:[],validator:isArray},nodeName:{setter:"_setNodeName",value:'',writeOnce:!0},nodeTag:{setter:"_setNodeTag",value:'',writeOnce:!0},offsetConnectors:{value:60,validator:isNumber},p1:{value:[0,0],validator:isArray},p2:{value:[0,0],validator:isArray},selected:{value:!1,validator:isBoolean},shape:{value:null,setter:"_setShape"},shapeArrow:{value:null,setter:"_setShapeArrow"},shapeArrowHover:{value:{fill:{color:"#ffd700"},stroke:{color:"#ffd700",weight:5,opacity:.8}}},shapeArrowSelected:{value:{fill:{color:"#ff6600"},stroke:{color:"#ff6600",weight:5,opacity:.8}}},shapeHover:{value:{stroke:{color:"#ffd700",weight:5,opacity:.8}}},shapeSelected:{value:{stroke:{color:"#ff6600",weight:5,opacity:.8}}},showTag:{validator:isBoolean,value:!0},transition:{value:{},validator:isObject},visible:{validator:isBoolean,value:!0}},STRINGS:{name:"Name"}})},"4.2.0",{requires:["arraylist-add","arraylist-filter","escape","json","graphics","dd"],skinnable:!0}); diff --git a/build/aui-diagram-builder/assets/aui-diagram-builder-connector-core.css b/build/aui-diagram-builder/assets/aui-diagram-builder-connector-core.css index cb115ef7d0f..3dbd822f167 100644 --- a/build/aui-diagram-builder/assets/aui-diagram-builder-connector-core.css +++ b/build/aui-diagram-builder/assets/aui-diagram-builder-connector-core.css @@ -12,6 +12,20 @@ z-index: 500; } +.diagram-builder-connector-tag { + background: none repeat scroll 0 0 #FFFFFF; + border-radius: 3px 3px 3px 3px; + border: 1px solid #666666; + cursor: pointer; + opacity: 0.8; + overflow: hidden; + padding: 0 2px; + position: absolute; + text-align: center; + white-space: nowrap; + z-index: 500; +} + .diagram-node-suggest-connector.popover { display: block; } diff --git a/build/aui-diagram-builder/aui-diagram-builder-min.js b/build/aui-diagram-builder/aui-diagram-builder-min.js index f69ea6ec6dd..11c967c1a27 100644 --- a/build/aui-diagram-builder/aui-diagram-builder-min.js +++ b/build/aui-diagram-builder/aui-diagram-builder-min.js @@ -1,3 +1,3 @@ YUI.add("aui-diagram-builder",function(A,NAME){var Lang=A.Lang,isBoolean=Lang.isBoolean,isObject=Lang.isObject,isString=Lang.isString,AArray=A.Array,aGetClassName=A.getClassName,CSS_PROPERTY_BUILDER_FIELD=aGetClassName("property","builder","field"),CSS_DIAGRAM_NODE=aGetClassName("diagram","node"),CSS_DIAGRAM_NODE_CONTENT=aGetClassName("diagram","node","content"),CSS_DIAGRAM_NODE_EDITING=aGetClassName("diagram","node","editing"),CSS_DIAGRAM_SUGGEST_CONNECTOR=aGetClassName("diagram","node","suggest","connector"),isConnector=function(e){return A.instanceOf(e,A.Connector)},isDiagramNode=function(e){return A.instanceOf(e,A.DiagramNode)},DiagramBuilder=A.Component.create({NAME:"diagram-builder",ATTRS:{connector:{setter:"_setConnector",value:null},fieldsDragConfig:{value:null,setter:"_setFieldsDragConfig",validator:isObject},graphic:{valueFn:function(){return new A.Graphic},validator:isObject},highlightDropZones:{validator:isBoolean,value:!0},strings:{value:{addNode:"Add node",cancel:"Cancel",close:"Close",deleteConnectorsMessage:"Are you sure you want to delete the selected connector(s)?",deleteNodesMessage:"Are you sure you want to delete the selected node(s)?",propertyName:"Property Name",save:"Save",settings:"Settings",value:"Value"}},showSuggestConnector:{validator:isBoolean,value:!0},suggestConnectorOverlay:{value:null,setter:"_setSuggestConnectorOverlay"},useARIA:{validator:isBoolean,value:!0,writeOnce:"initOnly"},showDeleteNodeIcon:{validator:isBoolean,value:!0,writeOnce:"initOnly"},moveNodeOutSideGroup:{validator:isBoolean,value:!0,writeOnce:"initOnly"},enableDeleteByKeyStroke:{validator:isBoolean,value:!0,writeOnce:"initOnly"}},AUGMENTS:[A.PropertyBuilderSettings],EXTENDS:A.PropertyBuilder,FIELDS_TAB:0,SETTINGS_TAB:1,prototype:{editingConnector:null,editingNode:null,publishedSource:null,publishedTarget:null,selectedConnector:null,selectedNode:null,initializer:function(){var e=this,t=e.get("canvas");e.on({cancel:e._onCancel,"drag:drag":e._onDrag,"drag:start":e._onDragStart,"drag:end":e._onDragEnd,"drop:hit":e._onDropHit,save:e._onSave}),A.DiagramNodeManager.on({publishedSource:function(t){e.publishedTarget=null,e.publishedSource=t.publishedSource}}),t.on("mousedown",A.bind(e._onCanvasMouseDown,e)),t.on("mouseenter",A.bind(e._onCanvasMouseEnter,e)),e.handlerKeyDown=A.getDoc().on("keydown",A.bind(e._afterKeyEvent,e)),e.dropContainer.delegate("click",A.bind(e._onNodeClick,e),"."+CSS_DIAGRAM_NODE),e.dropContainer.delegate("contextmenu",A.bind(e._onRightClick,e),"."+CSS_DIAGRAM_NODE),e.dropContainer.delegate("mousedown",A.bind(e._onCloseButtonMouseDown,e),".diagram-builder-controls button"),e.dropContainer.delegate("mouseenter",A.bind(e._onNodeMouseEnter,e),"."+CSS_DIAGRAM_NODE),e.dropContainer.delegate("mouseleave",A.bind(e._onNodeMouseLeave,e),"."+CSS_DIAGRAM_NODE)},renderUI:function(){var e=this;A.DiagramBuilder.superclass.renderUI.apply(this,arguments),e._setupFieldsDrag(),e._renderGraphic()},syncUI:function(){var e=this;A.DiagramBuilder.superclass.syncUI.apply(this,arguments),e.syncConnectionsUI(),e.connector=e.get("connector"),e.get("useARIA")&&e.plug(A.Plugin.Aria)},syncConnectionsUI:function(){var e=this;e.get("fields").each(function(e){e.syncConnectionsUI()})},clearFields:function(){var e=this,t=[];e.get("fields").each(function(e){t.push(e)}),AArray.each(t,function(e){e.destroy()}),t=e.editingConnector=e.editingNode=e.selectedNode=null},closeEditProperties:function(){var e=this,t=e.editingNode,n=e.tabView;n.selectChild(A.DiagramBuilder.FIELDS_TAB),n.disableTab(A.DiagramBuilder.SETTINGS_TAB),t&&t.get("boundingBox").removeClass(CSS_DIAGRAM_NODE_EDITING),e.editingConnector=e.editingNode=null},connect:function(e,t,n){var r=this;return isString(e)&&(e=A.DiagramNode.getNodeById(e)),isString(t)&&(t=A.DiagramNode.getNodeById(t)),e&&t&&e.connect(t.get("id"),n),r},connectAll:function(e){var t=this;return AArray.each(e,function(e){e.hasOwnProperty("source")&&e.hasOwnProperty("target")&&t.connect(e.source,e.target,e.connector)}),t},createField:function(e){var t=this;return isDiagramNode(e)||(e.builder=t,e.bubbleTargets=t,e=new(t.getFieldClass(e.type||"node"))(e)),e},deleteSelectedConnectors:function(){var e=this,t=e.getStrings(),n=e.getSelectedConnectors();n.length&&window.confirm(t.deleteConnectorsMessage)&&(AArray.each(n,function(e){var t=e.get("transition");A.DiagramNode.getNodeByName(t.source).disconnect(t)}),e.stopEditing())},deleteSelectedNode:function(){var e=this,t=e.getStrings(),n=e.selectedNode;n&&!n.get("required")&&window.confirm(t.deleteNodesMessage)&&(n.close(),e.editingNode=e.selectedNode=null,e.stopEditing())},destructor:function(){var e=this;e.get("suggestConnectorOverlay").destroy()},eachConnector:function(e){var t=this;t.get("fields").each(function(n){var r=n.get("transitions");AArray.each(r.values(),function(r){e.call(t,n.getConnector(r),r,n)})})},editConnector:function(e){var t=this;if(e){var n=t.tabView;t.closeEditProperties(),n.enableTab(A.DiagramBuilder.SETTINGS_TAB),n.selectChild(A.DiagramBuilder.SETTINGS_TAB),t.propertyList.set("data",e.getProperties()),t.editingConnector=t.selectedConnector=e}},editNode:function(e){var t=this;if(e){var n=t.tabView;t.closeEditProperties(),n.enableTab(A.DiagramBuilder.SETTINGS_TAB),n.selectChild(A.DiagramBuilder.SETTINGS_TAB),t.propertyList.set("data",e.getProperties()),e.get("boundingBox").addClass(CSS_DIAGRAM_NODE_EDITING),t.editingNode=t.selectedNode=e}},getFieldClass:function(e){var t=A.DiagramBuilder.types[e];return t?t:(A.log("The field type: ["+e+"] couldn't be found."),null)},getNodesByTransitionProperty:function(e,t){var n=this,r=[],i;return n.get("fields").each(function(n){i=n.get("transitions"),AArray.each(i.values(),function(i){if(i[e]===t)return r.push(n),!1})}),r},getSelectedConnectors:function(){var e=this,t=[];return e.eachConnector(function(e){e.get("selected")&&t.push(e)}),t},getSourceNodes:function(e){var t=this;return t.getNodesByTransitionProperty("target",e.get("id"))},hideSuggestConnectorOverlay:function(){var e=this ;e.connector.hide(),e.get("suggestConnectorOverlay").hide();try{e.fieldsDrag.dd.set("lock",!1)}catch(t){}},isAbleToConnect:function(){var e=this;return!!e.publishedSource&&!!e.publishedTarget},isFieldsDrag:function(e){var t=this;return e===t.fieldsDrag.dd},plotField:function(e){var t=this;e.get("rendered")||e.render(t.dropContainer)},select:function(e){var t=this;t.unselectNodes(),t.selectedNode=e.set("selected",!0).focus()},showSuggestConnectorOverlay:function(e){var t=this,n=t.get("suggestConnectorOverlay");n.get("boundingBox").addClass(CSS_DIAGRAM_SUGGEST_CONNECTOR),n.set("xy",e||t.connector.get("p2")).show();try{t.fieldsDrag.dd.set("lock",!0)}catch(r){}},stopEditing:function(){var e=this;e.unselectConnectors(),e.unselectNodes(),e.closeEditProperties()},toJSON:function(){var e=this,t={nodes:[]};return e.get("fields").each(function(e){var n={transitions:[]},r=e.get("transitions");AArray.each(e.SERIALIZABLE_ATTRS,function(t){n[t]=e.get(t)}),AArray.each(r.values(),function(t){var r=e.getConnector(t);t.connector=r.toJSON(),n.transitions.push(t)}),t.nodes.push(n)}),t},unselectConnectors:function(){var e=this;AArray.each(e.getSelectedConnectors(),function(e){e.set("selected",!1)})},unselectNodes:function(){var e=this,t=e.selectedNode;t&&t.set("selected",!1),e.selectedNode=null},_afterKeyEvent:function(e){var t=this;if(e.hasModifier()||A.getDoc().get("activeElement").test(":input,td"))return;var n=t._getAttr("enableDeleteByKeyStroke")===!0;e.isKey("esc")?t._onEscKey(e):n&&(e.isKey("backspace")||e.isKey("delete"))&&t._onDeleteKey(e)},_deleteSelectedNode:function(e){var t=this;t.deleteSelectedConnectors(),t.deleteSelectedNode(),e.halt()},_onCancel:function(){var e=this;e.closeEditProperties()},_onCanvasMouseEnter:function(){var e=this;e.syncUI()},_onCloseButtonMouseDown:function(e){var t=this,n=e.currentTarget.ancestor(".diagram-node");isDiagramNode(A.Widget.getByNode(n))&&t._deleteSelectedNode(e)},_onDeleteKey:function(e){var t=this,n=t.getSelectedConnectors();isDiagramNode(A.Widget.getByNode(e.target))?t._deleteSelectedNode(e):n.length>0&&(t.deleteSelectedConnectors(),e.halt())},_onDrag:function(e){var t=this,n=e.target;if(t.isFieldsDrag(n)){var r=A.Widget.getByNode(n.get("dragNode"));r&&(r.get("type")==="group"?this._moveChildrenGroupNodes(r,t):r.get("type")==="task"&&this._updateTaskNodeBoundary(r,t),r.alignTransitions(),AArray.each(t.getSourceNodes(r),function(e){e.alignTransitions()}),t.get("useARIA")&&t.aria.setAttributes([{name:"grabbed",node:r.get("boundingBox"),value:"true"},{name:"dropeffect",node:t.get("canvas"),value:"move"}]),r.set("xy",r.getNodeCoordinates()))}},_onDragStart:function(event){var instance=this,drag=event.target,diagramNode=A.Widget.getByNode(drag.get("dragNode"));if(diagramNode&&instance.isFieldsDrag(drag)){var attrs=this.correctPosition({id:diagramNode.getAttrs().id,name:diagramNode.getAttrs().name,clientX:event.clientX,clientY:event.clientY,type:diagramNode.getAttrs().type});eval(diagramNode.get("onDragStart"))(attrs)}},_onDragEnd:function(event){var instance=this,drag=event.target,diagramNode=A.Widget.getByNode(drag.get("dragNode"));if(diagramNode&&instance.isFieldsDrag(drag)){this._moveChildrenGroupNodes(diagramNode,instance),diagramNode.set("xy",diagramNode.getNodeCoordinates()),instance.get("useARIA")&&instance.aria.setAttributes([{name:"grabbed",node:diagramNode.get("boundingBox"),value:"false"},{name:"dropeffect",node:instance.get("canvas"),value:"none"}]);var attrs=this.correctPosition({id:diagramNode.getAttrs().id,name:diagramNode.getAttrs().name,clientX:event.pageX,clientY:event.pageY,type:diagramNode.getAttrs().type});eval(diagramNode.get("onDragEnd"))(attrs)}},_onDropHit:function(e){var t=this,n=e.drag;if(t.isAvailableFieldsDrag(n)){var r=n.get("node").getData("availableField"),i=t.addField({xy:A.DiagramNode.getNodeCoordinates(n.lastXY,t.dropContainer),type:r.get("type")});t.select(i)}},_onEscKey:function(e){var t=this;t.hideSuggestConnectorOverlay(),t.stopEditing(),e.halt()},_onCanvasMouseDown:function(){var e=this;e.stopEditing(),e.hideSuggestConnectorOverlay()},_onNodeClick:function(e){var t=this,n=A.Widget.getByNode(e.currentTarget);t.select(n),t._onNodeEdit(e),e.stopPropagation()},_onRightClick:function(event){event.preventDefault();var diagramNode=A.Widget.getByNode(event.currentTarget),attrs=this.correctPosition({id:diagramNode.getAttrs().id,name:diagramNode.getAttrs().name,clientX:event.clientX,clientY:event.clientY,type:diagramNode.getAttrs().type});eval(diagramNode.get("onRightClick"))(attrs),event.stopPropagation()},correctPosition:function(e){var t=this.dropContainer._node.getBoundingClientRect();return e.clientX-=t.left,e.clientY-=t.top,e},_onNodeEdit:function(e){var t=this;if(!e.target.ancestor("."+CSS_DIAGRAM_NODE_CONTENT,!0))return;var n=A.Widget.getByNode(e.currentTarget);n&&t.editNode(n)},_onNodeMouseEnter:function(e){var t=A.Widget.getByNode(e.currentTarget);t.set("highlighted",!0),this._onNodeMouseMove("mouseEnter",t)},_onNodeMouseMove:function(eventName,diagramNode){var attrs=this.correctPosition({event:eventName,id:diagramNode.getAttrs().id,name:diagramNode.getAttrs().name,clientX:event.clientX,clientY:event.clientY,type:diagramNode.getAttrs().type});eval(diagramNode.get("onMouseMove"))(attrs)},_onNodeMouseLeave:function(e){var t=this,n=t.publishedSource,r=A.Widget.getByNode(e.currentTarget);(!n||!n.boundaryDragDelegate.dd.get("dragging"))&&r.set("highlighted",!1),this._onNodeMouseMove("mouseLeave",r)},_onSave:function(){var e=this,t=e.editingNode,n=e.editingConnector,r=e.propertyList.get("data");t?r.each(function(e){t.set(e.get("attributeName"),e.get("value"))}):n&&r.each(function(e){n.set(e.get("attributeName"),e.get("value"))})},_onSuggestConnectorNodeClick:function(e){var t=this,n=e.currentTarget.getData("availableField"),r=t.connector,i=t.addField({type:n.get("type"),xy:r.toCoordinate(r.get("p2"))});t.hideSuggestConnectorOverlay(),t.publishedSource.connectNode(i)},_renderGraphic:function(){var e=this;e.get("graphic").render(e -.dropContainer)},_setConnector:function(e){var t=this;if(!isConnector(e)){var n=t.get("canvas").getXY();e=new A.Connector(A.merge({builder:t,graphic:t.get("graphic"),lazyDraw:!0,p1:n,p2:n,shapeHover:null,showName:!1},e))}return e},_setFieldsDragConfig:function(e){var t=this,n=t.dropContainer;return A.merge({bubbleTargets:t,container:n,dragConfig:{plugins:[{cfg:{constrain:n},fn:A.Plugin.DDConstrained},{cfg:{scrollDelay:150,node:n},fn:A.Plugin.DDNodeScroll}]},nodes:"."+CSS_DIAGRAM_NODE},e||{})},_setSuggestConnectorOverlay:function(e){var t=this;if(!e){var n=A.getDoc().invoke("createDocumentFragment"),r,i;AArray.each(t.get("availableFields"),function(e){var t=e.get("node");n.appendChild(t.clone().setData("availableField",t.getData("availableField")))}),e=new A.Overlay({bodyContent:n,render:!0,visible:!1,width:280,zIndex:1e4}),r=e.get("boundingBox"),i=e.get("contentBox"),i.addClass("popover-content"),r.addClass("popover"),r.delegate("click",A.bind(t._onSuggestConnectorNodeClick,t),"."+CSS_PROPERTY_BUILDER_FIELD)}return e},_setupFieldsDrag:function(){var e=this,t=e.get("fields"),n=e.get("fieldsDragConfig"),r=e.get("useARIA");e.fieldsDrag=new A.DD.Delegate(n),r&&t.each(function(e){var t=e.get("boundingBox");t.attr("draggable",!0)})},_moveChildrenGroupNodes:function(e,t){if(e._getAttr("children")){var n=e._getAttr("children").map(function(e){return t._getAttr("fields").filter(function(t){return t._getAttr("id")===e.id}).item(0)});AArray.each(n,function(n){n._setAttr("x",n._getAttr("x")+(e.getNodeCoordinates()[0]-e.get("x"))),n._setAttr("y",n._getAttr("y")+(e.getNodeCoordinates()[1]-e.get("y"))),n.alignTransitions(),AArray.each(t.getSourceNodes(n),function(e){e.alignTransitions()})})}},_updateTaskNodeBoundary:function(e,t){e.get("type")==="task"&&t.get("fields").each(function(n){if(n.get("type")==="group"&&n.get("children")&&!t._getAttr("moveNodeOutSideGroup")&&n.get("children").includes(e.get("id"))){var r=n.get("x"),i=n.get("y"),s=n.get("x")+n.get("width"),o=n.get("y")+n.get("height"),u=e.get("x"),a=e.get("y"),f=e.get("x")+e.get("width"),l=e.get("y")+e.get("height"),c=t.fieldsDrag.dd,h=c.con._regionCache[0],p=c.con._regionCache[1];us?c.con._regionCache.right=h+s:l>o&&(c.con._regionCache.bottom=p+o)}})}}});A.DiagramBuilder=DiagramBuilder,A.namespace("DiagramBuilder.types").node=A.DiagramNode,A.namespace("DiagramBuilder.types").state=A.DiagramNodeState,A.namespace("DiagramBuilder.types").condition=A.DiagramNodeCondition,A.namespace("DiagramBuilder.types").start=A.DiagramNodeStart,A.namespace("DiagramBuilder.types").end=A.DiagramNodeEnd,A.namespace("DiagramBuilder.types").join=A.DiagramNodeJoin,A.namespace("DiagramBuilder.types").fork=A.DiagramNodeFork,A.namespace("DiagramBuilder.types").task=A.DiagramNodeTask,A.namespace("DiagramBuilder.types").group=A.DiagramNodeGroup},"4.1.1",{requires:["aui-aria","aui-map","aui-property-builder","aui-diagram-builder-connector","aui-property-builder-settings","aui-diagram-node-condition","aui-diagram-node-end","aui-diagram-node-fork","aui-diagram-node-join","aui-diagram-node-start","aui-diagram-node-state","aui-diagram-node-task","aui-diagram-node-group","overlay"],skinnable:!0}); +.dropContainer)},_setConnector:function(e){var t=this;if(!isConnector(e)){var n=t.get("canvas").getXY();e=new A.Connector(A.merge({builder:t,graphic:t.get("graphic"),lazyDraw:!0,p1:n,p2:n,shapeHover:null,showTag:!1},e))}return e},_setFieldsDragConfig:function(e){var t=this,n=t.dropContainer;return A.merge({bubbleTargets:t,container:n,dragConfig:{plugins:[{cfg:{constrain:n},fn:A.Plugin.DDConstrained},{cfg:{scrollDelay:150,node:n},fn:A.Plugin.DDNodeScroll}]},nodes:"."+CSS_DIAGRAM_NODE},e||{})},_setSuggestConnectorOverlay:function(e){var t=this;if(!e){var n=A.getDoc().invoke("createDocumentFragment"),r,i;AArray.each(t.get("availableFields"),function(e){var t=e.get("node");n.appendChild(t.clone().setData("availableField",t.getData("availableField")))}),e=new A.Overlay({bodyContent:n,render:!0,visible:!1,width:280,zIndex:1e4}),r=e.get("boundingBox"),i=e.get("contentBox"),i.addClass("popover-content"),r.addClass("popover"),r.delegate("click",A.bind(t._onSuggestConnectorNodeClick,t),"."+CSS_PROPERTY_BUILDER_FIELD)}return e},_setupFieldsDrag:function(){var e=this,t=e.get("fields"),n=e.get("fieldsDragConfig"),r=e.get("useARIA");e.fieldsDrag=new A.DD.Delegate(n),r&&t.each(function(e){var t=e.get("boundingBox");t.attr("draggable",!0)})},_moveChildrenGroupNodes:function(e,t){if(e._getAttr("children")){var n=e._getAttr("children").map(function(e){return t._getAttr("fields").filter(function(t){return t._getAttr("id")===e.id}).item(0)});AArray.each(n,function(n){n._setAttr("x",n._getAttr("x")+(e.getNodeCoordinates()[0]-e.get("x"))),n._setAttr("y",n._getAttr("y")+(e.getNodeCoordinates()[1]-e.get("y"))),n.alignTransitions(),AArray.each(t.getSourceNodes(n),function(e){e.alignTransitions()})})}},_updateTaskNodeBoundary:function(e,t){e.get("type")==="task"&&t.get("fields").each(function(n){if(n.get("type")==="group"&&n.get("children")&&!t._getAttr("moveNodeOutSideGroup")&&n.get("children").includes(e.get("id"))){var r=n.get("x"),i=n.get("y"),s=n.get("x")+n.get("width"),o=n.get("y")+n.get("height"),u=e.get("x"),a=e.get("y"),f=e.get("x")+e.get("width"),l=e.get("y")+e.get("height"),c=t.fieldsDrag.dd,h=c.con._regionCache[0],p=c.con._regionCache[1];us?c.con._regionCache.right=h+s:l>o&&(c.con._regionCache.bottom=p+o)}})}}});A.DiagramBuilder=DiagramBuilder,A.namespace("DiagramBuilder.types").node=A.DiagramNode,A.namespace("DiagramBuilder.types").state=A.DiagramNodeState,A.namespace("DiagramBuilder.types").condition=A.DiagramNodeCondition,A.namespace("DiagramBuilder.types").start=A.DiagramNodeStart,A.namespace("DiagramBuilder.types").end=A.DiagramNodeEnd,A.namespace("DiagramBuilder.types").join=A.DiagramNodeJoin,A.namespace("DiagramBuilder.types").fork=A.DiagramNodeFork,A.namespace("DiagramBuilder.types").task=A.DiagramNodeTask,A.namespace("DiagramBuilder.types").group=A.DiagramNodeGroup},"4.2.0",{requires:["aui-aria","aui-map","aui-property-builder","aui-diagram-builder-connector","aui-property-builder-settings","aui-diagram-node-condition","aui-diagram-node-end","aui-diagram-node-fork","aui-diagram-node-join","aui-diagram-node-start","aui-diagram-node-state","aui-diagram-node-task","aui-diagram-node-group","overlay"],skinnable:!0}); diff --git a/build/aui-diagram-node-condition/aui-diagram-node-condition-min.js b/build/aui-diagram-node-condition/aui-diagram-node-condition-min.js index a511d3685fe..8fb09ea147a 100644 --- a/build/aui-diagram-node-condition/aui-diagram-node-condition-min.js +++ b/build/aui-diagram-node-condition/aui-diagram-node-condition-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-condition",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:60},type:{value:"condition"},width:{value:60}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.DIAMOND_POINTS,renderShapeBoundary:function(){var e=this,t=e.boundary=e.get("graphic").addShape(e.get("shapeBoundary"));return t.translate(10,10),t.rotate(45),t},_valueShapeBoundary:e.DiagramNode.prototype._valueShapeBoundary}});e.DiagramNodeCondition=n},"4.1.1",{requires:["aui-diagram-node-state"]}); +YUI.add("aui-diagram-node-condition",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:60},type:{value:"condition"},width:{value:60}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.DIAMOND_POINTS,renderShapeBoundary:function(){var e=this,t=e.boundary=e.get("graphic").addShape(e.get("shapeBoundary"));return t.translate(10,10),t.rotate(45),t},_valueShapeBoundary:e.DiagramNode.prototype._valueShapeBoundary}});e.DiagramNodeCondition=n},"4.2.0",{requires:["aui-diagram-node-state"]}); diff --git a/build/aui-diagram-node-end/aui-diagram-node-end-min.js b/build/aui-diagram-node-end/aui-diagram-node-end-min.js index 3e505e891bf..3d0e894daae 100644 --- a/build/aui-diagram-node-end/aui-diagram-node-end-min.js +++ b/build/aui-diagram-node-end/aui-diagram-node-end-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-end",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{type:{value:"end"}},EXTENDS:e.DiagramNodeState});e.DiagramNodeEnd=n},"4.1.1",{requires:["aui-diagram-node-state"]}); +YUI.add("aui-diagram-node-end",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{type:{value:"end"}},EXTENDS:e.DiagramNodeState});e.DiagramNodeEnd=n},"4.2.0",{requires:["aui-diagram-node-state"]}); diff --git a/build/aui-diagram-node-fork/aui-diagram-node-fork-min.js b/build/aui-diagram-node-fork/aui-diagram-node-fork-min.js index d068edd08cc..04fcdd4c55a 100644 --- a/build/aui-diagram-node-fork/aui-diagram-node-fork-min.js +++ b/build/aui-diagram-node-fork/aui-diagram-node-fork-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-fork",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:60},type:{value:"fork"},width:{value:60}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.DIAMOND_POINTS,renderShapeBoundary:e.DiagramNodeCondition.prototype.renderShapeBoundary,_valueShapeBoundary:e.DiagramNode.prototype._valueShapeBoundary}});e.DiagramNodeFork=n},"4.1.1",{requires:["aui-diagram-node-state"]}); +YUI.add("aui-diagram-node-fork",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:60},type:{value:"fork"},width:{value:60}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.DIAMOND_POINTS,renderShapeBoundary:e.DiagramNodeCondition.prototype.renderShapeBoundary,_valueShapeBoundary:e.DiagramNode.prototype._valueShapeBoundary}});e.DiagramNodeFork=n},"4.2.0",{requires:["aui-diagram-node-state"]}); diff --git a/build/aui-diagram-node-group/aui-diagram-node-group-min.js b/build/aui-diagram-node-group/aui-diagram-node-group-min.js index 9e640c1131d..7094f96b640 100644 --- a/build/aui-diagram-node-group/aui-diagram-node-group-min.js +++ b/build/aui-diagram-node-group/aui-diagram-node-group-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-group",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:300},type:{value:"group"},width:{value:300},children:{value:[]}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.SQUARE_POINTS,renderShapeBoundary:function(){var e=this;return e.boundary=e.get("graphic").addShape(e.get("shapeBoundary")),e.boundary},_valueShapeBoundary:function(){var e=this._getAttr("height"),t=this._getAttr("width");return this.hotPoints=this._calculateRectangleHotPoints(t,e),{height:e,width:t,type:"rect",pointerEvents:this._getAttr("allowsLinking")===!1?"none":"visiblePainted",stroke:{weight:3,opacity:.5,color:"black",dashstyle:"5,10,5"},fill:{color:"#DBEAF7",opacity:.35}}}}});e.DiagramNodeGroup=n},"4.1.1",{requires:["aui-diagram-node-state"]}); +YUI.add("aui-diagram-node-group",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:300},type:{value:"group"},width:{value:300},children:{value:[]}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.SQUARE_POINTS,renderShapeBoundary:function(){var e=this;return e.boundary=e.get("graphic").addShape(e.get("shapeBoundary")),e.boundary},_valueShapeBoundary:function(){var e=this._getAttr("height"),t=this._getAttr("width");return this.hotPoints=this._calculateRectangleHotPoints(t,e),{height:e,width:t,type:"rect",pointerEvents:this._getAttr("allowsLinking")===!1?"none":"visiblePainted",stroke:{weight:3,opacity:.5,color:"black",dashstyle:"5,10,5"},fill:{color:"#DBEAF7",opacity:.35}}}}});e.DiagramNodeGroup=n},"4.2.0",{requires:["aui-diagram-node-state"]}); diff --git a/build/aui-diagram-node-join/aui-diagram-node-join-min.js b/build/aui-diagram-node-join/aui-diagram-node-join-min.js index d6b8d37ba59..82597200cc9 100644 --- a/build/aui-diagram-node-join/aui-diagram-node-join-min.js +++ b/build/aui-diagram-node-join/aui-diagram-node-join-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-join",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:60},type:{value:"join"},width:{value:60}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.DIAMOND_POINTS,renderShapeBoundary:e.DiagramNodeCondition.prototype.renderShapeBoundary,_valueShapeBoundary:e.DiagramNode.prototype._valueShapeBoundary}});e.DiagramNodeJoin=n},"4.1.1",{requires:["aui-diagram-node-state"]}); +YUI.add("aui-diagram-node-join",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:60},type:{value:"join"},width:{value:60}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.DIAMOND_POINTS,renderShapeBoundary:e.DiagramNodeCondition.prototype.renderShapeBoundary,_valueShapeBoundary:e.DiagramNode.prototype._valueShapeBoundary}});e.DiagramNodeJoin=n},"4.2.0",{requires:["aui-diagram-node-state"]}); diff --git a/build/aui-diagram-node-manager-base/aui-diagram-node-manager-base-min.js b/build/aui-diagram-node-manager-base/aui-diagram-node-manager-base-min.js index 87e17477d72..9065cd662d0 100644 --- a/build/aui-diagram-node-manager-base/aui-diagram-node-manager-base-min.js +++ b/build/aui-diagram-node-manager-base/aui-diagram-node-manager-base-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-manager-base",function(e,t){var n=e.Component.create({NAME:"diagram-node-manager",EXTENDS:e.Base});e.DiagramNodeManager=new n},"4.1.1",{requires:["base"]}); +YUI.add("aui-diagram-node-manager-base",function(e,t){var n=e.Component.create({NAME:"diagram-node-manager",EXTENDS:e.Base});e.DiagramNodeManager=new n},"4.2.0",{requires:["base"]}); diff --git a/build/aui-diagram-node-start/aui-diagram-node-start-min.js b/build/aui-diagram-node-start/aui-diagram-node-start-min.js index 8eae2157bdb..b30cba7699c 100644 --- a/build/aui-diagram-node-start/aui-diagram-node-start-min.js +++ b/build/aui-diagram-node-start/aui-diagram-node-start-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-start",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{type:{value:"start"}},EXTENDS:e.DiagramNodeState});e.DiagramNodeStart=n},"4.1.1",{requires:["aui-diagram-node-state"]}); +YUI.add("aui-diagram-node-start",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{type:{value:"start"}},EXTENDS:e.DiagramNodeState});e.DiagramNodeStart=n},"4.2.0",{requires:["aui-diagram-node-state"]}); diff --git a/build/aui-diagram-node-state/aui-diagram-node-state-min.js b/build/aui-diagram-node-state/aui-diagram-node-state-min.js index 92a973e48c8..84c7f425da7 100644 --- a/build/aui-diagram-node-state/aui-diagram-node-state-min.js +++ b/build/aui-diagram-node-state/aui-diagram-node-state-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-state",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:40},type:{value:"state"},width:{value:40}},EXTENDS:e.DiagramNode,prototype:{hotPoints:e.DiagramNode.CIRCLE_POINTS,renderShapeBoundary:function(){var e=this,t=e.boundary=e.get("graphic").addShape(e.get("shapeBoundary"));return t.translate(5,5),t},_valueShapeBoundary:function(){return{radius:15,type:"circle",stroke:{weight:7,color:"transparent",opacity:0}}}}});e.DiagramNodeState=n},"4.1.1",{requires:["aui-diagram-node"]}); +YUI.add("aui-diagram-node-state",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:40},type:{value:"state"},width:{value:40}},EXTENDS:e.DiagramNode,prototype:{hotPoints:e.DiagramNode.CIRCLE_POINTS,renderShapeBoundary:function(){var e=this,t=e.boundary=e.get("graphic").addShape(e.get("shapeBoundary"));return t.translate(5,5),t},_valueShapeBoundary:function(){return{radius:15,type:"circle",stroke:{weight:7,color:"transparent",opacity:0}}}}});e.DiagramNodeState=n},"4.2.0",{requires:["aui-diagram-node"]}); diff --git a/build/aui-diagram-node-task/aui-diagram-node-task-min.js b/build/aui-diagram-node-task/aui-diagram-node-task-min.js index c0daeac4383..ea4e82b5562 100644 --- a/build/aui-diagram-node-task/aui-diagram-node-task-min.js +++ b/build/aui-diagram-node-task/aui-diagram-node-task-min.js @@ -1 +1 @@ -YUI.add("aui-diagram-node-task",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:70},type:{value:"task"},width:{value:70}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.SQUARE_POINTS,renderShapeBoundary:function(){var e=this;return e.boundary=e.get("graphic").addShape(e.get("shapeBoundary")),e.boundary},_valueShapeBoundary:function(){var e=this._getAttr("height"),t=this._getAttr("width");return this.hotPoints=this._calculateRectangleHotPoints(t,e),{height:e,width:t,type:"rect",pointerEvents:this._getAttr("allowsLinking")===!1?"none":"visiblePainted",stroke:{opacity:0}}}}});e.DiagramNodeTask=n},"4.1.1",{requires:["aui-diagram-node-state"]}); +YUI.add("aui-diagram-node-task",function(e,t){var n=e.Component.create({NAME:"diagram-node",ATTRS:{height:{value:70},type:{value:"task"},width:{value:70}},EXTENDS:e.DiagramNodeState,prototype:{hotPoints:e.DiagramNode.SQUARE_POINTS,renderShapeBoundary:function(){var e=this;return e.boundary=e.get("graphic").addShape(e.get("shapeBoundary")),e.boundary},_valueShapeBoundary:function(){var e=this._getAttr("height"),t=this._getAttr("width");return this.hotPoints=this._calculateRectangleHotPoints(t,e),{height:e,width:t,type:"rect",pointerEvents:this._getAttr("allowsLinking")===!1?"none":"visiblePainted",stroke:{opacity:0}}}}});e.DiagramNodeTask=n},"4.2.0",{requires:["aui-diagram-node-state"]}); diff --git a/build/aui-diagram-node/aui-diagram-node-min.js b/build/aui-diagram-node/aui-diagram-node-min.js index 2e0a271f1bf..917a22a5102 100644 --- a/build/aui-diagram-node/aui-diagram-node-min.js +++ b/build/aui-diagram-node/aui-diagram-node-min.js @@ -1,3 +1,3 @@ YUI.add("aui-diagram-node",function(e,t){var n,r=function(t,n){var r=e.Lang.isArray(t)?t:t.get("boundingBox").getXY();return[r[0]+n[0],r[1]+n[1]]},i=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},s=function(e,t){var n=e.hotPoints,s=t.hotPoints,o=e.get("boundingBox").getXY(),u=t.get("boundingBox").getXY(),a,f,l,c,h=Infinity,p=[[0,0],[0,0]];for(l=0,a=n.length;l{label}',boundary:null,hotPoints:[[0,0]],CONTROLS_TEMPLATE:'
',SERIALIZABLE_ATTRS:["description","id","name","required","type","width","height","zIndex","xy"],initializer:function(){var t=this;t.after({"map:remove":e.bind(t._afterMapRemove,t),render:t._afterRender}),t.on({nameChange:t._onNameChange}),t.publish({connectDrop:{defaultFn:t.connectDrop},connectEnd:{defaultFn:t.connectEnd},connectMove:{defaultFn:t.connectMove},connectOutTarget:{defaultFn:t.connectOutTarget},connectOverTarget:{defaultFn:t.connectOverTarget},connectStart:{defaultFn:t.connectStart},boundaryMouseEnter:{},boundaryMouseLeave:{}}),t.boundingBox=t.get("boundingBox"),t.toolbarContainer=t.get("toolbarContainer"),t.boundingBox.addClass(f+"-"+t.get("type")),t.boundingBox.setAttribute("draggable",!0)},destructor:function(){var e=this;e.eachConnector(function(e,t,n){n.removeTransition(e.get("transition"))}),e.invite.destroy(),e.get("graphic").destroy(),e.get("builder").removeField(e)},addTransition:function(t){var n=this,r=n.get("transitions");return t=n.prepareTransition(t),r.has(t.uid)||(t.uid=e.guid(),r.put(t.uid,t)),t},alignTransition:function(t){var n=this,i=e.DiagramNode.getNodeById(t.target);if(i){var o=s(n,i);t=e.merge(t,{sourceXY:o[0],targetXY:o[1]}),n.getConnector(t).setAttrs({p1:r(n,t.sourceXY),p2:r(i,t.targetXY)})}},alignTransitions:function(){var t=this,n=t.get("transitions");e.Array.each(n.values(),e.bind(t.alignTransition,t))},close:function(){var e=this;return e.destroy()},connect:function(t,n){var r=this;t=r.addTransition(t);var i=null,o=e.DiagramNode.getNodeById(t.target);if(o&&!r.isTransitionConnected(t)){var u=r.get("builder"),a=s(r,o);e.mix(t,{sourceXY:a[0],targetXY:a[1]}),i=new e.Connector(e.merge({after:{selectedChange:function(){r.alignTransition(t)}},builder:u,graphic:u.get("graphic"),transition:t},n)),r.get("connectors").put(t.uid,i)}return r.alignTransition(t),i},connectDrop:function(e){var t=this;t.connectNode(e.publishedTarget)},connectEnd:function() {var e=this,t=e.get("builder"),n=t.publishedSource;!t.isAbleToConnect()&&t.get("showSuggestConnector")&&t.connector.get("visible")?t.showSuggestConnectorOverlay():(t.connector.hide(),n.invite.set("visible",!1)),t.get("highlightDropZones")&&t.get("fields").each(function(e){e.set("highlighted",!1)})},connectMove:function(e){var t=this,n=t.get("builder"),r=e.mouseXY;n.connector.set("p2",r);if(n.publishedTarget){var i=t.invite,s=i.get("radius")||0;i.get("visible")||i.set("visible",!0),i.setXY([r[0]-s,r[1]-s])}},connectNode:function(t){var n=this,r=n.boundaryDragDelegate.dd;n.connect(n.prepareTransition({sourceXY:e.DiagramNode.getNodeCoordinates(r.startXY,n.get("boundingBox")),target:t.get("id"),targetXY:e.DiagramNode.getNodeCoordinates(r.mouseXY,t.get("boundingBox"))}))},connectOutTarget:function(){var e=this,t=e.get("builder");t.publishedTarget=null,t.publishedSource.invite.set("visible",!1)},connectOverTarget:function(){var e=this,t=e.get("builder");t.publishedSource!==e&&(t.publishedTarget=e)},connectStart:function(t){var n=this,r=n.get("builder");r.connector.show().set("p1",t.startXY),r.get("highlightDropZones")&&r.get("fields").each(function(e){e.set("highlighted",!0)}),e.DiagramNodeManager.fire("publishedSource",{publishedSource:n})},disconnect:function(e){var t=this;t.isTransitionConnected(e)&&t.removeTransition(e)},eachConnector:function(t){var n=this,r=[],i=[].concat(n.get("connectors").values()),s=i.length;return e.Array.each(n.get("builder").getSourceNodes(n),function(t){var s=t.get("connectors");e.Array.each(s.values(),function(e){n.get("id")===e.get("transition").target&&(r.push(t),i.push(e))})}),e.Array.each(i,function(e,i){t.call(n,e,i,i=s&&e<=o}return i},isKeyInSet:function(e){var t=this,r=n(arguments,1,!0);return t._isKeyInSet(e,r)},isNavKey:function(e){var t=this;return t.isKeyInRange(e,"PAGE_UP","DOWN")||t.isKeyInSet(e,"ENTER","TAB","ESC")},isSpecialKey:function(e,t){var n=this,r=t==="keypress"&&n.ctrlKey;return r||n.isNavKey(e)||n.isKeyInRange(e,"SHIFT","CAPS_LOCK")||n.isKeyInSet(e,"BACKSPACE","PRINT_SCREEN","INSERT","WIN_IME")},isModifyingKey:function(e){var t=this;return!t._isKeyInSet(e,t.NON_MODIFYING_KEYS)},_isKeyInSet:function(e,t){var n=this,r=t.length,i=!1,s,o;while(r--){s=t[r],o=s&&(n[s]||n[String(s).toUpperCase()]);if(e===o){i=!0;break}}return i}};e.mix(i,{hasModifier:function(){var e=this;return s.hasModifier(e)},isKey:function(e){var t=this;return s.isKey(t.keyCode,e)},isKeyInRange:function(e,t){var n=this;return s.isKeyInRange(n.keyCode,e,t)},isKeyInSet:function(){var e=this,t=n(arguments,0,!0);return s._isKeyInSet(e.keyCode,t)},isModifyingKey:function(){var e=this;return s.isModifyingKey(e.keyCode)},isNavKey:function(){var e=this;return s.isNavKey(e.keyCode)},isSpecialKey:function(){var e=this;return s.isSpecialKey(e.keyCode,e.type)}}),e.Event.KeyMap=s,e.Event.supportsDOMEvent=e.supportsDOMEvent},"4.1.1",{requires:["event-base"]}); +YUI.add("aui-event-base",function(e,t){var n=e.Array,r=e.DOMEventFacade,i=r.prototype,s={BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,RETURN:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUM_LOCK:144,WIN_KEY:224,WIN_IME:229,NON_MODIFYING_KEYS:["ALT","CAPS_LOCK","CTRL","DOWN","END","ESC","F1","F10","F11","F12","F2","F3","F4","F5","F6","F7","F8","F9","HOME","LEFT","NUM_LOCK","PAGE_DOWN","PAGE_UP","PAUSE","PRINT_SCREEN","RIGHT","SHIFT","SPACE","UP","WIN_KEY"],hasModifier:function(e){return e&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)},isKey:function(e,t){var n=this;return t&&(n[t]||n[t.toUpperCase()])===e},isKeyInRange:function(e,t,n){var r=this,i=!1;if(t&&n){var s=r[t]||r[t.toUpperCase()],o=r[n]||r[n.toUpperCase()];i=s&&o&&e>=s&&e<=o}return i},isKeyInSet:function(e){var t=this,r=n(arguments,1,!0);return t._isKeyInSet(e,r)},isNavKey:function(e){var t=this;return t.isKeyInRange(e,"PAGE_UP","DOWN")||t.isKeyInSet(e,"ENTER","TAB","ESC")},isSpecialKey:function(e,t){var n=this,r=t==="keypress"&&n.ctrlKey;return r||n.isNavKey(e)||n.isKeyInRange(e,"SHIFT","CAPS_LOCK")||n.isKeyInSet(e,"BACKSPACE","PRINT_SCREEN","INSERT","WIN_IME")},isModifyingKey:function(e){var t=this;return!t._isKeyInSet(e,t.NON_MODIFYING_KEYS)},_isKeyInSet:function(e,t){var n=this,r=t.length,i=!1,s,o;while(r--){s=t[r],o=s&&(n[s]||n[String(s).toUpperCase()]);if(e===o){i=!0;break}}return i}};e.mix(i,{hasModifier:function(){var e=this;return s.hasModifier(e)},isKey:function(e){var t=this;return s.isKey(t.keyCode,e)},isKeyInRange:function(e,t){var n=this;return s.isKeyInRange(n.keyCode,e,t)},isKeyInSet:function(){var e=this,t=n(arguments,0,!0);return s._isKeyInSet(e.keyCode,t)},isModifyingKey:function(){var e=this;return s.isModifyingKey(e.keyCode)},isNavKey:function(){var e=this;return s.isNavKey(e.keyCode)},isSpecialKey:function(){var e=this;return s.isSpecialKey(e.keyCode,e.type)}}),e.Event.KeyMap=s,e.Event.supportsDOMEvent=e.supportsDOMEvent},"4.2.0",{requires:["event-base"]}); diff --git a/build/aui-event-delegate-change/aui-event-delegate-change-min.js b/build/aui-event-delegate-change/aui-event-delegate-change-min.js index 36832bb41ea..64aa1abb355 100644 --- a/build/aui-event-delegate-change/aui-event-delegate-change-min.js +++ b/build/aui-event-delegate-change/aui-event-delegate-change-min.js @@ -1 +1 @@ -YUI.add("aui-event-delegate-change",function(e,t){var n=e.Object,r=e.Selector;e.Event.define("change",{delegate:function(e,t,n,r){var i=this;i._attachEvents(e,t,n,r)},detach:function(e,t,n){var r=this;r._detachEvents(e,t,n)},detachDelegate:function(e,t,n){var r=this;r._detachEvents(e,t,n)},on:function(e,t,n){var r=this;r._attachEvent(e,t,n)},_attachEvent:function(t,i,s,o,u){var a=this,f=a._getEventName(t),l=a._prepareHandles(i,t);if(!n.owns(l,f)){var c=s.fire;o&&(c=function(n){var i=o.getDOM(),a=!0,f=t.getDOM(),l=e.clone(n);do f&&r.test(f,u)&&(l.currentTarget=e.one(f),l.container=o,a=s.fire(l)),f=f.parentNode;while(a!==!1&&!l.stopped&&f&&f!==i);return a!==!1&&l.stopped!==2}),l[f]=e.Event._attach([f,c,t,s])}},_attachEvents:function(e,t,n,r){var i=this,s=i._prepareHandles(t,e);s.beforeactivate=e.delegate("beforeactivate",function(s){var o=s.target;i._attachEvent(o,t,n,e,r)},r)},_detachEvents:function(t,n){e.each(n._handles,function(t){e.each(t,function(e){e.detach()})}),delete n._handles},_getEventName:e.cached(function(e){var t="change",n=e.attr("tagName").toLowerCase(),r=e.attr("type").toLowerCase();return n==="input"&&(r==="checkbox"||r==="radio")&&(t="click"),t}),_prepareHandles:function(e,t){n.owns(e,"_handles")||(e._handles={});var r=e._handles;return n.owns(r,t)||(r[t]={}),r[t]}},!0)},"4.1.1",{requires:["aui-event-base","event-delegate","event-synthetic"]}); +YUI.add("aui-event-delegate-change",function(e,t){var n=e.Object,r=e.Selector;e.Event.define("change",{delegate:function(e,t,n,r){var i=this;i._attachEvents(e,t,n,r)},detach:function(e,t,n){var r=this;r._detachEvents(e,t,n)},detachDelegate:function(e,t,n){var r=this;r._detachEvents(e,t,n)},on:function(e,t,n){var r=this;r._attachEvent(e,t,n)},_attachEvent:function(t,i,s,o,u){var a=this,f=a._getEventName(t),l=a._prepareHandles(i,t);if(!n.owns(l,f)){var c=s.fire;o&&(c=function(n){var i=o.getDOM(),a=!0,f=t.getDOM(),l=e.clone(n);do f&&r.test(f,u)&&(l.currentTarget=e.one(f),l.container=o,a=s.fire(l)),f=f.parentNode;while(a!==!1&&!l.stopped&&f&&f!==i);return a!==!1&&l.stopped!==2}),l[f]=e.Event._attach([f,c,t,s])}},_attachEvents:function(e,t,n,r){var i=this,s=i._prepareHandles(t,e);s.beforeactivate=e.delegate("beforeactivate",function(s){var o=s.target;i._attachEvent(o,t,n,e,r)},r)},_detachEvents:function(t,n){e.each(n._handles,function(t){e.each(t,function(e){e.detach()})}),delete n._handles},_getEventName:e.cached(function(e){var t="change",n=e.attr("tagName").toLowerCase(),r=e.attr("type").toLowerCase();return n==="input"&&(r==="checkbox"||r==="radio")&&(t="click"),t}),_prepareHandles:function(e,t){n.owns(e,"_handles")||(e._handles={});var r=e._handles;return n.owns(r,t)||(r[t]={}),r[t]}},!0)},"4.2.0",{requires:["aui-event-base","event-delegate","event-synthetic"]}); diff --git a/build/aui-event-delegate-submit/aui-event-delegate-submit-min.js b/build/aui-event-delegate-submit/aui-event-delegate-submit-min.js index 71edf8749bb..6897d1b4e1c 100644 --- a/build/aui-event-delegate-submit/aui-event-delegate-submit-min.js +++ b/build/aui-event-delegate-submit/aui-event-delegate-submit-min.js @@ -1 +1 @@ -YUI.add("aui-event-delegate-submit",function(e,t){function o(e){n.some(e,function(t,n){if(t.args&&t.args[0]==="submit_delegate"){var r=e.splice(e.length-1,1)[0];return e.splice(n,0,r),!0}})}function u(e,t){var n=t,i={},s=t[e.sub.id],o=!1;return r.each(t,function(e){!o&&e.args&&e.args[0]==="submit_delegate"&&(i[s.id]=s,o=!0),e!==s&&(i[e.id]=e)}),o&&(n=i),n}function a(e,t,n,r,i){var s=this;r&&r[0]==="submit_on"&&(i==="after"&&s._afters.length?o.call(s,s._afters):s._subscribers.length&&o.call(s,s._subscribers))}function f(e,t,n,i,s){var o=this;i&&i[0]==="submit_on"&&(s==="after"&&!r.isEmpty(o.afters)?o.afters=u.call(o,e,o.afters):r.isEmpty(o.subscribers)||(o.subscribers=u.call(o,o.subscribers)))}var n=e.Array,r=e.Object,i=e.Selector;e.Event.define("submit",{delegate:function(e,t,n,i){var s=this,o=s._prepareHandles(t,e);r.owns(o,"click")||(o.click=e.delegate("click",function(r){var o=r.target;if(s._getNodeName(o,"input")||s._getNodeName(o,"button")){var u=o.get("form");u&&s._attachEvent(u,e,t,n,i)}},i))},detach:function(e,t,n){var r=this;r._detachEvents(e,t,n)},detachDelegate:function(e,t,n){var r=this;r._detachEvents(e,t,n)},on:function(e,t,n){var r=this;r._attachEvent(e,e,t,n)},_attachEvent:function(t,n,s,o,u){var a=this,f=function(r){var s=!0;if(u){if(!r.stopped||!a._hasParent(r._stoppedOnNode,n)){var f=n.getDOM(),l=t.getDOM();do l&&i.test(l,u)&&(r.currentTarget=e.one(l),r.container=n,s=o.fire(r),r.stopped&&!r._stoppedOnNode&&(r._stoppedOnNode=n)),l=l.parentNode;while(s!==!1&&!r.stopped&&l&&l!==f);s=s!==!1&&r.stopped!==2}}else s=o.fire(r),r.stopped&&!r._stoppedOnNode&&(r._stoppedOnNode=n);return s},l=a._prepareHandles(s,t);r.owns(l,"submit")||(l.submit=e.Event._attach(["submit",f,t,o,u?"submit_delegate":"submit_on"]))},_detachEvents:function(t,n){e.each(n._handles,function(t){e.each(t,function(e){e.detach()})}),delete n._handles},_getNodeName:function(e,t){var n=e.get("nodeName");return n&&n.toLowerCase()===t.toLowerCase()},_hasParent:function(e,t){return e.ancestor(function(e){return e===t},!1)},_prepareHandles:function(e,t){r.owns(e,"_handles")||(e._handles={});var n=e._handles;return r.owns(n,t)||(n[t]={}),n[t]}},!0);var s=e.CustomEvent.prototype._on;e.CustomEvent.prototype._on=function(e,t,n,r){var i=this,o=s.apply(i,arguments);return i._kds?f.call(i,o,e,t,n,r):a.call(i,o,e,t,n,r),o}},"4.1.1",{requires:["aui-event-base","event-delegate","event-synthetic"]}); +YUI.add("aui-event-delegate-submit",function(e,t){function o(e){n.some(e,function(t,n){if(t.args&&t.args[0]==="submit_delegate"){var r=e.splice(e.length-1,1)[0];return e.splice(n,0,r),!0}})}function u(e,t){var n=t,i={},s=t[e.sub.id],o=!1;return r.each(t,function(e){!o&&e.args&&e.args[0]==="submit_delegate"&&(i[s.id]=s,o=!0),e!==s&&(i[e.id]=e)}),o&&(n=i),n}function a(e,t,n,r,i){var s=this;r&&r[0]==="submit_on"&&(i==="after"&&s._afters.length?o.call(s,s._afters):s._subscribers.length&&o.call(s,s._subscribers))}function f(e,t,n,i,s){var o=this;i&&i[0]==="submit_on"&&(s==="after"&&!r.isEmpty(o.afters)?o.afters=u.call(o,e,o.afters):r.isEmpty(o.subscribers)||(o.subscribers=u.call(o,o.subscribers)))}var n=e.Array,r=e.Object,i=e.Selector;e.Event.define("submit",{delegate:function(e,t,n,i){var s=this,o=s._prepareHandles(t,e);r.owns(o,"click")||(o.click=e.delegate("click",function(r){var o=r.target;if(s._getNodeName(o,"input")||s._getNodeName(o,"button")){var u=o.get("form");u&&s._attachEvent(u,e,t,n,i)}},i))},detach:function(e,t,n){var r=this;r._detachEvents(e,t,n)},detachDelegate:function(e,t,n){var r=this;r._detachEvents(e,t,n)},on:function(e,t,n){var r=this;r._attachEvent(e,e,t,n)},_attachEvent:function(t,n,s,o,u){var a=this,f=function(r){var s=!0;if(u){if(!r.stopped||!a._hasParent(r._stoppedOnNode,n)){var f=n.getDOM(),l=t.getDOM();do l&&i.test(l,u)&&(r.currentTarget=e.one(l),r.container=n,s=o.fire(r),r.stopped&&!r._stoppedOnNode&&(r._stoppedOnNode=n)),l=l.parentNode;while(s!==!1&&!r.stopped&&l&&l!==f);s=s!==!1&&r.stopped!==2}}else s=o.fire(r),r.stopped&&!r._stoppedOnNode&&(r._stoppedOnNode=n);return s},l=a._prepareHandles(s,t);r.owns(l,"submit")||(l.submit=e.Event._attach(["submit",f,t,o,u?"submit_delegate":"submit_on"]))},_detachEvents:function(t,n){e.each(n._handles,function(t){e.each(t,function(e){e.detach()})}),delete n._handles},_getNodeName:function(e,t){var n=e.get("nodeName");return n&&n.toLowerCase()===t.toLowerCase()},_hasParent:function(e,t){return e.ancestor(function(e){return e===t},!1)},_prepareHandles:function(e,t){r.owns(e,"_handles")||(e._handles={});var n=e._handles;return r.owns(n,t)||(n[t]={}),n[t]}},!0);var s=e.CustomEvent.prototype._on;e.CustomEvent.prototype._on=function(e,t,n,r){var i=this,o=s.apply(i,arguments);return i._kds?f.call(i,o,e,t,n,r):a.call(i,o,e,t,n,r),o}},"4.2.0",{requires:["aui-event-base","event-delegate","event-synthetic"]}); diff --git a/build/aui-event-input/aui-event-input-min.js b/build/aui-event-input/aui-event-input-min.js index ac014578c02..655a8f170db 100644 --- a/build/aui-event-input/aui-event-input-min.js +++ b/build/aui-event-input/aui-event-input-min.js @@ -1 +1 @@ -YUI.add("aui-event-input",function(e,t){var n=e.Node.DOM_EVENTS;if(e.Features.test("event","input")){n.input=1;return}n.cut=1,n.dragend=1,n.paste=1;var r=e.Event.KeyMap,i="~~aui|input|event~~",s=["keydown","paste","drop","cut"],o={cut:1,drop:1,paste:1};e.Event.define("input",{on:function(t,n,r){var i=this;n._handler=t.on(s,e.bind(i._dispatchEvent,i,n,r))},delegate:function(t,n,r,o){var u=this;n._handles=[],n._handler=t.delegate("focus",function(t){var o=t.target,a=o.getData(i);a||(a=o.on(s,e.bind(u._dispatchEvent,u,n,r)),n._handles.push(a),o.setData(i,a))},o)},detach:function(e,t){t._handler.detach()},detachDelegate:function(t,n){e.Array.each(n._handles,function(t){var n=e.one(t.evt.el);n&&n.setData(i,null),t.detach()}),n._handler.detach()},_dispatchEvent:function(t,n,i){var s=this,u,a;u=i.target,(o[i.type]||u.get("ownerDocument").get("activeElement")===u)&&r.isModifyingKey(i.keyCode)&&(t._timer&&(t._timer.cancel(),t._timer=null),a=r.isKey(i.keyCode,"WIN_IME")?null:u.get("value"),t._timer=e.soon(e.bind("_fireEvent",s,t,n,i,a)))},_fireEvent:function(e,t,n,r){var i=n.target;e._timer=null,i.get("value")!==r&&t.fire(n)}})},"4.1.1",{requires:["aui-event-base","event-delegate","event-synthetic","timers"]}); +YUI.add("aui-event-input",function(e,t){var n=e.Node.DOM_EVENTS;if(e.Features.test("event","input")){n.input=1;return}n.cut=1,n.dragend=1,n.paste=1;var r=e.Event.KeyMap,i="~~aui|input|event~~",s=["keydown","paste","drop","cut"],o={cut:1,drop:1,paste:1};e.Event.define("input",{on:function(t,n,r){var i=this;n._handler=t.on(s,e.bind(i._dispatchEvent,i,n,r))},delegate:function(t,n,r,o){var u=this;n._handles=[],n._handler=t.delegate("focus",function(t){var o=t.target,a=o.getData(i);a||(a=o.on(s,e.bind(u._dispatchEvent,u,n,r)),n._handles.push(a),o.setData(i,a))},o)},detach:function(e,t){t._handler.detach()},detachDelegate:function(t,n){e.Array.each(n._handles,function(t){var n=e.one(t.evt.el);n&&n.setData(i,null),t.detach()}),n._handler.detach()},_dispatchEvent:function(t,n,i){var s=this,u,a;u=i.target,(o[i.type]||u.get("ownerDocument").get("activeElement")===u)&&r.isModifyingKey(i.keyCode)&&(t._timer&&(t._timer.cancel(),t._timer=null),a=r.isKey(i.keyCode,"WIN_IME")?null:u.get("value"),t._timer=e.soon(e.bind("_fireEvent",s,t,n,i,a)))},_fireEvent:function(e,t,n,r){var i=n.target;e._timer=null,i.get("value")!==r&&t.fire(n)}})},"4.2.0",{requires:["aui-event-base","event-delegate","event-synthetic","timers"]}); diff --git a/build/aui-form-builder-field-base/aui-form-builder-field-base-min.js b/build/aui-form-builder-field-base/aui-form-builder-field-base-min.js index 44d35230f24..27c90a1da70 100644 --- a/build/aui-form-builder-field-base/aui-form-builder-field-base-min.js +++ b/build/aui-form-builder-field-base/aui-form-builder-field-base-min.js @@ -1 +1 @@ -YUI.add("aui-form-builder-field-base",function(e,t){var n=e.getClassName("form","builder","field"),r=e.getClassName("form","builder","field","content"),i=e.getClassName("form","builder","field","content","footer"),s=e.getClassName("form","builder","field","content","toolbar"),o=e.getClassName("form","builder","field","footer","content"),u=e.getClassName("form","builder","field","move","button"),a=e.getClassName("form","builder","field","move","target"),f=e.getClassName("form","builder","field","move","target","label"),l=e.getClassName("form","builder","field","nested"),c=e.getClassName("form","builder","field","overlay"),h=e.getClassName("form","builder","field","settings","panel"),p=e.getClassName("form","builder","field","settings","panel","advanced"),d=e.getClassName("form","builder","field","settings","panel","advanced","content"),v=e.getClassName("form","builder","field","settings","panel","content"),m=e.getClassName("form","builder","field","settings","panel","toggler","advanced"),g=e.getClassName("form","builder","field","toolbar","container"),y=e.getClassName("hide");e.FormBuilderFieldBase=function(){},e.FormBuilderFieldBase.prototype={TPL_FIELD:'
'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+"
",TPL_FIELD_MOVE_TARGET:'',TPL_FIELD_SETTINGS_PANEL:'
'+'
'+"
"+'"+"
",TPL_FIELD_FOOTER_CONTENT:'
',initializer:function(){var t,n;this._fieldSettingsPanel=e.Node.create(e.Lang.sub(this.TPL_FIELD_SETTINGS_PANEL,{advancedOptions:this.get("strings").advancedOptions})),t=this._getAdvancedSettings();for(n=0;n'+'
'+'
'+'
'+'
'+'
'+'
'+'
'+"",TPL_FIELD_MOVE_TARGET:'',TPL_FIELD_SETTINGS_PANEL:'
'+'
'+"
"+'"+"
",TPL_FIELD_FOOTER_CONTENT:'
',initializer:function(){var t,n;this._fieldSettingsPanel=e.Node.create(e.Lang.sub(this.TPL_FIELD_SETTINGS_PANEL,{advancedOptions:this.get("strings").advancedOptions})),t=this._getAdvancedSettings();for(n=0;n'+''+'+'+'"+"",TPL_FIELD_LIST:'
'+'
'+"
",TPL_FIELD_MOVE_TARGET:'',initializer:function(){var t=this.get("content");this._uiSetFields(this.get("fields")),t.delegate("click",this._onClickAddField,"."+r,this),t.delegate("mouseenter",this._onMouseEnterAddButton,"."+f,this),t.delegate("mouseleave",this._onMouseLeaveAddButton,"."+f,this),this.after("fieldsChange",e.bind(this._afterFieldsChange,this)),this.after("enableAddFieldsChange",e.bind(this._afterEnableAddFieldsChange,this))},addField:function(t,n){var r=this.get("fields");if(!this.get("enableAddFields"))return;e.Lang.isNumber(n)?r.splice(n,0,t):r.splice(this._newFieldIndex,0,t),this.set("fields",r)},removeField:function(e){var t=this.get("fields"),n=t.indexOf(e);t.splice(n,1),this.set("fields",t)},_addEmptyColumnFieldClasses:function(e){e.one("."+f).addClass(a),e.one("."+r).addClass(o)},_afterEnableAddFieldsChange:function(){this._uiToggleDisableAddField()},_afterFieldsChange:function(){var e=this.get("fields");this._uiSetFields(e),this._updateRemovableLayoutColProperty()},_appendAddFieldNode:function(t){var n;return n=e.Node.create(e.Lang.sub(this.TPL_ADD_FIELD,{addField:this.get("strings").addField})),t.append(n),n},_appendAddMoveTargetNode:function(t,n){var r;return r=e.Node.create(e.Lang.sub(this.TPL_FIELD_MOVE_TARGET,{pasteHere:this.get("strings").pasteHere})),r.setData("field-list-index",n),t.append(r),r},_onClickAddField:function(e){var t=this.get("content").all("."+r);this._newFieldIndex=t.indexOf(e.currentTarget)},_onMouseEnterAddButton:function(e){var t=e.currentTarget;this.get("fields").length>0&&t.addClass(a)},_onMouseLeaveAddButton:function(e){var t=e.currentTarget;this.get("fields").length>0&&t.removeClass(a)},_uiSetField:function(e,t,n){this._appendAddFieldNode(e),this._appendAddMoveTargetNode(e,n),e.append(t.get("content"))},_uiSetFields:function(e){var t=this.get("content"),n=t.one("."+l),r;n.empty();for(r=0;r'+''+'+'+'"+"",TPL_FIELD_LIST:'
'+'
'+"
",TPL_FIELD_MOVE_TARGET:'',initializer:function(){var t=this.get("content");this._uiSetFields(this.get("fields")),t.delegate("click",this._onClickAddField,"."+r,this),t.delegate("mouseenter",this._onMouseEnterAddButton,"."+f,this),t.delegate("mouseleave",this._onMouseLeaveAddButton,"."+f,this),this.after("fieldsChange",e.bind(this._afterFieldsChange,this)),this.after("enableAddFieldsChange",e.bind(this._afterEnableAddFieldsChange,this))},addField:function(t,n){var r=this.get("fields");if(!this.get("enableAddFields"))return;e.Lang.isNumber(n)?r.splice(n,0,t):r.splice(this._newFieldIndex,0,t),this.set("fields",r)},removeField:function(e){var t=this.get("fields"),n=t.indexOf(e);t.splice(n,1),this.set("fields",t)},_addEmptyColumnFieldClasses:function(e){e.one("."+f).addClass(a),e.one("."+r).addClass(o)},_afterEnableAddFieldsChange:function(){this._uiToggleDisableAddField()},_afterFieldsChange:function(){var e=this.get("fields");this._uiSetFields(e),this._updateRemovableLayoutColProperty()},_appendAddFieldNode:function(t){var n;return n=e.Node.create(e.Lang.sub(this.TPL_ADD_FIELD,{addField:this.get("strings").addField})),t.append(n),n},_appendAddMoveTargetNode:function(t,n){var r;return r=e.Node.create(e.Lang.sub(this.TPL_FIELD_MOVE_TARGET,{pasteHere:this.get("strings").pasteHere})),r.setData("field-list-index",n),t.append(r),r},_onClickAddField:function(e){var t=this.get("content").all("."+r);this._newFieldIndex=t.indexOf(e.currentTarget)},_onMouseEnterAddButton:function(e){var t=e.currentTarget;this.get("fields").length>0&&t.addClass(a)},_onMouseLeaveAddButton:function(e){var t=e.currentTarget;this.get("fields").length>0&&t.removeClass(a)},_uiSetField:function(e,t,n){this._appendAddFieldNode(e),this._appendAddMoveTargetNode(e,n),e.append(t.get("content"))},_uiSetFields:function(e){var t=this.get("content"),n=t.one("."+l),r;n.empty();for(r=0;r'+''+'
',TPL_TOOLBAR_ITEM:'',initializer:function(){var t=this.get("formBuilder").get("contentBox");this._toolbar=e.Node.create(this.TPL_TOOLBAR),this._eventHandles=[this.after("itemsChange",this._afterItemsChange),this._toolbar.delegate("click",this._onToggleClick,"."+f,this),this._toolbar.delegate("click",this._onItemClick,"."+u,this)],e.UA.mobile?(this._toolbar.one("."+f).remove(),this._eventHandles.push(t.delegate("click",this._onFieldClick,"."+r,this))):this._eventHandles.push(t.delegate("mouseenter",this._onFieldMouseEnter,"."+i,this),t.delegate("mouseleave",this._onFieldMouseLeave,"."+i,this)),this._uiSetItems(this.get("items"))},destructor:function(){(new e.EventHandle(this._eventHandles)).detach()},addForField:function(e){e.get("content").one("."+o).append(this._toolbar),this.fire("onToolbarHasAddedToField",{colNode:e.get("content").ancestor(".col")})},close:function(){this._toolbar.removeClass("open")},getItem:function(e){return this._toolbar.one(e)},open:function(){this._toolbar.addClass("open")},remove:function(){this._toolbar.remove(),this.close()},_afterItemsChange:function(){this._uiSetItems(this.get("items"))},_getFieldFromEvent:function(e){return e.currentTarget.ancestor("."+n).getData("field-instance")},_getItemFromEvent:function(e){var t=this._toolbar.all("."+u).indexOf(e.currentTarget);return this.get("items")[t]},_onFieldClick:function(e){var t=e.currentTarget.ancestor("."+n).getData("field-instance");this.addForField(t),this.open()},_onFieldMouseEnter:function(e){var t=this._getFieldFromEvent(e);this.get("disabled")||this.addForField(t)},_onFieldMouseLeave:function(){this.remove()},_onItemClick:function(e){var t=this._getFieldFromEvent(e),n=this.get("formBuilder"),r=this._getItemFromEvent(e);this.close(),r.handler&&n[r.handler].call(n,t)},_onToggleClick:function(){this.open()},_uiSetItems:function(t){var n,r=this._toolbar.one("."+a);r.empty();for(n=0;n'+''+'
',TPL_TOOLBAR_ITEM:'',initializer:function(){var t=this.get("formBuilder").get("contentBox");this._toolbar=e.Node.create(this.TPL_TOOLBAR),this._eventHandles=[this.after("itemsChange",this._afterItemsChange),this._toolbar.delegate("click",this._onToggleClick,"."+f,this),this._toolbar.delegate("click",this._onItemClick,"."+u,this)],e.UA.mobile?(this._toolbar.one("."+f).remove(),this._eventHandles.push(t.delegate("click",this._onFieldClick,"."+r,this))):this._eventHandles.push(t.delegate("mouseenter",this._onFieldMouseEnter,"."+i,this),t.delegate("mouseleave",this._onFieldMouseLeave,"."+i,this)),this._uiSetItems(this.get("items"))},destructor:function(){(new e.EventHandle(this._eventHandles)).detach()},addForField:function(e){e.get("content").one("."+o).append(this._toolbar),this.fire("onToolbarHasAddedToField",{colNode:e.get("content").ancestor(".col")})},close:function(){this._toolbar.removeClass("open")},getItem:function(e){return this._toolbar.one(e)},open:function(){this._toolbar.addClass("open")},remove:function(){this._toolbar.remove(),this.close()},_afterItemsChange:function(){this._uiSetItems(this.get("items"))},_getFieldFromEvent:function(e){return e.currentTarget.ancestor("."+n).getData("field-instance")},_getItemFromEvent:function(e){var t=this._toolbar.all("."+u).indexOf(e.currentTarget);return this.get("items")[t]},_onFieldClick:function(e){var t=e.currentTarget.ancestor("."+n).getData("field-instance");this.addForField(t),this.open()},_onFieldMouseEnter:function(e){var t=this._getFieldFromEvent(e);this.get("disabled")||this.addForField(t)},_onFieldMouseLeave:function(){this.remove()},_onItemClick:function(e){var t=this._getFieldFromEvent(e),n=this.get("formBuilder"),r=this._getItemFromEvent(e);this.close(),r.handler&&n[r.handler].call(n,t)},_onToggleClick:function(){this.open()},_uiSetItems:function(t){var n,r=this._toolbar.one("."+a);r.empty();for(n=0;n',TPL_FIELD_TYPE_CONTENT:'
{label}
',initializer:function(){this.get("node").setHTML(e.Lang.sub(this.TPL_FIELD_TYPE_CONTENT,{icon:this.get("icon"),label:this.get("label")})),this.get("node").setData("fieldType",this),this._uiSetDisabled(this.get("disabled")),this.after({disabledChange:this._afterDisabledChange,iconChange:this._afterIconChange,labelChange:this._afterLabelChange}),this.get("node").on("mouseleave",e.bind(this._onMouseLeave,this)),this.get("node").on("mouseover",e.bind(this._onMouseOver,this))},destructor:function(){this.get("node").remove(!0)},_afterDisabledChange:function(){this._uiSetDisabled(this.get("disabled"))},_afterIconChange:function(e){var t=this.get("node").one(".field-type-icon");t&&t.replaceClass(e.prevVal,e.newVal)},_afterLabelChange:function(){var e=this.get("node").one(".field-type-label");e&&e.setHTML(this.get("label"))},_onMouseLeave:function(){var e=this.get("node");e.one(".field-type-label").removeClass("field-type-label-mouse-over"),e.one(".field-type-icon").removeClass("field-type-icon-mouse-over")},_onMouseOver:function(){var e=this.get("node");e.one(".field-type-label").addClass("field-type-label-mouse-over"),e.one(".field-type-icon").addClass("field-type-icon-mouse-over")},_uiSetDisabled:function(e){this.get("node").toggleClass("field-type-disabled",e)}},{ATTRS:{defaultConfig:{validator:e.Lang.isObject,value:{}},disabled:{validator:e.Lang.isBoolean,value:!1},fieldClass:{validator:e.Lang.isFunction},icon:{validator:e.Lang.isString,value:""},label:{validator:e.Lang.isString,value:""},node:{validator:function(t){return e.instanceOf(t,e.Node)},valueFn:function(){return e.Node.create(this.TPL_FIELD_TYPE)}},unique:{validator:e.Lang.isBoolean,value:!1}}})},"4.1.1",{requires:["base","node-base"],skinnable:!0}); +YUI.add("aui-form-builder-field-type",function(e,t){e.FormBuilderFieldType=e.Base.create("form-builder-field-type",e.Base,[],{TPL_FIELD_TYPE:'
',TPL_FIELD_TYPE_CONTENT:'
{label}
',initializer:function(){this.get("node").setHTML(e.Lang.sub(this.TPL_FIELD_TYPE_CONTENT,{icon:this.get("icon"),label:this.get("label")})),this.get("node").setData("fieldType",this),this._uiSetDisabled(this.get("disabled")),this.after({disabledChange:this._afterDisabledChange,iconChange:this._afterIconChange,labelChange:this._afterLabelChange}),this.get("node").on("mouseleave",e.bind(this._onMouseLeave,this)),this.get("node").on("mouseover",e.bind(this._onMouseOver,this))},destructor:function(){this.get("node").remove(!0)},_afterDisabledChange:function(){this._uiSetDisabled(this.get("disabled"))},_afterIconChange:function(e){var t=this.get("node").one(".field-type-icon");t&&t.replaceClass(e.prevVal,e.newVal)},_afterLabelChange:function(){var e=this.get("node").one(".field-type-label");e&&e.setHTML(this.get("label"))},_onMouseLeave:function(){var e=this.get("node");e.one(".field-type-label").removeClass("field-type-label-mouse-over"),e.one(".field-type-icon").removeClass("field-type-icon-mouse-over")},_onMouseOver:function(){var e=this.get("node");e.one(".field-type-label").addClass("field-type-label-mouse-over"),e.one(".field-type-icon").addClass("field-type-icon-mouse-over")},_uiSetDisabled:function(e){this.get("node").toggleClass("field-type-disabled",e)}},{ATTRS:{defaultConfig:{validator:e.Lang.isObject,value:{}},disabled:{validator:e.Lang.isBoolean,value:!1},fieldClass:{validator:e.Lang.isFunction},icon:{validator:e.Lang.isString,value:""},label:{validator:e.Lang.isString,value:""},node:{validator:function(t){return e.instanceOf(t,e.Node)},valueFn:function(){return e.Node.create(this.TPL_FIELD_TYPE)}},unique:{validator:e.Lang.isBoolean,value:!1}}})},"4.2.0",{requires:["base","node-base"],skinnable:!0}); diff --git a/build/aui-form-builder-field-types-modal/aui-form-builder-field-types-modal-min.js b/build/aui-form-builder-field-types-modal/aui-form-builder-field-types-modal-min.js index 919a6a3915b..56143aaf1c2 100644 --- a/build/aui-form-builder-field-types-modal/aui-form-builder-field-types-modal-min.js +++ b/build/aui-form-builder-field-types-modal/aui-form-builder-field-types-modal-min.js @@ -1 +1 @@ -YUI.add("aui-form-builder-field-types-modal",function(e,t){var n=e.getClassName("field","type"),r=e.getClassName("form","builder","field","types","list"),i=e.getClassName("modal","title");e.FormBuilderFieldTypesModal=e.Base.create("form-builder-field-types-modal",e.Modal,[],{TPL_HEADER_LABEL:'

{addField}

',TPL_TYPES_LIST:'
',initializer:function(){this.after("fieldTypesChange",this._afterFieldTypesChange)},bindUI:function(){var t=this.getStdModNode("body");e.FormBuilderFieldTypesModal.superclass.bindUI.apply(this,arguments),this._eventHandles.push(t.delegate("click",this._onClickFieldType,"."+n,this),t.delegate("key",e.bind(this._onKeyPressFieldType,this),"enter","."+n))},renderUI:function(){e.FormBuilderFieldTypesModal.superclass.renderUI.apply(this,arguments),this._uiSetFieldTypes(this.get("fieldTypes"))},_afterFieldTypesChange:function(){this._uiSetFieldTypes(this.get("fieldTypes"))},_onClickFieldType:function(e){var t=e.currentTarget.getData("fieldType");this.hide(),this.fire("selectFieldType",{fieldType:t})},_onFieldTypesModalCloseClick:function(){this.hide()},_onKeyPressFieldType:function(e){this._onClickFieldType(e)},_uiSetFieldTypes:function(t){var n=e.Node.create(this.TPL_TYPES_LIST);n.get("children").remove(),e.Array.each(t,function(e){n.append(e.get("node"))}),this.set("bodyContent",n)},_valueHeaderContent:function(){return e.Lang.sub(this.TPL_HEADER_LABEL,{addField:this.get("strings").addField})},_valueToolbars:function(){return{header:[{cssClass:"close",discardDefaultButtonCssClasses:!0,labelHTML:" \u00d7 ",on:{click:e.bind(this._onFieldTypesModalCloseClick,this)}}]}}},{ATTRS:{fieldTypes:{validator:e.Lang.isArray,value:[]},headerContent:{valueFn:"_valueHeaderContent"},strings:{value:{addField:"Add Field"}},toolbars:{validator:e.Lang.isObject,valueFn:"_valueToolbars"}},CSS_PREFIX:"modal-dialog"})},"4.1.1",{requires:["aui-modal"],skinnable:!0}); +YUI.add("aui-form-builder-field-types-modal",function(e,t){var n=e.getClassName("field","type"),r=e.getClassName("form","builder","field","types","list"),i=e.getClassName("modal","title");e.FormBuilderFieldTypesModal=e.Base.create("form-builder-field-types-modal",e.Modal,[],{TPL_HEADER_LABEL:'

{addField}

',TPL_TYPES_LIST:'
',initializer:function(){this.after("fieldTypesChange",this._afterFieldTypesChange)},bindUI:function(){var t=this.getStdModNode("body");e.FormBuilderFieldTypesModal.superclass.bindUI.apply(this,arguments),this._eventHandles.push(t.delegate("click",this._onClickFieldType,"."+n,this),t.delegate("key",e.bind(this._onKeyPressFieldType,this),"enter","."+n))},renderUI:function(){e.FormBuilderFieldTypesModal.superclass.renderUI.apply(this,arguments),this._uiSetFieldTypes(this.get("fieldTypes"))},_afterFieldTypesChange:function(){this._uiSetFieldTypes(this.get("fieldTypes"))},_onClickFieldType:function(e){var t=e.currentTarget.getData("fieldType");this.hide(),this.fire("selectFieldType",{fieldType:t})},_onFieldTypesModalCloseClick:function(){this.hide()},_onKeyPressFieldType:function(e){this._onClickFieldType(e)},_uiSetFieldTypes:function(t){var n=e.Node.create(this.TPL_TYPES_LIST);n.get("children").remove(),e.Array.each(t,function(e){n.append(e.get("node"))}),this.set("bodyContent",n)},_valueHeaderContent:function(){return e.Lang.sub(this.TPL_HEADER_LABEL,{addField:this.get("strings").addField})},_valueToolbars:function(){return{header:[{cssClass:"close",discardDefaultButtonCssClasses:!0,labelHTML:" \u00d7 ",on:{click:e.bind(this._onFieldTypesModalCloseClick,this)}}]}}},{ATTRS:{fieldTypes:{validator:e.Lang.isArray,value:[]},headerContent:{valueFn:"_valueHeaderContent"},strings:{value:{addField:"Add Field"}},toolbars:{validator:e.Lang.isObject,valueFn:"_valueToolbars"}},CSS_PREFIX:"modal-dialog"})},"4.2.0",{requires:["aui-modal"],skinnable:!0}); diff --git a/build/aui-form-builder-field-types/aui-form-builder-field-types-min.js b/build/aui-form-builder-field-types/aui-form-builder-field-types-min.js index c06961f68d3..e5199ebc8eb 100644 --- a/build/aui-form-builder-field-types/aui-form-builder-field-types-min.js +++ b/build/aui-form-builder-field-types/aui-form-builder-field-types-min.js @@ -1 +1 @@ -YUI.add("aui-form-builder-field-types",function(e,t){e.FormBuilderFieldTypes=function(){},e.FormBuilderFieldTypes.prototype={initializer:function(){this.after("fieldTypesChange",this._afterFieldTypesChange),this.after("form-builder-field-types-modal:selectFieldType",this._afterSelectFieldType)},destructor:function(){e.Array.each(this.get("fieldTypes"),function(e){e.destroy()}),this.get("fieldTypesModal").destroy()},disableUniqueFieldType:function(e){var t=this.findTypeOfField(e);t.get("unique")&&t.set("disabled",!0)},findTypeOfField:function(e){var t=this.get("fieldTypes"),n;for(n=0;n=0;r--)n[r].get("fieldClass")===t&&this._unregisterFieldTypeByIndex(r);else this._unregisterFieldTypeByIndex(n.indexOf(t))},_unregisterFieldTypeByIndex:function(e){var t=this.get("fieldTypes");e!==-1&&(t[e].destroy(),t.splice(e,1))},_updateUniqueFieldType:function(){var t=this;e.Array.each(t.get("fieldTypes"),function(e){e.get("unique")&&e.set("disabled",t._checkActiveLayoutHasFieldType(e))})},_valueFieldTypesModal:function(){var t=new e.FormBuilderFieldTypesModal({centered:!0,cssClass:"form-builder-modal",draggable:!1,fieldTypes:this.get("fieldTypes"),modal:!0,resizable:!1,visible:!1,zIndex:4});return t.addTarget(this),t}},e.FormBuilderFieldTypes.ATTRS={fieldTypes:{setter:"_setFieldTypes",validator:e.Lang.isArray,value:[]},fieldTypesModal:{valueFn:"_valueFieldTypesModal"}}},"4.1.1",{requires:["aui-classnamemanager","aui-form-builder-field-types-modal","base","node-base"],skinnable:!0}); +YUI.add("aui-form-builder-field-types",function(e,t){e.FormBuilderFieldTypes=function(){},e.FormBuilderFieldTypes.prototype={initializer:function(){this.after("fieldTypesChange",this._afterFieldTypesChange),this.after("form-builder-field-types-modal:selectFieldType",this._afterSelectFieldType)},destructor:function(){e.Array.each(this.get("fieldTypes"),function(e){e.destroy()}),this.get("fieldTypesModal").destroy()},disableUniqueFieldType:function(e){var t=this.findTypeOfField(e);t.get("unique")&&t.set("disabled",!0)},findTypeOfField:function(e){var t=this.get("fieldTypes"),n;for(n=0;n=0;r--)n[r].get("fieldClass")===t&&this._unregisterFieldTypeByIndex(r);else this._unregisterFieldTypeByIndex(n.indexOf(t))},_unregisterFieldTypeByIndex:function(e){var t=this.get("fieldTypes");e!==-1&&(t[e].destroy(),t.splice(e,1))},_updateUniqueFieldType:function(){var t=this;e.Array.each(t.get("fieldTypes"),function(e){e.get("unique")&&e.set("disabled",t._checkActiveLayoutHasFieldType(e))})},_valueFieldTypesModal:function(){var t=new e.FormBuilderFieldTypesModal({centered:!0,cssClass:"form-builder-modal",draggable:!1,fieldTypes:this.get("fieldTypes"),modal:!0,resizable:!1,visible:!1,zIndex:4});return t.addTarget(this),t}},e.FormBuilderFieldTypes.ATTRS={fieldTypes:{setter:"_setFieldTypes",validator:e.Lang.isArray,value:[]},fieldTypesModal:{valueFn:"_valueFieldTypesModal"}}},"4.2.0",{requires:["aui-classnamemanager","aui-form-builder-field-types-modal","base","node-base"],skinnable:!0}); diff --git a/build/aui-form-builder-layout-builder/aui-form-builder-layout-builder-min.js b/build/aui-form-builder-layout-builder/aui-form-builder-layout-builder-min.js index b223932d922..1bee191c32a 100644 --- a/build/aui-form-builder-layout-builder/aui-form-builder-layout-builder-min.js +++ b/build/aui-form-builder-layout-builder/aui-form-builder-layout-builder-min.js @@ -1,2 +1,2 @@ YUI.add("aui-form-builder-layout-builder",function(e,t){var n=e.getClassName("form","builder","choose","col","move"),r=e.getClassName("form","builder","choose","col","move","target"),i=e.getClassName("form","builder","field"),s=e.getClassName("form","builder","field","move","button"),o=e.getClassName("form","builder","field","move","target"),u=e.getClassName("form","builder","field","move","target","invalid"),a=e.getClassName("form","builder","field","moving"),f=e.getClassName("form","builder","layout"),l=e.getClassName("layout","builder","move","cancel"),c=e.getClassName("layout","builder","move","col","target"),h=e.getClassName("layout","builder","move","row","target"),p=e.getClassName("layout","builder","move","target"),d=e.getClassName("form","builder","remove","row","modal");e.FormBuilderLayoutBuilder=function(){},e.FormBuilderLayoutBuilder.prototype={initializer:function(){this._initRemoveConfirmationModal(),this.after({render:this._afterLayoutBuilderRender,"layout-row:colsChange":this._afterLayoutBuilderColsChange})},destructor:function(){this._layoutBuilder&&this._layoutBuilder.destroy(),this._removeConfirmationModal.destroy()},_addColMoveButton:function(e,t){var n=e.all("."+s);n.setData("node-col",e),n.setData("node-row",t),this._renderEmptyColumns()},_addColMoveTarget:function(e){var t=e.get("node"),n;t.addClass(r),n=t.all("."+o),n.setData("col",e)},_afterLayoutBuilderColsChange:function(){var e=this.getActiveLayout();this._checkLastRow(e)},_afterLayoutBuilderMoveEnd:function(){this._detachCancelMoveRowEvents(),this._enableAddFields(),this._fieldToolbar.set("disabled",!1),this._pageManager.enablePaginations()},_afterLayoutBuilderMoveStart:function(t){t.moveElement instanceof e.LayoutRow&&this._bindMoveRowEvents(),this._disableAddFields(),this._fieldToolbar.set("disabled",!0),this._pageManager.disablePaginations()},_afterLayoutBuilderRender:function(){var t;this._layoutBuilder=new e.LayoutBuilder({addColMoveButton:e.bind(this._addColMoveButton,this),addColMoveTarget:e.bind(this._addColMoveTarget,this),clickColMoveTarget:e.bind(this._clickColMoveTarget,this),clickRemoveRow:e.bind(this._clickRemoveRow,this),container:this.get("contentBox").one("."+f),layout:this.getActiveLayout(),removeColMoveButtons:e.bind(this._removeColMoveButtons,this),removeColMoveTargets:e.bind(this._removeColMoveTargets,this),strings:this.get("strings")}),this._layoutBuilder.after("layout-builder:moveStart",e.bind(this._afterLayoutBuilderMoveStart,this)),this._layoutBuilder.after("layout-builder:moveEnd",e.bind(this._afterLayoutBuilderMoveEnd,this)),t=this._layoutBuilder.get("chooseColMoveTarget"),this._layoutBuilder.set("chooseColMoveTarget",e.bind(this._chooseColMoveTarget,this,t)),this._eventHandles.push(this._fieldToolbar.on("onToolbarHasAddedToField",e.bind(this._onFormBuilderToolbarHasAddedToField,this))),this._removeLayoutCutColButtons()},_bindMoveRowEvents:function(){this._cancelMoveRowsHandles=[e.one(e.config.doc).on("click",e.bind(this._onClickOutsideMoveRowTarget,this))]},_checkLastRow:function(e){var t,n,r,i;n=this._getLastRow(e),t=n.get("cols"),t.length>1||!this._isColumnEmpty(t[0])?this._createLastRow(e):(i=e.get("rows"),r=i[i.length-2],r&&(t=r.get("cols"),t.length===1&&this._isColumnEmpty(t[0])&&e.removeRow(r))),this._getLastRow(e).set("removable",!1)},_chooseColMoveTarget:function(t,n,r){var s=n.ancestor("."+i),f=this.getActiveLayout(),l;this._fieldBeingMoved=s.getData("field-instance"),this._fieldListBeingMoved=r.get("value"),this._fieldBeingMovedCol=r,s.addClass(a),s.all("."+o).addClass(u),l=s.previous("."+o),l&&l.addClass(u),l=s.next("."+o),l&&l.addClass(u),t(n,r),this._addColMoveTarget(r),f.normalizeColsHeight(f.get("node").all(".row")),this._selectFirstValidMoveTarget(),this._cancelMoveFieldHandles=[e.one(e.config.doc).on("click",e.bind(this._onClickOutsideMoveColTarget,this)),e.one(e.config.doc).on("key",e.bind(this._onEscKeyPressMoveTarget,this),"down:27")]},_clickColMoveTarget:function(t){var n=this.getActiveLayout(),r=this._fieldBeingMoved.get("content").ancestor("."+i),s,o=t.getData("nested-field-parent"),u=this._fieldToolbar.getItem("."+l);u&&u.removeClass(l),r?r.getData("field-instance").removeNestedField(this._fieldBeingMoved):(s=this.getFieldRow(this._fieldBeingMoved),this._fieldListBeingMoved.removeField(this._fieldBeingMoved)),this._enableAddFields(),o?this._addNestedField(o,this._fieldBeingMoved,t.getData("nested-field-index")):t.getData("col").get("value").addField(this._fieldBeingMoved,t.getData("field-list-index")),this._removeLayoutCutColButtons(),n.normalizeColsHeight(new e.NodeList(this.getFieldRow(this._fieldBeingMoved))),this._detachCancelMoveFieldEvents()},_clickRemoveRow:function(e){var t=e.get("cols"),n,r;for(r=0;r'+''+''+"",TPL_PAGES:'
'+'
'+'
'+''+"
",TPL_POPOVER_CONTENT:'
    '+'
  • {addPageLastPosition}
  • '+'
  • {deleteCurrentPage}
  • '+'
  • {switchMode}
  • '+"
",TPL_TABS:'
'+'
'+"
",initializer:function(){var t=this.get("paginationContainer"),n=this.get("tabviewContainer"),r=this.get("pageHeader");t.append(this.TPL_PAGES),n.append(this.TPL_TABS),r.append(e.Lang.sub(this.TPL_PAGE_HEADER,{aditionalInfo:this.get("strings").aditionalInfo})),this._renderTopPagination(),this._renderFooterPagination(),this._eventHandles=[r.one("."+d).on("valuechange",e.bind(this._onDescriptionInputValueChange,this)),r.one("."+m).on("valuechange",e.bind(this._onTitleInputValueChange,this))],this.after({activePageNumberChange:this._afterActivePageNumberChange,pagesQuantityChange:this._afterPagesQuantityChange,modeChange:this._afterModeChange}),this._uiSetActivePageNumber(this.get("activePageNumber")),this._uiSetMode(this.get("mode"))},destructor:function(){var t=this._pagination,n=this._popover,r=this._tabview;t&&t.destroy(),r&&r.destroy(),n&&n.destroy(),(new e.EventHandle(this._eventHandles)).detach()},disablePaginations:function(){this._disableTabView(),this._disablePaginationView()},enablePaginations:function(){this._enableTabView(),this._enablePaginationView()},_addPage:function(){var e=this.get("pagesQuantity");this.set("pagesQuantity",e+1),this.fire("add",{quantity:e}),this._pagination.set("page",this.get("pagesQuantity")),e===0&&this.fire("updatePageContent",{newVal:1})},_addTab:function(){var e=this.get("pagesQuantity"),t=this._getTabView(),n;n=this._createUntitledPageLabel(e,e),t.add({label:e+"."+n}),t.selectChild(e-1),this._updateTabViewContent()},_afterActivePageNumberChange:function(e){this._uiSetActivePageNumber(e.newVal)},_afterModeChange:function(){this._uiSetMode(this.get("mode"))},_afterPagesQuantityChange:function(){this._uiSetPagesQuantity(this.get("pagesQuantity")),this._syncPopoverContent()},_afterTabViewSelectionChange:function(){var e,t=this._getPagination(),n=this._getTabView();e=n.getTabs().indexOf(n.getActiveTab()),e>-1&&(t.set("page",e+1),this.set("activePageNumber",e+1))},_createPagination:function(){return new e.Pagination({boundingBox:"."+f,on:{pageChange:e.bind(this._onCurrentPageChange,this)},page:this.get("activePageNumber"),strings:{prev:"«",next:"»"},total:this.get("pagesQuantity")})},_createPopover:function(){var t,n=this.get("paginationContainer").one("."+l),r;return t=e.Lang.sub(this.TPL_POPOVER_CONTENT,{addPageLastPosition:this.get("strings").addPageLastPosition,addPageNextPosition:this.get("strings").addPageNextPosition,deleteCurrentPage:this._getDeleteButtonString(),switchMode:this.get("strings").switchMode}),r=(new e.Popover({align:{node:n},bodyContent:t,constrain:!0,cssClass:o,position:"top",visible:!1,zIndex:50})).render(),n.after("click",r.toggle,r),n.after("clickoutside",r.hide,r),r.get("boundingBox").one("."+i).on("click",e.bind(this._onAddLastPageClick,this)),r.get("boundingBox").one("."+s).on("click",e.bind(this._onRemovePageClick,this)),r.get("boundingBox").one("."+u).on("click",e.bind(this._onSwitchViewClick,this)),r},_createTabView:function(){var t;return t=new e.TabView({boundingBox:"."+h}),t.get("contentBox").toggleView(),t.after("selectionChange",e.bind(this._afterTabViewSelectionChange,this)),t},_createUntitledPageLabel:function(t,n){var r;return r=e.Lang.sub(this.get("strings").untitledPage,{activePageNumber:t,pagesQuantity:n}),r},_disablePaginationView:function(){this._getPagination().get("items").addClass("disabled")},_disableTabView:function(){var t=this._getTabView();e.each(this._getTabView().getTabs(),function(e,n){t.disableTab(n)})},_enablePaginationView:function(){this._getPagination().get("items").removeClass("disabled")},_enableTabView:function(){var t=this._getTabView();e.each(this._getTabView().getTabs(),function(e,n){t.enableTab(n)})},_getDeleteButtonString:function(){var e;return this.get("pagesQuantity")>1?e=this.get("strings").deleteCurrentPage:e=this.get("strings").resetPage,e},_getPagination:function(){return this._pagination||(this._pagination=this._createPagination()),this._popover||(this._popover=this._createPopover()),this._pagination},_getPopover:function(){return this._popover},_getTabView:function(){var e,t=this.get("pagesQuantity"),n,r=this.get("titles");if(!this._tabview){this._tabview=this._createTabView();for(e=0;e0&&t.selectChild(e-1),t.remove(e),this._updateTabViewContent()},_renderFooterPagination:function(){this._getPagination().render()},_renderTopPagination:function(){this._getTabView().render()},_syncPopoverContent:function(){var e=this._getPopover().get("boundingBox").one("."+s);e.text(this._getDeleteButtonString())},_uiSetActivePageNumber:function(e){var t=this.get("descriptions")[e-1],n=this.get("titles")[e-1],r=this.get("pageHeader"),i=r.one("."+d),s=this.get("pagesQuantity"),o=r.one("."+m),u;n||(u=this._createUntitledPageLabel(e,s),o.attr("placeholder",u)),o.set("value",n||""),i.set("value",t||"")},_uiSetMode:function(e){var t=this.get("activePageNumber"),n=this._getPagination(),r=this._getTabView();e==="tabs"?(n.get("contentBox").hide(),r.get("contentBox").show(),r.selectChild(t-1)):(n.get("contentBox").show(),r.get("contentBox").hide(),n.set("page",t))},_uiSetPagesQuantity:function(e){var t=this.get("activePageNumber"),n=this._getPagination();n.set("total",e),n.set("page",t),n.getItem(t).addClass("active"),this._uiSetActivePageNumber(t)},_updateTabViewContent:function(){var e,t=this.get("pagesQuantity"),n=this._getTabView().get("contentBox").all(".tab-content"),r,i=this.get("titles");for(e=0;e0&&t.selectChild(e-1),t.remove(e),this._updateTabViewContent()},_renderFooterPagination:function(){this._getPagination().render()},_renderTopPagination:function(){this._getTabView().render()},_syncPopoverContent:function(){var e=this._getPopover().get("boundingBox").one("."+s);e.text(this._getDeleteButtonString())},_uiSetActivePageNumber:function(e){var t=this.get("descriptions")[e-1],n=this.get("titles")[e-1],r=this.get("pageHeader"),i=r.one("."+d),s=this.get("pagesQuantity"),o=r.one("."+m),u;n||(u=this._createUntitledPageLabel(e,s),o.attr("placeholder",u)),o.set("value",n||""),i.set("value",t||"")},_uiSetMode:function(e){var t=this.get("activePageNumber"),n=this._getPagination(),r=this._getTabView();e==="tabs"?(n.get("contentBox").hide(),r.get("contentBox").show(),r.selectChild(t-1)):(n.get("contentBox").show(),r.get("contentBox").hide(),n.set("page",t))},_uiSetPagesQuantity:function(e){var t=this.get("activePageNumber"),n=this._getPagination();n.set("total",e),n.set("page",t),n.getItem(t).addClass("active"),this._uiSetActivePageNumber(t)},_updateTabViewContent:function(){var e,t=this.get("pagesQuantity"),n=this._getTabView().get("contentBox").all(".tab-content"),r,i=this.get("titles");for(e=0;e',destructor:function(){this._modal&&this._modal.destroy()},hide:function(){this._modal&&this._modal.hide(),this._eventToggleAdvancedContent&&this._eventToggleAdvancedContent.detach()},show:function(t,n){var r,i;this._modal||this._create(),r=this._modal.getStdModNode(e.WidgetStdMod.BODY),r.empty(),t.renderSettingsPanel(r),this._modal.get("boundingBox").one("."+o).set("text",n),this._modal.show(),this._modal.align(),i=r.one('input[type="text"]'),i&&i.focus(),this._eventToggleAdvancedContent=t.on("contentToggle",e.bind(this._updateModalOnContentToggle,this)),this._fieldBeingEdited=t},_afterModalVisibleChange:function(e){e.newVal||this.fire("hide")},_create:function(){this._modal=(new e.Modal({centered:!0,cssClass:r,draggable:!1,modal:!0,headerContent:this.TPL_FIELD_SETTINGS_HEAD_CONTENT,resizable:!1,zIndex:4})).render(),this._modal.addToolbar([{cssClass:[n,s].join(" "),label:"Save",on:{click:e.bind(this._save,this)},render:!0},{cssClass:i,label:"Cancel",on:{click:e.bind(this.hide,this)},render:!0}],e.WidgetStdMod.FOOTER),this._modal.after("visibleChange",e.bind(this._afterModalVisibleChange,this))},_save:function(){this._fieldBeingEdited.validateSettings()&&(this._fieldBeingEdited.saveSettings(),this.fire("save",{field:this._fieldBeingEdited}),this.hide())},_updateModalOnContentToggle:function(){this._modal.align()}})},"4.1.1",{requires:["aui-classnamemanager","aui-modal","base","node-base"],skinnable:!0}); +YUI.add("aui-form-builder-settings-modal",function(e,t){var n=e.getClassName("btn","primary"),r=e.getClassName("form","builder","field","settings"),i=e.getClassName("form","builder","field","settings","cancel"),s=e.getClassName("form","builder","field","settings","save"),o=e.getClassName("modal","title");e.FormBuilderSettingsModal=e.Base.create("form-builder-settings-modal",e.Base,[],{TPL_FIELD_SETTINGS_HEAD_CONTENT:'

',destructor:function(){this._modal&&this._modal.destroy()},hide:function(){this._modal&&this._modal.hide(),this._eventToggleAdvancedContent&&this._eventToggleAdvancedContent.detach()},show:function(t,n){var r,i;this._modal||this._create(),r=this._modal.getStdModNode(e.WidgetStdMod.BODY),r.empty(),t.renderSettingsPanel(r),this._modal.get("boundingBox").one("."+o).set("text",n),this._modal.show(),this._modal.align(),i=r.one('input[type="text"]'),i&&i.focus(),this._eventToggleAdvancedContent=t.on("contentToggle",e.bind(this._updateModalOnContentToggle,this)),this._fieldBeingEdited=t},_afterModalVisibleChange:function(e){e.newVal||this.fire("hide")},_create:function(){this._modal=(new e.Modal({centered:!0,cssClass:r,draggable:!1,modal:!0,headerContent:this.TPL_FIELD_SETTINGS_HEAD_CONTENT,resizable:!1,zIndex:4})).render(),this._modal.addToolbar([{cssClass:[n,s].join(" "),label:"Save",on:{click:e.bind(this._save,this)},render:!0},{cssClass:i,label:"Cancel",on:{click:e.bind(this.hide,this)},render:!0}],e.WidgetStdMod.FOOTER),this._modal.after("visibleChange",e.bind(this._afterModalVisibleChange,this))},_save:function(){this._fieldBeingEdited.validateSettings()&&(this._fieldBeingEdited.saveSettings(),this.fire("save",{field:this._fieldBeingEdited}),this.hide())},_updateModalOnContentToggle:function(){this._modal.align()}})},"4.2.0",{requires:["aui-classnamemanager","aui-modal","base","node-base"],skinnable:!0}); diff --git a/build/aui-form-builder/aui-form-builder-min.js b/build/aui-form-builder/aui-form-builder-min.js index 27fe242d052..8a046f002cc 100644 --- a/build/aui-form-builder/aui-form-builder-min.js +++ b/build/aui-form-builder/aui-form-builder-min.js @@ -1,2 +1,2 @@ YUI.add("aui-form-builder",function(e,t){var n=e.getClassName("form","builder","edit","layout","button"),r=e.getClassName("form","builder","field","list","add","button"),i=e.getClassName("form","builder","field"),s=e.getClassName("form","builder","header"),o=e.getClassName("form","builder","header","title"),u=e.getClassName("form","builder","layout"),a=e.getClassName("form","builder","pages","header"),f=e.getClassName("form","builder","pages"),l=e.getClassName("form","builder","tabs");e.FormBuilder=e.Base.create("form-builder",e.Widget,[e.FormBuilderFieldTypes,e.FormBuilderLayoutBuilder],{TPL_EDIT_LAYOUT_BUTTON:'",TPL_HEADER:'
'+'
{formTitle}
'+"
",TPL_LAYOUT:'
',TPL_PAGE_HEADER:'
',TPL_PAGES:'
',TPL_TABVIEW:'
',_fieldsChangeHandles:[],initializer:function(){this._fieldToolbar=new e.FormBuilderFieldToolbar(this.get("fieldToolbarConfig")),this._eventHandles=[this.after("layoutsChange",e.bind(this._afterLayoutsChange,this)),this.after("layout:valueChange",this._afterLayoutChange),this.after("layout:rowsChange",this._afterLayoutRowsChange),this.after("layout-row:colsChange",this._afterLayoutColsChange)],e.Array.invoke(this.get("layouts"),"addTarget",this),this._addFieldsChangeListener(this.get("layouts")),this._checkLayoutsLastRow()},renderUI:function(){this.getActiveLayout().addTarget(this),this._renderContentBox(),this._renderEmptyColumns()},bindUI:function(){var t=this.get("boundingBox"),n=this._fieldToolbar,i=this.get("pages");this._eventHandles.push(t.delegate("click",this._onClickAddField,"."+r,this),n.after("destroy",e.bind(this._afterDestroyFieldToolbar,this)),i.on("add",e.bind(this._addPage,this)),i.on("remove",e.bind(this._removeLayout,this)),i.after("activePageNumberChange",e.bind(this._afterActivePageNumberChange,this)),i.after("updatePageContent",e.bind(this._afterUpdatePageContentChange,this))),this._fieldToolbarHandles=[this.get("contentBox").on("focus",e.bind(this._onFocus,this))]},syncUI:function(){this._updateUniqueFieldType()},destructor:function(){this._fieldSettingsModal&&this._fieldSettingsModal.destroy(),this.get("pages")&&this.get("pages").destroy(),(new e.EventHandle(this._eventHandles)).detach()},addNestedField:function(e){this._newFieldContainer=e,this.showFieldsPanel()},editField:function(e){var t=this.findTypeOfField(e);this.showFieldSettingsPanel(e,t.get("label"))},getActiveLayout:function(){return this.get("layouts")[this._getActiveLayoutIndex()]},getFieldRow:function(e){return e.get("content").ancestor(".layout-row")},removeField:function(t){var n,r,i,s=t.get("content").ancestor(".form-builder-field-nested");this._handleRemoveEvent(t),s?(r=s.ancestor(".form-builder-field").getData("field-instance"),r.removeNestedField(t),this.getActiveLayout().normalizeColsHeight(new e.NodeList(this.getFieldRow(r)))):(n=t.get("content").ancestor(".col").getData("layout-col"),i=this.getFieldRow(t),n.get("value").removeField(t),this.getActiveLayout().normalizeColsHeight(new e.NodeList(i))),this._updateUniqueFieldType()},showFieldSettingsPanel:function(t,n){this._fieldSettingsModal||(this._fieldSettingsModal=new e.FormBuilderSettingsModal,this._fieldSettingsModal.after("hide",e.bind(this._afterFieldSettingsModalHide,this)),this._fieldSettingsModal.after("save",e.bind(this._afterFieldSettingsModalSave,this))),this._fieldSettingsModal.show(t,n)},_addFieldsChangeListener:function(t){var n;for(n=0;n',h='
'+'
',p='',d='',v={CHECKBOX:"checkbox",LIST:"list",RADIO:"radio"};e.FormFieldChoice=e.Base.create("form-field-choice",e.FormField,[e.FormFieldRequired],{TPL_FIELD_CONTENT:'
',initializer:function(){this._oldTypeValue=this.get("type"),this.after({optionsChange:this._afterOptionsChange,otherOptionChange:this._afterOtherOptionChange,typeChange:this._afterTypeChange})},renderUI:function(){var t=this.get("content");e.FormFieldChoice.superclass.renderUI.call(this),t.addClass(n),this._updateOptionsContainer(),this._uiSetOptions(this.get("options"))},_afterOptionsChange:function(){this._uiSetOptions(this.get("options"))},_afterOtherOptionChange:function(){this._uiSetOtherOption(this.get("otherOption"))},_afterTypeChange:function(){this._uiSetType(this.get("type"))},_cleanOptionsContainer:function(){this.get("content").one("."+a).empty()},_createOptionNode:function(t){var n=this.get("type");return n===v.LIST?e.Node.create(e.Lang.sub(d,{label:t})):e.Node.create(e.Lang.sub(h,{label:t,type:n}))},_getFormClass:function(e){switch(e){case v.CHECKBOX:return i;case v.RADIO:return l}},_setFormType:function(e){var t=this.get("content"),n=t.one("."+a),r=t.all("."+u);n.replaceClass(this._getFormClass(this._oldTypeValue),this._getFormClass(e)),r.each(function(t){t.set("type",e)})},_uiSetOptions:function(t){var n=this,r,i;this._cleanOptionsContainer(),r=this.get("content").one("."+a),e.Array.each(t,function(e){i=n._createOptionNode(e),r.append(i)}),this._uiSetOtherOption(this.get("otherOption"))},_uiSetOtherOption:function(e){var t=this.get("content").one("."+a),n=this.get("content").one("."+f),r;n&&n.remove(),e&&(r=this._createOptionNode("Other"),r.addClass(f),t.append(r))},_uiSetType:function(e){e===v.LIST||this._oldTypeValue===v.LIST?(this._updateOptionsContainer(),this._uiSetOptions(this.get("options")),this._uiSetOtherOption(this.get("otherOption"))):this._setFormType(this.get("type")),this._oldTypeValue=e},_updateOptionsContainer:function(){var t=this.get("content").one("."+r),n;t.empty(),this.get("type")===v.LIST?n=e.Node.create(p):(n=e.Node.create(c),n.addClass(this._getFormClass(this.get("type")))),t.append(n)}},{ATTRS:{name:{validator:e.Lang.isString,value:""},options:{validator:e.Lang.isArray,value:[]},otherOption:{validator:e.Lang.isBoolean,value:!1},type:{validator:e.Lang.isString,value:v.RADIO}},TYPES:v})},"4.1.1",{requires:["aui-form-field-required"],skinnable:!0}); +YUI.add("aui-form-field-choice",function(e,t){var n=e.getClassName("form","field","choice"),r=e.getClassName("form","field","choice","content"),i=e.getClassName("form","field","choice","checkbox"),s=e.getClassName("form","field","choice","form"),o=e.getClassName("form","field","choice","list"),u=e.getClassName("form","field","choice","option"),a=e.getClassName("form","field","choice","options","container"),f=e.getClassName("form","field","choice","option","other"),l=e.getClassName("form","field","choice","radio"),c='
',h='
'+'
',p='',d='',v={CHECKBOX:"checkbox",LIST:"list",RADIO:"radio"};e.FormFieldChoice=e.Base.create("form-field-choice",e.FormField,[e.FormFieldRequired],{TPL_FIELD_CONTENT:'
',initializer:function(){this._oldTypeValue=this.get("type"),this.after({optionsChange:this._afterOptionsChange,otherOptionChange:this._afterOtherOptionChange,typeChange:this._afterTypeChange})},renderUI:function(){var t=this.get("content");e.FormFieldChoice.superclass.renderUI.call(this),t.addClass(n),this._updateOptionsContainer(),this._uiSetOptions(this.get("options"))},_afterOptionsChange:function(){this._uiSetOptions(this.get("options"))},_afterOtherOptionChange:function(){this._uiSetOtherOption(this.get("otherOption"))},_afterTypeChange:function(){this._uiSetType(this.get("type"))},_cleanOptionsContainer:function(){this.get("content").one("."+a).empty()},_createOptionNode:function(t){var n=this.get("type");return n===v.LIST?e.Node.create(e.Lang.sub(d,{label:t})):e.Node.create(e.Lang.sub(h,{label:t,type:n}))},_getFormClass:function(e){switch(e){case v.CHECKBOX:return i;case v.RADIO:return l}},_setFormType:function(e){var t=this.get("content"),n=t.one("."+a),r=t.all("."+u);n.replaceClass(this._getFormClass(this._oldTypeValue),this._getFormClass(e)),r.each(function(t){t.set("type",e)})},_uiSetOptions:function(t){var n=this,r,i;this._cleanOptionsContainer(),r=this.get("content").one("."+a),e.Array.each(t,function(e){i=n._createOptionNode(e),r.append(i)}),this._uiSetOtherOption(this.get("otherOption"))},_uiSetOtherOption:function(e){var t=this.get("content").one("."+a),n=this.get("content").one("."+f),r;n&&n.remove(),e&&(r=this._createOptionNode("Other"),r.addClass(f),t.append(r))},_uiSetType:function(e){e===v.LIST||this._oldTypeValue===v.LIST?(this._updateOptionsContainer(),this._uiSetOptions(this.get("options")),this._uiSetOtherOption(this.get("otherOption"))):this._setFormType(this.get("type")),this._oldTypeValue=e},_updateOptionsContainer:function(){var t=this.get("content").one("."+r),n;t.empty(),this.get("type")===v.LIST?n=e.Node.create(p):(n=e.Node.create(c),n.addClass(this._getFormClass(this.get("type")))),t.append(n)}},{ATTRS:{name:{validator:e.Lang.isString,value:""},options:{validator:e.Lang.isArray,value:[]},otherOption:{validator:e.Lang.isBoolean,value:!1},type:{validator:e.Lang.isString,value:v.RADIO}},TYPES:v})},"4.2.0",{requires:["aui-form-field-required"],skinnable:!0}); diff --git a/build/aui-form-field-required/aui-form-field-required-min.js b/build/aui-form-field-required/aui-form-field-required-min.js index 5221519f8c0..bf0e6e3c172 100644 --- a/build/aui-form-field-required/aui-form-field-required-min.js +++ b/build/aui-form-field-required/aui-form-field-required-min.js @@ -1 +1 @@ -YUI.add("aui-form-field-required",function(e,t){var n=e.getClassName("form","field","required"),r=e.getClassName("form","field","title");e.FormFieldRequired=function(){},e.FormFieldRequired.prototype={TPL_REQUIRED:'*',initializer:function(){this._uiSetRequired(this.get("required")),this.after({requiredChange:this._afterRequiredChange})},_afterRequiredChange:function(){this._uiSetRequired(this.get("required"))},_uiSetRequired:function(e){var t=this.get("content").one("."+r);e?t.append(this.TPL_REQUIRED):t.one("."+n)&&t.one("."+n).remove(!0)}},e.FormFieldRequired.ATTRS={required:{validator:e.Lang.isBoolean,value:!1}}},"4.1.1",{requires:["aui-form-field"]}); +YUI.add("aui-form-field-required",function(e,t){var n=e.getClassName("form","field","required"),r=e.getClassName("form","field","title");e.FormFieldRequired=function(){},e.FormFieldRequired.prototype={TPL_REQUIRED:'*',initializer:function(){this._uiSetRequired(this.get("required")),this.after({requiredChange:this._afterRequiredChange})},_afterRequiredChange:function(){this._uiSetRequired(this.get("required"))},_uiSetRequired:function(e){var t=this.get("content").one("."+r);e?t.append(this.TPL_REQUIRED):t.one("."+n)&&t.one("."+n).remove(!0)}},e.FormFieldRequired.ATTRS={required:{validator:e.Lang.isBoolean,value:!1}}},"4.2.0",{requires:["aui-form-field"]}); diff --git a/build/aui-form-field-text/aui-form-field-text-min.js b/build/aui-form-field-text/aui-form-field-text-min.js index 3e0349046d3..0b4712f1920 100644 --- a/build/aui-form-field-text/aui-form-field-text-min.js +++ b/build/aui-form-field-text/aui-form-field-text-min.js @@ -1 +1 @@ -YUI.add("aui-form-field-text",function(e,t){var n=e.getClassName("form","builder","field","text"),r=e.getClassName("form","builder","field","text","content"),i=e.getClassName("form","builder","field","text","input"),s='