@getflip/swirl-components 0.81.3 → 0.82.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 +29 -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 +14 -7
- 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 +8 -16
- 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 +15 -6
- 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 +8 -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 +8 -4
- package/dist/cjs/swirl-theme-provider.cjs.entry.js +15 -5
- package/dist/cjs/swirl-time-input.cjs.entry.js +10 -6
- 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/assets/pdfjs/pdf.worker.min.js +0 -22
- 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 +14 -7
- 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 +8 -16
- 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 +53 -9
- package/dist/collection/components/swirl-modal/swirl-modal.stories.js +1 -1
- 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 +8 -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 +8 -4
- package/dist/collection/components/swirl-text-input/swirl-text-input.spec.js +1 -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 +10 -6
- 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/assets/pdfjs/pdf.worker.min.js +0 -22
- 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 +14 -7
- 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 +8 -16
- package/dist/components/swirl-menu-item.js +4 -7
- package/dist/components/swirl-menu.js +6 -8
- package/dist/components/swirl-modal.js +16 -6
- 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 +8 -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 +8 -4
- package/dist/components/swirl-theme-provider.js +15 -5
- package/dist/components/swirl-time-input.js +10 -6
- 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 +14 -7
- 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 +8 -16
- 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 +15 -6
- 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 +8 -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 +8 -4
- package/dist/esm/swirl-theme-provider.entry.js +15 -5
- package/dist/esm/swirl-time-input.entry.js +10 -6
- 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-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-efb5e6ee.entry.js +1 -0
- 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-date-input/swirl-date-input.d.ts +1 -0
- package/dist/types/components/swirl-modal/swirl-modal.d.ts +5 -2
- package/dist/types/components/swirl-time-input/swirl-time-input.d.ts +1 -0
- package/dist/types/components.d.ts +5 -2
- package/package.json +2 -2
- package/vscode-data.json +4 -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-209e85c5.entry.js +0 -1
- package/dist/swirl-components/p-2278aeae.entry.js +0 -1
- package/dist/swirl-components/p-251884ec.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-2d5438ae.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-67770da3.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-873a1d91.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-97ac3d63.entry.js +0 -1
- package/dist/swirl-components/p-9d9427ab.entry.js +0 -1
- package/dist/swirl-components/p-a7568135.entry.js +0 -10
- 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
|
@@ -71,8 +71,11 @@ export class SwirlThemeProvider {
|
|
|
71
71
|
this.updateAppTheme();
|
|
72
72
|
}
|
|
73
73
|
resolveConfig() {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
this.resolvedConfig = {
|
|
75
|
+
...(this.config || {}),
|
|
76
|
+
rootElement: this.config?.rootElement || document.documentElement,
|
|
77
|
+
storage: this.config?.storage || window?.localStorage,
|
|
78
|
+
};
|
|
76
79
|
}
|
|
77
80
|
determineOSTheme() {
|
|
78
81
|
if (!Boolean(window.matchMedia)) {
|
|
@@ -111,8 +114,7 @@ export class SwirlThemeProvider {
|
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
updateTenantVariables() {
|
|
114
|
-
|
|
115
|
-
const tenantTheme = (_a = this.resolvedConfig) === null || _a === void 0 ? void 0 : _a.tenantColors;
|
|
117
|
+
const tenantTheme = this.resolvedConfig?.tenantColors;
|
|
116
118
|
if (!Boolean(tenantTheme)) {
|
|
117
119
|
this.resetTenantVariables();
|
|
118
120
|
return;
|
|
@@ -128,7 +130,15 @@ export class SwirlThemeProvider {
|
|
|
128
130
|
const secondaryPressed = toRgba(hsla(secondaryHsla[0], secondaryHsla[1], secondaryHsla[2] + 0.15, 1));
|
|
129
131
|
const textHovered = toRgba(hsla(textHsla[0], textHsla[1] - 0.34, textHsla[2] + 0.1, 1));
|
|
130
132
|
const textPressed = toRgba(hsla(textHsla[0], textHsla[1] - 0.48, textHsla[2] + 0.2, 1));
|
|
131
|
-
const tenantThemeWithGeneratedStateColors =
|
|
133
|
+
const tenantThemeWithGeneratedStateColors = {
|
|
134
|
+
...tenantTheme,
|
|
135
|
+
primaryHovered: primaryHovered,
|
|
136
|
+
primaryPressed: primaryPressed,
|
|
137
|
+
secondaryHovered: secondaryHovered,
|
|
138
|
+
secondaryPressed: secondaryPressed,
|
|
139
|
+
textHovered: textHovered,
|
|
140
|
+
textPressed: textPressed,
|
|
141
|
+
};
|
|
132
142
|
// set custom properties for tenant theme colors
|
|
133
143
|
Object.entries(tenantColorMapping).forEach(([key, value]) => rootElement.style.setProperty(key, tenantThemeWithGeneratedStateColors[value]));
|
|
134
144
|
}
|
|
@@ -73,11 +73,16 @@ export class SwirlTimeInput {
|
|
|
73
73
|
this.setupMask();
|
|
74
74
|
this.updateIconSize(this.desktopMediaQuery.matches);
|
|
75
75
|
this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
|
|
76
|
+
// see https://stackoverflow.com/a/27314017
|
|
77
|
+
if (this.autoFocus) {
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
this.inputEl.focus();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
76
82
|
}
|
|
77
83
|
disconnectedCallback() {
|
|
78
|
-
|
|
79
|
-
(
|
|
80
|
-
(_c = (_b = this.desktopMediaQuery).removeEventListener) === null || _c === void 0 ? void 0 : _c.call(_b, "change", this.desktopMediaQueryHandler);
|
|
84
|
+
this.mask?.destroy();
|
|
85
|
+
this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
|
|
81
86
|
}
|
|
82
87
|
watchFormat() {
|
|
83
88
|
this.setupMask();
|
|
@@ -92,8 +97,7 @@ export class SwirlTimeInput {
|
|
|
92
97
|
event.target.select();
|
|
93
98
|
}
|
|
94
99
|
setupMask() {
|
|
95
|
-
|
|
96
|
-
(_a = this.mask) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
100
|
+
this.mask?.destroy();
|
|
97
101
|
this.mask = createMask(`#${this.id}`, {
|
|
98
102
|
mask: this.format.replace(/[Hhms]/g, "#"),
|
|
99
103
|
});
|
|
@@ -111,7 +115,7 @@ export class SwirlTimeInput {
|
|
|
111
115
|
const className = classnames("time-input", {
|
|
112
116
|
"time-input--inline": this.inline,
|
|
113
117
|
});
|
|
114
|
-
return (h(Host, null, h("div", { class: className }, h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, autoFocus: this.autoFocus, class: "time-input__input", disabled: this.disabled, id: this.id, onBlur: this.onBlur, onClick: this.onClick, onFocus: this.onFocus, onInput: this.onInput, placeholder: this.placeholder, required: this.required, type: "text", value: displayValue }), h("span", { class: "time-input__icon" }, h("swirl-icon-time-outlined", { size: this.iconSize })))));
|
|
118
|
+
return (h(Host, null, h("div", { class: className }, h("input", { "aria-describedby": this.swirlAriaDescribedby, "aria-disabled": this.disabled ? "true" : undefined, "aria-invalid": ariaInvalid, autoFocus: this.autoFocus, class: "time-input__input", disabled: this.disabled, id: this.id, onBlur: this.onBlur, onClick: this.onClick, onFocus: this.onFocus, onInput: this.onInput, placeholder: this.placeholder, ref: (el) => (this.inputEl = el), required: this.required, type: "text", value: displayValue }), h("span", { class: "time-input__icon" }, h("swirl-icon-time-outlined", { size: this.iconSize })))));
|
|
115
119
|
}
|
|
116
120
|
static get is() { return "swirl-time-input"; }
|
|
117
121
|
static get encapsulation() { return "scoped"; }
|
|
@@ -27,15 +27,13 @@ export class SwirlToast {
|
|
|
27
27
|
this.desktopMediaQuery.onchange = this.desktopMediaQueryHandler;
|
|
28
28
|
}
|
|
29
29
|
disconnectedCallback() {
|
|
30
|
-
|
|
31
|
-
(_b = (_a = this.desktopMediaQuery).removeEventListener) === null || _b === void 0 ? void 0 : _b.call(_a, "change", this.desktopMediaQueryHandler);
|
|
30
|
+
this.desktopMediaQuery.removeEventListener?.("change", this.desktopMediaQueryHandler);
|
|
32
31
|
}
|
|
33
32
|
forceIconProps(smallIcon) {
|
|
34
|
-
|
|
35
|
-
const icon = (_a = this.iconEl) === null || _a === void 0 ? void 0 : _a.children[0];
|
|
33
|
+
const icon = this.iconEl?.children[0];
|
|
36
34
|
const dismissIcon = this.dismissIconEl;
|
|
37
|
-
icon
|
|
38
|
-
dismissIcon
|
|
35
|
+
icon?.setAttribute("size", smallIcon ? "20" : "24");
|
|
36
|
+
dismissIcon?.setAttribute("size", smallIcon ? "20" : "24");
|
|
39
37
|
}
|
|
40
38
|
startTimer() {
|
|
41
39
|
this.clearTimer();
|
|
@@ -39,14 +39,19 @@ export class SwirlToastProvider {
|
|
|
39
39
|
else if (this.globalDuration === 0) {
|
|
40
40
|
duration = undefined;
|
|
41
41
|
}
|
|
42
|
-
const newToastWithId =
|
|
42
|
+
const newToastWithId = {
|
|
43
|
+
...newToast,
|
|
44
|
+
createdAt: new Date(),
|
|
45
|
+
duration,
|
|
46
|
+
toastId: newToast.toastId || String(Math.round(Math.random() * 10000)),
|
|
47
|
+
};
|
|
43
48
|
this.toasts = [...this.toasts, newToastWithId];
|
|
44
49
|
return newToastWithId;
|
|
45
50
|
}
|
|
46
51
|
render() {
|
|
47
52
|
return (h(Host, { role: "status" }, h("swirl-stack", { spacing: "12" }, this.toasts.map((toast) => {
|
|
48
|
-
const props =
|
|
49
|
-
return (h("swirl-toast",
|
|
53
|
+
const props = { ...toast, content: undefined };
|
|
54
|
+
return (h("swirl-toast", { key: toast.toastId, onDismiss: this.onDismiss, ...props }, toast.content));
|
|
50
55
|
}))));
|
|
51
56
|
}
|
|
52
57
|
static get is() { return "swirl-toast-provider"; }
|
|
@@ -46,29 +46,28 @@ export class SwirlTooltip {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
this.getArrowStyles = () => {
|
|
49
|
-
|
|
50
|
-
if (((_a = this.actualPosition) === null || _a === void 0 ? void 0 : _a.placement) === "top") {
|
|
49
|
+
if (this.actualPosition?.placement === "top") {
|
|
51
50
|
return {
|
|
52
51
|
top: "100%",
|
|
53
52
|
left: "50%",
|
|
54
53
|
transform: "translate3d(-50%, -50%, 0) rotate(45deg)",
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
|
-
if (
|
|
56
|
+
if (this.actualPosition?.placement === "bottom") {
|
|
58
57
|
return {
|
|
59
58
|
bottom: "100%",
|
|
60
59
|
left: "50%",
|
|
61
60
|
transform: "translate3d(-50%, 50%, 0) rotate(45deg)",
|
|
62
61
|
};
|
|
63
62
|
}
|
|
64
|
-
if (
|
|
63
|
+
if (this.actualPosition?.placement === "right") {
|
|
65
64
|
return {
|
|
66
65
|
top: "50%",
|
|
67
66
|
right: "100%",
|
|
68
67
|
transform: "translate3d(50%, -50%, 0) rotate(45deg)",
|
|
69
68
|
};
|
|
70
69
|
}
|
|
71
|
-
if (
|
|
70
|
+
if (this.actualPosition?.placement === "left") {
|
|
72
71
|
return {
|
|
73
72
|
top: "50%",
|
|
74
73
|
left: "100%",
|
|
@@ -104,14 +103,13 @@ export class SwirlTooltip {
|
|
|
104
103
|
this.updateOptions();
|
|
105
104
|
}
|
|
106
105
|
render() {
|
|
107
|
-
var _a, _b;
|
|
108
106
|
const arrowStyles = this.getArrowStyles();
|
|
109
107
|
return (h(Host, { onKeydown: this.onKeydown }, h("span", { class: "tooltip" }, h("span", { class: "tooltip__reference", "aria-describedby": "tooltip", onBlur: this.hide, onClick: this.hide, onFocus: this.show, ref: (el) => (this.referenceEl = el), tabIndex: 0 }, h("slot", null)), h("span", { class: "tooltip__popper", ref: (el) => (this.popperEl = el), style: {
|
|
110
108
|
top: Boolean(this.actualPosition)
|
|
111
|
-
? `${
|
|
109
|
+
? `${this.actualPosition?.y}px`
|
|
112
110
|
: "",
|
|
113
111
|
left: Boolean(this.actualPosition)
|
|
114
|
-
? `${
|
|
112
|
+
? `${this.actualPosition?.x}px`
|
|
115
113
|
: "",
|
|
116
114
|
} }, this.visible && (h("span", { class: "tooltip__bubble", id: "tooltip", part: "tooltip__bubble", role: "tooltip" }, h("span", { class: "tooltip__content", innerHTML: this.content }), h("span", { class: "tooltip__arrow", style: arrowStyles })))))));
|
|
117
115
|
}
|
|
@@ -41,8 +41,7 @@ export class FileManager {
|
|
|
41
41
|
this.selectedDirectory = undefined;
|
|
42
42
|
};
|
|
43
43
|
this.toggleSidebar = () => {
|
|
44
|
-
|
|
45
|
-
(_a = this.layout) === null || _a === void 0 ? void 0 : _a.toggleSidebar();
|
|
44
|
+
this.layout?.toggleSidebar();
|
|
46
45
|
};
|
|
47
46
|
this.selectedDirectory = undefined;
|
|
48
47
|
this.selectedFile = undefined;
|
|
@@ -57,8 +56,7 @@ export class FileManager {
|
|
|
57
56
|
onClick: () => this.selectItem(item) }, "type" in item ? (h("swirl-icon-file", { slot: "media" })) : (h("swirl-icon-folder-shared", { slot: "media" })))))) : (h("swirl-box", { padding: "16" }, h("swirl-text", { color: "subdued", weight: "medium" }, "This directory is empty.")));
|
|
58
57
|
}
|
|
59
58
|
render() {
|
|
60
|
-
|
|
61
|
-
return (h(Host, null, h("swirl-app-layout", { appName: "Documents", backToNavigationViewButtonLabel: "Back to documents list", ctaIcon: "<swirl-icon-add></swirl-icon-add>", ctaLabel: "Upload file", navigationLabel: "Documents", onNavigationBackButtonClick: this.resetSelectedDirectory, ref: (el) => (this.layout = el), sidebarCloseButtonLabel: "Close file info", sidebarHeading: "File info", showNavigationBackButton: Boolean(this.selectedDirectory), transitionStyle: "dialog" }, h("swirl-resource-list", { label: "Documents", slot: "navigation" }, this.renderNavigation()), h("swirl-popover-trigger", { popover: this.sortMenu, slot: "navigation-controls" }, h("swirl-button", { label: "Sort items" })), h("swirl-stack", { orientation: "horizontal", slot: "app-bar" }, h("swirl-stack", null, h("swirl-heading", { as: "h2", level: 4, text: (_a = this.selectedFile) === null || _a === void 0 ? void 0 : _a.name }), h("swirl-text", { color: "subdued", truncate: true }, (_b = this.selectedFile) === null || _b === void 0 ? void 0 : _b.description))), Boolean(this.selectedFile) ? (h("swirl-file-viewer", { file: this.selectedFile.url, slot: "content", type: this.selectedFile.type })) : (h("swirl-box", { cover: true, centerBlock: true, centerInline: true, padding: "16", slot: "content" }, h("swirl-empty-state", { heading: "Nothing to see here.", illustration: "/images/empty-state-1.svg" }, "Please select a file from the list."))), h("div", { slot: "app-bar-controls" }, this.selectedFile && (h("swirl-button", { "hide-label": true, class: "info-button", icon: "<swirl-icon-info></swirl-icon-info>", label: "Open file info", onClick: this.toggleSidebar }))), h("swirl-box", { padding: "16", slot: "sidebar" }, h("swirl-text", { color: "subdued", weight: "medium" }, "File info goes here \u2026"))), h("swirl-popover", { label: "Sort items", ref: (el) => (this.sortMenu = el) }, h("swirl-option-list", { value: ["ascending"] }, h("swirl-option-list-item", { icon: "<swirl-icon-expand-less></swirl-icon-expand-less>", label: "Ascending", value: "ascending" }), h("swirl-option-list-item", { icon: "<swirl-icon-expand-more></swirl-icon-expand-more>", label: "Descending", value: "descending" }), h("swirl-option-list-item", { icon: "<swirl-icon-time-outlined></swirl-icon-time-outlined>", label: "By date", value: "date" })))));
|
|
59
|
+
return (h(Host, null, h("swirl-app-layout", { appName: "Documents", backToNavigationViewButtonLabel: "Back to documents list", ctaIcon: "<swirl-icon-add></swirl-icon-add>", ctaLabel: "Upload file", navigationLabel: "Documents", onNavigationBackButtonClick: this.resetSelectedDirectory, ref: (el) => (this.layout = el), sidebarCloseButtonLabel: "Close file info", sidebarHeading: "File info", showNavigationBackButton: Boolean(this.selectedDirectory), transitionStyle: "dialog" }, h("swirl-resource-list", { label: "Documents", slot: "navigation" }, this.renderNavigation()), h("swirl-popover-trigger", { popover: this.sortMenu, slot: "navigation-controls" }, h("swirl-button", { label: "Sort items" })), h("swirl-stack", { orientation: "horizontal", slot: "app-bar" }, h("swirl-stack", null, h("swirl-heading", { as: "h2", level: 4, text: this.selectedFile?.name }), h("swirl-text", { color: "subdued", truncate: true }, this.selectedFile?.description))), Boolean(this.selectedFile) ? (h("swirl-file-viewer", { file: this.selectedFile.url, slot: "content", type: this.selectedFile.type })) : (h("swirl-box", { cover: true, centerBlock: true, centerInline: true, padding: "16", slot: "content" }, h("swirl-empty-state", { heading: "Nothing to see here.", illustration: "/images/empty-state-1.svg" }, "Please select a file from the list."))), h("div", { slot: "app-bar-controls" }, this.selectedFile && (h("swirl-button", { "hide-label": true, class: "info-button", icon: "<swirl-icon-info></swirl-icon-info>", label: "Open file info", onClick: this.toggleSidebar }))), h("swirl-box", { padding: "16", slot: "sidebar" }, h("swirl-text", { color: "subdued", weight: "medium" }, "File info goes here \u2026"))), h("swirl-popover", { label: "Sort items", ref: (el) => (this.sortMenu = el) }, h("swirl-option-list", { value: ["ascending"] }, h("swirl-option-list-item", { icon: "<swirl-icon-expand-less></swirl-icon-expand-less>", label: "Ascending", value: "ascending" }), h("swirl-option-list-item", { icon: "<swirl-icon-expand-more></swirl-icon-expand-more>", label: "Descending", value: "descending" }), h("swirl-option-list-item", { icon: "<swirl-icon-time-outlined></swirl-icon-time-outlined>", label: "By date", value: "date" })))));
|
|
62
60
|
}
|
|
63
61
|
static get is() { return "file-manager"; }
|
|
64
62
|
static get encapsulation() { return "shadow"; }
|