@omnitend/dashboard-for-laravel 0.11.0 → 0.14.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,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[];
@@ -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;
@@ -102,6 +103,13 @@ export interface Props<TItem = any> {
102
103
  containerClass?: string;
103
104
  /** Column size (Bootstrap grid) */
104
105
  columnSize?: string | number;
106
+ /**
107
+ * Wrap the table in a `DCard`. Defaults to `true`. Set `false` for a plain,
108
+ * borderless variant — the same header, filter row, table and pagination
109
+ * rendered directly on the page background (no card border/shadow), for
110
+ * data-heavy admin index pages that read as busy inside a card.
111
+ */
112
+ card?: boolean;
105
113
  /** Form field definitions for edit modal (if provided, enables edit on row click) */
106
114
  editFields?: any[];
107
115
  /** Tab definitions for organizing edit modal content */
@@ -112,6 +120,15 @@ export interface Props<TItem = any> {
112
120
  editModalSize?: 'sm' | 'md' | 'lg' | 'xl';
113
121
  /** API endpoint pattern for updates (e.g., "/api/products/:id") */
114
122
  editUrl?: string;
123
+ /**
124
+ * API endpoint pattern to fetch the FULL record for the edit modal
125
+ * (e.g., "/api/products/:id"). When set, opening a row seeds the form from
126
+ * this fetch (shown with a loading state) instead of the thin list row —
127
+ * use when the list payload omits fields the edit form needs (notes, nested
128
+ * relations, repeater rows, …). The response is unwrapped from `data.data`
129
+ * (Laravel API Resource) or used as-is.
130
+ */
131
+ showUrl?: string;
115
132
  /** API endpoint pattern for deletions (e.g., "/api/products/:id") */
116
133
  deleteUrl?: string;
117
134
  /**
@@ -0,0 +1,24 @@
1
+ interface Props {
2
+ /** Wrap the content in a `DCard`. When false, render plain/borderless. */
3
+ card?: boolean;
4
+ }
5
+ declare var __VLS_5: {}, __VLS_7: {}, __VLS_9: {}, __VLS_11: {};
6
+ type __VLS_Slots = {} & {
7
+ header?: (props: typeof __VLS_5) => any;
8
+ } & {
9
+ default?: (props: typeof __VLS_7) => any;
10
+ } & {
11
+ header?: (props: typeof __VLS_9) => any;
12
+ } & {
13
+ default?: (props: typeof __VLS_11) => any;
14
+ };
15
+ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
16
+ card: boolean;
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
19
+ export default _default;
20
+ type __VLS_WithSlots<T, S> = T & {
21
+ new (): {
22
+ $slots: S;
23
+ };
24
+ };