@omnitend/dashboard-for-laravel 0.10.0 → 0.13.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/charts/DXBarChart.vue.d.ts +22 -0
- package/dist/components/charts/DXDoughnutChart.vue.d.ts +24 -0
- package/dist/components/charts/DXLineChart.vue.d.ts +22 -0
- package/dist/components/charts/chartTheme.d.ts +32 -0
- package/dist/components/extended/DXDashboard.vue.d.ts +12 -2
- package/dist/components/extended/DXStatCard.vue.d.ts +56 -0
- package/dist/components/extended/DXTable.vue.d.ts +26 -1
- package/dist/dashboard-for-laravel.js +7457 -7034
- 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 +4 -0
- package/dist/style.css +1 -1
- package/docs/public/api-reference.json +322 -7
- package/docs/public/docs-map.md +4 -2
- package/docs/public/llms.txt +3 -2
- package/package.json +12 -2
- package/resources/js/components/charts/DXBarChart.vue +79 -0
- package/resources/js/components/charts/DXDoughnutChart.vue +85 -0
- package/resources/js/components/charts/DXLineChart.vue +79 -0
- package/resources/js/components/charts/chartTheme.ts +229 -0
- package/resources/js/components/extended/DXDashboard.vue +18 -3
- package/resources/js/components/extended/DXStatCard.vue +211 -0
- package/resources/js/components/extended/DXTable.vue +137 -8
- package/resources/js/composables/useForm.ts +91 -7
- package/resources/js/index.ts +4 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ChartValueFormat } from "./chartTheme";
|
|
2
|
+
interface Props {
|
|
3
|
+
/** X-axis category labels. */
|
|
4
|
+
labels: string[];
|
|
5
|
+
/** Chart.js datasets. Colours are themed when a dataset omits them. */
|
|
6
|
+
datasets: any[];
|
|
7
|
+
/** Chart.js options; deep-merged over the themed defaults. */
|
|
8
|
+
options?: Record<string, any>;
|
|
9
|
+
/** Format value-axis ticks and tooltips. */
|
|
10
|
+
valueFormat?: ChartValueFormat;
|
|
11
|
+
/** Currency symbol for valueFormat: "currency" (default "£"). */
|
|
12
|
+
currencySymbol?: string;
|
|
13
|
+
/** Locale for number formatting. */
|
|
14
|
+
locale?: string;
|
|
15
|
+
/** Show the legend (default: only when there is more than one dataset). */
|
|
16
|
+
showLegend?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
19
|
+
currencySymbol: string;
|
|
20
|
+
showLegend: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ChartValueFormat } from "./chartTheme";
|
|
2
|
+
interface Props {
|
|
3
|
+
/** Slice labels. */
|
|
4
|
+
labels: string[];
|
|
5
|
+
/** Convenience: a single number array (one value per label). */
|
|
6
|
+
data?: number[];
|
|
7
|
+
/** Full Chart.js datasets (alternative to `data`). */
|
|
8
|
+
datasets?: any[];
|
|
9
|
+
/** Chart.js options; deep-merged over the themed defaults. */
|
|
10
|
+
options?: Record<string, any>;
|
|
11
|
+
/** Format tooltip values. */
|
|
12
|
+
valueFormat?: ChartValueFormat;
|
|
13
|
+
/** Currency symbol for valueFormat: "currency" (default "£"). */
|
|
14
|
+
currencySymbol?: string;
|
|
15
|
+
/** Locale for number formatting. */
|
|
16
|
+
locale?: string;
|
|
17
|
+
/** Show the legend (default: true — slices need identifying). */
|
|
18
|
+
showLegend?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
21
|
+
currencySymbol: string;
|
|
22
|
+
showLegend: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ChartValueFormat } from "./chartTheme";
|
|
2
|
+
interface Props {
|
|
3
|
+
/** X-axis category labels. */
|
|
4
|
+
labels: string[];
|
|
5
|
+
/** Chart.js datasets. Colours are themed when a dataset omits them. */
|
|
6
|
+
datasets: any[];
|
|
7
|
+
/** Chart.js options; deep-merged over the themed defaults. */
|
|
8
|
+
options?: Record<string, any>;
|
|
9
|
+
/** Format value-axis ticks and tooltips. */
|
|
10
|
+
valueFormat?: ChartValueFormat;
|
|
11
|
+
/** Currency symbol for valueFormat: "currency" (default "£"). */
|
|
12
|
+
currencySymbol?: string;
|
|
13
|
+
/** Locale for number formatting. */
|
|
14
|
+
locale?: string;
|
|
15
|
+
/** Show the legend (default: only when there is more than one dataset). */
|
|
16
|
+
showLegend?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
19
|
+
currencySymbol: string;
|
|
20
|
+
showLegend: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type ChartValueFormat = "number" | "currency" | "percent";
|
|
2
|
+
/** Deep-merge consumer `options` over the themed defaults (arrays replace). */
|
|
3
|
+
export declare function mergeOptions(base: Record<string, any>, override: Record<string, any>): Record<string, any>;
|
|
4
|
+
/**
|
|
5
|
+
* Register Chart.js (idempotent). Uses the full `registerables` set so every
|
|
6
|
+
* controller / scale / element / plugin (incl. Legend, Tooltip, Filler) is
|
|
7
|
+
* available — chart.js is an external peer dep, so this adds no bundle weight.
|
|
8
|
+
*/
|
|
9
|
+
export declare function registerCharts(): void;
|
|
10
|
+
/** Resolve the themed categorical palette from the document root. */
|
|
11
|
+
export declare function getPalette(): string[];
|
|
12
|
+
/** Add an alpha channel to a hex or rgb() colour (best-effort). */
|
|
13
|
+
export declare function withAlpha(color: string, alpha: number): string;
|
|
14
|
+
/** Format a numeric value per the chart's value format (for tick/tooltips). */
|
|
15
|
+
export declare function formatValue(value: number, format: ChartValueFormat | undefined, currencySymbol: string, locale?: string): string;
|
|
16
|
+
export interface BaseOptionArgs {
|
|
17
|
+
valueFormat?: ChartValueFormat;
|
|
18
|
+
currencySymbol?: string;
|
|
19
|
+
locale?: string;
|
|
20
|
+
/** Show the legend (default: false for a single dataset, true for many). */
|
|
21
|
+
showLegend?: boolean;
|
|
22
|
+
/** Whether the chart has value axes (bar/line) vs none (doughnut). */
|
|
23
|
+
hasValueAxis?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/** Dashboard default Chart.js options merged under any consumer `options`. */
|
|
26
|
+
export declare function baseOptions(args: BaseOptionArgs): Record<string, any>;
|
|
27
|
+
/**
|
|
28
|
+
* Apply the themed palette to any dataset that doesn't set its own colours.
|
|
29
|
+
* Bar: one colour per dataset (or per bar for a single dataset). Line: a themed
|
|
30
|
+
* stroke + translucent fill. Doughnut/pie: one colour per slice.
|
|
31
|
+
*/
|
|
32
|
+
export declare function applyPalette(datasets: any[], kind: "bar" | "line" | "doughnut", labelsCount: number): any[];
|
|
@@ -8,6 +8,14 @@ interface Props {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
/** Page title shown in navbar */
|
|
10
10
|
pageTitle?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Render the page content full-width and left-aligned instead of the default
|
|
13
|
+
* centred, reading-width (`col-xl-10`) column. Use for data-heavy admin pages
|
|
14
|
+
* (wide tables).
|
|
15
|
+
*/
|
|
16
|
+
fluid?: boolean;
|
|
17
|
+
/** Extra class(es) applied to the content container/column. */
|
|
18
|
+
contentClass?: string;
|
|
11
19
|
/** User object for navbar dropdown */
|
|
12
20
|
user?: {
|
|
13
21
|
name: string;
|
|
@@ -35,13 +43,15 @@ interface Props {
|
|
|
35
43
|
*/
|
|
36
44
|
dashboardId?: string;
|
|
37
45
|
}
|
|
38
|
-
declare var __VLS_9: string, __VLS_10: any, __VLS_20: string, __VLS_21: any,
|
|
46
|
+
declare var __VLS_9: string, __VLS_10: any, __VLS_20: string, __VLS_21: any, __VLS_26: {}, __VLS_37: {};
|
|
39
47
|
type __VLS_Slots = {} & {
|
|
40
48
|
[K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
|
|
41
49
|
} & {
|
|
42
50
|
[K in NonNullable<typeof __VLS_20>]?: (props: typeof __VLS_21) => any;
|
|
43
51
|
} & {
|
|
44
|
-
default?: (props: typeof
|
|
52
|
+
default?: (props: typeof __VLS_26) => any;
|
|
53
|
+
} & {
|
|
54
|
+
default?: (props: typeof __VLS_37) => any;
|
|
45
55
|
};
|
|
46
56
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
47
57
|
title: string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
type StatFormat = "number" | "currency" | "percent";
|
|
2
|
+
type DeltaDirection = "up" | "down" | "neutral";
|
|
3
|
+
interface Props {
|
|
4
|
+
/** Metric label, e.g. "Revenue". */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Optional secondary line under the title, e.g. "This week". */
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
/** The metric value. Numbers are formatted per `format`; strings pass through. */
|
|
9
|
+
value: string | number;
|
|
10
|
+
/** How to format a numeric `value` (default: plain number with grouping). */
|
|
11
|
+
format?: StatFormat;
|
|
12
|
+
/** Currency symbol for `format: "currency"` (default "£"). */
|
|
13
|
+
currencySymbol?: string;
|
|
14
|
+
/** Decimal places (default: 2 for currency, 0 otherwise). */
|
|
15
|
+
precision?: number;
|
|
16
|
+
/** Locale for number grouping/formatting (default: the runtime's). */
|
|
17
|
+
locale?: string;
|
|
18
|
+
/** Change versus a comparison period. Its sign drives the arrow/colour. */
|
|
19
|
+
delta?: number;
|
|
20
|
+
/** How to format the delta (default "percent"). */
|
|
21
|
+
deltaFormat?: StatFormat;
|
|
22
|
+
/** Force the delta direction instead of deriving it from `delta`'s sign. */
|
|
23
|
+
deltaDirection?: DeltaDirection;
|
|
24
|
+
/** Caption beside the delta, e.g. "vs last week". */
|
|
25
|
+
deltaLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Invert the delta colour: by default an up delta is positive (success/green)
|
|
28
|
+
* and a down delta negative (danger/red). Set for metrics where down is good
|
|
29
|
+
* (costs, bounce rate, …).
|
|
30
|
+
*/
|
|
31
|
+
invertDelta?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare var __VLS_5: {}, __VLS_7: {
|
|
34
|
+
formatted: string;
|
|
35
|
+
value: string | number;
|
|
36
|
+
}, __VLS_12: {};
|
|
37
|
+
type __VLS_Slots = {} & {
|
|
38
|
+
icon?: (props: typeof __VLS_5) => any;
|
|
39
|
+
} & {
|
|
40
|
+
value?: (props: typeof __VLS_7) => any;
|
|
41
|
+
} & {
|
|
42
|
+
trend?: (props: typeof __VLS_12) => any;
|
|
43
|
+
};
|
|
44
|
+
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
45
|
+
currencySymbol: string;
|
|
46
|
+
format: StatFormat;
|
|
47
|
+
deltaFormat: StatFormat;
|
|
48
|
+
invertDelta: boolean;
|
|
49
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
50
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -90,7 +90,8 @@ export interface Props<TItem = any> {
|
|
|
90
90
|
currentPage?: number;
|
|
91
91
|
/** Items per page (for provider mode, v-model support) */
|
|
92
92
|
perPage?: number;
|
|
93
|
-
/** Striped rows
|
|
93
|
+
/** Striped (banded) rows. Off by default — banding adds little on short
|
|
94
|
+
* tables and can read as noise; opt in with `:striped="true"`. */
|
|
94
95
|
striped?: boolean;
|
|
95
96
|
/** Hover effect on rows */
|
|
96
97
|
hover?: boolean;
|
|
@@ -112,8 +113,26 @@ export interface Props<TItem = any> {
|
|
|
112
113
|
editModalSize?: 'sm' | 'md' | 'lg' | 'xl';
|
|
113
114
|
/** API endpoint pattern for updates (e.g., "/api/products/:id") */
|
|
114
115
|
editUrl?: string;
|
|
116
|
+
/**
|
|
117
|
+
* API endpoint pattern to fetch the FULL record for the edit modal
|
|
118
|
+
* (e.g., "/api/products/:id"). When set, opening a row seeds the form from
|
|
119
|
+
* this fetch (shown with a loading state) instead of the thin list row —
|
|
120
|
+
* use when the list payload omits fields the edit form needs (notes, nested
|
|
121
|
+
* relations, repeater rows, …). The response is unwrapped from `data.data`
|
|
122
|
+
* (Laravel API Resource) or used as-is.
|
|
123
|
+
*/
|
|
124
|
+
showUrl?: string;
|
|
115
125
|
/** API endpoint pattern for deletions (e.g., "/api/products/:id") */
|
|
116
126
|
deleteUrl?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Guard run when Delete is clicked, before the confirm dialog and request.
|
|
129
|
+
* Return a message for a non-deletable item to show it immediately (as a
|
|
130
|
+
* toast) and skip both the confirm and the delete request; return
|
|
131
|
+
* `null`/`undefined` to proceed with the normal confirm + delete. Lets you
|
|
132
|
+
* short-circuit a doomed delete (e.g. a record with dependents that the
|
|
133
|
+
* server would reject) with an immediate, specific reason.
|
|
134
|
+
*/
|
|
135
|
+
deleteGuard?: (item: TItem) => string | null | undefined;
|
|
117
136
|
/** API endpoint for creating new items (e.g., "/api/products") — enables "New" button */
|
|
118
137
|
createUrl?: string;
|
|
119
138
|
/** Enable client-side filtering, sorting, and pagination on items array */
|
|
@@ -142,6 +161,12 @@ declare const _default: <T = any>(__VLS_props: NonNullable<Awaited<typeof __VLS_
|
|
|
142
161
|
} & 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;
|
|
143
162
|
expose(exposed: import("vue").ShallowUnwrapRef<{
|
|
144
163
|
refresh: () => void;
|
|
164
|
+
/**
|
|
165
|
+
* Open the built-in create modal (same as clicking the default "New {item}"
|
|
166
|
+
* button). Lets the create action live outside the table card — e.g. in a
|
|
167
|
+
* page header or the dashboard navbar. No-op unless `editFields` are set.
|
|
168
|
+
*/
|
|
169
|
+
openCreate: () => void;
|
|
145
170
|
}>): void;
|
|
146
171
|
attrs: any;
|
|
147
172
|
slots: {
|