@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.
Files changed (93) hide show
  1. package/index.d.ts +13 -0
  2. package/package.json +17 -8
  3. package/src/boot/register.ts +14 -0
  4. package/src/components/datatable/MDatatable.vue +2305 -0
  5. package/src/components/datatable/MDtAvatar.vue +49 -0
  6. package/src/components/datatable/MDtBtn.vue +153 -0
  7. package/src/components/datatable/MDtContextmenuItems.vue +54 -0
  8. package/src/components/datatable/index.ts +6 -0
  9. package/src/components/form/MAvatarViewer.vue +327 -0
  10. package/src/components/form/MAxios.vue +144 -0
  11. package/src/components/form/MBtn.vue +271 -93
  12. package/src/components/form/MCheckbox.vue +150 -0
  13. package/src/components/form/MCkeditor.vue +403 -0
  14. package/src/components/form/MColor.vue +122 -0
  15. package/src/components/form/MDate.vue +50 -0
  16. package/src/components/form/MEditor.vue +285 -0
  17. package/src/components/form/MEmail.vue +43 -0
  18. package/src/components/form/MField.vue +148 -0
  19. package/src/components/form/MFile.vue +215 -0
  20. package/src/components/form/MForm.vue +89 -0
  21. package/src/components/form/MHidden.vue +86 -0
  22. package/src/components/form/MHiddenInput.vue +58 -0
  23. package/src/components/form/MInput.vue +178 -0
  24. package/src/components/form/MInputFieldControl.vue +27 -0
  25. package/src/components/form/MInputLabel.vue +38 -0
  26. package/src/components/form/MMobile.vue +43 -0
  27. package/src/components/form/MOptions.vue +255 -0
  28. package/src/components/form/MOtp.vue +292 -0
  29. package/src/components/form/MPassword.vue +73 -0
  30. package/src/components/form/MPicker.vue +313 -0
  31. package/src/components/form/MRadio.vue +181 -0
  32. package/src/components/form/MSelect.vue +352 -0
  33. package/src/components/form/MTime.vue +48 -0
  34. package/src/components/form/MToggle.vue +211 -0
  35. package/src/components/form/MUploader.vue +511 -0
  36. package/src/components/form/index.ts +65 -0
  37. package/src/components/grid/MBlock.vue +39 -18
  38. package/src/components/grid/MCol.vue +11 -15
  39. package/src/components/grid/MColumn.vue +12 -1
  40. package/src/components/grid/MContainer.vue +22 -13
  41. package/src/components/grid/MHelpRow.vue +13 -12
  42. package/src/components/grid/MRow.vue +31 -10
  43. package/src/components/grid/index.ts +16 -0
  44. package/src/components/index.ts +15 -0
  45. package/src/components/modal/MDialog.vue +58 -0
  46. package/src/components/modal/MModalMenu.vue +62 -0
  47. package/src/components/modal/MTooltip.vue +39 -0
  48. package/src/components/modal/index.ts +5 -0
  49. package/src/components/parials/UploaderItem.vue +298 -0
  50. package/src/components/parials/index.ts +3 -0
  51. package/src/components/transition/MFadeTransition.vue +27 -0
  52. package/src/components/transition/MFadeXTransition.vue +26 -0
  53. package/src/components/transition/MTransition.vue +44 -0
  54. package/src/components/transition/index.ts +13 -0
  55. package/src/components/typography/MTypingString.vue +8 -0
  56. package/src/components/typography/index.ts +11 -0
  57. package/src/composable/index.ts +12 -0
  58. package/src/composable/useBindInput.ts +209 -0
  59. package/src/composable/useError.ts +11 -0
  60. package/src/composable/useMyth.ts +311 -0
  61. package/src/composable/useValue.ts +12 -0
  62. package/src/index.common.js +19 -1
  63. package/src/index.esm.js +18 -3
  64. package/src/index.js +19 -0
  65. package/src/index.sass +9 -26
  66. package/src/index.ts +18 -4
  67. package/src/index.umd.js +17 -2
  68. package/src/style/m-container.sass +13 -0
  69. package/src/style/main.sass +146 -0
  70. package/src/style/print.sass +14 -0
  71. package/src/style/transition.sass +40 -0
  72. package/src/types/api-helpers.d.ts +62 -0
  73. package/src/types/components.d.ts +1108 -27
  74. package/src/types/index.d.ts +21 -1
  75. package/src/types/install-options.d.ts +19 -0
  76. package/src/types/lodash.d.ts +26 -0
  77. package/src/types/m-datatable.d.ts +316 -0
  78. package/src/types/m-geolocation.d.ts +16 -0
  79. package/src/types/m-helpers.d.ts +97 -0
  80. package/src/types/plugin-props-option.d.ts +305 -0
  81. package/src/types/quasar-helpers.d.ts +7 -0
  82. package/src/types/theme.d.ts +12 -0
  83. package/src/utils/Helpers.ts +293 -0
  84. package/src/utils/Str.ts +211 -0
  85. package/src/utils/index.ts +13 -0
  86. package/src/utils/myth.ts +109 -0
  87. package/src/utils/vee-rules.ts +32 -0
  88. package/src/utils/vue-plugin.ts +163 -0
  89. package/tsconfig.json +9 -13
  90. package/src/myth.ts +0 -30
  91. package/src/types/myth.ts +0 -42
  92. package/src/vue-plugin.ts +0 -41
  93. package/types.d.ts +0 -1
