@mythpe/quasar-ui-qui 0.0.24-dev → 0.0.25-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/package.json +1 -1
- package/src/components/form/MCheckbox.vue +4 -1
- package/src/components/form/MField.vue +4 -1
- package/src/components/form/MFile.vue +6 -3
- package/src/components/form/MForm.vue +4 -1
- package/src/components/form/MHidden.vue +5 -2
- package/src/components/form/MMobile.vue +4 -1
- package/src/components/form/MPicker.vue +4 -1
- package/src/components/form/MRadio.vue +6 -3
- package/src/components/form/MSelect.vue +10 -4
- package/src/types/api-helpers.d.ts +1 -1
- package/src/types/components.d.ts +9 -3
- package/src/types/dt.d.ts +2 -0
- package/src/utils/Helpers.ts +1 -8
- package/src/utils/Str.ts +1 -0
package/package.json
CHANGED
|
@@ -35,7 +35,10 @@ const listeners = {
|
|
|
35
35
|
const input = useTemplateRef<InstanceType<typeof QCheckbox> | null>('input')
|
|
36
36
|
const scopes = reactive(inputScope)
|
|
37
37
|
defineExpose<typeof scopes & { input: typeof input }>({ input, ...scopes })
|
|
38
|
-
defineOptions({
|
|
38
|
+
defineOptions({
|
|
39
|
+
name: 'MCheckbox',
|
|
40
|
+
inheritAttrs: !1
|
|
41
|
+
})
|
|
39
42
|
</script>
|
|
40
43
|
|
|
41
44
|
<template>
|
|
@@ -65,7 +65,10 @@ const value = useFieldValue(() => props.name)
|
|
|
65
65
|
const errorMessage = useFieldError(() => props.name)
|
|
66
66
|
const input = useTemplateRef<InstanceType<typeof QField>>('input')
|
|
67
67
|
defineExpose<{ input: typeof input }>({ input })
|
|
68
|
-
defineOptions({
|
|
68
|
+
defineOptions({
|
|
69
|
+
name: 'MField',
|
|
70
|
+
inheritAttrs: !1
|
|
71
|
+
})
|
|
69
72
|
</script>
|
|
70
73
|
|
|
71
74
|
<template>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { QField, QFile, QFileSlots } from 'quasar'
|
|
12
12
|
import { useBindInput, useMyth } from '../../composable'
|
|
13
13
|
import { useField } from 'vee-validate'
|
|
14
|
-
import { defineProps, reactive,
|
|
14
|
+
import { defineProps, reactive, toValue, useTemplateRef } from 'vue'
|
|
15
15
|
import type { MFileProps as Props } from '../../types'
|
|
16
16
|
import { myth } from '../../utils'
|
|
17
17
|
|
|
@@ -88,7 +88,7 @@ const listeners = {
|
|
|
88
88
|
clear: (v: Event) => handleBlur(v, !0),
|
|
89
89
|
'update:modelValue': (v: Props['modelValue']) => handleChange(v, !!errorMessage.value)
|
|
90
90
|
}
|
|
91
|
-
const input =
|
|
91
|
+
const input = useTemplateRef<InstanceType<typeof QFile> | InstanceType<typeof QField>>('input')
|
|
92
92
|
const scopes = reactive(inputScope)
|
|
93
93
|
|
|
94
94
|
const pickFiles = (evt?: Event) => (input.value as QFile)?.pickFiles(evt)
|
|
@@ -111,7 +111,10 @@ const methods = {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
defineExpose({ input, ...scopes, ...methods })
|
|
114
|
-
defineOptions({
|
|
114
|
+
defineOptions({
|
|
115
|
+
name: 'MFile',
|
|
116
|
+
inheritAttrs: !1
|
|
117
|
+
})
|
|
115
118
|
</script>
|
|
116
119
|
|
|
117
120
|
<template>
|
|
@@ -55,7 +55,10 @@ const onErrorSubmission: InvalidSubmissionHandler = ({ errors }) => {
|
|
|
55
55
|
const defaultSubmit = props.emitValues ? handleSubmit(onSuccessSubmission, onErrorSubmission) : handleSubmit.withControlled(onSuccessSubmission,
|
|
56
56
|
onErrorSubmission)
|
|
57
57
|
defineExpose({ ...scope, defaultSubmit })
|
|
58
|
-
defineOptions({
|
|
58
|
+
defineOptions({
|
|
59
|
+
name: 'MForm',
|
|
60
|
+
inheritAttrs: !1
|
|
61
|
+
})
|
|
59
62
|
const options = { deep: !0, immediate: !0 }
|
|
60
63
|
const stateComputed = computed(() => props.state ? toValue(props.state) : {})
|
|
61
64
|
watch(stateComputed, v => v && resetForm(v), options)
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<script
|
|
10
10
|
lang="ts"
|
|
11
|
-
|
|
11
|
+
setup
|
|
12
12
|
>
|
|
13
13
|
|
|
14
14
|
import { useField } from 'vee-validate'
|
|
@@ -60,7 +60,10 @@ const { value, errorMessage } = inputScope
|
|
|
60
60
|
|
|
61
61
|
const scopes = reactive(inputScope)
|
|
62
62
|
defineExpose<typeof scopes>({ ...scopes })
|
|
63
|
-
defineOptions({
|
|
63
|
+
defineOptions({
|
|
64
|
+
name: 'MHidden',
|
|
65
|
+
inheritAttrs: !1
|
|
66
|
+
})
|
|
64
67
|
</script>
|
|
65
68
|
|
|
66
69
|
<template>
|
|
@@ -16,7 +16,10 @@ const modelValue = defineModel<Props['modelValue']>({ required: !1, default: und
|
|
|
16
16
|
const input = useTemplateRef<InstanceType<typeof MInput>>('input')
|
|
17
17
|
const { props: options } = myth
|
|
18
18
|
defineExpose<{ input: typeof input }>({ input })
|
|
19
|
-
defineOptions({
|
|
19
|
+
defineOptions({
|
|
20
|
+
name: 'MMobile',
|
|
21
|
+
inheritAttrs: !1
|
|
22
|
+
})
|
|
20
23
|
</script>
|
|
21
24
|
|
|
22
25
|
<template>
|
|
@@ -126,7 +126,10 @@ const saveDialog = () => {
|
|
|
126
126
|
const dateElm = useTemplateRef<InstanceType<typeof QDate>>('dateElm')
|
|
127
127
|
const timeElm = useTemplateRef<InstanceType<typeof QTime>>('timeElm')
|
|
128
128
|
defineExpose<{ input: typeof dateElm | typeof timeElm }>({ input: isDate.value ? dateElm : timeElm })
|
|
129
|
-
defineOptions({
|
|
129
|
+
defineOptions({
|
|
130
|
+
name: 'MPicker',
|
|
131
|
+
inheritAttrs: !1
|
|
132
|
+
})
|
|
130
133
|
</script>
|
|
131
134
|
|
|
132
135
|
<template>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<script lang="ts" setup>
|
|
10
10
|
import { useField } from 'vee-validate'
|
|
11
|
-
import { defineProps, reactive,
|
|
11
|
+
import { defineProps, reactive, toValue, useTemplateRef } from 'vue'
|
|
12
12
|
import { useBindInput, useMyth } from '../../composable'
|
|
13
13
|
import type { MRadioProps as Props } from '../../types'
|
|
14
14
|
import { QField, QRadio } from 'quasar'
|
|
@@ -77,10 +77,13 @@ const { props: options } = myth
|
|
|
77
77
|
const listeners = {
|
|
78
78
|
'update:modelValue': (v: Props['modelValue']) => handleChange(v, !!errorMessage.value)
|
|
79
79
|
}
|
|
80
|
-
const input =
|
|
80
|
+
const input = useTemplateRef<InstanceType<typeof QRadio>>('input')
|
|
81
81
|
const scopes = reactive(inputScope)
|
|
82
82
|
defineExpose<typeof scopes & { input: typeof input }>({ input, ...scopes })
|
|
83
|
-
defineOptions({
|
|
83
|
+
defineOptions({
|
|
84
|
+
name: 'MRadio',
|
|
85
|
+
inheritAttrs: !1
|
|
86
|
+
})
|
|
84
87
|
</script>
|
|
85
88
|
|
|
86
89
|
<template>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
import { useField } from 'vee-validate'
|
|
12
12
|
import type { MSelectProps as Props } from '../../types'
|
|
13
|
-
import { computed, reactive,
|
|
13
|
+
import { computed, reactive, toValue, useTemplateRef } from 'vue'
|
|
14
14
|
import { useBindInput, useMyth } from '../../composable'
|
|
15
15
|
import { QField, QSelect, type QSelectSlots } from 'quasar'
|
|
16
16
|
import { myth } from '../../utils'
|
|
@@ -164,10 +164,16 @@ const listeners = {
|
|
|
164
164
|
inputValue: (v: string) => (search.value = v?.toString() || ''),
|
|
165
165
|
filter: filterFn
|
|
166
166
|
}
|
|
167
|
-
const input =
|
|
167
|
+
const input = useTemplateRef<InstanceType<typeof QSelect> | InstanceType<typeof QField>>('input')
|
|
168
168
|
const scopes = reactive(inputScope)
|
|
169
|
-
defineExpose<typeof scopes & {
|
|
170
|
-
|
|
169
|
+
defineExpose<typeof scopes & {
|
|
170
|
+
input: typeof input,
|
|
171
|
+
onDoneOptions: typeof onDoneOptions
|
|
172
|
+
}>({ input, ...scopes, onDoneOptions })
|
|
173
|
+
defineOptions({
|
|
174
|
+
name: 'MSelect',
|
|
175
|
+
inheritAttrs: !1
|
|
176
|
+
})
|
|
171
177
|
</script>
|
|
172
178
|
|
|
173
179
|
<template>
|
|
@@ -13,7 +13,9 @@ import type {
|
|
|
13
13
|
QBtnProps,
|
|
14
14
|
QBtnSlots,
|
|
15
15
|
QCheckboxProps,
|
|
16
|
-
QDateProps,
|
|
16
|
+
QDateProps,
|
|
17
|
+
QEditorProps,
|
|
18
|
+
QEditorSlots,
|
|
17
19
|
QFieldSlots,
|
|
18
20
|
QFileProps,
|
|
19
21
|
QFileSlots,
|
|
@@ -21,7 +23,9 @@ import type {
|
|
|
21
23
|
QInputProps,
|
|
22
24
|
QInputSlots,
|
|
23
25
|
QItemProps,
|
|
24
|
-
QRadioProps,
|
|
26
|
+
QRadioProps,
|
|
27
|
+
QSelectProps,
|
|
28
|
+
QTableProps,
|
|
25
29
|
QTimeProps
|
|
26
30
|
} from 'quasar'
|
|
27
31
|
import type { MaybeRefOrGetter, TransitionGroupProps, TransitionProps, UnwrapNestedRefs, VNode } from 'vue'
|
|
@@ -30,7 +34,8 @@ import type { FieldContext, FieldOptions, FormContext, FormOptions, FormState }
|
|
|
30
34
|
|
|
31
35
|
import type { ThemeShadow, ThemeSize } from './theme'
|
|
32
36
|
import type {
|
|
33
|
-
GenericMDtBtn,
|
|
37
|
+
GenericMDtBtn,
|
|
38
|
+
MDtExportOptions,
|
|
34
39
|
MDtItem,
|
|
35
40
|
MDtRequestParamsCallbackProp,
|
|
36
41
|
MDtRequestParamsObjectProp,
|
|
@@ -664,6 +669,7 @@ export type MFormScope = FormContext<Record<string, any>>;
|
|
|
664
669
|
export interface MFormSlots {
|
|
665
670
|
default: (scope: MFormScope) => VNode[];
|
|
666
671
|
}
|
|
672
|
+
|
|
667
673
|
export declare type GenericFormValues = Record<any, any>;
|
|
668
674
|
|
|
669
675
|
export interface MDtBtnProps extends MBtnProps {
|
package/src/types/dt.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { QTableProps } from 'quasar'
|
|
|
2
2
|
import type { GenericFormValues, MDatatableProps, MDtBtnProps } from './components'
|
|
3
3
|
import type { MaybeRef, Ref, UnwrapRef } from 'vue'
|
|
4
4
|
import type { AxiosResponse } from 'axios'
|
|
5
|
+
|
|
5
6
|
type Generic = Record<any, any>;
|
|
6
7
|
|
|
7
8
|
export type MDtItem<T extends object = Record<keyof T, any>> = T & {
|
|
@@ -54,6 +55,7 @@ export interface ApiServiceParams {
|
|
|
54
55
|
|
|
55
56
|
[key: string]: any;
|
|
56
57
|
}
|
|
58
|
+
|
|
57
59
|
export type MDtServiceNameCallbackProp = (() => Record<string, (() => Promise<AxiosResponse>)>)
|
|
58
60
|
export type MDtServiceNameStringProp = string
|
|
59
61
|
export type MDtRequestParamsCallbackProp = (params: ApiServiceParams) => Partial<GenericFormValues>
|
package/src/utils/Helpers.ts
CHANGED
|
@@ -9,14 +9,7 @@
|
|
|
9
9
|
import { AxiosInstance, AxiosRequestConfig } from 'axios'
|
|
10
10
|
import lodash from 'lodash'
|
|
11
11
|
import { openURL, scroll } from 'quasar'
|
|
12
|
-
import type {
|
|
13
|
-
ConfigType,
|
|
14
|
-
DownloadFromResponse,
|
|
15
|
-
DownloadFromResponseCode,
|
|
16
|
-
HelpersStubSchema,
|
|
17
|
-
ParamsType,
|
|
18
|
-
UrlType
|
|
19
|
-
} from '../types'
|
|
12
|
+
import type { ConfigType, DownloadFromResponse, DownloadFromResponseCode, HelpersStubSchema, ParamsType, UrlType } from '../types'
|
|
20
13
|
|
|
21
14
|
import { nextTick } from 'vue'
|
|
22
15
|
|