nuxt-ui-tools 0.1.0 → 0.1.2
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.d.mts +4 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +30 -15
- package/dist/runtime/form/components/actions/FormActions.d.vue.ts +0 -2
- package/dist/runtime/form/components/actions/FormActions.vue +5 -8
- package/dist/runtime/form/components/actions/FormActions.vue.d.ts +0 -2
- package/dist/runtime/form/components/layout/DrawerLayout.vue +5 -1
- package/dist/runtime/form/components/layout/ModalLayout.vue +5 -1
- package/dist/runtime/form/components/renderer/FormCompositeControl.d.vue.ts +15 -0
- package/dist/runtime/form/components/renderer/FormCompositeControl.vue +13 -0
- package/dist/runtime/form/components/renderer/FormCompositeControl.vue.d.ts +15 -0
- package/dist/runtime/form/components/renderer/FormFieldRenderer.d.vue.ts +1 -0
- package/dist/runtime/form/components/renderer/FormFieldRenderer.vue +19 -3
- package/dist/runtime/form/components/renderer/FormFieldRenderer.vue.d.ts +1 -0
- package/dist/runtime/form/components/renderer/FormFieldShell.d.vue.ts +4 -4
- package/dist/runtime/form/components/renderer/FormFieldShell.vue +15 -1
- package/dist/runtime/form/components/renderer/FormFieldShell.vue.d.ts +4 -4
- package/dist/runtime/form/components/root/Form.d.vue.ts +2 -2
- package/dist/runtime/form/components/root/Form.vue +5 -3
- package/dist/runtime/form/components/root/Form.vue.d.ts +2 -2
- package/dist/runtime/form/composables/use-field-control.d.ts +1 -1
- package/dist/runtime/form/composables/use-field-control.js +4 -0
- package/dist/runtime/form/composables/use-field-options.d.ts +1 -1
- package/dist/runtime/form/composables/use-field-options.js +75 -31
- package/dist/runtime/form/composables/use-form-field-chrome.d.ts +3 -0
- package/dist/runtime/form/composables/use-form-field-chrome.js +9 -0
- package/dist/runtime/form/composables/use-form-runtime.js +17 -5
- package/dist/runtime/form/fields/array-list/component.vue +4 -1
- package/dist/runtime/form/fields/auto-complete/component.vue +23 -16
- package/dist/runtime/form/fields/checkbox-card/component.vue +28 -29
- package/dist/runtime/form/fields/checkbox-group/component.vue +28 -29
- package/dist/runtime/form/fields/color-picker/component.vue +4 -2
- package/dist/runtime/form/fields/date-family/component.vue +9 -4
- package/dist/runtime/form/fields/hierarchy/SelectionCheckbox.d.vue.ts +13 -0
- package/dist/runtime/form/fields/hierarchy/SelectionCheckbox.vue +24 -0
- package/dist/runtime/form/fields/hierarchy/SelectionCheckbox.vue.d.ts +13 -0
- package/dist/runtime/form/fields/hierarchy/SelectionRadio.d.vue.ts +14 -0
- package/dist/runtime/form/fields/hierarchy/SelectionRadio.vue +27 -0
- package/dist/runtime/form/fields/hierarchy/SelectionRadio.vue.d.ts +14 -0
- package/dist/runtime/form/fields/hierarchy/component.vue +257 -142
- package/dist/runtime/form/fields/hierarchy/utils.d.ts +9 -0
- package/dist/runtime/form/fields/hierarchy/utils.js +32 -0
- package/dist/runtime/form/fields/input-group/component.vue +7 -30
- package/dist/runtime/form/fields/matrix/component.vue +9 -3
- package/dist/runtime/form/fields/phone-number/component.vue +7 -2
- package/dist/runtime/form/fields/rating/component.vue +25 -2
- package/dist/runtime/form/fields/select/component.vue +29 -21
- package/dist/runtime/form/fields/switch-group/component.vue +8 -3
- package/dist/runtime/form/fields/time/component.vue +7 -5
- package/dist/runtime/form/fields/upload/component.vue +5 -3
- package/dist/runtime/form/types/api.d.ts +9 -3
- package/dist/runtime/form/types/field-base.d.ts +3 -1
- package/dist/runtime/form/types/runtime.d.ts +2 -0
- package/dist/runtime/form/types/ui.d.ts +1 -0
- package/dist/runtime/form/utils/api.js +3 -0
- package/dist/runtime/form/utils/options.d.ts +11 -2
- package/dist/runtime/form/utils/options.js +57 -9
- package/dist/runtime/form/utils/state.js +10 -2
- package/dist/runtime/i18n/locales/en.js +38 -0
- package/dist/runtime/i18n/locales/fr.js +38 -0
- package/dist/runtime/i18n/types.d.ts +38 -0
- package/dist/runtime/i18n/use-locale.d.ts +2 -2
- package/dist/runtime/i18n/use-locale.js +3 -3
- package/dist/runtime/spreadsheet/components/layout/SpreadsheetImportFooter.d.vue.ts +2 -2
- package/dist/runtime/spreadsheet/components/layout/SpreadsheetImportFooter.vue.d.ts +2 -2
- package/dist/runtime/spreadsheet/components/steps/review/SpreadsheetReviewInspection.d.vue.ts +2 -2
- package/dist/runtime/spreadsheet/components/steps/review/SpreadsheetReviewInspection.vue.d.ts +2 -2
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-internals.d.ts +15 -15
- package/dist/runtime/spreadsheet/composables/use-spreadsheet-resolutions.d.ts +2 -2
- package/dist/runtime/spreadsheet/schema/normalize.d.ts +1 -1
- package/dist/runtime/spreadsheet/utils/references/sources.d.ts +1 -1
- package/dist/runtime/table/components/DataList.d.vue.ts +2 -0
- package/dist/runtime/table/components/DataList.vue.d.ts +2 -0
- package/dist/runtime/table/components/actions/RowActions.d.vue.ts +4 -2
- package/dist/runtime/table/components/actions/RowActions.vue +2 -0
- package/dist/runtime/table/components/actions/RowActions.vue.d.ts +4 -2
- package/dist/runtime/table/components/data-list/DataListAddFilter.d.vue.ts +5 -3
- package/dist/runtime/table/components/data-list/DataListAddFilter.vue +6 -1
- package/dist/runtime/table/components/data-list/DataListAddFilter.vue.d.ts +5 -3
- package/dist/runtime/table/components/data-list/DataListContent.d.vue.ts +24 -17
- package/dist/runtime/table/components/data-list/DataListContent.vue +70 -17
- package/dist/runtime/table/components/data-list/DataListContent.vue.d.ts +24 -17
- package/dist/runtime/table/components/data-list/DataListDefault.d.vue.ts +2 -0
- package/dist/runtime/table/components/data-list/DataListDefault.vue.d.ts +2 -0
- package/dist/runtime/table/components/data-list/DataListFilterTags.d.vue.ts +2 -0
- package/dist/runtime/table/components/data-list/DataListFilterTags.vue.d.ts +2 -0
- package/dist/runtime/table/components/data-list/DataListInfiniteLoader.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/DataListInfiniteLoader.vue.d.ts +1 -1
- package/dist/runtime/table/components/data-list/DataListLayoutSwitch.vue +17 -11
- package/dist/runtime/table/components/data-list/DataListPagination.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/DataListPagination.vue.d.ts +1 -1
- package/dist/runtime/table/components/data-list/DataListRoot.vue +2 -46
- package/dist/runtime/table/components/data-list/DataListSortMenu.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/DataListSortMenu.vue +6 -0
- package/dist/runtime/table/components/data-list/DataListSortMenu.vue.d.ts +1 -1
- package/dist/runtime/table/components/filters/shared/DynamicFilterPicker.d.vue.ts +5 -0
- package/dist/runtime/table/components/filters/shared/DynamicFilterPicker.vue +182 -59
- package/dist/runtime/table/components/filters/shared/DynamicFilterPicker.vue.d.ts +5 -0
- package/dist/runtime/table/components/filters/shared/FilterMatchModeButton.d.vue.ts +3 -1
- package/dist/runtime/table/components/filters/shared/FilterMatchModeButton.vue +29 -5
- package/dist/runtime/table/components/filters/shared/FilterMatchModeButton.vue.d.ts +3 -1
- package/dist/runtime/table/components/filters/shared/FilterMatchModePanel.d.vue.ts +17 -0
- package/dist/runtime/table/components/filters/shared/FilterMatchModePanel.vue +47 -0
- package/dist/runtime/table/components/filters/shared/FilterMatchModePanel.vue.d.ts +17 -0
- package/dist/runtime/table/components/filters/shared/FilterOptionMultipleList.d.vue.ts +3 -1
- package/dist/runtime/table/components/filters/shared/FilterOptionMultipleList.vue +12 -3
- package/dist/runtime/table/components/filters/shared/FilterOptionMultipleList.vue.d.ts +3 -1
- package/dist/runtime/table/components/filters/shared/FilterOptionPickerContent.d.vue.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterOptionPickerContent.vue +11 -1
- package/dist/runtime/table/components/filters/shared/FilterOptionPickerContent.vue.d.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterOptionRow.d.vue.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterOptionRow.vue +48 -9
- package/dist/runtime/table/components/filters/shared/FilterOptionRow.vue.d.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterOptionSingleList.d.vue.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterOptionSingleList.vue +35 -9
- package/dist/runtime/table/components/filters/shared/FilterOptionSingleList.vue.d.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterOptionTreeContent.d.vue.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterOptionTreeContent.vue +77 -20
- package/dist/runtime/table/components/filters/shared/FilterOptionTreeContent.vue.d.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterPopoverShell.d.vue.ts +27 -0
- package/dist/runtime/table/components/filters/shared/FilterPopoverShell.vue +36 -0
- package/dist/runtime/table/components/filters/shared/FilterPopoverShell.vue.d.ts +27 -0
- package/dist/runtime/table/components/filters/shared/FilterSearchablePanel.d.vue.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterSearchablePanel.vue +40 -10
- package/dist/runtime/table/components/filters/shared/FilterSearchablePanel.vue.d.ts +3 -0
- package/dist/runtime/table/components/filters/shared/FilterStageTransition.d.vue.ts +23 -0
- package/dist/runtime/table/components/filters/shared/FilterStageTransition.vue +21 -0
- package/dist/runtime/table/components/filters/shared/FilterStageTransition.vue.d.ts +23 -0
- package/dist/runtime/table/components/filters/shared/FilterTriggerTag.d.vue.ts +3 -2
- package/dist/runtime/table/components/filters/shared/FilterTriggerTag.vue +26 -25
- package/dist/runtime/table/components/filters/shared/FilterTriggerTag.vue.d.ts +3 -2
- package/dist/runtime/table/components/filters/tags/BooleanFilterTag.d.vue.ts +1 -1
- package/dist/runtime/table/components/filters/tags/BooleanFilterTag.vue +75 -22
- package/dist/runtime/table/components/filters/tags/BooleanFilterTag.vue.d.ts +1 -1
- package/dist/runtime/table/components/filters/tags/DateFilterTag.d.vue.ts +3 -1
- package/dist/runtime/table/components/filters/tags/DateFilterTag.vue +254 -160
- package/dist/runtime/table/components/filters/tags/DateFilterTag.vue.d.ts +3 -1
- package/dist/runtime/table/components/filters/tags/FilterTagsBar.d.vue.ts +7 -6
- package/dist/runtime/table/components/filters/tags/FilterTagsBar.vue +12 -27
- package/dist/runtime/table/components/filters/tags/FilterTagsBar.vue.d.ts +7 -6
- package/dist/runtime/table/components/filters/tags/NumberFilterTag.d.vue.ts +3 -2
- package/dist/runtime/table/components/filters/tags/NumberFilterTag.vue +192 -106
- package/dist/runtime/table/components/filters/tags/NumberFilterTag.vue.d.ts +3 -2
- package/dist/runtime/table/components/filters/tags/OptionFilterTag.d.vue.ts +3 -2
- package/dist/runtime/table/components/filters/tags/OptionFilterTag.vue +110 -48
- package/dist/runtime/table/components/filters/tags/OptionFilterTag.vue.d.ts +3 -2
- package/dist/runtime/table/components/filters/tags/TextFilterTag.d.vue.ts +3 -2
- package/dist/runtime/table/components/filters/tags/TextFilterTag.vue +120 -57
- package/dist/runtime/table/components/filters/tags/TextFilterTag.vue.d.ts +3 -2
- package/dist/runtime/table/components/grid/GridRenderer.vue +1 -1
- package/dist/runtime/table/components/layout/TableFooter.d.vue.ts +1 -1
- package/dist/runtime/table/components/layout/TableFooter.vue +1 -0
- package/dist/runtime/table/components/layout/TableFooter.vue.d.ts +1 -1
- package/dist/runtime/table/components/table/TableCellEllipsis.d.ts +1 -1
- package/dist/runtime/table/components/table/TableRenderer.vue +24 -12
- package/dist/runtime/table/composables/use-filter-tag-session.d.ts +3 -4
- package/dist/runtime/table/composables/use-filter-tag-session.js +12 -32
- package/dist/runtime/table/composables/use-query-state.d.ts +5 -5
- package/dist/runtime/table/composables/use-query-state.js +7 -32
- package/dist/runtime/table/composables/use-table-api.js +2 -2
- package/dist/runtime/table/composables/use-table-columns.d.ts +4 -14
- package/dist/runtime/table/composables/use-table-filter-presentation.d.ts +0 -3
- package/dist/runtime/table/composables/use-table-filter-presentation.js +0 -9
- package/dist/runtime/table/composables/use-table-filters.js +18 -7
- package/dist/runtime/table/composables/use-table-internals.d.ts +24 -63
- package/dist/runtime/table/composables/use-table-pagination.d.ts +2 -2
- package/dist/runtime/table/composables/use-table-state.d.ts +2 -2
- package/dist/runtime/table/types/actions.d.ts +1 -1
- package/dist/runtime/table/types/data-list.d.ts +41 -8
- package/dist/runtime/table/types/filters.d.ts +4 -0
- package/dist/runtime/table/utils/actions.d.ts +1 -1
- package/dist/runtime/table/utils/columns/menu.d.ts +2 -11
- package/dist/runtime/table/utils/columns/render.d.ts +2 -9
- package/dist/runtime/table/utils/columns/render.js +39 -30
- package/dist/runtime/table/utils/columns/state.d.ts +1 -1
- package/dist/runtime/table/utils/data-list-ui.d.ts +3 -1
- package/dist/runtime/table/utils/data-list-ui.js +45 -0
- package/dist/runtime/table/utils/filters/editor-size.d.ts +11 -0
- package/dist/runtime/table/utils/filters/editor-size.js +45 -0
- package/dist/runtime/table/utils/filters/index.d.ts +1 -1
- package/dist/runtime/table/utils/filters/index.js +1 -1
- package/dist/runtime/table/utils/query-state.d.ts +18 -1
- package/dist/runtime/table/utils/query-state.js +109 -0
- package/package.json +4 -2
- package/dist/runtime/table/utils/filters/operators.d.ts +0 -4
- package/dist/runtime/table/utils/filters/operators.js +0 -6
|
@@ -6,31 +6,38 @@ type __VLS_Props = {
|
|
|
6
6
|
ui?: DataListContentUi;
|
|
7
7
|
};
|
|
8
8
|
declare function refresh(): void;
|
|
9
|
+
declare function clearQuery(): void;
|
|
9
10
|
declare var __VLS_1: {}, __VLS_4: "loading" | "initial-loading", __VLS_5: {
|
|
10
11
|
layout: "table" | "grid";
|
|
11
12
|
}, __VLS_7: {
|
|
12
13
|
error: {};
|
|
13
14
|
retry: typeof refresh;
|
|
14
|
-
},
|
|
15
|
+
}, __VLS_22: {
|
|
15
16
|
layout: "table" | "grid";
|
|
16
17
|
refresh: typeof refresh;
|
|
17
|
-
|
|
18
|
+
hasActiveQuery: boolean;
|
|
19
|
+
clearQuery: typeof clearQuery;
|
|
20
|
+
}, __VLS_24: {
|
|
18
21
|
layout: "table" | "grid";
|
|
19
22
|
rows: object[];
|
|
20
23
|
loading: boolean;
|
|
21
24
|
empty: boolean;
|
|
22
25
|
error: unknown;
|
|
23
|
-
},
|
|
26
|
+
}, __VLS_32: {
|
|
24
27
|
rows: object[];
|
|
25
|
-
},
|
|
28
|
+
}, __VLS_41: {}, __VLS_43: {
|
|
26
29
|
layout: string;
|
|
27
30
|
refresh: typeof refresh;
|
|
28
|
-
|
|
31
|
+
hasActiveQuery: boolean;
|
|
32
|
+
clearQuery: typeof clearQuery;
|
|
33
|
+
}, __VLS_45: {
|
|
29
34
|
rows: object[];
|
|
30
|
-
},
|
|
35
|
+
}, __VLS_54: {}, __VLS_56: {
|
|
31
36
|
layout: string;
|
|
32
37
|
refresh: typeof refresh;
|
|
33
|
-
|
|
38
|
+
hasActiveQuery: boolean;
|
|
39
|
+
clearQuery: typeof clearQuery;
|
|
40
|
+
}, __VLS_58: {}, __VLS_60: {};
|
|
34
41
|
type __VLS_Slots = {} & {
|
|
35
42
|
[K in NonNullable<typeof __VLS_4>]?: (props: typeof __VLS_5) => any;
|
|
36
43
|
} & {
|
|
@@ -38,25 +45,25 @@ type __VLS_Slots = {} & {
|
|
|
38
45
|
} & {
|
|
39
46
|
error?: (props: typeof __VLS_7) => any;
|
|
40
47
|
} & {
|
|
41
|
-
empty?: (props: typeof
|
|
48
|
+
empty?: (props: typeof __VLS_22) => any;
|
|
42
49
|
} & {
|
|
43
|
-
content?: (props: typeof
|
|
50
|
+
content?: (props: typeof __VLS_24) => any;
|
|
44
51
|
} & {
|
|
45
|
-
table?: (props: typeof
|
|
52
|
+
table?: (props: typeof __VLS_32) => any;
|
|
46
53
|
} & {
|
|
47
|
-
'empty-table'?: (props: typeof
|
|
54
|
+
'empty-table'?: (props: typeof __VLS_41) => any;
|
|
48
55
|
} & {
|
|
49
|
-
empty?: (props: typeof
|
|
56
|
+
empty?: (props: typeof __VLS_43) => any;
|
|
50
57
|
} & {
|
|
51
|
-
grid?: (props: typeof
|
|
58
|
+
grid?: (props: typeof __VLS_45) => any;
|
|
52
59
|
} & {
|
|
53
|
-
'empty-grid'?: (props: typeof
|
|
60
|
+
'empty-grid'?: (props: typeof __VLS_54) => any;
|
|
54
61
|
} & {
|
|
55
|
-
empty?: (props: typeof
|
|
62
|
+
empty?: (props: typeof __VLS_56) => any;
|
|
56
63
|
} & {
|
|
57
|
-
refreshing?: (props: typeof
|
|
64
|
+
refreshing?: (props: typeof __VLS_58) => any;
|
|
58
65
|
} & {
|
|
59
|
-
after?: (props: typeof
|
|
66
|
+
after?: (props: typeof __VLS_60) => any;
|
|
60
67
|
};
|
|
61
68
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
62
69
|
transition: boolean;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
+
import UButton from "@nuxt/ui/components/Button.vue";
|
|
3
|
+
import UIcon from "@nuxt/ui/components/Icon.vue";
|
|
2
4
|
import { computed, nextTick, ref, watch } from "vue";
|
|
3
5
|
import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
4
6
|
import { useDataListUi } from "../../composables/use-data-list-ui";
|
|
@@ -24,6 +26,9 @@ const loading = computed(
|
|
|
24
26
|
);
|
|
25
27
|
const error = computed(() => rows.value.length ? null : internals.queryContent.error.value);
|
|
26
28
|
const empty = computed(() => !loading.value && !error.value && rows.value.length === 0);
|
|
29
|
+
const hasActiveQuery = computed(
|
|
30
|
+
() => internals.filters.hasActiveSearch.value || internals.filters.hasActiveUiFilters.value
|
|
31
|
+
);
|
|
27
32
|
const refreshing = computed(
|
|
28
33
|
() => rows.value.length > 0 && (internals.queryContent.status.value.isRefreshing || internals.queryContent.status.value.isRevalidating)
|
|
29
34
|
);
|
|
@@ -42,6 +47,10 @@ const shellClass = computed(
|
|
|
42
47
|
function refresh() {
|
|
43
48
|
void internals.queryContent.refreshData()();
|
|
44
49
|
}
|
|
50
|
+
function clearQuery() {
|
|
51
|
+
internals.filters.searchQuery.value = "";
|
|
52
|
+
internals.filters.clearAllFilters();
|
|
53
|
+
}
|
|
45
54
|
watch(
|
|
46
55
|
() => internals.controls.tableLayout.value,
|
|
47
56
|
() => {
|
|
@@ -87,31 +96,61 @@ watch(
|
|
|
87
96
|
)
|
|
88
97
|
"
|
|
89
98
|
>
|
|
90
|
-
<div
|
|
91
|
-
|
|
99
|
+
<div
|
|
100
|
+
:class="
|
|
101
|
+
mergeDataListUiClass(
|
|
102
|
+
'flex max-w-md items-start gap-3 text-left',
|
|
103
|
+
rootUi?.errorBody,
|
|
104
|
+
ui?.errorBody
|
|
105
|
+
)
|
|
106
|
+
"
|
|
107
|
+
>
|
|
108
|
+
<span
|
|
92
109
|
:class="
|
|
110
|
+
mergeDataListUiClass(
|
|
111
|
+
'grid size-9 shrink-0 place-items-center rounded-md bg-error/10 text-error',
|
|
112
|
+
rootUi?.errorIcon,
|
|
113
|
+
ui?.errorIcon
|
|
114
|
+
)
|
|
115
|
+
"
|
|
116
|
+
>
|
|
117
|
+
<UIcon name="i-lucide-cloud-alert" class="size-4" />
|
|
118
|
+
</span>
|
|
119
|
+
<div :class="mergeDataListUiClass('min-w-0 flex-1', rootUi?.errorCopy, ui?.errorCopy)">
|
|
120
|
+
<div
|
|
121
|
+
:class="
|
|
93
122
|
mergeDataListUiClass(
|
|
94
123
|
'font-medium text-highlighted',
|
|
95
124
|
rootUi?.errorTitle,
|
|
96
125
|
ui?.errorTitle
|
|
97
126
|
)
|
|
98
127
|
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
:class="
|
|
128
|
+
>
|
|
129
|
+
{{ t("table.states.gridError.title") }}
|
|
130
|
+
</div>
|
|
131
|
+
<p
|
|
132
|
+
:class="
|
|
105
133
|
mergeDataListUiClass(
|
|
106
|
-
'
|
|
107
|
-
rootUi?.
|
|
108
|
-
ui?.
|
|
134
|
+
'mt-0.5 text-sm leading-5 text-muted',
|
|
135
|
+
rootUi?.errorDescription,
|
|
136
|
+
ui?.errorDescription
|
|
109
137
|
)
|
|
110
138
|
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
139
|
+
>
|
|
140
|
+
{{ t("table.states.gridError.description") }}
|
|
141
|
+
</p>
|
|
142
|
+
<UButton
|
|
143
|
+
color="neutral"
|
|
144
|
+
variant="soft"
|
|
145
|
+
size="sm"
|
|
146
|
+
icon="i-lucide-refresh-cw"
|
|
147
|
+
class="mt-3"
|
|
148
|
+
:ui="{ base: mergeDataListUiClass(rootUi?.retry, ui?.retry) }"
|
|
149
|
+
@click="refresh"
|
|
150
|
+
>
|
|
151
|
+
{{ t("table.states.gridError.action") }}
|
|
152
|
+
</UButton>
|
|
153
|
+
</div>
|
|
115
154
|
</div>
|
|
116
155
|
</div>
|
|
117
156
|
</slot>
|
|
@@ -120,6 +159,8 @@ watch(
|
|
|
120
159
|
name="empty"
|
|
121
160
|
:layout="internals.controls.tableLayout.value"
|
|
122
161
|
:refresh="refresh"
|
|
162
|
+
:has-active-query="hasActiveQuery"
|
|
163
|
+
:clear-query="clearQuery"
|
|
123
164
|
/>
|
|
124
165
|
<slot
|
|
125
166
|
v-else
|
|
@@ -140,7 +181,13 @@ watch(
|
|
|
140
181
|
<DataListTable>
|
|
141
182
|
<template #empty>
|
|
142
183
|
<slot name="empty-table">
|
|
143
|
-
<slot
|
|
184
|
+
<slot
|
|
185
|
+
name="empty"
|
|
186
|
+
:layout="'table'"
|
|
187
|
+
:refresh="refresh"
|
|
188
|
+
:has-active-query="hasActiveQuery"
|
|
189
|
+
:clear-query="clearQuery"
|
|
190
|
+
/>
|
|
144
191
|
</slot>
|
|
145
192
|
</template>
|
|
146
193
|
</DataListTable>
|
|
@@ -149,7 +196,13 @@ watch(
|
|
|
149
196
|
<DataListGrid>
|
|
150
197
|
<template #empty>
|
|
151
198
|
<slot name="empty-grid">
|
|
152
|
-
<slot
|
|
199
|
+
<slot
|
|
200
|
+
name="empty"
|
|
201
|
+
:layout="'grid'"
|
|
202
|
+
:refresh="refresh"
|
|
203
|
+
:has-active-query="hasActiveQuery"
|
|
204
|
+
:clear-query="clearQuery"
|
|
205
|
+
/>
|
|
153
206
|
</slot>
|
|
154
207
|
</template>
|
|
155
208
|
</DataListGrid>
|
|
@@ -6,31 +6,38 @@ type __VLS_Props = {
|
|
|
6
6
|
ui?: DataListContentUi;
|
|
7
7
|
};
|
|
8
8
|
declare function refresh(): void;
|
|
9
|
+
declare function clearQuery(): void;
|
|
9
10
|
declare var __VLS_1: {}, __VLS_4: "loading" | "initial-loading", __VLS_5: {
|
|
10
11
|
layout: "table" | "grid";
|
|
11
12
|
}, __VLS_7: {
|
|
12
13
|
error: {};
|
|
13
14
|
retry: typeof refresh;
|
|
14
|
-
},
|
|
15
|
+
}, __VLS_22: {
|
|
15
16
|
layout: "table" | "grid";
|
|
16
17
|
refresh: typeof refresh;
|
|
17
|
-
|
|
18
|
+
hasActiveQuery: boolean;
|
|
19
|
+
clearQuery: typeof clearQuery;
|
|
20
|
+
}, __VLS_24: {
|
|
18
21
|
layout: "table" | "grid";
|
|
19
22
|
rows: object[];
|
|
20
23
|
loading: boolean;
|
|
21
24
|
empty: boolean;
|
|
22
25
|
error: unknown;
|
|
23
|
-
},
|
|
26
|
+
}, __VLS_32: {
|
|
24
27
|
rows: object[];
|
|
25
|
-
},
|
|
28
|
+
}, __VLS_41: {}, __VLS_43: {
|
|
26
29
|
layout: string;
|
|
27
30
|
refresh: typeof refresh;
|
|
28
|
-
|
|
31
|
+
hasActiveQuery: boolean;
|
|
32
|
+
clearQuery: typeof clearQuery;
|
|
33
|
+
}, __VLS_45: {
|
|
29
34
|
rows: object[];
|
|
30
|
-
},
|
|
35
|
+
}, __VLS_54: {}, __VLS_56: {
|
|
31
36
|
layout: string;
|
|
32
37
|
refresh: typeof refresh;
|
|
33
|
-
|
|
38
|
+
hasActiveQuery: boolean;
|
|
39
|
+
clearQuery: typeof clearQuery;
|
|
40
|
+
}, __VLS_58: {}, __VLS_60: {};
|
|
34
41
|
type __VLS_Slots = {} & {
|
|
35
42
|
[K in NonNullable<typeof __VLS_4>]?: (props: typeof __VLS_5) => any;
|
|
36
43
|
} & {
|
|
@@ -38,25 +45,25 @@ type __VLS_Slots = {} & {
|
|
|
38
45
|
} & {
|
|
39
46
|
error?: (props: typeof __VLS_7) => any;
|
|
40
47
|
} & {
|
|
41
|
-
empty?: (props: typeof
|
|
48
|
+
empty?: (props: typeof __VLS_22) => any;
|
|
42
49
|
} & {
|
|
43
|
-
content?: (props: typeof
|
|
50
|
+
content?: (props: typeof __VLS_24) => any;
|
|
44
51
|
} & {
|
|
45
|
-
table?: (props: typeof
|
|
52
|
+
table?: (props: typeof __VLS_32) => any;
|
|
46
53
|
} & {
|
|
47
|
-
'empty-table'?: (props: typeof
|
|
54
|
+
'empty-table'?: (props: typeof __VLS_41) => any;
|
|
48
55
|
} & {
|
|
49
|
-
empty?: (props: typeof
|
|
56
|
+
empty?: (props: typeof __VLS_43) => any;
|
|
50
57
|
} & {
|
|
51
|
-
grid?: (props: typeof
|
|
58
|
+
grid?: (props: typeof __VLS_45) => any;
|
|
52
59
|
} & {
|
|
53
|
-
'empty-grid'?: (props: typeof
|
|
60
|
+
'empty-grid'?: (props: typeof __VLS_54) => any;
|
|
54
61
|
} & {
|
|
55
|
-
empty?: (props: typeof
|
|
62
|
+
empty?: (props: typeof __VLS_56) => any;
|
|
56
63
|
} & {
|
|
57
|
-
refreshing?: (props: typeof
|
|
64
|
+
refreshing?: (props: typeof __VLS_58) => any;
|
|
58
65
|
} & {
|
|
59
|
-
after?: (props: typeof
|
|
66
|
+
after?: (props: typeof __VLS_60) => any;
|
|
60
67
|
};
|
|
61
68
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
62
69
|
transition: boolean;
|
|
@@ -15,6 +15,8 @@ declare var __VLS_1: {}, __VLS_13: {}, __VLS_42: {
|
|
|
15
15
|
}, __VLS_51: {
|
|
16
16
|
layout: string;
|
|
17
17
|
refresh: () => void;
|
|
18
|
+
hasActiveQuery: boolean;
|
|
19
|
+
clearQuery: () => void;
|
|
18
20
|
}, __VLS_54: {}, __VLS_57: {}, __VLS_60: {}, __VLS_70: {
|
|
19
21
|
loadedCount: number;
|
|
20
22
|
}, __VLS_73: {
|
|
@@ -15,6 +15,8 @@ declare var __VLS_1: {}, __VLS_13: {}, __VLS_42: {
|
|
|
15
15
|
}, __VLS_51: {
|
|
16
16
|
layout: string;
|
|
17
17
|
refresh: () => void;
|
|
18
|
+
hasActiveQuery: boolean;
|
|
19
|
+
clearQuery: () => void;
|
|
18
20
|
}, __VLS_54: {}, __VLS_57: {}, __VLS_60: {}, __VLS_70: {
|
|
19
21
|
loadedCount: number;
|
|
20
22
|
}, __VLS_73: {
|
|
@@ -14,6 +14,8 @@ declare var __VLS_1: {
|
|
|
14
14
|
close: () => void;
|
|
15
15
|
toggle: () => void;
|
|
16
16
|
openState: boolean;
|
|
17
|
+
stage: "editor" | "match-mode" | "picker";
|
|
18
|
+
definition: import("../../types/index.js").TableUiFilterDefinition | undefined;
|
|
17
19
|
triggerProps: {
|
|
18
20
|
type: string;
|
|
19
21
|
'aria-expanded': boolean;
|
|
@@ -14,6 +14,8 @@ declare var __VLS_1: {
|
|
|
14
14
|
close: () => void;
|
|
15
15
|
toggle: () => void;
|
|
16
16
|
openState: boolean;
|
|
17
|
+
stage: "editor" | "match-mode" | "picker";
|
|
18
|
+
definition: import("../../types/index.js").TableUiFilterDefinition | undefined;
|
|
17
19
|
triggerProps: {
|
|
18
20
|
type: string;
|
|
19
21
|
'aria-expanded': boolean;
|
|
@@ -17,7 +17,7 @@ declare var __VLS_1: {
|
|
|
17
17
|
}, __VLS_14: {
|
|
18
18
|
loadMore: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverRefetchErrorResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverSuccessResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverLoadingErrorResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverPendingResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverPlaceholderResult<unknown, unknown> | undefined>;
|
|
19
19
|
state: {
|
|
20
|
-
mode: "
|
|
20
|
+
mode: "offset" | "cursor" | "none";
|
|
21
21
|
pageIndex: number;
|
|
22
22
|
pageSize: number;
|
|
23
23
|
pageCount: number;
|
|
@@ -17,7 +17,7 @@ declare var __VLS_1: {
|
|
|
17
17
|
}, __VLS_14: {
|
|
18
18
|
loadMore: () => Promise<import("@tanstack/vue-query").InfiniteQueryObserverRefetchErrorResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverSuccessResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverLoadingErrorResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverPendingResult<unknown, unknown> | import("@tanstack/vue-query").InfiniteQueryObserverPlaceholderResult<unknown, unknown> | undefined>;
|
|
19
19
|
state: {
|
|
20
|
-
mode: "
|
|
20
|
+
mode: "offset" | "cursor" | "none";
|
|
21
21
|
pageIndex: number;
|
|
22
22
|
pageSize: number;
|
|
23
23
|
pageCount: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import UButton from "@nuxt/ui/components/Button.vue";
|
|
3
3
|
import UFieldGroup from "@nuxt/ui/components/FieldGroup.vue";
|
|
4
|
+
import UTooltip from "@nuxt/ui/components/Tooltip.vue";
|
|
4
5
|
import { computed } from "vue";
|
|
5
6
|
import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
6
7
|
import { useDataListUi } from "../../composables/use-data-list-ui";
|
|
@@ -37,24 +38,29 @@ function setLayout(layout) {
|
|
|
37
38
|
:size="resolvedSize"
|
|
38
39
|
:class="resolvedUi.root"
|
|
39
40
|
>
|
|
40
|
-
<
|
|
41
|
+
<UTooltip
|
|
41
42
|
v-for="layout in order"
|
|
42
43
|
:key="layout"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
:text="layout === 'table' ? t('table.header.tableView') : t('table.header.gridView')"
|
|
45
|
+
>
|
|
46
|
+
<UButton
|
|
47
|
+
color="neutral"
|
|
48
|
+
:variant="internals.controls.tableLayout.value === layout ? 'subtle' : 'outline'"
|
|
49
|
+
:size="resolvedSize"
|
|
50
|
+
:icon="layout === 'table' ? 'i-lucide-table-properties' : 'i-lucide-layout-grid'"
|
|
51
|
+
:label="labels ? layout === 'table' ? 'Table' : 'Grid' : void 0"
|
|
52
|
+
:aria-label="
|
|
53
|
+
layout === 'table' ? t('table.header.tableView') : t('table.header.gridView')
|
|
54
|
+
"
|
|
55
|
+
:ui="{
|
|
51
56
|
base: resolvedUi.trigger,
|
|
52
57
|
label: resolvedUi.triggerLabel,
|
|
53
58
|
leadingIcon: resolvedUi.triggerLeadingIcon,
|
|
54
59
|
trailingIcon: resolvedUi.triggerTrailingIcon
|
|
55
60
|
}"
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
@click="setLayout(layout)"
|
|
62
|
+
/>
|
|
63
|
+
</UTooltip>
|
|
58
64
|
</UFieldGroup>
|
|
59
65
|
</slot>
|
|
60
66
|
</template>
|
|
@@ -4,6 +4,7 @@ import { computed, onBeforeUnmount, onMounted } from "vue";
|
|
|
4
4
|
import { provideUiToolsLocale, useUiToolsLocaleRef } from "#ui-tools/i18n";
|
|
5
5
|
import { provideDataListUi } from "../../composables/use-data-list-ui";
|
|
6
6
|
import { provideTableInternals } from "../../composables/use-table-internals";
|
|
7
|
+
import { mergeDataListUiConfig } from "../../utils";
|
|
7
8
|
const props = defineProps({
|
|
8
9
|
table: { type: Object, required: true },
|
|
9
10
|
locale: { type: Object, required: false },
|
|
@@ -15,7 +16,7 @@ provideTableInternals(props.table.__internals);
|
|
|
15
16
|
provideUiToolsLocale(useUiToolsLocaleRef(computed(() => props.locale)));
|
|
16
17
|
provideDataListUi(
|
|
17
18
|
computed(
|
|
18
|
-
() =>
|
|
19
|
+
() => mergeDataListUiConfig(resolveAppDataListUi(appConfig), props.ui, props.density)
|
|
19
20
|
)
|
|
20
21
|
);
|
|
21
22
|
onMounted(() => props.table.__internals.startup.scheduleStart());
|
|
@@ -29,51 +30,6 @@ function resolveAppDataListUi(config) {
|
|
|
29
30
|
function isDataListUiConfig(value) {
|
|
30
31
|
return Boolean(value) && typeof value === "object";
|
|
31
32
|
}
|
|
32
|
-
function mergeDataListUi(appUi, componentUi, density) {
|
|
33
|
-
return {
|
|
34
|
-
...appUi,
|
|
35
|
-
...componentUi,
|
|
36
|
-
density: density ?? componentUi?.density ?? appUi?.density,
|
|
37
|
-
control: { ...appUi?.control, ...componentUi?.control },
|
|
38
|
-
default: mergeUiConfig(appUi?.default, componentUi?.default),
|
|
39
|
-
search: mergeSearchConfig(appUi?.search, componentUi?.search),
|
|
40
|
-
filterTags: mergePartConfig(appUi?.filterTags, componentUi?.filterTags),
|
|
41
|
-
addFilter: mergePartConfig(appUi?.addFilter, componentUi?.addFilter),
|
|
42
|
-
filterPanel: mergePartConfig(appUi?.filterPanel, componentUi?.filterPanel),
|
|
43
|
-
clearFilters: mergePartConfig(appUi?.clearFilters, componentUi?.clearFilters),
|
|
44
|
-
resultCount: mergeUiConfig(appUi?.resultCount, componentUi?.resultCount),
|
|
45
|
-
columnPanel: mergePartConfig(appUi?.columnPanel, componentUi?.columnPanel),
|
|
46
|
-
sortMenu: mergePartConfig(appUi?.sortMenu, componentUi?.sortMenu),
|
|
47
|
-
layoutSwitch: mergePartConfig(appUi?.layoutSwitch, componentUi?.layoutSwitch),
|
|
48
|
-
refresh: mergePartConfig(appUi?.refresh, componentUi?.refresh),
|
|
49
|
-
content: mergeUiConfig(appUi?.content, componentUi?.content),
|
|
50
|
-
table: mergeUiConfig(appUi?.table, componentUi?.table),
|
|
51
|
-
grid: mergeUiConfig(appUi?.grid, componentUi?.grid),
|
|
52
|
-
pagination: mergePartConfig(appUi?.pagination, componentUi?.pagination),
|
|
53
|
-
infiniteLoader: mergePartConfig(appUi?.infiniteLoader, componentUi?.infiniteLoader)
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function mergeUiConfig(appDefaults, componentConfig) {
|
|
57
|
-
return {
|
|
58
|
-
...appDefaults,
|
|
59
|
-
...componentConfig,
|
|
60
|
-
ui: { ...appDefaults?.ui, ...componentConfig?.ui }
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
function mergePartConfig(appDefaults, componentConfig) {
|
|
64
|
-
return {
|
|
65
|
-
...appDefaults,
|
|
66
|
-
...componentConfig,
|
|
67
|
-
ui: { ...appDefaults?.ui, ...componentConfig?.ui }
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
function mergeSearchConfig(appDefaults, componentConfig) {
|
|
71
|
-
return {
|
|
72
|
-
...appDefaults,
|
|
73
|
-
...componentConfig,
|
|
74
|
-
ui: { ...appDefaults?.ui, ...componentConfig?.ui }
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
33
|
</script>
|
|
78
34
|
|
|
79
35
|
<template>
|
|
@@ -33,6 +33,10 @@ const sortLabels = computed(() => {
|
|
|
33
33
|
return labels;
|
|
34
34
|
});
|
|
35
35
|
const activeKey = computed(() => internals.tableColumns.sortingState.value.key);
|
|
36
|
+
const activeDirection = computed(() => internals.tableColumns.sortingState.value.dir);
|
|
37
|
+
const directionIcon = computed(
|
|
38
|
+
() => activeDirection.value === "asc" ? "i-lucide-arrow-up-narrow-wide" : "i-lucide-arrow-down-wide-narrow"
|
|
39
|
+
);
|
|
36
40
|
const sortKeys = computed(() => [
|
|
37
41
|
.../* @__PURE__ */ new Set([
|
|
38
42
|
...internals.tableColumns.sortKeys.value,
|
|
@@ -68,6 +72,7 @@ function humanize(value) {
|
|
|
68
72
|
|
|
69
73
|
<template>
|
|
70
74
|
<UDropdownMenu
|
|
75
|
+
:size="resolvedSize"
|
|
71
76
|
:items="items"
|
|
72
77
|
:content="{ align: 'end', sideOffset: 8 }"
|
|
73
78
|
:ui="{
|
|
@@ -91,6 +96,7 @@ function humanize(value) {
|
|
|
91
96
|
variant="outline"
|
|
92
97
|
:size="resolvedSize"
|
|
93
98
|
:label="`${label ?? t('table.controls.sort')}${activeLabel ? `: ${activeLabel}` : ''}`"
|
|
99
|
+
:icon="directionIcon"
|
|
94
100
|
trailing-icon="i-lucide-chevron-down"
|
|
95
101
|
:ui="{
|
|
96
102
|
base: resolvedUi.trigger,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DataListAddFilterUi, DataListControlSize, TableUiFilterDefinition } from '../../../types/index.js';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
definitions: TableUiFilterDefinition[];
|
|
4
|
+
sessionDefinition?: TableUiFilterDefinition;
|
|
4
5
|
getLabel: (definition: TableUiFilterDefinition) => string;
|
|
5
6
|
size?: DataListControlSize;
|
|
6
7
|
ui?: DataListAddFilterUi;
|
|
@@ -13,6 +14,8 @@ declare var __VLS_10: {
|
|
|
13
14
|
close: typeof close;
|
|
14
15
|
toggle: typeof toggle;
|
|
15
16
|
openState: boolean;
|
|
17
|
+
stage: "editor" | "match-mode" | "picker";
|
|
18
|
+
definition: TableUiFilterDefinition | undefined;
|
|
16
19
|
triggerProps: {
|
|
17
20
|
type: string;
|
|
18
21
|
'aria-expanded': boolean;
|
|
@@ -23,8 +26,10 @@ type __VLS_Slots = {} & {
|
|
|
23
26
|
};
|
|
24
27
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
25
28
|
select: (key: string) => any;
|
|
29
|
+
release: (key: string) => any;
|
|
26
30
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
31
|
onSelect?: ((key: string) => any) | undefined;
|
|
32
|
+
onRelease?: ((key: string) => any) | undefined;
|
|
28
33
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
34
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
30
35
|
declare const _default: typeof __VLS_export;
|