@db-ux/wc-core-components 1.0.0 → 1.1.0
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.
- package/dist/cjs/db-accordion-item.cjs.entry.js +1 -1
- package/dist/cjs/db-accordion.cjs.entry.js +1 -1
- package/dist/cjs/db-badge.cjs.entry.js +1 -1
- package/dist/cjs/db-brand.cjs.entry.js +1 -1
- package/dist/cjs/db-button.cjs.entry.js +1 -1
- package/dist/cjs/db-card.cjs.entry.js +1 -1
- package/dist/cjs/db-checkbox.cjs.entry.js +15 -16
- package/dist/cjs/db-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/db-divider.cjs.entry.js +1 -1
- package/dist/cjs/db-drawer.cjs.entry.js +1 -1
- package/dist/cjs/db-header.cjs.entry.js +2 -2
- package/dist/cjs/db-icon.cjs.entry.js +1 -1
- package/dist/cjs/db-infotext.cjs.entry.js +1 -1
- package/dist/cjs/db-input.cjs.entry.js +3 -3
- package/dist/cjs/db-input.cjs.entry.js.map +1 -1
- package/dist/cjs/db-link.cjs.entry.js +1 -1
- package/dist/cjs/db-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/db-navigation.cjs.entry.js +1 -1
- package/dist/cjs/db-notification.cjs.entry.js +1 -1
- package/dist/cjs/db-page.cjs.entry.js +1 -1
- package/dist/cjs/db-popover.cjs.entry.js +1 -1
- package/dist/cjs/db-radio.cjs.entry.js +4 -9
- package/dist/cjs/db-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/db-section.cjs.entry.js +1 -1
- package/dist/cjs/db-select.cjs.entry.js +5 -5
- package/dist/cjs/db-select.cjs.entry.js.map +1 -1
- package/dist/cjs/db-stack.cjs.entry.js +1 -1
- package/dist/cjs/db-switch.cjs.entry.js +8 -4
- package/dist/cjs/db-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/db-tab-item_3.cjs.entry.js +3 -3
- package/dist/cjs/db-tab-item_3.cjs.entry.js.map +1 -1
- package/dist/cjs/db-tabs.cjs.entry.js +21 -4
- package/dist/cjs/db-tabs.cjs.entry.js.map +1 -1
- package/dist/cjs/db-tag.cjs.entry.js +1 -1
- package/dist/cjs/db-textarea.cjs.entry.js +1 -1
- package/dist/cjs/db-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/db-ux.cjs.js +1 -1
- package/dist/cjs/{index-c0df827d.js → index-403366c7.js} +1 -12
- package/dist/cjs/index-403366c7.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -4
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{navigation-bb2d5552.js → navigation-5586b826.js} +2 -2
- package/dist/cjs/{navigation-bb2d5552.js.map → navigation-5586b826.js.map} +1 -1
- package/dist/collection/components/checkbox/checkbox.js +21 -22
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/input/input.js +27 -2
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/input/model.js.map +1 -1
- package/dist/collection/components/radio/radio.js +3 -8
- package/dist/collection/components/radio/radio.js.map +1 -1
- package/dist/collection/components/select/model.js.map +1 -1
- package/dist/collection/components/select/select.js +29 -4
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/components/switch/model.js.map +1 -1
- package/dist/collection/components/switch/switch.js +38 -10
- package/dist/collection/components/switch/switch.js.map +1 -1
- package/dist/collection/components/tab-item/tab-item.js +2 -2
- package/dist/collection/components/tab-item/tab-item.js.map +1 -1
- package/dist/collection/components/tabs/model.js.map +1 -1
- package/dist/collection/components/tabs/tabs.js +51 -3
- package/dist/collection/components/tabs/tabs.js.map +1 -1
- package/dist/collection/shared/model.js.map +1 -1
- package/dist/collection/utils/index.js +0 -11
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/collection/utils/react.js +16 -0
- package/dist/collection/utils/react.js.map +1 -0
- package/dist/custom-elements.json +144 -43
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/db-ux.esm.js.map +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/index.esm.js.map +1 -1
- package/dist/db-ux/p-0983e297.entry.js +2 -0
- package/dist/db-ux/p-0983e297.entry.js.map +1 -0
- package/dist/db-ux/{p-34f88e4e.js → p-0cdf053e.js} +2 -2
- package/dist/db-ux/{p-2d32aa06.entry.js → p-0d08f973.entry.js} +2 -2
- package/dist/db-ux/{p-78e5293a.entry.js → p-123cb839.entry.js} +2 -2
- package/dist/db-ux/p-123cb839.entry.js.map +1 -0
- package/dist/db-ux/{p-10d30f53.entry.js → p-1665a1f6.entry.js} +2 -2
- package/dist/db-ux/{p-b0f1a571.entry.js → p-1efdd41a.entry.js} +2 -2
- package/dist/db-ux/{p-031e9fbf.entry.js → p-223b1031.entry.js} +2 -2
- package/dist/db-ux/{p-a3be13fd.entry.js → p-2f695fb2.entry.js} +2 -2
- package/dist/db-ux/{p-ab8a1944.entry.js → p-300fb4ff.entry.js} +2 -2
- package/dist/db-ux/{p-d48f3770.entry.js → p-3958b712.entry.js} +2 -2
- package/dist/db-ux/p-3958b712.entry.js.map +1 -0
- package/dist/db-ux/{p-fea6db86.entry.js → p-398c72a6.entry.js} +2 -2
- package/dist/db-ux/p-45bb9feb.js +2 -0
- package/dist/db-ux/p-45bb9feb.js.map +1 -0
- package/dist/db-ux/{p-43aa16d7.entry.js → p-5c1b65ac.entry.js} +2 -2
- package/dist/db-ux/p-69948f78.entry.js +2 -0
- package/dist/db-ux/p-69948f78.entry.js.map +1 -0
- package/dist/db-ux/{p-6b6f1f7f.entry.js → p-7eb92648.entry.js} +2 -2
- package/dist/db-ux/{p-1c12853c.entry.js → p-8d9ef330.entry.js} +2 -2
- package/dist/db-ux/{p-79b43b42.entry.js → p-90caefe4.entry.js} +2 -2
- package/dist/db-ux/{p-c6d54dd4.entry.js → p-95e59a69.entry.js} +2 -2
- package/dist/db-ux/{p-71cb932e.entry.js → p-ab783af4.entry.js} +2 -2
- package/dist/db-ux/{p-3f2e2d87.entry.js → p-b0b04684.entry.js} +2 -2
- package/dist/db-ux/{p-79d9caa7.entry.js → p-b2886d1c.entry.js} +2 -2
- package/dist/db-ux/p-b4eefd78.entry.js +2 -0
- package/dist/db-ux/{p-08126c21.entry.js → p-c367b891.entry.js} +2 -2
- package/dist/db-ux/{p-1066cd52.entry.js → p-cf22eaea.entry.js} +2 -2
- package/dist/db-ux/{p-2e318e2a.entry.js → p-e1788dce.entry.js} +2 -2
- package/dist/db-ux/p-e1788dce.entry.js.map +1 -0
- package/dist/db-ux/p-e24051a3.entry.js +2 -0
- package/dist/db-ux/p-e24051a3.entry.js.map +1 -0
- package/dist/db-ux/{p-683d690f.entry.js → p-e6f5c82d.entry.js} +2 -2
- package/dist/db-ux/{p-5a689165.entry.js → p-f23ca7f6.entry.js} +2 -2
- package/dist/db-ux/{p-b47af6eb.entry.js → p-f3251c56.entry.js} +2 -2
- package/dist/db-ux/{p-8e2a086b.entry.js → p-f78c8591.entry.js} +2 -2
- package/dist/db-ux/p-fa9a7966.entry.js +2 -0
- package/dist/db-ux/p-fa9a7966.entry.js.map +1 -0
- package/dist/esm/db-accordion-item.entry.js +1 -1
- package/dist/esm/db-accordion.entry.js +1 -1
- package/dist/esm/db-badge.entry.js +1 -1
- package/dist/esm/db-brand.entry.js +1 -1
- package/dist/esm/db-button.entry.js +1 -1
- package/dist/esm/db-card.entry.js +1 -1
- package/dist/esm/db-checkbox.entry.js +15 -16
- package/dist/esm/db-checkbox.entry.js.map +1 -1
- package/dist/esm/db-divider.entry.js +1 -1
- package/dist/esm/db-drawer.entry.js +1 -1
- package/dist/esm/db-header.entry.js +2 -2
- package/dist/esm/db-icon.entry.js +1 -1
- package/dist/esm/db-infotext.entry.js +1 -1
- package/dist/esm/db-input.entry.js +3 -3
- package/dist/esm/db-input.entry.js.map +1 -1
- package/dist/esm/db-link.entry.js +1 -1
- package/dist/esm/db-navigation-item.entry.js +2 -2
- package/dist/esm/db-navigation.entry.js +1 -1
- package/dist/esm/db-notification.entry.js +1 -1
- package/dist/esm/db-page.entry.js +1 -1
- package/dist/esm/db-popover.entry.js +1 -1
- package/dist/esm/db-radio.entry.js +4 -9
- package/dist/esm/db-radio.entry.js.map +1 -1
- package/dist/esm/db-section.entry.js +1 -1
- package/dist/esm/db-select.entry.js +5 -5
- package/dist/esm/db-select.entry.js.map +1 -1
- package/dist/esm/db-stack.entry.js +1 -1
- package/dist/esm/db-switch.entry.js +8 -4
- package/dist/esm/db-switch.entry.js.map +1 -1
- package/dist/esm/db-tab-item_3.entry.js +3 -3
- package/dist/esm/db-tab-item_3.entry.js.map +1 -1
- package/dist/esm/db-tabs.entry.js +22 -5
- package/dist/esm/db-tabs.entry.js.map +1 -1
- package/dist/esm/db-tag.entry.js +1 -1
- package/dist/esm/db-textarea.entry.js +1 -1
- package/dist/esm/db-tooltip.entry.js +1 -1
- package/dist/esm/db-ux.js +1 -1
- package/dist/esm/{index-fad99efc.js → index-7d31752e.js} +2 -11
- package/dist/esm/index-7d31752e.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{navigation-9fec9921.js → navigation-09e3ace3.js} +2 -2
- package/dist/esm/{navigation-9fec9921.js.map → navigation-09e3ace3.js.map} +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/input/input.d.ts +1 -0
- package/dist/types/components/input/model.d.ts +2 -2
- package/dist/types/components/select/model.d.ts +2 -2
- package/dist/types/components/select/select.d.ts +1 -0
- package/dist/types/components/switch/model.d.ts +2 -2
- package/dist/types/components/switch/switch.d.ts +3 -2
- package/dist/types/components/tab-item/tab-item.d.ts +1 -2
- package/dist/types/components/tabs/model.d.ts +9 -0
- package/dist/types/components/tabs/tabs.d.ts +3 -0
- package/dist/types/components.d.ts +24 -0
- package/dist/types/shared/model.d.ts +6 -0
- package/dist/types/utils/index.d.ts +0 -4
- package/dist/types/utils/react.d.ts +7 -0
- package/dist/vscode.html-custom-data.json +14 -7
- package/dist/web-types.json +54 -19
- package/package.json +3 -3
- package/dist/cjs/index-c0df827d.js.map +0 -1
- package/dist/db-ux/p-1566cfef.entry.js +0 -2
- package/dist/db-ux/p-1566cfef.entry.js.map +0 -1
- package/dist/db-ux/p-2e318e2a.entry.js.map +0 -1
- package/dist/db-ux/p-6f645f17.entry.js +0 -2
- package/dist/db-ux/p-6f645f17.entry.js.map +0 -1
- package/dist/db-ux/p-78e5293a.entry.js.map +0 -1
- package/dist/db-ux/p-871805e1.entry.js +0 -2
- package/dist/db-ux/p-871805e1.entry.js.map +0 -1
- package/dist/db-ux/p-99d90022.js +0 -2
- package/dist/db-ux/p-99d90022.js.map +0 -1
- package/dist/db-ux/p-a494046c.entry.js +0 -2
- package/dist/db-ux/p-a494046c.entry.js.map +0 -1
- package/dist/db-ux/p-d48f3770.entry.js.map +0 -1
- package/dist/db-ux/p-f65f4eac.entry.js +0 -2
- package/dist/esm/index-fad99efc.js.map +0 -1
- /package/dist/db-ux/{p-34f88e4e.js.map → p-0cdf053e.js.map} +0 -0
- /package/dist/db-ux/{p-2d32aa06.entry.js.map → p-0d08f973.entry.js.map} +0 -0
- /package/dist/db-ux/{p-10d30f53.entry.js.map → p-1665a1f6.entry.js.map} +0 -0
- /package/dist/db-ux/{p-b0f1a571.entry.js.map → p-1efdd41a.entry.js.map} +0 -0
- /package/dist/db-ux/{p-031e9fbf.entry.js.map → p-223b1031.entry.js.map} +0 -0
- /package/dist/db-ux/{p-a3be13fd.entry.js.map → p-2f695fb2.entry.js.map} +0 -0
- /package/dist/db-ux/{p-ab8a1944.entry.js.map → p-300fb4ff.entry.js.map} +0 -0
- /package/dist/db-ux/{p-fea6db86.entry.js.map → p-398c72a6.entry.js.map} +0 -0
- /package/dist/db-ux/{p-43aa16d7.entry.js.map → p-5c1b65ac.entry.js.map} +0 -0
- /package/dist/db-ux/{p-6b6f1f7f.entry.js.map → p-7eb92648.entry.js.map} +0 -0
- /package/dist/db-ux/{p-1c12853c.entry.js.map → p-8d9ef330.entry.js.map} +0 -0
- /package/dist/db-ux/{p-79b43b42.entry.js.map → p-90caefe4.entry.js.map} +0 -0
- /package/dist/db-ux/{p-c6d54dd4.entry.js.map → p-95e59a69.entry.js.map} +0 -0
- /package/dist/db-ux/{p-71cb932e.entry.js.map → p-ab783af4.entry.js.map} +0 -0
- /package/dist/db-ux/{p-3f2e2d87.entry.js.map → p-b0b04684.entry.js.map} +0 -0
- /package/dist/db-ux/{p-79d9caa7.entry.js.map → p-b2886d1c.entry.js.map} +0 -0
- /package/dist/db-ux/{p-f65f4eac.entry.js.map → p-b4eefd78.entry.js.map} +0 -0
- /package/dist/db-ux/{p-08126c21.entry.js.map → p-c367b891.entry.js.map} +0 -0
- /package/dist/db-ux/{p-1066cd52.entry.js.map → p-cf22eaea.entry.js.map} +0 -0
- /package/dist/db-ux/{p-683d690f.entry.js.map → p-e6f5c82d.entry.js.map} +0 -0
- /package/dist/db-ux/{p-5a689165.entry.js.map → p-f23ca7f6.entry.js.map} +0 -0
- /package/dist/db-ux/{p-b47af6eb.entry.js.map → p-f3251c56.entry.js.map} +0 -0
- /package/dist/db-ux/{p-8e2a086b.entry.js.map → p-f78c8591.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/input/model.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,aAAa,GAAI,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM;IACjF,mCAAmC;IACnC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO;IAChD,mCAAmC;IACnC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAW,CAAC","sourcesContent":["import { ChangeEventProps, ChangeEventState, FocusEventProps, FocusEventState, FormMessageProps, FormProps, FormState, FormTextProps, GlobalProps, GlobalState, IconAfterProps, IconProps, InputEventProps, InputEventState, ShowIconProps, ValueLabelType } from '../../shared/model';\nexport const InputTypeList = (['color', 'date', 'datetime-local', 'email', 'file',\n// TODO: move this to own component\n'hidden', 'month', 'number', 'password', 'range',\n// TODO: move this to own component\n'search', 'tel', 'text', 'time', 'url', 'week'] as const);\nexport type InputTypeType = (typeof InputTypeList)[number];\nexport type DBInputDefaultProps = {\n /**\n * Set a [data list](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) via attribute instead of children.\n */\n dataList?: string[] | ValueLabelType[];\n /**\n * Add a custom id to [data list](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) if you're using `dataList` attribute.\n */\n dataListId?: string;\n /**\n * Maximum value\n */\n max?: number | string;\n /**\n * Minimum value\n */\n min?: number | string;\n\n /**\n * Pattern the value must match to be valid\n */\n pattern?: string;\n /**\n * \tType of form control\n */\n type?: InputTypeType | string;\n /**\n * Sets [step value](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/step).\n */\n step?: number | string;\n};\nexport type DBInputProps = DBInputDefaultProps & GlobalProps & FormTextProps & InputEventProps<HTMLInputElement> & ChangeEventProps<HTMLInputElement> & FocusEventProps<HTMLInputElement> & FormProps & IconProps & IconAfterProps & FormMessageProps & ShowIconProps;\nexport type DBInputDefaultState = {\n _dataListId?: string;\n getDataList: (_list?: string[] | ValueLabelType[]) => ValueLabelType[];\n};\nexport type DBInputState = DBInputDefaultState & GlobalState & InputEventState<HTMLInputElement> & ChangeEventState<HTMLInputElement> & FocusEventState<HTMLInputElement> & FormState"]}
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/input/model.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,aAAa,GAAI,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM;IACjF,mCAAmC;IACnC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO;IAChD,mCAAmC;IACnC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAW,CAAC","sourcesContent":["import { ChangeEventProps, ChangeEventState, FocusEventProps, FocusEventState, FormMessageProps, FormProps, FormSizeProps, FormState, FormTextProps, GlobalProps, GlobalState, IconAfterProps, IconProps, InputEventProps, InputEventState, ShowIconProps, ValueLabelType } from '../../shared/model';\nexport const InputTypeList = (['color', 'date', 'datetime-local', 'email', 'file',\n// TODO: move this to own component\n'hidden', 'month', 'number', 'password', 'range',\n// TODO: move this to own component\n'search', 'tel', 'text', 'time', 'url', 'week'] as const);\nexport type InputTypeType = (typeof InputTypeList)[number];\nexport type DBInputDefaultProps = {\n /**\n * Set a [data list](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) via attribute instead of children.\n */\n dataList?: string[] | ValueLabelType[];\n /**\n * Add a custom id to [data list](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist) if you're using `dataList` attribute.\n */\n dataListId?: string;\n /**\n * Maximum value\n */\n max?: number | string;\n /**\n * Minimum value\n */\n min?: number | string;\n\n /**\n * Pattern the value must match to be valid\n */\n pattern?: string;\n /**\n * \tType of form control\n */\n type?: InputTypeType | string;\n /**\n * Sets [step value](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/step).\n */\n step?: number | string;\n};\nexport type DBInputProps = DBInputDefaultProps & GlobalProps & FormTextProps & InputEventProps<HTMLInputElement> & ChangeEventProps<HTMLInputElement> & FocusEventProps<HTMLInputElement> & FormProps & IconProps & IconAfterProps & FormMessageProps & ShowIconProps & FormSizeProps;\nexport type DBInputDefaultState = {\n _dataListId?: string;\n getDataList: (_list?: string[] | ValueLabelType[]) => ValueLabelType[];\n};\nexport type DBInputState = DBInputDefaultState & GlobalState & InputEventState<HTMLInputElement> & ChangeEventState<HTMLInputElement> & FocusEventState<HTMLInputElement> & FormState"]}
|
|
@@ -72,17 +72,12 @@ export class DBRadio {
|
|
|
72
72
|
this._id = (_a = this.id) !== null && _a !== void 0 ? _a : `radio-${uuid()}`;
|
|
73
73
|
}
|
|
74
74
|
componentDidUpdate() {
|
|
75
|
-
if (this.checked && this.initialized &&
|
|
76
|
-
|
|
77
|
-
if (radioElement) {
|
|
78
|
-
if (this.checked != undefined) {
|
|
79
|
-
radioElement.checked = true;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
75
|
+
if (this.checked && this.initialized && this._ref) {
|
|
76
|
+
this._ref.checked = true;
|
|
82
77
|
}
|
|
83
78
|
}
|
|
84
79
|
render() {
|
|
85
|
-
return (h("label", { key: '
|
|
80
|
+
return (h("label", { key: 'cf284d1056ea238ee9172220c34bc818fa0f5216', class: cls("db-radio", this.className), "data-size": this.size, "data-hide-label": getHideProp(this.showLabel), htmlFor: this._id }, h("input", { key: '0c43cd33933fdfc52557a82c13e96f8c182183f6', type: "radio", "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
|
|
86
81
|
this._ref = el;
|
|
87
82
|
}, id: this._id, name: this.name, checked: this.checked, disabled: this.disabled, "aria-describedby": this.describedbyid, value: this.value, required: this.required, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event) }), this.label ? this.label : h("slot", null)));
|
|
88
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sourceRoot":"","sources":["../../../src/components/radio/radio.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAOrD,OAAO,EAAE,SAAS,EAAE,CAAC,EAAY,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3E;;;GAGG;AAIH,MAAM,OAAO,OAAO;IAHnB;QAwBU,gBAAW,GAAG,KAAK,CAAC;QACpB,QAAG,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"radio.js","sourceRoot":"","sources":["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AAK,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EACzC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAC3C;YACD,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,eAAa,CAClC,CACT,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBRadioProps, DBRadioState } from \"./model\";\nimport { cls, getHideProp, uuid } from \"../../utils\";\nimport { ChangeEvent, InteractionEvent } from \"../../shared/model\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\n\nimport { Component, h, Fragment, Event, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-radio\",\n})\nexport class DBRadio {\n private _ref!: HTMLInputElement | null;\n @Prop() id: DBRadioProps[\"id\"];\n @Prop() checked: DBRadioProps[\"checked\"];\n @Event() onChange: any;\n @Prop() change: DBRadioProps[\"change\"];\n @Event() onBlur: any;\n @Prop() blur: DBRadioProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBRadioProps[\"focus\"];\n @Prop() size: DBRadioProps[\"size\"];\n @Prop() showLabel: DBRadioProps[\"showLabel\"];\n @Prop({attribute: \"classname\"}) className: DBRadioProps[\"className\"];\n @Prop() validation: DBRadioProps[\"validation\"];\n @Prop() name: DBRadioProps[\"name\"];\n @Prop() disabled: DBRadioProps[\"disabled\"];\n @Prop() describedbyid: DBRadioProps[\"describedbyid\"];\n @Prop() value: DBRadioProps[\"value\"];\n @Prop() required: DBRadioProps[\"required\"];\n @Prop() label: DBRadioProps[\"label\"];\n\n @State() initialized = false;\n @State() _id = undefined;\n\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\n }\n handleBlur(event: InteractionEvent<HTMLInputElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLInputElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(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: 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 componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-radio\");\n this.initialized = true;\n this._id = this.id ?? `radio-${uuid()}`;\n }\n\n componentDidUpdate() {\n if (this.checked && this.initialized && this._ref) {\n this._ref.checked = true;\n }\n }\n\n render() {\n return (\n <label\n class={cls(\"db-radio\", this.className)}\n data-size={this.size}\n data-hide-label={getHideProp(this.showLabel)}\n htmlFor={this._id}\n >\n <input\n type=\"radio\"\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this._id}\n name={this.name}\n checked={this.checked}\n disabled={this.disabled}\n aria-describedby={this.describedbyid}\n value={this.value}\n required={this.required}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n />\n {this.label ? this.label : <slot></slot>}\n </label>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/select/model.ts"],"names":[],"mappings":"","sourcesContent":["import { ChangeEventProps, ChangeEventState, ClickEventProps, ClickEventState, FocusEventProps, FocusEventState, FormMessageProps, FormProps, FormState, GlobalProps, GlobalState, IconProps, InitializedState, InputEventProps, InputEventState, ShowIconProps } from '../../shared/model';\nexport type DBSelectDefaultProps = {\n /**\n * The description attribute will add a paragraph below the select.\n */\n description?: string;\n\n /**\n * If you don't/can't use children/slots you can pass in the options as an array.\n */\n options?: DBSelectOptionType[];\n};\nexport type DBSelectOptionType = {\n /**\n * Identifier for option\n */\n id?: string;\n\n /**\n * Disables this option\n */\n disabled?: boolean;\n\n /**\n * Selects this option\n */\n selected?: boolean;\n\n /**\n * If the value is different from the label you want to show to the user.\n */\n label?: string;\n\n /**\n * If you want to use optgroup you can nest options here.\n */\n options?: DBSelectOptionType[];\n\n /**\n * The main value you select, will be shown as default label if no label is set.\n */\n value: string | string[] | number;\n};\nexport type DBSelectProps = DBSelectDefaultProps & GlobalProps & ClickEventProps<HTMLSelectElement> & ChangeEventProps<HTMLSelectElement> & FocusEventProps<HTMLSelectElement> & InputEventProps<HTMLSelectElement> & FormProps & IconProps & FormMessageProps & ShowIconProps;\nexport type DBSelectDefaultState = {\n _placeholderId: string;\n getOptionLabel: (option: DBSelectOptionType) => string;\n};\nexport type DBSelectState = DBSelectDefaultState & GlobalState & ClickEventState<HTMLSelectElement> & ChangeEventState<HTMLSelectElement> & FocusEventState<HTMLSelectElement> & InputEventState<HTMLSelectElement> & FormState & InitializedState"]}
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/select/model.ts"],"names":[],"mappings":"","sourcesContent":["import { ChangeEventProps, ChangeEventState, ClickEventProps, ClickEventState, FocusEventProps, FocusEventState, FormMessageProps, FormProps, FormSizeProps, FormState, GlobalProps, GlobalState, IconProps, InitializedState, InputEventProps, InputEventState, ShowIconProps } from '../../shared/model';\nexport type DBSelectDefaultProps = {\n /**\n * The description attribute will add a paragraph below the select.\n */\n description?: string;\n\n /**\n * If you don't/can't use children/slots you can pass in the options as an array.\n */\n options?: DBSelectOptionType[];\n};\nexport type DBSelectOptionType = {\n /**\n * Identifier for option\n */\n id?: string;\n\n /**\n * Disables this option\n */\n disabled?: boolean;\n\n /**\n * Selects this option\n */\n selected?: boolean;\n\n /**\n * If the value is different from the label you want to show to the user.\n */\n label?: string;\n\n /**\n * If you want to use optgroup you can nest options here.\n */\n options?: DBSelectOptionType[];\n\n /**\n * The main value you select, will be shown as default label if no label is set.\n */\n value: string | string[] | number;\n};\nexport type DBSelectProps = DBSelectDefaultProps & GlobalProps & ClickEventProps<HTMLSelectElement> & ChangeEventProps<HTMLSelectElement> & FocusEventProps<HTMLSelectElement> & InputEventProps<HTMLSelectElement> & FormProps & IconProps & FormMessageProps & ShowIconProps & FormSizeProps;\nexport type DBSelectDefaultState = {\n _placeholderId: string;\n getOptionLabel: (option: DBSelectOptionType) => string;\n};\nexport type DBSelectState = DBSelectDefaultState & GlobalState & ClickEventState<HTMLSelectElement> & ChangeEventState<HTMLSelectElement> & FocusEventState<HTMLSelectElement> & InputEventState<HTMLSelectElement> & FormState & InitializedState"]}
|
|
@@ -145,16 +145,16 @@ export class DBSelect {
|
|
|
145
145
|
}
|
|
146
146
|
render() {
|
|
147
147
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
148
|
-
return (h("div", { key: '
|
|
148
|
+
return (h("div", { key: '1c026d87264bbb7476188faed638bdff983b7257', class: cls("db-select", this.className), "data-variant": this.variant, "data-hide-label": getHideProp(this.showLabel), "data-icon": this.icon, "data-hide-icon": getHideProp(this.showIcon) }, h("label", { key: '6e05a86b0f2c78603141e9de2573e2c494924301', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("select", { key: 'd3c4e34efd818c04def64f755bb3958205e54250', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, ref: (el) => {
|
|
149
149
|
this._ref = el;
|
|
150
|
-
}, required: this.required, disabled: this.disabled, id: this._id, name: this.name,
|
|
150
|
+
}, required: this.required, disabled: this.disabled, id: this._id, name: this.name, size: this.size,
|
|
151
151
|
/* @ts-ignore */
|
|
152
|
-
value: (_b = this.value) !== null && _b !== void 0 ? _b : this._value, autocomplete: this.autocomplete, onInput: (event) => this.handleInput(event), onClick: (event) => this.handleClick(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), "aria-describedby": this._descByIds }, h("option", { key: '
|
|
152
|
+
value: (_b = this.value) !== null && _b !== void 0 ? _b : this._value, autocomplete: this.autocomplete, onInput: (event) => this.handleInput(event), onClick: (event) => this.handleClick(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), "aria-describedby": this._descByIds }, h("option", { key: 'c6244178d81b998d7e25322b2dfca86d384f7df7', hidden: true }), this.options
|
|
153
153
|
? (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
|
|
154
154
|
var _a;
|
|
155
155
|
return (h(Fragment, null, option.options ? (h("optgroup", { label: this.getOptionLabel(option) }, (_a = option.options) === null || _a === void 0 ? void 0 : _a.map((optgroupOption) => (h("option", { key: optgroupOption.value.toString(), value: optgroupOption.value, selected: optgroupOption.selected, disabled: optgroupOption.disabled }, this.getOptionLabel(optgroupOption)))))) : null, !option.options ? (h("option", { value: option.value, disabled: option.disabled, selected: option.selected }, this.getOptionLabel(option))) : null));
|
|
156
156
|
})
|
|
157
|
-
: null, h("slot", { key: '
|
|
157
|
+
: null, h("slot", { key: '62937996853419228ae5738e077d4598b8691b0e' })), h("span", { key: '928d88490be50b727a7c47c54ad5fcc94b01f081', id: this._placeholderId }, (_d = this.placeholder) !== null && _d !== void 0 ? _d : this.label), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, h("db-infotext", { key: 'a4a0dbbc17cca2f44ac5800de5180a7c14638c5a', size: "small", semantic: "successful", id: this._validMessageId }, (_e = this.validMessage) !== null && _e !== void 0 ? _e : DEFAULT_VALID_MESSAGE), h("db-infotext", { key: '2ba1ac947180675feddc7a1567aa9c68cf5ca319', size: "small", semantic: "critical", id: this._invalidMessageId }, (_h = (_f = this.invalidMessage) !== null && _f !== void 0 ? _f : (_g = this._ref) === null || _g === void 0 ? void 0 : _g.validationMessage) !== null && _h !== void 0 ? _h : DEFAULT_INVALID_MESSAGE), h("span", { key: '2fc22ca7ad620da602ea173665e7fee349bd6f98', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
158
158
|
}
|
|
159
159
|
static get is() { return "db-select"; }
|
|
160
160
|
static get properties() {
|
|
@@ -651,6 +651,31 @@ export class DBSelect {
|
|
|
651
651
|
"attribute": "name",
|
|
652
652
|
"reflect": false
|
|
653
653
|
},
|
|
654
|
+
"size": {
|
|
655
|
+
"type": "number",
|
|
656
|
+
"mutable": false,
|
|
657
|
+
"complexType": {
|
|
658
|
+
"original": "DBSelectProps[\"size\"]",
|
|
659
|
+
"resolved": "number",
|
|
660
|
+
"references": {
|
|
661
|
+
"DBSelectProps": {
|
|
662
|
+
"location": "import",
|
|
663
|
+
"path": "./model",
|
|
664
|
+
"id": "src/components/select/model.ts::DBSelectProps"
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
"required": false,
|
|
669
|
+
"optional": false,
|
|
670
|
+
"docs": {
|
|
671
|
+
"tags": [],
|
|
672
|
+
"text": ""
|
|
673
|
+
},
|
|
674
|
+
"getter": false,
|
|
675
|
+
"setter": false,
|
|
676
|
+
"attribute": "size",
|
|
677
|
+
"reflect": false
|
|
678
|
+
},
|
|
654
679
|
"autocomplete": {
|
|
655
680
|
"type": "string",
|
|
656
681
|
"mutable": false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/select/select.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,GAAG,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,aAAa,EACb,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3E;;;GAGG;AAIH,MAAM,OAAO,QAAQ;IAHpB;QAmCU,QAAG,GAAG,SAAS,CAAC;QAChB,eAAU,GAAG,SAAS,CAAC;QACvB,oBAAe,GAAG,SAAS,CAAC;QAC5B,sBAAiB,GAAG,SAAS,CAAC;QAC9B,m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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBSelectOptionType, DBSelectProps, DBSelectState } from \"./model\";\nimport {\n cls,\n delay,\n getHideProp,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\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 { DBInfotext } from \"../infotext/infotext\";\nimport {\n ChangeEvent,\n ClickEvent,\n InputEvent,\n InteractionEvent,\n} from \"../../shared/model\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\n\nimport { Component, h, Fragment, Event, Prop, State } 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 | null;\n @Prop() id: DBSelectProps[\"id\"];\n @Prop() message: DBSelectProps[\"message\"];\n @Prop() showMessage: DBSelectProps[\"showMessage\"];\n @Prop() value: DBSelectProps[\"value\"];\n @Event() onClick: any;\n @Event() onInput: any;\n @Prop() input: DBSelectProps[\"input\"];\n @Event() onChange: any;\n @Prop() change: DBSelectProps[\"change\"];\n @Prop() validation: DBSelectProps[\"validation\"];\n @Prop() invalidMessage: DBSelectProps[\"invalidMessage\"];\n @Prop() required: DBSelectProps[\"required\"];\n @Prop() validMessage: DBSelectProps[\"validMessage\"];\n @Event() onBlur: any;\n @Prop() blur: DBSelectProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBSelectProps[\"focus\"];\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() disabled: DBSelectProps[\"disabled\"];\n @Prop() name: DBSelectProps[\"name\"];\n @Prop() autocomplete: DBSelectProps[\"autocomplete\"];\n @Prop() options: DBSelectProps[\"options\"];\n\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() _placeholderId = \"\";\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() initialized = false;\n @State() _voiceOverFallback = \"\";\n\n handleClick(event: ClickEvent<HTMLSelectElement>) {\n if (this.onClick) {\n this.onClick.emit(event);\n }\n }\n handleInput(event: InputEvent<HTMLSelectElement>) {\n if (this.onInput) {\n this.onInput.emit(event);\n }\n if (this.input) {\n this.input(event);\n }\n }\n handleChange(event: ChangeEvent<HTMLSelectElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\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 if (hasVoiceOver()) {\n this._voiceOverFallback =\n this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.validation === \"valid\" ||\n (this._ref?.validity.valid && 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 handleBlur(event: InteractionEvent<HTMLSelectElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLSelectElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(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 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 }\n\n componentDidUpdate() {\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 this._value = this.value;\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={this.required}\n disabled={this.disabled}\n id={this._id}\n name={this.name}\n /* @ts-ignore */\nvalue={this.value ?? this._value}\n autocomplete={this.autocomplete}\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._descByIds}\n >\n <option hidden={true}></option>\n {this.options\n ? this.options?.map((option) => (\n <Fragment>\n {option.options ? (\n <optgroup label={this.getOptionLabel(option)}>\n {option.options?.map((optgroupOption) => (\n <option\n key={optgroupOption.value.toString()}\n value={optgroupOption.value}\n selected={optgroupOption.selected}\n disabled={optgroupOption.disabled}\n >\n {this.getOptionLabel(optgroupOption)}\n </option>\n ))}\n </optgroup>\n ) : null}\n {!option.options ? (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={option.selected}\n >\n {this.getOptionLabel(option)}\n </option>\n ) : null}\n </Fragment>\n ))\n : null}\n <slot></slot>\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 <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage ?? DEFAULT_VALID_MESSAGE}\n </db-infotext>\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/components/select/select.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,GAAG,EACH,KAAK,EACL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,aAAa,EACb,yBAAyB,EACzB,6BAA6B,EAC7B,qBAAqB,EACrB,+BAA+B,GAChC,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBSelectOptionType, DBSelectProps, DBSelectState } from \"./model\";\nimport {\n cls,\n delay,\n getHideProp,\n hasVoiceOver,\n stringPropVisible,\n uuid,\n} from \"../../utils\";\nimport {\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 { DBInfotext } from \"../infotext/infotext\";\nimport {\n ChangeEvent,\n ClickEvent,\n InputEvent,\n InteractionEvent,\n} from \"../../shared/model\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\n\nimport { Component, h, Fragment, Event, Prop, State } 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 | null;\n @Prop() id: DBSelectProps[\"id\"];\n @Prop() message: DBSelectProps[\"message\"];\n @Prop() showMessage: DBSelectProps[\"showMessage\"];\n @Prop() value: DBSelectProps[\"value\"];\n @Event() onClick: any;\n @Event() onInput: any;\n @Prop() input: DBSelectProps[\"input\"];\n @Event() onChange: any;\n @Prop() change: DBSelectProps[\"change\"];\n @Prop() validation: DBSelectProps[\"validation\"];\n @Prop() invalidMessage: DBSelectProps[\"invalidMessage\"];\n @Prop() required: DBSelectProps[\"required\"];\n @Prop() validMessage: DBSelectProps[\"validMessage\"];\n @Event() onBlur: any;\n @Prop() blur: DBSelectProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBSelectProps[\"focus\"];\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() disabled: DBSelectProps[\"disabled\"];\n @Prop() name: DBSelectProps[\"name\"];\n @Prop() size: DBSelectProps[\"size\"];\n @Prop() autocomplete: DBSelectProps[\"autocomplete\"];\n @Prop() options: DBSelectProps[\"options\"];\n\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() _placeholderId = \"\";\n @State() _descByIds = \"\";\n @State() _value = \"\";\n @State() initialized = false;\n @State() _voiceOverFallback = \"\";\n\n handleClick(event: ClickEvent<HTMLSelectElement>) {\n if (this.onClick) {\n this.onClick.emit(event);\n }\n }\n handleInput(event: InputEvent<HTMLSelectElement>) {\n if (this.onInput) {\n this.onInput.emit(event);\n }\n if (this.input) {\n this.input(event);\n }\n }\n handleChange(event: ChangeEvent<HTMLSelectElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\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 if (hasVoiceOver()) {\n this._voiceOverFallback =\n this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE;\n delay(() => (this._voiceOverFallback = \"\"), 1000);\n }\n } else if (\n this.validation === \"valid\" ||\n (this._ref?.validity.valid && 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 handleBlur(event: InteractionEvent<HTMLSelectElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLSelectElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(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 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 }\n\n componentDidUpdate() {\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 this._value = this.value;\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={this.required}\n disabled={this.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 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._descByIds}\n >\n <option hidden={true}></option>\n {this.options\n ? this.options?.map((option) => (\n <Fragment>\n {option.options ? (\n <optgroup label={this.getOptionLabel(option)}>\n {option.options?.map((optgroupOption) => (\n <option\n key={optgroupOption.value.toString()}\n value={optgroupOption.value}\n selected={optgroupOption.selected}\n disabled={optgroupOption.disabled}\n >\n {this.getOptionLabel(optgroupOption)}\n </option>\n ))}\n </optgroup>\n ) : null}\n {!option.options ? (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={option.selected}\n >\n {this.getOptionLabel(option)}\n </option>\n ) : null}\n </Fragment>\n ))\n : null}\n <slot></slot>\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 <db-infotext\n size=\"small\"\n semantic=\"successful\"\n id={this._validMessageId}\n >\n {this.validMessage ?? DEFAULT_VALID_MESSAGE}\n </db-infotext>\n <db-infotext\n size=\"small\"\n semantic=\"critical\"\n id={this._invalidMessageId}\n >\n {this.invalidMessage ??\n this._ref?.validationMessage ??\n DEFAULT_INVALID_MESSAGE}\n </db-infotext>\n <span data-visually-hidden=\"true\" role=\"status\">\n {this._voiceOverFallback}\n </span>\n </div>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/switch/model.ts"],"names":[],"mappings":"","sourcesContent":["import { ChangeEventProps, ChangeEventState, EmphasisProps, FocusEventProps, FocusEventState, FormCheckProps, FormProps, FormState, GlobalProps, GlobalState, IconAfterProps, IconProps,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/switch/model.ts"],"names":[],"mappings":"","sourcesContent":["import { ChangeEventProps, ChangeEventState, EmphasisProps, FocusEventProps, FocusEventState, FormCheckProps, FormProps, FormState, GlobalProps, GlobalState, IconAfterProps, IconProps, SizeProps } from '../../shared/model';\nexport type DBSwitchDefaultProps = {\n /**\n * Add additional icons to indicate active/inactive state.\n */\n visualAid?: boolean;\n};\nexport type DBSwitchProps = DBSwitchDefaultProps & GlobalProps & ChangeEventProps<HTMLInputElement> & FocusEventProps<HTMLInputElement> & FormProps & FormCheckProps & EmphasisProps & SizeProps & IconProps & IconAfterProps;\nexport type DBSwitchDefaultState = {\n _checked: boolean;\n};\nexport type DBSwitchState = DBSwitchDefaultState & GlobalState & ChangeEventState<HTMLInputElement> & FocusEventState<HTMLInputElement> & FormState"]}
|
|
@@ -8,7 +8,6 @@ export class DBSwitch {
|
|
|
8
8
|
constructor() {
|
|
9
9
|
this._id = undefined;
|
|
10
10
|
this._checked = false;
|
|
11
|
-
this.initialized = false;
|
|
12
11
|
}
|
|
13
12
|
handleChange(event) {
|
|
14
13
|
var _a;
|
|
@@ -74,10 +73,15 @@ export class DBSwitch {
|
|
|
74
73
|
this.enableAttributePassing(this._ref, "db-switch");
|
|
75
74
|
this._id = (_a = this.id) !== null && _a !== void 0 ? _a : `switch-${uuid()}`;
|
|
76
75
|
}
|
|
76
|
+
componentDidUpdate() {
|
|
77
|
+
if (this.checked !== undefined && this.checked !== null) {
|
|
78
|
+
this._checked = !!this.checked;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
77
81
|
render() {
|
|
78
|
-
return (h("label", { key: '
|
|
82
|
+
return (h("label", { key: '1c301648d509c8d67d02cb96e89b4aed178a648a', class: cls("db-switch", this.className), "data-visual-aid": getBooleanAsString(this.visualAid), "data-size": this.size, "data-hide-label": getHideProp(this.showLabel), "data-emphasis": this.emphasis, htmlFor: this._id }, h("input", { key: '5d5fc24b58aa99e4aaeb83cabe533381c5477528', type: "checkbox", role: "switch", id: this._id, "aria-checked": getBooleanAsString(this._checked), ref: (el) => {
|
|
79
83
|
this._ref = el;
|
|
80
|
-
}, checked: this.checked, disabled: this.disabled, "aria-describedby": this.describedbyid, "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, name: this.name, required: this.required, "data-aid-icon": this.icon, "data-aid-icon-after": this.iconAfter, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event) }), this.label ? this.label : h("slot", null)));
|
|
84
|
+
}, checked: this.checked, value: this.value, disabled: this.disabled, "aria-describedby": this.describedbyid, "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, name: this.name, required: this.required, "data-aid-icon": this.icon, "data-aid-icon-after": this.iconAfter, onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event) }), this.label ? this.label : h("slot", null)));
|
|
81
85
|
}
|
|
82
86
|
static get is() { return "db-switch"; }
|
|
83
87
|
static get properties() {
|
|
@@ -107,6 +111,31 @@ export class DBSwitch {
|
|
|
107
111
|
"attribute": "id",
|
|
108
112
|
"reflect": false
|
|
109
113
|
},
|
|
114
|
+
"checked": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"mutable": false,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "DBSwitchProps[\"checked\"]",
|
|
119
|
+
"resolved": "boolean",
|
|
120
|
+
"references": {
|
|
121
|
+
"DBSwitchProps": {
|
|
122
|
+
"location": "import",
|
|
123
|
+
"path": "./model",
|
|
124
|
+
"id": "src/components/switch/model.ts::DBSwitchProps"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"required": false,
|
|
129
|
+
"optional": false,
|
|
130
|
+
"docs": {
|
|
131
|
+
"tags": [],
|
|
132
|
+
"text": ""
|
|
133
|
+
},
|
|
134
|
+
"getter": false,
|
|
135
|
+
"setter": false,
|
|
136
|
+
"attribute": "checked",
|
|
137
|
+
"reflect": false
|
|
138
|
+
},
|
|
110
139
|
"change": {
|
|
111
140
|
"type": "unknown",
|
|
112
141
|
"mutable": false,
|
|
@@ -301,12 +330,12 @@ export class DBSwitch {
|
|
|
301
330
|
"attribute": "classname",
|
|
302
331
|
"reflect": false
|
|
303
332
|
},
|
|
304
|
-
"
|
|
305
|
-
"type": "
|
|
333
|
+
"value": {
|
|
334
|
+
"type": "any",
|
|
306
335
|
"mutable": false,
|
|
307
336
|
"complexType": {
|
|
308
|
-
"original": "DBSwitchProps[\"
|
|
309
|
-
"resolved": "
|
|
337
|
+
"original": "DBSwitchProps[\"value\"]",
|
|
338
|
+
"resolved": "any",
|
|
310
339
|
"references": {
|
|
311
340
|
"DBSwitchProps": {
|
|
312
341
|
"location": "import",
|
|
@@ -323,7 +352,7 @@ export class DBSwitch {
|
|
|
323
352
|
},
|
|
324
353
|
"getter": false,
|
|
325
354
|
"setter": false,
|
|
326
|
-
"attribute": "
|
|
355
|
+
"attribute": "value",
|
|
327
356
|
"reflect": false
|
|
328
357
|
},
|
|
329
358
|
"disabled": {
|
|
@@ -531,8 +560,7 @@ export class DBSwitch {
|
|
|
531
560
|
static get states() {
|
|
532
561
|
return {
|
|
533
562
|
"_id": {},
|
|
534
|
-
"_checked": {}
|
|
535
|
-
"initialized": {}
|
|
563
|
+
"_checked": {}
|
|
536
564
|
};
|
|
537
565
|
}
|
|
538
566
|
static get events() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../src/components/switch/switch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,WAAW,EAAE,IAAI,EAAE,M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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { DBSwitchProps, DBSwitchState } from \"./model\";\nimport { cls, getBooleanAsString, getHideProp, uuid } from \"../../utils\";\nimport { ChangeEvent, InteractionEvent } from \"../../shared/model\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\n\nimport { Component, h, Fragment, Event, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-switch\",\n})\nexport class DBSwitch {\n private _ref!: HTMLInputElement | null;\n @Prop() id: DBSwitchProps[\"id\"];\n @Prop() checked: DBSwitchProps[\"checked\"];\n @Event() onChange: any;\n @Prop() change: DBSwitchProps[\"change\"];\n @Event() onBlur: any;\n @Prop() blur: DBSwitchProps[\"blur\"];\n @Event() onFocus: any;\n @Prop() focus: DBSwitchProps[\"focus\"];\n @Prop() visualAid: DBSwitchProps[\"visualAid\"];\n @Prop() size: DBSwitchProps[\"size\"];\n @Prop() showLabel: DBSwitchProps[\"showLabel\"];\n @Prop() emphasis: DBSwitchProps[\"emphasis\"];\n @Prop({attribute: \"classname\"}) className: DBSwitchProps[\"className\"];\n @Prop() value: DBSwitchProps[\"value\"];\n @Prop() disabled: DBSwitchProps[\"disabled\"];\n @Prop() describedbyid: DBSwitchProps[\"describedbyid\"];\n @Prop() validation: DBSwitchProps[\"validation\"];\n @Prop() name: DBSwitchProps[\"name\"];\n @Prop() required: DBSwitchProps[\"required\"];\n @Prop() icon: DBSwitchProps[\"icon\"];\n @Prop() iconAfter: DBSwitchProps[\"iconAfter\"];\n @Prop() label: DBSwitchProps[\"label\"];\n\n @State() _id = undefined;\n @State() _checked = false;\n\n handleChange(event: ChangeEvent<HTMLInputElement>) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\n\n // We have different ts types in different frameworks, so we need to use any here\n this._checked = (event.target as any)?.[\"checked\"];\n }\n handleBlur(event: InteractionEvent<HTMLInputElement>) {\n if (this.onBlur) {\n this.onBlur.emit(event);\n }\n if (this.blur) {\n this.blur(event);\n }\n }\n handleFocus(event: InteractionEvent<HTMLInputElement>) {\n if (this.onFocus) {\n this.onFocus.emit(event);\n }\n if (this.focus) {\n this.focus(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: 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 componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-switch\");\n this._id = this.id ?? `switch-${uuid()}`;\n }\n\n componentDidUpdate() {\n if (this.checked !== undefined && this.checked !== null) {\n this._checked = !!this.checked;\n }\n }\n\n render() {\n return (\n <label\n class={cls(\"db-switch\", this.className)}\n data-visual-aid={getBooleanAsString(this.visualAid)}\n data-size={this.size}\n data-hide-label={getHideProp(this.showLabel)}\n data-emphasis={this.emphasis}\n htmlFor={this._id}\n >\n <input\n type=\"checkbox\"\n role=\"switch\"\n id={this._id}\n aria-checked={getBooleanAsString(this._checked)}\n ref={(el: any) => {\n this._ref = el;\n }}\n checked={this.checked}\n value={this.value}\n disabled={this.disabled}\n aria-describedby={this.describedbyid}\n aria-invalid={this.validation === \"invalid\"}\n data-custom-validity={this.validation}\n name={this.name}\n required={this.required}\n data-aid-icon={this.icon}\n data-aid-icon-after={this.iconAfter}\n onChange={(event) => this.handleChange(event)}\n onBlur={(event) => this.handleBlur(event)}\n onFocus={(event) => this.handleFocus(event)}\n />\n {this.label ? this.label : <slot></slot>}\n </label>\n );\n }\n}\n"]}
|
|
@@ -64,9 +64,9 @@ export class DBTabItem {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
|
-
return (h("li", { key: '
|
|
67
|
+
return (h("li", { key: 'b74836903d6f4fb378dfefe400c4ee90e87e81b6', class: cls("db-tab-item", this.className), role: "none" }, h("label", { key: 'd54e0cdf202b70a2184ad29adac3a5b7aac1cce0', htmlFor: this.id, "data-icon": this.icon, "data-icon-after": this.iconAfter, "data-hide-icon": getHideProp(this.showIcon), "data-hide-icon-after": getHideProp(this.showIcon), "data-no-text": this.noText }, h("input", { key: '40dc63d4f0c756b8900917f0d216d005874303a2', type: "radio", role: "tab", disabled: this.disabled, "aria-selected": this._selected, "aria-controls": this.controls, checked: this.checked, ref: (el) => {
|
|
68
68
|
this._ref = el;
|
|
69
|
-
}, id: this.id, onChange: (event) => this.handleChange(event) }), this.label ? this.label : null, h("slot", { key: '
|
|
69
|
+
}, id: this.id, onChange: (event) => this.handleChange(event) }), this.label ? this.label : null, h("slot", { key: '3ef8b94926e52b17980f663487887b41f03f6b10' }))));
|
|
70
70
|
}
|
|
71
71
|
static get is() { return "db-tab-item"; }
|
|
72
72
|
static get properties() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-item.js","sourceRoot":"","sources":["../../../src/components/tab-item/tab-item.tsx"],"names":[],"mappings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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import type { DBTabItemProps, DBTabItemState } from \"./model\";\nimport { cls, getBooleanAsString, getHideProp } from \"../../utils\";\nimport {\n handleFrameworkEventAngular,\n handleFrameworkEventVue,\n} from \"../../utils/form-components\";\n\nimport { Component, h, Fragment, Event, Prop, State } from \"@stencil/core\";\n\n\n/**\n * @slot children - This is a default/unnamed slot\n\n */\n @Component({\n tag: \"db-tab-item\",\n})\nexport class DBTabItem {\n private _ref!: HTMLInputElement | null;\n @Prop() active: DBTabItemProps[\"active\"];\n @Event() onChange: any;\n @Prop() change: DBTabItemProps[\"change\"];\n @Prop({attribute: \"classname\"}) className: DBTabItemProps[\"className\"];\n @Prop() id: DBTabItemProps[\"id\"];\n @Prop() icon: DBTabItemProps[\"icon\"];\n @Prop() iconAfter: DBTabItemProps[\"iconAfter\"];\n @Prop() showIcon: DBTabItemProps[\"showIcon\"];\n @Prop() noText: DBTabItemProps[\"noText\"];\n @Prop() disabled: DBTabItemProps[\"disabled\"];\n @Prop() controls: DBTabItemProps[\"controls\"];\n @Prop() checked: DBTabItemProps[\"checked\"];\n @Prop() label: DBTabItemProps[\"label\"];\n\n @State() initialized = false;\n @State() _selected = false;\n\n handleChange(event: any) {\n if (this.onChange) {\n this.onChange.emit(event);\n }\n if (this.change) {\n this.change(event);\n }\n\n // We have different ts types in different frameworks, so we need to use any here\n\n const selected = (event.target as any)?.[\"checked\"];\n this._selected = getBooleanAsString(selected);\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 componentDidLoad() {\n this.enableAttributePassing(this._ref, \"db-tab-item\");\n this.initialized = true;\n }\n\n componentDidUpdate() {\n if (this.active && this.initialized && this._ref) {\n this._ref.click();\n this.initialized = false;\n }\n }\n\n render() {\n return (\n <li class={cls(\"db-tab-item\", this.className)} role=\"none\">\n <label\n htmlFor={this.id}\n data-icon={this.icon}\n data-icon-after={this.iconAfter}\n data-hide-icon={getHideProp(this.showIcon)}\n data-hide-icon-after={getHideProp(this.showIcon)}\n data-no-text={this.noText}\n >\n <input\n type=\"radio\"\n role=\"tab\"\n disabled={this.disabled}\n aria-selected={this._selected}\n aria-controls={this.controls}\n checked={this.checked}\n ref={(el: any) => {\n this._ref = el;\n }}\n id={this.id}\n onChange={(event) => this.handleChange(event)}\n />\n {this.label ? this.label : null}\n <slot></slot>\n </label>\n </li>\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/tabs/model.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAI,CAAC,WAAW,EAAE,QAAQ,CAAW,CAAC;AAEnE,MAAM,CAAC,MAAM,2BAA2B,GAAI,CAAC,MAAM,EAAE,UAAU,CAAW,CAAC","sourcesContent":["import { AlignmentProps, GlobalProps, GlobalState, InitializedState, OrientationProps, WidthProps } from '../../shared/model';\nimport { DBTabItemProps } from '../tab-item/model';\nimport { DBTabPanelProps } from '../tab-panel/model';\nexport const TabsBehaviorList = (['scrollbar', 'arrows'] as const);\nexport type TabsBehaviorType = (typeof TabsBehaviorList)[number];\nexport const TabsInitialSelectedModeList = (['auto', 'manually'] as const);\nexport type TabsInitialSelectedModeType = (typeof TabsInitialSelectedModeList)[number];\nexport type DBSimpleTabProps = DBTabItemProps & DBTabPanelProps;\nexport type DBTabsDefaultProps = {\n /**\n * Change amount of distance if you click on an arrow, only available with behavior=\"arrows\"\n */\n arrowScrollDistance?: number;\n
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../../src/components/tabs/model.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAI,CAAC,WAAW,EAAE,QAAQ,CAAW,CAAC;AAEnE,MAAM,CAAC,MAAM,2BAA2B,GAAI,CAAC,MAAM,EAAE,UAAU,CAAW,CAAC","sourcesContent":["import { AlignmentProps, GlobalProps, GlobalState, InitializedState, OrientationProps, WidthProps } from '../../shared/model';\nimport { DBTabItemProps } from '../tab-item/model';\nimport { DBTabPanelProps } from '../tab-panel/model';\nexport const TabsBehaviorList = (['scrollbar', 'arrows'] as const);\nexport type TabsBehaviorType = (typeof TabsBehaviorList)[number];\nexport const TabsInitialSelectedModeList = (['auto', 'manually'] as const);\nexport type TabsInitialSelectedModeType = (typeof TabsInitialSelectedModeList)[number];\nexport type DBSimpleTabProps = DBTabItemProps & DBTabPanelProps;\nexport type DBTabsDefaultProps = {\n /**\n * Change amount of distance if you click on an arrow, only available with behavior=\"arrows\"\n */\n arrowScrollDistance?: number;\n /**\n * Show a scrollbar or buttons with arrows to navigate for horizontal tabs with overflow visible\n */\n behavior?: TabsBehaviorType;\n\n /**\n * Default behavior is auto selecting the first tab, change selected tab by index\n */\n initialSelectedIndex?: number;\n\n /**\n * Default behavior is auto selecting the first tab, disable it with 'manually'\n */\n initialSelectedMode?: TabsInitialSelectedModeType;\n\n /**\n * The name of the tab bar, is required for grouping multiple tabs together. Will overwrite names from children.\n */\n name?: string;\n\n /**\n * Informs the user if the current tab index has changed.\n */\n onIndexChange?: (index?: number) => void;\n\n /**\n * Informs the user if another tab has been selected.\n */\n onTabSelect?: (event?: Event) => void;\n\n /**\n * Provide simple tabs with label + text as content\n */\n tabs?: DBSimpleTabProps[] | string;\n};\nexport type DBTabsProps = DBTabsDefaultProps & GlobalProps & OrientationProps & WidthProps & AlignmentProps;\nexport type DBTabsDefaultState = {\n _name: string;\n scrollContainer?: Element | null;\n scroll: (left?: boolean) => void;\n showScrollLeft?: boolean;\n showScrollRight?: boolean;\n evaluateScrollButtons: (tabList: Element) => void;\n convertTabs: (tabs?: unknown[] | string | undefined) => DBSimpleTabProps[];\n initTabList: () => void;\n initTabs: (init?: boolean) => void;\n handleChange: (event: any) => void;\n};\nexport type DBTabsState = DBTabsDefaultState & GlobalState & InitializedState"]}
|
|
@@ -97,6 +97,21 @@ export class DBTabs {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
handleChange(event) {
|
|
101
|
+
var _a;
|
|
102
|
+
if (this.onIndexChange && event.target) {
|
|
103
|
+
const list = event.target.closest("ul");
|
|
104
|
+
const listItem =
|
|
105
|
+
// db-tab-item for angular and stencil wrapping elements
|
|
106
|
+
(_a = event.target.closest("db-tab-item")) !== null && _a !== void 0 ? _a : event.target.closest("li");
|
|
107
|
+
if (list !== null && listItem !== null) {
|
|
108
|
+
this.onIndexChange.emit(Array.from(list.childNodes).indexOf(listItem));
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (this.onTabSelect) {
|
|
112
|
+
this.onTabSelect.emit(event);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
100
115
|
/**
|
|
101
116
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
102
117
|
* @param element the ref for the component
|
|
@@ -159,10 +174,10 @@ export class DBTabs {
|
|
|
159
174
|
}
|
|
160
175
|
render() {
|
|
161
176
|
var _a, _b, _c, _d;
|
|
162
|
-
return (h("div", { key: '
|
|
177
|
+
return (h("div", { key: 'a71824622643b3846d57370613e090805c4d6951', class: cls("db-tabs", this.className), ref: (el) => {
|
|
163
178
|
this._ref = el;
|
|
164
|
-
}, id: this._id, "data-orientation": this.orientation, "data-scroll-behavior": this.behavior, "data-alignment": (_a = this.alignment) !== null && _a !== void 0 ? _a : "start", "data-width": (_b = this.width) !== null && _b !== void 0 ? _b : "auto" }, this.showScrollLeft ? (h("db-button", { class: "tabs-scroll-left", variant: "ghost", icon: "chevron_left", noText: true, onClick: () => this.scroll(true) }, "Scroll left")) : null, this.tabs ? (h(Fragment, null, h("db-tab-list", null, (_c = this.convertTabs(this.tabs)) === null || _c === void 0 ? void 0 : _c.map((tab, index) => (h("db-tab-item", { key: this.name + "tab-item" + index, active: tab.active, label: tab.label, iconAfter: tab.iconAfter, icon: tab.icon, noText: tab.noText })))), (_d = this.convertTabs(this.tabs)) === null || _d === void 0 ? void 0 :
|
|
165
|
-
_d.map((tab, index) => (h("db-tab-panel", { key: this.name + "tab-panel" + index, content: tab.content }, tab.children))))) : null, this.showScrollRight ? (h("db-button", { class: "tabs-scroll-right", variant: "ghost", icon: "chevron_right", noText: true, onClick: () => this.scroll() }, "Scroll right")) : null, h("slot", { key: '
|
|
179
|
+
}, id: this._id, "data-orientation": this.orientation, "data-scroll-behavior": this.behavior, "data-alignment": (_a = this.alignment) !== null && _a !== void 0 ? _a : "start", "data-width": (_b = this.width) !== null && _b !== void 0 ? _b : "auto", onChange: (event) => this.handleChange(event) }, this.showScrollLeft ? (h("db-button", { class: "tabs-scroll-left", variant: "ghost", icon: "chevron_left", type: "button", noText: true, onClick: () => this.scroll(true) }, "Scroll left")) : null, this.tabs ? (h(Fragment, null, h("db-tab-list", null, (_c = this.convertTabs(this.tabs)) === null || _c === void 0 ? void 0 : _c.map((tab, index) => (h("db-tab-item", { key: this.name + "tab-item" + index, active: tab.active, label: tab.label, iconAfter: tab.iconAfter, icon: tab.icon, noText: tab.noText })))), (_d = this.convertTabs(this.tabs)) === null || _d === void 0 ? void 0 :
|
|
180
|
+
_d.map((tab, index) => (h("db-tab-panel", { key: this.name + "tab-panel" + index, content: tab.content }, tab.children))))) : null, this.showScrollRight ? (h("db-button", { class: "tabs-scroll-right", variant: "ghost", icon: "chevron_right", type: "button", noText: true, onClick: () => this.scroll() }, "Scroll right")) : null, h("slot", { key: '46e9b1aa01ebfd0dfd8c1f10783347ae9745ecd6' })));
|
|
166
181
|
}
|
|
167
182
|
static get is() { return "db-tabs"; }
|
|
168
183
|
static get properties() {
|
|
@@ -454,5 +469,38 @@ export class DBTabs {
|
|
|
454
469
|
"scrollContainer": {}
|
|
455
470
|
};
|
|
456
471
|
}
|
|
472
|
+
static get events() {
|
|
473
|
+
return [{
|
|
474
|
+
"method": "onIndexChange",
|
|
475
|
+
"name": "onIndexChange",
|
|
476
|
+
"bubbles": true,
|
|
477
|
+
"cancelable": true,
|
|
478
|
+
"composed": true,
|
|
479
|
+
"docs": {
|
|
480
|
+
"tags": [],
|
|
481
|
+
"text": ""
|
|
482
|
+
},
|
|
483
|
+
"complexType": {
|
|
484
|
+
"original": "any",
|
|
485
|
+
"resolved": "any",
|
|
486
|
+
"references": {}
|
|
487
|
+
}
|
|
488
|
+
}, {
|
|
489
|
+
"method": "onTabSelect",
|
|
490
|
+
"name": "onTabSelect",
|
|
491
|
+
"bubbles": true,
|
|
492
|
+
"cancelable": true,
|
|
493
|
+
"composed": true,
|
|
494
|
+
"docs": {
|
|
495
|
+
"tags": [],
|
|
496
|
+
"text": ""
|
|
497
|
+
},
|
|
498
|
+
"complexType": {
|
|
499
|
+
"original": "any",
|
|
500
|
+
"resolved": "any",
|
|
501
|
+
"references": {}
|
|
502
|
+
}
|
|
503
|
+
}];
|
|
504
|
+
}
|
|
457
505
|
}
|
|
458
506
|
//# sourceMappingURL=tabs.js.map
|