@caseparts-org/caseblocks 0.0.149 → 0.0.150
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,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as S, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import d from "react";
|
|
3
|
-
import { c as
|
|
3
|
+
import { c as u } from "./clsx-OuTLNxxd.js";
|
|
4
4
|
import { Icon as Y } from "./atoms/Icon/Icon.js";
|
|
5
5
|
import './assets/Table.css';const Z = "_table_14k11_2", $ = "_noPaddingRow_14k11_71", I = "_clickableRow_14k11_82", P = "_clickableCell_14k11_83", ee = "_expandedContentCell_14k11_85", ne = "_expandedContentRow_14k11_94", te = "_expandedRow_14k11_99", le = "_expanded_14k11_85", ae = "_columnContent_14k11_135", oe = "_clickableHeader_14k11_155", n = {
|
|
6
6
|
"table-container": "_table-container_14k11_2",
|
|
@@ -17,25 +17,25 @@ import './assets/Table.css';const Z = "_table_14k11_2", $ = "_noPaddingRow_14k11
|
|
|
17
17
|
columnContent: ae,
|
|
18
18
|
clickableHeader: oe,
|
|
19
19
|
"icon-ascending": "_icon-ascending_14k11_156"
|
|
20
|
-
}, V = ({ children:
|
|
20
|
+
}, V = ({ children: i }) => null;
|
|
21
21
|
V.displayName = "Table.Columns";
|
|
22
|
-
const v = ({ children:
|
|
22
|
+
const v = ({ children: i }) => null;
|
|
23
23
|
v.displayName = "Table.Column";
|
|
24
|
-
const j = ({ children:
|
|
24
|
+
const j = ({ children: i }) => null;
|
|
25
25
|
j.displayName = "Table.Body";
|
|
26
|
-
const M = ({ children:
|
|
26
|
+
const M = ({ children: i }) => null;
|
|
27
27
|
M.displayName = "Table.Row";
|
|
28
|
-
const O = ({ children:
|
|
28
|
+
const O = ({ children: i }) => null;
|
|
29
29
|
O.displayName = "Table.Cell";
|
|
30
|
-
const
|
|
30
|
+
const f = ({ children: i, className: z, alternatingRows: D = !1, isSortable: w = !1, sortField: q, sortFieldKey: G, sortOrder: J = "descending", onSort: F, ...L }) => {
|
|
31
31
|
const B = [];
|
|
32
32
|
let R, g;
|
|
33
|
-
const
|
|
33
|
+
const m = (t, l) => {
|
|
34
34
|
var e;
|
|
35
35
|
return !!t && d.isValidElement(t) && ((e = t.type) == null ? void 0 : e.displayName) === l;
|
|
36
36
|
};
|
|
37
|
-
d.Children.forEach(
|
|
38
|
-
|
|
37
|
+
d.Children.forEach(i, (t) => {
|
|
38
|
+
m(t, "Table.Columns") ? R = t : m(t, "Table.Body") ? g = t : B.push(t);
|
|
39
39
|
});
|
|
40
40
|
const A = (t) => t.flatMap((l) => {
|
|
41
41
|
if (d.isValidElement(l) && l.type === d.Fragment) {
|
|
@@ -47,32 +47,32 @@ const _ = ({ children: r, className: z, alternatingRows: D = !1, isSortable: w =
|
|
|
47
47
|
if (!R) return null;
|
|
48
48
|
const t = d.Children.toArray(R.props.children);
|
|
49
49
|
return /* @__PURE__ */ s("thead", { className: n.thead, children: /* @__PURE__ */ s("tr", { children: t.map((l, e) => {
|
|
50
|
-
if (
|
|
50
|
+
if (m(l, "Table.Column")) {
|
|
51
51
|
const c = l, {
|
|
52
52
|
children: a,
|
|
53
|
-
align:
|
|
53
|
+
align: r,
|
|
54
54
|
colSpan: C,
|
|
55
55
|
width: b,
|
|
56
56
|
style: N,
|
|
57
|
-
sortField:
|
|
57
|
+
sortField: y,
|
|
58
58
|
sortFieldKey: o,
|
|
59
|
-
...
|
|
59
|
+
...k
|
|
60
60
|
} = c.props, E = {
|
|
61
|
-
textAlign:
|
|
61
|
+
textAlign: r ?? "left",
|
|
62
62
|
width: b,
|
|
63
63
|
...N
|
|
64
|
-
},
|
|
64
|
+
}, T = r === "right" ? "flex-end" : r === "center" ? "center" : "flex-start", _ = !!y, x = w && _ && (_ && q === y) && (o !== void 0 ? G === o : !0), p = w && _ && typeof F == "function";
|
|
65
65
|
return /* @__PURE__ */ s(
|
|
66
66
|
"th",
|
|
67
67
|
{
|
|
68
|
-
className:
|
|
68
|
+
className: u(n.th, x && n["sorted-column"], p && n.clickableHeader),
|
|
69
69
|
style: E,
|
|
70
70
|
colSpan: C,
|
|
71
|
-
onClick:
|
|
72
|
-
...
|
|
73
|
-
children: /* @__PURE__ */ S("div", { className: n.columnContent, children: [
|
|
71
|
+
onClick: p ? () => F(y, o) : void 0,
|
|
72
|
+
...k,
|
|
73
|
+
children: /* @__PURE__ */ S("div", { className: n.columnContent, style: { justifyContent: T }, children: [
|
|
74
74
|
a,
|
|
75
|
-
|
|
75
|
+
x && /* @__PURE__ */ s("span", { className: u(J === "ascending" && n["icon-ascending"]), children: /* @__PURE__ */ s(Y, { iconKey: "fa-solid fa-chevron-down", size: "3xs" }) })
|
|
76
76
|
] })
|
|
77
77
|
},
|
|
78
78
|
e
|
|
@@ -81,62 +81,62 @@ const _ = ({ children: r, className: z, alternatingRows: D = !1, isSortable: w =
|
|
|
81
81
|
return /* @__PURE__ */ s("th", { className: n.th, children: l }, e);
|
|
82
82
|
}) }) });
|
|
83
83
|
}, h = (t, l, e) => {
|
|
84
|
-
const c = d.Children.toArray(t).map((o,
|
|
85
|
-
if (
|
|
84
|
+
const c = d.Children.toArray(t).map((o, k) => {
|
|
85
|
+
if (m(o, "Table.Cell")) {
|
|
86
86
|
const E = o, {
|
|
87
|
-
children:
|
|
88
|
-
align:
|
|
89
|
-
colSpan:
|
|
90
|
-
width:
|
|
87
|
+
children: T,
|
|
88
|
+
align: _,
|
|
89
|
+
colSpan: H,
|
|
90
|
+
width: K,
|
|
91
91
|
style: x,
|
|
92
|
-
...
|
|
92
|
+
...p
|
|
93
93
|
} = E.props, W = {
|
|
94
|
-
textAlign:
|
|
95
|
-
width:
|
|
94
|
+
textAlign: _ ?? "left",
|
|
95
|
+
width: K,
|
|
96
96
|
...x
|
|
97
|
-
}, X = !!(
|
|
97
|
+
}, X = !!(p && typeof p.onClick == "function");
|
|
98
98
|
return /* @__PURE__ */ s(
|
|
99
99
|
"td",
|
|
100
100
|
{
|
|
101
|
-
className:
|
|
101
|
+
className: u(
|
|
102
102
|
n.cell,
|
|
103
103
|
(e == null ? void 0 : e.isExpanded) && n.expanded,
|
|
104
104
|
(e == null ? void 0 : e.isExpandedContent) && n.expandedContentCell,
|
|
105
105
|
X && n.clickableCell
|
|
106
106
|
),
|
|
107
107
|
style: W,
|
|
108
|
-
colSpan:
|
|
109
|
-
...
|
|
110
|
-
children:
|
|
108
|
+
colSpan: H,
|
|
109
|
+
...p,
|
|
110
|
+
children: T
|
|
111
111
|
},
|
|
112
|
-
|
|
112
|
+
k
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
return d.isValidElement(o) && typeof o.type == "string" && o.type === "td" ? o : /* @__PURE__ */ s(
|
|
116
116
|
"td",
|
|
117
117
|
{
|
|
118
|
-
className:
|
|
118
|
+
className: u(
|
|
119
119
|
n.cell,
|
|
120
120
|
(e == null ? void 0 : e.isExpanded) && n.expanded,
|
|
121
121
|
(e == null ? void 0 : e.isExpandedContent) && n.expandedContentCell
|
|
122
122
|
),
|
|
123
123
|
children: o
|
|
124
124
|
},
|
|
125
|
-
|
|
125
|
+
k
|
|
126
126
|
);
|
|
127
|
-
}), { className: a, style:
|
|
127
|
+
}), { className: a, style: r, isExpanded: C, isExpandedContent: b, ...N } = e ?? {}, y = !!(e && typeof e.onClick == "function");
|
|
128
128
|
return /* @__PURE__ */ s(
|
|
129
129
|
"tr",
|
|
130
130
|
{
|
|
131
|
-
className:
|
|
131
|
+
className: u(
|
|
132
132
|
n.row,
|
|
133
133
|
a,
|
|
134
134
|
C && n.expandedRow,
|
|
135
135
|
b && n.noPaddingRow,
|
|
136
136
|
b && n.expandedContentRow,
|
|
137
|
-
|
|
137
|
+
y && n.clickableRow
|
|
138
138
|
),
|
|
139
|
-
style:
|
|
139
|
+
style: r,
|
|
140
140
|
...N,
|
|
141
141
|
children: c
|
|
142
142
|
},
|
|
@@ -144,17 +144,17 @@ const _ = ({ children: r, className: z, alternatingRows: D = !1, isSortable: w =
|
|
|
144
144
|
);
|
|
145
145
|
}, U = () => {
|
|
146
146
|
if (g) {
|
|
147
|
-
const c = A(d.Children.toArray(g.props.children)).map((a,
|
|
148
|
-
if (
|
|
147
|
+
const c = A(d.Children.toArray(g.props.children)).map((a, r) => {
|
|
148
|
+
if (m(a, "Table.Row")) {
|
|
149
149
|
const C = a;
|
|
150
|
-
return h(C.props.children,
|
|
150
|
+
return h(C.props.children, r, C.props);
|
|
151
151
|
}
|
|
152
|
-
return d.isValidElement(a) && typeof a.type == "string" && a.type === "tr" ? a : h(a,
|
|
152
|
+
return d.isValidElement(a) && typeof a.type == "string" && a.type === "tr" ? a : h(a, r);
|
|
153
153
|
});
|
|
154
154
|
return /* @__PURE__ */ s("tbody", { className: n.tbody, children: c });
|
|
155
155
|
}
|
|
156
156
|
const l = A(B).map((e, c) => {
|
|
157
|
-
if (
|
|
157
|
+
if (m(e, "Table.Row")) {
|
|
158
158
|
const a = e;
|
|
159
159
|
return h(a.props.children, c, a.props);
|
|
160
160
|
}
|
|
@@ -162,17 +162,17 @@ const _ = ({ children: r, className: z, alternatingRows: D = !1, isSortable: w =
|
|
|
162
162
|
});
|
|
163
163
|
return /* @__PURE__ */ s("tbody", { className: n.tbody, children: l });
|
|
164
164
|
};
|
|
165
|
-
return /* @__PURE__ */ S("table", { className:
|
|
165
|
+
return /* @__PURE__ */ S("table", { className: u(n.table, z, D && n["table-alternating"]), ...L, children: [
|
|
166
166
|
Q(),
|
|
167
167
|
U()
|
|
168
168
|
] });
|
|
169
169
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
f.Columns = V;
|
|
171
|
+
f.Column = v;
|
|
172
|
+
f.Body = j;
|
|
173
|
+
f.Row = M;
|
|
174
|
+
f.Cell = O;
|
|
175
175
|
export {
|
|
176
|
-
|
|
176
|
+
f as T,
|
|
177
177
|
n as s
|
|
178
178
|
};
|
package/dist/main-client.js
CHANGED
|
@@ -39,7 +39,7 @@ import { AnimatedCheckMark as Mo } from "./molecules/StatefulButton/AnimatedChec
|
|
|
39
39
|
import { AddToCart as vo } from "./molecules/AddToCart/AddToCart.js";
|
|
40
40
|
import { Modal as ho } from "./molecules/Modal/Modal.js";
|
|
41
41
|
import { ImageViewer as yo } from "./molecules/ImageViewer/ImageViewer.js";
|
|
42
|
-
import { T as Ho } from "./Table-
|
|
42
|
+
import { T as Ho } from "./Table-BX4PtCNE.js";
|
|
43
43
|
import { MainNav as Vo } from "./organisms/MainNav/MainNav.js";
|
|
44
44
|
import { ChipSelector as Go } from "./organisms/ChipSelector/ChipSelector.js";
|
|
45
45
|
import { Product as Qo } from "./organisms/Product/Product.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import R, { useState as d, useEffect as P } from "react";
|
|
3
|
-
import { T as t, s as x } from "../../Table-
|
|
3
|
+
import { T as t, s as x } from "../../Table-BX4PtCNE.js";
|
|
4
4
|
const v = {
|
|
5
5
|
title: "Case Parts/Molecules/Table",
|
|
6
6
|
component: t,
|