@expcat/tigercat-react 1.2.34 → 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-VHHYTCZQ.js → chunk-FZX7USS4.js} +48 -7
- package/dist/{chunk-VXOLIMK2.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-VAZYY35F.js → chunk-M36PT6BS.js} +208 -66
- package/dist/{chunk-VE2YEFG2.mjs → chunk-PCPAMUAE.mjs} +1 -1
- package/dist/{chunk-O4UDB6ZE.mjs → chunk-TAYQDWXN.mjs} +1 -1
- package/dist/{chunk-AIXYHS2L.mjs → chunk-TSZKBVTA.mjs} +209 -67
- 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,7 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
+
var _chunk6Z4LLPZAjs = require('./chunk-6Z4LLPZA.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkTMON4MPOjs = require('./chunk-TMON4MPO.js');
|
|
7
|
+
|
|
8
|
+
|
|
3
9
|
var _chunkTDODFBBOjs = require('./chunk-TDODFBBO.js');
|
|
4
10
|
|
|
11
|
+
|
|
12
|
+
var _chunkZRHDNGWOjs = require('./chunk-ZRHDNGWO.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunkF7H4ALKNjs = require('./chunk-F7H4ALKN.js');
|
|
16
|
+
|
|
5
17
|
// src/components/Table.tsx
|
|
6
18
|
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
7
19
|
|
|
@@ -19,6 +31,11 @@ var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
|
19
31
|
|
|
20
32
|
|
|
21
33
|
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
22
39
|
|
|
23
40
|
|
|
24
41
|
var _tigercatcore = require('@expcat/tigercat-core');
|
|
@@ -266,6 +283,17 @@ function useTableState(input) {
|
|
|
266
283
|
const total = _optionalChain([paginationConfig, 'optionalAccess', _25 => _25.total]) !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : processedData.length;
|
|
267
284
|
return _tigercatcore.calculatePagination.call(void 0, total, currentPage, currentPageSize);
|
|
268
285
|
}, [processedData.length, currentPage, currentPageSize, pagination, _optionalChain([paginationConfig, 'optionalAccess', _26 => _26.total])]);
|
|
286
|
+
function handleSetSort(newSortState) {
|
|
287
|
+
if (!isSortControlled) {
|
|
288
|
+
setUncontrolledSortState(newSortState);
|
|
289
|
+
}
|
|
290
|
+
_optionalChain([onSortChange, 'optionalCall', _27 => _27(newSortState)]);
|
|
291
|
+
_optionalChain([onChange, 'optionalCall', _28 => _28({
|
|
292
|
+
sort: newSortState,
|
|
293
|
+
filters: filterState,
|
|
294
|
+
pagination: pagination !== false ? { current: currentPage, pageSize: currentPageSize } : null
|
|
295
|
+
})]);
|
|
296
|
+
}
|
|
269
297
|
function handleSort(columnKey) {
|
|
270
298
|
const column = columnByKey[columnKey];
|
|
271
299
|
if (!column || !column.sortable) return;
|
|
@@ -277,19 +305,10 @@ function useTableState(input) {
|
|
|
277
305
|
newDirection = null;
|
|
278
306
|
}
|
|
279
307
|
}
|
|
280
|
-
|
|
308
|
+
handleSetSort({
|
|
281
309
|
key: newDirection ? columnKey : null,
|
|
282
310
|
direction: newDirection
|
|
283
|
-
};
|
|
284
|
-
if (!isSortControlled) {
|
|
285
|
-
setUncontrolledSortState(newSortState);
|
|
286
|
-
}
|
|
287
|
-
_optionalChain([onSortChange, 'optionalCall', _27 => _27(newSortState)]);
|
|
288
|
-
_optionalChain([onChange, 'optionalCall', _28 => _28({
|
|
289
|
-
sort: newSortState,
|
|
290
|
-
filters: filterState,
|
|
291
|
-
pagination: pagination !== false ? { current: currentPage, pageSize: currentPageSize } : null
|
|
292
|
-
})]);
|
|
311
|
+
});
|
|
293
312
|
}
|
|
294
313
|
function handleFilter(columnKey, value) {
|
|
295
314
|
const newFilterState = { ...filterState, [columnKey]: value };
|
|
@@ -466,6 +485,7 @@ function useTableState(input) {
|
|
|
466
485
|
handleFilter,
|
|
467
486
|
handlePageChange,
|
|
468
487
|
handlePageSizeChange,
|
|
488
|
+
handleSetSort,
|
|
469
489
|
handleRowClick,
|
|
470
490
|
handleToggleExpand,
|
|
471
491
|
handleSelectRow,
|
|
@@ -927,7 +947,9 @@ function Table({
|
|
|
927
947
|
striped = false,
|
|
928
948
|
hoverable = true,
|
|
929
949
|
loading = false,
|
|
930
|
-
|
|
950
|
+
locale,
|
|
951
|
+
labels,
|
|
952
|
+
emptyText,
|
|
931
953
|
pagination = {
|
|
932
954
|
current: 1,
|
|
933
955
|
pageSize: 10,
|
|
@@ -944,6 +966,9 @@ function Table({
|
|
|
944
966
|
maxHeight,
|
|
945
967
|
tableLayout = "auto",
|
|
946
968
|
responsiveMode = "scroll",
|
|
969
|
+
cardBreakpoint = "sm",
|
|
970
|
+
cardClassName,
|
|
971
|
+
renderCard,
|
|
947
972
|
// v0.6.0 props
|
|
948
973
|
virtual = false,
|
|
949
974
|
autoVirtual = true,
|
|
@@ -985,12 +1010,18 @@ function Table({
|
|
|
985
1010
|
const internalExpandable = expandable;
|
|
986
1011
|
const internalRowClassName = rowClassName;
|
|
987
1012
|
const paginationLocaleInput = pagination !== false && typeof pagination === "object" ? pagination.locale : void 0;
|
|
1013
|
+
const tableLocaleInput = locale;
|
|
988
1014
|
const isPaginationI18nDisabled = paginationLocaleInput === false;
|
|
989
1015
|
const immediatePaginationLocale = _react.useMemo.call(void 0,
|
|
990
1016
|
() => paginationLocaleInput && !isPaginationI18nDisabled ? _tigercatcore.getImmediateTigerLocale.call(void 0, paginationLocaleInput) : void 0,
|
|
991
1017
|
[isPaginationI18nDisabled, paginationLocaleInput]
|
|
992
1018
|
);
|
|
993
1019
|
const [resolvedPaginationLocale, setResolvedPaginationLocale] = _react.useState.call(void 0, immediatePaginationLocale);
|
|
1020
|
+
const immediateTableLocale = _react.useMemo.call(void 0,
|
|
1021
|
+
() => tableLocaleInput ? _tigercatcore.getImmediateTigerLocale.call(void 0, tableLocaleInput) : void 0,
|
|
1022
|
+
[tableLocaleInput]
|
|
1023
|
+
);
|
|
1024
|
+
const [resolvedTableLocale, setResolvedTableLocale] = _react.useState.call(void 0, immediateTableLocale);
|
|
994
1025
|
_react.useEffect.call(void 0, () => {
|
|
995
1026
|
let active = true;
|
|
996
1027
|
setResolvedPaginationLocale(immediatePaginationLocale);
|
|
@@ -1005,10 +1036,36 @@ function Table({
|
|
|
1005
1036
|
active = false;
|
|
1006
1037
|
};
|
|
1007
1038
|
}, [isPaginationI18nDisabled, paginationLocaleInput, immediatePaginationLocale]);
|
|
1039
|
+
_react.useEffect.call(void 0, () => {
|
|
1040
|
+
let active = true;
|
|
1041
|
+
setResolvedTableLocale(immediateTableLocale);
|
|
1042
|
+
if (tableLocaleInput && _tigercatcore.isLazyTigerLocale.call(void 0, tableLocaleInput)) {
|
|
1043
|
+
_tigercatcore.resolveTigerLocale.call(void 0, 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]);
|
|
1008
1053
|
const paginationLocale = _react.useMemo.call(void 0,
|
|
1009
1054
|
() => isPaginationI18nDisabled ? void 0 : _tigercatcore.mergeTigerLocale.call(void 0, config.locale, resolvedPaginationLocale),
|
|
1010
1055
|
[config.locale, isPaginationI18nDisabled, resolvedPaginationLocale]
|
|
1011
1056
|
);
|
|
1057
|
+
const tableLocale = _react.useMemo.call(void 0,
|
|
1058
|
+
() => _tigercatcore.mergeTigerLocale.call(void 0, config.locale, resolvedTableLocale),
|
|
1059
|
+
[config.locale, resolvedTableLocale]
|
|
1060
|
+
);
|
|
1061
|
+
const tableLabelOverrides = _react.useMemo.call(void 0,
|
|
1062
|
+
() => emptyText === void 0 ? labels : { ...labels, emptyText },
|
|
1063
|
+
[emptyText, labels]
|
|
1064
|
+
);
|
|
1065
|
+
const tableLabels = _react.useMemo.call(void 0,
|
|
1066
|
+
() => _tigercatcore.getTableLabels.call(void 0, tableLocale, tableLabelOverrides),
|
|
1067
|
+
[tableLabelOverrides, tableLocale]
|
|
1068
|
+
);
|
|
1012
1069
|
const ctx = useTableState({
|
|
1013
1070
|
columns,
|
|
1014
1071
|
dataSource,
|
|
@@ -1103,7 +1160,7 @@ function Table({
|
|
|
1103
1160
|
ref: tableRef,
|
|
1104
1161
|
className: _tigercatcore.classNames.call(void 0,
|
|
1105
1162
|
_tigercatcore.tableBaseClasses,
|
|
1106
|
-
_tigercatcore.getTableResponsiveTableClasses.call(void 0, responsiveMode),
|
|
1163
|
+
_tigercatcore.getTableResponsiveTableClasses.call(void 0, responsiveMode, cardBreakpoint),
|
|
1107
1164
|
tableLayout === "fixed" ? "table-fixed" : "table-auto",
|
|
1108
1165
|
className
|
|
1109
1166
|
),
|
|
@@ -1126,7 +1183,7 @@ function Table({
|
|
|
1126
1183
|
hoverable,
|
|
1127
1184
|
striped,
|
|
1128
1185
|
loading,
|
|
1129
|
-
emptyText,
|
|
1186
|
+
emptyText: tableLabels.emptyText,
|
|
1130
1187
|
rowSelection: internalRowSelection,
|
|
1131
1188
|
expandable: internalExpandable,
|
|
1132
1189
|
rowClassName: internalRowClassName,
|
|
@@ -1141,68 +1198,153 @@ function Table({
|
|
|
1141
1198
|
]
|
|
1142
1199
|
}
|
|
1143
1200
|
),
|
|
1144
|
-
responsiveMode === "card" && /* @__PURE__ */ _jsxruntime.
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
className: "text-sm text-[var(--tiger-primary,#2563eb)]",
|
|
1172
|
-
"aria-expanded": isExpanded,
|
|
1173
|
-
onClick: (event) => {
|
|
1174
|
-
event.stopPropagation();
|
|
1175
|
-
ctx.handleToggleExpand(key, record);
|
|
1201
|
+
responsiveMode === "card" && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1202
|
+
"div",
|
|
1203
|
+
{
|
|
1204
|
+
className: _tigercatcore.getTableResponsiveCardListClasses.call(void 0, cardBreakpoint),
|
|
1205
|
+
"data-tiger-table-mobile": "card",
|
|
1206
|
+
children: [
|
|
1207
|
+
_optionalChain([internalRowSelection, 'optionalAccess', _67 => _67.type]) !== "radio" && _optionalChain([internalRowSelection, 'optionalAccess', _68 => _68.showCheckbox]) !== false && internalRowSelection && ctx.paginatedData.length > 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "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__ */ _jsxruntime.jsx.call(void 0,
|
|
1208
|
+
_chunkF7H4ALKNjs.Checkbox,
|
|
1209
|
+
{
|
|
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__ */ _jsxruntime.jsx.call(void 0, "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__ */ _jsxruntime.jsx.call(void 0,
|
|
1218
|
+
_chunk6Z4LLPZAjs.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: `${_tigercatcore.formatTableSortByText.call(void 0, tableLabels.sortByText, column.title)} \u2191`,
|
|
1227
|
+
value: `${column.key}:asc`
|
|
1176
1228
|
},
|
|
1177
|
-
|
|
1229
|
+
{
|
|
1230
|
+
label: `${_tigercatcore.formatTableSortByText.call(void 0, tableLabels.sortByText, column.title)} \u2193`,
|
|
1231
|
+
value: `${column.key}:desc`
|
|
1232
|
+
}
|
|
1233
|
+
])
|
|
1234
|
+
],
|
|
1235
|
+
clearable: false,
|
|
1236
|
+
onChange: (value) => {
|
|
1237
|
+
const nextValue = String(_nullishCoalesce(value, () => ( "")));
|
|
1238
|
+
if (!nextValue) {
|
|
1239
|
+
ctx.handleSetSort({ key: null, direction: null });
|
|
1240
|
+
return;
|
|
1178
1241
|
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
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__ */ _jsxruntime.jsx.call(void 0, "div", { className: _tigercatcore.tableResponsiveCardClasses, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkZRHDNGWOjs.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 ? _optionalChain([internalExpandable, 'access', _69 => _69.expandedRowRender, 'optionalCall', _70 => _70(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 = _optionalChain([renderCard, 'optionalCall', _71 => _71(renderContext)]);
|
|
1266
|
+
const resolvedCardClassName = typeof cardClassName === "function" ? cardClassName(record, index) : cardClassName;
|
|
1267
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1268
|
+
"div",
|
|
1269
|
+
{
|
|
1270
|
+
className: _tigercatcore.classNames.call(void 0, _tigercatcore.tableResponsiveCardClasses, resolvedCardClassName),
|
|
1271
|
+
onClick: () => ctx.handleRowClick(record, index, key),
|
|
1272
|
+
children: customCard !== void 0 && customCard !== null ? customCard : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1273
|
+
_optionalChain([internalRowSelection, 'optionalAccess', _72 => _72.showCheckbox]) !== false && internalRowSelection || internalExpandable && isRowExpandable ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mb-2 flex items-center gap-3", children: [
|
|
1274
|
+
internalRowSelection && internalRowSelection.showCheckbox !== false && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { onClick: (event) => event.stopPropagation(), children: internalRowSelection.type === "radio" ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1275
|
+
_chunkTMON4MPOjs.Radio,
|
|
1276
|
+
{
|
|
1277
|
+
value: key,
|
|
1278
|
+
checked: isSelected,
|
|
1279
|
+
disabled: _optionalChain([internalRowSelection, 'access', _73 => _73.getCheckboxProps, 'optionalCall', _74 => _74(record), 'optionalAccess', _75 => _75.disabled]),
|
|
1280
|
+
"aria-label": _tigercatcore.formatTableSelectRowAriaLabel.call(void 0,
|
|
1281
|
+
tableLabels.selectRowAriaLabel,
|
|
1282
|
+
index + 1,
|
|
1283
|
+
_optionalChain([tableLocale, 'optionalAccess', _76 => _76.locale])
|
|
1284
|
+
),
|
|
1285
|
+
onChange: () => ctx.handleSelectRow(key, true)
|
|
1286
|
+
}
|
|
1287
|
+
) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1288
|
+
_chunkF7H4ALKNjs.Checkbox,
|
|
1289
|
+
{
|
|
1290
|
+
size: "sm",
|
|
1291
|
+
checked: isSelected,
|
|
1292
|
+
disabled: _optionalChain([internalRowSelection, 'access', _77 => _77.getCheckboxProps, 'optionalCall', _78 => _78(record), 'optionalAccess', _79 => _79.disabled]),
|
|
1293
|
+
"aria-label": _tigercatcore.formatTableSelectRowAriaLabel.call(void 0,
|
|
1294
|
+
tableLabels.selectRowAriaLabel,
|
|
1295
|
+
index + 1,
|
|
1296
|
+
_optionalChain([tableLocale, 'optionalAccess', _80 => _80.locale])
|
|
1297
|
+
),
|
|
1298
|
+
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
1299
|
+
}
|
|
1300
|
+
) }),
|
|
1301
|
+
internalExpandable && isRowExpandable && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
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 } = _tigercatcore.getCardColumns.call(void 0, 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__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
1322
|
+
titleColumn && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _tigercatcore.tableResponsiveCardTitleClasses, children: renderCellContent(titleColumn) }),
|
|
1323
|
+
bodyColumns.map((column) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _tigercatcore.tableResponsiveCardRowClasses, children: [
|
|
1324
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _tigercatcore.tableResponsiveCardLabelClasses, children: column.title }),
|
|
1325
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _tigercatcore.tableResponsiveCardValueClasses, children: renderCellContent(column) })
|
|
1326
|
+
] }, column.key))
|
|
1327
|
+
] });
|
|
1328
|
+
})(),
|
|
1329
|
+
expandedNode && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "mt-3 border-t border-[var(--tiger-border,#e5e7eb)] pt-3", children: expandedNode })
|
|
1330
|
+
] })
|
|
1331
|
+
},
|
|
1332
|
+
key
|
|
1333
|
+
);
|
|
1334
|
+
})
|
|
1335
|
+
]
|
|
1336
|
+
}
|
|
1337
|
+
),
|
|
1196
1338
|
loading && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
1197
1339
|
"div",
|
|
1198
1340
|
{
|
|
1199
1341
|
className: _tigercatcore.tableLoadingOverlayClasses,
|
|
1200
1342
|
role: "status",
|
|
1201
1343
|
"aria-live": "polite",
|
|
1202
|
-
"aria-label":
|
|
1344
|
+
"aria-label": tableLabels.loadingText,
|
|
1203
1345
|
children: [
|
|
1204
1346
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, LoadingSpinner, {}),
|
|
1205
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children:
|
|
1347
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { className: "sr-only", children: tableLabels.loadingText })
|
|
1206
1348
|
]
|
|
1207
1349
|
}
|
|
1208
1350
|
),
|