@owp/core 2.5.20 → 2.5.21
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/index16.js +4 -4
- package/dist/_virtual/index17.js +4 -4
- package/dist/_virtual/index18.js +4 -4
- package/dist/_virtual/index19.js +4 -4
- package/dist/components/OwpCommonCode/OwpCommonCodeQuerySelector.js +26 -26
- package/dist/components/OwpCommonCode/OwpCommonCodeQuerySelector.js.map +1 -1
- package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js +29 -29
- package/dist/components/OwpCommonCode/OwpCommonCodeSelector.js.map +1 -1
- package/dist/components/OwpMrtTable/OwpMrtTable.js +144 -141
- package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
- package/dist/components/OwpOptionSelector/OwpOptionSelector.js +20 -20
- package/dist/components/OwpOptionSelector/OwpOptionSelector.js.map +1 -1
- package/dist/components/OwpPicker/OwpDatePicker.js +218 -236
- package/dist/components/OwpPicker/OwpDatePicker.js.map +1 -1
- package/dist/components/OwpPicker/OwpTimePicker.js +311 -340
- package/dist/components/OwpPicker/OwpTimePicker.js.map +1 -1
- package/dist/components/OwpPicker/constants/index.js +21 -6
- package/dist/components/OwpPicker/constants/index.js.map +1 -1
- package/dist/components/OwpPicker/utils/index.js +22 -0
- package/dist/components/OwpPicker/utils/index.js.map +1 -0
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js +218 -205
- package/dist/components/OwpQuerySelector/OwpQuerySelector.js.map +1 -1
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js +59 -59
- package/dist/components/OwpSelectorBase/OwpSelectorAutocomplete.js.map +1 -1
- package/dist/components/OwpSelectorBase/OwpSelectorSelect.js +88 -85
- package/dist/components/OwpSelectorBase/OwpSelectorSelect.js.map +1 -1
- package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js +93 -93
- package/dist/components/OwpSelectorBase/hooks/useOwpSelectorBase.js.map +1 -1
- package/dist/components/OwpTable/OwpDataTable.js +329 -317
- package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
- package/dist/components/OwpTable/OwpFieldTable.js +78 -72
- package/dist/components/OwpTable/OwpFieldTable.js.map +1 -1
- package/dist/components/OwpTable/OwpTable.js +66 -219
- package/dist/components/OwpTable/OwpTable.js.map +1 -1
- package/dist/components/OwpTable/internal/OwpTableBase.js +170 -0
- package/dist/components/OwpTable/internal/OwpTableBase.js.map +1 -0
- package/dist/components/OwpTable/internal/OwpTableTotalCount.js +23 -0
- package/dist/components/OwpTable/internal/OwpTableTotalCount.js.map +1 -0
- package/dist/components/OwpTable/internal/defaultTableStyle.js +10 -10
- package/dist/components/OwpTable/internal/defaultTableStyle.js.map +1 -1
- package/dist/components/OwpTable/utils/tableSx.js +9 -0
- package/dist/components/OwpTable/utils/tableSx.js.map +1 -0
- package/dist/components/OwpTextField/OwpTextMaskField.js +95 -86
- package/dist/components/OwpTextField/OwpTextMaskField.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js +158 -172
- package/dist/components/OwpTreeGrid/internal/hooks/useOwpTreeGridDatePickerEditor.js.map +1 -1
- package/dist/components/OwpYesNoSelector/OwpYesNoSelector.js.map +1 -1
- package/dist/features/themePreview/configs/table.js +4 -4
- package/dist/features/themePreview/configs/table.js.map +1 -1
- package/dist/index.js +91 -94
- 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/CODE93/constants.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/ITF/constants.js +1 -1
- package/dist/node_modules/.pnpm/react-overlays@5.2.1_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/react-overlays/esm/Portal.js +1 -1
- package/dist/types/components/OwpCommonCode/OwpCommonCodeQuerySelector.d.ts +3 -3
- package/dist/types/components/OwpCommonCode/OwpCommonCodeSelector.d.ts +3 -3
- package/dist/types/components/OwpMrtTable/OwpMrtTable.d.ts +1 -0
- package/dist/types/components/OwpOptionSelector/OwpOptionSelector.d.ts +2 -2
- package/dist/types/components/OwpPicker/OwpDatePicker.d.ts +1 -1
- package/dist/types/components/OwpPicker/OwpTimePicker.d.ts +1 -1
- package/dist/types/components/OwpPicker/constants/index.d.ts +15 -0
- package/dist/types/components/OwpPicker/utils/index.d.ts +6 -0
- package/dist/types/components/OwpQuerySelector/OwpQuerySelector.d.ts +1 -1
- package/dist/types/components/OwpQuerySelector/types/types.d.ts +1 -0
- package/dist/types/components/OwpSelectorBase/hooks/useOwpSelectorBase.d.ts +1 -1
- package/dist/types/components/OwpSelectorBase/types/types.d.ts +1 -1
- package/dist/types/components/OwpTable/OwpDataTable.d.ts +5 -1
- package/dist/types/components/OwpTable/OwpFieldTable.d.ts +7 -1
- package/dist/types/components/OwpTable/OwpTable.d.ts +6 -38
- package/dist/types/components/OwpTable/internal/OwpTableBase.d.ts +34 -0
- package/dist/types/components/OwpTable/internal/OwpTableTotalCount.d.ts +9 -0
- package/dist/types/components/OwpTable/internal/defaultTableStyle.d.ts +4 -2
- package/dist/types/components/OwpTable/utils/tableSx.d.ts +11 -0
- package/dist/types/components/OwpTextField/OwpTextMaskField.d.ts +3 -3
- package/dist/types/components/OwpYesNoSelector/OwpYesNoSelector.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
var l = Object.defineProperty;
|
|
2
2
|
var r = (o, e) => l(o, "name", { value: e, configurable: !0 });
|
|
3
|
-
|
|
4
|
-
const a = "7px 10px", d = {
|
|
3
|
+
const n = "7px 10px", i = ".8rem", a = "#f5f5f5", d = {
|
|
5
4
|
borderColor: "#e2e8f0",
|
|
6
5
|
header: {
|
|
7
6
|
backgroundColor: "",
|
|
@@ -13,21 +12,20 @@ const a = "7px 10px", d = {
|
|
|
13
12
|
backgroundColor: "",
|
|
14
13
|
fontSize: "1.7rem"
|
|
15
14
|
}
|
|
16
|
-
}, t = /* @__PURE__ */ r(() => ({
|
|
17
|
-
padding:
|
|
15
|
+
}, t = /* @__PURE__ */ r((o) => ({
|
|
16
|
+
padding: n,
|
|
17
|
+
borderBottom: `1px solid ${o.borderColor}`,
|
|
18
18
|
borderLeft: "none",
|
|
19
19
|
borderRight: "none"
|
|
20
20
|
}), "getDefaultTableCellBaseSx"), f = /* @__PURE__ */ r((o) => ({
|
|
21
|
-
...t(),
|
|
22
|
-
borderBottomColor: o.borderColor,
|
|
21
|
+
...t(o),
|
|
23
22
|
...o.cell.backgroundColor && {
|
|
24
23
|
backgroundColor: o.cell.backgroundColor
|
|
25
24
|
},
|
|
26
25
|
fontSize: o.cell.fontSize
|
|
27
|
-
}), "getDefaultTableCellSx"),
|
|
28
|
-
...t(),
|
|
26
|
+
}), "getDefaultTableCellSx"), S = /* @__PURE__ */ r((o, e = a) => ({
|
|
27
|
+
...t(o),
|
|
29
28
|
backgroundColor: o.header.backgroundColor || e,
|
|
30
|
-
borderBottomColor: o.borderColor,
|
|
31
29
|
color: o.header.color,
|
|
32
30
|
fontSize: o.header.fontSize,
|
|
33
31
|
fontWeight: o.header.fontWeight
|
|
@@ -50,10 +48,12 @@ const a = "7px 10px", d = {
|
|
|
50
48
|
}
|
|
51
49
|
};
|
|
52
50
|
export {
|
|
51
|
+
a as DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,
|
|
52
|
+
i as DEFAULT_TABLE_RADIUS,
|
|
53
53
|
d as defaultStyledTableTheme,
|
|
54
54
|
u as defaultTableSortLabelSx,
|
|
55
55
|
f as getDefaultTableCellSx,
|
|
56
|
-
|
|
56
|
+
S as getDefaultTableHeaderCellSx,
|
|
57
57
|
g as getDefaultTableHeaderLabelSx
|
|
58
58
|
};
|
|
59
59
|
//# sourceMappingURL=defaultTableStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultTableStyle.js","sources":["../../../../src/components/OwpTable/internal/defaultTableStyle.ts"],"sourcesContent":["import type { OwpResolvedTableThemeConfigType } from '@/constants/tableTheme';\
|
|
1
|
+
{"version":3,"file":"defaultTableStyle.js","sources":["../../../../src/components/OwpTable/internal/defaultTableStyle.ts"],"sourcesContent":["import type { OwpResolvedTableThemeConfigType } from '@/constants/tableTheme';\n\nconst DEFAULT_TABLE_CELL_PADDING = '7px 10px';\n\nexport const DEFAULT_TABLE_RADIUS = '.8rem';\nexport const DEFAULT_TABLE_HEADER_BACKGROUND_COLOR = '#f5f5f5';\n\nexport const defaultStyledTableTheme = {\n borderColor: '#e2e8f0',\n header: {\n backgroundColor: '',\n color: 'inherit',\n fontSize: '1.7rem',\n fontWeight: 600,\n },\n cell: {\n backgroundColor: '',\n fontSize: '1.7rem',\n },\n} satisfies OwpResolvedTableThemeConfigType;\n\n/** 기본 table cell 공통 sx */\nconst getDefaultTableCellBaseSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n padding: DEFAULT_TABLE_CELL_PADDING,\n borderBottom: `1px solid ${tableTheme.borderColor}`,\n borderLeft: 'none',\n borderRight: 'none',\n }) as const;\n\n/** 기본 table cell sx */\nexport const getDefaultTableCellSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n ...getDefaultTableCellBaseSx(tableTheme),\n ...(tableTheme.cell.backgroundColor && {\n backgroundColor: tableTheme.cell.backgroundColor,\n }),\n fontSize: tableTheme.cell.fontSize,\n }) as const;\n\n/** 기본 table header cell sx */\nexport const getDefaultTableHeaderCellSx = (\n tableTheme: OwpResolvedTableThemeConfigType,\n fallbackBackgroundColor: string = DEFAULT_TABLE_HEADER_BACKGROUND_COLOR,\n) =>\n ({\n ...getDefaultTableCellBaseSx(tableTheme),\n backgroundColor: tableTheme.header.backgroundColor || fallbackBackgroundColor,\n color: tableTheme.header.color,\n fontSize: tableTheme.header.fontSize,\n fontWeight: tableTheme.header.fontWeight,\n }) as const;\n\n/** 기본 table header label sx */\nexport const getDefaultTableHeaderLabelSx = (tableTheme: OwpResolvedTableThemeConfigType) =>\n ({\n color: tableTheme.header.color,\n fontSize: tableTheme.header.fontSize,\n fontWeight: tableTheme.header.fontWeight,\n }) as const;\n\nexport const defaultTableSortLabelSx = {\n '&.MuiTableSortLabel-root': {\n color: 'inherit',\n },\n '&.MuiTableSortLabel-root:hover': {\n color: 'inherit',\n },\n '&.Mui-active': {\n color: 'inherit',\n },\n '& .MuiTableSortLabel-icon': {\n color: 'currentColor !important',\n },\n} as const;\n"],"names":["DEFAULT_TABLE_CELL_PADDING","DEFAULT_TABLE_RADIUS","DEFAULT_TABLE_HEADER_BACKGROUND_COLOR","defaultStyledTableTheme","getDefaultTableCellBaseSx","__name","tableTheme","getDefaultTableCellSx","getDefaultTableHeaderCellSx","fallbackBackgroundColor","getDefaultTableHeaderLabelSx","defaultTableSortLabelSx"],"mappings":";;AAEA,MAAMA,IAA6B,YAEtBC,IAAuB,SACvBC,IAAwC,WAExCC,IAA0B;AAAA,EACrC,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,YAAY;AAAA,EAAA;AAAA,EAEd,MAAM;AAAA,IACJ,iBAAiB;AAAA,IACjB,UAAU;AAAA,EAAA;AAEd,GAGMC,IAA4B,gBAAAC,EAAA,CAACC,OAChC;AAAA,EACC,SAASN;AAAA,EACT,cAAc,aAAaM,EAAW,WAAW;AAAA,EACjD,YAAY;AAAA,EACZ,aAAa;AACf,IANgC,8BASrBC,IAAwB,gBAAAF,EAAA,CAACC,OACnC;AAAA,EACC,GAAGF,EAA0BE,CAAU;AAAA,EACvC,GAAIA,EAAW,KAAK,mBAAmB;AAAA,IACrC,iBAAiBA,EAAW,KAAK;AAAA,EAAA;AAAA,EAEnC,UAAUA,EAAW,KAAK;AAC5B,IAPmC,0BAUxBE,IAA8B,gBAAAH,EAAA,CACzCC,GACAG,IAAkCP,OAEjC;AAAA,EACC,GAAGE,EAA0BE,CAAU;AAAA,EACvC,iBAAiBA,EAAW,OAAO,mBAAmBG;AAAA,EACtD,OAAOH,EAAW,OAAO;AAAA,EACzB,UAAUA,EAAW,OAAO;AAAA,EAC5B,YAAYA,EAAW,OAAO;AAChC,IAVyC,gCAa9BI,IAA+B,gBAAAL,EAAA,CAACC,OAC1C;AAAA,EACC,OAAOA,EAAW,OAAO;AAAA,EACzB,UAAUA,EAAW,OAAO;AAAA,EAC5B,YAAYA,EAAW,OAAO;AAChC,IAL0C,iCAO/BK,IAA0B;AAAA,EACrC,4BAA4B;AAAA,IAC1B,OAAO;AAAA,EAAA;AAAA,EAET,kCAAkC;AAAA,IAChC,OAAO;AAAA,EAAA;AAAA,EAET,gBAAgB;AAAA,IACd,OAAO;AAAA,EAAA;AAAA,EAET,6BAA6B;AAAA,IAC3B,OAAO;AAAA,EAAA;AAEX;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var t = Object.defineProperty;
|
|
2
|
+
var n = (r, e) => t(r, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { isArray as u } from "../../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
|
|
4
|
+
const p = /* @__PURE__ */ n((...r) => r.reduce((e, o) => o ? [...e, ...u(o) ? o : [o]] : e, []), "mergeSx"), f = /* @__PURE__ */ n((r) => typeof r == "number" ? `${r}px` : r, "toTableRadiusCssValue");
|
|
5
|
+
export {
|
|
6
|
+
p as mergeSx,
|
|
7
|
+
f as toTableRadiusCssValue
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=tableSx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableSx.js","sources":["../../../../src/components/OwpTable/utils/tableSx.ts"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material';\nimport { isArray } from 'es-toolkit/compat';\n\n/**\n * sx 조건부 배열 병합\n * @param styles sx 목록\n */\nexport const mergeSx = (...styles: Array<SxProps<Theme> | undefined | false>): SxProps<Theme> =>\n styles.reduce<Array<Exclude<SxProps<Theme>, readonly unknown[]>>>((acc, style) => {\n if (!style) {\n return acc;\n }\n\n return [...acc, ...(isArray(style) ? style : [style])];\n }, []) as SxProps<Theme>;\n\n/**\n * table radius CSS 값 변환\n * @param value radius 값\n */\nexport const toTableRadiusCssValue = (value: number | string) => {\n return typeof value === 'number' ? `${value}px` : value;\n};\n"],"names":["mergeSx","__name","styles","acc","style","isArray","toTableRadiusCssValue","value"],"mappings":";;;AAOO,MAAMA,IAAU,gBAAAC,EAAA,IAAIC,MACzBA,EAAO,OAA2D,CAACC,GAAKC,MACjEA,IAIE,CAAC,GAAGD,GAAK,GAAIE,EAAQD,CAAK,IAAIA,IAAQ,CAACA,CAAK,CAAE,IAH5CD,GAIR,CAAA,CAAE,GAPgB,YAaVG,IAAwB,gBAAAL,EAAA,CAACM,MAC7B,OAAOA,KAAU,WAAW,GAAGA,CAAK,OAAOA,GADf;"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { FormHelperText as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
1
|
+
var E = Object.defineProperty;
|
|
2
|
+
var s = (e, r) => E(e, "name", { value: r, configurable: !0 });
|
|
3
|
+
import { jsxs as j, jsx as V } 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 y } from "@mui/material";
|
|
5
|
+
import z from "@mui/material/FormControl";
|
|
6
|
+
import A from "@mui/material/FilledInput";
|
|
7
|
+
import H from "@mui/material/Input";
|
|
8
|
+
import L from "@mui/material/InputLabel";
|
|
9
|
+
import P from "@mui/material/OutlinedInput";
|
|
10
|
+
import { useId as $, forwardRef as b, useRef as c, useEffect as k } from "react";
|
|
11
|
+
import { InputMask as q } from "imask";
|
|
12
|
+
function B(e, r) {
|
|
11
13
|
if (typeof e == "function") {
|
|
12
14
|
e(r);
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
15
17
|
e && (e.current = r);
|
|
16
18
|
}
|
|
17
|
-
|
|
19
|
+
s(B, "assignInputRef");
|
|
18
20
|
function T({
|
|
19
21
|
mask: e,
|
|
20
22
|
definitions: r
|
|
@@ -25,133 +27,140 @@ function T({
|
|
|
25
27
|
overwrite: !0
|
|
26
28
|
};
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
+
s(T, "buildTextMaskOptions");
|
|
31
|
+
const D = b(/* @__PURE__ */ s(function(r, h) {
|
|
30
32
|
const {
|
|
31
|
-
onMaskChange:
|
|
32
|
-
mask:
|
|
33
|
-
definitions:
|
|
33
|
+
onMaskChange: l,
|
|
34
|
+
mask: i,
|
|
35
|
+
definitions: m,
|
|
34
36
|
name: f,
|
|
35
37
|
value: o,
|
|
36
|
-
defaultValue:
|
|
37
|
-
ownerState:
|
|
38
|
-
as:
|
|
39
|
-
onChange:
|
|
40
|
-
...
|
|
41
|
-
} = r,
|
|
42
|
-
|
|
43
|
-
g.current =
|
|
44
|
-
}, [
|
|
45
|
-
|
|
46
|
-
}, [f]),
|
|
47
|
-
const n =
|
|
38
|
+
defaultValue: I,
|
|
39
|
+
ownerState: S,
|
|
40
|
+
as: x,
|
|
41
|
+
onChange: w,
|
|
42
|
+
...O
|
|
43
|
+
} = r, a = c(null), u = c(null), g = c(l), C = c(f), M = c(T({ mask: i, definitions: m })), p = c(o !== void 0 ? o : I);
|
|
44
|
+
k(() => {
|
|
45
|
+
g.current = l;
|
|
46
|
+
}, [l]), k(() => {
|
|
47
|
+
C.current = f;
|
|
48
|
+
}, [f]), k(() => {
|
|
49
|
+
const n = a.current;
|
|
48
50
|
if (!n)
|
|
49
51
|
return;
|
|
50
|
-
const t = new
|
|
52
|
+
const t = new q(
|
|
51
53
|
n,
|
|
52
|
-
|
|
53
|
-
),
|
|
54
|
+
M.current
|
|
55
|
+
), R = /* @__PURE__ */ s(() => {
|
|
54
56
|
g.current({
|
|
55
57
|
target: {
|
|
56
|
-
name:
|
|
58
|
+
name: C.current ?? n.name ?? "",
|
|
57
59
|
value: t.value
|
|
58
60
|
},
|
|
59
61
|
unmaskedValue: t.unmaskedValue
|
|
60
62
|
});
|
|
61
63
|
}, "emitMaskChange");
|
|
62
|
-
if (t.on("accept",
|
|
63
|
-
const
|
|
64
|
-
t.value !==
|
|
64
|
+
if (t.on("accept", R), u.current = t, p.current !== void 0) {
|
|
65
|
+
const d = p.current == null ? "" : String(p.current);
|
|
66
|
+
t.value !== d && (t.value = d);
|
|
65
67
|
}
|
|
66
68
|
return () => {
|
|
67
|
-
t.off("accept",
|
|
69
|
+
t.off("accept", R), t.destroy(), u.current === t && (u.current = null);
|
|
68
70
|
};
|
|
69
|
-
}, []),
|
|
71
|
+
}, []), k(() => {
|
|
70
72
|
const n = u.current;
|
|
71
|
-
n && n.updateOptions(T({ mask:
|
|
72
|
-
}, [
|
|
73
|
+
n && n.updateOptions(T({ mask: i, definitions: m }));
|
|
74
|
+
}, [i, m]), k(() => {
|
|
73
75
|
const n = u.current;
|
|
74
76
|
if (!n || o === void 0)
|
|
75
77
|
return;
|
|
76
78
|
const t = o == null ? "" : String(o);
|
|
77
79
|
n.value !== t && (n.value = t);
|
|
78
80
|
}, [o]);
|
|
79
|
-
const
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
+
const v = o !== void 0 ? o : I, F = v == null ? "" : String(v);
|
|
82
|
+
return /* @__PURE__ */ V(
|
|
81
83
|
"input",
|
|
82
84
|
{
|
|
83
|
-
...
|
|
84
|
-
defaultValue:
|
|
85
|
-
onChange:
|
|
86
|
-
ref: /* @__PURE__ */
|
|
87
|
-
|
|
85
|
+
...O,
|
|
86
|
+
defaultValue: F,
|
|
87
|
+
onChange: w,
|
|
88
|
+
ref: /* @__PURE__ */ s((n) => {
|
|
89
|
+
a.current = n, B(h, n);
|
|
88
90
|
}, "ref")
|
|
89
91
|
}
|
|
90
92
|
);
|
|
91
93
|
}, "TextMaskCustom2"));
|
|
92
|
-
function
|
|
94
|
+
function nn({
|
|
93
95
|
className: e,
|
|
94
96
|
sx: r,
|
|
95
97
|
id: h,
|
|
96
|
-
name:
|
|
97
|
-
label:
|
|
98
|
-
value:
|
|
98
|
+
name: l,
|
|
99
|
+
label: i,
|
|
100
|
+
value: m,
|
|
99
101
|
defaultValue: f,
|
|
100
102
|
color: o,
|
|
101
|
-
onChange:
|
|
102
|
-
error:
|
|
103
|
-
helperText:
|
|
104
|
-
mask:
|
|
105
|
-
definitions:
|
|
106
|
-
variant:
|
|
103
|
+
onChange: I,
|
|
104
|
+
error: S,
|
|
105
|
+
helperText: x,
|
|
106
|
+
mask: w,
|
|
107
|
+
definitions: O,
|
|
108
|
+
variant: a,
|
|
107
109
|
fullWidth: u,
|
|
108
110
|
disabled: g,
|
|
109
|
-
required:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
required: C,
|
|
112
|
+
size: M,
|
|
113
|
+
placeholder: p,
|
|
114
|
+
autoFocus: v,
|
|
115
|
+
inputProps: F,
|
|
116
|
+
inputRef: n,
|
|
117
|
+
...t
|
|
114
118
|
}) {
|
|
115
|
-
const
|
|
116
|
-
return /* @__PURE__ */
|
|
117
|
-
|
|
119
|
+
const R = $(), d = h ?? `text-mask-input-${R}`;
|
|
120
|
+
return /* @__PURE__ */ j(
|
|
121
|
+
z,
|
|
118
122
|
{
|
|
123
|
+
className: e,
|
|
119
124
|
color: o,
|
|
120
|
-
variant:
|
|
125
|
+
variant: a,
|
|
121
126
|
fullWidth: u,
|
|
122
|
-
error:
|
|
127
|
+
error: S,
|
|
123
128
|
disabled: g,
|
|
124
|
-
required:
|
|
129
|
+
required: C,
|
|
130
|
+
size: M,
|
|
131
|
+
sx: r,
|
|
125
132
|
children: [
|
|
126
|
-
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
|
|
133
|
+
i ? /* @__PURE__ */ V(L, { htmlFor: d, children: i }) : null,
|
|
134
|
+
/* @__PURE__ */ V(
|
|
135
|
+
a === "outlined" ? P : a === "filled" ? A : H,
|
|
129
136
|
{
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
value:
|
|
137
|
+
...t,
|
|
138
|
+
...a === "outlined" ? { label: i } : void 0,
|
|
139
|
+
value: m,
|
|
133
140
|
defaultValue: f,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
fullWidth: u,
|
|
142
|
+
name: l,
|
|
143
|
+
id: d,
|
|
144
|
+
size: M,
|
|
145
|
+
placeholder: p,
|
|
146
|
+
autoFocus: v,
|
|
147
|
+
inputRef: n,
|
|
148
|
+
inputComponent: D,
|
|
140
149
|
inputProps: {
|
|
141
|
-
...
|
|
142
|
-
onMaskChange:
|
|
143
|
-
mask:
|
|
144
|
-
definitions:
|
|
150
|
+
...F,
|
|
151
|
+
onMaskChange: I,
|
|
152
|
+
mask: w,
|
|
153
|
+
definitions: O
|
|
145
154
|
}
|
|
146
155
|
}
|
|
147
156
|
),
|
|
148
|
-
|
|
157
|
+
x ? /* @__PURE__ */ V(y, { children: x }) : null
|
|
149
158
|
]
|
|
150
159
|
}
|
|
151
160
|
);
|
|
152
161
|
}
|
|
153
|
-
|
|
162
|
+
s(nn, "OwpTextMaskField");
|
|
154
163
|
export {
|
|
155
|
-
|
|
164
|
+
nn as OwpTextMaskField
|
|
156
165
|
};
|
|
157
166
|
//# 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 {\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","FormHel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B,GAAA,EAAgB,UAAAhB,EAAA,CAAW,IAAoB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGpE;AAzDgBtC,EAAA+B,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 FilledInput from '@mui/material/FilledInput';\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 OutlinedInput from '@mui/material/OutlinedInput';\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\nexport type OwpTextMaskFieldChangeEvent = {\n target: { name: string; value: string };\n unmaskedValue: string;\n};\n\ntype TextMaskValue = FactoryOpts['mask'];\n\ninterface CustomProps {\n onMaskChange: (event: OwpTextMaskFieldChangeEvent) => 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 size,\n placeholder,\n autoFocus,\n inputProps,\n inputRef,\n ...inputBaseProps\n}: OwpTextMaskFieldProps) {\n const generatedId = useId();\n const id = idProp ?? `text-mask-input-${generatedId}`;\n const InputComponent = (\n variant === 'outlined' ? OutlinedInput : variant === 'filled' ? FilledInput : Input\n ) as typeof Input;\n\n return (\n <FormControl\n className={className}\n color={color}\n variant={variant}\n fullWidth={fullWidth}\n error={error}\n disabled={disabled}\n required={required}\n size={size}\n sx={sx}\n >\n {label ? <InputLabel htmlFor={id}>{label}</InputLabel> : null}\n <InputComponent\n {...inputBaseProps}\n {...(variant === 'outlined' ? { label } : undefined)}\n value={value}\n defaultValue={defaultValue}\n fullWidth={fullWidth}\n name={name}\n id={id}\n size={size}\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","size","placeholder","autoFocus","inputProps","inputRef","inputBaseProps","generatedId","useId","id","jsxs","FormControl","InputLabel","OutlinedInput","FilledInput","Input","FormHelperText"],"mappings":";;;;;;;;;;;AAkDA,SAASA,EAAkBC,GAAsBC,GAAiB;AAChE,MAAI,OAAOD,KAAQ,YAAY;AAC7B,IAAAA,EAAIC,CAAK;AACT;AAAA,EACF;AAEA,EAAID,MACFA,EAAI,UAAUC;AAElB;AATSC,EAAAH,GAAA;AAYT,SAASI,EAAqB;AAAA,EAC5B,MAAAC;AAAA,EACA,aAAAC;AACF,GAA+D;AAC7D,SAAO;AAAA,IACL,MAAAD;AAAA,IACA,aAAAC;AAAA,IACA,WAAW;AAAA,EAAA;AAEf;AATSH,EAAAC,GAAA;AAWT,MAAMG,IAAiBC,EAAkD,gBAAAL,EAAA,SACvEM,GACAR,GACA;AACA,QAAM;AAAA,IACJ,cAAAS;AAAA,IACA,MAAAL;AAAA,IACA,aAAAC;AAAA,IACA,MAAAK;AAAA,IACA,OAAAT;AAAA,IACA,cAAAU;AAAA,IACA,YAAYC;AAAA,IACZ,IAAIC;AAAA,IACJ,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDP,GACEQ,IAAkBC,EAAgC,IAAI,GACtDC,IAAUD,EAAuC,IAAI,GACrDE,IAAkBF,EAAOR,CAAY,GACrCW,IAAUH,EAAOP,CAAI,GACrBW,IAAwBJ,EAAOd,EAAqB,EAAE,MAAAC,GAAM,aAAAC,EAAA,CAAa,CAA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