quasar-ui-danx 0.4.2 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/dist/danx.es.js +7127 -6615
  2. package/dist/danx.es.js.map +1 -1
  3. package/dist/danx.umd.js +11 -5
  4. package/dist/danx.umd.js.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/package.json +3 -1
  7. package/src/components/ActionTable/ActionTable.vue +28 -41
  8. package/src/components/ActionTable/Columns/ActionTableColumn.vue +19 -18
  9. package/src/components/ActionTable/Filters/CollapsableFiltersSidebar.vue +6 -6
  10. package/src/components/ActionTable/Filters/{FilterFieldList.vue → FilterList.vue} +26 -26
  11. package/src/components/ActionTable/Filters/FilterableField.vue +28 -31
  12. package/src/components/ActionTable/Filters/index.ts +2 -2
  13. package/src/components/ActionTable/Form/Fields/EditOnClickTextField.vue +71 -0
  14. package/src/components/ActionTable/Form/Fields/FieldLabel.vue +8 -13
  15. package/src/components/ActionTable/Form/Fields/MultiFileField.vue +48 -44
  16. package/src/components/ActionTable/Form/Fields/SelectField.vue +24 -38
  17. package/src/components/ActionTable/Form/Fields/SelectWithChildrenField.vue +28 -33
  18. package/src/components/ActionTable/Form/Fields/SingleFileField.vue +15 -15
  19. package/src/components/ActionTable/Form/Fields/SliderNumberField.vue +45 -0
  20. package/src/components/ActionTable/Form/Fields/TextField.vue +47 -66
  21. package/src/components/ActionTable/Form/Fields/index.ts +2 -0
  22. package/src/components/ActionTable/Form/RenderedForm.vue +50 -9
  23. package/src/components/ActionTable/Form/Utilities/MaxLengthCounter.vue +17 -0
  24. package/src/components/ActionTable/Form/Utilities/index.ts +1 -0
  25. package/src/components/ActionTable/Form/index.ts +1 -0
  26. package/src/components/ActionTable/Layouts/ActionTableLayout.vue +16 -15
  27. package/src/components/ActionTable/Toolbars/ActionToolbar.vue +6 -6
  28. package/src/components/ActionTable/listControls.ts +106 -166
  29. package/src/components/ActionTable/listHelpers.ts +2 -3
  30. package/src/components/ActionTable/tableColumns.ts +3 -27
  31. package/src/components/AuditHistory/AuditHistoryItemValue.vue +26 -26
  32. package/src/components/PanelsDrawer/PanelsDrawer.vue +17 -4
  33. package/src/components/PanelsDrawer/PanelsDrawerPanels.vue +6 -11
  34. package/src/components/PanelsDrawer/PanelsDrawerTabs.vue +20 -20
  35. package/src/components/Utility/Dialogs/ConfirmActionDialog.vue +39 -0
  36. package/src/components/Utility/Dialogs/ConfirmDialog.vue +10 -24
  37. package/src/components/Utility/Dialogs/DialogLayout.vue +10 -28
  38. package/src/components/Utility/Dialogs/FullscreenCarouselDialog.vue +42 -36
  39. package/src/components/Utility/Dialogs/index.ts +1 -0
  40. package/src/components/Utility/Files/FilePreview.vue +76 -73
  41. package/src/components/Utility/Layouts/ContentDrawer.vue +24 -31
  42. package/src/components/Utility/Tools/ActionVnode.vue +3 -3
  43. package/src/components/Utility/Tools/RenderVnode.vue +1 -1
  44. package/src/components/Utility/Transitions/MaxHeightTransition.vue +26 -0
  45. package/src/components/Utility/Transitions/index.ts +1 -0
  46. package/src/config/index.ts +36 -31
  47. package/src/helpers/FileUpload.ts +295 -297
  48. package/src/helpers/FlashMessages.ts +80 -71
  49. package/src/helpers/actions.ts +102 -82
  50. package/src/helpers/download.ts +189 -189
  51. package/src/helpers/downloadPdf.ts +55 -52
  52. package/src/helpers/formats.ts +151 -109
  53. package/src/helpers/index.ts +2 -0
  54. package/src/helpers/multiFileUpload.ts +72 -58
  55. package/src/helpers/objectStore.ts +52 -0
  56. package/src/helpers/request.ts +70 -51
  57. package/src/helpers/routes.ts +29 -0
  58. package/src/helpers/storage.ts +7 -3
  59. package/src/helpers/utils.ts +47 -29
  60. package/src/styles/quasar-reset.scss +16 -1
  61. package/src/styles/themes/danx/dialogs.scss +4 -0
  62. package/src/types/actions.d.ts +43 -0
  63. package/src/types/config.d.ts +15 -0
  64. package/src/types/controls.d.ts +99 -0
  65. package/src/types/dialogs.d.ts +32 -0
  66. package/src/types/fields.d.ts +20 -0
  67. package/src/types/files.d.ts +54 -0
  68. package/src/types/formats.d.ts +4 -0
  69. package/src/{components/ActionTable/Form/form.d.ts → types/forms.d.ts} +6 -0
  70. package/src/types/index.d.ts +12 -0
  71. package/src/types/requests.d.ts +13 -0
  72. package/src/types/shared.d.ts +15 -0
  73. package/src/types/tables.d.ts +27 -0
  74. package/types/index.d.ts +1 -1
  75. /package/src/components/ActionTable/Filters/{FilterFieldItem.vue → FilterItem.vue} +0 -0
