@expcat/tigercat-vue 2.0.0-preview.5 → 2.0.0-rc.1
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-4SLYX5GK.mjs → chunk-2LIIMWBR.mjs} +18 -7
- package/dist/chunk-H26JXVJX.mjs +156 -0
- package/dist/{chunk-4M2TNB2Z.mjs → chunk-IZRQ7LB3.mjs} +41 -74
- package/dist/{chunk-2YLUE5CW.mjs → chunk-KOG3HKOF.mjs} +35 -69
- package/dist/{chunk-QNPBLZZT.mjs → chunk-SUORTZUY.mjs} +1 -1
- package/dist/{chunk-KZ5AIM4G.mjs → chunk-TK3QU367.mjs} +1 -1
- package/dist/components/ActivityFeed.d.mts +6 -6
- package/dist/components/Alert.d.mts +3 -3
- package/dist/components/Anchor.d.mts +1 -1
- package/dist/components/AreaChart.d.mts +3 -3
- package/dist/components/AutoComplete.d.mts +5 -5
- package/dist/components/Avatar.d.mts +1 -1
- package/dist/components/AvatarGroup.d.mts +2 -2
- package/dist/components/BackTop.d.mts +1 -1
- package/dist/components/Badge.d.mts +4 -4
- package/dist/components/BarChart.d.mts +2 -2
- package/dist/components/Breadcrumb.d.mts +3 -3
- package/dist/components/Button.d.mts +3 -3
- package/dist/components/ButtonGroup.d.mts +1 -1
- package/dist/components/Calendar.d.mts +2 -2
- package/dist/components/Card.d.mts +2 -2
- package/dist/components/Carousel.d.mts +2 -2
- package/dist/components/Cascader.d.mts +3 -3
- package/dist/components/ChartCanvas.d.mts +1 -1
- package/dist/components/ChartGrid.d.mts +1 -1
- package/dist/components/ChartLegend.d.mts +1 -1
- package/dist/components/ChatWindow.d.mts +4 -4
- package/dist/components/CodeEditor.d.mts +3 -3
- package/dist/components/Collapse.d.mts +1 -1
- package/dist/components/CollapsePanel.d.mts +1 -1
- package/dist/components/ColorSwatch.d.mts +2 -2
- package/dist/components/CommentThread.d.mts +2 -2
- package/dist/components/ConfigProvider.d.mts +1 -1
- package/dist/components/Container.d.mts +1 -1
- package/dist/components/Countdown.d.mts +2 -2
- package/dist/components/CronEditor.d.mts +2 -2
- package/dist/components/CropUpload.d.mts +1 -1
- package/dist/components/DataExport.d.mts +136 -0
- package/dist/components/DataExport.mjs +10 -0
- package/dist/components/DataTableWithToolbar.d.mts +11 -11
- package/dist/components/DataTableWithToolbar.mjs +4 -3
- package/dist/components/DatePicker.d.mts +3 -3
- package/dist/components/Descriptions.d.mts +2 -2
- package/dist/components/DonutChart.d.mts +3 -3
- package/dist/components/Drawer.d.mts +4 -4
- package/dist/components/Dropdown.d.mts +1 -1
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/FileManager.d.mts +2 -2
- package/dist/components/FloatButton.d.mts +4 -4
- package/dist/components/Form.d.mts +2 -2
- package/dist/components/FormWizard.d.mts +7 -7
- package/dist/components/FunnelChart.d.mts +3 -3
- package/dist/components/Gantt.d.mts +2 -2
- package/dist/components/GaugeChart.d.mts +2 -2
- package/dist/components/HeatmapChart.d.mts +3 -3
- package/dist/components/Icon.d.mts +2 -2
- package/dist/components/Image.d.mts +2 -2
- package/dist/components/ImageAnnotation.d.mts +5 -5
- package/dist/components/ImageCropper.d.mts +1 -1
- package/dist/components/ImageViewer.d.mts +1 -1
- package/dist/components/InfiniteScroll.d.mts +3 -3
- package/dist/components/Input.d.mts +4 -4
- package/dist/components/InputGroup.d.mts +1 -1
- package/dist/components/InputNumber.d.mts +1 -1
- package/dist/components/Kanban.d.mts +1 -1
- package/dist/components/LineChart.d.mts +2 -2
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/List.d.mts +7 -7
- package/dist/components/List.mjs +2 -1
- package/dist/components/Loading.d.mts +6 -6
- package/dist/components/MarkdownEditor.d.mts +5 -5
- package/dist/components/Mentions.d.mts +3 -3
- package/dist/components/Menu.d.mts +5 -5
- package/dist/components/Modal.d.mts +7 -7
- package/dist/components/NotificationCenter.d.mts +5 -5
- package/dist/components/NotificationCenter.mjs +3 -2
- package/dist/components/NumberKeyboard.d.mts +5 -5
- package/dist/components/OrgChart.d.mts +3 -3
- package/dist/components/Pagination.d.mts +22 -4
- package/dist/components/Pagination.mjs +1 -1
- package/dist/components/PieChart.d.mts +3 -3
- package/dist/components/Popconfirm.d.mts +3 -3
- package/dist/components/Popover.d.mts +1 -1
- package/dist/components/Progress.d.mts +3 -3
- package/dist/components/QRCode.d.mts +3 -3
- package/dist/components/RadarChart.d.mts +3 -3
- package/dist/components/Rate.d.mts +2 -2
- package/dist/components/Result.d.mts +1 -1
- package/dist/components/RichTextEditor.d.mts +4 -4
- package/dist/components/Row.d.mts +1 -1
- package/dist/components/ScatterChart.d.mts +2 -2
- package/dist/components/ScrollSpy.d.mts +3 -3
- package/dist/components/Select.d.mts +3 -3
- package/dist/components/Signature.d.mts +5 -5
- package/dist/components/Skeleton.d.mts +1 -1
- package/dist/components/Space.d.mts +2 -2
- package/dist/components/Splitter.d.mts +1 -1
- package/dist/components/Spotlight.d.mts +5 -5
- package/dist/components/Steps.d.mts +3 -3
- package/dist/components/SunburstChart.d.mts +2 -2
- package/dist/components/Table.d.mts +5 -5
- package/dist/components/Table.mjs +2 -1
- package/dist/components/Tabs.d.mts +4 -4
- package/dist/components/Tag.d.mts +2 -2
- package/dist/components/TaskBoard.d.mts +2 -2
- package/dist/components/Text.d.mts +3 -3
- package/dist/components/Textarea.d.mts +3 -3
- package/dist/components/TimePicker.d.mts +4 -4
- package/dist/components/Timeline.d.mts +4 -4
- package/dist/components/Tooltip.d.mts +1 -1
- package/dist/components/Tour.d.mts +4 -4
- package/dist/components/Transfer.d.mts +3 -3
- package/dist/components/Tree.d.mts +4 -4
- package/dist/components/TreeMapChart.d.mts +2 -2
- package/dist/components/TreeSelect.d.mts +3 -3
- package/dist/components/Upload.d.mts +4 -4
- package/dist/components/VirtualTable.d.mts +3 -3
- package/dist/components/Watermark.d.mts +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +7 -7
- package/package.json +7 -2
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
formatPaginationTotal,
|
|
24
24
|
getPaginationContainerClasses,
|
|
25
25
|
getPaginationButtonBaseClasses,
|
|
26
|
-
getPaginationButtonActiveClasses,
|
|
27
26
|
getPaginationEllipsisClasses,
|
|
28
27
|
getQuickJumperInputClasses,
|
|
29
28
|
getPageSizeSelectorClasses,
|
|
@@ -131,6 +130,14 @@ var Pagination = defineComponent({
|
|
|
131
130
|
type: Boolean,
|
|
132
131
|
default: false
|
|
133
132
|
},
|
|
133
|
+
/**
|
|
134
|
+
* Custom text renderer for the simple-mode page indicator.
|
|
135
|
+
* Defaults to `{current} / {totalPages}` when not provided.
|
|
136
|
+
*/
|
|
137
|
+
pageIndicatorText: {
|
|
138
|
+
type: Function,
|
|
139
|
+
default: void 0
|
|
140
|
+
},
|
|
134
141
|
/**
|
|
135
142
|
* Size of pagination
|
|
136
143
|
* @default 'medium'
|
|
@@ -201,6 +208,9 @@ var Pagination = defineComponent({
|
|
|
201
208
|
default: void 0
|
|
202
209
|
}
|
|
203
210
|
},
|
|
211
|
+
// `change` fires on page navigation only; `page-size-change` fires on size
|
|
212
|
+
// changes and carries the resulting (clamped) page. A size change never also
|
|
213
|
+
// fires `change`, so consumers get exactly one event per interaction.
|
|
204
214
|
emits: ["update:current", "update:pageSize", "change", "page-size-change"],
|
|
205
215
|
setup(props, { emit, attrs }) {
|
|
206
216
|
const attrsRecord = attrs;
|
|
@@ -295,7 +305,6 @@ var Pagination = defineComponent({
|
|
|
295
305
|
emit("page-size-change", newPage, newPageSize);
|
|
296
306
|
if (newPage !== validatedCurrentPage.value) {
|
|
297
307
|
emit("update:current", newPage);
|
|
298
|
-
emit("change", newPage, newPageSize);
|
|
299
308
|
}
|
|
300
309
|
};
|
|
301
310
|
const handleQuickJumperSubmit = () => {
|
|
@@ -367,8 +376,13 @@ var Pagination = defineComponent({
|
|
|
367
376
|
)
|
|
368
377
|
);
|
|
369
378
|
if (props.simple) {
|
|
379
|
+
const indicatorText = props.pageIndicatorText ? props.pageIndicatorText(page, pages) : `${page} / ${pages}`;
|
|
370
380
|
elements.push(
|
|
371
|
-
h(
|
|
381
|
+
h(
|
|
382
|
+
"span",
|
|
383
|
+
{ class: classNames("mx-2", getSizeTextClasses(size)), "aria-label": indicatorText },
|
|
384
|
+
indicatorText
|
|
385
|
+
)
|
|
372
386
|
);
|
|
373
387
|
} else {
|
|
374
388
|
getPageNumbers(page, pages, props.showLessItems).forEach((pageNum) => {
|
|
@@ -383,10 +397,7 @@ var Pagination = defineComponent({
|
|
|
383
397
|
"button",
|
|
384
398
|
{
|
|
385
399
|
type: "button",
|
|
386
|
-
class:
|
|
387
|
-
getPaginationButtonBaseClasses(size),
|
|
388
|
-
isActive && getPaginationButtonActiveClasses()
|
|
389
|
-
),
|
|
400
|
+
class: getPaginationButtonBaseClasses(size, isActive),
|
|
390
401
|
disabled: props.disabled,
|
|
391
402
|
onClick: () => handlePageChange(pageNum),
|
|
392
403
|
"aria-label": formatPageAriaLabel(
|
|
@@ -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
|
+
};
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
Radio
|
|
6
6
|
} from "./chunk-6BDDX2R4.mjs";
|
|
7
|
+
import {
|
|
8
|
+
Pagination
|
|
9
|
+
} from "./chunk-2LIIMWBR.mjs";
|
|
7
10
|
import {
|
|
8
11
|
Empty
|
|
9
12
|
} from "./chunk-SJINC5NF.mjs";
|
|
@@ -1232,97 +1235,61 @@ function renderSummaryRow(ctx, props) {
|
|
|
1232
1235
|
// src/components/Table/render-pagination.ts
|
|
1233
1236
|
import { h as h5 } from "vue";
|
|
1234
1237
|
import {
|
|
1235
|
-
formatIntlNumber,
|
|
1236
|
-
formatPaginationTotal,
|
|
1237
1238
|
formatPaginationPageIndicator,
|
|
1239
|
+
formatPaginationTotal,
|
|
1240
|
+
getBuiltInPaginationContainerClasses,
|
|
1238
1241
|
getPaginationLabels,
|
|
1239
|
-
|
|
1240
|
-
getSimplePaginationTotalClasses,
|
|
1241
|
-
getSimplePaginationControlsClasses,
|
|
1242
|
-
getSimplePaginationSelectClasses,
|
|
1243
|
-
getSimplePaginationButtonClasses,
|
|
1244
|
-
getSimplePaginationPageIndicatorClasses,
|
|
1245
|
-
getSimplePaginationButtonsWrapperClasses
|
|
1242
|
+
resolvePaginationDisplayMode
|
|
1246
1243
|
} from "@expcat/tigercat-core";
|
|
1247
1244
|
function renderPagination(ctx, props, view) {
|
|
1248
1245
|
if (props.pagination === false || !ctx.paginationInfo.value) {
|
|
1249
1246
|
return null;
|
|
1250
1247
|
}
|
|
1251
|
-
const { totalPages
|
|
1248
|
+
const { totalPages } = ctx.paginationInfo.value;
|
|
1252
1249
|
const paginationConfig = props.pagination;
|
|
1253
1250
|
const total = paginationConfig.total !== void 0 && paginationConfig.total > 0 ? paginationConfig.total : ctx.processedData.value.length;
|
|
1254
1251
|
const locale = view?.disableI18n ? void 0 : view?.locale;
|
|
1255
1252
|
const labels = getPaginationLabels(locale);
|
|
1256
1253
|
const localeCode = locale?.locale;
|
|
1257
|
-
const
|
|
1258
|
-
const
|
|
1259
|
-
const
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
);
|
|
1266
|
-
const finalPrevAriaLabel = view?.disableI18n ? finalPrevText : labels.prevPageAriaLabel;
|
|
1267
|
-
const finalNextAriaLabel = view?.disableI18n ? finalNextText : labels.nextPageAriaLabel;
|
|
1268
|
-
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 ?? [
|
|
1269
1262
|
10,
|
|
1270
1263
|
20,
|
|
1271
1264
|
50,
|
|
1272
1265
|
100
|
|
1273
1266
|
];
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
disabled: !hasPrev,
|
|
1301
|
-
"aria-label": finalPrevAriaLabel,
|
|
1302
|
-
onClick: () => ctx.handlePageChange(ctx.currentPage.value - 1)
|
|
1303
|
-
},
|
|
1304
|
-
finalPrevText
|
|
1305
|
-
),
|
|
1306
|
-
h5(
|
|
1307
|
-
"span",
|
|
1308
|
-
{
|
|
1309
|
-
class: getSimplePaginationPageIndicatorClasses(),
|
|
1310
|
-
"aria-label": finalPageIndicatorText
|
|
1311
|
-
},
|
|
1312
|
-
finalPageIndicatorText
|
|
1313
|
-
),
|
|
1314
|
-
h5(
|
|
1315
|
-
"button",
|
|
1316
|
-
{
|
|
1317
|
-
class: getSimplePaginationButtonClasses(!hasNext),
|
|
1318
|
-
disabled: !hasNext,
|
|
1319
|
-
"aria-label": finalNextAriaLabel,
|
|
1320
|
-
onClick: () => ctx.handlePageChange(ctx.currentPage.value + 1)
|
|
1321
|
-
},
|
|
1322
|
-
finalNextText
|
|
1323
|
-
)
|
|
1324
|
-
])
|
|
1325
|
-
])
|
|
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) => ctx.handlePageChange(page),
|
|
1291
|
+
onPageSizeChange: (_page, pageSize) => ctx.handlePageSizeChange(pageSize)
|
|
1292
|
+
})
|
|
1326
1293
|
]);
|
|
1327
1294
|
}
|
|
1328
1295
|
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Pagination
|
|
3
|
+
} from "./chunk-2LIIMWBR.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
|
-
|
|
43
|
-
|
|
44
|
-
getSimplePaginationControlsClasses,
|
|
45
|
-
getSimplePaginationSelectClasses,
|
|
46
|
-
getSimplePaginationButtonClasses,
|
|
47
|
-
getSimplePaginationPageIndicatorClasses,
|
|
48
|
-
getSimplePaginationButtonsWrapperClasses,
|
|
45
|
+
getBuiltInPaginationContainerClasses,
|
|
46
|
+
resolvePaginationDisplayMode,
|
|
49
47
|
getPaginationLabels,
|
|
50
48
|
formatPaginationTotal,
|
|
51
49
|
formatPaginationPageIndicator
|
|
@@ -446,72 +444,40 @@ var List = defineComponent({
|
|
|
446
444
|
if (props.pagination === false || !paginationInfo.value) {
|
|
447
445
|
return null;
|
|
448
446
|
}
|
|
449
|
-
const { totalPages
|
|
447
|
+
const { totalPages } = paginationInfo.value;
|
|
450
448
|
const total = paginationTotal.value;
|
|
451
449
|
const paginationConfig = props.pagination;
|
|
452
450
|
const paginationLabels = getPaginationLabels(mergedLocale.value);
|
|
453
451
|
const localeCode = mergedLocale.value?.locale;
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
paginationConfig
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
h(
|
|
484
|
-
"button",
|
|
485
|
-
{
|
|
486
|
-
class: getSimplePaginationButtonClasses(!hasPrev),
|
|
487
|
-
disabled: !hasPrev,
|
|
488
|
-
onClick: () => handlePageChange(currentPage.value - 1)
|
|
489
|
-
},
|
|
490
|
-
paginationLabels.prevPageAriaLabel
|
|
491
|
-
),
|
|
492
|
-
// Current page indicator
|
|
493
|
-
h(
|
|
494
|
-
"span",
|
|
495
|
-
{ class: getSimplePaginationPageIndicatorClasses() },
|
|
496
|
-
formatPaginationPageIndicator(
|
|
497
|
-
paginationLabels.pageIndicatorText,
|
|
498
|
-
currentPage.value,
|
|
499
|
-
totalPages,
|
|
500
|
-
localeCode
|
|
501
|
-
)
|
|
502
|
-
),
|
|
503
|
-
// Next button
|
|
504
|
-
h(
|
|
505
|
-
"button",
|
|
506
|
-
{
|
|
507
|
-
class: getSimplePaginationButtonClasses(!hasNext),
|
|
508
|
-
disabled: !hasNext,
|
|
509
|
-
onClick: () => handlePageChange(currentPage.value + 1)
|
|
510
|
-
},
|
|
511
|
-
paginationLabels.nextPageAriaLabel
|
|
512
|
-
)
|
|
513
|
-
])
|
|
514
|
-
])
|
|
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) => handlePageChange(page),
|
|
479
|
+
onPageSizeChange: (_page, pageSize) => handlePageSizeChange(pageSize)
|
|
480
|
+
})
|
|
515
481
|
]);
|
|
516
482
|
}
|
|
517
483
|
return () => {
|
|
@@ -107,18 +107,18 @@ declare const ActivityFeed: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
107
107
|
default: undefined;
|
|
108
108
|
};
|
|
109
109
|
}>> & Readonly<{}>, {
|
|
110
|
+
loadingText: string;
|
|
111
|
+
emptyText: string;
|
|
112
|
+
className: string;
|
|
113
|
+
style: Record<string, string | number>;
|
|
114
|
+
loading: boolean;
|
|
115
|
+
groupBy: (item: ActivityItem) => string;
|
|
110
116
|
items: ActivityItem[];
|
|
111
117
|
groups: ActivityGroup[];
|
|
112
|
-
groupBy: (item: ActivityItem) => string;
|
|
113
118
|
groupOrder: string[];
|
|
114
|
-
loading: boolean;
|
|
115
|
-
loadingText: string;
|
|
116
|
-
emptyText: string;
|
|
117
119
|
showAvatar: boolean;
|
|
118
120
|
showTime: boolean;
|
|
119
121
|
showGroupTitle: boolean;
|
|
120
|
-
className: string;
|
|
121
|
-
style: Record<string, string | number>;
|
|
122
122
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
123
123
|
|
|
124
124
|
export { ActivityFeed, type VueActivityFeedProps, ActivityFeed as default };
|
|
@@ -204,14 +204,14 @@ declare const Alert: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
204
204
|
}>> & Readonly<{
|
|
205
205
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
206
206
|
}>, {
|
|
207
|
+
type: AlertType;
|
|
208
|
+
closeAriaLabel: string;
|
|
207
209
|
size: AlertSize;
|
|
208
210
|
className: string;
|
|
209
211
|
style: Record<string, string | number>;
|
|
210
|
-
type: AlertType;
|
|
211
212
|
title: string;
|
|
212
|
-
closable: boolean;
|
|
213
|
-
closeAriaLabel: string;
|
|
214
213
|
description: string;
|
|
214
|
+
closable: boolean;
|
|
215
215
|
showIcon: boolean;
|
|
216
216
|
duration: number;
|
|
217
217
|
banner: boolean;
|
|
@@ -236,9 +236,9 @@ declare const Anchor: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
236
236
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
237
237
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
238
238
|
}>, {
|
|
239
|
+
direction: AnchorDirection;
|
|
239
240
|
className: string;
|
|
240
241
|
style: Record<string, unknown>;
|
|
241
|
-
direction: AnchorDirection;
|
|
242
242
|
offsetTop: number;
|
|
243
243
|
targetOffset: number;
|
|
244
244
|
bounds: number;
|
|
@@ -421,12 +421,12 @@ declare const AreaChart: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
421
421
|
"onSeries-click"?: ((...args: any[]) => any) | undefined;
|
|
422
422
|
"onSeries-hover"?: ((...args: any[]) => any) | undefined;
|
|
423
423
|
}>, {
|
|
424
|
-
padding: ChartPadding;
|
|
425
|
-
hoverable: boolean;
|
|
426
|
-
strokeWidth: number;
|
|
427
424
|
width: number;
|
|
428
425
|
height: number;
|
|
426
|
+
padding: ChartPadding;
|
|
429
427
|
gradient: boolean;
|
|
428
|
+
hoverable: boolean;
|
|
429
|
+
strokeWidth: number;
|
|
430
430
|
fillOpacity: number;
|
|
431
431
|
selectable: boolean;
|
|
432
432
|
responsive: boolean;
|
|
@@ -58,7 +58,7 @@ declare const AutoComplete: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
58
58
|
};
|
|
59
59
|
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
60
60
|
[key: string]: any;
|
|
61
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("
|
|
61
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("select" | "change" | "update:modelValue" | "update:searchValue" | "search-change")[], "select" | "change" | "update:modelValue" | "update:searchValue" | "search-change", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
62
62
|
modelValue: {
|
|
63
63
|
type: PropType<string | number>;
|
|
64
64
|
default: string;
|
|
@@ -112,17 +112,17 @@ declare const AutoComplete: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
112
112
|
default: undefined;
|
|
113
113
|
};
|
|
114
114
|
}>> & Readonly<{
|
|
115
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
116
115
|
onSelect?: ((...args: any[]) => any) | undefined;
|
|
116
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
117
117
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
118
118
|
"onUpdate:searchValue"?: ((...args: any[]) => any) | undefined;
|
|
119
119
|
"onSearch-change"?: ((...args: any[]) => any) | undefined;
|
|
120
120
|
}>, {
|
|
121
|
-
size: ComponentSize;
|
|
122
|
-
emptyText: string;
|
|
123
121
|
locale: Partial<TigerLocale>;
|
|
124
|
-
|
|
122
|
+
emptyText: string;
|
|
125
123
|
placeholder: string;
|
|
124
|
+
size: ComponentSize;
|
|
125
|
+
disabled: boolean;
|
|
126
126
|
modelValue: string | number;
|
|
127
127
|
options: AutoCompleteOption[];
|
|
128
128
|
searchValue: string;
|
|
@@ -151,9 +151,9 @@ declare const Avatar: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
151
151
|
size: AvatarSize;
|
|
152
152
|
className: string;
|
|
153
153
|
style: Record<string, string | number>;
|
|
154
|
+
text: string;
|
|
154
155
|
src: string;
|
|
155
156
|
alt: string;
|
|
156
|
-
text: string;
|
|
157
157
|
shape: AvatarShape;
|
|
158
158
|
bgColor: string;
|
|
159
159
|
textColor: string;
|
|
@@ -63,10 +63,10 @@ declare const AvatarGroup: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
63
63
|
default: undefined;
|
|
64
64
|
};
|
|
65
65
|
}>> & Readonly<{}>, {
|
|
66
|
-
size: AvatarSize;
|
|
67
|
-
className: string;
|
|
68
66
|
locale: Partial<TigerLocale>;
|
|
69
67
|
labels: Partial<TigerLocaleAvatarGroup>;
|
|
68
|
+
size: AvatarSize;
|
|
69
|
+
className: string;
|
|
70
70
|
max: number;
|
|
71
71
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
72
72
|
|
|
@@ -104,8 +104,8 @@ declare const BackTop: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
104
104
|
}>, {
|
|
105
105
|
className: string;
|
|
106
106
|
style: Record<string, unknown>;
|
|
107
|
-
position: BackTopPosition;
|
|
108
107
|
target: () => HTMLElement | Window | null;
|
|
108
|
+
position: BackTopPosition;
|
|
109
109
|
offset: ViewportOffset;
|
|
110
110
|
placement: ViewportPlacement;
|
|
111
111
|
duration: number;
|