@chelone/vue 0.7.0 → 0.9.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 (225) hide show
  1. package/dist/admin/admin.vue_vue_type_script_setup_true_lang.js +5 -4
  2. package/dist/admin/auth-gate.js +1 -3
  3. package/dist/admin/resource-view.d.ts +8 -0
  4. package/dist/admin/resource-view.js +19 -0
  5. package/dist/auth/permissions-hooks.js +1 -3
  6. package/dist/choices/choices-context.d.ts +1 -2
  7. package/dist/choices/use-choices.d.ts +3 -3
  8. package/dist/choices/use-choices.js +13 -10
  9. package/dist/choices/use-reference-input.js +4 -4
  10. package/dist/components/admin/auth/auth-error.vue_vue_type_script_setup_true_lang.js +4 -3
  11. package/dist/components/admin/auth/auth-layout.vue_vue_type_script_setup_true_lang.js +1 -1
  12. package/dist/components/admin/auth/can-access.vue.d.ts +2 -2
  13. package/dist/components/admin/auth/login-form.vue_vue_type_script_setup_true_lang.js +3 -2
  14. package/dist/components/admin/auth/login-with-email.vue_vue_type_script_setup_true_lang.js +1 -0
  15. package/dist/components/admin/buttons/bulk-update-button.vue.d.ts +19 -6
  16. package/dist/components/admin/buttons/bulk-update-button.vue_vue_type_script_setup_true_lang.js +1 -1
  17. package/dist/components/admin/buttons/clone-button.vue.d.ts +19 -16
  18. package/dist/components/admin/buttons/clone-button.vue_vue_type_script_setup_true_lang.js +4 -5
  19. package/dist/components/admin/buttons/delete-button.vue.d.ts +19 -10
  20. package/dist/components/admin/buttons/delete-button.vue_vue_type_script_setup_true_lang.js +6 -7
  21. package/dist/components/admin/buttons/dual-approval-button.vue_vue_type_script_setup_true_lang.js +14 -2
  22. package/dist/components/admin/buttons/edit-button.vue.d.ts +19 -16
  23. package/dist/components/admin/buttons/edit-button.vue_vue_type_script_setup_true_lang.js +4 -5
  24. package/dist/components/admin/buttons/export-button.vue_vue_type_script_setup_true_lang.js +2 -2
  25. package/dist/components/admin/buttons/fields-selector.vue_vue_type_script_setup_true_lang.js +1 -2
  26. package/dist/components/admin/buttons/filter-button.vue_vue_type_script_setup_true_lang.js +1 -1
  27. package/dist/components/admin/buttons/record-button-props.d.ts +12 -0
  28. package/dist/components/admin/buttons/show-button.vue.d.ts +19 -16
  29. package/dist/components/admin/buttons/show-button.vue_vue_type_script_setup_true_lang.js +4 -5
  30. package/dist/components/admin/buttons/status-transition-button.vue_vue_type_script_setup_true_lang.js +3 -7
  31. package/dist/components/admin/buttons/update-button.vue.d.ts +28 -24
  32. package/dist/components/admin/buttons/update-button.vue_vue_type_script_setup_true_lang.js +3 -4
  33. package/dist/components/admin/common/application-updated-notification.vue_vue_type_script_setup_true_lang.js +1 -1
  34. package/dist/components/admin/common/i18n-key-editor.vue_vue_type_script_setup_true_lang.js +1 -2
  35. package/dist/components/admin/csv-import/csv-import.vue_vue_type_script_setup_true_lang.js +2 -5
  36. package/dist/components/admin/feedback/error.vue_vue_type_script_setup_true_lang.js +1 -1
  37. package/dist/components/admin/feedback/linear-progress.vue_vue_type_script_setup_true_lang.js +1 -0
  38. package/dist/components/admin/feedback/loading.vue_vue_type_script_setup_true_lang.js +7 -6
  39. package/dist/components/admin/feedback/placeholder.vue_vue_type_script_setup_true_lang.js +4 -1
  40. package/dist/components/admin/fields/api-key-field.vue.d.ts +3 -3
  41. package/dist/components/admin/fields/api-key-field.vue_vue_type_script_setup_true_lang.js +6 -7
  42. package/dist/components/admin/fields/array-field.vue.d.ts +3 -3
  43. package/dist/components/admin/fields/badge-field.vue.d.ts +3 -3
  44. package/dist/components/admin/fields/boolean-field.vue.d.ts +3 -3
  45. package/dist/components/admin/fields/chip-field.vue.d.ts +3 -3
  46. package/dist/components/admin/fields/color-field.vue.d.ts +3 -3
  47. package/dist/components/admin/fields/cron-field.vue.d.ts +3 -3
  48. package/dist/components/admin/fields/currency-field.vue.d.ts +3 -3
  49. package/dist/components/admin/fields/date-field.vue.d.ts +3 -3
  50. package/dist/components/admin/fields/diff-viewer.vue.d.ts +3 -3
  51. package/dist/components/admin/fields/duration-field.vue.d.ts +3 -3
  52. package/dist/components/admin/fields/email-field.vue.d.ts +3 -3
  53. package/dist/components/admin/fields/field-props.d.ts +2 -2
  54. package/dist/components/admin/fields/file-field.vue.d.ts +3 -3
  55. package/dist/components/admin/fields/function-field.vue.d.ts +3 -3
  56. package/dist/components/admin/fields/image-field.vue.d.ts +3 -3
  57. package/dist/components/admin/fields/json-field.vue.d.ts +3 -3
  58. package/dist/components/admin/fields/number-field.vue.d.ts +3 -3
  59. package/dist/components/admin/fields/phone-field.vue.d.ts +3 -3
  60. package/dist/components/admin/fields/phone-field.vue_vue_type_script_setup_true_lang.js +3 -1
  61. package/dist/components/admin/fields/rating-field.vue.d.ts +3 -3
  62. package/dist/components/admin/fields/rating-field.vue_vue_type_script_setup_true_lang.js +5 -5
  63. package/dist/components/admin/fields/record-field.vue.d.ts +3 -3
  64. package/dist/components/admin/fields/reference-array-field.vue.d.ts +20 -10
  65. package/dist/components/admin/fields/reference-field.vue.d.ts +22 -35
  66. package/dist/components/admin/fields/reference-many-count.vue.d.ts +20 -5
  67. package/dist/components/admin/fields/reference-many-field.vue.d.ts +20 -12
  68. package/dist/components/admin/fields/reference-one-field.vue.d.ts +22 -12
  69. package/dist/components/admin/fields/select-field.vue.d.ts +3 -3
  70. package/dist/components/admin/fields/subscription-plan-field.vue.d.ts +3 -3
  71. package/dist/components/admin/fields/text-array-field.vue.d.ts +3 -3
  72. package/dist/components/admin/fields/text-field.vue.d.ts +3 -3
  73. package/dist/components/admin/fields/url-field.vue.d.ts +3 -3
  74. package/dist/components/admin/fields/usage-meter-field.vue.d.ts +3 -3
  75. package/dist/components/admin/fields/usage-meter-field.vue_vue_type_script_setup_true_lang.js +6 -6
  76. package/dist/components/admin/fields/webhook-endpoint-field.vue.d.ts +3 -3
  77. package/dist/components/admin/fields/webhook-endpoint-field.vue_vue_type_script_setup_true_lang.js +1 -1
  78. package/dist/components/admin/fields/wrapper-field.vue.d.ts +21 -11
  79. package/dist/components/admin/inputs/api-key-input.vue.d.ts +20 -5
  80. package/dist/components/admin/inputs/api-key-input.vue_vue_type_script_setup_true_lang.js +3 -4
  81. package/dist/components/admin/inputs/array-input-row.vue_vue_type_script_setup_true_lang.js +1 -1
  82. package/dist/components/admin/inputs/checkbox-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
  83. package/dist/components/admin/inputs/date-input-format.d.ts +4 -1
  84. package/dist/components/admin/inputs/date-input-format.js +10 -1
  85. package/dist/components/admin/inputs/date-input.vue_vue_type_script_setup_true_lang.js +3 -2
  86. package/dist/components/admin/inputs/date-time-input.vue_vue_type_script_setup_true_lang.js +3 -2
  87. package/dist/components/admin/inputs/duration-input.vue_vue_type_script_setup_true_lang.js +1 -1
  88. package/dist/components/admin/inputs/image-input-thumbnail.vue_vue_type_script_setup_true_lang.js +6 -5
  89. package/dist/components/admin/inputs/image-input.vue.d.ts +1 -0
  90. package/dist/components/admin/inputs/image-input.vue_vue_type_script_setup_true_lang.js +4 -1
  91. package/dist/components/admin/inputs/in-place-editor-form.vue.d.ts +3 -3
  92. package/dist/components/admin/inputs/in-place-editor-form.vue_vue_type_script_setup_true_lang.js +1 -1
  93. package/dist/components/admin/inputs/in-place-editor.vue.d.ts +3 -3
  94. package/dist/components/admin/inputs/number-input.vue.d.ts +6 -0
  95. package/dist/components/admin/inputs/number-input.vue_vue_type_script_setup_true_lang.js +9 -0
  96. package/dist/components/admin/inputs/password-input.vue_vue_type_script_setup_true_lang.js +34 -30
  97. package/dist/components/admin/inputs/phone-input.vue_vue_type_script_setup_true_lang.js +1 -1
  98. package/dist/components/admin/inputs/radio-button-group-input.vue_vue_type_script_setup_true_lang.js +1 -1
  99. package/dist/components/admin/inputs/rating-input.vue_vue_type_script_setup_true_lang.js +24 -12
  100. package/dist/components/admin/inputs/reference-input.vue.d.ts +1 -1
  101. package/dist/components/admin/inputs/reference-input.vue_vue_type_script_setup_true_lang.js +2 -1
  102. package/dist/components/admin/inputs/resettable-text-input.vue.d.ts +6 -4
  103. package/dist/components/admin/inputs/resettable-text-input.vue_vue_type_script_setup_true_lang.js +44 -39
  104. package/dist/components/admin/inputs/subscription-plan-picker.vue_vue_type_script_setup_true_lang.js +2 -2
  105. package/dist/components/admin/inputs/text-input.vue.d.ts +13 -2
  106. package/dist/components/admin/inputs/text-input.vue_vue_type_script_setup_true_lang.js +9 -4
  107. package/dist/components/admin/inputs/time-input.vue_vue_type_script_setup_true_lang.js +3 -2
  108. package/dist/components/admin/inputs/use-choice-input.d.ts +2 -2
  109. package/dist/components/admin/layout/app-sidebar.vue.d.ts +12 -1
  110. package/dist/components/admin/layout/app-sidebar.vue_vue_type_script_setup_true_lang.js +15 -11
  111. package/dist/components/admin/layout/command-menu-content.vue_vue_type_script_setup_true_lang.js +1 -1
  112. package/dist/components/admin/layout/command-menu.vue.d.ts +1 -1
  113. package/dist/components/admin/layout/command-menu.vue_vue_type_script_setup_true_lang.js +9 -63
  114. package/dist/components/admin/layout/data-provider-devtools-entry.vue.d.ts +1 -1
  115. package/dist/components/admin/layout/data-provider-devtools-entry.vue_vue_type_script_setup_true_lang.js +3 -3
  116. package/dist/components/admin/layout/data-provider-devtools.vue_vue_type_script_setup_true_lang.js +1 -1
  117. package/dist/components/admin/layout/layout.vue_vue_type_script_setup_true_lang.js +1 -1
  118. package/dist/components/admin/layout/menu-item-link.vue.d.ts +5 -0
  119. package/dist/components/admin/layout/menu-item-link.vue_vue_type_script_setup_true_lang.js +27 -8
  120. package/dist/components/admin/layout/onboarding-tour-overlay.vue_vue_type_script_setup_true_lang.js +1 -2
  121. package/dist/components/admin/layout/resource-menu-item-group.vue.d.ts +8 -1
  122. package/dist/components/admin/layout/resource-menu-item-group.vue_vue_type_script_setup_true_lang.js +8 -7
  123. package/dist/components/admin/layout/theme-provider.vue_vue_type_script_setup_true_lang.js +2 -1
  124. package/dist/components/admin/layout/title-portal-id.d.ts +1 -1
  125. package/dist/components/admin/layout/title-portal-id.js +1 -9
  126. package/dist/components/admin/layout/top-toolbar.vue_vue_type_script_setup_true_lang.js +4 -1
  127. package/dist/components/admin/list/approval-queue-row.vue.d.ts +2 -2
  128. package/dist/components/admin/list/approval-queue-row.vue_vue_type_script_setup_true_lang.js +2 -2
  129. package/dist/components/admin/list/approval-queue.vue.d.ts +3 -3
  130. package/dist/components/admin/list/calendar-agenda-view.vue.d.ts +23 -15
  131. package/dist/components/admin/list/calendar-event.vue.d.ts +21 -8
  132. package/dist/components/admin/list/calendar-list.vue.d.ts +29 -56
  133. package/dist/components/admin/list/calendar-list.vue_vue_type_script_setup_true_lang.js +12 -8
  134. package/dist/components/admin/list/calendar-month-view.vue.d.ts +26 -20
  135. package/dist/components/admin/list/calendar-month-view.vue_vue_type_script_setup_true_lang.js +2 -6
  136. package/dist/components/admin/list/calendar-week-view.vue.d.ts +24 -17
  137. package/dist/components/admin/list/data-table-col.vue_vue_type_script_setup_true_lang.js +8 -5
  138. package/dist/components/admin/list/data-table-context.d.ts +9 -6
  139. package/dist/components/admin/list/data-table-context.js +9 -1
  140. package/dist/components/admin/list/data-table-row.vue.d.ts +19 -15
  141. package/dist/components/admin/list/data-table-row.vue_vue_type_script_setup_true_lang.js +5 -9
  142. package/dist/components/admin/list/data-table.vue.d.ts +35 -23
  143. package/dist/components/admin/list/data-table.vue_vue_type_script_setup_true_lang.js +4 -7
  144. package/dist/components/admin/list/list-pagination.vue_vue_type_script_setup_true_lang.js +2 -2
  145. package/dist/components/admin/list/pivot-grid.vue.d.ts +3 -3
  146. package/dist/components/admin/list/record-timeline.vue.d.ts +3 -3
  147. package/dist/components/admin/list/record-timeline.vue_vue_type_script_setup_true_lang.js +1 -1
  148. package/dist/components/admin/list/simple-list-item.vue.d.ts +21 -19
  149. package/dist/components/admin/list/simple-list-item.vue_vue_type_script_setup_true_lang.js +3 -7
  150. package/dist/components/admin/list/simple-list.vue.d.ts +28 -20
  151. package/dist/components/admin/list/single-field-list-record.vue.d.ts +19 -9
  152. package/dist/components/admin/list/single-field-list.vue.d.ts +21 -11
  153. package/dist/components/admin/list/tree-list-context.d.ts +11 -6
  154. package/dist/components/admin/list/tree-list-node.vue.d.ts +19 -4
  155. package/dist/components/admin/list/tree-list.vue.d.ts +28 -37
  156. package/dist/components/admin/realtime/comments-thread.vue_vue_type_script_setup_true_lang.js +56 -44
  157. package/dist/components/admin/supabase/forgot-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
  158. package/dist/components/admin/supabase/set-password-form.vue_vue_type_script_setup_true_lang.js +4 -3
  159. package/dist/components/admin/supabase/use-password-recovery.js +11 -1
  160. package/dist/components/admin/view/create.vue_vue_type_script_setup_true_lang.js +1 -1
  161. package/dist/components/admin/view/edit.vue_vue_type_script_setup_true_lang.js +1 -1
  162. package/dist/components/admin/view/show.vue_vue_type_script_setup_true_lang.js +1 -1
  163. package/dist/components/admin/widgets/job-monitor-row.vue.d.ts +24 -11
  164. package/dist/components/admin/widgets/job-monitor.vue.d.ts +3 -3
  165. package/dist/components/admin/widgets/job-monitor.vue_vue_type_script_setup_true_lang.js +2 -2
  166. package/dist/components/block-editor/block-doc-field.vue.d.ts +3 -3
  167. package/dist/components/block-editor/block-drag-handle.vue_vue_type_script_setup_true_lang.js +3 -4
  168. package/dist/components/block-editor/image-block-config.vue_vue_type_script_setup_true_lang.js +2 -3
  169. package/dist/components/charts/bar-chart.vue.d.ts +6 -2
  170. package/dist/components/charts/bar-chart.vue_vue_type_script_setup_true_lang.js +6 -4
  171. package/dist/components/charts/series-chart.d.ts +1 -1
  172. package/dist/components/charts/series-chart.js +9 -3
  173. package/dist/components/index.js +2 -2
  174. package/dist/components/inspector/configurable.vue.d.ts +0 -21
  175. package/dist/components/inspector/configurable.vue_vue_type_script_setup_true_lang.js +2 -2
  176. package/dist/components/inspector/inspector.vue_vue_type_script_setup_true_lang.js +6 -8
  177. package/dist/components/kanban/kanban-board.vue.d.ts +3 -3
  178. package/dist/components/kanban/kanban-board.vue_vue_type_script_setup_true_lang.js +7 -2
  179. package/dist/components/maps/bbox-field.vue_vue_type_script_setup_true_lang.js +4 -4
  180. package/dist/components/maps/geo-json-field.vue_vue_type_script_setup_true_lang.js +4 -4
  181. package/dist/components/maps/geo-json-layers.vue_vue_type_script_setup_true_lang.js +3 -3
  182. package/dist/components/maps/geo-json-view.vue_vue_type_script_setup_true_lang.js +3 -2
  183. package/dist/components/maps/lat-lng-field.vue_vue_type_script_setup_true_lang.js +4 -3
  184. package/dist/components/maps/lat-lng-input.vue_vue_type_script_setup_true_lang.js +5 -7
  185. package/dist/components/maps/map-canvas.vue_vue_type_script_setup_true_lang.js +3 -3
  186. package/dist/components/maps/use-map.js +1 -3
  187. package/dist/components/maps-draw/shape-input.vue_vue_type_script_setup_true_lang.js +5 -5
  188. package/dist/components/maps-draw/simplify-input.vue_vue_type_script_setup_true_lang.js +2 -2
  189. package/dist/components/maps-osm/geocoding-input.vue_vue_type_script_setup_true_lang.js +2 -1
  190. package/dist/components/maps-osm/map-with-search.vue_vue_type_script_setup_true_lang.js +2 -2
  191. package/dist/components/mdx-editor/mdx-editor-theme.css +47 -0
  192. package/dist/components/mdx-editor/mdx-field.vue.d.ts +21 -11
  193. package/dist/components/mdx-editor/mdx-input.vue_vue_type_script_setup_true_lang.js +4 -1
  194. package/dist/components/monaco/internal/use-json-schema.js +1 -2
  195. package/dist/components/monaco/internal/use-monaco-markers.d.ts +0 -6
  196. package/dist/components/monaco/internal/use-monaco-markers.js +4 -2
  197. package/dist/components/monaco/monaco-json-field-lazy.vue.d.ts +2 -2
  198. package/dist/components/monaco/monaco-json-field-lazy.vue_vue_type_script_setup_true_lang.js +3 -2
  199. package/dist/components/monaco/monaco-json-field.vue.d.ts +3 -3
  200. package/dist/components/monaco/monaco-json-input-lazy.vue_vue_type_script_setup_true_lang.js +4 -4
  201. package/dist/components/rich-text-input/rich-text-field.vue.d.ts +3 -3
  202. package/dist/components/ui/avatar.js +1 -1
  203. package/dist/components/ui/badge.js +4 -4
  204. package/dist/components/ui/button-variants.js +1 -1
  205. package/dist/components/ui/chart/chart-container.vue_vue_type_script_setup_true_lang.js +1 -1
  206. package/dist/components/ui/checkbox.vue_vue_type_script_setup_true_lang.js +1 -1
  207. package/dist/components/ui/command/command-dialog.vue_vue_type_script_setup_true_lang.js +1 -1
  208. package/dist/components/ui/sidebar/sidebar-menu-button.vue_vue_type_script_setup_true_lang.js +1 -1
  209. package/dist/components/ui/sidebar/sidebar-parts.js +2 -2
  210. package/dist/components/ui/sidebar/sidebar.vue_vue_type_script_setup_true_lang.js +2 -2
  211. package/dist/controllers/use-controller-for-id.d.ts +2 -2
  212. package/dist/controllers/use-prev-next-controller.d.ts +2 -2
  213. package/dist/controllers/use-reference-many-field-controller.d.ts +4 -4
  214. package/dist/controllers/use-reference-one-field-controller.d.ts +4 -4
  215. package/dist/create-resource-components.d.ts +225 -117
  216. package/dist/data/undoable.js +2 -2
  217. package/dist/form/use-form.d.ts +5 -3
  218. package/dist/form/use-form.js +1 -1
  219. package/dist/form/use-input.d.ts +0 -2
  220. package/dist/form/use-input.js +1 -2
  221. package/dist/index.js +2 -2
  222. package/dist/resource-context.d.ts +5 -1
  223. package/dist/resource-context.js +4 -0
  224. package/dist/router/use-get-path-for-record.d.ts +3 -3
  225. package/package.json +5 -5
