input.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. /*!
  2. * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
  3. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
  4. * v1.0.0-beta.82
  5. */
  6. import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
  7. import { T as TEXT$1, b as getSlotted, s as setRequestedIcon, g as getElementProp, a as getElementDir, C as CSS_UTILITY } from './dom.js';
  8. import { c as connectLabel, d as disconnectLabel, g as getLabelText } from './label.js';
  9. import { s as submitForm, c as connectForm, d as disconnectForm, H as HiddenFormInputSlot } from './form.js';
  10. import { d as delocalizeNumberString, g as getDecimalSeparator, l as localizeNumberString } from './locale.js';
  11. import { i as isValidNumber, p as parseNumberString, s as sanitizeNumberString, n as numberKeys } from './number.js';
  12. import { d as decimalPlaces } from './math.js';
  13. import { c as createObserver } from './observers.js';
  14. import { u as updateHostInteraction } from './interactive.js';
  15. import { d as defineCustomElement$2 } from './icon.js';
  16. import { d as defineCustomElement$1 } from './progress.js';
  17. const CSS = {
  18. loader: "loader",
  19. clearButton: "clear-button",
  20. editingEnabled: "editing-enabled",
  21. inlineChild: "inline-child",
  22. inputIcon: "icon",
  23. prefix: "prefix",
  24. suffix: "suffix",
  25. numberButtonWrapper: "number-button-wrapper",
  26. buttonItemHorizontal: "number-button-item--horizontal",
  27. wrapper: "element-wrapper",
  28. inputWrapper: "wrapper",
  29. actionWrapper: "action-wrapper",
  30. resizeIconWrapper: "resize-icon-wrapper",
  31. numberButtonItem: "number-button-item"
  32. };
  33. const INPUT_TYPE_ICONS = {
  34. tel: "phone",
  35. password: "lock",
  36. email: "email-address",
  37. date: "calendar",
  38. time: "clock",
  39. search: "search"
  40. };
  41. const SLOTS = {
  42. action: "action"
  43. };
  44. const TEXT = {
  45. clear: "Clear value"
  46. };
  47. const inputCss = "@-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)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:var(--calcite-animation-timing);animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{-webkit-animation-name:in;animation-name:in}.calcite-animate__in-down{-webkit-animation-name:in-down;animation-name:in-down}.calcite-animate__in-up{-webkit-animation-name:in-up;animation-name:in-up}.calcite-animate__in-scale{-webkit-animation-name:in-scale;animation-name:in-scale}:root{--calcite-popper-transition:var(--calcite-animation-timing)}:host([hidden]){display:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{height:1.5rem;padding:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) textarea{height:1.5rem;min-height:1.5rem}:host([scale=s]) .number-button-wrapper,:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{height:1.5rem}:host([scale=s]) input[type=file]{height:1.5rem}:host([scale=s]) .clear-button{min-height:1.5rem;min-width:1.5rem}:host([scale=s]) textarea{height:auto;padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.5rem;padding-right:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{height:2rem;padding:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) textarea{min-height:2rem}:host([scale=m]) .number-button-wrapper,:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{height:2rem}:host([scale=m]) input[type=file]{height:2rem}:host([scale=m]) .clear-button{min-height:2rem;min-width:2rem}:host([scale=m]) textarea{height:auto;padding-top:0.5rem;padding-bottom:0.5rem;padding-left:0.75rem;padding-right:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{height:2.75rem;padding:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) textarea{min-height:2.75rem}:host([scale=l]) .number-button-wrapper,:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{height:2.75rem}:host([scale=l]) input[type=file]{height:2.75rem}:host([scale=l]) .clear-button{min-height:2.75rem;min-width:2.75rem}:host([scale=l]) textarea{height:auto;padding-top:0.75rem;padding-bottom:0.75rem;padding-left:1rem;padding-right:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) textarea{resize:none}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host textarea,:host input{-webkit-transition:var(--calcite-animation-timing), height 0s;transition:var(--calcite-animation-timing), height 0s;-webkit-appearance:none;position:relative;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;max-height:100%;width:100%;max-width:100%;-ms-flex:1 1 0%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}:host input[type=search]::-webkit-search-decoration{-webkit-appearance:none}:host input,:host textarea{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}:host input:-ms-input-placeholder,:host textarea:-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}:host input::-ms-input-placeholder,:host textarea::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}:host input::placeholder,:host input:-ms-input-placeholder,:host input::-ms-input-placeholder,:host textarea::placeholder,:host textarea:-ms-input-placeholder,:host textarea::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}:host input:focus,:host textarea:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}:host input[readonly],:host textarea[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}:host input[readonly]:focus,:host textarea[readonly]:focus{color:var(--calcite-ui-text-1)}:host calcite-icon{color:var(--calcite-ui-text-3)}:host textarea,:host 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}:host textarea:focus,:host input:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}:host([status=invalid]) input,:host([status=invalid]) textarea{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus,:host([status=invalid]) textarea:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:-2px}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{-webkit-padding-start:2rem;padding-inline-start:2rem}:host([icon][scale=m]) input{-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}:host([icon][scale=l]) input{-webkit-padding-start:3rem;padding-inline-start:3rem}.element-wrapper{position:relative;-ms-flex-order:3;order:3;display:-ms-inline-flexbox;display:inline-flex;-ms-flex:1 1 0%;flex:1 1 0%;-ms-flex-align:center;align-items:center}.icon{pointer-events:none;position:absolute;z-index:10;display:block;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;height:0px;width:0px}input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration,input[type=date]::-webkit-clear-button,input[type=time]::-webkit-clear-button{display:none}.clear-button{pointer-events:initial;-ms-flex-order:4;order:4;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;min-height:100%;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-item-align:stretch;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);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;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-brand);outline-offset:-2px}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{top:1px;left:1px;right:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{-ms-flex-order:7;order:7;display:-ms-flexbox;display:flex}.prefix,.suffix{-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;height:auto;min-height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-ms-flex-line-pack:center;align-content:center;-ms-flex-align:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{-ms-flex-order:2;order:2;border-inline-end-width:0px}.suffix{-ms-flex-order:5;order:5;border-inline-start-width:0px}:host([alignment=start]) textarea,:host([alignment=start]) input{text-align:start}:host([alignment=end]) textarea,:host([alignment=end]) input{text-align:end}:host input[type=number]{-moz-appearance:textfield}:host input[type=number]::-webkit-inner-spin-button,:host input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield;margin:0px}.number-button-wrapper{pointer-events:none;-ms-flex-order:6;order:6;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}:host([number-button-type=vertical]) .wrapper{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex}:host([number-button-type=vertical]) input,:host([number-button-type=vertical]) textarea{-ms-flex-order:2;order:2}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=down] calcite-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host([number-button-type=horizontal]) .calcite--rtl .number-button-item[data-adjustment=up] calcite-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down],.number-button-item.number-button-item--horizontal[data-adjustment=up]{-ms-flex-order:1;order:1;max-height:100%;min-height:100%;-ms-flex-item-align:stretch;align-self:stretch}.number-button-item.number-button-item--horizontal[data-adjustment=down] calcite-icon,.number-button-item.number-button-item--horizontal[data-adjustment=up] calcite-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.number-button-item.number-button-item--horizontal[data-adjustment=down]{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);border-inline-end-width:0px}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item.number-button-item--horizontal[data-adjustment=up]{-ms-flex-order:5;order:5}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}.number-button-item.number-button-item--horizontal[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover{background-color:var(--calcite-ui-foreground-2)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=up]:hover calcite-icon{color:var(--calcite-ui-text-1)}:host([number-button-type=vertical]) .number-button-item[data-adjustment=down]{border-top-width:0px}.number-button-item{max-height:50%;min-height:50%;pointer-events:initial;margin:0px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-item-align:center;align-self:center;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);padding-top:0px;padding-bottom:0px;padding-left:0.5rem;padding-right:0.5rem;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s;border-inline-start-width:0px}.number-button-item calcite-icon{pointer-events:none;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}.number-button-item:focus{background-color:var(--calcite-ui-foreground-2)}.number-button-item:focus calcite-icon{color:var(--calcite-ui-text-1)}.number-button-item:active{background-color:var(--calcite-ui-foreground-3)}.wrapper{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}:host input::-webkit-calendar-picker-indicator{display:none}:host input[type=date]::-webkit-input-placeholder{visibility:hidden !important}:host textarea::-webkit-resizer{position:absolute;bottom:0px;-webkit-box-sizing:border-box;box-sizing:border-box;padding-top:0px;padding-bottom:0px;padding-left:0.25rem;padding-right:0.25rem;inset-inline-end:0}.resize-icon-wrapper{bottom:2px;inset-inline-end:2px;pointer-events:none;position:absolute;z-index:10;height:0.75rem;width:0.75rem;background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-3)}.resize-icon-wrapper calcite-icon{bottom:0.25rem;inset-inline-end:0.25rem;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.calcite--rtl .resize-icon-wrapper calcite-icon{-webkit-transform:rotate(45deg);transform:rotate(45deg)}:host([type=color]) input{padding:0.25rem}:host([type=file]) input{cursor:pointer;border-width:1px;border-style:dashed;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);text-align:center}:host([type=file][scale=s]) input{padding-top:1px;padding-bottom:1px;padding-left:0.5rem;padding-right:0.5rem}:host([type=file][scale=m]) input{padding-top:0.25rem;padding-bottom:0.25rem;padding-left:0.75rem;padding-right:0.75rem}:host([type=file][scale=l]) input{padding-top:0.5rem;padding-bottom:0.5rem;padding-left:1rem;padding-right:1rem}:host(.no-bottom-border) input{border-bottom-width:0px}:host(.border-top-color-one) input{border-top-color:var(--calcite-ui-border-1)}:host .inline-child{background-color:transparent;-webkit-transition-property:all;transition-property:all;-webkit-transition-duration:var(--calcite-animation-timing);transition-duration:var(--calcite-animation-timing);-webkit-transition-timing-function:ease-in-out;transition-timing-function:ease-in-out;-webkit-transition-delay:0s;transition-delay:0s}:host .inline-child .editing-enabled{background-color:inherit}:host .inline-child:not(.editing-enabled){display:-ms-flexbox;display:flex;cursor:pointer;border-color:transparent;-webkit-padding-start:0;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){bottom:0 !important;left:0 !important;margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;right:0 !important;top:0 !important;-webkit-transform:none !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
  48. const Input = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
  49. constructor() {
  50. super();
  51. this.__registerHost();
  52. this.__attachShadow();
  53. this.calciteInputFocus = createEvent(this, "calciteInputFocus", 7);
  54. this.calciteInputBlur = createEvent(this, "calciteInputBlur", 7);
  55. this.calciteInputInput = createEvent(this, "calciteInputInput", 7);
  56. this.calciteInputChange = createEvent(this, "calciteInputChange", 7);
  57. //--------------------------------------------------------------------------
  58. //
  59. // Properties
  60. //
  61. //--------------------------------------------------------------------------
  62. /** specify the alignment of the value of the input */
  63. this.alignment = "start";
  64. /** should the input autofocus */
  65. this.autofocus = false;
  66. /** optionally display a clear button that displays when field has a value
  67. * shows by default for search, time, date
  68. * will not display for type="textarea" */
  69. this.clearable = false;
  70. /** is the input disabled */
  71. this.disabled = false;
  72. /** for number values, displays the locale's group separator */
  73. this.groupSeparator = false;
  74. /** when true, the component will not be visible */
  75. this.hidden = false;
  76. /**
  77. * string to override English loading text
  78. * @default "Loading"
  79. */
  80. this.intlLoading = TEXT$1.loading;
  81. /** flip the icon in rtl */
  82. this.iconFlipRtl = false;
  83. /** specify if the input is in loading state */
  84. this.loading = false;
  85. /** BCP 47 language tag for desired language and country format */
  86. this.locale = document.documentElement.lang || "en";
  87. /**
  88. * Toggles locale formatting for numbers.
  89. * @internal
  90. */
  91. this.localeFormat = false;
  92. /** specify the placement of the number buttons */
  93. this.numberButtonType = "vertical";
  94. /** When true, a field cannot be modified. */
  95. this.readOnly = false;
  96. /** is the input required */
  97. this.required = false;
  98. /** specify the scale of the input, defaults to m */
  99. this.scale = "m";
  100. /** specify the status of the input field, determines message and icons */
  101. this.status = "idle";
  102. /** @internal adds inline styles for text input when slotted in calcite-inline-editable */
  103. this.editingEnabled = false;
  104. /**
  105. * specify the input type
  106. *
  107. * Note that the following types add type-specific icons by default: `date`, `email`, `password`, `search`, `tel`, `time`
  108. */
  109. this.type = "text";
  110. /** input value */
  111. this.value = "";
  112. /** keep track of the rendered child type */
  113. this.childElType = "input";
  114. this.previousValueOrigin = "initial";
  115. this.mutationObserver = createObserver("mutation", () => this.setDisabledAction());
  116. this.userChangedValue = false;
  117. //--------------------------------------------------------------------------
  118. //
  119. // Private Methods
  120. //
  121. //--------------------------------------------------------------------------
  122. this.keyDownHandler = (event) => {
  123. if (this.readOnly || this.disabled) {
  124. return;
  125. }
  126. if (this.isClearable && event.key === "Escape") {
  127. this.clearInputValue(event);
  128. event.preventDefault();
  129. }
  130. if (event.key === "Enter" && !event.defaultPrevented) {
  131. submitForm(this);
  132. }
  133. };
  134. this.clearInputValue = (nativeEvent) => {
  135. this.setValue({
  136. committing: true,
  137. nativeEvent,
  138. origin: "user",
  139. value: ""
  140. });
  141. };
  142. this.emitChangeIfUserModified = () => {
  143. if (this.previousValueOrigin === "user" && this.value !== this.previousEmittedValue) {
  144. this.calciteInputChange.emit();
  145. }
  146. this.previousEmittedValue = this.value;
  147. };
  148. this.inputBlurHandler = () => {
  149. this.calciteInputBlur.emit({
  150. element: this.childEl,
  151. value: this.value
  152. });
  153. this.emitChangeIfUserModified();
  154. };
  155. this.inputFocusHandler = (event) => {
  156. const slottedActionEl = getSlotted(this.el, "action");
  157. if (event.target !== slottedActionEl) {
  158. this.setFocus();
  159. }
  160. this.calciteInputFocus.emit({
  161. element: this.childEl,
  162. value: this.value
  163. });
  164. };
  165. this.inputInputHandler = (nativeEvent) => {
  166. if (this.disabled || this.readOnly) {
  167. return;
  168. }
  169. this.setValue({
  170. nativeEvent,
  171. origin: "user",
  172. value: nativeEvent.target.value
  173. });
  174. };
  175. this.inputKeyDownHandler = (event) => {
  176. if (this.disabled || this.readOnly) {
  177. return;
  178. }
  179. if (event.key === "Enter") {
  180. this.emitChangeIfUserModified();
  181. }
  182. };
  183. this.inputNumberInputHandler = (nativeEvent) => {
  184. if (this.disabled || this.readOnly) {
  185. return;
  186. }
  187. const value = nativeEvent.target.value;
  188. const delocalizedValue = delocalizeNumberString(value, this.locale);
  189. if (nativeEvent.inputType === "insertFromPaste") {
  190. if (!isValidNumber(delocalizedValue)) {
  191. nativeEvent.preventDefault();
  192. }
  193. this.setValue({
  194. nativeEvent,
  195. origin: "user",
  196. value: parseNumberString(delocalizedValue)
  197. });
  198. this.childNumberEl.value = this.localizedValue;
  199. }
  200. else {
  201. this.setValue({
  202. nativeEvent,
  203. origin: "user",
  204. value: delocalizedValue
  205. });
  206. }
  207. };
  208. this.inputNumberKeyDownHandler = (event) => {
  209. if (this.type !== "number" || this.disabled || this.readOnly) {
  210. return;
  211. }
  212. if (event.key === "ArrowUp") {
  213. /* prevent default behavior of moving cursor to the beginning of the input when holding down ArrowUp */
  214. event.preventDefault();
  215. this.nudgeNumberValue("up", event);
  216. return;
  217. }
  218. if (event.key === "ArrowDown") {
  219. this.nudgeNumberValue("down", event);
  220. return;
  221. }
  222. const supportedKeys = [
  223. ...numberKeys,
  224. "ArrowLeft",
  225. "ArrowRight",
  226. "Backspace",
  227. "Delete",
  228. "Enter",
  229. "Escape",
  230. "Tab"
  231. ];
  232. if (event.altKey || event.ctrlKey || event.metaKey) {
  233. return;
  234. }
  235. const isShiftTabEvent = event.shiftKey && event.key === "Tab";
  236. if (supportedKeys.includes(event.key) && (!event.shiftKey || isShiftTabEvent)) {
  237. if (event.key === "Enter") {
  238. this.emitChangeIfUserModified();
  239. }
  240. return;
  241. }
  242. const decimalSeparator = getDecimalSeparator(this.locale);
  243. if (event.key === decimalSeparator) {
  244. if (!this.value && !this.childNumberEl.value) {
  245. return;
  246. }
  247. if (this.value && this.childNumberEl.value.indexOf(decimalSeparator) === -1) {
  248. return;
  249. }
  250. }
  251. if (/[eE]/.test(event.key)) {
  252. if (!this.value && !this.childNumberEl.value) {
  253. return;
  254. }
  255. if (this.value && !/[eE]/.test(this.childNumberEl.value)) {
  256. return;
  257. }
  258. }
  259. if (event.key === "-") {
  260. if (!this.value && !this.childNumberEl.value) {
  261. return;
  262. }
  263. if (this.value && this.childNumberEl.value.split("-").length <= 2) {
  264. return;
  265. }
  266. }
  267. event.preventDefault();
  268. };
  269. this.nudgeNumberValue = (direction, nativeEvent) => {
  270. if ((nativeEvent instanceof KeyboardEvent && nativeEvent.repeat) || this.type !== "number") {
  271. return;
  272. }
  273. const inputMax = this.maxString ? parseFloat(this.maxString) : null;
  274. const inputMin = this.minString ? parseFloat(this.minString) : null;
  275. const valueNudgeDelayInMs = 100;
  276. this.incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent);
  277. if (this.nudgeNumberValueIntervalId) {
  278. window.clearInterval(this.nudgeNumberValueIntervalId);
  279. }
  280. let firstValueNudge = true;
  281. this.nudgeNumberValueIntervalId = window.setInterval(() => {
  282. if (firstValueNudge) {
  283. firstValueNudge = false;
  284. return;
  285. }
  286. this.incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent);
  287. }, valueNudgeDelayInMs);
  288. };
  289. this.numberButtonMouseUpAndMouseOutHandler = () => {
  290. window.clearInterval(this.nudgeNumberValueIntervalId);
  291. };
  292. this.numberButtonMouseDownHandler = (event) => {
  293. event.preventDefault();
  294. const direction = event.target.dataset.adjustment;
  295. this.nudgeNumberValue(direction, event);
  296. };
  297. this.setChildElRef = (el) => {
  298. this.childEl = el;
  299. };
  300. this.setChildNumberElRef = (el) => {
  301. this.childNumberEl = el;
  302. };
  303. this.setInputValue = (newInputValue) => {
  304. if (this.type === "text" && !this.childEl) {
  305. return;
  306. }
  307. if (this.type === "number" && !this.childNumberEl) {
  308. return;
  309. }
  310. this[`child${this.type === "number" ? "Number" : ""}El`].value = newInputValue;
  311. };
  312. this.setPreviousEmittedValue = (newPreviousEmittedValue) => {
  313. this.previousEmittedValue =
  314. this.type === "number"
  315. ? isValidNumber(newPreviousEmittedValue)
  316. ? newPreviousEmittedValue
  317. : ""
  318. : newPreviousEmittedValue;
  319. };
  320. this.setPreviousValue = (newPreviousValue) => {
  321. this.previousValue =
  322. this.type === "number"
  323. ? isValidNumber(newPreviousValue)
  324. ? newPreviousValue
  325. : ""
  326. : newPreviousValue;
  327. };
  328. this.setValue = ({ committing = false, nativeEvent, origin, previousValue, value }) => {
  329. const previousLocalizedValue = this.type === "number"
  330. ? localizeNumberString(this.previousValue, this.locale, this.groupSeparator)
  331. : "";
  332. const sanitizedValue = this.type === "number" ? sanitizeNumberString(value) : value;
  333. const newValue = this.type === "number" && value && !sanitizedValue
  334. ? isValidNumber(this.previousValue)
  335. ? this.previousValue
  336. : ""
  337. : sanitizedValue;
  338. const newLocalizedValue = this.type === "number"
  339. ? localizeNumberString(newValue, this.locale, this.groupSeparator)
  340. : "";
  341. this.setPreviousValue(previousValue || this.value);
  342. this.previousValueOrigin = origin;
  343. this.userChangedValue = origin === "user" && this.value !== newValue;
  344. this.value = newValue;
  345. if (this.type === "number") {
  346. this.localizedValue = newLocalizedValue;
  347. }
  348. if (origin === "direct") {
  349. this.setInputValue(this.type === "number" ? newLocalizedValue : newValue);
  350. }
  351. if (nativeEvent) {
  352. const calciteInputInputEvent = this.calciteInputInput.emit({
  353. element: this.childEl,
  354. nativeEvent,
  355. value: this.value
  356. });
  357. if (calciteInputInputEvent.defaultPrevented) {
  358. this.value = this.previousValue;
  359. this.localizedValue = previousLocalizedValue;
  360. }
  361. else if (committing) {
  362. this.emitChangeIfUserModified();
  363. }
  364. }
  365. };
  366. this.inputKeyUpHandler = () => {
  367. window.clearInterval(this.nudgeNumberValueIntervalId);
  368. };
  369. }
  370. disabledWatcher() {
  371. this.setDisabledAction();
  372. }
  373. /** watcher to update number-to-string for max */
  374. maxWatcher() {
  375. var _a;
  376. this.maxString = ((_a = this.max) === null || _a === void 0 ? void 0 : _a.toString()) || null;
  377. }
  378. /** watcher to update number-to-string for min */
  379. minWatcher() {
  380. var _a;
  381. this.minString = ((_a = this.min) === null || _a === void 0 ? void 0 : _a.toString()) || null;
  382. }
  383. valueWatcher(newValue, previousValue) {
  384. if (!this.userChangedValue) {
  385. this.setValue({
  386. origin: "direct",
  387. previousValue,
  388. value: newValue == null || newValue == ""
  389. ? ""
  390. : this.type === "number"
  391. ? isValidNumber(newValue)
  392. ? newValue
  393. : this.previousValue || ""
  394. : newValue
  395. });
  396. this.warnAboutInvalidNumberValue(newValue);
  397. }
  398. this.userChangedValue = false;
  399. }
  400. updateRequestedIcon() {
  401. this.requestedIcon = setRequestedIcon(INPUT_TYPE_ICONS, this.icon, this.type);
  402. }
  403. get isClearable() {
  404. return !this.isTextarea && (this.clearable || this.type === "search") && this.value.length > 0;
  405. }
  406. get isTextarea() {
  407. return this.childElType === "textarea";
  408. }
  409. //--------------------------------------------------------------------------
  410. //
  411. // Lifecycle
  412. //
  413. //--------------------------------------------------------------------------
  414. connectedCallback() {
  415. var _a;
  416. this.scale = getElementProp(this.el, "scale", this.scale);
  417. this.status = getElementProp(this.el, "status", this.status);
  418. this.inlineEditableEl = this.el.closest("calcite-inline-editable");
  419. if (this.inlineEditableEl) {
  420. this.editingEnabled = this.inlineEditableEl.editingEnabled || false;
  421. }
  422. this.setPreviousEmittedValue(this.value);
  423. this.setPreviousValue(this.value);
  424. if (this.type === "number") {
  425. this.warnAboutInvalidNumberValue(this.value);
  426. this.setValue({
  427. origin: "connected",
  428. value: isValidNumber(this.value) ? this.value : ""
  429. });
  430. }
  431. connectLabel(this);
  432. connectForm(this);
  433. (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.observe(this.el, { childList: true });
  434. this.setDisabledAction();
  435. }
  436. disconnectedCallback() {
  437. var _a;
  438. disconnectLabel(this);
  439. disconnectForm(this);
  440. (_a = this.mutationObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
  441. }
  442. componentWillLoad() {
  443. var _a, _b;
  444. this.childElType = this.type === "textarea" ? "textarea" : "input";
  445. this.maxString = (_a = this.max) === null || _a === void 0 ? void 0 : _a.toString();
  446. this.minString = (_b = this.min) === null || _b === void 0 ? void 0 : _b.toString();
  447. this.requestedIcon = setRequestedIcon(INPUT_TYPE_ICONS, this.icon, this.type);
  448. }
  449. componentShouldUpdate(newValue, oldValue, property) {
  450. if (this.type === "number" && property === "value" && newValue && !isValidNumber(newValue)) {
  451. this.setValue({
  452. origin: "reset",
  453. value: oldValue
  454. });
  455. return false;
  456. }
  457. return true;
  458. }
  459. componentDidRender() {
  460. updateHostInteraction(this);
  461. }
  462. //--------------------------------------------------------------------------
  463. //
  464. // Public Methods
  465. //
  466. //--------------------------------------------------------------------------
  467. /** Sets focus on the component. */
  468. async setFocus() {
  469. var _a, _b;
  470. if (this.type === "number") {
  471. (_a = this.childNumberEl) === null || _a === void 0 ? void 0 : _a.focus();
  472. }
  473. else {
  474. (_b = this.childEl) === null || _b === void 0 ? void 0 : _b.focus();
  475. }
  476. }
  477. onLabelClick() {
  478. this.setFocus();
  479. }
  480. incrementOrDecrementNumberValue(direction, inputMax, inputMin, nativeEvent) {
  481. const { value } = this;
  482. const inputStep = this.step === "any" ? 1 : Math.abs(this.step || 1);
  483. const inputVal = value && value !== "" ? parseFloat(value) : 0;
  484. const adjustment = direction === "up" ? 1 : -1;
  485. const nudgedValue = inputVal + inputStep * adjustment;
  486. const finalValue = (typeof inputMin === "number" && !isNaN(inputMin) && nudgedValue < inputMin) ||
  487. (typeof inputMax === "number" && !isNaN(inputMax) && nudgedValue > inputMax)
  488. ? inputVal
  489. : nudgedValue;
  490. const inputValPlaces = decimalPlaces(inputVal);
  491. const inputStepPlaces = decimalPlaces(inputStep);
  492. this.setValue({
  493. committing: true,
  494. nativeEvent,
  495. origin: "user",
  496. value: finalValue.toFixed(Math.max(inputValPlaces, inputStepPlaces))
  497. });
  498. }
  499. onFormReset() {
  500. this.setValue({
  501. origin: "reset",
  502. value: this.defaultValue
  503. });
  504. }
  505. syncHiddenFormInput(input) {
  506. var _a, _b, _c, _d;
  507. if (this.type === "number") {
  508. input.type = "number";
  509. input.min = (_b = (_a = this.min) === null || _a === void 0 ? void 0 : _a.toString(10)) !== null && _b !== void 0 ? _b : "";
  510. input.max = (_d = (_c = this.max) === null || _c === void 0 ? void 0 : _c.toString(10)) !== null && _d !== void 0 ? _d : "";
  511. }
  512. else if (this.type === "text") {
  513. input.type = "text";
  514. if (this.minLength != null) {
  515. input.minLength = this.minLength;
  516. }
  517. if (this.maxLength != null) {
  518. input.maxLength = this.maxLength;
  519. }
  520. }
  521. else if (this.type === "password") {
  522. input.type = "password";
  523. }
  524. }
  525. setDisabledAction() {
  526. const slottedActionEl = getSlotted(this.el, "action");
  527. if (!slottedActionEl) {
  528. return;
  529. }
  530. this.disabled
  531. ? slottedActionEl.setAttribute("disabled", "")
  532. : slottedActionEl.removeAttribute("disabled");
  533. }
  534. warnAboutInvalidNumberValue(value) {
  535. if (this.type === "number" && value && !isValidNumber(value)) {
  536. console.warn(`The specified value "${value}" cannot be parsed, or is out of range.`);
  537. }
  538. }
  539. // --------------------------------------------------------------------------
  540. //
  541. // Render Methods
  542. //
  543. // --------------------------------------------------------------------------
  544. render() {
  545. const dir = getElementDir(this.el);
  546. const loader = (h("div", { class: CSS.loader }, h("calcite-progress", { label: this.intlLoading, type: "indeterminate" })));
  547. const inputClearButton = (h("button", { "aria-label": this.intlClear || TEXT.clear, class: CSS.clearButton, disabled: this.disabled || this.readOnly, onClick: this.clearInputValue, tabIndex: this.disabled ? -1 : 0, type: "button" }, h("calcite-icon", { icon: "x", scale: "s" })));
  548. const iconEl = (h("calcite-icon", { class: CSS.inputIcon, flipRtl: this.iconFlipRtl, icon: this.requestedIcon, scale: "s" }));
  549. const isHorizontalNumberButton = this.numberButtonType === "horizontal";
  550. const numberButtonsHorizontalUp = (h("button", { class: {
  551. [CSS.numberButtonItem]: true,
  552. [CSS.buttonItemHorizontal]: isHorizontalNumberButton
  553. }, "data-adjustment": "up", disabled: this.disabled || this.readOnly, onMouseDown: this.numberButtonMouseDownHandler, onMouseOut: this.numberButtonMouseUpAndMouseOutHandler, onMouseUp: this.numberButtonMouseUpAndMouseOutHandler, tabIndex: -1, type: "button" }, h("calcite-icon", { icon: "chevron-up", scale: "s" })));
  554. const numberButtonsHorizontalDown = (h("button", { class: {
  555. [CSS.numberButtonItem]: true,
  556. [CSS.buttonItemHorizontal]: isHorizontalNumberButton
  557. }, "data-adjustment": "down", disabled: this.disabled || this.readOnly, onMouseDown: this.numberButtonMouseDownHandler, onMouseOut: this.numberButtonMouseUpAndMouseOutHandler, onMouseUp: this.numberButtonMouseUpAndMouseOutHandler, tabIndex: -1, type: "button" }, h("calcite-icon", { icon: "chevron-down", scale: "s" })));
  558. const numberButtonsVertical = (h("div", { class: CSS.numberButtonWrapper }, numberButtonsHorizontalUp, numberButtonsHorizontalDown));
  559. const prefixText = h("div", { class: CSS.prefix }, this.prefixText);
  560. const suffixText = h("div", { class: CSS.suffix }, this.suffixText);
  561. const localeNumberInput = this.type === "number" ? (h("input", { "aria-label": getLabelText(this), autofocus: this.autofocus ? true : null, defaultValue: this.defaultValue, disabled: this.disabled ? true : null, enterKeyHint: this.el.enterKeyHint, inputMode: this.el.inputMode, key: "localized-input", maxLength: this.maxLength, minLength: this.minLength, name: undefined, onBlur: this.inputBlurHandler, onFocus: this.inputFocusHandler, onInput: this.inputNumberInputHandler, onKeyDown: this.inputNumberKeyDownHandler, onKeyUp: this.inputKeyUpHandler, placeholder: this.placeholder || "", readOnly: this.readOnly, ref: this.setChildNumberElRef, type: "text", value: this.localizedValue })) : null;
  562. const childEl = this.type !== "number"
  563. ? [
  564. h(this.childElType, { "aria-label": getLabelText(this), autofocus: this.autofocus ? true : null, class: {
  565. [CSS.editingEnabled]: this.editingEnabled,
  566. [CSS.inlineChild]: !!this.inlineEditableEl
  567. }, defaultValue: this.defaultValue, disabled: this.disabled ? true : null, enterKeyHint: this.el.enterKeyHint, inputMode: this.el.inputMode, 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, onKeyUp: this.inputKeyUpHandler, placeholder: this.placeholder || "", readOnly: this.readOnly, ref: this.setChildElRef, required: this.required ? true : null, step: this.step, tabIndex: this.disabled || (this.inlineEditableEl && !this.editingEnabled) ? -1 : null, type: this.type, value: this.value }),
  568. this.isTextarea ? (h("div", { class: CSS.resizeIconWrapper }, h("calcite-icon", { icon: "chevron-down", scale: "s" }))) : null
  569. ]
  570. : null;
  571. return (h(Host, { onClick: this.inputFocusHandler, onKeyDown: this.keyDownHandler }, h("div", { class: { [CSS.inputWrapper]: true, [CSS_UTILITY.rtl]: dir === "rtl" } }, this.type === "number" && this.numberButtonType === "horizontal" && !this.readOnly
  572. ? numberButtonsHorizontalDown
  573. : null, this.prefixText ? prefixText : null, h("div", { class: CSS.wrapper }, localeNumberInput, childEl, this.isClearable ? inputClearButton : null, this.requestedIcon ? iconEl : null, this.loading ? loader : null), h("div", { class: CSS.actionWrapper }, h("slot", { name: SLOTS.action })), this.type === "number" && this.numberButtonType === "vertical" && !this.readOnly
  574. ? numberButtonsVertical
  575. : null, this.suffixText ? suffixText : null, this.type === "number" && this.numberButtonType === "horizontal" && !this.readOnly
  576. ? numberButtonsHorizontalUp
  577. : null, h(HiddenFormInputSlot, { component: this }))));
  578. }
  579. get el() { return this; }
  580. static get watchers() { return {
  581. "disabled": ["disabledWatcher"],
  582. "max": ["maxWatcher"],
  583. "min": ["minWatcher"],
  584. "value": ["valueWatcher"],
  585. "icon": ["updateRequestedIcon"],
  586. "type": ["updateRequestedIcon"]
  587. }; }
  588. static get style() { return inputCss; }
  589. }, [1, "calcite-input", {
  590. "alignment": [513],
  591. "autofocus": [4],
  592. "clearable": [516],
  593. "disabled": [516],
  594. "groupSeparator": [4, "group-separator"],
  595. "hidden": [4],
  596. "icon": [520],
  597. "intlClear": [1, "intl-clear"],
  598. "intlLoading": [1, "intl-loading"],
  599. "iconFlipRtl": [516, "icon-flip-rtl"],
  600. "label": [1],
  601. "loading": [516],
  602. "locale": [1],
  603. "localeFormat": [4, "locale-format"],
  604. "max": [514],
  605. "min": [514],
  606. "maxlength": [514],
  607. "maxLength": [514, "max-length"],
  608. "minLength": [514, "min-length"],
  609. "name": [513],
  610. "numberButtonType": [513, "number-button-type"],
  611. "placeholder": [1],
  612. "prefixText": [1, "prefix-text"],
  613. "readOnly": [4, "read-only"],
  614. "required": [4],
  615. "scale": [1537],
  616. "status": [1537],
  617. "step": [520],
  618. "suffixText": [1, "suffix-text"],
  619. "editingEnabled": [1540, "editing-enabled"],
  620. "type": [513],
  621. "value": [1025],
  622. "localizedValue": [32],
  623. "setFocus": [64]
  624. }]);
  625. function defineCustomElement() {
  626. if (typeof customElements === "undefined") {
  627. return;
  628. }
  629. const components = ["calcite-input", "calcite-icon", "calcite-progress"];
  630. components.forEach(tagName => { switch (tagName) {
  631. case "calcite-input":
  632. if (!customElements.get(tagName)) {
  633. customElements.define(tagName, Input);
  634. }
  635. break;
  636. case "calcite-icon":
  637. if (!customElements.get(tagName)) {
  638. defineCustomElement$2();
  639. }
  640. break;
  641. case "calcite-progress":
  642. if (!customElements.get(tagName)) {
  643. defineCustomElement$1();
  644. }
  645. break;
  646. } });
  647. }
  648. defineCustomElement();
  649. export { Input as I, defineCustomElement as d };