@db-ux/wc-core-components 4.12.0 → 4.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/bundle/db-custom-select-list-item.js +1 -1
- package/bundle/db-custom-select.js +1 -1
- package/bundle/db-drawer.js +1 -1
- package/bundle/db-header.js +1 -1
- package/bundle/db-navigation-item.js +1 -1
- package/bundle/db-popover.js +1 -1
- package/bundle/db-tag.js +1 -1
- package/bundle/db-tooltip.js +1 -1
- package/bundle/index.js +1 -1
- package/bundle/p-BFeR7jXy.js +1 -0
- package/bundle/p-C0q9XJSc.js +1 -0
- package/bundle/{p-BuBrj57D.js → p-C_qYW0Kh.js} +1 -1
- package/bundle/{p-BvgvWjGH.js → p-CuC4YsIB.js} +1 -1
- package/bundle/{p-DFypNnh0.js → p-gIJnyld5.js} +1 -1
- package/bundle/p-k8bCF_aj.js +1 -0
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +1 -1
- package/dist/cjs/db-custom-select.cjs.entry.js +15 -7
- package/dist/cjs/db-drawer.cjs.entry.js +28 -7
- package/dist/cjs/db-header.cjs.entry.js +2 -2
- package/dist/cjs/db-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/db-popover.cjs.entry.js +1 -1
- package/dist/cjs/db-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/db-ux.cjs.js +1 -1
- package/dist/cjs/{floating-components-DlstoCKH.js → floating-components-SpHkZuLA.js} +53 -8
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{navigation-Bah882nU.js → navigation-DUTSDY4q.js} +1 -1
- package/dist/collection/components/custom-select/custom-select.js +14 -6
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +1 -1
- package/dist/collection/components/drawer/drawer.js +29 -7
- package/dist/collection/utils/floating-components.js +53 -8
- package/dist/custom-elements.json +119 -20
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/{p-88dcff6a.entry.js → p-183c78b7.entry.js} +1 -1
- package/dist/db-ux/p-4751361d.entry.js +1 -0
- package/dist/db-ux/{p-bb5149a9.entry.js → p-5623ff36.entry.js} +1 -1
- package/dist/db-ux/{p-ef63c591.entry.js → p-87281518.entry.js} +1 -1
- package/dist/db-ux/p-C0q9XJSc.js +1 -0
- package/dist/db-ux/{p-BuBrj57D.js → p-C_qYW0Kh.js} +1 -1
- package/dist/db-ux/p-a6f33f3b.entry.js +1 -0
- package/dist/db-ux/p-f271332c.entry.js +1 -0
- package/dist/db-ux/{p-6fd70ba4.entry.js → p-f5f73623.entry.js} +1 -1
- package/dist/esm/db-custom-select-dropdown_5.entry.js +1 -1
- package/dist/esm/db-custom-select.entry.js +15 -7
- package/dist/esm/db-drawer.entry.js +28 -7
- package/dist/esm/db-header.entry.js +2 -2
- package/dist/esm/db-navigation-item.entry.js +2 -2
- package/dist/esm/db-popover.entry.js +1 -1
- package/dist/esm/db-tooltip.entry.js +1 -1
- package/dist/esm/db-ux.js +1 -1
- package/dist/esm/{floating-components-DOPXnIzL.js → floating-components-C0q9XJSc.js} +53 -8
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{navigation-Jh6m0eMk.js → navigation-Cd7KZ6E2.js} +1 -1
- package/dist/types/components/drawer/drawer.d.ts +4 -1
- package/dist/types/components/drawer/model.d.ts +3 -0
- package/dist/vscode.html-custom-data.json +6 -0
- package/dist/web-types.json +13 -1
- package/package.json +3 -3
- package/bundle/p-DOPXnIzL.js +0 -1
- package/bundle/p-DW47OZNu.js +0 -1
- package/bundle/p-n2qePi9e.js +0 -1
- package/dist/db-ux/p-4a94fbc9.entry.js +0 -1
- package/dist/db-ux/p-96978a7f.entry.js +0 -1
- package/dist/db-ux/p-DOPXnIzL.js +0 -1
- package/dist/db-ux/p-a4fb4782.entry.js +0 -1
|
@@ -429,6 +429,7 @@ export class DBCustomSelect {
|
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
handleSearch(valueOrEvent) {
|
|
432
|
+
var _a;
|
|
432
433
|
if (valueOrEvent === undefined) {
|
|
433
434
|
return;
|
|
434
435
|
}
|
|
@@ -457,6 +458,9 @@ export class DBCustomSelect {
|
|
|
457
458
|
.toLowerCase()
|
|
458
459
|
.includes(filterText.toLowerCase()));
|
|
459
460
|
}
|
|
461
|
+
if ((_a = this.detailsRef) === null || _a === void 0 ? void 0 : _a.open) {
|
|
462
|
+
this.handleAutoPlacement();
|
|
463
|
+
}
|
|
460
464
|
}
|
|
461
465
|
handleClearAll(event) {
|
|
462
466
|
event.stopPropagation();
|
|
@@ -686,10 +690,14 @@ export class DBCustomSelect {
|
|
|
686
690
|
this.watch11Fn();
|
|
687
691
|
}
|
|
688
692
|
watch12Fn() {
|
|
689
|
-
var _a, _b;
|
|
693
|
+
var _a, _b, _c;
|
|
690
694
|
this._options = this.options;
|
|
691
695
|
this.amountOptions =
|
|
692
696
|
(_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((option) => !option.isGroupTitle).length) !== null && _b !== void 0 ? _b : 0;
|
|
697
|
+
// Reposition open auto-width dropdowns: replacing options can change their content width.
|
|
698
|
+
if ((_c = this.detailsRef) === null || _c === void 0 ? void 0 : _c.open) {
|
|
699
|
+
this.handleAutoPlacement();
|
|
700
|
+
}
|
|
693
701
|
}
|
|
694
702
|
watch12() {
|
|
695
703
|
this.watch12Fn();
|
|
@@ -830,19 +838,19 @@ export class DBCustomSelect {
|
|
|
830
838
|
}
|
|
831
839
|
render() {
|
|
832
840
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
833
|
-
return (h("div", { key: '
|
|
841
|
+
return (h("div", { key: '9f804bd057ef9cde5cc83263e5b1e3a477ad5d2e', class: cls("db-custom-select", this.className), id: this._id, ref: (el) => {
|
|
834
842
|
this._ref = el;
|
|
835
843
|
}, "aria-invalid": this._validity === "invalid", "data-custom-validity": this._validity, "data-width": this.formFieldWidth, "data-variant": this.variant === "floating" &&
|
|
836
844
|
this.selectedType === "tag" &&
|
|
837
845
|
this.multiple
|
|
838
846
|
? "above"
|
|
839
|
-
: this.variant, "data-required": getBooleanAsString(this.required, "required"), "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-placement": this.placement, "data-selected-type": this.multiple ? this.selectedType : "text", "data-hide-label": getHideProp(this.showLabel), "data-icon": this.icon, "data-show-icon": getBooleanAsString(this.showIcon, "showIcon") }, h("label", { key: '
|
|
847
|
+
: this.variant, "data-required": getBooleanAsString(this.required, "required"), "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-placement": this.placement, "data-selected-type": this.multiple ? this.selectedType : "text", "data-hide-label": getHideProp(this.showLabel), "data-icon": this.icon, "data-show-icon": getBooleanAsString(this.showIcon, "showIcon") }, h("label", { key: '1ce826237b63c3abfad8b55068c25fdc4acc2d7a', id: this._labelId }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL, h("select", { key: '9f16da6b3d9e633e4ce70e8654925df86a901074', role: "none", hidden: true, id: this._selectId, tabIndex: -1, ref: (el) => {
|
|
840
848
|
this.selectRef = el;
|
|
841
849
|
}, form: this.form, name: this.name, "data-custom-validity": this._validity, multiple: getBoolean(this.multiple, "multiple"), disabled: getBoolean(this.disabled, "disabled"), required: getBoolean(this.required, "required"), onChange: (event) => this.satisfyReact(event) }, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.length)
|
|
842
850
|
? (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => (h("option", { disabled: option.disabled, value: option.value, key: undefined }, this.getOptionLabel(option))))
|
|
843
|
-
: null)), h("details", { key: '
|
|
851
|
+
: null)), h("details", { key: '6a88c236898236ee539bced6fa3b3918be8f693d', ref: (el) => {
|
|
844
852
|
this.detailsRef = el;
|
|
845
|
-
}, open: this.open, onToggle: (event) => this.handleDropdownToggle(event), onKeyDown: (event) => this.handleKeyboardPress(event) }, h("slot", { key: '
|
|
853
|
+
}, open: this.open, onToggle: (event) => this.handleDropdownToggle(event), onKeyDown: (event) => this.handleKeyboardPress(event) }, h("slot", { key: 'c9dd3e30dd094da51de1b2064749a211fef6eb36' }), this.options ? (h(Fragment, null, h("summary", { class: "db-custom-select-form-field", id: this._summaryId, "aria-disabled": getBooleanAsString(this.disabled, "disabled"), tabIndex: this.disabled ? -1 : undefined, "aria-labelledby": this._labelId }, ((_d = this._selectedLabels) === null || _d === void 0 ? void 0 : _d.length) ? (h("span", { "data-visually-hidden": getBooleanAsString(this.selectedType === "tag", "selectedType"), id: this._selectedLabelsId }, this.selectedPrefix ? (h("span", { "data-visually-hidden": "true" }, this.selectedPrefix)) : null, this._selectedLabels)) : null, this.selectedType === "tag" ? (h("div", null, (_e = this._selectedOptions) === null || _e === void 0 ? void 0 : _e.map((option) => (h("db-tag", { emphasis: "strong", behavior: "removable", removeButton: this.getTagRemoveLabel(option), onRemove: (event) => this.handleTagRemove(option, event), key: undefined }, this.getOptionLabel(option)))))) : null), h("db-custom-select-dropdown", { width: this.dropdownWidth }, this.searchEnabled ? (h("div", null, h("db-input", { type: "search", ref: (el) => {
|
|
846
854
|
this.searchInputRef = el;
|
|
847
855
|
}, name: this._id, form: this._id, showLabel: false, value: this._searchValue, label: (_f = this.searchLabel) !== null && _f !== void 0 ? _f : DEFAULT_LABEL, placeholder: (_g = this.searchPlaceholder) !== null && _g !== void 0 ? _g : this.searchLabel, ariaDescribedBy: this._hasNoOptions || this.showLoading
|
|
848
856
|
? this._infoTextId
|
|
@@ -852,7 +860,7 @@ export class DBCustomSelect {
|
|
|
852
860
|
this.selectAllRef = el;
|
|
853
861
|
}, form: this._id, checked: this.selectAllChecked, onChange: (event) => this.handleSelectAll(event) }), this.getSelectAllLabel())))) : null, h("db-custom-select-list", { multiple: getBoolean(this.multiple, "multiple"), label: (_k = (_j = this.listLabel) !== null && _j !== void 0 ? _j : this.label) !== null && _k !== void 0 ? _k : DEFAULT_LABEL }, (_l = this._options) === null || _l === void 0 ? void 0 : _l.map((option) => (h("db-custom-select-list-item", { type: this.multiple ? "checkbox" : "radio", showDivider: option.showDivider, icon: option.icon, isGroupTitle: option.isGroupTitle, groupTitle: this.getOptionLabel(option), name: this._id, checked: this.getOptionChecked(option.value), disabled: option.disabled, value: option.value, onChange: () => this.handleSelect(option.value), key: undefined }, !option.isGroupTitle
|
|
854
862
|
? this.getOptionLabel(option)
|
|
855
|
-
: null)))))), h("div", null, h("db-button", { variant: "ghost", width: "full", icon: "cross", size: "small", name: this._id, form: this._id, onClick: () => this.handleClose(undefined, true) }, (_m = this.mobileCloseButtonText) !== null && _m !== void 0 ? _m : DEFAULT_CLOSE_BUTTON))))) : null), ((_o = this.showClearSelection) !== null && _o !== void 0 ? _o : true) && ((_p = this._values) === null || _p === void 0 ? void 0 : _p.length) ? (h("db-button", { icon: "cross", variant: "ghost", size: "small", noText: true, name: this._id, form: this._id, disabled: getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClearAll(event) }, this.clearSelectionText, h("db-tooltip", { placement: "top" }, this.clearSelectionText))) : null, h("span", { key: '
|
|
863
|
+
: null)))))), h("div", null, h("db-button", { variant: "ghost", width: "full", icon: "cross", size: "small", name: this._id, form: this._id, onClick: () => this.handleClose(undefined, true) }, (_m = this.mobileCloseButtonText) !== null && _m !== void 0 ? _m : DEFAULT_CLOSE_BUTTON))))) : null), ((_o = this.showClearSelection) !== null && _o !== void 0 ? _o : true) && ((_p = this._values) === null || _p === void 0 ? void 0 : _p.length) ? (h("db-button", { icon: "cross", variant: "ghost", size: "small", noText: true, name: this._id, form: this._id, disabled: getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClearAll(event) }, this.clearSelectionText, h("db-tooltip", { placement: "top" }, this.clearSelectionText))) : null, h("span", { key: '3210abcd9df6f8232346aa78def9e3bd078f35db', class: "db-custom-select-placeholder", "aria-hidden": "true", id: this._placeholderId }, (_q = this.placeholder) !== null && _q !== void 0 ? _q : this.label), stringPropVisible(this.message, this.showMessage) ? (h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || DEFAULT_VALID_MESSAGE)) : null, h("db-infotext", { key: 'a552df2b93f899230e80623e2014691e411c3b40', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: 'b29045acf1f702b90b434dc4aa9d589c0c6c57f5', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
856
864
|
}
|
|
857
865
|
static get is() { return "db-custom-select"; }
|
|
858
866
|
static get properties() {
|
|
@@ -110,7 +110,7 @@ export class DBCustomSelectListItem {
|
|
|
110
110
|
"db-radio": this.type !== "checkbox" && !this.isGroupTitle,
|
|
111
111
|
}), ref: (el) => {
|
|
112
112
|
this._ref = el;
|
|
113
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-divider": getBooleanAsString(this.hasDivider, "hasDivider") }, !this.isGroupTitle ? (h("label", { "data-icon": this.type !== "checkbox" && this.icon ? this.icon : undefined, "data-show-icon": getBooleanAsString(this.showIcon, "showIcon"), "data-icon-trailing": this.getIconTrailing() }, h("input", { class: "db-custom-select-list-item-checkbox", "data-disable-focus": "true", type: this.type, name: this.name, form: this.name, checked: getBoolean(this.checked, "checked"), disabled: getBoolean(this.disabled, "disabled"), value: this.value, onChange: (event) => this.handleChange(event) }), this.label ? this.label : null, h("slot", null))) : (h("span", null, this.groupTitle))));
|
|
113
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-divider": getBooleanAsString(this.hasDivider, "hasDivider") }, !this.isGroupTitle ? (h("label", { "data-icon": this.type !== "checkbox" && this.icon ? this.icon : undefined, "data-show-icon": getBooleanAsString(this.showIcon, "showIcon"), "data-icon-trailing": this.getIconTrailing() }, h("input", { class: "db-custom-select-list-item-checkbox", "data-disable-focus": "true", type: this.type, name: this.name, form: this.name, checked: getBoolean(this.checked, "checked"), disabled: getBoolean(this.disabled, "disabled"), value: this.value, onChange: (event) => this.handleChange(event) }), h("span", { class: "db-custom-select-list-item-label" }, this.label ? this.label : null, h("slot", null)))) : (h("span", null, this.groupTitle))));
|
|
114
114
|
}
|
|
115
115
|
static get is() { return "db-custom-select-list-item"; }
|
|
116
116
|
static get properties() {
|
|
@@ -8,8 +8,22 @@ import { h } from "@stencil/core";
|
|
|
8
8
|
export class DBDrawer {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.initialized = false;
|
|
11
|
+
this.backdropPointerDown = false;
|
|
11
12
|
this.observer = undefined;
|
|
12
13
|
}
|
|
14
|
+
isNotModal() {
|
|
15
|
+
return (this.position === "absolute" ||
|
|
16
|
+
this.backdrop === "none" ||
|
|
17
|
+
this.variant === "inside");
|
|
18
|
+
}
|
|
19
|
+
handleBackdropPointerDown(event) {
|
|
20
|
+
var _a;
|
|
21
|
+
// Remember whether the pointer interaction started on the backdrop
|
|
22
|
+
// (the DIALOG element itself) so we only close on a real backdrop
|
|
23
|
+
// click and not when a drag started inside the content and ended
|
|
24
|
+
// on the backdrop.
|
|
25
|
+
this.backdropPointerDown = ((_a = event === null || event === void 0 ? void 0 : event.target) === null || _a === void 0 ? void 0 : _a.nodeName) === "DIALOG";
|
|
26
|
+
}
|
|
13
27
|
handleClose(event, forceClose) {
|
|
14
28
|
var _a;
|
|
15
29
|
if (!event)
|
|
@@ -31,11 +45,15 @@ export class DBDrawer {
|
|
|
31
45
|
}
|
|
32
46
|
if (((_a = event.target) === null || _a === void 0 ? void 0 : _a.nodeName) === "DIALOG" &&
|
|
33
47
|
event.type === "click" &&
|
|
34
|
-
this.backdrop !== "none"
|
|
48
|
+
this.backdrop !== "none" &&
|
|
49
|
+
this.backdropPointerDown) {
|
|
35
50
|
if (this.close) {
|
|
36
51
|
this.close.emit(event);
|
|
37
52
|
}
|
|
38
53
|
}
|
|
54
|
+
// Reset after handling the click so the next interaction
|
|
55
|
+
// starts from a clean state.
|
|
56
|
+
this.backdropPointerDown = false;
|
|
39
57
|
}
|
|
40
58
|
}
|
|
41
59
|
handleDialogOpen() {
|
|
@@ -45,12 +63,15 @@ export class DBDrawer {
|
|
|
45
63
|
if (this.dialogContainerRef) {
|
|
46
64
|
this.dialogContainerRef.removeAttribute("data-transition");
|
|
47
65
|
}
|
|
48
|
-
if (this.
|
|
49
|
-
this.backdrop === "none" ||
|
|
50
|
-
this.variant === "inside") {
|
|
66
|
+
if (this.isNotModal()) {
|
|
51
67
|
this._ref.show();
|
|
52
68
|
}
|
|
53
69
|
else {
|
|
70
|
+
// Set the closedby attribute imperatively: the JSX
|
|
71
|
+
// dialog type does not know this attribute yet, and it
|
|
72
|
+
// only applies to modal dialogs. "any" enables native
|
|
73
|
+
// light dismiss (backdrop click / Esc).
|
|
74
|
+
this._ref.setAttribute("closedby", "any");
|
|
54
75
|
this._ref.showModal();
|
|
55
76
|
}
|
|
56
77
|
void delay(() => {
|
|
@@ -177,11 +198,11 @@ export class DBDrawer {
|
|
|
177
198
|
}
|
|
178
199
|
render() {
|
|
179
200
|
var _a, _b, _c;
|
|
180
|
-
return (h("dialog", { key: '
|
|
201
|
+
return (h("dialog", { key: 'c03126193778f601b7ff3aeeeff508c8920e67a7', class: "db-drawer", id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, ref: (el) => {
|
|
181
202
|
this._ref = el;
|
|
182
|
-
}, onClick: (event) => this.handleClose(event), onKeyDown: (event) => this.handleClose(event), "data-position": this.position, "data-backdrop": this.backdrop, "data-direction": this.direction, "data-variant": this.variant }, h("article", { key: '
|
|
203
|
+
}, onClick: (event) => this.handleClose(event), onMouseDown: (event) => this.handleBackdropPointerDown(event), onKeyDown: (event) => this.handleClose(event), "data-position": this.position, "data-backdrop": this.backdrop, "data-direction": this.direction, "data-variant": this.variant }, h("article", { key: '64661349d858bf5be872d664b44bc6fa829014e6', class: cls("db-drawer-container", this.className), ref: (el) => {
|
|
183
204
|
this.dialogContainerRef = el;
|
|
184
|
-
}, "data-spacing": this.spacing, "data-width": this.width, "data-direction": this.direction, "data-rounded": getBooleanAsString(this.rounded, "rounded") }, h("header", { key: '
|
|
205
|
+
}, "data-spacing": this.spacing, "data-width": this.width, "data-direction": this.direction, "data-rounded": getBooleanAsString(this.rounded, "rounded") }, h("header", { key: 'b758a538b1337573090305aadcf3bc3befef1bf3', class: "db-drawer-header" }, h("div", { key: '235f2be7afc9c968b9270178c2720a5a50436123', class: "db-drawer-header-text" }, h("slot", { key: '26787a5e103d2d34785ce1eccd0ff73b6733fce8', name: "drawerHeader" })), h("db-button", { key: '1d22b406c4e235e91bc9bfc3265a0aaa9c7f8e8c', class: "button-close-drawer", icon: "cross", variant: "ghost", id: this.closeButtonId, noText: true, onClick: (event) => this.handleClose(event, true) }, (_c = this.closeButtonText) !== null && _c !== void 0 ? _c : DEFAULT_CLOSE_BUTTON)), h("div", { key: '0e338b2e11c8582ba59595f34d8fc4911db7025e', class: "db-drawer-content" }, h("slot", { key: 'c761758ada4d1602878a58de6003e01cf5b5d075' })))));
|
|
185
206
|
}
|
|
186
207
|
static get is() { return "db-drawer"; }
|
|
187
208
|
static get properties() {
|
|
@@ -527,6 +548,7 @@ export class DBDrawer {
|
|
|
527
548
|
static get states() {
|
|
528
549
|
return {
|
|
529
550
|
"initialized": {},
|
|
551
|
+
"backdropPointerDown": {},
|
|
530
552
|
"observer": {}
|
|
531
553
|
};
|
|
532
554
|
}
|
|
@@ -62,24 +62,69 @@ export const handleDataOutside = (el) => {
|
|
|
62
62
|
export const handleFixedDropdown = (element, parent, placement) => {
|
|
63
63
|
if (!element || !parent)
|
|
64
64
|
return;
|
|
65
|
-
|
|
65
|
+
const fullWidth = element.dataset['width'] === 'full';
|
|
66
|
+
const autoWidth = element.dataset['width'] === 'auto';
|
|
67
|
+
// Reset width-specific inline styles first so a previous mode (e.g. "auto")
|
|
68
|
+
// doesn't leave a stale minInlineSize/inlineSize behind when the dropdown
|
|
69
|
+
// width changes at runtime. This must happen before getFloatingProps
|
|
70
|
+
// measures the element, otherwise the dropdown would be measured with a
|
|
71
|
+
// width it no longer has and positioned incorrectly. It also has to run
|
|
72
|
+
// before the mobile bailout below: otherwise a desktop minInlineSize would
|
|
73
|
+
// survive into the mobile sheet, where CSS min-inline-size beats the
|
|
74
|
+
// mobile max-inline-size guard and overflows the viewport.
|
|
75
|
+
element.style.inlineSize = '';
|
|
76
|
+
element.style.minInlineSize = '';
|
|
77
|
+
// We skip the rest if we are in mobile, it's already fixed via CSS.
|
|
66
78
|
if (getComputedStyle(element).zIndex === '9999')
|
|
67
79
|
return;
|
|
68
|
-
const { top, bottom, childHeight, childWidth, width, right, left, correctedPlacement } = getFloatingProps(element, parent, placement);
|
|
69
|
-
|
|
80
|
+
const { top, bottom, childHeight, childWidth, width, right, left, correctedPlacement, innerWidth } = getFloatingProps(element, parent, placement);
|
|
81
|
+
// For auto width the dropdown is forced to be at least as wide as the trigger,
|
|
82
|
+
// but clamped to its own max-inline-size: CSS lets a min-inline-size override
|
|
83
|
+
// the max when the minimum is larger, so a trigger wider than the viewport
|
|
84
|
+
// limit would otherwise drop the side margins or overflow horizontally.
|
|
85
|
+
let autoMinWidth = width;
|
|
86
|
+
if (autoWidth) {
|
|
87
|
+
const maxInlineSize = parseFloat(getComputedStyle(element).maxInlineSize);
|
|
88
|
+
if (!isNaN(maxInlineSize) && maxInlineSize > 0) {
|
|
89
|
+
autoMinWidth = Math.min(width, maxInlineSize);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
70
92
|
if (fullWidth) {
|
|
71
93
|
element.style.inlineSize = `${width}px`;
|
|
72
94
|
}
|
|
73
|
-
if (
|
|
95
|
+
else if (autoWidth) {
|
|
96
|
+
element.style.minInlineSize = `${autoMinWidth}px`;
|
|
97
|
+
}
|
|
98
|
+
// getFloatingProps measured childWidth before the inline styles were
|
|
99
|
+
// (re)applied, so use the width the dropdown will actually have:
|
|
100
|
+
// - auto: the clamped minimum, so end-aligned dropdowns don't extend past
|
|
101
|
+
// the trigger's right edge.
|
|
102
|
+
// - full: the trigger width (the reset above drops it to content width).
|
|
103
|
+
let effectiveChildWidth = childWidth;
|
|
104
|
+
if (autoWidth) {
|
|
105
|
+
effectiveChildWidth = Math.max(childWidth, autoMinWidth);
|
|
106
|
+
}
|
|
107
|
+
else if (fullWidth) {
|
|
108
|
+
effectiveChildWidth = width;
|
|
109
|
+
}
|
|
110
|
+
// getFloatingProps detects horizontal overflow assuming a centered element
|
|
111
|
+
// (it halves childWidth). The dropdown is actually start-aligned (inset =
|
|
112
|
+
// left), so for the wider auto dropdown re-check overflow against its full
|
|
113
|
+
// width and flip to end-alignment when it would extend past the viewport.
|
|
114
|
+
let dropdownPlacement = correctedPlacement;
|
|
115
|
+
if (autoWidth && (dropdownPlacement === 'top' || dropdownPlacement === 'bottom' || dropdownPlacement === 'top-start' || dropdownPlacement === 'bottom-start') && left + effectiveChildWidth > innerWidth) {
|
|
116
|
+
dropdownPlacement = dropdownPlacement.startsWith('top') ? 'top-end' : 'bottom-end';
|
|
117
|
+
}
|
|
118
|
+
if (dropdownPlacement === 'top' || dropdownPlacement === 'bottom' || dropdownPlacement === 'top-start' || dropdownPlacement === 'bottom-start') {
|
|
74
119
|
element.style.insetInlineStart = `${left}px`;
|
|
75
120
|
}
|
|
76
|
-
else if (
|
|
77
|
-
element.style.insetInlineStart = `${right -
|
|
121
|
+
else if (dropdownPlacement === 'top-end' || dropdownPlacement === 'bottom-end') {
|
|
122
|
+
element.style.insetInlineStart = `${Math.max(right - effectiveChildWidth, 0)}px`;
|
|
78
123
|
}
|
|
79
|
-
if (
|
|
124
|
+
if (dropdownPlacement === null || dropdownPlacement === void 0 ? void 0 : dropdownPlacement.startsWith('top')) {
|
|
80
125
|
element.style.insetBlockStart = `${top - childHeight}px`;
|
|
81
126
|
}
|
|
82
|
-
else if (
|
|
127
|
+
else if (dropdownPlacement === null || dropdownPlacement === void 0 ? void 0 : dropdownPlacement.startsWith('bottom')) {
|
|
83
128
|
element.style.insetBlockStart = `${bottom}px`;
|
|
84
129
|
}
|
|
85
130
|
element.style.position = 'fixed';
|
|
@@ -10817,11 +10817,35 @@
|
|
|
10817
10817
|
},
|
|
10818
10818
|
"default": "false"
|
|
10819
10819
|
},
|
|
10820
|
+
{
|
|
10821
|
+
"kind": "field",
|
|
10822
|
+
"name": "backdropPointerDown",
|
|
10823
|
+
"type": {
|
|
10824
|
+
"text": "boolean"
|
|
10825
|
+
},
|
|
10826
|
+
"default": "false"
|
|
10827
|
+
},
|
|
10820
10828
|
{
|
|
10821
10829
|
"kind": "field",
|
|
10822
10830
|
"name": "observer",
|
|
10823
10831
|
"default": "undefined"
|
|
10824
10832
|
},
|
|
10833
|
+
{
|
|
10834
|
+
"kind": "method",
|
|
10835
|
+
"name": "isNotModal"
|
|
10836
|
+
},
|
|
10837
|
+
{
|
|
10838
|
+
"kind": "method",
|
|
10839
|
+
"name": "handleBackdropPointerDown",
|
|
10840
|
+
"parameters": [
|
|
10841
|
+
{
|
|
10842
|
+
"name": "event",
|
|
10843
|
+
"type": {
|
|
10844
|
+
"text": "any"
|
|
10845
|
+
}
|
|
10846
|
+
}
|
|
10847
|
+
]
|
|
10848
|
+
},
|
|
10825
10849
|
{
|
|
10826
10850
|
"kind": "method",
|
|
10827
10851
|
"name": "handleClose",
|
|
@@ -26679,7 +26703,7 @@
|
|
|
26679
26703
|
"name": "CustomButtonCheckbox",
|
|
26680
26704
|
"declaration": {
|
|
26681
26705
|
"name": "CustomButtonCheckbox",
|
|
26682
|
-
"module": "src/components/custom-button/examples/checkbox.example.tsx"
|
|
26706
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/checkbox.example.tsx"
|
|
26683
26707
|
}
|
|
26684
26708
|
},
|
|
26685
26709
|
{
|
|
@@ -26687,7 +26711,7 @@
|
|
|
26687
26711
|
"name": "custom-button-checkbox",
|
|
26688
26712
|
"declaration": {
|
|
26689
26713
|
"name": "CustomButtonCheckbox",
|
|
26690
|
-
"module": "src/components/custom-button/examples/checkbox.example.tsx"
|
|
26714
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/checkbox.example.tsx"
|
|
26691
26715
|
}
|
|
26692
26716
|
}
|
|
26693
26717
|
]
|
|
@@ -26754,7 +26778,7 @@
|
|
|
26754
26778
|
"name": "CustomButtonDensity",
|
|
26755
26779
|
"declaration": {
|
|
26756
26780
|
"name": "CustomButtonDensity",
|
|
26757
|
-
"module": "src/components/custom-button/examples/density.example.tsx"
|
|
26781
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/density.example.tsx"
|
|
26758
26782
|
}
|
|
26759
26783
|
},
|
|
26760
26784
|
{
|
|
@@ -26762,7 +26786,7 @@
|
|
|
26762
26786
|
"name": "custom-button-density",
|
|
26763
26787
|
"declaration": {
|
|
26764
26788
|
"name": "CustomButtonDensity",
|
|
26765
|
-
"module": "src/components/custom-button/examples/density.example.tsx"
|
|
26789
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/density.example.tsx"
|
|
26766
26790
|
}
|
|
26767
26791
|
}
|
|
26768
26792
|
]
|
|
@@ -26829,7 +26853,7 @@
|
|
|
26829
26853
|
"name": "CustomButtonDisabled",
|
|
26830
26854
|
"declaration": {
|
|
26831
26855
|
"name": "CustomButtonDisabled",
|
|
26832
|
-
"module": "src/components/custom-button/examples/disabled.example.tsx"
|
|
26856
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/disabled.example.tsx"
|
|
26833
26857
|
}
|
|
26834
26858
|
},
|
|
26835
26859
|
{
|
|
@@ -26837,7 +26861,7 @@
|
|
|
26837
26861
|
"name": "custom-button-disabled",
|
|
26838
26862
|
"declaration": {
|
|
26839
26863
|
"name": "CustomButtonDisabled",
|
|
26840
|
-
"module": "src/components/custom-button/examples/disabled.example.tsx"
|
|
26864
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/disabled.example.tsx"
|
|
26841
26865
|
}
|
|
26842
26866
|
}
|
|
26843
26867
|
]
|
|
@@ -26904,7 +26928,7 @@
|
|
|
26904
26928
|
"name": "CustomButtonMultiLineText",
|
|
26905
26929
|
"declaration": {
|
|
26906
26930
|
"name": "CustomButtonMultiLineText",
|
|
26907
|
-
"module": "src/components/custom-button/examples/multi-line-text.example.tsx"
|
|
26931
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/multi-line-text.example.tsx"
|
|
26908
26932
|
}
|
|
26909
26933
|
},
|
|
26910
26934
|
{
|
|
@@ -26912,7 +26936,7 @@
|
|
|
26912
26936
|
"name": "custom-button-multi-line-text",
|
|
26913
26937
|
"declaration": {
|
|
26914
26938
|
"name": "CustomButtonMultiLineText",
|
|
26915
|
-
"module": "src/components/custom-button/examples/multi-line-text.example.tsx"
|
|
26939
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/multi-line-text.example.tsx"
|
|
26916
26940
|
}
|
|
26917
26941
|
}
|
|
26918
26942
|
]
|
|
@@ -26979,7 +27003,7 @@
|
|
|
26979
27003
|
"name": "CustomButtonNoText",
|
|
26980
27004
|
"declaration": {
|
|
26981
27005
|
"name": "CustomButtonNoText",
|
|
26982
|
-
"module": "src/components/custom-button/examples/no-text.example.tsx"
|
|
27006
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/no-text.example.tsx"
|
|
26983
27007
|
}
|
|
26984
27008
|
},
|
|
26985
27009
|
{
|
|
@@ -26987,7 +27011,7 @@
|
|
|
26987
27011
|
"name": "custom-button-no-text",
|
|
26988
27012
|
"declaration": {
|
|
26989
27013
|
"name": "CustomButtonNoText",
|
|
26990
|
-
"module": "src/components/custom-button/examples/no-text.example.tsx"
|
|
27014
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/no-text.example.tsx"
|
|
26991
27015
|
}
|
|
26992
27016
|
}
|
|
26993
27017
|
]
|
|
@@ -27054,7 +27078,7 @@
|
|
|
27054
27078
|
"name": "CustomButtonShowIconLeading",
|
|
27055
27079
|
"declaration": {
|
|
27056
27080
|
"name": "CustomButtonShowIconLeading",
|
|
27057
|
-
"module": "src/components/custom-button/examples/show-icon-leading.example.tsx"
|
|
27081
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/show-icon-leading.example.tsx"
|
|
27058
27082
|
}
|
|
27059
27083
|
},
|
|
27060
27084
|
{
|
|
@@ -27062,7 +27086,7 @@
|
|
|
27062
27086
|
"name": "custom-button-show-icon-leading",
|
|
27063
27087
|
"declaration": {
|
|
27064
27088
|
"name": "CustomButtonShowIconLeading",
|
|
27065
|
-
"module": "src/components/custom-button/examples/show-icon-leading.example.tsx"
|
|
27089
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/show-icon-leading.example.tsx"
|
|
27066
27090
|
}
|
|
27067
27091
|
}
|
|
27068
27092
|
]
|
|
@@ -27129,7 +27153,7 @@
|
|
|
27129
27153
|
"name": "CustomButtonShowIconTrailing",
|
|
27130
27154
|
"declaration": {
|
|
27131
27155
|
"name": "CustomButtonShowIconTrailing",
|
|
27132
|
-
"module": "src/components/custom-button/examples/show-icon-trailing.example.tsx"
|
|
27156
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/show-icon-trailing.example.tsx"
|
|
27133
27157
|
}
|
|
27134
27158
|
},
|
|
27135
27159
|
{
|
|
@@ -27137,7 +27161,7 @@
|
|
|
27137
27161
|
"name": "custom-button-show-icon-trailing",
|
|
27138
27162
|
"declaration": {
|
|
27139
27163
|
"name": "CustomButtonShowIconTrailing",
|
|
27140
|
-
"module": "src/components/custom-button/examples/show-icon-trailing.example.tsx"
|
|
27164
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/show-icon-trailing.example.tsx"
|
|
27141
27165
|
}
|
|
27142
27166
|
}
|
|
27143
27167
|
]
|
|
@@ -27204,7 +27228,7 @@
|
|
|
27204
27228
|
"name": "CustomButtonSize",
|
|
27205
27229
|
"declaration": {
|
|
27206
27230
|
"name": "CustomButtonSize",
|
|
27207
|
-
"module": "src/components/custom-button/examples/size.example.tsx"
|
|
27231
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/size.example.tsx"
|
|
27208
27232
|
}
|
|
27209
27233
|
},
|
|
27210
27234
|
{
|
|
@@ -27212,7 +27236,7 @@
|
|
|
27212
27236
|
"name": "custom-button-size",
|
|
27213
27237
|
"declaration": {
|
|
27214
27238
|
"name": "CustomButtonSize",
|
|
27215
|
-
"module": "src/components/custom-button/examples/size.example.tsx"
|
|
27239
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/size.example.tsx"
|
|
27216
27240
|
}
|
|
27217
27241
|
}
|
|
27218
27242
|
]
|
|
@@ -27279,7 +27303,7 @@
|
|
|
27279
27303
|
"name": "CustomButtonVariant",
|
|
27280
27304
|
"declaration": {
|
|
27281
27305
|
"name": "CustomButtonVariant",
|
|
27282
|
-
"module": "src/components/custom-button/examples/variant.example.tsx"
|
|
27306
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/variant.example.tsx"
|
|
27283
27307
|
}
|
|
27284
27308
|
},
|
|
27285
27309
|
{
|
|
@@ -27287,7 +27311,7 @@
|
|
|
27287
27311
|
"name": "custom-button-variant",
|
|
27288
27312
|
"declaration": {
|
|
27289
27313
|
"name": "CustomButtonVariant",
|
|
27290
|
-
"module": "src/components/custom-button/examples/variant.example.tsx"
|
|
27314
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/variant.example.tsx"
|
|
27291
27315
|
}
|
|
27292
27316
|
}
|
|
27293
27317
|
]
|
|
@@ -27354,7 +27378,7 @@
|
|
|
27354
27378
|
"name": "CustomButtonWidth",
|
|
27355
27379
|
"declaration": {
|
|
27356
27380
|
"name": "CustomButtonWidth",
|
|
27357
|
-
"module": "src/components/custom-button/examples/width.example.tsx"
|
|
27381
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/width.example.tsx"
|
|
27358
27382
|
}
|
|
27359
27383
|
},
|
|
27360
27384
|
{
|
|
@@ -27362,7 +27386,7 @@
|
|
|
27362
27386
|
"name": "custom-button-width",
|
|
27363
27387
|
"declaration": {
|
|
27364
27388
|
"name": "CustomButtonWidth",
|
|
27365
|
-
"module": "src/components/custom-button/examples/width.example.tsx"
|
|
27389
|
+
"module": "/home/runner/work/core-web/core-web/output/stencil/src/components/custom-button/examples/width.example.tsx"
|
|
27366
27390
|
}
|
|
27367
27391
|
}
|
|
27368
27392
|
]
|
|
@@ -27608,6 +27632,81 @@
|
|
|
27608
27632
|
}
|
|
27609
27633
|
]
|
|
27610
27634
|
},
|
|
27635
|
+
{
|
|
27636
|
+
"kind": "javascript-module",
|
|
27637
|
+
"path": "dropdown-width-auto.example.tsx",
|
|
27638
|
+
"declarations": [
|
|
27639
|
+
{
|
|
27640
|
+
"kind": "class",
|
|
27641
|
+
"description": "",
|
|
27642
|
+
"name": "CustomSelectDropdownWidthAuto",
|
|
27643
|
+
"members": [
|
|
27644
|
+
{
|
|
27645
|
+
"kind": "field",
|
|
27646
|
+
"name": "rootElement",
|
|
27647
|
+
"type": {
|
|
27648
|
+
"text": "HTMLElement"
|
|
27649
|
+
}
|
|
27650
|
+
},
|
|
27651
|
+
{
|
|
27652
|
+
"kind": "field",
|
|
27653
|
+
"name": "_ref",
|
|
27654
|
+
"type": {
|
|
27655
|
+
"text": "HTMLElement"
|
|
27656
|
+
},
|
|
27657
|
+
"privacy": "private"
|
|
27658
|
+
},
|
|
27659
|
+
{
|
|
27660
|
+
"kind": "method",
|
|
27661
|
+
"name": "enableAttributePassing",
|
|
27662
|
+
"privacy": "private",
|
|
27663
|
+
"parameters": [
|
|
27664
|
+
{
|
|
27665
|
+
"name": "element",
|
|
27666
|
+
"type": {
|
|
27667
|
+
"text": "HTMLElement | null"
|
|
27668
|
+
},
|
|
27669
|
+
"description": "the ref for the component"
|
|
27670
|
+
},
|
|
27671
|
+
{
|
|
27672
|
+
"name": "customElementSelector",
|
|
27673
|
+
"type": {
|
|
27674
|
+
"text": "string"
|
|
27675
|
+
},
|
|
27676
|
+
"description": "the custom element like `my-component`"
|
|
27677
|
+
}
|
|
27678
|
+
],
|
|
27679
|
+
"description": "Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil."
|
|
27680
|
+
},
|
|
27681
|
+
{
|
|
27682
|
+
"kind": "method",
|
|
27683
|
+
"name": "render"
|
|
27684
|
+
}
|
|
27685
|
+
],
|
|
27686
|
+
"tagName": "custom-select-dropdown-width-auto",
|
|
27687
|
+
"events": [],
|
|
27688
|
+
"customElement": true
|
|
27689
|
+
}
|
|
27690
|
+
],
|
|
27691
|
+
"exports": [
|
|
27692
|
+
{
|
|
27693
|
+
"kind": "js",
|
|
27694
|
+
"name": "CustomSelectDropdownWidthAuto",
|
|
27695
|
+
"declaration": {
|
|
27696
|
+
"name": "CustomSelectDropdownWidthAuto",
|
|
27697
|
+
"module": "src/components/custom-select/examples/dropdown-width-auto.example.tsx"
|
|
27698
|
+
}
|
|
27699
|
+
},
|
|
27700
|
+
{
|
|
27701
|
+
"kind": "custom-element-definition",
|
|
27702
|
+
"name": "custom-select-dropdown-width-auto",
|
|
27703
|
+
"declaration": {
|
|
27704
|
+
"name": "CustomSelectDropdownWidthAuto",
|
|
27705
|
+
"module": "src/components/custom-select/examples/dropdown-width-auto.example.tsx"
|
|
27706
|
+
}
|
|
27707
|
+
}
|
|
27708
|
+
]
|
|
27709
|
+
},
|
|
27611
27710
|
{
|
|
27612
27711
|
"kind": "javascript-module",
|
|
27613
27712
|
"path": "dropdown-width.example.tsx",
|