@cfx-dev/ui-components 2.1.16 → 2.1.18
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/assets/Table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._tableIcon_1yah3_1._iconButton_1yah3_1{width:calc(var(--quant) * 6);height:calc(var(--quant) * 6);display:inline-flex;align-items:center;justify-content:center;color:rgba(var(--color-secondary),1)}._tableIcon_1yah3_1._iconButton_1yah3_1{transition:background-color .25s ease,color .25s ease,opacity .25s ease,outline-offset 0s,outline 0s}._tableIcon_1yah3_1._iconButton_1yah3_1:hover{color:rgba(var(--color-primary),1);background-color:var(--color-button-linked-hover-background)}._tableIcon_1yah3_1._iconButton_1yah3_1:not(:disabled):active{transform:none;opacity:.8}._root_1yah3_21 table{width:100%;border-collapse:collapse;border-top-left-radius:var(--border-radius-small);border-top-right-radius:var(--border-radius-small);overflow:hidden}._root_1yah3_21 th,._root_1yah3_21 td{text-align:left;padding:0 calc(var(--quant) * .75);color:#fff;height:calc(var(--quant) * 8.75);box-sizing:border-box}._root_1yah3_21 td{padding:calc(var(--quant) * 1.5) calc(var(--quant) * .75)}._root_1yah3_21 ._radio_1yah3_38{padding:calc(var(--quant) * .25)}._root_1yah3_21 ._radio_1yah3_38 ._radioContent_1yah3_41{width:100%;height:100%;display:flex;align-items:center;justify-content:center}._root_1yah3_21 ._pointer_1yah3_48{cursor:pointer}._root_1yah3_21 ._selectedRow_1yah3_51{background-color:rgba(var(--color-secondary),.4);box-shadow:0 -1px rgba(var(--color-primary),1) inset}._root_1yah3_21 th{position:sticky;top:0;z-index:0;background-color:rgba(var(--color-bg-light),1)}._root_1yah3_21 th ._headerContent_1yah3_61{display:flex;align-items:center;flex-direction:row}._root_1yah3_21 th ._headerContent_1yah3_61 ._iconButton_1yah3_1{margin-left:var(--offset-medium)}._root_1yah3_21 tr{box-shadow:0 -1px rgba(var(--color-bg-light),1) inset;box-sizing:border-box}._root_1yah3_21 tr:hover{background-color:rgba(var(--color-secondary),.2)}._root_1yah3_21 tr:hover:not(._selectedRow_1yah3_51){box-shadow:none}
|
|
@@ -8,7 +8,7 @@ export interface IconButtonProps extends TextColorProps {
|
|
|
8
8
|
name: IconName;
|
|
9
9
|
size?: IconSize;
|
|
10
10
|
areaSize?: IconButtonAreaSize;
|
|
11
|
-
onClick?: () => void;
|
|
11
|
+
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
12
12
|
className?: string;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
ariaLabel?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import a, { useState as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import a, { useState as k } from "react";
|
|
3
|
+
import v from "../Checkbox/Checkbox.js";
|
|
4
4
|
import I from "../IconButton/IconButton.js";
|
|
5
5
|
import { Text as T } from "../Text/Text.js";
|
|
6
|
-
import { clsx as
|
|
7
|
-
import '../../assets/Table.css';const $ = "
|
|
6
|
+
import { clsx as y } from "../../utils/clsx.js";
|
|
7
|
+
import '../../assets/Table.css';const $ = "_tableIcon_1yah3_1", j = "_iconButton_1yah3_1", z = "_root_1yah3_21", A = "_radio_1yah3_38", E = "_radioContent_1yah3_41", O = "_pointer_1yah3_48", S = "_selectedRow_1yah3_51", F = "_headerContent_1yah3_61", c = {
|
|
8
8
|
tableIcon: $,
|
|
9
9
|
iconButton: j,
|
|
10
10
|
root: z,
|
|
@@ -18,7 +18,7 @@ function H(r) {
|
|
|
18
18
|
const {
|
|
19
19
|
className: e,
|
|
20
20
|
color: o = "inherit"
|
|
21
|
-
} = r, n =
|
|
21
|
+
} = r, n = y(c.tableIcon, c.iconButton, e);
|
|
22
22
|
return /* @__PURE__ */ t(I, { ...r, className: n, color: o });
|
|
23
23
|
}
|
|
24
24
|
function V(r) {
|
|
@@ -27,7 +27,7 @@ function V(r) {
|
|
|
27
27
|
onSortClick: o
|
|
28
28
|
} = r, n = a.useCallback(() => {
|
|
29
29
|
o && o(e.sortKey || e.text);
|
|
30
|
-
}, [e.sortKey, e.text, o]), b =
|
|
30
|
+
}, [e.sortKey, e.text, o]), b = y(c.headerContent, {
|
|
31
31
|
[c.sortable]: e.sortable,
|
|
32
32
|
[c.empty]: !e.text
|
|
33
33
|
});
|
|
@@ -36,7 +36,7 @@ function V(r) {
|
|
|
36
36
|
{
|
|
37
37
|
className: e.sortable ? c.pointer : void 0,
|
|
38
38
|
onClick: e.sortable ? n : void 0,
|
|
39
|
-
children: /* @__PURE__ */
|
|
39
|
+
children: /* @__PURE__ */ p("div", { className: b, children: [
|
|
40
40
|
/* @__PURE__ */ t(T, { color: "secondary", weight: "bold", uppercase: !0, size: "xxsmall", children: e.text }),
|
|
41
41
|
!!e.sortable && /* @__PURE__ */ t(
|
|
42
42
|
H,
|
|
@@ -63,18 +63,18 @@ function q(r) {
|
|
|
63
63
|
);
|
|
64
64
|
}, [i, e]), _ = a.useCallback(() => {
|
|
65
65
|
i(e);
|
|
66
|
-
}, [i, e]), f =
|
|
66
|
+
}, [i, e]), f = y({
|
|
67
67
|
[c.selectedRow]: n === e,
|
|
68
68
|
[c.pointer]: o
|
|
69
69
|
});
|
|
70
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ p(
|
|
71
71
|
"tr",
|
|
72
72
|
{
|
|
73
73
|
className: f,
|
|
74
74
|
onClick: o ? _ : void 0,
|
|
75
75
|
children: [
|
|
76
76
|
o && /* @__PURE__ */ t("td", { className: c.radio, children: /* @__PURE__ */ t("div", { className: c.radioContent, children: /* @__PURE__ */ t(
|
|
77
|
-
|
|
77
|
+
v,
|
|
78
78
|
{
|
|
79
79
|
size: "small",
|
|
80
80
|
onCheckedChange: u,
|
|
@@ -82,9 +82,9 @@ function q(r) {
|
|
|
82
82
|
checked: n === e
|
|
83
83
|
}
|
|
84
84
|
) }) }),
|
|
85
|
-
b.map((l,
|
|
85
|
+
b.map((l, C) => {
|
|
86
86
|
let m;
|
|
87
|
-
return a.isValidElement(l) ? m = l : h ? m = a.createElement(h, { item: l }) : m = String(l), /* @__PURE__ */ t("td", { children: m }, `item-${
|
|
87
|
+
return a.isValidElement(l) ? m = l : h ? m = a.createElement(h, { item: l }) : m = String(l), /* @__PURE__ */ t("td", { children: m }, `item-${C}`);
|
|
88
88
|
})
|
|
89
89
|
]
|
|
90
90
|
},
|
|
@@ -102,10 +102,10 @@ function P({
|
|
|
102
102
|
sortOrder: u = "asc",
|
|
103
103
|
onSortChange: _
|
|
104
104
|
}) {
|
|
105
|
-
const [f, l] =
|
|
106
|
-
const
|
|
107
|
-
m(s), N
|
|
108
|
-
}, [_,
|
|
105
|
+
const [f, l] = k(h), [C, m] = k(i), [w, x] = k(u), R = a.useCallback((s) => {
|
|
106
|
+
const N = C === s && w === "asc" ? "desc" : "asc";
|
|
107
|
+
m(s), x(N), _ == null || _(s, N);
|
|
108
|
+
}, [_, C, w]), B = a.useCallback(
|
|
109
109
|
(s) => {
|
|
110
110
|
const d = s === f ? null : s;
|
|
111
111
|
l(d), n == null || n(d);
|
|
@@ -117,15 +117,15 @@ function P({
|
|
|
117
117
|
}, [h]), a.useEffect(() => {
|
|
118
118
|
m(i);
|
|
119
119
|
}, [i]), a.useEffect(() => {
|
|
120
|
-
|
|
121
|
-
}, [u]), /* @__PURE__ */ t("div", { className: c.root, children: /* @__PURE__ */
|
|
122
|
-
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */
|
|
120
|
+
x(u);
|
|
121
|
+
}, [u]), /* @__PURE__ */ t("div", { className: c.root, children: /* @__PURE__ */ p("table", { children: [
|
|
122
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ p("tr", { children: [
|
|
123
123
|
o && /* @__PURE__ */ t("th", { "aria-label": "Select Row" }),
|
|
124
124
|
r.map((s, d) => /* @__PURE__ */ t(
|
|
125
125
|
V,
|
|
126
126
|
{
|
|
127
127
|
item: s,
|
|
128
|
-
onSortClick:
|
|
128
|
+
onSortClick: R
|
|
129
129
|
},
|
|
130
130
|
`header-${d}`
|
|
131
131
|
))
|
|
@@ -137,7 +137,7 @@ function P({
|
|
|
137
137
|
item: s,
|
|
138
138
|
includeRadio: o,
|
|
139
139
|
selectedRow: f,
|
|
140
|
-
onSelectChange:
|
|
140
|
+
onSelectChange: B,
|
|
141
141
|
dataContainer: b
|
|
142
142
|
},
|
|
143
143
|
`row-${d}`
|
package/dist/main.d.ts
CHANGED
|
@@ -65,6 +65,8 @@ export { Text, TextBlock, getTextOpacity, } from './components/Text';
|
|
|
65
65
|
export { Textarea } from './components/Textarea/Textarea';
|
|
66
66
|
export { Title, TITLE_OUTLET_ID } from './components/Title/Title';
|
|
67
67
|
export { InputDropzone } from './components/InputDropzone';
|
|
68
|
+
export type { ButtonProps, ButtonTheme } from './components/Button/Button';
|
|
69
|
+
export type { TitleProps, FixedOn } from './components/Title/Title';
|
|
68
70
|
export type { IconButtonProps } from './components/IconButton';
|
|
69
71
|
export type { ClipboardButtonProps } from './components/ClipboardButton';
|
|
70
72
|
export type { InputDropzoneProps, FileWithPath } from './components/InputDropzone';
|