@omnitend/dashboard-for-laravel 0.32.0 → 0.33.1
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.
- package/dist/components/extended/DXCurrencyInput.vue.d.ts +27 -0
- package/dist/components/extended/DXField.vue.d.ts +30 -15
- package/dist/components/extended/DXTable.vue.d.ts +39 -5
- package/dist/composables/defineForm.d.ts +8 -2
- package/dist/dashboard-for-laravel.js +8503 -8351
- package/dist/dashboard-for-laravel.js.map +1 -1
- package/dist/dashboard-for-laravel.umd.cjs +7 -7
- package/dist/dashboard-for-laravel.umd.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +21 -9
- package/docs/public/api-reference.json +85 -5
- package/docs/public/docs-map.md +3 -2
- package/docs/public/llms.txt +3 -2
- package/package.json +1 -5
- package/resources/css/theme.scss +34 -0
- package/resources/js/components/extended/DXCurrencyInput.vue +143 -0
- package/resources/js/components/extended/DXDashboardSidebar.vue +21 -16
- package/resources/js/components/extended/DXField.vue +142 -71
- package/resources/js/components/extended/DXFormField.vue +1 -0
- package/resources/js/components/extended/DXTable.vue +164 -53
- package/resources/js/composables/defineForm.ts +12 -2
- package/resources/js/composables/useResourceEditor.ts +3 -5
- package/resources/js/index.ts +1 -0
- package/resources/js/types/index.ts +22 -8
- package/resources/js/utils/api.ts +13 -5
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** The numeric model. In `minorUnits` mode this is the integer minor-unit
|
|
3
|
+
* amount (e.g. pence); otherwise the major-unit amount. `null` = empty. */
|
|
4
|
+
modelValue?: number | null;
|
|
5
|
+
/** Symbol shown in the prepend (default "£"). */
|
|
6
|
+
currencySymbol?: string;
|
|
7
|
+
/** Minor-unit decimal places the display pads to (default 2; 0 for a
|
|
8
|
+
* currency with no minor unit, e.g. JPY). */
|
|
9
|
+
decimals?: number;
|
|
10
|
+
/** Model is stored in integer minor units (pence) but edited in major
|
|
11
|
+
* units (pounds). Scale is 10^decimals. */
|
|
12
|
+
minorUnits?: boolean;
|
|
13
|
+
/** Input step in MAJOR units (default: one minor unit, e.g. 0.01). */
|
|
14
|
+
step?: string | number;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: number | null) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
19
|
+
"onUpdate:modelValue"?: ((value: number | null) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
currencySymbol: string;
|
|
22
|
+
modelValue: number | null;
|
|
23
|
+
step: string | number;
|
|
24
|
+
decimals: number;
|
|
25
|
+
minorUnits: boolean;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UseFormReturn } from "../../composables/useForm";
|
|
2
|
-
import type { FieldDefinition, LabelCols } from "../../types";
|
|
2
|
+
import type { FieldDefinition, FieldOption, LabelCols } from "../../types";
|
|
3
3
|
interface Props {
|
|
4
4
|
/** Field definition to render */
|
|
5
5
|
field: FieldDefinition;
|
|
@@ -92,30 +92,39 @@ declare var __VLS_1: {
|
|
|
92
92
|
}, __VLS_98: {
|
|
93
93
|
field: FieldDefinition;
|
|
94
94
|
model: any;
|
|
95
|
-
},
|
|
95
|
+
}, __VLS_119: {
|
|
96
|
+
option: FieldOption;
|
|
97
|
+
on: boolean;
|
|
98
|
+
}, __VLS_124: {
|
|
99
|
+
field: FieldDefinition;
|
|
100
|
+
model: any;
|
|
101
|
+
}, __VLS_129: {
|
|
102
|
+
field: FieldDefinition;
|
|
103
|
+
model: any;
|
|
104
|
+
}, __VLS_144: {
|
|
96
105
|
row: any;
|
|
97
106
|
index: number;
|
|
98
107
|
fields: FieldDefinition[];
|
|
99
108
|
remove: () => void;
|
|
100
109
|
path: string;
|
|
101
|
-
},
|
|
110
|
+
}, __VLS_146: {
|
|
102
111
|
field: FieldDefinition;
|
|
103
112
|
model: any;
|
|
104
|
-
},
|
|
113
|
+
}, __VLS_151: {
|
|
105
114
|
field: FieldDefinition;
|
|
106
115
|
model: any;
|
|
107
|
-
},
|
|
116
|
+
}, __VLS_162: {
|
|
108
117
|
field: FieldDefinition;
|
|
109
118
|
model: any;
|
|
110
|
-
},
|
|
119
|
+
}, __VLS_164: {
|
|
111
120
|
field: FieldDefinition;
|
|
112
121
|
model: any;
|
|
113
122
|
value: any;
|
|
114
123
|
update: typeof setValue;
|
|
115
|
-
},
|
|
124
|
+
}, __VLS_230: {
|
|
116
125
|
field: FieldDefinition;
|
|
117
126
|
model: any;
|
|
118
|
-
},
|
|
127
|
+
}, __VLS_235: {
|
|
119
128
|
field: FieldDefinition;
|
|
120
129
|
model: any;
|
|
121
130
|
};
|
|
@@ -150,19 +159,25 @@ type __VLS_Slots = {} & {
|
|
|
150
159
|
} & {
|
|
151
160
|
hint?: (props: typeof __VLS_98) => any;
|
|
152
161
|
} & {
|
|
153
|
-
'
|
|
162
|
+
'switch-list-item'?: (props: typeof __VLS_119) => any;
|
|
163
|
+
} & {
|
|
164
|
+
info?: (props: typeof __VLS_124) => any;
|
|
165
|
+
} & {
|
|
166
|
+
hint?: (props: typeof __VLS_129) => any;
|
|
167
|
+
} & {
|
|
168
|
+
'repeater-row'?: (props: typeof __VLS_144) => any;
|
|
154
169
|
} & {
|
|
155
|
-
info?: (props: typeof
|
|
170
|
+
info?: (props: typeof __VLS_146) => any;
|
|
156
171
|
} & {
|
|
157
|
-
hint?: (props: typeof
|
|
172
|
+
hint?: (props: typeof __VLS_151) => any;
|
|
158
173
|
} & {
|
|
159
|
-
hint?: (props: typeof
|
|
174
|
+
hint?: (props: typeof __VLS_162) => any;
|
|
160
175
|
} & {
|
|
161
|
-
value?: (props: typeof
|
|
176
|
+
value?: (props: typeof __VLS_164) => any;
|
|
162
177
|
} & {
|
|
163
|
-
info?: (props: typeof
|
|
178
|
+
info?: (props: typeof __VLS_230) => any;
|
|
164
179
|
} & {
|
|
165
|
-
hint?: (props: typeof
|
|
180
|
+
hint?: (props: typeof __VLS_235) => any;
|
|
166
181
|
};
|
|
167
182
|
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>;
|
|
168
183
|
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
@@ -3,6 +3,25 @@ export interface FilterOption {
|
|
|
3
3
|
value: string;
|
|
4
4
|
text: string;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Adapts the built-in `apiUrl` provider's request/response to a backend whose
|
|
8
|
+
* convention differs from dfl's (spatie query-builder params, an envelope
|
|
9
|
+
* without the `{data, pagination}` shape). The sanctioned replacement for the
|
|
10
|
+
* axios-interceptor bridges #132 removed the route for: `request` maps the
|
|
11
|
+
* outgoing params (its return is what goes on the wire); `response` maps the
|
|
12
|
+
* body back, receiving the ORIGINAL dfl-shape params (`page`, `perPage`, …)
|
|
13
|
+
* so it can synthesize paginator metadata a foreign envelope lacks.
|
|
14
|
+
*/
|
|
15
|
+
export interface DXTableApiAdapter {
|
|
16
|
+
request?: (params: Record<string, any>) => Record<string, any>;
|
|
17
|
+
response?: (body: any, context: {
|
|
18
|
+
params: Record<string, any>;
|
|
19
|
+
}) => {
|
|
20
|
+
data: any[];
|
|
21
|
+
pagination?: PaginationData;
|
|
22
|
+
filterValues?: Record<string, string[]>;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
6
25
|
export interface TableField {
|
|
7
26
|
key: string;
|
|
8
27
|
label?: string;
|
|
@@ -15,6 +34,17 @@ export interface TableField {
|
|
|
15
34
|
* `#cell` slot.
|
|
16
35
|
*/
|
|
17
36
|
filterKey?: string;
|
|
37
|
+
/**
|
|
38
|
+
* For a `select` filter: allow SEVERAL values at once (#51). The filter
|
|
39
|
+
* renders as a multi-select typeahead, the filters map holds an ARRAY of
|
|
40
|
+
* the chosen option values, and the query string carries Laravel bracket
|
|
41
|
+
* notation (`filters[status][]=active&filters[status][]=pending`).
|
|
42
|
+
* Client-side, a row matches when its value equals ANY chosen value. An
|
|
43
|
+
* empty selection means "no filter". The "All …" reset row is omitted in
|
|
44
|
+
* this mode (removing the chips/✕ is the way back); `filterNullText`
|
|
45
|
+
* stays available as a choosable value.
|
|
46
|
+
*/
|
|
47
|
+
filterMultiple?: boolean;
|
|
18
48
|
/**
|
|
19
49
|
* For a `select` filter: adds an option meaning "has no value", e.g.
|
|
20
50
|
* `filterNullText: "Unassigned"` on an assignee column. Selecting it sends
|
|
@@ -98,12 +128,16 @@ export interface Props<TItem = any> {
|
|
|
98
128
|
provider?: BTableProvider<TItem>;
|
|
99
129
|
/** API endpoint URL for auto-provider mode (alternative to provider function) */
|
|
100
130
|
apiUrl?: string;
|
|
131
|
+
/** Adapts the built-in provider's request params / response body to a
|
|
132
|
+
* backend convention that differs from dfl's (see DXTableApiAdapter). */
|
|
133
|
+
apiAdapter?: DXTableApiAdapter;
|
|
101
134
|
/** Table field definitions */
|
|
102
135
|
fields: TableField[];
|
|
103
136
|
/** Sort configuration (v-model support) */
|
|
104
137
|
sortBy?: BTableSortBy[];
|
|
105
|
-
/** Filter values (v-model support) - key is field key, value is filter
|
|
106
|
-
|
|
138
|
+
/** Filter values (v-model support) - key is field key, value is the filter
|
|
139
|
+
* string, or an ARRAY of values for a `filterMultiple` column (#51). */
|
|
140
|
+
filters?: Record<string, string | string[]>;
|
|
107
141
|
/** Dynamic filter options from server - key is field key, value is array of values */
|
|
108
142
|
filterValues?: Record<string, string[]>;
|
|
109
143
|
/** Inertia route URL (if provided, handles navigation automatically) */
|
|
@@ -273,9 +307,9 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
|
273
307
|
key: string;
|
|
274
308
|
order: "asc" | "desc";
|
|
275
309
|
}) => any) | undefined;
|
|
276
|
-
readonly onFilterChange?: ((filters: Record<string, string>) => any) | undefined;
|
|
310
|
+
readonly onFilterChange?: ((filters: Record<string, string | string[]>) => any) | undefined;
|
|
277
311
|
readonly onPerPageChange?: ((perPage: number) => any) | undefined;
|
|
278
|
-
readonly "onUpdate:filters"?: ((filters: Record<string, string>) => any) | undefined;
|
|
312
|
+
readonly "onUpdate:filters"?: ((filters: Record<string, string | string[]>) => any) | undefined;
|
|
279
313
|
readonly "onUpdate:perPage"?: ((perPage: number) => any) | undefined;
|
|
280
314
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:sortBy" | "onUpdate:busy" | "onRowClicked" | "onUpdate:expandedItems" | "onRowCreated" | "onCreateError" | "onRowUpdated" | "onEditError" | "onRowDeleted" | "onDeleteError" | "onPageChange" | "onSortChange" | "onFilterChange" | "onPerPageChange" | "onUpdate:filters" | "onUpdate:perPage"> & Props<T> & Partial<{}>> & import("vue").PublicProps;
|
|
281
315
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
@@ -300,7 +334,7 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
|
300
334
|
emit: ((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:sortBy", sortBy: BTableSortBy[]) => void) & ((evt: "update:busy", busy: boolean) => void) & ((evt: "rowClicked", item: T, index: number, event: MouseEvent) => void) & ((evt: "update:expandedItems", items: T[]) => void) & ((evt: "pageChange", page: number) => void) & ((evt: "sortChange", sort: {
|
|
301
335
|
key: string;
|
|
302
336
|
order: "asc" | "desc";
|
|
303
|
-
}) => void) & ((evt: "filterChange", filters: Record<string, string>) => void) & ((evt: "perPageChange", perPage: number) => void) & ((evt: "update:filters", filters: Record<string, string>) => void) & ((evt: "update:perPage", perPage: number) => void);
|
|
337
|
+
}) => void) & ((evt: "filterChange", filters: Record<string, string | string[]>) => void) & ((evt: "perPageChange", perPage: number) => void) & ((evt: "update:filters", filters: Record<string, string | string[]>) => void) & ((evt: "update:perPage", perPage: number) => void);
|
|
304
338
|
}>) => import("vue").VNode & {
|
|
305
339
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
306
340
|
};
|
|
@@ -4,8 +4,14 @@ import type { FieldDefinition } from "../types";
|
|
|
4
4
|
* Extended field definition that includes default value
|
|
5
5
|
*/
|
|
6
6
|
export interface FormFieldDefinition<TValue = any> extends FieldDefinition {
|
|
7
|
-
/**
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Default/initial value for the field. Optional: when omitted, the field
|
|
9
|
+
* seeds from its type (`false` for checkbox/switch, `[]` for
|
|
10
|
+
* checkbox-group/switch-list/repeater, `0` for numerics, `""` otherwise) —
|
|
11
|
+
* previously the type required this even though the runtime had a
|
|
12
|
+
* fallback, so typed consumers could never use it.
|
|
13
|
+
*/
|
|
14
|
+
default?: TValue;
|
|
9
15
|
}
|
|
10
16
|
/**
|
|
11
17
|
* Infer data type from field definitions
|