@nuxt/ui 2.19.2 → 2.21.0
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/README.md +2 -2
- package/dist/module.d.mts +2 -0
- package/dist/module.d.ts +2 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +16 -11
- package/dist/runtime/components/data/Table.vue +88 -38
- package/dist/runtime/components/data/Table.vue.d.ts +73 -61
- package/dist/runtime/components/elements/Accordion.vue +3 -1
- package/dist/runtime/components/elements/Accordion.vue.d.ts +25 -24
- package/dist/runtime/components/elements/Alert.vue +2 -2
- package/dist/runtime/components/elements/Alert.vue.d.ts +39 -39
- package/dist/runtime/components/elements/Avatar.vue +2 -2
- package/dist/runtime/components/elements/Avatar.vue.d.ts +3 -3
- package/dist/runtime/components/elements/AvatarGroup.d.ts +11 -9
- package/dist/runtime/components/elements/AvatarGroup.js +2 -2
- package/dist/runtime/components/elements/Badge.vue +71 -4
- package/dist/runtime/components/elements/Badge.vue.d.ts +131 -4
- package/dist/runtime/components/elements/Button.vue +2 -2
- package/dist/runtime/components/elements/Button.vue.d.ts +20 -20
- package/dist/runtime/components/elements/ButtonGroup.d.ts +15 -13
- package/dist/runtime/components/elements/ButtonGroup.js +2 -2
- package/dist/runtime/components/elements/Carousel.vue +1 -2
- package/dist/runtime/components/elements/Carousel.vue.d.ts +43 -41
- package/dist/runtime/components/elements/Chip.vue.d.ts +5 -5
- package/dist/runtime/components/elements/Dropdown.vue +2 -2
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +7 -7
- package/dist/runtime/components/elements/Kbd.vue +2 -2
- package/dist/runtime/components/elements/Link.vue +15 -4
- package/dist/runtime/components/elements/Link.vue.d.ts +30 -29
- package/dist/runtime/components/elements/Meter.vue.d.ts +3 -3
- package/dist/runtime/components/elements/MeterGroup.d.ts +20 -18
- package/dist/runtime/components/elements/MeterGroup.js +1 -1
- package/dist/runtime/components/elements/Progress.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Checkbox.vue +2 -2
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Form.vue +6 -5
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Input.vue +2 -2
- package/dist/runtime/components/forms/Input.vue.d.ts +3 -3
- package/dist/runtime/components/forms/InputMenu.vue +37 -7
- package/dist/runtime/components/forms/InputMenu.vue.d.ts +13 -12
- package/dist/runtime/components/forms/Radio.vue +2 -2
- package/dist/runtime/components/forms/Radio.vue.d.ts +2 -2
- package/dist/runtime/components/forms/RadioGroup.vue +1 -1
- package/dist/runtime/components/forms/RadioGroup.vue.d.ts +4 -4
- package/dist/runtime/components/forms/Range.vue +2 -2
- package/dist/runtime/components/forms/Range.vue.d.ts +2 -2
- package/dist/runtime/components/forms/Select.vue +2 -2
- package/dist/runtime/components/forms/Select.vue.d.ts +3 -3
- package/dist/runtime/components/forms/SelectMenu.vue +48 -25
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +12 -11
- package/dist/runtime/components/forms/Textarea.vue +2 -2
- package/dist/runtime/components/forms/Textarea.vue.d.ts +3 -3
- package/dist/runtime/components/forms/Toggle.vue +2 -2
- package/dist/runtime/components/forms/Toggle.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Card.vue +2 -2
- package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Container.vue +2 -2
- package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
- package/dist/runtime/components/layout/Divider.vue +2 -2
- package/dist/runtime/components/layout/Divider.vue.d.ts +19 -19
- package/dist/runtime/components/layout/Skeleton.vue +2 -2
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/navigation/Breadcrumb.vue +2 -2
- package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +3 -3
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +26 -26
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +3 -3
- package/dist/runtime/components/navigation/HorizontalNavigation.vue +2 -2
- package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +164 -22
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +38 -38
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +2 -2
- package/dist/runtime/components/navigation/VerticalNavigation.vue +2 -2
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +186 -44
- package/dist/runtime/components/overlays/ContextMenu.vue +2 -2
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Notification.vue +8 -4
- package/dist/runtime/components/overlays/Notification.vue.d.ts +50 -41
- package/dist/runtime/components/overlays/Notifications.vue +4 -4
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +55 -46
- package/dist/runtime/components/overlays/Popover.vue.d.ts +1 -1
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +2 -2
- package/dist/runtime/types/checkbox.d.ts +3 -0
- package/dist/runtime/types/divider.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +1 -0
- package/dist/runtime/types/index.js +1 -0
- package/dist/runtime/types/link.d.ts +1 -1
- package/dist/runtime/types/utils.d.ts +1 -1
- package/dist/runtime/ui.config/data/table.d.ts +9 -8
- package/dist/runtime/ui.config/elements/accordion.d.ts +1 -1
- package/dist/runtime/ui.config/elements/alert.d.ts +5 -4
- package/dist/runtime/ui.config/elements/badge.d.ts +15 -0
- package/dist/runtime/ui.config/elements/badge.js +15 -0
- package/dist/runtime/ui.config/elements/carousel.d.ts +3 -2
- package/dist/runtime/ui.config/elements/dropdown.d.ts +2 -1
- package/dist/runtime/ui.config/forms/inputMenu.d.ts +2 -1
- package/dist/runtime/ui.config/forms/selectMenu.d.ts +1 -1
- package/dist/runtime/ui.config/layout/divider.d.ts +4 -3
- package/dist/runtime/ui.config/navigation/commandPalette.d.ts +2 -1
- package/dist/runtime/ui.config/navigation/horizontalNavigation.d.ts +5 -4
- package/dist/runtime/ui.config/navigation/pagination.d.ts +7 -6
- package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +5 -4
- package/dist/runtime/ui.config/overlays/notification.d.ts +6 -5
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +4 -3
- package/package.json +28 -25
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://ui.nuxt.com)
|
|
2
2
|
|
|
3
3
|
# Nuxt UI
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ Its goal is to provide everything related to UI when building a Nuxt app. This i
|
|
|
20
20
|
- Keyboard shortcuts
|
|
21
21
|
- Bundled icons
|
|
22
22
|
- Fully typed
|
|
23
|
-
- [Figma Kit](https://www.figma.com/community/file/
|
|
23
|
+
- [Figma Kit](https://www.figma.com/community/file/1436401057300493073)
|
|
24
24
|
|
|
25
25
|
Read more on [ui.nuxt.com](https://ui.nuxt.com)
|
|
26
26
|
|
package/dist/module.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { ConfigExtension, DefaultClassGroupIds, DefaultThemeGroupIds } from 'tailwind-merge';
|
|
2
3
|
import * as config from '../dist/runtime/ui.config/index.js';
|
|
3
4
|
import { Strategy, DeepPartial } from '../dist/runtime/types/index.js';
|
|
4
5
|
|
|
@@ -7,6 +8,7 @@ type UI = {
|
|
|
7
8
|
gray?: string;
|
|
8
9
|
colors?: string[];
|
|
9
10
|
strategy?: Strategy;
|
|
11
|
+
tailwindMerge?: ConfigExtension<DefaultClassGroupIds, DefaultThemeGroupIds>;
|
|
10
12
|
[key: string]: any;
|
|
11
13
|
} & DeepPartial<typeof config, string | number | boolean>;
|
|
12
14
|
declare module '@nuxt/schema' {
|
package/dist/module.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { ConfigExtension, DefaultClassGroupIds, DefaultThemeGroupIds } from 'tailwind-merge';
|
|
2
3
|
import * as config from '../dist/runtime/ui.config/index.js';
|
|
3
4
|
import { Strategy, DeepPartial } from '../dist/runtime/types/index.js';
|
|
4
5
|
|
|
@@ -7,6 +8,7 @@ type UI = {
|
|
|
7
8
|
gray?: string;
|
|
8
9
|
colors?: string[];
|
|
9
10
|
strategy?: Strategy;
|
|
11
|
+
tailwindMerge?: ConfigExtension<DefaultClassGroupIds, DefaultThemeGroupIds>;
|
|
10
12
|
[key: string]: any;
|
|
11
13
|
} & DeepPartial<typeof config, string | number | boolean>;
|
|
12
14
|
declare module '@nuxt/schema' {
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -14,7 +14,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
|
14
14
|
const __dirname = __cjs_path__.dirname(__filename);
|
|
15
15
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
16
16
|
const name = "@nuxt/ui";
|
|
17
|
-
const version = "2.
|
|
17
|
+
const version = "2.21.0";
|
|
18
18
|
|
|
19
19
|
function createTemplates(nuxt = useNuxt()) {
|
|
20
20
|
const template = addTemplate({
|
|
@@ -48,21 +48,26 @@ function installTailwind(moduleOptions, nuxt = useNuxt(), resolve = createResolv
|
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
50
|
const configTemplate = addTemplate({
|
|
51
|
-
filename: "nuxtui-tailwind.config.
|
|
51
|
+
filename: "nuxtui-tailwind.config.mjs",
|
|
52
52
|
write: true,
|
|
53
53
|
getContents: ({ nuxt: nuxt2 }) => `
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
import { defaultExtractor as createDefaultExtractor } from "tailwindcss/lib/lib/defaultExtractor.js";
|
|
55
|
+
import { customSafelistExtractor, generateSafelist } from ${JSON.stringify(resolve(runtimeDir, "utils", "colors"))};
|
|
56
|
+
import formsPlugin from "@tailwindcss/forms";
|
|
57
|
+
import aspectRatio from "@tailwindcss/aspect-ratio";
|
|
58
|
+
import typography from "@tailwindcss/typography";
|
|
59
|
+
import containerQueries from "@tailwindcss/container-queries";
|
|
60
|
+
import headlessUi from "@headlessui/tailwindcss";
|
|
56
61
|
|
|
57
|
-
const defaultExtractor = createDefaultExtractor({ tailwindConfig: { separator: ':' } })
|
|
62
|
+
const defaultExtractor = createDefaultExtractor({ tailwindConfig: { separator: ':' } });
|
|
58
63
|
|
|
59
|
-
|
|
64
|
+
export default {
|
|
60
65
|
plugins: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
formsPlugin({ strategy: 'class' }),
|
|
67
|
+
aspectRatio,
|
|
68
|
+
typography,
|
|
69
|
+
containerQueries,
|
|
70
|
+
headlessUi
|
|
66
71
|
],
|
|
67
72
|
content: {
|
|
68
73
|
files: [
|
|
@@ -8,28 +8,27 @@
|
|
|
8
8
|
</slot>
|
|
9
9
|
<thead :class="ui.thead">
|
|
10
10
|
<tr :class="ui.tr.base">
|
|
11
|
-
<th v-if="modelValue" scope="col" :class="ui.checkbox.padding">
|
|
12
|
-
<UCheckbox
|
|
13
|
-
:model-value="isAllRowChecked"
|
|
14
|
-
:indeterminate="indeterminate"
|
|
15
|
-
v-bind="ui.default.checkbox"
|
|
16
|
-
aria-label="Select all"
|
|
17
|
-
@change="onChange"
|
|
18
|
-
/>
|
|
19
|
-
</th>
|
|
20
|
-
|
|
21
11
|
<th v-if="expand" scope="col" :class="ui.tr.base">
|
|
22
12
|
<span class="sr-only">Expand</span>
|
|
23
13
|
</th>
|
|
24
|
-
|
|
25
14
|
<th
|
|
26
15
|
v-for="(column, index) in columns"
|
|
27
16
|
:key="index"
|
|
28
17
|
scope="col"
|
|
29
|
-
:class="[ui.th.base, ui.th.padding, ui.th.color, ui.th.font, ui.th.size, column.class]"
|
|
18
|
+
:class="[ui.th.base, ui.th.padding, ui.th.color, ui.th.font, ui.th.size, column.key === 'select' && ui.checkbox.padding, column.class]"
|
|
30
19
|
:aria-sort="getAriaSort(column)"
|
|
31
20
|
>
|
|
32
|
-
<slot
|
|
21
|
+
<slot v-if="!singleSelect && modelValue && column.key === 'select'" name="select-header" :indeterminate="indeterminate" :checked="isAllRowChecked" :change="onChange">
|
|
22
|
+
<UCheckbox
|
|
23
|
+
:model-value="isAllRowChecked"
|
|
24
|
+
:indeterminate="indeterminate"
|
|
25
|
+
v-bind="ui.default.checkbox"
|
|
26
|
+
aria-label="Select all"
|
|
27
|
+
@change="onChange"
|
|
28
|
+
/>
|
|
29
|
+
</slot>
|
|
30
|
+
|
|
31
|
+
<slot v-else :name="`${column.key}-header`" :column="column" :sort="sort" :on-sort="onSort">
|
|
33
32
|
<UButton
|
|
34
33
|
v-if="column.sortable"
|
|
35
34
|
v-bind="{ ...(ui.default.sortButton || {}), ...sortButton }"
|
|
@@ -77,16 +76,7 @@
|
|
|
77
76
|
|
|
78
77
|
<template v-else>
|
|
79
78
|
<template v-for="(row, index) in rows" :key="index">
|
|
80
|
-
<tr :class="[ui.tr.base, isSelected(row) && ui.tr.selected, isExpanded(row) && ui.tr.expanded, $attrs.onSelect && ui.tr.active, row?.class]" @click="() => onSelect(row)">
|
|
81
|
-
<td v-if="modelValue" :class="ui.checkbox.padding">
|
|
82
|
-
<UCheckbox
|
|
83
|
-
:model-value="isSelected(row)"
|
|
84
|
-
v-bind="ui.default.checkbox"
|
|
85
|
-
aria-label="Select row"
|
|
86
|
-
@change="onChangeCheckbox($event, row)"
|
|
87
|
-
@click.capture.stop="() => onSelect(row)"
|
|
88
|
-
/>
|
|
89
|
-
</td>
|
|
79
|
+
<tr :class="[ui.tr.base, isSelected(row) && ui.tr.selected, isExpanded(row) && ui.tr.expanded, $attrs.onSelect && ui.tr.active, row?.class]" @click="() => onSelect(row)" @contextmenu="(event) => onContextmenu(event, row)">
|
|
90
80
|
<td
|
|
91
81
|
v-if="expand"
|
|
92
82
|
:class="[ui.td.base, ui.td.padding, ui.td.color, ui.td.font, ui.td.size]"
|
|
@@ -102,8 +92,25 @@
|
|
|
102
92
|
@click.capture.stop="toggleOpened(row)"
|
|
103
93
|
/>
|
|
104
94
|
</td>
|
|
105
|
-
<td v-for="(column, subIndex) in columns" :key="subIndex" :class="[ui.td.base, ui.td.padding, ui.td.color, ui.td.font, ui.td.size, column?.rowClass, row[column.key]?.class]">
|
|
106
|
-
<slot
|
|
95
|
+
<td v-for="(column, subIndex) in columns" :key="subIndex" :class="[ui.td.base, ui.td.padding, ui.td.color, ui.td.font, ui.td.size, column?.rowClass, row[column.key]?.class, column.key === 'select' && ui.checkbox.padding]">
|
|
96
|
+
<slot v-if="modelValue && column.key === 'select' " name="select-data" :checked="isSelected(row)" :change="(ev: boolean) => onChangeCheckbox(ev, row)">
|
|
97
|
+
<UCheckbox
|
|
98
|
+
:model-value="isSelected(row)"
|
|
99
|
+
v-bind="ui.default.checkbox"
|
|
100
|
+
aria-label="Select row"
|
|
101
|
+
@change="onChangeCheckbox($event, row)"
|
|
102
|
+
/>
|
|
103
|
+
</slot>
|
|
104
|
+
|
|
105
|
+
<slot
|
|
106
|
+
v-else
|
|
107
|
+
:key="retriggerSlot"
|
|
108
|
+
:name="`${column.key}-data`"
|
|
109
|
+
:column="column"
|
|
110
|
+
:row="row"
|
|
111
|
+
:index="index"
|
|
112
|
+
:get-row-data="(defaultValue) => getRowData(row, column.key, defaultValue)"
|
|
113
|
+
>
|
|
107
114
|
{{ getRowData(row, column.key) }}
|
|
108
115
|
</slot>
|
|
109
116
|
</td>
|
|
@@ -125,21 +132,22 @@
|
|
|
125
132
|
</template>
|
|
126
133
|
|
|
127
134
|
<script>
|
|
128
|
-
import { computed, defineComponent, toRaw, toRef } from "vue";
|
|
135
|
+
import { computed, defineComponent, ref, toRaw, toRef, watch } from "vue";
|
|
129
136
|
import { upperFirst } from "scule";
|
|
130
137
|
import { defu } from "defu";
|
|
131
138
|
import { useVModel } from "@vueuse/core";
|
|
139
|
+
import { isEqual } from "ohash";
|
|
132
140
|
import UIcon from "../elements/Icon.vue";
|
|
133
141
|
import UButton from "../elements/Button.vue";
|
|
134
142
|
import UProgress from "../elements/Progress.vue";
|
|
135
143
|
import UCheckbox from "../forms/Checkbox.vue";
|
|
136
144
|
import { useUI } from "../../composables/useUI";
|
|
137
|
-
import {
|
|
145
|
+
import { get, mergeConfig } from "../../utils";
|
|
138
146
|
import appConfig from "#build/app.config";
|
|
139
147
|
import { table } from "#ui/ui.config";
|
|
140
148
|
const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.table, table);
|
|
141
149
|
function defaultComparator(a, z) {
|
|
142
|
-
return
|
|
150
|
+
return isEqual(a, z);
|
|
143
151
|
}
|
|
144
152
|
function defaultSort(a, b, direction) {
|
|
145
153
|
if (a === b) {
|
|
@@ -151,6 +159,12 @@ function defaultSort(a, b, direction) {
|
|
|
151
159
|
return a > b ? -1 : 1;
|
|
152
160
|
}
|
|
153
161
|
}
|
|
162
|
+
function getStringifiedSet(arr) {
|
|
163
|
+
return new Set(arr.map((item) => JSON.stringify(item)));
|
|
164
|
+
}
|
|
165
|
+
function accessor(key) {
|
|
166
|
+
return (obj) => get(obj, key);
|
|
167
|
+
}
|
|
154
168
|
export default defineComponent({
|
|
155
169
|
components: {
|
|
156
170
|
UIcon,
|
|
@@ -239,12 +253,34 @@ export default defineComponent({
|
|
|
239
253
|
multipleExpand: {
|
|
240
254
|
type: Boolean,
|
|
241
255
|
default: true
|
|
256
|
+
},
|
|
257
|
+
singleSelect: {
|
|
258
|
+
type: Boolean,
|
|
259
|
+
default: false
|
|
242
260
|
}
|
|
243
261
|
},
|
|
244
|
-
emits: ["update:modelValue", "update:sort", "update:expand"],
|
|
262
|
+
emits: ["update:modelValue", "update:sort", "update:expand", "select:all"],
|
|
245
263
|
setup(props, { emit, attrs: $attrs }) {
|
|
246
264
|
const { ui, attrs } = useUI("table", toRef(props, "ui"), config, toRef(props, "class"));
|
|
247
|
-
const columns = computed(() =>
|
|
265
|
+
const columns = computed(() => {
|
|
266
|
+
const defaultColumns = props.columns ?? Object.keys(props.rows[0]).map((key) => ({
|
|
267
|
+
key,
|
|
268
|
+
label: upperFirst(key),
|
|
269
|
+
sortable: false,
|
|
270
|
+
class: void 0,
|
|
271
|
+
sort: defaultSort
|
|
272
|
+
}));
|
|
273
|
+
const hasColumnSelect = defaultColumns.find((v) => v.key === "select");
|
|
274
|
+
if (hasColumnSelect || !props.modelValue) {
|
|
275
|
+
return defaultColumns;
|
|
276
|
+
}
|
|
277
|
+
return [{
|
|
278
|
+
key: "select",
|
|
279
|
+
sortable: false,
|
|
280
|
+
class: void 0,
|
|
281
|
+
sort: defaultSort
|
|
282
|
+
}, ...defaultColumns];
|
|
283
|
+
});
|
|
248
284
|
const sort = useVModel(props, "sort", emit, { passive: true, defaultValue: defu({}, props.sort, { column: null, direction: "asc" }) });
|
|
249
285
|
const expand = useVModel(props, "expand", emit, {
|
|
250
286
|
passive: true,
|
|
@@ -253,6 +289,7 @@ export default defineComponent({
|
|
|
253
289
|
row: null
|
|
254
290
|
})
|
|
255
291
|
});
|
|
292
|
+
const retriggerSlot = ref(null);
|
|
256
293
|
const savedSort = { column: sort.value.column, direction: null };
|
|
257
294
|
const rows = computed(() => {
|
|
258
295
|
if (!sort.value?.column || props.sortMode === "manual") {
|
|
@@ -274,7 +311,6 @@ export default defineComponent({
|
|
|
274
311
|
emit("update:modelValue", value);
|
|
275
312
|
}
|
|
276
313
|
});
|
|
277
|
-
const getStringifiedSet = (arr) => new Set(arr.map((item) => JSON.stringify(item)));
|
|
278
314
|
const totalRows = computed(() => props.rows.length);
|
|
279
315
|
const countCheckedRow = computed(() => {
|
|
280
316
|
const selectedData = getStringifiedSet(selected.value);
|
|
@@ -301,9 +337,6 @@ export default defineComponent({
|
|
|
301
337
|
}
|
|
302
338
|
return props.by(a, z);
|
|
303
339
|
}
|
|
304
|
-
function accessor(key) {
|
|
305
|
-
return (obj) => get(obj, key);
|
|
306
|
-
}
|
|
307
340
|
function isSelected(row) {
|
|
308
341
|
if (!props.modelValue) {
|
|
309
342
|
return false;
|
|
@@ -323,11 +356,21 @@ export default defineComponent({
|
|
|
323
356
|
}
|
|
324
357
|
}
|
|
325
358
|
function onSelect(row) {
|
|
359
|
+
const selection = window.getSelection();
|
|
360
|
+
if (selection && selection.toString().length > 0) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
326
363
|
if (!$attrs.onSelect) {
|
|
327
364
|
return;
|
|
328
365
|
}
|
|
329
366
|
$attrs.onSelect(row);
|
|
330
367
|
}
|
|
368
|
+
function onContextmenu(event, row) {
|
|
369
|
+
if (!$attrs.onContextmenu) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
$attrs.onContextmenu(event, row);
|
|
373
|
+
}
|
|
331
374
|
function selectAllRows() {
|
|
332
375
|
const newSelected = [...selected.value];
|
|
333
376
|
props.rows.forEach((row) => {
|
|
@@ -343,13 +386,13 @@ export default defineComponent({
|
|
|
343
386
|
} else {
|
|
344
387
|
selected.value = [];
|
|
345
388
|
}
|
|
389
|
+
emit("select:all", checked);
|
|
346
390
|
}
|
|
347
391
|
function onChangeCheckbox(checked, row) {
|
|
348
392
|
if (checked) {
|
|
349
|
-
selected.value.
|
|
393
|
+
selected.value = props.singleSelect ? [row] : [...selected.value, row];
|
|
350
394
|
} else {
|
|
351
|
-
|
|
352
|
-
selected.value.splice(index, 1);
|
|
395
|
+
selected.value = selected.value.filter((value) => !compare(toRaw(value), toRaw(row)));
|
|
353
396
|
}
|
|
354
397
|
}
|
|
355
398
|
function getRowData(row, rowKey, defaultValue = "") {
|
|
@@ -379,6 +422,11 @@ export default defineComponent({
|
|
|
379
422
|
}
|
|
380
423
|
return void 0;
|
|
381
424
|
}
|
|
425
|
+
watch(rows, () => {
|
|
426
|
+
retriggerSlot.value = /* @__PURE__ */ new Date();
|
|
427
|
+
}, {
|
|
428
|
+
deep: true
|
|
429
|
+
});
|
|
382
430
|
return {
|
|
383
431
|
// eslint-disable-next-line vue/no-dupe-keys
|
|
384
432
|
ui,
|
|
@@ -400,11 +448,13 @@ export default defineComponent({
|
|
|
400
448
|
isSelected,
|
|
401
449
|
onSort,
|
|
402
450
|
onSelect,
|
|
451
|
+
onContextmenu,
|
|
403
452
|
onChange,
|
|
404
453
|
getRowData,
|
|
405
454
|
toggleOpened,
|
|
406
455
|
getAriaSort,
|
|
407
|
-
isExpanded
|
|
456
|
+
isExpanded,
|
|
457
|
+
retriggerSlot
|
|
408
458
|
};
|
|
409
459
|
}
|
|
410
460
|
});
|
|
@@ -53,23 +53,23 @@ declare const config: {
|
|
|
53
53
|
icon: string;
|
|
54
54
|
trailing: boolean;
|
|
55
55
|
square: boolean;
|
|
56
|
-
color: "
|
|
57
|
-
variant: "
|
|
56
|
+
color: import("../../types/button").ButtonColor;
|
|
57
|
+
variant: import("../../types/button").ButtonVariant;
|
|
58
58
|
class: string;
|
|
59
59
|
};
|
|
60
60
|
expandButton: {
|
|
61
61
|
icon: string;
|
|
62
|
-
color: "
|
|
63
|
-
variant: "
|
|
64
|
-
size: "
|
|
62
|
+
color: import("../../types/button").ButtonColor;
|
|
63
|
+
variant: import("../../types/button").ButtonVariant;
|
|
64
|
+
size: import("../../types/button").ButtonSize;
|
|
65
65
|
class: string;
|
|
66
66
|
};
|
|
67
67
|
checkbox: {
|
|
68
|
-
color: "
|
|
68
|
+
color: import("../../types/checkbox").CheckboxColor;
|
|
69
69
|
};
|
|
70
70
|
progress: {
|
|
71
|
-
color:
|
|
72
|
-
animation:
|
|
71
|
+
color: ProgressColor;
|
|
72
|
+
animation: ProgressAnimation;
|
|
73
73
|
};
|
|
74
74
|
loadingState: {
|
|
75
75
|
icon: string;
|
|
@@ -142,7 +142,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
142
142
|
type: PropType<{
|
|
143
143
|
icon: string;
|
|
144
144
|
label: string;
|
|
145
|
-
}>;
|
|
145
|
+
} | null>;
|
|
146
146
|
default: () => {
|
|
147
147
|
icon: string;
|
|
148
148
|
label: string;
|
|
@@ -168,8 +168,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
168
168
|
animation: ProgressAnimation;
|
|
169
169
|
}>;
|
|
170
170
|
default: () => {
|
|
171
|
-
color:
|
|
172
|
-
animation:
|
|
171
|
+
color: ProgressColor;
|
|
172
|
+
animation: ProgressAnimation;
|
|
173
173
|
};
|
|
174
174
|
};
|
|
175
175
|
class: {
|
|
@@ -186,6 +186,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
186
186
|
type: BooleanConstructor;
|
|
187
187
|
default: boolean;
|
|
188
188
|
};
|
|
189
|
+
singleSelect: {
|
|
190
|
+
type: BooleanConstructor;
|
|
191
|
+
default: boolean;
|
|
192
|
+
};
|
|
189
193
|
}>, {
|
|
190
194
|
ui: import("vue").ComputedRef<{
|
|
191
195
|
wrapper: string;
|
|
@@ -240,23 +244,23 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
240
244
|
icon: string;
|
|
241
245
|
trailing: boolean;
|
|
242
246
|
square: boolean;
|
|
243
|
-
color: "
|
|
244
|
-
variant: "
|
|
247
|
+
color: import("../../types/button").ButtonColor;
|
|
248
|
+
variant: import("../../types/button").ButtonVariant;
|
|
245
249
|
class: string;
|
|
246
250
|
};
|
|
247
251
|
expandButton: {
|
|
248
252
|
icon: string;
|
|
249
|
-
color: "
|
|
250
|
-
variant: "
|
|
251
|
-
size: "
|
|
253
|
+
color: import("../../types/button").ButtonColor;
|
|
254
|
+
variant: import("../../types/button").ButtonVariant;
|
|
255
|
+
size: import("../../types/button").ButtonSize;
|
|
252
256
|
class: string;
|
|
253
257
|
};
|
|
254
258
|
checkbox: {
|
|
255
|
-
color: "
|
|
259
|
+
color: import("../../types/checkbox").CheckboxColor;
|
|
256
260
|
};
|
|
257
261
|
progress: {
|
|
258
|
-
color:
|
|
259
|
-
animation:
|
|
262
|
+
color: ProgressColor;
|
|
263
|
+
animation: ProgressAnimation;
|
|
260
264
|
};
|
|
261
265
|
loadingState: {
|
|
262
266
|
icon: string;
|
|
@@ -298,12 +302,14 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
298
302
|
direction?: "asc" | "desc";
|
|
299
303
|
}) => void;
|
|
300
304
|
onSelect: (row: TableRow) => void;
|
|
305
|
+
onContextmenu: (event: any, row: any) => void;
|
|
301
306
|
onChange: (checked: boolean) => void;
|
|
302
307
|
getRowData: (row: TableRow, rowKey: string | string[], defaultValue?: any) => any;
|
|
303
308
|
toggleOpened: (row: TableRow) => void;
|
|
304
309
|
getAriaSort: (column: TableColumn) => AriaAttributes["aria-sort"];
|
|
305
310
|
isExpanded: (row: TableRow) => boolean;
|
|
306
|
-
|
|
311
|
+
retriggerSlot: import("vue").Ref<any, any>;
|
|
312
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:sort" | "update:expand" | "select:all")[], "update:modelValue" | "update:sort" | "update:expand" | "select:all", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
307
313
|
modelValue: {
|
|
308
314
|
type: ArrayConstructor;
|
|
309
315
|
default: any;
|
|
@@ -363,7 +369,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
363
369
|
type: PropType<{
|
|
364
370
|
icon: string;
|
|
365
371
|
label: string;
|
|
366
|
-
}>;
|
|
372
|
+
} | null>;
|
|
367
373
|
default: () => {
|
|
368
374
|
icon: string;
|
|
369
375
|
label: string;
|
|
@@ -389,8 +395,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
389
395
|
animation: ProgressAnimation;
|
|
390
396
|
}>;
|
|
391
397
|
default: () => {
|
|
392
|
-
color:
|
|
393
|
-
animation:
|
|
398
|
+
color: ProgressColor;
|
|
399
|
+
animation: ProgressAnimation;
|
|
394
400
|
};
|
|
395
401
|
};
|
|
396
402
|
class: {
|
|
@@ -407,22 +413,21 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
407
413
|
type: BooleanConstructor;
|
|
408
414
|
default: boolean;
|
|
409
415
|
};
|
|
416
|
+
singleSelect: {
|
|
417
|
+
type: BooleanConstructor;
|
|
418
|
+
default: boolean;
|
|
419
|
+
};
|
|
410
420
|
}>> & Readonly<{
|
|
411
421
|
"onUpdate:modelValue"?: (...args: any[]) => any;
|
|
412
422
|
"onUpdate:sort"?: (...args: any[]) => any;
|
|
413
423
|
"onUpdate:expand"?: (...args: any[]) => any;
|
|
424
|
+
"onSelect:all"?: (...args: any[]) => any;
|
|
414
425
|
}>, {
|
|
415
426
|
sort: {
|
|
416
427
|
column: string;
|
|
417
428
|
direction: "asc" | "desc";
|
|
418
429
|
};
|
|
419
430
|
class: any;
|
|
420
|
-
caption: string;
|
|
421
|
-
columns: TableColumn[];
|
|
422
|
-
progress: {
|
|
423
|
-
color: ProgressColor;
|
|
424
|
-
animation: ProgressAnimation;
|
|
425
|
-
};
|
|
426
431
|
ui: {
|
|
427
432
|
wrapper?: string;
|
|
428
433
|
base?: string;
|
|
@@ -476,23 +481,23 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
476
481
|
icon: string;
|
|
477
482
|
trailing: boolean;
|
|
478
483
|
square: boolean;
|
|
479
|
-
color: "
|
|
480
|
-
variant: "
|
|
484
|
+
color: import("../../types/button").ButtonColor;
|
|
485
|
+
variant: import("../../types/button").ButtonVariant;
|
|
481
486
|
class: string;
|
|
482
487
|
};
|
|
483
488
|
expandButton: {
|
|
484
489
|
icon: string;
|
|
485
|
-
color: "
|
|
486
|
-
variant: "
|
|
487
|
-
size: "
|
|
490
|
+
color: import("../../types/button").ButtonColor;
|
|
491
|
+
variant: import("../../types/button").ButtonVariant;
|
|
492
|
+
size: import("../../types/button").ButtonSize;
|
|
488
493
|
class: string;
|
|
489
494
|
};
|
|
490
495
|
checkbox: {
|
|
491
|
-
color: "
|
|
496
|
+
color: import("../../types/checkbox").CheckboxColor;
|
|
492
497
|
};
|
|
493
498
|
progress: {
|
|
494
|
-
color:
|
|
495
|
-
animation:
|
|
499
|
+
color: ProgressColor;
|
|
500
|
+
animation: ProgressAnimation;
|
|
496
501
|
};
|
|
497
502
|
loadingState: {
|
|
498
503
|
icon: string;
|
|
@@ -508,6 +513,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
508
513
|
} & {
|
|
509
514
|
strategy?: Strategy;
|
|
510
515
|
};
|
|
516
|
+
caption: string;
|
|
517
|
+
columns: TableColumn[];
|
|
518
|
+
progress: {
|
|
519
|
+
color: ProgressColor;
|
|
520
|
+
animation: ProgressAnimation;
|
|
521
|
+
};
|
|
511
522
|
modelValue: unknown[];
|
|
512
523
|
loading: boolean;
|
|
513
524
|
loadingState: {
|
|
@@ -528,6 +539,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
528
539
|
sortDescIcon: string;
|
|
529
540
|
expandButton: Button;
|
|
530
541
|
multipleExpand: boolean;
|
|
542
|
+
singleSelect: boolean;
|
|
531
543
|
}, {}, {
|
|
532
544
|
UIcon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
533
545
|
name: {
|
|
@@ -1125,23 +1137,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1125
1137
|
class: any;
|
|
1126
1138
|
to: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
1127
1139
|
disabled: boolean;
|
|
1128
|
-
truncate: boolean;
|
|
1129
|
-
target: "_blank" | "_parent" | "_self" | "_top" | (string & {});
|
|
1130
|
-
activeClass: string;
|
|
1131
|
-
exactActiveClass: string;
|
|
1132
|
-
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
1133
|
-
replace: boolean;
|
|
1134
|
-
noRel: boolean;
|
|
1135
|
-
prefetch: boolean;
|
|
1136
|
-
noPrefetch: boolean;
|
|
1137
|
-
prefetchedClass: string;
|
|
1138
|
-
external: boolean;
|
|
1139
|
-
leading: boolean;
|
|
1140
|
-
color: import("../../types/button").ButtonColor;
|
|
1141
|
-
variant: import("../../types/button").ButtonVariant;
|
|
1142
|
-
href: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
1143
|
-
rel: any;
|
|
1144
|
-
label: string;
|
|
1145
1140
|
ui: {
|
|
1146
1141
|
base?: string;
|
|
1147
1142
|
font?: string;
|
|
@@ -1226,6 +1221,23 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1226
1221
|
} & {
|
|
1227
1222
|
strategy?: Strategy;
|
|
1228
1223
|
};
|
|
1224
|
+
color: import("../../types/button").ButtonColor;
|
|
1225
|
+
variant: import("../../types/button").ButtonVariant;
|
|
1226
|
+
truncate: boolean;
|
|
1227
|
+
target: "_blank" | "_parent" | "_self" | "_top" | (string & {});
|
|
1228
|
+
activeClass: string;
|
|
1229
|
+
exactActiveClass: string;
|
|
1230
|
+
ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
|
|
1231
|
+
replace: boolean;
|
|
1232
|
+
noRel: boolean;
|
|
1233
|
+
prefetch: boolean;
|
|
1234
|
+
noPrefetch: boolean;
|
|
1235
|
+
prefetchedClass: string;
|
|
1236
|
+
external: boolean;
|
|
1237
|
+
leading: boolean;
|
|
1238
|
+
href: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
1239
|
+
rel: any;
|
|
1240
|
+
label: string;
|
|
1229
1241
|
icon: string;
|
|
1230
1242
|
block: boolean;
|
|
1231
1243
|
square: boolean;
|
|
@@ -1303,7 +1315,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1303
1315
|
default: boolean;
|
|
1304
1316
|
};
|
|
1305
1317
|
exactQuery: {
|
|
1306
|
-
type:
|
|
1318
|
+
type: PropType<boolean | "partial">;
|
|
1307
1319
|
default: boolean;
|
|
1308
1320
|
};
|
|
1309
1321
|
exactHash: {
|
|
@@ -1406,7 +1418,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1406
1418
|
default: boolean;
|
|
1407
1419
|
};
|
|
1408
1420
|
exactQuery: {
|
|
1409
|
-
type:
|
|
1421
|
+
type: PropType<boolean | "partial">;
|
|
1410
1422
|
default: boolean;
|
|
1411
1423
|
};
|
|
1412
1424
|
exactHash: {
|
|
@@ -1499,7 +1511,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1499
1511
|
as: string;
|
|
1500
1512
|
active: boolean;
|
|
1501
1513
|
exact: boolean;
|
|
1502
|
-
exactQuery: boolean;
|
|
1514
|
+
exactQuery: boolean | "partial";
|
|
1503
1515
|
exactHash: boolean;
|
|
1504
1516
|
inactiveClass: string;
|
|
1505
1517
|
href: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
@@ -1846,11 +1858,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1846
1858
|
default: () => {};
|
|
1847
1859
|
};
|
|
1848
1860
|
}>> & Readonly<{}>, {
|
|
1849
|
-
size: "
|
|
1861
|
+
size: "sm" | "xs" | "2xs" | "md" | "lg" | "xl" | "2xl";
|
|
1850
1862
|
class: any;
|
|
1851
1863
|
max: number | any[];
|
|
1852
1864
|
animation: "carousel" | "carousel-inverse" | "swing" | "elastic";
|
|
1853
|
-
color: "primary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
|
|
1854
1865
|
ui: {
|
|
1855
1866
|
wrapper?: string;
|
|
1856
1867
|
indicator?: DeepPartial<{
|
|
@@ -1929,6 +1940,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
1929
1940
|
} & {
|
|
1930
1941
|
strategy?: Strategy;
|
|
1931
1942
|
};
|
|
1943
|
+
color: "primary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
|
|
1932
1944
|
value: number;
|
|
1933
1945
|
indicator: boolean;
|
|
1934
1946
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -2113,8 +2125,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2113
2125
|
required: boolean;
|
|
2114
2126
|
class: any;
|
|
2115
2127
|
disabled: boolean;
|
|
2116
|
-
color: "primary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
|
|
2117
|
-
label: string;
|
|
2118
2128
|
ui: {
|
|
2119
2129
|
wrapper?: string;
|
|
2120
2130
|
container?: string;
|
|
@@ -2137,6 +2147,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
2137
2147
|
} & {
|
|
2138
2148
|
strategy?: Strategy;
|
|
2139
2149
|
};
|
|
2150
|
+
color: "primary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose";
|
|
2151
|
+
label: string;
|
|
2140
2152
|
id: string;
|
|
2141
2153
|
modelValue: boolean | any[];
|
|
2142
2154
|
value: string | number | boolean | Record<string, any>;
|