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
|
@@ -4,13 +4,13 @@ type __VLS_Props = {
|
|
|
4
4
|
contentClass?: string;
|
|
5
5
|
transitioning?: boolean;
|
|
6
6
|
};
|
|
7
|
-
declare var __VLS_1: {},
|
|
7
|
+
declare var __VLS_1: {}, __VLS_11: {}, __VLS_14: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
9
|
content?: (props: typeof __VLS_1) => any;
|
|
10
10
|
} & {
|
|
11
|
-
default?: (props: typeof
|
|
11
|
+
default?: (props: typeof __VLS_11) => any;
|
|
12
12
|
} & {
|
|
13
|
-
content?: (props: typeof
|
|
13
|
+
content?: (props: typeof __VLS_14) => any;
|
|
14
14
|
};
|
|
15
15
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
16
|
updateOpen: (value: boolean) => any;
|
|
@@ -20,24 +20,26 @@ function handleFocusOutside(event) {
|
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<template>
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
<div class="contents">
|
|
24
|
+
<template v-if="embedded">
|
|
25
|
+
<slot name="content" />
|
|
26
|
+
</template>
|
|
27
|
+
<UPopover
|
|
28
|
+
v-else
|
|
29
|
+
:open="open"
|
|
30
|
+
:content="{
|
|
30
31
|
side: 'bottom',
|
|
31
32
|
align: 'start',
|
|
32
33
|
sideOffset: 8,
|
|
33
34
|
onFocusOutside: handleFocusOutside
|
|
34
35
|
}"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
:ui="{ content: resolvedContentClass }"
|
|
37
|
+
@update:open="emit('updateOpen', $event)"
|
|
38
|
+
>
|
|
39
|
+
<slot />
|
|
40
|
+
<template #content>
|
|
41
|
+
<slot name="content" />
|
|
42
|
+
</template>
|
|
43
|
+
</UPopover>
|
|
44
|
+
</div>
|
|
43
45
|
</template>
|
|
@@ -4,13 +4,13 @@ type __VLS_Props = {
|
|
|
4
4
|
contentClass?: string;
|
|
5
5
|
transitioning?: boolean;
|
|
6
6
|
};
|
|
7
|
-
declare var __VLS_1: {},
|
|
7
|
+
declare var __VLS_1: {}, __VLS_11: {}, __VLS_14: {};
|
|
8
8
|
type __VLS_Slots = {} & {
|
|
9
9
|
content?: (props: typeof __VLS_1) => any;
|
|
10
10
|
} & {
|
|
11
|
-
default?: (props: typeof
|
|
11
|
+
default?: (props: typeof __VLS_11) => any;
|
|
12
12
|
} & {
|
|
13
|
-
content?: (props: typeof
|
|
13
|
+
content?: (props: typeof __VLS_14) => any;
|
|
14
14
|
};
|
|
15
15
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
16
|
updateOpen: (value: boolean) => any;
|
|
@@ -51,7 +51,10 @@ const sizeClasses = computed(() => resolveFilterEditorSizeClasses(size));
|
|
|
51
51
|
variant="none"
|
|
52
52
|
:autofocus="autofocus"
|
|
53
53
|
:size="size"
|
|
54
|
-
:ui="{
|
|
54
|
+
:ui="{
|
|
55
|
+
root: ui?.search,
|
|
56
|
+
base: mergeDataListUiClass('h-8', void 0, ui?.searchInput)
|
|
57
|
+
}"
|
|
55
58
|
/>
|
|
56
59
|
</div>
|
|
57
60
|
|
|
@@ -78,7 +81,12 @@ const sizeClasses = computed(() => resolveFilterEditorSizeClasses(size));
|
|
|
78
81
|
"
|
|
79
82
|
>
|
|
80
83
|
<slot name="empty">
|
|
81
|
-
|
|
84
|
+
<div class="grid justify-items-center gap-2">
|
|
85
|
+
<span class="flex size-8 items-center justify-center rounded-full bg-elevated">
|
|
86
|
+
<span class="i-lucide-search-x size-4" aria-hidden="true" />
|
|
87
|
+
</span>
|
|
88
|
+
<span>{{ emptyLabel }}</span>
|
|
89
|
+
</div>
|
|
82
90
|
</slot>
|
|
83
91
|
</div>
|
|
84
92
|
</UScrollArea>
|
|
@@ -98,14 +98,15 @@ function clearAll() {
|
|
|
98
98
|
>
|
|
99
99
|
<UButton
|
|
100
100
|
v-bind="triggerProps"
|
|
101
|
+
:aria-label="t('table.filters.panel.trigger')"
|
|
102
|
+
:title="t('table.filters.panel.trigger')"
|
|
103
|
+
:square="!activeCount"
|
|
101
104
|
:ui="{
|
|
102
105
|
base: mergeDataListUiClass('nut-dl-sheet-trigger shrink-0', void 0, ui?.sheetTrigger)
|
|
103
106
|
}"
|
|
104
107
|
>
|
|
105
|
-
<span class="flex items-center
|
|
106
|
-
<span>{{ t("table.filters.panel.trigger") }}</span>
|
|
108
|
+
<span v-if="activeCount" class="flex items-center">
|
|
107
109
|
<UBadge
|
|
108
|
-
v-if="activeCount"
|
|
109
110
|
color="neutral"
|
|
110
111
|
variant="solid"
|
|
111
112
|
size="xs"
|
|
@@ -79,11 +79,9 @@ const showInitialLoading = computed(
|
|
|
79
79
|
() => status.value.isBooting || status.value.isPending && tableRows.value.length === 0
|
|
80
80
|
);
|
|
81
81
|
const showRefreshing = computed(
|
|
82
|
-
() => tableRows.value.length > 0 && (status.value.isFetching || status.value.isRefreshing || status.value.isRevalidating)
|
|
83
|
-
);
|
|
84
|
-
const showError = computed(
|
|
85
|
-
() => Boolean(internals.queryContent.error.value) && tableRows.value.length === 0
|
|
82
|
+
() => !internals.queryContent.error.value && tableRows.value.length > 0 && (status.value.isFetching || status.value.isRefreshing || status.value.isRevalidating)
|
|
86
83
|
);
|
|
84
|
+
const showError = computed(() => Boolean(internals.queryContent.error.value));
|
|
87
85
|
const showEmpty = computed(
|
|
88
86
|
() => !showInitialLoading.value && !showError.value && tableRows.value.length === 0
|
|
89
87
|
);
|
|
@@ -6,6 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
fill?: boolean;
|
|
7
7
|
ui?: DataListTableUi;
|
|
8
8
|
};
|
|
9
|
+
declare function refresh(): void;
|
|
9
10
|
type ColumnSlot = {
|
|
10
11
|
kind: 'column';
|
|
11
12
|
columnId: string;
|
|
@@ -25,11 +26,16 @@ declare var __VLS_34: {
|
|
|
25
26
|
coreRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
|
|
26
27
|
columnMeta: import("../../utils/index.js").DataListColumnMeta;
|
|
27
28
|
}, object, unknown>[];
|
|
28
|
-
}, __VLS_36: {
|
|
29
|
+
}, __VLS_36: {
|
|
30
|
+
error: {};
|
|
31
|
+
retry: typeof refresh;
|
|
32
|
+
}, __VLS_45: {};
|
|
29
33
|
type __VLS_Slots = {} & {
|
|
30
34
|
footer?: (props: typeof __VLS_34) => any;
|
|
31
35
|
} & {
|
|
32
|
-
|
|
36
|
+
error?: (props: typeof __VLS_36) => any;
|
|
37
|
+
} & {
|
|
38
|
+
empty?: (props: typeof __VLS_45) => any;
|
|
33
39
|
};
|
|
34
40
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
35
41
|
resetColumnSizing: () => void;
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
SELECT_COLUMN_ID,
|
|
24
24
|
SELECT_COLUMN_WIDTH
|
|
25
25
|
} from "../../utils/columns/types";
|
|
26
|
+
import DataListErrorState from "../data-list/data-list-error-state.vue";
|
|
26
27
|
import TableCell from "./table-cell";
|
|
27
28
|
import TableColumnHeader from "./table-column-header.vue";
|
|
28
29
|
import TableEmptyState from "./table-empty-state.vue";
|
|
@@ -58,12 +59,16 @@ const { status } = internals.queryContent;
|
|
|
58
59
|
const rowsMounted = ref(false);
|
|
59
60
|
let rowMountFrame = 0;
|
|
60
61
|
const isFirstLoad = computed(
|
|
61
|
-
() => status.value.isBooting || status.value.isPending && rows.value.length === 0 || !rowsMounted.value && rows.value.length > 0
|
|
62
|
+
() => status.value.isBooting || (status.value.isPending || status.value.isFetching) && rows.value.length === 0 || !rowsMounted.value && rows.value.length > 0
|
|
62
63
|
);
|
|
63
64
|
const refreshing = computed(
|
|
64
|
-
() => rows.value.length > 0 && (status.value.isFetching || status.value.isRefreshing)
|
|
65
|
+
() => rows.value.length > 0 && (status.value.isFetching || status.value.isRefreshing || status.value.isRevalidating)
|
|
65
66
|
);
|
|
66
|
-
const
|
|
67
|
+
const error = computed(() => rows.value.length === 0 ? internals.queryContent.error.value : null);
|
|
68
|
+
const empty = computed(() => !isFirstLoad.value && !error.value && rows.value.length === 0);
|
|
69
|
+
function refresh() {
|
|
70
|
+
void internals.queryContent.refreshData()();
|
|
71
|
+
}
|
|
67
72
|
const resolvedSize = computed(
|
|
68
73
|
() => props.size ?? dataListUi.ui.value.table?.size ?? dataListUi.controlSize.value
|
|
69
74
|
);
|
|
@@ -616,7 +621,7 @@ defineExpose({ resetColumnSizing });
|
|
|
616
621
|
</th>
|
|
617
622
|
</template>
|
|
618
623
|
</tr>
|
|
619
|
-
<tr
|
|
624
|
+
<tr class="nut-dl-progress" :data-active="refreshing" aria-hidden="true">
|
|
620
625
|
<th
|
|
621
626
|
:colspan="leafColumns.length"
|
|
622
627
|
class="sticky top-[var(--nut-dl-head-h)] z-[3] h-0 p-0"
|
|
@@ -824,7 +829,20 @@ defineExpose({ resetColumnSizing });
|
|
|
824
829
|
</tfoot>
|
|
825
830
|
</table>
|
|
826
831
|
|
|
827
|
-
<div
|
|
832
|
+
<div
|
|
833
|
+
v-if="error"
|
|
834
|
+
class="nut-dl-table__error sticky left-0 w-full"
|
|
835
|
+
:style="{ height: fill ? 'calc(100% - var(--nut-dl-head-h))' : void 0 }"
|
|
836
|
+
>
|
|
837
|
+
<slot name="error" :error="error" :retry="refresh">
|
|
838
|
+
<DataListErrorState
|
|
839
|
+
:min-height="fill ? '100%' : '16rem'"
|
|
840
|
+
:size="resolvedSize"
|
|
841
|
+
@retry="refresh"
|
|
842
|
+
/>
|
|
843
|
+
</slot>
|
|
844
|
+
</div>
|
|
845
|
+
<div v-else-if="empty" class="nut-dl-table__empty sticky left-0 w-full">
|
|
828
846
|
<slot name="empty">
|
|
829
847
|
<TableEmptyState
|
|
830
848
|
:min-height="fill ? 'calc(100% - var(--nut-dl-head-h))' : '16rem'"
|
|
@@ -840,5 +858,5 @@ defineExpose({ resetColumnSizing });
|
|
|
840
858
|
<style>
|
|
841
859
|
.nut-dl-table{--nut-dl-surface:var(--nut-dl-table-surface,var(--ui-bg-elevated));--nut-dl-line:var(--nut-dl-table-line,var(--ui-border));--nut-dl-line-soft:var(--nut-dl-table-line-soft,var(--ui-border-muted));--nut-dl-head-bg:var(--nut-dl-table-head-bg,var(--ui-bg-muted));--nut-dl-head-fg:var(--nut-dl-table-head-fg,var(--ui-text-muted));--nut-dl-head-font:var(--nut-dl-table-head-font,11px);--nut-dl-head-weight:var(--nut-dl-table-head-weight,600);--nut-dl-head-tracking:var(--nut-dl-table-head-tracking,0.04em);--nut-dl-head-transform:var(--nut-dl-table-head-transform,none);--nut-dl-row-hover:var(--nut-dl-table-row-hover,var(--ui-bg-muted));--nut-dl-row-selected:var(
|
|
842
860
|
--nut-dl-table-row-selected,color-mix(in srgb,var(--ui-primary) 10%,var(--nut-dl-surface))
|
|
843
|
-
);--nut-dl-accent:var(--ui-primary);--nut-dl-cell-fg:var(--nut-dl-table-cell-fg,var(--ui-text-toned));--nut-dl-pin-line:var(--nut-dl-table-pin-line,var(--nut-dl-line))}.nut-dl-table__scroll{overflow-anchor:none;scrollbar-width:none}.nut-dl-table__scroll::-webkit-scrollbar{display:none}.nut-dl-th{color:var(--nut-dl-head-fg);font-size:var(--nut-dl-head-font);font-weight:var(--nut-dl-head-weight);letter-spacing:var(--nut-dl-head-tracking);text-transform:var(--nut-dl-head-transform);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.nut-dl-table__spacer,.nut-dl-th{border-bottom:1px solid var(--nut-dl-line)}.nut-dl-table__spacer,.nut-dl-tf,.nut-dl-th{background:var(--nut-dl-head-bg);border-top:1px solid var(--nut-dl-line)}.nut-dl-tf{color:var(--ui-text-highlighted);font-weight:var(--nut-dl-table-foot-weight,500);white-space:nowrap}tfoot .nut-dl-table__spacer{border-bottom:0;border-top:1px solid var(--nut-dl-line)}.nut-dl-spinner{animation:nut-dl-spin .8s linear infinite}@keyframes nut-dl-spin{to{transform:rotate(1turn)}}tbody .nut-dl-table__spacer{background:var(--nut-dl-surface);border-bottom:1px solid var(--nut-dl-line-soft)}.nut-dl-th__btn--open{background:color-mix(in srgb,var(--nut-dl-head-fg) 8%,transparent)}.nut-dl-rz:after{background:var(--ui-border-accented);bottom:10px;content:"";opacity:0;position:absolute;right:0;top:10px;transition:opacity .12s;width:1px}.nut-dl-rz:hover:after,.nut-dl-th:hover .nut-dl-rz:after{opacity:1}.nut-dl-rz--active:after,.nut-dl-rz:hover:after{background:var(--nut-dl-accent);bottom:6px;left:2.5px;opacity:1;top:6px;width:2px}.nut-dl-row{background:var(--nut-dl-surface);transition:background-color .1s}.nut-dl-row:hover{background:var(--nut-dl-row-hover)}.nut-dl-row--selected,.nut-dl-row--selected:hover{background:var(--nut-dl-row-selected)}.nut-dl-td,.nut-dl-th__btn,.nut-dl-th__static{padding-left:var(--nut-dl-cell-l,var(--nut-dl-cell-x));padding-right:var(--nut-dl-cell-r,var(--nut-dl-cell-x))}.nut-dl-row>.nut-dl-td:first-child,.nut-dl-table__head-row>.nut-dl-th:first-child{--nut-dl-cell-l:var(--nut-dl-gutter)}.nut-dl-row>.nut-dl-td:last-child,.nut-dl-table__head-row>.nut-dl-th:last-child{--nut-dl-cell-r:var(--nut-dl-gutter)}.nut-dl-row>.nut-dl-td--actions:last-child,.nut-dl-table__head-row>.nut-dl-th--actions:last-child,.nut-dl-td--actions{--nut-dl-cell-l:var(--nut-dl-cell-x);--nut-dl-cell-r:var(--nut-dl-cell-x)}.nut-dl-td--actions .nut-dl-td__inner{justify-content:flex-end}.nut-dl-td{background:inherit;border-bottom:1px solid var(--nut-dl-line-soft);box-sizing:border-box;color:var(--nut-dl-cell-fg);overflow:hidden;overflow-wrap:anywhere;padding-block:var(--nut-dl-cell-y,6px);white-space:normal}.nut-dl-td__inner{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--nut-dl-lines,3);line-clamp:var(--nut-dl-lines,3);max-height:calc(var(--nut-dl-lines, 3)*1.5em);overflow:hidden}.nut-dl-td--ellipsis{--nut-dl-lines:1;white-space:nowrap}.nut-dl-td--ellipsis .nut-dl-td__inner{display:block;text-overflow:ellipsis}.nut-dl-td--actions .nut-dl-td__inner,.nut-dl-td--selection .nut-dl-td__inner{align-items:center;display:flex}.nut-dl-td--actions,.nut-dl-td--selection{white-space:nowrap}.nut-dl-td--actions .nut-dl-td__inner>*{opacity:.55;transition:opacity .12s}.nut-dl-row:hover .nut-dl-td--actions .nut-dl-td__inner>*{opacity:1}.nut-dl-pin{position:sticky}.nut-dl-pin--first-end:before,.nut-dl-pin--last-start:after{background:var(--nut-dl-line);bottom:0;content:"";pointer-events:none;position:absolute;top:0;width:1px}.nut-dl-pin--last-start:after{right:0}.nut-dl-pin--first-end:before{left:0}.nut-dl-pin--first-end:before,.nut-dl-pin--last-start:after{background:var(--nut-dl-pin-line)}.nut-dl-td--actions.nut-dl-pin--first-end:before,.nut-dl-th--actions.nut-dl-pin--first-end:before{display:none}.nut-dl-progress th{overflow:hidden}.nut-dl-progress th span{animation:nut-dl-progress 1s ease-in-out infinite;background:linear-gradient(90deg,transparent,var(--nut-dl-accent),transparent);background-size:40% 100%;height:2px;left:0;position:absolute;right:0}@keyframes nut-dl-progress{0%{background-position:-40% 0}to{background-position:140% 0}}.nut-dl-skeleton{animation:nut-dl-shimmer 1.6s ease-in-out infinite;animation-delay:calc(var(--nut-dl-i, 0)*-90ms);background:linear-gradient(90deg,var(--ui-bg-accented) 0,var(--ui-bg-muted) 45%,var(--ui-bg-accented) 100%);background-size:200% 100%}.nut-dl-row--skeleton{animation:nut-dl-fade-in .2s ease both;animation-delay:calc(var(--nut-dl-i, 0)*18ms)}@keyframes nut-dl-fade-in{0%{opacity:0}to{opacity:1}}@keyframes nut-dl-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}.nut-dl-table[data-virtualized=true] .nut-dl-row[style*="--nut-dl-i"]{animation:nut-dl-row-in .22s cubic-bezier(.2,.9,.3,1) both;animation-delay:calc(var(--nut-dl-i)*10ms)}@keyframes nut-dl-row-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.nut-dl-row--moving{transition:transform .24s cubic-bezier(.2,.9,.3,1)}.nut-dl-row--settling{transition:opacity .18s ease,transform .24s cubic-bezier(.2,.9,.3,1)}.nut-dl-row--from{opacity:0;transform:translateY(4px)}@media (prefers-reduced-motion:reduce){.nut-dl-row,.nut-dl-row--moving,.nut-dl-row--settling{transition:none}.nut-dl-progress th span,.nut-dl-skeleton,.nut-dl-table[data-virtualized=true] .nut-dl-row[style*="--nut-dl-i"]{animation:none}}
|
|
861
|
+
);--nut-dl-accent:var(--ui-primary);--nut-dl-cell-fg:var(--nut-dl-table-cell-fg,var(--ui-text-toned));--nut-dl-pin-line:var(--nut-dl-table-pin-line,var(--nut-dl-line))}.nut-dl-table__scroll{overflow-anchor:none;scrollbar-width:none}.nut-dl-table__scroll::-webkit-scrollbar{display:none}.nut-dl-th{color:var(--nut-dl-head-fg);font-size:var(--nut-dl-head-font);font-weight:var(--nut-dl-head-weight);letter-spacing:var(--nut-dl-head-tracking);text-transform:var(--nut-dl-head-transform);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.nut-dl-table__spacer,.nut-dl-th{border-bottom:1px solid var(--nut-dl-line)}.nut-dl-table__spacer,.nut-dl-tf,.nut-dl-th{background:var(--nut-dl-head-bg);border-top:1px solid var(--nut-dl-line)}.nut-dl-tf{color:var(--ui-text-highlighted);font-weight:var(--nut-dl-table-foot-weight,500);white-space:nowrap}tfoot .nut-dl-table__spacer{border-bottom:0;border-top:1px solid var(--nut-dl-line)}.nut-dl-spinner{animation:nut-dl-spin .8s linear infinite}@keyframes nut-dl-spin{to{transform:rotate(1turn)}}tbody .nut-dl-table__spacer{background:var(--nut-dl-surface);border-bottom:1px solid var(--nut-dl-line-soft)}.nut-dl-th__btn--open{background:color-mix(in srgb,var(--nut-dl-head-fg) 8%,transparent)}.nut-dl-rz:after{background:var(--ui-border-accented);bottom:10px;content:"";opacity:0;position:absolute;right:0;top:10px;transition:opacity .12s;width:1px}.nut-dl-rz:hover:after,.nut-dl-th:hover .nut-dl-rz:after{opacity:1}.nut-dl-rz--active:after,.nut-dl-rz:hover:after{background:var(--nut-dl-accent);bottom:6px;left:2.5px;opacity:1;top:6px;width:2px}.nut-dl-row{background:var(--nut-dl-surface);transition:background-color .1s}.nut-dl-row:hover{background:var(--nut-dl-row-hover)}.nut-dl-row--selected,.nut-dl-row--selected:hover{background:var(--nut-dl-row-selected)}.nut-dl-td,.nut-dl-th__btn,.nut-dl-th__static{padding-left:var(--nut-dl-cell-l,var(--nut-dl-cell-x));padding-right:var(--nut-dl-cell-r,var(--nut-dl-cell-x))}.nut-dl-row>.nut-dl-td:first-child,.nut-dl-table__head-row>.nut-dl-th:first-child{--nut-dl-cell-l:var(--nut-dl-gutter)}.nut-dl-row>.nut-dl-td:last-child,.nut-dl-table__head-row>.nut-dl-th:last-child{--nut-dl-cell-r:var(--nut-dl-gutter)}.nut-dl-row>.nut-dl-td--actions:last-child,.nut-dl-table__head-row>.nut-dl-th--actions:last-child,.nut-dl-td--actions{--nut-dl-cell-l:var(--nut-dl-cell-x);--nut-dl-cell-r:var(--nut-dl-cell-x)}.nut-dl-td--actions .nut-dl-td__inner{justify-content:flex-end}.nut-dl-td{background:inherit;border-bottom:1px solid var(--nut-dl-line-soft);box-sizing:border-box;color:var(--nut-dl-cell-fg);overflow:hidden;overflow-wrap:anywhere;padding-block:var(--nut-dl-cell-y,6px);white-space:normal}.nut-dl-td__inner{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--nut-dl-lines,3);line-clamp:var(--nut-dl-lines,3);max-height:calc(var(--nut-dl-lines, 3)*1.5em);overflow:hidden}.nut-dl-td--ellipsis{--nut-dl-lines:1;white-space:nowrap}.nut-dl-td--ellipsis .nut-dl-td__inner{display:block;text-overflow:ellipsis}.nut-dl-td--actions .nut-dl-td__inner,.nut-dl-td--selection .nut-dl-td__inner{align-items:center;display:flex}.nut-dl-td--actions,.nut-dl-td--selection{white-space:nowrap}.nut-dl-td--actions .nut-dl-td__inner>*{opacity:.55;transition:opacity .12s}.nut-dl-row:hover .nut-dl-td--actions .nut-dl-td__inner>*{opacity:1}.nut-dl-pin{position:sticky}.nut-dl-pin--first-end:before,.nut-dl-pin--last-start:after{background:var(--nut-dl-line);bottom:0;content:"";pointer-events:none;position:absolute;top:0;width:1px}.nut-dl-pin--last-start:after{right:0}.nut-dl-pin--first-end:before{left:0}.nut-dl-pin--first-end:before,.nut-dl-pin--last-start:after{background:var(--nut-dl-pin-line)}.nut-dl-td--actions.nut-dl-pin--first-end:before,.nut-dl-th--actions.nut-dl-pin--first-end:before{display:none}.nut-dl-progress th{overflow:hidden}.nut-dl-progress th span{animation:nut-dl-progress 1s ease-in-out infinite paused;background:linear-gradient(90deg,transparent,var(--nut-dl-accent),transparent);background-size:40% 100%;height:2px;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .12s ease-out}.nut-dl-progress[data-active=true] th span{animation-play-state:running;opacity:1}@keyframes nut-dl-progress{0%{background-position:-40% 0}to{background-position:140% 0}}.nut-dl-skeleton{animation:nut-dl-shimmer 1.6s ease-in-out infinite;animation-delay:calc(var(--nut-dl-i, 0)*-90ms);background:linear-gradient(90deg,var(--ui-bg-accented) 0,var(--ui-bg-muted) 45%,var(--ui-bg-accented) 100%);background-size:200% 100%}.nut-dl-row--skeleton{animation:nut-dl-fade-in .2s ease both;animation-delay:calc(var(--nut-dl-i, 0)*18ms)}@keyframes nut-dl-fade-in{0%{opacity:0}to{opacity:1}}@keyframes nut-dl-shimmer{0%{background-position:100% 0}to{background-position:-100% 0}}.nut-dl-table[data-virtualized=true] .nut-dl-row[style*="--nut-dl-i"]{animation:nut-dl-row-in .22s cubic-bezier(.2,.9,.3,1) both;animation-delay:calc(var(--nut-dl-i)*10ms)}@keyframes nut-dl-row-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}.nut-dl-row--moving{transition:transform .24s cubic-bezier(.2,.9,.3,1)}.nut-dl-row--settling{transition:opacity .18s ease,transform .24s cubic-bezier(.2,.9,.3,1)}.nut-dl-row--from{opacity:0;transform:translateY(4px)}@media (prefers-reduced-motion:reduce){.nut-dl-row,.nut-dl-row--moving,.nut-dl-row--settling{transition:none}.nut-dl-progress th span,.nut-dl-skeleton,.nut-dl-table[data-virtualized=true] .nut-dl-row[style*="--nut-dl-i"]{animation:none}}
|
|
844
862
|
</style>
|
|
@@ -6,6 +6,7 @@ type __VLS_Props = {
|
|
|
6
6
|
fill?: boolean;
|
|
7
7
|
ui?: DataListTableUi;
|
|
8
8
|
};
|
|
9
|
+
declare function refresh(): void;
|
|
9
10
|
type ColumnSlot = {
|
|
10
11
|
kind: 'column';
|
|
11
12
|
columnId: string;
|
|
@@ -25,11 +26,16 @@ declare var __VLS_34: {
|
|
|
25
26
|
coreRowModel: (table: import("@tanstack/table-core").Table<any, any>) => () => import("@tanstack/table-core").RowModel<any, any>;
|
|
26
27
|
columnMeta: import("../../utils/index.js").DataListColumnMeta;
|
|
27
28
|
}, object, unknown>[];
|
|
28
|
-
}, __VLS_36: {
|
|
29
|
+
}, __VLS_36: {
|
|
30
|
+
error: {};
|
|
31
|
+
retry: typeof refresh;
|
|
32
|
+
}, __VLS_45: {};
|
|
29
33
|
type __VLS_Slots = {} & {
|
|
30
34
|
footer?: (props: typeof __VLS_34) => any;
|
|
31
35
|
} & {
|
|
32
|
-
|
|
36
|
+
error?: (props: typeof __VLS_36) => any;
|
|
37
|
+
} & {
|
|
38
|
+
empty?: (props: typeof __VLS_45) => any;
|
|
33
39
|
};
|
|
34
40
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
35
41
|
resetColumnSizing: () => void;
|
|
@@ -49,6 +49,7 @@ export declare function useOptionFilterEditorState(options: UseOptionFilterEdito
|
|
|
49
49
|
isStaleLoading: ComputedRef<boolean>;
|
|
50
50
|
refresh: () => Promise<[import("@tanstack/vue-query").QueryObserverResult<TableFilterOptionEntry[] | import("../types/index.js").TableFilterOptionQueryResult, Error>, import("@tanstack/vue-query").QueryObserverResult<import("../types/index.js").TableFacetExecutionResult<string, unknown>, Error>]>;
|
|
51
51
|
searchExpandedIds: ComputedRef<string[]>;
|
|
52
|
+
showCounts: ComputedRef<boolean>;
|
|
52
53
|
sourceEntries: ComputedRef<(TableResolvedFilterOptionEntry<import("../types/index.js").TableFilterPrimitiveValue> & {
|
|
53
54
|
value: string | number | boolean;
|
|
54
55
|
})[]>;
|
|
@@ -111,7 +111,7 @@ export function useOptionFilterEditorState(options) {
|
|
|
111
111
|
const flatRadioItems = computed(
|
|
112
112
|
() => displayEntries.value.map((entry) => ({
|
|
113
113
|
color: entry.color,
|
|
114
|
-
count:
|
|
114
|
+
count: optionSource.showCounts.value ? entry.count ?? 0 : void 0,
|
|
115
115
|
icon: entry.icon,
|
|
116
116
|
label: entry.label,
|
|
117
117
|
truncate: filterUi.value.row.truncate,
|
|
@@ -134,7 +134,7 @@ export function useOptionFilterEditorState(options) {
|
|
|
134
134
|
const treeRadioItems = computed(
|
|
135
135
|
() => visibleTreeEntries.value.map((entry) => ({
|
|
136
136
|
color: entry.color,
|
|
137
|
-
count:
|
|
137
|
+
count: optionSource.showCounts.value ? entry.count ?? 0 : void 0,
|
|
138
138
|
depth: entry.depth,
|
|
139
139
|
disabled: !entry.selectable,
|
|
140
140
|
expandable: entry.expandable,
|
|
@@ -23,10 +23,7 @@ export function useTableActions(options) {
|
|
|
23
23
|
context: toPlainRecord(options.queryContent.contextData.value),
|
|
24
24
|
matchingCount: options.queryContent.data.value.rowCount ?? null,
|
|
25
25
|
pageContext: toPlainRecord(options.queryContent.pageContextData.value),
|
|
26
|
-
request:
|
|
27
|
-
...options.queryContent.requestContext.value,
|
|
28
|
-
context: toPlainRecord(options.queryContent.requestContext.value.context)
|
|
29
|
-
},
|
|
26
|
+
request: options.queryContent.sourceRequest.value,
|
|
30
27
|
scope: options.selection.bulkScope.value,
|
|
31
28
|
selectedRows: options.selection.selectedRows.value
|
|
32
29
|
}));
|
|
@@ -54,9 +51,17 @@ export function useTableActions(options) {
|
|
|
54
51
|
if (!definition.action) {
|
|
55
52
|
return;
|
|
56
53
|
}
|
|
54
|
+
const actionContext = context.value;
|
|
57
55
|
runningKeys.value = [...runningKeys.value, definition.key];
|
|
56
|
+
const selectionClear = "selectionClear" in definition ? definition.selectionClear ?? "never" : "never";
|
|
57
|
+
if (selectionClear === "trigger") {
|
|
58
|
+
selectionApi.clear();
|
|
59
|
+
}
|
|
58
60
|
try {
|
|
59
|
-
await definition.action(
|
|
61
|
+
await definition.action(actionContext);
|
|
62
|
+
if (selectionClear === "success") {
|
|
63
|
+
selectionApi.clear();
|
|
64
|
+
}
|
|
60
65
|
} finally {
|
|
61
66
|
runningKeys.value = runningKeys.value.filter((key) => key !== definition.key);
|
|
62
67
|
}
|
|
@@ -43,7 +43,10 @@ export function useTableApi(params) {
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
const layoutApi = {
|
|
46
|
-
set
|
|
46
|
+
set(layout) {
|
|
47
|
+
params.controls.setTableLayout(layout);
|
|
48
|
+
params.columns.setSorting(getDefaultSort({ layout, schema: params.runtimeSchema.value }));
|
|
49
|
+
},
|
|
47
50
|
state: params.controls.layoutState
|
|
48
51
|
};
|
|
49
52
|
const filters = {
|
|
@@ -74,7 +74,9 @@ export declare function useTableColumns(params: UseTableColumnsParams): {
|
|
|
74
74
|
original: import("../types/index.js").GenericObject;
|
|
75
75
|
index: number;
|
|
76
76
|
};
|
|
77
|
-
}) => import("vue
|
|
77
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
78
|
+
[key: string]: any;
|
|
79
|
+
}>;
|
|
78
80
|
enableHiding: boolean;
|
|
79
81
|
enablePinning: boolean;
|
|
80
82
|
enableResizing: boolean;
|
|
@@ -107,7 +109,9 @@ export declare function useTableColumns(params: UseTableColumnsParams): {
|
|
|
107
109
|
original: import("../types/index.js").GenericObject;
|
|
108
110
|
index: number;
|
|
109
111
|
};
|
|
110
|
-
}) => import("vue
|
|
112
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
113
|
+
[key: string]: any;
|
|
114
|
+
}>;
|
|
111
115
|
enableHiding: boolean;
|
|
112
116
|
enablePinning: boolean;
|
|
113
117
|
enableResizing: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useInfiniteQuery, useQueries, useQuery } from '@tanstack/vue-query';
|
|
2
2
|
import type { ComputedRef } from 'vue';
|
|
3
|
-
import type { GenericObject, TableExternalState, TableFacetExecutionResult, TableSchemaView, TableSourceRequestContext, TableRefreshResult, TableRuntimeRecord } from '../types/index.js';
|
|
3
|
+
import type { GenericObject, TableExternalState, TableFacetExecutionResult, TableRemoteSourceRequest, TableSchemaView, TableSourceRequestContext, TableRefreshResult, TableRuntimeRecord } from '../types/index.js';
|
|
4
4
|
import type { UseTableStartupReturn } from './use-table-startup.js';
|
|
5
5
|
import type { useTableState } from './use-table-state.js';
|
|
6
6
|
export interface UseTableDataParams {
|
|
@@ -19,6 +19,7 @@ export interface UseTableDataReturn {
|
|
|
19
19
|
context: TableRuntimeRecord;
|
|
20
20
|
}>;
|
|
21
21
|
requestContext: ComputedRef<TableSourceRequestContext>;
|
|
22
|
+
sourceRequest: ComputedRef<TableRemoteSourceRequest>;
|
|
22
23
|
searchParams: ComputedRef<TableSourceRequestContext>;
|
|
23
24
|
query: ReturnType<typeof useQuery>;
|
|
24
25
|
infiniteQuery: ReturnType<typeof useInfiniteQuery>;
|
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
isTableCursorPageResult,
|
|
12
12
|
paginateClientRows,
|
|
13
13
|
resolveTableRowId,
|
|
14
|
-
sortClientRows
|
|
14
|
+
sortClientRows,
|
|
15
|
+
toTableRemoteSourceRequest
|
|
15
16
|
} from "../utils/index.js";
|
|
16
17
|
export function useTableData(params) {
|
|
17
18
|
const contextItems = computed(
|
|
@@ -79,6 +80,7 @@ export function useTableData(params) {
|
|
|
79
80
|
search: requestSearch.value,
|
|
80
81
|
sorting: requestSorting.value
|
|
81
82
|
}));
|
|
83
|
+
const sourceRequest = computed(() => toTableRemoteSourceRequest(requestContext.value));
|
|
82
84
|
const searchParams = requestContext;
|
|
83
85
|
const dataStaleTime = computed(() => QUERY_DEFAULTS.staleTime.data);
|
|
84
86
|
const isCursorPagination = computed(() => requestPagination.value.mode === "cursor");
|
|
@@ -87,6 +89,7 @@ export function useTableData(params) {
|
|
|
87
89
|
const definition = resolveSourceDefinition({
|
|
88
90
|
context: contextData.value,
|
|
89
91
|
request: requestContext.value,
|
|
92
|
+
sourceRequest: sourceRequest.value,
|
|
90
93
|
source: params.schema.value.source
|
|
91
94
|
});
|
|
92
95
|
if (isCursorPagination.value) {
|
|
@@ -108,6 +111,7 @@ export function useTableData(params) {
|
|
|
108
111
|
createCursorQueryDefinition({
|
|
109
112
|
context: contextData.value,
|
|
110
113
|
request: requestContext.value,
|
|
114
|
+
sourceRequest: sourceRequest.value,
|
|
111
115
|
revision: params.state.queryState.paginationRevision.value,
|
|
112
116
|
source: params.schema.value.source
|
|
113
117
|
}),
|
|
@@ -351,6 +355,9 @@ export function useTableData(params) {
|
|
|
351
355
|
watch(
|
|
352
356
|
() => query.data.value,
|
|
353
357
|
(nextQueryData) => {
|
|
358
|
+
if (nextQueryData === void 0 && query.isError.value) {
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
354
361
|
const normalized = normalizeExternalState(nextQueryData);
|
|
355
362
|
if (sameExternalState(rawDataState.value, normalized)) {
|
|
356
363
|
return;
|
|
@@ -448,6 +455,7 @@ export function useTableData(params) {
|
|
|
448
455
|
refreshData,
|
|
449
456
|
refreshPageContext,
|
|
450
457
|
requestContext,
|
|
458
|
+
sourceRequest,
|
|
451
459
|
searchParams,
|
|
452
460
|
selectableRows,
|
|
453
461
|
status,
|
|
@@ -558,7 +566,7 @@ function isRemoteFacetQuery(value) {
|
|
|
558
566
|
return isFunction(value);
|
|
559
567
|
}
|
|
560
568
|
function resolveSourceDefinition(options) {
|
|
561
|
-
return options.source.query({ ...options.request, context: options.context });
|
|
569
|
+
return options.source.mode === "remote" ? options.source.query(options.sourceRequest, options.context) : options.source.query({ ...options.request, context: options.context });
|
|
562
570
|
}
|
|
563
571
|
function createCursorQueryDefinition(options) {
|
|
564
572
|
const firstPageDefinition = resolveSourceDefinition(options);
|
|
@@ -583,6 +591,15 @@ function createCursorQueryDefinition(options) {
|
|
|
583
591
|
mode: "cursor",
|
|
584
592
|
pageSize: pagination.pageSize
|
|
585
593
|
}
|
|
594
|
+
},
|
|
595
|
+
sourceRequest: {
|
|
596
|
+
...options.sourceRequest,
|
|
597
|
+
pagination: {
|
|
598
|
+
count: pagination.count,
|
|
599
|
+
cursor: queryContext.pageParam,
|
|
600
|
+
mode: "cursor",
|
|
601
|
+
pageSize: pagination.pageSize
|
|
602
|
+
}
|
|
586
603
|
}
|
|
587
604
|
});
|
|
588
605
|
if (!definition.queryFn) {
|
|
@@ -24,6 +24,7 @@ export declare function useTableFilterOptions(options: UseTableFilterOptionsPara
|
|
|
24
24
|
isStaleLoading: ComputedRef<boolean>;
|
|
25
25
|
refresh: () => Promise<[import("@tanstack/vue-query").QueryObserverResult<TableFilterOptionEntry[] | TableFilterOptionQueryResult, Error>, import("@tanstack/vue-query").QueryObserverResult<TableFacetExecutionResult<string, unknown>, Error>]>;
|
|
26
26
|
searchExpandedIds: ComputedRef<string[]>;
|
|
27
|
+
showCounts: ComputedRef<boolean>;
|
|
27
28
|
sourceEntries: ComputedRef<(TableResolvedFilterOptionEntry<import("../types/index.js").TableFilterPrimitiveValue> & {
|
|
28
29
|
value: string | number | boolean;
|
|
29
30
|
})[]>;
|
|
@@ -184,7 +184,7 @@ export function useTableFilterOptions(options) {
|
|
|
184
184
|
() => resolveFilterOptionEntries({
|
|
185
185
|
definition: options.definition,
|
|
186
186
|
deriveCounts: false,
|
|
187
|
-
facetCounts:
|
|
187
|
+
facetCounts: resolvedFacetCounts.value,
|
|
188
188
|
missingCountFallback: shouldResolveCounts.value && usesFacetCounts.value ? 0 : void 0,
|
|
189
189
|
options: hasRemoteOptionQuery.value ? remoteEntries.value : staticEntries.value,
|
|
190
190
|
rows: [],
|
|
@@ -253,6 +253,7 @@ export function useTableFilterOptions(options) {
|
|
|
253
253
|
isStaleLoading,
|
|
254
254
|
refresh: () => Promise.all([optionQuery.refetch(), perFilterFacetQuery.refetch()]),
|
|
255
255
|
searchExpandedIds: computed(() => filteredTreeState.value.expandedIds),
|
|
256
|
+
showCounts: computed(() => shouldDeriveCounts.value && usesFacetCounts.value),
|
|
256
257
|
sourceEntries: selectableSourceEntries,
|
|
257
258
|
sourceTreeEntries: resolvedSourceTreeEntries
|
|
258
259
|
};
|
|
@@ -461,7 +461,9 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
461
461
|
original: import("../types/index.js").GenericObject;
|
|
462
462
|
index: number;
|
|
463
463
|
};
|
|
464
|
-
}) => import("vue
|
|
464
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
465
|
+
[key: string]: any;
|
|
466
|
+
}>;
|
|
465
467
|
enableHiding: boolean;
|
|
466
468
|
enablePinning: boolean;
|
|
467
469
|
enableResizing: boolean;
|
|
@@ -494,7 +496,9 @@ declare function createTableInternals<TSchema>(options: {
|
|
|
494
496
|
original: import("../types/index.js").GenericObject;
|
|
495
497
|
index: number;
|
|
496
498
|
};
|
|
497
|
-
}) => import("vue
|
|
499
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
500
|
+
[key: string]: any;
|
|
501
|
+
}>;
|
|
498
502
|
enableHiding: boolean;
|
|
499
503
|
enablePinning: boolean;
|
|
500
504
|
enableResizing: boolean;
|
|
@@ -1048,7 +1052,9 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
1048
1052
|
original: import("../types/index.js").GenericObject;
|
|
1049
1053
|
index: number;
|
|
1050
1054
|
};
|
|
1051
|
-
}) => import("vue
|
|
1055
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1056
|
+
[key: string]: any;
|
|
1057
|
+
}>;
|
|
1052
1058
|
enableHiding: boolean;
|
|
1053
1059
|
enablePinning: boolean;
|
|
1054
1060
|
enableResizing: boolean;
|
|
@@ -1081,7 +1087,9 @@ declare function useProvideTableInternals<TSchema>(options: {
|
|
|
1081
1087
|
original: import("../types/index.js").GenericObject;
|
|
1082
1088
|
index: number;
|
|
1083
1089
|
};
|
|
1084
|
-
}) => import("vue
|
|
1090
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1091
|
+
[key: string]: any;
|
|
1092
|
+
}>;
|
|
1085
1093
|
enableHiding: boolean;
|
|
1086
1094
|
enablePinning: boolean;
|
|
1087
1095
|
enableResizing: boolean;
|
|
@@ -1632,7 +1640,9 @@ declare function useTableInternals(): {
|
|
|
1632
1640
|
original: import("../types/index.js").GenericObject;
|
|
1633
1641
|
index: number;
|
|
1634
1642
|
};
|
|
1635
|
-
}) => import("vue
|
|
1643
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1644
|
+
[key: string]: any;
|
|
1645
|
+
}>;
|
|
1636
1646
|
enableHiding: boolean;
|
|
1637
1647
|
enablePinning: boolean;
|
|
1638
1648
|
enableResizing: boolean;
|
|
@@ -1665,7 +1675,9 @@ declare function useTableInternals(): {
|
|
|
1665
1675
|
original: import("../types/index.js").GenericObject;
|
|
1666
1676
|
index: number;
|
|
1667
1677
|
};
|
|
1668
|
-
}) => import("vue
|
|
1678
|
+
}) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
1679
|
+
[key: string]: any;
|
|
1680
|
+
}>;
|
|
1669
1681
|
enableHiding: boolean;
|
|
1670
1682
|
enablePinning: boolean;
|
|
1671
1683
|
enableResizing: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DropdownMenuItem } from '@nuxt/ui/components/DropdownMenu.vue';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TableRemoteSourceRequest } from './source.js';
|
|
3
3
|
import type { TableApi } from './table-api.js';
|
|
4
4
|
import type { GenericObject, MaybePromise, TableLayout, TableRowRenderParams, TableTextValue } from './utils.js';
|
|
5
5
|
export interface TableActionContext<TRow extends GenericObject = GenericObject, TContext extends GenericObject = GenericObject, TPageContext extends GenericObject = GenericObject> {
|
|
@@ -10,7 +10,7 @@ export interface TableActionContext<TRow extends GenericObject = GenericObject,
|
|
|
10
10
|
matchingCount: number | null;
|
|
11
11
|
context: TContext;
|
|
12
12
|
pageContext: TPageContext;
|
|
13
|
-
request:
|
|
13
|
+
request: TableRemoteSourceRequest<TRow>;
|
|
14
14
|
}
|
|
15
15
|
export interface TableToolbarAction<TRow extends GenericObject = GenericObject, TContext extends GenericObject = GenericObject, TPageContext extends GenericObject = GenericObject> extends Omit<DropdownMenuItem, 'children' | 'disabled' | 'loading' | 'label' | 'onSelect'> {
|
|
16
16
|
key: string;
|
|
@@ -22,6 +22,7 @@ export interface TableToolbarAction<TRow extends GenericObject = GenericObject,
|
|
|
22
22
|
}
|
|
23
23
|
export interface TableBulkAction<TRow extends GenericObject = GenericObject, TContext extends GenericObject = GenericObject, TPageContext extends GenericObject = GenericObject> extends TableToolbarAction<TRow, TContext, TPageContext> {
|
|
24
24
|
requiresSelection?: boolean;
|
|
25
|
+
selectionClear?: 'trigger' | 'success' | 'never';
|
|
25
26
|
}
|
|
26
27
|
/** Runtime state exposed for a configured toolbar or bulk action. */
|
|
27
28
|
export interface TableActionState {
|
|
@@ -4,7 +4,15 @@ import type { CheckboxProps } from '@nuxt/ui/components/Checkbox.vue';
|
|
|
4
4
|
import type { InputProps } from '@nuxt/ui/components/Input.vue';
|
|
5
5
|
import type { PaginationProps } from '@nuxt/ui/components/Pagination.vue';
|
|
6
6
|
import type { SelectProps } from '@nuxt/ui/components/Select.vue';
|
|
7
|
+
import type { ComputedRef } from 'vue';
|
|
8
|
+
import type { TableInternals } from '../composables/use-table-internals.js';
|
|
7
9
|
import type { TableLayout } from './utils.js';
|
|
10
|
+
export interface DataListTable {
|
|
11
|
+
schema: ComputedRef<{
|
|
12
|
+
tableKey: string;
|
|
13
|
+
}>;
|
|
14
|
+
__internals: TableInternals;
|
|
15
|
+
}
|
|
8
16
|
export type DataListDensity = 'compact' | 'default' | 'comfortable';
|
|
9
17
|
export type DataListControlSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
10
18
|
/** Controls whether a granular content part owns its table boundary. */
|