@mescius/wijmo.input
Version:
UI library for pure JS, Angular, React, Vue and more...
14 lines (13 loc) • 287 kB
JavaScript
/*!
*
* Wijmo Library 5.20252.44
* 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 __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)},__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",inputDateDropDownContainer:"wj-inputdate-dropdown-container"};exports.InputDateRangeClsNames={hostElement:"wj-inputdaterange"};exports.InputDateTimeClsNames={hostElement:"wj-inputdatetime",showDropDownButton:"wj-show-dropdown-button"};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",screenReaderOnly:"wj-sr-only"};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));wijmo_1.isMobile()&&l(a,"beforeinput",o._beforeinput.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 u=o._clickSpinner.bind(o);l(o._btnUp,"click",u);l(o._btnDn,"click",u);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" 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),u=this._format||(l>-1?"n2":"n0"),h=wijmo_1.Globalize.parseFloat(e,u);isFinite(h)||(h=this.clamp(h));if(isNaN(h))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(h,u,!1,t,c);s&&h>=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;h=wijmo_1.Globalize.parseFloat(p,u)}if(this.text!=this._oldText){this._oldText=this.text;this.onTextChanged()}if(h!=this._value){this._value=h;this.onValueChanged()}this._updateBtn();this._updateState()}}};InputNumber.prototype._handleDecimalInput=function(e){if(0===this._fmtPrc){e.preventDefault();return!0}var t=this._tbx,i=t.value.indexOf(this._chrDec);if(i>-1){e.preventDefault();var o=t.selectionStart<=i?i+1:i;wijmo_1.setSelectionRange(t,o);return!0}return!1};InputNumber.prototype._beforeinput=function(e){if(!e.defaultPrevented&&!this._composing&&this._isEditable()){switch(e.data){case".":case this._chrDec:this._handleDecimalInput(e);return;case"+":case this._chrPls:this._handlePlusSign();e.preventDefault();return;case"-":case this._chrNeg:this._handleMinusSign();e.preventDefault();return}}};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:this._handleMinusSign();e.preventDefault();break;case"+":case this._chrPls:this._handlePlusSign();e.preventDefault();break;case".":case this._chrDec:this._handleDecimalInput(e)}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._handlePlusSign=function(){var e=this._tbx;(this.value<0||this._rxNeg.test(e.value))&&this._flipSign()};InputNumber.prototype._handleMinusSign=function(){var e=this._tbx;if(this.clamp(-1)>=0)this.value<0&&this._flipSign();else if(this.value&&e.selectionStart===e.selectionEnd)this._flipSign();else if(this.clamp(-1)<0){e.value=this._chrNeg;wijmo_1.setSelectionRange(e,1)}};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){if(1==r.length)wijmo_1.setSelectionRange(t,1);else{"c"===e._fmtSpc&&e._isNegativeCurrencyByParenthesis(i)&&(s-=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._isNegativeCurrencyByParenthesis=function(e){return e.length>1&&e[1]===this._chrCur};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;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:{inputMaskInput:"InputMask Input",inputMask:"Input Mask"}});var ColorPickerTabKeyAction,InputMask=function(e){__extends(InputMask,e);function InputMask(t,i){var o=e.call(this,t)||this;o._fullEdit=!1;o._inputElementAriaLabel=wijmo_1.culture.InputMask.ariaLabels.inputMaskInput;o._ariaLabelledby=null;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()}));o._updateInputAriaLabel();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)};Object.defineProperty(InputMask.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});InputMask.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)};InputMask.prototype.getAriaLabelForScreenReader=function(){return wijmo_1.culture.InputMask.ariaLabels.inputMask};InputMask._ctrlTemplate="";return InputMask}(wijmo_1.Control);exports.InputMask=InputMask;wijmo_1._addCultureInfo("ColorPicker",{ariaLabels:{colorPicker:"Color Picker",satAndBrightnessPanel:"Color saturation and brightness panel",huePanel:"Color hue panel",opacityPanel:"Color opacity panel",palettePanel:"Color palette panel",saturation:"Saturation:",hue:"Hue:",opacity:"Opacity:",degrees:"degrees",brightness:"Brightness:",baseColor:"Base color:",shadeColor:"Shade color:"}});!function(e){e[e.None=0]="None";e[e.All=1]="All"}(ColorPickerTabKeyAction=exports.ColorPickerTabKeyAction||(exports.ColorPickerTabKeyAction={}));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._ariaLabel=wijmo_1.culture.ColorPicker.ariaLabels.colorPicker;o.valueChanged=new wijmo_1.Event;o.hostElement.setAttribute("role","application");o.hostElement.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.colorPicker);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);o._keyActionTab=ColorPickerTabKeyAction.None;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){if(!o.isDisabled){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());t.focus()}}}));s(o.hostElement,"keydown",(function(e){o.isDisabled||o._keydown(e)}));o.value="#ffffff";o.initialize(i);o._updatePanels();o._eSB.setAttribute("role","slider");o._eSB.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.satAndBrightnessPanel);o._eSB.setAttribute("aria-valuemin","0");o._eSB.setAttribute("aria-valuemax","100");o._eHue.setAttribute("role","slider");o._eHue.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.huePanel);o._eHue.setAttribute("aria-valuemin","0");o._eHue.setAttribute("aria-valuemax","360");o._eAlpha.setAttribute("role","slider");o._eAlpha.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.opacityPanel);o._eAlpha.setAttribute("aria-valuemin","0");o._eAlpha.setAttribute("aria-valuemax","100");o._ePal.setAttribute("role","grid");o._ePal.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.palettePanel);o._updateTabIndex();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";if(wijmo_1.asBoolean(e)){this._eText.setAttribute("role","status");this._eText.setAttribute("aria-live","polite")}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"value",{get:function(){return this._value},set:function(e){if(e!=this.value){var t=this.value,i=(e=wijmo_1.asString(e)).trim(),o=wijmo_1.Color.fromString(i);if(o){var n=o.getHsb();this._value=i;this._eText.innerText=i;if(this._hsb[0]!=n[0]||this._hsb[1]!=n[1]||this._hsb[2]!=n[2]||this._alpha!=o.a){if(0==n[2]){n[0]=this._hsb[0];n[1]=this._hsb[1]}else 0==n[1]&&(n[0]=this._hsb[0]);this._hsb=n;this._alpha=o.a;this.onValueChanged()}else""===t&&this.onValueChanged()}else if(""===i){var s=new wijmo_1.Color(e);this._hsb=s.getHsb();this._alpha=s.a;this._value=e;this._eText.innerText=i;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});Object.defineProperty(ColorPicker.prototype,"ariaLabel",{get:function(){return this._ariaLabel},set:function(e){if(e!=this._ariaLabel){this._ariaLabel=e;wijmo_1.setAttribute(this.hostElement,"aria-label",this._ariaLabel)}},enumerable:!0,configurable:!0});Object.defineProperty(ColorPicker.prototype,"keyActionTab",{get:function(){return this._keyActionTab},set:function(e){this._keyActionTab=e;if(e==ColorPickerTabKeyAction.All){this.tabOrder=0;this.hostElement.setAttribute("tabindex","-1")}this._updateTabIndex()},enumerable:!0,configurable:!0});ColorPicker.prototype._setTabOrder=function(t){e.prototype._setTabOrder.call(this,t);this.isDisabled||this._updateTabIndex()};ColorPicker.prototype.onValueChanged=function(e){this._refreshSelection();this.valueChanged.raise(this,e)};ColorPicker.prototype._mouseDown=function(e){this._htDown=this._getTargetPanel(e);if(this._htDown){e.preventDefault();this._htDown.focus();this._mouseMove(e)}};ColorPicker.prototype._mouseMove=function(e){if(!this.isDisabled){var t=e.touches?e.touches[0]:e,i=this._htDown;if(i){var o=i.getBoundingClientRect(),n=this._hsb.slice(),s=this._alpha;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&&(s=wijmo_1.clamp((t.clientX-o.left)/o.width,0,1));this._updateColor(n,s)}}};ColorPicker.prototype._mouseUp=function(e){this._htDown=null};ColorPicker.prototype._updateColor=function(e,t){void 0===e&&(e=this._hsb);void 0===t&&(t=this._alpha);var i=this._hsb[0]!==e[0]||this._hsb[1]!==e[1]||this._hsb[2]!==e[2],o=this._alpha!==t;if(i||o){this._hsb=e;this._alpha=t;var n=wijmo_1.Color.fromHsb(e[0],e[1],e[2],t);this._value=n.toString();this._eText.innerText=this._value;this.onValueChanged()}};ColorPicker.prototype._updatePalette=function(){var e=this,t=new wijmo_1.Color("#fff"),i=new wijmo_1.Color("#000");this._ePal.innerHTML="";this._ePal.className="palette-grid";for(var o=Array.from({length:6},(function(){var e=document.createElement("div");e.className="palette-row";e.setAttribute("role","row");return e})),n=this.getActualTabIndex(),s=0;s<this._palette.length;s++){var r=new wijmo_1.Color(this._palette[s]),a=r.getHsb(),l=this._makePalEntry(r);l.innerHTML="​";l.setAttribute("role","columnheader");l.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.baseColor+" "+r.toString());if(0===s){this._ePalMainFirst=l;this._ePalMainFirst.setAttribute("tabindex",n)}else l.setAttribute("tabindex","-1");o[0].appendChild(l);for(var u=0;u<5;u++){var h=0===a[1]?wijmo_1.Color.interpolate(t,i,.1*u+(a[2]>.5?.05:.55)):wijmo_1.Color.fromHsb(a[0],.1+.2*u,1-.1*u),c=this._makePalEntry(h);c.setAttribute("role","gridcell");c.setAttribute("aria-label",wijmo_1.culture.ColorPicker.ariaLabels.shadeColor+" "+h.toString());if(0===s&&0===u){this._ePalShadeFirst=c;this._ePalShadeFirst.setAttribute("tabindex",n)}else wijmo_1.setAttribute(c,"tabindex","-1");o[u+1].appendChild(c)}}o.forEach((function(t){return e._ePal.appendChild(t)}))};ColorPicker.prototype._makePalEntry=function(e){var t=document.createElement("div");t.className="palette-gridcell";wijmo_1.setCss(t,{backgroundColor:e.toString()});return t};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)");var i=this.value.trim();this._ePreview.style.backgroundColor=i;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)+"%";var o=this.getColorsDiv(),n=wijmo_1.getActiveElement();if(this.keyActionTab===ColorPickerTabKeyAction.All&&!this.hostElement.contains(n)){if(this.isDisabled)return;for(var s=!1,r=0;r<o.length;r++){var a=o[r].style.backgroundColor;if(wijmo_1.Color.fromString(i).equals(wijmo_1.Color.fromString(a))){o[r].focus();s=!0;break}}s||o[0].focus()}};ColorPicker.prototype.getColorsDiv=function(){var e=Array.from(this._ePal.querySelectorAll('[role="columnheader"]')),t=Array.from(this._ePal.querySelectorAll('[role="gridcell"]'));return e.concat(t)};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.prototype.getActualTabIndex=function(){var e=this.tabOrder.toString();return this.keyActionTab===ColorPickerTabKeyAction.All&&!0!==this.isDisabled?e:"-1"};ColorPicker.prototype._updateTabIndex=function(){var e=this.getActualTabIndex();this._eSB.setAttribute("tabindex",e);this._eHue.setAttribute("tabindex",e);this._eAlpha.setAttribute("tabindex",e);this._ePalMainFirst.setAttribute("tabindex",e);this._ePalShadeFirst.setAttribute("tabindex",e)};ColorPicker.prototype._setIsDisabled=function(t){e.prototype._setIsDisabled.call(this,t);this._updateTabIndex()};ColorPicker.prototype._updateAriaValues=function(){var e=this._hsb;this._eSB.setAttribute("aria-valuenow",(100*e[1]).toString());this._eSB.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.saturation+" "+Math.round(100*e[1])+"%, "+wijmo_1.culture.ColorPicker.ariaLabels.brightness+" "+Math.round(100*e[2])+"%");this._eHue.setAttribute("aria-valuenow",(360*e[0]).toString());this._eHue.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.hue+" "+Math.round(360*e[0])+" "+wijmo_1.culture.ColorPicker.ariaLabels.degrees);this._eAlpha.setAttribute("aria-valuenow",(100*this._alpha).toString());this._eAlpha.setAttribute("aria-valuetext",wijmo_1.culture.ColorPicker.ariaLabels.opacity+" "+Math.round(100*this._alpha)+"%")};ColorPicker.prototype._keydown=function(e){var t=e.target;this._isInColorPalette(t)?this._handleColorNavigation(e,t):t!==this._eSB?t!==this._eHue?t!==this._eAlpha||this._handleAlphaNavigation(e):this._handleHSBNavigation(e,"hue"):this._handleHSBNavigation(e,"sb")};ColorPicker.prototype._isInColorPalette=function(e){return e&&"DIV"===e.tagName&&wijmo_1.contains(this._ePal,e)};ColorPicker.prototype._handleColorNavigation=function(e,t){var i=this.getColorsDiv(),o=this.palette.length,n=i.findIndex((function(e){return e===t})),s=null;switch(e.key){case"ArrowDown":n<i.length-1&&(s=i[n+o]);break;case"ArrowUp":n>0&&(s=i[n-o]);break;case"ArrowRight":var r=n+1;r<i.length&&(s=i[r]);break;case"ArrowLeft":var a=n-1;a>=0&&(s=i[a])}if(s){var l=s.style.backgroundColor;l&&(this.value=new wijmo_1.Color(l).toString());s.focus();e.preventDefault()}};ColorPicker.prototype._handleHSBNavigation=function(e,t){var i=this._hsb.slice();i=i.map((function(e){return wijmo_1.roundTo(e,2)}));var adjust=function(e,t,o){var n=Math.round(100*i[e]);i[e]=wijmo_1.clamp((n+t)/100,0,o)};switch(e.key){case"ArrowLeft":"sb"===t&&adjust(1,-1,1);break;case"ArrowRight":"sb"===t&&adjust(1,1,1);break;case"ArrowUp":"sb"===t?adjust(2,1,1):adjust(0,-1,.99);break;case"ArrowDown":"sb"===t?adjust(2,-1,1):adjust(0,1,.99)}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)){this._updateColor(i,void 0);e.preventDefault()}};ColorPicker.prototype._refreshSelection=function(){this._updatePanels();this._updateAriaValues()};ColorPicker.prototype._handleAlphaNavigation=function(e){var t=this._alpha;switch(e.key){case"ArrowLeft":t=wijmo_1.clamp(t-.01,0,1);break;case"ArrowRight":t=wijmo_1.clamp(t+.01,0,1);break;default:return}this._updateColor(void 0,t);e.preventDefault()};ColorPicker._ctrlTemplate="";ColorPicker._tplCursor='<div class="wj-colorpicker-cursor"></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._view,t=this._byPage,i=e?t?e.pageIndex:e.currentPosition:0,o=e?t?e.pageCount:e.itemCount:0;if(this.isDisabled)[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(e){wijmo_1.enable(e,!1)}));else{wijmo_1.enable(this._btnFirst,e&&i>0);wijmo_1.enable(this._btnPrev,e&&i>0);wijmo_1.enable(this._txtCurr,null!=e);wijmo_1.enable(this._btnNext,e&&i<o-1);wijmo_1.enable(this._btnLast,e&&i<o-1)}this._updateTabIndex();this._txtCurr.textContent=wijmo_1.format(this._fmt,{current:e?i+1:0,count:e?o:0,currentItem:e?e.currentPosition+1:0,itemCount:e?e.itemCount:0,currentPage:e?e.pageIndex+1:0,pageCount:e?e.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){if((e=!!wijmo_1.asBoolean(e,!0))!=this.isDisabled){var t=this._e;if(t){this._isDisabled=e;wijmo_1.toggleClass(t,wijmo_1.ControlStateClsNames.disabled,e);this._update();this._txtCurr.tabIndex=e?-1:this._orgTabIndex}}};CollectionViewNavigator.prototype._updateTabIndex=function(){var e=this;[this._btnFirst,this._btnPrev,this._btnNext,this._btnLast].forEach((function(t){if(e._isDisabled)t.firstElementChild.setAttribute("tabindex","-1");else{t.firstElementChild.disabled?t.firstElementChild.setAttribute("tabindex","-1"):t