@@ -1,7 +1,7 @@
1
1
  import { type VNode } from "vue";
2
- import type { CalendarEvent, LooseRecord } from "@chelone/core";
2
+ import type { CalendarEvent, LooseRecord, ResourceRecord } from "@chelone/core";
3
3
  /** What the `#event` slot of a `<CalendarList>` receives: the event and the day cell it renders in. */
4
- export interface CalendarEventSlotProps extends CalendarEvent<LooseRecord> {
4
+ export interface CalendarEventSlotProps<TRecord extends ResourceRecord = LooseRecord> extends CalendarEvent<TRecord> {
5
5
  day: Date;
6
6
  }
7
7
  /** The time span `select-slot` reports. */
@@ -16,7 +16,7 @@ export interface CalendarDrop {
16
16
  end?: string;
17
17
  }
18
18
  /** Props for {@link CalendarMonthView}. */
19
- export interface CalendarMonthViewProps {
19
+ export interface CalendarMonthViewProps<TRecord extends ResourceRecord = LooseRecord> {
20
20
  /** Every day of the grid, whole weeks, in order. */
21
21
  days: Date[];
22
22
  /** Its month decides which days are outside the month. */
@@ -25,29 +25,35 @@ export interface CalendarMonthViewProps {
25
25
  weekdays: string[];
26
26
  /** The label of the grid. */
27
27
  label: string;
28
- events: CalendarEvent<LooseRecord>[];
28
+ events: CalendarEvent<TRecord>[];
29
29
  /** The link an event is, when it navigates. */
30
- hrefFor: (record: LooseRecord) => string | undefined;
30
+ hrefFor: (record: TRecord) => string | undefined;
31
31
  /** Whether activating the event does anything: it is inert otherwise. */
32
- isSelectable: (record: LooseRecord) => boolean;
32
+ isSelectable: (record: TRecord) => boolean;
33
33
  /** Whether events can be dragged to another day. */
34
34
  draggable?: boolean;
35
35
  }
36
36
  declare const _default: typeof __VLS_export;
37
37
  export default _default;
38
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CalendarMonthViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
39
- drop: (record: LooseRecord, range: CalendarDrop) => any;
40
- selectEvent: (record: LooseRecord) => any;
41
- selectSlot: (slot: CalendarSlot) => any;
42
- }, string, import("vue").PublicProps, Readonly<CalendarMonthViewProps> & Readonly<{
43
- onDrop?: ((record: LooseRecord, range: CalendarDrop) => any) | undefined;
44
- onSelectEvent?: ((record: LooseRecord) => any) | undefined;
45
- onSelectSlot?: ((slot: CalendarSlot) => any) | undefined;
46
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
47
- event?(props: CalendarEventSlotProps): VNode[];
48
- }>;
49
- type __VLS_WithSlots<T, S> = T & {
50
- new (): {
51
- $slots: S;
38
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
39
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<CalendarMonthViewProps<TRecord> & {
40
+ onDrop?: ((record: TRecord, range: CalendarDrop) => any) | undefined;
41
+ onSelectEvent?: ((record: TRecord) => any) | undefined;
42
+ onSelectSlot?: ((slot: CalendarSlot) => any) | undefined;
43
+ }> & (typeof globalThis extends {
44
+ __VLS_PROPS_FALLBACK: infer P;
45
+ } ? P : {});
46
+ expose: (exposed: {}) => void;
47
+ attrs: any;
48
+ slots: {
49
+ event?(props: CalendarEventSlotProps<TRecord>): VNode[];
52
50
  };
51
+ emit: ((evt: "drop", record: TRecord, range: CalendarDrop) => void) & ((evt: "selectEvent", record: TRecord) => void) & ((evt: "selectSlot", slot: CalendarSlot) => void);
52
+ }>) => import("vue").VNode & {
53
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
53
54
  };
55
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
56
+ [K in keyof T]: T[K];
57
+ } : {
58
+ [K in keyof T as K]: T[K];
59
+ }) & {};
@@ -1,6 +1,6 @@
1
1
  import { cn } from "../../../lib/utils.js";
