nuxt-ui-tools 1.1.0 → 1.3.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.json +1 -1
- package/dist/module.mjs +10 -1
- package/dist/runtime/dashboard/components/block/dashboard-block-state.d.vue.ts +2 -0
- package/dist/runtime/dashboard/components/block/dashboard-block-state.vue +4 -1
- package/dist/runtime/dashboard/components/block/dashboard-block-state.vue.d.ts +2 -0
- package/dist/runtime/dashboard/components/block/dashboard-chips.d.vue.ts +20 -0
- package/dist/runtime/dashboard/components/block/dashboard-chips.vue +42 -0
- package/dist/runtime/dashboard/components/block/dashboard-chips.vue.d.ts +20 -0
- package/dist/runtime/dashboard/components/block/dashboard-series-picker.d.vue.ts +8 -0
- package/dist/runtime/dashboard/components/block/dashboard-series-picker.vue +29 -0
- package/dist/runtime/dashboard/components/block/dashboard-series-picker.vue.d.ts +8 -0
- package/dist/runtime/dashboard/components/block/dashboard-skeleton.d.vue.ts +1 -1
- package/dist/runtime/dashboard/components/block/dashboard-skeleton.vue +6 -3
- package/dist/runtime/dashboard/components/block/dashboard-skeleton.vue.d.ts +1 -1
- package/dist/runtime/dashboard/components/block/dashboard-view-scope.d.vue.ts +21 -0
- package/dist/runtime/dashboard/components/block/dashboard-view-scope.vue +12 -0
- package/dist/runtime/dashboard/components/block/dashboard-view-scope.vue.d.ts +21 -0
- package/dist/runtime/dashboard/components/dashboard-alerts.vue +3 -3
- package/dist/runtime/dashboard/components/dashboard-bar-chart.d.vue.ts +14 -3
- package/dist/runtime/dashboard/components/dashboard-bar-chart.vue +30 -9
- package/dist/runtime/dashboard/components/dashboard-bar-chart.vue.d.ts +14 -3
- package/dist/runtime/dashboard/components/dashboard-bars.vue +4 -4
- package/dist/runtime/dashboard/components/dashboard-card.vue +28 -6
- package/dist/runtime/dashboard/components/dashboard-combo-chart.d.vue.ts +6 -1
- package/dist/runtime/dashboard/components/dashboard-combo-chart.vue +13 -3
- package/dist/runtime/dashboard/components/dashboard-combo-chart.vue.d.ts +6 -1
- package/dist/runtime/dashboard/components/dashboard-donut-chart.vue +5 -5
- package/dist/runtime/dashboard/components/dashboard-feed.vue +8 -7
- package/dist/runtime/dashboard/components/dashboard-filter.d.vue.ts +67 -0
- package/dist/runtime/dashboard/components/dashboard-filter.vue +134 -0
- package/dist/runtime/dashboard/components/dashboard-filter.vue.d.ts +67 -0
- package/dist/runtime/dashboard/components/dashboard-filters.d.vue.ts +49 -0
- package/dist/runtime/dashboard/components/dashboard-filters.vue +96 -0
- package/dist/runtime/dashboard/components/dashboard-filters.vue.d.ts +49 -0
- package/dist/runtime/dashboard/components/dashboard-funnel.vue +5 -5
- package/dist/runtime/dashboard/components/dashboard-gauge.vue +3 -3
- package/dist/runtime/dashboard/components/dashboard-grid.d.vue.ts +10 -3
- package/dist/runtime/dashboard/components/dashboard-grid.vue +24 -9
- package/dist/runtime/dashboard/components/dashboard-grid.vue.d.ts +10 -3
- package/dist/runtime/dashboard/components/dashboard-line-chart.d.vue.ts +14 -3
- package/dist/runtime/dashboard/components/dashboard-line-chart.vue +30 -9
- package/dist/runtime/dashboard/components/dashboard-line-chart.vue.d.ts +14 -3
- package/dist/runtime/dashboard/components/dashboard-list.d.vue.ts +3 -0
- package/dist/runtime/dashboard/components/dashboard-list.vue +18 -6
- package/dist/runtime/dashboard/components/dashboard-list.vue.d.ts +3 -0
- package/dist/runtime/dashboard/components/dashboard-page.d.vue.ts +53 -0
- package/dist/runtime/dashboard/components/dashboard-page.vue +156 -0
- package/dist/runtime/dashboard/components/dashboard-page.vue.d.ts +53 -0
- package/dist/runtime/dashboard/components/dashboard-paired-bars.vue +4 -4
- package/dist/runtime/dashboard/components/dashboard-refresh.d.vue.ts +1 -1
- package/dist/runtime/dashboard/components/dashboard-refresh.vue +1 -0
- package/dist/runtime/dashboard/components/dashboard-refresh.vue.d.ts +1 -1
- package/dist/runtime/dashboard/components/dashboard-stack-bar.vue +4 -4
- package/dist/runtime/dashboard/components/dashboard-stat.d.vue.ts +14 -2
- package/dist/runtime/dashboard/components/dashboard-stat.vue +28 -10
- package/dist/runtime/dashboard/components/dashboard-stat.vue.d.ts +14 -2
- package/dist/runtime/dashboard/components/dashboard-stats.vue +3 -3
- package/dist/runtime/dashboard/components/dashboard-table.d.vue.ts +1 -1
- package/dist/runtime/dashboard/components/dashboard-table.vue +3 -3
- package/dist/runtime/dashboard/components/dashboard-table.vue.d.ts +1 -1
- package/dist/runtime/dashboard/components/dashboard-tabs.d.vue.ts +1 -1
- package/dist/runtime/dashboard/components/dashboard-tabs.vue.d.ts +1 -1
- package/dist/runtime/dashboard/components/dashboard-total.d.vue.ts +7 -2
- package/dist/runtime/dashboard/components/dashboard-total.vue +10 -2
- package/dist/runtime/dashboard/components/dashboard-total.vue.d.ts +7 -2
- package/dist/runtime/dashboard/components/dashboard-view-tabs.d.vue.ts +33 -0
- package/dist/runtime/dashboard/components/dashboard-view-tabs.vue +66 -0
- package/dist/runtime/dashboard/components/dashboard-view-tabs.vue.d.ts +33 -0
- package/dist/runtime/dashboard/components/dashboard-widget.vue +1 -1
- package/dist/runtime/dashboard/components/filter/dashboard-filter-menu.d.vue.ts +44 -0
- package/dist/runtime/dashboard/components/filter/dashboard-filter-menu.vue +220 -0
- package/dist/runtime/dashboard/components/filter/dashboard-filter-menu.vue.d.ts +44 -0
- package/dist/runtime/dashboard/composables/use-dashboard-api.d.ts +6 -1
- package/dist/runtime/dashboard/composables/use-dashboard-api.js +29 -6
- package/dist/runtime/dashboard/composables/use-dashboard-block.d.ts +5 -4
- package/dist/runtime/dashboard/composables/use-dashboard-block.js +32 -15
- package/dist/runtime/dashboard/composables/use-dashboard-chart.d.ts +8 -1
- package/dist/runtime/dashboard/composables/use-dashboard-chart.js +16 -4
- package/dist/runtime/dashboard/composables/use-dashboard-context.d.ts +50 -0
- package/dist/runtime/dashboard/composables/use-dashboard-context.js +56 -0
- package/dist/runtime/dashboard/composables/use-dashboard-derived.js +6 -1
- package/dist/runtime/dashboard/composables/use-dashboard-filter-control.d.ts +16 -0
- package/dist/runtime/dashboard/composables/use-dashboard-filter-control.js +161 -0
- package/dist/runtime/dashboard/composables/use-dashboard-filter-scope.d.ts +37 -0
- package/dist/runtime/dashboard/composables/use-dashboard-filter-scope.js +107 -0
- package/dist/runtime/dashboard/composables/use-dashboard-format.d.ts +46 -6
- package/dist/runtime/dashboard/composables/use-dashboard-format.js +51 -8
- package/dist/runtime/dashboard/composables/use-dashboard-options.d.ts +11 -4
- package/dist/runtime/dashboard/composables/use-dashboard-options.js +33 -47
- package/dist/runtime/dashboard/composables/use-dashboard-remote-options.d.ts +8 -5
- package/dist/runtime/dashboard/composables/use-dashboard-remote-options.js +66 -77
- package/dist/runtime/dashboard/composables/use-dashboard-resource.d.ts +15 -4
- package/dist/runtime/dashboard/composables/use-dashboard-resource.js +52 -17
- package/dist/runtime/dashboard/composables/use-dashboard-scope.d.ts +10 -7
- package/dist/runtime/dashboard/composables/use-dashboard-scope.js +26 -16
- package/dist/runtime/dashboard/composables/use-dashboard-series-picker.d.ts +20 -0
- package/dist/runtime/dashboard/composables/use-dashboard-series-picker.js +30 -0
- package/dist/runtime/dashboard/composables/use-dashboard-time.d.ts +2 -0
- package/dist/runtime/dashboard/composables/use-dashboard-time.js +4 -1
- package/dist/runtime/dashboard/composables/use-dashboard-ui.d.ts +12 -2
- package/dist/runtime/dashboard/composables/use-dashboard-ui.js +3 -0
- package/dist/runtime/dashboard/composables/use-dashboard-views.d.ts +15 -3
- package/dist/runtime/dashboard/composables/use-dashboard-views.js +33 -10
- package/dist/runtime/dashboard/composables/use-dashboard.d.ts +18 -12
- package/dist/runtime/dashboard/composables/use-dashboard.js +98 -9
- package/dist/runtime/dashboard/index.d.ts +3 -1
- package/dist/runtime/dashboard/index.js +3 -1
- package/dist/runtime/dashboard/schema/index.d.ts +62 -30
- package/dist/runtime/dashboard/schema/index.js +3 -0
- package/dist/runtime/dashboard/types/blocks.d.ts +30 -4
- package/dist/runtime/dashboard/types/charts.d.ts +2 -2
- package/dist/runtime/dashboard/types/controls.d.ts +123 -0
- package/dist/runtime/dashboard/types/filters.d.ts +236 -0
- package/dist/runtime/dashboard/types/index.d.ts +3 -2
- package/dist/runtime/dashboard/types/page.d.ts +17 -0
- package/dist/runtime/dashboard/types/page.js +0 -0
- package/dist/runtime/dashboard/types/resource.d.ts +66 -28
- package/dist/runtime/dashboard/types/runtime.d.ts +39 -8
- package/dist/runtime/dashboard/types/schema.d.ts +94 -54
- package/dist/runtime/dashboard/types/ui.d.ts +78 -0
- package/dist/runtime/dashboard/utils/builders/dashboard-filters.d.ts +142 -0
- package/dist/runtime/dashboard/utils/builders/dashboard-filters.js +135 -0
- package/dist/runtime/dashboard/utils/charts.d.ts +4 -15
- package/dist/runtime/dashboard/utils/charts.js +26 -28
- package/dist/runtime/dashboard/utils/{params/codecs.d.ts → codecs.d.ts} +2 -2
- package/dist/runtime/dashboard/utils/{params/codecs.js → codecs.js} +1 -1
- package/dist/runtime/dashboard/utils/environment.d.ts +36 -0
- package/dist/runtime/dashboard/utils/environment.js +30 -0
- package/dist/runtime/dashboard/utils/filters.d.ts +44 -0
- package/dist/runtime/dashboard/utils/filters.js +62 -0
- package/dist/runtime/dashboard/utils/format.d.ts +25 -0
- package/dist/runtime/dashboard/utils/format.js +66 -0
- package/dist/runtime/dashboard/utils/grid.d.ts +17 -0
- package/dist/runtime/dashboard/utils/grid.js +14 -0
- package/dist/runtime/dashboard/utils/options.d.ts +3 -8
- package/dist/runtime/dashboard/utils/options.js +6 -5
- package/dist/runtime/dashboard/utils/remote.d.ts +7 -0
- package/dist/runtime/dashboard/utils/remote.js +14 -0
- package/dist/runtime/dashboard/utils/resource.d.ts +16 -7
- package/dist/runtime/dashboard/utils/resource.js +15 -9
- package/dist/runtime/dashboard/utils/schema.d.ts +8 -3
- package/dist/runtime/dashboard/utils/schema.js +9 -4
- package/dist/runtime/dashboard/utils/state.d.ts +11 -6
- package/dist/runtime/dashboard/utils/state.js +10 -5
- package/dist/runtime/dashboard/utils/time.d.ts +2 -0
- package/dist/runtime/dashboard/utils/time.js +11 -1
- package/dist/runtime/dashboard/utils/ui.d.ts +1 -1
- package/dist/runtime/dashboard/utils/ui.js +1 -1
- package/dist/runtime/form/components/root/form.vue +1 -1
- package/dist/runtime/form/fields/card-selection.d.ts +1 -0
- package/dist/runtime/form/fields/card-selection.js +1 -0
- package/dist/runtime/form/fields/checkbox-card/component.vue +3 -1
- package/dist/runtime/form/fields/checkbox-group/component.vue +5 -0
- package/dist/runtime/form/fields/radio/component.vue +10 -0
- package/dist/runtime/form/fields/radio-card/component.vue +3 -1
- package/dist/runtime/form/types/options.d.ts +1 -11
- package/dist/runtime/form/utils/focus.js +1 -1
- package/dist/runtime/i18n/locales/en.js +32 -1
- package/dist/runtime/i18n/locales/fr.js +32 -1
- package/dist/runtime/i18n/types.d.ts +44 -0
- package/dist/runtime/shared/styles/scrollbars.css +1 -1
- package/dist/runtime/shared/styles/tokens.css +1 -1
- package/dist/runtime/shared/types/query.d.ts +8 -0
- package/dist/runtime/shared/utils/remote-options.d.ts +10 -0
- package/dist/runtime/shared/utils/remote-options.js +6 -0
- package/dist/runtime/table/components/filters/shared/filter-option-list-end.d.vue.ts +11 -0
- package/dist/runtime/table/components/filters/shared/filter-option-list-end.vue +76 -0
- package/dist/runtime/table/components/filters/shared/filter-option-list-end.vue.d.ts +11 -0
- package/dist/runtime/table/components/filters/shared/filter-option-loading-list.d.vue.ts +3 -0
- package/dist/runtime/table/components/filters/shared/filter-option-loading-list.vue +2 -1
- package/dist/runtime/table/components/filters/shared/filter-option-loading-list.vue.d.ts +3 -0
- package/dist/runtime/table/components/filters/shared/filter-option-multiple-list.vue +1 -1
- package/dist/runtime/table/components/filters/shared/filter-option-picker-content.vue +13 -0
- package/dist/runtime/table/components/filters/shared/filter-option-single-list.d.vue.ts +2 -0
- package/dist/runtime/table/components/filters/shared/filter-option-single-list.vue +1 -1
- package/dist/runtime/table/components/filters/shared/filter-option-single-list.vue.d.ts +2 -0
- package/dist/runtime/table/components/filters/shared/filter-option-tree-content.d.vue.ts +3 -0
- package/dist/runtime/table/components/filters/shared/filter-option-tree-content.vue +2 -2
- package/dist/runtime/table/components/filters/shared/filter-option-tree-content.vue.d.ts +3 -0
- package/dist/runtime/table/components/filters/shared/filter-searchable-panel.vue +1 -0
- package/dist/runtime/table/composables/use-option-filter-editor-state.d.ts +13 -1
- package/dist/runtime/table/composables/use-option-filter-editor-state.js +6 -2
- package/dist/runtime/table/composables/use-table-filter-options.d.ts +11 -1
- package/dist/runtime/table/composables/use-table-filter-options.js +128 -17
- package/dist/runtime/table/composables/use-table-filter-selected-options.d.ts +20 -0
- package/dist/runtime/table/composables/use-table-filter-selected-options.js +99 -0
- package/dist/runtime/table/composables/use-table-filters.d.ts +5 -0
- package/dist/runtime/table/composables/use-table-filters.js +20 -1
- package/dist/runtime/table/composables/use-table-internals.d.ts +15 -0
- package/dist/runtime/table/composables/use-table-remote-filter-options.d.ts +42 -0
- package/dist/runtime/table/composables/use-table-remote-filter-options.js +102 -0
- package/dist/runtime/table/types/filters.d.ts +42 -0
- package/dist/runtime/table/types/index.d.ts +1 -0
- package/dist/runtime/table/types/remote-options.d.ts +64 -0
- package/dist/runtime/table/types/remote-options.js +0 -0
- package/dist/runtime/table/types/source.d.ts +15 -1
- package/dist/runtime/table/utils/builders/table-source.d.ts +2 -6
- package/dist/runtime/table/utils/filters/options.d.ts +2 -0
- package/dist/runtime/table/utils/filters/options.js +1 -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 +21 -1
- package/dist/runtime/table/utils/remote-table-options.d.ts +26 -0
- package/dist/runtime/table/utils/remote-table-options.js +88 -0
- package/package.json +4 -1
- package/dist/runtime/dashboard/composables/use-dashboard-param-scope.d.ts +0 -30
- package/dist/runtime/dashboard/composables/use-dashboard-param-scope.js +0 -71
- package/dist/runtime/dashboard/types/options.d.ts +0 -46
- package/dist/runtime/dashboard/types/params.d.ts +0 -115
- package/dist/runtime/dashboard/utils/builders/dashboard-params.d.ts +0 -85
- package/dist/runtime/dashboard/utils/builders/dashboard-params.js +0 -87
- /package/dist/runtime/dashboard/types/{options.js → controls.js} +0 -0
- /package/dist/runtime/dashboard/types/{params.js → filters.js} +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import type { QueryCodec } from '../../../query-state/index.js';
|
|
2
|
-
import type { DashboardComparison, DashboardDateRange, DashboardOption, DashboardOptionValue, DashboardParamDefinition, DashboardParamOptions, DashboardRemoteOptionsConfig } from '../../types/index.js';
|
|
3
|
-
type ResolveParamValue<TValue, TDefault> = undefined extends TDefault ? TValue | undefined : TValue;
|
|
4
|
-
declare function stringParam<const TDefault extends string | undefined = undefined>(options?: DashboardParamOptions<TDefault>): DashboardParamDefinition<ResolveParamValue<string, TDefault>> & {
|
|
5
|
-
readonly kind: 'string';
|
|
6
|
-
};
|
|
7
|
-
declare function numberParam<const TDefault extends number | undefined = undefined>(options?: DashboardParamOptions<TDefault>): DashboardParamDefinition<ResolveParamValue<number, TDefault>> & {
|
|
8
|
-
readonly kind: 'number';
|
|
9
|
-
};
|
|
10
|
-
declare function booleanParam<const TDefault extends boolean | undefined = undefined>(options?: DashboardParamOptions<TDefault>): DashboardParamDefinition<ResolveParamValue<boolean, TDefault>> & {
|
|
11
|
-
readonly kind: 'boolean';
|
|
12
|
-
};
|
|
13
|
-
declare function dateParam<const TDefault extends Date | undefined = undefined>(options?: DashboardParamOptions<TDefault>): DashboardParamDefinition<ResolveParamValue<Date, TDefault>> & {
|
|
14
|
-
readonly kind: 'date';
|
|
15
|
-
};
|
|
16
|
-
declare function dateRangeParam<const TDefault extends DashboardDateRange | undefined = undefined>(options?: DashboardParamOptions<TDefault>): DashboardParamDefinition<ResolveParamValue<DashboardDateRange, TDefault>> & {
|
|
17
|
-
readonly kind: 'dateRange';
|
|
18
|
-
};
|
|
19
|
-
declare function enumParam<const TValues extends readonly DashboardOptionValue[]>(values: TValues, options: DashboardParamOptions<readonly TValues[number][]> & {
|
|
20
|
-
multiple: true;
|
|
21
|
-
}): DashboardParamDefinition<TValues[number][]> & {
|
|
22
|
-
readonly kind: 'enum';
|
|
23
|
-
};
|
|
24
|
-
declare function enumParam<const TValues extends readonly DashboardOptionValue[], const TDefault extends TValues[number] | undefined = undefined>(values: TValues, options?: DashboardParamOptions<TDefault> & {
|
|
25
|
-
multiple?: false;
|
|
26
|
-
}): DashboardParamDefinition<ResolveParamValue<TValues[number], TDefault>> & {
|
|
27
|
-
readonly kind: 'enum';
|
|
28
|
-
};
|
|
29
|
-
declare function optionsParam<const TItems extends readonly DashboardOption[]>(items: TItems, options: DashboardParamOptions<readonly TItems[number]['value'][]> & {
|
|
30
|
-
multiple: true;
|
|
31
|
-
}): DashboardParamDefinition<TItems[number]['value'][]> & {
|
|
32
|
-
readonly kind: 'options';
|
|
33
|
-
};
|
|
34
|
-
declare function optionsParam<const TItems extends readonly DashboardOption[], const TDefault extends TItems[number]['value'] | undefined = undefined>(items: TItems, options?: DashboardParamOptions<TDefault> & {
|
|
35
|
-
multiple?: false;
|
|
36
|
-
}): DashboardParamDefinition<ResolveParamValue<TItems[number]['value'], TDefault>> & {
|
|
37
|
-
readonly kind: 'options';
|
|
38
|
-
};
|
|
39
|
-
declare function remoteParam(config: DashboardRemoteOptionsConfig & DashboardParamOptions<readonly string[]> & {
|
|
40
|
-
multiple: true;
|
|
41
|
-
}): DashboardParamDefinition<string[]> & {
|
|
42
|
-
readonly kind: 'remote';
|
|
43
|
-
};
|
|
44
|
-
declare function remoteParam<const TDefault extends string | undefined = undefined>(config: DashboardRemoteOptionsConfig & DashboardParamOptions<TDefault> & {
|
|
45
|
-
multiple?: false;
|
|
46
|
-
}): DashboardParamDefinition<ResolveParamValue<string, TDefault>> & {
|
|
47
|
-
readonly kind: 'remote';
|
|
48
|
-
};
|
|
49
|
-
/** Values of `p.comparison`, in menu order. */
|
|
50
|
-
export declare const DASHBOARD_COMPARISONS: readonly ["previous", "year", "none"];
|
|
51
|
-
declare function comparisonParam<const TDefault extends DashboardComparison | undefined = undefined>(options?: DashboardParamOptions<TDefault>): DashboardParamDefinition<ResolveParamValue<DashboardComparison, TDefault>> & {
|
|
52
|
-
readonly kind: 'comparison';
|
|
53
|
-
};
|
|
54
|
-
declare function customParam<TValue, const TDefault extends TValue | undefined = undefined>(codec: QueryCodec<TValue>, options?: DashboardParamOptions<TDefault>): DashboardParamDefinition<ResolveParamValue<TValue, TDefault>> & {
|
|
55
|
-
readonly kind: 'custom';
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* The `p` builder handed to every `params` callback. Each method declares one typed, URL-synced
|
|
59
|
-
* param; the engine renders no controls, the app binds `v-model` to the resulting value.
|
|
60
|
-
*
|
|
61
|
-
* Every param accepts `defaultValue` (narrows away `undefined`), `urlKey`, `omitDefault`, and
|
|
62
|
-
* `historyMode`. Option-backed params (`enum`, `options`, `remote`) also accept `multiple: true`,
|
|
63
|
-
* which turns the value into an always-defined array.
|
|
64
|
-
*/
|
|
65
|
-
export declare const dashboardParamBuilder: {
|
|
66
|
-
boolean: typeof booleanParam;
|
|
67
|
-
/**
|
|
68
|
-
* Comparison period: `'previous'`, `'year'`, or `'none'`. Its option handle carries localized
|
|
69
|
-
* labels; `resolveDashboardComparisonRange(range, mode)` turns it into the range to fetch.
|
|
70
|
-
*/
|
|
71
|
-
comparison: typeof comparisonParam;
|
|
72
|
-
custom: typeof customParam;
|
|
73
|
-
date: typeof dateParam;
|
|
74
|
-
/** Inclusive date range, serialized as `YYYY-MM-DD..YYYY-MM-DD`. */
|
|
75
|
-
dateRange: typeof dateRangeParam;
|
|
76
|
-
/** Value(s) from a literal list, e.g. `p.enum([2024, 2025, 2026], { defaultValue: 2026 })`. */
|
|
77
|
-
enum: typeof enumParam;
|
|
78
|
-
number: typeof numberParam;
|
|
79
|
-
/** Value(s) from labeled items: `{ value, label, icon?, avatar?, description? }`. */
|
|
80
|
-
options: typeof optionsParam;
|
|
81
|
-
/** Id(s) picked from a remote, searchable, paginated option source. */
|
|
82
|
-
remote: typeof remoteParam;
|
|
83
|
-
string: typeof stringParam;
|
|
84
|
-
};
|
|
85
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createListCodec,
|
|
3
|
-
createOptionValueCodec,
|
|
4
|
-
createSafeCodec,
|
|
5
|
-
dateRangeCodec,
|
|
6
|
-
localDateCodec,
|
|
7
|
-
optionalBooleanCodec,
|
|
8
|
-
optionalNumberCodec,
|
|
9
|
-
optionalStringCodec
|
|
10
|
-
} from "../params/codecs.js";
|
|
11
|
-
function defineParam(kind, codec, options = {}) {
|
|
12
|
-
const multiple = options.multiple === true;
|
|
13
|
-
return {
|
|
14
|
-
codec: multiple ? createListCodec(codec) : codec,
|
|
15
|
-
defaultValue: options.defaultValue ?? (multiple ? [] : void 0),
|
|
16
|
-
historyMode: options.historyMode,
|
|
17
|
-
items: options.items,
|
|
18
|
-
kind,
|
|
19
|
-
multiple,
|
|
20
|
-
omitDefault: options.omitDefault,
|
|
21
|
-
remote: options.remote,
|
|
22
|
-
urlKey: options.urlKey
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
function stringParam(options) {
|
|
26
|
-
return defineParam("string", optionalStringCodec, options);
|
|
27
|
-
}
|
|
28
|
-
function numberParam(options) {
|
|
29
|
-
return defineParam("number", optionalNumberCodec, options);
|
|
30
|
-
}
|
|
31
|
-
function booleanParam(options) {
|
|
32
|
-
return defineParam("boolean", optionalBooleanCodec, options);
|
|
33
|
-
}
|
|
34
|
-
function dateParam(options) {
|
|
35
|
-
return defineParam("date", localDateCodec, options);
|
|
36
|
-
}
|
|
37
|
-
function dateRangeParam(options) {
|
|
38
|
-
return defineParam("dateRange", dateRangeCodec, options);
|
|
39
|
-
}
|
|
40
|
-
function enumParam(values, options) {
|
|
41
|
-
const items = values.map((value) => ({ label: String(value), value }));
|
|
42
|
-
return defineParam("enum", createOptionValueCodec(values), { ...options, items });
|
|
43
|
-
}
|
|
44
|
-
function optionsParam(items, options) {
|
|
45
|
-
const codec = createOptionValueCodec(items.map((item) => item.value));
|
|
46
|
-
return defineParam("options", codec, { ...options, items });
|
|
47
|
-
}
|
|
48
|
-
function remoteParam(config) {
|
|
49
|
-
const { load, pagination, queryKey, resolveSelected, search, ...options } = config;
|
|
50
|
-
const remote = { load, pagination, queryKey, resolveSelected, search };
|
|
51
|
-
return defineParam("remote", optionalStringCodec, { ...options, remote });
|
|
52
|
-
}
|
|
53
|
-
export const DASHBOARD_COMPARISONS = [
|
|
54
|
-
"previous",
|
|
55
|
-
"year",
|
|
56
|
-
"none"
|
|
57
|
-
];
|
|
58
|
-
function comparisonParam(options) {
|
|
59
|
-
const items = DASHBOARD_COMPARISONS.map((value) => ({ label: value, value }));
|
|
60
|
-
return defineParam("comparison", createOptionValueCodec(DASHBOARD_COMPARISONS), {
|
|
61
|
-
...options,
|
|
62
|
-
items
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function customParam(codec, options) {
|
|
66
|
-
return defineParam("custom", createSafeCodec(codec), options);
|
|
67
|
-
}
|
|
68
|
-
export const dashboardParamBuilder = {
|
|
69
|
-
boolean: booleanParam,
|
|
70
|
-
/**
|
|
71
|
-
* Comparison period: `'previous'`, `'year'`, or `'none'`. Its option handle carries localized
|
|
72
|
-
* labels; `resolveDashboardComparisonRange(range, mode)` turns it into the range to fetch.
|
|
73
|
-
*/
|
|
74
|
-
comparison: comparisonParam,
|
|
75
|
-
custom: customParam,
|
|
76
|
-
date: dateParam,
|
|
77
|
-
/** Inclusive date range, serialized as `YYYY-MM-DD..YYYY-MM-DD`. */
|
|
78
|
-
dateRange: dateRangeParam,
|
|
79
|
-
/** Value(s) from a literal list, e.g. `p.enum([2024, 2025, 2026], { defaultValue: 2026 })`. */
|
|
80
|
-
enum: enumParam,
|
|
81
|
-
number: numberParam,
|
|
82
|
-
/** Value(s) from labeled items: `{ value, label, icon?, avatar?, description? }`. */
|
|
83
|
-
options: optionsParam,
|
|
84
|
-
/** Id(s) picked from a remote, searchable, paginated option source. */
|
|
85
|
-
remote: remoteParam,
|
|
86
|
-
string: stringParam
|
|
87
|
-
};
|
|
File without changes
|
|
File without changes
|