@owp/core 2.5.35 → 2.5.37

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