@nuxt/ui 3.1.3 → 3.3.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/.nuxt/ui/avatar.ts +1 -1
- package/.nuxt/ui/button.ts +42 -42
- package/.nuxt/ui/card.ts +1 -1
- package/.nuxt/ui/carousel.ts +1 -1
- package/.nuxt/ui/command-palette.ts +3 -1
- package/.nuxt/ui/drawer.ts +1 -1
- package/.nuxt/ui/file-upload.ts +290 -0
- package/.nuxt/ui/index.ts +3 -0
- package/.nuxt/ui/input-menu.ts +24 -10
- package/.nuxt/ui/input-tags.ts +310 -0
- package/.nuxt/ui/kbd.ts +167 -3
- package/.nuxt/ui/modal.ts +1 -1
- package/.nuxt/ui/navigation-menu.ts +1 -1
- package/.nuxt/ui/select-menu.ts +11 -6
- package/.nuxt/ui/select.ts +11 -6
- package/.nuxt/ui/table.ts +11 -2
- package/.nuxt/ui/tabs.ts +4 -2
- package/.nuxt/ui/timeline.ts +321 -0
- package/.nuxt/ui/toast.ts +8 -15
- package/.nuxt/ui/toaster.ts +1 -1
- package/.nuxt/ui/tooltip.ts +1 -1
- package/cli/templates.mjs +11 -7
- package/dist/module.d.mts +15 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -3
- package/dist/runtime/components/Accordion.vue.d.ts +1 -1
- package/dist/runtime/components/Alert.vue +0 -1
- package/dist/runtime/components/Alert.vue.d.ts +2 -2
- package/dist/runtime/components/App.vue.d.ts +1 -1
- package/dist/runtime/components/Avatar.vue +10 -2
- package/dist/runtime/components/Avatar.vue.d.ts +3 -1
- package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Badge.vue.d.ts +1 -1
- package/dist/runtime/components/Breadcrumb.vue.d.ts +1 -1
- package/dist/runtime/components/Button.vue +6 -6
- package/dist/runtime/components/Button.vue.d.ts +1 -5
- package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Calendar.vue +4 -1
- package/dist/runtime/components/Calendar.vue.d.ts +1 -1
- package/dist/runtime/components/Card.vue.d.ts +1 -1
- package/dist/runtime/components/Carousel.vue +19 -16
- package/dist/runtime/components/Carousel.vue.d.ts +1 -1
- package/dist/runtime/components/Checkbox.vue +1 -1
- package/dist/runtime/components/Checkbox.vue.d.ts +1 -1
- package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
- package/dist/runtime/components/Chip.vue.d.ts +2 -2
- package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
- package/dist/runtime/components/ColorPicker.vue +1 -2
- package/dist/runtime/components/ColorPicker.vue.d.ts +1 -1
- package/dist/runtime/components/CommandPalette.vue +84 -16
- package/dist/runtime/components/CommandPalette.vue.d.ts +38 -9
- package/dist/runtime/components/Container.vue.d.ts +1 -1
- package/dist/runtime/components/ContextMenu.vue.d.ts +1 -1
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +5 -21
- package/dist/runtime/components/Drawer.vue +4 -4
- package/dist/runtime/components/Drawer.vue.d.ts +6 -1
- package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +12 -25
- package/dist/runtime/components/FileUpload.vue +242 -0
- package/dist/runtime/components/FileUpload.vue.d.ts +167 -0
- package/dist/runtime/components/Form.vue +6 -6
- package/dist/runtime/components/Form.vue.d.ts +15 -13
- package/dist/runtime/components/FormField.vue +2 -2
- package/dist/runtime/components/FormField.vue.d.ts +4 -4
- package/dist/runtime/components/Icon.vue.d.ts +1 -1
- package/dist/runtime/components/Input.vue +10 -7
- package/dist/runtime/components/Input.vue.d.ts +9 -9
- package/dist/runtime/components/InputMenu.vue +17 -10
- package/dist/runtime/components/InputMenu.vue.d.ts +19 -16
- package/dist/runtime/components/InputNumber.vue +3 -2
- package/dist/runtime/components/InputNumber.vue.d.ts +5 -5
- package/dist/runtime/components/InputTags.vue +161 -0
- package/dist/runtime/components/InputTags.vue.d.ts +185 -0
- package/dist/runtime/components/Kbd.vue +2 -1
- package/dist/runtime/components/Kbd.vue.d.ts +5 -1
- package/dist/runtime/components/Link.vue +6 -5
- package/dist/runtime/components/Link.vue.d.ts +1 -3
- package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/components/Modal.vue +14 -13
- package/dist/runtime/components/Modal.vue.d.ts +16 -6
- package/dist/runtime/components/NavigationMenu.vue +19 -17
- package/dist/runtime/components/NavigationMenu.vue.d.ts +1 -1
- package/dist/runtime/components/OverlayProvider.vue +2 -2
- package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Pagination.vue +1 -1
- package/dist/runtime/components/Pagination.vue.d.ts +1 -2
- package/dist/runtime/components/PinInput.vue +4 -3
- package/dist/runtime/components/PinInput.vue.d.ts +22 -19
- package/dist/runtime/components/Popover.vue +2 -1
- package/dist/runtime/components/Popover.vue.d.ts +8 -2
- package/dist/runtime/components/Progress.vue +2 -1
- package/dist/runtime/components/Progress.vue.d.ts +2 -2
- package/dist/runtime/components/RadioGroup.vue +3 -3
- package/dist/runtime/components/RadioGroup.vue.d.ts +5 -4
- package/dist/runtime/components/Select.vue +23 -4
- package/dist/runtime/components/Select.vue.d.ts +108 -2
- package/dist/runtime/components/SelectMenu.vue +33 -11
- package/dist/runtime/components/SelectMenu.vue.d.ts +106 -2
- package/dist/runtime/components/Separator.vue.d.ts +1 -1
- package/dist/runtime/components/Skeleton.vue.d.ts +1 -1
- package/dist/runtime/components/Slideover.vue +14 -13
- package/dist/runtime/components/Slideover.vue.d.ts +16 -6
- package/dist/runtime/components/Slider.vue.d.ts +5 -5
- package/dist/runtime/components/Stepper.vue.d.ts +1 -1
- package/dist/runtime/components/Switch.vue.d.ts +1 -1
- package/dist/runtime/components/Table.vue +90 -9
- package/dist/runtime/components/Table.vue.d.ts +30 -12
- package/dist/runtime/components/Tabs.vue +24 -4
- package/dist/runtime/components/Tabs.vue.d.ts +12 -4
- package/dist/runtime/components/Textarea.vue +10 -7
- package/dist/runtime/components/Textarea.vue.d.ts +14 -12
- package/dist/runtime/components/Timeline.vue +92 -0
- package/dist/runtime/components/Timeline.vue.d.ts +70 -0
- package/dist/runtime/components/Toast.vue +16 -9
- package/dist/runtime/components/Toast.vue.d.ts +14 -13
- package/dist/runtime/components/Toaster.vue.d.ts +1 -1
- package/dist/runtime/components/Tooltip.vue +2 -1
- package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
- package/dist/runtime/components/Tree.vue +6 -4
- package/dist/runtime/components/Tree.vue.d.ts +2 -2
- package/dist/runtime/composables/defineLocale.d.ts +2 -0
- package/dist/runtime/composables/defineLocale.js +4 -0
- package/dist/runtime/composables/defineShortcuts.js +7 -5
- package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
- package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
- package/dist/runtime/composables/useFileUpload.d.ts +19 -0
- package/dist/runtime/composables/useFileUpload.js +63 -0
- package/dist/runtime/composables/useFormField.d.ts +3 -6
- package/dist/runtime/composables/useFormField.js +5 -2
- package/dist/runtime/composables/useKbd.d.ts +1 -1
- package/dist/runtime/composables/useLocale.js +2 -2
- package/dist/runtime/composables/useOverlay.d.ts +30 -2
- package/dist/runtime/composables/useOverlay.js +8 -7
- package/dist/runtime/composables/usePortal.d.ts +1 -1
- package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
- package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
- package/dist/runtime/inertia/stubs.d.ts +1 -0
- package/dist/runtime/inertia/stubs.js +4 -2
- package/dist/runtime/locale/ar.js +4 -2
- package/dist/runtime/locale/az.js +3 -1
- package/dist/runtime/locale/bg.js +3 -1
- package/dist/runtime/locale/bn.js +3 -1
- package/dist/runtime/locale/ca.js +3 -1
- package/dist/runtime/locale/ckb.js +4 -2
- package/dist/runtime/locale/cs.js +3 -1
- package/dist/runtime/locale/da.js +3 -1
- package/dist/runtime/locale/de.js +3 -1
- package/dist/runtime/locale/el.js +3 -1
- package/dist/runtime/locale/en.js +3 -1
- package/dist/runtime/locale/es.js +3 -1
- package/dist/runtime/locale/et.js +3 -1
- package/dist/runtime/locale/fa_ir.js +3 -1
- package/dist/runtime/locale/fi.js +3 -1
- package/dist/runtime/locale/fr.js +3 -1
- package/dist/runtime/locale/he.js +3 -1
- package/dist/runtime/locale/hi.js +4 -2
- package/dist/runtime/locale/hu.js +3 -1
- package/dist/runtime/locale/hy.js +3 -1
- package/dist/runtime/locale/id.js +3 -1
- package/dist/runtime/locale/index.d.ts +1 -0
- package/dist/runtime/locale/index.js +1 -0
- package/dist/runtime/locale/it.js +3 -1
- package/dist/runtime/locale/ja.js +3 -1
- package/dist/runtime/locale/kk.js +3 -1
- package/dist/runtime/locale/km.js +4 -2
- package/dist/runtime/locale/ko.js +3 -1
- package/dist/runtime/locale/ky.js +3 -1
- package/dist/runtime/locale/lb.d.ts +3 -0
- package/dist/runtime/locale/lb.js +56 -0
- package/dist/runtime/locale/lt.js +3 -1
- package/dist/runtime/locale/mn.js +3 -1
- package/dist/runtime/locale/ms.js +3 -1
- package/dist/runtime/locale/nb_no.js +3 -1
- package/dist/runtime/locale/nl.js +3 -1
- package/dist/runtime/locale/pl.js +3 -1
- package/dist/runtime/locale/pt.js +3 -1
- package/dist/runtime/locale/pt_br.js +3 -1
- package/dist/runtime/locale/ro.js +3 -1
- package/dist/runtime/locale/ru.js +3 -1
- package/dist/runtime/locale/sk.js +3 -1
- package/dist/runtime/locale/sl.js +3 -1
- package/dist/runtime/locale/sv.js +3 -1
- package/dist/runtime/locale/th.js +3 -1
- package/dist/runtime/locale/tj.js +3 -1
- package/dist/runtime/locale/tr.js +3 -1
- package/dist/runtime/locale/ug_cn.js +3 -1
- package/dist/runtime/locale/uk.js +3 -1
- package/dist/runtime/locale/ur.js +3 -1
- package/dist/runtime/locale/uz.js +3 -1
- package/dist/runtime/locale/vi.js +3 -1
- package/dist/runtime/locale/zh_cn.js +3 -1
- package/dist/runtime/locale/zh_tw.js +3 -1
- package/dist/runtime/types/form.d.ts +11 -10
- package/dist/runtime/types/index.d.ts +3 -0
- package/dist/runtime/types/index.js +3 -0
- package/dist/runtime/types/locale.d.ts +2 -0
- package/dist/runtime/types/utils.d.ts +3 -0
- package/dist/runtime/utils/index.d.ts +1 -0
- package/dist/runtime/utils/index.js +9 -0
- package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
- package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
- package/dist/runtime/vue/stubs.d.ts +1 -0
- package/dist/runtime/vue/stubs.js +3 -1
- package/dist/shared/{ui.Bix4DSU4.mjs → ui.BkSj2DmF.mjs} +560 -55
- package/dist/unplugin.d.mts +2 -0
- package/dist/unplugin.mjs +6 -3
- package/dist/vite.mjs +1 -1
- package/package.json +37 -38
|
@@ -3,7 +3,7 @@ import theme from "#build/ui/select-menu";
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script setup>
|
|
6
|
-
import { computed, toRef, toRaw } from "vue";
|
|
6
|
+
import { ref, computed, onMounted, toRef, toRaw } from "vue";
|
|
7
7
|
import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, FocusScope, useForwardPropsEmits, useFilter } from "reka-ui";
|
|
8
8
|
import { defu } from "defu";
|
|
9
9
|
import { reactivePick, createReusableTemplate } from "@vueuse/core";
|
|
@@ -43,6 +43,8 @@ const props = defineProps({
|
|
|
43
43
|
createItem: { type: [Boolean, String, Object], required: false },
|
|
44
44
|
filterFields: { type: Array, required: false },
|
|
45
45
|
ignoreFilter: { type: Boolean, required: false },
|
|
46
|
+
autofocus: { type: Boolean, required: false },
|
|
47
|
+
autofocusDelay: { type: Number, required: false, default: 0 },
|
|
46
48
|
class: { type: null, required: false },
|
|
47
49
|
ui: { type: null, required: false },
|
|
48
50
|
open: { type: Boolean, required: false },
|
|
@@ -88,12 +90,10 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.selectMenu ||
|
|
|
88
90
|
}));
|
|
89
91
|
function displayValue(value) {
|
|
90
92
|
if (props.multiple && Array.isArray(value)) {
|
|
91
|
-
|
|
93
|
+
const values = value.map((v) => displayValue(v)).filter(Boolean);
|
|
94
|
+
return values?.length ? values.join(", ") : void 0;
|
|
92
95
|
}
|
|
93
|
-
|
|
94
|
-
return value && (typeof value === "object" ? get(value, props.labelKey) : value);
|
|
95
|
-
}
|
|
96
|
-
const item = items.value.find((item2) => compare(typeof item2 === "object" ? get(item2, props.valueKey) : item2, value));
|
|
96
|
+
const item = items.value.find((item2) => compare(typeof item2 === "object" && props.valueKey ? get(item2, props.valueKey) : item2, value));
|
|
97
97
|
return item && (typeof item === "object" ? get(item, props.labelKey) : item);
|
|
98
98
|
}
|
|
99
99
|
const groups = computed(
|
|
@@ -106,13 +106,19 @@ const filteredGroups = computed(() => {
|
|
|
106
106
|
}
|
|
107
107
|
const fields = Array.isArray(props.filterFields) ? props.filterFields : [props.labelKey];
|
|
108
108
|
return groups.value.map((items2) => items2.filter((item) => {
|
|
109
|
-
if (
|
|
109
|
+
if (item === void 0 || item === null) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (typeof item !== "object") {
|
|
110
113
|
return contains(String(item), searchTerm.value);
|
|
111
114
|
}
|
|
112
115
|
if (item.type && ["label", "separator"].includes(item.type)) {
|
|
113
116
|
return true;
|
|
114
117
|
}
|
|
115
|
-
return fields.some((field) =>
|
|
118
|
+
return fields.some((field) => {
|
|
119
|
+
const value = get(item, field);
|
|
120
|
+
return value !== void 0 && value !== null && contains(String(value), searchTerm.value);
|
|
121
|
+
});
|
|
116
122
|
})).filter((group) => group.filter(
|
|
117
123
|
(item) => !isSelectItem(item) || (!item.type || !["label", "separator"].includes(item.type))
|
|
118
124
|
).length > 0);
|
|
@@ -129,6 +135,19 @@ const createItem = computed(() => {
|
|
|
129
135
|
return !filteredItems.value.length;
|
|
130
136
|
});
|
|
131
137
|
const createItemPosition = computed(() => typeof props.createItem === "object" ? props.createItem.position : "bottom");
|
|
138
|
+
const triggerRef = ref(null);
|
|
139
|
+
function autoFocus() {
|
|
140
|
+
if (props.autofocus) {
|
|
141
|
+
triggerRef.value?.$el?.focus({
|
|
142
|
+
focusVisible: true
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
onMounted(() => {
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
autoFocus();
|
|
149
|
+
}, props.autofocusDelay);
|
|
150
|
+
});
|
|
132
151
|
function onUpdate(value) {
|
|
133
152
|
if (toRaw(props.modelValue) === value) {
|
|
134
153
|
return;
|
|
@@ -173,6 +192,9 @@ function onSelect(e, item) {
|
|
|
173
192
|
function isSelectItem(item) {
|
|
174
193
|
return typeof item === "object" && item !== null;
|
|
175
194
|
}
|
|
195
|
+
defineExpose({
|
|
196
|
+
triggerRef
|
|
197
|
+
});
|
|
176
198
|
</script>
|
|
177
199
|
|
|
178
200
|
<template>
|
|
@@ -204,7 +226,7 @@ function isSelectItem(item) {
|
|
|
204
226
|
@update:open="onUpdateOpen"
|
|
205
227
|
>
|
|
206
228
|
<ComboboxAnchor as-child>
|
|
207
|
-
<ComboboxTrigger :class="ui.base({ class: [props.ui?.base, props.class] })" tabindex="0">
|
|
229
|
+
<ComboboxTrigger ref="triggerRef" :class="ui.base({ class: [props.ui?.base, props.class] })" tabindex="0">
|
|
208
230
|
<span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
|
|
209
231
|
<slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
|
|
210
232
|
<UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
|
|
@@ -214,7 +236,7 @@ function isSelectItem(item) {
|
|
|
214
236
|
|
|
215
237
|
<slot :model-value="modelValue" :open="open">
|
|
216
238
|
<template v-for="displayedModelValue in [displayValue(modelValue)]" :key="displayedModelValue">
|
|
217
|
-
<span v-if="displayedModelValue" :class="ui.value({ class: props.ui?.value })">
|
|
239
|
+
<span v-if="displayedModelValue !== void 0 && displayedModelValue !== null" :class="ui.value({ class: props.ui?.value })">
|
|
218
240
|
{{ displayedModelValue }}
|
|
219
241
|
</span>
|
|
220
242
|
<span v-else :class="ui.placeholder({ class: props.ui?.placeholder })">
|
|
@@ -237,7 +259,7 @@ function isSelectItem(item) {
|
|
|
237
259
|
<slot name="content-top" />
|
|
238
260
|
|
|
239
261
|
<ComboboxInput v-if="!!searchInput" v-model="searchTerm" :display-value="() => searchTerm" as-child>
|
|
240
|
-
<UInput autofocus autocomplete="off" v-bind="searchInputProps" :class="ui.input({ class: props.ui?.input })" />
|
|
262
|
+
<UInput autofocus autocomplete="off" :size="size" v-bind="searchInputProps" :class="ui.input({ class: props.ui?.input })" />
|
|
241
263
|
</ComboboxInput>
|
|
242
264
|
|
|
243
265
|
<ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
|
|
@@ -114,6 +114,8 @@ export interface SelectMenuProps<T extends ArrayOrNested<SelectMenuItem> = Array
|
|
|
114
114
|
* @defaultValue false
|
|
115
115
|
*/
|
|
116
116
|
ignoreFilter?: boolean;
|
|
117
|
+
autofocus?: boolean;
|
|
118
|
+
autofocusDelay?: number;
|
|
117
119
|
class?: any;
|
|
118
120
|
ui?: SelectMenu['slots'];
|
|
119
121
|
}
|
|
@@ -182,7 +184,109 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
|
|
|
182
184
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue" | "onHighlight" | "onUpdate:searchTerm" | "onCreate"> & (SelectMenuProps<T, VK, M> & {
|
|
183
185
|
searchTerm?: string;
|
|
184
186
|
}) & Partial<{}>> & import("vue").PublicProps;
|
|
185
|
-
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
187
|
+
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
188
|
+
triggerRef: import("vue").Ref<({
|
|
189
|
+
$: import("vue").ComponentInternalInstance;
|
|
190
|
+
$data: {};
|
|
191
|
+
$props: {
|
|
192
|
+
readonly disabled?: boolean | undefined;
|
|
193
|
+
readonly asChild?: boolean | undefined;
|
|
194
|
+
readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
|
|
195
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
196
|
+
$attrs: {
|
|
197
|
+
[x: string]: unknown;
|
|
198
|
+
};
|
|
199
|
+
$refs: {
|
|
200
|
+
[x: string]: unknown;
|
|
201
|
+
};
|
|
202
|
+
$slots: Readonly<{
|
|
203
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
204
|
+
}>;
|
|
205
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
206
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
207
|
+
$host: Element | null;
|
|
208
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
209
|
+
$el: any;
|
|
210
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
211
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
212
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
213
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
214
|
+
created?: (() => void) | (() => void)[];
|
|
215
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
216
|
+
mounted?: (() => void) | (() => void)[];
|
|
217
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
218
|
+
updated?: (() => void) | (() => void)[];
|
|
219
|
+
activated?: (() => void) | (() => void)[];
|
|
220
|
+
deactivated?: (() => void) | (() => void)[];
|
|
221
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
222
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
223
|
+
destroyed?: (() => void) | (() => void)[];
|
|
224
|
+
unmounted?: (() => void) | (() => void)[];
|
|
225
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
226
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
227
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
228
|
+
};
|
|
229
|
+
$forceUpdate: () => void;
|
|
230
|
+
$nextTick: typeof import("vue").nextTick;
|
|
231
|
+
$watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
232
|
+
} & Readonly<{
|
|
233
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
234
|
+
}> & Omit<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
235
|
+
$slots: {
|
|
236
|
+
default?(_: {}): any;
|
|
237
|
+
};
|
|
238
|
+
}) | null, ({
|
|
239
|
+
$: import("vue").ComponentInternalInstance;
|
|
240
|
+
$data: {};
|
|
241
|
+
$props: {
|
|
242
|
+
readonly disabled?: boolean | undefined;
|
|
243
|
+
readonly asChild?: boolean | undefined;
|
|
244
|
+
readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
|
|
245
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
246
|
+
$attrs: {
|
|
247
|
+
[x: string]: unknown;
|
|
248
|
+
};
|
|
249
|
+
$refs: {
|
|
250
|
+
[x: string]: unknown;
|
|
251
|
+
};
|
|
252
|
+
$slots: Readonly<{
|
|
253
|
+
[name: string]: import("vue").Slot<any> | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
$root: import("vue").ComponentPublicInstance | null;
|
|
256
|
+
$parent: import("vue").ComponentPublicInstance | null;
|
|
257
|
+
$host: Element | null;
|
|
258
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
259
|
+
$el: any;
|
|
260
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
261
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
262
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
263
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
264
|
+
created?: (() => void) | (() => void)[];
|
|
265
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
266
|
+
mounted?: (() => void) | (() => void)[];
|
|
267
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
268
|
+
updated?: (() => void) | (() => void)[];
|
|
269
|
+
activated?: (() => void) | (() => void)[];
|
|
270
|
+
deactivated?: (() => void) | (() => void)[];
|
|
271
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
272
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
273
|
+
destroyed?: (() => void) | (() => void)[];
|
|
274
|
+
unmounted?: (() => void) | (() => void)[];
|
|
275
|
+
renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
276
|
+
renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
|
|
277
|
+
errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
278
|
+
};
|
|
279
|
+
$forceUpdate: () => void;
|
|
280
|
+
$nextTick: typeof import("vue").nextTick;
|
|
281
|
+
$watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
|
|
282
|
+
} & Readonly<{
|
|
283
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
284
|
+
}> & Omit<Readonly<import("reka-ui").ComboboxTriggerProps> & Readonly<{}>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
285
|
+
$slots: {
|
|
286
|
+
default?(_: {}): any;
|
|
287
|
+
};
|
|
288
|
+
}) | null>;
|
|
289
|
+
}>): void;
|
|
186
290
|
attrs: any;
|
|
187
291
|
slots: SelectMenuSlots<T, VK, M, NestedItem<T>>;
|
|
188
292
|
emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
|
|
@@ -194,5 +298,5 @@ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends Get
|
|
|
194
298
|
};
|
|
195
299
|
export default _default;
|
|
196
300
|
type __VLS_PrettifyLocal<T> = {
|
|
197
|
-
[K in keyof T]: T[K];
|
|
301
|
+
[K in keyof T as K]: T[K];
|
|
198
302
|
} & {};
|
|
@@ -43,7 +43,7 @@ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
|
43
43
|
export interface SeparatorSlots {
|
|
44
44
|
default(props?: {}): any;
|
|
45
45
|
}
|
|
46
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps,
|
|
46
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
|
|
47
47
|
orientation: "horizontal" | "vertical";
|
|
48
48
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SeparatorSlots>;
|
|
49
49
|
export default _default;
|
|
@@ -6,7 +6,7 @@ export interface SkeletonProps {
|
|
|
6
6
|
as?: any;
|
|
7
7
|
class?: any;
|
|
8
8
|
}
|
|
9
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps,
|
|
9
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
10
10
|
default?: (props: {}) => any;
|
|
11
11
|
}>;
|
|
12
12
|
export default _default;
|
|
@@ -40,14 +40,14 @@ const contentEvents = computed(() => {
|
|
|
40
40
|
closeAutoFocus: (e) => e.preventDefault()
|
|
41
41
|
};
|
|
42
42
|
if (!props.dismissible) {
|
|
43
|
-
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"
|
|
43
|
+
const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown"];
|
|
44
44
|
return events.reduce((acc, curr) => {
|
|
45
45
|
acc[curr] = (e) => {
|
|
46
46
|
e.preventDefault();
|
|
47
47
|
emits("close:prevent");
|
|
48
48
|
};
|
|
49
49
|
return acc;
|
|
50
|
-
},
|
|
50
|
+
}, defaultEvents);
|
|
51
51
|
}
|
|
52
52
|
return defaultEvents;
|
|
53
53
|
});
|
|
@@ -58,7 +58,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slideover ||
|
|
|
58
58
|
</script>
|
|
59
59
|
|
|
60
60
|
<template>
|
|
61
|
-
<DialogRoot v-slot="{ open }" v-bind="rootProps">
|
|
61
|
+
<DialogRoot v-slot="{ open, close }" v-bind="rootProps">
|
|
62
62
|
<DialogTrigger v-if="!!slots.default" as-child :class="props.class">
|
|
63
63
|
<slot :open="open" />
|
|
64
64
|
</DialogTrigger>
|
|
@@ -88,9 +88,9 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slideover ||
|
|
|
88
88
|
</DialogDescription>
|
|
89
89
|
</VisuallyHidden>
|
|
90
90
|
|
|
91
|
-
<slot name="content">
|
|
92
|
-
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (close || !!slots.close)" :class="ui.header({ class: props.ui?.header })">
|
|
93
|
-
<slot name="header">
|
|
91
|
+
<slot name="content" :close="close">
|
|
92
|
+
<div v-if="!!slots.header || (title || !!slots.title) || (description || !!slots.description) || (props.close || !!slots.close)" :class="ui.header({ class: props.ui?.header })">
|
|
93
|
+
<slot name="header" :close="close">
|
|
94
94
|
<div :class="ui.wrapper({ class: props.ui?.wrapper })">
|
|
95
95
|
<DialogTitle v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
|
|
96
96
|
<slot name="title">
|
|
@@ -105,16 +105,17 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slideover ||
|
|
|
105
105
|
</DialogDescription>
|
|
106
106
|
</div>
|
|
107
107
|
|
|
108
|
-
<
|
|
109
|
-
|
|
108
|
+
<slot name="actions" />
|
|
109
|
+
|
|
110
|
+
<DialogClose v-if="props.close || !!slots.close" as-child>
|
|
111
|
+
<slot name="close" :close="close" :ui="ui">
|
|
110
112
|
<UButton
|
|
111
|
-
v-if="close"
|
|
113
|
+
v-if="props.close"
|
|
112
114
|
:icon="closeIcon || appConfig.ui.icons.close"
|
|
113
|
-
size="md"
|
|
114
115
|
color="neutral"
|
|
115
116
|
variant="ghost"
|
|
116
117
|
:aria-label="t('slideover.close')"
|
|
117
|
-
v-bind="typeof close === 'object' ? close : {}"
|
|
118
|
+
v-bind="typeof props.close === 'object' ? props.close : {}"
|
|
118
119
|
:class="ui.close({ class: props.ui?.close })"
|
|
119
120
|
/>
|
|
120
121
|
</slot>
|
|
@@ -123,11 +124,11 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slideover ||
|
|
|
123
124
|
</div>
|
|
124
125
|
|
|
125
126
|
<div :class="ui.body({ class: props.ui?.body })">
|
|
126
|
-
<slot name="body" />
|
|
127
|
+
<slot name="body" :close="close" />
|
|
127
128
|
</div>
|
|
128
129
|
|
|
129
130
|
<div v-if="!!slots.footer" :class="ui.footer({ class: props.ui?.footer })">
|
|
130
|
-
<slot name="footer" />
|
|
131
|
+
<slot name="footer" :close="close" />
|
|
131
132
|
</div>
|
|
132
133
|
</slot>
|
|
133
134
|
</DialogContent>
|
|
@@ -58,19 +58,29 @@ export interface SlideoverSlots {
|
|
|
58
58
|
default(props: {
|
|
59
59
|
open: boolean;
|
|
60
60
|
}): any;
|
|
61
|
-
content(props
|
|
62
|
-
|
|
61
|
+
content(props: {
|
|
62
|
+
close: () => void;
|
|
63
|
+
}): any;
|
|
64
|
+
header(props: {
|
|
65
|
+
close: () => void;
|
|
66
|
+
}): any;
|
|
63
67
|
title(props?: {}): any;
|
|
64
68
|
description(props?: {}): any;
|
|
69
|
+
actions(props?: {}): any;
|
|
65
70
|
close(props: {
|
|
71
|
+
close: () => void;
|
|
66
72
|
ui: {
|
|
67
73
|
[K in keyof Required<Slideover['slots']>]: (props?: Record<string, any>) => string;
|
|
68
74
|
};
|
|
69
75
|
}): any;
|
|
70
|
-
body(props
|
|
71
|
-
|
|
76
|
+
body(props: {
|
|
77
|
+
close: () => void;
|
|
78
|
+
}): any;
|
|
79
|
+
footer(props: {
|
|
80
|
+
close: () => void;
|
|
81
|
+
}): any;
|
|
72
82
|
}
|
|
73
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps,
|
|
83
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
74
84
|
"update:open": (value: boolean) => any;
|
|
75
85
|
"after:leave": () => any;
|
|
76
86
|
"after:enter": () => any;
|
|
@@ -83,9 +93,9 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverP
|
|
|
83
93
|
}>, {
|
|
84
94
|
close: boolean | Partial<ButtonProps>;
|
|
85
95
|
modal: boolean;
|
|
96
|
+
transition: boolean;
|
|
86
97
|
portal: boolean | string | HTMLElement;
|
|
87
98
|
overlay: boolean;
|
|
88
|
-
transition: boolean;
|
|
89
99
|
side: Slideover["variants"]["side"];
|
|
90
100
|
dismissible: boolean;
|
|
91
101
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SlideoverSlots>;
|
|
@@ -35,24 +35,24 @@ export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' |
|
|
|
35
35
|
ui?: Slider['slots'];
|
|
36
36
|
}
|
|
37
37
|
export interface SliderEmits<T extends number | number[] = number | number[]> {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
'update:modelValue': [payload: T];
|
|
39
|
+
'change': [payload: Event];
|
|
40
40
|
}
|
|
41
41
|
declare const _default: <T extends number | number[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
42
42
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
|
43
43
|
readonly onChange?: ((payload: Event) => any) | undefined;
|
|
44
|
-
readonly "onUpdate:modelValue"?: ((
|
|
44
|
+
readonly "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
45
45
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & (SliderProps & {
|
|
46
46
|
modelValue?: T;
|
|
47
47
|
}) & Partial<{}>> & import("vue").PublicProps;
|
|
48
48
|
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
|
|
49
49
|
attrs: any;
|
|
50
50
|
slots: {};
|
|
51
|
-
emit:
|
|
51
|
+
emit: (((evt: "change", payload: Event) => void) & ((evt: "update:modelValue", payload: T) => void)) & ((evt: "update:modelValue", value: T | undefined) => void);
|
|
52
52
|
}>) => import("vue").VNode & {
|
|
53
53
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
54
54
|
};
|
|
55
55
|
export default _default;
|
|
56
56
|
type __VLS_PrettifyLocal<T> = {
|
|
57
|
-
[K in keyof T]: T[K];
|
|
57
|
+
[K in keyof T as K]: T[K];
|
|
58
58
|
} & {};
|
|
@@ -53,7 +53,7 @@ export interface SwitchSlots {
|
|
|
53
53
|
}
|
|
54
54
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SwitchProps & {
|
|
55
55
|
modelValue?: boolean;
|
|
56
|
-
},
|
|
56
|
+
}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
57
|
change: (payload: Event) => any;
|
|
58
58
|
"update:modelValue": (value: boolean) => any;
|
|
59
59
|
}, string, import("vue").PublicProps, Readonly<SwitchProps & {
|
|
@@ -18,7 +18,7 @@ const props = defineProps({
|
|
|
18
18
|
caption: { type: String, required: false },
|
|
19
19
|
meta: { type: Object, required: false },
|
|
20
20
|
empty: { type: String, required: false },
|
|
21
|
-
sticky: { type: Boolean, required: false },
|
|
21
|
+
sticky: { type: [Boolean, String], required: false },
|
|
22
22
|
loading: { type: Boolean, required: false },
|
|
23
23
|
loadingColor: { type: null, required: false },
|
|
24
24
|
loadingAnimation: { type: null, required: false },
|
|
@@ -38,6 +38,8 @@ const props = defineProps({
|
|
|
38
38
|
paginationOptions: { type: Object, required: false },
|
|
39
39
|
facetedOptions: { type: Object, required: false },
|
|
40
40
|
onSelect: { type: Function, required: false },
|
|
41
|
+
onHover: { type: Function, required: false },
|
|
42
|
+
onContextmenu: { type: [Function, Array], required: false },
|
|
41
43
|
class: { type: null, required: false },
|
|
42
44
|
ui: { type: null, required: false },
|
|
43
45
|
state: { type: Object, required: false },
|
|
@@ -69,6 +71,20 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.table || {} }
|
|
|
69
71
|
loadingColor: props.loadingColor,
|
|
70
72
|
loadingAnimation: props.loadingAnimation
|
|
71
73
|
}));
|
|
74
|
+
const hasFooter = computed(() => {
|
|
75
|
+
function hasFooterRecursive(columns2) {
|
|
76
|
+
for (const column of columns2) {
|
|
77
|
+
if ("footer" in column) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
if ("columns" in column && hasFooterRecursive(column.columns)) {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return hasFooterRecursive(columns.value);
|
|
87
|
+
});
|
|
72
88
|
const globalFilterState = defineModel("globalFilter", { type: String, ...{ default: void 0 } });
|
|
73
89
|
const columnFiltersState = defineModel("columnFilters", { type: Array, ...{ default: [] } });
|
|
74
90
|
const columnOrderState = defineModel("columnOrder", { type: Array, ...{ default: [] } });
|
|
@@ -82,11 +98,13 @@ const sortingState = defineModel("sorting", { type: Array, ...{ default: [] } })
|
|
|
82
98
|
const groupingState = defineModel("grouping", { type: Array, ...{ default: [] } });
|
|
83
99
|
const expandedState = defineModel("expanded", { type: [Boolean, Object], ...{ default: {} } });
|
|
84
100
|
const paginationState = defineModel("pagination", { type: Object, ...{ default: {} } });
|
|
85
|
-
const tableRef = ref();
|
|
101
|
+
const tableRef = ref(null);
|
|
86
102
|
const tableApi = useVueTable({
|
|
87
103
|
...reactiveOmit(props, "as", "data", "columns", "caption", "sticky", "loading", "loadingColor", "loadingAnimation", "class", "ui"),
|
|
88
104
|
data,
|
|
89
|
-
columns
|
|
105
|
+
get columns() {
|
|
106
|
+
return columns.value;
|
|
107
|
+
},
|
|
90
108
|
meta: meta.value,
|
|
91
109
|
getCoreRowModel: getCoreRowModel(),
|
|
92
110
|
...props.globalFilterOptions || {},
|
|
@@ -162,7 +180,7 @@ const tableApi = useVueTable({
|
|
|
162
180
|
function valueUpdater(updaterOrValue, ref2) {
|
|
163
181
|
ref2.value = typeof updaterOrValue === "function" ? updaterOrValue(ref2.value) : updaterOrValue;
|
|
164
182
|
}
|
|
165
|
-
function
|
|
183
|
+
function onRowSelect(e, row) {
|
|
166
184
|
if (!props.onSelect) {
|
|
167
185
|
return;
|
|
168
186
|
}
|
|
@@ -175,6 +193,28 @@ function handleRowSelect(row, e) {
|
|
|
175
193
|
e.stopPropagation();
|
|
176
194
|
props.onSelect(row, e);
|
|
177
195
|
}
|
|
196
|
+
function onRowHover(e, row) {
|
|
197
|
+
if (!props.onHover) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
props.onHover(e, row);
|
|
201
|
+
}
|
|
202
|
+
function onRowContextmenu(e, row) {
|
|
203
|
+
if (!props.onContextmenu) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (Array.isArray(props.onContextmenu)) {
|
|
207
|
+
props.onContextmenu.forEach((fn) => fn(e, row));
|
|
208
|
+
} else {
|
|
209
|
+
props.onContextmenu(e, row);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function resolveValue(prop, arg) {
|
|
213
|
+
if (typeof prop === "function") {
|
|
214
|
+
return prop(arg);
|
|
215
|
+
}
|
|
216
|
+
return prop;
|
|
217
|
+
}
|
|
178
218
|
watch(
|
|
179
219
|
() => props.data,
|
|
180
220
|
() => {
|
|
@@ -203,11 +243,13 @@ defineExpose({
|
|
|
203
243
|
v-for="header in headerGroup.headers"
|
|
204
244
|
:key="header.id"
|
|
205
245
|
:data-pinned="header.column.getIsPinned()"
|
|
246
|
+
:scope="header.colSpan > 1 ? 'colgroup' : 'col'"
|
|
206
247
|
:colspan="header.colSpan > 1 ? header.colSpan : void 0"
|
|
248
|
+
:rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
|
|
207
249
|
:class="ui.th({
|
|
208
250
|
class: [
|
|
209
251
|
props.ui?.th,
|
|
210
|
-
|
|
252
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
211
253
|
],
|
|
212
254
|
pinned: !!header.column.getIsPinned()
|
|
213
255
|
})"
|
|
@@ -217,36 +259,47 @@ defineExpose({
|
|
|
217
259
|
</slot>
|
|
218
260
|
</th>
|
|
219
261
|
</tr>
|
|
262
|
+
|
|
263
|
+
<tr :class="ui.separator({ class: [props.ui?.separator] })" />
|
|
220
264
|
</thead>
|
|
221
265
|
|
|
222
266
|
<tbody :class="ui.tbody({ class: [props.ui?.tbody] })">
|
|
267
|
+
<slot name="body-top" />
|
|
268
|
+
|
|
223
269
|
<template v-if="tableApi.getRowModel().rows?.length">
|
|
224
270
|
<template v-for="row in tableApi.getRowModel().rows" :key="row.id">
|
|
225
271
|
<tr
|
|
226
272
|
:data-selected="row.getIsSelected()"
|
|
227
|
-
:data-selectable="!!props.onSelect"
|
|
273
|
+
:data-selectable="!!props.onSelect || !!props.onHover || !!props.onContextmenu"
|
|
228
274
|
:data-expanded="row.getIsExpanded()"
|
|
229
275
|
:role="props.onSelect ? 'button' : void 0"
|
|
230
276
|
:tabindex="props.onSelect ? 0 : void 0"
|
|
231
277
|
:class="ui.tr({
|
|
232
278
|
class: [
|
|
233
279
|
props.ui?.tr,
|
|
234
|
-
|
|
280
|
+
resolveValue(tableApi.options.meta?.class?.tr, row)
|
|
235
281
|
]
|
|
236
282
|
})"
|
|
237
|
-
|
|
283
|
+
:style="resolveValue(tableApi.options.meta?.style?.tr, row)"
|
|
284
|
+
@click="onRowSelect($event, row)"
|
|
285
|
+
@pointerenter="onRowHover($event, row)"
|
|
286
|
+
@pointerleave="onRowHover($event, null)"
|
|
287
|
+
@contextmenu="onRowContextmenu($event, row)"
|
|
238
288
|
>
|
|
239
289
|
<td
|
|
240
290
|
v-for="cell in row.getVisibleCells()"
|
|
241
291
|
:key="cell.id"
|
|
242
292
|
:data-pinned="cell.column.getIsPinned()"
|
|
293
|
+
:colspan="resolveValue(cell.column.columnDef.meta?.colspan?.td, cell)"
|
|
294
|
+
:rowspan="resolveValue(cell.column.columnDef.meta?.rowspan?.td, cell)"
|
|
243
295
|
:class="ui.td({
|
|
244
296
|
class: [
|
|
245
297
|
props.ui?.td,
|
|
246
|
-
|
|
298
|
+
resolveValue(cell.column.columnDef.meta?.class?.td, cell)
|
|
247
299
|
],
|
|
248
300
|
pinned: !!cell.column.getIsPinned()
|
|
249
301
|
})"
|
|
302
|
+
:style="resolveValue(cell.column.columnDef.meta?.style?.td, cell)"
|
|
250
303
|
>
|
|
251
304
|
<slot :name="`${cell.column.id}-cell`" v-bind="cell.getContext()">
|
|
252
305
|
<FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
|
|
@@ -274,7 +327,35 @@ defineExpose({
|
|
|
274
327
|
</slot>
|
|
275
328
|
</td>
|
|
276
329
|
</tr>
|
|
330
|
+
|
|
331
|
+
<slot name="body-bottom" />
|
|
277
332
|
</tbody>
|
|
333
|
+
|
|
334
|
+
<tfoot v-if="hasFooter" :class="ui.tfoot({ class: [props.ui?.tfoot] })">
|
|
335
|
+
<tr :class="ui.separator({ class: [props.ui?.separator] })" />
|
|
336
|
+
|
|
337
|
+
<tr v-for="footerGroup in tableApi.getFooterGroups()" :key="footerGroup.id" :class="ui.tr({ class: [props.ui?.tr] })">
|
|
338
|
+
<th
|
|
339
|
+
v-for="header in footerGroup.headers"
|
|
340
|
+
:key="header.id"
|
|
341
|
+
:data-pinned="header.column.getIsPinned()"
|
|
342
|
+
:colspan="header.colSpan > 1 ? header.colSpan : void 0"
|
|
343
|
+
:rowspan="header.rowSpan > 1 ? header.rowSpan : void 0"
|
|
344
|
+
:class="ui.th({
|
|
345
|
+
class: [
|
|
346
|
+
props.ui?.th,
|
|
347
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
348
|
+
],
|
|
349
|
+
pinned: !!header.column.getIsPinned()
|
|
350
|
+
})"
|
|
351
|
+
:style="resolveValue(header.column.columnDef.meta?.style?.th, header)"
|
|
352
|
+
>
|
|
353
|
+
<slot :name="`${header.id}-footer`" v-bind="header.getContext()">
|
|
354
|
+
<FlexRender v-if="!header.isPlaceholder" :render="header.column.columnDef.footer" :props="header.getContext()" />
|
|
355
|
+
</slot>
|
|
356
|
+
</th>
|
|
357
|
+
</tr>
|
|
358
|
+
</tfoot>
|
|
278
359
|
</table>
|
|
279
360
|
</Primitive>
|
|
280
361
|
</template>
|