@six-group/ui-library 0.0.0-insider.db2b416 → 0.0.0-insider.e148618

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 (67) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/six-checkbox.cjs.entry.js +2 -10
  3. package/dist/cjs/six-checkbox.cjs.entry.js.map +1 -1
  4. package/dist/cjs/six-datepicker.cjs.entry.js +3 -1
  5. package/dist/cjs/six-datepicker.cjs.entry.js.map +1 -1
  6. package/dist/cjs/six-radio.cjs.entry.js +9 -17
  7. package/dist/cjs/six-radio.cjs.entry.js.map +1 -1
  8. package/dist/cjs/six-select.cjs.entry.js +4 -3
  9. package/dist/cjs/six-select.cjs.entry.js.map +1 -1
  10. package/dist/cjs/six-switch.cjs.entry.js +3 -1
  11. package/dist/cjs/six-switch.cjs.entry.js.map +1 -1
  12. package/dist/cjs/ui-library.cjs.js +1 -1
  13. package/dist/collection/components/six-checkbox/six-checkbox.js +2 -27
  14. package/dist/collection/components/six-checkbox/six-checkbox.js.map +1 -1
  15. package/dist/collection/components/six-datepicker/six-datepicker.js +3 -1
  16. package/dist/collection/components/six-datepicker/six-datepicker.js.map +1 -1
  17. package/dist/collection/components/six-radio/six-radio.js +9 -34
  18. package/dist/collection/components/six-radio/six-radio.js.map +1 -1
  19. package/dist/collection/components/six-select/six-select.js +4 -3
  20. package/dist/collection/components/six-select/six-select.js.map +1 -1
  21. package/dist/collection/components/six-switch/six-switch.js +3 -1
  22. package/dist/collection/components/six-switch/six-switch.js.map +1 -1
  23. package/dist/components/six-checkbox.js +3 -12
  24. package/dist/components/six-checkbox.js.map +1 -1
  25. package/dist/components/six-datepicker.js +3 -1
  26. package/dist/components/six-datepicker.js.map +1 -1
  27. package/dist/components/six-radio.js +10 -19
  28. package/dist/components/six-radio.js.map +1 -1
  29. package/dist/components/six-select.js +4 -3
  30. package/dist/components/six-select.js.map +1 -1
  31. package/dist/components/six-switch.js +3 -1
  32. package/dist/components/six-switch.js.map +1 -1
  33. package/dist/components.json +1 -45
  34. package/dist/esm/loader.js +1 -1
  35. package/dist/esm/six-checkbox.entry.js +2 -10
  36. package/dist/esm/six-checkbox.entry.js.map +1 -1
  37. package/dist/esm/six-datepicker.entry.js +3 -1
  38. package/dist/esm/six-datepicker.entry.js.map +1 -1
  39. package/dist/esm/six-radio.entry.js +9 -17
  40. package/dist/esm/six-radio.entry.js.map +1 -1
  41. package/dist/esm/six-select.entry.js +4 -3
  42. package/dist/esm/six-select.entry.js.map +1 -1
  43. package/dist/esm/six-switch.entry.js +3 -1
  44. package/dist/esm/six-switch.entry.js.map +1 -1
  45. package/dist/esm/ui-library.js +1 -1
  46. package/dist/types/components/six-checkbox/six-checkbox.d.ts +0 -4
  47. package/dist/types/components/six-radio/six-radio.d.ts +0 -5
  48. package/dist/types/components.d.ts +0 -8
  49. package/dist/ui-library/p-2451cfdc.entry.js +2 -0
  50. package/dist/ui-library/p-2451cfdc.entry.js.map +1 -0
  51. package/dist/ui-library/p-264d4ea8.entry.js +2 -0
  52. package/dist/ui-library/p-264d4ea8.entry.js.map +1 -0
  53. package/dist/ui-library/{p-f1eb03ba.entry.js → p-3d9de119.entry.js} +2 -2
  54. package/dist/ui-library/p-3d9de119.entry.js.map +1 -0
  55. package/dist/ui-library/{p-1730a174.entry.js → p-bf87464b.entry.js} +2 -2
  56. package/dist/ui-library/p-bf87464b.entry.js.map +1 -0
  57. package/dist/ui-library/{p-da19c7ce.entry.js → p-ed381ad9.entry.js} +2 -2
  58. package/dist/ui-library/{p-da19c7ce.entry.js.map → p-ed381ad9.entry.js.map} +1 -1
  59. package/dist/ui-library/ui-library.esm.js +1 -1
  60. package/dist/ui-library/ui-library.esm.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/ui-library/p-1730a174.entry.js.map +0 -1
  63. package/dist/ui-library/p-cf49252a.entry.js +0 -2
  64. package/dist/ui-library/p-cf49252a.entry.js.map +0 -1
  65. package/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E,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,cAAc,IACvD,eAAQ,CACH,CACD,EACR;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixRadio"],"sources":["src/components/six-radio/six-radio.scss?tag=six-radio&encapsulation=shadow","src/components/six-radio/six-radio.tsx"],"sourcesContent":["@import 'src/global/component';\n\n:host {\n display: inline-block;\n}\n\n.radio {\n display: inline-flex;\n align-items: center;\n font-family: var(--six-font-family);\n font-size: var(--six-input-font-size-medium);\n font-weight: var(--six-input-font-weight);\n color: var(--six-input-color);\n vertical-align: middle;\n cursor: pointer;\n}\n\n.radio__icon {\n display: inline-flex;\n width: var(--six-selection-control-toggle-size);\n height: var(--six-selection-control-toggle-size);\n\n svg {\n width: 100%;\n height: 100%;\n }\n}\n\n.radio__control {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--six-selection-control-toggle-size);\n height: var(--six-selection-control-toggle-size);\n border: solid var(--six-border-width) var(--six-input-border-color);\n border-radius: 50%;\n background-color: var(--six-input-background-color);\n color: transparent;\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color,\n var(--six-transition-fast) color, var(--six-transition-fast) box-shadow;\n\n input[type='radio'] {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n}\n\n// Hover\n.radio:not(.radio--checked):not(.radio--disabled) .radio__control:hover {\n border-color: var(--six-input-border-color-hover);\n}\n\n// Checked\n.radio--checked .radio__control {\n color: var(--six-selection-control-color);\n border-color: var(--six-selection-control-color);\n}\n\n// Checked + hover\n.radio.radio--checked:not(.radio--disabled) .radio__control:hover {\n color: var(--six-input-border-color-focus);\n border-color: var(--six-input-border-color-focus);\n}\n\n// Disabled\n.radio--disabled {\n cursor: not-allowed;\n color: var(--six-input-color-disabled);\n\n .radio__control {\n border-color: var(--six-input-border-color-disabled);\n }\n\n &.radio--checked .radio__control {\n color: var(--six-selection-control-color-disabled);\n }\n}\n\n.radio__label {\n line-height: var(--six-selection-control-toggle-size);\n margin-left: 0.5em;\n user-select: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The radio's label.\n *\n * @part base - The component's base wrapper.\n * @part control - The radio control.\n * @part checked-icon - The container the wraps the checked icon.\n * @part label - The radio label.\n */\n\n@Component({\n tag: 'six-radio',\n styleUrl: 'six-radio.scss',\n shadow: true,\n})\nexport class SixRadio {\n private inputId = `radio-${++id}`;\n private labelId = `radio-label-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixRadioElement;\n\n @State() hasFocus = false;\n\n /** The radio's name attribute. */\n @Prop() name = '';\n\n /** The radio's value attribute. */\n @Prop({ reflect: true }) value = 'on';\n\n /** Set to true to disable the radio. */\n @Prop() disabled = false;\n\n /** Set to true to draw the radio in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n @Watch('checked')\n handleCheckedChange() {\n if (this.checked) {\n this.getSiblingRadios().map((radio) => (radio.checked = false));\n }\n if (this.nativeInput != null) {\n this.nativeInput.checked = this.checked;\n this.sixChange.emit();\n }\n }\n\n @Watch('name')\n handleNameChange(name: string) {\n if (this.nativeInput != null) {\n this.nativeInput.name = name;\n }\n }\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-radio-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-radio-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-radio-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** default state whether the radio button should be checked or not when resetting */\n private defaultState = false;\n\n connectedCallback() {\n this.eventListeners.forward('six-radio-change', 'change', this.host);\n this.eventListeners.forward('six-radio-blur', 'blur', this.host);\n this.eventListeners.forward('six-radio-focus', 'focus', this.host);\n }\n\n componentWillLoad() {\n this.defaultState = this.checked;\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the radio. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the radio. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n /** Resets the formcontrol */\n @Method()\n async reset() {\n this.checked = this.defaultState;\n }\n\n private getAllRadios() {\n const form = this.host.closest('six-form, form') || document.body;\n\n if (this.name === '') return [];\n\n return [...form.querySelectorAll('six-radio')].filter(\n (radio: HTMLSixRadioElement) => radio.name === this.name\n ) as HTMLSixRadioElement[];\n }\n\n private getSiblingRadios() {\n return this.getAllRadios().filter((radio) => radio !== this.host) as HTMLSixRadioElement[];\n }\n\n private handleClick = () => {\n if (this.nativeInput != null) {\n this.checked = this.nativeInput.checked;\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(event.key)) {\n const radios = this.getAllRadios().filter((radio) => !radio.disabled);\n const incr = ['ArrowUp', 'ArrowLeft'].includes(event.key) ? -1 : 1;\n let index = radios.indexOf(this.host) + incr;\n if (index < 0) index = radios.length - 1;\n if (index > radios.length - 1) index = 0;\n\n this.getAllRadios().map((radio) => (radio.checked = false));\n radios[index].setFocus();\n radios[index].checked = true;\n\n event.preventDefault();\n }\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.nativeInput?.focus();\n };\n\n render() {\n return (\n <label\n part=\"base\"\n class={{\n radio: true,\n 'radio--checked': this.checked,\n 'radio--disabled': this.disabled,\n 'radio--focused': this.hasFocus,\n }}\n htmlFor={this.inputId}\n onKeyDown={this.handleKeyDown}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"radio__control\">\n <span part=\"checked-icon\" class=\"radio__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g fill=\"currentColor\">\n <circle cx=\"8\" cy=\"8\" r=\"5\"></circle>\n </g>\n </g>\n </svg>\n </span>\n\n <input\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n type=\"radio\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n role=\"radio\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onClick={this.handleClick}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n />\n </span>\n\n <span part=\"label\" id={this.labelId} class=\"radio__label\">\n <slot />\n </span>\n </label>\n );\n }\n}\n"],"version":3}
