@owp/core 2.5.2 → 2.5.3

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