@owp/core 2.5.3 → 2.5.4

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.
Files changed (65) hide show
  1. package/dist/_virtual/index11.js +2 -2
  2. package/dist/_virtual/index13.js +2 -2
  3. package/dist/_virtual/index14.js +2 -2
  4. package/dist/_virtual/index15.js +2 -2
  5. package/dist/components/OwpMrtTable/OwpMrtTable.js +250 -258
  6. package/dist/components/OwpMrtTable/OwpMrtTable.js.map +1 -1
  7. package/dist/components/OwpSnackbarContent/OwpSnackbarContent.js +166 -0
  8. package/dist/components/OwpSnackbarContent/OwpSnackbarContent.js.map +1 -0
  9. package/dist/components/OwpTable/OwpDataTable.js +316 -288
  10. package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
  11. package/dist/components/OwpTable/OwpFieldTable.js +102 -58
  12. package/dist/components/OwpTable/OwpFieldTable.js.map +1 -1
  13. package/dist/components/OwpTable/OwpTable.js +163 -164
  14. package/dist/components/OwpTable/OwpTable.js.map +1 -1
  15. package/dist/components/OwpTable/internal/treeGridTableStyle.js +77 -0
  16. package/dist/components/OwpTable/internal/treeGridTableStyle.js.map +1 -0
  17. package/dist/components/OwpTreeGrid/OwpTreeGrid.js +197 -252
  18. package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
  19. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js +172 -131
  20. package/dist/components/OwpTreeGrid/internal/treeGridRuntime.js.map +1 -1
  21. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +462 -0
  22. package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -0
  23. package/dist/configs/defaultConfig.js +67 -44
  24. package/dist/configs/defaultConfig.js.map +1 -1
  25. package/dist/constants/gridTheme.js +60 -10
  26. package/dist/constants/gridTheme.js.map +1 -1
  27. package/dist/constants/tableTheme.js +16 -0
  28. package/dist/constants/tableTheme.js.map +1 -0
  29. package/dist/constants/treeGrid.js +44 -26
  30. package/dist/constants/treeGrid.js.map +1 -1
  31. package/dist/constants.js +21 -20
  32. package/dist/contexts/OwpUiProvider.js +59 -38
  33. package/dist/contexts/OwpUiProvider.js.map +1 -1
  34. package/dist/index.js +111 -110
  35. package/dist/layout/components/toolbar/ToolbarLayout.js +5 -4
  36. package/dist/layout/components/toolbar/ToolbarLayout.js.map +1 -1
  37. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE128/index.js +1 -1
  38. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE39/index.js +1 -1
  39. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/CODE93/index.js +1 -1
  40. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/EAN_UPC/index.js +1 -1
  41. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/GenericBarcode/index.js +1 -1
  42. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/ITF/index.js +1 -1
  43. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/MSI/index.js +1 -1
  44. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/codabar/index.js +1 -1
  45. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/barcodes/pharmacode/index.js +1 -1
  46. package/dist/node_modules/.pnpm/jsbarcode@3.12.1/node_modules/jsbarcode/bin/renderers/index.js +1 -1
  47. package/dist/types/components/OwpSnackbarContent/OwpSnackbarContent.d.ts +2 -0
  48. package/dist/types/components/OwpTable/OwpTable.d.ts +3 -1
  49. package/dist/types/components/OwpTable/internal/treeGridTableStyle.d.ts +105 -0
  50. package/dist/types/components/OwpTreeGrid/internal/treeGridRuntime.d.ts +5 -1
  51. package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +20 -0
  52. package/dist/types/configs/defaultConfig.d.ts +22 -0
  53. package/dist/types/constants/gridTheme.d.ts +58 -0
  54. package/dist/types/constants/tableTheme.d.ts +18 -0
  55. package/dist/types/constants/treeGrid.d.ts +5 -0
  56. package/dist/types/types/OwpGridThemeTypes.d.ts +34 -0
  57. package/dist/types/types/OwpSettingsTypes.d.ts +9 -0
  58. package/dist/types/types/OwpTableThemeTypes.d.ts +16 -0
  59. package/dist/types/types/index.d.ts +3 -2
  60. package/dist/types/utils/treeGridUtil.d.ts +1 -0
  61. package/dist/utils/exceljsBrowser.js +45 -48
  62. package/dist/utils/exceljsBrowser.js.map +1 -1
  63. package/dist/utils/treeGridUtil.js +66 -66
  64. package/dist/utils/treeGridUtil.js.map +1 -1
  65. package/package.json +1 -1
