@justeattakeaway/pie-modal 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dialog-polyfill.esm-29edb142.js +398 -0
- package/dist/index.d.ts +4 -7
- package/dist/index.js +346 -754
- package/dist/react.d.ts +4 -7
- package/dist/react.js +11 -12
- package/package.json +1 -1
- package/src/defs.ts +1 -2
- package/src/index.ts +11 -14
package/dist/index.js
CHANGED
|
@@ -1,192 +1,115 @@
|
|
|
1
|
-
import { css as
|
|
2
|
-
import { html as
|
|
3
|
-
import { property as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
for (var n = i > 1 ? void 0 : i ? ve(t, o) : t, a = e.length - 1, r; a >= 0; a--)
|
|
7
|
-
(r = e[a]) && (n = (i ? r(t, o, n) : r(n)) || n);
|
|
8
|
-
return i && n && fe(t, o, n), n;
|
|
9
|
-
};
|
|
10
|
-
const ye = (e) => {
|
|
11
|
-
class t extends e {
|
|
12
|
-
constructor() {
|
|
13
|
-
var i;
|
|
14
|
-
super(...arguments), this.dir = ((i = document == null ? void 0 : document.documentElement) == null ? void 0 : i.dir) ?? "ltr";
|
|
15
|
-
}
|
|
1
|
+
import { isServer as te, css as I, LitElement as O, html as M, unsafeCSS as ie, nothing as c } from "lit";
|
|
2
|
+
import { html as p, unsafeStatic as oe } from "lit/static-html.js";
|
|
3
|
+
import { property as r, query as $ } from "lit/decorators.js";
|
|
4
|
+
const ne = (n) => {
|
|
5
|
+
class e extends n {
|
|
16
6
|
/**
|
|
17
|
-
*
|
|
18
|
-
* If
|
|
19
|
-
*
|
|
7
|
+
* A getter to determine whether the text direction is right-to-left (RTL).
|
|
8
|
+
* If the `dir` property is present on the component, it will be used to determine the text direction.
|
|
9
|
+
* If running on the client-side (not SSR) and the `dir` property is not present, the text direction will be inferred
|
|
10
|
+
* from the document's root element. This inference is not available during SSR.
|
|
11
|
+
* In all other cases, it will return `false`, indicating a left-to-right (LTR) text direction.
|
|
20
12
|
*
|
|
21
|
-
*
|
|
22
|
-
* If the component falls back to a parent dir attribute then the value
|
|
23
|
-
* will not be reactive and is only computed once
|
|
13
|
+
* @returns {boolean} - Returns `true` if the text direction is RTL, otherwise `false`.
|
|
24
14
|
*/
|
|
25
15
|
get isRTL() {
|
|
26
|
-
return this.dir === "rtl";
|
|
16
|
+
return this.dir ? this.dir === "rtl" : !te && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
|
|
27
17
|
}
|
|
28
18
|
}
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const r = `#${a}`;
|
|
34
|
-
Object.defineProperty(n, a, {
|
|
19
|
+
return e;
|
|
20
|
+
}, E = (n, e, t) => function(o, a) {
|
|
21
|
+
const l = `#${a}`;
|
|
22
|
+
Object.defineProperty(o, a, {
|
|
35
23
|
get() {
|
|
36
|
-
return this[
|
|
24
|
+
return this[l];
|
|
37
25
|
},
|
|
38
26
|
set(h) {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
`<${
|
|
42
|
-
`Must be one of: ${
|
|
43
|
-
`Falling back to default value: "${
|
|
44
|
-
), this[
|
|
27
|
+
const u = this[l];
|
|
28
|
+
e.includes(h) ? this[l] = h : (console.error(
|
|
29
|
+
`<${n}> Invalid value "${h}" provided for property "${a}".`,
|
|
30
|
+
`Must be one of: ${e.join(" | ")}.`,
|
|
31
|
+
`Falling back to default value: "${t}"`
|
|
32
|
+
), this[l] = t), this.requestUpdate(a, u);
|
|
45
33
|
}
|
|
46
34
|
});
|
|
47
|
-
},
|
|
48
|
-
const
|
|
49
|
-
Object.defineProperty(
|
|
35
|
+
}, ae = (n) => function(t, i) {
|
|
36
|
+
const o = `#${i}`;
|
|
37
|
+
Object.defineProperty(t, i, {
|
|
50
38
|
get() {
|
|
51
|
-
return this[
|
|
39
|
+
return this[o];
|
|
52
40
|
},
|
|
53
41
|
set(a) {
|
|
54
|
-
const
|
|
55
|
-
(a == null || typeof a == "string" && a.trim() === "") && console.error(`<${
|
|
42
|
+
const l = this[o];
|
|
43
|
+
(a == null || typeof a == "string" && a.trim() === "") && console.error(`<${n}> Missing required attribute "${i}"`), this[o] = a, this.requestUpdate(i, l);
|
|
56
44
|
}
|
|
57
45
|
});
|
|
58
|
-
}
|
|
59
|
-
function _e(e) {
|
|
60
|
-
if (Array.isArray(e)) {
|
|
61
|
-
for (var t = 0, o = Array(e.length); t < e.length; t++)
|
|
62
|
-
o[t] = e[t];
|
|
63
|
-
return o;
|
|
64
|
-
} else
|
|
65
|
-
return Array.from(e);
|
|
66
|
-
}
|
|
67
|
-
var R = !1;
|
|
68
|
-
if (typeof window < "u") {
|
|
69
|
-
var W = {
|
|
70
|
-
get passive() {
|
|
71
|
-
R = !0;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
window.addEventListener("testPassive", null, W), window.removeEventListener("testPassive", null, W);
|
|
75
|
-
}
|
|
76
|
-
var G = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), m = [], S = !1, J = -1, w = void 0, _ = void 0, Q = function(t) {
|
|
77
|
-
return m.some(function(o) {
|
|
78
|
-
return !!(o.options.allowTouchMove && o.options.allowTouchMove(t));
|
|
79
|
-
});
|
|
80
|
-
}, O = function(t) {
|
|
81
|
-
var o = t || window.event;
|
|
82
|
-
return Q(o.target) || o.touches.length > 1 ? !0 : (o.preventDefault && o.preventDefault(), !1);
|
|
83
|
-
}, ke = function(t) {
|
|
84
|
-
if (_ === void 0) {
|
|
85
|
-
var o = !!t && t.reserveScrollBarGap === !0, i = window.innerWidth - document.documentElement.clientWidth;
|
|
86
|
-
o && i > 0 && (_ = document.body.style.paddingRight, document.body.style.paddingRight = i + "px");
|
|
87
|
-
}
|
|
88
|
-
w === void 0 && (w = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
89
|
-
}, xe = function() {
|
|
90
|
-
_ !== void 0 && (document.body.style.paddingRight = _, _ = void 0), w !== void 0 && (document.body.style.overflow = w, w = void 0);
|
|
91
|
-
}, Ee = function(t) {
|
|
92
|
-
return t ? t.scrollHeight - t.scrollTop <= t.clientHeight : !1;
|
|
93
|
-
}, Me = function(t, o) {
|
|
94
|
-
var i = t.targetTouches[0].clientY - J;
|
|
95
|
-
return Q(t.target) ? !1 : o && o.scrollTop === 0 && i > 0 || Ee(o) && i < 0 ? O(t) : (t.stopPropagation(), !0);
|
|
96
|
-
}, Ce = function(t, o) {
|
|
97
|
-
if (!t) {
|
|
98
|
-
console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (!m.some(function(n) {
|
|
102
|
-
return n.targetElement === t;
|
|
103
|
-
})) {
|
|
104
|
-
var i = {
|
|
105
|
-
targetElement: t,
|
|
106
|
-
options: o || {}
|
|
107
|
-
};
|
|
108
|
-
m = [].concat(_e(m), [i]), G ? (t.ontouchstart = function(n) {
|
|
109
|
-
n.targetTouches.length === 1 && (J = n.targetTouches[0].clientY);
|
|
110
|
-
}, t.ontouchmove = function(n) {
|
|
111
|
-
n.targetTouches.length === 1 && Me(n, t);
|
|
112
|
-
}, S || (document.addEventListener("touchmove", O, R ? { passive: !1 } : void 0), S = !0)) : ke(o);
|
|
113
|
-
}
|
|
114
|
-
}, ze = function(t) {
|
|
115
|
-
if (!t) {
|
|
116
|
-
console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
m = m.filter(function(o) {
|
|
120
|
-
return o.targetElement !== t;
|
|
121
|
-
}), G ? (t.ontouchstart = null, t.ontouchmove = null, S && m.length === 0 && (document.removeEventListener("touchmove", O, R ? { passive: !1 } : void 0), S = !1)) : m.length || xe();
|
|
122
|
-
};
|
|
123
|
-
const A = {
|
|
46
|
+
}, _ = {
|
|
124
47
|
xs: 16,
|
|
125
48
|
s: 20,
|
|
126
49
|
m: 24,
|
|
127
50
|
l: 28,
|
|
128
51
|
xl: 32,
|
|
129
52
|
xxl: 40
|
|
130
|
-
},
|
|
131
|
-
function
|
|
132
|
-
const i = parseInt(
|
|
133
|
-
return i >=
|
|
53
|
+
}, W = Object.keys(_), Y = "xs", U = 8, z = 32;
|
|
54
|
+
function le(n, e, t) {
|
|
55
|
+
const i = parseInt(n, 10), o = i % t === 0;
|
|
56
|
+
return i >= e && o;
|
|
134
57
|
}
|
|
135
|
-
const
|
|
136
|
-
large: (
|
|
137
|
-
regular: (
|
|
58
|
+
const H = {
|
|
59
|
+
large: (n) => le(n, z, U),
|
|
60
|
+
regular: (n) => W.includes(n)
|
|
138
61
|
};
|
|
139
|
-
function
|
|
140
|
-
const
|
|
141
|
-
return { isValid:
|
|
62
|
+
function re(n) {
|
|
63
|
+
const e = H.large(n);
|
|
64
|
+
return { isValid: e, size: e ? n : z };
|
|
142
65
|
}
|
|
143
|
-
function
|
|
144
|
-
const
|
|
145
|
-
return { isValid:
|
|
66
|
+
function se(n) {
|
|
67
|
+
const e = H.regular(n), t = e ? _[n] : _[Y];
|
|
68
|
+
return { isValid: e, size: t };
|
|
146
69
|
}
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
let a,
|
|
150
|
-
if (
|
|
151
|
-
if ({ isValid: a, size:
|
|
152
|
-
const h =
|
|
70
|
+
const m = (n, e, t, i) => {
|
|
71
|
+
const o = n.endsWith("Large") || n.endsWith("-large");
|
|
72
|
+
let a, l;
|
|
73
|
+
if (t) {
|
|
74
|
+
if ({ isValid: a, size: l } = o ? re(t) : se(t), !a) {
|
|
75
|
+
const h = o ? `Invalid prop "size" value supplied to "${i}". The prop value should be a number equal or greater than ${z} and multiple of ${U}.` : `Invalid prop "size" value supplied to "${i}". The prop value should be one of the following values: ${W.join(", ")}.`;
|
|
153
76
|
console.error(h);
|
|
154
77
|
}
|
|
155
78
|
} else
|
|
156
|
-
|
|
79
|
+
l = o ? z : _[Y];
|
|
157
80
|
return {
|
|
158
|
-
class: [
|
|
159
|
-
width:
|
|
160
|
-
height:
|
|
81
|
+
class: [n, e].filter(Boolean).join(" "),
|
|
82
|
+
width: l,
|
|
83
|
+
height: l
|
|
161
84
|
};
|
|
162
85
|
};
|
|
163
|
-
var
|
|
164
|
-
for (var
|
|
165
|
-
(
|
|
166
|
-
return i &&
|
|
86
|
+
var de = Object.defineProperty, ce = Object.getOwnPropertyDescriptor, P = (n, e, t, i) => {
|
|
87
|
+
for (var o = i > 1 ? void 0 : i ? ce(e, t) : e, a = n.length - 1, l; a >= 0; a--)
|
|
88
|
+
(l = n[a]) && (o = (i ? l(e, t, o) : l(o)) || o);
|
|
89
|
+
return i && o && de(e, t, o), o;
|
|
167
90
|
};
|
|
168
|
-
const
|
|
169
|
-
let
|
|
91
|
+
const R = "icon-close";
|
|
92
|
+
let b = class extends O {
|
|
170
93
|
constructor() {
|
|
171
94
|
super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--close";
|
|
172
95
|
}
|
|
173
96
|
connectedCallback() {
|
|
174
|
-
var
|
|
175
|
-
if (super.connectedCallback(), ((
|
|
176
|
-
const
|
|
177
|
-
(
|
|
97
|
+
var e, t, i;
|
|
98
|
+
if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
|
|
99
|
+
const o = m("c-pieIcon c-pieIcon--close", "", null, "IconClose");
|
|
100
|
+
(t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
|
|
178
101
|
}
|
|
179
102
|
}
|
|
180
|
-
updated(
|
|
181
|
-
var
|
|
182
|
-
let
|
|
183
|
-
|
|
103
|
+
updated(e) {
|
|
104
|
+
var t, i;
|
|
105
|
+
let o;
|
|
106
|
+
e.has("size") && (o = m("c-pieIcon c-pieIcon--close", "", this.size, "IconClose"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
|
|
184
107
|
}
|
|
185
108
|
render() {
|
|
186
|
-
return
|
|
109
|
+
return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--close"><path d="M11.868 3.205 8 7.072 4.133 3.205l-.928.927L7.073 8l-3.868 3.867.928.928L8 8.927l3.868 3.868.927-.928L8.928 8l3.867-3.868-.927-.927Z"></path></svg>`;
|
|
187
110
|
}
|
|
188
111
|
};
|
|
189
|
-
|
|
112
|
+
b.styles = I`
|
|
190
113
|
:host-context(pie-icon-button) svg,
|
|
191
114
|
:host-context(pie-button) svg {
|
|
192
115
|
display: block;
|
|
@@ -194,43 +117,43 @@ x.styles = B`
|
|
|
194
117
|
height: var(--btn-icon-size);
|
|
195
118
|
}
|
|
196
119
|
`;
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
],
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
],
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
],
|
|
206
|
-
customElements.get(
|
|
207
|
-
var
|
|
208
|
-
for (var
|
|
209
|
-
(
|
|
210
|
-
return i &&
|
|
120
|
+
P([
|
|
121
|
+
r({ type: String, reflect: !0 })
|
|
122
|
+
], b.prototype, "size", 2);
|
|
123
|
+
P([
|
|
124
|
+
r({ type: String, reflect: !0 })
|
|
125
|
+
], b.prototype, "class", 2);
|
|
126
|
+
P([
|
|
127
|
+
$("svg")
|
|
128
|
+
], b.prototype, "_svg", 2);
|
|
129
|
+
customElements.get(R) === void 0 && customElements.define(R, b);
|
|
130
|
+
var he = Object.defineProperty, pe = Object.getOwnPropertyDescriptor, D = (n, e, t, i) => {
|
|
131
|
+
for (var o = i > 1 ? void 0 : i ? pe(e, t) : e, a = n.length - 1, l; a >= 0; a--)
|
|
132
|
+
(l = n[a]) && (o = (i ? l(e, t, o) : l(o)) || o);
|
|
133
|
+
return i && o && he(e, t, o), o;
|
|
211
134
|
};
|
|
212
|
-
const
|
|
213
|
-
class
|
|
135
|
+
const N = "icon-chevron-left";
|
|
136
|
+
class w extends O {
|
|
214
137
|
constructor() {
|
|
215
138
|
super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--chevronLeft";
|
|
216
139
|
}
|
|
217
140
|
connectedCallback() {
|
|
218
|
-
var
|
|
219
|
-
if (super.connectedCallback(), ((
|
|
220
|
-
const
|
|
221
|
-
(
|
|
141
|
+
var e, t, i;
|
|
142
|
+
if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
|
|
143
|
+
const o = m("c-pieIcon c-pieIcon--chevronLeft", "", null, "IconChevronLeft");
|
|
144
|
+
(t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
|
|
222
145
|
}
|
|
223
146
|
}
|
|
224
|
-
updated(
|
|
225
|
-
var
|
|
226
|
-
let
|
|
227
|
-
|
|
147
|
+
updated(e) {
|
|
148
|
+
var t, i;
|
|
149
|
+
let o;
|
|
150
|
+
e.has("size") && (o = m("c-pieIcon c-pieIcon--chevronLeft", "", this.size, "IconChevronLeft"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
|
|
228
151
|
}
|
|
229
152
|
render() {
|
|
230
|
-
return
|
|
153
|
+
return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronLeft"><path d="M10.96 2.82 5.605 8l5.399 5.197-.875.963-5.565-5.364a1.164 1.164 0 0 1 0-1.671l5.495-5.25.901.945Z"></path></svg>`;
|
|
231
154
|
}
|
|
232
155
|
}
|
|
233
|
-
|
|
156
|
+
w.styles = I`
|
|
234
157
|
:host-context(pie-icon-button) svg,
|
|
235
158
|
:host-context(pie-button) svg {
|
|
236
159
|
display: block;
|
|
@@ -238,43 +161,43 @@ E.styles = B`
|
|
|
238
161
|
height: var(--btn-icon-size);
|
|
239
162
|
}
|
|
240
163
|
`;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
],
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
],
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
],
|
|
250
|
-
customElements.get(
|
|
251
|
-
var
|
|
252
|
-
for (var
|
|
253
|
-
(
|
|
254
|
-
return i &&
|
|
164
|
+
D([
|
|
165
|
+
r({ type: String, reflect: !0 })
|
|
166
|
+
], w.prototype, "size", 2);
|
|
167
|
+
D([
|
|
168
|
+
r({ type: String, reflect: !0 })
|
|
169
|
+
], w.prototype, "class", 2);
|
|
170
|
+
D([
|
|
171
|
+
$("svg")
|
|
172
|
+
], w.prototype, "_svg", 2);
|
|
173
|
+
customElements.get(N) === void 0 && customElements.define(N, w);
|
|
174
|
+
var ge = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, T = (n, e, t, i) => {
|
|
175
|
+
for (var o = i > 1 ? void 0 : i ? ue(e, t) : e, a = n.length - 1, l; a >= 0; a--)
|
|
176
|
+
(l = n[a]) && (o = (i ? l(e, t, o) : l(o)) || o);
|
|
177
|
+
return i && o && ge(e, t, o), o;
|
|
255
178
|
};
|
|
256
|
-
const
|
|
257
|
-
class
|
|
179
|
+
const q = "icon-chevron-right";
|
|
180
|
+
class y extends O {
|
|
258
181
|
constructor() {
|
|
259
182
|
super(...arguments), this.size = "xs", this.class = "c-pieIcon c-pieIcon--chevronRight";
|
|
260
183
|
}
|
|
261
184
|
connectedCallback() {
|
|
262
|
-
var
|
|
263
|
-
if (super.connectedCallback(), ((
|
|
264
|
-
const
|
|
265
|
-
(
|
|
185
|
+
var e, t, i;
|
|
186
|
+
if (super.connectedCallback(), ((e = this._svg) == null ? void 0 : e.getAttribute("width")) === null) {
|
|
187
|
+
const o = m("c-pieIcon c-pieIcon--chevronRight", "", null, "IconChevronRight");
|
|
188
|
+
(t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height);
|
|
266
189
|
}
|
|
267
190
|
}
|
|
268
|
-
updated(
|
|
269
|
-
var
|
|
270
|
-
let
|
|
271
|
-
|
|
191
|
+
updated(e) {
|
|
192
|
+
var t, i;
|
|
193
|
+
let o;
|
|
194
|
+
e.has("size") && (o = m("c-pieIcon c-pieIcon--chevronRight", "", this.size, "IconChevronRight"), (t = this._svg) == null || t.setAttribute("width", o.width), (i = this._svg) == null || i.setAttribute("height", o.height));
|
|
272
195
|
}
|
|
273
196
|
render() {
|
|
274
|
-
return
|
|
197
|
+
return M`<svg xmlns="http://www.w3.org/2000/svg" role="presentation" focusable="false" fill="currentColor" viewBox="0 0 16 16" class="c-pieIcon c-pieIcon--chevronRight"><path d="M5.044 13.18 10.399 8 5 2.82l.875-.962 5.539 5.346a1.164 1.164 0 0 1 0 1.636l-5.469 5.285-.901-.945Z"></path></svg>`;
|
|
275
198
|
}
|
|
276
199
|
}
|
|
277
|
-
|
|
200
|
+
y.styles = I`
|
|
278
201
|
:host-context(pie-icon-button) svg,
|
|
279
202
|
:host-context(pie-button) svg {
|
|
280
203
|
display: block;
|
|
@@ -282,495 +205,164 @@ M.styles = B`
|
|
|
282
205
|
height: var(--btn-icon-size);
|
|
283
206
|
}
|
|
284
207
|
`;
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
],
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
],
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
],
|
|
294
|
-
customElements.get(
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
var o = "on" + t.type.toLowerCase();
|
|
303
|
-
return typeof e[o] == "function" && e[o](t), e.dispatchEvent(t);
|
|
304
|
-
}
|
|
305
|
-
function Be(e) {
|
|
306
|
-
for (; e && e !== document.body; ) {
|
|
307
|
-
var t = window.getComputedStyle(e), o = function(i, n) {
|
|
308
|
-
return !(t[i] === void 0 || t[i] === n);
|
|
309
|
-
};
|
|
310
|
-
if (t.opacity < 1 || o("zIndex", "auto") || o("transform", "none") || o("mixBlendMode", "normal") || o("filter", "none") || o("perspective", "none") || t.isolation === "isolate" || t.position === "fixed" || t.webkitOverflowScrolling === "touch")
|
|
311
|
-
return !0;
|
|
312
|
-
e = e.parentElement;
|
|
313
|
-
}
|
|
314
|
-
return !1;
|
|
315
|
-
}
|
|
316
|
-
function k(e) {
|
|
317
|
-
for (; e; ) {
|
|
318
|
-
if (e.localName === "dialog")
|
|
319
|
-
return (
|
|
320
|
-
/** @type {HTMLDialogElement} */
|
|
321
|
-
e
|
|
322
|
-
);
|
|
323
|
-
e.parentElement ? e = e.parentElement : e.parentNode ? e = e.parentNode.host : e = null;
|
|
324
|
-
}
|
|
325
|
-
return null;
|
|
326
|
-
}
|
|
327
|
-
function ae(e) {
|
|
328
|
-
for (; e && e.shadowRoot && e.shadowRoot.activeElement; )
|
|
329
|
-
e = e.shadowRoot.activeElement;
|
|
330
|
-
e && e.blur && e !== document.body && e.blur();
|
|
331
|
-
}
|
|
332
|
-
function Fe(e, t) {
|
|
333
|
-
for (var o = 0; o < e.length; ++o)
|
|
334
|
-
if (e[o] === t)
|
|
335
|
-
return !0;
|
|
336
|
-
return !1;
|
|
208
|
+
T([
|
|
209
|
+
r({ type: String, reflect: !0 })
|
|
210
|
+
], y.prototype, "size", 2);
|
|
211
|
+
T([
|
|
212
|
+
r({ type: String, reflect: !0 })
|
|
213
|
+
], y.prototype, "class", 2);
|
|
214
|
+
T([
|
|
215
|
+
$("svg")
|
|
216
|
+
], y.prototype, "_svg", 2);
|
|
217
|
+
customElements.get(q) === void 0 && customElements.define(q, y);
|
|
218
|
+
function me(n) {
|
|
219
|
+
if (Array.isArray(n)) {
|
|
220
|
+
for (var e = 0, t = Array(n.length); e < n.length; e++)
|
|
221
|
+
t[e] = n[e];
|
|
222
|
+
return t;
|
|
223
|
+
} else
|
|
224
|
+
return Array.from(n);
|
|
337
225
|
}
|
|
338
|
-
|
|
339
|
-
|
|
226
|
+
var j = !1;
|
|
227
|
+
if (typeof window < "u") {
|
|
228
|
+
var V = {
|
|
229
|
+
get passive() {
|
|
230
|
+
j = !0;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
window.addEventListener("testPassive", null, V), window.removeEventListener("testPassive", null, V);
|
|
340
234
|
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
return
|
|
235
|
+
var Z = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), g = [], C = !1, G = -1, v = void 0, f = void 0, X = function(e) {
|
|
236
|
+
return g.some(function(t) {
|
|
237
|
+
return !!(t.options.allowTouchMove && t.options.allowTouchMove(e));
|
|
344
238
|
});
|
|
345
|
-
|
|
346
|
-
var
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
if (!
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
return !o || o.form !== t ? null : o;
|
|
367
|
-
}
|
|
368
|
-
function Ne(e) {
|
|
369
|
-
if (!e.defaultPrevented) {
|
|
370
|
-
var t = (
|
|
371
|
-
/** @type {!HTMLFormElement} */
|
|
372
|
-
e.target
|
|
373
|
-
), o = l.imagemapUseValue, i = le(e);
|
|
374
|
-
o === null && i && (o = i.value);
|
|
375
|
-
var n = k(t);
|
|
376
|
-
if (n) {
|
|
377
|
-
var a = i && i.getAttribute("formmethod") || t.getAttribute("method");
|
|
378
|
-
a === "dialog" && (e.preventDefault(), o != null ? n.close(o) : n.close());
|
|
379
|
-
}
|
|
239
|
+
}, A = function(e) {
|
|
240
|
+
var t = e || window.event;
|
|
241
|
+
return X(t.target) || t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
|
|
242
|
+
}, ve = function(e) {
|
|
243
|
+
if (f === void 0) {
|
|
244
|
+
var t = !!e && e.reserveScrollBarGap === !0, i = window.innerWidth - document.documentElement.clientWidth;
|
|
245
|
+
t && i > 0 && (f = document.body.style.paddingRight, document.body.style.paddingRight = i + "px");
|
|
246
|
+
}
|
|
247
|
+
v === void 0 && (v = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
248
|
+
}, fe = function() {
|
|
249
|
+
f !== void 0 && (document.body.style.paddingRight = f, f = void 0), v !== void 0 && (document.body.style.overflow = v, v = void 0);
|
|
250
|
+
}, be = function(e) {
|
|
251
|
+
return e ? e.scrollHeight - e.scrollTop <= e.clientHeight : !1;
|
|
252
|
+
}, we = function(e, t) {
|
|
253
|
+
var i = e.targetTouches[0].clientY - G;
|
|
254
|
+
return X(e.target) ? !1 : t && t.scrollTop === 0 && i > 0 || be(t) && i < 0 ? A(e) : (e.stopPropagation(), !0);
|
|
255
|
+
}, ye = function(e, t) {
|
|
256
|
+
if (!e) {
|
|
257
|
+
console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");
|
|
258
|
+
return;
|
|
380
259
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
var
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
var o = !1, i = function() {
|
|
388
|
-
o ? this.downgradeModal() : this.maybeHideModal(), o = !1;
|
|
389
|
-
}.bind(this), n, a = function(r) {
|
|
390
|
-
if (r.target === e) {
|
|
391
|
-
var h = "DOMNodeRemoved";
|
|
392
|
-
o |= r.type.substr(0, h.length) === h, window.clearTimeout(n), n = window.setTimeout(i, 0);
|
|
393
|
-
}
|
|
260
|
+
if (!g.some(function(o) {
|
|
261
|
+
return o.targetElement === e;
|
|
262
|
+
})) {
|
|
263
|
+
var i = {
|
|
264
|
+
targetElement: e,
|
|
265
|
+
options: t || {}
|
|
394
266
|
};
|
|
395
|
-
[
|
|
396
|
-
|
|
397
|
-
})
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
{
|
|
406
|
-
get dialog() {
|
|
407
|
-
return this.dialog_;
|
|
408
|
-
},
|
|
409
|
-
/**
|
|
410
|
-
* Maybe remove this dialog from the modal top layer. This is called when
|
|
411
|
-
* a modal dialog may no longer be tenable, e.g., when the dialog is no
|
|
412
|
-
* longer open or is no longer part of the DOM.
|
|
413
|
-
*/
|
|
414
|
-
maybeHideModal: function() {
|
|
415
|
-
this.dialog_.hasAttribute("open") && X(this.dialog_) || this.downgradeModal();
|
|
416
|
-
},
|
|
417
|
-
/**
|
|
418
|
-
* Remove this dialog from the modal top layer, leaving it as a non-modal.
|
|
419
|
-
*/
|
|
420
|
-
downgradeModal: function() {
|
|
421
|
-
this.openAsModal_ && (this.openAsModal_ = !1, this.dialog_.style.zIndex = "", this.replacedStyleTop_ && (this.dialog_.style.top = "", this.replacedStyleTop_ = !1), this.backdrop_.parentNode && this.backdrop_.parentNode.removeChild(this.backdrop_), l.dm.removeDialog(this));
|
|
422
|
-
},
|
|
423
|
-
/**
|
|
424
|
-
* @param {boolean} value whether to open or close this dialog
|
|
425
|
-
*/
|
|
426
|
-
setOpen: function(e) {
|
|
427
|
-
e ? this.dialog_.hasAttribute("open") || this.dialog_.setAttribute("open", "") : (this.dialog_.removeAttribute("open"), this.maybeHideModal());
|
|
428
|
-
},
|
|
429
|
-
/**
|
|
430
|
-
* Handles mouse events ('mouseup', 'mousedown', 'click') on the fake .backdrop element, redirecting them as if
|
|
431
|
-
* they were on the dialog itself.
|
|
432
|
-
*
|
|
433
|
-
* @param {!Event} e to redirect
|
|
434
|
-
*/
|
|
435
|
-
backdropMouseEvent_: function(e) {
|
|
436
|
-
if (this.dialog_.hasAttribute("tabindex"))
|
|
437
|
-
this.dialog_.focus();
|
|
438
|
-
else {
|
|
439
|
-
var t = document.createElement("div");
|
|
440
|
-
this.dialog_.insertBefore(t, this.dialog_.firstChild), t.tabIndex = -1, t.focus(), this.dialog_.removeChild(t);
|
|
441
|
-
}
|
|
442
|
-
var o = document.createEvent("MouseEvents");
|
|
443
|
-
o.initMouseEvent(
|
|
444
|
-
e.type,
|
|
445
|
-
e.bubbles,
|
|
446
|
-
e.cancelable,
|
|
447
|
-
window,
|
|
448
|
-
e.detail,
|
|
449
|
-
e.screenX,
|
|
450
|
-
e.screenY,
|
|
451
|
-
e.clientX,
|
|
452
|
-
e.clientY,
|
|
453
|
-
e.ctrlKey,
|
|
454
|
-
e.altKey,
|
|
455
|
-
e.shiftKey,
|
|
456
|
-
e.metaKey,
|
|
457
|
-
e.button,
|
|
458
|
-
e.relatedTarget
|
|
459
|
-
), this.dialog_.dispatchEvent(o), e.stopPropagation();
|
|
460
|
-
},
|
|
461
|
-
/**
|
|
462
|
-
* Focuses on the first focusable element within the dialog. This will always blur the current
|
|
463
|
-
* focus, even if nothing within the dialog is found.
|
|
464
|
-
*/
|
|
465
|
-
focus_: function() {
|
|
466
|
-
var e = this.dialog_.querySelector("[autofocus]:not([disabled])");
|
|
467
|
-
!e && this.dialog_.tabIndex >= 0 && (e = this.dialog_), e || (e = re(this.dialog_)), ae(document.activeElement), e && e.focus();
|
|
468
|
-
},
|
|
469
|
-
/**
|
|
470
|
-
* Sets the zIndex for the backdrop and dialog.
|
|
471
|
-
*
|
|
472
|
-
* @param {number} dialogZ
|
|
473
|
-
* @param {number} backdropZ
|
|
474
|
-
*/
|
|
475
|
-
updateZIndex: function(e, t) {
|
|
476
|
-
if (e < t)
|
|
477
|
-
throw new Error("dialogZ should never be < backdropZ");
|
|
478
|
-
this.dialog_.style.zIndex = e, this.backdrop_.style.zIndex = t;
|
|
479
|
-
},
|
|
480
|
-
/**
|
|
481
|
-
* Shows the dialog. If the dialog is already open, this does nothing.
|
|
482
|
-
*/
|
|
483
|
-
show: function() {
|
|
484
|
-
this.dialog_.open || (this.setOpen(!0), this.focus_());
|
|
485
|
-
},
|
|
486
|
-
/**
|
|
487
|
-
* Show this dialog modally.
|
|
488
|
-
*/
|
|
489
|
-
showModal: function() {
|
|
490
|
-
if (this.dialog_.hasAttribute("open"))
|
|
491
|
-
throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");
|
|
492
|
-
if (!X(this.dialog_))
|
|
493
|
-
throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");
|
|
494
|
-
if (!l.dm.pushDialog(this))
|
|
495
|
-
throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");
|
|
496
|
-
Be(this.dialog_.parentElement) && console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"), this.setOpen(!0), this.openAsModal_ = !0, l.needsCentering(this.dialog_) ? (l.reposition(this.dialog_), this.replacedStyleTop_ = !0) : this.replacedStyleTop_ = !1, this.dialog_.parentNode.insertBefore(this.backdrop_, this.dialog_.nextSibling), this.focus_();
|
|
497
|
-
},
|
|
498
|
-
/**
|
|
499
|
-
* Closes this HTMLDialogElement. This is optional vs clearing the open
|
|
500
|
-
* attribute, however this fires a 'close' event.
|
|
501
|
-
*
|
|
502
|
-
* @param {string=} opt_returnValue to use as the returnValue
|
|
503
|
-
*/
|
|
504
|
-
close: function(e) {
|
|
505
|
-
if (!this.dialog_.hasAttribute("open"))
|
|
506
|
-
throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");
|
|
507
|
-
this.setOpen(!1), e !== void 0 && (this.dialog_.returnValue = e);
|
|
508
|
-
var t = new v("close", {
|
|
509
|
-
bubbles: !1,
|
|
510
|
-
cancelable: !1
|
|
511
|
-
});
|
|
512
|
-
ne(this.dialog_, t);
|
|
513
|
-
}
|
|
514
|
-
};
|
|
515
|
-
var l = {};
|
|
516
|
-
l.reposition = function(e) {
|
|
517
|
-
var t = document.body.scrollTop || document.documentElement.scrollTop, o = t + (window.innerHeight - e.offsetHeight) / 2;
|
|
518
|
-
e.style.top = Math.max(t, o) + "px";
|
|
519
|
-
};
|
|
520
|
-
l.isInlinePositionSetByStylesheet = function(e) {
|
|
521
|
-
for (var t = 0; t < document.styleSheets.length; ++t) {
|
|
522
|
-
var o = document.styleSheets[t], i = null;
|
|
523
|
-
try {
|
|
524
|
-
i = o.cssRules;
|
|
525
|
-
} catch {
|
|
526
|
-
}
|
|
527
|
-
if (i)
|
|
528
|
-
for (var n = 0; n < i.length; ++n) {
|
|
529
|
-
var a = i[n], r = null;
|
|
530
|
-
try {
|
|
531
|
-
r = document.querySelectorAll(a.selectorText);
|
|
532
|
-
} catch {
|
|
533
|
-
}
|
|
534
|
-
if (!(!r || !Fe(r, e))) {
|
|
535
|
-
var h = a.style.getPropertyValue("top"), p = a.style.getPropertyValue("bottom");
|
|
536
|
-
if (h && h !== "auto" || p && p !== "auto")
|
|
537
|
-
return !0;
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
return !1;
|
|
542
|
-
};
|
|
543
|
-
l.needsCentering = function(e) {
|
|
544
|
-
var t = window.getComputedStyle(e);
|
|
545
|
-
return t.position !== "absolute" || e.style.top !== "auto" && e.style.top !== "" || e.style.bottom !== "auto" && e.style.bottom !== "" ? !1 : !l.isInlinePositionSetByStylesheet(e);
|
|
546
|
-
};
|
|
547
|
-
l.forceRegisterDialog = function(e) {
|
|
548
|
-
if ((window.HTMLDialogElement || e.showModal) && console.warn("This browser already supports <dialog>, the polyfill may not work correctly", e), e.localName !== "dialog")
|
|
549
|
-
throw new Error("Failed to register dialog: The element is not a dialog.");
|
|
550
|
-
new se(
|
|
551
|
-
/** @type {!HTMLDialogElement} */
|
|
552
|
-
e
|
|
553
|
-
);
|
|
554
|
-
};
|
|
555
|
-
l.registerDialog = function(e) {
|
|
556
|
-
e.showModal || l.forceRegisterDialog(e);
|
|
557
|
-
};
|
|
558
|
-
l.DialogManager = function() {
|
|
559
|
-
this.pendingDialogStack = [];
|
|
560
|
-
var e = this.checkDOM_.bind(this);
|
|
561
|
-
this.overlay = document.createElement("div"), this.overlay.className = "_dialog_overlay", this.overlay.addEventListener("click", function(t) {
|
|
562
|
-
this.forwardTab_ = void 0, t.stopPropagation(), e([]);
|
|
563
|
-
}.bind(this)), this.handleKey_ = this.handleKey_.bind(this), this.handleFocus_ = this.handleFocus_.bind(this), this.zIndexLow_ = 1e5, this.zIndexHigh_ = 1e5 + 150, this.forwardTab_ = void 0, "MutationObserver" in window && (this.mo_ = new MutationObserver(function(t) {
|
|
564
|
-
var o = [];
|
|
565
|
-
t.forEach(function(i) {
|
|
566
|
-
for (var n = 0, a; a = i.removedNodes[n]; ++n) {
|
|
567
|
-
if (a instanceof Element)
|
|
568
|
-
a.localName === "dialog" && o.push(a);
|
|
569
|
-
else
|
|
570
|
-
continue;
|
|
571
|
-
o = o.concat(a.querySelectorAll("dialog"));
|
|
572
|
-
}
|
|
573
|
-
}), o.length && e(o);
|
|
574
|
-
}));
|
|
575
|
-
};
|
|
576
|
-
l.DialogManager.prototype.blockDocument = function() {
|
|
577
|
-
document.documentElement.addEventListener("focus", this.handleFocus_, !0), document.addEventListener("keydown", this.handleKey_), this.mo_ && this.mo_.observe(document, { childList: !0, subtree: !0 });
|
|
578
|
-
};
|
|
579
|
-
l.DialogManager.prototype.unblockDocument = function() {
|
|
580
|
-
document.documentElement.removeEventListener("focus", this.handleFocus_, !0), document.removeEventListener("keydown", this.handleKey_), this.mo_ && this.mo_.disconnect();
|
|
581
|
-
};
|
|
582
|
-
l.DialogManager.prototype.updateStacking = function() {
|
|
583
|
-
for (var e = this.zIndexHigh_, t = 0, o; o = this.pendingDialogStack[t]; ++t)
|
|
584
|
-
o.updateZIndex(--e, --e), t === 0 && (this.overlay.style.zIndex = --e);
|
|
585
|
-
var i = this.pendingDialogStack[0];
|
|
586
|
-
if (i) {
|
|
587
|
-
var n = i.dialog.parentNode || document.body;
|
|
588
|
-
n.appendChild(this.overlay);
|
|
589
|
-
} else
|
|
590
|
-
this.overlay.parentNode && this.overlay.parentNode.removeChild(this.overlay);
|
|
591
|
-
};
|
|
592
|
-
l.DialogManager.prototype.containedByTopDialog_ = function(e) {
|
|
593
|
-
for (; e = k(e); ) {
|
|
594
|
-
for (var t = 0, o; o = this.pendingDialogStack[t]; ++t)
|
|
595
|
-
if (o.dialog === e)
|
|
596
|
-
return t === 0;
|
|
597
|
-
e = e.parentElement;
|
|
598
|
-
}
|
|
599
|
-
return !1;
|
|
600
|
-
};
|
|
601
|
-
l.DialogManager.prototype.handleFocus_ = function(e) {
|
|
602
|
-
var t = e.composedPath ? e.composedPath()[0] : e.target;
|
|
603
|
-
if (!this.containedByTopDialog_(t) && document.activeElement !== document.documentElement && (e.preventDefault(), e.stopPropagation(), ae(
|
|
604
|
-
/** @type {Element} */
|
|
605
|
-
t
|
|
606
|
-
), this.forwardTab_ !== void 0)) {
|
|
607
|
-
var o = this.pendingDialogStack[0], i = o.dialog, n = i.compareDocumentPosition(t);
|
|
608
|
-
return n & Node.DOCUMENT_POSITION_PRECEDING && (this.forwardTab_ ? o.focus_() : t !== document.documentElement && document.documentElement.focus()), !1;
|
|
267
|
+
g = [].concat(me(g), [i]), Z ? (e.ontouchstart = function(o) {
|
|
268
|
+
o.targetTouches.length === 1 && (G = o.targetTouches[0].clientY);
|
|
269
|
+
}, e.ontouchmove = function(o) {
|
|
270
|
+
o.targetTouches.length === 1 && we(o, e);
|
|
271
|
+
}, C || (document.addEventListener("touchmove", A, j ? { passive: !1 } : void 0), C = !0)) : ve(t);
|
|
272
|
+
}
|
|
273
|
+
}, ke = function(e) {
|
|
274
|
+
if (!e) {
|
|
275
|
+
console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");
|
|
276
|
+
return;
|
|
609
277
|
}
|
|
278
|
+
g = g.filter(function(t) {
|
|
279
|
+
return t.targetElement !== e;
|
|
280
|
+
}), Z ? (e.ontouchstart = null, e.ontouchmove = null, C && g.length === 0 && (document.removeEventListener("touchmove", A, j ? { passive: !1 } : void 0), C = !1)) : g.length || fe();
|
|
610
281
|
};
|
|
611
|
-
l.
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
}), o = this.pendingDialogStack[0];
|
|
618
|
-
o && ne(o.dialog, t) && o.dialog.close();
|
|
619
|
-
} else
|
|
620
|
-
e.keyCode === 9 && (this.forwardTab_ = !e.shiftKey);
|
|
621
|
-
};
|
|
622
|
-
l.DialogManager.prototype.checkDOM_ = function(e) {
|
|
623
|
-
var t = this.pendingDialogStack.slice();
|
|
624
|
-
t.forEach(function(o) {
|
|
625
|
-
e.indexOf(o.dialog) !== -1 ? o.downgradeModal() : o.maybeHideModal();
|
|
626
|
-
});
|
|
627
|
-
};
|
|
628
|
-
l.DialogManager.prototype.pushDialog = function(e) {
|
|
629
|
-
var t = (this.zIndexHigh_ - this.zIndexLow_) / 2 - 1;
|
|
630
|
-
return this.pendingDialogStack.length >= t ? !1 : (this.pendingDialogStack.unshift(e) === 1 && this.blockDocument(), this.updateStacking(), !0);
|
|
631
|
-
};
|
|
632
|
-
l.DialogManager.prototype.removeDialog = function(e) {
|
|
633
|
-
var t = this.pendingDialogStack.indexOf(e);
|
|
634
|
-
t !== -1 && (this.pendingDialogStack.splice(t, 1), this.pendingDialogStack.length === 0 && this.unblockDocument(), this.updateStacking());
|
|
635
|
-
};
|
|
636
|
-
l.dm = new l.DialogManager();
|
|
637
|
-
l.formSubmitter = null;
|
|
638
|
-
l.imagemapUseValue = null;
|
|
639
|
-
if (window.HTMLDialogElement === void 0) {
|
|
640
|
-
var Z = document.createElement("form");
|
|
641
|
-
if (Z.setAttribute("method", "dialog"), Z.method !== "dialog") {
|
|
642
|
-
var f = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, "method");
|
|
643
|
-
if (f) {
|
|
644
|
-
var Re = f.get;
|
|
645
|
-
f.get = function() {
|
|
646
|
-
return $(this) ? "dialog" : Re.call(this);
|
|
647
|
-
};
|
|
648
|
-
var je = f.set;
|
|
649
|
-
f.set = function(e) {
|
|
650
|
-
return typeof e == "string" && e.toLowerCase() === "dialog" ? this.setAttribute("method", e) : je.call(this, e);
|
|
651
|
-
}, Object.defineProperty(HTMLFormElement.prototype, "method", f);
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
document.addEventListener("click", function(e) {
|
|
655
|
-
if (l.formSubmitter = null, l.imagemapUseValue = null, !e.defaultPrevented) {
|
|
656
|
-
var t = (
|
|
657
|
-
/** @type {Element} */
|
|
658
|
-
e.target
|
|
659
|
-
);
|
|
660
|
-
if ("composedPath" in e) {
|
|
661
|
-
var o = e.composedPath();
|
|
662
|
-
t = o.shift() || t;
|
|
663
|
-
}
|
|
664
|
-
if (!(!t || !$(t.form))) {
|
|
665
|
-
var i = t.type === "submit" && ["button", "input"].indexOf(t.localName) > -1;
|
|
666
|
-
if (!i) {
|
|
667
|
-
if (!(t.localName === "input" && t.type === "image"))
|
|
668
|
-
return;
|
|
669
|
-
l.imagemapUseValue = e.offsetX + "," + e.offsetY;
|
|
670
|
-
}
|
|
671
|
-
var n = k(t);
|
|
672
|
-
n && (l.formSubmitter = t);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
}, !1), document.addEventListener("submit", function(e) {
|
|
676
|
-
var t = e.target, o = k(t);
|
|
677
|
-
if (!o) {
|
|
678
|
-
var i = le(e), n = i && i.getAttribute("formmethod") || t.getAttribute("method");
|
|
679
|
-
n === "dialog" && e.preventDefault();
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
var He = HTMLFormElement.prototype.submit, Ve = function() {
|
|
683
|
-
if (!$(this))
|
|
684
|
-
return He.call(this);
|
|
685
|
-
var e = k(this);
|
|
686
|
-
e && e.close();
|
|
687
|
-
};
|
|
688
|
-
HTMLFormElement.prototype.submit = Ve;
|
|
689
|
-
}
|
|
690
|
-
const qe = `dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:white;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.1)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}*,*:before,*:after{box-sizing:border-box}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.c-modal{--modal-size-s: 450px;--modal-size-m: 600px;--modal-size-l: 1080px;--modal-border-radius: var(--dt-radius-rounded-d);--modal-font: var(--dt-font-interactive-m-family);--modal-bg-color: var(--dt-color-container-default);--modal-elevation: var(--dt-elevation-04);text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;border-radius:var(--modal-border-radius);border:none;box-shadow:var(--modal-elevation);font-family:var(--modal-font);background-color:var(--modal-bg-color);padding:0;--modal-margin-none: var(--dt-spacing-none);--modal-margin-small: var(--dt-spacing-g);--modal-margin-large: var(--dt-spacing-j);--modal-margin-block: var(--modal-margin-small);--modal-block-size: fit-content;--modal-inline-size: 75%;--modal-max-block-size: calc(100vh - calc(var(--modal-margin-block) * 2));--modal-max-inline-size: var(--modal-size-m);block-size:var(--modal-block-size);inline-size:var(--modal-inline-size);max-block-size:var(--modal-max-block-size);max-inline-size:var(--modal-max-inline-size)}.c-modal:focus-visible{outline:none}@media (max-width: 768px){.c-modal pie-icon-button{--btn-dimension: 40px}}.c-modal[open]{display:flex;flex-direction:column}@media (min-width: 768px){.c-modal{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=small]{--modal-max-inline-size: var(--modal-size-s)}@media (min-width: 768px){.c-modal[size=small]{--modal-margin-block: var(--modal-margin-large)}}@media (max-width: 767px){.c-modal[size=medium][isfullwidthbelowmid]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%;--modal-max-inline-size: 100%}}.c-modal[size=large]{--modal-inline-size: 75%;--modal-max-inline-size: var(--modal-size-l);--modal-margin-block: var(--modal-margin-large)}@media (max-width: 767px){.c-modal[size=large]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j)}@media (max-width: 767px){.c-modal[position=top][isfullwidthbelowmid]{margin-block-start:var(--dt-spacing-none)}}.c-modal::backdrop{background:rgba(0,0,0,.5)}.c-modal .c-modal-footer{--modal-button-spacing: var(--dt-spacing-d);--modal-footer-padding: var(--dt-spacing-d);display:flex;flex-flow:row-reverse;flex-wrap:wrap;gap:var(--modal-button-spacing);padding:var(--modal-footer-padding)}@media (min-width: 768px){.c-modal .c-modal-footer{--modal-footer-padding: var(--dt-spacing-e)}}@media (max-width: 767px){.c-modal[hasstackedactions] .c-modal-footer{flex-direction:column}}.c-modal .c-modal-header{padding-inline:var(--dt-spacing-d);padding-block:14px;display:grid;grid-template-areas:"back heading close" ". heading .";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:center}@media (min-width: 768px){.c-modal .c-modal-header{padding-inline:var(--dt-spacing-e);padding-block:20px}}.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-end:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-end:var(--dt-spacing-c)}}.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--wide) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 1px);--modal-header-font-weight: var(--dt-font-heading-m-weight);font-size:var(--modal-header-font-size);line-height:var(--modal-header-font-line-height);font-weight:var(--modal-header-font-weight);margin:0;grid-area:heading}.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-d)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-e)}}.c-modal .c-modal-backBtn{grid-area:back}.c-modal .c-modal-closeBtn{grid-area:close}.c-modal[isfooterpinned] .c-modal-content,.c-modal .c-modal-scrollContainer{overflow-y:auto}.c-modal .c-modal-scrollContainer{--bg-scroll-start: linear-gradient(var(--dt-color-container-default) 30%, rgba(255, 255, 255, 0));--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-top: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));--bg-scroll-bottom: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-start: 100% 40px;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-top: 100% 16px;--bg-size-scroll-bottom: 100% 16px;background:var(--bg-scroll-start),var(--bg-scroll-end),var(--bg-scroll-top),var(--bg-scroll-bottom);background-repeat:no-repeat;background-color:var(--dt-color-container-default);background-size:var(--bg-size-scroll-start),var(--bg-size-scroll-end),var(--bg-size-scroll-top),var(--bg-size-scroll-bottom);background-attachment:local,local,scroll,scroll}.c-modal .c-modal-content{--modal-content-font-size: calc(var(--dt-font-size-16) * 1px);--modal-content-font-weight: var(--dt-font-weight-regular);--modal-content-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--modal-content-padding: var(--dt-spacing-e);--modal-content-padding-block: var(--dt-spacing-a);--spinner-size: 48px;--spinner-border-width: 6px;--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;position:relative;min-block-size:var(--dt-spacing-j);font-size:var(--modal-content-font-size);line-height:var(--modal-content-line-height);font-weight:var(--modal-content-font-weight);padding-inline:var(--modal-content-padding);padding-block:var(--modal-content-padding-block)}.c-modal .c-modal-content--scrollable{background:linear-gradient(to bottom,transparent,var(--dt-color-container-default) 75%) center bottom,linear-gradient(transparent,var(--dt-color-border-strong)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 12px;background-attachment:local,scroll}.c-modal .c-modal-content:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;opacity:0}.c-modal[isLoading] .c-modal-content:before{animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count);opacity:1}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{opacity:0}
|
|
691
|
-
`, We = ["h1", "h2", "h3", "h4", "h5", "h6"], Ue = ["small", "medium", "large"], Ye = ["top", "center"], P = "pie-modal-close", z = "pie-modal-open", T = "pie-modal-back", Ke = "pie-modal-leading-action-click", Xe = "pie-modal-supporting-action-click";
|
|
692
|
-
var Ze = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, c = (e, t, o, i) => {
|
|
693
|
-
for (var n = i > 1 ? void 0 : i ? Ge(t, o) : t, a = e.length - 1, r; a >= 0; a--)
|
|
694
|
-
(r = e[a]) && (n = (i ? r(t, o, n) : r(n)) || n);
|
|
695
|
-
return i && n && Ze(t, o, n), n;
|
|
282
|
+
const xe = `dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:white;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.1)}._dialog_overlay{position:fixed;top:0;right:0;bottom:0;left:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}*,*:before,*:after{box-sizing:border-box}@keyframes rotate360{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.c-modal{--modal-size-s: 450px;--modal-size-m: 600px;--modal-size-l: 1080px;--modal-border-radius: var(--dt-radius-rounded-d);--modal-font: var(--dt-font-interactive-m-family);--modal-bg-color: var(--dt-color-container-default);--modal-elevation: var(--dt-elevation-04);text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased;border-radius:var(--modal-border-radius);border:none;box-shadow:var(--modal-elevation);font-family:var(--modal-font);background-color:var(--modal-bg-color);padding:0;--modal-margin-none: var(--dt-spacing-none);--modal-margin-small: var(--dt-spacing-g);--modal-margin-large: var(--dt-spacing-j);--modal-margin-block: var(--modal-margin-small);--modal-block-size: fit-content;--modal-inline-size: 75%;--modal-max-block-size: calc(100vh - calc(var(--modal-margin-block) * 2));--modal-max-inline-size: var(--modal-size-m);block-size:var(--modal-block-size);inline-size:var(--modal-inline-size);max-block-size:var(--modal-max-block-size);max-inline-size:var(--modal-max-inline-size)}.c-modal:focus-visible{outline:none}@media (max-width: 768px){.c-modal pie-icon-button{--btn-dimension: 40px}}.c-modal[open]{display:flex;flex-direction:column}@media (min-width: 768px){.c-modal{--modal-margin-block: var(--modal-margin-large)}}.c-modal[size=small]{--modal-max-inline-size: var(--modal-size-s)}@media (min-width: 768px){.c-modal[size=small]{--modal-margin-block: var(--modal-margin-large)}}@media (max-width: 767px){.c-modal[size=medium][isfullwidthbelowmid]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%;--modal-max-inline-size: 100%}}.c-modal[size=large]{--modal-inline-size: 75%;--modal-max-inline-size: var(--modal-size-l);--modal-margin-block: var(--modal-margin-large)}@media (max-width: 767px){.c-modal[size=large]{--modal-margin-block: var(--modal-margin-none);--modal-border-radius: var(--dt-radius-rounded-none);--modal-block-size: 100%;--modal-inline-size: 100%}}.c-modal[position=top]{margin-block-start:var(--dt-spacing-j)}@media (max-width: 767px){.c-modal[position=top][isfullwidthbelowmid]{margin-block-start:var(--dt-spacing-none)}}.c-modal::backdrop{background:rgba(0,0,0,.5)}.c-modal .c-modal-footer{--modal-button-spacing: var(--dt-spacing-d);--modal-footer-padding: var(--dt-spacing-d);display:flex;flex-flow:row-reverse;flex-wrap:wrap;gap:var(--modal-button-spacing);padding:var(--modal-footer-padding)}@media (min-width: 768px){.c-modal .c-modal-footer{--modal-footer-padding: var(--dt-spacing-e)}}@media (max-width: 767px){.c-modal[hasstackedactions] .c-modal-footer{flex-direction:column}}.c-modal .c-modal-header{padding-inline:var(--dt-spacing-d);padding-block:14px;display:grid;grid-template-areas:"back heading close" ". heading .";grid-template-columns:minmax(0,max-content) minmax(0,1fr) minmax(0,max-content);align-items:center}@media (min-width: 768px){.c-modal .c-modal-header{padding-inline:var(--dt-spacing-e);padding-block:20px}}.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-b);padding-inline-end:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-header{padding-block:var(--dt-spacing-c);padding-inline-end:var(--dt-spacing-c)}}.c-modal .c-modal-heading{--modal-header-font-size: calc(var(--dt-font-heading-m-size--wide) * 1px);--modal-header-font-line-height: calc(var(--dt-font-heading-m-line-height--wide) * 1px);--modal-header-font-weight: var(--dt-font-heading-m-weight);font-size:var(--modal-header-font-size);line-height:var(--modal-header-font-line-height);font-weight:var(--modal-header-font-weight);margin:0;grid-area:heading}.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-b)}@media (min-width: 768px){.c-modal[hasbackbutton] .c-modal-heading{padding-inline-start:var(--dt-spacing-c)}}.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-d)}@media (min-width: 768px){.c-modal[isdismissible] .c-modal-heading{padding-inline-end:var(--dt-spacing-e)}}.c-modal .c-modal-backBtn{grid-area:back}.c-modal .c-modal-closeBtn{grid-area:close}.c-modal[isfooterpinned] .c-modal-content,.c-modal .c-modal-scrollContainer{overflow-y:auto}.c-modal .c-modal-scrollContainer{--bg-scroll-start: linear-gradient(var(--dt-color-container-default) 30%, rgba(255, 255, 255, 0));--bg-scroll-end: linear-gradient(rgba(255, 255, 255, 0), var(--dt-color-container-default) 70%) 0 100%;--bg-scroll-top: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0));--bg-scroll-bottom: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0)) 0 100%;--bg-size-scroll-start: 100% 40px;--bg-size-scroll-end: 100% 40px;--bg-size-scroll-top: 100% 16px;--bg-size-scroll-bottom: 100% 16px;background:var(--bg-scroll-start),var(--bg-scroll-end),var(--bg-scroll-top),var(--bg-scroll-bottom);background-repeat:no-repeat;background-color:var(--dt-color-container-default);background-size:var(--bg-size-scroll-start),var(--bg-size-scroll-end),var(--bg-size-scroll-top),var(--bg-size-scroll-bottom);background-attachment:local,local,scroll,scroll}.c-modal .c-modal-content{--modal-content-font-size: calc(var(--dt-font-size-16) * 1px);--modal-content-font-weight: var(--dt-font-weight-regular);--modal-content-line-height: calc(var(--dt-font-size-16-line-height) * 1px);--modal-content-padding: var(--dt-spacing-e);--modal-content-padding-block: var(--dt-spacing-a);--spinner-size: 48px;--spinner-border-width: 6px;--spinner-base-color-h: var(--dt-color-content-interactive-secondary-h);--spinner-base-color-s: var(--dt-color-content-interactive-secondary-s);--spinner-base-color-l: var(--dt-color-content-interactive-secondary-l);--spinner-left-color-opacity: .35;--spinner-left-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), var(--spinner-left-color-opacity));--spinner-right-color: hsl(var(--spinner-base-color-h), var(--spinner-base-color-s), var(--spinner-base-color-l), 1);--spinner-animation-duration: 1.15s;--spinner-animation-timing-function: linear;--spinner-animation-iteration-count: infinite;position:relative;min-block-size:var(--dt-spacing-j);font-size:var(--modal-content-font-size);line-height:var(--modal-content-line-height);font-weight:var(--modal-content-font-weight);padding-inline:var(--modal-content-padding);padding-block:var(--modal-content-padding-block)}.c-modal .c-modal-content--scrollable{background:linear-gradient(to bottom,transparent,var(--dt-color-container-default) 75%) center bottom,linear-gradient(transparent,var(--dt-color-border-strong)) center bottom;background-repeat:no-repeat;background-size:100% 48px,100% 12px;background-attachment:local,scroll}.c-modal .c-modal-content:before{content:"";position:absolute;left:50%;top:50%;translate:-50% -50%;height:var(--spinner-size);width:var(--spinner-size);display:block;background-color:transparent;border-radius:50%;border-color:var(--spinner-left-color) var(--spinner-right-color) var(--spinner-right-color) var(--spinner-left-color);border-width:var(--spinner-border-width);border-style:solid;will-change:transform;opacity:0}.c-modal[isLoading] .c-modal-content:before{animation:rotate360 var(--spinner-animation-duration) var(--spinner-animation-timing-function) var(--spinner-animation-iteration-count);opacity:1}.c-modal[isLoading] .c-modal-content .c-modal-contentInner{opacity:0}
|
|
283
|
+
`, _e = ["h1", "h2", "h3", "h4", "h5", "h6"], ze = ["small", "medium", "large"], Ce = ["top", "center"], S = "pie-modal-close", x = "pie-modal-open", B = "pie-modal-back", Ae = "pie-modal-leading-action-click", Oe = "pie-modal-supporting-action-click";
|
|
284
|
+
var $e = Object.defineProperty, Le = Object.getOwnPropertyDescriptor, d = (n, e, t, i) => {
|
|
285
|
+
for (var o = i > 1 ? void 0 : i ? Le(e, t) : e, a = n.length - 1, l; a >= 0; a--)
|
|
286
|
+
(l = n[a]) && (o = (i ? l(e, t, o) : l(o)) || o);
|
|
287
|
+
return i && o && $e(e, t, o), o;
|
|
696
288
|
};
|
|
697
|
-
const
|
|
698
|
-
class
|
|
289
|
+
const k = "pie-modal";
|
|
290
|
+
class s extends ne(O) {
|
|
699
291
|
constructor() {
|
|
700
|
-
super(), this.headingLevel = "h2", this.hasBackButton = !1, this.hasStackedActions = !1, this.isDismissible = !1, this.isFooterPinned = !0, this.isFullWidthBelowMid = !1, this.isLoading = !1, this.isOpen = !1, this.position = "center", this.size = "medium", this._backButtonClicked = !1, this._handleDialogCancelEvent = (
|
|
701
|
-
this.isDismissible ||
|
|
702
|
-
}, this._handleDialogLightDismiss = (
|
|
703
|
-
var
|
|
292
|
+
super(...arguments), this.headingLevel = "h2", this.hasBackButton = !1, this.hasStackedActions = !1, this.isDismissible = !1, this.isFooterPinned = !0, this.isFullWidthBelowMid = !1, this.isLoading = !1, this.isOpen = !1, this.position = "center", this.size = "medium", this._backButtonClicked = !1, this._handleDialogCancelEvent = (e) => {
|
|
293
|
+
this.isDismissible || e.preventDefault();
|
|
294
|
+
}, this._handleDialogLightDismiss = (e) => {
|
|
295
|
+
var u;
|
|
704
296
|
if (!this.isDismissible)
|
|
705
297
|
return;
|
|
706
|
-
const
|
|
298
|
+
const t = (u = this._dialog) == null ? void 0 : u.getBoundingClientRect(), {
|
|
707
299
|
top: i = 0,
|
|
708
|
-
bottom:
|
|
300
|
+
bottom: o = 0,
|
|
709
301
|
left: a = 0,
|
|
710
|
-
right:
|
|
711
|
-
} =
|
|
712
|
-
if (i === 0 &&
|
|
302
|
+
right: l = 0
|
|
303
|
+
} = t || {};
|
|
304
|
+
if (i === 0 && o === 0 && a === 0 && l === 0)
|
|
713
305
|
return;
|
|
714
|
-
(
|
|
715
|
-
}, this._dispatchModalCustomEvent = (
|
|
716
|
-
const
|
|
306
|
+
(e.clientY < i || e.clientY > o || e.clientX < a || e.clientX > l) && (this.isOpen = !1);
|
|
307
|
+
}, this._dispatchModalCustomEvent = (e) => {
|
|
308
|
+
const t = new CustomEvent(e, {
|
|
717
309
|
bubbles: !0,
|
|
718
310
|
composed: !0
|
|
719
311
|
});
|
|
720
|
-
this.dispatchEvent(
|
|
721
|
-
}
|
|
312
|
+
this.dispatchEvent(t);
|
|
313
|
+
};
|
|
722
314
|
}
|
|
723
315
|
connectedCallback() {
|
|
724
|
-
super.connectedCallback(), document.addEventListener(
|
|
316
|
+
super.connectedCallback(), this.addEventListener("click", (e) => this._handleDialogLightDismiss(e)), document.addEventListener(x, this._handleModalOpened.bind(this)), document.addEventListener(S, this._handleModalClosed.bind(this)), document.addEventListener(B, this._handleModalClosed.bind(this));
|
|
725
317
|
}
|
|
726
318
|
disconnectedCallback() {
|
|
727
|
-
document.removeEventListener(
|
|
319
|
+
document.removeEventListener(x, this._handleModalOpened.bind(this)), document.removeEventListener(S, this._handleModalClosed.bind(this)), document.removeEventListener(B, this._handleModalClosed.bind(this)), super.disconnectedCallback();
|
|
728
320
|
}
|
|
729
|
-
firstUpdated(
|
|
730
|
-
this._dialog && (
|
|
321
|
+
async firstUpdated(e) {
|
|
322
|
+
super.firstUpdated(e), this._dialog && ((await import("./dialog-polyfill.esm-29edb142.js").then((i) => i.default)).registerDialog(this._dialog), this._dialog.addEventListener("cancel", (i) => this._handleDialogCancelEvent(i)), this._dialog.addEventListener("close", () => {
|
|
731
323
|
this.isOpen = !1;
|
|
732
|
-
})), this._handleModalOpenStateOnFirstRender(
|
|
324
|
+
})), this._handleModalOpenStateOnFirstRender(e);
|
|
733
325
|
}
|
|
734
|
-
updated(
|
|
735
|
-
this._handleModalOpenStateChanged(
|
|
326
|
+
updated(e) {
|
|
327
|
+
super.updated(e), this._handleModalOpenStateChanged(e);
|
|
736
328
|
}
|
|
737
329
|
/**
|
|
738
330
|
* Opens the dialog element and disables page scrolling
|
|
739
331
|
*/
|
|
740
332
|
_handleModalOpened() {
|
|
741
|
-
var
|
|
742
|
-
const
|
|
743
|
-
|
|
333
|
+
var t, i, o, a;
|
|
334
|
+
const e = (t = this._dialog) == null ? void 0 : t.querySelector(".c-modal-scrollContainer");
|
|
335
|
+
e && ye(e), !((i = this._dialog) != null && i.hasAttribute("open") || !((o = this._dialog) != null && o.isConnected)) && ((a = this._dialog) == null || a.showModal());
|
|
744
336
|
}
|
|
745
337
|
/**
|
|
746
338
|
* Closes the dialog element and re-enables page scrolling
|
|
747
339
|
*/
|
|
748
340
|
_handleModalClosed() {
|
|
749
|
-
var
|
|
750
|
-
const
|
|
751
|
-
|
|
341
|
+
var t, i;
|
|
342
|
+
const e = (t = this._dialog) == null ? void 0 : t.querySelector(".c-modal-scrollContainer");
|
|
343
|
+
e && ke(e), (i = this._dialog) == null || i.close(), this._returnFocus();
|
|
752
344
|
}
|
|
753
345
|
// Handles the value of the isOpen property on first render of the component
|
|
754
|
-
_handleModalOpenStateOnFirstRender(
|
|
755
|
-
|
|
346
|
+
_handleModalOpenStateOnFirstRender(e) {
|
|
347
|
+
e.get("isOpen") === void 0 && this.isOpen && this._dispatchModalCustomEvent(x);
|
|
756
348
|
}
|
|
757
349
|
// Handles changes to the modal isOpen property by dispatching any appropriate events
|
|
758
|
-
_handleModalOpenStateChanged(
|
|
759
|
-
const
|
|
760
|
-
|
|
350
|
+
_handleModalOpenStateChanged(e) {
|
|
351
|
+
const t = e.get("isOpen");
|
|
352
|
+
t !== void 0 && (t ? this._backButtonClicked ? (this._backButtonClicked = !1, this._dispatchModalCustomEvent(B)) : this._dispatchModalCustomEvent(S) : this._dispatchModalCustomEvent(x));
|
|
761
353
|
}
|
|
762
|
-
_handleActionClick(
|
|
763
|
-
var
|
|
764
|
-
|
|
354
|
+
_handleActionClick(e) {
|
|
355
|
+
var t, i;
|
|
356
|
+
e === "leading" ? ((t = this._dialog) == null || t.close("leading"), this._dispatchModalCustomEvent(Ae)) : e === "supporting" && ((i = this._dialog) == null || i.close("supporting"), this._dispatchModalCustomEvent(Oe));
|
|
765
357
|
}
|
|
766
358
|
/**
|
|
767
359
|
* Return focus to the specified element, providing the selector is valid
|
|
768
360
|
* and the chosen element can be found.
|
|
769
361
|
*/
|
|
770
362
|
_returnFocus() {
|
|
771
|
-
var
|
|
772
|
-
const
|
|
773
|
-
|
|
363
|
+
var t, i;
|
|
364
|
+
const e = (t = this.returnFocusAfterCloseSelector) == null ? void 0 : t.trim();
|
|
365
|
+
e && ((i = document.querySelector(e)) == null || i.focus());
|
|
774
366
|
}
|
|
775
367
|
/**
|
|
776
368
|
* Template for the close button element. Called within the
|
|
@@ -779,15 +371,15 @@ class d extends ye(L) {
|
|
|
779
371
|
* @private
|
|
780
372
|
*/
|
|
781
373
|
renderCloseButton() {
|
|
782
|
-
var
|
|
783
|
-
return
|
|
374
|
+
var e;
|
|
375
|
+
return p`
|
|
784
376
|
<pie-icon-button
|
|
785
377
|
@click="${() => {
|
|
786
378
|
this.isOpen = !1;
|
|
787
379
|
}}"
|
|
788
380
|
variant="ghost-secondary"
|
|
789
381
|
class="c-modal-closeBtn"
|
|
790
|
-
aria-label="${((
|
|
382
|
+
aria-label="${((e = this.aria) == null ? void 0 : e.close) || c}"
|
|
791
383
|
data-test-id="modal-close-button">
|
|
792
384
|
<icon-close></icon-close>
|
|
793
385
|
</pie-icon-button>`;
|
|
@@ -799,17 +391,17 @@ class d extends ye(L) {
|
|
|
799
391
|
* @private
|
|
800
392
|
*/
|
|
801
393
|
renderBackButton() {
|
|
802
|
-
var
|
|
803
|
-
return
|
|
394
|
+
var e;
|
|
395
|
+
return p`
|
|
804
396
|
<pie-icon-button
|
|
805
397
|
@click="${() => {
|
|
806
398
|
this._backButtonClicked = !0, this.isOpen = !1;
|
|
807
399
|
}}"
|
|
808
400
|
variant="ghost-secondary"
|
|
809
401
|
class="c-modal-backBtn"
|
|
810
|
-
aria-label="${((
|
|
402
|
+
aria-label="${((e = this.aria) == null ? void 0 : e.back) || c}"
|
|
811
403
|
data-test-id="modal-back-button">
|
|
812
|
-
${this.isRTL ?
|
|
404
|
+
${this.isRTL ? p`<icon-chevron-right></icon-chevron-right>` : p`<icon-chevron-left></icon-chevron-left>`}
|
|
813
405
|
</pie-icon-button>
|
|
814
406
|
`;
|
|
815
407
|
}
|
|
@@ -823,18 +415,18 @@ class d extends ye(L) {
|
|
|
823
415
|
* @private
|
|
824
416
|
*/
|
|
825
417
|
renderLeadingAction() {
|
|
826
|
-
const { text:
|
|
827
|
-
return
|
|
418
|
+
const { text: e, variant: t = "primary", ariaLabel: i } = this.leadingAction;
|
|
419
|
+
return e ? p`
|
|
828
420
|
<pie-button
|
|
829
|
-
variant="${
|
|
830
|
-
aria-label="${i ||
|
|
421
|
+
variant="${t}"
|
|
422
|
+
aria-label="${i || c}"
|
|
831
423
|
type="submit"
|
|
832
424
|
?isFullWidth="${this.hasStackedActions}"
|
|
833
425
|
@click="${() => this._handleActionClick("leading")}"
|
|
834
426
|
data-test-id="modal-leading-action">
|
|
835
|
-
${
|
|
427
|
+
${e}
|
|
836
428
|
</pie-button>
|
|
837
|
-
` :
|
|
429
|
+
` : c;
|
|
838
430
|
}
|
|
839
431
|
/**
|
|
840
432
|
* Render supportingAction button depending on prop availability.
|
|
@@ -848,76 +440,76 @@ class d extends ye(L) {
|
|
|
848
440
|
* @private
|
|
849
441
|
*/
|
|
850
442
|
renderSupportingAction() {
|
|
851
|
-
const { text:
|
|
852
|
-
return
|
|
443
|
+
const { text: e, variant: t = "ghost", ariaLabel: i } = this.supportingAction;
|
|
444
|
+
return e ? this.leadingAction ? p`
|
|
853
445
|
<pie-button
|
|
854
|
-
variant="${
|
|
855
|
-
aria-label="${i ||
|
|
446
|
+
variant="${t}"
|
|
447
|
+
aria-label="${i || c}"
|
|
856
448
|
type="reset"
|
|
857
449
|
?isFullWidth="${this.hasStackedActions}"
|
|
858
450
|
@click="${() => this._handleActionClick("supporting")}"
|
|
859
451
|
data-test-id="modal-supporting-action">
|
|
860
|
-
${
|
|
452
|
+
${e}
|
|
861
453
|
</pie-button>
|
|
862
|
-
` : (console.warn("Use `leadingAction` instead of `supportingAction`. `supportingAction` is being ignored."),
|
|
454
|
+
` : (console.warn("Use `leadingAction` instead of `supportingAction`. `supportingAction` is being ignored."), c) : c;
|
|
863
455
|
}
|
|
864
456
|
/**
|
|
865
457
|
* Renders the modal inner content and footer of the modal.
|
|
866
458
|
* @private
|
|
867
459
|
*/
|
|
868
460
|
renderModalContentAndFooter() {
|
|
869
|
-
return
|
|
461
|
+
return p`
|
|
870
462
|
<article class="c-modal-scrollContainer c-modal-content c-modal-content--scrollable">
|
|
871
463
|
<div class="c-modal-contentInner">
|
|
872
464
|
<slot></slot>
|
|
873
465
|
</div>
|
|
874
466
|
</article>
|
|
875
467
|
<footer class="c-modal-footer">
|
|
876
|
-
${this.leadingAction ? this.renderLeadingAction() :
|
|
877
|
-
${this.supportingAction ? this.renderSupportingAction() :
|
|
468
|
+
${this.leadingAction ? this.renderLeadingAction() : c}
|
|
469
|
+
${this.supportingAction ? this.renderSupportingAction() : c}
|
|
878
470
|
</footer>`;
|
|
879
471
|
}
|
|
880
472
|
render() {
|
|
881
473
|
const {
|
|
882
|
-
aria:
|
|
883
|
-
hasBackButton:
|
|
474
|
+
aria: e,
|
|
475
|
+
hasBackButton: t,
|
|
884
476
|
hasStackedActions: i,
|
|
885
|
-
heading:
|
|
477
|
+
heading: o,
|
|
886
478
|
headingLevel: a = "h2",
|
|
887
|
-
isDismissible:
|
|
479
|
+
isDismissible: l,
|
|
888
480
|
isFooterPinned: h,
|
|
889
|
-
isFullWidthBelowMid:
|
|
890
|
-
isLoading:
|
|
891
|
-
leadingAction:
|
|
892
|
-
position:
|
|
893
|
-
size:
|
|
894
|
-
supportingAction:
|
|
895
|
-
} = this,
|
|
896
|
-
return
|
|
481
|
+
isFullWidthBelowMid: u,
|
|
482
|
+
isLoading: L,
|
|
483
|
+
leadingAction: J,
|
|
484
|
+
position: Q,
|
|
485
|
+
size: K,
|
|
486
|
+
supportingAction: ee
|
|
487
|
+
} = this, F = oe(a);
|
|
488
|
+
return p`
|
|
897
489
|
<dialog
|
|
898
490
|
id="dialog"
|
|
899
491
|
class="c-modal"
|
|
900
|
-
size="${
|
|
901
|
-
position="${
|
|
902
|
-
?hasActions=${
|
|
903
|
-
?hasBackButton=${
|
|
492
|
+
size="${K}"
|
|
493
|
+
position="${Q}"
|
|
494
|
+
?hasActions=${J || ee}
|
|
495
|
+
?hasBackButton=${t}
|
|
904
496
|
?hasStackedActions=${i}
|
|
905
|
-
?isDismissible=${
|
|
497
|
+
?isDismissible=${l}
|
|
906
498
|
?isFooterPinned=${h}
|
|
907
|
-
?isFullWidthBelowMid=${
|
|
908
|
-
?isLoading=${
|
|
909
|
-
aria-busy="${
|
|
910
|
-
aria-label="${
|
|
499
|
+
?isFullWidthBelowMid=${u}
|
|
500
|
+
?isLoading=${L}
|
|
501
|
+
aria-busy="${L ? "true" : "false"}"
|
|
502
|
+
aria-label="${L && (e == null ? void 0 : e.loading) || c}"
|
|
911
503
|
data-test-id="pie-modal">
|
|
912
504
|
<header class="c-modal-header">
|
|
913
|
-
${
|
|
914
|
-
<${
|
|
915
|
-
${
|
|
916
|
-
</${
|
|
917
|
-
${
|
|
505
|
+
${t ? this.renderBackButton() : c}
|
|
506
|
+
<${F} class="c-modal-heading">
|
|
507
|
+
${o}
|
|
508
|
+
</${F}>
|
|
509
|
+
${l ? this.renderCloseButton() : c}
|
|
918
510
|
</header>
|
|
919
511
|
${// We need to wrap the remaining content in a shared scrollable container if the footer is not pinned
|
|
920
|
-
h ? this.renderModalContentAndFooter() :
|
|
512
|
+
h ? this.renderModalContentAndFooter() : p`
|
|
921
513
|
<div class="c-modal-scrollContainer">
|
|
922
514
|
${this.renderModalContentAndFooter()}
|
|
923
515
|
</div>
|
|
@@ -925,68 +517,68 @@ class d extends ye(L) {
|
|
|
925
517
|
</dialog>`;
|
|
926
518
|
}
|
|
927
519
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
],
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
],
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
],
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
],
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
],
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
],
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
],
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
],
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
],
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
],
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
],
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
],
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
],
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
],
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
],
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
],
|
|
981
|
-
customElements.define(
|
|
520
|
+
s.styles = ie(xe);
|
|
521
|
+
d([
|
|
522
|
+
r({ type: Object })
|
|
523
|
+
], s.prototype, "aria", 2);
|
|
524
|
+
d([
|
|
525
|
+
r({ type: String }),
|
|
526
|
+
ae(k)
|
|
527
|
+
], s.prototype, "heading", 2);
|
|
528
|
+
d([
|
|
529
|
+
r(),
|
|
530
|
+
E(k, _e, "h2")
|
|
531
|
+
], s.prototype, "headingLevel", 2);
|
|
532
|
+
d([
|
|
533
|
+
r({ type: Boolean })
|
|
534
|
+
], s.prototype, "hasBackButton", 2);
|
|
535
|
+
d([
|
|
536
|
+
r({ type: Boolean })
|
|
537
|
+
], s.prototype, "hasStackedActions", 2);
|
|
538
|
+
d([
|
|
539
|
+
r({ type: Boolean, reflect: !0 })
|
|
540
|
+
], s.prototype, "isDismissible", 2);
|
|
541
|
+
d([
|
|
542
|
+
r({ type: Boolean })
|
|
543
|
+
], s.prototype, "isFooterPinned", 2);
|
|
544
|
+
d([
|
|
545
|
+
r({ type: Boolean })
|
|
546
|
+
], s.prototype, "isFullWidthBelowMid", 2);
|
|
547
|
+
d([
|
|
548
|
+
r({ type: Boolean, reflect: !0 })
|
|
549
|
+
], s.prototype, "isLoading", 2);
|
|
550
|
+
d([
|
|
551
|
+
r({ type: Boolean })
|
|
552
|
+
], s.prototype, "isOpen", 2);
|
|
553
|
+
d([
|
|
554
|
+
r({ type: Object })
|
|
555
|
+
], s.prototype, "leadingAction", 2);
|
|
556
|
+
d([
|
|
557
|
+
r(),
|
|
558
|
+
E(k, Ce, "center")
|
|
559
|
+
], s.prototype, "position", 2);
|
|
560
|
+
d([
|
|
561
|
+
r()
|
|
562
|
+
], s.prototype, "returnFocusAfterCloseSelector", 2);
|
|
563
|
+
d([
|
|
564
|
+
r(),
|
|
565
|
+
E(k, ze, "medium")
|
|
566
|
+
], s.prototype, "size", 2);
|
|
567
|
+
d([
|
|
568
|
+
r({ type: Object })
|
|
569
|
+
], s.prototype, "supportingAction", 2);
|
|
570
|
+
d([
|
|
571
|
+
$("dialog")
|
|
572
|
+
], s.prototype, "_dialog", 2);
|
|
573
|
+
customElements.define(k, s);
|
|
982
574
|
export {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
575
|
+
B as ON_MODAL_BACK_EVENT,
|
|
576
|
+
S as ON_MODAL_CLOSE_EVENT,
|
|
577
|
+
Ae as ON_MODAL_LEADING_ACTION_CLICK,
|
|
578
|
+
x as ON_MODAL_OPEN_EVENT,
|
|
579
|
+
Oe as ON_MODAL_SUPPORTING_ACTION_CLICK,
|
|
580
|
+
s as PieModal,
|
|
581
|
+
_e as headingLevels,
|
|
582
|
+
Ce as positions,
|
|
583
|
+
ze as sizes
|
|
992
584
|
};
|