UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

1 lines • 29.9 kB
var __awaiter=this&&this.__awaiter||function(t,e,i,c){function n(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,a){function l(t){try{s(c.next(t))}catch(e){a(e)}}function r(t){try{s(c["throw"](t))}catch(e){a(e)}}function s(t){t.done?i(t.value):n(t.value).then(l,r)}s((c=c.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},c,n,a,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(t){return function(e){return s([t,e])}}function s(l){if(c)throw new TypeError("Generator is already executing.");while(i)try{if(c=1,n&&(a=l[0]&2?n["return"]:l[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;if(n=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:i.label++;return{value:l[1],done:false};case 5:i.label++;n=l[1];l=[0];continue;case 7:l=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){i=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){i.label=l[1];break}if(l[0]===6&&i.label<a[1]){i.label=a[1];a=l;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(l);break}if(a[2])i.ops.pop();i.trys.pop();continue}l=e.call(t,i)}catch(r){l=[6,r];n=0}finally{c=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e){for(var i=0,c=e.length,n=t.length;i<c;i++,n++)t[n]=e[i];return t};System.register(["./p-1720b7a7.system.js","./p-60d9e7d4.system.js","./p-95dfb659.system.js","./p-7de2ae67.system.js","./p-defdc464.system.js","./p-bcdfb7b3.system.js","./p-2c235db8.system.js"],(function(t){"use strict";var e,i,c,n,a,l,r,s,u,o,p,d,h,b,m,f,x,g,v;return{setters:[function(t){e=t.r;i=t.c;c=t.h;n=t.H;a=t.g},function(t){l=t.s;r=t.c;s=t.g;u=t.d;o=t.C},function(t){p=t.g;d=t.n},function(t){h=t.d;b=t.g;m=t.l},function(t){f=t.h},function(t){x=t.i;g=t.p;v=t.s},function(){}],execute:function(){var y={tel:"phone",password:"lock",email:"email-address",date:"calendar",time:"clock",search:"search"};var w={action:"action"};var k="@-webkit-keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-down{0%{opacity:0;-webkit-transform:translate3D(0, -5px, 0);transform:translate3D(0, -5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;-webkit-transform:translate3D(0, 5px, 0);transform:translate3D(0, 5px, 0)}100%{opacity:1;-webkit-transform:translate3D(0, 0, 0);transform:translate3D(0, 0, 0)}}@-webkit-keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}@keyframes in-scale{0%{opacity:0;-webkit-transform:scale3D(0.95, 0.95, 1);transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;-webkit-transform:scale3D(1, 1, 1);transform:scale3D(1, 1, 1)}}.sc-calcite-input:root{--calcite-popper-transition:150ms ease-in-out}[hidden].sc-calcite-input-h{display:none}[scale=s].sc-calcite-input-h textarea.sc-calcite-input,[scale=s].sc-calcite-input-h input.sc-calcite-input,[scale=s].sc-calcite-input-h .calcite-input-prefix.sc-calcite-input,[scale=s].sc-calcite-input-h .calcite-input-suffix.sc-calcite-input{font-size:var(--calcite-font-size--2);padding:0.5rem;height:2rem}[scale=s].sc-calcite-input-h textarea.sc-calcite-input{min-height:32px}[scale=s].sc-calcite-input-h .calcite-input-number-button-wrapper.sc-calcite-input,[scale=s].sc-calcite-input-h .calcite-action-wrapper.sc-calcite-input calcite-button.sc-calcite-input,[scale=s].sc-calcite-input-h .calcite-action-wrapper.sc-calcite-input calcite-button.sc-calcite-input button.sc-calcite-input{height:2rem}[scale=s].sc-calcite-input-h textarea.sc-calcite-input,[scale=s].sc-calcite-input-h input[type=file].sc-calcite-input{height:auto}[scale=s].sc-calcite-input-h .calcite-input-clear-button.sc-calcite-input{min-height:32px;min-width:32px}[scale=m].sc-calcite-input-h textarea.sc-calcite-input,[scale=m].sc-calcite-input-h input.sc-calcite-input,[scale=m].sc-calcite-input-h .calcite-input-prefix.sc-calcite-input,[scale=m].sc-calcite-input-h .calcite-input-suffix.sc-calcite-input{font-size:var(--calcite-font-size--1);padding:0.75rem;height:44px}[scale=m].sc-calcite-input-h textarea.sc-calcite-input{min-height:44px}[scale=m].sc-calcite-input-h .calcite-input-number-button-wrapper.sc-calcite-input,[scale=m].sc-calcite-input-h .calcite-action-wrapper.sc-calcite-input calcite-button.sc-calcite-input,[scale=m].sc-calcite-input-h .calcite-action-wrapper.sc-calcite-input calcite-button.sc-calcite-input button.sc-calcite-input{height:44px}[scale=m].sc-calcite-input-h textarea.sc-calcite-input,[scale=m].sc-calcite-input-h input[type=file].sc-calcite-input{height:auto}[scale=m].sc-calcite-input-h .calcite-input-clear-button.sc-calcite-input{min-height:44px;min-width:44px}[scale=l].sc-calcite-input-h textarea.sc-calcite-input,[scale=l].sc-calcite-input-h input.sc-calcite-input,[scale=l].sc-calcite-input-h .calcite-input-prefix.sc-calcite-input,[scale=l].sc-calcite-input-h .calcite-input-suffix.sc-calcite-input{font-size:var(--calcite-font-size-1);padding:1rem;height:56px}[scale=l].sc-calcite-input-h textarea.sc-calcite-input{min-height:56px}[scale=l].sc-calcite-input-h .calcite-input-number-button-wrapper.sc-calcite-input,[scale=l].sc-calcite-input-h .calcite-action-wrapper.sc-calcite-input calcite-button.sc-calcite-input,[scale=l].sc-calcite-input-h .calcite-action-wrapper.sc-calcite-input calcite-button.sc-calcite-input button.sc-calcite-input{height:56px}[scale=l].sc-calcite-input-h textarea.sc-calcite-input,[scale=l].sc-calcite-input-h input[type=file].sc-calcite-input{height:auto}[scale=l].sc-calcite-input-h .calcite-input-clear-button.sc-calcite-input{min-height:56px;min-width:56px}[disabled].sc-calcite-input-h{pointer-events:none}[disabled].sc-calcite-input-h .calcite-input-wrapper.sc-calcite-input{opacity:var(--calcite-ui-opacity-disabled);pointer-events:none}[disabled].sc-calcite-input-h textarea.sc-calcite-input,[disabled].sc-calcite-input-h input.sc-calcite-input{pointer-events:none}.sc-calcite-input-h textarea.sc-calcite-input,.sc-calcite-input-h input.sc-calcite-input{display:-ms-flexbox;display:flex;position:relative;min-width:20%;max-width:100%;max-height:100%;-ms-flex:1;flex:1;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;font-family:inherit;-webkit-transition:150ms ease-in-out, height 0s;transition:150ms ease-in-out, height 0s;-webkit-box-shadow:0 0 0 0 transparent;box-shadow:0 0 0 0 transparent;outline:0;margin:0;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);font-weight:400;border-radius:0;-webkit-border-radius:0}.sc-calcite-input-h input[type=search].sc-calcite-input::-webkit-search-decoration{-webkit-appearance:none}.sc-calcite-input-h textarea.sc-calcite-input,.sc-calcite-input-h input.sc-calcite-input{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}.sc-calcite-input-h textarea.sc-calcite-input:focus,.sc-calcite-input-h input.sc-calcite-input:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.sc-calcite-input-h input.sc-calcite-input,.sc-calcite-input-h textarea.sc-calcite-input{color:var(--calcite-ui-text-1);border:1px solid var(--calcite-ui-border-1)}.sc-calcite-input-h input.sc-calcite-input:-ms-input-placeholder,.sc-calcite-input-h textarea.sc-calcite-input:-ms-input-placeholder{color:var(--calcite-ui-text-3);font-weight:400}.sc-calcite-input-h input.sc-calcite-input::-ms-input-placeholder,.sc-calcite-input-h textarea.sc-calcite-input::-ms-input-placeholder{color:var(--calcite-ui-text-3);font-weight:400}.sc-calcite-input-h input.sc-calcite-input::placeholder,.sc-calcite-input-h input.sc-calcite-input:-ms-input-placeholder,.sc-calcite-input-h input.sc-calcite-input::-ms-input-placeholder,.sc-calcite-input-h textarea.sc-calcite-input::placeholder,.sc-calcite-input-h textarea.sc-calcite-input:-ms-input-placeholder,.sc-calcite-input-h textarea.sc-calcite-input::-ms-input-placeholder{color:var(--calcite-ui-text-3);font-weight:400}.sc-calcite-input-h input.sc-calcite-input:focus,.sc-calcite-input-h textarea.sc-calcite-input:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}.sc-calcite-input-h input[readonly].sc-calcite-input,.sc-calcite-input-h textarea[readonly].sc-calcite-input{background-color:var(--calcite-ui-background)}.sc-calcite-input-h input[readonly].sc-calcite-input:focus,.sc-calcite-input-h textarea[readonly].sc-calcite-input:focus{color:var(--calcite-ui-text-1)}.sc-calcite-input-h calcite-icon.sc-calcite-input{color:var(--calcite-ui-text-1)}.sc-calcite-input-h slot.sc-calcite-input:not[name=input-message]{display:block;margin-bottom:0.375rem;color:var(--calcite-ui-text-2);font-weight:500}[icon].sc-calcite-input-h input.sc-calcite-input{padding-left:2.25rem}[icon].sc-calcite-input-h .calcite--rtl.sc-calcite-input input.sc-calcite-input{padding-right:2.25rem;padding-left:0.75rem}[icon][scale=l].sc-calcite-input-h .calcite--rtl.sc-calcite-input input.sc-calcite-input{padding-right:3rem;padding-left:0.75rem}[icon][scale=l].sc-calcite-input-h input.sc-calcite-input{padding-left:3rem}.calcite-input-element-wrapper.sc-calcite-input{display:-ms-inline-flexbox;display:inline-flex;-ms-flex:1;flex:1;min-width:20%;position:relative;-ms-flex-order:3;order:3}.calcite-input-icon.sc-calcite-input{display:block;position:absolute;pointer-events:none;-webkit-transition:150ms ease-in-out;transition:150ms ease-in-out;top:calc(50% - 9px);left:0.75rem;margin:1px auto 0;z-index:1}[scale=l].sc-calcite-input-h .calcite-input-icon.sc-calcite-input{top:calc(50% - 12px)}.calcite--rtl.sc-calcite-input .calcite-input-icon.sc-calcite-input{left:unset;right:0.75rem}input[type=text].sc-calcite-input::-ms-clear{display:none;width:0;height:0}input[type=text].sc-calcite-input::-ms-reveal{display:none;width:0;height:0}input[type=search].sc-calcite-input::-webkit-search-decoration,input[type=search].sc-calcite-input::-webkit-search-cancel-button,input[type=search].sc-calcite-input::-webkit-search-results-button,input[type=search].sc-calcite-input::-webkit-search-results-decoration,input[type=date].sc-calcite-input::-webkit-clear-button,input[type=time].sc-calcite-input::-webkit-clear-button{display:none}.calcite-input-clear-button.sc-calcite-input{display:-ms-flexbox;display:flex;-ms-flex-item-align:stretch;align-self:stretch;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;min-height:100%;border:1px solid var(--calcite-ui-border-1);-webkit-transition:150ms ease-in-out;transition:150ms ease-in-out;pointer-events:initial;background-color:var(--calcite-ui-foreground-1);border-left:none;-ms-flex-order:4;order:4}.calcite-input-clear-button.sc-calcite-input:hover,.calcite-input-clear-button.sc-calcite-input:focus{background-color:var(--calcite-ui-foreground-2)}.calcite-input-clear-button.sc-calcite-input:active{background-color:var(--calcite-ui-foreground-3)}.calcite-input-clear-button.sc-calcite-input:disabled{opacity:var(--calcite-ui-opacity-disabled)}.calcite--rtl.sc-calcite-input .calcite-input-clear-button.sc-calcite-input{border-left:1px solid var(--calcite-ui-border-1);border-right:none}.calcite-input-clear-button.sc-calcite-input{outline-offset:0;outline-color:transparent;-webkit-transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out;transition:outline-offset 100ms ease-in-out, outline-color 100ms ease-in-out}.calcite-input-clear-button.sc-calcite-input:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.calcite-input-loading.sc-calcite-input{display:block;pointer-events:none;position:absolute;top:1px;left:1px;right:1px}.calcite-action-wrapper.sc-calcite-input{display:-ms-flexbox;display:flex;-ms-flex-order:7;order:7}.calcite-input-prefix.sc-calcite-input,.calcite-input-suffix.sc-calcite-input{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-line-pack:center;align-content:center;height:auto;min-height:100%;word-break:break-word;-webkit-user-select:none;-ms-user-select:none;-moz-user-select:none;user-select:none;-webkit-box-sizing:border-box;box-sizing:border-box;font-weight:500;border:1px solid var(--calcite-ui-border-1);background-color:var(--calcite-ui-background);color:var(--calcite-ui-text-2);line-height:1}.calcite-input-prefix.sc-calcite-input{-ms-flex-order:2;order:2;border-right-width:0px}.calcite-input-suffix.sc-calcite-input{-ms-flex-order:5;order:5;border-left-width:0px}.calcite--rtl.sc-calcite-input .calcite-input-prefix.sc-calcite-input{border-right-width:1px;border-left-width:0px}.calcite--rtl.sc-calcite-input .calcite-input-suffix.sc-calcite-input{border-left-width:1px;border-right-width:0px}[readonly].sc-calcite-input-h .calcite-input-number-button-item.sc-calcite-input{pointer-events:none}[alignment=start].sc-calcite-input-h textarea.sc-calcite-input,[alignment=start].sc-calcite-input-h input.sc-calcite-input{text-align:left}[alignment=end].sc-calcite-input-h textarea.sc-calcite-input,[alignment=end].sc-calcite-input-h input.sc-calcite-input{text-align:right}[alignment=start].sc-calcite-input-h .calcite--rtl.sc-calcite-input textarea.sc-calcite-input,[alignment=start].sc-calcite-input-h .calcite--rtl.sc-calcite-input input.sc-calcite-input{text-align:right}[alignment=end].sc-calcite-input-h .calcite--rtl.sc-calcite-input textarea.sc-calcite-input,[alignment=end].sc-calcite-input-h .calcite--rtl.sc-calcite-input input.sc-calcite-input{text-align:left}.sc-calcite-input-h input[type=number].sc-calcite-input{-moz-appearance:textfield}.sc-calcite-input-h input[type=number].sc-calcite-input::-webkit-inner-spin-button,.sc-calcite-input-h input[type=number].sc-calcite-input::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0}.calcite-input-number-button-wrapper.sc-calcite-input{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;box-sizing:border-box;-webkit-transition:150ms ease-in-out;transition:150ms ease-in-out;pointer-events:none;-ms-flex-order:6;order:6}[number-button-type=vertical].sc-calcite-input-h .calcite-input-wrapper.sc-calcite-input{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex}[number-button-type=vertical].sc-calcite-input-h input.sc-calcite-input,[number-button-type=vertical].sc-calcite-input-h textarea.sc-calcite-input{-ms-flex-order:2;order:2}[number-button-type=horizontal].sc-calcite-input-h .calcite--rtl.sc-calcite-input .calcite-input-number-button-item[data-adjustment=down].sc-calcite-input calcite-icon.sc-calcite-input{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}[number-button-type=horizontal].sc-calcite-input-h .calcite--rtl.sc-calcite-input .calcite-input-number-button-item[data-adjustment=up].sc-calcite-input calcite-icon.sc-calcite-input{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.calcite-input-number-button-item.number-button-item-horizontal[data-adjustment=down].sc-calcite-input,.calcite-input-number-button-item.number-button-item-horizontal[data-adjustment=up].sc-calcite-input{min-height:100%;max-height:100%;-ms-flex-order:1;order:1;-ms-flex-item-align:auto;align-self:auto}.calcite-input-number-button-item.number-button-item-horizontal[data-adjustment=down].sc-calcite-input calcite-icon.sc-calcite-input,.calcite-input-number-button-item.number-button-item-horizontal[data-adjustment=up].sc-calcite-input calcite-icon.sc-calcite-input{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.calcite-input-number-button-item.number-button-item-horizontal[data-adjustment=down].sc-calcite-input{border-left:1px solid var(--calcite-ui-border-1);border-right:0px}.calcite-input-number-button-item.number-button-item-horizontal[data-adjustment=up].sc-calcite-input{-ms-flex-order:5;order:5}.calcite--rtl.sc-calcite-input .calcite-input-number-button-item.number-button-item-horizontal[data-adjustment=down].sc-calcite-input{border-right:1px solid var(--calcite-ui-border-1);border-left:0px}.calcite--rtl.sc-calcite-input .calcite-input-number-button-item.number-button-item-horizontal[data-adjustment=up].sc-calcite-input{border-left:1px solid var(--calcite-ui-border-1);border-right:0px}[number-button-type=vertical].sc-calcite-input-h .calcite-input-number-button-item[data-adjustment=down].sc-calcite-input{border-top:0}.calcite-input-number-button-item.sc-calcite-input{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;cursor:pointer;max-height:50%;min-height:50%;padding:0 0.75rem;border:1px solid var(--calcite-ui-border-1);-webkit-transition:background-color 0.15s ease-in-out;transition:background-color 0.15s ease-in-out;pointer-events:initial;background-color:var(--calcite-ui-foreground-1);border-left:none}.calcite-input-number-button-item.sc-calcite-input calcite-icon.sc-calcite-input{pointer-events:none}.calcite-input-number-button-item.sc-calcite-input:hover,.calcite-input-number-button-item.sc-calcite-input:focus{background-color:var(--calcite-ui-foreground-2)}.calcite-input-number-button-item.sc-calcite-input:active{background-color:var(--calcite-ui-foreground-3)}[number-button-type=vertical].sc-calcite-input-h .calcite--rtl.sc-calcite-input .calcite-input-number-button-item.sc-calcite-input{border-right:none;border-left:1px solid var(--calcite-ui-border-1)}.calcite-input-wrapper.sc-calcite-input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;position:relative}.sc-calcite-input-h input.sc-calcite-input::-webkit-calendar-picker-indicator{display:none}.sc-calcite-input-h input[type=date].sc-calcite-input::-webkit-input-placeholder{visibility:hidden !important}.sc-calcite-input-h textarea.sc-calcite-input::-webkit-resizer{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;bottom:0;right:0;padding:0 0.375rem}@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none){.calcite-input-resize-icon-wrapper.sc-calcite-input{display:none}}.calcite-input-resize-icon-wrapper.sc-calcite-input{background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-3);position:absolute;z-index:1;bottom:2px;right:2px;pointer-events:none;width:16px;height:16px}.calcite-input-resize-icon-wrapper.sc-calcite-input calcite-icon.sc-calcite-input{bottom:4px;right:4px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.calcite--rtl.sc-calcite-input textarea.sc-calcite-input::-webkit-resizer{left:0;right:unset}.calcite--rtl.sc-calcite-input .calcite-input-resize-icon-wrapper.sc-calcite-input{left:2px;right:unset}.calcite--rtl.sc-calcite-input .calcite-input-resize-icon-wrapper.sc-calcite-input calcite-icon.sc-calcite-input{bottom:4px;right:4px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}[type=file].sc-calcite-input-h input.sc-calcite-input,[type=file].sc-calcite-input-h textarea.sc-calcite-input{cursor:pointer;padding:1.5rem;border:1px dashed #d4d4d4;background-color:#f8f8f8;text-align:center}.no-bottom-border.sc-calcite-input-h input.sc-calcite-input.sc-calcite-input{border-bottom:none}[status=invalid].sc-calcite-input-h .calcite-input-icon.sc-calcite-input{color:var(--calcite-ui-danger)}[status=valid].sc-calcite-input-h .calcite-input-icon.sc-calcite-input{color:var(--calcite-ui-success)}[status=idle].sc-calcite-input-h .calcite-input-icon.sc-calcite-input{color:var(--calcite-ui-text-2)}";var z=t("calcite_input",function(){function t(t){var c=this;e(this,t);this.calciteInputFocus=i(this,"calciteInputFocus",7);this.calciteInputBlur=i(this,"calciteInputBlur",7);this.calciteInputInput=i(this,"calciteInputInput",7);this.calciteInputChange=i(this,"calciteInputChange",7);this.alignment="start";this.autofocus=false;this.groupSeparator=false;this.loading=false;this.locale=document.documentElement.lang||"en";this.localeFormat=false;this.numberButtonType="vertical";this.required=false;this.scale="m";this.status="idle";this.type="text";this.childElType="input";this.clearInputValue=function(t){c.setValue(null,t,true)};this.inputBlurHandler=function(){if(c.type==="number"){c.setLocalizedValue(c.value)}c.calciteInputBlur.emit({element:c.childEl,value:c.value});if(c.preFocusValue!==c.value){c.calciteInputChange.emit()}};this.inputFocusHandler=function(t){if(t.target!==c.slottedActionEl){c.setFocus()}c.calciteInputFocus.emit({element:c.childEl,value:c.value});c.preFocusValue=c.value};this.inputInputHandler=function(t){c.setValue(t.target.value,t)};this.inputKeyDownHandler=function(t){if(t.key==="Enter"){c.calciteInputChange.emit()}};this.inputNumberInputHandler=function(t){var e=t.target.value;var i=h(e,c.locale);if(t.inputType==="insertFromPaste"){if(!x(i)){t.preventDefault()}c.setValue(g(i),t);c.childNumberEl.value=c.localizedValue}else{c.setValue(h(e,c.locale),t)}};this.inputNumberKeyDownHandler=function(t){if(c.type!=="number"){return}if(t.key==="ArrowUp"){c.nudgeNumberValue("up",t);return}if(t.key==="ArrowDown"){c.nudgeNumberValue("down",t);return}var e=__spreadArray(__spreadArray([],d),["ArrowLeft","ArrowRight","Backspace","Delete","Enter","Escape","Tab","-"]);if(t.altKey||t.ctrlKey||t.metaKey){return}var i=t.shiftKey&&t.key==="Tab";if(e.includes(t.key)&&(!t.shiftKey||i)&&!(parseInt(c.value)===0&&p(t.key)==="0")){if(t.key==="Enter"){c.calciteInputChange.emit()}return}var n=b(c.locale);if(t.key===n){if(!c.value&&!c.childNumberEl.value){return}if(c.value&&c.childNumberEl.value.indexOf(n)===-1){return}}t.preventDefault()};this.nudgeNumberValue=function(t,e){var i,n;if(c.type!=="number"){return}var a=((n=(i=c.value)===null||i===void 0?void 0:i.split(".")[1])===null||n===void 0?void 0:n.length)||0;var l=c.maxString?parseFloat(c.maxString):null;var r=c.minString?parseFloat(c.minString):null;var s=c.step==="any"?1:Math.abs(c.step||1);var u=c.value&&c.value!==""?parseFloat(c.value):0;var o=c.value;if(t==="up"&&(!l&&l!==0||u<l)){o=(u+=s).toFixed(a).toString()}if(t==="down"&&(!r&&r!==0||u>r)){o=(u-=s).toFixed(a).toString()}c.setValue(o,e,true)};this.numberButtonMouseDownHandler=function(t){t.preventDefault();var e=t.target.dataset.adjustment;c.nudgeNumberValue(e,t)};this.reset=function(t){if(c.type==="number"){t.preventDefault()}c.setValue(c.defaultValue,t)};this.setChildElRef=function(t){c.childEl=t};this.setChildNumberElRef=function(t){c.childNumberEl=t};this.setLocalizedValue=function(t){c.localizedValue=m(t,c.locale,c.groupSeparator)};this.setValue=function(t,e,i){if(i===void 0){i=false}var n=c.value;c.value=c.type==="number"?v(t):t;if(c.type==="number"){c.setLocalizedValue(c.value)}if(e){if(c.type==="number"&&(t===null||t===void 0?void 0:t.endsWith("."))){return}var a=c.calciteInputInput.emit({element:c.childEl,nativeEvent:e,value:t});if(a.defaultPrevented){c.value=n;c.setLocalizedValue(n)}else if(i){c.calciteInputChange.emit()}}}}t.prototype.disabledWatcher=function(){this.setDisabledAction()};t.prototype.maxWatcher=function(){var t;this.maxString=((t=this.max)===null||t===void 0?void 0:t.toString())||null};t.prototype.minWatcher=function(){var t;this.minString=((t=this.min)===null||t===void 0?void 0:t.toString())||null};t.prototype.valueWatcher=function(t){if(this.type==="number"&&this.localizedValue!==m(t,this.locale)){this.setLocalizedValue(t)}else if(this.childEl&&this.childEl.value!==t){this.childEl.value=t}};t.prototype.updateRequestedIcon=function(){this.requestedIcon=l(y,this.icon,this.type)};Object.defineProperty(t.prototype,"isClearable",{get:function(){var t;return!this.isTextarea&&(this.clearable||this.type==="search")&&((t=this.value)===null||t===void 0?void 0:t.length)>0},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isTextarea",{get:function(){return this.childElType==="textarea"},enumerable:false,configurable:true});t.prototype.connectedCallback=function(){var t;this.form=this.el.closest("form");(t=this.form)===null||t===void 0?void 0:t.addEventListener("reset",this.reset);this.scale=r(this.el,"scale",this.scale);this.status=r(this.el,"status",this.status);this.step=!this.step&&this.type==="number"?"any":this.step;if(this.type==="number"&&this.value){if(x(this.value)){this.localizedValue=m(this.value,this.locale,this.groupSeparator)}else{this.value=undefined}}};t.prototype.disconnectedCallback=function(){var t;(t=this.form)===null||t===void 0?void 0:t.removeEventListener("reset",this.reset)};t.prototype.componentWillLoad=function(){var t,e;this.childElType=this.type==="textarea"?"textarea":"input";this.defaultValue=this.value;this.maxString=(t=this.max)===null||t===void 0?void 0:t.toString();this.minString=(e=this.min)===null||e===void 0?void 0:e.toString();this.requestedIcon=l(y,this.icon,this.type)};t.prototype.componentDidLoad=function(){this.slottedActionEl=this.el.querySelector("[slot=action]");this.setDisabledAction();if(this.type==="number"&&this.childEl){this.childEl.style.cssText=f}};t.prototype.componentShouldUpdate=function(t,e,i){if(this.type==="number"&&i==="value"&&t&&!x(t)){this.value=e;return false}return true};t.prototype.keyDownHandler=function(t){if(this.isClearable&&p(t.key)==="Escape"){this.clearInputValue(t);t.preventDefault()}};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t,e;return __generator(this,(function(i){if(this.type==="number"){(t=this.childNumberEl)===null||t===void 0?void 0:t.focus()}else{(e=this.childEl)===null||e===void 0?void 0:e.focus()}return[2]}))}))};t.prototype.setDisabledAction=function(){if(!this.slottedActionEl){return}var t=this.slottedActionEl;this.disabled?t.setAttribute("disabled",""):t.removeAttribute("disabled")};t.prototype.render=function(){var t;var e=s(this.el);var i=u(this.el,["alignment","dir","clearable","min","max","step","value","icon","loading","prefix-text","scale","status","suffix-text","number-button-type","locale","group-separator"]);var a=c("div",{class:"calcite-input-loading"},c("calcite-progress",{type:"indeterminate"}));var l=this.scale==="s"||this.scale==="m"?"s":"m";var r=c("button",{class:"calcite-input-clear-button",disabled:this.loading,onClick:this.clearInputValue},c("calcite-icon",{icon:"x",scale:l}));var p=c("calcite-icon",{class:"calcite-input-icon",dir:e,flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:l});var d=this.numberButtonType==="horizontal"?"number-button-item-horizontal":null;var h=c("div",{class:"calcite-input-number-button-item "+d,"data-adjustment":"up",onMouseDown:this.numberButtonMouseDownHandler},c("calcite-icon",{icon:"chevron-up",scale:l}));var b=c("div",{class:"calcite-input-number-button-item "+d,"data-adjustment":"down",onMouseDown:this.numberButtonMouseDownHandler},c("calcite-icon",{icon:"chevron-down",scale:l}));var m=c("div",{class:"calcite-input-number-button-wrapper"},h,b);var f=c("div",{class:"calcite-input-prefix"},this.prefixText);var x=c("div",{class:"calcite-input-suffix"},this.suffixText);var g=this.type==="number"?c("input",Object.assign({},i,{autofocus:this.autofocus?true:null,defaultValue:this.defaultValue,disabled:this.disabled?true:null,key:"localized-input",maxLength:this.maxLength,minLength:this.minLength,name:undefined,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputNumberInputHandler,onKeyDown:this.inputNumberKeyDownHandler,placeholder:this.placeholder||"",ref:this.setChildNumberElRef,tabIndex:0,type:"text",value:this.localizedValue})):null;var v=[c(this.childElType,Object.assign({},i,{autofocus:this.autofocus?true:null,defaultValue:this.defaultValue,disabled:this.disabled?true:null,max:this.maxString,maxLength:this.maxLength,min:this.minString,minLength:this.minLength,name:this.name,onBlur:this.inputBlurHandler,onFocus:this.inputFocusHandler,onInput:this.inputInputHandler,onKeyDown:this.inputKeyDownHandler,placeholder:this.placeholder||"",ref:this.setChildElRef,required:this.required?true:null,step:this.step,tabIndex:this.disabled||this.type==="number"?-1:null,type:this.type,value:this.value})),this.isTextarea?c("div",{class:"calcite-input-resize-icon-wrapper"},c("calcite-icon",{icon:"chevron-down",scale:"s"})):null];return c(n,{onClick:this.inputFocusHandler},c("div",{class:(t={"calcite-input-wrapper":true},t[o.rtl]=e==="rtl",t),dir:e},this.type==="number"&&this.numberButtonType==="horizontal"?b:null,this.prefixText?f:null,c("div",{class:"calcite-input-element-wrapper"},g,v,this.isClearable?r:null,this.requestedIcon?p:null,this.loading?a:null),c("div",{class:"calcite-action-wrapper"},c("slot",{name:w.action})),this.type==="number"&&this.numberButtonType==="vertical"?m:null,this.suffixText?x:null,this.type==="number"&&this.numberButtonType==="horizontal"?h:null))};Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["disabledWatcher"],max:["maxWatcher"],min:["minWatcher"],value:["valueWatcher"],icon:["updateRequestedIcon"],type:["updateRequestedIcon"]}},enumerable:false,configurable:true});return t}());z.style=k}}}));