@expcat/tigercat-vue 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-WT3LV7OQ.mjs → chunk-3KIIMXJC.mjs} +1 -1
- package/dist/{chunk-PC2FNA4J.mjs → chunk-5BGVVVVD.mjs} +1 -1
- package/dist/{chunk-RRI3F52B.js → chunk-5BILS3SG.js} +268 -92
- package/dist/{chunk-W54LFA7A.mjs → chunk-5Z2OCSVJ.mjs} +268 -92
- package/dist/{chunk-U2PPTMQX.mjs → chunk-G7O3G2LI.mjs} +1 -1
- package/dist/{chunk-UJZPEXF5.mjs → chunk-JPZJZFC4.mjs} +17 -3
- package/dist/{chunk-3EVCDIZE.js → chunk-JT2ANXUR.js} +2 -2
- package/dist/{chunk-S3KTGULC.js → chunk-NNFDOVVA.js} +20 -6
- package/dist/{chunk-2HT6YGRY.js → chunk-O23S65U3.js} +60 -8
- package/dist/{chunk-ILTIUESE.mjs → chunk-OKBZKBFP.mjs} +60 -8
- package/dist/{chunk-6DYGPOYH.js → chunk-SSMSRTEQ.js} +2 -2
- package/dist/{chunk-HSMN5FWL.js → chunk-YCYS6LAQ.js} +2 -2
- package/dist/components/Alert.d.mts +1 -1
- package/dist/components/Alert.d.ts +1 -1
- package/dist/components/ChatWindow.js +3 -3
- package/dist/components/ChatWindow.mjs +2 -2
- package/dist/components/DataTableWithToolbar.d.mts +23 -3
- package/dist/components/DataTableWithToolbar.d.ts +23 -3
- package/dist/components/DataTableWithToolbar.js +8 -3
- package/dist/components/DataTableWithToolbar.mjs +7 -2
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/Empty.d.ts +1 -1
- package/dist/components/FormWizard.d.mts +1 -1
- package/dist/components/FormWizard.d.ts +1 -1
- package/dist/components/Menu.d.mts +1 -1
- package/dist/components/Menu.d.ts +1 -1
- package/dist/components/Pagination.d.mts +1 -1
- package/dist/components/Pagination.d.ts +1 -1
- package/dist/components/Popconfirm.d.mts +1 -1
- package/dist/components/Popconfirm.d.ts +1 -1
- 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/Steps.d.mts +1 -1
- package/dist/components/Steps.d.ts +1 -1
- package/dist/components/Table.d.mts +31 -3
- package/dist/components/Table.d.ts +31 -3
- package/dist/components/Table.js +8 -2
- package/dist/components/Table.mjs +7 -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-S45NWVQS.mjs → chunk-6GPX4ONB.mjs} +3 -3
- package/dist/{chunk-VES3OJOP.js → chunk-YS6FW775.js} +2 -2
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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 _chunkBGMAWKWVjs = require('./chunk-BGMAWKWV.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk3QV2D54Hjs = require('./chunk-3QV2D54H.js');
|
|
7
|
+
|
|
8
|
+
|
|
3
9
|
var _chunk25EYT2CBjs = require('./chunk-25EYT2CB.js');
|
|
4
10
|
|
|
11
|
+
|
|
12
|
+
var _chunkNOZ65AMOjs = require('./chunk-NOZ65AMO.js');
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
var _chunk2YFXJUBTjs = require('./chunk-2YFXJUBT.js');
|
|
16
|
+
|
|
5
17
|
// src/components/Table.ts
|
|
6
18
|
|
|
7
19
|
|
|
@@ -29,6 +41,9 @@ var _vue = require('vue');
|
|
|
29
41
|
|
|
30
42
|
|
|
31
43
|
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
32
47
|
|
|
33
48
|
|
|
34
49
|
var _tigercatcore = require('@expcat/tigercat-core');
|
|
@@ -85,9 +100,15 @@ var tableProps = {
|
|
|
85
100
|
type: Boolean,
|
|
86
101
|
default: false
|
|
87
102
|
},
|
|
103
|
+
locale: {
|
|
104
|
+
type: [Object, Function]
|
|
105
|
+
},
|
|
106
|
+
labels: {
|
|
107
|
+
type: Object
|
|
108
|
+
},
|
|
88
109
|
emptyText: {
|
|
89
110
|
type: String,
|
|
90
|
-
default:
|
|
111
|
+
default: void 0
|
|
91
112
|
},
|
|
92
113
|
pagination: {
|
|
93
114
|
type: [Object, Boolean],
|
|
@@ -132,6 +153,12 @@ var tableProps = {
|
|
|
132
153
|
type: String,
|
|
133
154
|
default: "sm"
|
|
134
155
|
},
|
|
156
|
+
cardClassName: {
|
|
157
|
+
type: [String, Function]
|
|
158
|
+
},
|
|
159
|
+
renderCard: {
|
|
160
|
+
type: Function
|
|
161
|
+
},
|
|
135
162
|
// --- v0.6.0 props ---
|
|
136
163
|
virtual: { type: Boolean, default: false },
|
|
137
164
|
autoVirtual: { type: Boolean, default: true },
|
|
@@ -333,6 +360,20 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
333
360
|
const total = _optionalChain([paginationConfig, 'access', _44 => _44.value, 'optionalAccess', _45 => _45.total]) !== void 0 && paginationConfig.value.total > 0 ? paginationConfig.value.total : processedData.value.length;
|
|
334
361
|
return _tigercatcore.calculatePagination.call(void 0, total, currentPage.value, currentPageSize.value);
|
|
335
362
|
});
|
|
363
|
+
function handleSetSort(nextSortState) {
|
|
364
|
+
if (!isSortControlled.value) {
|
|
365
|
+
uncontrolledSortState.value = nextSortState;
|
|
366
|
+
}
|
|
367
|
+
emit("sort-change", nextSortState);
|
|
368
|
+
emit("change", {
|
|
369
|
+
sort: nextSortState,
|
|
370
|
+
filters: filterState.value,
|
|
371
|
+
pagination: props.pagination !== false ? {
|
|
372
|
+
current: currentPage.value,
|
|
373
|
+
pageSize: currentPageSize.value
|
|
374
|
+
} : null
|
|
375
|
+
});
|
|
376
|
+
}
|
|
336
377
|
function handleSort(columnKey) {
|
|
337
378
|
const column = displayColumns.value.find((col) => col.key === columnKey);
|
|
338
379
|
if (!column || !column.sortable) {
|
|
@@ -346,21 +387,9 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
346
387
|
newDirection = null;
|
|
347
388
|
}
|
|
348
389
|
}
|
|
349
|
-
|
|
390
|
+
handleSetSort({
|
|
350
391
|
key: newDirection ? columnKey : null,
|
|
351
392
|
direction: newDirection
|
|
352
|
-
};
|
|
353
|
-
if (!isSortControlled.value) {
|
|
354
|
-
uncontrolledSortState.value = nextSortState;
|
|
355
|
-
}
|
|
356
|
-
emit("sort-change", nextSortState);
|
|
357
|
-
emit("change", {
|
|
358
|
-
sort: nextSortState,
|
|
359
|
-
filters: filterState.value,
|
|
360
|
-
pagination: props.pagination !== false ? {
|
|
361
|
-
current: currentPage.value,
|
|
362
|
-
pageSize: currentPageSize.value
|
|
363
|
-
} : null
|
|
364
393
|
});
|
|
365
394
|
}
|
|
366
395
|
function handleFilter(columnKey, value) {
|
|
@@ -556,6 +585,7 @@ function useTableState(props, emit, measuredColumnWidths) {
|
|
|
556
585
|
editingValue,
|
|
557
586
|
virtualScrollTop,
|
|
558
587
|
toggleColumnLock,
|
|
588
|
+
handleSetSort,
|
|
559
589
|
handleSort,
|
|
560
590
|
handleFilter,
|
|
561
591
|
handlePageChange,
|
|
@@ -1191,11 +1221,14 @@ var Table = _vue.defineComponent.call(void 0, {
|
|
|
1191
1221
|
const measuredRowHeights = _vue.ref.call(void 0, []);
|
|
1192
1222
|
const ctx = useTableState(props, emit, measuredColumnWidths);
|
|
1193
1223
|
const resolvedPaginationLocale = _vue.ref.call(void 0, );
|
|
1224
|
+
const resolvedTableLocale = _vue.ref.call(void 0, );
|
|
1194
1225
|
let paginationLocaleResolveId = 0;
|
|
1226
|
+
let tableLocaleResolveId = 0;
|
|
1195
1227
|
const paginationLocaleInput = _vue.computed.call(void 0,
|
|
1196
1228
|
() => props.pagination !== false && typeof props.pagination === "object" ? props.pagination.locale : void 0
|
|
1197
1229
|
);
|
|
1198
1230
|
const isPaginationI18nDisabled = _vue.computed.call(void 0, () => paginationLocaleInput.value === false);
|
|
1231
|
+
const tableLocaleInput = _vue.computed.call(void 0, () => props.locale);
|
|
1199
1232
|
_vue.watch.call(void 0,
|
|
1200
1233
|
paginationLocaleInput,
|
|
1201
1234
|
(locale) => {
|
|
@@ -1222,6 +1255,36 @@ var Table = _vue.defineComponent.call(void 0, {
|
|
|
1222
1255
|
const paginationLocale = _vue.computed.call(void 0,
|
|
1223
1256
|
() => isPaginationI18nDisabled.value ? void 0 : _tigercatcore.mergeTigerLocale.call(void 0, config.value.locale, resolvedPaginationLocale.value)
|
|
1224
1257
|
);
|
|
1258
|
+
_vue.watch.call(void 0,
|
|
1259
|
+
tableLocaleInput,
|
|
1260
|
+
(locale) => {
|
|
1261
|
+
const resolveId = ++tableLocaleResolveId;
|
|
1262
|
+
if (!locale) {
|
|
1263
|
+
resolvedTableLocale.value = void 0;
|
|
1264
|
+
return;
|
|
1265
|
+
}
|
|
1266
|
+
const immediateLocale = _tigercatcore.getImmediateTigerLocale.call(void 0, locale);
|
|
1267
|
+
resolvedTableLocale.value = immediateLocale;
|
|
1268
|
+
if (!_tigercatcore.isLazyTigerLocale.call(void 0, locale)) return;
|
|
1269
|
+
_tigercatcore.resolveTigerLocale.call(void 0, locale).then((nextLocale) => {
|
|
1270
|
+
if (resolveId === tableLocaleResolveId) {
|
|
1271
|
+
resolvedTableLocale.value = nextLocale;
|
|
1272
|
+
}
|
|
1273
|
+
}).catch(() => {
|
|
1274
|
+
if (resolveId === tableLocaleResolveId) {
|
|
1275
|
+
resolvedTableLocale.value = immediateLocale;
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
},
|
|
1279
|
+
{ immediate: true }
|
|
1280
|
+
);
|
|
1281
|
+
const tableLocale = _vue.computed.call(void 0,
|
|
1282
|
+
() => _tigercatcore.mergeTigerLocale.call(void 0, config.value.locale, resolvedTableLocale.value)
|
|
1283
|
+
);
|
|
1284
|
+
const tableLabels = _vue.computed.call(void 0, () => {
|
|
1285
|
+
const overrides = props.emptyText === void 0 ? props.labels : { ...props.labels, emptyText: props.emptyText };
|
|
1286
|
+
return _tigercatcore.getTableLabels.call(void 0, tableLocale.value, overrides);
|
|
1287
|
+
});
|
|
1225
1288
|
const resizeController = _tigercatcore.createTableResizeObserverController.call(void 0, {
|
|
1226
1289
|
onResize: (snapshot) => {
|
|
1227
1290
|
if (!areNumberRecordsEqual(measuredColumnWidths.value, snapshot.columnWidths)) {
|
|
@@ -1251,10 +1314,14 @@ var Table = _vue.defineComponent.call(void 0, {
|
|
|
1251
1314
|
const wrapperStyle = resolvedProps.maxHeight ? {
|
|
1252
1315
|
maxHeight: typeof resolvedProps.maxHeight === "number" ? `${resolvedProps.maxHeight}px` : resolvedProps.maxHeight
|
|
1253
1316
|
} : void 0;
|
|
1317
|
+
const renderProps = {
|
|
1318
|
+
...resolvedProps,
|
|
1319
|
+
emptyText: tableLabels.value.emptyText
|
|
1320
|
+
};
|
|
1254
1321
|
const tableChildren = [
|
|
1255
|
-
renderTableHeader(ctx,
|
|
1256
|
-
renderTableBody(ctx,
|
|
1257
|
-
renderSummaryRow(ctx,
|
|
1322
|
+
renderTableHeader(ctx, renderProps, slots),
|
|
1323
|
+
renderTableBody(ctx, renderProps, slots),
|
|
1324
|
+
renderSummaryRow(ctx, renderProps)
|
|
1258
1325
|
];
|
|
1259
1326
|
const tableInner = _vue.h.call(void 0,
|
|
1260
1327
|
"table",
|
|
@@ -1282,83 +1349,192 @@ var Table = _vue.defineComponent.call(void 0, {
|
|
|
1282
1349
|
},
|
|
1283
1350
|
[tableInner]
|
|
1284
1351
|
) : tableInner;
|
|
1285
|
-
const cardContent =
|
|
1286
|
-
"
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
])
|
|
1352
|
+
const cardContent = (() => {
|
|
1353
|
+
if (resolvedProps.responsiveMode !== "card") return null;
|
|
1354
|
+
const cardChildren = [];
|
|
1355
|
+
const sortableColumns = ctx.displayColumns.value.filter((column) => column.sortable);
|
|
1356
|
+
if (resolvedProps.rowSelection && resolvedProps.rowSelection.type !== "radio" && resolvedProps.rowSelection.showCheckbox !== false && ctx.paginatedData.value.length > 0) {
|
|
1357
|
+
cardChildren.push(
|
|
1358
|
+
_vue.h.call(void 0,
|
|
1359
|
+
"div",
|
|
1360
|
+
{
|
|
1361
|
+
class: "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"
|
|
1362
|
+
},
|
|
1363
|
+
[
|
|
1364
|
+
_vue.h.call(void 0,
|
|
1365
|
+
_chunk2YFXJUBTjs.Checkbox,
|
|
1366
|
+
{
|
|
1367
|
+
size: "sm",
|
|
1368
|
+
modelValue: ctx.allSelected.value,
|
|
1369
|
+
indeterminate: ctx.someSelected.value,
|
|
1370
|
+
onChange: (checked) => ctx.handleSelectAll(checked)
|
|
1371
|
+
},
|
|
1372
|
+
{ default: () => tableLabels.value.selectAllText }
|
|
1373
|
+
)
|
|
1374
|
+
]
|
|
1375
|
+
)
|
|
1310
1376
|
);
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1377
|
+
}
|
|
1378
|
+
if (sortableColumns.length > 0) {
|
|
1379
|
+
cardChildren.push(
|
|
1380
|
+
_vue.h.call(void 0, "div", {
|
|
1381
|
+
class: "rounded-[var(--tiger-radius-md,0.5rem)] border border-[var(--tiger-border,#e5e7eb)] bg-[var(--tiger-surface,#ffffff)] px-3 py-2"
|
|
1382
|
+
}, [
|
|
1383
|
+
_vue.h.call(void 0, _chunkBGMAWKWVjs.Select, {
|
|
1384
|
+
size: "sm",
|
|
1385
|
+
modelValue: ctx.sortState.value.key && ctx.sortState.value.direction ? `${ctx.sortState.value.key}:${ctx.sortState.value.direction}` : "",
|
|
1386
|
+
options: [
|
|
1387
|
+
{ label: tableLabels.value.clearSortText, value: "" },
|
|
1388
|
+
...sortableColumns.flatMap((column) => [
|
|
1389
|
+
{
|
|
1390
|
+
label: `${_tigercatcore.formatTableSortByText.call(void 0, tableLabels.value.sortByText, column.title)} \u2191`,
|
|
1391
|
+
value: `${column.key}:asc`
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
label: `${_tigercatcore.formatTableSortByText.call(void 0, tableLabels.value.sortByText, column.title)} \u2193`,
|
|
1395
|
+
value: `${column.key}:desc`
|
|
1396
|
+
}
|
|
1397
|
+
])
|
|
1398
|
+
],
|
|
1399
|
+
clearable: false,
|
|
1400
|
+
"onUpdate:modelValue": (value) => {
|
|
1401
|
+
const nextValue = String(_nullishCoalesce(value, () => ( "")));
|
|
1402
|
+
if (!nextValue) {
|
|
1403
|
+
ctx.handleSetSort({ key: null, direction: null });
|
|
1404
|
+
return;
|
|
1405
|
+
}
|
|
1406
|
+
const separatorIndex = nextValue.lastIndexOf(":");
|
|
1407
|
+
const key = nextValue.slice(0, separatorIndex);
|
|
1408
|
+
const direction = nextValue.slice(separatorIndex + 1);
|
|
1409
|
+
ctx.handleSetSort({ key, direction });
|
|
1410
|
+
}
|
|
1321
1411
|
})
|
|
1322
|
-
)
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1412
|
+
])
|
|
1413
|
+
);
|
|
1414
|
+
}
|
|
1415
|
+
if (ctx.paginatedData.value.length === 0) {
|
|
1416
|
+
cardChildren.push(
|
|
1417
|
+
_vue.h.call(void 0, "div", { class: _tigercatcore.tableResponsiveCardClasses }, [
|
|
1418
|
+
_vue.h.call(void 0, _chunkNOZ65AMOjs.Empty, { showImage: false, description: tableLabels.value.emptyText })
|
|
1419
|
+
])
|
|
1420
|
+
);
|
|
1421
|
+
} else {
|
|
1422
|
+
cardChildren.push(
|
|
1423
|
+
...ctx.paginatedData.value.map((record, index) => {
|
|
1424
|
+
const key = ctx.paginatedRowKeys.value[index];
|
|
1425
|
+
const isExpanded = ctx.expandedRowKeySet.value.has(key);
|
|
1426
|
+
const isSelected = ctx.selectedRowKeySet.value.has(key);
|
|
1427
|
+
const isRowExpandable = resolvedProps.expandable ? resolvedProps.expandable.rowExpandable ? resolvedProps.expandable.rowExpandable(record) : true : false;
|
|
1428
|
+
const { titleColumn, bodyColumns } = _tigercatcore.getCardColumns.call(void 0, ctx.displayColumns.value);
|
|
1429
|
+
const renderCardCellContent = (column) => {
|
|
1430
|
+
const dataKey = column.dataKey || column.key;
|
|
1431
|
+
return _nullishCoalesce(_optionalChain([slots, 'access', _86 => _86[`cell-${column.key}`], 'optionalCall', _87 => _87({ record, index })]), () => ( (column.render ? column.render(record, index) : record[dataKey])));
|
|
1432
|
+
};
|
|
1433
|
+
const titleNode = titleColumn ? _vue.h.call(void 0, "div", { class: _tigercatcore.tableResponsiveCardTitleClasses }, [
|
|
1434
|
+
renderCardCellContent(titleColumn)
|
|
1435
|
+
]) : null;
|
|
1436
|
+
const rows = bodyColumns.map(
|
|
1437
|
+
(column) => _vue.h.call(void 0, "div", { key: column.key, class: _tigercatcore.tableResponsiveCardRowClasses }, [
|
|
1438
|
+
_vue.h.call(void 0, "div", { class: _tigercatcore.tableResponsiveCardLabelClasses }, column.title),
|
|
1439
|
+
_vue.h.call(void 0, "div", { class: _tigercatcore.tableResponsiveCardValueClasses }, [
|
|
1440
|
+
renderCardCellContent(column)
|
|
1441
|
+
])
|
|
1442
|
+
])
|
|
1443
|
+
);
|
|
1444
|
+
const controls = [];
|
|
1445
|
+
if (resolvedProps.rowSelection && resolvedProps.rowSelection.showCheckbox !== false) {
|
|
1446
|
+
const checkboxProps = _optionalChain([resolvedProps, 'access', _88 => _88.rowSelection, 'access', _89 => _89.getCheckboxProps, 'optionalCall', _90 => _90(record)]) || {};
|
|
1447
|
+
controls.push(
|
|
1448
|
+
_vue.h.call(void 0,
|
|
1449
|
+
"span",
|
|
1450
|
+
{ onClick: (event) => event.stopPropagation() },
|
|
1451
|
+
[
|
|
1452
|
+
resolvedProps.rowSelection.type === "radio" ? _vue.h.call(void 0, _chunk3QV2D54Hjs.Radio, {
|
|
1453
|
+
value: key,
|
|
1454
|
+
checked: isSelected,
|
|
1455
|
+
disabled: checkboxProps.disabled,
|
|
1456
|
+
"aria-label": _tigercatcore.formatTableSelectRowAriaLabel.call(void 0,
|
|
1457
|
+
tableLabels.value.selectRowAriaLabel,
|
|
1458
|
+
index + 1,
|
|
1459
|
+
_optionalChain([tableLocale, 'access', _91 => _91.value, 'optionalAccess', _92 => _92.locale])
|
|
1460
|
+
),
|
|
1461
|
+
onChange: () => ctx.handleSelectRow(key, true)
|
|
1462
|
+
}) : _vue.h.call(void 0, _chunk2YFXJUBTjs.Checkbox, {
|
|
1463
|
+
size: "sm",
|
|
1464
|
+
modelValue: isSelected,
|
|
1465
|
+
disabled: checkboxProps.disabled,
|
|
1466
|
+
"aria-label": _tigercatcore.formatTableSelectRowAriaLabel.call(void 0,
|
|
1467
|
+
tableLabels.value.selectRowAriaLabel,
|
|
1468
|
+
index + 1,
|
|
1469
|
+
_optionalChain([tableLocale, 'access', _93 => _93.value, 'optionalAccess', _94 => _94.locale])
|
|
1470
|
+
),
|
|
1471
|
+
onChange: (checked) => ctx.handleSelectRow(key, checked)
|
|
1472
|
+
})
|
|
1473
|
+
]
|
|
1474
|
+
)
|
|
1475
|
+
);
|
|
1476
|
+
}
|
|
1477
|
+
if (resolvedProps.expandable && isRowExpandable) {
|
|
1478
|
+
controls.push(
|
|
1479
|
+
_vue.h.call(void 0,
|
|
1480
|
+
"button",
|
|
1481
|
+
{
|
|
1482
|
+
type: "button",
|
|
1483
|
+
class: "text-sm text-[var(--tiger-primary,#2563eb)]",
|
|
1484
|
+
"aria-expanded": isExpanded,
|
|
1485
|
+
onClick: (event) => {
|
|
1486
|
+
event.stopPropagation();
|
|
1487
|
+
ctx.handleToggleExpand(key, record);
|
|
1488
|
+
}
|
|
1489
|
+
},
|
|
1490
|
+
isExpanded ? tableLabels.value.collapseText : tableLabels.value.expandText
|
|
1491
|
+
)
|
|
1492
|
+
);
|
|
1493
|
+
}
|
|
1494
|
+
const expandedContent = resolvedProps.expandable && isExpanded && isRowExpandable ? _nullishCoalesce(_optionalChain([slots, 'access', _95 => _95["expanded-row"], 'optionalCall', _96 => _96({ record, index })]), () => ( _optionalChain([resolvedProps, 'access', _97 => _97.expandable, 'access', _98 => _98.expandedRowRender, 'optionalCall', _99 => _99(record, index)]))) : null;
|
|
1495
|
+
const cardContext = {
|
|
1496
|
+
record,
|
|
1497
|
+
index,
|
|
1498
|
+
columns: ctx.displayColumns.value,
|
|
1499
|
+
selected: isSelected,
|
|
1500
|
+
expanded: isExpanded,
|
|
1501
|
+
toggleExpand: () => ctx.handleToggleExpand(key, record),
|
|
1502
|
+
selectRow: (checked) => ctx.handleSelectRow(key, checked)
|
|
1503
|
+
};
|
|
1504
|
+
const customCard = _nullishCoalesce(_optionalChain([slots, 'access', _100 => _100.card, 'optionalCall', _101 => _101(cardContext)]), () => ( _optionalChain([resolvedProps, 'access', _102 => _102.renderCard, 'optionalCall', _103 => _103(cardContext)])));
|
|
1505
|
+
const resolvedCardClassName = typeof resolvedProps.cardClassName === "function" ? resolvedProps.cardClassName(record, index) : resolvedProps.cardClassName;
|
|
1506
|
+
return _vue.h.call(void 0,
|
|
1507
|
+
"div",
|
|
1328
1508
|
{
|
|
1329
|
-
|
|
1330
|
-
class:
|
|
1331
|
-
|
|
1332
|
-
onClick: (event) => {
|
|
1333
|
-
event.stopPropagation();
|
|
1334
|
-
ctx.handleToggleExpand(key, record);
|
|
1335
|
-
}
|
|
1509
|
+
key,
|
|
1510
|
+
class: _tigercatcore.classNames.call(void 0, _tigercatcore.tableResponsiveCardClasses, resolvedCardClassName),
|
|
1511
|
+
onClick: () => ctx.handleRowClick(record, index, key)
|
|
1336
1512
|
},
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
titleNode,
|
|
1352
|
-
...rows,
|
|
1353
|
-
expandedContent ? _vue.h.call(void 0,
|
|
1354
|
-
"div",
|
|
1355
|
-
{ class: "mt-3 border-t border-[var(--tiger-border,#e5e7eb)] pt-3" },
|
|
1356
|
-
[expandedContent]
|
|
1357
|
-
) : null
|
|
1358
|
-
]
|
|
1513
|
+
customCard !== void 0 && customCard !== null ? [customCard] : [
|
|
1514
|
+
controls.length ? _vue.h.call(void 0, "div", { class: "mb-2 flex items-center gap-3" }, controls) : null,
|
|
1515
|
+
titleNode,
|
|
1516
|
+
...rows,
|
|
1517
|
+
expandedContent ? _vue.h.call(void 0,
|
|
1518
|
+
"div",
|
|
1519
|
+
{
|
|
1520
|
+
class: "mt-3 border-t border-[var(--tiger-border,#e5e7eb)] pt-3"
|
|
1521
|
+
},
|
|
1522
|
+
[expandedContent]
|
|
1523
|
+
) : null
|
|
1524
|
+
]
|
|
1525
|
+
);
|
|
1526
|
+
})
|
|
1359
1527
|
);
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1528
|
+
}
|
|
1529
|
+
return _vue.h.call(void 0,
|
|
1530
|
+
"div",
|
|
1531
|
+
{
|
|
1532
|
+
class: _tigercatcore.getTableResponsiveCardListClasses.call(void 0, resolvedProps.cardBreakpoint),
|
|
1533
|
+
"data-tiger-table-mobile": "card"
|
|
1534
|
+
},
|
|
1535
|
+
cardChildren
|
|
1536
|
+
);
|
|
1537
|
+
})();
|
|
1362
1538
|
return _vue.h.call(void 0,
|
|
1363
1539
|
"div",
|
|
1364
1540
|
{
|
|
@@ -1393,11 +1569,11 @@ var Table = _vue.defineComponent.call(void 0, {
|
|
|
1393
1569
|
class: _tigercatcore.tableLoadingOverlayClasses,
|
|
1394
1570
|
role: "status",
|
|
1395
1571
|
"aria-live": "polite",
|
|
1396
|
-
"aria-label":
|
|
1572
|
+
"aria-label": tableLabels.value.loadingText
|
|
1397
1573
|
},
|
|
1398
|
-
[LoadingSpinner(), _vue.h.call(void 0, "span", { class: "sr-only" },
|
|
1574
|
+
[LoadingSpinner(), _vue.h.call(void 0, "span", { class: "sr-only" }, tableLabels.value.loadingText)]
|
|
1399
1575
|
),
|
|
1400
|
-
renderPagination(ctx,
|
|
1576
|
+
renderPagination(ctx, renderProps, {
|
|
1401
1577
|
locale: paginationLocale.value,
|
|
1402
1578
|
disableI18n: isPaginationI18nDisabled.value
|
|
1403
1579
|
})
|