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