@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,12 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Table
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CHDKJDZQ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Select
|
|
6
6
|
} from "./chunk-PYT5DTQQ.mjs";
|
|
7
|
+
import {
|
|
8
|
+
Popover
|
|
9
|
+
} from "./chunk-PT4Q7C2A.mjs";
|
|
10
|
+
import {
|
|
11
|
+
useTigerConfig
|
|
12
|
+
} from "./chunk-VG6E4NX6.mjs";
|
|
7
13
|
import {
|
|
8
14
|
Input
|
|
9
15
|
} from "./chunk-2WJADO6O.mjs";
|
|
16
|
+
import {
|
|
17
|
+
Checkbox
|
|
18
|
+
} from "./chunk-2BNQGU7E.mjs";
|
|
10
19
|
import {
|
|
11
20
|
Button
|
|
12
21
|
} from "./chunk-PO5GVU4Q.mjs";
|
|
@@ -23,7 +32,12 @@ import {
|
|
|
23
32
|
import {
|
|
24
33
|
classNames,
|
|
25
34
|
coerceClassValue,
|
|
26
|
-
|
|
35
|
+
getImmediateTigerLocale,
|
|
36
|
+
getTableLabels,
|
|
37
|
+
isLazyTigerLocale,
|
|
38
|
+
mergeStyleValues,
|
|
39
|
+
mergeTigerLocale,
|
|
40
|
+
resolveTigerLocale
|
|
27
41
|
} from "@expcat/tigercat-core";
|
|
28
42
|
var DataTableWithToolbar = defineComponent({
|
|
29
43
|
name: "TigerDataTableWithToolbar",
|
|
@@ -41,6 +55,14 @@ var DataTableWithToolbar = defineComponent({
|
|
|
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 = defineComponent({
|
|
|
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 = defineComponent({
|
|
|
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 = useTigerConfig();
|
|
143
176
|
const internalSearch = ref(props.toolbar?.defaultSearchValue ?? "");
|
|
177
|
+
const internalHiddenKeys = ref(
|
|
178
|
+
props.defaultHiddenColumnKeys ?? props.hiddenColumnKeys ?? []
|
|
179
|
+
);
|
|
144
180
|
const internalFilters = ref({});
|
|
145
181
|
const previousPageSize = ref(
|
|
146
182
|
props.pagination && typeof props.pagination === "object" ? props.pagination.pageSize ?? props.pagination.defaultPageSize ?? 10 : void 0
|
|
147
183
|
);
|
|
148
184
|
const vnodeProps = getCurrentInstance()?.vnode.props ?? {};
|
|
149
185
|
const hasSearchListener = Boolean(vnodeProps.onSearch || vnodeProps.onSearchChange);
|
|
186
|
+
const resolvedTableLocale = ref();
|
|
187
|
+
let tableLocaleResolveId = 0;
|
|
188
|
+
watch(
|
|
189
|
+
() => props.locale,
|
|
190
|
+
(locale) => {
|
|
191
|
+
const resolveId = ++tableLocaleResolveId;
|
|
192
|
+
if (!locale) {
|
|
193
|
+
resolvedTableLocale.value = void 0;
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const immediateLocale = getImmediateTigerLocale(locale);
|
|
197
|
+
resolvedTableLocale.value = immediateLocale;
|
|
198
|
+
if (!isLazyTigerLocale(locale)) return;
|
|
199
|
+
resolveTigerLocale(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 = computed(
|
|
212
|
+
() => mergeTigerLocale(config.value.locale, resolvedTableLocale.value)
|
|
213
|
+
);
|
|
214
|
+
const tableLabels = computed(() => getTableLabels(tableLocale.value, props.labels));
|
|
150
215
|
watch(
|
|
151
216
|
() => props.toolbar?.searchValue,
|
|
152
217
|
(nextValue) => {
|
|
@@ -163,6 +228,14 @@ var DataTableWithToolbar = defineComponent({
|
|
|
163
228
|
}
|
|
164
229
|
}
|
|
165
230
|
);
|
|
231
|
+
watch(
|
|
232
|
+
() => props.hiddenColumnKeys,
|
|
233
|
+
(nextValue) => {
|
|
234
|
+
if (nextValue !== void 0) {
|
|
235
|
+
internalHiddenKeys.value = nextValue;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
);
|
|
166
239
|
watch(
|
|
167
240
|
() => props.toolbar?.filters,
|
|
168
241
|
(filters) => {
|
|
@@ -195,6 +268,19 @@ var DataTableWithToolbar = defineComponent({
|
|
|
195
268
|
});
|
|
196
269
|
const hasFilters = computed(() => Boolean(props.toolbar?.filters?.length));
|
|
197
270
|
const hasBulkActions = computed(() => Boolean(props.toolbar?.bulkActions?.length));
|
|
271
|
+
const hasColumnSettings = computed(() => Boolean(props.toolbar?.showColumnSettings));
|
|
272
|
+
const resolvedHiddenKeys = computed(() => 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 = computed(() => Boolean(vnodeProps.onSearch));
|
|
199
285
|
const selectedKeys = computed(
|
|
200
286
|
() => props.toolbar?.selectedKeys ?? props.rowSelection?.selectedRowKeys ?? []
|
|
@@ -202,7 +288,9 @@ var DataTableWithToolbar = defineComponent({
|
|
|
202
288
|
const selectedCount = computed(
|
|
203
289
|
() => props.toolbar?.selectedCount !== void 0 ? props.toolbar.selectedCount : selectedKeys.value.length
|
|
204
290
|
);
|
|
205
|
-
const bulkLabel = computed(
|
|
291
|
+
const bulkLabel = computed(
|
|
292
|
+
() => props.toolbar?.bulkActionsLabel ?? tableLabels.value.selectedText
|
|
293
|
+
);
|
|
206
294
|
const wrapperClasses = computed(
|
|
207
295
|
() => classNames(
|
|
208
296
|
"tiger-data-table-with-toolbar flex flex-col",
|
|
@@ -249,8 +337,75 @@ var DataTableWithToolbar = defineComponent({
|
|
|
249
337
|
}
|
|
250
338
|
previousPageSize.value = pageSize;
|
|
251
339
|
};
|
|
340
|
+
const renderColumnSettings = () => {
|
|
341
|
+
const lockedKeys = new Set(props.toolbar?.columnSettings?.lockedColumnKeys ?? []);
|
|
342
|
+
const panelTitle = props.toolbar?.columnSettings?.title ?? tableLabels.value.columnSettingsText;
|
|
343
|
+
return h(
|
|
344
|
+
Popover,
|
|
345
|
+
{
|
|
346
|
+
trigger: "click",
|
|
347
|
+
placement: "bottom-end"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
default: () => h(
|
|
351
|
+
Button,
|
|
352
|
+
{
|
|
353
|
+
size: "sm",
|
|
354
|
+
variant: "outline",
|
|
355
|
+
class: "shrink-0 px-2",
|
|
356
|
+
"aria-label": tableLabels.value.columnSettingsAriaLabel
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
default: () => h(
|
|
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
|
+
h("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
|
+
h("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: () => h(
|
|
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 h(
|
|
391
|
+
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
411
|
const showButton = props.toolbar?.showSearchButton ?? true;
|
|
@@ -265,7 +420,7 @@ var DataTableWithToolbar = defineComponent({
|
|
|
265
420
|
type: "search",
|
|
266
421
|
size: "sm",
|
|
267
422
|
modelValue: searchValue.value,
|
|
268
|
-
placeholder: props.toolbar?.searchPlaceholder ??
|
|
423
|
+
placeholder: props.toolbar?.searchPlaceholder ?? tableLabels.value.searchPlaceholder,
|
|
269
424
|
"onUpdate:modelValue": (value) => handleSearchChange(String(value ?? "")),
|
|
270
425
|
onKeydown: (event) => {
|
|
271
426
|
if (event.key === "Enter") {
|
|
@@ -303,7 +458,9 @@ var DataTableWithToolbar = defineComponent({
|
|
|
303
458
|
onClick: handleSearchSubmit,
|
|
304
459
|
disabled: !canSearch.value
|
|
305
460
|
},
|
|
306
|
-
{
|
|
461
|
+
{
|
|
462
|
+
default: () => props.toolbar?.searchButtonText ?? tableLabels.value.searchButtonText
|
|
463
|
+
}
|
|
307
464
|
) : null
|
|
308
465
|
]
|
|
309
466
|
)
|
|
@@ -345,7 +502,11 @@ var DataTableWithToolbar = defineComponent({
|
|
|
345
502
|
h("span", {
|
|
346
503
|
class: "w-1.5 h-1.5 rounded-full bg-[var(--tiger-primary,#2563eb)] animate-pulse"
|
|
347
504
|
}),
|
|
348
|
-
h(
|
|
505
|
+
h(
|
|
506
|
+
"span",
|
|
507
|
+
null,
|
|
508
|
+
`${bulkLabel.value} ${selectedCount.value} ${tableLabels.value.selectedItemsText}`
|
|
509
|
+
)
|
|
349
510
|
]
|
|
350
511
|
)
|
|
351
512
|
);
|
|
@@ -375,7 +536,7 @@ var DataTableWithToolbar = defineComponent({
|
|
|
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
|
h("div", { class: "flex items-center gap-3 flex-wrap flex-1 min-w-0" }, leftNodes),
|
|
@@ -383,7 +544,10 @@ var DataTableWithToolbar = defineComponent({
|
|
|
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 ? h("div", { class: classNames("shrink-0", !hasBulkActions.value && "ml-auto") }, [
|
|
549
|
+
renderColumnSettings()
|
|
550
|
+
]) : null
|
|
387
551
|
]
|
|
388
552
|
);
|
|
389
553
|
};
|
|
@@ -394,6 +558,7 @@ var DataTableWithToolbar = defineComponent({
|
|
|
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 = defineComponent({
|
|
|
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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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');
|
|
@@ -48,7 +48,7 @@ var Tooltip = _vue.defineComponent.call(void 0, {
|
|
|
48
48
|
floatingRef,
|
|
49
49
|
floatingStyles,
|
|
50
50
|
triggerHandlers
|
|
51
|
-
} =
|
|
51
|
+
} = _chunkQOMWROWEjs.useFloatingPopup.call(void 0, { props, emit });
|
|
52
52
|
const tooltipId = createTooltipId();
|
|
53
53
|
const containerClasses = _vue.computed.call(void 0,
|
|
54
54
|
() => _tigercatcore.classNames.call(void 0, _tigercatcore.getTooltipContainerClasses.call(void 0, ), props.className, _tigercatcore.coerceClassValue.call(void 0, attrsRecord.class))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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');
|
|
@@ -54,7 +54,7 @@ var Popover = _vue.defineComponent.call(void 0, {
|
|
|
54
54
|
floatingRef,
|
|
55
55
|
floatingStyles,
|
|
56
56
|
triggerHandlers
|
|
57
|
-
} =
|
|
57
|
+
} = _chunkQOMWROWEjs.useFloatingPopup.call(void 0, { props, emit });
|
|
58
58
|
const popoverId = createPopoverId();
|
|
59
59
|
const titleId = `${popoverId}-title`;
|
|
60
60
|
const contentId = `${popoverId}-content`;
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
import { computed, ref, watch, onBeforeUnmount } from "vue";
|
|
9
9
|
import {
|
|
10
10
|
getTransformOrigin,
|
|
11
|
-
|
|
11
|
+
FLOATING_OVERLAY_Z_INDEX,
|
|
12
|
+
buildTriggerHandlerMap,
|
|
13
|
+
restoreFocus
|
|
12
14
|
} from "@expcat/tigercat-core";
|
|
13
15
|
function useFloatingPopup(options) {
|
|
14
16
|
const { props, emit, multiTrigger = true } = options;
|
|
@@ -32,6 +34,19 @@ function useFloatingPopup(options) {
|
|
|
32
34
|
const containerRef = ref(null);
|
|
33
35
|
const triggerRef = ref(null);
|
|
34
36
|
const floatingRef = ref(null);
|
|
37
|
+
const restoreTriggerFocus = () => {
|
|
38
|
+
const trigger = triggerRef.value;
|
|
39
|
+
const target = trigger?.querySelector(
|
|
40
|
+
'button,[href],input,select,textarea,[tabindex]:not([tabindex="-1"])'
|
|
41
|
+
) ?? trigger;
|
|
42
|
+
window.setTimeout(() => {
|
|
43
|
+
restoreFocus(target, { preventScroll: true });
|
|
44
|
+
}, 0);
|
|
45
|
+
};
|
|
46
|
+
const closeAndRestoreFocus = () => {
|
|
47
|
+
setVisible(false);
|
|
48
|
+
restoreTriggerFocus();
|
|
49
|
+
};
|
|
35
50
|
const {
|
|
36
51
|
x,
|
|
37
52
|
y,
|
|
@@ -59,14 +74,14 @@ function useFloatingPopup(options) {
|
|
|
59
74
|
outsideClickCleanup = useVueClickOutside({
|
|
60
75
|
enabled: currentVisible,
|
|
61
76
|
refs: [containerRef, floatingRef],
|
|
62
|
-
onOutsideClick:
|
|
77
|
+
onOutsideClick: closeAndRestoreFocus,
|
|
63
78
|
defer: true
|
|
64
79
|
});
|
|
65
80
|
}
|
|
66
81
|
if (visible && trigger !== "manual") {
|
|
67
82
|
escapeKeyCleanup = useVueEscapeKey({
|
|
68
83
|
enabled: currentVisible,
|
|
69
|
-
onEscape:
|
|
84
|
+
onEscape: closeAndRestoreFocus
|
|
70
85
|
});
|
|
71
86
|
}
|
|
72
87
|
},
|
|
@@ -81,7 +96,7 @@ function useFloatingPopup(options) {
|
|
|
81
96
|
left: `${x.value}px`,
|
|
82
97
|
top: `${y.value}px`,
|
|
83
98
|
transformOrigin: getTransformOrigin(actualPlacement.value),
|
|
84
|
-
zIndex:
|
|
99
|
+
zIndex: FLOATING_OVERLAY_Z_INDEX
|
|
85
100
|
}));
|
|
86
101
|
const handleToggle = () => {
|
|
87
102
|
if (!props.disabled) setVisible(!currentVisible.value);
|