@expcat/tigercat-vue 1.2.37 → 1.2.41
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-MD7S2A55.js → chunk-5TJI4HOT.js} +2 -2
- package/dist/{chunk-FKCZSBM6.js → chunk-7IVLFDZI.js} +17 -3
- package/dist/{chunk-W54LFA7A.mjs → chunk-CHDKJDZQ.mjs} +306 -94
- package/dist/{chunk-2HT6YGRY.js → chunk-EWQJGR7E.js} +185 -18
- package/dist/{chunk-U2PPTMQX.mjs → chunk-FI2EIJIF.mjs} +1 -1
- package/dist/{chunk-HSMN5FWL.js → chunk-GD2WAN62.js} +2 -2
- package/dist/{chunk-ILTIUESE.mjs → chunk-GFQDHFAX.mjs} +178 -11
- package/dist/{chunk-3EVCDIZE.js → chunk-KGDRA475.js} +2 -2
- package/dist/{chunk-WT3LV7OQ.mjs → chunk-KJ6VISRW.mjs} +1 -1
- package/dist/{chunk-6DYGPOYH.js → chunk-LUAI6VXV.js} +2 -2
- package/dist/{chunk-UJZPEXF5.mjs → chunk-M4EP4OVR.mjs} +19 -4
- package/dist/{chunk-RRI3F52B.js → chunk-OFTAQ2A4.js} +305 -93
- package/dist/{chunk-PC2FNA4J.mjs → chunk-PT4Q7C2A.mjs} +1 -1
- package/dist/{chunk-S3KTGULC.js → chunk-QOMWROWE.js} +22 -7
- package/dist/{chunk-FATIMV7O.mjs → chunk-ROMVD7LS.mjs} +1 -1
- package/dist/{chunk-NYH6GSP7.mjs → chunk-VKW2O36D.mjs} +17 -3
- package/dist/components/ActivityFeed.d.mts +6 -6
- package/dist/components/ActivityFeed.d.ts +6 -6
- package/dist/components/Alert.d.mts +3 -3
- package/dist/components/Alert.d.ts +3 -3
- package/dist/components/Anchor.d.mts +1 -1
- package/dist/components/Anchor.d.ts +1 -1
- package/dist/components/AreaChart.d.mts +2 -2
- package/dist/components/AreaChart.d.ts +2 -2
- package/dist/components/AutoComplete.d.mts +2 -2
- package/dist/components/AutoComplete.d.ts +2 -2
- package/dist/components/Avatar.d.mts +1 -1
- package/dist/components/Avatar.d.ts +1 -1
- package/dist/components/Badge.d.mts +3 -3
- package/dist/components/Badge.d.ts +3 -3
- package/dist/components/BarChart.d.mts +1 -1
- package/dist/components/BarChart.d.ts +1 -1
- package/dist/components/Breadcrumb.d.mts +2 -2
- package/dist/components/Breadcrumb.d.ts +2 -2
- package/dist/components/Button.d.mts +3 -3
- package/dist/components/Button.d.ts +3 -3
- package/dist/components/ButtonGroup.d.mts +1 -1
- package/dist/components/ButtonGroup.d.ts +1 -1
- package/dist/components/Calendar.d.mts +1 -1
- package/dist/components/Calendar.d.ts +1 -1
- package/dist/components/Card.d.mts +2 -2
- package/dist/components/Card.d.ts +2 -2
- package/dist/components/ChartGrid.d.mts +1 -1
- package/dist/components/ChartGrid.d.ts +1 -1
- package/dist/components/ChatWindow.d.mts +3 -3
- package/dist/components/ChatWindow.d.ts +3 -3
- package/dist/components/ChatWindow.js +3 -3
- package/dist/components/ChatWindow.mjs +2 -2
- package/dist/components/CodeEditor.d.mts +2 -2
- package/dist/components/CodeEditor.d.ts +2 -2
- package/dist/components/Collapse.d.mts +1 -1
- package/dist/components/Collapse.d.ts +1 -1
- package/dist/components/CollapsePanel.d.mts +1 -1
- package/dist/components/CollapsePanel.d.ts +1 -1
- package/dist/components/ColorSwatch.d.mts +1 -1
- package/dist/components/ColorSwatch.d.ts +1 -1
- package/dist/components/CommentThread.d.mts +2 -2
- package/dist/components/CommentThread.d.ts +2 -2
- package/dist/components/ConfigProvider.d.mts +1 -1
- package/dist/components/ConfigProvider.d.ts +1 -1
- package/dist/components/DataTableWithToolbar.d.mts +55 -11
- package/dist/components/DataTableWithToolbar.d.ts +55 -11
- package/dist/components/DataTableWithToolbar.js +11 -3
- package/dist/components/DataTableWithToolbar.mjs +10 -2
- package/dist/components/DatePicker.d.mts +2 -2
- package/dist/components/DatePicker.d.ts +2 -2
- package/dist/components/Descriptions.d.mts +2 -2
- package/dist/components/Descriptions.d.ts +2 -2
- package/dist/components/DonutChart.d.mts +2 -2
- package/dist/components/DonutChart.d.ts +2 -2
- package/dist/components/Drawer.d.mts +5 -5
- package/dist/components/Drawer.d.ts +5 -5
- package/dist/components/Dropdown.d.mts +19 -0
- package/dist/components/Dropdown.d.ts +19 -0
- package/dist/components/Dropdown.js +2 -2
- package/dist/components/Dropdown.mjs +1 -1
- package/dist/components/DropdownItem.js +3 -3
- package/dist/components/DropdownItem.mjs +2 -2
- package/dist/components/DropdownMenu.js +3 -3
- package/dist/components/DropdownMenu.mjs +1 -1
- package/dist/components/Empty.d.mts +1 -1
- package/dist/components/Empty.d.ts +1 -1
- package/dist/components/FileManager.d.mts +1 -1
- package/dist/components/FileManager.d.ts +1 -1
- package/dist/components/FloatButton.d.mts +3 -3
- package/dist/components/FloatButton.d.ts +3 -3
- package/dist/components/Form.d.mts +1 -1
- package/dist/components/Form.d.ts +1 -1
- package/dist/components/FormWizard.d.mts +6 -6
- package/dist/components/FormWizard.d.ts +6 -6
- package/dist/components/FunnelChart.d.mts +1 -1
- package/dist/components/FunnelChart.d.ts +1 -1
- package/dist/components/Gantt.d.mts +1 -1
- package/dist/components/Gantt.d.ts +1 -1
- package/dist/components/GaugeChart.d.mts +1 -1
- package/dist/components/GaugeChart.d.ts +1 -1
- package/dist/components/HeatmapChart.d.mts +2 -2
- package/dist/components/HeatmapChart.d.ts +2 -2
- package/dist/components/Image.d.mts +2 -2
- package/dist/components/Image.d.ts +2 -2
- package/dist/components/ImageAnnotation.d.mts +4 -4
- package/dist/components/ImageAnnotation.d.ts +4 -4
- package/dist/components/InfiniteScroll.d.mts +2 -2
- package/dist/components/InfiniteScroll.d.ts +2 -2
- package/dist/components/Input.d.mts +4 -4
- package/dist/components/Input.d.ts +4 -4
- package/dist/components/InputGroup.d.mts +1 -1
- package/dist/components/InputGroup.d.ts +1 -1
- package/dist/components/InputNumber.d.mts +1 -1
- package/dist/components/InputNumber.d.ts +1 -1
- package/dist/components/Kanban.d.mts +1 -1
- package/dist/components/Kanban.d.ts +1 -1
- package/dist/components/LineChart.d.mts +2 -2
- package/dist/components/LineChart.d.ts +2 -2
- package/dist/components/Link.d.mts +1 -1
- package/dist/components/Link.d.ts +1 -1
- package/dist/components/List.d.mts +6 -6
- package/dist/components/List.d.ts +6 -6
- package/dist/components/Loading.d.mts +5 -5
- package/dist/components/Loading.d.ts +5 -5
- package/dist/components/MarkdownEditor.d.mts +2 -2
- package/dist/components/MarkdownEditor.d.ts +2 -2
- package/dist/components/Mentions.d.mts +2 -2
- package/dist/components/Mentions.d.ts +2 -2
- package/dist/components/Menu.d.mts +5 -5
- package/dist/components/Menu.d.ts +5 -5
- package/dist/components/Modal.d.mts +8 -8
- package/dist/components/Modal.d.ts +8 -8
- package/dist/components/NotificationCenter.d.mts +5 -5
- package/dist/components/NotificationCenter.d.ts +5 -5
- package/dist/components/NumberKeyboard.d.mts +2 -2
- package/dist/components/NumberKeyboard.d.ts +2 -2
- package/dist/components/OrgChart.d.mts +1 -1
- package/dist/components/OrgChart.d.ts +1 -1
- package/dist/components/Pagination.d.mts +5 -5
- package/dist/components/Pagination.d.ts +5 -5
- package/dist/components/PieChart.d.mts +2 -2
- package/dist/components/PieChart.d.ts +2 -2
- package/dist/components/Popconfirm.d.mts +3 -3
- package/dist/components/Popconfirm.d.ts +3 -3
- package/dist/components/Popconfirm.js +3 -3
- package/dist/components/Popconfirm.mjs +2 -2
- package/dist/components/Popover.d.mts +1 -1
- package/dist/components/Popover.d.ts +1 -1
- package/dist/components/Popover.js +3 -3
- package/dist/components/Popover.mjs +2 -2
- package/dist/components/Progress.d.mts +3 -3
- package/dist/components/Progress.d.ts +3 -3
- package/dist/components/QRCode.d.mts +1 -1
- package/dist/components/QRCode.d.ts +1 -1
- package/dist/components/RadarChart.d.mts +2 -2
- package/dist/components/RadarChart.d.ts +2 -2
- package/dist/components/RichTextEditor.d.mts +1 -1
- package/dist/components/RichTextEditor.d.ts +1 -1
- package/dist/components/Row.d.mts +1 -1
- package/dist/components/Row.d.ts +1 -1
- package/dist/components/ScatterChart.d.mts +1 -1
- package/dist/components/ScatterChart.d.ts +1 -1
- package/dist/components/ScrollSpy.d.mts +2 -2
- package/dist/components/ScrollSpy.d.ts +2 -2
- package/dist/components/Select.d.mts +1 -1
- package/dist/components/Select.d.ts +1 -1
- package/dist/components/Signature.d.mts +2 -2
- package/dist/components/Signature.d.ts +2 -2
- package/dist/components/Skeleton.d.mts +1 -1
- package/dist/components/Skeleton.d.ts +1 -1
- package/dist/components/Space.d.mts +2 -2
- package/dist/components/Space.d.ts +2 -2
- package/dist/components/Splitter.d.mts +1 -1
- package/dist/components/Splitter.d.ts +1 -1
- package/dist/components/Spotlight.d.mts +4 -4
- package/dist/components/Spotlight.d.ts +4 -4
- package/dist/components/Steps.d.mts +3 -3
- package/dist/components/Steps.d.ts +3 -3
- package/dist/components/SunburstChart.d.mts +1 -1
- package/dist/components/SunburstChart.d.ts +1 -1
- package/dist/components/Table.d.mts +56 -8
- package/dist/components/Table.d.ts +56 -8
- package/dist/components/Table.js +8 -2
- package/dist/components/Table.mjs +7 -1
- package/dist/components/Tabs.d.mts +2 -2
- package/dist/components/Tabs.d.ts +2 -2
- 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/Text.d.mts +3 -3
- package/dist/components/Text.d.ts +3 -3
- package/dist/components/Textarea.d.mts +1 -1
- package/dist/components/Textarea.d.ts +1 -1
- package/dist/components/TimePicker.d.mts +3 -3
- package/dist/components/TimePicker.d.ts +3 -3
- package/dist/components/Timeline.d.mts +3 -3
- package/dist/components/Timeline.d.ts +3 -3
- package/dist/components/Tooltip.d.mts +1 -1
- package/dist/components/Tooltip.d.ts +1 -1
- package/dist/components/Tooltip.js +3 -3
- package/dist/components/Tooltip.mjs +2 -2
- package/dist/components/Tour.d.mts +2 -2
- package/dist/components/Tour.d.ts +2 -2
- package/dist/components/Tree.d.mts +2 -2
- package/dist/components/Tree.d.ts +2 -2
- package/dist/components/TreeMapChart.d.mts +1 -1
- package/dist/components/TreeMapChart.d.ts +1 -1
- package/dist/components/Upload.d.mts +4 -4
- package/dist/components/Upload.d.ts +4 -4
- package/dist/components/VirtualTable.d.mts +2 -2
- package/dist/components/VirtualTable.d.ts +2 -2
- package/dist/components/Watermark.d.mts +1 -1
- package/dist/components/Watermark.d.ts +1 -1
- package/dist/index.js +20 -20
- package/dist/index.mjs +20 -20
- package/package.json +2 -2
- package/dist/{chunk-S45NWVQS.mjs → chunk-6GPX4ONB.mjs} +3 -3
- package/dist/{chunk-VES3OJOP.js → chunk-YS6FW775.js} +2 -2
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkOFTAQ2A4js = require('./chunk-OFTAQ2A4.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkBGMAWKWVjs = require('./chunk-BGMAWKWV.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
var _chunkLUAI6VXVjs = require('./chunk-LUAI6VXV.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunk25EYT2CBjs = require('./chunk-25EYT2CB.js');
|
|
13
|
+
|
|
14
|
+
|
|
9
15
|
var _chunkBYNMOQBBjs = require('./chunk-BYNMOQBB.js');
|
|
10
16
|
|
|
11
17
|
|
|
18
|
+
var _chunk2YFXJUBTjs = require('./chunk-2YFXJUBT.js');
|
|
19
|
+
|
|
20
|
+
|
|
12
21
|
var _chunk4VLNT2EDjs = require('./chunk-4VLNT2ED.js');
|
|
13
22
|
|
|
14
23
|
// src/components/DataTableWithToolbar.ts
|
|
@@ -24,6 +33,11 @@ var _vue = require('vue');
|
|
|
24
33
|
|
|
25
34
|
|
|
26
35
|
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
27
41
|
var _tigercatcore = require('@expcat/tigercat-core');
|
|
28
42
|
var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
29
43
|
name: "TigerDataTableWithToolbar",
|
|
@@ -41,6 +55,14 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
41
55
|
type: Array,
|
|
42
56
|
default: () => []
|
|
43
57
|
},
|
|
58
|
+
hiddenColumnKeys: {
|
|
59
|
+
type: Array,
|
|
60
|
+
default: void 0
|
|
61
|
+
},
|
|
62
|
+
defaultHiddenColumnKeys: {
|
|
63
|
+
type: Array,
|
|
64
|
+
default: void 0
|
|
65
|
+
},
|
|
44
66
|
sort: {
|
|
45
67
|
type: Object,
|
|
46
68
|
default: void 0
|
|
@@ -77,9 +99,17 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
77
99
|
type: Boolean,
|
|
78
100
|
default: false
|
|
79
101
|
},
|
|
102
|
+
locale: {
|
|
103
|
+
type: [Object, Function],
|
|
104
|
+
default: void 0
|
|
105
|
+
},
|
|
106
|
+
labels: {
|
|
107
|
+
type: Object,
|
|
108
|
+
default: void 0
|
|
109
|
+
},
|
|
80
110
|
emptyText: {
|
|
81
111
|
type: String,
|
|
82
|
-
default:
|
|
112
|
+
default: void 0
|
|
83
113
|
},
|
|
84
114
|
rowSelection: {
|
|
85
115
|
type: Object,
|
|
@@ -137,16 +167,51 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
137
167
|
"bulk-action": (_action, _keys) => true,
|
|
138
168
|
"selection-change": (_keys) => true,
|
|
139
169
|
"page-change": (_current, _pageSize) => true,
|
|
140
|
-
"page-size-change": (_current, _pageSize) => true
|
|
170
|
+
"page-size-change": (_current, _pageSize) => true,
|
|
171
|
+
"update:hiddenColumnKeys": (_hiddenKeys) => true,
|
|
172
|
+
"hidden-columns-change": (_hiddenKeys) => true
|
|
141
173
|
},
|
|
142
174
|
setup(props, { attrs, emit }) {
|
|
175
|
+
const config = _chunk25EYT2CBjs.useTigerConfig.call(void 0, );
|
|
143
176
|
const internalSearch = _vue.ref.call(void 0, _nullishCoalesce(_optionalChain([props, 'access', _ => _.toolbar, 'optionalAccess', _2 => _2.defaultSearchValue]), () => ( "")));
|
|
177
|
+
const internalHiddenKeys = _vue.ref.call(void 0,
|
|
178
|
+
_nullishCoalesce(_nullishCoalesce(props.defaultHiddenColumnKeys, () => ( props.hiddenColumnKeys)), () => ( []))
|
|
179
|
+
);
|
|
144
180
|
const internalFilters = _vue.ref.call(void 0, {});
|
|
145
181
|
const previousPageSize = _vue.ref.call(void 0,
|
|
146
182
|
props.pagination && typeof props.pagination === "object" ? _nullishCoalesce(_nullishCoalesce(props.pagination.pageSize, () => ( props.pagination.defaultPageSize)), () => ( 10)) : void 0
|
|
147
183
|
);
|
|
148
184
|
const vnodeProps = _nullishCoalesce(_optionalChain([_vue.getCurrentInstance.call(void 0, ), 'optionalAccess', _3 => _3.vnode, 'access', _4 => _4.props]), () => ( {}));
|
|
149
185
|
const hasSearchListener = Boolean(vnodeProps.onSearch || vnodeProps.onSearchChange);
|
|
186
|
+
const resolvedTableLocale = _vue.ref.call(void 0, );
|
|
187
|
+
let tableLocaleResolveId = 0;
|
|
188
|
+
_vue.watch.call(void 0,
|
|
189
|
+
() => props.locale,
|
|
190
|
+
(locale) => {
|
|
191
|
+
const resolveId = ++tableLocaleResolveId;
|
|
192
|
+
if (!locale) {
|
|
193
|
+
resolvedTableLocale.value = void 0;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const immediateLocale = _tigercatcore.getImmediateTigerLocale.call(void 0, locale);
|
|
197
|
+
resolvedTableLocale.value = immediateLocale;
|
|
198
|
+
if (!_tigercatcore.isLazyTigerLocale.call(void 0, locale)) return;
|
|
199
|
+
_tigercatcore.resolveTigerLocale.call(void 0, locale).then((nextLocale) => {
|
|
200
|
+
if (resolveId === tableLocaleResolveId) {
|
|
201
|
+
resolvedTableLocale.value = nextLocale;
|
|
202
|
+
}
|
|
203
|
+
}).catch(() => {
|
|
204
|
+
if (resolveId === tableLocaleResolveId) {
|
|
205
|
+
resolvedTableLocale.value = immediateLocale;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
{ immediate: true }
|
|
210
|
+
);
|
|
211
|
+
const tableLocale = _vue.computed.call(void 0,
|
|
212
|
+
() => _tigercatcore.mergeTigerLocale.call(void 0, config.value.locale, resolvedTableLocale.value)
|
|
213
|
+
);
|
|
214
|
+
const tableLabels = _vue.computed.call(void 0, () => _tigercatcore.getTableLabels.call(void 0, tableLocale.value, props.labels));
|
|
150
215
|
_vue.watch.call(void 0,
|
|
151
216
|
() => _optionalChain([props, 'access', _5 => _5.toolbar, 'optionalAccess', _6 => _6.searchValue]),
|
|
152
217
|
(nextValue) => {
|
|
@@ -163,6 +228,14 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
163
228
|
}
|
|
164
229
|
}
|
|
165
230
|
);
|
|
231
|
+
_vue.watch.call(void 0,
|
|
232
|
+
() => props.hiddenColumnKeys,
|
|
233
|
+
(nextValue) => {
|
|
234
|
+
if (nextValue !== void 0) {
|
|
235
|
+
internalHiddenKeys.value = nextValue;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
);
|
|
166
239
|
_vue.watch.call(void 0,
|
|
167
240
|
() => _optionalChain([props, 'access', _7 => _7.toolbar, 'optionalAccess', _8 => _8.filters]),
|
|
168
241
|
(filters) => {
|
|
@@ -195,14 +268,29 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
195
268
|
});
|
|
196
269
|
const hasFilters = _vue.computed.call(void 0, () => Boolean(_optionalChain([props, 'access', _15 => _15.toolbar, 'optionalAccess', _16 => _16.filters, 'optionalAccess', _17 => _17.length])));
|
|
197
270
|
const hasBulkActions = _vue.computed.call(void 0, () => Boolean(_optionalChain([props, 'access', _18 => _18.toolbar, 'optionalAccess', _19 => _19.bulkActions, 'optionalAccess', _20 => _20.length])));
|
|
271
|
+
const hasColumnSettings = _vue.computed.call(void 0, () => Boolean(_optionalChain([props, 'access', _21 => _21.toolbar, 'optionalAccess', _22 => _22.showColumnSettings])));
|
|
272
|
+
const resolvedHiddenKeys = _vue.computed.call(void 0, () => _nullishCoalesce(props.hiddenColumnKeys, () => ( internalHiddenKeys.value)));
|
|
273
|
+
const handleHiddenColumnsChange = (nextHiddenKeys) => {
|
|
274
|
+
if (props.hiddenColumnKeys === void 0) {
|
|
275
|
+
internalHiddenKeys.value = nextHiddenKeys;
|
|
276
|
+
}
|
|
277
|
+
emit("update:hiddenColumnKeys", nextHiddenKeys);
|
|
278
|
+
emit("hidden-columns-change", nextHiddenKeys);
|
|
279
|
+
};
|
|
280
|
+
const handleToggleColumnVisibility = (columnKey, visible) => {
|
|
281
|
+
const nextHiddenKeys = visible ? resolvedHiddenKeys.value.filter((key) => key !== columnKey) : [...resolvedHiddenKeys.value, columnKey];
|
|
282
|
+
handleHiddenColumnsChange(nextHiddenKeys);
|
|
283
|
+
};
|
|
198
284
|
const canSearch = _vue.computed.call(void 0, () => Boolean(vnodeProps.onSearch));
|
|
199
285
|
const selectedKeys = _vue.computed.call(void 0,
|
|
200
|
-
() => _nullishCoalesce(_nullishCoalesce(_optionalChain([props, 'access',
|
|
286
|
+
() => _nullishCoalesce(_nullishCoalesce(_optionalChain([props, 'access', _23 => _23.toolbar, 'optionalAccess', _24 => _24.selectedKeys]), () => ( _optionalChain([props, 'access', _25 => _25.rowSelection, 'optionalAccess', _26 => _26.selectedRowKeys]))), () => ( []))
|
|
201
287
|
);
|
|
202
288
|
const selectedCount = _vue.computed.call(void 0,
|
|
203
|
-
() => _optionalChain([props, 'access',
|
|
289
|
+
() => _optionalChain([props, 'access', _27 => _27.toolbar, 'optionalAccess', _28 => _28.selectedCount]) !== void 0 ? props.toolbar.selectedCount : selectedKeys.value.length
|
|
290
|
+
);
|
|
291
|
+
const bulkLabel = _vue.computed.call(void 0,
|
|
292
|
+
() => _nullishCoalesce(_optionalChain([props, 'access', _29 => _29.toolbar, 'optionalAccess', _30 => _30.bulkActionsLabel]), () => ( tableLabels.value.selectedText))
|
|
204
293
|
);
|
|
205
|
-
const bulkLabel = _vue.computed.call(void 0, () => _nullishCoalesce(_optionalChain([props, 'access', _27 => _27.toolbar, 'optionalAccess', _28 => _28.bulkActionsLabel]), () => ( "\u5DF2\u9009\u62E9")));
|
|
206
294
|
const wrapperClasses = _vue.computed.call(void 0,
|
|
207
295
|
() => _tigercatcore.classNames.call(void 0,
|
|
208
296
|
"tiger-data-table-with-toolbar flex flex-col",
|
|
@@ -213,7 +301,7 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
213
301
|
);
|
|
214
302
|
const wrapperStyle = _vue.computed.call(void 0, () => _tigercatcore.mergeStyleValues.call(void 0, attrs.style, props.style));
|
|
215
303
|
const handleSearchChange = (value) => {
|
|
216
|
-
if (_optionalChain([props, 'access',
|
|
304
|
+
if (_optionalChain([props, 'access', _31 => _31.toolbar, 'optionalAccess', _32 => _32.searchValue]) === void 0) {
|
|
217
305
|
internalSearch.value = value;
|
|
218
306
|
}
|
|
219
307
|
emit("search-change", value);
|
|
@@ -236,7 +324,7 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
236
324
|
};
|
|
237
325
|
const handleBulkAction = (action) => {
|
|
238
326
|
const keys = _nullishCoalesce(selectedKeys.value, () => ( []));
|
|
239
|
-
_optionalChain([action, 'access',
|
|
327
|
+
_optionalChain([action, 'access', _33 => _33.onClick, 'optionalCall', _34 => _34(keys)]);
|
|
240
328
|
emit("bulk-action", action, keys);
|
|
241
329
|
};
|
|
242
330
|
const handleTablePageChange = ({
|
|
@@ -249,11 +337,78 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
249
337
|
}
|
|
250
338
|
previousPageSize.value = pageSize;
|
|
251
339
|
};
|
|
340
|
+
const renderColumnSettings = () => {
|
|
341
|
+
const lockedKeys = new Set(_nullishCoalesce(_optionalChain([props, 'access', _35 => _35.toolbar, 'optionalAccess', _36 => _36.columnSettings, 'optionalAccess', _37 => _37.lockedColumnKeys]), () => ( [])));
|
|
342
|
+
const panelTitle = _nullishCoalesce(_optionalChain([props, 'access', _38 => _38.toolbar, 'optionalAccess', _39 => _39.columnSettings, 'optionalAccess', _40 => _40.title]), () => ( tableLabels.value.columnSettingsText));
|
|
343
|
+
return _vue.h.call(void 0,
|
|
344
|
+
_chunkLUAI6VXVjs.Popover,
|
|
345
|
+
{
|
|
346
|
+
trigger: "click",
|
|
347
|
+
placement: "bottom-end"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
default: () => _vue.h.call(void 0,
|
|
351
|
+
_chunk4VLNT2EDjs.Button,
|
|
352
|
+
{
|
|
353
|
+
size: "sm",
|
|
354
|
+
variant: "outline",
|
|
355
|
+
class: "shrink-0 px-2",
|
|
356
|
+
"aria-label": tableLabels.value.columnSettingsAriaLabel
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
default: () => _vue.h.call(void 0,
|
|
360
|
+
"svg",
|
|
361
|
+
{
|
|
362
|
+
class: "w-3.5 h-3.5",
|
|
363
|
+
fill: "none",
|
|
364
|
+
stroke: "currentColor",
|
|
365
|
+
"stroke-width": "2",
|
|
366
|
+
viewBox: "0 0 24 24",
|
|
367
|
+
"aria-hidden": "true"
|
|
368
|
+
},
|
|
369
|
+
[
|
|
370
|
+
_vue.h.call(void 0, "path", {
|
|
371
|
+
"stroke-linecap": "round",
|
|
372
|
+
"stroke-linejoin": "round",
|
|
373
|
+
d: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
|
|
374
|
+
}),
|
|
375
|
+
_vue.h.call(void 0, "path", {
|
|
376
|
+
"stroke-linecap": "round",
|
|
377
|
+
"stroke-linejoin": "round",
|
|
378
|
+
d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z"
|
|
379
|
+
})
|
|
380
|
+
]
|
|
381
|
+
)
|
|
382
|
+
}
|
|
383
|
+
),
|
|
384
|
+
title: () => panelTitle,
|
|
385
|
+
content: () => _vue.h.call(void 0,
|
|
386
|
+
"div",
|
|
387
|
+
{ class: "flex flex-col gap-2 min-w-[160px]" },
|
|
388
|
+
props.columns.map((column) => {
|
|
389
|
+
const locked = lockedKeys.has(column.key) || column.hideable === false;
|
|
390
|
+
return _vue.h.call(void 0,
|
|
391
|
+
_chunk2YFXJUBTjs.Checkbox,
|
|
392
|
+
{
|
|
393
|
+
key: column.key,
|
|
394
|
+
size: "sm",
|
|
395
|
+
modelValue: !resolvedHiddenKeys.value.includes(column.key),
|
|
396
|
+
disabled: locked,
|
|
397
|
+
"onUpdate:modelValue": (checked) => handleToggleColumnVisibility(column.key, checked)
|
|
398
|
+
},
|
|
399
|
+
{ default: () => column.title }
|
|
400
|
+
);
|
|
401
|
+
})
|
|
402
|
+
)
|
|
403
|
+
}
|
|
404
|
+
);
|
|
405
|
+
};
|
|
252
406
|
const renderToolbar = () => {
|
|
253
|
-
if (!hasSearch.value && !hasFilters.value && !hasBulkActions.value
|
|
407
|
+
if (!hasSearch.value && !hasFilters.value && !hasBulkActions.value && !hasColumnSettings.value)
|
|
408
|
+
return null;
|
|
254
409
|
const leftNodes = [];
|
|
255
410
|
if (hasSearch.value) {
|
|
256
|
-
const showButton = _nullishCoalesce(_optionalChain([props, 'access',
|
|
411
|
+
const showButton = _nullishCoalesce(_optionalChain([props, 'access', _41 => _41.toolbar, 'optionalAccess', _42 => _42.showSearchButton]), () => ( true));
|
|
257
412
|
leftNodes.push(
|
|
258
413
|
_vue.h.call(void 0,
|
|
259
414
|
"div",
|
|
@@ -265,7 +420,7 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
265
420
|
type: "search",
|
|
266
421
|
size: "sm",
|
|
267
422
|
modelValue: searchValue.value,
|
|
268
|
-
placeholder: _nullishCoalesce(_optionalChain([props, 'access',
|
|
423
|
+
placeholder: _nullishCoalesce(_optionalChain([props, 'access', _43 => _43.toolbar, 'optionalAccess', _44 => _44.searchPlaceholder]), () => ( tableLabels.value.searchPlaceholder)),
|
|
269
424
|
"onUpdate:modelValue": (value) => handleSearchChange(String(_nullishCoalesce(value, () => ( "")))),
|
|
270
425
|
onKeydown: (event) => {
|
|
271
426
|
if (event.key === "Enter") {
|
|
@@ -303,14 +458,16 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
303
458
|
onClick: handleSearchSubmit,
|
|
304
459
|
disabled: !canSearch.value
|
|
305
460
|
},
|
|
306
|
-
{
|
|
461
|
+
{
|
|
462
|
+
default: () => _nullishCoalesce(_optionalChain([props, 'access', _45 => _45.toolbar, 'optionalAccess', _46 => _46.searchButtonText]), () => ( tableLabels.value.searchButtonText))
|
|
463
|
+
}
|
|
307
464
|
) : null
|
|
308
465
|
]
|
|
309
466
|
)
|
|
310
467
|
);
|
|
311
468
|
}
|
|
312
469
|
if (hasFilters.value) {
|
|
313
|
-
_optionalChain([props, 'access',
|
|
470
|
+
_optionalChain([props, 'access', _47 => _47.toolbar, 'optionalAccess', _48 => _48.filters, 'optionalAccess', _49 => _49.forEach, 'call', _50 => _50((filter) => {
|
|
314
471
|
const currentValue = resolvedFilters.value[filter.key];
|
|
315
472
|
const clearable = filter.clearable !== false;
|
|
316
473
|
leftNodes.push(
|
|
@@ -345,13 +502,17 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
345
502
|
_vue.h.call(void 0, "span", {
|
|
346
503
|
class: "w-1.5 h-1.5 rounded-full bg-[var(--tiger-primary,#2563eb)] animate-pulse"
|
|
347
504
|
}),
|
|
348
|
-
_vue.h.call(void 0,
|
|
505
|
+
_vue.h.call(void 0,
|
|
506
|
+
"span",
|
|
507
|
+
null,
|
|
508
|
+
`${bulkLabel.value} ${selectedCount.value} ${tableLabels.value.selectedItemsText}`
|
|
509
|
+
)
|
|
349
510
|
]
|
|
350
511
|
)
|
|
351
512
|
);
|
|
352
513
|
}
|
|
353
514
|
;
|
|
354
|
-
(_nullishCoalesce(_optionalChain([props, 'access',
|
|
515
|
+
(_nullishCoalesce(_optionalChain([props, 'access', _51 => _51.toolbar, 'optionalAccess', _52 => _52.bulkActions]), () => ( []))).forEach((action) => {
|
|
355
516
|
bulkChildren.push(
|
|
356
517
|
_vue.h.call(void 0,
|
|
357
518
|
_chunk4VLNT2EDjs.Button,
|
|
@@ -375,7 +536,7 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
375
536
|
props.bordered ? "bg-[var(--tiger-surface-muted,#f9fafb)] dark:bg-gray-800/10 px-4 py-3.5 border-b border-[var(--tiger-border,#e5e7eb)]" : "bg-[var(--tiger-surface-muted,#f9fafb)]/80 dark:bg-gray-800/30 px-4 py-3.5 border border-[var(--tiger-border,#e5e7eb)] rounded-[var(--tiger-radius-md,0.5rem)] shadow-sm"
|
|
376
537
|
),
|
|
377
538
|
role: "toolbar",
|
|
378
|
-
"aria-label":
|
|
539
|
+
"aria-label": tableLabels.value.toolbarAriaLabel
|
|
379
540
|
},
|
|
380
541
|
[
|
|
381
542
|
_vue.h.call(void 0, "div", { class: "flex items-center gap-3 flex-wrap flex-1 min-w-0" }, leftNodes),
|
|
@@ -383,7 +544,10 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
383
544
|
"div",
|
|
384
545
|
{ class: "flex items-center gap-2.5 flex-wrap ml-auto shrink-0" },
|
|
385
546
|
bulkChildren
|
|
386
|
-
) : null
|
|
547
|
+
) : null,
|
|
548
|
+
hasColumnSettings.value ? _vue.h.call(void 0, "div", { class: _tigercatcore.classNames.call(void 0, "shrink-0", !hasBulkActions.value && "ml-auto") }, [
|
|
549
|
+
renderColumnSettings()
|
|
550
|
+
]) : null
|
|
387
551
|
]
|
|
388
552
|
);
|
|
389
553
|
};
|
|
@@ -394,6 +558,7 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
394
558
|
columns: props.columns,
|
|
395
559
|
columnLockable: props.columnLockable,
|
|
396
560
|
dataSource: props.dataSource,
|
|
561
|
+
hiddenColumnKeys: resolvedHiddenKeys.value,
|
|
397
562
|
...props.sort !== void 0 ? { sort: props.sort } : {},
|
|
398
563
|
...props.defaultSort !== void 0 ? { defaultSort: props.defaultSort } : {},
|
|
399
564
|
...props.filters !== void 0 ? { filters: props.filters } : {},
|
|
@@ -403,6 +568,8 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
403
568
|
striped: props.striped,
|
|
404
569
|
hoverable: props.hoverable,
|
|
405
570
|
loading: props.loading,
|
|
571
|
+
locale: props.locale,
|
|
572
|
+
labels: props.labels,
|
|
406
573
|
emptyText: props.emptyText,
|
|
407
574
|
pagination: props.pagination,
|
|
408
575
|
rowSelection: props.rowSelection,
|
|
@@ -424,7 +591,7 @@ var DataTableWithToolbar = _vue.defineComponent.call(void 0, {
|
|
|
424
591
|
style: wrapperStyle.value,
|
|
425
592
|
"data-tiger-data-table-with-toolbar": ""
|
|
426
593
|
},
|
|
427
|
-
[renderToolbar(), _vue.h.call(void 0,
|
|
594
|
+
[renderToolbar(), _vue.h.call(void 0, _chunkOFTAQ2A4js.Table, tableProps)]
|
|
428
595
|
);
|
|
429
596
|
};
|
|
430
597
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkQOMWROWEjs = require('./chunk-QOMWROWE.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkEQW6IUHGjs = require('./chunk-EQW6IUHG.js');
|
|
@@ -93,7 +93,7 @@ var Popconfirm = _vue.defineComponent.call(void 0, {
|
|
|
93
93
|
floatingRef,
|
|
94
94
|
floatingStyles,
|
|
95
95
|
actualPlacement
|
|
96
|
-
} =
|
|
96
|
+
} = _chunkQOMWROWEjs.useFloatingPopup.call(void 0, { props, emit, multiTrigger: false });
|
|
97
97
|
const popconfirmId = createPopconfirmId();
|
|
98
98
|
const titleId = `${popconfirmId}-title`;
|
|
99
99
|
const descriptionId = `${popconfirmId}-description`;
|