nve-designsystem 1.0.0 → 1.3.1
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/chunks/chunk.2IP2T4OH.js +1 -1
- package/chunks/chunk.3SGXMLGV.js +8 -8
- package/chunks/chunk.5YPURQKE.js +6 -6
- package/chunks/chunk.5ZRUVMLP.js +1 -1
- package/chunks/chunk.7B2AJG4K.js +1 -1
- package/chunks/chunk.7ZRV3LMN.js +1 -1
- package/chunks/chunk.AR3BL5H3.js +1 -1
- package/chunks/chunk.BV4DJ45A.js +1 -1
- package/chunks/chunk.BWLYJ7KT.js +426 -0
- package/chunks/chunk.CKEABH2A.js +2 -2
- package/chunks/chunk.EMG3ZSPT.js +2 -2
- package/chunks/chunk.FDPXBVDV.js +1 -1
- package/chunks/chunk.FRD7DRZ6.js +77 -0
- package/chunks/chunk.GKEBKPRZ.js +1 -1
- package/chunks/chunk.KJWYNLDZ.js +1 -1
- package/chunks/chunk.LXDTFLWU.js +2 -2
- package/chunks/chunk.MMEGYRNV.js +1 -1
- package/chunks/chunk.MN4ICWTQ.js +1 -1
- package/chunks/chunk.OV3FWA7A.js +1 -1
- package/chunks/chunk.PCIMCNOI.js +1 -1
- package/chunks/chunk.RJUO2BMU.js +1713 -2123
- package/chunks/chunk.SDBB5L2R.js +1 -1
- package/chunks/chunk.V5BHNRQG.js +1 -1
- package/chunks/chunk.WKBPPP3T.js +53 -125
- package/components/nve-accordion-item/nve-accordion-item.component.js +1 -0
- package/components/nve-drawer/nve-drawer.component.d.ts +15 -0
- package/components/nve-drawer/nve-drawer.component.js +27 -0
- package/components/nve-drawer/nve-drawer.styles.d.ts +2 -0
- package/components/nve-drawer/nve-drawer.styles.js +42 -0
- package/components/nve-relative-time/nve-relative-time.component.js +1 -0
- package/custom-elements.json +933 -480
- package/nve-designsystem.d.ts +1 -0
- package/nve-designsystem.js +48 -46
- package/package.json +1 -1
package/chunks/chunk.2IP2T4OH.js
CHANGED
package/chunks/chunk.3SGXMLGV.js
CHANGED
|
@@ -2,12 +2,12 @@ import { b as l } from "./chunk.MAQXLKQ7.js";
|
|
|
2
2
|
import { i as a } from "./lit-element.js";
|
|
3
3
|
import { H as r } from "./chunk.NYIIDP5N.js";
|
|
4
4
|
import { w as u } from "./chunk.GMYPQTFK.js";
|
|
5
|
-
import { c as n,
|
|
6
|
-
import { e as
|
|
5
|
+
import { c as n, d as e, S as d } from "./chunk.EMG3ZSPT.js";
|
|
6
|
+
import { e as h } from "./class-map.js";
|
|
7
7
|
import { u as p } from "./static.js";
|
|
8
|
-
import { o as
|
|
8
|
+
import { o as c } from "./if-defined.js";
|
|
9
9
|
import { n as s } from "./property.js";
|
|
10
|
-
import { r as
|
|
10
|
+
import { r as b } from "./state.js";
|
|
11
11
|
import { e as i } from "./query.js";
|
|
12
12
|
var f = a`
|
|
13
13
|
${l}
|
|
@@ -33,7 +33,7 @@ var f = a`
|
|
|
33
33
|
opacity: 0;
|
|
34
34
|
z-index: -1;
|
|
35
35
|
}
|
|
36
|
-
`, t = class extends
|
|
36
|
+
`, t = class extends d {
|
|
37
37
|
constructor() {
|
|
38
38
|
super(...arguments), this.hasSlotController = new r(this, "[default]", "prefix", "suffix"), this.hasFocus = !1, this.checked = !1, this.disabled = !1, this.size = "medium", this.pill = !1;
|
|
39
39
|
}
|
|
@@ -71,7 +71,7 @@ var f = a`
|
|
|
71
71
|
part="${`button${this.checked ? " button--checked" : ""}`}"
|
|
72
72
|
role="radio"
|
|
73
73
|
aria-checked="${this.checked}"
|
|
74
|
-
class=${
|
|
74
|
+
class=${h({
|
|
75
75
|
button: !0,
|
|
76
76
|
"button--default": !0,
|
|
77
77
|
"button--small": this.size === "small",
|
|
@@ -88,7 +88,7 @@ var f = a`
|
|
|
88
88
|
})}
|
|
89
89
|
aria-disabled=${this.disabled}
|
|
90
90
|
type="button"
|
|
91
|
-
value=${
|
|
91
|
+
value=${c(this.value)}
|
|
92
92
|
@blur=${this.handleBlur}
|
|
93
93
|
@focus=${this.handleFocus}
|
|
94
94
|
@click=${this.handleClick}
|
|
@@ -109,7 +109,7 @@ e([
|
|
|
109
109
|
i(".hidden-input")
|
|
110
110
|
], t.prototype, "hiddenInput", 2);
|
|
111
111
|
e([
|
|
112
|
-
|
|
112
|
+
b()
|
|
113
113
|
], t.prototype, "hasFocus", 2);
|
|
114
114
|
e([
|
|
115
115
|
s({ type: Boolean, reflect: !0 })
|
package/chunks/chunk.5YPURQKE.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { i as b, x as g } from "./lit-element.js";
|
|
2
2
|
import { w as y, u as w, g as p } from "./chunk.ZL53POKZ.js";
|
|
3
|
-
import { w as
|
|
4
|
-
import { c as S,
|
|
3
|
+
import { w as f } from "./chunk.GMYPQTFK.js";
|
|
4
|
+
import { c as S, d as o, S as C } from "./chunk.EMG3ZSPT.js";
|
|
5
5
|
import { e as L } from "./directive-helpers.js";
|
|
6
6
|
import { n as h } from "./property.js";
|
|
7
7
|
import { r as R } from "./state.js";
|
|
8
|
-
var I =
|
|
8
|
+
var I = b`
|
|
9
9
|
:host {
|
|
10
10
|
display: inline-block;
|
|
11
11
|
width: 1em;
|
|
@@ -120,10 +120,10 @@ o([
|
|
|
120
120
|
h({ reflect: !0 })
|
|
121
121
|
], a.prototype, "library", 2);
|
|
122
122
|
o([
|
|
123
|
-
|
|
123
|
+
f("label")
|
|
124
124
|
], a.prototype, "handleLabelChange", 1);
|
|
125
125
|
o([
|
|
126
|
-
|
|
126
|
+
f(["name", "src", "library"])
|
|
127
127
|
], a.prototype, "setIcon", 1);
|
|
128
128
|
export {
|
|
129
129
|
a as S
|
package/chunks/chunk.5ZRUVMLP.js
CHANGED
|
@@ -3,7 +3,7 @@ import { S as g } from "./chunk.AR3BL5H3.js";
|
|
|
3
3
|
import { s as m, p as l, a as h, g as d, b as c, w as u } from "./chunk.AJ3ENQ5C.js";
|
|
4
4
|
import { L as v } from "./chunk.6CTB5ZDJ.js";
|
|
5
5
|
import { w as p } from "./chunk.GMYPQTFK.js";
|
|
6
|
-
import { c as w,
|
|
6
|
+
import { c as w, d as o, S as b } from "./chunk.EMG3ZSPT.js";
|
|
7
7
|
import { e as k } from "./class-map.js";
|
|
8
8
|
import { n as i } from "./property.js";
|
|
9
9
|
import { e as n } from "./query.js";
|
package/chunks/chunk.7B2AJG4K.js
CHANGED
|
@@ -2,7 +2,7 @@ import { i as r, x as c } from "./lit-element.js";
|
|
|
2
2
|
import { L as p } from "./chunk.6CTB5ZDJ.js";
|
|
3
3
|
import { S as d } from "./chunk.5YPURQKE.js";
|
|
4
4
|
import { w as i } from "./chunk.GMYPQTFK.js";
|
|
5
|
-
import { c as h,
|
|
5
|
+
import { c as h, d as t, S as u } from "./chunk.EMG3ZSPT.js";
|
|
6
6
|
import { e as f } from "./class-map.js";
|
|
7
7
|
import { n } from "./property.js";
|
|
8
8
|
import { r as a } from "./state.js";
|
package/chunks/chunk.7ZRV3LMN.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as a, x as t } from "./lit-element.js";
|
|
2
2
|
import { S as l } from "./chunk.5YPURQKE.js";
|
|
3
3
|
import { w as r } from "./chunk.GMYPQTFK.js";
|
|
4
|
-
import { c as d,
|
|
4
|
+
import { c as d, d as i, S as n } from "./chunk.EMG3ZSPT.js";
|
|
5
5
|
import { e as c } from "./class-map.js";
|
|
6
6
|
import { n as o } from "./property.js";
|
|
7
7
|
import { r as s } from "./state.js";
|
package/chunks/chunk.AR3BL5H3.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as Vt, x as Rt } from "./lit-element.js";
|
|
2
2
|
import { L as jt } from "./chunk.6CTB5ZDJ.js";
|
|
3
|
-
import { c as Yt,
|
|
3
|
+
import { c as Yt, d as x, S as It, _ as Xt, a as qt } from "./chunk.EMG3ZSPT.js";
|
|
4
4
|
import { e as Et } from "./class-map.js";
|
|
5
5
|
import { n as A } from "./property.js";
|
|
6
6
|
import { e as Tt } from "./query.js";
|
package/chunks/chunk.BV4DJ45A.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as g, x as p } from "./lit-element.js";
|
|
2
2
|
import { f as _ } from "./chunk.SI4ACBFK.js";
|
|
3
3
|
import { F as C, c as x, a as R, v as V } from "./chunk.3RPBFEDE.js";
|
|
4
|
-
import { c as b,
|
|
4
|
+
import { c as b, d as l, S as v } from "./chunk.EMG3ZSPT.js";
|
|
5
5
|
import { n } from "./property.js";
|
|
6
6
|
import { r as f } from "./state.js";
|
|
7
7
|
import { e as m } from "./query.js";
|
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
import { i as v, x as f } from "./lit-element.js";
|
|
2
|
+
import { M as g } from "./chunk.FRD7DRZ6.js";
|
|
3
|
+
import { l as h, u as c } from "./chunk.RWUUFNUL.js";
|
|
4
|
+
import { S as _ } from "./chunk.MMEGYRNV.js";
|
|
5
|
+
import { s as a, g as s, b as n, a as d, w as m } from "./chunk.AJ3ENQ5C.js";
|
|
6
|
+
import { H as b } from "./chunk.NYIIDP5N.js";
|
|
7
|
+
import { L as k } from "./chunk.6CTB5ZDJ.js";
|
|
8
|
+
import { w as y } from "./chunk.GMYPQTFK.js";
|
|
9
|
+
import { c as x, d as r, S as C } from "./chunk.EMG3ZSPT.js";
|
|
10
|
+
import { e as z } from "./class-map.js";
|
|
11
|
+
import { o as u } from "./if-defined.js";
|
|
12
|
+
import { n as l } from "./property.js";
|
|
13
|
+
import { e as p } from "./query.js";
|
|
14
|
+
var S = v`
|
|
15
|
+
:host {
|
|
16
|
+
--size: 25rem;
|
|
17
|
+
--header-spacing: var(--sl-spacing-large);
|
|
18
|
+
--body-spacing: var(--sl-spacing-large);
|
|
19
|
+
--footer-spacing: var(--sl-spacing-large);
|
|
20
|
+
|
|
21
|
+
display: contents;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.drawer {
|
|
25
|
+
top: 0;
|
|
26
|
+
inset-inline-start: 0;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.drawer--contained {
|
|
34
|
+
position: absolute;
|
|
35
|
+
z-index: initial;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.drawer--fixed {
|
|
39
|
+
position: fixed;
|
|
40
|
+
z-index: var(--sl-z-index-drawer);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.drawer__panel {
|
|
44
|
+
position: absolute;
|
|
45
|
+
display: flex;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
z-index: 2;
|
|
48
|
+
max-width: 100%;
|
|
49
|
+
max-height: 100%;
|
|
50
|
+
background-color: var(--sl-panel-background-color);
|
|
51
|
+
box-shadow: var(--sl-shadow-x-large);
|
|
52
|
+
overflow: auto;
|
|
53
|
+
pointer-events: all;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.drawer__panel:focus {
|
|
57
|
+
outline: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.drawer--top .drawer__panel {
|
|
61
|
+
top: 0;
|
|
62
|
+
inset-inline-end: auto;
|
|
63
|
+
bottom: auto;
|
|
64
|
+
inset-inline-start: 0;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: var(--size);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.drawer--end .drawer__panel {
|
|
70
|
+
top: 0;
|
|
71
|
+
inset-inline-end: 0;
|
|
72
|
+
bottom: auto;
|
|
73
|
+
inset-inline-start: auto;
|
|
74
|
+
width: var(--size);
|
|
75
|
+
height: 100%;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.drawer--bottom .drawer__panel {
|
|
79
|
+
top: auto;
|
|
80
|
+
inset-inline-end: auto;
|
|
81
|
+
bottom: 0;
|
|
82
|
+
inset-inline-start: 0;
|
|
83
|
+
width: 100%;
|
|
84
|
+
height: var(--size);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.drawer--start .drawer__panel {
|
|
88
|
+
top: 0;
|
|
89
|
+
inset-inline-end: auto;
|
|
90
|
+
bottom: auto;
|
|
91
|
+
inset-inline-start: 0;
|
|
92
|
+
width: var(--size);
|
|
93
|
+
height: 100%;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.drawer__header {
|
|
97
|
+
display: flex;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.drawer__title {
|
|
101
|
+
flex: 1 1 auto;
|
|
102
|
+
font: inherit;
|
|
103
|
+
font-size: var(--sl-font-size-large);
|
|
104
|
+
line-height: var(--sl-line-height-dense);
|
|
105
|
+
padding: var(--header-spacing);
|
|
106
|
+
margin: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.drawer__header-actions {
|
|
110
|
+
flex-shrink: 0;
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-wrap: wrap;
|
|
113
|
+
justify-content: end;
|
|
114
|
+
gap: var(--sl-spacing-2x-small);
|
|
115
|
+
padding: 0 var(--header-spacing);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.drawer__header-actions sl-icon-button,
|
|
119
|
+
.drawer__header-actions ::slotted(sl-icon-button) {
|
|
120
|
+
flex: 0 0 auto;
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: center;
|
|
123
|
+
font-size: var(--sl-font-size-medium);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.drawer__body {
|
|
127
|
+
flex: 1 1 auto;
|
|
128
|
+
display: block;
|
|
129
|
+
padding: var(--body-spacing);
|
|
130
|
+
overflow: auto;
|
|
131
|
+
-webkit-overflow-scrolling: touch;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.drawer__footer {
|
|
135
|
+
text-align: right;
|
|
136
|
+
padding: var(--footer-spacing);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.drawer__footer ::slotted(sl-button:not(:last-of-type)) {
|
|
140
|
+
margin-inline-end: var(--sl-spacing-x-small);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.drawer:not(.drawer--has-footer) .drawer__footer {
|
|
144
|
+
display: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.drawer__overlay {
|
|
148
|
+
display: block;
|
|
149
|
+
position: fixed;
|
|
150
|
+
top: 0;
|
|
151
|
+
right: 0;
|
|
152
|
+
bottom: 0;
|
|
153
|
+
left: 0;
|
|
154
|
+
background-color: var(--sl-overlay-background-color);
|
|
155
|
+
pointer-events: all;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.drawer--contained .drawer__overlay {
|
|
159
|
+
display: none;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@media (forced-colors: active) {
|
|
163
|
+
.drawer__panel {
|
|
164
|
+
border: solid 1px var(--sl-color-neutral-0);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
`;
|
|
168
|
+
function w(e) {
|
|
169
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
170
|
+
}
|
|
171
|
+
var t = class extends C {
|
|
172
|
+
constructor() {
|
|
173
|
+
super(...arguments), this.hasSlotController = new b(this, "footer"), this.localize = new k(this), this.modal = new g(this), this.open = !1, this.label = "", this.placement = "end", this.contained = !1, this.noHeader = !1, this.handleDocumentKeyDown = (e) => {
|
|
174
|
+
this.contained || e.key === "Escape" && this.modal.isActive() && this.open && (e.stopImmediatePropagation(), this.requestClose("keyboard"));
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
firstUpdated() {
|
|
178
|
+
this.drawer.hidden = !this.open, this.open && (this.addOpenListeners(), this.contained || (this.modal.activate(), h(this)));
|
|
179
|
+
}
|
|
180
|
+
disconnectedCallback() {
|
|
181
|
+
super.disconnectedCallback(), c(this), this.removeOpenListeners();
|
|
182
|
+
}
|
|
183
|
+
requestClose(e) {
|
|
184
|
+
if (this.emit("sl-request-close", {
|
|
185
|
+
cancelable: !0,
|
|
186
|
+
detail: { source: e }
|
|
187
|
+
}).defaultPrevented) {
|
|
188
|
+
const o = s(this, "drawer.denyClose", { dir: this.localize.dir() });
|
|
189
|
+
n(this.panel, o.keyframes, o.options);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.hide();
|
|
193
|
+
}
|
|
194
|
+
addOpenListeners() {
|
|
195
|
+
var e;
|
|
196
|
+
"CloseWatcher" in window ? ((e = this.closeWatcher) == null || e.destroy(), this.contained || (this.closeWatcher = new CloseWatcher(), this.closeWatcher.onclose = () => this.requestClose("keyboard"))) : document.addEventListener("keydown", this.handleDocumentKeyDown);
|
|
197
|
+
}
|
|
198
|
+
removeOpenListeners() {
|
|
199
|
+
var e;
|
|
200
|
+
document.removeEventListener("keydown", this.handleDocumentKeyDown), (e = this.closeWatcher) == null || e.destroy();
|
|
201
|
+
}
|
|
202
|
+
async handleOpenChange() {
|
|
203
|
+
if (this.open) {
|
|
204
|
+
this.emit("sl-show"), this.addOpenListeners(), this.originalTrigger = document.activeElement, this.contained || (this.modal.activate(), h(this));
|
|
205
|
+
const e = this.querySelector("[autofocus]");
|
|
206
|
+
e && e.removeAttribute("autofocus"), await Promise.all([d(this.drawer), d(this.overlay)]), this.drawer.hidden = !1, requestAnimationFrame(() => {
|
|
207
|
+
this.emit("sl-initial-focus", { cancelable: !0 }).defaultPrevented || (e ? e.focus({ preventScroll: !0 }) : this.panel.focus({ preventScroll: !0 })), e && e.setAttribute("autofocus", "");
|
|
208
|
+
});
|
|
209
|
+
const i = s(this, `drawer.show${w(this.placement)}`, {
|
|
210
|
+
dir: this.localize.dir()
|
|
211
|
+
}), o = s(this, "drawer.overlay.show", { dir: this.localize.dir() });
|
|
212
|
+
await Promise.all([
|
|
213
|
+
n(this.panel, i.keyframes, i.options),
|
|
214
|
+
n(this.overlay, o.keyframes, o.options)
|
|
215
|
+
]), this.emit("sl-after-show");
|
|
216
|
+
} else {
|
|
217
|
+
this.emit("sl-hide"), this.removeOpenListeners(), this.contained || (this.modal.deactivate(), c(this)), await Promise.all([d(this.drawer), d(this.overlay)]);
|
|
218
|
+
const e = s(this, `drawer.hide${w(this.placement)}`, {
|
|
219
|
+
dir: this.localize.dir()
|
|
220
|
+
}), i = s(this, "drawer.overlay.hide", { dir: this.localize.dir() });
|
|
221
|
+
await Promise.all([
|
|
222
|
+
n(this.overlay, i.keyframes, i.options).then(() => {
|
|
223
|
+
this.overlay.hidden = !0;
|
|
224
|
+
}),
|
|
225
|
+
n(this.panel, e.keyframes, e.options).then(() => {
|
|
226
|
+
this.panel.hidden = !0;
|
|
227
|
+
})
|
|
228
|
+
]), this.drawer.hidden = !0, this.overlay.hidden = !1, this.panel.hidden = !1;
|
|
229
|
+
const o = this.originalTrigger;
|
|
230
|
+
typeof (o == null ? void 0 : o.focus) == "function" && setTimeout(() => o.focus()), this.emit("sl-after-hide");
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
handleNoModalChange() {
|
|
234
|
+
this.open && !this.contained && (this.modal.activate(), h(this)), this.open && this.contained && (this.modal.deactivate(), c(this));
|
|
235
|
+
}
|
|
236
|
+
/** Shows the drawer. */
|
|
237
|
+
async show() {
|
|
238
|
+
if (!this.open)
|
|
239
|
+
return this.open = !0, m(this, "sl-after-show");
|
|
240
|
+
}
|
|
241
|
+
/** Hides the drawer */
|
|
242
|
+
async hide() {
|
|
243
|
+
if (this.open)
|
|
244
|
+
return this.open = !1, m(this, "sl-after-hide");
|
|
245
|
+
}
|
|
246
|
+
render() {
|
|
247
|
+
return f`
|
|
248
|
+
<div
|
|
249
|
+
part="base"
|
|
250
|
+
class=${z({
|
|
251
|
+
drawer: !0,
|
|
252
|
+
"drawer--open": this.open,
|
|
253
|
+
"drawer--top": this.placement === "top",
|
|
254
|
+
"drawer--end": this.placement === "end",
|
|
255
|
+
"drawer--bottom": this.placement === "bottom",
|
|
256
|
+
"drawer--start": this.placement === "start",
|
|
257
|
+
"drawer--contained": this.contained,
|
|
258
|
+
"drawer--fixed": !this.contained,
|
|
259
|
+
"drawer--rtl": this.localize.dir() === "rtl",
|
|
260
|
+
"drawer--has-footer": this.hasSlotController.test("footer")
|
|
261
|
+
})}
|
|
262
|
+
>
|
|
263
|
+
<div part="overlay" class="drawer__overlay" @click=${() => this.requestClose("overlay")} tabindex="-1"></div>
|
|
264
|
+
|
|
265
|
+
<div
|
|
266
|
+
part="panel"
|
|
267
|
+
class="drawer__panel"
|
|
268
|
+
role="dialog"
|
|
269
|
+
aria-modal="true"
|
|
270
|
+
aria-hidden=${this.open ? "false" : "true"}
|
|
271
|
+
aria-label=${u(this.noHeader ? this.label : void 0)}
|
|
272
|
+
aria-labelledby=${u(this.noHeader ? void 0 : "title")}
|
|
273
|
+
tabindex="0"
|
|
274
|
+
>
|
|
275
|
+
${this.noHeader ? "" : f`
|
|
276
|
+
<header part="header" class="drawer__header">
|
|
277
|
+
<h2 part="title" class="drawer__title" id="title">
|
|
278
|
+
<!-- If there's no label, use an invisible character to prevent the header from collapsing -->
|
|
279
|
+
<slot name="label"> ${this.label.length > 0 ? this.label : "\uFEFF"} </slot>
|
|
280
|
+
</h2>
|
|
281
|
+
<div part="header-actions" class="drawer__header-actions">
|
|
282
|
+
<slot name="header-actions"></slot>
|
|
283
|
+
<sl-icon-button
|
|
284
|
+
part="close-button"
|
|
285
|
+
exportparts="base:close-button__base"
|
|
286
|
+
class="drawer__close"
|
|
287
|
+
name="x-lg"
|
|
288
|
+
label=${this.localize.term("close")}
|
|
289
|
+
library="system"
|
|
290
|
+
@click=${() => this.requestClose("close-button")}
|
|
291
|
+
></sl-icon-button>
|
|
292
|
+
</div>
|
|
293
|
+
</header>
|
|
294
|
+
`}
|
|
295
|
+
|
|
296
|
+
<slot part="body" class="drawer__body"></slot>
|
|
297
|
+
|
|
298
|
+
<footer part="footer" class="drawer__footer">
|
|
299
|
+
<slot name="footer"></slot>
|
|
300
|
+
</footer>
|
|
301
|
+
</div>
|
|
302
|
+
</div>
|
|
303
|
+
`;
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
t.styles = [x, S];
|
|
307
|
+
t.dependencies = { "sl-icon-button": _ };
|
|
308
|
+
r([
|
|
309
|
+
p(".drawer")
|
|
310
|
+
], t.prototype, "drawer", 2);
|
|
311
|
+
r([
|
|
312
|
+
p(".drawer__panel")
|
|
313
|
+
], t.prototype, "panel", 2);
|
|
314
|
+
r([
|
|
315
|
+
p(".drawer__overlay")
|
|
316
|
+
], t.prototype, "overlay", 2);
|
|
317
|
+
r([
|
|
318
|
+
l({ type: Boolean, reflect: !0 })
|
|
319
|
+
], t.prototype, "open", 2);
|
|
320
|
+
r([
|
|
321
|
+
l({ reflect: !0 })
|
|
322
|
+
], t.prototype, "label", 2);
|
|
323
|
+
r([
|
|
324
|
+
l({ reflect: !0 })
|
|
325
|
+
], t.prototype, "placement", 2);
|
|
326
|
+
r([
|
|
327
|
+
l({ type: Boolean, reflect: !0 })
|
|
328
|
+
], t.prototype, "contained", 2);
|
|
329
|
+
r([
|
|
330
|
+
l({ attribute: "no-header", type: Boolean, reflect: !0 })
|
|
331
|
+
], t.prototype, "noHeader", 2);
|
|
332
|
+
r([
|
|
333
|
+
y("open", { waitUntilFirstUpdate: !0 })
|
|
334
|
+
], t.prototype, "handleOpenChange", 1);
|
|
335
|
+
r([
|
|
336
|
+
y("contained", { waitUntilFirstUpdate: !0 })
|
|
337
|
+
], t.prototype, "handleNoModalChange", 1);
|
|
338
|
+
a("drawer.showTop", {
|
|
339
|
+
keyframes: [
|
|
340
|
+
{ opacity: 0, translate: "0 -100%" },
|
|
341
|
+
{ opacity: 1, translate: "0 0" }
|
|
342
|
+
],
|
|
343
|
+
options: { duration: 250, easing: "ease" }
|
|
344
|
+
});
|
|
345
|
+
a("drawer.hideTop", {
|
|
346
|
+
keyframes: [
|
|
347
|
+
{ opacity: 1, translate: "0 0" },
|
|
348
|
+
{ opacity: 0, translate: "0 -100%" }
|
|
349
|
+
],
|
|
350
|
+
options: { duration: 250, easing: "ease" }
|
|
351
|
+
});
|
|
352
|
+
a("drawer.showEnd", {
|
|
353
|
+
keyframes: [
|
|
354
|
+
{ opacity: 0, translate: "100%" },
|
|
355
|
+
{ opacity: 1, translate: "0" }
|
|
356
|
+
],
|
|
357
|
+
rtlKeyframes: [
|
|
358
|
+
{ opacity: 0, translate: "-100%" },
|
|
359
|
+
{ opacity: 1, translate: "0" }
|
|
360
|
+
],
|
|
361
|
+
options: { duration: 250, easing: "ease" }
|
|
362
|
+
});
|
|
363
|
+
a("drawer.hideEnd", {
|
|
364
|
+
keyframes: [
|
|
365
|
+
{ opacity: 1, translate: "0" },
|
|
366
|
+
{ opacity: 0, translate: "100%" }
|
|
367
|
+
],
|
|
368
|
+
rtlKeyframes: [
|
|
369
|
+
{ opacity: 1, translate: "0" },
|
|
370
|
+
{ opacity: 0, translate: "-100%" }
|
|
371
|
+
],
|
|
372
|
+
options: { duration: 250, easing: "ease" }
|
|
373
|
+
});
|
|
374
|
+
a("drawer.showBottom", {
|
|
375
|
+
keyframes: [
|
|
376
|
+
{ opacity: 0, translate: "0 100%" },
|
|
377
|
+
{ opacity: 1, translate: "0 0" }
|
|
378
|
+
],
|
|
379
|
+
options: { duration: 250, easing: "ease" }
|
|
380
|
+
});
|
|
381
|
+
a("drawer.hideBottom", {
|
|
382
|
+
keyframes: [
|
|
383
|
+
{ opacity: 1, translate: "0 0" },
|
|
384
|
+
{ opacity: 0, translate: "0 100%" }
|
|
385
|
+
],
|
|
386
|
+
options: { duration: 250, easing: "ease" }
|
|
387
|
+
});
|
|
388
|
+
a("drawer.showStart", {
|
|
389
|
+
keyframes: [
|
|
390
|
+
{ opacity: 0, translate: "-100%" },
|
|
391
|
+
{ opacity: 1, translate: "0" }
|
|
392
|
+
],
|
|
393
|
+
rtlKeyframes: [
|
|
394
|
+
{ opacity: 0, translate: "100%" },
|
|
395
|
+
{ opacity: 1, translate: "0" }
|
|
396
|
+
],
|
|
397
|
+
options: { duration: 250, easing: "ease" }
|
|
398
|
+
});
|
|
399
|
+
a("drawer.hideStart", {
|
|
400
|
+
keyframes: [
|
|
401
|
+
{ opacity: 1, translate: "0" },
|
|
402
|
+
{ opacity: 0, translate: "-100%" }
|
|
403
|
+
],
|
|
404
|
+
rtlKeyframes: [
|
|
405
|
+
{ opacity: 1, translate: "0" },
|
|
406
|
+
{ opacity: 0, translate: "100%" }
|
|
407
|
+
],
|
|
408
|
+
options: { duration: 250, easing: "ease" }
|
|
409
|
+
});
|
|
410
|
+
a("drawer.denyClose", {
|
|
411
|
+
keyframes: [{ scale: 1 }, { scale: 1.01 }, { scale: 1 }],
|
|
412
|
+
options: { duration: 250 }
|
|
413
|
+
});
|
|
414
|
+
a("drawer.overlay.show", {
|
|
415
|
+
keyframes: [{ opacity: 0 }, { opacity: 1 }],
|
|
416
|
+
options: { duration: 250 }
|
|
417
|
+
});
|
|
418
|
+
a("drawer.overlay.hide", {
|
|
419
|
+
keyframes: [{ opacity: 1 }, { opacity: 0 }],
|
|
420
|
+
options: { duration: 250 }
|
|
421
|
+
});
|
|
422
|
+
var W = t;
|
|
423
|
+
t.define("sl-drawer");
|
|
424
|
+
export {
|
|
425
|
+
W as d
|
|
426
|
+
};
|
package/chunks/chunk.CKEABH2A.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { i as g, x as f } from "./lit-element.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as w } from "./chunk.LXDTFLWU.js";
|
|
3
3
|
import { S as y } from "./chunk.AR3BL5H3.js";
|
|
4
4
|
import { s as m, w as d, a as h, g as c, b as u } from "./chunk.AJ3ENQ5C.js";
|
|
5
5
|
import { L as v } from "./chunk.6CTB5ZDJ.js";
|
|
6
6
|
import { w as b } from "./chunk.GMYPQTFK.js";
|
|
7
|
-
import { c as k,
|
|
7
|
+
import { c as k, d as i, S as E } from "./chunk.EMG3ZSPT.js";
|
|
8
8
|
import { e as _ } from "./class-map.js";
|
|
9
9
|
import { o as D } from "./if-defined.js";
|
|
10
10
|
import { n } from "./property.js";
|
package/chunks/chunk.EMG3ZSPT.js
CHANGED
package/chunks/chunk.FDPXBVDV.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as t } from "./lit-element.js";
|
|
2
2
|
import { w as a } from "./chunk.GMYPQTFK.js";
|
|
3
|
-
import { c as i,
|
|
3
|
+
import { c as i, d as r, S as o } from "./chunk.EMG3ZSPT.js";
|
|
4
4
|
import { n as l } from "./property.js";
|
|
5
5
|
var s = t`
|
|
6
6
|
:host {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { g as u } from "./chunk.LXDTFLWU.js";
|
|
2
|
+
import { b as d } from "./chunk.EMG3ZSPT.js";
|
|
3
|
+
function* h(e = document.activeElement) {
|
|
4
|
+
e != null && (yield e, "shadowRoot" in e && e.shadowRoot && e.shadowRoot.mode !== "closed" && (yield* d(h(e.shadowRoot.activeElement))));
|
|
5
|
+
}
|
|
6
|
+
function b() {
|
|
7
|
+
return [...h()].pop();
|
|
8
|
+
}
|
|
9
|
+
var o = [], m = class {
|
|
10
|
+
constructor(e) {
|
|
11
|
+
this.tabDirection = "forward", this.handleFocusIn = () => {
|
|
12
|
+
this.isActive() && this.checkFocus();
|
|
13
|
+
}, this.handleKeyDown = (i) => {
|
|
14
|
+
var r;
|
|
15
|
+
if (i.key !== "Tab" || this.isExternalActivated || !this.isActive()) return;
|
|
16
|
+
const t = b();
|
|
17
|
+
if (this.previousFocus = t, this.previousFocus && this.possiblyHasTabbableChildren(this.previousFocus))
|
|
18
|
+
return;
|
|
19
|
+
i.shiftKey ? this.tabDirection = "backward" : this.tabDirection = "forward";
|
|
20
|
+
const a = u(this.element);
|
|
21
|
+
let s = a.findIndex((n) => n === t);
|
|
22
|
+
this.previousFocus = this.currentFocus;
|
|
23
|
+
const c = this.tabDirection === "forward" ? 1 : -1;
|
|
24
|
+
for (; ; ) {
|
|
25
|
+
s + c >= a.length ? s = 0 : s + c < 0 ? s = a.length - 1 : s += c, this.previousFocus = this.currentFocus;
|
|
26
|
+
const n = (
|
|
27
|
+
/** @type {HTMLElement} */
|
|
28
|
+
a[s]
|
|
29
|
+
);
|
|
30
|
+
if (this.tabDirection === "backward" && this.previousFocus && this.possiblyHasTabbableChildren(this.previousFocus) || n && this.possiblyHasTabbableChildren(n))
|
|
31
|
+
return;
|
|
32
|
+
i.preventDefault(), this.currentFocus = n, (r = this.currentFocus) == null || r.focus({ preventScroll: !1 });
|
|
33
|
+
const l = [...h()];
|
|
34
|
+
if (l.includes(this.currentFocus) || !l.includes(this.previousFocus))
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
setTimeout(() => this.checkFocus());
|
|
38
|
+
}, this.handleKeyUp = () => {
|
|
39
|
+
this.tabDirection = "forward";
|
|
40
|
+
}, this.element = e, this.elementsWithTabbableControls = ["iframe"];
|
|
41
|
+
}
|
|
42
|
+
/** Activates focus trapping. */
|
|
43
|
+
activate() {
|
|
44
|
+
o.push(this.element), document.addEventListener("focusin", this.handleFocusIn), document.addEventListener("keydown", this.handleKeyDown), document.addEventListener("keyup", this.handleKeyUp);
|
|
45
|
+
}
|
|
46
|
+
/** Deactivates focus trapping. */
|
|
47
|
+
deactivate() {
|
|
48
|
+
o = o.filter((e) => e !== this.element), this.currentFocus = null, document.removeEventListener("focusin", this.handleFocusIn), document.removeEventListener("keydown", this.handleKeyDown), document.removeEventListener("keyup", this.handleKeyUp);
|
|
49
|
+
}
|
|
50
|
+
/** Determines if this modal element is currently active or not. */
|
|
51
|
+
isActive() {
|
|
52
|
+
return o[o.length - 1] === this.element;
|
|
53
|
+
}
|
|
54
|
+
/** Activates external modal behavior and temporarily disables focus trapping. */
|
|
55
|
+
activateExternal() {
|
|
56
|
+
this.isExternalActivated = !0;
|
|
57
|
+
}
|
|
58
|
+
/** Deactivates external modal behavior and re-enables focus trapping. */
|
|
59
|
+
deactivateExternal() {
|
|
60
|
+
this.isExternalActivated = !1;
|
|
61
|
+
}
|
|
62
|
+
checkFocus() {
|
|
63
|
+
if (this.isActive() && !this.isExternalActivated) {
|
|
64
|
+
const e = u(this.element);
|
|
65
|
+
if (!this.element.matches(":focus-within")) {
|
|
66
|
+
const i = e[0], r = e[e.length - 1], t = this.tabDirection === "forward" ? i : r;
|
|
67
|
+
typeof (t == null ? void 0 : t.focus) == "function" && (this.currentFocus = t, t.focus({ preventScroll: !1 }));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
possiblyHasTabbableChildren(e) {
|
|
72
|
+
return this.elementsWithTabbableControls.includes(e.tagName.toLowerCase()) || e.hasAttribute("controls");
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
m as M
|
|
77
|
+
};
|
package/chunks/chunk.GKEBKPRZ.js
CHANGED
|
@@ -5,7 +5,7 @@ import { F as u } from "./chunk.3RPBFEDE.js";
|
|
|
5
5
|
import { H as p } from "./chunk.NYIIDP5N.js";
|
|
6
6
|
import { S as m } from "./chunk.5YPURQKE.js";
|
|
7
7
|
import { w as a } from "./chunk.GMYPQTFK.js";
|
|
8
|
-
import { c as b,
|
|
8
|
+
import { c as b, d as t, S as k } from "./chunk.EMG3ZSPT.js";
|
|
9
9
|
import { e as c } from "./class-map.js";
|
|
10
10
|
import { o as f } from "./if-defined.js";
|
|
11
11
|
import { l as s } from "./live.js";
|