@omnitend/dashboard-for-laravel 0.4.13 → 0.5.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.
@@ -0,0 +1,12 @@
1
+ declare var __VLS_7: string | number, __VLS_8: any;
2
+ type __VLS_Slots = {} & {
3
+ [K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
7
+ export default _default;
8
+ type __VLS_WithSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
@@ -1,36 +1,7 @@
1
- import type { UseFormReturn } from "../../composables/useForm";
2
- import type { FieldDefinition } from "../../types";
3
- interface Props {
4
- /** Form instance from useForm composable */
5
- form: UseFormReturn<any>;
6
- /** Field definitions */
7
- fields: FieldDefinition[];
8
- /** Submit button text */
9
- submitText?: string;
10
- /** Submit button loading text */
11
- submitLoadingText?: string;
12
- /** Show submit button */
13
- showSubmit?: boolean;
14
- }
15
- declare var __VLS_14: `field-${string}`, __VLS_15: {
16
- field: FieldDefinition;
17
- form: UseFormReturn<any>;
18
- }, __VLS_61: {};
19
- type __VLS_Slots = {} & {
20
- [K in NonNullable<typeof __VLS_14>]?: (props: typeof __VLS_15) => any;
21
- } & {
22
- footer?: (props: typeof __VLS_61) => any;
23
- };
24
- declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
25
- submit: () => any;
26
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
27
- onSubmit?: (() => any) | undefined;
28
- }>, {
29
- submitText: string;
30
- submitLoadingText: string;
31
- showSubmit: boolean;
32
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
1
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
2
+ [x: string]: ((props: any) => any) | undefined;
3
+ [x: number]: ((props: any) => any) | undefined;
4
+ }>;
34
5
  export default _default;
35
6
  type __VLS_WithSlots<T, S> = T & {
36
7
  new (): {
@@ -0,0 +1,88 @@
1
+ import type { UseFormReturn } from "../../composables/useForm";
2
+ import type { FieldDefinition } from "../../types";
3
+ interface Props {
4
+ /** Field definition to render */
5
+ field: FieldDefinition;
6
+ /** Form instance owning the field's data and errors */
7
+ form: UseFormReturn<any>;
8
+ /**
9
+ * Model passed to predicates (label/hint/when/disabled/readonly).
10
+ * Defaults to the live form data; a parent may widen it (e.g. a table
11
+ * merging the original row).
12
+ */
13
+ model?: any;
14
+ /** Dot path into form.data for the value (defaults to field.key). */
15
+ keyPath?: string;
16
+ /** Error key for validation lookups (defaults to keyPath/field.key). */
17
+ errorKey?: string;
18
+ }
19
+ declare function setValue(value: any): void;
20
+ declare var __VLS_1: {
21
+ field: FieldDefinition;
22
+ model: any;
23
+ value: any;
24
+ update: typeof setValue;
25
+ }, __VLS_3: {
26
+ field: FieldDefinition;
27
+ model: any;
28
+ value: any;
29
+ update: typeof setValue;
30
+ }, __VLS_11: {
31
+ field: FieldDefinition;
32
+ model: any;
33
+ }, __VLS_16: {
34
+ field: FieldDefinition;
35
+ model: any;
36
+ }, __VLS_28: {
37
+ row: any;
38
+ index: number;
39
+ fields: FieldDefinition[];
40
+ remove: () => void;
41
+ path: string;
42
+ }, __VLS_30: {
43
+ field: FieldDefinition;
44
+ model: any;
45
+ }, __VLS_35: {
46
+ field: FieldDefinition;
47
+ model: any;
48
+ }, __VLS_43: {
49
+ field: FieldDefinition;
50
+ model: any;
51
+ value: any;
52
+ update: typeof setValue;
53
+ }, __VLS_77: {
54
+ field: FieldDefinition;
55
+ model: any;
56
+ }, __VLS_82: {
57
+ field: FieldDefinition;
58
+ model: any;
59
+ };
60
+ type __VLS_Slots = {} & {
61
+ span?: (props: typeof __VLS_1) => any;
62
+ } & {
63
+ value?: (props: typeof __VLS_3) => any;
64
+ } & {
65
+ info?: (props: typeof __VLS_11) => any;
66
+ } & {
67
+ hint?: (props: typeof __VLS_16) => any;
68
+ } & {
69
+ 'repeater-row'?: (props: typeof __VLS_28) => any;
70
+ } & {
71
+ info?: (props: typeof __VLS_30) => any;
72
+ } & {
73
+ hint?: (props: typeof __VLS_35) => any;
74
+ } & {
75
+ value?: (props: typeof __VLS_43) => any;
76
+ } & {
77
+ info?: (props: typeof __VLS_77) => any;
78
+ } & {
79
+ hint?: (props: typeof __VLS_82) => any;
80
+ };
81
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
82
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
83
+ export default _default;
84
+ type __VLS_WithSlots<T, S> = T & {
85
+ new (): {
86
+ $slots: S;
87
+ };
88
+ };
@@ -1,26 +1,52 @@
1
+ import type { UseFormReturn } from "../../composables/useForm";
1
2
  import type { DefineFormReturn } from "../../composables/defineForm";
3
+ import type { FieldDefinition, FormTab } from "../../types";
2
4
  interface Props {
3
- /** Form object from defineForm */
4
- form: DefineFormReturn<any>;
5
+ /**
6
+ * Form instance — either a raw `useForm` return or a `defineForm`
7
+ * return (`{ form, fields }`). With the latter, `fields` may be
8
+ * omitted and is taken from the form object.
9
+ */
10
+ form: UseFormReturn<any> | DefineFormReturn<any>;
11
+ /** Field definitions (optional when `form` is a defineForm return). */
12
+ fields?: FieldDefinition[];
13
+ /** Tab definitions. When omitted, a flat single-column form renders. */
14
+ tabs?: FormTab[];
15
+ /**
16
+ * Extra context merged under the live form data when evaluating
17
+ * predicates (label/hint/when/disabled). E.g. a table passes the
18
+ * original row so predicates can read non-edited columns.
19
+ */
20
+ context?: Record<string, any>;
5
21
  /** Submit button text */
6
22
  submitText?: string;
7
23
  /** Submit button loading text */
8
24
  submitLoadingText?: string;
9
- /** Show submit button */
25
+ /** Show the submit button */
10
26
  showSubmit?: boolean;
27
+ /** Auto-switch to the first tab containing a validation error. */
28
+ autoErrorTab?: boolean;
11
29
  }
12
- declare var __VLS_10: string | number, __VLS_11: any;
13
- type __VLS_Slots = {} & {
14
- [K in NonNullable<typeof __VLS_10>]?: (props: typeof __VLS_11) => any;
30
+ type __VLS_Props = Props;
31
+ type __VLS_Slots = Record<string, (props: any) => any>;
32
+ declare function goToErrorTab(): void;
33
+ type __VLS_PublicProps = __VLS_Props & {
34
+ /** v-model for the active tab index. */
35
+ "activeTab"?: number;
15
36
  };
16
- declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {
38
+ goToErrorTab: typeof goToErrorTab;
39
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
17
40
  submit: () => any;
18
- }, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
41
+ "update:activeTab": (value: number) => any;
42
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
19
43
  onSubmit?: (() => any) | undefined;
44
+ "onUpdate:activeTab"?: ((value: number) => any) | undefined;
20
45
  }>, {
21
46
  submitText: string;
22
47
  submitLoadingText: string;
23
48
  showSubmit: boolean;
49
+ autoErrorTab: boolean;
24
50
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
51
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
26
52
  export default _default;
@@ -0,0 +1,30 @@
1
+ import type { UseFormReturn } from "../../composables/useForm";
2
+ import type { FieldDefinition } from "../../types";
3
+ interface Props {
4
+ /** Form instance owning the repeater array */
5
+ form: UseFormReturn<any>;
6
+ /** The repeater field definition (provides sub-fields, limits, labels) */
7
+ field: FieldDefinition;
8
+ /** Dot path into form.data for the array (defaults to field.key) */
9
+ keyPath?: string;
10
+ /** Model passed to predicates from the parent context */
11
+ model?: any;
12
+ }
13
+ declare var __VLS_1: {
14
+ row: any;
15
+ index: number;
16
+ fields: FieldDefinition[];
17
+ remove: () => void;
18
+ path: string;
19
+ };
20
+ type __VLS_Slots = {} & {
21
+ row?: (props: typeof __VLS_1) => any;
22
+ };
23
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
25
+ export default _default;
26
+ type __VLS_WithSlots<T, S> = T & {
27
+ new (): {
28
+ $slots: S;
29
+ };
30
+ };
@@ -110,6 +110,8 @@ export interface Props<TItem = any> {
110
110
  editUrl?: string;
111
111
  /** API endpoint pattern for deletions (e.g., "/api/products/:id") */
112
112
  deleteUrl?: string;
113
+ /** API endpoint for creating new items (e.g., "/api/products") — enables "New" button */
114
+ createUrl?: string;
113
115
  /** Enable client-side filtering, sorting, and pagination on items array */
114
116
  clientSide?: boolean;
115
117
  }
@@ -125,13 +127,15 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
125
127
  }) => any) | undefined;
126
128
  readonly onFilterChange?: ((filters: Record<string, string>) => any) | undefined;
127
129
  readonly onPerPageChange?: ((perPage: number) => any) | undefined;
130
+ readonly onRowCreated?: ((item: any, response: any) => any) | undefined;
131
+ readonly onCreateError?: ((error: any) => any) | undefined;
128
132
  readonly onRowUpdated?: ((item: T, response: any) => any) | undefined;
129
133
  readonly onEditError?: ((item: T, error: any) => any) | undefined;
130
134
  readonly onRowDeleted?: ((item: T, response: any) => any) | undefined;
131
135
  readonly onDeleteError?: ((item: T, error: any) => any) | undefined;
132
136
  readonly "onUpdate:filters"?: ((filters: Record<string, string>) => any) | undefined;
133
137
  readonly "onUpdate:perPage"?: ((perPage: number) => any) | undefined;
134
- } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:sortBy" | "onUpdate:busy" | "onRowClicked" | "onPageChange" | "onSortChange" | "onFilterChange" | "onPerPageChange" | "onRowUpdated" | "onEditError" | "onRowDeleted" | "onDeleteError" | "onUpdate:filters" | "onUpdate:perPage"> & Props<T> & Partial<{}>> & import("vue").PublicProps;
138
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:sortBy" | "onUpdate:busy" | "onRowClicked" | "onPageChange" | "onSortChange" | "onFilterChange" | "onPerPageChange" | "onRowCreated" | "onCreateError" | "onRowUpdated" | "onEditError" | "onRowDeleted" | "onDeleteError" | "onUpdate:filters" | "onUpdate:perPage"> & Props<T> & Partial<{}>> & import("vue").PublicProps;
135
139
  expose(exposed: import("vue").ShallowUnwrapRef<{
136
140
  refresh: () => void;
137
141
  }>): void;
