@justeattakeaway/pie-modal 1.0.2 → 1.1.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/index.js +13 -13
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { LitElement as F, unsafeCSS as T, nothing as p } from "lit";
|
|
|
2
2
|
import { html as s, unsafeStatic as P } from "lit/static-html.js";
|
|
3
3
|
import { property as d, query as K } from "lit/decorators.js";
|
|
4
4
|
import { classMap as B } from "lit/directives/class-map.js";
|
|
5
|
-
import { ifDefined as
|
|
5
|
+
import { ifDefined as v } from "lit/directives/if-defined.js";
|
|
6
6
|
import "@justeattakeaway/pie-button";
|
|
7
7
|
import "@justeattakeaway/pie-icon-button";
|
|
8
8
|
import { RtlMixin as I, dispatchCustomEvent as h, requiredProperty as N, validPropertyValues as _, defineCustomElement as W } from "@justeattakeaway/pie-webc-core";
|
|
@@ -36,7 +36,7 @@ var O = typeof window < "u" && window.navigator && window.navigator.platform &&
|
|
|
36
36
|
return D(o.target) || o.touches.length > 1 ? !0 : (o.preventDefault && o.preventDefault(), !1);
|
|
37
37
|
}, j = function(e) {
|
|
38
38
|
if (f === void 0) {
|
|
39
|
-
var o =
|
|
39
|
+
var o = !1, t = window.innerWidth - document.documentElement.clientWidth;
|
|
40
40
|
o && t > 0 && (f = document.body.style.paddingRight, document.body.style.paddingRight = t + "px");
|
|
41
41
|
}
|
|
42
42
|
u === void 0 && (u = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
@@ -63,7 +63,7 @@ var O = typeof window < "u" && window.navigator && window.navigator.platform &&
|
|
|
63
63
|
i.targetTouches.length === 1 && (M = i.targetTouches[0].clientY);
|
|
64
64
|
}, e.ontouchmove = function(i) {
|
|
65
65
|
i.targetTouches.length === 1 && H(i, e);
|
|
66
|
-
}, k || (document.addEventListener("touchmove", y, x ? { passive: !1 } : void 0), k = !0)) : j(
|
|
66
|
+
}, k || (document.addEventListener("touchmove", y, x ? { passive: !1 } : void 0), k = !0)) : j();
|
|
67
67
|
}
|
|
68
68
|
}, U = function(e) {
|
|
69
69
|
if (!e) {
|
|
@@ -91,7 +91,7 @@ var oe = Object.defineProperty, l = (a, e, o, t) => {
|
|
|
91
91
|
(g = a[c]) && (i = g(e, o, i) || i);
|
|
92
92
|
return i && oe(e, o, i), i;
|
|
93
93
|
};
|
|
94
|
-
const
|
|
94
|
+
const b = "pie-modal", C = class C extends I(F) {
|
|
95
95
|
constructor() {
|
|
96
96
|
super(...arguments), this.headingLevel = r.headingLevel, this.hasBackButton = r.hasBackButton, this.hasStackedActions = r.hasStackedActions, this.isDismissible = r.isDismissible, this.isFooterPinned = r.isFooterPinned, this.isFullWidthBelowMid = r.isFullWidthBelowMid, this.isLoading = r.isLoading, this.isOpen = r.isOpen, this.position = r.position, this.size = r.size, this._backButtonClicked = !1, this._escKeyAbortController = null, this._preventModalKeyboardDismissal = (e) => {
|
|
97
97
|
e.key === "Escape" && e.preventDefault();
|
|
@@ -237,7 +237,7 @@ const v = "pie-modal", C = class C extends I(F) {
|
|
|
237
237
|
}}"
|
|
238
238
|
variant="ghost-secondary"
|
|
239
239
|
class="c-modal-backBtn"
|
|
240
|
-
aria-label="${
|
|
240
|
+
aria-label="${v((e = this.aria) == null ? void 0 : e.back)}"
|
|
241
241
|
data-test-id="modal-back-button">
|
|
242
242
|
${this.isRTL ? s`<icon-chevron-right></icon-chevron-right>` : s`<icon-chevron-left></icon-chevron-left>`}
|
|
243
243
|
</pie-icon-button>
|
|
@@ -257,7 +257,7 @@ const v = "pie-modal", C = class C extends I(F) {
|
|
|
257
257
|
return o ? s`
|
|
258
258
|
<pie-button
|
|
259
259
|
variant="${t}"
|
|
260
|
-
aria-label="${
|
|
260
|
+
aria-label="${v(e)}"
|
|
261
261
|
type="submit"
|
|
262
262
|
?isFullWidth="${this.hasStackedActions}"
|
|
263
263
|
@click="${() => this._handleActionClick("leading")}"
|
|
@@ -282,7 +282,7 @@ const v = "pie-modal", C = class C extends I(F) {
|
|
|
282
282
|
return !o || !((i = this.leadingAction) != null && i.text) ? p : s`
|
|
283
283
|
<pie-button
|
|
284
284
|
variant="${t}"
|
|
285
|
-
aria-label="${
|
|
285
|
+
aria-label="${v(e)}"
|
|
286
286
|
type="reset"
|
|
287
287
|
?isFullWidth="${this.hasStackedActions}"
|
|
288
288
|
@click="${() => this._handleActionClick("supporting")}"
|
|
@@ -367,7 +367,7 @@ const v = "pie-modal", C = class C extends I(F) {
|
|
|
367
367
|
id="dialog"
|
|
368
368
|
class="${B(E)}"
|
|
369
369
|
aria-busy="${c ? "true" : "false"}"
|
|
370
|
-
aria-label="${
|
|
370
|
+
aria-label="${v($)}"
|
|
371
371
|
data-test-id="pie-modal">
|
|
372
372
|
<header class="c-modal-header" data-test-id="modal-header">
|
|
373
373
|
${this.renderBackButton()}
|
|
@@ -389,11 +389,11 @@ l([
|
|
|
389
389
|
], n.prototype, "aria");
|
|
390
390
|
l([
|
|
391
391
|
d({ type: String }),
|
|
392
|
-
N(
|
|
392
|
+
N(b)
|
|
393
393
|
], n.prototype, "heading");
|
|
394
394
|
l([
|
|
395
395
|
d({ type: String }),
|
|
396
|
-
_(
|
|
396
|
+
_(b, G, r.headingLevel)
|
|
397
397
|
], n.prototype, "headingLevel");
|
|
398
398
|
l([
|
|
399
399
|
d({ type: Boolean })
|
|
@@ -421,14 +421,14 @@ l([
|
|
|
421
421
|
], n.prototype, "leadingAction");
|
|
422
422
|
l([
|
|
423
423
|
d({ type: String }),
|
|
424
|
-
_(
|
|
424
|
+
_(b, Q, r.position)
|
|
425
425
|
], n.prototype, "position");
|
|
426
426
|
l([
|
|
427
427
|
d({ type: String })
|
|
428
428
|
], n.prototype, "returnFocusAfterCloseSelector");
|
|
429
429
|
l([
|
|
430
430
|
d({ type: String }),
|
|
431
|
-
_(
|
|
431
|
+
_(b, J, r.size)
|
|
432
432
|
], n.prototype, "size");
|
|
433
433
|
l([
|
|
434
434
|
d({ type: Object })
|
|
@@ -436,7 +436,7 @@ l([
|
|
|
436
436
|
l([
|
|
437
437
|
K("dialog")
|
|
438
438
|
], n.prototype, "_dialog");
|
|
439
|
-
W(
|
|
439
|
+
W(b, n);
|
|
440
440
|
export {
|
|
441
441
|
L as ON_MODAL_BACK_EVENT,
|
|
442
442
|
A as ON_MODAL_CLOSE_EVENT,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-modal",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "PIE design system modal built using web components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@custom-elements-manifest/analyzer": "0.9.0",
|
|
39
|
-
"@justeat/pie-design-tokens": "6.
|
|
39
|
+
"@justeat/pie-design-tokens": "6.8.1",
|
|
40
40
|
"@justeattakeaway/pie-button": "1.1.0",
|
|
41
41
|
"@justeattakeaway/pie-components-config": "0.18.0",
|
|
42
|
-
"@justeattakeaway/pie-css": "0.
|
|
43
|
-
"@justeattakeaway/pie-text-input": "0.
|
|
42
|
+
"@justeattakeaway/pie-css": "0.14.0",
|
|
43
|
+
"@justeattakeaway/pie-text-input": "0.25.0",
|
|
44
44
|
"@justeattakeaway/pie-wrapper-react": "0.14.2",
|
|
45
45
|
"@types/body-scroll-lock": "3.1.2",
|
|
46
46
|
"cem-plugin-module-file-extensions": "0.0.5"
|