@expcat/tigercat-vue 0.4.0 → 0.4.3
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-ZTJTIQZY.mjs → chunk-BS52UCMT.mjs} +139 -6
- package/dist/{chunk-ND4XDRYR.mjs → chunk-CWDBL5YC.mjs} +1 -1
- package/dist/{chunk-KUJ75OHX.js → chunk-ESALMEHU.js} +10 -9
- package/dist/{chunk-KVZLGW45.js → chunk-ETTYERGO.js} +14 -5
- package/dist/{chunk-YZK2HXRT.js → chunk-HBZHIEDV.js} +2 -2
- package/dist/chunk-HK2TAPQX.js +334 -0
- package/dist/chunk-LW3LFCRZ.mjs +331 -0
- package/dist/{chunk-3PQIZBT5.js → chunk-NUFSJMVC.js} +138 -5
- package/dist/{chunk-7FCHU5KV.mjs → chunk-TTDBR2B4.mjs} +11 -10
- package/dist/{chunk-RKPYLBPU.mjs → chunk-WM4ESIHG.mjs} +15 -6
- package/dist/components/ActivityFeed.d.mts +1 -1
- package/dist/components/ActivityFeed.d.ts +1 -1
- package/dist/components/ActivityFeed.js +4 -4
- package/dist/components/ActivityFeed.mjs +2 -2
- package/dist/components/Alert.d.mts +1 -1
- package/dist/components/Alert.d.ts +1 -1
- package/dist/components/Anchor.d.mts +5 -5
- package/dist/components/Anchor.d.ts +5 -5
- package/dist/components/AnchorLink.d.mts +1 -1
- package/dist/components/AnchorLink.d.ts +1 -1
- package/dist/components/Avatar.d.mts +2 -2
- package/dist/components/Avatar.d.ts +2 -2
- package/dist/components/BackTop.d.mts +1 -1
- package/dist/components/BackTop.d.ts +1 -1
- package/dist/components/Badge.d.mts +1 -1
- package/dist/components/Badge.d.ts +1 -1
- package/dist/components/Breadcrumb.d.mts +1 -1
- package/dist/components/Breadcrumb.d.ts +1 -1
- package/dist/components/BreadcrumbItem.d.mts +1 -1
- package/dist/components/BreadcrumbItem.d.ts +1 -1
- package/dist/components/Button.d.mts +2 -2
- package/dist/components/Button.d.ts +2 -2
- package/dist/components/Card.d.mts +1 -1
- package/dist/components/Card.d.ts +1 -1
- package/dist/components/Carousel.d.mts +2 -2
- package/dist/components/Carousel.d.ts +2 -2
- package/dist/components/ChartAxis.d.mts +1 -1
- package/dist/components/ChartAxis.d.ts +1 -1
- package/dist/components/ChartGrid.d.mts +2 -2
- package/dist/components/ChartGrid.d.ts +2 -2
- package/dist/components/ChartTooltip.d.mts +1 -1
- package/dist/components/ChartTooltip.d.ts +1 -1
- package/dist/components/ChatWindow.d.mts +1 -1
- package/dist/components/ChatWindow.d.ts +1 -1
- package/dist/components/Code.d.mts +1 -1
- package/dist/components/Code.d.ts +1 -1
- package/dist/components/Collapse.d.mts +3 -3
- package/dist/components/Collapse.d.ts +3 -3
- package/dist/components/CollapsePanel.d.mts +2 -2
- package/dist/components/CollapsePanel.d.ts +2 -2
- package/dist/components/CommentThread.d.mts +3 -3
- package/dist/components/CommentThread.d.ts +3 -3
- package/dist/components/Content.d.mts +1 -1
- package/dist/components/Content.d.ts +1 -1
- package/dist/components/CropUpload.d.mts +1 -1
- package/dist/components/CropUpload.d.ts +1 -1
- package/dist/components/DataTableWithToolbar.d.mts +3 -3
- package/dist/components/DataTableWithToolbar.d.ts +3 -3
- package/dist/components/DataTableWithToolbar.js +4 -4
- package/dist/components/DataTableWithToolbar.mjs +2 -2
- package/dist/components/DatePicker.d.mts +1 -1
- package/dist/components/DatePicker.d.ts +1 -1
- package/dist/components/Descriptions.d.mts +1 -1
- package/dist/components/Descriptions.d.ts +1 -1
- package/dist/components/Drawer.d.mts +3 -3
- package/dist/components/Drawer.d.ts +3 -3
- package/dist/components/Dropdown.d.mts +1 -1
- package/dist/components/Dropdown.d.ts +1 -1
- package/dist/components/DropdownItem.d.mts +1 -1
- package/dist/components/DropdownItem.d.ts +1 -1
- package/dist/components/DropdownMenu.d.mts +1 -1
- package/dist/components/DropdownMenu.d.ts +1 -1
- package/dist/components/Footer.d.mts +1 -1
- package/dist/components/Footer.d.ts +1 -1
- package/dist/components/FormWizard.d.mts +3 -3
- package/dist/components/FormWizard.d.ts +3 -3
- package/dist/components/Header.d.mts +1 -1
- package/dist/components/Header.d.ts +1 -1
- package/dist/components/Image.d.mts +1 -1
- package/dist/components/Image.d.ts +1 -1
- package/dist/components/ImageCropper.d.mts +1 -1
- package/dist/components/ImageCropper.d.ts +1 -1
- package/dist/components/Input.d.mts +1 -1
- package/dist/components/Input.d.ts +1 -1
- package/dist/components/InputNumber.d.mts +170 -0
- package/dist/components/InputNumber.d.ts +170 -0
- package/dist/components/InputNumber.js +17 -0
- package/dist/components/InputNumber.mjs +2 -0
- package/dist/components/Layout.d.mts +1 -1
- package/dist/components/Layout.d.ts +1 -1
- package/dist/components/List.d.mts +2 -2
- package/dist/components/List.d.ts +2 -2
- package/dist/components/Loading.d.mts +2 -2
- package/dist/components/Loading.d.ts +2 -2
- package/dist/components/Menu.d.mts +1 -1
- package/dist/components/Menu.d.ts +1 -1
- package/dist/components/MenuItem.d.mts +1 -1
- package/dist/components/MenuItem.d.ts +1 -1
- package/dist/components/MenuItemGroup.d.mts +1 -1
- package/dist/components/MenuItemGroup.d.ts +1 -1
- package/dist/components/Modal.d.mts +3 -3
- package/dist/components/Modal.d.ts +3 -3
- package/dist/components/NotificationCenter.d.mts +1 -1
- package/dist/components/NotificationCenter.d.ts +1 -1
- package/dist/components/Pagination.d.mts +2 -2
- package/dist/components/Pagination.d.ts +2 -2
- package/dist/components/Popconfirm.d.mts +1 -1
- package/dist/components/Popconfirm.d.ts +1 -1
- package/dist/components/Popover.d.mts +3 -3
- package/dist/components/Popover.d.ts +3 -3
- package/dist/components/Progress.d.mts +4 -4
- package/dist/components/Progress.d.ts +4 -4
- package/dist/components/Select.d.mts +1 -1
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Sidebar.d.mts +21 -1
- package/dist/components/Sidebar.d.ts +21 -1
- package/dist/components/Sidebar.js +3 -3
- package/dist/components/Sidebar.mjs +1 -1
- package/dist/components/Skeleton.d.mts +1 -1
- package/dist/components/Skeleton.d.ts +1 -1
- package/dist/components/Slider.d.mts +1 -1
- package/dist/components/Slider.d.ts +1 -1
- package/dist/components/Space.d.mts +1 -1
- package/dist/components/Space.d.ts +1 -1
- package/dist/components/Steps.d.mts +2 -2
- package/dist/components/Steps.d.ts +2 -2
- package/dist/components/StepsItem.d.mts +1 -1
- package/dist/components/StepsItem.d.ts +1 -1
- package/dist/components/SubMenu.d.mts +1 -1
- package/dist/components/SubMenu.d.ts +1 -1
- package/dist/components/SubMenu.js +3 -3
- package/dist/components/SubMenu.mjs +1 -1
- package/dist/components/TabPane.d.mts +1 -1
- package/dist/components/TabPane.d.ts +1 -1
- package/dist/components/Table.d.mts +16 -2
- package/dist/components/Table.d.ts +16 -2
- package/dist/components/Table.js +3 -3
- package/dist/components/Table.mjs +1 -1
- package/dist/components/Tabs.d.mts +1 -1
- package/dist/components/Tabs.d.ts +1 -1
- package/dist/components/Tag.d.mts +1 -1
- package/dist/components/Tag.d.ts +1 -1
- package/dist/components/TaskBoard.d.mts +2 -2
- package/dist/components/TaskBoard.d.ts +2 -2
- package/dist/components/Textarea.d.mts +1 -1
- package/dist/components/Textarea.d.ts +1 -1
- package/dist/components/TimePicker.d.mts +2 -2
- package/dist/components/TimePicker.d.ts +2 -2
- package/dist/components/Timeline.d.mts +2 -2
- package/dist/components/Timeline.d.ts +2 -2
- package/dist/components/Tooltip.d.mts +1 -1
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components/Upload.d.mts +3 -3
- package/dist/components/Upload.d.ts +3 -3
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +45 -40
- package/dist/index.mjs +12 -11
- package/package.json +2 -2
- package/dist/{chunk-NGW5UMAN.js → chunk-EBTLMVDJ.js} +1 -1
- package/dist/{chunk-D7VMY6WX.mjs → chunk-RVEEEDJQ.mjs} +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, computed, ref, watch, h } from 'vue';
|
|
2
|
-
import { getSpinnerSVG, getFixedColumnOffsets, filterData, sortData, paginateData, getRowKey, calculatePagination, getTableWrapperClasses, classNames, tableBaseClasses, tableLoadingOverlayClasses, getSimplePaginationContainerClasses, getSimplePaginationTotalClasses, getSimplePaginationControlsClasses, getSimplePaginationSelectClasses, getSimplePaginationButtonsWrapperClasses, getSimplePaginationButtonClasses, getSimplePaginationPageIndicatorClasses, getCheckboxCellClasses, getTableHeaderCellClasses, getTableHeaderClasses, tableEmptyStateClasses, getTableCellClasses, getTableRowClasses, getLoadingOverlaySpinnerClasses, normalizeSvgAttrs, icon24ViewBox, lockClosedIcon24PathD, lockOpenIcon24PathD, icon16ViewBox, getSortIconClasses, sortAscIcon16PathD, sortDescIcon16PathD, sortBothIcon16PathD } from '@expcat/tigercat-core';
|
|
2
|
+
import { getSpinnerSVG, getFixedColumnOffsets, filterData, sortData, paginateData, getRowKey, calculatePagination, getTableWrapperClasses, classNames, tableBaseClasses, tableLoadingOverlayClasses, getSimplePaginationContainerClasses, getSimplePaginationTotalClasses, getSimplePaginationControlsClasses, getSimplePaginationSelectClasses, getSimplePaginationButtonsWrapperClasses, getSimplePaginationButtonClasses, getSimplePaginationPageIndicatorClasses, getExpandIconCellClasses, getCheckboxCellClasses, getTableHeaderCellClasses, getTableHeaderClasses, tableEmptyStateClasses, getTableCellClasses, getTableRowClasses, getExpandedRowClasses, getExpandedRowContentClasses, getLoadingOverlaySpinnerClasses, normalizeSvgAttrs, icon24ViewBox, lockClosedIcon24PathD, lockOpenIcon24PathD, icon16ViewBox, getSortIconClasses, sortAscIcon16PathD, sortDescIcon16PathD, sortBothIcon16PathD, getExpandIconClasses, expandChevronIcon16PathD } from '@expcat/tigercat-core';
|
|
3
3
|
|
|
4
4
|
// src/components/Table.ts
|
|
5
5
|
var spinnerSvg = getSpinnerSVG("spinner");
|
|
@@ -31,6 +31,20 @@ var LockIcon = (locked) => {
|
|
|
31
31
|
[h("path", { d: locked ? lockClosedIcon24PathD : lockOpenIcon24PathD })]
|
|
32
32
|
);
|
|
33
33
|
};
|
|
34
|
+
var ExpandIcon = (expanded) => {
|
|
35
|
+
return h(
|
|
36
|
+
"svg",
|
|
37
|
+
{
|
|
38
|
+
class: getExpandIconClasses(expanded),
|
|
39
|
+
width: "16",
|
|
40
|
+
height: "16",
|
|
41
|
+
viewBox: icon16ViewBox,
|
|
42
|
+
fill: "currentColor",
|
|
43
|
+
"aria-hidden": "true"
|
|
44
|
+
},
|
|
45
|
+
[h("path", { d: expandChevronIcon16PathD })]
|
|
46
|
+
);
|
|
47
|
+
};
|
|
34
48
|
var LoadingSpinner = () => {
|
|
35
49
|
return h(
|
|
36
50
|
"svg",
|
|
@@ -158,6 +172,12 @@ var Table = defineComponent({
|
|
|
158
172
|
rowSelection: {
|
|
159
173
|
type: Object
|
|
160
174
|
},
|
|
175
|
+
/**
|
|
176
|
+
* Row expansion configuration
|
|
177
|
+
*/
|
|
178
|
+
expandable: {
|
|
179
|
+
type: Object
|
|
180
|
+
},
|
|
161
181
|
/**
|
|
162
182
|
* Function to get row key
|
|
163
183
|
*/
|
|
@@ -192,7 +212,15 @@ var Table = defineComponent({
|
|
|
192
212
|
default: "auto"
|
|
193
213
|
}
|
|
194
214
|
},
|
|
195
|
-
emits: [
|
|
215
|
+
emits: [
|
|
216
|
+
"change",
|
|
217
|
+
"row-click",
|
|
218
|
+
"selection-change",
|
|
219
|
+
"sort-change",
|
|
220
|
+
"filter-change",
|
|
221
|
+
"page-change",
|
|
222
|
+
"expand-change"
|
|
223
|
+
],
|
|
196
224
|
setup(props, { emit, slots }) {
|
|
197
225
|
const paginationConfig = computed(() => {
|
|
198
226
|
return props.pagination !== false && typeof props.pagination === "object" ? props.pagination : null;
|
|
@@ -202,6 +230,7 @@ var Table = defineComponent({
|
|
|
202
230
|
computed(() => paginationConfig.value?.current !== void 0);
|
|
203
231
|
computed(() => paginationConfig.value?.pageSize !== void 0);
|
|
204
232
|
const isSelectionControlled = computed(() => props.rowSelection?.selectedRowKeys !== void 0);
|
|
233
|
+
const isExpandControlled = computed(() => props.expandable?.expandedRowKeys !== void 0);
|
|
205
234
|
const uncontrolledSortState = ref(props.defaultSort);
|
|
206
235
|
const uncontrolledFilterState = ref(props.defaultFilters);
|
|
207
236
|
const uncontrolledCurrentPage = ref(
|
|
@@ -213,6 +242,9 @@ var Table = defineComponent({
|
|
|
213
242
|
const uncontrolledSelectedRowKeys = ref(
|
|
214
243
|
props.rowSelection?.defaultSelectedRowKeys ?? props.rowSelection?.selectedRowKeys ?? []
|
|
215
244
|
);
|
|
245
|
+
const uncontrolledExpandedRowKeys = ref(
|
|
246
|
+
props.expandable?.defaultExpandedRowKeys ?? props.expandable?.expandedRowKeys ?? []
|
|
247
|
+
);
|
|
216
248
|
const sortState = computed(() => props.sort ?? uncontrolledSortState.value);
|
|
217
249
|
const filterState = computed(() => props.filters ?? uncontrolledFilterState.value);
|
|
218
250
|
const currentPage = computed(() => {
|
|
@@ -224,6 +256,9 @@ var Table = defineComponent({
|
|
|
224
256
|
const selectedRowKeys = computed(() => {
|
|
225
257
|
return props.rowSelection?.selectedRowKeys ?? uncontrolledSelectedRowKeys.value;
|
|
226
258
|
});
|
|
259
|
+
const expandedRowKeys = computed(() => {
|
|
260
|
+
return props.expandable?.expandedRowKeys ?? uncontrolledExpandedRowKeys.value;
|
|
261
|
+
});
|
|
227
262
|
watch(
|
|
228
263
|
() => props.sort,
|
|
229
264
|
(next) => {
|
|
@@ -264,6 +299,14 @@ var Table = defineComponent({
|
|
|
264
299
|
}
|
|
265
300
|
}
|
|
266
301
|
);
|
|
302
|
+
watch(
|
|
303
|
+
() => props.expandable?.expandedRowKeys,
|
|
304
|
+
(next) => {
|
|
305
|
+
if (next !== void 0) {
|
|
306
|
+
uncontrolledExpandedRowKeys.value = next;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
);
|
|
267
310
|
const fixedOverrides = ref({});
|
|
268
311
|
const displayColumns = computed(() => {
|
|
269
312
|
return props.columns.map((column) => {
|
|
@@ -312,6 +355,15 @@ var Table = defineComponent({
|
|
|
312
355
|
const selectedRowKeySet = computed(() => {
|
|
313
356
|
return new Set(selectedRowKeys.value);
|
|
314
357
|
});
|
|
358
|
+
const expandedRowKeySet = computed(() => {
|
|
359
|
+
return new Set(expandedRowKeys.value);
|
|
360
|
+
});
|
|
361
|
+
const totalColumnCount = computed(() => {
|
|
362
|
+
let count = displayColumns.value.length;
|
|
363
|
+
if (props.rowSelection) count += 1;
|
|
364
|
+
if (props.expandable) count += 1;
|
|
365
|
+
return count;
|
|
366
|
+
});
|
|
315
367
|
const paginationInfo = computed(() => {
|
|
316
368
|
if (props.pagination === false) {
|
|
317
369
|
return null;
|
|
@@ -395,6 +447,21 @@ var Table = defineComponent({
|
|
|
395
447
|
}
|
|
396
448
|
function handleRowClick(record, index) {
|
|
397
449
|
emit("row-click", record, index);
|
|
450
|
+
if (props.expandable?.expandRowByClick) {
|
|
451
|
+
const key = getRowKey(record, props.rowKey, index);
|
|
452
|
+
const isExpandable = props.expandable?.rowExpandable ? props.expandable.rowExpandable(record) : true;
|
|
453
|
+
if (isExpandable) {
|
|
454
|
+
handleToggleExpand(key, record);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function handleToggleExpand(key, record) {
|
|
459
|
+
const isExpanded = expandedRowKeySet.value.has(key);
|
|
460
|
+
const newKeys = isExpanded ? expandedRowKeys.value.filter((k) => k !== key) : [...expandedRowKeys.value, key];
|
|
461
|
+
if (!isExpandControlled.value) {
|
|
462
|
+
uncontrolledExpandedRowKeys.value = newKeys;
|
|
463
|
+
}
|
|
464
|
+
emit("expand-change", newKeys, record, !isExpanded);
|
|
398
465
|
}
|
|
399
466
|
function handleSelectRow(key, checked) {
|
|
400
467
|
let newKeys;
|
|
@@ -437,6 +504,15 @@ var Table = defineComponent({
|
|
|
437
504
|
});
|
|
438
505
|
function renderTableHeader() {
|
|
439
506
|
const headerCells = [];
|
|
507
|
+
const expandAtStart = props.expandable && props.expandable.expandIconPosition !== "end";
|
|
508
|
+
const expandAtEnd = props.expandable && props.expandable.expandIconPosition === "end";
|
|
509
|
+
const expandHeaderTh = props.expandable ? h("th", {
|
|
510
|
+
class: getExpandIconCellClasses(props.size),
|
|
511
|
+
"aria-label": "Expand"
|
|
512
|
+
}) : null;
|
|
513
|
+
if (expandAtStart && expandHeaderTh) {
|
|
514
|
+
headerCells.push(expandHeaderTh);
|
|
515
|
+
}
|
|
440
516
|
if (props.rowSelection && props.rowSelection.showCheckbox !== false && props.rowSelection.type !== "radio") {
|
|
441
517
|
headerCells.push(
|
|
442
518
|
h(
|
|
@@ -556,6 +632,9 @@ var Table = defineComponent({
|
|
|
556
632
|
)
|
|
557
633
|
);
|
|
558
634
|
});
|
|
635
|
+
if (expandAtEnd && expandHeaderTh) {
|
|
636
|
+
headerCells.push(expandHeaderTh);
|
|
637
|
+
}
|
|
559
638
|
return h("thead", { class: getTableHeaderClasses(props.stickyHeader) }, [
|
|
560
639
|
h("tr", headerCells)
|
|
561
640
|
]);
|
|
@@ -570,7 +649,7 @@ var Table = defineComponent({
|
|
|
570
649
|
h(
|
|
571
650
|
"td",
|
|
572
651
|
{
|
|
573
|
-
colspan:
|
|
652
|
+
colspan: totalColumnCount.value,
|
|
574
653
|
class: tableEmptyStateClasses
|
|
575
654
|
},
|
|
576
655
|
[
|
|
@@ -587,11 +666,39 @@ var Table = defineComponent({
|
|
|
587
666
|
])
|
|
588
667
|
]);
|
|
589
668
|
}
|
|
590
|
-
const rows = paginatedData.value.
|
|
669
|
+
const rows = paginatedData.value.flatMap((record, index) => {
|
|
591
670
|
const key = paginatedRowKeys.value[index];
|
|
592
671
|
const isSelected = selectedRowKeySet.value.has(key);
|
|
672
|
+
const isExpanded = expandedRowKeySet.value.has(key);
|
|
673
|
+
const isRowExpandable = props.expandable ? props.expandable.rowExpandable ? props.expandable.rowExpandable(record) : true : false;
|
|
593
674
|
const rowClass = typeof props.rowClassName === "function" ? props.rowClassName(record, index) : props.rowClassName;
|
|
594
675
|
const cells = [];
|
|
676
|
+
const expandAtStart = props.expandable && props.expandable.expandIconPosition !== "end";
|
|
677
|
+
const expandToggleCell = props.expandable ? h(
|
|
678
|
+
"td",
|
|
679
|
+
{
|
|
680
|
+
class: getExpandIconCellClasses(props.size)
|
|
681
|
+
},
|
|
682
|
+
isRowExpandable ? [
|
|
683
|
+
h(
|
|
684
|
+
"button",
|
|
685
|
+
{
|
|
686
|
+
type: "button",
|
|
687
|
+
class: "inline-flex items-center justify-center",
|
|
688
|
+
"aria-label": isExpanded ? "Collapse row" : "Expand row",
|
|
689
|
+
"aria-expanded": isExpanded,
|
|
690
|
+
onClick: (e) => {
|
|
691
|
+
e.stopPropagation();
|
|
692
|
+
handleToggleExpand(key, record);
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
[ExpandIcon(isExpanded)]
|
|
696
|
+
)
|
|
697
|
+
] : []
|
|
698
|
+
) : null;
|
|
699
|
+
if (expandAtStart && expandToggleCell) {
|
|
700
|
+
cells.push(expandToggleCell);
|
|
701
|
+
}
|
|
595
702
|
if (props.rowSelection && props.rowSelection.showCheckbox !== false) {
|
|
596
703
|
const checkboxProps = props.rowSelection?.getCheckboxProps?.(record) || {};
|
|
597
704
|
cells.push(
|
|
@@ -606,6 +713,7 @@ var Table = defineComponent({
|
|
|
606
713
|
class: props.rowSelection?.type === "radio" ? "border-gray-300 text-[var(--tiger-primary,#2563eb)] focus:ring-[var(--tiger-primary,#2563eb)]" : "rounded border-gray-300 text-[var(--tiger-primary,#2563eb)] focus:ring-[var(--tiger-primary,#2563eb)]",
|
|
607
714
|
checked: isSelected,
|
|
608
715
|
disabled: checkboxProps.disabled,
|
|
716
|
+
onClick: (e) => e.stopPropagation(),
|
|
609
717
|
onChange: (e) => handleSelectRow(key, e.target.checked)
|
|
610
718
|
})
|
|
611
719
|
]
|
|
@@ -647,12 +755,15 @@ var Table = defineComponent({
|
|
|
647
755
|
style
|
|
648
756
|
},
|
|
649
757
|
[
|
|
650
|
-
|
|
758
|
+
slots[`cell-${column.key}`]?.({ record, index }) ?? (column.render ? column.render(record, index) : cellValue)
|
|
651
759
|
]
|
|
652
760
|
)
|
|
653
761
|
);
|
|
654
762
|
});
|
|
655
|
-
|
|
763
|
+
if (!expandAtStart && expandToggleCell) {
|
|
764
|
+
cells.push(expandToggleCell);
|
|
765
|
+
}
|
|
766
|
+
const rowNode = h(
|
|
656
767
|
"tr",
|
|
657
768
|
{
|
|
658
769
|
key,
|
|
@@ -664,6 +775,28 @@ var Table = defineComponent({
|
|
|
664
775
|
},
|
|
665
776
|
cells
|
|
666
777
|
);
|
|
778
|
+
if (props.expandable && isExpanded && isRowExpandable) {
|
|
779
|
+
const expandedContent = slots["expanded-row"]?.({ record, index }) || (props.expandable.expandedRowRender ? props.expandable.expandedRowRender(record, index) : null);
|
|
780
|
+
const expandedRow = h(
|
|
781
|
+
"tr",
|
|
782
|
+
{
|
|
783
|
+
key: `${key}-expanded`,
|
|
784
|
+
class: getExpandedRowClasses()
|
|
785
|
+
},
|
|
786
|
+
[
|
|
787
|
+
h(
|
|
788
|
+
"td",
|
|
789
|
+
{
|
|
790
|
+
colspan: totalColumnCount.value,
|
|
791
|
+
class: getExpandedRowContentClasses(props.size)
|
|
792
|
+
},
|
|
793
|
+
[expandedContent]
|
|
794
|
+
)
|
|
795
|
+
]
|
|
796
|
+
);
|
|
797
|
+
return [rowNode, expandedRow];
|
|
798
|
+
}
|
|
799
|
+
return rowNode;
|
|
667
800
|
});
|
|
668
801
|
return h("tbody", rows);
|
|
669
802
|
}
|
|
@@ -87,7 +87,9 @@ var SubMenu = vue.defineComponent({
|
|
|
87
87
|
return props.collapsed ?? (menuContext ? menuContext.collapsed.value : false);
|
|
88
88
|
});
|
|
89
89
|
const isPopup = vue.computed(() => {
|
|
90
|
-
|
|
90
|
+
if (!menuContext) return false;
|
|
91
|
+
if (menuContext.mode.value === "horizontal") return true;
|
|
92
|
+
return menuContext.mode.value === "vertical" && effectiveCollapsed.value;
|
|
91
93
|
});
|
|
92
94
|
const isExpanded = vue.computed(() => {
|
|
93
95
|
if (menuContext?.mode.value === "horizontal" || isPopup.value) {
|
|
@@ -111,12 +113,13 @@ var SubMenu = vue.defineComponent({
|
|
|
111
113
|
const contentClasses = vue.computed(() => {
|
|
112
114
|
if (!menuContext) return "";
|
|
113
115
|
if (menuContext.mode.value === "horizontal") {
|
|
114
|
-
return tigercatCore.submenuContentHorizontalClasses;
|
|
116
|
+
return props.level === 0 ? tigercatCore.submenuContentHorizontalClasses : tigercatCore.submenuContentHorizontalNestedClasses;
|
|
115
117
|
}
|
|
116
118
|
if (isPopup.value) return tigercatCore.submenuContentPopupClasses;
|
|
117
119
|
if (menuContext.mode.value === "inline") return tigercatCore.submenuContentInlineClasses;
|
|
118
120
|
return tigercatCore.submenuContentVerticalClasses;
|
|
119
121
|
});
|
|
122
|
+
const popupZIndex = vue.computed(() => isPopup.value ? tigercatCore.getSubmenuPopupZIndex(props.level) : {});
|
|
120
123
|
const handleTitleClick = () => {
|
|
121
124
|
if (!menuContext || props.disabled) return;
|
|
122
125
|
if (menuContext.mode.value === "horizontal") return;
|
|
@@ -208,7 +211,7 @@ var SubMenu = vue.defineComponent({
|
|
|
208
211
|
}
|
|
209
212
|
};
|
|
210
213
|
const indentStyle = vue.computed(() => {
|
|
211
|
-
if (!menuContext || menuContext.mode.value
|
|
214
|
+
if (!menuContext || menuContext.mode.value === "horizontal" || props.level === 0) {
|
|
212
215
|
return {};
|
|
213
216
|
}
|
|
214
217
|
return tigercatCore.getMenuItemIndent(props.level, menuContext.inlineIndent.value);
|
|
@@ -226,9 +229,6 @@ var SubMenu = vue.defineComponent({
|
|
|
226
229
|
const nextProps = {
|
|
227
230
|
level: existingProps.level ?? nextLevel
|
|
228
231
|
};
|
|
229
|
-
if (isPopup.value) {
|
|
230
|
-
nextProps.collapsed = false;
|
|
231
|
-
}
|
|
232
232
|
return vue.cloneVNode(node, nextProps);
|
|
233
233
|
});
|
|
234
234
|
};
|
|
@@ -276,12 +276,13 @@ var SubMenu = vue.defineComponent({
|
|
|
276
276
|
},
|
|
277
277
|
titleChildren
|
|
278
278
|
);
|
|
279
|
-
const contentNode =
|
|
279
|
+
const contentNode = isPopup.value ? vue.h(
|
|
280
280
|
"ul",
|
|
281
281
|
{
|
|
282
282
|
class: contentClasses.value,
|
|
283
283
|
style: {
|
|
284
|
-
display: isExpanded.value ? "block" : "none"
|
|
284
|
+
display: isExpanded.value ? "block" : "none",
|
|
285
|
+
...popupZIndex.value
|
|
285
286
|
},
|
|
286
287
|
role: "menu",
|
|
287
288
|
"aria-hidden": isExpanded.value ? void 0 : "true"
|
|
@@ -326,7 +327,7 @@ var SubMenu = vue.defineComponent({
|
|
|
326
327
|
return vue.h(
|
|
327
328
|
"li",
|
|
328
329
|
{
|
|
329
|
-
class:
|
|
330
|
+
class: isPopup.value ? "relative" : "",
|
|
330
331
|
onMouseenter: handleMouseEnter,
|
|
331
332
|
onMouseleave: handleMouseLeave,
|
|
332
333
|
role: "none"
|
|
@@ -23,6 +23,15 @@ var Sidebar = vue.defineComponent({
|
|
|
23
23
|
type: String,
|
|
24
24
|
default: "256px"
|
|
25
25
|
},
|
|
26
|
+
/**
|
|
27
|
+
* Width when collapsed (mini mode).
|
|
28
|
+
* Set to '0px' to fully hide the sidebar when collapsed.
|
|
29
|
+
* @default '64px'
|
|
30
|
+
*/
|
|
31
|
+
collapsedWidth: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "64px"
|
|
34
|
+
},
|
|
26
35
|
/**
|
|
27
36
|
* Whether the sidebar is collapsed
|
|
28
37
|
* @default false
|
|
@@ -43,14 +52,14 @@ var Sidebar = vue.defineComponent({
|
|
|
43
52
|
const sidebarClasses = vue.computed(
|
|
44
53
|
() => tigercatCore.classNames(
|
|
45
54
|
tigercatCore.layoutSidebarClasses,
|
|
55
|
+
props.collapsed && tigercatCore.layoutSidebarCollapsedClasses,
|
|
46
56
|
props.className,
|
|
47
57
|
tigercatCore.coerceClassValue(attrs.class)
|
|
48
58
|
)
|
|
49
59
|
);
|
|
50
|
-
const sidebarStyle = vue.computed(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}));
|
|
60
|
+
const sidebarStyle = vue.computed(
|
|
61
|
+
() => tigercatCore.getSidebarStyle(props.collapsed, props.width, props.collapsedWidth)
|
|
62
|
+
);
|
|
54
63
|
return () => vue.h(
|
|
55
64
|
"aside",
|
|
56
65
|
{
|
|
@@ -58,7 +67,7 @@ var Sidebar = vue.defineComponent({
|
|
|
58
67
|
class: sidebarClasses.value,
|
|
59
68
|
style: tigercatCore.mergeStyleValues(props.style, sidebarStyle.value)
|
|
60
69
|
},
|
|
61
|
-
|
|
70
|
+
slots.default?.()
|
|
62
71
|
);
|
|
63
72
|
}
|
|
64
73
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNUFSJMVC_js = require('./chunk-NUFSJMVC.js');
|
|
4
4
|
var chunkHNQZ5JRB_js = require('./chunk-HNQZ5JRB.js');
|
|
5
5
|
var chunkAGAJJYP2_js = require('./chunk-AGAJJYP2.js');
|
|
6
6
|
var chunkWC4B72TZ_js = require('./chunk-WC4B72TZ.js');
|
|
@@ -338,7 +338,7 @@ var DataTableWithToolbar = vue.defineComponent({
|
|
|
338
338
|
},
|
|
339
339
|
[
|
|
340
340
|
renderToolbar(),
|
|
341
|
-
vue.h(
|
|
341
|
+
vue.h(chunkNUFSJMVC_js.Table, tableProps),
|
|
342
342
|
showPagination ? vue.h(chunkAGAJJYP2_js.Pagination, {
|
|
343
343
|
...props.pagination,
|
|
344
344
|
onChange: (current, pageSize) => emit("page-change", current, pageSize),
|