@expcat/tigercat-vue 2.0.0-preview.4 → 2.0.0-preview.6

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.
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-U6OGGZBY.mjs";
5
5
  import {
6
6
  List
7
- } from "./chunk-6LORRRRB.mjs";
7
+ } from "./chunk-GIOEFFG6.mjs";
8
8
  import {
9
9
  Button
10
10
  } from "./chunk-YZBQ6IR7.mjs";
@@ -4,6 +4,9 @@ import {
4
4
  import {
5
5
  Radio
6
6
  } from "./chunk-6BDDX2R4.mjs";
7
+ import {
8
+ Pagination
9
+ } from "./chunk-N6GLO7U5.mjs";
7
10
  import {
8
11
  Empty
9
12
  } from "./chunk-SJINC5NF.mjs";
@@ -403,6 +406,9 @@ function useTableState(props, emit, measuredColumnWidths) {
403
406
  if (props.pagination === false) {
404
407
  return processedData.value;
405
408
  }
409
+ if (paginationConfig.value?.remote) {
410
+ return processedData.value;
411
+ }
406
412
  return paginateData(processedData.value, currentPage.value, currentPageSize.value);
407
413
  });
408
414
  const paginatedRowKeys = computed(() => {
@@ -1229,97 +1235,65 @@ function renderSummaryRow(ctx, props) {
1229
1235
  // src/components/Table/render-pagination.ts
1230
1236
  import { h as h5 } from "vue";
1231
1237
  import {
1232
- formatIntlNumber,
1233
- formatPaginationTotal,
1234
1238
  formatPaginationPageIndicator,
1239
+ formatPaginationTotal,
1240
+ getBuiltInPaginationContainerClasses,
1235
1241
  getPaginationLabels,
1236
- getSimplePaginationContainerClasses,
1237
- getSimplePaginationTotalClasses,
1238
- getSimplePaginationControlsClasses,
1239
- getSimplePaginationSelectClasses,
1240
- getSimplePaginationButtonClasses,
1241
- getSimplePaginationPageIndicatorClasses,
1242
- getSimplePaginationButtonsWrapperClasses
1242
+ resolvePaginationDisplayMode
1243
1243
  } from "@expcat/tigercat-core";
1244
1244
  function renderPagination(ctx, props, view) {
1245
1245
  if (props.pagination === false || !ctx.paginationInfo.value) {
1246
1246
  return null;
1247
1247
  }
1248
- const { totalPages, startIndex, endIndex, hasNext, hasPrev } = ctx.paginationInfo.value;
1248
+ const { totalPages } = ctx.paginationInfo.value;
1249
1249
  const paginationConfig = props.pagination;
1250
1250
  const total = paginationConfig.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : ctx.processedData.value.length;
1251
1251
  const locale = view?.disableI18n ? void 0 : view?.locale;
1252
1252
  const labels = getPaginationLabels(locale);
1253
1253
  const localeCode = locale?.locale;
1254
- const finalTotalText = paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : formatPaginationTotal(labels.totalText, total, [startIndex, endIndex], localeCode);
1255
- const finalPrevText = paginationConfig.prevText || labels.prevPageAriaLabel;
1256
- const finalNextText = paginationConfig.nextText || labels.nextPageAriaLabel;
1257
- const finalPageIndicatorText = paginationConfig.pageIndicatorText ? paginationConfig.pageIndicatorText(ctx.currentPage.value, totalPages) : formatPaginationPageIndicator(
1258
- labels.pageIndicatorText,
1259
- ctx.currentPage.value,
1260
- totalPages,
1261
- localeCode
1262
- );
1263
- const finalPrevAriaLabel = view?.disableI18n ? finalPrevText : labels.prevPageAriaLabel;
1264
- const finalNextAriaLabel = view?.disableI18n ? finalNextText : labels.nextPageAriaLabel;
1265
- const normalizedPageSizeOptions = paginationConfig.pageSizeOptions || [
1254
+ const { simple, showQuickJumper } = resolvePaginationDisplayMode(totalPages, paginationConfig);
1255
+ const totalText = paginationConfig.totalText ?? ((value, range) => formatPaginationTotal(labels.totalText, value, range, localeCode));
1256
+ const pageIndicatorText = paginationConfig.pageIndicatorText ?? ((current, pages) => formatPaginationPageIndicator(labels.pageIndicatorText, current, pages, localeCode));
1257
+ const overrides = view?.disableI18n ? { ...labels } : {};
1258
+ if (paginationConfig.prevText) overrides.prevPageAriaLabel = paginationConfig.prevText;
1259
+ if (paginationConfig.nextText) overrides.nextPageAriaLabel = paginationConfig.nextText;
1260
+ const labelsOverride = Object.keys(overrides).length > 0 ? overrides : void 0;
1261
+ const pageSizeOptions = paginationConfig.pageSizeOptions ?? [
1266
1262
  10,
1267
1263
  20,
1268
1264
  50,
1269
1265
  100
1270
1266
  ];
1271
- return h5("div", { class: getSimplePaginationContainerClasses() }, [
1272
- paginationConfig.showTotal !== false && h5("div", { class: getSimplePaginationTotalClasses() }, finalTotalText),
1273
- h5("div", { class: getSimplePaginationControlsClasses() }, [
1274
- paginationConfig.showSizeChanger !== false && h5(
1275
- "select",
1276
- {
1277
- class: getSimplePaginationSelectClasses(),
1278
- value: ctx.currentPageSize.value,
1279
- "aria-label": labels.itemsPerPageText,
1280
- onChange: (e) => ctx.handlePageSizeChange(Number(e.target.value))
1281
- },
1282
- normalizedPageSizeOptions.map((option) => {
1283
- const value = typeof option === "number" ? option : option.value;
1284
- const label = typeof option === "number" ? `${formatIntlNumber(value, localeCode)} ${labels.itemsPerPageText}` : option.label ?? `${formatIntlNumber(value, localeCode)} ${labels.itemsPerPageText}`;
1285
- return h5(
1286
- "option",
1287
- { value, key: value },
1288
- paginationConfig.pageSizeText ? paginationConfig.pageSizeText(value) : label
1289
- );
1290
- })
1291
- ),
1292
- h5("div", { class: getSimplePaginationButtonsWrapperClasses() }, [
1293
- h5(
1294
- "button",
1295
- {
1296
- class: getSimplePaginationButtonClasses(!hasPrev),
1297
- disabled: !hasPrev,
1298
- "aria-label": finalPrevAriaLabel,
1299
- onClick: () => ctx.handlePageChange(ctx.currentPage.value - 1)
1300
- },
1301
- finalPrevText
1302
- ),
1303
- h5(
1304
- "span",
1305
- {
1306
- class: getSimplePaginationPageIndicatorClasses(),
1307
- "aria-label": finalPageIndicatorText
1308
- },
1309
- finalPageIndicatorText
1310
- ),
1311
- h5(
1312
- "button",
1313
- {
1314
- class: getSimplePaginationButtonClasses(!hasNext),
1315
- disabled: !hasNext,
1316
- "aria-label": finalNextAriaLabel,
1317
- onClick: () => ctx.handlePageChange(ctx.currentPage.value + 1)
1318
- },
1319
- finalNextText
1320
- )
1321
- ])
1322
- ])
1267
+ const pageSizeText = paginationConfig.pageSizeText;
1268
+ const normalizedPageSizeOptions = pageSizeText ? pageSizeOptions.map((option) => {
1269
+ if (typeof option === "number") {
1270
+ return { value: option, label: pageSizeText(option) };
1271
+ }
1272
+ return { value: option.value, label: option.label ?? pageSizeText(option.value) };
1273
+ }) : pageSizeOptions;
1274
+ return h5("div", { class: getBuiltInPaginationContainerClasses() }, [
1275
+ h5(Pagination, {
1276
+ size: "small",
1277
+ align: "right",
1278
+ current: ctx.currentPage.value,
1279
+ pageSize: ctx.currentPageSize.value,
1280
+ total,
1281
+ simple,
1282
+ showQuickJumper,
1283
+ showSizeChanger: paginationConfig.showSizeChanger !== false,
1284
+ showTotal: paginationConfig.showTotal !== false,
1285
+ totalText,
1286
+ pageIndicatorText,
1287
+ pageSizeOptions: normalizedPageSizeOptions,
1288
+ locale,
1289
+ labels: labelsOverride,
1290
+ onChange: (page, pageSize) => {
1291
+ if (pageSize === ctx.currentPageSize.value) {
1292
+ ctx.handlePageChange(page);
1293
+ }
1294
+ },
1295
+ onPageSizeChange: (_page, pageSize) => ctx.handlePageSizeChange(pageSize)
1296
+ })
1323
1297
  ]);
1324
1298
  }
1325
1299
 
@@ -1,3 +1,6 @@
1
+ import {
2
+ Pagination
3
+ } from "./chunk-N6GLO7U5.mjs";
1
4
  import {
2
5
  VirtualList
3
6
  } from "./chunk-HS4YQGZQ.mjs";
@@ -39,13 +42,8 @@ import {
39
42
  getSpinnerSVG,
40
43
  normalizeSvgAttrs,
41
44
  getLoadingOverlaySpinnerClasses,
42
- getSimplePaginationContainerClasses,
43
- getSimplePaginationTotalClasses,
44
- getSimplePaginationControlsClasses,
45
- getSimplePaginationSelectClasses,
46
- getSimplePaginationButtonClasses,
47
- getSimplePaginationPageIndicatorClasses,
48
- getSimplePaginationButtonsWrapperClasses,
45
+ getBuiltInPaginationContainerClasses,
46
+ resolvePaginationDisplayMode,
49
47
  getPaginationLabels,
50
48
  formatPaginationTotal,
51
49
  formatPaginationPageIndicator
@@ -211,11 +209,17 @@ var List = defineComponent({
211
209
  const handler = vnodeProps.onItemClick;
212
210
  return typeof handler === "function" || Array.isArray(handler);
213
211
  });
214
- const currentPage = ref(
215
- props.pagination && typeof props.pagination === "object" ? props.pagination.current || 1 : 1
212
+ const paginationCfg = computed(
213
+ () => props.pagination !== false && typeof props.pagination === "object" ? props.pagination : null
214
+ );
215
+ const isRemotePagination = computed(() => paginationCfg.value?.remote === true);
216
+ const internalCurrentPage = ref(paginationCfg.value?.current || 1);
217
+ const internalCurrentPageSize = ref(paginationCfg.value?.pageSize || 10);
218
+ const currentPage = computed(
219
+ () => isRemotePagination.value ? paginationCfg.value?.current ?? internalCurrentPage.value : internalCurrentPage.value
216
220
  );
217
- const currentPageSize = ref(
218
- props.pagination && typeof props.pagination === "object" ? props.pagination.pageSize || 10 : 10
221
+ const currentPageSize = computed(
222
+ () => isRemotePagination.value ? paginationCfg.value?.pageSize ?? internalCurrentPageSize.value : internalCurrentPageSize.value
219
223
  );
220
224
  const dragIndex = ref(null);
221
225
  function handleDragStart(index) {
@@ -243,14 +247,19 @@ var List = defineComponent({
243
247
  if (props.pagination === false) {
244
248
  return props.dataSource;
245
249
  }
250
+ if (isRemotePagination.value) {
251
+ return props.dataSource;
252
+ }
246
253
  return paginateData(props.dataSource, currentPage.value, currentPageSize.value);
247
254
  });
255
+ const paginationTotal = computed(
256
+ () => isRemotePagination.value ? paginationCfg.value?.total ?? props.dataSource.length : props.dataSource.length
257
+ );
248
258
  const paginationInfo = computed(() => {
249
259
  if (props.pagination === false) {
250
260
  return null;
251
261
  }
252
- const total = props.dataSource.length;
253
- return calculatePagination(total, currentPage.value, currentPageSize.value);
262
+ return calculatePagination(paginationTotal.value, currentPage.value, currentPageSize.value);
254
263
  });
255
264
  const listClasses = computed(() => {
256
265
  return classNames(
@@ -275,12 +284,12 @@ var List = defineComponent({
275
284
  );
276
285
  });
277
286
  function handlePageChange(page) {
278
- currentPage.value = page;
287
+ internalCurrentPage.value = page;
279
288
  emit("page-change", { current: page, pageSize: currentPageSize.value });
280
289
  }
281
290
  function handlePageSizeChange(pageSize) {
282
- currentPageSize.value = pageSize;
283
- currentPage.value = 1;
291
+ internalCurrentPageSize.value = pageSize;
292
+ internalCurrentPage.value = 1;
284
293
  emit("page-change", { current: 1, pageSize });
285
294
  }
286
295
  function handleItemClick(item, index) {
@@ -435,72 +444,44 @@ var List = defineComponent({
435
444
  if (props.pagination === false || !paginationInfo.value) {
436
445
  return null;
437
446
  }
438
- const { totalPages, startIndex, endIndex, hasNext, hasPrev } = paginationInfo.value;
439
- const total = props.dataSource.length;
447
+ const { totalPages } = paginationInfo.value;
448
+ const total = paginationTotal.value;
440
449
  const paginationConfig = props.pagination;
441
450
  const paginationLabels = getPaginationLabels(mergedLocale.value);
442
451
  const localeCode = mergedLocale.value?.locale;
443
- return h("div", { class: getSimplePaginationContainerClasses() }, [
444
- // Total info
445
- paginationConfig.showTotal !== false && h(
446
- "div",
447
- { class: getSimplePaginationTotalClasses() },
448
- paginationConfig.totalText ? paginationConfig.totalText(total, [startIndex, endIndex]) : formatPaginationTotal(
449
- paginationLabels.totalText,
450
- total,
451
- [startIndex, endIndex],
452
- localeCode
453
- )
454
- ),
455
- // Pagination controls
456
- h("div", { class: getSimplePaginationControlsClasses() }, [
457
- // Page size selector
458
- paginationConfig.showSizeChanger !== false && h(
459
- "select",
460
- {
461
- class: getSimplePaginationSelectClasses(),
462
- value: currentPageSize.value,
463
- onChange: (e) => handlePageSizeChange(Number(e.target.value))
464
- },
465
- (paginationConfig.pageSizeOptions || [10, 20, 50, 100]).map(
466
- (size) => h("option", { value: size }, `${size} ${paginationLabels.itemsPerPageText}`)
467
- )
468
- ),
469
- // Page buttons
470
- h("div", { class: getSimplePaginationButtonsWrapperClasses() }, [
471
- // Previous button
472
- h(
473
- "button",
474
- {
475
- class: getSimplePaginationButtonClasses(!hasPrev),
476
- disabled: !hasPrev,
477
- onClick: () => handlePageChange(currentPage.value - 1)
478
- },
479
- paginationLabels.prevPageAriaLabel
480
- ),
481
- // Current page indicator
482
- h(
483
- "span",
484
- { class: getSimplePaginationPageIndicatorClasses() },
485
- formatPaginationPageIndicator(
486
- paginationLabels.pageIndicatorText,
487
- currentPage.value,
488
- totalPages,
489
- localeCode
490
- )
491
- ),
492
- // Next button
493
- h(
494
- "button",
495
- {
496
- class: getSimplePaginationButtonClasses(!hasNext),
497
- disabled: !hasNext,
498
- onClick: () => handlePageChange(currentPage.value + 1)
499
- },
500
- paginationLabels.nextPageAriaLabel
501
- )
502
- ])
503
- ])
452
+ const { simple, showQuickJumper } = resolvePaginationDisplayMode(
453
+ totalPages,
454
+ paginationConfig
455
+ );
456
+ const totalText = paginationConfig.totalText ?? ((value, range) => formatPaginationTotal(paginationLabels.totalText, value, range, localeCode));
457
+ const pageIndicatorText = (current, pages) => formatPaginationPageIndicator(
458
+ paginationLabels.pageIndicatorText,
459
+ current,
460
+ pages,
461
+ localeCode
462
+ );
463
+ return h("div", { class: getBuiltInPaginationContainerClasses() }, [
464
+ h(Pagination, {
465
+ size: "small",
466
+ align: "right",
467
+ current: currentPage.value,
468
+ pageSize: currentPageSize.value,
469
+ total,
470
+ simple,
471
+ showQuickJumper,
472
+ showSizeChanger: paginationConfig.showSizeChanger !== false,
473
+ showTotal: paginationConfig.showTotal !== false,
474
+ totalText,
475
+ pageIndicatorText,
476
+ pageSizeOptions: paginationConfig.pageSizeOptions || [10, 20, 50, 100],
477
+ locale: mergedLocale.value,
478
+ onChange: (page, pageSize) => {
479
+ if (pageSize === currentPageSize.value) {
480
+ handlePageChange(page);
481
+ }
482
+ },
483
+ onPageSizeChange: (_page, pageSize) => handlePageSizeChange(pageSize)
484
+ })
504
485
  ]);
505
486
  }
506
487
  return () => {
@@ -0,0 +1,156 @@
1
+ import {
2
+ Dropdown,
3
+ DropdownItem,
4
+ DropdownMenu
5
+ } from "./chunk-BNNTDSLJ.mjs";
6
+ import {
7
+ useTigerConfig
8
+ } from "./chunk-UOJOJBEU.mjs";
9
+
10
+ // src/components/DataExport.ts
11
+ import { computed, defineComponent, h, ref } from "vue";
12
+ import {
13
+ classNames,
14
+ getDataExportLabels,
15
+ mergeTigerLocale,
16
+ tableExportButtonClasses
17
+ } from "@expcat/tigercat-core";
18
+ var dataExportModulePromise = null;
19
+ function loadDataExportModule() {
20
+ dataExportModulePromise ??= import("@expcat/tigercat-core/utils/data-export");
21
+ return dataExportModulePromise;
22
+ }
23
+ var DataExport = defineComponent({
24
+ name: "TigerDataExport",
25
+ props: {
26
+ columns: {
27
+ type: Array,
28
+ required: true
29
+ },
30
+ dataSource: {
31
+ type: Array,
32
+ required: true
33
+ },
34
+ /**
35
+ * Formats offered to the user. A single format renders a plain button,
36
+ * multiple formats render a dropdown menu.
37
+ */
38
+ formats: {
39
+ type: Array,
40
+ default: () => ["xlsx", "markdown"]
41
+ },
42
+ /** Download file name without extension */
43
+ fileName: {
44
+ type: String,
45
+ default: "export"
46
+ },
47
+ /** Worksheet name used for xlsx output */
48
+ sheetName: {
49
+ type: String,
50
+ default: void 0
51
+ },
52
+ /** Transform a cell value before serialization */
53
+ cellFormatter: {
54
+ type: Function,
55
+ default: void 0
56
+ },
57
+ disabled: {
58
+ type: Boolean,
59
+ default: false
60
+ },
61
+ className: {
62
+ type: String,
63
+ default: void 0
64
+ },
65
+ /** Locale overrides merged on top of ConfigProvider locale */
66
+ locale: {
67
+ type: Object,
68
+ default: void 0
69
+ },
70
+ /** UI labels for custom text. Takes precedence over locale and ConfigProvider text. */
71
+ labels: {
72
+ type: Object,
73
+ default: void 0
74
+ }
75
+ },
76
+ emits: {
77
+ export: (_format) => true,
78
+ error: (_error) => true
79
+ },
80
+ setup(props, { emit }) {
81
+ const config = useTigerConfig();
82
+ const mergedLocale = computed(() => mergeTigerLocale(config.value.locale, props.locale));
83
+ const resolvedLabels = computed(() => getDataExportLabels(mergedLocale.value, props.labels));
84
+ const exporting = ref(false);
85
+ const handleExport = async (format) => {
86
+ if (props.disabled || exporting.value) return;
87
+ exporting.value = true;
88
+ try {
89
+ const mod = await loadDataExportModule();
90
+ const content = mod.exportData(props.columns, props.dataSource, format, {
91
+ sheetName: props.sheetName,
92
+ cellFormatter: props.cellFormatter
93
+ });
94
+ mod.downloadDataExport(content, props.fileName, format);
95
+ emit("export", format);
96
+ } catch (error) {
97
+ emit("error", error);
98
+ } finally {
99
+ exporting.value = false;
100
+ }
101
+ };
102
+ const formatLabel = (format) => format === "xlsx" ? resolvedLabels.value.xlsxText : resolvedLabels.value.markdownText;
103
+ const renderTrigger = (text, onClick) => h(
104
+ "button",
105
+ {
106
+ type: "button",
107
+ class: classNames(tableExportButtonClasses, onClick ? props.className : void 0),
108
+ "aria-label": resolvedLabels.value.triggerAriaLabel,
109
+ disabled: props.disabled || exporting.value,
110
+ onClick
111
+ },
112
+ text
113
+ );
114
+ return () => {
115
+ if (props.formats.length === 0) return null;
116
+ if (props.formats.length === 1) {
117
+ const format = props.formats[0];
118
+ return renderTrigger(
119
+ exporting.value ? resolvedLabels.value.exportingText : formatLabel(format),
120
+ () => void handleExport(format)
121
+ );
122
+ }
123
+ return h(
124
+ Dropdown,
125
+ {
126
+ trigger: "click",
127
+ disabled: props.disabled || exporting.value,
128
+ className: props.className
129
+ },
130
+ {
131
+ default: () => [
132
+ renderTrigger(
133
+ exporting.value ? resolvedLabels.value.exportingText : resolvedLabels.value.triggerText
134
+ ),
135
+ h(DropdownMenu, null, {
136
+ default: () => props.formats.map(
137
+ (format) => h(
138
+ DropdownItem,
139
+ {
140
+ key: format,
141
+ onClick: () => void handleExport(format)
142
+ },
143
+ { default: () => formatLabel(format) }
144
+ )
145
+ )
146
+ })
147
+ ]
148
+ }
149
+ );
150
+ };
151
+ }
152
+ });
153
+
154
+ export {
155
+ DataExport
156
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Table
3
- } from "./chunk-ANNYNTXR.mjs";
3
+ } from "./chunk-4JG6AG4W.mjs";
4
4
  import {
5
5
  Select
6
6
  } from "./chunk-N7LWKAYS.mjs";
@@ -131,6 +131,14 @@ var Pagination = defineComponent({
131
131
  type: Boolean,
132
132
  default: false
133
133
  },
134
+ /**
135
+ * Custom text renderer for the simple-mode page indicator.
136
+ * Defaults to `{current} / {totalPages}` when not provided.
137
+ */
138
+ pageIndicatorText: {
139
+ type: Function,
140
+ default: void 0
141
+ },
134
142
  /**
135
143
  * Size of pagination
136
144
  * @default 'medium'
@@ -367,8 +375,13 @@ var Pagination = defineComponent({
367
375
  )
368
376
  );
369
377
  if (props.simple) {
378
+ const indicatorText = props.pageIndicatorText ? props.pageIndicatorText(page, pages) : `${page} / ${pages}`;
370
379
  elements.push(
371
- h("span", { class: classNames("mx-2", getSizeTextClasses(size)) }, `${page} / ${pages}`)
380
+ h(
381
+ "span",
382
+ { class: classNames("mx-2", getSizeTextClasses(size)), "aria-label": indicatorText },
383
+ indicatorText
384
+ )
372
385
  );
373
386
  } else {
374
387
  getPageNumbers(page, pages, props.showLessItems).forEach((pageNum) => {
@@ -0,0 +1,136 @@
1
+ import * as vue from 'vue';
2
+ import { PropType } from 'vue';
3
+ import { TableColumn, DataExportFormat, TigerLocale, TigerLocaleDataExport, DataExportOptions } from '@expcat/tigercat-core';
4
+
5
+ interface VueDataExportProps<T = Record<string, unknown>> {
6
+ columns: TableColumn<T>[];
7
+ dataSource: T[];
8
+ formats?: DataExportFormat[];
9
+ fileName?: string;
10
+ sheetName?: string;
11
+ cellFormatter?: DataExportOptions<T>['cellFormatter'];
12
+ disabled?: boolean;
13
+ className?: string;
14
+ locale?: Partial<TigerLocale>;
15
+ labels?: Partial<TigerLocaleDataExport>;
16
+ }
17
+ declare const DataExport: vue.DefineComponent<vue.ExtractPropTypes<{
18
+ columns: {
19
+ type: PropType<TableColumn[]>;
20
+ required: true;
21
+ };
22
+ dataSource: {
23
+ type: PropType<Record<string, unknown>[]>;
24
+ required: true;
25
+ };
26
+ /**
27
+ * Formats offered to the user. A single format renders a plain button,
28
+ * multiple formats render a dropdown menu.
29
+ */
30
+ formats: {
31
+ type: PropType<DataExportFormat[]>;
32
+ default: () => DataExportFormat[];
33
+ };
34
+ /** Download file name without extension */
35
+ fileName: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ /** Worksheet name used for xlsx output */
40
+ sheetName: {
41
+ type: StringConstructor;
42
+ default: undefined;
43
+ };
44
+ /** Transform a cell value before serialization */
45
+ cellFormatter: {
46
+ type: PropType<(value: unknown, column: TableColumn, record: Record<string, unknown>) => unknown>;
47
+ default: undefined;
48
+ };
49
+ disabled: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
53
+ className: {
54
+ type: StringConstructor;
55
+ default: undefined;
56
+ };
57
+ /** Locale overrides merged on top of ConfigProvider locale */
58
+ locale: {
59
+ type: PropType<Partial<TigerLocale>>;
60
+ default: undefined;
61
+ };
62
+ /** UI labels for custom text. Takes precedence over locale and ConfigProvider text. */
63
+ labels: {
64
+ type: PropType<Partial<TigerLocaleDataExport>>;
65
+ default: undefined;
66
+ };
67
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
68
+ [key: string]: any;
69
+ }> | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
70
+ export: (_format: DataExportFormat) => true;
71
+ error: (_error: unknown) => true;
72
+ }, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
73
+ columns: {
74
+ type: PropType<TableColumn[]>;
75
+ required: true;
76
+ };
77
+ dataSource: {
78
+ type: PropType<Record<string, unknown>[]>;
79
+ required: true;
80
+ };
81
+ /**
82
+ * Formats offered to the user. A single format renders a plain button,
83
+ * multiple formats render a dropdown menu.
84
+ */
85
+ formats: {
86
+ type: PropType<DataExportFormat[]>;
87
+ default: () => DataExportFormat[];
88
+ };
89
+ /** Download file name without extension */
90
+ fileName: {
91
+ type: StringConstructor;
92
+ default: string;
93
+ };
94
+ /** Worksheet name used for xlsx output */
95
+ sheetName: {
96
+ type: StringConstructor;
97
+ default: undefined;
98
+ };
99
+ /** Transform a cell value before serialization */
100
+ cellFormatter: {
101
+ type: PropType<(value: unknown, column: TableColumn, record: Record<string, unknown>) => unknown>;
102
+ default: undefined;
103
+ };
104
+ disabled: {
105
+ type: BooleanConstructor;
106
+ default: boolean;
107
+ };
108
+ className: {
109
+ type: StringConstructor;
110
+ default: undefined;
111
+ };
112
+ /** Locale overrides merged on top of ConfigProvider locale */
113
+ locale: {
114
+ type: PropType<Partial<TigerLocale>>;
115
+ default: undefined;
116
+ };
117
+ /** UI labels for custom text. Takes precedence over locale and ConfigProvider text. */
118
+ labels: {
119
+ type: PropType<Partial<TigerLocaleDataExport>>;
120
+ default: undefined;
121
+ };
122
+ }>> & Readonly<{
123
+ onError?: ((_error: unknown) => any) | undefined;
124
+ onExport?: ((_format: DataExportFormat) => any) | undefined;
125
+ }>, {
126
+ locale: Partial<TigerLocale>;
127
+ labels: Partial<TigerLocaleDataExport>;
128
+ className: string;
129
+ disabled: boolean;
130
+ fileName: string;
131
+ cellFormatter: (value: unknown, column: TableColumn, record: Record<string, unknown>) => unknown;
132
+ formats: DataExportFormat[];
133
+ sheetName: string;
134
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
135
+
136
+ export { DataExport, type VueDataExportProps };
@@ -0,0 +1,10 @@
1
+ import {
2
+ DataExport
3
+ } from "../chunk-H26JXVJX.mjs";
4
+ import "../chunk-BNNTDSLJ.mjs";
5
+ import "../chunk-BDTPFPSB.mjs";
6
+ import "../chunk-UOJOJBEU.mjs";
7
+ import "../chunk-TGXBCKOU.mjs";
8
+ export {
9
+ DataExport
10
+ };
@@ -1,12 +1,13 @@
1
1
  import {
2
2
  DataTableWithToolbar,
3
3
  DataTableWithToolbar_default
4
- } from "../chunk-TXZ7GY26.mjs";
5
- import "../chunk-ANNYNTXR.mjs";
4
+ } from "../chunk-JPKC5T4O.mjs";
5
+ import "../chunk-4JG6AG4W.mjs";
6
6
  import "../chunk-N7LWKAYS.mjs";
7
+ import "../chunk-SYRRMZT2.mjs";
7
8
  import "../chunk-6BDDX2R4.mjs";
8
9
  import "../chunk-6TTICJR4.mjs";
9
- import "../chunk-SYRRMZT2.mjs";
10
+ import "../chunk-N6GLO7U5.mjs";
10
11
  import "../chunk-KE6RGD4Y.mjs";
11
12
  import "../chunk-XLNK3Z2P.mjs";
12
13
  import "../chunk-SJINC5NF.mjs";
@@ -361,8 +361,8 @@ declare const Drawer: vue.DefineComponent<vue.ExtractPropTypes<{
361
361
  open: boolean;
362
362
  mask: boolean;
363
363
  width: string | number;
364
- closable: boolean;
365
364
  placement: DrawerPlacement;
365
+ closable: boolean;
366
366
  zIndex: number;
367
367
  maskClosable: boolean;
368
368
  bodyClassName: string;
@@ -299,9 +299,9 @@ declare const Dropdown: vue.DefineComponent<vue.ExtractPropTypes<{
299
299
  offset: number;
300
300
  placement: FloatingPlacement;
301
301
  trigger: DropdownTrigger;
302
- showArrow: boolean;
303
302
  defaultOpen: boolean;
304
303
  closeOnClick: boolean;
304
+ showArrow: boolean;
305
305
  portal: boolean;
306
306
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
307
307
 
@@ -118,9 +118,9 @@ declare const FloatButton: vue.DefineComponent<vue.ExtractPropTypes<{
118
118
  disabled: boolean;
119
119
  tooltip: string;
120
120
  offset: ViewportOffset;
121
- shape: FloatButtonShape;
122
121
  placement: ViewportPlacement;
123
122
  floating: boolean;
123
+ shape: FloatButtonShape;
124
124
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
125
125
  interface VueFloatButtonGroupProps {
126
126
  shape?: FloatButtonShape;
@@ -179,8 +179,8 @@ declare const FloatButtonGroup: vue.DefineComponent<vue.ExtractPropTypes<{
179
179
  className: string;
180
180
  style: Record<string, string | number>;
181
181
  open: boolean;
182
- shape: FloatButtonShape;
183
182
  trigger: "click" | "hover";
183
+ shape: FloatButtonShape;
184
184
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
185
185
 
186
186
  export { FloatButton, FloatButtonGroup, type VueFloatButtonGroupProps, type VueFloatButtonProps, FloatButton as default };
@@ -100,7 +100,7 @@ declare const FormWizard: vue.DefineComponent<vue.ExtractPropTypes<{
100
100
  };
101
101
  }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
102
102
  [key: string]: any;
103
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "finish" | "update:current")[], "change" | "finish" | "update:current", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
103
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "update:current" | "finish")[], "change" | "update:current" | "finish", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
104
104
  steps: {
105
105
  type: PropType<WizardStep[]>;
106
106
  default: () => never[];
@@ -179,8 +179,8 @@ declare const FormWizard: vue.DefineComponent<vue.ExtractPropTypes<{
179
179
  };
180
180
  }>> & Readonly<{
181
181
  onChange?: ((...args: any[]) => any) | undefined;
182
- onFinish?: ((...args: any[]) => any) | undefined;
183
182
  "onUpdate:current"?: ((...args: any[]) => any) | undefined;
183
+ onFinish?: ((...args: any[]) => any) | undefined;
184
184
  }>, {
185
185
  locale: Partial<TigerLocale>;
186
186
  direction: StepsDirection;
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  List,
3
3
  List_default
4
- } from "../chunk-6LORRRRB.mjs";
4
+ } from "../chunk-GIOEFFG6.mjs";
5
+ import "../chunk-N6GLO7U5.mjs";
5
6
  import "../chunk-HS4YQGZQ.mjs";
6
7
  import "../chunk-UOJOJBEU.mjs";
7
8
  import "../chunk-TGXBCKOU.mjs";
@@ -255,9 +255,9 @@ declare const Menu: vue.DefineComponent<vue.ExtractPropTypes<{
255
255
  }>> & Readonly<{
256
256
  onSelect?: ((...args: any[]) => any) | undefined;
257
257
  "onUpdate:searchValue"?: ((...args: any[]) => any) | undefined;
258
+ "onOpen-change"?: ((...args: any[]) => any) | undefined;
258
259
  "onUpdate:selectedKeys"?: ((...args: any[]) => any) | undefined;
259
260
  onSearch?: ((...args: any[]) => any) | undefined;
260
- "onOpen-change"?: ((...args: any[]) => any) | undefined;
261
261
  "onUpdate:openKeys"?: ((...args: any[]) => any) | undefined;
262
262
  }>, {
263
263
  theme: MenuTheme;
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  NotificationCenter,
3
3
  NotificationCenter_default
4
- } from "../chunk-7XENCCN5.mjs";
4
+ } from "../chunk-2Y7W7IML.mjs";
5
5
  import "../chunk-U6OGGZBY.mjs";
6
- import "../chunk-6LORRRRB.mjs";
6
+ import "../chunk-GIOEFFG6.mjs";
7
+ import "../chunk-N6GLO7U5.mjs";
7
8
  import "../chunk-HS4YQGZQ.mjs";
8
9
  import "../chunk-YZBQ6IR7.mjs";
9
10
  import "../chunk-Z2ZECCGD.mjs";
@@ -18,6 +18,7 @@ interface VuePaginationProps {
18
18
  showTotal?: boolean;
19
19
  totalText?: (total: number, range: [number, number]) => string;
20
20
  simple?: boolean;
21
+ pageIndicatorText?: (current: number, totalPages: number) => string;
21
22
  size?: PaginationSize;
22
23
  align?: PaginationAlign;
23
24
  disabled?: boolean;
@@ -123,6 +124,14 @@ declare const Pagination: vue.DefineComponent<vue.ExtractPropTypes<{
123
124
  type: BooleanConstructor;
124
125
  default: boolean;
125
126
  };
127
+ /**
128
+ * Custom text renderer for the simple-mode page indicator.
129
+ * Defaults to `{current} / {totalPages}` when not provided.
130
+ */
131
+ pageIndicatorText: {
132
+ type: PropType<(current: number, totalPages: number) => string>;
133
+ default: undefined;
134
+ };
126
135
  /**
127
136
  * Size of pagination
128
137
  * @default 'medium'
@@ -285,6 +294,14 @@ declare const Pagination: vue.DefineComponent<vue.ExtractPropTypes<{
285
294
  type: BooleanConstructor;
286
295
  default: boolean;
287
296
  };
297
+ /**
298
+ * Custom text renderer for the simple-mode page indicator.
299
+ * Defaults to `{current} / {totalPages}` when not provided.
300
+ */
301
+ pageIndicatorText: {
302
+ type: PropType<(current: number, totalPages: number) => string>;
303
+ default: undefined;
304
+ };
288
305
  /**
289
306
  * Size of pagination
290
307
  * @default 'medium'
@@ -365,6 +382,7 @@ declare const Pagination: vue.DefineComponent<vue.ExtractPropTypes<{
365
382
  }>, {
366
383
  locale: TigerLocaleInput;
367
384
  totalText: (total: number, range: [number, number]) => string;
385
+ pageIndicatorText: (current: number, totalPages: number) => string;
368
386
  labels: Partial<TigerLocalePagination>;
369
387
  size: PaginationSize;
370
388
  className: string;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Pagination,
3
3
  Pagination_default
4
- } from "../chunk-4SLYX5GK.mjs";
4
+ } from "../chunk-N6GLO7U5.mjs";
5
5
  import "../chunk-UOJOJBEU.mjs";
6
6
  import "../chunk-TGXBCKOU.mjs";
7
7
  export {
@@ -165,8 +165,8 @@ declare const Popconfirm: vue.DefineComponent<vue.ExtractPropTypes<{
165
165
  offset: number;
166
166
  description: string;
167
167
  placement: FloatingPlacement;
168
- showIcon: boolean;
169
168
  defaultOpen: boolean;
169
+ showIcon: boolean;
170
170
  okType: "primary" | "danger";
171
171
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
172
172
 
@@ -189,10 +189,10 @@ declare const Spotlight: vue.DefineComponent<vue.ExtractPropTypes<{
189
189
  open: boolean | undefined;
190
190
  mask: boolean;
191
191
  limit: number;
192
+ defaultOpen: boolean;
192
193
  zIndex: number;
193
194
  maskClosable: boolean;
194
195
  items: SpotlightItem[];
195
- defaultOpen: boolean;
196
196
  query: string | undefined;
197
197
  defaultQuery: string;
198
198
  inputAriaLabel: string;
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  Table,
3
3
  Table_default
4
- } from "../chunk-ANNYNTXR.mjs";
4
+ } from "../chunk-4JG6AG4W.mjs";
5
5
  import "../chunk-N7LWKAYS.mjs";
6
6
  import "../chunk-6BDDX2R4.mjs";
7
7
  import "../chunk-6TTICJR4.mjs";
8
+ import "../chunk-N6GLO7U5.mjs";
8
9
  import "../chunk-SJINC5NF.mjs";
9
10
  import "../chunk-MYKKKVGK.mjs";
10
11
  import "../chunk-P3VAY2IQ.mjs";
@@ -60,7 +60,7 @@ declare const Tour: vue.DefineComponent<vue.ExtractPropTypes<{
60
60
  type: StringConstructor;
61
61
  default: undefined;
62
62
  };
63
- }>, () => vue.VNodeChild, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "close" | "update:open" | "finish" | "update:current")[], "change" | "close" | "update:open" | "finish" | "update:current", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
63
+ }>, () => vue.VNodeChild, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("change" | "close" | "update:current" | "update:open" | "finish")[], "change" | "close" | "update:current" | "update:open" | "finish", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
64
64
  steps: {
65
65
  type: PropType<TourStep[]>;
66
66
  required: true;
@@ -108,9 +108,9 @@ declare const Tour: vue.DefineComponent<vue.ExtractPropTypes<{
108
108
  }>> & Readonly<{
109
109
  onChange?: ((...args: any[]) => any) | undefined;
110
110
  onClose?: ((...args: any[]) => any) | undefined;
111
+ "onUpdate:current"?: ((...args: any[]) => any) | undefined;
111
112
  "onUpdate:open"?: ((...args: any[]) => any) | undefined;
112
113
  onFinish?: ((...args: any[]) => any) | undefined;
113
- "onUpdate:current"?: ((...args: any[]) => any) | undefined;
114
114
  }>, {
115
115
  locale: Partial<TigerLocale>;
116
116
  prevText: string;
@@ -118,8 +118,8 @@ declare const Tour: vue.DefineComponent<vue.ExtractPropTypes<{
118
118
  finishText: string;
119
119
  className: string;
120
120
  open: boolean;
121
- closable: boolean;
122
121
  current: number;
122
+ closable: boolean;
123
123
  loadSteps: TourStepLoader;
124
124
  showIndicators: boolean;
125
125
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
package/dist/index.d.mts CHANGED
@@ -40,6 +40,7 @@ export { DatePicker, VueDatePickerModelValue, VueDatePickerProps } from './compo
40
40
  export { TimePicker, VueTimePickerModelValue, VueTimePickerProps } from './components/TimePicker.mjs';
41
41
  export { Upload, VueUploadProps } from './components/Upload.mjs';
42
42
  export { Table, VueTableProps } from './components/Table.mjs';
43
+ export { DataExport, VueDataExportProps } from './components/DataExport.mjs';
43
44
  export { Tag, VueTagProps } from './components/Tag.mjs';
44
45
  export { Badge, VueBadgeProps } from './components/Badge.mjs';
45
46
  export { Card, VueCardProps } from './components/Card.mjs';
@@ -148,6 +149,6 @@ import 'vue';
148
149
  * Vue 3 components for Tigercat UI library
149
150
  */
150
151
 
151
- declare const version = "2.0.0-preview.4";
152
+ declare const version = "2.0.0-preview.6";
152
153
 
153
154
  export { version };
package/dist/index.mjs CHANGED
@@ -12,6 +12,7 @@ export {
12
12
  DEFAULT_CHART_COLORS,
13
13
  DEFAULT_CHART_LABELS,
14
14
  DEFAULT_CRON_EDITOR_LABELS,
15
+ DEFAULT_DATA_EXPORT_LABELS,
15
16
  DEFAULT_FILE_MANAGER_LABELS,
16
17
  DEFAULT_FORM_VALIDATION_LABELS,
17
18
  DEFAULT_FORM_WIZARD_LABELS,
@@ -60,6 +61,7 @@ export {
60
61
  MOTION_DURATION_TOKEN_VARS,
61
62
  MOTION_EASING_TOKEN_FALLBACKS,
62
63
  MOTION_EASING_TOKEN_VARS,
64
+ PAGINATION_FULL_MODE_PAGE_THRESHOLD,
63
65
  PIE_BASE_SHADOW,
64
66
  PIE_EMPHASIS_SHADOW,
65
67
  POPOVER_TEXT_CLASSES,
@@ -95,6 +97,7 @@ export {
95
97
  ZH_CN_CAROUSEL_LABELS,
96
98
  ZH_CN_CHART_LABELS,
97
99
  ZH_CN_CRON_EDITOR_LABELS,
100
+ ZH_CN_DATA_EXPORT_LABELS,
98
101
  ZH_CN_FILE_MANAGER_LABELS,
99
102
  ZH_CN_FORM_VALIDATION_LABELS,
100
103
  ZH_CN_FORM_WIZARD_LABELS,
@@ -710,6 +713,7 @@ export {
710
713
  getBreadcrumbItemClasses,
711
714
  getBreadcrumbLinkClasses,
712
715
  getBreadcrumbSeparatorClasses,
716
+ getBuiltInPaginationContainerClasses,
713
717
  getButtonGroupClasses,
714
718
  getButtonVariantClasses,
715
719
  getCalendarContainerClasses,
@@ -789,6 +793,7 @@ export {
789
793
  getCurrentActiveTourStep,
790
794
  getCurrentTime,
791
795
  getCyclicIndex,
796
+ getDataExportLabels,
792
797
  getDatePickerCalendarCellState,
793
798
  getDatePickerDayCellClasses,
794
799
  getDatePickerIconButtonClasses,
@@ -1655,6 +1660,7 @@ export {
1655
1660
  resolveMotionDuration,
1656
1661
  resolveMotionEasing,
1657
1662
  resolveMultiSeriesTooltipContent,
1663
+ resolvePaginationDisplayMode,
1658
1664
  resolvePanGesture,
1659
1665
  resolvePinchScale,
1660
1666
  resolveResponsiveChartSize,
@@ -2067,6 +2073,7 @@ export { DatePicker } from './components/DatePicker.mjs';
2067
2073
  export { TimePicker } from './components/TimePicker.mjs';
2068
2074
  export { Upload } from './components/Upload.mjs';
2069
2075
  export { Table } from './components/Table.mjs';
2076
+ export { DataExport } from './components/DataExport.mjs';
2070
2077
  export { Tag } from './components/Tag.mjs';
2071
2078
  export { Badge } from './components/Badge.mjs';
2072
2079
  export { Card } from './components/Card.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expcat/tigercat-vue",
3
- "version": "2.0.0-preview.4",
3
+ "version": "2.0.0-preview.6",
4
4
  "description": "Vue 3 components for Tigercat UI library",
5
5
  "license": "MIT",
6
6
  "author": "Yizhe Wang",
@@ -245,6 +245,11 @@
245
245
  "import": "./dist/components/CropUpload.mjs",
246
246
  "default": "./dist/components/CropUpload.mjs"
247
247
  },
248
+ "./DataExport": {
249
+ "types": "./dist/components/DataExport.d.mts",
250
+ "import": "./dist/components/DataExport.mjs",
251
+ "default": "./dist/components/DataExport.mjs"
252
+ },
248
253
  "./DataTableWithToolbar": {
249
254
  "types": "./dist/components/DataTableWithToolbar.d.mts",
250
255
  "import": "./dist/components/DataTableWithToolbar.mjs",
@@ -778,7 +783,7 @@
778
783
  "access": "public"
779
784
  },
780
785
  "dependencies": {
781
- "@expcat/tigercat-core": "2.0.0-preview.4"
786
+ "@expcat/tigercat-core": "2.0.0-preview.6"
782
787
  },
783
788
  "devDependencies": {
784
789
  "@types/node": "^22.20.0",