@getflip/swirl-components 0.459.1 → 0.459.2-beta-20260316104125
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/components.json +1 -1
- package/dist/cjs/swirl-accordion.cjs.entry.js +2 -2
- package/dist/cjs/swirl-form-control.cjs.entry.js +5 -3
- package/dist/cjs/swirl-lightbox.cjs.entry.js +1 -1
- package/dist/cjs/swirl-option-list.cjs.entry.js +10 -1
- package/dist/cjs/swirl-popover_2.cjs.entry.js +24 -17
- package/dist/cjs/swirl-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/swirl-resource-list.cjs.entry.js +4 -2
- package/dist/collection/components/swirl-accordion/swirl-accordion.js +2 -2
- package/dist/collection/components/swirl-form-control/swirl-form-control.js +5 -3
- package/dist/collection/components/swirl-lightbox/swirl-lightbox.js +1 -1
- package/dist/collection/components/swirl-option-list/swirl-option-list.js +10 -1
- package/dist/collection/components/swirl-popover/swirl-popover.js +6 -4
- package/dist/collection/components/swirl-popover-trigger/swirl-popover-trigger.js +18 -13
- package/dist/collection/components/swirl-radio-group/swirl-radio-group.js +2 -2
- package/dist/collection/components/swirl-resource-list/swirl-resource-list.js +4 -2
- package/dist/components/swirl-accordion.js +1 -1
- package/dist/components/swirl-form-control.js +1 -1
- package/dist/components/swirl-lightbox.js +1 -1
- package/dist/components/swirl-option-list2.js +1 -1
- package/dist/components/swirl-popover-trigger2.js +1 -1
- package/dist/components/swirl-popover2.js +1 -1
- package/dist/components/swirl-radio-group.js +1 -1
- package/dist/components/swirl-resource-list.js +1 -1
- package/dist/esm/swirl-accordion.entry.js +2 -2
- package/dist/esm/swirl-form-control.entry.js +5 -3
- package/dist/esm/swirl-lightbox.entry.js +1 -1
- package/dist/esm/swirl-option-list.entry.js +10 -1
- package/dist/esm/swirl-popover_2.entry.js +24 -17
- package/dist/esm/swirl-radio-group.entry.js +2 -2
- package/dist/esm/swirl-resource-list.entry.js +4 -2
- package/dist/swirl-components/p-28697a8d.entry.js +1 -0
- package/dist/swirl-components/p-39a0c9b8.entry.js +1 -0
- package/dist/swirl-components/p-4a9efdb9.entry.js +1 -0
- package/dist/swirl-components/p-4d1ff78b.entry.js +1 -0
- package/dist/swirl-components/p-66abd654.entry.js +1 -0
- package/dist/swirl-components/p-c997cd1d.entry.js +1 -0
- package/dist/swirl-components/{p-55e7c739.entry.js → p-fd26fb01.entry.js} +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-accordion/swirl-accordion.d.ts +1 -1
- package/dist/types/components/swirl-form-control/swirl-form-control.d.ts +1 -0
- package/dist/types/components/swirl-lightbox/swirl-lightbox.d.ts +1 -1
- package/dist/types/components/swirl-option-list/swirl-option-list.d.ts +2 -0
- package/dist/types/components/swirl-popover/swirl-popover.d.ts +1 -0
- package/dist/types/components/swirl-popover-trigger/swirl-popover-trigger.d.ts +2 -0
- package/dist/types/components/swirl-radio-group/swirl-radio-group.d.ts +1 -1
- package/dist/types/components/swirl-resource-list/swirl-resource-list.d.ts +1 -0
- package/package.json +1 -1
- package/dist/swirl-components/p-12a3b660.entry.js +0 -1
- package/dist/swirl-components/p-3e1f2e7d.entry.js +0 -1
- package/dist/swirl-components/p-43781b60.entry.js +0 -1
- package/dist/swirl-components/p-536a5865.entry.js +0 -1
- package/dist/swirl-components/p-7285071d.entry.js +0 -1
- package/dist/swirl-components/p-ef3b0d2f.entry.js +0 -1
package/components.json
CHANGED
|
@@ -16,7 +16,7 @@ const SwirlAccordion = class {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
connectedCallback() {
|
|
20
20
|
this.el.addEventListener("expansionChange", this.onExpansionChange);
|
|
21
21
|
}
|
|
22
22
|
disconnectedCallback() {
|
|
@@ -53,7 +53,7 @@ const SwirlAccordion = class {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
render() {
|
|
56
|
-
return (index.h(index.Host, { key: '
|
|
56
|
+
return (index.h(index.Host, { key: '1f6137c28a45e18096736147c4d0b09daf963bc9' }, index.h("slot", { key: '946dd241ee4b9375853ba7f3197f02ca484f431e' })));
|
|
57
57
|
}
|
|
58
58
|
get el() { return index.getElement(this); }
|
|
59
59
|
};
|
|
@@ -40,8 +40,11 @@ const SwirlFormControl = class {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
connectedCallback() {
|
|
44
44
|
this.inputEl = this.el.firstElementChild;
|
|
45
|
+
this.listenToInputValueChanges();
|
|
46
|
+
}
|
|
47
|
+
componentWillLoad() {
|
|
45
48
|
this.associateDescriptionWithInputElement();
|
|
46
49
|
this.associateLabelWithInputElement();
|
|
47
50
|
this.setInputElementDisabledState();
|
|
@@ -50,7 +53,6 @@ const SwirlFormControl = class {
|
|
|
50
53
|
this.setInputElementInvalidState();
|
|
51
54
|
this.setInputElementLabel();
|
|
52
55
|
this.checkInputValue();
|
|
53
|
-
this.listenToInputValueChanges();
|
|
54
56
|
}
|
|
55
57
|
componentDidRender() {
|
|
56
58
|
this.checkInputValue();
|
|
@@ -184,7 +186,7 @@ const SwirlFormControl = class {
|
|
|
184
186
|
"form-control--is-select": isSelect,
|
|
185
187
|
});
|
|
186
188
|
const LabelTag = hasContenteditableControl ? "div" : "label";
|
|
187
|
-
return (index.h(index.Host, { key: '
|
|
189
|
+
return (index.h(index.Host, { key: '6915a563e238b5301eec46a0e419d64ceffcdba4', onFocusin: this.onFocusIn, onFocusout: this.onFocusOut, onKeyDown: this.onKeyDown }, index.h("div", { key: 'ea2bbf01a71ec9d044479659b369629993cf6ecc', class: className, role: "group" }, index.h("span", { key: '8e1b4ad354ae02007231f4875a174b2e5cf7f2c0', class: "form-control__controls" }, index.h("span", { key: '1f7554dc19d9cd77bd7434261e0b28a8dd1da519', class: "form-control__prefix" }, index.h("slot", { key: '2e80b1680d0647b36f9a9e2ef1f169d59009a315', name: "prefix" })), index.h(LabelTag, { key: 'c7d0c330cb17be854abc0bfdecb6df1207c05574', class: "form-control__label", onClick: this.onLabelClick }, hasIcon && (index.h("span", { key: 'c144e2c24605112ffe728caf84282058f5e253d4', class: "form-control__icon" }, index.h("swirl-icon", { key: '29f17ec92c2d0c83f052659cd0465125c67651a1', glyph: this.icon, size: 20 }))), index.h("span", { key: 'd3f55b1b5dbc1e8a84dae5a1c2b8c63085679c61', class: "form-control__label-text", id: this.labelId }, this.label, this.secondaryLabel && this.labelPosition === "outside" && (index.h("span", { key: '621ad4301acc7716a14c3f41b2077123742897d8', class: "form-control__secondary-label" }, this.secondaryLabel)), this.tooltip && (index.h("span", { key: 'fff38bec9521273b202b4d6c30fe3673e5363460', class: "form-control__tooltip" }, index.h("swirl-tooltip", { key: '5e19071975fdd95f6562e32b3bc509c68d294fb9', content: this.tooltip, position: "top" }, index.h("swirl-icon-help", { key: '0d7026620a38276a4b46e7a27e13f088dda60bb4', size: 16, tabindex: "0" }))))), index.h("span", { key: 'b5f7cdcb12dc5fe585b9e05f8209b4c1f29a373f', class: "form-control__input" }, index.h("slot", { key: '1069cced3e9943fcac7937398102de05bc5880fd' }), index.h("span", { key: 'f5844abbe3f4e8137df79c3138883ecad311badd', class: "form-control__bottom" }, index.h("slot", { key: 'f279db84c9dcdd958f20486d034cc25be619ab29', name: "bottom" }))))), showDescription && (index.h("span", { key: '20697b04f91cfa4e8b6d8e0f6011f21c475d3ee6', class: "form-control__description", id: this.descriptionId }, this.description)), index.h("span", { key: 'f14ac6afa9bb8bac5834527134a21fc8a5ea2071', "aria-live": "polite" }, showErrorMessage && (index.h("span", { key: 'df3148dff898088dc6c4dbcc184a51baf7a02dea', class: "form-control__error-message", id: this.descriptionId }, index.h("swirl-inline-error", { key: '0e3ca419be23aee94adcbdc0a856de1b0afa39d8', message: this.errorMessage, size: "s" })))))));
|
|
188
190
|
}
|
|
189
191
|
get el() { return index.getElement(this); }
|
|
190
192
|
static get watchers() { return {
|
|
@@ -19,6 +19,7 @@ const SwirlOptionList = class {
|
|
|
19
19
|
this.selectAllLabel = "Select all";
|
|
20
20
|
this.value = [];
|
|
21
21
|
this.selectAllState = false;
|
|
22
|
+
this.componentLoaded = false;
|
|
22
23
|
this.selectAllValue = v4.v4();
|
|
23
24
|
this.onClick = (event) => {
|
|
24
25
|
event.preventDefault();
|
|
@@ -155,6 +156,13 @@ const SwirlOptionList = class {
|
|
|
155
156
|
this.focusItem(newIndex);
|
|
156
157
|
};
|
|
157
158
|
}
|
|
159
|
+
connectedCallback() {
|
|
160
|
+
if (this.componentLoaded) {
|
|
161
|
+
this.observeSlotChanges();
|
|
162
|
+
this.subscribeToSwirlPopover();
|
|
163
|
+
this.setItemAllowDragState();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
158
166
|
componentDidLoad() {
|
|
159
167
|
this.updateItems();
|
|
160
168
|
this.observeSlotChanges();
|
|
@@ -166,6 +174,7 @@ const SwirlOptionList = class {
|
|
|
166
174
|
this.setSectionSeparator();
|
|
167
175
|
this.setSelectAllState();
|
|
168
176
|
this.subscribeToSwirlPopover();
|
|
177
|
+
this.componentLoaded = true;
|
|
169
178
|
}
|
|
170
179
|
componentDidRender() {
|
|
171
180
|
this.setupDragDrop();
|
|
@@ -442,7 +451,7 @@ const SwirlOptionList = class {
|
|
|
442
451
|
const ariaMultiselectable = this.multiSelect ? "true" : undefined;
|
|
443
452
|
const tabIndex = Boolean(this.dragging) ? 0 : undefined;
|
|
444
453
|
const showSelectAll = this.multiSelect && this.showSelectAll;
|
|
445
|
-
return (index.h(index.Host, { key: '
|
|
454
|
+
return (index.h(index.Host, { key: 'ccde136da1bd0cc0217da24507a6c59954533bbd' }, index.h("swirl-visually-hidden", { key: 'c34905445208114685344f415572858ac91e7cc1', role: "alert" }, this.assistiveText), index.h("div", { key: '22d3f09f10f9bbdfce4455ad00383ceaa6bd2378', "aria-label": this.label, "aria-multiselectable": ariaMultiselectable, class: "option-list", id: this.optionListId, onClick: this.onClick, onKeyDown: this.onKeyDown, ref: (el) => (this.listboxEl = el), role: "listbox", tabIndex: tabIndex }, showSelectAll && (index.h("swirl-option-list-item", { key: 'd7890cd65febc6249561f12be58e128965a5f246', ref: (el) => (this.selectAllEl = el), label: this.selectAllLabel, disabled: this.disabled, context: "multi-select", selected: this.selectAllState === true, indeterminate: this.selectAllState === "indeterminate", value: this.selectAllValue })), index.h("slot", { key: '4d334f92999da727c34dc4d09d803698e6a3df20', onSlotchange: this.setSectionSeparator }))));
|
|
446
455
|
}
|
|
447
456
|
get el() { return index.getElement(this); }
|
|
448
457
|
static get watchers() { return {
|
|
@@ -73,8 +73,10 @@ const SwirlPopover = class {
|
|
|
73
73
|
this.close();
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
connectedCallback() {
|
|
77
77
|
this.connectTrigger();
|
|
78
|
+
}
|
|
79
|
+
componentDidLoad() {
|
|
78
80
|
this.updateTriggerAttributes();
|
|
79
81
|
if (Boolean(this.trigger)) {
|
|
80
82
|
console.warn('[Swirl] The "trigger" prop of swirl-popover is deprecated and will be removed with the next major release. Please use the swirl-popover-trigger component instead. https://swirl-storybook.flip-app.dev/?path=/docs/components-swirlpopovertrigger--docs');
|
|
@@ -308,16 +310,16 @@ const SwirlPopover = class {
|
|
|
308
310
|
"popover--transparent": this.transparent,
|
|
309
311
|
"popover--padded": this.padded,
|
|
310
312
|
});
|
|
311
|
-
return (index.h(index.Host, { key: '
|
|
313
|
+
return (index.h(index.Host, { key: 'e13802f20876c880190d801e6f1ef92384594223' }, index.h("div", { key: 'df4ed0a350c388200d932a3ef28b0e34a4de477c', popover: "manual", class: className, onKeyDown: this.onKeydown, ref: (el) => (this.popoverEl = el) }, index.h("div", { key: 'fe0b70d78e58130e548d985da628cdb1ab240406', "aria-hidden": !this.active ? "true" : "false", "aria-label": this.label, class: "popover__content", id: this.popoverId, part: "popover__content", role: "dialog", ref: (el) => (this.contentContainer = el), style: {
|
|
312
314
|
top: Boolean(this.position) ? `${this.position?.y}px` : "",
|
|
313
315
|
left: Boolean(this.position) ? `${this.position?.x}px` : "",
|
|
314
316
|
visibility: this.active && !this.position && !mobile ? "hidden" : undefined,
|
|
315
317
|
"--swirl-popover-border-radius": borderRadius,
|
|
316
|
-
}, tabindex: "-1" }, index.h("span", { key: '
|
|
318
|
+
}, tabindex: "-1" }, index.h("span", { key: 'bb43bf1de00f9da559346aa72d6f2cd15fee240a', class: "popover__handle" }), index.h("div", { key: '2d6778670b6c6316b93629813e4dfae7b793ac27', class: "popover__scroll-container", part: "popover__scroll-container", ref: (el) => (this.scrollContainer = el), style: {
|
|
317
319
|
maxHeight: !mobile && Boolean(this.maxHeight)
|
|
318
320
|
? this.maxHeight
|
|
319
321
|
: undefined,
|
|
320
|
-
} }, index.h("slot", { key: '
|
|
322
|
+
} }, index.h("slot", { key: '88e7009099df69e6d81ba66d97713a002458ace4' }))), this.active && (index.h("div", { key: '1370c89b9af85d29d4950537cdec69f4bc306ad1', class: "popover__backdrop", onClick: this.onCloseButtonClick })))));
|
|
321
323
|
}
|
|
322
324
|
get el() { return index.getElement(this); }
|
|
323
325
|
};
|
|
@@ -419,20 +421,12 @@ const SwirlPopoverTrigger = class {
|
|
|
419
421
|
}
|
|
420
422
|
};
|
|
421
423
|
}
|
|
424
|
+
connectedCallback() {
|
|
425
|
+
this.setupHoverListeners();
|
|
426
|
+
this.setupIntersectionObserver();
|
|
427
|
+
}
|
|
422
428
|
componentDidLoad() {
|
|
423
429
|
this.updateTriggerElAriaAttributes();
|
|
424
|
-
this.setupHoverListeners();
|
|
425
|
-
if (this.hidePopoverWhenInvisible) {
|
|
426
|
-
this.intersectionObserver = new IntersectionObserver(this.onVisibilityChange.bind(this), {
|
|
427
|
-
root: this.parentScrollContainer,
|
|
428
|
-
threshold: 1,
|
|
429
|
-
});
|
|
430
|
-
const firstChild = this.el.querySelector("*");
|
|
431
|
-
if (!Boolean(firstChild)) {
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
this.intersectionObserver.observe(firstChild);
|
|
435
|
-
}
|
|
436
430
|
}
|
|
437
431
|
disconnectedCallback() {
|
|
438
432
|
this.intersectionObserver?.disconnect();
|
|
@@ -460,6 +454,19 @@ const SwirlPopoverTrigger = class {
|
|
|
460
454
|
}
|
|
461
455
|
return this.el.children[0];
|
|
462
456
|
}
|
|
457
|
+
setupIntersectionObserver() {
|
|
458
|
+
if (this.hidePopoverWhenInvisible) {
|
|
459
|
+
this.intersectionObserver = new IntersectionObserver(this.onVisibilityChange.bind(this), {
|
|
460
|
+
root: this.parentScrollContainer,
|
|
461
|
+
threshold: 1,
|
|
462
|
+
});
|
|
463
|
+
const firstChild = this.el.querySelector("*");
|
|
464
|
+
if (!Boolean(firstChild)) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
this.intersectionObserver.observe(firstChild);
|
|
468
|
+
}
|
|
469
|
+
}
|
|
463
470
|
onVisibilityChange(entries) {
|
|
464
471
|
const triggerIsVisible = entries[0].isIntersecting;
|
|
465
472
|
if (!triggerIsVisible && this.isPopoverOpen()) {
|
|
@@ -497,7 +504,7 @@ const SwirlPopoverTrigger = class {
|
|
|
497
504
|
return isActive;
|
|
498
505
|
}
|
|
499
506
|
render() {
|
|
500
|
-
return (index.h(index.Host, { key: '
|
|
507
|
+
return (index.h(index.Host, { key: 'c3f8abef369c944c9fbaf9cb11ea31ecde57b5cc', onClick: this.onClick, onMouseenter: this.onMouseenter, onMouseleave: this.onMouseleave }, index.h("slot", { key: '88053a62f9804a5a66d809829d047fae3ddf16ab' })));
|
|
501
508
|
}
|
|
502
509
|
get el() { return index.getElement(this); }
|
|
503
510
|
static get watchers() { return {
|
|
@@ -22,7 +22,7 @@ const SwirlRadioGroup = class {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
connectedCallback() {
|
|
26
26
|
this.radioButtons = Array.from(this.el.querySelectorAll("swirl-radio"));
|
|
27
27
|
this.initValue();
|
|
28
28
|
this.addValueChangeListeners();
|
|
@@ -51,7 +51,7 @@ const SwirlRadioGroup = class {
|
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
|
-
return (index.h(index.Host, { key: '
|
|
54
|
+
return (index.h(index.Host, { key: '843c405062c889e74be2452e0498931d17a65177', "aria-describedby": this.swirlAriaDescribedby, role: "radiogroup" }, index.h("div", { key: '06a6114696d469d6fe0ef41c9f952082aa5d124b', class: "radio-group" }, index.h("slot", { key: '56871a249dc67fb0a5f24814e57e6970112942b0' }))));
|
|
55
55
|
}
|
|
56
56
|
get el() { return index.getElement(this); }
|
|
57
57
|
};
|
|
@@ -92,11 +92,13 @@ const SwirlResourceList = class {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
connectedCallback() {
|
|
96
96
|
this.observeSlotChanges();
|
|
97
97
|
this.collectItems();
|
|
98
98
|
this.setupControllingElement();
|
|
99
99
|
this.setItemAllowDragState();
|
|
100
|
+
}
|
|
101
|
+
componentDidLoad() {
|
|
100
102
|
this.setupDragDrop();
|
|
101
103
|
this.setSectionSpacingAndSeparator();
|
|
102
104
|
}
|
|
@@ -273,7 +275,7 @@ const SwirlResourceList = class {
|
|
|
273
275
|
});
|
|
274
276
|
}
|
|
275
277
|
render() {
|
|
276
|
-
return (index.h(index.Host, { key: '
|
|
278
|
+
return (index.h(index.Host, { key: '1ee5cc333ec6b97ba9b73292d7c4d3907be34f06', onKeyDown: this.onKeyDown }, index.h("swirl-visually-hidden", { key: '09291dc20b98e59c89be768d536ae7800e1c620d', role: "alert" }, this.assistiveText), index.h("swirl-box", { key: 'ff790da5bcaec4c738340150b23ea8f622175493', paddingBlockEnd: this.paddingBlockEnd ?? this.padding, paddingBlockStart: this.paddingBlockStart ?? this.padding, paddingInlineEnd: this.paddingInlineEnd ?? this.padding ?? "8", paddingInlineStart: this.paddingInlineStart ?? this.padding ?? "8" }, index.h("swirl-stack", { key: 'f43368058ebd4375da12f0348f6c50ef9816bb27', "aria-label": this.label, class: "resource-list", id: this.listId, ref: (el) => (this.gridEl = el), role: this.semantics, spacing: this.spacing }, index.h("slot", { key: '02c4a02b46c56b8c501e4fab98c698ce4514b689' })))));
|
|
277
279
|
}
|
|
278
280
|
get el() { return index.getElement(this); }
|
|
279
281
|
static get watchers() { return {
|
|
@@ -12,7 +12,7 @@ export class SwirlAccordion {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
connectedCallback() {
|
|
16
16
|
this.el.addEventListener("expansionChange", this.onExpansionChange);
|
|
17
17
|
}
|
|
18
18
|
disconnectedCallback() {
|
|
@@ -49,7 +49,7 @@ export class SwirlAccordion {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
|
-
return (h(Host, { key: '
|
|
52
|
+
return (h(Host, { key: '1f6137c28a45e18096736147c4d0b09daf963bc9' }, h("slot", { key: '946dd241ee4b9375853ba7f3197f02ca484f431e' })));
|
|
53
53
|
}
|
|
54
54
|
static get is() { return "swirl-accordion"; }
|
|
55
55
|
static get encapsulation() { return "shadow"; }
|
|
@@ -39,8 +39,11 @@ export class SwirlFormControl {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
connectedCallback() {
|
|
43
43
|
this.inputEl = this.el.firstElementChild;
|
|
44
|
+
this.listenToInputValueChanges();
|
|
45
|
+
}
|
|
46
|
+
componentWillLoad() {
|
|
44
47
|
this.associateDescriptionWithInputElement();
|
|
45
48
|
this.associateLabelWithInputElement();
|
|
46
49
|
this.setInputElementDisabledState();
|
|
@@ -49,7 +52,6 @@ export class SwirlFormControl {
|
|
|
49
52
|
this.setInputElementInvalidState();
|
|
50
53
|
this.setInputElementLabel();
|
|
51
54
|
this.checkInputValue();
|
|
52
|
-
this.listenToInputValueChanges();
|
|
53
55
|
}
|
|
54
56
|
componentDidRender() {
|
|
55
57
|
this.checkInputValue();
|
|
@@ -183,7 +185,7 @@ export class SwirlFormControl {
|
|
|
183
185
|
"form-control--is-select": isSelect,
|
|
184
186
|
});
|
|
185
187
|
const LabelTag = hasContenteditableControl ? "div" : "label";
|
|
186
|
-
return (h(Host, { key: '
|
|
188
|
+
return (h(Host, { key: '6915a563e238b5301eec46a0e419d64ceffcdba4', onFocusin: this.onFocusIn, onFocusout: this.onFocusOut, onKeyDown: this.onKeyDown }, h("div", { key: 'ea2bbf01a71ec9d044479659b369629993cf6ecc', class: className, role: "group" }, h("span", { key: '8e1b4ad354ae02007231f4875a174b2e5cf7f2c0', class: "form-control__controls" }, h("span", { key: '1f7554dc19d9cd77bd7434261e0b28a8dd1da519', class: "form-control__prefix" }, h("slot", { key: '2e80b1680d0647b36f9a9e2ef1f169d59009a315', name: "prefix" })), h(LabelTag, { key: 'c7d0c330cb17be854abc0bfdecb6df1207c05574', class: "form-control__label", onClick: this.onLabelClick }, hasIcon && (h("span", { key: 'c144e2c24605112ffe728caf84282058f5e253d4', class: "form-control__icon" }, h("swirl-icon", { key: '29f17ec92c2d0c83f052659cd0465125c67651a1', glyph: this.icon, size: 20 }))), h("span", { key: 'd3f55b1b5dbc1e8a84dae5a1c2b8c63085679c61', class: "form-control__label-text", id: this.labelId }, this.label, this.secondaryLabel && this.labelPosition === "outside" && (h("span", { key: '621ad4301acc7716a14c3f41b2077123742897d8', class: "form-control__secondary-label" }, this.secondaryLabel)), this.tooltip && (h("span", { key: 'fff38bec9521273b202b4d6c30fe3673e5363460', class: "form-control__tooltip" }, h("swirl-tooltip", { key: '5e19071975fdd95f6562e32b3bc509c68d294fb9', content: this.tooltip, position: "top" }, h("swirl-icon-help", { key: '0d7026620a38276a4b46e7a27e13f088dda60bb4', size: 16, tabindex: "0" }))))), h("span", { key: 'b5f7cdcb12dc5fe585b9e05f8209b4c1f29a373f', class: "form-control__input" }, h("slot", { key: '1069cced3e9943fcac7937398102de05bc5880fd' }), h("span", { key: 'f5844abbe3f4e8137df79c3138883ecad311badd', class: "form-control__bottom" }, h("slot", { key: 'f279db84c9dcdd958f20486d034cc25be619ab29', name: "bottom" }))))), showDescription && (h("span", { key: '20697b04f91cfa4e8b6d8e0f6011f21c475d3ee6', class: "form-control__description", id: this.descriptionId }, this.description)), h("span", { key: 'f14ac6afa9bb8bac5834527134a21fc8a5ea2071', "aria-live": "polite" }, showErrorMessage && (h("span", { key: 'df3148dff898088dc6c4dbcc184a51baf7a02dea', class: "form-control__error-message", id: this.descriptionId }, h("swirl-inline-error", { key: '0e3ca419be23aee94adcbdc0a856de1b0afa39d8', message: this.errorMessage, size: "s" })))))));
|
|
187
189
|
}
|
|
188
190
|
static get is() { return "swirl-form-control"; }
|
|
189
191
|
static get encapsulation() { return "scoped"; }
|
|
@@ -14,6 +14,7 @@ export class SwirlOptionList {
|
|
|
14
14
|
this.selectAllLabel = "Select all";
|
|
15
15
|
this.value = [];
|
|
16
16
|
this.selectAllState = false;
|
|
17
|
+
this.componentLoaded = false;
|
|
17
18
|
this.selectAllValue = uuid();
|
|
18
19
|
this.onClick = (event) => {
|
|
19
20
|
event.preventDefault();
|
|
@@ -150,6 +151,13 @@ export class SwirlOptionList {
|
|
|
150
151
|
this.focusItem(newIndex);
|
|
151
152
|
};
|
|
152
153
|
}
|
|
154
|
+
connectedCallback() {
|
|
155
|
+
if (this.componentLoaded) {
|
|
156
|
+
this.observeSlotChanges();
|
|
157
|
+
this.subscribeToSwirlPopover();
|
|
158
|
+
this.setItemAllowDragState();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
153
161
|
componentDidLoad() {
|
|
154
162
|
this.updateItems();
|
|
155
163
|
this.observeSlotChanges();
|
|
@@ -161,6 +169,7 @@ export class SwirlOptionList {
|
|
|
161
169
|
this.setSectionSeparator();
|
|
162
170
|
this.setSelectAllState();
|
|
163
171
|
this.subscribeToSwirlPopover();
|
|
172
|
+
this.componentLoaded = true;
|
|
164
173
|
}
|
|
165
174
|
componentDidRender() {
|
|
166
175
|
this.setupDragDrop();
|
|
@@ -437,7 +446,7 @@ export class SwirlOptionList {
|
|
|
437
446
|
const ariaMultiselectable = this.multiSelect ? "true" : undefined;
|
|
438
447
|
const tabIndex = Boolean(this.dragging) ? 0 : undefined;
|
|
439
448
|
const showSelectAll = this.multiSelect && this.showSelectAll;
|
|
440
|
-
return (h(Host, { key: '
|
|
449
|
+
return (h(Host, { key: 'ccde136da1bd0cc0217da24507a6c59954533bbd' }, h("swirl-visually-hidden", { key: 'c34905445208114685344f415572858ac91e7cc1', role: "alert" }, this.assistiveText), h("div", { key: '22d3f09f10f9bbdfce4455ad00383ceaa6bd2378', "aria-label": this.label, "aria-multiselectable": ariaMultiselectable, class: "option-list", id: this.optionListId, onClick: this.onClick, onKeyDown: this.onKeyDown, ref: (el) => (this.listboxEl = el), role: "listbox", tabIndex: tabIndex }, showSelectAll && (h("swirl-option-list-item", { key: 'd7890cd65febc6249561f12be58e128965a5f246', ref: (el) => (this.selectAllEl = el), label: this.selectAllLabel, disabled: this.disabled, context: "multi-select", selected: this.selectAllState === true, indeterminate: this.selectAllState === "indeterminate", value: this.selectAllValue })), h("slot", { key: '4d334f92999da727c34dc4d09d803698e6a3df20', onSlotchange: this.setSectionSeparator }))));
|
|
441
450
|
}
|
|
442
451
|
static get is() { return "swirl-option-list"; }
|
|
443
452
|
static get encapsulation() { return "scoped"; }
|
|
@@ -68,8 +68,10 @@ export class SwirlPopover {
|
|
|
68
68
|
this.close();
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
|
|
71
|
+
connectedCallback() {
|
|
72
72
|
this.connectTrigger();
|
|
73
|
+
}
|
|
74
|
+
componentDidLoad() {
|
|
73
75
|
this.updateTriggerAttributes();
|
|
74
76
|
if (Boolean(this.trigger)) {
|
|
75
77
|
console.warn('[Swirl] The "trigger" prop of swirl-popover is deprecated and will be removed with the next major release. Please use the swirl-popover-trigger component instead. https://swirl-storybook.flip-app.dev/?path=/docs/components-swirlpopovertrigger--docs');
|
|
@@ -303,16 +305,16 @@ export class SwirlPopover {
|
|
|
303
305
|
"popover--transparent": this.transparent,
|
|
304
306
|
"popover--padded": this.padded,
|
|
305
307
|
});
|
|
306
|
-
return (h(Host, { key: '
|
|
308
|
+
return (h(Host, { key: 'e13802f20876c880190d801e6f1ef92384594223' }, h("div", { key: 'df4ed0a350c388200d932a3ef28b0e34a4de477c', popover: "manual", class: className, onKeyDown: this.onKeydown, ref: (el) => (this.popoverEl = el) }, h("div", { key: 'fe0b70d78e58130e548d985da628cdb1ab240406', "aria-hidden": !this.active ? "true" : "false", "aria-label": this.label, class: "popover__content", id: this.popoverId, part: "popover__content", role: "dialog", ref: (el) => (this.contentContainer = el), style: {
|
|
307
309
|
top: Boolean(this.position) ? `${this.position?.y}px` : "",
|
|
308
310
|
left: Boolean(this.position) ? `${this.position?.x}px` : "",
|
|
309
311
|
visibility: this.active && !this.position && !mobile ? "hidden" : undefined,
|
|
310
312
|
"--swirl-popover-border-radius": borderRadius,
|
|
311
|
-
}, tabindex: "-1" }, h("span", { key: '
|
|
313
|
+
}, tabindex: "-1" }, h("span", { key: 'bb43bf1de00f9da559346aa72d6f2cd15fee240a', class: "popover__handle" }), h("div", { key: '2d6778670b6c6316b93629813e4dfae7b793ac27', class: "popover__scroll-container", part: "popover__scroll-container", ref: (el) => (this.scrollContainer = el), style: {
|
|
312
314
|
maxHeight: !mobile && Boolean(this.maxHeight)
|
|
313
315
|
? this.maxHeight
|
|
314
316
|
: undefined,
|
|
315
|
-
} }, h("slot", { key: '
|
|
317
|
+
} }, h("slot", { key: '88e7009099df69e6d81ba66d97713a002458ace4' }))), this.active && (h("div", { key: '1370c89b9af85d29d4950537cdec69f4bc306ad1', class: "popover__backdrop", onClick: this.onCloseButtonClick })))));
|
|
316
318
|
}
|
|
317
319
|
static get is() { return "swirl-popover"; }
|
|
318
320
|
static get encapsulation() { return "shadow"; }
|
|
@@ -95,20 +95,12 @@ export class SwirlPopoverTrigger {
|
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
|
+
connectedCallback() {
|
|
99
|
+
this.setupHoverListeners();
|
|
100
|
+
this.setupIntersectionObserver();
|
|
101
|
+
}
|
|
98
102
|
componentDidLoad() {
|
|
99
103
|
this.updateTriggerElAriaAttributes();
|
|
100
|
-
this.setupHoverListeners();
|
|
101
|
-
if (this.hidePopoverWhenInvisible) {
|
|
102
|
-
this.intersectionObserver = new IntersectionObserver(this.onVisibilityChange.bind(this), {
|
|
103
|
-
root: this.parentScrollContainer,
|
|
104
|
-
threshold: 1,
|
|
105
|
-
});
|
|
106
|
-
const firstChild = this.el.querySelector("*");
|
|
107
|
-
if (!Boolean(firstChild)) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
this.intersectionObserver.observe(firstChild);
|
|
111
|
-
}
|
|
112
104
|
}
|
|
113
105
|
disconnectedCallback() {
|
|
114
106
|
this.intersectionObserver?.disconnect();
|
|
@@ -136,6 +128,19 @@ export class SwirlPopoverTrigger {
|
|
|
136
128
|
}
|
|
137
129
|
return this.el.children[0];
|
|
138
130
|
}
|
|
131
|
+
setupIntersectionObserver() {
|
|
132
|
+
if (this.hidePopoverWhenInvisible) {
|
|
133
|
+
this.intersectionObserver = new IntersectionObserver(this.onVisibilityChange.bind(this), {
|
|
134
|
+
root: this.parentScrollContainer,
|
|
135
|
+
threshold: 1,
|
|
136
|
+
});
|
|
137
|
+
const firstChild = this.el.querySelector("*");
|
|
138
|
+
if (!Boolean(firstChild)) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.intersectionObserver.observe(firstChild);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
139
144
|
onVisibilityChange(entries) {
|
|
140
145
|
const triggerIsVisible = entries[0].isIntersecting;
|
|
141
146
|
if (!triggerIsVisible && this.isPopoverOpen()) {
|
|
@@ -173,7 +178,7 @@ export class SwirlPopoverTrigger {
|
|
|
173
178
|
return isActive;
|
|
174
179
|
}
|
|
175
180
|
render() {
|
|
176
|
-
return (h(Host, { key: '
|
|
181
|
+
return (h(Host, { key: 'c3f8abef369c944c9fbaf9cb11ea31ecde57b5cc', onClick: this.onClick, onMouseenter: this.onMouseenter, onMouseleave: this.onMouseleave }, h("slot", { key: '88053a62f9804a5a66d809829d047fae3ddf16ab' })));
|
|
177
182
|
}
|
|
178
183
|
static get is() { return "swirl-popover-trigger"; }
|
|
179
184
|
static get encapsulation() { return "scoped"; }
|
|
@@ -18,7 +18,7 @@ export class SwirlRadioGroup {
|
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
connectedCallback() {
|
|
22
22
|
this.radioButtons = Array.from(this.el.querySelectorAll("swirl-radio"));
|
|
23
23
|
this.initValue();
|
|
24
24
|
this.addValueChangeListeners();
|
|
@@ -47,7 +47,7 @@ export class SwirlRadioGroup {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
render() {
|
|
50
|
-
return (h(Host, { key: '
|
|
50
|
+
return (h(Host, { key: '843c405062c889e74be2452e0498931d17a65177', "aria-describedby": this.swirlAriaDescribedby, role: "radiogroup" }, h("div", { key: '06a6114696d469d6fe0ef41c9f952082aa5d124b', class: "radio-group" }, h("slot", { key: '56871a249dc67fb0a5f24814e57e6970112942b0' }))));
|
|
51
51
|
}
|
|
52
52
|
static get is() { return "swirl-radio-group"; }
|
|
53
53
|
static get encapsulation() { return "scoped"; }
|
|
@@ -88,11 +88,13 @@ export class SwirlResourceList {
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
connectedCallback() {
|
|
92
92
|
this.observeSlotChanges();
|
|
93
93
|
this.collectItems();
|
|
94
94
|
this.setupControllingElement();
|
|
95
95
|
this.setItemAllowDragState();
|
|
96
|
+
}
|
|
97
|
+
componentDidLoad() {
|
|
96
98
|
this.setupDragDrop();
|
|
97
99
|
this.setSectionSpacingAndSeparator();
|
|
98
100
|
}
|
|
@@ -269,7 +271,7 @@ export class SwirlResourceList {
|
|
|
269
271
|
});
|
|
270
272
|
}
|
|
271
273
|
render() {
|
|
272
|
-
return (h(Host, { key: '
|
|
274
|
+
return (h(Host, { key: '1ee5cc333ec6b97ba9b73292d7c4d3907be34f06', onKeyDown: this.onKeyDown }, h("swirl-visually-hidden", { key: '09291dc20b98e59c89be768d536ae7800e1c620d', role: "alert" }, this.assistiveText), h("swirl-box", { key: 'ff790da5bcaec4c738340150b23ea8f622175493', paddingBlockEnd: this.paddingBlockEnd ?? this.padding, paddingBlockStart: this.paddingBlockStart ?? this.padding, paddingInlineEnd: this.paddingInlineEnd ?? this.padding ?? "8", paddingInlineStart: this.paddingInlineStart ?? this.padding ?? "8" }, h("swirl-stack", { key: 'f43368058ebd4375da12f0348f6c50ef9816bb27', "aria-label": this.label, class: "resource-list", id: this.listId, ref: (el) => (this.gridEl = el), role: this.semantics, spacing: this.spacing }, h("slot", { key: '02c4a02b46c56b8c501e4fab98c698ce4514b689' })))));
|
|
273
275
|
}
|
|
274
276
|
static get is() { return "swirl-resource-list"; }
|
|
275
277
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as i,Host as n,transformTag as o}from"@stencil/core/internal/client";const c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.expandedItemChange=s(this,"expandedItemChange",7),this.multiExpand=!1,this.onExpansionChange=t=>{t.detail&&(this.expandedItemChange.emit(t.target.itemId),this.collapseInactiveItems(t.target))}}connectedCallback(){this.el.addEventListener("expansionChange",this.onExpansionChange)}disconnectedCallback(){this.el.removeEventListener("expansionChange",this.onExpansionChange)}async collapseItem(t){const e=Array.from(this.el.querySelectorAll("swirl-accordion-item")).find((e=>e.itemId===t));e&&e.collapse()}async expandItem(t){const e=Array.from(this.el.querySelectorAll("swirl-accordion-item")).find((e=>e.itemId===t));e&&e.expand()}collapseInactiveItems(t){this.multiExpand||Array.from(this.el.querySelectorAll("swirl-accordion-item")).forEach((e=>{e!==t&&e.collapse()}))}render(){return i(n,{key:"1f6137c28a45e18096736147c4d0b09daf963bc9"},i("slot",{key:"946dd241ee4b9375853ba7f3197f02ca484f431e"}))}get el(){return this}static get style(){return":host{display:block}:host *{box-sizing:border-box}::slotted(*:last-child){border-bottom:0.0625rem solid var(--s-border-default)}"}},[257,"swirl-accordion",{multiExpand:[4,"multi-expand"],collapseItem:[64],expandItem:[64]}]),r=c,a=function(){"undefined"!=typeof customElements&&["swirl-accordion"].forEach((t=>{"swirl-accordion"===t&&(customElements.get(o(t))||customElements.define(o(t),c))}))};export{r as SwirlAccordion,a as defineCustomElement}
|