@dskripchenko/laravel-admin 1.38.0 → 1.40.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/dist/.vite/manifest.json +2 -2
- package/dist/assets/app-BNKExPRh.js +44 -0
- package/dist/assets/app-ZHq3r6V_.css +1 -0
- package/dist/components/dashboard/DonutChartWidget.vue.d.ts +3 -0
- package/dist/components/dashboard/GaugePieTone.test.d.ts +1 -0
- package/dist/components/dashboard/GaugeWidget.vue.d.ts +9 -2
- package/dist/components/dashboard/IframeWidget.vue.d.ts +4 -2
- package/dist/components/dashboard/TableWidget.vue.d.ts +3 -3
- package/dist/components/dashboard/chartGeometry.d.ts +2 -6
- package/dist/components/dashboard/chartTypes.d.ts +1 -1
- package/dist/components/dashboard/toneColor.d.ts +4 -0
- package/dist/components/fields/CascaderField.vue.d.ts +1 -1
- package/dist/components/fields/CheckboxField.vue.d.ts +7 -0
- package/dist/components/fields/MarkdownField.vue.d.ts +1 -1
- package/dist/components/fields/RelationTableField.vue.d.ts +1 -1
- package/dist/components/fields/SelectField.vue.d.ts +3 -0
- package/dist/components/fields/SlugField.vue.d.ts +1 -1
- package/dist/components/fields/TagsField.vue.d.ts +1 -1
- package/dist/components/fields/choiceFields.test.d.ts +1 -0
- package/dist/components/fields/resourcePicker/ResourcePickerDialog.vue.d.ts +1 -1
- package/dist/components/fields/support/selectValue.d.ts +8 -0
- package/dist/components/layouts/SectionLayout.vue.d.ts +2 -0
- package/dist/components/notifications/notificationView.d.ts +16 -0
- package/dist/components/notifications/notificationView.test.d.ts +1 -0
- package/dist/components/resource/AdminFilterToolbar.vue.d.ts +4 -0
- package/dist/components/resource/AdminTableCell.vue.d.ts +14 -0
- package/dist/components/resource/ResourceViewPage.vue.d.ts +2 -2
- package/dist/components/resource/cellFormat.d.ts +29 -13
- package/dist/components/resource/cellFormat.test.d.ts +1 -0
- package/dist/components/shell/AdminShell.vue.d.ts +1 -0
- package/dist/components/shell/AdminTopBar.vue.d.ts +6 -4
- package/dist/components/shell/breadcrumbs.d.ts +34 -0
- package/dist/components/shell/breadcrumbs.test.d.ts +1 -0
- package/dist/i18n-BxCQCcGB.cjs +2 -0
- package/dist/i18n-BxCQCcGB.cjs.map +1 -0
- package/dist/i18n-Vgxu-A6P.js +66 -0
- package/dist/i18n-Vgxu-A6P.js.map +1 -0
- package/dist/index.cjs +23 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +16741 -16292
- package/dist/index.mjs.map +1 -1
- package/dist/source-hash.txt +1 -1
- package/dist/stores/dashboard.d.ts +1 -1
- package/dist/stores/i18n.d.ts +6 -0
- package/dist/stores/resourceForm.d.ts +6 -3
- package/dist/stores/screen.d.ts +5 -2
- package/dist/style.css +1 -1
- package/dist/tinymce.cjs +1 -1
- package/dist/tinymce.mjs +1 -1
- package/package.json +3 -3
- package/dist/assets/app-BISopiIN.css +0 -1
- package/dist/assets/app-DL-8fHEv.js +0 -43
- package/dist/i18n-BCRWWhHE.cjs +0 -2
- package/dist/i18n-BCRWWhHE.cjs.map +0 -1
- package/dist/i18n-DXndsABq.js +0 -55
- package/dist/i18n-DXndsABq.js.map +0 -1
|
@@ -6,8 +6,11 @@ interface Slice {
|
|
|
6
6
|
interface Props {
|
|
7
7
|
title?: string;
|
|
8
8
|
data: Slice[];
|
|
9
|
+
/** A doughnut's hole; a pie is drawn without one. */
|
|
10
|
+
hole?: boolean;
|
|
9
11
|
}
|
|
10
12
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
11
13
|
title: string;
|
|
14
|
+
hole: boolean;
|
|
12
15
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
16
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,6 +10,9 @@ interface Props {
|
|
|
10
10
|
/**
|
|
11
11
|
* The backend's GaugeWidget::data() returns `thresholds`, which matches
|
|
12
12
|
* UidGauge.ranges ({from, to, color}) structurally. Both names are accepted.
|
|
13
|
+
* A zone's colour is a tone name (success, warning, danger, info, primary,
|
|
14
|
+
* neutral, or green, amber, red…), mapped onto the kit's tokens; a CSS
|
|
15
|
+
* colour passes through.
|
|
13
16
|
*/
|
|
14
17
|
thresholds?: GaugeRange[];
|
|
15
18
|
unit?: string;
|
|
@@ -17,7 +20,11 @@ interface Props {
|
|
|
17
20
|
color?: string;
|
|
18
21
|
label?: string;
|
|
19
22
|
suffix?: string;
|
|
20
|
-
|
|
23
|
+
/**
|
|
24
|
+
* The decimals shown, GaugeWidget::precision(). Unset, a whole value shows
|
|
25
|
+
* none and a fractional one shows up to two, so 82.6 is not rounded to 83.
|
|
26
|
+
*/
|
|
27
|
+
precision?: number | null;
|
|
21
28
|
}
|
|
22
29
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
23
30
|
value: number;
|
|
@@ -28,7 +35,7 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
28
35
|
max: number;
|
|
29
36
|
min: number;
|
|
30
37
|
suffix: string;
|
|
31
|
-
precision: number;
|
|
38
|
+
precision: number | null;
|
|
32
39
|
tone: SemanticTone;
|
|
33
40
|
ranges: GaugeRange[];
|
|
34
41
|
thresholds: GaugeRange[];
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The backend's IframeWidget::data() gives {src, height, sandbox}. Validating
|
|
3
3
|
* the src against the allowed hosts is the host's business; the sandbox
|
|
4
|
-
* attribute is passed through as it is
|
|
5
|
-
*
|
|
4
|
+
* attribute is passed through as it is. The default — the backend's too —
|
|
5
|
+
* lets scripts, forms and pop-ups run under an opaque origin: adding
|
|
6
|
+
* allow-same-origin to allow-scripts would let the frame lift its own sandbox,
|
|
7
|
+
* which browsers warn about.
|
|
6
8
|
*/
|
|
7
9
|
interface Props {
|
|
8
10
|
title?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CellMeta } from '../resource/cellFormat';
|
|
2
2
|
/**
|
|
3
3
|
* Backend TableWidget::data() — {rows, columns[TableColumn::toArray]}:
|
|
4
4
|
* the columns come in the resource format ({name, label, preset, meta…}), so
|
|
5
|
-
* the cells are
|
|
6
|
-
* dates, money, booleans.
|
|
5
|
+
* the cells are drawn by the same AdminTableCell as a resource list uses —
|
|
6
|
+
* dates, money, booleans, badges, links and images.
|
|
7
7
|
*/
|
|
8
8
|
interface BackendColumn {
|
|
9
9
|
name: string;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared, dependency-free helpers of the SVG charts: the series palette, the
|
|
3
|
-
* normalization of the backend's datasets, nice axis ticks and number
|
|
4
|
-
* formatting. Pure functions — the components only lay the results out.
|
|
5
|
-
*/
|
|
6
1
|
/** One drawable series: the backend's dataset with its colour resolved. */
|
|
7
2
|
export interface ChartSeries {
|
|
8
3
|
label: string;
|
|
@@ -27,7 +22,8 @@ export declare const SERIES_PALETTE: readonly string[];
|
|
|
27
22
|
/** The colour of a lone series: the theme's accent, as the bar chart always had. */
|
|
28
23
|
export declare const SINGLE_SERIES_COLOR = "var(--uid-accent)";
|
|
29
24
|
/**
|
|
30
|
-
* Turns the backend's datasets into drawable series. An explicit `color`
|
|
25
|
+
* Turns the backend's datasets into drawable series. An explicit `color` — a
|
|
26
|
+
* tone name or a CSS colour, see toneColor — wins;
|
|
31
27
|
* otherwise a lone series takes `singleColor` and several take the palette in
|
|
32
28
|
* order.
|
|
33
29
|
*/
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* The backend's ChartWidget::ALLOWED_TYPES lists what a host may ask for;
|
|
5
5
|
* backendParity.test.ts checks every one of them has an entry here.
|
|
6
6
|
*/
|
|
7
|
-
export type ChartRenderer = 'bar' | 'line' | 'area' | 'donut' | 'radar';
|
|
7
|
+
export type ChartRenderer = 'bar' | 'line' | 'area' | 'pie' | 'donut' | 'radar';
|
|
8
8
|
export declare const CHART_RENDERERS: Readonly<Record<string, ChartRenderer>>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The tone names toneColor() knows, for docs and tests. */
|
|
2
|
+
export declare const TONE_NAMES: readonly string[];
|
|
3
|
+
/** A tone or colour name as a kit token; a CSS colour as it is; '' for nothing. */
|
|
4
|
+
export declare function toneColor(color: string | null | undefined): string;
|
|
@@ -20,9 +20,9 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
20
20
|
placeholder: string | null;
|
|
21
21
|
tree: never[];
|
|
22
22
|
readonly: boolean;
|
|
23
|
+
separator: string;
|
|
23
24
|
required: boolean;
|
|
24
25
|
help: string | null;
|
|
25
|
-
separator: string;
|
|
26
26
|
levels: Array<{
|
|
27
27
|
key?: string;
|
|
28
28
|
label?: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SelectOption } from './SelectField.vue';
|
|
1
2
|
interface Props {
|
|
2
3
|
name: string;
|
|
3
4
|
label?: string | null;
|
|
@@ -5,10 +6,16 @@ interface Props {
|
|
|
5
6
|
required?: boolean;
|
|
6
7
|
inlineLabel?: string | null;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
options?: SelectOption[] | null;
|
|
11
|
+
inline?: boolean;
|
|
8
12
|
}
|
|
9
13
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
14
|
+
options: SelectOption[] | null;
|
|
15
|
+
inline: boolean;
|
|
10
16
|
label: string | null;
|
|
11
17
|
disabled: boolean;
|
|
18
|
+
readonly: boolean;
|
|
12
19
|
required: boolean;
|
|
13
20
|
help: string | null;
|
|
14
21
|
inlineLabel: string | null;
|
|
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
23
23
|
required: boolean;
|
|
24
24
|
toolbar: boolean;
|
|
25
25
|
rows: number;
|
|
26
|
-
help: string | null;
|
|
27
26
|
preview: boolean;
|
|
27
|
+
help: string | null;
|
|
28
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
29
|
export default _default;
|
|
@@ -19,6 +19,8 @@ interface Props {
|
|
|
19
19
|
readonly?: boolean;
|
|
20
20
|
searchable?: boolean;
|
|
21
21
|
clearable?: boolean;
|
|
22
|
+
/** Select::multiple(): several values, stored as a list. */
|
|
23
|
+
multiple?: boolean;
|
|
22
24
|
size?: 'sm' | 'md' | 'lg';
|
|
23
25
|
}
|
|
24
26
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
@@ -29,6 +31,7 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
29
31
|
readonly: boolean;
|
|
30
32
|
searchable: boolean;
|
|
31
33
|
required: boolean;
|
|
34
|
+
multiple: boolean;
|
|
32
35
|
clearable: boolean;
|
|
33
36
|
help: string | null;
|
|
34
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -18,9 +18,9 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
placeholder: string | null;
|
|
20
20
|
readonly: boolean;
|
|
21
|
+
separator: string | null;
|
|
21
22
|
required: boolean;
|
|
22
23
|
help: string | null;
|
|
23
|
-
separator: string | null;
|
|
24
24
|
follow: boolean;
|
|
25
25
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
26
|
export default _default;
|
|
@@ -28,9 +28,9 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
28
28
|
label: string | null;
|
|
29
29
|
disabled: boolean;
|
|
30
30
|
placeholder: string | null;
|
|
31
|
+
separator: string;
|
|
31
32
|
required: boolean;
|
|
32
33
|
help: string | null;
|
|
33
|
-
separator: string;
|
|
34
34
|
suggestions: string[];
|
|
35
35
|
suggestionsByGroup: SuggestionGroup[];
|
|
36
36
|
maxItems: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -34,8 +34,8 @@ declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
34
34
|
upload: PickerUpload | null;
|
|
35
35
|
multiple: boolean;
|
|
36
36
|
perPage: number;
|
|
37
|
+
selected: PickerItem[];
|
|
37
38
|
maxItems: number | null;
|
|
38
39
|
availableFilters: FilterDef[];
|
|
39
|
-
selected: PickerItem[];
|
|
40
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
41
|
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SelectValue } from '@dskripchenko/ui';
|
|
2
|
+
/**
|
|
3
|
+
* The value of a single-value UidSelect. Since kit 1.5 its update event is
|
|
4
|
+
* typed for the multiple mode too (`SelectValue | SelectValue[] | null`),
|
|
5
|
+
* whatever `multiple` is; a select without `multiple` never emits a list, so
|
|
6
|
+
* a list is read as its first value.
|
|
7
|
+
*/
|
|
8
|
+
export declare function singleSelectValue(next: SelectValue | SelectValue[] | null | undefined): SelectValue | null;
|
|
@@ -3,8 +3,10 @@ interface Props {
|
|
|
3
3
|
items: LayoutNode[];
|
|
4
4
|
title?: string | null;
|
|
5
5
|
description?: string | null;
|
|
6
|
+
icon?: string | null;
|
|
6
7
|
}
|
|
7
8
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
icon: string | null;
|
|
8
10
|
title: string | null;
|
|
9
11
|
description: string | null;
|
|
10
12
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a stored notification reads: its title, body, tone and icon.
|
|
3
|
+
*
|
|
4
|
+
* AdminNotification stores {title, body, level, url, icon}; a notification of
|
|
5
|
+
* the host's own may carry `subject`, `message`, `description` or `text`
|
|
6
|
+
* instead, and a type name (its FQCN) is the last hint at its tone.
|
|
7
|
+
*/
|
|
8
|
+
import type { Component } from 'vue';
|
|
9
|
+
import type { NotificationItem } from '../../stores/notifications';
|
|
10
|
+
export type NotificationTone = 'success' | 'info' | 'warning' | 'danger' | 'neutral';
|
|
11
|
+
export declare function notificationTitle(item: NotificationItem, fallback: string): string;
|
|
12
|
+
export declare function notificationBody(item: NotificationItem): string;
|
|
13
|
+
/** The tone: the level AdminNotification stores, else a guess from the type. */
|
|
14
|
+
export declare function notificationTone(item: NotificationItem): NotificationTone;
|
|
15
|
+
/** The icon: the one the notification names, else one for its kind or tone. */
|
|
16
|
+
export declare function notificationIcon(item: NotificationItem): Component;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,6 +5,10 @@ interface ColumnDef {
|
|
|
5
5
|
label?: string;
|
|
6
6
|
groupable?: boolean;
|
|
7
7
|
hidden?: boolean;
|
|
8
|
+
/** TableColumn::defaultHidden(): off until switched on. */
|
|
9
|
+
defaultHidden?: boolean;
|
|
10
|
+
/** TableColumn::cantHide(): always shown, the switch is locked. */
|
|
11
|
+
cantHide?: boolean;
|
|
8
12
|
}
|
|
9
13
|
interface Props {
|
|
10
14
|
search: string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CellMeta } from './cellFormat';
|
|
2
|
+
interface Props {
|
|
3
|
+
value?: unknown;
|
|
4
|
+
preset?: string | null;
|
|
5
|
+
meta?: CellMeta | null;
|
|
6
|
+
row?: Record<string, unknown> | null;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
value: undefined;
|
|
10
|
+
meta: CellMeta | null;
|
|
11
|
+
row: Record<string, unknown> | null;
|
|
12
|
+
preset: string | null;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
export default _default;
|
|
@@ -19,12 +19,12 @@ interface Props {
|
|
|
19
19
|
/** The prefix of the UID label next to the status: 'A-' gives 'A-1284'. */
|
|
20
20
|
uidPrefix?: string;
|
|
21
21
|
}
|
|
22
|
-
declare var
|
|
22
|
+
declare var __VLS_70: {
|
|
23
23
|
record: Record<string, unknown>;
|
|
24
24
|
resource: import("../..").ManifestResourceMeta | null;
|
|
25
25
|
};
|
|
26
26
|
type __VLS_Slots = {} & {
|
|
27
|
-
sidebar?: (props: typeof
|
|
27
|
+
sidebar?: (props: typeof __VLS_70) => any;
|
|
28
28
|
};
|
|
29
29
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
30
30
|
indexRouteName: string | null;
|
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
* - badge → the label from meta.labels (TableColumn::asBadge), or the
|
|
11
11
|
* value as it is; the tone comes from badgeTone().
|
|
12
12
|
* - bytes → a human-readable size.
|
|
13
|
+
* - image → the URL; AdminTableCell draws the picture.
|
|
14
|
+
* - link → the caption; AdminTableCell draws the link.
|
|
13
15
|
* - text → the fallback.
|
|
14
16
|
*
|
|
15
17
|
* Columns with no explicit preset are formatted automatically: a value that
|
|
16
18
|
* looks like an ISO datetime — the column ends in `_at`, or the string carries
|
|
17
19
|
* T...Z — gets the default datetime format.
|
|
18
20
|
*/
|
|
19
|
-
export type CellPreset = 'text' | 'date' | 'datetime' | 'money' | 'boolean' | 'badge' | 'bytes';
|
|
21
|
+
export type CellPreset = 'text' | 'date' | 'datetime' | 'money' | 'boolean' | 'badge' | 'bytes' | 'image' | 'link';
|
|
20
22
|
export interface CellMeta {
|
|
21
23
|
format?: string;
|
|
22
24
|
currency?: string;
|
|
@@ -31,17 +33,31 @@ export type BadgeTone = 'info' | 'success' | 'warning' | 'danger' | 'default';
|
|
|
31
33
|
export declare function badgeTone(value: unknown, meta?: CellMeta): BadgeTone;
|
|
32
34
|
/** The badge caption of a value: meta.labels, or the value itself. */
|
|
33
35
|
export declare function badgeLabel(value: unknown, meta?: CellMeta): string;
|
|
34
|
-
/** Where formatTableRows keeps the raw row next to the formatted one. */
|
|
35
|
-
export declare const RAW_ROW: unique symbol;
|
|
36
|
-
export interface TableColumnLike {
|
|
37
|
-
name: string;
|
|
38
|
-
preset?: string | null;
|
|
39
|
-
meta?: CellMeta;
|
|
40
|
-
}
|
|
41
36
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
37
|
+
* The href of a link column (TableColumn::asLink): `{field}` stands for a
|
|
38
|
+
* field of the row, `:value` for the cell's own value. Empty when a field is
|
|
39
|
+
* missing or null — then the cell stays plain text.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveLinkHref(template: string | null | undefined, row: Record<string, unknown>, value: unknown): string;
|
|
42
|
+
/**
|
|
43
|
+
* Reads a date the way the backend sends it. A bare 'Y-m-d' is a calendar
|
|
44
|
+
* date, taken in local time — `new Date('2026-10-01')` would read it as UTC
|
|
45
|
+
* midnight and show the day before west of Greenwich. 'Y-m-d H:i:s' gets its
|
|
46
|
+
* 'T', which not every engine adds by itself; an ISO string with an offset
|
|
47
|
+
* or a 'Z' is converted to local time.
|
|
48
|
+
*/
|
|
49
|
+
export declare function parseDateValue(input: string): Date | null;
|
|
50
|
+
/**
|
|
51
|
+
* Formats a date by a PHP date() format string — every token of PHP's
|
|
52
|
+
* date(), with the names of months and days in the panel's language:
|
|
53
|
+
*
|
|
54
|
+
* day d j D l N S w z week W
|
|
55
|
+
* month F m M n t year L o Y y
|
|
56
|
+
* time a A B g G h H i s u v
|
|
57
|
+
* zone e I O P p T Z full c r U
|
|
58
|
+
*
|
|
59
|
+
* F before or after a day number takes the form a date reads with, which in
|
|
60
|
+
* Russian is the genitive: «1 октября», not «1 октябрь». A backslash escapes
|
|
61
|
+
* the next character, as in PHP.
|
|
44
62
|
*/
|
|
45
|
-
export declare function
|
|
46
|
-
/** The tone of a badge cell of a row made by formatTableRows. */
|
|
47
|
-
export declare function rowBadgeTone(row: unknown, column: TableColumnLike): BadgeTone;
|
|
63
|
+
export declare function formatPhpDate(date: Date, format: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type RouteLocationRaw } from 'vue-router';
|
|
1
2
|
interface Crumb {
|
|
2
3
|
label: string;
|
|
3
|
-
|
|
4
|
+
/** A router location, or a path within the panel. */
|
|
5
|
+
to?: RouteLocationRaw | null;
|
|
4
6
|
}
|
|
5
7
|
interface Props {
|
|
6
8
|
/** The breadcrumbs. The last one is the current page and carries no `to`. */
|
|
@@ -8,13 +10,13 @@ interface Props {
|
|
|
8
10
|
/** Whether to show the sidebar's collapse button; only inside the shell layout. */
|
|
9
11
|
showCollapseToggle?: boolean;
|
|
10
12
|
}
|
|
11
|
-
declare var __VLS_5: {},
|
|
13
|
+
declare var __VLS_5: {}, __VLS_15: {}, __VLS_21: {};
|
|
12
14
|
type __VLS_Slots = {} & {
|
|
13
15
|
breadcrumbs?: (props: typeof __VLS_5) => any;
|
|
14
16
|
} & {
|
|
15
|
-
search?: (props: typeof
|
|
17
|
+
search?: (props: typeof __VLS_15) => any;
|
|
16
18
|
} & {
|
|
17
|
-
actions?: (props: typeof
|
|
19
|
+
actions?: (props: typeof __VLS_21) => any;
|
|
18
20
|
};
|
|
19
21
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
22
|
"toggle-sidebar": () => any;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The top bar's breadcrumbs, derived from where the visitor is.
|
|
3
|
+
*
|
|
4
|
+
* The trail is the sidebar's: the menu item that matches the route — the way
|
|
5
|
+
* AdminSidebarNode marks its active item — preceded by its group and its
|
|
6
|
+
* parent items. A resource route adds what lies below the list: the record
|
|
7
|
+
* (named by its title, name or label, else #id) and "Editing" or "Creating".
|
|
8
|
+
* A page the menu does not hold is named by its own title.
|
|
9
|
+
*
|
|
10
|
+
* The last crumb is the current page and carries no link.
|
|
11
|
+
*/
|
|
12
|
+
import { type ComputedRef } from 'vue';
|
|
13
|
+
import { type RouteLocationRaw } from 'vue-router';
|
|
14
|
+
import { type MenuItem } from '../../stores/menu';
|
|
15
|
+
export interface Crumb {
|
|
16
|
+
label: string;
|
|
17
|
+
to?: RouteLocationRaw | null;
|
|
18
|
+
}
|
|
19
|
+
interface RouteLike {
|
|
20
|
+
name?: unknown;
|
|
21
|
+
path: string;
|
|
22
|
+
params: Record<string, unknown>;
|
|
23
|
+
meta: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
/** How well a menu item matches the route: 0 is no match, an exact one beats a prefix. */
|
|
26
|
+
export declare function menuMatchScore(item: MenuItem, route: RouteLike): number;
|
|
27
|
+
/**
|
|
28
|
+
* The best-matching menu item with the chain of its parents, outermost first.
|
|
29
|
+
* When several items lead to the same page, the shallowest one wins, then the
|
|
30
|
+
* first in menu order.
|
|
31
|
+
*/
|
|
32
|
+
export declare function findMenuTrail(items: MenuItem[], route: RouteLike): MenuItem[];
|
|
33
|
+
export declare function useBreadcrumbs(): ComputedRef<Crumb[]>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const m=require("pinia"),i=require("vue");function v(e){try{return u().tr(e)}catch{return e}}function S(){if(typeof document<"u"&&document.documentElement.lang)return document.documentElement.lang;try{const e=u().locale;if(e)return e}catch{}return"ru"}const u=m.defineStore("admin-i18n",()=>{const e=i.ref({}),n=i.ref("ru");function r(t){const c=t.translations;c&&typeof c=="object"&&(e.value={...c}),n.value=t.locale??"ru"}function o(t){e.value={...t}}function a(t,c={}){let s=e.value[t]??t;for(const[d,g]of Object.entries(c))s=s.replace(new RegExp(`:${d}`,"g"),String(g));return s}const l=t=>t in e.value;function f(t){return e.value[t]??t}return{messages:e,locale:n,hydrate:r,setMessages:o,t:a,tr:f,has:l,keys:i.computed(()=>Object.keys(e.value))}});function p(e,n){try{return u().t(e,n??{})}catch{let r=e;for(const[o,a]of Object.entries(n??{}))r=r.replace(new RegExp(`:${o}`,"g"),String(a));return r}}exports.currentLocale=S;exports.tRaw=p;exports.trSafe=v;exports.useI18nStore=u;
|
|
2
|
+
//# sourceMappingURL=i18n-BxCQCcGB.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-BxCQCcGB.cjs","sources":["../resources/ts/stores/i18n.ts"],"sourcesContent":["/**\n * The i18n store — a plain message bag plus the t() helper.\n *\n * The backend puts the bag into `bootstrap.translations`, a\n * Record<key, string>. When the locale changes (`/system/setLocale`) either\n * the bootstrap is raised again or the helper calls `loadLocale(locale)`,\n * which POSTs for the messages.\n *\n * The form:\n * t('admin.dashboard.add_widget') // 'Add widget'\n * t('admin.records.count', { n: 42 }) // 'Records: 42', interpolating :n\n *\n * The fallback: a key that is not found is returned as it is, which makes\n * missing translations easy to spot during development.\n */\nimport { defineStore } from 'pinia'\nimport { computed, ref } from 'vue'\nimport type { AdminBootstrap } from '../types/bootstrap'\n\n/**\n * A standalone wrapper around store.tr() for the components: it does not fall\n * over without an active Pinia (unit tests, SSR edges) and returns the source\n * string instead.\n */\nexport function trSafe(text: string): string {\n try {\n return useI18nStore().tr(text)\n } catch {\n return text\n }\n}\n\n/**\n * The panel's current language, for formatting — month names, numbers: the\n * document's lang, else the bootstrap locale, else Russian, the source\n * language.\n */\nexport function currentLocale(): string {\n // The locale store keeps <html lang> in step with a switch made in place.\n if (typeof document !== 'undefined' && document.documentElement.lang) {\n return document.documentElement.lang\n }\n try {\n const locale = useI18nStore().locale\n if (locale) return locale\n } catch {\n // no active Pinia\n }\n return 'ru'\n}\n\nexport const useI18nStore = defineStore('admin-i18n', () => {\n const messages = ref<Record<string, string>>({})\n const locale = ref<string>('ru')\n\n function hydrate(bootstrap: AdminBootstrap): void {\n // The backend may put the translations into the bootstrap.\n const t = (bootstrap as unknown as { translations?: Record<string, string> }).translations\n if (t && typeof t === 'object') {\n messages.value = { ...t }\n }\n locale.value = bootstrap.locale ?? 'ru'\n }\n\n function setMessages(next: Record<string, string>): void {\n messages.value = { ...next }\n }\n\n /**\n * Translates, supporting Laravel-style `:name` interpolation. A missing key\n * is returned as it is, which makes the gap visible.\n */\n function t(key: string, replace: Record<string, string | number> = {}): string {\n let str = messages.value[key] ?? key\n for (const [k, v] of Object.entries(replace)) {\n str = str.replace(new RegExp(`:${k}`, 'g'), String(v))\n }\n return str\n }\n\n const has = (key: string): boolean => key in messages.value\n\n /**\n * Translates by a string key, JSON-style, where the key is the source string\n * in the development language. The backend mixes the current locale's JSON\n * translations — the host's lang/{locale}.json — into the bag. Without a\n * translation the string comes back untouched, with no interpolation.\n */\n function tr(text: string): string {\n return messages.value[text] ?? text\n }\n\n return {\n messages,\n locale,\n hydrate,\n setMessages,\n t,\n tr,\n has,\n keys: computed(() => Object.keys(messages.value)),\n }\n})\n\n/**\n * A convenience: the global t() for non-Vue contexts — utilities, services. In\n * a Vue component prefer `const { t } = useI18nStore()`.\n */\nexport function tRaw(key: string, replace?: Record<string, string | number>): string {\n try {\n return useI18nStore().t(key, replace ?? {})\n } catch {\n // Without an active Pinia — unit tests, a render before the\n // initialization — we return the source string with the values\n // substituted. This used to throw and take the whole component down: an\n // untranslated string beats an empty page.\n let str = key\n for (const [k, v] of Object.entries(replace ?? {})) {\n str = str.replace(new RegExp(`:${k}`, 'g'), String(v))\n }\n\n return str\n }\n}\n"],"names":["trSafe","text","useI18nStore","currentLocale","locale","defineStore","messages","ref","hydrate","bootstrap","t","setMessages","next","key","replace","str","k","v","has","tr","computed","tRaw"],"mappings":"uDAwBO,SAASA,EAAOC,EAAsB,CAC3C,GAAI,CACF,OAAOC,EAAA,EAAe,GAAGD,CAAI,CAC/B,MAAQ,CACN,OAAOA,CACT,CACF,CAOO,SAASE,GAAwB,CAEtC,GAAI,OAAO,SAAa,KAAe,SAAS,gBAAgB,KAC9D,OAAO,SAAS,gBAAgB,KAElC,GAAI,CACF,MAAMC,EAASF,IAAe,OAC9B,GAAIE,EAAQ,OAAOA,CACrB,MAAQ,CAER,CACA,MAAO,IACT,CAEO,MAAMF,EAAeG,EAAAA,YAAY,aAAc,IAAM,CAC1D,MAAMC,EAAWC,EAAAA,IAA4B,EAAE,EACzCH,EAASG,EAAAA,IAAY,IAAI,EAE/B,SAASC,EAAQC,EAAiC,CAEhD,MAAMC,EAAKD,EAAmE,aAC1EC,GAAK,OAAOA,GAAM,WACpBJ,EAAS,MAAQ,CAAE,GAAGI,CAAAA,GAExBN,EAAO,MAAQK,EAAU,QAAU,IACrC,CAEA,SAASE,EAAYC,EAAoC,CACvDN,EAAS,MAAQ,CAAE,GAAGM,CAAA,CACxB,CAMA,SAASF,EAAEG,EAAaC,EAA2C,GAAY,CAC7E,IAAIC,EAAMT,EAAS,MAAMO,CAAG,GAAKA,EACjC,SAAW,CAACG,EAAGC,CAAC,IAAK,OAAO,QAAQH,CAAO,EACzCC,EAAMA,EAAI,QAAQ,IAAI,OAAO,IAAIC,CAAC,GAAI,GAAG,EAAG,OAAOC,CAAC,CAAC,EAEvD,OAAOF,CACT,CAEA,MAAMG,EAAOL,GAAyBA,KAAOP,EAAS,MAQtD,SAASa,EAAGlB,EAAsB,CAChC,OAAOK,EAAS,MAAML,CAAI,GAAKA,CACjC,CAEA,MAAO,CACL,SAAAK,EACA,OAAAF,EACA,QAAAI,EACA,YAAAG,EACA,EAAAD,EACA,GAAAS,EACA,IAAAD,EACA,KAAME,EAAAA,SAAS,IAAM,OAAO,KAAKd,EAAS,KAAK,CAAC,CAAA,CAEpD,CAAC,EAMM,SAASe,EAAKR,EAAaC,EAAmD,CACnF,GAAI,CACF,OAAOZ,IAAe,EAAEW,EAAKC,GAAW,CAAA,CAAE,CAC5C,MAAQ,CAKN,IAAIC,EAAMF,EACV,SAAW,CAACG,EAAGC,CAAC,IAAK,OAAO,QAAQH,GAAW,CAAA,CAAE,EAC/CC,EAAMA,EAAI,QAAQ,IAAI,OAAO,IAAIC,CAAC,GAAI,GAAG,EAAG,OAAOC,CAAC,CAAC,EAGvD,OAAOF,CACT,CACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineStore as g } from "pinia";
|
|
2
|
+
import { ref as l, computed as v } from "vue";
|
|
3
|
+
function h(e) {
|
|
4
|
+
try {
|
|
5
|
+
return s().tr(e);
|
|
6
|
+
} catch {
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function S() {
|
|
11
|
+
if (typeof document < "u" && document.documentElement.lang)
|
|
12
|
+
return document.documentElement.lang;
|
|
13
|
+
try {
|
|
14
|
+
const e = s().locale;
|
|
15
|
+
if (e) return e;
|
|
16
|
+
} catch {
|
|
17
|
+
}
|
|
18
|
+
return "ru";
|
|
19
|
+
}
|
|
20
|
+
const s = g("admin-i18n", () => {
|
|
21
|
+
const e = l({}), n = l("ru");
|
|
22
|
+
function r(t) {
|
|
23
|
+
const c = t.translations;
|
|
24
|
+
c && typeof c == "object" && (e.value = { ...c }), n.value = t.locale ?? "ru";
|
|
25
|
+
}
|
|
26
|
+
function o(t) {
|
|
27
|
+
e.value = { ...t };
|
|
28
|
+
}
|
|
29
|
+
function u(t, c = {}) {
|
|
30
|
+
let a = e.value[t] ?? t;
|
|
31
|
+
for (const [m, d] of Object.entries(c))
|
|
32
|
+
a = a.replace(new RegExp(`:${m}`, "g"), String(d));
|
|
33
|
+
return a;
|
|
34
|
+
}
|
|
35
|
+
const f = (t) => t in e.value;
|
|
36
|
+
function i(t) {
|
|
37
|
+
return e.value[t] ?? t;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
messages: e,
|
|
41
|
+
locale: n,
|
|
42
|
+
hydrate: r,
|
|
43
|
+
setMessages: o,
|
|
44
|
+
t: u,
|
|
45
|
+
tr: i,
|
|
46
|
+
has: f,
|
|
47
|
+
keys: v(() => Object.keys(e.value))
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
function j(e, n) {
|
|
51
|
+
try {
|
|
52
|
+
return s().t(e, n ?? {});
|
|
53
|
+
} catch {
|
|
54
|
+
let r = e;
|
|
55
|
+
for (const [o, u] of Object.entries(n ?? {}))
|
|
56
|
+
r = r.replace(new RegExp(`:${o}`, "g"), String(u));
|
|
57
|
+
return r;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
j as a,
|
|
62
|
+
S as c,
|
|
63
|
+
h as t,
|
|
64
|
+
s as u
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=i18n-Vgxu-A6P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n-Vgxu-A6P.js","sources":["../resources/ts/stores/i18n.ts"],"sourcesContent":["/**\n * The i18n store — a plain message bag plus the t() helper.\n *\n * The backend puts the bag into `bootstrap.translations`, a\n * Record<key, string>. When the locale changes (`/system/setLocale`) either\n * the bootstrap is raised again or the helper calls `loadLocale(locale)`,\n * which POSTs for the messages.\n *\n * The form:\n * t('admin.dashboard.add_widget') // 'Add widget'\n * t('admin.records.count', { n: 42 }) // 'Records: 42', interpolating :n\n *\n * The fallback: a key that is not found is returned as it is, which makes\n * missing translations easy to spot during development.\n */\nimport { defineStore } from 'pinia'\nimport { computed, ref } from 'vue'\nimport type { AdminBootstrap } from '../types/bootstrap'\n\n/**\n * A standalone wrapper around store.tr() for the components: it does not fall\n * over without an active Pinia (unit tests, SSR edges) and returns the source\n * string instead.\n */\nexport function trSafe(text: string): string {\n try {\n return useI18nStore().tr(text)\n } catch {\n return text\n }\n}\n\n/**\n * The panel's current language, for formatting — month names, numbers: the\n * document's lang, else the bootstrap locale, else Russian, the source\n * language.\n */\nexport function currentLocale(): string {\n // The locale store keeps <html lang> in step with a switch made in place.\n if (typeof document !== 'undefined' && document.documentElement.lang) {\n return document.documentElement.lang\n }\n try {\n const locale = useI18nStore().locale\n if (locale) return locale\n } catch {\n // no active Pinia\n }\n return 'ru'\n}\n\nexport const useI18nStore = defineStore('admin-i18n', () => {\n const messages = ref<Record<string, string>>({})\n const locale = ref<string>('ru')\n\n function hydrate(bootstrap: AdminBootstrap): void {\n // The backend may put the translations into the bootstrap.\n const t = (bootstrap as unknown as { translations?: Record<string, string> }).translations\n if (t && typeof t === 'object') {\n messages.value = { ...t }\n }\n locale.value = bootstrap.locale ?? 'ru'\n }\n\n function setMessages(next: Record<string, string>): void {\n messages.value = { ...next }\n }\n\n /**\n * Translates, supporting Laravel-style `:name` interpolation. A missing key\n * is returned as it is, which makes the gap visible.\n */\n function t(key: string, replace: Record<string, string | number> = {}): string {\n let str = messages.value[key] ?? key\n for (const [k, v] of Object.entries(replace)) {\n str = str.replace(new RegExp(`:${k}`, 'g'), String(v))\n }\n return str\n }\n\n const has = (key: string): boolean => key in messages.value\n\n /**\n * Translates by a string key, JSON-style, where the key is the source string\n * in the development language. The backend mixes the current locale's JSON\n * translations — the host's lang/{locale}.json — into the bag. Without a\n * translation the string comes back untouched, with no interpolation.\n */\n function tr(text: string): string {\n return messages.value[text] ?? text\n }\n\n return {\n messages,\n locale,\n hydrate,\n setMessages,\n t,\n tr,\n has,\n keys: computed(() => Object.keys(messages.value)),\n }\n})\n\n/**\n * A convenience: the global t() for non-Vue contexts — utilities, services. In\n * a Vue component prefer `const { t } = useI18nStore()`.\n */\nexport function tRaw(key: string, replace?: Record<string, string | number>): string {\n try {\n return useI18nStore().t(key, replace ?? {})\n } catch {\n // Without an active Pinia — unit tests, a render before the\n // initialization — we return the source string with the values\n // substituted. This used to throw and take the whole component down: an\n // untranslated string beats an empty page.\n let str = key\n for (const [k, v] of Object.entries(replace ?? {})) {\n str = str.replace(new RegExp(`:${k}`, 'g'), String(v))\n }\n\n return str\n }\n}\n"],"names":["trSafe","text","useI18nStore","currentLocale","locale","defineStore","messages","ref","hydrate","bootstrap","t","setMessages","next","key","replace","str","k","v","has","tr","computed","tRaw"],"mappings":";;AAwBO,SAASA,EAAOC,GAAsB;AAC3C,MAAI;AACF,WAAOC,EAAA,EAAe,GAAGD,CAAI;AAAA,EAC/B,QAAQ;AACN,WAAOA;AAAA,EACT;AACF;AAOO,SAASE,IAAwB;AAEtC,MAAI,OAAO,WAAa,OAAe,SAAS,gBAAgB;AAC9D,WAAO,SAAS,gBAAgB;AAElC,MAAI;AACF,UAAMC,IAASF,IAAe;AAC9B,QAAIE,EAAQ,QAAOA;AAAA,EACrB,QAAQ;AAAA,EAER;AACA,SAAO;AACT;AAEO,MAAMF,IAAeG,EAAY,cAAc,MAAM;AAC1D,QAAMC,IAAWC,EAA4B,EAAE,GACzCH,IAASG,EAAY,IAAI;AAE/B,WAASC,EAAQC,GAAiC;AAEhD,UAAMC,IAAKD,EAAmE;AAC9E,IAAIC,KAAK,OAAOA,KAAM,aACpBJ,EAAS,QAAQ,EAAE,GAAGI,EAAAA,IAExBN,EAAO,QAAQK,EAAU,UAAU;AAAA,EACrC;AAEA,WAASE,EAAYC,GAAoC;AACvD,IAAAN,EAAS,QAAQ,EAAE,GAAGM,EAAA;AAAA,EACxB;AAMA,WAASF,EAAEG,GAAaC,IAA2C,IAAY;AAC7E,QAAIC,IAAMT,EAAS,MAAMO,CAAG,KAAKA;AACjC,eAAW,CAACG,GAAGC,CAAC,KAAK,OAAO,QAAQH,CAAO;AACzC,MAAAC,IAAMA,EAAI,QAAQ,IAAI,OAAO,IAAIC,CAAC,IAAI,GAAG,GAAG,OAAOC,CAAC,CAAC;AAEvD,WAAOF;AAAA,EACT;AAEA,QAAMG,IAAM,CAACL,MAAyBA,KAAOP,EAAS;AAQtD,WAASa,EAAGlB,GAAsB;AAChC,WAAOK,EAAS,MAAML,CAAI,KAAKA;AAAA,EACjC;AAEA,SAAO;AAAA,IACL,UAAAK;AAAA,IACA,QAAAF;AAAA,IACA,SAAAI;AAAA,IACA,aAAAG;AAAA,IACA,GAAAD;AAAA,IACA,IAAAS;AAAA,IACA,KAAAD;AAAA,IACA,MAAME,EAAS,MAAM,OAAO,KAAKd,EAAS,KAAK,CAAC;AAAA,EAAA;AAEpD,CAAC;AAMM,SAASe,EAAKR,GAAaC,GAAmD;AACnF,MAAI;AACF,WAAOZ,IAAe,EAAEW,GAAKC,KAAW,CAAA,CAAE;AAAA,EAC5C,QAAQ;AAKN,QAAIC,IAAMF;AACV,eAAW,CAACG,GAAGC,CAAC,KAAK,OAAO,QAAQH,KAAW,CAAA,CAAE;AAC/C,MAAAC,IAAMA,EAAI,QAAQ,IAAI,OAAO,IAAIC,CAAC,IAAI,GAAG,GAAG,OAAOC,CAAC,CAAC;AAGvD,WAAOF;AAAA,EACT;AACF;"}
|