@mescius/wijmo.input
Version:
UI library for pure JS, Angular, React, Vue and more...
14 lines (13 loc) • 263 kB
JavaScript
/*!
*
* Wijmo Library 5.20251.40
* https://developer.mescius.com/wijmo
*
* Copyright(c) MESCIUS inc. All rights reserved.
*
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
* us.sales@mescius.com
* https://developer.mescius.com/wijmo/licensing
*
*/
"use strict";var __extends=this&&this.__extends||function(){var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};return function(e,t){extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.hasOwnProperty.call(e,i)&&(t[i]=e[i]);t.default=e;return t};Object.defineProperty(exports,"__esModule",{value:!0});var wijmo_1=require("@mescius/wijmo"),selfModule=__importStar(require("@mescius/wijmo.input"));exports.AutoCompleteClsNames={hostElement:"wj-autocomplete"};exports.CalendarClsNames={buttonsOutside:"wj-btns-outside",calendarHeader:"wj-calendar-header",calendarMonth:"wj-calendar-month",calendarMultiMonth:"wj-calendar-multimonth",calendarOuter:"wj-calendar-outer",calendarYear:"wj-calendar-year",dayOtherMonth:"wj-day-othermonth",dayToday:"wj-day-today",dayWeekend:"wj-day-weekend",header:"wj-header",hostElement:"wj-calendar",monthSelect:"wj-month-select",weekAfter:"wj-week-after",weekBefore:"wj-week-before",yearPicker:"wj-yearpicker",focused:"wj-state-focus",selectedYear:"wj-select-year",confirmationButtonContainer:"wj-calendar-confirmation-button-container",button:"wj-calendar-button"};exports.CollectionViewNavigatorClsNames={hostElement:"wj-collectionview-navigator",pager:"wj-pager"};exports.ColorPickerClsNames={colorBox:"wj-colorbox",hostElement:"wj-colorpicker"};exports.ComboBoxClsNames={hostElement:"wj-combobox",stateMatch:"wj-state-match"};exports.DropDownClsNames={dropDownPanel:"wj-dropdown-panel",hostElement:"wj-dropdown"};exports.InputClsNames={input:"wj-input",inputBtnVisible:"wj-input-btn-visible",inputGroup:"wj-input-group",inputGroupBtn:"wj-input-group-btn"};exports.InputColorClsNames={hostElement:"wj-inputcolor",inputColorBox:"wj-inputcolorbox"};exports.InputDateClsNames={hostElement:"wj-inputdate",inputDateDropDown:"wj-inputdate-dropdown"};exports.InputDateRangeClsNames={hostElement:"wj-inputdaterange"};exports.InputDateTimeClsNames={hostElement:"wj-inputdatetime"};exports.InputMaskClsNames={hostElement:"wj-inputmask"};exports.InputNumberClsNames={hostElement:"wj-inputnumber",numeric:"wj-numeric",showSpinner:"wj-input-show-spinner"};exports.InputTimeClsNames={hostElement:"wj-inputtime"};exports.ListBoxClsNames={header:"wj-header",hostElement:"wj-listbox",listBoxItem:"wj-listbox-item"};exports.MenuClsNames={hostElement:"wj-menu",menuItems:"wj-menu-items",subItems:"wj-subitems"};exports.MultiAutoCompleteClsNames={hostElement:"wj-multi-autocomplete",token:"wj-token",tokenActive:"wj-token-active",tokenClose:"wj-token-close",tokenHelper:"wj-token-helper",tokenLabel:"wj-token-label"};exports.MultiSelectClsNames={hostElement:"wj-multiselect"};exports.MultiSelectListBoxClsNames={header:"wj-header",hostElement:"wj-multiselectlistbox",selectAll:"wj-select-all"};exports.PopupClsNames={dialogHeader:"wj-dialog-header",hostElement:"wj-popup",popupBackDrop:"wj-popup-backdrop",dialogBody:"wj-dialog-body",dialogFooter:"wj-dialog-footer"};wijmo_1._addCultureInfo("InputNumber",{ariaLabels:{incVal:"Increase Value",decVal:"Decrease Value",inputNumberInput:"InputNumber Input",inputNumber:"Input Number"}});var InputNumber=function(e){__extends(InputNumber,e);function InputNumber(t,i){var o=e.call(this,t)||this;o._value=null;o._min=null;o._max=null;o._format="";o._step=null;o._showBtn=!0;o._readOnly=!1;o._handleWheel=!0;o._oldText="";o._fromKb=!0;o._inputElementAriaLabel=wijmo_1.culture.InputNumber.ariaLabels.inputNumberInput;o._ariaLabelledby=null;o.textChanged=new wijmo_1.Event;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputNumberClsNames.hostElement,n,{_tbx:"input",_btnUp:"btn-inc",_btnDn:"btn-dec"},"input");var s=o.inputElement;o.hostElement;wijmo_1.setAttribute(s,"role","spinbutton",!0);o._updateInputAriaLabel();var r=wijmo_1.culture.InputNumber.ariaLabels;wijmo_1.setAriaLabel(o._btnUp.querySelector("button"),r.incVal);wijmo_1.setAriaLabel(o._btnDn.querySelector("button"),r.decVal);o._tbx.type.match(/number/i)&&(o.inputType="");var a=o._tbx;a.autocomplete="off";a.spellcheck=!1;o._updateSymbols();var l=o.addEventListener.bind(o);l(a,"keypress",o._keypress.bind(o));l(a,"keydown",o._keydown.bind(o));l(a,"input",o._input.bind(o));l(a,"blur",(function(){o.text!=o._oldText&&o._setText(o.text)}));l(a,"paste",(function(){o._fromKb=!1}));l(a,"compositionstart",(function(){o._composing=!0}));l(a,"compositionend",(function(){o._composing=!1;setTimeout((function(){var e=o.text,t=o._oldText,i=o._chrPct;t&&t.indexOf(i)>-1&&e.indexOf(i)<0&&(e+=i);o._setText(e)}))}));var h=o._clickSpinner.bind(o);l(o._btnUp,"click",h);l(o._btnDn,"click",h);o._rptUp=new wijmo_1._ClickRepeater(o._btnUp.querySelector("button"));o._rptDn=new wijmo_1._ClickRepeater(o._btnDn.querySelector("button"));l(a,"wheel",(function(e){if(o.handleWheel&&!e.defaultPrevented&&!e.ctrlKey&&o._isEditable()&&o.containsFocus()){var t=wijmo_1.clamp(-e.deltaY,-1,1);o._increment((o.step||1)*t);setTimeout((function(){return o.selectAll()}));e.preventDefault()}}));o.value=0;o.isRequired=!0;o.initialize(i);return o}Object.defineProperty(InputNumber,"controlTemplate",{get:function(){InputNumber._ctrlTemplate||(InputNumber._ctrlTemplate='<div class="'+wijmo_1.ControlClsNames.template+'"><div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-dec" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">-</button></span><input type="tel" inputmode="numeric" wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+" "+exports.InputNumberClsNames.numeric+'"/><span wj-part="btn-inc" class="'+exports.InputClsNames.inputGroupBtn+'" tabindex="-1"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'" tabindex="-1">+</button></span></div></div></div>');return InputNumber._ctrlTemplate},set:function(e){InputNumber._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"value",{get:function(){return this._value},set:function(e){if(e!=this._value)if(null==(e=wijmo_1.asNumber(e,!this.isRequired||null==e&&null==this._value)))this._setText("");else if(!isNaN(e)){var t=wijmo_1.Globalize.format(e,this.format);this._setText(t)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(e){this._tbx.required=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"isReadOnly",{get:function(){return this._readOnly},set:function(e){this._readOnly=wijmo_1.asBoolean(e);this.inputElement.readOnly=this._readOnly;wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"handleWheel",{get:function(){return this._handleWheel},set:function(e){this._handleWheel=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"min",{get:function(){return this._min},set:function(e){if(e!=this._min){this._min=wijmo_1.asNumber(e,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"max",{get:function(){return this._max},set:function(e){if(e!=this._max){this._max=wijmo_1.asNumber(e,!0);this._updateAria()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"step",{get:function(){return this._step},set:function(e){this._step=wijmo_1.asNumber(e,!0);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"format",{get:function(){return this._format},set:function(e){if(e!=this.format){this._format=wijmo_1.asString(e);this.refresh()}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"text",{get:function(){return this._tbx.value},set:function(e){if(e!=this.text){this._oldText=this.text;this._setText(e)}},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(e){this._tbx.placeholder=e},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"showSpinner",{get:function(){return this._showBtn},set:function(e){this._showBtn=wijmo_1.asBoolean(e);this._updateBtn()},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"repeatButtons",{get:function(){return!this._rptUp.disabled},set:function(e){this._rptUp.disabled=this._rptDn.disabled=!wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputNumber.prototype,"ariaLabelledBy",{get:function(){return this._ariaLabelledby},set:function(e){wijmo_1._setAriaLabelBy(this,this._tbx,e,this._updateInputAriaLabel.bind(this))},enumerable:!0,configurable:!0});InputNumber.prototype.selectAll=function(){var e=this._tbx;wijmo_1.setSelectionRange(e,0,e.value.length)};InputNumber.prototype.clamp=function(e){return wijmo_1.clamp(e,this.min,this.max)};InputNumber.prototype.onTextChanged=function(e){this.textChanged.raise(this,e);this._updateState()};InputNumber.prototype.onValueChanged=function(e){this._updateAria();this.valueChanged.raise(this,e)};InputNumber.prototype.dispose=function(){this._rptUp.element=null;this._rptDn.element=null;e.prototype.dispose.call(this)};InputNumber.prototype.onGotFocus=function(t){this._oldValue=this.value;if(!this.isTouching){this._tbx.focus();this.selectAll()}e.prototype.onGotFocus.call(this,t)};InputNumber.prototype.onLostFocus=function(t){if(this._composing){this._composing=!1;this._setText(this.text)}if(this._isEditable()){var i=this.clamp(this.value);if(i==this.value||this.onInvalidInput(new wijmo_1.CancelEventArgs)){var o=wijmo_1.Globalize.format(i,this.format);this._setText(o)}}e.prototype.onLostFocus.call(this,t)};InputNumber.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);if(this.hostElement){this._updateSymbols();var i=wijmo_1.Globalize.format(this.value,this.format);this._setText(i)}};InputNumber.prototype._isEditable=function(){return!this.isReadOnly&&!this.isDisabled};InputNumber.prototype._updateSymbols=function(){var e=wijmo_1.culture.Globalize.numberFormat,t=wijmo_1.Globalize._parseNumericFormat(this.format);this._chrDec=e["."]||".";this._chrTho=e[","]||",";this._chrNeg=e["-"]||"-";this._chrPls=e["+"]||"+";this._chrPct=e["%"]||"%";this._chrCur=t.curr||e.currency.symbol||"$";this._fmtSpc=t.spec;this._fmtPrc=t.prec;this._rxSym=new RegExp("^[%+\\-() \\"+this._chrDec+"\\"+this._chrCur+"\\"+this._chrNeg+"\\"+this._chrPls+"\\"+this._chrPct+"]*$");this._rxNeg=new RegExp("^\\s*(\\-|\\"+this._chrNeg+")|([^e](\\-|\\"+this._chrNeg+")|\\()")};InputNumber.prototype._isNumeric=function(e,t){var i=e==this._chrDec||e>="0"&&e<="9",o="x"==this._fmtSpc;!i&&o&&(i=e>="a"&&e<="f"||e>="A"&&e<="F");i||t||o||(i=e==this._chrPls||e==this._chrNeg||"("==e||")"==e);return i};InputNumber.prototype._getInputRange=function(e){for(var t=[0,0],i=this.text,o=!1,n=0;n<i.length;n++)if(this._isNumeric(i[n],e)){if(!o){t[0]=n;o=!0}t[1]=n+1}return t};InputNumber.prototype._flipSign=function(){var e=this._getSelStartDigits();this.value*=-1;this._setSelStartDigits(e)};InputNumber.prototype._getSelStartDigits=function(){for(var e=0,t=this._tbx.selectionStart,i=this._tbx.value,o=0;o<i.length&&o<t;o++)this._isNumeric(i[o],!0)&&e++;return e};InputNumber.prototype._setSelStartDigits=function(e){for(var t=this._tbx.value,i=0;i<t.length&&e>=0;i++)if(this._isNumeric(t[i],!0)){if(!e){wijmo_1.setSelectionRange(this._tbx,i);break}e--}else if(!e){wijmo_1.setSelectionRange(this._tbx,i);break}};InputNumber.prototype._increment=function(e){if(e){var t=this.clamp(wijmo_1.isNumber(this.value)?this.value+e:0),i=wijmo_1.Globalize.format(t,this.format,!1,!1);this._setText(i)}};InputNumber.prototype._updateBtn=function(){var e=this.showSpinner&&!!this.step,t=e;wijmo_1.setCss([this._btnUp,this._btnDn],{display:e?"":"none"});wijmo_1.toggleClass(this.hostElement,exports.InputNumberClsNames.showSpinner,e);wijmo_1.enable(this._btnUp,t);wijmo_1.enable(this._btnDn,t);this._updateAria()};InputNumber.prototype._setText=function(e,t,i){void 0===t&&(t=!1);void 0===i&&(i=!1);if(!this._composing){var o=this._tbx,n=this._chrDec,s=this._rxNeg.test(e),r=this._delKey,a=this.containsFocus();e&&this._rxSym.test(e)&&a&&(e=this.isRequired||!r?(s?"-0":"0")+(e.indexOf(n)>-1?n:""):"");this._delKey=!1;r&&0==this.value&&!this.isRequired&&(e="");if(!e){if(!this.isRequired||i){o.value="";if(this._oldText){this._oldText=e;this.onTextChanged()}if(null!=this._value){this._value=null;this.onValueChanged()}this._updateBtn();return}e="0"}var l=e.indexOf(n),h=this._format||(l>-1?"n2":"n0"),u=wijmo_1.Globalize.parseFloat(e,h);isFinite(u)||(u=this.clamp(u));if(isNaN(u))if(this.onInvalidInput(new wijmo_1.CancelEventArgs))o.value=this._oldText;else{o.value=e;this.focus()}else{var c=a&&l>-1?2:null,p=wijmo_1.Globalize.format(u,h,!1,t,c);s&&u>=0&&!r&&(p=this._chrNeg+p);a&&l>-1&&"g"==this._fmtSpc&&0!=this._fmtPrc&&(p=e).indexOf(n)<0&&(p+=n);if(o.value!=p){o.value=p;u=wijmo_1.Globalize.parseFloat(p,h)}if(this.text!=this._oldText){this._oldText=this.text;this.onTextChanged()}if(u!=this._value){this._value=u;this.onValueChanged()}this._updateBtn();this._updateState()}}};InputNumber.prototype._keypress=function(e){if(!e.defaultPrevented&&!this._composing&&this._isEditable()&&e.charCode&&!e.ctrlKey&&!e.metaKey&&e.keyCode!=wijmo_1.Key.Enter){var t=this._tbx,i=String.fromCharCode(e.charCode);if(this._isNumeric(i,!1)){var o=t.maxLength;if(o>-1&&t.value.length>=o&&t.selectionEnd==t.selectionStart){e.preventDefault();return}var n=this._getInputRange(!0),s=t.selectionStart,r=t.selectionEnd;if(s<n[0]&&r<t.value.length){r=Math.max(r,n[0]);wijmo_1.setSelectionRange(t,n[0],r)}if(s>=n[1]){var a=null!=this._fmtPrc?this._fmtPrc:2,l=t.value.indexOf(this._chrDec);l>-1&&s-l>a&&e.preventDefault()}}else e.preventDefault();switch(i){case"-":case this._chrNeg:if(this.clamp(-1)>=0)this.value<0&&this._flipSign();else if(this.value&&t.selectionStart==t.selectionEnd)this._flipSign();else if(this.clamp(-1)<0){t.value=this._chrNeg;wijmo_1.setSelectionRange(t,1)}e.preventDefault();break;case"+":case this._chrPls:this.value<0&&this._flipSign();e.preventDefault();break;case".":case this._chrDec:if(0==this._fmtPrc)e.preventDefault();else{var h=t.value.indexOf(this._chrDec);if(h>-1){t.selectionStart<=h&&h++;wijmo_1.setSelectionRange(t,h);e.preventDefault()}}}if(!e.defaultPrevented&&wijmo_1.isIE()){var u=t.value;if((s=t.selectionStart)==(r=t.selectionEnd)){t.value=u.substr(0,s)+i+u.substr(r);wijmo_1.setSelectionRange(t,s+1);e.preventDefault();this._input()}}}};InputNumber.prototype._keydown=function(e){var t=this;this._delKey=!1;if(!e.defaultPrevented&&!this._composing){var i=wijmo_1.hasClass(this._tbx,"wj-grid-ime");if(!i||e.keyCode==wijmo_1.Key.Back||e.keyCode==wijmo_1.Key.Delete){var o=this._tbx,n=o.value,s=o.selectionStart,r=o.selectionEnd;switch(e.keyCode){case 65:if(e.ctrlKey){setTimeout((function(){t.selectAll()}));e.preventDefault()}break;case wijmo_1.Key.Up:case wijmo_1.Key.Down:if(this.step&&this._isEditable()){this._increment(this.step*(e.keyCode==wijmo_1.Key.Up?1:-1));setTimeout((function(){t.selectAll()}));e.preventDefault()}break;case wijmo_1.Key.Back:this._delKey=!0;if(r-s<2&&this._isEditable()){var a=n[r-1];if(a==this._chrDec||a==this._chrPct||a==this._chrTho||")"==a){setTimeout((function(){r=a==t._chrPct?t._getInputRange(!0)[1]:r-1;wijmo_1.setSelectionRange(o,r)}));e.preventDefault()}}break;case wijmo_1.Key.Delete:this._delKey=!0;if(r-s<2&&this._isEditable())if("0"==n&&1==s)wijmo_1.setSelectionRange(o,0);else{var l=n[s];if(l==this._chrDec||l==this._chrPct){setTimeout((function(){wijmo_1.setSelectionRange(o,s+1)}));e.preventDefault()}}break;case wijmo_1.Key.Escape:this.value=this._oldValue;this.selectAll()}i&&this._delKey&&this._isEditable()&&this._setText(null,!1,!0)}}};InputNumber.prototype._input=function(){var e=this;this._composing?this._fromKb=!0:setTimeout((function(){var t=e._tbx,i=t.value,o=i.indexOf(e._chrDec),n=t.selectionStart,s=e._getSelStartDigits();"p"==e._fmtSpc&&i.length&&i.indexOf(e._chrPct)<0&&(i+=e._chrPct);e._setText(i,e._fromKb);e._fromKb=!0;if(e.containsFocus()){var r=t.value,a=r.indexOf(e._chrDec),l=e._getInputRange(!0);if(i==e._chrNeg+e._chrDec&&a>-1){wijmo_1.setSelectionRange(t,a+1);return}if(i[0]==e._chrNeg&&r[0]!=e._chrNeg){1==r.length?wijmo_1.setSelectionRange(t,1):e._setSelStartDigits(s);return}i?i==e._chrDec&&a>-1?n=a+1:n<=o&&a>-1||o<0&&a<0?n+=r.length-i.length:o<0&&a>-1&&(n=a):n=a>-1?a:l[1];n=wijmo_1.clamp(n,l[0],l[1]);wijmo_1.setSelectionRange(t,n)}}))};InputNumber.prototype._clickSpinner=function(e){var t=this;if(!e.defaultPrevented&&this._isEditable()&&this.step){this._increment(this.step*(wijmo_1.contains(this._btnUp,e.target)?1:-1));if(!this.isTouching){wijmo_1.Control.sharedState.InvalidScroll=wijmo_1.isEdge();setTimeout((function(){return t.selectAll()}))}}};InputNumber.prototype._updateAria=function(){var e=this.inputElement;if(this.hostElement){wijmo_1.setAttribute(e,"aria-valuemin",this.min);wijmo_1.setAttribute(e,"aria-valuemax",this.max);wijmo_1.setAttribute(e,"aria-valuenow",this.value);wijmo_1.setAttribute(e,"aria-valuetext",this.text);wijmo_1.setAttribute(e,"step",this.step);wijmo_1.enable(this._btnDn,null==this.min||this.value>this.min);wijmo_1.enable(this._btnUp,null==this.max||this.value<this.max)}};InputNumber.prototype._updateInputAriaLabel=function(){var e=this.inputElement;!e||e.id||this._ariaLabelledby?wijmo_1.setAttribute(e,"aria-label",null):wijmo_1.setAttribute(e,"aria-label",this._inputElementAriaLabel)};InputNumber.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputNumber.ariaLabels.inputNumber};InputNumber._ctrlTemplate="";return InputNumber}(wijmo_1.Control);exports.InputNumber=InputNumber;wijmo_1._addCultureInfo("InputMask",{ariaLabels:{inputMask:"Input Mask"}});var InputMask=function(e){__extends(InputMask,e);function InputMask(t,i){var o=e.call(this,t)||this;o._fullEdit=!1;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.InputMaskClsNames.hostElement,n,{_tbx:"input"},"input");if("INPUT"==o._orgTag){var s=o._tbx.getAttribute("value");s&&(o.value=s)}o._msk=new wijmo_1._MaskProvider(o._tbx);o.isRequired=!0;o.initialize(i);o.addEventListener(o._tbx,"input",(function(){o.onValueChanged()}));o.addEventListener(o._tbx,"blur",o._commitText.bind(o));o.addEventListener(o._tbx,"keydown",(function(e){e.keyCode==wijmo_1.Key.Enter&&o._commitText()}));return o}Object.defineProperty(InputMask,"controlTemplate",{get:function(){InputMask._ctrlTemplate||(InputMask._ctrlTemplate='<div class="'+exports.InputClsNames.input+'"><div class="'+exports.InputClsNames.inputGroup+'"><input wj-part="input" class="'+wijmo_1.InputFormElementsClsNames.formControl+'"/></div></div>');return InputMask._ctrlTemplate},set:function(e){InputMask._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputElement",{get:function(){return this._tbx},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"inputType",{get:function(){return this._tbx.type},set:function(e){this._tbx.type=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"value",{get:function(){return this._tbx.value},set:function(e){if(e!=this.value){this._tbx.value=wijmo_1.asString(e);e=this._msk._applyMask();this._tbx.value=e;this.onValueChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"rawValue",{get:function(){return this._msk.getRawValue()},set:function(e){e!=this.rawValue&&(this.value=wijmo_1.asString(e))},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"mask",{get:function(){return this._msk.mask||""},set:function(e){var t=this.value;this._msk.mask=wijmo_1.asString(e);this.value!=t&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"promptChar",{get:function(){return this._msk.promptChar},set:function(e){var t=this.value;this._msk.promptChar=e;this.value!=t&&this.onValueChanged()},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"overwriteMode",{get:function(){return this._msk.overwriteMode},set:function(e){this._msk.overwriteMode=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"placeholder",{get:function(){return this._tbx.placeholder},set:function(e){this._tbx.placeholder=e},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"maskFull",{get:function(){return this._msk.maskFull},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isRequired",{get:function(){return this._tbx.required},set:function(e){this._tbx.required=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(InputMask.prototype,"isReadOnly",{get:function(){return this._tbx.readOnly},set:function(e){this._tbx.readOnly=wijmo_1.asBoolean(e);wijmo_1.toggleClass(this.hostElement,wijmo_1.ControlStateClsNames.readOnly,this.isReadOnly)},enumerable:!0,configurable:!0});InputMask.prototype.selectAll=function(){var e=this._msk.getMaskRange();wijmo_1.setSelectionRange(this._tbx,e[0],e[1]+1)};InputMask.prototype.onValueChanged=function(e){if(this.value!=this._oldValue){this._oldValue=this.value;this.valueChanged.raise(this,e)}this._updateState()};InputMask.prototype._commitText=function(){(this.rawValue||this.isRequired)&&(this.maskFull||this.onInvalidInput(new wijmo_1.CancelEventArgs));this._updateState()};InputMask.prototype.dispose=function(){this._msk.input=null;e.prototype.dispose.call(this)};InputMask.prototype.refresh=function(t){void 0===t&&(t=!0);e.prototype.refresh.call(this,t);this.hostElement&&this._msk.refresh()};InputMask.prototype.onGotFocus=function(t){this.selectAll();e.prototype.onGotFocus.call(this,t)};InputMask.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputMask.ariaLabels.inputMask};InputMask._ctrlTemplate="";return InputMask}(wijmo_1.Control);exports.InputMask=InputMask;var ColorPicker=function(e){__extends(ColorPicker,e);function ColorPicker(t,i){var o=e.call(this,t)||this;o._hsb=[.5,1,1];o._alpha=1;o.valueChanged=new wijmo_1.Event;var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ColorPickerClsNames.hostElement,n,{_eSB:"div-sb",_eHue:"div-hue",_eAlpha:"div-alpha",_ePreview:"div-pv",_ePal:"div-pal",_eText:"div-text"});o._palette="#FFF,#000,#F00,#FFC000,#FFFF00,#92D050,#00B050,#00B0F0,#0070C0,#7030A0".split(",");o._updatePalette();o._eHue.style.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAD4CAIAAACi6hsPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAGvSURBVDhPXdBPaM9xHMfxz4pWaxcmtoOhpdXSVpiyHWxqmVpDjaU5rK34XfypjTJ/p+ZPay6jhsOsRrKwaJElf9IQq03WIkv4FeMwMq221tfje1ByeFzfvd7PEKWGEKWTQRZLySWfVRRTQjmVbKWGOhLsZT+HaeY0bbTTQSfdXOcWffTzmAFeMcwoYyT5ygS/mA5hNgphip98J8kHRnnNSwZ4yH1uc4OrdHGR87RximYO0cgedlLLdqqoYAPrWMtKVrCcJSxiPmnMJUQp/Bsyk2xyyKOAQooopYwKtlDNDur5G7SBJo7RQiv/B+2hl3s84CkvGGKEOOYnxolj/mYmhBmDJ5ngCx95xxsGecYj4pB3iENeoZMO2mmlhaMcpIE4ZII6aqhmM3HMMkooopB88sghm0wySCeVlCjMCVFIYx4LWUwOeRSwhmLWU84mqqihll3sppEmjnOSs5zjEl1c4yZ99POE5wwxwns+840fTDFLFKaZZIJxkozxlmEGGSC+GF++Sy89dHOZC8Rr4lVnOMERDrCPBPXEX22jko2UEn+/mnxyWUYWC0gnNUQh/AEc0HJs6cex0gAAAABJRU5ErkJggg==)";o._eHue.style.backgroundSize="contain";if(navigator.appVersion.indexOf("MSIE 9")>-1){o._eSB.children[0].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffffff,endColorstr=#00ffffff,GradientType=1)";o._eSB.children[1].style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr=#ff000000,GradientType=0)"}n=ColorPicker._tplCursor;o._cSB=wijmo_1.createElement(n);o._cHue=wijmo_1.createElement(n);o._cHue.style.width="100%";o._cAlpha=wijmo_1.createElement(n);o._cAlpha.style.height="100%";o._eSB.appendChild(o._cSB);o._eHue.appendChild(o._cHue);o._eAlpha.appendChild(o._cAlpha);var s=o.addEventListener.bind(o),r=o.removeEventListener.bind(o),a=document;s(o.hostElement,"mousedown",(function(e){s(a,"mousemove",mouseMove);s(a,"mouseup",mouseUp);o._mouseDown(e)}));s(o.hostElement,"touchstart",(function(e){s(a,"touchmove",mouseMove);s(a,"touchend",mouseUp);o._mouseDown(e)}));var mouseMove=function(e){o._mouseMove(e)},mouseUp=function(e){r(a,"mousemove",mouseMove);r(a,"mouseup",mouseUp);r(a,"touchmove",mouseMove);r(a,"touchend",mouseUp);o._mouseUp(e)};s(o.hostElement,"click",(function(e){var t=e.target;if(t&&"DIV"==t.tagName&&wijmo_1.contains(o._ePal,t)){var i=t.style.backgroundColor;i&&(o.value=new wijmo_1.Color(i).toString())}}));o.value="#ffffff";o.initialize(i);o._updatePanels();return o}Object.defineProperty(ColorPicker,"controlTemplate",{get:function(){ColorPicker._ctrlTemplate||(ColorPicker._ctrlTemplate='<div style="position:relative;width:100%;height:100%"><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-pal"><div style="float:left;width:10%;box-sizing:border-box;padding:2px"><div style="background-color:black;width:100%"> </div><div style="height:6px"></div></div></div><div wj-part="div-text" style="position:absolute;bottom:0px;display:none"></div></div><div style="float:left;width:50%;height:100%;box-sizing:border-box;padding:2px"><div wj-part="div-sb" class="'+exports.ColorPickerClsNames.colorBox+'" style="float:left;width:89%;height:89%"><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to right, white 0%,transparent 100%)"></div><div style="position:absolute;width:100%;height:100%;background:linear-gradient(to top, black 0%,transparent 100%)"></div></div><div style="float:left;width:1%;height:89%"></div><div style="float:left;width:10%;height:89%"><div wj-part="div-hue" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div><div style="float:left;width:89%;height:1%"></div><div style="float:left;width:89%;height:10%"><div style="width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuM4zml1AAAAAcSURBVBhXY/iPBBYgAWpKQGkwgMqDAdUk/v8HAM7Mm6GatDUYAAAAAElFTkSuQmCC)"><div wj-part="div-alpha" class="'+exports.ColorPickerClsNames.colorBox+'"></div></div></div><div style="float:left;width:1%;height:10%"></div><div style="float:left;width:10%;height:10%"><div wj-part="div-pv" class="'+exports.ColorPickerClsNames.colorBox+'" style="position:static"></div></div></div></div>');return ColorPicker._ctrlTemplate},set:function(e){ColorPicker._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showAlphaChannel",{get:function(){return"none"!=this._eAlpha.parentElement.style.display},set:function(e){this._eAlpha.parentElement.style.display=wijmo_1.asBoolean(e)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"showColorString",{get:function(){return"none"!=this._eText.style.display},set:function(e){this._eText.style.display=wijmo_1.asBoolean(e)?"":"none"},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"value",{get:function(){return this._value},set:function(e){if(e!=this.value){e=(e=wijmo_1.asString(e)).trim();var t=wijmo_1.Color.fromString(e);if(t){this._value=e;this._eText.innerText=e;var i=t.getHsb();if(this._hsb[0]!=i[0]||this._hsb[1]!=i[1]||this._hsb[2]!=i[2]||this._alpha!=t.a){if(0==i[2]){i[0]=this._hsb[0];i[1]=this._hsb[1]}else 0==i[1]&&(i[0]=this._hsb[0]);this._hsb=i;this._alpha=t.a;this._updatePanels();this.onValueChanged()}}}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"palette",{get:function(){return this._palette},set:function(e){if((e=(e=wijmo_1.asArray(e)).slice(0,10)).every((function(e){return null!=wijmo_1.Color.fromString(e)}))){this._palette=e;this._updatePalette()}},enumerable:!0,configurable:!0});ColorPicker.prototype.onValueChanged=function(e){this._updatePanels();this.valueChanged.raise(this,e)};ColorPicker.prototype._mouseDown=function(e){this._htDown=this._getTargetPanel(e);if(this._htDown){e.preventDefault();this.focus();this._mouseMove(e)}};ColorPicker.prototype._mouseMove=function(e){var t=e.touches?e.touches[0]:e,i=this._htDown;if(i){var o=i.getBoundingClientRect(),n=this._hsb;if(i==this._eHue)n[0]=wijmo_1.clamp((t.clientY-o.top)/o.height,0,.99);else if(i==this._eSB){n[1]=wijmo_1.clamp((t.clientX-o.left)/o.width,0,1);n[2]=wijmo_1.clamp(1-(t.clientY-o.top)/o.height,0,1)}else i==this._eAlpha&&(this._alpha=wijmo_1.clamp((t.clientX-o.left)/o.width,0,1));this._updateColor()}};ColorPicker.prototype._mouseUp=function(e){this._htDown=null};ColorPicker.prototype._updateColor=function(){var e=wijmo_1.Color.fromHsb(this._hsb[0],this._hsb[1],this._hsb[2],this._alpha);this.value=e.toString();this._updatePanels()};ColorPicker.prototype._updatePalette=function(){var e=new wijmo_1.Color("#fff"),t=new wijmo_1.Color("#000");this._ePal.innerHTML="";for(var i=0;i<this._palette.length;i++){var o=wijmo_1.createElement('<div style="float:left;width:10%;box-sizing:border-box;padding:1px">'),n=new wijmo_1.Color(this._palette[i]),s=n.getHsb();o.appendChild(this._makePalEntry(n,4));for(var r=0;r<5;r++){if(0==s[1]){var a=.1*r+(s[2]>.5?.05:.55);n=wijmo_1.Color.interpolate(e,t,a)}else n=wijmo_1.Color.fromHsb(s[0],.1+.2*r,1-.1*r);o.appendChild(this._makePalEntry(n,0))}this._ePal.appendChild(o)}};ColorPicker.prototype._makePalEntry=function(e,t){var i=document.createElement("div");wijmo_1.setCss(i,{cursor:"pointer",backgroundColor:e.toString(),marginBottom:t||""});i.innerHTML=" ";return i};ColorPicker.prototype._updatePanels=function(){var e=wijmo_1.Color.fromHsb(this._hsb[0],1,1,1),t=wijmo_1.Color.fromHsb(this._hsb[0],this._hsb[1],this._hsb[2],1);this._eSB.style.backgroundColor=e.toString();this._eAlpha.style.background="linear-gradient(to right, transparent 0%, "+t.toString()+" 100%)";navigator.appVersion.indexOf("MSIE 9")>-1&&(this._eAlpha.style.filter="progid:DXImageTransform.Microsoft.gradient(startColorstr=#00000000,endColorstr="+t.toString()+", GradientType = 1)");this._ePreview.style.backgroundColor=this.value;this._cHue.style.top=(100*this._hsb[0]).toFixed(0)+"%";this._cSB.style.left=(100*this._hsb[1]).toFixed(0)+"%";this._cSB.style.top=(100-100*this._hsb[2]).toFixed(0)+"%";this._cAlpha.style.left=(100*this._alpha).toFixed(0)+"%"};ColorPicker.prototype._getTargetPanel=function(e){var t=e.target;return wijmo_1.contains(this._eSB,t)?this._eSB:wijmo_1.contains(this._eHue,t)?this._eHue:wijmo_1.contains(this._eAlpha,t)?this._eAlpha:null};ColorPicker._ctrlTemplate="";ColorPicker._tplCursor='<div style="position:absolute;left:50%;top:50%;width:7px;height:7px;transform:translate(-50%,-50%);border:2px solid #f0f0f0;border-radius:50px;box-shadow:0px 0px 4px 2px #0f0f0f"></div>';return ColorPicker}(wijmo_1.Control);exports.ColorPicker=ColorPicker;wijmo_1._addCultureInfo("CollectionViewNavigator",{ariaLabels:{byPage:{btnFirst:"Navigate to first page",btnPrev:"Navigate to previous page",btnNext:"Navigate to next page",btnLast:"Navigate to last page"},byItem:{btnFirst:"Navigate to first item",btnPrev:"Navigate to previous item",btnNext:"Navigate to next item",btnLast:"Navigate to last item"}}});var CollectionViewNavigator=function(e){__extends(CollectionViewNavigator,e);function CollectionViewNavigator(t,i){var o=e.call(this,t)||this;o._view=null;o._byPage=!1;o._fmt="{current:n0} / {count:n0}";o._liveRegionON=!1;o._ariaLabel="";var n=o.getTemplate();o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.CollectionViewNavigatorClsNames.pager+" "+exports.CollectionViewNavigatorClsNames.hostElement,n,{_btnFirst:"btn-first",_btnPrev:"btn-prev",_txtCurr:"txt-curr",_btnNext:"btn-next",_btnLast:"btn-last"},"input");o.hostElement.tabIndex=-1;o._updateAriaLabels();var s=wijmo_1.uidGenerator();o._txtCurr.id=s;[o._btnFirst,o._btnPrev,o._btnNext,o._btnLast].forEach((function(e){wijmo_1.setAttribute(e.firstElementChild,"aria-controls",o._txtCurr.id)}));wijmo_1.setAttribute(o.hostElement.firstElementChild,"role","group");wijmo_1.setAttribute(o._txtCurr,"role","status");o._rptNext=new wijmo_1._ClickRepeater(o._btnNext.querySelector("button"));o._rptPrev=new wijmo_1._ClickRepeater(o._btnPrev.querySelector("button"));o.addEventListener(o.hostElement,"click",o._click.bind(o));o.addEventListener(o.hostElement,"keydown",o._keydown.bind(o));wijmo_1.setAttribute(o.hostElement,"role","navigation");o._addA11yRelatedHandlers();o.initialize(i);o._update();return o}Object.defineProperty(CollectionViewNavigator,"controlTemplate",{get:function(){CollectionViewNavigator._ctrlTemplate||(CollectionViewNavigator._ctrlTemplate='<div class="'+exports.InputClsNames.inputGroup+'"><span wj-part="btn-first" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepBackward+'"></span></button></span><span wj-part="btn-prev" class="'+exports.InputClsNames.inputGroupBtn+'"> <button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.left+'"></span> </button></span><span wj-part="txt-curr" tabIndex="0"></span><span wj-part="btn-next" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.right+'"></span></button></span><span wj-part="btn-last" class="'+exports.InputClsNames.inputGroupBtn+'"><button class="'+wijmo_1.InputFormElementsClsNames.btn+" "+wijmo_1.InputFormElementsClsNames.btnDefault+'"><span class="'+wijmo_1.GlyphClsNames.stepForward+'"></span></button></span></div>');return CollectionViewNavigator._ctrlTemplate},set:function(e){CollectionViewNavigator._ctrlTemplate=e},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"cv",{get:function(){return this._view},set:function(e){if(e!=this._view){var t=this._view;if(t){t.collectionChanged.removeHandler(this._collectionChanged);t.currentChanged.removeHandler(this._currentChanged)}t=this._view=wijmo_1.asType(e,"ICollectionView",!0);this._update();if(t){t.collectionChanged.addHandler(this._collectionChanged,this);t.currentChanged.addHandler(this._currentChanged,this)}}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"byPage",{get:function(){return this._byPage},set:function(e){if(e!=this._byPage){this._byPage=wijmo_1.asBoolean(e);this._update();this._updateAriaLabels()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"headerFormat",{get:function(){return this._fmt},set:function(e){if(e!=this._fmt){this._fmt=wijmo_1.asString(e);this._update()}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"repeatButtons",{get:function(){return!this._rptNext.disabled},set:function(e){this._rptNext.disabled=this._rptPrev.disabled=!wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"ariaLabel",{get:function(){if(this.hostElement){var e=this.hostElement.getAttribute("aria-label");if(e)return e}return this._ariaLabel},set:function(e){if(this.ariaLabel!==e){this._ariaLabel=e;this.hostElement&&wijmo_1.setAttribute(this.hostElement,"aria-label",e)}},enumerable:!0,configurable:!0});Object.defineProperty(CollectionViewNavigator.prototype,"isDisabled",{get:function(){return this._isDisabled},set:function(e){this._setIsDisabled(e)},enumerable:!0,configurable:!0});CollectionViewNavigator.prototype.focus=function(){var e=this._e;e&&e.offsetHeight&&(this.isDisabled||wijmo_1.moveFocus(e,0)||this._txtCurr.tabIndex>=0&&this._txtCurr.focus())};CollectionViewNavigator.prototype._update=function(){var e=this,t=this._view,i=this._byPage,o=t?i?t.pageIndex:t.currentPosition:0,n=t?i?t.pageCount:t.itemCount:0;if(!this.isDisabled){wijmo_1.enable(this._btnFirst,t&&o>0);wijmo_1.enable(this._btnPrev,t&&o>0);wijmo_1.enable(this._txtCurr,null!=t);wijmo_1.enable(this._btnNext,t&&o<n-1);wijmo_1.enable(this._btnLast,t&&o<n-1)}[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(t){t.firstElementChild.disabled?t.firstElementChild.setAttribute("tabindex","-1"):t.firstElementChild.setAttribute("tabindex",e._orgTabIndex.toString())}));this._txtCurr.textContent=wijmo_1.format(this._fmt,{current:t?o+1:0,count:t?n:0,currentItem:t?t.currentPosition+1:0,itemCount:t?t.itemCount:0,currentPage:t?t.pageIndex+1:0,pageCount:t?t.pageCount:0})};CollectionViewNavigator.prototype._currentChanged=function(){this._update()};CollectionViewNavigator.prototype._collectionChanged=function(){this._update()};CollectionViewNavigator.prototype._click=function(e){var t=e.target,i=this._view,o=this._byPage;if(i){wijmo_1.contains(this._btnFirst,t)?o?i.moveToFirstPage():i.moveCurrentToFirst():wijmo_1.contains(this._btnPrev,t)?o?i.moveToPreviousPage():i.moveCurrentToPrevious():wijmo_1.contains(this._btnNext,t)?o?i.moveToNextPage():i.moveCurrentToNext():wijmo_1.contains(this._btnLast,t)&&(o?i.moveToLastPage():i.moveCurrentToLast());(this.byPage?i.pageIndex>=i.pageCount-1||i.pageIndex<=0:i.currentPosition>=i.itemCount-1||i.currentPosition<=0)&&!this.isDisabled&&this._txtCurr.tabIndex>=0&&this._txtCurr.focus();e.preventDefault()}};CollectionViewNavigator.prototype._updateAriaLabels=function(){var e=wijmo_1.culture.CollectionViewNavigator.ariaLabels[this._byPage?"byPage":"byItem"];wijmo_1.setAttribute(this._btnFirst.firstElementChild,"aria-label",e.btnFirst);wijmo_1.setAttribute(this._btnPrev.firstElementChild,"aria-label",e.btnPrev);wijmo_1.setAttribute(this._btnNext.firstElementChild,"aria-label",e.btnNext);wijmo_1.setAttribute(this._btnLast.firstElementChild,"aria-label",e.btnLast)};CollectionViewNavigator.prototype._addA11yRelatedHandlers=function(){var e=this;this.addEventListener(this._txtCurr,"focus",(function(t){if(e._txtCurr===document.activeElement){wijmo_1.setAttribute(e._txtCurr,"aria-live","off");wijmo_1.setAttribute(e._txtCurr,"aria-label",e._txtCurr.textContent);e._liveRegionON=!1}}));this.addEventListener(this._txtCurr,"blur",(function(t){e._txtCurr!==document.activeElement&&e._txtCurr.removeAttribute("aria-label")}));[this._btnFirst.firstElementChild,this._btnPrev.firstElementChild,this._btnNext.firstElementChild,this._btnLast.firstElementChild].forEach((function(t){e.addEventListener(t,"focus",(function(t){setTimeout((function(){if(!e._liveRegionON){var t=wijmo_1._isMacOS()?"polite":"assertive";wijmo_1.setAttribute(e._txtCurr,"aria-live",t);e._liveRegionON=!0}}))}))}))};CollectionViewNavigator.prototype._setTabOrder=function(e){var t=this._e,i=null!=this._txtCurr.getAttribute("disabled");this._orgTabIndex=e;if(this.isDisabled||i){t.tabIndex=-1;this._txtCurr.tabIndex=-1}else i||(this._txtCurr.tabIndex=this._orgTabIndex)};CollectionViewNavigator.prototype._keydown=function(e){if(wijmo_1.contains(this._txtCurr,e.target)&&(e.ctrlKey||e.metaKey)&&("A"===e.key||"a"===e.key)){e.preventDefault();var t=document.createRange();t.selectNodeContents(this._txtCurr);var i=window.getSelection();i.removeAllRanges();i.addRange(t)}};CollectionViewNavigator.prototype._setIsDisabled=function(e){var t=this;if((e=!!wijmo_1.asBoolean(e,!0))!=this.isDisabled){var i=this._e;if(i){this._isDisabled=e;wijmo_1.toggleClass(i,wijmo_1.ControlStateClsNames.disabled,e);[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(i){if(e){i.firstElementChild.setAttribute("disabled","");i.firstElementChild.setAttribute("tabindex","-1")}else{i.firstElementChild.removeAttribute("disabled");i.firstElementChild.setAttribute("tabindex",t._orgTabIndex.toString())}wijmo_1.toggleClass(i,wijmo_1.ControlStateClsNames.disabled,e)}));this._txtCurr.tabIndex=e?-1:this._orgTabIndex;wijmo_1.toggleClass(this._txtCurr,wijmo_1.ControlStateClsNames.disabled,e)}}};CollectionViewNavigator._ctrlTemplate="";return CollectionViewNavigator}(wijmo_1.Control);exports.CollectionViewNavigator=CollectionViewNavigator;wijmo_1._addCultureInfo("Listbox",{ariaLabels:{listBox:"list box"}});var ListBox=function(e){__extends(ListBox,e);function ListBox(t,i){var o=e.call(this,t,null,!0)||this;o._cv=null;o._itemFormatter=null;o._pathDisplay=new wijmo_1.Binding("");o._pathValue=new wijmo_1.Binding("");o._pathChecked=new wijmo_1.Binding("");o._html=!1;o._shGroups=!1;o._checkedItems=[];o._itemRole="option";o._caseSensitive=!1;o._addMode=!1;o._isShiftDown=!1;o._shouldClearOnShift=!0;o._vThreshold=ListBox._VTHRESH;o._isVirtual=!1;o._children=[];o._ignoreItemFormatterTextArray=[];o._itemFormatterHelper=document.createElement("div");o._clientHeight=-1;o._itemHeight=30;o._itemsAbove=-1;o._itemsBelow=-1;o._eSizer=document.createElement("div");o._ePadTop=document.createElement("div");o._ePadBot=document.createElement("div");o._checking=!1;o._ignoredItemChangedEvents=!1;o._search="";o._fmtItemHandlers=0;o._itemCount=0;o._oldSel=null;o._container=null;o._oldSelectedIndex=-1;o._ariaLabel=wijmo_1.culture.Listbox.ariaLabels.listBox;o.selectedIndexChanged=new wijmo_1.Event;o.itemsChanged=new wijmo_1.Event;o.loadingItems=new wijmo_1.Event;o.loadedItems=new wijmo_1.Event;o.itemChecked=new wijmo_1.Event;o.checkedItemsChanged=new wijmo_1.Event;o.formatItem=new wijmo_1.Event((function(){o.invalidate()}));o._handleKeyUp=function(e){if("Shift"===e.key){o._isShiftDown=!1;o._shouldClearOnShift=!0}};o.applyTemplate(wijmo_1.ControlClsNames.hostElement+" "+wijmo_1.ControlClsNames.content+" "+exports.ListBoxClsNames.hostElement,null,null);var n=o.hostElement;wijmo_1.setAttribute(n,"role","listbox",!0);o._updateAriaLabel();"SELECT"==o._orgTag&&o._initFromSelect(o.hostElement);o.addEventListener(n,"click",o._click.bind(o));o.addEventListener(n,"keydown",o._keydown.bind(o));o.addEventListener(n,"keypress",o._keypress.bind(o));o.addEventListener(n,"keyup",o._handleKeyUp.bind(o));o.addEventListener(n,"wheel",(function(e){if(n.scrollHeight>n.offsetHeight&&(e.deltaY<0&&0==n.scrollTop||e.deltaY>0&&n.scrollTop+n.offsetHeight>=n.scrollHeight)){e.preventDefault();e.stopPropagation();e.stopImmediatePropagation()}}));[o._eSizer,o._ePadTop,o._ePadBot].forEach((function(e){e.tabIndex=-1;wijmo_1.setAttribute(e,"aria-hidden",!0);wijmo_1.setCss(e,{pointerEvents:"none",opacity:"0"})}));o.initialize(i);o._updateViewRange();o.addEventListener(o.hostElement,"scroll",(function(e){o._updateViewRange()}));return o}Object.defineProperty(ListBox.prototype,"ariaLabelledBy",{get:function(){return this.hostElement.getAttribute("aria-labelledby")},set:function(e){wijmo_1._setAriaLabelBy(this,this.hostElement,e,this._updateAriaLabel.bind(this))},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemsSource",{get:function(){return this._items},set:function(e){if(this._items!=e){if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=e;this._cv=wijmo_1.asCollectionView(e);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._populateList();this.onItemsChanged();this.onSelectedIndexChanged()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"collectionView",{get:function(){return this._cv},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"virtualizationThreshold",{get:function(){return this._vThreshold},set:function(e){if(e!=this._vThreshold){var t=this._getVirtual();this._vThreshold=wijmo_1.asNumber(e,!1,!0);t!=this._getVirtual()&&this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"showGroups",{get:function(){return this._shGroups},set:function(e){if(e!=this._shGroups){this._shGroups=wijmo_1.asBoolean(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"isContentHtml",{get:function(){return this._html},set:function(e){if(e!=this._html){this._html=wijmo_1.asBoolean(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(e){if(e!=this._itemFormatter){this._itemFormatter=wijmo_1.asFunction(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"displayMemberPath",{get:function(){return this._pathDisplay.path},set:function(e){if(e!=this.displayMemberPath){this._pathDisplay.path=wijmo_1.asString(e);this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValuePath",{get:function(){return this._pathValue.path},set:function(e){this._pathValue.path=wijmo_1.asString(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"checkedMemberPath",{get:function(){return this._pathChecked.path},set:function(e){if(e!=this.checkedMemberPath){this._pathChecked.path=wijmo_1.asString(e);wijmo_1.setAttribute(this.hostElement,"aria-multiselectable",""!==this.checkedMemberPath?"true":"false");this._populateList()}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"caseSensitiveSearch",{get:function(){return this._caseSensitive},set:function(e){this._caseSensitive=wijmo_1.asBoolean(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"itemRole",{get:function(){return this._itemRole},set:function(e){if(e!=this.itemRole){this._itemRole=wijmo_1.asString(e);this._populateList()}},enumerable:!0,configurable:!0});ListBox.prototype.getDisplayValue=function(e,t){var i=null;if(e>-1&&wijmo_1.hasItems(this._cv)){i=this._cv.items[e];this.displayMemberPath&&(i=this._pathDisplay.getValue(i))}var o=null!=i?i.toString():"";this._itemFormatter&&!t&&(o=this._itemFormatter(e,o));return o};ListBox.prototype.getDisplayText=function(e){return this._getDisplayText(e)};ListBox.prototype._getDisplayText=function(e,t){if(t&&this._ignoreItemFormatterTextArray[e])return this._ignoreItemFormatterTextArray[e];var i=this._getChild(e);return null!=i?i.textContent:""};ListBox.prototype.isItemEnabled=function(e){var t=this._getChild(e);return null!=t&&!t.hasAttribute("disabled")&&!wijmo_1.hasClass(t,wijmo_1.ControlStateClsNames.disabled)&&!wijmo_1.hasClass(t,wijmo_1.UtilitesClsNames.separator)};Object.defineProperty(ListBox.prototype,"selectedIndex",{get:function(){return this._cv?this._cv.currentPosition:-1},set:function(e){if(this._cv){this._oldSelectedIndex=this._cv.currentPosition;this._cv.moveCurrentToPosition(wijmo_1.asNumber(e))}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedItem",{get:function(){return this._cv?this._cv.currentItem:null},set:function(e){this._cv&&this._cv.moveCurrentTo(e)},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"selectedValue",{get:function(){var e=this.selectedItem;e&&this.selectedValuePath&&(e=this._pathValue.getValue(e));return e},set:function(e){var t=this._cv,i=t?t.items:null,o=this.selectedValuePath,n=-1;if(i){for(var s=0;s<i.length;s++){var r=i[s],a=o?this._pathValue.getValue(r):r;if(a===e||wijmo_1.DateTime.equals(a,e)){n=s;break}if(this.isContentHtml&&wijmo_1.isString(a)&&a.indexOf("<")>-1&&wijmo_1.toPlainText(a)===e){n=s;break}}this.selectedIndex=n}},enumerable:!0,configurable:!0});Object.defineProperty(ListBox.prototype,"maxHeight",{get:function(){var e=this.hostElement,t=e?parseFloat(e.style.maxHeight):null;return isNaN(t)?null:t},set:function(e){var t=this.hostElement;if(t){e=wijmo_1.asNumber(e,!0);t.style.maxHeight=null==e?"":e+"px"}},enumerable:!0,configurable:!0});ListBox.prototype.showSelection=function(e){void 0===e&&(e=this.containsFocus());var t=this.hostElement,i=this._children,o=this._getSelectedElement(!1),n=new wijmo_1.Rect(0,0,0,0);if(o!=this._oldSel){this._updateItemAttributes(o,!0);this._updateItemAttributes(this._oldSel,!1);this._oldSel=o}o instanceof HTMLElement?n=this._getBoundingClientRect(o):this._children.length>0&&(n=this._getBoundingClientRect(this._getChild(0)));var s=this._getBoundingClientRect(t),r=0;if(this._shGroups){r=this._itemHeight;if(!this._isVirtual){var a=i[0];a&&a.offsetHeight&&wijmo_1.hasClass(a,exports.ListBoxClsNames.header)&&(r=a.offsetHeight)}}n.bottom>s.bottom?t.scrollTop+=n.bottom-s.bottom:n.top<s.top+r&&(t.scrollTop-=s.top+r-n.top);this._updateViewRange();o=this._getSelectedElement(!0);wijmo_1.setAttribute(t,"aria-activedescendant",o?o.id:null);if(e){(o&&!wijmo_1.contains