1
+ {"file":"six-radio.js","mappings":";;;AAAA,MAAM,WAAW,GAAG,g3DAAg3D;;ACIp4D,IAAI,EAAE,GAAG,CAAC,CAAC;MAqBEA,UAAQ;;;;;;;;IACX,YAAO,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC;IAC1B,YAAO,GAAG,eAAe,EAAE,EAAE,CAAC;IAE9B,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAmFtC,gBAAW,GAAG;MACpB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,EAAE;QAC5B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;OACvB;KACF,CAAC;IAEM,eAAU,GAAG;MACnB,IAAI,CAAC,QA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CACnC,CACF,CACA,CACD,EAEP,aACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC,EACpC,EAAE,EAAE,IAAI,CAAC,OAAO,EAChB,IAAI,EAAC,OAAO,EACZ,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,OAAO,kBACE,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO,qBAC5B,IAAI,CAAC,OAAO,EAC7B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,GACzB,CACG,EAEP,YAAM,IAAI,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,cAAc,IACvD,eAAQ,CACH,CACD,EACR;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixRadio"],"sources":["src/components/six-radio/six-radio.scss?tag=six-radio&encapsulation=shadow","src/components/six-radio/six-radio.tsx"],"sourcesContent":["@import 'src/global/component';\n\n:host {\n display: inline-block;\n}\n\n.radio {\n display: inline-flex;\n align-items: center;\n font-family: var(--six-font-family);\n font-size: var(--six-input-font-size-medium);\n font-weight: var(--six-input-font-weight);\n color: var(--six-input-color);\n vertical-align: middle;\n cursor: pointer;\n}\n\n.radio__icon {\n display: inline-flex;\n width: var(--six-selection-control-toggle-size);\n height: var(--six-selection-control-toggle-size);\n\n svg {\n width: 100%;\n height: 100%;\n }\n}\n\n.radio__control {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--six-selection-control-toggle-size);\n height: var(--six-selection-control-toggle-size);\n border: solid var(--six-border-width) var(--six-input-border-color);\n border-radius: 50%;\n background-color: var(--six-input-background-color);\n color: transparent;\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color,\n var(--six-transition-fast) color, var(--six-transition-fast) box-shadow;\n\n input[type='radio'] {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n}\n\n// Hover\n.radio:not(.radio--checked):not(.radio--disabled) .radio__control:hover {\n border-color: var(--six-input-border-color-hover);\n}\n\n// Checked\n.radio--checked .radio__control {\n color: var(--six-selection-control-color);\n border-color: var(--six-selection-control-color);\n}\n\n// Checked + hover\n.radio.radio--checked:not(.radio--disabled) .radio__control:hover {\n color: var(--six-input-border-color-focus);\n border-color: var(--six-input-border-color-focus);\n}\n\n// Disabled\n.radio--disabled {\n cursor: not-allowed;\n color: var(--six-input-color-disabled);\n\n .radio__control {\n border-color: var(--six-input-border-color-disabled);\n }\n\n &.radio--checked .radio__control {\n color: var(--six-selection-control-color-disabled);\n }\n}\n\n.radio__label {\n line-height: var(--six-selection-control-toggle-size);\n margin-left: 0.5em;\n user-select: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The radio's label.\n *\n * @part base - The component's base wrapper.\n * @part control - The radio control.\n * @part checked-icon - The container the wraps the checked icon.\n * @part label - The radio label.\n */\n\n@Component({\n tag: 'six-radio',\n styleUrl: 'six-radio.scss',\n shadow: true,\n})\nexport class SixRadio {\n private inputId = `radio-${++id}`;\n private labelId = `radio-label-${id}`;\n private nativeInput?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixRadioElement;\n\n @State() hasFocus = false;\n\n /** The radio's name attribute. */\n @Prop() name = '';\n\n /** The radio's value attribute. */\n @Prop({ reflect: true }) value = 'on';\n\n /** Set to true to disable the radio. */\n @Prop() disabled = false;\n\n /** Set to true to draw the radio in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n @Watch('checked')\n handleCheckedChange() {\n if (this.checked) {\n this.getSiblingRadios().forEach((radio) => (radio.checked = false));\n }\n if (this.nativeInput != null) {\n this.nativeInput.checked = this.checked;\n }\n }\n\n @Watch('name')\n handleNameChange(name: string) {\n if (this.nativeInput != null) {\n this.nativeInput.name = name;\n }\n }\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-radio-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-radio-change' }) sixChange!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-radio-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.eventListeners.forward('six-radio-change', 'change', this.host);\n this.eventListeners.forward('six-radio-blur', 'blur', this.host);\n this.eventListeners.forward('six-radio-focus', 'focus', this.host);\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the radio. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.nativeInput?.focus(options);\n }\n\n /** Removes focus from the radio. */\n @Method()\n async removeFocus() {\n this.nativeInput?.blur();\n }\n\n private getAllRadios() {\n const form = this.host.closest('form') || document.body;\n\n if (this.name === '') return [];\n\n return [...form.querySelectorAll('six-radio')].filter(\n (radio: HTMLSixRadioElement) => radio.name === this.name\n ) as HTMLSixRadioElement[];\n }\n\n private getSiblingRadios() {\n return this.getAllRadios().filter((radio) => radio !== this.host) as HTMLSixRadioElement[];\n }\n\n private handleClick = () => {\n if (this.nativeInput != null) {\n this.checked = this.nativeInput.checked;\n this.sixChange.emit();\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleKeyDown = (keyboardEvent: KeyboardEvent) => {\n if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(keyboardEvent.key)) {\n const radios = this.getAllRadios().filter((radio) => !radio.disabled);\n const incr = ['ArrowUp', 'ArrowLeft'].includes(keyboardEvent.key) ? -1 : 1;\n let index = radios.indexOf(this.host) + incr;\n if (index < 0) index = radios.length - 1;\n if (index > radios.length - 1) index = 0;\n\n this.getAllRadios().forEach((radio) => (radio.checked = false));\n radios[index].setFocus();\n radios[index].checked = true;\n radios[index].dispatchEvent(new CustomEvent('six-radio-change', { bubbles: true, cancelable: true }));\n keyboardEvent.preventDefault();\n }\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.nativeInput?.focus();\n };\n\n render() {\n return (\n <label\n part=\"base\"\n class={{\n radio: true,\n 'radio--checked': this.checked,\n 'radio--disabled': this.disabled,\n 'radio--focused': this.hasFocus,\n }}\n htmlFor={this.inputId}\n onKeyDown={this.handleKeyDown}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"radio__control\">\n <span part=\"checked-icon\" class=\"radio__icon\">\n <svg viewBox=\"0 0 16 16\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <g fill=\"currentColor\">\n <circle cx=\"8\" cy=\"8\" r=\"5\"></circle>\n </g>\n </g>\n </svg>\n </span>\n\n <input\n ref={(el) => (this.nativeInput = el)}\n id={this.inputId}\n type=\"radio\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n role=\"radio\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onClick={this.handleClick}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n />\n </span>\n\n <span part=\"label\" id={this.labelId} class=\"radio__label\">\n <slot />\n </span>\n </label>\n );\n }\n}\n"],"version":3}
@@ -46,6 +46,7 @@ const SixSelect$1 = /*@__PURE__*/ proxyCustomElement(class SixSelect extends HTM
46
46
  this.handleClearClick = (event) => {
47
47
  event.stopPropagation();
48
48
  this.clearValues();
49
+ this.sixChange.emit({ value: this.value, isSelected: true });
49
50
  };
50
51
  this.handleSelectAll = (event) => {
51
52
  const nonFilteredItems = this.getItems().filter((item) => item.style.display !== 'none');
@@ -62,6 +63,7 @@ const SixSelect$1 = /*@__PURE__*/ proxyCustomElement(class SixSelect extends HTM
62
63
  .forEach((option) => (option.checked = hasDeselectedOptions));
63
64
  const checkedItems = nonFilteredItems.filter((option) => option.checked).map((option) => option.value);
64
65
  this.value = hasDeselectedOptions ? checkedItems : [];
66
+ this.sixChange.emit({ value: this.value, isSelected: true });
65
67
  }
66
68
  };
67
69
  this.handleKeyDown = (event) => {
@@ -124,6 +126,7 @@ const SixSelect$1 = /*@__PURE__*/ proxyCustomElement(class SixSelect extends HTM
124
126
  };
125
127
  this.value = getValue();
126
128
  this.syncItemsFromValue();
129
+ this.sixChange.emit({ value: this.value, isSelected: true });
127
130
  };
128
131
  this.handleMenuShow = (event) => {
129
132
  var _a;
@@ -156,6 +159,7 @@ const SixSelect$1 = /*@__PURE__*/ proxyCustomElement(class SixSelect extends HTM
156
159
  });
157
160
  if (clearButton) {
158
161
  event.stopPropagation();
162
+ this.sixChange.emit({ value: this.value, isSelected: true });
159
163
  }
160
164
  };
161
165
  this.hasFocus = false;
@@ -212,9 +216,6 @@ const SixSelect$1 = /*@__PURE__*/ proxyCustomElement(class SixSelect extends HTM
212
216
  this.value = '';
213
217
  }
214
218
  await this.syncItemsFromValue();
215
- if (this.input) {
216
- this.sixChange.emit({ value: this.value, isSelected: true });
217
- }
218
219
  }
