@omnitend/dashboard-for-laravel 0.41.2 → 0.42.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.
- package/README.md +2 -1
- package/dist/assets/MavenPro-Bold-35b16f06.woff2 +0 -0
- package/dist/assets/MavenPro-Medium-febc8674.woff2 +0 -0
- package/dist/assets/MavenPro-Regular-aee3df9e.woff2 +0 -0
- package/dist/assets/MavenPro-SemiBold-c555dbfa.woff2 +0 -0
- package/dist/assets/Poppins-Medium-5800fa57.woff2 +0 -0
- package/dist/assets/Poppins-SemiBold-94a36267.woff2 +0 -0
- package/dist/charts.js +148 -130
- package/dist/charts.js.map +1 -1
- package/dist/charts.umd.cjs +1 -1
- package/dist/charts.umd.cjs.map +1 -1
- package/dist/components/charts/chartTheme.d.ts +14 -2
- package/dist/components/extended/DXField.vue.d.ts +16 -5
- package/dist/components/extended/DXForm.vue.d.ts +25 -9
- package/dist/components/extended/DXNumberStepper.vue.d.ts +33 -0
- package/dist/components/extended/DXSaveButton.vue.d.ts +38 -0
- package/dist/components/extended/DXTable.vue.d.ts +6 -2
- package/dist/composables/useForm.d.ts +7 -0
- package/dist/dashboard-for-laravel.js +9369 -9133
- 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 +2 -0
- package/dist/style.css +2 -2
- package/dist/types/index.d.ts +20 -3
- package/docs/public/api-reference.json +165 -14
- package/docs/public/docs-map.md +4 -2
- package/docs/public/llms.txt +4 -2
- package/package.json +1 -1
- package/resources/css/theme.scss +512 -89
- package/resources/fonts/maven-pro/MavenPro-Bold.woff2 +0 -0
- package/resources/fonts/maven-pro/MavenPro-Medium.woff2 +0 -0
- package/resources/fonts/maven-pro/MavenPro-Regular.woff2 +0 -0
- package/resources/fonts/maven-pro/MavenPro-SemiBold.woff2 +0 -0
- package/resources/fonts/maven-pro/OFL.txt +93 -0
- package/resources/fonts/poppins/OFL.txt +93 -0
- package/resources/fonts/poppins/Poppins-Medium.woff2 +0 -0
- package/resources/fonts/poppins/Poppins-SemiBold.woff2 +0 -0
- package/resources/js/components/charts/DXBarChart.vue +2 -1
- package/resources/js/components/charts/DXDoughnutChart.vue +2 -1
- package/resources/js/components/charts/DXLineChart.vue +2 -1
- package/resources/js/components/charts/chartTheme.ts +68 -21
- package/resources/js/components/extended/DXDashboard.vue +4 -2
- package/resources/js/components/extended/DXDashboardSidebar.vue +52 -20
- package/resources/js/components/extended/DXField.vue +59 -28
- package/resources/js/components/extended/DXForm.vue +122 -21
- package/resources/js/components/extended/DXNumberStepper.vue +243 -0
- package/resources/js/components/extended/DXSaveButton.vue +82 -0
- package/resources/js/components/extended/DXTable.vue +44 -15
- package/resources/js/composables/useForm.ts +11 -0
- package/resources/js/composables/useToast.ts +1 -1
- package/resources/js/index.ts +2 -0
- package/resources/js/types/index.ts +21 -3
|
@@ -31,6 +31,13 @@ export interface FormState<TData extends Record<string, any>> {
|
|
|
31
31
|
message: string;
|
|
32
32
|
touched: Record<string, boolean>;
|
|
33
33
|
recentlySuccessful: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the most recent submission succeeded. Unlike
|
|
36
|
+
* `recentlySuccessful` (which clears itself after 1.5s) this stays true
|
|
37
|
+
* until the next submission starts, and is false after a failure — the
|
|
38
|
+
* Inertia `wasSuccessful` semantics. DXForm's saved state reads it.
|
|
39
|
+
*/
|
|
40
|
+
wasSuccessful: boolean;
|
|
34
41
|
shouldShowMessage: boolean;
|
|
35
42
|
}
|
|
36
43
|
|
|
@@ -172,6 +179,7 @@ export function useForm<TData extends Record<string, any>>(
|
|
|
172
179
|
message: "",
|
|
173
180
|
touched: {},
|
|
174
181
|
recentlySuccessful: false,
|
|
182
|
+
wasSuccessful: false,
|
|
175
183
|
shouldShowMessage: false,
|
|
176
184
|
});
|
|
177
185
|
|
|
@@ -263,6 +271,7 @@ export function useForm<TData extends Record<string, any>>(
|
|
|
263
271
|
): Promise<TResponse> => {
|
|
264
272
|
inFlightCount += 1;
|
|
265
273
|
state.processing = true;
|
|
274
|
+
state.wasSuccessful = false;
|
|
266
275
|
if (!options.preserveErrors) clearErrors();
|
|
267
276
|
|
|
268
277
|
const payloadRaw = (
|
|
@@ -326,6 +335,7 @@ export function useForm<TData extends Record<string, any>>(
|
|
|
326
335
|
});
|
|
327
336
|
|
|
328
337
|
state.recentlySuccessful = true;
|
|
338
|
+
state.wasSuccessful = true;
|
|
329
339
|
if (successTimer !== null) clearTimeout(successTimer);
|
|
330
340
|
successTimer = setTimeout(() => {
|
|
331
341
|
state.recentlySuccessful = false;
|
|
@@ -338,6 +348,7 @@ export function useForm<TData extends Record<string, any>>(
|
|
|
338
348
|
}
|
|
339
349
|
return data;
|
|
340
350
|
} catch (err) {
|
|
351
|
+
state.wasSuccessful = false;
|
|
341
352
|
const { errors, message } = errorsFromLaravel(err);
|
|
342
353
|
setErrors(errors);
|
|
343
354
|
setMessage(message);
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
// class, driving Bootstrap's own `--bs-toast-*` variables cleanly. An
|
|
14
14
|
// unrecognised variant (e.g. "primary", "dark", or none) falls through to
|
|
15
15
|
// BVN's default `.text-bg-*` styling unchanged.
|
|
16
|
-
const THEMED_TOAST_VARIANTS = new Set(["success", "danger", "warning", "info"]);
|
|
16
|
+
const THEMED_TOAST_VARIANTS = new Set(["success", "danger", "warning", "info", "pending"]);
|
|
17
17
|
|
|
18
18
|
function themeToastParam(param: Record<string, unknown>): Record<string, unknown> {
|
|
19
19
|
const variant = param.variant as string | null | undefined;
|
package/resources/js/index.ts
CHANGED
|
@@ -10,9 +10,11 @@ export { default as DXForm } from "./components/extended/DXForm.vue";
|
|
|
10
10
|
export { default as DXField } from "./components/extended/DXField.vue";
|
|
11
11
|
export { default as DXFieldLabel } from "./components/extended/DXFieldLabel.vue";
|
|
12
12
|
export { default as DXModalActions } from "./components/extended/DXModalActions.vue";
|
|
13
|
+
export { default as DXSaveButton } from "./components/extended/DXSaveButton.vue";
|
|
13
14
|
export { default as DXLoading } from "./components/extended/DXLoading.vue";
|
|
14
15
|
export { default as DXSwitch } from "./components/extended/DXSwitch.vue";
|
|
15
16
|
export { default as DXCurrencyInput } from "./components/extended/DXCurrencyInput.vue";
|
|
17
|
+
export { default as DXNumberStepper } from "./components/extended/DXNumberStepper.vue";
|
|
16
18
|
export { default as DXStatCard } from "./components/extended/DXStatCard.vue";
|
|
17
19
|
// Chart components moved to the `@omnitend/dashboard-for-laravel/charts` entry
|
|
18
20
|
// (#142) so chart.js / vue-chartjs stay genuinely optional peers — the main
|
|
@@ -73,8 +73,9 @@ export type OptionsLoader = (model: any) => Promise<FieldOption[]>;
|
|
|
73
73
|
* Deliberately excludes `boolean` (which BFormGroup's own `labelCols` prop
|
|
74
74
|
* accepts): Vue's type-based `defineProps` auto-defaults an omitted prop to
|
|
75
75
|
* `false` (not `undefined`) whenever its declared type includes `boolean`,
|
|
76
|
-
* which would silently break the `field.labelCols ?? formLabelCols
|
|
77
|
-
*
|
|
76
|
+
* which would silently break the `field.labelCols ?? formLabelCols` fallback
|
|
77
|
+
* chain used to resolve this value (`undefined` at the end of it means the
|
|
78
|
+
* default 45% label column, `--dx-form-label-width`).
|
|
78
79
|
*/
|
|
79
80
|
export type LabelCols =
|
|
80
81
|
| number
|
|
@@ -241,7 +242,8 @@ export interface FieldDefinition {
|
|
|
241
242
|
|
|
242
243
|
/**
|
|
243
244
|
* Per-field override of DXForm's `labelCols` prop, for horizontal
|
|
244
|
-
* layout. Falls back to the form-level `labelCols` when omitted
|
|
245
|
+
* layout. Falls back to the form-level `labelCols` when omitted, and to
|
|
246
|
+
* the default 45% label column (`--dx-form-label-width`) when neither is set.
|
|
245
247
|
*/
|
|
246
248
|
labelCols?: LabelCols;
|
|
247
249
|
|
|
@@ -636,3 +638,19 @@ export interface FormTab {
|
|
|
636
638
|
/** Lazily mount tab content until first activated */
|
|
637
639
|
lazy?: boolean;
|
|
638
640
|
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* The theme's extra colour variant, `pending`: waiting, and the next move is
|
|
644
|
+
* not yours ("awaiting payment", "sent to printer, not yet confirmed").
|
|
645
|
+
* theme.scss paints it everywhere a stock variant is painted (badge, soft and
|
|
646
|
+
* outline button, alert, text, subtle utilities, table row, list-group item,
|
|
647
|
+
* toast). Registering it on bootstrap-vue-next's `BaseColorVariant` adds it to
|
|
648
|
+
* every variant union derived from that interface (`ColorVariant`,
|
|
649
|
+
* `ButtonVariant` incl. `outline-pending`, the `-subtle` and `-emphasis`
|
|
650
|
+
* forms), so `<DBadge variant="pending">` type-checks.
|
|
651
|
+
*/
|
|
652
|
+
declare module "bootstrap-vue-next" {
|
|
653
|
+
interface BaseColorVariant {
|
|
654
|
+
pending: unknown;
|
|
655
|
+
}
|
|
656
|
+
}
|