@modufolio/panel 0.1.0 → 0.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 (73) hide show
  1. package/README.md +1 -1
  2. package/dist/Builder/dragHandle.d.ts +10 -0
  3. package/dist/Builder/schema.d.ts +1 -1
  4. package/dist/Components/Actions/Action.vue.d.ts +1 -1
  5. package/dist/Components/Columns/CellActions.vue.d.ts +7 -7
  6. package/dist/Components/Columns/SelectColumn.vue.d.ts +8 -2
  7. package/dist/Components/Core/Button.vue.d.ts +2 -2
  8. package/dist/Components/Core/FlashMessages.vue.d.ts +6 -1
  9. package/dist/Components/Core/SelectInput.vue.d.ts +1 -1
  10. package/dist/Components/Core/TextInput.vue.d.ts +1 -1
  11. package/dist/Components/Dialogs/Dialog.vue.d.ts +1 -1
  12. package/dist/Components/Drawer/Drawer.vue.d.ts +1 -1
  13. package/dist/Components/Drawer/DrawerLink.vue.d.ts +4 -3
  14. package/dist/Components/Drawer/DrawerRelationList.vue.d.ts +12 -10
  15. package/dist/Components/Drawer/DrawerStack.vue.d.ts +14 -14
  16. package/dist/Components/Drawer/useDrawerDirtyGuard.d.ts +17 -0
  17. package/dist/Components/Drawer/useDrawerStack.d.ts +1 -1
  18. package/dist/Components/Drawer/useIsDrawer.d.ts +8 -0
  19. package/dist/Components/Fields/BelongsToSelect.vue.d.ts +14 -9
  20. package/dist/Components/Fields/CheckboxField.vue.d.ts +2 -2
  21. package/dist/Components/Fields/ColorPickerField.vue.d.ts +3 -3
  22. package/dist/Components/Fields/DataField.vue.d.ts +55 -0
  23. package/dist/Components/Fields/DatePickerField.vue.d.ts +2 -2
  24. package/dist/Components/Fields/DateRangePickerField.vue.d.ts +2 -2
  25. package/dist/Components/Fields/DateTimePickerField.vue.d.ts +2 -2
  26. package/dist/Components/Fields/EmbedField.vue.d.ts +95 -0
  27. package/dist/Components/Fields/FieldDescription.vue.d.ts +25 -0
  28. package/dist/Components/Fields/FieldLabel.vue.d.ts +67 -0
  29. package/dist/Components/Fields/FieldMessage.vue.d.ts +25 -0
  30. package/dist/Components/Fields/FieldPrimitive.vue.d.ts +127 -0
  31. package/dist/Components/Fields/FileUploadField.vue.d.ts +2 -2
  32. package/dist/Components/Fields/HiddenField.vue.d.ts +28 -0
  33. package/dist/Components/Fields/MultiSelectField.vue.d.ts +3 -3
  34. package/dist/Components/Fields/ProseMirrorBuilderField.vue.d.ts +1 -1
  35. package/dist/Components/Fields/RangeField.vue.d.ts +2 -2
  36. package/dist/Components/Fields/RepeaterField.vue.d.ts +29 -15
  37. package/dist/Components/Fields/RichTextEditorField.vue.d.ts +3 -3
  38. package/dist/Components/Fields/SelectField.vue.d.ts +6 -5
  39. package/dist/Components/Fields/SetField.vue.d.ts +77 -0
  40. package/dist/Components/Fields/TagsField.vue.d.ts +3 -3
  41. package/dist/Components/Fields/TextField.vue.d.ts +4 -4
  42. package/dist/Components/Fields/TextareaField.vue.d.ts +3 -3
  43. package/dist/Components/Fields/TimePickerField.vue.d.ts +2 -2
  44. package/dist/Components/Fields/ToggleButtonsField.vue.d.ts +10 -5
  45. package/dist/Components/Fields/ToggleField.vue.d.ts +2 -2
  46. package/dist/Components/Fields/fieldsFromSpec.d.ts +10 -2
  47. package/dist/Components/Fields/useBlueprint.d.ts +4 -0
  48. package/dist/Components/Filters/DateRangeFilter.vue.d.ts +1 -1
  49. package/dist/Components/Filters/MultiSelectFilter.vue.d.ts +2 -2
  50. package/dist/Components/Filters/NumberFilter.vue.d.ts +1 -1
  51. package/dist/Components/Filters/SelectFilter.vue.d.ts +2 -2
  52. package/dist/Components/Filters/TernaryFilter.vue.d.ts +1 -1
  53. package/dist/Components/Layout/AppLayout.vue.d.ts +5 -3
  54. package/dist/Components/Layout/Breadcrumbs.vue.d.ts +2 -2
  55. package/dist/Components/Layout/Sidebar.vue.d.ts +22 -3
  56. package/dist/Components/Relations/RelationManager.vue.d.ts +4 -3
  57. package/dist/Components/Table/ExportButton.vue.d.ts +3 -3
  58. package/dist/Components/Table/SchemaCell.d.ts +7 -7
  59. package/dist/Components/Table/SchemaTable.vue.d.ts +21 -20
  60. package/dist/Components/Table/schemaLinks.d.ts +11 -3
  61. package/dist/Components/Table/tableSchema.d.ts +28 -11
  62. package/dist/Components/Table/tableTypes.d.ts +14 -1
  63. package/dist/Components/Table/useSchemaActions.d.ts +9 -26
  64. package/dist/Composables/useDeleteConfirmation.d.ts +11 -31
  65. package/dist/Composables/useNestedDrawerForm.d.ts +7 -0
  66. package/dist/index.css +1 -1
  67. package/dist/index.d.ts +6 -1
  68. package/dist/index.js +9951 -9770
  69. package/dist/index.js.map +1 -1
  70. package/docs/custom-fields.md +54 -2
  71. package/docs/drawer-protocol.md +27 -1
  72. package/docs/table-schema.md +5 -0
  73. package/package.json +2 -2
