@rededor/cura 1.3.0 → 1.4.0-alpha.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/dist/cjs/cura-accordion_12.cjs.entry.js +9 -9
- package/dist/cjs/cura-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/cura-display.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option-title.cjs.entry.js +1 -1
- package/dist/cjs/cura-dropdown-search-option.cjs.entry.js +2 -2
- package/dist/cjs/cura-dropdown-search.cjs.entry.js +24 -15
- package/dist/cjs/cura-dropdown-search.cjs.entry.js.map +1 -1
- package/dist/cjs/cura-input-date.cjs.entry.js +1 -1
- package/dist/cjs/cura-loader-bar.cjs.entry.js +1 -1
- package/dist/cjs/cura-modal.cjs.entry.js +50 -0
- package/dist/cjs/cura-modal.cjs.entry.js.map +1 -0
- package/dist/cjs/cura-radio.cjs.entry.js +1 -1
- package/dist/cjs/cura-switch.cjs.entry.js +1 -1
- package/dist/cjs/cura-toast.cjs.entry.js +1 -1
- package/dist/cjs/cura-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/cura-modal/cura-modal.css +211 -0
- package/dist/collection/components/cura-modal/cura-modal.js +134 -0
- package/dist/collection/components/cura-modal/cura-modal.js.map +1 -0
- package/dist/collection/components/cura-modal/cura-modal.stories.js +85 -0
- package/dist/collection/components/cura-modal/cura-modal.stories.js.map +1 -0
- package/dist/collection/components/cura-page-template/cura-page-template.js +1 -1
- package/dist/collection/components/cura-toast/cura-toast.js +1 -1
- package/dist/collection/components/cura-tooltip/cura-tooltip.js +1 -1
- package/dist/collection/components/forms/cura-checkbox/cura-checkbox.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option/cura-dropdown-search-option.js +2 -2
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search-option-title/cura-dropdown-search-option-title.js +1 -1
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js +26 -16
- package/dist/collection/components/forms/cura-dropdown-search/cura-dropdown-search.js.map +1 -1
- package/dist/collection/components/forms/cura-input-date/cura-input-date.js +1 -1
- package/dist/collection/components/forms/cura-label/cura-label.js +1 -1
- package/dist/collection/components/forms/cura-radio/cura-radio.js +1 -1
- package/dist/collection/components/forms/cura-select/cura-select.js +3 -3
- package/dist/collection/components/forms/cura-select-options/cura-select-option.js +1 -1
- package/dist/collection/components/forms/cura-switch/cura-switch.js +1 -1
- package/dist/collection/components/loaders/cura-loader-bar/cura-loader-bar.js +1 -1
- package/dist/collection/components/loaders/cura-loader-circle/cura-loader-circle.js +1 -1
- package/dist/collection/components/text/cura-display/cura-display.js +1 -1
- package/dist/collection/components/text/cura-heading/cura-heading.js +1 -1
- package/dist/collection/components/text/cura-paragraph/cura-paragraph.js +1 -1
- package/dist/components/cura-checkbox.js +1 -1
- package/dist/components/cura-display.js +1 -1
- package/dist/components/cura-dropdown-search-option-title.js +1 -1
- package/dist/components/cura-dropdown-search-option.js +2 -2
- package/dist/components/cura-dropdown-search.js +26 -16
- package/dist/components/cura-dropdown-search.js.map +1 -1
- package/dist/components/cura-heading2.js +1 -1
- package/dist/components/cura-input-date.js +1 -1
- package/dist/components/cura-label2.js +1 -1
- package/dist/components/cura-loader-bar2.js +1 -1
- package/dist/components/cura-loader-circle2.js +1 -1
- package/dist/components/cura-modal.d.ts +11 -0
- package/dist/components/cura-modal.js +84 -0
- package/dist/components/cura-modal.js.map +1 -0
- package/dist/components/cura-page-template.js +1 -1
- package/dist/components/cura-paragraph2.js +1 -1
- package/dist/components/cura-radio.js +1 -1
- package/dist/components/cura-select-option2.js +1 -1
- package/dist/components/cura-select2.js +3 -3
- package/dist/components/cura-switch.js +1 -1
- package/dist/components/cura-toast.js +1 -1
- package/dist/components/cura-tooltip.js +1 -1
- package/dist/components/index.js +2 -0
- package/dist/components/index.js.map +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/cura.esm.js.map +1 -1
- package/dist/cura/{p-022b22b6.entry.js → p-075b02de.entry.js} +2 -2
- package/dist/cura/{p-df851816.entry.js → p-0e28f1c8.entry.js} +2 -2
- package/dist/cura/{p-c444e692.entry.js → p-1f53580a.entry.js} +2 -2
- package/dist/cura/{p-2b9eadc7.entry.js → p-3536c96b.entry.js} +2 -2
- package/dist/cura/{p-93525d68.entry.js → p-71a2dcef.entry.js} +2 -2
- package/dist/cura/p-9a7e3f48.entry.js +2 -0
- package/dist/cura/p-9a7e3f48.entry.js.map +1 -0
- package/dist/cura/{p-e3d3bc3d.entry.js → p-dbd9eab3.entry.js} +2 -2
- package/dist/cura/p-deadde8d.entry.js +2 -0
- package/dist/cura/p-deadde8d.entry.js.map +1 -0
- package/dist/cura/{p-b883e098.entry.js → p-e5b0dd74.entry.js} +2 -2
- package/dist/cura/p-ebed83d1.entry.js +2 -0
- package/dist/cura/{p-639c1b67.entry.js → p-ed839f1e.entry.js} +2 -2
- package/dist/cura/{p-2c0f5497.entry.js → p-eea093b2.entry.js} +2 -2
- package/dist/cura/{p-9e3d26fe.entry.js → p-f375a612.entry.js} +2 -2
- package/dist/esm/cura-accordion_12.entry.js +9 -9
- package/dist/esm/cura-checkbox.entry.js +1 -1
- package/dist/esm/cura-display.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option-title.entry.js +1 -1
- package/dist/esm/cura-dropdown-search-option.entry.js +2 -2
- package/dist/esm/cura-dropdown-search.entry.js +24 -15
- package/dist/esm/cura-dropdown-search.entry.js.map +1 -1
- package/dist/esm/cura-input-date.entry.js +1 -1
- package/dist/esm/cura-loader-bar.entry.js +1 -1
- package/dist/esm/cura-modal.entry.js +46 -0
- package/dist/esm/cura-modal.entry.js.map +1 -0
- package/dist/esm/cura-radio.entry.js +1 -1
- package/dist/esm/cura-switch.entry.js +1 -1
- package/dist/esm/cura-toast.entry.js +1 -1
- package/dist/esm/cura-tooltip.entry.js +1 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cura-modal/cura-modal.d.ts +28 -0
- package/dist/types/components/cura-modal/cura-modal.stories.d.ts +70 -0
- package/dist/types/components/forms/cura-dropdown-search/cura-dropdown-search.d.ts +8 -0
- package/dist/types/components.d.ts +56 -0
- package/package.json +2 -2
- package/dist/cura/p-22e921d9.entry.js +0 -2
- package/dist/cura/p-22e921d9.entry.js.map +0 -1
- package/dist/cura/p-9991f7db.entry.js +0 -2
- /package/dist/cura/{p-022b22b6.entry.js.map → p-075b02de.entry.js.map} +0 -0
- /package/dist/cura/{p-df851816.entry.js.map → p-0e28f1c8.entry.js.map} +0 -0
- /package/dist/cura/{p-c444e692.entry.js.map → p-1f53580a.entry.js.map} +0 -0
- /package/dist/cura/{p-2b9eadc7.entry.js.map → p-3536c96b.entry.js.map} +0 -0
- /package/dist/cura/{p-93525d68.entry.js.map → p-71a2dcef.entry.js.map} +0 -0
- /package/dist/cura/{p-e3d3bc3d.entry.js.map → p-dbd9eab3.entry.js.map} +0 -0
- /package/dist/cura/{p-b883e098.entry.js.map → p-e5b0dd74.entry.js.map} +0 -0
- /package/dist/cura/{p-9991f7db.entry.js.map → p-ebed83d1.entry.js.map} +0 -0
- /package/dist/cura/{p-639c1b67.entry.js.map → p-ed839f1e.entry.js.map} +0 -0
- /package/dist/cura/{p-2c0f5497.entry.js.map → p-eea093b2.entry.js.map} +0 -0
- /package/dist/cura/{p-9e3d26fe.entry.js.map → p-f375a612.entry.js.map} +0 -0
|
@@ -21,7 +21,7 @@ export class CuraToast {
|
|
|
21
21
|
this.setStyle();
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
-
return (h(Host, { key: '
|
|
24
|
+
return (h(Host, { key: '467952f8386d659d44090163f3e14c0231dfcafd' }, h("div", { key: 'f510e12d309c79842d30cc24409b61433a6fe58e', class: this.getClasses(), style: this.styles }, h("cura-icon", { key: 'acd2a9d52ad91565c7bd36bc205753bdfe6e3e59', class: "default-icon", name: this.getNameIcon(), size: 16, color: `${this.type}-dark` }), h("div", { key: 'dced39ca17901673360dacbf27764b1387eff20d', class: "content" }, h("cura-heading", { key: '6ac55c8ae757f654c808b72b4f44b54dc822107c', level: 4, size: "xsmall", color: `${this.type}-dark`, weight: "bold", "margin-block": "0" }, this.label), h("cura-paragraph", { key: 'e8e83b891e0b7e02901999f1622a183afc94c28e', color: `${this.type}-darker`, size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, h("slot", { key: '080891767b1b552520d7d3ed59002a9478eb0288' })), h("slot", { key: '0a43f99bbaf2e4cdd2fd7dc1d5a0431602b76361', name: "actions" })), this.closeButton && h("cura-icon", { key: '1ec27e6d6d44b82ed26a59cb6ba967858b4c8809', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.loader && !!this.autoCloseDelay && h("cura-loader-bar", { key: '6457bb003e4706d3f60b85aa3faa3e0b6b276869', color: `${this.type}-base`, progress: this.progress }))));
|
|
25
25
|
}
|
|
26
26
|
componentDidLoad() {
|
|
27
27
|
this.openContainer();
|
|
@@ -25,7 +25,7 @@ export class CuraTooltip {
|
|
|
25
25
|
this.setStyle();
|
|
26
26
|
}
|
|
27
27
|
render() {
|
|
28
|
-
return (h(Host, { key: '
|
|
28
|
+
return (h(Host, { key: '732345360f527ffc69743818657643616b2ee611', role: "tooltip", id: this.elementId }, h("div", { key: '166aa0dd54c933f8b3b8ecc5c5c76824ef180d71', class: "container", style: this.styles }, h("div", { key: '7b54ec53f3b454979c45415ddcd164a71a9ab2b0', class: "content" }, h("cura-heading", { key: '71bf328ed2f9e5d704e6d06989a4bef6d7c4993d', level: 4, size: "xsmall", color: "neutral-black", weight: "bold", "margin-block": "0" }, this.label), h("cura-paragraph", { key: 'a427a4b9df7bfae50300c9947db9df825a2f7da0', color: "neutral-dark", "spot-color": "secondary-darker", size: "xsmall", marginBlock: "0", lineHeight: "133.33%" }, h("slot", { key: '65875debf5bd3eec9f3070ab96cf644460897c3b' }))), this.closeButton && !this.isMobile && h("cura-icon", { key: 'dac8229dc0f348b45ea3af9392c2001f638a0efb', class: "close-icon", name: "close", size: 16, color: "error-dark", onClick: this.handleClose }), this.isMobile && h("cura-button-transparent", { key: '6c90921145206d47ab84eaee972a08b9dcad7cf0', class: "close-button", size: "small", type: "button", color: "error", "icon-name": "close", "icon-position": "right", onClick: this.handleClose }, "OK, entendi."))));
|
|
29
29
|
}
|
|
30
30
|
componentDidLoad() {
|
|
31
31
|
this.targetElement = document.querySelector(`[aria-labelledby="${this.elementId}"]`);
|
|
@@ -147,7 +147,7 @@ export class CuraCheckbox {
|
|
|
147
147
|
return h("cura-icon", { class: "icon", name: iconName, size: iconSize, color: iconColor });
|
|
148
148
|
}
|
|
149
149
|
render() {
|
|
150
|
-
return (h(Host, { key: '
|
|
150
|
+
return (h(Host, { key: '876fa0a7aa0fc7110cbf0ffeb2d95d529fa78e64' }, h("div", { key: '3e6d730765590ee75d7e045cadc7d03e5fc035e2', class: this.getClasses(), style: this.styles, onClick: this.handleClick }, h("div", { key: '0f7f6f3bc61a80e899d940d76fee266af1914f5a', class: "info" }, h("div", { key: 'a836cb0d7751a1a812364fe93a30403b02ec5c95', class: "label-wrapper" }, h("cura-label", { key: '5d180552ec71e22ddd8822727bd32d4167215f33', class: "label", weight: 'bold', size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && h("cura-paragraph", { key: '047413aa21a28bc33984d19ad4dc10a38289c205', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), h("cura-label", { key: '68c9dd6f228ec3204647795f1cae32a8f8797bc2', color: this.assignColor('message'), size: "xsmall", class: "message" }, h("slot", { key: '3a35a1219f135002f1b9ae64c0eb4227529bc904' }))), h("div", { key: 'fe969ee332b3c64a259ec552f411b5d2d4bc81e4', class: 'checkbox', tabIndex: this.ontabindex }, h("input", { key: '2cbcbe56130bddb5853cfcc3a8ef1b421f39bc7b', type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
|
|
151
151
|
}
|
|
152
152
|
static get is() { return "cura-checkbox"; }
|
|
153
153
|
static get encapsulation() { return "shadow"; }
|
|
@@ -36,12 +36,12 @@ export class CuraDropdownSearchOption {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
return (h(Host, { key: '
|
|
39
|
+
return (h(Host, { key: '0dfb8d67f1aee692af5abdad170f2fc3e6c5ffc6', slot: "dropdown-search-option" }, h("div", { key: '6596c224bbfc0e9b5c3d2a39d064852019af5b74', style: this.styles, class: {
|
|
40
40
|
"option-container": true,
|
|
41
41
|
hovered: this.selectable ? this.hovered : false,
|
|
42
42
|
selected: this.selected,
|
|
43
43
|
disabled: !this.selectable
|
|
44
|
-
} }, h("div", { key: '
|
|
44
|
+
} }, h("div", { key: 'b73badabbcde37615c58707d8a62832363deb694', class: "content-container" }, h("div", { key: '6ea1e5cfa3aa5f7bb7d0a4a2c9c8aff6e076304c', class: "option-info", onClick: (e) => this.handleOptionClick(e) }, h("slot", { key: '9e6272b220a723fbc1b52a23f59873cb4eea0986', name: "image" }), h("cura-heading", { key: '4bec4f91fd5ef5759373d846c0876678e67b1b48', size: "xsmall", lineHeight: "16px", marginBlock: "0px", weight: "bold", color: "neutral-black" }, h("slot", { key: 'c485bfd68ddf4b5bcfa0c590c11344352939fe87' }))), h("slot", { key: '0ce8978f72401af3580c72919b6079ef222dcc0d', name: "action" })))));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "cura-dropdown-search-option"; }
|
|
47
47
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
2
|
export class CuraDropdownSearchOptionTitle {
|
|
3
3
|
render() {
|
|
4
|
-
return (h(Host, { key: '
|
|
4
|
+
return (h(Host, { key: 'ed1d2aeeba08c3c53f04f434fa46cb178271f405', slot: "dropdown-search-option" }, h("cura-label", { key: '910b1ada8d333ace0171a3180ba6320e813e4fce', color: "neutral-dark", size: "xsmall", lineHeight: "16px", marginBlock: "0" }, h("slot", { key: '20816c3a0c9805a88074f36e060ad850157427e2' }))));
|
|
5
5
|
}
|
|
6
6
|
static get is() { return "cura-dropdown-search-option-title"; }
|
|
7
7
|
static get encapsulation() { return "shadow"; }
|
|
@@ -8,20 +8,10 @@ export class CuraDropdownSearch {
|
|
|
8
8
|
const isKeyboardOpen = window.innerHeight < window.screen.height * 0.8;
|
|
9
9
|
const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
|
|
10
10
|
if (dropdown) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
dropdown.style.position = 'fixed';
|
|
17
|
-
dropdown.style.bottom = '0';
|
|
18
|
-
}
|
|
11
|
+
dropdown.style.position = isKeyboardOpen ? 'absolute' : 'fixed';
|
|
12
|
+
dropdown.style.bottom = isKeyboardOpen ? `${window.screen.height - window.innerHeight}px` : '0';
|
|
13
|
+
window.scroll({ top: 0, left: 0, behavior: 'smooth' });
|
|
19
14
|
}
|
|
20
|
-
window.scroll({
|
|
21
|
-
top: 0,
|
|
22
|
-
left: 0,
|
|
23
|
-
behavior: 'smooth',
|
|
24
|
-
});
|
|
25
15
|
});
|
|
26
16
|
};
|
|
27
17
|
this.handleSlotChange = () => {
|
|
@@ -59,6 +49,7 @@ export class CuraDropdownSearch {
|
|
|
59
49
|
this.showOverlay();
|
|
60
50
|
}
|
|
61
51
|
else {
|
|
52
|
+
this.resetDropdownStyles();
|
|
62
53
|
this.removeOverlay();
|
|
63
54
|
}
|
|
64
55
|
}
|
|
@@ -83,6 +74,7 @@ export class CuraDropdownSearch {
|
|
|
83
74
|
this.isOnBlurInput = true;
|
|
84
75
|
this.hoveredIndex = -1;
|
|
85
76
|
this.options = [];
|
|
77
|
+
this.originalOverflow = '';
|
|
86
78
|
}
|
|
87
79
|
connectedCallback() {
|
|
88
80
|
this.weights = window.CuraAPI.theme.fonts.getWeights();
|
|
@@ -134,12 +126,15 @@ export class CuraDropdownSearch {
|
|
|
134
126
|
this.overlayElement.style.zIndex = '9999';
|
|
135
127
|
this.overlayElement.style.backgroundColor = 'white';
|
|
136
128
|
document.body.appendChild(this.overlayElement);
|
|
129
|
+
this.originalOverflow = document.body.style.overflow;
|
|
130
|
+
document.body.style.overflow = 'hidden';
|
|
137
131
|
}
|
|
138
132
|
}
|
|
139
133
|
removeOverlay() {
|
|
140
134
|
if (this.overlayElement && this.overlayElement.parentNode === document.body) {
|
|
141
135
|
document.body.removeChild(this.overlayElement);
|
|
142
136
|
this.overlayElement = null;
|
|
137
|
+
document.body.style.overflow = this.originalOverflow;
|
|
143
138
|
}
|
|
144
139
|
}
|
|
145
140
|
addClickListenersToOptions() {
|
|
@@ -163,6 +158,7 @@ export class CuraDropdownSearch {
|
|
|
163
158
|
this.updateSelectedOption(this.value);
|
|
164
159
|
this.isDropdownOpen = false;
|
|
165
160
|
this.isOnBlurInput = true;
|
|
161
|
+
this.resetDropdownStyles();
|
|
166
162
|
this.removeOverlay();
|
|
167
163
|
}
|
|
168
164
|
}
|
|
@@ -202,6 +198,7 @@ export class CuraDropdownSearch {
|
|
|
202
198
|
if (this.isOnBlurInput === true) {
|
|
203
199
|
setTimeout(() => {
|
|
204
200
|
this.isDropdownOpen = false;
|
|
201
|
+
this.resetDropdownStyles();
|
|
205
202
|
this.removeOverlay();
|
|
206
203
|
}, 200);
|
|
207
204
|
}
|
|
@@ -235,11 +232,23 @@ export class CuraDropdownSearch {
|
|
|
235
232
|
this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);
|
|
236
233
|
}
|
|
237
234
|
}
|
|
235
|
+
handleGoBack() {
|
|
236
|
+
this.resetDropdownStyles();
|
|
237
|
+
this.isMobile = false;
|
|
238
|
+
}
|
|
239
|
+
resetDropdownStyles() {
|
|
240
|
+
var _a;
|
|
241
|
+
const dropdown = (_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.dropdown-mobile');
|
|
242
|
+
if (dropdown && dropdown.style.position === 'fixed') {
|
|
243
|
+
dropdown.style.position = 'relative';
|
|
244
|
+
dropdown.style.removeProperty('bottom');
|
|
245
|
+
}
|
|
246
|
+
}
|
|
238
247
|
render() {
|
|
239
248
|
const isMobileDropdown = this.isMobile && this.isDropdownOpen;
|
|
240
|
-
return (h(Host, { key: '
|
|
249
|
+
return (h(Host, { key: '21f8601dd62ce272ac6856e6f951268b2fbbf32d', style: this.hostCSSProperties(), class: "dropdown-overlay" }, h("div", { key: 'a6841c5564454fcc33a4d053cd506c17f53026d3', class: `dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`, style: this.styles }, h("div", { key: '3653377bc88d97c60a049731f6286aa5d7fc516c', class: this.getClasses() }, this.isMobile && this.isDropdownOpen && (h("cura-button-transparent", { key: 'bd4614e2859df22d74d27532171e73de1cf60979', fontColor: "dark", onClick: () => this.handleGoBack(), iconName: "arrowLeft", size: "medium", iconOnly: true, color: "primary" })), h("cura-input-text", { key: '811d3745b6963d3aff02d58a39f7f1be472646fa', disabled: this.disabled, label: this.label, part: "cura-input-field", mode: isMobileDropdown ? 'transparent' : 'default', required: this.required, hideErrorIcon: this.status === 'error', iconName: this.iconName || 'search', value: this.value, status: this.status, onValueChange: e => this.onValueChange(e.target.value), onInput: e => this.handleInputChange(e), onFocus: () => this.handleOnFocus(), onClick: () => (window.innerWidth < 768 ? (this.isMobile = true) : null), onBlur: () => {
|
|
241
250
|
this.handleOnBlur();
|
|
242
|
-
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, h("slot", { key: '
|
|
251
|
+
}, placeholder: this.placeholder, size: this.size, onKeyDown: this.handleKeyDown }, h("slot", { key: 'a928b64d301c0cd674612698839a213344dc6798', name: "helperText" }))), h("div", { key: '06ba9b411e46969ccf7378869bc37d202084ead0', id: "dropdown-search-list", class: this.getDropdownClasses() }, h("slot", { key: '8915959d70f28a28c7b8035e77c34ed1f7035727', name: "dropdown-search-option", onSlotchange: this.handleSlotChange })))));
|
|
243
252
|
}
|
|
244
253
|
static get is() { return "cura-dropdown-search"; }
|
|
245
254
|
static get encapsulation() { return "shadow"; }
|
|
@@ -464,7 +473,8 @@ export class CuraDropdownSearch {
|
|
|
464
473
|
"inputTextRef": {},
|
|
465
474
|
"isOnBlurInput": {},
|
|
466
475
|
"hoveredIndex": {},
|
|
467
|
-
"options": {}
|
|
476
|
+
"options": {},
|
|
477
|
+
"originalOverflow": {}
|
|
468
478
|
};
|
|
469
479
|
}
|
|
470
480
|
static get events() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cura-dropdown-search.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-dropdown-search/cura-dropdown-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOrG,MAAM,OAAO,kBAAkB;;QAmHrB,mBAAc,GAA0B,IAAI,CAAC;QAI7C,wBAAmB,GAAG,GAAG,EAAE;YACjC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;;gBACpD,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;gBACvE,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,UAAU,0CAAE,aAAa,CAAC,kBAAkB,CAAqB,CAAC;gBAE7F,IAAI,QAAQ,EAAE,CAAC;oBACb,IAAI,cAAc,EAAE,CAAC;wBACnB,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;wB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EAAC,wBAAwB,EAAC,YAAY,EAAE,IAAI,CAAC,gBAAgB,GAAS,CAC5E,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, Prop, State, Event, EventEmitter, Element, Watch, h } from '@stencil/core';\n\n@Component({\n tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n /**\n * Size of the dropdown search mode default: 'small', 'medium', or 'large' (default: 'large')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Define the status of the dropdown search.\n */\n @Prop({ reflect: true }) status: 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The name of the dropdown search component.\n */\n @Prop({ reflect: true }) name: string;\n\n /**\n * Indicates if the dropdown search is required.\n */\n @Prop({ reflect: true, mutable: true }) required: boolean = false;\n\n /**\n * Indicates if the dropdown search is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * The value of the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * The placeholder text for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) placeholder: string = '';\n\n /**\n * The label for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) label: string = '';\n\n /**\n * Custom icon name. Default: search.\n */\n @Prop({ reflect: true }) iconName = 'search';\n\n /**\n * CSS max-height property for dropdown item.\n * Default to 630px\n */\n @Prop({ reflect: true }) dropdownMaxHeight = '630px';\n\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n /**\n * Indicates if the overlay is visible.\n */\n @State() overlayVisible: boolean = false;\n\n /**\n * Event emitted when the value changes.\n */\n @Event() valueChanged: EventEmitter<string>;\n\n /**\n * Indicates if the dropdown is open.\n */\n @State() isDropdownOpen: boolean = false;\n\n /**\n * Styles for the component.\n\n */\n @State() styles = {};\n\n /**\n * Indicates if the component is being viewed on a mobile device.\n */\n @State() isMobile: boolean = window.innerWidth < 768;\n\n /**\n * The mode of the dropdown search.\n */\n @State() mode: 'default' | 'transparent' = 'default';\n\n @Event() onselect: EventEmitter;\n\n @State() inputTextRef!: HTMLCuraInputTextElement;\n\n /**\n * Indicates if the input is on blur.\n */\n @State() isOnBlurInput: boolean = true;\n\n /**\n * The index of the currently hovered option.\n */\n @State() hoveredIndex: number = -1;\n\n /**\n * The options for the dropdown search.\n * @type {HTMLCuraDropdownSearchOptionElement[]}\n */\n\n weights;\n\n private overlayElement: HTMLDivElement | null = null;\n\n @State() options: HTMLCuraDropdownSearchOptionElement[] = [];\n\n private adjustInputPosition = () => {\n window.visualViewport.addEventListener('resize', () => {\n const isKeyboardOpen = window.innerHeight < window.screen.height * 0.8;\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLInputElement;\n\n if (dropdown) {\n if (isKeyboardOpen) {\n dropdown.style.position = 'absolute';\n dropdown.style.bottom = `${window.screen.height - window.innerHeight}px`;\n } else {\n dropdown.style.position = 'fixed';\n dropdown.style.bottom = '0';\n }\n }\n\n window.scroll({\n top: 0,\n left: 0,\n behavior: 'smooth',\n });\n });\n };\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--breakpoints'] = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n }\n\n @Watch('value')\n onValueChange(newValue: string) {\n this.updateSelectedOption(newValue);\n this.valueChanged.emit(newValue);\n }\n\n componentWillLoad() {\n this.updateSelectedOption(this.value);\n }\n\n componentDidRender() {\n if (this.isDropdownOpen && this.isMobile) {\n this.showOverlay();\n this.getDropdownSearchListHeight();\n } else {\n this.removeOverlay();\n }\n }\n componentDidLoad() {\n window.addEventListener('resize', this.handleResize);\n window.addEventListener('resize', this.adjustInputPosition);\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.handleResize);\n window.removeEventListener('resize', this.adjustInputPosition);\n }\n\n private showOverlay() {\n if (!this.overlayElement) {\n this.overlayElement = document.createElement('div');\n this.overlayElement.className = 'dropdown-overlay';\n this.overlayElement.style.position = 'fixed';\n this.overlayElement.style.top = '0';\n this.overlayElement.style.left = '0';\n this.overlayElement.style.width = '100%';\n this.overlayElement.style.height = '100%';\n this.overlayElement.style.zIndex = '9999';\n this.overlayElement.style.backgroundColor = 'white';\n document.body.appendChild(this.overlayElement);\n }\n }\n\n private removeOverlay() {\n if (this.overlayElement && this.overlayElement.parentNode === document.body) {\n document.body.removeChild(this.overlayElement);\n this.overlayElement = null;\n }\n }\n\n private handleSlotChange = () => {\n this.options = Array.from(this.host.querySelectorAll('cura-dropdown-search-option'));\n this.addClickListenersToOptions();\n this.updateHoveredIndex();\n };\n\n private addClickListenersToOptions() {\n this.options.forEach((option, index) => {\n option.addEventListener('optionSelected', () => this.onSelectedOption(index));\n });\n }\n\n private updateSelectedOption(value: string) {\n const selectedOptionIndex = this.options.findIndex(option => option.getAttribute('value') === value);\n this.hoveredIndex = selectedOptionIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.updateOptionAttribute('selected', this.hoveredIndex);\n\n this.scrollIntoView();\n this.adjustInputPosition();\n }\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.onValueChange(this.value);\n // this.valueChanged.emit(this.value);\n };\n\n private onSelectedOption(index: number) {\n const selectedOption = this.options[index];\n if (selectedOption.selectable) {\n const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;\n\n this.value = selectedValue || '';\n this.updateSelectedOption(this.value);\n\n this.isDropdownOpen = false;\n this.isOnBlurInput = true;\n this.removeOverlay();\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.moveHighlight(1);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.moveHighlight(-1);\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (this.hoveredIndex > -1) {\n this.handleOnBlur();\n this.onSelectedOption(this.hoveredIndex);\n }\n }\n };\n\n private moveHighlight(direction: number) {\n const visibleOptions = this.options;\n const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;\n this.hoveredIndex = newIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.scrollIntoView();\n }\n\n private updateOptionAttribute(attribute: string, indexToUpdate: number) {\n this.options.forEach((option, index) => {\n (option as any)[attribute] = index === indexToUpdate;\n });\n }\n\n private updateHoveredIndex() {\n const visibleOptions = this.options;\n const currentValue = this.value;\n this.hoveredIndex = visibleOptions.findIndex(option => option.getAttribute('value') === currentValue);\n }\n\n private scrollIntoView() {\n const container = this.host.shadowRoot?.querySelector('.dropdown-search-list');\n const hoveredOption = this.options[this.hoveredIndex];\n\n if (container && hoveredOption) {\n const optionRect = hoveredOption.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n if (optionRect.bottom > containerRect.bottom) {\n container.scrollTop += optionRect.bottom - containerRect.bottom;\n }\n\n if (optionRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - optionRect.top;\n }\n }\n }\n\n private handleResize = () => {\n this.isMobile = window.innerWidth < 768;\n if (this.isDropdownOpen) {\n if (this.isMobile) {\n this.showOverlay();\n } else {\n this.removeOverlay();\n }\n }\n };\n\n handleOnBlur() {\n if (this.isOnBlurInput === true) {\n setTimeout(() => {\n this.isDropdownOpen = false;\n this.removeOverlay();\n }, 200);\n }\n }\n getClasses() {\n return {\n 'dropdown-input-search': true,\n 'dropdown-open': this.isDropdownOpen,\n 'disabled': this.disabled,\n [this.status]: true,\n };\n }\n\n getDropdownClasses() {\n return {\n 'dropdown-search-list': true,\n 'visible': this.options.length && this.isDropdownOpen ? true : false,\n };\n }\n\n hostCSSProperties() {\n return {\n '--dropdown-max-height': this.dropdownMaxHeight,\n };\n }\n\n handleOnFocus() {\n this.isDropdownOpen = true;\n }\n\n getDropdownSearchListHeight() {\n const dropdownInputSearchElement = this.host.shadowRoot?.querySelector('.dropdown-input-search') as HTMLInputElement;\n if (dropdownInputSearchElement) {\n this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);\n }\n }\n\n render() {\n const isMobileDropdown = this.isMobile && this.isDropdownOpen;\n return (\n <Host style={this.hostCSSProperties()} class=\"dropdown-overlay\">\n <div class={`dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`} style={this.styles}>\n <div class={this.getClasses()}>\n {this.isMobile && this.isDropdownOpen && (\n <cura-button-transparent\n fontColor=\"dark\"\n onClick={() => (this.isMobile = false)}\n iconName=\"arrowLeft\"\n size=\"medium\"\n iconOnly\n color=\"primary\"\n ></cura-button-transparent>\n )}\n <cura-input-text\n disabled={this.disabled}\n label={this.label}\n part=\"cura-input-field\"\n mode={isMobileDropdown ? 'transparent' : 'default'}\n required={this.required}\n hideErrorIcon={this.status === 'error'}\n iconName={this.iconName || 'search'}\n value={this.value}\n status={this.status}\n onValueChange={e => this.onValueChange(e.target.value as string)}\n onInput={e => this.handleInputChange(e)}\n onFocus={() => this.handleOnFocus()}\n onClick={() => (window.innerWidth < 768 ? (this.isMobile = true) : null)}\n onBlur={() => {\n this.handleOnBlur();\n }}\n placeholder={this.placeholder}\n size={this.size}\n onKeyDown={this.handleKeyDown}\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div id=\"dropdown-search-list\" class={this.getDropdownClasses()}>\n <slot name=\"dropdown-search-option\" onSlotchange={this.handleSlotChange}></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cura-dropdown-search.js","sourceRoot":"","sources":["../../../../src/components/forms/cura-dropdown-search/cura-dropdown-search.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAgB,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOrG,MAAM,OAAO,kBAAkB;;QAmHrB,mBAAc,GAA0B,IAAI,CAAC;QAW7C,wBAAmB,GAAG,GAAG,EAAE;YACjC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;;gBACpD,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC;gBACvE,MAAM,QAAQ,GAAG,MAAA,IAAI,CAAC,IAAI,CAAC,UAAU,0CAAE,aAAa,CAAC,kBAAkB,CAAqB,CAAC;gBAE7F,IAAI,QAAQ,EAAE,CAAC;oBACb,QAAQ,CAAC,KAAK,CAAC,QAAQ,GAAG,cAAc,CAAC,C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tag: 'cura-dropdown-search',\n styleUrl: 'cura-dropdown-search.scss',\n shadow: true,\n})\nexport class CuraDropdownSearch {\n /**\n * Size of the dropdown search mode default: 'small', 'medium', or 'large' (default: 'large')\n */\n @Prop({ reflect: true, mutable: true }) size: 'small' | 'medium' | 'large' = 'large';\n\n /**\n * Define the status of the dropdown search.\n */\n @Prop({ reflect: true }) status: 'error' | 'default' = 'default';\n\n /**\n * Whether the select component is disabled.\n * Reflects as an attribute in the DOM.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * The name of the dropdown search component.\n */\n @Prop({ reflect: true }) name: string;\n\n /**\n * Indicates if the dropdown search is required.\n */\n @Prop({ reflect: true, mutable: true }) required: boolean = false;\n\n /**\n * Indicates if the dropdown search is selected.\n */\n @Prop({ reflect: true, mutable: true }) selected: boolean = false;\n\n /**\n * The value of the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * The placeholder text for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) placeholder: string = '';\n\n /**\n * The label for the dropdown search.\n */\n @Prop({ reflect: true, mutable: true }) label: string = '';\n\n /**\n * Custom icon name. Default: search.\n */\n @Prop({ reflect: true }) iconName = 'search';\n\n /**\n * CSS max-height property for dropdown item.\n * Default to 630px\n */\n @Prop({ reflect: true }) dropdownMaxHeight = '630px';\n\n /**\n * Reference to the host element.\n */\n @Element() host: HTMLElement;\n\n /**\n * Indicates if the overlay is visible.\n */\n @State() overlayVisible: boolean = false;\n\n /**\n * Event emitted when the value changes.\n */\n @Event() valueChanged: EventEmitter<string>;\n\n /**\n * Indicates if the dropdown is open.\n */\n @State() isDropdownOpen: boolean = false;\n\n /**\n * Styles for the component.\n\n */\n @State() styles = {};\n\n /**\n * Indicates if the component is being viewed on a mobile device.\n */\n @State() isMobile: boolean = window.innerWidth < 768;\n\n /**\n * The mode of the dropdown search.\n */\n @State() mode: 'default' | 'transparent' = 'default';\n\n @Event() onselect: EventEmitter;\n\n @State() inputTextRef!: HTMLCuraInputTextElement;\n\n /**\n * Indicates if the input is on blur.\n */\n @State() isOnBlurInput: boolean = true;\n\n /**\n * The index of the currently hovered option.\n */\n @State() hoveredIndex: number = -1;\n\n /**\n * The options for the dropdown search.\n * @type {HTMLCuraDropdownSearchOptionElement[]}\n */\n\n weights;\n\n private overlayElement: HTMLDivElement | null = null;\n\n @State() options: HTMLCuraDropdownSearchOptionElement[] = [];\n\n /**\n *\n * Stores the original value of the 'overflow' style of the body\n * before blocking the scroll.\n */\n @State() originalOverflow: string = '';\n\n private adjustInputPosition = () => {\n window.visualViewport.addEventListener('resize', () => {\n const isKeyboardOpen = window.innerHeight < window.screen.height * 0.8;\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLInputElement;\n\n if (dropdown) {\n dropdown.style.position = isKeyboardOpen ? 'absolute' : 'fixed';\n dropdown.style.bottom = isKeyboardOpen ? `${window.screen.height - window.innerHeight}px` : '0';\n window.scroll({ top: 0, left: 0, behavior: 'smooth' });\n }\n });\n };\n\n connectedCallback() {\n this.weights = window.CuraAPI.theme.fonts.getWeights();\n this.styles['--info-base'] = window.CuraAPI.theme.colors.getColor('info-base');\n this.styles['--neutral-purewhite'] = window.CuraAPI.theme.colors.getColor('neutral-purewhite');\n this.styles['--neutral-light'] = window.CuraAPI.theme.colors.getColor('neutral-light');\n this.styles['--neutral-dark'] = window.CuraAPI.theme.colors.getColor('neutral-dark');\n this.styles['--neutral-black-shadow'] = window.CuraAPI.theme.colors.getColor(`neutral-black`, 0.16);\n this.styles['--error-dark'] = window.CuraAPI.theme.colors.getColor('error-dark');\n this.styles['--error-lighter'] = window.CuraAPI.theme.colors.getColor('error-lighter');\n this.styles['--breakpoints'] = window.CuraAPI.theme.breakpoints.get();\n this.styles['--font-size'] = window.CuraAPI.theme.fonts.getSize();\n this.styles['--font-family'] = window.CuraAPI.theme.fonts.getFamily();\n this.styles['--font-weight-medium'] = this.weights.medium;\n }\n\n @Watch('value')\n onValueChange(newValue: string) {\n this.updateSelectedOption(newValue);\n this.valueChanged.emit(newValue);\n }\n\n componentWillLoad() {\n this.updateSelectedOption(this.value);\n }\n\n componentDidRender() {\n if (this.isDropdownOpen && this.isMobile) {\n this.showOverlay();\n this.getDropdownSearchListHeight();\n } else {\n this.removeOverlay();\n }\n }\n componentDidLoad() {\n window.addEventListener('resize', this.handleResize);\n window.addEventListener('resize', this.adjustInputPosition);\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.handleResize);\n window.removeEventListener('resize', this.adjustInputPosition);\n }\n\n private showOverlay() {\n if (!this.overlayElement) {\n this.overlayElement = document.createElement('div');\n this.overlayElement.className = 'dropdown-overlay';\n this.overlayElement.style.position = 'fixed';\n this.overlayElement.style.top = '0';\n this.overlayElement.style.left = '0';\n this.overlayElement.style.width = '100%';\n this.overlayElement.style.height = '100%';\n this.overlayElement.style.zIndex = '9999';\n this.overlayElement.style.backgroundColor = 'white';\n document.body.appendChild(this.overlayElement);\n\n this.originalOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n }\n\n private removeOverlay() {\n if (this.overlayElement && this.overlayElement.parentNode === document.body) {\n document.body.removeChild(this.overlayElement);\n this.overlayElement = null;\n document.body.style.overflow = this.originalOverflow;\n }\n }\n\n private handleSlotChange = () => {\n this.options = Array.from(this.host.querySelectorAll('cura-dropdown-search-option'));\n this.addClickListenersToOptions();\n this.updateHoveredIndex();\n };\n\n private addClickListenersToOptions() {\n this.options.forEach((option, index) => {\n option.addEventListener('optionSelected', () => this.onSelectedOption(index));\n });\n }\n\n private updateSelectedOption(value: string) {\n const selectedOptionIndex = this.options.findIndex(option => option.getAttribute('value') === value);\n this.hoveredIndex = selectedOptionIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.updateOptionAttribute('selected', this.hoveredIndex);\n\n this.scrollIntoView();\n this.adjustInputPosition();\n }\n\n private handleInputChange = (event: Event) => {\n const input = event.target as HTMLInputElement;\n this.value = input.value;\n this.onValueChange(this.value);\n // this.valueChanged.emit(this.value);\n };\n\n private onSelectedOption(index: number) {\n const selectedOption = this.options[index];\n if (selectedOption.selectable) {\n const selectedValue = selectedOption.getAttribute('value') || selectedOption.textContent;\n\n this.value = selectedValue || '';\n this.updateSelectedOption(this.value);\n\n this.isDropdownOpen = false;\n this.isOnBlurInput = true;\n this.resetDropdownStyles();\n this.removeOverlay();\n }\n }\n\n private handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.moveHighlight(1);\n } else if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.moveHighlight(-1);\n } else if (event.key === 'Enter') {\n event.preventDefault();\n if (this.hoveredIndex > -1) {\n this.handleOnBlur();\n this.onSelectedOption(this.hoveredIndex);\n }\n }\n };\n\n private moveHighlight(direction: number) {\n const visibleOptions = this.options;\n const newIndex = (this.hoveredIndex + direction + visibleOptions.length) % visibleOptions.length;\n this.hoveredIndex = newIndex;\n this.updateOptionAttribute('hovered', this.hoveredIndex);\n this.scrollIntoView();\n }\n\n private updateOptionAttribute(attribute: string, indexToUpdate: number) {\n this.options.forEach((option, index) => {\n (option as any)[attribute] = index === indexToUpdate;\n });\n }\n\n private updateHoveredIndex() {\n const visibleOptions = this.options;\n const currentValue = this.value;\n this.hoveredIndex = visibleOptions.findIndex(option => option.getAttribute('value') === currentValue);\n }\n\n private scrollIntoView() {\n const container = this.host.shadowRoot?.querySelector('.dropdown-search-list');\n const hoveredOption = this.options[this.hoveredIndex];\n\n if (container && hoveredOption) {\n const optionRect = hoveredOption.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n if (optionRect.bottom > containerRect.bottom) {\n container.scrollTop += optionRect.bottom - containerRect.bottom;\n }\n\n if (optionRect.top < containerRect.top) {\n container.scrollTop -= containerRect.top - optionRect.top;\n }\n }\n }\n\n private handleResize = () => {\n this.isMobile = window.innerWidth < 768;\n if (this.isDropdownOpen) {\n if (this.isMobile) {\n this.showOverlay();\n } else {\n this.resetDropdownStyles();\n this.removeOverlay();\n }\n }\n };\n\n handleOnBlur() {\n if (this.isOnBlurInput === true) {\n setTimeout(() => {\n this.isDropdownOpen = false;\n this.resetDropdownStyles();\n this.removeOverlay();\n }, 200);\n }\n }\n getClasses() {\n return {\n 'dropdown-input-search': true,\n 'dropdown-open': this.isDropdownOpen,\n 'disabled': this.disabled,\n [this.status]: true,\n };\n }\n\n getDropdownClasses() {\n return {\n 'dropdown-search-list': true,\n 'visible': this.options.length && this.isDropdownOpen ? true : false,\n };\n }\n\n hostCSSProperties() {\n return {\n '--dropdown-max-height': this.dropdownMaxHeight,\n };\n }\n\n handleOnFocus() {\n this.isDropdownOpen = true;\n }\n\n getDropdownSearchListHeight() {\n const dropdownInputSearchElement = this.host.shadowRoot?.querySelector('.dropdown-input-search') as HTMLInputElement;\n if (dropdownInputSearchElement) {\n this.host.style.setProperty('--dynamic-input-search-height', `${dropdownInputSearchElement.offsetHeight}px`);\n }\n }\n\n handleGoBack() {\n this.resetDropdownStyles();\n this.isMobile = false;\n }\n\n resetDropdownStyles() {\n const dropdown = this.host.shadowRoot?.querySelector('.dropdown-mobile') as HTMLInputElement;\n if (dropdown && dropdown.style.position === 'fixed') {\n dropdown.style.position = 'relative';\n dropdown.style.removeProperty('bottom');\n }\n }\n\n render() {\n const isMobileDropdown = this.isMobile && this.isDropdownOpen;\n return (\n <Host style={this.hostCSSProperties()} class=\"dropdown-overlay\">\n <div class={`dropdown ${isMobileDropdown ? 'dropdown-mobile' : ''}`} style={this.styles}>\n <div class={this.getClasses()}>\n {this.isMobile && this.isDropdownOpen && (\n <cura-button-transparent fontColor=\"dark\" onClick={() => this.handleGoBack()} iconName=\"arrowLeft\" size=\"medium\" iconOnly color=\"primary\"></cura-button-transparent>\n )}\n <cura-input-text\n disabled={this.disabled}\n label={this.label}\n part=\"cura-input-field\"\n mode={isMobileDropdown ? 'transparent' : 'default'}\n required={this.required}\n hideErrorIcon={this.status === 'error'}\n iconName={this.iconName || 'search'}\n value={this.value}\n status={this.status}\n onValueChange={e => this.onValueChange(e.target.value as string)}\n onInput={e => this.handleInputChange(e)}\n onFocus={() => this.handleOnFocus()}\n onClick={() => (window.innerWidth < 768 ? (this.isMobile = true) : null)}\n onBlur={() => {\n this.handleOnBlur();\n }}\n placeholder={this.placeholder}\n size={this.size}\n onKeyDown={this.handleKeyDown}\n >\n <slot name=\"helperText\"></slot>\n </cura-input-text>\n </div>\n <div id=\"dropdown-search-list\" class={this.getDropdownClasses()}>\n <slot name=\"dropdown-search-option\" onSlotchange={this.handleSlotChange}></slot>\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -162,7 +162,7 @@ export class CuraInputDate {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
render() {
|
|
165
|
-
return (h(Host, { key: '
|
|
165
|
+
return (h(Host, { key: 'bcda0a8a2601f24d445775e40535d1c8a80be5c0' }, h("div", { key: '3a3e11f1bd7082d563537a8679f69f976f242a4a', class: "container", style: this.styles }, h("cura-input-text", { key: '86ce4be158090c4ad4bfaa1e5196548fa5e1c105', label: this.label, name: this.name, status: this.status, value: this.value, onFocus: () => this.showCalendar(), size: this.size, "icon-name": this.iconName, placeholder: this.dateSettings.placeholder, "mask-preset": this.dateSettings.mask, "enable-selection-mode": true, onKeyUp: event => this.handleInputDates(event), autocomplete: "off", onValueChange: event => this.handleChangeDates(event) }, this.renderCalendarOrHelperText()))));
|
|
166
166
|
}
|
|
167
167
|
static get is() { return "cura-input-date"; }
|
|
168
168
|
static get encapsulation() { return "shadow"; }
|
|
@@ -46,7 +46,7 @@ export class CuraLabel {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: '8d691e1d4c38c30d1e50bc981b9e6de89b3506e0', style: this.hostCSSProperties() }, h("p", { key: 'b68944f4fe1e65aecf6a627f3bba547418bc125b', style: this.styles, class: this.getClasses() }, h("slot", { key: 'f8ac467674d94fe94adc075743b12111d1e32469' }))));
|
|
50
50
|
}
|
|
51
51
|
static get is() { return "cura-label"; }
|
|
52
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -120,7 +120,7 @@ export class CuraRadio {
|
|
|
120
120
|
return statusColors[this.status][type];
|
|
121
121
|
}
|
|
122
122
|
render() {
|
|
123
|
-
return (h(Host, { key: '
|
|
123
|
+
return (h(Host, { key: '07ed893348b28a188a67ee6b5e8eedb0598d2309' }, h("div", { key: 'b80a2b0e3db1f5dcac77617ecb9629b219460dbe', class: this.getClasses(), style: this.styles }, h("div", { key: '945ceedc874bf7b8ecb48683d26fa626449fb377', class: "info" }, h("div", { key: '3257b5a46d040d0177e8a791a2d810bf278f7517', class: "label-wrapper" }, h("cura-label", { key: '8c68882b6e2f852a2d1929449b3c82469474fab3', class: "label", size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && h("cura-paragraph", { key: 'e9adfe5998b2c5f705589461bff38705f0ddbbc7', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), h("cura-label", { key: '50063f682a67c74a0ce2292cc823c21e6db90bcd', color: this.assignColor('message'), size: "xsmall", class: "message" }, h("slot", { key: 'c746a61b3e7ea6d4a63143b794fd8c482829e834' }))), h("input", { key: '078275db7eb3a4878d93d77b120c3caaa0b5e0b7', type: "radio", class: `radio ${this.size.toLocaleLowerCase()}`, name: this.name, value: this.value, required: this.required, tabIndex: this.ontabindex, disabled: this.disabled, checked: this.checked, onClick: this.handleClick }))));
|
|
124
124
|
}
|
|
125
125
|
static get is() { return "cura-radio"; }
|
|
126
126
|
static get encapsulation() { return "shadow"; }
|
|
@@ -265,13 +265,13 @@ export class CuraSelect {
|
|
|
265
265
|
return (h("cura-icon", { class: 'feedback-icon', name: icon, iconset: 'default', size: this.size === 'large' ? 20 : 16, color: this.getColor('icon'), style: this.styles }));
|
|
266
266
|
}
|
|
267
267
|
render() {
|
|
268
|
-
return (h(Host, { key: '
|
|
268
|
+
return (h(Host, { key: 'f01b52d0da1c417723c9da0ce7002155b3cbb07d', style: this.styles }, h("div", { key: '2798e5cd7f16e8679520900374e569cca1e5bee8', class: this.getClasses(), onMouseEnter: () => (this.isHovered = true), onMouseLeave: () => (this.isHovered = false), onClick: this.handleClick }, this.label && (h("cura-label", { key: '5f9f645c3199e6299f000f5ab167139f536442b8', class: 'label', weight: 'bold', size: this.size === 'large' ? 'small' : 'xsmall', color: this.getColor('label') }, this.label, " ", this.required && h("span", { key: '2bca7ed64c1d44152161c2d71173f70b8b2fbacc', class: 'required' }, "* "))), h("div", { key: 'c1e77ccc2d1853b8749fea57e5ca3554363ef168', class: {
|
|
269
269
|
'cura-input-field': true,
|
|
270
270
|
'open': this.isOpen
|
|
271
|
-
} }, this.renderIcon(), h("input", { key: '
|
|
271
|
+
} }, this.renderIcon(), h("input", { key: '66e99e0a7c3b00516cc2f1240d08511c9434201b', type: "text", autocomplete: 'off', onFocus: () => (this.isFocused = true), onBlur: () => (this.isFocused = false), onKeyDown: this.handleKeyNavigation, "aria-required": String(this.required), "aria-disabled": String(this.disabled), "aria-invalid": String(this.status === 'error'), onInput: this.handleInputChange, style: this.styles, placeholder: this.placeholder, disabled: this.disabled, required: this.required, value: this.textInput, readonly: this.searchBehavior ? null : true }), h("cura-icon", { key: '4efde985b30016b633818f9fafe6c1f538b4776e', name: this.isOpen ? 'up' : 'down', class: "up-down-icon", color: this.disabled ? 'neutral-dark' : 'primary-base', size: 16, iconset: 'default' })), h("cura-label", { key: 'ead6b6a9f95acc7f2cf2e7474f72c1627e0bd8cd', class: "helper-text", size: 'xsmall', color: this.getColor('text'), weight: this.mode === 'transparent' ? 'bold' : 'regular' }, h("slot", { key: 'e01c6c99fecb78822d092a41db0b969ca160cea1' })), this.isOpen && (h("div", { key: '0fedad3cac056457810c984eb471bd9a703f2ff4', class: {
|
|
272
272
|
'menu': true,
|
|
273
273
|
'open': this.isOpen
|
|
274
|
-
} }, h("slot", { key: '
|
|
274
|
+
} }, h("slot", { key: '1330a45037f002b5fd20a356f1fe5b982999e512', name: 'option' }))))));
|
|
275
275
|
}
|
|
276
276
|
static get is() { return "cura-select"; }
|
|
277
277
|
static get encapsulation() { return "shadow"; }
|
|
@@ -33,7 +33,7 @@ export class CuraSelectOption {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
render() {
|
|
36
|
-
return (h(Host, { key: '
|
|
36
|
+
return (h(Host, { key: '42fe72a8cadcb2745fa41cced2bf8f571ca0fb81', slot: "option" }, h("div", { key: '275c6ba6baaf1c28af3c6cce6abc36dc8c496e13', class: this.getClasses(), style: this.styles }, h("cura-label", { key: 'a5f2e672f55fe16b749f6f5d33c1ba64eb415ca8', color: `${this.selected ? 'primary-base' : 'neutral-black'}`, size: this.getSize('label'), "margin-block": "0" }, h("slot", { key: '37b09097f6f51515fe63f07a5b6bb2449ba51e60' })), this.selected && h("cura-icon", { key: '88b01b9505ea9c46ddd19be78db4bd084601687d', name: 'check', size: this.getSize('icon'), color: "primary-base" }))));
|
|
37
37
|
}
|
|
38
38
|
static get is() { return "cura-select-option"; }
|
|
39
39
|
static get encapsulation() { return "shadow"; }
|
|
@@ -92,7 +92,7 @@ export class CuraSwitch {
|
|
|
92
92
|
return classes;
|
|
93
93
|
}
|
|
94
94
|
render() {
|
|
95
|
-
return (h(Host, { key: '
|
|
95
|
+
return (h(Host, { key: '7d90b4378da63462ce63f48a54b73c1ae73e75cd' }, h("div", { key: '880d8117e073b11e33acfe2915b4aa2695f6eda4', class: this.getClasses(), style: this.styles }, h("div", { key: '475056ce32564bd91dc48cd0d9d08059db77c030', class: "info" }, h("cura-label", { key: 'f391c5eb73fbae218a7037d0381fd49b9c739298', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, class: "label", weight: "bold", size: this.size === 'large' ? 'medium' : 'xsmall', lineHeight: "125%", color: this.assignColor('neutral-white', 'neutral-black') }, this.label), h("cura-label", { key: 'd587a5d17813f65a77563ce70f0c5e924bbf737d', style: { textAlign: this.position === 'right' ? 'right' : 'left' }, color: this.assignColor('primary-lighter', 'neutral-dark'), size: "xsmall", class: "message" }, h("slot", { key: '9cb6d99b2c6e7f0f398fb2899823717c9b1b565e' }))), h("div", { key: 'c7fd172953c607baa30186dd1429b39af28093ca', onClick: this.toggleSwitch, class: "control" }, h("div", { key: '0392a5ea1bd31068aa8af7f95fe21f3c7bf7797e', class: `track ${this.size.toLowerCase()}` }, h("div", { key: '98d36e0853ec222beaefd6da984483cbc872a5fa', class: `thumb ${this.size.toLowerCase()}`, tabIndex: this.ontabindex }))))));
|
|
96
96
|
}
|
|
97
97
|
static get is() { return "cura-switch"; }
|
|
98
98
|
static get encapsulation() { return "shadow"; }
|
|
@@ -16,7 +16,7 @@ export class CuraLoaderBar {
|
|
|
16
16
|
this.setProgress();
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
|
-
return (h(Host, { key: '
|
|
19
|
+
return (h(Host, { key: 'b24471535bdf9ada29ae81baa05f5c9abe7b79f9' }, h("div", { key: '15eb6b0b6abb45246c98d9e5957c492f44544062', id: "progress-bar", class: "progress-bar", style: this.styles }, h("span", { key: '032eee4ae4da0d5ad88f0df735d93ed37b8be26b', class: "progress-bar-fill" }))));
|
|
20
20
|
}
|
|
21
21
|
setColor() {
|
|
22
22
|
this.styles = Object.assign(Object.assign({}, this.styles), { '--neutral-base': window.CuraAPI.theme.colors.getColor(`neutral-base`, 0.2), '--color-base': window.CuraAPI.theme.colors.getColor(this.color) });
|
|
@@ -19,7 +19,7 @@ export class CuraLoaderCircle {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h(Host, { key: '
|
|
22
|
+
return (h(Host, { key: '9ef3dd91b5958a5aeb90fe51120f5d9cc768ca62', style: this.getStyles() }, h("svg", { key: '96b6a2ac1ee77c14b68ea7ee462bae4a122f0c1f', viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("g", { key: '01e9425e96b2f8b63a0115dfba358a46d86574c5' }, h("circle", { key: '5ba2e9d288de3b48d33c57ef9c8c282511683739', cx: "8", cy: "8", r: "7", stroke: "url(#paint0_linear_13485_11488)", "stroke-width": "2" }), h("path", { key: 'b2069b38fc2a810c6b838eb4c924619a14ef5648', d: "M1 8C1 4.13401 4.11877 1 7.96596 1C9.53445 1 10.9819 1.52093 12.1462 2.4C12.8959 2.96601 13.5282 3.68049 14 4.5", "stroke-width": "2" })), h("defs", { key: '4e04a92c3cb8ba0084112f1a14a7815317ca92c5' }, h("linearGradient", { key: '4369f1a5c6d66b37cc00ca88c3e5c77867867fbf', id: "paint0_linear_13485_11488", x1: "15.7", y1: "4.5", x2: "4.15", y2: "11.5", gradientUnits: "userSpaceOnUse" }, h("stop", { key: '224eac239fcd4f22e3ca7b044d89942757381b9e' }), h("stop", { key: '35236a39f2156fefea7878a60dd1e559d3d1f850', offset: "1" }))))));
|
|
23
23
|
}
|
|
24
24
|
static get is() { return "cura-loader-circle"; }
|
|
25
25
|
static get encapsulation() { return "shadow"; }
|
|
@@ -60,7 +60,7 @@ export class CuraDisplay {
|
|
|
60
60
|
return tags[`${this.level}`] || tags['default'];
|
|
61
61
|
}
|
|
62
62
|
render() {
|
|
63
|
-
return (h(Host, { key: '
|
|
63
|
+
return (h(Host, { key: '9d75215eaa43baaf9ca9aada36dfdbff4596afb2', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
64
64
|
}
|
|
65
65
|
static get is() { return "cura-display"; }
|
|
66
66
|
static get encapsulation() { return "shadow"; }
|
|
@@ -62,7 +62,7 @@ export class CuraHeading {
|
|
|
62
62
|
return tags[`${this.level}`] || tags['default'];
|
|
63
63
|
}
|
|
64
64
|
render() {
|
|
65
|
-
return (h(Host, { key: '
|
|
65
|
+
return (h(Host, { key: '83a6a2a08051c3654f609f0e1824f41f48a6ff83', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
66
66
|
}
|
|
67
67
|
static get is() { return "cura-heading"; }
|
|
68
68
|
static get encapsulation() { return "shadow"; }
|
|
@@ -45,7 +45,7 @@ export class CuraParagraph {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: 'fc146c5173887dd80bb1798d58b7fbe29775e2de', style: this.hostCSSProperties() }, h("p", { key: '0defc510c08182261e22a4ab47a24d939199db24', style: this.styles, class: this.setsizeClass() }, h("slot", { key: 'e70c68a1da0596dc8d2273f5679c9193a354e313' }))));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "cura-paragraph"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -159,7 +159,7 @@ const CuraCheckbox$1 = /*@__PURE__*/ proxyCustomElement(class CuraCheckbox exten
|
|
|
159
159
|
return h("cura-icon", { class: "icon", name: iconName, size: iconSize, color: iconColor });
|
|
160
160
|
}
|
|
161
161
|
render() {
|
|
162
|
-
return (h(Host, { key: '
|
|
162
|
+
return (h(Host, { key: '876fa0a7aa0fc7110cbf0ffeb2d95d529fa78e64' }, h("div", { key: '3e6d730765590ee75d7e045cadc7d03e5fc035e2', class: this.getClasses(), style: this.styles, onClick: this.handleClick }, h("div", { key: '0f7f6f3bc61a80e899d940d76fee266af1914f5a', class: "info" }, h("div", { key: 'a836cb0d7751a1a812364fe93a30403b02ec5c95', class: "label-wrapper" }, h("cura-label", { key: '5d180552ec71e22ddd8822727bd32d4167215f33', class: "label", weight: 'bold', size: this.size === 'large' ? 'medium' : 'xsmall', color: this.assignColor('label') }, this.label), this.required && h("cura-paragraph", { key: '047413aa21a28bc33984d19ad4dc10a38289c205', lineHeight: '0%', marginBlock: '0', color: "error-base" }, "* ")), h("cura-label", { key: '68c9dd6f228ec3204647795f1cae32a8f8797bc2', color: this.assignColor('message'), size: "xsmall", class: "message" }, h("slot", { key: '3a35a1219f135002f1b9ae64c0eb4227529bc904' }))), h("div", { key: 'fe969ee332b3c64a259ec552f411b5d2d4bc81e4', class: 'checkbox', tabIndex: this.ontabindex }, h("input", { key: '2cbcbe56130bddb5853cfcc3a8ef1b421f39bc7b', type: "checkbox", name: this.name, value: this.value, disabled: this.disabled, required: this.required, checked: this.checked, indeterminate: this.indeterminate }), this.getIcon()))));
|
|
163
163
|
}
|
|
164
164
|
static get formAssociated() { return true; }
|
|
165
165
|
get host() { return this; }
|
|
@@ -67,7 +67,7 @@ const CuraDisplay$1 = /*@__PURE__*/ proxyCustomElement(class CuraDisplay extends
|
|
|
67
67
|
return tags[`${this.level}`] || tags['default'];
|
|
68
68
|
}
|
|
69
69
|
render() {
|
|
70
|
-
return (h(Host, { key: '
|
|
70
|
+
return (h(Host, { key: '9d75215eaa43baaf9ca9aada36dfdbff4596afb2', style: this.hostCSSProperties() }, this.getHeadingTag()));
|
|
71
71
|
}
|
|
72
72
|
get host() { return this; }
|
|
73
73
|
static get watchers() { return {
|
|
@@ -11,7 +11,7 @@ const CuraDropdownSearchOptionTitle$1 = /*@__PURE__*/ proxyCustomElement(class C
|
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (h(Host, { key: '
|
|
14
|
+
return (h(Host, { key: 'ed1d2aeeba08c3c53f04f434fa46cb178271f405', slot: "dropdown-search-option" }, h("cura-label", { key: '910b1ada8d333ace0171a3180ba6320e813e4fce', color: "neutral-dark", size: "xsmall", lineHeight: "16px", marginBlock: "0" }, h("slot", { key: '20816c3a0c9805a88074f36e060ad850157427e2' }))));
|
|
15
15
|
}
|
|
16
16
|
static get style() { return CuraDropdownSearchOptionTitleStyle0; }
|
|
17
17
|
}, [1, "cura-dropdown-search-option-title"]);
|
|
@@ -45,12 +45,12 @@ const CuraDropdownSearchOption$1 = /*@__PURE__*/ proxyCustomElement(class CuraDr
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
|
-
return (h(Host, { key: '
|
|
48
|
+
return (h(Host, { key: '0dfb8d67f1aee692af5abdad170f2fc3e6c5ffc6', slot: "dropdown-search-option" }, h("div", { key: '6596c224bbfc0e9b5c3d2a39d064852019af5b74', style: this.styles, class: {
|
|
49
49
|
"option-container": true,
|
|
50
50
|
hovered: this.selectable ? this.hovered : false,
|
|
51
51
|
selected: this.selected,
|
|
52
52
|
disabled: !this.selectable
|
|
53
|
-
} }, h("div", { key: '
|
|
53
|
+
} }, h("div", { key: 'b73badabbcde37615c58707d8a62832363deb694', class: "content-container" }, h("div", { key: '6ea1e5cfa3aa5f7bb7d0a4a2c9c8aff6e076304c', class: "option-info", onClick: (e) => this.handleOptionClick(e) }, h("slot", { key: '9e6272b220a723fbc1b52a23f59873cb4eea0986', name: "image" }), h("cura-heading", { key: '4bec4f91fd5ef5759373d846c0876678e67b1b48', size: "xsmall", lineHeight: "16px", marginBlock: "0px", weight: "bold", color: "neutral-black" }, h("slot", { key: 'c485bfd68ddf4b5bcfa0c590c11344352939fe87' }))), h("slot", { key: '0ce8978f72401af3580c72919b6079ef222dcc0d', name: "action" })))));
|
|
54
54
|
}
|
|
55
55
|
get hostElement() { return this; }
|
|
56
56
|
static get watchers() { return {
|