vrembem 4.0.0-next.2 → 4.0.0-next.4
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/LICENSE +21 -0
- package/dev/index.css +553 -254
- package/dev/index.css.map +1 -1
- package/dev/index.js +938 -923
- package/dev/index.js.map +1 -1
- package/dev/index.umd.cjs +743 -728
- package/dev/index.umd.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1060 -1044
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +6 -2
- package/dist/index.umd.cjs.map +1 -1
- package/index.js +0 -2
- package/index.scss +1 -2
- package/package.json +23 -24
package/dev/index.umd.cjs
CHANGED
|
@@ -6,33 +6,33 @@
|
|
|
6
6
|
if (!e.has(t))
|
|
7
7
|
throw TypeError("Cannot " + n);
|
|
8
8
|
};
|
|
9
|
-
var
|
|
9
|
+
var r = (t, e, n) => (b$2(t, e, "read from private field"), n ? n.call(t) : e.get(t)), m$2 = (t, e, n) => {
|
|
10
10
|
if (e.has(t))
|
|
11
11
|
throw TypeError("Cannot add the same private member more than once");
|
|
12
12
|
e instanceof WeakSet ? e.add(t) : e.set(t, n);
|
|
13
|
-
}, a = (t, e, n,
|
|
13
|
+
}, a$1 = (t, e, n, s) => (b$2(t, e, "write to private field"), s ? s.call(t, n) : e.set(t, n), n);
|
|
14
14
|
var l$1;
|
|
15
|
-
let
|
|
15
|
+
let I$3 = class I {
|
|
16
16
|
constructor(e, n) {
|
|
17
|
-
|
|
18
|
-
this.value = e, a(this, l$1, n), this.mql = null;
|
|
17
|
+
m$2(this, l$1, void 0);
|
|
18
|
+
this.value = e, a$1(this, l$1, n), this.mql = null;
|
|
19
19
|
}
|
|
20
20
|
get handler() {
|
|
21
|
-
return
|
|
21
|
+
return r(this, l$1);
|
|
22
22
|
}
|
|
23
23
|
// Unmount existing handler before setting a new one.
|
|
24
24
|
set handler(e) {
|
|
25
|
-
this.mql &&
|
|
25
|
+
this.mql && this.mql.removeEventListener("change", r(this, l$1)), a$1(this, l$1, e);
|
|
26
26
|
}
|
|
27
27
|
mount(e, n) {
|
|
28
|
-
return e && (this.value = e), n && a(this, l$1, n), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`),
|
|
28
|
+
return e && (this.value = e), n && a$1(this, l$1, n), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", r(this, l$1)), r(this, l$1).call(this, this.mql), this) : this;
|
|
29
29
|
}
|
|
30
30
|
unmount() {
|
|
31
|
-
return this.mql ? (
|
|
31
|
+
return this.mql ? (this.mql.removeEventListener("change", r(this, l$1)), this.value = null, a$1(this, l$1, null), this.mql = null, this) : this;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
l$1 = /* @__PURE__ */ new WeakMap();
|
|
35
|
-
let
|
|
35
|
+
let L$2 = class L {
|
|
36
36
|
constructor() {
|
|
37
37
|
this.collection = [];
|
|
38
38
|
}
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
return await this.deregister(e), this.collection.push(e), this.collection;
|
|
41
41
|
}
|
|
42
42
|
async deregister(e) {
|
|
43
|
-
const n = this.collection.findIndex((
|
|
43
|
+
const n = this.collection.findIndex((s) => s === e);
|
|
44
44
|
if (n >= 0) {
|
|
45
|
-
const
|
|
46
|
-
Object.getOwnPropertyNames(
|
|
47
|
-
delete
|
|
45
|
+
const s = this.collection[n];
|
|
46
|
+
Object.getOwnPropertyNames(s).forEach((o2) => {
|
|
47
|
+
delete s[o2];
|
|
48
48
|
}), this.collection.splice(n, 1);
|
|
49
49
|
}
|
|
50
50
|
return this.collection;
|
|
@@ -60,44 +60,44 @@
|
|
|
60
60
|
return this.collection;
|
|
61
61
|
}
|
|
62
62
|
get(e, n = "id") {
|
|
63
|
-
return this.collection.find((
|
|
63
|
+
return this.collection.find((s) => s[n] === e);
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
const
|
|
66
|
+
const i = {
|
|
67
67
|
inert: ":not([inert]):not([inert] *)",
|
|
68
68
|
negTabIndex: ':not([tabindex^="-"])',
|
|
69
69
|
disabled: ":not(:disabled)"
|
|
70
|
-
},
|
|
71
|
-
`a[href]${
|
|
72
|
-
`area[href]${
|
|
73
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
74
|
-
`input[type="radio"]${
|
|
75
|
-
`select${
|
|
76
|
-
`textarea${
|
|
77
|
-
`button${
|
|
78
|
-
`details${
|
|
70
|
+
}, g$2 = [
|
|
71
|
+
`a[href]${i.inert}${i.negTabIndex}`,
|
|
72
|
+
`area[href]${i.inert}${i.negTabIndex}`,
|
|
73
|
+
`input:not([type="hidden"]):not([type="radio"])${i.inert}${i.negTabIndex}${i.disabled}`,
|
|
74
|
+
`input[type="radio"]${i.inert}${i.negTabIndex}${i.disabled}`,
|
|
75
|
+
`select${i.inert}${i.negTabIndex}${i.disabled}`,
|
|
76
|
+
`textarea${i.inert}${i.negTabIndex}${i.disabled}`,
|
|
77
|
+
`button${i.inert}${i.negTabIndex}${i.disabled}`,
|
|
78
|
+
`details${i.inert} > summary:first-of-type${i.negTabIndex}`,
|
|
79
79
|
// Discard until Firefox supports `:has()`
|
|
80
80
|
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
|
|
81
81
|
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
|
|
82
|
-
`iframe${
|
|
83
|
-
`audio[controls]${
|
|
84
|
-
`video[controls]${
|
|
85
|
-
`[contenteditable]${
|
|
86
|
-
`[tabindex]${
|
|
82
|
+
`iframe${i.inert}${i.negTabIndex}`,
|
|
83
|
+
`audio[controls]${i.inert}${i.negTabIndex}`,
|
|
84
|
+
`video[controls]${i.inert}${i.negTabIndex}`,
|
|
85
|
+
`[contenteditable]${i.inert}${i.negTabIndex}`,
|
|
86
|
+
`[tabindex]${i.inert}${i.negTabIndex}`
|
|
87
87
|
];
|
|
88
|
-
var f$2,
|
|
89
|
-
let
|
|
88
|
+
var f$2, u$2, d$2;
|
|
89
|
+
let S$3 = class S {
|
|
90
90
|
constructor(e = null, n = "[data-focus]") {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.el = e, this.selectorFocus = n, a(this,
|
|
91
|
+
m$2(this, f$2, void 0);
|
|
92
|
+
m$2(this, u$2, void 0);
|
|
93
|
+
m$2(this, d$2, void 0);
|
|
94
|
+
this.el = e, this.selectorFocus = n, a$1(this, u$2, $$2.bind(this)), a$1(this, d$2, y$2.bind(this));
|
|
95
95
|
}
|
|
96
96
|
get focusable() {
|
|
97
|
-
return
|
|
97
|
+
return r(this, f$2);
|
|
98
98
|
}
|
|
99
99
|
set focusable(e) {
|
|
100
|
-
a(this, f$2, e),
|
|
100
|
+
a$1(this, f$2, e), r(this, f$2).length ? (document.removeEventListener("keydown", r(this, d$2)), document.addEventListener("keydown", r(this, u$2))) : (document.removeEventListener("keydown", r(this, u$2)), document.addEventListener("keydown", r(this, d$2)));
|
|
101
101
|
}
|
|
102
102
|
get focusableFirst() {
|
|
103
103
|
return this.focusable[0];
|
|
@@ -109,180 +109,155 @@
|
|
|
109
109
|
e && (this.el = e), n && (this.selectorFocus = n), this.focusable = this.getFocusable(), this.focus();
|
|
110
110
|
}
|
|
111
111
|
unmount() {
|
|
112
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown",
|
|
112
|
+
this.el = null, this.focusable = [], document.removeEventListener("keydown", r(this, u$2)), document.removeEventListener("keydown", r(this, d$2));
|
|
113
113
|
}
|
|
114
114
|
focus(e = this.el, n = this.selectorFocus) {
|
|
115
115
|
(e.querySelector(n) || e).focus();
|
|
116
116
|
}
|
|
117
117
|
getFocusable(e = this.el) {
|
|
118
|
-
const n = [],
|
|
119
|
-
return e.querySelectorAll(
|
|
120
|
-
|
|
121
|
-
}), e.scrollTop =
|
|
118
|
+
const n = [], s = document.activeElement, o2 = e.scrollTop;
|
|
119
|
+
return e.querySelectorAll(g$2.join(",")).forEach((h2) => {
|
|
120
|
+
h2.focus(), document.activeElement === h2 && n.push(h2);
|
|
121
|
+
}), e.scrollTop = o2, s.focus(), n;
|
|
122
122
|
}
|
|
123
123
|
};
|
|
124
|
-
f$2 = /* @__PURE__ */ new WeakMap(),
|
|
125
|
-
function
|
|
124
|
+
f$2 = /* @__PURE__ */ new WeakMap(), u$2 = /* @__PURE__ */ new WeakMap(), d$2 = /* @__PURE__ */ new WeakMap();
|
|
125
|
+
function $$2(t) {
|
|
126
126
|
(t.key === "Tab" || t.keyCode === 9) && (t.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (t.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (t.preventDefault(), this.focusableFirst.focus()));
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function y$2(t) {
|
|
129
129
|
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
function v$2() {
|
|
132
|
+
return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim();
|
|
133
|
+
}
|
|
134
|
+
function T$2(t, e = document.body, n = true) {
|
|
135
|
+
if (n) {
|
|
136
|
+
const o2 = v$2();
|
|
137
|
+
o2 && !t.includes(`--${o2}`) && (t = t.replace("--", `--${o2}`));
|
|
138
|
+
}
|
|
139
|
+
const s = getComputedStyle(e).getPropertyValue(t).trim();
|
|
140
|
+
if (s)
|
|
141
|
+
return s;
|
|
142
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
134
143
|
}
|
|
135
|
-
function
|
|
136
|
-
|
|
144
|
+
function q$2(t, e) {
|
|
145
|
+
const s = (t.getAttribute(`data-${e}`) || "").replace(/'/g, '"');
|
|
146
|
+
return s ? JSON.parse(s) : {};
|
|
137
147
|
}
|
|
138
|
-
function
|
|
139
|
-
const n = localStorage.getItem(t),
|
|
148
|
+
function F$3(t, e = true) {
|
|
149
|
+
const n = localStorage.getItem(t), s = n ? JSON.parse(n) : {};
|
|
140
150
|
return {
|
|
141
|
-
get(
|
|
142
|
-
return
|
|
151
|
+
get(o2) {
|
|
152
|
+
return o2 ? s[o2] : s;
|
|
143
153
|
},
|
|
144
|
-
set(
|
|
145
|
-
return c2 ?
|
|
154
|
+
set(o2, c2) {
|
|
155
|
+
return c2 ? s[o2] = c2 : delete s[o2], e && localStorage.setItem(t, JSON.stringify(s)), s;
|
|
146
156
|
}
|
|
147
157
|
};
|
|
148
158
|
}
|
|
149
|
-
function
|
|
150
|
-
const
|
|
151
|
-
if (e =
|
|
159
|
+
function k$3(t, e, n) {
|
|
160
|
+
const s = e.nodeType === Node.COMMENT_NODE, o2 = e.nodeType === Node.ELEMENT_NODE;
|
|
161
|
+
if (e = s || o2 ? e : document.querySelector(e), s && (n = "after"), !e)
|
|
152
162
|
throw new Error(`Not a valid teleport reference: '${e}'`);
|
|
153
163
|
if (typeof e[n] != "function")
|
|
154
164
|
throw new Error(`Not a valid teleport method: '${n}'`);
|
|
155
165
|
let c2 = null;
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
function y$2(t, e) {
|
|
168
|
-
e && document.querySelectorAll(e).forEach((i2) => {
|
|
169
|
-
t ? i2.style.overflow = "hidden" : i2.style.removeProperty("overflow");
|
|
166
|
+
return s || (c2 = document.createComment("teleported #" + t.id), t.before(c2)), e[n](t), s && e.remove(), c2;
|
|
167
|
+
}
|
|
168
|
+
function w$2(t, e, n, s = "--transition-duration") {
|
|
169
|
+
return new Promise((o2) => {
|
|
170
|
+
if (typeof s == "string") {
|
|
171
|
+
const c2 = T$2(s, t), h2 = !!c2.includes("ms");
|
|
172
|
+
s = parseFloat(c2) * (h2 ? 1 : 1e3);
|
|
173
|
+
}
|
|
174
|
+
t.classList.remove(e.finish), t.classList.add(n.start), setTimeout(() => {
|
|
175
|
+
t.classList.add(n.finish), t.classList.remove(n.start), o2(t);
|
|
176
|
+
}, s);
|
|
170
177
|
});
|
|
171
178
|
}
|
|
172
|
-
function
|
|
173
|
-
e && document.querySelectorAll(e).forEach((
|
|
174
|
-
t ?
|
|
179
|
+
function p$2(t, e) {
|
|
180
|
+
e && document.querySelectorAll(e).forEach((s) => {
|
|
181
|
+
t ? s.style.overflow = "hidden" : s.style.removeProperty("overflow");
|
|
175
182
|
});
|
|
176
183
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
184
|
+
function E$2(t, e) {
|
|
185
|
+
e && document.querySelectorAll(e).forEach((s) => {
|
|
186
|
+
t ? (s.inert = true, s.setAttribute("aria-hidden", true)) : (s.inert = null, s.removeAttribute("aria-hidden"));
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function C$2(t, e) {
|
|
190
|
+
E$2(!!t, e.selectorInert), p$2(!!t, e.selectorOverflow);
|
|
179
191
|
}
|
|
180
192
|
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
181
193
|
__proto__: null,
|
|
182
|
-
Breakpoint:
|
|
183
|
-
Collection:
|
|
184
|
-
FocusTrap:
|
|
185
|
-
|
|
194
|
+
Breakpoint: I$3,
|
|
195
|
+
Collection: L$2,
|
|
196
|
+
FocusTrap: S$3,
|
|
197
|
+
cssVar: T$2,
|
|
186
198
|
getConfig: q$2,
|
|
187
|
-
getPrefix:
|
|
188
|
-
localStore:
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
updateGlobalState:
|
|
199
|
+
getPrefix: v$2,
|
|
200
|
+
localStore: F$3,
|
|
201
|
+
teleport: k$3,
|
|
202
|
+
transition: w$2,
|
|
203
|
+
updateGlobalState: C$2
|
|
192
204
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
stateValue: "mixed"
|
|
197
|
-
};
|
|
198
|
-
let r$2 = class r {
|
|
199
|
-
constructor(t) {
|
|
200
|
-
this.defaults = i, this.settings = { ...this.defaults, ...t }, this.__handlerClick = this.handlerClick.bind(this), this.settings.autoInit && this.init();
|
|
201
|
-
}
|
|
202
|
-
init(t = null) {
|
|
203
|
-
t && (this.settings = { ...this.settings, ...t });
|
|
204
|
-
const e = `[${this.settings.stateAttr}="${this.settings.stateValue}"]`, s2 = document.querySelectorAll(e);
|
|
205
|
-
this.setIndeterminate(s2), document.addEventListener("click", this.__handlerClick, false);
|
|
206
|
-
}
|
|
207
|
-
destroy() {
|
|
208
|
-
document.removeEventListener("click", this.__handlerClick, false);
|
|
209
|
-
}
|
|
210
|
-
handlerClick(t) {
|
|
211
|
-
const e = `[${this.settings.stateAttr}="${this.settings.stateValue}"]`, s2 = t.target.closest(e);
|
|
212
|
-
s2 && (this.removeAriaState(s2), this.setIndeterminate(s2));
|
|
213
|
-
}
|
|
214
|
-
setAriaState(t, e = this.settings.stateValue) {
|
|
215
|
-
t = t.forEach ? t : [t], t.forEach((s2) => {
|
|
216
|
-
s2.setAttribute(this.settings.stateAttr, e);
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
removeAriaState(t) {
|
|
220
|
-
t = t.forEach ? t : [t], t.forEach((e) => {
|
|
221
|
-
e.removeAttribute(this.settings.stateAttr);
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
setIndeterminate(t) {
|
|
225
|
-
t = t.forEach ? t : [t], t.forEach((e) => {
|
|
226
|
-
e.hasAttribute(this.settings.stateAttr) ? e.indeterminate = true : e.indeterminate = false;
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
var S$2 = (t, e, s2) => {
|
|
231
|
-
if (!e.has(t))
|
|
232
|
-
throw TypeError("Cannot " + s2);
|
|
205
|
+
var I$2 = (t, s, e) => {
|
|
206
|
+
if (!s.has(t))
|
|
207
|
+
throw TypeError("Cannot " + e);
|
|
233
208
|
};
|
|
234
|
-
var
|
|
235
|
-
if (
|
|
209
|
+
var b$1 = (t, s, e) => (I$2(t, s, "read from private field"), e ? e.call(t) : s.get(t)), $$1 = (t, s, e) => {
|
|
210
|
+
if (s.has(t))
|
|
236
211
|
throw TypeError("Cannot add the same private member more than once");
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
var
|
|
240
|
-
if (!
|
|
241
|
-
throw TypeError("Cannot " +
|
|
242
|
-
}, l = (t,
|
|
243
|
-
if (
|
|
212
|
+
s instanceof WeakSet ? s.add(t) : s.set(t, e);
|
|
213
|
+
}, S$2 = (t, s, e, i2) => (I$2(t, s, "write to private field"), i2 ? i2.call(t, e) : s.set(t, e), e);
|
|
214
|
+
var O$1 = (t, s, e) => {
|
|
215
|
+
if (!s.has(t))
|
|
216
|
+
throw TypeError("Cannot " + e);
|
|
217
|
+
}, l = (t, s, e) => (O$1(t, s, "read from private field"), e ? e.call(t) : s.get(t)), w$1 = (t, s, e) => {
|
|
218
|
+
if (s.has(t))
|
|
244
219
|
throw TypeError("Cannot add the same private member more than once");
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
let
|
|
248
|
-
constructor(
|
|
249
|
-
w$1(this,
|
|
220
|
+
s instanceof WeakSet ? s.add(t) : s.set(t, e);
|
|
221
|
+
}, u$1 = (t, s, e, i2) => (O$1(t, s, "write to private field"), i2 ? i2.call(t, e) : s.set(t, e), e), d$1;
|
|
222
|
+
let P$1 = class P {
|
|
223
|
+
constructor(s, e) {
|
|
224
|
+
w$1(this, d$1, void 0), this.value = s, u$1(this, d$1, e), this.mql = null;
|
|
250
225
|
}
|
|
251
226
|
get handler() {
|
|
252
|
-
return l(this,
|
|
227
|
+
return l(this, d$1);
|
|
253
228
|
}
|
|
254
229
|
// Unmount existing handler before setting a new one.
|
|
255
|
-
set handler(
|
|
256
|
-
this.mql &&
|
|
230
|
+
set handler(s) {
|
|
231
|
+
this.mql && this.mql.removeEventListener("change", l(this, d$1)), u$1(this, d$1, s);
|
|
257
232
|
}
|
|
258
|
-
mount(
|
|
259
|
-
return
|
|
233
|
+
mount(s, e) {
|
|
234
|
+
return s && (this.value = s), e && u$1(this, d$1, e), this.value ? (this.mql = window.matchMedia(`(min-width: ${this.value})`), this.mql.addEventListener("change", l(this, d$1)), l(this, d$1).call(this, this.mql), this) : this;
|
|
260
235
|
}
|
|
261
236
|
unmount() {
|
|
262
|
-
return this.mql ? (
|
|
237
|
+
return this.mql ? (this.mql.removeEventListener("change", l(this, d$1)), this.value = null, u$1(this, d$1, null), this.mql = null, this) : this;
|
|
263
238
|
}
|
|
264
239
|
};
|
|
265
|
-
|
|
266
|
-
let
|
|
240
|
+
d$1 = /* @__PURE__ */ new WeakMap();
|
|
241
|
+
let A$1 = class A {
|
|
267
242
|
constructor() {
|
|
268
243
|
this.collection = [];
|
|
269
244
|
}
|
|
270
|
-
async register(
|
|
271
|
-
return await this.deregister(
|
|
245
|
+
async register(s) {
|
|
246
|
+
return await this.deregister(s), this.collection.push(s), this.collection;
|
|
272
247
|
}
|
|
273
|
-
async deregister(
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
const i2 = this.collection[
|
|
248
|
+
async deregister(s) {
|
|
249
|
+
const e = this.collection.findIndex((i2) => i2 === s);
|
|
250
|
+
if (e >= 0) {
|
|
251
|
+
const i2 = this.collection[e];
|
|
277
252
|
Object.getOwnPropertyNames(i2).forEach((n) => {
|
|
278
253
|
delete i2[n];
|
|
279
|
-
}), this.collection.splice(
|
|
254
|
+
}), this.collection.splice(e, 1);
|
|
280
255
|
}
|
|
281
256
|
return this.collection;
|
|
282
257
|
}
|
|
283
|
-
async registerCollection(
|
|
284
|
-
return await Promise.all(Array.from(
|
|
285
|
-
this.register(
|
|
258
|
+
async registerCollection(s) {
|
|
259
|
+
return await Promise.all(Array.from(s, (e) => {
|
|
260
|
+
this.register(e);
|
|
286
261
|
})), this.collection;
|
|
287
262
|
}
|
|
288
263
|
async deregisterCollection() {
|
|
@@ -290,42 +265,42 @@
|
|
|
290
265
|
await this.deregister(this.collection[0]);
|
|
291
266
|
return this.collection;
|
|
292
267
|
}
|
|
293
|
-
get(
|
|
294
|
-
return this.collection.find((i2) => i2[
|
|
268
|
+
get(s, e = "id") {
|
|
269
|
+
return this.collection.find((i2) => i2[e] === s);
|
|
295
270
|
}
|
|
296
271
|
};
|
|
297
|
-
const
|
|
272
|
+
const o$1 = {
|
|
298
273
|
inert: ":not([inert]):not([inert] *)",
|
|
299
274
|
negTabIndex: ':not([tabindex^="-"])',
|
|
300
275
|
disabled: ":not(:disabled)"
|
|
301
|
-
},
|
|
302
|
-
`a[href]${
|
|
303
|
-
`area[href]${
|
|
304
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
305
|
-
`input[type="radio"]${
|
|
306
|
-
`select${
|
|
307
|
-
`textarea${
|
|
308
|
-
`button${
|
|
309
|
-
`details${
|
|
276
|
+
}, B$1 = [
|
|
277
|
+
`a[href]${o$1.inert}${o$1.negTabIndex}`,
|
|
278
|
+
`area[href]${o$1.inert}${o$1.negTabIndex}`,
|
|
279
|
+
`input:not([type="hidden"]):not([type="radio"])${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
280
|
+
`input[type="radio"]${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
281
|
+
`select${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
282
|
+
`textarea${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
283
|
+
`button${o$1.inert}${o$1.negTabIndex}${o$1.disabled}`,
|
|
284
|
+
`details${o$1.inert} > summary:first-of-type${o$1.negTabIndex}`,
|
|
310
285
|
// Discard until Firefox supports `:has()`
|
|
311
286
|
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
|
|
312
287
|
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
|
|
313
|
-
`iframe${
|
|
314
|
-
`audio[controls]${
|
|
315
|
-
`video[controls]${
|
|
316
|
-
`[contenteditable]${
|
|
317
|
-
`[tabindex]${
|
|
288
|
+
`iframe${o$1.inert}${o$1.negTabIndex}`,
|
|
289
|
+
`audio[controls]${o$1.inert}${o$1.negTabIndex}`,
|
|
290
|
+
`video[controls]${o$1.inert}${o$1.negTabIndex}`,
|
|
291
|
+
`[contenteditable]${o$1.inert}${o$1.negTabIndex}`,
|
|
292
|
+
`[tabindex]${o$1.inert}${o$1.negTabIndex}`
|
|
318
293
|
];
|
|
319
|
-
var v$1,
|
|
320
|
-
let
|
|
321
|
-
constructor(
|
|
322
|
-
w$1(this, v$1, void 0), w$1(this,
|
|
294
|
+
var v$1, g$1, f$1;
|
|
295
|
+
let j$2 = class j {
|
|
296
|
+
constructor(s = null, e = "[data-focus]") {
|
|
297
|
+
w$1(this, v$1, void 0), w$1(this, g$1, void 0), w$1(this, f$1, void 0), this.el = s, this.selectorFocus = e, u$1(this, g$1, q$1.bind(this)), u$1(this, f$1, K$2.bind(this));
|
|
323
298
|
}
|
|
324
299
|
get focusable() {
|
|
325
300
|
return l(this, v$1);
|
|
326
301
|
}
|
|
327
|
-
set focusable(
|
|
328
|
-
|
|
302
|
+
set focusable(s) {
|
|
303
|
+
u$1(this, v$1, s), l(this, v$1).length ? (document.removeEventListener("keydown", l(this, f$1)), document.addEventListener("keydown", l(this, g$1))) : (document.removeEventListener("keydown", l(this, g$1)), document.addEventListener("keydown", l(this, f$1)));
|
|
329
304
|
}
|
|
330
305
|
get focusableFirst() {
|
|
331
306
|
return this.focusable[0];
|
|
@@ -333,70 +308,82 @@
|
|
|
333
308
|
get focusableLast() {
|
|
334
309
|
return this.focusable[this.focusable.length - 1];
|
|
335
310
|
}
|
|
336
|
-
mount(
|
|
337
|
-
|
|
311
|
+
mount(s, e) {
|
|
312
|
+
s && (this.el = s), e && (this.selectorFocus = e), this.focusable = this.getFocusable(), this.focus();
|
|
338
313
|
}
|
|
339
314
|
unmount() {
|
|
340
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown", l(this,
|
|
315
|
+
this.el = null, this.focusable = [], document.removeEventListener("keydown", l(this, g$1)), document.removeEventListener("keydown", l(this, f$1));
|
|
341
316
|
}
|
|
342
|
-
focus(
|
|
343
|
-
(
|
|
317
|
+
focus(s = this.el, e = this.selectorFocus) {
|
|
318
|
+
(s.querySelector(e) || s).focus();
|
|
344
319
|
}
|
|
345
|
-
getFocusable(
|
|
346
|
-
const
|
|
347
|
-
return
|
|
348
|
-
|
|
349
|
-
}),
|
|
320
|
+
getFocusable(s = this.el) {
|
|
321
|
+
const e = [], i2 = document.activeElement, n = s.scrollTop;
|
|
322
|
+
return s.querySelectorAll(B$1.join(",")).forEach((c2) => {
|
|
323
|
+
c2.focus(), document.activeElement === c2 && e.push(c2);
|
|
324
|
+
}), s.scrollTop = n, i2.focus(), e;
|
|
350
325
|
}
|
|
351
326
|
};
|
|
352
|
-
v$1 = /* @__PURE__ */ new WeakMap(),
|
|
353
|
-
function
|
|
327
|
+
v$1 = /* @__PURE__ */ new WeakMap(), g$1 = /* @__PURE__ */ new WeakMap(), f$1 = /* @__PURE__ */ new WeakMap();
|
|
328
|
+
function q$1(t) {
|
|
354
329
|
(t.key === "Tab" || t.keyCode === 9) && (t.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (t.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (t.preventDefault(), this.focusableFirst.focus()));
|
|
355
330
|
}
|
|
356
|
-
function
|
|
331
|
+
function K$2(t) {
|
|
357
332
|
(t.key === "Tab" || t.keyCode === 9) && t.preventDefault();
|
|
358
333
|
}
|
|
359
|
-
function
|
|
360
|
-
|
|
361
|
-
|
|
334
|
+
function y$1() {
|
|
335
|
+
return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim();
|
|
336
|
+
}
|
|
337
|
+
function N$2(t, s = document.body, e = true) {
|
|
338
|
+
if (e) {
|
|
339
|
+
const n = y$1();
|
|
340
|
+
n && !t.includes(`--${n}`) && (t = t.replace("--", `--${n}`));
|
|
341
|
+
}
|
|
342
|
+
const i2 = getComputedStyle(s).getPropertyValue(t).trim();
|
|
343
|
+
if (i2)
|
|
344
|
+
return i2;
|
|
345
|
+
throw new Error(`CSS variable "${t}" was not found!`);
|
|
362
346
|
}
|
|
363
|
-
function
|
|
364
|
-
|
|
347
|
+
function V$1(t, s) {
|
|
348
|
+
const e = (t.getAttribute(`data-${s}`) || "").replace(/'/g, '"');
|
|
349
|
+
return e ? JSON.parse(e) : {};
|
|
365
350
|
}
|
|
366
|
-
function
|
|
367
|
-
const
|
|
351
|
+
function W$1(t, s = true) {
|
|
352
|
+
const e = localStorage.getItem(t), i2 = e ? JSON.parse(e) : {};
|
|
368
353
|
return {
|
|
369
354
|
get(n) {
|
|
370
355
|
return n ? i2[n] : i2;
|
|
371
356
|
},
|
|
372
|
-
set(n,
|
|
373
|
-
return
|
|
357
|
+
set(n, c2) {
|
|
358
|
+
return c2 ? i2[n] = c2 : delete i2[n], s && localStorage.setItem(t, JSON.stringify(i2)), i2;
|
|
374
359
|
}
|
|
375
360
|
};
|
|
376
361
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
function G$1(t, e) {
|
|
387
|
-
e && document.querySelectorAll(e).forEach((s2) => {
|
|
388
|
-
t ? s2.style.overflow = "hidden" : s2.style.removeProperty("overflow");
|
|
362
|
+
function M$1(t, s, e, i2 = "--transition-duration") {
|
|
363
|
+
return new Promise((n) => {
|
|
364
|
+
if (typeof i2 == "string") {
|
|
365
|
+
const c2 = N$2(i2, t), r2 = !!c2.includes("ms");
|
|
366
|
+
i2 = parseFloat(c2) * (r2 ? 1 : 1e3);
|
|
367
|
+
}
|
|
368
|
+
t.classList.remove(s.finish), t.classList.add(e.start), setTimeout(() => {
|
|
369
|
+
t.classList.add(e.finish), t.classList.remove(e.start), n(t);
|
|
370
|
+
}, i2);
|
|
389
371
|
});
|
|
390
372
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
393
|
-
t ?
|
|
373
|
+
function _$2(t, s) {
|
|
374
|
+
s && document.querySelectorAll(s).forEach((e) => {
|
|
375
|
+
t ? e.style.overflow = "hidden" : e.style.removeProperty("overflow");
|
|
394
376
|
});
|
|
395
377
|
}
|
|
396
|
-
function
|
|
397
|
-
|
|
378
|
+
function J$2(t, s) {
|
|
379
|
+
s && document.querySelectorAll(s).forEach((e) => {
|
|
380
|
+
t ? (e.inert = true, e.setAttribute("aria-hidden", true)) : (e.inert = null, e.removeAttribute("aria-hidden"));
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
function k$2(t, s) {
|
|
384
|
+
J$2(!!t, s.selectorInert), _$2(!!t, s.selectorOverflow);
|
|
398
385
|
}
|
|
399
|
-
const
|
|
386
|
+
const z$1 = {
|
|
400
387
|
autoInit: false,
|
|
401
388
|
// Data attributes
|
|
402
389
|
dataOpen: "drawer-open",
|
|
@@ -407,6 +394,7 @@
|
|
|
407
394
|
// Selectors
|
|
408
395
|
selectorDrawer: ".drawer",
|
|
409
396
|
selectorDialog: ".drawer__dialog",
|
|
397
|
+
selectorScreen: ".drawer",
|
|
410
398
|
selectorFocus: "[data-focus]",
|
|
411
399
|
selectorInert: null,
|
|
412
400
|
selectorOverflow: "body",
|
|
@@ -424,186 +412,195 @@
|
|
|
424
412
|
store: true,
|
|
425
413
|
storeKey: "VB:DrawerState",
|
|
426
414
|
setTabindex: true,
|
|
427
|
-
transition: true
|
|
415
|
+
transition: true,
|
|
416
|
+
transitionDuration: "--vb-drawer-transition-duration"
|
|
428
417
|
};
|
|
429
|
-
function
|
|
430
|
-
const
|
|
418
|
+
async function G$1(t) {
|
|
419
|
+
const s = t.target.closest(`
|
|
431
420
|
[data-${this.settings.dataOpen}],
|
|
432
421
|
[data-${this.settings.dataToggle}],
|
|
433
422
|
[data-${this.settings.dataClose}]
|
|
434
423
|
`);
|
|
435
|
-
if (
|
|
436
|
-
t.preventDefault(),
|
|
424
|
+
if (s) {
|
|
425
|
+
t.preventDefault(), s.matches(`[data-${this.settings.dataToggle}]`) && s.getAttribute(`data-${this.settings.dataToggle}`).trim().split(" ").forEach((i2) => {
|
|
437
426
|
const n = this.get(i2);
|
|
438
|
-
n.trigger =
|
|
439
|
-
}),
|
|
427
|
+
return n.trigger = s, n.toggle();
|
|
428
|
+
}), s.matches(`[data-${this.settings.dataOpen}]`) && s.getAttribute(`data-${this.settings.dataOpen}`).trim().split(" ").forEach((i2) => {
|
|
440
429
|
const n = this.get(i2);
|
|
441
|
-
n.trigger =
|
|
442
|
-
}),
|
|
430
|
+
return n.trigger = s, n.open();
|
|
431
|
+
}), s.matches(`[data-${this.settings.dataClose}]`) && s.getAttribute(`data-${this.settings.dataClose}`).trim().split(" ").forEach((i2) => {
|
|
443
432
|
if (i2) {
|
|
444
433
|
const n = this.get(i2);
|
|
445
|
-
n.trigger =
|
|
434
|
+
return n.trigger = s, n.close();
|
|
446
435
|
} else {
|
|
447
436
|
const n = t.target.closest(this.settings.selectorDrawer);
|
|
448
|
-
|
|
437
|
+
if (n)
|
|
438
|
+
return this.close(n);
|
|
449
439
|
}
|
|
450
440
|
});
|
|
451
441
|
return;
|
|
452
442
|
}
|
|
453
|
-
t.target.matches(this.settings.
|
|
443
|
+
if (this.activeModal && t.target.matches(this.settings.selectorScreen))
|
|
444
|
+
return this.close(this.activeModal.id);
|
|
454
445
|
}
|
|
455
|
-
function
|
|
456
|
-
if (t.key === "Escape")
|
|
457
|
-
|
|
458
|
-
e && this.close(e);
|
|
459
|
-
}
|
|
446
|
+
function H$1(t) {
|
|
447
|
+
if (t.key === "Escape" && this.activeModal)
|
|
448
|
+
return this.close(this.activeModal);
|
|
460
449
|
}
|
|
461
|
-
async function L$1(t,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
const i2 = this.collection[s2];
|
|
467
|
-
e && i2.state === "opened" && await i2.close(false), this.store.set(i2.id), i2.unmountBreakpoint(), Object.getOwnPropertyNames(i2).forEach((n) => {
|
|
450
|
+
async function L$1(t, s = true) {
|
|
451
|
+
const e = this.collection.findIndex((i2) => i2.id === t.id);
|
|
452
|
+
if (e >= 0) {
|
|
453
|
+
const i2 = this.collection[e];
|
|
454
|
+
s && i2.state === "opened" && await i2.close(false), this.store.set(i2.id), i2.unmountBreakpoint(), Object.getOwnPropertyNames(i2).forEach((n) => {
|
|
468
455
|
delete i2[n];
|
|
469
|
-
}), this.collection.splice(
|
|
456
|
+
}), this.collection.splice(e, 1);
|
|
470
457
|
}
|
|
471
458
|
return this.collection;
|
|
472
459
|
}
|
|
473
|
-
function
|
|
474
|
-
|
|
475
|
-
return this.settings.breakpoints && this.settings.breakpoints[s2] ? this.settings.breakpoints[s2] : getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${s2}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${e}breakpoint-${s2}`).trim() : s2;
|
|
476
|
-
}
|
|
477
|
-
function y$1(t) {
|
|
478
|
-
const e = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
479
|
-
if (e)
|
|
480
|
-
return e;
|
|
481
|
-
throw new Error(`Drawer not found in collection with id of "${t.id || t}".`);
|
|
460
|
+
function Q$1(t) {
|
|
461
|
+
t.store === "opened" ? t.open(false, false) : t.store === "closed" ? t.close(false, false) : t.store === "indeterminate" ? t.state = "indeterminate" : t.el.classList.contains(t.getSetting("stateOpened")) ? t.open(false, false) : t.el.classList.contains(t.getSetting("stateClosed")) ? t.close(false, false) : t.state = "indeterminate";
|
|
482
462
|
}
|
|
483
|
-
function
|
|
484
|
-
|
|
463
|
+
async function R$1(t) {
|
|
464
|
+
t.store === "opened" ? await t.open(false, false) : t.store === "closed" ? await t.close(false, false) : t.store === "indeterminate" ? t.state != "indeterminate" && (t.state = "indeterminate") : (t.state != t.inlineState && (t.state = t.inlineState), t.inlineState === "opened" ? await t.open(false, false) : t.inlineState === "closed" && await t.close(false, false));
|
|
485
465
|
}
|
|
486
|
-
function
|
|
487
|
-
const
|
|
488
|
-
|
|
489
|
-
const s2 = document.querySelector(`#${e}`), i2 = s2 ? s2.querySelector(this.settings.selectorDialog) : null;
|
|
490
|
-
return !s2 && !i2 ? { error: new Error(`No drawer elements found using the ID: "${e}".`) } : i2 ? { drawer: s2, dialog: i2 } : { error: new Error("Drawer is missing dialog element.") };
|
|
491
|
-
} else
|
|
492
|
-
return { error: new Error("Could not resolve the drawer ID.") };
|
|
466
|
+
function U(t) {
|
|
467
|
+
const s = y$1(), e = t.getAttribute(`data-${this.settings.dataBreakpoint}`);
|
|
468
|
+
return this.settings.breakpoints && this.settings.breakpoints[e] ? this.settings.breakpoints[e] : getComputedStyle(document.body).getPropertyValue(`--${s}breakpoint-${e}`).trim() ? getComputedStyle(document.body).getPropertyValue(`--${s}breakpoint-${e}`).trim() : e;
|
|
493
469
|
}
|
|
494
|
-
|
|
495
|
-
|
|
470
|
+
function C$1(t) {
|
|
471
|
+
const s = typeof t == "string" ? this.get(t) : this.get(t.id);
|
|
472
|
+
if (s)
|
|
473
|
+
return s;
|
|
474
|
+
throw new Error(`Drawer not found in collection with id of "${t.id || t}".`);
|
|
496
475
|
}
|
|
497
476
|
function D$2(t) {
|
|
498
477
|
t.state === "opened" ? t.mode === "modal" ? this.focusTrap.mount(t.dialog, this.settings.selectorFocus) : this.focusTrap.focus(t.dialog, this.settings.selectorFocus) : (t.trigger && (t.trigger.focus(), t.trigger = null), this.focusTrap.unmount());
|
|
499
478
|
}
|
|
500
|
-
async function
|
|
501
|
-
const i2 =
|
|
502
|
-
return
|
|
479
|
+
async function x$1(t, s, e = true) {
|
|
480
|
+
const i2 = C$1.call(this, t), n = { ...this.settings, ...i2.settings };
|
|
481
|
+
return s !== void 0 && (n.transition = s), (i2.state === "closed" || i2.state === "indeterminate") && (i2.state = "opening", n.transition ? await M$1(i2.el, {
|
|
482
|
+
start: n.stateClosing,
|
|
483
|
+
finish: n.stateClosed
|
|
484
|
+
}, {
|
|
485
|
+
start: n.stateOpening,
|
|
486
|
+
finish: n.stateOpened
|
|
487
|
+
}, n.transitionDuration) : (i2.el.classList.add(n.stateOpened), i2.el.classList.remove(n.stateClosed)), i2.state = "opened", i2.mode === "modal" && k$2(true, n), e && D$2.call(this, i2), i2.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "opened", {
|
|
503
488
|
detail: this,
|
|
504
489
|
bubbles: true
|
|
505
|
-
})), i2;
|
|
490
|
+
}))), i2;
|
|
506
491
|
}
|
|
507
|
-
async function
|
|
508
|
-
const i2 =
|
|
509
|
-
return
|
|
492
|
+
async function E$1(t, s, e = true) {
|
|
493
|
+
const i2 = C$1.call(this, t), n = { ...this.settings, ...i2.settings };
|
|
494
|
+
return s !== void 0 && (n.transition = s), (i2.state === "opened" || i2.state === "indeterminate") && (i2.state = "closing", document.activeElement.blur(), n.transition ? await M$1(i2.el, {
|
|
495
|
+
start: n.stateOpening,
|
|
496
|
+
finish: n.stateOpened
|
|
497
|
+
}, {
|
|
498
|
+
start: n.stateClosing,
|
|
499
|
+
finish: n.stateClosed
|
|
500
|
+
}, n.transitionDuration) : (i2.el.classList.add(n.stateClosed), i2.el.classList.remove(n.stateOpened)), i2.state = "closed", i2.mode === "modal" && k$2(false, n), e && D$2.call(this, i2), i2.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "closed", {
|
|
510
501
|
detail: this,
|
|
511
502
|
bubbles: true
|
|
512
503
|
}))), i2;
|
|
513
504
|
}
|
|
514
|
-
async function
|
|
515
|
-
const i2 =
|
|
516
|
-
return i2.state === "closed" ?
|
|
505
|
+
async function F$2(t, s, e) {
|
|
506
|
+
const i2 = C$1.call(this, t);
|
|
507
|
+
return i2.state === "closed" ? x$1.call(this, i2, s, e) : E$1.call(this, i2, s, e);
|
|
517
508
|
}
|
|
518
|
-
function
|
|
509
|
+
function X(t) {
|
|
519
510
|
switch (t.mode) {
|
|
520
511
|
case "inline":
|
|
521
|
-
return
|
|
512
|
+
return Y.call(this, t);
|
|
522
513
|
case "modal":
|
|
523
|
-
return
|
|
514
|
+
return Z$1.call(this, t);
|
|
524
515
|
default:
|
|
525
516
|
throw new Error(`"${t.mode}" is not a valid drawer mode.`);
|
|
526
517
|
}
|
|
527
518
|
}
|
|
528
|
-
async function
|
|
529
|
-
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), k$2(false, { ...this.settings, ...t.settings }), this.focusTrap.unmount(), await
|
|
519
|
+
async function Y(t) {
|
|
520
|
+
return t.el.classList.remove(t.getSetting("classModal")), t.dialog.removeAttribute("aria-modal"), k$2(false, { ...this.settings, ...t.settings }), this.focusTrap.unmount(), await R$1(t), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
530
521
|
detail: this,
|
|
531
522
|
bubbles: true
|
|
532
523
|
})), t;
|
|
533
524
|
}
|
|
534
|
-
async function
|
|
535
|
-
return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"),
|
|
525
|
+
async function Z$1(t) {
|
|
526
|
+
return t.el.classList.add(t.getSetting("classModal")), t.dialog.setAttribute("aria-modal", "true"), await E$1.call(this, t, false, false), t.el.dispatchEvent(new CustomEvent(t.getSetting("customEventPrefix") + "switchMode", {
|
|
536
527
|
detail: this,
|
|
537
528
|
bubbles: true
|
|
538
529
|
})), t;
|
|
539
530
|
}
|
|
540
|
-
async function
|
|
531
|
+
async function tt$1(t, s = {}) {
|
|
541
532
|
await L$1.call(this, t, false);
|
|
542
|
-
const
|
|
543
|
-
|
|
544
|
-
|
|
533
|
+
const e = this, i2 = new P$1();
|
|
534
|
+
let n, c2 = "indeterminate";
|
|
535
|
+
const r2 = {
|
|
536
|
+
id: t.id,
|
|
537
|
+
el: t,
|
|
538
|
+
dialog: null,
|
|
539
|
+
trigger: null,
|
|
540
|
+
settings: { ...V$1(t, this.settings.dataConfig), ...s },
|
|
541
|
+
inlineState: "indeterminate",
|
|
542
|
+
get breakpoint() {
|
|
543
|
+
return U.call(e, t);
|
|
545
544
|
},
|
|
546
|
-
|
|
547
|
-
return
|
|
545
|
+
get store() {
|
|
546
|
+
return e.store.get(this.id);
|
|
548
547
|
},
|
|
549
|
-
|
|
550
|
-
return
|
|
548
|
+
get mode() {
|
|
549
|
+
return n;
|
|
551
550
|
},
|
|
552
|
-
|
|
553
|
-
|
|
551
|
+
set mode(a2) {
|
|
552
|
+
n = a2, X.call(e, this);
|
|
554
553
|
},
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
return i2.mount(o2, d2), this;
|
|
554
|
+
get state() {
|
|
555
|
+
return c2;
|
|
558
556
|
},
|
|
559
|
-
|
|
560
|
-
|
|
557
|
+
set state(a2) {
|
|
558
|
+
c2 = a2, this.mode === "inline" && a2 != "opening" && a2 != "closing" && (this.inlineState = a2, this.getSetting("store") && e.store.set(this.id, a2)), a2 === "indeterminate" && (this.el.classList.remove(this.getSetting("stateOpened")), this.el.classList.remove(this.getSetting("stateOpening")), this.el.classList.remove(this.getSetting("stateClosed")), this.el.classList.remove(this.getSetting("stateClosing")));
|
|
561
559
|
},
|
|
562
|
-
|
|
563
|
-
return
|
|
560
|
+
open(a2, h2) {
|
|
561
|
+
return x$1.call(e, this, a2, h2);
|
|
564
562
|
},
|
|
565
|
-
|
|
566
|
-
return
|
|
567
|
-
}
|
|
568
|
-
}, a2 = {
|
|
569
|
-
id: t.id,
|
|
570
|
-
el: t,
|
|
571
|
-
dialog: e,
|
|
572
|
-
trigger: null,
|
|
573
|
-
settings: K$2(t, this.settings.dataConfig),
|
|
574
|
-
get breakpoint() {
|
|
575
|
-
return X.call(s2, t);
|
|
563
|
+
close(a2, h2) {
|
|
564
|
+
return E$1.call(e, this, a2, h2);
|
|
576
565
|
},
|
|
577
|
-
|
|
578
|
-
return
|
|
566
|
+
toggle(a2, h2) {
|
|
567
|
+
return F$2.call(e, this, a2, h2);
|
|
579
568
|
},
|
|
580
|
-
|
|
581
|
-
|
|
569
|
+
deregister() {
|
|
570
|
+
return L$1.call(e, this);
|
|
582
571
|
},
|
|
583
|
-
|
|
584
|
-
|
|
572
|
+
mountBreakpoint() {
|
|
573
|
+
const a2 = this.breakpoint, h2 = this.handleBreakpoint.bind(this);
|
|
574
|
+
return i2.mount(a2, h2), this;
|
|
585
575
|
},
|
|
586
|
-
|
|
587
|
-
|
|
576
|
+
unmountBreakpoint() {
|
|
577
|
+
return i2.unmount(), this;
|
|
578
|
+
},
|
|
579
|
+
handleBreakpoint(a2) {
|
|
580
|
+
const h2 = a2.matches ? "inline" : "modal";
|
|
581
|
+
return this.mode != h2 && (this.mode = h2), this;
|
|
588
582
|
},
|
|
589
|
-
|
|
583
|
+
getSetting(a2) {
|
|
584
|
+
return a2 in this.settings ? this.settings[a2] : e.settings[a2];
|
|
585
|
+
}
|
|
590
586
|
};
|
|
591
|
-
|
|
592
|
-
|
|
587
|
+
this.collection.push(r2);
|
|
588
|
+
const T2 = t.querySelector(r2.getSetting("selectorDialog"));
|
|
589
|
+
return r2.dialog = T2 || t, r2.getSetting("setTabindex") && r2.dialog.setAttribute("tabindex", "-1"), await Q$1(r2), r2.inlineState = r2.state, r2.mode = t.classList.contains(r2.getSetting("classModal")) ? "modal" : "inline", r2.breakpoint && r2.mountBreakpoint(), r2;
|
|
593
590
|
}
|
|
594
|
-
var
|
|
595
|
-
let
|
|
596
|
-
constructor(
|
|
591
|
+
var m$1, p$1;
|
|
592
|
+
let st$1 = class st extends A$1 {
|
|
593
|
+
constructor(e) {
|
|
597
594
|
super();
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
this.defaults =
|
|
595
|
+
$$1(this, m$1, void 0);
|
|
596
|
+
$$1(this, p$1, void 0);
|
|
597
|
+
this.defaults = z$1, this.settings = { ...this.defaults, ...e }, this.focusTrap = new j$2(), this.store = W$1(this.settings.storeKey, this.settings.store), S$2(this, m$1, G$1.bind(this)), S$2(this, p$1, H$1.bind(this)), this.settings.autoInit && this.init();
|
|
601
598
|
}
|
|
602
599
|
get activeModal() {
|
|
603
|
-
return this.collection.find((
|
|
600
|
+
return this.collection.find((e) => e.state === "opened" && e.mode === "modal");
|
|
604
601
|
}
|
|
605
|
-
async init(
|
|
606
|
-
|
|
602
|
+
async init(e = null) {
|
|
603
|
+
e && (this.settings = { ...this.settings, ...e });
|
|
607
604
|
const i2 = document.querySelectorAll(this.settings.selectorDrawer);
|
|
608
605
|
return await this.registerCollection(i2), this.settings.eventListeners && this.initEventListeners(), this;
|
|
609
606
|
}
|
|
@@ -611,67 +608,67 @@
|
|
|
611
608
|
return await this.deregisterCollection(), this.settings.eventListeners && this.destroyEventListeners(), this;
|
|
612
609
|
}
|
|
613
610
|
initEventListeners() {
|
|
614
|
-
document.addEventListener("click",
|
|
611
|
+
document.addEventListener("click", b$1(this, m$1), false), document.addEventListener("keydown", b$1(this, p$1), false);
|
|
615
612
|
}
|
|
616
613
|
destroyEventListeners() {
|
|
617
|
-
document.removeEventListener("click",
|
|
614
|
+
document.removeEventListener("click", b$1(this, m$1), false), document.removeEventListener("keydown", b$1(this, p$1), false);
|
|
618
615
|
}
|
|
619
|
-
register(
|
|
620
|
-
|
|
621
|
-
return
|
|
616
|
+
register(e, i2 = {}) {
|
|
617
|
+
let n = typeof e == "string" ? document.getElementById(e) : e;
|
|
618
|
+
return n ? tt$1.call(this, n, i2) : Promise.reject(new Error(`Failed to register; drawer not found with ID of: "${e.id || e}".`));
|
|
622
619
|
}
|
|
623
|
-
deregister(
|
|
624
|
-
|
|
625
|
-
return L$1.call(this, i2);
|
|
620
|
+
deregister(e) {
|
|
621
|
+
let i2 = this.get(e.id || e);
|
|
622
|
+
return i2 ? L$1.call(this, i2) : Promise.reject(new Error(`Failed to deregister; drawer does not exist in collection with ID of: "${e.id || e}".`));
|
|
626
623
|
}
|
|
627
|
-
open(
|
|
628
|
-
return
|
|
624
|
+
open(e, i2, n) {
|
|
625
|
+
return x$1.call(this, e, i2, n);
|
|
629
626
|
}
|
|
630
|
-
close(
|
|
631
|
-
return
|
|
627
|
+
close(e, i2, n) {
|
|
628
|
+
return E$1.call(this, e, i2, n);
|
|
632
629
|
}
|
|
633
|
-
toggle(
|
|
634
|
-
return
|
|
630
|
+
toggle(e, i2, n) {
|
|
631
|
+
return F$2.call(this, e, i2, n);
|
|
635
632
|
}
|
|
636
633
|
};
|
|
637
|
-
|
|
638
|
-
var I$1 = (
|
|
639
|
-
if (!
|
|
640
|
-
throw TypeError("Cannot " +
|
|
634
|
+
m$1 = /* @__PURE__ */ new WeakMap(), p$1 = /* @__PURE__ */ new WeakMap();
|
|
635
|
+
var I$1 = (i2, s, t) => {
|
|
636
|
+
if (!s.has(i2))
|
|
637
|
+
throw TypeError("Cannot " + t);
|
|
641
638
|
};
|
|
642
|
-
var f = (
|
|
643
|
-
if (
|
|
639
|
+
var f = (i2, s, t) => (I$1(i2, s, "read from private field"), t ? t.call(i2) : s.get(i2)), m = (i2, s, t) => {
|
|
640
|
+
if (s.has(i2))
|
|
644
641
|
throw TypeError("Cannot add the same private member more than once");
|
|
645
|
-
|
|
646
|
-
},
|
|
647
|
-
var
|
|
648
|
-
if (!
|
|
649
|
-
throw TypeError("Cannot " +
|
|
650
|
-
},
|
|
651
|
-
if (
|
|
642
|
+
s instanceof WeakSet ? s.add(i2) : s.set(i2, t);
|
|
643
|
+
}, v = (i2, s, t, e) => (I$1(i2, s, "write to private field"), e ? e.call(i2, t) : s.set(i2, t), t);
|
|
644
|
+
var T$1 = (i2, s, t) => {
|
|
645
|
+
if (!s.has(i2))
|
|
646
|
+
throw TypeError("Cannot " + t);
|
|
647
|
+
}, a = (i2, s, t) => (T$1(i2, s, "read from private field"), t ? t.call(i2) : s.get(i2)), b = (i2, s, t) => {
|
|
648
|
+
if (s.has(i2))
|
|
652
649
|
throw TypeError("Cannot add the same private member more than once");
|
|
653
|
-
|
|
654
|
-
},
|
|
655
|
-
class
|
|
650
|
+
s instanceof WeakSet ? s.add(i2) : s.set(i2, t);
|
|
651
|
+
}, y = (i2, s, t, e) => (T$1(i2, s, "write to private field"), e ? e.call(i2, t) : s.set(i2, t), t);
|
|
652
|
+
class O {
|
|
656
653
|
constructor() {
|
|
657
654
|
this.collection = [];
|
|
658
655
|
}
|
|
659
|
-
async register(
|
|
660
|
-
return await this.deregister(
|
|
656
|
+
async register(s) {
|
|
657
|
+
return await this.deregister(s), this.collection.push(s), this.collection;
|
|
661
658
|
}
|
|
662
|
-
async deregister(
|
|
663
|
-
const
|
|
664
|
-
if (
|
|
665
|
-
const
|
|
666
|
-
Object.getOwnPropertyNames(
|
|
667
|
-
delete
|
|
668
|
-
}), this.collection.splice(
|
|
659
|
+
async deregister(s) {
|
|
660
|
+
const t = this.collection.findIndex((e) => e === s);
|
|
661
|
+
if (t >= 0) {
|
|
662
|
+
const e = this.collection[t];
|
|
663
|
+
Object.getOwnPropertyNames(e).forEach((n) => {
|
|
664
|
+
delete e[n];
|
|
665
|
+
}), this.collection.splice(t, 1);
|
|
669
666
|
}
|
|
670
667
|
return this.collection;
|
|
671
668
|
}
|
|
672
|
-
async registerCollection(
|
|
673
|
-
return await Promise.all(Array.from(
|
|
674
|
-
this.register(
|
|
669
|
+
async registerCollection(s) {
|
|
670
|
+
return await Promise.all(Array.from(s, (t) => {
|
|
671
|
+
this.register(t);
|
|
675
672
|
})), this.collection;
|
|
676
673
|
}
|
|
677
674
|
async deregisterCollection() {
|
|
@@ -679,42 +676,42 @@
|
|
|
679
676
|
await this.deregister(this.collection[0]);
|
|
680
677
|
return this.collection;
|
|
681
678
|
}
|
|
682
|
-
get(
|
|
683
|
-
return this.collection.find((
|
|
679
|
+
get(s, t = "id") {
|
|
680
|
+
return this.collection.find((e) => e[t] === s);
|
|
684
681
|
}
|
|
685
682
|
}
|
|
686
|
-
const
|
|
683
|
+
const o = {
|
|
687
684
|
inert: ":not([inert]):not([inert] *)",
|
|
688
685
|
negTabIndex: ':not([tabindex^="-"])',
|
|
689
686
|
disabled: ":not(:disabled)"
|
|
690
|
-
},
|
|
691
|
-
`a[href]${
|
|
692
|
-
`area[href]${
|
|
693
|
-
`input:not([type="hidden"]):not([type="radio"])${
|
|
694
|
-
`input[type="radio"]${
|
|
695
|
-
`select${
|
|
696
|
-
`textarea${
|
|
697
|
-
`button${
|
|
698
|
-
`details${
|
|
687
|
+
}, A = [
|
|
688
|
+
`a[href]${o.inert}${o.negTabIndex}`,
|
|
689
|
+
`area[href]${o.inert}${o.negTabIndex}`,
|
|
690
|
+
`input:not([type="hidden"]):not([type="radio"])${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
691
|
+
`input[type="radio"]${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
692
|
+
`select${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
693
|
+
`textarea${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
694
|
+
`button${o.inert}${o.negTabIndex}${o.disabled}`,
|
|
695
|
+
`details${o.inert} > summary:first-of-type${o.negTabIndex}`,
|
|
699
696
|
// Discard until Firefox supports `:has()`
|
|
700
697
|
// See: https://github.com/KittyGiraudel/focusable-selectors/issues/12
|
|
701
698
|
// `details:not(:has(> summary))${not.inert}${not.negTabIndex}`,
|
|
702
|
-
`iframe${
|
|
703
|
-
`audio[controls]${
|
|
704
|
-
`video[controls]${
|
|
705
|
-
`[contenteditable]${
|
|
706
|
-
`[tabindex]${
|
|
699
|
+
`iframe${o.inert}${o.negTabIndex}`,
|
|
700
|
+
`audio[controls]${o.inert}${o.negTabIndex}`,
|
|
701
|
+
`video[controls]${o.inert}${o.negTabIndex}`,
|
|
702
|
+
`[contenteditable]${o.inert}${o.negTabIndex}`,
|
|
703
|
+
`[tabindex]${o.inert}${o.negTabIndex}`
|
|
707
704
|
];
|
|
708
705
|
var g, c, d;
|
|
709
|
-
|
|
710
|
-
constructor(
|
|
711
|
-
|
|
706
|
+
class M {
|
|
707
|
+
constructor(s = null, t = "[data-focus]") {
|
|
708
|
+
b(this, g, void 0), b(this, c, void 0), b(this, d, void 0), this.el = s, this.selectorFocus = t, y(this, c, P.bind(this)), y(this, d, R.bind(this));
|
|
712
709
|
}
|
|
713
710
|
get focusable() {
|
|
714
|
-
return
|
|
711
|
+
return a(this, g);
|
|
715
712
|
}
|
|
716
|
-
set focusable(
|
|
717
|
-
|
|
713
|
+
set focusable(s) {
|
|
714
|
+
y(this, g, s), a(this, g).length ? (document.removeEventListener("keydown", a(this, d)), document.addEventListener("keydown", a(this, c))) : (document.removeEventListener("keydown", a(this, c)), document.addEventListener("keydown", a(this, d)));
|
|
718
715
|
}
|
|
719
716
|
get focusableFirst() {
|
|
720
717
|
return this.focusable[0];
|
|
@@ -722,63 +719,78 @@
|
|
|
722
719
|
get focusableLast() {
|
|
723
720
|
return this.focusable[this.focusable.length - 1];
|
|
724
721
|
}
|
|
725
|
-
mount(
|
|
726
|
-
|
|
722
|
+
mount(s, t) {
|
|
723
|
+
s && (this.el = s), t && (this.selectorFocus = t), this.focusable = this.getFocusable(), this.focus();
|
|
727
724
|
}
|
|
728
725
|
unmount() {
|
|
729
|
-
this.el = null, this.focusable = [], document.removeEventListener("keydown",
|
|
726
|
+
this.el = null, this.focusable = [], document.removeEventListener("keydown", a(this, c)), document.removeEventListener("keydown", a(this, d));
|
|
730
727
|
}
|
|
731
|
-
focus(
|
|
732
|
-
(
|
|
728
|
+
focus(s = this.el, t = this.selectorFocus) {
|
|
729
|
+
(s.querySelector(t) || s).focus();
|
|
733
730
|
}
|
|
734
|
-
getFocusable(
|
|
735
|
-
const
|
|
736
|
-
return
|
|
737
|
-
|
|
738
|
-
}),
|
|
731
|
+
getFocusable(s = this.el) {
|
|
732
|
+
const t = [], e = document.activeElement, n = s.scrollTop;
|
|
733
|
+
return s.querySelectorAll(A.join(",")).forEach((r2) => {
|
|
734
|
+
r2.focus(), document.activeElement === r2 && t.push(r2);
|
|
735
|
+
}), s.scrollTop = n, e.focus(), t;
|
|
739
736
|
}
|
|
740
|
-
}
|
|
737
|
+
}
|
|
741
738
|
g = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(), d = /* @__PURE__ */ new WeakMap();
|
|
742
|
-
function
|
|
743
|
-
(
|
|
744
|
-
}
|
|
745
|
-
function
|
|
746
|
-
(
|
|
747
|
-
}
|
|
748
|
-
function
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
t
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
739
|
+
function P(i2) {
|
|
740
|
+
(i2.key === "Tab" || i2.keyCode === 9) && (i2.shiftKey ? (document.activeElement === this.focusableFirst || document.activeElement === this.el) && (i2.preventDefault(), this.focusableLast.focus()) : (document.activeElement === this.focusableLast || document.activeElement === this.el) && (i2.preventDefault(), this.focusableFirst.focus()));
|
|
741
|
+
}
|
|
742
|
+
function R(i2) {
|
|
743
|
+
(i2.key === "Tab" || i2.keyCode === 9) && i2.preventDefault();
|
|
744
|
+
}
|
|
745
|
+
function F$1() {
|
|
746
|
+
return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim();
|
|
747
|
+
}
|
|
748
|
+
function D$1(i2, s = document.body, t = true) {
|
|
749
|
+
if (t) {
|
|
750
|
+
const n = F$1();
|
|
751
|
+
n && !i2.includes(`--${n}`) && (i2 = i2.replace("--", `--${n}`));
|
|
752
|
+
}
|
|
753
|
+
const e = getComputedStyle(s).getPropertyValue(i2).trim();
|
|
754
|
+
if (e)
|
|
755
|
+
return e;
|
|
756
|
+
throw new Error(`CSS variable "${i2}" was not found!`);
|
|
757
|
+
}
|
|
758
|
+
function N$1(i2, s) {
|
|
759
|
+
const t = (i2.getAttribute(`data-${s}`) || "").replace(/'/g, '"');
|
|
760
|
+
return t ? JSON.parse(t) : {};
|
|
761
|
+
}
|
|
762
|
+
function L(i2, s, t) {
|
|
763
|
+
const e = s.nodeType === Node.COMMENT_NODE, n = s.nodeType === Node.ELEMENT_NODE;
|
|
764
|
+
if (s = e || n ? s : document.querySelector(s), e && (t = "after"), !s)
|
|
765
|
+
throw new Error(`Not a valid teleport reference: '${s}'`);
|
|
766
|
+
if (typeof s[t] != "function")
|
|
767
|
+
throw new Error(`Not a valid teleport method: '${t}'`);
|
|
768
|
+
let r2 = null;
|
|
769
|
+
return e || (r2 = document.createComment("teleported #" + i2.id), i2.before(r2)), s[t](i2), e && s.remove(), r2;
|
|
770
|
+
}
|
|
771
|
+
function S$1(i2, s, t, e = "--transition-duration") {
|
|
772
|
+
return new Promise((n) => {
|
|
773
|
+
if (typeof e == "string") {
|
|
774
|
+
const r2 = D$1(e, i2), l2 = !!r2.includes("ms");
|
|
775
|
+
e = parseFloat(r2) * (l2 ? 1 : 1e3);
|
|
776
|
+
}
|
|
777
|
+
i2.classList.remove(s.finish), i2.classList.add(t.start), setTimeout(() => {
|
|
778
|
+
i2.classList.add(t.finish), i2.classList.remove(t.start), n(i2);
|
|
779
|
+
}, e);
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
function z(i2, s) {
|
|
783
|
+
s && document.querySelectorAll(s).forEach((t) => {
|
|
784
|
+
i2 ? t.style.overflow = "hidden" : t.style.removeProperty("overflow");
|
|
773
785
|
});
|
|
774
786
|
}
|
|
775
|
-
function
|
|
776
|
-
|
|
777
|
-
|
|
787
|
+
function j$1(i2, s) {
|
|
788
|
+
s && document.querySelectorAll(s).forEach((t) => {
|
|
789
|
+
i2 ? (t.inert = true, t.setAttribute("aria-hidden", true)) : (t.inert = null, t.removeAttribute("aria-hidden"));
|
|
778
790
|
});
|
|
779
791
|
}
|
|
780
|
-
function W(
|
|
781
|
-
|
|
792
|
+
function W(i2, s) {
|
|
793
|
+
j$1(!!i2, s.selectorInert), z(!!i2, s.selectorOverflow);
|
|
782
794
|
}
|
|
783
795
|
const _$1 = {
|
|
784
796
|
autoInit: false,
|
|
@@ -790,6 +802,7 @@
|
|
|
790
802
|
// Selectors
|
|
791
803
|
selectorModal: ".modal",
|
|
792
804
|
selectorDialog: ".modal__dialog",
|
|
805
|
+
selectorScreen: ".modal",
|
|
793
806
|
selectorRequired: '[role="alertdialog"]',
|
|
794
807
|
selectorFocus: "[data-focus]",
|
|
795
808
|
selectorInert: null,
|
|
@@ -805,175 +818,182 @@
|
|
|
805
818
|
teleport: null,
|
|
806
819
|
teleportMethod: "append",
|
|
807
820
|
setTabindex: true,
|
|
808
|
-
transition: true
|
|
821
|
+
transition: true,
|
|
822
|
+
transitionDuration: "--vb-modal-transition-duration"
|
|
809
823
|
};
|
|
810
|
-
function
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
}
|
|
830
|
-
async function K$1(e) {
|
|
831
|
-
let t = e.target.closest(
|
|
832
|
-
`[data-${this.settings.dataOpen}], [data-${this.settings.dataReplace}]`
|
|
833
|
-
);
|
|
834
|
-
if (t) {
|
|
835
|
-
e.preventDefault(), e.target.closest(this.settings.selectorModal) || (this.trigger = t);
|
|
836
|
-
const i2 = this.get(p.call(this, t));
|
|
837
|
-
return t.matches(`[data-${this.settings.dataOpen}]`) ? i2.open() : i2.replace();
|
|
838
|
-
}
|
|
839
|
-
if (t = e.target.closest(`[data-${this.settings.dataClose}]`), t) {
|
|
840
|
-
e.preventDefault();
|
|
841
|
-
const s2 = t.getAttribute(`data-${this.settings.dataClose}`);
|
|
842
|
-
return s2 === "*" ? this.closeAll() : this.close(s2);
|
|
824
|
+
async function G(i2) {
|
|
825
|
+
const s = i2.target.closest(`
|
|
826
|
+
[data-${this.settings.dataOpen}],
|
|
827
|
+
[data-${this.settings.dataReplace}],
|
|
828
|
+
[data-${this.settings.dataClose}]
|
|
829
|
+
`);
|
|
830
|
+
if (s) {
|
|
831
|
+
if (i2.preventDefault(), s.matches(`[data-${this.settings.dataOpen}]`)) {
|
|
832
|
+
const t = s.getAttribute(`data-${this.settings.dataOpen}`).trim(), e = this.get(t);
|
|
833
|
+
return i2.target.closest(this.settings.selectorModal) || (this.trigger = s), e.open();
|
|
834
|
+
}
|
|
835
|
+
if (s.matches(`[data-${this.settings.dataReplace}]`)) {
|
|
836
|
+
const t = s.getAttribute(`data-${this.settings.dataReplace}`).trim(), e = this.get(t);
|
|
837
|
+
return i2.target.closest(this.settings.selectorModal) || (this.trigger = s), e.replace();
|
|
838
|
+
}
|
|
839
|
+
if (s.matches(`[data-${this.settings.dataClose}]`)) {
|
|
840
|
+
const t = s.getAttribute(`data-${this.settings.dataClose}`).trim();
|
|
841
|
+
return t === "*" ? this.closeAll() : this.close(t);
|
|
842
|
+
}
|
|
843
843
|
}
|
|
844
|
-
if (
|
|
845
|
-
return this.close(
|
|
844
|
+
if (this.active && i2.target.matches(this.settings.selectorScreen) && !this.active.required)
|
|
845
|
+
return this.close(this.active.id);
|
|
846
846
|
}
|
|
847
|
-
function
|
|
848
|
-
if (
|
|
847
|
+
function K$1(i2) {
|
|
848
|
+
if (i2.key === "Escape" && this.active && !this.active.dialog.matches(this.settings.selectorRequired))
|
|
849
849
|
return this.close();
|
|
850
850
|
}
|
|
851
|
-
async function w(
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
delete i2[n];
|
|
859
|
-
}), this.collection.splice(s2, 1);
|
|
851
|
+
async function w(i2, s = true) {
|
|
852
|
+
const t = this.collection.findIndex((e) => e.id === i2.id);
|
|
853
|
+
if (t >= 0) {
|
|
854
|
+
const e = this.collection[t];
|
|
855
|
+
s && e.state === "opened" ? await e.close(false) : this.stack.remove(e), e.getSetting("teleport") && e.teleportReturn(), Object.getOwnPropertyNames(e).forEach((n) => {
|
|
856
|
+
delete e[n];
|
|
857
|
+
}), this.collection.splice(t, 1);
|
|
860
858
|
}
|
|
861
859
|
return this.collection;
|
|
862
860
|
}
|
|
863
|
-
|
|
864
|
-
const
|
|
865
|
-
|
|
861
|
+
function $(i2) {
|
|
862
|
+
const s = typeof i2 == "string" ? this.get(i2) : this.get(i2.id);
|
|
863
|
+
if (s)
|
|
864
|
+
return s;
|
|
865
|
+
throw new Error(`Modal not found in collection with id of "${i2.id || i2}".`);
|
|
866
|
+
}
|
|
867
|
+
function p() {
|
|
868
|
+
this.active ? this.focusTrap.mount(this.active.dialog, this.settings.selectorFocus) : (this.trigger && (this.trigger.focus(), this.trigger = null), this.focusTrap.unmount());
|
|
869
|
+
}
|
|
870
|
+
async function x(i2, s, t = true) {
|
|
871
|
+
const e = $.call(this, i2), n = { ...this.settings, ...e.settings };
|
|
872
|
+
return s !== void 0 && (n.transition = s), this.stack.moveToTop(e), e.state === "closed" && (e.state = "opening", this.stack.add(e), n.transition ? await S$1(e.el, {
|
|
873
|
+
start: n.stateClosing,
|
|
874
|
+
finish: n.stateClosed
|
|
875
|
+
}, {
|
|
876
|
+
start: n.stateOpening,
|
|
877
|
+
finish: n.stateOpened
|
|
878
|
+
}, n.transitionDuration) : (e.el.classList.add(n.stateOpened), e.el.classList.remove(n.stateClosed)), e.state = "opened"), t && p.call(this), e.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "opened", {
|
|
866
879
|
detail: this,
|
|
867
880
|
bubbles: true
|
|
868
|
-
})),
|
|
869
|
-
}
|
|
870
|
-
async function C(
|
|
871
|
-
const
|
|
872
|
-
if (
|
|
873
|
-
|
|
874
|
-
const n = { ...this.settings, ...
|
|
875
|
-
|
|
881
|
+
})), e;
|
|
882
|
+
}
|
|
883
|
+
async function C(i2, s, t = true) {
|
|
884
|
+
const e = i2 ? $.call(this, i2) : this.active;
|
|
885
|
+
if (e && e.state === "opened") {
|
|
886
|
+
e.state = "closing";
|
|
887
|
+
const n = { ...this.settings, ...e.settings };
|
|
888
|
+
s !== void 0 && (n.transition = s), document.activeElement.blur(), n.transition ? await S$1(e.el, {
|
|
889
|
+
start: n.stateOpening,
|
|
890
|
+
finish: n.stateOpened
|
|
891
|
+
}, {
|
|
892
|
+
start: n.stateClosing,
|
|
893
|
+
finish: n.stateClosed
|
|
894
|
+
}, n.transitionDuration) : (e.el.classList.add(n.stateClosed), e.el.classList.remove(n.stateOpened)), this.stack.remove(e), e.state = "closed", t && p.call(this), e.el.dispatchEvent(new CustomEvent(n.customEventPrefix + "closed", {
|
|
876
895
|
detail: this,
|
|
877
896
|
bubbles: true
|
|
878
897
|
}));
|
|
879
898
|
}
|
|
880
|
-
return
|
|
899
|
+
return e;
|
|
881
900
|
}
|
|
882
|
-
async function
|
|
883
|
-
const
|
|
884
|
-
return await Promise.all(this.stack.value.map(async (
|
|
885
|
-
|
|
886
|
-
})),
|
|
887
|
-
}
|
|
888
|
-
async function
|
|
889
|
-
const
|
|
890
|
-
let n,
|
|
891
|
-
return
|
|
892
|
-
}
|
|
893
|
-
async function
|
|
894
|
-
await w.call(this,
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
901
|
+
async function E(i2, s) {
|
|
902
|
+
const t = [];
|
|
903
|
+
return await Promise.all(this.stack.value.map(async (e) => {
|
|
904
|
+
i2 && i2 === e.id ? Promise.resolve() : t.push(await C.call(this, e, s, false)), e.trigger = null;
|
|
905
|
+
})), t;
|
|
906
|
+
}
|
|
907
|
+
async function k$1(i2, s, t = true) {
|
|
908
|
+
const e = $.call(this, i2);
|
|
909
|
+
let n, r2;
|
|
910
|
+
return e.state === "opened" ? (n = e, r2 = await E.call(this, e.id, s)) : (r2 = E.call(this, false, s), n = x.call(this, e, s, false), await Promise.all([n, r2])), t && p.call(this), { opened: n, closed: r2 };
|
|
911
|
+
}
|
|
912
|
+
async function V(i2, s = {}) {
|
|
913
|
+
await w.call(this, i2, false);
|
|
914
|
+
const t = this, e = {
|
|
915
|
+
id: i2.id,
|
|
916
|
+
state: "closed",
|
|
917
|
+
el: i2,
|
|
918
|
+
dialog: null,
|
|
919
|
+
get required() {
|
|
920
|
+
return this.dialog.matches(this.getSetting("selectorRequired"));
|
|
898
921
|
},
|
|
899
|
-
|
|
900
|
-
|
|
922
|
+
returnRef: null,
|
|
923
|
+
settings: { ...N$1(i2, this.settings.dataConfig), ...s },
|
|
924
|
+
open(r2, l2) {
|
|
925
|
+
return x.call(t, this, r2, l2);
|
|
926
|
+
},
|
|
927
|
+
close(r2, l2) {
|
|
928
|
+
return C.call(t, this, r2, l2);
|
|
901
929
|
},
|
|
902
|
-
replace(
|
|
903
|
-
return
|
|
930
|
+
replace(r2, l2) {
|
|
931
|
+
return k$1.call(t, this, r2, l2);
|
|
904
932
|
},
|
|
905
933
|
deregister() {
|
|
906
|
-
return w.call(
|
|
934
|
+
return w.call(t, this);
|
|
907
935
|
},
|
|
908
|
-
teleport(
|
|
909
|
-
return this.returnRef ? (console.error("Element has already been teleported:", this.el), false) : (this.returnRef =
|
|
936
|
+
teleport(r2 = this.getSetting("teleport"), l2 = this.getSetting("teleportMethod")) {
|
|
937
|
+
return this.returnRef ? (console.error("Element has already been teleported:", this.el), false) : (this.returnRef = L(this.el, r2, l2), this.el);
|
|
910
938
|
},
|
|
911
939
|
teleportReturn() {
|
|
912
|
-
return this.returnRef ? (this.returnRef =
|
|
940
|
+
return this.returnRef ? (this.returnRef = L(this.el, this.returnRef), this.el) : (console.error("No return reference found:", this.el), false);
|
|
913
941
|
},
|
|
914
|
-
getSetting(
|
|
915
|
-
return
|
|
942
|
+
getSetting(r2) {
|
|
943
|
+
return r2 in this.settings ? this.settings[r2] : t.settings[r2];
|
|
916
944
|
}
|
|
917
|
-
}, n =
|
|
918
|
-
|
|
919
|
-
state: "closed",
|
|
920
|
-
el: e,
|
|
921
|
-
dialog: t,
|
|
922
|
-
returnRef: null,
|
|
923
|
-
settings: P(e, this.settings.dataConfig),
|
|
924
|
-
...i2
|
|
925
|
-
};
|
|
926
|
-
return n.dialog.setAttribute("aria-modal", "true"), n.dialog.hasAttribute("role") || n.dialog.setAttribute("role", "dialog"), n.getSetting("setTabindex") && n.dialog.setAttribute("tabindex", "-1"), n.getSetting("teleport") && n.teleport(), this.collection.push(n), n.el.classList.contains(this.settings.stateOpened) ? await n.open(false) : (n.el.classList.remove(this.settings.stateOpening), n.el.classList.remove(this.settings.stateClosing), n.el.classList.add(this.settings.stateClosed)), n;
|
|
945
|
+
}, n = i2.querySelector(e.getSetting("selectorDialog"));
|
|
946
|
+
return e.dialog = n || i2, e.dialog.setAttribute("aria-modal", "true"), e.dialog.hasAttribute("role") || e.dialog.setAttribute("role", "dialog"), e.getSetting("setTabindex") && e.dialog.setAttribute("tabindex", "-1"), e.getSetting("teleport") && e.teleport(), this.collection.push(e), e.el.classList.contains(this.settings.stateOpened) ? await e.open(false) : (e.el.classList.remove(this.settings.stateOpening), e.el.classList.remove(this.settings.stateClosing), e.el.classList.add(this.settings.stateClosed)), e;
|
|
927
947
|
}
|
|
928
|
-
function
|
|
929
|
-
const
|
|
948
|
+
function q(i2) {
|
|
949
|
+
const s = [];
|
|
930
950
|
return {
|
|
931
951
|
get value() {
|
|
932
|
-
return [...
|
|
952
|
+
return [...s];
|
|
933
953
|
},
|
|
934
954
|
get top() {
|
|
935
|
-
return
|
|
955
|
+
return s[s.length - 1];
|
|
936
956
|
},
|
|
937
957
|
updateIndex() {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
const n = getComputedStyle(
|
|
941
|
-
|
|
958
|
+
s.forEach((t, e) => {
|
|
959
|
+
t.el.style.zIndex = null;
|
|
960
|
+
const n = getComputedStyle(t.el)["z-index"];
|
|
961
|
+
t.el.style.zIndex = parseInt(n) + e + 1;
|
|
942
962
|
});
|
|
943
963
|
},
|
|
944
964
|
updateGlobalState() {
|
|
945
|
-
W(this.top,
|
|
965
|
+
W(this.top, i2), this.updateIndex();
|
|
946
966
|
},
|
|
947
|
-
add(
|
|
948
|
-
|
|
949
|
-
const
|
|
950
|
-
|
|
967
|
+
add(t) {
|
|
968
|
+
t.el.style.zIndex = null;
|
|
969
|
+
const e = getComputedStyle(t.el)["z-index"];
|
|
970
|
+
t.el.style.zIndex = parseInt(e) + s.length + 1, s.push(t), this.updateGlobalState();
|
|
951
971
|
},
|
|
952
|
-
remove(
|
|
953
|
-
const
|
|
954
|
-
|
|
972
|
+
remove(t) {
|
|
973
|
+
const e = s.findIndex((n) => n.id === t.id);
|
|
974
|
+
e >= 0 && (t.el.style.zIndex = null, s.splice(e, 1), this.updateGlobalState());
|
|
955
975
|
},
|
|
956
|
-
moveToTop(
|
|
957
|
-
const
|
|
958
|
-
|
|
976
|
+
moveToTop(t) {
|
|
977
|
+
const e = s.findIndex((n) => n.id === t.id);
|
|
978
|
+
e >= 0 && (s.splice(e, 1), this.add(t));
|
|
959
979
|
}
|
|
960
980
|
};
|
|
961
981
|
}
|
|
962
982
|
var u, h;
|
|
963
|
-
class
|
|
964
|
-
constructor(
|
|
983
|
+
let J$1 = class J extends O {
|
|
984
|
+
constructor(t) {
|
|
965
985
|
super();
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
this.defaults = _$1, this.settings = { ...this.defaults, ...
|
|
986
|
+
m(this, u, void 0);
|
|
987
|
+
m(this, h, void 0);
|
|
988
|
+
this.defaults = _$1, this.settings = { ...this.defaults, ...t }, this.trigger = null, this.focusTrap = new M(), this.stack = q(this.settings), v(this, u, G.bind(this)), v(this, h, K$1.bind(this)), this.settings.autoInit && this.init();
|
|
969
989
|
}
|
|
970
990
|
get active() {
|
|
971
991
|
return this.stack.top;
|
|
972
992
|
}
|
|
973
|
-
async init(
|
|
974
|
-
|
|
975
|
-
const
|
|
976
|
-
return await this.registerCollection(
|
|
993
|
+
async init(t) {
|
|
994
|
+
t && (this.settings = { ...this.settings, ...t });
|
|
995
|
+
const e = document.querySelectorAll(this.settings.selectorModal);
|
|
996
|
+
return await this.registerCollection(e), this.settings.eventListeners && this.initEventListeners(), this;
|
|
977
997
|
}
|
|
978
998
|
async destroy() {
|
|
979
999
|
return this.trigger = null, await this.deregisterCollection(), this.settings.eventListeners && this.destroyEventListeners(), this;
|
|
@@ -984,28 +1004,28 @@
|
|
|
984
1004
|
destroyEventListeners() {
|
|
985
1005
|
document.removeEventListener("click", f(this, u), false), document.removeEventListener("keydown", f(this, h), false);
|
|
986
1006
|
}
|
|
987
|
-
register(
|
|
988
|
-
|
|
989
|
-
return
|
|
1007
|
+
register(t, e = {}) {
|
|
1008
|
+
let n = typeof t == "string" ? document.getElementById(t) : t;
|
|
1009
|
+
return n ? V.call(this, n, e) : Promise.reject(new Error(`Failed to register; modal not found with ID of: "${t.id || t}".`));
|
|
990
1010
|
}
|
|
991
|
-
deregister(
|
|
992
|
-
|
|
993
|
-
return w.call(this,
|
|
1011
|
+
deregister(t) {
|
|
1012
|
+
let e = this.get(t.id || t);
|
|
1013
|
+
return e ? w.call(this, e) : Promise.reject(new Error(`Failed to deregister; modal does not exist in collection with ID of: "${t.id || t}".`));
|
|
994
1014
|
}
|
|
995
|
-
open(
|
|
996
|
-
return x.call(this,
|
|
1015
|
+
open(t, e, n) {
|
|
1016
|
+
return x.call(this, t, e, n);
|
|
997
1017
|
}
|
|
998
|
-
close(
|
|
999
|
-
return C.call(this,
|
|
1018
|
+
close(t, e, n) {
|
|
1019
|
+
return C.call(this, t, e, n);
|
|
1000
1020
|
}
|
|
1001
|
-
replace(
|
|
1002
|
-
return
|
|
1021
|
+
replace(t, e, n) {
|
|
1022
|
+
return k$1.call(this, t, e, n);
|
|
1003
1023
|
}
|
|
1004
|
-
async closeAll(
|
|
1005
|
-
const
|
|
1006
|
-
return n &&
|
|
1024
|
+
async closeAll(t = false, e, n = true) {
|
|
1025
|
+
const r2 = await E.call(this, t, e);
|
|
1026
|
+
return n && p.call(this), r2;
|
|
1007
1027
|
}
|
|
1008
|
-
}
|
|
1028
|
+
};
|
|
1009
1029
|
u = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakMap();
|
|
1010
1030
|
var Ue = (e, t, r2) => {
|
|
1011
1031
|
if (!t.has(e))
|
|
@@ -1016,7 +1036,7 @@
|
|
|
1016
1036
|
throw TypeError("Cannot add the same private member more than once");
|
|
1017
1037
|
t instanceof WeakSet ? t.add(e) : t.set(e, r2);
|
|
1018
1038
|
}, Ke = (e, t, r2, i2) => (Ue(e, t, "write to private field"), i2 ? i2.call(e, r2) : t.set(e, r2), r2);
|
|
1019
|
-
class
|
|
1039
|
+
class $t {
|
|
1020
1040
|
constructor() {
|
|
1021
1041
|
this.collection = [];
|
|
1022
1042
|
}
|
|
@@ -1047,10 +1067,10 @@
|
|
|
1047
1067
|
return this.collection.find((i2) => i2[r2] === t);
|
|
1048
1068
|
}
|
|
1049
1069
|
}
|
|
1050
|
-
function
|
|
1051
|
-
return getComputedStyle(document.body).getPropertyValue("--vrembem-
|
|
1070
|
+
function Ct() {
|
|
1071
|
+
return getComputedStyle(document.body).getPropertyValue("--vrembem-prefix").trim();
|
|
1052
1072
|
}
|
|
1053
|
-
const
|
|
1073
|
+
const kt = {
|
|
1054
1074
|
autoInit: false,
|
|
1055
1075
|
// Selectors
|
|
1056
1076
|
selectorPopover: ".popover",
|
|
@@ -1073,7 +1093,7 @@
|
|
|
1073
1093
|
"arrow-padding": 0
|
|
1074
1094
|
};
|
|
1075
1095
|
for (const n in i2) {
|
|
1076
|
-
const o2 =
|
|
1096
|
+
const o2 = Ct(), l2 = r2.getPropertyValue(`--${o2}popover-${n}`).trim();
|
|
1077
1097
|
l2 && (i2[n] = l2);
|
|
1078
1098
|
}
|
|
1079
1099
|
return i2;
|
|
@@ -1117,7 +1137,7 @@
|
|
|
1117
1137
|
}
|
|
1118
1138
|
return t;
|
|
1119
1139
|
}
|
|
1120
|
-
function
|
|
1140
|
+
function Dt(e) {
|
|
1121
1141
|
return [{
|
|
1122
1142
|
name: "offset",
|
|
1123
1143
|
options: {
|
|
@@ -1147,11 +1167,11 @@
|
|
|
1147
1167
|
return t;
|
|
1148
1168
|
throw new Error(`Popover not found in collection with id of "${e}".`);
|
|
1149
1169
|
}
|
|
1150
|
-
function
|
|
1151
|
-
return typeof e == "string" ? e : typeof e.hasAttribute == "function" ? e.closest(this.settings.selectorPopover) ? (e = e.closest(this.settings.selectorPopover), e.id) : e.hasAttribute("aria-controls") ? e.getAttribute("aria-controls") : e.hasAttribute("aria-describedby") ? e.getAttribute("aria-describedby") : false :
|
|
1170
|
+
function Rt(e) {
|
|
1171
|
+
return typeof e == "string" ? e : typeof e.hasAttribute == "function" ? e.closest(this.settings.selectorPopover) ? (e = e.closest(this.settings.selectorPopover), e.id) : e.hasAttribute("aria-controls") ? e.getAttribute("aria-controls") : e.hasAttribute("aria-describedby") ? e.getAttribute("aria-describedby") : false : false;
|
|
1152
1172
|
}
|
|
1153
1173
|
function Bt(e) {
|
|
1154
|
-
const t =
|
|
1174
|
+
const t = Rt.call(this, e);
|
|
1155
1175
|
if (t) {
|
|
1156
1176
|
const r2 = document.querySelector(`#${t}`), i2 = document.querySelector(`[aria-controls="${t}"]`) || document.querySelector(`[aria-describedby="${t}"]`);
|
|
1157
1177
|
return !i2 && !r2 ? { error: new Error(`No popover elements found using the ID: "${t}".`) } : i2 ? r2 ? { popover: r2, trigger: i2 } : { error: new Error("No popover associated with the provided popover trigger.") } : { error: new Error("No popover trigger associated with the provided popover.") };
|
|
@@ -1159,18 +1179,18 @@
|
|
|
1159
1179
|
return { error: new Error("Could not resolve the popover ID.") };
|
|
1160
1180
|
}
|
|
1161
1181
|
async function ke(e) {
|
|
1162
|
-
const t = e ? at.call(this, e) : await
|
|
1182
|
+
const t = e ? at.call(this, e) : await st.call(this);
|
|
1163
1183
|
return t && t.state === "opened" && (t.el.classList.remove(this.settings.stateActive), t.trigger.hasAttribute("aria-controls") && t.trigger.setAttribute("aria-expanded", "false"), t.popper.setOptions({
|
|
1164
1184
|
modifiers: [{ name: "eventListeners", enabled: false }]
|
|
1165
1185
|
}), t.state = "closed", t.trigger === this.trigger && (this.trigger = null)), t;
|
|
1166
1186
|
}
|
|
1167
|
-
async function
|
|
1187
|
+
async function st() {
|
|
1168
1188
|
const e = [];
|
|
1169
1189
|
return await Promise.all(this.collection.map(async (t) => {
|
|
1170
1190
|
t.state === "opened" && e.push(await ke.call(this, t));
|
|
1171
1191
|
})), e;
|
|
1172
1192
|
}
|
|
1173
|
-
function
|
|
1193
|
+
function ct(e) {
|
|
1174
1194
|
e.state == "opened" && setTimeout(() => {
|
|
1175
1195
|
const t = e.el.closest(":hover") === e.el || e.trigger.closest(":hover") === e.trigger, r2 = document.activeElement.closest(
|
|
1176
1196
|
`#${e.id}, [aria-controls="${e.id}"], [aria-describedby="${e.id}"]`
|
|
@@ -1179,23 +1199,23 @@
|
|
|
1179
1199
|
}, 1);
|
|
1180
1200
|
}
|
|
1181
1201
|
function Tt(e) {
|
|
1182
|
-
e.state === "opened" ? e.close() : (this.trigger = e.trigger, e.open(),
|
|
1202
|
+
e.state === "opened" ? e.close() : (this.trigger = e.trigger, e.open(), lt.call(this, e));
|
|
1183
1203
|
}
|
|
1184
1204
|
function St(e) {
|
|
1185
1205
|
switch (e.key) {
|
|
1186
1206
|
case "Escape":
|
|
1187
|
-
this.trigger && this.trigger.focus(),
|
|
1207
|
+
this.trigger && this.trigger.focus(), st.call(this);
|
|
1188
1208
|
return;
|
|
1189
1209
|
case "Tab":
|
|
1190
1210
|
this.collection.forEach((t) => {
|
|
1191
|
-
|
|
1211
|
+
ct.call(this, t);
|
|
1192
1212
|
});
|
|
1193
1213
|
return;
|
|
1194
1214
|
default:
|
|
1195
1215
|
return;
|
|
1196
1216
|
}
|
|
1197
1217
|
}
|
|
1198
|
-
function
|
|
1218
|
+
function lt(e) {
|
|
1199
1219
|
const t = this;
|
|
1200
1220
|
document.addEventListener("click", function r2(i2) {
|
|
1201
1221
|
i2.target.closest(
|
|
@@ -1203,11 +1223,11 @@
|
|
|
1203
1223
|
) ? e.el && !e.el.classList.contains(t.settings.stateActive) && this.removeEventListener("click", r2) : (e.el && e.el.classList.contains(t.settings.stateActive) && e.close(), this.removeEventListener("click", r2));
|
|
1204
1224
|
});
|
|
1205
1225
|
}
|
|
1206
|
-
var k = "top", S = "bottom",
|
|
1226
|
+
var k = "top", S = "bottom", j = "right", D = "left", De = "auto", le = [k, S, j, D], Q = "start", se = "end", jt = "clippingParents", ft = "viewport", ne = "popper", Mt = "reference", Ge = /* @__PURE__ */ le.reduce(function(e, t) {
|
|
1207
1227
|
return e.concat([t + "-" + Q, t + "-" + se]);
|
|
1208
|
-
}, []),
|
|
1228
|
+
}, []), ut = /* @__PURE__ */ [].concat(le, [De]).reduce(function(e, t) {
|
|
1209
1229
|
return e.concat([t, t + "-" + Q, t + "-" + se]);
|
|
1210
|
-
}, []),
|
|
1230
|
+
}, []), Wt = "beforeRead", Ht = "read", Nt = "afterRead", It = "beforeMain", Vt = "main", Ft = "afterMain", Xt = "beforeWrite", Yt = "write", qt = "afterWrite", zt = [Wt, Ht, Nt, It, Vt, Ft, Xt, Yt, qt];
|
|
1211
1231
|
function N(e) {
|
|
1212
1232
|
return e ? (e.nodeName || "").toLowerCase() : null;
|
|
1213
1233
|
}
|
|
@@ -1239,8 +1259,8 @@
|
|
|
1239
1259
|
Object.keys(t.elements).forEach(function(r2) {
|
|
1240
1260
|
var i2 = t.styles[r2] || {}, n = t.attributes[r2] || {}, o2 = t.elements[r2];
|
|
1241
1261
|
!T(o2) || !N(o2) || (Object.assign(o2.style, i2), Object.keys(n).forEach(function(l2) {
|
|
1242
|
-
var
|
|
1243
|
-
|
|
1262
|
+
var s = n[l2];
|
|
1263
|
+
s === false ? o2.removeAttribute(l2) : o2.setAttribute(l2, s === true ? "" : s);
|
|
1244
1264
|
}));
|
|
1245
1265
|
});
|
|
1246
1266
|
}
|
|
@@ -1259,10 +1279,10 @@
|
|
|
1259
1279
|
};
|
|
1260
1280
|
return Object.assign(t.elements.popper.style, r2.popper), t.styles = r2, t.elements.arrow && Object.assign(t.elements.arrow.style, r2.arrow), function() {
|
|
1261
1281
|
Object.keys(t.elements).forEach(function(i2) {
|
|
1262
|
-
var n = t.elements[i2], o2 = t.attributes[i2] || {}, l2 = Object.keys(t.styles.hasOwnProperty(i2) ? t.styles[i2] : r2[i2]),
|
|
1282
|
+
var n = t.elements[i2], o2 = t.attributes[i2] || {}, l2 = Object.keys(t.styles.hasOwnProperty(i2) ? t.styles[i2] : r2[i2]), s = l2.reduce(function(a2, f2) {
|
|
1263
1283
|
return a2[f2] = "", a2;
|
|
1264
1284
|
}, {});
|
|
1265
|
-
!T(n) || !N(n) || (Object.assign(n.style,
|
|
1285
|
+
!T(n) || !N(n) || (Object.assign(n.style, s), Object.keys(o2).forEach(function(a2) {
|
|
1266
1286
|
n.removeAttribute(a2);
|
|
1267
1287
|
}));
|
|
1268
1288
|
});
|
|
@@ -1286,14 +1306,14 @@
|
|
|
1286
1306
|
return t.brand + "/" + t.version;
|
|
1287
1307
|
}).join(" ") : navigator.userAgent;
|
|
1288
1308
|
}
|
|
1289
|
-
function
|
|
1309
|
+
function pt() {
|
|
1290
1310
|
return !/^((?!chrome|android).)*safari/i.test(Le());
|
|
1291
1311
|
}
|
|
1292
1312
|
function ee(e, t, r2) {
|
|
1293
1313
|
t === void 0 && (t = false), r2 === void 0 && (r2 = false);
|
|
1294
1314
|
var i2 = e.getBoundingClientRect(), n = 1, o2 = 1;
|
|
1295
1315
|
t && T(e) && (n = e.offsetWidth > 0 && Z(i2.width) / e.offsetWidth || 1, o2 = e.offsetHeight > 0 && Z(i2.height) / e.offsetHeight || 1);
|
|
1296
|
-
var l2 = K(e) ? B(e) : window,
|
|
1316
|
+
var l2 = K(e) ? B(e) : window, s = l2.visualViewport, a2 = !pt() && r2, f2 = (i2.left + (a2 && s ? s.offsetLeft : 0)) / n, c2 = (i2.top + (a2 && s ? s.offsetTop : 0)) / o2, h2 = i2.width / n, y2 = i2.height / o2;
|
|
1297
1317
|
return {
|
|
1298
1318
|
width: h2,
|
|
1299
1319
|
height: y2,
|
|
@@ -1314,7 +1334,7 @@
|
|
|
1314
1334
|
height: i2
|
|
1315
1335
|
};
|
|
1316
1336
|
}
|
|
1317
|
-
function
|
|
1337
|
+
function dt(e, t) {
|
|
1318
1338
|
var r2 = t.getRootNode && t.getRootNode();
|
|
1319
1339
|
if (e.contains(t))
|
|
1320
1340
|
return true;
|
|
@@ -1387,7 +1407,7 @@
|
|
|
1387
1407
|
var i2 = oe(e, t, r2);
|
|
1388
1408
|
return i2 > r2 ? r2 : i2;
|
|
1389
1409
|
}
|
|
1390
|
-
function
|
|
1410
|
+
function vt() {
|
|
1391
1411
|
return {
|
|
1392
1412
|
top: 0,
|
|
1393
1413
|
right: 0,
|
|
@@ -1395,10 +1415,10 @@
|
|
|
1395
1415
|
left: 0
|
|
1396
1416
|
};
|
|
1397
1417
|
}
|
|
1398
|
-
function
|
|
1399
|
-
return Object.assign({},
|
|
1418
|
+
function ht(e) {
|
|
1419
|
+
return Object.assign({}, vt(), e);
|
|
1400
1420
|
}
|
|
1401
|
-
function
|
|
1421
|
+
function gt(e, t) {
|
|
1402
1422
|
return t.reduce(function(r2, i2) {
|
|
1403
1423
|
return r2[i2] = e, r2;
|
|
1404
1424
|
}, {});
|
|
@@ -1406,18 +1426,18 @@
|
|
|
1406
1426
|
var Zt = function(t, r2) {
|
|
1407
1427
|
return t = typeof t == "function" ? t(Object.assign({}, r2.rects, {
|
|
1408
1428
|
placement: r2.placement
|
|
1409
|
-
})) : t,
|
|
1429
|
+
})) : t, ht(typeof t != "number" ? t : gt(t, le));
|
|
1410
1430
|
};
|
|
1411
1431
|
function er(e) {
|
|
1412
|
-
var t, r2 = e.state, i2 = e.name, n = e.options, o2 = r2.elements.arrow, l2 = r2.modifiersData.popperOffsets,
|
|
1432
|
+
var t, r2 = e.state, i2 = e.name, n = e.options, o2 = r2.elements.arrow, l2 = r2.modifiersData.popperOffsets, s = H(r2.placement), a2 = Te(s), f2 = [D, j].indexOf(s) >= 0, c2 = f2 ? "height" : "width";
|
|
1413
1433
|
if (!(!o2 || !l2)) {
|
|
1414
|
-
var h2 = Zt(n.padding, r2), y2 = Be(o2), u2 = a2 === "y" ? k : D, b2 = a2 === "y" ? S :
|
|
1434
|
+
var h2 = Zt(n.padding, r2), y2 = Be(o2), u2 = a2 === "y" ? k : D, b2 = a2 === "y" ? S : j, v2 = r2.rects.reference[c2] + r2.rects.reference[a2] - l2[a2] - r2.rects.popper[c2], d2 = l2[a2] - r2.rects.reference[a2], w2 = fe(o2), O2 = w2 ? a2 === "y" ? w2.clientHeight || 0 : w2.clientWidth || 0 : 0, E2 = v2 / 2 - d2 / 2, p2 = h2[u2], g2 = O2 - y2[c2] - h2[b2], m2 = O2 / 2 - y2[c2] / 2 + E2, x2 = oe(p2, m2, g2), L2 = a2;
|
|
1415
1435
|
r2.modifiersData[i2] = (t = {}, t[L2] = x2, t.centerOffset = x2 - m2, t);
|
|
1416
1436
|
}
|
|
1417
1437
|
}
|
|
1418
1438
|
function tr(e) {
|
|
1419
1439
|
var t = e.state, r2 = e.options, i2 = r2.element, n = i2 === void 0 ? "[data-popper-arrow]" : i2;
|
|
1420
|
-
n != null && (typeof n == "string" && (n = t.elements.popper.querySelector(n), !n) ||
|
|
1440
|
+
n != null && (typeof n == "string" && (n = t.elements.popper.querySelector(n), !n) || dt(t.elements.popper, n) && (t.elements.arrow = n));
|
|
1421
1441
|
}
|
|
1422
1442
|
const rr = {
|
|
1423
1443
|
name: "arrow",
|
|
@@ -1445,7 +1465,7 @@
|
|
|
1445
1465
|
};
|
|
1446
1466
|
}
|
|
1447
1467
|
function Qe(e) {
|
|
1448
|
-
var t, r2 = e.popper, i2 = e.popperRect, n = e.placement, o2 = e.variation, l2 = e.offsets,
|
|
1468
|
+
var t, r2 = e.popper, i2 = e.popperRect, n = e.placement, o2 = e.variation, l2 = e.offsets, s = e.position, a2 = e.gpuAcceleration, f2 = e.adaptive, c2 = e.roundOffsets, h2 = e.isFixed, y2 = l2.x, u2 = y2 === void 0 ? 0 : y2, b2 = l2.y, v2 = b2 === void 0 ? 0 : b2, d2 = typeof c2 == "function" ? c2({
|
|
1449
1469
|
x: u2,
|
|
1450
1470
|
y: v2
|
|
1451
1471
|
}) : {
|
|
@@ -1456,7 +1476,7 @@
|
|
|
1456
1476
|
var w2 = l2.hasOwnProperty("x"), O2 = l2.hasOwnProperty("y"), E2 = D, p2 = k, g2 = window;
|
|
1457
1477
|
if (f2) {
|
|
1458
1478
|
var m2 = fe(r2), x2 = "clientHeight", L2 = "clientWidth";
|
|
1459
|
-
if (m2 === B(r2) && (m2 = F(r2), I(m2).position !== "static" &&
|
|
1479
|
+
if (m2 === B(r2) && (m2 = F(r2), I(m2).position !== "static" && s === "absolute" && (x2 = "scrollHeight", L2 = "scrollWidth")), m2 = m2, n === k || (n === D || n === j) && o2 === se) {
|
|
1460
1480
|
p2 = S;
|
|
1461
1481
|
var P2 = h2 && m2 === g2 && g2.visualViewport ? g2.visualViewport.height : (
|
|
1462
1482
|
// $FlowFixMe[prop-missing]
|
|
@@ -1465,7 +1485,7 @@
|
|
|
1465
1485
|
v2 -= P2 - i2.height, v2 *= a2 ? 1 : -1;
|
|
1466
1486
|
}
|
|
1467
1487
|
if (n === D || (n === k || n === S) && o2 === se) {
|
|
1468
|
-
E2 =
|
|
1488
|
+
E2 = j;
|
|
1469
1489
|
var A2 = h2 && m2 === g2 && g2.visualViewport ? g2.visualViewport.width : (
|
|
1470
1490
|
// $FlowFixMe[prop-missing]
|
|
1471
1491
|
m2[L2]
|
|
@@ -1474,22 +1494,22 @@
|
|
|
1474
1494
|
}
|
|
1475
1495
|
}
|
|
1476
1496
|
var $2 = Object.assign({
|
|
1477
|
-
position:
|
|
1478
|
-
}, f2 && ir),
|
|
1497
|
+
position: s
|
|
1498
|
+
}, f2 && ir), M2 = c2 === true ? nr({
|
|
1479
1499
|
x: u2,
|
|
1480
1500
|
y: v2
|
|
1481
1501
|
}, B(r2)) : {
|
|
1482
1502
|
x: u2,
|
|
1483
1503
|
y: v2
|
|
1484
1504
|
};
|
|
1485
|
-
if (u2 =
|
|
1505
|
+
if (u2 = M2.x, v2 = M2.y, a2) {
|
|
1486
1506
|
var C2;
|
|
1487
1507
|
return Object.assign({}, $2, (C2 = {}, C2[p2] = O2 ? "0" : "", C2[E2] = w2 ? "0" : "", C2.transform = (g2.devicePixelRatio || 1) <= 1 ? "translate(" + u2 + "px, " + v2 + "px)" : "translate3d(" + u2 + "px, " + v2 + "px, 0)", C2));
|
|
1488
1508
|
}
|
|
1489
1509
|
return Object.assign({}, $2, (t = {}, t[p2] = O2 ? v2 + "px" : "", t[E2] = w2 ? u2 + "px" : "", t.transform = "", t));
|
|
1490
1510
|
}
|
|
1491
1511
|
function or(e) {
|
|
1492
|
-
var t = e.state, r2 = e.options, i2 = r2.gpuAcceleration, n = i2 === void 0 ? true : i2, o2 = r2.adaptive, l2 = o2 === void 0 ? true : o2,
|
|
1512
|
+
var t = e.state, r2 = e.options, i2 = r2.gpuAcceleration, n = i2 === void 0 ? true : i2, o2 = r2.adaptive, l2 = o2 === void 0 ? true : o2, s = r2.roundOffsets, a2 = s === void 0 ? true : s, f2 = {
|
|
1493
1513
|
placement: H(t.placement),
|
|
1494
1514
|
variation: te(t.placement),
|
|
1495
1515
|
popper: t.elements.popper,
|
|
@@ -1522,13 +1542,13 @@
|
|
|
1522
1542
|
passive: true
|
|
1523
1543
|
};
|
|
1524
1544
|
function sr(e) {
|
|
1525
|
-
var t = e.state, r2 = e.instance, i2 = e.options, n = i2.scroll, o2 = n === void 0 ? true : n, l2 = i2.resize,
|
|
1545
|
+
var t = e.state, r2 = e.instance, i2 = e.options, n = i2.scroll, o2 = n === void 0 ? true : n, l2 = i2.resize, s = l2 === void 0 ? true : l2, a2 = B(t.elements.popper), f2 = [].concat(t.scrollParents.reference, t.scrollParents.popper);
|
|
1526
1546
|
return o2 && f2.forEach(function(c2) {
|
|
1527
1547
|
c2.addEventListener("scroll", r2.update, ge);
|
|
1528
|
-
}),
|
|
1548
|
+
}), s && a2.addEventListener("resize", r2.update, ge), function() {
|
|
1529
1549
|
o2 && f2.forEach(function(c2) {
|
|
1530
1550
|
c2.removeEventListener("scroll", r2.update, ge);
|
|
1531
|
-
}),
|
|
1551
|
+
}), s && a2.removeEventListener("resize", r2.update, ge);
|
|
1532
1552
|
};
|
|
1533
1553
|
}
|
|
1534
1554
|
const cr = {
|
|
@@ -1567,46 +1587,46 @@
|
|
|
1567
1587
|
scrollTop: i2
|
|
1568
1588
|
};
|
|
1569
1589
|
}
|
|
1570
|
-
function
|
|
1590
|
+
function je(e) {
|
|
1571
1591
|
return ee(F(e)).left + Se(e).scrollLeft;
|
|
1572
1592
|
}
|
|
1573
1593
|
function ur(e, t) {
|
|
1574
|
-
var r2 = B(e), i2 = F(e), n = r2.visualViewport, o2 = i2.clientWidth, l2 = i2.clientHeight,
|
|
1594
|
+
var r2 = B(e), i2 = F(e), n = r2.visualViewport, o2 = i2.clientWidth, l2 = i2.clientHeight, s = 0, a2 = 0;
|
|
1575
1595
|
if (n) {
|
|
1576
1596
|
o2 = n.width, l2 = n.height;
|
|
1577
|
-
var f2 =
|
|
1578
|
-
(f2 || !f2 && t === "fixed") && (
|
|
1597
|
+
var f2 = pt();
|
|
1598
|
+
(f2 || !f2 && t === "fixed") && (s = n.offsetLeft, a2 = n.offsetTop);
|
|
1579
1599
|
}
|
|
1580
1600
|
return {
|
|
1581
1601
|
width: o2,
|
|
1582
1602
|
height: l2,
|
|
1583
|
-
x:
|
|
1603
|
+
x: s + je(e),
|
|
1584
1604
|
y: a2
|
|
1585
1605
|
};
|
|
1586
1606
|
}
|
|
1587
1607
|
function pr(e) {
|
|
1588
|
-
var t, r2 = F(e), i2 = Se(e), n = (t = e.ownerDocument) == null ? void 0 : t.body, o2 = _(r2.scrollWidth, r2.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), l2 = _(r2.scrollHeight, r2.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0),
|
|
1589
|
-
return I(n || r2).direction === "rtl" && (
|
|
1608
|
+
var t, r2 = F(e), i2 = Se(e), n = (t = e.ownerDocument) == null ? void 0 : t.body, o2 = _(r2.scrollWidth, r2.clientWidth, n ? n.scrollWidth : 0, n ? n.clientWidth : 0), l2 = _(r2.scrollHeight, r2.clientHeight, n ? n.scrollHeight : 0, n ? n.clientHeight : 0), s = -i2.scrollLeft + je(e), a2 = -i2.scrollTop;
|
|
1609
|
+
return I(n || r2).direction === "rtl" && (s += _(r2.clientWidth, n ? n.clientWidth : 0) - o2), {
|
|
1590
1610
|
width: o2,
|
|
1591
1611
|
height: l2,
|
|
1592
|
-
x:
|
|
1612
|
+
x: s,
|
|
1593
1613
|
y: a2
|
|
1594
1614
|
};
|
|
1595
1615
|
}
|
|
1596
|
-
function
|
|
1616
|
+
function Me(e) {
|
|
1597
1617
|
var t = I(e), r2 = t.overflow, i2 = t.overflowX, n = t.overflowY;
|
|
1598
1618
|
return /auto|scroll|overlay|hidden/.test(r2 + n + i2);
|
|
1599
1619
|
}
|
|
1600
|
-
function
|
|
1601
|
-
return ["html", "body", "#document"].indexOf(N(e)) >= 0 ? e.ownerDocument.body : T(e) &&
|
|
1620
|
+
function mt(e) {
|
|
1621
|
+
return ["html", "body", "#document"].indexOf(N(e)) >= 0 ? e.ownerDocument.body : T(e) && Me(e) ? e : mt(we(e));
|
|
1602
1622
|
}
|
|
1603
1623
|
function ae(e, t) {
|
|
1604
1624
|
var r2;
|
|
1605
1625
|
t === void 0 && (t = []);
|
|
1606
|
-
var i2 =
|
|
1607
|
-
return n ?
|
|
1626
|
+
var i2 = mt(e), n = i2 === ((r2 = e.ownerDocument) == null ? void 0 : r2.body), o2 = B(i2), l2 = n ? [o2].concat(o2.visualViewport || [], Me(i2) ? i2 : []) : i2, s = t.concat(l2);
|
|
1627
|
+
return n ? s : (
|
|
1608
1628
|
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
|
1609
|
-
|
|
1629
|
+
s.concat(ae(we(l2)))
|
|
1610
1630
|
);
|
|
1611
1631
|
}
|
|
1612
1632
|
function $e(e) {
|
|
@@ -1622,23 +1642,23 @@
|
|
|
1622
1642
|
return r2.top = r2.top + e.clientTop, r2.left = r2.left + e.clientLeft, r2.bottom = r2.top + e.clientHeight, r2.right = r2.left + e.clientWidth, r2.width = e.clientWidth, r2.height = e.clientHeight, r2.x = r2.left, r2.y = r2.top, r2;
|
|
1623
1643
|
}
|
|
1624
1644
|
function et(e, t, r2) {
|
|
1625
|
-
return t ===
|
|
1645
|
+
return t === ft ? $e(ur(e, r2)) : K(t) ? dr(t, r2) : $e(pr(F(e)));
|
|
1626
1646
|
}
|
|
1627
1647
|
function vr(e) {
|
|
1628
1648
|
var t = ae(we(e)), r2 = ["absolute", "fixed"].indexOf(I(e).position) >= 0, i2 = r2 && T(e) ? fe(e) : e;
|
|
1629
1649
|
return K(i2) ? t.filter(function(n) {
|
|
1630
|
-
return K(n) &&
|
|
1650
|
+
return K(n) && dt(n, i2) && N(n) !== "body";
|
|
1631
1651
|
}) : [];
|
|
1632
1652
|
}
|
|
1633
1653
|
function hr(e, t, r2, i2) {
|
|
1634
|
-
var n = t === "clippingParents" ? vr(e) : [].concat(t), o2 = [].concat(n, [r2]), l2 = o2[0],
|
|
1654
|
+
var n = t === "clippingParents" ? vr(e) : [].concat(t), o2 = [].concat(n, [r2]), l2 = o2[0], s = o2.reduce(function(a2, f2) {
|
|
1635
1655
|
var c2 = et(e, f2, i2);
|
|
1636
1656
|
return a2.top = _(c2.top, a2.top), a2.right = ye(c2.right, a2.right), a2.bottom = ye(c2.bottom, a2.bottom), a2.left = _(c2.left, a2.left), a2;
|
|
1637
1657
|
}, et(e, l2, i2));
|
|
1638
|
-
return
|
|
1658
|
+
return s.width = s.right - s.left, s.height = s.bottom - s.top, s.x = s.left, s.y = s.top, s;
|
|
1639
1659
|
}
|
|
1640
|
-
function
|
|
1641
|
-
var t = e.reference, r2 = e.element, i2 = e.placement, n = i2 ? H(i2) : null, o2 = i2 ? te(i2) : null, l2 = t.x + t.width / 2 - r2.width / 2,
|
|
1660
|
+
function yt(e) {
|
|
1661
|
+
var t = e.reference, r2 = e.element, i2 = e.placement, n = i2 ? H(i2) : null, o2 = i2 ? te(i2) : null, l2 = t.x + t.width / 2 - r2.width / 2, s = t.y + t.height / 2 - r2.height / 2, a2;
|
|
1642
1662
|
switch (n) {
|
|
1643
1663
|
case k:
|
|
1644
1664
|
a2 = {
|
|
@@ -1652,16 +1672,16 @@
|
|
|
1652
1672
|
y: t.y + t.height
|
|
1653
1673
|
};
|
|
1654
1674
|
break;
|
|
1655
|
-
case
|
|
1675
|
+
case j:
|
|
1656
1676
|
a2 = {
|
|
1657
1677
|
x: t.x + t.width,
|
|
1658
|
-
y:
|
|
1678
|
+
y: s
|
|
1659
1679
|
};
|
|
1660
1680
|
break;
|
|
1661
1681
|
case D:
|
|
1662
1682
|
a2 = {
|
|
1663
1683
|
x: t.x - r2.width,
|
|
1664
|
-
y:
|
|
1684
|
+
y: s
|
|
1665
1685
|
};
|
|
1666
1686
|
break;
|
|
1667
1687
|
default:
|
|
@@ -1686,7 +1706,7 @@
|
|
|
1686
1706
|
}
|
|
1687
1707
|
function ce(e, t) {
|
|
1688
1708
|
t === void 0 && (t = {});
|
|
1689
|
-
var r2 = t, i2 = r2.placement, n = i2 === void 0 ? e.placement : i2, o2 = r2.strategy, l2 = o2 === void 0 ? e.strategy : o2,
|
|
1709
|
+
var r2 = t, i2 = r2.placement, n = i2 === void 0 ? e.placement : i2, o2 = r2.strategy, l2 = o2 === void 0 ? e.strategy : o2, s = r2.boundary, a2 = s === void 0 ? jt : s, f2 = r2.rootBoundary, c2 = f2 === void 0 ? ft : f2, h2 = r2.elementContext, y2 = h2 === void 0 ? ne : h2, u2 = r2.altBoundary, b2 = u2 === void 0 ? false : u2, v2 = r2.padding, d2 = v2 === void 0 ? 0 : v2, w2 = ht(typeof d2 != "number" ? d2 : gt(d2, le)), O2 = y2 === ne ? Mt : ne, E2 = e.rects.popper, p2 = e.elements[b2 ? O2 : y2], g2 = hr(K(p2) ? p2 : p2.contextElement || F(e.elements.popper), a2, c2, l2), m2 = ee(e.elements.reference), x2 = yt({
|
|
1690
1710
|
reference: m2,
|
|
1691
1711
|
element: E2,
|
|
1692
1712
|
strategy: "absolute",
|
|
@@ -1698,17 +1718,17 @@
|
|
|
1698
1718
|
right: P2.right - g2.right + w2.right
|
|
1699
1719
|
}, $2 = e.modifiersData.offset;
|
|
1700
1720
|
if (y2 === ne && $2) {
|
|
1701
|
-
var
|
|
1721
|
+
var M2 = $2[n];
|
|
1702
1722
|
Object.keys(A2).forEach(function(C2) {
|
|
1703
|
-
var
|
|
1704
|
-
A2[C2] +=
|
|
1723
|
+
var X2 = [j, S].indexOf(C2) >= 0 ? 1 : -1, Y2 = [k, S].indexOf(C2) >= 0 ? "y" : "x";
|
|
1724
|
+
A2[C2] += M2[Y2] * X2;
|
|
1705
1725
|
});
|
|
1706
1726
|
}
|
|
1707
1727
|
return A2;
|
|
1708
1728
|
}
|
|
1709
1729
|
function gr(e, t) {
|
|
1710
1730
|
t === void 0 && (t = {});
|
|
1711
|
-
var r2 = t, i2 = r2.placement, n = r2.boundary, o2 = r2.rootBoundary, l2 = r2.padding,
|
|
1731
|
+
var r2 = t, i2 = r2.placement, n = r2.boundary, o2 = r2.rootBoundary, l2 = r2.padding, s = r2.flipVariations, a2 = r2.allowedAutoPlacements, f2 = a2 === void 0 ? ut : a2, c2 = te(i2), h2 = c2 ? s ? Ge : Ge.filter(function(b2) {
|
|
1712
1732
|
return te(b2) === c2;
|
|
1713
1733
|
}) : le, y2 = h2.filter(function(b2) {
|
|
1714
1734
|
return f2.indexOf(b2) >= 0;
|
|
@@ -1735,7 +1755,7 @@
|
|
|
1735
1755
|
function yr(e) {
|
|
1736
1756
|
var t = e.state, r2 = e.options, i2 = e.name;
|
|
1737
1757
|
if (!t.modifiersData[i2]._skip) {
|
|
1738
|
-
for (var n = r2.mainAxis, o2 = n === void 0 ? true : n, l2 = r2.altAxis,
|
|
1758
|
+
for (var n = r2.mainAxis, o2 = n === void 0 ? true : n, l2 = r2.altAxis, s = l2 === void 0 ? true : l2, a2 = r2.fallbackPlacements, f2 = r2.padding, c2 = r2.boundary, h2 = r2.rootBoundary, y2 = r2.altBoundary, u2 = r2.flipVariations, b2 = u2 === void 0 ? true : u2, v2 = r2.allowedAutoPlacements, d2 = t.options.placement, w2 = H(d2), O2 = w2 === d2, E2 = a2 || (O2 || !b2 ? [me(d2)] : mr(d2)), p2 = [d2].concat(E2).reduce(function(G2, V2) {
|
|
1739
1759
|
return G2.concat(H(V2) === De ? gr(t, {
|
|
1740
1760
|
placement: V2,
|
|
1741
1761
|
boundary: c2,
|
|
@@ -1745,22 +1765,22 @@
|
|
|
1745
1765
|
allowedAutoPlacements: v2
|
|
1746
1766
|
}) : V2);
|
|
1747
1767
|
}, []), g2 = t.rects.reference, m2 = t.rects.popper, x2 = /* @__PURE__ */ new Map(), L2 = true, P2 = p2[0], A2 = 0; A2 < p2.length; A2++) {
|
|
1748
|
-
var $2 = p2[A2],
|
|
1768
|
+
var $2 = p2[A2], M2 = H($2), C2 = te($2) === Q, X2 = [k, S].indexOf(M2) >= 0, Y2 = X2 ? "width" : "height", R2 = ce(t, {
|
|
1749
1769
|
placement: $2,
|
|
1750
1770
|
boundary: c2,
|
|
1751
1771
|
rootBoundary: h2,
|
|
1752
1772
|
altBoundary: y2,
|
|
1753
1773
|
padding: f2
|
|
1754
|
-
}),
|
|
1755
|
-
g2[
|
|
1756
|
-
var ue = me(
|
|
1757
|
-
if (o2 &&
|
|
1774
|
+
}), W2 = X2 ? C2 ? j : D : C2 ? S : k;
|
|
1775
|
+
g2[Y2] > m2[Y2] && (W2 = me(W2));
|
|
1776
|
+
var ue = me(W2), q2 = [];
|
|
1777
|
+
if (o2 && q2.push(R2[M2] <= 0), s && q2.push(R2[W2] <= 0, R2[ue] <= 0), q2.every(function(G2) {
|
|
1758
1778
|
return G2;
|
|
1759
1779
|
})) {
|
|
1760
1780
|
P2 = $2, L2 = false;
|
|
1761
1781
|
break;
|
|
1762
1782
|
}
|
|
1763
|
-
x2.set($2,
|
|
1783
|
+
x2.set($2, q2);
|
|
1764
1784
|
}
|
|
1765
1785
|
if (L2)
|
|
1766
1786
|
for (var pe = b2 ? 3 : 1, be = function(V2) {
|
|
@@ -1803,16 +1823,16 @@
|
|
|
1803
1823
|
};
|
|
1804
1824
|
}
|
|
1805
1825
|
function rt(e) {
|
|
1806
|
-
return [k,
|
|
1826
|
+
return [k, j, S, D].some(function(t) {
|
|
1807
1827
|
return e[t] >= 0;
|
|
1808
1828
|
});
|
|
1809
1829
|
}
|
|
1810
1830
|
function br(e) {
|
|
1811
1831
|
var t = e.state, r2 = e.name, i2 = t.rects.reference, n = t.rects.popper, o2 = t.modifiersData.preventOverflow, l2 = ce(t, {
|
|
1812
1832
|
elementContext: "reference"
|
|
1813
|
-
}),
|
|
1833
|
+
}), s = ce(t, {
|
|
1814
1834
|
altBoundary: true
|
|
1815
|
-
}), a2 = tt(l2, i2), f2 = tt(
|
|
1835
|
+
}), a2 = tt(l2, i2), f2 = tt(s, n, o2), c2 = rt(a2), h2 = rt(f2);
|
|
1816
1836
|
t.modifiersData[r2] = {
|
|
1817
1837
|
referenceClippingOffsets: a2,
|
|
1818
1838
|
popperEscapeOffsets: f2,
|
|
@@ -1833,19 +1853,19 @@
|
|
|
1833
1853
|
function Or(e, t, r2) {
|
|
1834
1854
|
var i2 = H(e), n = [D, k].indexOf(i2) >= 0 ? -1 : 1, o2 = typeof r2 == "function" ? r2(Object.assign({}, t, {
|
|
1835
1855
|
placement: e
|
|
1836
|
-
})) : r2, l2 = o2[0],
|
|
1837
|
-
return l2 = l2 || 0,
|
|
1838
|
-
x:
|
|
1856
|
+
})) : r2, l2 = o2[0], s = o2[1];
|
|
1857
|
+
return l2 = l2 || 0, s = (s || 0) * n, [D, j].indexOf(i2) >= 0 ? {
|
|
1858
|
+
x: s,
|
|
1839
1859
|
y: l2
|
|
1840
1860
|
} : {
|
|
1841
1861
|
x: l2,
|
|
1842
|
-
y:
|
|
1862
|
+
y: s
|
|
1843
1863
|
};
|
|
1844
1864
|
}
|
|
1845
1865
|
function Er(e) {
|
|
1846
|
-
var t = e.state, r2 = e.options, i2 = e.name, n = r2.offset, o2 = n === void 0 ? [0, 0] : n, l2 =
|
|
1866
|
+
var t = e.state, r2 = e.options, i2 = e.name, n = r2.offset, o2 = n === void 0 ? [0, 0] : n, l2 = ut.reduce(function(c2, h2) {
|
|
1847
1867
|
return c2[h2] = Or(h2, t.rects, o2), c2;
|
|
1848
|
-
}, {}),
|
|
1868
|
+
}, {}), s = l2[t.placement], a2 = s.x, f2 = s.y;
|
|
1849
1869
|
t.modifiersData.popperOffsets != null && (t.modifiersData.popperOffsets.x += a2, t.modifiersData.popperOffsets.y += f2), t.modifiersData[i2] = l2;
|
|
1850
1870
|
}
|
|
1851
1871
|
const Ar = {
|
|
@@ -1857,7 +1877,7 @@
|
|
|
1857
1877
|
};
|
|
1858
1878
|
function Pr(e) {
|
|
1859
1879
|
var t = e.state, r2 = e.name;
|
|
1860
|
-
t.modifiersData[r2] =
|
|
1880
|
+
t.modifiersData[r2] = yt({
|
|
1861
1881
|
reference: t.rects.reference,
|
|
1862
1882
|
element: t.rects.popper,
|
|
1863
1883
|
strategy: "absolute",
|
|
@@ -1875,7 +1895,7 @@
|
|
|
1875
1895
|
return e === "x" ? "y" : "x";
|
|
1876
1896
|
}
|
|
1877
1897
|
function Cr(e) {
|
|
1878
|
-
var t = e.state, r2 = e.options, i2 = e.name, n = r2.mainAxis, o2 = n === void 0 ? true : n, l2 = r2.altAxis,
|
|
1898
|
+
var t = e.state, r2 = e.options, i2 = e.name, n = r2.mainAxis, o2 = n === void 0 ? true : n, l2 = r2.altAxis, s = l2 === void 0 ? false : l2, a2 = r2.boundary, f2 = r2.rootBoundary, c2 = r2.altBoundary, h2 = r2.padding, y2 = r2.tether, u2 = y2 === void 0 ? true : y2, b2 = r2.tetherOffset, v2 = b2 === void 0 ? 0 : b2, d2 = ce(t, {
|
|
1879
1899
|
boundary: a2,
|
|
1880
1900
|
rootBoundary: f2,
|
|
1881
1901
|
padding: h2,
|
|
@@ -1888,23 +1908,23 @@
|
|
|
1888
1908
|
} : Object.assign({
|
|
1889
1909
|
mainAxis: 0,
|
|
1890
1910
|
altAxis: 0
|
|
1891
|
-
}, P2), $2 = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null,
|
|
1911
|
+
}, P2), $2 = t.modifiersData.offset ? t.modifiersData.offset[t.placement] : null, M2 = {
|
|
1892
1912
|
x: 0,
|
|
1893
1913
|
y: 0
|
|
1894
1914
|
};
|
|
1895
1915
|
if (m2) {
|
|
1896
1916
|
if (o2) {
|
|
1897
|
-
var C2,
|
|
1917
|
+
var C2, X2 = p2 === "y" ? k : D, Y2 = p2 === "y" ? S : j, R2 = p2 === "y" ? "height" : "width", W2 = m2[p2], ue = W2 + d2[X2], q2 = W2 - d2[Y2], pe = u2 ? -L2[R2] / 2 : 0, be = O2 === Q ? x2[R2] : L2[R2], re = O2 === Q ? -L2[R2] : -x2[R2], de = t.elements.arrow, G2 = u2 && de ? Be(de) : {
|
|
1898
1918
|
width: 0,
|
|
1899
1919
|
height: 0
|
|
1900
|
-
}, V2 = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding :
|
|
1901
|
-
m2[p2] = Ne,
|
|
1920
|
+
}, V2 = t.modifiersData["arrow#persistent"] ? t.modifiersData["arrow#persistent"].padding : vt(), ie = V2[X2], ve = V2[Y2], z2 = oe(0, x2[R2], G2[R2]), xe = E2 ? x2[R2] / 2 - pe - z2 - ie - A2.mainAxis : be - z2 - ie - A2.mainAxis, xt = E2 ? -x2[R2] / 2 + pe + z2 + ve + A2.mainAxis : re + z2 + ve + A2.mainAxis, Oe = t.elements.arrow && fe(t.elements.arrow), Ot = Oe ? p2 === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, He = (C2 = $2 == null ? void 0 : $2[p2]) != null ? C2 : 0, Et = W2 + xe - He - Ot, At = W2 + xt - He, Ne = oe(u2 ? ye(ue, Et) : ue, W2, u2 ? _(q2, At) : q2);
|
|
1921
|
+
m2[p2] = Ne, M2[p2] = Ne - W2;
|
|
1902
1922
|
}
|
|
1903
|
-
if (
|
|
1904
|
-
var Ie,
|
|
1905
|
-
m2[g2] = ze,
|
|
1923
|
+
if (s) {
|
|
1924
|
+
var Ie, Pt = p2 === "x" ? k : D, Lt = p2 === "x" ? S : j, U2 = m2[g2], he = g2 === "y" ? "height" : "width", Ve = U2 + d2[Pt], Fe = U2 - d2[Lt], Ee = [k, D].indexOf(w2) !== -1, Xe = (Ie = $2 == null ? void 0 : $2[g2]) != null ? Ie : 0, Ye = Ee ? Ve : U2 - x2[he] - L2[he] - Xe + A2.altAxis, qe = Ee ? U2 + x2[he] + L2[he] - Xe - A2.altAxis : Fe, ze = u2 && Ee ? Qt(Ye, U2, qe) : oe(u2 ? Ye : Ve, U2, u2 ? qe : Fe);
|
|
1925
|
+
m2[g2] = ze, M2[g2] = ze - U2;
|
|
1906
1926
|
}
|
|
1907
|
-
t.modifiersData[i2] =
|
|
1927
|
+
t.modifiersData[i2] = M2;
|
|
1908
1928
|
}
|
|
1909
1929
|
}
|
|
1910
1930
|
const kr = {
|
|
@@ -1929,7 +1949,7 @@
|
|
|
1929
1949
|
}
|
|
1930
1950
|
function Tr(e, t, r2) {
|
|
1931
1951
|
r2 === void 0 && (r2 = false);
|
|
1932
|
-
var i2 = T(t), n = T(t) && Br(t), o2 = F(t), l2 = ee(e, n, r2),
|
|
1952
|
+
var i2 = T(t), n = T(t) && Br(t), o2 = F(t), l2 = ee(e, n, r2), s = {
|
|
1933
1953
|
scrollLeft: 0,
|
|
1934
1954
|
scrollTop: 0
|
|
1935
1955
|
}, a2 = {
|
|
@@ -1937,9 +1957,9 @@
|
|
|
1937
1957
|
y: 0
|
|
1938
1958
|
};
|
|
1939
1959
|
return (i2 || !i2 && !r2) && ((N(t) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
|
1940
|
-
|
|
1941
|
-
x: l2.left +
|
|
1942
|
-
y: l2.top +
|
|
1960
|
+
Me(o2)) && (s = Rr(t)), T(t) ? (a2 = ee(t, true), a2.x += t.clientLeft, a2.y += t.clientTop) : o2 && (a2.x = je(o2))), {
|
|
1961
|
+
x: l2.left + s.scrollLeft - a2.x,
|
|
1962
|
+
y: l2.top + s.scrollTop - a2.y,
|
|
1943
1963
|
width: l2.width,
|
|
1944
1964
|
height: l2.height
|
|
1945
1965
|
};
|
|
@@ -1952,9 +1972,9 @@
|
|
|
1952
1972
|
function n(o2) {
|
|
1953
1973
|
r2.add(o2.name);
|
|
1954
1974
|
var l2 = [].concat(o2.requires || [], o2.requiresIfExists || []);
|
|
1955
|
-
l2.forEach(function(
|
|
1956
|
-
if (!r2.has(
|
|
1957
|
-
var a2 = t.get(
|
|
1975
|
+
l2.forEach(function(s) {
|
|
1976
|
+
if (!r2.has(s)) {
|
|
1977
|
+
var a2 = t.get(s);
|
|
1958
1978
|
a2 && n(a2);
|
|
1959
1979
|
}
|
|
1960
1980
|
}), i2.push(o2);
|
|
@@ -1963,7 +1983,7 @@
|
|
|
1963
1983
|
r2.has(o2.name) || n(o2);
|
|
1964
1984
|
}), i2;
|
|
1965
1985
|
}
|
|
1966
|
-
function
|
|
1986
|
+
function jr(e) {
|
|
1967
1987
|
var t = Sr(e);
|
|
1968
1988
|
return zt.reduce(function(r2, i2) {
|
|
1969
1989
|
return r2.concat(t.filter(function(n) {
|
|
@@ -1971,7 +1991,7 @@
|
|
|
1971
1991
|
}));
|
|
1972
1992
|
}, []);
|
|
1973
1993
|
}
|
|
1974
|
-
function
|
|
1994
|
+
function Mr(e) {
|
|
1975
1995
|
var t;
|
|
1976
1996
|
return function() {
|
|
1977
1997
|
return t || (t = new Promise(function(r2) {
|
|
@@ -1981,7 +2001,7 @@
|
|
|
1981
2001
|
})), t;
|
|
1982
2002
|
};
|
|
1983
2003
|
}
|
|
1984
|
-
function
|
|
2004
|
+
function Wr(e) {
|
|
1985
2005
|
var t = e.reduce(function(r2, i2) {
|
|
1986
2006
|
var n = r2[i2.name];
|
|
1987
2007
|
return r2[i2.name] = n ? Object.assign({}, n, i2, {
|
|
@@ -2008,7 +2028,7 @@
|
|
|
2008
2028
|
function Hr(e) {
|
|
2009
2029
|
e === void 0 && (e = {});
|
|
2010
2030
|
var t = e, r2 = t.defaultModifiers, i2 = r2 === void 0 ? [] : r2, n = t.defaultOptions, o2 = n === void 0 ? it : n;
|
|
2011
|
-
return function(
|
|
2031
|
+
return function(s, a2, f2) {
|
|
2012
2032
|
f2 === void 0 && (f2 = o2);
|
|
2013
2033
|
var c2 = {
|
|
2014
2034
|
placement: "bottom",
|
|
@@ -2016,7 +2036,7 @@
|
|
|
2016
2036
|
options: Object.assign({}, it, o2),
|
|
2017
2037
|
modifiersData: {},
|
|
2018
2038
|
elements: {
|
|
2019
|
-
reference:
|
|
2039
|
+
reference: s,
|
|
2020
2040
|
popper: a2
|
|
2021
2041
|
},
|
|
2022
2042
|
attributes: {},
|
|
@@ -2026,10 +2046,10 @@
|
|
|
2026
2046
|
setOptions: function(w2) {
|
|
2027
2047
|
var O2 = typeof w2 == "function" ? w2(c2.options) : w2;
|
|
2028
2048
|
v2(), c2.options = Object.assign({}, o2, c2.options, O2), c2.scrollParents = {
|
|
2029
|
-
reference: K(
|
|
2049
|
+
reference: K(s) ? ae(s) : s.contextElement ? ae(s.contextElement) : [],
|
|
2030
2050
|
popper: ae(a2)
|
|
2031
2051
|
};
|
|
2032
|
-
var E2 =
|
|
2052
|
+
var E2 = jr(Wr([].concat(i2, c2.options.modifiers)));
|
|
2033
2053
|
return c2.orderedModifiers = E2.filter(function(p2) {
|
|
2034
2054
|
return p2.enabled;
|
|
2035
2055
|
}), b2(), u2.update();
|
|
@@ -2067,7 +2087,7 @@
|
|
|
2067
2087
|
},
|
|
2068
2088
|
// Async and optimistically optimized update – it will not be executed if
|
|
2069
2089
|
// not necessary (debounced to run at most once-per-tick)
|
|
2070
|
-
update:
|
|
2090
|
+
update: Mr(function() {
|
|
2071
2091
|
return new Promise(function(d2) {
|
|
2072
2092
|
u2.forceUpdate(), d2(c2);
|
|
2073
2093
|
});
|
|
@@ -2076,7 +2096,7 @@
|
|
|
2076
2096
|
v2(), y2 = true;
|
|
2077
2097
|
}
|
|
2078
2098
|
};
|
|
2079
|
-
if (!nt(
|
|
2099
|
+
if (!nt(s, a2))
|
|
2080
2100
|
return u2;
|
|
2081
2101
|
u2.setOptions(f2).then(function(d2) {
|
|
2082
2102
|
!y2 && f2.onFirstUpdate && f2.onFirstUpdate(d2);
|
|
@@ -2108,18 +2128,16 @@
|
|
|
2108
2128
|
defaultModifiers: Nr
|
|
2109
2129
|
});
|
|
2110
2130
|
async function Ce(e) {
|
|
2111
|
-
if (!e)
|
|
2112
|
-
return this.collection;
|
|
2113
2131
|
const t = this.collection.findIndex((r2) => r2.id === e.id);
|
|
2114
2132
|
if (t >= 0) {
|
|
2115
2133
|
const r2 = this.collection[t];
|
|
2116
|
-
r2.state === "opened" && r2.close(), r2.popper.destroy(),
|
|
2134
|
+
r2.state === "opened" && r2.close(), r2.popper.destroy(), wt(r2), Object.getOwnPropertyNames(r2).forEach((i2) => {
|
|
2117
2135
|
delete r2[i2];
|
|
2118
2136
|
}), this.collection.splice(t, 1);
|
|
2119
2137
|
}
|
|
2120
2138
|
return this.collection;
|
|
2121
2139
|
}
|
|
2122
|
-
function
|
|
2140
|
+
function wt(e) {
|
|
2123
2141
|
return e.__eventListeners && (e.__eventListeners.forEach((t) => {
|
|
2124
2142
|
t.el.forEach((r2) => {
|
|
2125
2143
|
t.type.forEach((i2) => {
|
|
@@ -2128,21 +2146,27 @@
|
|
|
2128
2146
|
});
|
|
2129
2147
|
}), delete e.__eventListeners), e;
|
|
2130
2148
|
}
|
|
2131
|
-
async function
|
|
2149
|
+
async function We(e) {
|
|
2132
2150
|
const t = at.call(this, e);
|
|
2133
2151
|
return t.el.classList.add(this.settings.stateActive), t.trigger.hasAttribute("aria-controls") && t.trigger.setAttribute("aria-expanded", "true"), t.config = ot(t.el, this.settings), t.popper.setOptions({
|
|
2134
2152
|
placement: t.config.placement,
|
|
2135
2153
|
modifiers: [
|
|
2136
2154
|
{ name: "eventListeners", enabled: true },
|
|
2137
|
-
...
|
|
2155
|
+
...Dt(t.config)
|
|
2138
2156
|
]
|
|
2139
2157
|
}), t.popper.update(), t.state = "opened", t;
|
|
2140
2158
|
}
|
|
2141
2159
|
async function Vr(e, t) {
|
|
2142
2160
|
Ce.call(this, e);
|
|
2143
2161
|
const r2 = this, i2 = {
|
|
2162
|
+
id: e.id,
|
|
2163
|
+
state: "closed",
|
|
2164
|
+
el: e,
|
|
2165
|
+
trigger: t,
|
|
2166
|
+
popper: Ir(t, e),
|
|
2167
|
+
config: ot(e, this.settings),
|
|
2144
2168
|
open() {
|
|
2145
|
-
return
|
|
2169
|
+
return We.call(r2, this);
|
|
2146
2170
|
},
|
|
2147
2171
|
close() {
|
|
2148
2172
|
return ke.call(r2, this);
|
|
@@ -2150,26 +2174,18 @@
|
|
|
2150
2174
|
deregister() {
|
|
2151
2175
|
return Ce.call(r2, this);
|
|
2152
2176
|
}
|
|
2153
|
-
}, n = {
|
|
2154
|
-
id: e.id,
|
|
2155
|
-
state: "closed",
|
|
2156
|
-
el: e,
|
|
2157
|
-
trigger: t,
|
|
2158
|
-
popper: Ir(t, e),
|
|
2159
|
-
config: ot(e, this.settings),
|
|
2160
|
-
...i2
|
|
2161
2177
|
};
|
|
2162
|
-
return
|
|
2178
|
+
return i2.trigger.hasAttribute("aria-controls") && i2.trigger.setAttribute("aria-expanded", "false"), bt.call(this, i2), this.collection.push(i2), i2.el.classList.contains(this.settings.stateActive) && (await i2.open(), lt.call(this, i2)), i2;
|
|
2163
2179
|
}
|
|
2164
|
-
function
|
|
2180
|
+
function bt(e) {
|
|
2165
2181
|
return e.__eventListeners || (e.config.event === "hover" ? (e.__eventListeners = [{
|
|
2166
2182
|
el: ["trigger"],
|
|
2167
2183
|
type: ["mouseenter", "focus"],
|
|
2168
|
-
listener:
|
|
2184
|
+
listener: We.bind(this, e)
|
|
2169
2185
|
}, {
|
|
2170
2186
|
el: ["el", "trigger"],
|
|
2171
2187
|
type: ["mouseleave", "focusout"],
|
|
2172
|
-
listener:
|
|
2188
|
+
listener: ct.bind(this, e)
|
|
2173
2189
|
}], e.__eventListeners.forEach((r2) => {
|
|
2174
2190
|
r2.el.forEach((i2) => {
|
|
2175
2191
|
r2.type.forEach((n) => {
|
|
@@ -2189,11 +2205,11 @@
|
|
|
2189
2205
|
}))), e;
|
|
2190
2206
|
}
|
|
2191
2207
|
var J;
|
|
2192
|
-
class
|
|
2208
|
+
class Xr extends $t {
|
|
2193
2209
|
constructor(r2) {
|
|
2194
2210
|
super();
|
|
2195
2211
|
_e(this, J, void 0);
|
|
2196
|
-
this.defaults =
|
|
2212
|
+
this.defaults = kt, this.settings = { ...this.defaults, ...r2 }, this.trigger = null, Ke(this, J, St.bind(this)), this.settings.autoInit && this.init();
|
|
2197
2213
|
}
|
|
2198
2214
|
async init(r2) {
|
|
2199
2215
|
r2 && (this.settings = { ...this.settings, ...r2 });
|
|
@@ -2205,12 +2221,12 @@
|
|
|
2205
2221
|
}
|
|
2206
2222
|
initEventListeners(r2 = true) {
|
|
2207
2223
|
r2 && this.collection.forEach((i2) => {
|
|
2208
|
-
|
|
2224
|
+
bt.call(this, i2);
|
|
2209
2225
|
}), document.addEventListener("keydown", Ae(this, J), false);
|
|
2210
2226
|
}
|
|
2211
2227
|
destroyEventListeners(r2 = true) {
|
|
2212
2228
|
r2 && this.collection.forEach((i2) => {
|
|
2213
|
-
|
|
2229
|
+
wt(i2);
|
|
2214
2230
|
}), document.removeEventListener("keydown", Ae(this, J), false);
|
|
2215
2231
|
}
|
|
2216
2232
|
register(r2) {
|
|
@@ -2218,21 +2234,20 @@
|
|
|
2218
2234
|
return i2.error ? Promise.reject(i2.error) : Vr.call(this, i2.popover, i2.trigger);
|
|
2219
2235
|
}
|
|
2220
2236
|
deregister(r2) {
|
|
2221
|
-
|
|
2222
|
-
return Ce.call(this, i2);
|
|
2237
|
+
let i2 = this.get(r2.id || r2);
|
|
2238
|
+
return i2 ? Ce.call(this, i2) : Promise.reject(new Error(`Failed to deregister; popover does not exist in collection with ID of: "${r2.id || r2}".`));
|
|
2223
2239
|
}
|
|
2224
2240
|
open(r2) {
|
|
2225
|
-
return
|
|
2241
|
+
return We.call(this, r2);
|
|
2226
2242
|
}
|
|
2227
2243
|
close(r2) {
|
|
2228
2244
|
return ke.call(this, r2);
|
|
2229
2245
|
}
|
|
2230
2246
|
}
|
|
2231
2247
|
J = /* @__PURE__ */ new WeakMap();
|
|
2232
|
-
exports2.
|
|
2233
|
-
exports2.
|
|
2234
|
-
exports2.
|
|
2235
|
-
exports2.Popover = qr;
|
|
2248
|
+
exports2.Drawer = st$1;
|
|
2249
|
+
exports2.Modal = J$1;
|
|
2250
|
+
exports2.Popover = Xr;
|
|
2236
2251
|
exports2.core = index;
|
|
2237
2252
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
2238
2253
|
});
|