@db-ux/wc-core-components 4.4.2 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/cjs/db-accordion-item.cjs.entry.js +11 -6
- package/dist/cjs/db-accordion.cjs.entry.js +12 -8
- package/dist/cjs/db-badge.cjs.entry.js +11 -7
- package/dist/cjs/db-brand.cjs.entry.js +11 -7
- package/dist/cjs/db-button.cjs.entry.js +11 -7
- package/dist/cjs/db-card.cjs.entry.js +11 -6
- package/dist/cjs/db-checkbox.cjs.entry.js +59 -36
- package/dist/cjs/db-custom-button.cjs.entry.js +57 -0
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +89 -47
- package/dist/cjs/db-custom-select-form-field.cjs.entry.js +11 -6
- package/dist/cjs/db-custom-select.cjs.entry.js +133 -110
- package/dist/cjs/db-divider.cjs.entry.js +11 -6
- package/dist/cjs/db-drawer.cjs.entry.js +12 -8
- package/dist/cjs/db-header.cjs.entry.js +13 -9
- package/dist/cjs/db-icon.cjs.entry.js +11 -6
- package/dist/cjs/db-infotext.cjs.entry.js +11 -7
- package/dist/cjs/db-link.cjs.entry.js +11 -7
- package/dist/cjs/db-navigation-item.cjs.entry.js +13 -9
- package/dist/cjs/db-navigation.cjs.entry.js +11 -6
- package/dist/cjs/db-notification.cjs.entry.js +12 -8
- package/dist/cjs/db-page.cjs.entry.js +11 -6
- package/dist/cjs/db-popover.cjs.entry.js +14 -10
- package/dist/cjs/db-radio.cjs.entry.js +39 -16
- package/dist/cjs/db-section.cjs.entry.js +11 -6
- package/dist/cjs/db-select.cjs.entry.js +54 -31
- package/dist/cjs/db-stack.cjs.entry.js +11 -6
- package/dist/cjs/db-switch.cjs.entry.js +64 -24
- package/dist/cjs/db-tab-item_3.cjs.entry.js +29 -15
- package/dist/cjs/db-tabs.cjs.entry.js +12 -8
- package/dist/cjs/db-textarea.cjs.entry.js +52 -29
- package/dist/cjs/db-tooltip.cjs.entry.js +25 -12
- package/dist/cjs/db-ux.cjs.js +3 -3
- package/dist/cjs/{document-click-listener-Bb3Tinb8.js → document-click-listener-B2-xKJv3.js} +1 -1
- package/dist/cjs/{document-scroll-listener-unypEU42.js → document-scroll-listener-ChQ7XZRk.js} +1 -1
- package/dist/cjs/{floating-components-ogUqz72V.js → floating-components-pYaTeNhp.js} +65 -15
- package/dist/cjs/{form-components-LsqVohyb.js → form-components-_ncB_U2D.js} +1 -1
- package/dist/cjs/{index-CsHqnQII.js → index-2_9ESkQu.js} +6 -7
- package/dist/cjs/{index-CEqZnn9s.js → index-CSMPhlzz.js} +2 -2
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{navigation-DauGE-qj.js → navigation-BztJmEHf.js} +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/accordion/accordion.js +34 -6
- package/dist/collection/components/accordion-item/accordion-item.js +33 -4
- package/dist/collection/components/badge/badge.js +60 -6
- package/dist/collection/components/brand/brand.js +33 -5
- package/dist/collection/components/button/button.js +59 -5
- package/dist/collection/components/card/card.js +33 -4
- package/dist/collection/components/checkbox/checkbox.js +87 -40
- package/dist/collection/components/custom-button/custom-button.js +394 -0
- package/dist/collection/components/custom-button/index.js +2 -0
- package/dist/collection/components/custom-button/model.js +1 -0
- package/dist/collection/components/custom-select/custom-select.js +157 -110
- package/dist/collection/components/custom-select-dropdown/custom-select-dropdown.js +33 -4
- package/dist/collection/components/custom-select-form-field/custom-select-form-field.js +33 -4
- package/dist/collection/components/custom-select-list/custom-select-list.js +33 -4
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +33 -4
- package/dist/collection/components/divider/divider.js +33 -4
- package/dist/collection/components/drawer/drawer.js +34 -6
- package/dist/collection/components/header/header.js +33 -5
- package/dist/collection/components/icon/icon.js +33 -4
- package/dist/collection/components/infotext/infotext.js +59 -5
- package/dist/collection/components/input/input.js +80 -33
- package/dist/collection/components/link/link.js +33 -5
- package/dist/collection/components/navigation/navigation.js +33 -4
- package/dist/collection/components/navigation-item/navigation-item.js +33 -5
- package/dist/collection/components/notification/notification.js +34 -6
- package/dist/collection/components/page/page.js +33 -4
- package/dist/collection/components/popover/popover.js +34 -6
- package/dist/collection/components/radio/radio.js +60 -13
- package/dist/collection/components/section/section.js +33 -4
- package/dist/collection/components/select/select.js +81 -34
- package/dist/collection/components/stack/stack.js +33 -4
- package/dist/collection/components/switch/switch.js +118 -50
- package/dist/collection/components/tab-item/tab-item.js +33 -5
- package/dist/collection/components/tab-list/tab-list.js +33 -4
- package/dist/collection/components/tab-panel/tab-panel.js +33 -4
- package/dist/collection/components/tabs/tabs.js +34 -6
- package/dist/collection/components/tag/tag.js +33 -5
- package/dist/collection/components/textarea/textarea.js +79 -32
- package/dist/collection/components/tooltip/tooltip.js +71 -8
- package/dist/collection/index.js +2 -0
- package/dist/collection/utils/floating-components.js +65 -15
- package/dist/collection/utils/index.js +6 -7
- package/dist/custom-elements.json +19735 -1796
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/p-00df7d53.entry.js +1 -0
- package/dist/db-ux/p-064ddad6.entry.js +1 -0
- package/dist/db-ux/p-0ff173fb.entry.js +1 -0
- package/dist/db-ux/p-1519dbbb.entry.js +1 -0
- package/dist/db-ux/p-16281dcb.entry.js +1 -0
- package/dist/db-ux/p-27eb6e88.entry.js +1 -0
- package/dist/db-ux/p-2898ebe6.entry.js +1 -0
- package/dist/db-ux/p-2e940d2e.entry.js +1 -0
- package/dist/db-ux/p-309259be.entry.js +1 -0
- package/dist/db-ux/p-4183b8e1.entry.js +1 -0
- package/dist/db-ux/p-4284c37f.entry.js +1 -0
- package/dist/db-ux/p-432ceb90.entry.js +1 -0
- package/dist/db-ux/p-503d5103.entry.js +1 -0
- package/dist/db-ux/p-6794144b.entry.js +1 -0
- package/dist/db-ux/p-6cb4232d.entry.js +1 -0
- package/dist/db-ux/p-6da70f61.entry.js +1 -0
- package/dist/db-ux/p-766057ea.entry.js +1 -0
- package/dist/db-ux/p-7a146dee.entry.js +1 -0
- package/dist/db-ux/p-7e274359.entry.js +1 -0
- package/dist/db-ux/p-Bs7RfNRP.js +2 -0
- package/dist/db-ux/p-CHLgQ9vn.js +1 -0
- package/dist/db-ux/{p-CAEpg8tJ.js → p-D5mInaY7.js} +1 -1
- package/dist/db-ux/p-D_roHmuC.js +1 -0
- package/dist/db-ux/p-DfYL98sI.js +1 -0
- package/dist/db-ux/p-aad9c604.entry.js +1 -0
- package/dist/db-ux/p-ad3d2cff.entry.js +1 -0
- package/dist/db-ux/p-b218b08b.entry.js +1 -0
- package/dist/db-ux/p-bfe27311.entry.js +1 -0
- package/dist/db-ux/p-c1cf7ea4.entry.js +1 -0
- package/dist/db-ux/{p-sP2NlPcu.js → p-cNk4ImpW.js} +1 -1
- package/dist/db-ux/p-cd8557dd.entry.js +1 -0
- package/dist/db-ux/p-d2674cff.entry.js +1 -0
- package/dist/db-ux/p-d4e79c33.entry.js +1 -0
- package/dist/db-ux/p-e19f2640.entry.js +1 -0
- package/dist/db-ux/p-e3def528.entry.js +1 -0
- package/dist/db-ux/p-e6b17374.entry.js +1 -0
- package/dist/db-ux/p-ea7219af.entry.js +1 -0
- package/dist/db-ux/p-xkoBSP8R.js +1 -0
- package/dist/esm/db-accordion-item.entry.js +11 -6
- package/dist/esm/db-accordion.entry.js +12 -8
- package/dist/esm/db-badge.entry.js +11 -7
- package/dist/esm/db-brand.entry.js +11 -7
- package/dist/esm/db-button.entry.js +11 -7
- package/dist/esm/db-card.entry.js +11 -6
- package/dist/esm/db-checkbox.entry.js +60 -37
- package/dist/esm/db-custom-button.entry.js +55 -0
- package/dist/esm/db-custom-select-dropdown_5.entry.js +90 -48
- package/dist/esm/db-custom-select-form-field.entry.js +11 -6
- package/dist/esm/db-custom-select.entry.js +134 -111
- package/dist/esm/db-divider.entry.js +11 -6
- package/dist/esm/db-drawer.entry.js +12 -8
- package/dist/esm/db-header.entry.js +13 -9
- package/dist/esm/db-icon.entry.js +11 -6
- package/dist/esm/db-infotext.entry.js +11 -7
- package/dist/esm/db-link.entry.js +11 -7
- package/dist/esm/db-navigation-item.entry.js +13 -9
- package/dist/esm/db-navigation.entry.js +11 -6
- package/dist/esm/db-notification.entry.js +12 -8
- package/dist/esm/db-page.entry.js +11 -6
- package/dist/esm/db-popover.entry.js +14 -10
- package/dist/esm/db-radio.entry.js +39 -16
- package/dist/esm/db-section.entry.js +11 -6
- package/dist/esm/db-select.entry.js +55 -32
- package/dist/esm/db-stack.entry.js +11 -6
- package/dist/esm/db-switch.entry.js +64 -24
- package/dist/esm/db-tab-item_3.entry.js +29 -15
- package/dist/esm/db-tabs.entry.js +12 -8
- package/dist/esm/db-textarea.entry.js +53 -30
- package/dist/esm/db-tooltip.entry.js +25 -12
- package/dist/esm/db-ux.js +4 -4
- package/dist/esm/{document-click-listener-CmYoXpGE.js → document-click-listener-D7W_VE5O.js} +1 -1
- package/dist/esm/{document-scroll-listener-65bHuFAN.js → document-scroll-listener-DOBe3Oa9.js} +1 -1
- package/dist/esm/{floating-components-G-TursYV.js → floating-components-DfYL98sI.js} +65 -15
- package/dist/esm/{form-components-BLsiOrPI.js → form-components-D6LQfJvq.js} +1 -1
- package/dist/esm/{index-BrThqi62.js → index-Bs7RfNRP.js} +2 -2
- package/dist/esm/{index-C4x0SOcx.js → index-xkoBSP8R.js} +6 -7
- package/dist/esm/index.js +5 -5
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{navigation--UdC9CzO.js → navigation-DgsMCdfn.js} +1 -1
- package/dist/types/components/accordion/accordion.d.ts +1 -0
- package/dist/types/components/accordion-item/accordion-item.d.ts +1 -0
- package/dist/types/components/badge/badge.d.ts +2 -0
- package/dist/types/components/badge/model.d.ts +2 -2
- package/dist/types/components/brand/brand.d.ts +1 -0
- package/dist/types/components/button/button.d.ts +2 -0
- package/dist/types/components/button/model.d.ts +8 -10
- package/dist/types/components/card/card.d.ts +1 -0
- package/dist/types/components/checkbox/checkbox.d.ts +5 -1
- package/dist/types/components/custom-button/custom-button.d.ts +29 -0
- package/dist/types/components/custom-button/index.d.ts +2 -0
- package/dist/types/components/custom-button/model.d.ts +6 -0
- package/dist/types/components/custom-select/custom-select.d.ts +5 -1
- package/dist/types/components/custom-select-dropdown/custom-select-dropdown.d.ts +1 -0
- package/dist/types/components/custom-select-form-field/custom-select-form-field.d.ts +1 -0
- package/dist/types/components/custom-select-list/custom-select-list.d.ts +1 -0
- package/dist/types/components/custom-select-list-item/custom-select-list-item.d.ts +1 -0
- package/dist/types/components/divider/divider.d.ts +1 -0
- package/dist/types/components/drawer/drawer.d.ts +1 -0
- package/dist/types/components/header/header.d.ts +1 -0
- package/dist/types/components/icon/icon.d.ts +1 -0
- package/dist/types/components/infotext/infotext.d.ts +2 -0
- package/dist/types/components/infotext/model.d.ts +2 -2
- package/dist/types/components/input/input.d.ts +5 -1
- package/dist/types/components/link/link.d.ts +1 -0
- package/dist/types/components/navigation/navigation.d.ts +1 -0
- package/dist/types/components/navigation-item/navigation-item.d.ts +1 -0
- package/dist/types/components/notification/model.d.ts +2 -2
- package/dist/types/components/notification/notification.d.ts +1 -0
- package/dist/types/components/page/page.d.ts +1 -0
- package/dist/types/components/popover/popover.d.ts +1 -0
- package/dist/types/components/radio/radio.d.ts +4 -0
- package/dist/types/components/section/section.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +5 -1
- package/dist/types/components/stack/stack.d.ts +1 -0
- package/dist/types/components/switch/model.d.ts +1 -1
- package/dist/types/components/switch/switch.d.ts +7 -1
- package/dist/types/components/tab-item/tab-item.d.ts +1 -0
- package/dist/types/components/tab-list/tab-list.d.ts +1 -0
- package/dist/types/components/tab-panel/tab-panel.d.ts +1 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -0
- package/dist/types/components/tag/model.d.ts +2 -6
- package/dist/types/components/tag/tag.d.ts +1 -0
- package/dist/types/components/textarea/textarea.d.ts +5 -1
- package/dist/types/components/tooltip/model.d.ts +3 -3
- package/dist/types/components/tooltip/tooltip.d.ts +3 -0
- package/dist/types/components.d.ts +146 -6
- package/dist/types/index.d.ts +2 -0
- package/dist/types/shared/model.d.ts +17 -3
- package/dist/types/stencil-public-runtime.d.ts +3 -1
- package/dist/vscode.html-custom-data.json +1981 -245
- package/dist/web-types.json +3299 -648
- package/package.json +4 -4
- package/dist/db-ux/p-07bf3657.entry.js +0 -1
- package/dist/db-ux/p-0a89cbcd.entry.js +0 -1
- package/dist/db-ux/p-15539d9d.entry.js +0 -1
- package/dist/db-ux/p-41cb4673.entry.js +0 -1
- package/dist/db-ux/p-460073dd.entry.js +0 -1
- package/dist/db-ux/p-4a9b9909.entry.js +0 -1
- package/dist/db-ux/p-4ec09cf1.entry.js +0 -1
- package/dist/db-ux/p-57205dfd.entry.js +0 -1
- package/dist/db-ux/p-5775bf7a.entry.js +0 -1
- package/dist/db-ux/p-5bcde39a.entry.js +0 -1
- package/dist/db-ux/p-6341aaa9.entry.js +0 -1
- package/dist/db-ux/p-64573104.entry.js +0 -1
- package/dist/db-ux/p-6b63156d.entry.js +0 -1
- package/dist/db-ux/p-70822a27.entry.js +0 -1
- package/dist/db-ux/p-710a430d.entry.js +0 -1
- package/dist/db-ux/p-72d712b0.entry.js +0 -1
- package/dist/db-ux/p-7b7f4d03.entry.js +0 -1
- package/dist/db-ux/p-7bd4c573.entry.js +0 -1
- package/dist/db-ux/p-819cf20a.entry.js +0 -1
- package/dist/db-ux/p-87fdbcfb.entry.js +0 -1
- package/dist/db-ux/p-9051e26c.entry.js +0 -1
- package/dist/db-ux/p-934a708c.entry.js +0 -1
- package/dist/db-ux/p-9ffa5c48.entry.js +0 -1
- package/dist/db-ux/p-BhXdfCpU.js +0 -1
- package/dist/db-ux/p-BrThqi62.js +0 -2
- package/dist/db-ux/p-C4x0SOcx.js +0 -1
- package/dist/db-ux/p-G-TursYV.js +0 -1
- package/dist/db-ux/p-RHqkTr-_.js +0 -1
- package/dist/db-ux/p-a9af70eb.entry.js +0 -1
- package/dist/db-ux/p-aa8383a3.entry.js +0 -1
- package/dist/db-ux/p-ba1f69bd.entry.js +0 -1
- package/dist/db-ux/p-d273b998.entry.js +0 -1
- package/dist/db-ux/p-da4ee6ee.entry.js +0 -1
- package/dist/db-ux/p-e584e927.entry.js +0 -1
- package/dist/db-ux/p-fe185f98.entry.js +0 -1
|
@@ -74,6 +74,14 @@ export class DBTextarea {
|
|
|
74
74
|
this.focus.emit(event);
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
+
resetIds() {
|
|
78
|
+
var _a, _b, _c;
|
|
79
|
+
const mId = (_c = (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : `textarea-${uuid()}`;
|
|
80
|
+
this._id = mId;
|
|
81
|
+
this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;
|
|
82
|
+
this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;
|
|
83
|
+
this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;
|
|
84
|
+
}
|
|
77
85
|
/**
|
|
78
86
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
79
87
|
* @param element the ref for the component
|
|
@@ -85,12 +93,16 @@ export class DBTextarea {
|
|
|
85
93
|
const attributes = parent.attributes;
|
|
86
94
|
for (let i = 0; i < attributes.length; i++) {
|
|
87
95
|
const attr = attributes.item(i);
|
|
88
|
-
if (attr &&
|
|
96
|
+
if (attr && attr.name !== 'data-density' &&
|
|
89
97
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
90
98
|
element.setAttribute(attr.name, attr.value);
|
|
91
99
|
parent.removeAttribute(attr.name);
|
|
92
100
|
}
|
|
93
|
-
if (attr && attr.name
|
|
101
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
102
|
+
element.setAttribute(attr.name, attr.value);
|
|
103
|
+
parent.removeAttribute(attr.name);
|
|
104
|
+
}
|
|
105
|
+
else if (attr && attr.name === "class") {
|
|
94
106
|
const isWebComponent = attr.value.includes("hydrated");
|
|
95
107
|
const value = attr.value.replace("hydrated", "").trim();
|
|
96
108
|
const currentClass = element.getAttribute("class");
|
|
@@ -107,16 +119,25 @@ export class DBTextarea {
|
|
|
107
119
|
}
|
|
108
120
|
}
|
|
109
121
|
watch0Fn() {
|
|
122
|
+
var _a, _b;
|
|
123
|
+
if ((_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id) {
|
|
124
|
+
this.resetIds();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
watch0() {
|
|
128
|
+
this.watch0Fn();
|
|
129
|
+
}
|
|
130
|
+
watch1Fn() {
|
|
110
131
|
var _a;
|
|
111
132
|
this._invalidMessage =
|
|
112
133
|
this.invalidMessage ||
|
|
113
134
|
((_a = this._ref) === null || _a === void 0 ? void 0 : _a.validationMessage) ||
|
|
114
135
|
DEFAULT_INVALID_MESSAGE;
|
|
115
136
|
}
|
|
116
|
-
|
|
117
|
-
this.
|
|
137
|
+
watch1() {
|
|
138
|
+
this.watch1Fn();
|
|
118
139
|
}
|
|
119
|
-
|
|
140
|
+
watch2Fn() {
|
|
120
141
|
if (this._id) {
|
|
121
142
|
const messageId = this._id + DEFAULT_MESSAGE_ID_SUFFIX;
|
|
122
143
|
this._messageId = messageId;
|
|
@@ -128,18 +149,18 @@ export class DBTextarea {
|
|
|
128
149
|
this.handleValidation();
|
|
129
150
|
}
|
|
130
151
|
}
|
|
131
|
-
|
|
132
|
-
this.
|
|
152
|
+
watch2() {
|
|
153
|
+
this.watch2Fn();
|
|
133
154
|
}
|
|
134
|
-
|
|
155
|
+
watch3Fn() {
|
|
135
156
|
if (this.value !== undefined) {
|
|
136
157
|
this._value = this.value;
|
|
137
158
|
}
|
|
138
159
|
}
|
|
139
|
-
|
|
140
|
-
this.
|
|
160
|
+
watch3() {
|
|
161
|
+
this.watch3Fn();
|
|
141
162
|
}
|
|
142
|
-
|
|
163
|
+
watch4Fn() {
|
|
143
164
|
// If angular uses ngModel value and _value are null
|
|
144
165
|
// then the value will be set afterward and the _ref will be refreshed
|
|
145
166
|
const addResetListener = true;
|
|
@@ -159,22 +180,18 @@ export class DBTextarea {
|
|
|
159
180
|
}, controller.signal);
|
|
160
181
|
}
|
|
161
182
|
}
|
|
162
|
-
|
|
163
|
-
this.
|
|
183
|
+
watch4() {
|
|
184
|
+
this.watch4Fn();
|
|
164
185
|
}
|
|
165
186
|
componentDidLoad() {
|
|
166
|
-
var _a;
|
|
167
187
|
this.enableAttributePassing(this._ref, "db-textarea");
|
|
168
|
-
|
|
169
|
-
this._id = mId;
|
|
170
|
-
this._messageId = mId + DEFAULT_MESSAGE_ID_SUFFIX;
|
|
171
|
-
this._validMessageId = mId + DEFAULT_VALID_MESSAGE_ID_SUFFIX;
|
|
172
|
-
this._invalidMessageId = mId + DEFAULT_INVALID_MESSAGE_ID_SUFFIX;
|
|
188
|
+
this.resetIds();
|
|
173
189
|
this._invalidMessage = this.invalidMessage || DEFAULT_INVALID_MESSAGE;
|
|
174
190
|
this.watch0Fn();
|
|
175
191
|
this.watch1Fn();
|
|
176
192
|
this.watch2Fn();
|
|
177
193
|
this.watch3Fn();
|
|
194
|
+
this.watch4Fn();
|
|
178
195
|
}
|
|
179
196
|
disconnectedCallback() {
|
|
180
197
|
var _a;
|
|
@@ -182,19 +199,19 @@ export class DBTextarea {
|
|
|
182
199
|
}
|
|
183
200
|
render() {
|
|
184
201
|
var _a, _b, _c, _d, _e;
|
|
185
|
-
return (h("div", { key: '
|
|
202
|
+
return (h("div", { key: '393d0c53d9c4566418ac057d776c17b3f17c32aa', class: cls("db-textarea", this.className), "data-variant": this.variant, "data-hide-asterisk": getHideProp(this.showRequiredAsterisk), "data-hide-label": getHideProp(this.showLabel) }, h("label", { key: 'a899bcdffbffcdeef71bd1a62c4d0e3d5e4bbecc', htmlFor: this._id }, (_a = this.label) !== null && _a !== void 0 ? _a : DEFAULT_LABEL), h("textarea", { key: 'e21b1f05254885af4ff600ad4ffeb691040074d1', "aria-invalid": this.validation === "invalid", "data-custom-validity": this.validation, "data-field-sizing": this.fieldSizing, ref: (el) => {
|
|
186
203
|
this._ref = el;
|
|
187
204
|
}, id: this._id, "data-resize": this.resize, "data-hide-resizer": getHideProp((_b = this.showResizer) !== null && _b !== void 0 ? _b : true), disabled: getBoolean(this.disabled, "disabled"), required: getBoolean(this.required, "required"), readOnly: getBoolean(this.readOnly, "readOnly") ||
|
|
188
|
-
getBoolean(this.readonly, "readonly"), form: this.form, maxLength: getNumber(this.maxLength, this.maxlength), minLength: getNumber(this.minLength, this.minlength), name: this.name, wrap: this.wrap, spellcheck: this.spellCheck, autocomplete: this.autocomplete, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), value: (_c = this.value) !== null && _c !== void 0 ? _c : this._value, "aria-describedby": (_d = this.ariaDescribedBy) !== null && _d !== void 0 ? _d : this._descByIds, placeholder: (_e = this.placeholder) !== null && _e !== void 0 ? _e : DEFAULT_PLACEHOLDER, rows: getNumber(this.rows, DEFAULT_ROWS), cols: getNumber(this.cols) }), 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: '
|
|
205
|
+
getBoolean(this.readonly, "readonly"), form: this.form, maxLength: getNumber(this.maxLength, this.maxlength), minLength: getNumber(this.minLength, this.minlength), name: this.name, wrap: this.wrap, spellcheck: this.spellCheck, autocomplete: this.autocomplete, onInput: (event) => this.handleInput(event), onChange: (event) => this.handleChange(event), onBlur: (event) => this.handleBlur(event), onFocus: (event) => this.handleFocus(event), value: (_c = this.value) !== null && _c !== void 0 ? _c : this._value, "aria-describedby": (_d = this.ariaDescribedBy) !== null && _d !== void 0 ? _d : this._descByIds, placeholder: (_e = this.placeholder) !== null && _e !== void 0 ? _e : DEFAULT_PLACEHOLDER, rows: getNumber(this.rows, DEFAULT_ROWS), cols: getNumber(this.cols) }), 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: '9067bf72dc0406d8fa9365d57f6289aabdccc507', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), h("span", { key: '85655aea65cece93bbc6fbc5d50b8849548a4365', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
189
206
|
}
|
|
190
207
|
static get is() { return "db-textarea"; }
|
|
191
208
|
static get properties() {
|
|
192
209
|
return {
|
|
193
|
-
"
|
|
210
|
+
"invalidMessage": {
|
|
194
211
|
"type": "string",
|
|
195
212
|
"mutable": false,
|
|
196
213
|
"complexType": {
|
|
197
|
-
"original": "DBTextareaProps[\"
|
|
214
|
+
"original": "DBTextareaProps[\"invalidMessage\"]",
|
|
198
215
|
"resolved": "string",
|
|
199
216
|
"references": {
|
|
200
217
|
"DBTextareaProps": {
|
|
@@ -214,13 +231,13 @@ export class DBTextarea {
|
|
|
214
231
|
"getter": false,
|
|
215
232
|
"setter": false,
|
|
216
233
|
"reflect": false,
|
|
217
|
-
"attribute": "
|
|
234
|
+
"attribute": "invalid-message"
|
|
218
235
|
},
|
|
219
|
-
"
|
|
236
|
+
"id": {
|
|
220
237
|
"type": "string",
|
|
221
238
|
"mutable": false,
|
|
222
239
|
"complexType": {
|
|
223
|
-
"original": "DBTextareaProps[\"
|
|
240
|
+
"original": "DBTextareaProps[\"id\"]",
|
|
224
241
|
"resolved": "string",
|
|
225
242
|
"references": {
|
|
226
243
|
"DBTextareaProps": {
|
|
@@ -240,7 +257,31 @@ export class DBTextarea {
|
|
|
240
257
|
"getter": false,
|
|
241
258
|
"setter": false,
|
|
242
259
|
"reflect": false,
|
|
243
|
-
"attribute": "
|
|
260
|
+
"attribute": "id"
|
|
261
|
+
},
|
|
262
|
+
"propOverrides": {
|
|
263
|
+
"type": "unknown",
|
|
264
|
+
"mutable": false,
|
|
265
|
+
"complexType": {
|
|
266
|
+
"original": "DBTextareaProps[\"propOverrides\"]",
|
|
267
|
+
"resolved": "{ id?: string; }",
|
|
268
|
+
"references": {
|
|
269
|
+
"DBTextareaProps": {
|
|
270
|
+
"location": "import",
|
|
271
|
+
"path": "./model",
|
|
272
|
+
"id": "src/components/textarea/model.ts::DBTextareaProps",
|
|
273
|
+
"referenceLocation": "DBTextareaProps"
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"required": false,
|
|
278
|
+
"optional": false,
|
|
279
|
+
"docs": {
|
|
280
|
+
"tags": [],
|
|
281
|
+
"text": ""
|
|
282
|
+
},
|
|
283
|
+
"getter": false,
|
|
284
|
+
"setter": false
|
|
244
285
|
},
|
|
245
286
|
"message": {
|
|
246
287
|
"type": "string",
|
|
@@ -1128,20 +1169,26 @@ export class DBTextarea {
|
|
|
1128
1169
|
}
|
|
1129
1170
|
static get watchers() {
|
|
1130
1171
|
return [{
|
|
1131
|
-
"propName": "
|
|
1172
|
+
"propName": "id",
|
|
1132
1173
|
"methodName": "watch0"
|
|
1133
1174
|
}, {
|
|
1134
|
-
"propName": "
|
|
1175
|
+
"propName": "propOverrides?.id",
|
|
1135
1176
|
"methodName": "watch0"
|
|
1136
1177
|
}, {
|
|
1137
|
-
"propName": "
|
|
1178
|
+
"propName": "_ref",
|
|
1138
1179
|
"methodName": "watch1"
|
|
1139
1180
|
}, {
|
|
1140
|
-
"propName": "
|
|
1181
|
+
"propName": "invalidMessage",
|
|
1182
|
+
"methodName": "watch1"
|
|
1183
|
+
}, {
|
|
1184
|
+
"propName": "_id",
|
|
1141
1185
|
"methodName": "watch2"
|
|
1142
1186
|
}, {
|
|
1143
|
-
"propName": "
|
|
1187
|
+
"propName": "value",
|
|
1144
1188
|
"methodName": "watch3"
|
|
1189
|
+
}, {
|
|
1190
|
+
"propName": "_ref",
|
|
1191
|
+
"methodName": "watch4"
|
|
1145
1192
|
}];
|
|
1146
1193
|
}
|
|
1147
1194
|
}
|
|
@@ -37,7 +37,7 @@ export class DBTooltip {
|
|
|
37
37
|
return;
|
|
38
38
|
if (this._ref) {
|
|
39
39
|
// This is a workaround for angular
|
|
40
|
-
utilsDelay(() => {
|
|
40
|
+
void utilsDelay(() => {
|
|
41
41
|
var _a;
|
|
42
42
|
// Due to race conditions we need to check for _ref again
|
|
43
43
|
if (this._ref) {
|
|
@@ -66,6 +66,10 @@ export class DBTooltip {
|
|
|
66
66
|
this.handleAutoPlacement(parent);
|
|
67
67
|
(_a = this._observer) === null || _a === void 0 ? void 0 : _a.observe(this.getParent());
|
|
68
68
|
}
|
|
69
|
+
resetIds() {
|
|
70
|
+
var _a, _b, _c;
|
|
71
|
+
this._id = (_c = (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : "tooltip-" + uuid();
|
|
72
|
+
}
|
|
69
73
|
/**
|
|
70
74
|
* Passes `aria-*`, `data-*` & `class` attributes to correct child. Used in angular and stencil.
|
|
71
75
|
* @param element the ref for the component
|
|
@@ -77,12 +81,16 @@ export class DBTooltip {
|
|
|
77
81
|
const attributes = parent.attributes;
|
|
78
82
|
for (let i = 0; i < attributes.length; i++) {
|
|
79
83
|
const attr = attributes.item(i);
|
|
80
|
-
if (attr &&
|
|
84
|
+
if (attr && attr.name !== 'data-density' &&
|
|
81
85
|
(attr.name.startsWith("data-") || attr.name.startsWith("aria-"))) {
|
|
82
86
|
element.setAttribute(attr.name, attr.value);
|
|
83
87
|
parent.removeAttribute(attr.name);
|
|
84
88
|
}
|
|
85
|
-
if (attr && attr.name
|
|
89
|
+
else if (attr && attr.name !== 'data-density' && attr.name !== "class" && attr.name === "style") {
|
|
90
|
+
element.setAttribute(attr.name, attr.value);
|
|
91
|
+
parent.removeAttribute(attr.name);
|
|
92
|
+
}
|
|
93
|
+
else if (attr && attr.name === "class") {
|
|
86
94
|
const isWebComponent = attr.value.includes("hydrated");
|
|
87
95
|
const value = attr.value.replace("hydrated", "").trim();
|
|
88
96
|
const currentClass = element.getAttribute("class");
|
|
@@ -99,8 +107,9 @@ export class DBTooltip {
|
|
|
99
107
|
}
|
|
100
108
|
}
|
|
101
109
|
watch0Fn() {
|
|
102
|
-
|
|
103
|
-
|
|
110
|
+
var _a, _b;
|
|
111
|
+
if ((_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id) {
|
|
112
|
+
this.resetIds();
|
|
104
113
|
}
|
|
105
114
|
}
|
|
106
115
|
watch0() {
|
|
@@ -110,6 +119,7 @@ export class DBTooltip {
|
|
|
110
119
|
if (this._ref && this.initialized && this._id) {
|
|
111
120
|
const parent = this.getParent();
|
|
112
121
|
if (parent) {
|
|
122
|
+
this.handleAutoPlacement(parent);
|
|
113
123
|
["mouseenter", "focusin"].forEach((event) => {
|
|
114
124
|
parent.addEventListener(event, () => this.handleEnter(parent));
|
|
115
125
|
});
|
|
@@ -141,16 +151,16 @@ export class DBTooltip {
|
|
|
141
151
|
}
|
|
142
152
|
componentDidLoad() {
|
|
143
153
|
this.enableAttributePassing(this._ref, "db-tooltip");
|
|
144
|
-
this.
|
|
154
|
+
this.resetIds();
|
|
145
155
|
this.initialized = true;
|
|
146
156
|
this.watch0Fn();
|
|
147
157
|
this.watch1Fn();
|
|
148
158
|
}
|
|
149
159
|
render() {
|
|
150
160
|
var _a, _b;
|
|
151
|
-
return (h("i", { key: '
|
|
161
|
+
return (h("i", { key: '3340b8840c8d749852c69311cf4a28d5bc4c9252', class: cls("db-tooltip", this.className), role: "tooltip", "aria-hidden": "true", "data-gap": "true", ref: (el) => {
|
|
152
162
|
this._ref = el;
|
|
153
|
-
}, id: this._id, "data-emphasis": this.emphasis, "data-animation": getBooleanAsString((_a = this.animation) !== null && _a !== void 0 ? _a : true), "data-delay": this.delay, "data-width": this.width, "data-show-arrow": getBooleanAsString((_b = this.showArrow) !== null && _b !== void 0 ? _b : true), "data-placement": this.placement, onClick: (event) => this.handleClick(event) }, h("slot", { key: '
|
|
163
|
+
}, id: this._id, "data-emphasis": this.emphasis, "data-wrap": getBooleanAsString(this.wrap), "data-animation": getBooleanAsString((_a = this.animation) !== null && _a !== void 0 ? _a : true), "data-delay": this.delay, "data-width": this.width, "data-show-arrow": getBooleanAsString((_b = this.showArrow) !== null && _b !== void 0 ? _b : true), "data-placement": this.placement, onClick: (event) => this.handleClick(event) }, h("slot", { key: 'b20207e24fe5999249505cb8a5543ae853425ae2' })));
|
|
154
164
|
}
|
|
155
165
|
static get is() { return "db-tooltip"; }
|
|
156
166
|
static get properties() {
|
|
@@ -181,6 +191,30 @@ export class DBTooltip {
|
|
|
181
191
|
"reflect": false,
|
|
182
192
|
"attribute": "id"
|
|
183
193
|
},
|
|
194
|
+
"propOverrides": {
|
|
195
|
+
"type": "unknown",
|
|
196
|
+
"mutable": false,
|
|
197
|
+
"complexType": {
|
|
198
|
+
"original": "DBTooltipProps[\"propOverrides\"]",
|
|
199
|
+
"resolved": "{ id?: string; }",
|
|
200
|
+
"references": {
|
|
201
|
+
"DBTooltipProps": {
|
|
202
|
+
"location": "import",
|
|
203
|
+
"path": "./model",
|
|
204
|
+
"id": "src/components/tooltip/model.ts::DBTooltipProps",
|
|
205
|
+
"referenceLocation": "DBTooltipProps"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"required": false,
|
|
210
|
+
"optional": false,
|
|
211
|
+
"docs": {
|
|
212
|
+
"tags": [],
|
|
213
|
+
"text": ""
|
|
214
|
+
},
|
|
215
|
+
"getter": false,
|
|
216
|
+
"setter": false
|
|
217
|
+
},
|
|
184
218
|
"variant": {
|
|
185
219
|
"type": "string",
|
|
186
220
|
"mutable": false,
|
|
@@ -285,6 +319,32 @@ export class DBTooltip {
|
|
|
285
319
|
"reflect": false,
|
|
286
320
|
"attribute": "emphasis"
|
|
287
321
|
},
|
|
322
|
+
"wrap": {
|
|
323
|
+
"type": "any",
|
|
324
|
+
"mutable": false,
|
|
325
|
+
"complexType": {
|
|
326
|
+
"original": "DBTooltipProps[\"wrap\"]",
|
|
327
|
+
"resolved": "boolean | string",
|
|
328
|
+
"references": {
|
|
329
|
+
"DBTooltipProps": {
|
|
330
|
+
"location": "import",
|
|
331
|
+
"path": "./model",
|
|
332
|
+
"id": "src/components/tooltip/model.ts::DBTooltipProps",
|
|
333
|
+
"referenceLocation": "DBTooltipProps"
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"required": false,
|
|
338
|
+
"optional": false,
|
|
339
|
+
"docs": {
|
|
340
|
+
"tags": [],
|
|
341
|
+
"text": ""
|
|
342
|
+
},
|
|
343
|
+
"getter": false,
|
|
344
|
+
"setter": false,
|
|
345
|
+
"reflect": false,
|
|
346
|
+
"attribute": "wrap"
|
|
347
|
+
},
|
|
288
348
|
"animation": {
|
|
289
349
|
"type": "any",
|
|
290
350
|
"mutable": false,
|
|
@@ -403,6 +463,9 @@ export class DBTooltip {
|
|
|
403
463
|
return [{
|
|
404
464
|
"propName": "id",
|
|
405
465
|
"methodName": "watch0"
|
|
466
|
+
}, {
|
|
467
|
+
"propName": "propOverrides?.id",
|
|
468
|
+
"methodName": "watch0"
|
|
406
469
|
}, {
|
|
407
470
|
"propName": "_ref",
|
|
408
471
|
"methodName": "watch1"
|
package/dist/collection/index.js
CHANGED
|
@@ -12,6 +12,8 @@ export * from './components/card';
|
|
|
12
12
|
export * from './components/card/model';
|
|
13
13
|
export * from './components/checkbox';
|
|
14
14
|
export * from './components/checkbox/model';
|
|
15
|
+
export * from './components/custom-button';
|
|
16
|
+
export * from './components/custom-button/model';
|
|
15
17
|
export * from './components/custom-select';
|
|
16
18
|
export * from './components/custom-select-dropdown';
|
|
17
19
|
export * from './components/custom-select-dropdown/model';
|
|
@@ -228,10 +228,54 @@ export const getFloatingProps = (element, parent, placement) => {
|
|
|
228
228
|
innerHeight
|
|
229
229
|
};
|
|
230
230
|
};
|
|
231
|
+
const MAX_ANCESTOR_DEPTH = 10;
|
|
232
|
+
const ancestorCache = new WeakMap();
|
|
233
|
+
const getAncestorHasCorrectedPlacement = (element) => {
|
|
234
|
+
if (ancestorCache.has(element)) {
|
|
235
|
+
return ancestorCache.get(element);
|
|
236
|
+
}
|
|
237
|
+
let current = element.parentElement;
|
|
238
|
+
let anchor = 0;
|
|
239
|
+
while (current && anchor < MAX_ANCESTOR_DEPTH) {
|
|
240
|
+
if (current.dataset['correctedPlacement']) {
|
|
241
|
+
ancestorCache.set(element, current);
|
|
242
|
+
return current;
|
|
243
|
+
}
|
|
244
|
+
current = current.parentElement;
|
|
245
|
+
anchor += 1;
|
|
246
|
+
}
|
|
247
|
+
ancestorCache.set(element, null);
|
|
248
|
+
return null;
|
|
249
|
+
};
|
|
231
250
|
export const handleFixedPopover = (element, parent, placement) => {
|
|
232
|
-
var _a;
|
|
233
|
-
const
|
|
234
|
-
const
|
|
251
|
+
var _a, _b;
|
|
252
|
+
const parentComputedStyles = getComputedStyle(parent);
|
|
253
|
+
const parentHasFloatingPosition = ['absolute', 'fixed'].includes(parentComputedStyles.position);
|
|
254
|
+
const ancestorWithCorrectedPlacement = getAncestorHasCorrectedPlacement(element);
|
|
255
|
+
const noFloatingAncestor = !ancestorWithCorrectedPlacement && !parentHasFloatingPosition;
|
|
256
|
+
const distance = (_b = (_a = getComputedStyle(element)) === null || _a === void 0 ? void 0 : _a.getPropertyValue('--db-popover-distance')) !== null && _b !== void 0 ? _b : '0px';
|
|
257
|
+
let { top, height, width, childHeight, childWidth, right, left, bottom, correctedPlacement, innerWidth, innerHeight } = getFloatingProps(element, parent, placement);
|
|
258
|
+
if (ancestorWithCorrectedPlacement) {
|
|
259
|
+
const ancestorRect = ancestorWithCorrectedPlacement.getBoundingClientRect();
|
|
260
|
+
left = Math.abs(left - ancestorRect.left);
|
|
261
|
+
right = (width + Math.abs(right - ancestorRect.right)) * 1.5; // We add a transform -50% later
|
|
262
|
+
top = Math.abs(top - ancestorRect.top);
|
|
263
|
+
bottom = (height + Math.abs(bottom - ancestorRect.bottom)) * 1.5; // We add a transform -50% later
|
|
264
|
+
}
|
|
265
|
+
if (parentHasFloatingPosition) {
|
|
266
|
+
/*
|
|
267
|
+
* If we have a floating element inside an element with position:absolute/fixed
|
|
268
|
+
* we need to calculate with relative values
|
|
269
|
+
* */
|
|
270
|
+
left = 0;
|
|
271
|
+
right = width;
|
|
272
|
+
top = 0;
|
|
273
|
+
bottom = height;
|
|
274
|
+
if (['auto', 'inherit', '0'].includes(parentComputedStyles.zIndex)) {
|
|
275
|
+
// We need the default zIndex for floating elements on the parent
|
|
276
|
+
parent.style.zIndex = '1';
|
|
277
|
+
}
|
|
278
|
+
}
|
|
235
279
|
// Tooltip arrow position
|
|
236
280
|
if (childWidth > width && (correctedPlacement.startsWith('bottom') || correctedPlacement.startsWith('top'))) {
|
|
237
281
|
const diff = width / 2 / childWidth * 100;
|
|
@@ -241,6 +285,9 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
241
285
|
else if (correctedPlacement.endsWith('end')) {
|
|
242
286
|
element.style.setProperty('--db-tooltip-arrow-inline-start', `${100 - diff}%`);
|
|
243
287
|
}
|
|
288
|
+
else {
|
|
289
|
+
element.style.setProperty('--db-tooltip-arrow-inline-start', `50%`);
|
|
290
|
+
}
|
|
244
291
|
}
|
|
245
292
|
if (childHeight > height && (correctedPlacement.startsWith('left') || correctedPlacement.startsWith('bottom'))) {
|
|
246
293
|
const diff = height / 2 / childHeight * 100;
|
|
@@ -250,6 +297,9 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
250
297
|
else if (correctedPlacement.endsWith('end')) {
|
|
251
298
|
element.style.setProperty('--db-tooltip-arrow-block-start', `${100 - diff}%`);
|
|
252
299
|
}
|
|
300
|
+
else {
|
|
301
|
+
element.style.setProperty('--db-tooltip-arrow-block-start', `50%`);
|
|
302
|
+
}
|
|
253
303
|
}
|
|
254
304
|
// Popover position
|
|
255
305
|
if (correctedPlacement === 'right' || correctedPlacement === 'left') {
|
|
@@ -259,11 +309,11 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
259
309
|
else if (correctedPlacement === 'right-start' || correctedPlacement === 'left-start') {
|
|
260
310
|
const end = top + childHeight;
|
|
261
311
|
element.style.insetBlockStart = `${top}px`;
|
|
262
|
-
element.style.insetBlockEnd = `${end > innerHeight ? innerHeight : end}px`;
|
|
312
|
+
element.style.insetBlockEnd = `${!parentHasFloatingPosition && end > innerHeight ? innerHeight : end}px`;
|
|
263
313
|
}
|
|
264
314
|
else if (correctedPlacement === 'right-end' || correctedPlacement === 'left-end') {
|
|
265
315
|
const start = bottom - childHeight;
|
|
266
|
-
element.style.insetBlockStart = `${start < 0 ? 0 : start}px`;
|
|
316
|
+
element.style.insetBlockStart = `${!parentHasFloatingPosition && start < 0 ? 0 : start}px`;
|
|
267
317
|
element.style.insetBlockEnd = `${bottom}px`;
|
|
268
318
|
}
|
|
269
319
|
else if (correctedPlacement === 'top' || correctedPlacement === 'bottom') {
|
|
@@ -273,32 +323,32 @@ export const handleFixedPopover = (element, parent, placement) => {
|
|
|
273
323
|
else if (correctedPlacement === 'top-start' || correctedPlacement === 'bottom-start') {
|
|
274
324
|
const end = left + childWidth;
|
|
275
325
|
element.style.insetInlineStart = `${left}px`;
|
|
276
|
-
element.style.insetInlineEnd = `${end > innerWidth ? innerWidth : end}px`;
|
|
326
|
+
element.style.insetInlineEnd = `${!parentHasFloatingPosition && end > innerWidth ? innerWidth : end}px`;
|
|
277
327
|
}
|
|
278
328
|
else if (correctedPlacement === 'top-end' || correctedPlacement === 'bottom-end') {
|
|
279
|
-
const start =
|
|
280
|
-
element.style.insetInlineStart = `${
|
|
281
|
-
element.style.insetInlineEnd = `${
|
|
329
|
+
const start = right - childWidth;
|
|
330
|
+
element.style.insetInlineStart = `${!parentHasFloatingPosition && start < 0 ? 0 : start}px`;
|
|
331
|
+
element.style.insetInlineEnd = `${right}px`;
|
|
282
332
|
}
|
|
283
333
|
if (correctedPlacement === null || correctedPlacement === void 0 ? void 0 : correctedPlacement.startsWith('right')) {
|
|
284
334
|
const end = right + childWidth;
|
|
285
335
|
element.style.insetInlineStart = `calc(${right}px + ${distance})`;
|
|
286
|
-
element.style.insetInlineEnd = `calc(${end > innerWidth ? innerWidth : end}px + ${distance})`;
|
|
336
|
+
element.style.insetInlineEnd = `calc(${noFloatingAncestor && end > innerWidth ? innerWidth : end}px + ${distance})`;
|
|
287
337
|
}
|
|
288
338
|
else if (correctedPlacement === null || correctedPlacement === void 0 ? void 0 : correctedPlacement.startsWith('left')) {
|
|
289
339
|
const start = left - childWidth;
|
|
290
|
-
element.style.insetInlineStart = `calc(${start < 0 ? 0 : start}px - ${distance})`;
|
|
340
|
+
element.style.insetInlineStart = `calc(${noFloatingAncestor && start < 0 ? 0 : start}px - ${distance})`;
|
|
291
341
|
element.style.insetInlineEnd = `calc(${right}px - ${distance})`;
|
|
292
342
|
}
|
|
293
343
|
else if (correctedPlacement === null || correctedPlacement === void 0 ? void 0 : correctedPlacement.startsWith('top')) {
|
|
294
344
|
const start = top - childHeight;
|
|
295
|
-
element.style.insetBlockStart = `calc(${start < 0 ? 0 : start}px - ${distance})`;
|
|
296
|
-
element.style.insetBlockEnd = `calc(${bottom}px - ${distance})`;
|
|
345
|
+
element.style.insetBlockStart = `calc(${noFloatingAncestor && start < 0 ? 0 : start}px - ${distance})`;
|
|
346
|
+
element.style.insetBlockEnd = `calc(${parentHasFloatingPosition ? start : bottom}px - ${distance})`;
|
|
297
347
|
}
|
|
298
348
|
else if (correctedPlacement === null || correctedPlacement === void 0 ? void 0 : correctedPlacement.startsWith('bottom')) {
|
|
299
349
|
const end = bottom + childHeight;
|
|
300
|
-
element.style.insetBlockStart = `calc(${bottom}px + ${distance})`;
|
|
301
|
-
element.style.insetBlockEnd = `calc(${end > innerHeight ? innerHeight : end}px + ${distance})`;
|
|
350
|
+
element.style.insetBlockStart = `calc(${parentHasFloatingPosition ? end : bottom}px + ${distance})`;
|
|
351
|
+
element.style.insetBlockEnd = `calc(${noFloatingAncestor && end > innerHeight ? innerHeight : end}px + ${distance})`;
|
|
302
352
|
}
|
|
303
353
|
element.style.position = 'fixed';
|
|
304
354
|
element.dataset['correctedPlacement'] = correctedPlacement;
|
|
@@ -70,15 +70,15 @@ export const getBooleanAsString = (originBool) => {
|
|
|
70
70
|
if (originBool === undefined || originBool === null)
|
|
71
71
|
return;
|
|
72
72
|
if (typeof originBool === 'string') {
|
|
73
|
-
return String(
|
|
73
|
+
return String(originBool === 'true');
|
|
74
74
|
}
|
|
75
75
|
return String(originBool);
|
|
76
76
|
};
|
|
77
77
|
export const getBoolean = (originBool, propertyName) => {
|
|
78
78
|
if (originBool === undefined || originBool === null)
|
|
79
79
|
return;
|
|
80
|
-
if (typeof originBool === 'string'
|
|
81
|
-
return Boolean(propertyName === originBool || originBool);
|
|
80
|
+
if (typeof originBool === 'string') {
|
|
81
|
+
return Boolean(propertyName === originBool || originBool === 'true');
|
|
82
82
|
}
|
|
83
83
|
return Boolean(originBool);
|
|
84
84
|
};
|
|
@@ -119,20 +119,19 @@ export const getStep = (step) => {
|
|
|
119
119
|
export const getInputValue = (value, inputType) => {
|
|
120
120
|
return inputType && ['number', 'range'].includes(inputType) ? getNumber(value) : value;
|
|
121
121
|
};
|
|
122
|
+
const toBool = (value) => typeof value === 'string' ? value === 'true' : value;
|
|
122
123
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
123
124
|
export const getHideProp = (show) => {
|
|
124
125
|
if (show === undefined || show === null) {
|
|
125
126
|
return undefined;
|
|
126
127
|
}
|
|
127
|
-
return getBooleanAsString(!
|
|
128
|
+
return getBooleanAsString(!toBool(show));
|
|
128
129
|
};
|
|
129
130
|
export const stringPropVisible = (givenString, showString) => {
|
|
130
131
|
if (showString === undefined) {
|
|
131
132
|
return !!givenString;
|
|
132
133
|
}
|
|
133
|
-
|
|
134
|
-
return Boolean(showString) && Boolean(givenString);
|
|
135
|
-
}
|
|
134
|
+
return toBool(showString) && Boolean(givenString);
|
|
136
135
|
};
|
|
137
136
|
export const getSearchInput = (element) => element.querySelector(`input[type="search"]`);
|
|
138
137
|
export const getOptionKey = (option, prefix) => {
|