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,16 @@
1
+ /** Default TanStack Query options applied to dashboard queries. */
2
+ export declare const DASHBOARD_QUERY_DEFAULTS: {
3
+ refetchOnWindowFocus: boolean;
4
+ /** How long fetched data is considered fresh (ms), per stage. */
5
+ staleTime: {
6
+ background: number;
7
+ deferred: number;
8
+ essential: number;
9
+ };
10
+ };
11
+ export declare const DASHBOARD_REMOTE_OPTIONS_DEFAULTS: {
12
+ pageSize: number;
13
+ searchDebounce: number;
14
+ selectedStaleTime: number;
15
+ staleTime: number;
16
+ };
@@ -0,0 +1,15 @@
1
+ export const DASHBOARD_QUERY_DEFAULTS = {
2
+ refetchOnWindowFocus: false,
3
+ /** How long fetched data is considered fresh (ms), per stage. */
4
+ staleTime: {
5
+ background: 6e4,
6
+ deferred: 6e4,
7
+ essential: 3e4
8
+ }
9
+ };
10
+ export const DASHBOARD_REMOTE_OPTIONS_DEFAULTS = {
11
+ pageSize: 25,
12
+ searchDebounce: 250,
13
+ selectedStaleTime: 3e5,
14
+ staleTime: 3e4
15
+ };
@@ -0,0 +1,4 @@
1
+ export { useDashboard } from './composables/use-dashboard.js';
2
+ export { defineDashboardSchema } from './schema/index.js';
3
+ export { resolveDashboardComparisonRange } from './utils/comparison.js';
4
+ export type * from './types';
@@ -0,0 +1,3 @@
1
+ export { useDashboard } from "./composables/use-dashboard.js";
2
+ export { defineDashboardSchema } from "./schema/index.js";
3
+ export { resolveDashboardComparisonRange } from "./utils/comparison.js";
@@ -0,0 +1,57 @@
1
+ import type { DashboardDeriveMap, DashboardDerivedResources, DashboardEmptyMap, DashboardKeyError, DashboardParamMap, DashboardReservedKey, DashboardSchema, DashboardScopeGuard, DashboardScopeInput, DashboardSourceMap, DashboardViewBuilder, DashboardViewMap } from '../types/index.js';
2
+ type DashboardViewsGuard<TQueries, TDerive, TViews> = [
3
+ Extract<keyof TViews, DashboardReservedKey | keyof TQueries | keyof TDerive>
4
+ ] extends [never] ? unknown : {
5
+ views: DashboardKeyError<`View key "${Extract<keyof TViews, DashboardReservedKey | keyof TQueries | keyof TDerive> & string}" is reserved or collides with a root query or derived value.`>;
6
+ };
7
+ /**
8
+ * Declares a dashboard: typed URL-synced params, staged queries, derived values, and optional
9
+ * views (tabs). Nothing runs here — `useDashboard(schema)` instantiates it.
10
+ *
11
+ * Keys are checked at compile time: a query, derived value, or view named after a runtime member
12
+ * (`params`, `options`, `state`, `refreshing`, `refresh`, `updatedAt`, `autoRefresh`, `view`,
13
+ * `schema`) or after a sibling is a type error.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const schema = defineDashboardSchema({
18
+ * key: 'sales',
19
+ * params: (p) => ({ period: p.enum([7, 30, 90], { defaultValue: 30 }) }),
20
+ * queries: ({ essential, background, params }) => ({
21
+ * summary: essential.query(() => ({
22
+ * queryKey: ['sales', 'summary', params.period],
23
+ * queryFn: () => api.sales.summary({ days: params.period }),
24
+ * })),
25
+ * channels: background.query({
26
+ * defaultValue: [],
27
+ * query: () => ({
28
+ * queryKey: ['sales', 'channels', params.period],
29
+ * queryFn: () => api.sales.channels({ days: params.period }),
30
+ * }),
31
+ * }),
32
+ * }),
33
+ * derive: ({ data }) => ({
34
+ * channelCount: () => data.channels.length,
35
+ * }),
36
+ * })
37
+ * ```
38
+ */
39
+ export declare function defineDashboardSchema<const TParams extends DashboardParamMap = DashboardEmptyMap, const TQueries extends DashboardSourceMap = DashboardEmptyMap, const TDerive extends DashboardDeriveMap = DashboardEmptyMap, const TViews extends DashboardViewMap = DashboardEmptyMap>(schema: {
40
+ /** Stable identity, used in default query keys and devtools labels. */
41
+ key: string;
42
+ /** Prefix prepended to every URL key this dashboard owns. */
43
+ urlPrefix?: string;
44
+ /**
45
+ * Default auto-refresh interval in seconds (`0`: off). `dashboard.autoRefresh` changes it at
46
+ * runtime and keeps it in the URL (`refresh`).
47
+ */
48
+ autoRefresh?: number;
49
+ /**
50
+ * Views (tabs). Each view owns params and queries; queries of a view never fetch until the
51
+ * view is opened once, then stay warm.
52
+ */
53
+ views?: (view: DashboardViewBuilder<TParams, TQueries & DashboardDerivedResources<TDerive>>) => TViews;
54
+ /** View shown when the URL does not select one. Defaults to the first declared view. */
55
+ defaultView?: NoInfer<keyof TViews & string>;
56
+ } & DashboardScopeInput<DashboardEmptyMap, DashboardEmptyMap, TParams, TQueries, TDerive> & DashboardScopeGuard<TQueries, TDerive> & DashboardViewsGuard<TQueries, TDerive, TViews>): DashboardSchema<TParams, TQueries, TDerive, TViews>;
57
+ export {};
@@ -0,0 +1,3 @@
1
+ export function defineDashboardSchema(schema) {
2
+ return schema;
3
+ }
@@ -0,0 +1,251 @@
1
+ import type { ButtonProps } from '@nuxt/ui/components/Button.vue';
2
+ import type { DropdownMenuItem } from '@nuxt/ui/components/DropdownMenu.vue';
3
+ import type { RouteLocationRaw } from 'vue-router';
4
+ import type { LazyTextValue } from '../../shared/types/utils.js';
5
+ import type { DashboardBlockUi } from './ui.js';
6
+ /** Formats a numeric value for axes, tooltips, legends, and totals. */
7
+ export type DashboardValueFormat = (value: number) => string;
8
+ /**
9
+ * Series color: a palette slot (`'series-1'` … `'series-6'`), a Nuxt UI color (`'primary'`,
10
+ * `'success'`, `'warning'`, `'error'`, `'info'`, `'neutral'`), or any CSS color / `var(--x)`.
11
+ * Omitted colors follow the palette order.
12
+ */
13
+ export type DashboardSeriesColor = string;
14
+ /** One series of a chart, read from each row through an accessor. */
15
+ export interface DashboardSeries<TRow> {
16
+ /** Stable identity, also used for legend keys. */
17
+ key: string;
18
+ label?: LazyTextValue;
19
+ value: (row: TRow, index: number) => number | null | undefined;
20
+ color?: DashboardSeriesColor;
21
+ /** Draws the series as a dashed line (comparison / previous period). */
22
+ dashed?: boolean;
23
+ /** Combo charts only: how the series is drawn. Defaults to the chart's own mark. */
24
+ type?: 'bar' | 'line' | 'area';
25
+ /**
26
+ * Combo charts only: which value axis a line or area series uses. Defaults to `'left'`. Bars
27
+ * always use the left axis.
28
+ */
29
+ axis?: 'left' | 'right';
30
+ /**
31
+ * The same measure over the comparison period (previous period, previous year). Drawn next to the
32
+ * series in a faded tone of its color (dashed for lines), and listed in the legend, tooltip,
33
+ * table view, and CSV.
34
+ */
35
+ compare?: (row: TRow, index: number) => number | null | undefined;
36
+ /** Legend label of `compare`. Defaults to "<label> (previous period)". */
37
+ compareLabel?: LazyTextValue;
38
+ }
39
+ /**
40
+ * Emphasized bars of a bar chart: the largest, the smallest, the last, or the rows an accessor
41
+ * picks. The other bars take a faded tone of their color.
42
+ */
43
+ export type DashboardHighlight<TRow> = 'max' | 'min' | 'last' | ((row: TRow, index: number) => boolean);
44
+ /**
45
+ * Rows shown as selected, typically the value a `select` handler stored in a param (drill-down,
46
+ * cross-filter). Selected rows are marked; in charts the other bars, points, and segments recede.
47
+ */
48
+ export type DashboardSelected<TRow> = (row: TRow, index: number) => boolean;
49
+ export interface DashboardAxisOptions {
50
+ format?: DashboardValueFormat;
51
+ /** Fixed domain bounds. Defaults to `0` and a rounded maximum of the data. */
52
+ min?: number;
53
+ max?: number;
54
+ /** Number of intervals between ticks. Defaults to a readable count for the maximum. */
55
+ ticks?: number;
56
+ }
57
+ /** Horizontal reference line, e.g. an objective. */
58
+ export interface DashboardReferenceLine {
59
+ value: number;
60
+ label?: LazyTextValue;
61
+ axis?: 'left' | 'right';
62
+ /** Where the label sits along the line. Defaults to `'end'`. */
63
+ position?: 'start' | 'end';
64
+ }
65
+ /** Shape of the loading skeleton, one per block family. */
66
+ export type DashboardSkeletonKind = 'stat' | 'bars' | 'lines' | 'donut' | 'rows' | 'hbars' | 'funnel' | 'stack' | 'paired' | 'feed' | 'table' | 'stats' | 'gauge';
67
+ /**
68
+ * Built-in card menu actions: `table` switches the content to a data table, `csv` downloads that
69
+ * data, `expand` opens the card in a large dialog.
70
+ */
71
+ export type DashboardMenuAction = 'table' | 'csv' | 'expand';
72
+ /** Entries of a card menu: built-in actions and Nuxt UI dropdown items, in display order. */
73
+ export type DashboardMenuEntries = readonly (DashboardMenuAction | DropdownMenuItem)[];
74
+ /** What a function `menu` receives: the block's own data actions, to reuse in custom items. */
75
+ export interface DashboardMenuContext {
76
+ /** Resolved block title. */
77
+ title: string;
78
+ /** The block's tabular data (the table view / CSV source); `undefined` until content shows. */
79
+ table: () => DashboardDataTable | undefined;
80
+ /** Downloads that table as CSV. */
81
+ download: () => void;
82
+ /** Opens the expand dialog. */
83
+ expand: () => void;
84
+ }
85
+ /**
86
+ * Card menu, opened from a `…` button in the header. `true` lists every built-in action the block
87
+ * supports; an array picks and orders built-in actions and mixes in Nuxt UI dropdown items; a
88
+ * function builds that array from the block's context (its table, CSV download, expand).
89
+ */
90
+ export type DashboardMenu = boolean | DashboardMenuEntries | ((context: DashboardMenuContext) => DashboardMenuEntries);
91
+ /**
92
+ * Button of a block, in its header next to the menu (default) or full width under the content.
93
+ * Takes any Nuxt UI button prop: `label`, `icon`, `to`, `onClick`, `color`, `variant`, `loading`…
94
+ */
95
+ export interface DashboardAction extends ButtonProps {
96
+ placement?: 'header' | 'footer';
97
+ }
98
+ /** Action on one row: a Nuxt UI dropdown item, listed in the row's `⋮` menu. */
99
+ export interface DashboardRowAction extends DropdownMenuItem {
100
+ /** Renders the action as an icon button on the row instead (needs an `icon`). */
101
+ inline?: boolean;
102
+ }
103
+ /** Builds the actions of one row. An empty result leaves the row without actions. */
104
+ export type DashboardRowActions<TRow> = (row: TRow, index: number) => readonly DashboardRowAction[] | null | undefined;
105
+ /** One column of a block's tabular data. */
106
+ export interface DashboardDataColumn {
107
+ key: string;
108
+ label: string;
109
+ /** Numeric columns align to the end and export their raw values. */
110
+ numeric: boolean;
111
+ }
112
+ /** One cell: the raw value (exported to CSV) and its display text. */
113
+ export interface DashboardDataCell {
114
+ value: string | number | null;
115
+ text: string;
116
+ }
117
+ /** Tabular view of a block's data, behind the `table` and `csv` menu actions. */
118
+ export interface DashboardDataTable {
119
+ columns: DashboardDataColumn[];
120
+ rows: DashboardDataCell[][];
121
+ }
122
+ /** A point in time as blocks receive it: a `Date`, epoch milliseconds, or an ISO string. */
123
+ export type DashboardTimeValue = Date | number | string;
124
+ /** Payload of a block's `select` event: the clicked row and its index in the source data. */
125
+ export interface DashboardSelectEvent<TRow> {
126
+ row: TRow;
127
+ index: number;
128
+ }
129
+ /** Status of a KPI, shown as a colored dot and label on the title row. */
130
+ export interface DashboardStatus {
131
+ color: 'success' | 'warning' | 'error' | 'info' | 'neutral';
132
+ label?: LazyTextValue;
133
+ }
134
+ /** Severity of an alert row, most severe first. */
135
+ export type DashboardAlertSeverity = 'error' | 'warning' | 'info' | 'success';
136
+ /** Button at the end of an alert row. */
137
+ export interface DashboardAlertAction {
138
+ label: LazyTextValue;
139
+ icon?: string;
140
+ to?: RouteLocationRaw;
141
+ onClick?: (event: MouseEvent) => void;
142
+ }
143
+ /** One column of `UiDashboardTable`. */
144
+ export interface DashboardTableColumn<TRow> {
145
+ /** Stable identity: sort key and `#cell-<key>` slot name. */
146
+ key: string;
147
+ label?: LazyTextValue;
148
+ /** Cell value. Numbers go through `format` and sort numerically. */
149
+ value: (row: TRow, index: number) => LazyTextValue | null | undefined;
150
+ /**
151
+ * `text` (default); `number`; `delta` (signed percent, colored by sign); `percent` (a share);
152
+ * `bar` (the number with an inline bar scaled to the column maximum).
153
+ */
154
+ type?: 'text' | 'number' | 'delta' | 'percent' | 'bar';
155
+ format?: DashboardValueFormat;
156
+ /** `delta` columns: a decrease is good news. */
157
+ invert?: boolean;
158
+ /** `bar` columns: bar color. */
159
+ color?: DashboardSeriesColor;
160
+ /** `bar` columns: value of a full bar. Defaults to the column maximum. */
161
+ max?: number;
162
+ /** Defaults to `end` for numeric types, `start` otherwise. */
163
+ align?: 'start' | 'center' | 'end';
164
+ /** Header click sorts by this column. Defaults to `true`. */
165
+ sortable?: boolean;
166
+ /** Column width, any CSS length. */
167
+ width?: string;
168
+ /** Classes of the column's cells. */
169
+ class?: string;
170
+ }
171
+ /** Sort state of `UiDashboardTable` (`v-model:sort`). */
172
+ export interface DashboardTableSort {
173
+ key: string;
174
+ direction: 'asc' | 'desc';
175
+ }
176
+ /** Visual state a block renders, reduced from its source. */
177
+ export type DashboardBlockPhase = 'idle' | 'loading' | 'empty' | 'error' | 'content';
178
+ /**
179
+ * When a block activates a `deferred` source: once it scrolls near the viewport (default), as soon
180
+ * as it mounts, or never (`manual`, the app calls `source.activate()`).
181
+ */
182
+ export type DashboardBlockActivation = 'visible' | 'mount' | 'manual';
183
+ /** Empty state content, shown when a source is ready but has nothing to display. */
184
+ export interface DashboardEmptyContent {
185
+ icon?: string;
186
+ title?: LazyTextValue;
187
+ description?: LazyTextValue;
188
+ }
189
+ /** Props shared by every block. */
190
+ export interface DashboardBlockBaseProps {
191
+ title?: LazyTextValue;
192
+ subtitle?: LazyTextValue;
193
+ /** Grid span, responsive: `"12 md:6 xl:4"`. Defaults to the full row. */
194
+ size?: string;
195
+ /** Grid row span, responsive. */
196
+ rows?: string;
197
+ /** Render without card chrome (no border, padding, or background). Defaults to `true`. */
198
+ card?: boolean;
199
+ activation?: DashboardBlockActivation;
200
+ /** Empty state content. Defaults to a localized "no data" message. */
201
+ empty?: DashboardEmptyContent;
202
+ /** Card menu. Inherits the enclosing grid's `menu` when omitted. */
203
+ menu?: DashboardMenu;
204
+ /** Buttons in the header, next to the menu, or full width under the content (`placement`). */
205
+ actions?: readonly DashboardAction[];
206
+ /**
207
+ * Shows when the data was last fetched ("Updated 3 min ago") under the content. Inherits the
208
+ * enclosing grid's `freshness` when omitted.
209
+ */
210
+ freshness?: boolean;
211
+ /** Class overrides for the card parts, merged over `appConfig.nuxtUiTools.dashboard.card`. */
212
+ ui?: DashboardBlockUi;
213
+ }
214
+ /** One figure of `UiDashboardStats`, read from the source data. */
215
+ export interface DashboardStatsItem<TData> {
216
+ /** Stable identity. */
217
+ key: string;
218
+ label: LazyTextValue;
219
+ /** Numbers go through `format` (locale number format by default). */
220
+ value: (data: TData) => LazyTextValue | null | undefined;
221
+ format?: DashboardValueFormat;
222
+ /** Change in percent, colored by sign. `null` hides it. */
223
+ delta?: (data: TData) => number | null | undefined;
224
+ /** A decrease is good news. */
225
+ invertDelta?: boolean;
226
+ /** Secondary text after the delta. */
227
+ caption?: LazyTextValue | ((data: TData) => LazyTextValue | undefined);
228
+ icon?: string;
229
+ /** Accent of the icon and the progress bar. Defaults to the palette order. */
230
+ color?: DashboardSeriesColor;
231
+ /** Completion in percent (0–100), drawn as a bar under the value. `null` hides it. */
232
+ progress?: (data: TData) => number | null | undefined;
233
+ /** Badge next to the value ("Good", "At risk"). `null` hides it. */
234
+ status?: (data: TData) => DashboardStatus | null | undefined;
235
+ }
236
+ /** One tab of `UiDashboardTabs`. */
237
+ export interface DashboardTab<TValue extends string | number = string | number> {
238
+ value: TValue;
239
+ label: LazyTextValue;
240
+ icon?: string;
241
+ /** Count shown after the label (items waiting in that tab…). */
242
+ count?: number | null;
243
+ disabled?: boolean;
244
+ }
245
+ /** Legend entry rendered in a block header. */
246
+ export interface DashboardLegendItem {
247
+ key: string;
248
+ label: string;
249
+ color: string;
250
+ dashed?: boolean;
251
+ }
File without changes
@@ -0,0 +1,60 @@
1
+ import type { DashboardValueFormat } from './blocks.js';
2
+ /** Normalized chart row: series values in series order. */
3
+ export interface DashboardChartDatum {
4
+ index: number;
5
+ values: (number | undefined)[];
6
+ }
7
+ export interface DashboardChartFrameSeries {
8
+ key: string;
9
+ label: string;
10
+ color: string;
11
+ dashed: boolean;
12
+ type: 'bar' | 'line' | 'area';
13
+ axis: 'left' | 'right';
14
+ /** Position in `DashboardChartDatum.values`. */
15
+ index: number;
16
+ }
17
+ export interface DashboardChartFrameAxis {
18
+ domain: [number, number];
19
+ /** Tick values, evenly spaced on round numbers. */
20
+ ticks: number[];
21
+ format: DashboardValueFormat;
22
+ }
23
+ export interface DashboardChartFrameReference {
24
+ value: number;
25
+ label: string;
26
+ axis: 'left' | 'right';
27
+ position: 'start' | 'end';
28
+ }
29
+ /** Value printed above one bar group: the stack total, or the tallest bar of the group. */
30
+ export interface DashboardChartValueLabel {
31
+ index: number;
32
+ value: number;
33
+ text: string;
34
+ /** Emphasized datum (highlight or selection): the label stands out too. */
35
+ strong: boolean;
36
+ }
37
+ /** Everything a chart renderer needs, precomputed from the block props and source data. */
38
+ export interface DashboardChartFrame {
39
+ data: DashboardChartDatum[];
40
+ labels: string[];
41
+ series: DashboardChartFrameSeries[];
42
+ /**
43
+ * Datums drawn at full strength, by index; the other bars take a faded tone. `null` when every
44
+ * datum does (no highlight, no selection).
45
+ */
46
+ emphasis: boolean[] | null;
47
+ /** Selected datum indexes, marked with a band behind line-only charts. */
48
+ selection: number[];
49
+ /** Values printed above the bars (`labels` prop), empty otherwise. */
50
+ valueLabels: DashboardChartValueLabel[];
51
+ /**
52
+ * X domain in datum indexes. Charts with bars pad half a slot on both sides so every bar group
53
+ * is centered on its label; line-only charts run edge to edge.
54
+ */
55
+ xDomain: [number, number];
56
+ left: DashboardChartFrameAxis;
57
+ right: DashboardChartFrameAxis | null;
58
+ references: DashboardChartFrameReference[];
59
+ stacked: boolean;
60
+ }
File without changes
@@ -0,0 +1,7 @@
1
+ export type * from './options';
2
+ export type * from './params';
3
+ export type * from './resource';
4
+ export type * from './schema';
5
+ export type * from './blocks';
6
+ export type * from './charts';
7
+ export type * from './ui';
File without changes
@@ -0,0 +1,46 @@
1
+ import type { DashboardOption, DashboardOptionParamKeys, DashboardOptionValue } from './params.js';
2
+ /**
3
+ * Props ready to spread onto a Nuxt UI `USelectMenu`:
4
+ * `<USelectMenu v-model="dashboard.params.account" v-bind="dashboard.options.account.menu" />`.
5
+ */
6
+ export interface DashboardOptionsMenuBindings<TValue extends DashboardOptionValue = DashboardOptionValue> {
7
+ items: DashboardOption<TValue>[];
8
+ valueKey: 'value';
9
+ labelKey: 'label';
10
+ loading?: boolean;
11
+ searchTerm?: string;
12
+ ignoreFilter?: boolean;
13
+ 'onUpdate:searchTerm'?: (value: string) => void;
14
+ 'onUpdate:open'?: (value: boolean) => void;
15
+ }
16
+ /**
17
+ * Option state of an option-backed param (`p.enum`, `p.options`, `p.remote`).
18
+ *
19
+ * Remote handles load nothing until `open` becomes `true` (or `search` is set), then page through
20
+ * the source; selected values restored from the URL are hydrated through `resolveSelected`.
21
+ */
22
+ export interface DashboardOptionsHandle<TValue extends DashboardOptionValue = DashboardOptionValue> {
23
+ /** Loaded options merged with the hydrated selected options. */
24
+ readonly items: readonly DashboardOption<TValue>[];
25
+ /** Options matching the current param value, in value order. */
26
+ readonly selected: readonly DashboardOption<TValue>[];
27
+ readonly loading: boolean;
28
+ readonly loadingMore: boolean;
29
+ readonly hasMore: boolean;
30
+ readonly error: unknown;
31
+ /** Search term. Writable; remote sources debounce it before loading. */
32
+ search: string;
33
+ /** Picker open state. Writable; opening a remote picker starts loading its first page. */
34
+ open: boolean;
35
+ loadMore(): void;
36
+ refresh(): Promise<void>;
37
+ readonly menu: DashboardOptionsMenuBindings<TValue>;
38
+ }
39
+ /** Option value type of a param: its value, or its element type for `multiple` params. */
40
+ type DashboardParamOptionValue<TParam> = TParam extends {
41
+ readonly defaultValue: infer TValue;
42
+ } ? Extract<NonNullable<TValue> extends readonly (infer TItem)[] ? TItem : NonNullable<TValue>, DashboardOptionValue> : never;
43
+ export type DashboardOptionsHandles<TParams> = {
44
+ readonly [K in DashboardOptionParamKeys<TParams>]: DashboardOptionsHandle<DashboardParamOptionValue<TParams[K]>>;
45
+ };
46
+ export {};
File without changes
@@ -0,0 +1,115 @@
1
+ import type { QueryKey } from '@tanstack/vue-query';
2
+ import type { HistoryMode, QueryCodec, StaticQueryStateOptions } from '../../query-state/index.js';
3
+ import type { RemoteOptionsPageRequest, RemoteOptionsPagination, RemoteOptionsResult, RemoteOptionsSearch } from '../../shared/types/remote-options.js';
4
+ import type { dashboardParamBuilder } from '../utils/builders/dashboard-params.js';
5
+ export type DashboardParamKind = 'string' | 'number' | 'boolean' | 'date' | 'dateRange' | 'enum' | 'options' | 'remote' | 'comparison' | 'custom';
6
+ /**
7
+ * Period a dashboard compares against: the one right before the current range (`previous`), the
8
+ * same dates a year earlier (`year`), or no comparison (`none`).
9
+ */
10
+ export type DashboardComparison = 'previous' | 'year' | 'none';
11
+ /** Primitive value an option-backed param can hold. */
12
+ export type DashboardOptionValue = string | number;
13
+ /**
14
+ * Option item shape. It matches Nuxt UI `USelect` / `USelectMenu` items, so option handles can be
15
+ * bound to those components directly.
16
+ */
17
+ export interface DashboardOption<TValue extends DashboardOptionValue = DashboardOptionValue> {
18
+ value: TValue;
19
+ label: string;
20
+ description?: string;
21
+ icon?: string;
22
+ avatar?: {
23
+ src?: string;
24
+ alt?: string;
25
+ text?: string;
26
+ };
27
+ disabled?: boolean;
28
+ }
29
+ export interface DashboardDateRange {
30
+ start: Date;
31
+ end: Date;
32
+ }
33
+ /** Options shared by every `p.*` param builder. */
34
+ export interface DashboardParamOptions<TDefault> {
35
+ /**
36
+ * Value used when the URL key is absent or cannot be parsed.
37
+ * A non-`undefined` default narrows the param type: `p.string()` is `string | undefined`,
38
+ * `p.string({ defaultValue: '' })` is `string`. Values equal to the default never reach the URL.
39
+ */
40
+ defaultValue?: TDefault;
41
+ /** Override the URL segment. Defaults to the param name inside its scope prefix. */
42
+ urlKey?: string;
43
+ /** Remove the key from the URL when the value equals the default. Defaults to `true`. */
44
+ omitDefault?: boolean;
45
+ /** Router history mode for writes to this param. Params default to `'replace'`. */
46
+ historyMode?: HistoryMode;
47
+ }
48
+ /** Request received by a remote option source. */
49
+ export interface DashboardRemoteOptionsRequest {
50
+ /** Current debounced search term. Empty when the menu lists unfiltered options. */
51
+ search: string;
52
+ /** Requested page. */
53
+ page: RemoteOptionsPageRequest;
54
+ }
55
+ /**
56
+ * Remote option source, following the same contract as the form engine's remote options:
57
+ * server-side search, page or cursor pagination, and hydration of selected values that the loaded
58
+ * pages do not contain (for example ids restored from the URL).
59
+ */
60
+ export interface DashboardRemoteOptionsConfig {
61
+ /** Loads one page of options for the current search term. */
62
+ load: (request: DashboardRemoteOptionsRequest) => Promise<RemoteOptionsResult<DashboardOption<string>>>;
63
+ /** Resolves labels for selected values missing from the loaded pages. */
64
+ resolveSelected?: (request: {
65
+ values: readonly string[];
66
+ }) => Promise<readonly DashboardOption<string>[]>;
67
+ /** Defaults to `{ type: 'page', size: 25 }`. */
68
+ pagination?: RemoteOptionsPagination;
69
+ search?: RemoteOptionsSearch;
70
+ /** Cache identity of the option source. Defaults to a key derived from the param location. */
71
+ queryKey?: QueryKey;
72
+ }
73
+ /** Runtime view of a param definition, with its value type erased. */
74
+ export interface DashboardRuntimeParam extends DashboardParamLike {
75
+ /** Erased codec, in the shape `useQueryStates` accepts for heterogeneous schemas. */
76
+ readonly codec: StaticQueryStateOptions['codec'];
77
+ readonly urlKey?: string;
78
+ readonly omitDefault?: boolean;
79
+ readonly historyMode?: HistoryMode;
80
+ /** Static option items for `p.enum` and `p.options`. */
81
+ readonly items?: readonly DashboardOption[];
82
+ /** Remote option source for `p.remote`. */
83
+ readonly remote?: DashboardRemoteOptionsConfig;
84
+ }
85
+ /**
86
+ * Param definition produced by the `p.*` builders. `defaultValue` carries the resolved value type:
87
+ * it includes `undefined` only when no default was declared.
88
+ */
89
+ export type DashboardParamDefinition<TValue> = Omit<DashboardRuntimeParam, 'codec' | 'defaultValue'> & {
90
+ readonly codec: QueryCodec<TValue | undefined>;
91
+ readonly defaultValue: TValue;
92
+ };
93
+ /** Structural constraint every param definition satisfies, whatever its value type. */
94
+ export interface DashboardParamLike {
95
+ readonly kind: DashboardParamKind;
96
+ readonly multiple: boolean;
97
+ readonly defaultValue: unknown;
98
+ }
99
+ export type DashboardParamMap = Record<string, DashboardParamLike>;
100
+ /** Empty map used when a scope declares no params, queries, or derived values. */
101
+ export type DashboardEmptyMap = Record<never, never>;
102
+ /** Writable, URL-synced values of a param map. Every property is a `v-model` target. */
103
+ export type DashboardParamValues<TParams> = {
104
+ -readonly [K in keyof TParams]: TParams[K] extends {
105
+ readonly defaultValue: infer TValue;
106
+ } ? TValue : never;
107
+ };
108
+ /** Keys of params that carry option items (`p.enum`, `p.options`, `p.remote`, `p.comparison`). */
109
+ export type DashboardOptionParamKeys<TParams> = {
110
+ [K in keyof TParams]: TParams[K] extends {
111
+ readonly kind: 'enum' | 'options' | 'remote' | 'comparison';
112
+ } ? K : never;
113
+ }[keyof TParams];
114
+ /** The `p` builder handed to every `params` callback. */
115
+ export type DashboardParamBuilder = typeof dashboardParamBuilder;
File without changes