quasar-ui-danx 0.4.4 → 0.4.6

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.
@@ -1,6 +1,7 @@
1
1
  import { ComputedRef, Ref, ShallowRef } from "vue";
2
+ import { Router } from "vue-router";
2
3
  import { ActionTargetItem } from "./actions";
3
- import { LabelValueItem } from "./shared";
4
+ import { AnyObject, LabelValueItem } from "./shared";
4
5
 
5
6
  export interface ListControlsFilter {
6
7
  [key: string]: object | object[] | null | undefined | string | number | boolean;
@@ -20,13 +21,23 @@ export interface FilterGroup {
20
21
  fields: FilterableField[];
21
22
  }
22
23
 
24
+
23
25
  export interface ListControlsRoutes {
24
- list: (pager: object) => Promise<ActionTargetItem[]>;
25
- details?: (item: object) => Promise<ActionTargetItem> | null;
26
- summary?: (filter: object | null) => Promise<object> | null;
27
- fieldOptions?: (filter: object | null) => Promise<object> | null;
28
- more?: (pager: object) => Promise<ActionTargetItem[]> | null;
29
- export: (filter?: ListControlsFilter) => Promise<void>;
26
+ list(pager?: ListControlsPagination): Promise<ActionTargetItem[]>;
27
+
28
+ summary?(filter?: ListControlsFilter): Promise<object>;
29
+
30
+ details?(target: ActionTargetItem): Promise<ActionTargetItem>;
31
+
32
+ more?(pager: ListControlsPagination): Promise<ActionTargetItem[]>;
33
+
34
+ fieldOptions?(filter?: AnyObject): Promise<object>;
35
+
36
+ applyAction?(action: string, target: ActionTargetItem | null, data: object): Promise<object>;
37
+
38
+ batchAction?(action: string, targets: ActionTargetItem[], data: object): Promise<object>;
39
+
40
+ export?(filter?: ListControlsFilter, name?: string): Promise<void>;
30
41
  }
31
42
 
32
43
  export interface ListControlsOptions {
@@ -44,6 +55,8 @@ export interface ListControlsPagination {
44
55
  page?: number;
45
56
  rowsNumber?: number;
46
57
  rowsPerPage?: number;
58
+ perPage?: number;
59
+ filter?: ListControlsFilter;
47
60
  }
48
61
 
49
62
  export interface PagedItems {
@@ -54,6 +67,10 @@ export interface PagedItems {
54
67
  } | undefined;
55
68
  }
56
69
 
70
+ export interface ListControlsInitializeOptions {
71
+ vueRouter?: Router;
72
+ }
73
+
57
74
  export interface ActionController {
58
75
  name: string;
59
76
  label: string;
@@ -78,7 +95,7 @@ export interface ActionController {
78
95
  activePanel: ShallowRef<string | null>;
79
96
 
80
97
  // Actions
81
- initialize: () => void;
98
+ initialize: (options: ListControlsInitializeOptions) => void;
82
99
  resetPaging: () => void;
83
100
  setPagination: (updated: ListControlsPagination) => void;
84
101
  setSelectedRows: (selection: ActionTargetItem[]) => void;
@@ -1,3 +1,17 @@
1
+ import { AnyObject } from "src/types/shared";
2
+
3
+ export interface RequestApi {
4
+ abortControllers: { [key: string]: { abort: AbortController, timestamp: number } };
5
+
6
+ url(url: string): string;
7
+
8
+ call(url: string, options?: RequestCallOptions): Promise<any>;
9
+
10
+ get(url: string, options?: RequestCallOptions): Promise<any>;
11
+
12
+ post(url: string, data?: object, options?: RequestCallOptions): Promise<any>;
13
+ }
14
+
1
15
  export interface HttpResponse {
2
16
  headers: any;
3
17
  data?: any;
@@ -8,6 +22,12 @@ export interface HttpResponse {
8
22
 
9
23
  export interface RequestOptions {
10
24
  baseUrl?: string;
11
- headers?: object;
25
+ headers?: AnyObject;
12
26
  onUnauthorized?: (response) => object;
27
+ onAppVersionMismatch?: (version) => void;
13
28
  }
29
+
30
+ export interface RequestCallOptions extends RequestInit {
31
+ abortOn?: string;
32
+ }
33
+
package/tsconfig.json CHANGED
@@ -42,7 +42,6 @@
42
42
  "types/**/*.d.ts"
43
43
  ],
44
44
  "exclude": [
45
- "node_modules",
46
45
  "dist",
47
46
  "**/*.spec.ts"
48
47
  ]