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