@mintplayer/web-components 1.4.0 → 1.6.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/a11y/index.d.ts +1 -0
- package/calendar/index.d.ts +1 -0
- package/card/index.d.ts +1 -0
- package/checkbox/index.d.ts +1 -0
- package/checkbox/src/components/mp-checkbox.d.ts +1 -1
- package/chunks/{color-C4VT0EL7.mjs → color-CyamnJnn.mjs} +4 -4
- package/code-snippet/index.d.ts +1 -0
- package/datatable/index.d.ts +1 -0
- package/datepicker/index.d.ts +1 -0
- package/datetime-picker/index.d.ts +1 -0
- package/dock/index.d.ts +1 -0
- package/file-manager/index.d.ts +1 -0
- package/multi-range/index.d.ts +1 -0
- package/otp-input/index.d.ts +1 -0
- package/overlay/index.d.ts +1 -0
- package/package.json +123 -3
- package/pagination/index.d.ts +1 -0
- package/query-builder/index.d.ts +1 -0
- package/query-builder/index.mjs +4 -0
- package/radio/index.d.ts +1 -0
- package/radio/src/components/mp-radio.d.ts +1 -1
- package/ribbon/index.d.ts +1 -0
- package/ribbon/index.mjs +23 -23
- package/scheduler/index.d.ts +1 -0
- package/scheduler/index.mjs +1 -1
- package/scheduler-core/index.d.ts +1 -0
- package/scheduler-core/index.mjs +2 -2
- package/select/index.d.ts +1 -0
- package/select/src/components/mp-select.d.ts +1 -1
- package/shell/index.d.ts +1 -0
- package/shell/index.mjs +485 -0
- package/shell/src/components/index.d.ts +2 -0
- package/shell/src/components/mp-shell.d.ts +59 -0
- package/shell/src/index.d.ts +4 -0
- package/shell/src/styles/index.d.ts +1 -0
- package/shell/src/styles/shell.styles.d.ts +2 -0
- package/shell/src/types/index.d.ts +1 -0
- package/shell/src/types/shell-state.d.ts +8 -0
- package/splitter/index.d.ts +1 -0
- package/tab-control/index.d.ts +1 -0
- package/tile-manager/index.d.ts +1 -0
- package/timeline/index.d.ts +1 -0
- package/timeline-core/index.d.ts +1 -0
- package/timepicker/index.d.ts +1 -0
- package/toggle-button/index.d.ts +1 -0
- package/toggle-button/src/components/mp-toggle-button.d.ts +1 -1
- package/tree-select/index.d.ts +1 -0
- package/treeview/index.d.ts +1 -0
- package/accordion/src/styles/accordion.styles.d.ts +0 -2
package/a11y/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/card/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -30,7 +30,7 @@ export declare class MpCheckbox extends LitElement {
|
|
|
30
30
|
static shadowRootOptions: {
|
|
31
31
|
delegatesFocus: boolean;
|
|
32
32
|
clonable?: boolean;
|
|
33
|
-
customElementRegistry?: CustomElementRegistry;
|
|
33
|
+
customElementRegistry?: CustomElementRegistry | null;
|
|
34
34
|
mode: ShadowRootMode;
|
|
35
35
|
serializable?: boolean;
|
|
36
36
|
slotAssignment?: SlotAssignmentMode;
|
|
@@ -825,14 +825,14 @@ function B(c, t) {
|
|
|
825
825
|
return `rgba(${n}, ${s}, ${r}, ${t})`;
|
|
826
826
|
}
|
|
827
827
|
export {
|
|
828
|
-
|
|
828
|
+
I as D,
|
|
829
829
|
k as R,
|
|
830
830
|
v as T,
|
|
831
|
-
|
|
831
|
+
M as a,
|
|
832
832
|
T as b,
|
|
833
833
|
B as c,
|
|
834
|
-
|
|
835
|
-
|
|
834
|
+
y as d,
|
|
835
|
+
G as e,
|
|
836
836
|
F as f,
|
|
837
837
|
R as g,
|
|
838
838
|
D as h,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/dock/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mintplayer/web-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Framework-agnostic Lit web components for the @mintplayer/bootstrap design system. Consumed by @mintplayer/ng-bootstrap, @mintplayer/react-bootstrap, and @mintplayer/vue-bootstrap.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -24,7 +24,127 @@
|
|
|
24
24
|
"import": "./index.mjs"
|
|
25
25
|
},
|
|
26
26
|
"./custom-elements.json": "./custom-elements.json",
|
|
27
|
-
"./package.json": "./package.json"
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
"./a11y": {
|
|
29
|
+
"types": "./a11y/index.d.ts",
|
|
30
|
+
"import": "./a11y/index.mjs"
|
|
31
|
+
},
|
|
32
|
+
"./calendar": {
|
|
33
|
+
"types": "./calendar/index.d.ts",
|
|
34
|
+
"import": "./calendar/index.mjs"
|
|
35
|
+
},
|
|
36
|
+
"./card": {
|
|
37
|
+
"types": "./card/index.d.ts",
|
|
38
|
+
"import": "./card/index.mjs"
|
|
39
|
+
},
|
|
40
|
+
"./checkbox": {
|
|
41
|
+
"types": "./checkbox/index.d.ts",
|
|
42
|
+
"import": "./checkbox/index.mjs"
|
|
43
|
+
},
|
|
44
|
+
"./code-snippet": {
|
|
45
|
+
"types": "./code-snippet/index.d.ts",
|
|
46
|
+
"import": "./code-snippet/index.mjs"
|
|
47
|
+
},
|
|
48
|
+
"./datatable": {
|
|
49
|
+
"types": "./datatable/index.d.ts",
|
|
50
|
+
"import": "./datatable/index.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./datepicker": {
|
|
53
|
+
"types": "./datepicker/index.d.ts",
|
|
54
|
+
"import": "./datepicker/index.mjs"
|
|
55
|
+
},
|
|
56
|
+
"./datetime-picker": {
|
|
57
|
+
"types": "./datetime-picker/index.d.ts",
|
|
58
|
+
"import": "./datetime-picker/index.mjs"
|
|
59
|
+
},
|
|
60
|
+
"./dock": {
|
|
61
|
+
"types": "./dock/index.d.ts",
|
|
62
|
+
"import": "./dock/index.mjs"
|
|
63
|
+
},
|
|
64
|
+
"./file-manager": {
|
|
65
|
+
"types": "./file-manager/index.d.ts",
|
|
66
|
+
"import": "./file-manager/index.mjs"
|
|
67
|
+
},
|
|
68
|
+
"./multi-range": {
|
|
69
|
+
"types": "./multi-range/index.d.ts",
|
|
70
|
+
"import": "./multi-range/index.mjs"
|
|
71
|
+
},
|
|
72
|
+
"./otp-input": {
|
|
73
|
+
"types": "./otp-input/index.d.ts",
|
|
74
|
+
"import": "./otp-input/index.mjs"
|
|
75
|
+
},
|
|
76
|
+
"./overlay": {
|
|
77
|
+
"types": "./overlay/index.d.ts",
|
|
78
|
+
"import": "./overlay/index.mjs"
|
|
79
|
+
},
|
|
80
|
+
"./pagination": {
|
|
81
|
+
"types": "./pagination/index.d.ts",
|
|
82
|
+
"import": "./pagination/index.mjs"
|
|
83
|
+
},
|
|
84
|
+
"./query-builder": {
|
|
85
|
+
"types": "./query-builder/index.d.ts",
|
|
86
|
+
"import": "./query-builder/index.mjs"
|
|
87
|
+
},
|
|
88
|
+
"./radio": {
|
|
89
|
+
"types": "./radio/index.d.ts",
|
|
90
|
+
"import": "./radio/index.mjs"
|
|
91
|
+
},
|
|
92
|
+
"./ribbon": {
|
|
93
|
+
"types": "./ribbon/index.d.ts",
|
|
94
|
+
"import": "./ribbon/index.mjs"
|
|
95
|
+
},
|
|
96
|
+
"./scheduler": {
|
|
97
|
+
"types": "./scheduler/index.d.ts",
|
|
98
|
+
"import": "./scheduler/index.mjs"
|
|
99
|
+
},
|
|
100
|
+
"./scheduler-core": {
|
|
101
|
+
"types": "./scheduler-core/index.d.ts",
|
|
102
|
+
"import": "./scheduler-core/index.mjs"
|
|
103
|
+
},
|
|
104
|
+
"./select": {
|
|
105
|
+
"types": "./select/index.d.ts",
|
|
106
|
+
"import": "./select/index.mjs"
|
|
107
|
+
},
|
|
108
|
+
"./shell": {
|
|
109
|
+
"types": "./shell/index.d.ts",
|
|
110
|
+
"import": "./shell/index.mjs"
|
|
111
|
+
},
|
|
112
|
+
"./splitter": {
|
|
113
|
+
"types": "./splitter/index.d.ts",
|
|
114
|
+
"import": "./splitter/index.mjs"
|
|
115
|
+
},
|
|
116
|
+
"./tab-control": {
|
|
117
|
+
"types": "./tab-control/index.d.ts",
|
|
118
|
+
"import": "./tab-control/index.mjs"
|
|
119
|
+
},
|
|
120
|
+
"./tile-manager": {
|
|
121
|
+
"types": "./tile-manager/index.d.ts",
|
|
122
|
+
"import": "./tile-manager/index.mjs"
|
|
123
|
+
},
|
|
124
|
+
"./timeline": {
|
|
125
|
+
"types": "./timeline/index.d.ts",
|
|
126
|
+
"import": "./timeline/index.mjs"
|
|
127
|
+
},
|
|
128
|
+
"./timeline-core": {
|
|
129
|
+
"types": "./timeline-core/index.d.ts",
|
|
130
|
+
"import": "./timeline-core/index.mjs"
|
|
131
|
+
},
|
|
132
|
+
"./timepicker": {
|
|
133
|
+
"types": "./timepicker/index.d.ts",
|
|
134
|
+
"import": "./timepicker/index.mjs"
|
|
135
|
+
},
|
|
136
|
+
"./toggle-button": {
|
|
137
|
+
"types": "./toggle-button/index.d.ts",
|
|
138
|
+
"import": "./toggle-button/index.mjs"
|
|
139
|
+
},
|
|
140
|
+
"./tree-select": {
|
|
141
|
+
"types": "./tree-select/index.d.ts",
|
|
142
|
+
"import": "./tree-select/index.mjs"
|
|
143
|
+
},
|
|
144
|
+
"./treeview": {
|
|
145
|
+
"types": "./treeview/index.d.ts",
|
|
146
|
+
"import": "./treeview/index.mjs"
|
|
147
|
+
}
|
|
28
148
|
},
|
|
29
149
|
"peerDependencies": {
|
|
30
150
|
"lit": "^3.3.0",
|
|
@@ -39,4 +159,4 @@
|
|
|
39
159
|
"dependencies": {
|
|
40
160
|
"tslib": "^2.3.0"
|
|
41
161
|
}
|
|
42
|
-
}
|
|
162
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/query-builder/index.mjs
CHANGED
package/radio/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -29,7 +29,7 @@ export declare class MpRadio extends LitElement {
|
|
|
29
29
|
static shadowRootOptions: {
|
|
30
30
|
delegatesFocus: boolean;
|
|
31
31
|
clonable?: boolean;
|
|
32
|
-
customElementRegistry?: CustomElementRegistry;
|
|
32
|
+
customElementRegistry?: CustomElementRegistry | null;
|
|
33
33
|
mode: ShadowRootMode;
|
|
34
34
|
serializable?: boolean;
|
|
35
35
|
slotAssignment?: SlotAssignmentMode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/ribbon/index.mjs
CHANGED
|
@@ -739,7 +739,7 @@ class k extends w {
|
|
|
739
739
|
return o.length === 0 ? null : o.find((r) => r.getAttribute("tabindex") === "0") ?? o[0];
|
|
740
740
|
}
|
|
741
741
|
updated(e) {
|
|
742
|
-
if (e.has("activeTabId")) {
|
|
742
|
+
if (!this.activeTabId && this.tabsList.length > 0 && (this.activeTabId = this.tabsList[0].tabId), e.has("activeTabId")) {
|
|
743
743
|
this.applyActiveAttribute();
|
|
744
744
|
const o = this.tabsList.findIndex((r) => r.tabId === this.activeTabId);
|
|
745
745
|
o >= 0 && (this.currentTabIndex = o);
|
|
@@ -980,19 +980,19 @@ class k extends w {
|
|
|
980
980
|
const h = (p) => Number(p.getAttribute("priority") ?? "0"), u = (p) => p.getAttribute("auto-scale") !== "false", f = () => {
|
|
981
981
|
let p = null, A = 1 / 0, C = -1;
|
|
982
982
|
for (let y = 0; y < r.length; y++) {
|
|
983
|
-
const
|
|
984
|
-
if (
|
|
985
|
-
const z = h(
|
|
986
|
-
(z < A || z === A && y > C) && (p =
|
|
983
|
+
const $ = r[y];
|
|
984
|
+
if ($.getAttribute("data-resolved-size") === "popup" || !u($)) continue;
|
|
985
|
+
const z = h($);
|
|
986
|
+
(z < A || z === A && y > C) && (p = $, A = z, C = y);
|
|
987
987
|
}
|
|
988
988
|
return p;
|
|
989
989
|
}, m = () => {
|
|
990
990
|
let p = null, A = -1 / 0, C = 1 / 0;
|
|
991
991
|
for (let y = 0; y < r.length; y++) {
|
|
992
|
-
const
|
|
993
|
-
if (
|
|
994
|
-
const z = h(
|
|
995
|
-
(z > A || z === A && y < C) && (p =
|
|
992
|
+
const $ = r[y];
|
|
993
|
+
if ($.getAttribute("data-resolved-size") !== "popup") continue;
|
|
994
|
+
const z = h($);
|
|
995
|
+
(z > A || z === A && y < C) && (p = $, A = z, C = y);
|
|
996
996
|
}
|
|
997
997
|
return p;
|
|
998
998
|
};
|
|
@@ -1311,7 +1311,7 @@ var le = Object.defineProperty, E = (s, e, o, r) => {
|
|
|
1311
1311
|
return t && le(e, o, t), t;
|
|
1312
1312
|
};
|
|
1313
1313
|
const de = "mp-ribbon-button, mp-ribbon-toggle-button, mp-ribbon-checkbox, mp-ribbon-combobox, mp-ribbon-color-picker, mp-ribbon-group-button, mp-ribbon-split-button, mp-ribbon-dropdown-button, mp-ribbon-gallery";
|
|
1314
|
-
class
|
|
1314
|
+
class I extends w {
|
|
1315
1315
|
constructor() {
|
|
1316
1316
|
super(...arguments), this.tabId = "", this.label = "", this.active = !1, this.idealSizes = {}, this.reduceOrder = [], this.overflowEntries = [], this.overflowOverlay = new G(this, {
|
|
1317
1317
|
anchor: () => this.overflowTriggerEl ?? null,
|
|
@@ -1556,29 +1556,29 @@ class $ extends w {
|
|
|
1556
1556
|
}
|
|
1557
1557
|
E([
|
|
1558
1558
|
l({ type: String, attribute: "tab-id", reflect: !0 })
|
|
1559
|
-
],
|
|
1559
|
+
], I.prototype, "tabId");
|
|
1560
1560
|
E([
|
|
1561
1561
|
l({ type: String, reflect: !0 })
|
|
1562
|
-
],
|
|
1562
|
+
], I.prototype, "label");
|
|
1563
1563
|
E([
|
|
1564
1564
|
l({ type: Boolean, reflect: !0 })
|
|
1565
|
-
],
|
|
1565
|
+
], I.prototype, "active");
|
|
1566
1566
|
E([
|
|
1567
1567
|
l({ attribute: !1 })
|
|
1568
|
-
],
|
|
1568
|
+
], I.prototype, "idealSizes");
|
|
1569
1569
|
E([
|
|
1570
1570
|
l({ attribute: !1 })
|
|
1571
|
-
],
|
|
1571
|
+
], I.prototype, "reduceOrder");
|
|
1572
1572
|
E([
|
|
1573
1573
|
_()
|
|
1574
|
-
],
|
|
1574
|
+
], I.prototype, "overflowEntries");
|
|
1575
1575
|
E([
|
|
1576
1576
|
S(".overflow-trigger")
|
|
1577
|
-
],
|
|
1577
|
+
], I.prototype, "overflowTriggerEl");
|
|
1578
1578
|
E([
|
|
1579
1579
|
S(".overflow-panel")
|
|
1580
|
-
],
|
|
1581
|
-
customElements.define("mp-ribbon-tab",
|
|
1580
|
+
], I.prototype, "overflowPanelEl");
|
|
1581
|
+
customElements.define("mp-ribbon-tab", I);
|
|
1582
1582
|
var ce = Object.defineProperty, W = (s, e, o, r) => {
|
|
1583
1583
|
for (var t = void 0, i = s.length - 1, n; i >= 0; i--)
|
|
1584
1584
|
(n = s[i]) && (t = n(e, o, t) || t);
|
|
@@ -2849,10 +2849,10 @@ ie([
|
|
|
2849
2849
|
l({ type: Array })
|
|
2850
2850
|
], Y.prototype, "buttons");
|
|
2851
2851
|
customElements.define("mp-ribbon-group-button", Y);
|
|
2852
|
-
var
|
|
2852
|
+
var Ie = Object.defineProperty, $e = (s, e, o, r) => {
|
|
2853
2853
|
for (var t = void 0, i = s.length - 1, n; i >= 0; i--)
|
|
2854
2854
|
(n = s[i]) && (t = n(e, o, t) || t);
|
|
2855
|
-
return t &&
|
|
2855
|
+
return t && Ie(e, o, t), t;
|
|
2856
2856
|
};
|
|
2857
2857
|
class re extends v {
|
|
2858
2858
|
constructor() {
|
|
@@ -2884,7 +2884,7 @@ class re extends v {
|
|
|
2884
2884
|
`;
|
|
2885
2885
|
}
|
|
2886
2886
|
}
|
|
2887
|
-
|
|
2887
|
+
$e([
|
|
2888
2888
|
l({ type: Number })
|
|
2889
2889
|
], re.prototype, "columns");
|
|
2890
2890
|
customElements.define("mp-ribbon-gallery", re);
|
|
@@ -3145,7 +3145,7 @@ export {
|
|
|
3145
3145
|
R as MpRibbonMenuItem,
|
|
3146
3146
|
Oe as MpRibbonMenuSeparator,
|
|
3147
3147
|
q as MpRibbonSplitButton,
|
|
3148
|
-
|
|
3148
|
+
I as MpRibbonTab,
|
|
3149
3149
|
ne as MpRibbonTemplateItem,
|
|
3150
3150
|
J as MpRibbonToggleButton
|
|
3151
3151
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/scheduler/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unsafeCSS as W, LitElement as B, html as U } from "lit";
|
|
2
2
|
import { L as O } from "../chunks/live-announcer-CZDTKulf.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { D as N, d as h, t as M, k as I, r as S, m as $, l as F, g as V } from "../chunks/color-CyamnJnn.mjs";
|
|
4
4
|
function q(g = {}) {
|
|
5
5
|
const e = { ...N, ...g };
|
|
6
6
|
return {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/scheduler-core/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { D as T, d as C } from "../chunks/color-CyamnJnn.mjs";
|
|
2
|
+
import { a as N, b as X, R as Y, T as G, c as U, e as _, g as q, f as J, h as K, i as Q, j as Z, k as tt, l as et, m as ot, n as nt, r as st, t as ct } from "../chunks/color-CyamnJnn.mjs";
|
|
3
3
|
class x {
|
|
4
4
|
/**
|
|
5
5
|
* Calculate position for an event part in week/day view
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -39,7 +39,7 @@ export declare class MpSelect extends LitElement {
|
|
|
39
39
|
static shadowRootOptions: {
|
|
40
40
|
delegatesFocus: boolean;
|
|
41
41
|
clonable?: boolean;
|
|
42
|
-
customElementRegistry?: CustomElementRegistry;
|
|
42
|
+
customElementRegistry?: CustomElementRegistry | null;
|
|
43
43
|
mode: ShadowRootMode;
|
|
44
44
|
serializable?: boolean;
|
|
45
45
|
slotAssignment?: SlotAssignmentMode;
|
package/shell/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/shell/index.mjs
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import { unsafeCSS as l, LitElement as a, html as r } from "lit";
|
|
2
|
+
const h = l(`:host {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
position: relative;
|
|
6
|
+
--mp-shell-size: 15rem;
|
|
7
|
+
--mp-shell-open: 0;
|
|
8
|
+
--mp-shell-wide: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.topbar {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
flex: 0 0 auto;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.sidebar-root {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: stretch;
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
flex: 1 1 auto;
|
|
22
|
+
min-block-size: 0;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sidebar {
|
|
27
|
+
flex: 0 0 auto;
|
|
28
|
+
overflow-x: hidden;
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
min-block-size: 0;
|
|
31
|
+
transition: transform 0.3s ease-in-out, inline-size 0.3s ease-in-out;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.content {
|
|
35
|
+
flex: 1 1 auto;
|
|
36
|
+
min-inline-size: 0;
|
|
37
|
+
min-block-size: 0;
|
|
38
|
+
overflow-y: auto;
|
|
39
|
+
transition: margin-inline-start 0.3s ease-in-out;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.shell-toggle {
|
|
43
|
+
position: absolute;
|
|
44
|
+
inline-size: 1px;
|
|
45
|
+
block-size: 1px;
|
|
46
|
+
margin: -1px;
|
|
47
|
+
padding: 0;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
clip: rect(0 0 0 0);
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
border: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.shell-hamburger {
|
|
55
|
+
display: inline-flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
flex: 0 0 auto;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
padding: 0.5rem 0.75rem;
|
|
61
|
+
font-size: 1.25rem;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
user-select: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host([external-toggle]) .shell-hamburger {
|
|
67
|
+
display: none;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([breakpoint=xs]) .sidebar {
|
|
71
|
+
position: absolute;
|
|
72
|
+
inset-block: 0;
|
|
73
|
+
inset-inline-start: 0;
|
|
74
|
+
inline-size: 100%;
|
|
75
|
+
z-index: 1030;
|
|
76
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
77
|
+
}
|
|
78
|
+
:host([breakpoint=xs]) .content {
|
|
79
|
+
margin-inline-start: 0;
|
|
80
|
+
}
|
|
81
|
+
:host([breakpoint=xs]) .sidebar-root {
|
|
82
|
+
--mp-shell-wide: 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@media (min-width: 576px) {
|
|
86
|
+
:host([breakpoint=sm]) .sidebar {
|
|
87
|
+
position: absolute;
|
|
88
|
+
inset-block: 0;
|
|
89
|
+
inset-inline-start: 0;
|
|
90
|
+
inline-size: var(--mp-shell-size);
|
|
91
|
+
z-index: 1030;
|
|
92
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
93
|
+
}
|
|
94
|
+
:host([breakpoint=sm]) .content {
|
|
95
|
+
margin-inline-start: calc(var(--mp-shell-open) * var(--mp-shell-size));
|
|
96
|
+
}
|
|
97
|
+
:host([breakpoint=sm]) .sidebar-root {
|
|
98
|
+
--mp-shell-wide: 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
@media (max-width: 575.98px) {
|
|
102
|
+
:host([breakpoint=sm]) .sidebar {
|
|
103
|
+
position: absolute;
|
|
104
|
+
inset-block: 0;
|
|
105
|
+
inset-inline-start: 0;
|
|
106
|
+
inline-size: 100%;
|
|
107
|
+
z-index: 1030;
|
|
108
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
109
|
+
}
|
|
110
|
+
:host([breakpoint=sm]) .content {
|
|
111
|
+
margin-inline-start: 0;
|
|
112
|
+
}
|
|
113
|
+
:host([breakpoint=sm]) .sidebar-root {
|
|
114
|
+
--mp-shell-wide: 0;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media (min-width: 768px) {
|
|
119
|
+
:host([breakpoint=md]) .sidebar {
|
|
120
|
+
position: absolute;
|
|
121
|
+
inset-block: 0;
|
|
122
|
+
inset-inline-start: 0;
|
|
123
|
+
inline-size: var(--mp-shell-size);
|
|
124
|
+
z-index: 1030;
|
|
125
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
126
|
+
}
|
|
127
|
+
:host([breakpoint=md]) .content {
|
|
128
|
+
margin-inline-start: calc(var(--mp-shell-open) * var(--mp-shell-size));
|
|
129
|
+
}
|
|
130
|
+
:host([breakpoint=md]) .sidebar-root {
|
|
131
|
+
--mp-shell-wide: 1;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
@media (max-width: 767.98px) {
|
|
135
|
+
:host([breakpoint=md]) .sidebar {
|
|
136
|
+
position: absolute;
|
|
137
|
+
inset-block: 0;
|
|
138
|
+
inset-inline-start: 0;
|
|
139
|
+
inline-size: 100%;
|
|
140
|
+
z-index: 1030;
|
|
141
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
142
|
+
}
|
|
143
|
+
:host([breakpoint=md]) .content {
|
|
144
|
+
margin-inline-start: 0;
|
|
145
|
+
}
|
|
146
|
+
:host([breakpoint=md]) .sidebar-root {
|
|
147
|
+
--mp-shell-wide: 0;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@media (min-width: 992px) {
|
|
152
|
+
:host([breakpoint=lg]) .sidebar {
|
|
153
|
+
position: absolute;
|
|
154
|
+
inset-block: 0;
|
|
155
|
+
inset-inline-start: 0;
|
|
156
|
+
inline-size: var(--mp-shell-size);
|
|
157
|
+
z-index: 1030;
|
|
158
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
159
|
+
}
|
|
160
|
+
:host([breakpoint=lg]) .content {
|
|
161
|
+
margin-inline-start: calc(var(--mp-shell-open) * var(--mp-shell-size));
|
|
162
|
+
}
|
|
163
|
+
:host([breakpoint=lg]) .sidebar-root {
|
|
164
|
+
--mp-shell-wide: 1;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
@media (max-width: 991.98px) {
|
|
168
|
+
:host([breakpoint=lg]) .sidebar {
|
|
169
|
+
position: absolute;
|
|
170
|
+
inset-block: 0;
|
|
171
|
+
inset-inline-start: 0;
|
|
172
|
+
inline-size: 100%;
|
|
173
|
+
z-index: 1030;
|
|
174
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
175
|
+
}
|
|
176
|
+
:host([breakpoint=lg]) .content {
|
|
177
|
+
margin-inline-start: 0;
|
|
178
|
+
}
|
|
179
|
+
:host([breakpoint=lg]) .sidebar-root {
|
|
180
|
+
--mp-shell-wide: 0;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@media (min-width: 1200px) {
|
|
185
|
+
:host([breakpoint=xl]) .sidebar {
|
|
186
|
+
position: absolute;
|
|
187
|
+
inset-block: 0;
|
|
188
|
+
inset-inline-start: 0;
|
|
189
|
+
inline-size: var(--mp-shell-size);
|
|
190
|
+
z-index: 1030;
|
|
191
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
192
|
+
}
|
|
193
|
+
:host([breakpoint=xl]) .content {
|
|
194
|
+
margin-inline-start: calc(var(--mp-shell-open) * var(--mp-shell-size));
|
|
195
|
+
}
|
|
196
|
+
:host([breakpoint=xl]) .sidebar-root {
|
|
197
|
+
--mp-shell-wide: 1;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
@media (max-width: 1199.98px) {
|
|
201
|
+
:host([breakpoint=xl]) .sidebar {
|
|
202
|
+
position: absolute;
|
|
203
|
+
inset-block: 0;
|
|
204
|
+
inset-inline-start: 0;
|
|
205
|
+
inline-size: 100%;
|
|
206
|
+
z-index: 1030;
|
|
207
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
208
|
+
}
|
|
209
|
+
:host([breakpoint=xl]) .content {
|
|
210
|
+
margin-inline-start: 0;
|
|
211
|
+
}
|
|
212
|
+
:host([breakpoint=xl]) .sidebar-root {
|
|
213
|
+
--mp-shell-wide: 0;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
@media (min-width: 1400px) {
|
|
218
|
+
:host([breakpoint=xxl]) .sidebar {
|
|
219
|
+
position: absolute;
|
|
220
|
+
inset-block: 0;
|
|
221
|
+
inset-inline-start: 0;
|
|
222
|
+
inline-size: var(--mp-shell-size);
|
|
223
|
+
z-index: 1030;
|
|
224
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
225
|
+
}
|
|
226
|
+
:host([breakpoint=xxl]) .content {
|
|
227
|
+
margin-inline-start: calc(var(--mp-shell-open) * var(--mp-shell-size));
|
|
228
|
+
}
|
|
229
|
+
:host([breakpoint=xxl]) .sidebar-root {
|
|
230
|
+
--mp-shell-wide: 1;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
@media (max-width: 1399.98px) {
|
|
234
|
+
:host([breakpoint=xxl]) .sidebar {
|
|
235
|
+
position: absolute;
|
|
236
|
+
inset-block: 0;
|
|
237
|
+
inset-inline-start: 0;
|
|
238
|
+
inline-size: 100%;
|
|
239
|
+
z-index: 1030;
|
|
240
|
+
transform: translateX(calc((var(--mp-shell-open) - 1) * 100%));
|
|
241
|
+
}
|
|
242
|
+
:host([breakpoint=xxl]) .content {
|
|
243
|
+
margin-inline-start: 0;
|
|
244
|
+
}
|
|
245
|
+
:host([breakpoint=xxl]) .sidebar-root {
|
|
246
|
+
--mp-shell-wide: 0;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
:host([state=show]) {
|
|
251
|
+
--mp-shell-open: 1;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
:host([state=hide]) {
|
|
255
|
+
--mp-shell-open: 0;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:host([breakpoint=xs]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
259
|
+
--mp-shell-open: 0;
|
|
260
|
+
}
|
|
261
|
+
:host([breakpoint=xs]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
262
|
+
--mp-shell-open: 1;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
@media (min-width: 576px) {
|
|
266
|
+
:host([breakpoint=sm]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
267
|
+
--mp-shell-open: 1;
|
|
268
|
+
}
|
|
269
|
+
:host([breakpoint=sm]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
270
|
+
--mp-shell-open: 0;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
@media (max-width: 575.98px) {
|
|
274
|
+
:host([breakpoint=sm]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
275
|
+
--mp-shell-open: 0;
|
|
276
|
+
}
|
|
277
|
+
:host([breakpoint=sm]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
278
|
+
--mp-shell-open: 1;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
@media (min-width: 768px) {
|
|
283
|
+
:host([breakpoint=md]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
284
|
+
--mp-shell-open: 1;
|
|
285
|
+
}
|
|
286
|
+
:host([breakpoint=md]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
287
|
+
--mp-shell-open: 0;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
@media (max-width: 767.98px) {
|
|
291
|
+
:host([breakpoint=md]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
292
|
+
--mp-shell-open: 0;
|
|
293
|
+
}
|
|
294
|
+
:host([breakpoint=md]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
295
|
+
--mp-shell-open: 1;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@media (min-width: 992px) {
|
|
300
|
+
:host([breakpoint=lg]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
301
|
+
--mp-shell-open: 1;
|
|
302
|
+
}
|
|
303
|
+
:host([breakpoint=lg]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
304
|
+
--mp-shell-open: 0;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
@media (max-width: 991.98px) {
|
|
308
|
+
:host([breakpoint=lg]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
309
|
+
--mp-shell-open: 0;
|
|
310
|
+
}
|
|
311
|
+
:host([breakpoint=lg]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
312
|
+
--mp-shell-open: 1;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@media (min-width: 1200px) {
|
|
317
|
+
:host([breakpoint=xl]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
318
|
+
--mp-shell-open: 1;
|
|
319
|
+
}
|
|
320
|
+
:host([breakpoint=xl]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
321
|
+
--mp-shell-open: 0;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
@media (max-width: 1199.98px) {
|
|
325
|
+
:host([breakpoint=xl]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
326
|
+
--mp-shell-open: 0;
|
|
327
|
+
}
|
|
328
|
+
:host([breakpoint=xl]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
329
|
+
--mp-shell-open: 1;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
@media (min-width: 1400px) {
|
|
334
|
+
:host([breakpoint=xxl]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
335
|
+
--mp-shell-open: 1;
|
|
336
|
+
}
|
|
337
|
+
:host([breakpoint=xxl]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
338
|
+
--mp-shell-open: 0;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
@media (max-width: 1399.98px) {
|
|
342
|
+
:host([breakpoint=xxl]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:not(:checked) ~ .sidebar-root {
|
|
343
|
+
--mp-shell-open: 0;
|
|
344
|
+
}
|
|
345
|
+
:host([breakpoint=xxl]:not([state=show]):not([state=hide]):not([external-toggle])) .shell-toggle:checked ~ .sidebar-root {
|
|
346
|
+
--mp-shell-open: 1;
|
|
347
|
+
}
|
|
348
|
+
}`);
|
|
349
|
+
class p extends a {
|
|
350
|
+
static {
|
|
351
|
+
this.styles = [h];
|
|
352
|
+
}
|
|
353
|
+
static get observedAttributes() {
|
|
354
|
+
return [
|
|
355
|
+
...super.observedAttributes ?? [],
|
|
356
|
+
"state",
|
|
357
|
+
"breakpoint",
|
|
358
|
+
"size",
|
|
359
|
+
"external-toggle"
|
|
360
|
+
];
|
|
361
|
+
}
|
|
362
|
+
createRenderRoot() {
|
|
363
|
+
return this.constructor.observedAttributes.includes("defer-hydration") || this.shadowRoot?.replaceChildren(), super.createRenderRoot();
|
|
364
|
+
}
|
|
365
|
+
connectedCallback() {
|
|
366
|
+
super.connectedCallback(), this.addEventListener("click", this.#e);
|
|
367
|
+
}
|
|
368
|
+
disconnectedCallback() {
|
|
369
|
+
super.disconnectedCallback(), this.removeEventListener("click", this.#e);
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Auto-close the drawer when a navigation link inside the `sidebar` slot is
|
|
373
|
+
* clicked — only when `dismiss-on-navigate` is set AND the shell is in
|
|
374
|
+
* narrow/overlay mode. Reads the attribute on demand (no reactive property).
|
|
375
|
+
* The anchor must sit *before* the sidebar slot in the composed path, i.e.
|
|
376
|
+
* inside the slotted sidebar content — so topbar/content clicks are ignored.
|
|
377
|
+
* Opt-out: a clicked link (or any wrapper around it) carrying `data-no-dismiss`
|
|
378
|
+
* is ignored — for parent items that only expand a sub-list / highlight the
|
|
379
|
+
* active path and cancel their own navigation. Opt-out (rather than opt-in)
|
|
380
|
+
* keeps the common case — every leaf link dismisses — annotation-free.
|
|
381
|
+
*/
|
|
382
|
+
#e = (e) => {
|
|
383
|
+
if (!this.hasAttribute("dismiss-on-navigate") || this.#o()) return;
|
|
384
|
+
const t = e.composedPath(), o = this.renderRoot?.querySelector('slot[name="sidebar"]'), i = o ? t.indexOf(o) : -1;
|
|
385
|
+
if (i < 0) return;
|
|
386
|
+
const n = t.slice(0, i);
|
|
387
|
+
if (n.some((s) => s instanceof HTMLElement && s.hasAttribute("data-no-dismiss"))) return;
|
|
388
|
+
n.some(
|
|
389
|
+
(s) => s instanceof HTMLElement && s.tagName === "A" && s.hasAttribute("href")
|
|
390
|
+
) && this.open && this.toggle(!1);
|
|
391
|
+
};
|
|
392
|
+
attributeChangedCallback(e, t, o) {
|
|
393
|
+
super.attributeChangedCallback(e, t, o), e === "size" && (o ? this.style.setProperty("--mp-shell-size", o) : this.style.removeProperty("--mp-shell-size"));
|
|
394
|
+
}
|
|
395
|
+
get toggleInput() {
|
|
396
|
+
return this.renderRoot?.querySelector(".shell-toggle") ?? null;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* The *resolved, visual* open state — read straight from the value the CSS
|
|
400
|
+
* computed (`--mp-shell-open`), so it accounts for `state`, `breakpoint`, the
|
|
401
|
+
* viewport and the toggle checkbox all at once. The CSS is the single source
|
|
402
|
+
* of truth; we don't re-derive the matrix in JS.
|
|
403
|
+
*/
|
|
404
|
+
#t() {
|
|
405
|
+
if (typeof window > "u") return !1;
|
|
406
|
+
const e = this.renderRoot?.querySelector(".sidebar-root");
|
|
407
|
+
return e ? getComputedStyle(e).getPropertyValue("--mp-shell-open").trim() === "1" : !1;
|
|
408
|
+
}
|
|
409
|
+
/** An explicit `state` (`show`/`hide`) freezes the CSS checkbox. */
|
|
410
|
+
#n() {
|
|
411
|
+
const e = this.getAttribute("state");
|
|
412
|
+
return e === "show" || e === "hide";
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Wide (sidebar pushes content) vs narrow (sidebar overlays) — read from the
|
|
416
|
+
* `--mp-shell-wide` lever the media queries resolved (1 = wide, 0 = narrow),
|
|
417
|
+
* avoiding any breakpoint duplication in JS. (The sidebar is now
|
|
418
|
+
* `position: absolute` in BOTH modes, so position no longer discriminates.)
|
|
419
|
+
*/
|
|
420
|
+
#o() {
|
|
421
|
+
if (typeof window > "u") return !0;
|
|
422
|
+
const e = this.renderRoot?.querySelector(".sidebar-root");
|
|
423
|
+
return e ? getComputedStyle(e).getPropertyValue("--mp-shell-wide").trim() === "1" : !0;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Keep the checkbox encoding the resolved open for the current viewport, so
|
|
427
|
+
* that returning to `auto` (where the checkbox drives the CSS again) resolves
|
|
428
|
+
* to the same visual state instead of jumping. In `auto` the checkbox means
|
|
429
|
+
* "inverted from the responsive default": wide default = open (checked ⇒
|
|
430
|
+
* closed); narrow default = closed (checked ⇒ open).
|
|
431
|
+
*/
|
|
432
|
+
#s(e) {
|
|
433
|
+
const t = this.toggleInput;
|
|
434
|
+
t && (t.checked = this.#o() ? !e : e);
|
|
435
|
+
}
|
|
436
|
+
/** Whether the sidebar is currently (visually) open. */
|
|
437
|
+
get open() {
|
|
438
|
+
return this.#t();
|
|
439
|
+
}
|
|
440
|
+
/** Programmatically open/close the sidebar. Pass a boolean to force a state. */
|
|
441
|
+
toggle(e) {
|
|
442
|
+
const t = e ?? !this.open;
|
|
443
|
+
this.#s(t), this.#i(t);
|
|
444
|
+
}
|
|
445
|
+
#l = () => {
|
|
446
|
+
const e = this.#t(), t = this.#n() ? !e : e;
|
|
447
|
+
this.#s(t), this.#i(t);
|
|
448
|
+
};
|
|
449
|
+
#i(e) {
|
|
450
|
+
this.dispatchEvent(
|
|
451
|
+
new CustomEvent("statechange", {
|
|
452
|
+
detail: { open: e },
|
|
453
|
+
bubbles: !0,
|
|
454
|
+
composed: !0
|
|
455
|
+
})
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
render() {
|
|
459
|
+
return r`
|
|
460
|
+
<input
|
|
461
|
+
type="checkbox"
|
|
462
|
+
id="mp-shell-toggle"
|
|
463
|
+
class="shell-toggle"
|
|
464
|
+
aria-label="Toggle sidebar"
|
|
465
|
+
@change=${this.#l}
|
|
466
|
+
/>
|
|
467
|
+
<div class="topbar" part="topbar">
|
|
468
|
+
<label for="mp-shell-toggle" class="shell-hamburger" part="hamburger" title="Toggle sidebar">
|
|
469
|
+
<slot name="hamburger">☰</slot>
|
|
470
|
+
</label>
|
|
471
|
+
<slot name="topbar"></slot>
|
|
472
|
+
</div>
|
|
473
|
+
<div class="sidebar-root" part="sidebar-root">
|
|
474
|
+
<aside class="sidebar" part="sidebar" aria-label="Sidebar"><slot name="sidebar"></slot></aside>
|
|
475
|
+
<div class="content" part="content"><slot></slot></div>
|
|
476
|
+
</div>
|
|
477
|
+
<slot name="toggle"></slot>
|
|
478
|
+
`;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
customElements.get("mp-shell") || customElements.define("mp-shell", p);
|
|
482
|
+
export {
|
|
483
|
+
p as MpShell,
|
|
484
|
+
h as shellStyles
|
|
485
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface ShellStateChangeEventDetail {
|
|
3
|
+
/** Whether the sidebar is now (visually) open after the toggle. */
|
|
4
|
+
open: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* `<mp-shell>` — responsive sidebar layout shell.
|
|
8
|
+
*
|
|
9
|
+
* The shadow DOM is *static chrome* (a hidden checkbox toggle, the hamburger
|
|
10
|
+
* label, the sidebar-root with named slots); the consumer's sidebar and main
|
|
11
|
+
* content are slotted light DOM. All visibility is pure CSS (see
|
|
12
|
+
* `shell.styles.scss`), so it works with JavaScript disabled when the shadow
|
|
13
|
+
* root is present (e.g. server-rendered as Declarative Shadow DOM).
|
|
14
|
+
*
|
|
15
|
+
* Authoring (vanilla):
|
|
16
|
+
*
|
|
17
|
+
* <mp-shell breakpoint="md">
|
|
18
|
+
* <div slot="topbar">…brand / nav…</div>
|
|
19
|
+
* <nav slot="sidebar">…</nav>
|
|
20
|
+
* <main>…</main>
|
|
21
|
+
* </mp-shell>
|
|
22
|
+
*
|
|
23
|
+
* Layout: a full-width top bar (the built-in hamburger toggle on its left, plus
|
|
24
|
+
* the `topbar` slot) sits above a row of `sidebar` + default (content) slots.
|
|
25
|
+
* The sidebar slides in/out below the top bar, which stays put.
|
|
26
|
+
*
|
|
27
|
+
* Attributes:
|
|
28
|
+
* - `state` — `auto` (default) | `show` | `hide`.
|
|
29
|
+
* - `breakpoint` — Bootstrap breakpoint name (`xs`…`xxl`, default `md`); below
|
|
30
|
+
* it the sidebar starts collapsed, at/above it expanded.
|
|
31
|
+
* - `size` — expanded sidebar width (any CSS length); also settable via the
|
|
32
|
+
* `--mp-shell-size` custom property.
|
|
33
|
+
* - `external-toggle` — hides the built-in hamburger; the consumer supplies a
|
|
34
|
+
* `<label for>` + a `slot="toggle"` checkbox and a global bridge rule.
|
|
35
|
+
* - `dismiss-on-navigate` — opt-in: when a navigation link (`<a href>`) inside
|
|
36
|
+
* the `sidebar` slot is clicked while in narrow/overlay mode, auto-close the
|
|
37
|
+
* drawer (the mobile-drawer convention). No effect in wide mode; a pure
|
|
38
|
+
* progressive enhancement (with JS off the link just navigates). Mark a link
|
|
39
|
+
* (or any wrapper around it) with `data-no-dismiss` to exclude it — e.g. a
|
|
40
|
+
* parent nav item that only expands a sub-list or highlights the active path
|
|
41
|
+
* and cancels its own navigation.
|
|
42
|
+
*
|
|
43
|
+
* Events: `statechange` (`detail: { open }`) when the toggle flips.
|
|
44
|
+
*/
|
|
45
|
+
export declare class MpShell extends LitElement {
|
|
46
|
+
#private;
|
|
47
|
+
static styles: import('lit').CSSResult[];
|
|
48
|
+
static get observedAttributes(): string[];
|
|
49
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
50
|
+
connectedCallback(): void;
|
|
51
|
+
disconnectedCallback(): void;
|
|
52
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
53
|
+
private get toggleInput();
|
|
54
|
+
/** Whether the sidebar is currently (visually) open. */
|
|
55
|
+
get open(): boolean;
|
|
56
|
+
/** Programmatically open/close the sidebar. Pass a boolean to force a state. */
|
|
57
|
+
toggle(force?: boolean): void;
|
|
58
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { shellStyles } from './shell.styles';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ShellState } from './shell-state';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Declarative sidebar state set by the consumer.
|
|
3
|
+
* - `auto` — responsive: collapsed below `breakpoint`, expanded at/above it;
|
|
4
|
+
* the toggle then flips it (inverse of the responsive default).
|
|
5
|
+
* - `show` — force expanded regardless of viewport / toggle.
|
|
6
|
+
* - `hide` — force collapsed regardless of viewport / toggle.
|
|
7
|
+
*/
|
|
8
|
+
export type ShellState = 'auto' | 'show' | 'hide';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -21,7 +21,7 @@ export declare class MpToggleButton extends LitElement {
|
|
|
21
21
|
static shadowRootOptions: {
|
|
22
22
|
delegatesFocus: boolean;
|
|
23
23
|
clonable?: boolean;
|
|
24
|
-
customElementRegistry?: CustomElementRegistry;
|
|
24
|
+
customElementRegistry?: CustomElementRegistry | null;
|
|
25
25
|
mode: ShadowRootMode;
|
|
26
26
|
serializable?: boolean;
|
|
27
27
|
slotAssignment?: SlotAssignmentMode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|