219
220
  connectedCallback() {
220
221
  var _a;
@@ -1 +1 @@
1
- {"file":"six-select.js","mappings":";;;;;;;;;;;;;SA2CgB,YAAY,CAAC,KAAwB;EACnD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CA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C,GACZ,CACE,EAEN,gBACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,EAC7B,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;QACL,YAAY,EAAE,IAAI;QAClB,wBAAwB,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW;QACzD,sBAAsB,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;OAC7C,8BACyB,IAAI,CAAC,gBAAgB,EAC/C,KAAK,EAAE,IAAI,CAAC,OAAO,EACnB,aAAa,EAAE,IAAI,CAAC,aAAa,+BAGjC,YAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACpC,CACE,CACH,EACd;GACH;EAEO,YAAY;IAClB,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;GAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixSelect"],"sources":["src/components/six-select/util.ts","src/components/six-select/six-select.scss?tag=six-select&encapsulation=shadow","src/components/six-select/six-select.tsx"],"sourcesContent":["export interface MenuItem {\n value: string;\n}\n\nexport function getValue(value: unknown, multiple: boolean, menuItems: MenuItem[]): string | string[] {\n if (multiple) {\n if (Array.isArray(value)) {\n return getSelectedValues(value, menuItems);\n } else {\n return getSelectedValuesFromString(value, menuItems);\n }\n }\n\n return getSelectedMenuItem(value, menuItems)?.value ?? '';\n}\n\nexport function isValidValue(value: unknown, multiple: boolean, menuItems: MenuItem[]): boolean {\n if (value === '') {\n return true;\n }\n\n if (multiple) {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return true;\n }\n return getSelectedValues(value, menuItems).length === value.length;\n }\n return getSelectedValuesFromString(value, menuItems).length > 0;\n }\n\n return getSelectedMenuItem(value, menuItems) != null;\n}\n\nexport function valueEquals(a: string | string[], b: string | string[]): boolean {\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((element, index) => element === b[index]);\n } else if (typeof a === 'string' && typeof b === 'string') {\n return a === b;\n }\n return false;\n}\n\nexport function isValueEmpty(value: string | string[]): boolean {\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n return value === '';\n}\n\nfunction getSelectedValues(values: unknown[], menuItems: MenuItem[]): string[] {\n return menuItems.filter((menuItem) => values.includes(menuItem.value)).map((menuItem) => menuItem.value);\n}\n\nfunction getSelectedValuesFromString(value: unknown, menuItems: MenuItem[]): string[] {\n return menuItems.filter((menuItem) => value === menuItem.value).map((menuItem) => menuItem.value);\n}\n\nfunction getSelectedMenuItem(value: unknown, menuItems: MenuItem[]): MenuItem | undefined {\n return menuItems.find((item) => value === item.value);\n}\n","@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n@import 'src/global/mixins/hidden';\n@import 'src/global/mixins/hide-scrollbar';\n\n:host {\n display: block;\n}\n\n.select {\n display: block;\n}\n\n.select__box {\n display: inline-flex;\n align-items: center;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n font-size: var(--six-input-font-size-medium);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: pointer;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &--autocomplete {\n border: none;\n overflow: initial;\n }\n}\n\n.select:not(.select--disabled) .select__box:hover {\n background-color: var(--six-input-background-color-hover);\n color: var(--six-input-color-hover);\n\n border-bottom-color: var(--six-input-border-color-hover);\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-hover);\n }\n}\n\n.select:not(.select--disabled) .select__box:focus {\n background-color: var(--six-input-background-color-focus);\n outline: none;\n color: var(--six-input-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n}\n\n.select--disabled {\n .select__box {\n background-color: var(--six-input-background-color-disabled);\n color: var(--six-input-color-disabled);\n cursor: not-allowed;\n outline: none;\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-disabled);\n }\n }\n\n .select__tags,\n .select__clear {\n pointer-events: none;\n }\n}\n\n.select--invalid:not(.select--disabled):not(.select--focused) {\n .select__box {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.select__label {\n flex-shrink: 1;\n flex-grow: 1;\n align-items: center;\n user-select: none;\n width: 0; /* needed for firefox because due to \"white-space: nowrap\" the default is set to max-content */\n\n @include hide-scrollbar;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n}\n\n.select__clear {\n flex-shrink: 0;\n flex-grow: 0;\n display: inline;\n}\n\n.select__icon {\n flex-shrink: 0;\n flex-grow: 0;\n display: inline;\n transition: var(--six-transition-medium) transform ease;\n}\n\n.select--open .select__icon {\n transform: rotate(-180deg);\n}\n\n// Placeholder\n.select--placeholder-visible .select__label {\n color: var(--six-input-placeholder-color);\n}\n\n.select--disabled.select--placeholder-visible .select__label {\n color: var(--six-input-placeholder-color-disabled);\n}\n\n// Tags\n.select__tags {\n display: inline-flex;\n align-items: center;\n flex-wrap: wrap;\n justify-content: left;\n margin-left: var(--six-spacing-xx-small);\n}\n\n// Hidden input (for form control validation to show)\n.select__hidden-select {\n @include visually-hidden();\n}\n\n.select__input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.select--small {\n .select__box {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n min-height: var(--six-height-small);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-small);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 2px;\n\n six-tag {\n padding-top: 2px;\n }\n\n six-tag:not(:last-of-type) {\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n.select--medium {\n .select__box {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n min-height: var(--six-height-medium);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 3px;\n\n six-tag {\n padding-top: 3px;\n }\n\n six-tag:not(:last-of-type) {\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n.select--large {\n .select__box {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n min-height: var(--six-height-large);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-large);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 4px;\n\n six-tag {\n padding-top: 4px;\n }\n\n six-tag:not(:last-of-type) {\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.select--pill {\n &.select--small .select__box {\n border-radius: var(--six-height-small);\n }\n\n &.select--medium .select__box {\n border-radius: var(--six-height-medium);\n }\n\n &.select--large .select__box {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Menu\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n.select {\n &__menu {\n max-width: 50vw;\n width: fit-content;\n\n &--filtered {\n // fixes problem where when filter is enabled the popup has the width of the input field but the menu has the width\n // of the trigger element and we thus get weird UI glitches when trigger is narrower than filter input field\n width: 100% !important;\n }\n\n &--hidden {\n // hide the menu panel if there are no menu items\n display: none;\n }\n }\n}\n\n// fixes problem where six-select height changes when size=\"small\" and clearing button is visible\nsix-icon-button::part(base) {\n padding-top: 0;\n padding-bottom: 0;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { getTextContent, hasSlot } from '../../utils/slot';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { debounce, DEFAULT_DEBOUNCE_FAST } from '../../utils/execution-control';\nimport { SixMenuItemData } from '../six-menu/six-menu';\nimport { isValueEmpty } from './util';\n\nexport interface SixSelectChangePayload {\n value: string | string[];\n isSelected: boolean;\n}\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The select's options in the form of menu items.\n * @slot label - The select's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the select.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part clear-button - The input's clear button, exported from six-input.\n * @part form-control - The form control that wraps the label, input, and help text.\n * @part help-text - The select's help text.\n * @part icon - The select's icon.\n * @part label - The select's label.\n * @part menu - The select menu, a six-menu element.\n * @part tag - The multiselect option, a six-tag element.\n * @part tags - The container in which multiselect options are rendered.\n */\n\n@Component({\n tag: 'six-select',\n styleUrl: 'six-select.scss',\n shadow: true,\n})\nexport class SixSelect {\n private box?: HTMLElement;\n private dropdown?: HTMLSixDropdownElement;\n private input?: HTMLSixInputElement;\n private inputId = `select-${++id}`;\n private labelId = `select-label-${id}`;\n private helpTextId = `select-help-text-${id}`;\n private errorTextId = `select-error-text-${id}`;\n private menu?: HTMLSixMenuElement;\n private resizeObserver?: ResizeObserver;\n private touched = false;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixSelectElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() isOpen = false;\n @State() displayLabel = '';\n @State() displayTags: HTMLSixTagElement[] = [];\n\n /** Set to true to enable multiselect. */\n @Prop() multiple = false;\n\n /**\n * The maximum number of tags to show when `multiple` is true. After the maximum, \"+n\" will be shown to indicate the\n * number of additional items that are selected. Set to -1 to remove the limit.\n */\n @Prop() maxTagsVisible = 3;\n\n /** Set to true to disable the select control. */\n @Prop() disabled = false;\n\n /** The select's name. */\n @Prop() name = '';\n\n /** The select's placeholder text. */\n @Prop() placeholder = '';\n\n /** The filter's placeholder text. */\n @Prop() filterPlaceholder?: string;\n\n /** The debounce for the filter callbacks. */\n @Prop() filterDebounce = DEFAULT_DEBOUNCE_FAST;\n\n /** The select's size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /** The value of the control. This will be a string or an array depending on `multiple`. */\n @Prop({ mutable: true }) value: string | string[] = '';\n\n /** Set to true to draw a pill-style select with rounded edges. */\n @Prop() pill = false;\n\n /** The select's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** Set to true to add a clear button when the select is populated. */\n @Prop() clearable = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to render as line */\n @Prop() line = false;\n\n /** Set to true to allow filtering for entries in the dropdown */\n @Prop() filter = false;\n\n /**\n * Set to true to allow async filtering.\n * When you enter something in the search field the component will only emit an event but not filter any elements itself.\n * You can then simply listen to the 'six-async-filter-fired' event to manage the shown menu-items yourself\n */\n @Prop() asyncFilter = false;\n\n /**\n * Set to true to turn the six-select into an autocomplete.\n */\n @Prop() autocomplete = false;\n\n /** The debounce for when the input changes for autocompletes should be emitted */\n @Prop() inputDebounce = DEFAULT_DEBOUNCE_FAST;\n\n /** Set the options to be shown in the dropdown (alternative to setting the elements via html) */\n @Prop() options: SixMenuItemData[] | null = null;\n\n /** Defines whether the menu list will be rendered virtually i.e. only the elements actually shown (and a couple around)\n * are actually rendered in the DOM. If you use virtual scrolling pass the elements via prop instead of via slot. */\n @Prop() virtualScroll = false;\n\n @Watch('disabled')\n handleDisabledChange() {\n if (this.disabled && this.isOpen) {\n this.dropdown?.hide();\n }\n }\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('multiple')\n handleMultipleChange() {\n // Cast to array | string based on `this.multiple`\n const value = this.getValueAsArray();\n this.value = this.multiple ? value : value[0] || '';\n this.syncItemsFromValue();\n }\n\n @Watch('value')\n async handleValueChange() {\n if (this.multiple && !Array.isArray(this.value)) {\n this.value = [];\n }\n\n if (!this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n\n await this.syncItemsFromValue();\n if (this.input) {\n this.sixChange.emit({ value: this.value, isSelected: true });\n }\n }\n\n /** Emitted when the control's value changes. */\n @Event({ eventName: 'six-select-change' }) sixChange!: EventEmitter<SixSelectChangePayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-select-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-select-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n if (this.virtualScroll && this.options === null) {\n console.error('Options must be defined when using virtual scrolling');\n }\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-select-change', 'change', this.host);\n this.eventListeners.forward('six-select-blur', 'blur', this.host);\n this.eventListeners.forward('six-select-focus', 'focus', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n if (this.multiple && this.value != null) {\n this.value = this.getValueAsArray();\n }\n }\n\n componentDidLoad() {\n if (this.input == null) return;\n const input = this.input;\n this.resizeObserver = new ResizeObserver(() => this.resizeMenu());\n\n // We need to do an initial sync after the component has rendered, so this will suppress the re-render warning\n requestAnimationFrame(() => this.syncItemsFromValue());\n\n this.eventListeners.add(\n input,\n 'six-input-input',\n debounce((event) => {\n const enteredValue = input.value;\n this.clearValues();\n this.sixChange.emit({ value: enteredValue, isSelected: false });\n event.stopPropagation();\n }, this.inputDebounce)\n );\n\n input.value = this.hasSelection() ? this.displayLabel : '';\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the select. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.hasFocus = true;\n this.box?.focus(options);\n }\n\n private getItemLabel(item: HTMLSixMenuItemElement): string {\n const slot = item.shadowRoot?.querySelector('slot:not([name])') as HTMLSlotElement;\n if (slot != null) {\n return getTextContent(slot);\n } else {\n // bugfix/COMSLI-203-six-select-value-is-not-updated-if-the-slot-is-changed\n return item.textContent ?? '';\n }\n }\n\n private getItems(): HTMLSixMenuItemElement[] {\n if (this.options !== null) {\n return this.options.map((option) => <six-menu-item value={option.value}>{option.label}</six-menu-item>);\n }\n\n return [...this.host.querySelectorAll('six-menu-item')];\n }\n\n private hasMenuItems() {\n return this.getItems().length > 0;\n }\n\n private getValueAsArray() {\n const values = Array.isArray(this.value) ? this.value : [this.value];\n // enforce that the values are converted to 'string' before the value is compared\n return values.map(String);\n }\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.clearValues();\n };\n\n private clearValues() {\n this.value = this.multiple ? [] : '';\n this.syncItemsFromValue();\n }\n\n private handleSelectAll = (event: KeyboardEvent) => {\n const nonFilteredItems = this.getItems().filter((item) => item.style.display !== 'none');\n const keyName = event.key;\n const keyCode = event.code;\n\n if (keyName === 'Control') {\n return;\n }\n\n if (this.isOpen && this.multiple && keyCode === 'KeyA' && event.ctrlKey) {\n event.preventDefault();\n const hasDeselectedOptions = nonFilteredItems.some((opt) => !opt.disabled && !opt.checked);\n\n nonFilteredItems\n .filter((option) => !option.disabled)\n .forEach((option) => (option.checked = hasDeselectedOptions));\n const checkedItems = nonFilteredItems.filter((option) => option.checked).map((option) => option.value);\n this.value = hasDeselectedOptions ? checkedItems : [];\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n\n const items = this.getItems();\n const firstItem = items[0];\n const lastItem = items[items.length - 1];\n\n // Ignore key presses on tags\n if (target.tagName.toLowerCase() === 'six-tag') {\n return;\n }\n\n // Tabbing out of the control closes it\n if (event.key === 'Tab') {\n if (this.isOpen) {\n this.dropdown?.hide();\n }\n return;\n }\n\n // Up/down opens the menu\n if (['ArrowDown', 'ArrowUp'].includes(event.key)) {\n event.preventDefault();\n\n // Show the menu if it's not already open\n if (!this.isOpen) {\n this.dropdown?.show();\n }\n\n // Focus on a menu item\n if (event.key === 'ArrowDown' && firstItem) {\n firstItem.setFocus();\n return;\n }\n\n if (event.key === 'ArrowUp' && lastItem) {\n lastItem.setFocus();\n return;\n }\n }\n\n // All other keys open the menu and initiate type to select\n if (!this.isOpen) {\n event.stopPropagation();\n event.preventDefault();\n this.dropdown?.show();\n this.menu?.typeToSelect(event.key);\n }\n };\n\n private handleLabelClick = () => {\n this.box?.focus();\n };\n\n private handleMenuSelect = (event: CustomEvent) => {\n const item = event.detail.item;\n\n const getValue = () => {\n if (this.multiple) {\n return this.value.includes(item.value)\n ? (this.value as []).filter((v) => v !== item.value)\n : [...this.value, item.value];\n } else {\n return item.value;\n }\n };\n\n this.value = getValue();\n\n this.syncItemsFromValue();\n };\n\n private handleMenuShow = (event: CustomEvent) => {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n\n this.resizeMenu();\n this.resizeObserver?.observe(this.host);\n this.isOpen = true;\n };\n\n private handleMenuHide = () => {\n this.resizeObserver?.unobserve(this.host);\n this.isOpen = false;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.syncItemsFromValue();\n };\n\n private handleTagInteraction = (event: KeyboardEvent | MouseEvent) => {\n // Don't toggle the menu when a tag's clear button is activated\n const path = event.composedPath() as EventTarget[];\n const clearButton = path.find((el) => {\n if (el instanceof HTMLElement) {\n const element = el as HTMLElement;\n return element.classList.contains('tag__clear');\n }\n });\n\n if (clearButton) {\n event.stopPropagation();\n }\n };\n\n private resizeMenu() {\n if (this.menu == null || this.box == null) return;\n this.menu.style.minWidth = `${this.box.clientWidth}px`;\n\n if (this.dropdown) {\n this.dropdown.reposition();\n }\n }\n\n private async syncItemsFromValue() {\n const items = this.getItems();\n const value = this.getValueAsArray();\n\n // Sync checked states\n items.forEach((item) => (item.checked = value.includes(item.value)));\n\n // Sync display label\n if (this.multiple) {\n const checkedItems: HTMLSixMenuItemElement[] = [];\n value.forEach((val) => items.map((item) => (item.value === val ? checkedItems.push(item) : null)));\n\n this.displayTags = checkedItems.map((item) => {\n return (\n <six-tag\n exportparts=\"base:tag\"\n type=\"primary\"\n size={this.size}\n pill={this.pill}\n clearable\n onClick={this.handleTagInteraction}\n onKeyDown={this.handleTagInteraction}\n onSix-tag-clear={(event) => {\n event.stopPropagation();\n if (!this.disabled) {\n item.checked = false;\n this.syncValueFromItems();\n }\n }}\n >\n {this.getItemLabel(item)}\n </six-tag>\n );\n });\n\n if (this.maxTagsVisible > 0 && this.displayTags.length > this.maxTagsVisible) {\n const total = this.displayTags.length;\n this.displayLabel = '';\n this.displayTags = this.displayTags.slice(0, this.maxTagsVisible);\n this.displayTags.push(\n <six-tag exportparts=\"base:tag\" type=\"info\" size={this.size}>\n +{total - this.maxTagsVisible}\n </six-tag>\n );\n }\n } else {\n this.displayLabel = this.extractLabelForSelectedItem(value, items);\n this.displayTags = [];\n }\n\n if (!isValueEmpty(this.value)) {\n this.touched = true;\n }\n if (this.touched && this.input != null) {\n this.input.value = Array.isArray(this.value) ? this.value.join(',') : this.value;\n }\n }\n\n private extractLabelForSelectedItem(value: string[], items: HTMLSixMenuItemElement[]): string {\n if (value.length === 0 || (value.length === 1 && value[0] === '')) {\n return '';\n }\n\n if (this.options !== null) {\n const selectedOption = this.options.find((item) => item.value === value[0]);\n return selectedOption?.value || '';\n }\n\n const checkedItem = items.find((item) => item.value === value[0]);\n return checkedItem ? this.getItemLabel(checkedItem) : '';\n }\n\n private syncValueFromItems() {\n const items = this.getItems();\n const checkedItems = items.filter((item) => item.checked);\n const checkedValues = checkedItems.map((item) => item.value);\n this.value = this.multiple\n ? this.getValueAsArray().filter((val) => checkedValues.includes(val))\n : checkedValues.length > 0\n ? checkedValues[0]\n : '';\n }\n\n render() {\n const hasSelection = this.hasSelection();\n\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n size={this.size}\n onLabelClick={this.handleLabelClick}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <six-dropdown\n part=\"base\"\n ref={(el) => (this.dropdown = el)}\n hoist={this.hoist}\n closeOnSelect={!this.multiple}\n containingElement={this.host}\n disableHideOnEnterAndSpace={this.autocomplete}\n class={{\n select: true,\n 'select--open': this.isOpen,\n 'select--empty': this.value?.length === 0,\n 'select--focused': this.hasFocus,\n 'select--clearable': this.clearable,\n 'select--disabled': this.disabled,\n 'select--multiple': this.multiple,\n 'select--has-tags': this.multiple && hasSelection,\n 'select--placeholder-visible': this.displayLabel === '',\n 'select--small': this.size === 'small',\n 'select--medium': this.size === 'medium',\n 'select--large': this.size === 'large',\n 'select--pill': this.pill,\n 'select--invalid': this.invalid,\n }}\n onKeyDown={this.handleSelectAll}\n onSix-dropdown-show={this.handleMenuShow}\n onSix-dropdown-hide={this.handleMenuHide}\n filterPlaceholder={this.filterPlaceholder}\n filterDebounce={this.filterDebounce}\n filter={this.filter}\n asyncFilter={this.asyncFilter}\n >\n <div\n slot=\"trigger\"\n ref={(el) => (this.box = el)}\n id={this.inputId}\n class={{\n select__box: true,\n 'select__box--line': this.line,\n 'select__box--autocomplete': this.autocomplete,\n }}\n role=\"combobox\"\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-haspopup=\"true\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n tabIndex={this.disabled ? -1 : 0}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n >\n <span class=\"select__label\">\n {this.displayTags.length > 0 ? (\n <span part=\"tags\" class=\"select__tags\">\n {this.displayTags}\n </span>\n ) : (\n this.displayLabel || this.placeholder\n )}\n </span>\n\n {this.clearable && hasSelection && (\n <six-icon-button\n exportparts=\"base:clear-button\"\n class=\"select__clear\"\n name=\"clear\"\n size=\"small\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n />\n )}\n\n {this.hasMenuItems() && (\n <span part=\"icon\" class=\"select__icon\">\n <six-icon size=\"medium\">expand_more</six-icon>\n </span>\n )}\n\n {/*\n The hidden input tricks the browser's built-in validation so it works as expected. We use an input instead\n of a select because, otherwise, iOS will show a list of options during validation.\n */}\n <six-input\n ref={(el) => (this.input = el)}\n class={{\n select__input: true,\n 'select__hidden-select': !this.autocomplete,\n }}\n aria-hidden=\"true\"\n required={this.required}\n onFocus={this.handleFocus}\n clearable={this.clearable}\n placeholder={this.placeholder}\n pill={this.pill}\n disabled={this.disabled}\n size={this.size}\n tabIndex={-1}\n />\n </div>\n\n <six-menu\n ref={(el) => (this.menu = el)}\n part=\"menu\"\n class={{\n select__menu: true,\n 'select__menu--filtered': this.filter || this.asyncFilter,\n 'select__menu--hidden': !this.hasMenuItems(),\n }}\n onSix-menu-item-selected={this.handleMenuSelect}\n items={this.options}\n virtualScroll={this.virtualScroll}\n remove-box-shadow\n >\n <slot onSlotchange={this.handleSlotChange} />\n </six-menu>\n </six-dropdown>\n </FormControl>\n );\n }\n\n private hasSelection() {\n return this.multiple ? this.value.length > 0 : this.value !== '';\n }\n}\n"],"version":3}
1
+ {"file":"six-select.js","mappings":";;;;;;;;;;;;;SA2CgB,YAAY,CAAC,KAAwB;EACnD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;IACxB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;GAC3B;EACD,OAAO,KAAK,KAAK,EAAE,CAAC;AACtB;;AChDA,MAAM,YAAY,GAAG,olQAAolQ;;ACczmQ,IAAI,EAAE,GAAG,CAAC,CAAC;MA6BEA,WAAS;;;;;;;;IAIZ,YAAO,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;IAC3B,YAAO,GAAG,gBAAgB,EAAE,EAAE,CAAC;IAC/B,eAAU,GAAG,oBAAoB,EAAE,EAAE,CAAC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,gBACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,EAC7B,IAAI,EAAC,MAAM,EACX,KAAK,EAAE;QACL,YAAY,EAAE,IAAI;QAClB,wBAAwB,EAAE,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW;QACzD,sBAAsB,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE;OAC7C,8BACyB,IAAI,CAAC,gBAAgB,EAC/C,KAAK,EAAE,IAAI,CAAC,OAAO,EACnB,aAAa,EAAE,IAAI,CAAC,aAAa,+BAGjC,YAAM,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAI,CACpC,CACE,CACH,EACd;GACH;EAEO,YAAY;IAClB,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;GAClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixSelect"],"sources":["src/components/six-select/util.ts","src/components/six-select/six-select.scss?tag=six-select&encapsulation=shadow","src/components/six-select/six-select.tsx"],"sourcesContent":["export interface MenuItem {\n value: string;\n}\n\nexport function getValue(value: unknown, multiple: boolean, menuItems: MenuItem[]): string | string[] {\n if (multiple) {\n if (Array.isArray(value)) {\n return getSelectedValues(value, menuItems);\n } else {\n return getSelectedValuesFromString(value, menuItems);\n }\n }\n\n return getSelectedMenuItem(value, menuItems)?.value ?? '';\n}\n\nexport function isValidValue(value: unknown, multiple: boolean, menuItems: MenuItem[]): boolean {\n if (value === '') {\n return true;\n }\n\n if (multiple) {\n if (Array.isArray(value)) {\n if (value.length === 0) {\n return true;\n }\n return getSelectedValues(value, menuItems).length === value.length;\n }\n return getSelectedValuesFromString(value, menuItems).length > 0;\n }\n\n return getSelectedMenuItem(value, menuItems) != null;\n}\n\nexport function valueEquals(a: string | string[], b: string | string[]): boolean {\n if (Array.isArray(a) && Array.isArray(b)) {\n return a.length === b.length && a.every((element, index) => element === b[index]);\n } else if (typeof a === 'string' && typeof b === 'string') {\n return a === b;\n }\n return false;\n}\n\nexport function isValueEmpty(value: string | string[]): boolean {\n if (Array.isArray(value)) {\n return value.length === 0;\n }\n return value === '';\n}\n\nfunction getSelectedValues(values: unknown[], menuItems: MenuItem[]): string[] {\n return menuItems.filter((menuItem) => values.includes(menuItem.value)).map((menuItem) => menuItem.value);\n}\n\nfunction getSelectedValuesFromString(value: unknown, menuItems: MenuItem[]): string[] {\n return menuItems.filter((menuItem) => value === menuItem.value).map((menuItem) => menuItem.value);\n}\n\nfunction getSelectedMenuItem(value: unknown, menuItems: MenuItem[]): MenuItem | undefined {\n return menuItems.find((item) => value === item.value);\n}\n","@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n@import 'src/global/mixins/hidden';\n@import 'src/global/mixins/hide-scrollbar';\n\n:host {\n display: block;\n}\n\n.select {\n display: block;\n}\n\n.select__box {\n display: inline-flex;\n align-items: center;\n justify-content: start;\n position: relative;\n width: 100%;\n font-family: var(--six-font-family);\n font-weight: var(--six-input-font-weight);\n font-size: var(--six-input-font-size-medium);\n letter-spacing: var(--six-input-letter-spacing);\n background-color: var(--six-input-background-color);\n border: solid var(--six-border-width) var(--six-input-border-color);\n vertical-align: middle;\n overflow: hidden;\n transition: var(--six-transition-fast) color, var(--six-transition-fast) border, var(--six-transition-fast) box-shadow;\n cursor: pointer;\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n\n &--autocomplete {\n border: none;\n overflow: initial;\n }\n}\n\n.select:not(.select--disabled) .select__box:hover {\n background-color: var(--six-input-background-color-hover);\n color: var(--six-input-color-hover);\n\n border-bottom-color: var(--six-input-border-color-hover);\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-hover);\n }\n}\n\n.select:not(.select--disabled) .select__box:focus {\n background-color: var(--six-input-background-color-focus);\n outline: none;\n color: var(--six-input-color-focus);\n\n border-bottom-color: var(--six-input-border-color-focus);\n box-shadow: 0 1px 0 0 var(--six-input-border-color-focus);\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-focus);\n box-shadow: var(--six-input-focus-shadow);\n }\n}\n\n.select--disabled {\n .select__box {\n background-color: var(--six-input-background-color-disabled);\n color: var(--six-input-color-disabled);\n cursor: not-allowed;\n outline: none;\n\n &:not(.select__box--line) {\n border-color: var(--six-input-border-color-disabled);\n }\n }\n\n .select__tags,\n .select__clear {\n pointer-events: none;\n }\n}\n\n.select--invalid:not(.select--disabled):not(.select--focused) {\n .select__box {\n border-bottom-color: var(--six-input-border-color-danger);\n\n &:not(.input--line) {\n border-color: var(--six-input-border-color-danger);\n }\n }\n}\n\n.select__label {\n flex-shrink: 1;\n flex-grow: 1;\n align-items: center;\n user-select: none;\n width: 0; /* needed for firefox because due to \"white-space: nowrap\" the default is set to max-content */\n\n @include hide-scrollbar;\n overflow-x: auto;\n overflow-y: hidden;\n white-space: nowrap;\n}\n\n.select__clear {\n flex-shrink: 0;\n flex-grow: 0;\n display: inline;\n}\n\n.select__icon {\n flex-shrink: 0;\n flex-grow: 0;\n display: inline;\n transition: var(--six-transition-medium) transform ease;\n}\n\n.select--open .select__icon {\n transform: rotate(-180deg);\n}\n\n// Placeholder\n.select--placeholder-visible .select__label {\n color: var(--six-input-placeholder-color);\n}\n\n.select--disabled.select--placeholder-visible .select__label {\n color: var(--six-input-placeholder-color-disabled);\n}\n\n// Tags\n.select__tags {\n display: inline-flex;\n align-items: center;\n flex-wrap: wrap;\n justify-content: left;\n margin-left: var(--six-spacing-xx-small);\n}\n\n// Hidden input (for form control validation to show)\n.select__hidden-select {\n @include visually-hidden();\n}\n\n.select__input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Size modifiers\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.select--small {\n .select__box {\n border-radius: var(--six-input-border-radius-small);\n font-size: var(--six-input-font-size-small);\n min-height: var(--six-height-small);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-small);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 2px;\n\n six-tag {\n padding-top: 2px;\n }\n\n six-tag:not(:last-of-type) {\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n.select--medium {\n .select__box {\n border-radius: var(--six-input-border-radius-medium);\n font-size: var(--six-input-font-size-medium);\n min-height: var(--six-height-medium);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-medium);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 3px;\n\n six-tag {\n padding-top: 3px;\n }\n\n six-tag:not(:last-of-type) {\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n.select--large {\n .select__box {\n border-radius: var(--six-input-border-radius-large);\n font-size: var(--six-input-font-size-large);\n min-height: var(--six-height-large);\n\n &--line {\n border: none;\n border-bottom: solid var(--six-border-width) var(--six-input-border-color);\n }\n }\n\n .select__label {\n margin: 0 var(--six-input-spacing-large);\n }\n\n .select__clear {\n margin-right: var(--six-spacing-xxx-small);\n }\n\n .select__icon {\n margin-right: var(--six-spacing-x-small);\n }\n\n .select__tags {\n padding-bottom: 4px;\n\n six-tag {\n padding-top: 4px;\n }\n\n six-tag:not(:last-of-type) {\n margin-right: var(--six-spacing-xx-small);\n }\n }\n\n &.select--has-tags .select__label {\n margin-left: 0;\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Pill modifier\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n.select--pill {\n &.select--small .select__box {\n border-radius: var(--six-height-small);\n }\n\n &.select--medium .select__box {\n border-radius: var(--six-height-medium);\n }\n\n &.select--large .select__box {\n border-radius: var(--six-height-large);\n }\n}\n\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n// Menu\n////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n.select {\n &__menu {\n max-width: 50vw;\n width: fit-content;\n\n &--filtered {\n // fixes problem where when filter is enabled the popup has the width of the input field but the menu has the width\n // of the trigger element and we thus get weird UI glitches when trigger is narrower than filter input field\n width: 100% !important;\n }\n\n &--hidden {\n // hide the menu panel if there are no menu items\n display: none;\n }\n }\n}\n\n// fixes problem where six-select height changes when size=\"small\" and clearing button is visible\nsix-icon-button::part(base) {\n padding-top: 0;\n padding-bottom: 0;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { getTextContent, hasSlot } from '../../utils/slot';\nimport FormControl from '../../functional-components/form-control/form-control';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport { debounce, DEFAULT_DEBOUNCE_FAST } from '../../utils/execution-control';\nimport { SixMenuItemData } from '../six-menu/six-menu';\nimport { isValueEmpty } from './util';\n\nexport interface SixSelectChangePayload {\n value: string | string[];\n isSelected: boolean;\n}\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The select's options in the form of menu items.\n * @slot label - The select's label. Alternatively, you can use the label prop.\n * @slot help-text - Help text that describes how to use the select.\n * @slot error-text - Error text that is shown for validation errors. Alternatively, you can use the error-text prop.\n *\n * @part base - The component's base wrapper.\n * @part clear-button - The input's clear button, exported from six-input.\n * @part form-control - The form control that wraps the label, input, and help text.\n * @part help-text - The select's help text.\n * @part icon - The select's icon.\n * @part label - The select's label.\n * @part menu - The select menu, a six-menu element.\n * @part tag - The multiselect option, a six-tag element.\n * @part tags - The container in which multiselect options are rendered.\n */\n\n@Component({\n tag: 'six-select',\n styleUrl: 'six-select.scss',\n shadow: true,\n})\nexport class SixSelect {\n private box?: HTMLElement;\n private dropdown?: HTMLSixDropdownElement;\n private input?: HTMLSixInputElement;\n private inputId = `select-${++id}`;\n private labelId = `select-label-${id}`;\n private helpTextId = `select-help-text-${id}`;\n private errorTextId = `select-error-text-${id}`;\n private menu?: HTMLSixMenuElement;\n private resizeObserver?: ResizeObserver;\n private touched = false;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixSelectElement;\n\n @State() hasFocus = false;\n @State() hasHelpTextSlot = false;\n @State() hasLabelSlot = false;\n @State() isOpen = false;\n @State() displayLabel = '';\n @State() displayTags: HTMLSixTagElement[] = [];\n\n /** Set to true to enable multiselect. */\n @Prop() multiple = false;\n\n /**\n * The maximum number of tags to show when `multiple` is true. After the maximum, \"+n\" will be shown to indicate the\n * number of additional items that are selected. Set to -1 to remove the limit.\n */\n @Prop() maxTagsVisible = 3;\n\n /** Set to true to disable the select control. */\n @Prop() disabled = false;\n\n /** The select's name. */\n @Prop() name = '';\n\n /** The select's placeholder text. */\n @Prop() placeholder = '';\n\n /** The filter's placeholder text. */\n @Prop() filterPlaceholder?: string;\n\n /** The debounce for the filter callbacks. */\n @Prop() filterDebounce = DEFAULT_DEBOUNCE_FAST;\n\n /** The select's size. */\n @Prop() size: 'small' | 'medium' | 'large' = 'medium';\n\n /**\n * Enable this option to prevent the panel from being clipped when the component is placed inside a container with\n * `overflow: auto|scroll`.\n */\n @Prop() hoist = false;\n\n /** The value of the control. This will be a string or an array depending on `multiple`. */\n @Prop({ mutable: true }) value: string | string[] = '';\n\n /** Set to true to draw a pill-style select with rounded edges. */\n @Prop() pill = false;\n\n /** The select's help text. Alternatively, you can use the help-text slot. */\n @Prop() helpText = '';\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** Set to true to add a clear button when the select is populated. */\n @Prop() clearable = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n /** Set to render as line */\n @Prop() line = false;\n\n /** Set to true to allow filtering for entries in the dropdown */\n @Prop() filter = false;\n\n /**\n * Set to true to allow async filtering.\n * When you enter something in the search field the component will only emit an event but not filter any elements itself.\n * You can then simply listen to the 'six-async-filter-fired' event to manage the shown menu-items yourself\n */\n @Prop() asyncFilter = false;\n\n /**\n * Set to true to turn the six-select into an autocomplete.\n */\n @Prop() autocomplete = false;\n\n /** The debounce for when the input changes for autocompletes should be emitted */\n @Prop() inputDebounce = DEFAULT_DEBOUNCE_FAST;\n\n /** Set the options to be shown in the dropdown (alternative to setting the elements via html) */\n @Prop() options: SixMenuItemData[] | null = null;\n\n /** Defines whether the menu list will be rendered virtually i.e. only the elements actually shown (and a couple around)\n * are actually rendered in the DOM. If you use virtual scrolling pass the elements via prop instead of via slot. */\n @Prop() virtualScroll = false;\n\n @Watch('disabled')\n handleDisabledChange() {\n if (this.disabled && this.isOpen) {\n this.dropdown?.hide();\n }\n }\n\n @Watch('helpText')\n @Watch('errorText')\n @Watch('label')\n handleLabelChange() {\n this.handleSlotChange();\n }\n\n @Watch('multiple')\n handleMultipleChange() {\n // Cast to array | string based on `this.multiple`\n const value = this.getValueAsArray();\n this.value = this.multiple ? value : value[0] || '';\n this.syncItemsFromValue();\n }\n\n @Watch('value')\n async handleValueChange() {\n if (this.multiple && !Array.isArray(this.value)) {\n this.value = [];\n }\n\n if (!this.multiple && typeof this.value !== 'string') {\n this.value = '';\n }\n\n await this.syncItemsFromValue();\n }\n\n /** Emitted when the control's value changes. */\n @Event({ eventName: 'six-select-change' }) sixChange!: EventEmitter<SixSelectChangePayload>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-select-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-select-blur' }) sixBlur!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n if (this.virtualScroll && this.options === null) {\n console.error('Options must be defined when using virtual scrolling');\n }\n this.host.shadowRoot?.addEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.forward('six-select-change', 'change', this.host);\n this.eventListeners.forward('six-select-blur', 'blur', this.host);\n this.eventListeners.forward('six-select-focus', 'focus', this.host);\n }\n\n componentWillLoad() {\n this.handleSlotChange();\n if (this.multiple && this.value != null) {\n this.value = this.getValueAsArray();\n }\n }\n\n componentDidLoad() {\n if (this.input == null) return;\n const input = this.input;\n this.resizeObserver = new ResizeObserver(() => this.resizeMenu());\n\n // We need to do an initial sync after the component has rendered, so this will suppress the re-render warning\n requestAnimationFrame(() => this.syncItemsFromValue());\n\n this.eventListeners.add(\n input,\n 'six-input-input',\n debounce((event) => {\n const enteredValue = input.value;\n this.clearValues();\n this.sixChange.emit({ value: enteredValue, isSelected: false });\n event.stopPropagation();\n }, this.inputDebounce)\n );\n\n input.value = this.hasSelection() ? this.displayLabel : '';\n }\n\n disconnectedCallback() {\n this.host.shadowRoot?.removeEventListener('slotchange', this.handleSlotChange);\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the select. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.hasFocus = true;\n this.box?.focus(options);\n }\n\n private getItemLabel(item: HTMLSixMenuItemElement): string {\n const slot = item.shadowRoot?.querySelector('slot:not([name])') as HTMLSlotElement;\n if (slot != null) {\n return getTextContent(slot);\n } else {\n // bugfix/COMSLI-203-six-select-value-is-not-updated-if-the-slot-is-changed\n return item.textContent ?? '';\n }\n }\n\n private getItems(): HTMLSixMenuItemElement[] {\n if (this.options !== null) {\n return this.options.map((option) => <six-menu-item value={option.value}>{option.label}</six-menu-item>);\n }\n\n return [...this.host.querySelectorAll('six-menu-item')];\n }\n\n private hasMenuItems() {\n return this.getItems().length > 0;\n }\n\n private getValueAsArray() {\n const values = Array.isArray(this.value) ? this.value : [this.value];\n // enforce that the values are converted to 'string' before the value is compared\n return values.map(String);\n }\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit();\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleClearClick = (event: MouseEvent) => {\n event.stopPropagation();\n this.clearValues();\n this.sixChange.emit({ value: this.value, isSelected: true });\n };\n\n private clearValues() {\n this.value = this.multiple ? [] : '';\n this.syncItemsFromValue();\n }\n\n private handleSelectAll = (event: KeyboardEvent) => {\n const nonFilteredItems = this.getItems().filter((item) => item.style.display !== 'none');\n const keyName = event.key;\n const keyCode = event.code;\n\n if (keyName === 'Control') {\n return;\n }\n\n if (this.isOpen && this.multiple && keyCode === 'KeyA' && event.ctrlKey) {\n event.preventDefault();\n const hasDeselectedOptions = nonFilteredItems.some((opt) => !opt.disabled && !opt.checked);\n\n nonFilteredItems\n .filter((option) => !option.disabled)\n .forEach((option) => (option.checked = hasDeselectedOptions));\n const checkedItems = nonFilteredItems.filter((option) => option.checked).map((option) => option.value);\n this.value = hasDeselectedOptions ? checkedItems : [];\n this.sixChange.emit({ value: this.value, isSelected: true });\n }\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n const target = event.target as HTMLElement;\n\n const items = this.getItems();\n const firstItem = items[0];\n const lastItem = items[items.length - 1];\n\n // Ignore key presses on tags\n if (target.tagName.toLowerCase() === 'six-tag') {\n return;\n }\n\n // Tabbing out of the control closes it\n if (event.key === 'Tab') {\n if (this.isOpen) {\n this.dropdown?.hide();\n }\n return;\n }\n\n // Up/down opens the menu\n if (['ArrowDown', 'ArrowUp'].includes(event.key)) {\n event.preventDefault();\n\n // Show the menu if it's not already open\n if (!this.isOpen) {\n this.dropdown?.show();\n }\n\n // Focus on a menu item\n if (event.key === 'ArrowDown' && firstItem) {\n firstItem.setFocus();\n return;\n }\n\n if (event.key === 'ArrowUp' && lastItem) {\n lastItem.setFocus();\n return;\n }\n }\n\n // All other keys open the menu and initiate type to select\n if (!this.isOpen) {\n event.stopPropagation();\n event.preventDefault();\n this.dropdown?.show();\n this.menu?.typeToSelect(event.key);\n }\n };\n\n private handleLabelClick = () => {\n this.box?.focus();\n };\n\n private handleMenuSelect = (event: CustomEvent) => {\n const item = event.detail.item;\n\n const getValue = () => {\n if (this.multiple) {\n return this.value.includes(item.value)\n ? (this.value as []).filter((v) => v !== item.value)\n : [...this.value, item.value];\n } else {\n return item.value;\n }\n };\n\n this.value = getValue();\n\n this.syncItemsFromValue();\n this.sixChange.emit({ value: this.value, isSelected: true });\n };\n\n private handleMenuShow = (event: CustomEvent) => {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n\n this.resizeMenu();\n this.resizeObserver?.observe(this.host);\n this.isOpen = true;\n };\n\n private handleMenuHide = () => {\n this.resizeObserver?.unobserve(this.host);\n this.isOpen = false;\n };\n\n private handleSlotChange = () => {\n this.hasHelpTextSlot = hasSlot(this.host, 'help-text');\n this.hasLabelSlot = hasSlot(this.host, 'label');\n this.syncItemsFromValue();\n };\n\n private handleTagInteraction = (event: KeyboardEvent | MouseEvent) => {\n // Don't toggle the menu when a tag's clear button is activated\n const path = event.composedPath() as EventTarget[];\n const clearButton = path.find((el) => {\n if (el instanceof HTMLElement) {\n const element = el as HTMLElement;\n return element.classList.contains('tag__clear');\n }\n });\n\n if (clearButton) {\n event.stopPropagation();\n this.sixChange.emit({ value: this.value, isSelected: true });\n }\n };\n\n private resizeMenu() {\n if (this.menu == null || this.box == null) return;\n this.menu.style.minWidth = `${this.box.clientWidth}px`;\n\n if (this.dropdown) {\n this.dropdown.reposition();\n }\n }\n\n private async syncItemsFromValue() {\n const items = this.getItems();\n const value = this.getValueAsArray();\n\n // Sync checked states\n items.forEach((item) => (item.checked = value.includes(item.value)));\n\n // Sync display label\n if (this.multiple) {\n const checkedItems: HTMLSixMenuItemElement[] = [];\n value.forEach((val) => items.map((item) => (item.value === val ? checkedItems.push(item) : null)));\n\n this.displayTags = checkedItems.map((item) => {\n return (\n <six-tag\n exportparts=\"base:tag\"\n type=\"primary\"\n size={this.size}\n pill={this.pill}\n clearable\n onClick={this.handleTagInteraction}\n onKeyDown={this.handleTagInteraction}\n onSix-tag-clear={(event) => {\n event.stopPropagation();\n if (!this.disabled) {\n item.checked = false;\n this.syncValueFromItems();\n }\n }}\n >\n {this.getItemLabel(item)}\n </six-tag>\n );\n });\n\n if (this.maxTagsVisible > 0 && this.displayTags.length > this.maxTagsVisible) {\n const total = this.displayTags.length;\n this.displayLabel = '';\n this.displayTags = this.displayTags.slice(0, this.maxTagsVisible);\n this.displayTags.push(\n <six-tag exportparts=\"base:tag\" type=\"info\" size={this.size}>\n +{total - this.maxTagsVisible}\n </six-tag>\n );\n }\n } else {\n this.displayLabel = this.extractLabelForSelectedItem(value, items);\n this.displayTags = [];\n }\n\n if (!isValueEmpty(this.value)) {\n this.touched = true;\n }\n if (this.touched && this.input != null) {\n this.input.value = Array.isArray(this.value) ? this.value.join(',') : this.value;\n }\n }\n\n private extractLabelForSelectedItem(value: string[], items: HTMLSixMenuItemElement[]): string {\n if (value.length === 0 || (value.length === 1 && value[0] === '')) {\n return '';\n }\n\n if (this.options !== null) {\n const selectedOption = this.options.find((item) => item.value === value[0]);\n return selectedOption?.value || '';\n }\n\n const checkedItem = items.find((item) => item.value === value[0]);\n return checkedItem ? this.getItemLabel(checkedItem) : '';\n }\n\n private syncValueFromItems() {\n const items = this.getItems();\n const checkedItems = items.filter((item) => item.checked);\n const checkedValues = checkedItems.map((item) => item.value);\n this.value = this.multiple\n ? this.getValueAsArray().filter((val) => checkedValues.includes(val))\n : checkedValues.length > 0\n ? checkedValues[0]\n : '';\n }\n\n render() {\n const hasSelection = this.hasSelection();\n\n return (\n <FormControl\n inputId={this.inputId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={this.hasLabelSlot}\n helpTextId={this.helpTextId}\n helpText={this.helpText}\n hasHelpTextSlot={this.hasHelpTextSlot}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n size={this.size}\n onLabelClick={this.handleLabelClick}\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <six-dropdown\n part=\"base\"\n ref={(el) => (this.dropdown = el)}\n hoist={this.hoist}\n closeOnSelect={!this.multiple}\n containingElement={this.host}\n disableHideOnEnterAndSpace={this.autocomplete}\n class={{\n select: true,\n 'select--open': this.isOpen,\n 'select--empty': this.value?.length === 0,\n 'select--focused': this.hasFocus,\n 'select--clearable': this.clearable,\n 'select--disabled': this.disabled,\n 'select--multiple': this.multiple,\n 'select--has-tags': this.multiple && hasSelection,\n 'select--placeholder-visible': this.displayLabel === '',\n 'select--small': this.size === 'small',\n 'select--medium': this.size === 'medium',\n 'select--large': this.size === 'large',\n 'select--pill': this.pill,\n 'select--invalid': this.invalid,\n }}\n onKeyDown={this.handleSelectAll}\n onSix-dropdown-show={this.handleMenuShow}\n onSix-dropdown-hide={this.handleMenuHide}\n filterPlaceholder={this.filterPlaceholder}\n filterDebounce={this.filterDebounce}\n filter={this.filter}\n asyncFilter={this.asyncFilter}\n >\n <div\n slot=\"trigger\"\n ref={(el) => (this.box = el)}\n id={this.inputId}\n class={{\n select__box: true,\n 'select__box--line': this.line,\n 'select__box--autocomplete': this.autocomplete,\n }}\n role=\"combobox\"\n aria-labelledby={this.labelId}\n aria-describedby={this.helpTextId}\n aria-haspopup=\"true\"\n aria-expanded={this.isOpen ? 'true' : 'false'}\n tabIndex={this.disabled ? -1 : 0}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n >\n <span class=\"select__label\">\n {this.displayTags.length > 0 ? (\n <span part=\"tags\" class=\"select__tags\">\n {this.displayTags}\n </span>\n ) : (\n this.displayLabel || this.placeholder\n )}\n </span>\n\n {this.clearable && hasSelection && (\n <six-icon-button\n exportparts=\"base:clear-button\"\n class=\"select__clear\"\n name=\"clear\"\n size=\"small\"\n onClick={this.handleClearClick}\n tabindex=\"-1\"\n />\n )}\n\n {this.hasMenuItems() && (\n <span part=\"icon\" class=\"select__icon\">\n <six-icon size=\"medium\">expand_more</six-icon>\n </span>\n )}\n\n {/*\n The hidden input tricks the browser's built-in validation so it works as expected. We use an input instead\n of a select because, otherwise, iOS will show a list of options during validation.\n */}\n <six-input\n ref={(el) => (this.input = el)}\n class={{\n select__input: true,\n 'select__hidden-select': !this.autocomplete,\n }}\n aria-hidden=\"true\"\n required={this.required}\n onFocus={this.handleFocus}\n clearable={this.clearable}\n placeholder={this.placeholder}\n pill={this.pill}\n disabled={this.disabled}\n size={this.size}\n tabIndex={-1}\n />\n </div>\n\n <six-menu\n ref={(el) => (this.menu = el)}\n part=\"menu\"\n class={{\n select__menu: true,\n 'select__menu--filtered': this.filter || this.asyncFilter,\n 'select__menu--hidden': !this.hasMenuItems(),\n }}\n onSix-menu-item-selected={this.handleMenuSelect}\n items={this.options}\n virtualScroll={this.virtualScroll}\n remove-box-shadow\n >\n <slot onSlotchange={this.handleSlotChange} />\n </six-menu>\n </six-dropdown>\n </FormControl>\n );\n }\n\n private hasSelection() {\n return this.multiple ? this.value.length > 0 : this.value !== '';\n }\n}\n"],"version":3}
@@ -20,6 +20,7 @@ const SixSwitch$1 = /*@__PURE__*/ proxyCustomElement(class SixSwitch extends HTM
20
20
  this.handleClick = () => {
21
21
  if (this.inputElement != null) {
22
22
  this.checked = this.inputElement.checked;
23
+ this.sixChange.emit(this.checked);
23
24
  }
24
25
  };
25
26
  this.handleBlur = () => {
@@ -34,10 +35,12 @@ const SixSwitch$1 = /*@__PURE__*/ proxyCustomElement(class SixSwitch extends HTM
34
35
  if (event.key === 'ArrowLeft') {
35
36
  event.preventDefault();
36
37
  this.checked = false;
38
+ this.sixChange.emit(this.checked);
37
39
  }
38
40
  if (event.key === 'ArrowRight') {
39
41
  event.preventDefault();
40
42
  this.checked = true;
43
+ this.sixChange.emit(this.checked);
41
44
  }
42
45
  };
43
46
  this.handleMouseDown = (event) => {
@@ -61,7 +64,6 @@ const SixSwitch$1 = /*@__PURE__*/ proxyCustomElement(class SixSwitch extends HTM
61
64
  this.inputElement.checked = this.checked;
62
65
  this.checked = this.inputElement.checked;
63
66
  }
64
- this.sixChange.emit(this.checked);
65
67
  }
66
68
  connectedCallback() {
67
69
  this.eventListeners.forward('six-switch-change', 'change', this.host);
@@ -1 +1 @@
1
- {"file":"six-switch.js","mappings":";;;;AAAA,MAAM,YAAY,GAAG,4iJAA4iJ;;ACKjkJ,IAAI,EAAE,GAAG,CAAC,CAAC;MAqBEA,WAAS;;;;;;;;IACZ,aAAQ,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;IAC5B,YAAO,GAAG,gBAAgB,EAAE,EAAE,CAAC;IAC/B,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAGvC,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAsEtC,gBAAW,GAAG;MACpB,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;OAC1C;KACF,CAAC;IAEM,eAAU,GAAG;MACnB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;MACtB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KACjC,CAAC;IAEM,gBAAW,GAAG;MACpB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;MACrB,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACtB,CAAC;IAEM,kBAAa,GAAG,CAAC,KAAoB;MAC3C,IAAI,KAAK,CAAC,GAAG,KAAK,WAAW,EAAE;QAC7B,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;OAC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O,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,SAAS,EAAE,IAAI,CAAC,aAAa,GAC7B,CACG,EAEP,YAAM,IAAI,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,eAAe,IACxD,eAAQ,CACH,CACD,CACI,EACd;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixSwitch"],"sources":["src/components/six-switch/six-switch.scss?tag=six-switch&encapsulation=shadow","src/components/six-switch/six-switch.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n/**\n * @prop --width: The width of the switch.\n * @prop --height: The height of the switch.\n * @prop --thumb-size: The size of the thumb.\n */\n:host {\n --height: var(--six-selection-control-toggle-size);\n --thumb-size: calc(var(--six-selection-control-toggle-size) - 4px);\n --width: calc(var(--height) * 2);\n\n display: inline-block;\n}\n\n.switch {\n display: inline-flex;\n align-items: center;\n font-family: var(--six-font-family);\n font-size: var(--six-input-font-size-medium);\n font-weight: var(--six-input-font-weight);\n color: var(--six-input-color);\n vertical-align: middle;\n cursor: pointer;\n}\n\n.switch__control {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--height);\n background-color: var(--six-selection-control-color-disabled);\n border-radius: var(--height);\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color;\n\n .switch__thumb {\n width: var(--thumb-size);\n height: var(--thumb-size);\n background-color: var(--six-input-background-color);\n border-radius: 50%;\n transform: translateX(calc(var(--width) / -2 + var(--thumb-size) / 2 - (var(--thumb-size) - var(--height)) / 2));\n transition: var(--six-transition-fast) transform ease, var(--six-transition-fast) background-color,\n var(--six-transition-fast) border-color, var(--six-transition-fast) box-shadow;\n }\n\n input[type='checkbox'] {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n}\n\n// Hover\n.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--six-input-border-color-hover);\n}\n\n// Checked\n.switch--checked .switch__control {\n background-color: var(--six-selection-control-color);\n\n .switch__thumb {\n background-color: var(--six-color-white);\n transform: translateX(calc(var(--width) / 2 - var(--thumb-size) / 2 + (var(--thumb-size) - var(--height)) / 2));\n }\n}\n\n// Checked + hover\n.switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--six-input-border-color-focus);\n}\n\n// Disabled\n.switch--disabled {\n cursor: not-allowed;\n color: var(--six-selection-control-color-disabled);\n\n .switch__control {\n background-color: var(--six-selection-control-color-disabled);\n }\n\n &.switch--checked .switch__control {\n background-color: var(--six-selection-control-color-disabled);\n }\n}\n\n.switch__label {\n line-height: var(--height);\n margin-left: 0.5em;\n user-select: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport FormControl from '../../functional-components/form-control/form-control';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The switch's label.\n *\n * @part base - The component's base wrapper.\n * @part control - The switch control.\n * @part thumb - The switch position indicator.\n * @part label - The switch label.\n */\n\n@Component({\n tag: 'six-switch',\n styleUrl: 'six-switch.scss',\n shadow: true,\n})\nexport class SixSwitch {\n private switchId = `switch-${++id}`;\n private labelId = `switch-label-${id}`;\n private errorTextId = `input-error-text-${id}`;\n\n private inputElement?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixSwitchElement;\n\n @State() hasFocus = false;\n\n /** The switch's name attribute. */\n @Prop() name = '';\n\n /** The switch's value attribute. */\n @Prop() value = 'on';\n\n /** Set to true to disable the switch. */\n @Prop() disabled = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** Set to true to draw the switch in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n @Watch('checked')\n handleCheckedChange() {\n if (this.inputElement != null) {\n this.inputElement.checked = this.checked;\n this.checked = this.inputElement.checked;\n }\n this.sixChange.emit(this.checked);\n }\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-switch-blur' }) sixBlur!: EventEmitter<boolean>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-switch-change' }) sixChange!: EventEmitter<boolean>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-switch-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.eventListeners.forward('six-switch-change', 'change', this.host);\n this.eventListeners.forward('six-switch-blur', 'blur', this.host);\n this.eventListeners.forward('six-switch-focus', 'focus', this.host);\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the switch. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.focus(options);\n }\n\n /** Removes focus from the switch. */\n @Method()\n async removeFocus() {\n this.inputElement?.blur();\n }\n\n private handleClick = () => {\n if (this.inputElement != null) {\n this.checked = this.inputElement.checked;\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit(this.checked);\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n this.checked = false;\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n this.checked = true;\n }\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.inputElement?.focus();\n };\n\n render() {\n return (\n <FormControl\n inputId={this.switchId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={false}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <label\n part=\"base\"\n htmlFor={this.switchId}\n class={{\n switch: true,\n 'switch--checked': this.checked,\n 'switch--disabled': this.disabled,\n 'switch--focused': this.hasFocus,\n }}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"switch__control\">\n <span part=\"thumb\" class=\"switch__thumb\" />\n\n <input\n ref={(el) => (this.inputElement = el)}\n id={this.switchId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"switch\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onClick={this.handleClick}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n />\n </span>\n\n <span part=\"label\" id={this.labelId} class=\"switch__label\">\n <slot />\n </span>\n </label>\n </FormControl>\n );\n }\n}\n"],"version":3}
1
+ {"file":"six-switch.js","mappings":";;;;AAAA,MAAM,YAAY,GAAG,4iJAA4iJ;;ACKjkJ,IAAI,EAAE,GAAG,CAAC,CAAC;MAqBEA,WAAS;;;;;;;;IACZ,aAAQ,GAAG,UAAU,EAAE,EAAE,EAAE,CAAC;IAC5B,YAAO,GAAG,gBAAgB,EAAE,EAAE,CAAC;IAC/B,gBAAW,GAAG,oBAAoB,EAAE,EAAE,CAAC;IAGvC,mBAAc,GAAG,IAAI,cAAc,EAAE,CAAC;IAqEtC,gBAAW,GAAG;MACpB,IAAI,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE;QAC7B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC;QACzC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;OACnC;K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AAK,EAAC,iBAAiB,IAC1C,YAAM,IAAI,EAAC,OAAO,EAAC,KAAK,EAAC,eAAe,GAAG,EAE3C,aACE,GAAG,EAAE,CAAC,EAAE,MAAM,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC,EACrC,EAAE,EAAE,IAAI,CAAC,QAAQ,EACjB,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAC,QAAQ,kBACC,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG,OAAO,qBAC5B,IAAI,CAAC,OAAO,EAC7B,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,OAAO,EAAE,IAAI,CAAC,WAAW,EACzB,SAAS,EAAE,IAAI,CAAC,aAAa,GAC7B,CACG,EAEP,YAAM,IAAI,EAAC,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,EAAC,eAAe,IACxD,eAAQ,CACH,CACD,CACI,EACd;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SixSwitch"],"sources":["src/components/six-switch/six-switch.scss?tag=six-switch&encapsulation=shadow","src/components/six-switch/six-switch.tsx"],"sourcesContent":["@import 'src/global/component';\n@import '../../functional-components/form-control/form-control';\n\n/**\n * @prop --width: The width of the switch.\n * @prop --height: The height of the switch.\n * @prop --thumb-size: The size of the thumb.\n */\n:host {\n --height: var(--six-selection-control-toggle-size);\n --thumb-size: calc(var(--six-selection-control-toggle-size) - 4px);\n --width: calc(var(--height) * 2);\n\n display: inline-block;\n}\n\n.switch {\n display: inline-flex;\n align-items: center;\n font-family: var(--six-font-family);\n font-size: var(--six-input-font-size-medium);\n font-weight: var(--six-input-font-weight);\n color: var(--six-input-color);\n vertical-align: middle;\n cursor: pointer;\n}\n\n.switch__control {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: var(--width);\n height: var(--height);\n background-color: var(--six-selection-control-color-disabled);\n border-radius: var(--height);\n transition: var(--six-transition-fast) border-color, var(--six-transition-fast) background-color;\n\n .switch__thumb {\n width: var(--thumb-size);\n height: var(--thumb-size);\n background-color: var(--six-input-background-color);\n border-radius: 50%;\n transform: translateX(calc(var(--width) / -2 + var(--thumb-size) / 2 - (var(--thumb-size) - var(--height)) / 2));\n transition: var(--six-transition-fast) transform ease, var(--six-transition-fast) background-color,\n var(--six-transition-fast) border-color, var(--six-transition-fast) box-shadow;\n }\n\n input[type='checkbox'] {\n position: absolute;\n opacity: 0;\n padding: 0;\n margin: 0;\n pointer-events: none;\n }\n}\n\n// Hover\n.switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--six-input-border-color-hover);\n}\n\n// Checked\n.switch--checked .switch__control {\n background-color: var(--six-selection-control-color);\n\n .switch__thumb {\n background-color: var(--six-color-white);\n transform: translateX(calc(var(--width) / 2 - var(--thumb-size) / 2 + (var(--thumb-size) - var(--height)) / 2));\n }\n}\n\n// Checked + hover\n.switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--six-input-border-color-focus);\n}\n\n// Disabled\n.switch--disabled {\n cursor: not-allowed;\n color: var(--six-selection-control-color-disabled);\n\n .switch__control {\n background-color: var(--six-selection-control-color-disabled);\n }\n\n &.switch--checked .switch__control {\n background-color: var(--six-selection-control-color-disabled);\n }\n}\n\n.switch__label {\n line-height: var(--height);\n margin-left: 0.5em;\n user-select: none;\n}\n","import { Component, Element, Event, EventEmitter, h, Method, Prop, State, Watch } from '@stencil/core';\nimport { EmptyPayload } from '../../utils/types';\nimport { EventListeners } from '../../utils/event-listeners';\nimport FormControl from '../../functional-components/form-control/form-control';\n\nlet id = 0;\n\n/**\n * @since 1.0\n * @status stable\n *\n * Forked from https://github.com/shoelace-style/shoelace version v2.0.0-beta27.\n *\n * @slot - The switch's label.\n *\n * @part base - The component's base wrapper.\n * @part control - The switch control.\n * @part thumb - The switch position indicator.\n * @part label - The switch label.\n */\n\n@Component({\n tag: 'six-switch',\n styleUrl: 'six-switch.scss',\n shadow: true,\n})\nexport class SixSwitch {\n private switchId = `switch-${++id}`;\n private labelId = `switch-label-${id}`;\n private errorTextId = `input-error-text-${id}`;\n\n private inputElement?: HTMLInputElement;\n private eventListeners = new EventListeners();\n\n @Element() host!: HTMLSixSwitchElement;\n\n @State() hasFocus = false;\n\n /** The switch's name attribute. */\n @Prop() name = '';\n\n /** The switch's value attribute. */\n @Prop() value = 'on';\n\n /** Set to true to disable the switch. */\n @Prop() disabled = false;\n\n /** Set to true to show an asterisk beneath the label. */\n @Prop() required = false;\n\n /** Set to true to draw the switch in a checked state. */\n @Prop({ mutable: true, reflect: true }) checked = false;\n\n /** The label text. */\n @Prop() label = '';\n\n /** The error message shown, if `invalid` is set to true. */\n @Prop() errorText = '';\n\n /** If this property is set to true and an error message is provided by `errorText`, the error message is displayed. */\n @Prop({ reflect: true }) invalid = false;\n\n @Watch('checked')\n handleCheckedChange() {\n if (this.inputElement != null) {\n this.inputElement.checked = this.checked;\n this.checked = this.inputElement.checked;\n }\n }\n\n /** Emitted when the control loses focus. */\n @Event({ eventName: 'six-switch-blur' }) sixBlur!: EventEmitter<boolean>;\n\n /** Emitted when the control's checked state changes. */\n @Event({ eventName: 'six-switch-change' }) sixChange!: EventEmitter<boolean>;\n\n /** Emitted when the control gains focus. */\n @Event({ eventName: 'six-switch-focus' }) sixFocus!: EventEmitter<EmptyPayload>;\n\n connectedCallback() {\n this.eventListeners.forward('six-switch-change', 'change', this.host);\n this.eventListeners.forward('six-switch-blur', 'blur', this.host);\n this.eventListeners.forward('six-switch-focus', 'focus', this.host);\n }\n\n disconnectedCallback() {\n this.eventListeners.removeAll();\n }\n\n /** Sets focus on the switch. */\n @Method()\n async setFocus(options?: FocusOptions) {\n this.inputElement?.focus(options);\n }\n\n /** Removes focus from the switch. */\n @Method()\n async removeFocus() {\n this.inputElement?.blur();\n }\n\n private handleClick = () => {\n if (this.inputElement != null) {\n this.checked = this.inputElement.checked;\n this.sixChange.emit(this.checked);\n }\n };\n\n private handleBlur = () => {\n this.hasFocus = false;\n this.sixBlur.emit(this.checked);\n };\n\n private handleFocus = () => {\n this.hasFocus = true;\n this.sixFocus.emit();\n };\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n this.checked = false;\n this.sixChange.emit(this.checked);\n }\n\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n this.checked = true;\n this.sixChange.emit(this.checked);\n }\n };\n\n private handleMouseDown = (event: MouseEvent) => {\n // Prevent clicks on the label from briefly blurring the input\n event.preventDefault();\n this.inputElement?.focus();\n };\n\n render() {\n return (\n <FormControl\n inputId={this.switchId}\n label={this.label}\n labelId={this.labelId}\n hasLabelSlot={false}\n errorTextId={this.errorTextId}\n errorText={this.errorText}\n size=\"medium\"\n disabled={this.disabled}\n required={this.required}\n displayError={this.invalid}\n >\n <label\n part=\"base\"\n htmlFor={this.switchId}\n class={{\n switch: true,\n 'switch--checked': this.checked,\n 'switch--disabled': this.disabled,\n 'switch--focused': this.hasFocus,\n }}\n onMouseDown={this.handleMouseDown}\n >\n <span part=\"control\" class=\"switch__control\">\n <span part=\"thumb\" class=\"switch__thumb\" />\n\n <input\n ref={(el) => (this.inputElement = el)}\n id={this.switchId}\n type=\"checkbox\"\n name={this.name}\n value={this.value}\n checked={this.checked}\n disabled={this.disabled}\n required={this.required}\n role=\"switch\"\n aria-checked={this.checked ? 'true' : 'false'}\n aria-labelledby={this.labelId}\n onClick={this.handleClick}\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onKeyDown={this.handleKeyDown}\n />\n </span>\n\n <span part=\"label\" id={this.labelId} class=\"switch__label\">\n <slot />\n </span>\n </label>\n </FormControl>\n );\n }\n}\n"],"version":3}
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2023-08-09T13:02:16",
2
+ "timestamp": "2023-08-09T13:23:14",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "4.0.4",
@@ -1580,28 +1580,6 @@
1580
1580
  "docs": "Removes focus from the checkbox.",
1581
1581
  "docsTags": []
1582
1582
  },