@@ -1,78 +1,85 @@
1
- var Ft = Object.defineProperty;
2
- var n = (t, o) => Ft(t, "name", { value: o, configurable: !0 });
3
- import { jsxs as z, 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 { resolveOwpGridTheme as $t } from "../../constants/gridTheme.js";
5
- import { getTreeGridFontFaceStyles as It, TREEGRID_FONT_FAMILY_STACK as Nt } from "../../constants/treeGrid.js";
1
+ var Tt = Object.defineProperty;
2
+ var s = (t, o) => Tt(t, "name", { value: o, configurable: !0 });
3
+ import { jsxs as M, jsx as f } 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 { resolveOwpGridTheme as zt } from "../../constants/gridTheme.js";
5
+ import { resolveOwpTableTheme as Ft } from "../../constants/tableTheme.js";
6
+ import { getTreeGridFontFaceStyles as Ct } from "../../constants/treeGrid.js";
6
7
  import { useGetCurrentSettings as Mt } from "../../hooks/useOwpSettings.js";
7
- import { TextField as yt, Divider as Ht, Typography as Z } from "@mui/material";
8
- import ft, { checkboxClasses as Dt } from "@mui/material/Checkbox";
9
- import { grey as F } from "@mui/material/colors";
10
- import Et from "@mui/material/GlobalStyles";
11
- import Ot from "@mui/material/Paper";
12
- import zt from "@mui/material/Table";
13
- import Bt from "@mui/material/TableBody";
14
- import B from "@mui/material/TableCell";
15
- import Ct from "@mui/material/TableContainer";
16
- import Wt from "@mui/material/TableHead";
17
- import bt from "@mui/material/TableRow";
18
- import Vt from "@mui/material/TableSortLabel";
19
- import { useState as J, useRef as _t, useMemo as y, useEffect as dt } from "react";
20
- import { uniqueId as qt } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/util/uniqueId.js";
21
- import { isEmpty as Pt } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
22
- import { isEqual as Q } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
23
- import { OwpNumberField as Tt } from "../OwpNumberField/OwpNumberField.js";
24
- import { isNumber as H } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
25
- import { isArray as xt } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
26
- import { isBoolean as ut } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isBoolean.js";
27
- const ct = {
28
- bgcolor: "#586980",
8
+ import { TextField as Nt, Divider as Wt, Typography as it } from "@mui/material";
9
+ import $t, { checkboxClasses as Vt } from "@mui/material/Checkbox";
10
+ import { grey as I } from "@mui/material/colors";
11
+ import qt from "@mui/material/GlobalStyles";
12
+ import Pt from "@mui/material/Paper";
13
+ import jt from "@mui/material/Table";
14
+ import Kt from "@mui/material/TableBody";
15
+ import N from "@mui/material/TableCell";
16
+ import yt from "@mui/material/TableContainer";
17
+ import Yt from "@mui/material/TableHead";
18
+ import Dt from "@mui/material/TableRow";
19
+ import Jt from "@mui/material/TableSortLabel";
20
+ import { useState as X, useRef as Qt, useMemo as D, useEffect as lt } from "react";
21
+ import { getTreeGridBodyCellSx as Z, TREEGRID_TABLE_BODY_BORDER_COLOR as Xt, getTreeGridBodyRowSx as Zt, getTreeGridContainerSx as G, getTreeGridHeaderCellSx as pt, TREEGRID_TABLE_HEADER_BORDER_COLOR as Gt } from "./internal/treeGridTableStyle.js";
22
+ import { uniqueId as Ut } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/util/uniqueId.js";
23
+ import { isEmpty as to } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isEmpty.js";
24
+ import { isEqual as U } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/predicate/isEqual.js";
25
+ import { OwpNumberField as oo } from "../OwpNumberField/OwpNumberField.js";
26
+ import { isNumber as T } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isNumber.js";
27
+ import { isArray as Ht } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isArray.js";
28
+ import { isBoolean as bt } from "../../node_modules/.pnpm/es-toolkit@1.39.10/node_modules/es-toolkit/dist/compat/predicate/isBoolean.js";
29
+ const xt = /* @__PURE__ */ s((t) => ({
30
+ bgcolor: t.header.backgroundColor,
31
+ borderBottom: `1px solid ${at}`,
29
32
  borderTopLeftRadius: "inherit",
30
33
  borderTopRightRadius: "inherit"
31
- }, mt = {
32
- borderRight: `1px solid ${F.A200}`
33
- }, X = {
34
- borderRight: `1px solid ${F[400]}`
35
- }, jt = {
34
+ }), "defaultHeadCellsSx"), Rt = {
35
+ borderRight: `1px solid ${Gt}`
36
+ }, at = I[400], tt = {
37
+ borderRight: `1px solid ${at}`
38
+ }, ot = {
39
+ borderRight: `1px solid ${Xt}`
40
+ }, Lt = 34, eo = {
41
+ header: {
42
+ backgroundColor: "#586980",
43
+ color: "#ffffff",
44
+ fontSize: "1.4rem",
45
+ fontWeight: 500
46
+ },
47
+ cell: {
48
+ fontSize: "1.3rem"
49
+ }
50
+ }, et = /* @__PURE__ */ s((t) => ({
51
+ fontSize: t.cell.fontSize
52
+ }), "getDefaultTableBodyCellSx"), vt = {
53
+ borderRight: `1px solid ${at}`
54
+ }, rt = {
55
+ height: Lt,
56
+ minHeight: Lt,
57
+ py: 0
58
+ }, At = /* @__PURE__ */ s((t) => ({
59
+ color: t.header.color,
60
+ fontSize: t.header.fontSize,
61
+ fontWeight: t.header.fontWeight
62
+ }), "getDefaultTableHeaderLabelSx"), ro = {
36
63
  "&.MuiTableSortLabel-root": {
37
- color: F.A100
64
+ color: I.A100
38
65
  },
39
66
  "&.MuiTableSortLabel-root:hover": {
40
- color: F.A100
67
+ color: I.A100
41
68
  },
42
69
  "&.Mui-active": {
43
- color: F.A100
70
+ color: I.A100
44
71
  },
45
72
  "& .MuiTableSortLabel-icon": {
46
- color: `${F.A100} !important`
73
+ color: `${I.A100} !important`
47
74
  }
48
- }, g = {
75
+ }, l = {
49
76
  borderRadius: 0
50
- }, Kt = {
77
+ }, io = {
51
78
  "& > th, & > td": {
52
79
  borderBottomLeftRadius: 0,
53
80
  borderBottomRightRadius: 0
54
81
  }
55
- }, vt = /* @__PURE__ */ n((t) => ({
56
- fontFamily: Nt,
57
- fontSize: t,
58
- fontWeight: "normal",
59
- lineHeight: "16px",
60
- boxSizing: "border-box",
61
- overflow: "hidden",
62
- textOverflow: "ellipsis",
63
- verticalAlign: "middle",
64
- whiteSpace: "nowrap"
65
- }), "getTreeGridCellBaseSx"), lt = /* @__PURE__ */ n((t) => ({
66
- ...vt(t.header.fontSize),
67
- bgcolor: t.header.backgroundColor,
68
- borderBottom: "1px solid #6F7F94",
69
- borderRight: "1px solid #6F7F94",
70
- color: t.header.color,
71
- fontWeight: t.header.fontWeight,
72
- height: t.header.height,
73
- minHeight: t.header.height,
74
- p: "7px 2px 6px 10px"
75
- }), "getTreeGridHeaderCellSx"), Yt = {
82
+ }, no = {
76
83
  "&.MuiTableSortLabel-root": {
77
84
  color: "inherit",
78
85
  display: "flex",
@@ -99,16 +106,10 @@ const ct = {
99
106
  position: "absolute",
100
107
  right: 0
101
108
  }
102
- }, G = /* @__PURE__ */ n((t) => ({
103
- ...vt(t.cell.fontSize),
104
- borderBottom: "1px solid #CDD8E4",
105
- borderRight: "1px solid #CDD8E4",
106
- color: "#111112",
107
- p: "7px 10px 6px"
108
- }), "getTreeGridBodyCellSx"), m = /* @__PURE__ */ n((...t) => t.reduce((o, i) => i ? [...o, ...xt(i) ? i : [i]] : o, []), "mergeSx"), Jt = /* @__PURE__ */ n((t) => {
109
- if (!(!H(t) || t < 1))
109
+ }, m = /* @__PURE__ */ s((...t) => t.reduce((o, i) => i ? [...o, ...Ht(i) ? i : [i]] : o, []), "mergeSx"), so = /* @__PURE__ */ s((t) => {
110
+ if (!(!T(t) || t < 1))
110
111
  return t;
111
- }, "getFixedRowCount"), Qt = /* @__PURE__ */ n((t) => Array.from({ length: t }, () => ({})), "createEmptyRows"), U = /* @__PURE__ */ n((t, o) => {
112
+ }, "getFixedRowCount"), ao = /* @__PURE__ */ s((t) => Array.from({ length: t }, () => ({})), "createEmptyRows"), nt = /* @__PURE__ */ s((t, o) => {
112
113
  switch (t) {
113
114
  case "center":
114
115
  case "right":
@@ -119,35 +120,35 @@ const ct = {
119
120
  default:
120
121
  return o;
121
122
  }
122
- }, "getTableCellAlign"), C = /* @__PURE__ */ n((t, o) => {
123
+ }, "getTableCellAlign"), W = /* @__PURE__ */ s((t, o) => {
123
124
  if (o)
124
125
  return t == null ? void 0 : t[o];
125
- }, "getRowValue"), ht = /* @__PURE__ */ n((t) => {
126
- if (typeof t == "string" || H(t))
126
+ }, "getRowValue"), wt = /* @__PURE__ */ s((t) => {
127
+ if (typeof t == "string" || T(t))
127
128
  return t;
128
129
  }, "getComparableValue");
129
- function gt(t, o, i) {
130
- const c = ht(C(t, i)), l = ht(C(o, i));
131
- return l == null && c == null ? 0 : l == null ? -1 : c == null ? 1 : l < c ? -1 : l > c ? 1 : 0;
130
+ function kt(t, o, i) {
131
+ const c = wt(W(t, i)), g = wt(W(o, i));
132
+ return g == null && c == null ? 0 : g == null ? -1 : c == null ? 1 : g < c ? -1 : g > c ? 1 : 0;
132
133
  }
133
- n(gt, "descendingComparator");
134
- function Xt(t, o) {
135
- return t === "desc" ? (i, c) => gt(i, c, o) : (i, c) => -gt(i, c, o);
134
+ s(kt, "descendingComparator");
135
+ function uo(t, o) {
136
+ return t === "desc" ? (i, c) => kt(i, c, o) : (i, c) => -kt(i, c, o);
136
137
  }
137
- n(Xt, "getComparator");
138
- const tt = /* @__PURE__ */ n((t, o) => {
138
+ s(uo, "getComparator");
139
+ const st = /* @__PURE__ */ s((t, o) => {
139
140
  if (o)
140
- return C(t, o);
141
- }, "getRowRangeValue"), Gt = /* @__PURE__ */ n((t, o) => {
142
- var c, l, f, v;
141
+ return W(t, o);
142
+ }, "getRowRangeValue"), fo = /* @__PURE__ */ s((t, o) => {
143
+ var c, g, x, A;
143
144
  if (!(o.inputLabel ?? o.rangeKey))
144
145
  return "";
145
- const i = tt(t, o.rangeKey);
146
- return `${(c = o.rangeLabel) != null && c.start ? `${(l = o.rangeLabel) == null ? void 0 : l.start}: ` : ""}${i == null ? void 0 : i.start} ~ ${(f = o.rangeLabel) != null && f.end ? `${(v = o.rangeLabel) == null ? void 0 : v.end}: ` : ""}${i == null ? void 0 : i.end}`;
147
- }, "getRangeLabel"), Zt = /* @__PURE__ */ n((t, o) => {
148
- const i = C(t, "index");
149
- return H(i) ? i : o;
150
- }, "getRowTabIndex"), pt = /* @__PURE__ */ n((t, o) => ({
146
+ const i = st(t, o.rangeKey);
147
+ return `${(c = o.rangeLabel) != null && c.start ? `${(g = o.rangeLabel) == null ? void 0 : g.start}: ` : ""}${i == null ? void 0 : i.start} ~ ${(x = o.rangeLabel) != null && x.end ? `${(A = o.rangeLabel) == null ? void 0 : A.end}: ` : ""}${i == null ? void 0 : i.end}`;
148
+ }, "getRangeLabel"), mo = /* @__PURE__ */ s((t, o) => {
149
+ const i = W(t, "index");
150
+ return T(i) ? i : o;
151
+ }, "getRowTabIndex"), Et = /* @__PURE__ */ s((t, o) => ({
151
152
  "& input": {
152
153
  fontSize: o,
153
154
  textAlign: t ?? "center"
@@ -157,337 +158,361 @@ const tt = /* @__PURE__ */ n((t, o) => {
157
158
  },
158
159
  height: 34
159
160
  }), "getEditableCellSx");
160
- function Ut(t) {
161
+ function co(t) {
161
162
  const {
162
163
  sx: o,
163
164
  headCells: i,
164
165
  onSelectAllClick: c,
165
- order: l,
166
- orderBy: f,
167
- numSelected: v,
168
- rowCount: $,
169
- onRequestSort: W,
170
- canCheckbox: j,
166
+ order: g,
167
+ orderBy: x,
168
+ numSelected: A,
169
+ rowCount: H,
170
+ onRequestSort: V,
171
+ canCheckbox: Y,
171
172
  canUseOrderBy: h = !0,
172
- canTableRadiusZero: s,
173
- canUseTreeGridStyle: p,
174
- gridTheme: k
175
- } = t, R = /* @__PURE__ */ n((r) => (L) => {
176
- W(L, r);
173
+ canTableRadiusZero: e,
174
+ canUseTreeGridStyle: u,
175
+ gridTheme: E,
176
+ tableTheme: p
177
+ } = t, R = /* @__PURE__ */ s((n) => (O) => {
178
+ V(O, n);
177
179
  }, "createSortHandler");
178
- return /* @__PURE__ */ a(Wt, { sx: m(s && g), children: /* @__PURE__ */ z(
179
- bt,
180
+ return /* @__PURE__ */ f(Yt, { sx: m(e && l), children: /* @__PURE__ */ M(
181
+ Dt,
180
182
  {
181
183
  sx: m(
182
- p && { height: k.header.height },
183
- s && g
184
+ !u && rt,
185
+ u && { height: E.header.height },
186
+ e && l
184
187
  ),
185
188
  children: [
186
- j && /* @__PURE__ */ a(
187
- B,
189
+ Y && /* @__PURE__ */ f(
190
+ N,
188
191
  {
189
192
  padding: "checkbox",
190
- className: "text-white",
191
193
  sx: m(
192
194
  {
193
- ...ct,
194
- ...mt
195
+ ...xt(p)
195
196
  },
196
- p && lt(k),
197
- s && g,
197
+ !u && vt,
198
+ !u && rt,
199
+ u && Rt,
200
+ u && pt(E),
201
+ e && l,
198
202
  o
199
203
  ),
200
- children: /* @__PURE__ */ a(
201
- ft,
204
+ children: /* @__PURE__ */ f(
205
+ $t,
202
206
  {
203
207
  color: "default",
204
208
  sx: m(
205
209
  {
206
- [`&, &.${Dt.checked}`]: {
207
- color: F[50]
210
+ [`&, &.${Vt.checked}`]: {
211
+ color: I[50]
208
212
  }
209
213
  },
210
- p && { p: 0 }
214
+ u && { p: 0 }
211
215
  ),
212
- indeterminate: v > 0 && v < $,
213
- checked: $ > 0 && v === $,
216
+ indeterminate: A > 0 && A < H,
217
+ checked: H > 0 && A === H,
214
218
  onChange: c
215
219
  }
216
220
  )
217
221
  }
218
222
  ),
219
- i.map((r, L) => /* @__PURE__ */ a(
220
- B,
223
+ i.map((n, O) => /* @__PURE__ */ f(
224
+ N,
221
225
  {
222
- className: p ? void 0 : "pl-20",
223
- align: U(r.align, "center"),
224
- padding: r.enablePadding ? "normal" : "none",
225
- sortDirection: f === r.id ? l : !1,
226
+ className: u ? void 0 : "pl-20",
227
+ align: nt(n.align, "center"),
228
+ padding: n.enablePadding ? "normal" : "none",
229
+ sortDirection: x === n.id ? g : !1,
226
230
  sx: m(
227
231
  {
228
- ...ct,
229
- ...i.length - 1 !== L && mt
232
+ ...xt(p)
230
233
  },
231
- p && lt(k),
232
- s && g,
234
+ !u && i.length - 1 !== O && vt,
235
+ !u && rt,
236
+ u && i.length - 1 !== O && Rt,
237
+ u && pt(E),
238
+ e && l,
233
239
  o,
234
- p && (r == null ? void 0 : r.sx)
240
+ u && (n == null ? void 0 : n.sx)
235
241
  ),
236
- children: h ? /* @__PURE__ */ a(
237
- Vt,
242
+ children: h ? /* @__PURE__ */ f(
243
+ Jt,
238
244
  {
239
- sx: p ? Yt : jt,
240
- active: f === r.id,
241
- direction: f === r.id ? l : "asc",
242
- onClick: R(r.id),
243
- children: p ? r.label : /* @__PURE__ */ a(Z, { className: "text-white text-lg font-medium", sx: r == null ? void 0 : r.sx, children: r.label })
245
+ sx: u ? no : ro,
246
+ active: x === n.id,
247
+ direction: x === n.id ? g : "asc",
248
+ onClick: R(n.id),
249
+ children: u ? n.label : /* @__PURE__ */ f(it, { sx: m(At(p), n == null ? void 0 : n.sx), children: n.label })
244
250
  }
245
- ) : p ? r.label : /* @__PURE__ */ a(Z, { className: "text-white text-lg font-medium", sx: r == null ? void 0 : r.sx, children: r.label })
251
+ ) : u ? n.label : /* @__PURE__ */ f(it, { sx: m(At(p), n == null ? void 0 : n.sx), children: n.label })
246
252
  },
247
- r.id
253
+ n.id
248
254
  ))
249
255
  ]
250
256
  }
251
257
  ) });
252
258
  }
253
- n(Ut, "DataTableHead");
254
- function Fo({
259
+ s(co, "DataTableHead");
260
+ function Wo({
255
261
  className: t,
256
262
  sx: o,
257
263
  headSx: i,
258
264
  headCells: c,
259
- rows: l,
260
- selected: f,
261
- canCheckbox: v,
262
- canTotalCountRow: $,
263
- canSelectingSingle: W,
264
- canUseOrderBy: j = !0,
265
+ rows: g,
266
+ selected: x,
267
+ canCheckbox: A,
268
+ canTotalCountRow: H,
269
+ canSelectingSingle: V,
270
+ canUseOrderBy: Y = !0,
265
271
  canTableRadiusZero: h = !1,
266
- canUseTreeGridStyle: s = !1,
267
- fixedRowCount: p,
268
- onSelect: k,
269
- onBlur: R
272
+ canUseTreeGridStyle: e = !1,
273
+ fixedRowCount: u,
274
+ onSelect: E,
275
+ onBlur: p
270
276
  }) {
271
- const r = Mt(), [L, wt] = J("asc"), [V, Rt] = J(""), [_, D] = J([]), Lt = _t(qt("owp-data-table")), b = y(() => Jt(p), [p]), E = y(() => {
272
- const d = xt(l) ? l : [];
273
- return b ? d.slice(0, b) : d;
274
- }, [l, b]), q = y(() => c ?? [], [c]), I = y(
277
+ const R = Mt(), [n, O] = X("asc"), [q, Ot] = X(""), [P, z] = X([]), St = Qt(Ut("owp-data-table")), L = D(() => so(u), [u]), F = D(() => {
278
+ const a = Ht(g) ? g : [];
279
+ return L ? a.slice(0, L) : a;
280
+ }, [g, L]), j = D(() => c ?? [], [c]), v = D(
275
281
  () => {
276
- var d, u;
277
- return $t((u = (d = r == null ? void 0 : r.theme) == null ? void 0 : d.main) == null ? void 0 : u.grid);
282
+ var a, d;
283
+ return zt((d = (a = R == null ? void 0 : R.theme) == null ? void 0 : a.main) == null ? void 0 : d.grid);
278
284
  },
279
- [r]
280
- ), ot = ut(v) ? v : !0, et = ut($) ? $ : !0;
281
- dt(() => {
282
- Pt(f) || D(f);
283
- }, [f]), dt(() => {
284
- k == null || k(_);
285
- }, [_]);
286
- const kt = /* @__PURE__ */ n((d, u) => {
287
- wt(V === u && L === "asc" ? "desc" : "asc"), Rt(u);
288
- }, "handleRequestSort"), At = /* @__PURE__ */ n((d) => {
289
- if (d.target.checked) {
290
- D(E);
285
+ [R]
286
+ ), S = D(
287
+ () => {
288
+ var a, d;
289
+ return Ft((d = (a = R == null ? void 0 : R.theme) == null ? void 0 : a.main) == null ? void 0 : d.table, eo);
290
+ },
291
+ [R]
292
+ ), dt = bt(A) ? A : !0, ut = bt(H) ? H : !0;
293
+ lt(() => {
294
+ to(x) || z(x);
295
+ }, [x]), lt(() => {
296
+ E == null || E(P);
297
+ }, [P]);
298
+ const _t = /* @__PURE__ */ s((a, d) => {
299
+ O(q === d && n === "asc" ? "desc" : "asc"), Ot(d);
300
+ }, "handleRequestSort"), Bt = /* @__PURE__ */ s((a) => {
301
+ if (a.target.checked) {
302
+ z(F);
291
303
  return;
292
304
  }
293
- D([]);
294
- }, "handleSelectAllClick"), St = /* @__PURE__ */ n((d, u) => {
295
- if (W) {
296
- D([u]);
305
+ z([]);
306
+ }, "handleSelectAllClick"), It = /* @__PURE__ */ s((a, d) => {
307
+ if (V) {
308
+ z([d]);
297
309
  return;
298
310
  }
299
- D((x) => !!x.find((A) => Q(A, u)) ? x == null ? void 0 : x.filter((A) => !Q(A, u)) : [...x, u]);
300
- }, "handleClick"), N = y(
301
- () => [...E].sort(Xt(L, V)),
302
- [L, V, E]
303
- ), rt = y(() => !b || N.length >= b ? N : [...N, ...Qt(b - N.length)], [b, N]);
304
- return /* @__PURE__ */ z(
305
- Ot,
311
+ z((b) => !!b.find((k) => U(k, d)) ? b == null ? void 0 : b.filter((k) => !U(k, d)) : [...b, d]);
312
+ }, "handleClick"), _ = D(
313
+ () => [...F].sort(uo(n, q)),
314
+ [n, q, F]
315
+ ), ft = D(() => !L || _.length >= L ? _ : [..._, ...ao(L - _.length)], [L, _]);
316
+ return /* @__PURE__ */ M(
317
+ Pt,
306
318
  {
307
319
  className: t,
308
- sx: m({ width: "100%" }, h && g),
320
+ sx: m(
321
+ { width: "100%" },
322
+ e && G(v),
323
+ h && l
324
+ ),
309
325
  children: [
310
- s && /* @__PURE__ */ a(Et, { styles: It() }),
311
- /* @__PURE__ */ a(
312
- Ct,
326
+ e && /* @__PURE__ */ f(qt, { styles: Ct() }),
327
+ /* @__PURE__ */ f(
328
+ yt,
313
329
  {
314
330
  sx: m(
315
- { height: b ? "auto" : 500, borderRadius: 2 },
316
- b && { overflowY: "hidden" },
317
- h && g,
331
+ { height: L ? "auto" : 500, borderRadius: 2 },
332
+ e && G(v),
333
+ L && { overflowY: "hidden" },
334
+ h && l,
318
335
  o
319
336
  ),
320
- children: /* @__PURE__ */ z(
321
- zt,
337
+ children: /* @__PURE__ */ M(
338
+ jt,
322
339
  {
323
- stickyHeader: !s,
324
- sx: m({ minWidth: 200 }, h && g),
340
+ stickyHeader: !e,
341
+ sx: m({ minWidth: 200 }, h && l),
325
342
  "aria-labelledby": "owp-data-table",
326
343
  children: [
327
- /* @__PURE__ */ a(
328
- Ut,
344
+ /* @__PURE__ */ f(
345
+ co,
329
346
  {
330
347
  sx: i,
331
- headCells: q,
332
- gridTheme: I,
333
- numSelected: _.length,
334
- order: L,
335
- orderBy: V,
336
- onSelectAllClick: At,
337
- canCheckbox: !W && ot,
338
- canUseOrderBy: j,
348
+ headCells: j,
349
+ gridTheme: v,
350
+ tableTheme: S,
351
+ numSelected: P.length,
352
+ order: n,
353
+ orderBy: q,
354
+ onSelectAllClick: Bt,
355
+ canCheckbox: !V && dt,
356
+ canUseOrderBy: Y,
339
357
  canTableRadiusZero: h,
340
- canUseTreeGridStyle: s,
341
- onRequestSort: kt,
342
- rowCount: E.length
358
+ canUseTreeGridStyle: e,
359
+ onRequestSort: _t,
360
+ rowCount: F.length
343
361
  }
344
362
  ),
345
- /* @__PURE__ */ a(Bt, { sx: m(h && g), children: rt.map((d, u) => {
346
- const x = _.some((e) => Q(e, d)), it = rt.length - 1 === u, A = b ? u >= N.length : !1, K = `${Lt.current}-${u}`;
347
- return /* @__PURE__ */ z(
348
- bt,
363
+ /* @__PURE__ */ f(Kt, { sx: m(h && l), children: ft.map((a, d) => {
364
+ const b = P.some((r) => U(r, a)), mt = ft.length - 1 === d, k = L ? d >= _.length : !1, J = `${St.current}-${d}`;
365
+ return /* @__PURE__ */ M(
366
+ Dt,
349
367
  {
350
368
  hover: !0,
351
- role: s ? void 0 : "checkbox",
352
- "aria-checked": s ? void 0 : x,
369
+ role: e ? void 0 : "checkbox",
370
+ "aria-checked": e ? void 0 : b,
353
371
  tabIndex: -1,
354
- selected: x,
372
+ selected: b,
355
373
  sx: m(
356
- { cursor: A ? "default" : "pointer" },
357
- s && { height: 30 },
358
- h && g,
359
- h && it && Kt
374
+ { cursor: k ? "default" : "pointer" },
375
+ e && Zt(v, {
376
+ canHover: !k,
377
+ selected: b
378
+ }),
379
+ e && { height: 30 },
380
+ h && l,
381
+ h && mt && io
360
382
  ),
361
383
  children: [
362
- ot && /* @__PURE__ */ a(
363
- B,
384
+ dt && /* @__PURE__ */ f(
385
+ N,
364
386
  {
365
387
  padding: "checkbox",
366
- onClick: /* @__PURE__ */ n((e) => {
367
- A || St(e, d);
388
+ onClick: /* @__PURE__ */ s((r) => {
389
+ k || It(r, a);
368
390
  }, "onClick"),
369
391
  sx: m(
370
- X,
371
- s && G(I),
372
- h && g
392
+ e ? ot : tt,
393
+ !e && et(S),
394
+ e && Z(v),
395
+ h && l
373
396
  ),
374
- children: /* @__PURE__ */ a(
375
- ft,
397
+ children: /* @__PURE__ */ f(
398
+ $t,
376
399
  {
377
400
  color: "default",
378
- checked: x,
379
- disabled: A,
380
- sx: m(s && { p: 0 })
401
+ checked: b,
402
+ disabled: k,
403
+ sx: m(e && { p: 0 })
381
404
  }
382
405
  )
383
406
  }
384
407
  ),
385
- q.map((e, Y) => {
386
- const nt = `${K}-row-${u}-cell-${Y}`, st = Gt(d, e), P = Zt(d, u), T = C(d, String(e == null ? void 0 : e.id));
387
- return Y === 0 ? /* @__PURE__ */ a(
388
- B,
408
+ j.map((r, Q) => {
409
+ const ct = `${J}-row-${d}-cell-${Q}`, gt = fo(a, r), K = mo(a, d), y = W(a, String(r == null ? void 0 : r.id));
410
+ return Q === 0 ? /* @__PURE__ */ f(
411
+ N,
389
412
  {
390
- className: s ? void 0 : "px-4",
391
- component: s ? "td" : "th",
392
- id: K,
393
- scope: s ? void 0 : "row",
413
+ className: e ? void 0 : "px-4",
414
+ component: e ? "td" : "th",
415
+ id: J,
416
+ scope: e ? void 0 : "row",
394
417
  padding: "none",
395
- role: s ? "cell" : void 0,
396
- align: U(e.valueAlign, "left"),
418
+ role: e ? "cell" : void 0,
419
+ align: nt(r.valueAlign, "left"),
397
420
  sx: m(
398
- q.length > 1 && X,
399
- s && G(I),
400
- h && g
421
+ j.length > 1 && (e ? ot : tt),
422
+ !e && et(S),
423
+ e && Z(v),
424
+ h && l
401
425
  ),
402
- children: T
426
+ children: y
403
427
  },
404
- nt
405
- ) : /* @__PURE__ */ a(
406
- B,
428
+ ct
429
+ ) : /* @__PURE__ */ f(
430
+ N,
407
431
  {
408
- className: s ? void 0 : "px-4",
409
- role: s ? "cell" : void 0,
410
- align: U(e.valueAlign, "left"),
432
+ className: e ? void 0 : "px-4",
433
+ role: e ? "cell" : void 0,
434
+ align: nt(r.valueAlign, "left"),
411
435
  sx: m(
412
- q.length - 1 !== Y && X,
413
- s && G(I),
414
- h && g
436
+ j.length - 1 !== Q && (e ? ot : tt),
437
+ !e && et(S),
438
+ e && Z(v),
439
+ h && l
415
440
  ),
416
- children: e != null && e.canTextField ? (e == null ? void 0 : e.textFieldType) === "number" ? /* @__PURE__ */ a(
417
- Tt,
441
+ children: r != null && r.canTextField ? (r == null ? void 0 : r.textFieldType) === "number" ? /* @__PURE__ */ f(
442
+ oo,
418
443
  {
419
444
  variant: "standard",
420
445
  decimalScale: 2,
421
- label: st,
446
+ label: gt,
422
447
  fullWidth: !0,
423
448
  size: "small",
424
- sx: pt(
425
- e == null ? void 0 : e.valueAlign,
426
- s ? I.cell.fontSize : void 0
449
+ sx: Et(
450
+ r == null ? void 0 : r.valueAlign,
451
+ e ? v.cell.fontSize : S.cell.fontSize
427
452
  ),
428
453
  slotProps: {
429
454
  input: {
430
- tabIndex: P
455
+ tabIndex: K
431
456
  },
432
457
  inputLabel: {
433
458
  shrink: !0
434
459
  }
435
460
  },
436
- isAllowed: /* @__PURE__ */ n((w) => {
437
- var O;
438
- const { floatValue: M } = w, S = (O = tt(d, e == null ? void 0 : e.rangeKey)) == null ? void 0 : O.end;
439
- return H(M) && H(S) ? M <= S : !0;
461
+ isAllowed: /* @__PURE__ */ s((w) => {
462
+ var C;
463
+ const { floatValue: B } = w, $ = (C = st(a, r == null ? void 0 : r.rangeKey)) == null ? void 0 : C.end;
464
+ return T(B) && T($) ? B <= $ : !0;
440
465
  }, "isAllowed"),
441
- value: T,
442
- onBlur: /* @__PURE__ */ n((w) => {
443
- var O, at;
444
- const M = (O = tt(d, e == null ? void 0 : e.rangeKey)) == null ? void 0 : O.start, S = (at = w.target.value) == null ? void 0 : at.replace(/,/g, "");
445
- R == null || R(
466
+ value: y,
467
+ onBlur: /* @__PURE__ */ s((w) => {
468
+ var C, ht;
469
+ const B = (C = st(a, r == null ? void 0 : r.rangeKey)) == null ? void 0 : C.start, $ = (ht = w.target.value) == null ? void 0 : ht.replace(/,/g, "");
470
+ p == null || p(
446
471
  {
447
472
  ...w,
448
473
  target: {
449
474
  ...w.target,
450
- value: H(M) && S !== "" ? Number(M > Number(S) ? M : S) : S
475
+ value: T(B) && $ !== "" ? Number(B > Number($) ? B : $) : $
451
476
  }
452
477
  },
453
- P
478
+ K
454
479
  );
455
480
  }, "onBlur")
456
481
  }
457
- ) : /* @__PURE__ */ a(
458
- yt,
482
+ ) : /* @__PURE__ */ f(
483
+ Nt,
459
484
  {
460
485
  variant: "standard",
461
- label: st,
486
+ label: gt,
462
487
  fullWidth: !0,
463
488
  size: "small",
464
- sx: pt(
465
- e == null ? void 0 : e.valueAlign,
466
- s ? I.cell.fontSize : void 0
489
+ sx: Et(
490
+ r == null ? void 0 : r.valueAlign,
491
+ e ? v.cell.fontSize : S.cell.fontSize
467
492
  ),
468
493
  slotProps: {
469
494
  input: {
470
- tabIndex: P
495
+ tabIndex: K
471
496
  },
472
497
  inputLabel: {
473
498
  shrink: !0
474
499
  }
475
500
  },
476
- type: (e == null ? void 0 : e.textFieldType) ?? "text",
477
- defaultValue: T,
478
- onBlur: /* @__PURE__ */ n((w) => R == null ? void 0 : R(
501
+ type: (r == null ? void 0 : r.textFieldType) ?? "text",
502
+ defaultValue: y,
503
+ onBlur: /* @__PURE__ */ s((w) => p == null ? void 0 : p(
479
504
  { ...w, target: { ...w.target, value: w.target.value } },
480
- P
505
+ K
481
506
  ), "onBlur")
482
507
  }
483
- ) : T
508
+ ) : y
484
509
  },
485
- nt
510
+ ct
486
511
  );
487
512
  })
488
513
  ]
489
514
  },
490
- `${K}-row-${u}`
515
+ `${J}-row-${d}`
491
516
  );
492
517
  }) })
493
518
  ]
@@ -495,16 +520,19 @@ function Fo({
495
520
  )
496
521
  }
497
522
  ),
498
- et && /* @__PURE__ */ a(Ht, { sx: m(h && g) }),
499
- et && /* @__PURE__ */ z(
500
- Z,
523
+ ut && /* @__PURE__ */ f(Wt, { sx: m(h && l) }),
524
+ ut && /* @__PURE__ */ M(
525
+ it,
501
526
  {
502
527
  className: "w-full py-8 pr-12",
503
528
  align: "right",
504
- sx: m(h && g),
529
+ sx: m(
530
+ e && G(v),
531
+ h && l
532
+ ),
505
533
  children: [
506
534
  "전체: ",
507
- E.length.toLocaleString(),
535
+ F.length.toLocaleString(),
508
536
  " 건"
509
537
  ]
510
538
  }
@@ -513,8 +541,8 @@ function Fo({
513
541
  }
514
542
  );
515
543
  }
516
- n(Fo, "OwpDataTable");
544
+ s(Wo, "OwpDataTable");
517
545
  export {
518
- Fo as OwpDataTable
546
+ Wo as OwpDataTable
519
547
  };
520
548
  //# sourceMappingURL=OwpDataTable.js.map