nuxt-ui-tools 1.0.0 → 1.1.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 +37 -0
- package/dist/runtime/dashboard/components/block/dashboard-block-state.d.vue.ts +12 -0
- package/dist/runtime/dashboard/components/block/dashboard-block-state.vue +59 -0
- package/dist/runtime/dashboard/components/block/dashboard-block-state.vue.d.ts +12 -0
- package/dist/runtime/dashboard/components/block/dashboard-data-table.d.vue.ts +9 -0
- package/dist/runtime/dashboard/components/block/dashboard-data-table.vue +47 -0
- package/dist/runtime/dashboard/components/block/dashboard-data-table.vue.d.ts +9 -0
- package/dist/runtime/dashboard/components/block/dashboard-ring.d.vue.ts +34 -0
- package/dist/runtime/dashboard/components/block/dashboard-ring.vue +91 -0
- package/dist/runtime/dashboard/components/block/dashboard-ring.vue.d.ts +34 -0
- package/dist/runtime/dashboard/components/block/dashboard-row-actions.d.vue.ts +13 -0
- package/dist/runtime/dashboard/components/block/dashboard-row-actions.vue +49 -0
- package/dist/runtime/dashboard/components/block/dashboard-row-actions.vue.d.ts +13 -0
- package/dist/runtime/dashboard/components/block/dashboard-skeleton.d.vue.ts +34 -0
- package/dist/runtime/dashboard/components/block/dashboard-skeleton.vue +312 -0
- package/dist/runtime/dashboard/components/block/dashboard-skeleton.vue.d.ts +34 -0
- package/dist/runtime/dashboard/components/charts/renderer.d.ts +43 -0
- package/dist/runtime/dashboard/components/charts/renderer.js +34 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-donut-chart.d.vue.ts +18 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-donut-chart.vue +45 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-donut-chart.vue.d.ts +18 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-chart.d.vue.ts +14 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-chart.vue +190 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-chart.vue.d.ts +14 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-marks.d.vue.ts +13 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-marks.vue +72 -0
- package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-marks.vue.d.ts +13 -0
- package/dist/runtime/dashboard/components/charts/unovis/xy-layers.d.ts +43 -0
- package/dist/runtime/dashboard/components/charts/unovis/xy-layers.js +60 -0
- package/dist/runtime/dashboard/components/dashboard-alerts.d.vue.ts +49 -0
- package/dist/runtime/dashboard/components/dashboard-alerts.vue +226 -0
- package/dist/runtime/dashboard/components/dashboard-alerts.vue.d.ts +49 -0
- package/dist/runtime/dashboard/components/dashboard-bar-chart.d.vue.ts +53 -0
- package/dist/runtime/dashboard/components/dashboard-bar-chart.vue +131 -0
- package/dist/runtime/dashboard/components/dashboard-bar-chart.vue.d.ts +53 -0
- package/dist/runtime/dashboard/components/dashboard-bars.d.vue.ts +49 -0
- package/dist/runtime/dashboard/components/dashboard-bars.vue +187 -0
- package/dist/runtime/dashboard/components/dashboard-bars.vue.d.ts +49 -0
- package/dist/runtime/dashboard/components/dashboard-card.d.vue.ts +47 -0
- package/dist/runtime/dashboard/components/dashboard-card.vue +316 -0
- package/dist/runtime/dashboard/components/dashboard-card.vue.d.ts +47 -0
- package/dist/runtime/dashboard/components/dashboard-combo-chart.d.vue.ts +52 -0
- package/dist/runtime/dashboard/components/dashboard-combo-chart.vue +128 -0
- package/dist/runtime/dashboard/components/dashboard-combo-chart.vue.d.ts +52 -0
- package/dist/runtime/dashboard/components/dashboard-donut-chart.d.vue.ts +48 -0
- package/dist/runtime/dashboard/components/dashboard-donut-chart.vue +216 -0
- package/dist/runtime/dashboard/components/dashboard-donut-chart.vue.d.ts +48 -0
- package/dist/runtime/dashboard/components/dashboard-feed.d.vue.ts +49 -0
- package/dist/runtime/dashboard/components/dashboard-feed.vue +238 -0
- package/dist/runtime/dashboard/components/dashboard-feed.vue.d.ts +49 -0
- package/dist/runtime/dashboard/components/dashboard-funnel.d.vue.ts +34 -0
- package/dist/runtime/dashboard/components/dashboard-funnel.vue +157 -0
- package/dist/runtime/dashboard/components/dashboard-funnel.vue.d.ts +34 -0
- package/dist/runtime/dashboard/components/dashboard-gauge.d.vue.ts +55 -0
- package/dist/runtime/dashboard/components/dashboard-gauge.vue +177 -0
- package/dist/runtime/dashboard/components/dashboard-gauge.vue.d.ts +55 -0
- package/dist/runtime/dashboard/components/dashboard-grid.d.vue.ts +38 -0
- package/dist/runtime/dashboard/components/dashboard-grid.vue +49 -0
- package/dist/runtime/dashboard/components/dashboard-grid.vue.d.ts +38 -0
- package/dist/runtime/dashboard/components/dashboard-legend.d.vue.ts +8 -0
- package/dist/runtime/dashboard/components/dashboard-legend.vue +37 -0
- package/dist/runtime/dashboard/components/dashboard-legend.vue.d.ts +8 -0
- package/dist/runtime/dashboard/components/dashboard-line-chart.d.vue.ts +46 -0
- package/dist/runtime/dashboard/components/dashboard-line-chart.vue +129 -0
- package/dist/runtime/dashboard/components/dashboard-line-chart.vue.d.ts +46 -0
- package/dist/runtime/dashboard/components/dashboard-list.d.vue.ts +63 -0
- package/dist/runtime/dashboard/components/dashboard-list.vue +239 -0
- package/dist/runtime/dashboard/components/dashboard-list.vue.d.ts +63 -0
- package/dist/runtime/dashboard/components/dashboard-paired-bars.d.vue.ts +43 -0
- package/dist/runtime/dashboard/components/dashboard-paired-bars.vue +194 -0
- package/dist/runtime/dashboard/components/dashboard-paired-bars.vue.d.ts +43 -0
- package/dist/runtime/dashboard/components/dashboard-refresh.d.vue.ts +29 -0
- package/dist/runtime/dashboard/components/dashboard-refresh.vue +86 -0
- package/dist/runtime/dashboard/components/dashboard-refresh.vue.d.ts +29 -0
- package/dist/runtime/dashboard/components/dashboard-relative-time.d.vue.ts +12 -0
- package/dist/runtime/dashboard/components/dashboard-relative-time.vue +23 -0
- package/dist/runtime/dashboard/components/dashboard-relative-time.vue.d.ts +12 -0
- package/dist/runtime/dashboard/components/dashboard-stack-bar.d.vue.ts +36 -0
- package/dist/runtime/dashboard/components/dashboard-stack-bar.vue +162 -0
- package/dist/runtime/dashboard/components/dashboard-stack-bar.vue.d.ts +36 -0
- package/dist/runtime/dashboard/components/dashboard-stat.d.vue.ts +69 -0
- package/dist/runtime/dashboard/components/dashboard-stat.vue +279 -0
- package/dist/runtime/dashboard/components/dashboard-stat.vue.d.ts +69 -0
- package/dist/runtime/dashboard/components/dashboard-stats.d.vue.ts +38 -0
- package/dist/runtime/dashboard/components/dashboard-stats.vue +202 -0
- package/dist/runtime/dashboard/components/dashboard-stats.vue.d.ts +38 -0
- package/dist/runtime/dashboard/components/dashboard-table.d.vue.ts +52 -0
- package/dist/runtime/dashboard/components/dashboard-table.vue +305 -0
- package/dist/runtime/dashboard/components/dashboard-table.vue.d.ts +52 -0
- package/dist/runtime/dashboard/components/dashboard-tabs.d.vue.ts +35 -0
- package/dist/runtime/dashboard/components/dashboard-tabs.vue +55 -0
- package/dist/runtime/dashboard/components/dashboard-tabs.vue.d.ts +35 -0
- package/dist/runtime/dashboard/components/dashboard-total.d.vue.ts +10 -0
- package/dist/runtime/dashboard/components/dashboard-total.vue +32 -0
- package/dist/runtime/dashboard/components/dashboard-total.vue.d.ts +10 -0
- package/dist/runtime/dashboard/components/dashboard-widget.d.vue.ts +46 -0
- package/dist/runtime/dashboard/components/dashboard-widget.vue +84 -0
- package/dist/runtime/dashboard/components/dashboard-widget.vue.d.ts +46 -0
- package/dist/runtime/dashboard/composables/use-dashboard-api.d.ts +15 -0
- package/dist/runtime/dashboard/composables/use-dashboard-api.js +91 -0
- package/dist/runtime/dashboard/composables/use-dashboard-block.d.ts +22 -0
- package/dist/runtime/dashboard/composables/use-dashboard-block.js +35 -0
- package/dist/runtime/dashboard/composables/use-dashboard-chart.d.ts +36 -0
- package/dist/runtime/dashboard/composables/use-dashboard-chart.js +118 -0
- package/dist/runtime/dashboard/composables/use-dashboard-derived.d.ts +12 -0
- package/dist/runtime/dashboard/composables/use-dashboard-derived.js +47 -0
- package/dist/runtime/dashboard/composables/use-dashboard-format.d.ts +6 -0
- package/dist/runtime/dashboard/composables/use-dashboard-format.js +12 -0
- package/dist/runtime/dashboard/composables/use-dashboard-options.d.ts +8 -0
- package/dist/runtime/dashboard/composables/use-dashboard-options.js +63 -0
- package/dist/runtime/dashboard/composables/use-dashboard-param-scope.d.ts +30 -0
- package/dist/runtime/dashboard/composables/use-dashboard-param-scope.js +71 -0
- package/dist/runtime/dashboard/composables/use-dashboard-remote-options.d.ts +12 -0
- package/dist/runtime/dashboard/composables/use-dashboard-remote-options.js +117 -0
- package/dist/runtime/dashboard/composables/use-dashboard-resource.d.ts +35 -0
- package/dist/runtime/dashboard/composables/use-dashboard-resource.js +80 -0
- package/dist/runtime/dashboard/composables/use-dashboard-scope.d.ts +46 -0
- package/dist/runtime/dashboard/composables/use-dashboard-scope.js +127 -0
- package/dist/runtime/dashboard/composables/use-dashboard-time.d.ts +13 -0
- package/dist/runtime/dashboard/composables/use-dashboard-time.js +40 -0
- package/dist/runtime/dashboard/composables/use-dashboard-ui.d.ts +22 -0
- package/dist/runtime/dashboard/composables/use-dashboard-ui.js +19 -0
- package/dist/runtime/dashboard/composables/use-dashboard-views.d.ts +46 -0
- package/dist/runtime/dashboard/composables/use-dashboard-views.js +49 -0
- package/dist/runtime/dashboard/composables/use-dashboard.d.ts +24 -0
- package/dist/runtime/dashboard/composables/use-dashboard.js +42 -0
- package/dist/runtime/dashboard/constants/query.d.ts +16 -0
- package/dist/runtime/dashboard/constants/query.js +15 -0
- package/dist/runtime/dashboard/index.d.ts +4 -0
- package/dist/runtime/dashboard/index.js +3 -0
- package/dist/runtime/dashboard/schema/index.d.ts +57 -0
- package/dist/runtime/dashboard/schema/index.js +3 -0
- package/dist/runtime/dashboard/types/blocks.d.ts +251 -0
- package/dist/runtime/dashboard/types/blocks.js +0 -0
- package/dist/runtime/dashboard/types/charts.d.ts +60 -0
- package/dist/runtime/dashboard/types/charts.js +0 -0
- package/dist/runtime/dashboard/types/index.d.ts +7 -0
- package/dist/runtime/dashboard/types/index.js +0 -0
- package/dist/runtime/dashboard/types/options.d.ts +46 -0
- package/dist/runtime/dashboard/types/options.js +0 -0
- package/dist/runtime/dashboard/types/params.d.ts +115 -0
- package/dist/runtime/dashboard/types/params.js +0 -0
- package/dist/runtime/dashboard/types/resource.d.ts +106 -0
- package/dist/runtime/dashboard/types/resource.js +0 -0
- package/dist/runtime/dashboard/types/runtime.d.ts +44 -0
- package/dist/runtime/dashboard/types/runtime.js +0 -0
- package/dist/runtime/dashboard/types/schema.d.ts +171 -0
- package/dist/runtime/dashboard/types/schema.js +0 -0
- package/dist/runtime/dashboard/types/ui.d.ts +201 -0
- package/dist/runtime/dashboard/types/ui.js +0 -0
- package/dist/runtime/dashboard/utils/builders/dashboard-params.d.ts +85 -0
- package/dist/runtime/dashboard/utils/builders/dashboard-params.js +87 -0
- package/dist/runtime/dashboard/utils/chart-frame.d.ts +5 -0
- package/dist/runtime/dashboard/utils/chart-frame.js +27 -0
- package/dist/runtime/dashboard/utils/charts.d.ts +61 -0
- package/dist/runtime/dashboard/utils/charts.js +142 -0
- package/dist/runtime/dashboard/utils/comparison.d.ts +15 -0
- package/dist/runtime/dashboard/utils/comparison.js +19 -0
- package/dist/runtime/dashboard/utils/export.d.ts +13 -0
- package/dist/runtime/dashboard/utils/export.js +45 -0
- package/dist/runtime/dashboard/utils/options.d.ts +12 -0
- package/dist/runtime/dashboard/utils/options.js +23 -0
- package/dist/runtime/dashboard/utils/params/codecs.d.ts +14 -0
- package/dist/runtime/dashboard/utils/params/codecs.js +69 -0
- package/dist/runtime/dashboard/utils/resource.d.ts +16 -0
- package/dist/runtime/dashboard/utils/resource.js +39 -0
- package/dist/runtime/dashboard/utils/schema.d.ts +9 -0
- package/dist/runtime/dashboard/utils/schema.js +31 -0
- package/dist/runtime/dashboard/utils/sparkline.d.ts +21 -0
- package/dist/runtime/dashboard/utils/sparkline.js +53 -0
- package/dist/runtime/dashboard/utils/state.d.ts +28 -0
- package/dist/runtime/dashboard/utils/state.js +32 -0
- package/dist/runtime/dashboard/utils/time.d.ts +17 -0
- package/dist/runtime/dashboard/utils/time.js +60 -0
- package/dist/runtime/dashboard/utils/tracker.d.ts +12 -0
- package/dist/runtime/dashboard/utils/tracker.js +31 -0
- package/dist/runtime/dashboard/utils/ui.d.ts +38 -0
- package/dist/runtime/dashboard/utils/ui.js +24 -0
- package/dist/runtime/dashboard/utils/visibility.d.ts +2 -0
- package/dist/runtime/dashboard/utils/visibility.js +25 -0
- 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/options.d.ts +15 -36
- 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 +63 -0
- package/dist/runtime/i18n/locales/fr.js +63 -0
- package/dist/runtime/i18n/types.d.ts +68 -0
- package/dist/runtime/shared/index.d.ts +2 -0
- package/dist/runtime/shared/styles/tokens.css +1 -1
- package/dist/runtime/shared/types/query.d.ts +10 -0
- package/dist/runtime/shared/types/query.js +0 -0
- package/dist/runtime/shared/types/remote-options.d.ts +37 -0
- package/dist/runtime/shared/types/remote-options.js +0 -0
- package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.d.vue.ts +2 -2
- package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.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/data-list/data-list-content.d.vue.ts +20 -18
- 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 +20 -18
- 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-infinite-loader.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-infinite-loader.vue.d.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-layout-switch.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-layout-switch.vue +1 -1
- package/dist/runtime/table/components/data-list/data-list-layout-switch.vue.d.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-pagination.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-pagination.vue.d.ts +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.d.vue.ts +1 -1
- package/dist/runtime/table/components/data-list/data-list-sort-menu.vue +11 -5
- package/dist/runtime/table/components/data-list/data-list-sort-menu.vue.d.ts +1 -1
- package/dist/runtime/table/components/data-list/sort-menu-panel.d.vue.ts +2 -2
- package/dist/runtime/table/components/data-list/sort-menu-panel.vue.d.ts +2 -2
- 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-match-mode-button.d.vue.ts +1 -1
- package/dist/runtime/table/components/filters/shared/filter-match-mode-button.vue.d.ts +1 -1
- 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/layout/table-footer.d.vue.ts +1 -1
- package/dist/runtime/table/components/layout/table-footer.vue.d.ts +1 -1
- package/dist/runtime/table/components/table/table-cell-ellipsis.d.ts +1 -1
- 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-query-state.d.ts +3 -3
- 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 +9 -5
- 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 +45 -33
- package/dist/runtime/table/composables/use-table-pagination.d.ts +2 -2
- package/dist/runtime/table/composables/use-table-selection.d.ts +1 -1
- package/dist/runtime/table/composables/use-table-state.d.ts +3 -3
- 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 +14 -6
- 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/menu.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/columns/state.d.ts +1 -1
- package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
- 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 +28 -1
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import UButton from "@nuxt/ui/components/Button.vue";
|
|
3
|
-
import UIcon from "@nuxt/ui/components/Icon.vue";
|
|
4
2
|
import { computed, nextTick, ref, watch } from "vue";
|
|
5
|
-
import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
6
3
|
import { isNumber } from "../../../shared/utils/predicate";
|
|
7
4
|
import { useDataListUi } from "../../composables/use-data-list-ui";
|
|
8
5
|
import { provideDataListViewport } from "../../composables/use-data-list-viewport";
|
|
9
6
|
import { useTableInternals } from "../../composables/use-table-internals";
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
resolveDataListContentShellClass,
|
|
13
|
-
resolveDataListControlGeometry
|
|
14
|
-
} from "../../utils";
|
|
7
|
+
import { mergeDataListUiClass, resolveDataListContentShellClass } from "../../utils";
|
|
8
|
+
import DataListErrorState from "./data-list-error-state.vue";
|
|
15
9
|
import DataListGrid from "./data-list-grid.vue";
|
|
16
10
|
import DataListTable from "./data-list-table.vue";
|
|
17
11
|
const props = defineProps({
|
|
@@ -24,14 +18,13 @@ const props = defineProps({
|
|
|
24
18
|
});
|
|
25
19
|
const internals = useTableInternals();
|
|
26
20
|
const dataListUi = useDataListUi();
|
|
27
|
-
const { t } = useUiToolsLocale();
|
|
28
21
|
const viewport = ref(null);
|
|
29
22
|
provideDataListViewport(viewport);
|
|
30
23
|
const rows = computed(() => internals.queryContent.data.value.rows);
|
|
31
24
|
const loading = computed(
|
|
32
|
-
() => internals.queryContent.status.value.isBooting || internals.queryContent.status.value.isPending && rows.value.length === 0
|
|
25
|
+
() => internals.queryContent.status.value.isBooting || (internals.queryContent.status.value.isPending || internals.queryContent.status.value.isFetching) && rows.value.length === 0
|
|
33
26
|
);
|
|
34
|
-
const error = computed(() =>
|
|
27
|
+
const error = computed(() => internals.queryContent.error.value);
|
|
35
28
|
const empty = computed(() => !loading.value && !error.value && rows.value.length === 0);
|
|
36
29
|
const hasActiveQuery = computed(
|
|
37
30
|
() => internals.filters.hasActiveSearch.value || internals.filters.hasActiveUiFilters.value
|
|
@@ -55,7 +48,6 @@ const rootUi = computed(() => dataListUi.ui.value.content?.ui);
|
|
|
55
48
|
const resolvedSize = computed(
|
|
56
49
|
() => props.size ?? dataListUi.ui.value.content?.size ?? dataListUi.controlSize.value
|
|
57
50
|
);
|
|
58
|
-
const geometry = computed(() => resolveDataListControlGeometry(resolvedSize.value));
|
|
59
51
|
const shellClass = computed(
|
|
60
52
|
() => resolveDataListContentShellClass({
|
|
61
53
|
layout: internals.controls.tableLayout.value,
|
|
@@ -106,81 +98,13 @@ watch(
|
|
|
106
98
|
:name="$slots['initial-loading'] ? 'initial-loading' : 'loading'"
|
|
107
99
|
:layout="internals.controls.tableLayout.value"
|
|
108
100
|
/>
|
|
109
|
-
<slot
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
)
|
|
117
|
-
"
|
|
118
|
-
>
|
|
119
|
-
<div
|
|
120
|
-
:class="
|
|
121
|
-
mergeDataListUiClass(
|
|
122
|
-
`flex max-w-md items-start text-left ${geometry.toolbarGap}`,
|
|
123
|
-
rootUi?.errorBody,
|
|
124
|
-
ui?.errorBody
|
|
125
|
-
)
|
|
126
|
-
"
|
|
127
|
-
>
|
|
128
|
-
<span
|
|
129
|
-
:class="
|
|
130
|
-
mergeDataListUiClass(
|
|
131
|
-
'grid size-9 shrink-0 place-items-center rounded-md bg-error/10 text-error',
|
|
132
|
-
rootUi?.errorIcon,
|
|
133
|
-
ui?.errorIcon
|
|
134
|
-
)
|
|
135
|
-
"
|
|
136
|
-
>
|
|
137
|
-
<UIcon name="i-lucide-cloud-alert" class="size-4" />
|
|
138
|
-
</span>
|
|
139
|
-
<div
|
|
140
|
-
:class="
|
|
141
|
-
mergeDataListUiClass(
|
|
142
|
-
`min-w-0 flex-1 ${geometry.text}`,
|
|
143
|
-
rootUi?.errorCopy,
|
|
144
|
-
ui?.errorCopy
|
|
145
|
-
)
|
|
146
|
-
"
|
|
147
|
-
>
|
|
148
|
-
<div
|
|
149
|
-
:class="
|
|
150
|
-
mergeDataListUiClass(
|
|
151
|
-
'font-medium text-highlighted',
|
|
152
|
-
rootUi?.errorTitle,
|
|
153
|
-
ui?.errorTitle
|
|
154
|
-
)
|
|
155
|
-
"
|
|
156
|
-
>
|
|
157
|
-
{{ t("table.states.gridError.title") }}
|
|
158
|
-
</div>
|
|
159
|
-
<p
|
|
160
|
-
:class="
|
|
161
|
-
mergeDataListUiClass(
|
|
162
|
-
'mt-0.5 leading-5 text-muted',
|
|
163
|
-
rootUi?.errorDescription,
|
|
164
|
-
ui?.errorDescription
|
|
165
|
-
)
|
|
166
|
-
"
|
|
167
|
-
>
|
|
168
|
-
{{ t("table.states.gridError.description") }}
|
|
169
|
-
</p>
|
|
170
|
-
<UButton
|
|
171
|
-
color="neutral"
|
|
172
|
-
variant="soft"
|
|
173
|
-
:size="resolvedSize"
|
|
174
|
-
icon="i-lucide-refresh-cw"
|
|
175
|
-
class="mt-3"
|
|
176
|
-
:ui="{ base: mergeDataListUiClass(rootUi?.retry, ui?.retry) }"
|
|
177
|
-
@click="refresh"
|
|
178
|
-
>
|
|
179
|
-
{{ t("table.states.gridError.action") }}
|
|
180
|
-
</UButton>
|
|
181
|
-
</div>
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
101
|
+
<slot
|
|
102
|
+
v-else-if="error && internals.controls.tableLayout.value === 'grid'"
|
|
103
|
+
name="error"
|
|
104
|
+
:error="error"
|
|
105
|
+
:retry="refresh"
|
|
106
|
+
>
|
|
107
|
+
<DataListErrorState min-height="16rem" :size="resolvedSize" :ui="ui" @retry="refresh" />
|
|
184
108
|
</slot>
|
|
185
109
|
<slot
|
|
186
110
|
v-else-if="empty && $slots.empty"
|
|
@@ -207,6 +131,9 @@ watch(
|
|
|
207
131
|
>
|
|
208
132
|
<slot v-if="internals.controls.tableLayout.value === 'table'" name="table" :rows="rows">
|
|
209
133
|
<DataListTable :size="resolvedSize" :fill="fit !== 'content'" class="min-h-0 flex-1">
|
|
134
|
+
<template v-if="$slots.error" #error="scope">
|
|
135
|
+
<slot name="error" v-bind="scope" />
|
|
136
|
+
</template>
|
|
210
137
|
<template #empty>
|
|
211
138
|
<slot name="empty-table">
|
|
212
139
|
<slot
|
|
@@ -14,32 +14,32 @@ declare var __VLS_1: {}, __VLS_4: "loading" | "initial-loading", __VLS_5: {
|
|
|
14
14
|
}, __VLS_7: {
|
|
15
15
|
error: {};
|
|
16
16
|
retry: typeof refresh;
|
|
17
|
-
},
|
|
17
|
+
}, __VLS_16: {
|
|
18
18
|
layout: import("../../types/index.js").TableLayout;
|
|
19
19
|
refresh: typeof refresh;
|
|
20
20
|
hasActiveQuery: boolean;
|
|
21
21
|
clearQuery: typeof clearQuery;
|
|
22
|
-
},
|
|
22
|
+
}, __VLS_18: {
|
|
23
23
|
layout: import("../../types/index.js").TableLayout;
|
|
24
24
|
rows: object[];
|
|
25
25
|
loading: boolean;
|
|
26
26
|
empty: boolean;
|
|
27
27
|
error: unknown;
|
|
28
|
-
},
|
|
28
|
+
}, __VLS_26: {
|
|
29
29
|
rows: object[];
|
|
30
|
-
},
|
|
30
|
+
}, __VLS_35: any, __VLS_38: {}, __VLS_40: {
|
|
31
31
|
layout: string;
|
|
32
32
|
refresh: typeof refresh;
|
|
33
33
|
hasActiveQuery: boolean;
|
|
34
34
|
clearQuery: typeof clearQuery;
|
|
35
|
-
},
|
|
35
|
+
}, __VLS_42: {
|
|
36
36
|
rows: object[];
|
|
37
|
-
},
|
|
37
|
+
}, __VLS_51: {}, __VLS_53: {
|
|
38
38
|
layout: string;
|
|
39
39
|
refresh: typeof refresh;
|
|
40
40
|
hasActiveQuery: boolean;
|
|
41
41
|
clearQuery: typeof clearQuery;
|
|
42
|
-
},
|
|
42
|
+
}, __VLS_55: {}, __VLS_57: {};
|
|
43
43
|
type __VLS_Slots = {} & {
|
|
44
44
|
[K in NonNullable<typeof __VLS_4>]?: (props: typeof __VLS_5) => any;
|
|
45
45
|
} & {
|
|
@@ -47,30 +47,32 @@ type __VLS_Slots = {} & {
|
|
|
47
47
|
} & {
|
|
48
48
|
error?: (props: typeof __VLS_7) => any;
|
|
49
49
|
} & {
|
|
50
|
-
empty?: (props: typeof
|
|
50
|
+
empty?: (props: typeof __VLS_16) => any;
|
|
51
51
|
} & {
|
|
52
|
-
content?: (props: typeof
|
|
52
|
+
content?: (props: typeof __VLS_18) => any;
|
|
53
53
|
} & {
|
|
54
|
-
table?: (props: typeof
|
|
54
|
+
table?: (props: typeof __VLS_26) => any;
|
|
55
55
|
} & {
|
|
56
|
-
|
|
56
|
+
error?: (props: typeof __VLS_35) => any;
|
|
57
57
|
} & {
|
|
58
|
-
empty?: (props: typeof
|
|
58
|
+
'empty-table'?: (props: typeof __VLS_38) => any;
|
|
59
59
|
} & {
|
|
60
|
-
|
|
60
|
+
empty?: (props: typeof __VLS_40) => any;
|
|
61
61
|
} & {
|
|
62
|
-
|
|
62
|
+
grid?: (props: typeof __VLS_42) => any;
|
|
63
63
|
} & {
|
|
64
|
-
empty?: (props: typeof
|
|
64
|
+
'empty-grid'?: (props: typeof __VLS_51) => any;
|
|
65
65
|
} & {
|
|
66
|
-
|
|
66
|
+
empty?: (props: typeof __VLS_53) => any;
|
|
67
67
|
} & {
|
|
68
|
-
|
|
68
|
+
refreshing?: (props: typeof __VLS_55) => any;
|
|
69
|
+
} & {
|
|
70
|
+
after?: (props: typeof __VLS_57) => any;
|
|
69
71
|
};
|
|
70
72
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
71
73
|
transition: boolean;
|
|
72
|
-
fit: DataListContentFit;
|
|
73
74
|
surface: DataListContentSurface;
|
|
75
|
+
fit: DataListContentFit;
|
|
74
76
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
75
77
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
76
78
|
declare const _default: typeof __VLS_export;
|
|
@@ -9,10 +9,7 @@ declare var __VLS_1: {}, __VLS_18: {}, __VLS_52: {
|
|
|
9
9
|
layout: import("../../types/index.js").TableLayout;
|
|
10
10
|
}, __VLS_55: {
|
|
11
11
|
layout: import("../../types/index.js").TableLayout;
|
|
12
|
-
}, __VLS_58: {
|
|
13
|
-
error: {};
|
|
14
|
-
retry: () => void;
|
|
15
|
-
}, __VLS_61: {
|
|
12
|
+
}, __VLS_58: any, __VLS_61: {
|
|
16
13
|
layout: string;
|
|
17
14
|
refresh: () => void;
|
|
18
15
|
hasActiveQuery: boolean;
|
|
@@ -9,10 +9,7 @@ declare var __VLS_1: {}, __VLS_18: {}, __VLS_52: {
|
|
|
9
9
|
layout: import("../../types/index.js").TableLayout;
|
|
10
10
|
}, __VLS_55: {
|
|
11
11
|
layout: import("../../types/index.js").TableLayout;
|
|
12
|
-
}, __VLS_58: {
|
|
13
|
-
error: {};
|
|
14
|
-
retry: () => void;
|
|
15
|
-
}, __VLS_61: {
|
|
12
|
+
}, __VLS_58: any, __VLS_61: {
|
|
16
13
|
layout: string;
|
|
17
14
|
refresh: () => void;
|
|
18
15
|
hasActiveQuery: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DataListContentUi, DataListControlSize } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
minHeight?: string;
|
|
4
|
+
size?: DataListControlSize;
|
|
5
|
+
ui?: DataListContentUi;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
retry: () => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onRetry?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import UButton from "@nuxt/ui/components/Button.vue";
|
|
3
|
+
import UIcon from "@nuxt/ui/components/Icon.vue";
|
|
4
|
+
import { computed } from "vue";
|
|
5
|
+
import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
6
|
+
import { useDataListUi } from "../../composables/use-data-list-ui";
|
|
7
|
+
import { mergeDataListUiClass, resolveDataListControlGeometry } from "../../utils";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
minHeight: { type: String, required: false },
|
|
10
|
+
size: { type: String, required: false },
|
|
11
|
+
ui: { type: Object, required: false }
|
|
12
|
+
});
|
|
13
|
+
const emit = defineEmits(["retry"]);
|
|
14
|
+
const dataListUi = useDataListUi();
|
|
15
|
+
const { t } = useUiToolsLocale();
|
|
16
|
+
const rootUi = computed(() => dataListUi.ui.value.content?.ui);
|
|
17
|
+
const resolvedSize = computed(
|
|
18
|
+
() => props.size ?? dataListUi.ui.value.content?.size ?? dataListUi.controlSize.value
|
|
19
|
+
);
|
|
20
|
+
const geometry = computed(() => resolveDataListControlGeometry(resolvedSize.value));
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div
|
|
25
|
+
:class="
|
|
26
|
+
mergeDataListUiClass(
|
|
27
|
+
'grid place-items-center px-4 py-10 text-center',
|
|
28
|
+
rootUi?.error,
|
|
29
|
+
ui?.error
|
|
30
|
+
)
|
|
31
|
+
"
|
|
32
|
+
:style="{ minHeight }"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
:class="
|
|
36
|
+
mergeDataListUiClass(
|
|
37
|
+
`flex max-w-md items-start text-left ${geometry.toolbarGap}`,
|
|
38
|
+
rootUi?.errorBody,
|
|
39
|
+
ui?.errorBody
|
|
40
|
+
)
|
|
41
|
+
"
|
|
42
|
+
>
|
|
43
|
+
<span
|
|
44
|
+
:class="
|
|
45
|
+
mergeDataListUiClass(
|
|
46
|
+
'grid size-9 shrink-0 place-items-center rounded-md bg-error/10 text-error',
|
|
47
|
+
rootUi?.errorIcon,
|
|
48
|
+
ui?.errorIcon
|
|
49
|
+
)
|
|
50
|
+
"
|
|
51
|
+
>
|
|
52
|
+
<UIcon name="i-lucide-cloud-alert" class="size-4" />
|
|
53
|
+
</span>
|
|
54
|
+
<div
|
|
55
|
+
:class="
|
|
56
|
+
mergeDataListUiClass(`min-w-0 flex-1 ${geometry.text}`, rootUi?.errorCopy, ui?.errorCopy)
|
|
57
|
+
"
|
|
58
|
+
>
|
|
59
|
+
<div
|
|
60
|
+
:class="
|
|
61
|
+
mergeDataListUiClass('font-medium text-highlighted', rootUi?.errorTitle, ui?.errorTitle)
|
|
62
|
+
"
|
|
63
|
+
>
|
|
64
|
+
{{ t("table.states.gridError.title") }}
|
|
65
|
+
</div>
|
|
66
|
+
<p
|
|
67
|
+
:class="
|
|
68
|
+
mergeDataListUiClass(
|
|
69
|
+
'mt-0.5 leading-5 text-muted',
|
|
70
|
+
rootUi?.errorDescription,
|
|
71
|
+
ui?.errorDescription
|
|
72
|
+
)
|
|
73
|
+
"
|
|
74
|
+
>
|
|
75
|
+
{{ t("table.states.gridError.description") }}
|
|
76
|
+
</p>
|
|
77
|
+
<UButton
|
|
78
|
+
color="neutral"
|
|
79
|
+
variant="soft"
|
|
80
|
+
:size="resolvedSize"
|
|
81
|
+
icon="i-lucide-refresh-cw"
|
|
82
|
+
class="mt-3"
|
|
83
|
+
:ui="{ base: mergeDataListUiClass(rootUi?.retry, ui?.retry) }"
|
|
84
|
+
@click="emit('retry')"
|
|
85
|
+
>
|
|
86
|
+
{{ t("table.states.gridError.action") }}
|
|
87
|
+
</UButton>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DataListContentUi, DataListControlSize } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
minHeight?: string;
|
|
4
|
+
size?: DataListControlSize;
|
|
5
|
+
ui?: DataListContentUi;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
retry: () => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onRetry?: (() => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -17,8 +17,8 @@ type __VLS_Slots = {} & {
|
|
|
17
17
|
default?: (props: typeof __VLS_1) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
20
|
-
mobile: boolean;
|
|
21
20
|
order: TableLayout[];
|
|
21
|
+
mobile: boolean;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
@@ -17,8 +17,8 @@ type __VLS_Slots = {} & {
|
|
|
17
17
|
default?: (props: typeof __VLS_1) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
20
|
-
mobile: boolean;
|
|
21
20
|
order: TableLayout[];
|
|
21
|
+
mobile: boolean;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
23
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
24
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import UButton from "@nuxt/ui/components/Button.vue";
|
|
3
|
-
import {
|
|
3
|
+
import { usePreferredReducedMotion } from "@vueuse/core";
|
|
4
|
+
import { computed, onBeforeUnmount, ref, watch } from "vue";
|
|
4
5
|
import { useUiToolsLocale } from "#ui-tools/i18n";
|
|
5
6
|
import { useDataListUi } from "../../composables/use-data-list-ui";
|
|
6
7
|
import { useTableInternals } from "../../composables/use-table-internals";
|
|
@@ -14,9 +15,13 @@ const props = defineProps({
|
|
|
14
15
|
const internals = useTableInternals();
|
|
15
16
|
const dataListUi = useDataListUi();
|
|
16
17
|
const { t } = useUiToolsLocale();
|
|
18
|
+
const preferredMotion = usePreferredReducedMotion();
|
|
17
19
|
const loading = computed(
|
|
18
20
|
() => internals.queryContent.status.value.isFetching || internals.queryContent.status.value.isRefreshing || internals.queryContent.status.value.isRevalidating
|
|
19
21
|
);
|
|
22
|
+
const completingSpin = ref(false);
|
|
23
|
+
const spinning = computed(() => loading.value || completingSpin.value);
|
|
24
|
+
let completionFallback;
|
|
20
25
|
const resolvedSize = computed(
|
|
21
26
|
() => props.size ?? dataListUi.ui.value.refresh?.size ?? dataListUi.controlSize.value
|
|
22
27
|
);
|
|
@@ -34,6 +39,37 @@ const buttonProps = computed(
|
|
|
34
39
|
function refresh() {
|
|
35
40
|
void internals.queryContent.refreshData()();
|
|
36
41
|
}
|
|
42
|
+
function finishSpin() {
|
|
43
|
+
completingSpin.value = false;
|
|
44
|
+
clearTimeout(completionFallback);
|
|
45
|
+
completionFallback = void 0;
|
|
46
|
+
}
|
|
47
|
+
function onSpinIteration(event) {
|
|
48
|
+
if (event.animationName === "nut-dl-refresh-spin" && !loading.value) {
|
|
49
|
+
finishSpin();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
watch(
|
|
53
|
+
loading,
|
|
54
|
+
(next, previous) => {
|
|
55
|
+
if (next) {
|
|
56
|
+
finishSpin();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (!previous || preferredMotion.value === "reduce") {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
completingSpin.value = true;
|
|
63
|
+
completionFallback = setTimeout(finishSpin, 750);
|
|
64
|
+
},
|
|
65
|
+
{ flush: "sync" }
|
|
66
|
+
);
|
|
67
|
+
watch(preferredMotion, (motion) => {
|
|
68
|
+
if (motion === "reduce") {
|
|
69
|
+
finishSpin();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
onBeforeUnmount(() => clearTimeout(completionFallback));
|
|
37
73
|
</script>
|
|
38
74
|
|
|
39
75
|
<template>
|
|
@@ -48,21 +84,23 @@ function refresh() {
|
|
|
48
84
|
:square="!label"
|
|
49
85
|
:aria-label="t('table.header.refreshData')"
|
|
50
86
|
:title="t('table.header.refreshData')"
|
|
51
|
-
:
|
|
87
|
+
:aria-busy="loading"
|
|
88
|
+
:data-refreshing="spinning"
|
|
52
89
|
:ui="{
|
|
53
90
|
...resolvedUi,
|
|
54
91
|
base: mergeDataListUiClass('nut-dl-refresh', void 0, resolvedUi.base),
|
|
55
92
|
leadingIcon: mergeDataListUiClass(
|
|
56
|
-
|
|
93
|
+
spinning ? 'nut-dl-refresh__icon--spinning' : 'nut-dl-refresh__icon',
|
|
57
94
|
void 0,
|
|
58
95
|
resolvedUi.leadingIcon
|
|
59
96
|
)
|
|
60
97
|
}"
|
|
98
|
+
@animationiteration="onSpinIteration"
|
|
61
99
|
@click="refresh"
|
|
62
100
|
/>
|
|
63
101
|
</slot>
|
|
64
102
|
</template>
|
|
65
103
|
|
|
66
104
|
<style>
|
|
67
|
-
.nut-dl-refresh__icon--spinning{animation:nut-dl-refresh-spin .7s linear infinite}@keyframes nut-dl-refresh-spin{to{transform:rotate(1turn)}}
|
|
105
|
+
.nut-dl-refresh__icon--spinning{animation:nut-dl-refresh-spin .7s linear infinite}@keyframes nut-dl-refresh-spin{to{transform:rotate(1turn)}}@media (prefers-reduced-motion:reduce){.nut-dl-refresh__icon--spinning{animation:none}}
|
|
68
106
|
</style>
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import type { ComputedRef } from 'vue';
|
|
2
1
|
import type { UiToolsLocale, UiToolsMessages } from '#ui-tools/i18n';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DataListControlSize, DataListDensity, DataListUiConfig } from '../../types/index.js';
|
|
5
|
-
interface DataListTable {
|
|
6
|
-
schema: ComputedRef<{
|
|
7
|
-
tableKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
__internals: TableInternals;
|
|
10
|
-
}
|
|
2
|
+
import type { DataListControlSize, DataListDensity, DataListTable, DataListUiConfig } from '../../types/index.js';
|
|
11
3
|
type __VLS_Props = {
|
|
12
4
|
table: DataListTable;
|
|
13
5
|
locale?: UiToolsLocale<UiToolsMessages>;
|
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
import type { ComputedRef } from 'vue';
|
|
2
1
|
import type { UiToolsLocale, UiToolsMessages } from '#ui-tools/i18n';
|
|
3
|
-
import type {
|
|
4
|
-
import type { DataListControlSize, DataListDensity, DataListUiConfig } from '../../types/index.js';
|
|
5
|
-
interface DataListTable {
|
|
6
|
-
schema: ComputedRef<{
|
|
7
|
-
tableKey: string;
|
|
8
|
-
}>;
|
|
9
|
-
__internals: TableInternals;
|
|
10
|
-
}
|
|
2
|
+
import type { DataListControlSize, DataListDensity, DataListTable, DataListUiConfig } from '../../types/index.js';
|
|
11
3
|
type __VLS_Props = {
|
|
12
4
|
table: DataListTable;
|
|
13
5
|
locale?: UiToolsLocale<UiToolsMessages>;
|
|
@@ -154,15 +154,21 @@ function humanize(value) {
|
|
|
154
154
|
v-bind="triggerControlProps"
|
|
155
155
|
icon="i-lucide-arrow-down-up"
|
|
156
156
|
:ui="{
|
|
157
|
-
base: mergeDataListUiClass(
|
|
158
|
-
|
|
157
|
+
base: mergeDataListUiClass(
|
|
158
|
+
'nut-dl-sortbtn min-w-0 max-w-full',
|
|
159
|
+
void 0,
|
|
160
|
+
resolvedUi.trigger
|
|
161
|
+
),
|
|
162
|
+
label: mergeDataListUiClass('min-w-0', void 0, resolvedUi.triggerLabel),
|
|
159
163
|
leadingIcon: resolvedUi.triggerLeadingIcon,
|
|
160
164
|
trailingIcon: resolvedUi.triggerTrailingIcon
|
|
161
165
|
}"
|
|
162
166
|
>
|
|
163
|
-
<span class="nut-dl-sortbtn__label flex items-center gap-1.5">
|
|
164
|
-
<span>{{ label ?? t("table.controls.sort") }}</span>
|
|
165
|
-
<span v-if="activeLabel" class="font-semibold text-highlighted">{{
|
|
167
|
+
<span class="nut-dl-sortbtn__label flex min-w-0 items-center gap-1.5">
|
|
168
|
+
<span class="shrink-0">{{ label ?? t("table.controls.sort") }}</span>
|
|
169
|
+
<span v-if="activeLabel" class="min-w-0 truncate font-semibold text-highlighted">{{
|
|
170
|
+
activeLabel
|
|
171
|
+
}}</span>
|
|
166
172
|
<UIcon
|
|
167
173
|
v-if="activeLabel"
|
|
168
174
|
:name="activeDirection === 'asc' ? 'i-lucide-arrow-up' : 'i-lucide-arrow-down'"
|
|
@@ -7,10 +7,10 @@ type __VLS_Props = {
|
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
selectKey: (key: string) => any;
|
|
10
|
-
selectDirection: (direction: "
|
|
10
|
+
selectDirection: (direction: "asc" | "desc") => any;
|
|
11
11
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
12
|
onSelectKey?: ((key: string) => any) | undefined;
|
|
13
|
-
onSelectDirection?: ((direction: "
|
|
13
|
+
onSelectDirection?: ((direction: "asc" | "desc") => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
15
|
compact: boolean;
|
|
16
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -7,10 +7,10 @@ type __VLS_Props = {
|
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
selectKey: (key: string) => any;
|
|
10
|
-
selectDirection: (direction: "
|
|
10
|
+
selectDirection: (direction: "asc" | "desc") => any;
|
|
11
11
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
12
|
onSelectKey?: ((key: string) => any) | undefined;
|
|
13
|
-
onSelectDirection?: ((direction: "
|
|
13
|
+
onSelectDirection?: ((direction: "asc" | "desc") => any) | undefined;
|
|
14
14
|
}>, {
|
|
15
15
|
compact: boolean;
|
|
16
16
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|