react-luminus-components 1.1.6 → 1.1.7
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/.vite/manifest.json +53 -46
- package/dist/DataKey-C-RyQIZQ.mjs +51 -0
- package/dist/DataKey-CBpWR2M6.js +1 -0
- package/dist/{InvalidFeedback.module-DrVBvau3.js → EmployeesDropdown.module-4iGuBkjc.js} +15 -15
- package/dist/{InvalidFeedback.module-DJcRbXSF.mjs → EmployeesDropdown.module-AbK-MkT0.mjs} +290 -274
- package/dist/SimpleTooltip-BwmrrMt1.js +1 -0
- package/dist/{SimpleTooltip-CKNsKZll.mjs → SimpleTooltip-eeSv-6cG.mjs} +2 -2
- package/dist/components/Form/EmployeePicker/EmployeePicker.d.ts +2 -1
- package/dist/components/HookForm/EmployeePicker/HookFormEmployeePicker.d.ts +2 -1
- package/dist/components/common/EmployeesDropdown/EmployeesDropdown.d.ts +11 -0
- package/dist/components/common/InputContainer/InputContainer.d.ts +2 -1
- package/dist/components/common/index.d.ts +1 -0
- package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +2 -2
- package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +3 -3
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +648 -74
- package/dist/{hasClass-2sGhxaPc.mjs → hasClass-6QP28uKO.mjs} +1 -1
- package/dist/{hasClass-Ch2izaph.js → hasClass-Do_vMvLD.js} +5 -5
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +3 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +35 -33
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +2 -2
- package/dist/main.cjs.js +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.es.js +1129 -1123
- package/dist/models/index.d.ts +1 -1
- package/dist/models/texts/EmployeesDropdownTexts.d.ts +4 -0
- package/dist/style.css +1 -1
- package/dist/useClickOutside-BjJyGTec.mjs +14 -0
- package/dist/useClickOutside-DsVG12Cs.js +1 -0
- package/dist/{useConfirm-Cv_8Pxgx.mjs → useConfirm-CsFA8Y7z.mjs} +1 -1
- package/dist/useConfirm-DGeJryJS.js +1 -0
- package/package.json +2 -3
- package/dist/Modal-Cgt4jEpF.mjs +0 -627
- package/dist/Modal-dXyx77X0.js +0 -1
- package/dist/SimpleTooltip-hw-DnjyJ.js +0 -1
- package/dist/components/EmployeePicker/EmployeeSearch/EmployeeSearch.d.ts +0 -7
- package/dist/components/EmployeePicker/EmployeeSearchModal/EmployeeSearchModal.d.ts +0 -9
- package/dist/components/EmployeePicker/comps/EmployeeSearchItem/EmployeeSearchItem.d.ts +0 -7
- package/dist/components/EmployeePicker/comps/index.d.ts +0 -1
- package/dist/components/EmployeePicker/index.d.ts +0 -2
- package/dist/models/texts/EmployeeSearchModalTexts.d.ts +0 -6
- package/dist/useConfirm-BCj1t5rw.js +0 -1
package/dist/contexts.es.js
CHANGED
|
@@ -1,88 +1,662 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { u as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { j as a, C as tt, L as Ae, I as ot, g as nt, b as st, U as rt, d as y } from "./EmployeesDropdown.module-AbK-MkT0.mjs";
|
|
2
|
+
import * as g from "react";
|
|
3
|
+
import { useState as M, useCallback as m, useMemo as G, useEffect as Ce, forwardRef as at, useRef as N, useImperativeHandle as it, useContext as Le } from "react";
|
|
4
|
+
import { L as lt, d as dt, u as ct, q as D, T as ut } from "./DataKey-C-RyQIZQ.mjs";
|
|
5
|
+
import { u as ft } from "./useConfirm-CsFA8Y7z.mjs";
|
|
6
|
+
import { P as ge, c as Ee, o as De, s as z, u as Fe, a as ht, b as mt, d as w, l as Te, e as Ne, f as Ie, i as gt, r as Re, h as pt, g as I, j as vt, k as yt, m as Ct, n as je, F as $e, p as Et, t as wt } from "./hasClass-6QP28uKO.mjs";
|
|
7
|
+
import Mt from "react-dom";
|
|
8
|
+
const xt = ({ children: t }) => {
|
|
9
|
+
const [e, o] = M(!1), [n, s] = M(""), r = m((h) => {
|
|
10
|
+
o(!0), s(h);
|
|
11
|
+
}, []), u = m(() => {
|
|
12
|
+
o(!1);
|
|
13
|
+
}, []), d = G(() => ({ show: e, text: n, showConfirm: r, hideConfirm: u }), [e, n, r, u]);
|
|
14
|
+
return /* @__PURE__ */ a.jsxs(tt.Provider, { value: d, children: [
|
|
15
|
+
/* @__PURE__ */ a.jsx(Xt, {}),
|
|
16
|
+
t
|
|
14
17
|
] });
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
axiosInstance:
|
|
18
|
-
LinkComponent:
|
|
19
|
-
language:
|
|
20
|
-
axiosTexts:
|
|
21
|
-
confirmTexts:
|
|
22
|
-
formValidationTexts:
|
|
23
|
-
|
|
24
|
-
homeDashboardTexts:
|
|
18
|
+
}, to = ({ axiosInstance: t, LinkComponent: e, language: o, axiosTexts: n, confirmTexts: s, formValidationTexts: r, employeesDropdownTexts: u, homeDashboardTexts: d, children: h }) => {
|
|
19
|
+
const p = G(() => ({
|
|
20
|
+
axiosInstance: t,
|
|
21
|
+
LinkComponent: e,
|
|
22
|
+
language: o,
|
|
23
|
+
axiosTexts: n,
|
|
24
|
+
confirmTexts: s,
|
|
25
|
+
formValidationTexts: r,
|
|
26
|
+
employeesDropdownTexts: u,
|
|
27
|
+
homeDashboardTexts: d
|
|
25
28
|
}), [
|
|
26
|
-
r,
|
|
27
|
-
n,
|
|
28
|
-
e,
|
|
29
29
|
t,
|
|
30
|
+
e,
|
|
30
31
|
o,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return /* @__PURE__ */ s.jsx(h.Provider, { value: f, children: /* @__PURE__ */ s.jsxs(I, { children: [
|
|
36
|
-
/* @__PURE__ */ s.jsx(v, {}),
|
|
32
|
+
n,
|
|
33
|
+
s,
|
|
34
|
+
r,
|
|
35
|
+
u,
|
|
37
36
|
d
|
|
37
|
+
]);
|
|
38
|
+
return /* @__PURE__ */ a.jsx(Ae.Provider, { value: p, children: /* @__PURE__ */ a.jsxs(xt, { children: [
|
|
39
|
+
/* @__PURE__ */ a.jsx(ot, {}),
|
|
40
|
+
h
|
|
38
41
|
] }) });
|
|
39
|
-
},
|
|
40
|
-
const [
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
|
|
44
|
-
}, [
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
}, oo = ({ children: t }) => {
|
|
43
|
+
const [e, o] = M(!1), [n] = M(/* @__PURE__ */ new Set()), s = m((d) => {
|
|
44
|
+
n.add(d), o(!0);
|
|
45
|
+
}, [n]), r = m((d) => {
|
|
46
|
+
n.delete(d), n.size === 0 && o(!1);
|
|
47
|
+
}, [n]), u = G(() => ({ isLoading: e, startLoading: s, stopLoading: r }), [e, s, r]);
|
|
48
|
+
return /* @__PURE__ */ a.jsxs(nt.Provider, { value: u, children: [
|
|
49
|
+
e && /* @__PURE__ */ a.jsx(lt, {}),
|
|
50
|
+
t
|
|
48
51
|
] });
|
|
49
|
-
},
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
}, []), [
|
|
54
|
-
let
|
|
55
|
-
return await
|
|
56
|
-
|
|
52
|
+
}, no = ({ children: t }) => {
|
|
53
|
+
const e = st(), o = m(() => {
|
|
54
|
+
const c = localStorage.getItem("user") ?? null;
|
|
55
|
+
return c ? JSON.parse(c) : null;
|
|
56
|
+
}, []), [n, s] = M(o()), r = m(async () => {
|
|
57
|
+
let c = null;
|
|
58
|
+
return await e.get("/user/detail").then((x) => {
|
|
59
|
+
c = x.data;
|
|
57
60
|
}).catch(() => {
|
|
58
|
-
|
|
59
|
-
}), localStorage.setItem("user", JSON.stringify(
|
|
60
|
-
}, [
|
|
61
|
+
c = null;
|
|
62
|
+
}), localStorage.setItem("user", JSON.stringify(c)), c;
|
|
63
|
+
}, [e]), u = m(() => {
|
|
61
64
|
localStorage.removeItem("user");
|
|
62
|
-
}, []),
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
}, [
|
|
66
|
-
|
|
67
|
-
}, [
|
|
68
|
-
return
|
|
69
|
-
o(
|
|
70
|
-
}, [
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
}, []), d = m(async () => {
|
|
66
|
+
const c = await r();
|
|
67
|
+
return c ? (s(c), !0) : !1;
|
|
68
|
+
}, [r]), h = m(() => {
|
|
69
|
+
u(), s(null);
|
|
70
|
+
}, [u]), p = G(() => ({ user: n, loginUser: d, logoutUser: h }), [n, d, h]);
|
|
71
|
+
return Ce(() => {
|
|
72
|
+
s(o());
|
|
73
|
+
}, [o]), /* @__PURE__ */ a.jsx(rt.Provider, { value: p, children: t });
|
|
74
|
+
}, bt = (t) => /* @__PURE__ */ g.forwardRef((e, o) => /* @__PURE__ */ a.jsx("div", {
|
|
75
|
+
...e,
|
|
76
|
+
ref: o,
|
|
77
|
+
className: y(e.className, t)
|
|
78
|
+
})), Tt = {
|
|
79
|
+
/** An accessible label indicating the relevant information about the Close Button. */
|
|
80
|
+
"aria-label": ge.string,
|
|
81
|
+
/** A callback fired after the Close Button is clicked. */
|
|
82
|
+
onClick: ge.func,
|
|
83
|
+
/**
|
|
84
|
+
* Render different color variant for the button.
|
|
85
|
+
*
|
|
86
|
+
* Omitting this will render the default dark color.
|
|
87
|
+
*/
|
|
88
|
+
variant: ge.oneOf(["white"])
|
|
89
|
+
}, we = /* @__PURE__ */ g.forwardRef(({
|
|
90
|
+
className: t,
|
|
91
|
+
variant: e,
|
|
92
|
+
"aria-label": o = "Close",
|
|
93
|
+
...n
|
|
94
|
+
}, s) => /* @__PURE__ */ a.jsx("button", {
|
|
95
|
+
ref: s,
|
|
96
|
+
type: "button",
|
|
97
|
+
className: y("btn-close", e && `btn-close-${e}`, t),
|
|
98
|
+
"aria-label": o,
|
|
99
|
+
...n
|
|
100
|
+
}));
|
|
101
|
+
we.displayName = "CloseButton";
|
|
102
|
+
we.propTypes = Tt;
|
|
103
|
+
const Nt = we;
|
|
104
|
+
var ne;
|
|
105
|
+
function ke(t) {
|
|
106
|
+
if ((!ne && ne !== 0 || t) && Ee) {
|
|
107
|
+
var e = document.createElement("div");
|
|
108
|
+
e.style.position = "absolute", e.style.top = "-9999px", e.style.width = "50px", e.style.height = "50px", e.style.overflow = "scroll", document.body.appendChild(e), ne = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
109
|
+
}
|
|
110
|
+
return ne;
|
|
111
|
+
}
|
|
112
|
+
function pe(t) {
|
|
113
|
+
t === void 0 && (t = De());
|
|
114
|
+
try {
|
|
115
|
+
var e = t.activeElement;
|
|
116
|
+
return !e || !e.nodeName ? null : e;
|
|
117
|
+
} catch {
|
|
118
|
+
return t.body;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function Rt(t = document) {
|
|
122
|
+
const e = t.defaultView;
|
|
123
|
+
return Math.abs(e.innerWidth - t.documentElement.clientWidth);
|
|
124
|
+
}
|
|
125
|
+
const Oe = dt("modal-open");
|
|
126
|
+
class jt {
|
|
127
|
+
constructor({
|
|
128
|
+
ownerDocument: e,
|
|
129
|
+
handleContainerOverflow: o = !0,
|
|
130
|
+
isRTL: n = !1
|
|
131
|
+
} = {}) {
|
|
132
|
+
this.handleContainerOverflow = o, this.isRTL = n, this.modals = [], this.ownerDocument = e;
|
|
133
|
+
}
|
|
134
|
+
getScrollbarWidth() {
|
|
135
|
+
return Rt(this.ownerDocument);
|
|
136
|
+
}
|
|
137
|
+
getElement() {
|
|
138
|
+
return (this.ownerDocument || document).body;
|
|
139
|
+
}
|
|
140
|
+
setModalAttributes(e) {
|
|
141
|
+
}
|
|
142
|
+
removeModalAttributes(e) {
|
|
143
|
+
}
|
|
144
|
+
setContainerStyle(e) {
|
|
145
|
+
const o = {
|
|
146
|
+
overflow: "hidden"
|
|
147
|
+
}, n = this.isRTL ? "paddingLeft" : "paddingRight", s = this.getElement();
|
|
148
|
+
e.style = {
|
|
149
|
+
overflow: s.style.overflow,
|
|
150
|
+
[n]: s.style[n]
|
|
151
|
+
}, e.scrollBarWidth && (o[n] = `${parseInt(z(s, n) || "0", 10) + e.scrollBarWidth}px`), s.setAttribute(Oe, ""), z(s, o);
|
|
152
|
+
}
|
|
153
|
+
reset() {
|
|
154
|
+
[...this.modals].forEach((e) => this.remove(e));
|
|
155
|
+
}
|
|
156
|
+
removeContainerStyle(e) {
|
|
157
|
+
const o = this.getElement();
|
|
158
|
+
o.removeAttribute(Oe), Object.assign(o.style, e.style);
|
|
159
|
+
}
|
|
160
|
+
add(e) {
|
|
161
|
+
let o = this.modals.indexOf(e);
|
|
162
|
+
return o !== -1 || (o = this.modals.length, this.modals.push(e), this.setModalAttributes(e), o !== 0) || (this.state = {
|
|
163
|
+
scrollBarWidth: this.getScrollbarWidth(),
|
|
164
|
+
style: {}
|
|
165
|
+
}, this.handleContainerOverflow && this.setContainerStyle(this.state)), o;
|
|
166
|
+
}
|
|
167
|
+
remove(e) {
|
|
168
|
+
const o = this.modals.indexOf(e);
|
|
169
|
+
o !== -1 && (this.modals.splice(o, 1), !this.modals.length && this.handleContainerOverflow && this.removeContainerStyle(this.state), this.removeModalAttributes(e));
|
|
170
|
+
}
|
|
171
|
+
isTopModal(e) {
|
|
172
|
+
return !!this.modals.length && this.modals[this.modals.length - 1] === e;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const Me = jt, kt = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
|
|
176
|
+
function Ot(t, e) {
|
|
177
|
+
if (t == null)
|
|
178
|
+
return {};
|
|
179
|
+
var o = {}, n = Object.keys(t), s, r;
|
|
180
|
+
for (r = 0; r < n.length; r++)
|
|
181
|
+
s = n[r], !(e.indexOf(s) >= 0) && (o[s] = t[s]);
|
|
182
|
+
return o;
|
|
183
|
+
}
|
|
184
|
+
let ve;
|
|
185
|
+
function St(t) {
|
|
186
|
+
return ve || (ve = new Me({
|
|
187
|
+
ownerDocument: t == null ? void 0 : t.document
|
|
188
|
+
})), ve;
|
|
189
|
+
}
|
|
190
|
+
function Bt(t) {
|
|
191
|
+
const e = Fe(), o = t || St(e), n = N({
|
|
192
|
+
dialog: null,
|
|
193
|
+
backdrop: null
|
|
194
|
+
});
|
|
195
|
+
return Object.assign(n.current, {
|
|
196
|
+
add: () => o.add(n.current),
|
|
197
|
+
remove: () => o.remove(n.current),
|
|
198
|
+
isTopModal: () => o.isTopModal(n.current),
|
|
199
|
+
setDialogRef: m((s) => {
|
|
200
|
+
n.current.dialog = s;
|
|
201
|
+
}, []),
|
|
202
|
+
setBackdropRef: m((s) => {
|
|
203
|
+
n.current.backdrop = s;
|
|
204
|
+
}, [])
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
const We = /* @__PURE__ */ at((t, e) => {
|
|
208
|
+
let {
|
|
209
|
+
show: o = !1,
|
|
210
|
+
role: n = "dialog",
|
|
211
|
+
className: s,
|
|
212
|
+
style: r,
|
|
213
|
+
children: u,
|
|
214
|
+
backdrop: d = !0,
|
|
215
|
+
keyboard: h = !0,
|
|
216
|
+
onBackdropClick: p,
|
|
217
|
+
onEscapeKeyDown: c,
|
|
218
|
+
transition: x,
|
|
219
|
+
runTransition: b,
|
|
220
|
+
backdropTransition: R,
|
|
221
|
+
runBackdropTransition: se,
|
|
222
|
+
autoFocus: P = !0,
|
|
223
|
+
enforceFocus: re = !0,
|
|
224
|
+
restoreFocus: j = !0,
|
|
225
|
+
restoreFocusOptions: ae,
|
|
226
|
+
renderDialog: V,
|
|
227
|
+
renderBackdrop: ie = (l) => /* @__PURE__ */ a.jsx("div", Object.assign({}, l)),
|
|
228
|
+
manager: le,
|
|
229
|
+
container: de,
|
|
230
|
+
onShow: X,
|
|
231
|
+
onHide: $ = () => {
|
|
232
|
+
},
|
|
233
|
+
onExit: ce,
|
|
234
|
+
onExited: W,
|
|
235
|
+
onExiting: Y,
|
|
236
|
+
onEnter: q,
|
|
237
|
+
onEntering: J,
|
|
238
|
+
onEntered: Q
|
|
239
|
+
} = t, ue = Ot(t, kt);
|
|
240
|
+
const C = Fe(), k = ht(de), f = Bt(le), fe = mt(), Z = ct(o), [T, O] = M(!o), v = N(null);
|
|
241
|
+
it(e, () => f, [f]), Ee && !Z && o && (v.current = pe(C == null ? void 0 : C.document)), o && T && O(!1);
|
|
242
|
+
const E = w(() => {
|
|
243
|
+
if (f.add(), S.current = Te(document, "keydown", me), H.current = Te(
|
|
244
|
+
document,
|
|
245
|
+
"focus",
|
|
246
|
+
// the timeout is necessary b/c this will run before the new modal is mounted
|
|
247
|
+
// and so steals focus from it
|
|
248
|
+
() => setTimeout(he),
|
|
249
|
+
!0
|
|
250
|
+
), X && X(), P) {
|
|
251
|
+
var l, oe;
|
|
252
|
+
const K = pe((l = (oe = f.dialog) == null ? void 0 : oe.ownerDocument) != null ? l : C == null ? void 0 : C.document);
|
|
253
|
+
f.dialog && K && !Ne(f.dialog, K) && (v.current = K, f.dialog.focus());
|
|
254
|
+
}
|
|
255
|
+
}), U = w(() => {
|
|
256
|
+
if (f.remove(), S.current == null || S.current(), H.current == null || H.current(), j) {
|
|
257
|
+
var l;
|
|
258
|
+
(l = v.current) == null || l.focus == null || l.focus(ae), v.current = null;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
Ce(() => {
|
|
262
|
+
!o || !k || E();
|
|
263
|
+
}, [
|
|
264
|
+
o,
|
|
265
|
+
k,
|
|
266
|
+
/* should never change: */
|
|
267
|
+
E
|
|
268
|
+
]), Ce(() => {
|
|
269
|
+
T && U();
|
|
270
|
+
}, [T, U]), Ie(() => {
|
|
271
|
+
U();
|
|
272
|
+
});
|
|
273
|
+
const he = w(() => {
|
|
274
|
+
if (!re || !fe() || !f.isTopModal())
|
|
275
|
+
return;
|
|
276
|
+
const l = pe(C == null ? void 0 : C.document);
|
|
277
|
+
f.dialog && l && !Ne(f.dialog, l) && f.dialog.focus();
|
|
278
|
+
}), ee = w((l) => {
|
|
279
|
+
l.target === l.currentTarget && (p == null || p(l), d === !0 && $());
|
|
280
|
+
}), me = w((l) => {
|
|
281
|
+
h && gt(l) && f.isTopModal() && (c == null || c(l), l.defaultPrevented || $());
|
|
282
|
+
}), H = N(), S = N(), te = (...l) => {
|
|
283
|
+
O(!0), W == null || W(...l);
|
|
284
|
+
};
|
|
285
|
+
if (!k)
|
|
286
|
+
return null;
|
|
287
|
+
const B = Object.assign({
|
|
288
|
+
role: n,
|
|
289
|
+
ref: f.setDialogRef,
|
|
290
|
+
// apparently only works on the dialog role element
|
|
291
|
+
"aria-modal": n === "dialog" ? !0 : void 0
|
|
292
|
+
}, ue, {
|
|
293
|
+
style: r,
|
|
294
|
+
className: s,
|
|
295
|
+
tabIndex: -1
|
|
296
|
+
});
|
|
297
|
+
let _ = V ? V(B) : /* @__PURE__ */ a.jsx("div", Object.assign({}, B, {
|
|
298
|
+
children: /* @__PURE__ */ g.cloneElement(u, {
|
|
299
|
+
role: "document"
|
|
300
|
+
})
|
|
301
|
+
}));
|
|
302
|
+
_ = Re(x, b, {
|
|
303
|
+
unmountOnExit: !0,
|
|
304
|
+
mountOnEnter: !0,
|
|
305
|
+
appear: !0,
|
|
306
|
+
in: !!o,
|
|
307
|
+
onExit: ce,
|
|
308
|
+
onExiting: Y,
|
|
309
|
+
onExited: te,
|
|
310
|
+
onEnter: q,
|
|
311
|
+
onEntering: J,
|
|
312
|
+
onEntered: Q,
|
|
313
|
+
children: _
|
|
314
|
+
});
|
|
315
|
+
let A = null;
|
|
316
|
+
return d && (A = ie({
|
|
317
|
+
ref: f.setBackdropRef,
|
|
318
|
+
onClick: ee
|
|
319
|
+
}), A = Re(R, se, {
|
|
320
|
+
in: !!o,
|
|
321
|
+
appear: !0,
|
|
322
|
+
mountOnEnter: !0,
|
|
323
|
+
unmountOnExit: !0,
|
|
324
|
+
children: A
|
|
325
|
+
})), /* @__PURE__ */ a.jsx(a.Fragment, {
|
|
326
|
+
children: /* @__PURE__ */ Mt.createPortal(/* @__PURE__ */ a.jsxs(a.Fragment, {
|
|
327
|
+
children: [A, _]
|
|
328
|
+
}), k)
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
We.displayName = "Modal";
|
|
332
|
+
const At = Object.assign(We, {
|
|
333
|
+
Manager: Me
|
|
334
|
+
});
|
|
335
|
+
function Lt(t, e) {
|
|
336
|
+
t.classList ? t.classList.add(e) : pt(t, e) || (typeof t.className == "string" ? t.className = t.className + " " + e : t.setAttribute("class", (t.className && t.className.baseVal || "") + " " + e));
|
|
337
|
+
}
|
|
338
|
+
function Se(t, e) {
|
|
339
|
+
return t.replace(new RegExp("(^|\\s)" + e + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
340
|
+
}
|
|
341
|
+
function Dt(t, e) {
|
|
342
|
+
t.classList ? t.classList.remove(e) : typeof t.className == "string" ? t.className = Se(t.className, e) : t.setAttribute("class", Se(t.className && t.className.baseVal || "", e));
|
|
343
|
+
}
|
|
344
|
+
const F = {
|
|
345
|
+
FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
|
|
346
|
+
STICKY_CONTENT: ".sticky-top",
|
|
347
|
+
NAVBAR_TOGGLER: ".navbar-toggler"
|
|
348
|
+
};
|
|
349
|
+
class Ft extends Me {
|
|
350
|
+
adjustAndStore(e, o, n) {
|
|
351
|
+
const s = o.style[e];
|
|
352
|
+
o.dataset[e] = s, z(o, {
|
|
353
|
+
[e]: `${parseFloat(z(o, e)) + n}px`
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
restore(e, o) {
|
|
357
|
+
const n = o.dataset[e];
|
|
358
|
+
n !== void 0 && (delete o.dataset[e], z(o, {
|
|
359
|
+
[e]: n
|
|
360
|
+
}));
|
|
361
|
+
}
|
|
362
|
+
setContainerStyle(e) {
|
|
363
|
+
super.setContainerStyle(e);
|
|
364
|
+
const o = this.getElement();
|
|
365
|
+
if (Lt(o, "modal-open"), !e.scrollBarWidth)
|
|
366
|
+
return;
|
|
367
|
+
const n = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
|
|
368
|
+
D(o, F.FIXED_CONTENT).forEach((r) => this.adjustAndStore(n, r, e.scrollBarWidth)), D(o, F.STICKY_CONTENT).forEach((r) => this.adjustAndStore(s, r, -e.scrollBarWidth)), D(o, F.NAVBAR_TOGGLER).forEach((r) => this.adjustAndStore(s, r, e.scrollBarWidth));
|
|
369
|
+
}
|
|
370
|
+
removeContainerStyle(e) {
|
|
371
|
+
super.removeContainerStyle(e);
|
|
372
|
+
const o = this.getElement();
|
|
373
|
+
Dt(o, "modal-open");
|
|
374
|
+
const n = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
|
|
375
|
+
D(o, F.FIXED_CONTENT).forEach((r) => this.restore(n, r)), D(o, F.STICKY_CONTENT).forEach((r) => this.restore(s, r)), D(o, F.NAVBAR_TOGGLER).forEach((r) => this.restore(s, r));
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
let ye;
|
|
379
|
+
function It(t) {
|
|
380
|
+
return ye || (ye = new Ft(t)), ye;
|
|
381
|
+
}
|
|
382
|
+
const Ue = /* @__PURE__ */ g.forwardRef(({
|
|
383
|
+
className: t,
|
|
384
|
+
bsPrefix: e,
|
|
385
|
+
as: o = "div",
|
|
386
|
+
...n
|
|
387
|
+
}, s) => (e = I(e, "modal-body"), /* @__PURE__ */ a.jsx(o, {
|
|
388
|
+
ref: s,
|
|
389
|
+
className: y(t, e),
|
|
390
|
+
...n
|
|
391
|
+
})));
|
|
392
|
+
Ue.displayName = "ModalBody";
|
|
393
|
+
const $t = Ue, Wt = /* @__PURE__ */ g.createContext({
|
|
394
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
395
|
+
onHide() {
|
|
396
|
+
}
|
|
397
|
+
}), He = Wt, _e = /* @__PURE__ */ g.forwardRef(({
|
|
398
|
+
bsPrefix: t,
|
|
399
|
+
className: e,
|
|
400
|
+
contentClassName: o,
|
|
401
|
+
centered: n,
|
|
402
|
+
size: s,
|
|
403
|
+
fullscreen: r,
|
|
404
|
+
children: u,
|
|
405
|
+
scrollable: d,
|
|
406
|
+
...h
|
|
407
|
+
}, p) => {
|
|
408
|
+
t = I(t, "modal");
|
|
409
|
+
const c = `${t}-dialog`, x = typeof r == "string" ? `${t}-fullscreen-${r}` : `${t}-fullscreen`;
|
|
410
|
+
return /* @__PURE__ */ a.jsx("div", {
|
|
411
|
+
...h,
|
|
412
|
+
ref: p,
|
|
413
|
+
className: y(c, e, s && `${t}-${s}`, n && `${c}-centered`, d && `${c}-scrollable`, r && x),
|
|
414
|
+
children: /* @__PURE__ */ a.jsx("div", {
|
|
415
|
+
className: y(`${t}-content`, o),
|
|
416
|
+
children: u
|
|
417
|
+
})
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
_e.displayName = "ModalDialog";
|
|
421
|
+
const Ke = _e, ze = /* @__PURE__ */ g.forwardRef(({
|
|
422
|
+
className: t,
|
|
423
|
+
bsPrefix: e,
|
|
424
|
+
as: o = "div",
|
|
425
|
+
...n
|
|
426
|
+
}, s) => (e = I(e, "modal-footer"), /* @__PURE__ */ a.jsx(o, {
|
|
427
|
+
ref: s,
|
|
428
|
+
className: y(t, e),
|
|
429
|
+
...n
|
|
430
|
+
})));
|
|
431
|
+
ze.displayName = "ModalFooter";
|
|
432
|
+
const Ut = ze, Ht = /* @__PURE__ */ g.forwardRef(({
|
|
433
|
+
closeLabel: t = "Close",
|
|
434
|
+
closeVariant: e,
|
|
435
|
+
closeButton: o = !1,
|
|
436
|
+
onHide: n,
|
|
437
|
+
children: s,
|
|
438
|
+
...r
|
|
439
|
+
}, u) => {
|
|
440
|
+
const d = Le(He), h = w(() => {
|
|
441
|
+
d == null || d.onHide(), n == null || n();
|
|
442
|
+
});
|
|
443
|
+
return /* @__PURE__ */ a.jsxs("div", {
|
|
444
|
+
ref: u,
|
|
445
|
+
...r,
|
|
446
|
+
children: [s, o && /* @__PURE__ */ a.jsx(Nt, {
|
|
447
|
+
"aria-label": t,
|
|
448
|
+
variant: e,
|
|
449
|
+
onClick: h
|
|
450
|
+
})]
|
|
451
|
+
});
|
|
452
|
+
}), _t = Ht, Ge = /* @__PURE__ */ g.forwardRef(({
|
|
453
|
+
bsPrefix: t,
|
|
454
|
+
className: e,
|
|
455
|
+
closeLabel: o = "Close",
|
|
456
|
+
closeButton: n = !1,
|
|
457
|
+
...s
|
|
458
|
+
}, r) => (t = I(t, "modal-header"), /* @__PURE__ */ a.jsx(_t, {
|
|
459
|
+
ref: r,
|
|
460
|
+
...s,
|
|
461
|
+
className: y(e, t),
|
|
462
|
+
closeLabel: o,
|
|
463
|
+
closeButton: n
|
|
464
|
+
})));
|
|
465
|
+
Ge.displayName = "ModalHeader";
|
|
466
|
+
const Kt = Ge, zt = bt("h4"), Pe = /* @__PURE__ */ g.forwardRef(({
|
|
467
|
+
className: t,
|
|
468
|
+
bsPrefix: e,
|
|
469
|
+
as: o = zt,
|
|
470
|
+
...n
|
|
471
|
+
}, s) => (e = I(e, "modal-title"), /* @__PURE__ */ a.jsx(o, {
|
|
472
|
+
ref: s,
|
|
473
|
+
className: y(t, e),
|
|
474
|
+
...n
|
|
475
|
+
})));
|
|
476
|
+
Pe.displayName = "ModalTitle";
|
|
477
|
+
const Gt = Pe;
|
|
478
|
+
function Pt(t) {
|
|
479
|
+
return /* @__PURE__ */ a.jsx($e, {
|
|
480
|
+
...t,
|
|
481
|
+
timeout: null
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
function Vt(t) {
|
|
485
|
+
return /* @__PURE__ */ a.jsx($e, {
|
|
486
|
+
...t,
|
|
487
|
+
timeout: null
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
const Ve = /* @__PURE__ */ g.forwardRef(({
|
|
491
|
+
bsPrefix: t,
|
|
492
|
+
className: e,
|
|
493
|
+
style: o,
|
|
494
|
+
dialogClassName: n,
|
|
495
|
+
contentClassName: s,
|
|
496
|
+
children: r,
|
|
497
|
+
dialogAs: u = Ke,
|
|
498
|
+
"data-bs-theme": d,
|
|
499
|
+
"aria-labelledby": h,
|
|
500
|
+
"aria-describedby": p,
|
|
501
|
+
"aria-label": c,
|
|
502
|
+
/* BaseModal props */
|
|
503
|
+
show: x = !1,
|
|
504
|
+
animation: b = !0,
|
|
505
|
+
backdrop: R = !0,
|
|
506
|
+
keyboard: se = !0,
|
|
507
|
+
onEscapeKeyDown: P,
|
|
508
|
+
onShow: re,
|
|
509
|
+
onHide: j,
|
|
510
|
+
container: ae,
|
|
511
|
+
autoFocus: V = !0,
|
|
512
|
+
enforceFocus: ie = !0,
|
|
513
|
+
restoreFocus: le = !0,
|
|
514
|
+
restoreFocusOptions: de,
|
|
515
|
+
onEntered: X,
|
|
516
|
+
onExit: $,
|
|
517
|
+
onExiting: ce,
|
|
518
|
+
onEnter: W,
|
|
519
|
+
onEntering: Y,
|
|
520
|
+
onExited: q,
|
|
521
|
+
backdropClassName: J,
|
|
522
|
+
manager: Q,
|
|
523
|
+
...ue
|
|
524
|
+
}, C) => {
|
|
525
|
+
const [k, f] = M({}), [fe, Z] = M(!1), T = N(!1), O = N(!1), v = N(null), [E, U] = vt(), he = yt(C, U), ee = w(j), me = Ct();
|
|
526
|
+
t = I(t, "modal");
|
|
527
|
+
const H = G(() => ({
|
|
528
|
+
onHide: ee
|
|
529
|
+
}), [ee]);
|
|
530
|
+
function S() {
|
|
531
|
+
return Q || It({
|
|
532
|
+
isRTL: me
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
function te(i) {
|
|
536
|
+
if (!Ee)
|
|
537
|
+
return;
|
|
538
|
+
const L = S().getScrollbarWidth() > 0, be = i.scrollHeight > De(i).documentElement.clientHeight;
|
|
539
|
+
f({
|
|
540
|
+
paddingRight: L && !be ? ke() : void 0,
|
|
541
|
+
paddingLeft: !L && be ? ke() : void 0
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
const B = w(() => {
|
|
545
|
+
E && te(E.dialog);
|
|
546
|
+
});
|
|
547
|
+
Ie(() => {
|
|
548
|
+
je(window, "resize", B), v.current == null || v.current();
|
|
549
|
+
});
|
|
550
|
+
const _ = () => {
|
|
551
|
+
T.current = !0;
|
|
552
|
+
}, A = (i) => {
|
|
553
|
+
T.current && E && i.target === E.dialog && (O.current = !0), T.current = !1;
|
|
554
|
+
}, l = () => {
|
|
555
|
+
Z(!0), v.current = wt(E.dialog, () => {
|
|
556
|
+
Z(!1);
|
|
557
|
+
});
|
|
558
|
+
}, oe = (i) => {
|
|
559
|
+
i.target === i.currentTarget && l();
|
|
560
|
+
}, K = (i) => {
|
|
561
|
+
if (R === "static") {
|
|
562
|
+
oe(i);
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
if (O.current || i.target !== i.currentTarget) {
|
|
566
|
+
O.current = !1;
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
j == null || j();
|
|
570
|
+
}, Xe = (i) => {
|
|
571
|
+
se ? P == null || P(i) : (i.preventDefault(), R === "static" && l());
|
|
572
|
+
}, Ye = (i, L) => {
|
|
573
|
+
i && te(i), W == null || W(i, L);
|
|
574
|
+
}, qe = (i) => {
|
|
575
|
+
v.current == null || v.current(), $ == null || $(i);
|
|
576
|
+
}, Je = (i, L) => {
|
|
577
|
+
Y == null || Y(i, L), Et(window, "resize", B);
|
|
578
|
+
}, Qe = (i) => {
|
|
579
|
+
i && (i.style.display = ""), q == null || q(i), je(window, "resize", B);
|
|
580
|
+
}, Ze = m((i) => /* @__PURE__ */ a.jsx("div", {
|
|
581
|
+
...i,
|
|
582
|
+
className: y(`${t}-backdrop`, J, !b && "show")
|
|
583
|
+
}), [b, J, t]), xe = {
|
|
584
|
+
...o,
|
|
585
|
+
...k
|
|
586
|
+
};
|
|
587
|
+
xe.display = "block";
|
|
588
|
+
const et = (i) => /* @__PURE__ */ a.jsx("div", {
|
|
589
|
+
role: "dialog",
|
|
590
|
+
...i,
|
|
591
|
+
style: xe,
|
|
592
|
+
className: y(e, t, fe && `${t}-static`, !b && "show"),
|
|
593
|
+
onClick: R ? K : void 0,
|
|
594
|
+
onMouseUp: A,
|
|
595
|
+
"data-bs-theme": d,
|
|
596
|
+
"aria-label": c,
|
|
597
|
+
"aria-labelledby": h,
|
|
598
|
+
"aria-describedby": p,
|
|
599
|
+
children: /* @__PURE__ */ a.jsx(u, {
|
|
600
|
+
...ue,
|
|
601
|
+
onMouseDown: _,
|
|
602
|
+
className: n,
|
|
603
|
+
contentClassName: s,
|
|
604
|
+
children: r
|
|
605
|
+
})
|
|
606
|
+
});
|
|
607
|
+
return /* @__PURE__ */ a.jsx(He.Provider, {
|
|
608
|
+
value: H,
|
|
609
|
+
children: /* @__PURE__ */ a.jsx(At, {
|
|
610
|
+
show: x,
|
|
611
|
+
ref: he,
|
|
612
|
+
backdrop: R,
|
|
613
|
+
container: ae,
|
|
614
|
+
keyboard: !0,
|
|
615
|
+
autoFocus: V,
|
|
616
|
+
enforceFocus: ie,
|
|
617
|
+
restoreFocus: le,
|
|
618
|
+
restoreFocusOptions: de,
|
|
619
|
+
onEscapeKeyDown: Xe,
|
|
620
|
+
onShow: re,
|
|
621
|
+
onHide: j,
|
|
622
|
+
onEnter: Ye,
|
|
623
|
+
onEntering: Je,
|
|
624
|
+
onEntered: X,
|
|
625
|
+
onExit: qe,
|
|
626
|
+
onExiting: ce,
|
|
627
|
+
onExited: Qe,
|
|
628
|
+
manager: S(),
|
|
629
|
+
transition: b ? Pt : void 0,
|
|
630
|
+
backdropTransition: b ? Vt : void 0,
|
|
631
|
+
renderBackdrop: Ze,
|
|
632
|
+
renderDialog: et
|
|
633
|
+
})
|
|
634
|
+
});
|
|
635
|
+
});
|
|
636
|
+
Ve.displayName = "Modal";
|
|
637
|
+
const Be = Object.assign(Ve, {
|
|
638
|
+
Body: $t,
|
|
639
|
+
Header: Kt,
|
|
640
|
+
Title: Gt,
|
|
641
|
+
Footer: Ut,
|
|
642
|
+
Dialog: Ke,
|
|
643
|
+
TRANSITION_DURATION: 300,
|
|
644
|
+
BACKDROP_TRANSITION_DURATION: 150
|
|
645
|
+
}), Xt = () => {
|
|
646
|
+
const { confirmTexts: t } = Le(Ae), { onConfirm: e, onCancel: o, text: n, show: s } = ft();
|
|
647
|
+
return /* @__PURE__ */ a.jsx(Be, { show: s, size: "sm", centered: !0, onHide: o, children: /* @__PURE__ */ a.jsxs(Be.Body, { children: [
|
|
648
|
+
/* @__PURE__ */ a.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ a.jsx(ut, { variant: "h6", children: n }) }),
|
|
649
|
+
/* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
650
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: o, children: t.no }),
|
|
651
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: e, children: t.yes })
|
|
78
652
|
] })
|
|
79
653
|
] }) });
|
|
80
654
|
};
|
|
81
655
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
656
|
+
nt as LoadingContext,
|
|
657
|
+
oo as LoadingProvider,
|
|
658
|
+
Ae as LuminusComponentsContext,
|
|
659
|
+
to as LuminusComponentsProvider,
|
|
660
|
+
rt as UserContext,
|
|
661
|
+
no as UserProvider
|
|
88
662
|
};
|