2
2
  import { Fragment, computed, createBlock, createElementBlock, createElementVNode, createTextVNode, defineComponent, mergeProps, normalizeClass, normalizeStyle, onBeforeUnmount, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, unref, withCtx, withModifiers } from "vue";
3
- import { calendarDayKey, calendarEventsOnDay, moveCalendarEvent } from "@chelone/core";
3
+ import { calendarDayKey, calendarDaySlot, calendarEventsOnDay, moveCalendarEvent } from "@chelone/core";
4
4
  // src/components/admin/list/calendar-month-view.vue?vue&type=script&setup=true&lang.ts
5
5
  var _hoisted_1 = ["aria-label"];
6
6
  var _hoisted_2 = {
@@ -67,11 +67,7 @@ var calendar_month_view_vue_vue_type_script_setup_true_lang_default = /*@__PURE_
67
67
  onBeforeUnmount(() => clearTimeout(midnightTimer));
68
68
  const eventsOn = (day) => calendarEventsOnDay(props.events, day);
69
69
  function selectSlot(day) {
70
- emit("selectSlot", {
71
- startISO: new Date(day.getFullYear(), day.getMonth(), day.getDate()).toISOString(),
72
- endISO: new Date(day.getFullYear(), day.getMonth(), day.getDate(), 23, 59, 59, 999).toISOString(),
73
- allDay: true
74
- });
70
+ emit("selectSlot", calendarDaySlot(day));
75
71
  }
76
72
  function onEventClick(event, record) {
77
73
  if (!props.isSelectable(record)) return;
@@ -1,32 +1,39 @@
1
1
  import { type VNode } from "vue";
2
2
  import type { CalendarEventSlotProps, CalendarSlot } from "./calendar-month-view.vue.js";
3
- import type { CalendarEvent, CalendarLabels, LooseRecord } from "@chelone/core";
3
+ import type { CalendarEvent, CalendarLabels, LooseRecord, ResourceRecord } from "@chelone/core";
4
4
  /** Props for {@link CalendarWeekView}. */
5
- export interface CalendarWeekViewProps {
5
+ export interface CalendarWeekViewProps<TRecord extends ResourceRecord = LooseRecord> {
6
6
  /** The seven days of the week, in order. */
7
7
  days: Date[];
8
8
  labels: CalendarLabels;
9
9
  /** The label of the grid. */
10
10
  label: string;
11
- events: CalendarEvent<LooseRecord>[];
11
+ events: CalendarEvent<TRecord>[];
12
12
  /** The link an event is, when it navigates. */
13
- hrefFor: (record: LooseRecord) => string | undefined;
13
+ hrefFor: (record: TRecord) => string | undefined;
14
14
  /** Whether activating the event does anything: it is inert otherwise. */
15
- isSelectable: (record: LooseRecord) => boolean;
15
+ isSelectable: (record: TRecord) => boolean;
16
16
  }
17
17
  declare const _default: typeof __VLS_export;
18
18
  export default _default;
19
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CalendarWeekViewProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
- selectEvent: (record: LooseRecord) => any;
21
- selectSlot: (slot: CalendarSlot) => any;
22
- }, string, import("vue").PublicProps, Readonly<CalendarWeekViewProps> & Readonly<{
23
- onSelectEvent?: ((record: LooseRecord) => any) | undefined;
24
- onSelectSlot?: ((slot: CalendarSlot) => any) | undefined;
25
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
26
- event?(props: CalendarEventSlotProps): VNode[];
27
- }>;
28
- type __VLS_WithSlots<T, S> = T & {
29
- new (): {
30
- $slots: S;
19
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
20
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<CalendarWeekViewProps<TRecord> & {
21
+ onSelectEvent?: ((record: TRecord) => any) | undefined;
22
+ onSelectSlot?: ((slot: CalendarSlot) => any) | undefined;
23
+ }> & (typeof globalThis extends {
24
+ __VLS_PROPS_FALLBACK: infer P;
25
+ } ? P : {});
26
+ expose: (exposed: {}) => void;
27
+ attrs: any;
28
+ slots: {
29
+ event?(props: CalendarEventSlotProps<TRecord>): VNode[];
31
30
  };
31
+ emit: ((evt: "selectEvent", record: TRecord) => void) & ((evt: "selectSlot", slot: CalendarSlot) => void);
32
+ }>) => import("vue").VNode & {
33
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
32
34
  };
35
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
36
+ [K in keyof T]: T[K];
37
+ } : {
38
+ [K in keyof T as K]: T[K];
39
+ }) & {};
@@ -7,8 +7,12 @@ import { TableCell, TableHead } from "../../ui/table.js";
7
7
  import { ChevronDownIcon } from "../buttons/icons.js";
