nuxt-ui-tools 1.24.0 → 1.25.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.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 +96 -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 +136 -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 +184 -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 +241 -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 +144 -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 +179 -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 +154 -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 +75 -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 +195 -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 +103 -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 +301 -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 +336 -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 +302 -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 +153 -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 +268 -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 +189 -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 +136 -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 +141 -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 +238 -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 +27 -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 +71 -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 +36 -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 +11 -0
- package/dist/runtime/display/components/parts/display-record-media.vue +61 -0
- package/dist/runtime/display/components/parts/display-record-media.vue.d.ts +11 -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/directives/reveal-truncated.d.ts +10 -0
- package/dist/runtime/display/directives/reveal-truncated.js +31 -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 +52 -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 +34 -0
- package/dist/runtime/display/types/blocks/person.js +0 -0
- package/dist/runtime/display/types/blocks/record.d.ts +44 -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 +60 -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 +80 -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 +11 -0
- package/dist/runtime/display/utils/config.js +17 -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/links.d.ts +12 -0
- package/dist/runtime/display/utils/links.js +9 -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 +17 -4
- 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 +27 -0
- package/dist/runtime/i18n/locales/fr.js +27 -0
- package/dist/runtime/i18n/types.d.ts +35 -0
- package/dist/runtime/shared/styles/tokens.css +1 -1
- package/dist/runtime/shared/utils/file.d.ts +1 -1
- package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
- package/package.json +16 -1
|
@@ -1,12 +1,86 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { DisplayKind, DisplayPropsMap } from '../../../display/types/index.js';
|
|
2
|
+
import type { FormFieldCallback, FormFieldCallbackParams } from '../../types/callbacks.js';
|
|
3
|
+
import type { FormQueryOptions } from '../../types/context.js';
|
|
4
|
+
import type { FormFieldDescription, FormFieldProps, FormStatelessFieldBase } from '../../types/field-base.js';
|
|
5
|
+
import type { FormDynamic, FormRenderable, FormText } from '../../types/utils.js';
|
|
6
|
+
/** Props of a notice field: its `content` drawn in an alert. */
|
|
4
7
|
export interface FormInfoProps {
|
|
5
8
|
title?: FormText;
|
|
6
9
|
icon?: string | false;
|
|
7
10
|
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
8
11
|
variant?: 'solid' | 'outline' | 'soft' | 'subtle';
|
|
9
12
|
}
|
|
10
|
-
|
|
13
|
+
interface FormInfoFieldBase<TContext, TDeps> extends Omit<FormStatelessFieldBase<'info', TContext, TDeps>, 'props'> {
|
|
14
|
+
/** Raw dependency paths read before evaluating `props`, `content` and `condition`. */
|
|
15
|
+
dependencies?: readonly (string | readonly [string, string])[];
|
|
16
|
+
/**
|
|
17
|
+
* Draws the field inside the standard label wrapper, like an input, for a read-only value that
|
|
18
|
+
* belongs in the form grid. `description`, `hint` and `help` do the same.
|
|
19
|
+
*/
|
|
20
|
+
label?: FormText;
|
|
21
|
+
description?: FormText | FormFieldDescription;
|
|
22
|
+
hint?: FormText;
|
|
23
|
+
help?: FormText;
|
|
24
|
+
}
|
|
25
|
+
/** A notice: `content` in an alert, styled by `props`. */
|
|
26
|
+
export interface FormInfoNoticeField<TContext = NonNullable<unknown>, TDeps = NonNullable<unknown>> extends FormInfoFieldBase<TContext, TDeps> {
|
|
27
|
+
display?: undefined;
|
|
28
|
+
preset?: undefined;
|
|
11
29
|
content: FormRenderable | FormFieldCallback<FormRenderable, TContext, TDeps>;
|
|
30
|
+
props?: FormFieldProps<FormInfoProps, TContext, TDeps>;
|
|
12
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Props of a display block, or a way to load them: a promise, or TanStack Query options whose
|
|
34
|
+
* data (after `select`) is the props, cached under their `queryKey`.
|
|
35
|
+
*/
|
|
36
|
+
export type FormInfoDisplaySource<TProps> = TProps | Promise<TProps> | FormQueryOptions<TProps>;
|
|
37
|
+
/**
|
|
38
|
+
* A display block: `display` picks the kind and `props` configure it, statically or from the
|
|
39
|
+
* field's dependencies, so the block follows the form values. `props` may also load them: a
|
|
40
|
+
* callback returning a promise or query options runs again when a dependency changes, shows the
|
|
41
|
+
* block's skeleton until they arrive, drops a late answer to an older run, and shows a compact
|
|
42
|
+
* error with a retry button when loading fails.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* {
|
|
47
|
+
* key: 'quote',
|
|
48
|
+
* type: 'info',
|
|
49
|
+
* display: 'breakdown',
|
|
50
|
+
* dependencies: ['seats'],
|
|
51
|
+
* props: ({ deps }) => ({
|
|
52
|
+
* lines: [{ label: 'Licences', detail: `${deps.get<number>('seats')} × 96 €`, value: '…' }],
|
|
53
|
+
* total: { label: 'Total', value: '…' },
|
|
54
|
+
* }),
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* {
|
|
58
|
+
* key: 'accountNote',
|
|
59
|
+
* type: 'info',
|
|
60
|
+
* display: 'text',
|
|
61
|
+
* dependencies: ['accountId'],
|
|
62
|
+
* props: ({ deps }) =>
|
|
63
|
+
* queryOptions({
|
|
64
|
+
* queryKey: ['accounts', deps.get('accountId'), 'note'],
|
|
65
|
+
* queryFn: () => fetchAccountNote(deps.get('accountId')),
|
|
66
|
+
* select: (note) => ({ appearance: 'quote', text: note.body, author: note.author }),
|
|
67
|
+
* }),
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
export type FormInfoDisplayField<TContext = NonNullable<unknown>, TDeps = NonNullable<unknown>> = {
|
|
72
|
+
[TKind in DisplayKind]: FormInfoFieldBase<TContext, TDeps> & {
|
|
73
|
+
display: TKind;
|
|
74
|
+
/** Name of a preset in `appConfig.nuxtUiTools.display.presets[display]`; `props` override it. */
|
|
75
|
+
preset?: string;
|
|
76
|
+
content?: undefined;
|
|
77
|
+
/**
|
|
78
|
+
* The block's props, or a callback receiving `{ ctx, deps, api }` that returns them, a promise
|
|
79
|
+
* of them, or query options. `api.form` sets values, submits, or closes the form, so a block
|
|
80
|
+
* action can act on it.
|
|
81
|
+
*/
|
|
82
|
+
props: FormDynamic<FormInfoDisplaySource<DisplayPropsMap[TKind]>, FormFieldCallbackParams<TContext, TDeps>>;
|
|
83
|
+
};
|
|
84
|
+
}[DisplayKind];
|
|
85
|
+
export type FormInfoField<TContext = NonNullable<unknown>, TDeps = NonNullable<unknown>> = FormInfoNoticeField<TContext, TDeps> | FormInfoDisplayField<TContext, TDeps>;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { DisplayKind, DisplayPropsMap } from '../../../display/types/index.js';
|
|
3
|
+
import type { FormFieldCallbackParams } from '../../types/index.js';
|
|
4
|
+
import type { FormInfoDisplayField } from './types.js';
|
|
5
|
+
type DisplayProps = DisplayPropsMap[DisplayKind];
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the props of a display field: static, derived from its dependencies, or loaded through
|
|
8
|
+
* a promise or TanStack Query options. A promise from an older run never overwrites a newer one.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useInfoDisplay(params: {
|
|
11
|
+
field: () => FormInfoDisplayField | undefined;
|
|
12
|
+
callbackParams: ComputedRef<FormFieldCallbackParams>;
|
|
13
|
+
path: () => readonly string[];
|
|
14
|
+
}): {
|
|
15
|
+
error: ComputedRef<unknown>;
|
|
16
|
+
pending: ComputedRef<boolean>;
|
|
17
|
+
props: ComputedRef<DisplayProps | undefined>;
|
|
18
|
+
retry: () => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { useQuery } from "@tanstack/vue-query";
|
|
2
|
+
import { computed, ref, shallowRef, unref, watch } from "vue";
|
|
3
|
+
import { isPlainObject, isPromise } from "../../../shared/utils/predicate.js";
|
|
4
|
+
import { resolveFormDynamic } from "../../utils/dynamic.js";
|
|
5
|
+
import { isRecord } from "../../utils/path.js";
|
|
6
|
+
export function useInfoDisplay(params) {
|
|
7
|
+
const attempt = ref(0);
|
|
8
|
+
const promiseRun = ref(0);
|
|
9
|
+
const promiseProps = shallowRef(void 0);
|
|
10
|
+
const promisePending = ref(false);
|
|
11
|
+
const promiseError = shallowRef(null);
|
|
12
|
+
const source = computed(() => {
|
|
13
|
+
void attempt.value;
|
|
14
|
+
const field = params.field();
|
|
15
|
+
return field ? resolveFormDynamic(
|
|
16
|
+
field.props,
|
|
17
|
+
params.callbackParams.value
|
|
18
|
+
) : void 0;
|
|
19
|
+
});
|
|
20
|
+
const querySource = computed(() => isQueryOptions(source.value) ? source.value : null);
|
|
21
|
+
const query = useQuery(
|
|
22
|
+
computed(
|
|
23
|
+
() => querySource.value ?? {
|
|
24
|
+
enabled: false,
|
|
25
|
+
queryFn: async () => null,
|
|
26
|
+
queryKey: ["form-info", params.path().join("."), "disabled"]
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
);
|
|
30
|
+
watch(
|
|
31
|
+
source,
|
|
32
|
+
async (current) => {
|
|
33
|
+
if (!isPromise(current)) {
|
|
34
|
+
promiseRun.value += 1;
|
|
35
|
+
promisePending.value = false;
|
|
36
|
+
promiseError.value = null;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const run = promiseRun.value + 1;
|
|
40
|
+
promiseRun.value = run;
|
|
41
|
+
promisePending.value = true;
|
|
42
|
+
promiseError.value = null;
|
|
43
|
+
try {
|
|
44
|
+
const result = await current;
|
|
45
|
+
if (promiseRun.value !== run) return;
|
|
46
|
+
promiseProps.value = isDisplayProps(result) ? result : void 0;
|
|
47
|
+
} catch (caughtError) {
|
|
48
|
+
if (promiseRun.value === run) promiseError.value = caughtError;
|
|
49
|
+
} finally {
|
|
50
|
+
if (promiseRun.value === run) promisePending.value = false;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{ immediate: true }
|
|
54
|
+
);
|
|
55
|
+
const props = computed(() => {
|
|
56
|
+
const current = source.value;
|
|
57
|
+
if (querySource.value) {
|
|
58
|
+
const data = unref(query.data);
|
|
59
|
+
return isDisplayProps(data) ? data : void 0;
|
|
60
|
+
}
|
|
61
|
+
if (isPromise(current)) return promisePending.value ? void 0 : promiseProps.value;
|
|
62
|
+
return isDisplayProps(current) ? current : void 0;
|
|
63
|
+
});
|
|
64
|
+
const pending = computed(() => {
|
|
65
|
+
if (querySource.value) return unref(query.isPending) && unref(query.fetchStatus) !== "idle";
|
|
66
|
+
return promisePending.value;
|
|
67
|
+
});
|
|
68
|
+
const error = computed(
|
|
69
|
+
() => querySource.value ? unref(query.error) ?? null : promiseError.value
|
|
70
|
+
);
|
|
71
|
+
function retry() {
|
|
72
|
+
if (querySource.value) void query.refetch();
|
|
73
|
+
else attempt.value += 1;
|
|
74
|
+
}
|
|
75
|
+
return { error, pending, props, retry };
|
|
76
|
+
}
|
|
77
|
+
function isQueryOptions(value) {
|
|
78
|
+
return isRecord(value) && Array.isArray(Object.getOwnPropertyDescriptor(value, "queryKey")?.value);
|
|
79
|
+
}
|
|
80
|
+
function isDisplayProps(value) {
|
|
81
|
+
return isPlainObject(value) && !isQueryOptions(value);
|
|
82
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import UButton from "@nuxt/ui/components/Button.vue";
|
|
3
3
|
import UIcon from "@nuxt/ui/components/Icon.vue";
|
|
4
4
|
import UProgress from "@nuxt/ui/components/Progress.vue";
|
|
5
|
-
import { computed } from "vue";
|
|
5
|
+
import { computed, ref, watch } from "vue";
|
|
6
6
|
import { useUiToolsLocale } from "../../../i18n/use-locale";
|
|
7
7
|
import { fileExtensionLabel, fileIconName, formatFileSize } from "../../../shared/utils/file";
|
|
8
8
|
const props = defineProps({
|
|
@@ -14,6 +14,13 @@ const props = defineProps({
|
|
|
14
14
|
const emit = defineEmits(["open", "start", "cancel", "retry", "remove", "replace"]);
|
|
15
15
|
const { code, t } = useUiToolsLocale();
|
|
16
16
|
const icon = computed(() => fileIconName(props.item.type));
|
|
17
|
+
const thumbnailFailed = ref(false);
|
|
18
|
+
watch(
|
|
19
|
+
() => props.item.thumbnail,
|
|
20
|
+
() => {
|
|
21
|
+
thumbnailFailed.value = false;
|
|
22
|
+
}
|
|
23
|
+
);
|
|
17
24
|
const meta = computed(() => {
|
|
18
25
|
if (props.item.description) return props.item.description;
|
|
19
26
|
const extension = fileExtensionLabel({ name: props.item.name, type: props.item.type });
|
|
@@ -37,9 +44,10 @@ const status = computed(() => {
|
|
|
37
44
|
:data-form-upload-item="item.status"
|
|
38
45
|
>
|
|
39
46
|
<img
|
|
40
|
-
v-if="item.thumbnail"
|
|
47
|
+
v-if="item.thumbnail && !thumbnailFailed"
|
|
41
48
|
:src="item.thumbnail"
|
|
42
49
|
:alt="item.name"
|
|
50
|
+
@error="thumbnailFailed = true"
|
|
43
51
|
class="shrink-0 rounded-md border border-default bg-white object-contain p-0.5"
|
|
44
52
|
:class="compact ? 'size-7' : 'size-10'"
|
|
45
53
|
/>
|
|
@@ -59,6 +59,12 @@ export interface FormFieldFormApi {
|
|
|
59
59
|
reset: () => Promise<void>;
|
|
60
60
|
/** Submits the form through the configured submit lifecycle. */
|
|
61
61
|
submit: () => Promise<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Closes the form the way its Cancel action does: asks to discard unsaved changes when the
|
|
64
|
+
* schema asks for it, then cancels (an overlay closes). Does nothing for a form rendered without
|
|
65
|
+
* a cancel handler.
|
|
66
|
+
*/
|
|
67
|
+
close: () => Promise<void>;
|
|
62
68
|
/** Advances to the next step on stepped forms. */
|
|
63
69
|
nextStep: () => Promise<boolean>;
|
|
64
70
|
/** Returns to the previous step on stepped forms. */
|
|
@@ -92,4 +92,6 @@ export interface FormRuntime {
|
|
|
92
92
|
nextStep: () => Promise<boolean>;
|
|
93
93
|
previousStep: () => Promise<boolean>;
|
|
94
94
|
goToStep: (index: number) => Promise<boolean>;
|
|
95
|
+
/** Cancels the rendered form, as its Cancel action does. Set by the form root that renders it. */
|
|
96
|
+
bindCancel: (cancel: (() => Promise<void>) | null) => void;
|
|
95
97
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FormDynamic } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Value of a static-or-callback option: the callback's result for `params`, else the value.
|
|
4
|
+
* Any function counts as the callback, the same convention as every field callback.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveFormDynamic<TValue, TParams>(value: FormDynamic<TValue, TParams>, params: TParams): TValue;
|
|
@@ -97,6 +97,33 @@ export default defineUiToolsLocale({
|
|
|
97
97
|
retry: "Retry"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
+
display: {
|
|
101
|
+
after: "After",
|
|
102
|
+
before: "Before",
|
|
103
|
+
conceal: "Hide",
|
|
104
|
+
copied: "Copied",
|
|
105
|
+
copy: "Copy",
|
|
106
|
+
details: "Details",
|
|
107
|
+
download: "Download",
|
|
108
|
+
dueOn: "Due {date}",
|
|
109
|
+
empty: "Nothing to show",
|
|
110
|
+
field: "Field",
|
|
111
|
+
from: "From",
|
|
112
|
+
hideDetails: "Hide details",
|
|
113
|
+
loadError: "This content could not be loaded.",
|
|
114
|
+
open: "Open",
|
|
115
|
+
overdue: "{duration} overdue",
|
|
116
|
+
pages: "{count} pages",
|
|
117
|
+
play: "Play the video",
|
|
118
|
+
readLess: "Show less",
|
|
119
|
+
readMore: "Read more",
|
|
120
|
+
retry: "Retry",
|
|
121
|
+
reveal: "Show",
|
|
122
|
+
showDetails: "Show details",
|
|
123
|
+
showMore: "Show more \xB7 {count}",
|
|
124
|
+
to: "To",
|
|
125
|
+
today: "Today"
|
|
126
|
+
},
|
|
100
127
|
filePreview: {
|
|
101
128
|
close: "Close",
|
|
102
129
|
converted: {
|
|
@@ -97,6 +97,33 @@ export default defineUiToolsLocale({
|
|
|
97
97
|
retry: "R\xE9essayer"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
+
display: {
|
|
101
|
+
after: "Apr\xE8s",
|
|
102
|
+
before: "Avant",
|
|
103
|
+
conceal: "Masquer",
|
|
104
|
+
copied: "Copi\xE9",
|
|
105
|
+
copy: "Copier",
|
|
106
|
+
details: "D\xE9tail",
|
|
107
|
+
download: "T\xE9l\xE9charger",
|
|
108
|
+
dueOn: "\xC9ch\xE9ance {date}",
|
|
109
|
+
empty: "Rien \xE0 afficher",
|
|
110
|
+
field: "Champ",
|
|
111
|
+
from: "Du",
|
|
112
|
+
hideDetails: "Masquer le d\xE9tail",
|
|
113
|
+
loadError: "Ce contenu n\u2019a pas pu \xEAtre charg\xE9.",
|
|
114
|
+
open: "Ouvrir",
|
|
115
|
+
overdue: "En retard de {duration}",
|
|
116
|
+
pages: "{count} pages",
|
|
117
|
+
play: "Lire la vid\xE9o",
|
|
118
|
+
readLess: "R\xE9duire",
|
|
119
|
+
readMore: "Lire la suite",
|
|
120
|
+
retry: "R\xE9essayer",
|
|
121
|
+
reveal: "Afficher",
|
|
122
|
+
showDetails: "Voir le d\xE9tail",
|
|
123
|
+
showMore: "Voir plus \xB7 {count}",
|
|
124
|
+
to: "Au",
|
|
125
|
+
today: "Aujourd'hui"
|
|
126
|
+
},
|
|
100
127
|
filePreview: {
|
|
101
128
|
close: "Fermer",
|
|
102
129
|
converted: {
|
|
@@ -723,6 +723,40 @@ export interface UiToolsDashboardMessages {
|
|
|
723
723
|
};
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
|
+
export interface UiToolsDisplayMessages {
|
|
727
|
+
/** Shown by a block with nothing to list. */
|
|
728
|
+
empty: string;
|
|
729
|
+
/** "Show more · {count}" */
|
|
730
|
+
showMore: string;
|
|
731
|
+
readMore: string;
|
|
732
|
+
readLess: string;
|
|
733
|
+
showDetails: string;
|
|
734
|
+
hideDetails: string;
|
|
735
|
+
/** Toggle of a collapsible breakdown. */
|
|
736
|
+
details: string;
|
|
737
|
+
copy: string;
|
|
738
|
+
copied: string;
|
|
739
|
+
reveal: string;
|
|
740
|
+
conceal: string;
|
|
741
|
+
open: string;
|
|
742
|
+
download: string;
|
|
743
|
+
play: string;
|
|
744
|
+
today: string;
|
|
745
|
+
from: string;
|
|
746
|
+
to: string;
|
|
747
|
+
/** "{duration} overdue" */
|
|
748
|
+
overdue: string;
|
|
749
|
+
/** "Due {date}" */
|
|
750
|
+
dueOn: string;
|
|
751
|
+
/** "{count} pages" */
|
|
752
|
+
pages: string;
|
|
753
|
+
/** Shown when a block's props failed to load. */
|
|
754
|
+
loadError: string;
|
|
755
|
+
retry: string;
|
|
756
|
+
field: string;
|
|
757
|
+
before: string;
|
|
758
|
+
after: string;
|
|
759
|
+
}
|
|
726
760
|
export interface UiToolsFilePreviewMessages {
|
|
727
761
|
/** Name shown for a file that has none, such as a pasted image. */
|
|
728
762
|
untitled: string;
|
|
@@ -831,6 +865,7 @@ export interface UiToolsFilePreviewMessages {
|
|
|
831
865
|
}
|
|
832
866
|
export interface Messages {
|
|
833
867
|
dashboard: UiToolsDashboardMessages;
|
|
868
|
+
display: UiToolsDisplayMessages;
|
|
834
869
|
filePreview: UiToolsFilePreviewMessages;
|
|
835
870
|
form: UiToolsFormMessages;
|
|
836
871
|
table: UiToolsTableMessages;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer theme, base, components, utilities;@layer base{:root{--nut-form-veil:rgba(31,29,26,.18)}.dark{--nut-form-veil:rgba(0,0,0,.45)}:where(:root){--nut-dash-s1:var(--ui-primary);--nut-dash-s2:var(--ui-color-neutral-400);--nut-dash-s3:var(--ui-secondary);--nut-dash-s4:color-mix(in oklab,var(--ui-primary) 20%,var(--ui-bg));--nut-dash-s5:var(--ui-warning);--nut-dash-s6:color-mix(in oklab,var(--ui-secondary) 35%,var(--ui-bg));--nut-dash-up:var(--ui-success);--nut-dash-up-mark:var(--nut-dash-up);--nut-dash-down:var(--ui-error);--nut-dash-muted:var(--ui-border-accented);--nut-dash-track:var(--ui-bg-elevated);--nut-dash-grid:var(--ui-border-muted);--nut-dash-axis:var(--ui-text-dimmed);--nut-dash-ref:var(--ui-text-dimmed);--nut-dash-ref-label:var(--ui-text-muted);--nut-dash-ghost:var(--ui-bg-accented);--nut-dash-ghost-shine:color-mix(in oklab,var(--ui-bg) 70%,transparent);--nut-dash-filter-active:color-mix(in oklab,var(--ui-primary) 9%,var(--ui-bg));--nut-dash-filter-active-line:color-mix(in oklab,var(--ui-primary) 35%,var(--ui-border));--nut-dash-filter-ink:var(--nut-dl-accent-ink,var(--ui-primary));--nut-dash-row-hover:var(--ui-bg-elevated)}:where(.dark){--nut-dash-s2:var(--ui-color-neutral-500);--nut-dash-s4:color-mix(in oklab,var(--ui-primary) 30%,var(--ui-bg));--nut-dash-s6:color-mix(in oklab,var(--ui-secondary) 40%,var(--ui-bg))}@supports (color:oklch(from red l c h)){:where(:root){--nut-dash-s4:oklch(from var(--ui-primary) 0.88 calc(c * 0.45) h);--nut-dash-s6:oklch(from var(--ui-secondary) 0.8 calc(c * 0.55) h)}:where(.dark){--nut-dash-s4:oklch(from var(--ui-primary) 0.42 calc(c * 0.6) h);--nut-dash-s6:oklch(from var(--ui-secondary) 0.45 calc(c * 0.65) h)}}:where(:root){--nut-fp-veil:rgba(31,29,26,.4);--nut-fp-stage:var(--ui-bg-muted);--nut-fp-document:#525659;--nut-fp-checker-a:#fff;--nut-fp-checker-b:#ebe7e2;--nut-fp-token-key:var(--ui-primary);--nut-fp-token-string:var(--ui-success);--nut-fp-token-number:var(--ui-info);--nut-fp-token-literal:var(--ui-error)}:where(.dark){--nut-fp-veil:rgba(0,0,0,.62);--nut-fp-stage:var(--ui-bg);--nut-fp-checker-a:#e9e4dd;--nut-fp-checker-b:#d8d1c7}}@layer components{.nut-dash-chart{--vis-font-family:inherit;--vis-axis-tick-label-color:var(--nut-dash-axis);--vis-axis-tick-label-font-size:10px;--vis-axis-grid-color:var(--nut-dash-grid);--vis-axis-domain-color:var(--nut-dash-grid);--vis-crosshair-line-stroke-color:var(--ui-border-accented);--vis-crosshair-circle-stroke-color:var(--ui-bg);--vis-tooltip-background-color:var(--ui-bg);--vis-tooltip-border-color:var(--ui-border);--vis-tooltip-text-color:var(--ui-text);--vis-tooltip-padding:8px 10px;--vis-tooltip-border-radius:calc(var(--ui-radius)*1.5);--vis-tooltip-shadow-color:rgb(0 0 0/8%);--vis-plotline-label-font-size:10px}.nut-dash-chart--bars [data-vis-component] rect:hover{opacity:.8}.nut-dash-tip{display:flex;flex-direction:column;font-size:12px;gap:4px;min-width:9rem}.nut-dash-tip-title{color:var(--ui-text-muted);font-weight:500}.nut-dash-tip-row{align-items:center;display:flex;gap:6px}.nut-dash-tip-row i{border-radius:2px;height:8px;width:8px}.nut-dash-tip-row span{color:var(--ui-text-muted);flex:1}.nut-dash-tip-row b{font-variant-numeric:tabular-nums;font-weight:600}.nut-dash-ghost{background:var(--nut-dash-ghost)}.nut-dash-shimmer{overflow:hidden;position:relative}.nut-dash-shimmer:after{animation:nut-dash-shimmer 1.6s ease-in-out infinite;background:linear-gradient(100deg,transparent 25%,var(--nut-dash-ghost-shine) 50%,transparent 75%);content:"";inset:0;pointer-events:none;position:absolute;transform:translateX(-100%);will-change:transform}@keyframes nut-dash-shimmer{to{transform:translateX(100%)}}.nut-dash-enter{animation:nut-dash-enter .28s ease-out}@keyframes nut-dash-enter{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:none}}.nut-dash-progress{animation:nut-dash-progress 1.1s ease-in-out infinite}@keyframes nut-dash-progress{0%{transform:translateX(-100%)}to{transform:translateX(300%)}}@media (prefers-reduced-motion:reduce){.nut-dash-shimmer:after{display:none}.nut-dash-enter{animation:none}.nut-dash-progress{animation-duration:3s}}.nut-fp-checker{background-color:var(--nut-fp-checker-a);background-image:conic-gradient(var(--nut-fp-checker-b) 25%,transparent 0 50%,var(--nut-fp-checker-b) 0 75%,transparent 0);background-size:18px 18px}.nut-fp-code [data-token=key]{color:var(--nut-fp-token-key)}.nut-fp-code [data-token=string]{color:var(--nut-fp-token-string)}.nut-fp-code [data-token=number]{color:var(--nut-fp-token-number)}.nut-fp-code [data-token=literal]{color:var(--nut-fp-token-literal)}[data-file-preview-bottom][data-single]:has([data-file-preview-tools]:empty){display:none}@keyframes nut-fp-progress{0%{transform:translateX(-100%)}to{transform:translateX(300%)}}.nut-fp-progress{animation:nut-fp-progress 1s ease-in-out infinite}@keyframes nut-fp-equalizer{to{transform:scaleY(.45)}}.nut-fp-equalizer{animation:nut-fp-equalizer .9s ease-in-out infinite alternate}@media (prefers-reduced-motion:reduce){.nut-fp-progress{animation-duration:2.4s}.nut-fp-equalizer{animation:none}}.nut-fp-prose{color:var(--ui-text);font-size:.925rem;line-height:1.7}.nut-fp-prose>:first-child{margin-top:0}.nut-fp-prose :where(h1,h2,h3,h4){color:var(--ui-text-highlighted);font-weight:650;letter-spacing:-.01em;line-height:1.25;margin:1.75em 0 .6em}.nut-fp-prose h1{font-size:1.6em}.nut-fp-prose h2{font-size:1.25em}.nut-fp-prose h3{font-size:1.05em}.nut-fp-prose :where(p,ul,ol,pre,table,blockquote){margin:0 0 1em}.nut-fp-prose :where(ul,ol){padding-inline-start:1.4em}.nut-fp-prose ul{list-style:disc}.nut-fp-prose ol{list-style:decimal}.nut-fp-prose a{color:var(--ui-primary);text-decoration:underline;text-underline-offset:2px}.nut-fp-prose :not(pre)>code{background:var(--ui-bg-elevated);border:1px solid var(--ui-border-muted);border-radius:4px;font-size:.86em;padding:.1em .35em}.nut-fp-prose pre{background:var(--ui-bg-elevated);border:1px solid var(--ui-border);border-radius:8px;font-size:.85em;overflow-x:auto;padding:.9em 1.1em}.nut-fp-prose table{border-collapse:collapse;display:block;font-size:.9em;overflow-x:auto}.nut-fp-prose :where(th,td){border:1px solid var(--ui-border);padding:.4em .75em;text-align:start}.nut-fp-prose th{background:var(--ui-bg-elevated);font-weight:600}.nut-fp-prose blockquote{border-inline-start:3px solid var(--ui-primary);color:var(--ui-text-toned);padding-inline-start:1em}.nut-fp-prose img{border-radius:6px;max-width:100%}}
|
|
1
|
+
@layer theme, base, components, utilities;@layer base{:root{--nut-form-veil:rgba(31,29,26,.18)}.dark{--nut-form-veil:rgba(0,0,0,.45)}:where(:root){--nut-dash-s1:var(--ui-primary);--nut-dash-s2:var(--ui-color-neutral-400);--nut-dash-s3:var(--ui-secondary);--nut-dash-s4:color-mix(in oklab,var(--ui-primary) 20%,var(--ui-bg));--nut-dash-s5:var(--ui-warning);--nut-dash-s6:color-mix(in oklab,var(--ui-secondary) 35%,var(--ui-bg));--nut-dash-up:var(--ui-success);--nut-dash-up-mark:var(--nut-dash-up);--nut-dash-down:var(--ui-error);--nut-dash-muted:var(--ui-border-accented);--nut-dash-track:var(--ui-bg-elevated);--nut-dash-grid:var(--ui-border-muted);--nut-dash-axis:var(--ui-text-dimmed);--nut-dash-ref:var(--ui-text-dimmed);--nut-dash-ref-label:var(--ui-text-muted);--nut-dash-ghost:var(--ui-bg-accented);--nut-dash-ghost-shine:color-mix(in oklab,var(--ui-bg) 70%,transparent);--nut-dash-filter-active:color-mix(in oklab,var(--ui-primary) 9%,var(--ui-bg));--nut-dash-filter-active-line:color-mix(in oklab,var(--ui-primary) 35%,var(--ui-border));--nut-dash-filter-ink:var(--nut-dl-accent-ink,var(--ui-primary));--nut-dash-row-hover:var(--ui-bg-elevated)}:where(.dark){--nut-dash-s2:var(--ui-color-neutral-500);--nut-dash-s4:color-mix(in oklab,var(--ui-primary) 30%,var(--ui-bg));--nut-dash-s6:color-mix(in oklab,var(--ui-secondary) 40%,var(--ui-bg))}@supports (color:oklch(from red l c h)){:where(:root){--nut-dash-s4:oklch(from var(--ui-primary) 0.88 calc(c * 0.45) h);--nut-dash-s6:oklch(from var(--ui-secondary) 0.8 calc(c * 0.55) h)}:where(.dark){--nut-dash-s4:oklch(from var(--ui-primary) 0.42 calc(c * 0.6) h);--nut-dash-s6:oklch(from var(--ui-secondary) 0.45 calc(c * 0.65) h)}}:where(:root){--nut-fp-veil:rgba(31,29,26,.4);--nut-fp-stage:var(--ui-bg-muted);--nut-fp-document:#525659;--nut-fp-checker-a:#fff;--nut-fp-checker-b:#ebe7e2;--nut-fp-token-key:var(--ui-primary);--nut-fp-token-string:var(--ui-success);--nut-fp-token-number:var(--ui-info);--nut-fp-token-literal:var(--ui-error)}:where(.dark){--nut-fp-veil:rgba(0,0,0,.62);--nut-fp-stage:var(--ui-bg);--nut-fp-checker-a:#e9e4dd;--nut-fp-checker-b:#d8d1c7}:where(:root){--nut-display-radius:calc(var(--ui-radius)*2);--nut-display-track:var(--ui-bg-accented);--nut-display-code-bg:var(--ui-color-neutral-900);--nut-display-code-ink:var(--ui-color-neutral-100);--nut-display-code-muted:var(--ui-color-neutral-400);--nut-display-code-line:var(--ui-color-neutral-800);--nut-display-code-key:var(--ui-color-primary-300);--nut-display-code-string:var(--ui-color-success-300);--nut-display-code-number:var(--ui-color-info-300);--nut-display-code-literal:var(--ui-color-error-300);--nut-display-primary:var(--ui-primary);--nut-display-primary-ink:var(--ui-primary);--nut-display-primary-soft:color-mix(in oklab,var(--ui-primary) 10%,var(--ui-bg));--nut-display-primary-line:color-mix(in oklab,var(--ui-primary) 40%,var(--ui-bg));--nut-display-primary-contrast:var(--ui-text-inverted);--nut-display-secondary:var(--ui-secondary);--nut-display-secondary-ink:var(--ui-secondary);--nut-display-secondary-soft:color-mix(in oklab,var(--ui-secondary) 10%,var(--ui-bg));--nut-display-secondary-line:color-mix(in oklab,var(--ui-secondary) 40%,var(--ui-bg));--nut-display-secondary-contrast:var(--ui-text-inverted);--nut-display-success:var(--ui-success);--nut-display-success-ink:var(--ui-success);--nut-display-success-soft:color-mix(in oklab,var(--ui-success) 10%,var(--ui-bg));--nut-display-success-line:color-mix(in oklab,var(--ui-success) 40%,var(--ui-bg));--nut-display-success-contrast:var(--ui-text-inverted);--nut-display-info:var(--ui-info);--nut-display-info-ink:var(--ui-info);--nut-display-info-soft:color-mix(in oklab,var(--ui-info) 10%,var(--ui-bg));--nut-display-info-line:color-mix(in oklab,var(--ui-info) 40%,var(--ui-bg));--nut-display-info-contrast:var(--ui-text-inverted);--nut-display-warning:var(--ui-warning);--nut-display-warning-ink:var(--ui-warning);--nut-display-warning-soft:color-mix(in oklab,var(--ui-warning) 10%,var(--ui-bg));--nut-display-warning-line:color-mix(in oklab,var(--ui-warning) 40%,var(--ui-bg));--nut-display-warning-contrast:var(--ui-text-inverted);--nut-display-error:var(--ui-error);--nut-display-error-ink:var(--ui-error);--nut-display-error-soft:color-mix(in oklab,var(--ui-error) 10%,var(--ui-bg));--nut-display-error-line:color-mix(in oklab,var(--ui-error) 40%,var(--ui-bg));--nut-display-error-contrast:var(--ui-text-inverted);--nut-display-neutral:var(--ui-bg-inverted);--nut-display-neutral-ink:var(--ui-text-toned);--nut-display-neutral-soft:var(--ui-bg-elevated);--nut-display-neutral-line:var(--ui-border-accented);--nut-display-neutral-contrast:var(--ui-text-inverted)}:where(.dark){--nut-display-code-bg:var(--ui-color-neutral-950);--nut-display-code-line:var(--ui-color-neutral-800)}:where(.nut-display-tone-primary){--nut-tone:var(--nut-display-primary);--nut-tone-ink:var(--nut-display-primary-ink);--nut-tone-soft:var(--nut-display-primary-soft);--nut-tone-line:var(--nut-display-primary-line);--nut-tone-contrast:var(--nut-display-primary-contrast)}:where(.nut-display-tone-secondary){--nut-tone:var(--nut-display-secondary);--nut-tone-ink:var(--nut-display-secondary-ink);--nut-tone-soft:var(--nut-display-secondary-soft);--nut-tone-line:var(--nut-display-secondary-line);--nut-tone-contrast:var(--nut-display-secondary-contrast)}:where(.nut-display-tone-success){--nut-tone:var(--nut-display-success);--nut-tone-ink:var(--nut-display-success-ink);--nut-tone-soft:var(--nut-display-success-soft);--nut-tone-line:var(--nut-display-success-line);--nut-tone-contrast:var(--nut-display-success-contrast)}:where(.nut-display-tone-info){--nut-tone:var(--nut-display-info);--nut-tone-ink:var(--nut-display-info-ink);--nut-tone-soft:var(--nut-display-info-soft);--nut-tone-line:var(--nut-display-info-line);--nut-tone-contrast:var(--nut-display-info-contrast)}:where(.nut-display-tone-warning){--nut-tone:var(--nut-display-warning);--nut-tone-ink:var(--nut-display-warning-ink);--nut-tone-soft:var(--nut-display-warning-soft);--nut-tone-line:var(--nut-display-warning-line);--nut-tone-contrast:var(--nut-display-warning-contrast)}:where(.nut-display-tone-error){--nut-tone:var(--nut-display-error);--nut-tone-ink:var(--nut-display-error-ink);--nut-tone-soft:var(--nut-display-error-soft);--nut-tone-line:var(--nut-display-error-line);--nut-tone-contrast:var(--nut-display-error-contrast)}:where(.nut-display-tone-neutral){--nut-tone:var(--nut-display-neutral);--nut-tone-ink:var(--nut-display-neutral-ink);--nut-tone-soft:var(--nut-display-neutral-soft);--nut-tone-line:var(--nut-display-neutral-line);--nut-tone-contrast:var(--nut-display-neutral-contrast)}}@layer components{.nut-dash-chart{--vis-font-family:inherit;--vis-axis-tick-label-color:var(--nut-dash-axis);--vis-axis-tick-label-font-size:10px;--vis-axis-grid-color:var(--nut-dash-grid);--vis-axis-domain-color:var(--nut-dash-grid);--vis-crosshair-line-stroke-color:var(--ui-border-accented);--vis-crosshair-circle-stroke-color:var(--ui-bg);--vis-tooltip-background-color:var(--ui-bg);--vis-tooltip-border-color:var(--ui-border);--vis-tooltip-text-color:var(--ui-text);--vis-tooltip-padding:8px 10px;--vis-tooltip-border-radius:calc(var(--ui-radius)*1.5);--vis-tooltip-shadow-color:rgb(0 0 0/8%);--vis-plotline-label-font-size:10px}.nut-dash-chart--bars [data-vis-component] rect:hover{opacity:.8}.nut-dash-tip{display:flex;flex-direction:column;font-size:12px;gap:4px;min-width:9rem}.nut-dash-tip-title{color:var(--ui-text-muted);font-weight:500}.nut-dash-tip-row{align-items:center;display:flex;gap:6px}.nut-dash-tip-row i{border-radius:2px;height:8px;width:8px}.nut-dash-tip-row span{color:var(--ui-text-muted);flex:1}.nut-dash-tip-row b{font-variant-numeric:tabular-nums;font-weight:600}.nut-dash-ghost{background:var(--nut-dash-ghost)}.nut-dash-shimmer{overflow:hidden;position:relative}.nut-dash-shimmer:after{animation:nut-dash-shimmer 1.6s ease-in-out infinite;background:linear-gradient(100deg,transparent 25%,var(--nut-dash-ghost-shine) 50%,transparent 75%);content:"";inset:0;pointer-events:none;position:absolute;transform:translateX(-100%);will-change:transform}@keyframes nut-dash-shimmer{to{transform:translateX(100%)}}.nut-dash-enter{animation:nut-dash-enter .28s ease-out}@keyframes nut-dash-enter{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:none}}.nut-dash-progress{animation:nut-dash-progress 1.1s ease-in-out infinite}@keyframes nut-dash-progress{0%{transform:translateX(-100%)}to{transform:translateX(300%)}}@media (prefers-reduced-motion:reduce){.nut-dash-shimmer:after{display:none}.nut-dash-enter{animation:none}.nut-dash-progress{animation-duration:3s}}.nut-fp-checker{background-color:var(--nut-fp-checker-a);background-image:conic-gradient(var(--nut-fp-checker-b) 25%,transparent 0 50%,var(--nut-fp-checker-b) 0 75%,transparent 0);background-size:18px 18px}.nut-fp-code [data-token=key]{color:var(--nut-fp-token-key)}.nut-fp-code [data-token=string]{color:var(--nut-fp-token-string)}.nut-fp-code [data-token=number]{color:var(--nut-fp-token-number)}.nut-fp-code [data-token=literal]{color:var(--nut-fp-token-literal)}[data-file-preview-bottom][data-single]:has([data-file-preview-tools]:empty){display:none}@keyframes nut-fp-progress{0%{transform:translateX(-100%)}to{transform:translateX(300%)}}.nut-fp-progress{animation:nut-fp-progress 1s ease-in-out infinite}@keyframes nut-fp-equalizer{to{transform:scaleY(.45)}}.nut-fp-equalizer{animation:nut-fp-equalizer .9s ease-in-out infinite alternate}@media (prefers-reduced-motion:reduce){.nut-fp-progress{animation-duration:2.4s}.nut-fp-equalizer{animation:none}}.nut-fp-prose{color:var(--ui-text);font-size:.925rem;line-height:1.7}.nut-fp-prose>:first-child{margin-top:0}.nut-fp-prose :where(h1,h2,h3,h4){color:var(--ui-text-highlighted);font-weight:650;letter-spacing:-.01em;line-height:1.25;margin:1.75em 0 .6em}.nut-fp-prose h1{font-size:1.6em}.nut-fp-prose h2{font-size:1.25em}.nut-fp-prose h3{font-size:1.05em}.nut-fp-prose :where(p,ul,ol,pre,table,blockquote){margin:0 0 1em}.nut-fp-prose :where(ul,ol){padding-inline-start:1.4em}.nut-fp-prose ul{list-style:disc}.nut-fp-prose ol{list-style:decimal}.nut-fp-prose a{color:var(--ui-primary);text-decoration:underline;text-underline-offset:2px}.nut-fp-prose :not(pre)>code{background:var(--ui-bg-elevated);border:1px solid var(--ui-border-muted);border-radius:4px;font-size:.86em;padding:.1em .35em}.nut-fp-prose pre{background:var(--ui-bg-elevated);border:1px solid var(--ui-border);border-radius:8px;font-size:.85em;overflow-x:auto;padding:.9em 1.1em}.nut-fp-prose table{border-collapse:collapse;display:block;font-size:.9em;overflow-x:auto}.nut-fp-prose :where(th,td){border:1px solid var(--ui-border);padding:.4em .75em;text-align:start}.nut-fp-prose th{background:var(--ui-bg-elevated);font-weight:600}.nut-fp-prose blockquote{border-inline-start:3px solid var(--ui-primary);color:var(--ui-text-toned);padding-inline-start:1em}.nut-fp-prose img{border-radius:6px;max-width:100%}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function fileIconName(type: string | null | undefined): "i-lucide-file
|
|
1
|
+
export declare function fileIconName(type: string | null | undefined): "i-lucide-file" | "i-lucide-file-text" | "i-lucide-file-image" | "i-lucide-file-video" | "i-lucide-file-audio" | "i-lucide-file-spreadsheet" | "i-lucide-file-type" | "i-lucide-file-archive";
|
|
2
2
|
/** Lowercase extension of a file name without the dot, or `null` when it has none. */
|
|
3
3
|
export declare function fileExtension(name: string): string | null;
|
|
4
4
|
export declare function fileExtensionLabel(file: {
|
|
@@ -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.1",
|
|
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"
|