@owp/core 2.5.35 → 2.5.36

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