8
8
  import field_label_text_default from "../common/field-label-text.js";
9
9
  import { useDataTablePass } from "./data-table-context.js";
10
- import { computed, createBlock, createCommentVNode, createTextVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
10
+ import { computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, renderSlot, toDisplayString, unref, withCtx } from "vue";
11
11
  // src/components/admin/list/data-table-col.vue?vue&type=script&setup=true&lang.ts
12
+ var _hoisted_1 = {
13
+ key: 1,
14
+ class: "text-xs"
15
+ };
12
16
  var data_table_col_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
13
17
  __name: "data-table-col",
14
18
  props: {
@@ -67,7 +71,7 @@ var data_table_col_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
67
71
  key: 0,
68
72
  variant: "ghost",
69
73
  size: "sm",
70
- class: "-mx-3 h-8",
74
+ class: "-mx-2 h-8",
71
75
  "data-field": __props.source,
72
76
  onClick: onSort
73
77
  }, {
@@ -79,11 +83,10 @@ var data_table_col_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
79
83
  class: normalizeClass(primarySort.value?.order === "ASC" ? "rotate-180" : "")
80
84
  }, null, 8, ["class"])) : createCommentVNode("", true)]),
81
85
  _: 1
82
- }, 8, ["data-field"])) : (openBlock(), createBlock(field_label_text_default, {
83
- key: 1,
86
+ }, 8, ["data-field"])) : (openBlock(), createElementBlock("span", _hoisted_1, [createVNode(field_label_text_default, {
84
87
  label: __props.label,
85
88
  source: __props.source
86
- }, null, 8, ["label", "source"]))]),
89
+ }, null, 8, ["label", "source"])]))]),
87
90
  _: 1
