quasar-ui-danx 0.4.28 → 0.4.30
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +35 -35
- package/dist/danx.es.js +2972 -2855
- package/dist/danx.es.js.map +1 -1
- package/dist/danx.umd.js +48 -48
- package/dist/danx.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/ActionTable/Form/Fields/EditableDiv.vue +55 -17
- package/src/components/ActionTable/Form/Fields/TextField.vue +2 -0
- package/src/components/ActionTable/Form/RenderedForm.vue +7 -20
- package/src/components/ActionTable/Form/Utilities/MaxLengthCounter.vue +1 -1
- package/src/components/ActionTable/Form/Utilities/SaveStateIndicator.vue +37 -0
- package/src/components/ActionTable/Form/Utilities/index.ts +1 -0
- package/src/components/ActionTable/Layouts/ActionTableLayout.vue +3 -3
- package/src/components/ActionTable/{listControls.ts → controls.ts} +11 -7
- package/src/components/ActionTable/index.ts +1 -1
- package/src/components/DragAndDrop/ListItemDraggable.vue +8 -4
- package/src/components/DragAndDrop/dragAndDrop.ts +2 -1
- package/src/components/DragAndDrop/listDragAndDrop.ts +19 -6
- package/src/helpers/FileUpload.ts +4 -4
- package/src/helpers/files.ts +56 -43
- package/src/types/actions.d.ts +45 -27
- package/src/types/controls.d.ts +22 -41
- package/src/types/fields.d.ts +1 -0
- package/src/types/files.d.ts +2 -2
- package/src/types/index.d.ts +5 -0
- package/src/types/shared.d.ts +9 -0
- package/src/types/tables.d.ts +3 -3
package/src/types/controls.d.ts
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
import { ComputedRef, Ref, ShallowRef } from "vue";
|
4
|
-
import { ActionOptions, ActionPanel, ActionTargetItem, ResourceAction } from "./actions";
|
5
|
-
import { AnyObject, LabelValueItem } from "./shared";
|
1
|
+
import { ActionOptions, ActionTargetItem, ResourceAction } from "./actions";
|
2
|
+
import { AnyObject, ComputedRef, LabelValueItem, Ref } from "./shared";
|
6
3
|
|
7
4
|
export interface ListControlsFilter {
|
8
5
|
[key: string]: object | object[] | null | undefined | string | number | boolean;
|
@@ -22,24 +19,24 @@ export interface FilterGroup {
|
|
22
19
|
fields: FilterableField[];
|
23
20
|
}
|
24
21
|
|
25
|
-
export interface ListControlsRoutes {
|
26
|
-
list(pager?: ListControlsPagination): Promise<
|
22
|
+
export interface ListControlsRoutes<T = ActionTargetItem> {
|
23
|
+
list(pager?: ListControlsPagination): Promise<T[]>;
|
27
24
|
|
28
25
|
summary?(filter?: ListControlsFilter): Promise<AnyObject>;
|
29
26
|
|
30
|
-
details?(target:
|
27
|
+
details?(target: T): Promise<T>;
|
31
28
|
|
32
|
-
detailsAndStore?(target:
|
29
|
+
detailsAndStore?(target: T): Promise<T>;
|
33
30
|
|
34
|
-
relation?(target:
|
31
|
+
relation?(target: T, relation: string): Promise<T>;
|
35
32
|
|
36
|
-
more?(pager: ListControlsPagination): Promise<
|
33
|
+
more?(pager: ListControlsPagination): Promise<T[]>;
|
37
34
|
|
38
35
|
fieldOptions?(filter?: AnyObject): Promise<AnyObject>;
|
39
36
|
|
40
|
-
applyAction?(action: string | ResourceAction | ActionOptions, target:
|
37
|
+
applyAction?(action: string | ResourceAction | ActionOptions, target: T | null, data?: object): Promise<AnyObject>;
|
41
38
|
|
42
|
-
batchAction?(action: string | ResourceAction | ActionOptions, targets:
|
39
|
+
batchAction?(action: string | ResourceAction | ActionOptions, targets: T[], data: object): Promise<AnyObject>;
|
43
40
|
|
44
41
|
export?(filter?: ListControlsFilter, name?: string): Promise<void>;
|
45
42
|
}
|
@@ -63,24 +60,24 @@ export interface ListControlsPagination {
|
|
63
60
|
filter?: ListControlsFilter;
|
64
61
|
}
|
65
62
|
|
66
|
-
export interface PagedItems {
|
67
|
-
data:
|
63
|
+
export interface PagedItems<T = ActionTargetItem> {
|
64
|
+
data: T[] | undefined;
|
68
65
|
meta: {
|
69
66
|
total: number;
|
70
67
|
last_page?: number;
|
71
68
|
} | undefined;
|
72
69
|
}
|
73
70
|
|
74
|
-
export interface ListController {
|
71
|
+
export interface ListController<T = ActionTargetItem> {
|
75
72
|
name: string;
|
76
73
|
label: string;
|
77
|
-
pagedItems: Ref<PagedItems | null>;
|
74
|
+
pagedItems: Ref<PagedItems<T> | null>;
|
78
75
|
activeFilter: Ref<ListControlsFilter>;
|
79
76
|
globalFilter: Ref<ListControlsFilter>;
|
80
77
|
filterActiveCount: ComputedRef<number>;
|
81
78
|
showFilters: Ref<boolean>;
|
82
|
-
summary:
|
83
|
-
selectedRows:
|
79
|
+
summary: Ref<object | null>;
|
80
|
+
selectedRows: Ref<T[]>;
|
84
81
|
isLoadingList: Ref<boolean>;
|
85
82
|
isLoadingFilters: Ref<boolean>;
|
86
83
|
isLoadingSummary: Ref<boolean>;
|
@@ -90,15 +87,15 @@ export interface ListController {
|
|
90
87
|
filter: ListControlsFilter;
|
91
88
|
sort: object[] | undefined;
|
92
89
|
}>;
|
93
|
-
pagination:
|
94
|
-
activeItem:
|
95
|
-
activePanel:
|
90
|
+
pagination: Ref<ListControlsPagination>;
|
91
|
+
activeItem: Ref<T | null>;
|
92
|
+
activePanel: Ref<string | null>;
|
96
93
|
|
97
94
|
// List Controls
|
98
95
|
initialize: () => void;
|
99
96
|
resetPaging: () => void;
|
100
97
|
setPagination: (updated: Partial<ListControlsPagination>) => void;
|
101
|
-
setSelectedRows: (selection:
|
98
|
+
setSelectedRows: (selection: T[]) => void;
|
102
99
|
clearSelectedRows: () => void;
|
103
100
|
loadList: (filter?: ListControlsFilter) => Promise<void>;
|
104
101
|
loadSummary: (filter?: ListControlsFilter) => Promise<void>;
|
@@ -108,26 +105,10 @@ export interface ListController {
|
|
108
105
|
getActiveItemDetails: () => Promise<void>;
|
109
106
|
refreshAll: () => Promise<void[]>;
|
110
107
|
exportList: (filter?: ListControlsFilter) => Promise<void>;
|
111
|
-
setActiveItem: (item:
|
108
|
+
setActiveItem: (item: T | null) => void;
|
112
109
|
getNextItem: (offset: number) => Promise<void>;
|
113
|
-
activatePanel: (item:
|
110
|
+
activatePanel: (item: T | null, panel: string) => void;
|
114
111
|
setActiveFilter: (filter?: ListControlsFilter) => void;
|
115
112
|
applyFilterFromUrl: (url: string, filters?: Ref<FilterGroup[]> | null) => void;
|
116
113
|
getFieldOptions: (field: string) => any[];
|
117
114
|
}
|
118
|
-
|
119
|
-
export interface ActionController {
|
120
|
-
// Actions
|
121
|
-
action?: (actionName: string, target?: ActionTargetItem | null, input?: any) => Promise<any | void>;
|
122
|
-
getAction?: (actionName: string, actionOptions?: Partial<ActionOptions>) => ResourceAction;
|
123
|
-
getActions?: (names?: string[]) => ResourceAction[];
|
124
|
-
extendAction?: (actionName: string, extendedId: string | number, actionOptions: Partial<ActionOptions>) => ResourceAction;
|
125
|
-
modifyAction?: (actionName: string, actionOptions: Partial<ActionOptions>) => ResourceAction;
|
126
|
-
batchActions?: ResourceAction[];
|
127
|
-
menuActions?: ResourceAction[];
|
128
|
-
columns?: TableColumn[];
|
129
|
-
filters?: ComputedRef<FilterGroup[]>;
|
130
|
-
fields?: FormField[];
|
131
|
-
panels?: ActionPanel[];
|
132
|
-
routes?: ListControlsRoutes;
|
133
|
-
}
|
package/src/types/fields.d.ts
CHANGED
package/src/types/files.d.ts
CHANGED
@@ -3,7 +3,7 @@ import { AnyObject, TypedObject } from "src/types/shared";
|
|
3
3
|
export interface FileUploadOptions {
|
4
4
|
directory?: string,
|
5
5
|
createPresignedUpload?: ((path: string, name: string, mime?: string) => Promise<UploadedFile>) | null;
|
6
|
-
completePresignedUpload?: ((fileId: string) => Promise<UploadedFile>) | null;
|
6
|
+
completePresignedUpload?: ((fileId: string, file: XHRFileUpload) => Promise<UploadedFile>) | null;
|
7
7
|
refreshFile?: ((fileId: string) => Promise<UploadedFile>) | null;
|
8
8
|
}
|
9
9
|
|
@@ -25,7 +25,7 @@ export interface UploadedFile extends TypedObject {
|
|
25
25
|
mimeType?: string;
|
26
26
|
mime?: string;
|
27
27
|
progress?: number;
|
28
|
-
location?: string;
|
28
|
+
location?: string | Partial<GeolocationCoordinates> | null;
|
29
29
|
blobUrl?: string;
|
30
30
|
url?: string;
|
31
31
|
thumb?: UploadedFile;
|
package/src/types/index.d.ts
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
import { ActionController, ActionTargetItem } from "./actions";
|
2
|
+
import { ListController } from "./controls";
|
3
|
+
|
1
4
|
export * from "./actions";
|
2
5
|
export * from "./config";
|
3
6
|
export * from "./controls";
|
@@ -9,3 +12,5 @@ export * from "./forms";
|
|
9
12
|
export * from "./requests";
|
10
13
|
export * from "./shared";
|
11
14
|
export * from "./tables";
|
15
|
+
|
16
|
+
export type DanxController<T = ActionTargetItem> = ActionController<T> & ListController<T>;
|
package/src/types/shared.d.ts
CHANGED
@@ -14,3 +14,12 @@ export interface LabelValueItem {
|
|
14
14
|
label: string;
|
15
15
|
value: string | number | boolean;
|
16
16
|
}
|
17
|
+
|
18
|
+
/** Define Vue 3 Types here for better type checking in PHPStorm */
|
19
|
+
export interface Ref<T = any> {
|
20
|
+
value: T;
|
21
|
+
}
|
22
|
+
|
23
|
+
export interface ComputedRef<T = any> {
|
24
|
+
readonly value: T;
|
25
|
+
}
|
package/src/types/tables.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { VNode } from "vue";
|
2
|
-
import { ActionOptions } from "./actions";
|
2
|
+
import { ActionOptions, ActionTargetItem } from "./actions";
|
3
3
|
|
4
|
-
export interface TableColumn {
|
5
|
-
actionMenu?: ActionOptions[];
|
4
|
+
export interface TableColumn<T = ActionTargetItem> {
|
5
|
+
actionMenu?: ActionOptions<T>[];
|
6
6
|
align?: string;
|
7
7
|
category?: string;
|
8
8
|
class?: string | object;
|