nuxt-ui-tools 1.0.1 → 1.2.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.
Files changed (258) hide show
  1. package/dist/module.d.mts +3 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +37 -0
  4. package/dist/runtime/dashboard/components/block/dashboard-block-state.d.vue.ts +12 -0
  5. package/dist/runtime/dashboard/components/block/dashboard-block-state.vue +59 -0
  6. package/dist/runtime/dashboard/components/block/dashboard-block-state.vue.d.ts +12 -0
  7. package/dist/runtime/dashboard/components/block/dashboard-data-table.d.vue.ts +9 -0
  8. package/dist/runtime/dashboard/components/block/dashboard-data-table.vue +47 -0
  9. package/dist/runtime/dashboard/components/block/dashboard-data-table.vue.d.ts +9 -0
  10. package/dist/runtime/dashboard/components/block/dashboard-ring.d.vue.ts +34 -0
  11. package/dist/runtime/dashboard/components/block/dashboard-ring.vue +91 -0
  12. package/dist/runtime/dashboard/components/block/dashboard-ring.vue.d.ts +34 -0
  13. package/dist/runtime/dashboard/components/block/dashboard-row-actions.d.vue.ts +13 -0
  14. package/dist/runtime/dashboard/components/block/dashboard-row-actions.vue +49 -0
  15. package/dist/runtime/dashboard/components/block/dashboard-row-actions.vue.d.ts +13 -0
  16. package/dist/runtime/dashboard/components/block/dashboard-skeleton.d.vue.ts +34 -0
  17. package/dist/runtime/dashboard/components/block/dashboard-skeleton.vue +315 -0
  18. package/dist/runtime/dashboard/components/block/dashboard-skeleton.vue.d.ts +34 -0
  19. package/dist/runtime/dashboard/components/charts/renderer.d.ts +43 -0
  20. package/dist/runtime/dashboard/components/charts/renderer.js +34 -0
  21. package/dist/runtime/dashboard/components/charts/unovis/dashboard-donut-chart.d.vue.ts +18 -0
  22. package/dist/runtime/dashboard/components/charts/unovis/dashboard-donut-chart.vue +45 -0
  23. package/dist/runtime/dashboard/components/charts/unovis/dashboard-donut-chart.vue.d.ts +18 -0
  24. package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-chart.d.vue.ts +14 -0
  25. package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-chart.vue +190 -0
  26. package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-chart.vue.d.ts +14 -0
  27. package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-marks.d.vue.ts +13 -0
  28. package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-marks.vue +72 -0
  29. package/dist/runtime/dashboard/components/charts/unovis/dashboard-xy-marks.vue.d.ts +13 -0
  30. package/dist/runtime/dashboard/components/charts/unovis/xy-layers.d.ts +43 -0
  31. package/dist/runtime/dashboard/components/charts/unovis/xy-layers.js +60 -0
  32. package/dist/runtime/dashboard/components/dashboard-alerts.d.vue.ts +49 -0
  33. package/dist/runtime/dashboard/components/dashboard-alerts.vue +226 -0
  34. package/dist/runtime/dashboard/components/dashboard-alerts.vue.d.ts +49 -0
  35. package/dist/runtime/dashboard/components/dashboard-bar-chart.d.vue.ts +53 -0
  36. package/dist/runtime/dashboard/components/dashboard-bar-chart.vue +131 -0
  37. package/dist/runtime/dashboard/components/dashboard-bar-chart.vue.d.ts +53 -0
  38. package/dist/runtime/dashboard/components/dashboard-bars.d.vue.ts +49 -0
  39. package/dist/runtime/dashboard/components/dashboard-bars.vue +187 -0
  40. package/dist/runtime/dashboard/components/dashboard-bars.vue.d.ts +49 -0
  41. package/dist/runtime/dashboard/components/dashboard-card.d.vue.ts +47 -0
  42. package/dist/runtime/dashboard/components/dashboard-card.vue +316 -0
  43. package/dist/runtime/dashboard/components/dashboard-card.vue.d.ts +47 -0
  44. package/dist/runtime/dashboard/components/dashboard-combo-chart.d.vue.ts +52 -0
  45. package/dist/runtime/dashboard/components/dashboard-combo-chart.vue +128 -0
  46. package/dist/runtime/dashboard/components/dashboard-combo-chart.vue.d.ts +52 -0
  47. package/dist/runtime/dashboard/components/dashboard-donut-chart.d.vue.ts +48 -0
  48. package/dist/runtime/dashboard/components/dashboard-donut-chart.vue +216 -0
  49. package/dist/runtime/dashboard/components/dashboard-donut-chart.vue.d.ts +48 -0
  50. package/dist/runtime/dashboard/components/dashboard-feed.d.vue.ts +49 -0
  51. package/dist/runtime/dashboard/components/dashboard-feed.vue +239 -0
  52. package/dist/runtime/dashboard/components/dashboard-feed.vue.d.ts +49 -0
  53. package/dist/runtime/dashboard/components/dashboard-funnel.d.vue.ts +34 -0
  54. package/dist/runtime/dashboard/components/dashboard-funnel.vue +157 -0
  55. package/dist/runtime/dashboard/components/dashboard-funnel.vue.d.ts +34 -0
  56. package/dist/runtime/dashboard/components/dashboard-gauge.d.vue.ts +55 -0
  57. package/dist/runtime/dashboard/components/dashboard-gauge.vue +177 -0
  58. package/dist/runtime/dashboard/components/dashboard-gauge.vue.d.ts +55 -0
  59. package/dist/runtime/dashboard/components/dashboard-grid.d.vue.ts +38 -0
  60. package/dist/runtime/dashboard/components/dashboard-grid.vue +49 -0
  61. package/dist/runtime/dashboard/components/dashboard-grid.vue.d.ts +38 -0
  62. package/dist/runtime/dashboard/components/dashboard-legend.d.vue.ts +8 -0
  63. package/dist/runtime/dashboard/components/dashboard-legend.vue +37 -0
  64. package/dist/runtime/dashboard/components/dashboard-legend.vue.d.ts +8 -0
  65. package/dist/runtime/dashboard/components/dashboard-line-chart.d.vue.ts +46 -0
  66. package/dist/runtime/dashboard/components/dashboard-line-chart.vue +129 -0
  67. package/dist/runtime/dashboard/components/dashboard-line-chart.vue.d.ts +46 -0
  68. package/dist/runtime/dashboard/components/dashboard-list.d.vue.ts +63 -0
  69. package/dist/runtime/dashboard/components/dashboard-list.vue +239 -0
  70. package/dist/runtime/dashboard/components/dashboard-list.vue.d.ts +63 -0
  71. package/dist/runtime/dashboard/components/dashboard-paired-bars.d.vue.ts +43 -0
  72. package/dist/runtime/dashboard/components/dashboard-paired-bars.vue +194 -0
  73. package/dist/runtime/dashboard/components/dashboard-paired-bars.vue.d.ts +43 -0
  74. package/dist/runtime/dashboard/components/dashboard-refresh.d.vue.ts +29 -0
  75. package/dist/runtime/dashboard/components/dashboard-refresh.vue +86 -0
  76. package/dist/runtime/dashboard/components/dashboard-refresh.vue.d.ts +29 -0
  77. package/dist/runtime/dashboard/components/dashboard-relative-time.d.vue.ts +12 -0
  78. package/dist/runtime/dashboard/components/dashboard-relative-time.vue +23 -0
  79. package/dist/runtime/dashboard/components/dashboard-relative-time.vue.d.ts +12 -0
  80. package/dist/runtime/dashboard/components/dashboard-stack-bar.d.vue.ts +36 -0
  81. package/dist/runtime/dashboard/components/dashboard-stack-bar.vue +162 -0
  82. package/dist/runtime/dashboard/components/dashboard-stack-bar.vue.d.ts +36 -0
  83. package/dist/runtime/dashboard/components/dashboard-stat.d.vue.ts +69 -0
  84. package/dist/runtime/dashboard/components/dashboard-stat.vue +279 -0
  85. package/dist/runtime/dashboard/components/dashboard-stat.vue.d.ts +69 -0
  86. package/dist/runtime/dashboard/components/dashboard-stats.d.vue.ts +38 -0
  87. package/dist/runtime/dashboard/components/dashboard-stats.vue +202 -0
  88. package/dist/runtime/dashboard/components/dashboard-stats.vue.d.ts +38 -0
  89. package/dist/runtime/dashboard/components/dashboard-table.d.vue.ts +52 -0
  90. package/dist/runtime/dashboard/components/dashboard-table.vue +305 -0
  91. package/dist/runtime/dashboard/components/dashboard-table.vue.d.ts +52 -0
  92. package/dist/runtime/dashboard/components/dashboard-tabs.d.vue.ts +35 -0
  93. package/dist/runtime/dashboard/components/dashboard-tabs.vue +55 -0
  94. package/dist/runtime/dashboard/components/dashboard-tabs.vue.d.ts +35 -0
  95. package/dist/runtime/dashboard/components/dashboard-total.d.vue.ts +10 -0
  96. package/dist/runtime/dashboard/components/dashboard-total.vue +32 -0
  97. package/dist/runtime/dashboard/components/dashboard-total.vue.d.ts +10 -0
  98. package/dist/runtime/dashboard/components/dashboard-widget.d.vue.ts +46 -0
  99. package/dist/runtime/dashboard/components/dashboard-widget.vue +84 -0
  100. package/dist/runtime/dashboard/components/dashboard-widget.vue.d.ts +46 -0
  101. package/dist/runtime/dashboard/composables/use-dashboard-api.d.ts +15 -0
  102. package/dist/runtime/dashboard/composables/use-dashboard-api.js +91 -0
  103. package/dist/runtime/dashboard/composables/use-dashboard-block.d.ts +22 -0
  104. package/dist/runtime/dashboard/composables/use-dashboard-block.js +35 -0
  105. package/dist/runtime/dashboard/composables/use-dashboard-chart.d.ts +36 -0
  106. package/dist/runtime/dashboard/composables/use-dashboard-chart.js +118 -0
  107. package/dist/runtime/dashboard/composables/use-dashboard-derived.d.ts +12 -0
  108. package/dist/runtime/dashboard/composables/use-dashboard-derived.js +47 -0
  109. package/dist/runtime/dashboard/composables/use-dashboard-format.d.ts +6 -0
  110. package/dist/runtime/dashboard/composables/use-dashboard-format.js +12 -0
  111. package/dist/runtime/dashboard/composables/use-dashboard-options.d.ts +8 -0
  112. package/dist/runtime/dashboard/composables/use-dashboard-options.js +63 -0
  113. package/dist/runtime/dashboard/composables/use-dashboard-param-scope.d.ts +30 -0
  114. package/dist/runtime/dashboard/composables/use-dashboard-param-scope.js +71 -0
  115. package/dist/runtime/dashboard/composables/use-dashboard-remote-options.d.ts +12 -0
  116. package/dist/runtime/dashboard/composables/use-dashboard-remote-options.js +117 -0
  117. package/dist/runtime/dashboard/composables/use-dashboard-resource.d.ts +35 -0
  118. package/dist/runtime/dashboard/composables/use-dashboard-resource.js +80 -0
  119. package/dist/runtime/dashboard/composables/use-dashboard-scope.d.ts +46 -0
  120. package/dist/runtime/dashboard/composables/use-dashboard-scope.js +127 -0
  121. package/dist/runtime/dashboard/composables/use-dashboard-time.d.ts +13 -0
  122. package/dist/runtime/dashboard/composables/use-dashboard-time.js +40 -0
  123. package/dist/runtime/dashboard/composables/use-dashboard-ui.d.ts +22 -0
  124. package/dist/runtime/dashboard/composables/use-dashboard-ui.js +19 -0
  125. package/dist/runtime/dashboard/composables/use-dashboard-views.d.ts +46 -0
  126. package/dist/runtime/dashboard/composables/use-dashboard-views.js +49 -0
  127. package/dist/runtime/dashboard/composables/use-dashboard.d.ts +24 -0
  128. package/dist/runtime/dashboard/composables/use-dashboard.js +42 -0
  129. package/dist/runtime/dashboard/constants/query.d.ts +16 -0
  130. package/dist/runtime/dashboard/constants/query.js +15 -0
  131. package/dist/runtime/dashboard/index.d.ts +4 -0
  132. package/dist/runtime/dashboard/index.js +3 -0
  133. package/dist/runtime/dashboard/schema/index.d.ts +57 -0
  134. package/dist/runtime/dashboard/schema/index.js +3 -0
  135. package/dist/runtime/dashboard/types/blocks.d.ts +251 -0
  136. package/dist/runtime/dashboard/types/blocks.js +0 -0
  137. package/dist/runtime/dashboard/types/charts.d.ts +60 -0
  138. package/dist/runtime/dashboard/types/charts.js +0 -0
  139. package/dist/runtime/dashboard/types/index.d.ts +7 -0
  140. package/dist/runtime/dashboard/types/index.js +0 -0
  141. package/dist/runtime/dashboard/types/options.d.ts +46 -0
  142. package/dist/runtime/dashboard/types/options.js +0 -0
  143. package/dist/runtime/dashboard/types/params.d.ts +115 -0
  144. package/dist/runtime/dashboard/types/params.js +0 -0
  145. package/dist/runtime/dashboard/types/resource.d.ts +106 -0
  146. package/dist/runtime/dashboard/types/resource.js +0 -0
  147. package/dist/runtime/dashboard/types/runtime.d.ts +44 -0
  148. package/dist/runtime/dashboard/types/runtime.js +0 -0
  149. package/dist/runtime/dashboard/types/schema.d.ts +171 -0
  150. package/dist/runtime/dashboard/types/schema.js +0 -0
  151. package/dist/runtime/dashboard/types/ui.d.ts +201 -0
  152. package/dist/runtime/dashboard/types/ui.js +0 -0
  153. package/dist/runtime/dashboard/utils/builders/dashboard-params.d.ts +85 -0
  154. package/dist/runtime/dashboard/utils/builders/dashboard-params.js +87 -0
  155. package/dist/runtime/dashboard/utils/chart-frame.d.ts +5 -0
  156. package/dist/runtime/dashboard/utils/chart-frame.js +27 -0
  157. package/dist/runtime/dashboard/utils/charts.d.ts +61 -0
  158. package/dist/runtime/dashboard/utils/charts.js +142 -0
  159. package/dist/runtime/dashboard/utils/comparison.d.ts +15 -0
  160. package/dist/runtime/dashboard/utils/comparison.js +19 -0
  161. package/dist/runtime/dashboard/utils/export.d.ts +13 -0
  162. package/dist/runtime/dashboard/utils/export.js +45 -0
  163. package/dist/runtime/dashboard/utils/options.d.ts +5 -0
  164. package/dist/runtime/dashboard/utils/options.js +18 -0
  165. package/dist/runtime/dashboard/utils/params/codecs.d.ts +14 -0
  166. package/dist/runtime/dashboard/utils/params/codecs.js +69 -0
  167. package/dist/runtime/dashboard/utils/resource.d.ts +16 -0
  168. package/dist/runtime/dashboard/utils/resource.js +39 -0
  169. package/dist/runtime/dashboard/utils/schema.d.ts +9 -0
  170. package/dist/runtime/dashboard/utils/schema.js +31 -0
  171. package/dist/runtime/dashboard/utils/sparkline.d.ts +21 -0
  172. package/dist/runtime/dashboard/utils/sparkline.js +53 -0
  173. package/dist/runtime/dashboard/utils/state.d.ts +28 -0
  174. package/dist/runtime/dashboard/utils/state.js +32 -0
  175. package/dist/runtime/dashboard/utils/time.d.ts +17 -0
  176. package/dist/runtime/dashboard/utils/time.js +60 -0
  177. package/dist/runtime/dashboard/utils/tracker.d.ts +12 -0
  178. package/dist/runtime/dashboard/utils/tracker.js +31 -0
  179. package/dist/runtime/dashboard/utils/ui.d.ts +38 -0
  180. package/dist/runtime/dashboard/utils/ui.js +24 -0
  181. package/dist/runtime/dashboard/utils/visibility.d.ts +2 -0
  182. package/dist/runtime/dashboard/utils/visibility.js +25 -0
  183. package/dist/runtime/form/types/options.d.ts +15 -36
  184. package/dist/runtime/i18n/locales/en.js +65 -1
  185. package/dist/runtime/i18n/locales/fr.js +65 -1
  186. package/dist/runtime/i18n/types.d.ts +70 -0
  187. package/dist/runtime/shared/index.d.ts +2 -0
  188. package/dist/runtime/shared/styles/scrollbars.css +1 -1
  189. package/dist/runtime/shared/styles/tokens.css +1 -1
  190. package/dist/runtime/shared/types/query.d.ts +10 -0
  191. package/dist/runtime/shared/types/query.js +0 -0
  192. package/dist/runtime/shared/types/remote-options.d.ts +37 -0
  193. package/dist/runtime/shared/types/remote-options.js +0 -0
  194. package/dist/runtime/shared/utils/remote-options.d.ts +10 -0
  195. package/dist/runtime/shared/utils/remote-options.js +6 -0
  196. package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.d.vue.ts +2 -2
  197. package/dist/runtime/spreadsheet/components/layout/spreadsheet-import-footer.vue.d.ts +2 -2
  198. package/dist/runtime/spreadsheet/composables/use-spreadsheet-internals.d.ts +15 -15
  199. package/dist/runtime/spreadsheet/composables/use-spreadsheet-resolutions.d.ts +2 -2
  200. package/dist/runtime/spreadsheet/schema/normalize.d.ts +1 -1
  201. package/dist/runtime/spreadsheet/utils/references/sources.d.ts +1 -1
  202. package/dist/runtime/table/components/data-list/data-list-content.d.vue.ts +1 -1
  203. package/dist/runtime/table/components/data-list/data-list-content.vue.d.ts +1 -1
  204. package/dist/runtime/table/components/data-list/data-list-infinite-loader.d.vue.ts +1 -1
  205. package/dist/runtime/table/components/data-list/data-list-infinite-loader.vue.d.ts +1 -1
  206. package/dist/runtime/table/components/data-list/data-list-layout-switch.d.vue.ts +1 -1
  207. package/dist/runtime/table/components/data-list/data-list-layout-switch.vue.d.ts +1 -1
  208. package/dist/runtime/table/components/data-list/data-list-pagination.d.vue.ts +1 -1
  209. package/dist/runtime/table/components/data-list/data-list-pagination.vue.d.ts +1 -1
  210. package/dist/runtime/table/components/data-list/data-list-sort-menu.d.vue.ts +1 -1
  211. package/dist/runtime/table/components/data-list/data-list-sort-menu.vue.d.ts +1 -1
  212. package/dist/runtime/table/components/data-list/sort-menu-panel.d.vue.ts +2 -2
  213. package/dist/runtime/table/components/data-list/sort-menu-panel.vue.d.ts +2 -2
  214. package/dist/runtime/table/components/filters/shared/filter-match-mode-button.d.vue.ts +1 -1
  215. package/dist/runtime/table/components/filters/shared/filter-match-mode-button.vue.d.ts +1 -1
  216. package/dist/runtime/table/components/filters/shared/filter-option-list-end.d.vue.ts +11 -0
  217. package/dist/runtime/table/components/filters/shared/filter-option-list-end.vue +76 -0
  218. package/dist/runtime/table/components/filters/shared/filter-option-list-end.vue.d.ts +11 -0
  219. package/dist/runtime/table/components/filters/shared/filter-option-loading-list.d.vue.ts +3 -0
  220. package/dist/runtime/table/components/filters/shared/filter-option-loading-list.vue +2 -1
  221. package/dist/runtime/table/components/filters/shared/filter-option-loading-list.vue.d.ts +3 -0
  222. package/dist/runtime/table/components/filters/shared/filter-option-multiple-list.vue +1 -1
  223. package/dist/runtime/table/components/filters/shared/filter-option-picker-content.vue +13 -0
  224. package/dist/runtime/table/components/filters/shared/filter-option-single-list.d.vue.ts +2 -0
  225. package/dist/runtime/table/components/filters/shared/filter-option-single-list.vue +1 -1
  226. package/dist/runtime/table/components/filters/shared/filter-option-single-list.vue.d.ts +2 -0
  227. package/dist/runtime/table/components/filters/shared/filter-option-tree-content.d.vue.ts +3 -0
  228. package/dist/runtime/table/components/filters/shared/filter-option-tree-content.vue +2 -2
  229. package/dist/runtime/table/components/filters/shared/filter-option-tree-content.vue.d.ts +3 -0
  230. package/dist/runtime/table/components/filters/shared/filter-searchable-panel.vue +1 -0
  231. package/dist/runtime/table/components/layout/table-footer.d.vue.ts +1 -1
  232. package/dist/runtime/table/components/layout/table-footer.vue.d.ts +1 -1
  233. package/dist/runtime/table/components/table/table-cell-ellipsis.d.ts +1 -1
  234. package/dist/runtime/table/composables/use-option-filter-editor-state.d.ts +13 -1
  235. package/dist/runtime/table/composables/use-option-filter-editor-state.js +6 -2
  236. package/dist/runtime/table/composables/use-query-state.d.ts +3 -3
  237. package/dist/runtime/table/composables/use-table-columns.d.ts +3 -3
  238. package/dist/runtime/table/composables/use-table-filter-options.d.ts +11 -1
  239. package/dist/runtime/table/composables/use-table-filter-options.js +128 -17
  240. package/dist/runtime/table/composables/use-table-filter-selected-options.d.ts +20 -0
  241. package/dist/runtime/table/composables/use-table-filter-selected-options.js +99 -0
  242. package/dist/runtime/table/composables/use-table-filters.d.ts +5 -0
  243. package/dist/runtime/table/composables/use-table-filters.js +20 -1
  244. package/dist/runtime/table/composables/use-table-internals.d.ts +42 -27
  245. package/dist/runtime/table/composables/use-table-pagination.d.ts +2 -2
  246. package/dist/runtime/table/composables/use-table-remote-filter-options.d.ts +42 -0
  247. package/dist/runtime/table/composables/use-table-remote-filter-options.js +102 -0
  248. package/dist/runtime/table/composables/use-table-selection.d.ts +1 -1
  249. package/dist/runtime/table/composables/use-table-state.d.ts +3 -3
  250. package/dist/runtime/table/types/filters.d.ts +42 -0
  251. package/dist/runtime/table/types/source.d.ts +9 -5
  252. package/dist/runtime/table/utils/columns/menu.d.ts +1 -1
  253. package/dist/runtime/table/utils/columns/state.d.ts +1 -1
  254. package/dist/runtime/table/utils/data-list-ui.d.ts +1 -1
  255. package/dist/runtime/table/utils/filters/options.d.ts +2 -0
  256. package/dist/runtime/table/utils/filters/options.js +1 -1
  257. package/dist/runtime/table/utils/prefetch.js +21 -1
  258. package/package.json +28 -1