@@ -1,8 +1,76 @@
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
+ QOptionGroupProps,
27
+ QOptionGroupSlots,
28
+ QRadioProps,
29
+ QSelectProps,
30
+ QTimeProps,
31
+ QToggleProps,
32
+ QUploaderProps,
33
+ QUploaderSlots
34
+ } from 'quasar'
35
+ import { QDialogProps, QMenuProps, QPopupProxyProps, QTooltipProps } from 'quasar'
36
+ import type {
37
+ ComputedRef,
38
+ MaybeRefOrGetter,
39
+ Ref,
40
+ ShallowRef,
41
+ TransitionGroupProps,
42
+ TransitionProps,
43
+ UnwrapNestedRefs,
44
+ VNode,
45
+ WritableComputedRef
46
+ } from 'vue'
47
+ import type { TypedOptions } from 'typed.js'
48
+ import type { FieldContext, FieldOptions, FormContext, FormOptions, FormState } from 'vee-validate'
49
+ import type { ThemeShadow, ThemeSize } from './theme'
50
+ import type { AxiosRequestConfig } from 'axios'
51
+ import { ApiInterface, HelpersStubSchema } from './api-helpers'
52
+ import {
53
+ MDatatableProps,
54
+ MDatatableSlots,
55
+ MDtAvatarProps,
56
+ MDtAvatarSlots,
57
+ MDtBtnProps,
58
+ MDtBtnSlots,
59
+ MDtContextmenuItemsProps,
60
+ MDtContextmenuItemsSlots
61
+ } from './m-datatable'
62
+ import type { EditorConfig } from 'ckeditor5'
63
+
64
+ export interface MTransitionProps extends TransitionGroupProps {
65
+ enterIn?: string;
66
+ enterOut?: string;
67
+ slowIn?: boolean;
68
+ slowOut?: boolean;
69
+ }
70
+
71
+ export interface MTransitionsSlots {
72
+ default: () => VNode[];
73
+ }
6
74
 