@@ -1,50 +1,69 @@
1
- import { ref, Ref } from "vue";
1
+ import { Ref } from "vue";
2
+ import { danxOptions } from "../config";
3
+ import { AnyObject } from "../types";
2
4
 
3
- interface RequestOptions {
4
- baseUrl: string;
5
- }
6
-
7
- const requestOptions: Ref<RequestOptions> = ref({
8
- baseUrl: ""
9
- });
10
5
  /**
11
6
  * A simple request helper that wraps the fetch API
12
7
  * to make GET and POST requests easier w/ JSON payloads
13
8
  */
14
9
  export const request = {
15
- configure(options: RequestOptions) {
16
- requestOptions.value = options;
17
- },
10
+ url(url: string) {
11
+ if (url.startsWith("http")) {
12
+ return url;
13
+ }
14
+ return (danxOptions.value.request?.baseUrl || "").replace(/\/$/, "") + "/" + url;
15
+ },
16
+
17
+ async call(url: string, options: RequestInit): Promise<object> {
18
+ try {
19
+ const response = await fetch(request.url(url), options);
20
+ const result = await response.json();
21
+
22
+ if (response.status === 401) {
23
+ const onUnauthorized = danxOptions.value.request?.onUnauthorized;
24
+ return onUnauthorized ? onUnauthorized(response) : {
25
+ error: true,
26
+ message: "Unauthorized"
27
+ };
28
+ }
18
29
 
19
- url(url: string) {
20
- if (url.startsWith("http")) {
21
- return url;
22
- }
23
- return requestOptions.value.baseUrl + url;
24
- },
30
+ if (response.status > 400) {
31
+ if (result.exception && !result.error) {
32
+ result.error = true;
33
+ }
34
+ }
25
35
 
26
- async get(url: string, options = {}): Promise<object> {
27
- return fetch(request.url(url), {
28
- method: "get",
29
- headers: {
30
- Accept: "application/json",
31
- "Content-Type": "application/json"
32
- },
33
- ...options
34
- }).then((r) => r.json());
35
- },
36
+ return result;
37
+ } catch (error: any) {
38
+ return {
39
+ error: error.message || "An error occurred fetching the data"
40
+ };
41
+ }
42
+ },
43
+ async get(url: string, options: RequestInit = {}): Promise<object> {
44
+ return await request.call(url, {
45
+ method: "get",
46
+ headers: {
47
+ Accept: "application/json",
48
+ "Content-Type": "application/json",
49
+ ...danxOptions.value.request?.headers
50
+ },
51
+ ...options
52
+ });
53
+ },
36
54
 
37
- async post(url: string, data = {}, options = {}) {
38
- return fetch(request.url(url), {
39
- method: "post",
40
- body: JSON.stringify(data),
41
- headers: {
42
- Accept: "application/json",
43
- "Content-Type": "application/json"
44
- },
45
- ...options
46
- }).then((r) => r.json());
47
- }
55
+ async post(url: string, data: AnyObject = {}, options: RequestInit = {}) {
56
+ return request.call(url, {
57
+ method: "post",
58
+ body: JSON.stringify(data),
59
+ headers: {
60
+ Accept: "application/json",
61
+ "Content-Type": "application/json",
62
+ ...danxOptions.value.request?.headers
63
+ },
64
+ ...options
65
+ });
66
+ }
48
67
  };
