@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.
- 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 +360 -391
- 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 +287 -361
- 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 +410 -331
- package/dist/components/OwpTreeGrid/internal/treeGridTheme.js.map +1 -1
- package/dist/constants/treeGrid.js +47 -59
- package/dist/constants/treeGrid.js.map +1 -1
- package/dist/constants.js +28 -27
- package/dist/constants.js.map +1 -1
- 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/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 +4 -2
- package/dist/types/constants/index.d.ts +1 -0
- package/dist/types/constants/treeGrid.d.ts +1 -9
- package/package.json +1 -1
|
@@ -1,69 +1,70 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
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 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"),
|
|
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__ */ 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
|
-
}
|
|
52
|
-
|
|
53
|
-
}), "
|
|
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
|
-
},
|
|
56
|
-
borderRadius:
|
|
57
|
-
},
|
|
56
|
+
}, Tt = {
|
|
57
|
+
borderRadius: qo
|
|
58
|
+
}, Et = {
|
|
58
59
|
"& > th, & > td": {
|
|
59
60
|
borderBottomLeftRadius: 0,
|
|
60
61
|
borderBottomRightRadius: 0
|
|
61
62
|
}
|
|
62
|
-
},
|
|
63
|
+
}, $t = {
|
|
63
64
|
"& > th, & > td": {
|
|
64
65
|
borderBottom: "none"
|
|
65
66
|
}
|
|
66
|
-
},
|
|
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
|
-
},
|
|
94
|
-
if (!(!
|
|
95
|
-
return
|
|
96
|
-
}, "getFixedRowCount"),
|
|
97
|
-
switch (
|
|
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
|
|
104
|
+
return t;
|
|
104
105
|
default:
|
|
105
|
-
return
|
|
106
|
+
return r;
|
|
106
107
|
}
|
|
107
|
-
}, "getTableCellAlign"),
|
|
108
|
-
if (
|
|
109
|
-
return
|
|
110
|
-
}, "getRowValue"),
|
|
111
|
-
if (typeof
|
|
112
|
-
return
|
|
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
|
|
115
|
-
const m =
|
|
116
|
-
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;
|
|
117
118
|
}
|
|
118
|
-
|
|
119
|
-
function
|
|
120
|
-
return
|
|
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
|
-
|
|
123
|
-
const
|
|
124
|
-
if (
|
|
125
|
-
return
|
|
126
|
-
}, "getRowRangeValue"),
|
|
127
|
-
var m,
|
|
128
|
-
if (!(
|
|
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
|
|
131
|
-
return `${(m =
|
|
132
|
-
}, "getRangeLabel"),
|
|
133
|
-
const
|
|
134
|
-
return
|
|
135
|
-
}, "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) => ({
|
|
136
137
|
"& input": {
|
|
137
|
-
fontSize:
|
|
138
|
-
textAlign:
|
|
138
|
+
fontSize: r,
|
|
139
|
+
textAlign: t ?? "center"
|
|
139
140
|
},
|
|
140
141
|
"& .MuiInputBase-input": {
|
|
141
|
-
fontSize:
|
|
142
|
+
fontSize: r
|
|
142
143
|
},
|
|
143
144
|
height: 34
|
|
144
145
|
}), "getEditableCellSx");
|
|
145
|
-
function
|
|
146
|
+
function Nt(t) {
|
|
146
147
|
const {
|
|
147
|
-
sx:
|
|
148
|
-
headCells:
|
|
148
|
+
sx: r,
|
|
149
|
+
headCells: a,
|
|
149
150
|
onSelectAllClick: m,
|
|
150
|
-
order:
|
|
151
|
-
orderBy:
|
|
152
|
-
numSelected:
|
|
153
|
-
rowCount:
|
|
154
|
-
onRequestSort:
|
|
155
|
-
canCheckbox:
|
|
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:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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
|
-
|
|
165
|
+
return /* @__PURE__ */ b(mt, { sx: l(T && g), children: /* @__PURE__ */ Y(
|
|
166
|
+
Zo,
|
|
167
167
|
{
|
|
168
|
-
sx:
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
sx: l(
|
|
169
|
+
o && { height: H.header.height },
|
|
170
|
+
T && g
|
|
171
171
|
),
|
|
172
|
-
children:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
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
|
-
}
|
|
179
|
+
...Io(k, Ho)
|
|
180
|
+
},
|
|
181
|
+
!o && No(k),
|
|
182
|
+
o && Mo,
|
|
183
|
+
o && Oo(H),
|
|
184
|
+
T && g,
|
|
185
|
+
r
|
|
219
186
|
),
|
|
220
|
-
|
|
221
|
-
|
|
187
|
+
children: /* @__PURE__ */ b(
|
|
188
|
+
Po,
|
|
222
189
|
{
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
193
|
+
[`&, &.${nt.checked}`]: o ? { color: at[50] } : { color: "inherit" }
|
|
230
194
|
},
|
|
231
|
-
|
|
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
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
-
|
|
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
|
-
|
|
268
|
-
function
|
|
269
|
-
className:
|
|
270
|
-
sx:
|
|
271
|
-
headSx:
|
|
239
|
+
n(Nt, "DataTableHead");
|
|
240
|
+
function gr({
|
|
241
|
+
className: t,
|
|
242
|
+
sx: r,
|
|
243
|
+
headSx: a,
|
|
272
244
|
headCells: m,
|
|
273
|
-
rows:
|
|
274
|
-
selected:
|
|
275
|
-
canCheckbox:
|
|
276
|
-
canTotalCountRow:
|
|
277
|
-
canSelectingSingle:
|
|
278
|
-
canUseOrderBy:
|
|
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:
|
|
281
|
-
canUseTreeGridStyle:
|
|
282
|
-
tableBorderRadius:
|
|
283
|
-
fixedRowCount:
|
|
284
|
-
onSelect:
|
|
285
|
-
onBlur:
|
|
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
|
|
288
|
-
const
|
|
289
|
-
const d =
|
|
290
|
-
return
|
|
291
|
-
}, [
|
|
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
|
|
266
|
+
return ot((u = (d = s == null ? void 0 : s.theme) == null ? void 0 : d.main) == null ? void 0 : u.grid);
|
|
295
267
|
},
|
|
296
|
-
[
|
|
297
|
-
),
|
|
268
|
+
[s]
|
|
269
|
+
), v = B(
|
|
298
270
|
() => {
|
|
299
271
|
var d, u;
|
|
300
|
-
return
|
|
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
|
-
[
|
|
303
|
-
),
|
|
304
|
-
borderRadius:
|
|
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
|
-
} :
|
|
278
|
+
} : o ? void 0 : Tt, mo = Fo(w) ? w : !0, Qo = Fo(D) ? D : !0;
|
|
307
279
|
$o(() => {
|
|
308
|
-
|
|
309
|
-
}, [
|
|
310
|
-
|
|
311
|
-
}, [
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
}, "handleRequestSort"),
|
|
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
|
|
288
|
+
I(M);
|
|
317
289
|
return;
|
|
318
290
|
}
|
|
319
|
-
|
|
320
|
-
}, "handleSelectAllClick"),
|
|
321
|
-
if (
|
|
322
|
-
|
|
291
|
+
I([]);
|
|
292
|
+
}, "handleSelectAllClick"), Go = /* @__PURE__ */ n((d, u) => {
|
|
293
|
+
if (S) {
|
|
294
|
+
I([u]);
|
|
323
295
|
return;
|
|
324
296
|
}
|
|
325
|
-
|
|
326
|
-
}, "handleClick"),
|
|
327
|
-
() => [...
|
|
328
|
-
[
|
|
329
|
-
),
|
|
330
|
-
return /* @__PURE__ */
|
|
331
|
-
|
|
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:
|
|
305
|
+
className: t,
|
|
334
306
|
elevation: 0,
|
|
335
|
-
sx:
|
|
307
|
+
sx: l(
|
|
336
308
|
{ width: "100%" },
|
|
337
|
-
!
|
|
338
|
-
|
|
339
|
-
|
|
309
|
+
!o && E && { backgroundColor: E },
|
|
310
|
+
o && to(R),
|
|
311
|
+
lo
|
|
340
312
|
),
|
|
341
313
|
children: [
|
|
342
|
-
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
|
|
314
|
+
o && /* @__PURE__ */ b(st, { styles: rt() }),
|
|
315
|
+
/* @__PURE__ */ b(
|
|
316
|
+
lt,
|
|
345
317
|
{
|
|
346
|
-
sx:
|
|
347
|
-
{ height:
|
|
348
|
-
!
|
|
349
|
-
!
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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__ */
|
|
357
|
-
|
|
328
|
+
children: /* @__PURE__ */ Y(
|
|
329
|
+
ut,
|
|
358
330
|
{
|
|
359
|
-
stickyHeader: !
|
|
360
|
-
sx:
|
|
331
|
+
stickyHeader: !o,
|
|
332
|
+
sx: l({ minWidth: 200 }, h && g),
|
|
361
333
|
"aria-labelledby": "owp-data-table",
|
|
362
334
|
children: [
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
|
|
335
|
+
/* @__PURE__ */ b(
|
|
336
|
+
Nt,
|
|
365
337
|
{
|
|
366
|
-
sx:
|
|
367
|
-
headCells:
|
|
368
|
-
gridTheme:
|
|
369
|
-
tableTheme:
|
|
370
|
-
numSelected:
|
|
371
|
-
order:
|
|
372
|
-
orderBy:
|
|
373
|
-
onSelectAllClick:
|
|
374
|
-
canCheckbox: !
|
|
375
|
-
canUseOrderBy:
|
|
376
|
-
canTableRadiusZero:
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
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__ */
|
|
384
|
-
const
|
|
385
|
-
return /* @__PURE__ */
|
|
386
|
-
|
|
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:
|
|
390
|
-
"aria-checked":
|
|
360
|
+
role: o ? void 0 : "checkbox",
|
|
361
|
+
"aria-checked": o ? void 0 : c,
|
|
391
362
|
tabIndex: -1,
|
|
392
|
-
selected:
|
|
393
|
-
sx:
|
|
394
|
-
{ cursor:
|
|
395
|
-
!
|
|
396
|
-
!
|
|
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:
|
|
369
|
+
backgroundColor: uo
|
|
399
370
|
}
|
|
400
371
|
},
|
|
401
|
-
!
|
|
372
|
+
!o && bo && c && {
|
|
402
373
|
"&.Mui-selected, &.Mui-selected:hover": {
|
|
403
374
|
backgroundColor: bo
|
|
404
375
|
}
|
|
405
376
|
},
|
|
406
|
-
|
|
407
|
-
canHover: !
|
|
408
|
-
selected:
|
|
377
|
+
o && gt(R, {
|
|
378
|
+
canHover: !C,
|
|
379
|
+
selected: c
|
|
409
380
|
}),
|
|
410
|
-
!
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
381
|
+
!o && X && $t,
|
|
382
|
+
o && { height: 30 },
|
|
383
|
+
h && g,
|
|
384
|
+
h && X && Et
|
|
414
385
|
),
|
|
415
386
|
children: [
|
|
416
|
-
|
|
417
|
-
|
|
387
|
+
mo && /* @__PURE__ */ b(
|
|
388
|
+
z,
|
|
418
389
|
{
|
|
419
390
|
padding: "checkbox",
|
|
420
|
-
onClick: /* @__PURE__ */
|
|
421
|
-
|
|
391
|
+
onClick: /* @__PURE__ */ n((e) => {
|
|
392
|
+
C || Go(e, d);
|
|
422
393
|
}, "onClick"),
|
|
423
|
-
sx:
|
|
424
|
-
!
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
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__ */
|
|
431
|
-
|
|
400
|
+
children: /* @__PURE__ */ b(
|
|
401
|
+
Po,
|
|
432
402
|
{
|
|
433
403
|
color: "default",
|
|
434
|
-
checked:
|
|
435
|
-
disabled:
|
|
436
|
-
sx:
|
|
404
|
+
checked: c,
|
|
405
|
+
disabled: C,
|
|
406
|
+
sx: l(o && { p: 0 })
|
|
437
407
|
}
|
|
438
408
|
)
|
|
439
409
|
}
|
|
440
410
|
),
|
|
441
|
-
|
|
442
|
-
const
|
|
443
|
-
return
|
|
444
|
-
|
|
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:
|
|
447
|
-
component:
|
|
448
|
-
id:
|
|
449
|
-
scope:
|
|
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:
|
|
452
|
-
align:
|
|
453
|
-
sx:
|
|
454
|
-
!
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
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:
|
|
429
|
+
children: W
|
|
461
430
|
},
|
|
462
|
-
|
|
463
|
-
) : /* @__PURE__ */
|
|
464
|
-
|
|
431
|
+
Bo
|
|
432
|
+
) : /* @__PURE__ */ b(
|
|
433
|
+
z,
|
|
465
434
|
{
|
|
466
|
-
className:
|
|
467
|
-
role:
|
|
468
|
-
align:
|
|
469
|
-
sx:
|
|
470
|
-
!
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
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:
|
|
476
|
-
|
|
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:
|
|
449
|
+
label: Do,
|
|
481
450
|
fullWidth: !0,
|
|
482
451
|
size: "small",
|
|
483
|
-
sx:
|
|
484
|
-
|
|
485
|
-
|
|
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:
|
|
458
|
+
tabIndex: K
|
|
490
459
|
},
|
|
491
460
|
inputLabel: {
|
|
492
461
|
shrink: !0
|
|
493
462
|
}
|
|
494
463
|
},
|
|
495
|
-
isAllowed: /* @__PURE__ */
|
|
496
|
-
var
|
|
497
|
-
const { floatValue:
|
|
498
|
-
return
|
|
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:
|
|
501
|
-
onBlur: /* @__PURE__ */
|
|
502
|
-
var
|
|
503
|
-
const
|
|
504
|
-
|
|
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
|
-
...
|
|
475
|
+
...L,
|
|
507
476
|
target: {
|
|
508
|
-
...
|
|
509
|
-
value:
|
|
477
|
+
...L.target,
|
|
478
|
+
value: _(O) && A !== "" ? Number(O > Number(A) ? O : A) : A
|
|
510
479
|
}
|
|
511
480
|
},
|
|
512
|
-
|
|
481
|
+
K
|
|
513
482
|
);
|
|
514
483
|
}, "onBlur")
|
|
515
484
|
}
|
|
516
|
-
) : /* @__PURE__ */
|
|
517
|
-
|
|
485
|
+
) : /* @__PURE__ */ b(
|
|
486
|
+
it,
|
|
518
487
|
{
|
|
519
488
|
variant: "standard",
|
|
520
|
-
label:
|
|
489
|
+
label: Do,
|
|
521
490
|
fullWidth: !0,
|
|
522
491
|
size: "small",
|
|
523
|
-
sx:
|
|
524
|
-
|
|
525
|
-
|
|
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:
|
|
498
|
+
tabIndex: K
|
|
530
499
|
},
|
|
531
500
|
inputLabel: {
|
|
532
501
|
shrink: !0
|
|
533
502
|
}
|
|
534
503
|
},
|
|
535
|
-
type: (
|
|
536
|
-
defaultValue:
|
|
537
|
-
onBlur: /* @__PURE__ */
|
|
538
|
-
{ ...
|
|
539
|
-
|
|
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
|
-
) :
|
|
511
|
+
) : W
|
|
543
512
|
},
|
|
544
|
-
|
|
513
|
+
Bo
|
|
545
514
|
);
|
|
546
515
|
})
|
|
547
516
|
]
|
|
548
517
|
},
|
|
549
|
-
`${
|
|
518
|
+
`${y}-row-${u}`
|
|
550
519
|
);
|
|
551
520
|
}) })
|
|
552
521
|
]
|
|
@@ -554,14 +523,14 @@ function Rr({
|
|
|
554
523
|
)
|
|
555
524
|
}
|
|
556
525
|
),
|
|
557
|
-
|
|
558
|
-
|
|
526
|
+
Qo && /* @__PURE__ */ b(
|
|
527
|
+
wt,
|
|
559
528
|
{
|
|
560
|
-
dividerSx:
|
|
561
|
-
totalCount:
|
|
562
|
-
typographySx:
|
|
563
|
-
|
|
564
|
-
|
|
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
|
-
|
|
541
|
+
n(gr, "OwpDataTable");
|
|
573
542
|
export {
|
|
574
|
-
|
|
543
|
+
gr as OwpDataTable
|
|
575
544
|
};
|
|
576
545
|
//# sourceMappingURL=OwpDataTable.js.map
|