@getflip/swirl-components 0.228.0 → 0.230.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 +76 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/swirl-action-list_3.cjs.entry.js +1 -1
- package/dist/cjs/swirl-app-layout_5.cjs.entry.js +3 -2
- package/dist/cjs/swirl-autocomplete.cjs.entry.js +1 -1
- package/dist/cjs/swirl-banner.cjs.entry.js +1 -1
- package/dist/cjs/swirl-button.cjs.entry.js +1 -1
- package/dist/cjs/swirl-carousel.cjs.entry.js +1 -1
- package/dist/cjs/swirl-chip.cjs.entry.js +1 -1
- package/dist/cjs/swirl-components.cjs.js +1 -1
- package/dist/cjs/swirl-console-layout.cjs.entry.js +1 -1
- package/dist/cjs/swirl-date-input.cjs.entry.js +1 -1
- package/dist/cjs/swirl-date-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/swirl-file-viewer_8.cjs.entry.js +1 -1
- package/dist/cjs/swirl-form-control.cjs.entry.js +1 -1
- package/dist/cjs/swirl-icon-check-small_3.cjs.entry.js +1 -1
- package/dist/cjs/swirl-icon-error_3.cjs.entry.js +1 -1
- package/dist/cjs/swirl-inline-status.cjs.entry.js +1 -1
- package/dist/cjs/swirl-lightbox.cjs.entry.js +1 -1
- package/dist/cjs/swirl-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/swirl-menu.cjs.entry.js +1 -1
- package/dist/cjs/swirl-option-list_2.cjs.entry.js +1 -1
- package/dist/cjs/swirl-pagination.cjs.entry.js +1 -1
- package/dist/cjs/swirl-pdf-reader.cjs.entry.js +1 -1
- package/dist/cjs/swirl-popover_2.cjs.entry.js +1 -1
- package/dist/cjs/swirl-resource-list-file-item.cjs.entry.js +1 -1
- package/dist/cjs/swirl-search.cjs.entry.js +1 -1
- package/dist/cjs/swirl-select.cjs.entry.js +1 -1
- package/dist/cjs/swirl-shell-layout.cjs.entry.js +25 -14
- 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 -1
- package/dist/cjs/swirl-text-input.cjs.entry.js +1 -1
- package/dist/cjs/swirl-time-input.cjs.entry.js +1 -1
- package/dist/cjs/swirl-toast.cjs.entry.js +1 -1
- package/dist/cjs/swirl-toolbar.cjs.entry.js +1 -1
- package/dist/cjs/{utils-c82e5573.js → utils-3ff36fc3.js} +4 -0
- package/dist/collection/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/collection/components/swirl-resource-list/swirl-resource-list.js +26 -1
- package/dist/collection/components/swirl-resource-list/swirl-resource-list.spec.js +1 -1
- package/dist/collection/components/swirl-shell-layout/swirl-shell-layout.js +33 -15
- package/dist/collection/components/swirl-text/swirl-text.spec.js +2 -2
- package/dist/collection/utils.js +3 -0
- package/dist/components/assets/pdfjs/pdf.worker.min.js +1 -1
- package/dist/components/swirl-app-layout2.js +1 -1
- package/dist/components/swirl-file-viewer-pdf2.js +1 -1
- package/dist/components/swirl-resource-list2.js +3 -1
- package/dist/components/swirl-shell-layout.js +27 -15
- package/dist/components/utils.js +4 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/swirl-action-list_3.entry.js +1 -1
- package/dist/esm/swirl-app-layout_5.entry.js +3 -2
- package/dist/esm/swirl-autocomplete.entry.js +1 -1
- package/dist/esm/swirl-banner.entry.js +1 -1
- package/dist/esm/swirl-button.entry.js +1 -1
- package/dist/esm/swirl-carousel.entry.js +1 -1
- package/dist/esm/swirl-chip.entry.js +1 -1
- package/dist/esm/swirl-components.js +1 -1
- package/dist/esm/swirl-console-layout.entry.js +1 -1
- package/dist/esm/swirl-date-input.entry.js +1 -1
- package/dist/esm/swirl-date-picker_2.entry.js +1 -1
- package/dist/esm/swirl-file-viewer_8.entry.js +1 -1
- package/dist/esm/swirl-form-control.entry.js +1 -1
- package/dist/esm/swirl-icon-check-small_3.entry.js +1 -1
- package/dist/esm/swirl-icon-error_3.entry.js +1 -1
- package/dist/esm/swirl-inline-status.entry.js +1 -1
- package/dist/esm/swirl-lightbox.entry.js +1 -1
- package/dist/esm/swirl-menu-item.entry.js +1 -1
- package/dist/esm/swirl-menu.entry.js +1 -1
- package/dist/esm/swirl-option-list_2.entry.js +1 -1
- package/dist/esm/swirl-pagination.entry.js +1 -1
- package/dist/esm/swirl-pdf-reader.entry.js +1 -1
- package/dist/esm/swirl-popover_2.entry.js +1 -1
- package/dist/esm/swirl-resource-list-file-item.entry.js +1 -1
- package/dist/esm/swirl-search.entry.js +1 -1
- package/dist/esm/swirl-select.entry.js +1 -1
- package/dist/esm/swirl-shell-layout.entry.js +25 -14
- 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 -1
- package/dist/esm/swirl-text-input.entry.js +1 -1
- package/dist/esm/swirl-time-input.entry.js +1 -1
- package/dist/esm/swirl-toast.entry.js +1 -1
- package/dist/esm/swirl-toolbar.entry.js +1 -1
- package/dist/esm/{utils-9b747dd7.js → utils-c16952ba.js} +4 -1
- package/dist/swirl-components/{p-e1ff83d8.entry.js → p-08f5f1d3.entry.js} +1 -1
- package/dist/swirl-components/{p-f6d1648e.entry.js → p-1392a4a9.entry.js} +1 -1
- package/dist/swirl-components/{p-f7e43e2f.entry.js → p-13d34640.entry.js} +1 -1
- package/dist/swirl-components/{p-847592fc.entry.js → p-1cf1875d.entry.js} +1 -1
- package/dist/swirl-components/{p-b2548187.entry.js → p-1e97bdac.entry.js} +1 -1
- package/dist/swirl-components/{p-f313bf01.entry.js → p-2140f5ba.entry.js} +1 -1
- package/dist/swirl-components/{p-b6cc6b81.entry.js → p-27a1ed04.entry.js} +1 -1
- package/dist/swirl-components/{p-6fea6759.entry.js → p-2ce35652.entry.js} +1 -1
- package/dist/swirl-components/{p-4ec4c3e3.entry.js → p-2f081c81.entry.js} +1 -1
- package/dist/swirl-components/{p-7102e187.entry.js → p-35be11a9.entry.js} +1 -1
- package/dist/swirl-components/{p-ee32dd8b.entry.js → p-35da654d.entry.js} +1 -1
- package/dist/swirl-components/{p-763c5694.entry.js → p-46d2b252.entry.js} +1 -1
- package/dist/swirl-components/{p-18c4f321.entry.js → p-4beb9f23.entry.js} +1 -1
- package/dist/swirl-components/{p-64af1828.entry.js → p-52e3cd23.entry.js} +1 -1
- package/dist/swirl-components/{p-100d3b2a.entry.js → p-552c6e85.entry.js} +1 -1
- package/dist/swirl-components/p-5848d900.js +1 -0
- package/dist/swirl-components/{p-c497d897.entry.js → p-64a31581.entry.js} +1 -1
- package/dist/swirl-components/{p-2901eccf.entry.js → p-75b1b381.entry.js} +1 -1
- package/dist/swirl-components/{p-b3472679.entry.js → p-7be8ab02.entry.js} +1 -1
- package/dist/swirl-components/{p-3c991c18.entry.js → p-8944f95b.entry.js} +1 -1
- package/dist/swirl-components/{p-68ed6dcc.entry.js → p-90cad481.entry.js} +1 -1
- package/dist/swirl-components/{p-2824cfca.entry.js → p-a281dbe3.entry.js} +1 -1
- package/dist/swirl-components/{p-85103dcc.entry.js → p-a7dfc194.entry.js} +1 -1
- package/dist/swirl-components/{p-5b251b1e.entry.js → p-aa18cff2.entry.js} +1 -1
- package/dist/swirl-components/{p-0d0d3ded.entry.js → p-bfabb88e.entry.js} +1 -1
- package/dist/swirl-components/{p-30e79248.entry.js → p-c4671da2.entry.js} +1 -1
- package/dist/swirl-components/{p-9c02b88b.entry.js → p-d168a8bb.entry.js} +1 -1
- package/dist/swirl-components/{p-740d9751.entry.js → p-d5f023e1.entry.js} +1 -1
- package/dist/swirl-components/{p-5625da01.entry.js → p-e4353c3d.entry.js} +1 -1
- package/dist/swirl-components/{p-63f3198d.entry.js → p-ea02636d.entry.js} +1 -1
- package/dist/swirl-components/p-eb502f57.entry.js +1 -0
- package/dist/swirl-components/{p-7dfa4feb.entry.js → p-f058ae20.entry.js} +1 -1
- package/dist/swirl-components/{p-9d546f10.entry.js → p-f74eae56.entry.js} +1 -1
- package/dist/swirl-components/{p-6e36dd88.entry.js → p-ff56c492.entry.js} +1 -1
- package/dist/swirl-components/swirl-components.esm.js +1 -1
- package/dist/types/components/swirl-resource-list/swirl-resource-list.d.ts +2 -0
- package/dist/types/components/swirl-shell-layout/swirl-shell-layout.d.ts +2 -0
- package/dist/types/components.d.ts +8 -4
- package/dist/types/utils.d.ts +1 -0
- package/package.json +1 -1
- package/vscode-data.json +39 -0
- package/dist/swirl-components/p-0ac5f986.entry.js +0 -1
- package/dist/swirl-components/p-58abf3c6.js +0 -1
|
@@ -83,6 +83,7 @@ export class SwirlResourceList {
|
|
|
83
83
|
this.assistiveTextItemMoved = "Item moved. New position:";
|
|
84
84
|
this.controllingElement = undefined;
|
|
85
85
|
this.label = undefined;
|
|
86
|
+
this.spacing = "0";
|
|
86
87
|
this.assistiveText = undefined;
|
|
87
88
|
this.listId = uuid();
|
|
88
89
|
}
|
|
@@ -232,7 +233,7 @@ export class SwirlResourceList {
|
|
|
232
233
|
this.assistiveText = `${this.assistiveTextItemMoving} ${this.getItemIndex(this.dragging) + 1}`;
|
|
233
234
|
}
|
|
234
235
|
render() {
|
|
235
|
-
return (h(Host, { key: '
|
|
236
|
+
return (h(Host, { key: '5275305a537d6591f88aca3e719eb625a81af46e', onKeyDown: this.onKeyDown }, h("swirl-visually-hidden", { key: '2bfd1debd362806e9f66b9f0ced478eceba8b4ee', role: "alert" }, this.assistiveText), h("swirl-box", { key: 'b473aac22f978d47aa2d7734ac1c0228efb11210', paddingInlineEnd: "8", paddingInlineStart: "8" }, h("swirl-stack", { key: '757cc4a34325eb8298437a43b3f2aeeb895fb74a', "aria-label": this.label, class: "resource-list", id: this.listId, ref: (el) => (this.gridEl = el), role: "grid", spacing: this.spacing }, h("slot", { key: '833d2dace730d044e9f65f95e874c118a70ae25e' })))));
|
|
236
237
|
}
|
|
237
238
|
static get is() { return "swirl-resource-list"; }
|
|
238
239
|
static get encapsulation() { return "scoped"; }
|
|
@@ -355,6 +356,30 @@ export class SwirlResourceList {
|
|
|
355
356
|
},
|
|
356
357
|
"attribute": "label",
|
|
357
358
|
"reflect": false
|
|
359
|
+
},
|
|
360
|
+
"spacing": {
|
|
361
|
+
"type": "string",
|
|
362
|
+
"mutable": false,
|
|
363
|
+
"complexType": {
|
|
364
|
+
"original": "SwirlStackSpacing",
|
|
365
|
+
"resolved": "\"0\" | \"12\" | \"16\" | \"2\" | \"24\" | \"32\" | \"4\" | \"40\" | \"48\" | \"64\" | \"8\"",
|
|
366
|
+
"references": {
|
|
367
|
+
"SwirlStackSpacing": {
|
|
368
|
+
"location": "import",
|
|
369
|
+
"path": "../swirl-stack/swirl-stack",
|
|
370
|
+
"id": "src/components/swirl-stack/swirl-stack.tsx::SwirlStackSpacing"
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
"required": false,
|
|
375
|
+
"optional": true,
|
|
376
|
+
"docs": {
|
|
377
|
+
"tags": [],
|
|
378
|
+
"text": ""
|
|
379
|
+
},
|
|
380
|
+
"attribute": "spacing",
|
|
381
|
+
"reflect": false,
|
|
382
|
+
"defaultValue": "\"0\""
|
|
358
383
|
}
|
|
359
384
|
};
|
|
360
385
|
}
|
|
@@ -48,7 +48,7 @@ describe("swirl-resource-list", () => {
|
|
|
48
48
|
<swirl-resource-list label="Label">
|
|
49
49
|
<swirl-visually-hidden role="alert"></swirl-visually-hidden>
|
|
50
50
|
<swirl-box paddinginlineend="8" paddinginlinestart="8">
|
|
51
|
-
<swirl-stack aria-label="Label" class="resource-list" id="${id}" role="grid">
|
|
51
|
+
<swirl-stack aria-label="Label" class="resource-list" id="${id}" role="grid" spacing="0">
|
|
52
52
|
<swirl-resource-list-item description="With a description" label="This is a resource item" media="<swirl-avatar label="John Doe" src="https://picsum.photos/id/433/144/144"></swirl-avatar>"></swirl-resource-list-item>
|
|
53
53
|
<swirl-resource-list-item description="With a description" label="This is a resource item" media="<swirl-avatar label="John Doe" src="https://picsum.photos/id/103/144/144"></swirl-avatar>"></swirl-resource-list-item>
|
|
54
54
|
</swirl-stack>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import * as focusTrap from "focus-trap";
|
|
4
|
+
import { isDesktopViewport } from "../../utils";
|
|
4
5
|
const SECONDARY_NAVIGATION_COLLAPSE_STORAGE_KEY = "SWIRL_SHELL_SECONDARY_NAVIGATION_COLLAPSE_STATE";
|
|
5
6
|
const SECONDARY_NAVIGATION_VIEW_STORAGE_KEY = "SWIRL_SHELL_SECONDARY_NAVIGATION_VIEW_STATE";
|
|
6
7
|
const NAVIGATION_COLLAPSE_STORAGE_KEY = "SWIRL_SHELL_NAVIGATION_COLLAPSE_STATE";
|
|
@@ -23,6 +24,7 @@ export class SwirlShellLayout {
|
|
|
23
24
|
this.mainNavItems = Array.from(this.el.querySelectorAll("swirl-shell-navigation-item[slot='nav'], [slot='nav'] swirl-shell-navigation-item"));
|
|
24
25
|
this.secondaryNavItems = Array.from(this.el.querySelectorAll("swirl-shell-navigation-item[slot='secondary-nav'], [slot='secondary-nav'] swirl-shell-navigation-item"));
|
|
25
26
|
this.toggleNavItemLabels();
|
|
27
|
+
this.setSecondaryNavItemsTiled();
|
|
26
28
|
};
|
|
27
29
|
this.toggleSecondaryNavView = (event) => {
|
|
28
30
|
event.stopPropagation();
|
|
@@ -67,8 +69,10 @@ export class SwirlShellLayout {
|
|
|
67
69
|
this.navigationCollapsed = undefined;
|
|
68
70
|
this.secondaryNavCollapsed = undefined;
|
|
69
71
|
this.secondaryNavView = "list";
|
|
72
|
+
this.isDesktopViewport = true;
|
|
70
73
|
}
|
|
71
74
|
componentWillLoad() {
|
|
75
|
+
this.isDesktopViewport = isDesktopViewport();
|
|
72
76
|
this.collectNavItems();
|
|
73
77
|
const restoredSidebarState = localStorage.getItem(SIDEBAR_STORAGE_KEY) === "true";
|
|
74
78
|
this.sidebarActive =
|
|
@@ -88,8 +92,7 @@ export class SwirlShellLayout {
|
|
|
88
92
|
},
|
|
89
93
|
},
|
|
90
94
|
});
|
|
91
|
-
this.
|
|
92
|
-
this.setSecondaryNavItemsTiled();
|
|
95
|
+
this.collectNavItems();
|
|
93
96
|
this.navMutationObserver = new MutationObserver(() => {
|
|
94
97
|
this.collectNavItems();
|
|
95
98
|
this.setSecondaryNavItemsTiled();
|
|
@@ -132,29 +135,37 @@ export class SwirlShellLayout {
|
|
|
132
135
|
watchSidebarActive() {
|
|
133
136
|
localStorage.setItem(SIDEBAR_STORAGE_KEY, String(this.sidebarActive));
|
|
134
137
|
}
|
|
138
|
+
onWindowResize() {
|
|
139
|
+
if (this.isDesktopViewport !== isDesktopViewport()) {
|
|
140
|
+
this.isDesktopViewport = isDesktopViewport();
|
|
141
|
+
this.collectNavItems();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
135
144
|
/**
|
|
136
145
|
* Opens the mobile navigation.
|
|
137
146
|
*/
|
|
138
147
|
async showMobileNavigation() {
|
|
139
148
|
this.mobileNavigationActive = true;
|
|
149
|
+
this.collectNavItems();
|
|
140
150
|
}
|
|
141
151
|
/**
|
|
142
152
|
* Hides the mobile navigation.
|
|
143
153
|
*/
|
|
144
154
|
async hideMobileNavigation() {
|
|
145
155
|
this.mobileNavigationActive = false;
|
|
156
|
+
this.toggleNavItemLabels();
|
|
146
157
|
}
|
|
147
158
|
toggleNavItemLabels() {
|
|
148
159
|
[...this.secondaryNavItems, ...this.mainNavItems].forEach((item) => {
|
|
149
|
-
item.hideLabel =
|
|
150
|
-
!!(this.enableSecondaryNavGridLayout && this.navigationCollapsed) ||
|
|
151
|
-
(!this.enableSecondaryNavGridLayout && this.navigationCollapsed);
|
|
160
|
+
item.hideLabel = this.navigationCollapsed && this.isDesktopViewport;
|
|
152
161
|
});
|
|
153
162
|
}
|
|
154
163
|
setSecondaryNavItemsTiled() {
|
|
155
164
|
this.secondaryNavItems.forEach((item) => {
|
|
156
165
|
item.tiled =
|
|
157
|
-
this.enableSecondaryNavGridLayout &&
|
|
166
|
+
this.enableSecondaryNavGridLayout &&
|
|
167
|
+
(this.secondaryNavView === "grid" ||
|
|
168
|
+
(this.navigationCollapsed && this.isDesktopViewport));
|
|
158
169
|
});
|
|
159
170
|
}
|
|
160
171
|
restoreSecondaryNavState() {
|
|
@@ -169,31 +180,31 @@ export class SwirlShellLayout {
|
|
|
169
180
|
}
|
|
170
181
|
render() {
|
|
171
182
|
const hasSidebarToggleBadgeWithLabel = this.sidebarToggleBadge !== true && this.sidebarToggleBadge !== "true";
|
|
183
|
+
const mainNavCollapsed = this.navigationCollapsed && this.isDesktopViewport;
|
|
172
184
|
const hasSecondaryNav = Boolean(this.el.querySelector("[slot='secondary-nav']"));
|
|
173
185
|
const className = classnames("shell-layout", {
|
|
174
186
|
"shell-layout--branded-header": this.brandedHeader,
|
|
175
187
|
"shell-layout--secondary-nav-collapsed": this.secondaryNavCollapsed,
|
|
176
188
|
"shell-layout--has-secondary-nav": hasSecondaryNav,
|
|
177
189
|
"shell-layout--mobile-navigation-active": this.mobileNavigationActive,
|
|
178
|
-
"shell-layout--navigation-collapsed":
|
|
190
|
+
"shell-layout--navigation-collapsed": mainNavCollapsed,
|
|
179
191
|
"shell-layout--sidebar-active": this.sidebarActive,
|
|
180
192
|
});
|
|
181
|
-
return (h(Host, { key: '
|
|
193
|
+
return (h(Host, { key: '5c12250de3323c6e489f3e91807fce226378a364' }, h("div", { key: '20efbc31458693f8f880e15bdef8732a979e7723', class: className }, h("header", { key: '93645e7bf08d24544267a9a35de0887ebdcac9e9', class: "shell-layout__header", "data-tauri-drag-region": "true" }, h("button", { key: '20361c417ab828b5cf9bef5710012cd48d73540b', class: "shell-layout__skip-link", onClick: this.skipLinkClick.emit, type: "button" }, this.skipLinkLabel), h("div", { key: '6c76237a92f7758630f947d174eca682df9813f7', class: "shell-layout__header-left" }, h("button", { key: '1282daa50168b50b57e057f050fdcd43339060ab', class: "shell-layout__header-tool", onClick: this.onNavigationToggleClick, type: "button" }, h("swirl-icon-dock-left", { key: '16891b597aad29f8cf8a3641db6208db46a84b47', size: 20 }), h("swirl-visually-hidden", { key: '1294f46b1faefca7a122c494b861d25272ea2cb4' }, this.navigationToggleLabel)), h("a", { key: 'f7ed1b921d55faf287752be5d4ad9d8c3155653a', class: "shell-layout__header-tool", href: "javascript:history.back()" }, h("swirl-icon-arrow-back", { key: '5b03132e0e5be62efe2f5f217aa064942c5b78fb', size: 20 }), h("swirl-visually-hidden", { key: 'bb26c2d22fe311fc899b022fd5e3fc1bdd2333d6' }, this.browserBackButtonLabel)), h("a", { key: '111fe00b6d8f0aa4a1739ed7f11e27b4de82af4f', class: "shell-layout__header-tool", href: "javascript:history.forward()" }, h("swirl-icon-arrow-forward", { key: '0cbc2913813e5a60a59151ef70f87123c38636d7', size: 20 }), h("swirl-visually-hidden", { key: '3c143db049267b6f7b9040cd8efa4b6767b31c71' }, this.browserForwardButtonLabel)), h("slot", { key: 'd0e00ad4b9424c3713be1cbdc4173cca7e175f60', name: "left-header-tools" })), h("div", { key: '9053b2428a73b52f2657138a2018c3bb8df9b942', class: "shell-layout__logo" }, h("slot", { key: '46fb16906c4940ac2226a23c60ca4e2b700c1f2b', name: "logo" })), h("div", { key: '35825b726163fca399fcccd8f92c511e951a4f6d', class: "shell-layout__header-right" }, h("slot", { key: '7a16ab917f4031730f0915658325ab663b46abdc', name: "right-header-tools" }), h("button", { key: '0828fa4d0969f4ebe05036455de31c1c921b7ae9', class: "shell-layout__header-tool shell-layout__sidebar-toggle", onClick: this.sidebarToggleClick.emit, type: "button" }, h("swirl-icon", { key: 'd39c7c329648a3798b6424558ce7f7de34b765f9', glyph: this.sidebarToggleIcon, size: 20 }), h("swirl-visually-hidden", { key: '51889052fb865b555db470634e69adfcb7e9a433' }, this.sidebarToggleLabel), this.sidebarToggleBadge && (h("swirl-badge", { key: '4cc79f7e073afc1f6e609e54480b468f4e5f028e', "aria-label": this.sidebarToggleBadgeAriaLabel, label: !hasSidebarToggleBadgeWithLabel
|
|
182
194
|
? this.sidebarToggleBadgeAriaLabel
|
|
183
|
-
: String(this.sidebarToggleBadge), size: "xs", variant: !hasSidebarToggleBadgeWithLabel ? "dot" : "default" }))), h("slot", { key: '
|
|
195
|
+
: String(this.sidebarToggleBadge), size: "xs", variant: !hasSidebarToggleBadgeWithLabel ? "dot" : "default" }))), h("slot", { key: '8119e763ed4ec0c4934317ac5fa2bb5ae56413a3', name: "avatar" }))), h("div", { key: '618249da25d9a510e3b850d68389e52d4c5b64ed', class: "shell-layout__mobile-nav-backdrop", onClick: this.onNavigationClick }), h("nav", { key: 'a1689720c5f62cf1572ee80ed1b82ee5676cd406', "aria-labelledby": "main-navigation-label", class: "shell-layout__nav", onClick: this.onNavigationClick, ref: (el) => (this.navElement = el) }, h("div", { key: 'b4500a5a6f0f4a32ce4ee1f8c90c40896aabb5c8', class: "shell-layout__mobile-header" }, h("slot", { key: 'f22761f5011f27f19628d415840c90e8dbffd306', name: "mobile-logo" }), h("div", { key: '9761126f496e42f861a474722ee12b908efc2108', class: "shell-layout__mobile-header-tools" }, h("slot", { key: '3dac3d5358433559971ba3e2aa60428daf72d6fd', name: "mobile-header-tools" }), h("button", { key: '8df62c780226b37da61106c09759c0f83827172e', class: "shell-layout__header-tool", type: "button" }, h("swirl-icon-double-arrow-left", { key: 'd0ee691f631be0ecfad427dd9640e1d9563083b1', size: 20 }), h("swirl-visually-hidden", { key: '3e028b5919a3967cd725ee7601d2569fe5378b7b' }, this.hideMobileNavigationButtonLabel)))), h("div", { key: 'a6478a52bfedf7c080244b13aa3ecfaadb8afaec', class: "shell-layout__nav-body" }, h("swirl-visually-hidden", { key: '71fb758c944603cbc0eca1a70f57cab4d81d3ea6' }, h("span", { key: '8fcb34cde559b2192caead914d558df4581b23ec', id: "main-navigation-label" }, this.navigationLabel)), h("slot", { key: '4bc9baa3d12381678981e84c3727ee79a127fea2', name: "nav", onSlotchange: this.collectNavItems }), h("div", { key: 'c555bc66bceed44d1ee9f9599cb6a66b3fa484a2', class: "shell-layout__secondary-nav" }, h("swirl-separator", { key: 'cba186e98e42a5f7644c4dfabf773f7e49587f3c', borderColor: "strong", spacing: "16" }), this.enableSecondaryNavGridLayout && (h("swirl-box", { key: 'b5393c61be683dcbdbfef248763ca5d388aba4d4', paddingBlockEnd: "16" }, h("swirl-stack", { key: '3238deda1ae4b70aaf1fcbf0a0f3091d35b3ebaf', justify: mainNavCollapsed ? "center" : "space-between", orientation: "horizontal" }, h("swirl-button", { key: '10a3251a25367af6d85368f3497eda2eaaf8b154', hideLabel: mainNavCollapsed, icon: this.secondaryNavCollapsed
|
|
184
196
|
? "<swirl-icon-expand-more></swirl-icon-expand-more>"
|
|
185
197
|
: "<swirl-icon-expand-less></swirl-icon-expand-less>", label: this.secondaryNavCollapsed
|
|
186
198
|
? this.secondaryNavExpandLabel
|
|
187
|
-
: this.secondaryNavCollapseLabel, onClick: this.toggleSecondaryNavCollapse, variant: "plain" }), !this.
|
|
188
|
-
!this.secondaryNavCollapsed && (h("swirl-button", { key: '9c43584ccb0e91ecc7143c1f4671c664515db04c', icon: this.secondaryNavView === "grid"
|
|
199
|
+
: this.secondaryNavCollapseLabel, onClick: this.toggleSecondaryNavCollapse, variant: "plain" }), !mainNavCollapsed && !this.secondaryNavCollapsed && (h("swirl-button", { key: 'df1df6b2a06c721a6b4df20dac8f9de908708021', icon: this.secondaryNavView === "grid"
|
|
189
200
|
? "<swirl-icon-menu></swirl-icon-menu>"
|
|
190
201
|
: "<swirl-icon-hamburger-menu></swirl-icon-hamburger-menu>", iconPosition: "end", label: this.secondaryNavView === "grid"
|
|
191
202
|
? this.gridNavLayoutToggleLabel
|
|
192
|
-
: this.listNavLayoutToggleLabel, onClick: this.toggleSecondaryNavView, variant: "plain" }))))), h("div", { key: '
|
|
203
|
+
: this.listNavLayoutToggleLabel, onClick: this.toggleSecondaryNavView, variant: "plain" }))))), h("div", { key: '69a481958c06725c99888a4dbb70807ab424c2ac', class: {
|
|
193
204
|
"shell-layout__secondary-nav-items": true,
|
|
194
205
|
"shell-layout__secondary-nav-items--grid-view": this.enableSecondaryNavGridLayout &&
|
|
195
|
-
this.secondaryNavView === "grid",
|
|
196
|
-
} }, h("slot", { key: '
|
|
206
|
+
(this.secondaryNavView === "grid" || mainNavCollapsed),
|
|
207
|
+
} }, h("slot", { key: '7054faefe6f13c25a071498e9b556d9f7990cc5a', name: "secondary-nav", onSlotchange: this.collectNavItems }))))), h("main", { key: 'eee310fc015240bf09e44f52e1273f7d86dec913', class: "shell-layout__main", id: "main-content" }, h("slot", { key: '2564cd4717d18a74cee4ed6da1533e2148b0ded8' })), h("aside", { key: '9e906480ee9b8e4625107e1382a0ab71edbebd07', class: "shell-layout__sidebar", inert: this.sidebarActive ? undefined : true }, h("div", { key: '900e544ddbef42702dd3507d3163ba208ed6e5ca', class: "shell-layout__sidebar-body" }, h("div", { key: '0fbcf8cd5a0e158e7923cf851cc474b570ec886a', class: "shell-layout__sidebar-app-bar" }, h("slot", { key: '1904105bcb39ba4bf04b93fe6f97fa1feece49d1', name: "sidebar-app-bar" })), h("div", { key: 'f391fde20115bcab8952fc7b66fd74c64e27520f', class: "shell-layout__sidebar-content" }, h("slot", { key: '5f7b34ddda70f186199eeda95b119463e7b82cb0', name: "sidebar" })))))));
|
|
197
208
|
}
|
|
198
209
|
static get is() { return "swirl-shell-layout"; }
|
|
199
210
|
static get encapsulation() { return "scoped"; }
|
|
@@ -518,7 +529,8 @@ export class SwirlShellLayout {
|
|
|
518
529
|
"mobileNavigationActive": {},
|
|
519
530
|
"navigationCollapsed": {},
|
|
520
531
|
"secondaryNavCollapsed": {},
|
|
521
|
-
"secondaryNavView": {}
|
|
532
|
+
"secondaryNavView": {},
|
|
533
|
+
"isDesktopViewport": {}
|
|
522
534
|
};
|
|
523
535
|
}
|
|
524
536
|
static get events() {
|
|
@@ -625,6 +637,12 @@ export class SwirlShellLayout {
|
|
|
625
637
|
"target": "window",
|
|
626
638
|
"capture": false,
|
|
627
639
|
"passive": false
|
|
640
|
+
}, {
|
|
641
|
+
"name": "resize",
|
|
642
|
+
"method": "onWindowResize",
|
|
643
|
+
"target": "window",
|
|
644
|
+
"capture": false,
|
|
645
|
+
"passive": true
|
|
628
646
|
}];
|
|
629
647
|
}
|
|
630
648
|
}
|
|
@@ -16,7 +16,7 @@ describe("swirl-text", () => {
|
|
|
16
16
|
});
|
|
17
17
|
expect(page.root).toEqualHtml(`
|
|
18
18
|
<swirl-text align="center" color="critical" font-style="italic" size="lg" weight="medium">
|
|
19
|
-
<p class="text text--align-center text--color-critical text--font-family-text text--font-style-italic text--size-lg text--truncate-direction-end text--weight-medium" style="white-space: normal;">
|
|
19
|
+
<p class="text text--align-center text--color-critical text--font-family-text text--font-style-italic text--responsive text--size-lg text--truncate-direction-end text--weight-medium" style="white-space: normal;">
|
|
20
20
|
Est, odio dis scelerisque risus sagittis lorem rhoncus. Vivamus tristique habitant vitae cursus nisl. Sed adipiscing proin suspendisse aliquam maecenas faucibus mauris purus. Tortor ut habitant erat adipiscing nulla pretium, cursus tortor. Amet viverra et platea lacus, nec molestie tincidunt.
|
|
21
21
|
</p>
|
|
22
22
|
</swirl-text>
|
|
@@ -37,7 +37,7 @@ describe("swirl-text", () => {
|
|
|
37
37
|
});
|
|
38
38
|
expect(page.root).toEqualHtml(`
|
|
39
39
|
<swirl-text as="span">
|
|
40
|
-
<span class="text text--align-start text--color-default text--font-family-text text--font-style-normal text--size-base text--truncate-direction-end text--weight-normal" style="white-space: normal;">
|
|
40
|
+
<span class="text text--align-start text--color-default text--font-family-text text--font-style-normal text--responsive text--size-base text--truncate-direction-end text--weight-normal" style="white-space: normal;">
|
|
41
41
|
Est, odio dis scelerisque risus sagittis lorem rhoncus. Vivamus tristique habitant vitae cursus nisl. Sed adipiscing proin suspendisse aliquam maecenas faucibus mauris purus. Tortor ut habitant erat adipiscing nulla pretium, cursus tortor. Amet viverra et platea lacus, nec molestie tincidunt.
|
|
42
42
|
</span>
|
|
43
43
|
</swirl-text>
|
package/dist/collection/utils.js
CHANGED
|
@@ -136,6 +136,9 @@ export function getVisibleHeight(element, container) {
|
|
|
136
136
|
export function isMobileViewport() {
|
|
137
137
|
return !window.matchMedia("(min-width: 768px)").matches;
|
|
138
138
|
}
|
|
139
|
+
export function isDesktopViewport() {
|
|
140
|
+
return window.matchMedia("(min-width: 992px)").matches;
|
|
141
|
+
}
|
|
139
142
|
export function prefersReducedMotion() {
|
|
140
143
|
return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
141
144
|
}
|