49
68
 
50
69
  /**
@@ -55,25 +74,25 @@ export const request = {
55
74
  *
56
75
  */
57
76
  export async function fetchResourceListWithSelected(fetchFn: (filter: object) => Promise<any[]>, list: Ref, id: string, filter: object): Promise<void> {
58
- // First make sure we have the selected record, so we can always add it to the list
59
- let selectedResource;
60
- if (id) {
61
- selectedResource = list.value.find((c: { id: string }) => c.id === id) || (await fetchFn({ id }))[0];
62
- }
77
+ // First make sure we have the selected record, so we can always add it to the list
78
+ let selectedResource;
79
+ if (id) {
80
+ selectedResource = list.value.find((c: { id: string }) => c.id === id) || (await fetchFn({ id }))[0];
81
+ }
63
82
 
64
- // Get the filtered campaign list
65
- list.value = await fetchFn(filter);
83
+ // Get the filtered campaign list
84
+ list.value = await fetchFn(filter);
66
85
 
67
- // If our selected campaign is not in the filtered list, add it
68
- if (selectedResource && !list.value.find((c: { id: string }) => c.id === id)) {
69
- list.value.push(selectedResource);
70
- }
86
+ // If our selected campaign is not in the filtered list, add it
87
+ if (selectedResource && !list.value.find((c: { id: string }) => c.id === id)) {
88
+ list.value.push(selectedResource);
89
+ }
71
90
  }
72
91
 
73
92
  /**
74
93
  * Returns the value of the URL parameter (if it is set)
75
94
  */
76
95
  export function getUrlParam(key: string, url?: string) {
77
- const params = new URLSearchParams(url?.replace(/.*\?/, "") || window.location.search);
78
- return params.get(key);
96
+ const params = new URLSearchParams(url?.replace(/.*\?/, "") || window.location.search);
97
+ return params.get(key);
79
98
  }
@@ -0,0 +1,29 @@
1
+ import { ActionTargetItem, AnyObject, ListControlsPagination } from "../types";
2
+ import { downloadFile } from "./downloadPdf";
3
+ import { request } from "./request";
4
+
5
+ export function useActionRoutes(baseUrl: string) {
6
+ return {
7
+ list(pager: ListControlsPagination) {
8
+ return request.post(`${baseUrl}/list`, pager);
9
+ },
10
+ summary(filter: AnyObject) {
11
+ return request.post(`${baseUrl}/summary`, { filter });
12
+ },
13
+ details(target: ActionTargetItem) {
14
+ return request.get(`${baseUrl}/${target.id}/details`);
15
+ },
16
+ fieldOptions() {
17
+ return request.get(`${baseUrl}/field-options`);
18
+ },
19
+ applyAction(action: string, target: ActionTargetItem | null, data: object) {
20
+ return request.post(`${baseUrl}/${target ? target.id : "new"}/apply-action`, { action, data });
21
+ },
22
+ batchAction(action: string, targets: ActionTargetItem[], data: object) {
23
+ return request.post(`${baseUrl}/batch-action`, { action, filter: { id: targets.map(r => r.id) }, data });
24
+ },
25
+ export(filter: AnyObject, name?: string) {
26
+ return downloadFile(`${baseUrl}/export`, name || "export.csv", { filter });
27
+ }
28
+ };
29
+ }
@@ -1,8 +1,12 @@
1
1
  export function setItem(key: string, value: any) {
2
- localStorage.setItem(key, JSON.stringify(value));
2
+ localStorage.setItem(key, JSON.stringify(value));
3
3
  }
4
4
 
5
5
  export function getItem(key: string, defaultValue: any = null) {
6
- const item = localStorage.getItem(key);
7
- return item ? JSON.parse(item) : defaultValue;
6
+ const item = localStorage.getItem(key);
7
+ try {
8
+ return item ? JSON.parse(item) : defaultValue;
9
+ } catch (e) {
10
+ return undefined;
11
+ }
8
12
  }
@@ -6,72 +6,90 @@ import { Ref, watch } from "vue";
6
6
  * eg: await sleep(5000);
7
7
  */
8
8
  export function sleep(delay: number) {
9
- return new Promise((resolve) => setTimeout(resolve, delay));
9
+ return new Promise((resolve) => setTimeout(resolve, delay));
10
10
  }
