@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.
- package/dist/components/OwpTable/OwpDataTable.js +342 -377
- package/dist/components/OwpTable/OwpDataTable.js.map +1 -1
- package/dist/components/OwpTable/OwpTable.js +19 -20
- package/dist/components/OwpTable/OwpTable.js.map +1 -1
- package/dist/components/OwpTable/internal/OwpTableBase.js +78 -81
- package/dist/components/OwpTable/internal/OwpTableBase.js.map +1 -1
- package/dist/components/OwpTable/internal/treeGridTableStyle.js +31 -88
- package/dist/components/OwpTable/internal/treeGridTableStyle.js.map +1 -1
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js +262 -304
- package/dist/components/OwpTreeGrid/OwpTreeGrid.js.map +1 -1
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js +345 -300
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
- package/dist/constants/treeGrid.js +46 -59
- package/dist/constants/treeGrid.js.map +1 -1
- package/dist/constants.js +18 -18
- package/dist/constants.js.map +1 -1
- package/dist/owp-app.css +1 -1
- package/dist/types/components/OwpTable/internal/OwpTableBase.d.ts +1 -3
- package/dist/types/components/OwpTable/internal/treeGridTableStyle.d.ts +2 -61
- package/dist/types/components/OwpTreeGrid/internal/treeGridTheme.d.ts +1 -2
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/constants/treeGrid.d.ts +0 -9
- package/package.json +1 -1
|
@@ -1,69 +1,67 @@
|
|
|
1
|
-
var
|
|
2
|
-
var a = (
|
|
3
|
-
import { jsxs as
|
|
4
|
-
import { resolveOwpGridTheme as
|
|
5
|
-
import { resolveOwpTableTheme as
|
|
6
|
-
import { DEFAULT_TABLE_RADIUS as
|
|
7
|
-
import { getTreeGridFontFaceStyles as
|
|
8
|
-
import { useGetCurrentSettings as
|
|
9
|
-
import { TextField as
|
|
10
|
-
import
|
|
11
|
-
import { grey as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import { useState as
|
|
22
|
-
import {
|
|
23
|
-
import { getDefaultTableCellSx as
|
|
24
|
-
import { OwpTableTotalCount as
|
|
25
|
-
import { toTableRadiusCssValue as
|
|
26
|
-
import { uniqueId as
|
|
27
|
-
import { isEmpty as
|
|
28
|
-
import { isEqual as
|
|
29
|
-
import { OwpNumberField as
|
|
30
|
-
import { isNumber as
|
|
31
|
-
import { isArray as
|
|
32
|
-
import { isBoolean as
|
|
33
|
-
const
|
|
34
|
-
...
|
|
35
|
-
borderBottom: `1px solid ${
|
|
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"),
|
|
39
|
-
borderRight: `1px solid ${
|
|
40
|
-
},
|
|
41
|
-
borderRight: `1px solid ${
|
|
42
|
-
}), "getDefaultRowBorderRightSx"),
|
|
43
|
-
borderRight: `1px solid ${
|
|
44
|
-
},
|
|
45
|
-
borderLeft: `1px solid ${
|
|
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
|
-
}
|
|
52
|
-
|
|
53
|
-
}), "
|
|
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
|
-
},
|
|
56
|
-
borderRadius:
|
|
57
|
-
},
|
|
53
|
+
}, Tt = {
|
|
54
|
+
borderRadius: Po
|
|
55
|
+
}, Dt = {
|
|
58
56
|
"& > th, & > td": {
|
|
59
57
|
borderBottomLeftRadius: 0,
|
|
60
58
|
borderBottomRightRadius: 0
|
|
61
59
|
}
|
|
62
|
-
},
|
|
60
|
+
}, Et = {
|
|
63
61
|
"& > th, & > td": {
|
|
64
62
|
borderBottom: "none"
|
|
65
63
|
}
|
|
66
|
-
},
|
|
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
|
-
},
|
|
94
|
-
if (!(!
|
|
95
|
-
return
|
|
96
|
-
}, "getFixedRowCount"),
|
|
97
|
-
switch (
|
|
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
|
|
101
|
+
return t;
|
|
104
102
|
default:
|
|
105
|
-
return
|
|
103
|
+
return r;
|
|
106
104
|
}
|
|
107
|
-
}, "getTableCellAlign"),
|
|
108
|
-
if (
|
|
109
|
-
return
|
|
110
|
-
}, "getRowValue"),
|
|
111
|
-
if (typeof
|
|
112
|
-
return
|
|
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
|
|
115
|
-
const
|
|
116
|
-
return
|
|
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(
|
|
119
|
-
function
|
|
120
|
-
return
|
|
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(
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
return
|
|
126
|
-
}, "getRowRangeValue"),
|
|
127
|
-
var
|
|
128
|
-
if (!(
|
|
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 =
|
|
131
|
-
return `${(
|
|
132
|
-
}, "getRangeLabel"),
|
|
133
|
-
const n =
|
|
134
|
-
return
|
|
135
|
-
}, "getRowTabIndex"),
|
|
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:
|
|
138
|
-
textAlign:
|
|
135
|
+
fontSize: r,
|
|
136
|
+
textAlign: t ?? "center"
|
|
139
137
|
},
|
|
140
138
|
"& .MuiInputBase-input": {
|
|
141
|
-
fontSize:
|
|
139
|
+
fontSize: r
|
|
142
140
|
},
|
|
143
141
|
height: 34
|
|
144
142
|
}), "getEditableCellSx");
|
|
145
|
-
function
|
|
143
|
+
function Mt(t) {
|
|
146
144
|
const {
|
|
147
|
-
sx:
|
|
145
|
+
sx: r,
|
|
148
146
|
headCells: n,
|
|
149
|
-
onSelectAllClick:
|
|
150
|
-
order:
|
|
151
|
-
orderBy:
|
|
152
|
-
numSelected:
|
|
153
|
-
rowCount:
|
|
147
|
+
onSelectAllClick: b,
|
|
148
|
+
order: c,
|
|
149
|
+
orderBy: p,
|
|
150
|
+
numSelected: v,
|
|
151
|
+
rowCount: T,
|
|
154
152
|
onRequestSort: q,
|
|
155
|
-
canCheckbox:
|
|
153
|
+
canCheckbox: J,
|
|
156
154
|
canUseOrderBy: Q = !0,
|
|
157
|
-
canTableRadiusZero:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
-
|
|
162
|
+
return /* @__PURE__ */ l(bt, { sx: m(D && g), children: /* @__PURE__ */ Y(
|
|
163
|
+
Zo,
|
|
167
164
|
{
|
|
168
|
-
sx:
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
sx: m(
|
|
166
|
+
o && { height: H.header.height },
|
|
167
|
+
D && g
|
|
171
168
|
),
|
|
172
|
-
children:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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
|
-
|
|
221
|
-
|
|
184
|
+
children: /* @__PURE__ */ l(
|
|
185
|
+
So,
|
|
222
186
|
{
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
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(
|
|
268
|
-
function
|
|
269
|
-
className:
|
|
270
|
-
sx:
|
|
236
|
+
a(Mt, "DataTableHead");
|
|
237
|
+
function fr({
|
|
238
|
+
className: t,
|
|
239
|
+
sx: r,
|
|
271
240
|
headSx: n,
|
|
272
|
-
headCells:
|
|
273
|
-
rows:
|
|
274
|
-
selected:
|
|
275
|
-
canCheckbox:
|
|
276
|
-
canTotalCountRow:
|
|
241
|
+
headCells: b,
|
|
242
|
+
rows: c,
|
|
243
|
+
selected: p,
|
|
244
|
+
canCheckbox: v,
|
|
245
|
+
canTotalCountRow: T,
|
|
277
246
|
canSelectingSingle: q,
|
|
278
|
-
canUseOrderBy:
|
|
247
|
+
canUseOrderBy: J = !0,
|
|
279
248
|
canTableRadiusZero: Q,
|
|
280
|
-
canUseTableRadius:
|
|
281
|
-
canUseTreeGridStyle:
|
|
282
|
-
tableBorderRadius:
|
|
283
|
-
fixedRowCount:
|
|
284
|
-
onSelect:
|
|
285
|
-
onBlur:
|
|
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,
|
|
288
|
-
const
|
|
289
|
-
const d =
|
|
290
|
-
return
|
|
291
|
-
}, [
|
|
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
|
|
263
|
+
return ot((u = (d = s == null ? void 0 : s.theme) == null ? void 0 : d.main) == null ? void 0 : u.grid);
|
|
295
264
|
},
|
|
296
|
-
[
|
|
297
|
-
), k =
|
|
265
|
+
[s]
|
|
266
|
+
), k = B(
|
|
298
267
|
() => {
|
|
299
268
|
var d, u;
|
|
300
|
-
return
|
|
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
|
-
[
|
|
303
|
-
),
|
|
304
|
-
borderRadius:
|
|
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
|
-
} :
|
|
275
|
+
} : o ? void 0 : Tt, bo = Io(v) ? v : !0, Qo = Io(T) ? T : !0;
|
|
307
276
|
$o(() => {
|
|
308
|
-
|
|
309
|
-
}, [
|
|
310
|
-
|
|
311
|
-
}, [
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
}, "handleRequestSort"),
|
|
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
|
|
285
|
+
F(M);
|
|
317
286
|
return;
|
|
318
287
|
}
|
|
319
|
-
|
|
320
|
-
}, "handleSelectAllClick"),
|
|
288
|
+
F([]);
|
|
289
|
+
}, "handleSelectAllClick"), Go = /* @__PURE__ */ a((d, u) => {
|
|
321
290
|
if (q) {
|
|
322
|
-
|
|
291
|
+
F([u]);
|
|
323
292
|
return;
|
|
324
293
|
}
|
|
325
|
-
|
|
326
|
-
}, "handleClick"),
|
|
327
|
-
() => [...
|
|
328
|
-
[
|
|
329
|
-
),
|
|
330
|
-
return /* @__PURE__ */
|
|
331
|
-
|
|
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:
|
|
302
|
+
className: t,
|
|
334
303
|
elevation: 0,
|
|
335
|
-
sx:
|
|
304
|
+
sx: m(
|
|
336
305
|
{ width: "100%" },
|
|
337
|
-
!
|
|
338
|
-
|
|
306
|
+
!o && E && { backgroundColor: E },
|
|
307
|
+
o && to(R),
|
|
339
308
|
mo
|
|
340
309
|
),
|
|
341
310
|
children: [
|
|
342
|
-
|
|
311
|
+
o && /* @__PURE__ */ l(st, { styles: rt() }),
|
|
343
312
|
/* @__PURE__ */ l(
|
|
344
|
-
|
|
313
|
+
mt,
|
|
345
314
|
{
|
|
346
|
-
sx:
|
|
347
|
-
{ height:
|
|
348
|
-
!
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
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
|
-
|
|
322
|
+
r
|
|
355
323
|
),
|
|
356
|
-
children: /* @__PURE__ */
|
|
357
|
-
|
|
324
|
+
children: /* @__PURE__ */ Y(
|
|
325
|
+
ut,
|
|
358
326
|
{
|
|
359
|
-
stickyHeader: !
|
|
360
|
-
sx:
|
|
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
|
-
|
|
332
|
+
Mt,
|
|
365
333
|
{
|
|
366
334
|
sx: n,
|
|
367
|
-
headCells:
|
|
368
|
-
gridTheme:
|
|
335
|
+
headCells: j,
|
|
336
|
+
gridTheme: R,
|
|
369
337
|
tableTheme: k,
|
|
370
|
-
numSelected:
|
|
371
|
-
order:
|
|
372
|
-
orderBy:
|
|
373
|
-
onSelectAllClick:
|
|
374
|
-
canCheckbox: !q &&
|
|
375
|
-
canUseOrderBy:
|
|
376
|
-
canTableRadiusZero:
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
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(
|
|
384
|
-
const f =
|
|
385
|
-
return /* @__PURE__ */
|
|
386
|
-
|
|
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:
|
|
390
|
-
"aria-checked":
|
|
356
|
+
role: o ? void 0 : "checkbox",
|
|
357
|
+
"aria-checked": o ? void 0 : f,
|
|
391
358
|
tabIndex: -1,
|
|
392
359
|
selected: f,
|
|
393
|
-
sx:
|
|
394
|
-
{ cursor:
|
|
395
|
-
!
|
|
396
|
-
!
|
|
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:
|
|
365
|
+
backgroundColor: uo
|
|
399
366
|
}
|
|
400
367
|
},
|
|
401
|
-
!
|
|
368
|
+
!o && lo && f && {
|
|
402
369
|
"&.Mui-selected, &.Mui-selected:hover": {
|
|
403
|
-
backgroundColor:
|
|
370
|
+
backgroundColor: lo
|
|
404
371
|
}
|
|
405
372
|
},
|
|
406
|
-
|
|
407
|
-
canHover: !
|
|
373
|
+
o && gt(R, {
|
|
374
|
+
canHover: !L,
|
|
408
375
|
selected: f
|
|
409
376
|
}),
|
|
410
|
-
!
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
377
|
+
!o && X && Et,
|
|
378
|
+
o && { height: 30 },
|
|
379
|
+
h && g,
|
|
380
|
+
h && X && Dt
|
|
414
381
|
),
|
|
415
382
|
children: [
|
|
416
|
-
|
|
417
|
-
|
|
383
|
+
bo && /* @__PURE__ */ l(
|
|
384
|
+
z,
|
|
418
385
|
{
|
|
419
386
|
padding: "checkbox",
|
|
420
|
-
onClick: /* @__PURE__ */ a((
|
|
421
|
-
|
|
387
|
+
onClick: /* @__PURE__ */ a((e) => {
|
|
388
|
+
L || Go(e, d);
|
|
422
389
|
}, "onClick"),
|
|
423
|
-
sx:
|
|
424
|
-
!
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
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
|
-
|
|
397
|
+
So,
|
|
432
398
|
{
|
|
433
399
|
color: "default",
|
|
434
400
|
checked: f,
|
|
435
|
-
disabled:
|
|
436
|
-
sx:
|
|
401
|
+
disabled: L,
|
|
402
|
+
sx: m(o && { p: 0 })
|
|
437
403
|
}
|
|
438
404
|
)
|
|
439
405
|
}
|
|
440
406
|
),
|
|
441
|
-
|
|
442
|
-
const
|
|
443
|
-
return
|
|
444
|
-
|
|
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:
|
|
447
|
-
component:
|
|
448
|
-
id:
|
|
449
|
-
scope:
|
|
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:
|
|
452
|
-
align:
|
|
453
|
-
sx:
|
|
454
|
-
!
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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:
|
|
425
|
+
children: W
|
|
461
426
|
},
|
|
462
|
-
|
|
427
|
+
Bo
|
|
463
428
|
) : /* @__PURE__ */ l(
|
|
464
|
-
|
|
429
|
+
z,
|
|
465
430
|
{
|
|
466
|
-
className:
|
|
467
|
-
role:
|
|
468
|
-
align:
|
|
469
|
-
sx:
|
|
470
|
-
!
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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:
|
|
476
|
-
|
|
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:
|
|
445
|
+
label: To,
|
|
481
446
|
fullWidth: !0,
|
|
482
447
|
size: "small",
|
|
483
|
-
sx:
|
|
484
|
-
|
|
485
|
-
|
|
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:
|
|
454
|
+
tabIndex: K
|
|
490
455
|
},
|
|
491
456
|
inputLabel: {
|
|
492
457
|
shrink: !0
|
|
493
458
|
}
|
|
494
459
|
},
|
|
495
|
-
isAllowed: /* @__PURE__ */ a((
|
|
496
|
-
var
|
|
497
|
-
const { floatValue:
|
|
498
|
-
return
|
|
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:
|
|
501
|
-
onBlur: /* @__PURE__ */ a((
|
|
502
|
-
var
|
|
503
|
-
const
|
|
504
|
-
|
|
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
|
-
...
|
|
471
|
+
...C,
|
|
507
472
|
target: {
|
|
508
|
-
...
|
|
509
|
-
value:
|
|
473
|
+
...C.target,
|
|
474
|
+
value: _(O) && A !== "" ? Number(O > Number(A) ? O : A) : A
|
|
510
475
|
}
|
|
511
476
|
},
|
|
512
|
-
|
|
477
|
+
K
|
|
513
478
|
);
|
|
514
479
|
}, "onBlur")
|
|
515
480
|
}
|
|
516
481
|
) : /* @__PURE__ */ l(
|
|
517
|
-
|
|
482
|
+
it,
|
|
518
483
|
{
|
|
519
484
|
variant: "standard",
|
|
520
|
-
label:
|
|
485
|
+
label: To,
|
|
521
486
|
fullWidth: !0,
|
|
522
487
|
size: "small",
|
|
523
|
-
sx:
|
|
524
|
-
|
|
525
|
-
|
|
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:
|
|
494
|
+
tabIndex: K
|
|
530
495
|
},
|
|
531
496
|
inputLabel: {
|
|
532
497
|
shrink: !0
|
|
533
498
|
}
|
|
534
499
|
},
|
|
535
|
-
type: (
|
|
536
|
-
defaultValue:
|
|
537
|
-
onBlur: /* @__PURE__ */ a((
|
|
538
|
-
{ ...
|
|
539
|
-
|
|
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
|
-
) :
|
|
507
|
+
) : W
|
|
543
508
|
},
|
|
544
|
-
|
|
509
|
+
Bo
|
|
545
510
|
);
|
|
546
511
|
})
|
|
547
512
|
]
|
|
548
513
|
},
|
|
549
|
-
`${
|
|
514
|
+
`${y}-row-${u}`
|
|
550
515
|
);
|
|
551
516
|
}) })
|
|
552
517
|
]
|
|
@@ -554,14 +519,14 @@ function Rr({
|
|
|
554
519
|
)
|
|
555
520
|
}
|
|
556
521
|
),
|
|
557
|
-
|
|
558
|
-
|
|
522
|
+
Qo && /* @__PURE__ */ l(
|
|
523
|
+
wt,
|
|
559
524
|
{
|
|
560
|
-
dividerSx:
|
|
561
|
-
totalCount:
|
|
562
|
-
typographySx:
|
|
563
|
-
|
|
564
|
-
|
|
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(
|
|
537
|
+
a(fr, "OwpDataTable");
|
|
573
538
|
export {
|
|
574
|
-
|
|
539
|
+
fr as OwpDataTable
|
|
575
540
|
};
|
|
576
541
|
//# sourceMappingURL=OwpDataTable.js.map
|