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
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { type Ref } from 'vue';
|
|
2
2
|
export interface UseFilterTagSessionParams {
|
|
3
3
|
isOpen?: Ref<boolean>;
|
|
4
|
-
activationToken?: Ref<number | undefined>;
|
|
5
4
|
session?: boolean;
|
|
6
5
|
dynamic?: boolean;
|
|
6
|
+
embedded?: boolean;
|
|
7
7
|
hasCommittedState: () => boolean;
|
|
8
|
-
onActivated: () => void;
|
|
9
8
|
onOpen: () => void;
|
|
10
9
|
onClose: () => void;
|
|
11
10
|
onSessionClosed: () => void;
|
|
@@ -13,7 +12,7 @@ export interface UseFilterTagSessionParams {
|
|
|
13
12
|
}
|
|
14
13
|
export declare function useFilterTagSession(options: UseFilterTagSessionParams): {
|
|
15
14
|
isOpen: Ref<boolean, boolean>;
|
|
16
|
-
|
|
17
|
-
handleOpenChange: (
|
|
15
|
+
open: () => void;
|
|
16
|
+
handleOpenChange: (nextOpen: boolean) => void;
|
|
18
17
|
close: () => void;
|
|
19
18
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ref
|
|
1
|
+
import { ref } from "vue";
|
|
2
2
|
export function useFilterTagSession(options) {
|
|
3
3
|
const isOpen = options.isOpen ?? ref(false);
|
|
4
|
-
|
|
5
|
-
let dismissLocked = false;
|
|
4
|
+
if (options.embedded) isOpen.value = true;
|
|
6
5
|
function runCloseEffects() {
|
|
7
6
|
options.onClose();
|
|
8
7
|
if (options.session) {
|
|
@@ -11,22 +10,15 @@ export function useFilterTagSession(options) {
|
|
|
11
10
|
}
|
|
12
11
|
if (options.dynamic && !options.hasCommittedState()) options.onDismiss();
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
requestAnimationFrame(() => {
|
|
19
|
-
requestAnimationFrame(() => {
|
|
20
|
-
dismissLocked = false;
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
});
|
|
13
|
+
function open() {
|
|
14
|
+
if (isOpen.value) return;
|
|
15
|
+
isOpen.value = true;
|
|
16
|
+
options.onOpen();
|
|
24
17
|
}
|
|
25
|
-
function handleOpenChange(
|
|
26
|
-
if (!
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (open) {
|
|
18
|
+
function handleOpenChange(nextOpen) {
|
|
19
|
+
if (!nextOpen && !isOpen.value) return;
|
|
20
|
+
isOpen.value = nextOpen;
|
|
21
|
+
if (nextOpen) {
|
|
30
22
|
options.onOpen();
|
|
31
23
|
return;
|
|
32
24
|
}
|
|
@@ -37,22 +29,10 @@ export function useFilterTagSession(options) {
|
|
|
37
29
|
isOpen.value = false;
|
|
38
30
|
runCloseEffects();
|
|
39
31
|
}
|
|
40
|
-
if (options.
|
|
41
|
-
queueMicrotask(() => {
|
|
42
|
-
watch(
|
|
43
|
-
options.activationToken,
|
|
44
|
-
(value) => {
|
|
45
|
-
if (value == null || value === lastActivationToken.value) return;
|
|
46
|
-
lastActivationToken.value = value;
|
|
47
|
-
options.onActivated();
|
|
48
|
-
},
|
|
49
|
-
{ immediate: true }
|
|
50
|
-
);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
32
|
+
if (options.embedded) queueMicrotask(options.onOpen);
|
|
53
33
|
return {
|
|
54
34
|
isOpen,
|
|
55
|
-
|
|
35
|
+
open,
|
|
56
36
|
handleOpenChange,
|
|
57
37
|
close
|
|
58
38
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComputedRef } from 'vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TableLayout, TableQueryStateFilterRule, TableSchemaView } from '../types/index.js';
|
|
3
3
|
export interface UseQueryStateParams {
|
|
4
4
|
schema: ComputedRef<TableSchemaView>;
|
|
5
5
|
activeLayout: ComputedRef<TableLayout>;
|
|
@@ -24,7 +24,7 @@ export declare function useQueryState(params: UseQueryStateParams): {
|
|
|
24
24
|
readonly count: "exact";
|
|
25
25
|
readonly cursor?: undefined;
|
|
26
26
|
}>;
|
|
27
|
-
paginationMode: "
|
|
27
|
+
paginationMode: "offset" | "cursor" | "none";
|
|
28
28
|
paginationRevision: import("vue").Ref<number, number>;
|
|
29
29
|
resetPagination: () => void;
|
|
30
30
|
setOffsetPagination: (value: {
|
|
@@ -33,16 +33,16 @@ export declare function useQueryState(params: UseQueryStateParams): {
|
|
|
33
33
|
}) => void;
|
|
34
34
|
sorting: import("vue").WritableComputedRef<{
|
|
35
35
|
key: string;
|
|
36
|
-
dir: "
|
|
36
|
+
dir: "asc" | "desc";
|
|
37
37
|
} | null, {
|
|
38
38
|
key: string;
|
|
39
39
|
dir: "asc" | "desc";
|
|
40
40
|
} | null>;
|
|
41
41
|
filters: import("vue").WritableComputedRef<{
|
|
42
42
|
search: string;
|
|
43
|
-
ui: TableQueryStateFilterRule<string, TableFilterOperator, TableQueryStateFilterValue>[];
|
|
43
|
+
ui: TableQueryStateFilterRule<string, import("../types/index.js").TableFilterOperator, import("../types/index.js").TableQueryStateFilterValue>[];
|
|
44
44
|
}, {
|
|
45
45
|
search: string;
|
|
46
|
-
ui: TableQueryStateFilterRule<string, TableFilterOperator, TableQueryStateFilterValue>[];
|
|
46
|
+
ui: TableQueryStateFilterRule<string, import("../types/index.js").TableFilterOperator, import("../types/index.js").TableQueryStateFilterValue>[];
|
|
47
47
|
}>;
|
|
48
48
|
};
|
|
@@ -12,8 +12,11 @@ import {
|
|
|
12
12
|
getDefaultSort,
|
|
13
13
|
getPaginationMode,
|
|
14
14
|
normalizeFilterDefinition,
|
|
15
|
+
parseTableFilterQueryState,
|
|
16
|
+
resolveTableFilterDefaultRules,
|
|
15
17
|
resolveFilterDefaultOperator,
|
|
16
|
-
resolveFilterSupportedOperators
|
|
18
|
+
resolveFilterSupportedOperators,
|
|
19
|
+
serializeTableFilterQueryState
|
|
17
20
|
} from "../utils/index.js";
|
|
18
21
|
export function useQueryState(params) {
|
|
19
22
|
const defaultPageSize = getDefaultPageSize({
|
|
@@ -90,7 +93,7 @@ export function useQueryState(params) {
|
|
|
90
93
|
ui: dynamicQueryState({
|
|
91
94
|
urlPrefix: "ui",
|
|
92
95
|
definitions: () => params.schema.value.filters?.ui ?? [],
|
|
93
|
-
defaultValue: [],
|
|
96
|
+
defaultValue: resolveTableFilterDefaultRules(params.schema.value.filters?.ui ?? []),
|
|
94
97
|
resolve(filter) {
|
|
95
98
|
const definition = normalizeFilterDefinition(filter);
|
|
96
99
|
const operators = resolveFilterSupportedOperators(definition);
|
|
@@ -102,38 +105,10 @@ export function useQueryState(params) {
|
|
|
102
105
|
}));
|
|
103
106
|
},
|
|
104
107
|
parse(entries, definitions) {
|
|
105
|
-
|
|
106
|
-
for (const filter of definitions) {
|
|
107
|
-
const definition = normalizeFilterDefinition(filter);
|
|
108
|
-
const operators = resolveFilterSupportedOperators(definition);
|
|
109
|
-
const defaultOp = resolveFilterDefaultOperator(definition);
|
|
110
|
-
for (const op of operators) {
|
|
111
|
-
const urlKey = op === defaultOp ? definition.key : `${definition.key}~${op}`;
|
|
112
|
-
const value = entries.get(urlKey);
|
|
113
|
-
if (value != null) {
|
|
114
|
-
rules.push({
|
|
115
|
-
key: definition.key,
|
|
116
|
-
operator: op,
|
|
117
|
-
value
|
|
118
|
-
});
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return rules;
|
|
108
|
+
return parseTableFilterQueryState({ entries, definitions });
|
|
124
109
|
},
|
|
125
110
|
serialize(rules, definitions) {
|
|
126
|
-
|
|
127
|
-
for (const rule of rules) {
|
|
128
|
-
const filter = definitions.find((f) => f.key === rule.key);
|
|
129
|
-
if (!filter) continue;
|
|
130
|
-
const definition = normalizeFilterDefinition(filter);
|
|
131
|
-
const operator = rule.operator ?? resolveFilterDefaultOperator(definition);
|
|
132
|
-
const defaultOp = resolveFilterDefaultOperator(definition);
|
|
133
|
-
const urlKey = operator === defaultOp ? definition.key : `${definition.key}~${operator}`;
|
|
134
|
-
result.set(urlKey, rule.value);
|
|
135
|
-
}
|
|
136
|
-
return result;
|
|
111
|
+
return serializeTableFilterQueryState({ rules, definitions });
|
|
137
112
|
}
|
|
138
113
|
})
|
|
139
114
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
|
-
import { getDefaultSort, mapPublicQueryState } from "../utils/index.js";
|
|
2
|
+
import { getDefaultSort, mapPublicQueryState, resolveTableFilterDefaultRules } from "../utils/index.js";
|
|
3
3
|
export function useTableApi(params) {
|
|
4
4
|
const state = {
|
|
5
5
|
layout: params.layout.activeLayout,
|
|
@@ -84,7 +84,7 @@ export function useTableApi(params) {
|
|
|
84
84
|
params.columns.setSorting(defaultSort);
|
|
85
85
|
params.state.queryState.filters.value = {
|
|
86
86
|
search: "",
|
|
87
|
-
ui: []
|
|
87
|
+
ui: resolveTableFilterDefaultRules(params.runtimeSchema.value.filters?.ui ?? [])
|
|
88
88
|
};
|
|
89
89
|
},
|
|
90
90
|
all() {
|
|
@@ -174,26 +174,16 @@ export declare function useTableColumns(params: UseTableColumnsParams): {
|
|
|
174
174
|
}) => void;
|
|
175
175
|
getSortState: (options: {
|
|
176
176
|
columnId: string;
|
|
177
|
-
}) => "
|
|
177
|
+
}) => "asc" | "desc" | null;
|
|
178
178
|
getPinnedState: (options: {
|
|
179
179
|
columnId: string;
|
|
180
|
-
}) => "
|
|
180
|
+
}) => "left" | "right" | null;
|
|
181
181
|
getMenuItems: (options: {
|
|
182
182
|
columnId: string;
|
|
183
|
-
}) => (
|
|
184
|
-
label: string;
|
|
185
|
-
icon: string;
|
|
186
|
-
color: string;
|
|
187
|
-
onSelect: () => void;
|
|
188
|
-
} | {
|
|
189
|
-
label: string;
|
|
190
|
-
icon: string;
|
|
191
|
-
onSelect: () => void;
|
|
192
|
-
color?: undefined;
|
|
193
|
-
})[][];
|
|
183
|
+
}) => import("@nuxt/ui/runtime/components/DropdownMenu.d.vue.js").DropdownMenuItem[][];
|
|
194
184
|
sortingState: import("vue").ComputedRef<{
|
|
195
185
|
key: string | undefined;
|
|
196
|
-
dir: "
|
|
186
|
+
dir: "asc" | "desc" | undefined;
|
|
197
187
|
active: boolean;
|
|
198
188
|
}>;
|
|
199
189
|
sortKeys: import("vue").ComputedRef<string[]>;
|
|
@@ -23,9 +23,6 @@ export declare function useTableFilterPresentation(options: UseTableFilterPresen
|
|
|
23
23
|
releaseDynamicSession: (input: {
|
|
24
24
|
key: string;
|
|
25
25
|
}) => void;
|
|
26
|
-
getDynamicActivationToken: (input: {
|
|
27
|
-
key: string;
|
|
28
|
-
}) => number;
|
|
29
26
|
openPanel: () => void;
|
|
30
27
|
closePanel: () => void;
|
|
31
28
|
resetPanelDraft: () => void;
|
|
@@ -2,7 +2,6 @@ import { computed, ref } from "vue";
|
|
|
2
2
|
import { resolveFilterDisplayLocation, resolveFilterDisplayOrder } from "../utils/index.js";
|
|
3
3
|
export function useTableFilterPresentation(options) {
|
|
4
4
|
const dynamicSessionKey = ref(null);
|
|
5
|
-
const dynamicActivationToken = ref({});
|
|
6
5
|
const panelOpen = ref(false);
|
|
7
6
|
const panelDraftFilters = ref([]);
|
|
8
7
|
const definitions = computed(
|
|
@@ -76,10 +75,6 @@ export function useTableFilterPresentation(options) {
|
|
|
76
75
|
});
|
|
77
76
|
function activateDynamicFilter(input) {
|
|
78
77
|
dynamicSessionKey.value = input.key;
|
|
79
|
-
dynamicActivationToken.value = {
|
|
80
|
-
...dynamicActivationToken.value,
|
|
81
|
-
[input.key]: (dynamicActivationToken.value[input.key] ?? 0) + 1
|
|
82
|
-
};
|
|
83
78
|
}
|
|
84
79
|
function releaseDynamicSession(input) {
|
|
85
80
|
if (dynamicSessionKey.value !== input.key) return;
|
|
@@ -167,9 +162,6 @@ export function useTableFilterPresentation(options) {
|
|
|
167
162
|
function clearPanelFilter(input) {
|
|
168
163
|
panelDraftFilters.value = panelDraftFilters.value.filter((rule) => rule.key !== input.key);
|
|
169
164
|
}
|
|
170
|
-
function getDynamicActivationToken(input) {
|
|
171
|
-
return dynamicActivationToken.value[input.key] ?? 0;
|
|
172
|
-
}
|
|
173
165
|
function isPanelKey(key) {
|
|
174
166
|
return panelDefinitions.value.some((definition) => definition.key === key);
|
|
175
167
|
}
|
|
@@ -192,7 +184,6 @@ export function useTableFilterPresentation(options) {
|
|
|
192
184
|
panelOpen,
|
|
193
185
|
activateDynamicFilter,
|
|
194
186
|
releaseDynamicSession,
|
|
195
|
-
getDynamicActivationToken,
|
|
196
187
|
openPanel,
|
|
197
188
|
closePanel,
|
|
198
189
|
resetPanelDraft,
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
|
+
import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
2
3
|
import {
|
|
3
4
|
buildFilterPreview,
|
|
4
5
|
createFilterValueForOperator,
|
|
5
6
|
flattenFilterOptionEntries,
|
|
6
7
|
getFilterLabelText,
|
|
7
|
-
|
|
8
|
+
mergeTableFilterDefaultRules,
|
|
9
|
+
resolveTableFilterDefaultRules,
|
|
8
10
|
resolveFilterOptionEntries
|
|
9
11
|
} from "../utils/index.js";
|
|
10
12
|
import { useTableSearch } from "./use-table-search.js";
|
|
11
13
|
export function useTableFilters(params) {
|
|
14
|
+
const { t } = useUiToolsLocale();
|
|
12
15
|
const search = useTableSearch({
|
|
13
16
|
schema: params.schema,
|
|
14
17
|
queryState: params.state.queryState
|
|
@@ -19,6 +22,9 @@ export function useTableFilters(params) {
|
|
|
19
22
|
const activeUiFilters = computed(
|
|
20
23
|
() => params.state.queryState.filters.value.ui ?? []
|
|
21
24
|
);
|
|
25
|
+
const defaultUiFilters = computed(
|
|
26
|
+
() => resolveTableFilterDefaultRules(definitions.value)
|
|
27
|
+
);
|
|
22
28
|
const hasActiveUiFilters = computed(() => activeUiFilters.value.length > 0);
|
|
23
29
|
function getDefinition(input) {
|
|
24
30
|
return definitions.value.find(
|
|
@@ -79,9 +85,7 @@ export function useTableFilters(params) {
|
|
|
79
85
|
function getFilterOperatorOptions(input) {
|
|
80
86
|
return getFilterOperators(input.key).map((operator) => ({
|
|
81
87
|
value: operator,
|
|
82
|
-
label:
|
|
83
|
-
operator
|
|
84
|
-
})
|
|
88
|
+
label: t(`table.filters.operators.${operator}`)
|
|
85
89
|
}));
|
|
86
90
|
}
|
|
87
91
|
function setFilterOperator(input) {
|
|
@@ -175,24 +179,31 @@ export function useTableFilters(params) {
|
|
|
175
179
|
});
|
|
176
180
|
}
|
|
177
181
|
function removeFilter(key) {
|
|
182
|
+
const defaultRule = defaultUiFilters.value.find((filter) => filter.key === key);
|
|
178
183
|
params.state.queryState.resetPagination();
|
|
179
184
|
params.state.queryState.filters.value = {
|
|
180
185
|
...params.state.queryState.filters.value,
|
|
181
|
-
ui:
|
|
186
|
+
ui: [
|
|
187
|
+
...params.state.queryState.filters.value.ui.filter((filter) => filter.key !== key),
|
|
188
|
+
...defaultRule ? [defaultRule] : []
|
|
189
|
+
]
|
|
182
190
|
};
|
|
183
191
|
}
|
|
184
192
|
function clearAllFilters() {
|
|
185
193
|
params.state.queryState.resetPagination();
|
|
186
194
|
params.state.queryState.filters.value = {
|
|
187
195
|
...params.state.queryState.filters.value,
|
|
188
|
-
ui:
|
|
196
|
+
ui: defaultUiFilters.value
|
|
189
197
|
};
|
|
190
198
|
}
|
|
191
199
|
function replaceFilters(input) {
|
|
192
200
|
params.state.queryState.resetPagination();
|
|
193
201
|
params.state.queryState.filters.value = {
|
|
194
202
|
...params.state.queryState.filters.value,
|
|
195
|
-
ui:
|
|
203
|
+
ui: mergeTableFilterDefaultRules({
|
|
204
|
+
rules: input.rules,
|
|
205
|
+
definitions: definitions.value
|
|
206
|
+
})
|
|
196
207
|
};
|
|
197
208
|
}
|
|
198
209
|
return {
|
|
@@ -36,7 +36,7 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
36
36
|
readonly count: "exact";
|
|
37
37
|
readonly cursor?: undefined;
|
|
38
38
|
}>;
|
|
39
|
-
paginationMode: "
|
|
39
|
+
paginationMode: "offset" | "cursor" | "none";
|
|
40
40
|
paginationRevision: import("vue").Ref<number, number>;
|
|
41
41
|
resetPagination: () => void;
|
|
42
42
|
setOffsetPagination: (value: {
|
|
@@ -45,7 +45,7 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
45
45
|
}) => void;
|
|
46
46
|
sorting: import("vue").WritableComputedRef<{
|
|
47
47
|
key: string;
|
|
48
|
-
dir: "
|
|
48
|
+
dir: "asc" | "desc";
|
|
49
49
|
} | null, {
|
|
50
50
|
key: string;
|
|
51
51
|
dir: "asc" | "desc";
|
|
@@ -190,9 +190,6 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
190
190
|
releaseDynamicSession: (input: {
|
|
191
191
|
key: string;
|
|
192
192
|
}) => void;
|
|
193
|
-
getDynamicActivationToken: (input: {
|
|
194
|
-
key: string;
|
|
195
|
-
}) => number;
|
|
196
193
|
openPanel: () => void;
|
|
197
194
|
closePanel: () => void;
|
|
198
195
|
resetPanelDraft: () => void;
|
|
@@ -426,26 +423,16 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
426
423
|
}) => void;
|
|
427
424
|
getSortState: (options: {
|
|
428
425
|
columnId: string;
|
|
429
|
-
}) => "
|
|
426
|
+
}) => "asc" | "desc" | null;
|
|
430
427
|
getPinnedState: (options: {
|
|
431
428
|
columnId: string;
|
|
432
|
-
}) => "
|
|
429
|
+
}) => "left" | "right" | null;
|
|
433
430
|
getMenuItems: (options: {
|
|
434
431
|
columnId: string;
|
|
435
|
-
}) => (
|
|
436
|
-
label: string;
|
|
437
|
-
icon: string;
|
|
438
|
-
color: string;
|
|
439
|
-
onSelect: () => void;
|
|
440
|
-
} | {
|
|
441
|
-
label: string;
|
|
442
|
-
icon: string;
|
|
443
|
-
onSelect: () => void;
|
|
444
|
-
color?: undefined;
|
|
445
|
-
})[][];
|
|
432
|
+
}) => import("@nuxt/ui/runtime/components/DropdownMenu.d.vue.js").DropdownMenuItem[][];
|
|
446
433
|
sortingState: import("vue").ComputedRef<{
|
|
447
434
|
key: string | undefined;
|
|
448
|
-
dir: "
|
|
435
|
+
dir: "asc" | "desc" | undefined;
|
|
449
436
|
active: boolean;
|
|
450
437
|
}>;
|
|
451
438
|
sortKeys: import("vue").ComputedRef<string[]>;
|
|
@@ -459,7 +446,7 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
459
446
|
toggleSorting: (key: string) => void;
|
|
460
447
|
};
|
|
461
448
|
pagination: {
|
|
462
|
-
mode: import("vue").ComputedRef<"
|
|
449
|
+
mode: import("vue").ComputedRef<"offset" | "cursor" | "none">;
|
|
463
450
|
rowCount: import("vue").ComputedRef<number | null>;
|
|
464
451
|
loadedCount: import("vue").ComputedRef<number>;
|
|
465
452
|
currentPage: import("vue").ComputedRef<number>;
|
|
@@ -470,7 +457,7 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
470
457
|
isLoadingMore: import("vue").ComputedRef<boolean>;
|
|
471
458
|
loadMoreError: import("vue").ComputedRef<unknown>;
|
|
472
459
|
state: import("vue").ComputedRef<{
|
|
473
|
-
mode: "
|
|
460
|
+
mode: "offset" | "cursor" | "none";
|
|
474
461
|
pageIndex: number;
|
|
475
462
|
pageSize: number;
|
|
476
463
|
pageCount: number;
|
|
@@ -528,7 +515,7 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
528
515
|
readonly count: "exact";
|
|
529
516
|
readonly cursor?: undefined;
|
|
530
517
|
}>;
|
|
531
|
-
paginationMode: "
|
|
518
|
+
paginationMode: "offset" | "cursor" | "none";
|
|
532
519
|
paginationRevision: import("vue").Ref<number, number>;
|
|
533
520
|
resetPagination: () => void;
|
|
534
521
|
setOffsetPagination: (value: {
|
|
@@ -537,7 +524,7 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
537
524
|
}) => void;
|
|
538
525
|
sorting: import("vue").WritableComputedRef<{
|
|
539
526
|
key: string;
|
|
540
|
-
dir: "
|
|
527
|
+
dir: "asc" | "desc";
|
|
541
528
|
} | null, {
|
|
542
529
|
key: string;
|
|
543
530
|
dir: "asc" | "desc";
|
|
@@ -682,9 +669,6 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
682
669
|
releaseDynamicSession: (input: {
|
|
683
670
|
key: string;
|
|
684
671
|
}) => void;
|
|
685
|
-
getDynamicActivationToken: (input: {
|
|
686
|
-
key: string;
|
|
687
|
-
}) => number;
|
|
688
672
|
openPanel: () => void;
|
|
689
673
|
closePanel: () => void;
|
|
690
674
|
resetPanelDraft: () => void;
|
|
@@ -918,26 +902,16 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
918
902
|
}) => void;
|
|
919
903
|
getSortState: (options: {
|
|
920
904
|
columnId: string;
|
|
921
|
-
}) => "
|
|
905
|
+
}) => "asc" | "desc" | null;
|
|
922
906
|
getPinnedState: (options: {
|
|
923
907
|
columnId: string;
|
|
924
|
-
}) => "
|
|
908
|
+
}) => "left" | "right" | null;
|
|
925
909
|
getMenuItems: (options: {
|
|
926
910
|
columnId: string;
|
|
927
|
-
}) => (
|
|
928
|
-
label: string;
|
|
929
|
-
icon: string;
|
|
930
|
-
color: string;
|
|
931
|
-
onSelect: () => void;
|
|
932
|
-
} | {
|
|
933
|
-
label: string;
|
|
934
|
-
icon: string;
|
|
935
|
-
onSelect: () => void;
|
|
936
|
-
color?: undefined;
|
|
937
|
-
})[][];
|
|
911
|
+
}) => import("@nuxt/ui/runtime/components/DropdownMenu.d.vue.js").DropdownMenuItem[][];
|
|
938
912
|
sortingState: import("vue").ComputedRef<{
|
|
939
913
|
key: string | undefined;
|
|
940
|
-
dir: "
|
|
914
|
+
dir: "asc" | "desc" | undefined;
|
|
941
915
|
active: boolean;
|
|
942
916
|
}>;
|
|
943
917
|
sortKeys: import("vue").ComputedRef<string[]>;
|
|
@@ -951,7 +925,7 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
951
925
|
toggleSorting: (key: string) => void;
|
|
952
926
|
};
|
|
953
927
|
pagination: {
|
|
954
|
-
mode: import("vue").ComputedRef<"
|
|
928
|
+
mode: import("vue").ComputedRef<"offset" | "cursor" | "none">;
|
|
955
929
|
rowCount: import("vue").ComputedRef<number | null>;
|
|
956
930
|
loadedCount: import("vue").ComputedRef<number>;
|
|
957
931
|
currentPage: import("vue").ComputedRef<number>;
|
|
@@ -962,7 +936,7 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
962
936
|
isLoadingMore: import("vue").ComputedRef<boolean>;
|
|
963
937
|
loadMoreError: import("vue").ComputedRef<unknown>;
|
|
964
938
|
state: import("vue").ComputedRef<{
|
|
965
|
-
mode: "
|
|
939
|
+
mode: "offset" | "cursor" | "none";
|
|
966
940
|
pageIndex: number;
|
|
967
941
|
pageSize: number;
|
|
968
942
|
pageCount: number;
|
|
@@ -1017,7 +991,7 @@ declare function useTableInternals(): {
|
|
|
1017
991
|
readonly count: "exact";
|
|
1018
992
|
readonly cursor?: undefined;
|
|
1019
993
|
}>;
|
|
1020
|
-
paginationMode: "
|
|
994
|
+
paginationMode: "offset" | "cursor" | "none";
|
|
1021
995
|
paginationRevision: import("vue").Ref<number, number>;
|
|
1022
996
|
resetPagination: () => void;
|
|
1023
997
|
setOffsetPagination: (value: {
|
|
@@ -1026,7 +1000,7 @@ declare function useTableInternals(): {
|
|
|
1026
1000
|
}) => void;
|
|
1027
1001
|
sorting: import("vue").WritableComputedRef<{
|
|
1028
1002
|
key: string;
|
|
1029
|
-
dir: "
|
|
1003
|
+
dir: "asc" | "desc";
|
|
1030
1004
|
} | null, {
|
|
1031
1005
|
key: string;
|
|
1032
1006
|
dir: "asc" | "desc";
|
|
@@ -1171,9 +1145,6 @@ declare function useTableInternals(): {
|
|
|
1171
1145
|
releaseDynamicSession: (input: {
|
|
1172
1146
|
key: string;
|
|
1173
1147
|
}) => void;
|
|
1174
|
-
getDynamicActivationToken: (input: {
|
|
1175
|
-
key: string;
|
|
1176
|
-
}) => number;
|
|
1177
1148
|
openPanel: () => void;
|
|
1178
1149
|
closePanel: () => void;
|
|
1179
1150
|
resetPanelDraft: () => void;
|
|
@@ -1407,26 +1378,16 @@ declare function useTableInternals(): {
|
|
|
1407
1378
|
}) => void;
|
|
1408
1379
|
getSortState: (options: {
|
|
1409
1380
|
columnId: string;
|
|
1410
|
-
}) => "
|
|
1381
|
+
}) => "asc" | "desc" | null;
|
|
1411
1382
|
getPinnedState: (options: {
|
|
1412
1383
|
columnId: string;
|
|
1413
|
-
}) => "
|
|
1384
|
+
}) => "left" | "right" | null;
|
|
1414
1385
|
getMenuItems: (options: {
|
|
1415
1386
|
columnId: string;
|
|
1416
|
-
}) => (
|
|
1417
|
-
label: string;
|
|
1418
|
-
icon: string;
|
|
1419
|
-
color: string;
|
|
1420
|
-
onSelect: () => void;
|
|
1421
|
-
} | {
|
|
1422
|
-
label: string;
|
|
1423
|
-
icon: string;
|
|
1424
|
-
onSelect: () => void;
|
|
1425
|
-
color?: undefined;
|
|
1426
|
-
})[][];
|
|
1387
|
+
}) => import("@nuxt/ui/runtime/components/DropdownMenu.d.vue.js").DropdownMenuItem[][];
|
|
1427
1388
|
sortingState: import("vue").ComputedRef<{
|
|
1428
1389
|
key: string | undefined;
|
|
1429
|
-
dir: "
|
|
1390
|
+
dir: "asc" | "desc" | undefined;
|
|
1430
1391
|
active: boolean;
|
|
1431
1392
|
}>;
|
|
1432
1393
|
sortKeys: import("vue").ComputedRef<string[]>;
|
|
@@ -1440,7 +1401,7 @@ declare function useTableInternals(): {
|
|
|
1440
1401
|
toggleSorting: (key: string) => void;
|
|
1441
1402
|
};
|
|
1442
1403
|
pagination: {
|
|
1443
|
-
mode: import("vue").ComputedRef<"
|
|
1404
|
+
mode: import("vue").ComputedRef<"offset" | "cursor" | "none">;
|
|
1444
1405
|
rowCount: import("vue").ComputedRef<number | null>;
|
|
1445
1406
|
loadedCount: import("vue").ComputedRef<number>;
|
|
1446
1407
|
currentPage: import("vue").ComputedRef<number>;
|
|
@@ -1451,7 +1412,7 @@ declare function useTableInternals(): {
|
|
|
1451
1412
|
isLoadingMore: import("vue").ComputedRef<boolean>;
|
|
1452
1413
|
loadMoreError: import("vue").ComputedRef<unknown>;
|
|
1453
1414
|
state: import("vue").ComputedRef<{
|
|
1454
|
-
mode: "
|
|
1415
|
+
mode: "offset" | "cursor" | "none";
|
|
1455
1416
|
pageIndex: number;
|
|
1456
1417
|
pageSize: number;
|
|
1457
1418
|
pageCount: number;
|
|
@@ -10,7 +10,7 @@ export interface UseTablePaginationParams {
|
|
|
10
10
|
queryContent: ReturnType<typeof useTableData>;
|
|
11
11
|
}
|
|
12
12
|
export declare function useTablePagination(options: UseTablePaginationParams): {
|
|
13
|
-
mode: ComputedRef<"
|
|
13
|
+
mode: ComputedRef<"offset" | "cursor" | "none">;
|
|
14
14
|
rowCount: ComputedRef<number | null>;
|
|
15
15
|
loadedCount: ComputedRef<number>;
|
|
16
16
|
currentPage: ComputedRef<number>;
|
|
@@ -21,7 +21,7 @@ export declare function useTablePagination(options: UseTablePaginationParams): {
|
|
|
21
21
|
isLoadingMore: ComputedRef<boolean>;
|
|
22
22
|
loadMoreError: ComputedRef<unknown>;
|
|
23
23
|
state: ComputedRef<{
|
|
24
|
-
mode: "
|
|
24
|
+
mode: "offset" | "cursor" | "none";
|
|
25
25
|
pageIndex: number;
|
|
26
26
|
pageSize: number;
|
|
27
27
|
pageCount: number;
|
|
@@ -26,7 +26,7 @@ export declare function useTableState(params: UseTableStateParams): {
|
|
|
26
26
|
readonly count: "exact";
|
|
27
27
|
readonly cursor?: undefined;
|
|
28
28
|
}>;
|
|
29
|
-
paginationMode: "
|
|
29
|
+
paginationMode: "offset" | "cursor" | "none";
|
|
30
30
|
paginationRevision: import("vue").Ref<number, number>;
|
|
31
31
|
resetPagination: () => void;
|
|
32
32
|
setOffsetPagination: (value: {
|
|
@@ -35,7 +35,7 @@ export declare function useTableState(params: UseTableStateParams): {
|
|
|
35
35
|
}) => void;
|
|
36
36
|
sorting: import("vue").WritableComputedRef<{
|
|
37
37
|
key: string;
|
|
38
|
-
dir: "
|
|
38
|
+
dir: "asc" | "desc";
|
|
39
39
|
} | null, {
|
|
40
40
|
key: string;
|
|
41
41
|
dir: "asc" | "desc";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DropdownMenuItem } from '@nuxt/ui';
|
|
1
|
+
import type { DropdownMenuItem } from '@nuxt/ui/components/DropdownMenu.vue';
|
|
2
2
|
import type { TableSourceRequestContext } from './source.js';
|
|
3
3
|
import type { GenericObject, MaybePromise, TableLayout, TableRowRenderParams, TableTextValue } from './utils.js';
|
|
4
4
|
export interface TableActionContext<TRow extends GenericObject = GenericObject, TContext extends GenericObject = GenericObject, TPageContext extends GenericObject = GenericObject> {
|