@@ -143,40 +147,33 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
143
147
  } & {
144
148
  [x: string]: ((props: any) => any) | undefined;
145
149
  } & {
146
- [x: `tab-content(${string})`]: ((props: {
147
- item: import("@vue/reactivity").DistributeRef<[T | null] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & T, import("vue").Ref<import("vue").Ref<any, any> & T, import("vue").Ref<any, any> & T>, import("vue").Ref<any, any> & T> : import("vue").Ref<import("vue").UnwrapRef<T> | null, T | import("vue").UnwrapRef<T> | null>>;
148
- tab: EditTab;
149
- }) => any) | undefined;
150
- } & {
151
- [x: `tab-before(${string})`]: ((props: {
150
+ [x: `edit-value(${string})`]: ((props: {
152
151
  item: import("@vue/reactivity").DistributeRef<[T | null] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & T, import("vue").Ref<import("vue").Ref<any, any> & T, import("vue").Ref<any, any> & T>, import("vue").Ref<any, any> & T> : import("vue").Ref<import("vue").UnwrapRef<T> | null, T | import("vue").UnwrapRef<T> | null>>;
153
- tab: EditTab;
152
+ value: any;
153
+ update: any;
154
+ field: any;
154
155
  }) => any) | undefined;
155
156
  } & {
156
157
  [x: `edit-span(${string})`]: ((props: {
157
158
  item: import("@vue/reactivity").DistributeRef<[T | null] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & T, import("vue").Ref<import("vue").Ref<any, any> & T, import("vue").Ref<any, any> & T>, import("vue").Ref<any, any> & T> : import("vue").Ref<import("vue").UnwrapRef<T> | null, T | import("vue").UnwrapRef<T> | null>>;
158
159
  value: any;
159
- update: (v: any) => any;
160
+ update: any;
160
161
  close: () => void;
161
162
  }) => any) | undefined;
162
163
  } & {
163
- [x: `edit-value(${string})`]: ((props: {
164
+ [x: `tab-content(${string})`]: ((props: {
164
165
  item: import("@vue/reactivity").DistributeRef<[T | null] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & T, import("vue").Ref<import("vue").Ref<any, any> & T, import("vue").Ref<any, any> & T>, import("vue").Ref<any, any> & T> : import("vue").Ref<import("vue").UnwrapRef<T> | null, T | import("vue").UnwrapRef<T> | null>>;
165
- value: any;
166
- update: (v: any) => any;
167
- field: any;
166
+ tab: any;
168
167
  }) => any) | undefined;
169
168
  } & {
170
- [x: `edit-value(${string})`]: ((props: {
169
+ [x: `tab-before(${string})`]: ((props: {
171
170
  item: import("@vue/reactivity").DistributeRef<[T | null] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & T, import("vue").Ref<import("vue").Ref<any, any> & T, import("vue").Ref<any, any> & T>, import("vue").Ref<any, any> & T> : import("vue").Ref<import("vue").UnwrapRef<T> | null, T | import("vue").UnwrapRef<T> | null>>;
172
- value: any;
173
- update: (v: any) => any;
174
- field: any;
171
+ tab: any;
175
172
  }) => any) | undefined;
176
173
  } & {
177
174
  [x: `tab-after(${string})`]: ((props: {
178
175
  item: import("@vue/reactivity").DistributeRef<[T | null] extends [import("vue").Ref<any, any>] ? import("@vue/shared").IfAny<import("vue").Ref<any, any> & T, import("vue").Ref<import("vue").Ref<any, any> & T, import("vue").Ref<any, any> & T>, import("vue").Ref<any, any> & T> : import("vue").Ref<import("vue").UnwrapRef<T> | null, T | import("vue").UnwrapRef<T> | null>>;
179
- tab: EditTab;
176
+ tab: any;
180
177
  }) => any) | undefined;
181
178
  } & {
182
179
  header?: (props: {}) => any;
@@ -184,7 +181,7 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
184
181
  emit: ((evt: "update:sortBy", sortBy: BTableSortBy[]) => void) & ((evt: "update:busy", busy: boolean) => void) & ((evt: "rowClicked", item: T, index: number, event: MouseEvent) => void) & ((evt: "pageChange", page: number) => void) & ((evt: "sortChange", sort: {
185
182
  key: string;
186
183
  order: "asc" | "desc";
187
- }) => void) & ((evt: "filterChange", filters: Record<string, string>) => void) & ((evt: "perPageChange", perPage: number) => void) & ((evt: "rowUpdated", item: T, response: any) => void) & ((evt: "editError", item: T, error: any) => void) & ((evt: "rowDeleted", item: T, response: any) => void) & ((evt: "deleteError", item: T, error: any) => void) & ((evt: "update:filters", filters: Record<string, string>) => void) & ((evt: "update:perPage", perPage: number) => void);
184
+ }) => void) & ((evt: "filterChange", filters: Record<string, string>) => void) & ((evt: "perPageChange", perPage: number) => void) & ((evt: "rowCreated", item: any, response: any) => void) & ((evt: "createError", error: any) => void) & ((evt: "rowUpdated", item: T, response: any) => void) & ((evt: "editError", item: T, error: any) => void) & ((evt: "rowDeleted", item: T, response: any) => void) & ((evt: "deleteError", item: T, error: any) => void) & ((evt: "update:filters", filters: Record<string, string>) => void) & ((evt: "update:perPage", perPage: number) => void);
188
185
  }>) => import("vue").VNode & {
189
186
  __ctx?: Awaited<typeof __VLS_setup>;
190
187
  };