88
91
  }, 8, ["class", "aria-sort"])) : (openBlock(), createBlock(unref(TableCell), {
89
92
  key: 1,
@@ -12,7 +12,7 @@
12
12
  * against its own outlet's provider — the standard "renderless provider wrapping
13
13
  * slot content" pattern.
14
14
  */
15
- import type { CreatePathType, Identifier, LooseRecord } from "@chelone/core";
15
+ import type { CreatePathType, Identifier, LooseRecord, ResourceRecord } from "@chelone/core";
16
16
  import { type InjectionKey, type PropType, type Ref, type VNode } from "vue";
17
17
  /** Which pass a `<DataTableCol>` is rendering in. */
18
18
  export type DataTablePass = "header" | "data";
@@ -70,19 +70,22 @@ export declare const ColumnsOutlet: import("vue").DefineComponent<import("vue").
70
70
  report: () => void;
71
71
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
72
72
  /** What a row click does: a link type, `"expand"`, `"toggleSelection"` or nothing. */
73
- export type DataTableRowClick = "edit" | "show" | "expand" | "toggleSelection" | false | ((record: LooseRecord, id: Identifier) => CreatePathType | "expand" | "toggleSelection" | false);
73
+ export type DataTableRowClick<TRecord extends ResourceRecord = LooseRecord> = "edit" | "show" | "expand" | "toggleSelection" | false | ((record: TRecord, id: Identifier) => CreatePathType | "expand" | "toggleSelection" | false);
74
74
  /**
75
75
  * Row behaviour `<DataTable>` shares with its `<DataTableRow>`s. The expanded
76
76
  * ids live in `<DataTable>` so the header's expand-all button and every row's
77
77
  * toggle act on the same state.
78
78
  */
79
- export interface DataTableRowsContext {
80
- rowClick: Ref<DataTableRowClick>;
79
+ export interface DataTableRowsContext<TRecord extends ResourceRecord = LooseRecord> {
80
+ rowClick: Ref<DataTableRowClick<TRecord>>;
81
81
  /** True when the `#expand` slot is passed. */
82
82
  expandEnabled: Ref<boolean>;
83
83
  expandedIds: Ref<Identifier[]>;
84
84
  toggleExpand: (id: Identifier) => void;
85
85
  /** Whether the record can expand (true when no `isRowExpandable` is set). */
86
- canExpand: (record: LooseRecord) => boolean;
86
+ canExpand: (record: TRecord) => boolean;
87
87
  }
88
- export declare const DataTableRowsKey: InjectionKey<DataTableRowsContext>;
88
+ /** Publish the table's row behaviour to its rows, typed at the table's record. */
89
+ export declare function provideDataTableRows<TRecord extends ResourceRecord>(context: DataTableRowsContext<TRecord>): void;
90
+ /** The ambient table's row behaviour, or `null` outside a `<DataTable>`. */
91
+ export declare function useDataTableRows<TRecord extends ResourceRecord = LooseRecord>(): DataTableRowsContext<TRecord> | null;
@@ -49,4 +49,12 @@ var ColumnsOutlet = defineComponent({
49
49
  }
50
50
  });
51
51
  var DataTableRowsKey = Symbol("chelone-data-table-rows");
52
- export { ColumnsOutlet, DataTablePassKey, DataTableRowsKey, PassProvider, useDataTablePass };
52
+ /** Publish the table's row behaviour to its rows, typed at the table's record. */
53
+ function provideDataTableRows(context) {
54
+ provide(DataTableRowsKey, context);
55
+ }
56
+ /** The ambient table's row behaviour, or `null` outside a `<DataTable>`. */
57
+ function useDataTableRows() {
58
+ return inject(DataTableRowsKey, null);
59
+ }
60
+ export { ColumnsOutlet, DataTablePassKey, PassProvider, provideDataTableRows, useDataTablePass, useDataTableRows };
@@ -12,23 +12,27 @@
12
12
  * checkbox bound to the ambient list selection (`selectedIds` / `toggleItem`);
13
13
  * toggling it stops propagation so it never triggers the row-click navigation.
14
14
  */
15
- import type { LooseRecord } from "@chelone/core";
16
- type __VLS_Props = {
17
- record: LooseRecord;
18
- hasBulkActions?: boolean;
19
- };
20
- declare const __VLS_template: () => {
21
- __VLS_Slots: {
15
+ import type { LooseRecord, ResourceRecord } from "@chelone/core";
16
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
17
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
18
+ record: TRecord;
19
+ hasBulkActions?: boolean;
20
+ }> & (typeof globalThis extends {
21
+ __VLS_PROPS_FALLBACK: infer P;
22
+ } ? P : {});
23
+ expose: (exposed: {}) => void;
24
+ attrs: any;
25
+ slots: {
22
26
  default?: (props: {}) => any;
23
27
  };
28
+ emit: {};
29
+ }>) => import("vue").VNode & {
30
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
24
31
  };
25
- type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
26
- declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
28
32
  declare const _default: typeof __VLS_export;
29
33
  export default _default;
30
- type __VLS_WithSlots<T, S> = T & {
31
- new (): {
32
- $slots: S;
33
- };
34
- };
34
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
35
+ [K in keyof T]: T[K];
36
+ } : {
37
+ [K in keyof T as K]: T[K];
38
+ }) & {};
@@ -1,15 +1,15 @@
1
1
  import { useListContext } from "../../../list/list-context.js";
