@itilite/lumina-ui 1.0.0-alpha → 1.0.1-alpha
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/{AdvancedDateRangePicker-Eh6n4ne0.d.mts → AdvancedDateRangePicker-ozItnkhp.d.mts} +1 -1
- package/dist/{AdvancedDateRangePicker-Eh6n4ne0.d.ts → AdvancedDateRangePicker-ozItnkhp.d.ts} +1 -1
- package/dist/atom/AdvancedDateRangePicker/AdvancedDateRangePicker.d.mts +1 -1
- package/dist/atom/AdvancedDateRangePicker/AdvancedDateRangePicker.d.ts +1 -1
- package/dist/atom/AdvancedDateRangePicker/InternalCalendar.d.mts +1 -2
- package/dist/atom/AdvancedDateRangePicker/InternalCalendar.d.ts +1 -2
- package/dist/atom/LoadingSpinner/LoadingSpinner.d.mts +2 -2
- package/dist/atom/LoadingSpinner/LoadingSpinner.d.ts +2 -2
- package/dist/index.d.mts +14 -15
- package/dist/index.d.ts +14 -15
- package/dist/index.mjs +8 -8
- package/dist/styles.css +328 -312
- package/package.json +1 -1
- package/dist/AdvancedDateRangePicker-CN9WN0rH.d.mts +0 -56
- package/dist/AdvancedDateRangePicker-CN9WN0rH.d.ts +0 -56
- package/dist/AdvancedDateRangePicker-CzN1HGsC.d.mts +0 -57
- package/dist/AdvancedDateRangePicker-CzN1HGsC.d.ts +0 -57
- package/dist/AdvancedDateRangePicker-DAPxgRl3.d.mts +0 -54
- package/dist/AdvancedDateRangePicker-DAPxgRl3.d.ts +0 -54
- package/dist/AdvancedDateRangePicker-DW94285G.d.mts +0 -56
- package/dist/AdvancedDateRangePicker-DW94285G.d.ts +0 -56
- package/dist/Avatar-DX2JwvAs.d.mts +0 -17
- package/dist/Avatar-DX2JwvAs.d.ts +0 -17
- package/dist/Table-BA0D3p1m.d.mts +0 -78
- package/dist/Table-BA0D3p1m.d.ts +0 -78
- package/dist/Table-BLZ6c46U.d.mts +0 -77
- package/dist/Table-BLZ6c46U.d.ts +0 -77
- package/dist/Table-BMqYnFi4.d.mts +0 -25
- package/dist/Table-BMqYnFi4.d.ts +0 -25
- package/dist/Table-BRcthrYV.d.mts +0 -98
- package/dist/Table-BRcthrYV.d.ts +0 -98
- package/dist/Table-BWlFCfBG.d.mts +0 -106
- package/dist/Table-BWlFCfBG.d.ts +0 -106
- package/dist/Table-CHFmNrme.d.mts +0 -77
- package/dist/Table-CHFmNrme.d.ts +0 -77
- package/dist/Table-CX6UwQiD.d.mts +0 -116
- package/dist/Table-CX6UwQiD.d.ts +0 -116
- package/dist/Table-Chud2XSq.d.mts +0 -99
- package/dist/Table-Chud2XSq.d.ts +0 -99
- package/dist/Table-D5QRe_j3.d.mts +0 -121
- package/dist/Table-D5QRe_j3.d.ts +0 -121
- package/dist/Table-DAgFGahx.d.mts +0 -39
- package/dist/Table-DAgFGahx.d.ts +0 -39
- package/dist/Table-DWniK7At.d.mts +0 -87
- package/dist/Table-DWniK7At.d.ts +0 -87
- package/dist/Table-PyFlnUDu.d.mts +0 -47
- package/dist/Table-PyFlnUDu.d.ts +0 -47
- package/dist/Table-wqyg13Y9.d.mts +0 -77
- package/dist/Table-wqyg13Y9.d.ts +0 -77
- package/dist/Tag-l7I5oeyk.d.mts +0 -13
- package/dist/Tag-l7I5oeyk.d.ts +0 -13
- package/dist/atom/Table/LuminaPagination.d.mts +0 -7
- package/dist/atom/Table/LuminaPagination.d.ts +0 -7
- package/dist/atom/Table/LuminaPagination.js +0 -153
- package/dist/atom/Table/LuminaPagination.mjs +0 -9
- package/dist/atom/Table/TableAccordion.d.mts +0 -9
- package/dist/atom/Table/TableAccordion.d.ts +0 -9
- package/dist/atom/Table/TableAccordion.js +0 -91
- package/dist/atom/Table/TableAccordion.mjs +0 -10
- package/dist/atom/Table/TableColumnHeader.d.mts +0 -7
- package/dist/atom/Table/TableColumnHeader.d.ts +0 -7
- package/dist/atom/Table/TableColumnHeader.js +0 -151
- package/dist/atom/Table/TableColumnHeader.mjs +0 -10
- package/dist/atom/Table/TableToolbar.d.mts +0 -9
- package/dist/atom/Table/TableToolbar.d.ts +0 -9
- package/dist/atom/Table/TableToolbar.js +0 -114
- package/dist/atom/Table/TableToolbar.mjs +0 -10
- package/dist/atom/Table/__tests__/Table.test.d.mts +0 -2
- package/dist/atom/Table/__tests__/Table.test.d.ts +0 -2
- package/dist/atom/Table/__tests__/Table.test.js +0 -61133
- package/dist/atom/Table/__tests__/Table.test.mjs +0 -59522
- package/dist/atom/TableAccordion/index.d.mts +0 -17
- package/dist/atom/TableAccordion/index.d.ts +0 -17
- package/dist/atom/TableAccordion/index.js +0 -91
- package/dist/atom/TableAccordion/index.mjs +0 -9
- package/dist/atom/TableToolbar/index.d.mts +0 -23
- package/dist/atom/TableToolbar/index.d.ts +0 -23
- package/dist/atom/TableToolbar/index.js +0 -114
- package/dist/atom/TableToolbar/index.mjs +0 -9
- package/dist/chunk-2PIFDGVK.mjs +0 -420
- package/dist/chunk-35KDS27M.mjs +0 -618
- package/dist/chunk-3S4X3YO2.mjs +0 -64
- package/dist/chunk-3XUHGVYA.mjs +0 -77
- package/dist/chunk-5HF6Y37C.mjs +0 -642
- package/dist/chunk-5OGQ4YIR.mjs +0 -238
- package/dist/chunk-6FCSXN7R.mjs +0 -388
- package/dist/chunk-7W72LPSU.mjs +0 -66
- package/dist/chunk-A66QDQHK.mjs +0 -627
- package/dist/chunk-ABLIL47F.mjs +0 -618
- package/dist/chunk-AEPDEUGY.mjs +0 -627
- package/dist/chunk-AFLEGUF3.mjs +0 -232
- package/dist/chunk-APCEITHQ.mjs +0 -232
- package/dist/chunk-AVQBFGBT.mjs +0 -141
- package/dist/chunk-B5BOBELW.mjs +0 -213
- package/dist/chunk-BQ4PVLJ4.mjs +0 -262
- package/dist/chunk-DBNLBCQK.mjs +0 -64
- package/dist/chunk-DLLT6V65.mjs +0 -141
- package/dist/chunk-DOQQRYTS.mjs +0 -73
- package/dist/chunk-DSVR2DVF.mjs +0 -660
- package/dist/chunk-DXUPULDI.mjs +0 -424
- package/dist/chunk-E465D6OH.mjs +0 -644
- package/dist/chunk-E4FCLHYA.mjs +0 -678
- package/dist/chunk-ENQN5BAN.mjs +0 -225
- package/dist/chunk-F6VMSH4N.mjs +0 -79
- package/dist/chunk-FKGGN3FA.mjs +0 -412
- package/dist/chunk-GFTO2N3Q.mjs +0 -432
- package/dist/chunk-GM6H6RPJ.mjs +0 -232
- package/dist/chunk-HF3VJBMY.mjs +0 -244
- package/dist/chunk-HISCHZ5H.mjs +0 -77
- package/dist/chunk-HWQBE6PT.mjs +0 -99
- package/dist/chunk-HXM657YW.mjs +0 -115
- package/dist/chunk-I5VHKSQR.mjs +0 -64
- package/dist/chunk-ICSZZNTY.mjs +0 -384
- package/dist/chunk-IZGLD7U3.mjs +0 -667
- package/dist/chunk-J7X2PZG6.mjs +0 -232
- package/dist/chunk-JUXBLRMQ.mjs +0 -50
- package/dist/chunk-JXFSGADI.mjs +0 -678
- package/dist/chunk-KGKRSR6D.mjs +0 -388
- package/dist/chunk-KQKNFGWZ.mjs +0 -388
- package/dist/chunk-LCH4DXJY.mjs +0 -92
- package/dist/chunk-LCXU3K57.mjs +0 -232
- package/dist/chunk-LRN4XOIR.mjs +0 -71
- package/dist/chunk-LROMXY35.mjs +0 -116
- package/dist/chunk-LUNPHYAR.mjs +0 -681
- package/dist/chunk-LVOTEPLC.mjs +0 -64
- package/dist/chunk-M2ZM3X5Y.mjs +0 -56
- package/dist/chunk-M4MIYHAV.mjs +0 -43
- package/dist/chunk-M7F7DOC4.mjs +0 -41
- package/dist/chunk-MHWFVML4.mjs +0 -115
- package/dist/chunk-MPTVYTYS.mjs +0 -0
- package/dist/chunk-MQFW3LZR.mjs +0 -111
- package/dist/chunk-N355RJGH.mjs +0 -141
- package/dist/chunk-N3YFQDW7.mjs +0 -77
- package/dist/chunk-NGCBOOIE.mjs +0 -225
- package/dist/chunk-NWQQYJSP.mjs +0 -688
- package/dist/chunk-NYQV556V.mjs +0 -667
- package/dist/chunk-O5C3355V.mjs +0 -246
- package/dist/chunk-OCP43S7U.mjs +0 -241
- package/dist/chunk-OHLFRULE.mjs +0 -432
- package/dist/chunk-PLO46EKV.mjs +0 -65
- package/dist/chunk-PSBEYGD4.mjs +0 -618
- package/dist/chunk-PWIBJI6Z.mjs +0 -115
- package/dist/chunk-Q5KPXEH5.mjs +0 -223
- package/dist/chunk-QC34HHAY.mjs +0 -57
- package/dist/chunk-QVWV36BK.mjs +0 -73
- package/dist/chunk-QWK3MYDM.mjs +0 -64
- package/dist/chunk-RE44YAMD.mjs +0 -47
- package/dist/chunk-RH6DAYBU.mjs +0 -369
- package/dist/chunk-RSSEJENT.mjs +0 -269
- package/dist/chunk-SJBS5QCJ.mjs +0 -225
- package/dist/chunk-SWRFCTJW.mjs +0 -77
- package/dist/chunk-T4XNCAIB.mjs +0 -231
- package/dist/chunk-TCX5IFQ4.mjs +0 -627
- package/dist/chunk-TSAUBT2F.mjs +0 -74
- package/dist/chunk-U7Q7ILSE.mjs +0 -690
- package/dist/chunk-UHTUJJH7.mjs +0 -112
- package/dist/chunk-UOHYCMUS.mjs +0 -53
- package/dist/chunk-UQZBL3F7.mjs +0 -0
- package/dist/chunk-URGYNKJM.mjs +0 -229
- package/dist/chunk-UTMZY37A.mjs +0 -141
- package/dist/chunk-UUEPD2FH.mjs +0 -141
- package/dist/chunk-VQOUJQIF.mjs +0 -249
- package/dist/chunk-VY3QH43W.mjs +0 -6
- package/dist/chunk-W2N3AWY6.mjs +0 -80
- package/dist/chunk-WUVS6S7N.mjs +0 -119
- package/dist/chunk-WZS2K7X3.mjs +0 -688
- package/dist/chunk-X76GNSBB.mjs +0 -87
- package/dist/chunk-XG7CZXBW.mjs +0 -244
- package/dist/chunk-XXKIBYXD.mjs +0 -109
- package/dist/chunk-XXTUVMAY.mjs +0 -51
- package/dist/chunk-Y3BIY4DW.mjs +0 -618
- package/dist/chunk-Y7FP6ZMW.mjs +0 -225
- package/dist/chunk-YELLXCMY.mjs +0 -265
- package/dist/chunk-YQEEM26W.mjs +0 -232
- package/dist/chunk-ZGFE3OPJ.mjs +0 -678
- package/dist/chunk-ZMJ3KDDY.mjs +0 -618
- package/dist/chunk-ZYPWQ53U.mjs +0 -6
- package/dist/dist-U2IPN4FB.mjs +0 -567
- package/dist/magic-string.es-XOWQCRDO.mjs +0 -1311
- package/dist/types-CA0Wby2L.d.mts +0 -67
- package/dist/types-CA0Wby2L.d.ts +0 -67
- package/dist/types-CncMmuJM.d.mts +0 -44
- package/dist/types-CncMmuJM.d.ts +0 -44
- package/dist/types-D4fdeMWQ.d.mts +0 -62
- package/dist/types-D4fdeMWQ.d.ts +0 -62
package/dist/chunk-ENQN5BAN.mjs
DELETED
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__objRest,
|
|
3
|
-
__spreadProps,
|
|
4
|
-
__spreadValues
|
|
5
|
-
} from "./chunk-HWQBE6PT.mjs";
|
|
6
|
-
|
|
7
|
-
// src/atom/Table/Table.tsx
|
|
8
|
-
import * as React from "react";
|
|
9
|
-
import { Table as AntTable } from "antd";
|
|
10
|
-
import clsx from "clsx";
|
|
11
|
-
|
|
12
|
-
// src/atom/Table/Table.module.scss
|
|
13
|
-
var Table_module_default = { "tableWrapper": "Table-module__tableWrapper___3cqiD", "childVariant": "Table-module__childVariant___z8tqO", "showHoverEffect": "Table-module__showHoverEffect___IyKyO", "table": "Table-module__table___5d7g0", "columnHeader": "Table-module__columnHeader___Unr6d", "columnHeaderSortArea": "Table-module__columnHeaderSortArea___jrIYo", "columnHeaderLabel": "Table-module__columnHeaderLabel___A-mRu", "columnHeaderSortIcon": "Table-module__columnHeaderSortIcon___mWVZN", "columnHeaderSortIconActive": "Table-module__columnHeaderSortIconActive___wHAqC", "columnHeaderFilterWrapper": "Table-module__columnHeaderFilterWrapper___DnSve", "columnHeaderFilterBtn": "Table-module__columnHeaderFilterBtn___NR7DY", "columnHeaderFilterBtnActive": "Table-module__columnHeaderFilterBtnActive___JdO11", "columnHeaderFilterBadge": "Table-module__columnHeaderFilterBadge___-Q2T2", "columnHeaderFilterDropdown": "Table-module__columnHeaderFilterDropdown___M-fD4" };
|
|
14
|
-
|
|
15
|
-
// src/atom/Table/Table.tsx
|
|
16
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
-
function buildPagination(pagination) {
|
|
18
|
-
if (pagination === false || pagination === void 0) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
const defaults = {
|
|
22
|
-
showSizeChanger: true,
|
|
23
|
-
pageSizeOptions: [10, 25, 50],
|
|
24
|
-
showTotal: (total, range) => `${range[0]}\u2013${range[1]} of ${total} items`
|
|
25
|
-
};
|
|
26
|
-
if (pagination === true) {
|
|
27
|
-
return defaults;
|
|
28
|
-
}
|
|
29
|
-
return __spreadValues(__spreadValues({}, defaults), pagination);
|
|
30
|
-
}
|
|
31
|
-
function SortBothIcon() {
|
|
32
|
-
return /* @__PURE__ */ jsxs("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: [
|
|
33
|
-
/* @__PURE__ */ jsx("path", { d: "M3.5 7.5L6 10L8.5 7.5", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
34
|
-
/* @__PURE__ */ jsx("path", { d: "M3.5 4.5L6 2L8.5 4.5", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
35
|
-
] });
|
|
36
|
-
}
|
|
37
|
-
function SortAscIcon() {
|
|
38
|
-
return /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M3.5 7.5L6 2L8.5 7.5", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
39
|
-
}
|
|
40
|
-
function SortDescIcon() {
|
|
41
|
-
return /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M3.5 4.5L6 10L8.5 4.5", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
42
|
-
}
|
|
43
|
-
function FilterIcon() {
|
|
44
|
-
return /* @__PURE__ */ jsxs("svg", { width: "13", height: "11", viewBox: "0 0 13 11", fill: "none", "aria-hidden": "true", children: [
|
|
45
|
-
/* @__PURE__ */ jsx("path", { d: "M1 1H12", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" }),
|
|
46
|
-
/* @__PURE__ */ jsx("path", { d: "M2.5 4.5H10.5", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" }),
|
|
47
|
-
/* @__PURE__ */ jsx("path", { d: "M4.5 8H8.5", stroke: "currentColor", strokeWidth: "1.3", strokeLinecap: "round" })
|
|
48
|
-
] });
|
|
49
|
-
}
|
|
50
|
-
function nextSortOrder(current) {
|
|
51
|
-
if (current === void 0) return "ascend";
|
|
52
|
-
if (current === "ascend") return "descend";
|
|
53
|
-
return void 0;
|
|
54
|
-
}
|
|
55
|
-
function ColumnHeader({
|
|
56
|
-
label,
|
|
57
|
-
sortable = false,
|
|
58
|
-
sortOrder,
|
|
59
|
-
onSortChange,
|
|
60
|
-
sortIcon,
|
|
61
|
-
filterCount = 0,
|
|
62
|
-
filterIcon,
|
|
63
|
-
filterContent
|
|
64
|
-
}) {
|
|
65
|
-
const [filterOpen, setFilterOpen] = React.useState(false);
|
|
66
|
-
const wrapperRef = React.useRef(null);
|
|
67
|
-
const filterActive = filterCount > 0;
|
|
68
|
-
const hasFilter = filterContent !== void 0;
|
|
69
|
-
React.useEffect(() => {
|
|
70
|
-
if (!filterOpen) return;
|
|
71
|
-
const onOutside = (e) => {
|
|
72
|
-
if (wrapperRef.current && !wrapperRef.current.contains(e.target)) {
|
|
73
|
-
setFilterOpen(false);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
document.addEventListener("mousedown", onOutside);
|
|
77
|
-
return () => document.removeEventListener("mousedown", onOutside);
|
|
78
|
-
}, [filterOpen]);
|
|
79
|
-
return /* @__PURE__ */ jsxs("div", { className: Table_module_default.columnHeader, ref: wrapperRef, children: [
|
|
80
|
-
sortable ? /* @__PURE__ */ jsxs(
|
|
81
|
-
"button",
|
|
82
|
-
{
|
|
83
|
-
type: "button",
|
|
84
|
-
className: Table_module_default.columnHeaderSortArea,
|
|
85
|
-
onClick: () => onSortChange == null ? void 0 : onSortChange(nextSortOrder(sortOrder)),
|
|
86
|
-
"aria-label": typeof label === "string" ? `Sort by ${label}` : "Sort",
|
|
87
|
-
children: [
|
|
88
|
-
/* @__PURE__ */ jsx("span", { className: Table_module_default.columnHeaderLabel, children: label }),
|
|
89
|
-
/* @__PURE__ */ jsx(
|
|
90
|
-
"span",
|
|
91
|
-
{
|
|
92
|
-
className: clsx(Table_module_default.columnHeaderSortIcon, {
|
|
93
|
-
[Table_module_default.columnHeaderSortIconActive]: sortOrder !== void 0
|
|
94
|
-
}),
|
|
95
|
-
children: sortIcon != null ? sortIcon : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
96
|
-
sortOrder === "ascend" && /* @__PURE__ */ jsx(SortAscIcon, {}),
|
|
97
|
-
sortOrder === "descend" && /* @__PURE__ */ jsx(SortDescIcon, {}),
|
|
98
|
-
sortOrder === void 0 && /* @__PURE__ */ jsx(SortBothIcon, {})
|
|
99
|
-
] })
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
]
|
|
103
|
-
}
|
|
104
|
-
) : /* @__PURE__ */ jsx("span", { className: Table_module_default.columnHeaderLabel, children: label }),
|
|
105
|
-
hasFilter && /* @__PURE__ */ jsxs("div", { className: Table_module_default.columnHeaderFilterWrapper, children: [
|
|
106
|
-
/* @__PURE__ */ jsxs(
|
|
107
|
-
"button",
|
|
108
|
-
{
|
|
109
|
-
type: "button",
|
|
110
|
-
className: clsx(Table_module_default.columnHeaderFilterBtn, {
|
|
111
|
-
[Table_module_default.columnHeaderFilterBtnActive]: filterActive
|
|
112
|
-
}),
|
|
113
|
-
onClick: () => setFilterOpen((v) => !v),
|
|
114
|
-
"aria-label": typeof label === "string" ? `Filter ${label}` : "Filter",
|
|
115
|
-
"aria-expanded": filterOpen,
|
|
116
|
-
"aria-haspopup": "dialog",
|
|
117
|
-
children: [
|
|
118
|
-
filterIcon != null ? filterIcon : /* @__PURE__ */ jsx(FilterIcon, {}),
|
|
119
|
-
filterActive && /* @__PURE__ */ jsx("span", { className: Table_module_default.columnHeaderFilterBadge, children: filterCount })
|
|
120
|
-
]
|
|
121
|
-
}
|
|
122
|
-
),
|
|
123
|
-
filterOpen && /* @__PURE__ */ jsx("div", { className: Table_module_default.columnHeaderFilterDropdown, role: "dialog", children: filterContent })
|
|
124
|
-
] })
|
|
125
|
-
] });
|
|
126
|
-
}
|
|
127
|
-
function processColumns(columns) {
|
|
128
|
-
if (!columns) return void 0;
|
|
129
|
-
return columns.map((col) => {
|
|
130
|
-
const _a = col, { headerProps, title } = _a, rest = __objRest(_a, ["headerProps", "title"]);
|
|
131
|
-
if (!headerProps) return __spreadValues({ title }, rest);
|
|
132
|
-
return __spreadProps(__spreadValues({}, rest), {
|
|
133
|
-
title: /* @__PURE__ */ jsx(ColumnHeader, __spreadValues({ label: title }, headerProps))
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
function Table(props) {
|
|
138
|
-
const _a = props, {
|
|
139
|
-
size = "middle",
|
|
140
|
-
variant = "default",
|
|
141
|
-
className = "",
|
|
142
|
-
analytics: _analytics,
|
|
143
|
-
pagination,
|
|
144
|
-
columns,
|
|
145
|
-
rowSelection,
|
|
146
|
-
rowKey = "key",
|
|
147
|
-
onRow,
|
|
148
|
-
dataSource
|
|
149
|
-
} = _a, rest = __objRest(_a, [
|
|
150
|
-
"size",
|
|
151
|
-
"variant",
|
|
152
|
-
"className",
|
|
153
|
-
"analytics",
|
|
154
|
-
"pagination",
|
|
155
|
-
"columns",
|
|
156
|
-
"rowSelection",
|
|
157
|
-
"rowKey",
|
|
158
|
-
"onRow",
|
|
159
|
-
"dataSource"
|
|
160
|
-
]);
|
|
161
|
-
const isChildVariant = variant === "accordion-child" || variant === "toolbar-child";
|
|
162
|
-
const resolvedPagination = buildPagination(pagination);
|
|
163
|
-
const processedColumns = React.useMemo(
|
|
164
|
-
() => processColumns(columns),
|
|
165
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
166
|
-
[columns]
|
|
167
|
-
);
|
|
168
|
-
const resolvedOnRow = React.useMemo(() => {
|
|
169
|
-
const onChange = rowSelection == null ? void 0 : rowSelection.onChange;
|
|
170
|
-
if (variant !== "selectable" || !onChange) return onRow;
|
|
171
|
-
return (record, index) => {
|
|
172
|
-
var _a2;
|
|
173
|
-
const base = (_a2 = onRow == null ? void 0 : onRow(record, index)) != null ? _a2 : {};
|
|
174
|
-
const getKey = (r, i) => typeof rowKey === "function" ? rowKey(r, i) : r[rowKey];
|
|
175
|
-
return __spreadProps(__spreadValues({}, base), {
|
|
176
|
-
style: __spreadValues({ cursor: "pointer" }, base.style),
|
|
177
|
-
onClick: (e) => {
|
|
178
|
-
var _a3, _b;
|
|
179
|
-
(_a3 = base.onClick) == null ? void 0 : _a3.call(base, e);
|
|
180
|
-
const key = getKey(record, index);
|
|
181
|
-
const current = (_b = rowSelection.selectedRowKeys) != null ? _b : [];
|
|
182
|
-
const isSelected = current.some((k) => k === key);
|
|
183
|
-
const newKeys = isSelected ? current.filter((k) => k !== key) : [...current, key];
|
|
184
|
-
const newRows = (dataSource != null ? dataSource : []).filter(
|
|
185
|
-
(r) => newKeys.some((k) => k === getKey(r))
|
|
186
|
-
);
|
|
187
|
-
onChange(newKeys, newRows, { type: "single" });
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
};
|
|
191
|
-
}, [variant, rowSelection, rowKey, onRow, dataSource]);
|
|
192
|
-
return /* @__PURE__ */ jsx(
|
|
193
|
-
"div",
|
|
194
|
-
{
|
|
195
|
-
className: clsx(
|
|
196
|
-
Table_module_default.tableWrapper,
|
|
197
|
-
{ [Table_module_default.childVariant]: isChildVariant },
|
|
198
|
-
{ [Table_module_default.showHoverEffect]: variant === "hover" || variant === "selectable" },
|
|
199
|
-
`variant_${variant}`,
|
|
200
|
-
className
|
|
201
|
-
),
|
|
202
|
-
"data-testid": "lumina-table",
|
|
203
|
-
children: /* @__PURE__ */ jsx(
|
|
204
|
-
AntTable,
|
|
205
|
-
__spreadValues({
|
|
206
|
-
className: Table_module_default.table,
|
|
207
|
-
size,
|
|
208
|
-
pagination: resolvedPagination,
|
|
209
|
-
columns: processedColumns,
|
|
210
|
-
rowSelection,
|
|
211
|
-
rowKey,
|
|
212
|
-
onRow: resolvedOnRow,
|
|
213
|
-
dataSource
|
|
214
|
-
}, rest)
|
|
215
|
-
)
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
}
|
|
219
|
-
Table.displayName = "Table";
|
|
220
|
-
var Table_default = Table;
|
|
221
|
-
|
|
222
|
-
export {
|
|
223
|
-
Table,
|
|
224
|
-
Table_default
|
|
225
|
-
};
|
package/dist/chunk-F6VMSH4N.mjs
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Table_module_default
|
|
3
|
-
} from "./chunk-ZYPWQ53U.mjs";
|
|
4
|
-
|
|
5
|
-
// src/atom/Table/TableToolbar.tsx
|
|
6
|
-
import * as React from "react";
|
|
7
|
-
import clsx from "clsx";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
var TableToolbar = ({
|
|
10
|
-
searchPlaceholder = "Search...",
|
|
11
|
-
onSearch,
|
|
12
|
-
editColumnsLabel = "Edit Columns",
|
|
13
|
-
onEditColumns,
|
|
14
|
-
addFilterLabel = "+ Add filter",
|
|
15
|
-
onAddFilter,
|
|
16
|
-
className,
|
|
17
|
-
children
|
|
18
|
-
}) => {
|
|
19
|
-
const [searchValue, setSearchValue] = React.useState("");
|
|
20
|
-
const handleSearchChange = (e) => {
|
|
21
|
-
setSearchValue(e.target.value);
|
|
22
|
-
onSearch == null ? void 0 : onSearch(e.target.value);
|
|
23
|
-
};
|
|
24
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx(Table_module_default.toolbarWrapper, className), "data-testid": "lumina-table-toolbar", children: [
|
|
25
|
-
/* @__PURE__ */ jsxs("div", { className: Table_module_default.toolbarTopRow, children: [
|
|
26
|
-
/* @__PURE__ */ jsxs("div", { className: Table_module_default.toolbarSearchInputWrapper, children: [
|
|
27
|
-
/* @__PURE__ */ jsx("span", { className: Table_module_default.toolbarSearchIcon, "aria-hidden": "true", children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
28
|
-
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "4.5", stroke: "#9CA3AF", strokeWidth: "1.5" }),
|
|
29
|
-
/* @__PURE__ */ jsx("path", { d: "M10.5 10.5L13.5 13.5", stroke: "#9CA3AF", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
30
|
-
] }) }),
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
32
|
-
"input",
|
|
33
|
-
{
|
|
34
|
-
className: Table_module_default.toolbarSearchInput,
|
|
35
|
-
type: "text",
|
|
36
|
-
placeholder: searchPlaceholder,
|
|
37
|
-
value: searchValue,
|
|
38
|
-
onChange: handleSearchChange,
|
|
39
|
-
"aria-label": "Search"
|
|
40
|
-
}
|
|
41
|
-
)
|
|
42
|
-
] }),
|
|
43
|
-
/* @__PURE__ */ jsxs(
|
|
44
|
-
"button",
|
|
45
|
-
{
|
|
46
|
-
className: Table_module_default.toolbarEditColumnsBtn,
|
|
47
|
-
onClick: onEditColumns,
|
|
48
|
-
type: "button",
|
|
49
|
-
"data-testid": "edit-columns-btn",
|
|
50
|
-
children: [
|
|
51
|
-
/* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
52
|
-
/* @__PURE__ */ jsx("rect", { x: "2", y: "3", width: "3", height: "10", rx: "1", stroke: "#374151", strokeWidth: "1.25" }),
|
|
53
|
-
/* @__PURE__ */ jsx("rect", { x: "6.5", y: "3", width: "3", height: "10", rx: "1", stroke: "#374151", strokeWidth: "1.25" }),
|
|
54
|
-
/* @__PURE__ */ jsx("rect", { x: "11", y: "3", width: "3", height: "10", rx: "1", stroke: "#374151", strokeWidth: "1.25" })
|
|
55
|
-
] }),
|
|
56
|
-
editColumnsLabel
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
] }),
|
|
61
|
-
/* @__PURE__ */ jsx("div", { className: Table_module_default.toolbarFilterRow, children: /* @__PURE__ */ jsx(
|
|
62
|
-
"button",
|
|
63
|
-
{
|
|
64
|
-
className: Table_module_default.toolbarAddFilterBtn,
|
|
65
|
-
onClick: onAddFilter,
|
|
66
|
-
type: "button",
|
|
67
|
-
"data-testid": "add-filter-btn",
|
|
68
|
-
children: addFilterLabel
|
|
69
|
-
}
|
|
70
|
-
) }),
|
|
71
|
-
/* @__PURE__ */ jsx("div", { className: Table_module_default.toolbarTableSlot, children })
|
|
72
|
-
] });
|
|
73
|
-
};
|
|
74
|
-
var TableToolbar_default = TableToolbar;
|
|
75
|
-
|
|
76
|
-
export {
|
|
77
|
-
TableToolbar,
|
|
78
|
-
TableToolbar_default
|
|
79
|
-
};
|