@@ -0,0 +1,106 @@
1
+ import type { QueryKey } from '@tanstack/vue-query';
2
+ import type { DashboardOptionsHandles } from './options.js';
3
+ import type { DashboardEmptyMap, DashboardParamBuilder, DashboardParamMap, DashboardParamValues } from './params.js';
4
+ import type { DashboardKeyError } from './schema.js';
5
+ /**
6
+ * Fetch stage of a query.
7
+ *
8
+ * - `essential` fetches as soon as its scope is active and drives the scope `state`.
9
+ * - `background` fetches once every essential query of the same scope has settled.
10
+ * - `deferred` never fetches until `resource.activate()` runs (blocks call it when they mount or
11
+ * scroll into view).
12
+ */
13
+ export type DashboardStage = 'essential' | 'background' | 'deferred';
14
+ export type DashboardResourceState = 'idle' | 'loading' | 'ready' | 'error';
15
+ /**
16
+ * Contract every block binds to through `:source`. Query resources and derived resources both
17
+ * satisfy it. Every member is a plain value read through a getter — there is no `.value`.
18
+ */
19
+ export interface DashboardSourceLike<TData = unknown> {
20
+ /** Stable identity, e.g. `consumption.productLines`. */
21
+ readonly id: string;
22
+ readonly data: TData;
23
+ readonly state: DashboardResourceState;
24
+ readonly error: unknown;
25
+ /** A background refetch is running while `state` is still `'ready'`. */
26
+ readonly refreshing: boolean;
27
+ /**
28
+ * When the data was last fetched successfully (epoch milliseconds). `undefined` until the first
29
+ * success. A derived value reports its oldest input.
30
+ */
31
+ readonly updatedAt: number | undefined;
32
+ /** Opts an idle `deferred` resource in. No-op for other resources. */
33
+ activate(): void;
34
+ refresh(): Promise<void>;
35
+ }
36
+ /** A declared query, as exposed on the dashboard facade. */
37
+ export interface DashboardResource<TData, TParams extends DashboardParamMap = DashboardEmptyMap, TStage extends DashboardStage = DashboardStage> extends DashboardSourceLike<TData> {
38
+ readonly kind: 'query';
39
+ readonly stage: TStage;
40
+ /** `false` while the owning view has never been opened or a `deferred` query was not activated. */
41
+ readonly active: boolean;
42
+ /** Widget-scoped params, URL-synced under this resource's key. */
43
+ readonly params: DashboardParamValues<TParams>;
44
+ /** Option handles for option-backed widget params. */
45
+ readonly options: DashboardOptionsHandles<TParams>;
46
+ }
47
+ /** A value declared in `derive`, exposed as a resource whose state follows the data it reads. */
48
+ export interface DashboardDerived<TData> extends DashboardSourceLike<TData> {
49
+ readonly kind: 'derived';
50
+ }
51
+ export type DashboardSourceMap = Record<string, DashboardSourceLike>;
52
+ /** Data of a source once it is `ready` (`undefined` is excluded, `null` is kept). */
53
+ export type DashboardReadyData<TSource> = TSource extends DashboardSourceLike<infer TData> ? Exclude<TData, undefined> : never;
54
+ /** Row type of a source whose ready data is an array. */
55
+ export type DashboardSourceRow<TSource> = DashboardReadyData<TSource> extends readonly (infer TRow)[] ? TRow : never;
56
+ /** Minimal query shape accepted from query factories (TanStack `queryOptions()` objects fit). */
57
+ export interface DashboardQueryLike {
58
+ queryKey: QueryKey;
59
+ }
60
+ /** Result type of a query definition, read from its `queryFn`. */
61
+ export type DashboardQueryData<TQuery> = TQuery extends {
62
+ queryFn?: infer TFn;
63
+ } ? TFn extends (...args: never[]) => infer TResult ? Awaited<TResult> : never : never;
64
+ /** Scope handed to the configured query factory. */
65
+ export interface DashboardQueryScope<TParams extends DashboardParamMap, TRequired> {
66
+ /** Widget-scoped params declared on this query. */
67
+ params: Readonly<DashboardParamValues<TParams>>;
68
+ /** Non-nullish value returned by `requires`. */
69
+ required: NonNullable<TRequired>;
70
+ }
71
+ export interface DashboardQueryInput<TQuery extends DashboardQueryLike, TParams extends DashboardParamMap, TRequired> {
72
+ /** Widget-scoped params, URL-synced under `<scope>.<queryKey>.<param>`. */
73
+ params?: (p: DashboardParamBuilder) => TParams;
74
+ /**
75
+ * Gate and narrow. While it returns `null` or `undefined`, the resource stays `idle` and never
76
+ * fetches; once set, `scope.required` is the non-nullish value. Reading another resource's
77
+ * `data` here expresses a dependent query.
78
+ */
79
+ requires?: () => TRequired;
80
+ /** Extra boolean gate, combined with `requires` and with stage activation. */
81
+ enabled?: () => boolean;
82
+ /** Reactive query factory returning a TanStack query definition. */
83
+ query: (scope: DashboardQueryScope<NoInfer<TParams>, NoInfer<TRequired>>) => TQuery;
84
+ /** Keep previous data while a new key loads. Defaults to `true`. */
85
+ keepPreviousData?: boolean;
86
+ staleTime?: number;
87
+ }
88
+ /**
89
+ * One fetch stage. Declared once and instantiated for `essential`, `background` and `deferred`.
90
+ */
91
+ export interface DashboardQueryStage<TStage extends DashboardStage> {
92
+ /** Plain query. `data` is `T | undefined`. */
93
+ query<TQuery extends DashboardQueryLike>(factory: () => TQuery): DashboardResource<DashboardQueryData<TQuery> | undefined, DashboardEmptyMap, TStage>;
94
+ /** Configured query without a default. `data` is `T | undefined`. */
95
+ query<TQuery extends DashboardQueryLike, const TParams extends DashboardParamMap = DashboardEmptyMap, TRequired = undefined>(input: DashboardQueryInput<TQuery, TParams, TRequired> & {
96
+ defaultValue?: undefined;
97
+ }): DashboardResource<DashboardQueryData<TQuery> | undefined, TParams, TStage>;
98
+ /**
99
+ * Configured query with a default. `data` is always defined. The default is inferred on its own
100
+ * (so property order inside the object does not matter) and checked against the query result: a
101
+ * mismatching default turns the resource into a `DashboardKeyError`, rejected by `queries`.
102
+ */
103
+ query<TQuery extends DashboardQueryLike, const TParams extends DashboardParamMap = DashboardEmptyMap, TRequired = undefined, TDefault = never>(input: DashboardQueryInput<TQuery, TParams, TRequired> & {
104
+ defaultValue: TDefault;
105
+ }): [TDefault] extends [DashboardQueryData<TQuery>] ? DashboardResource<DashboardQueryData<TQuery>, TParams, TStage> : DashboardKeyError<'defaultValue is not assignable to the query data type.'>;
106
+ }
File without changes
@@ -0,0 +1,44 @@
1
+ import type { QueryDefinition } from '../../shared/types/query.js';
2
+ import type { LazyTextValue } from '../../shared/types/utils.js';
3
+ import type { DashboardParamBuilder, DashboardParamMap } from './params.js';
4
+ import type { DashboardSourceLike, DashboardStage } from './resource.js';
5
+ /**
6
+ * Runtime (type-erased) view of the schema. The public schema types carry precise generics; the
7
+ * runtime reads the same objects through these shapes after one normalization step.
8
+ */
9
+ export interface DashboardRuntimeQueryInput {
10
+ params?: (p: DashboardParamBuilder) => DashboardParamMap;
11
+ requires?: () => unknown;
12
+ enabled?: () => boolean;
13
+ query: (scope: {
14
+ params: object;
15
+ required: unknown;
16
+ }) => QueryDefinition;
17
+ defaultValue?: unknown;
18
+ keepPreviousData?: boolean;
19
+ staleTime?: number;
20
+ }
21
+ export interface DashboardRuntimeStage {
22
+ query: (input: DashboardRuntimeQueryInput | (() => QueryDefinition)) => DashboardSourceLike;
23
+ }
24
+ export type DashboardRuntimeStages = Record<DashboardStage, DashboardRuntimeStage>;
25
+ export interface DashboardRuntimeQueriesContext extends DashboardRuntimeStages {
26
+ params: object;
27
+ }
28
+ export interface DashboardRuntimeDeriveContext {
29
+ data: object;
30
+ params: object;
31
+ }
32
+ export interface DashboardRuntimeScopeInput {
33
+ label?: LazyTextValue;
34
+ params?: (p: DashboardParamBuilder) => DashboardParamMap;
35
+ queries?: (context: DashboardRuntimeQueriesContext) => Record<string, DashboardSourceLike>;
36
+ derive?: (context: DashboardRuntimeDeriveContext) => Record<string, () => unknown>;
37
+ }
38
+ export interface DashboardRuntimeSchema extends DashboardRuntimeScopeInput {
39
+ key: string;
40
+ urlPrefix?: string;
41
+ autoRefresh?: number;
42
+ defaultView?: string;
43
+ views: [key: string, view: DashboardRuntimeScopeInput][];
44
+ }
File without changes
@@ -0,0 +1,171 @@
1
+ import type { LazyTextValue, Prettify } from '../../shared/types/utils.js';
2
+ import type { DashboardOptionsHandles } from './options.js';
3
+ import type { DashboardEmptyMap, DashboardParamBuilder, DashboardParamMap, DashboardParamValues } from './params.js';
4
+ import type { DashboardDerived, DashboardQueryStage, DashboardResourceState, DashboardSourceLike, DashboardSourceMap } from './resource.js';
5
+ /** `derive` entries: each one is a function evaluated reactively into a derived resource. */
6
+ export type DashboardDeriveMap = Record<string, () => unknown>;
7
+ /** Context received by a scope's `queries` builder. */
8
+ export interface DashboardQueriesContext<TParams> {
9
+ essential: DashboardQueryStage<'essential'>;
10
+ background: DashboardQueryStage<'background'>;
11
+ deferred: DashboardQueryStage<'deferred'>;
12
+ /** Params visible to this scope (shared params plus the view's own params). */
13
+ params: Readonly<DashboardParamValues<TParams>>;
14
+ }
15
+ /** `data` of every source a `derive` builder can read. */
16
+ export type DashboardSourceData<TSources> = {
17
+ readonly [K in keyof TSources]: TSources[K] extends DashboardSourceLike<infer TData> ? TData : never;
18
+ };
19
+ /** Context received by a scope's `derive` builder. */
20
+ export interface DashboardDeriveContext<TParams, TSources> {
21
+ /**
22
+ * Current data of every query visible to this scope. Reads are tracked: a derived value's
23
+ * `state` follows the state of the queries it actually read during its last evaluation.
24
+ */
25
+ data: DashboardSourceData<TSources>;
26
+ params: Readonly<DashboardParamValues<TParams>>;
27
+ }
28
+ export type DashboardDerivedResources<TDerive> = {
29
+ readonly [K in keyof TDerive]: TDerive[K] extends () => infer TResult ? DashboardDerived<TResult> : never;
30
+ };
31
+ /** Params, queries and derived values of one scope (the dashboard root or one view). */
32
+ export interface DashboardScopeInput<TShared extends DashboardParamMap, TVisibleSources, TParams extends DashboardParamMap, TQueries extends DashboardSourceMap, TDerive extends DashboardDeriveMap> {
33
+ /** Typed, URL-synced params owned by this scope. */
34
+ params?: (p: DashboardParamBuilder) => TParams;
35
+ /** Staged queries owned by this scope. Declared once, when `useDashboard()` runs. */
36
+ queries?: (context: DashboardQueriesContext<TShared & TParams>) => TQueries;
37
+ /** Derived values computed from query data, exposed as resources with automatic state. */
38
+ derive?: (context: DashboardDeriveContext<TShared & TParams, TVisibleSources & TQueries>) => TDerive;
39
+ }
40
+ /** Names owned by the runtime on the dashboard root and on every view handle. */
41
+ export type DashboardReservedKey = 'params' | 'options' | 'state' | 'refreshing' | 'refresh' | 'updatedAt' | 'autoRefresh' | 'view' | 'schema';
42
+ declare const DashboardKeyErrorBrand: unique symbol;
43
+ /** Unsatisfiable type. Its hover text is the error message the consumer reads. */
44
+ export interface DashboardKeyError<TMessage extends string> {
45
+ readonly [DashboardKeyErrorBrand]: TMessage;
46
+ }
47
+ type Guard<TSlot extends string, TBad, TMessage extends string> = [TBad] extends [never] ? unknown : {
48
+ [K in TSlot]: DashboardKeyError<TMessage>;
49
+ };
50
+ /** Compile-time collision checks for one scope's queries and derived values. */
51
+ export type DashboardScopeGuard<TQueries, TDerive, TTaken = never> = Guard<'queries', Extract<keyof TQueries, DashboardReservedKey | TTaken>, `Query key "${Extract<keyof TQueries, DashboardReservedKey | TTaken> & string}" is reserved or already used.`> & Guard<'derive', Extract<keyof TDerive, DashboardReservedKey | TTaken | keyof TQueries>, `Derived key "${Extract<keyof TDerive, DashboardReservedKey | TTaken | keyof TQueries> & string}" is reserved or already used.`>;
52
+ /** A view declared through the `view(...)` builder. */
53
+ export interface DashboardView<TParams extends DashboardParamMap, TQueries extends DashboardSourceMap, TDerive extends DashboardDeriveMap> {
54
+ /** Tab label. The lazy form keeps it translation-friendly. */
55
+ readonly label?: LazyTextValue;
56
+ readonly params?: (p: DashboardParamBuilder) => TParams;
57
+ readonly queries?: (context: never) => TQueries;
58
+ readonly derive?: (context: never) => TDerive;
59
+ }
60
+ export type DashboardViewMap = Record<string, DashboardView<DashboardParamMap, DashboardSourceMap, DashboardDeriveMap>>;
61
+ type DashboardViewResult<TParams extends DashboardParamMap, TQueries extends DashboardSourceMap, TDerive extends DashboardDeriveMap, TRootSources> = [Extract<keyof TQueries | keyof TDerive, DashboardReservedKey | keyof TRootSources>] extends [
62
+ never
63
+ ] ? [Extract<keyof TDerive, keyof TQueries>] extends [never] ? DashboardView<TParams, TQueries, TDerive> : DashboardKeyError<`Derived key "${Extract<keyof TDerive, keyof TQueries> & string}" collides with a query of the same view.`> : DashboardKeyError<`View member "${Extract<keyof TQueries | keyof TDerive, DashboardReservedKey | keyof TRootSources> & string}" is reserved or collides with a root query or derived value.`>;
64
+ /**
65
+ * Declares one view. Its queries see the shared params plus its own, and its `derive` can read root
66
+ * queries and derived values as well as its own queries.
67
+ *
68
+ * The result is `NoInfer`: otherwise the contextual `DashboardViewMap` would become an inference
69
+ * candidate, and a view without queries would infer `TQueries` as the open constraint.
70
+ */
71
+ export type DashboardViewBuilder<TShared extends DashboardParamMap, TRootSources> = <const TParams extends DashboardParamMap = DashboardEmptyMap, const TQueries extends DashboardSourceMap = DashboardEmptyMap, const TDerive extends DashboardDeriveMap = DashboardEmptyMap>(view: {
72
+ label?: LazyTextValue;
73
+ } & DashboardScopeInput<TShared, TRootSources, TParams, TQueries, TDerive>) => DashboardViewResult<NoInfer<TParams>, NoInfer<TQueries>, NoInfer<TDerive>, TRootSources>;
74
+ /** Resolved dashboard schema returned by `defineDashboardSchema`. */
75
+ export interface DashboardSchema<TParams extends DashboardParamMap = DashboardEmptyMap, TQueries extends DashboardSourceMap = DashboardEmptyMap, TDerive extends DashboardDeriveMap = DashboardEmptyMap, TViews extends DashboardViewMap = DashboardEmptyMap> {
76
+ /** Stable identity, used in default query keys and devtools labels. */
77
+ readonly key: string;
78
+ /** Prefix prepended to every URL key this dashboard owns. Use it when two dashboards share a page. */
79
+ readonly urlPrefix?: string;
80
+ /** Default auto-refresh interval in seconds (`0`: off). */
81
+ readonly autoRefresh?: number;
82
+ readonly params?: (p: DashboardParamBuilder) => TParams;
83
+ readonly queries?: (context: never) => TQueries;
84
+ readonly derive?: (context: never) => TDerive;
85
+ readonly views?: (view: never) => TViews;
86
+ readonly defaultView?: keyof TViews & string;
87
+ }
88
+ /** Structural constraint every schema returned by `defineDashboardSchema` satisfies. */
89
+ export interface DashboardSchemaLike {
90
+ readonly key: string;
91
+ readonly urlPrefix?: string;
92
+ readonly autoRefresh?: number;
93
+ readonly params?: (p: DashboardParamBuilder) => DashboardParamMap;
94
+ readonly queries?: (context: never) => DashboardSourceMap;
95
+ readonly derive?: (context: never) => DashboardDeriveMap;
96
+ readonly views?: (view: never) => DashboardViewMap;
97
+ readonly defaultView?: string;
98
+ }
99
+ type InferParams<T> = T extends {
100
+ params?: (p: never) => infer TParams;
101
+ } ? TParams extends DashboardParamMap ? TParams : DashboardEmptyMap : DashboardEmptyMap;
102
+ type InferQueries<T> = T extends {
103
+ queries?: (context: never) => infer TQueries;
104
+ } ? TQueries extends DashboardSourceMap ? TQueries : DashboardEmptyMap : DashboardEmptyMap;
105
+ type InferDerive<T> = T extends {
106
+ derive?: (context: never) => infer TDerive;
107
+ } ? TDerive extends DashboardDeriveMap ? TDerive : DashboardEmptyMap : DashboardEmptyMap;
108
+ type InferViews<T> = T extends {
109
+ views?: (view: never) => infer TViews;
110
+ } ? TViews extends DashboardViewMap ? TViews : DashboardEmptyMap : DashboardEmptyMap;
111
+ /** Runtime members shared by the dashboard root and every view handle. */
112
+ export interface DashboardScopeMembers<TParams> {
113
+ /** Params owned by this scope. Writable, URL-synced, `v-model`-ready. */
114
+ readonly params: DashboardParamValues<TParams>;
115
+ /** Option handles of this scope's option-backed params. */
116
+ readonly options: DashboardOptionsHandles<TParams>;
117
+ /**
118
+ * `idle` while the scope has never been active, `error` if an active essential query failed,
119
+ * `loading` while essentials load, `ready` once they all succeeded.
120
+ */
121
+ readonly state: DashboardResourceState;
122
+ /** A refresh started by `refresh()` is in flight. */
123
+ readonly refreshing: boolean;
124
+ /**
125
+ * Oldest `updatedAt` among the active queries (the dashboard root also counts the current
126
+ * view): everything on screen is at least this fresh. `undefined` until one has loaded.
127
+ */
128
+ readonly updatedAt: number | undefined;
129
+ /** Refetches every active query of this scope. */
130
+ refresh(): Promise<void>;
131
+ }
132
+ export interface DashboardViewMeta<TKey extends string> {
133
+ readonly key: TKey;
134
+ readonly label: string;
135
+ /** The view is the current one. */
136
+ readonly active: boolean;
137
+ /** The view has been opened at least once; its queries stay warm afterwards. */
138
+ readonly opened: boolean;
139
+ }
140
+ export interface DashboardViewController<TKey extends string> {
141
+ /** Current view. Writable and URL-synced under `view`. */
142
+ current: TKey;
143
+ /** Ordered view descriptors, ready for `UTabs` items. */
144
+ readonly items: readonly {
145
+ value: TKey;
146
+ label: string;
147
+ }[];
148
+ }
149
+ export type DashboardViewHandle<TView, TKey extends string> = Prettify<InferQueries<TView> & DashboardDerivedResources<InferDerive<TView>> & DashboardScopeMembers<InferParams<TView>> & {
150
+ readonly view: DashboardViewMeta<TKey>;
151
+ }>;
152
+ type DashboardViewHandles<TViews> = {
153
+ readonly [K in keyof TViews]: DashboardViewHandle<TViews[K], K & string>;
154
+ };
155
+ /** Runtime members of the dashboard root only. */
156
+ export interface DashboardRootMembers {
157
+ /**
158
+ * Auto-refresh interval in seconds, `0` when off. Writable and URL-synced under `refresh`. Every
159
+ * active query refetches on that interval while the page is visible (polling pauses in a
160
+ * background tab); a query's own `refetchInterval` wins.
161
+ */
162
+ autoRefresh: number;
163
+ }
164
+ type DashboardRootViewMembers<TViews> = [keyof TViews] extends [never] ? unknown : {
165
+ readonly view: DashboardViewController<keyof TViews & string>;
166
+ };
167
+ /** Facade returned by `useDashboard(schema)`. */
168
+ export type DashboardApi<TSchema> = Prettify<InferQueries<TSchema> & DashboardDerivedResources<InferDerive<TSchema>> & DashboardViewHandles<InferViews<TSchema>> & DashboardScopeMembers<InferParams<TSchema>> & DashboardRootMembers & DashboardRootViewMembers<InferViews<TSchema>> & {
169
+ readonly schema: TSchema;
170
+ }>;
171
+ export {};
File without changes
@@ -0,0 +1,201 @@
1
+ /**
2
+ * Class overrides for dashboard blocks. Every slot is merged (tailwind-merge) in this order:
3
+ * library defaults → `appConfig.nuxtUiTools.dashboard` → the block's `ui` prop.
4
+ */
5
+ /** Card chrome shared by every block. */
6
+ export interface DashboardBlockUi {
7
+ root?: string;
8
+ header?: string;
9
+ title?: string;
10
+ subtitle?: string;
11
+ actions?: string;
12
+ /** Row under the header (`#toolbar` slot). */
13
+ toolbar?: string;
14
+ body?: string;
15
+ footer?: string;
16
+ /** Row of `actions` placed under the content (`placement: 'footer'`). */
17
+ footerActions?: string;
18
+ /** `…` button of the card menu. */
19
+ menu?: string;
20
+ /** "Updated 3 min ago" line under the content. */
21
+ freshness?: string;
22
+ }
23
+ export interface DashboardGridUi {
24
+ root?: string;
25
+ /** Container of `variant="panels"` grids: joined cells separated by 1px rules. */
26
+ panels?: string;
27
+ /** Card root of blocks placed inside a `panels` grid. */
28
+ panel?: string;
29
+ }
30
+ export interface DashboardStatUi {
31
+ /** KPI label, rendered as the card title. */
32
+ label?: string;
33
+ value?: string;
34
+ /** Row under the value: delta, then caption. */
35
+ meta?: string;
36
+ delta?: string;
37
+ /** `▲` / `▼` before the delta. */
38
+ mark?: string;
39
+ caption?: string;
40
+ /** Colored dot and label of `status`, on the title row. */
41
+ status?: string;
42
+ /** Sparkline of `trend`. */
43
+ trend?: string;
44
+ /** Track of the `goal` progress bar. */
45
+ progress?: string;
46
+ /** Line under the progress bar: goal and completion. */
47
+ goal?: string;
48
+ }
49
+ export interface DashboardStatsUi {
50
+ /** Grid of the figures. */
51
+ grid?: string;
52
+ item?: string;
53
+ /** Icon tile before the label. */
54
+ icon?: string;
55
+ label?: string;
56
+ value?: string;
57
+ /** Row under the value: delta, then caption. */
58
+ meta?: string;
59
+ delta?: string;
60
+ caption?: string;
61
+ /** Track of the `progress` bar. */
62
+ progress?: string;
63
+ /** Badge of `status`. */
64
+ status?: string;
65
+ }
66
+ export interface DashboardGaugeUi {
67
+ /** Ring and its centered text. */
68
+ ring?: string;
69
+ value?: string;
70
+ /** Text under the value, inside the ring. */
71
+ caption?: string;
72
+ /** Line under the ring: min / target / max. */
73
+ scale?: string;
74
+ }
75
+ export interface DashboardAlertsUi {
76
+ row?: string;
77
+ /** Severity icon tile. */
78
+ icon?: string;
79
+ label?: string;
80
+ description?: string;
81
+ value?: string;
82
+ action?: string;
83
+ }
84
+ export interface DashboardFeedUi {
85
+ /** Day heading when `groupBy` is set. */
86
+ group?: string;
87
+ item?: string;
88
+ /** Icon, avatar, or dot on the timeline rail. */
89
+ marker?: string;
90
+ label?: string;
91
+ description?: string;
92
+ time?: string;
93
+ }
94
+ export interface DashboardTableUi {
95
+ /** Scroll container around the table. */
96
+ wrapper?: string;
97
+ table?: string;
98
+ head?: string;
99
+ /** Header cells. */
100
+ th?: string;
101
+ row?: string;
102
+ /** Body cells. */
103
+ td?: string;
104
+ /** Inline bar of `bar` columns. */
105
+ bar?: string;
106
+ }
107
+ export interface DashboardLegendUi {
108
+ root?: string;
109
+ item?: string;
110
+ swatch?: string;
111
+ }
112
+ export interface DashboardTotalUi {
113
+ root?: string;
114
+ label?: string;
115
+ value?: string;
116
+ }
117
+ export interface DashboardListUi {
118
+ row?: string;
119
+ avatar?: string;
120
+ code?: string;
121
+ /** Progress ring of `leading: 'ring'`. */
122
+ ring?: string;
123
+ label?: string;
124
+ description?: string;
125
+ share?: string;
126
+ delta?: string;
127
+ value?: string;
128
+ }
129
+ export interface DashboardBarsUi {
130
+ row?: string;
131
+ label?: string;
132
+ tag?: string;
133
+ meta?: string;
134
+ track?: string;
135
+ fill?: string;
136
+ }
137
+ export interface DashboardPairedBarsUi {
138
+ row?: string;
139
+ label?: string;
140
+ track?: string;
141
+ value?: string;
142
+ }
143
+ export interface DashboardFunnelUi {
144
+ step?: string;
145
+ label?: string;
146
+ value?: string;
147
+ note?: string;
148
+ track?: string;
149
+ }
150
+ export interface DashboardStackBarUi {
151
+ track?: string;
152
+ legend?: string;
153
+ item?: string;
154
+ }
155
+ export interface DashboardDonutUi {
156
+ legend?: string;
157
+ item?: string;
158
+ /** Big value in the middle of the ring. */
159
+ center?: string;
160
+ centerLabel?: string;
161
+ }
162
+ export interface DashboardStateUi {
163
+ root?: string;
164
+ icon?: string;
165
+ title?: string;
166
+ description?: string;
167
+ }
168
+ /**
169
+ * App-wide dashboard theming, read from `appConfig.nuxtUiTools.dashboard`.
170
+ *
171
+ * @example
172
+ * ```ts
173
+ * export default defineAppConfig({
174
+ * nuxtUiTools: {
175
+ * dashboard: {
176
+ * card: { root: 'px-6 py-5', title: 'font-semibold' },
177
+ * stat: { value: 'font-light tracking-tight' },
178
+ * },
179
+ * },
180
+ * })
181
+ * ```
182
+ */
183
+ export interface DashboardUiConfig {
184
+ card?: DashboardBlockUi;
185
+ grid?: DashboardGridUi;
186
+ stat?: DashboardStatUi;
187
+ stats?: DashboardStatsUi;
188
+ gauge?: DashboardGaugeUi;
189
+ legend?: DashboardLegendUi;
190
+ total?: DashboardTotalUi;
191
+ list?: DashboardListUi;
192
+ bars?: DashboardBarsUi;
193
+ pairedBars?: DashboardPairedBarsUi;
194
+ funnel?: DashboardFunnelUi;
195
+ stackBar?: DashboardStackBarUi;
196
+ donut?: DashboardDonutUi;
197
+ alerts?: DashboardAlertsUi;
198
+ feed?: DashboardFeedUi;
199
+ table?: DashboardTableUi;
200
+ state?: DashboardStateUi;
201
+ }
File without changes
@@ -0,0 +1,85 @@
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 {};