react-luminus-components 1.0.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/README.md +3 -0
- package/dist/.vite/manifest.json +133 -0
- package/dist/Modal-JLnYbEat.js +1 -0
- package/dist/Modal-_FnSEPRk.mjs +623 -0
- package/dist/SimpleTooltip-BjlbHsKC.mjs +1767 -0
- package/dist/SimpleTooltip-D9shMl1R.js +1 -0
- package/dist/components/EmployeePicker/EmployeeSearch/EmployeeSearch.d.ts +7 -0
- package/dist/components/EmployeePicker/EmployeeSearchModal/EmployeeSearchModal.d.ts +9 -0
- package/dist/components/EmployeePicker/comps/EmployeeSearchItem/EmployeeSearchItem.d.ts +7 -0
- package/dist/components/EmployeePicker/comps/index.d.ts +1 -0
- package/dist/components/EmployeePicker/index.d.ts +2 -0
- package/dist/components/Form/CheckInput/CheckInput.d.ts +11 -0
- package/dist/components/Form/Container/InputContainer.d.ts +8 -0
- package/dist/components/Form/EmployeePicker/EmployeePicker.d.ts +12 -0
- package/dist/components/Form/SelectInput/SelectInput.d.ts +17 -0
- package/dist/components/Form/TextInput/TextInput.d.ts +16 -0
- package/dist/components/Form/index.d.ts +4 -0
- package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +9 -0
- package/dist/components/HookForm/EmployeePicker/HookFormEmployeePicker.d.ts +9 -0
- package/dist/components/HookForm/FloatingSubmit/FloatingFormSubmit.d.ts +6 -0
- package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +9 -0
- package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +9 -0
- package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +9 -0
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +9 -0
- package/dist/components/HookForm/index.d.ts +7 -0
- package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +10 -0
- package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +8 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +8 -0
- package/dist/components/UserAvatar/UserAvatarDropdown/UserAvatarDropdown.d.ts +7 -0
- package/dist/components/UserAvatar/UserAvatarToggle/UserAvatarToggle.d.ts +8 -0
- package/dist/components/UserAvatar/index.d.ts +2 -0
- package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +9 -0
- package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +3 -0
- package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +9 -0
- package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +6 -0
- package/dist/components/common/HomeDashboard/comps/index.d.ts +1 -0
- package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +6 -0
- package/dist/components/common/Loading/Loading.d.ts +3 -0
- package/dist/components/common/MonthPicker/MonthPicker.d.ts +9 -0
- package/dist/components/common/Typography/Typography.d.ts +9 -0
- package/dist/components/common/index.d.ts +6 -0
- package/dist/constants-CT2hnPeO.js +1 -0
- package/dist/constants-CzNy5yO3.mjs +7 -0
- package/dist/contexts/confirm/ConfirmContext.d.ts +9 -0
- package/dist/contexts/confirm/ConfirmProvider.d.ts +6 -0
- package/dist/contexts/index.d.ts +6 -0
- package/dist/contexts/loading/LoadingContext.d.ts +8 -0
- package/dist/contexts/loading/LoadingProvider.d.ts +6 -0
- package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +15 -0
- package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +16 -0
- package/dist/contexts/user/UserContext.d.ts +9 -0
- package/dist/contexts/user/UserProvider.d.ts +6 -0
- package/dist/contexts.cjs.js +1 -0
- package/dist/contexts.d.ts +1 -0
- package/dist/contexts.es.js +86 -0
- package/dist/hasClass-3JW9Qluf.mjs +1482 -0
- package/dist/hasClass-6m1Qq_DA.js +20 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useAuth/useAuth.d.ts +7 -0
- package/dist/hooks/useAxios/useAxios.d.ts +3 -0
- package/dist/hooks/useConfirm/useConfirm.d.ts +8 -0
- package/dist/hooks/useNotifications/useNotifications.d.ts +4 -0
- package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +44 -0
- package/dist/hooks.cjs.js +1 -0
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.es.js +2781 -0
- package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +4 -0
- package/dist/layout/MainContainer/MainContainer.d.ts +4 -0
- package/dist/layout/SideContentBar/SideContentBar.d.ts +7 -0
- package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +10 -0
- package/dist/layout/SideMenu/SideMenu.d.ts +10 -0
- package/dist/layout/TopBar/TopBar.d.ts +7 -0
- package/dist/layout/index.d.ts +5 -0
- package/dist/layout.cjs.js +1 -0
- package/dist/layout.d.ts +1 -0
- package/dist/layout.es.js +164 -0
- package/dist/main.cjs.js +1 -0
- package/dist/main.d.ts +11 -0
- package/dist/main.es.js +2788 -0
- package/dist/models/index.d.ts +23 -0
- package/dist/models/prop-types/ContainerProps.d.ts +6 -0
- package/dist/models/prop-types/HookFormCheckInputProps.d.ts +7 -0
- package/dist/models/prop-types/HookFormEmployeePickerProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormInputProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormRadioInputProps.d.ts +7 -0
- package/dist/models/prop-types/HookFormSelectInputProps.d.ts +12 -0
- package/dist/models/prop-types/HookFormTextAreaInputProps.d.ts +9 -0
- package/dist/models/prop-types/HookFormTextInputProps.d.ts +11 -0
- package/dist/models/texts/AxiosTexts.d.ts +6 -0
- package/dist/models/texts/ConfirmTexts.d.ts +5 -0
- package/dist/models/texts/EmployeeSearchModalTexts.d.ts +6 -0
- package/dist/models/texts/FormValidationTexts.d.ts +5 -0
- package/dist/models/texts/HomeDashboardTexts.d.ts +5 -0
- package/dist/models/types/ApiErrorResult.d.ts +7 -0
- package/dist/models/types/DashboardConfig.d.ts +5 -0
- package/dist/models/types/DashboardWidget.d.ts +7 -0
- package/dist/models/types/DashboardWidgetConfig.d.ts +5 -0
- package/dist/models/types/EmployeeIndexModel.d.ts +14 -0
- package/dist/models/types/ErrorField.d.ts +5 -0
- package/dist/models/types/FormSelectOption.d.ts +5 -0
- package/dist/models/types/HookFormInputProps.d.ts +9 -0
- package/dist/models/types/MenuItemType.d.ts +9 -0
- package/dist/models/types/NameIdIntModel.d.ts +5 -0
- package/dist/models/types/NameIdStringModel.d.ts +5 -0
- package/dist/models/types/UserModel.d.ts +13 -0
- package/dist/style.css +1 -0
- package/dist/textUtils-9KFqOvA8.mjs +27 -0
- package/dist/textUtils-C0nqWp3S.js +1 -0
- package/dist/useAxios-BU-BqYrK.mjs +2663 -0
- package/dist/useAxios-ZEhq7C_H.js +212 -0
- package/dist/useConfirm-BazFQNRI.js +1 -0
- package/dist/useConfirm-DH9Pmz_w.mjs +18 -0
- package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +4 -0
- package/dist/utils/date/dateUtils.d.ts +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/object/objectUtils.d.ts +2 -0
- package/dist/utils/text/textUtils.d.ts +1 -0
- package/dist/utils.cjs.js +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.es.js +137 -0
- package/package.json +94 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { j as s, C as j, L as g, I as v, d as p, b, U as w } from "./useAxios-BU-BqYrK.mjs";
|
|
2
|
+
import { useState as m, useCallback as u, useMemo as x, useEffect as y, useContext as L } from "react";
|
|
3
|
+
import { L as S, M as f, T as U } from "./Modal-_FnSEPRk.mjs";
|
|
4
|
+
import { u as P } from "./useConfirm-DH9Pmz_w.mjs";
|
|
5
|
+
const I = ({ children: r }) => {
|
|
6
|
+
const [n, t] = m(!1), [e, o] = m(""), a = u((d) => {
|
|
7
|
+
t(!0), o(d);
|
|
8
|
+
}, []), i = u(() => {
|
|
9
|
+
t(!1);
|
|
10
|
+
}, []), c = x(() => ({ show: n, text: e, showConfirm: a, hideConfirm: i }), [n, e, a, i]);
|
|
11
|
+
return /* @__PURE__ */ s.jsxs(j.Provider, { value: c, children: [
|
|
12
|
+
/* @__PURE__ */ s.jsx(N, {}),
|
|
13
|
+
r
|
|
14
|
+
] });
|
|
15
|
+
}, O = ({ axiosInstance: r, LinkComponent: n, language: t, axiosTexts: e, confirmTexts: o, formValidationTexts: a, employeePickerModalTexts: i, children: c }) => {
|
|
16
|
+
const d = x(() => ({
|
|
17
|
+
axiosInstance: r,
|
|
18
|
+
LinkComponent: n,
|
|
19
|
+
language: t,
|
|
20
|
+
axiosTexts: e,
|
|
21
|
+
confirmTexts: o,
|
|
22
|
+
formValidationTexts: a,
|
|
23
|
+
employeePickerModalTexts: i
|
|
24
|
+
}), [
|
|
25
|
+
r,
|
|
26
|
+
n,
|
|
27
|
+
t,
|
|
28
|
+
e,
|
|
29
|
+
o,
|
|
30
|
+
a,
|
|
31
|
+
i
|
|
32
|
+
]);
|
|
33
|
+
return /* @__PURE__ */ s.jsx(g.Provider, { value: d, children: /* @__PURE__ */ s.jsxs(I, { children: [
|
|
34
|
+
/* @__PURE__ */ s.jsx(v, {}),
|
|
35
|
+
c
|
|
36
|
+
] }) });
|
|
37
|
+
}, k = ({ children: r }) => {
|
|
38
|
+
const [n, t] = m(!1), [e] = m(/* @__PURE__ */ new Set()), o = u((c) => {
|
|
39
|
+
e.add(c), t(!0);
|
|
40
|
+
}, [e]), a = u((c) => {
|
|
41
|
+
e.delete(c), e.size === 0 && t(!1);
|
|
42
|
+
}, [e]), i = x(() => ({ isLoading: n, startLoading: o, stopLoading: a }), [n, o, a]);
|
|
43
|
+
return /* @__PURE__ */ s.jsxs(p.Provider, { value: i, children: [
|
|
44
|
+
n && /* @__PURE__ */ s.jsx(S, {}),
|
|
45
|
+
r
|
|
46
|
+
] });
|
|
47
|
+
}, A = ({ children: r }) => {
|
|
48
|
+
const n = b(), t = u(() => {
|
|
49
|
+
const l = localStorage.getItem("user") ?? null;
|
|
50
|
+
return l ? JSON.parse(l) : null;
|
|
51
|
+
}, []), [e, o] = m(t()), a = u(async () => {
|
|
52
|
+
let l = null;
|
|
53
|
+
return await n.get("/user/detail").then((C) => {
|
|
54
|
+
l = C.data;
|
|
55
|
+
}).catch(() => {
|
|
56
|
+
l = null;
|
|
57
|
+
}), localStorage.setItem("user", JSON.stringify(l)), l;
|
|
58
|
+
}, [n]), i = u(() => {
|
|
59
|
+
localStorage.removeItem("user");
|
|
60
|
+
}, []), c = u(async () => {
|
|
61
|
+
const l = await a();
|
|
62
|
+
return l ? (o(l), !0) : !1;
|
|
63
|
+
}, [a]), d = u(() => {
|
|
64
|
+
i(), o(null);
|
|
65
|
+
}, [i]), h = x(() => ({ user: e, loginUser: c, logoutUser: d }), [e, c, d]);
|
|
66
|
+
return y(() => {
|
|
67
|
+
o(t());
|
|
68
|
+
}, [t]), /* @__PURE__ */ s.jsx(w.Provider, { value: h, children: r });
|
|
69
|
+
}, N = () => {
|
|
70
|
+
const { confirmTexts: r } = L(g), { onConfirm: n, onCancel: t, text: e, show: o } = P();
|
|
71
|
+
return /* @__PURE__ */ s.jsx(f, { show: o, size: "sm", centered: !0, onHide: t, children: /* @__PURE__ */ s.jsxs(f.Body, { children: [
|
|
72
|
+
/* @__PURE__ */ s.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ s.jsx(U, { variant: "h6", children: e }) }),
|
|
73
|
+
/* @__PURE__ */ s.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
74
|
+
/* @__PURE__ */ s.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: t, children: r.no }),
|
|
75
|
+
/* @__PURE__ */ s.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: n, children: r.yes })
|
|
76
|
+
] })
|
|
77
|
+
] }) });
|
|
78
|
+
};
|
|
79
|
+
export {
|
|
80
|
+
p as LoadingContext,
|
|
81
|
+
k as LoadingProvider,
|
|
82
|
+
g as LuminusComponentsContext,
|
|
83
|
+
O as LuminusComponentsProvider,
|
|
84
|
+
w as UserContext,
|
|
85
|
+
A as UserProvider
|
|
86
|
+
};
|