@db-ux/wc-core-components 2.4.1 → 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.
- package/dist/cjs/db-navigation-item.cjs.entry.js +6 -5
- package/dist/cjs/db-navigation-item.cjs.entry.js.map +1 -1
- package/dist/cjs/db-navigation-item.entry.cjs.js.map +1 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/collection/components/navigation-item/navigation-item.js +7 -6
- package/dist/collection/components/navigation-item/navigation-item.js.map +1 -1
- package/dist/collection/shared/model.js.map +1 -1
- package/dist/custom-elements.json +1 -1
- package/dist/db-ux/db-navigation-item.entry.esm.js.map +1 -1
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js.map +1 -1
- package/dist/db-ux/p-90eef6ac.entry.js +2 -0
- package/dist/db-ux/p-90eef6ac.entry.js.map +1 -0
- package/dist/esm/db-navigation-item.entry.js +7 -6
- package/dist/esm/db-navigation-item.entry.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/navigation-item/navigation-item.d.ts +1 -1
- package/dist/types/shared/model.d.ts +1 -1
- package/package.json +3 -3
- package/dist/db-ux/p-3cd03681.entry.js +0 -2
- package/dist/db-ux/p-3cd03681.entry.js.map +0 -1
|
@@ -19,11 +19,12 @@ const DBNavigationItem = class {
|
|
|
19
19
|
this.navigationItemSafeTriangle = undefined;
|
|
20
20
|
}
|
|
21
21
|
handleNavigationItemClick(event) {
|
|
22
|
-
|
|
22
|
+
var _a;
|
|
23
|
+
if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.nodeName) === "A") {
|
|
23
24
|
this.autoClose = true;
|
|
24
|
-
index$1.delay(() => {
|
|
25
|
+
void index$1.delay(() => {
|
|
25
26
|
this.autoClose = false;
|
|
26
|
-
},
|
|
27
|
+
}, 1000);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
handleClick(event) {
|
|
@@ -107,9 +108,9 @@ const DBNavigationItem = class {
|
|
|
107
108
|
}
|
|
108
109
|
render() {
|
|
109
110
|
var _a;
|
|
110
|
-
return (index.h("li", { key: '
|
|
111
|
+
return (index.h("li", { key: '62b4491ae6751fc7cc00c2dfb411141111171fb1', class: index$1.cls("db-navigation-item", this.className), ref: (el) => {
|
|
111
112
|
this._ref = el;
|
|
112
|
-
}, id: this.id, onMouseOver: () => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.enableFollow(); }, onMouseLeave: () => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.disableFollow(); }, onMouseMove: (event) => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.followByMouseEvent(event); }, "data-width": this.width, "data-icon": this.icon, "data-hide-icon": index$1.getHideProp(this.showIcon), "data-active": this.active, "data-wrap": index$1.getBooleanAsString(this.wrap), "aria-disabled": index$1.getBooleanAsString(this.disabled) }, !this.hasSubNavigation ? this.text ? this.text : index.h("slot", null) : null, this.hasSubNavigation ? (index.h(index.Fragment, null, index.h("button", { class: "db-navigation-item-expand-button", "aria-haspopup": this.hasAreaPopup, "aria-expanded": this.isSubNavigationExpanded, disabled: index$1.getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClick(event) }, this.text ? this.text : index.h("slot", null)), index.h("menu", { class: "db-sub-navigation", "data-
|
|
113
|
+
}, id: this.id, onMouseOver: () => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.enableFollow(); }, onMouseLeave: () => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.disableFollow(); }, onMouseMove: (event) => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.followByMouseEvent(event); }, "data-width": this.width, "data-icon": this.icon, "data-hide-icon": index$1.getHideProp(this.showIcon), "data-active": this.active, "data-wrap": index$1.getBooleanAsString(this.wrap), "aria-disabled": index$1.getBooleanAsString(this.disabled) }, !this.hasSubNavigation ? this.text ? this.text : index.h("slot", null) : null, this.hasSubNavigation ? (index.h(index.Fragment, null, index.h("button", { class: "db-navigation-item-expand-button", "aria-haspopup": this.hasAreaPopup, "aria-expanded": this.isSubNavigationExpanded, disabled: index$1.getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClick(event) }, this.text ? this.text : index.h("slot", null)), index.h("menu", { class: "db-sub-navigation", "data-force-close": this.autoClose, id: this.subNavigationId, onClick: (event) => this.handleNavigationItemClick(event) }, this.hasAreaPopup ? (index.h("div", { class: "db-mobile-navigation-back" }, index.h("db-button", { icon: "arrow_left", variant: "ghost", id: this.backButtonId, onClick: (event) => this.handleBackClick(event) }, (_a = this.backButtonText) !== null && _a !== void 0 ? _a : constants.DEFAULT_BACK))) : null, index.h("slot", { name: "subNavigation" })))) : null));
|
|
113
114
|
}
|
|
114
115
|
static get watchers() { return {
|
|
115
116
|
"subNavigationExpanded": ["watch0"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"db-navigation-item.entry.cjs.js","mappings":";;;;;;;;MAoCa,gBAAgB,GAAA,MAAA;AAH5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBU,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AACnB,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AACpB,QAAA,IAAgB,CAAA,gBAAA,GAAG,IAAI;AACvB,QAAA,IAAuB,CAAA,uBAAA,GAAG,KAAK;AAC/B,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AACjB,QAAA,IAAA,CAAA,eAAe,GAAG,iBAAiB,GAAGA,YAAI,EAAE;AAC5C,QAAA,IAA0B,CAAA,0BAAA,GAAG,SAAS;AAuKhD;AArKC,IAAA,yBAAyB,CAAC,KAAc,EAAA;AACtC,QAAA,IAAIC,sCAA2B,CAAC,KAAK,CAAC,EAAE;AACtC,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI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AAK,CAAC,EAAA,EAE9C,MAAA,IAAI,CAAC,cAAc,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAIK,sBAAY,CAC1B,CACR,IACJ,IAAI,EACRL,OAAA,CAAA,MAAA,EAAA,EAAM,IAAI,EAAC,eAAe,EAAA,CAAQ,CAC7B,CACE,IACT,IAAI,CACL;;;;;;;;;;;","names":["uuid","isEventTargetNavigationItem","delay","getBoolean","NavigationItemSafeTriangle","h","cls","getHideProp","getBooleanAsString","Fragment","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 {\n isEventTargetNavigationItem,\n NavigationItemSafeTriangle,\n} 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: unknown) {\n if (isEventTargetNavigationItem(event)) {\n this.autoClose = true;\n delay(() => {\n this.autoClose = false;\n }, 300);\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-auto-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"],"version":3}
|
|
1
|
+
{"file":"db-navigation-item.entry.cjs.js","mappings":";;;;;;;;MAiCa,gBAAgB,GAAA,MAAA;AAH5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBU,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AACnB,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AACpB,QAAA,IAAgB,CAAA,gBAAA,GAAG,IAAI;AACvB,QAAA,IAAuB,CAAA,uBAAA,GAAG,KAAK;AAC/B,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AACjB,QAAA,IAAA,CAAA,eAAe,GAAG,iBAAiB,GAAGA,YAAI,EAAE;AAC5C,QAAA,IAA0B,CAAA,0BAAA,GAAG,SAAS;AAuKhD;AArKC,IAAA,yBAAyB,CAAC,KAAU,EAAA;;QAClC,IAAI,CAAA,CAAA,EAAA,GAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,MAAM,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,QAAQ,MAAK,GAAG,EAAE;AACnC,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;YACrB,KAAKC,aAAK,CAAC,MAAK;AACd,gBAAA,IAAI,CAAC,SAAS,GAAG,KAAK;aACvB,EAAE,IAAI,CAAC;;;AAGZ,IAAA,WAAW,CAAC,KAA0C,EAAA;AACpD,QAAA,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,KAAK,CAAC,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A,CAAQ,CAC7B,CACE,IACT,IAAI,CACL;;;;;;;;;;;","names":["uuid","delay","getBoolean","NavigationItemSafeTriangle","h","cls","getHideProp","getBooleanAsString","Fragment","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"],"version":3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-navigation-item.entry.cjs.js","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 {\n isEventTargetNavigationItem,\n NavigationItemSafeTriangle,\n} 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: unknown) {\n if (isEventTargetNavigationItem(event)) {\n this.autoClose = true;\n delay(() => {\n this.autoClose = false;\n }, 300);\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-auto-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"],"names":["uuid","isEventTargetNavigationItem","delay","getBoolean","NavigationItemSafeTriangle","h","cls","getHideProp","getBooleanAsString","Fragment","DEFAULT_BACK"],"mappings":";;;;;;;;MAoCa,gBAAgB,GAAA,MAAA;AAH5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBU,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AACnB,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AACpB,QAAA,IAAgB,CAAA,gBAAA,GAAG,IAAI;AACvB,QAAA,IAAuB,CAAA,uBAAA,GAAG,KAAK;AAC/B,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AACjB,QAAA,IAAA,CAAA,eAAe,GAAG,iBAAiB,GAAGA,YAAI,EAAE;AAC5C,QAAA,IAA0B,CAAA,0BAAA,GAAG,SAAS;AAuKhD;AArKC,IAAA,yBAAyB,CAAC,KAAc,EAAA;AACtC,QAAA,IAAIC,sCAA2B,CAAC,KAAK,CAAC,EAAE;AACtC,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;YACrBC,aAAK,CAAC,MAAK;AACT,gBAAA,IAAI,CAAC,SAAS,GAAG,KAAK;aACvB,EAAE,GAAG,CAAC;;;AAGX,IAAA,WAAW,CAAC,KAA0C,EAAA;AACpD,QAAA,IAAI,IAAI,CAAC,KAAK,EAAE;YACd,KAAK,CAAC,eAAe,EAAE;AACvB,YAAA,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;;AAExB,QAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACrB,YAAA,IAAI,CAAC,uBAAuB,GAAG,IAAI;;;AAGvC,IAAA,eAAe,CAAC,KAA0C,EAAA;QACxD,KAAK,CAAC,eAAe,EAAE;AACvB,QAAA,IAAI,CAAC,uBAAuB,GAAG,KAAK;;AAGtC;;;;AAIG;IACK,sBAAsB,CAC5B,OAA2B,EAC3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AAQ,EAAEF,kBAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,EAC/C,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,EAE1C,EAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAGE,OAAA,CAAA,MAAA,EAAA,IAAA,CAAa,CAC/B,EACTA,OACE,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EACR,iBAAA,EAAA,IAAI,CAAC,SAAS,EAC/B,EAAE,EAAE,IAAI,CAAC,eAAe,EACxB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAAA,EAExD,IAAI,CAAC,YAAY,IAChBA,OAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,2BAA2B,EAAA,EACpCA,OAAA,CAAA,WAAA,EAAA,EACE,IAAI,EAAC,YAAY,EACjB,OAAO,EAAC,OAAO,EACf,EAAE,EAAE,IAAI,CAAC,YAAY,EACrB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAA,EAE9C,MAAA,IAAI,CAAC,cAAc,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAIK,sBAAY,CAC1B,CACR,IACJ,IAAI,EACRL,OAAA,CAAA,MAAA,EAAA,EAAM,IAAI,EAAC,eAAe,EAAA,CAAQ,CAC7B,CACE,IACT,IAAI,CACL;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"db-navigation-item.entry.cjs.js","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"],"names":["uuid","delay","getBoolean","NavigationItemSafeTriangle","h","cls","getHideProp","getBooleanAsString","Fragment","DEFAULT_BACK"],"mappings":";;;;;;;;MAiCa,gBAAgB,GAAA,MAAA;AAH5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBU,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AACnB,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AACpB,QAAA,IAAgB,CAAA,gBAAA,GAAG,IAAI;AACvB,QAAA,IA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CAAa,CAC/B,EACTA,OACE,CAAA,MAAA,EAAA,EAAA,KAAK,EAAC,mBAAmB,EACP,kBAAA,EAAA,IAAI,CAAC,SAAS,EAChC,EAAE,EAAE,IAAI,CAAC,eAAe,EACxB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAAA,EAExD,IAAI,CAAC,YAAY,IAChBA,OAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,2BAA2B,EAAA,EACpCA,OAAA,CAAA,WAAA,EAAA,EACE,IAAI,EAAC,YAAY,EACjB,OAAO,EAAC,OAAO,EACf,EAAE,EAAE,IAAI,CAAC,YAAY,EACrB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAA,EAE9C,MAAA,IAAI,CAAC,cAAc,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAIK,sBAAY,CAC1B,CACR,IACJ,IAAI,EACRL,OAAA,CAAA,MAAA,EAAA,EAAM,IAAI,EAAC,eAAe,EAAA,CAAQ,CAC7B,CACE,IACT,IAAI,CACL;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["src/shared/model.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { IconTypes } from '@db-ux/core-foundations';\nexport type GlobalProps = {\n /**\n * default slot\n */\n\n children?: any;\n\n /**\n * React specific for adding className to the component.\n */\n className?: string;\n\n /**\n * Workaround for TypeScript using class for all components.\n */\n class?: string | any;\n\n /**\n * @deprecated\n * [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.\n */\n describedbyid?: string;\n\n /**\n * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.\n */\n id?: string;\n\n /**\n * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)\n */\n autofocus?: boolean | string;\n};\nexport type GlobalState = {\n _id?: string;\n};\nexport const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'] as const;\nexport type SemanticType = (typeof SemanticList)[number];\nexport type SemanticProps = {\n /**\n * The semantic defines the default variants for most components.\n */\n semantic?: SemanticType;\n};\nexport type IconProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n icon?: IconTypes;\n};\nexport type ShowIconProps = {\n /**\n * Enables or disables the visibility of the icon. The default value depends on the component.\n * For many components this property is optional to reflect Figma properties.\n */\n showIcon?: boolean | string;\n};\nexport type IconAfterProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconAfter?: IconTypes;\n};\nexport const SpacingList = ['medium', 'small', 'large', 'none'] as const;\nexport type SpacingType = (typeof SpacingList)[number];\nexport type SpacingProps = {\n /**\n * The spacing attribute changes the padding of the component.\n */\n spacing?: SpacingType | string;\n};\nexport const MarginList = ['medium', 'small', 'large', 'none'] as const;\nexport type MarginType = (typeof MarginList)[number];\nexport type MarginProps = {\n /**\n * The margin attribute changes the margin of the component.\n */\n margin?: MarginType;\n};\nexport const PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'] as const;\nexport type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];\nexport const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const;\nexport type PlacementVerticalType = (typeof PlacementVerticalList)[number];\nexport const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList] as const;\nexport type PlacementType = (typeof PlacementList)[number];\nexport type PlacementProps = {\n /**\n * The `placement` attributes values change the position to absolute and adds a transform based on the placement.\n */\n placement?: PlacementType;\n};\nexport type NavigationBehaviorState = {\n handleNavigationItemClick: (event: unknown) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean | string;\n};\nexport const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'] as const;\nexport type GapSpacingType = (typeof GapSpacingList)[number];\nexport type GapSpacingProps = {\n /**\n * Set the gap/spacing between elements\n */\n gap?: GapSpacingType;\n};\nexport type OverflowProps = {\n /**\n * The overflow attribute sets a max-width and longer text will be dotted.\n */\n overflow?: boolean | string;\n};\nexport const OrientationList = ['horizontal', 'vertical'] as const;\nexport type OrientationType = (typeof OrientationList)[number];\nexport type OrientationProps = {\n /**\n * Change the orientation. Defaults to horizontal.\n */\n orientation?: OrientationType;\n};\nexport const WidthList = ['full', 'auto'] as const;\nexport type WidthType = (typeof WidthList)[number];\nexport type WidthProps = {\n /**\n * Width of the component. Auto width based on children size, full width based on parent elements width.\n */\n width?: WidthType | string;\n};\nexport const MaxWidthList = ['full', 'medium', 'large', 'small'] as const;\nexport type MaxWidthType = (typeof MaxWidthList)[number];\nexport type ContainerWidthProps = {\n /**\n * Set max width for the component\n */\n width?: MaxWidthType;\n};\nexport const PopoverDelayList = ['none', 'slow', 'fast'] as const;\nexport type PopoverDelayType = (typeof PopoverDelayList)[number];\nexport const PopoverWidthList = ['auto', 'fixed'] as const;\nexport type PopoverWidthType = (typeof PopoverWidthList)[number];\nexport type PopoverProps = {\n /**\n * Add a delay before showing the tooltip\n */\n delay?: PopoverDelayType;\n /**\n * Disable animation\n */\n animation?: boolean | string;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type NameProps = {\n /**\n * The name attribute gives the name of the element to group it.\n */\n name?: string;\n};\nexport type NameState = {\n _name?: string;\n handleNameAttribute: () => void;\n};\nexport type ContentSlotProps = {\n /**\n * Default slot which is used to pass in additional content.\n */\n content?: any;\n};\nexport const SizeList = ['small', 'medium'] as const;\nexport type SizeType = (typeof SizeList)[number];\nexport type SizeProps = {\n /**\n * The size attribute changes the font-size and other related sizes of the component.\n */\n size?: SizeType;\n};\nexport const EmphasisList = ['weak', 'strong'] as const;\nexport type EmphasisType = (typeof EmphasisList)[number];\nexport type EmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak or strong importance.\n */\n emphasis?: EmphasisType;\n};\nexport const ValidationList = ['invalid', 'valid', 'no-validation'] as const;\nexport type ValidationType = (typeof ValidationList)[number];\n\n/**\n * Properties to control the required state and its visual annotation for input components.\n */\nexport type RequiredProps = {\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n * The form element will be marked semantically as required and by default also visually with an asterisk '*' next to the label (unless the property `showRequiredAsterisk` is also set with the value `false`).\n */\n required?: boolean | string;\n /**\n * This attribute allows to specify whether a form field which is marked as required will show a visual indicator (an asterisk '*').\n * It allows to prevent adding the visual indicator but still keep the field semantically required by setting its value to `false`.\n * By default, its value is `true`, so the asterisk is shown when `required` is set.\n */\n showRequiredAsterisk?: boolean | string;\n};\nexport type ShowLabelProps = {\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean | string;\n};\nexport type ValueProps = {\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type BaseFormProps = {\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean | string;\n /**\n * The label attribute specifies the caption of the form element.\n */\n label?: string;\n\n /**\n * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.\n */\n name?: string;\n};\nexport type CustomFormProps = {\n /**\n * Overwrites auto handling for aria-describedby.\n */\n ariaDescribedBy?: string;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n};\nexport type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;\nexport const FieldSizingList = ['fixed', 'content'] as const;\nexport type FieldSizingType = (typeof FieldSizingList)[number];\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number | string;\n /**\n * Maximum length (number of characters) of value\n */\n maxlength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minlength?: number | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readonly?: boolean | string;\n\n /**\n * Adds shrinkwrap for input and textarea: https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing\n * Note: Only supported in Chromium browsers so far\n */\n fieldSizing?: FieldSizingType;\n};\nexport type FormSizeProps = {\n /**\n * Size of the control\n */\n size?: number;\n};\nexport type FormCheckProps = {\n /**\n * Define the radio or checkbox elements checked state\n */\n checked?: boolean | string;\n};\nexport const LabelVariantList = ['above', 'floating'] as const;\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'] as const;\nexport type AutoCompleteType = (typeof AutoCompleteList)[number];\nexport type FormMessageProps = {\n /**\n * Change the variant of the label to float or hidden\n */\n variant?: LabelVariantType;\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder?: string;\n /**\n * Optional helper message for form components\n */\n message?: string;\n\n /**\n * Helper message for valid form components\n */\n validMessage?: string;\n\n /**\n * Helper message for invalid form components\n */\n invalidMessage?: string;\n\n /**\n * Set/overwrite icon for helper message for form components\n */\n messageIcon?: IconTypes;\n\n /**\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autocomplete?: string | AutoCompleteType;\n\n /**\n * Enables or disables the visibility of the message.\n */\n showMessage?: boolean | string;\n};\nexport type FromValidState = {\n hasValidState: () => boolean;\n handleValidation: () => void;\n _invalidMessage?: string;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n _invalidMessage?: string;\n /**\n * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html\n * Currently VoiceOver isn't supporting changes from aria-describedby.\n * This is an internal Fallback\n */\n _voiceOverFallback?: string;\n};\nexport type InitializedState = {\n initialized: boolean;\n};\nexport const LinkCurrentList = ['time', 'true', 'false', 'date', 'page', 'step', 'location'] as const;\nexport type LinkCurrentType = (typeof LinkCurrentList)[number];\nexport const LinkTargetList = ['_self', '_blank', '_parent', '_top'] as const;\nexport type LinkTargetType = (typeof LinkTargetList)[number];\nexport const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const;\nexport type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];\nexport type LinkProps = {\n /**\n * Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).\n */\n current?: boolean | LinkCurrentType;\n /**\n * Disables the link.\n */\n disabled?: boolean | string;\n /**\n * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).\n */\n href?: string;\n /**\n * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).\n */\n hreflang?: string;\n /**\n * Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).\n */\n label?: string;\n /**\n * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).\n */\n target?: LinkTargetType;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n rel?: string;\n /**\n * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).\n */\n role?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n referrerpolicy?: LinkReferrerPolicyType;\n /**\n * Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).\n */\n selected?: boolean | string;\n};\nexport type TextProps = {\n /**\n * Alternative for default slot/children.\n */\n text?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralEvent<T> = Event;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralKeyboardEvent<T> = KeyboardEvent;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type ClickEvent<T> = MouseEvent;\nexport type ClickEventProps<T> = {\n /**\n * React specific onClick to pass to forward ref.\n */\n onClick?: (event: ClickEvent<T>) => void;\n};\nexport type ClickEventState<T> = {\n handleClick: (event: ClickEvent<T> | any) => void;\n};\nexport type ToggleEventProps = {\n toggle?: (open: boolean) => void;\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n handleToggle: (event?: ClickEvent<T> | any) => void;\n};\nexport type CloseEventProps<T> = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: T) => void;\n /**\n * Function to handle button click (close).\n */\n close?: (event?: T) => void;\n};\nexport type CloseEventState<T> = {\n handleClose: (event?: T | void, forceClose?: boolean) => void;\n};\nexport const AlignmentList = ['start', 'center'] as const;\nexport type AlignmentType = (typeof AlignmentList)[number];\nexport type AlignmentProps = {\n /**\n * Define the content alignment in full width\n */\n alignment?: AlignmentType | string;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean | string;\n};\nexport type InputEvent<T> = Event;\nexport type InputEventProps<T> = {\n input?: (event: InputEvent<T>) => void;\n onInput?: (event: InputEvent<T>) => void;\n};\nexport type InputEventState<T> = {\n handleInput: (event: InputEvent<T> | any) => void;\n};\nexport type ChangeEvent<T> = Event;\nexport type ChangeEventProps<T> = {\n change?: (event: ChangeEvent<T>) => void;\n onChange?: (event: ChangeEvent<T>) => void;\n};\nexport type ChangeEventState<T> = {\n handleChange: (event: ChangeEvent<T> | any) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type InteractionEvent<T> = FocusEvent;\nexport type FocusEventProps<T> = {\n blur?: (event: InteractionEvent<T>) => void;\n onBlur?: (event: InteractionEvent<T>) => void;\n focus?: (event: InteractionEvent<T>) => void;\n onFocus?: (event: InteractionEvent<T>) => void;\n};\nexport type FocusEventState<T> = {\n handleBlur: (event: InteractionEvent<T> | any) => void;\n handleFocus: (event: InteractionEvent<T> | any) => void;\n};\nexport type InnerCloseButtonProps = {\n /**\n * The closeButtonId attribute changes the id inside the close button.\n */\n closeButtonId?: string;\n /**\n * The closeButtonText attribute changes the text inside the close button.\n */\n closeButtonText?: string;\n};\nexport type NavigationBackButtonProps = {\n /**\n * The backButtonId attribute changes the id inside the back button.\n */\n backButtonId?: string;\n /**\n * The backButtonText attribute changes the text inside the back button.\n */\n backButtonText?: string;\n};\nexport type AriaLabelledByProps = {\n /**\n * Pass `aria-labelledby` to inner element\n */\n labelledBy?: string;\n};\nexport type AriaControlsProps = {\n /**\n * Pass `aria-controls` to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n};\nexport type DocumentScrollState = {\n _documentScrollListenerCallbackId?: string;\n handleDocumentScroll: (event: any, parent?: HTMLElement) => void;\n _observer?: IntersectionObserver;\n};\nexport type PopoverState = {\n handleEscape: (event: any) => void;\n handleAutoPlacement: (parent?: HTMLElement) => void;\n handleEnter: (parent?: HTMLElement) => void;\n handleLeave: (event?: any) => void;\n} & DocumentScrollState"],"names":[],"mappings":";;;;;;;;;;AAAA;AAuCa,MAAA,YAAY,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY;AA2BjG,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;AAQvD,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;AAQhD,MAAA,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW;AAEhG,MAAA,qBAAqB,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY;AAE9F,MAAA,aAAa,GAAG,CAAC,GAAG,uBAAuB,EAAE,GAAG,qBAAqB;AAiBrE,MAAA,cAAc,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU;MAc1H,eAAe,GAAG,CAAC,YAAY,EAAE,UAAU;MAQ3C,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM;AAQjC,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO;AAQlD,MAAA,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM;MAE1C,gBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO;MAgCnC,QAAQ,GAAG,CAAC,OAAO,EAAE,QAAQ;MAQ7B,YAAY,GAAG,CAA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E,YAAY;MAuF5L,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["src/shared/model.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { IconTypes } from '@db-ux/core-foundations';\nexport type GlobalProps = {\n /**\n * default slot\n */\n\n children?: any;\n\n /**\n * React specific for adding className to the component.\n */\n className?: string;\n\n /**\n * Workaround for TypeScript using class for all components.\n */\n class?: string | any;\n\n /**\n * @deprecated\n * [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.\n */\n describedbyid?: string;\n\n /**\n * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.\n */\n id?: string;\n\n /**\n * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)\n */\n autofocus?: boolean | string;\n};\nexport type GlobalState = {\n _id?: string;\n};\nexport const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'] as const;\nexport type SemanticType = (typeof SemanticList)[number];\nexport type SemanticProps = {\n /**\n * The semantic defines the default variants for most components.\n */\n semantic?: SemanticType;\n};\nexport type IconProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n icon?: IconTypes;\n};\nexport type ShowIconProps = {\n /**\n * Enables or disables the visibility of the icon. The default value depends on the component.\n * For many components this property is optional to reflect Figma properties.\n */\n showIcon?: boolean | string;\n};\nexport type IconAfterProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconAfter?: IconTypes;\n};\nexport const SpacingList = ['medium', 'small', 'large', 'none'] as const;\nexport type SpacingType = (typeof SpacingList)[number];\nexport type SpacingProps = {\n /**\n * The spacing attribute changes the padding of the component.\n */\n spacing?: SpacingType | string;\n};\nexport const MarginList = ['medium', 'small', 'large', 'none'] as const;\nexport type MarginType = (typeof MarginList)[number];\nexport type MarginProps = {\n /**\n * The margin attribute changes the margin of the component.\n */\n margin?: MarginType;\n};\nexport const PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'] as const;\nexport type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];\nexport const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const;\nexport type PlacementVerticalType = (typeof PlacementVerticalList)[number];\nexport const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList] as const;\nexport type PlacementType = (typeof PlacementList)[number];\nexport type PlacementProps = {\n /**\n * The `placement` attributes values change the position to absolute and adds a transform based on the placement.\n */\n placement?: PlacementType;\n};\nexport type NavigationBehaviorState = {\n handleNavigationItemClick: (event: any) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean | string;\n};\nexport const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'] as const;\nexport type GapSpacingType = (typeof GapSpacingList)[number];\nexport type GapSpacingProps = {\n /**\n * Set the gap/spacing between elements\n */\n gap?: GapSpacingType;\n};\nexport type OverflowProps = {\n /**\n * The overflow attribute sets a max-width and longer text will be dotted.\n */\n overflow?: boolean | string;\n};\nexport const OrientationList = ['horizontal', 'vertical'] as const;\nexport type OrientationType = (typeof OrientationList)[number];\nexport type OrientationProps = {\n /**\n * Change the orientation. Defaults to horizontal.\n */\n orientation?: OrientationType;\n};\nexport const WidthList = ['full', 'auto'] as const;\nexport type WidthType = (typeof WidthList)[number];\nexport type WidthProps = {\n /**\n * Width of the component. Auto width based on children size, full width based on parent elements width.\n */\n width?: WidthType | string;\n};\nexport const MaxWidthList = ['full', 'medium', 'large', 'small'] as const;\nexport type MaxWidthType = (typeof MaxWidthList)[number];\nexport type ContainerWidthProps = {\n /**\n * Set max width for the component\n */\n width?: MaxWidthType;\n};\nexport const PopoverDelayList = ['none', 'slow', 'fast'] as const;\nexport type PopoverDelayType = (typeof PopoverDelayList)[number];\nexport const PopoverWidthList = ['auto', 'fixed'] as const;\nexport type PopoverWidthType = (typeof PopoverWidthList)[number];\nexport type PopoverProps = {\n /**\n * Add a delay before showing the tooltip\n */\n delay?: PopoverDelayType;\n /**\n * Disable animation\n */\n animation?: boolean | string;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type NameProps = {\n /**\n * The name attribute gives the name of the element to group it.\n */\n name?: string;\n};\nexport type NameState = {\n _name?: string;\n handleNameAttribute: () => void;\n};\nexport type ContentSlotProps = {\n /**\n * Default slot which is used to pass in additional content.\n */\n content?: any;\n};\nexport const SizeList = ['small', 'medium'] as const;\nexport type SizeType = (typeof SizeList)[number];\nexport type SizeProps = {\n /**\n * The size attribute changes the font-size and other related sizes of the component.\n */\n size?: SizeType;\n};\nexport const EmphasisList = ['weak', 'strong'] as const;\nexport type EmphasisType = (typeof EmphasisList)[number];\nexport type EmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak or strong importance.\n */\n emphasis?: EmphasisType;\n};\nexport const ValidationList = ['invalid', 'valid', 'no-validation'] as const;\nexport type ValidationType = (typeof ValidationList)[number];\n\n/**\n * Properties to control the required state and its visual annotation for input components.\n */\nexport type RequiredProps = {\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n * The form element will be marked semantically as required and by default also visually with an asterisk '*' next to the label (unless the property `showRequiredAsterisk` is also set with the value `false`).\n */\n required?: boolean | string;\n /**\n * This attribute allows to specify whether a form field which is marked as required will show a visual indicator (an asterisk '*').\n * It allows to prevent adding the visual indicator but still keep the field semantically required by setting its value to `false`.\n * By default, its value is `true`, so the asterisk is shown when `required` is set.\n */\n showRequiredAsterisk?: boolean | string;\n};\nexport type ShowLabelProps = {\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean | string;\n};\nexport type ValueProps = {\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type BaseFormProps = {\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean | string;\n /**\n * The label attribute specifies the caption of the form element.\n */\n label?: string;\n\n /**\n * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.\n */\n name?: string;\n};\nexport type CustomFormProps = {\n /**\n * Overwrites auto handling for aria-describedby.\n */\n ariaDescribedBy?: string;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n};\nexport type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;\nexport const FieldSizingList = ['fixed', 'content'] as const;\nexport type FieldSizingType = (typeof FieldSizingList)[number];\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number | string;\n /**\n * Maximum length (number of characters) of value\n */\n maxlength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minlength?: number | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readonly?: boolean | string;\n\n /**\n * Adds shrinkwrap for input and textarea: https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing\n * Note: Only supported in Chromium browsers so far\n */\n fieldSizing?: FieldSizingType;\n};\nexport type FormSizeProps = {\n /**\n * Size of the control\n */\n size?: number;\n};\nexport type FormCheckProps = {\n /**\n * Define the radio or checkbox elements checked state\n */\n checked?: boolean | string;\n};\nexport const LabelVariantList = ['above', 'floating'] as const;\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'] as const;\nexport type AutoCompleteType = (typeof AutoCompleteList)[number];\nexport type FormMessageProps = {\n /**\n * Change the variant of the label to float or hidden\n */\n variant?: LabelVariantType;\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder?: string;\n /**\n * Optional helper message for form components\n */\n message?: string;\n\n /**\n * Helper message for valid form components\n */\n validMessage?: string;\n\n /**\n * Helper message for invalid form components\n */\n invalidMessage?: string;\n\n /**\n * Set/overwrite icon for helper message for form components\n */\n messageIcon?: IconTypes;\n\n /**\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autocomplete?: string | AutoCompleteType;\n\n /**\n * Enables or disables the visibility of the message.\n */\n showMessage?: boolean | string;\n};\nexport type FromValidState = {\n hasValidState: () => boolean;\n handleValidation: () => void;\n _invalidMessage?: string;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n _invalidMessage?: string;\n /**\n * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html\n * Currently VoiceOver isn't supporting changes from aria-describedby.\n * This is an internal Fallback\n */\n _voiceOverFallback?: string;\n};\nexport type InitializedState = {\n initialized: boolean;\n};\nexport const LinkCurrentList = ['time', 'true', 'false', 'date', 'page', 'step', 'location'] as const;\nexport type LinkCurrentType = (typeof LinkCurrentList)[number];\nexport const LinkTargetList = ['_self', '_blank', '_parent', '_top'] as const;\nexport type LinkTargetType = (typeof LinkTargetList)[number];\nexport const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const;\nexport type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];\nexport type LinkProps = {\n /**\n * Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).\n */\n current?: boolean | LinkCurrentType;\n /**\n * Disables the link.\n */\n disabled?: boolean | string;\n /**\n * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).\n */\n href?: string;\n /**\n * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).\n */\n hreflang?: string;\n /**\n * Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).\n */\n label?: string;\n /**\n * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).\n */\n target?: LinkTargetType;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n rel?: string;\n /**\n * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).\n */\n role?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n referrerpolicy?: LinkReferrerPolicyType;\n /**\n * Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).\n */\n selected?: boolean | string;\n};\nexport type TextProps = {\n /**\n * Alternative for default slot/children.\n */\n text?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralEvent<T> = Event;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralKeyboardEvent<T> = KeyboardEvent;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type ClickEvent<T> = MouseEvent;\nexport type ClickEventProps<T> = {\n /**\n * React specific onClick to pass to forward ref.\n */\n onClick?: (event: ClickEvent<T>) => void;\n};\nexport type ClickEventState<T> = {\n handleClick: (event: ClickEvent<T> | any) => void;\n};\nexport type ToggleEventProps = {\n toggle?: (open: boolean) => void;\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n handleToggle: (event?: ClickEvent<T> | any) => void;\n};\nexport type CloseEventProps<T> = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: T) => void;\n /**\n * Function to handle button click (close).\n */\n close?: (event?: T) => void;\n};\nexport type CloseEventState<T> = {\n handleClose: (event?: T | void, forceClose?: boolean) => void;\n};\nexport const AlignmentList = ['start', 'center'] as const;\nexport type AlignmentType = (typeof AlignmentList)[number];\nexport type AlignmentProps = {\n /**\n * Define the content alignment in full width\n */\n alignment?: AlignmentType | string;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean | string;\n};\nexport type InputEvent<T> = Event;\nexport type InputEventProps<T> = {\n input?: (event: InputEvent<T>) => void;\n onInput?: (event: InputEvent<T>) => void;\n};\nexport type InputEventState<T> = {\n handleInput: (event: InputEvent<T> | any) => void;\n};\nexport type ChangeEvent<T> = Event;\nexport type ChangeEventProps<T> = {\n change?: (event: ChangeEvent<T>) => void;\n onChange?: (event: ChangeEvent<T>) => void;\n};\nexport type ChangeEventState<T> = {\n handleChange: (event: ChangeEvent<T> | any) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type InteractionEvent<T> = FocusEvent;\nexport type FocusEventProps<T> = {\n blur?: (event: InteractionEvent<T>) => void;\n onBlur?: (event: InteractionEvent<T>) => void;\n focus?: (event: InteractionEvent<T>) => void;\n onFocus?: (event: InteractionEvent<T>) => void;\n};\nexport type FocusEventState<T> = {\n handleBlur: (event: InteractionEvent<T> | any) => void;\n handleFocus: (event: InteractionEvent<T> | any) => void;\n};\nexport type InnerCloseButtonProps = {\n /**\n * The closeButtonId attribute changes the id inside the close button.\n */\n closeButtonId?: string;\n /**\n * The closeButtonText attribute changes the text inside the close button.\n */\n closeButtonText?: string;\n};\nexport type NavigationBackButtonProps = {\n /**\n * The backButtonId attribute changes the id inside the back button.\n */\n backButtonId?: string;\n /**\n * The backButtonText attribute changes the text inside the back button.\n */\n backButtonText?: string;\n};\nexport type AriaLabelledByProps = {\n /**\n * Pass `aria-labelledby` to inner element\n */\n labelledBy?: string;\n};\nexport type AriaControlsProps = {\n /**\n * Pass `aria-controls` to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n};\nexport type DocumentScrollState = {\n _documentScrollListenerCallbackId?: string;\n handleDocumentScroll: (event: any, parent?: HTMLElement) => void;\n _observer?: IntersectionObserver;\n};\nexport type PopoverState = {\n handleEscape: (event: any) => void;\n handleAutoPlacement: (parent?: HTMLElement) => void;\n handleEnter: (parent?: HTMLElement) => void;\n handleLeave: (event?: any) => void;\n} & DocumentScrollState"],"names":[],"mappings":";;;;;;;;;;AAAA;AAuCa,MAAA,YAAY,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY;AA2BjG,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;AAQvD,MAAM,UAAU,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;AAQhD,MAAA,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,WAAW;AAEhG,MAAA,qBAA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,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU;AA+Dt0B,MAAA,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;AAEpF,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM;MAEtD,sBAAsB,GAAG,CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY;MAuF5L,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_BACK } from "../../shared/constants";
|
|
2
2
|
import { cls, delay, getBoolean, getBooleanAsString, getHideProp, uuid, } from "../../utils";
|
|
3
|
-
import {
|
|
3
|
+
import { NavigationItemSafeTriangle } from "../../utils/navigation";
|
|
4
4
|
import { h, Fragment, } from "@stencil/core";
|
|
5
5
|
/**
|
|
6
6
|
* @slot children - This is a default/unnamed slot
|
|
@@ -17,11 +17,12 @@ export class DBNavigationItem {
|
|
|
17
17
|
this.navigationItemSafeTriangle = undefined;
|
|
18
18
|
}
|
|
19
19
|
handleNavigationItemClick(event) {
|
|
20
|
-
|
|
20
|
+
var _a;
|
|
21
|
+
if (((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.nodeName) === "A") {
|
|
21
22
|
this.autoClose = true;
|
|
22
|
-
delay(() => {
|
|
23
|
+
void delay(() => {
|
|
23
24
|
this.autoClose = false;
|
|
24
|
-
},
|
|
25
|
+
}, 1000);
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
handleClick(event) {
|
|
@@ -105,9 +106,9 @@ export class DBNavigationItem {
|
|
|
105
106
|
}
|
|
106
107
|
render() {
|
|
107
108
|
var _a;
|
|
108
|
-
return (h("li", { key: '
|
|
109
|
+
return (h("li", { key: '62b4491ae6751fc7cc00c2dfb411141111171fb1', class: cls("db-navigation-item", this.className), ref: (el) => {
|
|
109
110
|
this._ref = el;
|
|
110
|
-
}, id: this.id, onMouseOver: () => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.enableFollow(); }, onMouseLeave: () => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.disableFollow(); }, onMouseMove: (event) => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.followByMouseEvent(event); }, "data-width": this.width, "data-icon": this.icon, "data-hide-icon": getHideProp(this.showIcon), "data-active": this.active, "data-wrap": getBooleanAsString(this.wrap), "aria-disabled": getBooleanAsString(this.disabled) }, !this.hasSubNavigation ? this.text ? this.text : h("slot", null) : null, this.hasSubNavigation ? (h(Fragment, null, h("button", { class: "db-navigation-item-expand-button", "aria-haspopup": this.hasAreaPopup, "aria-expanded": this.isSubNavigationExpanded, disabled: getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClick(event) }, this.text ? this.text : h("slot", null)), h("menu", { class: "db-sub-navigation", "data-
|
|
111
|
+
}, id: this.id, onMouseOver: () => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.enableFollow(); }, onMouseLeave: () => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.disableFollow(); }, onMouseMove: (event) => { var _a; return (_a = this.navigationItemSafeTriangle) === null || _a === void 0 ? void 0 : _a.followByMouseEvent(event); }, "data-width": this.width, "data-icon": this.icon, "data-hide-icon": getHideProp(this.showIcon), "data-active": this.active, "data-wrap": getBooleanAsString(this.wrap), "aria-disabled": getBooleanAsString(this.disabled) }, !this.hasSubNavigation ? this.text ? this.text : h("slot", null) : null, this.hasSubNavigation ? (h(Fragment, null, h("button", { class: "db-navigation-item-expand-button", "aria-haspopup": this.hasAreaPopup, "aria-expanded": this.isSubNavigationExpanded, disabled: getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClick(event) }, this.text ? this.text : h("slot", null)), h("menu", { class: "db-sub-navigation", "data-force-close": this.autoClose, id: this.subNavigationId, onClick: (event) => this.handleNavigationItemClick(event) }, this.hasAreaPopup ? (h("div", { class: "db-mobile-navigation-back" }, h("db-button", { icon: "arrow_left", variant: "ghost", id: this.backButtonId, onClick: (event) => this.handleBackClick(event) }, (_a = this.backButtonText) !== null && _a !== void 0 ? _a : DEFAULT_BACK))) : null, h("slot", { name: "subNavigation" })))) : null));
|
|
111
112
|
}
|
|
112
113
|
static get is() { return "db-navigation-item"; }
|
|
113
114
|
static get properties() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-item.js","sourceRoot":"","sources":["../../../src/components/navigation-item/navigation-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EACL,GAAG,EACH,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EACL,SAAS,EACT,CAAC,EACD,QAAQ,EACR,KAAK,EACL,KAAK,EAEL,IAAI,EACJ,KAAK,GACN,MAAM,eAAe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EAAE,EAAE,IAAI,CAAC,eAAe,EACxB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC;oBAExD,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CACnB,WAAK,KAAK,EAAC,2BAA2B;wBACpC,iBACE,IAAI,EAAC,YAAY,EACjB,OAAO,EAAC,OAAO,EACf,EAAE,EAAE,IAAI,CAAC,YAAY,EACrB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAE9C,MAAA,IAAI,CAAC,cAAc,mCAAI,YAAY,CAC1B,CACR,CACP,CAAC,CAAC,CAAC,IAAI;oBACR,YAAM,IAAI,EAAC,eAAe,GAAQ,CAC7B,CACE,CACZ,CAAC,CAAC,CAAC,IAAI,CACL,CACN,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","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 {\n isEventTargetNavigationItem,\n NavigationItemSafeTriangle,\n} 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: unknown) {\n if (isEventTargetNavigationItem(event)) {\n this.autoClose = true;\n delay(() => {\n this.autoClose = false;\n }, 300);\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-auto-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"]}
|
|
1
|
+
{"version":3,"file":"navigation-item.js","sourceRoot":"","sources":["../../../src/components/navigation-item/navigation-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EACL,GAAG,EACH,KAAK,EACL,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAIpE,OAAO,EACL,SAAS,EACT,CAAC,EACD,QAAQ,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CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,eAAa,CAC/B;gBACT,YACE,KAAK,EAAC,mBAAmB,sBACP,IAAI,CAAC,SAAS,EAChC,EAAE,EAAE,IAAI,CAAC,eAAe,EACxB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,yBAAyB,CAAC,KAAK,CAAC;oBAExD,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CACnB,WAAK,KAAK,EAAC,2BAA2B;wBACpC,iBACE,IAAI,EAAC,YAAY,EACjB,OAAO,EAAC,OAAO,EACf,EAAE,EAAE,IAAI,CAAC,YAAY,EACrB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,IAE9C,MAAA,IAAI,CAAC,cAAc,mCAAI,YAAY,CAC1B,CACR,CACP,CAAC,CAAC,CAAC,IAAI;oBACR,YAAM,IAAI,EAAC,eAAe,GAAQ,CAC7B,CACE,CACZ,CAAC,CAAC,CAAC,IAAI,CACL,CACN,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/shared/model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAuCvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAU,CAAC;AA2BnH,MAAM,CA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AAE,SAAS,EAAE,MAAM,CAAU,CAAC;AAE9E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,aAAa,EAAE,4BAA4B,EAAE,QAAQ,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,CAAU,CAAC;AAuFpN,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { IconTypes } from '@db-ux/core-foundations';\nexport type GlobalProps = {\n /**\n * default slot\n */\n\n children?: any;\n\n /**\n * React specific for adding className to the component.\n */\n className?: string;\n\n /**\n * Workaround for TypeScript using class for all components.\n */\n class?: string | any;\n\n /**\n * @deprecated\n * [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.\n */\n describedbyid?: string;\n\n /**\n * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.\n */\n id?: string;\n\n /**\n * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)\n */\n autofocus?: boolean | string;\n};\nexport type GlobalState = {\n _id?: string;\n};\nexport const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'] as const;\nexport type SemanticType = (typeof SemanticList)[number];\nexport type SemanticProps = {\n /**\n * The semantic defines the default variants for most components.\n */\n semantic?: SemanticType;\n};\nexport type IconProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n icon?: IconTypes;\n};\nexport type ShowIconProps = {\n /**\n * Enables or disables the visibility of the icon. The default value depends on the component.\n * For many components this property is optional to reflect Figma properties.\n */\n showIcon?: boolean | string;\n};\nexport type IconAfterProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconAfter?: IconTypes;\n};\nexport const SpacingList = ['medium', 'small', 'large', 'none'] as const;\nexport type SpacingType = (typeof SpacingList)[number];\nexport type SpacingProps = {\n /**\n * The spacing attribute changes the padding of the component.\n */\n spacing?: SpacingType | string;\n};\nexport const MarginList = ['medium', 'small', 'large', 'none'] as const;\nexport type MarginType = (typeof MarginList)[number];\nexport type MarginProps = {\n /**\n * The margin attribute changes the margin of the component.\n */\n margin?: MarginType;\n};\nexport const PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'] as const;\nexport type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];\nexport const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const;\nexport type PlacementVerticalType = (typeof PlacementVerticalList)[number];\nexport const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList] as const;\nexport type PlacementType = (typeof PlacementList)[number];\nexport type PlacementProps = {\n /**\n * The `placement` attributes values change the position to absolute and adds a transform based on the placement.\n */\n placement?: PlacementType;\n};\nexport type NavigationBehaviorState = {\n handleNavigationItemClick: (event: unknown) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean | string;\n};\nexport const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'] as const;\nexport type GapSpacingType = (typeof GapSpacingList)[number];\nexport type GapSpacingProps = {\n /**\n * Set the gap/spacing between elements\n */\n gap?: GapSpacingType;\n};\nexport type OverflowProps = {\n /**\n * The overflow attribute sets a max-width and longer text will be dotted.\n */\n overflow?: boolean | string;\n};\nexport const OrientationList = ['horizontal', 'vertical'] as const;\nexport type OrientationType = (typeof OrientationList)[number];\nexport type OrientationProps = {\n /**\n * Change the orientation. Defaults to horizontal.\n */\n orientation?: OrientationType;\n};\nexport const WidthList = ['full', 'auto'] as const;\nexport type WidthType = (typeof WidthList)[number];\nexport type WidthProps = {\n /**\n * Width of the component. Auto width based on children size, full width based on parent elements width.\n */\n width?: WidthType | string;\n};\nexport const MaxWidthList = ['full', 'medium', 'large', 'small'] as const;\nexport type MaxWidthType = (typeof MaxWidthList)[number];\nexport type ContainerWidthProps = {\n /**\n * Set max width for the component\n */\n width?: MaxWidthType;\n};\nexport const PopoverDelayList = ['none', 'slow', 'fast'] as const;\nexport type PopoverDelayType = (typeof PopoverDelayList)[number];\nexport const PopoverWidthList = ['auto', 'fixed'] as const;\nexport type PopoverWidthType = (typeof PopoverWidthList)[number];\nexport type PopoverProps = {\n /**\n * Add a delay before showing the tooltip\n */\n delay?: PopoverDelayType;\n /**\n * Disable animation\n */\n animation?: boolean | string;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type NameProps = {\n /**\n * The name attribute gives the name of the element to group it.\n */\n name?: string;\n};\nexport type NameState = {\n _name?: string;\n handleNameAttribute: () => void;\n};\nexport type ContentSlotProps = {\n /**\n * Default slot which is used to pass in additional content.\n */\n content?: any;\n};\nexport const SizeList = ['small', 'medium'] as const;\nexport type SizeType = (typeof SizeList)[number];\nexport type SizeProps = {\n /**\n * The size attribute changes the font-size and other related sizes of the component.\n */\n size?: SizeType;\n};\nexport const EmphasisList = ['weak', 'strong'] as const;\nexport type EmphasisType = (typeof EmphasisList)[number];\nexport type EmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak or strong importance.\n */\n emphasis?: EmphasisType;\n};\nexport const ValidationList = ['invalid', 'valid', 'no-validation'] as const;\nexport type ValidationType = (typeof ValidationList)[number];\n\n/**\n * Properties to control the required state and its visual annotation for input components.\n */\nexport type RequiredProps = {\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n * The form element will be marked semantically as required and by default also visually with an asterisk '*' next to the label (unless the property `showRequiredAsterisk` is also set with the value `false`).\n */\n required?: boolean | string;\n /**\n * This attribute allows to specify whether a form field which is marked as required will show a visual indicator (an asterisk '*').\n * It allows to prevent adding the visual indicator but still keep the field semantically required by setting its value to `false`.\n * By default, its value is `true`, so the asterisk is shown when `required` is set.\n */\n showRequiredAsterisk?: boolean | string;\n};\nexport type ShowLabelProps = {\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean | string;\n};\nexport type ValueProps = {\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type BaseFormProps = {\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean | string;\n /**\n * The label attribute specifies the caption of the form element.\n */\n label?: string;\n\n /**\n * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.\n */\n name?: string;\n};\nexport type CustomFormProps = {\n /**\n * Overwrites auto handling for aria-describedby.\n */\n ariaDescribedBy?: string;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n};\nexport type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;\nexport const FieldSizingList = ['fixed', 'content'] as const;\nexport type FieldSizingType = (typeof FieldSizingList)[number];\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number | string;\n /**\n * Maximum length (number of characters) of value\n */\n maxlength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minlength?: number | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readonly?: boolean | string;\n\n /**\n * Adds shrinkwrap for input and textarea: https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing\n * Note: Only supported in Chromium browsers so far\n */\n fieldSizing?: FieldSizingType;\n};\nexport type FormSizeProps = {\n /**\n * Size of the control\n */\n size?: number;\n};\nexport type FormCheckProps = {\n /**\n * Define the radio or checkbox elements checked state\n */\n checked?: boolean | string;\n};\nexport const LabelVariantList = ['above', 'floating'] as const;\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'] as const;\nexport type AutoCompleteType = (typeof AutoCompleteList)[number];\nexport type FormMessageProps = {\n /**\n * Change the variant of the label to float or hidden\n */\n variant?: LabelVariantType;\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder?: string;\n /**\n * Optional helper message for form components\n */\n message?: string;\n\n /**\n * Helper message for valid form components\n */\n validMessage?: string;\n\n /**\n * Helper message for invalid form components\n */\n invalidMessage?: string;\n\n /**\n * Set/overwrite icon for helper message for form components\n */\n messageIcon?: IconTypes;\n\n /**\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autocomplete?: string | AutoCompleteType;\n\n /**\n * Enables or disables the visibility of the message.\n */\n showMessage?: boolean | string;\n};\nexport type FromValidState = {\n hasValidState: () => boolean;\n handleValidation: () => void;\n _invalidMessage?: string;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n _invalidMessage?: string;\n /**\n * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html\n * Currently VoiceOver isn't supporting changes from aria-describedby.\n * This is an internal Fallback\n */\n _voiceOverFallback?: string;\n};\nexport type InitializedState = {\n initialized: boolean;\n};\nexport const LinkCurrentList = ['time', 'true', 'false', 'date', 'page', 'step', 'location'] as const;\nexport type LinkCurrentType = (typeof LinkCurrentList)[number];\nexport const LinkTargetList = ['_self', '_blank', '_parent', '_top'] as const;\nexport type LinkTargetType = (typeof LinkTargetList)[number];\nexport const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const;\nexport type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];\nexport type LinkProps = {\n /**\n * Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).\n */\n current?: boolean | LinkCurrentType;\n /**\n * Disables the link.\n */\n disabled?: boolean | string;\n /**\n * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).\n */\n href?: string;\n /**\n * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).\n */\n hreflang?: string;\n /**\n * Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).\n */\n label?: string;\n /**\n * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).\n */\n target?: LinkTargetType;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n rel?: string;\n /**\n * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).\n */\n role?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n referrerpolicy?: LinkReferrerPolicyType;\n /**\n * Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).\n */\n selected?: boolean | string;\n};\nexport type TextProps = {\n /**\n * Alternative for default slot/children.\n */\n text?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralEvent<T> = Event;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralKeyboardEvent<T> = KeyboardEvent;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type ClickEvent<T> = MouseEvent;\nexport type ClickEventProps<T> = {\n /**\n * React specific onClick to pass to forward ref.\n */\n onClick?: (event: ClickEvent<T>) => void;\n};\nexport type ClickEventState<T> = {\n handleClick: (event: ClickEvent<T> | any) => void;\n};\nexport type ToggleEventProps = {\n toggle?: (open: boolean) => void;\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n handleToggle: (event?: ClickEvent<T> | any) => void;\n};\nexport type CloseEventProps<T> = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: T) => void;\n /**\n * Function to handle button click (close).\n */\n close?: (event?: T) => void;\n};\nexport type CloseEventState<T> = {\n handleClose: (event?: T | void, forceClose?: boolean) => void;\n};\nexport const AlignmentList = ['start', 'center'] as const;\nexport type AlignmentType = (typeof AlignmentList)[number];\nexport type AlignmentProps = {\n /**\n * Define the content alignment in full width\n */\n alignment?: AlignmentType | string;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean | string;\n};\nexport type InputEvent<T> = Event;\nexport type InputEventProps<T> = {\n input?: (event: InputEvent<T>) => void;\n onInput?: (event: InputEvent<T>) => void;\n};\nexport type InputEventState<T> = {\n handleInput: (event: InputEvent<T> | any) => void;\n};\nexport type ChangeEvent<T> = Event;\nexport type ChangeEventProps<T> = {\n change?: (event: ChangeEvent<T>) => void;\n onChange?: (event: ChangeEvent<T>) => void;\n};\nexport type ChangeEventState<T> = {\n handleChange: (event: ChangeEvent<T> | any) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type InteractionEvent<T> = FocusEvent;\nexport type FocusEventProps<T> = {\n blur?: (event: InteractionEvent<T>) => void;\n onBlur?: (event: InteractionEvent<T>) => void;\n focus?: (event: InteractionEvent<T>) => void;\n onFocus?: (event: InteractionEvent<T>) => void;\n};\nexport type FocusEventState<T> = {\n handleBlur: (event: InteractionEvent<T> | any) => void;\n handleFocus: (event: InteractionEvent<T> | any) => void;\n};\nexport type InnerCloseButtonProps = {\n /**\n * The closeButtonId attribute changes the id inside the close button.\n */\n closeButtonId?: string;\n /**\n * The closeButtonText attribute changes the text inside the close button.\n */\n closeButtonText?: string;\n};\nexport type NavigationBackButtonProps = {\n /**\n * The backButtonId attribute changes the id inside the back button.\n */\n backButtonId?: string;\n /**\n * The backButtonText attribute changes the text inside the back button.\n */\n backButtonText?: string;\n};\nexport type AriaLabelledByProps = {\n /**\n * Pass `aria-labelledby` to inner element\n */\n labelledBy?: string;\n};\nexport type AriaControlsProps = {\n /**\n * Pass `aria-controls` to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n};\nexport type DocumentScrollState = {\n _documentScrollListenerCallbackId?: string;\n handleDocumentScroll: (event: any, parent?: HTMLElement) => void;\n _observer?: IntersectionObserver;\n};\nexport type PopoverState = {\n handleEscape: (event: any) => void;\n handleAutoPlacement: (parent?: HTMLElement) => void;\n handleEnter: (parent?: HTMLElement) => void;\n handleLeave: (event?: any) => void;\n} & DocumentScrollState"]}
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/shared/model.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAuCvD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,CAAU,CAAC;AA2BnH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAU,CAAC;AAQzE,MAAM,CAAC,MAAM,UA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Q,EAAE,0BAA0B,EAAE,aAAa,EAAE,eAAe,EAAE,iCAAiC,EAAE,YAAY,CAAU,CAAC;AAuFpN,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { IconTypes } from '@db-ux/core-foundations';\nexport type GlobalProps = {\n /**\n * default slot\n */\n\n children?: any;\n\n /**\n * React specific for adding className to the component.\n */\n className?: string;\n\n /**\n * Workaround for TypeScript using class for all components.\n */\n class?: string | any;\n\n /**\n * @deprecated\n * [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-describedby) is used to link to the elements that describe the element with the set attribute.\n */\n describedbyid?: string;\n\n /**\n * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset.\n */\n id?: string;\n\n /**\n * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns)\n */\n autofocus?: boolean | string;\n};\nexport type GlobalState = {\n _id?: string;\n};\nexport const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'] as const;\nexport type SemanticType = (typeof SemanticList)[number];\nexport type SemanticProps = {\n /**\n * The semantic defines the default variants for most components.\n */\n semantic?: SemanticType;\n};\nexport type IconProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n icon?: IconTypes;\n};\nexport type ShowIconProps = {\n /**\n * Enables or disables the visibility of the icon. The default value depends on the component.\n * For many components this property is optional to reflect Figma properties.\n */\n showIcon?: boolean | string;\n};\nexport type IconAfterProps = {\n /**\n * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content.\n */\n iconAfter?: IconTypes;\n};\nexport const SpacingList = ['medium', 'small', 'large', 'none'] as const;\nexport type SpacingType = (typeof SpacingList)[number];\nexport type SpacingProps = {\n /**\n * The spacing attribute changes the padding of the component.\n */\n spacing?: SpacingType | string;\n};\nexport const MarginList = ['medium', 'small', 'large', 'none'] as const;\nexport type MarginType = (typeof MarginList)[number];\nexport type MarginProps = {\n /**\n * The margin attribute changes the margin of the component.\n */\n margin?: MarginType;\n};\nexport const PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'] as const;\nexport type PlacementHorizontalType = (typeof PlacementHorizontalList)[number];\nexport const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'] as const;\nexport type PlacementVerticalType = (typeof PlacementVerticalList)[number];\nexport const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList] as const;\nexport type PlacementType = (typeof PlacementList)[number];\nexport type PlacementProps = {\n /**\n * The `placement` attributes values change the position to absolute and adds a transform based on the placement.\n */\n placement?: PlacementType;\n};\nexport type NavigationBehaviorState = {\n handleNavigationItemClick: (event: any) => void;\n};\nexport type GapProps = {\n /**\n * If the absolute element should have a gap between the parent element.\n */\n gap?: boolean | string;\n};\nexport const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'] as const;\nexport type GapSpacingType = (typeof GapSpacingList)[number];\nexport type GapSpacingProps = {\n /**\n * Set the gap/spacing between elements\n */\n gap?: GapSpacingType;\n};\nexport type OverflowProps = {\n /**\n * The overflow attribute sets a max-width and longer text will be dotted.\n */\n overflow?: boolean | string;\n};\nexport const OrientationList = ['horizontal', 'vertical'] as const;\nexport type OrientationType = (typeof OrientationList)[number];\nexport type OrientationProps = {\n /**\n * Change the orientation. Defaults to horizontal.\n */\n orientation?: OrientationType;\n};\nexport const WidthList = ['full', 'auto'] as const;\nexport type WidthType = (typeof WidthList)[number];\nexport type WidthProps = {\n /**\n * Width of the component. Auto width based on children size, full width based on parent elements width.\n */\n width?: WidthType | string;\n};\nexport const MaxWidthList = ['full', 'medium', 'large', 'small'] as const;\nexport type MaxWidthType = (typeof MaxWidthList)[number];\nexport type ContainerWidthProps = {\n /**\n * Set max width for the component\n */\n width?: MaxWidthType;\n};\nexport const PopoverDelayList = ['none', 'slow', 'fast'] as const;\nexport type PopoverDelayType = (typeof PopoverDelayList)[number];\nexport const PopoverWidthList = ['auto', 'fixed'] as const;\nexport type PopoverWidthType = (typeof PopoverWidthList)[number];\nexport type PopoverProps = {\n /**\n * Add a delay before showing the tooltip\n */\n delay?: PopoverDelayType;\n /**\n * Disable animation\n */\n animation?: boolean | string;\n /**\n * Use fixed with for default max-width\n */\n width?: PopoverWidthType;\n};\nexport type NameProps = {\n /**\n * The name attribute gives the name of the element to group it.\n */\n name?: string;\n};\nexport type NameState = {\n _name?: string;\n handleNameAttribute: () => void;\n};\nexport type ContentSlotProps = {\n /**\n * Default slot which is used to pass in additional content.\n */\n content?: any;\n};\nexport const SizeList = ['small', 'medium'] as const;\nexport type SizeType = (typeof SizeList)[number];\nexport type SizeProps = {\n /**\n * The size attribute changes the font-size and other related sizes of the component.\n */\n size?: SizeType;\n};\nexport const EmphasisList = ['weak', 'strong'] as const;\nexport type EmphasisType = (typeof EmphasisList)[number];\nexport type EmphasisProps = {\n /**\n * The emphasis attribute divides in between a weak or strong importance.\n */\n emphasis?: EmphasisType;\n};\nexport const ValidationList = ['invalid', 'valid', 'no-validation'] as const;\nexport type ValidationType = (typeof ValidationList)[number];\n\n/**\n * Properties to control the required state and its visual annotation for input components.\n */\nexport type RequiredProps = {\n /**\n * When the required attribute specified, the user will be required to fill the form element before submitting the form.\n * The form element will be marked semantically as required and by default also visually with an asterisk '*' next to the label (unless the property `showRequiredAsterisk` is also set with the value `false`).\n */\n required?: boolean | string;\n /**\n * This attribute allows to specify whether a form field which is marked as required will show a visual indicator (an asterisk '*').\n * It allows to prevent adding the visual indicator but still keep the field semantically required by setting its value to `false`.\n * By default, its value is `true`, so the asterisk is shown when `required` is set.\n */\n showRequiredAsterisk?: boolean | string;\n};\nexport type ShowLabelProps = {\n /**\n * Enables/disables the visibility of the label\n */\n showLabel?: boolean | string;\n};\nexport type ValueProps = {\n /**\n * The value property is to receive results from the native form element.\n */\n value?: any;\n};\nexport type BaseFormProps = {\n /**\n * The disabled attribute can be set to keep a user from clicking on the form element.\n */\n disabled?: boolean | string;\n /**\n * The label attribute specifies the caption of the form element.\n */\n label?: string;\n\n /**\n * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object.\n */\n name?: string;\n};\nexport type CustomFormProps = {\n /**\n * Overwrites auto handling for aria-describedby.\n */\n ariaDescribedBy?: string;\n /**\n * \tAssociates the control with a form element\n */\n form?: string;\n\n /**\n * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector.\n */\n validation?: ValidationType;\n};\nexport type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps;\nexport const FieldSizingList = ['fixed', 'content'] as const;\nexport type FieldSizingType = (typeof FieldSizingList)[number];\nexport type FormTextProps = {\n /**\n * Maximum length (number of characters) of value\n */\n maxLength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minLength?: number | string;\n /**\n * Maximum length (number of characters) of value\n */\n maxlength?: number | string;\n /**\n * Minimum length (number of characters) of value\n */\n minlength?: number | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readOnly?: boolean | string;\n /**\n * The disabled attribute can be set to keep a user from edit on the form element\n */\n readonly?: boolean | string;\n\n /**\n * Adds shrinkwrap for input and textarea: https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing\n * Note: Only supported in Chromium browsers so far\n */\n fieldSizing?: FieldSizingType;\n};\nexport type FormSizeProps = {\n /**\n * Size of the control\n */\n size?: number;\n};\nexport type FormCheckProps = {\n /**\n * Define the radio or checkbox elements checked state\n */\n checked?: boolean | string;\n};\nexport const LabelVariantList = ['above', 'floating'] as const;\nexport type LabelVariantType = (typeof LabelVariantList)[number];\nexport const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'] as const;\nexport type AutoCompleteType = (typeof AutoCompleteList)[number];\nexport type FormMessageProps = {\n /**\n * Change the variant of the label to float or hidden\n */\n variant?: LabelVariantType;\n /**\n * Text that appears in the form control when it has no value set\n */\n placeholder?: string;\n /**\n * Optional helper message for form components\n */\n message?: string;\n\n /**\n * Helper message for valid form components\n */\n validMessage?: string;\n\n /**\n * Helper message for invalid form components\n */\n invalidMessage?: string;\n\n /**\n * Set/overwrite icon for helper message for form components\n */\n messageIcon?: IconTypes;\n\n /**\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete\n */\n autocomplete?: string | AutoCompleteType;\n\n /**\n * Enables or disables the visibility of the message.\n */\n showMessage?: boolean | string;\n};\nexport type FromValidState = {\n hasValidState: () => boolean;\n handleValidation: () => void;\n _invalidMessage?: string;\n};\nexport type FormState = {\n _messageId?: string;\n _validMessageId?: string;\n _invalidMessageId?: string;\n _descByIds?: string;\n _value?: string;\n _invalidMessage?: string;\n /**\n * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html\n * Currently VoiceOver isn't supporting changes from aria-describedby.\n * This is an internal Fallback\n */\n _voiceOverFallback?: string;\n};\nexport type InitializedState = {\n initialized: boolean;\n};\nexport const LinkCurrentList = ['time', 'true', 'false', 'date', 'page', 'step', 'location'] as const;\nexport type LinkCurrentType = (typeof LinkCurrentList)[number];\nexport const LinkTargetList = ['_self', '_blank', '_parent', '_top'] as const;\nexport type LinkTargetType = (typeof LinkTargetList)[number];\nexport const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'] as const;\nexport type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number];\nexport type LinkProps = {\n /**\n * Sets aria attribute based on [`aria-current`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current).\n */\n current?: boolean | LinkCurrentType;\n /**\n * Disables the link.\n */\n disabled?: boolean | string;\n /**\n * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href).\n */\n href?: string;\n /**\n * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang).\n */\n hreflang?: string;\n /**\n * Sets aria attribute based on [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label).\n */\n label?: string;\n /**\n * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target).\n */\n target?: LinkTargetType;\n /**\n * The relationship of the linked URL as space-separated link types.\n */\n rel?: string;\n /**\n * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles).\n */\n role?: string;\n /**\n * How much of the referrer to send when following the link.\n */\n referrerpolicy?: LinkReferrerPolicyType;\n /**\n * Sets aria role based on [`aria-selected`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected).\n */\n selected?: boolean | string;\n};\nexport type TextProps = {\n /**\n * Alternative for default slot/children.\n */\n text?: string;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralEvent<T> = Event;\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type GeneralKeyboardEvent<T> = KeyboardEvent;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type ClickEvent<T> = MouseEvent;\nexport type ClickEventProps<T> = {\n /**\n * React specific onClick to pass to forward ref.\n */\n onClick?: (event: ClickEvent<T>) => void;\n};\nexport type ClickEventState<T> = {\n handleClick: (event: ClickEvent<T> | any) => void;\n};\nexport type ToggleEventProps = {\n toggle?: (open: boolean) => void;\n onToggle?: (open: boolean) => void;\n};\nexport type ToggleEventState<T> = {\n handleToggle: (event?: ClickEvent<T> | any) => void;\n};\nexport type CloseEventProps<T> = {\n /**\n * Function to handle button click (close).\n */\n onClose?: (event?: T) => void;\n /**\n * Function to handle button click (close).\n */\n close?: (event?: T) => void;\n};\nexport type CloseEventState<T> = {\n handleClose: (event?: T | void, forceClose?: boolean) => void;\n};\nexport const AlignmentList = ['start', 'center'] as const;\nexport type AlignmentType = (typeof AlignmentList)[number];\nexport type AlignmentProps = {\n /**\n * Define the content alignment in full width\n */\n alignment?: AlignmentType | string;\n};\nexport type ActiveProps = {\n /**\n * If the tab is checked/active.\n */\n active?: boolean | string;\n};\nexport type InputEvent<T> = Event;\nexport type InputEventProps<T> = {\n input?: (event: InputEvent<T>) => void;\n onInput?: (event: InputEvent<T>) => void;\n};\nexport type InputEventState<T> = {\n handleInput: (event: InputEvent<T> | any) => void;\n};\nexport type ChangeEvent<T> = Event;\nexport type ChangeEventProps<T> = {\n change?: (event: ChangeEvent<T>) => void;\n onChange?: (event: ChangeEvent<T>) => void;\n};\nexport type ChangeEventState<T> = {\n handleChange: (event: ChangeEvent<T> | any) => void;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type InteractionEvent<T> = FocusEvent;\nexport type FocusEventProps<T> = {\n blur?: (event: InteractionEvent<T>) => void;\n onBlur?: (event: InteractionEvent<T>) => void;\n focus?: (event: InteractionEvent<T>) => void;\n onFocus?: (event: InteractionEvent<T>) => void;\n};\nexport type FocusEventState<T> = {\n handleBlur: (event: InteractionEvent<T> | any) => void;\n handleFocus: (event: InteractionEvent<T> | any) => void;\n};\nexport type InnerCloseButtonProps = {\n /**\n * The closeButtonId attribute changes the id inside the close button.\n */\n closeButtonId?: string;\n /**\n * The closeButtonText attribute changes the text inside the close button.\n */\n closeButtonText?: string;\n};\nexport type NavigationBackButtonProps = {\n /**\n * The backButtonId attribute changes the id inside the back button.\n */\n backButtonId?: string;\n /**\n * The backButtonText attribute changes the text inside the back button.\n */\n backButtonText?: string;\n};\nexport type AriaLabelledByProps = {\n /**\n * Pass `aria-labelledby` to inner element\n */\n labelledBy?: string;\n};\nexport type AriaControlsProps = {\n /**\n * Pass `aria-controls` to inner element\n */\n controls?: string;\n};\nexport type ValueLabelType = {\n value: string;\n label?: string;\n};\nexport type DocumentScrollState = {\n _documentScrollListenerCallbackId?: string;\n handleDocumentScroll: (event: any, parent?: HTMLElement) => void;\n _observer?: IntersectionObserver;\n};\nexport type PopoverState = {\n handleEscape: (event: any) => void;\n handleAutoPlacement: (parent?: HTMLElement) => void;\n handleEnter: (parent?: HTMLElement) => void;\n handleLeave: (event?: any) => void;\n} & DocumentScrollState"]}
|
|
@@ -11374,7 +11374,7 @@
|
|
|
11374
11374
|
{
|
|
11375
11375
|
"name": "event",
|
|
11376
11376
|
"type": {
|
|
11377
|
-
"text": "
|
|
11377
|
+
"text": "any"
|
|
11378
11378
|
}
|
|
11379
11379
|
}
|
|
11380
11380
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-navigation-item.entry.esm.js","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 {\n isEventTargetNavigationItem,\n NavigationItemSafeTriangle,\n} 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: unknown) {\n if (isEventTargetNavigationItem(event)) {\n this.autoClose = true;\n delay(() => {\n this.autoClose = false;\n }, 300);\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-auto-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"],"names":[],"mappings":";;;;;;MAoCa,gBAAgB,GAAA,MAAA;AAH5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBU,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AACnB,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AACpB,QAAA,IAAgB,CAAA,gBAAA,GAAG,IAAI;AACvB,QAAA,IAAuB,CAAA,uBAAA,GAAG,KAAK;A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EAAA,EAExD,IAAI,CAAC,YAAY,IAChB,CAAA,CAAA,KAAA,EAAA,EAAK,KAAK,EAAC,2BAA2B,EAAA,EACpC,CAAA,CAAA,WAAA,EAAA,EACE,IAAI,EAAC,YAAY,EACjB,OAAO,EAAC,OAAO,EACf,EAAE,EAAE,IAAI,CAAC,YAAY,EACrB,OAAO,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAA,EAE9C,MAAA,IAAI,CAAC,cAAc,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,YAAY,CAC1B,CACR,IACJ,IAAI,EACR,CAAA,CAAA,MAAA,EAAA,EAAM,IAAI,EAAC,eAAe,EAAA,CAAQ,CAC7B,CACE,IACT,IAAI,CACL;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"db-navigation-item.entry.esm.js","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"],"names":[],"mappings":";;;;;;MAiCa,gBAAgB,GAAA,MAAA;AAH5B,IAAA,WAAA,CAAA,OAAA,EAAA;;;AAoBU,QAAA,IAAW,CAAA,WAAA,GAAG,KAAK;AACnB,QAAA,IAAY,CAAA,YAAA,GAAG,KAAK;AACpB,QAAA,IAAgB,CAAA,gBAAA,GAAG,IAAI;AACvB,QAAA,IAAuB,CAAA,uBAAA,GAAG,KAAK;AAC/B,QAAA,IAAS,CAAA,SAAA,GAAG,KAAK;AACjB,QAAA,IAAA,CAAA,eAAe,GAAG,iBAAiB,GAAG,IAAI,EAAE;AAC5C,QAAA,IAA0B,CAAA,0BAAA,GAAG,SAAS;AAuKhD;AArKC,IAAA,yBAAyB,CAAC,KAAU,EAAA;;QAClC,IAAI,CAAA,CAAA,EAAA,GAAA,KAAK,KAAA,IAAA,IAAL,KAAK,KAAL,MAAA,GAAA,MAAA,GAAA,KAAK,CAAE,MAAM,MAAE,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,QAAQ,MAAK,GAAG,EAAE;AACnC,YAAA,IAAI,CAAC,SAAS,GAAG,IAAI;YACrB,KAAK,KAAK,CAAC,MAAK;AACd,gBAAA,IAAI,CAAC,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