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