11
11
 
12
12
  /**
13
13
  * Wait for a ref to have a value and then resolve the promise
14
14
  */
15
15
  export function waitForRef(ref: Ref, value: any) {
16
- return new Promise<void>((resolve) => {
17
- watch(ref, (newValue) => {
18
- if (newValue === value) {
19
- resolve();
20
- }
21
- });
22
- });
16
+ return new Promise<void>((resolve) => {
17
+ watch(ref, (newValue) => {
18
+ if (newValue === value) {
19
+ resolve();
20
+ }
21
+ });
22
+ });
23
23
  }
24
24
 
25
25
  /**
26
26
  * Returns a number that is constrained to the given range.
27
27
  */
28
28
  export function minmax(min: number, max: number, value: number) {
29
- return Math.max(min, Math.min(max, value));
29
+ return Math.max(min, Math.min(max, value));
30
30
  }
31
31
 
32
32
  /**
33
33
  * Convert meters to miles
34
34
  */
35
35
  export function metersToMiles(meters: number) {
36
- return meters * 0.000621371;
36
+ return meters * 0.000621371;
37
37
  }
38
38
 
39
39
  /**
40
40
  * Convert miles to meters
41
41
  */
42
42
  export function milesToMeters(miles: number) {
43
- return miles / 0.000621371;
43
+ return miles / 0.000621371;
44
44
  }
45
45
 
46
46
  /**
47
47
  * Parses a string for Lat and Long coords
48
48
  */
49
49
  export function parseCoords(location: string) {
50
- const latLong = location.split(",");
50
+ const latLong = location.split(",");
51
51
 
52
- if (latLong.length === 2) {
53
- const lat = parseFloat(latLong[0].trim());
54
- const lng = parseFloat(latLong[1].trim());
52
+ if (latLong.length === 2) {
53
+ const lat = parseFloat(latLong[0].trim());
54
+ const lng = parseFloat(latLong[1].trim());
55
55
 
56
- if (!isNaN(lat) && !isNaN(lng)) {
57
- return {
58
- lat,
59
- lng
60
- };
61
- }
62
- }
56
+ if (!isNaN(lat) && !isNaN(lng)) {
57
+ return {
58
+ lat,
59
+ lng
60
+ };
61
+ }
62
+ }
63
63
 
64
- return null;
64
+ return null;
65
65
  }
66
66
 
67
67
  /**
68
68
  * Increment a name by adding a number to the end of it or incrementing the number if it already exists
69
69
  */
70
70
  export function incrementName(name: string) {
71
- name = (name || "New Item").trim();
72
- const match = name.match(/(\d+)$/);
73
- if (match) {
74
- return name.replace(/\d+$/, (match: string) => "" + (parseInt(match) + 1));
75
- }
76
- return `${name} 1`;
71
+ name = (name || "New Item").trim();
72
+ const match = name.match(/(\d+)$/);
73
+ if (match) {
74
+ return name.replace(/\d+$/, (match: string) => "" + (parseInt(match) + 1));
75
+ }
76
+ return `${name} 1`;
77
+ }
78
+
79
+ /**
80
+ * Check if a string is a valid JSON object. If an object is passed, always return true
81
+ */
82
+ export function isJSON(string: string | object) {
83
+ if (!string) {
84
+ return false;
85
+ }
86
+ if (typeof string === "object") {
87
+ return true;
88
+ }
89
+ try {
90
+ JSON.parse(string);
91
+ return true;
92
+ } catch (e) {
93
+ return false;
94
+ }
77
95
  }
@@ -15,6 +15,7 @@
15
15
  .q-toolbar {
16
16
  min-height: 0;
17
17
  padding: 0;
18
+ flex-shrink: 0;
18
19
  }
19
20
 
20
21
  .q-notification__actions {
@@ -46,6 +47,12 @@
46
47
  .q-field__control-container {
47
48
  padding-top: 1.1rem;
48
49
  }
50
+
51
+ &.q-textarea {
52
+ .q-field__control-container {
53
+ padding-bottom: 1.1rem;
54
+ }
55
+ }
49
56
  }
50
57
 
