@pismo/marola 1.1.7 → 1.1.10
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.module-CE1Q-5tJ.js +1 -2
- package/dist/Group-ZXteFV4M.js +1 -2
- package/dist/Popover.module-B4boCutS.js +1 -2
- package/dist/SelectButton-DbiTJagF.js +1 -2
- package/dist/Tabs.module-BNRwj3Z0.js +1 -2
- package/dist/Toggle-BuZjueQ7.js +1 -2
- package/dist/assets/Calendar.css +1 -1
- package/dist/assets/Table.css +1 -1
- package/dist/components/Adornment/Adornment.js +1 -2
- package/dist/components/Advice/Advice.js +1 -2
- package/dist/components/Alert/Alert.js +1 -2
- package/dist/components/Autocomplete/Autocomplete.js +1 -2
- package/dist/components/Avatar/Avatar.js +1 -2
- package/dist/components/Badge/Badge.js +1 -2
- package/dist/components/BankCard/BankCard.js +1 -2
- package/dist/components/Button/Button.js +1 -2
- package/dist/components/Calendar/Calendar.d.ts +2 -1
- package/dist/components/Calendar/Calendar.js +58 -38
- package/dist/components/Calendar/Calendar.stories.d.ts +2 -1
- package/dist/components/Checkbox/Checkbox.js +1 -2
- package/dist/components/ConfirmationDialog/ConfirmationDialog.js +1 -1
- package/dist/components/Description/Description.js +1 -2
- package/dist/components/Dialog/Dialog.d.ts +10 -9
- package/dist/components/Dialog/Dialog.js +230 -222
- package/dist/components/Dialog/Dialog.stories.d.ts +9 -5
- package/dist/components/Dialog/Dialog.test.d.ts +1 -0
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +1 -2
- package/dist/components/IconButton/IconButton.js +1 -2
- package/dist/components/Input/Input.js +1 -2
- package/dist/components/InputSearch/InputSearch.js +1 -2
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -2
- package/dist/components/PageHeader/PageHeader.js +1 -2
- package/dist/components/Pagination/Pagination.js +1 -2
- package/dist/components/RadioButton/RadioButton.js +1 -2
- package/dist/components/ResultWithChips/ResultWithChips.js +1 -2
- package/dist/components/Skeleton/Skeleton.js +1 -2
- package/dist/components/Snackbar/Snackbar.js +1 -2
- package/dist/components/SortTooltip/SortTooltip.js +1 -2
- package/dist/components/Stepper/Stepper.js +1 -2
- package/dist/components/StepperNavigator/StepperNavigator.js +1 -2
- package/dist/components/Table/Table.d.ts +26 -10
- package/dist/components/Table/Table.js +136 -95
- package/dist/components/Table/Table.stories.d.ts +4 -0
- package/dist/components/Table/Table.test.d.ts +1 -0
- package/dist/components/Table/_Table.Td.stories.d.ts +1 -1
- package/dist/components/Table/_Table.Th.stories.d.ts +1 -1
- package/dist/components/Table/_Table.Tr.stories.d.ts +1 -1
- package/dist/components/Tag/Tag.js +1 -2
- package/dist/components/TextDisplay/TextDisplay.js +1 -2
- package/dist/components/Toggle/Toggle.js +1 -2
- package/dist/components/Tooltip/Tooltip.js +1 -2
- package/dist/components/TransactionRow/TransactionRow.js +1 -2
- package/dist/components/Typography/Typography.js +1 -2
- package/package.json +1 -1
|
@@ -1,122 +1,123 @@
|
|
|
1
1
|
import { jsxs as $, jsx as S } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { forwardRef as se } from "react";
|
|
4
|
+
import { c as ie } from "../../clsx-DB4S2d7J.js";
|
|
5
|
+
import le from "./Actions.js";
|
|
4
6
|
import ae from "./Backdrop.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
+
import ce from "./CloseIconButton.js";
|
|
8
|
+
import de from "./Content.js";
|
|
7
9
|
import { s as z } from "../../Dialog.module-CE1Q-5tJ.js";
|
|
8
10
|
import ee from "./DialogTitle.js";
|
|
9
|
-
import { u as te, P as
|
|
10
|
-
import
|
|
11
|
-
import { o as A, e as ne } from "../../ownerDocument-YGhwAnr1.js";
|
|
11
|
+
import { u as te, P as l, f as ue, b as C, g as fe, a as pe, _ as be, c as G, d as he, e as me } from "../../useSlotProps-C_I1kEHr.js";
|
|
12
|
+
import { o as A, e as oe } from "../../ownerDocument-YGhwAnr1.js";
|
|
12
13
|
import { u as X } from "../../useEventCallback-BAQJJ3ye.js";
|
|
13
|
-
import { P as
|
|
14
|
-
import { e as
|
|
14
|
+
import { P as ge, H as Ee } from "../../Portal-oY3enyAm.js";
|
|
15
|
+
import { e as Te } from "../../index-bQFToy-I.js";
|
|
15
16
|
function J(...e) {
|
|
16
|
-
return e.reduce((t,
|
|
17
|
-
t.apply(this, s),
|
|
17
|
+
return e.reduce((t, n) => n == null ? t : function(...s) {
|
|
18
|
+
t.apply(this, s), n.apply(this, s);
|
|
18
19
|
}, () => {
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
function Y(e) {
|
|
22
23
|
return A(e).defaultView || window;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function ye(e) {
|
|
25
26
|
const t = e.documentElement.clientWidth;
|
|
26
27
|
return Math.abs(window.innerWidth - t);
|
|
27
28
|
}
|
|
28
|
-
const
|
|
29
|
-
function
|
|
29
|
+
const xe = ["input", "select", "textarea", "a[href]", "button", "[tabindex]", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])'].join(",");
|
|
30
|
+
function Re(e) {
|
|
30
31
|
const t = parseInt(e.getAttribute("tabindex") || "", 10);
|
|
31
32
|
return Number.isNaN(t) ? e.contentEditable === "true" || (e.nodeName === "AUDIO" || e.nodeName === "VIDEO" || e.nodeName === "DETAILS") && e.getAttribute("tabindex") === null ? 0 : e.tabIndex : t;
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
+
function ve(e) {
|
|
34
35
|
if (e.tagName !== "INPUT" || e.type !== "radio" || !e.name)
|
|
35
36
|
return !1;
|
|
36
|
-
const t = (
|
|
37
|
-
let
|
|
38
|
-
return
|
|
39
|
-
}
|
|
40
|
-
function ve(e) {
|
|
41
|
-
return !(e.disabled || e.tagName === "INPUT" && e.type === "hidden" || Re(e));
|
|
37
|
+
const t = (o) => e.ownerDocument.querySelector(`input[type="radio"]${o}`);
|
|
38
|
+
let n = t(`[name="${e.name}"]:checked`);
|
|
39
|
+
return n || (n = t(`[name="${e.name}"]`)), n !== e;
|
|
42
40
|
}
|
|
43
41
|
function ke(e) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
return !(e.disabled || e.tagName === "INPUT" && e.type === "hidden" || ve(e));
|
|
43
|
+
}
|
|
44
|
+
function Pe(e) {
|
|
45
|
+
const t = [], n = [];
|
|
46
|
+
return Array.from(e.querySelectorAll(xe)).forEach((o, s) => {
|
|
47
|
+
const r = Re(o);
|
|
48
|
+
r === -1 || !ke(o) || (r === 0 ? t.push(o) : n.push({
|
|
48
49
|
documentOrder: s,
|
|
49
50
|
tabIndex: r,
|
|
50
|
-
node:
|
|
51
|
+
node: o
|
|
51
52
|
}));
|
|
52
|
-
}),
|
|
53
|
+
}), n.sort((o, s) => o.tabIndex === s.tabIndex ? o.documentOrder - s.documentOrder : o.tabIndex - s.tabIndex).map((o) => o.node).concat(t);
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function Ne() {
|
|
55
56
|
return !0;
|
|
56
57
|
}
|
|
57
58
|
function j(e) {
|
|
58
59
|
const {
|
|
59
60
|
children: t,
|
|
60
|
-
disableAutoFocus:
|
|
61
|
-
disableEnforceFocus:
|
|
61
|
+
disableAutoFocus: n = !1,
|
|
62
|
+
disableEnforceFocus: o = !1,
|
|
62
63
|
disableRestoreFocus: s = !1,
|
|
63
|
-
getTabbable: r =
|
|
64
|
-
isEnabled:
|
|
64
|
+
getTabbable: r = Pe,
|
|
65
|
+
isEnabled: i = Ne,
|
|
65
66
|
open: c
|
|
66
67
|
} = e, p = f.useRef(!1), x = f.useRef(null), h = f.useRef(null), m = f.useRef(null), R = f.useRef(null), g = f.useRef(!1), d = f.useRef(null), w = te(t.ref, d), I = f.useRef(null);
|
|
67
68
|
f.useEffect(() => {
|
|
68
|
-
!c || !d.current || (g.current = !
|
|
69
|
-
}, [
|
|
69
|
+
!c || !d.current || (g.current = !n);
|
|
70
|
+
}, [n, c]), f.useEffect(() => {
|
|
70
71
|
if (!c || !d.current)
|
|
71
72
|
return;
|
|
72
|
-
const
|
|
73
|
-
return d.current.contains(
|
|
73
|
+
const a = A(d.current);
|
|
74
|
+
return d.current.contains(a.activeElement) || (d.current.hasAttribute("tabIndex") || (process.env.NODE_ENV !== "production" && console.error(["MUI: The modal content node does not accept focus.", 'For the benefit of assistive technologies, the tabIndex of the node is being set to "-1".'].join(`
|
|
74
75
|
`)), d.current.setAttribute("tabIndex", "-1")), g.current && d.current.focus()), () => {
|
|
75
76
|
s || (m.current && m.current.focus && (p.current = !0, m.current.focus()), m.current = null);
|
|
76
77
|
};
|
|
77
78
|
}, [c]), f.useEffect(() => {
|
|
78
79
|
if (!c || !d.current)
|
|
79
80
|
return;
|
|
80
|
-
const
|
|
81
|
-
I.current = E, !(
|
|
81
|
+
const a = A(d.current), v = (E) => {
|
|
82
|
+
I.current = E, !(o || !i() || E.key !== "Tab") && a.activeElement === d.current && E.shiftKey && (p.current = !0, h.current && h.current.focus());
|
|
82
83
|
}, k = () => {
|
|
83
84
|
const E = d.current;
|
|
84
85
|
if (E === null)
|
|
85
86
|
return;
|
|
86
|
-
if (!
|
|
87
|
+
if (!a.hasFocus() || !i() || p.current) {
|
|
87
88
|
p.current = !1;
|
|
88
89
|
return;
|
|
89
90
|
}
|
|
90
|
-
if (E.contains(
|
|
91
|
+
if (E.contains(a.activeElement) || o && a.activeElement !== x.current && a.activeElement !== h.current)
|
|
91
92
|
return;
|
|
92
|
-
if (
|
|
93
|
+
if (a.activeElement !== R.current)
|
|
93
94
|
R.current = null;
|
|
94
95
|
else if (R.current !== null)
|
|
95
96
|
return;
|
|
96
97
|
if (!g.current)
|
|
97
98
|
return;
|
|
98
99
|
let T = [];
|
|
99
|
-
if ((
|
|
100
|
-
var
|
|
101
|
-
const D = !!((
|
|
102
|
-
typeof F != "string" && typeof
|
|
100
|
+
if ((a.activeElement === x.current || a.activeElement === h.current) && (T = r(d.current)), T.length > 0) {
|
|
101
|
+
var B, y;
|
|
102
|
+
const D = !!((B = I.current) != null && B.shiftKey && ((y = I.current) == null ? void 0 : y.key) === "Tab"), F = T[0], H = T[T.length - 1];
|
|
103
|
+
typeof F != "string" && typeof H != "string" && (D ? H.focus() : F.focus());
|
|
103
104
|
} else
|
|
104
105
|
E.focus();
|
|
105
106
|
};
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
a.addEventListener("focusin", k), a.addEventListener("keydown", v, !0);
|
|
108
|
+
const L = setInterval(() => {
|
|
109
|
+
a.activeElement && a.activeElement.tagName === "BODY" && k();
|
|
109
110
|
}, 50);
|
|
110
111
|
return () => {
|
|
111
|
-
clearInterval(
|
|
112
|
+
clearInterval(L), a.removeEventListener("focusin", k), a.removeEventListener("keydown", v, !0);
|
|
112
113
|
};
|
|
113
|
-
}, [
|
|
114
|
-
const O = (
|
|
115
|
-
m.current === null && (m.current =
|
|
114
|
+
}, [n, o, s, i, c, r]);
|
|
115
|
+
const O = (a) => {
|
|
116
|
+
m.current === null && (m.current = a.relatedTarget), g.current = !0, R.current = a.target;
|
|
116
117
|
const v = t.props.onFocus;
|
|
117
|
-
v && v(
|
|
118
|
-
}, N = (
|
|
119
|
-
m.current === null && (m.current =
|
|
118
|
+
v && v(a);
|
|
119
|
+
}, N = (a) => {
|
|
120
|
+
m.current === null && (m.current = a.relatedTarget), g.current = !0;
|
|
120
121
|
};
|
|
121
122
|
return /* @__PURE__ */ $(f.Fragment, {
|
|
122
123
|
children: [/* @__PURE__ */ S("div", {
|
|
@@ -143,7 +144,7 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
|
143
144
|
/**
|
|
144
145
|
* A single child content element.
|
|
145
146
|
*/
|
|
146
|
-
children:
|
|
147
|
+
children: oe,
|
|
147
148
|
/**
|
|
148
149
|
* If `true`, the focus trap will not automatically shift focus to itself when it opens, and
|
|
149
150
|
* replace it to the last focused element when it closes.
|
|
@@ -153,7 +154,7 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
|
153
154
|
* accessible to assistive technologies, like screen readers.
|
|
154
155
|
* @default false
|
|
155
156
|
*/
|
|
156
|
-
disableAutoFocus:
|
|
157
|
+
disableAutoFocus: l.bool,
|
|
157
158
|
/**
|
|
158
159
|
* If `true`, the focus trap will not prevent focus from leaving the focus trap while open.
|
|
159
160
|
*
|
|
@@ -161,19 +162,19 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
|
161
162
|
* accessible to assistive technologies, like screen readers.
|
|
162
163
|
* @default false
|
|
163
164
|
*/
|
|
164
|
-
disableEnforceFocus:
|
|
165
|
+
disableEnforceFocus: l.bool,
|
|
165
166
|
/**
|
|
166
167
|
* If `true`, the focus trap will not restore focus to previously focused element once
|
|
167
168
|
* focus trap is hidden or unmounted.
|
|
168
169
|
* @default false
|
|
169
170
|
*/
|
|
170
|
-
disableRestoreFocus:
|
|
171
|
+
disableRestoreFocus: l.bool,
|
|
171
172
|
/**
|
|
172
173
|
* Returns an array of ordered tabbable nodes (i.e. in tab order) within the root.
|
|
173
174
|
* For instance, you can provide the "tabbable" npm dependency.
|
|
174
175
|
* @param {HTMLElement} root
|
|
175
176
|
*/
|
|
176
|
-
getTabbable:
|
|
177
|
+
getTabbable: l.func,
|
|
177
178
|
/**
|
|
178
179
|
* This prop extends the `open` prop.
|
|
179
180
|
* It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.
|
|
@@ -183,14 +184,14 @@ process.env.NODE_ENV !== "production" && (j.propTypes = {
|
|
|
183
184
|
* return true;
|
|
184
185
|
* }
|
|
185
186
|
*/
|
|
186
|
-
isEnabled:
|
|
187
|
+
isEnabled: l.func,
|
|
187
188
|
/**
|
|
188
189
|
* If `true`, focus is locked.
|
|
189
190
|
*/
|
|
190
|
-
open:
|
|
191
|
+
open: l.bool.isRequired
|
|
191
192
|
});
|
|
192
|
-
process.env.NODE_ENV !== "production" && (j.propTypes =
|
|
193
|
-
function
|
|
193
|
+
process.env.NODE_ENV !== "production" && (j.propTypes = Te(j.propTypes));
|
|
194
|
+
function Ce(e) {
|
|
194
195
|
const t = A(e);
|
|
195
196
|
return t.body === e ? Y(e).innerWidth > t.documentElement.clientWidth : e.scrollHeight > e.clientHeight;
|
|
196
197
|
}
|
|
@@ -200,48 +201,48 @@ function U(e, t) {
|
|
|
200
201
|
function Q(e) {
|
|
201
202
|
return parseInt(Y(e).getComputedStyle(e).paddingRight, 10) || 0;
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
-
const
|
|
205
|
-
return
|
|
204
|
+
function Ie(e) {
|
|
205
|
+
const n = ["TEMPLATE", "SCRIPT", "STYLE", "LINK", "MAP", "META", "NOSCRIPT", "PICTURE", "COL", "COLGROUP", "PARAM", "SLOT", "SOURCE", "TRACK"].indexOf(e.tagName) !== -1, o = e.tagName === "INPUT" && e.getAttribute("type") === "hidden";
|
|
206
|
+
return n || o;
|
|
206
207
|
}
|
|
207
|
-
function Z(e, t,
|
|
208
|
-
const r = [t,
|
|
209
|
-
[].forEach.call(e.children, (
|
|
210
|
-
const c = r.indexOf(
|
|
211
|
-
c && p && U(
|
|
208
|
+
function Z(e, t, n, o, s) {
|
|
209
|
+
const r = [t, n, ...o];
|
|
210
|
+
[].forEach.call(e.children, (i) => {
|
|
211
|
+
const c = r.indexOf(i) === -1, p = !Ie(i);
|
|
212
|
+
c && p && U(i, s);
|
|
212
213
|
});
|
|
213
214
|
}
|
|
214
215
|
function V(e, t) {
|
|
215
|
-
let
|
|
216
|
-
return e.some((
|
|
216
|
+
let n = -1;
|
|
217
|
+
return e.some((o, s) => t(o) ? (n = s, !0) : !1), n;
|
|
217
218
|
}
|
|
218
|
-
function
|
|
219
|
-
const
|
|
219
|
+
function Fe(e, t) {
|
|
220
|
+
const n = [], o = e.container;
|
|
220
221
|
if (!t.disableScrollLock) {
|
|
221
|
-
if (
|
|
222
|
-
const
|
|
223
|
-
|
|
224
|
-
value:
|
|
222
|
+
if (Ce(o)) {
|
|
223
|
+
const i = ye(A(o));
|
|
224
|
+
n.push({
|
|
225
|
+
value: o.style.paddingRight,
|
|
225
226
|
property: "padding-right",
|
|
226
|
-
el:
|
|
227
|
-
}),
|
|
228
|
-
const c = A(
|
|
227
|
+
el: o
|
|
228
|
+
}), o.style.paddingRight = `${Q(o) + i}px`;
|
|
229
|
+
const c = A(o).querySelectorAll(".mui-fixed");
|
|
229
230
|
[].forEach.call(c, (p) => {
|
|
230
|
-
|
|
231
|
+
n.push({
|
|
231
232
|
value: p.style.paddingRight,
|
|
232
233
|
property: "padding-right",
|
|
233
234
|
el: p
|
|
234
|
-
}), p.style.paddingRight = `${Q(p) +
|
|
235
|
+
}), p.style.paddingRight = `${Q(p) + i}px`;
|
|
235
236
|
});
|
|
236
237
|
}
|
|
237
238
|
let r;
|
|
238
|
-
if (
|
|
239
|
-
r = A(
|
|
239
|
+
if (o.parentNode instanceof DocumentFragment)
|
|
240
|
+
r = A(o).body;
|
|
240
241
|
else {
|
|
241
|
-
const
|
|
242
|
-
r = (
|
|
242
|
+
const i = o.parentElement, c = Y(o);
|
|
243
|
+
r = (i == null ? void 0 : i.nodeName) === "HTML" && c.getComputedStyle(i).overflowY === "scroll" ? i : o;
|
|
243
244
|
}
|
|
244
|
-
|
|
245
|
+
n.push({
|
|
245
246
|
value: r.style.overflow,
|
|
246
247
|
property: "overflow",
|
|
247
248
|
el: r
|
|
@@ -256,97 +257,97 @@ function Ie(e, t) {
|
|
|
256
257
|
}), r.style.overflow = "hidden";
|
|
257
258
|
}
|
|
258
259
|
return () => {
|
|
259
|
-
|
|
260
|
+
n.forEach(({
|
|
260
261
|
value: r,
|
|
261
|
-
el:
|
|
262
|
+
el: i,
|
|
262
263
|
property: c
|
|
263
264
|
}) => {
|
|
264
|
-
r ?
|
|
265
|
+
r ? i.style.setProperty(c, r) : i.style.removeProperty(c);
|
|
265
266
|
});
|
|
266
267
|
};
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
+
function Se(e) {
|
|
269
270
|
const t = [];
|
|
270
|
-
return [].forEach.call(e.children, (
|
|
271
|
-
|
|
271
|
+
return [].forEach.call(e.children, (n) => {
|
|
272
|
+
n.getAttribute("aria-hidden") === "true" && t.push(n);
|
|
272
273
|
}), t;
|
|
273
274
|
}
|
|
274
|
-
class
|
|
275
|
+
class Ae {
|
|
275
276
|
constructor() {
|
|
276
277
|
this.containers = void 0, this.modals = void 0, this.modals = [], this.containers = [];
|
|
277
278
|
}
|
|
278
|
-
add(t,
|
|
279
|
-
let
|
|
280
|
-
if (
|
|
281
|
-
return
|
|
282
|
-
|
|
283
|
-
const s =
|
|
284
|
-
Z(
|
|
285
|
-
const r = V(this.containers, (
|
|
286
|
-
return r !== -1 ? (this.containers[r].modals.push(t),
|
|
279
|
+
add(t, n) {
|
|
280
|
+
let o = this.modals.indexOf(t);
|
|
281
|
+
if (o !== -1)
|
|
282
|
+
return o;
|
|
283
|
+
o = this.modals.length, this.modals.push(t), t.modalRef && U(t.modalRef, !1);
|
|
284
|
+
const s = Se(n);
|
|
285
|
+
Z(n, t.mount, t.modalRef, s, !0);
|
|
286
|
+
const r = V(this.containers, (i) => i.container === n);
|
|
287
|
+
return r !== -1 ? (this.containers[r].modals.push(t), o) : (this.containers.push({
|
|
287
288
|
modals: [t],
|
|
288
|
-
container:
|
|
289
|
+
container: n,
|
|
289
290
|
restore: null,
|
|
290
291
|
hiddenSiblings: s
|
|
291
|
-
}),
|
|
292
|
+
}), o);
|
|
292
293
|
}
|
|
293
|
-
mount(t,
|
|
294
|
-
const
|
|
295
|
-
s.restore || (s.restore =
|
|
294
|
+
mount(t, n) {
|
|
295
|
+
const o = V(this.containers, (r) => r.modals.indexOf(t) !== -1), s = this.containers[o];
|
|
296
|
+
s.restore || (s.restore = Fe(s, n));
|
|
296
297
|
}
|
|
297
|
-
remove(t,
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
return
|
|
301
|
-
const s = V(this.containers, (
|
|
302
|
-
if (r.modals.splice(r.modals.indexOf(t), 1), this.modals.splice(
|
|
303
|
-
r.restore && r.restore(), t.modalRef && U(t.modalRef,
|
|
298
|
+
remove(t, n = !0) {
|
|
299
|
+
const o = this.modals.indexOf(t);
|
|
300
|
+
if (o === -1)
|
|
301
|
+
return o;
|
|
302
|
+
const s = V(this.containers, (i) => i.modals.indexOf(t) !== -1), r = this.containers[s];
|
|
303
|
+
if (r.modals.splice(r.modals.indexOf(t), 1), this.modals.splice(o, 1), r.modals.length === 0)
|
|
304
|
+
r.restore && r.restore(), t.modalRef && U(t.modalRef, n), Z(r.container, t.mount, t.modalRef, r.hiddenSiblings, !1), this.containers.splice(s, 1);
|
|
304
305
|
else {
|
|
305
|
-
const
|
|
306
|
-
|
|
306
|
+
const i = r.modals[r.modals.length - 1];
|
|
307
|
+
i.modalRef && U(i.modalRef, !1);
|
|
307
308
|
}
|
|
308
|
-
return
|
|
309
|
+
return o;
|
|
309
310
|
}
|
|
310
311
|
isTopModal(t) {
|
|
311
312
|
return this.modals.length > 0 && this.modals[this.modals.length - 1] === t;
|
|
312
313
|
}
|
|
313
314
|
}
|
|
314
|
-
function
|
|
315
|
+
function we(e) {
|
|
315
316
|
return typeof e == "function" ? e() : e;
|
|
316
317
|
}
|
|
317
|
-
function
|
|
318
|
+
function Oe(e) {
|
|
318
319
|
return e ? e.props.hasOwnProperty("in") : !1;
|
|
319
320
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
321
|
+
const De = new Ae();
|
|
322
|
+
function Me(e) {
|
|
322
323
|
const {
|
|
323
324
|
container: t,
|
|
324
|
-
disableEscapeKeyDown:
|
|
325
|
-
disableScrollLock:
|
|
325
|
+
disableEscapeKeyDown: n = !1,
|
|
326
|
+
disableScrollLock: o = !1,
|
|
326
327
|
// @ts-ignore internal logic - Base UI supports the manager as a prop too
|
|
327
|
-
manager: s =
|
|
328
|
+
manager: s = De,
|
|
328
329
|
closeAfterTransition: r = !1,
|
|
329
|
-
onTransitionEnter:
|
|
330
|
+
onTransitionEnter: i,
|
|
330
331
|
onTransitionExited: c,
|
|
331
332
|
children: p,
|
|
332
333
|
onClose: x,
|
|
333
334
|
open: h,
|
|
334
335
|
rootRef: m
|
|
335
|
-
} = e, R = f.useRef({}), g = f.useRef(null), d = f.useRef(null), w = te(d, m), [I, O] = f.useState(!h), N =
|
|
336
|
-
let
|
|
337
|
-
(e["aria-hidden"] === "false" || e["aria-hidden"] === !1) && (
|
|
338
|
-
const v = () => A(g.current), k = () => (R.current.modalRef = d.current, R.current.mount = g.current, R.current),
|
|
336
|
+
} = e, R = f.useRef({}), g = f.useRef(null), d = f.useRef(null), w = te(d, m), [I, O] = f.useState(!h), N = Oe(p);
|
|
337
|
+
let a = !0;
|
|
338
|
+
(e["aria-hidden"] === "false" || e["aria-hidden"] === !1) && (a = !1);
|
|
339
|
+
const v = () => A(g.current), k = () => (R.current.modalRef = d.current, R.current.mount = g.current, R.current), L = () => {
|
|
339
340
|
s.mount(k(), {
|
|
340
|
-
disableScrollLock:
|
|
341
|
+
disableScrollLock: o
|
|
341
342
|
}), d.current && (d.current.scrollTop = 0);
|
|
342
343
|
}, E = X(() => {
|
|
343
|
-
const b =
|
|
344
|
-
s.add(k(), b), d.current &&
|
|
345
|
-
}), T = f.useCallback(() => s.isTopModal(k()), [s]),
|
|
346
|
-
g.current = b, b && (h && T() ?
|
|
344
|
+
const b = we(t) || v().body;
|
|
345
|
+
s.add(k(), b), d.current && L();
|
|
346
|
+
}), T = f.useCallback(() => s.isTopModal(k()), [s]), B = X((b) => {
|
|
347
|
+
g.current = b, b && (h && T() ? L() : d.current && U(d.current, a));
|
|
347
348
|
}), y = f.useCallback(() => {
|
|
348
|
-
s.remove(k(),
|
|
349
|
-
}, [
|
|
349
|
+
s.remove(k(), a);
|
|
350
|
+
}, [a, s]);
|
|
350
351
|
f.useEffect(() => () => {
|
|
351
352
|
y();
|
|
352
353
|
}, [y]), f.useEffect(() => {
|
|
@@ -355,14 +356,14 @@ function De(e) {
|
|
|
355
356
|
const D = (b) => (u) => {
|
|
356
357
|
var P;
|
|
357
358
|
(P = b.onKeyDown) == null || P.call(b, u), !(u.key !== "Escape" || u.which === 229 || // Wait until IME is settled.
|
|
358
|
-
!T()) && (
|
|
359
|
+
!T()) && (n || (u.stopPropagation(), x && x(u, "escapeKeyDown")));
|
|
359
360
|
}, F = (b) => (u) => {
|
|
360
361
|
var P;
|
|
361
362
|
(P = b.onClick) == null || P.call(b, u), u.target === u.currentTarget && x && x(u, "backdropClick");
|
|
362
363
|
};
|
|
363
364
|
return {
|
|
364
365
|
getRootProps: (b = {}) => {
|
|
365
|
-
const u =
|
|
366
|
+
const u = ue(e);
|
|
366
367
|
delete u.onTransitionEnter, delete u.onTransitionExited;
|
|
367
368
|
const P = C({}, u, b);
|
|
368
369
|
return C({
|
|
@@ -383,7 +384,7 @@ function De(e) {
|
|
|
383
384
|
},
|
|
384
385
|
getTransitionProps: () => {
|
|
385
386
|
const b = () => {
|
|
386
|
-
O(!1),
|
|
387
|
+
O(!1), i && i();
|
|
387
388
|
}, u = () => {
|
|
388
389
|
O(!0), c && c(), r && y();
|
|
389
390
|
};
|
|
@@ -393,32 +394,32 @@ function De(e) {
|
|
|
393
394
|
};
|
|
394
395
|
},
|
|
395
396
|
rootRef: w,
|
|
396
|
-
portalRef:
|
|
397
|
+
portalRef: B,
|
|
397
398
|
isTopModal: T,
|
|
398
399
|
exited: I,
|
|
399
400
|
hasTransition: N
|
|
400
401
|
};
|
|
401
402
|
}
|
|
402
|
-
const
|
|
403
|
-
function
|
|
404
|
-
return
|
|
403
|
+
const ne = "Modal";
|
|
404
|
+
function Le(e) {
|
|
405
|
+
return fe(ne, e);
|
|
405
406
|
}
|
|
406
|
-
|
|
407
|
-
const
|
|
407
|
+
pe(ne, ["root", "hidden", "backdrop"]);
|
|
408
|
+
const Be = ["children", "closeAfterTransition", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "onBackdropClick", "onClose", "onKeyDown", "open", "onTransitionEnter", "onTransitionExited", "slotProps", "slots"], He = (e) => {
|
|
408
409
|
const {
|
|
409
410
|
open: t,
|
|
410
|
-
exited:
|
|
411
|
+
exited: n
|
|
411
412
|
} = e;
|
|
412
|
-
return
|
|
413
|
-
root: ["root", !t &&
|
|
413
|
+
return he({
|
|
414
|
+
root: ["root", !t && n && "hidden"],
|
|
414
415
|
backdrop: ["backdrop"]
|
|
415
|
-
},
|
|
416
|
-
}, re = /* @__PURE__ */ f.forwardRef(function(t,
|
|
417
|
-
var
|
|
416
|
+
}, me(Le));
|
|
417
|
+
}, re = /* @__PURE__ */ f.forwardRef(function(t, n) {
|
|
418
|
+
var o;
|
|
418
419
|
const {
|
|
419
420
|
children: s,
|
|
420
421
|
closeAfterTransition: r = !1,
|
|
421
|
-
container:
|
|
422
|
+
container: i,
|
|
422
423
|
disableAutoFocus: c = !1,
|
|
423
424
|
disableEnforceFocus: p = !1,
|
|
424
425
|
disableEscapeKeyDown: x = !1,
|
|
@@ -431,7 +432,7 @@ const Le = ["children", "closeAfterTransition", "container", "disableAutoFocus",
|
|
|
431
432
|
open: I,
|
|
432
433
|
slotProps: O = {},
|
|
433
434
|
slots: N = {}
|
|
434
|
-
} = t,
|
|
435
|
+
} = t, a = be(t, Be), v = C({}, t, {
|
|
435
436
|
closeAfterTransition: r,
|
|
436
437
|
disableAutoFocus: c,
|
|
437
438
|
disableEnforceFocus: p,
|
|
@@ -443,53 +444,53 @@ const Le = ["children", "closeAfterTransition", "container", "disableAutoFocus",
|
|
|
443
444
|
keepMounted: d
|
|
444
445
|
}), {
|
|
445
446
|
getRootProps: k,
|
|
446
|
-
getBackdropProps:
|
|
447
|
+
getBackdropProps: L,
|
|
447
448
|
getTransitionProps: E,
|
|
448
449
|
portalRef: T,
|
|
449
|
-
isTopModal:
|
|
450
|
+
isTopModal: B,
|
|
450
451
|
exited: y,
|
|
451
452
|
hasTransition: D
|
|
452
|
-
} =
|
|
453
|
-
rootRef:
|
|
453
|
+
} = Me(C({}, v, {
|
|
454
|
+
rootRef: n
|
|
454
455
|
})), F = C({}, v, {
|
|
455
456
|
exited: y,
|
|
456
457
|
hasTransition: D
|
|
457
|
-
}),
|
|
458
|
+
}), H = He(F), _ = {};
|
|
458
459
|
if (s.props.tabIndex === void 0 && (_.tabIndex = "-1"), D) {
|
|
459
460
|
const {
|
|
460
|
-
onEnter:
|
|
461
|
+
onEnter: K,
|
|
461
462
|
onExited: W
|
|
462
463
|
} = E();
|
|
463
|
-
_.onEnter =
|
|
464
|
+
_.onEnter = K, _.onExited = W;
|
|
464
465
|
}
|
|
465
|
-
const q = (
|
|
466
|
+
const q = (o = N.root) != null ? o : "div", b = G({
|
|
466
467
|
elementType: q,
|
|
467
468
|
externalSlotProps: O.root,
|
|
468
|
-
externalForwardedProps:
|
|
469
|
+
externalForwardedProps: a,
|
|
469
470
|
getSlotProps: k,
|
|
470
|
-
className:
|
|
471
|
+
className: H.root,
|
|
471
472
|
ownerState: F
|
|
472
473
|
}), u = N.backdrop, P = G({
|
|
473
474
|
elementType: u,
|
|
474
475
|
externalSlotProps: O.backdrop,
|
|
475
|
-
getSlotProps: (
|
|
476
|
+
getSlotProps: (K) => L(C({}, K, {
|
|
476
477
|
onClick: (W) => {
|
|
477
|
-
w && w(W),
|
|
478
|
+
w && w(W), K != null && K.onClick && K.onClick(W);
|
|
478
479
|
}
|
|
479
480
|
})),
|
|
480
|
-
className:
|
|
481
|
+
className: H.backdrop,
|
|
481
482
|
ownerState: F
|
|
482
483
|
});
|
|
483
|
-
return !d && !I && (!D || y) ? null : /* @__PURE__ */ S(
|
|
484
|
+
return !d && !I && (!D || y) ? null : /* @__PURE__ */ S(ge, {
|
|
484
485
|
ref: T,
|
|
485
|
-
container:
|
|
486
|
+
container: i,
|
|
486
487
|
disablePortal: h,
|
|
487
488
|
children: /* @__PURE__ */ $(q, C({}, b, {
|
|
488
489
|
children: [!g && u ? /* @__PURE__ */ S(u, C({}, P)) : null, /* @__PURE__ */ S(j, {
|
|
489
490
|
disableEnforceFocus: p,
|
|
490
491
|
disableAutoFocus: c,
|
|
491
492
|
disableRestoreFocus: m,
|
|
492
|
-
isEnabled:
|
|
493
|
+
isEnabled: B,
|
|
493
494
|
open: I,
|
|
494
495
|
children: /* @__PURE__ */ f.cloneElement(s, _)
|
|
495
496
|
})]
|
|
@@ -504,12 +505,12 @@ process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
|
504
505
|
/**
|
|
505
506
|
* A single child content element.
|
|
506
507
|
*/
|
|
507
|
-
children:
|
|
508
|
+
children: oe.isRequired,
|
|
508
509
|
/**
|
|
509
510
|
* When set to true the Modal waits until a nested Transition is completed before closing.
|
|
510
511
|
* @default false
|
|
511
512
|
*/
|
|
512
|
-
closeAfterTransition:
|
|
513
|
+
closeAfterTransition: l.bool,
|
|
513
514
|
/**
|
|
514
515
|
* An HTML element or function that returns one.
|
|
515
516
|
* The `container` will have the portal children appended to it.
|
|
@@ -520,7 +521,7 @@ process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
|
520
521
|
* By default, it uses the body of the top-level document object,
|
|
521
522
|
* so it's simply `document.body` most of the time.
|
|
522
523
|
*/
|
|
523
|
-
container:
|
|
524
|
+
container: l.oneOfType([Ee, l.func]),
|
|
524
525
|
/**
|
|
525
526
|
* If `true`, the modal will not automatically shift focus to itself when it opens, and
|
|
526
527
|
* replace it to the last focused element when it closes.
|
|
@@ -530,7 +531,7 @@ process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
|
530
531
|
* accessible to assistive technologies, like screen readers.
|
|
531
532
|
* @default false
|
|
532
533
|
*/
|
|
533
|
-
disableAutoFocus:
|
|
534
|
+
disableAutoFocus: l.bool,
|
|
534
535
|
/**
|
|
535
536
|
* If `true`, the modal will not prevent focus from leaving the modal while open.
|
|
536
537
|
*
|
|
@@ -538,45 +539,45 @@ process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
|
538
539
|
* accessible to assistive technologies, like screen readers.
|
|
539
540
|
* @default false
|
|
540
541
|
*/
|
|
541
|
-
disableEnforceFocus:
|
|
542
|
+
disableEnforceFocus: l.bool,
|
|
542
543
|
/**
|
|
543
544
|
* If `true`, hitting escape will not fire the `onClose` callback.
|
|
544
545
|
* @default false
|
|
545
546
|
*/
|
|
546
|
-
disableEscapeKeyDown:
|
|
547
|
+
disableEscapeKeyDown: l.bool,
|
|
547
548
|
/**
|
|
548
549
|
* The `children` will be under the DOM hierarchy of the parent component.
|
|
549
550
|
* @default false
|
|
550
551
|
*/
|
|
551
|
-
disablePortal:
|
|
552
|
+
disablePortal: l.bool,
|
|
552
553
|
/**
|
|
553
554
|
* If `true`, the modal will not restore focus to previously focused element once
|
|
554
555
|
* modal is hidden or unmounted.
|
|
555
556
|
* @default false
|
|
556
557
|
*/
|
|
557
|
-
disableRestoreFocus:
|
|
558
|
+
disableRestoreFocus: l.bool,
|
|
558
559
|
/**
|
|
559
560
|
* Disable the scroll lock behavior.
|
|
560
561
|
* @default false
|
|
561
562
|
*/
|
|
562
|
-
disableScrollLock:
|
|
563
|
+
disableScrollLock: l.bool,
|
|
563
564
|
/**
|
|
564
565
|
* If `true`, the backdrop is not rendered.
|
|
565
566
|
* @default false
|
|
566
567
|
*/
|
|
567
|
-
hideBackdrop:
|
|
568
|
+
hideBackdrop: l.bool,
|
|
568
569
|
/**
|
|
569
570
|
* Always keep the children in the DOM.
|
|
570
571
|
* This prop can be useful in SEO situation or
|
|
571
572
|
* when you want to maximize the responsiveness of the Modal.
|
|
572
573
|
* @default false
|
|
573
574
|
*/
|
|
574
|
-
keepMounted:
|
|
575
|
+
keepMounted: l.bool,
|
|
575
576
|
/**
|
|
576
577
|
* Callback fired when the backdrop is clicked.
|
|
577
578
|
* @deprecated Use the `onClose` prop with the `reason` argument to handle the `backdropClick` events.
|
|
578
579
|
*/
|
|
579
|
-
onBackdropClick:
|
|
580
|
+
onBackdropClick: l.func,
|
|
580
581
|
/**
|
|
581
582
|
* Callback fired when the component requests to be closed.
|
|
582
583
|
* The `reason` parameter can optionally be used to control the response to `onClose`.
|
|
@@ -584,64 +585,71 @@ process.env.NODE_ENV !== "production" && (re.propTypes = {
|
|
|
584
585
|
* @param {object} event The event source of the callback.
|
|
585
586
|
* @param {string} reason Can be: `"escapeKeyDown"`, `"backdropClick"`.
|
|
586
587
|
*/
|
|
587
|
-
onClose:
|
|
588
|
+
onClose: l.func,
|
|
588
589
|
/**
|
|
589
590
|
* A function called when a transition enters.
|
|
590
591
|
*/
|
|
591
|
-
onTransitionEnter:
|
|
592
|
+
onTransitionEnter: l.func,
|
|
592
593
|
/**
|
|
593
594
|
* A function called when a transition has exited.
|
|
594
595
|
*/
|
|
595
|
-
onTransitionExited:
|
|
596
|
+
onTransitionExited: l.func,
|
|
596
597
|
/**
|
|
597
598
|
* If `true`, the component is shown.
|
|
598
599
|
*/
|
|
599
|
-
open:
|
|
600
|
+
open: l.bool.isRequired,
|
|
600
601
|
/**
|
|
601
602
|
* The props used for each slot inside the Modal.
|
|
602
603
|
* @default {}
|
|
603
604
|
*/
|
|
604
|
-
slotProps:
|
|
605
|
-
backdrop:
|
|
606
|
-
root:
|
|
605
|
+
slotProps: l.shape({
|
|
606
|
+
backdrop: l.oneOfType([l.func, l.object]),
|
|
607
|
+
root: l.oneOfType([l.func, l.object])
|
|
607
608
|
}),
|
|
608
609
|
/**
|
|
609
610
|
* The components used for each slot inside the Modal.
|
|
610
611
|
* Either a string to use a HTML element or a component.
|
|
611
612
|
* @default {}
|
|
612
613
|
*/
|
|
613
|
-
slots:
|
|
614
|
-
backdrop:
|
|
615
|
-
root:
|
|
614
|
+
slots: l.shape({
|
|
615
|
+
backdrop: l.elementType,
|
|
616
|
+
root: l.elementType
|
|
616
617
|
})
|
|
617
618
|
});
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
)
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
619
|
+
const M = se((e, t) => {
|
|
620
|
+
const { children: n, dialogTitle: o, dialogSubtitle: s, icon: r, onClose: i = () => {
|
|
621
|
+
} } = e;
|
|
622
|
+
return /* @__PURE__ */ S(
|
|
623
|
+
re,
|
|
624
|
+
{
|
|
625
|
+
ref: t,
|
|
626
|
+
slots: { backdrop: ae },
|
|
627
|
+
...e,
|
|
628
|
+
onClose: (c, p) => {
|
|
629
|
+
i(p);
|
|
630
|
+
},
|
|
631
|
+
className: ie(z.dialog, e.className),
|
|
632
|
+
"aria-labelledby": "alert-dialog-title",
|
|
633
|
+
"aria-describedby": "alert-dialog-description",
|
|
634
|
+
children: /* @__PURE__ */ $("section", { className: z.dialog__panel, children: [
|
|
635
|
+
!!i && /* @__PURE__ */ S(ce, { handleOnClose: () => i("closeButtonClick") }),
|
|
636
|
+
/* @__PURE__ */ S(ee, { title: o, subTitle: s, icon: r }),
|
|
637
|
+
n
|
|
638
|
+
] })
|
|
639
|
+
}
|
|
640
|
+
);
|
|
641
|
+
});
|
|
642
|
+
M.Title = ee;
|
|
643
|
+
M.Title.displayName = "Dialog.Title";
|
|
644
|
+
M.Content = de;
|
|
645
|
+
M.Content.displayName = "Dialog.Content";
|
|
646
|
+
M.Actions = le;
|
|
647
|
+
M.Actions.displayName = "Dialog.Actions";
|
|
648
|
+
const Ze = M;
|
|
641
649
|
export {
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
650
|
+
le as Actions,
|
|
651
|
+
de as Content,
|
|
652
|
+
Ze as Dialog,
|
|
645
653
|
ee as DialogTitle,
|
|
646
|
-
|
|
654
|
+
M as default
|
|
647
655
|
};
|