@carbon/web-components 1.36.0 → 1.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{checkbox-33a1eaf8.js → checkbox-39ba54c6.js} +1 -1
  2. package/dist/checkbox-d61e0f46.js +65 -0
  3. package/dist/checkbox.min.js +1 -1
  4. package/dist/checkbox.rtl.min.js +1 -1
  5. package/dist/data-table.min.js +1 -1
  6. package/dist/data-table.rtl.min.js +1 -1
  7. package/dist/date-picker.min.js +1 -1
  8. package/dist/date-picker.rtl.min.js +1 -1
  9. package/dist/{input-47bf976e.js → input-47f04966.js} +1 -1
  10. package/dist/{input-e5442b90.js → input-d66d0e9c.js} +1 -1
  11. package/dist/input.min.js +1 -1
  12. package/dist/input.rtl.min.js +1 -1
  13. package/dist/number-input.min.js +2 -2
  14. package/dist/number-input.rtl.min.js +2 -2
  15. package/dist/pagination.min.js +1 -1
  16. package/dist/pagination.rtl.min.js +1 -1
  17. package/dist/{search-87761b5e.js → search-e6781408.js} +1 -1
  18. package/dist/{search-f2955dfc.js → search-f36f74c2.js} +1 -1
  19. package/dist/search.min.js +1 -1
  20. package/dist/search.rtl.min.js +1 -1
  21. package/dist/select.min.js +1 -1
  22. package/dist/select.rtl.min.js +1 -1
  23. package/dist/toggle.min.js +1 -1
  24. package/dist/toggle.rtl.min.js +1 -1
  25. package/es/components/checkbox/checkbox.js +1 -1
  26. package/es/components/checkbox/checkbox.js.map +1 -1
  27. package/es/components/input/input.d.ts +0 -4
  28. package/es/components/input/input.js +1 -11
  29. package/es/components/input/input.js.map +1 -1
  30. package/es/components/number-input/number-input.js +1 -1
  31. package/es/components/number-input/number-input.js.map +1 -1
  32. package/es/components/pagination/pages-select.js +1 -1
  33. package/es/components/pagination/pages-select.js.map +1 -1
  34. package/package.json +2 -2
  35. package/dist/checkbox-7352ebd3.js +0 -65
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.js","names":["classMap","html","property","query","LitElement","settings","ifNonNull","FocusMixin","FormMixin","styles","carbonElement","customElement","prefix","BXCheckbox","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","decorators","key","value","_handleChange","checked","indeterminate","_checkboxNode","eventChange","dispatchEvent","CustomEvent","bubbles","composed","detail","_handleFormdata","event","formData","disabled","name","append","type","Boolean","reflect","attribute","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","Number","exec","navigator","userAgent","render","hideLabel","labelText","handleChange","labelClasses","_t","_","String","static"],"sources":["components/checkbox/checkbox.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit-html/directives/class-map';\nimport { html, property, query, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport ifNonNull from '../../globals/directives/if-non-null';\nimport FocusMixin from '../../globals/mixins/focus';\nimport FormMixin from '../../globals/mixins/form';\nimport styles from './checkbox.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * Check box.\n *\n * @element bx-checkbox\n * @fires bx-checkbox-changed - The custom event fired after this changebox changes its checked state.\n * @csspart input The checkbox.\n * @csspart label The label.\n */\n@customElement(`${prefix}-checkbox`)\nclass BXCheckbox extends FocusMixin(FormMixin(LitElement)) {\n @query('input')\n protected _checkboxNode!: HTMLInputElement;\n\n /**\n * Handles `click` event on the `<input>` in the shadow DOM.\n */\n protected _handleChange() {\n const { checked, indeterminate } = this._checkboxNode;\n this.checked = checked;\n this.indeterminate = indeterminate;\n const { eventChange } = this.constructor as typeof BXCheckbox;\n this.dispatchEvent(\n new CustomEvent(eventChange, {\n bubbles: true,\n composed: true,\n detail: {\n indeterminate,\n },\n })\n );\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { checked, disabled, name, value = 'on' } = this;\n if (!disabled && checked) {\n formData.append(name, value);\n }\n }\n\n /**\n * `true` if the check box should be checked.\n */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /**\n * `true` if the check box should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if the label should be hidden.\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * `true` if the check box should show its UI of the indeterminate state.\n */\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * The form name.\n */\n @property()\n name!: string;\n\n /**\n * The value.\n */\n @property()\n value!: string;\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n render() {\n const {\n checked,\n disabled,\n hideLabel,\n indeterminate,\n labelText,\n name,\n value,\n _handleChange: handleChange,\n } = this;\n const labelClasses = classMap({\n [`${prefix}--checkbox-label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n });\n return html`\n <input\n id=\"checkbox\"\n type=\"checkbox\"\n part=\"input\"\n class=\"${`${prefix}--checkbox`}\"\n aria-checked=\"${indeterminate ? 'mixed' : String(Boolean(checked))}\"\n .checked=\"${checked}\"\n ?disabled=\"${disabled}\"\n .indeterminate=\"${indeterminate}\"\n name=\"${ifNonNull(name)}\"\n value=\"${ifNonNull(value)}\"\n @change=\"${handleChange}\" />\n <label for=\"checkbox\" part=\"label\" class=\"${labelClasses}\">\n <span class=\"${prefix}--checkbox-label-text\"\n ><slot>${labelText}</slot></span\n >\n </label>\n `;\n }\n\n /**\n * The name of the custom event fired after this changebox changes its checked state.\n */\n static get eventChange() {\n return `${prefix}-checkbox-changed`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXCheckbox;\n"],"m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ACvBrB,SAAS,CAACiC,IAAI,CAAC,EACdjC,SAAS,CAACkB,KAAK,CAAC,EACdiC,YAAY,EACmBC,YAAY,EACvC9C,MAAM,EACV4C,SAAS;MAI1B;;MAEA;AACF;AACA;IAFE;MAAAnC,IAAA;MAAAyC,MAAA;MAAAvC,GAAA;MAAAC,KAAA,EAGA,SAAAK,YAAA,EAAyB;QACvB,OAAQ,GAAEjB,MAAO,mBAAkB;MACrC;IAAC;MAAAS,IAAA;MAAAyC,MAAA;MAAAvC,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GA7HCF,UAAU,CAACC,SAAS,CAACJ,UAAU,CAAC,CAAC;AAgI1D,eAAeS,UAAU"}
1
+ {"version":3,"file":"checkbox.js","names":["classMap","html","property","query","LitElement","settings","ifNonNull","FocusMixin","FormMixin","styles","carbonElement","customElement","prefix","BXCheckbox","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","decorators","key","value","_handleChange","checked","indeterminate","_checkboxNode","eventChange","dispatchEvent","CustomEvent","bubbles","composed","detail","_handleFormdata","event","formData","disabled","name","append","type","Boolean","reflect","attribute","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","Number","exec","navigator","userAgent","render","hideLabel","labelText","handleChange","labelClasses","_t","_","static"],"sources":["components/checkbox/checkbox.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit-html/directives/class-map';\nimport { html, property, query, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport ifNonNull from '../../globals/directives/if-non-null';\nimport FocusMixin from '../../globals/mixins/focus';\nimport FormMixin from '../../globals/mixins/form';\nimport styles from './checkbox.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * Check box.\n *\n * @element bx-checkbox\n * @fires bx-checkbox-changed - The custom event fired after this changebox changes its checked state.\n * @csspart input The checkbox.\n * @csspart label The label.\n */\n@customElement(`${prefix}-checkbox`)\nclass BXCheckbox extends FocusMixin(FormMixin(LitElement)) {\n @query('input')\n protected _checkboxNode!: HTMLInputElement;\n\n /**\n * Handles `click` event on the `<input>` in the shadow DOM.\n */\n protected _handleChange() {\n const { checked, indeterminate } = this._checkboxNode;\n this.checked = checked;\n this.indeterminate = indeterminate;\n const { eventChange } = this.constructor as typeof BXCheckbox;\n this.dispatchEvent(\n new CustomEvent(eventChange, {\n bubbles: true,\n composed: true,\n detail: {\n indeterminate,\n },\n })\n );\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { checked, disabled, name, value = 'on' } = this;\n if (!disabled && checked) {\n formData.append(name, value);\n }\n }\n\n /**\n * `true` if the check box should be checked.\n */\n @property({ type: Boolean, reflect: true })\n checked = false;\n\n /**\n * `true` if the check box should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if the label should be hidden.\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-label' })\n hideLabel = false;\n\n /**\n * `true` if the check box should show its UI of the indeterminate state.\n */\n @property({ type: Boolean, reflect: true })\n indeterminate = false;\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * The form name.\n */\n @property()\n name!: string;\n\n /**\n * The value.\n */\n @property()\n value!: string;\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n render() {\n const {\n checked,\n disabled,\n hideLabel,\n indeterminate,\n labelText,\n name,\n value,\n _handleChange: handleChange,\n } = this;\n const labelClasses = classMap({\n [`${prefix}--checkbox-label`]: true,\n [`${prefix}--visually-hidden`]: hideLabel,\n });\n return html`\n <input\n id=\"checkbox\"\n type=\"checkbox\"\n part=\"input\"\n class=\"${`${prefix}--checkbox`}\"\n .checked=\"${checked}\"\n ?disabled=\"${disabled}\"\n .indeterminate=\"${indeterminate}\"\n name=\"${ifNonNull(name)}\"\n value=\"${ifNonNull(value)}\"\n @change=\"${handleChange}\" />\n <label for=\"checkbox\" part=\"label\" class=\"${labelClasses}\">\n <span class=\"${prefix}--checkbox-label-text\"\n ><slot>${labelText}</slot></span\n >\n </label>\n `;\n }\n\n /**\n * The name of the custom event fired after this changebox changes its checked state.\n */\n static get eventChange() {\n return `${prefix}-checkbox-changed`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXCheckbox;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,+BAA+B;AACxD,SAASC,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,UAAU,QAAQ,aAAa;AAC/D,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,SAAS,MAAM,sCAAsC;AAC5D,OAAOC,UAAU,MAAM,4BAA4B;AACnD,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,MAAM,MAAM,qBAAiB;AACpC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,MAAM;EAAEC;AAAO,CAAC,GAAGP,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IASMQ,UAAU,GAAAC,SAAA,EADfH,aAAa,CAAE,GAAEC,MAAO,WAAU,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAApC,MACMH,UAAU,SAAAG,WAAA,CAA2C;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA6H3D;EAAC;IAAAI,CAAA,EA7HKN,UAAU;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GACbnB,KAAK,CAAC,OAAO,CAAC;MAAAoB,G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,aAAa;UACb6B,SAAS;UACTjB,IAAI;UACJf,KAAK;UACLC,aAAa,EAAEgC;QACjB,CAAC,GAAG,IAAI;QACR,MAAMC,YAAY,GAAG1D,QAAQ,CAAC;UAC5B,CAAE,GAAEY,MAAO,kBAAiB,GAAG,IAAI;UACnC,CAAE,GAAEA,MAAO,mBAAkB,GAAG2C;QAClC,CAAC,CAAC;QACF,OAAOtD,IAAI,CAAA0D,EAAA,KAAAA,EAAA,GAAAC,CAAA,gSAKG,GAAEhD,MAAO,YAAW,EAClBc,OAAO,EACNY,QAAQ,EACHX,aAAa,EACvBrB,SAAS,CAACiC,IAAI,CAAC,EACdjC,SAAS,CAACkB,KAAK,CAAC,EACdiC,YAAY,EACmBC,YAAY,EACvC9C,MAAM,EACV4C,SAAS;MAI1B;;MAEA;AACF;AACA;IAFE;MAAAnC,IAAA;MAAAwC,MAAA;MAAAtC,GAAA;MAAAC,KAAA,EAGA,SAAAK,YAAA,EAAyB;QACvB,OAAQ,GAAEjB,MAAO,mBAAkB;MACrC;IAAC;MAAAS,IAAA;MAAAwC,MAAA;MAAAtC,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GA5HCF,UAAU,CAACC,SAAS,CAACJ,UAAU,CAAC,CAAC;AA+H1D,eAAeS,UAAU"}
@@ -683,10 +683,6 @@ export default class BXInput extends BXInput_base {
683
683
  * The underlying input element
684
684
  */
685
685
  protected _input: HTMLInputElement;
686
- /**
687
- * The internal value.
688
- */
689
- protected _value: string;
690
686
  /**
691
687
  * Set initial value of input
692
688
  */
@@ -52,12 +52,6 @@ let BXInput = _decorate([customElement(`${prefix}-input`)], function (_initializ
52
52
  decorators: [query('input')],
53
53
  key: "_input",
54
54
  value: void 0
55
- }, {
56
- kind: "field",
57
- key: "_value",
58
- value() {
59
- return '';
60
- }
61
55
  }, {
62
56
  kind: "field",
63
57
  decorators: [property({
@@ -75,10 +69,6 @@ let BXInput = _decorate([customElement(`${prefix}-input`)], function (_initializ
75
69
  * The underlying input element
76
70
  */
77
71
 
78
- /**
79
- * The internal value.
80
- */
81
-
82
72
  /**
83
73
  * Set initial value of input
84
74
  */
@@ -421,7 +411,7 @@ let BXInput = _decorate([customElement(`${prefix}-input`)], function (_initializ
421
411
  });
422
412
  const passwordButtonLabel = html(_t || (_t = _` <span class="${0}--assistive-text"> ${0} </span> `), prefix, passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel);
423
413
  const passwordVisibilityButton = () => html(_t2 || (_t2 = _` <button type="button" class="${0}" ?disabled="${0}" @click="${0}"> ${0} ${0} </button> `), passwordVisibilityToggleClasses, this.disabled, this.handleTogglePasswordVisibility, !this.disabled && passwordButtonLabel, passwordVisibilityIcon);
424
- return html(_t3 || (_t3 = _` <label class="${0}" for="input"> <slot name="label-text"> ${0} </slot> </label> <div class="${0}--text-input__field-wrapper" ?data-invalid="${0}"> ${0} <input autocomplete="${0}" ?autofocus="${0}" class="${0}" ?data-invalid="${0}" ?disabled="${0}" aria-describedby="helper-text" id="input" name="${0}" pattern="${0}" placeholder="${0}" ?readonly="${0}" ?required="${0}" type="${0}" .value="${0}" @input="${0}"> ${0} </div> <div class="${0}" id="helper-text"> <slot name="helper-text"> ${0} </slot> </div> <div class="${0}--form-requirement"> <slot name="validity-message"> ${0} </slot> </div> `), labelClasses, this.labelText, prefix, this.invalid, this.invalid ? invalidIcon : null, this.autocomplete, this.autofocus, inputClasses, this.invalid, this.disabled, ifNonEmpty(this.name), ifNonEmpty(this.pattern), ifNonEmpty(this.placeholder), this.readonly, this.required, ifNonEmpty(this.type), this._value, handleInput, this.showPasswordVisibilityToggle && (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT) ? passwordVisibilityButton() : null, helperTextClasses, this.helperText, prefix, this.validityMessage);
414
+ return html(_t3 || (_t3 = _` <label class="${0}" for="input"> <slot name="label-text"> ${0} </slot> </label> <div class="${0}--text-input__field-wrapper" ?data-invalid="${0}"> ${0} <input autocomplete="${0}" ?autofocus="${0}" class="${0}" ?data-invalid="${0}" ?disabled="${0}" aria-describedby="helper-text" id="input" name="${0}" pattern="${0}" placeholder="${0}" ?readonly="${0}" ?required="${0}" type="${0}" .value="${0}" @input="${0}"> ${0} </div> <div class="${0}" id="helper-text"> <slot name="helper-text"> ${0} </slot> </div> <div class="${0}--form-requirement"> <slot name="validity-message"> ${0} </slot> </div> `), labelClasses, this.labelText, prefix, this.invalid, this.invalid ? invalidIcon : null, this.autocomplete, this.autofocus, inputClasses, this.invalid, this.disabled, ifNonEmpty(this.name), ifNonEmpty(this.pattern), ifNonEmpty(this.placeholder), this.readonly, this.required, ifNonEmpty(this.type), this.value, handleInput, this.showPasswordVisibilityToggle && (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT) ? passwordVisibilityButton() : null, helperTextClasses, this.helperText, prefix, this.validityMessage);
425
415
  }
426
416
  }, {
427
417
  kind: "field",
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":["html","property","query","LitElement","classMap","settings","View16","ViewOff16","WarningFilled16","FLOATING_MENU_ALIGNMENT","FLOATING_MENU_DIRECTION","ifNonEmpty","FormMixin","ValidityMixin","INPUT_COLOR_SCHEME","INPUT_SIZE","INPUT_TYPE","styles","carbonElement","customElement","prefix","BXInput","_decorate","_initialize","_ValidityMixin","constructor","args","F","d","kind","decorators","key","value","reflect","_handleInput","target","_handleFormdata","event","formData","disabled","name","append","type","Boolean","attribute","REGULAR","CENTER","BOTTOM","TEXT","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","Number","exec","navigator","userAgent","handleTogglePasswordVisibility","PASSWORD","render","handleInput","invalidIcon","class","inputClasses","colorScheme","invalid","size","labelClasses","helperTextClasses","passwordIsVisible","passwordVisibilityIcon","passwordVisibilityToggleClasses","tooltipDirection","tooltipAlignment","passwordButtonLabel","_t","_","hidePasswordLabel","showPasswordLabel","passwordVisibilityButton","_t2","_t3","labelText","autocomplete","autofocus","pattern","placeholder","readonly","required","_value","showPasswordVisibilityToggle","helperText","validityMessage","static","default"],"sources":["components/input/input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, query, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport View16 from '@carbon/icons/lib/view/16';\nimport ViewOff16 from '@carbon/icons/lib/view--off/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n} from '../floating-menu/floating-menu';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from './defs';\nimport styles from './input.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE };\n\nconst { prefix } = settings;\n\n/**\n * Input element. Supports all the usual attributes for textual input types\n *\n * @element bx-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-input`)\nexport default class BXInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Set initial value of input\n */\n @property({ reflect: true })\n value = '';\n\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = INPUT_COLOR_SCHEME.REGULAR;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Controls the readonly state of the input\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.REGULAR;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = FLOATING_MENU_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = FLOATING_MENU_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const { _handleInput: handleInput } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--${this.colorScheme}`]: this.colorScheme,\n [`${prefix}--text-input--invalid`]: this.invalid,\n [`${prefix}--text-input--${this.size}`]: this.size,\n [`${prefix}--password-input`]: this.type === INPUT_TYPE.PASSWORD,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const passwordIsVisible = this.type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? ViewOff16({ class: `${prefix}--icon-visibility-off` })\n : View16({ class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: this.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${!this.disabled && passwordButtonLabel} ${passwordVisibilityIcon}\n </button>\n `;\n\n return html`\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.labelText} </slot>\n </label>\n <div\n class=\"${prefix}--text-input__field-wrapper\"\n ?data-invalid=\"${this.invalid}\">\n ${this.invalid ? invalidIcon : null}\n <input\n autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n type=\"${ifNonEmpty(this.type)}\"\n .value=\"${this._value}\"\n @input=\"${handleInput}\" />\n ${this.showPasswordVisibilityToggle &&\n (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n </div>\n <div class=\"${helperTextClasses}\" id=\"helper-text\">\n <slot name=\"helper-text\"> ${this.helperText} </slot>\n </div>\n <div class=\"${prefix}--form-requirement\">\n <slot name=\"validity-message\"> ${this.validityMessage} </slot>\n </div>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"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B,4BAA4B,KAClC,IAAI,CAACjD,IAAI,KAAK1B,UAAU,CAAC2C,QAAQ,IAAI,IAAI,CAACjB,IAAI,KAAK1B,UAAU,CAACgC,IAAI,CAAC,GAChEgC,wBAAwB,CAAC,CAAC,GAC1B,IAAI,EAEIX,iBAAiB,EACD,IAAI,CAACuB,UAAU,EAE/BxE,MAAM,EACe,IAAI,CAACyE,eAAe;MAG3D;IAAC;MAAAhE,IAAA;MAAAiE,MAAA;MAAA/D,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAxRaJ,aAAa,CAACD,SAAS,CAACT,UAAU,CAAC,CAAC;AAAA,SAApDkB,OAAO,IAAA0E,OAAA"}
1
+ {"version":3,"file":"input.js","names":["html","property","query","LitElement","classMap","settings","View16","ViewOff16","WarningFilled16","FLOATING_MENU_ALIGNMENT","FLOATING_MENU_DIRECTION","ifNonEmpty","FormMixin","ValidityMixin","INPUT_COLOR_SCHEME","INPUT_SIZE","INPUT_TYPE","styles","carbonElement","customElement","prefix","BXInput","_decorate","_initialize","_ValidityMixin","constructor","args","F","d","kind","decorators","key","value","reflect","_handleInput","target","_handleFormdata","event","formData","disabled","name","append","type","Boolean","attribute","REGULAR","CENTER","BOTTOM","TEXT","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","Number","exec","navigator","userAgent","handleTogglePasswordVisibility","PASSWORD","render","handleInput","invalidIcon","class","inputClasses","colorScheme","invalid","size","labelClasses","helperTextClasses","passwordIsVisible","passwordVisibilityIcon","passwordVisibilityToggleClasses","tooltipDirection","tooltipAlignment","passwordButtonLabel","_t","_","hidePasswordLabel","showPasswordLabel","passwordVisibilityButton","_t2","_t3","labelText","autocomplete","autofocus","pattern","placeholder","readonly","required","showPasswordVisibilityToggle","helperText","validityMessage","static","default"],"sources":["components/input/input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, query, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport View16 from '@carbon/icons/lib/view/16';\nimport ViewOff16 from '@carbon/icons/lib/view--off/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n} from '../floating-menu/floating-menu';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from './defs';\nimport styles from './input.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE };\n\nconst { prefix } = settings;\n\n/**\n * Input element. Supports all the usual attributes for textual input types\n *\n * @element bx-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-input`)\nexport default class BXInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n /**\n * Set initial value of input\n */\n @property({ reflect: true })\n value = '';\n\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = INPUT_COLOR_SCHEME.REGULAR;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Controls the readonly state of the input\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.REGULAR;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = FLOATING_MENU_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = FLOATING_MENU_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const { _handleInput: handleInput } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--${this.colorScheme}`]: this.colorScheme,\n [`${prefix}--text-input--invalid`]: this.invalid,\n [`${prefix}--text-input--${this.size}`]: this.size,\n [`${prefix}--password-input`]: this.type === INPUT_TYPE.PASSWORD,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const passwordIsVisible = this.type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? ViewOff16({ class: `${prefix}--icon-visibility-off` })\n : View16({ class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: this.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${!this.disabled && passwordButtonLabel} ${passwordVisibilityIcon}\n </button>\n `;\n\n return html`\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.labelText} </slot>\n </label>\n <div\n class=\"${prefix}--text-input__field-wrapper\"\n ?data-invalid=\"${this.invalid}\">\n ${this.invalid ? invalidIcon : null}\n <input\n autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n type=\"${ifNonEmpty(this.type)}\"\n .value=\"${this.value}\"\n @input=\"${handleInput}\" />\n ${this.showPasswordVisibilityToggle &&\n (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n </div>\n <div class=\"${helperTextClasses}\" id=\"helper-text\">\n <slot name=\"helper-text\"> ${this.helperText} </slot>\n </div>\n <div class=\"${prefix}--form-requirement\">\n <slot name=\"validity-message\"> ${this.validityMessage} </slot>\n </div>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,UAAU,QAAQ,aAAa;AAC/D,SAASC,QAAQ,QAAQ,+BAA+B;AACxD,OAAOC,Q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,IAAA;MAAAgE,MAAA;MAAA9D,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAnRaJ,aAAa,CAACD,SAAS,CAACT,UAAU,CAAC,CAAC;AAAA,SAApDkB,OAAO,IAAAyE,OAAA"}
@@ -385,7 +385,7 @@ let BXNumberInput = _decorate([customElement(`${prefix}-number-input`)], functio
385
385
  });
386
386
  const incrementButton = html(_t || (_t = _2` <button class="${0}--number__control-btn up-icon" aria-label="${0}" aria-live="polite" aria-atomic="true" type="button" ?disabled="${0}" @click="${0}"> ${0} </button> `), prefix, this.incrementButtonAssistiveText, this.disabled, handleUserInitiatedStepUp, CaretUp16());
387
387
  const decrementButton = html(_t2 || (_t2 = _2` <button class="${0}--number__control-btn down-icon" aria-label="${0}" aria-live="polite" aria-atomic="true" type="button" ?disabled="${0}" @click="${0}"> ${0} </button> `), prefix, this.decrementButtonAssistiveText, this.disabled, handleUserInitiatedStepDown, CaretDown16());
388
- const input = html(_t3 || (_t3 = _2` <input ?autocomplete="${0}" ?autofocus="${0}" ?data-invalid="${0}" ?disabled="${0}" id="input" name="${0}" pattern="${0}" placeholder="${0}" ?readonly="${0}" ?required="${0}" type="number" .value="${0}" @input="${0}" min="${0}" max="${0}" step="${0}" role="alert" aria-atomic="true"> `), this.autocomplete, this.autofocus, this.invalid, this.disabled, ifNonEmpty(this.name), ifNonEmpty(this.pattern), ifNonEmpty(this.placeholder), this.readonly, this.required, this._value, handleInput, ifNonEmpty(this.min), ifNonEmpty(this.max), ifNonEmpty(this.step));
388
+ const input = html(_t3 || (_t3 = _2` <input ?autocomplete="${0}" ?autofocus="${0}" ?data-invalid="${0}" ?disabled="${0}" id="input" name="${0}" pattern="${0}" placeholder="${0}" ?readonly="${0}" ?required="${0}" type="number" .value="${0}" @input="${0}" min="${0}" max="${0}" step="${0}" role="alert" aria-atomic="true"> `), this.autocomplete, this.autofocus, this.invalid, this.disabled, ifNonEmpty(this.name), ifNonEmpty(this.pattern), ifNonEmpty(this.placeholder), this.readonly, this.required, this.value, handleInput, ifNonEmpty(this.min), ifNonEmpty(this.max), ifNonEmpty(this.step));
389
389
  const defaultLayout = html(_t4 || (_t4 = _2` ${0} ${0} <div class="${0}--number__controls"> ${0} ${0} </div> `), this.invalid ? invalidIcon : null, input, prefix, incrementButton, decrementButton);
390
390
  const mobileLayout = html(_t5 || (_t5 = _2` ${0} ${0} ${0} `), decrementButton, input, incrementButton);
391
391
  return html(_t6 || (_t6 = _2` <div class="${0}" ?data-invalid="${0}"> <label class="${0}" for="input"> <slot name="label-text"> ${0} </slot> </label> <div class="${0}--number__input-wrapper"> ${0} </div> <div class="${0}"> <slot name="helper-text"> ${0} </slot> </div> <div class="${0}--form-requirement" ?hidden="${0}"> <slot name="validity-message"> ${0} </slot> </div> <div class="${0}--form-requirement" ?hidden="${0}"> <slot name="validity-message-max"> ${0} </slot> </div> <div class="${0}--form-requirement" ?hidden="${0}"> <slot name="validity-message-min"> ${0} </slot> </div> </div> `), wrapperClasses, this.invalid, labelClasses, this.labelText, prefix, this.mobile ? mobileLayout : defaultLayout, helperTextClasses, this.helperText, prefix, !isGenericallyInvalid(), this.validityMessage, prefix, validity !== NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM, this.validityMessageMax, prefix, validity !== NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM, this.validityMessageMin);
@@ -1 +1 @@
1
- {"version":3,"file":"number-input.js","names":["html","property","query","classMap","settings","WarningFilled16","CaretUp16","CaretDown16","ifNonEmpty","NUMBER_INPUT_COLOR_SCHEME","NUMBER_INPUT_VALIDATION_STATUS","styles","BXInput","INPUT_SIZE","carbonElement","customElement","prefix","BXNumberInput","_decorate","_initialize","_BXInput","constructor","args","F","d","kind","key","value","_handleInput","event","target","dispatchEvent","CustomEvent","eventInput","bubbles","composed","cancelable","detail","_get","_getPrototypeOf","prototype","call","_handleUserInitiatedStepDown","_","_input","input","stepDown","_handleUserInitiatedStepUp","stepUp","decorators","_testValidity","_this$_input","_this$_input2","valueAsNumber","Number","max","EXCEEDED_MAXIMUM","min","EXCEEDED_MINIMUM","_getValidityMessage","state","Object","values","includes","stateMessageMap","validityMessageMax","validityMessageMin","attribute","reflect","REGULAR","_min","toString","oldValue","requestUpdate","_max","step","_step","type","Boolean","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","exec","navigator","userAgent","render","handleInput","handleUserInitiatedStepDown","handleUserInitiatedStepUp","invalidIcon","class","validity","isGenericallyInvalid","invalid","wrapperClasses","colorScheme","mobile","size","labelClasses","disabled","helperTextClasses","incrementButton","_t","_2","incrementButtonAssistiveText","decrementButton","_t2","decrementButtonAssistiveText","_t3","autocomplete","autofocus","name","pattern","placeholder","readonly","required","_value","defaultLayout","_t4","mobileLayout","_t5","_t6","labelText","helperText","validityMessage","static","default"],"sources":["components/number-input/number-input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, query } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport CaretUp16 from '@carbon/icons/lib/caret--up/16';\nimport CaretDown16 from '@carbon/icons/lib/caret--down/16';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport {\n NUMBER_INPUT_COLOR_SCHEME,\n NUMBER_INPUT_VALIDATION_STATUS,\n} from './defs';\nimport styles from './number-input.scss';\nimport BXInput, { INPUT_SIZE } from '../input/input';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { NUMBER_INPUT_COLOR_SCHEME, NUMBER_INPUT_VALIDATION_STATUS };\n\nconst { prefix } = settings;\n\n/**\n * Number input.\n *\n * @element bx-number-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-number-input`)\nexport default class BXNumberInput extends BXInput {\n /**\n * Handles `input` event on the `<input>` in the shadow DOM.\n */\n protected _handleInput(event: Event) {\n const { target } = event;\n const { value } = target as HTMLInputElement;\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof BXNumberInput).eventInput, {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n value,\n },\n })\n );\n super._handleInput(event);\n }\n\n /**\n * Handles `click` event on the up button in the shadow DOM.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected _handleUserInitiatedStepDown(_: Event) {\n const { _input: input } = this;\n this.stepDown();\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof BXNumberInput).eventInput, {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n value: input.value,\n },\n })\n );\n }\n\n /**\n * Handles `click` event on the down button in the shadow DOM.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected _handleUserInitiatedStepUp(_: Event) {\n const { _input: input } = this;\n this.stepUp();\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof BXNumberInput).eventInput, {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n value: input.value,\n },\n })\n );\n }\n\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n _testValidity() {\n if (this._input?.valueAsNumber > Number(this.max)) {\n return NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM;\n }\n if (this._input?.valueAsNumber < Number(this.min)) {\n return NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM;\n }\n return super._testValidity();\n }\n\n _getValidityMessage(state: string) {\n if (\n Object.values(NUMBER_INPUT_VALIDATION_STATUS).includes(\n state as NUMBER_INPUT_VALIDATION_STATUS\n )\n ) {\n const stateMessageMap = {\n [NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM]:\n this.validityMessageMax,\n [NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM]:\n this.validityMessageMin,\n };\n return stateMessageMap[state];\n }\n return super._getValidityMessage(state);\n }\n\n protected _min = '';\n\n protected _max = '';\n\n protected _step = '1';\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = NUMBER_INPUT_COLOR_SCHEME.REGULAR;\n\n /**\n * The minimum value allowed in the input\n */\n @property({ reflect: true })\n get min() {\n return this._min.toString();\n }\n\n set min(value) {\n const oldValue = this.min;\n this._min = value;\n this.requestUpdate('min', oldValue);\n }\n\n /**\n * The maximum value allowed in the input\n */\n @property({ reflect: true })\n get max() {\n return this._max.toString();\n }\n\n set max(value) {\n const oldValue = this.max;\n this._max = value;\n this.requestUpdate('max', oldValue);\n }\n\n /**\n * The amount the value should increase or decrease by\n */\n @property({ reflect: true })\n get step() {\n return this._step.toString();\n }\n\n set step(value) {\n const oldValue = this.step;\n this._step = value;\n this.requestUpdate('step', oldValue);\n }\n\n /**\n * Set to `true` to enable the mobile variant of the number input\n */\n @property({ type: Boolean, reflect: true })\n mobile = false;\n\n /**\n * Aria text for the button that increments the value\n */\n @property({ attribute: 'increment-button-assistive-text' })\n incrementButtonAssistiveText = 'increase number input';\n\n /**\n * Aria text for the button that decrements the value\n */\n @property({ attribute: 'decrement-button-assistive-text' })\n decrementButtonAssistiveText = 'decrease number input';\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.REGULAR;\n\n /**\n * The validity message shown when the value is greater than the maximum\n *\n * Also available via the `validity-message-max` slot\n */\n @property({ attribute: 'validity-message-max' })\n validityMessageMax = '';\n\n /**\n * The validity message shown when the value is less than the minimum\n *\n * Also available via the `validity-message-min` slot\n */\n @property({ attribute: 'validity-message-min' })\n validityMessageMin = '';\n\n /**\n * Handles incrementing the value in the input\n */\n stepUp() {\n this._input.stepUp();\n }\n\n /**\n * Handles decrementing the value in the input\n */\n stepDown() {\n this._input.stepDown();\n }\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n render() {\n const {\n _handleInput: handleInput,\n _handleUserInitiatedStepDown: handleUserInitiatedStepDown,\n _handleUserInitiatedStepUp: handleUserInitiatedStepUp,\n } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--number__invalid`,\n });\n\n const validity = this._testValidity();\n\n const isGenericallyInvalid = () =>\n this.invalid &&\n validity !== NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM &&\n validity !== NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM;\n\n const wrapperClasses = classMap({\n [`${prefix}--number`]: true,\n [`${prefix}--number--${this.colorScheme}`]: this.colorScheme,\n [`${prefix}--number--mobile`]: this.mobile,\n [`${prefix}--number--${this.size}`]: this.size,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const incrementButton = html`\n <button\n class=\"${prefix}--number__control-btn up-icon\"\n aria-label=\"${this.incrementButtonAssistiveText}\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n type=\"button\"\n ?disabled=${this.disabled}\n @click=${handleUserInitiatedStepUp}>\n ${CaretUp16()}\n </button>\n `;\n const decrementButton = html`\n <button\n class=\"${prefix}--number__control-btn down-icon\"\n aria-label=\"${this.decrementButtonAssistiveText}\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n type=\"button\"\n ?disabled=${this.disabled}\n @click=${handleUserInitiatedStepDown}>\n ${CaretDown16()}\n </button>\n `;\n\n const input = html`\n <input\n ?autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n type=\"number\"\n .value=\"${this._value}\"\n @input=\"${handleInput}\"\n min=\"${ifNonEmpty(this.min)}\"\n max=\"${ifNonEmpty(this.max)}\"\n step=\"${ifNonEmpty(this.step)}\"\n role=\"alert\"\n aria-atomic=\"true\" />\n `;\n\n const defaultLayout = html`\n ${this.invalid ? invalidIcon : null} ${input}\n <div class=\"${prefix}--number__controls\">\n ${incrementButton} ${decrementButton}\n </div>\n `;\n\n const mobileLayout = html` ${decrementButton} ${input} ${incrementButton} `;\n\n return html`\n <div class=\"${wrapperClasses}\" ?data-invalid=${this.invalid}>\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.labelText} </slot>\n </label>\n <div class=\"${prefix}--number__input-wrapper\">\n ${this.mobile ? mobileLayout : defaultLayout}\n </div>\n <div class=\"${helperTextClasses}\">\n <slot name=\"helper-text\"> ${this.helperText} </slot>\n </div>\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!isGenericallyInvalid()}\">\n <slot name=\"validity-message\"> ${this.validityMessage} </slot>\n </div>\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${validity !==\n NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM}\">\n <slot name=\"validity-message-max\"> ${this.validityMessageMax} </slot>\n </div>\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${validity !==\n NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM}\">\n <slot name=\"validity-message-min\"> ${this.validityMessageMin} </slot>\n </div>\n </div>\n `;\n }\n\n /**\n * The name of the custom event fired after the value is changed upon a user gesture.\n */\n static get eventInput() {\n return `${prefix}-number-input`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"],"mappings":";;;;;;;;;;AAAA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AA,EAGA,SAAAM,WAAA,EAAwB;QACtB,OAAQ,GAAEjB,MAAO,eAAc;MACjC;IAAC;MAAAS,IAAA;MAAAsG,MAAA;MAAArG,GAAA;MAAAC,MAAA;QAAA,OAEehB,MAAM;MAAA;IAAA;EAAA;AAAA,GAlVmBC,OAAO;AAAA,SAA7BK,aAAa,IAAA+G,OAAA"}
1
+ {"version":3,"file":"number-input.js","names":["html","property","query","classMap","settings","WarningFilled16","CaretUp16","CaretDown16","ifNonEmpty","NUMBER_INPUT_COLOR_SCHEME","NUMBER_INPUT_VALIDATION_STATUS","styles","BXInput","INPUT_SIZE","carbonElement","customElement","prefix","BXNumberInput","_decorate","_initialize","_BXInput","constructor","args","F","d","kind","key","value","_handleInput","event","target","dispatchEvent","CustomEvent","eventInput","bubbles","composed","cancelable","detail","_get","_getPrototypeOf","prototype","call","_handleUserInitiatedStepDown","_","_input","input","stepDown","_handleUserInitiatedStepUp","stepUp","decorators","_testValidity","_this$_input","_this$_input2","valueAsNumber","Number","max","EXCEEDED_MAXIMUM","min","EXCEEDED_MINIMUM","_getValidityMessage","state","Object","values","includes","stateMessageMap","validityMessageMax","validityMessageMin","attribute","reflect","REGULAR","_min","toString","oldValue","requestUpdate","_max","step","_step","type","Boolean","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","exec","navigator","userAgent","render","handleInput","handleUserInitiatedStepDown","handleUserInitiatedStepUp","invalidIcon","class","validity","isGenericallyInvalid","invalid","wrapperClasses","colorScheme","mobile","size","labelClasses","disabled","helperTextClasses","incrementButton","_t","_2","incrementButtonAssistiveText","decrementButton","_t2","decrementButtonAssistiveText","_t3","autocomplete","autofocus","name","pattern","placeholder","readonly","required","defaultLayout","_t4","mobileLayout","_t5","_t6","labelText","helperText","validityMessage","static","default"],"sources":["components/number-input/number-input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, query } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport CaretUp16 from '@carbon/icons/lib/caret--up/16';\nimport CaretDown16 from '@carbon/icons/lib/caret--down/16';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport {\n NUMBER_INPUT_COLOR_SCHEME,\n NUMBER_INPUT_VALIDATION_STATUS,\n} from './defs';\nimport styles from './number-input.scss';\nimport BXInput, { INPUT_SIZE } from '../input/input';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { NUMBER_INPUT_COLOR_SCHEME, NUMBER_INPUT_VALIDATION_STATUS };\n\nconst { prefix } = settings;\n\n/**\n * Number input.\n *\n * @element bx-number-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-number-input`)\nexport default class BXNumberInput extends BXInput {\n /**\n * Handles `input` event on the `<input>` in the shadow DOM.\n */\n protected _handleInput(event: Event) {\n const { target } = event;\n const { value } = target as HTMLInputElement;\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof BXNumberInput).eventInput, {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n value,\n },\n })\n );\n super._handleInput(event);\n }\n\n /**\n * Handles `click` event on the up button in the shadow DOM.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected _handleUserInitiatedStepDown(_: Event) {\n const { _input: input } = this;\n this.stepDown();\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof BXNumberInput).eventInput, {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n value: input.value,\n },\n })\n );\n }\n\n /**\n * Handles `click` event on the down button in the shadow DOM.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected _handleUserInitiatedStepUp(_: Event) {\n const { _input: input } = this;\n this.stepUp();\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof BXNumberInput).eventInput, {\n bubbles: true,\n composed: true,\n cancelable: false,\n detail: {\n value: input.value,\n },\n })\n );\n }\n\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n _testValidity() {\n if (this._input?.valueAsNumber > Number(this.max)) {\n return NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM;\n }\n if (this._input?.valueAsNumber < Number(this.min)) {\n return NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM;\n }\n return super._testValidity();\n }\n\n _getValidityMessage(state: string) {\n if (\n Object.values(NUMBER_INPUT_VALIDATION_STATUS).includes(\n state as NUMBER_INPUT_VALIDATION_STATUS\n )\n ) {\n const stateMessageMap = {\n [NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM]:\n this.validityMessageMax,\n [NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM]:\n this.validityMessageMin,\n };\n return stateMessageMap[state];\n }\n return super._getValidityMessage(state);\n }\n\n protected _min = '';\n\n protected _max = '';\n\n protected _step = '1';\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = NUMBER_INPUT_COLOR_SCHEME.REGULAR;\n\n /**\n * The minimum value allowed in the input\n */\n @property({ reflect: true })\n get min() {\n return this._min.toString();\n }\n\n set min(value) {\n const oldValue = this.min;\n this._min = value;\n this.requestUpdate('min', oldValue);\n }\n\n /**\n * The maximum value allowed in the input\n */\n @property({ reflect: true })\n get max() {\n return this._max.toString();\n }\n\n set max(value) {\n const oldValue = this.max;\n this._max = value;\n this.requestUpdate('max', oldValue);\n }\n\n /**\n * The amount the value should increase or decrease by\n */\n @property({ reflect: true })\n get step() {\n return this._step.toString();\n }\n\n set step(value) {\n const oldValue = this.step;\n this._step = value;\n this.requestUpdate('step', oldValue);\n }\n\n /**\n * Set to `true` to enable the mobile variant of the number input\n */\n @property({ type: Boolean, reflect: true })\n mobile = false;\n\n /**\n * Aria text for the button that increments the value\n */\n @property({ attribute: 'increment-button-assistive-text' })\n incrementButtonAssistiveText = 'increase number input';\n\n /**\n * Aria text for the button that decrements the value\n */\n @property({ attribute: 'decrement-button-assistive-text' })\n decrementButtonAssistiveText = 'decrease number input';\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.REGULAR;\n\n /**\n * The validity message shown when the value is greater than the maximum\n *\n * Also available via the `validity-message-max` slot\n */\n @property({ attribute: 'validity-message-max' })\n validityMessageMax = '';\n\n /**\n * The validity message shown when the value is less than the minimum\n *\n * Also available via the `validity-message-min` slot\n */\n @property({ attribute: 'validity-message-min' })\n validityMessageMin = '';\n\n /**\n * Handles incrementing the value in the input\n */\n stepUp() {\n this._input.stepUp();\n }\n\n /**\n * Handles decrementing the value in the input\n */\n stepDown() {\n this._input.stepDown();\n }\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n render() {\n const {\n _handleInput: handleInput,\n _handleUserInitiatedStepDown: handleUserInitiatedStepDown,\n _handleUserInitiatedStepUp: handleUserInitiatedStepUp,\n } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--number__invalid`,\n });\n\n const validity = this._testValidity();\n\n const isGenericallyInvalid = () =>\n this.invalid &&\n validity !== NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM &&\n validity !== NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM;\n\n const wrapperClasses = classMap({\n [`${prefix}--number`]: true,\n [`${prefix}--number--${this.colorScheme}`]: this.colorScheme,\n [`${prefix}--number--mobile`]: this.mobile,\n [`${prefix}--number--${this.size}`]: this.size,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const incrementButton = html`\n <button\n class=\"${prefix}--number__control-btn up-icon\"\n aria-label=\"${this.incrementButtonAssistiveText}\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n type=\"button\"\n ?disabled=${this.disabled}\n @click=${handleUserInitiatedStepUp}>\n ${CaretUp16()}\n </button>\n `;\n const decrementButton = html`\n <button\n class=\"${prefix}--number__control-btn down-icon\"\n aria-label=\"${this.decrementButtonAssistiveText}\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n type=\"button\"\n ?disabled=${this.disabled}\n @click=${handleUserInitiatedStepDown}>\n ${CaretDown16()}\n </button>\n `;\n\n const input = html`\n <input\n ?autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n type=\"number\"\n .value=\"${this.value}\"\n @input=\"${handleInput}\"\n min=\"${ifNonEmpty(this.min)}\"\n max=\"${ifNonEmpty(this.max)}\"\n step=\"${ifNonEmpty(this.step)}\"\n role=\"alert\"\n aria-atomic=\"true\" />\n `;\n\n const defaultLayout = html`\n ${this.invalid ? invalidIcon : null} ${input}\n <div class=\"${prefix}--number__controls\">\n ${incrementButton} ${decrementButton}\n </div>\n `;\n\n const mobileLayout = html` ${decrementButton} ${input} ${incrementButton} `;\n\n return html`\n <div class=\"${wrapperClasses}\" ?data-invalid=${this.invalid}>\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.labelText} </slot>\n </label>\n <div class=\"${prefix}--number__input-wrapper\">\n ${this.mobile ? mobileLayout : defaultLayout}\n </div>\n <div class=\"${helperTextClasses}\">\n <slot name=\"helper-text\"> ${this.helperText} </slot>\n </div>\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${!isGenericallyInvalid()}\">\n <slot name=\"validity-message\"> ${this.validityMessage} </slot>\n </div>\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${validity !==\n NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MAXIMUM}\">\n <slot name=\"validity-message-max\"> ${this.validityMessageMax} </slot>\n </div>\n <div\n class=\"${prefix}--form-requirement\"\n ?hidden=\"${validity !==\n NUMBER_INPUT_VALIDATION_STATUS.EXCEEDED_MINIMUM}\">\n <slot name=\"validity-message-min\"> ${this.validityMessageMin} </slot>\n </div>\n </div>\n `;\n }\n\n /**\n * The name of the custom event fired after the value is changed upon a user gesture.\n */\n static get eventInput() {\n return `${prefix}-number-input`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,aAAa;AACnD,SAASC,QAAQ,QAAQ,+BAA+B;AACxD,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,eAAe,MAAM,gCAAsC;AAClE,OAAOC,SAAS,MAAM,0BAAgC;AACtD,OAAOC,WAAW,MAAM,4BAAkC;AAC1D,OAAOC,UAAU,MAAM,uCAAuC;AAC9D,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,QAAQ;AACf,OAAOC,MAAM,MAAM,yBAAqB;AACxC,OAAOC,OAAO,IAAIC,UAAU,QAAQ,gBAAgB;AACpD,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,SAASN,yBAAyB,EAAEC,8BAA8B;AAElE,MAAM;EAAEM;AAAO,CAAC,GAAGZ,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IASqBa,aAAa,GAAAC,SAAA,EADjCH,aAAa,CAAE,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OvG,IAAI,CAAA0H,GAAA,KAAAA,GAAA,GAAAjB,EAAA,yjBACKT,cAAc,EAAmB,IAAI,CAACD,OAAO,EACzCK,YAAY,EACC,IAAI,CAACuB,SAAS,EAE7B3G,MAAM,EAChB,IAAI,CAACkF,MAAM,GAAGsB,YAAY,GAAGF,aAAa,EAEhChB,iBAAiB,EACD,IAAI,CAACsB,UAAU,EAGlC5G,MAAM,EACJ,CAAC8E,oBAAoB,CAAC,CAAC,EACD,IAAI,CAAC+B,eAAe,EAG5C7G,MAAM,EACJ6E,QAAQ,KACnBnF,8BAA8B,CAAC8C,gBAAgB,EACV,IAAI,CAACS,kBAAkB,EAGnDjD,MAAM,EACJ6E,QAAQ,KACnBnF,8BAA8B,CAACgD,gBAAgB,EACV,IAAI,CAACQ,kBAAkB;MAIpE;;MAEA;AACF;AACA;IAFE;MAAAzC,IAAA;MAAAqG,MAAA;MAAApG,GAAA;MAAAC,KAAA,EAGA,SAAAM,WAAA,EAAwB;QACtB,OAAQ,GAAEjB,MAAO,eAAc;MACjC;IAAC;MAAAS,IAAA;MAAAqG,MAAA;MAAApG,GAAA;MAAAC,MAAA;QAAA,OAEehB,MAAM;MAAA;IAAA;EAAA;AAAA,GAlVmBC,OAAO;AAAA,SAA7BK,aAAa,IAAA8G,OAAA"}
@@ -130,7 +130,7 @@ let BXPagesSelect = _decorate([customElement(`${prefix}-pages-select`)], functio
130
130
  } = this;
131
131
  // `<option ?selected="${index === value}">` is a workaround for:
132
132
  // https://github.com/Polymer/lit-html/issues/1052
133
- return html(_t || (_t = _` <div class="${0}--select__page-number"> <label for="select" class="${0}--label ${0}--visually-hidden"> ${0} </label> <select class="${0}--select-input" .value="${0}" @change="${0}"> ${0} </select> ${0} </div> <span class="${0}--pagination__text"> ${0} </span> `), prefix, prefix, prefix, formatLabelText({
133
+ return html(_t || (_t = _` <div class="${0}--select__page-number"> <label for="select-page" class="${0}--label ${0}--visually-hidden"> ${0} </label> <select class="${0}--select-input" .value="${0}" id="select-page" @change="${0}"> ${0} </select> ${0} </div> <span class="${0}--pagination__text"> ${0} </span> `), prefix, prefix, prefix, formatLabelText({
134
134
  count: total
135
135
  }), prefix, value, handleChange, Array.from(new Array(total)).map((_item, index) => html(_t2 || (_t2 = _` <option value="${0}" ?selected="${0}"> ${0} </option> `), index, index === value, index + 1)), ChevronDown16({
136
136
  class: `${prefix}--select__arrow`
@@ -1 +1 @@
1
- {"version":3,"file":"pages-select.js","names":["html","property","LitElement","ChevronDown16","settings","FocusMixin","styles","carbonElement","customElement","prefix","BXPagesSelect","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","key","value","_handleChange","target","Number","dispatchEvent","CustomEvent","eventChange","bubbles","composed","detail","decorators","attribute","count","type","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","exec","navigator","userAgent","render","formatLabelText","formatSupplementalText","total","handleChange","_t","_","Array","from","map","_item","index","_t2","class","static"],"sources":["components/pagination/pages-select.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement } from 'lit-element';\nimport ChevronDown16 from '@carbon/icons/lib/chevron--down/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './pagination.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * The select box for the current page.\n *\n * @element bx-pages-select\n * @fires bx-pages-select-changed - The custom event fired after the page is changed.\n */\n@customElement(`${prefix}-pages-select`)\nclass BXPagesSelect extends FocusMixin(LitElement) {\n /**\n * Handles `change` event on the `<select>` to select page size.\n */\n private _handleChange({ target }: Event) {\n const value = Number((target as HTMLSelectElement).value);\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof BXPagesSelect).eventChange, {\n bubbles: true,\n composed: true,\n detail: {\n value,\n },\n })\n );\n this.value = value;\n }\n\n /**\n * The formatter for the assistive text for screen readers to announce.\n * Should be changed upon the locale the UI is rendered with.\n */\n @property({ attribute: false })\n formatLabelText = ({ count }) =>\n `Page number, of ${count} page${count <= 1 ? '' : 's'}`;\n\n /**\n * The formatter for the text next to the select box. Should be changed upon the locale the UI is rendered with.\n */\n @property({ attribute: false })\n formatSupplementalText = ({ count }) =>\n `of ${count} page${count <= 1 ? '' : 's'}`;\n\n /**\n * The number of total pages.\n */\n @property({ type: Number })\n total!: number;\n\n /**\n * The value, working as the current page, index that starts with zero.\n */\n @property({ type: Number })\n value!: number;\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n render() {\n const {\n formatLabelText,\n formatSupplementalText,\n total,\n value,\n _handleChange: handleChange,\n } = this;\n // `<option ?selected=\"${index === value}\">` is a workaround for:\n // https://github.com/Polymer/lit-html/issues/1052\n return html`\n <div class=\"${prefix}--select__page-number\">\n <label for=\"select\" class=\"${prefix}--label ${prefix}--visually-hidden\">\n ${formatLabelText({ count: total })}\n </label>\n <select\n class=\"${prefix}--select-input\"\n .value=\"${value}\"\n @change=\"${handleChange}\">\n ${Array.from(new Array(total)).map(\n (_item, index) =>\n html`\n <option value=${index} ?selected=\"${index === value}\">\n ${index + 1}\n </option>\n `\n )}\n </select>\n ${ChevronDown16({ class: `${prefix}--select__arrow` })}\n </div>\n <span class=\"${prefix}--pagination__text\">\n ${formatSupplementalText({ count: total })}\n </span>\n `;\n }\n\n /**\n * The name of the custom event fired after the page is changed.\n */\n static get eventChange() {\n return `${prefix}-pages-select-changed`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXPagesSelect;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,aAAa;AACxD,OA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Y,EACrBG,KAAK,CAACC,IAAI,CAAC,IAAID,KAAK,CAACJ,KAAK,CAAC,CAAC,CAACM,GAAG,CAChC,CAACC,KAAK,EAAEC,KAAK,KACXrD,IAAI,CAAAsD,GAAA,KAAAA,GAAA,GAAAN,CAAA,4DACcK,KAAK,EAAeA,KAAK,KAAKjC,KAAK,EAC/CiC,KAAK,GAAG,CAAC,CAGnB,CAAC,EAEDlD,aAAa,CAAC;UAAEoD,KAAK,EAAG,GAAE9C,MAAO;QAAiB,CAAC,CAAC,EAEzCA,MAAM,EACjBmC,sBAAsB,CAAC;UAAEZ,KAAK,EAAEa;QAAM,CAAC,CAAC;MAGhD;;MAEA;AACF;AACA;IAFE;MAAA3B,IAAA;MAAAsC,MAAA;MAAArC,GAAA;MAAAC,KAAA,EAGA,SAAAM,YAAA,EAAyB;QACvB,OAAQ,GAAEjB,MAAO,uBAAsB;MACzC;IAAC;MAAAS,IAAA;MAAAsC,MAAA;MAAArC,GAAA;MAAAC,MAAA;QAAA,OAEed,MAAM;MAAA;IAAA;EAAA;AAAA,GAjGID,UAAU,CAACH,UAAU,CAAC;AAoGlD,eAAeQ,aAAa"}
1
+ {"version":3,"file":"pages-select.js","names":["html","property","LitElement","ChevronDown16","settings","FocusMixin","styles","carbonElement","customElement","prefix","BXPagesSelect","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","key","value","_handleChange","target","Number","dispatchEvent","CustomEvent","eventChange","bubbles","composed","detail","decorators","attribute","count","type","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","exec","navigator","userAgent","render","formatLabelText","formatSupplementalText","total","handleChange","_t","_","Array","from","map","_item","index","_t2","class","static"],"sources":["components/pagination/pages-select.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement } from 'lit-element';\nimport ChevronDown16 from '@carbon/icons/lib/chevron--down/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './pagination.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * The select box for the current page.\n *\n * @element bx-pages-select\n * @fires bx-pages-select-changed - The custom event fired after the page is changed.\n */\n@customElement(`${prefix}-pages-select`)\nclass BXPagesSelect extends FocusMixin(LitElement) {\n /**\n * Handles `change` event on the `<select>` to select page size.\n */\n private _handleChange({ target }: Event) {\n const value = Number((target as HTMLSelectElement).value);\n this.dispatchEvent(\n new CustomEvent((this.constructor as typeof BXPagesSelect).eventChange, {\n bubbles: true,\n composed: true,\n detail: {\n value,\n },\n })\n );\n this.value = value;\n }\n\n /**\n * The formatter for the assistive text for screen readers to announce.\n * Should be changed upon the locale the UI is rendered with.\n */\n @property({ attribute: false })\n formatLabelText = ({ count }) =>\n `Page number, of ${count} page${count <= 1 ? '' : 's'}`;\n\n /**\n * The formatter for the text next to the select box. Should be changed upon the locale the UI is rendered with.\n */\n @property({ attribute: false })\n formatSupplementalText = ({ count }) =>\n `of ${count} page${count <= 1 ? '' : 's'}`;\n\n /**\n * The number of total pages.\n */\n @property({ type: Number })\n total!: number;\n\n /**\n * The value, working as the current page, index that starts with zero.\n */\n @property({ type: Number })\n value!: number;\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n render() {\n const {\n formatLabelText,\n formatSupplementalText,\n total,\n value,\n _handleChange: handleChange,\n } = this;\n // `<option ?selected=\"${index === value}\">` is a workaround for:\n // https://github.com/Polymer/lit-html/issues/1052\n return html`\n <div class=\"${prefix}--select__page-number\">\n <label\n for=\"select-page\"\n class=\"${prefix}--label ${prefix}--visually-hidden\">\n ${formatLabelText({ count: total })}\n </label>\n <select\n class=\"${prefix}--select-input\"\n .value=\"${value}\"\n id=\"select-page\"\n @change=\"${handleChange}\">\n ${Array.from(new Array(total)).map(\n (_item, index) =>\n html`\n <option value=${index} ?selected=\"${index === value}\">\n ${index + 1}\n </option>\n `\n )}\n </select>\n ${ChevronDown16({ class: `${prefix}--select__arrow` })}\n </div>\n <span class=\"${prefix}--pagination__text\">\n ${formatSupplementalText({ count: total })}\n </span>\n `;\n }\n\n /**\n * The name of the custom event fired after the page is changed.\n */\n static get eventChange() {\n return `${prefix}-pages-select-changed`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXPagesSelect;\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,aAAa;AACxD,OAAOC,aAAa,MAAM,8BAAoC;AAC9D,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,UAAU,MAAM,4BAA4B;AACnD,OAAOC,MAAM,MAAM,uBAAmB;AACtC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,MAAM;EAAEC;AAAO,CAAC,GAAGL,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AALA,IAOMM,aAAa,GAAAC,SAAA,EADlBH,aAAa,CAAE,GAAEC,MAAO,eAAc,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAAxC,MACMH,aAAa,SAAAG,WAAA,CAAgC;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAqGnD;EAAC;IAAAI,CAAA,EArGKN,aAAa;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,KAAA;MACjB;AACF;AACA;MACE,SAAAC,cAAsB;QAAEC;MAAc,CAAC,EAAE;QACvC,MAAMF,KAAK,GAAGG,MAAM,CAAED,MAAM,CAAuBF,KAAK,CAAC;QACzD,IAAI,CAACI,aAAa,CAChB,IAAIC,WAAW,CAAE,IAAI,CAACX,WAAW,C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
1
  {
2
2
  "name": "@carbon/web-components",
3
- "version": "1.36.0",
3
+ "version": "1.36.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -211,5 +211,5 @@
211
211
  "zone.js": "~0.14.0"
212
212
  },
213
213
  "typings": "es/index.d.ts",
214
- "gitHead": "7a1976faf107f68edaa0e801120f8e44a5d3d7c8"
214
+ "gitHead": "72e59a859a80d5d88a35df12191941131d8cc1b6"
215
215
  }
@@ -1,65 +0,0 @@
1
- /**
2
- * @license
3
- *
4
- * Copyright IBM Corp. 2019, 2020
5
- *
6
- * This source code is licensed under the Apache-2.0 license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
9
- /**
10
- * @license
11
- *
12
- * This bundle contains the following third-party dependencies:
13
- *
14
- * lit-html:
15
- *
16
- * @license
17
- * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.
18
- * This code may only be used under the BSD style license found at
19
- * http://polymer.github.io/LICENSE.txt
20
- * The complete set of authors may be found at
21
- * http://polymer.github.io/AUTHORS.txt
22
- * The complete set of contributors may be found at
23
- * http://polymer.github.io/CONTRIBUTORS.txt
24
- * Code distributed by Google as part of the polymer project is also
25
- * subject to an additional IP rights grant found at
26
- * http://polymer.github.io/PATENTS.txt
27
- *
28
- * lit-element:
29
- *
30
- * @license
31
- * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
32
- * This code may only be used under the BSD style license found at
33
- * http://polymer.github.io/LICENSE.txt
34
- * The complete set of authors may be found at
35
- * http://polymer.github.io/AUTHORS.txt
36
- * The complete set of contributors may be found at
37
- * http://polymer.github.io/CONTRIBUTORS.txt
38
- * Code distributed by Google as part of the polymer project is also
39
- * subject to an additional IP rights grant found at
40
- * http://polymer.github.io/PATENTS.txt
41
- *
42
- * flatpickr:
43
- *
44
- *****************************************************************************
45
- Copyright (c) Microsoft Corporation.
46
-
47
- Permission to use, copy, modify, and/or distribute this software for any
48
- purpose with or without fee is hereby granted.
49
-
50
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
51
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
52
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
53
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
54
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
55
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
56
- PERFORMANCE OF THIS SOFTWARE.
57
- *****************************************************************************
58
- *
59
- * Also refer to the following links for the license of other third-party dependencies:
60
- *
61
- * https://www.npmjs.com/package/@carbon/icons
62
- * https://www.npmjs.com/package/lodash-es
63
- */
64
-
65
- import{c as e,_ as t,h as i,s as r,L as o}from"./settings-898bd7b0.js";import{c as a}from"./class-map-bd61e03f.js";import{i as n}from"./if-non-null-63ecd660.js";import{F as l}from"./focus-1800056c.js";import{F as d}from"./form-80943f8c.js";import{c}from"./carbon-element-18175602.js";import{q as b,p as s}from"./decorators-56213c84.js";var x=e(['a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}button,input,select,textarea{border-radius:0;font-family:inherit}input[type=text]::-ms-clear{display:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}body{line-height:1}sup{vertical-align:super}sub{vertical-align:sub}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:""}table{border-collapse:collapse;border-spacing:0}*{box-sizing:border-box}button{margin:0}html{font-size:100%}body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:IBM Plex Sans,Helvetica Neue,Arial,sans-serif;font-weight:400;text-rendering:optimizeLegibility}code{font-family:IBM Plex Mono,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace}strong{font-weight:600}@media screen and (-ms-high-contrast:active){svg{fill:ButtonText}}h1{font-size:var(--cds-productive-heading-06-font-size,2.625rem);font-weight:var(--cds-productive-heading-06-font-weight,300);letter-spacing:var(--cds-productive-heading-06-letter-spacing,0);line-height:var(--cds-productive-heading-06-line-height,1.199)}h2{font-size:var(--cds-productive-heading-05-font-size,2rem);font-weight:var(--cds-productive-heading-05-font-weight,300);letter-spacing:var(--cds-productive-heading-05-letter-spacing,0);line-height:var(--cds-productive-heading-05-line-height,1.25)}h3{font-size:var(--cds-productive-heading-04-font-size,1.75rem);font-weight:var(--cds-productive-heading-04-font-weight,400);letter-spacing:var(--cds-productive-heading-04-letter-spacing,0);line-height:var(--cds-productive-heading-04-line-height,1.28572)}h4{font-size:var(--cds-productive-heading-03-font-size,1.25rem);font-weight:var(--cds-productive-heading-03-font-weight,400);letter-spacing:var(--cds-productive-heading-03-letter-spacing,0);line-height:var(--cds-productive-heading-03-line-height,1.4)}h5{font-size:var(--cds-productive-heading-02-font-size,1rem);font-weight:var(--cds-productive-heading-02-font-weight,600);letter-spacing:var(--cds-productive-heading-02-letter-spacing,0);line-height:var(--cds-productive-heading-02-line-height,1.375)}h6{font-size:var(--cds-productive-heading-01-font-size,.875rem);font-weight:var(--cds-productive-heading-01-font-weight,600);letter-spacing:var(--cds-productive-heading-01-letter-spacing,.16px);line-height:var(--cds-productive-heading-01-line-height,1.28572)}p{font-size:var(--cds-body-long-02-font-size,1rem);font-weight:var(--cds-body-long-02-font-weight,400);letter-spacing:var(--cds-body-long-02-letter-spacing,0);line-height:var(--cds-body-long-02-line-height,1.5)}a{color:#0f62fe}em{font-style:italic}.bx--assistive-text,.bx--visually-hidden{clip:rect(0,0,0,0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;visibility:inherit;white-space:nowrap;width:1px}.bx--body{background-color:var(--cds-ui-background,#fff);border:0;box-sizing:border-box;color:var(--cds-text-01,#161616);font-family:inherit;font-size:100%;font-size:var(--cds-body-short-01-font-size,.875rem);font-weight:var(--cds-body-short-01-font-weight,400);letter-spacing:var(--cds-body-short-01-letter-spacing,.16px);line-height:var(--cds-body-short-01-line-height,1.28572);line-height:1;margin:0;padding:0;vertical-align:baseline}.bx--body *,.bx--body :after,.bx--body :before{box-sizing:inherit}@keyframes skeleton{0%{opacity:.3;transform:scaleX(0);transform-origin:left}20%{opacity:1;transform:scaleX(1);transform-origin:left}28%{transform:scaleX(1);transform-origin:right}51%{transform:scaleX(0);transform-origin:right}58%{transform:scaleX(0);transform-origin:right}82%{transform:scaleX(1);transform-origin:right}83%{transform:scaleX(1);transform-origin:left}96%{transform:scaleX(0);transform-origin:left}to{opacity:.3;transform:scaleX(0);transform-origin:left}}.bx--fieldset{border:0;box-sizing:border-box;font-family:inherit;font-size:100%;margin:0 0 2rem;padding:0;vertical-align:baseline}.bx--fieldset *,.bx--fieldset :after,.bx--fieldset :before{box-sizing:inherit}.bx--fieldset--no-margin{margin-bottom:0}.bx--form-item,:host(bx-checkbox){align-items:flex-start;display:flex;flex:1 1 auto;flex-direction:column;font-size:var(--cds-body-short-01-font-size,.875rem);font-weight:var(--cds-body-short-01-font-weight,400);letter-spacing:var(--cds-body-short-01-letter-spacing,.16px);line-height:var(--cds-body-short-01-line-height,1.28572)}.bx--label{border:0;box-sizing:border-box;color:var(--cds-text-02,#525252);display:inline-block;font-family:inherit;font-size:100%;font-size:var(--cds-label-01-font-size,.75rem);font-weight:var(--cds-label-01-font-weight,400);font-weight:400;letter-spacing:var(--cds-label-01-letter-spacing,.32px);line-height:var(--cds-label-01-line-height,1.33333);line-height:1rem;margin:0 0 .5rem;padding:0;vertical-align:baseline}.bx--label *,.bx--label :after,.bx--label :before{box-sizing:inherit}.bx--label .bx--tooltip__trigger{font-size:var(--cds-label-01-font-size,.75rem);font-weight:var(--cds-label-01-font-weight,400);letter-spacing:var(--cds-label-01-letter-spacing,.32px);line-height:var(--cds-label-01-line-height,1.33333)}.bx--label.bx--skeleton{background:var(--cds-skeleton-01,#e5e5e5);border:none;box-shadow:none;height:.875rem;padding:0;pointer-events:none;position:relative;width:4.6875rem}.bx--label.bx--skeleton:active,.bx--label.bx--skeleton:focus,.bx--label.bx--skeleton:hover{border:none;cursor:default;outline:none}.bx--label.bx--skeleton:before{animation:skeleton 3s ease-in-out infinite;background:var(--cds-skeleton-02,#c6c6c6);content:"";height:100%;left:0;position:absolute;top:0;width:100%;will-change:transform-origin,transform,opacity}@media (prefers-reduced-motion:reduce){.bx--label.bx--skeleton:before{animation:none}}input[type=number]{font-family:IBM Plex Mono,Menlo,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier,monospace}.bx--combo-box[data-invalid] .bx--text-input:not(:focus),.bx--list-box[data-invalid]:not(:focus),.bx--number[data-invalid] input[type=number]:not(:focus),.bx--select-input__wrapper[data-invalid] .bx--select-input:not(:focus),.bx--text-area__wrapper[data-invalid]>.bx--text-area--invalid:not(:focus),.bx--text-input__field-wrapper[data-invalid]>.bx--text-input--invalid:not(:focus),input[data-invalid]:not(:focus){outline:2px solid var(--cds-support-01,#da1e28);outline-offset:-2px}@media screen and (prefers-contrast){.bx--combo-box[data-invalid] .bx--text-input:not(:focus),.bx--list-box[data-invalid]:not(:focus),.bx--number[data-invalid] input[type=number]:not(:focus),.bx--select-input__wrapper[data-invalid] .bx--select-input:not(:focus),.bx--text-area__wrapper[data-invalid]>.bx--text-area--invalid:not(:focus),.bx--text-input__field-wrapper[data-invalid]>.bx--text-input--invalid:not(:focus),input[data-invalid]:not(:focus){outline-style:dotted}}.bx--date-picker-input__wrapper--invalid~.bx--form-requirement,.bx--date-picker-input__wrapper--warn~.bx--form-requirement,.bx--date-picker-input__wrapper~.bx--form-requirement,.bx--list-box--warning~.bx--form-requirement,.bx--list-box[data-invalid]~.bx--form-requirement,.bx--number[data-invalid] .bx--number__input-wrapper~.bx--form-requirement,.bx--number__input-wrapper--warning~.bx--form-requirement,.bx--select--warning .bx--select-input__wrapper~.bx--form-requirement,.bx--select-input__wrapper[data-invalid]~.bx--form-requirement,.bx--text-area__wrapper[data-invalid]~.bx--form-requirement,.bx--text-input__field-wrapper--warning>.bx--text-input~.bx--form-requirement,.bx--text-input__field-wrapper--warning~.bx--form-requirement,.bx--text-input__field-wrapper[data-invalid]~.bx--form-requirement,.bx--time-picker--invalid~.bx--form-requirement,.bx--time-picker[data-invalid]~.bx--form-requirement,input[data-invalid]~.bx--form-requirement{display:block;font-weight:400;max-height:12.5rem;overflow:visible}.bx--date-picker-input__wrapper--invalid~.bx--form-requirement,.bx--date-picker-input__wrapper~.bx--form-requirement,.bx--list-box[data-invalid]~.bx--form-requirement,.bx--number[data-invalid] .bx--number__input-wrapper~.bx--form-requirement,.bx--select-input__wrapper[data-invalid]~.bx--form-requirement,.bx--text-area__wrapper[data-invalid]~.bx--form-requirement,.bx--text-input__field-wrapper[data-invalid]~.bx--form-requirement,.bx--time-picker--invalid~.bx--form-requirement,.bx--time-picker[data-invalid]~.bx--form-requirement,input[data-invalid]~.bx--form-requirement{color:var(--cds-text-error,#da1e28)}.bx--form--fluid .bx--text-input__field-wrapper--warning,.bx--form--fluid .bx--text-input__field-wrapper[data-invalid]{display:block}.bx--form--fluid .bx--fieldset{margin:0}.bx--form--fluid input[data-invalid]{outline:none}.bx--form--fluid .bx--form-requirement{margin:0;padding:.5rem 2.5rem .5rem 1rem}input:not(output):not([data-invalid]):-moz-ui-invalid{box-shadow:none}.bx--form-requirement{border:0;box-sizing:border-box;display:none;font-family:inherit;font-size:100%;font-size:var(--cds-caption-01-font-size,.75rem);font-weight:var(--cds-caption-01-font-weight,400);letter-spacing:var(--cds-caption-01-letter-spacing,.32px);line-height:var(--cds-caption-01-line-height,1.33333);margin:.25rem 0 0;max-height:0;overflow:hidden;padding:0;vertical-align:baseline}.bx--form-requirement *,.bx--form-requirement :after,.bx--form-requirement :before{box-sizing:inherit}.bx--select--inline .bx--form__helper-text{margin-top:0}.bx--form__helper-text{color:var(--cds-text-02,#525252);font-size:var(--cds-helper-text-01-font-size,.75rem);letter-spacing:var(--cds-helper-text-01-letter-spacing,.32px);line-height:var(--cds-helper-text-01-line-height,1.33333);margin-top:.25rem;opacity:1;width:100%;z-index:0}.bx--form__helper-text--disabled,.bx--label--disabled,fieldset[disabled] .bx--form__helper-text,fieldset[disabled] .bx--label{color:var(--cds-disabled-02,#c6c6c6)}.bx--form-item.bx--checkbox-wrapper{margin-bottom:.25rem;position:relative}.bx--form-item.bx--checkbox-wrapper:first-of-type{margin-top:.1875rem}.bx--label+.bx--form-item.bx--checkbox-wrapper{margin-top:-.125rem}.bx--form-item.bx--checkbox-wrapper:last-of-type{margin-bottom:.1875rem}.bx--checkbox{clip:rect(0,0,0,0);border:0;height:1px;left:.7rem;margin:-1px;overflow:hidden;padding:0;position:absolute;top:1.25rem;visibility:inherit;white-space:nowrap;width:1px}.bx--checkbox-label{border:0;box-sizing:border-box;cursor:pointer;display:flex;font-family:inherit;font-size:100%;font-size:var(--cds-body-short-01-font-size,.875rem);font-weight:var(--cds-body-short-01-font-weight,400);letter-spacing:var(--cds-body-short-01-letter-spacing,.16px);line-height:var(--cds-body-short-01-line-height,1.28572);margin:0;min-height:1.5rem;padding:.1875rem 0 0 1.25rem;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:baseline}.bx--checkbox-label *,.bx--checkbox-label :after,.bx--checkbox-label :before{box-sizing:inherit}.bx--checkbox-label-text{padding-left:.375rem}.bx--checkbox-label:after,.bx--checkbox-label:before{box-sizing:border-box}.bx--checkbox-label:before{background-color:transparent;border:1px solid var(--cds-icon-01,#161616);border-radius:1px;content:"";height:1rem;left:0;margin:.125rem .125rem .125rem .1875rem;position:absolute;top:.125rem;width:1rem}.bx--checkbox-label:after{background:none;border-bottom:2px solid var(--cds-inverse-01,#fff);border-left:2px solid var(--cds-inverse-01,#fff);content:"";height:.3125rem;left:.4375rem;margin-top:-.1875rem;position:absolute;top:.5rem;transform:scale(0) rotate(-45deg);transform-origin:bottom right;width:.5625rem}.bx--checkbox-label[data-contained-checkbox-state=mixed]:before,.bx--checkbox-label[data-contained-checkbox-state=true]:before,.bx--checkbox:checked+.bx--checkbox-label:before,.bx--checkbox:indeterminate+.bx--checkbox-label:before{background-color:var(--cds-icon-01,#161616);border-color:var(--cds-icon-01,#161616);border-width:1px}.bx--checkbox-label[data-contained-checkbox-state=true]:after,.bx--checkbox:checked+.bx--checkbox-label:after{transform:scale(1) rotate(-45deg)}.bx--checkbox-label[data-contained-checkbox-state=mixed]:after,.bx--checkbox:indeterminate+.bx--checkbox-label:after{border-bottom:2px solid var(--cds-inverse-01,#fff);border-left:0 solid var(--cds-inverse-01,#fff);top:.6875rem;transform:scale(1) rotate(0deg);width:.5rem}.bx--checkbox-label[data-contained-checkbox-state=mixed].bx--checkbox-label__focus:before,.bx--checkbox-label[data-contained-checkbox-state=true].bx--checkbox-label__focus:before,.bx--checkbox-label__focus:before,.bx--checkbox:checked:focus+.bx--checkbox-label:before,.bx--checkbox:focus+.bx--checkbox-label:before,.bx--checkbox:indeterminate:focus+.bx--checkbox-label:before{outline:2px solid var(--cds-focus,#0f62fe);outline-offset:1px}.bx--checkbox-label[data-contained-checkbox-disabled=true],.bx--checkbox:disabled+.bx--checkbox-label{color:var(--cds-disabled-02,#c6c6c6);cursor:not-allowed}.bx--checkbox-label[data-contained-checkbox-disabled=true]:before,.bx--checkbox:disabled+.bx--checkbox-label:before{border-color:var(--cds-disabled-02,#c6c6c6)}.bx--checkbox-label[data-contained-checkbox-state=mixed][data-contained-checkbox-disabled=true]:before,.bx--checkbox-label[data-contained-checkbox-state=true][data-contained-checkbox-disabled=true]:before,.bx--checkbox:checked:disabled+.bx--checkbox-label:before,.bx--checkbox:indeterminate:disabled+.bx--checkbox-label:before{background-color:var(--cds-disabled-02,#c6c6c6)}.bx--checkbox-label-text.bx--skeleton{background:var(--cds-skeleton-01,#e5e5e5);border:none;box-shadow:none;height:var(--cds-spacing-05,1rem);margin:.0625rem 0 0 .375rem;padding:0;pointer-events:none;position:relative;width:6.25rem}.bx--checkbox-label-text.bx--skeleton:active,.bx--checkbox-label-text.bx--skeleton:focus,.bx--checkbox-label-text.bx--skeleton:hover{border:none;cursor:default;outline:none}.bx--checkbox-label-text.bx--skeleton:before{animation:skeleton 3s ease-in-out infinite;background:var(--cds-skeleton-02,#c6c6c6);content:"";height:100%;left:0;position:absolute;top:0;width:100%;will-change:transform-origin,transform,opacity}@media (prefers-reduced-motion:reduce){.bx--checkbox-label-text.bx--skeleton:before{animation:none}}.bx--checkbox--inline{position:relative}:host(bx-checkbox){outline:none;position:relative}']);let f,h=e=>e;const{prefix:p}=r;let m=t([c(`${p}-checkbox`)],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[b("input")],key:"_checkboxNode",value:void 0},{kind:"method",key:"_handleChange",value:function(){const{checked:e,indeterminate:t}=this._checkboxNode;this.checked=e,this.indeterminate=t;const{eventChange:i}=this.constructor;this.dispatchEvent(new CustomEvent(i,{bubbles:!0,composed:!0,detail:{indeterminate:t}}))}},{kind:"method",key:"_handleFormdata",value:function(e){const{formData:t}=e,{checked:i,disabled:r,name:o,value:a="on"}=this;!r&&i&&t.append(o,a)}},{kind:"field",decorators:[s({type:Boolean,reflect:!0})],key:"checked",value:()=>!1},{kind:"field",decorators:[s({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[s({type:Boolean,reflect:!0,attribute:"hide-label"})],key:"hideLabel",value:()=>!1},{kind:"field",decorators:[s({type:Boolean,reflect:!0})],key:"indeterminate",value:()=>!1},{kind:"field",decorators:[s({attribute:"label-text"})],key:"labelText",value:()=>""},{kind:"field",decorators:[s()],key:"name",value:void 0},{kind:"field",decorators:[s()],key:"value",value:void 0},{kind:"method",key:"createRenderRoot",value:function(){var e;return this.attachShadow({mode:"open",delegatesFocus:Number((null!==(e=/Safari\/(\d+)/.exec(navigator.userAgent))&&void 0!==e?e:["",0])[1])<=537})}},{kind:"method",key:"render",value:function(){const{checked:e,disabled:t,hideLabel:r,indeterminate:o,labelText:l,name:d,value:c,_handleChange:b}=this,s=a({[`${p}--checkbox-label`]:!0,[`${p}--visually-hidden`]:r});return i(f||(f=h` <input id="checkbox" type="checkbox" part="input" class="${0}" aria-checked="${0}" .checked="${0}" ?disabled="${0}" .indeterminate="${0}" name="${0}" value="${0}" @change="${0}"> <label for="checkbox" part="label" class="${0}"> <span class="${0}--checkbox-label-text"><slot>${0}</slot></span> </label> `),`${p}--checkbox`,o?"mixed":String(Boolean(e)),e,t,o,n(d),n(c),b,s,p,l)}},{kind:"get",static:!0,key:"eventChange",value:function(){return`${p}-checkbox-changed`}},{kind:"field",static:!0,key:"styles",value:()=>x}]}}),l(d(o)));export{m as B};