nuxt-ui-tools 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/form/components/root/form.vue +1 -1
- package/dist/runtime/form/composables/use-form-validation.d.ts +2 -3
- package/dist/runtime/form/composables/use-form-validation.js +24 -112
- package/dist/runtime/form/composables/use-form.js +1 -1
- package/dist/runtime/form/fields/password/component.vue +132 -28
- package/dist/runtime/form/fields/password/types.d.ts +6 -0
- package/dist/runtime/form/fields/text/component.vue +7 -2
- package/dist/runtime/form/types/field.d.ts +1 -1
- package/dist/runtime/form/types/validation.d.ts +3 -20
- package/dist/runtime/form/utils/state.d.ts +1 -14
- package/dist/runtime/form/utils/state.js +0 -199
- package/dist/runtime/i18n/locales/en.js +1 -0
- package/dist/runtime/i18n/locales/fr.js +1 -0
- package/dist/runtime/i18n/types.d.ts +1 -0
- package/dist/runtime/table/components/data-list/data-list-content.d.vue.ts +19 -17
- package/dist/runtime/table/components/data-list/data-list-content.vue +14 -87
- package/dist/runtime/table/components/data-list/data-list-content.vue.d.ts +19 -17
- package/dist/runtime/table/components/data-list/data-list-default.d.vue.ts +1 -4
- package/dist/runtime/table/components/data-list/data-list-default.vue.d.ts +1 -4
- package/dist/runtime/table/components/data-list/data-list-error-state.d.vue.ts +13 -0
- package/dist/runtime/table/components/data-list/data-list-error-state.vue +91 -0
- package/dist/runtime/table/components/data-list/data-list-error-state.vue.d.ts +13 -0
- package/dist/runtime/table/components/data-list/data-list-layout-switch.vue +1 -1
- package/dist/runtime/table/components/data-list/data-list-refresh.vue +42 -4
- package/dist/runtime/table/components/data-list/data-list-root.d.vue.ts +1 -9
- package/dist/runtime/table/components/data-list/data-list-root.vue.d.ts +1 -9
- package/dist/runtime/table/components/data-list/data-list-sort-menu.vue +11 -5
- package/dist/runtime/table/components/data-list.d.vue.ts +2 -13
- package/dist/runtime/table/components/data-list.vue.d.ts +2 -13
- package/dist/runtime/table/components/drawers/column-panel.vue +7 -2
- package/dist/runtime/table/components/filters/panel/filter-panel-chips.vue +2 -5
- package/dist/runtime/table/components/filters/panel/option-filter-panel-field.vue +1 -1
- package/dist/runtime/table/components/filters/shared/dynamic-filter-picker.d.vue.ts +2 -2
- package/dist/runtime/table/components/filters/shared/dynamic-filter-picker.vue +103 -101
- package/dist/runtime/table/components/filters/shared/dynamic-filter-picker.vue.d.ts +2 -2
- package/dist/runtime/table/components/filters/shared/filter-option-multiple-list.vue +2 -2
- package/dist/runtime/table/components/filters/shared/filter-option-picker-content.vue +3 -3
- package/dist/runtime/table/components/filters/shared/filter-option-single-list.vue +1 -1
- package/dist/runtime/table/components/filters/shared/filter-popover-shell.d.vue.ts +3 -3
- package/dist/runtime/table/components/filters/shared/filter-popover-shell.vue +17 -15
- package/dist/runtime/table/components/filters/shared/filter-popover-shell.vue.d.ts +3 -3
- package/dist/runtime/table/components/filters/shared/filter-searchable-panel.vue +10 -2
- package/dist/runtime/table/components/filters/sheet/filter-sheet.vue +4 -3
- package/dist/runtime/table/components/filters/tags/filter-tags-bar.vue +1 -1
- package/dist/runtime/table/components/grid/grid-renderer.vue +2 -4
- package/dist/runtime/table/components/table/table-renderer.d.vue.ts +8 -2
- package/dist/runtime/table/components/table/table-renderer.vue +24 -6
- package/dist/runtime/table/components/table/table-renderer.vue.d.ts +8 -2
- package/dist/runtime/table/composables/use-option-filter-editor-state.d.ts +1 -0
- package/dist/runtime/table/composables/use-option-filter-editor-state.js +2 -2
- package/dist/runtime/table/composables/use-table-actions.js +10 -5
- package/dist/runtime/table/composables/use-table-api.js +4 -1
- package/dist/runtime/table/composables/use-table-columns.d.ts +6 -2
- package/dist/runtime/table/composables/use-table-data.d.ts +2 -1
- package/dist/runtime/table/composables/use-table-data.js +19 -2
- package/dist/runtime/table/composables/use-table-filter-options.d.ts +1 -0
- package/dist/runtime/table/composables/use-table-filter-options.js +2 -1
- package/dist/runtime/table/composables/use-table-internals.d.ts +18 -6
- package/dist/runtime/table/types/actions.d.ts +3 -2
- package/dist/runtime/table/types/data-list.d.ts +8 -0
- package/dist/runtime/table/types/source.d.ts +10 -1
- package/dist/runtime/table/utils/builders/table-source.d.ts +14 -15
- package/dist/runtime/table/utils/client-query.d.ts +1 -1
- package/dist/runtime/table/utils/columns/render.d.ts +13 -5
- package/dist/runtime/table/utils/columns/render.js +3 -2
- package/dist/runtime/table/utils/filters/editor-size.js +9 -9
- package/dist/runtime/table/utils/filters/options.js +6 -1
- package/dist/runtime/table/utils/index.d.ts +1 -0
- package/dist/runtime/table/utils/index.js +1 -0
- package/dist/runtime/table/utils/prefetch.js +5 -1
- package/dist/runtime/table/utils/source-request.d.ts +2 -0
- package/dist/runtime/table/utils/source-request.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DataListContentUi, DataListControlSize } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
minHeight?: string;
|
|
4
|
+
size?: DataListControlSize;
|
|
5
|
+
ui?: DataListContentUi;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
retry: () => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onRetry?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import UButton from "@nuxt/ui/components/Button.vue";
|
|
3
|
-
import {
|
|
3
|
+
import { usePreferredReducedMotion } from "@vueuse/core";
|
|
4
|
+
import { computed, onBeforeUnmount, ref, watch } from "vue";
|
|
4
5
|
import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
5
6
|
import { useDataListUi } from "../../composables/use-data-list-ui";
|
|
6
7
|
import { useTableInternals } from "../../composables/use-table-internals";
|
|
@@ -14,9 +15,13 @@ const props = defineProps({
|
|
|
14
15
|
const internals = useTableInternals();
|
|
15
16
|
const dataListUi = useDataListUi();
|
|
16
17
|
const { t } = useUiToolsLocale();
|
|
18
|
+
const preferredMotion = usePreferredReducedMotion();
|
|
17
19
|
const loading = computed(
|
|
18
20
|
() => internals.queryContent.status.value.isFetching || internals.queryContent.status.value.isRefreshing || internals.queryContent.status.value.isRevalidating
|
|
19
21
|
);
|
|
22
|
+
const completingSpin = ref(false);
|
|
23
|
+
const spinning = computed(() => loading.value || completingSpin.value);
|
|
24
|
+
let completionFallback;
|
|
20
25
|
const resolvedSize = computed(
|
|
21
26
|
() => props.size ?? dataListUi.ui.value.refresh?.size ?? dataListUi.controlSize.value
|
|
22
27
|
);
|
|
@@ -34,6 +39,37 @@ const buttonProps = computed(
|
|
|
34
39
|
function refresh() {
|
|
35
40
|
void internals.queryContent.refreshData()();
|
|
36
41
|
}
|
|
42
|
+
function finishSpin() {
|
|
43
|
+
completingSpin.value = false;
|
|
44
|
+
clearTimeout(completionFallback);
|
|
45
|
+
completionFallback = void 0;
|
|
46
|
+
}
|
|
47
|
+
function onSpinIteration(event) {
|
|
48
|
+
if (event.animationName === "nut-dl-refresh-spin" && !loading.value) {
|
|
49
|
+
finishSpin();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
watch(
|
|
53
|
+
loading,
|
|
54
|
+
(next, previous) => {
|
|
55
|
+
if (next) {
|
|
56
|
+
finishSpin();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!previous || preferredMotion.value === "reduce") {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
completingSpin.value = true;
|
|
63
|
+
completionFallback = setTimeout(finishSpin, 750);
|
|
64
|
+
},
|
|
65
|
+
{ flush: "sync" }
|
|
66
|
+
);
|
|
67
|
+
watch(preferredMotion, (motion) => {
|
|
68
|
+
if (motion === "reduce") {
|
|
69
|
+
finishSpin();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
onBeforeUnmount(() => clearTimeout(completionFallback));
|
|
37
73
|
</script>
|
|
38
74
|
|
|
39
75
|
<template>
|
|
@@ -48,21 +84,23 @@ function refresh() {
|
|
|
48
84
|
:square="!label"
|
|
49
85
|
:aria-label="t('table.header.refreshData')"
|
|
50
86
|
:title="t('table.header.refreshData')"
|
|
51
|
-
:
|
|
87
|
+
:aria-busy="loading"
|
|
88
|
+
:data-refreshing="spinning"
|
|
52
89
|
:ui="{
|
|
53
90
|
...resolvedUi,
|
|
54
91
|
base: mergeDataListUiClass('nut-dl-refresh', void 0, resolvedUi.base),
|
|
55
92
|
leadingIcon: mergeDataListUiClass(
|
|
56
|
-
|
|
93
|
+
spinning ? 'nut-dl-refresh__icon--spinning' : 'nut-dl-refresh__icon',
|
|
57
94
|
void 0,
|
|
58
95
|
resolvedUi.leadingIcon
|
|
59
96
|
)
|
|
60
97
|
}"
|
|
98
|
+
@animationiteration="onSpinIteration"
|
|
61
99
|
@click="refresh"
|
|
62
100
|
/>
|
|
63
101
|
</slot>
|
|
64
102
|
</template>
|
|
65
103
|
|
|
66
104
|
<style>
|
|
67
|
-
.nut-dl-refresh__icon--spinning{animation:nut-dl-refresh-spin .7s linear infinite}@keyframes nut-dl-refresh-spin{to{transform:rotate(1turn)}}
|
|
105
|
+
.nut-dl-refresh__icon--spinning{animation:nut-dl-refresh-spin .7s linear infinite}@keyframes nut-dl-refresh-spin{to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){.nut-dl-refresh__icon--spinning{animation:none}}
|
|
68
106
|
</style>
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import type { ComputedRef } from 'vue';
|
|
2
1
|
import type { UiToolsLocale, UiToolsMessages } from '#ui-tools/i18n';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DataListControlSize, DataListDensity, DataListUiConfig } from '../../types/index.js';
|
|
5
|
-
interface DataListTable {
|
|
6
|
-
schema: ComputedRef<{
|
|
7
|
-
tableKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
__internals: TableInternals;
|
|
10
|
-
}
|
|
2
|
+
import type { DataListControlSize, DataListDensity, DataListTable, DataListUiConfig } from '../../types/index.js';
|
|
11
3
|
type __VLS_Props = {
|
|
12
4
|
table: DataListTable;
|
|
13
5
|
locale?: UiToolsLocale<UiToolsMessages>;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import type { ComputedRef } from 'vue';
|
|
2
1
|
import type { UiToolsLocale, UiToolsMessages } from '#ui-tools/i18n';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DataListControlSize, DataListDensity, DataListUiConfig } from '../../types/index.js';
|
|
5
|
-
interface DataListTable {
|
|
6
|
-
schema: ComputedRef<{
|
|
7
|
-
tableKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
__internals: TableInternals;
|
|
10
|
-
}
|
|
2
|
+
import type { DataListControlSize, DataListDensity, DataListTable, DataListUiConfig } from '../../types/index.js';
|
|
11
3
|
type __VLS_Props = {
|
|
12
4
|
table: DataListTable;
|
|
13
5
|
locale?: UiToolsLocale<UiToolsMessages>;
|
|
@@ -154,15 +154,21 @@ function humanize(value) {
|
|
|
154
154
|
v-bind="triggerControlProps"
|
|
155
155
|
icon="i-lucide-arrow-down-up"
|
|
156
156
|
:ui="{
|
|
157
|
-
base: mergeDataListUiClass(
|
|
158
|
-
|
|
157
|
+
base: mergeDataListUiClass(
|
|
158
|
+
'nut-dl-sortbtn min-w-0 max-w-full',
|
|
159
|
+
void 0,
|
|
160
|
+
resolvedUi.trigger
|
|
161
|
+
),
|
|
162
|
+
label: mergeDataListUiClass('min-w-0', void 0, resolvedUi.triggerLabel),
|
|
159
163
|
leadingIcon: resolvedUi.triggerLeadingIcon,
|
|
160
164
|
trailingIcon: resolvedUi.triggerTrailingIcon
|
|
161
165
|
}"
|
|
162
166
|
>
|
|
163
|
-
<span class="nut-dl-sortbtn__label flex items-center gap-1.5">
|
|
164
|
-
<span>{{ label ?? t("table.controls.sort") }}</span>
|
|
165
|
-
<span v-if="activeLabel" class="font-semibold text-highlighted">{{
|
|
167
|
+
<span class="nut-dl-sortbtn__label flex min-w-0 items-center gap-1.5">
|
|
168
|
+
<span class="shrink-0">{{ label ?? t("table.controls.sort") }}</span>
|
|
169
|
+
<span v-if="activeLabel" class="min-w-0 truncate font-semibold text-highlighted">{{
|
|
170
|
+
activeLabel
|
|
171
|
+
}}</span>
|
|
166
172
|
<UIcon
|
|
167
173
|
v-if="activeLabel"
|
|
168
174
|
:name="activeDirection === 'asc' ? 'i-lucide-arrow-up' : 'i-lucide-arrow-down'"
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import type { ComputedRef } from 'vue';
|
|
2
1
|
import type { UiToolsLocale, UiToolsMessages } from '#ui-tools/i18n';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DataListControlSize, DataListDensity, DataListUiConfig } from '../types/index.js';
|
|
5
|
-
interface DataListTable {
|
|
6
|
-
schema: ComputedRef<{
|
|
7
|
-
tableKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
__internals: TableInternals;
|
|
10
|
-
}
|
|
2
|
+
import type { DataListControlSize, DataListDensity, DataListTable, DataListUiConfig } from '../types/index.js';
|
|
11
3
|
type __VLS_Props = {
|
|
12
4
|
table: DataListTable;
|
|
13
5
|
title?: string;
|
|
@@ -27,10 +19,7 @@ declare var __VLS_15: {}, __VLS_18: {}, __VLS_21: {
|
|
|
27
19
|
layout: import("../types/index.js").TableLayout;
|
|
28
20
|
}, __VLS_33: {
|
|
29
21
|
layout: import("../types/index.js").TableLayout;
|
|
30
|
-
}, __VLS_36: {
|
|
31
|
-
error: {};
|
|
32
|
-
retry: () => void;
|
|
33
|
-
}, __VLS_39: {
|
|
22
|
+
}, __VLS_36: any, __VLS_39: {
|
|
34
23
|
loadedCount: number;
|
|
35
24
|
}, __VLS_42: {
|
|
36
25
|
error: {};
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import type { ComputedRef } from 'vue';
|
|
2
1
|
import type { UiToolsLocale, UiToolsMessages } from '#ui-tools/i18n';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DataListControlSize, DataListDensity, DataListUiConfig } from '../types/index.js';
|
|
5
|
-
interface DataListTable {
|
|
6
|
-
schema: ComputedRef<{
|
|
7
|
-
tableKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
__internals: TableInternals;
|
|
10
|
-
}
|
|
2
|
+
import type { DataListControlSize, DataListDensity, DataListTable, DataListUiConfig } from '../types/index.js';
|
|
11
3
|
type __VLS_Props = {
|
|
12
4
|
table: DataListTable;
|
|
13
5
|
title?: string;
|
|
@@ -27,10 +19,7 @@ declare var __VLS_15: {}, __VLS_18: {}, __VLS_21: {
|
|
|
27
19
|
layout: import("../types/index.js").TableLayout;
|
|
28
20
|
}, __VLS_33: {
|
|
29
21
|
layout: import("../types/index.js").TableLayout;
|
|
30
|
-
}, __VLS_36: {
|
|
31
|
-
error: {};
|
|
32
|
-
retry: () => void;
|
|
33
|
-
}, __VLS_39: {
|
|
22
|
+
}, __VLS_36: any, __VLS_39: {
|
|
34
23
|
loadedCount: number;
|
|
35
24
|
}, __VLS_42: {
|
|
36
25
|
error: {};
|
|
@@ -9,6 +9,7 @@ import { computed } from "vue";
|
|
|
9
9
|
import { VueDraggable } from "vue-draggable-plus";
|
|
10
10
|
import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
11
11
|
import { isNumber } from "../../../shared/utils/predicate";
|
|
12
|
+
import { useDataListBreakpoint } from "../../composables/use-data-list-breakpoint";
|
|
12
13
|
import { useDataListUi } from "../../composables/use-data-list-ui";
|
|
13
14
|
import { useTableInternals } from "../../composables/use-table-internals";
|
|
14
15
|
import {
|
|
@@ -24,6 +25,7 @@ const props = defineProps({
|
|
|
24
25
|
});
|
|
25
26
|
const internals = useTableInternals();
|
|
26
27
|
const dataListUi = useDataListUi();
|
|
28
|
+
const { isMobile } = useDataListBreakpoint();
|
|
27
29
|
const { t } = useUiToolsLocale();
|
|
28
30
|
const ui = computed(() => ({
|
|
29
31
|
...dataListUi.ui.value.columnPanel?.ui,
|
|
@@ -41,15 +43,16 @@ const triggerProps = computed(
|
|
|
41
43
|
{
|
|
42
44
|
color: "neutral",
|
|
43
45
|
icon: "i-lucide-layers",
|
|
44
|
-
label: t("table.controls.view"),
|
|
46
|
+
label: isMobile.value ? void 0 : t("table.controls.view"),
|
|
45
47
|
size: resolvedSize.value,
|
|
48
|
+
square: isMobile.value,
|
|
46
49
|
variant: "outline"
|
|
47
50
|
},
|
|
48
51
|
controlProps.value.trigger
|
|
49
52
|
)
|
|
50
53
|
);
|
|
51
54
|
const countProps = computed(
|
|
52
|
-
() => controlProps.value.count === false ? null : controlProps.value.count ? mergeDataListProps(
|
|
55
|
+
() => isMobile.value || controlProps.value.count === false ? null : controlProps.value.count ? mergeDataListProps(
|
|
53
56
|
{ color: "neutral", size: resolvedSize.value, variant: "subtle" },
|
|
54
57
|
controlProps.value.count
|
|
55
58
|
) : null
|
|
@@ -159,6 +162,8 @@ function toggle() {
|
|
|
159
162
|
>
|
|
160
163
|
<UButton
|
|
161
164
|
v-bind="triggerProps"
|
|
165
|
+
:aria-label="t('table.controls.view')"
|
|
166
|
+
:title="t('table.controls.view')"
|
|
162
167
|
:ui="{ base: mergeDataListUiClass('nut-dl-colbtn', void 0, ui.trigger) }"
|
|
163
168
|
>
|
|
164
169
|
<template v-if="countProps" #trailing>
|
|
@@ -63,11 +63,8 @@ const CHIP_ACTIVE = "nut-dl-chip--active border-primary/25 bg-primary/10 text-[v
|
|
|
63
63
|
class="nut-dl-skeleton inline-block h-2.5 w-4 rounded"
|
|
64
64
|
aria-hidden="true"
|
|
65
65
|
/>
|
|
66
|
-
<small
|
|
67
|
-
|
|
68
|
-
class="nut-dl-chip__count text-[11px] text-dimmed tabular-nums"
|
|
69
|
-
>
|
|
70
|
-
{{ entry.count }}
|
|
66
|
+
<small v-else-if="showCounts" class="nut-dl-chip__count text-[11px] text-dimmed tabular-nums">
|
|
67
|
+
{{ entry.count ?? 0 }}
|
|
71
68
|
</small>
|
|
72
69
|
</button>
|
|
73
70
|
</div>
|
|
@@ -141,7 +141,7 @@ function isPrimitiveValue(value) {
|
|
|
141
141
|
:entries="chipEntries"
|
|
142
142
|
:loading="state.optionSource.isLoading.value"
|
|
143
143
|
:count-loading="state.optionSource.isCountLoading.value"
|
|
144
|
-
:show-counts="state.
|
|
144
|
+
:show-counts="state.optionSource.showCounts.value"
|
|
145
145
|
:ui="ui"
|
|
146
146
|
@toggle="state.toggleValue"
|
|
147
147
|
/>
|
|
@@ -9,7 +9,7 @@ type __VLS_Props = {
|
|
|
9
9
|
declare function open(): void;
|
|
10
10
|
declare function close(): void;
|
|
11
11
|
declare function toggle(): void;
|
|
12
|
-
declare var
|
|
12
|
+
declare var __VLS_9: {
|
|
13
13
|
open: typeof open;
|
|
14
14
|
close: typeof close;
|
|
15
15
|
toggle: typeof toggle;
|
|
@@ -22,7 +22,7 @@ declare var __VLS_10: {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
type __VLS_Slots = {} & {
|
|
25
|
-
trigger?: (props: typeof
|
|
25
|
+
trigger?: (props: typeof __VLS_9) => any;
|
|
26
26
|
};
|
|
27
27
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
28
|
select: (key: string) => any;
|
|
@@ -156,16 +156,17 @@ function toggle() {
|
|
|
156
156
|
</script>
|
|
157
157
|
|
|
158
158
|
<template>
|
|
159
|
-
<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
<div class="contents">
|
|
160
|
+
<UPopover
|
|
161
|
+
:open="isOpen"
|
|
162
|
+
mode="click"
|
|
163
|
+
:content="{
|
|
163
164
|
side: 'bottom',
|
|
164
165
|
align: 'start',
|
|
165
166
|
sideOffset: 8,
|
|
166
167
|
onFocusOutside: handleFocusOutside
|
|
167
168
|
}"
|
|
168
|
-
|
|
169
|
+
:ui="{
|
|
169
170
|
content: resolveDataListPopoverContentClass(
|
|
170
171
|
'fit',
|
|
171
172
|
mergeDataListUiClass(
|
|
@@ -175,32 +176,32 @@ function toggle() {
|
|
|
175
176
|
)
|
|
176
177
|
)
|
|
177
178
|
}"
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
179
|
+
@update:open="handleOpenChange"
|
|
180
|
+
>
|
|
181
|
+
<slot
|
|
182
|
+
v-if="$slots.trigger"
|
|
183
|
+
name="trigger"
|
|
184
|
+
:open="open"
|
|
185
|
+
:close="close"
|
|
186
|
+
:toggle="toggle"
|
|
187
|
+
:open-state="isOpen"
|
|
188
|
+
:stage="stage"
|
|
189
|
+
:definition="selectedDefinition"
|
|
190
|
+
:trigger-props="{
|
|
190
191
|
type: 'button',
|
|
191
192
|
'aria-expanded': isOpen
|
|
192
193
|
}"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
/>
|
|
195
|
+
<UButton
|
|
196
|
+
v-else
|
|
197
|
+
v-bind="triggerProps"
|
|
198
|
+
:icon="
|
|
198
199
|
selectedDefinition ? dataListUi.ui.value.filterTags?.props?.icon === false ? void 0 : resolveFilterTriggerIcon(selectedDefinition) : 'i-lucide-plus'
|
|
199
200
|
"
|
|
200
|
-
|
|
201
|
+
:label="
|
|
201
202
|
selectedDefinition ? getLabel(selectedDefinition) : triggerProps.label ?? t('table.controls.addFilter')
|
|
202
203
|
"
|
|
203
|
-
|
|
204
|
+
:ui="{
|
|
204
205
|
base: mergeDataListUiClass(
|
|
205
206
|
`nut-dl-tag nut-dl-tag--add shrink-0 ${selectedDefinition ? '' : 'border border-dashed border-[var(--ui-border-accented)] text-muted hover:text-default hover:border-[var(--ui-text-dimmed)]'}`,
|
|
206
207
|
void 0,
|
|
@@ -208,118 +209,119 @@ function toggle() {
|
|
|
208
209
|
),
|
|
209
210
|
leadingIcon: 'size-[13px]'
|
|
210
211
|
}"
|
|
211
|
-
|
|
212
|
+
/>
|
|
212
213
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
>
|
|
219
|
-
<div
|
|
220
|
-
v-if="stage === 'picker'"
|
|
221
|
-
:class="mergeDataListUiClass(sizeClasses.editor, void 0, ui?.panel)"
|
|
214
|
+
<template #content>
|
|
215
|
+
<FilterStageTransition
|
|
216
|
+
:stage-key="`${stage}:${selectedKey ?? ''}:${pendingOperator ?? ''}`"
|
|
217
|
+
:direction="stageDirection"
|
|
218
|
+
@settled="stageTransitioning = false"
|
|
222
219
|
>
|
|
223
220
|
<div
|
|
224
|
-
v-if="
|
|
225
|
-
:class="
|
|
221
|
+
v-if="stage === 'picker'"
|
|
222
|
+
:class="mergeDataListUiClass(sizeClasses.editor, void 0, ui?.panel)"
|
|
223
|
+
>
|
|
224
|
+
<div
|
|
225
|
+
v-if="pickerProps?.title !== false"
|
|
226
|
+
:class="
|
|
226
227
|
mergeDataListUiClass(
|
|
227
228
|
'nut-dl-picker__title px-2.5 pt-2 pb-0.5 text-[11.5px] font-semibold text-muted',
|
|
228
229
|
void 0,
|
|
229
230
|
ui?.title
|
|
230
231
|
)
|
|
231
232
|
"
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
233
|
+
>
|
|
234
|
+
{{ t("table.controls.addFilter") }}
|
|
235
|
+
</div>
|
|
236
|
+
<FilterSearchablePanel
|
|
237
|
+
v-model:search-query="searchQuery"
|
|
238
|
+
:searchable="searchable"
|
|
239
|
+
:autofocus="searchable"
|
|
240
|
+
:search-placeholder="t('table.controls.searchFilters')"
|
|
241
|
+
:show-empty="!filteredDefinitions.length"
|
|
242
|
+
:empty-label="t('table.controls.noMatchingFilters')"
|
|
243
|
+
max-height-class="max-h-72"
|
|
244
|
+
:size="size"
|
|
245
|
+
:ui="ui"
|
|
246
|
+
>
|
|
247
|
+
<button
|
|
248
|
+
v-for="definition in filteredDefinitions"
|
|
249
|
+
:key="definition.key"
|
|
250
|
+
type="button"
|
|
251
|
+
:class="
|
|
251
252
|
mergeDataListUiClass(
|
|
252
253
|
`flex min-w-0 items-center rounded-md text-left outline-none transition-colors hover:bg-elevated/70 focus-visible:ring-2 focus-visible:ring-primary/40 ${sizeClasses.option}`,
|
|
253
254
|
void 0,
|
|
254
255
|
ui?.option
|
|
255
256
|
)
|
|
256
257
|
"
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
@click="handleSelect(definition.key)"
|
|
259
|
+
>
|
|
260
|
+
<UIcon
|
|
261
|
+
:name="
|
|
261
262
|
pickerProps?.icon === 'kind' ? resolveFilterTriggerIcon(definition) : 'i-lucide-plus'
|
|
262
263
|
"
|
|
263
|
-
|
|
264
|
+
:class="
|
|
264
265
|
mergeDataListUiClass(
|
|
265
266
|
`${sizeClasses.optionIcon} shrink-0 text-muted`,
|
|
266
267
|
void 0,
|
|
267
268
|
ui?.optionIcon
|
|
268
269
|
)
|
|
269
270
|
"
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
/>
|
|
272
|
+
<span
|
|
273
|
+
:class="
|
|
273
274
|
mergeDataListUiClass(
|
|
274
275
|
`min-w-0 flex-1 truncate text-default ${sizeClasses.optionLabel}`,
|
|
275
276
|
void 0,
|
|
276
277
|
ui?.optionLabel
|
|
277
278
|
)
|
|
278
279
|
"
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
280
|
+
>
|
|
281
|
+
{{ getLabel(definition) }}
|
|
282
|
+
</span>
|
|
283
|
+
<span
|
|
284
|
+
:class="
|
|
284
285
|
mergeDataListUiClass(
|
|
285
286
|
'inline-flex shrink-0 items-center text-dimmed',
|
|
286
287
|
void 0,
|
|
287
288
|
ui?.optionTrailingIcon
|
|
288
289
|
)
|
|
289
290
|
"
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
291
|
+
>
|
|
292
|
+
<UIcon name="i-lucide-chevron-right" :class="geometry.icon" />
|
|
293
|
+
</span>
|
|
294
|
+
</button>
|
|
295
|
+
</FilterSearchablePanel>
|
|
296
|
+
</div>
|
|
296
297
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
298
|
+
<div
|
|
299
|
+
v-else-if="stage === 'match-mode'"
|
|
300
|
+
:class="mergeDataListUiClass(sizeClasses.editor, void 0, ui?.panel)"
|
|
301
|
+
>
|
|
302
|
+
<FilterMatchModePanel
|
|
303
|
+
:items="operatorItems"
|
|
304
|
+
:selected="pendingOperator"
|
|
305
|
+
:size="size"
|
|
306
|
+
:ui="ui"
|
|
307
|
+
@select="openEditor"
|
|
308
|
+
/>
|
|
309
|
+
</div>
|
|
309
310
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
311
|
+
<component
|
|
312
|
+
:is="resolveFilterTagComponent(sessionDefinition)"
|
|
313
|
+
v-else-if="stage === 'editor' && sessionDefinition"
|
|
314
|
+
:definition="sessionDefinition"
|
|
315
|
+
dynamic
|
|
316
|
+
session
|
|
317
|
+
embedded
|
|
318
|
+
:initial-operator="pendingOperator"
|
|
319
|
+
@dismiss="handleSessionClosed"
|
|
320
|
+
@session-closed="handleSessionClosed"
|
|
321
|
+
@back="goBack"
|
|
322
|
+
/>
|
|
323
|
+
</FilterStageTransition>
|
|
324
|
+
</template>
|
|
325
|
+
</UPopover>
|
|
326
|
+
</div>
|
|
325
327
|
</template>
|
|
@@ -9,7 +9,7 @@ type __VLS_Props = {
|
|
|
9
9
|
declare function open(): void;
|
|
10
10
|
declare function close(): void;
|
|
11
11
|
declare function toggle(): void;
|
|
12
|
-
declare var
|
|
12
|
+
declare var __VLS_9: {
|
|
13
13
|
open: typeof open;
|
|
14
14
|
close: typeof close;
|
|
15
15
|
toggle: typeof toggle;
|
|
@@ -22,7 +22,7 @@ declare var __VLS_10: {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
type __VLS_Slots = {} & {
|
|
25
|
-
trigger?: (props: typeof
|
|
25
|
+
trigger?: (props: typeof __VLS_9) => any;
|
|
26
26
|
};
|
|
27
27
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
28
|
select: (key: string) => any;
|
|
@@ -104,10 +104,10 @@ const geometry = computed(() => resolveDataListControlGeometry(size.value));
|
|
|
104
104
|
:class="[sizeClasses.skeletonCount, 'shrink-0 rounded-full']"
|
|
105
105
|
/>
|
|
106
106
|
<span
|
|
107
|
-
v-else-if="props.showCounts
|
|
107
|
+
v-else-if="props.showCounts"
|
|
108
108
|
:class="mergeDataListUiClass('shrink-0 text-muted', void 0, ui?.optionCount)"
|
|
109
109
|
>
|
|
110
|
-
{{ entry.count }}
|
|
110
|
+
{{ entry.count ?? 0 }}
|
|
111
111
|
</span>
|
|
112
112
|
</div>
|
|
113
113
|
</template>
|
|
@@ -55,7 +55,7 @@ function handleSelect(options) {
|
|
|
55
55
|
:items="props.state.treeRadioItems.value"
|
|
56
56
|
:multiple="props.state.filterUi.value.selection.mode === 'multiple'"
|
|
57
57
|
:count-loading="
|
|
58
|
-
props.state.
|
|
58
|
+
props.state.optionSource.showCounts.value && props.state.optionSource.isCountLoading.value
|
|
59
59
|
"
|
|
60
60
|
:selected-icon="props.state.filterUi.value.row.selectedIcon"
|
|
61
61
|
:size="props.size"
|
|
@@ -77,7 +77,7 @@ function handleSelect(options) {
|
|
|
77
77
|
:sections="
|
|
78
78
|
props.sections ?? [{ key: 'default', entries: props.state.displayEntries.value }]
|
|
79
79
|
"
|
|
80
|
-
:show-counts="props.state.
|
|
80
|
+
:show-counts="props.state.optionSource.showCounts.value"
|
|
81
81
|
:count-loading="props.state.optionSource.isCountLoading.value"
|
|
82
82
|
:selected-icon="props.state.filterUi.value.row.selectedIcon"
|
|
83
83
|
:truncate="props.state.filterUi.value.row.truncate"
|
|
@@ -99,7 +99,7 @@ function handleSelect(options) {
|
|
|
99
99
|
v-model="flatRadioValue"
|
|
100
100
|
:items="props.state.flatRadioItems.value"
|
|
101
101
|
:count-loading="
|
|
102
|
-
props.state.
|
|
102
|
+
props.state.optionSource.showCounts.value && props.state.optionSource.isCountLoading.value
|
|
103
103
|
"
|
|
104
104
|
:size="props.size"
|
|
105
105
|
:ui="props.ui"
|