@db-ux/wc-core-components 2.4.0 → 2.4.2

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 (99) hide show
  1. package/dist/cjs/db-checkbox.cjs.entry.js +2 -2
  2. package/dist/cjs/db-checkbox.cjs.entry.js.map +1 -1
  3. package/dist/cjs/db-checkbox.entry.cjs.js.map +1 -1
  4. package/dist/cjs/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.cjs.js.map +1 -1
  5. package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +3 -3
  6. package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js.map +1 -1
  7. package/dist/cjs/db-navigation-item.cjs.entry.js +6 -5
  8. package/dist/cjs/db-navigation-item.cjs.entry.js.map +1 -1
  9. package/dist/cjs/db-navigation-item.entry.cjs.js.map +1 -1
  10. package/dist/cjs/db-radio.cjs.entry.js +2 -2
  11. package/dist/cjs/db-radio.cjs.entry.js.map +1 -1
  12. package/dist/cjs/db-radio.entry.cjs.js.map +1 -1
  13. package/dist/cjs/db-select.cjs.entry.js +4 -4
  14. package/dist/cjs/db-select.cjs.entry.js.map +1 -1
  15. package/dist/cjs/db-select.entry.cjs.js.map +1 -1
  16. package/dist/cjs/db-switch.cjs.entry.js +2 -18
  17. package/dist/cjs/db-switch.cjs.entry.js.map +1 -1
  18. package/dist/cjs/db-switch.entry.cjs.js.map +1 -1
  19. package/dist/cjs/db-textarea.cjs.entry.js +3 -3
  20. package/dist/cjs/db-textarea.cjs.entry.js.map +1 -1
  21. package/dist/cjs/db-textarea.entry.cjs.js.map +1 -1
  22. package/dist/cjs/db-ux.cjs.js +1 -1
  23. package/dist/cjs/index.cjs.js.map +1 -1
  24. package/dist/cjs/loader.cjs.js +1 -1
  25. package/dist/collection/components/checkbox/checkbox.js +23 -23
  26. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  27. package/dist/collection/components/input/input.js +28 -28
  28. package/dist/collection/components/input/input.js.map +1 -1
  29. package/dist/collection/components/navigation-item/navigation-item.js +7 -6
  30. package/dist/collection/components/navigation-item/navigation-item.js.map +1 -1
  31. package/dist/collection/components/radio/radio.js +27 -27
  32. package/dist/collection/components/radio/radio.js.map +1 -1
  33. package/dist/collection/components/select/select.js +24 -24
  34. package/dist/collection/components/select/select.js.map +1 -1
  35. package/dist/collection/components/switch/model.js.map +1 -1
  36. package/dist/collection/components/switch/switch.js +50 -70
  37. package/dist/collection/components/switch/switch.js.map +1 -1
  38. package/dist/collection/components/textarea/textarea.js +28 -28
  39. package/dist/collection/components/textarea/textarea.js.map +1 -1
  40. package/dist/collection/shared/model.js.map +1 -1
  41. package/dist/custom-elements.json +291 -307
  42. package/dist/db-ux/db-checkbox.entry.esm.js.map +1 -1
  43. package/dist/db-ux/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.esm.js.map +1 -1
  44. package/dist/db-ux/db-navigation-item.entry.esm.js.map +1 -1
  45. package/dist/db-ux/db-radio.entry.esm.js.map +1 -1
  46. package/dist/db-ux/db-select.entry.esm.js.map +1 -1
  47. package/dist/db-ux/db-switch.entry.esm.js.map +1 -1
  48. package/dist/db-ux/db-textarea.entry.esm.js.map +1 -1
  49. package/dist/db-ux/db-ux.esm.js +1 -1
  50. package/dist/db-ux/index.esm.js.map +1 -1
  51. package/dist/db-ux/{p-51f991c4.entry.js → p-2d389152.entry.js} +2 -2
  52. package/dist/db-ux/{p-51f991c4.entry.js.map → p-2d389152.entry.js.map} +1 -1
  53. package/dist/db-ux/p-684d11af.entry.js +2 -0
  54. package/dist/db-ux/p-684d11af.entry.js.map +1 -0
  55. package/dist/db-ux/{p-016e21b6.entry.js → p-77e5189c.entry.js} +2 -2
  56. package/dist/db-ux/{p-016e21b6.entry.js.map → p-77e5189c.entry.js.map} +1 -1
  57. package/dist/db-ux/{p-2f87bffd.entry.js → p-7ee7a06d.entry.js} +2 -2
  58. package/dist/db-ux/{p-2f87bffd.entry.js.map → p-7ee7a06d.entry.js.map} +1 -1
  59. package/dist/db-ux/p-81a85032.entry.js +2 -0
  60. package/dist/db-ux/{p-a258be18.entry.js.map → p-81a85032.entry.js.map} +1 -1
  61. package/dist/db-ux/p-90eef6ac.entry.js +2 -0
  62. package/dist/db-ux/p-90eef6ac.entry.js.map +1 -0
  63. package/dist/db-ux/{p-518d1a26.entry.js → p-fdb8daba.entry.js} +2 -2
  64. package/dist/db-ux/{p-518d1a26.entry.js.map → p-fdb8daba.entry.js.map} +1 -1
  65. package/dist/esm/db-checkbox.entry.js +2 -2
  66. package/dist/esm/db-checkbox.entry.js.map +1 -1
  67. package/dist/esm/db-custom-select-dropdown.db-custom-select-list.db-custom-select-list-item.db-input.db-tag.entry.js.map +1 -1
  68. package/dist/esm/db-custom-select-dropdown_5.entry.js +3 -3
  69. package/dist/esm/db-custom-select-dropdown_5.entry.js.map +1 -1
  70. package/dist/esm/db-navigation-item.entry.js +7 -6
  71. package/dist/esm/db-navigation-item.entry.js.map +1 -1
  72. package/dist/esm/db-radio.entry.js +3 -3
  73. package/dist/esm/db-radio.entry.js.map +1 -1
  74. package/dist/esm/db-select.entry.js +4 -4
  75. package/dist/esm/db-select.entry.js.map +1 -1
  76. package/dist/esm/db-switch.entry.js +3 -19
  77. package/dist/esm/db-switch.entry.js.map +1 -1
  78. package/dist/esm/db-textarea.entry.js +3 -3
  79. package/dist/esm/db-textarea.entry.js.map +1 -1
  80. package/dist/esm/db-ux.js +1 -1
  81. package/dist/esm/index.js.map +1 -1
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  84. package/dist/types/components/input/input.d.ts +1 -1
  85. package/dist/types/components/navigation-item/navigation-item.d.ts +1 -1
  86. package/dist/types/components/radio/radio.d.ts +1 -1
  87. package/dist/types/components/select/select.d.ts +1 -1
  88. package/dist/types/components/switch/model.d.ts +1 -3
  89. package/dist/types/components/switch/switch.d.ts +2 -5
  90. package/dist/types/components/textarea/textarea.d.ts +1 -1
  91. package/dist/types/shared/model.d.ts +1 -1
  92. package/dist/vscode.html-custom-data.json +35 -35
  93. package/dist/web-types.json +71 -72
  94. package/package.json +4 -4
  95. package/dist/db-ux/p-11228e58.entry.js +0 -2
  96. package/dist/db-ux/p-11228e58.entry.js.map +0 -1
  97. package/dist/db-ux/p-3cd03681.entry.js +0 -2
  98. package/dist/db-ux/p-3cd03681.entry.js.map +0 -1
  99. package/dist/db-ux/p-a258be18.entry.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"names":["DBCustomSelectDropdown","constructor","hostRef","this","width","enableAttributePassing","element","customElementSelector","parent","closest","attributes","i","length","attr","item","name","startsWith","setAttribute","value","removeAttribute","isWebComponent","includes","replace","trim","currentClass","getAttribute","componentDidLoad","_ref","render","h","key","class","cls","className","ref","el","id","DBCustomSelectList","role","multiple","label","DBCustomSelectListItem","_id","undefined","hasDivider","handleChange","event","stopPropagation","change","emit","getIconAfter","isGroupTitle","type","getBoolean","checked","watch0Fn","Boolean","showDivider","watch0","_a","uuid","getBooleanAsString","icon","getHideProp","showIcon","form","disabled","onChange","groupTitle","DBInput","_messageId","_validMessageId","_invalidMessageId","_invalidMessage","_dataListId","_descByIds","_value","_voiceOverFallback","hasValidState","validMessage","validation","handleValidation","validity","valid","invalidMessage","_b","validationMessage","DEFAULT_INVALID_MESSAGE","hasVoiceOver","delay","_c","required","minLength","maxLength","pattern","_d","DEFAULT_VALID_MESSAGE","stringPropVisible","message","showMessage","handleInput","input","handleBlur","blur","handleFocus","focus","getDataList","_list","dataList","Array","from","isArrayOfStrings","map","val","watch1Fn","messageId","DEFAULT_MESSAGE_ID_SUFFIX","DEFAULT_VALID_MESSAGE_ID_SUFFIX","DEFAULT_INVALID_MESSAGE_ID_SUFFIX","dataListId","DEFAULT_DATALIST_ID_SUFFIX","watch1","watch2Fn","watch2","mId","variant","showLabel","iconAfter","htmlFor","DEFAULT_LABEL","fieldSizing","placeholder","DEFAULT_PLACEHOLDER","showRequiredAsterisk","step","getNumber","maxlength","minlength","max","getInputValue","min","readOnly","readonly","size","autoComplete","autocomplete","autoFocus","autofocus","onInput","onBlur","onFocus","list","ariaDescribedBy","_e","option","messageIcon","semantic","DBTag","initialized","handleRemove","remove","getRemoveButtonText","removeButton","DEFAULT_REMOVE","button","querySelector","emphasis","showCheckState","noText","overflow","text","behavior","onClick"],"sources":["src/components/custom-select-dropdown/custom-select-dropdown.tsx","src/components/custom-select-list/custom-select-list.tsx","src/components/custom-select-list-item/custom-select-list-item.tsx","src/components/input/input.tsx","src/components/tag/tag.tsx"],"sourcesContent":["import { cls } from \"../../utils\";\nimport { DBCustomSelectDropdownProps } from \"./model\";\n\nimport { Component, h, Fragment, Prop } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-custom-select-dropdown\",\n})\nexport class DBCustomSelectDropdown {\n private _ref!: HTMLDivElement | any;\n @Prop() id: DBCustomSelectDropdownProps[\"id\"];\n @Prop({attribute: \"classname\"}) className: DBCustomSelectDropdownProps[\"className\"];\n @Prop() width: DBCustomSelectDropdownProps[\"width\"] = \"fixed\";\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-custom-select-dropdown\");\n }\n\n render() {\n return (\n <article\n class={cls(\"db-custom-select-dropdown db-card\", this.className)}\n data-spacing=\"none\"\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this.id}\n data-width={this.width}\n >\n <slot></slot>\n </article>\n );\n }\n}\n","import { cls } from \"../../utils\";\nimport { DBCustomSelectListProps } from \"./model\";\n\nimport { Component, h, Fragment, Prop } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-custom-select-list\",\n})\nexport class DBCustomSelectList {\n private _ref!: HTMLDivElement | any;\n @Prop() multiple: DBCustomSelectListProps[\"multiple\"];\n @Prop() label: DBCustomSelectListProps[\"label\"];\n @Prop() id: DBCustomSelectListProps[\"id\"];\n @Prop({attribute: \"classname\"}) className: DBCustomSelectListProps[\"className\"];\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-custom-select-list\");\n }\n\n render() {\n return (\n <div\n class={cls(\"db-custom-select-list\", this.className)}\n role={this.multiple ? \"group\" : \"radiogroup\"}\n aria-label={this.label}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this.id}\n >\n <ul>\n <slot></slot>\n </ul>\n </div>\n );\n }\n}\n","import { ChangeEvent } from \"../../shared/model\";\nimport {\n cls,\n getBoolean,\n getBooleanAsString,\n getHideProp,\n uuid,\n} from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport {\n DBCustomSelectListItemProps,\n DBCustomSelectListItemState,\n} from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-custom-select-list-item\",\n})\nexport class DBCustomSelectListItem {\n private _ref!: HTMLLIElement | any;\n @Prop() id: DBCustomSelectListItemProps[\"id\"];\n @Prop() isGroupTitle: DBCustomSelectListItemProps[\"isGroupTitle\"];\n @Prop() showDivider: DBCustomSelectListItemProps[\"showDivider\"];\n @Event() change: EventEmitter<\n Parameters<Required<DBCustomSelectListItemProps>[\"onChange\"]>[number]\n > | void;\n @Prop() type: DBCustomSelectListItemProps[\"type\"];\n @Prop() checked: DBCustomSelectListItemProps[\"checked\"];\n @Prop({attribute: \"classname\"}) className: DBCustomSelectListItemProps[\"className\"];\n @Prop() groupTitle: DBCustomSelectListItemProps[\"groupTitle\"];\n @Prop() icon: DBCustomSelectListItemProps[\"icon\"];\n @Prop() showIcon: DBCustomSelectListItemProps[\"showIcon\"];\n @Prop() name: DBCustomSelectListItemProps[\"name\"];\n @Prop() disabled: DBCustomSelectListItemProps[\"disabled\"];\n @Prop() value: DBCustomSelectListItemProps[\"value\"];\n @Prop() label: DBCustomSelectListItemProps[\"label\"];\n @State() _id = undefined;\n @State() hasDivider = false;\n\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n event.stopPropagation();\n if (this.change) {\n this.change.emit(event);\n }\n }\n getIconAfter() {\n if (this.isGroupTitle || this.type === \"checkbox\") {\n return;\n }\n return getBoolean(this.checked, \"checked\") ? \"check\" : \"x_placeholder\";\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this.hasDivider = Boolean(this.isGroupTitle || this.showDivider);\n }\n\n @Watch(\"isGroupTitle\")\n @Watch(\"showDivider\")\n watch0() {\n this.watch0Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-custom-select-list-item\");\n this._id = this.id ?? `custom-select-list-item-${uuid()}`;\n this.watch0Fn();\n }\n\n render() {\n return (\n <li\n class={cls(\"db-custom-select-list-item\", this.className, {\n \"db-checkbox\": this.type === \"checkbox\" && !this.isGroupTitle,\n \"db-radio\": this.type !== \"checkbox\" && !this.isGroupTitle,\n })}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-divider={getBooleanAsString(this.hasDivider)}\n >\n {!this.isGroupTitle ? (\n <label\n data-icon={\n this.type !== \"checkbox\" && this.icon ? this.icon : undefined\n }\n data-hide-icon={getHideProp(this.showIcon)}\n data-icon-after={this.getIconAfter()}\n >\n <input\n class=\"db-custom-select-list-item-checkbox\"\n data-disable-focus=\"true\"\n type={this.type}\n name={this.name}\n form={this.name}\n checked={getBoolean(this.checked, \"checked\")}\n disabled={getBoolean(this.disabled, \"disabled\")}\n value={this.value}\n onChange={(event) => this.handleChange(event)}\n />\n {this.label ? this.label : <slot></slot>}\n </label>\n ) : (\n <span>{this.groupTitle}</span>\n )}\n </li>\n );\n }\n}\n","import {\n DEFAULT_DATALIST_ID_SUFFIX,\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport {\n ChangeEvent,\n InputEvent,\n InteractionEvent,\n ValueLabelType,\n} from \"../../shared/model\";\nimport {\n cls,\n delay,\n getBoolean,\n getHideProp,\n getInputValue,\n getNumber,\n hasVoiceOver,\n isArrayOfStrings,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport { DBInputProps, DBInputState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-input\",\n})\nexport class DBInput {\n private _ref!: HTMLInputElement | any;\n @Prop() id: DBInputProps[\"id\"];\n @Prop() invalidMessage: DBInputProps[\"invalidMessage\"];\n @Prop() dataListId: DBInputProps[\"dataListId\"];\n @Prop() message: DBInputProps[\"message\"];\n @Prop() showMessage: DBInputProps[\"showMessage\"];\n @Prop() value: DBInputProps[\"value\"];\n @Prop() validMessage: DBInputProps[\"validMessage\"];\n @Prop() validation: DBInputProps[\"validation\"];\n @Prop() required: DBInputProps[\"required\"];\n @Prop() minLength: DBInputProps[\"minLength\"];\n @Prop() maxLength: DBInputProps[\"maxLength\"];\n @Prop() pattern: DBInputProps[\"pattern\"];\n @Event() input: EventEmitter<\n Parameters<Required<DBInputProps>[\"onInput\"]>[number]\n > | void;\n @Event() change: EventEmitter<\n Parameters<Required<DBInputProps>[\"onChange\"]>[number]\n > | void;\n @Event() blur: EventEmitter<\n Parameters<Required<DBInputProps>[\"onBlur\"]>[number]\n > | void;\n @Event() focus: EventEmitter<\n Parameters<Required<DBInputProps>[\"onFocus\"]>[number]\n > | void;\n @Prop() dataList: DBInputProps[\"dataList\"];\n @Prop({attribute: \"classname\"}) className: DBInputProps[\"className\"];\n @Prop() variant: DBInputProps[\"variant\"];\n @Prop() showLabel: DBInputProps[\"showLabel\"];\n @Prop() showIcon: DBInputProps[\"showIcon\"];\n @Prop() icon: DBInputProps[\"icon\"];\n @Prop() iconAfter: DBInputProps[\"iconAfter\"];\n @Prop() label: DBInputProps[\"label\"];\n @Prop() fieldSizing: DBInputProps[\"fieldSizing\"];\n @Prop() name: DBInputProps[\"name\"];\n @Prop() type: DBInputProps[\"type\"];\n @Prop() placeholder: DBInputProps[\"placeholder\"];\n @Prop() disabled: DBInputProps[\"disabled\"];\n @Prop() showRequiredAsterisk: DBInputProps[\"showRequiredAsterisk\"];\n @Prop() step: DBInputProps[\"step\"];\n @Prop() maxlength: DBInputProps[\"maxlength\"];\n @Prop() minlength: DBInputProps[\"minlength\"];\n @Prop() max: DBInputProps[\"max\"];\n @Prop() min: DBInputProps[\"min\"];\n @Prop() readOnly: DBInputProps[\"readOnly\"];\n @Prop() readonly: DBInputProps[\"readonly\"];\n @Prop() form: DBInputProps[\"form\"];\n @Prop() size: DBInputProps[\"size\"];\n @Prop() autocomplete: DBInputProps[\"autocomplete\"];\n @Prop() autofocus: DBInputProps[\"autofocus\"];\n @Prop() ariaDescribedBy: DBInputProps[\"ariaDescribedBy\"];\n @Prop() messageIcon: DBInputProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _invalidMessage = undefined;\n @State() _dataListId = undefined;\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() _voiceOverFallback = \"\";\n\n hasValidState() {\n return !!(this.validMessage ?? this.validation === \"valid\");\n }\n handleValidation() {\n /* For a11y reasons we need to map the correct message with the input */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this._invalidMessage;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.hasValidState() &&\n this._ref?.validity.valid &&\n (this.required || this.minLength || this.maxLength || this.pattern)\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleInput(event: InputEvent<HTMLInputElement>) {\n if (this.input) {\n this.input.emit(event);\n }\n this.handleValidation();\n }\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (this.change) {\n this.change.emit(event);\n }\n this.handleValidation();\n }\n handleBlur(event: InteractionEvent<HTMLInputElement> | any) {\n if (this.blur) {\n this.blur.emit(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLInputElement> | any) {\n if (this.focus) {\n this.focus.emit(event);\n }\n }\n getDataList() {\n const _list = this.dataList;\n return Array.from(\n (isArrayOfStrings(_list)\n ? _list?.map((val: string) => ({\n value: val,\n label: undefined,\n }))\n : _list) || []\n );\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLInputElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n }\n\n @Watch(\"_ref\")\n @Watch(\"invalidMessage\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._dataListId =\n this.dataListId ?? this._id + DEFAULT_DATALIST_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n }\n\n @Watch(\"_id\")\n watch1() {\n this.watch1Fn();\n }\n\n watch2Fn() {\n this._value = this.value;\n }\n\n @Watch(\"value\")\n watch2() {\n this.watch2Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-input\");\n const mId = this.id ?? `input-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._dataListId = mId + DEFAULT_DATALIST_ID_SUFFIX;\n this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;\n this.watch0Fn();\n this.watch1Fn();\n this.watch2Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-input\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n data-hide-icon={getHideProp(this.showIcon)}\n data-icon={this.icon}\n data-icon-after={this.iconAfter}\n data-hide-icon-after={getHideProp(this.showIcon)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <input\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n data-field-sizing={this.fieldSizing}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n name={this.name}\n type={this.type || \"text\"}\n placeholder={this.placeholder ?? DEFAULT_PLACEHOLDER}\n disabled={getBoolean(this.disabled, \"disabled\")}\n required={getBoolean(this.required, \"required\")}\n data-hide-asterisk={getHideProp(this.showRequiredAsterisk)}\n step={getNumber(this.step)}\n value={this.value ?? this._value}\n maxLength={getNumber(this.maxLength, this.maxlength)}\n minLength={getNumber(this.minLength, this.minlength)}\n max={getInputValue(this.max, this.type)}\n min={getInputValue(this.min, this.type)}\n readOnly={\n getBoolean(this.readOnly, \"readOnly\") ||\n getBoolean(this.readonly, \"readonly\")\n }\n form={this.form}\n pattern={this.pattern}\n size={this.size}\n autoComplete={this.autocomplete}\n autoFocus={getBoolean(this.autofocus, \"autofocus\")}\n onInput={(event) => this.handleInput(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n list={this.dataList && this._dataListId}\n aria-describedby={this.ariaDescribedBy ?? this._descByIds}\n />\n {this.dataList ? (\n <datalist id={this._dataListId}>\n {this.getDataList()?.map((option) => (\n <option\n key={this._dataListId + \"-option-\" + option.value}\n value={option.value}\n >\n {option.label}\n </option>\n ))}\n </datalist>\n ) : null}\n <slot></slot>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n {this.hasValidState() ? (\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage || DEFAULT_VALID_MESSAGE}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this._invalidMessage}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n","import { DEFAULT_REMOVE } from \"../../shared/constants\";\nimport { ClickEvent } from \"../../shared/model\";\nimport { cls, getBooleanAsString, getHideProp } from \"../../utils\";\nimport { DBTooltip } from \"../tooltip/tooltip\";\nimport { DBTagProps, DBTagState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n * @slot content - TODO: Add description for slotContent\n */\n @Component({\n tag: \"db-tag\",\n})\nexport class DBTag {\n private _ref!: HTMLDivElement | any;\n @Prop() disabled: DBTagProps[\"disabled\"];\n @Event() remove: EventEmitter<\n Parameters<Required<DBTagProps>[\"remove\"]>[number]\n > | void;\n @Prop() removeButton: DBTagProps[\"removeButton\"];\n @Prop() id: DBTagProps[\"id\"];\n @Prop({attribute: \"classname\"}) className: DBTagProps[\"className\"];\n @Prop() semantic: DBTagProps[\"semantic\"];\n @Prop() emphasis: DBTagProps[\"emphasis\"];\n @Prop() icon: DBTagProps[\"icon\"];\n @Prop() showCheckState: DBTagProps[\"showCheckState\"];\n @Prop() showIcon: DBTagProps[\"showIcon\"];\n @Prop() noText: DBTagProps[\"noText\"];\n @Prop() overflow: DBTagProps[\"overflow\"];\n @Prop() text: DBTagProps[\"text\"];\n @Prop() behavior: DBTagProps[\"behavior\"];\n @State() initialized = false;\n\n handleRemove(event?: ClickEvent<HTMLButtonElement> | void) {\n if (!event) return;\n event.stopPropagation();\n if (this.remove) {\n this.remove.emit(event);\n }\n }\n getRemoveButtonText() {\n if (this.removeButton) {\n return this.removeButton;\n }\n\n // TODO: We should think this through again, if we would really like to have default and especially english, instead of german labels in here\n return DEFAULT_REMOVE;\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n if (this.initialized && this._ref && this.disabled !== undefined) {\n const button: HTMLButtonElement | null = this._ref?.querySelector(\n \"button:not(.db-tab-remove-button)\"\n );\n const input: HTMLInputElement | null = this._ref?.querySelector(\"input\");\n for (const element of [button, input]) {\n if (element) {\n element.disabled = Boolean(this.disabled);\n }\n }\n }\n }\n\n @Watch(\"initialized\")\n @Watch(\"disabled\")\n @Watch(\"_ref\")\n watch0() {\n this.watch0Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-tag\");\n\n this.watch0Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-tag\", this.className)}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this.id}\n data-disabled={getBooleanAsString(this.disabled)}\n data-semantic={this.semantic}\n data-emphasis={this.emphasis}\n data-icon={this.icon}\n data-show-check-state={getBooleanAsString(this.showCheckState ?? true)}\n data-hide-icon={getHideProp(this.showIcon)}\n data-no-text={getBooleanAsString(this.noText)}\n data-overflow={getBooleanAsString(this.overflow)}\n >\n <slot name=\"content\"></slot>\n <slot></slot>\n {this.text ? this.text : null}\n {this.behavior === \"removable\" ? (\n <button\n class=\"db-button db-tab-remove-button\"\n data-icon=\"cross\"\n data-size=\"small\"\n data-no-text=\"true\"\n data-variant=\"ghost\"\n type=\"button\"\n onClick={(event) => this.handleRemove(event)}\n >\n <db-tooltip variant=\"label\">\n {this.getRemoveButtonText()}\n </db-tooltip>\n </button>\n ) : null}\n </div>\n );\n }\n}\n"],"mappings":"8PAaaA,EAAsB,MAHlC,WAAAC,CAAAC,G,UAOSC,KAAKC,MAAyC,OA6DvD,CAtDS,sBAAAC,CACNC,EACAC,GAEA,MAAMC,EAASF,IAAO,MAAPA,SAAO,SAAPA,EAASG,QAAQF,GAChC,GAAID,GAAWE,EAAQ,CACrB,MAAME,EAAaF,EAAOE,WAC1B,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAWE,OAAQD,IAAK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AAR,GACEvD,KAAKoD,U,CAGP,gBAAA7B,GACEvB,KAAKE,uBAAuBF,KAAKwB,KAAM,UAEvCxB,KAAKoD,U,CAGP,MAAA3B,G,MACE,OACEC,EACE,OAAAC,IAAA,2CAAAC,MAAOC,EAAI,SAAU7B,KAAK8B,WAC1BC,IAAMC,IACJhC,KAAKwB,KAAOQ,CAAE,EAEhBC,GAAIjC,KAAKiC,GACM,gBAAAyB,EAAmB1D,KAAK+D,UACxB,gBAAA/D,KAAKyJ,SACL,gBAAAzJ,KAAKmK,SACT,YAAAnK,KAAK2D,KACO,wBAAAD,GAAmBF,EAAAxD,KAAKoK,kBAAkB,MAAA5G,SAAA,EAAAA,EAAA,MAAK,iBACtDI,EAAY5D,KAAK6D,UAAS,eAC5BH,EAAmB1D,KAAKqK,QACvB,gBAAA3G,EAAmB1D,KAAKsK,WAEvC5I,EAAM,QAAAC,IAAA,2CAAAf,KAAK,YACXc,EAAa,QAAAC,IAAA,6CACZ3B,KAAKuK,KAAOvK,KAAKuK,KAAO,KACxBvK,KAAKwK,WAAa,YACjB9I,EACE,UAAAE,MAAM,iCAAgC,YAC5B,QAAO,YACP,QACG,sBACA,uBACbqB,KAAK,SACLwH,QAAU9H,GAAU3C,KAAK4J,aAAajH,IAEtCjB,EAAA,cAAYgG,QAAQ,SACjB1H,KAAK8J,wBAGR,K","ignoreList":[]}
