@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
package/dist/_virtual/index10.js
CHANGED
package/dist/_virtual/index12.js
CHANGED
package/dist/_virtual/index13.js
CHANGED
package/dist/_virtual/index14.js
CHANGED
package/dist/_virtual/index15.js
CHANGED
package/dist/_virtual/index17.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as t } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/match/index.js";
|
|
3
|
+
var o = t();
|
|
4
|
+
const m = /* @__PURE__ */ r(o);
|
|
2
5
|
export {
|
|
3
|
-
|
|
6
|
+
m as default
|
|
4
7
|
};
|
|
5
8
|
//# sourceMappingURL=index17.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index17.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index17.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
package/dist/_virtual/index18.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as
|
|
3
|
-
var o =
|
|
4
|
-
const
|
|
2
|
+
import { __require as e } from "../node_modules/.pnpm/autosuggest-highlight@3.3.4/node_modules/autosuggest-highlight/parse/index.js";
|
|
3
|
+
var o = e();
|
|
4
|
+
const s = /* @__PURE__ */ r(o);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index18.js.map
|
package/dist/_virtual/index19.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
2
|
-
import { __require as
|
|
3
|
-
var o =
|
|
4
|
-
const
|
|
2
|
+
import { __require as t } from "../node_modules/.pnpm/react-autosuggest@10.1.0_react@19.2.4/node_modules/react-autosuggest/dist/index.js";
|
|
3
|
+
var o = t();
|
|
4
|
+
const i = /* @__PURE__ */ r(o);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
i as default
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=index19.js.map
|
package/dist/_virtual/index20.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { __require as t } from "../node_modules/.pnpm/react-autosuggest@10.1.0_react@19.2.4/node_modules/react-autosuggest/dist/index.js";
|
|
3
|
-
var o = t();
|
|
4
|
-
const i = /* @__PURE__ */ r(o);
|
|
1
|
+
var p = { exports: {} };
|
|
5
2
|
export {
|
|
6
|
-
|
|
3
|
+
p as __module
|
|
7
4
|
};
|
|
8
5
|
//# sourceMappingURL=index20.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index20.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index20.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { useGetCommonCodeList as
|
|
5
|
-
import { FormControlLabel as
|
|
6
|
-
import { useId as
|
|
7
|
-
const
|
|
8
|
-
codeId:
|
|
9
|
-
description:
|
|
10
|
-
label:
|
|
11
|
-
fullWidth:
|
|
12
|
-
defaultValue:
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var O = (l, n) => R(l, "name", { value: n, configurable: !0 });
|
|
3
|
+
import { jsxs as b, jsx as a } 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 { useGetCommonCodeList as g } from "../../hooks/useCommonCodeList.js";
|
|
5
|
+
import { FormControlLabel as h, Radio as v, RadioGroup as F, FormControl as X, FormLabel as _, FormHelperText as $ } from "@mui/material";
|
|
6
|
+
import { useId as w, useMemo as M } from "react";
|
|
7
|
+
const x = /* @__PURE__ */ O(({
|
|
8
|
+
codeId: l,
|
|
9
|
+
description: n,
|
|
10
|
+
label: m,
|
|
11
|
+
fullWidth: f,
|
|
12
|
+
defaultValue: s,
|
|
13
13
|
useValueKeyDescription: D,
|
|
14
|
-
required:
|
|
15
|
-
error:
|
|
16
|
-
helperText:
|
|
14
|
+
required: E,
|
|
15
|
+
error: N,
|
|
16
|
+
helperText: d,
|
|
17
17
|
filterOptions: i,
|
|
18
18
|
...e
|
|
19
19
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
const o = typeof i == "function" ?
|
|
22
|
-
return
|
|
23
|
-
(
|
|
20
|
+
const C = w(), t = g(), u = M(() => (t == null ? void 0 : t[l]) ?? [], [l, t]), c = `common-code-radio-group-${C}`, L = M(() => {
|
|
21
|
+
const o = typeof i == "function" ? u.filter(i) : u;
|
|
22
|
+
return n ? o.filter(
|
|
23
|
+
(r) => r["IPX_COMMONCODE.DESCRIPTION"] === n
|
|
24
24
|
) : o;
|
|
25
|
-
}, [
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
-
|
|
25
|
+
}, [u, n, i]);
|
|
26
|
+
return /* @__PURE__ */ b(X, { className: "min-w-128", fullWidth: f, required: E, error: N, children: [
|
|
27
|
+
m ? /* @__PURE__ */ a(_, { id: c, children: m }) : null,
|
|
28
|
+
/* @__PURE__ */ a(
|
|
29
|
+
F,
|
|
30
30
|
{
|
|
31
31
|
row: !0,
|
|
32
32
|
...e,
|
|
33
|
-
"aria-labelledby":
|
|
34
|
-
name: e.name ?? `common-code-radio-group-name-${
|
|
35
|
-
defaultValue:
|
|
33
|
+
"aria-labelledby": m ? c : void 0,
|
|
34
|
+
name: e.name ?? `common-code-radio-group-name-${C}`,
|
|
35
|
+
defaultValue: s,
|
|
36
36
|
value: e.value,
|
|
37
|
-
onChange: /* @__PURE__ */
|
|
38
|
-
var
|
|
39
|
-
(
|
|
37
|
+
onChange: /* @__PURE__ */ O((o, r) => {
|
|
38
|
+
var I;
|
|
39
|
+
(I = e.onChange) == null || I.call(e, o, r);
|
|
40
40
|
}, "onChange"),
|
|
41
|
-
children:
|
|
42
|
-
|
|
41
|
+
children: L.map((o, r) => /* @__PURE__ */ a(
|
|
42
|
+
h,
|
|
43
43
|
{
|
|
44
44
|
value: o[D ? "IPX_COMMONCODE.DESCRIPTION" : "IPX_COMMONCODE.CODEID"],
|
|
45
|
-
control: /* @__PURE__ */
|
|
45
|
+
control: /* @__PURE__ */ a(v, {}),
|
|
46
46
|
label: o["IPX_COMMONCODE.CODENM"]
|
|
47
47
|
},
|
|
48
|
-
`common-code-radio-group-item-${
|
|
48
|
+
`common-code-radio-group-item-${C}-${r}`
|
|
49
49
|
))
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
d ? /* @__PURE__ */ a($, { children: d }) : null
|
|
53
53
|
] });
|
|
54
|
-
}, "OwpCommonCodeRadioGroup"),
|
|
54
|
+
}, "OwpCommonCodeRadioGroup"), y = x;
|
|
55
55
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
y as CommonCodeRadioGroup,
|
|
57
|
+
x as OwpCommonCodeRadioGroup
|
|
58
58
|
};
|
|
59
59
|
//# sourceMappingURL=OwpCommonCodeRadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OwpCommonCodeRadioGroup.js","sources":["../../../src/components/OwpCommonCode/OwpCommonCodeRadioGroup.tsx"],"sourcesContent":["import { useGetCommonCodeList } from '@/hooks/useCommonCodeList';\nimport { CommonCode } from '@/utils/commonCodeUtils';\nimport {\n FormControl,\n FormControlLabel,\n FormControlProps,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup,\n RadioGroupProps,\n} from '@mui/material';\nimport { useId, useMemo } from 'react';\n\nexport type OwpCommonCodeRadioGroupProps = FormControlProps &\n RadioGroupProps & {\n codeId: string;\n description?: string;\n useValueKeyDescription?: boolean;\n label?: string;\n helperText?: string;\n filterOptions?: (commonCode: CommonCode) => boolean;\n };\n\n/**\n * 공통코드 목록을 기반으로 라디오 그룹을 렌더링합니다.\n * @param props 공통코드 라디오 그룹 props\n */\nexport const OwpCommonCodeRadioGroup = ({\n codeId,\n description,\n label,\n fullWidth,\n defaultValue,\n useValueKeyDescription,\n required,\n error,\n helperText,\n filterOptions,\n ...commonCodeProps\n}: OwpCommonCodeRadioGroupProps) => {\n const labelId = useId();\n const commonCodeByGroupId = useGetCommonCodeList();\n const commonCodeList = useMemo(() => commonCodeByGroupId?.[codeId] ?? [], [codeId, commonCodeByGroupId]);\n\n const finalCommonCodeList = useMemo(() => {\n const filteredCommonCodeList =\n typeof filterOptions === 'function' ? commonCodeList.filter(filterOptions) : commonCodeList;\n\n if (description) {\n return filteredCommonCodeList.filter(\n (item) => item['IPX_COMMONCODE.DESCRIPTION'] === description,\n );\n }\n\n return filteredCommonCodeList;\n }, [commonCodeList, description, filterOptions]);\n\n return (\n <FormControl className=\"min-w-128\" fullWidth={fullWidth} required={required} error={error}>\n <FormLabel id={
|
|
1
|
+
{"version":3,"file":"OwpCommonCodeRadioGroup.js","sources":["../../../src/components/OwpCommonCode/OwpCommonCodeRadioGroup.tsx"],"sourcesContent":["import { useGetCommonCodeList } from '@/hooks/useCommonCodeList';\nimport { CommonCode } from '@/utils/commonCodeUtils';\nimport {\n FormControl,\n FormControlLabel,\n FormControlProps,\n FormHelperText,\n FormLabel,\n Radio,\n RadioGroup,\n RadioGroupProps,\n} from '@mui/material';\nimport { useId, useMemo } from 'react';\n\nexport type OwpCommonCodeRadioGroupProps = FormControlProps &\n RadioGroupProps & {\n codeId: string;\n description?: string;\n useValueKeyDescription?: boolean;\n label?: string;\n helperText?: string;\n filterOptions?: (commonCode: CommonCode) => boolean;\n };\n\n/**\n * 공통코드 목록을 기반으로 라디오 그룹을 렌더링합니다.\n * @param props 공통코드 라디오 그룹 props\n */\nexport const OwpCommonCodeRadioGroup = ({\n codeId,\n description,\n label,\n fullWidth,\n defaultValue,\n useValueKeyDescription,\n required,\n error,\n helperText,\n filterOptions,\n ...commonCodeProps\n}: OwpCommonCodeRadioGroupProps) => {\n const labelId = useId();\n const commonCodeByGroupId = useGetCommonCodeList();\n const commonCodeList = useMemo(() => commonCodeByGroupId?.[codeId] ?? [], [codeId, commonCodeByGroupId]);\n const labelElementId = `common-code-radio-group-${labelId}`;\n\n const finalCommonCodeList = useMemo(() => {\n const filteredCommonCodeList =\n typeof filterOptions === 'function' ? commonCodeList.filter(filterOptions) : commonCodeList;\n\n if (description) {\n return filteredCommonCodeList.filter(\n (item) => item['IPX_COMMONCODE.DESCRIPTION'] === description,\n );\n }\n\n return filteredCommonCodeList;\n }, [commonCodeList, description, filterOptions]);\n\n return (\n <FormControl className=\"min-w-128\" fullWidth={fullWidth} required={required} error={error}>\n {label ? <FormLabel id={labelElementId}>{label}</FormLabel> : null}\n <RadioGroup\n row\n {...commonCodeProps}\n aria-labelledby={label ? labelElementId : undefined}\n name={commonCodeProps.name ?? `common-code-radio-group-name-${labelId}`}\n defaultValue={defaultValue}\n value={commonCodeProps.value}\n onChange={(event, value) => {\n commonCodeProps.onChange?.(event, value);\n }}\n >\n {finalCommonCodeList.map((item, index) => (\n <FormControlLabel\n key={`common-code-radio-group-item-${labelId}-${index}`}\n value={\n item[useValueKeyDescription ? 'IPX_COMMONCODE.DESCRIPTION' : 'IPX_COMMONCODE.CODEID']\n }\n control={<Radio />}\n label={item['IPX_COMMONCODE.CODENM']}\n />\n ))}\n </RadioGroup>\n {helperText ? <FormHelperText>{helperText}</FormHelperText> : null}\n </FormControl>\n );\n};\n\nexport const CommonCodeRadioGroup = OwpCommonCodeRadioGroup;\n"],"names":["OwpCommonCodeRadioGroup","__name","codeId","description","label","fullWidth","defaultValue","useValueKeyDescription","required","error","helperText","filterOptions","commonCodeProps","labelId","useId","commonCodeByGroupId","useGetCommonCodeList","commonCodeList","useMemo","labelElementId","finalCommonCodeList","filteredCommonCodeList","item","FormControl","jsx","FormLabel","RadioGroup","event","value","_a","index","FormControlLabel","Radio","FormHelperText","CommonCodeRadioGroup"],"mappings":";;;;;;AA4BO,MAAMA,IAA0B,gBAAAC,EAAA,CAAC;AAAA,EACtC,QAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,wBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,eAAAC;AAAA,EACA,GAAGC;AACL,MAAoC;AAClC,QAAMC,IAAUC,EAAA,GACVC,IAAsBC,EAAA,GACtBC,IAAiBC,EAAQ,OAAMH,KAAA,gBAAAA,EAAsBb,OAAW,IAAI,CAACA,GAAQa,CAAmB,CAAC,GACjGI,IAAiB,2BAA2BN,CAAO,IAEnDO,IAAsBF,EAAQ,MAAM;AACxC,UAAMG,IACJ,OAAOV,KAAkB,aAAaM,EAAe,OAAON,CAAa,IAAIM;AAE/E,WAAId,IACKkB,EAAuB;AAAA,MAC5B,CAACC,MAASA,EAAK,4BAA4B,MAAMnB;AAAA,IAAA,IAI9CkB;AAAA,EACT,GAAG,CAACJ,GAAgBd,GAAaQ,CAAa,CAAC;AAE/C,2BACGY,GAAA,EAAY,WAAU,aAAY,WAAAlB,GAAsB,UAAAG,GAAoB,OAAAC,GAC1E,UAAA;AAAA,IAAAL,IAAQ,gBAAAoB,EAACC,GAAA,EAAU,IAAIN,GAAiB,aAAM,IAAe;AAAA,IAC9D,gBAAAK;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,KAAG;AAAA,QACF,GAAGd;AAAA,QACJ,mBAAiBR,IAAQe,IAAiB;AAAA,QAC1C,MAAMP,EAAgB,QAAQ,gCAAgCC,CAAO;AAAA,QACrE,cAAAP;AAAA,QACA,OAAOM,EAAgB;AAAA,QACvB,UAAU,gBAAAX,EAAA,CAAC0B,GAAOC,MAAU;;AAC1B,WAAAC,IAAAjB,EAAgB,aAAhB,QAAAiB,EAAA,KAAAjB,GAA2Be,GAAOC;AAAA,QACpC,GAFU;AAAA,QAIT,UAAAR,EAAoB,IAAI,CAACE,GAAMQ,MAC9B,gBAAAN;AAAA,UAACO;AAAA,UAAA;AAAA,YAEC,OACET,EAAKf,IAAyB,+BAA+B,uBAAuB;AAAA,YAEtF,2BAAUyB,GAAA,EAAM;AAAA,YAChB,OAAOV,EAAK,uBAAuB;AAAA,UAAA;AAAA,UAL9B,gCAAgCT,CAAO,IAAIiB,CAAK;AAAA,QAAA,CAOxD;AAAA,MAAA;AAAA,IAAA;AAAA,IAEFpB,IAAa,gBAAAc,EAACS,GAAA,EAAgB,UAAAvB,EAAA,CAAW,IAAoB;AAAA,EAAA,GAChE;AAEJ,GA3DuC,4BA6D1BwB,IAAuBlC;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var s = (e, n) => m(e, "name", { value: n, configurable: !0 });
|
|
3
|
+
import { jsxs as a, jsx as l } 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 t from "@mui/material/FormHelperText";
|
|
5
|
+
import { clsx as d } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
6
|
+
function u({
|
|
7
|
+
children: e,
|
|
8
|
+
required: n = !1,
|
|
9
|
+
className: r,
|
|
10
|
+
component: i = "div",
|
|
11
|
+
...o
|
|
12
|
+
}) {
|
|
13
|
+
return !(e != null && e !== "") && !n ? null : /* @__PURE__ */ a(
|
|
14
|
+
t,
|
|
15
|
+
{
|
|
16
|
+
...o,
|
|
17
|
+
component: i,
|
|
18
|
+
className: d("text-16 font-medium", r),
|
|
19
|
+
children: [
|
|
20
|
+
n ? /* @__PURE__ */ a("span", { className: "mr-4 leading-none text-red-600", children: [
|
|
21
|
+
/* @__PURE__ */ l("span", { className: "leading-none", children: "(" }),
|
|
22
|
+
/* @__PURE__ */ l("span", { className: "leading-none", children: "*" }),
|
|
23
|
+
/* @__PURE__ */ l("span", { className: "leading-none", children: ")" })
|
|
24
|
+
] }) : null,
|
|
25
|
+
e
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
s(u, "OwpFieldHelperText");
|
|
31
|
+
export {
|
|
32
|
+
u as OwpFieldHelperText
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=OwpFieldHelperText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwpFieldHelperText.js","sources":["../../../src/components/OwpFieldHelperText/OwpFieldHelperText.tsx"],"sourcesContent":["import FormHelperText from '@mui/material/FormHelperText';\nimport type { FormHelperTextProps } from '@mui/material/FormHelperText';\nimport clsx from 'clsx';\nimport type { ReactNode } from 'react';\n\nexport interface OwpFieldHelperTextProps\n extends Omit<FormHelperTextProps, 'children'> {\n children?: ReactNode;\n required?: boolean;\n}\n\n/**\n * 입력 필드 하단 안내 문구\n * @param children 안내 문구\n * @param required 필수 표시 노출 여부\n * @param className 추가 스타일 클래스\n */\nfunction OwpFieldHelperText({\n children,\n required = false,\n className,\n component = 'div',\n ...formHelperTextProps\n}: OwpFieldHelperTextProps) {\n const hasChildren = children !== undefined && children !== null && children !== '';\n\n if (!hasChildren && !required) {\n return null;\n }\n\n return (\n <FormHelperText\n {...formHelperTextProps}\n component={component}\n className={clsx('text-16 font-medium', className)}\n >\n {required ? (\n <span className=\"mr-4 leading-none text-red-600\">\n <span className=\"leading-none\">(</span>\n <span className=\"leading-none\">*</span>\n <span className=\"leading-none\">)</span>\n </span>\n ) : null}\n {children}\n </FormHelperText>\n );\n}\n\nexport { OwpFieldHelperText };\n"],"names":["OwpFieldHelperText","children","required","className","component","formHelperTextProps","jsxs","FormHelperText","clsx","jsx","__name"],"mappings":";;;;;AAiBA,SAASA,EAAmB;AAAA,EAC1B,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,GAA4B;AAG1B,SAAI,EAF0CJ,KAAa,QAAQA,MAAa,OAE5D,CAACC,IACZ,OAIP,gBAAAI;AAAA,IAACC;AAAA,IAAA;AAAA,MACE,GAAGF;AAAA,MACJ,WAAAD;AAAA,MACA,WAAWI,EAAK,uBAAuBL,CAAS;AAAA,MAE/C,UAAA;AAAA,QAAAD,IACC,gBAAAI,EAAC,QAAA,EAAK,WAAU,kCACd,UAAA;AAAA,UAAA,gBAAAG,EAAC,QAAA,EAAK,WAAU,gBAAe,UAAA,KAAC;AAAA,UAChC,gBAAAA,EAAC,QAAA,EAAK,WAAU,gBAAe,UAAA,KAAC;AAAA,UAChC,gBAAAA,EAAC,QAAA,EAAK,WAAU,gBAAe,UAAA,IAAA,CAAC;AAAA,QAAA,EAAA,CAClC,IACE;AAAA,QACHR;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;AA7BSS,EAAAV,GAAA;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var t = (r, l) => d(r, "name", { value: l, configurable: !0 });
|
|
3
|
+
import { jsxs as f, jsx as c, Fragment as u } 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 { clsx as a } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
5
|
+
import { isValidElement as g, Fragment as h, cloneElement as x } from "react";
|
|
6
|
+
function N({
|
|
7
|
+
children: r,
|
|
8
|
+
message: l,
|
|
9
|
+
className: s,
|
|
10
|
+
required: o = !0,
|
|
11
|
+
requiredPosition: m = "right"
|
|
12
|
+
}) {
|
|
13
|
+
const n = r !== void 0 ? r : l;
|
|
14
|
+
if (n == null || n === "")
|
|
15
|
+
return null;
|
|
16
|
+
const i = /* @__PURE__ */ t((e) => /* @__PURE__ */ c("span", { className: a("text-red-600", e), children: "*" }), "renderMark"), p = /* @__PURE__ */ t((e) => /* @__PURE__ */ f(u, { children: [
|
|
17
|
+
o && m === "left" ? i("mr-4") : null,
|
|
18
|
+
e,
|
|
19
|
+
o && m === "right" ? i("ml-4") : null
|
|
20
|
+
] }), "renderContent");
|
|
21
|
+
if (g(n) && n.type !== h) {
|
|
22
|
+
const e = n;
|
|
23
|
+
if (e.props.children !== void 0)
|
|
24
|
+
return x(
|
|
25
|
+
e,
|
|
26
|
+
{
|
|
27
|
+
className: a(e.props.className, s)
|
|
28
|
+
},
|
|
29
|
+
p(e.props.children)
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ c("span", { className: s, children: p(n) });
|
|
33
|
+
}
|
|
34
|
+
t(N, "OwpRequiredHelperText");
|
|
35
|
+
export {
|
|
36
|
+
N as OwpRequiredHelperText
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=OwpRequiredHelperText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwpRequiredHelperText.js","sources":["../../../src/components/OwpRequiredHelperText/OwpRequiredHelperText.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport {\n Fragment,\n cloneElement,\n isValidElement,\n type ReactElement,\n type ReactNode,\n} from 'react';\n\nexport interface OwpRequiredHelperTextProps {\n children?: ReactNode;\n message?: ReactNode;\n className?: string;\n required?: boolean;\n requiredPosition?: 'left' | 'right';\n}\n\n/**\n * 필수 표시 안내 문구\n * @param children 안내 문구\n * @param message 안내 문구\n * @param className 추가 스타일 클래스\n * @param required 필수 표시 노출 여부\n * @param requiredPosition 필수 표시 위치\n */\nfunction OwpRequiredHelperText({\n children,\n message,\n className,\n required = true,\n requiredPosition = 'right',\n}: OwpRequiredHelperTextProps) {\n const content = children !== undefined ? children : message;\n\n if (content === undefined || content === null || content === '') {\n return null;\n }\n\n const renderMark = (marginClassName: string) => (\n <span className={clsx('text-red-600', marginClassName)}>\n *\n </span>\n );\n\n const renderContent = (content: ReactNode) => (\n <>\n {required && requiredPosition === 'left' ? renderMark('mr-4') : null}\n {content}\n {required && requiredPosition === 'right' ? renderMark('ml-4') : null}\n </>\n );\n\n if (isValidElement(content) && content.type !== Fragment) {\n const messageElement = content as ReactElement<{\n children?: ReactNode;\n className?: string;\n }>;\n\n if (messageElement.props.children !== undefined) {\n return cloneElement(\n messageElement,\n {\n className: clsx(messageElement.props.className, className),\n },\n renderContent(messageElement.props.children),\n );\n }\n }\n\n return <span className={className}>{renderContent(content)}</span>;\n}\n\nexport { OwpRequiredHelperText };\n"],"names":["OwpRequiredHelperText","children","message","className","required","requiredPosition","content","renderMark","__name","marginClassName","jsx","clsx","renderContent","jsxs","Fragment","isValidElement","messageElement","cloneElement"],"mappings":";;;;;AAyBA,SAASA,EAAsB;AAAA,EAC7B,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,kBAAAC,IAAmB;AACrB,GAA+B;AAC7B,QAAMC,IAAUL,MAAa,SAAYA,IAAWC;AAEpD,MAA6BI,KAAY,QAAQA,MAAY;AAC3D,WAAO;AAGT,QAAMC,IAAa,gBAAAC,EAAA,CAACC,MAClB,gBAAAC,EAAC,QAAA,EAAK,WAAWC,EAAK,gBAAgBF,CAAe,GAAG,UAAA,IAAA,CAExD,GAHiB,eAMbG,IAAgB,gBAAAJ,EAAA,CAACF,MACrB,gBAAAO,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAV,KAAYC,MAAqB,SAASE,EAAW,MAAM,IAAI;AAAA,IAC/DD;AAAAA,IACAF,KAAYC,MAAqB,UAAUE,EAAW,MAAM,IAAI;AAAA,EAAA,GACnE,GALoB;AAQtB,MAAIQ,EAAeT,CAAO,KAAKA,EAAQ,SAASQ,GAAU;AACxD,UAAME,IAAiBV;AAKvB,QAAIU,EAAe,MAAM,aAAa;AACpC,aAAOC;AAAA,QACLD;AAAA,QACA;AAAA,UACE,WAAWL,EAAKK,EAAe,MAAM,WAAWb,CAAS;AAAA,QAAA;AAAA,QAE3DS,EAAcI,EAAe,MAAM,QAAQ;AAAA,MAAA;AAAA,EAGjD;AAEA,SAAO,gBAAAN,EAAC,QAAA,EAAK,WAAAP,GAAuB,UAAAS,EAAcN,CAAO,GAAE;AAC7D;AA7CSE,EAAAR,GAAA;"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var n = (e, t) => x(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
import { jsxs as a, jsx as m, Fragment as D } 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 { TableCell as d, TableBody as F, Checkbox as T } from "@mui/material";
|
|
5
|
+
import { clsx as N } from "../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
6
|
+
import S from "dayjs";
|
|
7
|
+
import { Fragment as H } from "react";
|
|
8
|
+
import { StyledTableRow as M, StyledTable as k } from "./OwpTable.js";
|
|
9
|
+
import { isNaN as l } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNaN.js";
|
|
10
|
+
import { toNumber as y } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/util/toNumber.js";
|
|
11
|
+
const E = 28, R = {
|
|
12
|
+
"&&": {
|
|
13
|
+
fontFamily: "inherit",
|
|
14
|
+
fontSize: "1.7rem",
|
|
15
|
+
fontWeight: 600,
|
|
16
|
+
lineHeight: "normal",
|
|
17
|
+
minHeight: "unset",
|
|
18
|
+
padding: "7px 10px"
|
|
19
|
+
}
|
|
20
|
+
}, $ = {
|
|
21
|
+
borderRadius: 0,
|
|
22
|
+
overflow: "visible"
|
|
23
|
+
}, u = {
|
|
24
|
+
borderTop: "1px solid #CDD8E4"
|
|
25
|
+
}, c = /* @__PURE__ */ n((e) => /* @__PURE__ */ a(D, { children: [
|
|
26
|
+
e,
|
|
27
|
+
/* @__PURE__ */ m("span", { className: "ml-4 text-red-600", children: "*" })
|
|
28
|
+
] }), "getRequiredTitle"), j = /* @__PURE__ */ n((e, t) => e == null ? void 0 : e[t], "getFieldTableValue"), z = /* @__PURE__ */ n((e, t) => typeof t == "function" ? t(e) : l(y(e)) ? e === "Y" : !!Number(e), "getCheckboxChecked"), B = /* @__PURE__ */ n((e) => e.withTime ? "YYYY-MM-DD HH:mm" : e.withTimeAndSec ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD", "getDateFormat"), L = /* @__PURE__ */ n((e, t, s) => {
|
|
29
|
+
const i = j(t, e.key);
|
|
30
|
+
return typeof e.render == "function" ? e.render() : e.useCheckbox ? /* @__PURE__ */ m(
|
|
31
|
+
T,
|
|
32
|
+
{
|
|
33
|
+
checked: z(i, e.validate),
|
|
34
|
+
sx: { "& .MuiSvgIcon-root": { fontSize: (s == null ? void 0 : s.fontSize) ?? E } }
|
|
35
|
+
}
|
|
36
|
+
) : e.useDate ? i && S(i).format(B(e)) : e.disableLocaleString ? i : i == null ? void 0 : i.toLocaleString();
|
|
37
|
+
}, "renderFieldTableCellValue");
|
|
38
|
+
function Z({
|
|
39
|
+
layout: e,
|
|
40
|
+
titleWidth: t,
|
|
41
|
+
titleSx: s,
|
|
42
|
+
treeGridTitleCellSx: i,
|
|
43
|
+
cellSx: f,
|
|
44
|
+
data: h,
|
|
45
|
+
colGroupSlot: b,
|
|
46
|
+
className: w,
|
|
47
|
+
tableLayout: g = "fixed",
|
|
48
|
+
canUseTreeGridStyle: o = !1
|
|
49
|
+
}) {
|
|
50
|
+
return /* @__PURE__ */ a(
|
|
51
|
+
k,
|
|
52
|
+
{
|
|
53
|
+
canUseTreeGridStyle: o,
|
|
54
|
+
className: N("w-full", w),
|
|
55
|
+
containerProps: { sx: o ? $ : void 0 },
|
|
56
|
+
tableLayout: g,
|
|
57
|
+
children: [
|
|
58
|
+
b,
|
|
59
|
+
/* @__PURE__ */ m(F, { children: e.map((Y, p) => /* @__PURE__ */ m(M, { children: Y.map((r, C) => /* @__PURE__ */ a(H, { children: [
|
|
60
|
+
/* @__PURE__ */ m(
|
|
61
|
+
d,
|
|
62
|
+
{
|
|
63
|
+
component: "th",
|
|
64
|
+
className: "whitespace-pre-wrap",
|
|
65
|
+
width: t ?? 200,
|
|
66
|
+
sx: {
|
|
67
|
+
...o ? R : {},
|
|
68
|
+
...o ? i ?? {} : {},
|
|
69
|
+
...o && p === 0 ? u : {},
|
|
70
|
+
...s ?? {}
|
|
71
|
+
},
|
|
72
|
+
rowSpan: r == null ? void 0 : r.rowSpan,
|
|
73
|
+
children: r.required ? c(r.title) : r.title
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ m(
|
|
77
|
+
d,
|
|
78
|
+
{
|
|
79
|
+
className: "whitespace-pre-wrap",
|
|
80
|
+
sx: {
|
|
81
|
+
...o && p === 0 ? u : {},
|
|
82
|
+
...f ?? {}
|
|
83
|
+
},
|
|
84
|
+
style: (r == null ? void 0 : r.style) ?? {},
|
|
85
|
+
colSpan: r == null ? void 0 : r.colSpan,
|
|
86
|
+
rowSpan: r == null ? void 0 : r.rowSpan,
|
|
87
|
+
children: L(r, h, f)
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }, `owp-field-cell-${p}-${C}`)) }, `owp-field-col-${p}`)) })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
n(Z, "OwpFieldTable");
|
|
96
|
+
export {
|
|
97
|
+
Z as OwpFieldTable
|
|
98
|
+
};
|
|
99
|
+
//# sourceMappingURL=OwpFieldTable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwpFieldTable.js","sources":["../../../src/components/OwpTable/OwpFieldTable.tsx"],"sourcesContent":["import { Checkbox, TableBody, TableCell, type TableCellProps } from '@mui/material';\nimport clsx from 'clsx';\nimport dayjs from 'dayjs';\nimport { isNaN, toNumber } from 'es-toolkit/compat';\nimport { Fragment, type CSSProperties, type ReactNode } from 'react';\nimport { StyledTable, StyledTableRow } from './OwpTable';\n\ntype OwpFieldTableCell = {\n title: string;\n key: string;\n required?: boolean;\n disableLocaleString?: boolean;\n useDate?: boolean;\n withTime?: boolean;\n withTimeAndSec?: boolean;\n useCheckbox?: boolean;\n colSpan?: number;\n rowSpan?: number;\n style?: CSSProperties;\n render?: () => ReactNode;\n validate?: (v?: number | string) => boolean;\n};\n\ntype OwpFieldTableValue = string | number | '';\ntype OwpFieldTableDataRecord = Record<string, OwpFieldTableValue | undefined>;\n\ninterface OwpFieldTableProps {\n layout: OwpFieldTableCell[][];\n data?: OwpFieldTableDataRecord;\n titleSx?: TableCellProps['sx'];\n treeGridTitleCellSx?: TableCellProps['sx'] & CSSProperties;\n cellSx?: TableCellProps['sx'] & CSSProperties;\n titleWidth?: number | string;\n colGroupSlot?: ReactNode;\n className?: string;\n tableLayout?: 'auto' | 'fixed';\n canUseTreeGridStyle?: boolean;\n}\n\nconst DEFAULT_CHECKBOX_FONT_SIZE = 28;\n\nconst defaultTreeGridTitleCellSx = {\n '&&': {\n fontFamily: 'inherit',\n fontSize: '1.7rem',\n fontWeight: 600,\n lineHeight: 'normal',\n minHeight: 'unset',\n padding: '7px 10px',\n },\n} as const;\n\nconst treeGridContainerSx = {\n borderRadius: 0,\n overflow: 'visible',\n} as const;\n\nconst treeGridFirstRowCellSx = {\n borderTop: '1px solid #CDD8E4',\n} as const;\n\n/** 필수 헤더 타이틀 */\nconst getRequiredTitle = (title: string) => (\n <>\n {title}\n <span className=\"ml-4 text-red-600\">*</span>\n </>\n);\n\nconst getFieldTableValue = (data: OwpFieldTableProps['data'], key: string) => {\n return data?.[key];\n};\n\nconst getCheckboxChecked = (\n value: OwpFieldTableValue | undefined,\n validate?: OwpFieldTableCell['validate'],\n) => {\n if (typeof validate === 'function') {\n return validate(value);\n }\n\n if (isNaN(toNumber(value))) {\n return value === 'Y';\n }\n\n return Boolean(Number(value));\n};\n\nconst getDateFormat = (cell: OwpFieldTableCell) => {\n if (cell.withTime) {\n return 'YYYY-MM-DD HH:mm';\n }\n\n if (cell.withTimeAndSec) {\n return 'YYYY-MM-DD HH:mm:ss';\n }\n\n return 'YYYY-MM-DD';\n};\n\nconst renderFieldTableCellValue = (\n cell: OwpFieldTableCell,\n data: OwpFieldTableProps['data'],\n cellSx?: OwpFieldTableProps['cellSx'],\n): ReactNode => {\n const value = getFieldTableValue(data, cell.key);\n\n if (typeof cell.render === 'function') {\n return cell.render();\n }\n\n if (cell.useCheckbox) {\n return (\n <Checkbox\n checked={getCheckboxChecked(value, cell.validate)}\n sx={{ '& .MuiSvgIcon-root': { fontSize: cellSx?.fontSize ?? DEFAULT_CHECKBOX_FONT_SIZE } }}\n />\n );\n }\n\n if (cell.useDate) {\n return value ? dayjs(value).format(getDateFormat(cell)) : value;\n }\n\n if (cell.disableLocaleString) {\n return value;\n }\n\n return value?.toLocaleString();\n};\n\n/**\n * OwpFieldTable 컴포넌트\n * @param layout layout 값\n * @param titleWidth titleWidth 값\n * @param titleSx titleSx 값\n * @param treeGridTitleCellSx TreeGrid title cell sx 값\n * @param cellSx cellSx 값\n * @param data 데이터\n * @param colGroupSlot colGroupSlot 값\n * @param className className 값\n * @param tableLayout tableLayout 값\n * @param canUseTreeGridStyle TreeGrid 스타일 사용 여부\n */\nexport function OwpFieldTable({\n layout,\n titleWidth,\n titleSx,\n treeGridTitleCellSx,\n cellSx,\n data,\n colGroupSlot,\n className,\n tableLayout = 'fixed',\n canUseTreeGridStyle = false,\n}: OwpFieldTableProps) {\n return (\n <StyledTable\n canUseTreeGridStyle={canUseTreeGridStyle}\n className={clsx('w-full', className)}\n containerProps={{ sx: canUseTreeGridStyle ? treeGridContainerSx : undefined }}\n tableLayout={tableLayout}\n >\n {colGroupSlot}\n <TableBody>\n {layout.map((cols, rowIndex) => (\n <StyledTableRow key={`owp-field-col-${rowIndex}`}>\n {cols.map((col, colIndex) => (\n <Fragment key={`owp-field-cell-${rowIndex}-${colIndex}`}>\n <TableCell\n component=\"th\"\n className=\"whitespace-pre-wrap\"\n width={titleWidth ?? 200}\n sx={{\n ...(canUseTreeGridStyle ? defaultTreeGridTitleCellSx : {}),\n ...(canUseTreeGridStyle ? (treeGridTitleCellSx ?? {}) : {}),\n ...(canUseTreeGridStyle && rowIndex === 0 ? treeGridFirstRowCellSx : {}),\n ...(titleSx ?? {}),\n }}\n rowSpan={col?.rowSpan}\n >\n {col.required ? getRequiredTitle(col.title) : col.title}\n </TableCell>\n <TableCell\n className=\"whitespace-pre-wrap\"\n sx={{\n ...(canUseTreeGridStyle && rowIndex === 0 ? treeGridFirstRowCellSx : {}),\n ...(cellSx ?? {}),\n }}\n style={col?.style ?? {}}\n colSpan={col?.colSpan}\n rowSpan={col?.rowSpan}\n >\n {renderFieldTableCellValue(col, data, cellSx)}\n </TableCell>\n </Fragment>\n ))}\n </StyledTableRow>\n ))}\n </TableBody>\n </StyledTable>\n );\n}\n"],"names":["DEFAULT_CHECKBOX_FONT_SIZE","defaultTreeGridTitleCellSx","treeGridContainerSx","treeGridFirstRowCellSx","getRequiredTitle","__name","title","jsxs","Fragment","jsx","getFieldTableValue","data","key","getCheckboxChecked","value","validate","isNaN","toNumber","getDateFormat","cell","renderFieldTableCellValue","cellSx","Checkbox","dayjs","OwpFieldTable","layout","titleWidth","titleSx","treeGridTitleCellSx","colGroupSlot","className","tableLayout","canUseTreeGridStyle","StyledTable","clsx","TableBody","cols","rowIndex","StyledTableRow","col","colIndex","TableCell"],"mappings":"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"}
|