1583
- {
1584
- "name": "reset",
1585
- "returns": {
1586
- "type": "Promise<void>",
1587
- "docs": ""
1588
- },
1589
- "complexType": {
1590
- "signature": "() => Promise<void>",
1591
- "parameters": [],
1592
- "references": {
1593
- "Promise": {
1594
- "location": "global",
1595
- "id": "global::Promise"
1596
- }
1597
- },
1598
- "return": "Promise<void>"
1599
- },
1600
- "signature": "reset() => Promise<void>",
1601
- "parameters": [],
1602
- "docs": "Resets the formcontrol",
1603
- "docsTags": []
1604
- },
1605
1583
  {
1606
1584
  "name": "setFocus",
1607
1585
  "returns": {
@@ -9223,28 +9201,6 @@
9223
9201
  "docs": "Removes focus from the radio.",
9224
9202
  "docsTags": []
9225
9203
  },
9226
- {
9227
- "name": "reset",
9228
- "returns": {
9229
- "type": "Promise<void>",
9230
- "docs": ""
9231
- },
9232
- "complexType": {
9233
- "signature": "() => Promise<void>",
9234
- "parameters": [],
9235
- "references": {
9236
- "Promise": {
9237
- "location": "global",
9238
- "id": "global::Promise"
9239
- }
9240
- },
9241
- "return": "Promise<void>"
9242
- },
9243
- "signature": "reset() => Promise<void>",
9244
- "parameters": [],
9245
- "docs": "Resets the formcontrol",
9246
- "docsTags": []
9247
- },
9248
9204
  {
9249
9205
  "name": "setFocus",
9250
9206
  "returns": {
@@ -3,7 +3,7 @@ export { s as setNonce } from './index-8a74f992.js';
3
3
 
4
4
  const defineCustomElements = (win, options) => {
5
5
  if (typeof window === 'undefined') return undefined;
6
- return bootstrapLazy(JSON.parse("[[\"six-select\",[[1,\"six-select\",{\"multiple\":[4],\"maxTagsVisible\":[2,\"max-tags-visible\"],\"disabled\":[4],\"name\":[1],\"placeholder\":[1],\"filterPlaceholder\":[1,\"filter-placeholder\"],\"filterDebounce\":[2,\"filter-debounce\"],\"size\":[1],\"hoist\":[4],\"value\":[1025],\"pill\":[4],\"helpText\":[1,\"help-text\"],\"required\":[4],\"clearable\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"line\":[4],\"filter\":[4],\"asyncFilter\":[4,\"async-filter\"],\"autocomplete\":[4],\"inputDebounce\":[2,\"input-debounce\"],\"options\":[16],\"virtualScroll\":[4,\"virtual-scroll\"],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"isOpen\":[32],\"displayLabel\":[32],\"displayTags\":[32],\"setFocus\":[64]}]]],[\"six-header\",[[1,\"six-header\",{\"shiftContent\":[4,\"shift-content\"],\"openHamburgerMenu\":[4,\"open-hamburger-menu\"],\"openSearch\":[4,\"open-search\"],\"clickableLogo\":[4,\"clickable-logo\"],\"selectedApp\":[32],\"selectedSection\":[32],\"setSearchOpenState\":[64],\"getIsSearchOpen\":[64]}]]],[\"six-datepicker\",[[1,\"six-datepicker\",{\"type\":[1],\"locale\":[1],\"open\":[1540],\"inline\":[516],\"readonly\":[4],\"disabled\":[4],\"allowedDates\":[16],\"min\":[16],\"max\":[16],\"closeOnSelect\":[4,\"close-on-select\"],\"placement\":[1],\"size\":[1],\"required\":[4],\"defaultDate\":[1,\"default-date\"],\"placeholder\":[1],\"value\":[1040],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"containingElement\":[16],\"dateFormat\":[1,\"date-format\"],\"debounce\":[2],\"name\":[513],\"clearable\":[4],\"iconPosition\":[1,\"icon-position\"],\"hoist\":[4],\"pointerDate\":[32],\"selectionMode\":[32],\"isDropDownContentUp\":[32],\"setFocus\":[64],\"select\":[64]},[[9,\"resize\",\"resizeHandler\"],[9,\"scroll\",\"scrollHandler\"]]]]],[\"six-root\",[[1,\"six-root\",{\"breakpoint\":[2],\"padded\":[4],\"stage\":[1],\"version\":[1],\"collapse\":[32]}]]],[\"six-tile\",[[1,\"six-tile\",{\"label\":[1],\"iconName\":[1,\"icon-name\"],\"closeable\":[4],\"elevated\":[4],\"disableTooltip\":[4,\"disable-tooltip\"],\"disabled\":[516],\"size\":[513],\"visible\":[32],\"hasIconSlot\":[32],\"hasLabelSlot\":[32],\"hide\":[64],\"show\":[64]}]]],[\"six-alert\",[[1,\"six-alert\",{\"open\":[1540],\"closable\":[516],\"type\":[513],\"duration\":[2],\"isVisible\":[32],\"show\":[64],\"hide\":[64],\"toast\":[64]}]]],[\"six-dialog\",[[1,\"six-dialog\",{\"open\":[1540],\"label\":[1],\"noHeader\":[4,\"no-header\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-drawer\",[[1,\"six-drawer\",{\"open\":[1540],\"label\":[1],\"placement\":[1],\"contained\":[4],\"noHeader\":[4,\"no-header\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-search-field\",[[1,\"six-search-field\",{\"placeholder\":[1],\"debounce\":[514],\"disabled\":[516],\"value\":[513],\"clearable\":[4]}]]],[\"six-sidebar-item-group\",[[1,\"six-sidebar-item-group\",{\"name\":[1],\"icon\":[1],\"value\":[513],\"open\":[516],\"summaryIcon\":[1,\"summary-icon\"],\"hasItems\":[32],\"summaryIconHasContent\":[32]}]]],[\"six-tab\",[[1,\"six-tab\",{\"panel\":[513],\"active\":[516],\"closable\":[4],\"disabled\":[516],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-tab-group\",[[1,\"six-tab-group\",{\"placement\":[1],\"noScrollControls\":[4,\"no-scroll-controls\"],\"hasScrollControls\":[32],\"show\":[64]}]]],[\"six-avatar\",[[1,\"six-avatar\",{\"image\":[1],\"alt\":[1],\"initials\":[1],\"shape\":[1],\"hasError\":[32]}]]],[\"six-button\",[[1,\"six-button\",{\"type\":[513],\"size\":[513],\"caret\":[4],\"disabled\":[516],\"loading\":[516],\"pill\":[516],\"circle\":[516],\"submit\":[516],\"reset\":[516],\"name\":[1],\"value\":[1],\"href\":[1],\"target\":[1],\"download\":[1],\"hasFocus\":[32],\"hasLabel\":[32],\"hasPrefix\":[32],\"hasSuffix\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-error-page\",[[1,\"six-error-page\",{\"errorCode\":[2,\"error-code\"],\"language\":[1],\"customTitle\":[1,\"custom-title\"],\"customDescription\":[16],\"customIcon\":[1,\"custom-icon\"]}]]],[\"six-file-list-item\",[[1,\"six-file-list-item\",{\"identifier\":[513],\"name\":[513],\"date\":[513],\"size\":[514],\"nodownload\":[516],\"nodelete\":[516]}]]],[\"six-file-upload\",[[2,\"six-file-upload\",{\"compact\":[4],\"label\":[1],\"disabled\":[4],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"isOver\":[32]},[[1,\"dragenter\",\"dragenterHandler\"],[1,\"dragover\",\"dragoverHandler\"],[1,\"dragleave\",\"dragleaveHandler\"],[1,\"drop\",\"dropHandler\"]]]]],[\"six-badge\",[[1,\"six-badge\",{\"type\":[1],\"pill\":[4],\"pulse\":[4]}]]],[\"six-card\",[[1,\"six-card\"]]],[\"six-checkbox\",[[1,\"six-checkbox\",{\"name\":[1],\"value\":[1],\"disabled\":[4],\"required\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"checked\":[1540],\"indeterminate\":[1540],\"hasFocus\":[32],\"hasLabelSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"reset\":[64]}]]],[\"six-file-list\",[[1,\"six-file-list\"]]],[\"six-footer\",[[1,\"six-footer\"]]],[\"six-group-label\",[[1,\"six-group-label\",{\"size\":[513],\"label\":[1],\"helpText\":[1,\"help-text\"],\"disabled\":[516],\"required\":[4],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32]}]]],[\"six-language-switcher\",[[1,\"six-language-switcher\",{\"selected\":[1537],\"languages\":[16]}]]],[\"six-layout-grid\",[[1,\"six-layout-grid\",{\"columns\":[1026]}]]],[\"six-main-container\",[[1,\"six-main-container\",{\"padded\":[4]}]]],[\"six-menu-divider\",[[1,\"six-menu-divider\"]]],[\"six-menu-label\",[[1,\"six-menu-label\"]]],[\"six-progress-bar\",[[1,\"six-progress-bar\",{\"percentage\":[2],\"indeterminate\":[4]}]]],[\"six-progress-ring\",[[1,\"six-progress-ring\",{\"size\":[2],\"strokeWidth\":[2,\"stroke-width\"],\"percentage\":[2]}]]],[\"six-radio\",[[1,\"six-radio\",{\"name\":[1],\"value\":[513],\"disabled\":[4],\"checked\":[1540],\"invalid\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"reset\":[64]}]]],[\"six-range\",[[1,\"six-range\",{\"name\":[1],\"value\":[1026],\"required\":[4],\"helpText\":[1,\"help-text\"],\"disabled\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"min\":[2],\"max\":[2],\"step\":[2],\"tooltip\":[1],\"tooltipFormatter\":[16],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"hasTooltip\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-sidebar\",[[1,\"six-sidebar\",{\"position\":[1],\"open\":[1540],\"width\":[1],\"toggled\":[4],\"isVisible\":[32],\"toggle\":[64],\"show\":[64],\"hide\":[64],\"selectItemByIndex\":[64],\"selectItemByName\":[64]}]]],[\"six-sidebar-item\",[[1,\"six-sidebar-item\",{\"value\":[513],\"selected\":[516],\"disabled\":[516]}]]],[\"six-switch\",[[1,\"six-switch\",{\"name\":[1],\"value\":[1],\"disabled\":[4],\"required\":[4],\"checked\":[1540],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-tab-panel\",[[1,\"six-tab-panel\",{\"name\":[1],\"active\":[516]}]]],[\"six-textarea\",[[1,\"six-textarea\",{\"size\":[513],\"name\":[513],\"value\":[1537],\"helpText\":[1,\"help-text\"],\"placeholder\":[1],\"rows\":[2],\"resize\":[1],\"disabled\":[516],\"readonly\":[516],\"minlength\":[514],\"maxlength\":[514],\"required\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"autofocus\":[4],\"spellcheck\":[4],\"inputmode\":[1],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"select\":[64],\"setSelectionRange\":[64],\"setRangeText\":[64]}]]],[\"six-icon\",[[1,\"six-icon\",{\"size\":[513],\"filled\":[4]}]]],[\"six-timepicker\",[[1,\"six-timepicker\",{\"format\":[1],\"separator\":[1],\"value\":[1025],\"open\":[1540],\"inline\":[516],\"readonly\":[4],\"disabled\":[4],\"placement\":[1],\"size\":[1],\"required\":[4],\"placeholder\":[1],\"errorText\":[1,\"error-text\"],\"label\":[1],\"invalid\":[516],\"name\":[513],\"clearable\":[4],\"iconPosition\":[1,\"icon-position\"],\"hoist\":[4],\"timeout\":[2],\"interval\":[2],\"defaultTime\":[1,\"default-time\"],\"debounce\":[2],\"isPopupContentUp\":[32],\"isDropDownContentUp\":[32],\"popupValue\":[32],\"setFocus\":[64]},[[9,\"resize\",\"resizeHandler\"],[9,\"scroll\",\"scrollHandler\"]]]]],[\"six-tag\",[[1,\"six-tag\",{\"type\":[513],\"size\":[513],\"pill\":[516],\"clearable\":[516]}]]],[\"six-details\",[[1,\"six-details\",{\"open\":[1540],\"summary\":[1],\"summaryIcon\":[1,\"summary-icon\"],\"summaryIconSize\":[513,\"summary-icon-size\"],\"disabled\":[4],\"inline\":[4],\"selectableEmpty\":[4,\"selectable-empty\"],\"hasContent\":[4,\"has-content\"],\"animateSummaryIcon\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-picto\",[[1,\"six-picto\",{\"size\":[1]}]]],[\"six-spinner\",[[1,\"six-spinner\",{\"six\":[4]}]]],[\"six-tooltip\",[[1,\"six-tooltip\",{\"content\":[1],\"placement\":[1],\"disabled\":[4],\"distance\":[2],\"open\":[1540],\"skidding\":[2],\"trigger\":[1],\"show\":[64],\"hide\":[64]}]]],[\"set-attributes_2\",[[1,\"six-stage-indicator\",{\"stage\":[1]}],[4,\"set-attributes\",{\"value\":[16]}]]],[\"six-item-picker\",[[1,\"six-item-picker\",{\"value\":[1544],\"type\":[1],\"min\":[1544],\"max\":[1544],\"roundtrip\":[516],\"step\":[514],\"items\":[16],\"padded\":[4],\"paddingLength\":[2,\"padding-length\"],\"paddingChar\":[1,\"padding-char\"],\"paddingDirection\":[1,\"padding-direction\"],\"timeout\":[2],\"interval\":[2],\"debounce\":[2],\"_items\":[32],\"_itemIndexes\":[32]}]]],[\"six-menu-item\",[[1,\"six-menu-item\",{\"checked\":[516],\"value\":[513],\"disabled\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"getTextLabel\":[64]}]]],[\"six-input\",[[1,\"six-input\",{\"type\":[513],\"size\":[513],\"name\":[513],\"value\":[1537],\"pill\":[516],\"helpText\":[1,\"help-text\"],\"placeholder\":[1],\"disabled\":[516],\"readonly\":[516],\"minlength\":[514],\"maxlength\":[514],\"min\":[514],\"max\":[514],\"step\":[514],\"pattern\":[513],\"required\":[4],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"autofocus\":[4],\"spellcheck\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"clearable\":[4],\"togglePassword\":[4,\"toggle-password\"],\"inputmode\":[1],\"line\":[4],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"isPasswordVisible\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"select\":[64],\"setSelectionRange\":[64],\"setRangeText\":[64]}]]],[\"six-dropdown_2\",[[1,\"six-dropdown\",{\"open\":[1540],\"placement\":[1],\"closeOnSelect\":[4,\"close-on-select\"],\"distance\":[2],\"skidding\":[2],\"hoist\":[4],\"containingElement\":[16],\"filter\":[4],\"asyncFilter\":[4,\"async-filter\"],\"filterPlaceholder\":[1,\"filter-placeholder\"],\"autofocusFilter\":[4,\"autofocus-filter\"],\"filterDebounce\":[2,\"filter-debounce\"],\"disableHideOnEnterAndSpace\":[4,\"disable-hide-on-enter-and-space\"],\"options\":[16],\"virtualScroll\":[4,\"virtual-scroll\"],\"filteredOptions\":[32],\"show\":[64],\"hide\":[64],\"reposition\":[64]}],[1,\"six-menu\",{\"removeBoxShadow\":[4,\"remove-box-shadow\"],\"items\":[16],\"itemsShown\":[2,\"items-shown\"],\"virtualScroll\":[4,\"virtual-scroll\"],\"itemSize\":[2,\"item-size\"],\"scrollingDebounce\":[2,\"scrolling-debounce\"],\"scrollingIndex\":[32],\"sixMenuItemHeight\":[32],\"typeToSelect\":[64]}]]],[\"six-icon-button\",[[1,\"six-icon-button\",{\"name\":[513],\"size\":[513],\"label\":[513],\"disabled\":[516],\"html\":[513]}]]]]"), options);
6
+ return bootstrapLazy(JSON.parse("[[\"six-select\",[[1,\"six-select\",{\"multiple\":[4],\"maxTagsVisible\":[2,\"max-tags-visible\"],\"disabled\":[4],\"name\":[1],\"placeholder\":[1],\"filterPlaceholder\":[1,\"filter-placeholder\"],\"filterDebounce\":[2,\"filter-debounce\"],\"size\":[1],\"hoist\":[4],\"value\":[1025],\"pill\":[4],\"helpText\":[1,\"help-text\"],\"required\":[4],\"clearable\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"line\":[4],\"filter\":[4],\"asyncFilter\":[4,\"async-filter\"],\"autocomplete\":[4],\"inputDebounce\":[2,\"input-debounce\"],\"options\":[16],\"virtualScroll\":[4,\"virtual-scroll\"],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"isOpen\":[32],\"displayLabel\":[32],\"displayTags\":[32],\"setFocus\":[64]}]]],[\"six-header\",[[1,\"six-header\",{\"shiftContent\":[4,\"shift-content\"],\"openHamburgerMenu\":[4,\"open-hamburger-menu\"],\"openSearch\":[4,\"open-search\"],\"clickableLogo\":[4,\"clickable-logo\"],\"selectedApp\":[32],\"selectedSection\":[32],\"setSearchOpenState\":[64],\"getIsSearchOpen\":[64]}]]],[\"six-datepicker\",[[1,\"six-datepicker\",{\"type\":[1],\"locale\":[1],\"open\":[1540],\"inline\":[516],\"readonly\":[4],\"disabled\":[4],\"allowedDates\":[16],\"min\":[16],\"max\":[16],\"closeOnSelect\":[4,\"close-on-select\"],\"placement\":[1],\"size\":[1],\"required\":[4],\"defaultDate\":[1,\"default-date\"],\"placeholder\":[1],\"value\":[1040],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"containingElement\":[16],\"dateFormat\":[1,\"date-format\"],\"debounce\":[2],\"name\":[513],\"clearable\":[4],\"iconPosition\":[1,\"icon-position\"],\"hoist\":[4],\"pointerDate\":[32],\"selectionMode\":[32],\"isDropDownContentUp\":[32],\"setFocus\":[64],\"select\":[64]},[[9,\"resize\",\"resizeHandler\"],[9,\"scroll\",\"scrollHandler\"]]]]],[\"six-root\",[[1,\"six-root\",{\"breakpoint\":[2],\"padded\":[4],\"stage\":[1],\"version\":[1],\"collapse\":[32]}]]],[\"six-tile\",[[1,\"six-tile\",{\"label\":[1],\"iconName\":[1,\"icon-name\"],\"closeable\":[4],\"elevated\":[4],\"disableTooltip\":[4,\"disable-tooltip\"],\"disabled\":[516],\"size\":[513],\"visible\":[32],\"hasIconSlot\":[32],\"hasLabelSlot\":[32],\"hide\":[64],\"show\":[64]}]]],[\"six-alert\",[[1,\"six-alert\",{\"open\":[1540],\"closable\":[516],\"type\":[513],\"duration\":[2],\"isVisible\":[32],\"show\":[64],\"hide\":[64],\"toast\":[64]}]]],[\"six-dialog\",[[1,\"six-dialog\",{\"open\":[1540],\"label\":[1],\"noHeader\":[4,\"no-header\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-drawer\",[[1,\"six-drawer\",{\"open\":[1540],\"label\":[1],\"placement\":[1],\"contained\":[4],\"noHeader\":[4,\"no-header\"],\"hasFooter\":[32],\"isVisible\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-search-field\",[[1,\"six-search-field\",{\"placeholder\":[1],\"debounce\":[514],\"disabled\":[516],\"value\":[513],\"clearable\":[4]}]]],[\"six-sidebar-item-group\",[[1,\"six-sidebar-item-group\",{\"name\":[1],\"icon\":[1],\"value\":[513],\"open\":[516],\"summaryIcon\":[1,\"summary-icon\"],\"hasItems\":[32],\"summaryIconHasContent\":[32]}]]],[\"six-tab\",[[1,\"six-tab\",{\"panel\":[513],\"active\":[516],\"closable\":[4],\"disabled\":[516],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-tab-group\",[[1,\"six-tab-group\",{\"placement\":[1],\"noScrollControls\":[4,\"no-scroll-controls\"],\"hasScrollControls\":[32],\"show\":[64]}]]],[\"six-avatar\",[[1,\"six-avatar\",{\"image\":[1],\"alt\":[1],\"initials\":[1],\"shape\":[1],\"hasError\":[32]}]]],[\"six-button\",[[1,\"six-button\",{\"type\":[513],\"size\":[513],\"caret\":[4],\"disabled\":[516],\"loading\":[516],\"pill\":[516],\"circle\":[516],\"submit\":[516],\"reset\":[516],\"name\":[1],\"value\":[1],\"href\":[1],\"target\":[1],\"download\":[1],\"hasFocus\":[32],\"hasLabel\":[32],\"hasPrefix\":[32],\"hasSuffix\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-error-page\",[[1,\"six-error-page\",{\"errorCode\":[2,\"error-code\"],\"language\":[1],\"customTitle\":[1,\"custom-title\"],\"customDescription\":[16],\"customIcon\":[1,\"custom-icon\"]}]]],[\"six-file-list-item\",[[1,\"six-file-list-item\",{\"identifier\":[513],\"name\":[513],\"date\":[513],\"size\":[514],\"nodownload\":[516],\"nodelete\":[516]}]]],[\"six-file-upload\",[[2,\"six-file-upload\",{\"compact\":[4],\"label\":[1],\"disabled\":[4],\"accept\":[1],\"multiple\":[4],\"maxFileSize\":[2,\"max-file-size\"],\"isOver\":[32]},[[1,\"dragenter\",\"dragenterHandler\"],[1,\"dragover\",\"dragoverHandler\"],[1,\"dragleave\",\"dragleaveHandler\"],[1,\"drop\",\"dropHandler\"]]]]],[\"six-badge\",[[1,\"six-badge\",{\"type\":[1],\"pill\":[4],\"pulse\":[4]}]]],[\"six-card\",[[1,\"six-card\"]]],[\"six-checkbox\",[[1,\"six-checkbox\",{\"name\":[1],\"value\":[1],\"disabled\":[4],\"required\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"checked\":[1540],\"indeterminate\":[1540],\"hasFocus\":[32],\"hasLabelSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-file-list\",[[1,\"six-file-list\"]]],[\"six-footer\",[[1,\"six-footer\"]]],[\"six-group-label\",[[1,\"six-group-label\",{\"size\":[513],\"label\":[1],\"helpText\":[1,\"help-text\"],\"disabled\":[516],\"required\":[4],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32]}]]],[\"six-language-switcher\",[[1,\"six-language-switcher\",{\"selected\":[1537],\"languages\":[16]}]]],[\"six-layout-grid\",[[1,\"six-layout-grid\",{\"columns\":[1026]}]]],[\"six-main-container\",[[1,\"six-main-container\",{\"padded\":[4]}]]],[\"six-menu-divider\",[[1,\"six-menu-divider\"]]],[\"six-menu-label\",[[1,\"six-menu-label\"]]],[\"six-progress-bar\",[[1,\"six-progress-bar\",{\"percentage\":[2],\"indeterminate\":[4]}]]],[\"six-progress-ring\",[[1,\"six-progress-ring\",{\"size\":[2],\"strokeWidth\":[2,\"stroke-width\"],\"percentage\":[2]}]]],[\"six-radio\",[[1,\"six-radio\",{\"name\":[1],\"value\":[513],\"disabled\":[4],\"checked\":[1540],\"invalid\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-range\",[[1,\"six-range\",{\"name\":[1],\"value\":[1026],\"required\":[4],\"helpText\":[1,\"help-text\"],\"disabled\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"min\":[2],\"max\":[2],\"step\":[2],\"tooltip\":[1],\"tooltipFormatter\":[16],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"hasTooltip\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-sidebar\",[[1,\"six-sidebar\",{\"position\":[1],\"open\":[1540],\"width\":[1],\"toggled\":[4],\"isVisible\":[32],\"toggle\":[64],\"show\":[64],\"hide\":[64],\"selectItemByIndex\":[64],\"selectItemByName\":[64]}]]],[\"six-sidebar-item\",[[1,\"six-sidebar-item\",{\"value\":[513],\"selected\":[516],\"disabled\":[516]}]]],[\"six-switch\",[[1,\"six-switch\",{\"name\":[1],\"value\":[1],\"disabled\":[4],\"required\":[4],\"checked\":[1540],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64]}]]],[\"six-tab-panel\",[[1,\"six-tab-panel\",{\"name\":[1],\"active\":[516]}]]],[\"six-textarea\",[[1,\"six-textarea\",{\"size\":[513],\"name\":[513],\"value\":[1537],\"helpText\":[1,\"help-text\"],\"placeholder\":[1],\"rows\":[2],\"resize\":[1],\"disabled\":[516],\"readonly\":[516],\"minlength\":[514],\"maxlength\":[514],\"required\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"autofocus\":[4],\"spellcheck\":[4],\"inputmode\":[1],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"select\":[64],\"setSelectionRange\":[64],\"setRangeText\":[64]}]]],[\"six-icon\",[[1,\"six-icon\",{\"size\":[513],\"filled\":[4]}]]],[\"six-timepicker\",[[1,\"six-timepicker\",{\"format\":[1],\"separator\":[1],\"value\":[1025],\"open\":[1540],\"inline\":[516],\"readonly\":[4],\"disabled\":[4],\"placement\":[1],\"size\":[1],\"required\":[4],\"placeholder\":[1],\"errorText\":[1,\"error-text\"],\"label\":[1],\"invalid\":[516],\"name\":[513],\"clearable\":[4],\"iconPosition\":[1,\"icon-position\"],\"hoist\":[4],\"timeout\":[2],\"interval\":[2],\"defaultTime\":[1,\"default-time\"],\"debounce\":[2],\"isPopupContentUp\":[32],\"isDropDownContentUp\":[32],\"popupValue\":[32],\"setFocus\":[64]},[[9,\"resize\",\"resizeHandler\"],[9,\"scroll\",\"scrollHandler\"]]]]],[\"six-tag\",[[1,\"six-tag\",{\"type\":[513],\"size\":[513],\"pill\":[516],\"clearable\":[516]}]]],[\"six-details\",[[1,\"six-details\",{\"open\":[1540],\"summary\":[1],\"summaryIcon\":[1,\"summary-icon\"],\"summaryIconSize\":[513,\"summary-icon-size\"],\"disabled\":[4],\"inline\":[4],\"selectableEmpty\":[4,\"selectable-empty\"],\"hasContent\":[4,\"has-content\"],\"animateSummaryIcon\":[32],\"show\":[64],\"hide\":[64]}]]],[\"six-picto\",[[1,\"six-picto\",{\"size\":[1]}]]],[\"six-spinner\",[[1,\"six-spinner\",{\"six\":[4]}]]],[\"six-tooltip\",[[1,\"six-tooltip\",{\"content\":[1],\"placement\":[1],\"disabled\":[4],\"distance\":[2],\"open\":[1540],\"skidding\":[2],\"trigger\":[1],\"show\":[64],\"hide\":[64]}]]],[\"set-attributes_2\",[[1,\"six-stage-indicator\",{\"stage\":[1]}],[4,\"set-attributes\",{\"value\":[16]}]]],[\"six-item-picker\",[[1,\"six-item-picker\",{\"value\":[1544],\"type\":[1],\"min\":[1544],\"max\":[1544],\"roundtrip\":[516],\"step\":[514],\"items\":[16],\"padded\":[4],\"paddingLength\":[2,\"padding-length\"],\"paddingChar\":[1,\"padding-char\"],\"paddingDirection\":[1,\"padding-direction\"],\"timeout\":[2],\"interval\":[2],\"debounce\":[2],\"_items\":[32],\"_itemIndexes\":[32]}]]],[\"six-menu-item\",[[1,\"six-menu-item\",{\"checked\":[516],\"value\":[513],\"disabled\":[516],\"hasFocus\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"getTextLabel\":[64]}]]],[\"six-input\",[[1,\"six-input\",{\"type\":[513],\"size\":[513],\"name\":[513],\"value\":[1537],\"pill\":[516],\"helpText\":[1,\"help-text\"],\"placeholder\":[1],\"disabled\":[516],\"readonly\":[516],\"minlength\":[514],\"maxlength\":[514],\"min\":[514],\"max\":[514],\"step\":[514],\"pattern\":[513],\"required\":[4],\"autocapitalize\":[1],\"autocorrect\":[1],\"autocomplete\":[1],\"autofocus\":[4],\"spellcheck\":[4],\"label\":[1],\"errorText\":[1,\"error-text\"],\"invalid\":[516],\"clearable\":[4],\"togglePassword\":[4,\"toggle-password\"],\"inputmode\":[1],\"line\":[4],\"hasFocus\":[32],\"hasHelpTextSlot\":[32],\"hasLabelSlot\":[32],\"isPasswordVisible\":[32],\"setFocus\":[64],\"removeFocus\":[64],\"select\":[64],\"setSelectionRange\":[64],\"setRangeText\":[64]}]]],[\"six-dropdown_2\",[[1,\"six-dropdown\",{\"open\":[1540],\"placement\":[1],\"closeOnSelect\":[4,\"close-on-select\"],\"distance\":[2],\"skidding\":[2],\"hoist\":[4],\"containingElement\":[16],\"filter\":[4],\"asyncFilter\":[4,\"async-filter\"],\"filterPlaceholder\":[1,\"filter-placeholder\"],\"autofocusFilter\":[4,\"autofocus-filter\"],\"filterDebounce\":[2,\"filter-debounce\"],\"disableHideOnEnterAndSpace\":[4,\"disable-hide-on-enter-and-space\"],\"options\":[16],\"virtualScroll\":[4,\"virtual-scroll\"],\"filteredOptions\":[32],\"show\":[64],\"hide\":[64],\"reposition\":[64]}],[1,\"six-menu\",{\"removeBoxShadow\":[4,\"remove-box-shadow\"],\"items\":[16],\"itemsShown\":[2,\"items-shown\"],\"virtualScroll\":[4,\"virtual-scroll\"],\"itemSize\":[2,\"item-size\"],\"scrollingDebounce\":[2,\"scrolling-debounce\"],\"scrollingIndex\":[32],\"sixMenuItemHeight\":[32],\"typeToSelect\":[64]}]]],[\"six-icon-button\",[[1,\"six-icon-button\",{\"name\":[513],\"size\":[513],\"label\":[513],\"disabled\":[516],\"html\":[513]}]]]]"), options);
7
7
  };
8
8
 
9
9
  export { defineCustomElements };