@justeattakeaway/pie-modal 1.25.13 → 1.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dialog-polyfill.esm-CbjBMXAG.js +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +8 -8
- package/dist/react.d.ts +0 -0
- package/dist/react.js +0 -0
- package/package.json +5 -5
- package/src/index.ts +2 -4
- package/src/react.ts +0 -0
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const x = class x extends T {
|
|
|
14
14
|
this.getAttribute("v") || this.setAttribute("v", x.v);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
x.v = "1.
|
|
17
|
+
x.v = "1.26.1";
|
|
18
18
|
let B = x;
|
|
19
19
|
function V(o) {
|
|
20
20
|
if (Array.isArray(o)) {
|
|
@@ -26,12 +26,12 @@ function V(o) {
|
|
|
26
26
|
}
|
|
27
27
|
var A = !1;
|
|
28
28
|
if (typeof window < "u") {
|
|
29
|
-
var
|
|
29
|
+
var O = {
|
|
30
30
|
get passive() {
|
|
31
31
|
A = !0;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
window.addEventListener("testPassive", null,
|
|
34
|
+
window.addEventListener("testPassive", null, O), window.removeEventListener("testPassive", null, O);
|
|
35
35
|
}
|
|
36
36
|
var $ = typeof window < "u" && window.navigator && window.navigator.platform && (/iP(ad|hone|od)/.test(window.navigator.platform) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1), p = [], w = !1, D = -1, v = void 0, y = void 0, E = function(t) {
|
|
37
37
|
return p.some(function(a) {
|
|
@@ -95,7 +95,7 @@ const J = '*,*:after,*:before{box-sizing:inherit}dialog{position:absolute;left:0
|
|
|
95
95
|
"brand-06-subtle",
|
|
96
96
|
"brand-08",
|
|
97
97
|
"brand-08-subtle"
|
|
98
|
-
],
|
|
98
|
+
], M = "pie-modal-close", C = "pie-modal-open", L = "pie-modal-back", eo = "pie-modal-leading-action-click", io = "pie-modal-supporting-action-click", r = {
|
|
99
99
|
hasBackButton: !1,
|
|
100
100
|
hasStackedActions: !1,
|
|
101
101
|
headingLevel: "h2",
|
|
@@ -141,7 +141,7 @@ let n = class extends B {
|
|
|
141
141
|
connectedCallback() {
|
|
142
142
|
super.connectedCallback(), this._abortController = new AbortController();
|
|
143
143
|
const { signal: o } = this._abortController;
|
|
144
|
-
this.addEventListener("click", (t) => this._handleDialogLightDismiss(t)),
|
|
144
|
+
this.addEventListener("click", (t) => this._handleDialogLightDismiss(t)), document.addEventListener(C, (t) => this._handleModalOpened(t), { signal: o }), document.addEventListener(M, (t) => this._handleModalClosed(t), { signal: o }), document.addEventListener(L, (t) => this._handleModalClosed(t), { signal: o });
|
|
145
145
|
}
|
|
146
146
|
disconnectedCallback() {
|
|
147
147
|
super.disconnectedCallback(), this._abortController.abort(), this._enableBodyScroll(), this._removeEscKeyEventListener();
|
|
@@ -158,7 +158,7 @@ let n = class extends B {
|
|
|
158
158
|
}
|
|
159
159
|
_handleIsDismissibleChanged(o) {
|
|
160
160
|
const t = o.get("isDismissible"), a = this.isDismissible;
|
|
161
|
-
!t && a && this._removeEscKeyEventListener(), t && !a && this._setupEscKeyListener();
|
|
161
|
+
!t && a && this._removeEscKeyEventListener(), t && !a && this.isOpen && this._setupEscKeyListener();
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Opens the dialog element and disables page scrolling
|
|
@@ -204,7 +204,7 @@ let n = class extends B {
|
|
|
204
204
|
// Handles changes to the modal isOpen property by dispatching any appropriate events
|
|
205
205
|
_handleModalOpenStateChanged(o) {
|
|
206
206
|
const t = o.get("isOpen");
|
|
207
|
-
t !== void 0 && (t ? this._backButtonClicked ? (this._backButtonClicked = !1, b(this, L, { targetModal: this })) : b(this,
|
|
207
|
+
t !== void 0 && (t ? this._backButtonClicked ? (this._backButtonClicked = !1, b(this, L, { targetModal: this })) : b(this, M, { targetModal: this }) : b(this, C, { targetModal: this }));
|
|
208
208
|
}
|
|
209
209
|
_handleActionClick(o) {
|
|
210
210
|
o === "leading" ? (this._dialog.close("leading"), b(this, eo, { targetModal: this })) : o === "supporting" && (this._dialog.close("supporting"), b(this, io, { targetModal: this }));
|
|
@@ -530,7 +530,7 @@ n = l([
|
|
|
530
530
|
], n);
|
|
531
531
|
export {
|
|
532
532
|
L as ON_MODAL_BACK_EVENT,
|
|
533
|
-
|
|
533
|
+
M as ON_MODAL_CLOSE_EVENT,
|
|
534
534
|
eo as ON_MODAL_LEADING_ACTION_CLICK,
|
|
535
535
|
C as ON_MODAL_OPEN_EVENT,
|
|
536
536
|
io as ON_MODAL_SUPPORTING_ACTION_CLICK,
|
package/dist/react.d.ts
CHANGED
|
File without changes
|
package/dist/react.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-modal",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.1",
|
|
4
4
|
"description": "PIE design system modal built using web components",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
"@justeat/pie-design-tokens": "7.11.1",
|
|
51
51
|
"@justeattakeaway/pie-button": "1.13.4",
|
|
52
52
|
"@justeattakeaway/pie-components-config": "0.21.0",
|
|
53
|
-
"@justeattakeaway/pie-css": "1.1.
|
|
53
|
+
"@justeattakeaway/pie-css": "1.1.1",
|
|
54
54
|
"@justeattakeaway/pie-monorepo-utils": "0.9.0",
|
|
55
|
-
"@justeattakeaway/pie-text-input": "0.29.
|
|
55
|
+
"@justeattakeaway/pie-text-input": "0.29.29",
|
|
56
56
|
"@justeattakeaway/pie-wrapper-react": "0.14.4",
|
|
57
57
|
"@types/body-scroll-lock": "3.1.2",
|
|
58
58
|
"cem-plugin-module-file-extensions": "0.0.5"
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@justeattakeaway/pie-button": "1.13.4",
|
|
65
|
-
"@justeattakeaway/pie-icon-button": "2.7.
|
|
66
|
-
"@justeattakeaway/pie-icons-webc": "1.
|
|
65
|
+
"@justeattakeaway/pie-icon-button": "2.7.9",
|
|
66
|
+
"@justeattakeaway/pie-icons-webc": "1.22.0",
|
|
67
67
|
"@justeattakeaway/pie-spinner": "1.4.13",
|
|
68
68
|
"@justeattakeaway/pie-webc-core": "14.0.1",
|
|
69
69
|
"body-scroll-lock": "3.1.5",
|
package/src/index.ts
CHANGED
|
@@ -154,8 +154,6 @@ export class PieModal extends PieElement implements ModalProps {
|
|
|
154
154
|
|
|
155
155
|
this.addEventListener('click', (event) => this._handleDialogLightDismiss(event));
|
|
156
156
|
|
|
157
|
-
this._setupEscKeyListener();
|
|
158
|
-
|
|
159
157
|
document.addEventListener(ON_MODAL_OPEN_EVENT, (event) => this._handleModalOpened(<CustomEvent>event), { signal });
|
|
160
158
|
document.addEventListener(ON_MODAL_CLOSE_EVENT, (event) => this._handleModalClosed(<CustomEvent>event), { signal });
|
|
161
159
|
document.addEventListener(ON_MODAL_BACK_EVENT, (event) => this._handleModalClosed(<CustomEvent>event), { signal });
|
|
@@ -195,8 +193,8 @@ export class PieModal extends PieElement implements ModalProps {
|
|
|
195
193
|
this._removeEscKeyEventListener();
|
|
196
194
|
}
|
|
197
195
|
|
|
198
|
-
// if the modal is being set to NOT dismissible, add the esc key listener
|
|
199
|
-
if (oldValue && !newValue) {
|
|
196
|
+
// if the modal is being set to NOT dismissible, add the esc key listener (only if open)
|
|
197
|
+
if (oldValue && !newValue && this.isOpen) {
|
|
200
198
|
this._setupEscKeyListener();
|
|
201
199
|
}
|
|
202
200
|
}
|
package/src/react.ts
CHANGED
|
File without changes
|