2
- import { RecordContextKey } from "../../../record/record-context.js";
2
+ import { provideRecordContext } from "../../../record/record-context.js";
3
3
  import { useResourceContext } from "../../../resource-context.js";
4
4
  import { useRouterAdapterOptional } from "../../../router/adapter.js";
5
5
  import { useCreatePath } from "../../../router/nav-composables.js";
6
6
  import button_default from "../../ui/button.js";
7
7
  import checkbox_default from "../../ui/checkbox.js";
8
8
  import { TableCell, TableRow } from "../../ui/table.js";
9
- import { DataTablePassKey, DataTableRowsKey } from "./data-table-context.js";
9
+ import { DataTablePassKey, useDataTableRows } from "./data-table-context.js";
10
10
  import { ChevronDownIcon } from "../buttons/icons.js";
11
11
  import { ChevronRightIcon } from "./list-icons.js";
12
- import { computed, createBlock, createCommentVNode, createVNode, defineComponent, inject, normalizeClass, openBlock, provide, ref, renderSlot, unref, watch, withCtx, withModifiers } from "vue";
12
+ import { computed, createBlock, createCommentVNode, createVNode, defineComponent, normalizeClass, openBlock, provide, renderSlot, unref, withCtx, withModifiers } from "vue";
13
13
  // src/components/admin/list/data-table-row.vue?vue&type=script&setup=true&lang.ts
14
14
  var data_table_row_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
15
15
  __name: "data-table-row",
@@ -33,11 +33,7 @@ var data_table_row_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
33
33
  * toggling it stops propagation so it never triggers the row-click navigation.
34
34
  */
35
35
  const props = __props;
36
- const recordRef = ref(props.record);
37
- watch(() => props.record, (next) => {
38
- recordRef.value = next;
39
- });
40
- provide(RecordContextKey, recordRef);
36
+ provideRecordContext(computed(() => props.record));
41
37
  provide(DataTablePassKey, "data");
42
38
  const list = useListContext();
43
39
  const recordId = computed(() => props.record.id);
@@ -50,7 +46,7 @@ var data_table_row_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ d
50
46
  const resource = useResourceContext();
51
47
  const navigate = adapter?.useNavigate();
52
48
  const createPath = adapter ? useCreatePath() : void 0;