@@ -120,19 +120,19 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
120
120
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
121
121
  }>, {
122
122
  required: boolean;
123
- modelValue: string | number;
124
123
  id: string;
125
- label: string;
126
124
  type: string;
127
- placeholder: string;
125
+ label: string;
128
126
  help: string;
129
127
  error: string;
128
+ width: string;
129
+ modelValue: string | number;
130
+ placeholder: string;
130
131
  prefix: string | Record<string, any>;
131
132
  suffix: string | Record<string, any>;
132
133
  disabled: boolean;
133
134
  readonly: boolean;
134
135
  autocomplete: string;
135
- width: string;
136
136
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
137
137
  declare const _default: typeof __VLS_export;
138
138
  export default _default;
@@ -96,15 +96,15 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
96
96
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
97
97
  }>, {
98
98
  required: boolean;
99
- modelValue: string | number;
100
99
  id: string;
101
100
  label: string;
102
- placeholder: string;
103
101
  help: string;
104
102
  error: string;
103
+ width: string;
104
+ modelValue: string | number;
105
+ placeholder: string;
105
106
  disabled: boolean;
106
107
  readonly: boolean;
107
- width: string;
108
108
  rows: number;
109
109
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
110
110
  declare const _default: typeof __VLS_export;
@@ -102,13 +102,13 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
102
102
  required: boolean;
103
103
  min: string;
104
104
  max: string;
105
- modelValue: string;
106
105
  id: string;
107
106
  label: string;
108
107
  help: string;
109
108
  error: string;
110
- disabled: boolean;
111
109
  width: string;
110
+ modelValue: string;
111
+ disabled: boolean;
112
112
  step: number;
113
113
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
114
114
  declare const _default: typeof __VLS_export;
@@ -1,4 +1,9 @@
1
- import { PropType } from 'vue';
1
+ import { Component, PropType } from 'vue';
2
+ import { OptionItem } from './useBlueprint';
3
+ /** A blueprint option that may also carry an icon to render before its label. */
4
+ interface ToggleButtonOption extends OptionItem {
5
+ icon?: Component | string | null;
6
+ }
2
7
  declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
8
  modelValue: {
4
9
  type: (StringConstructor | NumberConstructor | BooleanConstructor)[];
@@ -9,7 +14,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
9
14
  default: string;
10
15
  };
11
16
  options: {
12
- type: PropType<any[]>;
17
+ type: PropType<Array<ToggleButtonOption | string | number>>;
13
18
  required: true;
14
19
  };
15
20
  help: {
@@ -49,7 +54,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
49
54
  default: string;
50
55
  };
51
56
  options: {
52
- type: PropType<any[]>;
57
+ type: PropType<Array<ToggleButtonOption | string | number>>;
53
58
  required: true;
54
59
  };
55
60
  help: {
@@ -81,12 +86,12 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
81
86
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
82
87
  }>, {
83
88
  required: boolean;
84
- modelValue: string | number | boolean;
85
89
  label: string;
86
90
  help: string;
87
91
  error: string;
88
- disabled: boolean;
89
92
  width: string;
93
+ modelValue: string | number | boolean;
94
+ disabled: boolean;
90
95
  colors: Record<string, string>;
91
96
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
92
97
  declare const _default: typeof __VLS_export;
@@ -81,13 +81,13 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
81
81
  }>> & Readonly<{
82
82
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
83
83
  }>, {
84
- modelValue: boolean;
85
84
  id: string;
86
85
  label: string;
87
86
  help: string;
88
87
  error: string;
89
- disabled: boolean;
90
88
  width: string;
89
+ modelValue: boolean;
90
+ disabled: boolean;
91
91
  color: string;
92
92
  description: string;
93
93
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,5 +1,13 @@
1
1
  import { FieldDef } from './useBlueprint';
2
- export declare function fieldsFromSpec(fields: any[]): FieldDef[];
2
+ /**
3
+ * A field as `PanelResource::formFields()` serializes it: a {@link FieldDef}
4
+ * whose `rules` are still the PHP map, plus the starting value it declares.
5
+ */
6
+ export interface FieldSpec extends Omit<FieldDef, 'rules'> {
7
+ rules?: Record<string, unknown>;
8
+ default?: unknown;
9
+ }
10
+ export declare function fieldsFromSpec(fields: FieldSpec[]): FieldDef[];
3
11
  /**
4
12
  * Starting values for a set of declared fields.
5
13
  *
@@ -7,4 +15,4 @@ export declare function fieldsFromSpec(fields: any[]): FieldDef[];
7
15
  * (`[...modelValue]`, `v-for`), and an explicit null overrides a prop default,
8
16
  * so null does not degrade gracefully — it throws.
9
17
  */
10
- export declare function initialValues(fields: any[], record?: Record<string, any> | null): Record<string, unknown>;
18
+ export declare function initialValues(fields: Array<Pick<FieldSpec, 'key' | 'type' | 'default'>>, record?: Record<string, unknown> | null): Record<string, unknown>;
@@ -38,6 +38,8 @@ export interface FieldDef {
38
38
  props?: Record<string, unknown>;
39
39
  /** Conditional visibility — the field is hidden when this evaluates false */
40
40
  when?: Condition;
41
+ /** Conditionally required — same shape as `when`, server-mirrored. */
42
+ requiredWhen?: Condition;
41
43
  /** Client-side validation, evaluated in order; the first failure is shown */
42
44
  rules?: ValidationRule[];
43
45
  /** Sub-field declarations, for container types such as `repeater` */
@@ -62,6 +64,8 @@ export type Condition = ((form: Record<string, unknown>) => boolean) | Condition
62
64
  all: Condition[];
63
65
  } | {
64
66
  any: Condition[];
67
+ } | {
68
+ not: Condition;
65
69
  };
66
70
  /** Evaluate a condition against the current form values. */
67
71
  export declare function evaluateCondition(condition: Condition, form: Record<string, unknown>): boolean;
@@ -83,8 +83,8 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
83
83
  }>, {
84
84
  min: string;
85
85
  max: string;
86
- modelValue: Record<string, any>;
87
86
  label: string;
87
+ modelValue: Record<string, any>;
88
88
  showPresets: boolean;
89
89
  presets: DatePreset[];
90
90
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,6 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  interface FilterOption {
3
- value: any;
3
+ value: string | number;
4
4
  label: string;
5
5
  count?: number;
6
6
  }
@@ -43,8 +43,8 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
43
43
  }>> & Readonly<{
44
44
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
45
45
  }>, {
46
- modelValue: unknown[];
47
46
  label: string;
47
+ modelValue: unknown[];
48
48
  searchable: boolean;
49
49
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
50
50
  declare const _default: typeof __VLS_export;
@@ -53,8 +53,8 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
53
53
  }>, {
54
54
  min: number;
55
55
  max: number;
56
- modelValue: Record<string, any>;
57
56
  label: string;
57
+ modelValue: Record<string, any>;
58
58
  step: number;
59
59
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
60
60
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  interface FilterOption {
3
- value: any;
3
+ value: string | number;
4
4
  label: string;
5
5
  }
6
6
  declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
@@ -52,8 +52,8 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
52
52
  }>> & Readonly<{
53
53
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
54
54
  }>, {
55
- modelValue: string | number;
56
55
  label: string;
56
+ modelValue: string | number;
57
57
  placeholder: string;
58
58
  optionsTruncated: boolean;
59
59
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -61,8 +61,8 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
61
61
  }>> & Readonly<{
62
62
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
63
63
  }>, {
64
- modelValue: string | number | boolean | null;
65
64
  label: string;
65
+ modelValue: string | number | boolean | null;
66
66
  placeholder: string;
67
67
  trueLabel: string;
68
68
  falseLabel: string;
@@ -1,4 +1,6 @@
1
1
  import { MenuItem } from '../../types/menu';
2
+ import { PropType } from 'vue';
3
+ import { SidebarEntry } from './Sidebar.vue';
2
4
  declare var __VLS_34: {}, __VLS_37: {}, __VLS_39: {}, __VLS_41: {}, __VLS_43: {};
3
5
  type __VLS_Slots = {} & {
4
6
  breadcrumbs?: (props: typeof __VLS_34) => any;
@@ -13,7 +15,7 @@ type __VLS_Slots = {} & {
13
15
  };
14
16
  declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
15
17
  navigationItems: {
16
- type: ArrayConstructor;
18
+ type: PropType<SidebarEntry[]>;
17
19
  default: () => never[];
18
20
  };
19
21
  userName: {
@@ -65,7 +67,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
65
67
  "open-notifications": (...args: any[]) => void;
66
68
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
67
69
  navigationItems: {
68
- type: ArrayConstructor;
70
+ type: PropType<SidebarEntry[]>;
69
71
  default: () => never[];
70
72
  };
71
73
  userName: {
@@ -123,7 +125,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
123
125
  showNotifications: boolean;
124
126
  notificationCount: number;
125
127
  impersonation: Record<string, any>;
126
- navigationItems: unknown[];
128
+ navigationItems: SidebarEntry[];
127
129
  userMenuItems: MenuItem[];
128
130
  initialSidebarCollapsed: boolean;
129
131
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,7 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
3
  items: {
4
- type: PropType<any[]>;
4
+ type: PropType<unknown[]>;
5
5
  required: true;
6
6
  validator: (items: unknown) => boolean;
7
7
  };
@@ -19,7 +19,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
19
19
  };
20
20
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
21
21
  items: {
22
- type: PropType<any[]>;
22
+ type: PropType<unknown[]>;
23
23
  required: true;
24
24
  validator: (items: unknown) => boolean;
25
25
  };
@@ -1,4 +1,23 @@
1
1
  import { PropType } from 'vue';
2
+ /** A submenu link; shown without an icon when it has none. */
3
+ export interface SidebarChildItem {
4
+ label: string;
5
+ href: string;
6
+ icon?: string;
7
+ }
8
+ /** A top-level navigation link, optionally carrying a submenu. */
9
+ export interface SidebarItem extends SidebarChildItem {
10
+ /** Always drawn — it is all that remains of the item when the sidebar is collapsed. */
11
+ icon: string;
12
+ badge?: string | number;
13
+ badgeColor?: 'primary' | 'success' | 'danger' | 'warning';
14
+ children?: SidebarChildItem[];
15
+ }
16
+ /** A heading; the items that follow it belong to that group until the next one. */
17
+ export interface SidebarGroupHeading {
18
+ group: string;
19
+ }
20
+ export type SidebarEntry = SidebarItem | SidebarGroupHeading;
2
21
  declare var __VLS_7: {
3
22
  collapsed: boolean;
4
23
  };
@@ -7,7 +26,7 @@ type __VLS_Slots = {} & {
7
26
  };
8
27
  declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
9
28
  items: {
10
- type: PropType<any[]>;
29
+ type: PropType<SidebarEntry[]>;
11
30
  default: () => never[];
12
31
  };
13
32
  collapsed: {
@@ -26,7 +45,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
26
45
  "update:collapsed": (...args: any[]) => void;
27
46
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
28
47
  items: {
29
- type: PropType<any[]>;
48
+ type: PropType<SidebarEntry[]>;
30
49
  default: () => never[];
31
50
  };
32
51
  collapsed: {
@@ -45,7 +64,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
45
64
  "onUpdate:collapsed"?: ((...args: any[]) => any) | undefined;
46
65
  }>, {
47
66
  width: string;
48
- items: any[];
67
+ items: SidebarEntry[];
49
68
  collapsed: boolean;
50
69
  collapsedWidth: string;
51
70
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -1,8 +1,9 @@
1
1
  import { PropType } from 'vue';
2
+ import { TableColumn, TableRecord } from '../Table/tableTypes';
2
3
  declare var __VLS_1: {
3
4
  refresh: () => Promise<void>;
4
5
  }, __VLS_32: string, __VLS_33: any, __VLS_69: {
5
- record: import('../Table/tableTypes').TableRecord;
6
+ record: TableRecord;
6
7
  };
7
8
  type __VLS_Slots = {} & {
8
9
  [K in NonNullable<typeof __VLS_32>]?: (props: typeof __VLS_33) => any;
@@ -44,7 +45,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
44
45
  * Table configuration
45
46
  */
46
47
  columns: {
47
- type: PropType<any[]>;
48
+ type: PropType<TableColumn[]>;
48
49
  required: true;
49
50
  };
50
51
  searchable: {
@@ -143,7 +144,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
143
144
  * Table configuration
144
145
  */
145
146
  columns: {
146
- type: PropType<any[]>;
147
+ type: PropType<TableColumn[]>;
147
148
  required: true;
148
149
  };
149
150
  searchable: {
@@ -34,7 +34,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
34
34
  default: string;
35
35
  };
36
36
  selectedRecords: {
37
- type: ArrayConstructor;
37
+ type: PropType<Record<string, unknown>[]>;
38
38
  default: () => never[];
39
39
  };
40
40
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
@@ -74,7 +74,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
74
74
  default: string;
75
75
  };
76
76
  selectedRecords: {
77
- type: ArrayConstructor;
77
+ type: PropType<Record<string, unknown>[]>;
78
78
  default: () => never[];
79
79
  };
80
80
  }>> & Readonly<{
@@ -83,7 +83,7 @@ declare const __VLS_export: import('vue').DefineComponent<import('vue').ExtractP
83
83
  }>, {
84
84
  label: string;
85
85
  disabled: boolean;
86
- selectedRecords: unknown[];
86
+ selectedRecords: Record<string, unknown>[];
87
87
  filename: string;
88
88
  showPrint: boolean;
89
89
  availableFormats: unknown[];
@@ -1,6 +1,6 @@
1
1
  import { PropType } from 'vue';
2
- import { SchemaColumn } from './tableSchema';
3
- type CellHandler = ((record: any, column: string, value: any) => unknown) | undefined;
2
+ import { SchemaColumn, CellHandler } from './tableSchema';
3
+ import { TableRecord } from './tableTypes';
4
4
  /**
5
5
  * Renders one cell from its column definition.
6
6
  *
@@ -13,7 +13,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
13
13
  required: true;
14
14
  };
15
15
  record: {
16
- type: PropType<Record<string, any>>;
16
+ type: PropType<TableRecord>;
17
17
  required: true;
18
18
  };
19
19
  value: {
@@ -21,7 +21,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
21
21
  default: undefined;
22
22
  };
23
23
  handler: {
24
- type: PropType<CellHandler>;
24
+ type: PropType<CellHandler | undefined>;
25
25
  default: undefined;
26
26
  };
27
27
  }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
@@ -32,7 +32,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
32
32
  required: true;
33
33
  };
34
34
  record: {
35
- type: PropType<Record<string, any>>;
35
+ type: PropType<TableRecord>;
36
36
  required: true;
37
37
  };
38
38
  value: {
@@ -40,11 +40,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
40
40
  default: undefined;
41
41
  };
42
42
  handler: {
43
- type: PropType<CellHandler>;
43
+ type: PropType<CellHandler | undefined>;
44
44
  default: undefined;
45
45
  };
46
46
  }>> & Readonly<{}>, {
47
47
  value: any;
48
- handler: CellHandler;
48
+ handler: ((record: TableRecord, column: string, value: unknown) => unknown) | undefined;
49
49
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
50
50
  export default _default;
@@ -1,6 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  import { StackItem } from '../Drawer/useDrawerStack';
3
- import { SchemaColumnAction, SchemaRowAction, SchemaBulkAction, TableSchema } from './tableSchema';
3
+ import { TableSchema, CellHandler, CellActionHandler, RowActionHandler, BulkActionHandler } from './tableSchema';
4
+ import { TableRecord } from './tableTypes';
4
5
  declare var __VLS_13: string, __VLS_14: any;
5
6
  type __VLS_Slots = {} & {
6
7
  [K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any;
@@ -12,7 +13,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
12
13
  required: true;
13
14
  };
14
15
  records: {
15
- type: PropType<Record<string, any>[]>;
16
+ type: PropType<TableRecord[]>;
16
17
  default: () => never[];
17
18
  };
18
19
  search: {
@@ -33,7 +34,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
33
34
  };
34
35
  /** Appended to record links so a drawer preserves the current list state. */
35
36
  queryParams: {
36
- type: PropType<Record<string, any>>;
37
+ type: PropType<Record<string, unknown>>;
37
38
  default: () => {};
38
39
  };
39
40
  /** Null means "use the schema's toggleable defaults". */
@@ -43,12 +44,12 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
43
44
  };
44
45
  /** Handlers for row actions the schema declares but the table cannot service. */
45
46
  rowActionHandlers: {
46
- type: PropType<Record<string, (record: any, action: SchemaRowAction) => unknown>>;
47
+ type: PropType<Record<string, RowActionHandler>>;
47
48
  default: () => {};
48
49
  };
49
50
  /** The same, for bulk actions. */
50
51
  bulkActionHandlers: {
51
- type: PropType<Record<string, (records: any[], action: SchemaBulkAction) => unknown>>;
52
+ type: PropType<Record<string, BulkActionHandler>>;
52
53
  default: () => {};
53
54
  };
54
55
  externalFocusedRowIndex: {
@@ -77,7 +78,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
77
78
  * into an Inertia prop. The page injects that behaviour here.
78
79
  */
79
80
  cellHandlers: {
80
- type: PropType<Record<string, (record: any, column: string, value: any) => unknown>>;
81
+ type: PropType<Record<string, CellHandler>>;
81
82
  default: () => {};
82
83
  };
83
84
  /**
@@ -88,7 +89,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
88
89
  * Actions that navigate declare a `urlTemplate` instead and need no entry.
89
90
  */
90
91
  cellActionHandlers: {
91
- type: PropType<Record<string, (record: any, action: SchemaColumnAction) => unknown>>;
92
+ type: PropType<Record<string, CellActionHandler>>;
92
93
  default: () => {};
93
94
  };
94
95
  /** Current filter form values, keyed by filter key. */
@@ -121,7 +122,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
121
122
  required: true;
122
123
  };
123
124
  records: {
124
- type: PropType<Record<string, any>[]>;
125
+ type: PropType<TableRecord[]>;
125
126
  default: () => never[];
126
127
  };
127
128
  search: {
@@ -142,7 +143,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
142
143
  };
143
144
  /** Appended to record links so a drawer preserves the current list state. */
144
145
  queryParams: {
145
- type: PropType<Record<string, any>>;
146
+ type: PropType<Record<string, unknown>>;
146
147
  default: () => {};
147
148
  };
148
149
  /** Null means "use the schema's toggleable defaults". */
@@ -152,12 +153,12 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
152
153
  };
153
154
  /** Handlers for row actions the schema declares but the table cannot service. */
154
155
  rowActionHandlers: {
155
- type: PropType<Record<string, (record: any, action: SchemaRowAction) => unknown>>;
156
+ type: PropType<Record<string, RowActionHandler>>;
156
157
  default: () => {};
157
158
  };
158
159
  /** The same, for bulk actions. */
159
160
  bulkActionHandlers: {
160
- type: PropType<Record<string, (records: any[], action: SchemaBulkAction) => unknown>>;
161
+ type: PropType<Record<string, BulkActionHandler>>;
161
162
  default: () => {};
162
163
  };
163
164
  externalFocusedRowIndex: {
@@ -186,7 +187,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
186
187
  * into an Inertia prop. The page injects that behaviour here.
187
188
  */
188
189
  cellHandlers: {
189
- type: PropType<Record<string, (record: any, column: string, value: any) => unknown>>;
190
+ type: PropType<Record<string, CellHandler>>;
190
191
  default: () => {};
191
192
  };
192
193
  /**
@@ -197,7 +198,7 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
197
198
  * Actions that navigate declare a `urlTemplate` instead and need no entry.
198
199
  */
199
200
  cellActionHandlers: {
200
- type: PropType<Record<string, (record: any, action: SchemaColumnAction) => unknown>>;
201
+ type: PropType<Record<string, CellActionHandler>>;
201
202
  default: () => {};
202
203
  };
203
204
  /** Current filter form values, keyed by filter key. */
@@ -226,18 +227,18 @@ declare const __VLS_base: import('vue').DefineComponent<import('vue').ExtractPro
226
227
  }>, {
227
228
  search: string;
228
229
  loading: boolean;
230
+ stack: StackItem[];
229
231
  sortColumn: string;
230
232
  sortDirection: string;
231
- records: Record<string, any>[];
233
+ records: TableRecord[];
232
234
  visibleColumns: string[] | null;
233
235
  externalFocusedRowIndex: number;
234
- stack: StackItem[];
235
- queryParams: Record<string, any>;
236
- rowActionHandlers: Record<string, (record: any, action: SchemaRowAction) => unknown>;
237
- bulkActionHandlers: Record<string, (records: any[], action: SchemaBulkAction) => unknown>;
236
+ queryParams: Record<string, unknown>;
237
+ rowActionHandlers: Record<string, (record: TableRecord, action: import('./tableSchema').SchemaRowAction) => unknown>;
238
+ bulkActionHandlers: Record<string, (records: TableRecord[], action: import('./tableSchema').SchemaBulkAction) => unknown>;
238
239
  drawerType: string;
239
- cellHandlers: Record<string, (record: any, column: string, value: any) => unknown>;
240
- cellActionHandlers: Record<string, (record: any, action: SchemaColumnAction) => unknown>;
240
+ cellHandlers: Record<string, (record: TableRecord, column: string, value: unknown) => unknown>;
241
+ cellActionHandlers: Record<string, (record: TableRecord, action: import('./tableSchema').SchemaColumnAction) => unknown>;
241
242
  filterValues: Record<string, unknown>;
242
243
  summaries: Record<string, {
243
244
  type: string;
@@ -1,4 +1,12 @@
1
1
  import { SchemaColumn } from './tableSchema';
2
+ import { TableRecord } from './tableTypes';
3
+ /** The DrawerLink props a linked cell binds; empty for a cell that is not a link. */
4
+ export interface CellLinkProps {
5
+ href?: string;
6
+ queryParams?: Record<string, unknown>;
7
+ color?: string;
8
+ showArrow?: boolean;
9
+ }
2
10
  /**
3
11
  * The cell's displayed value, honouring `valueKey` so a column can render a
4
12
  * nested field while staying keyed on its own name.
@@ -6,11 +14,11 @@ import { SchemaColumn } from './tableSchema';
6
14
  * Resolved here rather than using Table.vue's `value` slot prop, which always
7
15
  * reads the bare column key — that returns the relation object, not its name.
8
16
  */
9
- export declare function cellValue(column: SchemaColumn, record: Record<string, any>): unknown;
17
+ export declare function cellValue(column: SchemaColumn, record: TableRecord): unknown;
10
18
  /** Where a cell links to, or null when it renders as plain content. */
11
- export declare function cellLink(column: SchemaColumn, record: Record<string, any>, recordUrl: string | null | undefined): string | null;
19
+ export declare function cellLink(column: SchemaColumn, record: TableRecord, recordUrl: string | null | undefined): string | null;
12
20
  /**
13
21
  * A drill-down into a *related* record gets the accented style with an arrow;
14
22
  * a link to the row's own drawer stays muted and inline.
15
23
  */
16
- export declare function cellLinkProps(column: SchemaColumn, record: Record<string, any>, recordUrl: string | null | undefined, queryParams: Record<string, any>): Record<string, any>;
24
+ export declare function cellLinkProps(column: SchemaColumn, record: TableRecord, recordUrl: string | null | undefined, queryParams: Record<string, unknown>): CellLinkProps;