@wavemaker/app-runtime-wm-build 11.4.3-next.25778 → 11.4.3-next.25780

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/app-runtime-wm-build",
3
- "version": "11.4.3-next.25778",
3
+ "version": "11.4.3-next.25780",
4
4
  "description": "All modules required for a wavemaker application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -17083,7 +17083,9 @@
17083
17083
  };
17084
17084
  BaseFormCustomComponent.prototype.invokeOnChange = function(value, $event, valid) {
17085
17085
  this._onChange(value);
17086
- _super.prototype.invokeOnChange.call(this, value, $event);
17086
+ if (valid) {
17087
+ _super.prototype.invokeOnChange.call(this, value, $event);
17088
+ }
17087
17089
  };
17088
17090
  BaseFormCustomComponent.prototype.invokeOnTouched = function($event) {
17089
17091
  this._onTouched();
@@ -54,7 +54,7 @@
54
54
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
55
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
56
  PERFORMANCE OF THIS SOFTWARE.
57
- ***************************************************************************** */var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var u=function(){a.register("wm-button",new Map([["animation",a.PROP_STRING],["badgevalue",a.PROP_STRING],["caption",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["iconclass",a.PROP_STRING],["iconheight",a.PROP_STRING],["iconmargin",a.PROP_STRING],["iconposition",a.PROP_STRING],["iconurl",a.PROP_STRING],["iconwidth",a.PROP_STRING],["name",a.PROP_STRING],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",a.PROP_STRING]]))},h={widgetType:"wm-button",hostClass:"btn app-button",displayType:a.DISPLAY_TYPE.INLINE_BLOCK},m=function(e){function t(t){var n=e.call(this,t,h)||this;return a.styler(n.nativeElement,n),n}return c(t,e),t}(a.StylableComponent);m.initializeProps=u(),m.decorators=[{type:t.Component,args:[{selector:"button[wmButton]",template:'<img data-identifier="img" alt="button image" class="button-image-icon" [src]="iconurl | image" *ngIf="iconurl" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin}"/>\n<i class="app-icon {{iconclass}}" aria-hidden="true" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin, fontSize:iconwidth}" *ngIf="iconclass"></i>\n<span class="sr-only" *ngIf="iconclass">{{caption}} {{appLocale.LABEL_ICON}}</span>\n<span class="btn-caption" [innerHTML]="caption"></span>\n<ng-content select=".caret"></ng-content>\n<span *ngIf="badgevalue" class="badge pull-right" [textContent]="badgevalue"></span>\n',providers:[a.provideAsWidgetRef(m)],exportAs:"wmButton"}]}],m.ctorParameters=function(){return[{type:t.Injector}]},m.propDecorators={type:[{type:t.HostBinding,args:["type"]}],tabindex:[{type:t.HostBinding,args:["tabIndex"]}],disabled:[{type:t.HostBinding,args:["disabled"]}],shortcutkey:[{type:t.HostBinding,args:["attr.accesskey"]}],iconposition:[{type:t.HostBinding,args:["attr.icon-position"]}]};var f=function(){a.register("wm-buttongroup",new Map([["class",a.PROP_STRING],["name",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["vertical",a.PROP_BOOLEAN]]))},g={widgetType:"wm-buttongroup",hostClass:"btn-group app-button-group"},v=function(e){function t(t){var n=e.call(this,t,g)||this;return a.styler(n.nativeElement,n,a.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.handleClick=function(e){var t=$(e.target).closest(".app-button");this.$element.find(".app-button").removeClass("selected"),t.addClass("selected")},t}(a.StylableComponent);v.initializeProps=f(),v.decorators=[{type:t.Directive,args:[{selector:"[wmButtonGroup]",providers:[a.provideAsWidgetRef(v)]}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={vertical:[{type:t.HostBinding,args:["class.btn-group-vertical"]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var y=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.inj=t,o.binddatavalue=o.$element.attr("datavalue.bind"),o}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.dataval},set:function(e){this.dataval=e},enumerable:!1,configurable:!0}),t.prototype.updateBoundVariable=function(e){var t=this.binddatavalue;this.datavaluesource&&this.datavaluesource.execute(r.DataSource.Operation.IS_API_AWARE)||this.datavaluesource&&!this.datavaluesource.twoWayBinding||!t||t.startsWith("Widgets.")||t.startsWith("itemRef.currentItemWidgets")||(t=t.replace(/\[\$i\]/g,"[0]"),_.has(this.context,t.split(".")[0])?_.set(this.context,t,e):_.set(this.viewParent,t,e))},t.prototype.invokeOnChange=function(e,t){t&&this.datavalue!==this.prevDatavalue&&(this.updateBoundVariable(e),this.invokeEventCallback("change",{$event:t,newVal:e,oldVal:this.prevDatavalue})),this.prevDatavalue=e},t.prototype.updatePrevDatavalue=function(e){this.prevDatavalue=e},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),$(this.nativeElement).parents().closest("[wmList]").length&&this.$element.keydown((function(e){37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode||e.stopPropagation()}))},t}(a.StylableComponent);function b(e){return function(t){return e?function(e){switch(typeof e){case"object":return!(!e||!e.length&&!Object.keys(e).length);case"number":return!!e||0===e;default:return!(null==e||""===e)}}(t.value)?null:{required:!0}:null}}y.decorators=[{type:t.Injectable}],y.ctorParameters=function(){return[{type:t.Injector},{type:void 0},{type:Promise}]};var w=function(e){function t(){var t=e.apply(this,d([],p(arguments)))||this;return t._onChange=function(){},t._onTouched=function(){},t}return c(t,e),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this._formControl=this.inj.get(i.FormControlName,null)},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.writeValue=function(e){this.isDestroyed||(this._formControl&&(this.datavalue=e,this.onPropertyChange("datavalue",e),this.updatePrevDatavalue(e)),e!==this.datavalue&&this._onChange(this.datavalue))},t.prototype.invokeOnChange=function(t,n,i){this._onChange(t),e.prototype.invokeOnChange.call(this,t,n)},t.prototype.invokeOnTouched=function(e){this._onTouched(),e&&this.invokeEventCallback("blur",{$event:e})},t.prototype.invokeOnFocus=function(e){this.invokeEventCallback("focus",{$event:e})},t.prototype.validate=function(e){return this.show?b(this.required)(e):null},t}(y);w.decorators=[{type:t.Injectable}];var P=new Map([["caption",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["checkedvalue",Object.assign({value:!0},a.PROP_STRING)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["name",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["uncheckedvalue",Object.assign({value:!1},a.PROP_STRING)]]),O=function(){a.register("wm-checkbox",P),a.registerFormWidget(r.FormWidgetType.CHECKBOX,P),a.registerFormWidget(r.FormWidgetType.TOGGLE,P)},E={widgetType:"wm-checkbox",hostClass:"app-checkbox checkbox"},R=function(e,t){if(null===e)return t;if(!0===e||"true"===e)return!0;if(!1===e||"false"===e)return!1;var n=parseInt(e,10);return isNaN(n)?e:n},A=R,T=function(e){function t(t,n,i,o){var a=e.call(this,t,E)||this;return a.type=o,a._caption="&nbsp",a._checkedvalue=R(n,!0),a._uncheckedvalue=R(i,!1),r.toggleClass(a.nativeElement,"app-toggle","toggle"===o),a}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return r.isDefined(this.proxyModel)?this.proxyModel?this._checkedvalue:this._uncheckedvalue:void 0},set:function(e){this.proxyModel=r.isDefined(e)&&""!==e?e===this._checkedvalue:void 0,this.updatePrevDatavalue(this.datavalue)},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"caption"===t?r.isDefined(n)&&""!==n?this._caption=n:this._caption="&nbsp;":"checkedvalue"===t?this._checkedvalue=R(n,!0):"uncheckedvalue"===t?this._uncheckedvalue=R(n,!1):"datavalue"===t?(this.datavalue=R(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.handleEvent=function(t,n,i,o){if("change"!==n&&"blur"!==n){var a="tap"===n?this.nativeElement.querySelector("label"):this.checkboxEl.nativeElement;e.prototype.handleEvent.call(this,a,n,i,o)}},t.prototype.handleChange=function(e){this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.onKeyDown=function(e){e.preventDefault(),this.checkboxEl.nativeElement.click()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.styler(this.nativeElement.querySelector("label"),this)},t}(w);T.initializeProps=O(),T.decorators=[{type:t.Component,args:[{selector:"[wmCheckbox]",template:'<label [ngClass]="{\'unchecked\': !proxyModel, \'disabled\': (disabled || readonly), \'required\': (required && _caption)}">\n <input type="checkbox"\n role="checkbox"\n #checkbox\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-checked]="!!proxyModel"\n focus-target\n [(ngModel)]="proxyModel"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled || readonly"\n [attr.accesskey]="shortcutkey"\n [tabindex]="tabindex"\n (blur)="invokeOnTouched($event)"\n (ngModelChange)="handleChange($event)">\n <span class="caption" [innerHtml]="_caption"></span>\n <img alt="Checkbox Image" aria-hidden="true" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="switch"/>\n</label>\n<input type="hidden" class="ng-hide model-holder" aria-hidden="true" tabindex="-1" [disabled]="disabled" [value]="proxyModel">\n',providers:[a.provideAs(T,i.NG_VALUE_ACCESSOR,!0),a.provideAs(T,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(T)]}]}],T.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["checkedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["uncheckedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["type"]}]}]},T.propDecorators={ngModel:[{type:t.ViewChild,args:[i.NgModel]}],checkboxEl:[{type:t.ViewChild,args:["checkbox",{static:!0,read:t.ElementRef}]}],onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var S=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;return o.groupby=i,o.datasetItems=[],o.acceptsArray=!1,o.dataset$=new s.Subject,o.datavalue$=new s.Subject,o.allowempty=!0,o._debounceDatavalueUpdation=_.debounce((function(e){!r.isDefined(o._modelByKey)||_.isArray(o._modelByKey)&&!o._modelByKey.length?(o.toBeProcessedDatavalue=e,o._modelByValue=""):r.isDefined(o.toBeProcessedDatavalue)&&(r.isDefined(o._modelByValue)||(o._modelByValue=!o.multiple&&_.isArray(o.toBeProcessedDatavalue)?o.toBeProcessedDatavalue[0]:o.toBeProcessedDatavalue),o.toBeProcessedDatavalue=void 0),o.initDisplayValues()}),150),o.datePipe=o.inj.get(a.ToDatePipe),o.appDefaults=o.inj.get(r.AppDefaults),o.binddisplayexpression=o.nativeElement.getAttribute("displayexpression.bind"),o.binddisplayimagesrc=o.nativeElement.getAttribute("displayimagesrc.bind"),o.binddisplaylabel=o.nativeElement.getAttribute("displaylabel.bind"),o._debouncedInitDatasetItems=r.debounce((function(){o.initDatasetItems(),r.$appDigest()}),150),o.handleHeaderClick=r.noop,o.cancelLocaleChangeSubscription=o.getAppInstance().subscribe("locale-changed",(function(){o._debouncedInitDatasetItems()})),o}return c(t,e),Object.defineProperty(t.prototype,"modelByKey",{get:function(){return this._modelByKey},set:function(e){this.selectByKey(e),this.invokeOnChange(this._modelByValue)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this._modelByValue},set:function(e){this.multiple&&(e=a.extractDataAsArray(e)),this._modelByValue=e,this.selectByValue(e),this.datavalue$.next(e),this.invokeOnChange(e,void 0,!0)},enumerable:!1,configurable:!0}),t.prototype.selectByKey=function(e){var t=this;if(this.resetDatasetItems(),this.datasetItems.length){if(this.multiple&&!_.isArray(e)&&(e=[e]),this._modelByKey=e,this.multiple)this._modelByValue=[],e.forEach((function(e){var n=_.find(t.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,t._modelByValue=d(d([],p(t._modelByValue)),[n.value]))}));else{this._modelByValue="";var n=_.find(this.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,this._modelByValue=n.value)}this.initDisplayValues()}},t.prototype.selectByValue=function(e){var t=this;if(this.resetDatasetItems(),!(!r.isDefined(e)||""===e||_.isNull(e)||e instanceof Array&&!e.length)||(this._modelByKey=void 0,this.allowempty&&r.isDefined(e)))if(this.acceptsArray&&!_.isArray(e)&&(e=this.allowempty?[e]:a.extractDataAsArray(e)),this.datasetItems.length||!r.isDefined(e)){var n=this.datafield===a.ALLFIELDS?"dataObject":"key";if(_.isArray(e))this._modelByKey=[],e.forEach((function(e){var i=_.find(t.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?r.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,t._modelByKey.push(i.key))}));else{this._modelByKey=void 0;var i=_.find(this.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?r.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,this._modelByKey=i.key)}this._debounceDatavalueUpdation(e)}else this.toBeProcessedDatavalue=e},t.prototype.initDisplayValues=function(){var e=[];this.datasetItems.forEach((function(t){t.selected&&e.push(t.label)})),this.displayValue=this.multiple?e:e[0]||""},t.prototype.initDatasetItems=function(){if(!this.dataset||_.isEmpty(this.dataset))return this.datasetItems=[],void this.dataset$.next(this.datasetItems);var e=a.getOrderedDataset(a.convertDataToObject(this.dataset),this.orderby);if(this.usekeys)this.datasetItems=a.transformDataWithKeys(e);else{var t=a.transformFormData(this.viewParent,e,this.datafield,{displayField:this.displayfield||this.displaylabel,displayExpr:this.displayexpression,bindDisplayExpr:this.binddisplayexpression||this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc});this.datasetItems=d([],p(a.getUniqObjsByDataField(t,this.datafield,this.displayfield||this.displaylabel,r.toBoolean(this.allowempty))))}this.postDatasetItemsInit()},t.prototype.postDatasetItemsInit=function(){if(this.datasetItems.length&&!this._defaultQueryInvoked){var e=_.isEmpty(this.toBeProcessedDatavalue)?this.datavalue:this.toBeProcessedDatavalue;this.selectByValue(e)}this.dataset$.next(this.datasetItems)},t.prototype.resetDatasetItems=function(){this.datasetItems.forEach((function(e){return e.selected=!1}))},t.prototype.setTemplate=function(e){this.content=e,this.viewParent&&this.viewParent.prefabName&&(this.prefabName=this.viewParent.prefabName)},t.prototype.getGroupedData=function(){return this.datasetItems.length?a.groupData(this,a.convertDataToObject(this.datasetItems),this.groupby,this.match,this.orderby,this.dateformat,this.datePipe,"dataObject",this.appDefaults):[]},t.prototype.datasetSubscription=function(){var e=this,t=this.dataset$.subscribe((function(){e.groupedData=e.getGroupedData()}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.setGroupData=function(){this.datasetSubscription(),this.groupedData=this.getGroupedData()},t.prototype.onPropertyChange=function(t,n,i){switch(e.prototype.onPropertyChange.call(this,t,n,i),t){case"dataset":case"datafield":case"displayfield":case"displaylabel":case"displayexpression":case"orderby":case"usekeys":this._debouncedInitDatasetItems();break;case"required":case"datavalue":this._onChange(this.datavalue);break;case"groupby":case"match":"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData()}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.groupby&&"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData(),this.groupby&&this.collapsible&&(this.handleHeaderClick=a.handleHeaderClick,this.toggleAllHeaders=a.toggleAllHeaders.bind(void 0,this))},t.prototype.ngOnDestroy=function(){this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription()},t}(w);S.decorators=[{type:t.Injectable}],S.ctorParameters=function(){return[{type:t.Injector},null,{type:String,decorators:[{type:t.Attribute,args:["groupby"]}]}]};var C=new Map([["class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["itemclass",Object.assign({value:""},a.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},a.PROP_STRING)],["listclass",Object.assign({value:""},a.PROP_STRING)],["match",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},a.PROP_STRING)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),I=function(){a.register("wm-checkboxset",C),a.registerFormWidget(r.FormWidgetType.CHECKBOXSET,new Map(C))},D={widgetType:"wm-checkboxset",hostClass:"app-checkboxset list-group inline"},x=function(e){function t(t){var n=e.call(this,t,D)||this;return n.layout="",a.styler(n.nativeElement,n),n.multiple=!0,n}return c(t,e),t.prototype.onCheckboxLabelClick=function(e,t){if($(e.target).is("input")){var n=this.nativeElement.querySelectorAll("input:checked"),i=[];_.forEach(n,(function(e){i.push(e.value)})),this.modelByKey=i,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)}},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onKeyDown=function(e){e.preventDefault(),e.target.click()},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"itemsperrow"===t?r.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t}(S);x.initializeProps=I(),x.decorators=[{type:t.Component,args:[{selector:"[wmCheckboxset]",exportAs:"wmCheckboxset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'checkbox\', \'app-checkbox\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems; let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group" role="presentation">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'checkbox\', \'app-checkbox\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[a.provideAs(x,i.NG_VALUE_ACCESSOR,!0),a.provideAs(x,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector}]},x.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var N=function(){a.register("wm-form-group",new Map([["captionposition",a.PROP_STRING],["name",a.PROP_STRING],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)]]))},k={widgetType:"wm-form-group",hostClass:"form-group app-composite-widget clearfix"},M={left:"caption-left",right:"caption-right",top:"caption-top",floating:"caption-floating"},L=function(e){function t(t){var n=e.call(this,t,k)||this;return a.styler(n.nativeElement,n,a.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"captionposition"===t?r.switchClass(this.nativeElement,M[n],M[i]):"required"===t?(this.required=n,this.assignRequiredToSubComponents()):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.assignRequiredToSubComponents=function(){var e=this;this.required&&this.componentRefs&&setTimeout((function(){e.componentRefs.forEach((function(e){return e.widget.required=!0}))}),50)},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.addForIdAttributes(this.nativeElement),this.assignRequiredToSubComponents()},t}(a.StylableComponent);L.initializeProps=N(),L.decorators=[{type:t.Directive,args:[{selector:"div[wmComposite]",providers:[a.provideAsWidgetRef(L)]}]}],L.ctorParameters=function(){return[{type:t.Injector}]},L.propDecorators={componentRefs:[{type:t.ContentChildren,args:[a.WidgetRef,{descendants:!0}]}]};var F=new Map([["autofocus",a.PROP_BOOLEAN],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["localefilter",a.PROP_STRING],["minvalue",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["numberfilter",a.PROP_STRING],["placeholder",Object.assign({value:"Enter number"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",Object.assign({value:1},a.PROP_NUMBER)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["trailingzero",Object.assign({value:!1},a.PROP_BOOLEAN)],["updateon",a.PROP_STRING],["inputmode",Object.assign({value:"natural"},a.PROP_STRING)]]),j=function(){a.register("wm-number",F),a.registerFormWidget(r.FormWidgetType.NUMBER,new Map(F))},B=function(e){function t(t,n){var i=e.call(this,t,n)||this;i.ngModelOptions={updateOn:""};var o=i.nativeElement.getAttribute("updateon")||"blur";return o="default"===o?"change":o,i.ngModelOptions.updateOn=o,i}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"===t&&this._onChange(this.datavalue),"class"===t?this.inputEl.nativeElement&&r.switchClass(this.inputEl.nativeElement,n,i):"datavalue"===t?(this.updatePrevDatavalue(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.handleChange=function(e){this.autotrim&&this.datavalue&&_.isString(this.datavalue)&&(this.datavalue=this.datavalue.trim()),this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.handleEvent=function(t,n,i,o){"change"!==n&&"blur"!==n&&e.prototype.handleEvent.call(this,this.inputEl.nativeElement,n,i,o)},t.prototype.handleBlur=function(e){this.invokeOnTouched(e)},t.prototype.flushViewChanges=function(e){var t=_.get(this.imask,"maskRef.unmaskedValue");e=t||e,this.ngModel.update.next(e),r.$appDigest()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.class&&r.addClass(this.inputEl.nativeElement,this.class),a.styler(this.inputEl.nativeElement,this)},t}(w);B.decorators=[{type:t.Injectable}],B.ctorParameters=function(){return[{type:t.Injector},{type:void 0}]};var G=function(e){function t(t,i,o,a){var r=e.call(this,t,i)||this;return r.i18nService=o,r.trailingZeroDecimalPipe=a,r.isDefaultQuery=!0,r.decimalValue="",r.selectedLocale=o.getSelectedLocale(),r.DECIMAL=n.getLocaleNumberSymbol(r.localefilter||r.selectedLocale,n.NumberSymbol.Decimal),r.GROUP=n.getLocaleNumberSymbol(r.localefilter||r.selectedLocale,n.NumberSymbol.Group),r.numberfilter="1.0-16",r.resetValidations(),r}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.proxyModel},set:function(e){if(this.lastValIsDecimal=!1,_.includes([null,void 0,""],e)){var t=this.inputEl.nativeElement,n=this.prevDatavalue;return this.displayValue=t.value=this.proxyModel=null,this.resetValidations(),void(n&&!this.isDefaultQuery&&(this.handleChange(e),this._onChange()))}if(this.isDefaultQuery){var i=_.isString(e)&&_.includes(e,this.DECIMAL),o=i?e.split(this.DECIMAL):_.isString(e)&&e.split(".");this.decimalValue=o[1]||"",e=i?e:this.transformNumber(e)}var a,r=e.toString();a=/\d/.test(r)?this.parseNumber(r):NaN,_.isNaN(a)&&r[r.length-1]===this.DECIMAL&&"change"===this.ngModelOptions.updateOn&&this.$element.find("input:focus").length&&(this.lastValIsDecimal=!0),!this.lastValIsDecimal&&this.isValid(a)?(this.proxyModel=a,this.updateDisplayText(),this.isDefaultQuery||this.handleChange(a)):(this.displayValue=e.toString(),this.proxyModel=null,this.handleChange(null))},enumerable:!1,configurable:!0}),t.prototype.resetValidations=function(){this.isInvalidNumber=!1,this.numberNotInRange=!1},t.prototype.isValid=function(e){return _.isNaN(e)||!_.isFinite(e)||!Number.isInteger(this.step)&&this.countDecimals(e)>this.countDecimals(this.step)?(this.isInvalidNumber=!0,!1):e!==this.getValueInRange(e)?(this.numberNotInRange=!0,!0):(this.resetValidations(),!0)},t.prototype.getValueInRange=function(e){return!_.isNaN(this.minvalue)&&e<this.minvalue?(this.validateType="minvalue",this.minvalue):!_.isNaN(this.maxvalue)&&e>this.maxvalue?(this.validateType="maxvalue",this.maxvalue):e},t.prototype.transformNumber=function(e,t){var n,i=t||this.numberfilter;return this.trailingZeroDecimalPipe.transform(e,this.selectedLocale,i,this.localefilter,this.trailingzero,this.decimalValue,!!t,null===(n=this.i18nService)||void 0===n?void 0:n.getwidgetLocale())},t.prototype.resetCursorPosition=function(e){var t=this.inputEl.nativeElement,n=t.value.length-e;n=n<0?0:n,t.setSelectionRange(n,n)},t.prototype.parseNumber=function(e){var t=e.split(this.inputmode===a.INPUTMODE.FINANCIAL?e.indexOf(this.DECIMAL)>-1?this.DECIMAL:".":this.DECIMAL);if(!t.length)return null;if(t.length>2)return NaN;if(""===t[1])return NaN;var n=Number(t[0].split(this.GROUP).join("")),i=Number("0."+(t[1]||0));if(Number.isNaN(n)||Number.isNaN(i))return NaN;var o=t.length>1?parseFloat((n+i).toFixed(t[1].length)):n+i;return 0===n?Object.is(0,n)?o:n-i:n>0?o:n-i},t.prototype.updateDisplayText=function(){var e=this.inputEl.nativeElement,t=e.selectionStart,n=e.value;if(!this.isDefaultQuery){var i=n.split(this.DECIMAL);this.decimalValue=i[1]||""}var o=this.stepLength();this.inputmode===a.INPUTMODE.FINANCIAL&&o?(this.displayValue=e.value=this.transformNumber(this.proxyModel,"1."+o+"-"+o),this.decimalValue=this.decimalValue.replace(/\D/g,"")):this.displayValue=e.value=this.transformNumber(this.proxyModel),"default"!==this.updateon||this.isDefaultQuery||this.resetCursorPosition(n.length-t)},t.prototype.stepLength=function(){var e=this.step.toString().split(".");return 1===e.length?void 0:e[1].length},t.prototype.isNaturalCurrency=function(){return this.inputmode===a.INPUTMODE.NATURAL&&"wm-currency"===this.widgetType&&!!this.trailingzero},t.prototype.onInputChange=function(e){var t=this.stepLength();if(r.isDefined(e)&&(""!==e||this.datavalue)&&(this.handleChange(e),t&&this.inputmode===a.INPUTMODE.FINANCIAL)){var n;if(this.isDefaultQuery)n=parseFloat(e);else n=parseInt(e.toString().replace(/\D/g,""))*this.step;_.isNaN(n)?"blur"!==this.ngModelOptions.updateOn&&(this.datavalue=void 0,this.handleChange(null)):"change"===this.ngModelOptions.updateOn?(this.datavalue=parseFloat(n.toFixed(t)),this.handleChange(this.datavalue)):this.displayValue=n.toFixed(t)}},t.prototype.checkForTrailingZeros=function(e){var t=this.stepLength(),n=!this.trailingzero&&this.inputmode===a.INPUTMODE.FINANCIAL;if(this.lastValIsDecimal&&this.onModelChange(this.displayValue),(n||this.isNaturalCurrency())&&t&&this.datavalue){var i=void 0;(n&&"focus"===e.type||this.isNaturalCurrency()&&"blur"===e.type)&&(i="1."+t+"-"+t),this.displayValue=this.transformNumber(this.datavalue,i)}},t.prototype.countDecimals=function(e){if(e%1!=0){var t=e.toString().split(".")[1];return t&&t.length}return 0},t.prototype.onArrowPress=function(e,t){if(e.preventDefault(),!this.readonly&&0!==this.step){var n,i,o=e.target.value.replace(/,/g,"");if(n=o&&!_.isNaN(parseFloat(o))?parseFloat(o):this.proxyModel,this.numberNotInRange){var a=this.parseNumber(this.inputEl.nativeElement.value);_.isNaN(a)||(i=this.getValueInRange(a),n=a,this.resetValidations())}else _.isUndefined(n)||_.isNull(n)?(n=i=this.getValueInRange(this.minvalue||0),this.resetValidations()):i=this.getValueInRange(n+("UP"===t?this.step:-this.step));if("UP"===t&&n<=i||"DOWN"===t&&n>=i){var r=Math.max(this.countDecimals(n),this.countDecimals(this.step));this.proxyModel=_.round(i,r),this.updateDisplayText(),this.handleChange(this.proxyModel)}}},t.prototype.validate=function(e){return this.isInvalidNumber?(this.validateType="",{invalidNumber:{valid:!1}}):this.numberNotInRange?{numberNotInRange:{valid:!1}}:(this.validateType="",this.show&&this.required?e.value||0===e.value?null:{required:!0}:null)},t.prototype.validateInputEntry=function(e){if(this.isDefaultQuery=!1,!e.ctrlKey&&!_.includes(["Backspace","ArrowRight","ArrowLeft","Tab","Enter","Delete"],e.key)){var t=new RegExp("^[\\d\\s-,.e+"+this.GROUP+this.DECIMAL+"]$","i"),n=e.target.value,i=this.inputmode===a.INPUTMODE.FINANCIAL;if(n)if(parseInt(n.toString().replace(/\D/g,"")).toString().length>15){var o=window.getSelection();return!(!o||!o.toString()||o.focusNode!==this.nativeElement)}return!(!i&&n&&this.countDecimals(this.step)&&this.countDecimals(n)>=this.countDecimals(this.step)&&e.target.selectionStart>=n.length-1)&&(!!t.test(e.key)&&((!_.includes(n,",")||","!==n[n.length-1]||","!==e.key)&&((!_.includes(n,this.DECIMAL)||e.key!==this.DECIMAL)&&((!_.intersection(_.toArray(n),["e","E"]).length||!_.includes("eE",e.key))&&((!_.includes(n,"+")&&!_.includes(n,"-")||"+"!==e.key&&"-"!==e.key)&&(!(!n&&"Space"===e.code)&&void 0))))))}},t.prototype.onBackspace=function(e){this.isDefaultQuery=!1},t.prototype.onEnter=function(e){this.datavalue=e.target.value},t.prototype.onModelChange=function(e){(this.inputmode===a.INPUTMODE.NATURAL||this.inputmode===a.INPUTMODE.FINANCIAL&&"blur"===this.ngModelOptions.updateOn)&&(this.datavalue=e)},t.prototype.onPropertyChange=function(t,n,i){"minvalue"===t||"maxvalue"===t?this.isValid(n):"datavalue"!==t||i?e.prototype.onPropertyChange.call(this,t,n,i):this.isNaturalCurrency()?this.checkForTrailingZeros({type:"blur"}):this.onInputChange(n)},t}(B),V={widgetType:"wm-number",hostClass:"app-input-wrapper"},W=function(e){function t(t,n,i){return e.call(this,t,V,n,i)||this}return c(t,e),t}(G);W.initializeProps=j(),W.decorators=[{type:t.Component,args:[{selector:"[wmNumber]",template:'<input class="form-control app-textbox app-number-input"\n inputmode="decimal"\n focus-target\n [attr.name]="name"\n role="textbox"\n type="text"\n [ngModel]="displayValue"\n [readonly]="readonly"\n [disabled]="disabled"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (ngModelChange)="onModelChange($event)"\n (blur)="handleBlur($event); checkForTrailingZeros($event);"\n (focus)="checkForTrailingZeros($event)"\n (input)="onInputChange($event.target.value)"\n [ngModelOptions]="ngModelOptions"\n [required]="required"\n (keypress)="validateInputEntry($event)"\n (keydown.backspace)="onBackspace($event)"\n (keydown.enter)="onEnter($event)"\n (keydown.ArrowUp)="onArrowPress($event, \'UP\')"\n (keydown.ArrowDown)="onArrowPress($event, \'DOWN\')"\n #input>\n',providers:[a.provideAs(W,i.NG_VALUE_ACCESSOR,!0),a.provideAs(W,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(W)]}]}],W.ctorParameters=function(){return[{type:t.Injector},{type:r.AbstractI18nService},{type:a.TrailingZeroDecimalPipe}]},W.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel,{static:!0}]}]};var U=new Map([["class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_ANY],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["itemclass",Object.assign({value:""},a.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},a.PROP_STRING)],["listclass",Object.assign({value:""},a.PROP_STRING)],["match",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},a.PROP_STRING)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),q=function(){a.register("wm-radioset",U),a.registerFormWidget(r.FormWidgetType.RADIOSET,new Map(U))},z={widgetType:"wm-radioset",hostClass:"app-radioset list-group inline"},H=function(e){function t(t){var n=e.call(this,t,z)||this;return n.layout="",a.styler(n.nativeElement,n),n.multiple=!1,n}return c(t,e),t.prototype.onRadioLabelClick=function(e,t){$(e.target).is("input")&&(this.modelByKey=t,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0))},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("itemsperrow"===t?r.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i))},t}(S);H.initializeProps=q(),H.decorators=[{type:t.Component,args:[{selector:"[wmRadioset]",exportAs:"wmRadioset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'radio\', \'app-radio\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems;let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" aria-readonly="true" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'radio\', \'app-radio\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[a.provideAs(H,i.NG_VALUE_ACCESSOR,!0),a.provideAs(H,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(H)]}]}],H.ctorParameters=function(){return[{type:t.Injector}]};var Y=new Map([["autofocus",a.PROP_BOOLEAN],["class",Object.assign({value:""},a.PROP_STRING)],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",a.PROP_ANY],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["hint",a.PROP_STRING],["match",a.PROP_STRING],["multiple",Object.assign({value:!1},a.PROP_BOOLEAN)],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["placeholder",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),K=function(){a.register("wm-select",Y),a.registerFormWidget(r.FormWidgetType.SELECT,new Map(Y)),a.registerFormWidget(r.FormWidgetType.TYPEAHEAD,new Map(Y))},Q={widgetType:"wm-select",hostClass:"app-select-wrapper"},Z=function(e){function t(t){var n=e.call(this,t,Q)||this;return n.acceptsArray=!0,n}return c(t,e),Object.defineProperty(t.prototype,"datasource",{set:function(e){e&&e.execute&&e.execute(r.DataSource.Operation.IS_BOUND_TO_LOCALE)&&(this.datavalue=e.execute(r.DataSource.Operation.GET_DEFAULT_LOCALE))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.styler(this.selectEl.nativeElement,this)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","change"],n)||e.prototype.handleEvent.call(this,this.selectEl.nativeElement,n,i,o)},t.prototype.onSelectValueChange=function(e){if(this.readonly)return this.placeholder?this.selectEl.nativeElement.value=this.placeholder:this.selectEl.nativeElement.value="",void(this.datavalue=this.prevDatavalue);this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)},t.prototype.onPropertyChange=function(t,n,i){"required"!==t?"class"!==t&&"tabindex"!==t&&("readonly"===t&&(!0===n?r.setAttr(this.selectEl.nativeElement,"readonly","readonly"):r.removeAttr(this.selectEl.nativeElement,"readonly")),e.prototype.onPropertyChange.call(this,t,n,i)):this._onChange(this.datavalue)},t.prototype.checkForFloatingLabel=function(e){var t=$(this.selectEl.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&("focus"===e.type&&(!this.datavalue||this.datavalue&&""===$(this.selectEl).find("select option:selected").text()&&this.placeholder)?$(this.selectEl.nativeElement).find("option:first").text(this.placeholder):this.datavalue||($(this.selectEl.nativeElement).find("option:selected").text(""),t.removeClass("float-active")))},t}(S);Z.initializeProps=K(),Z.decorators=[{type:t.Component,args:[{selector:"wm-select",template:'<select role="listbox" aria-haspopup="true" aria-expanded="false" #select\n focus-target\n [ngClass]="[\'app-select form-control\', class]"\n [disabled]="disabled"\n [required]="required"\n [tabindex]="tabindex"\n [(ngModel)]="modelByKey"\n [multiple]="multiple"\n (change)="onSelectValueChange($event)"\n (focus)="checkForFloatingLabel($event)"\n (blur)="invokeOnTouched($event); checkForFloatingLabel($event)"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-multiselectable]="multiple"\n [autofocus]="autofocus"\n>\n <option selected\n value="undefined"\n [textContent]="placeholder"\n [hidden]="!placeholder"></option>\n\n <ng-container *ngIf="groupby">\n <optgroup *ngFor="let groupObj of groupedData"\n [label]="groupObj.key">\n <option *ngFor="let item of groupObj.data;"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </optgroup>\n </ng-container>\n\n <ng-container *ngIf="!groupby">\n <option *ngFor="let item of datasetItems"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </ng-container>\n</select>\n',providers:[a.provideAs(Z,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Z,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Z)]}]}],Z.ctorParameters=function(){return[{type:t.Injector}]},Z.propDecorators={selectEl:[{type:t.ViewChild,args:["select",{static:!0,read:t.ElementRef}]}]};var J=new Map([["class",a.PROP_STRING],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"yes, no, maybe"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["hint",a.PROP_STRING],["iconclass",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)]]),X=function(){a.register("wm-switch",J),a.registerFormWidget(r.FormWidgetType.SWITCH,new Map(J)),a.registerFormWidget(r.FormWidgetType.TOGGLE,new Map(J))},ee={widgetType:"wm-switch",hostClass:"app-switch"},te=function(e){function t(t){var n=e.call(this,t,ee)||this;n.options=[],n._debounceSetSelectedValue=r.debounce((function(e){n.setSelectedValue(),n.updateHighlighter(e),e&&r.$appDigest()}),200);var i=n.dataset$.subscribe((function(){return n.updateSwitchOptions()}));n.registerDestroyListener((function(){return i.unsubscribe()}));var o=n.datavalue$.subscribe((function(){n._debounceSetSelectedValue(!0)}));return n.registerDestroyListener((function(){return o.unsubscribe()})),n}return c(t,e),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.styler(this.nativeElement,this)},t.prototype.onStyleChange=function(t,n,i){"height"===t?r.setCSS(this.nativeElement,"overflow",n?"auto":""):e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.setSelectedValue=function(){r.isDefined(this.datavalue)||r.isDefined(this.toBeProcessedDatavalue)?this.selectedItem=_.find(this.datasetItems,{selected:!0}):this.selectOptAtIndex(0)},t.prototype.updateSwitchOptions=function(){this.datasetItems.length&&(this.btnwidth=100/this.datasetItems.length,r.setCSS(this.nativeElement.querySelector(".app-switch-overlay"),"width",this.btnwidth+"%")),this._debounceSetSelectedValue(!0)},t.prototype.updateHighlighter=function(e){var t=$(this.nativeElement).find("span.app-switch-overlay");this.setSelectedValue();var n,i=this.selectedItem?_.findIndex(this.datasetItems,{key:this.selectedItem.key}):-1;null==i&&(i=-1),n=i*this.btnwidth,e?t.css("left",n+"%"):t.animate({left:n+"%"},300)},t.prototype.selectOptAtIndex=function(e){if(this.datasetItems.length){var t=this.datasetItems[e];this._modelByValue=t.value}},t.prototype.selectOpt=function(e,t,n){if(e.preventDefault(),!this.disabled){if(this.modelByKey=n.key,this.invokeOnTouched(),this.selectedItem&&t===_.findIndex(this.datasetItems,{key:this.selectedItem.key})){if(2!==this.datasetItems.length)return;t=1===t?0:1}this.selectedItem=this.datasetItems[t],this.updateHighlighter(),this.invokeOnChange(this.datavalue,e||{},!0),r.$appDigest()}},t.prototype.onPropertyChange=function(t,n,i){"disabled"!==t||r.toBoolean(n)?e.prototype.onPropertyChange.call(this,t,n,i):this.nativeElement.removeAttribute(t)},t}(S);te.initializeProps=X(),te.decorators=[{type:t.Component,args:[{selector:"[wmSwitch]",template:'<div role="group" class="btn-group btn-group-justified">\n <a *ngFor="let opt of datasetItems; let $index = index;"\n focus-target\n href="javascript:void(0);"\n class="btn btn-default"\n [name]="\'wm-switch-\' + opt.key"\n [ngClass]="{\'selected\': opt.selected, \'disabled\': disabled}"\n (click)="selectOpt($event, $index, opt)"\n >\n <i *ngIf="opt.dataObject && opt.dataObject[iconclass]" aria-hidden="true" [ngClass]="[\'app-icon\', opt.dataObject[iconclass] || opt[\'icon\']]"></i>\n <span class="caption" [textContent]="opt[displayfield] || opt.label"></span>\n </a>\n</div>\n<span [title]="selectedItem ? selectedItem.label : modelByKey"\n class="btn btn-primary app-switch-overlay switch-handle">\n <i *ngIf="iconclass"\n class="app-icon {{(selectedItem && selectedItem.dataObject) && selectedItem.dataObject[iconclass]}}"></i>\n {{selectedItem ? selectedItem.label : modelByKey}}\n</span>\n<input [name]="name" class="model-holder ng-hide" [disabled]="disabled" [value]="modelByKey" [required]="required" aria-hidden="true">\n',providers:[a.provideAs(te,i.NG_VALUE_ACCESSOR,!0),a.provideAsWidgetRef(te)],exportAs:"wmSwitch"}]}],te.ctorParameters=function(){return[{type:t.Injector}]};var ne=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["class",a.PROP_STRING],["datasource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxvalue",a.PROP_NUMBER],["minvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",a.PROP_NUMBER],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",a.PROP_STRING],["updateon",a.PROP_STRING]]),ie=function(){a.register("wm-input-calendar",ne)},oe={widgetType:"wm-input-calendar",hostClass:"app-input-wrapper"},ae=function(e){function t(t){return e.call(this,t,oe)||this}return c(t,e),t}(B);ae.initializeProps=ie(),ae.decorators=[{type:t.Component,args:[{selector:'wm-input[type="date"], wm-input[type="datetime-local"], wm-input[type="month"], wm-input[type="time"], wm-input[type="week"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint || type + \' field\'"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n #input>\n',providers:[a.provideAs(ae,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ae,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(ae)]}]}],ae.ctorParameters=function(){return[{type:t.Injector}]},ae.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var re=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"color"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),se=function(){a.register("wm-input-color",re)},le={widgetType:"wm-input-color",hostClass:"app-input-wrapper"},ce=function(e){function t(t){return e.call(this,t,le)||this}return c(t,e),t}(B);ce.initializeProps=se(),ce.decorators=[{type:t.Component,args:[{selector:'wm-input[type="color"]',template:'<input class="form-control app-textbox"\n focus-target\n [type]="type"\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n #input>\n',providers:[a.provideAs(ce,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ce,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(ce)]}]}],ce.ctorParameters=function(){return[{type:t.Injector}]},ce.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var pe=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"email"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),de=function(){a.register("wm-input-email",pe)},ue={widgetType:"wm-input-email",hostClass:"app-input-wrapper"},he=function(e){function t(t){return e.call(this,t,ue)||this}return c(t,e),t}(B);he.initializeProps=de(),he.decorators=[{type:t.Component,args:[{selector:'wm-input[type="email"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n email\n #input>\n',providers:[a.provideAs(he,i.NG_VALUE_ACCESSOR,!0),a.provideAs(he,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(he)]}]}],he.ctorParameters=function(){return[{type:t.Injector}]},he.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var me=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["minvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",a.PROP_NUMBER],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"number"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),fe=function(){a.register("wm-input-number",me)},ge={widgetType:"wm-input-number",hostClass:"app-input-wrapper"},ve=function(e){function t(t){return e.call(this,t,ge)||this}return c(t,e),t.prototype.onArrowPress=function(e){0===this.step&&e.preventDefault()},t.prototype.validateInputEntry=function(e){if("e"===e.key&&-1!==e.target.value.indexOf(e.key))return!1},t}(B);ve.initializeProps=fe(),ve.decorators=[{type:t.Component,args:[{selector:'wm-input[type="number"]',template:'<input class="form-control app-textbox"\n [ngClass]="{\'step-hidden\': step === 0}"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n (keydown.ArrowUp)="onArrowPress($event)"\n (keydown.ArrowDown)="onArrowPress($event)"\n (keypress)="validateInputEntry($event)"\n #input>\n',providers:[a.provideAs(ve,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ve,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(ve)]}]}],ve.ctorParameters=function(){return[{type:t.Injector}]},ve.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ye=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayformat",a.PROP_STRING],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showdisplayformaton",Object.assign({value:"always"},a.PROP_ANY)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"text"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),be=function(){a.register("wm-input-text",ye),a.registerFormWidget(r.FormWidgetType.PASSWORD,new Map(ye));var e=new Map(ye),t=function(t){t.forEach((function(t,n){return e.set(n,t)}))};t(ne),t(re),t(pe),t(me),a.registerFormWidget(r.FormWidgetType.TEXT,new Map(e))},we={widgetType:"wm-input-text",hostClass:"app-input-wrapper"},Pe=function(e){function t(t){var n=e.call(this,t,we)||this;return n.lazy=!1,n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"displayformat":this.maskVal=this.displayformat,this.checkForDisplayFormat();break;case"showdisplayformaton":this.lazy="keypress"===n;break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},Object.defineProperty(t.prototype,"mask",{get:function(){return!(!this.displayformat||!(!this.placeholder||this.placeholder&&this.isFocused))&&{mask:this.maskVal,lazy:this.lazy,definitions:{9:/\d/,A:/[a-zA-Z]/,a:/[a-z]/,"*":/\w/}}},enumerable:!1,configurable:!0}),t.prototype.checkForDisplayFormat=function(e){var t=this;this.displayformat?(this.isFocused=!!(e&&"focus"===e.type||this.datavalue),!this.isFocused&&this.imask&&this.imask.maskRef?(this.imask.maskRef.updateOptions({lazy:!0}),!this.datavalue&&this.imask.maskRef.value&&(this.imask.maskRef.value=this.datavalue)):setTimeout((function(){if(t.imask&&t.imask.maskRef&&t.imask.maskRef.value){var e=t.imask.maskRef.value.indexOf("_"),n=e>=0?t.imask.maskRef.value.slice(0,e).length:t.imask.maskRef.value.length;n!==t.imask.maskRef.cursorPos&&t.imask.maskRef.updateCursor(n)}}),50)):this.imask&&this.imask.maskRef&&(this.imask.maskRef.updateOptions({lazy:!0}),this.inputEl.nativeElement.value=this.datavalue)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.isFocused=!!this.datavalue},t}(B);Pe.initializeProps=be(),Pe.decorators=[{type:t.Component,args:[{selector:'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [(ngModel)]="datavalue"\n [imask]="mask"\n [unmask]="true"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [autofocus]="autofocus"\n (ngModelChange)="handleChange($event)"\n (blur)="handleBlur($event); checkForDisplayFormat($event)"\n (focus)="checkForDisplayFormat($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n #input>\n',providers:[a.provideAs(Pe,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Pe,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Pe)]}]}],Pe.ctorParameters=function(){return[{type:t.Injector}]},Pe.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}],imask:[{type:t.ViewChild,args:["input",{read:o.IMaskDirective}]}]};var _e=new Map([["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Place your text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["updateon",a.PROP_STRING],["limitdisplaytext",a.PROP_STRING],["charlength",a.PROP_NUMBER]]),Oe=function(){a.register("wm-textarea",_e),a.registerFormWidget(r.FormWidgetType.TEXTAREA,new Map(_e))},Ee={widgetType:"wm-textarea",hostClass:"app-input-wrapper"},Re=function(e){function t(t){var n=e.call(this,t,Ee)||this;return n.charlength=0,n}return c(t,e),t.prototype.onInputChange=function(){this.charlength=this.inputEl.nativeElement.value.length},t}(B);Re.initializeProps=Oe(),Re.decorators=[{type:t.Component,args:[{selector:"wm-textarea",template:'<textarea class="form-control app-textarea"\n focus-target\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n aria-multiline="true"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (input)="onInputChange()"\n (ngModelChange)="handleChange($event); onInputChange();"\n #textarea\n></textarea>\n\n<div *ngIf="maxchars" class="textarea-count" >{{limitdisplaytext}}</div>\n',providers:[a.provideAs(Re,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Re,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Re)]}]}],Re.ctorParameters=function(){return[{type:t.Injector}]},Re.propDecorators={inputEl:[{type:t.ViewChild,args:["textarea",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var Ae=function(){function e(e,n){this.skipFloatPositionWidgets=["radioset","checkboxset","richtext","switch","chips","checkbox","slider","rating","toggle","upload"],this.elementRef=e.get(t.ElementRef),this.nativeEl=this.elementRef.nativeElement,this.app=n}return e.prototype.onBlurCb=function(){var e;this.inputEl.length>1&&this.inputEl.hasClass("mobile-input")&&_.forEach(this.inputEl,(function(t){$(t).hasClass("mobile-input")&&t.value&&(e=t.value)})),this.inputEl.val()||e||(this.compositeEle.classList.remove("float-active"),this.inputEl.removeAttr("placeholder"))},e.prototype.onFocusCb=function(){this.compositeEle.classList.add("float-active"),this.inputEl.attr("placeholder",this.placeholder)},e.prototype.checkForSelectPlaceholder=function(){!$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").is(":focus")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.nativeEl).find("select option:selected").text("")},e.prototype.setDefaultValueAnimation=function(){!this._isPlaceholderBound&&this.inputEl.attr("placeholder")&&(this.placeholder=this.inputEl.attr("placeholder"),this.inputEl.removeAttr("placeholder")),this.checkForSelectPlaceholder(),(this.inputEl.val()&&!this.inputEl.is("select")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.inputEl.parent("[widget-id]")).attr("datavalue.bind")||this.nativeEl.getAttribute("defaultvalue")||this.nativeEl.getAttribute("displayformat")||$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").attr("multiple"))&&this.compositeEle.classList.add("float-active")},e.prototype.observeForPlaceholderAttrChange=function(){var e=this;this._attrObserver=new MutationObserver((function(t){t.forEach((function(t){"placeholder"===t.attributeName&&e.inputEl.attr("placeholder")&&!e.compositeEle.classList.contains("float-active")&&(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder"))}))}));this._attrObserver.observe(this.inputEl[0],{attributes:!0,childList:!1,characterData:!1})},e.prototype.checkForRightAlignedForm=function(){var e=$(this.compositeEle);if(e.closest(".align-right").length&&e.find(".input-group-btn").length){var t=e.find("label");e.find("[wmdatetime]").length?t.addClass("input-grp-dt-icon"):t.addClass("input-grp-icon")}},e.prototype.ngAfterViewInit=function(){this.compositeEle=this.nativeEl;var e=this.nativeEl.widget,t=e.$attrs.get("captionposition");if(e.form&&(t=e.form.$attrs.get("captionposition"),this.compositeEle=this.nativeEl.querySelector(".app-composite-widget"),this._isPlaceholderBound=this.nativeEl.getAttribute("placeholder.bind")),"floating"===t){if(e.form){var n=this.nativeEl.getAttribute("widgettype");this.skipFloatPositionWidgets.indexOf(n)>-1&&(this.compositeEle.classList.remove("caption-floating"),this.compositeEle.classList.add("caption-top")),this.checkForRightAlignedForm()}this.inputEl=$(this.nativeEl).find("input, select, textarea"),this._isPlaceholderBound||(this._isPlaceholderBound=this.inputEl.closest("[widget-id]").attr("placeholder.bind")),setTimeout(this.setDefaultValueAnimation.bind(this),0),this.inputEl.focus(this.onFocusCb.bind(this)),this.inputEl.blur(this.onBlurCb.bind(this)),this._isPlaceholderBound&&this.observeForPlaceholderAttrChange()}},e.prototype.ngOnInit=function(){var e=this;this.labelAnimationSubscription=this.app.subscribe("captionPositionAnimate",(function(t){var n=e.inputEl&&e.inputEl.is(":focus");if(t.displayVal||t.isFocused||t.isSelectMultiple||n)t.nativeEl.addClass("float-active"),!t.displayVal&&n&&e.inputEl.attr("placeholder",e.placeholder);else if(t.nativeEl.removeClass("float-active"),e.inputEl){var i=e.inputEl.find("option:first");(e.inputEl.attr("placeholder")||i.text())&&(i.length?i.text(""):(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder")))}}))},e.prototype.ngOnDestroy=function(){this.labelAnimationSubscription&&this.labelAnimationSubscription(),this._attrObserver&&this._attrObserver.disconnect()},e}();Ae.decorators=[{type:t.Directive,args:[{selector:"[captionPosition]"}]}],Ae.ctorParameters=function(){return[{type:t.Injector},{type:r.App}]};var Te=[m,v,Ae,T,x,L,W,H,Z,te,ae,ce,he,ve,Pe,Re],Se=function(){};Se.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,a.WmComponentsModule,o.IMaskModule],declarations:d([],p(Te)),exports:d([],p(Te)),entryComponents:[]}]}],e.BaseFormComponent=y,e.BaseFormCustomComponent=w,e.ButtonComponent=m,e.ButtonGroupDirective=v,e.CaptionPositionDirective=Ae,e.CheckboxComponent=T,e.CheckboxsetComponent=x,e.CompositeDirective=L,e.DatasetAwareFormComponent=S,e.InputCalendarComponent=ae,e.InputColorComponent=ce,e.InputEmailComponent=he,e.InputModule=Se,e.InputNumberComponent=ve,e.InputTextComponent=Pe,e.NumberComponent=W,e.NumberLocale=G,e.RadiosetComponent=H,e.SelectComponent=Z,e.SwitchComponent=te,e.TextareaComponent=Re,e["\u02750"]=A,e["\u0275a"]=u,e["\u0275b"]=f,e["\u0275c"]=O,e["\u0275d"]=I,e["\u0275e"]=N,e["\u0275f"]=B,e["\u0275g"]=j,e["\u0275h"]=q,e["\u0275i"]=K,e["\u0275j"]=X,e["\u0275k"]=ie,e["\u0275l"]=se,e["\u0275m"]=de,e["\u0275n"]=fe,e["\u0275o"]=be,e["\u0275p"]=Oe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@wm/core"),require("@wm/components/base"),require("@angular/common")):"function"==typeof define&&define.amd?define("@wm/components/basic",["exports","@angular/core","@wm/core","@wm/components/base","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic={}),e.ng.core,e.wm.core,e.wm.components.base,e.ng.common)}(this,(function(e,t,n,i,o){"use strict";
57
+ ***************************************************************************** */var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,a=n.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return r}function d(e,t,n){if(n||2===arguments.length)for(var i,o=0,a=t.length;o<a;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var u=function(){a.register("wm-button",new Map([["animation",a.PROP_STRING],["badgevalue",a.PROP_STRING],["caption",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["iconclass",a.PROP_STRING],["iconheight",a.PROP_STRING],["iconmargin",a.PROP_STRING],["iconposition",a.PROP_STRING],["iconurl",a.PROP_STRING],["iconwidth",a.PROP_STRING],["name",a.PROP_STRING],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",a.PROP_STRING]]))},h={widgetType:"wm-button",hostClass:"btn app-button",displayType:a.DISPLAY_TYPE.INLINE_BLOCK},m=function(e){function t(t){var n=e.call(this,t,h)||this;return a.styler(n.nativeElement,n),n}return c(t,e),t}(a.StylableComponent);m.initializeProps=u(),m.decorators=[{type:t.Component,args:[{selector:"button[wmButton]",template:'<img data-identifier="img" alt="button image" class="button-image-icon" [src]="iconurl | image" *ngIf="iconurl" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin}"/>\n<i class="app-icon {{iconclass}}" aria-hidden="true" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin, fontSize:iconwidth}" *ngIf="iconclass"></i>\n<span class="sr-only" *ngIf="iconclass">{{caption}} {{appLocale.LABEL_ICON}}</span>\n<span class="btn-caption" [innerHTML]="caption"></span>\n<ng-content select=".caret"></ng-content>\n<span *ngIf="badgevalue" class="badge pull-right" [textContent]="badgevalue"></span>\n',providers:[a.provideAsWidgetRef(m)],exportAs:"wmButton"}]}],m.ctorParameters=function(){return[{type:t.Injector}]},m.propDecorators={type:[{type:t.HostBinding,args:["type"]}],tabindex:[{type:t.HostBinding,args:["tabIndex"]}],disabled:[{type:t.HostBinding,args:["disabled"]}],shortcutkey:[{type:t.HostBinding,args:["attr.accesskey"]}],iconposition:[{type:t.HostBinding,args:["attr.icon-position"]}]};var f=function(){a.register("wm-buttongroup",new Map([["class",a.PROP_STRING],["name",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["vertical",a.PROP_BOOLEAN]]))},g={widgetType:"wm-buttongroup",hostClass:"btn-group app-button-group"},v=function(e){function t(t){var n=e.call(this,t,g)||this;return a.styler(n.nativeElement,n,a.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.handleClick=function(e){var t=$(e.target).closest(".app-button");this.$element.find(".app-button").removeClass("selected"),t.addClass("selected")},t}(a.StylableComponent);v.initializeProps=f(),v.decorators=[{type:t.Directive,args:[{selector:"[wmButtonGroup]",providers:[a.provideAsWidgetRef(v)]}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={vertical:[{type:t.HostBinding,args:["class.btn-group-vertical"]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var y=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.inj=t,o.binddatavalue=o.$element.attr("datavalue.bind"),o}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.dataval},set:function(e){this.dataval=e},enumerable:!1,configurable:!0}),t.prototype.updateBoundVariable=function(e){var t=this.binddatavalue;this.datavaluesource&&this.datavaluesource.execute(r.DataSource.Operation.IS_API_AWARE)||this.datavaluesource&&!this.datavaluesource.twoWayBinding||!t||t.startsWith("Widgets.")||t.startsWith("itemRef.currentItemWidgets")||(t=t.replace(/\[\$i\]/g,"[0]"),_.has(this.context,t.split(".")[0])?_.set(this.context,t,e):_.set(this.viewParent,t,e))},t.prototype.invokeOnChange=function(e,t){t&&this.datavalue!==this.prevDatavalue&&(this.updateBoundVariable(e),this.invokeEventCallback("change",{$event:t,newVal:e,oldVal:this.prevDatavalue})),this.prevDatavalue=e},t.prototype.updatePrevDatavalue=function(e){this.prevDatavalue=e},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),$(this.nativeElement).parents().closest("[wmList]").length&&this.$element.keydown((function(e){37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode||e.stopPropagation()}))},t}(a.StylableComponent);function b(e){return function(t){return e?function(e){switch(typeof e){case"object":return!(!e||!e.length&&!Object.keys(e).length);case"number":return!!e||0===e;default:return!(null==e||""===e)}}(t.value)?null:{required:!0}:null}}y.decorators=[{type:t.Injectable}],y.ctorParameters=function(){return[{type:t.Injector},{type:void 0},{type:Promise}]};var w=function(e){function t(){var t=e.apply(this,d([],p(arguments)))||this;return t._onChange=function(){},t._onTouched=function(){},t}return c(t,e),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this._formControl=this.inj.get(i.FormControlName,null)},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.writeValue=function(e){this.isDestroyed||(this._formControl&&(this.datavalue=e,this.onPropertyChange("datavalue",e),this.updatePrevDatavalue(e)),e!==this.datavalue&&this._onChange(this.datavalue))},t.prototype.invokeOnChange=function(t,n,i){this._onChange(t),i&&e.prototype.invokeOnChange.call(this,t,n)},t.prototype.invokeOnTouched=function(e){this._onTouched(),e&&this.invokeEventCallback("blur",{$event:e})},t.prototype.invokeOnFocus=function(e){this.invokeEventCallback("focus",{$event:e})},t.prototype.validate=function(e){return this.show?b(this.required)(e):null},t}(y);w.decorators=[{type:t.Injectable}];var P=new Map([["caption",a.PROP_STRING],["class",a.PROP_STRING],["conditionalclass",a.PROP_ANY],["conditionalstyle",a.PROP_ANY],["checkedvalue",Object.assign({value:!0},a.PROP_STRING)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["name",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["uncheckedvalue",Object.assign({value:!1},a.PROP_STRING)]]),O=function(){a.register("wm-checkbox",P),a.registerFormWidget(r.FormWidgetType.CHECKBOX,P),a.registerFormWidget(r.FormWidgetType.TOGGLE,P)},E={widgetType:"wm-checkbox",hostClass:"app-checkbox checkbox"},R=function(e,t){if(null===e)return t;if(!0===e||"true"===e)return!0;if(!1===e||"false"===e)return!1;var n=parseInt(e,10);return isNaN(n)?e:n},A=R,T=function(e){function t(t,n,i,o){var a=e.call(this,t,E)||this;return a.type=o,a._caption="&nbsp",a._checkedvalue=R(n,!0),a._uncheckedvalue=R(i,!1),r.toggleClass(a.nativeElement,"app-toggle","toggle"===o),a}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return r.isDefined(this.proxyModel)?this.proxyModel?this._checkedvalue:this._uncheckedvalue:void 0},set:function(e){this.proxyModel=r.isDefined(e)&&""!==e?e===this._checkedvalue:void 0,this.updatePrevDatavalue(this.datavalue)},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"caption"===t?r.isDefined(n)&&""!==n?this._caption=n:this._caption="&nbsp;":"checkedvalue"===t?this._checkedvalue=R(n,!0):"uncheckedvalue"===t?this._uncheckedvalue=R(n,!1):"datavalue"===t?(this.datavalue=R(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.handleEvent=function(t,n,i,o){if("change"!==n&&"blur"!==n){var a="tap"===n?this.nativeElement.querySelector("label"):this.checkboxEl.nativeElement;e.prototype.handleEvent.call(this,a,n,i,o)}},t.prototype.handleChange=function(e){this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.onKeyDown=function(e){e.preventDefault(),this.checkboxEl.nativeElement.click()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.styler(this.nativeElement.querySelector("label"),this)},t}(w);T.initializeProps=O(),T.decorators=[{type:t.Component,args:[{selector:"[wmCheckbox]",template:'<label [ngClass]="{\'unchecked\': !proxyModel, \'disabled\': (disabled || readonly), \'required\': (required && _caption)}">\n <input type="checkbox"\n role="checkbox"\n #checkbox\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-checked]="!!proxyModel"\n focus-target\n [(ngModel)]="proxyModel"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled || readonly"\n [attr.accesskey]="shortcutkey"\n [tabindex]="tabindex"\n (blur)="invokeOnTouched($event)"\n (ngModelChange)="handleChange($event)">\n <span class="caption" [innerHtml]="_caption"></span>\n <img alt="Checkbox Image" aria-hidden="true" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="switch"/>\n</label>\n<input type="hidden" class="ng-hide model-holder" aria-hidden="true" tabindex="-1" [disabled]="disabled" [value]="proxyModel">\n',providers:[a.provideAs(T,i.NG_VALUE_ACCESSOR,!0),a.provideAs(T,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(T)]}]}],T.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["checkedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["uncheckedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["type"]}]}]},T.propDecorators={ngModel:[{type:t.ViewChild,args:[i.NgModel]}],checkboxEl:[{type:t.ViewChild,args:["checkbox",{static:!0,read:t.ElementRef}]}],onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var S=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;return o.groupby=i,o.datasetItems=[],o.acceptsArray=!1,o.dataset$=new s.Subject,o.datavalue$=new s.Subject,o.allowempty=!0,o._debounceDatavalueUpdation=_.debounce((function(e){!r.isDefined(o._modelByKey)||_.isArray(o._modelByKey)&&!o._modelByKey.length?(o.toBeProcessedDatavalue=e,o._modelByValue=""):r.isDefined(o.toBeProcessedDatavalue)&&(r.isDefined(o._modelByValue)||(o._modelByValue=!o.multiple&&_.isArray(o.toBeProcessedDatavalue)?o.toBeProcessedDatavalue[0]:o.toBeProcessedDatavalue),o.toBeProcessedDatavalue=void 0),o.initDisplayValues()}),150),o.datePipe=o.inj.get(a.ToDatePipe),o.appDefaults=o.inj.get(r.AppDefaults),o.binddisplayexpression=o.nativeElement.getAttribute("displayexpression.bind"),o.binddisplayimagesrc=o.nativeElement.getAttribute("displayimagesrc.bind"),o.binddisplaylabel=o.nativeElement.getAttribute("displaylabel.bind"),o._debouncedInitDatasetItems=r.debounce((function(){o.initDatasetItems(),r.$appDigest()}),150),o.handleHeaderClick=r.noop,o.cancelLocaleChangeSubscription=o.getAppInstance().subscribe("locale-changed",(function(){o._debouncedInitDatasetItems()})),o}return c(t,e),Object.defineProperty(t.prototype,"modelByKey",{get:function(){return this._modelByKey},set:function(e){this.selectByKey(e),this.invokeOnChange(this._modelByValue)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this._modelByValue},set:function(e){this.multiple&&(e=a.extractDataAsArray(e)),this._modelByValue=e,this.selectByValue(e),this.datavalue$.next(e),this.invokeOnChange(e,void 0,!0)},enumerable:!1,configurable:!0}),t.prototype.selectByKey=function(e){var t=this;if(this.resetDatasetItems(),this.datasetItems.length){if(this.multiple&&!_.isArray(e)&&(e=[e]),this._modelByKey=e,this.multiple)this._modelByValue=[],e.forEach((function(e){var n=_.find(t.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,t._modelByValue=d(d([],p(t._modelByValue)),[n.value]))}));else{this._modelByValue="";var n=_.find(this.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,this._modelByValue=n.value)}this.initDisplayValues()}},t.prototype.selectByValue=function(e){var t=this;if(this.resetDatasetItems(),!(!r.isDefined(e)||""===e||_.isNull(e)||e instanceof Array&&!e.length)||(this._modelByKey=void 0,this.allowempty&&r.isDefined(e)))if(this.acceptsArray&&!_.isArray(e)&&(e=this.allowempty?[e]:a.extractDataAsArray(e)),this.datasetItems.length||!r.isDefined(e)){var n=this.datafield===a.ALLFIELDS?"dataObject":"key";if(_.isArray(e))this._modelByKey=[],e.forEach((function(e){var i=_.find(t.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?r.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,t._modelByKey.push(i.key))}));else{this._modelByKey=void 0;var i=_.find(this.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?r.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,this._modelByKey=i.key)}this._debounceDatavalueUpdation(e)}else this.toBeProcessedDatavalue=e},t.prototype.initDisplayValues=function(){var e=[];this.datasetItems.forEach((function(t){t.selected&&e.push(t.label)})),this.displayValue=this.multiple?e:e[0]||""},t.prototype.initDatasetItems=function(){if(!this.dataset||_.isEmpty(this.dataset))return this.datasetItems=[],void this.dataset$.next(this.datasetItems);var e=a.getOrderedDataset(a.convertDataToObject(this.dataset),this.orderby);if(this.usekeys)this.datasetItems=a.transformDataWithKeys(e);else{var t=a.transformFormData(this.viewParent,e,this.datafield,{displayField:this.displayfield||this.displaylabel,displayExpr:this.displayexpression,bindDisplayExpr:this.binddisplayexpression||this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc});this.datasetItems=d([],p(a.getUniqObjsByDataField(t,this.datafield,this.displayfield||this.displaylabel,r.toBoolean(this.allowempty))))}this.postDatasetItemsInit()},t.prototype.postDatasetItemsInit=function(){if(this.datasetItems.length&&!this._defaultQueryInvoked){var e=_.isEmpty(this.toBeProcessedDatavalue)?this.datavalue:this.toBeProcessedDatavalue;this.selectByValue(e)}this.dataset$.next(this.datasetItems)},t.prototype.resetDatasetItems=function(){this.datasetItems.forEach((function(e){return e.selected=!1}))},t.prototype.setTemplate=function(e){this.content=e,this.viewParent&&this.viewParent.prefabName&&(this.prefabName=this.viewParent.prefabName)},t.prototype.getGroupedData=function(){return this.datasetItems.length?a.groupData(this,a.convertDataToObject(this.datasetItems),this.groupby,this.match,this.orderby,this.dateformat,this.datePipe,"dataObject",this.appDefaults):[]},t.prototype.datasetSubscription=function(){var e=this,t=this.dataset$.subscribe((function(){e.groupedData=e.getGroupedData()}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.setGroupData=function(){this.datasetSubscription(),this.groupedData=this.getGroupedData()},t.prototype.onPropertyChange=function(t,n,i){switch(e.prototype.onPropertyChange.call(this,t,n,i),t){case"dataset":case"datafield":case"displayfield":case"displaylabel":case"displayexpression":case"orderby":case"usekeys":this._debouncedInitDatasetItems();break;case"required":case"datavalue":this._onChange(this.datavalue);break;case"groupby":case"match":"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData()}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.groupby&&"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData(),this.groupby&&this.collapsible&&(this.handleHeaderClick=a.handleHeaderClick,this.toggleAllHeaders=a.toggleAllHeaders.bind(void 0,this))},t.prototype.ngOnDestroy=function(){this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription()},t}(w);S.decorators=[{type:t.Injectable}],S.ctorParameters=function(){return[{type:t.Injector},null,{type:String,decorators:[{type:t.Attribute,args:["groupby"]}]}]};var C=new Map([["class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["itemclass",Object.assign({value:""},a.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},a.PROP_STRING)],["listclass",Object.assign({value:""},a.PROP_STRING)],["match",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},a.PROP_STRING)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),I=function(){a.register("wm-checkboxset",C),a.registerFormWidget(r.FormWidgetType.CHECKBOXSET,new Map(C))},D={widgetType:"wm-checkboxset",hostClass:"app-checkboxset list-group inline"},x=function(e){function t(t){var n=e.call(this,t,D)||this;return n.layout="",a.styler(n.nativeElement,n),n.multiple=!0,n}return c(t,e),t.prototype.onCheckboxLabelClick=function(e,t){if($(e.target).is("input")){var n=this.nativeElement.querySelectorAll("input:checked"),i=[];_.forEach(n,(function(e){i.push(e.value)})),this.modelByKey=i,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)}},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onKeyDown=function(e){e.preventDefault(),e.target.click()},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"itemsperrow"===t?r.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t}(S);x.initializeProps=I(),x.decorators=[{type:t.Component,args:[{selector:"[wmCheckboxset]",exportAs:"wmCheckboxset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'checkbox\', \'app-checkbox\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems; let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group" role="presentation">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'checkbox\', \'app-checkbox\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[a.provideAs(x,i.NG_VALUE_ACCESSOR,!0),a.provideAs(x,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(x)]}]}],x.ctorParameters=function(){return[{type:t.Injector}]},x.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var N=function(){a.register("wm-form-group",new Map([["captionposition",a.PROP_STRING],["name",a.PROP_STRING],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)]]))},k={widgetType:"wm-form-group",hostClass:"form-group app-composite-widget clearfix"},M={left:"caption-left",right:"caption-right",top:"caption-top",floating:"caption-floating"},L=function(e){function t(t){var n=e.call(this,t,k)||this;return a.styler(n.nativeElement,n,a.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"captionposition"===t?r.switchClass(this.nativeElement,M[n],M[i]):"required"===t?(this.required=n,this.assignRequiredToSubComponents()):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.assignRequiredToSubComponents=function(){var e=this;this.required&&this.componentRefs&&setTimeout((function(){e.componentRefs.forEach((function(e){return e.widget.required=!0}))}),50)},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.addForIdAttributes(this.nativeElement),this.assignRequiredToSubComponents()},t}(a.StylableComponent);L.initializeProps=N(),L.decorators=[{type:t.Directive,args:[{selector:"div[wmComposite]",providers:[a.provideAsWidgetRef(L)]}]}],L.ctorParameters=function(){return[{type:t.Injector}]},L.propDecorators={componentRefs:[{type:t.ContentChildren,args:[a.WidgetRef,{descendants:!0}]}]};var F=new Map([["autofocus",a.PROP_BOOLEAN],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["localefilter",a.PROP_STRING],["minvalue",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["numberfilter",a.PROP_STRING],["placeholder",Object.assign({value:"Enter number"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",Object.assign({value:1},a.PROP_NUMBER)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["trailingzero",Object.assign({value:!1},a.PROP_BOOLEAN)],["updateon",a.PROP_STRING],["inputmode",Object.assign({value:"natural"},a.PROP_STRING)]]),j=function(){a.register("wm-number",F),a.registerFormWidget(r.FormWidgetType.NUMBER,new Map(F))},B=function(e){function t(t,n){var i=e.call(this,t,n)||this;i.ngModelOptions={updateOn:""};var o=i.nativeElement.getAttribute("updateon")||"blur";return o="default"===o?"change":o,i.ngModelOptions.updateOn=o,i}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"===t&&this._onChange(this.datavalue),"class"===t?this.inputEl.nativeElement&&r.switchClass(this.inputEl.nativeElement,n,i):"datavalue"===t?(this.updatePrevDatavalue(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.handleChange=function(e){this.autotrim&&this.datavalue&&_.isString(this.datavalue)&&(this.datavalue=this.datavalue.trim()),this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.handleEvent=function(t,n,i,o){"change"!==n&&"blur"!==n&&e.prototype.handleEvent.call(this,this.inputEl.nativeElement,n,i,o)},t.prototype.handleBlur=function(e){this.invokeOnTouched(e)},t.prototype.flushViewChanges=function(e){var t=_.get(this.imask,"maskRef.unmaskedValue");e=t||e,this.ngModel.update.next(e),r.$appDigest()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.class&&r.addClass(this.inputEl.nativeElement,this.class),a.styler(this.inputEl.nativeElement,this)},t}(w);B.decorators=[{type:t.Injectable}],B.ctorParameters=function(){return[{type:t.Injector},{type:void 0}]};var G=function(e){function t(t,i,o,a){var r=e.call(this,t,i)||this;return r.i18nService=o,r.trailingZeroDecimalPipe=a,r.isDefaultQuery=!0,r.decimalValue="",r.selectedLocale=o.getSelectedLocale(),r.DECIMAL=n.getLocaleNumberSymbol(r.localefilter||r.selectedLocale,n.NumberSymbol.Decimal),r.GROUP=n.getLocaleNumberSymbol(r.localefilter||r.selectedLocale,n.NumberSymbol.Group),r.numberfilter="1.0-16",r.resetValidations(),r}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.proxyModel},set:function(e){if(this.lastValIsDecimal=!1,_.includes([null,void 0,""],e)){var t=this.inputEl.nativeElement,n=this.prevDatavalue;return this.displayValue=t.value=this.proxyModel=null,this.resetValidations(),void(n&&!this.isDefaultQuery&&(this.handleChange(e),this._onChange()))}if(this.isDefaultQuery){var i=_.isString(e)&&_.includes(e,this.DECIMAL),o=i?e.split(this.DECIMAL):_.isString(e)&&e.split(".");this.decimalValue=o[1]||"",e=i?e:this.transformNumber(e)}var a,r=e.toString();a=/\d/.test(r)?this.parseNumber(r):NaN,_.isNaN(a)&&r[r.length-1]===this.DECIMAL&&"change"===this.ngModelOptions.updateOn&&this.$element.find("input:focus").length&&(this.lastValIsDecimal=!0),!this.lastValIsDecimal&&this.isValid(a)?(this.proxyModel=a,this.updateDisplayText(),this.isDefaultQuery||this.handleChange(a)):(this.displayValue=e.toString(),this.proxyModel=null,this.handleChange(null))},enumerable:!1,configurable:!0}),t.prototype.resetValidations=function(){this.isInvalidNumber=!1,this.numberNotInRange=!1},t.prototype.isValid=function(e){return _.isNaN(e)||!_.isFinite(e)||!Number.isInteger(this.step)&&this.countDecimals(e)>this.countDecimals(this.step)?(this.isInvalidNumber=!0,!1):e!==this.getValueInRange(e)?(this.numberNotInRange=!0,!0):(this.resetValidations(),!0)},t.prototype.getValueInRange=function(e){return!_.isNaN(this.minvalue)&&e<this.minvalue?(this.validateType="minvalue",this.minvalue):!_.isNaN(this.maxvalue)&&e>this.maxvalue?(this.validateType="maxvalue",this.maxvalue):e},t.prototype.transformNumber=function(e,t){var n,i=t||this.numberfilter;return this.trailingZeroDecimalPipe.transform(e,this.selectedLocale,i,this.localefilter,this.trailingzero,this.decimalValue,!!t,null===(n=this.i18nService)||void 0===n?void 0:n.getwidgetLocale())},t.prototype.resetCursorPosition=function(e){var t=this.inputEl.nativeElement,n=t.value.length-e;n=n<0?0:n,t.setSelectionRange(n,n)},t.prototype.parseNumber=function(e){var t=e.split(this.inputmode===a.INPUTMODE.FINANCIAL?e.indexOf(this.DECIMAL)>-1?this.DECIMAL:".":this.DECIMAL);if(!t.length)return null;if(t.length>2)return NaN;if(""===t[1])return NaN;var n=Number(t[0].split(this.GROUP).join("")),i=Number("0."+(t[1]||0));if(Number.isNaN(n)||Number.isNaN(i))return NaN;var o=t.length>1?parseFloat((n+i).toFixed(t[1].length)):n+i;return 0===n?Object.is(0,n)?o:n-i:n>0?o:n-i},t.prototype.updateDisplayText=function(){var e=this.inputEl.nativeElement,t=e.selectionStart,n=e.value;if(!this.isDefaultQuery){var i=n.split(this.DECIMAL);this.decimalValue=i[1]||""}var o=this.stepLength();this.inputmode===a.INPUTMODE.FINANCIAL&&o?(this.displayValue=e.value=this.transformNumber(this.proxyModel,"1."+o+"-"+o),this.decimalValue=this.decimalValue.replace(/\D/g,"")):this.displayValue=e.value=this.transformNumber(this.proxyModel),"default"!==this.updateon||this.isDefaultQuery||this.resetCursorPosition(n.length-t)},t.prototype.stepLength=function(){var e=this.step.toString().split(".");return 1===e.length?void 0:e[1].length},t.prototype.isNaturalCurrency=function(){return this.inputmode===a.INPUTMODE.NATURAL&&"wm-currency"===this.widgetType&&!!this.trailingzero},t.prototype.onInputChange=function(e){var t=this.stepLength();if(r.isDefined(e)&&(""!==e||this.datavalue)&&(this.handleChange(e),t&&this.inputmode===a.INPUTMODE.FINANCIAL)){var n;if(this.isDefaultQuery)n=parseFloat(e);else n=parseInt(e.toString().replace(/\D/g,""))*this.step;_.isNaN(n)?"blur"!==this.ngModelOptions.updateOn&&(this.datavalue=void 0,this.handleChange(null)):"change"===this.ngModelOptions.updateOn?(this.datavalue=parseFloat(n.toFixed(t)),this.handleChange(this.datavalue)):this.displayValue=n.toFixed(t)}},t.prototype.checkForTrailingZeros=function(e){var t=this.stepLength(),n=!this.trailingzero&&this.inputmode===a.INPUTMODE.FINANCIAL;if(this.lastValIsDecimal&&this.onModelChange(this.displayValue),(n||this.isNaturalCurrency())&&t&&this.datavalue){var i=void 0;(n&&"focus"===e.type||this.isNaturalCurrency()&&"blur"===e.type)&&(i="1."+t+"-"+t),this.displayValue=this.transformNumber(this.datavalue,i)}},t.prototype.countDecimals=function(e){if(e%1!=0){var t=e.toString().split(".")[1];return t&&t.length}return 0},t.prototype.onArrowPress=function(e,t){if(e.preventDefault(),!this.readonly&&0!==this.step){var n,i,o=e.target.value.replace(/,/g,"");if(n=o&&!_.isNaN(parseFloat(o))?parseFloat(o):this.proxyModel,this.numberNotInRange){var a=this.parseNumber(this.inputEl.nativeElement.value);_.isNaN(a)||(i=this.getValueInRange(a),n=a,this.resetValidations())}else _.isUndefined(n)||_.isNull(n)?(n=i=this.getValueInRange(this.minvalue||0),this.resetValidations()):i=this.getValueInRange(n+("UP"===t?this.step:-this.step));if("UP"===t&&n<=i||"DOWN"===t&&n>=i){var r=Math.max(this.countDecimals(n),this.countDecimals(this.step));this.proxyModel=_.round(i,r),this.updateDisplayText(),this.handleChange(this.proxyModel)}}},t.prototype.validate=function(e){return this.isInvalidNumber?(this.validateType="",{invalidNumber:{valid:!1}}):this.numberNotInRange?{numberNotInRange:{valid:!1}}:(this.validateType="",this.show&&this.required?e.value||0===e.value?null:{required:!0}:null)},t.prototype.validateInputEntry=function(e){if(this.isDefaultQuery=!1,!e.ctrlKey&&!_.includes(["Backspace","ArrowRight","ArrowLeft","Tab","Enter","Delete"],e.key)){var t=new RegExp("^[\\d\\s-,.e+"+this.GROUP+this.DECIMAL+"]$","i"),n=e.target.value,i=this.inputmode===a.INPUTMODE.FINANCIAL;if(n)if(parseInt(n.toString().replace(/\D/g,"")).toString().length>15){var o=window.getSelection();return!(!o||!o.toString()||o.focusNode!==this.nativeElement)}return!(!i&&n&&this.countDecimals(this.step)&&this.countDecimals(n)>=this.countDecimals(this.step)&&e.target.selectionStart>=n.length-1)&&(!!t.test(e.key)&&((!_.includes(n,",")||","!==n[n.length-1]||","!==e.key)&&((!_.includes(n,this.DECIMAL)||e.key!==this.DECIMAL)&&((!_.intersection(_.toArray(n),["e","E"]).length||!_.includes("eE",e.key))&&((!_.includes(n,"+")&&!_.includes(n,"-")||"+"!==e.key&&"-"!==e.key)&&(!(!n&&"Space"===e.code)&&void 0))))))}},t.prototype.onBackspace=function(e){this.isDefaultQuery=!1},t.prototype.onEnter=function(e){this.datavalue=e.target.value},t.prototype.onModelChange=function(e){(this.inputmode===a.INPUTMODE.NATURAL||this.inputmode===a.INPUTMODE.FINANCIAL&&"blur"===this.ngModelOptions.updateOn)&&(this.datavalue=e)},t.prototype.onPropertyChange=function(t,n,i){"minvalue"===t||"maxvalue"===t?this.isValid(n):"datavalue"!==t||i?e.prototype.onPropertyChange.call(this,t,n,i):this.isNaturalCurrency()?this.checkForTrailingZeros({type:"blur"}):this.onInputChange(n)},t}(B),V={widgetType:"wm-number",hostClass:"app-input-wrapper"},W=function(e){function t(t,n,i){return e.call(this,t,V,n,i)||this}return c(t,e),t}(G);W.initializeProps=j(),W.decorators=[{type:t.Component,args:[{selector:"[wmNumber]",template:'<input class="form-control app-textbox app-number-input"\n inputmode="decimal"\n focus-target\n [attr.name]="name"\n role="textbox"\n type="text"\n [ngModel]="displayValue"\n [readonly]="readonly"\n [disabled]="disabled"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (ngModelChange)="onModelChange($event)"\n (blur)="handleBlur($event); checkForTrailingZeros($event);"\n (focus)="checkForTrailingZeros($event)"\n (input)="onInputChange($event.target.value)"\n [ngModelOptions]="ngModelOptions"\n [required]="required"\n (keypress)="validateInputEntry($event)"\n (keydown.backspace)="onBackspace($event)"\n (keydown.enter)="onEnter($event)"\n (keydown.ArrowUp)="onArrowPress($event, \'UP\')"\n (keydown.ArrowDown)="onArrowPress($event, \'DOWN\')"\n #input>\n',providers:[a.provideAs(W,i.NG_VALUE_ACCESSOR,!0),a.provideAs(W,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(W)]}]}],W.ctorParameters=function(){return[{type:t.Injector},{type:r.AbstractI18nService},{type:a.TrailingZeroDecimalPipe}]},W.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel,{static:!0}]}]};var U=new Map([["class",a.PROP_STRING],["collapsible",a.PROP_BOOLEAN],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_ANY],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["itemclass",Object.assign({value:""},a.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},a.PROP_STRING)],["listclass",Object.assign({value:""},a.PROP_STRING)],["match",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showcount",a.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},a.PROP_STRING)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),q=function(){a.register("wm-radioset",U),a.registerFormWidget(r.FormWidgetType.RADIOSET,new Map(U))},z={widgetType:"wm-radioset",hostClass:"app-radioset list-group inline"},H=function(e){function t(t){var n=e.call(this,t,z)||this;return n.layout="",a.styler(n.nativeElement,n),n.multiple=!1,n}return c(t,e),t.prototype.onRadioLabelClick=function(e,t){$(e.target).is("input")&&(this.modelByKey=t,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0))},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("itemsperrow"===t?r.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i))},t}(S);H.initializeProps=q(),H.decorators=[{type:t.Component,args:[{selector:"[wmRadioset]",exportAs:"wmRadioset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'radio\', \'app-radio\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems;let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" aria-readonly="true" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'radio\', \'app-radio\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[a.provideAs(H,i.NG_VALUE_ACCESSOR,!0),a.provideAs(H,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(H)]}]}],H.ctorParameters=function(){return[{type:t.Injector}]};var Y=new Map([["autofocus",a.PROP_BOOLEAN],["class",Object.assign({value:""},a.PROP_STRING)],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",a.PROP_ANY],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["dateformat",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["displayValue",a.PROP_STRING],["groupby",a.PROP_STRING],["hint",a.PROP_STRING],["match",a.PROP_STRING],["multiple",Object.assign({value:!1},a.PROP_BOOLEAN)],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["placeholder",a.PROP_STRING],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["usekeys",a.PROP_BOOLEAN]]),K=function(){a.register("wm-select",Y),a.registerFormWidget(r.FormWidgetType.SELECT,new Map(Y)),a.registerFormWidget(r.FormWidgetType.TYPEAHEAD,new Map(Y))},Q={widgetType:"wm-select",hostClass:"app-select-wrapper"},Z=function(e){function t(t){var n=e.call(this,t,Q)||this;return n.acceptsArray=!0,n}return c(t,e),Object.defineProperty(t.prototype,"datasource",{set:function(e){e&&e.execute&&e.execute(r.DataSource.Operation.IS_BOUND_TO_LOCALE)&&(this.datavalue=e.execute(r.DataSource.Operation.GET_DEFAULT_LOCALE))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.styler(this.selectEl.nativeElement,this)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","change"],n)||e.prototype.handleEvent.call(this,this.selectEl.nativeElement,n,i,o)},t.prototype.onSelectValueChange=function(e){if(this.readonly)return this.placeholder?this.selectEl.nativeElement.value=this.placeholder:this.selectEl.nativeElement.value="",void(this.datavalue=this.prevDatavalue);this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)},t.prototype.onPropertyChange=function(t,n,i){"required"!==t?"class"!==t&&"tabindex"!==t&&("readonly"===t&&(!0===n?r.setAttr(this.selectEl.nativeElement,"readonly","readonly"):r.removeAttr(this.selectEl.nativeElement,"readonly")),e.prototype.onPropertyChange.call(this,t,n,i)):this._onChange(this.datavalue)},t.prototype.checkForFloatingLabel=function(e){var t=$(this.selectEl.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&("focus"===e.type&&(!this.datavalue||this.datavalue&&""===$(this.selectEl).find("select option:selected").text()&&this.placeholder)?$(this.selectEl.nativeElement).find("option:first").text(this.placeholder):this.datavalue||($(this.selectEl.nativeElement).find("option:selected").text(""),t.removeClass("float-active")))},t}(S);Z.initializeProps=K(),Z.decorators=[{type:t.Component,args:[{selector:"wm-select",template:'<select role="listbox" aria-haspopup="true" aria-expanded="false" #select\n focus-target\n [ngClass]="[\'app-select form-control\', class]"\n [disabled]="disabled"\n [required]="required"\n [tabindex]="tabindex"\n [(ngModel)]="modelByKey"\n [multiple]="multiple"\n (change)="onSelectValueChange($event)"\n (focus)="checkForFloatingLabel($event)"\n (blur)="invokeOnTouched($event); checkForFloatingLabel($event)"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-multiselectable]="multiple"\n [autofocus]="autofocus"\n>\n <option selected\n value="undefined"\n [textContent]="placeholder"\n [hidden]="!placeholder"></option>\n\n <ng-container *ngIf="groupby">\n <optgroup *ngFor="let groupObj of groupedData"\n [label]="groupObj.key">\n <option *ngFor="let item of groupObj.data;"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </optgroup>\n </ng-container>\n\n <ng-container *ngIf="!groupby">\n <option *ngFor="let item of datasetItems"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </ng-container>\n</select>\n',providers:[a.provideAs(Z,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Z,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Z)]}]}],Z.ctorParameters=function(){return[{type:t.Injector}]},Z.propDecorators={selectEl:[{type:t.ViewChild,args:["select",{static:!0,read:t.ElementRef}]}]};var J=new Map([["class",a.PROP_STRING],["compareby",a.PROP_STRING],["datafield",a.PROP_STRING],["dataset",Object.assign({value:"yes, no, maybe"},a.PROP_ANY)],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayexpression",a.PROP_STRING],["displayfield",a.PROP_STRING],["hint",a.PROP_STRING],["iconclass",a.PROP_STRING],["name",a.PROP_STRING],["orderby",a.PROP_STRING],["required",a.PROP_BOOLEAN],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)]]),X=function(){a.register("wm-switch",J),a.registerFormWidget(r.FormWidgetType.SWITCH,new Map(J)),a.registerFormWidget(r.FormWidgetType.TOGGLE,new Map(J))},ee={widgetType:"wm-switch",hostClass:"app-switch"},te=function(e){function t(t){var n=e.call(this,t,ee)||this;n.options=[],n._debounceSetSelectedValue=r.debounce((function(e){n.setSelectedValue(),n.updateHighlighter(e),e&&r.$appDigest()}),200);var i=n.dataset$.subscribe((function(){return n.updateSwitchOptions()}));n.registerDestroyListener((function(){return i.unsubscribe()}));var o=n.datavalue$.subscribe((function(){n._debounceSetSelectedValue(!0)}));return n.registerDestroyListener((function(){return o.unsubscribe()})),n}return c(t,e),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.styler(this.nativeElement,this)},t.prototype.onStyleChange=function(t,n,i){"height"===t?r.setCSS(this.nativeElement,"overflow",n?"auto":""):e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.setSelectedValue=function(){r.isDefined(this.datavalue)||r.isDefined(this.toBeProcessedDatavalue)?this.selectedItem=_.find(this.datasetItems,{selected:!0}):this.selectOptAtIndex(0)},t.prototype.updateSwitchOptions=function(){this.datasetItems.length&&(this.btnwidth=100/this.datasetItems.length,r.setCSS(this.nativeElement.querySelector(".app-switch-overlay"),"width",this.btnwidth+"%")),this._debounceSetSelectedValue(!0)},t.prototype.updateHighlighter=function(e){var t=$(this.nativeElement).find("span.app-switch-overlay");this.setSelectedValue();var n,i=this.selectedItem?_.findIndex(this.datasetItems,{key:this.selectedItem.key}):-1;null==i&&(i=-1),n=i*this.btnwidth,e?t.css("left",n+"%"):t.animate({left:n+"%"},300)},t.prototype.selectOptAtIndex=function(e){if(this.datasetItems.length){var t=this.datasetItems[e];this._modelByValue=t.value}},t.prototype.selectOpt=function(e,t,n){if(e.preventDefault(),!this.disabled){if(this.modelByKey=n.key,this.invokeOnTouched(),this.selectedItem&&t===_.findIndex(this.datasetItems,{key:this.selectedItem.key})){if(2!==this.datasetItems.length)return;t=1===t?0:1}this.selectedItem=this.datasetItems[t],this.updateHighlighter(),this.invokeOnChange(this.datavalue,e||{},!0),r.$appDigest()}},t.prototype.onPropertyChange=function(t,n,i){"disabled"!==t||r.toBoolean(n)?e.prototype.onPropertyChange.call(this,t,n,i):this.nativeElement.removeAttribute(t)},t}(S);te.initializeProps=X(),te.decorators=[{type:t.Component,args:[{selector:"[wmSwitch]",template:'<div role="group" class="btn-group btn-group-justified">\n <a *ngFor="let opt of datasetItems; let $index = index;"\n focus-target\n href="javascript:void(0);"\n class="btn btn-default"\n [name]="\'wm-switch-\' + opt.key"\n [ngClass]="{\'selected\': opt.selected, \'disabled\': disabled}"\n (click)="selectOpt($event, $index, opt)"\n >\n <i *ngIf="opt.dataObject && opt.dataObject[iconclass]" aria-hidden="true" [ngClass]="[\'app-icon\', opt.dataObject[iconclass] || opt[\'icon\']]"></i>\n <span class="caption" [textContent]="opt[displayfield] || opt.label"></span>\n </a>\n</div>\n<span [title]="selectedItem ? selectedItem.label : modelByKey"\n class="btn btn-primary app-switch-overlay switch-handle">\n <i *ngIf="iconclass"\n class="app-icon {{(selectedItem && selectedItem.dataObject) && selectedItem.dataObject[iconclass]}}"></i>\n {{selectedItem ? selectedItem.label : modelByKey}}\n</span>\n<input [name]="name" class="model-holder ng-hide" [disabled]="disabled" [value]="modelByKey" [required]="required" aria-hidden="true">\n',providers:[a.provideAs(te,i.NG_VALUE_ACCESSOR,!0),a.provideAsWidgetRef(te)],exportAs:"wmSwitch"}]}],te.ctorParameters=function(){return[{type:t.Injector}]};var ne=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["class",a.PROP_STRING],["datasource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxvalue",a.PROP_NUMBER],["minvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",a.PROP_NUMBER],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",a.PROP_STRING],["updateon",a.PROP_STRING]]),ie=function(){a.register("wm-input-calendar",ne)},oe={widgetType:"wm-input-calendar",hostClass:"app-input-wrapper"},ae=function(e){function t(t){return e.call(this,t,oe)||this}return c(t,e),t}(B);ae.initializeProps=ie(),ae.decorators=[{type:t.Component,args:[{selector:'wm-input[type="date"], wm-input[type="datetime-local"], wm-input[type="month"], wm-input[type="time"], wm-input[type="week"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint || type + \' field\'"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n #input>\n',providers:[a.provideAs(ae,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ae,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(ae)]}]}],ae.ctorParameters=function(){return[{type:t.Injector}]},ae.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var re=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"color"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),se=function(){a.register("wm-input-color",re)},le={widgetType:"wm-input-color",hostClass:"app-input-wrapper"},ce=function(e){function t(t){return e.call(this,t,le)||this}return c(t,e),t}(B);ce.initializeProps=se(),ce.decorators=[{type:t.Component,args:[{selector:'wm-input[type="color"]',template:'<input class="form-control app-textbox"\n focus-target\n [type]="type"\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n #input>\n',providers:[a.provideAs(ce,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ce,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(ce)]}]}],ce.ctorParameters=function(){return[{type:t.Injector}]},ce.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var pe=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"email"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),de=function(){a.register("wm-input-email",pe)},ue={widgetType:"wm-input-email",hostClass:"app-input-wrapper"},he=function(e){function t(t){return e.call(this,t,ue)||this}return c(t,e),t}(B);he.initializeProps=de(),he.decorators=[{type:t.Component,args:[{selector:'wm-input[type="email"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n email\n #input>\n',providers:[a.provideAs(he,i.NG_VALUE_ACCESSOR,!0),a.provideAs(he,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(he)]}]}],he.ctorParameters=function(){return[{type:t.Injector}]},he.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var me=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["maxvalue",a.PROP_NUMBER],["minvalue",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["step",a.PROP_NUMBER],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"number"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),fe=function(){a.register("wm-input-number",me)},ge={widgetType:"wm-input-number",hostClass:"app-input-wrapper"},ve=function(e){function t(t){return e.call(this,t,ge)||this}return c(t,e),t.prototype.onArrowPress=function(e){0===this.step&&e.preventDefault()},t.prototype.validateInputEntry=function(e){if("e"===e.key&&-1!==e.target.value.indexOf(e.key))return!1},t}(B);ve.initializeProps=fe(),ve.decorators=[{type:t.Component,args:[{selector:'wm-input[type="number"]',template:'<input class="form-control app-textbox"\n [ngClass]="{\'step-hidden\': step === 0}"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n (keydown.ArrowUp)="onArrowPress($event)"\n (keydown.ArrowDown)="onArrowPress($event)"\n (keypress)="validateInputEntry($event)"\n #input>\n',providers:[a.provideAs(ve,i.NG_VALUE_ACCESSOR,!0),a.provideAs(ve,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(ve)]}]}],ve.ctorParameters=function(){return[{type:t.Injector}]},ve.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ye=new Map([["autocomplete",Object.assign({value:!0},a.PROP_BOOLEAN)],["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["displayformat",a.PROP_STRING],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["regexp",a.PROP_STRING],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["showdisplayformaton",Object.assign({value:"always"},a.PROP_ANY)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["type",Object.assign({value:"text"},a.PROP_STRING)],["updateon",a.PROP_STRING]]),be=function(){a.register("wm-input-text",ye),a.registerFormWidget(r.FormWidgetType.PASSWORD,new Map(ye));var e=new Map(ye),t=function(t){t.forEach((function(t,n){return e.set(n,t)}))};t(ne),t(re),t(pe),t(me),a.registerFormWidget(r.FormWidgetType.TEXT,new Map(e))},we={widgetType:"wm-input-text",hostClass:"app-input-wrapper"},Pe=function(e){function t(t){var n=e.call(this,t,we)||this;return n.lazy=!1,n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"displayformat":this.maskVal=this.displayformat,this.checkForDisplayFormat();break;case"showdisplayformaton":this.lazy="keypress"===n;break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},Object.defineProperty(t.prototype,"mask",{get:function(){return!(!this.displayformat||!(!this.placeholder||this.placeholder&&this.isFocused))&&{mask:this.maskVal,lazy:this.lazy,definitions:{9:/\d/,A:/[a-zA-Z]/,a:/[a-z]/,"*":/\w/}}},enumerable:!1,configurable:!0}),t.prototype.checkForDisplayFormat=function(e){var t=this;this.displayformat?(this.isFocused=!!(e&&"focus"===e.type||this.datavalue),!this.isFocused&&this.imask&&this.imask.maskRef?(this.imask.maskRef.updateOptions({lazy:!0}),!this.datavalue&&this.imask.maskRef.value&&(this.imask.maskRef.value=this.datavalue)):setTimeout((function(){if(t.imask&&t.imask.maskRef&&t.imask.maskRef.value){var e=t.imask.maskRef.value.indexOf("_"),n=e>=0?t.imask.maskRef.value.slice(0,e).length:t.imask.maskRef.value.length;n!==t.imask.maskRef.cursorPos&&t.imask.maskRef.updateCursor(n)}}),50)):this.imask&&this.imask.maskRef&&(this.imask.maskRef.updateOptions({lazy:!0}),this.inputEl.nativeElement.value=this.datavalue)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.isFocused=!!this.datavalue},t}(B);Pe.initializeProps=be(),Pe.decorators=[{type:t.Component,args:[{selector:'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [(ngModel)]="datavalue"\n [imask]="mask"\n [unmask]="true"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [autofocus]="autofocus"\n (ngModelChange)="handleChange($event)"\n (blur)="handleBlur($event); checkForDisplayFormat($event)"\n (focus)="checkForDisplayFormat($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n #input>\n',providers:[a.provideAs(Pe,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Pe,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Pe)]}]}],Pe.ctorParameters=function(){return[{type:t.Injector}]},Pe.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}],imask:[{type:t.ViewChild,args:["input",{read:o.IMaskDirective}]}]};var _e=new Map([["autofocus",a.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},a.PROP_BOOLEAN)],["class",a.PROP_STRING],["datavaluesource",a.PROP_ANY],["datavalue",a.PROP_STRING],["disabled",a.PROP_BOOLEAN],["hint",a.PROP_STRING],["maxchars",a.PROP_NUMBER],["name",a.PROP_STRING],["placeholder",Object.assign({value:"Place your text"},a.PROP_STRING)],["readonly",a.PROP_BOOLEAN],["required",a.PROP_BOOLEAN],["shortcutkey",a.PROP_STRING],["show",Object.assign({value:!0},a.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},a.PROP_NUMBER)],["updateon",a.PROP_STRING],["limitdisplaytext",a.PROP_STRING],["charlength",a.PROP_NUMBER]]),Oe=function(){a.register("wm-textarea",_e),a.registerFormWidget(r.FormWidgetType.TEXTAREA,new Map(_e))},Ee={widgetType:"wm-textarea",hostClass:"app-input-wrapper"},Re=function(e){function t(t){var n=e.call(this,t,Ee)||this;return n.charlength=0,n}return c(t,e),t.prototype.onInputChange=function(){this.charlength=this.inputEl.nativeElement.value.length},t}(B);Re.initializeProps=Oe(),Re.decorators=[{type:t.Component,args:[{selector:"wm-textarea",template:'<textarea class="form-control app-textarea"\n focus-target\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n aria-multiline="true"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (input)="onInputChange()"\n (ngModelChange)="handleChange($event); onInputChange();"\n #textarea\n></textarea>\n\n<div *ngIf="maxchars" class="textarea-count" >{{limitdisplaytext}}</div>\n',providers:[a.provideAs(Re,i.NG_VALUE_ACCESSOR,!0),a.provideAs(Re,i.NG_VALIDATORS,!0),a.provideAsWidgetRef(Re)]}]}],Re.ctorParameters=function(){return[{type:t.Injector}]},Re.propDecorators={inputEl:[{type:t.ViewChild,args:["textarea",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var Ae=function(){function e(e,n){this.skipFloatPositionWidgets=["radioset","checkboxset","richtext","switch","chips","checkbox","slider","rating","toggle","upload"],this.elementRef=e.get(t.ElementRef),this.nativeEl=this.elementRef.nativeElement,this.app=n}return e.prototype.onBlurCb=function(){var e;this.inputEl.length>1&&this.inputEl.hasClass("mobile-input")&&_.forEach(this.inputEl,(function(t){$(t).hasClass("mobile-input")&&t.value&&(e=t.value)})),this.inputEl.val()||e||(this.compositeEle.classList.remove("float-active"),this.inputEl.removeAttr("placeholder"))},e.prototype.onFocusCb=function(){this.compositeEle.classList.add("float-active"),this.inputEl.attr("placeholder",this.placeholder)},e.prototype.checkForSelectPlaceholder=function(){!$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").is(":focus")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.nativeEl).find("select option:selected").text("")},e.prototype.setDefaultValueAnimation=function(){!this._isPlaceholderBound&&this.inputEl.attr("placeholder")&&(this.placeholder=this.inputEl.attr("placeholder"),this.inputEl.removeAttr("placeholder")),this.checkForSelectPlaceholder(),(this.inputEl.val()&&!this.inputEl.is("select")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.inputEl.parent("[widget-id]")).attr("datavalue.bind")||this.nativeEl.getAttribute("defaultvalue")||this.nativeEl.getAttribute("displayformat")||$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").attr("multiple"))&&this.compositeEle.classList.add("float-active")},e.prototype.observeForPlaceholderAttrChange=function(){var e=this;this._attrObserver=new MutationObserver((function(t){t.forEach((function(t){"placeholder"===t.attributeName&&e.inputEl.attr("placeholder")&&!e.compositeEle.classList.contains("float-active")&&(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder"))}))}));this._attrObserver.observe(this.inputEl[0],{attributes:!0,childList:!1,characterData:!1})},e.prototype.checkForRightAlignedForm=function(){var e=$(this.compositeEle);if(e.closest(".align-right").length&&e.find(".input-group-btn").length){var t=e.find("label");e.find("[wmdatetime]").length?t.addClass("input-grp-dt-icon"):t.addClass("input-grp-icon")}},e.prototype.ngAfterViewInit=function(){this.compositeEle=this.nativeEl;var e=this.nativeEl.widget,t=e.$attrs.get("captionposition");if(e.form&&(t=e.form.$attrs.get("captionposition"),this.compositeEle=this.nativeEl.querySelector(".app-composite-widget"),this._isPlaceholderBound=this.nativeEl.getAttribute("placeholder.bind")),"floating"===t){if(e.form){var n=this.nativeEl.getAttribute("widgettype");this.skipFloatPositionWidgets.indexOf(n)>-1&&(this.compositeEle.classList.remove("caption-floating"),this.compositeEle.classList.add("caption-top")),this.checkForRightAlignedForm()}this.inputEl=$(this.nativeEl).find("input, select, textarea"),this._isPlaceholderBound||(this._isPlaceholderBound=this.inputEl.closest("[widget-id]").attr("placeholder.bind")),setTimeout(this.setDefaultValueAnimation.bind(this),0),this.inputEl.focus(this.onFocusCb.bind(this)),this.inputEl.blur(this.onBlurCb.bind(this)),this._isPlaceholderBound&&this.observeForPlaceholderAttrChange()}},e.prototype.ngOnInit=function(){var e=this;this.labelAnimationSubscription=this.app.subscribe("captionPositionAnimate",(function(t){var n=e.inputEl&&e.inputEl.is(":focus");if(t.displayVal||t.isFocused||t.isSelectMultiple||n)t.nativeEl.addClass("float-active"),!t.displayVal&&n&&e.inputEl.attr("placeholder",e.placeholder);else if(t.nativeEl.removeClass("float-active"),e.inputEl){var i=e.inputEl.find("option:first");(e.inputEl.attr("placeholder")||i.text())&&(i.length?i.text(""):(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder")))}}))},e.prototype.ngOnDestroy=function(){this.labelAnimationSubscription&&this.labelAnimationSubscription(),this._attrObserver&&this._attrObserver.disconnect()},e}();Ae.decorators=[{type:t.Directive,args:[{selector:"[captionPosition]"}]}],Ae.ctorParameters=function(){return[{type:t.Injector},{type:r.App}]};var Te=[m,v,Ae,T,x,L,W,H,Z,te,ae,ce,he,ve,Pe,Re],Se=function(){};Se.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,a.WmComponentsModule,o.IMaskModule],declarations:d([],p(Te)),exports:d([],p(Te)),entryComponents:[]}]}],e.BaseFormComponent=y,e.BaseFormCustomComponent=w,e.ButtonComponent=m,e.ButtonGroupDirective=v,e.CaptionPositionDirective=Ae,e.CheckboxComponent=T,e.CheckboxsetComponent=x,e.CompositeDirective=L,e.DatasetAwareFormComponent=S,e.InputCalendarComponent=ae,e.InputColorComponent=ce,e.InputEmailComponent=he,e.InputModule=Se,e.InputNumberComponent=ve,e.InputTextComponent=Pe,e.NumberComponent=W,e.NumberLocale=G,e.RadiosetComponent=H,e.SelectComponent=Z,e.SwitchComponent=te,e.TextareaComponent=Re,e["\u02750"]=A,e["\u0275a"]=u,e["\u0275b"]=f,e["\u0275c"]=O,e["\u0275d"]=I,e["\u0275e"]=N,e["\u0275f"]=B,e["\u0275g"]=j,e["\u0275h"]=q,e["\u0275i"]=K,e["\u0275j"]=X,e["\u0275k"]=ie,e["\u0275l"]=se,e["\u0275m"]=de,e["\u0275n"]=fe,e["\u0275o"]=be,e["\u0275p"]=Oe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@wm/core"),require("@wm/components/base"),require("@angular/common")):"function"==typeof define&&define.amd?define("@wm/components/basic",["exports","@angular/core","@wm/core","@wm/components/base","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic={}),e.ng.core,e.wm.core,e.wm.components.base,e.ng.common)}(this,(function(e,t,n,i,o){"use strict";
58
58
  /*! *****************************************************************************
59
59
  Copyright (c) Microsoft Corporation.
60
60
 
@@ -17083,7 +17083,9 @@
17083
17083
  };
17084
17084
  BaseFormCustomComponent.prototype.invokeOnChange = function(value, $event, valid) {
17085
17085
  this._onChange(value);
17086
- _super.prototype.invokeOnChange.call(this, value, $event);
17086
+ if (valid) {
17087
+ _super.prototype.invokeOnChange.call(this, value, $event);
17088
+ }
17087
17089
  };
17088
17090
  BaseFormCustomComponent.prototype.invokeOnTouched = function($event) {
17089
17091
  this._onTouched();
@@ -54,7 +54,7 @@
54
54
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
55
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
56
  PERFORMANCE OF THIS SOFTWARE.
57
- ***************************************************************************** */var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function u(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var d=function(){r.register("wm-button",new Map([["animation",r.PROP_STRING],["badgevalue",r.PROP_STRING],["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["iconclass",r.PROP_STRING],["iconheight",r.PROP_STRING],["iconmargin",r.PROP_STRING],["iconposition",r.PROP_STRING],["iconurl",r.PROP_STRING],["iconwidth",r.PROP_STRING],["name",r.PROP_STRING],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",r.PROP_STRING]]))},h={widgetType:"wm-button",hostClass:"btn app-button",displayType:r.DISPLAY_TYPE.INLINE_BLOCK},m=function(e){function t(t){var n=e.call(this,t,h)||this;return r.styler(n.nativeElement,n),n}return c(t,e),t}(r.StylableComponent);m.initializeProps=d(),m.decorators=[{type:t.Component,args:[{selector:"button[wmButton]",template:'<img data-identifier="img" alt="button image" class="button-image-icon" [src]="iconurl | image" *ngIf="iconurl" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin}"/>\n<i class="app-icon {{iconclass}}" aria-hidden="true" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin, fontSize:iconwidth}" *ngIf="iconclass"></i>\n<span class="sr-only" *ngIf="iconclass">{{caption}} {{appLocale.LABEL_ICON}}</span>\n<span class="btn-caption" [innerHTML]="caption"></span>\n<ng-content select=".caret"></ng-content>\n<span *ngIf="badgevalue" class="badge pull-right" [textContent]="badgevalue"></span>\n',providers:[r.provideAsWidgetRef(m)],exportAs:"wmButton"}]}],m.ctorParameters=function(){return[{type:t.Injector}]},m.propDecorators={type:[{type:t.HostBinding,args:["type"]}],tabindex:[{type:t.HostBinding,args:["tabIndex"]}],disabled:[{type:t.HostBinding,args:["disabled"]}],shortcutkey:[{type:t.HostBinding,args:["attr.accesskey"]}],iconposition:[{type:t.HostBinding,args:["attr.icon-position"]}]};var f=function(){r.register("wm-buttongroup",new Map([["class",r.PROP_STRING],["name",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["vertical",r.PROP_BOOLEAN]]))},g={widgetType:"wm-buttongroup",hostClass:"btn-group app-button-group"},v=function(e){function t(t){var n=e.call(this,t,g)||this;return r.styler(n.nativeElement,n,r.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.handleClick=function(e){var t=$(e.target).closest(".app-button");this.$element.find(".app-button").removeClass("selected"),t.addClass("selected")},t}(r.StylableComponent);v.initializeProps=f(),v.decorators=[{type:t.Directive,args:[{selector:"[wmButtonGroup]",providers:[r.provideAsWidgetRef(v)]}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={vertical:[{type:t.HostBinding,args:["class.btn-group-vertical"]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var y=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.inj=t,o.binddatavalue=o.$element.attr("datavalue.bind"),o}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.dataval},set:function(e){this.dataval=e},enumerable:!1,configurable:!0}),t.prototype.updateBoundVariable=function(e){var t=this.binddatavalue;this.datavaluesource&&this.datavaluesource.execute(a.DataSource.Operation.IS_API_AWARE)||this.datavaluesource&&!this.datavaluesource.twoWayBinding||!t||t.startsWith("Widgets.")||t.startsWith("itemRef.currentItemWidgets")||(t=t.replace(/\[\$i\]/g,"[0]"),_.has(this.context,t.split(".")[0])?_.set(this.context,t,e):_.set(this.viewParent,t,e))},t.prototype.invokeOnChange=function(e,t){t&&this.datavalue!==this.prevDatavalue&&(this.updateBoundVariable(e),this.invokeEventCallback("change",{$event:t,newVal:e,oldVal:this.prevDatavalue})),this.prevDatavalue=e},t.prototype.updatePrevDatavalue=function(e){this.prevDatavalue=e},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),$(this.nativeElement).parents().closest("[wmList]").length&&this.$element.keydown((function(e){37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode||e.stopPropagation()}))},t}(r.StylableComponent);function b(e){return function(t){return e?function(e){switch(typeof e){case"object":return!(!e||!e.length&&!Object.keys(e).length);case"number":return!!e||0===e;default:return!(null==e||""===e)}}(t.value)?null:{required:!0}:null}}y.decorators=[{type:t.Injectable}],y.ctorParameters=function(){return[{type:t.Injector},{type:void 0},{type:Promise}]};var w=function(e){function t(){var t=e.apply(this,u([],p(arguments)))||this;return t._onChange=function(){},t._onTouched=function(){},t}return c(t,e),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this._formControl=this.inj.get(i.FormControlName,null)},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.writeValue=function(e){this.isDestroyed||(this._formControl&&(this.datavalue=e,this.onPropertyChange("datavalue",e),this.updatePrevDatavalue(e)),e!==this.datavalue&&this._onChange(this.datavalue))},t.prototype.invokeOnChange=function(t,n,i){this._onChange(t),e.prototype.invokeOnChange.call(this,t,n)},t.prototype.invokeOnTouched=function(e){this._onTouched(),e&&this.invokeEventCallback("blur",{$event:e})},t.prototype.invokeOnFocus=function(e){this.invokeEventCallback("focus",{$event:e})},t.prototype.validate=function(e){return this.show?b(this.required)(e):null},t}(y);w.decorators=[{type:t.Injectable}];var P=new Map([["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["checkedvalue",Object.assign({value:!0},r.PROP_STRING)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["name",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["uncheckedvalue",Object.assign({value:!1},r.PROP_STRING)]]),O=function(){r.register("wm-checkbox",P),r.registerFormWidget(a.FormWidgetType.CHECKBOX,P),r.registerFormWidget(a.FormWidgetType.TOGGLE,P)},S={widgetType:"wm-checkbox",hostClass:"app-checkbox checkbox"},E=function(e,t){if(null===e)return t;if(!0===e||"true"===e)return!0;if(!1===e||"false"===e)return!1;var n=parseInt(e,10);return isNaN(n)?e:n},T=E,C=function(e){function t(t,n,i,o){var r=e.call(this,t,S)||this;return r.type=o,r._caption="&nbsp",r._checkedvalue=E(n,!0),r._uncheckedvalue=E(i,!1),a.toggleClass(r.nativeElement,"app-toggle","toggle"===o),r}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return a.isDefined(this.proxyModel)?this.proxyModel?this._checkedvalue:this._uncheckedvalue:void 0},set:function(e){this.proxyModel=a.isDefined(e)&&""!==e?e===this._checkedvalue:void 0,this.updatePrevDatavalue(this.datavalue)},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"caption"===t?a.isDefined(n)&&""!==n?this._caption=n:this._caption="&nbsp;":"checkedvalue"===t?this._checkedvalue=E(n,!0):"uncheckedvalue"===t?this._uncheckedvalue=E(n,!1):"datavalue"===t?(this.datavalue=E(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.handleEvent=function(t,n,i,o){if("change"!==n&&"blur"!==n){var r="tap"===n?this.nativeElement.querySelector("label"):this.checkboxEl.nativeElement;e.prototype.handleEvent.call(this,r,n,i,o)}},t.prototype.handleChange=function(e){this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.onKeyDown=function(e){e.preventDefault(),this.checkboxEl.nativeElement.click()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement.querySelector("label"),this)},t}(w);C.initializeProps=O(),C.decorators=[{type:t.Component,args:[{selector:"[wmCheckbox]",template:'<label [ngClass]="{\'unchecked\': !proxyModel, \'disabled\': (disabled || readonly), \'required\': (required && _caption)}">\n <input type="checkbox"\n role="checkbox"\n #checkbox\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-checked]="!!proxyModel"\n focus-target\n [(ngModel)]="proxyModel"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled || readonly"\n [attr.accesskey]="shortcutkey"\n [tabindex]="tabindex"\n (blur)="invokeOnTouched($event)"\n (ngModelChange)="handleChange($event)">\n <span class="caption" [innerHtml]="_caption"></span>\n <img alt="Checkbox Image" aria-hidden="true" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="switch"/>\n</label>\n<input type="hidden" class="ng-hide model-holder" aria-hidden="true" tabindex="-1" [disabled]="disabled" [value]="proxyModel">\n',providers:[r.provideAs(C,i.NG_VALUE_ACCESSOR,!0),r.provideAs(C,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(C)]}]}],C.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["checkedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["uncheckedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["type"]}]}]},C.propDecorators={ngModel:[{type:t.ViewChild,args:[i.NgModel]}],checkboxEl:[{type:t.ViewChild,args:["checkbox",{static:!0,read:t.ElementRef}]}],onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var A=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;return o.groupby=i,o.datasetItems=[],o.acceptsArray=!1,o.dataset$=new s.Subject,o.datavalue$=new s.Subject,o.allowempty=!0,o._debounceDatavalueUpdation=_.debounce((function(e){!a.isDefined(o._modelByKey)||_.isArray(o._modelByKey)&&!o._modelByKey.length?(o.toBeProcessedDatavalue=e,o._modelByValue=""):a.isDefined(o.toBeProcessedDatavalue)&&(a.isDefined(o._modelByValue)||(o._modelByValue=!o.multiple&&_.isArray(o.toBeProcessedDatavalue)?o.toBeProcessedDatavalue[0]:o.toBeProcessedDatavalue),o.toBeProcessedDatavalue=void 0),o.initDisplayValues()}),150),o.datePipe=o.inj.get(r.ToDatePipe),o.appDefaults=o.inj.get(a.AppDefaults),o.binddisplayexpression=o.nativeElement.getAttribute("displayexpression.bind"),o.binddisplayimagesrc=o.nativeElement.getAttribute("displayimagesrc.bind"),o.binddisplaylabel=o.nativeElement.getAttribute("displaylabel.bind"),o._debouncedInitDatasetItems=a.debounce((function(){o.initDatasetItems(),a.$appDigest()}),150),o.handleHeaderClick=a.noop,o.cancelLocaleChangeSubscription=o.getAppInstance().subscribe("locale-changed",(function(){o._debouncedInitDatasetItems()})),o}return c(t,e),Object.defineProperty(t.prototype,"modelByKey",{get:function(){return this._modelByKey},set:function(e){this.selectByKey(e),this.invokeOnChange(this._modelByValue)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this._modelByValue},set:function(e){this.multiple&&(e=r.extractDataAsArray(e)),this._modelByValue=e,this.selectByValue(e),this.datavalue$.next(e),this.invokeOnChange(e,void 0,!0)},enumerable:!1,configurable:!0}),t.prototype.selectByKey=function(e){var t=this;if(this.resetDatasetItems(),this.datasetItems.length){if(this.multiple&&!_.isArray(e)&&(e=[e]),this._modelByKey=e,this.multiple)this._modelByValue=[],e.forEach((function(e){var n=_.find(t.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,t._modelByValue=u(u([],p(t._modelByValue)),[n.value]))}));else{this._modelByValue="";var n=_.find(this.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,this._modelByValue=n.value)}this.initDisplayValues()}},t.prototype.selectByValue=function(e){var t=this;if(this.resetDatasetItems(),!(!a.isDefined(e)||""===e||_.isNull(e)||e instanceof Array&&!e.length)||(this._modelByKey=void 0,this.allowempty&&a.isDefined(e)))if(this.acceptsArray&&!_.isArray(e)&&(e=this.allowempty?[e]:r.extractDataAsArray(e)),this.datasetItems.length||!a.isDefined(e)){var n=this.datafield===r.ALLFIELDS?"dataObject":"key";if(_.isArray(e))this._modelByKey=[],e.forEach((function(e){var i=_.find(t.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?a.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,t._modelByKey.push(i.key))}));else{this._modelByKey=void 0;var i=_.find(this.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?a.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,this._modelByKey=i.key)}this._debounceDatavalueUpdation(e)}else this.toBeProcessedDatavalue=e},t.prototype.initDisplayValues=function(){var e=[];this.datasetItems.forEach((function(t){t.selected&&e.push(t.label)})),this.displayValue=this.multiple?e:e[0]||""},t.prototype.initDatasetItems=function(){if(!this.dataset||_.isEmpty(this.dataset))return this.datasetItems=[],void this.dataset$.next(this.datasetItems);var e=r.getOrderedDataset(r.convertDataToObject(this.dataset),this.orderby);if(this.usekeys)this.datasetItems=r.transformDataWithKeys(e);else{var t=r.transformFormData(this.viewParent,e,this.datafield,{displayField:this.displayfield||this.displaylabel,displayExpr:this.displayexpression,bindDisplayExpr:this.binddisplayexpression||this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc});this.datasetItems=u([],p(r.getUniqObjsByDataField(t,this.datafield,this.displayfield||this.displaylabel,a.toBoolean(this.allowempty))))}this.postDatasetItemsInit()},t.prototype.postDatasetItemsInit=function(){if(this.datasetItems.length&&!this._defaultQueryInvoked){var e=_.isEmpty(this.toBeProcessedDatavalue)?this.datavalue:this.toBeProcessedDatavalue;this.selectByValue(e)}this.dataset$.next(this.datasetItems)},t.prototype.resetDatasetItems=function(){this.datasetItems.forEach((function(e){return e.selected=!1}))},t.prototype.setTemplate=function(e){this.content=e,this.viewParent&&this.viewParent.prefabName&&(this.prefabName=this.viewParent.prefabName)},t.prototype.getGroupedData=function(){return this.datasetItems.length?r.groupData(this,r.convertDataToObject(this.datasetItems),this.groupby,this.match,this.orderby,this.dateformat,this.datePipe,"dataObject",this.appDefaults):[]},t.prototype.datasetSubscription=function(){var e=this,t=this.dataset$.subscribe((function(){e.groupedData=e.getGroupedData()}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.setGroupData=function(){this.datasetSubscription(),this.groupedData=this.getGroupedData()},t.prototype.onPropertyChange=function(t,n,i){switch(e.prototype.onPropertyChange.call(this,t,n,i),t){case"dataset":case"datafield":case"displayfield":case"displaylabel":case"displayexpression":case"orderby":case"usekeys":this._debouncedInitDatasetItems();break;case"required":case"datavalue":this._onChange(this.datavalue);break;case"groupby":case"match":"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData()}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.groupby&&"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData(),this.groupby&&this.collapsible&&(this.handleHeaderClick=r.handleHeaderClick,this.toggleAllHeaders=r.toggleAllHeaders.bind(void 0,this))},t.prototype.ngOnDestroy=function(){this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription()},t}(w);A.decorators=[{type:t.Injectable}],A.ctorParameters=function(){return[{type:t.Injector},null,{type:String,decorators:[{type:t.Attribute,args:["groupby"]}]}]};var R=new Map([["class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["itemclass",Object.assign({value:""},r.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},r.PROP_STRING)],["listclass",Object.assign({value:""},r.PROP_STRING)],["match",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},r.PROP_STRING)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),I=function(){r.register("wm-checkboxset",R),r.registerFormWidget(a.FormWidgetType.CHECKBOXSET,new Map(R))},D={widgetType:"wm-checkboxset",hostClass:"app-checkboxset list-group inline"},N=function(e){function t(t){var n=e.call(this,t,D)||this;return n.layout="",r.styler(n.nativeElement,n),n.multiple=!0,n}return c(t,e),t.prototype.onCheckboxLabelClick=function(e,t){if($(e.target).is("input")){var n=this.nativeElement.querySelectorAll("input:checked"),i=[];_.forEach(n,(function(e){i.push(e.value)})),this.modelByKey=i,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)}},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onKeyDown=function(e){e.preventDefault(),e.target.click()},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"itemsperrow"===t?a.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t}(A);N.initializeProps=I(),N.decorators=[{type:t.Component,args:[{selector:"[wmCheckboxset]",exportAs:"wmCheckboxset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'checkbox\', \'app-checkbox\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems; let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group" role="presentation">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'checkbox\', \'app-checkbox\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[r.provideAs(N,i.NG_VALUE_ACCESSOR,!0),r.provideAs(N,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(N)]}]}],N.ctorParameters=function(){return[{type:t.Injector}]},N.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var x=function(){r.register("wm-form-group",new Map([["captionposition",r.PROP_STRING],["name",r.PROP_STRING],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)]]))},k={widgetType:"wm-form-group",hostClass:"form-group app-composite-widget clearfix"},M={left:"caption-left",right:"caption-right",top:"caption-top",floating:"caption-floating"},L=function(e){function t(t){var n=e.call(this,t,k)||this;return r.styler(n.nativeElement,n,r.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"captionposition"===t?a.switchClass(this.nativeElement,M[n],M[i]):"required"===t?(this.required=n,this.assignRequiredToSubComponents()):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.assignRequiredToSubComponents=function(){var e=this;this.required&&this.componentRefs&&setTimeout((function(){e.componentRefs.forEach((function(e){return e.widget.required=!0}))}),50)},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.addForIdAttributes(this.nativeElement),this.assignRequiredToSubComponents()},t}(r.StylableComponent);L.initializeProps=x(),L.decorators=[{type:t.Directive,args:[{selector:"div[wmComposite]",providers:[r.provideAsWidgetRef(L)]}]}],L.ctorParameters=function(){return[{type:t.Injector}]},L.propDecorators={componentRefs:[{type:t.ContentChildren,args:[r.WidgetRef,{descendants:!0}]}]};var F=new Map([["autofocus",r.PROP_BOOLEAN],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["localefilter",r.PROP_STRING],["minvalue",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["numberfilter",r.PROP_STRING],["placeholder",Object.assign({value:"Enter number"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",Object.assign({value:1},r.PROP_NUMBER)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["trailingzero",Object.assign({value:!1},r.PROP_BOOLEAN)],["updateon",r.PROP_STRING],["inputmode",Object.assign({value:"natural"},r.PROP_STRING)]]),j=function(){r.register("wm-number",F),r.registerFormWidget(a.FormWidgetType.NUMBER,new Map(F))},B=function(e){function t(t,n){var i=e.call(this,t,n)||this;i.ngModelOptions={updateOn:""};var o=i.nativeElement.getAttribute("updateon")||"blur";return o="default"===o?"change":o,i.ngModelOptions.updateOn=o,i}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"===t&&this._onChange(this.datavalue),"class"===t?this.inputEl.nativeElement&&a.switchClass(this.inputEl.nativeElement,n,i):"datavalue"===t?(this.updatePrevDatavalue(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.handleChange=function(e){this.autotrim&&this.datavalue&&_.isString(this.datavalue)&&(this.datavalue=this.datavalue.trim()),this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.handleEvent=function(t,n,i,o){"change"!==n&&"blur"!==n&&e.prototype.handleEvent.call(this,this.inputEl.nativeElement,n,i,o)},t.prototype.handleBlur=function(e){this.invokeOnTouched(e)},t.prototype.flushViewChanges=function(e){var t=_.get(this.imask,"maskRef.unmaskedValue");e=t||e,this.ngModel.update.next(e),a.$appDigest()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.class&&a.addClass(this.inputEl.nativeElement,this.class),r.styler(this.inputEl.nativeElement,this)},t}(w);B.decorators=[{type:t.Injectable}],B.ctorParameters=function(){return[{type:t.Injector},{type:void 0}]};var G=function(e){function t(t,i,o,r){var a=e.call(this,t,i)||this;return a.i18nService=o,a.trailingZeroDecimalPipe=r,a.isDefaultQuery=!0,a.decimalValue="",a.selectedLocale=o.getSelectedLocale(),a.DECIMAL=n.getLocaleNumberSymbol(a.localefilter||a.selectedLocale,n.NumberSymbol.Decimal),a.GROUP=n.getLocaleNumberSymbol(a.localefilter||a.selectedLocale,n.NumberSymbol.Group),a.numberfilter="1.0-16",a.resetValidations(),a}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.proxyModel},set:function(e){if(this.lastValIsDecimal=!1,_.includes([null,void 0,""],e)){var t=this.inputEl.nativeElement,n=this.prevDatavalue;return this.displayValue=t.value=this.proxyModel=null,this.resetValidations(),void(n&&!this.isDefaultQuery&&(this.handleChange(e),this._onChange()))}if(this.isDefaultQuery){var i=_.isString(e)&&_.includes(e,this.DECIMAL),o=i?e.split(this.DECIMAL):_.isString(e)&&e.split(".");this.decimalValue=o[1]||"",e=i?e:this.transformNumber(e)}var r,a=e.toString();r=/\d/.test(a)?this.parseNumber(a):NaN,_.isNaN(r)&&a[a.length-1]===this.DECIMAL&&"change"===this.ngModelOptions.updateOn&&this.$element.find("input:focus").length&&(this.lastValIsDecimal=!0),!this.lastValIsDecimal&&this.isValid(r)?(this.proxyModel=r,this.updateDisplayText(),this.isDefaultQuery||this.handleChange(r)):(this.displayValue=e.toString(),this.proxyModel=null,this.handleChange(null))},enumerable:!1,configurable:!0}),t.prototype.resetValidations=function(){this.isInvalidNumber=!1,this.numberNotInRange=!1},t.prototype.isValid=function(e){return _.isNaN(e)||!_.isFinite(e)||!Number.isInteger(this.step)&&this.countDecimals(e)>this.countDecimals(this.step)?(this.isInvalidNumber=!0,!1):e!==this.getValueInRange(e)?(this.numberNotInRange=!0,!0):(this.resetValidations(),!0)},t.prototype.getValueInRange=function(e){return!_.isNaN(this.minvalue)&&e<this.minvalue?(this.validateType="minvalue",this.minvalue):!_.isNaN(this.maxvalue)&&e>this.maxvalue?(this.validateType="maxvalue",this.maxvalue):e},t.prototype.transformNumber=function(e,t){var n,i=t||this.numberfilter;return this.trailingZeroDecimalPipe.transform(e,this.selectedLocale,i,this.localefilter,this.trailingzero,this.decimalValue,!!t,null===(n=this.i18nService)||void 0===n?void 0:n.getwidgetLocale())},t.prototype.resetCursorPosition=function(e){var t=this.inputEl.nativeElement,n=t.value.length-e;n=n<0?0:n,t.setSelectionRange(n,n)},t.prototype.parseNumber=function(e){var t=e.split(this.inputmode===r.INPUTMODE.FINANCIAL?e.indexOf(this.DECIMAL)>-1?this.DECIMAL:".":this.DECIMAL);if(!t.length)return null;if(t.length>2)return NaN;if(""===t[1])return NaN;var n=Number(t[0].split(this.GROUP).join("")),i=Number("0."+(t[1]||0));if(Number.isNaN(n)||Number.isNaN(i))return NaN;var o=t.length>1?parseFloat((n+i).toFixed(t[1].length)):n+i;return 0===n?Object.is(0,n)?o:n-i:n>0?o:n-i},t.prototype.updateDisplayText=function(){var e=this.inputEl.nativeElement,t=e.selectionStart,n=e.value;if(!this.isDefaultQuery){var i=n.split(this.DECIMAL);this.decimalValue=i[1]||""}var o=this.stepLength();this.inputmode===r.INPUTMODE.FINANCIAL&&o?(this.displayValue=e.value=this.transformNumber(this.proxyModel,"1."+o+"-"+o),this.decimalValue=this.decimalValue.replace(/\D/g,"")):this.displayValue=e.value=this.transformNumber(this.proxyModel),"default"!==this.updateon||this.isDefaultQuery||this.resetCursorPosition(n.length-t)},t.prototype.stepLength=function(){var e=this.step.toString().split(".");return 1===e.length?void 0:e[1].length},t.prototype.isNaturalCurrency=function(){return this.inputmode===r.INPUTMODE.NATURAL&&"wm-currency"===this.widgetType&&!!this.trailingzero},t.prototype.onInputChange=function(e){var t=this.stepLength();if(a.isDefined(e)&&(""!==e||this.datavalue)&&(this.handleChange(e),t&&this.inputmode===r.INPUTMODE.FINANCIAL)){var n;if(this.isDefaultQuery)n=parseFloat(e);else n=parseInt(e.toString().replace(/\D/g,""))*this.step;_.isNaN(n)?"blur"!==this.ngModelOptions.updateOn&&(this.datavalue=void 0,this.handleChange(null)):"change"===this.ngModelOptions.updateOn?(this.datavalue=parseFloat(n.toFixed(t)),this.handleChange(this.datavalue)):this.displayValue=n.toFixed(t)}},t.prototype.checkForTrailingZeros=function(e){var t=this.stepLength(),n=!this.trailingzero&&this.inputmode===r.INPUTMODE.FINANCIAL;if(this.lastValIsDecimal&&this.onModelChange(this.displayValue),(n||this.isNaturalCurrency())&&t&&this.datavalue){var i=void 0;(n&&"focus"===e.type||this.isNaturalCurrency()&&"blur"===e.type)&&(i="1."+t+"-"+t),this.displayValue=this.transformNumber(this.datavalue,i)}},t.prototype.countDecimals=function(e){if(e%1!=0){var t=e.toString().split(".")[1];return t&&t.length}return 0},t.prototype.onArrowPress=function(e,t){if(e.preventDefault(),!this.readonly&&0!==this.step){var n,i,o=e.target.value.replace(/,/g,"");if(n=o&&!_.isNaN(parseFloat(o))?parseFloat(o):this.proxyModel,this.numberNotInRange){var r=this.parseNumber(this.inputEl.nativeElement.value);_.isNaN(r)||(i=this.getValueInRange(r),n=r,this.resetValidations())}else _.isUndefined(n)||_.isNull(n)?(n=i=this.getValueInRange(this.minvalue||0),this.resetValidations()):i=this.getValueInRange(n+("UP"===t?this.step:-this.step));if("UP"===t&&n<=i||"DOWN"===t&&n>=i){var a=Math.max(this.countDecimals(n),this.countDecimals(this.step));this.proxyModel=_.round(i,a),this.updateDisplayText(),this.handleChange(this.proxyModel)}}},t.prototype.validate=function(e){return this.isInvalidNumber?(this.validateType="",{invalidNumber:{valid:!1}}):this.numberNotInRange?{numberNotInRange:{valid:!1}}:(this.validateType="",this.show&&this.required?e.value||0===e.value?null:{required:!0}:null)},t.prototype.validateInputEntry=function(e){if(this.isDefaultQuery=!1,!e.ctrlKey&&!_.includes(["Backspace","ArrowRight","ArrowLeft","Tab","Enter","Delete"],e.key)){var t=new RegExp("^[\\d\\s-,.e+"+this.GROUP+this.DECIMAL+"]$","i"),n=e.target.value,i=this.inputmode===r.INPUTMODE.FINANCIAL;if(n)if(parseInt(n.toString().replace(/\D/g,"")).toString().length>15){var o=window.getSelection();return!(!o||!o.toString()||o.focusNode!==this.nativeElement)}return!(!i&&n&&this.countDecimals(this.step)&&this.countDecimals(n)>=this.countDecimals(this.step)&&e.target.selectionStart>=n.length-1)&&(!!t.test(e.key)&&((!_.includes(n,",")||","!==n[n.length-1]||","!==e.key)&&((!_.includes(n,this.DECIMAL)||e.key!==this.DECIMAL)&&((!_.intersection(_.toArray(n),["e","E"]).length||!_.includes("eE",e.key))&&((!_.includes(n,"+")&&!_.includes(n,"-")||"+"!==e.key&&"-"!==e.key)&&(!(!n&&"Space"===e.code)&&void 0))))))}},t.prototype.onBackspace=function(e){this.isDefaultQuery=!1},t.prototype.onEnter=function(e){this.datavalue=e.target.value},t.prototype.onModelChange=function(e){(this.inputmode===r.INPUTMODE.NATURAL||this.inputmode===r.INPUTMODE.FINANCIAL&&"blur"===this.ngModelOptions.updateOn)&&(this.datavalue=e)},t.prototype.onPropertyChange=function(t,n,i){"minvalue"===t||"maxvalue"===t?this.isValid(n):"datavalue"!==t||i?e.prototype.onPropertyChange.call(this,t,n,i):this.isNaturalCurrency()?this.checkForTrailingZeros({type:"blur"}):this.onInputChange(n)},t}(B),V={widgetType:"wm-number",hostClass:"app-input-wrapper"},U=function(e){function t(t,n,i){return e.call(this,t,V,n,i)||this}return c(t,e),t}(G);U.initializeProps=j(),U.decorators=[{type:t.Component,args:[{selector:"[wmNumber]",template:'<input class="form-control app-textbox app-number-input"\n inputmode="decimal"\n focus-target\n [attr.name]="name"\n role="textbox"\n type="text"\n [ngModel]="displayValue"\n [readonly]="readonly"\n [disabled]="disabled"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (ngModelChange)="onModelChange($event)"\n (blur)="handleBlur($event); checkForTrailingZeros($event);"\n (focus)="checkForTrailingZeros($event)"\n (input)="onInputChange($event.target.value)"\n [ngModelOptions]="ngModelOptions"\n [required]="required"\n (keypress)="validateInputEntry($event)"\n (keydown.backspace)="onBackspace($event)"\n (keydown.enter)="onEnter($event)"\n (keydown.ArrowUp)="onArrowPress($event, \'UP\')"\n (keydown.ArrowDown)="onArrowPress($event, \'DOWN\')"\n #input>\n',providers:[r.provideAs(U,i.NG_VALUE_ACCESSOR,!0),r.provideAs(U,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(U)]}]}],U.ctorParameters=function(){return[{type:t.Injector},{type:a.AbstractI18nService},{type:r.TrailingZeroDecimalPipe}]},U.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel,{static:!0}]}]};var W=new Map([["class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_ANY],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["itemclass",Object.assign({value:""},r.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},r.PROP_STRING)],["listclass",Object.assign({value:""},r.PROP_STRING)],["match",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},r.PROP_STRING)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),q=function(){r.register("wm-radioset",W),r.registerFormWidget(a.FormWidgetType.RADIOSET,new Map(W))},z={widgetType:"wm-radioset",hostClass:"app-radioset list-group inline"},H=function(e){function t(t){var n=e.call(this,t,z)||this;return n.layout="",r.styler(n.nativeElement,n),n.multiple=!1,n}return c(t,e),t.prototype.onRadioLabelClick=function(e,t){$(e.target).is("input")&&(this.modelByKey=t,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0))},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("itemsperrow"===t?a.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i))},t}(A);H.initializeProps=q(),H.decorators=[{type:t.Component,args:[{selector:"[wmRadioset]",exportAs:"wmRadioset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'radio\', \'app-radio\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems;let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" aria-readonly="true" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'radio\', \'app-radio\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[r.provideAs(H,i.NG_VALUE_ACCESSOR,!0),r.provideAs(H,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(H)]}]}],H.ctorParameters=function(){return[{type:t.Injector}]};var Y=new Map([["autofocus",r.PROP_BOOLEAN],["class",Object.assign({value:""},r.PROP_STRING)],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",r.PROP_ANY],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["hint",r.PROP_STRING],["match",r.PROP_STRING],["multiple",Object.assign({value:!1},r.PROP_BOOLEAN)],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["placeholder",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),K=function(){r.register("wm-select",Y),r.registerFormWidget(a.FormWidgetType.SELECT,new Map(Y)),r.registerFormWidget(a.FormWidgetType.TYPEAHEAD,new Map(Y))},Q={widgetType:"wm-select",hostClass:"app-select-wrapper"},X=function(e){function t(t){var n=e.call(this,t,Q)||this;return n.acceptsArray=!0,n}return c(t,e),Object.defineProperty(t.prototype,"datasource",{set:function(e){e&&e.execute&&e.execute(a.DataSource.Operation.IS_BOUND_TO_LOCALE)&&(this.datavalue=e.execute(a.DataSource.Operation.GET_DEFAULT_LOCALE))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.selectEl.nativeElement,this)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","change"],n)||e.prototype.handleEvent.call(this,this.selectEl.nativeElement,n,i,o)},t.prototype.onSelectValueChange=function(e){if(this.readonly)return this.placeholder?this.selectEl.nativeElement.value=this.placeholder:this.selectEl.nativeElement.value="",void(this.datavalue=this.prevDatavalue);this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)},t.prototype.onPropertyChange=function(t,n,i){"required"!==t?"class"!==t&&"tabindex"!==t&&("readonly"===t&&(!0===n?a.setAttr(this.selectEl.nativeElement,"readonly","readonly"):a.removeAttr(this.selectEl.nativeElement,"readonly")),e.prototype.onPropertyChange.call(this,t,n,i)):this._onChange(this.datavalue)},t.prototype.checkForFloatingLabel=function(e){var t=$(this.selectEl.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&("focus"===e.type&&(!this.datavalue||this.datavalue&&""===$(this.selectEl).find("select option:selected").text()&&this.placeholder)?$(this.selectEl.nativeElement).find("option:first").text(this.placeholder):this.datavalue||($(this.selectEl.nativeElement).find("option:selected").text(""),t.removeClass("float-active")))},t}(A);X.initializeProps=K(),X.decorators=[{type:t.Component,args:[{selector:"wm-select",template:'<select role="listbox" aria-haspopup="true" aria-expanded="false" #select\n focus-target\n [ngClass]="[\'app-select form-control\', class]"\n [disabled]="disabled"\n [required]="required"\n [tabindex]="tabindex"\n [(ngModel)]="modelByKey"\n [multiple]="multiple"\n (change)="onSelectValueChange($event)"\n (focus)="checkForFloatingLabel($event)"\n (blur)="invokeOnTouched($event); checkForFloatingLabel($event)"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-multiselectable]="multiple"\n [autofocus]="autofocus"\n>\n <option selected\n value="undefined"\n [textContent]="placeholder"\n [hidden]="!placeholder"></option>\n\n <ng-container *ngIf="groupby">\n <optgroup *ngFor="let groupObj of groupedData"\n [label]="groupObj.key">\n <option *ngFor="let item of groupObj.data;"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </optgroup>\n </ng-container>\n\n <ng-container *ngIf="!groupby">\n <option *ngFor="let item of datasetItems"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </ng-container>\n</select>\n',providers:[r.provideAs(X,i.NG_VALUE_ACCESSOR,!0),r.provideAs(X,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(X)]}]}],X.ctorParameters=function(){return[{type:t.Injector}]},X.propDecorators={selectEl:[{type:t.ViewChild,args:["select",{static:!0,read:t.ElementRef}]}]};var J=new Map([["class",r.PROP_STRING],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"yes, no, maybe"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["hint",r.PROP_STRING],["iconclass",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)]]),Z=function(){r.register("wm-switch",J),r.registerFormWidget(a.FormWidgetType.SWITCH,new Map(J)),r.registerFormWidget(a.FormWidgetType.TOGGLE,new Map(J))},ee={widgetType:"wm-switch",hostClass:"app-switch"},te=function(e){function t(t){var n=e.call(this,t,ee)||this;n.options=[],n._debounceSetSelectedValue=a.debounce((function(e){n.setSelectedValue(),n.updateHighlighter(e),e&&a.$appDigest()}),200);var i=n.dataset$.subscribe((function(){return n.updateSwitchOptions()}));n.registerDestroyListener((function(){return i.unsubscribe()}));var o=n.datavalue$.subscribe((function(){n._debounceSetSelectedValue(!0)}));return n.registerDestroyListener((function(){return o.unsubscribe()})),n}return c(t,e),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement,this)},t.prototype.onStyleChange=function(t,n,i){"height"===t?a.setCSS(this.nativeElement,"overflow",n?"auto":""):e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.setSelectedValue=function(){a.isDefined(this.datavalue)||a.isDefined(this.toBeProcessedDatavalue)?this.selectedItem=_.find(this.datasetItems,{selected:!0}):this.selectOptAtIndex(0)},t.prototype.updateSwitchOptions=function(){this.datasetItems.length&&(this.btnwidth=100/this.datasetItems.length,a.setCSS(this.nativeElement.querySelector(".app-switch-overlay"),"width",this.btnwidth+"%")),this._debounceSetSelectedValue(!0)},t.prototype.updateHighlighter=function(e){var t=$(this.nativeElement).find("span.app-switch-overlay");this.setSelectedValue();var n,i=this.selectedItem?_.findIndex(this.datasetItems,{key:this.selectedItem.key}):-1;null==i&&(i=-1),n=i*this.btnwidth,e?t.css("left",n+"%"):t.animate({left:n+"%"},300)},t.prototype.selectOptAtIndex=function(e){if(this.datasetItems.length){var t=this.datasetItems[e];this._modelByValue=t.value}},t.prototype.selectOpt=function(e,t,n){if(e.preventDefault(),!this.disabled){if(this.modelByKey=n.key,this.invokeOnTouched(),this.selectedItem&&t===_.findIndex(this.datasetItems,{key:this.selectedItem.key})){if(2!==this.datasetItems.length)return;t=1===t?0:1}this.selectedItem=this.datasetItems[t],this.updateHighlighter(),this.invokeOnChange(this.datavalue,e||{},!0),a.$appDigest()}},t.prototype.onPropertyChange=function(t,n,i){"disabled"!==t||a.toBoolean(n)?e.prototype.onPropertyChange.call(this,t,n,i):this.nativeElement.removeAttribute(t)},t}(A);te.initializeProps=Z(),te.decorators=[{type:t.Component,args:[{selector:"[wmSwitch]",template:'<div role="group" class="btn-group btn-group-justified">\n <a *ngFor="let opt of datasetItems; let $index = index;"\n focus-target\n href="javascript:void(0);"\n class="btn btn-default"\n [name]="\'wm-switch-\' + opt.key"\n [ngClass]="{\'selected\': opt.selected, \'disabled\': disabled}"\n (click)="selectOpt($event, $index, opt)"\n >\n <i *ngIf="opt.dataObject && opt.dataObject[iconclass]" aria-hidden="true" [ngClass]="[\'app-icon\', opt.dataObject[iconclass] || opt[\'icon\']]"></i>\n <span class="caption" [textContent]="opt[displayfield] || opt.label"></span>\n </a>\n</div>\n<span [title]="selectedItem ? selectedItem.label : modelByKey"\n class="btn btn-primary app-switch-overlay switch-handle">\n <i *ngIf="iconclass"\n class="app-icon {{(selectedItem && selectedItem.dataObject) && selectedItem.dataObject[iconclass]}}"></i>\n {{selectedItem ? selectedItem.label : modelByKey}}\n</span>\n<input [name]="name" class="model-holder ng-hide" [disabled]="disabled" [value]="modelByKey" [required]="required" aria-hidden="true">\n',providers:[r.provideAs(te,i.NG_VALUE_ACCESSOR,!0),r.provideAsWidgetRef(te)],exportAs:"wmSwitch"}]}],te.ctorParameters=function(){return[{type:t.Injector}]};var ne=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["class",r.PROP_STRING],["datasource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxvalue",r.PROP_NUMBER],["minvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",r.PROP_NUMBER],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",r.PROP_STRING],["updateon",r.PROP_STRING]]),ie=function(){r.register("wm-input-calendar",ne)},oe={widgetType:"wm-input-calendar",hostClass:"app-input-wrapper"},re=function(e){function t(t){return e.call(this,t,oe)||this}return c(t,e),t}(B);re.initializeProps=ie(),re.decorators=[{type:t.Component,args:[{selector:'wm-input[type="date"], wm-input[type="datetime-local"], wm-input[type="month"], wm-input[type="time"], wm-input[type="week"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint || type + \' field\'"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n #input>\n',providers:[r.provideAs(re,i.NG_VALUE_ACCESSOR,!0),r.provideAs(re,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(re)]}]}],re.ctorParameters=function(){return[{type:t.Injector}]},re.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ae=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"color"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),se=function(){r.register("wm-input-color",ae)},le={widgetType:"wm-input-color",hostClass:"app-input-wrapper"},ce=function(e){function t(t){return e.call(this,t,le)||this}return c(t,e),t}(B);ce.initializeProps=se(),ce.decorators=[{type:t.Component,args:[{selector:'wm-input[type="color"]',template:'<input class="form-control app-textbox"\n focus-target\n [type]="type"\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n #input>\n',providers:[r.provideAs(ce,i.NG_VALUE_ACCESSOR,!0),r.provideAs(ce,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(ce)]}]}],ce.ctorParameters=function(){return[{type:t.Injector}]},ce.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var pe=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"email"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),ue=function(){r.register("wm-input-email",pe)},de={widgetType:"wm-input-email",hostClass:"app-input-wrapper"},he=function(e){function t(t){return e.call(this,t,de)||this}return c(t,e),t}(B);he.initializeProps=ue(),he.decorators=[{type:t.Component,args:[{selector:'wm-input[type="email"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n email\n #input>\n',providers:[r.provideAs(he,i.NG_VALUE_ACCESSOR,!0),r.provideAs(he,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(he)]}]}],he.ctorParameters=function(){return[{type:t.Injector}]},he.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var me=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["minvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",r.PROP_NUMBER],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"number"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),fe=function(){r.register("wm-input-number",me)},ge={widgetType:"wm-input-number",hostClass:"app-input-wrapper"},ve=function(e){function t(t){return e.call(this,t,ge)||this}return c(t,e),t.prototype.onArrowPress=function(e){0===this.step&&e.preventDefault()},t.prototype.validateInputEntry=function(e){if("e"===e.key&&-1!==e.target.value.indexOf(e.key))return!1},t}(B);ve.initializeProps=fe(),ve.decorators=[{type:t.Component,args:[{selector:'wm-input[type="number"]',template:'<input class="form-control app-textbox"\n [ngClass]="{\'step-hidden\': step === 0}"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n (keydown.ArrowUp)="onArrowPress($event)"\n (keydown.ArrowDown)="onArrowPress($event)"\n (keypress)="validateInputEntry($event)"\n #input>\n',providers:[r.provideAs(ve,i.NG_VALUE_ACCESSOR,!0),r.provideAs(ve,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(ve)]}]}],ve.ctorParameters=function(){return[{type:t.Injector}]},ve.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ye=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayformat",r.PROP_STRING],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showdisplayformaton",Object.assign({value:"always"},r.PROP_ANY)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"text"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),be=function(){r.register("wm-input-text",ye),r.registerFormWidget(a.FormWidgetType.PASSWORD,new Map(ye));var e=new Map(ye),t=function(t){t.forEach((function(t,n){return e.set(n,t)}))};t(ne),t(ae),t(pe),t(me),r.registerFormWidget(a.FormWidgetType.TEXT,new Map(e))},we={widgetType:"wm-input-text",hostClass:"app-input-wrapper"},Pe=function(e){function t(t){var n=e.call(this,t,we)||this;return n.lazy=!1,n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"displayformat":this.maskVal=this.displayformat,this.checkForDisplayFormat();break;case"showdisplayformaton":this.lazy="keypress"===n;break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},Object.defineProperty(t.prototype,"mask",{get:function(){return!(!this.displayformat||!(!this.placeholder||this.placeholder&&this.isFocused))&&{mask:this.maskVal,lazy:this.lazy,definitions:{9:/\d/,A:/[a-zA-Z]/,a:/[a-z]/,"*":/\w/}}},enumerable:!1,configurable:!0}),t.prototype.checkForDisplayFormat=function(e){var t=this;this.displayformat?(this.isFocused=!!(e&&"focus"===e.type||this.datavalue),!this.isFocused&&this.imask&&this.imask.maskRef?(this.imask.maskRef.updateOptions({lazy:!0}),!this.datavalue&&this.imask.maskRef.value&&(this.imask.maskRef.value=this.datavalue)):setTimeout((function(){if(t.imask&&t.imask.maskRef&&t.imask.maskRef.value){var e=t.imask.maskRef.value.indexOf("_"),n=e>=0?t.imask.maskRef.value.slice(0,e).length:t.imask.maskRef.value.length;n!==t.imask.maskRef.cursorPos&&t.imask.maskRef.updateCursor(n)}}),50)):this.imask&&this.imask.maskRef&&(this.imask.maskRef.updateOptions({lazy:!0}),this.inputEl.nativeElement.value=this.datavalue)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.isFocused=!!this.datavalue},t}(B);Pe.initializeProps=be(),Pe.decorators=[{type:t.Component,args:[{selector:'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [(ngModel)]="datavalue"\n [imask]="mask"\n [unmask]="true"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [autofocus]="autofocus"\n (ngModelChange)="handleChange($event)"\n (blur)="handleBlur($event); checkForDisplayFormat($event)"\n (focus)="checkForDisplayFormat($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n #input>\n',providers:[r.provideAs(Pe,i.NG_VALUE_ACCESSOR,!0),r.provideAs(Pe,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(Pe)]}]}],Pe.ctorParameters=function(){return[{type:t.Injector}]},Pe.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}],imask:[{type:t.ViewChild,args:["input",{read:o.IMaskDirective}]}]};var _e=new Map([["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Place your text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["updateon",r.PROP_STRING],["limitdisplaytext",r.PROP_STRING],["charlength",r.PROP_NUMBER]]),Oe=function(){r.register("wm-textarea",_e),r.registerFormWidget(a.FormWidgetType.TEXTAREA,new Map(_e))},Se={widgetType:"wm-textarea",hostClass:"app-input-wrapper"},Ee=function(e){function t(t){var n=e.call(this,t,Se)||this;return n.charlength=0,n}return c(t,e),t.prototype.onInputChange=function(){this.charlength=this.inputEl.nativeElement.value.length},t}(B);Ee.initializeProps=Oe(),Ee.decorators=[{type:t.Component,args:[{selector:"wm-textarea",template:'<textarea class="form-control app-textarea"\n focus-target\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n aria-multiline="true"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (input)="onInputChange()"\n (ngModelChange)="handleChange($event); onInputChange();"\n #textarea\n></textarea>\n\n<div *ngIf="maxchars" class="textarea-count" >{{limitdisplaytext}}</div>\n',providers:[r.provideAs(Ee,i.NG_VALUE_ACCESSOR,!0),r.provideAs(Ee,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(Ee)]}]}],Ee.ctorParameters=function(){return[{type:t.Injector}]},Ee.propDecorators={inputEl:[{type:t.ViewChild,args:["textarea",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var Te=function(){function e(e,n){this.skipFloatPositionWidgets=["radioset","checkboxset","richtext","switch","chips","checkbox","slider","rating","toggle","upload"],this.elementRef=e.get(t.ElementRef),this.nativeEl=this.elementRef.nativeElement,this.app=n}return e.prototype.onBlurCb=function(){var e;this.inputEl.length>1&&this.inputEl.hasClass("mobile-input")&&_.forEach(this.inputEl,(function(t){$(t).hasClass("mobile-input")&&t.value&&(e=t.value)})),this.inputEl.val()||e||(this.compositeEle.classList.remove("float-active"),this.inputEl.removeAttr("placeholder"))},e.prototype.onFocusCb=function(){this.compositeEle.classList.add("float-active"),this.inputEl.attr("placeholder",this.placeholder)},e.prototype.checkForSelectPlaceholder=function(){!$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").is(":focus")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.nativeEl).find("select option:selected").text("")},e.prototype.setDefaultValueAnimation=function(){!this._isPlaceholderBound&&this.inputEl.attr("placeholder")&&(this.placeholder=this.inputEl.attr("placeholder"),this.inputEl.removeAttr("placeholder")),this.checkForSelectPlaceholder(),(this.inputEl.val()&&!this.inputEl.is("select")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.inputEl.parent("[widget-id]")).attr("datavalue.bind")||this.nativeEl.getAttribute("defaultvalue")||this.nativeEl.getAttribute("displayformat")||$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").attr("multiple"))&&this.compositeEle.classList.add("float-active")},e.prototype.observeForPlaceholderAttrChange=function(){var e=this;this._attrObserver=new MutationObserver((function(t){t.forEach((function(t){"placeholder"===t.attributeName&&e.inputEl.attr("placeholder")&&!e.compositeEle.classList.contains("float-active")&&(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder"))}))}));this._attrObserver.observe(this.inputEl[0],{attributes:!0,childList:!1,characterData:!1})},e.prototype.checkForRightAlignedForm=function(){var e=$(this.compositeEle);if(e.closest(".align-right").length&&e.find(".input-group-btn").length){var t=e.find("label");e.find("[wmdatetime]").length?t.addClass("input-grp-dt-icon"):t.addClass("input-grp-icon")}},e.prototype.ngAfterViewInit=function(){this.compositeEle=this.nativeEl;var e=this.nativeEl.widget,t=e.$attrs.get("captionposition");if(e.form&&(t=e.form.$attrs.get("captionposition"),this.compositeEle=this.nativeEl.querySelector(".app-composite-widget"),this._isPlaceholderBound=this.nativeEl.getAttribute("placeholder.bind")),"floating"===t){if(e.form){var n=this.nativeEl.getAttribute("widgettype");this.skipFloatPositionWidgets.indexOf(n)>-1&&(this.compositeEle.classList.remove("caption-floating"),this.compositeEle.classList.add("caption-top")),this.checkForRightAlignedForm()}this.inputEl=$(this.nativeEl).find("input, select, textarea"),this._isPlaceholderBound||(this._isPlaceholderBound=this.inputEl.closest("[widget-id]").attr("placeholder.bind")),setTimeout(this.setDefaultValueAnimation.bind(this),0),this.inputEl.focus(this.onFocusCb.bind(this)),this.inputEl.blur(this.onBlurCb.bind(this)),this._isPlaceholderBound&&this.observeForPlaceholderAttrChange()}},e.prototype.ngOnInit=function(){var e=this;this.labelAnimationSubscription=this.app.subscribe("captionPositionAnimate",(function(t){var n=e.inputEl&&e.inputEl.is(":focus");if(t.displayVal||t.isFocused||t.isSelectMultiple||n)t.nativeEl.addClass("float-active"),!t.displayVal&&n&&e.inputEl.attr("placeholder",e.placeholder);else if(t.nativeEl.removeClass("float-active"),e.inputEl){var i=e.inputEl.find("option:first");(e.inputEl.attr("placeholder")||i.text())&&(i.length?i.text(""):(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder")))}}))},e.prototype.ngOnDestroy=function(){this.labelAnimationSubscription&&this.labelAnimationSubscription(),this._attrObserver&&this._attrObserver.disconnect()},e}();Te.decorators=[{type:t.Directive,args:[{selector:"[captionPosition]"}]}],Te.ctorParameters=function(){return[{type:t.Injector},{type:a.App}]};var Ce=[m,v,Te,C,N,L,U,H,X,te,re,ce,he,ve,Pe,Ee],Ae=function(){};Ae.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,r.WmComponentsModule,o.IMaskModule],declarations:u([],p(Ce)),exports:u([],p(Ce)),entryComponents:[]}]}],e.BaseFormComponent=y,e.BaseFormCustomComponent=w,e.ButtonComponent=m,e.ButtonGroupDirective=v,e.CaptionPositionDirective=Te,e.CheckboxComponent=C,e.CheckboxsetComponent=N,e.CompositeDirective=L,e.DatasetAwareFormComponent=A,e.InputCalendarComponent=re,e.InputColorComponent=ce,e.InputEmailComponent=he,e.InputModule=Ae,e.InputNumberComponent=ve,e.InputTextComponent=Pe,e.NumberComponent=U,e.NumberLocale=G,e.RadiosetComponent=H,e.SelectComponent=X,e.SwitchComponent=te,e.TextareaComponent=Ee,e["\u02750"]=T,e["\u0275a"]=d,e["\u0275b"]=f,e["\u0275c"]=O,e["\u0275d"]=I,e["\u0275e"]=x,e["\u0275f"]=B,e["\u0275g"]=j,e["\u0275h"]=q,e["\u0275i"]=K,e["\u0275j"]=Z,e["\u0275k"]=ie,e["\u0275l"]=se,e["\u0275m"]=ue,e["\u0275n"]=fe,e["\u0275o"]=be,e["\u0275p"]=Oe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@wm/core"),require("@wm/components/base"),require("@angular/common")):"function"==typeof define&&define.amd?define("@wm/components/basic",["exports","@angular/core","@wm/core","@wm/components/base","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic={}),e.ng.core,e.wm.core,e.wm.components.base,e.ng.common)}(this,(function(e,t,n,i,o){"use strict";
57
+ ***************************************************************************** */var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create;function p(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function u(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}Object.create;var d=function(){r.register("wm-button",new Map([["animation",r.PROP_STRING],["badgevalue",r.PROP_STRING],["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["iconclass",r.PROP_STRING],["iconheight",r.PROP_STRING],["iconmargin",r.PROP_STRING],["iconposition",r.PROP_STRING],["iconurl",r.PROP_STRING],["iconwidth",r.PROP_STRING],["name",r.PROP_STRING],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",r.PROP_STRING]]))},h={widgetType:"wm-button",hostClass:"btn app-button",displayType:r.DISPLAY_TYPE.INLINE_BLOCK},m=function(e){function t(t){var n=e.call(this,t,h)||this;return r.styler(n.nativeElement,n),n}return c(t,e),t}(r.StylableComponent);m.initializeProps=d(),m.decorators=[{type:t.Component,args:[{selector:"button[wmButton]",template:'<img data-identifier="img" alt="button image" class="button-image-icon" [src]="iconurl | image" *ngIf="iconurl" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin}"/>\n<i class="app-icon {{iconclass}}" aria-hidden="true" [ngStyle]="{width:iconwidth, height:iconheight, margin:iconmargin, fontSize:iconwidth}" *ngIf="iconclass"></i>\n<span class="sr-only" *ngIf="iconclass">{{caption}} {{appLocale.LABEL_ICON}}</span>\n<span class="btn-caption" [innerHTML]="caption"></span>\n<ng-content select=".caret"></ng-content>\n<span *ngIf="badgevalue" class="badge pull-right" [textContent]="badgevalue"></span>\n',providers:[r.provideAsWidgetRef(m)],exportAs:"wmButton"}]}],m.ctorParameters=function(){return[{type:t.Injector}]},m.propDecorators={type:[{type:t.HostBinding,args:["type"]}],tabindex:[{type:t.HostBinding,args:["tabIndex"]}],disabled:[{type:t.HostBinding,args:["disabled"]}],shortcutkey:[{type:t.HostBinding,args:["attr.accesskey"]}],iconposition:[{type:t.HostBinding,args:["attr.icon-position"]}]};var f=function(){r.register("wm-buttongroup",new Map([["class",r.PROP_STRING],["name",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["vertical",r.PROP_BOOLEAN]]))},g={widgetType:"wm-buttongroup",hostClass:"btn-group app-button-group"},v=function(e){function t(t){var n=e.call(this,t,g)||this;return r.styler(n.nativeElement,n,r.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.handleClick=function(e){var t=$(e.target).closest(".app-button");this.$element.find(".app-button").removeClass("selected"),t.addClass("selected")},t}(r.StylableComponent);v.initializeProps=f(),v.decorators=[{type:t.Directive,args:[{selector:"[wmButtonGroup]",providers:[r.provideAsWidgetRef(v)]}]}],v.ctorParameters=function(){return[{type:t.Injector}]},v.propDecorators={vertical:[{type:t.HostBinding,args:["class.btn-group-vertical"]}],handleClick:[{type:t.HostListener,args:["click",["$event"]]}]};var y=function(e){function t(t,n,i){var o=e.call(this,t,n,i)||this;return o.inj=t,o.binddatavalue=o.$element.attr("datavalue.bind"),o}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.dataval},set:function(e){this.dataval=e},enumerable:!1,configurable:!0}),t.prototype.updateBoundVariable=function(e){var t=this.binddatavalue;this.datavaluesource&&this.datavaluesource.execute(a.DataSource.Operation.IS_API_AWARE)||this.datavaluesource&&!this.datavaluesource.twoWayBinding||!t||t.startsWith("Widgets.")||t.startsWith("itemRef.currentItemWidgets")||(t=t.replace(/\[\$i\]/g,"[0]"),_.has(this.context,t.split(".")[0])?_.set(this.context,t,e):_.set(this.viewParent,t,e))},t.prototype.invokeOnChange=function(e,t){t&&this.datavalue!==this.prevDatavalue&&(this.updateBoundVariable(e),this.invokeEventCallback("change",{$event:t,newVal:e,oldVal:this.prevDatavalue})),this.prevDatavalue=e},t.prototype.updatePrevDatavalue=function(e){this.prevDatavalue=e},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),$(this.nativeElement).parents().closest("[wmList]").length&&this.$element.keydown((function(e){37!==e.keyCode&&38!==e.keyCode&&39!==e.keyCode&&40!==e.keyCode||e.stopPropagation()}))},t}(r.StylableComponent);function b(e){return function(t){return e?function(e){switch(typeof e){case"object":return!(!e||!e.length&&!Object.keys(e).length);case"number":return!!e||0===e;default:return!(null==e||""===e)}}(t.value)?null:{required:!0}:null}}y.decorators=[{type:t.Injectable}],y.ctorParameters=function(){return[{type:t.Injector},{type:void 0},{type:Promise}]};var w=function(e){function t(){var t=e.apply(this,u([],p(arguments)))||this;return t._onChange=function(){},t._onTouched=function(){},t}return c(t,e),t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this._formControl=this.inj.get(i.FormControlName,null)},t.prototype.registerOnChange=function(e){this._onChange=e},t.prototype.registerOnTouched=function(e){this._onTouched=e},t.prototype.writeValue=function(e){this.isDestroyed||(this._formControl&&(this.datavalue=e,this.onPropertyChange("datavalue",e),this.updatePrevDatavalue(e)),e!==this.datavalue&&this._onChange(this.datavalue))},t.prototype.invokeOnChange=function(t,n,i){this._onChange(t),i&&e.prototype.invokeOnChange.call(this,t,n)},t.prototype.invokeOnTouched=function(e){this._onTouched(),e&&this.invokeEventCallback("blur",{$event:e})},t.prototype.invokeOnFocus=function(e){this.invokeEventCallback("focus",{$event:e})},t.prototype.validate=function(e){return this.show?b(this.required)(e):null},t}(y);w.decorators=[{type:t.Injectable}];var P=new Map([["caption",r.PROP_STRING],["class",r.PROP_STRING],["conditionalclass",r.PROP_ANY],["conditionalstyle",r.PROP_ANY],["checkedvalue",Object.assign({value:!0},r.PROP_STRING)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["name",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["uncheckedvalue",Object.assign({value:!1},r.PROP_STRING)]]),O=function(){r.register("wm-checkbox",P),r.registerFormWidget(a.FormWidgetType.CHECKBOX,P),r.registerFormWidget(a.FormWidgetType.TOGGLE,P)},S={widgetType:"wm-checkbox",hostClass:"app-checkbox checkbox"},E=function(e,t){if(null===e)return t;if(!0===e||"true"===e)return!0;if(!1===e||"false"===e)return!1;var n=parseInt(e,10);return isNaN(n)?e:n},T=E,C=function(e){function t(t,n,i,o){var r=e.call(this,t,S)||this;return r.type=o,r._caption="&nbsp",r._checkedvalue=E(n,!0),r._uncheckedvalue=E(i,!1),a.toggleClass(r.nativeElement,"app-toggle","toggle"===o),r}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return a.isDefined(this.proxyModel)?this.proxyModel?this._checkedvalue:this._uncheckedvalue:void 0},set:function(e){this.proxyModel=a.isDefined(e)&&""!==e?e===this._checkedvalue:void 0,this.updatePrevDatavalue(this.datavalue)},enumerable:!1,configurable:!0}),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"caption"===t?a.isDefined(n)&&""!==n?this._caption=n:this._caption="&nbsp;":"checkedvalue"===t?this._checkedvalue=E(n,!0):"uncheckedvalue"===t?this._uncheckedvalue=E(n,!1):"datavalue"===t?(this.datavalue=E(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t.prototype.handleEvent=function(t,n,i,o){if("change"!==n&&"blur"!==n){var r="tap"===n?this.nativeElement.querySelector("label"):this.checkboxEl.nativeElement;e.prototype.handleEvent.call(this,r,n,i,o)}},t.prototype.handleChange=function(e){this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.onKeyDown=function(e){e.preventDefault(),this.checkboxEl.nativeElement.click()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement.querySelector("label"),this)},t}(w);C.initializeProps=O(),C.decorators=[{type:t.Component,args:[{selector:"[wmCheckbox]",template:'<label [ngClass]="{\'unchecked\': !proxyModel, \'disabled\': (disabled || readonly), \'required\': (required && _caption)}">\n <input type="checkbox"\n role="checkbox"\n #checkbox\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-checked]="!!proxyModel"\n focus-target\n [(ngModel)]="proxyModel"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled || readonly"\n [attr.accesskey]="shortcutkey"\n [tabindex]="tabindex"\n (blur)="invokeOnTouched($event)"\n (ngModelChange)="handleChange($event)">\n <span class="caption" [innerHtml]="_caption"></span>\n <img alt="Checkbox Image" aria-hidden="true" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="switch"/>\n</label>\n<input type="hidden" class="ng-hide model-holder" aria-hidden="true" tabindex="-1" [disabled]="disabled" [value]="proxyModel">\n',providers:[r.provideAs(C,i.NG_VALUE_ACCESSOR,!0),r.provideAs(C,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(C)]}]}],C.ctorParameters=function(){return[{type:t.Injector},{type:void 0,decorators:[{type:t.Attribute,args:["checkedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["uncheckedvalue"]}]},{type:void 0,decorators:[{type:t.Attribute,args:["type"]}]}]},C.propDecorators={ngModel:[{type:t.ViewChild,args:[i.NgModel]}],checkboxEl:[{type:t.ViewChild,args:["checkbox",{static:!0,read:t.ElementRef}]}],onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var A=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;return o.groupby=i,o.datasetItems=[],o.acceptsArray=!1,o.dataset$=new s.Subject,o.datavalue$=new s.Subject,o.allowempty=!0,o._debounceDatavalueUpdation=_.debounce((function(e){!a.isDefined(o._modelByKey)||_.isArray(o._modelByKey)&&!o._modelByKey.length?(o.toBeProcessedDatavalue=e,o._modelByValue=""):a.isDefined(o.toBeProcessedDatavalue)&&(a.isDefined(o._modelByValue)||(o._modelByValue=!o.multiple&&_.isArray(o.toBeProcessedDatavalue)?o.toBeProcessedDatavalue[0]:o.toBeProcessedDatavalue),o.toBeProcessedDatavalue=void 0),o.initDisplayValues()}),150),o.datePipe=o.inj.get(r.ToDatePipe),o.appDefaults=o.inj.get(a.AppDefaults),o.binddisplayexpression=o.nativeElement.getAttribute("displayexpression.bind"),o.binddisplayimagesrc=o.nativeElement.getAttribute("displayimagesrc.bind"),o.binddisplaylabel=o.nativeElement.getAttribute("displaylabel.bind"),o._debouncedInitDatasetItems=a.debounce((function(){o.initDatasetItems(),a.$appDigest()}),150),o.handleHeaderClick=a.noop,o.cancelLocaleChangeSubscription=o.getAppInstance().subscribe("locale-changed",(function(){o._debouncedInitDatasetItems()})),o}return c(t,e),Object.defineProperty(t.prototype,"modelByKey",{get:function(){return this._modelByKey},set:function(e){this.selectByKey(e),this.invokeOnChange(this._modelByValue)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this._modelByValue},set:function(e){this.multiple&&(e=r.extractDataAsArray(e)),this._modelByValue=e,this.selectByValue(e),this.datavalue$.next(e),this.invokeOnChange(e,void 0,!0)},enumerable:!1,configurable:!0}),t.prototype.selectByKey=function(e){var t=this;if(this.resetDatasetItems(),this.datasetItems.length){if(this.multiple&&!_.isArray(e)&&(e=[e]),this._modelByKey=e,this.multiple)this._modelByValue=[],e.forEach((function(e){var n=_.find(t.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,t._modelByValue=u(u([],p(t._modelByValue)),[n.value]))}));else{this._modelByValue="";var n=_.find(this.datasetItems,(function(t){return _.toString(t.key)===_.toString(e)}));n&&(n.selected=!0,this._modelByValue=n.value)}this.initDisplayValues()}},t.prototype.selectByValue=function(e){var t=this;if(this.resetDatasetItems(),!(!a.isDefined(e)||""===e||_.isNull(e)||e instanceof Array&&!e.length)||(this._modelByKey=void 0,this.allowempty&&a.isDefined(e)))if(this.acceptsArray&&!_.isArray(e)&&(e=this.allowempty?[e]:r.extractDataAsArray(e)),this.datasetItems.length||!a.isDefined(e)){var n=this.datafield===r.ALLFIELDS?"dataObject":"key";if(_.isArray(e))this._modelByKey=[],e.forEach((function(e){var i=_.find(t.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?a.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,t._modelByKey.push(i.key))}));else{this._modelByKey=void 0;var i=_.find(this.datasetItems,(function(i){return"dataObject"===n&&t.compareby&&t.compareby.length?a.isEqualWithFields(i[n],e,t.compareby):_.isObject(i.value)?_.isEqual(i.value,e):_.toString(i.value).toLowerCase()===_.toString(e).toLowerCase()}));i&&(i.selected=!0,this._modelByKey=i.key)}this._debounceDatavalueUpdation(e)}else this.toBeProcessedDatavalue=e},t.prototype.initDisplayValues=function(){var e=[];this.datasetItems.forEach((function(t){t.selected&&e.push(t.label)})),this.displayValue=this.multiple?e:e[0]||""},t.prototype.initDatasetItems=function(){if(!this.dataset||_.isEmpty(this.dataset))return this.datasetItems=[],void this.dataset$.next(this.datasetItems);var e=r.getOrderedDataset(r.convertDataToObject(this.dataset),this.orderby);if(this.usekeys)this.datasetItems=r.transformDataWithKeys(e);else{var t=r.transformFormData(this.viewParent,e,this.datafield,{displayField:this.displayfield||this.displaylabel,displayExpr:this.displayexpression,bindDisplayExpr:this.binddisplayexpression||this.binddisplaylabel,bindDisplayImgSrc:this.binddisplayimagesrc,displayImgSrc:this.displayimagesrc});this.datasetItems=u([],p(r.getUniqObjsByDataField(t,this.datafield,this.displayfield||this.displaylabel,a.toBoolean(this.allowempty))))}this.postDatasetItemsInit()},t.prototype.postDatasetItemsInit=function(){if(this.datasetItems.length&&!this._defaultQueryInvoked){var e=_.isEmpty(this.toBeProcessedDatavalue)?this.datavalue:this.toBeProcessedDatavalue;this.selectByValue(e)}this.dataset$.next(this.datasetItems)},t.prototype.resetDatasetItems=function(){this.datasetItems.forEach((function(e){return e.selected=!1}))},t.prototype.setTemplate=function(e){this.content=e,this.viewParent&&this.viewParent.prefabName&&(this.prefabName=this.viewParent.prefabName)},t.prototype.getGroupedData=function(){return this.datasetItems.length?r.groupData(this,r.convertDataToObject(this.datasetItems),this.groupby,this.match,this.orderby,this.dateformat,this.datePipe,"dataObject",this.appDefaults):[]},t.prototype.datasetSubscription=function(){var e=this,t=this.dataset$.subscribe((function(){e.groupedData=e.getGroupedData()}));this.registerDestroyListener((function(){return t.unsubscribe()}))},t.prototype.setGroupData=function(){this.datasetSubscription(),this.groupedData=this.getGroupedData()},t.prototype.onPropertyChange=function(t,n,i){switch(e.prototype.onPropertyChange.call(this,t,n,i),t){case"dataset":case"datafield":case"displayfield":case"displaylabel":case"displayexpression":case"orderby":case"usekeys":this._debouncedInitDatasetItems();break;case"required":case"datavalue":this._onChange(this.datavalue);break;case"groupby":case"match":"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData()}},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.groupby&&"wm-search"!==this.widgetType&&"wm-chips"!==this.widgetType&&this.setGroupData(),this.groupby&&this.collapsible&&(this.handleHeaderClick=r.handleHeaderClick,this.toggleAllHeaders=r.toggleAllHeaders.bind(void 0,this))},t.prototype.ngOnDestroy=function(){this.cancelLocaleChangeSubscription&&this.cancelLocaleChangeSubscription()},t}(w);A.decorators=[{type:t.Injectable}],A.ctorParameters=function(){return[{type:t.Injector},null,{type:String,decorators:[{type:t.Attribute,args:["groupby"]}]}]};var R=new Map([["class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["itemclass",Object.assign({value:""},r.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},r.PROP_STRING)],["listclass",Object.assign({value:""},r.PROP_STRING)],["match",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},r.PROP_STRING)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),I=function(){r.register("wm-checkboxset",R),r.registerFormWidget(a.FormWidgetType.CHECKBOXSET,new Map(R))},D={widgetType:"wm-checkboxset",hostClass:"app-checkboxset list-group inline"},N=function(e){function t(t){var n=e.call(this,t,D)||this;return n.layout="",r.styler(n.nativeElement,n),n.multiple=!0,n}return c(t,e),t.prototype.onCheckboxLabelClick=function(e,t){if($(e.target).is("input")){var n=this.nativeElement.querySelectorAll("input:checked"),i=[];_.forEach(n,(function(e){i.push(e.value)})),this.modelByKey=i,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)}},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onKeyDown=function(e){e.preventDefault(),e.target.click()},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"!==t?"itemsperrow"===t?a.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i):this._onChange(this.datavalue))},t}(A);N.initializeProps=I(),N.decorators=[{type:t.Component,args:[{selector:"[wmCheckboxset]",exportAs:"wmCheckboxset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'checkbox\', \'app-checkbox\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems; let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" [attr.aria-label]="item.key"\n [tabindex]="tabindex" [attr.aria-checked]="item.selected"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group" role="presentation">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'checkbox\', \'app-checkbox\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onCheckboxLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" [title]="item.label">\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-checkboxset-label" [ngClass]="{\'disabled\':disabled || readonly}" >\n <input [name]="\'checkboxset_\' + widgetId" type="checkbox" aria-label="checkbox group"\n [tabindex]="tabindex"\n [disabled]="disabled || readonly" [attr.data-attr-index]="i"\n [value]="item.key" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[r.provideAs(N,i.NG_VALUE_ACCESSOR,!0),r.provideAs(N,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(N)]}]}],N.ctorParameters=function(){return[{type:t.Injector}]},N.propDecorators={onKeyDown:[{type:t.HostListener,args:["keydown.enter",["$event",'"ENTER"']]}]};var x=function(){r.register("wm-form-group",new Map([["captionposition",r.PROP_STRING],["name",r.PROP_STRING],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)]]))},k={widgetType:"wm-form-group",hostClass:"form-group app-composite-widget clearfix"},M={left:"caption-left",right:"caption-right",top:"caption-top",floating:"caption-floating"},L=function(e){function t(t){var n=e.call(this,t,k)||this;return r.styler(n.nativeElement,n,r.APPLY_STYLES_TYPE.CONTAINER),n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"captionposition"===t?a.switchClass(this.nativeElement,M[n],M[i]):"required"===t?(this.required=n,this.assignRequiredToSubComponents()):e.prototype.onPropertyChange.call(this,t,n,i)},t.prototype.assignRequiredToSubComponents=function(){var e=this;this.required&&this.componentRefs&&setTimeout((function(){e.componentRefs.forEach((function(e){return e.widget.required=!0}))}),50)},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),a.addForIdAttributes(this.nativeElement),this.assignRequiredToSubComponents()},t}(r.StylableComponent);L.initializeProps=x(),L.decorators=[{type:t.Directive,args:[{selector:"div[wmComposite]",providers:[r.provideAsWidgetRef(L)]}]}],L.ctorParameters=function(){return[{type:t.Injector}]},L.propDecorators={componentRefs:[{type:t.ContentChildren,args:[r.WidgetRef,{descendants:!0}]}]};var F=new Map([["autofocus",r.PROP_BOOLEAN],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["localefilter",r.PROP_STRING],["minvalue",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["numberfilter",r.PROP_STRING],["placeholder",Object.assign({value:"Enter number"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",Object.assign({value:1},r.PROP_NUMBER)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["trailingzero",Object.assign({value:!1},r.PROP_BOOLEAN)],["updateon",r.PROP_STRING],["inputmode",Object.assign({value:"natural"},r.PROP_STRING)]]),j=function(){r.register("wm-number",F),r.registerFormWidget(a.FormWidgetType.NUMBER,new Map(F))},B=function(e){function t(t,n){var i=e.call(this,t,n)||this;i.ngModelOptions={updateOn:""};var o=i.nativeElement.getAttribute("updateon")||"blur";return o="default"===o?"change":o,i.ngModelOptions.updateOn=o,i}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("required"===t&&this._onChange(this.datavalue),"class"===t?this.inputEl.nativeElement&&a.switchClass(this.inputEl.nativeElement,n,i):"datavalue"===t?(this.updatePrevDatavalue(n),this._onChange(this.datavalue)):e.prototype.onPropertyChange.call(this,t,n,i))},t.prototype.handleChange=function(e){this.autotrim&&this.datavalue&&_.isString(this.datavalue)&&(this.datavalue=this.datavalue.trim()),this.invokeOnChange(this.datavalue,{type:"change"},this.ngModel.valid)},t.prototype.handleEvent=function(t,n,i,o){"change"!==n&&"blur"!==n&&e.prototype.handleEvent.call(this,this.inputEl.nativeElement,n,i,o)},t.prototype.handleBlur=function(e){this.invokeOnTouched(e)},t.prototype.flushViewChanges=function(e){var t=_.get(this.imask,"maskRef.unmaskedValue");e=t||e,this.ngModel.update.next(e),a.$appDigest()},t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),this.class&&a.addClass(this.inputEl.nativeElement,this.class),r.styler(this.inputEl.nativeElement,this)},t}(w);B.decorators=[{type:t.Injectable}],B.ctorParameters=function(){return[{type:t.Injector},{type:void 0}]};var G=function(e){function t(t,i,o,r){var a=e.call(this,t,i)||this;return a.i18nService=o,a.trailingZeroDecimalPipe=r,a.isDefaultQuery=!0,a.decimalValue="",a.selectedLocale=o.getSelectedLocale(),a.DECIMAL=n.getLocaleNumberSymbol(a.localefilter||a.selectedLocale,n.NumberSymbol.Decimal),a.GROUP=n.getLocaleNumberSymbol(a.localefilter||a.selectedLocale,n.NumberSymbol.Group),a.numberfilter="1.0-16",a.resetValidations(),a}return c(t,e),Object.defineProperty(t.prototype,"datavalue",{get:function(){return this.proxyModel},set:function(e){if(this.lastValIsDecimal=!1,_.includes([null,void 0,""],e)){var t=this.inputEl.nativeElement,n=this.prevDatavalue;return this.displayValue=t.value=this.proxyModel=null,this.resetValidations(),void(n&&!this.isDefaultQuery&&(this.handleChange(e),this._onChange()))}if(this.isDefaultQuery){var i=_.isString(e)&&_.includes(e,this.DECIMAL),o=i?e.split(this.DECIMAL):_.isString(e)&&e.split(".");this.decimalValue=o[1]||"",e=i?e:this.transformNumber(e)}var r,a=e.toString();r=/\d/.test(a)?this.parseNumber(a):NaN,_.isNaN(r)&&a[a.length-1]===this.DECIMAL&&"change"===this.ngModelOptions.updateOn&&this.$element.find("input:focus").length&&(this.lastValIsDecimal=!0),!this.lastValIsDecimal&&this.isValid(r)?(this.proxyModel=r,this.updateDisplayText(),this.isDefaultQuery||this.handleChange(r)):(this.displayValue=e.toString(),this.proxyModel=null,this.handleChange(null))},enumerable:!1,configurable:!0}),t.prototype.resetValidations=function(){this.isInvalidNumber=!1,this.numberNotInRange=!1},t.prototype.isValid=function(e){return _.isNaN(e)||!_.isFinite(e)||!Number.isInteger(this.step)&&this.countDecimals(e)>this.countDecimals(this.step)?(this.isInvalidNumber=!0,!1):e!==this.getValueInRange(e)?(this.numberNotInRange=!0,!0):(this.resetValidations(),!0)},t.prototype.getValueInRange=function(e){return!_.isNaN(this.minvalue)&&e<this.minvalue?(this.validateType="minvalue",this.minvalue):!_.isNaN(this.maxvalue)&&e>this.maxvalue?(this.validateType="maxvalue",this.maxvalue):e},t.prototype.transformNumber=function(e,t){var n,i=t||this.numberfilter;return this.trailingZeroDecimalPipe.transform(e,this.selectedLocale,i,this.localefilter,this.trailingzero,this.decimalValue,!!t,null===(n=this.i18nService)||void 0===n?void 0:n.getwidgetLocale())},t.prototype.resetCursorPosition=function(e){var t=this.inputEl.nativeElement,n=t.value.length-e;n=n<0?0:n,t.setSelectionRange(n,n)},t.prototype.parseNumber=function(e){var t=e.split(this.inputmode===r.INPUTMODE.FINANCIAL?e.indexOf(this.DECIMAL)>-1?this.DECIMAL:".":this.DECIMAL);if(!t.length)return null;if(t.length>2)return NaN;if(""===t[1])return NaN;var n=Number(t[0].split(this.GROUP).join("")),i=Number("0."+(t[1]||0));if(Number.isNaN(n)||Number.isNaN(i))return NaN;var o=t.length>1?parseFloat((n+i).toFixed(t[1].length)):n+i;return 0===n?Object.is(0,n)?o:n-i:n>0?o:n-i},t.prototype.updateDisplayText=function(){var e=this.inputEl.nativeElement,t=e.selectionStart,n=e.value;if(!this.isDefaultQuery){var i=n.split(this.DECIMAL);this.decimalValue=i[1]||""}var o=this.stepLength();this.inputmode===r.INPUTMODE.FINANCIAL&&o?(this.displayValue=e.value=this.transformNumber(this.proxyModel,"1."+o+"-"+o),this.decimalValue=this.decimalValue.replace(/\D/g,"")):this.displayValue=e.value=this.transformNumber(this.proxyModel),"default"!==this.updateon||this.isDefaultQuery||this.resetCursorPosition(n.length-t)},t.prototype.stepLength=function(){var e=this.step.toString().split(".");return 1===e.length?void 0:e[1].length},t.prototype.isNaturalCurrency=function(){return this.inputmode===r.INPUTMODE.NATURAL&&"wm-currency"===this.widgetType&&!!this.trailingzero},t.prototype.onInputChange=function(e){var t=this.stepLength();if(a.isDefined(e)&&(""!==e||this.datavalue)&&(this.handleChange(e),t&&this.inputmode===r.INPUTMODE.FINANCIAL)){var n;if(this.isDefaultQuery)n=parseFloat(e);else n=parseInt(e.toString().replace(/\D/g,""))*this.step;_.isNaN(n)?"blur"!==this.ngModelOptions.updateOn&&(this.datavalue=void 0,this.handleChange(null)):"change"===this.ngModelOptions.updateOn?(this.datavalue=parseFloat(n.toFixed(t)),this.handleChange(this.datavalue)):this.displayValue=n.toFixed(t)}},t.prototype.checkForTrailingZeros=function(e){var t=this.stepLength(),n=!this.trailingzero&&this.inputmode===r.INPUTMODE.FINANCIAL;if(this.lastValIsDecimal&&this.onModelChange(this.displayValue),(n||this.isNaturalCurrency())&&t&&this.datavalue){var i=void 0;(n&&"focus"===e.type||this.isNaturalCurrency()&&"blur"===e.type)&&(i="1."+t+"-"+t),this.displayValue=this.transformNumber(this.datavalue,i)}},t.prototype.countDecimals=function(e){if(e%1!=0){var t=e.toString().split(".")[1];return t&&t.length}return 0},t.prototype.onArrowPress=function(e,t){if(e.preventDefault(),!this.readonly&&0!==this.step){var n,i,o=e.target.value.replace(/,/g,"");if(n=o&&!_.isNaN(parseFloat(o))?parseFloat(o):this.proxyModel,this.numberNotInRange){var r=this.parseNumber(this.inputEl.nativeElement.value);_.isNaN(r)||(i=this.getValueInRange(r),n=r,this.resetValidations())}else _.isUndefined(n)||_.isNull(n)?(n=i=this.getValueInRange(this.minvalue||0),this.resetValidations()):i=this.getValueInRange(n+("UP"===t?this.step:-this.step));if("UP"===t&&n<=i||"DOWN"===t&&n>=i){var a=Math.max(this.countDecimals(n),this.countDecimals(this.step));this.proxyModel=_.round(i,a),this.updateDisplayText(),this.handleChange(this.proxyModel)}}},t.prototype.validate=function(e){return this.isInvalidNumber?(this.validateType="",{invalidNumber:{valid:!1}}):this.numberNotInRange?{numberNotInRange:{valid:!1}}:(this.validateType="",this.show&&this.required?e.value||0===e.value?null:{required:!0}:null)},t.prototype.validateInputEntry=function(e){if(this.isDefaultQuery=!1,!e.ctrlKey&&!_.includes(["Backspace","ArrowRight","ArrowLeft","Tab","Enter","Delete"],e.key)){var t=new RegExp("^[\\d\\s-,.e+"+this.GROUP+this.DECIMAL+"]$","i"),n=e.target.value,i=this.inputmode===r.INPUTMODE.FINANCIAL;if(n)if(parseInt(n.toString().replace(/\D/g,"")).toString().length>15){var o=window.getSelection();return!(!o||!o.toString()||o.focusNode!==this.nativeElement)}return!(!i&&n&&this.countDecimals(this.step)&&this.countDecimals(n)>=this.countDecimals(this.step)&&e.target.selectionStart>=n.length-1)&&(!!t.test(e.key)&&((!_.includes(n,",")||","!==n[n.length-1]||","!==e.key)&&((!_.includes(n,this.DECIMAL)||e.key!==this.DECIMAL)&&((!_.intersection(_.toArray(n),["e","E"]).length||!_.includes("eE",e.key))&&((!_.includes(n,"+")&&!_.includes(n,"-")||"+"!==e.key&&"-"!==e.key)&&(!(!n&&"Space"===e.code)&&void 0))))))}},t.prototype.onBackspace=function(e){this.isDefaultQuery=!1},t.prototype.onEnter=function(e){this.datavalue=e.target.value},t.prototype.onModelChange=function(e){(this.inputmode===r.INPUTMODE.NATURAL||this.inputmode===r.INPUTMODE.FINANCIAL&&"blur"===this.ngModelOptions.updateOn)&&(this.datavalue=e)},t.prototype.onPropertyChange=function(t,n,i){"minvalue"===t||"maxvalue"===t?this.isValid(n):"datavalue"!==t||i?e.prototype.onPropertyChange.call(this,t,n,i):this.isNaturalCurrency()?this.checkForTrailingZeros({type:"blur"}):this.onInputChange(n)},t}(B),V={widgetType:"wm-number",hostClass:"app-input-wrapper"},U=function(e){function t(t,n,i){return e.call(this,t,V,n,i)||this}return c(t,e),t}(G);U.initializeProps=j(),U.decorators=[{type:t.Component,args:[{selector:"[wmNumber]",template:'<input class="form-control app-textbox app-number-input"\n inputmode="decimal"\n focus-target\n [attr.name]="name"\n role="textbox"\n type="text"\n [ngModel]="displayValue"\n [readonly]="readonly"\n [disabled]="disabled"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (ngModelChange)="onModelChange($event)"\n (blur)="handleBlur($event); checkForTrailingZeros($event);"\n (focus)="checkForTrailingZeros($event)"\n (input)="onInputChange($event.target.value)"\n [ngModelOptions]="ngModelOptions"\n [required]="required"\n (keypress)="validateInputEntry($event)"\n (keydown.backspace)="onBackspace($event)"\n (keydown.enter)="onEnter($event)"\n (keydown.ArrowUp)="onArrowPress($event, \'UP\')"\n (keydown.ArrowDown)="onArrowPress($event, \'DOWN\')"\n #input>\n',providers:[r.provideAs(U,i.NG_VALUE_ACCESSOR,!0),r.provideAs(U,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(U)]}]}],U.ctorParameters=function(){return[{type:t.Injector},{type:a.AbstractI18nService},{type:r.TrailingZeroDecimalPipe}]},U.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel,{static:!0}]}]};var W=new Map([["class",r.PROP_STRING],["collapsible",r.PROP_BOOLEAN],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"Option 1, Option 2, Option 3"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_ANY],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["itemclass",Object.assign({value:""},r.PROP_STRING)],["itemsperrow",Object.assign({value:"xs-1 sm-1 md-1 lg-1"},r.PROP_STRING)],["listclass",Object.assign({value:""},r.PROP_STRING)],["match",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showcount",r.PROP_BOOLEAN],["showindevice",Object.assign({displayType:"inline-block",value:"all"},r.PROP_STRING)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),q=function(){r.register("wm-radioset",W),r.registerFormWidget(a.FormWidgetType.RADIOSET,new Map(W))},z={widgetType:"wm-radioset",hostClass:"app-radioset list-group inline"},H=function(e){function t(t){var n=e.call(this,t,z)||this;return n.layout="",r.styler(n.nativeElement,n),n.multiple=!1,n}return c(t,e),t.prototype.onRadioLabelClick=function(e,t){$(e.target).is("input")&&(this.modelByKey=t,this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0))},t.prototype.handleEvent=function(t,n,i,o){"click"===n?this.eventManager.addEventListener(t,n,(function(e){if($(e.target).is("input"))return o.$event=e,i()})):_.includes(["change"],n)||e.prototype.handleEvent.call(this,t,n,i,o)},t.prototype.onPropertyChange=function(t,n,i){"tabindex"!==t&&("itemsperrow"===t?a.setListClass(this):e.prototype.onPropertyChange.call(this,t,n,i))},t}(A);H.initializeProps=q(),H.decorators=[{type:t.Component,args:[{selector:"[wmRadioset]",exportAs:"wmRadioset",template:'<ng-template [ngIf]="!groupby" [ngIfElse]="groupedListTemplate">\n <li [ngClass]="[\'radio\', \'app-radio\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n *ngFor="let item of datasetItems;let i = index"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item.key)" role="presentation">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"\n [attr.aria-label]="item.key"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n</ng-template>\n\n<input [disabled]="disabled || readonly" hidden class="model-holder">\n<div *ngIf="readonly || disabled" aria-readonly="true" class="readonly-wrapper"></div>\n\n\x3c!-- This template will be displayed when groupby is specified. --\x3e\n<ng-template #groupedListTemplate>\n <li *ngFor="let groupObj of groupedData" class="app-list-item-group">\n <ul class="item-group">\n <li class="list-group-header" (click)="handleHeaderClick($event)" [title]="groupObj.key" [ngClass]="{\'collapsible-content\': collapsible}">\n <h4 class="group-title">{{groupObj.key}}\n <div class="header-action">\n <i class="app-icon wi action wi-chevron-up" *ngIf="collapsible" title="{{appLocale.LABEL_COLLAPSE}}/{{appLocale.LABEL_EXPAND}}"></i>\n <span *ngIf="showcount" class="label label-default" [textContent]="groupObj.data.length"></span>\n </div>\n </h4>\n </li>\n <li *ngFor="let item of groupObj.data; let i = index;"\n [ngClass]="[\'radio\', \'app-radio\', \'group-list-item\', itemclass, itemsPerRowClass]"\n [class.active]="item.selected"\n [wmItemTemplate]="content" [userComponentParams]="item" partialContainer\n (click)="onRadioLabelClick($event, item)">\n \x3c!-- Default item template --\x3e\n <label *ngIf="!content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption" [textContent]="item.label"></span>\n </label>\n \x3c!-- Custom partial template --\x3e\n <label *ngIf="content" class="app-radioset-label"\n [ngClass]="{\'disabled\':disabled || readonly}">\n <input [name]="\'radioset_\' + widgetId" type="radio" [attr.aria-checked]="item.selected" [attr.data-attr-index]="i"\n [value]="item.key" [disabled]="disabled || readonly" [tabindex]="tabindex" [checked]="item.selected"/>\n <span class="caption customTemplate" partial-container-target></span>\n </label>\n </li>\n </ul>\n </li>\n</ng-template>\n',providers:[r.provideAs(H,i.NG_VALUE_ACCESSOR,!0),r.provideAs(H,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(H)]}]}],H.ctorParameters=function(){return[{type:t.Injector}]};var Y=new Map([["autofocus",r.PROP_BOOLEAN],["class",Object.assign({value:""},r.PROP_STRING)],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",r.PROP_ANY],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["dateformat",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["displayValue",r.PROP_STRING],["groupby",r.PROP_STRING],["hint",r.PROP_STRING],["match",r.PROP_STRING],["multiple",Object.assign({value:!1},r.PROP_BOOLEAN)],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["placeholder",r.PROP_STRING],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["usekeys",r.PROP_BOOLEAN]]),K=function(){r.register("wm-select",Y),r.registerFormWidget(a.FormWidgetType.SELECT,new Map(Y)),r.registerFormWidget(a.FormWidgetType.TYPEAHEAD,new Map(Y))},Q={widgetType:"wm-select",hostClass:"app-select-wrapper"},X=function(e){function t(t){var n=e.call(this,t,Q)||this;return n.acceptsArray=!0,n}return c(t,e),Object.defineProperty(t.prototype,"datasource",{set:function(e){e&&e.execute&&e.execute(a.DataSource.Operation.IS_BOUND_TO_LOCALE)&&(this.datavalue=e.execute(a.DataSource.Operation.GET_DEFAULT_LOCALE))},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.selectEl.nativeElement,this)},t.prototype.handleEvent=function(t,n,i,o){_.includes(["blur","change"],n)||e.prototype.handleEvent.call(this,this.selectEl.nativeElement,n,i,o)},t.prototype.onSelectValueChange=function(e){if(this.readonly)return this.placeholder?this.selectEl.nativeElement.value=this.placeholder:this.selectEl.nativeElement.value="",void(this.datavalue=this.prevDatavalue);this.invokeOnTouched(),this.invokeOnChange(this.datavalue,e||{},!0)},t.prototype.onPropertyChange=function(t,n,i){"required"!==t?"class"!==t&&"tabindex"!==t&&("readonly"===t&&(!0===n?a.setAttr(this.selectEl.nativeElement,"readonly","readonly"):a.removeAttr(this.selectEl.nativeElement,"readonly")),e.prototype.onPropertyChange.call(this,t,n,i)):this._onChange(this.datavalue)},t.prototype.checkForFloatingLabel=function(e){var t=$(this.selectEl.nativeElement).closest(".app-composite-widget.caption-floating");t.length>0&&("focus"===e.type&&(!this.datavalue||this.datavalue&&""===$(this.selectEl).find("select option:selected").text()&&this.placeholder)?$(this.selectEl.nativeElement).find("option:first").text(this.placeholder):this.datavalue||($(this.selectEl.nativeElement).find("option:selected").text(""),t.removeClass("float-active")))},t}(A);X.initializeProps=K(),X.decorators=[{type:t.Component,args:[{selector:"wm-select",template:'<select role="listbox" aria-haspopup="true" aria-expanded="false" #select\n focus-target\n [ngClass]="[\'app-select form-control\', class]"\n [disabled]="disabled"\n [required]="required"\n [tabindex]="tabindex"\n [(ngModel)]="modelByKey"\n [multiple]="multiple"\n (change)="onSelectValueChange($event)"\n (focus)="checkForFloatingLabel($event)"\n (blur)="invokeOnTouched($event); checkForFloatingLabel($event)"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [attr.aria-multiselectable]="multiple"\n [autofocus]="autofocus"\n>\n <option selected\n value="undefined"\n [textContent]="placeholder"\n [hidden]="!placeholder"></option>\n\n <ng-container *ngIf="groupby">\n <optgroup *ngFor="let groupObj of groupedData"\n [label]="groupObj.key">\n <option *ngFor="let item of groupObj.data;"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </optgroup>\n </ng-container>\n\n <ng-container *ngIf="!groupby">\n <option *ngFor="let item of datasetItems"\n [value]="item.key"\n [selected]="item.selected"\n [textContent]="item.label"\n role="option"></option>\n </ng-container>\n</select>\n',providers:[r.provideAs(X,i.NG_VALUE_ACCESSOR,!0),r.provideAs(X,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(X)]}]}],X.ctorParameters=function(){return[{type:t.Injector}]},X.propDecorators={selectEl:[{type:t.ViewChild,args:["select",{static:!0,read:t.ElementRef}]}]};var J=new Map([["class",r.PROP_STRING],["compareby",r.PROP_STRING],["datafield",r.PROP_STRING],["dataset",Object.assign({value:"yes, no, maybe"},r.PROP_ANY)],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayexpression",r.PROP_STRING],["displayfield",r.PROP_STRING],["hint",r.PROP_STRING],["iconclass",r.PROP_STRING],["name",r.PROP_STRING],["orderby",r.PROP_STRING],["required",r.PROP_BOOLEAN],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)]]),Z=function(){r.register("wm-switch",J),r.registerFormWidget(a.FormWidgetType.SWITCH,new Map(J)),r.registerFormWidget(a.FormWidgetType.TOGGLE,new Map(J))},ee={widgetType:"wm-switch",hostClass:"app-switch"},te=function(e){function t(t){var n=e.call(this,t,ee)||this;n.options=[],n._debounceSetSelectedValue=a.debounce((function(e){n.setSelectedValue(),n.updateHighlighter(e),e&&a.$appDigest()}),200);var i=n.dataset$.subscribe((function(){return n.updateSwitchOptions()}));n.registerDestroyListener((function(){return i.unsubscribe()}));var o=n.datavalue$.subscribe((function(){n._debounceSetSelectedValue(!0)}));return n.registerDestroyListener((function(){return o.unsubscribe()})),n}return c(t,e),t.prototype.ngAfterViewInit=function(){e.prototype.ngAfterViewInit.call(this),r.styler(this.nativeElement,this)},t.prototype.onStyleChange=function(t,n,i){"height"===t?a.setCSS(this.nativeElement,"overflow",n?"auto":""):e.prototype.onStyleChange.call(this,t,n,i)},t.prototype.setSelectedValue=function(){a.isDefined(this.datavalue)||a.isDefined(this.toBeProcessedDatavalue)?this.selectedItem=_.find(this.datasetItems,{selected:!0}):this.selectOptAtIndex(0)},t.prototype.updateSwitchOptions=function(){this.datasetItems.length&&(this.btnwidth=100/this.datasetItems.length,a.setCSS(this.nativeElement.querySelector(".app-switch-overlay"),"width",this.btnwidth+"%")),this._debounceSetSelectedValue(!0)},t.prototype.updateHighlighter=function(e){var t=$(this.nativeElement).find("span.app-switch-overlay");this.setSelectedValue();var n,i=this.selectedItem?_.findIndex(this.datasetItems,{key:this.selectedItem.key}):-1;null==i&&(i=-1),n=i*this.btnwidth,e?t.css("left",n+"%"):t.animate({left:n+"%"},300)},t.prototype.selectOptAtIndex=function(e){if(this.datasetItems.length){var t=this.datasetItems[e];this._modelByValue=t.value}},t.prototype.selectOpt=function(e,t,n){if(e.preventDefault(),!this.disabled){if(this.modelByKey=n.key,this.invokeOnTouched(),this.selectedItem&&t===_.findIndex(this.datasetItems,{key:this.selectedItem.key})){if(2!==this.datasetItems.length)return;t=1===t?0:1}this.selectedItem=this.datasetItems[t],this.updateHighlighter(),this.invokeOnChange(this.datavalue,e||{},!0),a.$appDigest()}},t.prototype.onPropertyChange=function(t,n,i){"disabled"!==t||a.toBoolean(n)?e.prototype.onPropertyChange.call(this,t,n,i):this.nativeElement.removeAttribute(t)},t}(A);te.initializeProps=Z(),te.decorators=[{type:t.Component,args:[{selector:"[wmSwitch]",template:'<div role="group" class="btn-group btn-group-justified">\n <a *ngFor="let opt of datasetItems; let $index = index;"\n focus-target\n href="javascript:void(0);"\n class="btn btn-default"\n [name]="\'wm-switch-\' + opt.key"\n [ngClass]="{\'selected\': opt.selected, \'disabled\': disabled}"\n (click)="selectOpt($event, $index, opt)"\n >\n <i *ngIf="opt.dataObject && opt.dataObject[iconclass]" aria-hidden="true" [ngClass]="[\'app-icon\', opt.dataObject[iconclass] || opt[\'icon\']]"></i>\n <span class="caption" [textContent]="opt[displayfield] || opt.label"></span>\n </a>\n</div>\n<span [title]="selectedItem ? selectedItem.label : modelByKey"\n class="btn btn-primary app-switch-overlay switch-handle">\n <i *ngIf="iconclass"\n class="app-icon {{(selectedItem && selectedItem.dataObject) && selectedItem.dataObject[iconclass]}}"></i>\n {{selectedItem ? selectedItem.label : modelByKey}}\n</span>\n<input [name]="name" class="model-holder ng-hide" [disabled]="disabled" [value]="modelByKey" [required]="required" aria-hidden="true">\n',providers:[r.provideAs(te,i.NG_VALUE_ACCESSOR,!0),r.provideAsWidgetRef(te)],exportAs:"wmSwitch"}]}],te.ctorParameters=function(){return[{type:t.Injector}]};var ne=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["class",r.PROP_STRING],["datasource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxvalue",r.PROP_NUMBER],["minvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",r.PROP_NUMBER],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",r.PROP_STRING],["updateon",r.PROP_STRING]]),ie=function(){r.register("wm-input-calendar",ne)},oe={widgetType:"wm-input-calendar",hostClass:"app-input-wrapper"},re=function(e){function t(t){return e.call(this,t,oe)||this}return c(t,e),t}(B);re.initializeProps=ie(),re.decorators=[{type:t.Component,args:[{selector:'wm-input[type="date"], wm-input[type="datetime-local"], wm-input[type="month"], wm-input[type="time"], wm-input[type="week"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint || type + \' field\'"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n #input>\n',providers:[r.provideAs(re,i.NG_VALUE_ACCESSOR,!0),r.provideAs(re,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(re)]}]}],re.ctorParameters=function(){return[{type:t.Injector}]},re.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ae=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"color"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),se=function(){r.register("wm-input-color",ae)},le={widgetType:"wm-input-color",hostClass:"app-input-wrapper"},ce=function(e){function t(t){return e.call(this,t,le)||this}return c(t,e),t}(B);ce.initializeProps=se(),ce.decorators=[{type:t.Component,args:[{selector:'wm-input[type="color"]',template:'<input class="form-control app-textbox"\n focus-target\n [type]="type"\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n #input>\n',providers:[r.provideAs(ce,i.NG_VALUE_ACCESSOR,!0),r.provideAs(ce,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(ce)]}]}],ce.ctorParameters=function(){return[{type:t.Injector}]},ce.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var pe=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"email"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),ue=function(){r.register("wm-input-email",pe)},de={widgetType:"wm-input-email",hostClass:"app-input-wrapper"},he=function(e){function t(t){return e.call(this,t,de)||this}return c(t,e),t}(B);he.initializeProps=ue(),he.decorators=[{type:t.Component,args:[{selector:'wm-input[type="email"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n email\n #input>\n',providers:[r.provideAs(he,i.NG_VALUE_ACCESSOR,!0),r.provideAs(he,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(he)]}]}],he.ctorParameters=function(){return[{type:t.Injector}]},he.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var me=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["maxvalue",r.PROP_NUMBER],["minvalue",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["step",r.PROP_NUMBER],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"number"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),fe=function(){r.register("wm-input-number",me)},ge={widgetType:"wm-input-number",hostClass:"app-input-wrapper"},ve=function(e){function t(t){return e.call(this,t,ge)||this}return c(t,e),t.prototype.onArrowPress=function(e){0===this.step&&e.preventDefault()},t.prototype.validateInputEntry=function(e){if("e"===e.key&&-1!==e.target.value.indexOf(e.key))return!1},t}(B);ve.initializeProps=fe(),ve.decorators=[{type:t.Component,args:[{selector:'wm-input[type="number"]',template:'<input class="form-control app-textbox"\n [ngClass]="{\'step-hidden\': step === 0}"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [min]="minvalue"\n [max]="maxvalue"\n [step]="step"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (ngModelChange)="handleChange($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n (keydown.ArrowUp)="onArrowPress($event)"\n (keydown.ArrowDown)="onArrowPress($event)"\n (keypress)="validateInputEntry($event)"\n #input>\n',providers:[r.provideAs(ve,i.NG_VALUE_ACCESSOR,!0),r.provideAs(ve,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(ve)]}]}],ve.ctorParameters=function(){return[{type:t.Injector}]},ve.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var ye=new Map([["autocomplete",Object.assign({value:!0},r.PROP_BOOLEAN)],["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["displayformat",r.PROP_STRING],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Enter text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["regexp",r.PROP_STRING],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["showdisplayformaton",Object.assign({value:"always"},r.PROP_ANY)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["type",Object.assign({value:"text"},r.PROP_STRING)],["updateon",r.PROP_STRING]]),be=function(){r.register("wm-input-text",ye),r.registerFormWidget(a.FormWidgetType.PASSWORD,new Map(ye));var e=new Map(ye),t=function(t){t.forEach((function(t,n){return e.set(n,t)}))};t(ne),t(ae),t(pe),t(me),r.registerFormWidget(a.FormWidgetType.TEXT,new Map(e))},we={widgetType:"wm-input-text",hostClass:"app-input-wrapper"},Pe=function(e){function t(t){var n=e.call(this,t,we)||this;return n.lazy=!1,n}return c(t,e),t.prototype.onPropertyChange=function(t,n,i){switch(t){case"displayformat":this.maskVal=this.displayformat,this.checkForDisplayFormat();break;case"showdisplayformaton":this.lazy="keypress"===n;break;default:e.prototype.onPropertyChange.call(this,t,n,i)}},Object.defineProperty(t.prototype,"mask",{get:function(){return!(!this.displayformat||!(!this.placeholder||this.placeholder&&this.isFocused))&&{mask:this.maskVal,lazy:this.lazy,definitions:{9:/\d/,A:/[a-zA-Z]/,a:/[a-z]/,"*":/\w/}}},enumerable:!1,configurable:!0}),t.prototype.checkForDisplayFormat=function(e){var t=this;this.displayformat?(this.isFocused=!!(e&&"focus"===e.type||this.datavalue),!this.isFocused&&this.imask&&this.imask.maskRef?(this.imask.maskRef.updateOptions({lazy:!0}),!this.datavalue&&this.imask.maskRef.value&&(this.imask.maskRef.value=this.datavalue)):setTimeout((function(){if(t.imask&&t.imask.maskRef&&t.imask.maskRef.value){var e=t.imask.maskRef.value.indexOf("_"),n=e>=0?t.imask.maskRef.value.slice(0,e).length:t.imask.maskRef.value.length;n!==t.imask.maskRef.cursorPos&&t.imask.maskRef.updateCursor(n)}}),50)):this.imask&&this.imask.maskRef&&(this.imask.maskRef.updateOptions({lazy:!0}),this.inputEl.nativeElement.value=this.datavalue)},t.prototype.ngOnInit=function(){e.prototype.ngOnInit.call(this),this.isFocused=!!this.datavalue},t}(B);Pe.initializeProps=be(),Pe.decorators=[{type:t.Component,args:[{selector:'wm-input[type="text"], wm-input:not([type]), wm-input[type="password"], wm-input[type="search"], wm-input[type="tel"], wm-input[type="url"]',template:'<input class="form-control app-textbox"\n focus-target\n role="textbox"\n [type]="type"\n [attr.name]="name"\n [attr.aria-label]="hint"\n [(ngModel)]="datavalue"\n [imask]="mask"\n [unmask]="true"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [pattern]="regexp"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [autofocus]="autofocus"\n (ngModelChange)="handleChange($event)"\n (blur)="handleBlur($event); checkForDisplayFormat($event)"\n (focus)="checkForDisplayFormat($event)"\n [autocomplete]="autocomplete ? \'on\' : \'off\'"\n (keyup.enter)="flushViewChanges(input.value)"\n #input>\n',providers:[r.provideAs(Pe,i.NG_VALUE_ACCESSOR,!0),r.provideAs(Pe,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(Pe)]}]}],Pe.ctorParameters=function(){return[{type:t.Injector}]},Pe.propDecorators={inputEl:[{type:t.ViewChild,args:["input",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}],imask:[{type:t.ViewChild,args:["input",{read:o.IMaskDirective}]}]};var _e=new Map([["autofocus",r.PROP_BOOLEAN],["autotrim",Object.assign({value:!0},r.PROP_BOOLEAN)],["class",r.PROP_STRING],["datavaluesource",r.PROP_ANY],["datavalue",r.PROP_STRING],["disabled",r.PROP_BOOLEAN],["hint",r.PROP_STRING],["maxchars",r.PROP_NUMBER],["name",r.PROP_STRING],["placeholder",Object.assign({value:"Place your text"},r.PROP_STRING)],["readonly",r.PROP_BOOLEAN],["required",r.PROP_BOOLEAN],["shortcutkey",r.PROP_STRING],["show",Object.assign({value:!0},r.PROP_BOOLEAN)],["tabindex",Object.assign({value:0},r.PROP_NUMBER)],["updateon",r.PROP_STRING],["limitdisplaytext",r.PROP_STRING],["charlength",r.PROP_NUMBER]]),Oe=function(){r.register("wm-textarea",_e),r.registerFormWidget(a.FormWidgetType.TEXTAREA,new Map(_e))},Se={widgetType:"wm-textarea",hostClass:"app-input-wrapper"},Ee=function(e){function t(t){var n=e.call(this,t,Se)||this;return n.charlength=0,n}return c(t,e),t.prototype.onInputChange=function(){this.charlength=this.inputEl.nativeElement.value.length},t}(B);Ee.initializeProps=Oe(),Ee.decorators=[{type:t.Component,args:[{selector:"wm-textarea",template:'<textarea class="form-control app-textarea"\n focus-target\n role="textbox"\n [attr.name]="name"\n [(ngModel)]="datavalue"\n [ngModelOptions]="ngModelOptions"\n [readonly]="readonly"\n [required]="required"\n [disabled]="disabled"\n [maxlength]="maxchars"\n [attr.tabindex]="tabindex"\n [attr.placeholder]="placeholder"\n [attr.accesskey]="shortcutkey"\n [attr.aria-label]="hint"\n aria-multiline="true"\n [autofocus]="autofocus"\n (blur)="handleBlur($event)"\n (input)="onInputChange()"\n (ngModelChange)="handleChange($event); onInputChange();"\n #textarea\n></textarea>\n\n<div *ngIf="maxchars" class="textarea-count" >{{limitdisplaytext}}</div>\n',providers:[r.provideAs(Ee,i.NG_VALUE_ACCESSOR,!0),r.provideAs(Ee,i.NG_VALIDATORS,!0),r.provideAsWidgetRef(Ee)]}]}],Ee.ctorParameters=function(){return[{type:t.Injector}]},Ee.propDecorators={inputEl:[{type:t.ViewChild,args:["textarea",{static:!0}]}],ngModel:[{type:t.ViewChild,args:[i.NgModel]}]};var Te=function(){function e(e,n){this.skipFloatPositionWidgets=["radioset","checkboxset","richtext","switch","chips","checkbox","slider","rating","toggle","upload"],this.elementRef=e.get(t.ElementRef),this.nativeEl=this.elementRef.nativeElement,this.app=n}return e.prototype.onBlurCb=function(){var e;this.inputEl.length>1&&this.inputEl.hasClass("mobile-input")&&_.forEach(this.inputEl,(function(t){$(t).hasClass("mobile-input")&&t.value&&(e=t.value)})),this.inputEl.val()||e||(this.compositeEle.classList.remove("float-active"),this.inputEl.removeAttr("placeholder"))},e.prototype.onFocusCb=function(){this.compositeEle.classList.add("float-active"),this.inputEl.attr("placeholder",this.placeholder)},e.prototype.checkForSelectPlaceholder=function(){!$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").is(":focus")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.nativeEl).find("select option:selected").text("")},e.prototype.setDefaultValueAnimation=function(){!this._isPlaceholderBound&&this.inputEl.attr("placeholder")&&(this.placeholder=this.inputEl.attr("placeholder"),this.inputEl.removeAttr("placeholder")),this.checkForSelectPlaceholder(),(this.inputEl.val()&&!this.inputEl.is("select")||$(this.inputEl.closest("[widget-id]")).attr("datavalue")||$(this.inputEl.parent("[widget-id]")).attr("datavalue.bind")||this.nativeEl.getAttribute("defaultvalue")||this.nativeEl.getAttribute("displayformat")||$(this.nativeEl).find("select option:selected").text()||$(this.nativeEl).find("select").attr("multiple"))&&this.compositeEle.classList.add("float-active")},e.prototype.observeForPlaceholderAttrChange=function(){var e=this;this._attrObserver=new MutationObserver((function(t){t.forEach((function(t){"placeholder"===t.attributeName&&e.inputEl.attr("placeholder")&&!e.compositeEle.classList.contains("float-active")&&(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder"))}))}));this._attrObserver.observe(this.inputEl[0],{attributes:!0,childList:!1,characterData:!1})},e.prototype.checkForRightAlignedForm=function(){var e=$(this.compositeEle);if(e.closest(".align-right").length&&e.find(".input-group-btn").length){var t=e.find("label");e.find("[wmdatetime]").length?t.addClass("input-grp-dt-icon"):t.addClass("input-grp-icon")}},e.prototype.ngAfterViewInit=function(){this.compositeEle=this.nativeEl;var e=this.nativeEl.widget,t=e.$attrs.get("captionposition");if(e.form&&(t=e.form.$attrs.get("captionposition"),this.compositeEle=this.nativeEl.querySelector(".app-composite-widget"),this._isPlaceholderBound=this.nativeEl.getAttribute("placeholder.bind")),"floating"===t){if(e.form){var n=this.nativeEl.getAttribute("widgettype");this.skipFloatPositionWidgets.indexOf(n)>-1&&(this.compositeEle.classList.remove("caption-floating"),this.compositeEle.classList.add("caption-top")),this.checkForRightAlignedForm()}this.inputEl=$(this.nativeEl).find("input, select, textarea"),this._isPlaceholderBound||(this._isPlaceholderBound=this.inputEl.closest("[widget-id]").attr("placeholder.bind")),setTimeout(this.setDefaultValueAnimation.bind(this),0),this.inputEl.focus(this.onFocusCb.bind(this)),this.inputEl.blur(this.onBlurCb.bind(this)),this._isPlaceholderBound&&this.observeForPlaceholderAttrChange()}},e.prototype.ngOnInit=function(){var e=this;this.labelAnimationSubscription=this.app.subscribe("captionPositionAnimate",(function(t){var n=e.inputEl&&e.inputEl.is(":focus");if(t.displayVal||t.isFocused||t.isSelectMultiple||n)t.nativeEl.addClass("float-active"),!t.displayVal&&n&&e.inputEl.attr("placeholder",e.placeholder);else if(t.nativeEl.removeClass("float-active"),e.inputEl){var i=e.inputEl.find("option:first");(e.inputEl.attr("placeholder")||i.text())&&(i.length?i.text(""):(e.placeholder=e.inputEl.attr("placeholder"),e.inputEl.removeAttr("placeholder")))}}))},e.prototype.ngOnDestroy=function(){this.labelAnimationSubscription&&this.labelAnimationSubscription(),this._attrObserver&&this._attrObserver.disconnect()},e}();Te.decorators=[{type:t.Directive,args:[{selector:"[captionPosition]"}]}],Te.ctorParameters=function(){return[{type:t.Injector},{type:a.App}]};var Ce=[m,v,Te,C,N,L,U,H,X,te,re,ce,he,ve,Pe,Ee],Ae=function(){};Ae.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule,i.FormsModule,r.WmComponentsModule,o.IMaskModule],declarations:u([],p(Ce)),exports:u([],p(Ce)),entryComponents:[]}]}],e.BaseFormComponent=y,e.BaseFormCustomComponent=w,e.ButtonComponent=m,e.ButtonGroupDirective=v,e.CaptionPositionDirective=Te,e.CheckboxComponent=C,e.CheckboxsetComponent=N,e.CompositeDirective=L,e.DatasetAwareFormComponent=A,e.InputCalendarComponent=re,e.InputColorComponent=ce,e.InputEmailComponent=he,e.InputModule=Ae,e.InputNumberComponent=ve,e.InputTextComponent=Pe,e.NumberComponent=U,e.NumberLocale=G,e.RadiosetComponent=H,e.SelectComponent=X,e.SwitchComponent=te,e.TextareaComponent=Ee,e["\u02750"]=T,e["\u0275a"]=d,e["\u0275b"]=f,e["\u0275c"]=O,e["\u0275d"]=I,e["\u0275e"]=x,e["\u0275f"]=B,e["\u0275g"]=j,e["\u0275h"]=q,e["\u0275i"]=K,e["\u0275j"]=Z,e["\u0275k"]=ie,e["\u0275l"]=se,e["\u0275m"]=ue,e["\u0275n"]=fe,e["\u0275o"]=be,e["\u0275p"]=Oe,Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@wm/core"),require("@wm/components/base"),require("@angular/common")):"function"==typeof define&&define.amd?define("@wm/components/basic",["exports","@angular/core","@wm/core","@wm/components/base","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).wm=e.wm||{},e.wm.components=e.wm.components||{},e.wm.components.basic={}),e.ng.core,e.wm.core,e.wm.components.base,e.ng.common)}(this,(function(e,t,n,i,o){"use strict";
58
58
  /*! *****************************************************************************
59
59
  Copyright (c) Microsoft Corporation.
60
60