53
- const rows = inject(DataTableRowsKey, null);
49
+ const rows = useDataTableRows();
54
50
  const link = computed(() => {
55
51
  const rowClick = rows?.rowClick.value ?? "edit";
56
52
  return typeof rowClick === "function" ? rowClick(props.record, recordId.value) : rowClick;
@@ -1,7 +1,13 @@
1
- import type { Identifier, LooseRecord } from "@chelone/core";
1
+ import { type VNode } from "vue";
2
+ import type { Identifier, LooseRecord, ResourceRecord } from "@chelone/core";
2
3
  import type { DataTableRowClick } from "./data-table-context.js";
3
- /** Props for {@link DataTable}. */
4
- export interface DataTableProps {
4
+ /**
5
+ * Props for {@link DataTable}. A caller of `h()` with loosely typed callbacks
6
+ * writes `h(DataTable<LooseRecord>, ...)`: `h()` resolves a generic component
7
+ * to its constraint, `ResourceRecord`, which refuses a `(record: LooseRecord)`
8
+ * callback.
9
+ */
10
+ export interface DataTableProps<TRecord extends ResourceRecord = LooseRecord> {
5
11
  class?: string;
6
12
  /** Enable row selection + the bulk-actions toolbar (also on if a `#bulkActions` slot is passed). */
7
13
  bulkActions?: boolean;
@@ -12,13 +18,13 @@ export interface DataTableProps {
12
18
  * `"toggleSelection"`, `false` (inert), or a function of `(record, id)`
13
19
  * returning one of those or any other link type (`false` = do nothing).
14
20
  */
15
- rowClick?: DataTableRowClick;
21
+ rowClick?: DataTableRowClick<TRecord>;
16
22
  /** Allow only one expanded row at a time (also hides the expand-all button). */
17
23
  expandSingle?: boolean;
18
24
  /** Which records can expand; a rejected row gets no toggle. All can by default. */
19
- isRowExpandable?: (record: LooseRecord) => boolean;
25
+ isRowExpandable?: (record: TRecord) => boolean;
20
26
  /** A class for a body row, computed from its record and index. */
21
- rowClass?: (record: LooseRecord, rowIndex: number) => string | false | undefined;
27
+ rowClass?: (record: TRecord, rowIndex: number) => string | false | undefined;
22
28
  /**
23
29
  * The store key of the hidden column ids; the order and the published
24
30
  * columns are kept under keys derived from it. Defaults to
@@ -30,22 +36,28 @@ export interface DataTableProps {
30
36
  }
31
37
  declare const _default: typeof __VLS_export;
32
38
  export default _default;
33
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<DataTableProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DataTableProps> & Readonly<{}>, {
34
- pagination: boolean;
35
- bulkActions: boolean;
36
- rowClick: DataTableRowClick;
37
- expandSingle: boolean;
38
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
39
- expand?: (props: {
40
- id: Identifier;
41
- record: LooseRecord;
42
- resource: string;
43
- }) => any;
44
- } & {
45
- bulkActions?: (props: {}) => any;
46
- }>;
47
- type __VLS_WithSlots<T, S> = T & {
48
- new (): {
49
- $slots: S;
39
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
40
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<DataTableProps<TRecord>> & (typeof globalThis extends {
41
+ __VLS_PROPS_FALLBACK: infer P;
42
+ } ? P : {});
43
+ expose: (exposed: {}) => void;
44
+ attrs: any;
45
+ slots: {
46
+ default?: () => VNode[];
47
+ /** Under an expanded row, given the row's record. */
48
+ expand?: (props: {
49
+ id: Identifier;
50
+ record: TRecord;
51
+ resource: string;
52
+ }) => VNode[];
53
+ bulkActions?: () => VNode[];
50
54
  };
55
+ emit: {};
56
+ }>) => import("vue").VNode & {
57
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
51
58
  };
59
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
60
+ [K in keyof T]: T[K];
61
+ } : {
62
+ [K in keyof T as K]: T[K];
63
+ }) & {};
@@ -6,11 +6,11 @@ import checkbox_default from "../../ui/checkbox.js";
6
6
  import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../ui/table.js";
7
7
  import bulk_actions_toolbar_default from "./bulk-actions-toolbar.js";
8
8
  import button_default from "../../ui/button.js";
9
- import { ColumnsOutlet, DataTableRowsKey, PassProvider } from "./data-table-context.js";
9
+ import { ColumnsOutlet, PassProvider, provideDataTableRows } from "./data-table-context.js";
10
10
  import data_table_row_default from "./data-table-row.js";
11
11
  import { ChevronsUpDownIcon } from "./list-icons.js";
12
12
  import list_pagination_default from "./list-pagination.js";
13
- import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, provide, ref, renderList, renderSlot, unref, useSlots, withCtx, withModifiers } from "vue";
13
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, renderList, renderSlot, unref, useSlots, withCtx, withModifiers } from "vue";
14
14
  import { arrangeColumns, defaultDataTableStoreKey, getDataTableColumnId } from "@chelone/core";
15
15
  // src/components/admin/list/data-table.vue?vue&type=script&setup=true&lang.ts
16
16
  var data_table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
@@ -72,7 +72,7 @@ var data_table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
72
72
  if (expandedIds.value.includes(id)) expandedIds.value = expandedIds.value.filter((x) => x !== id);
73
73
  else expandedIds.value = props.expandSingle ? [id] : [...expandedIds.value, id];
74
74
  }
75
- provide(DataTableRowsKey, {
75
+ provideDataTableRows({
76
76
  rowClick: computed(() => props.rowClick),
77
77
  expandEnabled,
78
78
  expandedIds,
@@ -225,10 +225,7 @@ var data_table_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
225
225
  })]),
226
226
  _: 3
227
227
  }),
