@dskripchenko/laravel-admin 1.35.0 → 1.36.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-Ce9-9CTP.js +29 -0
- package/dist/assets/{app-DvKbADye.css → app-w16kkVES.css} +1 -1
- package/dist/components/fields/ResourcePickerField.vue.d.ts +34 -0
- package/dist/components/fields/resourcePicker/PickerItemView.vue.d.ts +9 -0
- package/dist/components/fields/resourcePicker/ResourcePickerDialog.vue.d.ts +41 -0
- package/dist/components/fields/resourcePicker/pickerApi.d.ts +44 -0
- package/dist/components/fields/resourcePicker.test.d.ts +1 -0
- package/dist/components/infolist/ResourcePickerEntry.vue.d.ts +17 -0
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +15301 -14674
- package/dist/index.mjs.map +1 -1
- package/dist/source-hash.txt +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/assets/app-Bt8LixFu.js +0 -29
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type PickerUpload } from './resourcePicker/pickerApi';
|
|
2
|
+
interface Props {
|
|
3
|
+
name: string;
|
|
4
|
+
resource: string;
|
|
5
|
+
label?: string | null;
|
|
6
|
+
help?: string | null;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
maxItems?: number | null;
|
|
12
|
+
filters?: Record<string, unknown> | unknown[];
|
|
13
|
+
perPage?: number;
|
|
14
|
+
layout?: 'grid' | 'list' | null;
|
|
15
|
+
dialogSize?: 'lg' | 'xl' | 'full';
|
|
16
|
+
upload?: PickerUpload | null;
|
|
17
|
+
viewPermission?: string | null;
|
|
18
|
+
}
|
|
19
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
20
|
+
label: string | null;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
filters: Record<string, unknown> | unknown[];
|
|
23
|
+
layout: "grid" | "list" | null;
|
|
24
|
+
upload: PickerUpload | null;
|
|
25
|
+
required: boolean;
|
|
26
|
+
readonly: boolean;
|
|
27
|
+
multiple: boolean;
|
|
28
|
+
perPage: number;
|
|
29
|
+
help: string | null;
|
|
30
|
+
maxItems: number | null;
|
|
31
|
+
dialogSize: "lg" | "xl" | "full";
|
|
32
|
+
viewPermission: string | null;
|
|
33
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PickerItem } from './pickerApi';
|
|
2
|
+
interface Props {
|
|
3
|
+
item: PickerItem;
|
|
4
|
+
variant?: 'tile' | 'row';
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
7
|
+
variant: "tile" | "row";
|
|
8
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { FilterDef } from '../../resource/FilterEditor';
|
|
2
|
+
import { type PickerItem, type PickerUpload } from './pickerApi';
|
|
3
|
+
interface Props {
|
|
4
|
+
open: boolean;
|
|
5
|
+
resource: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
maxItems?: number | null;
|
|
9
|
+
/** Fixed filter values, keyed by the target's filter names. */
|
|
10
|
+
filters?: Record<string, unknown>;
|
|
11
|
+
/** The target's filters from its manifest, for the toolbar. */
|
|
12
|
+
availableFilters?: FilterDef[];
|
|
13
|
+
searchable?: boolean;
|
|
14
|
+
perPage?: number;
|
|
15
|
+
layout?: 'grid' | 'list' | null;
|
|
16
|
+
size?: 'lg' | 'xl' | 'full';
|
|
17
|
+
/** What is picked when the dialog opens. */
|
|
18
|
+
selected?: PickerItem[];
|
|
19
|
+
/** The upload endpoint, when the user may upload. */
|
|
20
|
+
upload?: PickerUpload | null;
|
|
21
|
+
}
|
|
22
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
23
|
+
confirm: (items: PickerItem[]) => any;
|
|
24
|
+
"update:open": (value: boolean) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
26
|
+
onConfirm?: ((items: PickerItem[]) => any) | undefined;
|
|
27
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
size: "lg" | "xl" | "full";
|
|
30
|
+
title: string;
|
|
31
|
+
filters: Record<string, unknown>;
|
|
32
|
+
searchable: boolean;
|
|
33
|
+
layout: "grid" | "list" | null;
|
|
34
|
+
upload: PickerUpload | null;
|
|
35
|
+
multiple: boolean;
|
|
36
|
+
perPage: number;
|
|
37
|
+
maxItems: number | null;
|
|
38
|
+
availableFilters: FilterDef[];
|
|
39
|
+
selected: PickerItem[];
|
|
40
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type PickerKey = string | number;
|
|
2
|
+
export interface PickerItem {
|
|
3
|
+
id: PickerKey;
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle: string | null;
|
|
6
|
+
preview: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface PickerUpload {
|
|
9
|
+
url: string;
|
|
10
|
+
permission?: string | null;
|
|
11
|
+
fileField?: string;
|
|
12
|
+
responseKey?: string | null;
|
|
13
|
+
data?: Record<string, string | number | boolean>;
|
|
14
|
+
accept?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface PickerPage {
|
|
17
|
+
items: PickerItem[];
|
|
18
|
+
total: number;
|
|
19
|
+
page: number;
|
|
20
|
+
lastPage: number;
|
|
21
|
+
}
|
|
22
|
+
export interface PickerQuery {
|
|
23
|
+
page?: number;
|
|
24
|
+
perPage?: number;
|
|
25
|
+
q?: string;
|
|
26
|
+
filters?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
/** Two keys are the same record whether they came as 7 or as '7'. */
|
|
29
|
+
export declare const sameKey: (a: PickerKey, b: PickerKey) => boolean;
|
|
30
|
+
/** The field's value as an ordered list of keys, whatever shape it arrived in. */
|
|
31
|
+
export declare function keysOf(value: unknown): PickerKey[];
|
|
32
|
+
/**
|
|
33
|
+
* A search row as a picker item. `_picker` is what the backend sends; the
|
|
34
|
+
* fallback covers a row without it — a host endpoint, say.
|
|
35
|
+
*/
|
|
36
|
+
export declare function toPickerItem(row: Record<string, unknown>): PickerItem | null;
|
|
37
|
+
export declare function searchPicker(resource: string, query?: PickerQuery): Promise<PickerPage>;
|
|
38
|
+
/** The records behind the given keys. A key the resource no longer lists is simply absent. */
|
|
39
|
+
export declare function fetchPickerItems(resource: string, keys: PickerKey[]): Promise<PickerItem[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Uploads a file to the picker's upload endpoint and returns the new record's
|
|
42
|
+
* key: the response is the record, or holds it under `responseKey`.
|
|
43
|
+
*/
|
|
44
|
+
export declare function uploadForPicker(upload: PickerUpload, file: File): Promise<PickerKey | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
name?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
value?: unknown;
|
|
5
|
+
resource?: string;
|
|
6
|
+
viewPermission?: string | null;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
10
|
+
value: undefined;
|
|
11
|
+
label: string;
|
|
12
|
+
name: string;
|
|
13
|
+
placeholder: string;
|
|
14
|
+
resource: string;
|
|
15
|
+
viewPermission: string | null;
|
|
16
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
export default _default;
|