@owp/core 2.4.0 → 2.4.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/_virtual/index10.js +2 -2
- package/dist/_virtual/index12.js +2 -2
- package/dist/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index17.js +5 -2
- package/dist/_virtual/index17.js.map +1 -1
- package/dist/_virtual/index18.js +4 -4
- package/dist/_virtual/index19.js +4 -4
- package/dist/_virtual/index20.js +2 -5
- package/dist/_virtual/index20.js.map +1 -1
- package/dist/_virtual/index5.js +2 -2
- package/dist/components/OwpCommonCode/OwpCommonCodeRadioGroup.js +38 -38
- package/dist/components/OwpCommonCode/OwpCommonCodeRadioGroup.js.map +1 -1
- package/dist/components/OwpFieldHelperText/OwpFieldHelperText.js +34 -0
- package/dist/components/OwpFieldHelperText/OwpFieldHelperText.js.map +1 -0
- package/dist/components/OwpRequiredHelperText/OwpRequiredHelperText.js +38 -0
- package/dist/components/OwpRequiredHelperText/OwpRequiredHelperText.js.map +1 -0
- package/dist/components/OwpTable/OwpFieldTable.js +99 -0
- package/dist/components/OwpTable/OwpFieldTable.js.map +1 -0
- package/dist/components/OwpTextField/OwpTextMaskField.js +138 -87
- package/dist/components/OwpTextField/OwpTextMaskField.js.map +1 -1
- package/dist/hooks/useCurrentUserSeq.js +20 -6
- package/dist/hooks/useCurrentUserSeq.js.map +1 -1
- package/dist/hooks.js +50 -49
- package/dist/index.js +74 -70
- package/dist/index.js.map +1 -1
- package/dist/layout/components/toggles/NavigationSearchToggle.js +3 -3
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/constants.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
- package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js +1 -1
- package/dist/owp-app.css +1 -1
- package/dist/types/components/OwpFieldHelperText/OwpFieldHelperText.d.ts +14 -0
- package/dist/types/components/OwpFieldHelperText/index.d.ts +2 -0
- package/dist/types/components/OwpRequiredHelperText/OwpRequiredHelperText.d.ts +18 -0
- package/dist/types/components/OwpRequiredHelperText/index.d.ts +2 -0
- package/dist/types/components/OwpTable/{OwpVerticalTable.d.ts → OwpFieldTable.d.ts} +9 -8
- package/dist/types/components/OwpTable/index.d.ts +1 -1
- package/dist/types/components/OwpTextField/OwpTextMaskField.d.ts +5 -3
- package/dist/types/hooks/useCurrentUserSeq.d.ts +11 -2
- package/dist/types/index.d.ts +3 -1
- package/package.json +2 -2
- package/dist/components/OwpTable/OwpVerticalTable.js +0 -96
- package/dist/components/OwpTable/OwpVerticalTable.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +0 -39
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-contenteditable-mask-element.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-input-mask-element.js +0 -36
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-input-mask-element.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-mask-element.js +0 -52
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/html-mask-element.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/input-history.js +0 -35
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/input-history.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/input.js +0 -227
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/input.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/mask-element.js +0 -48
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/controls/mask-element.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/action-details.js +0 -56
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/action-details.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/change-details.js +0 -41
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/change-details.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/continuous-tail-details.js +0 -47
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/continuous-tail-details.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/holder.js +0 -10
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/holder.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/utils.js +0 -76
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/core/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/index.js +0 -51
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/index.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/base.js +0 -257
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/base.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/date.js +0 -121
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/date.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/dynamic.js +0 -227
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/dynamic.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/enum.js +0 -74
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/enum.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/factory.js +0 -52
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/factory.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/function.js +0 -28
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/function.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/number.js +0 -217
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/number.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +0 -108
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/chunk-tail-details.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/cursor.js +0 -105
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/cursor.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/fixed-definition.js +0 -107
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/fixed-definition.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/input-definition.js +0 -138
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern/input-definition.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern.js +0 -327
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pipe.js +0 -28
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/pipe.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/range.js +0 -83
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/range.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/regexp.js +0 -26
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/regexp.js.map +0 -1
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/repeat.js +0 -109
- package/dist/node_modules/.pnpm/imask@7.6.1/node_modules/imask/esm/masked/repeat.js.map +0 -1
- package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/input.js +0 -28
- package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/input.js.map +0 -1
- package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js +0 -136
- package/dist/node_modules/.pnpm/react-imask@7.6.1_react@19.2.4/node_modules/react-imask/esm/mixin.js.map +0 -1
|
@@ -1,106 +1,157 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { FormHelperText as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { useId as
|
|
9
|
-
import "
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
var z = Object.defineProperty;
|
|
2
|
+
var i = (e, r) => z(e, "name", { value: r, configurable: !0 });
|
|
3
|
+
import { jsxs as E, jsx as M } from "../../node_modules/.pnpm/@emotion_react@11.14.0_@types_react@19.2.14_react@19.2.4/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js";
|
|
4
|
+
import { FormHelperText as j } from "@mui/material";
|
|
5
|
+
import y from "@mui/material/FormControl";
|
|
6
|
+
import b from "@mui/material/Input";
|
|
7
|
+
import A from "@mui/material/InputLabel";
|
|
8
|
+
import { useId as H, forwardRef as L, useRef as s, useEffect as p } from "react";
|
|
9
|
+
import { InputMask as P } from "imask";
|
|
10
|
+
function $(e, r) {
|
|
11
|
+
if (typeof e == "function") {
|
|
12
|
+
e(r);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
e && (e.current = r);
|
|
16
|
+
}
|
|
17
|
+
i($, "assignInputRef");
|
|
18
|
+
function T({
|
|
19
|
+
mask: e,
|
|
20
|
+
definitions: r
|
|
21
|
+
}) {
|
|
22
|
+
return {
|
|
23
|
+
mask: e,
|
|
24
|
+
definitions: r,
|
|
25
|
+
overwrite: !0
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
i(T, "buildTextMaskOptions");
|
|
29
|
+
const q = L(/* @__PURE__ */ i(function(r, h) {
|
|
30
|
+
const {
|
|
31
|
+
onMaskChange: c,
|
|
32
|
+
mask: a,
|
|
33
|
+
definitions: l,
|
|
34
|
+
name: f,
|
|
35
|
+
value: o,
|
|
36
|
+
defaultValue: d,
|
|
37
|
+
ownerState: O,
|
|
38
|
+
as: C,
|
|
39
|
+
onChange: R,
|
|
40
|
+
...V
|
|
41
|
+
} = r, k = s(null), u = s(null), g = s(c), v = s(f), x = s(T({ mask: a, definitions: l })), m = s(o !== void 0 ? o : d);
|
|
42
|
+
p(() => {
|
|
43
|
+
g.current = c;
|
|
44
|
+
}, [c]), p(() => {
|
|
45
|
+
v.current = f;
|
|
46
|
+
}, [f]), p(() => {
|
|
47
|
+
const n = k.current;
|
|
48
|
+
if (!n)
|
|
49
|
+
return;
|
|
50
|
+
const t = new P(
|
|
51
|
+
n,
|
|
52
|
+
x.current
|
|
53
|
+
), S = /* @__PURE__ */ i(() => {
|
|
54
|
+
g.current({
|
|
55
|
+
target: {
|
|
56
|
+
name: v.current ?? n.name ?? "",
|
|
57
|
+
value: t.value
|
|
58
|
+
},
|
|
59
|
+
unmaskedValue: t.unmaskedValue
|
|
60
|
+
});
|
|
61
|
+
}, "emitMaskChange");
|
|
62
|
+
if (t.on("accept", S), u.current = t, m.current !== void 0) {
|
|
63
|
+
const F = m.current == null ? "" : String(m.current);
|
|
64
|
+
t.value !== F && (t.value = F);
|
|
65
|
+
}
|
|
66
|
+
return () => {
|
|
67
|
+
t.off("accept", S), t.destroy(), u.current === t && (u.current = null);
|
|
68
|
+
};
|
|
69
|
+
}, []), p(() => {
|
|
70
|
+
const n = u.current;
|
|
71
|
+
n && n.updateOptions(T({ mask: a, definitions: l }));
|
|
72
|
+
}, [a, l]), p(() => {
|
|
73
|
+
const n = u.current;
|
|
74
|
+
if (!n || o === void 0)
|
|
75
|
+
return;
|
|
76
|
+
const t = o == null ? "" : String(o);
|
|
77
|
+
n.value !== t && (n.value = t);
|
|
78
|
+
}, [o]);
|
|
79
|
+
const I = o !== void 0 ? o : d, w = I == null ? "" : String(I);
|
|
80
|
+
return /* @__PURE__ */ M(
|
|
81
|
+
"input",
|
|
23
82
|
{
|
|
24
|
-
...
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
target: {
|
|
31
|
-
name: s ?? "",
|
|
32
|
-
value: String(d ?? "")
|
|
33
|
-
},
|
|
34
|
-
unmaskedValue: f.unmaskedValue
|
|
35
|
-
});
|
|
36
|
-
}, "onAccept"),
|
|
37
|
-
overwrite: !0
|
|
83
|
+
...V,
|
|
84
|
+
defaultValue: w,
|
|
85
|
+
onChange: R,
|
|
86
|
+
ref: /* @__PURE__ */ i((n) => {
|
|
87
|
+
k.current = n, $(h, n);
|
|
88
|
+
}, "ref")
|
|
38
89
|
}
|
|
39
90
|
);
|
|
40
91
|
}, "TextMaskCustom2"));
|
|
41
|
-
function
|
|
42
|
-
className:
|
|
43
|
-
sx:
|
|
44
|
-
id:
|
|
45
|
-
name:
|
|
46
|
-
label:
|
|
47
|
-
value:
|
|
48
|
-
defaultValue:
|
|
49
|
-
color:
|
|
50
|
-
onChange:
|
|
51
|
-
error:
|
|
52
|
-
helperText:
|
|
53
|
-
mask:
|
|
54
|
-
definitions:
|
|
55
|
-
variant:
|
|
56
|
-
fullWidth:
|
|
57
|
-
disabled:
|
|
58
|
-
required:
|
|
59
|
-
placeholder:
|
|
60
|
-
autoFocus:
|
|
61
|
-
inputProps:
|
|
62
|
-
inputRef:
|
|
92
|
+
function W({
|
|
93
|
+
className: e,
|
|
94
|
+
sx: r,
|
|
95
|
+
id: h,
|
|
96
|
+
name: c,
|
|
97
|
+
label: a,
|
|
98
|
+
value: l,
|
|
99
|
+
defaultValue: f,
|
|
100
|
+
color: o,
|
|
101
|
+
onChange: d,
|
|
102
|
+
error: O,
|
|
103
|
+
helperText: C,
|
|
104
|
+
mask: R,
|
|
105
|
+
definitions: V,
|
|
106
|
+
variant: k,
|
|
107
|
+
fullWidth: u,
|
|
108
|
+
disabled: g,
|
|
109
|
+
required: v,
|
|
110
|
+
placeholder: x,
|
|
111
|
+
autoFocus: m,
|
|
112
|
+
inputProps: I,
|
|
113
|
+
inputRef: w
|
|
63
114
|
}) {
|
|
64
|
-
const
|
|
65
|
-
return /* @__PURE__ */
|
|
66
|
-
|
|
115
|
+
const n = H(), t = h ?? `text-mask-input-${n}`;
|
|
116
|
+
return /* @__PURE__ */ E(
|
|
117
|
+
y,
|
|
67
118
|
{
|
|
68
|
-
color:
|
|
69
|
-
variant:
|
|
70
|
-
fullWidth:
|
|
71
|
-
error:
|
|
72
|
-
disabled:
|
|
73
|
-
required:
|
|
119
|
+
color: o,
|
|
120
|
+
variant: k,
|
|
121
|
+
fullWidth: u,
|
|
122
|
+
error: O,
|
|
123
|
+
disabled: g,
|
|
124
|
+
required: v,
|
|
74
125
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
/* @__PURE__ */
|
|
77
|
-
|
|
126
|
+
a ? /* @__PURE__ */ M(A, { htmlFor: t, children: a }) : null,
|
|
127
|
+
/* @__PURE__ */ M(
|
|
128
|
+
b,
|
|
78
129
|
{
|
|
79
|
-
className:
|
|
80
|
-
sx:
|
|
81
|
-
value:
|
|
82
|
-
defaultValue:
|
|
83
|
-
name:
|
|
84
|
-
id:
|
|
85
|
-
placeholder:
|
|
86
|
-
autoFocus:
|
|
87
|
-
inputRef:
|
|
88
|
-
inputComponent:
|
|
130
|
+
className: e,
|
|
131
|
+
sx: r,
|
|
132
|
+
value: l,
|
|
133
|
+
defaultValue: f,
|
|
134
|
+
name: c,
|
|
135
|
+
id: t,
|
|
136
|
+
placeholder: x,
|
|
137
|
+
autoFocus: m,
|
|
138
|
+
inputRef: w,
|
|
139
|
+
inputComponent: q,
|
|
89
140
|
inputProps: {
|
|
90
|
-
...
|
|
91
|
-
onMaskChange:
|
|
92
|
-
mask:
|
|
93
|
-
definitions:
|
|
141
|
+
...I,
|
|
142
|
+
onMaskChange: d,
|
|
143
|
+
mask: R,
|
|
144
|
+
definitions: V
|
|
94
145
|
}
|
|
95
146
|
}
|
|
96
147
|
),
|
|
97
|
-
/* @__PURE__ */
|
|
148
|
+
C ? /* @__PURE__ */ M(j, { children: C }) : null
|
|
98
149
|
]
|
|
99
150
|
}
|
|
100
151
|
);
|
|
101
152
|
}
|
|
102
|
-
|
|
153
|
+
i(W, "OwpTextMaskField");
|
|
103
154
|
export {
|
|
104
|
-
|
|
155
|
+
W as OwpTextMaskField
|
|
105
156
|
};
|
|
106
157
|
//# sourceMappingURL=OwpTextMaskField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpTextMaskField.js","sources":["../../../src/components/OwpTextField/OwpTextMaskField.tsx"],"sourcesContent":["import { FormHelperText } from '@mui/material';\nimport FormControl from '@mui/material/FormControl';\nimport type { FormControlProps } from '@mui/material/FormControl';\nimport Input from '@mui/material/Input';\nimport type { InputProps as MuiInputProps } from '@mui/material/Input';\nimport type { InputBaseComponentProps } from '@mui/material/InputBase';\nimport InputLabel from '@mui/material/InputLabel';\nimport { forwardRef, type ReactNode, useId } from 'react';\nimport { IMaskInput } from 'react-imask';\n\ntype TextMaskFieldChangeEvent = {\n target: { name: string; value: string };\n unmaskedValue: string;\n};\n\ninterface CustomProps {\n onMaskChange: (event: TextMaskFieldChangeEvent) => void;\n name?: string;\n mask: string;\n definitions?: Record<string, unknown>;\n}\n\ntype OwpTextMaskFieldProps = Omit<MuiInputProps, 'onChange' | 'inputComponent'> &\n Omit<CustomProps, 'onMaskChange'> & {\n label?: ReactNode;\n helperText?: ReactNode;\n variant?: FormControlProps['variant'];\n onChange: CustomProps['onMaskChange'];\n };\n\n/** 마스크 입력 어댑터 */\ntype TextMaskCustomProps = InputBaseComponentProps & CustomProps;\n\nconst TextMaskCustom = forwardRef<HTMLInputElement, TextMaskCustomProps>(function TextMaskCustom(\n props,\n ref,\n) {\n const { onMaskChange, mask, definitions, name, ...other } = props;\n const { onChange: ignoredOnChange, ...imaskInputProps } = other;\n\n void ignoredOnChange;\n\n return (\n <IMaskInput\n {...imaskInputProps}\n mask={mask}\n definitions={definitions}\n inputRef={ref}\n onAccept={(value, maskRef) => {\n onMaskChange({\n target: {\n name: name ?? '',\n value: String(value ?? ''),\n },\n unmaskedValue: maskRef.unmaskedValue,\n });\n }}\n overwrite\n />\n );\n});\n\n/**\n * 마스크 텍스트 입력 필드\n * @param mask 입력 마스크 문자열\n * @param definitions 사용자 정의 마스크 정의\n * @param onChange 마스크 변경 이벤트 핸들러\n */\nexport function OwpTextMaskField({\n className,\n sx,\n id: idProp,\n name,\n label,\n value,\n defaultValue,\n color,\n onChange,\n error,\n helperText,\n mask,\n definitions,\n variant,\n fullWidth,\n disabled,\n required,\n placeholder,\n autoFocus,\n inputProps,\n inputRef,\n}: OwpTextMaskFieldProps) {\n const generatedId = useId();\n const id = idProp ?? `text-mask-input-${generatedId}`;\n\n return (\n <FormControl\n color={color}\n variant={variant}\n fullWidth={fullWidth}\n error={error}\n disabled={disabled}\n required={required}\n >\n <InputLabel htmlFor={id}>{label}</InputLabel>\n <Input\n className={className}\n sx={sx}\n value={value}\n defaultValue={defaultValue}\n name={name}\n id={id}\n placeholder={placeholder}\n autoFocus={autoFocus}\n inputRef={inputRef}\n inputComponent={TextMaskCustom}\n inputProps={{\n ...inputProps,\n onMaskChange: onChange,\n mask,\n definitions,\n }}\n />\n <FormHelperText>{helperText}</FormHelperText>\n </FormControl>\n );\n}\n"],"names":["TextMaskCustom","forwardRef","__name","props","ref","onMaskChange","mask","definitions","name","other","ignoredOnChange","imaskInputProps","jsx","IMaskInput","value","maskRef","OwpTextMaskField","className","sx","idProp","label","defaultValue","color","onChange","error","helperText","variant","fullWidth","disabled","required","placeholder","autoFocus","inputProps","inputRef","generatedId","useId","id","jsxs","FormControl","InputLabel","Input","FormHelperText"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,MAAMA,IAAiBC,EAAkD,gBAAAC,EAAA,SACvEC,GACAC,GACA;AACA,QAAM,EAAE,cAAAC,GAAc,MAAAC,GAAM,aAAAC,GAAa,MAAAC,GAAM,GAAGC,MAAUN,GACtD,EAAE,UAAUO,GAAiB,GAAGC,MAAoBF;AAI1D,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,MAAAL;AAAA,MACA,aAAAC;AAAA,MACA,UAAUH;AAAA,MACV,UAAU,gBAAAF,EAAA,CAACY,GAAOC,MAAY;AAC5B,QAAAV,EAAa;AAAA,UACX,QAAQ;AAAA,YACN,MAAMG,KAAQ;AAAA,YACd,OAAO,OAAOM,KAAS,EAAE;AAAA,UAAA;AAAA,UAE3B,eAAeC,EAAQ;AAAA,QAAA,CACxB;AAAA,MACH,GARU;AAAA,MASV,WAAS;AAAA,IAAA;AAAA,EAAA;AAGf,GA3ByE,kBA2BxE;AAQM,SAASC,EAAiB;AAAA,EAC/B,WAAAC;AAAA,EACA,IAAAC;AAAA,EACA,IAAIC;AAAA,EACJ,MAAAX;AAAA,EACA,OAAAY;AAAA,EACA,OAAAN;AAAA,EACA,cAAAO;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,MAAAnB;AAAA,EACA,aAAAC;AAAA,EACA,SAAAmB;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,aAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AACF,GAA0B;AACxB,QAAMC,IAAcC,EAAA,GACdC,IAAKjB,KAAU,mBAAmBe,CAAW;AAEnD,SACE,gBAAAG;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAAhB;AAAA,MACA,SAAAI;AAAA,MACA,WAAAC;AAAA,MACA,OAAAH;AAAA,MACA,UAAAI;AAAA,MACA,UAAAC;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAjB,EAAC2B,GAAA,EAAW,SAASH,GAAK,UAAAhB,GAAM;AAAA,QAChC,gBAAAR;AAAA,UAAC4B;AAAA,UAAA;AAAA,YACC,WAAAvB;AAAA,YACA,IAAAC;AAAA,YACA,OAAAJ;AAAA,YACA,cAAAO;AAAA,YACA,MAAAb;AAAA,YACA,IAAA4B;AAAA,YACA,aAAAN;AAAA,YACA,WAAAC;AAAA,YACA,UAAAE;AAAA,YACA,gBAAgBjC;AAAA,YAChB,YAAY;AAAA,cACV,GAAGgC;AAAA,cACH,cAAcT;AAAA,cACd,MAAAjB;AAAA,cACA,aAAAC;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,QAEF,gBAAAK,EAAC6B,KAAgB,UAAAhB,EAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGlC;AAzDgBvB,EAAAc,GAAA;"}
|
|
1
|
+
{"version":3,"file":"OwpTextMaskField.js","sources":["../../../src/components/OwpTextField/OwpTextMaskField.tsx"],"sourcesContent":["import { FormHelperText } from '@mui/material';\nimport FormControl from '@mui/material/FormControl';\nimport type { FormControlProps } from '@mui/material/FormControl';\nimport Input from '@mui/material/Input';\nimport type { InputProps as MuiInputProps } from '@mui/material/Input';\nimport type { InputBaseComponentProps } from '@mui/material/InputBase';\nimport InputLabel from '@mui/material/InputLabel';\nimport {\n forwardRef,\n type ForwardedRef,\n type ReactNode,\n useEffect,\n useId,\n useRef,\n} from 'react';\nimport { InputMask as IMaskInput, type Definitions, type FactoryOpts } from 'imask';\n\ntype TextMaskFieldChangeEvent = {\n target: { name: string; value: string };\n unmaskedValue: string;\n};\n\ntype TextMaskValue = FactoryOpts['mask'];\n\ninterface CustomProps {\n onMaskChange: (event: TextMaskFieldChangeEvent) => void;\n name?: string;\n mask: TextMaskValue;\n definitions?: Definitions;\n}\n\ntype OwpTextMaskFieldProps = Omit<MuiInputProps, 'onChange' | 'inputComponent'> &\n Omit<CustomProps, 'onMaskChange'> & {\n label?: ReactNode;\n helperText?: ReactNode;\n variant?: FormControlProps['variant'];\n onChange: CustomProps['onMaskChange'];\n };\n\n/** 마스크 입력 어댑터 */\ntype TextMaskCustomProps = InputBaseComponentProps & CustomProps;\n\ntype TextMaskOptions = FactoryOpts & {\n definitions?: Definitions;\n overwrite: true;\n};\n\n/** ref 전달 정규화 */\nfunction assignInputRef<T>(ref: ForwardedRef<T>, value: T | null) {\n if (typeof ref === 'function') {\n ref(value);\n return;\n }\n\n if (ref) {\n ref.current = value;\n }\n}\n\n/** 마스크 옵션 생성 */\nfunction buildTextMaskOptions({\n mask,\n definitions,\n}: Pick<CustomProps, 'mask' | 'definitions'>): TextMaskOptions {\n return {\n mask,\n definitions,\n overwrite: true,\n } as TextMaskOptions;\n}\n\nconst TextMaskCustom = forwardRef<HTMLInputElement, TextMaskCustomProps>(function TextMaskCustom(\n props,\n ref,\n) {\n const {\n onMaskChange,\n mask,\n definitions,\n name,\n value,\n defaultValue,\n ownerState: ignoredOwnerState,\n as: ignoredAs,\n onChange,\n ...other\n } = props;\n const inputElementRef = useRef<HTMLInputElement | null>(null);\n const maskRef = useRef<IMaskInput<FactoryOpts> | null>(null);\n const onMaskChangeRef = useRef(onMaskChange);\n const nameRef = useRef(name);\n const initialMaskOptionsRef = useRef(buildTextMaskOptions({ mask, definitions }));\n const initialValueRef = useRef(value !== undefined ? value : defaultValue);\n\n void ignoredOwnerState;\n void ignoredAs;\n\n useEffect(() => {\n onMaskChangeRef.current = onMaskChange;\n }, [onMaskChange]);\n\n useEffect(() => {\n nameRef.current = name;\n }, [name]);\n\n useEffect(() => {\n const inputElement = inputElementRef.current;\n\n if (!inputElement) {\n return;\n }\n\n const maskInstance = new IMaskInput(\n inputElement,\n initialMaskOptionsRef.current as FactoryOpts,\n );\n const emitMaskChange = () => {\n onMaskChangeRef.current({\n target: {\n name: nameRef.current ?? inputElement.name ?? '',\n value: maskInstance.value,\n },\n unmaskedValue: maskInstance.unmaskedValue,\n });\n };\n\n maskInstance.on('accept', emitMaskChange);\n maskRef.current = maskInstance;\n\n if (initialValueRef.current !== undefined) {\n const normalizedInitialValue =\n initialValueRef.current == null ? '' : String(initialValueRef.current);\n\n if (maskInstance.value !== normalizedInitialValue) {\n maskInstance.value = normalizedInitialValue;\n }\n }\n\n return () => {\n maskInstance.off('accept', emitMaskChange);\n maskInstance.destroy();\n\n if (maskRef.current === maskInstance) {\n maskRef.current = null;\n }\n };\n }, []);\n\n useEffect(() => {\n const maskInstance = maskRef.current;\n\n if (!maskInstance) {\n return;\n }\n\n maskInstance.updateOptions(buildTextMaskOptions({ mask, definitions }) as FactoryOpts);\n }, [mask, definitions]);\n\n useEffect(() => {\n const maskInstance = maskRef.current;\n\n if (!maskInstance || value === undefined) {\n return;\n }\n\n const normalizedValue = value == null ? '' : String(value);\n\n if (maskInstance.value !== normalizedValue) {\n maskInstance.value = normalizedValue;\n }\n }, [value]);\n\n const initialValue = value !== undefined ? value : defaultValue;\n const normalizedInitialValue = initialValue == null ? '' : String(initialValue);\n\n return (\n <input\n {...other}\n defaultValue={normalizedInitialValue}\n onChange={onChange}\n ref={(element) => {\n inputElementRef.current = element;\n assignInputRef(ref, element);\n }}\n />\n );\n});\n\n/**\n * 마스크 텍스트 입력 필드\n * @param mask 입력 마스크 정의\n * @param definitions 사용자 정의 마스크 정의\n * @param onChange 마스크 변경 이벤트 핸들러\n */\nexport function OwpTextMaskField({\n className,\n sx,\n id: idProp,\n name,\n label,\n value,\n defaultValue,\n color,\n onChange,\n error,\n helperText,\n mask,\n definitions,\n variant,\n fullWidth,\n disabled,\n required,\n placeholder,\n autoFocus,\n inputProps,\n inputRef,\n}: OwpTextMaskFieldProps) {\n const generatedId = useId();\n const id = idProp ?? `text-mask-input-${generatedId}`;\n\n return (\n <FormControl\n color={color}\n variant={variant}\n fullWidth={fullWidth}\n error={error}\n disabled={disabled}\n required={required}\n >\n {label ? <InputLabel htmlFor={id}>{label}</InputLabel> : null}\n <Input\n className={className}\n sx={sx}\n value={value}\n defaultValue={defaultValue}\n name={name}\n id={id}\n placeholder={placeholder}\n autoFocus={autoFocus}\n inputRef={inputRef}\n inputComponent={TextMaskCustom}\n inputProps={{\n ...inputProps,\n onMaskChange: onChange,\n mask,\n definitions,\n }}\n />\n {helperText ? <FormHelperText>{helperText}</FormHelperText> : null}\n </FormControl>\n );\n}\n"],"names":["assignInputRef","ref","value","__name","buildTextMaskOptions","mask","definitions","TextMaskCustom","forwardRef","props","onMaskChange","name","defaultValue","ignoredOwnerState","ignoredAs","onChange","other","inputElementRef","useRef","maskRef","onMaskChangeRef","nameRef","initialMaskOptionsRef","initialValueRef","useEffect","inputElement","maskInstance","IMaskInput","emitMaskChange","normalizedInitialValue","normalizedValue","initialValue","jsx","element","OwpTextMaskField","className","sx","idProp","label","color","error","helperText","variant","fullWidth","disabled","required","placeholder","autoFocus","inputProps","inputRef","generatedId","useId","id","jsxs","FormControl","InputLabel","Input","FormHelperText"],"mappings":"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"}
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
var s = Object.defineProperty;
|
|
2
|
-
var e = (t,
|
|
2
|
+
var e = (t, r) => s(t, "name", { value: r, configurable: !0 });
|
|
3
3
|
import { STORAGE_KEYS as u } from "../constants/storageKeys.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
4
|
+
import { useOwpTranslation as S } from "./useOwpTranslation.js";
|
|
5
|
+
import { useAtomValue as m, useSetAtom as a } from "jotai";
|
|
6
|
+
import { atomWithStorage as c } from "jotai/utils";
|
|
7
|
+
import { enqueueSnackbar as i } from "notistack";
|
|
8
|
+
const A = "Message.로그인 사용자 정보가 없습니다.", n = c(u.currentUserSeq, ""), p = /* @__PURE__ */ e(() => m(n), "useGetCurrentUserSeq"), _ = /* @__PURE__ */ e(() => a(n), "useSetCurrentUserSeq"), g = /* @__PURE__ */ e(({
|
|
9
|
+
snackbarMessageKey: t = A
|
|
10
|
+
} = {}) => {
|
|
11
|
+
const r = p(), { t: o } = S();
|
|
12
|
+
return () => {
|
|
13
|
+
if (r == null || r === "") {
|
|
14
|
+
i(o(t), { variant: "warning" });
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
return r;
|
|
18
|
+
};
|
|
19
|
+
}, "useEnsureCurrentUserSeq");
|
|
7
20
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
21
|
+
g as useEnsureCurrentUserSeq,
|
|
22
|
+
p as useGetCurrentUserSeq,
|
|
23
|
+
_ as useSetCurrentUserSeq
|
|
10
24
|
};
|
|
11
25
|
//# sourceMappingURL=useCurrentUserSeq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentUserSeq.js","sources":["../../src/hooks/useCurrentUserSeq.ts"],"sourcesContent":["import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\n\
|
|
1
|
+
{"version":3,"file":"useCurrentUserSeq.js","sources":["../../src/hooks/useCurrentUserSeq.ts"],"sourcesContent":["import { STORAGE_KEYS } from '@/constants/storageKeys';\nimport { useOwpTranslation } from '@/hooks/useOwpTranslation';\nimport { useAtomValue, useSetAtom } from 'jotai';\nimport { atomWithStorage } from 'jotai/utils';\nimport { enqueueSnackbar } from 'notistack';\n\nexport type CurrentUserSeq = string | number;\n\nexport interface UseEnsureCurrentUserSeqOptions {\n snackbarMessageKey?: string;\n}\n\nconst DEFAULT_SNACKBAR_MESSAGE_KEY = 'Message.로그인 사용자 정보가 없습니다.';\n\nconst currentUserSeqAtom = atomWithStorage<CurrentUserSeq | ''>(STORAGE_KEYS.currentUserSeq, '');\n\n/**\n * 현재 사용자 USERSEQ 조회 훅\n */\nexport const useGetCurrentUserSeq = () => {\n return useAtomValue(currentUserSeqAtom);\n};\n\n/**\n * 현재 사용자 USERSEQ 설정 훅\n */\nexport const useSetCurrentUserSeq = () => {\n return useSetAtom(currentUserSeqAtom);\n};\n\n/**\n * 현재 사용자 USERSEQ 필수 검증 훅\n * @param snackbarMessageKey 사용자 정보 부재 안내 메시지 키\n */\nexport const useEnsureCurrentUserSeq = ({\n snackbarMessageKey = DEFAULT_SNACKBAR_MESSAGE_KEY,\n}: UseEnsureCurrentUserSeqOptions = {}) => {\n const currentUserSeq = useGetCurrentUserSeq();\n const { t } = useOwpTranslation();\n\n return () => {\n if (currentUserSeq == null || currentUserSeq === '') {\n enqueueSnackbar(t(snackbarMessageKey), { variant: 'warning' });\n return undefined;\n }\n\n return currentUserSeq;\n };\n};\n"],"names":["DEFAULT_SNACKBAR_MESSAGE_KEY","currentUserSeqAtom","atomWithStorage","STORAGE_KEYS","useGetCurrentUserSeq","__name","useAtomValue","useSetCurrentUserSeq","useSetAtom","useEnsureCurrentUserSeq","snackbarMessageKey","currentUserSeq","t","useOwpTranslation","enqueueSnackbar"],"mappings":";;;;;;;AAYA,MAAMA,IAA+B,6BAE/BC,IAAqBC,EAAqCC,EAAa,gBAAgB,EAAE,GAKlFC,IAAuB,gBAAAC,EAAA,MAC3BC,EAAaL,CAAkB,GADJ,yBAOvBM,IAAuB,gBAAAF,EAAA,MAC3BG,EAAWP,CAAkB,GADF,yBAQvBQ,IAA0B,gBAAAJ,EAAA,CAAC;AAAA,EACtC,oBAAAK,IAAqBV;AACvB,IAAoC,OAAO;AACzC,QAAMW,IAAiBP,EAAA,GACjB,EAAE,GAAAQ,EAAA,IAAMC,EAAA;AAEd,SAAO,MAAM;AACX,QAAIF,KAAkB,QAAQA,MAAmB,IAAI;AACnD,MAAAG,EAAgBF,EAAEF,CAAkB,GAAG,EAAE,SAAS,WAAW;AAC7D;AAAA,IACF;AAEA,WAAOC;AAAA,EACT;AACF,GAduC;"}
|
package/dist/hooks.js
CHANGED
|
@@ -2,83 +2,84 @@ import { useGetCommonCodeList as t, useSetCommonCodeList as o } from "./hooks/us
|
|
|
2
2
|
import { useAccessTokenGuard as u } from "./hooks/useAccessTokenGuard.js";
|
|
3
3
|
import { useConfirm as n } from "./hooks/useConfirm.js";
|
|
4
4
|
import { useGetCurrentLanguage as a, useGetLanguageList as f, useSetCurrentLanguage as i } from "./hooks/useCurrentLanguage.js";
|
|
5
|
-
import { useGetLogoSrc as C, useSetLogoSrc as
|
|
5
|
+
import { useGetLogoSrc as C, useSetLogoSrc as S } from "./hooks/useLogoSrc.js";
|
|
6
6
|
import { useGetCurrentUser as g, useSetCurrentUser as L } from "./hooks/useCurrentUser.js";
|
|
7
7
|
import { useGetCurrentUserId as d, useSetCurrentUserId as T } from "./hooks/useCurrentUserId.js";
|
|
8
|
-
import { useGetCurrentUserSeq as
|
|
8
|
+
import { useEnsureCurrentUserSeq as h, useGetCurrentUserSeq as l, useSetCurrentUserSeq as v } from "./hooks/useCurrentUserSeq.js";
|
|
9
9
|
import { useDebounce as b } from "./hooks/useDebounce.js";
|
|
10
|
-
import { useDeepCompareEffect as N, useDeepCompareEffectNoCheck as
|
|
11
|
-
import { useHeaderWrapState as
|
|
10
|
+
import { useDeepCompareEffect as N, useDeepCompareEffectNoCheck as D, useDeepCompareMemoize as I } from "./hooks/useDeepCompareEffect.js";
|
|
11
|
+
import { useHeaderWrapState as q } from "./hooks/useHeaderWrapState.js";
|
|
12
12
|
import { useInitApp as M } from "./hooks/useInitApp.js";
|
|
13
13
|
import { useInitCommonCodes as P } from "./hooks/useInitCommonCodes.js";
|
|
14
|
-
import { useGetNavbar as
|
|
15
|
-
import { useGetNavigationList as
|
|
16
|
-
import { useChangeOwpTheme as
|
|
17
|
-
import { useOwpTranslation as
|
|
18
|
-
import { useGetPageLockLoading as
|
|
19
|
-
import { usePrevious as
|
|
20
|
-
import { useGetShortcuts as
|
|
21
|
-
import { getEnv as
|
|
22
|
-
import { useThemeMediaQuery as
|
|
23
|
-
import { useTimeout as
|
|
14
|
+
import { useGetNavbar as F, useNavbarActions as _ } from "./hooks/useNavbar.js";
|
|
15
|
+
import { useGetNavigationList as B, useSetNavigationList as H } from "./hooks/useNavigation.js";
|
|
16
|
+
import { useChangeOwpTheme as Q, useGetCurrentLayoutConfig as R, useGetCurrentSettings as W, useGetCustomScrollbarsEnabled as j, useGetDefaultSettings as J, useGetFooterTheme as V, useGetMainTheme as X, useGetNavbarTheme as Y, useGetOwpSettings as Z, useGetToolbarTheme as $, useResetSettings as ee, useSetDefaultSettings as re, useSetSettings as te } from "./hooks/useOwpSettings.js";
|
|
17
|
+
import { useOwpTranslation as se } from "./hooks/useOwpTranslation.js";
|
|
18
|
+
import { useGetPageLockLoading as me, usePageLockLoading as ne } from "./hooks/usePageLockLoading.js";
|
|
19
|
+
import { usePrevious as ae } from "./hooks/usePrevious.js";
|
|
20
|
+
import { useGetShortcuts as ie, useSetShortcuts as xe } from "./hooks/useShortcuts.js";
|
|
21
|
+
import { getEnv as Se, setEnv as Ge, useStorage as ge } from "./hooks/useStorage.js";
|
|
22
|
+
import { useThemeMediaQuery as ce } from "./hooks/useThemeMediaQuery.js";
|
|
23
|
+
import { useTimeout as Te } from "./hooks/useTimeout.js";
|
|
24
24
|
import { useTreeGridCommonCodeEnums as he } from "./hooks/useTreeGridCommonCodeEnums.js";
|
|
25
|
-
import { useTreeGridEnums as
|
|
25
|
+
import { useTreeGridEnums as ve } from "./hooks/useTreeGridEnums.js";
|
|
26
26
|
import { useTreeGridExcelExport as be } from "./hooks/useTreeGridExcelExport.js";
|
|
27
27
|
import { FALLBACK_LANGUAGE_LIST as Ne } from "./constants/language.js";
|
|
28
28
|
export {
|
|
29
29
|
Ne as FALLBACK_LANGUAGE_LIST,
|
|
30
|
-
|
|
30
|
+
Se as getEnv,
|
|
31
31
|
Ge as setEnv,
|
|
32
32
|
u as useAccessTokenGuard,
|
|
33
|
-
|
|
33
|
+
Q as useChangeOwpTheme,
|
|
34
34
|
n as useConfirm,
|
|
35
35
|
b as useDebounce,
|
|
36
36
|
N as useDeepCompareEffect,
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
D as useDeepCompareEffectNoCheck,
|
|
38
|
+
I as useDeepCompareMemoize,
|
|
39
|
+
h as useEnsureCurrentUserSeq,
|
|
39
40
|
t as useGetCommonCodeList,
|
|
40
41
|
a as useGetCurrentLanguage,
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
R as useGetCurrentLayoutConfig,
|
|
43
|
+
W as useGetCurrentSettings,
|
|
43
44
|
g as useGetCurrentUser,
|
|
44
45
|
d as useGetCurrentUserId,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
l as useGetCurrentUserSeq,
|
|
47
|
+
j as useGetCustomScrollbarsEnabled,
|
|
48
|
+
J as useGetDefaultSettings,
|
|
49
|
+
V as useGetFooterTheme,
|
|
49
50
|
f as useGetLanguageList,
|
|
50
51
|
C as useGetLogoSrc,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
52
|
+
X as useGetMainTheme,
|
|
53
|
+
F as useGetNavbar,
|
|
54
|
+
Y as useGetNavbarTheme,
|
|
55
|
+
B as useGetNavigationList,
|
|
56
|
+
Z as useGetOwpSettings,
|
|
57
|
+
me as useGetPageLockLoading,
|
|
58
|
+
ie as useGetShortcuts,
|
|
59
|
+
$ as useGetToolbarTheme,
|
|
60
|
+
q as useHeaderWrapState,
|
|
60
61
|
M as useInitApp,
|
|
61
62
|
P as useInitCommonCodes,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
_ as useNavbarActions,
|
|
64
|
+
se as useOwpTranslation,
|
|
65
|
+
ne as usePageLockLoading,
|
|
66
|
+
ae as usePrevious,
|
|
67
|
+
ee as useResetSettings,
|
|
67
68
|
o as useSetCommonCodeList,
|
|
68
69
|
i as useSetCurrentLanguage,
|
|
69
70
|
L as useSetCurrentUser,
|
|
70
71
|
T as useSetCurrentUserId,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
v as useSetCurrentUserSeq,
|
|
73
|
+
re as useSetDefaultSettings,
|
|
74
|
+
S as useSetLogoSrc,
|
|
75
|
+
H as useSetNavigationList,
|
|
76
|
+
te as useSetSettings,
|
|
77
|
+
xe as useSetShortcuts,
|
|
78
|
+
ge as useStorage,
|
|
79
|
+
ce as useThemeMediaQuery,
|
|
80
|
+
Te as useTimeout,
|
|
80
81
|
he as useTreeGridCommonCodeEnums,
|
|
81
|
-
|
|
82
|
+
ve as useTreeGridEnums,
|
|
82
83
|
be as useTreeGridExcelExport
|
|
83
84
|
};
|
|
84
85
|
//# sourceMappingURL=hooks.js.map
|