228
- __props.pagination ? (openBlock(), createBlock(list_pagination_default, {
229
- key: 0,
230
- class: "mt-2"
231
- })) : createCommentVNode("", true),
228
+ __props.pagination ? (openBlock(), createBlock(list_pagination_default, { key: 0 })) : createCommentVNode("", true),
232
229
  hasBulkActions.value ? (openBlock(), createBlock(bulk_actions_toolbar_default, { key: 1 }, {
233
230
  default: withCtx(() => [renderSlot(_ctx.$slots, "bulkActions")]),
234
231
  _: 3
@@ -7,7 +7,7 @@ import { ChevronLeftIcon, ChevronRightIcon } from "./list-icons.js";
7
7
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, renderList, toDisplayString, unref, watch, withCtx } from "vue";
8
8
  // src/components/admin/list/list-pagination.vue?vue&type=script&setup=true&lang.ts
9
9
  var _hoisted_1 = { class: "hidden md:flex items-center gap-x-2" };
10
- var _hoisted_2 = { class: "text-sm font-medium" };
10
+ var _hoisted_2 = { class: "text-sm font-medium whitespace-nowrap" };
11
11
  var _hoisted_3 = {
12
12
  class: "text-sm text-muted-foreground",
13
13
  "data-slot": "page-range"
@@ -125,7 +125,7 @@ var list_pagination_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
125
125
  return (_ctx, _cache) => {
126
126
  return !hidden.value ? (openBlock(), createElementBlock("div", {
127
127
  key: 0,
128
- class: normalizeClass(unref(cn)("flex items-center justify-end gap-x-2 gap-4", props.class)),
128
+ class: normalizeClass(unref(cn)("mt-2 flex items-center justify-end gap-x-2 gap-4", props.class)),
129
129
  "data-slot": "list-pagination"
130
130
  }, [
131
131
  createElementVNode("div", _hoisted_1, [createElementVNode("p", _hoisted_2, toDisplayString(rowsPerPageLabel.value), 1), createVNode(native_select_default, {
@@ -1,7 +1,7 @@
1
1
  import { type VNode } from "vue";
2
- import type { LooseRecord, PivotAggregator, SourceProp } from "@chelone/core";
2
+ import type { LooseRecord, ResourceRecord, PivotAggregator, SourceProp } from "@chelone/core";
3
3
  /** Props for {@link PivotGrid}. */
4
- export interface PivotGridProps<TRecord extends LooseRecord = LooseRecord> {
4
+ export interface PivotGridProps<TRecord extends ResourceRecord = LooseRecord> {
5
5
  /** The field whose values become the rows; a dotted path reads a nested value. */
6
6
  rowSource: SourceProp<TRecord>;
7
7
  /** The field whose values become the columns. */
@@ -16,7 +16,7 @@ export interface PivotGridProps<TRecord extends LooseRecord = LooseRecord> {
16
16
  }
17
17
  declare const _default: typeof __VLS_export;
18
18
  export default _default;
19
- declare const __VLS_export: <TRecord extends LooseRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
19
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
20
20
  props: import("vue").PublicProps & __VLS_PrettifyLocal<PivotGridProps<TRecord>> & (typeof globalThis extends {
21
21
  __VLS_PROPS_FALLBACK: infer P;
22
22
  } ? P : {});
@@ -1,8 +1,8 @@
1
1
  import { type VNode } from "vue";
2
- import type { LooseRecord, SourceProp } from "@chelone/core";
2
+ import type { LooseRecord, ResourceRecord, SourceProp } from "@chelone/core";
3
3
  import type { Component } from "vue";
4
4
  /** Props for {@link RecordTimeline}. */
5
- export interface RecordTimelineProps<TRecord extends LooseRecord = LooseRecord> {
5
+ export interface RecordTimelineProps<TRecord extends ResourceRecord = LooseRecord> {
6
6
  /** The field printed as the entry's text; a dotted path reads a nested value. */
7
7
  messageSource: SourceProp<TRecord>;
8
8
  /** The field holding the entry's date. An invalid or missing date leaves the time out. */
@@ -17,7 +17,7 @@ export interface RecordTimelineProps<TRecord extends LooseRecord = LooseRecord>
17
17
  }
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
20
- declare const __VLS_export: <TRecord extends LooseRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
20
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
21
21
  props: import("vue").PublicProps & __VLS_PrettifyLocal<RecordTimelineProps<TRecord>> & (typeof globalThis extends {
22
22
  __VLS_PROPS_FALLBACK: infer P;
23
23
  } ? P : {});
@@ -50,9 +50,9 @@ var record_timeline_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
50
50
  * </ReferenceManyField>
51
51
  */
52
52
  const props = __props;
53
- const list = useListContext();
54
53
  const translate = useTranslate();
55
54
  const locale = useLocale();
55
+ const list = useListContext();
56
56
  const timeline = computed(() => {
57
57
  const now = /* @__PURE__ */ new Date();
58
58
  return toTimelineEntries(list.data ?? [], {
@@ -1,13 +1,7 @@
1
- /**
2
- * `<SimpleListItem>` — one `<li>` of a `<SimpleList>`: the row content, linked
3
- * to the record's edit or show page. The Vue analog of `@chelone/react`'s
4
- * `list/simple-list-item.tsx`. Provides the record to its content (so slotted
5
- * fields resolve it via `RecordContext`) and renders nothing without one.
6
- */
7
- import type { LooseRecord } from "@chelone/core";
1
+ import type { LooseRecord, ResourceRecord } from "@chelone/core";
8
2
  /** Props for {@link SimpleListItem}. */
9
- export interface SimpleListItemProps {
10
- record?: LooseRecord;
3
+ export interface SimpleListItemProps<TRecord extends ResourceRecord = LooseRecord> {
4
+ record?: TRecord;
11
5
  /** Override the ambient `<Resource>`. Without one the row is not linked. */
12
6
  resource?: string;
13
7
  /**
@@ -20,15 +14,23 @@ export interface SimpleListItemProps {
20
14
  }
21
15
  declare const _default: typeof __VLS_export;
22
16
  export default _default;
23
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<SimpleListItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SimpleListItemProps> & Readonly<{}>, {
24
- linkType: false | "edit" | "show";
25
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
26
- default?: (props: {}) => any;
27
- } & {
28
- default?: (props: {}) => any;
29
- }>;
30
- type __VLS_WithSlots<T, S> = T & {
31
- new (): {
32
- $slots: S;
17
+ declare const __VLS_export: <TRecord extends ResourceRecord = LooseRecord>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
18
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<SimpleListItemProps<TRecord>> & (typeof globalThis extends {
19
+ __VLS_PROPS_FALLBACK: infer P;
20
+ } ? P : {});
21
+ expose: (exposed: {}) => void;
22
+ attrs: any;
23
+ slots: {
24
+ default?: (props: {}) => any;
25
+ } & {
26
+ default?: (props: {}) => any;
33
27
  };
28
+ emit: {};
29
+ }>) => import("vue").VNode & {
30
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
34
31
  };
32
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
33
+ [K in keyof T]: T[K];
34
+ } : {
35
+ [K in keyof T as K]: T[K];
36
+ }) & {};
@@ -1,9 +1,9 @@
1
1
  import { useResourceDefinition } from "../../../admin/resource-registry.js";
2
2
  import { cn } from "../../../lib/utils.js";
3
- import { RecordContextKey } from "../../../record/record-context.js";
3
+ import { provideRecordContext } from "../../../record/record-context.js";
4
4
  import { useResourceContext } from "../../../resource-context.js";
5
5
  import { useCreatePath } from "../../../router/nav-composables.js";
6
- import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, normalizeClass, openBlock, provide, ref, renderSlot, unref, watch, withCtx } from "vue";
6
+ import { computed, createBlock, createCommentVNode, createElementBlock, defineComponent, normalizeClass, openBlock, renderSlot, toRef, unref, withCtx } from "vue";
7
7
  import { RouterLink } from "vue-router";
8
8
  // src/components/admin/list/simple-list-item.vue?vue&type=script&setup=true&lang.ts
9
9
  var _hoisted_1 = ["data-row-index"];
@@ -27,11 +27,7 @@ var simple_list_item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
27
27
  * fields resolve it via `RecordContext`) and renders nothing without one.
28
28
  */
29
29
  const props = __props;
30
- const recordRef = ref(props.record);
31
- watch(() => props.record, (next) => {
32
- recordRef.value = next;
33
- });
34
- provide(RecordContextKey, recordRef);
30
+ provideRecordContext(toRef(props, "record"));
35
31
  const resource = useResourceContext(props);
36
32
  const createPath = useCreatePath();
37
33
  const definition = useResourceDefinition(() => ({ resource }));