@expcat/tigercat-react 1.2.37 → 1.2.39
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/{chunk-6HELKWFN.js → chunk-3LCISRAV.js} +17 -3
- package/dist/{chunk-KRFD27WA.js → chunk-AT2GRD6F.js} +2 -2
- package/dist/{chunk-L2CAJUXH.js → chunk-FZX7USS4.js} +48 -7
- package/dist/{chunk-2CJKAO2I.mjs → chunk-JDJFSO2D.mjs} +48 -7
- package/dist/{chunk-UKBVJWP3.mjs → chunk-LJARWKJT.mjs} +1 -1
- package/dist/{chunk-JNRUOQNT.js → chunk-LJDILPI6.js} +2 -2
- package/dist/{chunk-MIINT2WV.js → chunk-M36PT6BS.js} +199 -72
- package/dist/{chunk-VE2YEFG2.mjs → chunk-PCPAMUAE.mjs} +1 -1
- package/dist/{chunk-O4UDB6ZE.mjs → chunk-TAYQDWXN.mjs} +1 -1
- package/dist/{chunk-ZGPOMSGD.mjs → chunk-TSZKBVTA.mjs} +198 -71
- package/dist/{chunk-IAONLOJN.js → chunk-XU4TF2YA.js} +2 -2
- package/dist/{chunk-4XOWNEZA.mjs → chunk-ZDEOTMXP.mjs} +17 -3
- package/dist/components/ChatWindow.js +3 -3
- package/dist/components/ChatWindow.mjs +2 -2
- package/dist/components/DataTableWithToolbar.d.mts +1 -1
- package/dist/components/DataTableWithToolbar.d.ts +1 -1
- package/dist/components/DataTableWithToolbar.js +9 -3
- package/dist/components/DataTableWithToolbar.mjs +8 -2
- package/dist/components/Popconfirm.js +3 -3
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.js +3 -3
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/Table.d.mts +1 -1
- package/dist/components/Table.d.ts +1 -1
- package/dist/components/Table.js +9 -2
- package/dist/components/Table.mjs +8 -1
- package/dist/components/Tooltip.js +3 -3
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/index.js +16 -16
- package/dist/index.mjs +16 -16
- package/package.json +2 -2
- package/dist/{chunk-7KPALCG3.js → chunk-ABTJVM3X.js} +2 -2
- package/dist/{chunk-GYFR2O27.mjs → chunk-OXDX6CH2.mjs} +3 -3
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Select
|
|
3
|
+
} from "./chunk-T4OVGM4X.mjs";
|
|
4
|
+
import {
|
|
5
|
+
Radio
|
|
6
|
+
} from "./chunk-NPTXXUXF.mjs";
|
|
1
7
|
import {
|
|
2
8
|
useTigerConfig
|
|
3
9
|
} from "./chunk-QAIBQHIO.mjs";
|
|
10
|
+
import {
|
|
11
|
+
Empty
|
|
12
|
+
} from "./chunk-WIWTY74F.mjs";
|
|
13
|
+
import {
|
|
14
|
+
Checkbox
|
|
15
|
+
} from "./chunk-MSHCPJIJ.mjs";
|
|
4
16
|
|
|
5
17
|
// src/components/Table.tsx
|
|
6
18
|
import { useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
|
|
@@ -12,6 +24,9 @@ import {
|
|
|
12
24
|
getTableResponsiveCardListClasses,
|
|
13
25
|
getTableResponsiveTableClasses,
|
|
14
26
|
getTableVirtualRecommendation,
|
|
27
|
+
formatTableSelectRowAriaLabel,
|
|
28
|
+
formatTableSortByText,
|
|
29
|
+
getTableLabels,
|
|
15
30
|
tableBaseClasses,
|
|
16
31
|
tableResponsiveCardClasses,
|
|
17
32
|
tableResponsiveCardLabelClasses,
|
|
@@ -268,6 +283,17 @@ function useTableState(input) {
|
|
|
268
283
|
const total = paginationConfig?.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : processedData.length;
|
|
269
284
|
return calculatePagination(total, currentPage, currentPageSize);
|
|
270
285
|
}, [processedData.length, currentPage, currentPageSize, pagination, paginationConfig?.total]);
|
|
286
|
+
function handleSetSort(newSortState) {
|
|
287
|
+
if (!isSortControlled) {
|
|
288
|
+
setUncontrolledSortState(newSortState);
|
|
289
|
+
}
|
|
290
|
+
onSortChange?.(newSortState);
|
|
291
|
+
onChange?.({
|
|
292
|
+
sort: newSortState,
|
|
293
|
+
filters: filterState,
|
|
294
|
+
pagination: pagination !== false ? { current: currentPage, pageSize: currentPageSize } : null
|
|
295
|
+
});
|
|
296
|
+
}
|
|
271
297
|
function handleSort(columnKey) {
|
|
272
298
|
const column = columnByKey[columnKey];
|
|
273
299
|
if (!column || !column.sortable) return;
|
|
@@ -279,18 +305,9 @@ function useTableState(input) {
|
|
|
279
305
|
newDirection = null;
|
|
280
306
|
}
|
|
281
307
|
}
|
|
282
|
-
|
|
308
|
+
handleSetSort({
|
|
283
309
|
key: newDirection ? columnKey : null,
|
|
284
310
|
direction: newDirection
|
|
285
|
-
};
|
|
286
|
-
if (!isSortControlled) {
|
|
287
|
-
setUncontrolledSortState(newSortState);
|
|
288
|
-
}
|
|
289
|
-
onSortChange?.(newSortState);
|
|
290
|
-
onChange?.({
|
|
291
|
-
sort: newSortState,
|
|
292
|
-
filters: filterState,
|
|
293
|
-
pagination: pagination !== false ? { current: currentPage, pageSize: currentPageSize } : null
|
|
294
311
|
});
|
|
295
312
|
}
|
|
296
313
|
function handleFilter(columnKey, value) {
|
|
@@ -468,6 +485,7 @@ function useTableState(input) {
|
|
|
468
485
|
handleFilter,
|
|
469
486
|
handlePageChange,
|
|
470
487
|
handlePageSizeChange,
|
|
488
|
+
handleSetSort,
|
|
471
489
|
handleRowClick,
|
|
472
490
|
handleToggleExpand,
|
|
473
491
|
handleSelectRow,
|
|
@@ -929,7 +947,9 @@ function Table({
|
|
|
929
947
|
striped = false,
|
|
930
948
|
hoverable = true,
|
|
931
949
|
loading = false,
|
|
932
|
-
|
|
950
|
+
locale,
|
|
951
|
+
labels,
|
|
952
|
+
emptyText,
|
|
933
953
|
pagination = {
|
|
934
954
|
current: 1,
|
|
935
955
|
pageSize: 10,
|
|
@@ -947,6 +967,8 @@ function Table({
|
|
|
947
967
|
tableLayout = "auto",
|
|
948
968
|
responsiveMode = "scroll",
|
|
949
969
|
cardBreakpoint = "sm",
|
|
970
|
+
cardClassName,
|
|
971
|
+
renderCard,
|
|
950
972
|
// v0.6.0 props
|
|
951
973
|
virtual = false,
|
|
952
974
|
autoVirtual = true,
|
|
@@ -988,12 +1010,18 @@ function Table({
|
|
|
988
1010
|
const internalExpandable = expandable;
|
|
989
1011
|
const internalRowClassName = rowClassName;
|
|
990
1012
|
const paginationLocaleInput = pagination !== false && typeof pagination === "object" ? pagination.locale : void 0;
|
|
1013
|
+
const tableLocaleInput = locale;
|
|
991
1014
|
const isPaginationI18nDisabled = paginationLocaleInput === false;
|
|
992
1015
|
const immediatePaginationLocale = useMemo2(
|
|
993
1016
|
() => paginationLocaleInput && !isPaginationI18nDisabled ? getImmediateTigerLocale(paginationLocaleInput) : void 0,
|
|
994
1017
|
[isPaginationI18nDisabled, paginationLocaleInput]
|
|
995
1018
|
);
|
|
996
1019
|
const [resolvedPaginationLocale, setResolvedPaginationLocale] = useState2(immediatePaginationLocale);
|
|
1020
|
+
const immediateTableLocale = useMemo2(
|
|
1021
|
+
() => tableLocaleInput ? getImmediateTigerLocale(tableLocaleInput) : void 0,
|
|
1022
|
+
[tableLocaleInput]
|
|
1023
|
+
);
|
|
1024
|
+
const [resolvedTableLocale, setResolvedTableLocale] = useState2(immediateTableLocale);
|
|
997
1025
|
useEffect2(() => {
|
|
998
1026
|
let active = true;
|
|
999
1027
|
setResolvedPaginationLocale(immediatePaginationLocale);
|
|
@@ -1008,10 +1036,36 @@ function Table({
|
|
|
1008
1036
|
active = false;
|
|
1009
1037
|
};
|
|
1010
1038
|
}, [isPaginationI18nDisabled, paginationLocaleInput, immediatePaginationLocale]);
|
|
1039
|
+
useEffect2(() => {
|
|
1040
|
+
let active = true;
|
|
1041
|
+
setResolvedTableLocale(immediateTableLocale);
|
|
1042
|
+
if (tableLocaleInput && isLazyTigerLocale(tableLocaleInput)) {
|
|
1043
|
+
resolveTigerLocale(tableLocaleInput).then((nextLocale) => {
|
|
1044
|
+
if (active) setResolvedTableLocale(nextLocale);
|
|
1045
|
+
}).catch(() => {
|
|
1046
|
+
if (active) setResolvedTableLocale(immediateTableLocale);
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
return () => {
|
|
1050
|
+
active = false;
|
|
1051
|
+
};
|
|
1052
|
+
}, [tableLocaleInput, immediateTableLocale]);
|
|
1011
1053
|
const paginationLocale = useMemo2(
|
|
1012
1054
|
() => isPaginationI18nDisabled ? void 0 : mergeTigerLocale(config.locale, resolvedPaginationLocale),
|
|
1013
1055
|
[config.locale, isPaginationI18nDisabled, resolvedPaginationLocale]
|
|
1014
1056
|
);
|
|
1057
|
+
const tableLocale = useMemo2(
|
|
1058
|
+
() => mergeTigerLocale(config.locale, resolvedTableLocale),
|
|
1059
|
+
[config.locale, resolvedTableLocale]
|
|
1060
|
+
);
|
|
1061
|
+
const tableLabelOverrides = useMemo2(
|
|
1062
|
+
() => emptyText === void 0 ? labels : { ...labels, emptyText },
|
|
1063
|
+
[emptyText, labels]
|
|
1064
|
+
);
|
|
1065
|
+
const tableLabels = useMemo2(
|
|
1066
|
+
() => getTableLabels(tableLocale, tableLabelOverrides),
|
|
1067
|
+
[tableLabelOverrides, tableLocale]
|
|
1068
|
+
);
|
|
1015
1069
|
const ctx = useTableState({
|
|
1016
1070
|
columns,
|
|
1017
1071
|
dataSource,
|
|
@@ -1129,7 +1183,7 @@ function Table({
|
|
|
1129
1183
|
hoverable,
|
|
1130
1184
|
striped,
|
|
1131
1185
|
loading,
|
|
1132
|
-
emptyText,
|
|
1186
|
+
emptyText: tableLabels.emptyText,
|
|
1133
1187
|
rowSelection: internalRowSelection,
|
|
1134
1188
|
expandable: internalExpandable,
|
|
1135
1189
|
rowClassName: internalRowClassName,
|
|
@@ -1144,68 +1198,141 @@ function Table({
|
|
|
1144
1198
|
]
|
|
1145
1199
|
}
|
|
1146
1200
|
),
|
|
1147
|
-
responsiveMode === "card" && /* @__PURE__ */
|
|
1201
|
+
responsiveMode === "card" && /* @__PURE__ */ jsxs5(
|
|
1148
1202
|
"div",
|
|
1149
1203
|
{
|
|
1150
1204
|
className: getTableResponsiveCardListClasses(cardBreakpoint),
|
|
1151
1205
|
"data-tiger-table-mobile": "card",
|
|
1152
|
-
children:
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
const isRowExpandable = internalExpandable ? internalExpandable.rowExpandable ? internalExpandable.rowExpandable(record) : true : false;
|
|
1156
|
-
const expandedContent = internalExpandable && isExpanded && isRowExpandable ? internalExpandable.expandedRowRender?.(record, index) : null;
|
|
1157
|
-
const expandedNode = expandedContent;
|
|
1158
|
-
return /* @__PURE__ */ jsxs5(
|
|
1159
|
-
"div",
|
|
1206
|
+
children: [
|
|
1207
|
+
internalRowSelection?.type !== "radio" && internalRowSelection?.showCheckbox !== false && internalRowSelection && ctx.paginatedData.length > 0 ? /* @__PURE__ */ jsx6("div", { className: "flex items-center justify-between rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] px-3 py-2", children: /* @__PURE__ */ jsx6(
|
|
1208
|
+
Checkbox,
|
|
1160
1209
|
{
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
{
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
(
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1210
|
+
size: "sm",
|
|
1211
|
+
checked: ctx.allSelected,
|
|
1212
|
+
indeterminate: ctx.someSelected,
|
|
1213
|
+
onChange: (checked) => ctx.handleSelectAll(checked),
|
|
1214
|
+
children: tableLabels.selectAllText
|
|
1215
|
+
}
|
|
1216
|
+
) }) : null,
|
|
1217
|
+
ctx.displayColumns.some((column) => column.sortable) ? /* @__PURE__ */ jsx6("div", { className: "rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] px-3 py-2", children: /* @__PURE__ */ jsx6(
|
|
1218
|
+
Select,
|
|
1219
|
+
{
|
|
1220
|
+
size: "sm",
|
|
1221
|
+
value: ctx.sortState.key && ctx.sortState.direction ? `${ctx.sortState.key}:${ctx.sortState.direction}` : "",
|
|
1222
|
+
options: [
|
|
1223
|
+
{ label: tableLabels.clearSortText, value: "" },
|
|
1224
|
+
...ctx.displayColumns.filter((column) => column.sortable).flatMap((column) => [
|
|
1225
|
+
{
|
|
1226
|
+
label: `${formatTableSortByText(tableLabels.sortByText, column.title)} \u2191`,
|
|
1227
|
+
value: `${column.key}:asc`
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
label: `${formatTableSortByText(tableLabels.sortByText, column.title)} \u2193`,
|
|
1231
|
+
value: `${column.key}:desc`
|
|
1232
|
+
}
|
|
1233
|
+
])
|
|
1234
|
+
],
|
|
1235
|
+
clearable: false,
|
|
1236
|
+
onChange: (value) => {
|
|
1237
|
+
const nextValue = String(value ?? "");
|
|
1238
|
+
if (!nextValue) {
|
|
1239
|
+
ctx.handleSetSort({ key: null, direction: null });
|
|
1240
|
+
return;
|
|
1241
|
+
}
|
|
1242
|
+
const separatorIndex = nextValue.lastIndexOf(":");
|
|
1243
|
+
const key = nextValue.slice(0, separatorIndex);
|
|
1244
|
+
const direction = nextValue.slice(separatorIndex + 1);
|
|
1245
|
+
ctx.handleSetSort({ key, direction });
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
) }) : null,
|
|
1249
|
+
ctx.paginatedData.length === 0 ? /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardClasses, children: /* @__PURE__ */ jsx6(Empty, { showImage: false, description: tableLabels.emptyText }) }) : ctx.paginatedData.map((record, index) => {
|
|
1250
|
+
const key = ctx.pageRowKeys[index];
|
|
1251
|
+
const isExpanded = ctx.expandedRowKeySet.has(key);
|
|
1252
|
+
const isSelected = ctx.selectedRowKeySet.has(key);
|
|
1253
|
+
const isRowExpandable = internalExpandable ? internalExpandable.rowExpandable ? internalExpandable.rowExpandable(record) : true : false;
|
|
1254
|
+
const expandedContent = internalExpandable && isExpanded && isRowExpandable ? internalExpandable.expandedRowRender?.(record, index) : null;
|
|
1255
|
+
const expandedNode = expandedContent;
|
|
1256
|
+
const renderContext = {
|
|
1257
|
+
record,
|
|
1258
|
+
index,
|
|
1259
|
+
columns: ctx.displayColumns,
|
|
1260
|
+
selected: isSelected,
|
|
1261
|
+
expanded: isExpanded,
|
|
1262
|
+
toggleExpand: () => ctx.handleToggleExpand(key, record),
|
|
1263
|
+
selectRow: (checked) => ctx.handleSelectRow(key, checked)
|
|
1264
|
+
};
|
|
1265
|
+
const customCard = renderCard?.(renderContext);
|
|
1266
|
+
const resolvedCardClassName = typeof cardClassName === "function" ? cardClassName(record, index) : cardClassName;
|
|
1267
|
+
return /* @__PURE__ */ jsx6(
|
|
1268
|
+
"div",
|
|
1269
|
+
{
|
|
1270
|
+
className: classNames3(tableResponsiveCardClasses, resolvedCardClassName),
|
|
1271
|
+
onClick: () => ctx.handleRowClick(record, index, key),
|
|
1272
|
+
children: customCard !== void 0 && customCard !== null ? customCard : /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1273
|
+
internalRowSelection?.showCheckbox !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ jsxs5("div", { className: "mb-2 flex items-center gap-3", children: [
|
|
1274
|
+
internalRowSelection && internalRowSelection.showCheckbox !== false && /* @__PURE__ */ jsx6("span", { onClick: (event) => event.stopPropagation(), children: internalRowSelection.type === "radio" ? /* @__PURE__ */ jsx6(
|
|
1275
|
+
Radio,
|
|
1276
|
+
{
|
|
1277
|
+
value: key,
|
|
1278
|
+
checked: isSelected,
|
|
1279
|
+
disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
|
|
1280
|
+
"aria-label": formatTableSelectRowAriaLabel(
|
|
1281
|
+
tableLabels.selectRowAriaLabel,
|
|
1282
|
+
index + 1,
|
|
1283
|
+
tableLocale?.locale
|
|
1284
|
+
),
|
|
1285
|
+
onChange: () => ctx.handleSelectRow(key, true)
|
|
1286
|
+
}
|
|
1287
|
+
) : /* @__PURE__ */ jsx6(
|
|
1288
|
+
Checkbox,
|
|
1289
|
+
{
|
|
1290
|
+
size: "sm",
|
|
1291
|
+
checked: isSelected,
|
|
1292
|
+
disabled: internalRowSelection.getCheckboxProps?.(record)?.disabled,
|
|
1293
|
+
"aria-label": formatTableSelectRowAriaLabel(
|
|
1294
|
+
tableLabels.selectRowAriaLabel,
|
|
1295
|
+
index + 1,
|
|
1296
|
+
tableLocale?.locale
|
|
1297
|
+
),
|
|
1298
|
+
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
1299
|
+
}
|
|
1300
|
+
) }),
|
|
1301
|
+
internalExpandable && isRowExpandable && /* @__PURE__ */ jsx6(
|
|
1302
|
+
"button",
|
|
1303
|
+
{
|
|
1304
|
+
type: "button",
|
|
1305
|
+
className: "text-sm text-[var(--tiger-primary,#2563eb)]",
|
|
1306
|
+
"aria-expanded": isExpanded,
|
|
1307
|
+
onClick: (event) => {
|
|
1308
|
+
event.stopPropagation();
|
|
1309
|
+
ctx.handleToggleExpand(key, record);
|
|
1310
|
+
},
|
|
1311
|
+
children: isExpanded ? tableLabels.collapseText : tableLabels.expandText
|
|
1312
|
+
}
|
|
1313
|
+
)
|
|
1314
|
+
] }) : null,
|
|
1315
|
+
(() => {
|
|
1316
|
+
const { titleColumn, bodyColumns } = getCardColumns(ctx.displayColumns);
|
|
1317
|
+
const renderCellContent = (column) => {
|
|
1318
|
+
const dataKey = column.dataKey || column.key;
|
|
1319
|
+
return column.render ? column.render(record, index) : record[dataKey];
|
|
1320
|
+
};
|
|
1321
|
+
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1322
|
+
titleColumn && /* @__PURE__ */ jsx6("div", { className: tableResponsiveCardTitleClasses, children: renderCellContent(titleColumn) }),
|
|
1323
|
+
bodyColumns.map((column) => /* @__PURE__ */ jsxs5("div", { className: tableResponsiveCardRowClasses, children: [
|
|
1324
|
+
/* @__PURE__ */ jsx6("div", { className: tableResponsiveCardLabelClasses, children: column.title }),
|
|
1325
|
+
/* @__PURE__ */ jsx6("div", { className: tableResponsiveCardValueClasses, children: renderCellContent(column) })
|
|
1326
|
+
] }, column.key))
|
|
1327
|
+
] });
|
|
1328
|
+
})(),
|
|
1329
|
+
expandedNode && /* @__PURE__ */ jsx6("div", { className: "mt-3 border-t border-[var(--tiger-border,#e5e7eb)] pt-3", children: expandedNode })
|
|
1330
|
+
] })
|
|
1331
|
+
},
|
|
1332
|
+
key
|
|
1333
|
+
);
|
|
1334
|
+
})
|
|
1335
|
+
]
|
|
1209
1336
|
}
|
|
1210
1337
|
),
|
|
1211
1338
|
loading && /* @__PURE__ */ jsxs5(
|
|
@@ -1214,10 +1341,10 @@ function Table({
|
|
|
1214
1341
|
className: tableLoadingOverlayClasses,
|
|
1215
1342
|
role: "status",
|
|
1216
1343
|
"aria-live": "polite",
|
|
1217
|
-
"aria-label":
|
|
1344
|
+
"aria-label": tableLabels.loadingText,
|
|
1218
1345
|
children: [
|
|
1219
1346
|
/* @__PURE__ */ jsx6(LoadingSpinner, {}),
|
|
1220
|
-
/* @__PURE__ */ jsx6("span", { className: "sr-only", children:
|
|
1347
|
+
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: tableLabels.loadingText })
|
|
1221
1348
|
]
|
|
1222
1349
|
}
|
|
1223
1350
|
),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3LCISRAVjs = require('./chunk-3LCISRAV.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkSTTQ5LXXjs = require('./chunk-STTQ5LXX.js');
|
|
@@ -41,7 +41,7 @@ var Popover = ({
|
|
|
41
41
|
const popoverId = popoverIdRef.current;
|
|
42
42
|
const titleId = `${popoverId}-title`;
|
|
43
43
|
const contentId = `${popoverId}-content`;
|
|
44
|
-
const { currentVisible, containerRef, triggerRef, floatingRef, floatingStyles, triggerHandlers } =
|
|
44
|
+
const { currentVisible, containerRef, triggerRef, floatingRef, floatingStyles, triggerHandlers } = _chunk3LCISRAVjs.usePopup.call(void 0, { open, defaultOpen, disabled, trigger, placement, offset, onOpenChange });
|
|
45
45
|
const containerClasses = _react.useMemo.call(void 0,
|
|
46
46
|
() => _tigercatcore.classNames.call(void 0, _tigercatcore.getPopoverContainerClasses.call(void 0, ), className),
|
|
47
47
|
[className]
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
9
9
|
import {
|
|
10
10
|
getTransformOrigin,
|
|
11
|
-
buildTriggerHandlerMap
|
|
11
|
+
buildTriggerHandlerMap,
|
|
12
|
+
restoreFocus
|
|
12
13
|
} from "@expcat/tigercat-core";
|
|
13
14
|
function usePopup(options) {
|
|
14
15
|
const {
|
|
@@ -46,6 +47,19 @@ function usePopup(options) {
|
|
|
46
47
|
},
|
|
47
48
|
[disabled, isControlled, onOpenChange]
|
|
48
49
|
);
|
|
50
|
+
const restoreTriggerFocus = useCallback(() => {
|
|
51
|
+
const trigger2 = triggerRef.current;
|
|
52
|
+
const target = trigger2?.querySelector(
|
|
53
|
+
'button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])'
|
|
54
|
+
) ?? trigger2;
|
|
55
|
+
window.setTimeout(() => {
|
|
56
|
+
restoreFocus(target, { preventScroll: true });
|
|
57
|
+
}, 0);
|
|
58
|
+
}, []);
|
|
59
|
+
const closeAndRestoreFocus = useCallback(() => {
|
|
60
|
+
setVisible(false);
|
|
61
|
+
restoreTriggerFocus();
|
|
62
|
+
}, [restoreTriggerFocus, setVisible]);
|
|
49
63
|
const handleToggle = useCallback(() => {
|
|
50
64
|
if (!disabled) setVisible(!currentVisible);
|
|
51
65
|
}, [disabled, currentVisible, setVisible]);
|
|
@@ -59,12 +73,12 @@ function usePopup(options) {
|
|
|
59
73
|
useClickOutside({
|
|
60
74
|
enabled: currentVisible && effectiveTrigger === "click",
|
|
61
75
|
refs: [containerRef, floatingRef],
|
|
62
|
-
onOutsideClick:
|
|
76
|
+
onOutsideClick: closeAndRestoreFocus,
|
|
63
77
|
defer: true
|
|
64
78
|
});
|
|
65
79
|
useEscapeKey({
|
|
66
80
|
enabled: currentVisible && effectiveTrigger !== "manual",
|
|
67
|
-
onEscape:
|
|
81
|
+
onEscape: closeAndRestoreFocus
|
|
68
82
|
});
|
|
69
83
|
const floatingStyles = useMemo(
|
|
70
84
|
() => ({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkABTJVM3Xjs = require('../chunk-ABTJVM3X.js');
|
|
5
5
|
require('../chunk-P36GX65N.js');
|
|
6
|
-
require('../chunk-ZRHDNGWO.js');
|
|
7
6
|
require('../chunk-ZYJTHGQW.js');
|
|
7
|
+
require('../chunk-ZRHDNGWO.js');
|
|
8
8
|
require('../chunk-WVVXZKNI.js');
|
|
9
9
|
require('../chunk-UKGQ7256.js');
|
|
10
10
|
require('../chunk-56ZV3VVY.js');
|
|
@@ -14,4 +14,4 @@ require('../chunk-TQOWIDQT.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.ChatWindow =
|
|
17
|
+
exports.ChatWindow = _chunkABTJVM3Xjs.ChatWindow; exports.default = _chunkABTJVM3Xjs.ChatWindow_default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ChatWindow,
|
|
3
3
|
ChatWindow_default
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-OXDX6CH2.mjs";
|
|
5
5
|
import "../chunk-7DUHHRAU.mjs";
|
|
6
|
-
import "../chunk-WIWTY74F.mjs";
|
|
7
6
|
import "../chunk-WNLUUD5N.mjs";
|
|
7
|
+
import "../chunk-WIWTY74F.mjs";
|
|
8
8
|
import "../chunk-7QZ4XT2P.mjs";
|
|
9
9
|
import "../chunk-UQMPEMY7.mjs";
|
|
10
10
|
import "../chunk-USWK2S3Y.mjs";
|
|
@@ -41,6 +41,6 @@ interface DataTableWithToolbarProps<T = Record<string, unknown>> extends Omit<Ta
|
|
|
41
41
|
*/
|
|
42
42
|
tableClassName?: string;
|
|
43
43
|
}
|
|
44
|
-
declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, locale, labels, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
|
|
45
45
|
|
|
46
46
|
export { DataTableWithToolbar, type DataTableWithToolbarProps, DataTableWithToolbar as default };
|
|
@@ -41,6 +41,6 @@ interface DataTableWithToolbarProps<T = Record<string, unknown>> extends Omit<Ta
|
|
|
41
41
|
*/
|
|
42
42
|
tableClassName?: string;
|
|
43
43
|
}
|
|
44
|
-
declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
|
|
44
|
+
declare const DataTableWithToolbar: <T extends Record<string, unknown> = Record<string, unknown>>({ toolbar, locale, labels, onSearchChange, onSearch, onFiltersChange, onBulkAction, pagination, onPageChange, onPageSizeChange, className, tableClassName, ...tableProps }: DataTableWithToolbarProps<T>) => react_jsx_runtime.JSX.Element;
|
|
45
45
|
|
|
46
46
|
export { DataTableWithToolbar, type DataTableWithToolbarProps, DataTableWithToolbar as default };
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var _chunkFZX7USS4js = require('../chunk-FZX7USS4.js');
|
|
5
|
+
require('../chunk-M36PT6BS.js');
|
|
6
6
|
require('../chunk-6Z4LLPZA.js');
|
|
7
|
+
require('../chunk-TMON4MPO.js');
|
|
8
|
+
require('../chunk-ZFMMAYSX.js');
|
|
7
9
|
require('../chunk-TDODFBBO.js');
|
|
8
10
|
require('../chunk-ZYJTHGQW.js');
|
|
11
|
+
require('../chunk-ZRHDNGWO.js');
|
|
12
|
+
require('../chunk-F7H4ALKN.js');
|
|
13
|
+
require('../chunk-JLRRXRZO.js');
|
|
14
|
+
require('../chunk-UKGQ7256.js');
|
|
9
15
|
require('../chunk-56ZV3VVY.js');
|
|
10
16
|
require('../chunk-YMKA4L3Z.js');
|
|
11
17
|
|
|
12
18
|
|
|
13
19
|
|
|
14
|
-
exports.DataTableWithToolbar =
|
|
20
|
+
exports.DataTableWithToolbar = _chunkFZX7USS4js.DataTableWithToolbar; exports.default = _chunkFZX7USS4js.DataTableWithToolbar_default;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataTableWithToolbar,
|
|
3
3
|
DataTableWithToolbar_default
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-JDJFSO2D.mjs";
|
|
5
|
+
import "../chunk-TSZKBVTA.mjs";
|
|
6
6
|
import "../chunk-T4OVGM4X.mjs";
|
|
7
|
+
import "../chunk-NPTXXUXF.mjs";
|
|
8
|
+
import "../chunk-IG75YSX3.mjs";
|
|
7
9
|
import "../chunk-QAIBQHIO.mjs";
|
|
8
10
|
import "../chunk-WNLUUD5N.mjs";
|
|
11
|
+
import "../chunk-WIWTY74F.mjs";
|
|
12
|
+
import "../chunk-MSHCPJIJ.mjs";
|
|
13
|
+
import "../chunk-DKT2EYVM.mjs";
|
|
14
|
+
import "../chunk-UQMPEMY7.mjs";
|
|
9
15
|
import "../chunk-USWK2S3Y.mjs";
|
|
10
16
|
import "../chunk-ZJWUBR2X.mjs";
|
|
11
17
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkLJDILPI6js = require('../chunk-LJDILPI6.js');
|
|
4
|
+
require('../chunk-3LCISRAV.js');
|
|
5
5
|
require('../chunk-STTQ5LXX.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.Popconfirm =
|
|
8
|
+
exports.Popconfirm = _chunkLJDILPI6js.Popconfirm;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkXU4TF2YAjs = require('../chunk-XU4TF2YA.js');
|
|
4
|
+
require('../chunk-3LCISRAV.js');
|
|
5
5
|
require('../chunk-STTQ5LXX.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.Popover =
|
|
8
|
+
exports.Popover = _chunkXU4TF2YAjs.Popover;
|
|
@@ -2,6 +2,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { T as TableProps } from '../types-mtq1tZJd.mjs';
|
|
3
3
|
import '@expcat/tigercat-core';
|
|
4
4
|
|
|
5
|
-
declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, columnLockable, dataSource, sort, defaultSort, filters, defaultFilters, size, bordered, striped, hoverable, loading, emptyText, pagination, rowSelection, expandable, rowKey, rowClassName, stickyHeader, maxHeight, tableLayout, responsiveMode, cardBreakpoint, virtual, autoVirtual, virtualHeight, virtualItemHeight: _virtualItemHeight, autoVirtualThreshold, virtualThreshold, editable, editableCells, filterMode, advancedFilterRules, columnDraggable, rowDraggable, summaryRow, groupBy, exportable, exportFormat, exportFilename, onChange, onRowClick, onSelectionChange, onSortChange, onFilterChange, onPageChange, onExpandChange, onCellChange, onColumnOrderChange, onRowOrderChange, onExport, className, ...props }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, columnLockable, dataSource, sort, defaultSort, filters, defaultFilters, size, bordered, striped, hoverable, loading, locale, labels, emptyText, pagination, rowSelection, expandable, rowKey, rowClassName, stickyHeader, maxHeight, tableLayout, responsiveMode, cardBreakpoint, cardClassName, renderCard, virtual, autoVirtual, virtualHeight, virtualItemHeight: _virtualItemHeight, autoVirtualThreshold, virtualThreshold, editable, editableCells, filterMode, advancedFilterRules, columnDraggable, rowDraggable, summaryRow, groupBy, exportable, exportFormat, exportFilename, onChange, onRowClick, onSelectionChange, onSortChange, onFilterChange, onPageChange, onExpandChange, onCellChange, onColumnOrderChange, onRowOrderChange, onExport, className, ...props }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
6
6
|
|
|
7
7
|
export { Table, TableProps };
|
|
@@ -2,6 +2,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { T as TableProps } from '../types-mtq1tZJd.js';
|
|
3
3
|
import '@expcat/tigercat-core';
|
|
4
4
|
|
|
5
|
-
declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, columnLockable, dataSource, sort, defaultSort, filters, defaultFilters, size, bordered, striped, hoverable, loading, emptyText, pagination, rowSelection, expandable, rowKey, rowClassName, stickyHeader, maxHeight, tableLayout, responsiveMode, cardBreakpoint, virtual, autoVirtual, virtualHeight, virtualItemHeight: _virtualItemHeight, autoVirtualThreshold, virtualThreshold, editable, editableCells, filterMode, advancedFilterRules, columnDraggable, rowDraggable, summaryRow, groupBy, exportable, exportFormat, exportFilename, onChange, onRowClick, onSelectionChange, onSortChange, onFilterChange, onPageChange, onExpandChange, onCellChange, onColumnOrderChange, onRowOrderChange, onExport, className, ...props }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
5
|
+
declare function Table<T extends Record<string, unknown> = Record<string, unknown>>({ columns, columnLockable, dataSource, sort, defaultSort, filters, defaultFilters, size, bordered, striped, hoverable, loading, locale, labels, emptyText, pagination, rowSelection, expandable, rowKey, rowClassName, stickyHeader, maxHeight, tableLayout, responsiveMode, cardBreakpoint, cardClassName, renderCard, virtual, autoVirtual, virtualHeight, virtualItemHeight: _virtualItemHeight, autoVirtualThreshold, virtualThreshold, editable, editableCells, filterMode, advancedFilterRules, columnDraggable, rowDraggable, summaryRow, groupBy, exportable, exportFormat, exportFilename, onChange, onRowClick, onSelectionChange, onSortChange, onFilterChange, onPageChange, onExpandChange, onCellChange, onColumnOrderChange, onRowOrderChange, onExport, className, ...props }: TableProps<T>): react_jsx_runtime.JSX.Element;
|
|
6
6
|
|
|
7
7
|
export { Table, TableProps };
|
package/dist/components/Table.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkM36PT6BSjs = require('../chunk-M36PT6BS.js');
|
|
4
|
+
require('../chunk-6Z4LLPZA.js');
|
|
5
|
+
require('../chunk-TMON4MPO.js');
|
|
6
|
+
require('../chunk-ZFMMAYSX.js');
|
|
4
7
|
require('../chunk-TDODFBBO.js');
|
|
8
|
+
require('../chunk-ZRHDNGWO.js');
|
|
9
|
+
require('../chunk-F7H4ALKN.js');
|
|
10
|
+
require('../chunk-JLRRXRZO.js');
|
|
11
|
+
require('../chunk-UKGQ7256.js');
|
|
5
12
|
|
|
6
13
|
|
|
7
|
-
exports.Table =
|
|
14
|
+
exports.Table = _chunkM36PT6BSjs.Table;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-TSZKBVTA.mjs";
|
|
4
|
+
import "../chunk-T4OVGM4X.mjs";
|
|
5
|
+
import "../chunk-NPTXXUXF.mjs";
|
|
6
|
+
import "../chunk-IG75YSX3.mjs";
|
|
4
7
|
import "../chunk-QAIBQHIO.mjs";
|
|
8
|
+
import "../chunk-WIWTY74F.mjs";
|
|
9
|
+
import "../chunk-MSHCPJIJ.mjs";
|
|
10
|
+
import "../chunk-DKT2EYVM.mjs";
|
|
11
|
+
import "../chunk-UQMPEMY7.mjs";
|
|
5
12
|
export {
|
|
6
13
|
Table
|
|
7
14
|
};
|