@omnitend/dashboard-for-laravel 0.47.0 → 0.47.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/DXField.vue.d.ts +12 -3
- package/dist/components/extended/DXFormErrorSummary.vue.d.ts +8 -0
- package/dist/composables/useForm.d.ts +22 -0
- package/dist/dashboard-for-laravel.js +6031 -5973
- package/dist/dashboard-for-laravel.js.map +1 -1
- package/dist/dashboard-for-laravel.umd.cjs +6 -6
- package/dist/dashboard-for-laravel.umd.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +9 -5
- package/dist/utils/formErrorTargets.d.ts +21 -11
- package/docs/public/api-reference.json +5 -5
- package/docs/public/docs-map.md +1 -1
- package/package.json +1 -1
- package/resources/js/components/extended/DXField.vue +29 -6
- package/resources/js/components/extended/DXForm.vue +17 -5
- package/resources/js/components/extended/DXFormErrorSummary.vue +12 -0
- package/resources/js/components/extended/DXTableEditorModal.vue +2 -2
- package/resources/js/composables/useForm.ts +68 -0
- package/resources/js/index.ts +1 -0
- package/resources/js/types/index.ts +9 -5
- package/resources/js/utils/formErrorTargets.ts +82 -16
|
@@ -41,6 +41,15 @@ interface Props {
|
|
|
41
41
|
hideLabel?: boolean;
|
|
42
42
|
}
|
|
43
43
|
declare function setValue(value: any): void;
|
|
44
|
+
/**
|
|
45
|
+
* `update` for the `span` and `value` slots (and so DXTable's `edit-span` /
|
|
46
|
+
* `edit-value`). Such a slot may draw rows of its own and write the whole
|
|
47
|
+
* array back, so besides the field's own error it clears every error under
|
|
48
|
+
* `<key>.` (`lines.3.price`), as the repeater's add and remove do: the rows
|
|
49
|
+
* may have moved, and a stale per-row error would stay in the summary under
|
|
50
|
+
* the wrong row. They come back on the next submit.
|
|
51
|
+
*/
|
|
52
|
+
declare function setValueFromSlot(value: any): void;
|
|
44
53
|
/**
|
|
45
54
|
* The `password-actions` slot's handle on the reveal state: the same state
|
|
46
55
|
* the eye toggles, so the two never disagree. Refused on a `revealable: false`
|
|
@@ -51,7 +60,7 @@ declare var __VLS_1: {
|
|
|
51
60
|
field: FieldDefinition;
|
|
52
61
|
model: any;
|
|
53
62
|
value: any;
|
|
54
|
-
update: typeof
|
|
63
|
+
update: typeof setValueFromSlot;
|
|
55
64
|
}, __VLS_6: {
|
|
56
65
|
field: FieldDefinition;
|
|
57
66
|
model: any;
|
|
@@ -62,12 +71,12 @@ declare var __VLS_1: {
|
|
|
62
71
|
field: FieldDefinition;
|
|
63
72
|
model: any;
|
|
64
73
|
value: any;
|
|
65
|
-
update: typeof
|
|
74
|
+
update: typeof setValueFromSlot;
|
|
66
75
|
}, __VLS_12: {
|
|
67
76
|
field: FieldDefinition;
|
|
68
77
|
model: any;
|
|
69
78
|
value: any;
|
|
70
|
-
update: typeof
|
|
79
|
+
update: typeof setValueFromSlot;
|
|
71
80
|
}, __VLS_54: {
|
|
72
81
|
option: FieldOption;
|
|
73
82
|
on: boolean;
|
|
@@ -10,6 +10,14 @@ export interface ErrorSummarySelection {
|
|
|
10
10
|
tabKey: string | null;
|
|
11
11
|
/** The error key as the server sent it. */
|
|
12
12
|
errorKey: string;
|
|
13
|
+
/**
|
|
14
|
+
* Where to take the user: the error key at the failed row's current
|
|
15
|
+
* index, or the field's key when that row is gone (see
|
|
16
|
+
* `ErrorTarget.focusKey`). Equal to `errorKey` for everything else.
|
|
17
|
+
* Always emitted; optional so a selection built by hand for DXForm's
|
|
18
|
+
* exposed `focusErrorTarget` still types (it then uses `errorKey`).
|
|
19
|
+
*/
|
|
20
|
+
focusKey?: string;
|
|
13
21
|
}
|
|
14
22
|
interface Props {
|
|
15
23
|
/** The form: a `useForm` return or a `defineForm` return. */
|
|
@@ -15,6 +15,28 @@ export interface SubmitFailure {
|
|
|
15
15
|
message: string;
|
|
16
16
|
/** The validation errors the submit returned (`{}` when none). */
|
|
17
17
|
errors: ValidationErrors;
|
|
18
|
+
/**
|
|
19
|
+
* The rows the errors named, as they were when the submit failed, keyed
|
|
20
|
+
* by row path (`lines.2` for `lines.2.price`; every numeric segment of
|
|
21
|
+
* every error key gets one). Absent when no error key names a row that
|
|
22
|
+
* exists in the form data. The error summary uses it to keep naming
|
|
23
|
+
* and finding the row that failed after rows are removed or reordered.
|
|
24
|
+
*/
|
|
25
|
+
failedRows?: Record<string, FailedRow>;
|
|
26
|
+
}
|
|
27
|
+
/** One row a failed submit's errors named (see `SubmitFailure.failedRows`). */
|
|
28
|
+
export interface FailedRow {
|
|
29
|
+
/**
|
|
30
|
+
* The row object itself (raw, not a reactive proxy), so its current
|
|
31
|
+
* index can be found by identity. A row array replaced wholesale (a
|
|
32
|
+
* reload) holds new objects, and the row then counts as gone.
|
|
33
|
+
*/
|
|
34
|
+
row: object;
|
|
35
|
+
/**
|
|
36
|
+
* A copy of the row taken when the submit failed, for labels: a row's
|
|
37
|
+
* name (`rowLabel`) reads it, so later edits do not rename the error.
|
|
38
|
+
*/
|
|
39
|
+
snapshot: Record<string, any>;
|
|
18
40
|
}
|
|
19
41
|
export interface FormSubmitOptions<TPayload = unknown, TResponse = unknown> {
|
|
20
42
|
onSuccess?: (data: TResponse) => void;
|