@mythpe/quasar-ui-qui 0.0.23-dev → 0.0.24-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 +4 -0
- package/package.json +8 -5
- package/src/components/form/MAvatarViewer.vue +324 -0
- package/src/components/form/MBtn.vue +258 -91
- package/src/components/form/MCheckbox.vue +123 -0
- package/src/components/form/MColor.vue +122 -0
- package/src/components/form/MDate.vue +47 -0
- package/src/components/form/MEditor.vue +285 -0
- package/src/components/form/MEmail.vue +40 -0
- package/src/components/form/MField.vue +142 -0
- package/src/components/form/MFile.vue +209 -0
- package/src/components/form/MForm.vue +83 -0
- package/src/components/form/MHidden.vue +83 -0
- package/src/components/form/MHiddenInput.vue +55 -0
- package/src/components/form/MInput.vue +62 -65
- package/src/components/form/MInputFieldControl.vue +4 -1
- package/src/components/form/MInputLabel.vue +6 -2
- package/src/components/form/MMobile.vue +37 -0
- package/src/components/form/MPicker.vue +310 -0
- package/src/components/form/MRadio.vue +175 -0
- package/src/components/form/MSelect.vue +343 -0
- package/src/components/form/MTime.vue +45 -0
- package/src/components/form/index.ts +38 -1
- package/src/components/grid/MBlock.vue +31 -17
- package/src/components/grid/MCol.vue +2 -14
- package/src/components/grid/MContainer.vue +21 -12
- package/src/components/grid/MHelpRow.vue +4 -9
- package/src/components/grid/MRow.vue +22 -9
- package/src/components/index.ts +1 -0
- package/src/components/transition/MFadeTransition.vue +27 -0
- package/src/components/transition/MFadeXTransition.vue +26 -0
- package/src/components/transition/MTransition.vue +41 -0
- package/src/components/transition/index.ts +13 -0
- package/src/components/typography/index.ts +1 -0
- package/src/composable/index.ts +3 -1
- package/src/composable/{useHelpersMyth.ts → useBindInput.ts} +92 -62
- package/src/composable/useError.ts +11 -0
- package/src/composable/useMyth.ts +280 -3
- package/src/composable/useValue.ts +12 -0
- package/src/index.sass +7 -33
- package/src/style/m-container.sass +13 -0
- package/src/style/main.sass +42 -0
- package/src/types/api-helpers.d.ts +120 -0
- package/src/types/components.d.ts +550 -52
- package/src/types/dt.d.ts +142 -0
- package/src/types/index.d.ts +128 -47
- package/src/types/lodash.d.ts +26 -0
- package/src/types/quasar-helpers.d.ts +7 -0
- package/src/types/theme.d.ts +12 -0
- package/src/utils/Helpers.ts +321 -0
- package/src/utils/Str.ts +210 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/myth.ts +75 -22
- package/src/utils/vee-rules.ts +2 -1
- package/src/utils/vue-plugin.ts +80 -3
- package/tsconfig.json +8 -11
|
@@ -6,12 +6,49 @@
|
|
|
6
6
|
* Github: https://github.com/mythpe
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type {
|
|
10
|
-
|
|
9
|
+
import type {
|
|
10
|
+
GlobalComponentConstructor,
|
|
11
|
+
QAvatarProps,
|
|
12
|
+
QAvatarSlots,
|
|
13
|
+
QBtnProps,
|
|
14
|
+
QBtnSlots,
|
|
15
|
+
QCheckboxProps,
|
|
16
|
+
QDateProps, QEditorProps, QEditorSlots,
|
|
17
|
+
QFieldSlots,
|
|
18
|
+
QFileProps,
|
|
19
|
+
QFileSlots,
|
|
20
|
+
QImgProps,
|
|
21
|
+
QInputProps,
|
|
22
|
+
QInputSlots,
|
|
23
|
+
QItemProps,
|
|
24
|
+
QRadioProps, QSelectProps, QTableProps,
|
|
25
|
+
QTimeProps
|
|
26
|
+
} from 'quasar'
|
|
27
|
+
import type { MaybeRefOrGetter, TransitionGroupProps, TransitionProps, UnwrapNestedRefs, VNode } from 'vue'
|
|
11
28
|
import type { TypedOptions } from 'typed.js'
|
|
12
|
-
import type { FieldContext, FieldOptions } from 'vee-validate'
|
|
29
|
+
import type { FieldContext, FieldOptions, FormContext, FormOptions, FormState } from 'vee-validate'
|
|
13
30
|
|
|
14
|
-
|
|
31
|
+
import type { ThemeShadow, ThemeSize } from './theme'
|
|
32
|
+
import type {
|
|
33
|
+
GenericMDtBtn, MDtExportOptions,
|
|
34
|
+
MDtItem,
|
|
35
|
+
MDtRequestParamsCallbackProp,
|
|
36
|
+
MDtRequestParamsObjectProp,
|
|
37
|
+
MDtServiceNameCallbackProp,
|
|
38
|
+
MDtServiceNameStringProp
|
|
39
|
+
} from './dt'
|
|
40
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
41
|
+
|
|
42
|
+
export type MTransitionProps = TransitionGroupProps & {
|
|
43
|
+
enterIn?: string;
|
|
44
|
+
enterOut?: string;
|
|
45
|
+
slowIn?: boolean;
|
|
46
|
+
slowOut?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type MTransitionsSlots = {
|
|
50
|
+
default: () => VNode[];
|
|
51
|
+
}
|
|
15
52
|
|
|
16
53
|
export interface MBtnProps extends QBtnProps {
|
|
17
54
|
//
|
|
@@ -33,15 +70,15 @@ export interface MBlockProps {
|
|
|
33
70
|
* Size of the padding block.
|
|
34
71
|
* Default: 'md'
|
|
35
72
|
*/
|
|
36
|
-
|
|
73
|
+
size?: ThemeSize | undefined;
|
|
37
74
|
/**
|
|
38
75
|
* Rounded block
|
|
39
76
|
*/
|
|
40
|
-
|
|
77
|
+
rounded?: boolean | undefined;
|
|
41
78
|
/**
|
|
42
79
|
* Shadow level
|
|
43
80
|
*/
|
|
44
|
-
|
|
81
|
+
shadow?: ThemeShadow | undefined;
|
|
45
82
|
}
|
|
46
83
|
|
|
47
84
|
export interface MBlockSlots {
|
|
@@ -82,14 +119,14 @@ export type ColStyleType =
|
|
|
82
119
|
| 12
|
|
83
120
|
|
|
84
121
|
export interface MColProps {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
122
|
+
auto?: boolean | undefined;
|
|
123
|
+
col?: ColStyleType;
|
|
124
|
+
xs?: ColStyleType;
|
|
125
|
+
sm?: ColStyleType;
|
|
126
|
+
md?: ColStyleType;
|
|
127
|
+
lg?: ColStyleType;
|
|
128
|
+
xl?: ColStyleType;
|
|
129
|
+
name?: string;
|
|
93
130
|
}
|
|
94
131
|
|
|
95
132
|
export interface MColSlots {
|
|
@@ -104,10 +141,10 @@ export interface MColumnSlots {
|
|
|
104
141
|
default?: () => VNode[];
|
|
105
142
|
}
|
|
106
143
|
|
|
107
|
-
export
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
144
|
+
export type MContainerProps = {
|
|
145
|
+
size?: ThemeSize | string | undefined;
|
|
146
|
+
dense?: boolean | undefined;
|
|
147
|
+
fluid?: boolean | undefined;
|
|
111
148
|
}
|
|
112
149
|
|
|
113
150
|
export interface MContainerSlots {
|
|
@@ -118,11 +155,11 @@ export interface MRowProps {
|
|
|
118
155
|
/**
|
|
119
156
|
* Default: false.
|
|
120
157
|
*/
|
|
121
|
-
gutter?: boolean |
|
|
158
|
+
gutter?: boolean | ThemeSize | undefined;
|
|
122
159
|
/**
|
|
123
160
|
* Default: false.
|
|
124
161
|
*/
|
|
125
|
-
col?: boolean |
|
|
162
|
+
col?: boolean | ThemeSize | undefined;
|
|
126
163
|
}
|
|
127
164
|
|
|
128
165
|
export interface MRowSlots {
|
|
@@ -154,55 +191,179 @@ export interface MTypingStringSlots {
|
|
|
154
191
|
default?: () => VNode[];
|
|
155
192
|
}
|
|
156
193
|
|
|
157
|
-
export
|
|
158
|
-
|
|
194
|
+
export interface BaseInputFieldPropContext extends FieldContext<any> {
|
|
195
|
+
//
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface BaseInputFieldProps {
|
|
159
199
|
/**
|
|
160
200
|
* Context of field input.
|
|
161
201
|
*/
|
|
162
202
|
field: UnwrapNestedRefs<BaseInputFieldPropContext>;
|
|
163
|
-
|
|
203
|
+
label?: string | undefined;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface MInputFieldControlProps {
|
|
207
|
+
[k: string]: any;
|
|
164
208
|
}
|
|
165
209
|
|
|
166
|
-
export
|
|
167
|
-
export type MInputFieldControlSlots = {
|
|
210
|
+
export interface MInputFieldControlSlots {
|
|
168
211
|
default: () => VNode[];
|
|
169
212
|
}
|
|
170
213
|
|
|
171
|
-
export
|
|
172
|
-
|
|
214
|
+
export interface MInputLabelProps extends BaseInputFieldProps {
|
|
215
|
+
//
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export interface MInputLabelSlots {
|
|
173
219
|
default?: () => VNode[];
|
|
174
220
|
}
|
|
175
221
|
|
|
176
|
-
export
|
|
222
|
+
export interface ViewModeProps {
|
|
177
223
|
/**
|
|
178
224
|
* Set input to vie mode use q-field
|
|
179
225
|
*/
|
|
180
|
-
|
|
226
|
+
viewMode?: boolean;
|
|
181
227
|
/**
|
|
182
228
|
* View Mode value for input or modelValue.
|
|
183
229
|
*/
|
|
184
|
-
|
|
230
|
+
viewModeValue?: any | undefined;
|
|
185
231
|
}
|
|
186
|
-
|
|
232
|
+
|
|
233
|
+
export interface InputHelpProps {
|
|
187
234
|
/**
|
|
188
235
|
* Information text with Icon.
|
|
189
236
|
*/
|
|
190
|
-
|
|
237
|
+
help?: string;
|
|
191
238
|
}
|
|
192
|
-
|
|
239
|
+
|
|
240
|
+
export interface InputHelpSlots {
|
|
193
241
|
/**
|
|
194
242
|
* VNode bottom of input & before 'bottom-input slot'.
|
|
195
243
|
*/
|
|
196
244
|
help: () => VNode[];
|
|
197
245
|
}
|
|
246
|
+
|
|
198
247
|
export type InputRulesContext = string | string[] | Record<string, any> | undefined;
|
|
199
248
|
export type InputErrorsContext = string[];
|
|
200
249
|
export type InputFormErrorsContext = Record<string, InputErrorsContext> | undefined;
|
|
201
|
-
|
|
250
|
+
|
|
251
|
+
export type MAvatarViewerModelValue = File | null | undefined;
|
|
252
|
+
|
|
253
|
+
export type MAvatarViewerProps = QAvatarProps & MColProps & {
|
|
254
|
+
/**
|
|
255
|
+
* Comma separated list of unique file type specifiers. Maps to 'accept' attribute of native input type=file element
|
|
256
|
+
*/
|
|
257
|
+
accept?: string | string [] | null | Record<string, string>;
|
|
258
|
+
/**
|
|
259
|
+
* Add accept file type.
|
|
260
|
+
*/
|
|
261
|
+
images?: boolean | string;
|
|
262
|
+
/**
|
|
263
|
+
* Add accept svg type.
|
|
264
|
+
*/
|
|
265
|
+
svg?: boolean | string;
|
|
266
|
+
/**
|
|
267
|
+
* Add accept video type.
|
|
268
|
+
*/
|
|
269
|
+
video?: boolean | string;
|
|
270
|
+
/**
|
|
271
|
+
* Add accept pdf type.
|
|
272
|
+
*/
|
|
273
|
+
pdf?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Add accept excel type.
|
|
276
|
+
*/
|
|
277
|
+
excel?: boolean | string;
|
|
278
|
+
/**
|
|
279
|
+
* Show text if no image
|
|
280
|
+
*/
|
|
281
|
+
avatarText?: string;
|
|
282
|
+
/**
|
|
283
|
+
* How the image will fit into the container; Equivalent of the object-fit prop; Can be coordinated with 'position' prop
|
|
284
|
+
* Default value: cover
|
|
285
|
+
*/
|
|
286
|
+
fit?: QImgProps['fit'];
|
|
287
|
+
/**
|
|
288
|
+
* Can clear the input & not required
|
|
289
|
+
*/
|
|
290
|
+
clearable?: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* The label that will appear above the image
|
|
293
|
+
*/
|
|
294
|
+
label?: string;
|
|
295
|
+
/**
|
|
296
|
+
* List of error messages.
|
|
297
|
+
*/
|
|
298
|
+
errors?: InputErrorsContext;
|
|
299
|
+
/**
|
|
300
|
+
* List of form errors.
|
|
301
|
+
*/
|
|
302
|
+
formErrors?: InputFormErrorsContext;
|
|
303
|
+
/**
|
|
304
|
+
* Model of the component;
|
|
305
|
+
* Must be FileList or Array if using 'multiple' prop;
|
|
306
|
+
* Either use this property (along with a listener for 'update:modelValue' event) OR use v-model directive
|
|
307
|
+
*/
|
|
308
|
+
modelValue?: MAvatarViewerModelValue;
|
|
309
|
+
/**
|
|
310
|
+
* The name of the file for the image used and the field.
|
|
311
|
+
* Example: name='avatar' { avatar: https://4myth.com, avatarBlob: Blob, avatarRemoved: !0 | !1 }
|
|
312
|
+
*/
|
|
313
|
+
name?: string;
|
|
314
|
+
/**
|
|
315
|
+
* Avatar url.
|
|
316
|
+
* (along with a listener for 'update:url' event) OR use v-model directive
|
|
317
|
+
*/
|
|
318
|
+
url?: string;
|
|
319
|
+
/**
|
|
320
|
+
* value if user remove the image
|
|
321
|
+
* (along with a listener for 'update:removed' event) OR use v-model directive
|
|
322
|
+
*/
|
|
323
|
+
removed?: boolean;
|
|
324
|
+
/**
|
|
325
|
+
* Input hint.
|
|
326
|
+
*/
|
|
327
|
+
hint?: string;
|
|
328
|
+
hintProps?: Record<string, any>;
|
|
329
|
+
|
|
330
|
+
caption?: string;
|
|
331
|
+
captionProps?: Record<string, any>;
|
|
332
|
+
/**
|
|
333
|
+
* Help text after label.
|
|
334
|
+
*/
|
|
335
|
+
help?: string;
|
|
336
|
+
/**
|
|
337
|
+
* Set input to readonly.
|
|
338
|
+
*/
|
|
339
|
+
readonly?: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Loading for skeleton.
|
|
342
|
+
*/
|
|
343
|
+
loading?: boolean;
|
|
344
|
+
/**
|
|
345
|
+
* Input Required validation.
|
|
346
|
+
*/
|
|
347
|
+
required?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Input Validation Rules.
|
|
350
|
+
*/
|
|
351
|
+
rules?: InputRulesContext;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export interface MAvatarViewerSlots extends QAvatarSlots {
|
|
355
|
+
/**
|
|
356
|
+
* Field main content
|
|
357
|
+
*/
|
|
358
|
+
default: () => VNode[];
|
|
359
|
+
hint: () => VNode[];
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface BaseInputFormProps {
|
|
202
363
|
/**
|
|
203
364
|
* Input name.
|
|
204
365
|
*/
|
|
205
|
-
|
|
366
|
+
name: string;
|
|
206
367
|
/**
|
|
207
368
|
* Input model value.
|
|
208
369
|
* can be used instead of initialValue.
|
|
@@ -211,27 +372,27 @@ export type BaseInputFormProps = {
|
|
|
211
372
|
/**
|
|
212
373
|
* Input Label.
|
|
213
374
|
*/
|
|
214
|
-
|
|
375
|
+
label?: string | undefined;
|
|
215
376
|
/**
|
|
216
377
|
* Caption under label.
|
|
217
378
|
*/
|
|
218
|
-
|
|
379
|
+
caption?: string | undefined;
|
|
219
380
|
/**
|
|
220
381
|
* Input Hint.
|
|
221
382
|
*/
|
|
222
|
-
|
|
383
|
+
hint?: string | undefined;
|
|
223
384
|
/**
|
|
224
385
|
* Input Placeholder.
|
|
225
386
|
*/
|
|
226
|
-
|
|
387
|
+
placeholder?: string | undefined;
|
|
227
388
|
/**
|
|
228
389
|
* Input Required validation.
|
|
229
390
|
*/
|
|
230
|
-
|
|
391
|
+
required?: boolean;
|
|
231
392
|
/**
|
|
232
393
|
* Input Validation Rules.
|
|
233
394
|
*/
|
|
234
|
-
|
|
395
|
+
rules?: InputRulesContext;
|
|
235
396
|
/**
|
|
236
397
|
* Input Error Messages.
|
|
237
398
|
*/
|
|
@@ -247,30 +408,38 @@ export type BaseInputFormProps = {
|
|
|
247
408
|
* else, will set the attribute value.
|
|
248
409
|
* Default: undefined.
|
|
249
410
|
*/
|
|
250
|
-
|
|
411
|
+
autocomplete?: boolean | string | undefined;
|
|
251
412
|
/**
|
|
252
413
|
* Inputs Top Label.
|
|
253
414
|
*/
|
|
254
|
-
|
|
415
|
+
topLabel?: boolean;
|
|
255
416
|
/**
|
|
256
417
|
* Mobile Rule.
|
|
257
418
|
*/
|
|
258
|
-
|
|
419
|
+
mobile?: boolean | string | number | undefined;
|
|
259
420
|
/**
|
|
260
421
|
* Email Rule.
|
|
261
422
|
*/
|
|
262
|
-
|
|
423
|
+
email?: boolean;
|
|
263
424
|
/**
|
|
264
425
|
* Number Rule.
|
|
265
426
|
*/
|
|
266
|
-
|
|
427
|
+
float?: boolean;
|
|
267
428
|
/**
|
|
268
429
|
* vee-validate Field Options.
|
|
269
430
|
*/
|
|
270
|
-
|
|
431
|
+
fieldOptions?: Partial<FieldOptions> | MaybeRefOrGetter<Partial<FieldOptions>>;
|
|
432
|
+
/**
|
|
433
|
+
* choice key of auto placeholder.
|
|
434
|
+
*/
|
|
435
|
+
useChoice?: boolean | string;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
export interface BaseInputsProps extends ViewModeProps, InputHelpProps, Omit<MColProps, 'name'>, BaseInputFormProps {
|
|
439
|
+
//
|
|
271
440
|
}
|
|
272
|
-
|
|
273
|
-
export
|
|
441
|
+
|
|
442
|
+
export interface BaseInputsSlots extends InputHelpSlots {
|
|
274
443
|
/**
|
|
275
444
|
* VNode top of input & top of 'top label slot'.
|
|
276
445
|
*/
|
|
@@ -296,15 +465,338 @@ export type BaseInputsSlots = InputHelpSlots & {
|
|
|
296
465
|
export interface MInputProps extends Omit<QInputProps, 'rules' | 'name' | 'modelValue' | 'label' | 'hint'>, BaseInputsProps {
|
|
297
466
|
//
|
|
298
467
|
}
|
|
299
|
-
|
|
468
|
+
|
|
469
|
+
export interface MInputSlots extends QInputSlots, QFieldSlots, BaseInputsSlots {
|
|
470
|
+
//
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export type MEditorProps = Omit<QEditorProps, 'modelValue' | 'placeholder'> & BaseInputsProps
|
|
474
|
+
export type MEditorSlots = QEditorSlots & BaseInputsSlots
|
|
475
|
+
|
|
476
|
+
export type MSelectModelEmit = { value: any | null; model: object | null }
|
|
477
|
+
export type MSelectProps = Omit<QSelectProps, 'rules' | 'name' | 'modelValue' | 'label' | 'hint' | 'autocomplete'> & BaseInputsProps & {
|
|
478
|
+
/**
|
|
479
|
+
* Input search functionality. useInput prop for this feature.
|
|
480
|
+
*/
|
|
481
|
+
search?: string | null | undefined;
|
|
482
|
+
/**
|
|
483
|
+
* Minimum characters to start searching. Default is 1.
|
|
484
|
+
*/
|
|
485
|
+
searchLength?: string | number;
|
|
486
|
+
/**
|
|
487
|
+
* hide the default empty list message.
|
|
488
|
+
*/
|
|
489
|
+
hideEmptyList?: boolean | undefined;
|
|
490
|
+
/**
|
|
491
|
+
* Disable filter functionality.
|
|
492
|
+
*/
|
|
493
|
+
noFilter?: boolean | undefined;
|
|
494
|
+
/**
|
|
495
|
+
* Set mode of component to axios of filter & search.
|
|
496
|
+
* if set to true, component will fetch data from api and don't do filter functionality.
|
|
497
|
+
*/
|
|
498
|
+
axiosMode?: boolean | undefined;
|
|
499
|
+
/**
|
|
500
|
+
* Fetch Data on mounted
|
|
501
|
+
*/
|
|
502
|
+
// iniData?: boolean;
|
|
503
|
+
}
|
|
504
|
+
export type MSelectSlots = QInputSlots & QFieldSlots & BaseInputsSlots
|
|
505
|
+
|
|
506
|
+
export type MFileProps =
|
|
507
|
+
Omit<QFileProps, 'modelValue' | 'rules' | 'name' | 'label' | 'hint'>
|
|
508
|
+
& Omit<BaseInputsProps, 'autocomplete'>
|
|
509
|
+
& {
|
|
510
|
+
accept?: string | undefined;
|
|
511
|
+
images?: boolean;
|
|
512
|
+
svg?: boolean;
|
|
513
|
+
video?: boolean;
|
|
514
|
+
pdf?: boolean;
|
|
515
|
+
excel?: boolean;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
export type MFileSlots = QFileSlots & BaseInputsSlots
|
|
519
|
+
|
|
520
|
+
export interface BaseCheckboxProps extends Omit<BaseInputsProps, 'topLabel'> {
|
|
521
|
+
/**
|
|
522
|
+
* Input row props.
|
|
523
|
+
*/
|
|
524
|
+
rowProps?: Record<string, any>;
|
|
525
|
+
/**
|
|
526
|
+
* Input column props.
|
|
527
|
+
*/
|
|
528
|
+
colProps?: Record<string, any>;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export interface MCheckboxProps extends Omit<QCheckboxProps, 'name' | 'modelValue' | 'label'>, BaseCheckboxProps {
|
|
532
|
+
//
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export interface MCheckboxSlots extends Omit<BaseInputsSlots, 'top-label'> {
|
|
536
|
+
/**
|
|
537
|
+
* VNode before field main content.
|
|
538
|
+
*/
|
|
539
|
+
before: () => VNode[];
|
|
540
|
+
/**
|
|
541
|
+
* VNode after field main content.
|
|
542
|
+
*/
|
|
543
|
+
after: () => VNode[];
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
export interface MRadioProps extends Omit<QRadioProps, 'name' | 'modelValue' | 'label'>, BaseCheckboxProps {
|
|
547
|
+
//
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
export interface MRadioSlots extends MCheckboxSlots {
|
|
551
|
+
//
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export interface MPickerProps extends BaseInputsProps,
|
|
555
|
+
Omit<QDateProps, 'modelValue' | 'options'>,
|
|
556
|
+
Omit<QTimeProps, 'modelValue'> {
|
|
557
|
+
/**
|
|
558
|
+
* Initial value of the picker.
|
|
559
|
+
* Default is: null.
|
|
560
|
+
*/
|
|
561
|
+
modelValue?: any;
|
|
562
|
+
/**
|
|
563
|
+
* Type of picker. 'date' or 'time'.
|
|
564
|
+
* Default is: 'date'.
|
|
565
|
+
*/
|
|
566
|
+
type?: 'date' | 'time';
|
|
567
|
+
/**
|
|
568
|
+
* QBtn props for append button.
|
|
569
|
+
*/
|
|
570
|
+
btnProps?: QBtnProps;
|
|
571
|
+
/**
|
|
572
|
+
* Value of separator for range picker.
|
|
573
|
+
* Default is: ' - '.
|
|
574
|
+
*/
|
|
575
|
+
rangeSeparator?: string;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
export interface MPickerSlots extends MInputSlots {
|
|
579
|
+
//
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export interface MDateProps extends Omit<MPickerProps, 'type'> {
|
|
583
|
+
//
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
export interface MDateSlots extends MPickerSlots {
|
|
587
|
+
//
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export interface MTimeProps extends Omit<MPickerProps, 'type'> {
|
|
591
|
+
//
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export interface MTimeSlots extends MPickerSlots {
|
|
595
|
+
//
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export type MFieldProps = Omit<MInputProps, 'viewMode' | 'viewModeValue' | 'fieldOptions'>
|
|
599
|
+
export type MFieldSlots = MInputSlots
|
|
600
|
+
|
|
601
|
+
export type MHiddenInputSlots = object
|
|
602
|
+
export type MHiddenInputProps = Pick<BaseInputFormProps, 'rules' | 'required'> & {
|
|
603
|
+
/**
|
|
604
|
+
* Input name.
|
|
605
|
+
*/
|
|
606
|
+
name: string;
|
|
607
|
+
/**
|
|
608
|
+
* Input model value.
|
|
609
|
+
*/
|
|
610
|
+
modelValue?: any;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
export type MHiddenProps = MHiddenInputProps & Pick<ViewModeProps, 'viewMode'> & Omit<MColProps, 'name'>
|
|
614
|
+
export type MHiddenSlots = {
|
|
615
|
+
/**
|
|
616
|
+
* Field main content
|
|
617
|
+
*/
|
|
618
|
+
default: () => VNode[];
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
export interface MFormProps {
|
|
622
|
+
/**
|
|
623
|
+
* Form HTML element attributes.
|
|
624
|
+
*/
|
|
625
|
+
formProps?: Record<string, any>;
|
|
626
|
+
/**
|
|
627
|
+
* Default options of useForm.
|
|
628
|
+
*/
|
|
629
|
+
opts?: FormOptions<Record<string, any>>;
|
|
630
|
+
/**
|
|
631
|
+
* The target to which the page will be scrolled.
|
|
632
|
+
* Default is: Window.
|
|
633
|
+
*/
|
|
634
|
+
target?: HTMLElement | string | undefined;
|
|
635
|
+
/**
|
|
636
|
+
* Emit values instead controlled values.
|
|
637
|
+
* Default is: false.
|
|
638
|
+
*/
|
|
639
|
+
emitValues?: boolean;
|
|
640
|
+
/**
|
|
641
|
+
* Watch to reset form values.
|
|
642
|
+
*/
|
|
643
|
+
readonly state?: MaybeRefOrGetter<Partial<FormState<Record<string, any>>>>;
|
|
644
|
+
/**
|
|
645
|
+
* Watch to reset form values.
|
|
646
|
+
*/
|
|
647
|
+
readonly form?: MaybeRefOrGetter<Record<string, any>>;
|
|
648
|
+
/**
|
|
649
|
+
* Watch to set form values.
|
|
650
|
+
*/
|
|
651
|
+
readonly values?: MaybeRefOrGetter<Record<string, any>>;
|
|
652
|
+
/**
|
|
653
|
+
* Watch to set form errors.
|
|
654
|
+
*/
|
|
655
|
+
readonly errors?: MaybeRefOrGetter<Record<string, string | string[]>>;
|
|
656
|
+
/**
|
|
657
|
+
* Apply padding to form.
|
|
658
|
+
*/
|
|
659
|
+
readonly padding?: boolean;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export type MFormScope = FormContext<Record<string, any>>;
|
|
663
|
+
|
|
664
|
+
export interface MFormSlots {
|
|
665
|
+
default: (scope: MFormScope) => VNode[];
|
|
666
|
+
}
|
|
667
|
+
export declare type GenericFormValues = Record<any, any>;
|
|
668
|
+
|
|
669
|
+
export interface MDtBtnProps extends MBtnProps {
|
|
670
|
+
show?: boolean;
|
|
671
|
+
update?: boolean;
|
|
672
|
+
destroy?: boolean;
|
|
673
|
+
tooltip?: string | undefined;
|
|
674
|
+
color?: string;
|
|
675
|
+
icon?: string;
|
|
676
|
+
listItem?: boolean;
|
|
677
|
+
fabMini?: boolean;
|
|
678
|
+
flat?: boolean;
|
|
679
|
+
round?: boolean;
|
|
680
|
+
dense?: boolean;
|
|
681
|
+
label?: string | undefined;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export interface MDtBtnSlots extends MBtnSlots {
|
|
685
|
+
/**
|
|
686
|
+
* Use for custom content, instead of relying on 'icon' and 'label' props
|
|
687
|
+
*/
|
|
688
|
+
default: () => VNode[];
|
|
689
|
+
/**
|
|
690
|
+
* Override the default QSpinner when in 'loading' state
|
|
691
|
+
*/
|
|
692
|
+
loading: () => VNode[];
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
export type MDatatableProps<I extends GenericFormValues = GenericFormValues> = Omit<QTableProps, 'rows' | 'rowsPerPageOptions' | 'visibleColumns'> & {
|
|
696
|
+
rows?: any[];
|
|
697
|
+
controlKey?: string;
|
|
698
|
+
defaultItem?: Partial<MDtItem<I>>
|
|
699
|
+
contextItems?: GenericMDtBtn[];
|
|
700
|
+
hideAutoMessage?: boolean;
|
|
701
|
+
headers: string[] | Partial<QTableProps['columns']> | any[];
|
|
702
|
+
serviceName?: MDtServiceNameStringProp | MDtServiceNameCallbackProp;
|
|
703
|
+
requestParams?: MDtRequestParamsObjectProp | MDtRequestParamsCallbackProp;
|
|
704
|
+
pdf?: boolean;
|
|
705
|
+
excel?: boolean;
|
|
706
|
+
exportUrl?: MDtExportOptions | boolean;
|
|
707
|
+
hideSearch?: boolean;
|
|
708
|
+
searchDebounce?: string | number;
|
|
709
|
+
withIndex?: string | string[];
|
|
710
|
+
withStore?: string | string[];
|
|
711
|
+
withShow?: string | string[];
|
|
712
|
+
withUpdate?: string | string[];
|
|
713
|
+
hideAddBtn?: boolean;
|
|
714
|
+
hideUpdateBtn?: boolean;
|
|
715
|
+
hideShowBtn?: boolean;
|
|
716
|
+
hideDestroyBtn?: boolean;
|
|
717
|
+
storeRoute?: string | RouteLocationRaw;
|
|
718
|
+
storeQueryParams?: boolean;
|
|
719
|
+
updateRoute?: string | RouteLocationRaw;
|
|
720
|
+
updateQueryParams?: boolean;
|
|
721
|
+
showRoute?: string | RouteLocationRaw;
|
|
722
|
+
showQueryParams?: boolean;
|
|
723
|
+
mouse?: boolean;
|
|
724
|
+
noRefreshBtn?: boolean;
|
|
725
|
+
endReach?: boolean;
|
|
726
|
+
showSelection?: boolean;
|
|
727
|
+
hideSelection?: boolean;
|
|
728
|
+
multiSelection?: boolean;
|
|
729
|
+
multiDestroy?: boolean;
|
|
730
|
+
rowsPerPageOptions?: (string | number)[];
|
|
731
|
+
ignoreKeys?: string[] | ((form: Record<string, any>) => string[]) | any[];
|
|
732
|
+
manageColumns?: boolean;
|
|
733
|
+
visibleColumns?: (string | null | undefined)[] | any[];
|
|
734
|
+
searchColumns?: string[];
|
|
735
|
+
/**
|
|
736
|
+
* Show Add btn top of table,
|
|
737
|
+
*/
|
|
738
|
+
addTopBtn?: boolean;
|
|
739
|
+
/**
|
|
740
|
+
* Show Add btn inside more list
|
|
741
|
+
*/
|
|
742
|
+
addListBtn?: boolean;
|
|
743
|
+
/**
|
|
744
|
+
* Show Fab Add btn
|
|
745
|
+
*/
|
|
746
|
+
addFabBtn?: boolean;
|
|
747
|
+
/**
|
|
748
|
+
* make datatable fullscreen mode
|
|
749
|
+
*/
|
|
750
|
+
fullscreenBtn?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Auto actions body headers 'control'
|
|
753
|
+
*/
|
|
754
|
+
noBodyControl?: boolean;
|
|
755
|
+
/**
|
|
756
|
+
* Auto actions card 'control'
|
|
757
|
+
*/
|
|
758
|
+
showCardControlHeader?: boolean;
|
|
759
|
+
/**
|
|
760
|
+
* Set datatable to fixed view
|
|
761
|
+
*/
|
|
762
|
+
fixed?: boolean;
|
|
763
|
+
/**
|
|
764
|
+
* Names of image columns in the table.
|
|
765
|
+
*/
|
|
766
|
+
imageColumns?: string[] | any[];
|
|
767
|
+
/**
|
|
768
|
+
* How to display image button in table.
|
|
769
|
+
*/
|
|
770
|
+
imageMode?: 'icon' | 'image';
|
|
771
|
+
/**
|
|
772
|
+
* Image size in display
|
|
773
|
+
*/
|
|
774
|
+
imageSize?: string;
|
|
775
|
+
|
|
776
|
+
}
|
|
300
777
|
|
|
301
778
|
declare module '@vue/runtime-core' {
|
|
302
779
|
interface GlobalComponents {
|
|
303
780
|
// Form.
|
|
781
|
+
MAvatarViewer: GlobalComponentConstructor<MAvatarViewerProps, MAvatarViewerSlots>;
|
|
304
782
|
MBtn: GlobalComponentConstructor<MBtnProps, MBtnSlots>;
|
|
305
|
-
|
|
783
|
+
MCheckbox: GlobalComponentConstructor<MCheckboxProps, MCheckboxSlots>;
|
|
784
|
+
MColor: GlobalComponentConstructor<MInputProps, MInputSlots>;
|
|
785
|
+
MDate: GlobalComponentConstructor<MDateProps, MDateSlots>;
|
|
786
|
+
MEditor: GlobalComponentConstructor<MEditorProps, MEditorSlots>;
|
|
787
|
+
MEmail: GlobalComponentConstructor<MInputProps, MInputSlots>;
|
|
788
|
+
MField: GlobalComponentConstructor<MFieldProps, MFieldSlots>;
|
|
789
|
+
MFile: GlobalComponentConstructor<MFileProps, MFileSlots>;
|
|
790
|
+
MForm: GlobalComponentConstructor<MFormProps, MFormSlots>;
|
|
791
|
+
MHidden: GlobalComponentConstructor<MHiddenProps, MHiddenSlots>;
|
|
792
|
+
MHiddenInput: GlobalComponentConstructor<MHiddenInputProps, MHiddenInputSlots>;
|
|
306
793
|
MInputFieldControl: GlobalComponentConstructor<MInputFieldControlProps, MInputFieldControlSlots>;
|
|
307
794
|
MInputLabel: GlobalComponentConstructor<MInputLabelProps, MInputLabelSlots>;
|
|
795
|
+
MMobile: GlobalComponentConstructor<MInputProps, MInputSlots>;
|
|
796
|
+
MPicker: GlobalComponentConstructor<MPickerProps, MPickerSlots>;
|
|
797
|
+
MRadio: GlobalComponentConstructor<MRadioProps, MRadioSlots>;
|
|
798
|
+
MSelect: GlobalComponentConstructor<MSelectProps, MSelectSlots>;
|
|
799
|
+
MTime: GlobalComponentConstructor<MTimeProps, MTimeSlots>;
|
|
308
800
|
|
|
309
801
|
// Grid.
|
|
310
802
|
MBlock: GlobalComponentConstructor<MBlockProps, MBlockSlots>;
|
|
@@ -313,7 +805,13 @@ declare module '@vue/runtime-core' {
|
|
|
313
805
|
MContainer: GlobalComponentConstructor<MContainerProps, MContainerSlots>;
|
|
314
806
|
MHelpRow: GlobalComponentConstructor<MHelpRowProps, MHelpRowSlots>;
|
|
315
807
|
MRow: GlobalComponentConstructor<MRowProps, MRowSlots>;
|
|
808
|
+
|
|
316
809
|
// Typography.
|
|
317
810
|
MTypingString: GlobalComponentConstructor<MTypingStringProps, MTypingStringSlots>;
|
|
811
|
+
|
|
812
|
+
// Transitions.
|
|
813
|
+
MTransition: GlobalComponentConstructor<MTransitionProps, MTransitionsSlots>;
|
|
814
|
+
MFadeTransition: GlobalComponentConstructor<TransitionProps, MTransitionsSlots>;
|
|
815
|
+
MFadeXTransition: GlobalComponentConstructor<TransitionProps, MTransitionsSlots>;
|
|
318
816
|
}
|
|
319
817
|
}
|