51
58
  .q-field__marginal, .q-field__input, .q-field__label {
@@ -56,7 +63,11 @@
56
63
 
57
64
  .q-btn {
58
65
  text-transform: inherit;
59
- @apply bg-inherit text-inherit;
66
+ @apply bg-inherit text-inherit min-h-[auto] p-2;
67
+
68
+ &:before {
69
+ @apply shadow-none;
70
+ }
60
71
  }
61
72
 
62
73
  .q-item {
@@ -89,3 +100,7 @@
89
100
  @apply p-0;
90
101
  }
91
102
  }
103
+
104
+ .q-banner {
105
+ @apply min-h-[auto];
106
+ }
@@ -1,4 +1,8 @@
1
1
  .dx-dialog {
2
+ .dx-dialog-card {
3
+ @apply overflow-hidden;
4
+ }
5
+
2
6
  .dx-dialog-title {
3
7
  @apply pl-6 pr-10 border-b border-gray-300 font-normal;
4
8
  }
@@ -0,0 +1,43 @@
1
+ import { VNode } from "vue";
2
+ import { TypedObject } from "./shared";
3
+
4
+ export interface ActionPanel {
5
+ name: string | number;
6
+ label: string;
7
+ category?: string;
8
+ class?: string | object;
9
+ enabled?: boolean | (() => boolean);
10
+ tabVnode?: (activePanel: string | number) => VNode | any;
11
+ vnode: (activePanel: string) => VNode | any;
12
+ }
13
+
14
+ export interface ActionTargetItem extends TypedObject {
15
+ isSaving?: boolean;
16
+ }
17
+
18
+ export type ActionTarget = ActionTargetItem[] | ActionTargetItem | null;
19
+
20
+ export interface ActionOptions {
21
+ name?: string;
22
+ alias?: string;
23
+ label?: string;
24
+ menu?: boolean;
25
+ batch?: boolean;
26
+ category?: string;
27
+ class?: string;
28
+ debounce?: number;
29
+ isApplying?: boolean;
30
+ optimistic?: boolean | ((action: ActionOptions, target: ActionTargetItem | null, input: any) => void);
31
+ trigger?: (target?: ActionTarget, input?: any) => Promise<any>;
32
+ vnode?: ((target: ActionTarget) => VNode) | any;
33
+ enabled?: (target: object) => boolean;
34
+ batchEnabled?: (targets: object[]) => boolean;
35
+ onAction?: (action: string | null | undefined, target: ActionTargetItem | null, input: any) => Promise<any> | void;
36
+ onBatchAction?: (action: string | null | undefined, targets: ActionTargetItem[], input: any) => Promise<any>;
37
+ onStart?: (action: ActionOptions | null, targets: ActionTarget, input: any) => boolean;
38
+ onSuccess?: (result: any, targets: ActionTarget, input: any) => any;
39
+ onBatchSuccess?: (result: any, targets: ActionTargetItem[], input: any) => any;
40
+ onError?: (result: any, targets: ActionTarget, input: any) => any;
41
+ onFinish?: (result: any, targets: ActionTarget, input: any) => any;
42
+ __type?: string;
43
+ }
@@ -0,0 +1,15 @@
1
+ import { QNotifyCreateOptions } from "quasar";
2
+ import { FileUploadOptions } from "./files";
3
+ import { RequestOptions } from "./requests";
4
+
5
+ export interface DanxOptions {
6
+ tinyMceApiKey?: string;
7
+ fileUpload?: FileUploadOptions;
8
+ request?: RequestOptions,
9
+ flashMessages?: {
10
+ default?: QNotifyCreateOptions;
11
+ success?: QNotifyCreateOptions;
12
+ warning?: QNotifyCreateOptions;
13
+ error?: QNotifyCreateOptions;
14
+ };
15
+ }
@@ -0,0 +1,99 @@
1
+ import { ComputedRef, Ref, ShallowRef } from "vue";
2
+ import { ActionTargetItem } from "./actions";
3
+ import { LabelValueItem } from "./shared";
4
+
5
+ export interface ListControlsFilter {
6
+ [key: string]: object | object[] | null | undefined | string | number | boolean;
7
+ }
8
+
9
+ export interface FilterableField {
10
+ name: string;
11
+ label: string;
12
+ type: string;
13
+ options?: string[] | number[] | LabelValueItem[];
14
+ inline?: boolean;
15
+ }
16
+
17
+ export interface FilterGroup {
18
+ name?: string;
19
+ flat?: boolean;
20
+ fields: FilterableField[];
21
+ }
22
+
23
+ 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>;
30
+ }
31
+
32
+ export interface ListControlsOptions {
33
+ label?: string,
34
+ routes: ListControlsRoutes;
35
+ urlPattern?: RegExp | null;
36
+ filterDefaults?: Record<string, object>;
37
+ refreshFilters?: boolean;
38
+ }
39
+
40
+ export interface ListControlsPagination {
41
+ __sort?: object[] | null;
42
+ sortBy?: string | null;
43
+ descending?: boolean;
44
+ page?: number;
45
+ rowsNumber?: number;
46
+ rowsPerPage?: number;
47
+ }
48
+
49
+ export interface PagedItems {
50
+ data: ActionTargetItem[] | undefined;
51
+ meta: {
52
+ total: number;
53
+ last_page?: number;
54
+ } | undefined;
55
+ }
56
+
57
+ export interface ActionController {
58
+ name: string;
59
+ label: string;
60
+ pagedItems: Ref<PagedItems | null>;
61
+ activeFilter: Ref<ListControlsFilter>;
62
+ globalFilter: Ref<ListControlsFilter>;
63
+ filterActiveCount: ComputedRef<number>;
64
+ showFilters: Ref<boolean>;
65
+ summary: ShallowRef<object | null>;
66
+ selectedRows: ShallowRef<ActionTargetItem[]>;
67
+ isLoadingList: Ref<boolean>;
68
+ isLoadingFilters: Ref<boolean>;
69
+ isLoadingSummary: Ref<boolean>;
70
+ pager: ComputedRef<{
71
+ perPage: number;
72
+ page: number;
73
+ filter: ListControlsFilter;
74
+ sort: object[] | undefined;
75
+ }>;
76
+ pagination: ShallowRef<ListControlsPagination>;
77
+ activeItem: ShallowRef<ActionTargetItem | null>;
78
+ activePanel: ShallowRef<string | null>;
79
+
80
+ // Actions
81
+ initialize: () => void;
82
+ resetPaging: () => void;
83
+ setPagination: (updated: ListControlsPagination) => void;
84
+ setSelectedRows: (selection: ActionTargetItem[]) => void;
85
+ clearSelectedRows: () => void;
86
+ loadList: (filter?: ListControlsFilter) => Promise<void>;
87
+ loadSummary: (filter?: ListControlsFilter) => Promise<void>;
88
+ loadListAndSummary: (filter?: ListControlsFilter) => Promise<void>;
89
+ loadMore: (index: number, perPage?: number) => Promise<boolean>;
90
+ getActiveItemDetails: () => Promise<void>;
91
+ refreshAll: () => Promise<void[]>;
92
+ exportList: (filter?: ListControlsFilter) => Promise<void>;
93
+ setActiveItem: (item: ActionTargetItem | null) => void;
94
+ getNextItem: (offset: number) => Promise<void>;
95
+ activatePanel: (item: ActionTargetItem | null, panel: string) => void;
96
+ setActiveFilter: (filter?: ListControlsFilter) => void;
97
+ applyFilterFromUrl: (url: string, filters?: Ref<FilterGroup[]> | null) => void;
98
+ getFieldOptions: (field: string) => any[];
99
+ }
@@ -0,0 +1,32 @@
1
+ import { ActionTargetItem } from "./actions";
2
+
3
+ export interface DialogLayoutProps {
4
+ modelValue?: string | boolean | object;
5
+ title?: string;
6
+ titleClass?: string;
7
+ subtitle?: string;
8
+ content?: string;
9
+ backdropDismiss?: boolean;
10
+ maximized?: boolean;
11
+ fullWidth?: boolean;
12
+ fullHeight?: boolean;
13
+ contentClass?: string;
14
+ }
15
+
16
+ export interface ConfirmDialogProps extends DialogLayoutProps {
17
+ disabled?: boolean;
18
+ isSaving?: boolean;
19
+ closeOnConfirm?: boolean;
20
+ hideConfirm?: boolean;
21
+ confirmText?: string;
22
+ cancelText?: string;
23
+ confirmClass?: string;
24
+ contentClass?: string;
25
+ }
26
+
27
+ export interface ConfirmActionDialogProps extends ConfirmDialogProps {
28
+ action: string,
29
+ label?: string,
30
+ target: ActionTargetItem | ActionTargetItem[]
31
+ message?: string,
32
+ }
@@ -0,0 +1,20 @@
1
+ import { QInputProps } from "quasar";
2
+ import { FormField } from "./forms";
3
+
4
+ export interface TextFieldProps {
5
+ modelValue?: string,
6
+ field?: FormField,
7
+ type?: QInputProps["type"],
8
+ label?: string,
9
+ labelClass?: string,
10
+ parentClass?: string,
11
+ inputClass?: string,
12
+ allowOverMax?: boolean,
13
+ maxLength?: number;
14
+ autogrow?: boolean;
15
+ noLabel?: boolean;
16
+ showName?: boolean;
17
+ disabled?: boolean;
18
+ readonly?: boolean;
19
+ debounce?: string | number;
20
+ }
@@ -0,0 +1,54 @@
1
+ export interface FileUploadOptions {
2
+ directory?: string,
3
+ createPresignedUpload?: ((path: string, name: string, mime?: string) => Promise<UploadedFile>) | null;
4
+ completePresignedUpload?: ((fileId: string) => Promise<UploadedFile>) | null;
5
+ }
6
+
7
+ export interface XHRFileUpload {
8
+ file: UploadedFile;
9
+ xhr?: XMLHttpRequest | null;
10
+ formData: FormData;
11
+ isComplete: boolean;
12
+ body?: FormData | UploadedFile | string;
13
+ }
14
+
15
+ export interface UploadedFile {
16
+ id: string,
17
+ resource_id?: string;
18
+ name: string,
19
+ size: number,
20
+ type: string;
21
+ mimeType?: string;
22
+ mime?: string;
23
+ progress?: number;
24
+ location?: string;
25
+ blobUrl?: string;
26
+ url?: string;
27
+ }
28
+
29
+ export interface FileUploadCompleteCallbackParams {
30
+ file?: UploadedFile | null;
31
+ uploadedFile?: UploadedFile | null;
32
+ }
33
+
34
+ export interface FileUploadAllCompleteCallbackParams {
35
+ files: XHRFileUpload[];
36
+ }
37
+
38
+ export interface FileUploadProgressCallbackParams {
39
+ file?: UploadedFile | null;
40
+ progress: number;
41
+ }
42
+
43
+ export interface FileUploadErrorCallbackParams {
44
+ e: InputEvent;
45
+ file: UploadedFile;
46
+ error: any;
47
+ }
48
+
49
+ export type FileUploadCompleteCallback = (params: FileUploadCompleteCallbackParams) => void
50
+ export type FileUploadAllCompleteCallback = (params: FileUploadAllCompleteCallbackParams) => void
51
+ export type FileUploadProgressCallback = (params: FileUploadProgressCallbackParams) => void
52
+ export type FileUploadErrorCallback = (params: FileUploadErrorCallbackParams) => void
53
+ export type OnFilesChangeCallback = (files: UploadedFile[]) => void;
54
+ export type VoidCallback = () => void;
@@ -0,0 +1,4 @@
1
+ export interface fDateOptions {
2
+ format?: string,
3
+ empty?: string
4
+ }
@@ -10,10 +10,16 @@ export interface FormField {
10
10
  type?: string;
11
11
  name: string;
12
12
  label: string;
13
+ placeholder?: string;
13
14
  vnode?: ((props) => VNode | any);
14
15
  component?: any;
16
+ clearable?: boolean;
15
17
  required?: boolean;
16
18
  required_group?: string;
19
+ toggleIndeterminate?: boolean;
20
+ inline?: boolean;
21
+ maxLength?: number;
22
+ minLength?: number;
17
23
  options?: FormFieldOption[];
18
24
  }
19
25
 
@@ -0,0 +1,12 @@
1
+ export * from "./actions";
2
+ export * from "./config";
3
+ export * from "./controls";
4
+ export * from "./dialogs";
5
+ export * from "./fields";
6
+ export * from "./files";
7
+ export * from "./formats";
8
+ export * from "./forms";
9
+ export * from "./requests";
10
+ export * from "./shared";
11
+ export * from "./tables";
12
+
@@ -0,0 +1,13 @@
1
+ export interface HttpResponse {
2
+ headers: any;
3
+ data?: any;
4
+ ok?: boolean;
5
+
6
+ blob(): any;
7
+ }
8
+
9
+ export interface RequestOptions {
10
+ baseUrl?: string;
11
+ headers?: object;
12
+ onUnauthorized?: (response) => object;
13
+ }