1
+ {"version":3,"names":["DBCustomSelectDropdown","constructor","hostRef","this","width","enableAttributePassing","element","customElementSelector","parent","closest","attributes","i","length","attr","item","name","startsWith","setAttribute","value","removeAttribute","isWebComponent","includes","replace","trim","currentClass","getAttribute","componentDidLoad","_ref","render","h","key","class","cls","className","ref","el","id","DBCustomSelectList","role","multiple","label","DBCustomSelectListItem","_id","undefined","hasDivider","handleChange","event","stopPropagation","change","emit","getIconAfter","isGroupTitle","type","getBoolean","checked","watch0Fn","Boolean","showDivider","watch0","_a","uuid","getBooleanAsString","icon","getHideProp","showIcon","form","disabled","onChange","groupTitle","DBInput","_messageId","_validMessageId","_invalidMessageId","_invalidMessage","_dataListId","_descByIds","_value","_voiceOverFallback","hasValidState","validMessage","validation","handleValidation","validity","valid","invalidMessage","_b","validationMessage","DEFAULT_INVALID_MESSAGE","hasVoiceOver","delay","_c","required","minLength","maxLength","pattern","_d","DEFAULT_VALID_MESSAGE","stringPropVisible","message","showMessage","handleInput","input","handleBlur","blur","handleFocus","focus","getDataList","_list","dataList","Array","from","isArrayOfStrings","map","val","watch1Fn","messageId","DEFAULT_MESSAGE_ID_SUFFIX","DEFAULT_VALID_MESSAGE_ID_SUFFIX","DEFAULT_INVALID_MESSAGE_ID_SUFFIX","dataListId","DEFAULT_DATALIST_ID_SUFFIX","watch1","watch2Fn","watch2","mId","variant","showLabel","iconAfter","showRequiredAsterisk","htmlFor","DEFAULT_LABEL","fieldSizing","placeholder","DEFAULT_PLACEHOLDER","step","getNumber","maxlength","minlength","max","getInputValue","min","readOnly","readonly","size","autoComplete","autocomplete","autoFocus","autofocus","onInput","onBlur","onFocus","list","ariaDescribedBy","_e","option","messageIcon","semantic","DBTag","initialized","handleRemove","remove","getRemoveButtonText","removeButton","DEFAULT_REMOVE","button","querySelector","emphasis","showCheckState","noText","overflow","text","behavior","onClick"],"sources":["src/components/custom-select-dropdown/custom-select-dropdown.tsx","src/components/custom-select-list/custom-select-list.tsx","src/components/custom-select-list-item/custom-select-list-item.tsx","src/components/input/input.tsx","src/components/tag/tag.tsx"],"sourcesContent":["import { cls } from \"../../utils\";\nimport { DBCustomSelectDropdownProps } from \"./model\";\n\nimport { Component, h, Fragment, Prop } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-custom-select-dropdown\",\n})\nexport class DBCustomSelectDropdown {\n private _ref!: HTMLDivElement | any;\n @Prop() id: DBCustomSelectDropdownProps[\"id\"];\n @Prop({attribute: \"classname\"}) className: DBCustomSelectDropdownProps[\"className\"];\n @Prop() width: DBCustomSelectDropdownProps[\"width\"] = \"fixed\";\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-custom-select-dropdown\");\n }\n\n render() {\n return (\n <article\n class={cls(\"db-custom-select-dropdown db-card\", this.className)}\n data-spacing=\"none\"\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this.id}\n data-width={this.width}\n >\n <slot></slot>\n </article>\n );\n }\n}\n","import { cls } from \"../../utils\";\nimport { DBCustomSelectListProps } from \"./model\";\n\nimport { Component, h, Fragment, Prop } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-custom-select-list\",\n})\nexport class DBCustomSelectList {\n private _ref!: HTMLDivElement | any;\n @Prop() multiple: DBCustomSelectListProps[\"multiple\"];\n @Prop() label: DBCustomSelectListProps[\"label\"];\n @Prop() id: DBCustomSelectListProps[\"id\"];\n @Prop({attribute: \"classname\"}) className: DBCustomSelectListProps[\"className\"];\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-custom-select-list\");\n }\n\n render() {\n return (\n <div\n class={cls(\"db-custom-select-list\", this.className)}\n role={this.multiple ? \"group\" : \"radiogroup\"}\n aria-label={this.label}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this.id}\n >\n <ul>\n <slot></slot>\n </ul>\n </div>\n );\n }\n}\n","import { ChangeEvent } from \"../../shared/model\";\nimport {\n cls,\n getBoolean,\n getBooleanAsString,\n getHideProp,\n uuid,\n} from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport {\n DBCustomSelectListItemProps,\n DBCustomSelectListItemState,\n} from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-custom-select-list-item\",\n})\nexport class DBCustomSelectListItem {\n private _ref!: HTMLLIElement | any;\n @Prop() id: DBCustomSelectListItemProps[\"id\"];\n @Prop() isGroupTitle: DBCustomSelectListItemProps[\"isGroupTitle\"];\n @Prop() showDivider: DBCustomSelectListItemProps[\"showDivider\"];\n @Event() change: EventEmitter<\n Parameters<Required<DBCustomSelectListItemProps>[\"onChange\"]>[number]\n > | void;\n @Prop() type: DBCustomSelectListItemProps[\"type\"];\n @Prop() checked: DBCustomSelectListItemProps[\"checked\"];\n @Prop({attribute: \"classname\"}) className: DBCustomSelectListItemProps[\"className\"];\n @Prop() groupTitle: DBCustomSelectListItemProps[\"groupTitle\"];\n @Prop() icon: DBCustomSelectListItemProps[\"icon\"];\n @Prop() showIcon: DBCustomSelectListItemProps[\"showIcon\"];\n @Prop() name: DBCustomSelectListItemProps[\"name\"];\n @Prop() disabled: DBCustomSelectListItemProps[\"disabled\"];\n @Prop() value: DBCustomSelectListItemProps[\"value\"];\n @Prop() label: DBCustomSelectListItemProps[\"label\"];\n @State() _id = undefined;\n @State() hasDivider = false;\n\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n event.stopPropagation();\n if (this.change) {\n this.change.emit(event);\n }\n }\n getIconAfter() {\n if (this.isGroupTitle || this.type === \"checkbox\") {\n return;\n }\n return getBoolean(this.checked, \"checked\") ? \"check\" : \"x_placeholder\";\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this.hasDivider = Boolean(this.isGroupTitle || this.showDivider);\n }\n\n @Watch(\"isGroupTitle\")\n @Watch(\"showDivider\")\n watch0() {\n this.watch0Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-custom-select-list-item\");\n this._id = this.id ?? `custom-select-list-item-${uuid()}`;\n this.watch0Fn();\n }\n\n render() {\n return (\n <li\n class={cls(\"db-custom-select-list-item\", this.className, {\n \"db-checkbox\": this.type === \"checkbox\" && !this.isGroupTitle,\n \"db-radio\": this.type !== \"checkbox\" && !this.isGroupTitle,\n })}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-divider={getBooleanAsString(this.hasDivider)}\n >\n {!this.isGroupTitle ? (\n <label\n data-icon={\n this.type !== \"checkbox\" && this.icon ? this.icon : undefined\n }\n data-hide-icon={getHideProp(this.showIcon)}\n data-icon-after={this.getIconAfter()}\n >\n <input\n class=\"db-custom-select-list-item-checkbox\"\n data-disable-focus=\"true\"\n type={this.type}\n name={this.name}\n form={this.name}\n checked={getBoolean(this.checked, \"checked\")}\n disabled={getBoolean(this.disabled, \"disabled\")}\n value={this.value}\n onChange={(event) => this.handleChange(event)}\n />\n {this.label ? this.label : <slot></slot>}\n </label>\n ) : (\n <span>{this.groupTitle}</span>\n )}\n </li>\n );\n }\n}\n","import {\n DEFAULT_DATALIST_ID_SUFFIX,\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport {\n ChangeEvent,\n InputEvent,\n InteractionEvent,\n ValueLabelType,\n} from \"../../shared/model\";\nimport {\n cls,\n delay,\n getBoolean,\n getHideProp,\n getInputValue,\n getNumber,\n hasVoiceOver,\n isArrayOfStrings,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport { DBInputProps, DBInputState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-input\",\n})\nexport class DBInput {\n private _ref!: HTMLInputElement | any;\n @Prop() id: DBInputProps[\"id\"];\n @Prop() invalidMessage: DBInputProps[\"invalidMessage\"];\n @Prop() dataListId: DBInputProps[\"dataListId\"];\n @Prop() message: DBInputProps[\"message\"];\n @Prop() showMessage: DBInputProps[\"showMessage\"];\n @Prop() value: DBInputProps[\"value\"];\n @Prop() validMessage: DBInputProps[\"validMessage\"];\n @Prop() validation: DBInputProps[\"validation\"];\n @Prop() required: DBInputProps[\"required\"];\n @Prop() minLength: DBInputProps[\"minLength\"];\n @Prop() maxLength: DBInputProps[\"maxLength\"];\n @Prop() pattern: DBInputProps[\"pattern\"];\n @Event() input: EventEmitter<\n Parameters<Required<DBInputProps>[\"onInput\"]>[number]\n > | void;\n @Event() change: EventEmitter<\n Parameters<Required<DBInputProps>[\"onChange\"]>[number]\n > | void;\n @Event() blur: EventEmitter<\n Parameters<Required<DBInputProps>[\"onBlur\"]>[number]\n > | void;\n @Event() focus: EventEmitter<\n Parameters<Required<DBInputProps>[\"onFocus\"]>[number]\n > | void;\n @Prop() dataList: DBInputProps[\"dataList\"];\n @Prop({attribute: \"classname\"}) className: DBInputProps[\"className\"];\n @Prop() variant: DBInputProps[\"variant\"];\n @Prop() showLabel: DBInputProps[\"showLabel\"];\n @Prop() showIcon: DBInputProps[\"showIcon\"];\n @Prop() icon: DBInputProps[\"icon\"];\n @Prop() iconAfter: DBInputProps[\"iconAfter\"];\n @Prop() showRequiredAsterisk: DBInputProps[\"showRequiredAsterisk\"];\n @Prop() label: DBInputProps[\"label\"];\n @Prop() fieldSizing: DBInputProps[\"fieldSizing\"];\n @Prop() name: DBInputProps[\"name\"];\n @Prop() type: DBInputProps[\"type\"];\n @Prop() placeholder: DBInputProps[\"placeholder\"];\n @Prop() disabled: DBInputProps[\"disabled\"];\n @Prop() step: DBInputProps[\"step\"];\n @Prop() maxlength: DBInputProps[\"maxlength\"];\n @Prop() minlength: DBInputProps[\"minlength\"];\n @Prop() max: DBInputProps[\"max\"];\n @Prop() min: DBInputProps[\"min\"];\n @Prop() readOnly: DBInputProps[\"readOnly\"];\n @Prop() readonly: DBInputProps[\"readonly\"];\n @Prop() form: DBInputProps[\"form\"];\n @Prop() size: DBInputProps[\"size\"];\n @Prop() autocomplete: DBInputProps[\"autocomplete\"];\n @Prop() autofocus: DBInputProps[\"autofocus\"];\n @Prop() ariaDescribedBy: DBInputProps[\"ariaDescribedBy\"];\n @Prop() messageIcon: DBInputProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _invalidMessage = undefined;\n @State() _dataListId = undefined;\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() _voiceOverFallback = \"\";\n\n hasValidState() {\n return !!(this.validMessage ?? this.validation === \"valid\");\n }\n handleValidation() {\n /* For a11y reasons we need to map the correct message with the input */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this._invalidMessage;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.hasValidState() &&\n this._ref?.validity.valid &&\n (this.required || this.minLength || this.maxLength || this.pattern)\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleInput(event: InputEvent<HTMLInputElement>) {\n if (this.input) {\n this.input.emit(event);\n }\n this.handleValidation();\n }\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (this.change) {\n this.change.emit(event);\n }\n this.handleValidation();\n }\n handleBlur(event: InteractionEvent<HTMLInputElement> | any) {\n if (this.blur) {\n this.blur.emit(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLInputElement> | any) {\n if (this.focus) {\n this.focus.emit(event);\n }\n }\n getDataList() {\n const _list = this.dataList;\n return Array.from(\n (isArrayOfStrings(_list)\n ? _list?.map((val: string) => ({\n value: val,\n label: undefined,\n }))\n : _list) || []\n );\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLInputElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n }\n\n @Watch(\"_ref\")\n @Watch(\"invalidMessage\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._dataListId =\n this.dataListId ?? this._id + DEFAULT_DATALIST_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n }\n\n @Watch(\"_id\")\n watch1() {\n this.watch1Fn();\n }\n\n watch2Fn() {\n this._value = this.value;\n }\n\n @Watch(\"value\")\n watch2() {\n this.watch2Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-input\");\n const mId = this.id ?? `input-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._dataListId = mId + DEFAULT_DATALIST_ID_SUFFIX;\n this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;\n this.watch0Fn();\n this.watch1Fn();\n this.watch2Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-input\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n data-hide-icon={getHideProp(this.showIcon)}\n data-icon={this.icon}\n data-icon-after={this.iconAfter}\n data-hide-asterisk={getHideProp(this.showRequiredAsterisk)}\n data-hide-icon-after={getHideProp(this.showIcon)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <input\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n data-field-sizing={this.fieldSizing}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n name={this.name}\n type={this.type || \"text\"}\n placeholder={this.placeholder ?? DEFAULT_PLACEHOLDER}\n disabled={getBoolean(this.disabled, \"disabled\")}\n required={getBoolean(this.required, \"required\")}\n step={getNumber(this.step)}\n value={this.value ?? this._value}\n maxLength={getNumber(this.maxLength, this.maxlength)}\n minLength={getNumber(this.minLength, this.minlength)}\n max={getInputValue(this.max, this.type)}\n min={getInputValue(this.min, this.type)}\n readOnly={\n getBoolean(this.readOnly, \"readOnly\") ||\n getBoolean(this.readonly, \"readonly\")\n }\n form={this.form}\n pattern={this.pattern}\n size={this.size}\n autoComplete={this.autocomplete}\n autoFocus={getBoolean(this.autofocus, \"autofocus\")}\n onInput={(event) => this.handleInput(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n list={this.dataList && this._dataListId}\n aria-describedby={this.ariaDescribedBy ?? this._descByIds}\n />\n {this.dataList ? (\n <datalist id={this._dataListId}>\n {this.getDataList()?.map((option) => (\n <option\n key={this._dataListId + \"-option-\" + option.value}\n value={option.value}\n >\n {option.label}\n </option>\n ))}\n </datalist>\n ) : null}\n <slot></slot>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n {this.hasValidState() ? (\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage || DEFAULT_VALID_MESSAGE}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this._invalidMessage}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n","import { DEFAULT_REMOVE } from \"../../shared/constants\";\nimport { ClickEvent } from \"../../shared/model\";\nimport { cls, getBooleanAsString, getHideProp } from \"../../utils\";\nimport { DBTooltip } from \"../tooltip/tooltip\";\nimport { DBTagProps, DBTagState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n * @slot content - TODO: Add description for slotContent\n */\n @Component({\n tag: \"db-tag\",\n})\nexport class DBTag {\n private _ref!: HTMLDivElement | any;\n @Prop() disabled: DBTagProps[\"disabled\"];\n @Event() remove: EventEmitter<\n Parameters<Required<DBTagProps>[\"remove\"]>[number]\n > | void;\n @Prop() removeButton: DBTagProps[\"removeButton\"];\n @Prop() id: DBTagProps[\"id\"];\n @Prop({attribute: \"classname\"}) className: DBTagProps[\"className\"];\n @Prop() semantic: DBTagProps[\"semantic\"];\n @Prop() emphasis: DBTagProps[\"emphasis\"];\n @Prop() icon: DBTagProps[\"icon\"];\n @Prop() showCheckState: DBTagProps[\"showCheckState\"];\n @Prop() showIcon: DBTagProps[\"showIcon\"];\n @Prop() noText: DBTagProps[\"noText\"];\n @Prop() overflow: DBTagProps[\"overflow\"];\n @Prop() text: DBTagProps[\"text\"];\n @Prop() behavior: DBTagProps[\"behavior\"];\n @State() initialized = false;\n\n handleRemove(event?: ClickEvent<HTMLButtonElement> | void) {\n if (!event) return;\n event.stopPropagation();\n if (this.remove) {\n this.remove.emit(event);\n }\n }\n getRemoveButtonText() {\n if (this.removeButton) {\n return this.removeButton;\n }\n\n // TODO: We should think this through again, if we would really like to have default and especially english, instead of german labels in here\n return DEFAULT_REMOVE;\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n if (this.initialized && this._ref && this.disabled !== undefined) {\n const button: HTMLButtonElement | null = this._ref?.querySelector(\n \"button:not(.db-tab-remove-button)\"\n );\n const input: HTMLInputElement | null = this._ref?.querySelector(\"input\");\n for (const element of [button, input]) {\n if (element) {\n element.disabled = Boolean(this.disabled);\n }\n }\n }\n }\n\n @Watch(\"initialized\")\n @Watch(\"disabled\")\n @Watch(\"_ref\")\n watch0() {\n this.watch0Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-tag\");\n\n this.watch0Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-tag\", this.className)}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this.id}\n data-disabled={getBooleanAsString(this.disabled)}\n data-semantic={this.semantic}\n data-emphasis={this.emphasis}\n data-icon={this.icon}\n data-show-check-state={getBooleanAsString(this.showCheckState ?? true)}\n data-hide-icon={getHideProp(this.showIcon)}\n data-no-text={getBooleanAsString(this.noText)}\n data-overflow={getBooleanAsString(this.overflow)}\n >\n <slot name=\"content\"></slot>\n <slot></slot>\n {this.text ? this.text : null}\n {this.behavior === \"removable\" ? (\n <button\n class=\"db-button db-tab-remove-button\"\n data-icon=\"cross\"\n data-size=\"small\"\n data-no-text=\"true\"\n data-variant=\"ghost\"\n type=\"button\"\n onClick={(event) => this.handleRemove(event)}\n >\n <db-tooltip variant=\"label\">\n {this.getRemoveButtonText()}\n </db-tooltip>\n </button>\n ) : null}\n </div>\n );\n }\n}\n"],"mappings":"8PAaaA,EAAsB,MAHlC,WAAAC,CAAAC,G,UAOSC,KAAKC,MAAyC,OA6DvD,CAtDS,sBAAAC,CACNC,EACAC,GAEA,MAAMC,EAASF,IAAO,MAAPA,SAAO,SAAPA,EAASG,QAAQF,GAChC,GAAID,GAAWE,EAAQ,CACrB,MAAME,EAAaF,EAAOE,WAC1B,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAWE,OAAQD,IAAK,CAC1C,MAAME,EAAOH,EAAWI,KAAKH,GAC7B,GACEE,IACCA,EAAKE,KAAKC,WAAW,UAAYH,EAAKE,KAAKC,WAAW,UACvD,CACAV,EAAQW,aAAaJ,EAAKE,KAAMF,EAAKK,OACrCV,EAAOW,gBAAgBN,EAAKE,K,CAE9B,GAAIF,GAAQA,EAAKE,OAAS,QAAS,CACjC,MAAMK,EAAiBP,EAAKK,MAAMG,SAAS,YAC3C,MAAMH,EAAQL,EAAKK,MAAMI,QAAQ,WAAY,IAAIC,OACjD,MAAMC,EAAelB,EAAQmB,aAAa,SAC1CnB,EAAQW,aACNJ,EAAKE,KACL,GAAGS,EAAe,GAAGA,KAAkB,KAAKN,KAE9C,GAAIE,EAAgB,CAElBZ,EAAOS,aAAa,QAAS,W,KACxB,CACLT,EAAOW,gBAAgBN,EAAKE,K,KAOtC,gBAAAW,GACEvB,KAAKE,uBAAuBF,KAAKwB,KAAM,4B,CAGzC,MAAAC,GACE,OACEC,EAAA,WAAAC,IAAA,2CACEC,MAAOC,EAAI,oCAAqC7B,KAAK8B,WAAU,eAClD,OACbC,IAAMC,IACJhC,KAAKwB,KAAOQ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P,QACG,sBACA,uBACbqB,KAAK,SACLwH,QAAU9H,GAAU3C,KAAK4J,aAAajH,IAEtCjB,EAAA,cAAYgG,QAAQ,SACjB1H,KAAK8J,wBAGR,K","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as i,c as t,h as s,F as h}from"./p-CK6m6IJ4.js";import{l as a,g as e,h as d,f as l,i as n,k as o,a as c}from"./p-DC9V_oNU.js";import{h as u,d as r,s as f,u as v,b,j as p,c as m}from"./p-YECpAE3G.js";const y=class{constructor(s){i(this,s);this.click=t(this,"click");this.input=t(this,"input");this.change=t(this,"change");this.blur=t(this,"blur");this.focus=t(this,"focus");this._id=undefined;this._messageId=undefined;this._validMessageId=undefined;this._invalidMessageId=undefined;this._invalidMessage=undefined;this._placeholderId="";this._descByIds="";this._value="";this.initialized=false;this._voiceOverFallback=""}hasValidState(){var i;return!!((i=this.validMessage)!==null&&i!==void 0?i:this.validation==="valid")}handleValidation(){var i,t,s,h;if(!((i=this._ref)===null||i===void 0?void 0:i.validity.valid)||this.validation==="invalid"){this._descByIds=this._invalidMessageId;this._invalidMessage=this.invalidMessage||((t=this._ref)===null||t===void 0?void 0:t.validationMessage)||a;if(u()){this._voiceOverFallback=this._invalidMessage;r((()=>this._voiceOverFallback=""),1e3)}}else if(this.hasValidState()&&((s=this._ref)===null||s===void 0?void 0:s.validity.valid)&&this.required){this._descByIds=this._validMessageId;if(u()){this._voiceOverFallback=(h=this.validMessage)!==null&&h!==void 0?h:o;r((()=>this._voiceOverFallback=""),1e3)}}else if(f(this.message,this.showMessage)){this._descByIds=this._messageId}else{this._descByIds=this._placeholderId}}handleClick(i){if(this.click){this.click.emit(i)}}handleInput(i){if(this.input){this.input.emit(i)}this.handleValidation()}handleChange(i){if(this.change){this.change.emit(i)}this.handleValidation()}handleBlur(i){if(this.blur){this.blur.emit(i)}}handleFocus(i){if(this.focus){this.focus.emit(i)}}getOptionLabel(i){var t,s;return(t=i.label)!==null&&t!==void 0?t:(s=i.value)===null||s===void 0?void 0:s.toString()}enableAttributePassing(i,t){const s=i===null||i===void 0?void 0:i.closest(t);if(i&&s){const t=s.attributes;for(let h=0;h<t.length;h++){const a=t.item(h);if(a&&(a.name.startsWith("data-")||a.name.startsWith("aria-"))){i.setAttribute(a.name,a.value);s.removeAttribute(a.name)}if(a&&a.name==="class"){const t=a.value.includes("hydrated");const h=a.value.replace("hydrated","").trim();const e=i.getAttribute("class");i.setAttribute(a.name,`${e?`${e} `:""}${h}`);if(t){s.setAttribute("class","hydrated")}else{s.removeAttribute(a.name)}}}}}watch0Fn(){var i;this._invalidMessage=this.invalidMessage||((i=this._ref)===null||i===void 0?void 0:i.validationMessage)||a}watch0(){this.watch0Fn()}watch1Fn(){if(this._id&&this.initialized){const i=this._id+l;const t=this._id+n;this._messageId=i;this._validMessageId=this._id+e;this._invalidMessageId=this._id+d;this._placeholderId=t;if(f(this.message,this.showMessage)){this._descByIds=i}else{this._descByIds=t}this.initialized=false}}watch1(){this.watch1Fn()}watch2Fn(){this._value=this.value}watch2(){this.watch2Fn()}componentDidLoad(){var i;this.enableAttributePassing(this._ref,"db-select");this.initialized=true;const t=(i=this.id)!==null&&i!==void 0?i:`select-${v()}`;this._id=t;this._messageId=t+l;this._validMessageId=t+e;this._invalidMessageId=t+d;this._placeholderId=t+n;this._invalidMessage=this.invalidMessage||a;this.watch0Fn();this.watch1Fn();this.watch2Fn()}render(){var i,t,a,e,d,l;return s("div",{key:"8c7536566f068aad9a6c3648bf2ca2f140080d72",class:m("db-select",this.className),"data-variant":this.variant,"data-hide-label":p(this.showLabel),"data-icon":this.icon,"data-hide-icon":p(this.showIcon)},s("label",{key:"941d1a745368e5630fe13facb5966285cf038dde",htmlFor:this._id},(i=this.label)!==null&&i!==void 0?i:c),s("select",{key:"4ab4802a667376373885f606c7fc7883dd3b958f","aria-invalid":this.validation==="invalid","data-custom-validity":this.validation,ref:i=>{this._ref=i},required:b(this.required,"required"),"data-hide-asterisk":p(this.showRequiredAsterisk),disabled:b(this.disabled,"disabled"),id:this._id,name:this.name,size:this.size,value:(t=this.value)!==null&&t!==void 0?t:this._value,autocomplete:this.autocomplete,multiple:this.multiple,onInput:i=>this.handleInput(i),onClick:i=>this.handleClick(i),onChange:i=>this.handleChange(i),onBlur:i=>this.handleBlur(i),onFocus:i=>this.handleFocus(i),"aria-describedby":(a=this.ariaDescribedBy)!==null&&a!==void 0?a:this._descByIds},s("option",{key:"73cc18a0540c9e1021e6b8643aa1d5739ee227ac",hidden:true}),((e=this.options)===null||e===void 0?void 0:e.length)?(d=this.options)===null||d===void 0?void 0:d.map((i=>{var t;return s(h,null,i.options?s("optgroup",{label:this.getOptionLabel(i),key:undefined},(t=i.options)===null||t===void 0?void 0:t.map((i=>s("option",{value:i.value,selected:i.selected,disabled:i.disabled,key:undefined},this.getOptionLabel(i))))):s("option",{value:i.value,disabled:i.disabled,selected:i.selected,key:undefined},this.getOptionLabel(i)))})):s("slot",null)),s("span",{key:"b463c1196682ce2e01221e482fb04b677af5f9ba",id:this._placeholderId},(l=this.placeholder)!==null&&l!==void 0?l:this.label),f(this.message,this.showMessage)?s("db-infotext",{size:"small",icon:this.messageIcon,id:this._messageId},this.message):null,this.hasValidState()?s("db-infotext",{size:"small",semantic:"successful",id:this._validMessageId},this.validMessage||o):null,s("db-infotext",{key:"d676a7e8123761dd6106ba7d7d6c9ac9c1a99c06",size:"small",semantic:"critical",id:this._invalidMessageId},this._invalidMessage),s("span",{key:"59042ea13d38c24dda27986f2ac7f6db1a808506","data-visually-hidden":"true",role:"status"},this._voiceOverFallback))}static get watchers(){return{_ref:["watch0"],invalidMessage:["watch0"],_id:["watch1"],initialized:["watch1"],value:["watch2"]}}};export{y as db_select};
2
- //# sourceMappingURL=p-2f87bffd.entry.js.map
1
+ import{r as i,c as t,h as s,F as h}from"./p-CK6m6IJ4.js";import{l as e,g as a,h as d,f as l,i as n,k as c,a as o}from"./p-DC9V_oNU.js";import{h as u,d as f,s as r,u as v,b,j as p,c as m}from"./p-YECpAE3G.js";const y=class{constructor(s){i(this,s);this.click=t(this,"click");this.input=t(this,"input");this.change=t(this,"change");this.blur=t(this,"blur");this.focus=t(this,"focus");this._id=undefined;this._messageId=undefined;this._validMessageId=undefined;this._invalidMessageId=undefined;this._invalidMessage=undefined;this._placeholderId="";this._descByIds="";this._value="";this.initialized=false;this._voiceOverFallback=""}hasValidState(){var i;return!!((i=this.validMessage)!==null&&i!==void 0?i:this.validation==="valid")}handleValidation(){var i,t,s,h;if(!((i=this._ref)===null||i===void 0?void 0:i.validity.valid)||this.validation==="invalid"){this._descByIds=this._invalidMessageId;this._invalidMessage=this.invalidMessage||((t=this._ref)===null||t===void 0?void 0:t.validationMessage)||e;if(u()){this._voiceOverFallback=this._invalidMessage;f((()=>this._voiceOverFallback=""),1e3)}}else if(this.hasValidState()&&((s=this._ref)===null||s===void 0?void 0:s.validity.valid)&&this.required){this._descByIds=this._validMessageId;if(u()){this._voiceOverFallback=(h=this.validMessage)!==null&&h!==void 0?h:c;f((()=>this._voiceOverFallback=""),1e3)}}else if(r(this.message,this.showMessage)){this._descByIds=this._messageId}else{this._descByIds=this._placeholderId}}handleClick(i){if(this.click){this.click.emit(i)}}handleInput(i){if(this.input){this.input.emit(i)}this.handleValidation()}handleChange(i){if(this.change){this.change.emit(i)}this.handleValidation()}handleBlur(i){if(this.blur){this.blur.emit(i)}}handleFocus(i){if(this.focus){this.focus.emit(i)}}getOptionLabel(i){var t,s;return(t=i.label)!==null&&t!==void 0?t:(s=i.value)===null||s===void 0?void 0:s.toString()}enableAttributePassing(i,t){const s=i===null||i===void 0?void 0:i.closest(t);if(i&&s){const t=s.attributes;for(let h=0;h<t.length;h++){const e=t.item(h);if(e&&(e.name.startsWith("data-")||e.name.startsWith("aria-"))){i.setAttribute(e.name,e.value);s.removeAttribute(e.name)}if(e&&e.name==="class"){const t=e.value.includes("hydrated");const h=e.value.replace("hydrated","").trim();const a=i.getAttribute("class");i.setAttribute(e.name,`${a?`${a} `:""}${h}`);if(t){s.setAttribute("class","hydrated")}else{s.removeAttribute(e.name)}}}}}watch0Fn(){var i;this._invalidMessage=this.invalidMessage||((i=this._ref)===null||i===void 0?void 0:i.validationMessage)||e}watch0(){this.watch0Fn()}watch1Fn(){if(this._id&&this.initialized){const i=this._id+l;const t=this._id+n;this._messageId=i;this._validMessageId=this._id+a;this._invalidMessageId=this._id+d;this._placeholderId=t;if(r(this.message,this.showMessage)){this._descByIds=i}else{this._descByIds=t}this.initialized=false}}watch1(){this.watch1Fn()}watch2Fn(){this._value=this.value}watch2(){this.watch2Fn()}componentDidLoad(){var i;this.enableAttributePassing(this._ref,"db-select");this.initialized=true;const t=(i=this.id)!==null&&i!==void 0?i:`select-${v()}`;this._id=t;this._messageId=t+l;this._validMessageId=t+a;this._invalidMessageId=t+d;this._placeholderId=t+n;this._invalidMessage=this.invalidMessage||e;this.watch0Fn();this.watch1Fn();this.watch2Fn()}render(){var i,t,e,a,d,l;return s("div",{key:"c55fdccdd060f36e19a34f1bcfc569bf6f4917ed",class:m("db-select",this.className),"data-variant":this.variant,"data-hide-label":p(this.showLabel),"data-hide-asterisk":p(this.showRequiredAsterisk),"data-icon":this.icon,"data-hide-icon":p(this.showIcon)},s("label",{key:"c424b175cb5d4f7e7cc14ab29cfa67576684a115",htmlFor:this._id},(i=this.label)!==null&&i!==void 0?i:o),s("select",{key:"8386e3eb1fdceb1ffc9933c72f2b0f04938d1108","aria-invalid":this.validation==="invalid","data-custom-validity":this.validation,ref:i=>{this._ref=i},required:b(this.required,"required"),disabled:b(this.disabled,"disabled"),id:this._id,name:this.name,size:this.size,value:(t=this.value)!==null&&t!==void 0?t:this._value,autocomplete:this.autocomplete,multiple:this.multiple,onInput:i=>this.handleInput(i),onClick:i=>this.handleClick(i),onChange:i=>this.handleChange(i),onBlur:i=>this.handleBlur(i),onFocus:i=>this.handleFocus(i),"aria-describedby":(e=this.ariaDescribedBy)!==null&&e!==void 0?e:this._descByIds},s("option",{key:"c337ef04ac473d3cf00419d30c61cd38b4ca1ad6",hidden:true}),((a=this.options)===null||a===void 0?void 0:a.length)?(d=this.options)===null||d===void 0?void 0:d.map((i=>{var t;return s(h,null,i.options?s("optgroup",{label:this.getOptionLabel(i),key:undefined},(t=i.options)===null||t===void 0?void 0:t.map((i=>s("option",{value:i.value,selected:i.selected,disabled:i.disabled,key:undefined},this.getOptionLabel(i))))):s("option",{value:i.value,disabled:i.disabled,selected:i.selected,key:undefined},this.getOptionLabel(i)))})):s("slot",null)),s("span",{key:"13f3711cb31601dc4e2580fbd0e165a4902cf18f",id:this._placeholderId},(l=this.placeholder)!==null&&l!==void 0?l:this.label),r(this.message,this.showMessage)?s("db-infotext",{size:"small",icon:this.messageIcon,id:this._messageId},this.message):null,this.hasValidState()?s("db-infotext",{size:"small",semantic:"successful",id:this._validMessageId},this.validMessage||c):null,s("db-infotext",{key:"743f2051458556cd1f6d900415878ac83b615132",size:"small",semantic:"critical",id:this._invalidMessageId},this._invalidMessage),s("span",{key:"96a5cf7d9ba622214d63945bde23fe521aa73a09","data-visually-hidden":"true",role:"status"},this._voiceOverFallback))}static get watchers(){return{_ref:["watch0"],invalidMessage:["watch0"],_id:["watch1"],initialized:["watch1"],value:["watch2"]}}};export{y as db_select};
2
+ //# sourceMappingURL=p-7ee7a06d.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DBSelect","constructor","hostRef","this","_id","undefined","_messageId","_validMessageId","_invalidMessageId","_invalidMessage","_placeholderId","_descByIds","_value","initialized","_voiceOverFallback","hasValidState","_a","validMessage","validation","handleValidation","_ref","validity","valid","invalidMessage","_b","validationMessage","DEFAULT_INVALID_MESSAGE","hasVoiceOver","delay","_c","required","_d","DEFAULT_VALID_MESSAGE","stringPropVisible","message","showMessage","handleClick","event","click","emit","handleInput","input","handleChange","change","handleBlur","blur","handleFocus","focus","getOptionLabel","option","label","value","toString","enableAttributePassing","element","customElementSelector","parent","closest","attributes","i","length","attr","item","name","startsWith","setAttribute","removeAttribute","isWebComponent","includes","replace","trim","currentClass","getAttribute","watch0Fn","watch0","watch1Fn","messageId","DEFAULT_MESSAGE_ID_SUFFIX","placeholderId","DEFAULT_PLACEHOLDER_ID_SUFFIX","DEFAULT_VALID_MESSAGE_ID_SUFFIX","DEFAULT_INVALID_MESSAGE_ID_SUFFIX","watch1","watch2Fn","watch2","componentDidLoad","mId","id","uuid","render","h","key","class","cls","className","variant","getHideProp","showLabel","icon","showIcon","htmlFor","DEFAULT_LABEL","ref","el","getBoolean","showRequiredAsterisk","disabled","size","autocomplete","multiple","onInput","onClick","onChange","onBlur","onFocus","ariaDescribedBy","hidden","options","_e","map","Fragment","optgroupOption","selected","_f","placeholder","messageIcon","semantic","role"],"sources":["src/components/select/select.tsx"],"sourcesContent":["import {\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER_ID_SUFFIX,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport {\n ChangeEvent,\n ClickEvent,\n InputEvent,\n InteractionEvent,\n} from \"../../shared/model\";\nimport {\n cls,\n delay,\n getBoolean,\n getHideProp,\n getOptionKey,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport { DBSelectOptionType, DBSelectProps, DBSelectState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-select\",\n})\nexport class DBSelect {\n private _ref!: HTMLSelectElement | any;\n @Prop() id: DBSelectProps[\"id\"];\n @Prop() invalidMessage: DBSelectProps[\"invalidMessage\"];\n @Prop() message: DBSelectProps[\"message\"];\n @Prop() showMessage: DBSelectProps[\"showMessage\"];\n @Prop() value: DBSelectProps[\"value\"];\n @Prop() validMessage: DBSelectProps[\"validMessage\"];\n @Prop() validation: DBSelectProps[\"validation\"];\n @Prop() required: DBSelectProps[\"required\"];\n @Event() click: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onClick\"]>[number]\n > | void;\n @Event() input: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onInput\"]>[number]\n > | void;\n @Event() change: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onChange\"]>[number]\n > | void;\n @Event() blur: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onBlur\"]>[number]\n > | void;\n @Event() focus: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onFocus\"]>[number]\n > | void;\n @Prop({attribute: \"classname\"}) className: DBSelectProps[\"className\"];\n @Prop() variant: DBSelectProps[\"variant\"];\n @Prop() showLabel: DBSelectProps[\"showLabel\"];\n @Prop() icon: DBSelectProps[\"icon\"];\n @Prop() showIcon: DBSelectProps[\"showIcon\"];\n @Prop() label: DBSelectProps[\"label\"];\n @Prop() showRequiredAsterisk: DBSelectProps[\"showRequiredAsterisk\"];\n @Prop() disabled: DBSelectProps[\"disabled\"];\n @Prop() name: DBSelectProps[\"name\"];\n @Prop() size: DBSelectProps[\"size\"];\n @Prop() autocomplete: DBSelectProps[\"autocomplete\"];\n @Prop() multiple: DBSelectProps[\"multiple\"];\n @Prop() ariaDescribedBy: DBSelectProps[\"ariaDescribedBy\"];\n @Prop() options: DBSelectProps[\"options\"];\n @Prop() placeholder: DBSelectProps[\"placeholder\"];\n @Prop() messageIcon: DBSelectProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _invalidMessage = undefined;\n @State() _placeholderId = \"\";\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() initialized = false;\n @State() _voiceOverFallback = \"\";\n\n hasValidState() {\n return !!(this.validMessage ?? this.validation === \"valid\");\n }\n handleValidation() {\n /* For a11y reasons we need to map the correct message with the select */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this._invalidMessage;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.hasValidState() &&\n this._ref?.validity.valid &&\n this.required\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = this._placeholderId;\n }\n }\n handleClick(event: ClickEvent<HTMLSelectElement> | any) {\n if (this.click) {\n this.click.emit(event);\n }\n }\n handleInput(event: InputEvent<HTMLSelectElement> | any) {\n if (this.input) {\n this.input.emit(event);\n }\n this.handleValidation();\n }\n handleChange(event: ChangeEvent<HTMLSelectElement> | any) {\n if (this.change) {\n this.change.emit(event);\n }\n this.handleValidation();\n }\n handleBlur(event: InteractionEvent<HTMLSelectElement> | any) {\n if (this.blur) {\n this.blur.emit(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLSelectElement> | any) {\n if (this.focus) {\n this.focus.emit(event);\n }\n }\n getOptionLabel(option: DBSelectOptionType) {\n return option.label ?? option.value?.toString();\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLSelectElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n }\n\n @Watch(\"_ref\")\n @Watch(\"invalidMessage\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n if (this._id && this.initialized) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n const placeholderId = this._id + DEFAULT_PLACEHOLDER_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._placeholderId = placeholderId;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n } else {\n this._descByIds = placeholderId;\n }\n this.initialized = false;\n }\n }\n\n @Watch(\"_id\")\n @Watch(\"initialized\")\n watch1() {\n this.watch1Fn();\n }\n\n watch2Fn() {\n this._value = this.value;\n }\n\n @Watch(\"value\")\n watch2() {\n this.watch2Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-select\");\n this.initialized = true;\n const mId = this.id ?? `select-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._placeholderId = mId + DEFAULT_PLACEHOLDER_ID_SUFFIX;\n this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;\n this.watch0Fn();\n this.watch1Fn();\n this.watch2Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-select\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n data-icon={this.icon}\n data-hide-icon={getHideProp(this.showIcon)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <select\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n required={getBoolean(this.required, \"required\")}\n data-hide-asterisk={getHideProp(this.showRequiredAsterisk)}\n disabled={getBoolean(this.disabled, \"disabled\")}\n id={this._id}\n name={this.name}\n size={this.size}\n /* @ts-ignore */\nvalue={this.value ?? this._value}\n autocomplete={this.autocomplete}\n multiple={this.multiple}\n onInput={(event) => this.handleInput(event)}\n onClick={(event) => this.handleClick(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n aria-describedby={this.ariaDescribedBy ?? this._descByIds}\n >\n <option hidden={true}></option>\n {this.options?.length ? (\n this.options?.map((option) => (\n <Fragment>\n {option.options ? (\n <optgroup label={this.getOptionLabel(option)} key={undefined}>\n {option.options?.map((optgroupOption) => (\n <option\n value={optgroupOption.value}\n selected={optgroupOption.selected}\n disabled={optgroupOption.disabled}\n key={undefined}\n >\n {this.getOptionLabel(optgroupOption)}\n </option>\n ))}\n </optgroup>\n ) : (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={option.selected}\n key={undefined}\n >\n {this.getOptionLabel(option)}\n </option>\n )}\n </Fragment>\n ))\n ) : (\n <slot></slot>\n )}\n </select>\n <span id={this._placeholderId}>{this.placeholder ?? this.label}</span>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n {this.hasValidState() ? (\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage || DEFAULT_VALID_MESSAGE}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this._invalidMessage}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"],"mappings":"sNAmDaA,EAAQ,MAHpB,WAAAC,CAAAC,G,iJA4CUC,KAAGC,IAAGC,UACNF,KAAUG,WAAGD,UACbF,KAAeI,gBAAGF,UAClBF,KAAiBK,kBAAGH,UACpBF,KAAeM,gBAAGJ,UAClBF,KAAcO,eAAG,GACjBP,KAAUQ,WAAG,GACbR,KAAMS,OAAG,GACTT,KAAWU,YAAG,MACdV,KAAkBW,mBAAG,EAsQ/B,CApQC,aAAAC,G,MACE,UAAUC,EAAAb,KAAKc,gBAAgB,MAAAD,SAAA,EAAAA,EAAAb,KAAKe,aAAe,Q,CAErD,gBAAAC,G,YAEE,MAAKH,EAAAb,KAAKiB,QAAI,MAAAJ,SAAA,SAAAA,EAAEK,SAASC,QAASnB,KAAKe,aAAe,UAAW,CAC/Df,KAAKQ,WAAaR,KAAKK,kBACvBL,KAAKM,gBACHN,KAAKoB,kBACLC,EAAArB,KAAKiB,QAAI,MAAAI,SAAA,SAAAA,EAAEC,oBACXC,EACF,GAAIC,IAAgB,CAClBxB,KAAKW,mBAAqBX,KAAKM,gBAC/BmB,GAAM,IAAOzB,KAAKW,mBAAqB,IAAK,I,OAEzC,GACLX,KAAKY,mBACLc,EAAA1B,KAAKiB,QAAI,MAAAS,SAAA,SAAAA,EAAER,SAASC,QACpBnB,KAAK2B,SACL,CACA3B,KAAKQ,WAAaR,KAAKI,gBACvB,GAAIoB,IAAgB,CAClBxB,KAAKW,oBAAqB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AKkH,WAAO,MAAAtF,SAAA,SAAAA,EAAE6B,SACb0D,EAAAnH,KAAKkH,WAAS,MAAAC,SAAA,SAAAA,EAAAC,KAAKtE,I,MAAW,OAC5ByC,EAAC8B,EACE,KAAAvE,EAAOoE,QACN3B,EAAA,YAAUxC,MAAO/C,KAAK6C,eAAeC,GAAS0C,IAAKtF,YAChDW,EAAAiC,EAAOoE,WAAS,MAAArG,SAAA,SAAAA,EAAAuG,KAAKE,GACpB/B,EACE,UAAAvC,MAAOsE,EAAetE,MACtBuE,SAAUD,EAAeC,SACzBhB,SAAUe,EAAef,SACzBf,IAAKtF,WAEJF,KAAK6C,eAAeyE,OAK3B/B,EACE,UAAAvC,MAAOF,EAAOE,MACduD,SAAUzD,EAAOyD,SACjBgB,SAAUzE,EAAOyE,SACjB/B,IAAKtF,WAEJF,KAAK6C,eAAeC,IAGhB,IAGbyC,EAAA,cAGJA,EAAA,QAAAC,IAAA,2CAAMJ,GAAIpF,KAAKO,iBAAiBiH,EAAAxH,KAAKyH,eAAW,MAAAD,SAAA,EAAAA,EAAIxH,KAAK+C,OACxDjB,EAAkB9B,KAAK+B,QAAS/B,KAAKgC,aACpCuD,EAAA,eACEiB,KAAK,QACLT,KAAM/F,KAAK0H,YACXtC,GAAIpF,KAAKG,YAERH,KAAK+B,SAEN,KACH/B,KAAKY,gBACJ2E,EACE,eAAAiB,KAAK,QACLmB,SAAS,aACTvC,GAAIpF,KAAKI,iBAERJ,KAAKc,cAAgBe,GAEtB,KACJ0D,EAAA,eAAAC,IAAA,2CACEgB,KAAK,QACLmB,SAAS,WACTvC,GAAIpF,KAAKK,mBAERL,KAAKM,iBAERiF,EAAA,QAAAC,IAAA,kEAA2B,OAAOoC,KAAK,UACpC5H,KAAKW,oB","ignoreList":[]}
1
+ {"version":3,"names":["DBSelect","constructor","hostRef","this","_id","undefined","_messageId","_validMessageId","_invalidMessageId","_invalidMessage","_placeholderId","_descByIds","_value","initialized","_voiceOverFallback","hasValidState","_a","validMessage","validation","handleValidation","_ref","validity","valid","invalidMessage","_b","validationMessage","DEFAULT_INVALID_MESSAGE","hasVoiceOver","delay","_c","required","_d","DEFAULT_VALID_MESSAGE","stringPropVisible","message","showMessage","handleClick","event","click","emit","handleInput","input","handleChange","change","handleBlur","blur","handleFocus","focus","getOptionLabel","option","label","value","toString","enableAttributePassing","element","customElementSelector","parent","closest","attributes","i","length","attr","item","name","startsWith","setAttribute","removeAttribute","isWebComponent","includes","replace","trim","currentClass","getAttribute","watch0Fn","watch0","watch1Fn","messageId","DEFAULT_MESSAGE_ID_SUFFIX","placeholderId","DEFAULT_PLACEHOLDER_ID_SUFFIX","DEFAULT_VALID_MESSAGE_ID_SUFFIX","DEFAULT_INVALID_MESSAGE_ID_SUFFIX","watch1","watch2Fn","watch2","componentDidLoad","mId","id","uuid","render","h","key","class","cls","className","variant","getHideProp","showLabel","showRequiredAsterisk","icon","showIcon","htmlFor","DEFAULT_LABEL","ref","el","getBoolean","disabled","size","autocomplete","multiple","onInput","onClick","onChange","onBlur","onFocus","ariaDescribedBy","hidden","options","_e","map","Fragment","optgroupOption","selected","_f","placeholder","messageIcon","semantic","role"],"sources":["src/components/select/select.tsx"],"sourcesContent":["import {\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER_ID_SUFFIX,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport {\n ChangeEvent,\n ClickEvent,\n InputEvent,\n InteractionEvent,\n} from \"../../shared/model\";\nimport {\n cls,\n delay,\n getBoolean,\n getHideProp,\n getOptionKey,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport { DBSelectOptionType, DBSelectProps, DBSelectState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-select\",\n})\nexport class DBSelect {\n private _ref!: HTMLSelectElement | any;\n @Prop() id: DBSelectProps[\"id\"];\n @Prop() invalidMessage: DBSelectProps[\"invalidMessage\"];\n @Prop() message: DBSelectProps[\"message\"];\n @Prop() showMessage: DBSelectProps[\"showMessage\"];\n @Prop() value: DBSelectProps[\"value\"];\n @Prop() validMessage: DBSelectProps[\"validMessage\"];\n @Prop() validation: DBSelectProps[\"validation\"];\n @Prop() required: DBSelectProps[\"required\"];\n @Event() click: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onClick\"]>[number]\n > | void;\n @Event() input: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onInput\"]>[number]\n > | void;\n @Event() change: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onChange\"]>[number]\n > | void;\n @Event() blur: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onBlur\"]>[number]\n > | void;\n @Event() focus: EventEmitter<\n Parameters<Required<DBSelectProps>[\"onFocus\"]>[number]\n > | void;\n @Prop({attribute: \"classname\"}) className: DBSelectProps[\"className\"];\n @Prop() variant: DBSelectProps[\"variant\"];\n @Prop() showLabel: DBSelectProps[\"showLabel\"];\n @Prop() showRequiredAsterisk: DBSelectProps[\"showRequiredAsterisk\"];\n @Prop() icon: DBSelectProps[\"icon\"];\n @Prop() showIcon: DBSelectProps[\"showIcon\"];\n @Prop() label: DBSelectProps[\"label\"];\n @Prop() disabled: DBSelectProps[\"disabled\"];\n @Prop() name: DBSelectProps[\"name\"];\n @Prop() size: DBSelectProps[\"size\"];\n @Prop() autocomplete: DBSelectProps[\"autocomplete\"];\n @Prop() multiple: DBSelectProps[\"multiple\"];\n @Prop() ariaDescribedBy: DBSelectProps[\"ariaDescribedBy\"];\n @Prop() options: DBSelectProps[\"options\"];\n @Prop() placeholder: DBSelectProps[\"placeholder\"];\n @Prop() messageIcon: DBSelectProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _invalidMessage = undefined;\n @State() _placeholderId = \"\";\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() initialized = false;\n @State() _voiceOverFallback = \"\";\n\n hasValidState() {\n return !!(this.validMessage ?? this.validation === \"valid\");\n }\n handleValidation() {\n /* For a11y reasons we need to map the correct message with the select */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this._invalidMessage;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.hasValidState() &&\n this._ref?.validity.valid &&\n this.required\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = this._placeholderId;\n }\n }\n handleClick(event: ClickEvent<HTMLSelectElement> | any) {\n if (this.click) {\n this.click.emit(event);\n }\n }\n handleInput(event: InputEvent<HTMLSelectElement> | any) {\n if (this.input) {\n this.input.emit(event);\n }\n this.handleValidation();\n }\n handleChange(event: ChangeEvent<HTMLSelectElement> | any) {\n if (this.change) {\n this.change.emit(event);\n }\n this.handleValidation();\n }\n handleBlur(event: InteractionEvent<HTMLSelectElement> | any) {\n if (this.blur) {\n this.blur.emit(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLSelectElement> | any) {\n if (this.focus) {\n this.focus.emit(event);\n }\n }\n getOptionLabel(option: DBSelectOptionType) {\n return option.label ?? option.value?.toString();\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLSelectElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n }\n\n @Watch(\"_ref\")\n @Watch(\"invalidMessage\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n if (this._id && this.initialized) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n const placeholderId = this._id + DEFAULT_PLACEHOLDER_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._placeholderId = placeholderId;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n } else {\n this._descByIds = placeholderId;\n }\n this.initialized = false;\n }\n }\n\n @Watch(\"_id\")\n @Watch(\"initialized\")\n watch1() {\n this.watch1Fn();\n }\n\n watch2Fn() {\n this._value = this.value;\n }\n\n @Watch(\"value\")\n watch2() {\n this.watch2Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-select\");\n this.initialized = true;\n const mId = this.id ?? `select-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._placeholderId = mId + DEFAULT_PLACEHOLDER_ID_SUFFIX;\n this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;\n this.watch0Fn();\n this.watch1Fn();\n this.watch2Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-select\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n data-hide-asterisk={getHideProp(this.showRequiredAsterisk)}\n data-icon={this.icon}\n data-hide-icon={getHideProp(this.showIcon)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <select\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n required={getBoolean(this.required, \"required\")}\n disabled={getBoolean(this.disabled, \"disabled\")}\n id={this._id}\n name={this.name}\n size={this.size}\n /* @ts-ignore */\nvalue={this.value ?? this._value}\n autocomplete={this.autocomplete}\n multiple={this.multiple}\n onInput={(event) => this.handleInput(event)}\n onClick={(event) => this.handleClick(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n aria-describedby={this.ariaDescribedBy ?? this._descByIds}\n >\n <option hidden={true}></option>\n {this.options?.length ? (\n this.options?.map((option) => (\n <Fragment>\n {option.options ? (\n <optgroup label={this.getOptionLabel(option)} key={undefined}>\n {option.options?.map((optgroupOption) => (\n <option\n value={optgroupOption.value}\n selected={optgroupOption.selected}\n disabled={optgroupOption.disabled}\n key={undefined}\n >\n {this.getOptionLabel(optgroupOption)}\n </option>\n ))}\n </optgroup>\n ) : (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={option.selected}\n key={undefined}\n >\n {this.getOptionLabel(option)}\n </option>\n )}\n </Fragment>\n ))\n ) : (\n <slot></slot>\n )}\n </select>\n <span id={this._placeholderId}>{this.placeholder ?? this.label}</span>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n {this.hasValidState() ? (\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage || DEFAULT_VALID_MESSAGE}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this._invalidMessage}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"],"mappings":"sNAmDaA,EAAQ,MAHpB,WAAAC,CAAAC,G,iJA4CUC,KAAGC,IAAGC,UACNF,KAAUG,WAAGD,UACbF,KAAeI,gBAAGF,UAClBF,KAAiBK,kBAAGH,UACpBF,KAAeM,gBAAGJ,UAClBF,KAAcO,eAAG,GACjBP,KAAUQ,WAAG,GACbR,KAAMS,OAAG,GACTT,KAAWU,YAAG,MACdV,KAAkBW,mBAAG,EAsQ/B,CApQC,aAAAC,G,MACE,UAAUC,EAAAb,KAAKc,gBAAgB,MAAAD,SAAA,EAAAA,EAAAb,KAAKe,aAAe,Q,CAErD,gBAAAC,G,YAEE,MAAKH,EAAAb,KAAKiB,QAAI,MAAAJ,SAAA,SAAAA,EAAEK,SAASC,QAASnB,KAAKe,aAAe,UAAW,CAC/Df,KAAKQ,WAAaR,KAAKK,kBACvBL,KAAKM,gBACHN,KAAKoB,kBACLC,EAAArB,KAAKiB,QAAI,MAAAI,SAAA,SAAAA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AAA,eAAAC,IAAA,2CACEgB,KAAK,QACLmB,SAAS,WACTvC,GAAIpF,KAAKK,mBAERL,KAAKM,iBAERiF,EAAA,QAAAC,IAAA,kEAA2B,OAAOoC,KAAK,UACpC5H,KAAKW,oB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as i,c as t,h as s}from"./p-CK6m6IJ4.js";import{l as h,g as a,h as e,f as d,k as l,b as n,r,a as o}from"./p-DC9V_oNU.js";import{h as c,d as f,s as u,u as v,e as b,b as m,j as p,c as y}from"./p-YECpAE3G.js";const w=class{constructor(s){i(this,s);this.input=t(this,"input");this.change=t(this,"change");this.blur=t(this,"blur");this.focus=t(this,"focus");this._id=undefined;this._messageId=undefined;this._validMessageId=undefined;this._invalidMessageId=undefined;this._invalidMessage=undefined;this._descByIds="";this._value="";this._voiceOverFallback=""}hasValidState(){var i;return!!((i=this.validMessage)!==null&&i!==void 0?i:this.validation==="valid")}handleValidation(){var i,t,s,a;if(!((i=this._ref)===null||i===void 0?void 0:i.validity.valid)||this.validation==="invalid"){this._descByIds=this._invalidMessageId;this._invalidMessage=this.invalidMessage||((t=this._ref)===null||t===void 0?void 0:t.validationMessage)||h;if(c()){this._voiceOverFallback=this._invalidMessage;f((()=>this._voiceOverFallback=""),1e3)}}else if(this.hasValidState()&&((s=this._ref)===null||s===void 0?void 0:s.validity.valid)&&(this.required||this.minLength||this.maxLength)){this._descByIds=this._validMessageId;if(c()){this._voiceOverFallback=(a=this.validMessage)!==null&&a!==void 0?a:l;f((()=>this._voiceOverFallback=""),1e3)}}else if(u(this.message,this.showMessage)){this._descByIds=this._messageId}else{this._descByIds=""}}handleInput(i){if(this.input){this.input.emit(i)}this.handleValidation()}handleChange(i){if(this.change){this.change.emit(i)}this.handleValidation()}handleBlur(i){if(this.blur){this.blur.emit(i)}}handleFocus(i){if(this.focus){this.focus.emit(i)}}enableAttributePassing(i,t){const s=i===null||i===void 0?void 0:i.closest(t);if(i&&s){const t=s.attributes;for(let h=0;h<t.length;h++){const a=t.item(h);if(a&&(a.name.startsWith("data-")||a.name.startsWith("aria-"))){i.setAttribute(a.name,a.value);s.removeAttribute(a.name)}if(a&&a.name==="class"){const t=a.value.includes("hydrated");const h=a.value.replace("hydrated","").trim();const e=i.getAttribute("class");i.setAttribute(a.name,`${e?`${e} `:""}${h}`);if(t){s.setAttribute("class","hydrated")}else{s.removeAttribute(a.name)}}}}}watch0Fn(){var i;this._invalidMessage=this.invalidMessage||((i=this._ref)===null||i===void 0?void 0:i.validationMessage)||h}watch0(){this.watch0Fn()}watch1Fn(){if(this._id){const i=this._id+d;this._messageId=i;this._validMessageId=this._id+a;this._invalidMessageId=this._id+e;if(u(this.message,this.showMessage)){this._descByIds=i}}}watch1(){this.watch1Fn()}watch2Fn(){this._value=this.value}watch2(){this.watch2Fn()}componentDidLoad(){var i;this.enableAttributePassing(this._ref,"db-textarea");const t=(i=this.id)!==null&&i!==void 0?i:`textarea-${v()}`;this._id=t;this._messageId=t+d;this._validMessageId=t+a;this._invalidMessageId=t+e;this._invalidMessage=this.invalidMessage||h;this.watch0Fn();this.watch1Fn();this.watch2Fn()}render(){var i,t,h,a,e;return s("div",{key:"066914fb703dd14040eba1547f2a6d259c8f8bc2",class:y("db-textarea",this.className),"data-variant":this.variant,"data-hide-asterisk":p(this.showRequiredAsterisk),"data-hide-label":p(this.showLabel)},s("label",{key:"2037bfd141592ee0acfc2c23bb5f3c2c4abb13ce",htmlFor:this._id},(i=this.label)!==null&&i!==void 0?i:o),s("textarea",{key:"255a990e807905deff1ba3dd540cfb50c85506b2","aria-invalid":this.validation==="invalid","data-custom-validity":this.validation,"data-field-sizing":this.fieldSizing,ref:i=>{this._ref=i},id:this._id,"data-resize":this.resize,"data-hide-resizer":p((t=this.showResizer)!==null&&t!==void 0?t:true),disabled:m(this.disabled,"disabled"),required:m(this.required,"required"),readOnly:m(this.readOnly,"readOnly")||m(this.readonly,"readonly"),form:this.form,maxLength:b(this.maxLength,this.maxlength),minLength:b(this.minLength,this.minlength),name:this.name,wrap:this.wrap,spellcheck:this.spellCheck,autocomplete:this.autocomplete,onInput:i=>this.handleInput(i),onChange:i=>this.handleChange(i),onBlur:i=>this.handleBlur(i),onFocus:i=>this.handleFocus(i),value:(h=this.value)!==null&&h!==void 0?h:this._value,"aria-describedby":(a=this.ariaDescribedBy)!==null&&a!==void 0?a:this._descByIds,placeholder:(e=this.placeholder)!==null&&e!==void 0?e:n,rows:b(this.rows,r),cols:b(this.cols)}),u(this.message,this.showMessage)?s("db-infotext",{size:"small",icon:this.messageIcon,id:this._messageId},this.message):null,this.hasValidState()?s("db-infotext",{size:"small",semantic:"successful",id:this._validMessageId},this.validMessage||l):null,s("db-infotext",{key:"8f5e12098eb1a75aae4b11167e65723df250dfb6",size:"small",semantic:"critical",id:this._invalidMessageId},this._invalidMessage),s("span",{key:"5632e00e8f1362293bd0f208e1fe26d88fb0581c","data-visually-hidden":"true",role:"status"},this._voiceOverFallback))}static get watchers(){return{_ref:["watch0"],invalidMessage:["watch0"],_id:["watch1"],value:["watch2"]}}};export{w as db_textarea};
2
+ //# sourceMappingURL=p-81a85032.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DBTextarea","constructor","hostRef","this","_id","undefined","_messageId","_validMessageId","_invalidMessageId","_invalidMessage","_descByIds","_value","_voiceOverFallback","hasValidState","_a","validMessage","validation","handleValidation","_ref","validity","valid","invalidMessage","_b","validationMessage","DEFAULT_INVALID_MESSAGE","hasVoiceOver","delay","_c","required","minLength","maxLength","_d","DEFAULT_VALID_MESSAGE","stringPropVisible","message","showMessage","handleInput","event","input","emit","handleChange","change","handleBlur","blur","handleFocus","focus","enableAttributePassing","element","customElementSelector","parent","closest","attributes","i","length","attr","item","name","startsWith","setAttribute","value","removeAttribute","isWebComponent","includes","replace","trim","currentClass","getAttribute","watch0Fn","watch0","watch1Fn","messageId","DEFAULT_MESSAGE_ID_SUFFIX","DEFAULT_VALID_MESSAGE_ID_SUFFIX","DEFAULT_INVALID_MESSAGE_ID_SUFFIX","watch1","watch2Fn","watch2","componentDidLoad","mId","id","uuid","render","h","key","class","cls","className","variant","getHideProp","showLabel","htmlFor","label","DEFAULT_LABEL","fieldSizing","ref","el","resize","showResizer","disabled","getBoolean","showRequiredAsterisk","readOnly","readonly","form","getNumber","maxlength","minlength","wrap","spellcheck","spellCheck","autocomplete","onInput","onChange","onBlur","onFocus","ariaDescribedBy","placeholder","_e","DEFAULT_PLACEHOLDER","rows","DEFAULT_ROWS","cols","size","icon","messageIcon","semantic","role"],"sources":["src/components/textarea/textarea.tsx"],"sourcesContent":["import {\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER,\n DEFAULT_ROWS,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport { ChangeEvent, InputEvent, InteractionEvent } from \"../../shared/model\";\nimport {\n cls,\n delay,\n getBoolean,\n getHideProp,\n getNumber,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport { DBTextareaProps, DBTextareaState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-textarea\",\n})\nexport class DBTextarea {\n private _ref!: HTMLTextAreaElement | any;\n @Prop() id: DBTextareaProps[\"id\"];\n @Prop() invalidMessage: DBTextareaProps[\"invalidMessage\"];\n @Prop() message: DBTextareaProps[\"message\"];\n @Prop() showMessage: DBTextareaProps[\"showMessage\"];\n @Prop() value: DBTextareaProps[\"value\"];\n @Prop() validMessage: DBTextareaProps[\"validMessage\"];\n @Prop() validation: DBTextareaProps[\"validation\"];\n @Prop() required: DBTextareaProps[\"required\"];\n @Prop() minLength: DBTextareaProps[\"minLength\"];\n @Prop() maxLength: DBTextareaProps[\"maxLength\"];\n @Event() input: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onInput\"]>[number]\n > | void;\n @Event() change: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onChange\"]>[number]\n > | void;\n @Event() blur: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onBlur\"]>[number]\n > | void;\n @Event() focus: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onFocus\"]>[number]\n > | void;\n @Prop({attribute: \"classname\"}) className: DBTextareaProps[\"className\"];\n @Prop() variant: DBTextareaProps[\"variant\"];\n @Prop() showLabel: DBTextareaProps[\"showLabel\"];\n @Prop() label: DBTextareaProps[\"label\"];\n @Prop() fieldSizing: DBTextareaProps[\"fieldSizing\"];\n @Prop() resize: DBTextareaProps[\"resize\"];\n @Prop() showResizer: DBTextareaProps[\"showResizer\"];\n @Prop() disabled: DBTextareaProps[\"disabled\"];\n @Prop() showRequiredAsterisk: DBTextareaProps[\"showRequiredAsterisk\"];\n @Prop() readOnly: DBTextareaProps[\"readOnly\"];\n @Prop() readonly: DBTextareaProps[\"readonly\"];\n @Prop() form: DBTextareaProps[\"form\"];\n @Prop() maxlength: DBTextareaProps[\"maxlength\"];\n @Prop() minlength: DBTextareaProps[\"minlength\"];\n @Prop() name: DBTextareaProps[\"name\"];\n @Prop() wrap: DBTextareaProps[\"wrap\"];\n @Prop() spellCheck: DBTextareaProps[\"spellCheck\"];\n @Prop() autocomplete: DBTextareaProps[\"autocomplete\"];\n @Prop() ariaDescribedBy: DBTextareaProps[\"ariaDescribedBy\"];\n @Prop() placeholder: DBTextareaProps[\"placeholder\"];\n @Prop() rows: DBTextareaProps[\"rows\"];\n @Prop() cols: DBTextareaProps[\"cols\"];\n @Prop() messageIcon: DBTextareaProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _invalidMessage = undefined;\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() _voiceOverFallback = \"\";\n\n hasValidState() {\n return !!(this.validMessage ?? this.validation === \"valid\");\n }\n handleValidation() {\n /* For a11y reasons we need to map the correct message with the textarea */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this._invalidMessage;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.hasValidState() &&\n this._ref?.validity.valid &&\n (this.required || this.minLength || this.maxLength)\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleInput(event: InputEvent<HTMLTextAreaElement>) {\n if (this.input) {\n this.input.emit(event);\n }\n this.handleValidation();\n }\n handleChange(event: ChangeEvent<HTMLTextAreaElement>) {\n if (this.change) {\n this.change.emit(event);\n }\n this.handleValidation();\n }\n handleBlur(event: InteractionEvent<HTMLTextAreaElement> | any) {\n if (this.blur) {\n this.blur.emit(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLTextAreaElement> | any) {\n if (this.focus) {\n this.focus.emit(event);\n }\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLTextAreaElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n }\n\n @Watch(\"_ref\")\n @Watch(\"invalidMessage\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n }\n\n @Watch(\"_id\")\n watch1() {\n this.watch1Fn();\n }\n\n watch2Fn() {\n this._value = this.value;\n }\n\n @Watch(\"value\")\n watch2() {\n this.watch2Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-textarea\");\n const mId = this.id ?? `textarea-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;\n this.watch0Fn();\n this.watch1Fn();\n this.watch2Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-textarea\", this.className)}\n data-variant={this.variant}\n data-hide-label={getHideProp(this.showLabel)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <textarea\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n data-field-sizing={this.fieldSizing}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-resize={this.resize}\n data-hide-resizer={getHideProp(this.showResizer ?? true)}\n disabled={getBoolean(this.disabled, \"disabled\")}\n required={getBoolean(this.required, \"required\")}\n data-hide-asterisk={getHideProp(this.showRequiredAsterisk)}\n readOnly={\n getBoolean(this.readOnly, \"readOnly\") ||\n getBoolean(this.readonly, \"readonly\")\n }\n form={this.form}\n maxLength={getNumber(this.maxLength, this.maxlength)}\n minLength={getNumber(this.minLength, this.minlength)}\n name={this.name}\n wrap={this.wrap}\n spellcheck={this.spellCheck}\n autocomplete={this.autocomplete}\n onInput={(event) => this.handleInput(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n value={this.value ?? this._value}\n aria-describedby={this.ariaDescribedBy ?? this._descByIds}\n placeholder={this.placeholder ?? DEFAULT_PLACEHOLDER}\n rows={getNumber(this.rows, DEFAULT_ROWS)}\n cols={getNumber(this.cols)}\n ></textarea>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n {this.hasValidState() ? (\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage || DEFAULT_VALID_MESSAGE}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this._invalidMessage}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voice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_messageId","_validMessageId","_invalidMessageId","_invalidMessage","_descByIds","_value","_voiceOverFallback","hasValidState","_a","validMessage","validation","handleValidation","_ref","validity","valid","invalidMessage","_b","validationMessage","DEFAULT_INVALID_MESSAGE","hasVoiceOver","delay","_c","required","minLength","maxLength","_d","DEFAULT_VALID_MESSAGE","stringPropVisible","message","showMessage","handleInput","event","input","emit","handleChange","change","handleBlur","blur","handleFocus","focus","enableAttributePassing","element","customElementSelector","parent","closest","attributes","i","length","attr","item","name","startsWith","setAttribute","value","removeAttribute","isWebComponent","includes","replace","trim","currentClass","getAttribute","watch0Fn","watch0","watch1Fn","messageId","DEFAULT_MESSAGE_ID_SUFFIX","DEFAULT_VALID_MESSAGE_ID_SUFFIX","DEFAULT_INVALID_MESSAGE_ID_SUFFIX","watch1","watch2Fn","watch2","componentDidLoad","mId","id","uuid","render","h","key","class","cls","className","variant","getHideProp","showRequiredAsterisk","showLabel","htmlFor","label","DEFAULT_LABEL","fieldSizing","ref","el","resize","showResizer","disabled","getBoolean","readOnly","readonly","form","getNumber","maxlength","minlength","wrap","spellcheck","spellCheck","autocomplete","onInput","onChange","onBlur","onFocus","ariaDescribedBy","placeholder","_e","DEFAULT_PLACEHOLDER","rows","DEFAULT_ROWS","cols","size","icon","messageIcon","semantic","role"],"sources":["src/components/textarea/textarea.tsx"],"sourcesContent":["import {\n DEFAULT_INVALID_MESSAGE,\n DEFAULT_INVALID_MESSAGE_ID_SUFFIX,\n DEFAULT_LABEL,\n DEFAULT_MESSAGE_ID_SUFFIX,\n DEFAULT_PLACEHOLDER,\n DEFAULT_ROWS,\n DEFAULT_VALID_MESSAGE,\n DEFAULT_VALID_MESSAGE_ID_SUFFIX,\n} from \"../../shared/constants\";\nimport { ChangeEvent, InputEvent, InteractionEvent } from \"../../shared/model\";\nimport {\n cls,\n delay,\n getBoolean,\n getHideProp,\n getNumber,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\nimport { DBInfotext } from \"../infotext/infotext\";\nimport { DBTextareaProps, DBTextareaState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-textarea\",\n})\nexport class DBTextarea {\n private _ref!: HTMLTextAreaElement | any;\n @Prop() id: DBTextareaProps[\"id\"];\n @Prop() invalidMessage: DBTextareaProps[\"invalidMessage\"];\n @Prop() message: DBTextareaProps[\"message\"];\n @Prop() showMessage: DBTextareaProps[\"showMessage\"];\n @Prop() value: DBTextareaProps[\"value\"];\n @Prop() validMessage: DBTextareaProps[\"validMessage\"];\n @Prop() validation: DBTextareaProps[\"validation\"];\n @Prop() required: DBTextareaProps[\"required\"];\n @Prop() minLength: DBTextareaProps[\"minLength\"];\n @Prop() maxLength: DBTextareaProps[\"maxLength\"];\n @Event() input: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onInput\"]>[number]\n > | void;\n @Event() change: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onChange\"]>[number]\n > | void;\n @Event() blur: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onBlur\"]>[number]\n > | void;\n @Event() focus: EventEmitter<\n Parameters<Required<DBTextareaProps>[\"onFocus\"]>[number]\n > | void;\n @Prop({attribute: \"classname\"}) className: DBTextareaProps[\"className\"];\n @Prop() variant: DBTextareaProps[\"variant\"];\n @Prop() showRequiredAsterisk: DBTextareaProps[\"showRequiredAsterisk\"];\n @Prop() showLabel: DBTextareaProps[\"showLabel\"];\n @Prop() label: DBTextareaProps[\"label\"];\n @Prop() fieldSizing: DBTextareaProps[\"fieldSizing\"];\n @Prop() resize: DBTextareaProps[\"resize\"];\n @Prop() showResizer: DBTextareaProps[\"showResizer\"];\n @Prop() disabled: DBTextareaProps[\"disabled\"];\n @Prop() readOnly: DBTextareaProps[\"readOnly\"];\n @Prop() readonly: DBTextareaProps[\"readonly\"];\n @Prop() form: DBTextareaProps[\"form\"];\n @Prop() maxlength: DBTextareaProps[\"maxlength\"];\n @Prop() minlength: DBTextareaProps[\"minlength\"];\n @Prop() name: DBTextareaProps[\"name\"];\n @Prop() wrap: DBTextareaProps[\"wrap\"];\n @Prop() spellCheck: DBTextareaProps[\"spellCheck\"];\n @Prop() autocomplete: DBTextareaProps[\"autocomplete\"];\n @Prop() ariaDescribedBy: DBTextareaProps[\"ariaDescribedBy\"];\n @Prop() placeholder: DBTextareaProps[\"placeholder\"];\n @Prop() rows: DBTextareaProps[\"rows\"];\n @Prop() cols: DBTextareaProps[\"cols\"];\n @Prop() messageIcon: DBTextareaProps[\"messageIcon\"];\n @State() _id = undefined;\n @State() _messageId = undefined;\n @State() _validMessageId = undefined;\n @State() _invalidMessageId = undefined;\n @State() _invalidMessage = undefined;\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() _voiceOverFallback = \"\";\n\n hasValidState() {\n return !!(this.validMessage ?? this.validation === \"valid\");\n }\n handleValidation() {\n /* For a11y reasons we need to map the correct message with the textarea */\n if (!this._ref?.validity.valid || this.validation === \"invalid\") {\n this._descByIds = this._invalidMessageId;\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this._invalidMessage;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.hasValidState() &&\n this._ref?.validity.valid &&\n (this.required || this.minLength || this.maxLength)\n ) {\n this._descByIds = this._validMessageId;\n if (hasVoiceOver()) {\n this._voiceOverFallback = this.validMessage ?? DEFAULT_VALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = this._messageId;\n } else {\n this._descByIds = \"\";\n }\n }\n handleInput(event: InputEvent<HTMLTextAreaElement>) {\n if (this.input) {\n this.input.emit(event);\n }\n this.handleValidation();\n }\n handleChange(event: ChangeEvent<HTMLTextAreaElement>) {\n if (this.change) {\n this.change.emit(event);\n }\n this.handleValidation();\n }\n handleBlur(event: InteractionEvent<HTMLTextAreaElement> | any) {\n if (this.blur) {\n this.blur.emit(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLTextAreaElement> | any) {\n if (this.focus) {\n this.focus.emit(event);\n }\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLTextAreaElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n this._invalidMessage =\n this.invalidMessage ||\n this._ref?.validationMessage ||\n DEFAULT_INVALID_MESSAGE;\n }\n\n @Watch(\"_ref\")\n @Watch(\"invalidMessage\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n if (this._id) {\n const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;\n this._messageId = messageId;\n this._validMessageId = this._id + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = this._id + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n if (stringPropVisible(this.message, this.showMessage)) {\n this._descByIds = messageId;\n }\n }\n }\n\n @Watch(\"_id\")\n watch1() {\n this.watch1Fn();\n }\n\n watch2Fn() {\n this._value = this.value;\n }\n\n @Watch(\"value\")\n watch2() {\n this.watch2Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-textarea\");\n const mId = this.id ?? `textarea-${uuid()}`;\n this._id = mId;\n this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;\n this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;\n this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;\n this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;\n this.watch0Fn();\n this.watch1Fn();\n this.watch2Fn();\n }\n\n render() {\n return (\n <div\n class={cls(\"db-textarea\", this.className)}\n data-variant={this.variant}\n data-hide-asterisk={getHideProp(this.showRequiredAsterisk)}\n data-hide-label={getHideProp(this.showLabel)}\n >\n <label htmlFor={this._id}>{this.label ?? DEFAULT_LABEL}</label>\n <textarea\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n data-field-sizing={this.fieldSizing}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n data-resize={this.resize}\n data-hide-resizer={getHideProp(this.showResizer ?? true)}\n disabled={getBoolean(this.disabled, \"disabled\")}\n required={getBoolean(this.required, \"required\")}\n readOnly={\n getBoolean(this.readOnly, \"readOnly\") ||\n getBoolean(this.readonly, \"readonly\")\n }\n form={this.form}\n maxLength={getNumber(this.maxLength, this.maxlength)}\n minLength={getNumber(this.minLength, this.minlength)}\n name={this.name}\n wrap={this.wrap}\n spellcheck={this.spellCheck}\n autocomplete={this.autocomplete}\n onInput={(event) => this.handleInput(event)}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n value={this.value ?? this._value}\n aria-describedby={this.ariaDescribedBy ?? this._descByIds}\n placeholder={this.placeholder ?? DEFAULT_PLACEHOLDER}\n rows={getNumber(this.rows, DEFAULT_ROWS)}\n cols={getNumber(this.cols)}\n ></textarea>\n {stringPropVisible(this.message, this.showMessage) ? (\n <db-infotext\n size=\"small\"\n icon={this.messageIcon}\n id={this._messageId}\n >\n {this.message}\n </db-infotext>\n ) : null}\n {this.hasValidState() ? (\n <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage || DEFAULT_VALID_MESSAGE}\n </db-infotext>\n ) : null}\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this._invalidMessage}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"],"mappings":"6NA+CaA,EAAU,MAHtB,WAAAC,CAAAC,G,sHAkDUC,KAAGC,IAAGC,UACNF,KAAUG,WAAGD,UACbF,KAAeI,gBAAGF,UAClBF,KAAiBK,kBAAGH,UACpBF,KAAeM,gBAAGJ,UAClBF,KAAUO,WAAG,GACbP,KAAMQ,OAAG,GACTR,KAAkBS,mBAAG,EA6N/B,CA3NC,aAAAC,G,MACE,UAAUC,EAAAX,KAAKY,gBAAgB,MAAAD,SAAA,EAAAA,EAAAX,KAAKa,aAAe,Q,CAErD,gBAAAC,G,YAEE,MAAKH,EAAAX,KAAKe,QAAI,MAAAJ,SAAA,SAAAA,EAAEK,SAASC,QAASjB,KAAKa,aAAe,UAAW,CAC/Db,KAAKO,WAAaP,KAAKK,kBACvBL,KAAKM,gBACHN,KAAKkB,kBACLC,EAAAnB,KAAKe,QAAI,MAAAI,SAAA,SAAAA,EAAEC,oBACXC,EACF,GAAIC,IAAgB,CAClBtB,KAAKS,mBAAqBT,KAAKM,gBAC/BiB,GAAM,IAAOvB,KAAKS,mBAAqB,IAAK,I,OAEzC,GACLT,KAAKU,mBACLc,EAAAxB,KAAKe,QAAI,MAAAS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KAAKsH,QAEtBxF,EAAkB9B,KAAK+B,QAAS/B,KAAKgC,aACpC+C,EAAA,eACEwC,KAAK,QACLC,KAAMxH,KAAKyH,YACX7C,GAAI5E,KAAKG,YAERH,KAAK+B,SAEN,KACH/B,KAAKU,gBACJqE,EACE,eAAAwC,KAAK,QACLG,SAAS,aACT9C,GAAI5E,KAAKI,iBAERJ,KAAKY,cAAgBiB,GAEtB,KACJkD,EAAA,eAAAC,IAAA,2CACEuC,KAAK,QACLG,SAAS,WACT9C,GAAI5E,KAAKK,mBAERL,KAAKM,iBAERyE,EAAA,QAAAC,IAAA,kEAA2B,OAAO2C,KAAK,UACpC3H,KAAKS,oB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import{r as i,c as t,h as s,F as a}from"./p-CK6m6IJ4.js";import{n}from"./p-DC9V_oNU.js";import{u as h,d as e,b as o,g as d,j as l,c as r}from"./p-YECpAE3G.js";import{N as c}from"./p-DdyDId49.js";import"./p-CifCRcqG.js";const u=class{constructor(s){i(this,s);this.click=t(this,"click");this.initialized=false;this.hasAreaPopup=false;this.hasSubNavigation=true;this.isSubNavigationExpanded=false;this.autoClose=false;this.subNavigationId="sub-navigation-"+h();this.navigationItemSafeTriangle=undefined}handleNavigationItemClick(i){var t;if(((t=i===null||i===void 0?void 0:i.target)===null||t===void 0?void 0:t.nodeName)==="A"){this.autoClose=true;void e((()=>{this.autoClose=false}),1e3)}}handleClick(i){if(this.click){i.stopPropagation();this.click.emit(i)}if(this.hasAreaPopup){this.isSubNavigationExpanded=true}}handleBackClick(i){i.stopPropagation();this.isSubNavigationExpanded=false}enableAttributePassing(i,t){const s=i===null||i===void 0?void 0:i.closest(t);if(i&&s){const t=s.attributes;for(let a=0;a<t.length;a++){const n=t.item(a);if(n&&(n.name.startsWith("data-")||n.name.startsWith("aria-"))){i.setAttribute(n.name,n.value);s.removeAttribute(n.name)}if(n&&n.name==="class"){const t=n.value.includes("hydrated");const a=n.value.replace("hydrated","").trim();const h=i.getAttribute("class");i.setAttribute(n.name,`${h?`${h} `:""}${a}`);if(t){s.setAttribute("class","hydrated")}else{s.removeAttribute(n.name)}}}}}watch0Fn(){if(this.subNavigationExpanded!==undefined){this.isSubNavigationExpanded=!!o(this.subNavigationExpanded,"subNavigationExpanded")}}watch0(){this.watch0Fn()}watch1Fn(){var i;if(this.initialized&&this._ref){const t=this._ref.querySelector("menu");if(t){if(((i=t.children)===null||i===void 0?void 0:i.length)>0){this.hasAreaPopup=true;if(!this.navigationItemSafeTriangle){this.navigationItemSafeTriangle=new c(this._ref,t)}}else{this.hasSubNavigation=false}}}}watch1(){this.watch1Fn()}componentDidLoad(){this.enableAttributePassing(this._ref,"db-navigation-item");this.initialized=true;this.watch0Fn();this.watch1Fn()}render(){var i;return s("li",{key:"62b4491ae6751fc7cc00c2dfb411141111171fb1",class:r("db-navigation-item",this.className),ref:i=>{this._ref=i},id:this.id,onMouseOver:()=>{var i;return(i=this.navigationItemSafeTriangle)===null||i===void 0?void 0:i.enableFollow()},onMouseLeave:()=>{var i;return(i=this.navigationItemSafeTriangle)===null||i===void 0?void 0:i.disableFollow()},onMouseMove:i=>{var t;return(t=this.navigationItemSafeTriangle)===null||t===void 0?void 0:t.followByMouseEvent(i)},"data-width":this.width,"data-icon":this.icon,"data-hide-icon":l(this.showIcon),"data-active":this.active,"data-wrap":d(this.wrap),"aria-disabled":d(this.disabled)},!this.hasSubNavigation?this.text?this.text:s("slot",null):null,this.hasSubNavigation?s(a,null,s("button",{class:"db-navigation-item-expand-button","aria-haspopup":this.hasAreaPopup,"aria-expanded":this.isSubNavigationExpanded,disabled:o(this.disabled,"disabled"),onClick:i=>this.handleClick(i)},this.text?this.text:s("slot",null)),s("menu",{class:"db-sub-navigation","data-force-close":this.autoClose,id:this.subNavigationId,onClick:i=>this.handleNavigationItemClick(i)},this.hasAreaPopup?s("div",{class:"db-mobile-navigation-back"},s("db-button",{icon:"arrow_left",variant:"ghost",id:this.backButtonId,onClick:i=>this.handleBackClick(i)},(i=this.backButtonText)!==null&&i!==void 0?i:n)):null,s("slot",{name:"subNavigation"}))):null)}static get watchers(){return{subNavigationExpanded:["watch0"],initialized:["watch1"],_ref:["watch1"]}}};export{u as db_navigation_item};
2
+ //# sourceMappingURL=p-90eef6ac.entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DBNavigationItem","constructor","hostRef","this","initialized","hasAreaPopup","hasSubNavigation","isSubNavigationExpanded","autoClose","subNavigationId","uuid","navigationItemSafeTriangle","undefined","handleNavigationItemClick","event","_a","target","nodeName","delay","handleClick","click","stopPropagation","emit","handleBackClick","enableAttributePassing","element","customElementSelector","parent","closest","attributes","i","length","attr","item","name","startsWith","setAttribute","value","removeAttribute","isWebComponent","includes","replace","trim","currentClass","getAttribute","watch0Fn","subNavigationExpanded","getBoolean","watch0","watch1Fn","_ref","subNavigationSlot","querySelector","children","NavigationItemSafeTriangle","watch1","componentDidLoad","render","h","key","class","cls","className","ref","el","id","onMouseOver","enableFollow","onMouseLeave","disableFollow","onMouseMove","followByMouseEvent","width","icon","getHideProp","showIcon","active","getBooleanAsString","wrap","disabled","text","Fragment","onClick","variant","backButtonId","backButtonText","DEFAULT_BACK"],"sources":["src/components/navigation-item/navigation-item.tsx"],"sourcesContent":["import { DEFAULT_BACK } from \"../../shared/constants\";\nimport { ClickEvent } from \"../../shared/model\";\nimport {\n cls,\n delay,\n getBoolean,\n getBooleanAsString,\n getHideProp,\n uuid,\n} from \"../../utils\";\nimport { NavigationItemSafeTriangle } from \"../../utils/navigation\";\nimport { DBButton } from \"../button/button\";\nimport { DBNavigationItemProps, DBNavigationItemState } from \"./model\";\n\nimport {\n Component,\n h,\n Fragment,\n Watch,\n Event,\n EventEmitter,\n Prop,\n State,\n} from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n * @slot subNavigation - TODO: Add description for slotSubNavigation\n */\n @Component({\n tag: \"db-navigation-item\",\n})\nexport class DBNavigationItem {\n private _ref!: HTMLLIElement | any;\n @Prop() subNavigationExpanded: DBNavigationItemProps[\"subNavigationExpanded\"];\n @Event() click: EventEmitter<\n Parameters<Required<DBNavigationItemProps>[\"onClick\"]>[number]\n > | void;\n @Prop() id: DBNavigationItemProps[\"id\"];\n @Prop({attribute: \"classname\"}) className: DBNavigationItemProps[\"className\"];\n @Prop() width: DBNavigationItemProps[\"width\"];\n @Prop() icon: DBNavigationItemProps[\"icon\"];\n @Prop() showIcon: DBNavigationItemProps[\"showIcon\"];\n @Prop() active: DBNavigationItemProps[\"active\"];\n @Prop() wrap: DBNavigationItemProps[\"wrap\"];\n @Prop() disabled: DBNavigationItemProps[\"disabled\"];\n @Prop() text: DBNavigationItemProps[\"text\"];\n @Prop() backButtonId: DBNavigationItemProps[\"backButtonId\"];\n @Prop() backButtonText: DBNavigationItemProps[\"backButtonText\"];\n @State() initialized = false;\n @State() hasAreaPopup = false;\n @State() hasSubNavigation = true;\n @State() isSubNavigationExpanded = false;\n @State() autoClose = false;\n @State() subNavigationId = \"sub-navigation-\" + uuid();\n @State() navigationItemSafeTriangle = undefined;\n\n handleNavigationItemClick(event: any) {\n if (event?.target?.nodeName === \"A\") {\n this.autoClose = true;\n void delay(() => {\n this.autoClose = false;\n }, 1000);\n }\n }\n handleClick(event: ClickEvent<HTMLButtonElement> | any) {\n if (this.click) {\n event.stopPropagation();\n this.click.emit(event);\n }\n if (this.hasAreaPopup) {\n this.isSubNavigationExpanded = true;\n }\n }\n handleBackClick(event: ClickEvent<HTMLButtonElement> | any) {\n event.stopPropagation();\n this.isSubNavigationExpanded = false;\n }\n\n /**\n * Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.\n * @param element the ref for the component\n * @param customElementSelector the custom element like `my-component`\n */\n private enableAttributePassing(\n element: HTMLElement | null,\n customElementSelector: string\n ) {\n const parent = element?.closest(customElementSelector);\n if (element && parent) {\n const attributes = parent.attributes;\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes.item(i);\n if (\n attr &&\n (attr.name.startsWith(\"data-\") || attr.name.startsWith(\"aria-\"))\n ) {\n element.setAttribute(attr.name, attr.value);\n parent.removeAttribute(attr.name);\n }\n if (attr && attr.name === \"class\") {\n const isWebComponent = attr.value.includes(\"hydrated\");\n const value = attr.value.replace(\"hydrated\", \"\").trim();\n const currentClass = element.getAttribute(\"class\");\n element.setAttribute(\n attr.name,\n `${currentClass ? `${currentClass} ` : \"\"}${value}`\n );\n if (isWebComponent) {\n // Stencil is using this class for lazy loading component\n parent.setAttribute(\"class\", \"hydrated\");\n } else {\n parent.removeAttribute(attr.name);\n }\n }\n }\n }\n }\n\n watch0Fn() {\n if (this.subNavigationExpanded !== undefined) {\n this.isSubNavigationExpanded = !!getBoolean(\n this.subNavigationExpanded,\n \"subNavigationExpanded\"\n );\n }\n }\n\n @Watch(\"subNavigationExpanded\")\n watch0() {\n this.watch0Fn();\n }\n\n watch1Fn() {\n if (this.initialized && this._ref) {\n const subNavigationSlot = this._ref.querySelector(\"menu\");\n if (subNavigationSlot) {\n if (subNavigationSlot.children?.length > 0) {\n this.hasAreaPopup = true;\n if (!this.navigationItemSafeTriangle) {\n this.navigationItemSafeTriangle = new NavigationItemSafeTriangle(\n this._ref,\n subNavigationSlot\n );\n }\n } else {\n this.hasSubNavigation = false;\n }\n }\n }\n }\n\n @Watch(\"initialized\")\n @Watch(\"_ref\")\n watch1() {\n this.watch1Fn();\n }\n\n componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-navigation-item\");\n this.initialized = true;\n this.watch0Fn();\n this.watch1Fn();\n }\n\n render() {\n return (\n <li\n class={cls(\"db-navigation-item\", this.className)}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this.id}\n onMouseOver={() => this.navigationItemSafeTriangle?.enableFollow()}\n onMouseLeave={() => this.navigationItemSafeTriangle?.disableFollow()}\n onMouseMove={(event) =>\n this.navigationItemSafeTriangle?.followByMouseEvent(event)\n }\n data-width={this.width}\n data-icon={this.icon}\n data-hide-icon={getHideProp(this.showIcon)}\n data-active={this.active}\n data-wrap={getBooleanAsString(this.wrap)}\n aria-disabled={getBooleanAsString(this.disabled)}\n >\n {!this.hasSubNavigation ? this.text ? this.text : <slot></slot> : null}\n {this.hasSubNavigation ? (\n <Fragment>\n <button\n class=\"db-navigation-item-expand-button\"\n aria-haspopup={this.hasAreaPopup}\n aria-expanded={this.isSubNavigationExpanded}\n disabled={getBoolean(this.disabled, \"disabled\")}\n onClick={(event) => this.handleClick(event)}\n >\n {this.text ? this.text : <slot></slot>}\n </button>\n <menu\n class=\"db-sub-navigation\"\n data-force-close={this.autoClose}\n id={this.subNavigationId}\n onClick={(event) => this.handleNavigationItemClick(event)}\n >\n {this.hasAreaPopup ? (\n <div class=\"db-mobile-navigation-back\">\n <db-button\n icon=\"arrow_left\"\n variant=\"ghost\"\n id={this.backButtonId}\n onClick={(event) => this.handleBackClick(event)}\n >\n {this.backButtonText ?? DEFAULT_BACK}\n </db-button>\n </div>\n ) : null}\n <slot name=\"subNavigation\"></slot>\n </menu>\n </Fragment>\n ) : null}\n </li>\n );\n }\n}\n"],"mappings":"iOAiCaA,EAAgB,MAH5B,WAAAC,CAAAC,G,qCAoBUC,KAAWC,YAAG,MACdD,KAAYE,aAAG,MACfF,KAAgBG,iBAAG,KACnBH,KAAuBI,wBAAG,MAC1BJ,KAASK,UAAG,MACZL,KAAAM,gBAAkB,kBAAoBC,IACtCP,KAA0BQ,2BAAGC,SAuKvC,CArKC,yBAAAC,CAA0BC,G,MACxB,KAAIC,EAAAD,IAAK,MAALA,SAAA,SAAAA,EAAOE,UAAQ,MAAAD,SAAA,SAAAA,EAAAE,YAAa,IAAK,CACnCd,KAAKK,UAAY,UACZU,GAAM,KACTf,KAAKK,UAAY,KAAK,GACrB,I,EAGP,WAAAW,CAAYL,GACV,GAAIX,KAAKiB,MAAO,CACdN,EAAMO,kBACNlB,KAAKiB,MAAME,KAAKR,E,CAElB,GAAIX,KAAKE,aAAc,CACrBF,KAAKI,wBAA0B,I,EAGnC,eAAAgB,CAAgBT,G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AM,6BACTF,EAAA,aACEe,KAAK,aACLU,QAAQ,QACRlB,GAAI9D,KAAKiF,aACTF,QAAUpE,GAAUX,KAAKoB,gBAAgBT,KAExCC,EAAAZ,KAAKkF,kBAAc,MAAAtE,SAAA,EAAAA,EAAIuE,IAG1B,KACJ5B,EAAA,QAAMxB,KAAK,oBAGb,K","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import{r as i,c as t,h as s}from"./p-CK6m6IJ4.js";import{l as h,g as a,h as e,f as d,k as c}from"./p-DC9V_oNU.js";import{h as n,d as l,s as o,b as r,u as f,j as u,c as b}from"./p-YECpAE3G.js";const v=class{constructor(s){i(this,s);this.change=t(this,"change");this.blur=t(this,"blur");this.focus=t(this,"focus");this.initialized=false;this._id=undefined;this._messageId=undefined;this._validMessageId=undefined;this._invalidMessageId=undefined;this._invalidMessage=undefined;this._descByIds="";this._voiceOverFallback=""}hasValidState(){var i;return!!((i=this.validMessage)!==null&&i!==void 0?i:this.validation==="valid")}handleValidation(){var i,t,s,a;if(!((i=this._ref)===null||i===void 0?void 0:i.validity.valid)||this.validation==="invalid"){this._descByIds=this._invalidMessageId;this._invalidMessage=this.invalidMessage||((t=this._ref)===null||t===void 0?void 0:t.validationMessage)||h;if(n()){this._voiceOverFallback=this._invalidMessage;l((()=>this._voiceOverFallback=""),1e3)}}else if(this.hasValidState()&&((s=this._ref)===null||s===void 0?void 0:s.validity.valid)&&this.required){this._descByIds=this._validMessageId;if(n()){this._voiceOverFallback=(a=this.validMessage)!==null&&a!==void 0?a:c;l((()=>this._voiceOverFallback=""),1e3)}}else if(o(this.message,this.showMessage)){this._descByIds=this._messageId}else{this._descByIds=""}}handleChange(i){if(this.change){this.change.emit(i)}this.handleValidation()}handleBlur(i){if(this.blur){this.blur.emit(i)}}handleFocus(i){if(this.focus){this.focus.emit(i)}}enableAttributePassing(i,t){const s=i===null||i===void 0?void 0:i.closest(t);if(i&&s){const t=s.attributes;for(let h=0;h<t.length;h++){const a=t.item(h);if(a&&(a.name.startsWith("data-")||a.name.startsWith("aria-"))){i.setAttribute(a.name,a.value);s.removeAttribute(a.name)}if(a&&a.name==="class"){const t=a.value.includes("hydrated");const h=a.value.replace("hydrated","").trim();const e=i.getAttribute("class");i.setAttribute(a.name,`${e?`${e} `:""}${h}`);if(t){s.setAttribute("class","hydrated")}else{s.removeAttribute(a.name)}}}}}watch0Fn(){var i;this._invalidMessage=this.invalidMessage||((i=this._ref)===null||i===void 0?void 0:i.validationMessage)||h}watch0(){this.watch0Fn()}watch1Fn(){if(this._id){const i=this._id+d;this._messageId=i;this._validMessageId=this._id+a;this._invalidMessageId=this._id+e;if(o(this.message,this.showMessage)){this._descByIds=i}}}watch1(){this.watch1Fn()}watch2Fn(){if(this._ref){if(this.indeterminate!==undefined){this._ref.indeterminate=!!r(this.indeterminate)}}}watch2(){this.watch2Fn()}watch3Fn(){if(this.initialized&&this._ref){if(this.checked!=undefined){this._ref.checked=!!r(this.checked)}this.initialized=false}}watch3(){this.watch3Fn()}componentDidLoad(){var i;this.enableAttributePassing(this._ref,"db-checkbox");this.initialized=true;const t=(i=this.id)!==null&&i!==void 0?i:`checkbox-${f()}`;this._id=t;this._messageId=t+d;this._validMessageId=t+a;this._invalidMessageId=t+e;this._invalidMessage=this.invalidMessage||h;this.watch0Fn();this.watch1Fn();this.watch2Fn();this.watch3Fn()}render(){var i;return s("div",{key:"48ac9c81c099dd609eabd76285b792bc0dec643f",class:b("db-checkbox",this.className),"data-size":this.size,"data-hide-label":u(this.showLabel)},s("label",{key:"72c23808443bdbc7a4824f34a0e0004146f01dad",htmlFor:this._id},s("input",{key:"f2dd4f17d83f8c9743b784a006a6ec4b46aa95d4",type:"checkbox","aria-invalid":this.validation==="invalid","data-custom-validity":this.validation,ref:i=>{this._ref=i},id:this._id,name:this.name,checked:r(this.checked,"checked"),disabled:r(this.disabled,"disabled"),value:this.value,required:r(this.required,"required"),"data-hide-asterisk":u(this.showRequiredAsterisk),onChange:i=>this.handleChange(i),onBlur:i=>this.handleBlur(i),onFocus:i=>this.handleFocus(i),"aria-describedby":(i=this.ariaDescribedBy)!==null&&i!==void 0?i:this._descByIds}),this.label?this.label:s("slot",null)),o(this.message,this.showMessage)?s("db-infotext",{size:"small",icon:this.messageIcon,id:this._messageId},this.message):null,this.hasValidState()?s("db-infotext",{size:"small",semantic:"successful",id:this._validMessageId},this.validMessage||c):null,s("db-infotext",{key:"cc0e9ba19bd95441f3c310e71a77874bcd9d1311",size:"small",semantic:"critical",id:this._invalidMessageId},this._invalidMessage),s("span",{key:"c627e923cbe17904177a99cb93f3ea929f83db3c","data-visually-hidden":"true",role:"status"},this._voiceOverFallback))}static get watchers(){return{_ref:["watch0","watch2","watch3"],invalidMessage:["watch0"],_id:["watch1"],initialized:["watch2","watch3"],indeterminate:["watch2"],checked:["watch3"]}}};export{v as db_checkbox};
2
- //# sourceMappingURL=p-518d1a26.entry.js.map
1
+ import{r as i,c as t,h as s}from"./p-CK6m6IJ4.js";import{l as h,g as a,h as e,f as d,k as c}from"./p-DC9V_oNU.js";import{h as n,d as l,s as o,b as f,u as r,j as u,c as b}from"./p-YECpAE3G.js";const v=class{constructor(s){i(this,s);this.change=t(this,"change");this.blur=t(this,"blur");this.focus=t(this,"focus");this.initialized=false;this._id=undefined;this._messageId=undefined;this._validMessageId=undefined;this._invalidMessageId=undefined;this._invalidMessage=undefined;this._descByIds="";this._voiceOverFallback=""}hasValidState(){var i;return!!((i=this.validMessage)!==null&&i!==void 0?i:this.validation==="valid")}handleValidation(){var i,t,s,a;if(!((i=this._ref)===null||i===void 0?void 0:i.validity.valid)||this.validation==="invalid"){this._descByIds=this._invalidMessageId;this._invalidMessage=this.invalidMessage||((t=this._ref)===null||t===void 0?void 0:t.validationMessage)||h;if(n()){this._voiceOverFallback=this._invalidMessage;l((()=>this._voiceOverFallback=""),1e3)}}else if(this.hasValidState()&&((s=this._ref)===null||s===void 0?void 0:s.validity.valid)&&this.required){this._descByIds=this._validMessageId;if(n()){this._voiceOverFallback=(a=this.validMessage)!==null&&a!==void 0?a:c;l((()=>this._voiceOverFallback=""),1e3)}}else if(o(this.message,this.showMessage)){this._descByIds=this._messageId}else{this._descByIds=""}}handleChange(i){if(this.change){this.change.emit(i)}this.handleValidation()}handleBlur(i){if(this.blur){this.blur.emit(i)}}handleFocus(i){if(this.focus){this.focus.emit(i)}}enableAttributePassing(i,t){const s=i===null||i===void 0?void 0:i.closest(t);if(i&&s){const t=s.attributes;for(let h=0;h<t.length;h++){const a=t.item(h);if(a&&(a.name.startsWith("data-")||a.name.startsWith("aria-"))){i.setAttribute(a.name,a.value);s.removeAttribute(a.name)}if(a&&a.name==="class"){const t=a.value.includes("hydrated");const h=a.value.replace("hydrated","").trim();const e=i.getAttribute("class");i.setAttribute(a.name,`${e?`${e} `:""}${h}`);if(t){s.setAttribute("class","hydrated")}else{s.removeAttribute(a.name)}}}}}watch0Fn(){var i;this._invalidMessage=this.invalidMessage||((i=this._ref)===null||i===void 0?void 0:i.validationMessage)||h}watch0(){this.watch0Fn()}watch1Fn(){if(this._id){const i=this._id+d;this._messageId=i;this._validMessageId=this._id+a;this._invalidMessageId=this._id+e;if(o(this.message,this.showMessage)){this._descByIds=i}}}watch1(){this.watch1Fn()}watch2Fn(){if(this._ref){if(this.indeterminate!==undefined){this._ref.indeterminate=!!f(this.indeterminate)}}}watch2(){this.watch2Fn()}watch3Fn(){if(this.initialized&&this._ref){if(this.checked!=undefined){this._ref.checked=!!f(this.checked)}this.initialized=false}}watch3(){this.watch3Fn()}componentDidLoad(){var i;this.enableAttributePassing(this._ref,"db-checkbox");this.initialized=true;const t=(i=this.id)!==null&&i!==void 0?i:`checkbox-${r()}`;this._id=t;this._messageId=t+d;this._validMessageId=t+a;this._invalidMessageId=t+e;this._invalidMessage=this.invalidMessage||h;this.watch0Fn();this.watch1Fn();this.watch2Fn();this.watch3Fn()}render(){var i;return s("div",{key:"d09d5b8c0b6192a373fd8e6600fdb8e533cc3ab5",class:b("db-checkbox",this.className),"data-size":this.size,"data-hide-asterisk":u(this.showRequiredAsterisk),"data-hide-label":u(this.showLabel)},s("label",{key:"c95d8c43a6949a51cce6b9bcafe1fa4cf802531a",htmlFor:this._id},s("input",{key:"3894ac295370c9a4bd7d5d7bc84b913fe195f8f4",type:"checkbox","aria-invalid":this.validation==="invalid","data-custom-validity":this.validation,ref:i=>{this._ref=i},id:this._id,name:this.name,checked:f(this.checked,"checked"),disabled:f(this.disabled,"disabled"),value:this.value,required:f(this.required,"required"),onChange:i=>this.handleChange(i),onBlur:i=>this.handleBlur(i),onFocus:i=>this.handleFocus(i),"aria-describedby":(i=this.ariaDescribedBy)!==null&&i!==void 0?i:this._descByIds}),this.label?this.label:s("slot",null)),o(this.message,this.showMessage)?s("db-infotext",{size:"small",icon:this.messageIcon,id:this._messageId},this.message):null,this.hasValidState()?s("db-infotext",{size:"small",semantic:"successful",id:this._validMessageId},this.validMessage||c):null,s("db-infotext",{key:"d7eda556b0b13f40183f06471b7fa559ecf0a26c",size:"small",semantic:"critical",id:this._invalidMessageId},this._invalidMessage),s("span",{key:"dd9238f5200aa849b78c64fb46313559dc8d08a4","data-visually-hidden":"true",role:"status"},this._voiceOverFallback))}static get watchers(){return{_ref:["watch0","watch2","watch3"],invalidMessage:["watch0"],_id:["watch1"],initialized:["watch2","watch3"],indeterminate:["watch2"],checked:["watch3"]}}};export{v as db_checkbox};
2
+ //# sourceMappingURL=p-fdb8daba.entry.js.map