@getflip/swirl-components 0.81.4 → 0.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.json +45 -3
- package/dist/cjs/file-manager.cjs.entry.js +2 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-action-list_3.cjs.entry.js +8 -12
- package/dist/cjs/swirl-app-bar.cjs.entry.js +1 -2
- package/dist/cjs/swirl-app-layout_7.cjs.entry.js +10 -15
- package/dist/cjs/swirl-autocomplete.cjs.entry.js +4 -6
- package/dist/cjs/swirl-avatar-group.cjs.entry.js +1 -1
- package/dist/cjs/swirl-banner.cjs.entry.js +5 -7
- package/dist/cjs/swirl-button.cjs.entry.js +2 -3
- package/dist/cjs/swirl-carousel.cjs.entry.js +3 -4
- package/dist/cjs/swirl-chip.cjs.entry.js +2 -3
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-console-layout.cjs.entry.js +2 -4
- package/dist/cjs/swirl-date-input.cjs.entry.js +7 -6
- package/dist/cjs/swirl-dialog.cjs.entry.js +4 -5
- package/dist/cjs/swirl-file-viewer_7.cjs.entry.js +13 -20
- package/dist/cjs/swirl-form-control.cjs.entry.js +1 -2
- package/dist/cjs/swirl-icon-check-small_3.cjs.entry.js +3 -5
- package/dist/cjs/swirl-icon-error_3.cjs.entry.js +2 -3
- package/dist/cjs/swirl-inline-status.cjs.entry.js +1 -2
- package/dist/cjs/swirl-lightbox.cjs.entry.js +10 -17
- package/dist/cjs/swirl-menu-item.cjs.entry.js +4 -7
- package/dist/cjs/swirl-menu.cjs.entry.js +6 -8
- package/dist/cjs/swirl-modal.cjs.entry.js +12 -8
- package/dist/cjs/swirl-option-list.cjs.entry.js +5 -8
- package/dist/cjs/swirl-pdf-reader.cjs.entry.js +3 -5
- package/dist/cjs/swirl-popover_2.cjs.entry.js +9 -14
- package/dist/cjs/swirl-resource-list-file-item.cjs.entry.js +2 -3
- package/dist/cjs/swirl-search.cjs.entry.js +2 -3
- package/dist/cjs/swirl-select.cjs.entry.js +9 -7
- package/dist/cjs/swirl-shell-layout.cjs.entry.js +2 -3
- package/dist/cjs/swirl-table-column.cjs.entry.js +1 -1
- package/dist/cjs/swirl-table-row.cjs.entry.js +1 -1
- package/dist/cjs/swirl-table.cjs.entry.js +1 -2
- package/dist/cjs/swirl-tabs.cjs.entry.js +2 -4
- package/dist/cjs/swirl-tag.cjs.entry.js +1 -2
- package/dist/cjs/swirl-text-input.cjs.entry.js +2 -4
- package/dist/cjs/swirl-theme-provider.cjs.entry.js +15 -5
- package/dist/cjs/swirl-time-input.cjs.entry.js +3 -5
- package/dist/cjs/swirl-toast-provider.cjs.entry.js +8 -3
- package/dist/cjs/swirl-toast.cjs.entry.js +4 -6
- package/dist/cjs/swirl-tooltip.cjs.entry.js +6 -8
- package/dist/collection/components/swirl-action-list/swirl-action-list.js +3 -5
- package/dist/collection/components/swirl-action-list-item/swirl-action-list-item.js +5 -7
- package/dist/collection/components/swirl-app-bar/swirl-app-bar.js +1 -2
- package/dist/collection/components/swirl-app-layout/swirl-app-layout.js +1 -2
- package/dist/collection/components/swirl-autocomplete/swirl-autocomplete.js +4 -6
- package/dist/collection/components/swirl-avatar-group/swirl-avatar-group.js +1 -1
- package/dist/collection/components/swirl-banner/swirl-banner.js +5 -7
- package/dist/collection/components/swirl-button/swirl-button.js +2 -3
- package/dist/collection/components/swirl-carousel/swirl-carousel.js +3 -4
- package/dist/collection/components/swirl-chip/swirl-chip.js +2 -3
- package/dist/collection/components/swirl-console-layout/swirl-console-layout.js +2 -4
- package/dist/collection/components/swirl-date-input/swirl-date-input.js +7 -6
- package/dist/collection/components/swirl-dialog/swirl-dialog.js +4 -5
- package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-csv/swirl-file-viewer-csv.js +2 -4
- package/dist/collection/components/swirl-file-viewer/viewers/swirl-file-viewer-pdf/swirl-file-viewer-pdf.js +11 -16
- package/dist/collection/components/swirl-form-control/swirl-form-control.js +1 -2
- package/dist/collection/components/swirl-form-control/swirl-form-control.stories.js +28 -7
- package/dist/collection/components/swirl-inline-error/swirl-inline-error.js +2 -3
- package/dist/collection/components/swirl-inline-status/swirl-inline-status.js +1 -2
- package/dist/collection/components/swirl-lightbox/swirl-lightbox.js +27 -17
- package/dist/collection/components/swirl-menu/swirl-menu.js +6 -8
- package/dist/collection/components/swirl-menu-item/swirl-menu-item.js +4 -7
- package/dist/collection/components/swirl-modal/swirl-modal.js +50 -11
- package/dist/collection/components/swirl-option-list/swirl-option-list.js +5 -8
- package/dist/collection/components/swirl-option-list-item/swirl-option-list-item.js +3 -5
- package/dist/collection/components/swirl-pdf-reader/swirl-pdf-reader.js +3 -5
- package/dist/collection/components/swirl-popover/swirl-popover.js +8 -12
- package/dist/collection/components/swirl-popover/swirl-popover.stories.js +1 -1
- package/dist/collection/components/swirl-popover-trigger/swirl-popover-trigger.js +1 -2
- package/dist/collection/components/swirl-resource-list/swirl-resource-list.js +6 -8
- package/dist/collection/components/swirl-resource-list-file-item/swirl-resource-list-file-item.js +2 -3
- package/dist/collection/components/swirl-resource-list-item/swirl-resource-list-item.js +3 -5
- package/dist/collection/components/swirl-search/swirl-search.js +2 -3
- package/dist/collection/components/swirl-select/swirl-select.js +9 -7
- package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.js +2 -3
- package/dist/collection/components/swirl-table/swirl-table.js +1 -2
- package/dist/collection/components/swirl-table-column/swirl-table-column.js +1 -1
- package/dist/collection/components/swirl-table-row/swirl-table-row.js +1 -1
- package/dist/collection/components/swirl-tabs/swirl-tabs.js +2 -4
- package/dist/collection/components/swirl-tag/swirl-tag.js +1 -2
- package/dist/collection/components/swirl-text-input/swirl-text-input.js +2 -4
- package/dist/collection/components/swirl-theme-provider/swirl-theme-provider.js +15 -5
- package/dist/collection/components/swirl-time-input/swirl-time-input.js +3 -5
- package/dist/collection/components/swirl-toast/swirl-toast.js +4 -6
- package/dist/collection/components/swirl-toast-provider/swirl-toast-provider.js +8 -3
- package/dist/collection/components/swirl-tooltip/swirl-tooltip.js +6 -8
- package/dist/collection/prototypes/file-manager/file-manager.js +2 -4
- package/dist/components/file-manager.js +2 -4
- package/dist/components/swirl-action-list-item2.js +5 -7
- package/dist/components/swirl-action-list2.js +3 -5
- package/dist/components/swirl-app-bar.js +1 -2
- package/dist/components/swirl-app-layout2.js +1 -2
- package/dist/components/swirl-autocomplete.js +4 -6
- package/dist/components/swirl-avatar-group.js +1 -1
- package/dist/components/swirl-banner.js +5 -7
- package/dist/components/swirl-button2.js +2 -3
- package/dist/components/swirl-carousel.js +3 -4
- package/dist/components/swirl-chip.js +2 -3
- package/dist/components/swirl-console-layout.js +2 -4
- package/dist/components/swirl-date-input.js +7 -6
- package/dist/components/swirl-dialog.js +4 -5
- package/dist/components/swirl-file-viewer-csv2.js +2 -4
- package/dist/components/swirl-file-viewer-pdf2.js +11 -16
- package/dist/components/swirl-form-control.js +1 -2
- package/dist/components/swirl-inline-error2.js +2 -3
- package/dist/components/swirl-inline-status.js +1 -2
- package/dist/components/swirl-lightbox.js +11 -17
- package/dist/components/swirl-menu-item.js +4 -7
- package/dist/components/swirl-menu.js +6 -8
- package/dist/components/swirl-modal.js +13 -8
- package/dist/components/swirl-option-list-item2.js +3 -5
- package/dist/components/swirl-option-list2.js +5 -8
- package/dist/components/swirl-pdf-reader.js +3 -5
- package/dist/components/swirl-popover-trigger2.js +1 -2
- package/dist/components/swirl-popover2.js +8 -12
- package/dist/components/swirl-resource-list-file-item.js +2 -3
- package/dist/components/swirl-resource-list-item2.js +3 -5
- package/dist/components/swirl-resource-list2.js +6 -8
- package/dist/components/swirl-search.js +2 -3
- package/dist/components/swirl-select.js +9 -7
- package/dist/components/swirl-shell-layout.js +2 -3
- package/dist/components/swirl-table-column.js +1 -1
- package/dist/components/swirl-table-row.js +1 -1
- package/dist/components/swirl-table.js +1 -2
- package/dist/components/swirl-tabs.js +2 -4
- package/dist/components/swirl-tag2.js +1 -2
- package/dist/components/swirl-text-input2.js +2 -4
- package/dist/components/swirl-theme-provider.js +15 -5
- package/dist/components/swirl-time-input.js +3 -5
- package/dist/components/swirl-toast-provider.js +8 -3
- package/dist/components/swirl-toast2.js +4 -6
- package/dist/components/swirl-tooltip.js +6 -8
- package/dist/esm/file-manager.entry.js +2 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-action-list_3.entry.js +8 -12
- package/dist/esm/swirl-app-bar.entry.js +1 -2
- package/dist/esm/swirl-app-layout_7.entry.js +10 -15
- package/dist/esm/swirl-autocomplete.entry.js +4 -6
- package/dist/esm/swirl-avatar-group.entry.js +1 -1
- package/dist/esm/swirl-banner.entry.js +5 -7
- package/dist/esm/swirl-button.entry.js +2 -3
- package/dist/esm/swirl-carousel.entry.js +3 -4
- package/dist/esm/swirl-chip.entry.js +2 -3
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-console-layout.entry.js +2 -4
- package/dist/esm/swirl-date-input.entry.js +7 -6
- package/dist/esm/swirl-dialog.entry.js +4 -5
- package/dist/esm/swirl-file-viewer_7.entry.js +13 -20
- package/dist/esm/swirl-form-control.entry.js +1 -2
- package/dist/esm/swirl-icon-check-small_3.entry.js +3 -5
- package/dist/esm/swirl-icon-error_3.entry.js +2 -3
- package/dist/esm/swirl-inline-status.entry.js +1 -2
- package/dist/esm/swirl-lightbox.entry.js +10 -17
- package/dist/esm/swirl-menu-item.entry.js +4 -7
- package/dist/esm/swirl-menu.entry.js +6 -8
- package/dist/esm/swirl-modal.entry.js +12 -8
- package/dist/esm/swirl-option-list.entry.js +5 -8
- package/dist/esm/swirl-pdf-reader.entry.js +3 -5
- package/dist/esm/swirl-popover_2.entry.js +9 -14
- package/dist/esm/swirl-resource-list-file-item.entry.js +2 -3
- package/dist/esm/swirl-search.entry.js +2 -3
- package/dist/esm/swirl-select.entry.js +9 -7
- package/dist/esm/swirl-shell-layout.entry.js +2 -3
- package/dist/esm/swirl-table-column.entry.js +1 -1
- package/dist/esm/swirl-table-row.entry.js +1 -1
- package/dist/esm/swirl-table.entry.js +1 -2
- package/dist/esm/swirl-tabs.entry.js +2 -4
- package/dist/esm/swirl-tag.entry.js +1 -2
- package/dist/esm/swirl-text-input.entry.js +2 -4
- package/dist/esm/swirl-theme-provider.entry.js +15 -5
- package/dist/esm/swirl-time-input.entry.js +3 -5
- package/dist/esm/swirl-toast-provider.entry.js +8 -3
- package/dist/esm/swirl-toast.entry.js +4 -6
- package/dist/esm/swirl-tooltip.entry.js +6 -8
- package/dist/swirl-components/p-07957b9a.entry.js +1 -0
- package/dist/swirl-components/p-1a05f16b.entry.js +1 -0
- package/dist/swirl-components/{p-1d92561c.entry.js → p-1a4c6557.entry.js} +1 -1
- package/dist/swirl-components/p-1f3c35bd.entry.js +1 -0
- package/dist/swirl-components/p-3da6d23a.entry.js +1 -0
- package/dist/swirl-components/{p-ab7f6735.entry.js → p-44196449.entry.js} +1 -1
- package/dist/swirl-components/p-4dafdcee.entry.js +1 -0
- package/dist/swirl-components/p-56fa872b.entry.js +1 -0
- package/dist/swirl-components/p-5fcf5a79.entry.js +1 -0
- package/dist/swirl-components/p-62f1aaae.entry.js +1 -0
- package/dist/swirl-components/p-684170ee.entry.js +1 -0
- package/dist/swirl-components/p-6f178b75.entry.js +1 -0
- package/dist/swirl-components/p-723f12cd.entry.js +1 -0
- package/dist/swirl-components/{p-bd0ba465.entry.js → p-7c9311c4.entry.js} +2 -2
- package/dist/swirl-components/p-7e90107b.entry.js +1 -0
- package/dist/swirl-components/p-81067ba3.entry.js +1 -0
- package/dist/swirl-components/p-8e5e6c16.entry.js +1 -0
- package/dist/swirl-components/p-902fc533.entry.js +1 -0
- package/dist/swirl-components/p-9c5e2b99.entry.js +1 -0
- package/dist/swirl-components/p-9c70b38e.entry.js +1 -0
- package/dist/swirl-components/p-9ca9ee83.entry.js +1 -0
- package/dist/swirl-components/p-a3e6a921.entry.js +1 -0
- package/dist/swirl-components/p-a8dc02be.entry.js +1 -0
- package/dist/swirl-components/p-baf3c630.entry.js +1 -0
- package/dist/swirl-components/p-bf317ae5.entry.js +1 -0
- package/dist/swirl-components/p-c3d23855.entry.js +1 -0
- package/dist/swirl-components/p-c4c4d5c4.entry.js +1 -0
- package/dist/swirl-components/p-ce1cd2e1.entry.js +1 -0
- package/dist/swirl-components/p-d14846f2.entry.js +1 -0
- package/dist/swirl-components/p-d1edd738.entry.js +10 -0
- package/dist/swirl-components/p-d3c3cb10.entry.js +1 -0
- package/dist/swirl-components/p-d3e39e06.entry.js +1 -0
- package/dist/swirl-components/p-d403f973.entry.js +1 -0
- package/dist/swirl-components/p-e4819964.entry.js +1 -0
- package/dist/swirl-components/p-e86c79d8.entry.js +1 -0
- package/dist/swirl-components/{p-b6e75c2e.entry.js → p-e9cefe04.entry.js} +1 -1
- package/dist/swirl-components/p-f299ab14.entry.js +1 -0
- package/dist/swirl-components/p-f703a664.entry.js +1 -0
- package/dist/swirl-components/p-fd7140dc.entry.js +1 -0
- package/dist/swirl-components/p-fdfeb16a.entry.js +1 -0
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-lightbox/swirl-lightbox.d.ts +1 -0
- package/dist/types/components/swirl-modal/swirl-modal.d.ts +4 -2
- package/dist/types/components.d.ts +7 -2
- package/package.json +2 -2
- package/vscode-data.json +8 -0
- package/dist/swirl-components/p-017fc399.entry.js +0 -1
- package/dist/swirl-components/p-028dbe1a.entry.js +0 -1
- package/dist/swirl-components/p-059f706f.entry.js +0 -1
- package/dist/swirl-components/p-062a4329.entry.js +0 -1
- package/dist/swirl-components/p-1181ed47.entry.js +0 -10
- package/dist/swirl-components/p-209e85c5.entry.js +0 -1
- package/dist/swirl-components/p-2278aeae.entry.js +0 -1
- package/dist/swirl-components/p-27bdb25e.entry.js +0 -1
- package/dist/swirl-components/p-29147daa.entry.js +0 -1
- package/dist/swirl-components/p-29d32e39.entry.js +0 -1
- package/dist/swirl-components/p-2fb83beb.entry.js +0 -1
- package/dist/swirl-components/p-30ae7d5c.entry.js +0 -1
- package/dist/swirl-components/p-34edf304.entry.js +0 -1
- package/dist/swirl-components/p-3d7a911b.entry.js +0 -1
- package/dist/swirl-components/p-5875e90e.entry.js +0 -1
- package/dist/swirl-components/p-58cce5bc.entry.js +0 -1
- package/dist/swirl-components/p-6832ee6c.entry.js +0 -1
- package/dist/swirl-components/p-687f534e.entry.js +0 -1
- package/dist/swirl-components/p-70db5c75.entry.js +0 -1
- package/dist/swirl-components/p-71c6c311.entry.js +0 -1
- package/dist/swirl-components/p-75a0a157.entry.js +0 -1
- package/dist/swirl-components/p-75d85160.entry.js +0 -1
- package/dist/swirl-components/p-794d25e2.entry.js +0 -1
- package/dist/swirl-components/p-8570aa37.entry.js +0 -1
- package/dist/swirl-components/p-873a1d91.entry.js +0 -1
- package/dist/swirl-components/p-888c8874.entry.js +0 -1
- package/dist/swirl-components/p-8c62e1d4.entry.js +0 -1
- package/dist/swirl-components/p-8d92436f.entry.js +0 -1
- package/dist/swirl-components/p-95b5a85e.entry.js +0 -1
- package/dist/swirl-components/p-97ac3d63.entry.js +0 -1
- package/dist/swirl-components/p-af46650d.entry.js +0 -1
- package/dist/swirl-components/p-d2845730.entry.js +0 -1
- package/dist/swirl-components/p-d56358aa.entry.js +0 -1
- package/dist/swirl-components/p-d5c14ee5.entry.js +0 -1
- package/dist/swirl-components/p-dd83db88.entry.js +0 -1
- package/dist/swirl-components/p-f6a11841.entry.js +0 -1
|
@@ -19,8 +19,7 @@ const SwirlLightbox = class {
|
|
|
19
19
|
this.close();
|
|
20
20
|
};
|
|
21
21
|
this.onDownloadButtonClick = () => {
|
|
22
|
-
|
|
23
|
-
(_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.download();
|
|
22
|
+
this.slides[this.activeSlideIndex]?.download();
|
|
24
23
|
this.menu.close();
|
|
25
24
|
};
|
|
26
25
|
this.onKeyDown = (event) => {
|
|
@@ -54,9 +53,8 @@ const SwirlLightbox = class {
|
|
|
54
53
|
});
|
|
55
54
|
};
|
|
56
55
|
this.onPointerMove = async (event) => {
|
|
57
|
-
var _a, _b;
|
|
58
56
|
const isMultiTouch = !(event instanceof MouseEvent) && event.touches.length > 1;
|
|
59
|
-
const imageViewer =
|
|
57
|
+
const imageViewer = this.slides[this.activeSlideIndex]?.shadowRoot?.querySelector("swirl-file-viewer-image");
|
|
60
58
|
const showsZoomedImage = Boolean(imageViewer)
|
|
61
59
|
? (await imageViewer.getZoom()) > 1
|
|
62
60
|
: false;
|
|
@@ -98,6 +96,7 @@ const SwirlLightbox = class {
|
|
|
98
96
|
};
|
|
99
97
|
this.closeButtonLabel = "Close modal";
|
|
100
98
|
this.downloadButtonLabel = "Download";
|
|
99
|
+
this.hideMenu = undefined;
|
|
101
100
|
this.label = undefined;
|
|
102
101
|
this.menuLabel = "Slide options";
|
|
103
102
|
this.menuTriggerLabel = "Open slide menu";
|
|
@@ -115,8 +114,7 @@ const SwirlLightbox = class {
|
|
|
115
114
|
this.activateSlide(0);
|
|
116
115
|
}
|
|
117
116
|
disconnectedCallback() {
|
|
118
|
-
|
|
119
|
-
(_a = this.modal) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
117
|
+
this.modal?.destroy();
|
|
120
118
|
this.unlockBodyScroll();
|
|
121
119
|
}
|
|
122
120
|
/**
|
|
@@ -147,8 +145,7 @@ const SwirlLightbox = class {
|
|
|
147
145
|
* @param newActiveSlideIndex
|
|
148
146
|
*/
|
|
149
147
|
async activateSlide(newActiveSlideIndex) {
|
|
150
|
-
|
|
151
|
-
(_b = (_a = this.menu) === null || _a === void 0 ? void 0 : _a.close) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
148
|
+
this.menu?.close?.();
|
|
152
149
|
this.dragging = false;
|
|
153
150
|
this.activeSlideIndex = newActiveSlideIndex;
|
|
154
151
|
this.slides.forEach((slide, index) => {
|
|
@@ -194,16 +191,13 @@ const SwirlLightbox = class {
|
|
|
194
191
|
});
|
|
195
192
|
}
|
|
196
193
|
getCurrentFileName() {
|
|
197
|
-
|
|
198
|
-
return (_b = (_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.file) === null || _b === void 0 ? void 0 : _b.split("/").pop();
|
|
194
|
+
return this.slides[this.activeSlideIndex]?.file?.split("/").pop();
|
|
199
195
|
}
|
|
200
196
|
getCurrentFileType() {
|
|
201
|
-
|
|
202
|
-
return (_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.type;
|
|
197
|
+
return this.slides[this.activeSlideIndex]?.type;
|
|
203
198
|
}
|
|
204
199
|
getCurrentThumbnailUrl() {
|
|
205
|
-
|
|
206
|
-
return (_a = this.slides[this.activeSlideIndex]) === null || _a === void 0 ? void 0 : _a.thumbnailUrl;
|
|
200
|
+
return this.slides[this.activeSlideIndex]?.thumbnailUrl;
|
|
207
201
|
}
|
|
208
202
|
lockBodyScroll() {
|
|
209
203
|
bodyScrollLock_esm.disableBodyScroll(this.el);
|
|
@@ -220,8 +214,7 @@ const SwirlLightbox = class {
|
|
|
220
214
|
}
|
|
221
215
|
resetImageZoom() {
|
|
222
216
|
this.slides.forEach((slide) => {
|
|
223
|
-
|
|
224
|
-
const imageViewer = (_a = slide === null || slide === void 0 ? void 0 : slide.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("swirl-file-viewer-image");
|
|
217
|
+
const imageViewer = slide?.shadowRoot?.querySelector("swirl-file-viewer-image");
|
|
225
218
|
if (Boolean(imageViewer)) {
|
|
226
219
|
imageViewer.resetZoom();
|
|
227
220
|
}
|
|
@@ -235,7 +228,7 @@ const SwirlLightbox = class {
|
|
|
235
228
|
const className = index$1.classnames("lightbox", {
|
|
236
229
|
"lightbox--closing": this.closing,
|
|
237
230
|
});
|
|
238
|
-
return (index.h(index.Host, null, index.h("section", { "aria-hidden": "true", "aria-label": this.label, class: className, id: "lightbox", onMouseDown: this.onPointerDown, onMouseMove: this.onPointerMove, onMouseOut: this.onPointerUp, onMouseUp: this.onPointerUp, onKeyDown: this.onKeyDown, onTouchEnd: this.onPointerUp, onTouchMove: this.onPointerMove, onTouchStart: this.onPointerDown, ref: (el) => (this.modalEl = el) }, index.h("div", { class: "lightbox__body", role: "document" }, index.h("header", { class: "lightbox__header" }, index.h("button", { "aria-label": this.closeButtonLabel, class: "lightbox__close-button", onClick: this.onCloseButtonClick }, index.h("swirl-icon-close", null)), index.h("swirl-popover-trigger", { popover: this.menu }, index.h("button", { "aria-label": this.menuTriggerLabel, class: "lightbox__menu-button" }, index.h("swirl-icon-more-vertikal", null)))), index.h("div", { "aria-roledescription": "carousel", class: "lightbox__content", role: "group" }, index.h("div", { "aria-atomic": "false", "aria-live": "polite", class: "lightbox__slides" }, index.h("slot", { onSlotchange: this.registerSlides }))), index.h("div", { class: "lightbox__controls" }, index.h("button", { "aria-label": this.previousSlideButtonLabel, class: "lightbox__previous-slide-button", disabled: this.activeSlideIndex === 0, onClick: this.onPreviousSlideClick }, index.h("swirl-icon-arrow-left", null)), index.h("button", { "aria-label": this.nextSlideButtonLabel, class: "lightbox__next-slide-button", disabled: this.activeSlideIndex === this.slides.length - 1, onClick: this.onNextSlideClick }, index.h("swirl-icon-arrow-right", null))), showPagination && (index.h("span", { class: "lightbox__pagination" }, index.h("span", { "aria-current": "page" }, this.activeSlideIndex + 1), " /", " ", this.slides.length))), index.h("swirl-popover", { animation: "scale-in-y", disableScrollLock: true, id: "slide-menu", label: this.menuLabel, placement: "bottom-end", ref: (el) => (this.menu = el) }, index.h("swirl-stack", null, index.h("div", { class: "lightbox__meta" }, currentThumbnailUrl && (index.h("div", { class: "lightbox__thumbnail" }, index.h("swirl-thumbnail", { alt: "", src: currentThumbnailUrl }))), index.h("div", { class: "lightbox__file-info" }, index.h("swirl-text", { truncate: true, weight: "semibold" }, currentFileName), index.h("swirl-text", { color: "subdued", size: "sm", truncate: true }, currentFileType))), index.h("swirl-separator", null), index.h("swirl-action-list", null, index.h("swirl-action-list-item", { icon: "<swirl-icon-download></swirl-icon-download>", label: this.downloadButtonLabel, onClick: this.onDownloadButtonClick }), index.h("slot", { name: "menu-items" })))))));
|
|
231
|
+
return (index.h(index.Host, null, index.h("section", { "aria-hidden": "true", "aria-label": this.label, class: className, id: "lightbox", onMouseDown: this.onPointerDown, onMouseMove: this.onPointerMove, onMouseOut: this.onPointerUp, onMouseUp: this.onPointerUp, onKeyDown: this.onKeyDown, onTouchEnd: this.onPointerUp, onTouchMove: this.onPointerMove, onTouchStart: this.onPointerDown, ref: (el) => (this.modalEl = el) }, index.h("div", { class: "lightbox__body", role: "document" }, index.h("header", { class: "lightbox__header" }, index.h("button", { "aria-label": this.closeButtonLabel, class: "lightbox__close-button", onClick: this.onCloseButtonClick }, index.h("swirl-icon-close", null)), !this.hideMenu && (index.h("swirl-popover-trigger", { popover: this.menu }, index.h("button", { "aria-label": this.menuTriggerLabel, class: "lightbox__menu-button" }, index.h("swirl-icon-more-vertikal", null))))), index.h("div", { "aria-roledescription": "carousel", class: "lightbox__content", role: "group" }, index.h("div", { "aria-atomic": "false", "aria-live": "polite", class: "lightbox__slides" }, index.h("slot", { onSlotchange: this.registerSlides }))), index.h("div", { class: "lightbox__controls" }, index.h("button", { "aria-label": this.previousSlideButtonLabel, class: "lightbox__previous-slide-button", disabled: this.activeSlideIndex === 0, onClick: this.onPreviousSlideClick }, index.h("swirl-icon-arrow-left", null)), index.h("button", { "aria-label": this.nextSlideButtonLabel, class: "lightbox__next-slide-button", disabled: this.activeSlideIndex === this.slides.length - 1, onClick: this.onNextSlideClick }, index.h("swirl-icon-arrow-right", null))), showPagination && (index.h("span", { class: "lightbox__pagination" }, index.h("span", { "aria-current": "page" }, this.activeSlideIndex + 1), " /", " ", this.slides.length))), !this.hideMenu && (index.h("swirl-popover", { animation: "scale-in-y", disableScrollLock: true, id: "slide-menu", label: this.menuLabel, placement: "bottom-end", ref: (el) => (this.menu = el) }, index.h("swirl-stack", null, index.h("div", { class: "lightbox__meta" }, currentThumbnailUrl && (index.h("div", { class: "lightbox__thumbnail" }, index.h("swirl-thumbnail", { alt: "", src: currentThumbnailUrl }))), index.h("div", { class: "lightbox__file-info" }, index.h("swirl-text", { truncate: true, weight: "semibold" }, currentFileName), index.h("swirl-text", { color: "subdued", size: "sm", truncate: true }, currentFileType))), index.h("swirl-separator", null), index.h("swirl-action-list", null, index.h("swirl-action-list-item", { icon: "<swirl-icon-download></swirl-icon-download>", label: this.downloadButtonLabel, onClick: this.onDownloadButtonClick }), index.h("slot", { name: "menu-items" }))))))));
|
|
239
232
|
}
|
|
240
233
|
get el() { return index.getElement(this); }
|
|
241
234
|
};
|
|
@@ -91,22 +91,19 @@ const SwirlMenuItem = class {
|
|
|
91
91
|
: undefined;
|
|
92
92
|
}
|
|
93
93
|
renderActionListItem() {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
? (_c = Array.from(((_b = this.subMenu) === null || _b === void 0 ? void 0 : _b.querySelectorAll("swirl-menu-item")) || []).find((item) => { var _a; return item.value === ((_a = this.subMenu) === null || _a === void 0 ? void 0 : _a.value); })) === null || _c === void 0 ? void 0 : _c.label
|
|
94
|
+
const badge = Boolean(this.subMenu?.value)
|
|
95
|
+
? Array.from(this.subMenu?.querySelectorAll("swirl-menu-item") || []).find((item) => item.value === this.subMenu?.value)?.label
|
|
97
96
|
: undefined;
|
|
98
97
|
return (index.h("swirl-action-list-item", { badge: badge, description: this.description, disabled: this.disabled, icon: this.icon, intent: this.intent, label: this.label, onClick: this.onActionListItemClick, ref: (el) => (this.actionListItem = el) }));
|
|
99
98
|
}
|
|
100
99
|
renderOptionListItem() {
|
|
101
|
-
|
|
102
|
-
return (index.h("swirl-option-list-item", { disabled: this.disabled, icon: this.icon, label: this.label, onClick: this.onOptionListItemClick, onKeyDown: this.onOptionListItemKeyDown, onKeyUp: this.onOptionListItemKeyUp, ref: (el) => (this.optionListItem = el), selected: ((_a = this.parentMenu) === null || _a === void 0 ? void 0 : _a.value) === this.value, swirlAriaRole: "menuitemradio", value: this.value }));
|
|
100
|
+
return (index.h("swirl-option-list-item", { disabled: this.disabled, icon: this.icon, label: this.label, onClick: this.onOptionListItemClick, onKeyDown: this.onOptionListItemKeyDown, onKeyUp: this.onOptionListItemKeyUp, ref: (el) => (this.optionListItem = el), selected: this.parentMenu?.value === this.value, swirlAriaRole: "menuitemradio", value: this.value }));
|
|
103
101
|
}
|
|
104
102
|
render() {
|
|
105
|
-
var _a;
|
|
106
103
|
const className = index$1.classnames("menu-item", {
|
|
107
104
|
"menu-item--expanded": this.expanded,
|
|
108
105
|
});
|
|
109
|
-
return (index.h(index.Host, null, index.h("div", { class: className },
|
|
106
|
+
return (index.h(index.Host, null, index.h("div", { class: className }, this.parentMenu?.variant === "selection"
|
|
110
107
|
? this.renderOptionListItem()
|
|
111
108
|
: this.renderActionListItem(), index.h("slot", { onSlotchange: this.onSlotChange }))));
|
|
112
109
|
}
|
|
@@ -124,10 +124,9 @@ const SwirlMenu = class {
|
|
|
124
124
|
this.updateItems();
|
|
125
125
|
}
|
|
126
126
|
disconnectedCallback() {
|
|
127
|
-
var _a, _b, _c;
|
|
128
127
|
this.popover.removeEventListener("popoverClose", this.resetMenu);
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
this.mobileMediaQuery.removeEventListener?.("change", this.mediaQueryHandler);
|
|
129
|
+
this.observer?.disconnect();
|
|
131
130
|
}
|
|
132
131
|
watchActive() {
|
|
133
132
|
this.reposition();
|
|
@@ -265,11 +264,10 @@ const SwirlMenu = class {
|
|
|
265
264
|
getActiveItemIndex() {
|
|
266
265
|
const activeElement = utils.getActiveElement();
|
|
267
266
|
return this.items.findIndex((item) => item === activeElement ||
|
|
268
|
-
item ===
|
|
269
|
-
item ===
|
|
267
|
+
item === activeElement?.querySelector('[role="menuitem"]') ||
|
|
268
|
+
item === activeElement?.querySelector('[role="menuitemradio"]'));
|
|
270
269
|
}
|
|
271
270
|
render() {
|
|
272
|
-
var _a, _b;
|
|
273
271
|
const isTopLevelMenu = !Boolean(this.parentMenu);
|
|
274
272
|
const ariaLabel = isTopLevelMenu && this.mobile ? undefined : this.label;
|
|
275
273
|
const ariaLabelledby = isTopLevelMenu && this.mobile ? "menu-title" : undefined;
|
|
@@ -281,8 +279,8 @@ const SwirlMenu = class {
|
|
|
281
279
|
});
|
|
282
280
|
return (index.h(index.Host, null, index.h("div", { class: className }, this.mobile && isTopLevelMenu && (index.h("div", { class: "menu__mobile-header" }, this.activeLevel === 0 && (index.h("swirl-button", { hideLabel: true, icon: "<swirl-icon-close></swirl-icon-close>", label: this.mobileCloseMenuButtonLabel, onClick: this.onClose, variant: "plain" })), this.activeLevel > 0 && (index.h("swirl-button", { hideLabel: true, icon: "<swirl-icon-chevron-left></swirl-icon-chevron-left>", label: this.mobileBackButtonLabel, onClick: this.onGoBack, variant: "plain" })), index.h("span", { class: "menu__title", id: "menu-title" }, index.h("swirl-heading", { align: "center", as: "span", level: 4, text: this.label, truncate: true })), index.h("swirl-button", { class: "menu__done-button", intent: "primary", label: this.mobileDoneButtonLabel, onClick: this.onDone }))), index.h("div", { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-orientation": "vertical", class: "menu__menu", onKeyDown: this.onKeyDown, ref: (el) => (this.menuContainer = el), role: role, style: !this.mobile && this.level > 0
|
|
283
281
|
? {
|
|
284
|
-
top: Boolean(this.position) ? `${
|
|
285
|
-
left: Boolean(this.position) ? `${
|
|
282
|
+
top: Boolean(this.position) ? `${this.position?.y}px` : "",
|
|
283
|
+
left: Boolean(this.position) ? `${this.position?.x}px` : "",
|
|
286
284
|
}
|
|
287
285
|
: this.mobile
|
|
288
286
|
? {
|
|
@@ -1156,6 +1156,7 @@ const SwirlModal = class {
|
|
|
1156
1156
|
this.modalClose = index.createEvent(this, "modalClose", 7);
|
|
1157
1157
|
this.modalOpen = index.createEvent(this, "modalOpen", 7);
|
|
1158
1158
|
this.primaryAction = index.createEvent(this, "primaryAction", 7);
|
|
1159
|
+
this.requestModalClose = index.createEvent(this, "requestModalClose", 7);
|
|
1159
1160
|
this.secondaryAction = index.createEvent(this, "secondaryAction", 7);
|
|
1160
1161
|
this.onKeyDown = (event) => {
|
|
1161
1162
|
if (event.code === "Escape") {
|
|
@@ -1175,10 +1176,9 @@ const SwirlModal = class {
|
|
|
1175
1176
|
this.secondaryAction.emit(event);
|
|
1176
1177
|
};
|
|
1177
1178
|
this.determineScrollStatus = () => {
|
|
1178
|
-
|
|
1179
|
-
const
|
|
1180
|
-
const
|
|
1181
|
-
const scrollable = ((_e = this.scrollContainer) === null || _e === void 0 ? void 0 : _e.scrollHeight) > ((_f = this.scrollContainer) === null || _f === void 0 ? void 0 : _f.offsetHeight);
|
|
1179
|
+
const scrolled = this.scrollContainer?.scrollTop > 0;
|
|
1180
|
+
const scrolledDown = Math.ceil(this.scrollContainer?.scrollTop + this.scrollContainer?.offsetHeight) >= this.scrollContainer?.scrollHeight;
|
|
1181
|
+
const scrollable = this.scrollContainer?.scrollHeight > this.scrollContainer?.offsetHeight;
|
|
1182
1182
|
if (scrolled !== this.scrolled) {
|
|
1183
1183
|
this.scrolled = scrolled;
|
|
1184
1184
|
}
|
|
@@ -1189,6 +1189,7 @@ const SwirlModal = class {
|
|
|
1189
1189
|
this.scrollable = scrollable;
|
|
1190
1190
|
}
|
|
1191
1191
|
};
|
|
1192
|
+
this.closable = true;
|
|
1192
1193
|
this.closeButtonLabel = "Close modal";
|
|
1193
1194
|
this.hideCloseButton = undefined;
|
|
1194
1195
|
this.hideLabel = undefined;
|
|
@@ -1253,12 +1254,16 @@ const SwirlModal = class {
|
|
|
1253
1254
|
this.determineScrollStatus();
|
|
1254
1255
|
}
|
|
1255
1256
|
/**
|
|
1256
|
-
* Close the modal.
|
|
1257
|
+
* Close the modal. Pass `true` to force close even if the modal is not closable.
|
|
1257
1258
|
*/
|
|
1258
|
-
async close() {
|
|
1259
|
+
async close(force) {
|
|
1259
1260
|
if (this.closing) {
|
|
1260
1261
|
return;
|
|
1261
1262
|
}
|
|
1263
|
+
this.requestModalClose.emit();
|
|
1264
|
+
if (!this.closable && !force) {
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1262
1267
|
this.closing = true;
|
|
1263
1268
|
this.unlockBodyScroll();
|
|
1264
1269
|
setTimeout(() => {
|
|
@@ -1277,8 +1282,7 @@ const SwirlModal = class {
|
|
|
1277
1282
|
this.hasHeaderTools = Boolean(this.el.querySelector('[slot="header-tools"]'));
|
|
1278
1283
|
}
|
|
1279
1284
|
handleAutoFocus() {
|
|
1280
|
-
|
|
1281
|
-
(_a = this.modalEl.querySelector("input[autofocus]")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1285
|
+
this.modalEl.querySelector("input[autofocus]")?.focus();
|
|
1282
1286
|
}
|
|
1283
1287
|
lockBodyScroll() {
|
|
1284
1288
|
bodyScrollLock_esm.disableBodyScroll(this.scrollContainer);
|
|
@@ -29,7 +29,7 @@ const SwirlOptionList = class {
|
|
|
29
29
|
this.onClick = (event) => {
|
|
30
30
|
event.preventDefault();
|
|
31
31
|
const target = event.target;
|
|
32
|
-
const item = target
|
|
32
|
+
const item = target?.closest("swirl-option-list-item");
|
|
33
33
|
const composedTarget = event.composedPath()[0];
|
|
34
34
|
const clickedOption = Boolean(utils.closestPassShadow(composedTarget, '[role="option"]'));
|
|
35
35
|
if (!Boolean(item) || !clickedOption) {
|
|
@@ -138,9 +138,8 @@ const SwirlOptionList = class {
|
|
|
138
138
|
this.setupDragDrop();
|
|
139
139
|
}
|
|
140
140
|
disconnectedCallback() {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
(_b = this.sortable) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
141
|
+
this.observer?.disconnect();
|
|
142
|
+
this.sortable?.destroy();
|
|
144
143
|
}
|
|
145
144
|
watchAllowDrag() {
|
|
146
145
|
this.setItemAllowDragState();
|
|
@@ -268,16 +267,14 @@ const SwirlOptionList = class {
|
|
|
268
267
|
}
|
|
269
268
|
}
|
|
270
269
|
syncItemsWithValue() {
|
|
271
|
-
|
|
272
|
-
(_a = this.items) === null || _a === void 0 ? void 0 : _a.forEach((item) => (item.selected = this.value.includes(item.value)));
|
|
270
|
+
this.items?.forEach((item) => (item.selected = this.value.includes(item.value)));
|
|
273
271
|
}
|
|
274
272
|
focusItem(index) {
|
|
275
|
-
var _a;
|
|
276
273
|
if (this.disabled) {
|
|
277
274
|
return;
|
|
278
275
|
}
|
|
279
276
|
this.items.forEach((item) => item.querySelector('[role="option"]').removeAttribute("tabIndex"));
|
|
280
|
-
const item =
|
|
277
|
+
const item = this.items[index]?.querySelector('[role="option"]');
|
|
281
278
|
if (!Boolean(item)) {
|
|
282
279
|
return;
|
|
283
280
|
}
|
|
@@ -74,9 +74,8 @@ const SwirlPdfReader = class {
|
|
|
74
74
|
this.zoom = value === "auto" ? value : +value;
|
|
75
75
|
};
|
|
76
76
|
this.onThumbnailClick = (index) => () => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
page === null || page === void 0 ? void 0 : page.scrollIntoView();
|
|
77
|
+
const page = utils.querySelectorAllDeep(this.el, `[data-page-number="${index + 1}"]`)?.[0];
|
|
78
|
+
page?.scrollIntoView();
|
|
80
79
|
};
|
|
81
80
|
this.autoZoomLabel = "Full width";
|
|
82
81
|
this.closeButtonLabel = "Close PDF viewer";
|
|
@@ -112,9 +111,8 @@ const SwirlPdfReader = class {
|
|
|
112
111
|
this.modal = new a11yDialog_esm.A11yDialog(this.modalEl);
|
|
113
112
|
}
|
|
114
113
|
disconnectedCallback() {
|
|
115
|
-
var _a;
|
|
116
114
|
this.unlockBodyScroll();
|
|
117
|
-
|
|
115
|
+
this.modal?.destroy();
|
|
118
116
|
}
|
|
119
117
|
onWindowResize() {
|
|
120
118
|
if (!Boolean(this.pdfViewer)) {
|
|
@@ -81,7 +81,6 @@ const SwirlPopover = class {
|
|
|
81
81
|
this.unlockBodyScroll();
|
|
82
82
|
}
|
|
83
83
|
onWindowFocusIn(event) {
|
|
84
|
-
var _a;
|
|
85
84
|
if (!this.active) {
|
|
86
85
|
return;
|
|
87
86
|
}
|
|
@@ -92,7 +91,7 @@ const SwirlPopover = class {
|
|
|
92
91
|
const popoverLostFocus = !this.el.contains(target) &&
|
|
93
92
|
!this.el.contains(activeElement) &&
|
|
94
93
|
target !== this.triggerEl &&
|
|
95
|
-
!
|
|
94
|
+
!this.triggerEl?.contains(target) &&
|
|
96
95
|
(!isSafari ||
|
|
97
96
|
(isSafari &&
|
|
98
97
|
!this.el.contains(relatedTarget || target) &&
|
|
@@ -122,7 +121,6 @@ const SwirlPopover = class {
|
|
|
122
121
|
* @returns
|
|
123
122
|
*/
|
|
124
123
|
async close() {
|
|
125
|
-
var _a;
|
|
126
124
|
if (this.closing || !this.active) {
|
|
127
125
|
return;
|
|
128
126
|
}
|
|
@@ -137,7 +135,7 @@ const SwirlPopover = class {
|
|
|
137
135
|
this.updateTriggerAttributes();
|
|
138
136
|
}, 150);
|
|
139
137
|
this.unlockBodyScroll();
|
|
140
|
-
|
|
138
|
+
this.getNativeTriggerElement()?.focus();
|
|
141
139
|
}
|
|
142
140
|
/**
|
|
143
141
|
* Open the popover.
|
|
@@ -186,10 +184,9 @@ const SwirlPopover = class {
|
|
|
186
184
|
});
|
|
187
185
|
}
|
|
188
186
|
getNativeTriggerElement() {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
((_d = (_c = this.triggerEl) === null || _c === void 0 ? void 0 : _c.shadowRoot) === null || _d === void 0 ? void 0 : _d.children[0]) ||
|
|
187
|
+
return this.triggerEl?.tagName.startsWith("SWIRL-")
|
|
188
|
+
? (this.triggerEl?.children[0] ||
|
|
189
|
+
this.triggerEl?.shadowRoot?.children[0] ||
|
|
193
190
|
this.triggerEl)
|
|
194
191
|
: this.triggerEl;
|
|
195
192
|
}
|
|
@@ -242,17 +239,16 @@ const SwirlPopover = class {
|
|
|
242
239
|
bodyScrollLock_esm.enableBodyScroll(this.scrollContainer);
|
|
243
240
|
}
|
|
244
241
|
render() {
|
|
245
|
-
var _a, _b, _c;
|
|
246
242
|
const mobile = !window.matchMedia("(min-width: 768px)").matches;
|
|
247
|
-
const className = index$1.classnames("popover", `popover--animation-${this.animation}`, `popover--placement-${
|
|
243
|
+
const className = index$1.classnames("popover", `popover--animation-${this.animation}`, `popover--placement-${this.position?.placement}`, {
|
|
248
244
|
"popover--closing": this.closing,
|
|
249
245
|
"popover--active": this.active,
|
|
250
246
|
"popover--fullscreen-bottom-sheet": this.fullscreenBottomSheet,
|
|
251
247
|
"popover--inactive": !this.active,
|
|
252
248
|
});
|
|
253
249
|
return (index.h(index.Host, null, index.h("div", { class: className, onKeyDown: this.onKeydown }, index.h("div", { "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: {
|
|
254
|
-
top: Boolean(this.position) ? `${
|
|
255
|
-
left: Boolean(this.position) ? `${
|
|
250
|
+
top: Boolean(this.position) ? `${this.position?.y}px` : "",
|
|
251
|
+
left: Boolean(this.position) ? `${this.position?.x}px` : "",
|
|
256
252
|
}, tabindex: "-1" }, index.h("span", { class: "popover__handle" }), index.h("div", { class: "popover__scroll-container", ref: (el) => (this.scrollContainer = el), style: {
|
|
257
253
|
maxHeight: !mobile && Boolean(this.maxHeight)
|
|
258
254
|
? this.maxHeight
|
|
@@ -294,12 +290,11 @@ const SwirlPopoverTrigger = class {
|
|
|
294
290
|
}, { once: true });
|
|
295
291
|
};
|
|
296
292
|
this.updateTriggerElAriaAttributes = (open) => {
|
|
297
|
-
var _a;
|
|
298
293
|
if (!this.setAriaAttributes) {
|
|
299
294
|
return;
|
|
300
295
|
}
|
|
301
296
|
const triggerEl = this.getTriggerEl();
|
|
302
|
-
const popoverId = typeof this.popover === "string" ? this.popover :
|
|
297
|
+
const popoverId = typeof this.popover === "string" ? this.popover : this.popover?.id;
|
|
303
298
|
if (triggerEl.tagName.startsWith("SWIRL-")) {
|
|
304
299
|
triggerEl.setAttribute("swirl-aria-controls", popoverId);
|
|
305
300
|
triggerEl.setAttribute("swirl-aria-expanded", String(open || "false"));
|
|
@@ -29,15 +29,14 @@ const SwirlResourceListFileItem = class {
|
|
|
29
29
|
this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
|
|
30
30
|
}
|
|
31
31
|
disconnectedCallback() {
|
|
32
|
-
|
|
33
|
-
(_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
|
|
32
|
+
this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
|
|
34
33
|
}
|
|
35
34
|
forceIconProps(smallIcon) {
|
|
36
35
|
if (!Boolean(this.iconEl)) {
|
|
37
36
|
return;
|
|
38
37
|
}
|
|
39
38
|
const icon = this.iconEl.children[0];
|
|
40
|
-
icon
|
|
39
|
+
icon?.setAttribute("size", smallIcon ? "20" : "24");
|
|
41
40
|
}
|
|
42
41
|
render() {
|
|
43
42
|
const showError = Boolean(this.errorMessage);
|
|
@@ -57,15 +57,14 @@ const SwirlSearch = class {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
disconnectedCallback() {
|
|
60
|
-
|
|
61
|
-
(_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
|
|
60
|
+
this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
|
|
62
61
|
}
|
|
63
62
|
forceIconProps(smallIcon) {
|
|
64
63
|
if (!Boolean(this.iconEl)) {
|
|
65
64
|
return;
|
|
66
65
|
}
|
|
67
66
|
const icon = this.iconEl.children[0];
|
|
68
|
-
icon
|
|
67
|
+
icon?.setAttribute("size", smallIcon ? "20" : "24");
|
|
69
68
|
}
|
|
70
69
|
onKeyDown(event) {
|
|
71
70
|
if ((event.code === "KeyK" || event.code === "Slash") &&
|
|
@@ -30,8 +30,7 @@ const SwirlSelect = class {
|
|
|
30
30
|
this.updateOptions();
|
|
31
31
|
};
|
|
32
32
|
this.onOpen = (event) => {
|
|
33
|
-
|
|
34
|
-
this.placement = (_a = event.detail.position) === null || _a === void 0 ? void 0 : _a.placement;
|
|
33
|
+
this.placement = event.detail.position?.placement;
|
|
35
34
|
this.open = true;
|
|
36
35
|
};
|
|
37
36
|
this.onClose = () => {
|
|
@@ -71,15 +70,16 @@ const SwirlSelect = class {
|
|
|
71
70
|
this.options = utils.querySelectorAllDeep(this.el, "swirl-option-list-item");
|
|
72
71
|
}
|
|
73
72
|
render() {
|
|
74
|
-
var _a, _b, _c;
|
|
75
73
|
const label = Boolean(this.value)
|
|
76
|
-
?
|
|
74
|
+
? this.value
|
|
75
|
+
?.map((value) => this.options.find((option) => option.value === value)?.label)
|
|
76
|
+
.join(", ")
|
|
77
77
|
: "";
|
|
78
78
|
const ariaInvalid = this.invalid === true || this.invalid === false
|
|
79
79
|
? String(this.invalid)
|
|
80
80
|
: undefined;
|
|
81
81
|
const formControl = this.el.closest("swirl-form-control");
|
|
82
|
-
const offset =
|
|
82
|
+
const offset = formControl?.inline || formControl?.labelPosition === "outside"
|
|
83
83
|
? -12
|
|
84
84
|
: -16;
|
|
85
85
|
const className = index$1.classnames("select", `select--placement-${this.placement}`, {
|
|
@@ -87,9 +87,11 @@ const SwirlSelect = class {
|
|
|
87
87
|
"select--inline": this.inline,
|
|
88
88
|
"select--multi": this.multiSelect,
|
|
89
89
|
});
|
|
90
|
-
return (index.h(index.Host, { onKeyDown: this.onKeyDown }, index.h("div", { class: className }, index.h("swirl-popover-trigger", { popover: this.popover, setAriaAttributes: false }, index.h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, class: "select__input", disabled: this.disabled, readOnly: true, type: "text", value: label })), index.h("span", { class: "select__multi-select-values" },
|
|
90
|
+
return (index.h(index.Host, { onKeyDown: this.onKeyDown }, index.h("div", { class: className }, index.h("swirl-popover-trigger", { popover: this.popover, setAriaAttributes: false }, index.h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, class: "select__input", disabled: this.disabled, readOnly: true, type: "text", value: label })), index.h("span", { class: "select__multi-select-values" }, this.value
|
|
91
|
+
?.map((value) => this.options.find((option) => option.value === value))
|
|
92
|
+
?.map((option) => (index.h("swirl-tag", { "aria-hidden": "true", label: option?.label,
|
|
91
93
|
// eslint-disable-next-line react/jsx-no-bind
|
|
92
|
-
onRemove: () => this.unselectOption(option
|
|
94
|
+
onRemove: () => this.unselectOption(option?.value), removable: !this.disabled && this.allowDeselect })))), index.h("span", { class: "select__indicator" }, this.open ? (index.h("swirl-icon-expand-less", null)) : (index.h("swirl-icon-expand-more", null))), index.h("swirl-popover", { animation: "scale-in-y", class: "select__popover", id: `select-options-${this.selectId}`, label: this.label, offset: [0, offset], onPopoverClose: this.onClose, onPopoverOpen: this.onOpen, ref: (el) => (this.popover = el), useContainerWidth: "swirl-form-control" }, index.h("swirl-option-list", { allowDeselect: this.allowDeselect, onValueChange: this.select, multiSelect: this.multiSelect, value: this.value }, index.h("slot", { onSlotchange: this.onSlotChange }))))));
|
|
93
95
|
}
|
|
94
96
|
get el() { return index.getElement(this); }
|
|
95
97
|
};
|
|
@@ -51,10 +51,9 @@ const SwirlShellLayout = class {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
this.onSidebarClick = () => {
|
|
54
|
-
var _a, _b;
|
|
55
54
|
if (this.collapsedSidebar) {
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
document.activeElement?.blur();
|
|
56
|
+
utils.getActiveElement()?.blur();
|
|
58
57
|
}
|
|
59
58
|
};
|
|
60
59
|
this.onSidebarMouseEnter = () => {
|
|
@@ -16,7 +16,7 @@ const SwirlTableRow = class {
|
|
|
16
16
|
}
|
|
17
17
|
componentDidLoad() {
|
|
18
18
|
const table = utils.closestPassShadow(this.el, "swirl-table");
|
|
19
|
-
table
|
|
19
|
+
table?.rerender();
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
22
|
const className = index$1.classnames("table-row", {
|
|
@@ -210,9 +210,8 @@ const SwirlTable = class {
|
|
|
210
210
|
emptyRow.style.width = scrollWidth;
|
|
211
211
|
}
|
|
212
212
|
layoutRowGroups() {
|
|
213
|
-
var _a;
|
|
214
213
|
const tableRowGroups = Array.from(this.el.querySelectorAll("swirl-table-row-group"));
|
|
215
|
-
const scrollWidth = `${
|
|
214
|
+
const scrollWidth = `${this.el.shadowRoot.querySelector(".table__container")?.scrollWidth}px`;
|
|
216
215
|
tableRowGroups.forEach((tableRowGroup) => {
|
|
217
216
|
const headerRow = tableRowGroup.shadowRoot.querySelector(".table-row-group__header-row");
|
|
218
217
|
if (!Boolean(headerRow)) {
|
|
@@ -52,8 +52,7 @@ const SwirlTabs = class {
|
|
|
52
52
|
const nextIndex = Math.min(this.tabs.length - 1, currentIndex + 1);
|
|
53
53
|
this.activateTab(this.tabs[nextIndex].tabId);
|
|
54
54
|
requestAnimationFrame(() => {
|
|
55
|
-
|
|
56
|
-
(_a = this.el.querySelector(".tabs__tab--active")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
55
|
+
this.el.querySelector(".tabs__tab--active")?.focus();
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
58
|
activatePreviousTab() {
|
|
@@ -61,8 +60,7 @@ const SwirlTabs = class {
|
|
|
61
60
|
const previousIndex = Math.max(0, currentIndex - 1);
|
|
62
61
|
this.activateTab(this.tabs[previousIndex].tabId);
|
|
63
62
|
requestAnimationFrame(() => {
|
|
64
|
-
|
|
65
|
-
(_a = this.el.querySelector(".tabs__tab--active")) === null || _a === void 0 ? void 0 : _a.focus();
|
|
63
|
+
this.el.querySelector(".tabs__tab--active")?.focus();
|
|
66
64
|
});
|
|
67
65
|
}
|
|
68
66
|
collectTabs() {
|
|
@@ -12,8 +12,7 @@ const SwirlTag = class {
|
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
this.remove = index.createEvent(this, "remove", 7);
|
|
14
14
|
this.onRemove = (event) => {
|
|
15
|
-
|
|
16
|
-
(_a = this.remove) === null || _a === void 0 ? void 0 : _a.emit(event);
|
|
15
|
+
this.remove?.emit(event);
|
|
17
16
|
};
|
|
18
17
|
this.intent = "default";
|
|
19
18
|
this.label = undefined;
|
|
@@ -124,8 +124,7 @@ const SwirlTextInput = class {
|
|
|
124
124
|
this.adjustInputSize();
|
|
125
125
|
}
|
|
126
126
|
disconnectedCallback() {
|
|
127
|
-
|
|
128
|
-
(_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
|
|
127
|
+
this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
|
|
129
128
|
}
|
|
130
129
|
updateIconSize(smallIcon) {
|
|
131
130
|
this.iconSize = smallIcon ? 20 : 24;
|
|
@@ -155,7 +154,6 @@ const SwirlTextInput = class {
|
|
|
155
154
|
event.target.select();
|
|
156
155
|
}
|
|
157
156
|
render() {
|
|
158
|
-
var _a;
|
|
159
157
|
const Tag = this.rows === 1 && !this.autoGrow ? "input" : "textarea";
|
|
160
158
|
const ariaInvalid = this.invalid === true || this.invalid === false
|
|
161
159
|
? String(this.invalid)
|
|
@@ -178,7 +176,7 @@ const SwirlTextInput = class {
|
|
|
178
176
|
"text-input--inline": this.inline,
|
|
179
177
|
"text-input--show-password": this.type === "password" && this.showPassword,
|
|
180
178
|
});
|
|
181
|
-
return (index.h(index.Host, null, index.h("div", { class: className }, this.prefixLabel && (index.h("span", { class: "text-input__prefix" }, this.prefixLabel)), index.h(Tag, { "aria-autocomplete": this.swirlAriaAutocomplete, "aria-controls": this.swirlAriaControls, "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-expanded": this.swirlAriaExpanded, "aria-invalid": ariaInvalid, autoComplete: this.autoComplete, autoFocus: this.autoFocus, class: "text-input__input", disabled: this.disabled, inputMode: this.mode, maxLength: this.maxLength, max: this.type === "number" ? this.max : undefined, min: this.type === "number" ? this.min : undefined, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, onKeyPress: this.onKeyPress, placeholder: !Boolean(this.suffixLabel) ? this.placeholder : undefined, ref: (el) => (this.inputEl = el), required: this.required, role: this.swirlRole, rows: this.rows > 1 ? this.rows : this.autoGrow ? 1 : undefined, spellcheck: this.spellCheck, step: this.type === "number" ? this.step : undefined, type: type, value: this.value }, this.rows > 1 && this.value), this.suffixLabel && (index.h("span", { class: "text-input__suffix" }, this.suffixLabel)), showClearButton && (index.h("button", { "aria-label": this.clearButtonLabel, class: "text-input__clear-button", onClick: this.clear, part: "text-input__clear-button", type: "button" }, index.h("swirl-icon-cancel", { size: this.iconSize }))), showPasswordToggle && (index.h("button", { "aria-label": this.passwordToggleLabel, class: "text-input__password-toggle", onClick: this.togglePassword, type: "button" }, this.showPassword ? (index.h("swirl-icon-visibility-off", { size: this.iconSize })) : (index.h("swirl-icon-visibility", { size: this.iconSize })))), showStepper && (index.h("span", { class: "text-input__stepper" }, index.h("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.increaseValue, tabIndex: -1, type: "button" }, index.h("swirl-icon-expand-less", { size: this.iconSize })), index.h("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.decreaseValue, tabIndex: -1, type: "button" }, index.h("swirl-icon-expand-more", { size: this.iconSize })))), this.showCharacterCounter && (index.h("span", { class: "text-input__character-counter" },
|
|
179
|
+
return (index.h(index.Host, null, index.h("div", { class: className }, this.prefixLabel && (index.h("span", { class: "text-input__prefix" }, this.prefixLabel)), index.h(Tag, { "aria-autocomplete": this.swirlAriaAutocomplete, "aria-controls": this.swirlAriaControls, "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-expanded": this.swirlAriaExpanded, "aria-invalid": ariaInvalid, autoComplete: this.autoComplete, autoFocus: this.autoFocus, class: "text-input__input", disabled: this.disabled, inputMode: this.mode, maxLength: this.maxLength, max: this.type === "number" ? this.max : undefined, min: this.type === "number" ? this.min : undefined, onBlur: this.onBlur, onFocus: this.onFocus, onInput: this.onInput, onKeyPress: this.onKeyPress, placeholder: !Boolean(this.suffixLabel) ? this.placeholder : undefined, ref: (el) => (this.inputEl = el), required: this.required, role: this.swirlRole, rows: this.rows > 1 ? this.rows : this.autoGrow ? 1 : undefined, spellcheck: this.spellCheck, step: this.type === "number" ? this.step : undefined, type: type, value: this.value }, this.rows > 1 && this.value), this.suffixLabel && (index.h("span", { class: "text-input__suffix" }, this.suffixLabel)), showClearButton && (index.h("button", { "aria-label": this.clearButtonLabel, class: "text-input__clear-button", onClick: this.clear, part: "text-input__clear-button", type: "button" }, index.h("swirl-icon-cancel", { size: this.iconSize }))), showPasswordToggle && (index.h("button", { "aria-label": this.passwordToggleLabel, class: "text-input__password-toggle", onClick: this.togglePassword, type: "button" }, this.showPassword ? (index.h("swirl-icon-visibility-off", { size: this.iconSize })) : (index.h("swirl-icon-visibility", { size: this.iconSize })))), showStepper && (index.h("span", { class: "text-input__stepper" }, index.h("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.increaseValue, tabIndex: -1, type: "button" }, index.h("swirl-icon-expand-less", { size: this.iconSize })), index.h("button", { "aria-hidden": "true", class: "text-input__step-button", onClick: this.decreaseValue, tabIndex: -1, type: "button" }, index.h("swirl-icon-expand-more", { size: this.iconSize })))), this.showCharacterCounter && (index.h("span", { class: "text-input__character-counter" }, this.value?.length || 0, " ", Boolean(this.maxLength) ? `/ ${this.maxLength}` : "")))));
|
|
182
180
|
}
|
|
183
181
|
};
|
|
184
182
|
SwirlTextInput.style = swirlTextInputCss;
|
|
@@ -296,8 +296,11 @@ const SwirlThemeProvider = class {
|
|
|
296
296
|
this.updateAppTheme();
|
|
297
297
|
}
|
|
298
298
|
resolveConfig() {
|
|
299
|
-
|
|
300
|
-
|
|
299
|
+
this.resolvedConfig = {
|
|
300
|
+
...(this.config || {}),
|
|
301
|
+
rootElement: this.config?.rootElement || document.documentElement,
|
|
302
|
+
storage: this.config?.storage || window?.localStorage,
|
|
303
|
+
};
|
|
301
304
|
}
|
|
302
305
|
determineOSTheme() {
|
|
303
306
|
if (!Boolean(window.matchMedia)) {
|
|
@@ -336,8 +339,7 @@ const SwirlThemeProvider = class {
|
|
|
336
339
|
}
|
|
337
340
|
}
|
|
338
341
|
updateTenantVariables() {
|
|
339
|
-
|
|
340
|
-
const tenantTheme = (_a = this.resolvedConfig) === null || _a === void 0 ? void 0 : _a.tenantColors;
|
|
342
|
+
const tenantTheme = this.resolvedConfig?.tenantColors;
|
|
341
343
|
if (!Boolean(tenantTheme)) {
|
|
342
344
|
this.resetTenantVariables();
|
|
343
345
|
return;
|
|
@@ -353,7 +355,15 @@ const SwirlThemeProvider = class {
|
|
|
353
355
|
const secondaryPressed = toRgba(hsla(secondaryHsla[0], secondaryHsla[1], secondaryHsla[2] + 0.15, 1));
|
|
354
356
|
const textHovered = toRgba(hsla(textHsla[0], textHsla[1] - 0.34, textHsla[2] + 0.1, 1));
|
|
355
357
|
const textPressed = toRgba(hsla(textHsla[0], textHsla[1] - 0.48, textHsla[2] + 0.2, 1));
|
|
356
|
-
const tenantThemeWithGeneratedStateColors =
|
|
358
|
+
const tenantThemeWithGeneratedStateColors = {
|
|
359
|
+
...tenantTheme,
|
|
360
|
+
primaryHovered: primaryHovered,
|
|
361
|
+
primaryPressed: primaryPressed,
|
|
362
|
+
secondaryHovered: secondaryHovered,
|
|
363
|
+
secondaryPressed: secondaryPressed,
|
|
364
|
+
textHovered: textHovered,
|
|
365
|
+
textPressed: textPressed,
|
|
366
|
+
};
|
|
357
367
|
// set custom properties for tenant theme colors
|
|
358
368
|
Object.entries(tenantColorMapping).forEach(([key, value]) => rootElement.style.setProperty(key, tenantThemeWithGeneratedStateColors[value]));
|
|
359
369
|
}
|