@mythpe/quasar-ui-qui 0.0.27 → 0.0.29-dev
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/index.d.ts +13 -0
- package/package.json +17 -8
- package/src/boot/register.ts +14 -0
- package/src/components/datatable/MDatatable.vue +2305 -0
- package/src/components/datatable/MDtAvatar.vue +49 -0
- package/src/components/datatable/MDtBtn.vue +153 -0
- package/src/components/datatable/MDtContextmenuItems.vue +54 -0
- package/src/components/datatable/index.ts +6 -0
- package/src/components/form/MAvatarViewer.vue +327 -0
- package/src/components/form/MAxios.vue +144 -0
- package/src/components/form/MBtn.vue +271 -93
- package/src/components/form/MCheckbox.vue +150 -0
- package/src/components/form/MCkeditor.vue +403 -0
- package/src/components/form/MColor.vue +122 -0
- package/src/components/form/MDate.vue +50 -0
- package/src/components/form/MEditor.vue +285 -0
- package/src/components/form/MEmail.vue +43 -0
- package/src/components/form/MField.vue +148 -0
- package/src/components/form/MFile.vue +215 -0
- package/src/components/form/MForm.vue +89 -0
- package/src/components/form/MHidden.vue +86 -0
- package/src/components/form/MHiddenInput.vue +58 -0
- package/src/components/form/MInput.vue +178 -0
- package/src/components/form/MInputFieldControl.vue +27 -0
- package/src/components/form/MInputLabel.vue +38 -0
- package/src/components/form/MMobile.vue +43 -0
- package/src/components/form/MOptions.vue +255 -0
- package/src/components/form/MOtp.vue +292 -0
- package/src/components/form/MPassword.vue +73 -0
- package/src/components/form/MPicker.vue +313 -0
- package/src/components/form/MRadio.vue +181 -0
- package/src/components/form/MSelect.vue +352 -0
- package/src/components/form/MTime.vue +48 -0
- package/src/components/form/MToggle.vue +211 -0
- package/src/components/form/MUploader.vue +511 -0
- package/src/components/form/index.ts +65 -0
- package/src/components/grid/MBlock.vue +39 -18
- package/src/components/grid/MCol.vue +11 -15
- package/src/components/grid/MColumn.vue +12 -1
- package/src/components/grid/MContainer.vue +22 -13
- package/src/components/grid/MHelpRow.vue +13 -12
- package/src/components/grid/MRow.vue +31 -10
- package/src/components/grid/index.ts +16 -0
- package/src/components/index.ts +15 -0
- package/src/components/modal/MDialog.vue +58 -0
- package/src/components/modal/MModalMenu.vue +62 -0
- package/src/components/modal/MTooltip.vue +39 -0
- package/src/components/modal/index.ts +5 -0
- package/src/components/parials/UploaderItem.vue +298 -0
- package/src/components/parials/index.ts +3 -0
- package/src/components/transition/MFadeTransition.vue +27 -0
- package/src/components/transition/MFadeXTransition.vue +26 -0
- package/src/components/transition/MTransition.vue +44 -0
- package/src/components/transition/index.ts +13 -0
- package/src/components/typography/MTypingString.vue +8 -0
- package/src/components/typography/index.ts +11 -0
- package/src/composable/index.ts +12 -0
- package/src/composable/useBindInput.ts +209 -0
- package/src/composable/useError.ts +11 -0
- package/src/composable/useMyth.ts +311 -0
- package/src/composable/useValue.ts +12 -0
- package/src/index.common.js +19 -1
- package/src/index.esm.js +18 -3
- package/src/index.js +19 -0
- package/src/index.sass +9 -26
- package/src/index.ts +18 -4
- package/src/index.umd.js +17 -2
- package/src/style/m-container.sass +13 -0
- package/src/style/main.sass +146 -0
- package/src/style/print.sass +14 -0
- package/src/style/transition.sass +40 -0
- package/src/types/api-helpers.d.ts +62 -0
- package/src/types/components.d.ts +1108 -27
- package/src/types/index.d.ts +21 -1
- package/src/types/install-options.d.ts +19 -0
- package/src/types/lodash.d.ts +26 -0
- package/src/types/m-datatable.d.ts +316 -0
- package/src/types/m-geolocation.d.ts +16 -0
- package/src/types/m-helpers.d.ts +97 -0
- package/src/types/plugin-props-option.d.ts +305 -0
- package/src/types/quasar-helpers.d.ts +7 -0
- package/src/types/theme.d.ts +12 -0
- package/src/utils/Helpers.ts +293 -0
- package/src/utils/Str.ts +211 -0
- package/src/utils/index.ts +13 -0
- package/src/utils/myth.ts +109 -0
- package/src/utils/vee-rules.ts +32 -0
- package/src/utils/vue-plugin.ts +163 -0
- package/tsconfig.json +9 -13
- package/src/myth.ts +0 -30
- package/src/types/myth.ts +0 -42
- package/src/vue-plugin.ts +0 -41
- package/types.d.ts +0 -1
package/src/types/index.d.ts
CHANGED
|
@@ -1,2 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MyTh Ahmed Faiz Copyright © 2016-2024 All rights reserved.
|
|
3
|
+
* Email: mythpe@gmail.com
|
|
4
|
+
* Mobile: +966590470092
|
|
5
|
+
* Website: https://www.4myth.com
|
|
6
|
+
* Github: https://github.com/mythpe
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { myth } from '../utils'
|
|
10
|
+
|
|
11
|
+
export type MythContext = typeof myth;
|
|
12
|
+
|
|
13
|
+
export * from './api-helpers'
|
|
1
14
|
export * from './components'
|
|
2
|
-
export * from './
|
|
15
|
+
export * from './install-options'
|
|
16
|
+
export * from './lodash'
|
|
17
|
+
export * from './m-datatable'
|
|
18
|
+
export * from './m-geolocation'
|
|
19
|
+
export * from './plugin-props-option'
|
|
20
|
+
export * from './m-helpers'
|
|
21
|
+
export * from './quasar-helpers'
|
|
22
|
+
export * from './theme'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ThemeBtn, ThemeFluid, ThemeInput, ThemeRounded, ThemeShadow, ThemeSize } from './theme'
|
|
2
|
+
import type { BtnLoading, PropsContext } from './plugin-props-option'
|
|
3
|
+
import type { HelpersStubSchema } from './api-helpers'
|
|
4
|
+
import type { AxiosInstance } from 'axios'
|
|
5
|
+
|
|
6
|
+
export interface InstallOptions {
|
|
7
|
+
size?: ThemeSize;
|
|
8
|
+
rounded?: ThemeRounded;
|
|
9
|
+
shadow?: ThemeShadow;
|
|
10
|
+
fluid?: ThemeFluid;
|
|
11
|
+
rules?: string[];
|
|
12
|
+
btnLoading?: BtnLoading;
|
|
13
|
+
props?: PropsContext;
|
|
14
|
+
themeInput?: ThemeInput;
|
|
15
|
+
themeBtn?: ThemeBtn;
|
|
16
|
+
baseUrl?: string;
|
|
17
|
+
api?: HelpersStubSchema;
|
|
18
|
+
mAxios?: AxiosInstance;
|
|
19
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MyTh Ahmed Faiz Copyright © 2016-2024 All rights reserved.
|
|
3
|
+
* Email: mythpe@gmail.com
|
|
4
|
+
* Mobile: +966590470092
|
|
5
|
+
* Website: https://www.4myth.com
|
|
6
|
+
* Github: https://github.com/mythpe
|
|
7
|
+
*/
|
|
8
|
+
/* eslint-disable */
|
|
9
|
+
|
|
10
|
+
declare module 'lodash' {
|
|
11
|
+
interface LoDashStatic {
|
|
12
|
+
/**
|
|
13
|
+
* Converts string to pascal case.
|
|
14
|
+
*
|
|
15
|
+
* @param string The string to convert.
|
|
16
|
+
* @return Returns the pascal cased string.
|
|
17
|
+
*/
|
|
18
|
+
pascalCase (string?: string): string;
|
|
19
|
+
|
|
20
|
+
pluralize (string?: string): string;
|
|
21
|
+
|
|
22
|
+
singularize (string?: string): string;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MyTh Ahmed Faiz Copyright © 2016-2024 All rights reserved.
|
|
3
|
+
* Email: mythpe@gmail.com
|
|
4
|
+
* Mobile: +966590470092
|
|
5
|
+
* Website: https://www.4myth.com
|
|
6
|
+
* Github: https://github.com/mythpe
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { AxiosResponse } from 'axios'
|
|
10
|
+
import type { QAvatarProps, QAvatarSlots, QTableProps, QTableSlots } from 'quasar'
|
|
11
|
+
import type { ComputedRef, MaybeRef, Ref, UnwrapNestedRefs, UnwrapRef, VNode } from 'vue'
|
|
12
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
13
|
+
import { GenericFormValues, MBtnProps, MBtnSlots, MFormSlots } from './components'
|
|
14
|
+
import { StubSchema } from './api-helpers'
|
|
15
|
+
import { ApiMetaInterface, Generic } from './m-helpers'
|
|
16
|
+
|
|
17
|
+
export type MDtItem<T extends object = Record<keyof T, any>> = T & {
|
|
18
|
+
id: string | number;
|
|
19
|
+
[K: keyof T]: any;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type MDtItemIndex = number;
|
|
23
|
+
export type MDtExportOptions = 'pdf' | 'excel';
|
|
24
|
+
|
|
25
|
+
export interface MDatatablePagination {
|
|
26
|
+
/**
|
|
27
|
+
* Column name (from column definition)
|
|
28
|
+
*/
|
|
29
|
+
sortBy?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Is sorting in descending order?
|
|
32
|
+
*/
|
|
33
|
+
descending?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Page number (1-based)
|
|
36
|
+
*/
|
|
37
|
+
page: number;
|
|
38
|
+
/**
|
|
39
|
+
* How many rows per page? 0 means Infinite
|
|
40
|
+
*/
|
|
41
|
+
rowsPerPage?: number;
|
|
42
|
+
/**
|
|
43
|
+
* For server-side fetching only. How many total database rows are there to be added to the table.
|
|
44
|
+
*/
|
|
45
|
+
rowsNumber?: number;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export type MDatatableFilterForm = Partial<GenericFormValues>
|
|
49
|
+
|
|
50
|
+
export interface FetchRowsArgs {
|
|
51
|
+
filter?: string | null;
|
|
52
|
+
pagination?: MDatatablePagination
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface ApiServiceParams {
|
|
56
|
+
filter?: Record<string, any>;
|
|
57
|
+
search?: string | null;
|
|
58
|
+
searchColumns?: string[] | string;
|
|
59
|
+
// headers: string[];
|
|
60
|
+
headerItems?: any[] | string[] | string;
|
|
61
|
+
ids?: number[];
|
|
62
|
+
indexType: 'index' | 'pdf' | 'excel';
|
|
63
|
+
// For Datatable, index,export-pdf|excel,update,create,show,delete
|
|
64
|
+
fdt: 'i' | 'e' | 'u' | 'c' | 's' | 'd';
|
|
65
|
+
requestWith?: string;
|
|
66
|
+
itemsPerPage: number;
|
|
67
|
+
page: number;
|
|
68
|
+
sortBy?: string;
|
|
69
|
+
sortDesc?: number;
|
|
70
|
+
toUrl?: MDtExportOptions | boolean;
|
|
71
|
+
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type MDtMythApiServicesSchema = StubSchema;
|
|
76
|
+
|
|
77
|
+
export type MDatatableMetaServer = ApiMetaInterface
|
|
78
|
+
|
|
79
|
+
export type MDatatableOptions = {
|
|
80
|
+
// Table has action like : delete, update, etc...
|
|
81
|
+
hasAction: Ref<boolean>;
|
|
82
|
+
// Table is loading
|
|
83
|
+
loading: Ref<boolean>;
|
|
84
|
+
// Search input
|
|
85
|
+
search: Ref<string | null>;
|
|
86
|
+
// Table pagination
|
|
87
|
+
pagination: Ref<MDatatablePagination>;
|
|
88
|
+
// Server meta data
|
|
89
|
+
meta: Ref<MDatatableMetaServer>;
|
|
90
|
+
// Table filter form
|
|
91
|
+
filter: Ref<MDatatableFilterForm>;
|
|
92
|
+
// Temp of filter form
|
|
93
|
+
tempFilter: Ref<MDatatableFilterForm>;
|
|
94
|
+
// Selected rows
|
|
95
|
+
selected: Ref<MDtItem[]>;
|
|
96
|
+
// Fullscreen of datatable
|
|
97
|
+
fullscreen: Ref<boolean>;
|
|
98
|
+
// Datatable headers.
|
|
99
|
+
getHeaders: ComputedRef<string[] | Partial<QTableProps['columns']> | any[]>;
|
|
100
|
+
// Datatable visible headers.
|
|
101
|
+
visibleHeaders: Ref<any[]>;
|
|
102
|
+
}
|
|
103
|
+
type MDDIP<T extends Generic = Generic | any> = Partial<MDtItem> & Record<string, any> | T;
|
|
104
|
+
export type MDatatableDialogsOptions<T extends MDDIP = MDDIP> = {
|
|
105
|
+
filter: Ref<boolean>;
|
|
106
|
+
show: Ref<boolean>;
|
|
107
|
+
form: Ref<boolean>;
|
|
108
|
+
isUpdate: Ref<boolean>;
|
|
109
|
+
item: T | MaybeRef<MDDIP<T>> | UnwrapRef<MDDIP<T>> | Record<string, any> | undefined;
|
|
110
|
+
index: Ref<MDtItemIndex | undefined>;
|
|
111
|
+
errors: Record<string | number | symbol, string[]> | any;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface MDtBtnProps extends MBtnProps {
|
|
115
|
+
show?: boolean;
|
|
116
|
+
update?: boolean;
|
|
117
|
+
destroy?: boolean;
|
|
118
|
+
tooltip?: string | undefined;
|
|
119
|
+
color?: string;
|
|
120
|
+
icon?: string;
|
|
121
|
+
listItem?: boolean;
|
|
122
|
+
fabMini?: boolean;
|
|
123
|
+
flat?: boolean;
|
|
124
|
+
round?: boolean;
|
|
125
|
+
dense?: boolean;
|
|
126
|
+
label?: string | undefined;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface MDtBtnSlots extends MBtnSlots {
|
|
130
|
+
/**
|
|
131
|
+
* Use for custom content, instead of relying on 'icon' and 'label' props
|
|
132
|
+
*/
|
|
133
|
+
default: () => VNode[];
|
|
134
|
+
/**
|
|
135
|
+
* Override the default QSpinner when in 'loading' state
|
|
136
|
+
*/
|
|
137
|
+
loading: () => VNode[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
type UnwrapNestedTableOptionsType = UnwrapNestedRefs<MDatatableOptions>;
|
|
141
|
+
export type MDatatableScope = {
|
|
142
|
+
openShowDialog: (item: MDtItem, index?: MDtItemIndex) => void;
|
|
143
|
+
openShowDialogNoIndex: (item: MDtItem) => void;
|
|
144
|
+
closeShowDialog: () => void;
|
|
145
|
+
openUpdateDialog: (item: MDtItem, index?: MDtItemIndex) => void;
|
|
146
|
+
openUpdateDialogNoIndex: (item: MDtItem) => void;
|
|
147
|
+
openCreateDialog: (item?: MDtItem) => void;
|
|
148
|
+
closeFormDialog: () => void;
|
|
149
|
+
onDeleteItem: (item: MDtItem, index: number) => void;
|
|
150
|
+
refresh: (done?: () => void) => void;
|
|
151
|
+
refreshNoUpdate: (done?: () => void) => void;
|
|
152
|
+
tableOptions: UnwrapNestedTableOptionsType;
|
|
153
|
+
isSingleSelectedItem: ComputedRef<boolean>;
|
|
154
|
+
firstSelectedItem: ComputedRef<MDtItem>;
|
|
155
|
+
updateDatatableItem: (item: MDtItem, index?: MDtItemIndex) => void;
|
|
156
|
+
updateSelectedItems: ((selected: MDtItem[]) => void);
|
|
157
|
+
imageDialog: UnwrapNestedRefs<{ value: boolean, src?: string, asAttachment?: boolean }>;
|
|
158
|
+
openImageDialog: (src: string, opts?: { asAttachment?: boolean }) => void;
|
|
159
|
+
closeImageDialog: () => void;
|
|
160
|
+
}
|
|
161
|
+
type E = MDatatableDialogsOptions['item'];
|
|
162
|
+
export type GenericMDtBtn<T extends E = E> = Record<string, any> & {
|
|
163
|
+
name: string;
|
|
164
|
+
label?: string;
|
|
165
|
+
contextLabel?: string | null;
|
|
166
|
+
tooltip?: string;
|
|
167
|
+
click?: (item: UnwrapRef<T> | Ref<T> | T, index: UnwrapRef<MDatatableDialogsOptions['index']>) => void;
|
|
168
|
+
multiClick?: (items: T[]) => void;
|
|
169
|
+
showIf?: boolean | ((item: UnwrapRef<MDatatableDialogsOptions['item']>, index: UnwrapRef<MDatatableDialogsOptions['index']>) => boolean);
|
|
170
|
+
order?: number;
|
|
171
|
+
attr?: Partial<MDtBtnProps> & Partial<{ icon?: string; textColor?: string; color?: string; }>;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
type MDatatableFormScope = Parameters<MFormSlots['default']>[0]
|
|
175
|
+
|
|
176
|
+
type MDatatableMainScope = {
|
|
177
|
+
dt: MDatatableScope,
|
|
178
|
+
item: MDtItem,
|
|
179
|
+
index: MDtItemIndex,
|
|
180
|
+
form: MDatatableFormScope,
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface MDatatableSlots extends Omit<QTableSlots, `body-cell-${string}` | 'top'> {
|
|
184
|
+
tools: ((scope: { dt: MDatatableScope, }) => VNode[]);
|
|
185
|
+
|
|
186
|
+
selection: ((scope: { dt: MDatatableScope, }) => VNode[]);
|
|
187
|
+
|
|
188
|
+
filter: ((scope: { filter: MDatatableFilterForm } & MDatatableMainScope) => VNode[]);
|
|
189
|
+
|
|
190
|
+
show: ((scope: MDatatableMainScope) => VNode[]);
|
|
191
|
+
|
|
192
|
+
form: ((scope: MDatatableMainScope) => VNode[]);
|
|
193
|
+
|
|
194
|
+
'form-actions': ((scope: MDatatableMainScope) => VNode[]);
|
|
195
|
+
|
|
196
|
+
title: ((scope: MDatatableMainScope) => VNode[]);
|
|
197
|
+
'top-search': ((scope: MDatatableMainScope) => VNode[]);
|
|
198
|
+
'bottom-search': ((scope: MDatatableMainScope) => VNode[]);
|
|
199
|
+
|
|
200
|
+
[K: `body-cell-${string}`]: ((scope: Parameters<QTableSlots['body-cell']>[0] & { dt: MDatatableScope }) => VNode[]);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export type MDtServiceNameCallbackProp = (() => Record<string, (() => Promise<AxiosResponse>)>)
|
|
204
|
+
export type MDtServiceNameStringProp = string
|
|
205
|
+
export type MDtRequestParamsCallbackProp = (params: ApiServiceParams) => Partial<GenericFormValues>
|
|
206
|
+
export type MDtRequestParamsObjectProp = Partial<GenericFormValues>
|
|
207
|
+
|
|
208
|
+
export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = Omit<QTableProps, 'rows' | 'rowsPerPageOptions' | 'visibleColumns'> & {
|
|
209
|
+
rows?: any[];
|
|
210
|
+
controlKey?: string;
|
|
211
|
+
defaultItem?: Partial<MDtItem<I>>
|
|
212
|
+
contextItems?: GenericMDtBtn[];
|
|
213
|
+
hideAutoMessage?: boolean;
|
|
214
|
+
headers: string[] | Partial<QTableProps['columns']> | any[];
|
|
215
|
+
serviceName?: MDtServiceNameStringProp | MDtServiceNameCallbackProp;
|
|
216
|
+
requestParams?: MDtRequestParamsObjectProp | MDtRequestParamsCallbackProp;
|
|
217
|
+
pdf?: boolean;
|
|
218
|
+
excel?: boolean;
|
|
219
|
+
exportUrl?: MDtExportOptions | boolean;
|
|
220
|
+
hideSearch?: boolean;
|
|
221
|
+
searchDebounce?: string | number;
|
|
222
|
+
withIndex?: string | string[];
|
|
223
|
+
withStore?: string | string[];
|
|
224
|
+
withShow?: string | string[];
|
|
225
|
+
withUpdate?: string | string[];
|
|
226
|
+
hideAddBtn?: boolean;
|
|
227
|
+
hideUpdateBtn?: boolean;
|
|
228
|
+
hideShowBtn?: boolean;
|
|
229
|
+
hideDestroyBtn?: boolean;
|
|
230
|
+
storeRoute?: string | RouteLocationRaw;
|
|
231
|
+
storeQueryParams?: boolean;
|
|
232
|
+
updateRoute?: string | RouteLocationRaw;
|
|
233
|
+
updateQueryParams?: boolean;
|
|
234
|
+
showRoute?: string | RouteLocationRaw;
|
|
235
|
+
showQueryParams?: boolean;
|
|
236
|
+
mouse?: boolean;
|
|
237
|
+
noRefreshBtn?: boolean;
|
|
238
|
+
endReach?: boolean;
|
|
239
|
+
showSelection?: boolean;
|
|
240
|
+
hideSelection?: boolean;
|
|
241
|
+
multiSelection?: boolean;
|
|
242
|
+
multiDestroy?: boolean;
|
|
243
|
+
rowsPerPageOptions?: (string | number)[];
|
|
244
|
+
ignoreKeys?: string[] | ((form: Record<string, any>) => string[]) | any[];
|
|
245
|
+
manageColumns?: boolean;
|
|
246
|
+
visibleColumns?: (string | null | undefined)[] | any[];
|
|
247
|
+
searchColumns?: string[];
|
|
248
|
+
/**
|
|
249
|
+
* Show Add btn top of table,
|
|
250
|
+
*/
|
|
251
|
+
addTopBtn?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Show Add btn inside more list
|
|
254
|
+
*/
|
|
255
|
+
addListBtn?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* Show Fab Add btn
|
|
258
|
+
*/
|
|
259
|
+
addFabBtn?: boolean;
|
|
260
|
+
/**
|
|
261
|
+
* make datatable fullscreen mode
|
|
262
|
+
*/
|
|
263
|
+
fullscreenBtn?: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Auto actions body headers 'control'
|
|
266
|
+
*/
|
|
267
|
+
noBodyControl?: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Auto actions card 'control'
|
|
270
|
+
*/
|
|
271
|
+
showCardControlHeader?: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* Set datatable to fixed view
|
|
274
|
+
*/
|
|
275
|
+
fixed?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* Names of image columns in the table.
|
|
278
|
+
*/
|
|
279
|
+
imageColumns?: string[] | any[];
|
|
280
|
+
/**
|
|
281
|
+
* How to display image button in table.
|
|
282
|
+
*/
|
|
283
|
+
imageMode?: 'icon' | 'image';
|
|
284
|
+
/**
|
|
285
|
+
* Image size in display
|
|
286
|
+
*/
|
|
287
|
+
imageSize?: string;
|
|
288
|
+
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export interface MDtAvatarProps extends QAvatarProps {
|
|
292
|
+
width?: string;
|
|
293
|
+
src?: string;
|
|
294
|
+
href?: string;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export interface MDtAvatarSlots extends QAvatarSlots {
|
|
298
|
+
/**
|
|
299
|
+
* Default slot can be used for captions. See examples
|
|
300
|
+
*/
|
|
301
|
+
default: () => VNode[];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface MDtContextmenuItemsProps {
|
|
305
|
+
items: MDatatableProps['contextItems'],
|
|
306
|
+
item: UnwrapRef<MDatatableDialogsOptions['item']>,
|
|
307
|
+
index: UnwrapRef<MDatatableDialogsOptions['index']>,
|
|
308
|
+
displayMode?: 'icon' | 'item'
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface MDtContextmenuItemsSlots {
|
|
312
|
+
/**
|
|
313
|
+
* Default slot can be used for captions. See examples
|
|
314
|
+
*/
|
|
315
|
+
default: () => VNode[];
|
|
316
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MyTh Ahmed Faiz Copyright © 2016-2024 All rights reserved.
|
|
3
|
+
* Email: mythpe@gmail.com
|
|
4
|
+
* Mobile: +966590470092
|
|
5
|
+
* Website: https://www.4myth.com
|
|
6
|
+
* Github: https://github.com/mythpe
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/// <reference types="google.maps" />
|
|
10
|
+
|
|
11
|
+
export interface CoordsProps {
|
|
12
|
+
latitude: number;
|
|
13
|
+
longitude: number;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MyTh Ahmed Faiz Copyright © 2016-2024 All rights reserved.
|
|
3
|
+
* Email: mythpe@gmail.com
|
|
4
|
+
* Mobile: +966590470092
|
|
5
|
+
* Website: https://www.4myth.com
|
|
6
|
+
* Github: https://github.com/mythpe
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { AxiosError, AxiosResponse } from 'axios'
|
|
10
|
+
import type { DialogChainObject, QNotifyCreateOptions, QNotifyUpdateOptions, QTableProps } from 'quasar'
|
|
11
|
+
import type { MDatatableProps } from './m-datatable'
|
|
12
|
+
|
|
13
|
+
export type ParseHeaderOptions = {
|
|
14
|
+
controlKey?: 'control' | string
|
|
15
|
+
controlStyle?: 'max-width: 150px' | string
|
|
16
|
+
align?: 'left' | 'right' | 'center' | undefined
|
|
17
|
+
sortable?: boolean | undefined;
|
|
18
|
+
classes?: string | (() => string),
|
|
19
|
+
noSort?: string[]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type MDtColumn = QTableProps['columns'][number]
|
|
23
|
+
|
|
24
|
+
export type MDtHeadersParameter = MDtColumn[] | (keyof MDatatableProps['defaultItem'])[]
|
|
25
|
+
|
|
26
|
+
// Axios
|
|
27
|
+
type Generic = Record<any, any>;
|
|
28
|
+
|
|
29
|
+
export type ApiMetaInterface = {
|
|
30
|
+
// server current page
|
|
31
|
+
current_page: number | null;
|
|
32
|
+
// server last page
|
|
33
|
+
last_page: number | null;
|
|
34
|
+
// server total items
|
|
35
|
+
total: number | null;
|
|
36
|
+
[K: any]: any;
|
|
37
|
+
};
|
|
38
|
+
export type ApiErrorInterface = Record<string, string[]>;
|
|
39
|
+
export type ApiErrorsInterface = ApiErrorInterface[];
|
|
40
|
+
|
|
41
|
+
export type ApiModel<T extends Generic = Generic> = {
|
|
42
|
+
id: string | number;
|
|
43
|
+
value: string | number;
|
|
44
|
+
label?: string;
|
|
45
|
+
[K: keyof T]: any;
|
|
46
|
+
[s: string]: any;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
type ResponseAsMain = Generic & {
|
|
50
|
+
success: boolean;
|
|
51
|
+
errors: ApiErrorsInterface;
|
|
52
|
+
message: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
type ResponseAsModel<T extends Generic = Generic> = ResponseAsMain & {
|
|
56
|
+
data: ApiModel<T>
|
|
57
|
+
}
|
|
58
|
+
type ResponseAsList<T extends Generic = Generic> = ResponseAsMain & {
|
|
59
|
+
data: ResponseAsModel<T>[];
|
|
60
|
+
links: {
|
|
61
|
+
first: string;
|
|
62
|
+
last: string;
|
|
63
|
+
prev: string | null;
|
|
64
|
+
next: string | null;
|
|
65
|
+
}
|
|
66
|
+
meta: ApiMetaInterface;
|
|
67
|
+
}
|
|
68
|
+
type ResponseDataType = ResponseAsList | ResponseAsModel | Generic;
|
|
69
|
+
export type ApiFulfilledResponse = AxiosResponse<ResponseDataType>
|
|
70
|
+
export type ApiErrorResponse = AxiosError<ResponseDataType>;
|
|
71
|
+
|
|
72
|
+
export type ApiInterface = ApiFulfilledResponse & {
|
|
73
|
+
_data: ResponseDataType;
|
|
74
|
+
_message: ResponseAsMain['message'];
|
|
75
|
+
_meta: ResponseAsList['meta'];
|
|
76
|
+
_success: ResponseAsMain['success'];
|
|
77
|
+
_errors: ResponseAsMain['errors'];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Axios
|
|
81
|
+
|
|
82
|
+
export type Vue3MAlertMessageOptions = QNotifyCreateOptions | string
|
|
83
|
+
|
|
84
|
+
export type Vue3MAlertMessage = (props?: QNotifyUpdateOptions) => void;
|
|
85
|
+
|
|
86
|
+
export type Vue3MConfirmMessage = DialogChainObject
|
|
87
|
+
|
|
88
|
+
export type DownloadFromResponse = {
|
|
89
|
+
status: boolean;
|
|
90
|
+
response: AxiosResponse;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export type DownloadFromResponseCode = 'no_response' | 'no_file_name' | 'no_file_url' | 'unknown' | string
|
|
94
|
+
export type DownloadFromResponseError = {
|
|
95
|
+
code: DownloadFromResponseCode
|
|
96
|
+
status: boolean;
|
|
97
|
+
}
|