7
75
  export interface MBtnProps extends QBtnProps {
8
76
  //
@@ -12,7 +80,7 @@ export interface MBtnSlots extends QBtnSlots {
12
80
  /**
13
81
  * Use for custom content, instead of relying on 'icon' and 'label' props
14
82
  */
15
- default: () => VNode[];
83
+ default?: () => VNode[];
16
84
  /**
17
85
  * Override the default QSpinner when in 'loading' state
18
86
  */
@@ -24,19 +92,19 @@ export interface MBlockProps {
24
92
  * Size of the padding block.
25
93
  * Default: 'md'
26
94
  */
27
- readonly size?: StyleSize | undefined;
95
+ size?: ThemeSize | undefined;
28
96
  /**
29
97
  * Rounded block
30
98
  */
31
- readonly rounded?: boolean | undefined;
99
+ rounded?: boolean | undefined;
32
100
  /**
33
101
  * Shadow level
34
102
  */
35
- readonly shadow?: string | number | 'transition' | 'none' | undefined;
103
+ shadow?: ThemeShadow | undefined;
36
104
  }
37
105
 
38
106
  export interface MBlockSlots {
39
- default: () => VNode[];
107
+ default?: () => VNode[];
40
108
  }
41
109
 
42
110
  export type ColStyleType =
@@ -73,18 +141,18 @@ export type ColStyleType =
73
141
  | 12
74
142
 
75
143
  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;
144
+ auto?: boolean | undefined;
145
+ col?: ColStyleType;
146
+ xs?: ColStyleType;
147
+ sm?: ColStyleType;
148
+ md?: ColStyleType;
149
+ lg?: ColStyleType;
150
+ xl?: ColStyleType;
151
+ name?: string;
84
152
  }
85
153
 
86
154
  export interface MColSlots {
87
- default: () => VNode[];
155
+ default?: () => VNode[];
88
156
  }
89
157
 
90
158
  export interface MColumnProps {
@@ -92,32 +160,32 @@ export interface MColumnProps {
92
160
  }
93
161
 
94
162
  export interface MColumnSlots {
95
- default: () => VNode[];
163
+ default?: () => VNode[];
96
164
  }
97
165
 
98
166
  export interface MContainerProps {
99
- readonly size?: StyleSize | string | undefined;
100
- readonly dense?: boolean | undefined;
101
- readonly fluid?: boolean | undefined;
167
+ size?: ThemeSize | string | undefined;
168
+ dense?: boolean | undefined;
169
+ fluid?: boolean | undefined;
102
170
  }
103
171
 
104
172
  export interface MContainerSlots {
105
- default: () => VNode[];
173
+ default?: () => VNode[];
106
174
  }
107
175
 
108
176
  export interface MRowProps {
109
177
  /**
110
178
  * Default: false.
111
179
  */
112
- gutter?: boolean | StyleSize | undefined;
180
+ gutter?: boolean | ThemeSize | undefined;
113
181
  /**
114
182
  * Default: false.
115
183
  */
116
- col?: boolean | StyleSize | undefined;
184
+ col?: boolean | ThemeSize | undefined;
117
185
  }
118
186
 
119
187
  export interface MRowSlots {
120
- default: () => VNode[];
188
+ default?: () => VNode[];
121
189
  }
122
190
 
123
191
  export interface MHelpRowProps extends Partial<QItemProps> {
@@ -127,7 +195,7 @@ export interface MHelpRowProps extends Partial<QItemProps> {
127
195
  }
128
196
 
129
197
  export interface MHelpRowSlots {
130
- default: () => VNode[];
198
+ default?: () => VNode[];
131
199
  }
132
200
 
133
201
  export interface MTypingStringProps {
@@ -142,13 +210,1011 @@ export interface MTypingStringProps {
142
210
  }
143
211
 
144
212
  export interface MTypingStringSlots {
213
+ default?: () => VNode[];
214
+ }
215
+
216
+ export interface BaseInputFieldPropContext extends FieldContext<any> {
217
+ //
218
+ }
219
+
220
+ export interface BaseInputFieldProps {
221
+ /**
222
+ * Context of field input.
223
+ */
224
+ field: UnwrapNestedRefs<BaseInputFieldPropContext>;
225
+ label?: string | undefined;
226
+ }
227
+
228
+ export interface MInputFieldControlProps {
229
+ [k: string]: any;
230
+ }
231
+
232
+ export interface MInputFieldControlSlots {
233
+ default: () => VNode[];
234
+ }
235
+
236
+ export interface MInputLabelProps extends BaseInputFieldProps {
237
+ //
238
+ }
239
+
240
+ export interface MInputLabelSlots {
241
+ default?: () => VNode[];
242
+ }
243
+
244
+ export interface ViewModeProps {
245
+ /**
246
+ * Set input to vie mode use q-field
247
+ */
248
+ viewMode?: boolean;
249
+ /**
250
+ * View Mode value for input or modelValue.
251
+ */
252
+ viewModeValue?: any | undefined;
253
+ }
254
+
255
+ export interface InputHelpProps {
256
+ /**
257
+ * Information text with Icon.
258
+ */
259
+ help?: string;
260
+ }
261
+
262
+ export interface InputHelpSlots {
263
+ /**
264
+ * VNode bottom of input & before 'bottom-input slot'.
265
+ */
266
+ help: () => VNode[];
267
+ }
268
+
269
+ export type InputRulesContext = string | string[] | Record<string, any> | undefined;
270
+ export type InputErrorsContext = string[];
271
+ export type InputFormErrorsContext = Record<string, InputErrorsContext> | undefined;
272
+
273
+ export type MAvatarViewerModelValue = File | null | undefined;
274
+
275
+ export interface MAvatarViewerProps extends QAvatarProps, MColProps {
276
+ /**
277
+ * Comma separated list of unique file type specifiers. Maps to 'accept' attribute of native input type=file element
278
+ */
279
+ accept?: string | string [] | null | Record<string, string>;
280
+ /**
281
+ * Add accept file type.
282
+ */
283
+ images?: boolean | string;
284
+ /**
285
+ * Add accept svg type.
286
+ */
287
+ svg?: boolean | string;
288
+ /**
289
+ * Add accept video type.
290
+ */
291
+ video?: boolean | string;
292
+ /**
293
+ * Add accept pdf type.
294
+ */
295
+ pdf?: boolean;
296
+ /**
297
+ * Add accept excel type.
298
+ */
299
+ excel?: boolean | string;
300
+ /**
301
+ * Show text if no image
302
+ */
303
+ avatarText?: string;
304
+ /**
305
+ * How the image will fit into the container; Equivalent of the object-fit prop; Can be coordinated with 'position' prop
306
+ * Default value: cover
307
+ */
308
+ fit?: QImgProps['fit'];
309
+ /**
310
+ * Can clear the input & not required
311
+ */
312
+ clearable?: boolean;
313
+ /**
314
+ * The label that will appear above the image
315
+ */
316
+ label?: string;
317
+ /**
318
+ * List of error messages.
319
+ */
320
+ errors?: InputErrorsContext;
321
+ /**
322
+ * List of form errors.
323
+ */
324
+ formErrors?: InputFormErrorsContext;
325
+ /**
326
+ * Model of the component;
327
+ * Must be FileList or Array if using 'multiple' prop;
328
+ * Either use this property (along with a listener for 'update:modelValue' event) OR use v-model directive
329
+ */
330
+ modelValue?: MAvatarViewerModelValue;
331
+ /**
332
+ * The name of the file for the image used and the field.
333
+ * Example: name='avatar' { avatar: https://4myth.com, avatarBlob: Blob, avatarRemoved: !0 | !1 }
334
+ */
335
+ name?: string;
336
+ /**
337
+ * Avatar url.
338
+ * (along with a listener for 'update:url' event) OR use v-model directive
339
+ */
340
+ url?: string;
341
+ /**
342
+ * value if user remove the image
343
+ * (along with a listener for 'update:removed' event) OR use v-model directive
344
+ */
345
+ removed?: boolean;
346
+ /**
347
+ * Input hint.
348
+ */
349
+ hint?: string;
350
+ hintProps?: Record<string, any>;
351
+
352
+ caption?: string;
353
+ captionProps?: Record<string, any>;
354
+ /**
355
+ * Help text after label.
356
+ */
357
+ help?: string;
358
+ /**
359
+ * Set input to readonly.
360
+ */
361
+ readonly?: boolean;
362
+ /**
363
+ * Loading for skeleton.
364
+ */
365
+ loading?: boolean;
366
+ /**
367
+ * Input Required validation.
368
+ */
369
+ required?: boolean;
370
+ /**
371
+ * Input Validation Rules.
372
+ */
373
+ rules?: InputRulesContext;
374
+ }
375
+
376
+ export interface MAvatarViewerSlots extends QAvatarSlots {
377
+ /**
378
+ * Field main content
379
+ */
380
+ default: () => VNode[];
381
+ hint: () => VNode[];
382
+ }
383
+
384
+ export interface BaseInputFormProps {
385
+ /**
386
+ * Input name.
387
+ */
388
+ name: string;
389
+ /**
390
+ * Input model value.
391
+ * can be used instead of initialValue.
392
+ */
393
+ modelValue?: any;
394
+ /**
395
+ * Input Label.
396
+ */
397
+ label?: string | undefined;
398
+ /**
399
+ * Caption under label.
400
+ */
401
+ caption?: string | undefined;
402
+ /**
403
+ * Input Hint.
404
+ */
405
+ hint?: string | undefined;
406
+ /**
407
+ * Input Placeholder.
408
+ */
409
+ placeholder?: string | undefined;
410
+ /**
411
+ * Input Required validation.
412
+ */
413
+ required?: boolean;
414
+ /**
415
+ * Input Validation Rules.
416
+ */
417
+ rules?: InputRulesContext;
418
+ /**
419
+ * Input Error Messages.
420
+ */
421
+ // errors?: InputErrorsContext;
422
+ /**
423
+ * Form Error Messages.
424
+ */
425
+ // formErrors?: InputFormErrorsContext;
426
+ /**
427
+ * Input autocomplete attribute.
428
+ * if true, will set from input name.
429
+ * if false, will set 'off'.
430
+ * else, will set the attribute value.
431
+ * Default: undefined.
432
+ */
433
+ autocomplete?: boolean | string | undefined;
434
+ /**
435
+ * Inputs Top Label.
436
+ */
437
+ topLabel?: boolean;
438
+ /**
439
+ * Mobile Rule.
440
+ */
441
+ mobile?: boolean | string | number | undefined;
442
+ /**
443
+ * Email Rule.
444
+ */
445
+ email?: boolean;
446
+ /**
447
+ * Number Rule.
448
+ */
449
+ float?: boolean;
450
+ /**
451
+ * vee-validate Field Options.
452
+ */
453
+ fieldOptions?: Partial<FieldOptions> | MaybeRefOrGetter<Partial<FieldOptions>>;
454
+ /**
455
+ * choice key of auto placeholder.
456
+ */
457
+ useChoice?: boolean | string;
458
+ }
459
+
460
+ export interface BaseInputsProps extends ViewModeProps, InputHelpProps, Omit<MColProps, 'name'>, BaseInputFormProps {
461
+ //
462
+ }
463
+
464
+ export interface BaseInputsSlots extends InputHelpSlots {
465
+ /**
466
+ * VNode top of input & top of 'top label slot'.
467
+ */
468
+ 'top-input': () => VNode[];
469
+ /**
470
+ * The label top on input
471
+ */
472
+ 'top-label': () => VNode[];
473
+ /**
474
+ * VNode top of input & after top label.
475
+ */
476
+ caption: () => VNode[];
477
+ /**
478
+ * Field main content
479
+ */
480
+ default: () => VNode[];
481
+ /**
482
+ * VNode bottom of input.
483
+ */
484
+ 'bottom-input': () => VNode[];
485
+ }
486
+
487
+ export interface MInputProps extends Omit<QInputProps, 'rules' | 'name' | 'modelValue' | 'label' | 'hint'>, BaseInputsProps {
488
+ //
489
+ }
490
+
491
+ export interface MInputSlots extends QInputSlots, QFieldSlots, BaseInputsSlots {
492
+ //
493
+ }
494
+
495
+ export interface MPasswordProps extends MInputProps {
496
+ /**
497
+ * icon prepend it to password input.
498
+ */
499
+ icon?: boolean | undefined;
500
+ /**
501
+ * toggle password append icon.
502
+ */
503
+ noToggle?: boolean | undefined;
504
+ }
505
+
506
+ export interface MEditorProps extends Omit<QEditorProps, 'modelValue' | 'placeholder'>, BaseInputsProps {
507
+ //
508
+ }
509
+
510
+ export interface MEditorSlots extends QEditorSlots, BaseInputsSlots {
511
+ //
512
+ }
513
+
514
+ export interface MSelectModelEmit {
515
+ value: any | null;
516
+ model: object | null;
517
+ }
518
+
519
+ export interface MSelectProps extends Omit<QSelectProps, 'rules' | 'name' | 'modelValue' | 'label' | 'hint' | 'autocomplete'>, BaseInputsProps {
520
+ /**
521
+ * Input search functionality. useInput prop for this feature.
522
+ */
523
+ search?: string | null | undefined;
524
+ /**
525
+ * Minimum characters to start searching. Default is 1.
526
+ */
527
+ searchLength?: string | number;
528
+ /**
529
+ * hide the default empty list message.
530
+ */
531
+ hideEmptyList?: boolean | undefined;
532
+ /**
533
+ * Disable filter functionality.
534
+ */
535
+ noFilter?: boolean | undefined;
536
+ /**
537
+ * Set mode of component to axios of filter & search.
538
+ * if set to true, component will fetch data from api and don't do filter functionality.
539
+ */
540
+ axiosMode?: boolean | undefined;
541
+ /**
542
+ * Fetch Data on mounted
543
+ */
544
+ // iniData?: boolean;
545
+ }
546
+
547
+ export interface MSelectSlots extends QInputSlots, QFieldSlots, BaseInputsSlots {
548
+ //
549
+ }
550
+
551
+ export interface MFileProps extends Omit<QFileProps, 'modelValue' | 'rules' | 'name' | 'label' | 'hint'>, Omit<BaseInputsProps, 'autocomplete'> {
552
+ accept?: string | undefined;
553
+ images?: boolean;
554
+ svg?: boolean;
555
+ video?: boolean;
556
+ pdf?: boolean;
557
+ excel?: boolean;
558
+ }
559
+
560
+ export interface MFileSlots extends QFileSlots, BaseInputsSlots {
561
+ //
562
+ }
563
+
564
+ export interface BaseCheckboxProps extends Omit<BaseInputsProps, 'topLabel'> {
565
+ /**
566
+ * Input row props.
567
+ */
568
+ rowProps?: Record<string, any>;
569
+ /**
570
+ * Input column props.
571
+ */
572
+ colProps?: Record<string, any>;
573
+ }
574
+
575
+ export interface MCheckboxProps extends Omit<QCheckboxProps, 'name' | 'modelValue' | 'label'>, BaseCheckboxProps {
576
+ //
577
+ }
578
+
579
+ export interface MCheckboxSlots extends Omit<BaseInputsSlots, 'top-label'> {
580
+ /**
581
+ * VNode before field main content.
582
+ */
583
+ before: () => VNode[];
584
+ /**
585
+ * VNode after field main content.
586
+ */
587
+ after: () => VNode[];
588
+ }
589
+
590
+ export interface MRadioProps extends Omit<QRadioProps, 'name' | 'modelValue' | 'label'>, BaseCheckboxProps {
591
+ //
592
+ }
593
+
594
+ export interface MRadioSlots extends MCheckboxSlots {
595
+ //
596
+ }
597
+
598
+ export interface MPickerProps extends BaseInputsProps,
599
+ Omit<QDateProps, 'modelValue' | 'options'>,
600
+ Omit<QTimeProps, 'modelValue'> {
601
+ /**
602
+ * Initial value of the picker.
603
+ * Default is: null.
604
+ */
605
+ modelValue?: any;
606
+ /**
607
+ * Type of picker. 'date' or 'time'.
608
+ * Default is: 'date'.
609
+ */
610
+ type?: 'date' | 'time';
611
+ /**
612
+ * QBtn props for append button.
613
+ */
614
+ btnProps?: QBtnProps;
615
+ /**
616
+ * Value of separator for range picker.
617
+ * Default is: ' - '.
618
+ */
619
+ rangeSeparator?: string;
620
+ }
621
+
622
+ export interface MPickerSlots extends MInputSlots {
623
+ //
624
+ }
625
+
626
+ export interface MDateProps extends Omit<MPickerProps, 'type'> {
627
+ //
628
+ }
629
+
630
+ export interface MDateSlots extends MPickerSlots {
631
+ //
632
+ }
633
+
634
+ export interface MTimeProps extends Omit<MPickerProps, 'type'> {
635
+ //
636
+ }
637
+
638
+ export interface MTimeSlots extends MPickerSlots {
639
+ //
640
+ }
641
+
642
+ export interface MFieldProps extends Omit<MInputProps, 'viewMode' | 'viewModeValue' | 'fieldOptions'> {
643
+ //
644
+ }
645
+
646
+ export interface MFieldSlots extends MInputSlots {
647
+ //
648
+ }
649
+
650
+ export interface MHiddenInputSlots {
651
+ [key: string]: () => VNode[]
652
+ }
653
+
654
+ export interface MHiddenInputProps extends Pick<BaseInputFormProps, 'rules' | 'required'> {
655
+ /**
656
+ * Input name.
657
+ */
658
+ name: string;
659
+ /**
660
+ * Input model value.
661
+ */
662
+ modelValue?: any;
663
+ }
664
+
665
+ export interface MHiddenProps extends MHiddenInputProps, Pick<ViewModeProps, 'viewMode'>, Omit<MColProps, 'name'> {
666
+ //
667
+ }
668
+
669
+ export interface MHiddenSlots {
670
+ /**
671
+ * Field main content
672
+ */
145
673
  default: () => VNode[];
146
674
  }
147
675
 
676
+ export type MFormScope = FormContext<Record<string, any>>;
677
+
678
+ export interface MFormProps {
679
+ /**
680
+ * Form HTML element attributes.
681
+ */
682
+ formProps?: Record<string, any>;
683
+ /**
684
+ * Default options of useForm.
685
+ */
686
+ opts?: FormOptions<Record<string, any>>;
687
+ /**
688
+ * The target to which the page will be scrolled.
689
+ * Default is: Window.
690
+ */
691
+ target?: HTMLElement | string | undefined;
692
+ /**
693
+ * Emit values instead controlled values.
694
+ * Default is: false.
695
+ */
696
+ emitValues?: boolean;
697
+ /**
698
+ * Watch to reset form values.
699
+ */
700
+ readonly state?: MaybeRefOrGetter<Partial<FormState<Record<string, any>>>>;
701
+ /**
702
+ * Watch to reset form values.
703
+ */
704
+ readonly form?: MaybeRefOrGetter<Record<string, any>>;
705
+ /**
706
+ * Watch to set form values.
707
+ */
708
+ readonly values?: MaybeRefOrGetter<Record<string, any>>;
709
+ /**
710
+ * Watch to set form errors.
711
+ */
712
+ readonly errors?: MaybeRefOrGetter<Record<string, string | string[]>>;
713
+ /**
714
+ * Apply padding to form.
715
+ */
716
+ readonly padding?: boolean;
717
+ }
718
+
719
+ export interface MFormSlots {
720
+ default: (scope: MFormScope) => VNode[];
721
+ }
722
+
723
+ export declare type GenericFormValues = Record<any, any>;
724
+
725
+ type ParamsReq = Record<string, any>;
726
+
727
+ export interface MAxiosProps extends Omit<MSelectProps, 'options' | 'axiosMode'> {
728
+ /**
729
+ * Request method. Default is GET.
730
+ */
731
+ service: ((config?: AxiosRequestConfig) => Promise<any>) | string;
732
+ /**
733
+ * Send request as guest request. If false, send request as authenticated user. Default is true.
734
+ */
735
+ guest?: boolean | MaybeRefOrGetter<boolean>;
736
+ /**
737
+ * Request params.
738
+ */
739
+ params?: Ref<ParamsReq> | ShallowRef<ParamsReq> | WritableComputedRef<ParamsReq> | ComputedRef<ParamsReq> | (() => ParamsReq);
740
+ /**
741
+ * Request relations.
742
+ */
743
+ requestWith?: MaybeRefOrGetter<string> | undefined;
744
+ /**
745
+ * Component items.
746
+ */
747
+ items?: any[];
748
+ /**
749
+ * The name of the attribute to be used as a label
750
+ */
751
+ attributeName?: string;
752
+ /**
753
+ * Do fetch asynchronous
754
+ */
755
+ lazy?: boolean;
756
+ }
757
+
758
+ export interface MAxiosSlots extends MSelectSlots {
759
+ //
760
+ }
761
+
762
+ export interface MOptionsOptionContext extends Omit<QToggleProps, 'modelValue'>, Omit<QRadioProps, 'modelValue'>, Omit<QCheckboxProps, 'modelValue'> {
763
+ /**
764
+ * Label to display along the component
765
+ */
766
+ label: string;
767
+ /**
768
+ * Value of the option that will be used by the component model
769
+ */
770
+ value: any;
771
+ /**
772
+ * If true, the option will be disabled
773
+ */
774
+ disable?: boolean;
775
+ /**
776
+ * Any other props from QToggle, QCheckbox, or QRadio
777
+ */
778
+ }
779
+
780
+ export interface MOptionsProps extends Omit<QOptionGroupProps, 'name' | 'modelValue' | 'options'>,
781
+ Omit<BaseInputsProps, 'autocomplete' | 'modelValue'> {
782
+ modelValue?: any;
783
+ /**
784
+ * Array of objects with value, label, and disable (optional) props. The binary components will be created according to this array; Props from QToggle, QCheckbox or QRadio can also be added as key/value pairs to control the components singularly
785
+ */
786
+ options?: MOptionsOptionContext[];
787
+ /**
788
+ * Get options by function. any send the current value to this function to get options.
789
+ */
790
+ service?: ((value?: any) => Promise<ApiInterface>) | undefined;
791
+ /**
792
+ * Service loading.
793
+ */
794
+ loading?: boolean | undefined;
795
+ /**
796
+ * Set content to be full width.
797
+ */
798
+ fullWidth?: boolean;
799
+ /**
800
+ * Set width of content to be equals.
801
+ * Default is: 33.33333333%
802
+ */
803
+ fitWidth?: boolean;
804
+ }
805
+
806
+ export interface MOtpProps extends Omit<QInputProps, 'modelValue'> {
807
+ modelValue?: string | number;
808
+ inputLength?: string | number;
809
+ numeric?: boolean;
810
+ time?: string | number;
811
+ hideTime?: boolean;
812
+ hideSendAgain?: boolean;
813
+ topLabel?: string | undefined;
814
+ topLabelProps?: any | undefined;
815
+ errors?: string[];
816
+ }
817
+
818
+ export interface MOtpSlots extends QInputSlots {
819
+ default: () => VNode[];
820
+ 'before-all': () => VNode[];
821
+ 'after-all': () => VNode[];
822
+ 'after-input': () => VNode[];
823
+ }
824
+
825
+ export interface MOptionsSlots extends QOptionGroupSlots, QFieldSlots, BaseInputsSlots {
826
+ //
827
+ }
828
+
829
+ export interface MToggleProps extends Omit<BaseInputsProps, 'placeholder' | 'topLabel' | 'autocomplete' | 'modelValue'>,
830
+ Omit<QToggleProps, 'modelValue' | 'label' | 'name'> {
831
+ modelValue?: number;
832
+ /**
833
+ * Customize the label when the toggle is true.
834
+ * Default is: Yes.
835
+ */
836
+ activeLabel?: string;
837
+ /**
838
+ * Customize the label when the toggle is false.
839
+ * Default is: No.
840
+ */
841
+ inactiveLabel?: string;
842
+ /**
843
+ * Set labels of toggle to status, Active & Inactive.
844
+ */
845
+ status?: boolean;
846
+ /**
847
+ * Input row props.
848
+ */
849
+ rowProps?: Record<string, any>;
850
+ /**
851
+ * Input column props.
852
+ */
853
+ colProps?: Record<string, any>;
854
+ }
855
+
856
+ export interface MToggleSlots extends MCheckboxSlots, Pick<BaseInputsProps, 'topLabel'> {
857
+ //
858
+ }
859
+
860
+ export type MUploaderMediaItem = {
861
+ id: number;
862
+ value: number;
863
+ name: string;
864
+ file_name: string;
865
+ type: string;
866
+ size: number;
867
+ size_to_string: string;
868
+ url: string;
869
+ download_url: string;
870
+ icon: string;
871
+ description: string;
872
+ attachment_type: string;
873
+ attachment_type_id: number;
874
+ attachment_type_id_to_string: string;
875
+ user_id: number | null;
876
+ user_id_to_string: string;
877
+ order_column: number;
878
+ [k: string]: any;
879
+ };
880
+
881
+ export type MUploaderServiceType = Pick<HelpersStubSchema, 'getUploadAttachmentsUrl' | 'updateAttachment' | 'uploadAttachments' | 'deleteAttachment'>
882
+
883
+ export interface MUploaderProps extends Omit<QUploaderProps, 'formFields' | 'headers' | 'url'>, MColProps, Pick<BaseInputsProps, 'fieldOptions'> {
884
+ /**
885
+ * Name fo field input, Attachments key name.
886
+ * Default is: 'attachments'
887
+ */
888
+ name?: string;
889
+ /**
890
+ * Put component in disabled mode
891
+ */
892
+ disable?: boolean;
893
+ /**
894
+ * Put component in readonly mode
895
+ */
896
+ readonly?: boolean;
897
+ /**
898
+ * Comma separated list of unique file type specifiers. Maps to 'accept' attribute of native input type=file element
899
+ */
900
+ accept?: string;
901
+ /**
902
+ * Support for uploading images
903
+ */
904
+ images?: boolean;
905
+ /**
906
+ * Support for uploading svg
907
+ */
908
+ svg?: boolean;
909
+ /**
910
+ * Support for uploading videos
911
+ */
912
+ video?: boolean;
913
+ /**
914
+ * Support for uploading pdf
915
+ */
916
+ pdf?: boolean;
917
+ /**
918
+ * Support for uploading excel
919
+ */
920
+ excel?: boolean;
921
+ /**
922
+ * Upload files immediately when added
923
+ */
924
+ autoUpload?: boolean;
925
+ /**
926
+ * Field name for each file upload; This goes into the following header: 'Content-Disposition: form-data; name="__HERE__"; filename="somefile.png"; If using a function then for best performance, reference it from your scope and do not define it inline
927
+ * Default value: (file) => file.name
928
+ * @param files The current file being processed
929
+ * @returns Field name for the current file upload
930
+ */
931
+ fieldName?: string | ((files: File) => string);
932
+ /**
933
+ * Collection send to API
934
+ */
935
+ collection?: string | number | symbol;
936
+ /**
937
+ * Field Attachment Type
938
+ */
939
+ attachmentType?: any;
940
+ /**
941
+ * return attachments after upload;
942
+ * Default current collection name;
943
+ */
944
+ returnType?: 'all' | 'current' | undefined;
945
+ /**
946
+ * Object with additional fields definitions (used by Form to be uploaded);
947
+ */
948
+ formFields?: Record<string, any>;
949
+ /**
950
+ * Extra headers
951
+ */
952
+ headers?: Record<string, any>;
953
+ /**
954
+ * Label for the uploader
955
+ */
956
+ label?: string | null | undefined;
957
+ /**
958
+ * The Attachments list.
959
+ */
960
+ modelValue?: MUploaderMediaItem[];
961
+ /**
962
+ * Hide delete media items from uploader, no delete media For API
963
+ */
964
+ hideDeleteMedia?: boolean;
965
+ /**
966
+ * Show update button of media.
967
+ */
968
+ updateBtn?: boolean;
969
+ /**
970
+ * User APi service for upload & delete
971
+ */
972
+ service: string | MUploaderServiceType;
973
+ /**
974
+ * The ID of model will use in attachments
975
+ */
976
+ modelId?: string | number | undefined;
977
+ uploading?: boolean | undefined;
978
+ defaultFileIcon?: string | undefined;
979
+ deleteMediaIcon?: string | undefined;
980
+ uploadFilesIcon?: string | undefined;
981
+ pickFilesIcon?: string | undefined;
982
+ removeUploadedIcon?: string | undefined;
983
+ removeQueuedIcon?: string | undefined;
984
+ abortUploadIcon?: string | undefined;
985
+ downloadFileIcon?: string | undefined;
986
+ errorsIcon?: string | undefined;
987
+ iconsSize?: string | undefined;
988
+ displayMode?: 'list' | 'card' | undefined;
989
+ shadow?: string | undefined;
990
+ /**
991
+ * Media Item Label Field.
992
+ * Default is: name.
993
+ */
994
+ mediaLabel?: string | undefined;
995
+ }
996
+
997
+ export interface MUploaderSlots extends QUploaderSlots {
998
+ /**
999
+ * Field main content
1000
+ */
1001
+ default: () => VNode[];
1002
+ /**
1003
+ * list of item will be display
1004
+ */
1005
+ // list: (scope: { item: MUploaderMediaItem, index: number }) => VNode[];
1006
+ /**
1007
+ * list of item will be display
1008
+ */
1009
+ 'item-list': (scope: { item: MUploaderMediaItem, index: number }) => VNode[];
1010
+ }
1011
+
1012
+ export type MUploaderXhrInfo = { files: readonly any[]; xhr: any; }
1013
+
1014
+ export type MModalMenuProps = Partial<QDialogProps> & Partial<QMenuProps> & Partial<QPopupProxyProps> & {
1015
+ noCloseBtn?: boolean;
1016
+ }
1017
+
1018
+ export type MModalMenuSlots = {
1019
+ default: () => VNode[];
1020
+ }
1021
+
1022
+ export type MTooltipProps = Partial<QTooltipProps> & {
1023
+ /**
1024
+ * One of Quasar's embedded transitions
1025
+ * Default value: jump-down
1026
+ */
1027
+ transitionShow?: string | undefined;
1028
+ /**
1029
+ * One of Quasar's embedded transitions
1030
+ * Default value: jump-up
1031
+ */
1032
+ transitionHide?: string | undefined;
1033
+ /**
1034
+ * Transition duration (in milliseconds, without unit)
1035
+ * Default value: 300
1036
+ */
1037
+ transitionDuration?: string | number | undefined;
1038
+ /**
1039
+ * Model of the component defining shown/hidden state; Either use this property (along with a listener for 'update:model-value' event) OR use v-model directive
1040
+ */
1041
+ modelValue?: boolean;
1042
+ /**
1043
+ * The maximum height of the Tooltip; Size in CSS units, including unit name
1044
+ */
1045
+ maxHeight?: string | undefined;
1046
+ /**
1047
+ * The maximum width of the Tooltip; Size in CSS units, including unit name
1048
+ */
1049
+ maxWidth?: string | undefined;
1050
+ /**
1051
+ * Two values setting the starting position or anchor point of the Tooltip relative to its target
1052
+ * Default value: bottom middle
1053
+ */
1054
+ anchor?:
1055
+ | 'top left'
1056
+ | 'top middle'
1057
+ | 'top right'
1058
+ | 'top start'
1059
+ | 'top end'
1060
+ | 'center left'
1061
+ | 'center middle'
1062
+ | 'center right'
1063
+ | 'center start'
1064
+ | 'center end'
1065
+ | 'bottom left'
1066
+ | 'bottom middle'
1067
+ | 'bottom right'
1068
+ | 'bottom start'
1069
+ | 'bottom end'
1070
+ | undefined;
1071
+ /**
1072
+ * Two values setting the Tooltip's own position relative to its target
1073
+ * Default value: top middle
1074
+ */
1075
+ self?:
1076
+ | 'top left'
1077
+ | 'top middle'
1078
+ | 'top right'
1079
+ | 'top start'
1080
+ | 'top end'
1081
+ | 'center left'
1082
+ | 'center middle'
1083
+ | 'center right'
1084
+ | 'center start'
1085
+ | 'center end'
1086
+ | 'bottom left'
1087
+ | 'bottom middle'
1088
+ | 'bottom right'
1089
+ | 'bottom start'
1090
+ | 'bottom end'
1091
+ | undefined;
1092
+ /**
1093
+ * An array of two numbers to offset the Tooltip horizontally and vertically in pixels
1094
+ * Default value: [14, 14]
1095
+ */
1096
+ offset?: readonly any[] | undefined;
1097
+ /**
1098
+ * CSS selector or DOM element to be used as a custom scroll container instead of the auto detected one
1099
+ */
1100
+ scrollTarget?: Element | string | undefined;
1101
+ /**
1102
+ * Configure a target element to trigger Tooltip toggle; 'true' means it enables the parent DOM element, 'false' means it disables attaching events to any DOM elements; By using a String (CSS selector) it attaches the events to the specified DOM element (if it exists)
1103
+ * Default value: true
1104
+ */
1105
+ target?: boolean | string | undefined;
1106
+ /**
1107
+ * Skips attaching events to the target DOM element (that trigger the element to get shown)
1108
+ */
1109
+ noParentEvent?: boolean | undefined;
1110
+ /**
1111
+ * Configure Tooltip to appear with delay
1112
+ */
1113
+ delay?: number | undefined;
1114
+ /**
1115
+ * Configure Tooltip to disappear with delay
1116
+ */
1117
+ hideDelay?: number | undefined;
1118
+ /**
1119
+ * Emitted when showing/hidden state changes; Is also used by v-model
1120
+ * @param value New state (showing/hidden)
1121
+ */
1122
+ 'onUpdate:modelValue'?: (value: boolean) => void;
1123
+ /**
1124
+ * Emitted after component has triggered show()
1125
+ * @param evt JS event object
1126
+ */
1127
+ onShow?: (evt: Event) => void;
1128
+ /**
1129
+ * Emitted when component triggers show() but before it finishes doing it
1130
+ * @param evt JS event object
1131
+ */
1132
+ onBeforeShow?: (evt: Event) => void;
1133
+ /**
1134
+ * Emitted after component has triggered hide()
1135
+ * @param evt JS event object
1136
+ */
1137
+ onHide?: (evt: Event) => void;
1138
+ /**
1139
+ * Emitted when component triggers hide() but before it finishes doing it
1140
+ * @param evt JS event object
1141
+ */
1142
+ onBeforeHide?: (evt: Event) => void;
1143
+ }
1144
+
1145
+ export type MTooltipSlots = {
1146
+ default: () => VNode[];
1147
+ }
1148
+
1149
+ export type MDialogProps = Partial<QDialogProps> & {
1150
+ slide?: boolean | undefined;
1151
+ from?: 'up' | 'down' | 'left' | 'right';
1152
+ }
1153
+
1154
+ export type MDialogSlots = {
1155
+ default: () => VNode[];
1156
+ }
1157
+
1158
+ export type MCkeditorProps = Omit<BaseInputsProps, 'hint' | 'topLabel' | 'placeholder' | 'autocomplete'> & {
1159
+ /**
1160
+ * Editor language.
1161
+ * Default value: ar.
1162
+ */
1163
+ lang: 'ar' | 'en';
1164
+ /**
1165
+ * Specifies the configuration of the editor.
1166
+ * https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html
1167
+ */
1168
+ config?: ((config: EditorConfig) => EditorConfig) | undefined;
1169
+ /**
1170
+ * By default, the editor component creates a <div> container which is used as an element passed to the editor (for example, ClassicEditor#element).
1171
+ * The element can be configured, so for example to create a <textarea>, use the following directive:
1172
+ * tag-name="textarea"
1173
+ * Default value: div.
1174
+ */
1175
+ tagName?: string;
1176
+ /**
1177
+ * This directive controls the isReadOnly property of the editor.
1178
+ * Default value: false.
1179
+ */
1180
+ disabled?: boolean;
1181
+ /**
1182
+ * Allows disabling the two-way data binding mechanism.
1183
+ * Default value: false.
1184
+ */
1185
+ disableTwoWayDataBinding?: boolean;
1186
+ }
1187
+ export type MCkeditorSlots = BaseInputsSlots
1188
+
148
1189
  declare module '@vue/runtime-core' {
149
1190
  interface GlobalComponents {
150
1191
  // Form.
1192
+ MAvatarViewer: GlobalComponentConstructor<MAvatarViewerProps, MAvatarViewerSlots>;
1193
+ MAxios: GlobalComponentConstructor<MAxiosProps, MAxiosSlots>;
151
1194
  MBtn: GlobalComponentConstructor<MBtnProps, MBtnSlots>;
1195
+ MCheckbox: GlobalComponentConstructor<MCheckboxProps, MCheckboxSlots>;
1196
+ MCkeditor: GlobalComponentConstructor<MCkeditorProps, MCkeditorSlots>;
1197
+ MColor: GlobalComponentConstructor<MInputProps, MInputSlots>;
1198
+ MDate: GlobalComponentConstructor<MDateProps, MDateSlots>;
1199
+ MEditor: GlobalComponentConstructor<MEditorProps, MEditorSlots>;
1200
+ MEmail: GlobalComponentConstructor<MInputProps, MInputSlots>;
1201
+ MField: GlobalComponentConstructor<MFieldProps, MFieldSlots>;
1202
+ MFile: GlobalComponentConstructor<MFileProps, MFileSlots>;
1203
+ MForm: GlobalComponentConstructor<MFormProps, MFormSlots>;
1204
+ MHidden: GlobalComponentConstructor<MHiddenProps, MHiddenSlots>;
1205
+ MHiddenInput: GlobalComponentConstructor<MHiddenInputProps, MHiddenInputSlots>;
1206
+ MInputFieldControl: GlobalComponentConstructor<MInputFieldControlProps, MInputFieldControlSlots>;
1207
+ MInputLabel: GlobalComponentConstructor<MInputLabelProps, MInputLabelSlots>;
1208
+ MMobile: GlobalComponentConstructor<MInputProps, MInputSlots>;
1209
+ MOptions: GlobalComponentConstructor<MOptionsProps, MOptionsSlots>;
1210
+ MOtp: GlobalComponentConstructor<MOtpProps, MOtpSlots>;
1211
+ MPassword: GlobalComponentConstructor<MPasswordProps, MInputSlots>;
1212
+ MPicker: GlobalComponentConstructor<MPickerProps, MPickerSlots>;
1213
+ MRadio: GlobalComponentConstructor<MRadioProps, MRadioSlots>;
1214
+ MSelect: GlobalComponentConstructor<MSelectProps, MSelectSlots>;
1215
+ MTime: GlobalComponentConstructor<MTimeProps, MTimeSlots>;
1216
+ MToggle: GlobalComponentConstructor<MToggleProps, MToggleSlots>;
1217
+ MUploader: GlobalComponentConstructor<MUploaderProps, MUploaderSlots>;
152
1218
 
153
1219
  // Grid.
154
1220
  MBlock: GlobalComponentConstructor<MBlockProps, MBlockSlots>;
@@ -157,7 +1223,22 @@ declare module '@vue/runtime-core' {
157
1223
  MContainer: GlobalComponentConstructor<MContainerProps, MContainerSlots>;
158
1224
  MHelpRow: GlobalComponentConstructor<MHelpRowProps, MHelpRowSlots>;
159
1225
  MRow: GlobalComponentConstructor<MRowProps, MRowSlots>;
1226
+
160
1227
  // Typography.
161
1228
  MTypingString: GlobalComponentConstructor<MTypingStringProps, MTypingStringSlots>;
1229
+
1230
+ // Transitions.
1231
+ MTransition: GlobalComponentConstructor<MTransitionProps, MTransitionsSlots>;
1232
+ MFadeTransition: GlobalComponentConstructor<TransitionProps, MTransitionsSlots>;
1233
+ MFadeXTransition: GlobalComponentConstructor<TransitionProps, MTransitionsSlots>;
1234
+ // Modals.
1235
+ MDialog: GlobalComponentConstructor<MDialogProps, MDialogSlots>;
1236
+ MModalMenu: GlobalComponentConstructor<MModalMenuProps, MModalMenuSlots>;
1237
+ MTooltip: GlobalComponentConstructor<MTooltipProps, MTooltipSlots>;
1238
+ // Datatable
1239
+ MDatatable: GlobalComponentConstructor<MDatatableProps, MDatatableSlots>;
1240
+ MDtAvatar: GlobalComponentConstructor<MDtAvatarProps, MDtAvatarSlots>;
1241
+ MDtBtn: GlobalComponentConstructor<MDtBtnProps, MDtBtnSlots>;
1242
+ MDtContextmenuItems: GlobalComponentConstructor<MDtContextmenuItemsProps, MDtContextmenuItemsSlots>;
162
1243
  }
163
1244
  }