@paperless/core 2.0.1-beta.35 → 2.0.1-beta.37
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 +143 -0
- package/dist/build/p-43992afc.js +2 -0
- package/dist/build/p-60f4b734.entry.js +2 -0
- package/dist/build/p-60f4b734.entry.js.map +1 -0
- package/dist/build/p-6db4ca89.entry.js +2 -0
- package/dist/build/p-6db4ca89.entry.js.map +1 -0
- package/dist/build/p-a9a85ce4.entry.js +2 -0
- package/dist/build/p-a9a85ce4.entry.js.map +1 -0
- package/dist/build/p-b3b50ed2.entry.js +2 -0
- package/dist/build/p-b3b50ed2.entry.js.map +1 -0
- package/dist/build/p-dc8258c0.entry.js +2 -0
- package/dist/build/p-dc8258c0.entry.js.map +1 -0
- package/dist/build/p-ff6356cb.entry.js +2 -0
- package/dist/build/p-ff6356cb.entry.js.map +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/build/paperless.esm.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-checkbox_2.cjs.entry.js +16 -11
- package/dist/cjs/p-checkbox_2.cjs.entry.js.map +1 -1
- package/dist/cjs/p-dropdown-menu-item_4.cjs.entry.js +1 -1
- package/dist/cjs/p-dropdown-menu-item_4.cjs.entry.js.map +1 -1
- package/dist/cjs/p-radio.cjs.entry.js +6 -15
- package/dist/cjs/p-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/p-select.cjs.entry.js +35 -26
- package/dist/cjs/p-select.cjs.entry.js.map +1 -1
- package/dist/cjs/p-stepper.cjs.entry.js +1 -1
- package/dist/cjs/p-stepper.cjs.entry.js.map +1 -1
- package/dist/cjs/p-toggle.cjs.entry.js +8 -43
- package/dist/cjs/p-toggle.cjs.entry.js.map +1 -1
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/collection/components/atoms/checkbox/checkbox.component.css +1 -1
- package/dist/collection/components/atoms/checkbox/checkbox.component.js +15 -30
- package/dist/collection/components/atoms/checkbox/checkbox.component.js.map +1 -1
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +1 -1
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js.map +1 -1
- package/dist/collection/components/atoms/radio/radio.component.css +1 -1
- package/dist/collection/components/atoms/radio/radio.component.js +5 -34
- package/dist/collection/components/atoms/radio/radio.component.js.map +1 -1
- package/dist/collection/components/atoms/toggle/toggle.component.css +1 -1
- package/dist/collection/components/atoms/toggle/toggle.component.js +7 -62
- package/dist/collection/components/atoms/toggle/toggle.component.js.map +1 -1
- package/dist/collection/components/molecules/select/select.component.css +1 -1
- package/dist/collection/components/molecules/select/select.component.js +80 -25
- package/dist/collection/components/molecules/select/select.component.js.map +1 -1
- package/dist/collection/components/molecules/stepper/stepper.component.css +1 -1
- package/dist/components/checkbox.component.js +16 -12
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/dropdown-menu-item.component.js +1 -1
- package/dist/components/dropdown-menu-item.component.js.map +1 -1
- package/dist/components/p-radio.js +6 -16
- package/dist/components/p-radio.js.map +1 -1
- package/dist/components/p-select.js +37 -26
- package/dist/components/p-select.js.map +1 -1
- package/dist/components/p-stepper.js +1 -1
- package/dist/components/p-stepper.js.map +1 -1
- package/dist/components/p-toggle.js +8 -44
- package/dist/components/p-toggle.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-checkbox_2.entry.js +16 -11
- package/dist/esm/p-checkbox_2.entry.js.map +1 -1
- package/dist/esm/p-dropdown-menu-item_4.entry.js +1 -1
- package/dist/esm/p-dropdown-menu-item_4.entry.js.map +1 -1
- package/dist/esm/p-radio.entry.js +6 -15
- package/dist/esm/p-radio.entry.js.map +1 -1
- package/dist/esm/p-select.entry.js +35 -26
- package/dist/esm/p-select.entry.js.map +1 -1
- package/dist/esm/p-stepper.entry.js +1 -1
- package/dist/esm/p-stepper.entry.js.map +1 -1
- package/dist/esm/p-toggle.entry.js +8 -43
- package/dist/esm/p-toggle.entry.js.map +1 -1
- package/dist/esm/paperless.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/p-60f4b734.entry.js +2 -0
- package/dist/paperless/p-60f4b734.entry.js.map +1 -0
- package/dist/paperless/p-6db4ca89.entry.js +2 -0
- package/dist/paperless/p-6db4ca89.entry.js.map +1 -0
- package/dist/paperless/p-a9a85ce4.entry.js +2 -0
- package/dist/paperless/p-a9a85ce4.entry.js.map +1 -0
- package/dist/paperless/p-b3b50ed2.entry.js +2 -0
- package/dist/paperless/p-b3b50ed2.entry.js.map +1 -0
- package/dist/paperless/p-dc8258c0.entry.js +2 -0
- package/dist/paperless/p-dc8258c0.entry.js.map +1 -0
- package/dist/paperless/p-ff6356cb.entry.js +2 -0
- package/dist/paperless/p-ff6356cb.entry.js.map +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/paperless/paperless.esm.js.map +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/atoms/checkbox/checkbox.component.d.ts +0 -4
- package/dist/types/components/atoms/radio/radio.component.d.ts +0 -4
- package/dist/types/components/atoms/toggle/toggle.component.d.ts +0 -4
- package/dist/types/components/molecules/select/select.component.d.ts +10 -0
- package/dist/types/components.d.ts +16 -24
- package/hydrate/index.js +69 -100
- package/hydrate/index.mjs +69 -100
- package/package.json +1 -1
- package/dist/build/p-2d43b7ce.entry.js +0 -2
- package/dist/build/p-2d43b7ce.entry.js.map +0 -1
- package/dist/build/p-489013c7.entry.js +0 -2
- package/dist/build/p-489013c7.entry.js.map +0 -1
- package/dist/build/p-8857d619.entry.js +0 -2
- package/dist/build/p-8857d619.entry.js.map +0 -1
- package/dist/build/p-99352ae4.entry.js +0 -2
- package/dist/build/p-99352ae4.entry.js.map +0 -1
- package/dist/build/p-cf0cc50e.js +0 -2
- package/dist/build/p-d2ddf504.entry.js +0 -2
- package/dist/build/p-d2ddf504.entry.js.map +0 -1
- package/dist/build/p-da44c5f3.entry.js +0 -2
- package/dist/build/p-da44c5f3.entry.js.map +0 -1
- package/dist/paperless/p-2d43b7ce.entry.js +0 -2
- package/dist/paperless/p-2d43b7ce.entry.js.map +0 -1
- package/dist/paperless/p-489013c7.entry.js +0 -2
- package/dist/paperless/p-489013c7.entry.js.map +0 -1
- package/dist/paperless/p-8857d619.entry.js +0 -2
- package/dist/paperless/p-8857d619.entry.js.map +0 -1
- package/dist/paperless/p-99352ae4.entry.js +0 -2
- package/dist/paperless/p-99352ae4.entry.js.map +0 -1
- package/dist/paperless/p-d2ddf504.entry.js +0 -2
- package/dist/paperless/p-d2ddf504.entry.js.map +0 -1
- package/dist/paperless/p-da44c5f3.entry.js +0 -2
- package/dist/paperless/p-da44c5f3.entry.js.map +0 -1
|
@@ -15,7 +15,7 @@ import { d as defineCustomElement$4 } from './loader.component.js';
|
|
|
15
15
|
import { d as defineCustomElement$3 } from './portal.component.js';
|
|
16
16
|
import { d as defineCustomElement$2 } from './tooltip.component.js';
|
|
17
17
|
|
|
18
|
-
const selectComponentCss = "*{box-sizing:border-box}.pointer-events-none{pointer-events:none!important}.pointer-events-auto{pointer-events:auto!important}.static{position:static!important}.relative{position:relative!important}.sticky{position:sticky!important}.top-0{top:0!important}.mb-3{margin-bottom:.75rem!important}.block{display:block!important}.flex{display:flex!important}.hidden{display:none!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.h-\\[1\\.625rem\\]{height:1.625rem!important}.h-full{height:100%!important}.w-6{width:1.5rem!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}.flex-1{flex:1 1 0%!important}.cursor-pointer{cursor:pointer!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.whitespace-nowrap{white-space:nowrap!important}.rounded{border-radius:.25rem!important}.rounded-lg{border-radius:.5rem!important}.bg-supportive-lilac-100{--tw-bg-opacity:1!important;background-color:rgb(246 239 255/var(--tw-bg-opacity,1))!important}.p-2{padding:.5rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.text-center{text-align:center!important}.text-start{text-align:start!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-semibold{font-weight:600!important}.text-black-teal-100{--tw-text-opacity:1!important;color:rgb(205 212 211/var(--tw-text-opacity,1))!important}.text-black-teal-400{--tw-text-opacity:1!important;color:rgb(53 85 80/var(--tw-text-opacity,1))!important}.text-supportive-lilac{--tw-text-opacity:1!important;color:rgb(209 174 255/var(--tw-text-opacity,1))!important}.text-teal-800{--tw-text-opacity:1!important;color:rgb(2 102 92/var(--tw-text-opacity,1))!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.group\\/item:hover .group-hover\\/item\\:text-supportive-lilac-800{--tw-text-opacity:1!important;color:rgb(189 140 255/var(--tw-text-opacity,1))!important}";
|
|
18
|
+
const selectComponentCss = "*{box-sizing:border-box}.pointer-events-none{pointer-events:none!important}.pointer-events-auto{pointer-events:auto!important}.static{position:static!important}.absolute{position:absolute!important}.relative{position:relative!important}.sticky{position:sticky!important}.top-0{top:0!important}.mb-3{margin-bottom:.75rem!important}.block{display:block!important}.flex{display:flex!important}.hidden{display:none!important}.h-6{height:1.5rem!important}.h-8{height:2rem!important}.h-\\[1\\.625rem\\]{height:1.625rem!important}.h-full{height:100%!important}.w-6{width:1.5rem!important}.w-full{width:100%!important}.min-w-0{min-width:0!important}.flex-1{flex:1 1 0%!important}.cursor-pointer{cursor:pointer!important}.items-center{align-items:center!important}.justify-center{justify-content:center!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.overflow-hidden{overflow:hidden!important}.text-ellipsis{text-overflow:ellipsis!important}.whitespace-nowrap{white-space:nowrap!important}.rounded{border-radius:.25rem!important}.rounded-lg{border-radius:.5rem!important}.bg-supportive-lilac-100{--tw-bg-opacity:1!important;background-color:rgb(246 239 255/var(--tw-bg-opacity,1))!important}.p-2{padding:.5rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.text-center{text-align:center!important}.text-start{text-align:start!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-semibold{font-weight:600!important}.text-black-teal-100{--tw-text-opacity:1!important;color:rgb(205 212 211/var(--tw-text-opacity,1))!important}.text-black-teal-400{--tw-text-opacity:1!important;color:rgb(53 85 80/var(--tw-text-opacity,1))!important}.text-supportive-lilac{--tw-text-opacity:1!important;color:rgb(209 174 255/var(--tw-text-opacity,1))!important}.text-teal-800{--tw-text-opacity:1!important;color:rgb(2 102 92/var(--tw-text-opacity,1))!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.group\\/item:hover .group-hover\\/item\\:text-supportive-lilac-800{--tw-text-opacity:1!important;color:rgb(189 140 255/var(--tw-text-opacity,1))!important}";
|
|
19
19
|
const PSelectStyle0 = selectComponentCss;
|
|
20
20
|
|
|
21
21
|
const multiContainer = cva([
|
|
@@ -51,6 +51,8 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
51
51
|
this.add = createEvent(this, "add", 3);
|
|
52
52
|
this.items = undefined;
|
|
53
53
|
this.multi = undefined;
|
|
54
|
+
this.usePortal = false;
|
|
55
|
+
this.strategy = 'absolute';
|
|
54
56
|
this.icon = undefined;
|
|
55
57
|
this.query = undefined;
|
|
56
58
|
this.placeholder = undefined;
|
|
@@ -120,28 +122,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
120
122
|
_resizeDebounceTimer;
|
|
121
123
|
_checkSelectedItemsTimeout;
|
|
122
124
|
get _items() {
|
|
123
|
-
|
|
124
|
-
return [];
|
|
125
|
-
}
|
|
126
|
-
let items = typeof this.items === 'string' ? JSON.parse(this.items) : this.items;
|
|
127
|
-
if (typeof items?.[0] === 'string') {
|
|
128
|
-
this.displayKey = 'text';
|
|
129
|
-
this.valueKey = 'value';
|
|
130
|
-
items = items.map(str => ({
|
|
131
|
-
value: str,
|
|
132
|
-
text: str,
|
|
133
|
-
}));
|
|
134
|
-
}
|
|
135
|
-
if (this.query?.length && !this.asyncFilter) {
|
|
136
|
-
items = items.filter(item => {
|
|
137
|
-
if (this.queryKey) {
|
|
138
|
-
return this._checkvalue(this.queryKey, item);
|
|
139
|
-
}
|
|
140
|
-
return (this._checkvalue(this._identifierKey, item) ||
|
|
141
|
-
this._checkvalue(this.displayKey, item));
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
return items?.slice(0, this.maxDisplayedItems);
|
|
125
|
+
return this._getParsedItems();
|
|
145
126
|
}
|
|
146
127
|
get _displayValue() {
|
|
147
128
|
const placeholder = (h("div", { class: textContainer({ variant: 'placeholder' }) }, this.placeholder));
|
|
@@ -194,7 +175,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
194
175
|
}
|
|
195
176
|
}
|
|
196
177
|
render() {
|
|
197
|
-
return (h(Host, { key: '
|
|
178
|
+
return (h(Host, { key: '5fca82e69df3bcdbff0b946c4ae1335f7bee738a', class: 'p-select' }, h("p-dropdown", { key: 'c5fab92fa37891c3bf00cd7d512a0c8484267e6b', disableTriggerClick: true, calculateWidth: true, insideClick: true, scrollable: this.enableAutocomplete ? 'large' : true, show: this._showDropdown, onIsOpen: ev => this._onDropdownOpen(ev), usePortal: this.usePortal, strategy: this.strategy }, h("p-field-container", { key: '85d39bac84e07e015c8d643a2f2372dfc259e9b6', slot: 'trigger', prefix: this.prefix, label: this.label, helper: this.helper, required: this.required, error: this.error, errorPlacement: 'top-start', forceShowTooltip: this.error?.length && this._showDropdown }, h("p-button", { key: '62659969a3ea8c096af2f288b19a313cd3063254', class: 'w-full', slot: 'content', variant: 'secondary', size: this.size, chevron: this.showChevron, disabled: this.disabled, active: this._showDropdown, icon: this.icon, onClick: ev => this._onClick(ev) }, h("div", { key: '8c1bb55bde3a7080f535c86709d010bd82a8c971', class: 'relative flex-1', ref: ref => (this._inputRef = ref) }, this._displayValue))), this.loading ? this._getLoadingItems() : this._getItems(), this.showAddItem && this._getAddItem())));
|
|
198
179
|
}
|
|
199
180
|
documentClickHandler({ target }) {
|
|
200
181
|
if (!this._showDropdown || childOf(target, this._el)) {
|
|
@@ -265,7 +246,8 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
265
246
|
this._selectValue(value, false);
|
|
266
247
|
return;
|
|
267
248
|
}
|
|
268
|
-
const
|
|
249
|
+
const items = this._getParsedItems(false);
|
|
250
|
+
const item = items.find(i => {
|
|
269
251
|
const itemIdentifier = i?.[this._identifierKey];
|
|
270
252
|
const parsedItemIdentifier = typeof itemIdentifier === 'string' || typeof itemIdentifier === 'number'
|
|
271
253
|
? itemIdentifier
|
|
@@ -428,7 +410,7 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
428
410
|
}
|
|
429
411
|
_getDisplay(item, isSelection = false) {
|
|
430
412
|
let content = (h("div", { class: textContainer({ variant: 'default' }) }, item[isSelection
|
|
431
|
-
? this.selectionDisplayKey ?? this.displayKey
|
|
413
|
+
? (this.selectionDisplayKey ?? this.displayKey)
|
|
432
414
|
: this.displayKey]));
|
|
433
415
|
if (this.avatarKey) {
|
|
434
416
|
content = (h("span", { class: 'flex items-center gap-2' }, h("p-avatar", { size: 'sm', src: item[this.avatarKey], letters: item[this.avatarLettersKey] }), h("div", { class: textContainer({ variant: 'default' }) }, item[this.dropdownDisplayKey ?? this.displayKey])));
|
|
@@ -442,6 +424,33 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
442
424
|
}
|
|
443
425
|
return content;
|
|
444
426
|
}
|
|
427
|
+
_getParsedItems(applyPagination = true) {
|
|
428
|
+
if (!this.items || this.loading) {
|
|
429
|
+
return [];
|
|
430
|
+
}
|
|
431
|
+
let items = typeof this.items === 'string' ? JSON.parse(this.items) : this.items;
|
|
432
|
+
if (typeof items?.[0] === 'string') {
|
|
433
|
+
this.displayKey = 'text';
|
|
434
|
+
this.valueKey = 'value';
|
|
435
|
+
items = items.map(str => ({
|
|
436
|
+
value: str,
|
|
437
|
+
text: str,
|
|
438
|
+
}));
|
|
439
|
+
}
|
|
440
|
+
if (this.query?.length && !this.asyncFilter) {
|
|
441
|
+
items = items.filter(item => {
|
|
442
|
+
if (this.queryKey) {
|
|
443
|
+
return this._checkvalue(this.queryKey, item);
|
|
444
|
+
}
|
|
445
|
+
return (this._checkvalue(this._identifierKey, item) ||
|
|
446
|
+
this._checkvalue(this.displayKey, item));
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
if (!applyPagination) {
|
|
450
|
+
return items;
|
|
451
|
+
}
|
|
452
|
+
return items?.slice(0, this.maxDisplayedItems);
|
|
453
|
+
}
|
|
445
454
|
static get watchers() { return {
|
|
446
455
|
"value": ["_valueChange"],
|
|
447
456
|
"items": ["itemChanges"],
|
|
@@ -452,6 +461,8 @@ const Select = /*@__PURE__*/ proxyCustomElement(class Select extends HTMLElement
|
|
|
452
461
|
}, [0, "p-select", {
|
|
453
462
|
"items": [1],
|
|
454
463
|
"multi": [516],
|
|
464
|
+
"usePortal": [4, "use-portal"],
|
|
465
|
+
"strategy": [1],
|
|
455
466
|
"icon": [1],
|
|
456
467
|
"query": [1],
|
|
457
468
|
"placeholder": [1],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-select.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,kzEAA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AAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAgB,GAAI,EACtD,WAAK,KAAK,EAAE,aAAa,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,IAC/C,IAAI,CAAC,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,UAAU,CAAC,CAC5C,CACA,CACP,CAAC;SACF;QAED,IACC,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,wBAAwB;YAC9C,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EACpB;YACD,OAAO,WAAK,KAAK,EAAE,IAAI,CAAC,KAAK,IAAG,OAAO,CAAO,CAAC;SAC/C;QAED,OAAO,OAAO,CAAC;KACf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/select/select.component.css?tag=p-select","src/components/molecules/select/select.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\nimport { cva } from 'class-variance-authority';\n\nconst multiContainer = cva([\n\t'flex items-center gap-2',\n\t'flex-1 min-w-0 h-full',\n\t'pointer-events-none overflow-hidden',\n]);\n\nconst multiItem = cva([\n\t'item group/item',\n\t'pointer-events-auto cursor-pointer',\n\t'flex h-[1.625rem] items-center gap-2',\n\t'h-[1.625rem] px-2',\n\t'text-sm font-semibold whitespace-nowrap',\n\t'rounded-lg',\n\t'bg-supportive-lilac-100',\n]);\n\nconst textContainer = cva(\n\t'block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start',\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tplaceholder: 'text-black-teal-400',\n\t\t\t\tdefault: null,\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-select',\n\tstyleUrl: 'select.component.css',\n})\nexport class Select {\n\t/**\n\t * The items to show in the dropdown\n\t */\n\t@Prop() items: string | any[];\n\n\t/**\n\t * Wether to enable multi select\n\t */\n\t@Prop({ reflect: true }) multi: boolean;\n\n\t/**\n\t * Icon of the select box\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * The current query\n\t */\n\t@Prop() query: string;\n\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The placeholder of the input used for auto complete\n\t */\n\t@Prop() autocompletePlaceholder: string = 'Search...';\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: any;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() displayKey: string = 'text';\n\n\t/**\n\t * The key of the object to display in the dropdown (overwrites displayKey)\n\t */\n\t@Prop() dropdownDisplayKey: string | undefined;\n\n\t/**\n\t * The key of the object to display in the input (overwrites displayKey)\n\t */\n\t@Prop() selectionDisplayKey: string | undefined;\n\n\t/**\n\t * The key of the object to return\n\t */\n\t@Prop() valueKey: string;\n\n\t/**\n\t * The key of avatar within an item to show\n\t */\n\t@Prop() avatarKey: string;\n\n\t/**\n\t * The key of icon variant within an item to show\n\t */\n\t@Prop() iconKey: string;\n\n\t/**\n\t * Wether to show the icon also on the selected Item\n\t */\n\t@Prop() showIconInSelectedItem: string;\n\n\t/**\n\t * The key of a class in an item to apply\n\t */\n\t@Prop() classKey: string = 'class';\n\n\t/**\n\t * Wether to apply the item's class also on the selected item\n\t */\n\t@Prop() applyClassOnSelectedItem: string;\n\n\t/**\n\t * The key of avatar letters within an item to show when the avatar url doesn't work\n\t */\n\t@Prop() avatarLettersKey: string;\n\n\t/**\n\t * The key to identify an object\n\t */\n\t@Prop() identifierKey: string;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() queryKey?: string;\n\n\t/**\n\t * Wether to automatically select the first item\n\t */\n\t@Prop() autoSelectFirst: boolean = true;\n\n\t/**\n\t * Wether to show the chevron or not\n\t */\n\t@Prop() showChevron: boolean = true;\n\n\t/**\n\t * The maximum amount of items to display\n\t */\n\t@Prop() maxDisplayedItems: number = 10;\n\n\t/**\n\t * Wether to enable autocomplete\n\t */\n\t@Prop() enableAutocomplete: boolean = true;\n\n\t/**\n\t * Wether the input uses async filtering\n\t */\n\t@Prop() asyncFilter: boolean = false;\n\n\t/**\n\t * Wether to show loading items\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether to show the select all item with multi select\n\t */\n\t@Prop() enableSelectAll: boolean = false;\n\n\t/**\n\t * The text of the select all item\n\t */\n\t@Prop() selectAllText: string = 'Select all';\n\n\t/**\n\t * The icon to prefix for select all\n\t */\n\t@Prop() selectAllIcon: IconVariant | undefined;\n\n\t/**\n\t * Event when the query of the autocomplete changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tqueryChange: EventEmitter<string>;\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the select all item has been selected or not\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tselectAllChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the dropdown shows\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdropdownShown: EventEmitter<any>;\n\n\t/**\n\t * The size of the input group used by the select\n\t */\n\t@Prop() size: 'sm' | 'base' = 'base';\n\n\t/**\n\t * The prefix of the input group used by the select\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the select\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the select\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether to show a \"add\" item\n\t */\n\t@Prop() showAddItem: boolean = false;\n\n\t/**\n\t * The text to show when add item is being shown\n\t */\n\t@Prop() addItemText: string = 'Add item';\n\n\t/**\n\t * Event when the add item is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tadd: EventEmitter;\n\n\t/**\n\t * The text to show when items is empty\n\t */\n\t@Prop() emptyStateText: string = 'No items available';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _selectedItem: any = null;\n\n\t@State() private _allSelected: boolean = false;\n\n\t@State() private _amountHidden = 0;\n\n\tprivate _inputRef: HTMLDivElement;\n\tprivate autocompleteInputRef: HTMLInputElement | HTMLTextAreaElement;\n\tprivate _multiContainerRef: HTMLElement;\n\n\tprivate _resizeObserver: ResizeObserver;\n\tprivate _resizeDebounceTimer: NodeJS.Timeout | undefined;\n\tprivate _checkSelectedItemsTimeout: NodeJS.Timeout | undefined;\n\n\tget _items() {\n\t\tif (!this.items || this.loading) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet items =\n\t\t\ttypeof this.items === 'string' ? JSON.parse(this.items) : this.items;\n\n\t\tif (typeof items?.[0] === 'string') {\n\t\t\tthis.displayKey = 'text';\n\t\t\tthis.valueKey = 'value';\n\n\t\t\titems = items.map(str => ({\n\t\t\t\tvalue: str,\n\t\t\t\ttext: str,\n\t\t\t}));\n\t\t}\n\n\t\tif (this.query?.length && !this.asyncFilter) {\n\t\t\titems = items.filter(item => {\n\t\t\t\tif (this.queryKey) {\n\t\t\t\t\treturn this._checkvalue(this.queryKey, item);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tthis._checkvalue(this._identifierKey, item) ||\n\t\t\t\t\tthis._checkvalue(this.displayKey, item)\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\treturn items?.slice(0, this.maxDisplayedItems);\n\t}\n\n\tget _displayValue() {\n\t\tconst placeholder = (\n\t\t\t<div class={textContainer({ variant: 'placeholder' })}>\n\t\t\t\t{this.placeholder}\n\t\t\t</div>\n\t\t);\n\n\t\tif (!this._selectedItem) {\n\t\t\treturn placeholder;\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tif (this._selectedItem?.length === 0) {\n\t\t\t\treturn placeholder;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclass={multiContainer()}\n\t\t\t\t\tref={ref => (this._multiContainerRef = ref)}\n\t\t\t\t>\n\t\t\t\t\t{this._selectedItem.map(item => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={multiItem()}\n\t\t\t\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item[this.selectionDisplayKey ?? this.displayKey]}\n\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\tclass='text-xs text-supportive-lilac group-hover/item:text-supportive-lilac-800'\n\t\t\t\t\t\t\t\tvariant='negative'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\n\t\t\t\t\t<div class='extra pointer-events-none hidden text-sm text-black-teal-100'>\n\t\t\t\t\t\t+{this._amountHidden}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn this._getDisplay(this._selectedItem, true);\n\t}\n\n\tget _identifierKey() {\n\t\treturn this.identifierKey ?? this.valueKey ?? 'value';\n\t}\n\n\tcomponentDidLoad() {\n\t\tif (!this.valueKey && !this.identifierKey) {\n\t\t\tthrow new Error('You must provide a valueKey or identifierKey');\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\n\t\t\tthis._resizeObserver = new ResizeObserver(() => {\n\t\t\t\tif (this._resizeDebounceTimer) {\n\t\t\t\t\tclearTimeout(this._resizeDebounceTimer);\n\t\t\t\t\tthis._resizeDebounceTimer = null;\n\t\t\t\t}\n\n\t\t\t\tthis._resizeDebounceTimer = setTimeout(() => {\n\t\t\t\t\tthis._setMultiContainerMaxWidth();\n\t\t\t\t\tthis._setCheckSelectedItemsTimeout();\n\t\t\t\t}, 200);\n\t\t\t});\n\t\t\tthis._resizeObserver.observe(this._el);\n\t\t}\n\n\t\tif (this.value) {\n\t\t\tthis._valueChange();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.itemChanges();\n\t}\n\n\tcomponentDidRender() {\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this.multi) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-select'>\n\t\t\t\t<p-dropdown\n\t\t\t\t\tdisableTriggerClick={true}\n\t\t\t\t\tcalculateWidth={true}\n\t\t\t\t\tinsideClick={true}\n\t\t\t\t\tscrollable={this.enableAutocomplete ? 'large' : true}\n\t\t\t\t\tshow={this._showDropdown}\n\t\t\t\t\tonIsOpen={ev => this._onDropdownOpen(ev)}\n\t\t\t\t>\n\t\t\t\t\t<p-field-container\n\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\t\tlabel={this.label}\n\t\t\t\t\t\thelper={this.helper}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\terror={this.error}\n\t\t\t\t\t\terrorPlacement='top-start'\n\t\t\t\t\t\tforceShowTooltip={this.error?.length && this._showDropdown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tclass='w-full'\n\t\t\t\t\t\t\tslot='content'\n\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tchevron={this.showChevron}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tactive={this._showDropdown}\n\t\t\t\t\t\t\ticon={this.icon}\n\t\t\t\t\t\t\tonClick={ev => this._onClick(ev)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass='relative flex-1'\n\t\t\t\t\t\t\t\tref={ref => (this._inputRef = ref)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{this._displayValue}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t</p-field-container>\n\t\t\t\t\t{this.loading ? this._getLoadingItems() : this._getItems()}\n\t\t\t\t\t{this.showAddItem && this._getAddItem()}\n\t\t\t\t</p-dropdown>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\t@Watch('value')\n\tprivate _valueChange() {\n\t\tsetTimeout(() => {\n\t\t\tthis._preselectItem();\n\t\t\tthis._setCheckSelectedItemsTimeout();\n\t\t});\n\t}\n\n\t@Watch('items')\n\tpublic itemChanges() {\n\t\tsetTimeout(() => this._preselectItem());\n\t}\n\n\t@Watch('_showDropdown')\n\tpublic _showDropdownChanges() {\n\t\tthis.dropdownShown.emit({\n\t\t\tvalue: this._showDropdown,\n\t\t\tquery: this.query,\n\t\t});\n\t}\n\n\t@Watch('multi')\n\tpublic multiChanges() {\n\t\tif (this._selectedItem && !Array.isArray(this._selectedItem)) {\n\t\t\tthis._selectedItem = [];\n\t\t}\n\t}\n\n\tprivate _preselectItem() {\n\t\tlet value =\n\t\t\ttypeof this.value === 'string' && this.multi\n\t\t\t\t? JSON.parse(this.value)\n\t\t\t\t: this.value;\n\n\t\tif (this.multi) {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthis.value = [];\n\t\t\t\tthis.valueChange.emit(this.value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t\tif (!value.length) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._selectedItem =\n\t\t\t\t!!this.valueKey && this.valueKey !== 'false'\n\t\t\t\t\t? this._items.filter(i => value.includes(i?.[this.valueKey]))\n\t\t\t\t\t: [...value];\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._selectedItem && !value && this.autoSelectFirst) {\n\t\t\tvalue = this._items[0];\n\t\t}\n\n\t\tconst identifier =\n\t\t\ttypeof value === 'object' && value !== null\n\t\t\t\t? value[this._identifierKey]\n\t\t\t\t: value;\n\t\tconst parsedValue =\n\t\t\ttypeof identifier === 'string' || typeof identifier === 'number'\n\t\t\t\t? identifier\n\t\t\t\t: JSON.stringify(identifier);\n\n\t\tconst currentValue = this._selectedItem\n\t\t\t? this._selectedItem?.[this._identifierKey]\n\t\t\t: null;\n\t\tconst currentParsedValue =\n\t\t\ttypeof currentValue === 'string' || typeof currentValue === 'number'\n\t\t\t\t? currentValue\n\t\t\t\t: JSON.stringify(currentValue);\n\n\t\tif (this._selectedItem && currentParsedValue === parsedValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._items?.length && value) {\n\t\t\tthis._selectValue(value, false);\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = this._items.find(i => {\n\t\t\tconst itemIdentifier = i?.[this._identifierKey];\n\t\t\tconst parsedItemIdentifier =\n\t\t\t\ttypeof itemIdentifier === 'string' || typeof itemIdentifier === 'number'\n\t\t\t\t\t? itemIdentifier\n\t\t\t\t\t: JSON.stringify(itemIdentifier);\n\n\t\t\treturn parsedItemIdentifier === parsedValue;\n\t\t});\n\n\t\tthis._selectValue(!!item ? item : value, false);\n\t}\n\n\tprivate _selectValue(item, forceBlur = true) {\n\t\tlet value =\n\t\t\t!!this.valueKey && this.valueKey !== 'false' && item !== null\n\t\t\t\t? item?.[this.valueKey]\n\t\t\t\t: item;\n\n\t\tif (this.multi) {\n\t\t\tif (!this._selectedItem || !Array.isArray(this._selectedItem)) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t}\n\n\t\t\tif (!this.value || !Array.isArray(this.value)) {\n\t\t\t\tthis.value = [];\n\t\t\t}\n\n\t\t\tconst selectedItem = [...this._selectedItem];\n\t\t\tconst valueArray = [...this.value];\n\n\t\t\tconst includesIndex = selectedItem.findIndex(\n\t\t\t\ti => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t);\n\t\t\tif (includesIndex === -1) {\n\t\t\t\tselectedItem.push(item);\n\t\t\t\tvalueArray.push(value);\n\t\t\t} else {\n\t\t\t\tselectedItem.splice(includesIndex, 1);\n\t\t\t\tvalueArray.splice(includesIndex, 1);\n\t\t\t}\n\n\t\t\tthis._selectedItem = selectedItem;\n\t\t\tthis.value = valueArray;\n\t\t\tthis.valueChange.emit(valueArray);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._selectedItem = item;\n\t\tthis.value = value;\n\t\tthis.valueChange.emit(value);\n\n\t\tthis._onBlur(forceBlur);\n\t}\n\n\tprivate _findOnClickTarget(target: HTMLElement) {\n\t\tif (target.nodeName.toLowerCase() === 'p-button') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (target.classList.contains('item')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this._findOnClickTarget(target.parentElement);\n\t}\n\n\tprivate _onClick(ev) {\n\t\tif (!this._findOnClickTarget(ev.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = !this._showDropdown;\n\t}\n\n\tprivate _onBlur(force = false) {\n\t\tif (this.enableAutocomplete && !force) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onAutoComplete(ev) {\n\t\tif (!this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = true;\n\n\t\tthis.query = ev.detail;\n\t\tthis.queryChange.emit(ev.detail);\n\t}\n\n\tprivate _checkvalue(key, item) {\n\t\treturn (\n\t\t\titem?.[key]\n\t\t\t\t?.toString()\n\t\t\t\t?.toLowerCase()\n\t\t\t\t.indexOf(this.query?.toLowerCase()) >= 0\n\t\t);\n\t}\n\n\tprivate _getItems() {\n\t\tlet items = this._items.map(item => (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tuseContainer={false}\n\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\tactive={\n\t\t\t\t\tthis.multi &&\n\t\t\t\t\t!!this._selectedItem &&\n\t\t\t\t\tArray.isArray(this._selectedItem)\n\t\t\t\t\t\t? this._selectedItem.findIndex(\n\t\t\t\t\t\t\t\ti => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t\t\t\t ) >= 0\n\t\t\t\t\t\t: item[this._identifierKey] ===\n\t\t\t\t\t\t this._selectedItem?.[this._identifierKey]\n\t\t\t\t}\n\t\t\t\tcheckbox={this.multi ? true : false}\n\t\t\t\tslot='items'\n\t\t\t>\n\t\t\t\t{this._getDisplay(item)}\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\n\t\tif (!this._items.length) {\n\t\t\titems = [\n\t\t\t\t<p\n\t\t\t\t\tclass='w-full p-2 text-center text-sm text-black-teal-400'\n\t\t\t\t\tslot='items'\n\t\t\t\t>\n\t\t\t\t\t{this.emptyStateText}\n\t\t\t\t</p>,\n\t\t\t];\n\t\t}\n\n\t\tif (this.enableSelectAll && this._items.length) {\n\t\t\titems.unshift(\n\t\t\t\t<p-dropdown-menu-item\n\t\t\t\t\tslot='items'\n\t\t\t\t\tuseContainer={false}\n\t\t\t\t\tcheckbox\n\t\t\t\t\tonClick={() => this._selectAllChange()}\n\t\t\t\t\tactive={this._allSelected}\n\t\t\t\t>\n\t\t\t\t\t{this.selectAllIcon?.length ? (\n\t\t\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t\t\t<div class='flex w-6 justify-center text-lg'>\n\t\t\t\t\t\t\t\t<p-icon variant={this.selectAllIcon} />\n\t\t\t\t\t\t\t</div>{' '}\n\t\t\t\t\t\t\t{this.selectAllText}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.selectAllText\n\t\t\t\t\t)}\n\t\t\t\t</p-dropdown-menu-item>\n\t\t\t);\n\t\t}\n\n\t\tif (this.enableAutocomplete) {\n\t\t\titems.unshift(this._getAutoCompleteItem());\n\t\t}\n\n\t\treturn items;\n\t}\n\n\tprivate _getAddItem() {\n\t\treturn (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tonClick={() => this.add.emit()}\n\t\t\t\tuseContainer={false}\n\t\t\t\tslot='items'\n\t\t\t>\n\t\t\t\t<span class='flex items-center gap-1 font-semibold text-teal-800'>\n\t\t\t\t\t{this.addItemText}\n\t\t\t\t\t<p-icon variant='plus' />\n\t\t\t\t</span>\n\t\t\t</p-dropdown-menu-item>\n\t\t);\n\t}\n\n\tprivate _getLoadingItems() {\n\t\tconst items = [0, 0, 0].map(() => (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tenableHover={false}\n\t\t\t\tslot='items'\n\t\t\t>\n\t\t\t\t<p-loader\n\t\t\t\t\tvariant='ghost'\n\t\t\t\t\tclass='h-6 w-full rounded'\n\t\t\t\t/>\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\n\t\tif (this.enableAutocomplete) {\n\t\t\titems.unshift(this._getAutoCompleteItem());\n\t\t}\n\n\t\treturn items;\n\t}\n\n\tprivate _getAutoCompleteItem() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass='sticky top-0 mb-3 h-8'\n\t\t\t\tslot='items'\n\t\t\t>\n\t\t\t\t<p-field\n\t\t\t\t\tclass='block'\n\t\t\t\t\tplaceholder={this.autocompletePlaceholder}\n\t\t\t\t\tonValueChange={ev => this._onAutoComplete(ev)}\n\t\t\t\t\tonInputRefChange={ev => (this.autocompleteInputRef = ev.detail)}\n\t\t\t\t\tvalue={this.query}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _setMultiContainerMaxWidth() {\n\t\tif (!this._inputRef || !this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._multiContainerRef.style.maxWidth = `${\n\t\t\tthis._inputRef.clientWidth - 16\n\t\t}px`;\n\t}\n\n\tprivate _setCheckSelectedItemsTimeout() {\n\t\tif (this._checkSelectedItemsTimeout) {\n\t\t\tclearTimeout(this._checkSelectedItemsTimeout);\n\t\t}\n\n\t\tthis._checkSelectedItemsTimeout = setTimeout(\n\t\t\t() => this._checkSelectedItems(),\n\t\t\t50\n\t\t);\n\t}\n\n\tprivate _checkSelectedItems() {\n\t\tif (!this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst containerRect = this._multiContainerRef.getBoundingClientRect();\n\t\tconst items = this._multiContainerRef.querySelectorAll('.item');\n\n\t\tlet amountHidden = 0;\n\n\t\tfor (const child of items) {\n\t\t\tchild.classList.remove('hidden');\n\t\t\tchild.classList.add('flex');\n\n\t\t\tconst childRect = child.getBoundingClientRect();\n\t\t\tif (childRect.right > containerRect.right) {\n\t\t\t\tchild.classList.remove('flex');\n\t\t\t\tchild.classList.add('hidden');\n\t\t\t\tamountHidden++;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tthis._amountHidden = amountHidden;\n\t\tconst extra = this._multiContainerRef.querySelector('.extra');\n\t\tif (!extra) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!extra.classList.contains('hidden')) {\n\t\t\textra.classList.add('hidden');\n\t\t}\n\n\t\tif (amountHidden > 0) {\n\t\t\textra.classList.remove('hidden');\n\t\t}\n\t}\n\n\tprivate _onDropdownOpen(ev) {\n\t\tif (!ev.detail || !this.autocompleteInputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.autocompleteInputRef.focus();\n\t}\n\n\tprivate _selectAllChange() {\n\t\tthis._allSelected = !this._allSelected;\n\t\tthis.selectAllChange.emit(this._allSelected);\n\t}\n\n\tprivate _getDisplay(item, isSelection = false) {\n\t\tlet content = (\n\t\t\t<div class={textContainer({ variant: 'default' })}>\n\t\t\t\t{\n\t\t\t\t\titem[\n\t\t\t\t\t\tisSelection\n\t\t\t\t\t\t\t? this.selectionDisplayKey ?? this.displayKey\n\t\t\t\t\t\t\t: this.displayKey\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t</div>\n\t\t);\n\n\t\tif (this.avatarKey) {\n\t\t\tcontent = (\n\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t<p-avatar\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tsrc={item[this.avatarKey]}\n\t\t\t\t\t\tletters={item[this.avatarLettersKey]}\n\t\t\t\t\t></p-avatar>\n\t\t\t\t\t<div class={textContainer({ variant: 'default' })}>\n\t\t\t\t\t\t{item[this.dropdownDisplayKey ?? this.displayKey]}\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\n\t\tif (this.iconKey && (!isSelection || this.showIconInSelectedItem)) {\n\t\t\tcontent = (\n\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t<p-icon variant={item[this.iconKey] as IconVariant} />\n\t\t\t\t\t<div class={textContainer({ variant: 'default' })}>\n\t\t\t\t\t\t{item[this.dropdownDisplayKey ?? this.displayKey]}\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t(!isSelection || this.applyClassOnSelectedItem) &&\n\t\t\t!!item?.class?.length\n\t\t) {\n\t\t\treturn <div class={item.class}>{content}</div>;\n\t\t}\n\n\t\treturn content;\n\t}\n}\n"],"version":3}
|
|
1
|
+
{"file":"p-select.js","mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,kBAAkB,GAAG,w1EAAw1E,CAAC;AACp3E,sBAAe,kBAAkB;;ACiBjC,MAAM,cAAc,GAAG,GAAG,CAAC;IAC1B,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GAAG,KAAK;gBACzB,KAAK,EAAE,GAAG;gBACV,IAAI,EAAE,GAAG;aACT,CAAC,CAAC,CAAC;SACJ;QAED,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YAC5C,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI;gBACxB,IAAI,IAAI,CAAC,QAAQ,EAAE;oBAClB,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;iBAC7C;gBAED,QACC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC;oBAC3C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EACtC;aACF,CAAC,CAAC;SACH;QAED,IAAI,CAAC,eAAe,EAAE;YACrB,OAAO,KAAK,CAAC;SACb;QAED,OAAO,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;KAC/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/select/select.component.css?tag=p-select","src/components/molecules/select/select.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tElement,\n\tEvent,\n\tEventEmitter,\n\th,\n\tHost,\n\tListen,\n\tProp,\n\tState,\n\tWatch,\n} from '@stencil/core';\nimport { childOf } from '../../../utils';\nimport { IconVariant } from '../../atoms/icon/icon.component';\nimport { Strategy } from '@floating-ui/dom';\n\nimport { cva } from 'class-variance-authority';\n\nconst multiContainer = cva([\n\t'flex items-center gap-2',\n\t'flex-1 min-w-0 h-full',\n\t'pointer-events-none overflow-hidden',\n]);\n\nconst multiItem = cva([\n\t'item group/item',\n\t'pointer-events-auto cursor-pointer',\n\t'flex h-[1.625rem] items-center gap-2',\n\t'h-[1.625rem] px-2',\n\t'text-sm font-semibold whitespace-nowrap',\n\t'rounded-lg',\n\t'bg-supportive-lilac-100',\n]);\n\nconst textContainer = cva(\n\t'block w-full overflow-hidden text-ellipsis whitespace-nowrap text-start',\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tplaceholder: 'text-black-teal-400',\n\t\t\t\tdefault: null,\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-select',\n\tstyleUrl: 'select.component.css',\n})\nexport class Select {\n\t/**\n\t * The items to show in the dropdown\n\t */\n\t@Prop() items: string | any[];\n\n\t/**\n\t * Wether to enable multi select\n\t */\n\t@Prop({ reflect: true }) multi: boolean;\n\n\t/**\n\t * Wether to use a portal for the dropdown container of the select\n\t */\n\t@Prop() usePortal: boolean = false;\n\n\t/**\n\t * The strategy to use for the dropdown placement\n\t */\n\t@Prop() strategy: Strategy = 'absolute';\n\n\t/**\n\t * Icon of the select box\n\t */\n\t@Prop() icon: IconVariant;\n\n\t/**\n\t * The current query\n\t */\n\t@Prop() query: string;\n\n\t/**\n\t * The placeholder of the input\n\t */\n\t@Prop() placeholder: string;\n\n\t/**\n\t * The placeholder of the input used for auto complete\n\t */\n\t@Prop() autocompletePlaceholder: string = 'Search...';\n\n\t/**\n\t * The current value\n\t */\n\t@Prop() value: any;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() displayKey: string = 'text';\n\n\t/**\n\t * The key of the object to display in the dropdown (overwrites displayKey)\n\t */\n\t@Prop() dropdownDisplayKey: string | undefined;\n\n\t/**\n\t * The key of the object to display in the input (overwrites displayKey)\n\t */\n\t@Prop() selectionDisplayKey: string | undefined;\n\n\t/**\n\t * The key of the object to return\n\t */\n\t@Prop() valueKey: string;\n\n\t/**\n\t * The key of avatar within an item to show\n\t */\n\t@Prop() avatarKey: string;\n\n\t/**\n\t * The key of icon variant within an item to show\n\t */\n\t@Prop() iconKey: string;\n\n\t/**\n\t * Wether to show the icon also on the selected Item\n\t */\n\t@Prop() showIconInSelectedItem: string;\n\n\t/**\n\t * The key of a class in an item to apply\n\t */\n\t@Prop() classKey: string = 'class';\n\n\t/**\n\t * Wether to apply the item's class also on the selected item\n\t */\n\t@Prop() applyClassOnSelectedItem: string;\n\n\t/**\n\t * The key of avatar letters within an item to show when the avatar url doesn't work\n\t */\n\t@Prop() avatarLettersKey: string;\n\n\t/**\n\t * The key to identify an object\n\t */\n\t@Prop() identifierKey: string;\n\n\t/**\n\t * The key of the object to display\n\t */\n\t@Prop() queryKey?: string;\n\n\t/**\n\t * Wether to automatically select the first item\n\t */\n\t@Prop() autoSelectFirst: boolean = true;\n\n\t/**\n\t * Wether to show the chevron or not\n\t */\n\t@Prop() showChevron: boolean = true;\n\n\t/**\n\t * The maximum amount of items to display\n\t */\n\t@Prop() maxDisplayedItems: number = 10;\n\n\t/**\n\t * Wether to enable autocomplete\n\t */\n\t@Prop() enableAutocomplete: boolean = true;\n\n\t/**\n\t * Wether the input uses async filtering\n\t */\n\t@Prop() asyncFilter: boolean = false;\n\n\t/**\n\t * Wether to show loading items\n\t */\n\t@Prop() loading: boolean = false;\n\n\t/**\n\t * Wether to show the select all item with multi select\n\t */\n\t@Prop() enableSelectAll: boolean = false;\n\n\t/**\n\t * The text of the select all item\n\t */\n\t@Prop() selectAllText: string = 'Select all';\n\n\t/**\n\t * The icon to prefix for select all\n\t */\n\t@Prop() selectAllIcon: IconVariant | undefined;\n\n\t/**\n\t * Event when the query of the autocomplete changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tqueryChange: EventEmitter<string>;\n\n\t/**\n\t * Event when the value changes\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tvalueChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the select all item has been selected or not\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tselectAllChange: EventEmitter<any>;\n\n\t/**\n\t * Event when the dropdown shows\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tdropdownShown: EventEmitter<any>;\n\n\t/**\n\t * The size of the input group used by the select\n\t */\n\t@Prop() size: 'sm' | 'base' = 'base';\n\n\t/**\n\t * The prefix of the input group used by the select\n\t */\n\t@Prop() prefix: string;\n\n\t/**\n\t * The label of the input group used by the select\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop() helper: string;\n\n\t/**\n\t * Wether the field is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The helper of the input group used by the select\n\t */\n\t@Prop({ reflect: true }) error: string;\n\n\t/**\n\t * Wether the input group is disabled used by the select\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether to show a \"add\" item\n\t */\n\t@Prop() showAddItem: boolean = false;\n\n\t/**\n\t * The text to show when add item is being shown\n\t */\n\t@Prop() addItemText: string = 'Add item';\n\n\t/**\n\t * Event when the add item is clicked\n\t */\n\t@Event({\n\t\tbubbles: false,\n\t})\n\tadd: EventEmitter;\n\n\t/**\n\t * The text to show when items is empty\n\t */\n\t@Prop() emptyStateText: string = 'No items available';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\t@State() private _showDropdown: any = false;\n\t@State() private _selectedItem: any = null;\n\n\t@State() private _allSelected: boolean = false;\n\n\t@State() private _amountHidden = 0;\n\n\tprivate _inputRef: HTMLDivElement;\n\tprivate autocompleteInputRef: HTMLInputElement | HTMLTextAreaElement;\n\tprivate _multiContainerRef: HTMLElement;\n\n\tprivate _resizeObserver: ResizeObserver;\n\tprivate _resizeDebounceTimer: NodeJS.Timeout | undefined;\n\tprivate _checkSelectedItemsTimeout: NodeJS.Timeout | undefined;\n\n\tget _items() {\n\t\treturn this._getParsedItems();\n\t}\n\n\tget _displayValue() {\n\t\tconst placeholder = (\n\t\t\t<div class={textContainer({ variant: 'placeholder' })}>\n\t\t\t\t{this.placeholder}\n\t\t\t</div>\n\t\t);\n\n\t\tif (!this._selectedItem) {\n\t\t\treturn placeholder;\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tif (this._selectedItem?.length === 0) {\n\t\t\t\treturn placeholder;\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tclass={multiContainer()}\n\t\t\t\t\tref={ref => (this._multiContainerRef = ref)}\n\t\t\t\t>\n\t\t\t\t\t{this._selectedItem.map(item => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={multiItem()}\n\t\t\t\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{item[this.selectionDisplayKey ?? this.displayKey]}\n\t\t\t\t\t\t\t<p-icon\n\t\t\t\t\t\t\t\tclass='text-xs text-supportive-lilac group-hover/item:text-supportive-lilac-800'\n\t\t\t\t\t\t\t\tvariant='negative'\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\n\t\t\t\t\t<div class='extra pointer-events-none hidden text-sm text-black-teal-100'>\n\t\t\t\t\t\t+{this._amountHidden}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn this._getDisplay(this._selectedItem, true);\n\t}\n\n\tget _identifierKey() {\n\t\treturn this.identifierKey ?? this.valueKey ?? 'value';\n\t}\n\n\tcomponentDidLoad() {\n\t\tif (!this.valueKey && !this.identifierKey) {\n\t\t\tthrow new Error('You must provide a valueKey or identifierKey');\n\t\t}\n\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\n\t\t\tthis._resizeObserver = new ResizeObserver(() => {\n\t\t\t\tif (this._resizeDebounceTimer) {\n\t\t\t\t\tclearTimeout(this._resizeDebounceTimer);\n\t\t\t\t\tthis._resizeDebounceTimer = null;\n\t\t\t\t}\n\n\t\t\t\tthis._resizeDebounceTimer = setTimeout(() => {\n\t\t\t\t\tthis._setMultiContainerMaxWidth();\n\t\t\t\t\tthis._setCheckSelectedItemsTimeout();\n\t\t\t\t}, 200);\n\t\t\t});\n\t\t\tthis._resizeObserver.observe(this._el);\n\t\t}\n\n\t\tif (this.value) {\n\t\t\tthis._valueChange();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.itemChanges();\n\t}\n\n\tcomponentDidRender() {\n\t\tif (this.multi) {\n\t\t\tthis._setMultiContainerMaxWidth();\n\t\t}\n\t}\n\n\tdisconnectedCallback() {\n\t\tif (this.multi) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-select'>\n\t\t\t\t<p-dropdown\n\t\t\t\t\tdisableTriggerClick={true}\n\t\t\t\t\tcalculateWidth={true}\n\t\t\t\t\tinsideClick={true}\n\t\t\t\t\tscrollable={this.enableAutocomplete ? 'large' : true}\n\t\t\t\t\tshow={this._showDropdown}\n\t\t\t\t\tonIsOpen={ev => this._onDropdownOpen(ev)}\n\t\t\t\t\tusePortal={this.usePortal}\n\t\t\t\t\tstrategy={this.strategy}\n\t\t\t\t>\n\t\t\t\t\t<p-field-container\n\t\t\t\t\t\tslot='trigger'\n\t\t\t\t\t\tprefix={this.prefix}\n\t\t\t\t\t\tlabel={this.label}\n\t\t\t\t\t\thelper={this.helper}\n\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\terror={this.error}\n\t\t\t\t\t\terrorPlacement='top-start'\n\t\t\t\t\t\tforceShowTooltip={this.error?.length && this._showDropdown}\n\t\t\t\t\t>\n\t\t\t\t\t\t<p-button\n\t\t\t\t\t\t\tclass='w-full'\n\t\t\t\t\t\t\tslot='content'\n\t\t\t\t\t\t\tvariant='secondary'\n\t\t\t\t\t\t\tsize={this.size}\n\t\t\t\t\t\t\tchevron={this.showChevron}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tactive={this._showDropdown}\n\t\t\t\t\t\t\ticon={this.icon}\n\t\t\t\t\t\t\tonClick={ev => this._onClick(ev)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass='relative flex-1'\n\t\t\t\t\t\t\t\tref={ref => (this._inputRef = ref)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{this._displayValue}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</p-button>\n\t\t\t\t\t</p-field-container>\n\t\t\t\t\t{this.loading ? this._getLoadingItems() : this._getItems()}\n\t\t\t\t\t{this.showAddItem && this._getAddItem()}\n\t\t\t\t</p-dropdown>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Listen('click', { target: 'document', capture: true })\n\tprotected documentClickHandler({ target }) {\n\t\tif (!this._showDropdown || childOf(target, this._el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\t@Watch('value')\n\tprivate _valueChange() {\n\t\tsetTimeout(() => {\n\t\t\tthis._preselectItem();\n\t\t\tthis._setCheckSelectedItemsTimeout();\n\t\t});\n\t}\n\n\t@Watch('items')\n\tpublic itemChanges() {\n\t\tsetTimeout(() => this._preselectItem());\n\t}\n\n\t@Watch('_showDropdown')\n\tpublic _showDropdownChanges() {\n\t\tthis.dropdownShown.emit({\n\t\t\tvalue: this._showDropdown,\n\t\t\tquery: this.query,\n\t\t});\n\t}\n\n\t@Watch('multi')\n\tpublic multiChanges() {\n\t\tif (this._selectedItem && !Array.isArray(this._selectedItem)) {\n\t\t\tthis._selectedItem = [];\n\t\t}\n\t}\n\n\tprivate _preselectItem() {\n\t\tlet value =\n\t\t\ttypeof this.value === 'string' && this.multi\n\t\t\t\t? JSON.parse(this.value)\n\t\t\t\t: this.value;\n\n\t\tif (this.multi) {\n\t\t\tif (!Array.isArray(value)) {\n\t\t\t\tthis.value = [];\n\t\t\t\tthis.valueChange.emit(this.value);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t\tif (!value.length) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._selectedItem =\n\t\t\t\t!!this.valueKey && this.valueKey !== 'false'\n\t\t\t\t\t? this._items.filter(i => value.includes(i?.[this.valueKey]))\n\t\t\t\t\t: [...value];\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._selectedItem && !value && this.autoSelectFirst) {\n\t\t\tvalue = this._items[0];\n\t\t}\n\n\t\tconst identifier =\n\t\t\ttypeof value === 'object' && value !== null\n\t\t\t\t? value[this._identifierKey]\n\t\t\t\t: value;\n\t\tconst parsedValue =\n\t\t\ttypeof identifier === 'string' || typeof identifier === 'number'\n\t\t\t\t? identifier\n\t\t\t\t: JSON.stringify(identifier);\n\n\t\tconst currentValue = this._selectedItem\n\t\t\t? this._selectedItem?.[this._identifierKey]\n\t\t\t: null;\n\t\tconst currentParsedValue =\n\t\t\ttypeof currentValue === 'string' || typeof currentValue === 'number'\n\t\t\t\t? currentValue\n\t\t\t\t: JSON.stringify(currentValue);\n\n\t\tif (this._selectedItem && currentParsedValue === parsedValue) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this._items?.length && value) {\n\t\t\tthis._selectValue(value, false);\n\t\t\treturn;\n\t\t}\n\n\t\tconst items = this._getParsedItems(false);\n\t\tconst item = items.find(i => {\n\t\t\tconst itemIdentifier = i?.[this._identifierKey];\n\t\t\tconst parsedItemIdentifier =\n\t\t\t\ttypeof itemIdentifier === 'string' || typeof itemIdentifier === 'number'\n\t\t\t\t\t? itemIdentifier\n\t\t\t\t\t: JSON.stringify(itemIdentifier);\n\n\t\t\treturn parsedItemIdentifier === parsedValue;\n\t\t});\n\n\t\tthis._selectValue(!!item ? item : value, false);\n\t}\n\n\tprivate _selectValue(item, forceBlur = true) {\n\t\tlet value =\n\t\t\t!!this.valueKey && this.valueKey !== 'false' && item !== null\n\t\t\t\t? item?.[this.valueKey]\n\t\t\t\t: item;\n\n\t\tif (this.multi) {\n\t\t\tif (!this._selectedItem || !Array.isArray(this._selectedItem)) {\n\t\t\t\tthis._selectedItem = [];\n\t\t\t}\n\n\t\t\tif (!this.value || !Array.isArray(this.value)) {\n\t\t\t\tthis.value = [];\n\t\t\t}\n\n\t\t\tconst selectedItem = [...this._selectedItem];\n\t\t\tconst valueArray = [...this.value];\n\n\t\t\tconst includesIndex = selectedItem.findIndex(\n\t\t\t\ti => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t);\n\t\t\tif (includesIndex === -1) {\n\t\t\t\tselectedItem.push(item);\n\t\t\t\tvalueArray.push(value);\n\t\t\t} else {\n\t\t\t\tselectedItem.splice(includesIndex, 1);\n\t\t\t\tvalueArray.splice(includesIndex, 1);\n\t\t\t}\n\n\t\t\tthis._selectedItem = selectedItem;\n\t\t\tthis.value = valueArray;\n\t\t\tthis.valueChange.emit(valueArray);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._selectedItem = item;\n\t\tthis.value = value;\n\t\tthis.valueChange.emit(value);\n\n\t\tthis._onBlur(forceBlur);\n\t}\n\n\tprivate _findOnClickTarget(target: HTMLElement) {\n\t\tif (target.nodeName.toLowerCase() === 'p-button') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (target.classList.contains('item')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this._findOnClickTarget(target.parentElement);\n\t}\n\n\tprivate _onClick(ev) {\n\t\tif (!this._findOnClickTarget(ev.target as HTMLElement)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = !this._showDropdown;\n\t}\n\n\tprivate _onBlur(force = false) {\n\t\tif (this.enableAutocomplete && !force) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = false;\n\t}\n\n\tprivate _onAutoComplete(ev) {\n\t\tif (!this.enableAutocomplete) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._showDropdown = true;\n\n\t\tthis.query = ev.detail;\n\t\tthis.queryChange.emit(ev.detail);\n\t}\n\n\tprivate _checkvalue(key, item) {\n\t\treturn (\n\t\t\titem?.[key]\n\t\t\t\t?.toString()\n\t\t\t\t?.toLowerCase()\n\t\t\t\t.indexOf(this.query?.toLowerCase()) >= 0\n\t\t);\n\t}\n\n\tprivate _getItems() {\n\t\tlet items = this._items.map(item => (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tuseContainer={false}\n\t\t\t\tonClick={() => this._selectValue(item)}\n\t\t\t\tactive={\n\t\t\t\t\tthis.multi &&\n\t\t\t\t\t!!this._selectedItem &&\n\t\t\t\t\tArray.isArray(this._selectedItem)\n\t\t\t\t\t\t? this._selectedItem.findIndex(\n\t\t\t\t\t\t\t\ti => i[this._identifierKey] === item[this._identifierKey]\n\t\t\t\t\t\t\t) >= 0\n\t\t\t\t\t\t: item[this._identifierKey] ===\n\t\t\t\t\t\t\tthis._selectedItem?.[this._identifierKey]\n\t\t\t\t}\n\t\t\t\tcheckbox={this.multi ? true : false}\n\t\t\t\tslot='items'\n\t\t\t>\n\t\t\t\t{this._getDisplay(item)}\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\n\t\tif (!this._items.length) {\n\t\t\titems = [\n\t\t\t\t<p\n\t\t\t\t\tclass='w-full p-2 text-center text-sm text-black-teal-400'\n\t\t\t\t\tslot='items'\n\t\t\t\t>\n\t\t\t\t\t{this.emptyStateText}\n\t\t\t\t</p>,\n\t\t\t];\n\t\t}\n\n\t\tif (this.enableSelectAll && this._items.length) {\n\t\t\titems.unshift(\n\t\t\t\t<p-dropdown-menu-item\n\t\t\t\t\tslot='items'\n\t\t\t\t\tuseContainer={false}\n\t\t\t\t\tcheckbox\n\t\t\t\t\tonClick={() => this._selectAllChange()}\n\t\t\t\t\tactive={this._allSelected}\n\t\t\t\t>\n\t\t\t\t\t{this.selectAllIcon?.length ? (\n\t\t\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t\t\t<div class='flex w-6 justify-center text-lg'>\n\t\t\t\t\t\t\t\t<p-icon variant={this.selectAllIcon} />\n\t\t\t\t\t\t\t</div>{' '}\n\t\t\t\t\t\t\t{this.selectAllText}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : (\n\t\t\t\t\t\tthis.selectAllText\n\t\t\t\t\t)}\n\t\t\t\t</p-dropdown-menu-item>\n\t\t\t);\n\t\t}\n\n\t\tif (this.enableAutocomplete) {\n\t\t\titems.unshift(this._getAutoCompleteItem());\n\t\t}\n\n\t\treturn items;\n\t}\n\n\tprivate _getAddItem() {\n\t\treturn (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tonClick={() => this.add.emit()}\n\t\t\t\tuseContainer={false}\n\t\t\t\tslot='items'\n\t\t\t>\n\t\t\t\t<span class='flex items-center gap-1 font-semibold text-teal-800'>\n\t\t\t\t\t{this.addItemText}\n\t\t\t\t\t<p-icon variant='plus' />\n\t\t\t\t</span>\n\t\t\t</p-dropdown-menu-item>\n\t\t);\n\t}\n\n\tprivate _getLoadingItems() {\n\t\tconst items = [0, 0, 0].map(() => (\n\t\t\t<p-dropdown-menu-item\n\t\t\t\tenableHover={false}\n\t\t\t\tslot='items'\n\t\t\t>\n\t\t\t\t<p-loader\n\t\t\t\t\tvariant='ghost'\n\t\t\t\t\tclass='h-6 w-full rounded'\n\t\t\t\t/>\n\t\t\t</p-dropdown-menu-item>\n\t\t));\n\n\t\tif (this.enableAutocomplete) {\n\t\t\titems.unshift(this._getAutoCompleteItem());\n\t\t}\n\n\t\treturn items;\n\t}\n\n\tprivate _getAutoCompleteItem() {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tclass='sticky top-0 mb-3 h-8'\n\t\t\t\tslot='items'\n\t\t\t>\n\t\t\t\t<p-field\n\t\t\t\t\tclass='block'\n\t\t\t\t\tplaceholder={this.autocompletePlaceholder}\n\t\t\t\t\tonValueChange={ev => this._onAutoComplete(ev)}\n\t\t\t\t\tonInputRefChange={ev => (this.autocompleteInputRef = ev.detail)}\n\t\t\t\t\tvalue={this.query}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tprivate _setMultiContainerMaxWidth() {\n\t\tif (!this._inputRef || !this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._multiContainerRef.style.maxWidth = `${\n\t\t\tthis._inputRef.clientWidth - 16\n\t\t}px`;\n\t}\n\n\tprivate _setCheckSelectedItemsTimeout() {\n\t\tif (this._checkSelectedItemsTimeout) {\n\t\t\tclearTimeout(this._checkSelectedItemsTimeout);\n\t\t}\n\n\t\tthis._checkSelectedItemsTimeout = setTimeout(\n\t\t\t() => this._checkSelectedItems(),\n\t\t\t50\n\t\t);\n\t}\n\n\tprivate _checkSelectedItems() {\n\t\tif (!this._multiContainerRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst containerRect = this._multiContainerRef.getBoundingClientRect();\n\t\tconst items = this._multiContainerRef.querySelectorAll('.item');\n\n\t\tlet amountHidden = 0;\n\n\t\tfor (const child of items) {\n\t\t\tchild.classList.remove('hidden');\n\t\t\tchild.classList.add('flex');\n\n\t\t\tconst childRect = child.getBoundingClientRect();\n\t\t\tif (childRect.right > containerRect.right) {\n\t\t\t\tchild.classList.remove('flex');\n\t\t\t\tchild.classList.add('hidden');\n\t\t\t\tamountHidden++;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tthis._amountHidden = amountHidden;\n\t\tconst extra = this._multiContainerRef.querySelector('.extra');\n\t\tif (!extra) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!extra.classList.contains('hidden')) {\n\t\t\textra.classList.add('hidden');\n\t\t}\n\n\t\tif (amountHidden > 0) {\n\t\t\textra.classList.remove('hidden');\n\t\t}\n\t}\n\n\tprivate _onDropdownOpen(ev) {\n\t\tif (!ev.detail || !this.autocompleteInputRef) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.autocompleteInputRef.focus();\n\t}\n\n\tprivate _selectAllChange() {\n\t\tthis._allSelected = !this._allSelected;\n\t\tthis.selectAllChange.emit(this._allSelected);\n\t}\n\n\tprivate _getDisplay(item, isSelection = false) {\n\t\tlet content = (\n\t\t\t<div class={textContainer({ variant: 'default' })}>\n\t\t\t\t{\n\t\t\t\t\titem[\n\t\t\t\t\t\tisSelection\n\t\t\t\t\t\t\t? (this.selectionDisplayKey ?? this.displayKey)\n\t\t\t\t\t\t\t: this.displayKey\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t</div>\n\t\t);\n\n\t\tif (this.avatarKey) {\n\t\t\tcontent = (\n\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t<p-avatar\n\t\t\t\t\t\tsize='sm'\n\t\t\t\t\t\tsrc={item[this.avatarKey]}\n\t\t\t\t\t\tletters={item[this.avatarLettersKey]}\n\t\t\t\t\t></p-avatar>\n\t\t\t\t\t<div class={textContainer({ variant: 'default' })}>\n\t\t\t\t\t\t{item[this.dropdownDisplayKey ?? this.displayKey]}\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\n\t\tif (this.iconKey && (!isSelection || this.showIconInSelectedItem)) {\n\t\t\tcontent = (\n\t\t\t\t<span class='flex items-center gap-2'>\n\t\t\t\t\t<p-icon variant={item[this.iconKey] as IconVariant} />\n\t\t\t\t\t<div class={textContainer({ variant: 'default' })}>\n\t\t\t\t\t\t{item[this.dropdownDisplayKey ?? this.displayKey]}\n\t\t\t\t\t</div>\n\t\t\t\t</span>\n\t\t\t);\n\t\t}\n\n\t\tif (\n\t\t\t(!isSelection || this.applyClassOnSelectedItem) &&\n\t\t\t!!item?.class?.length\n\t\t) {\n\t\t\treturn <div class={item.class}>{content}</div>;\n\t\t}\n\n\t\treturn content;\n\t}\n\n\tprivate _getParsedItems(applyPagination = true) {\n\t\tif (!this.items || this.loading) {\n\t\t\treturn [];\n\t\t}\n\n\t\tlet items =\n\t\t\ttypeof this.items === 'string' ? JSON.parse(this.items) : this.items;\n\n\t\tif (typeof items?.[0] === 'string') {\n\t\t\tthis.displayKey = 'text';\n\t\t\tthis.valueKey = 'value';\n\n\t\t\titems = items.map(str => ({\n\t\t\t\tvalue: str,\n\t\t\t\ttext: str,\n\t\t\t}));\n\t\t}\n\n\t\tif (this.query?.length && !this.asyncFilter) {\n\t\t\titems = items.filter(item => {\n\t\t\t\tif (this.queryKey) {\n\t\t\t\t\treturn this._checkvalue(this.queryKey, item);\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tthis._checkvalue(this._identifierKey, item) ||\n\t\t\t\t\tthis._checkvalue(this.displayKey, item)\n\t\t\t\t);\n\t\t\t});\n\t\t}\n\n\t\tif (!applyPagination) {\n\t\t\treturn items;\n\t\t}\n\n\t\treturn items?.slice(0, this.maxDisplayedItems);\n\t}\n}\n"],"version":3}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$2 } from './stepper-line.component.js';
|
|
3
3
|
|
|
4
|
-
const stepperComponentCss = ".flex{display:flex!important}.h-auto{height:auto!important}.
|
|
4
|
+
const stepperComponentCss = ".flex{display:flex!important}.h-auto{height:auto!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}*{box-sizing:border-box}:host{display:flex}:host([direction=horizontal]){align-items:flex-end;height:auto}:host([direction=vertical]){align-items:flex-start;flex-direction:column;flex-wrap:wrap;width:100%}:host([direction=vertical][content-position=start]){align-items:flex-end}.static{position:static!important}";
|
|
5
5
|
const PStepperStyle0 = stepperComponentCss;
|
|
6
6
|
|
|
7
7
|
const Stepper = /*@__PURE__*/ proxyCustomElement(class Stepper extends HTMLElement {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-stepper.js","mappings":";;;AAAA,MAAM,mBAAmB,GAAG,gfAAgf,CAAC;AAC7gB,uBAAe,mBAAmB;;MCMrB,OAAO;;;;;0BAIU,CAAC;gCAKM,IAAI;yBAKwB,YAAY;+BAKhB,KAAK;;;IAOzD,gBAAgB,CAA6B;IAC7C,eAAe,CAAiB;IAEhC,kBAAkB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AAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACvC,WAAW,CAAC,MAAM,GAAG,CAAC,GAAG,UAAU,CAAC;QAEpC,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,UAAU,EAAE;YACpD,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,UAAU,GAAG,EAAE,KAAK,CAAC;YACvD,WAAW,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,cAAc,GAAG,EAAE,KAAK,CAAC;YAC9D,WAAW,CAAC,KAAK,CAAC,SAAS,GAAG,eAC7B,CAAC,UAAU,GAAG,cAAc,IAAI,EACjC,MAAM,CAAC;SACP;KACD,CAAC;IAEF,gBAAgB;QACf,IAAI,CAAC,eAAe,GAAG,IAAI,cAAc,CAAC,MAAM,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;QAC3E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACvC;IAED,kBAAkB;QACjB,IAAI,IAAI,CAAC,eAAe,EAAE;YACzB,IAAI,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;SAClC;KACD;IAED,MAAM;QACL,QACC,EAAC,IAAI,qDAAC,KAAK,EAAC,WAAW,IACtB,6DAAM,YAAY,EAAE,MAAM,IAAI,CAAC,kBAAkB,EAAE,GAAI,CACjD,EACN;KACF;IAGS,mBAAmB;QAC5B,IAAI,CAAC,kBAAkB,EAAE,CAAC;KAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full min-h-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * Wether to automatically apply active & finished to items\n\t */\n\t@Prop() enableAutoStatus: boolean = true;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' = 'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _generateTimeout: NodeJS.Timeout | undefined;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _generateStepsOnce = () => {\n\t\tif (this._generateTimeout) {\n\t\t\tclearTimeout(this._generateTimeout);\n\t\t\tthis._generateTimeout = null;\n\t\t}\n\n\t\tthis._generateTimeout = setTimeout(() => this._generateSteps(), 50);\n\t};\n\n\tprivate _generateSteps = async () => {\n\t\tif (!this._el) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tlet directionChanged = false;\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (this.enableAutoStatus) {\n\t\t\t\titem.active = i === activeStep;\n\t\t\t\titem.finished = i < activeStep;\n\t\t\t}\n\n\t\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (item.direction !== this.direction && !directionChanged) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\tthis.direction === 'vertical'\n\t\t\t\t\t? 'start'\n\t\t\t\t\t: i === 0\n\t\t\t\t\t? 'start'\n\t\t\t\t\t: i === items?.length - 1\n\t\t\t\t\t? 'end'\n\t\t\t\t\t: 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\t\t}\n\n\t\tif (directionChanged) {\n\t\t\t// super hacky way to ensure all elements that have a direction changed are re-rendered\n\t\t\tawait new Promise(resolve => setTimeout(resolve, 200));\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tlet nextItem = item.nextElementSibling;\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\tconst stepperLine = document.createElement('p-stepper-line');\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\t\t\t\t\tthis._setStepperLineData(stepperLine, item, nextItem, i, activeStep);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\t\tprevious.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tconst stepperLine = nextItem;\n\t\t\t\t\tnextItem = nextItem.nextElementSibling;\n\n\t\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\t\tthis._setStepperLineData(\n\t\t\t\t\t\t\tstepperLine,\n\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\tnextItem,\n\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\tactiveStep\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tpreviousItem &&\n\t\t\t\t\tpreviousItem.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t) {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines = this._el.querySelectorAll(\n\t\t\t'p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child'\n\t\t);\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tline.remove();\n\t\t}\n\t};\n\n\tprivate _setStepperLineData = (\n\t\tstepperLine: HTMLPStepperLineElement,\n\t\titem: HTMLPStepperItemElement,\n\t\tnextItem: HTMLPStepperItemElement,\n\t\ti: number,\n\t\tactiveStep: number\n\t) => {\n\t\tconst heightDiff = item.clientHeight / 2;\n\t\tconst heightDiffNext = nextItem.clientHeight / 2;\n\n\t\tstepperLine.direction = this.direction;\n\t\tstepperLine.active = i < activeStep;\n\n\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\tstepperLine.style.marginBottom = `-${heightDiffNext / 16}rem`;\n\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t(heightDiff + heightDiffNext) / 16\n\t\t\t}rem)`;\n\t\t}\n\t};\n\n\tcomponentDidLoad() {\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateStepsOnce());\n\t\tthis._resizeObserver.observe(this._el);\n\t}\n\n\tdisconnectCallback() {\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-stepper'>\n\t\t\t\t<slot onSlotchange={() => this._generateStepsOnce()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeSt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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/molecules/stepper/stepper.component.scss?tag=p-stepper&encapsulation=shadow","src/components/molecules/stepper/stepper.component.tsx"],"sourcesContent":[":host {\n\t@apply flex;\n}\n\n:host([direction='horizontal']) {\n\t@apply h-auto items-end;\n}\n\n:host([direction='vertical']) {\n\t@apply flex-col flex-wrap items-start;\n\t@apply w-full;\n}\n\n:host([direction='vertical'][content-position='start']) {\n\t@apply items-end;\n}\n","import { Component, Element, h, Host, Prop, Watch } from '@stencil/core';\n\n@Component({\n\ttag: 'p-stepper',\n\tstyleUrl: 'stepper.component.scss',\n\tshadow: true,\n})\nexport class Stepper {\n\t/**\n\t * The currently active step\n\t */\n\t@Prop() activeStep: number = 1;\n\n\t/**\n\t * Wether to automatically apply active & finished to items\n\t */\n\t@Prop() enableAutoStatus: boolean = true;\n\n\t/**\n\t * The direction of the stepper\n\t */\n\t@Prop({ reflect: true }) direction: 'horizontal' | 'vertical' = 'horizontal';\n\n\t/**\n\t * The position of the content in case of vertical direction\n\t */\n\t@Prop({ reflect: true }) contentPosition: 'start' | 'end' = 'end';\n\n\t/**\n\t * The host element\n\t */\n\t@Element() private _el: HTMLElement;\n\n\tprivate _generateTimeout: NodeJS.Timeout | undefined;\n\tprivate _resizeObserver: ResizeObserver;\n\n\tprivate _generateStepsOnce = () => {\n\t\tif (this._generateTimeout) {\n\t\t\tclearTimeout(this._generateTimeout);\n\t\t\tthis._generateTimeout = null;\n\t\t}\n\n\t\tthis._generateTimeout = setTimeout(() => this._generateSteps(), 50);\n\t};\n\n\tprivate _generateSteps = async () => {\n\t\tif (!this._el) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet activeStep = this.activeStep - 1 || 0;\n\t\tconst items = this._el.querySelectorAll('p-stepper-item');\n\n\t\tlet directionChanged = false;\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (this.enableAutoStatus) {\n\t\t\t\titem.active = i === activeStep;\n\t\t\t\titem.finished = i < activeStep;\n\t\t\t}\n\n\t\t\tif (!this.activeStep || activeStep < 0) {\n\t\t\t\tif (item.active) {\n\t\t\t\t\tactiveStep = i;\n\t\t\t\t}\n\n\t\t\t\tif (activeStep < 0 && item.finished) {\n\t\t\t\t\tactiveStep = i + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (item.direction !== this.direction && !directionChanged) {\n\t\t\t\tdirectionChanged = true;\n\t\t\t}\n\n\t\t\titem.direction = this.direction;\n\t\t\titem.align =\n\t\t\t\tthis.direction === 'vertical'\n\t\t\t\t\t? 'start'\n\t\t\t\t\t: i === 0\n\t\t\t\t\t? 'start'\n\t\t\t\t\t: i === items?.length - 1\n\t\t\t\t\t? 'end'\n\t\t\t\t\t: 'center';\n\t\t\titem.contentPosition = this.contentPosition;\n\t\t}\n\n\t\tif (directionChanged) {\n\t\t\t// super hacky way to ensure all elements that have a direction changed are re-rendered\n\t\t\tawait new Promise(resolve => setTimeout(resolve, 200));\n\t\t}\n\n\t\tfor (let i = 0; i < items?.length; i++) {\n\t\t\tconst item = items.item(i) as any;\n\n\t\t\tif (i < items.length - 1) {\n\t\t\t\tlet nextItem = item.nextElementSibling;\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\tconst stepperLine = document.createElement('p-stepper-line');\n\t\t\t\t\tthis._el.insertBefore(stepperLine, nextItem);\n\t\t\t\t\tthis._setStepperLineData(stepperLine, item, nextItem, i, activeStep);\n\n\t\t\t\t\tconst previous = stepperLine.previousElementSibling;\n\t\t\t\t\tif (previous && previous.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\t\tprevious.remove();\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-line') {\n\t\t\t\t\tconst stepperLine = nextItem;\n\t\t\t\t\tnextItem = nextItem.nextElementSibling;\n\n\t\t\t\t\tif (nextItem && nextItem.tagName.toLowerCase() === 'p-stepper-item') {\n\t\t\t\t\t\tthis._setStepperLineData(\n\t\t\t\t\t\t\tstepperLine,\n\t\t\t\t\t\t\titem,\n\t\t\t\t\t\t\tnextItem,\n\t\t\t\t\t\t\ti,\n\t\t\t\t\t\t\tactiveStep\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (i > 0) {\n\t\t\t\tconst previousItem = item.previousElementSibling;\n\t\t\t\tif (\n\t\t\t\t\tpreviousItem &&\n\t\t\t\t\tpreviousItem.tagName.toLowerCase() === 'p-stepper-line'\n\t\t\t\t) {\n\t\t\t\t\tpreviousItem.direction = this.direction;\n\t\t\t\t\tpreviousItem.active = item.active || item.finished;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst lines = this._el.querySelectorAll(\n\t\t\t'p-stepper-line:not(:has(+ p-stepper-item)), p-stepper-line:first-child'\n\t\t);\n\t\tfor (let j = lines.length - 1; j >= 0; j--) {\n\t\t\tconst line = lines.item(j);\n\t\t\tline.remove();\n\t\t}\n\t};\n\n\tprivate _setStepperLineData = (\n\t\tstepperLine: HTMLPStepperLineElement,\n\t\titem: HTMLPStepperItemElement,\n\t\tnextItem: HTMLPStepperItemElement,\n\t\ti: number,\n\t\tactiveStep: number\n\t) => {\n\t\tconst heightDiff = item.clientHeight / 2;\n\t\tconst heightDiffNext = nextItem.clientHeight / 2;\n\n\t\tstepperLine.direction = this.direction;\n\t\tstepperLine.active = i < activeStep;\n\n\t\tif (heightDiff > 0 && this.direction === 'vertical') {\n\t\t\tstepperLine.style.marginTop = `-${heightDiff / 16}rem`;\n\t\t\tstepperLine.style.marginBottom = `-${heightDiffNext / 16}rem`;\n\t\t\tstepperLine.style.minHeight = `calc(1rem + ${\n\t\t\t\t(heightDiff + heightDiffNext) / 16\n\t\t\t}rem)`;\n\t\t}\n\t};\n\n\tcomponentDidLoad() {\n\t\tthis._resizeObserver = new ResizeObserver(() => this._generateStepsOnce());\n\t\tthis._resizeObserver.observe(this._el);\n\t}\n\n\tdisconnectCallback() {\n\t\tif (this._resizeObserver) {\n\t\t\tthis._resizeObserver.disconnect();\n\t\t}\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-stepper'>\n\t\t\t\t<slot onSlotchange={() => this._generateStepsOnce()} />\n\t\t\t</Host>\n\t\t);\n\t}\n\n\t@Watch('activeStep')\n\tprotected _onActiveStepChange() {\n\t\tthis._generateStepsOnce();\n\t}\n}\n"],"version":3}
|
|
@@ -2,18 +2,15 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
2
2
|
import { c as cva } from './index2.js';
|
|
3
3
|
import { n as nonce } from './nonce.js';
|
|
4
4
|
|
|
5
|
-
const toggleComponentCss = "*{box-sizing:border-box}.pointer-events-none{pointer-events:none!important}.static{position:static!important}.absolute{position:absolute!important}.relative{position:relative!important}.left-\\[1px\\]{left:1px!important}.left-\\[2px\\]{left:2px!important}.top-1\\/2{top:50%!important}.m-0{margin:0!important}.flex{display:flex!important}.h-3{height:.75rem!important}.h-4{height:1rem!important}.h
|
|
5
|
+
const toggleComponentCss = "*{box-sizing:border-box}.pointer-events-none{pointer-events:none!important}.static{position:static!important}.absolute{position:absolute!important}.relative{position:relative!important}.left-\\[1px\\]{left:1px!important}.left-\\[2px\\]{left:2px!important}.top-1\\/2{top:50%!important}.m-0{margin:0!important}.flex{display:flex!important}.h-3{height:.75rem!important}.h-4{height:1rem!important}.h-\\[14px\\]{height:14px!important}.w-3{width:.75rem!important}.w-8{width:2rem!important}.w-\\[14px\\]{width:14px!important}.flex-shrink-0{flex-shrink:0!important}.-translate-y-1\\/2{--tw-translate-y:-50%!important}.-translate-y-1\\/2,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.appearance-none{appearance:none!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.justify-center{justify-content:center!important}.gap-2{gap:.5rem!important}.rounded-full{border-radius:9999px!important}.border{border-width:1px!important}.border-solid{border-style:solid!important}.border-black-teal-100{--tw-border-opacity:1!important;border-color:rgb(205 212 211/var(--tw-border-opacity,1))!important}.border-black-teal-50{--tw-border-opacity:1!important;border-color:rgb(230 234 233/var(--tw-border-opacity,1))!important}.bg-black-teal-100{--tw-bg-opacity:1!important;background-color:rgb(205 212 211/var(--tw-bg-opacity,1))!important}.bg-black-teal-50{--tw-bg-opacity:1!important;background-color:rgb(230 234 233/var(--tw-bg-opacity,1))!important}.bg-white{background-color:rgb(255 255 255/var(--tw-bg-opacity,1))!important}.bg-white,.bg-white-600{--tw-bg-opacity:1!important}.bg-white-600{background-color:rgb(250 250 250/var(--tw-bg-opacity,1))!important}.text-black-teal{--tw-text-opacity:1!important;color:rgb(3 42 36/var(--tw-text-opacity,1))!important}.shadow-1{--tw-shadow:0 1px 1px rgba(0,2,2,.08)!important;--tw-shadow-colored:0 1px 1px var(--tw-shadow-color)!important;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)!important}.outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.ring-1{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.ring-black-teal\\/10{--tw-ring-color:rgba(3,42,36,.1)!important}.transition-all{transition-duration:.15s!important;transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.after\\:h-1:after{content:var(--tw-content)!important;height:.25rem!important}.after\\:w-1:after{content:var(--tw-content)!important;width:.25rem!important}.after\\:rounded-full:after{border-radius:9999px!important;content:var(--tw-content)!important}.after\\:bg-supportive-lilac-800:after{--tw-bg-opacity:1!important;background-color:rgb(189 140 255/var(--tw-bg-opacity,1))!important;content:var(--tw-content)!important}.after\\:transition-all:after{content:var(--tw-content)!important;transition-duration:.15s!important;transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important}.after\\:content-\\[\\]:after{--tw-content:!important;content:var(--tw-content)!important}.checked\\:border-black-teal\\/20:checked{border-color:rgba(3,42,36,.2)!important}.checked\\:bg-supportive-lilac:checked{--tw-bg-opacity:1!important;background-color:rgb(209 174 255/var(--tw-bg-opacity,1))!important}.checked\\:ring-2:checked{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)!important;--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color)!important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)!important}.checked\\:ring-supportive-lilac-100:checked{--tw-ring-opacity:1!important;--tw-ring-color:rgb(246 239 255/var(--tw-ring-opacity,1))!important}.hover\\:border-black-teal-100:hover{--tw-border-opacity:1!important;border-color:rgb(205 212 211/var(--tw-border-opacity,1))!important}.hover\\:bg-supportive-lilac-100:hover{--tw-bg-opacity:1!important;background-color:rgb(246 239 255/var(--tw-bg-opacity,1))!important}.checked\\:hover\\:border-black-teal\\/20:hover:checked{border-color:rgba(3,42,36,.2)!important}.checked\\:hover\\:bg-supportive-lilac-700:hover:checked{--tw-bg-opacity:1!important;background-color:rgb(200 159 255/var(--tw-bg-opacity,1))!important}.group:hover .group-hover\\:w-\\[18px\\]{width:18px!important}.group:hover .group-hover\\:after\\:w-2:after{content:var(--tw-content)!important;width:.5rem!important}.peer:checked~.peer-checked\\:left-full{left:100%!important}.peer:checked~.peer-checked\\:-translate-x-\\[calc\\(100\\%\\+1px\\)\\]{--tw-translate-x:calc(-100% - 1px)!important}.peer:checked~.peer-checked\\:-translate-x-\\[calc\\(100\\%\\+1px\\)\\],.peer:checked~.peer-checked\\:-translate-x-\\[calc\\(100\\%\\+2px\\)\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}.peer:checked~.peer-checked\\:-translate-x-\\[calc\\(100\\%\\+2px\\)\\]{--tw-translate-x:calc(-100% - 2px)!important}.peer:checked~.peer-checked\\:bg-black-teal-200{--tw-bg-opacity:1!important;background-color:rgb(154 170 167/var(--tw-bg-opacity,1))!important}.peer:checked~.peer-checked\\:after\\:content-\\[\\'\\'\\]:after{--tw-content:\"\"!important;content:var(--tw-content)!important}";
|
|
6
6
|
const PToggleStyle0 = toggleComponentCss;
|
|
7
7
|
|
|
8
8
|
const checkbox = cva([
|
|
9
9
|
'peer appearance-none m-0 outline-none flex-shrink-0',
|
|
10
10
|
'border border-inset border-solid ',
|
|
11
|
+
'rounded-full w-8 h-4',
|
|
11
12
|
], {
|
|
12
13
|
variants: {
|
|
13
|
-
size: {
|
|
14
|
-
sm: 'rounded-full w-8 h-4',
|
|
15
|
-
base: 'rounded-full w-10 h-6',
|
|
16
|
-
},
|
|
17
14
|
disabled: {
|
|
18
15
|
false: [
|
|
19
16
|
'cursor-pointer shadow-1',
|
|
@@ -33,50 +30,21 @@ const circle = cva([
|
|
|
33
30
|
'absolute top-1/2 peer-checked:left-full transform -translate-y-1/2 pointer-events-none',
|
|
34
31
|
], {
|
|
35
32
|
variants: {
|
|
36
|
-
size: {
|
|
37
|
-
sm: null,
|
|
38
|
-
base: null,
|
|
39
|
-
},
|
|
40
33
|
disabled: {
|
|
41
34
|
false: [
|
|
42
35
|
'bg-white ring-1 ring-black-teal/10',
|
|
43
36
|
'left-[1px] peer-checked:-translate-x-[calc(100%+1px)]',
|
|
44
37
|
"after:content-[] peer-checked:after:content-[''] after:bg-supportive-lilac-800 after:rounded-full after:transition-all",
|
|
38
|
+
'w-[14px] h-[14px] group-hover:w-[18px]',
|
|
39
|
+
'after:w-1 after:h-1 group-hover:after:w-2',
|
|
45
40
|
],
|
|
46
41
|
true: [
|
|
47
42
|
'bg-black-teal-100 peer-checked:bg-black-teal-200',
|
|
48
43
|
'left-[2px] peer-checked:-translate-x-[calc(100%+2px)]',
|
|
44
|
+
'w-3 h-3',
|
|
49
45
|
],
|
|
50
46
|
},
|
|
51
47
|
},
|
|
52
|
-
compoundVariants: [
|
|
53
|
-
{
|
|
54
|
-
size: 'sm',
|
|
55
|
-
disabled: false,
|
|
56
|
-
class: [
|
|
57
|
-
'w-[14px] h-[14px] group-hover:w-[18px]',
|
|
58
|
-
'after:w-1 after:h-1 group-hover:after:w-2',
|
|
59
|
-
],
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
size: 'base',
|
|
63
|
-
disabled: false,
|
|
64
|
-
class: [
|
|
65
|
-
'w-[22px] h-[22px] group-hover:w-[26px]',
|
|
66
|
-
'after:w-2 after:h-2 group-hover:after:w-3',
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
size: 'sm',
|
|
71
|
-
disabled: true,
|
|
72
|
-
class: 'w-3 h-3',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
size: 'base',
|
|
76
|
-
disabled: true,
|
|
77
|
-
class: 'w-[20px] h-[20px]',
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
48
|
});
|
|
81
49
|
const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement {
|
|
82
50
|
constructor() {
|
|
@@ -86,7 +54,6 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
86
54
|
this.indeterminateChange = createEvent(this, "indeterminateChange", 7);
|
|
87
55
|
this.checked = undefined;
|
|
88
56
|
this.indeterminate = undefined;
|
|
89
|
-
this.size = 'base';
|
|
90
57
|
this.disabled = false;
|
|
91
58
|
this.required = true;
|
|
92
59
|
this.id = undefined;
|
|
@@ -102,13 +69,11 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
102
69
|
*/
|
|
103
70
|
indeterminateChange;
|
|
104
71
|
render() {
|
|
105
|
-
return (h(Host, { key: '
|
|
106
|
-
size: this.size,
|
|
72
|
+
return (h(Host, { key: 'af914441aaa48a4ae3b5b962cf85d47480ffad83', class: 'p-checkbox' }, h("label", { key: '83d44d8292c5f0d82b1f0a0561e8906ae057d74c', htmlFor: this.id ?? this._nonce, class: 'flex items-center justify-start gap-2 text-black-teal' }, h("div", { key: 'a40171d14d2c82e2f0c04c27c0eb092850589bd1', class: 'group relative flex flex-shrink-0 items-center' }, h("input", { key: 'b056cad8a4e5764bdbab0875a88bbf07c6ff3d09', class: checkbox({
|
|
107
73
|
disabled: this.disabled,
|
|
108
|
-
}), type: 'checkbox', id: this.id ?? this._nonce, name: this.name, required: this.required, checked: !!this.checked, indeterminate: this.indeterminate, disabled: this.disabled, onChange: ev => this._onChange(ev) }), h("div", { key: '
|
|
109
|
-
size: this.size,
|
|
74
|
+
}), type: 'checkbox', id: this.id ?? this._nonce, name: this.name, required: this.required, checked: !!this.checked, indeterminate: this.indeterminate, disabled: this.disabled, onChange: ev => this._onChange(ev) }), h("div", { key: '9c0fd9118fdec489c4eaa1a202e26d4199ee9be7', class: circle({
|
|
110
75
|
disabled: this.disabled,
|
|
111
|
-
}) })), h("slot", { key: '
|
|
76
|
+
}) })), h("slot", { key: 'd2cdec166bbf1e2f4b8ec6dc06342cb8051933d1' }))));
|
|
112
77
|
}
|
|
113
78
|
_onChange(ev) {
|
|
114
79
|
if (this.disabled) {
|
|
@@ -130,7 +95,6 @@ const Toggle = /*@__PURE__*/ proxyCustomElement(class Toggle extends HTMLElement
|
|
|
130
95
|
}, [4, "p-toggle", {
|
|
131
96
|
"checked": [4],
|
|
132
97
|
"indeterminate": [4],
|
|
133
|
-
"size": [1],
|
|
134
98
|
"disabled": [516],
|
|
135
99
|
"required": [516],
|
|
136
100
|
"id": [513],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"p-toggle.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,
|
|
1
|
+
{"file":"p-toggle.js","mappings":";;;;AAAA,MAAM,kBAAkB,GAAG,2yLAA2yL,CAAC;AACv0L,sBAAe,kBAAkB;;ACWjC,MAAM,QAAQ,GAAG,GAAG,CACnB;IACC,qDAAqD;IACrD,mCAAmC;IACnC,sBAAsB;CACtB,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,yBAAyB;gBACzB,wCAAwC;gBACxC,2DAA2D;gBAC3D,0DAA0D;gBAC1D,kDAAkD;gBAClD,0EAA0E;aAC1E;YACD,IAAI,EAAE,uDAAuD;SAC7D;KACD;CACD,CACD,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG,CACjB;IACC,kCAAkC;IAClC,8BAA8B;IAC9B,0FAA0F;CAC1F,EACD;IACC,QAAQ,EAAE;QACT,QAAQ,EAAE;YACT,KAAK,EAAE;gBACN,oCAAoC;gBACpC,uDAAuD;gBACvD,yHAAyH;gBACzH,wCAAwC;gBACxC,2CAA2C;aAC3C;YACD,IAAI,EAAE;gBACL,kDAAkD;gBAClD,uDAAuD;gBACvD,SAAS;aACT;SACD;KACD;CACD,CACD,CAAC;MAMW,MAAM;;;;;;;;wBAc2B,KAAK;wBAKL,IAAI;;;sBAqBvB,KAAK,CAAC,CAAC,CAAC;;;;;IANzB,aAAa,CAAwB;;;;IAIrC,mBAAmB,CAAwB;IAIpD,MAAM;QACL,QACC,EAAC,IAAI,qDAAC,KAAK,EAAC,YAAY,IACvB,8DACC,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,MAAM,E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ources":["src/components/atoms/toggle/toggle.component.css?tag=p-toggle","src/components/atoms/toggle/toggle.component.tsx"],"sourcesContent":["","import {\n\tComponent,\n\tEvent,\n\tEventEmitter,\n\tHost,\n\tProp,\n\tState,\n\th,\n} from '@stencil/core';\nimport { cva } from 'class-variance-authority';\nimport { nonce } from '../../../utils/nonce';\n\nconst checkbox = cva(\n\t[\n\t\t'peer appearance-none m-0 outline-none flex-shrink-0',\n\t\t'border border-inset border-solid ',\n\t\t'rounded-full w-8 h-4',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'cursor-pointer shadow-1',\n\t\t\t\t\t'bg-black-teal-50 border-black-teal-100',\n\t\t\t\t\t'hover:bg-supportive-lilac-100 hover:border-black-teal-100',\n\t\t\t\t\t'checked:bg-supportive-lilac checked:border-black-teal/20',\n\t\t\t\t\t'checked:ring-2 checked:ring-supportive-lilac-100',\n\t\t\t\t\t'checked:hover:bg-supportive-lilac-700 checked:hover:border-black-teal/20',\n\t\t\t\t],\n\t\t\t\ttrue: 'bg-white-600 border-black-teal-50 cursor-not-allowed ',\n\t\t\t},\n\t\t},\n\t}\n);\n\nconst circle = cva(\n\t[\n\t\t'flex items-center justify-center',\n\t\t'rounded-full transition-all ',\n\t\t'absolute top-1/2 peer-checked:left-full transform -translate-y-1/2 pointer-events-none',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tdisabled: {\n\t\t\t\tfalse: [\n\t\t\t\t\t'bg-white ring-1 ring-black-teal/10',\n\t\t\t\t\t'left-[1px] peer-checked:-translate-x-[calc(100%+1px)]',\n\t\t\t\t\t\"after:content-[] peer-checked:after:content-[''] after:bg-supportive-lilac-800 after:rounded-full after:transition-all\",\n\t\t\t\t\t'w-[14px] h-[14px] group-hover:w-[18px]',\n\t\t\t\t\t'after:w-1 after:h-1 group-hover:after:w-2',\n\t\t\t\t],\n\t\t\t\ttrue: [\n\t\t\t\t\t'bg-black-teal-100 peer-checked:bg-black-teal-200',\n\t\t\t\t\t'left-[2px] peer-checked:-translate-x-[calc(100%+2px)]',\n\t\t\t\t\t'w-3 h-3',\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t}\n);\n\n@Component({\n\ttag: 'p-toggle',\n\tstyleUrl: 'toggle.component.css',\n})\nexport class Toggle {\n\t/**\n\t * Wether the checkbox is checked\n\t */\n\t@Prop() checked: boolean;\n\n\t/**\n\t * Wether the checkbox is in indeterminate state\n\t */\n\t@Prop() indeterminate: boolean;\n\n\t/**\n\t * Wether the checkbox is disabled\n\t */\n\t@Prop({ reflect: true }) disabled: boolean = false;\n\n\t/**\n\t * Wether the checkbox is required\n\t */\n\t@Prop({ reflect: true }) required: boolean = true;\n\n\t/**\n\t * The id of the checkbox button\n\t */\n\t@Prop({ reflect: true }) id: string;\n\n\t/**\n\t * The name of the checkbox button\n\t */\n\t@Prop({ reflect: true }) name: string;\n\n\t/**\n\t * Event whenever the checked changes\n\t */\n\t@Event() checkedChange: EventEmitter<boolean>;\n\t/**\n\t * Event whenever the indeterminate changes\n\t */\n\t@Event() indeterminateChange: EventEmitter<boolean>;\n\n\t@State() private _nonce = nonce(5);\n\n\trender() {\n\t\treturn (\n\t\t\t<Host class='p-checkbox'>\n\t\t\t\t<label\n\t\t\t\t\thtmlFor={this.id ?? this._nonce}\n\t\t\t\t\tclass='flex items-center justify-start gap-2 text-black-teal'\n\t\t\t\t>\n\t\t\t\t\t<div class='group relative flex flex-shrink-0 items-center'>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclass={checkbox({\n\t\t\t\t\t\t\t\tdisabled: this.disabled,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\ttype='checkbox'\n\t\t\t\t\t\t\tid={this.id ?? this._nonce}\n\t\t\t\t\t\t\tname={this.name}\n\t\t\t\t\t\t\trequired={this.required}\n\t\t\t\t\t\t\tchecked={!!this.checked}\n\t\t\t\t\t\t\tindeterminate={this.indeterminate}\n\t\t\t\t\t\t\tdisabled={this.disabled}\n\t\t\t\t\t\t\tonChange={ev => this._onChange(ev)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass={circle({\n\t\t\t\t\t\t\t\tdisabled: this.disabled,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</label>\n\t\t\t</Host>\n\t\t);\n\t}\n\n\tprivate _onChange(ev: Event) {\n\t\tif (this.disabled) {\n\t\t\tev.preventDefault();\n\t\t\treturn;\n\t\t}\n\n\t\tconst checked = (ev.target as HTMLInputElement).checked;\n\t\tconst indeterminate = (ev.target as HTMLInputElement).indeterminate;\n\n\t\tif (checked != this.checked) {\n\t\t\tthis.checked = checked;\n\t\t\tthis.checkedChange.emit(checked);\n\t\t}\n\n\t\tif (indeterminate != this.indeterminate) {\n\t\t\tthis.indeterminate = indeterminate;\n\t\t\tthis.indeterminateChange.emit(indeterminate);\n\t\t}\n\t}\n}\n"],"version":3}
|