nuxt-ui-tools 1.23.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.mts +3 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +8 -0
- package/dist/runtime/display/components/blocks/display-accordion.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-accordion.vue +93 -0
- package/dist/runtime/display/components/blocks/display-accordion.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-alert.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-alert.vue +133 -0
- package/dist/runtime/display/components/blocks/display-alert.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-breakdown.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-breakdown.vue +178 -0
- package/dist/runtime/display/components/blocks/display-breakdown.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-chart.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-chart.vue +237 -0
- package/dist/runtime/display/components/blocks/display-chart.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-code.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-code.vue +143 -0
- package/dist/runtime/display/components/blocks/display-code.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-date.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-date.vue +174 -0
- package/dist/runtime/display/components/blocks/display-date.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-diff.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-diff.vue +142 -0
- package/dist/runtime/display/components/blocks/display-diff.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-empty.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-empty.vue +74 -0
- package/dist/runtime/display/components/blocks/display-empty.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-facts.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-facts.vue +180 -0
- package/dist/runtime/display/components/blocks/display-facts.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-heading.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-heading.vue +96 -0
- package/dist/runtime/display/components/blocks/display-heading.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-list.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-list.vue +295 -0
- package/dist/runtime/display/components/blocks/display-list.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-media.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-media.vue +326 -0
- package/dist/runtime/display/components/blocks/display-media.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-meter.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-meter.vue +301 -0
- package/dist/runtime/display/components/blocks/display-meter.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-person.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-person.vue +146 -0
- package/dist/runtime/display/components/blocks/display-person.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-record.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-record.vue +208 -0
- package/dist/runtime/display/components/blocks/display-record.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-stat.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-stat.vue +178 -0
- package/dist/runtime/display/components/blocks/display-stat.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-table.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-table.vue +132 -0
- package/dist/runtime/display/components/blocks/display-table.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-text.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-text.vue +135 -0
- package/dist/runtime/display/components/blocks/display-text.vue.d.ts +4 -0
- package/dist/runtime/display/components/blocks/display-timeline.d.vue.ts +4 -0
- package/dist/runtime/display/components/blocks/display-timeline.vue +232 -0
- package/dist/runtime/display/components/blocks/display-timeline.vue.d.ts +4 -0
- package/dist/runtime/display/components/display.d.vue.ts +24 -0
- package/dist/runtime/display/components/display.vue +21 -0
- package/dist/runtime/display/components/display.vue.d.ts +24 -0
- package/dist/runtime/display/components/parts/display-actions.d.vue.ts +9 -0
- package/dist/runtime/display/components/parts/display-actions.vue +24 -0
- package/dist/runtime/display/components/parts/display-actions.vue.d.ts +9 -0
- package/dist/runtime/display/components/parts/display-chip.d.vue.ts +11 -0
- package/dist/runtime/display/components/parts/display-chip.vue +45 -0
- package/dist/runtime/display/components/parts/display-chip.vue.d.ts +11 -0
- package/dist/runtime/display/components/parts/display-copy.d.vue.ts +6 -0
- package/dist/runtime/display/components/parts/display-copy.vue +27 -0
- package/dist/runtime/display/components/parts/display-copy.vue.d.ts +6 -0
- package/dist/runtime/display/components/parts/display-empty-line.d.vue.ts +7 -0
- package/dist/runtime/display/components/parts/display-empty-line.vue +21 -0
- package/dist/runtime/display/components/parts/display-empty-line.vue.d.ts +7 -0
- package/dist/runtime/display/components/parts/display-fact-value.d.vue.ts +7 -0
- package/dist/runtime/display/components/parts/display-fact-value.vue +35 -0
- package/dist/runtime/display/components/parts/display-fact-value.vue.d.ts +7 -0
- package/dist/runtime/display/components/parts/display-load-error.d.vue.ts +7 -0
- package/dist/runtime/display/components/parts/display-load-error.vue +29 -0
- package/dist/runtime/display/components/parts/display-load-error.vue.d.ts +7 -0
- package/dist/runtime/display/components/parts/display-more.d.vue.ts +10 -0
- package/dist/runtime/display/components/parts/display-more.vue +23 -0
- package/dist/runtime/display/components/parts/display-more.vue.d.ts +10 -0
- package/dist/runtime/display/components/parts/display-record-media.d.vue.ts +9 -0
- package/dist/runtime/display/components/parts/display-record-media.vue +59 -0
- package/dist/runtime/display/components/parts/display-record-media.vue.d.ts +9 -0
- package/dist/runtime/display/components/parts/display-render.d.ts +10 -0
- package/dist/runtime/display/components/parts/display-render.js +5 -0
- package/dist/runtime/display/components/parts/display-skeleton.d.vue.ts +7 -0
- package/dist/runtime/display/components/parts/display-skeleton.vue +67 -0
- package/dist/runtime/display/components/parts/display-skeleton.vue.d.ts +7 -0
- package/dist/runtime/display/composables/use-display-config.d.ts +6 -0
- package/dist/runtime/display/composables/use-display-config.js +11 -0
- package/dist/runtime/display/composables/use-display-file-preview.d.ts +9 -0
- package/dist/runtime/display/composables/use-display-file-preview.js +11 -0
- package/dist/runtime/display/composables/use-display-icons.d.ts +8 -0
- package/dist/runtime/display/composables/use-display-icons.js +62 -0
- package/dist/runtime/display/composables/use-display-locale.d.ts +5 -0
- package/dist/runtime/display/composables/use-display-locale.js +5 -0
- package/dist/runtime/display/composables/use-display-number.d.ts +2 -0
- package/dist/runtime/display/composables/use-display-number.js +7 -0
- package/dist/runtime/display/composables/use-display-reveal.d.ts +14 -0
- package/dist/runtime/display/composables/use-display-reveal.js +15 -0
- package/dist/runtime/display/composables/use-display-url.d.ts +26 -0
- package/dist/runtime/display/composables/use-display-url.js +46 -0
- package/dist/runtime/display/index.d.ts +4 -0
- package/dist/runtime/display/index.js +3 -0
- package/dist/runtime/display/plugins/display-tones.d.ts +3 -0
- package/dist/runtime/display/plugins/display-tones.js +17 -0
- package/dist/runtime/display/types/blocks/accordion.d.ts +18 -0
- package/dist/runtime/display/types/blocks/accordion.js +0 -0
- package/dist/runtime/display/types/blocks/alert.d.ts +31 -0
- package/dist/runtime/display/types/blocks/alert.js +0 -0
- package/dist/runtime/display/types/blocks/breakdown.d.ts +36 -0
- package/dist/runtime/display/types/blocks/breakdown.js +0 -0
- package/dist/runtime/display/types/blocks/chart.d.ts +23 -0
- package/dist/runtime/display/types/blocks/chart.js +0 -0
- package/dist/runtime/display/types/blocks/code.d.ts +21 -0
- package/dist/runtime/display/types/blocks/code.js +0 -0
- package/dist/runtime/display/types/blocks/date.d.ts +27 -0
- package/dist/runtime/display/types/blocks/date.js +0 -0
- package/dist/runtime/display/types/blocks/diff.d.ts +20 -0
- package/dist/runtime/display/types/blocks/diff.js +0 -0
- package/dist/runtime/display/types/blocks/empty.d.ts +13 -0
- package/dist/runtime/display/types/blocks/empty.js +0 -0
- package/dist/runtime/display/types/blocks/facts.d.ts +50 -0
- package/dist/runtime/display/types/blocks/facts.js +0 -0
- package/dist/runtime/display/types/blocks/heading.d.ts +19 -0
- package/dist/runtime/display/types/blocks/heading.js +0 -0
- package/dist/runtime/display/types/blocks/list.d.ts +36 -0
- package/dist/runtime/display/types/blocks/list.js +0 -0
- package/dist/runtime/display/types/blocks/media.d.ts +42 -0
- package/dist/runtime/display/types/blocks/media.js +0 -0
- package/dist/runtime/display/types/blocks/meter.d.ts +48 -0
- package/dist/runtime/display/types/blocks/meter.js +0 -0
- package/dist/runtime/display/types/blocks/person.d.ts +32 -0
- package/dist/runtime/display/types/blocks/person.js +0 -0
- package/dist/runtime/display/types/blocks/record.d.ts +42 -0
- package/dist/runtime/display/types/blocks/record.js +0 -0
- package/dist/runtime/display/types/blocks/stat.d.ts +44 -0
- package/dist/runtime/display/types/blocks/stat.js +0 -0
- package/dist/runtime/display/types/blocks/table.d.ts +28 -0
- package/dist/runtime/display/types/blocks/table.js +0 -0
- package/dist/runtime/display/types/blocks/text.d.ts +22 -0
- package/dist/runtime/display/types/blocks/text.js +0 -0
- package/dist/runtime/display/types/blocks/timeline.d.ts +37 -0
- package/dist/runtime/display/types/blocks/timeline.js +0 -0
- package/dist/runtime/display/types/config.d.ts +53 -0
- package/dist/runtime/display/types/config.js +0 -0
- package/dist/runtime/display/types/index.d.ts +22 -0
- package/dist/runtime/display/types/index.js +0 -0
- package/dist/runtime/display/types/registry.d.ts +57 -0
- package/dist/runtime/display/types/registry.js +0 -0
- package/dist/runtime/display/types/shared.d.ts +71 -0
- package/dist/runtime/display/types/shared.js +0 -0
- package/dist/runtime/display/utils/classes.d.ts +3 -0
- package/dist/runtime/display/utils/classes.js +7 -0
- package/dist/runtime/display/utils/config.d.ts +6 -0
- package/dist/runtime/display/utils/config.js +7 -0
- package/dist/runtime/display/utils/content.d.ts +7 -0
- package/dist/runtime/display/utils/content.js +13 -0
- package/dist/runtime/display/utils/dates.d.ts +16 -0
- package/dist/runtime/display/utils/dates.js +34 -0
- package/dist/runtime/display/utils/json.d.ts +7 -0
- package/dist/runtime/display/utils/json.js +15 -0
- package/dist/runtime/display/utils/meter.d.ts +7 -0
- package/dist/runtime/display/utils/meter.js +13 -0
- package/dist/runtime/display/utils/registry.d.ts +47 -0
- package/dist/runtime/display/utils/registry.js +64 -0
- package/dist/runtime/display/utils/tone-css.d.ts +7 -0
- package/dist/runtime/display/utils/tone-css.js +38 -0
- package/dist/runtime/display/utils/tone.d.ts +26 -0
- package/dist/runtime/display/utils/tone.js +38 -0
- package/dist/runtime/display/utils/urls.d.ts +10 -0
- package/dist/runtime/display/utils/urls.js +33 -0
- package/dist/runtime/file-preview/components/shell/file-preview-stage.vue +5 -3
- package/dist/runtime/file-preview/composables/use-file-preview-source.d.ts +7 -0
- package/dist/runtime/file-preview/composables/use-file-preview-source.js +7 -1
- package/dist/runtime/file-preview/index.d.ts +1 -0
- package/dist/runtime/file-preview/index.js +1 -0
- package/dist/runtime/file-preview/types/file.d.ts +9 -0
- package/dist/runtime/file-preview/utils/errors.d.ts +30 -0
- package/dist/runtime/file-preview/utils/errors.js +26 -0
- package/dist/runtime/form/components/utils/form-file-preview.vue +7 -2
- package/dist/runtime/form/composables/use-form-root.js +2 -0
- package/dist/runtime/form/composables/use-form-runtime.js +7 -2
- package/dist/runtime/form/fields/index.d.ts +5 -0
- package/dist/runtime/form/fields/info/component.vue +51 -19
- package/dist/runtime/form/fields/info/config.d.ts +5 -0
- package/dist/runtime/form/fields/info/config.js +2 -1
- package/dist/runtime/form/fields/info/types.d.ts +78 -4
- package/dist/runtime/form/fields/info/use-info-display.d.ts +20 -0
- package/dist/runtime/form/fields/info/use-info-display.js +82 -0
- package/dist/runtime/form/fields/upload/upload-item.vue +10 -2
- package/dist/runtime/form/types/api.d.ts +6 -0
- package/dist/runtime/form/types/runtime.d.ts +2 -0
- package/dist/runtime/form/utils/dynamic.d.ts +6 -0
- package/dist/runtime/form/utils/dynamic.js +7 -0
- package/dist/runtime/i18n/locales/en.js +32 -0
- package/dist/runtime/i18n/locales/fr.js +32 -0
- package/dist/runtime/i18n/types.d.ts +40 -0
- package/dist/runtime/shared/styles/tokens.css +1 -1
- package/dist/runtime/shared/utils/file.d.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-root.vue +2 -0
- package/dist/runtime/table/components/data-list/data-list-selection-actions.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-selection-actions.vue +32 -5
- package/dist/runtime/table/components/data-list/data-list-selection-actions.vue.d.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-selection-sheet.d.vue.ts +10 -0
- package/dist/runtime/table/components/data-list/data-list-selection-sheet.vue +238 -0
- package/dist/runtime/table/components/data-list/data-list-selection-sheet.vue.d.ts +10 -0
- package/dist/runtime/table/components/grid/grid-renderer.vue +2 -0
- package/dist/runtime/table/components/summary/summary-renderer.vue +2 -0
- package/dist/runtime/table/components/table/table-renderer.vue +2 -0
- package/dist/runtime/table/components/utils/overlay-inset-spacer.d.vue.ts +3 -0
- package/dist/runtime/table/components/utils/overlay-inset-spacer.vue +13 -0
- package/dist/runtime/table/components/utils/overlay-inset-spacer.vue.d.ts +3 -0
- package/dist/runtime/table/composables/use-data-list-overlay-inset.d.ts +10 -0
- package/dist/runtime/table/composables/use-data-list-overlay-inset.js +11 -0
- package/dist/runtime/table/composables/use-table-actions.js +11 -2
- package/dist/runtime/table/constants/mobile.d.ts +0 -7
- package/dist/runtime/table/constants/mobile.js +0 -1
- package/dist/runtime/table/types/actions.d.ts +7 -0
- package/dist/runtime/table/types/data-list.d.ts +8 -1
- package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
- package/package.json +16 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DataListSelectionActionsProps, DataListSelectionActionsUi } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Shows the selection / all-results scope switch at the top of the sheet. */
|
|
4
|
+
scope: boolean;
|
|
5
|
+
ui: DataListSelectionActionsUi;
|
|
6
|
+
controls: DataListSelectionActionsProps;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -11,6 +11,7 @@ import { mergeDataListUiClass, resolveTableRowId } from "../../utils";
|
|
|
11
11
|
import DataListErrorState from "../data-list/data-list-error-state.vue";
|
|
12
12
|
import ProgressLine from "../layout/progress-line.vue";
|
|
13
13
|
import TableEmptyState from "../table/table-empty-state.vue";
|
|
14
|
+
import OverlayInsetSpacer from "../utils/overlay-inset-spacer.vue";
|
|
14
15
|
import GridCard from "./grid-card.vue";
|
|
15
16
|
import GridSkeleton from "./grid-skeleton.vue";
|
|
16
17
|
const props = defineProps({
|
|
@@ -283,6 +284,7 @@ function refreshData() {
|
|
|
283
284
|
<GridCard :row-index="index" />
|
|
284
285
|
</div>
|
|
285
286
|
</div>
|
|
287
|
+
<OverlayInsetSpacer />
|
|
286
288
|
</div>
|
|
287
289
|
|
|
288
290
|
<div
|
|
@@ -19,6 +19,7 @@ import DataListErrorState from "../data-list/data-list-error-state.vue";
|
|
|
19
19
|
import ProgressLine from "../layout/progress-line.vue";
|
|
20
20
|
import TableEmptyState from "../table/table-empty-state.vue";
|
|
21
21
|
import TableSelectionControl from "../table/table-selection-control.vue";
|
|
22
|
+
import OverlayInsetSpacer from "../utils/overlay-inset-spacer.vue";
|
|
22
23
|
import SummaryRow from "./summary-row.vue";
|
|
23
24
|
const props = defineProps({
|
|
24
25
|
height: { type: String, required: false },
|
|
@@ -265,6 +266,7 @@ watch(
|
|
|
265
266
|
<span>{{ t("table.controls.loadingMore") }}</span>
|
|
266
267
|
</li>
|
|
267
268
|
</ul>
|
|
269
|
+
<OverlayInsetSpacer />
|
|
268
270
|
</div>
|
|
269
271
|
|
|
270
272
|
<ProgressLine
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from "../../utils/tree";
|
|
24
24
|
import DataListErrorState from "../data-list/data-list-error-state.vue";
|
|
25
25
|
import ProgressLine from "../layout/progress-line.vue";
|
|
26
|
+
import OverlayInsetSpacer from "../utils/overlay-inset-spacer.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";
|
|
@@ -921,6 +922,7 @@ defineExpose({ resetColumnSizing });
|
|
|
921
922
|
/>
|
|
922
923
|
</slot>
|
|
923
924
|
</div>
|
|
925
|
+
<OverlayInsetSpacer />
|
|
924
926
|
</div>
|
|
925
927
|
<ProgressLine
|
|
926
928
|
:active="refreshing"
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useDataListOverlayInset } from "../../composables/use-data-list-overlay-inset";
|
|
3
|
+
const inset = useDataListOverlayInset();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<div
|
|
8
|
+
v-if="inset?.bottom.value"
|
|
9
|
+
class="nut-dl-overlay-inset shrink-0"
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
:style="{ height: `${inset.bottom.value}px` }"
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shares the height a floating part, such as the mobile selection bar, covers at the bottom of the
|
|
3
|
+
* list, so the scroll areas can end with as much room and their last row scrolls above it.
|
|
4
|
+
*/
|
|
5
|
+
export declare function provideDataListOverlayInset(): {
|
|
6
|
+
bottom: import("vue").Ref<number, number>;
|
|
7
|
+
};
|
|
8
|
+
export declare function useDataListOverlayInset(): {
|
|
9
|
+
bottom: import("vue").Ref<number, number>;
|
|
10
|
+
} | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createInjectionState } from "@vueuse/core";
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
const [provideDataListOverlayInsetState, useInjectedDataListOverlayInset] = createInjectionState(
|
|
4
|
+
() => ({ bottom: ref(0) })
|
|
5
|
+
);
|
|
6
|
+
export function provideDataListOverlayInset() {
|
|
7
|
+
return provideDataListOverlayInsetState();
|
|
8
|
+
}
|
|
9
|
+
export function useDataListOverlayInset() {
|
|
10
|
+
return useInjectedDataListOverlayInset();
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, ref } from "vue";
|
|
2
2
|
import { isRecord } from "../../shared/utils/path.js";
|
|
3
3
|
import { isFunction } from "../../shared/utils/predicate.js";
|
|
4
|
-
import { resolveTableActionDefinitions } from "../utils/actions.js";
|
|
4
|
+
import { resolveTableActionDefinitions, resolveTableActionLabel } from "../utils/actions.js";
|
|
5
5
|
export function useTableActions(options) {
|
|
6
6
|
const runningKeys = ref([]);
|
|
7
7
|
const tableApi = options.tableApi.value;
|
|
@@ -37,12 +37,15 @@ export function useTableActions(options) {
|
|
|
37
37
|
const disabled = resolveFlag(definition.disabled, actionContext);
|
|
38
38
|
const loading = resolveFlag(definition.loading, actionContext);
|
|
39
39
|
const requiresSelection = "requiresSelection" in definition && definition.requiresSelection;
|
|
40
|
-
|
|
40
|
+
const state = {
|
|
41
41
|
disabled: disabled || Boolean(requiresSelection && !actionContext.selectedRows.length),
|
|
42
42
|
loading,
|
|
43
43
|
running: isRunning(definition.key),
|
|
44
44
|
visible: condition
|
|
45
45
|
};
|
|
46
|
+
const reason = disabled ? resolveReason(definition.disabledReason, actionContext) : void 0;
|
|
47
|
+
if (reason) state.disabledReason = reason;
|
|
48
|
+
return state;
|
|
46
49
|
}
|
|
47
50
|
async function execute(definition) {
|
|
48
51
|
const state = resolveState(definition);
|
|
@@ -110,6 +113,12 @@ export function useTableActions(options) {
|
|
|
110
113
|
function resolveCondition(value, context) {
|
|
111
114
|
return isBooleanResolver(value) ? value(context) : value ?? true;
|
|
112
115
|
}
|
|
116
|
+
function resolveReason(value, context) {
|
|
117
|
+
return resolveTableActionLabel(isReasonResolver(value) ? value(context) : value);
|
|
118
|
+
}
|
|
119
|
+
function isReasonResolver(value) {
|
|
120
|
+
return isFunction(value);
|
|
121
|
+
}
|
|
113
122
|
function resolveFlag(value, context) {
|
|
114
123
|
return isBooleanResolver(value) ? value(context) : value ?? false;
|
|
115
124
|
}
|
|
@@ -52,13 +52,6 @@ export declare const DATA_LIST_MOBILE_DEFAULTS: {
|
|
|
52
52
|
readonly clear: "min-h-11 min-w-11";
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
readonly selectionActions: {
|
|
56
|
-
readonly ui: {
|
|
57
|
-
readonly action: "h-11 min-w-11";
|
|
58
|
-
readonly dismiss: "size-11";
|
|
59
|
-
readonly overflow: "size-11";
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
55
|
readonly sortMenu: {
|
|
63
56
|
readonly ui: {
|
|
64
57
|
readonly trigger: "min-h-11 min-w-11";
|
|
@@ -10,7 +10,6 @@ export const DATA_LIST_MOBILE_DEFAULTS = {
|
|
|
10
10
|
pagination: { ui: { button: TOUCH_TARGET } },
|
|
11
11
|
refresh: { ui: { base: TOUCH_TARGET } },
|
|
12
12
|
search: { ui: { base: "min-h-11", clear: TOUCH_TARGET } },
|
|
13
|
-
selectionActions: { ui: { action: "h-11 min-w-11", dismiss: "size-11", overflow: "size-11" } },
|
|
14
13
|
sortMenu: { ui: { trigger: TOUCH_TARGET } },
|
|
15
14
|
table: { ui: { emptyAction: TOUCH_TARGET, rowAction: TOUCH_TARGET, selectControl: TOUCH_AREA } },
|
|
16
15
|
viewToggle: { ui: { base: TOUCH_TARGET } }
|
|
@@ -17,6 +17,11 @@ export interface TableToolbarAction<TRow extends GenericObject = GenericObject,
|
|
|
17
17
|
label?: TableTextValue;
|
|
18
18
|
condition?: boolean | ((context: TContext) => boolean);
|
|
19
19
|
disabled?: boolean | ((context: TableActionContext<TRow, TContext, TPageContext>) => boolean);
|
|
20
|
+
/**
|
|
21
|
+
* Why the action is disabled. The mobile actions sheet shows it under the label while the action
|
|
22
|
+
* is disabled, in place of `description`.
|
|
23
|
+
*/
|
|
24
|
+
disabledReason?: TableTextValue | ((context: TableActionContext<TRow, TContext, TPageContext>) => TableTextValue | undefined);
|
|
20
25
|
loading?: boolean | ((context: TableActionContext<TRow, TContext, TPageContext>) => boolean);
|
|
21
26
|
/**
|
|
22
27
|
* Runs the action. Returning `false` or `{ success: false }` marks the run as failed without
|
|
@@ -34,6 +39,8 @@ export interface TableBulkAction<TRow extends GenericObject = GenericObject, TCo
|
|
|
34
39
|
export interface TableActionState {
|
|
35
40
|
visible: boolean;
|
|
36
41
|
disabled: boolean;
|
|
42
|
+
/** The resolved `disabledReason` while the action is disabled. */
|
|
43
|
+
disabledReason?: string;
|
|
37
44
|
loading: boolean;
|
|
38
45
|
running: boolean;
|
|
39
46
|
}
|
|
@@ -421,6 +421,8 @@ export interface DataListSelectionActionsProps {
|
|
|
421
421
|
overflow?: DataListButtonProps;
|
|
422
422
|
dismiss?: DataListButtonProps;
|
|
423
423
|
scope?: DataListButtonProps;
|
|
424
|
+
/** The « Actions » button that opens the actions sheet below `md`. */
|
|
425
|
+
trigger?: DataListButtonProps;
|
|
424
426
|
}
|
|
425
427
|
/** Component props exposed by the refresh control. */
|
|
426
428
|
export interface DataListRefreshProps {
|
|
@@ -499,7 +501,10 @@ export interface DataListTableConfig extends DataListPartConfig<DataListTableUi,
|
|
|
499
501
|
/** Horizontal padding of the first and last cells, in px; defaults to the cell padding. */
|
|
500
502
|
gutter?: number;
|
|
501
503
|
}
|
|
502
|
-
/**
|
|
504
|
+
/**
|
|
505
|
+
* UI slots rendered by the floating selection bar. Below `md` the bar keeps `root`, `bar`, `count`
|
|
506
|
+
* and `dismiss`, opens its actions in a sheet from `trigger`, and styles the sheet with `sheet`.
|
|
507
|
+
*/
|
|
503
508
|
export interface DataListSelectionActionsUi {
|
|
504
509
|
root?: DataListUiClass;
|
|
505
510
|
bar?: DataListUiClass;
|
|
@@ -509,4 +514,6 @@ export interface DataListSelectionActionsUi {
|
|
|
509
514
|
action?: DataListUiClass;
|
|
510
515
|
overflow?: DataListUiClass;
|
|
511
516
|
dismiss?: DataListUiClass;
|
|
517
|
+
trigger?: DataListUiClass;
|
|
518
|
+
sheet?: DataListUiClass;
|
|
512
519
|
}
|
|
@@ -122,6 +122,6 @@ export declare function resolveDataListTableDensity(density: DataListDensity): {
|
|
|
122
122
|
export declare function resolveDataListContentShellClass(options: {
|
|
123
123
|
layout: 'table' | 'grid';
|
|
124
124
|
surface: DataListContentSurface;
|
|
125
|
-
}): "
|
|
125
|
+
}): "overflow-hidden" | "grid gap-5" | "grid gap-5 overflow-hidden rounded-md border border-default bg-default" | "overflow-hidden rounded-md border border-default bg-default";
|
|
126
126
|
/** Merges application and root DataList defaults without losing nested UI slots. */
|
|
127
127
|
export declare function mergeDataListUiConfig(appUi: DataListUiConfig | undefined, componentUi: DataListUiConfig | undefined, density?: DataListDensity, size?: DataListControlSize): DataListUiConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ui-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "Nuxt module and runtime toolkit for UI-heavy Nuxt applications",
|
|
5
5
|
"homepage": "https://github.com/ChronicStone/nuxt-ui-tools#readme",
|
|
6
6
|
"bugs": "https://github.com/ChronicStone/nuxt-ui-tools/issues",
|
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
"dashboard": [
|
|
24
24
|
"./dist/runtime/dashboard/index.d.ts"
|
|
25
25
|
],
|
|
26
|
+
"display": [
|
|
27
|
+
"./dist/runtime/display/index.d.ts"
|
|
28
|
+
],
|
|
26
29
|
"file-preview": [
|
|
27
30
|
"./dist/runtime/file-preview/index.d.ts"
|
|
28
31
|
],
|
|
@@ -58,6 +61,14 @@
|
|
|
58
61
|
"types": "./dist/runtime/dashboard/*.d.ts",
|
|
59
62
|
"default": "./dist/runtime/dashboard/*.js"
|
|
60
63
|
},
|
|
64
|
+
"#ui-tools/display": {
|
|
65
|
+
"types": "./dist/runtime/display/index.d.ts",
|
|
66
|
+
"default": "./dist/runtime/display/index.js"
|
|
67
|
+
},
|
|
68
|
+
"#ui-tools/display/*": {
|
|
69
|
+
"types": "./dist/runtime/display/*.d.ts",
|
|
70
|
+
"default": "./dist/runtime/display/*.js"
|
|
71
|
+
},
|
|
61
72
|
"#ui-tools/file-preview": {
|
|
62
73
|
"types": "./dist/runtime/file-preview/index.d.ts",
|
|
63
74
|
"default": "./dist/runtime/file-preview/index.js"
|
|
@@ -132,6 +143,10 @@
|
|
|
132
143
|
"types": "./dist/runtime/dashboard/index.d.ts",
|
|
133
144
|
"import": "./dist/runtime/dashboard/index.js"
|
|
134
145
|
},
|
|
146
|
+
"./display": {
|
|
147
|
+
"types": "./dist/runtime/display/index.d.ts",
|
|
148
|
+
"import": "./dist/runtime/display/index.js"
|
|
149
|
+
},
|
|
135
150
|
"./file-preview": {
|
|
136
151
|
"types": "./dist/runtime/file-preview/index.d.ts",
|
|
137
152
|
"import": "./dist/runtime/file-preview/index.js"
|