@mythpe/quasar-ui-qui 0.0.60 → 0.0.61
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 +54 -16
- package/src/components/form/MColor.vue +26 -43
- package/src/components/form/MDate.vue +1 -1
- package/src/components/form/MEmail.vue +1 -3
- package/src/components/form/MField.vue +10 -8
- package/src/components/form/MFile.vue +2 -2
- package/src/components/form/MInput.vue +3 -3
- package/src/components/form/MInputLabel.vue +4 -1
- package/src/components/form/MOptions.vue +4 -1
- package/src/components/form/MPicker.vue +59 -61
- package/src/components/form/MRadio.vue +7 -4
- package/src/components/form/MSelect.vue +12 -12
- package/src/components/form/MToggle.vue +5 -4
- package/src/composable/useBindInput.ts +1 -1
- package/src/types/components.d.ts +1 -1
package/package.json
CHANGED
|
@@ -16,11 +16,34 @@ import { useBindInput, useMyth } from '../../composable'
|
|
|
16
16
|
import type { MCheckboxProps as Props } from '../../types'
|
|
17
17
|
import { QCheckbox, QField } from 'quasar'
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
type P = {
|
|
20
|
+
auto?: Props['auto'];
|
|
21
|
+
col?: Props['col'];
|
|
22
|
+
xs?: Props['xs'];
|
|
23
|
+
sm?: Props['sm'];
|
|
24
|
+
md?: Props['md'];
|
|
25
|
+
lg?: Props['lg'];
|
|
26
|
+
xl?: Props['xl'];
|
|
27
|
+
name: Props['name'];
|
|
28
|
+
label?: Props['label'];
|
|
29
|
+
caption?: Props['caption'];
|
|
30
|
+
hint?: Props['hint'];
|
|
31
|
+
help?: Props['help'];
|
|
32
|
+
val?: Props['val'];
|
|
33
|
+
required?: Props['required'];
|
|
34
|
+
rules?: Props['rules'];
|
|
35
|
+
trueValue?: Props['trueValue'];
|
|
36
|
+
falseValue?: Props['falseValue'];
|
|
37
|
+
checkedIcon?: Props['checkedIcon'];
|
|
38
|
+
rowProps?: Props['rowProps'];
|
|
39
|
+
colProps?: Props['colProps'];
|
|
40
|
+
viewMode?: Props['viewMode'];
|
|
41
|
+
fieldOptions?: Props['fieldOptions'];
|
|
42
|
+
autocomplete: Props['autocomplete'];
|
|
43
|
+
disable: Props['disable'];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const props = withDefaults(defineProps<P>(), {
|
|
24
47
|
auto: undefined,
|
|
25
48
|
col: undefined,
|
|
26
49
|
xs: undefined,
|
|
@@ -28,17 +51,28 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
28
51
|
md: undefined,
|
|
29
52
|
lg: undefined,
|
|
30
53
|
xl: undefined,
|
|
54
|
+
name: () => '',
|
|
55
|
+
label: undefined,
|
|
56
|
+
caption: undefined,
|
|
57
|
+
hint: undefined,
|
|
58
|
+
help: undefined,
|
|
59
|
+
val: undefined,
|
|
31
60
|
required: undefined,
|
|
61
|
+
rules: undefined,
|
|
62
|
+
trueValue: () => !0,
|
|
63
|
+
falseValue: () => !1,
|
|
64
|
+
checkedIcon: undefined,
|
|
65
|
+
rowProps: undefined,
|
|
66
|
+
colProps: undefined,
|
|
67
|
+
viewMode: () => !1,
|
|
68
|
+
fieldOptions: undefined,
|
|
32
69
|
autocomplete: undefined,
|
|
33
|
-
|
|
34
|
-
email: undefined,
|
|
35
|
-
float: undefined,
|
|
36
|
-
useChoice: undefined
|
|
70
|
+
disable: undefined
|
|
37
71
|
})
|
|
38
72
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
39
|
-
const { __ } = useMyth()
|
|
73
|
+
const { __, props: pluginOptions } = useMyth()
|
|
40
74
|
const helper = useBindInput<Props>(() => props, 'checkbox')
|
|
41
|
-
const { getLabel, inputRules, theme } = helper
|
|
75
|
+
const { getLabel, inputRules, theme, getAutocompleteAttribute, getProp } = helper
|
|
42
76
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
43
77
|
syncVModel: !0,
|
|
44
78
|
label: getLabel,
|
|
@@ -91,10 +125,11 @@ defineOptions({
|
|
|
91
125
|
<MCol v-bind="colProps">
|
|
92
126
|
<q-field
|
|
93
127
|
v-bind="{
|
|
94
|
-
|
|
128
|
+
...theme,
|
|
129
|
+
...pluginOptions.field,
|
|
95
130
|
error: !!errorMessage,
|
|
96
131
|
errorMessage,
|
|
97
|
-
hint: __(hint),
|
|
132
|
+
hint: hint ? __(hint) : hint,
|
|
98
133
|
borderless: !0,
|
|
99
134
|
outlined: !1,
|
|
100
135
|
stackLabel: !0
|
|
@@ -103,11 +138,14 @@ defineOptions({
|
|
|
103
138
|
<q-checkbox
|
|
104
139
|
ref="input"
|
|
105
140
|
v-bind="{
|
|
106
|
-
...$attrs,
|
|
107
141
|
...theme,
|
|
142
|
+
...pluginOptions.checkbox,
|
|
143
|
+
checkedIcon: getProp('checkedIcon'),
|
|
144
|
+
...$attrs,
|
|
108
145
|
modelValue: value,
|
|
109
|
-
disable: viewMode === !0 ?
|
|
110
|
-
|
|
146
|
+
disable: viewMode === !0 ? !0 : disable,
|
|
147
|
+
autocomplete: getAutocompleteAttribute,
|
|
148
|
+
label: undefined
|
|
111
149
|
}"
|
|
112
150
|
v-on="listeners"
|
|
113
151
|
>
|
|
@@ -16,54 +16,28 @@ import { useField } from 'vee-validate'
|
|
|
16
16
|
import { useBindInput } from '../../composable'
|
|
17
17
|
import type { QField, QInput } from 'quasar'
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
type P = {
|
|
20
|
+
name: Props['name'];
|
|
21
|
+
label?: Props['label'];
|
|
22
|
+
required?: Props['required'];
|
|
23
|
+
rules?: Props['rules'];
|
|
24
|
+
viewMode?: Props['viewMode'];
|
|
25
|
+
topLabel?: Props['topLabel'];
|
|
26
|
+
fieldOptions?: Props['fieldOptions'];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const props = withDefaults(defineProps<P>(), {
|
|
20
30
|
name: () => '',
|
|
21
|
-
|
|
22
|
-
reverseFillMask: undefined,
|
|
23
|
-
unmaskedValue: undefined,
|
|
24
|
-
error: undefined,
|
|
25
|
-
noErrorIcon: undefined,
|
|
26
|
-
reactiveRules: undefined,
|
|
27
|
-
lazyRules: undefined,
|
|
28
|
-
stackLabel: undefined,
|
|
29
|
-
hideHint: undefined,
|
|
30
|
-
dark: undefined,
|
|
31
|
-
loading: undefined,
|
|
32
|
-
clearable: undefined,
|
|
33
|
-
filled: undefined,
|
|
34
|
-
outlined: undefined,
|
|
35
|
-
borderless: undefined,
|
|
36
|
-
standout: undefined,
|
|
37
|
-
labelSlot: undefined,
|
|
38
|
-
bottomSlots: undefined,
|
|
39
|
-
hideBottomSpace: undefined,
|
|
40
|
-
counter: undefined,
|
|
41
|
-
rounded: undefined,
|
|
42
|
-
square: undefined,
|
|
43
|
-
dense: undefined,
|
|
44
|
-
itemAligned: undefined,
|
|
45
|
-
disable: undefined,
|
|
46
|
-
readonly: undefined,
|
|
47
|
-
autofocus: undefined,
|
|
48
|
-
autogrow: undefined,
|
|
49
|
-
viewMode: undefined,
|
|
50
|
-
auto: undefined,
|
|
51
|
-
col: undefined,
|
|
52
|
-
xs: undefined,
|
|
53
|
-
sm: undefined,
|
|
54
|
-
md: undefined,
|
|
55
|
-
lg: undefined,
|
|
56
|
-
xl: undefined,
|
|
31
|
+
label: undefined,
|
|
57
32
|
required: undefined,
|
|
58
|
-
|
|
33
|
+
rules: undefined,
|
|
34
|
+
viewMode: () => !1,
|
|
59
35
|
topLabel: undefined,
|
|
60
|
-
|
|
61
|
-
email: undefined,
|
|
62
|
-
float: undefined
|
|
36
|
+
fieldOptions: undefined
|
|
63
37
|
})
|
|
64
38
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
65
39
|
const helper = useBindInput<Props>(() => props, 'input')
|
|
66
|
-
const { getLabel, inputRules
|
|
40
|
+
const { getLabel, inputRules } = helper
|
|
67
41
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
68
42
|
syncVModel: !0,
|
|
69
43
|
label: getLabel,
|
|
@@ -88,7 +62,16 @@ defineOptions({
|
|
|
88
62
|
<template>
|
|
89
63
|
<MInput
|
|
90
64
|
ref="input"
|
|
91
|
-
v-bind="{
|
|
65
|
+
v-bind="{
|
|
66
|
+
...$attrs,
|
|
67
|
+
name,
|
|
68
|
+
label,
|
|
69
|
+
required,
|
|
70
|
+
topLabel,
|
|
71
|
+
viewMode,
|
|
72
|
+
rules: inputRules,
|
|
73
|
+
modelValue: value
|
|
74
|
+
}"
|
|
92
75
|
v-on="listeners"
|
|
93
76
|
>
|
|
94
77
|
<template #prepend>
|
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
import type { MInputProps as Props, MInputSlots } from '../../types'
|
|
14
14
|
import { useTemplateRef } from 'vue'
|
|
15
15
|
import MInput from './MInput.vue'
|
|
16
|
-
import { useMyth } from '../../composable'
|
|
17
16
|
|
|
18
|
-
const { props: pluginOptions } = useMyth()
|
|
19
17
|
const modelValue = defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
20
18
|
const input = useTemplateRef<InstanceType<typeof MInput>>('input')
|
|
21
19
|
defineExpose<{ input: typeof input }>({ input })
|
|
@@ -29,7 +27,7 @@ defineOptions({
|
|
|
29
27
|
<MInput
|
|
30
28
|
ref="input"
|
|
31
29
|
v-model="modelValue"
|
|
32
|
-
v-bind="{
|
|
30
|
+
v-bind="{...$attrs as any, type:'email',email:!0}"
|
|
33
31
|
>
|
|
34
32
|
<template
|
|
35
33
|
v-for="(_,slot) in $slots as Readonly<MInputSlots>"
|
|
@@ -59,10 +59,10 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
59
59
|
topLabel: undefined,
|
|
60
60
|
clearable: undefined
|
|
61
61
|
})
|
|
62
|
-
const { __ } = useMyth()
|
|
62
|
+
const { __, props: pluginOptions } = useMyth()
|
|
63
63
|
const modelValue = defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
64
64
|
const helper = useBindInput<P>(() => props, 'input')
|
|
65
|
-
const { hasTopLabel, getLabel, getPlaceholder, inputRules,
|
|
65
|
+
const { hasTopLabel, getLabel, getPlaceholder, inputRules, getAutocompleteAttribute, theme } = helper
|
|
66
66
|
const value = useFieldValue(() => props.name)
|
|
67
67
|
const errorMessage = useFieldError(() => props.name)
|
|
68
68
|
const input = useTemplateRef<InstanceType<typeof QField>>('input')
|
|
@@ -108,16 +108,18 @@ defineOptions({
|
|
|
108
108
|
<q-field
|
|
109
109
|
ref="input"
|
|
110
110
|
v-bind="{
|
|
111
|
+
...theme,
|
|
111
112
|
...$attrs,
|
|
112
|
-
...
|
|
113
|
+
...pluginOptions.field as any,
|
|
113
114
|
clearable: !1,
|
|
114
115
|
stackLabel: !0,
|
|
115
|
-
error
|
|
116
|
+
error: !!errorMessage,
|
|
116
117
|
errorMessage,
|
|
117
|
-
hint:__(hint),
|
|
118
|
-
label:hasTopLabel ? undefined : getLabel,
|
|
119
|
-
modelValue:value,
|
|
120
|
-
|
|
118
|
+
hint: hint ? __(hint) : hint,
|
|
119
|
+
label: hasTopLabel ? undefined : getLabel,
|
|
120
|
+
modelValue: value,
|
|
121
|
+
autocomplete: getAutocompleteAttribute,
|
|
122
|
+
placeholder: getPlaceholder
|
|
121
123
|
}"
|
|
122
124
|
>
|
|
123
125
|
<template
|
|
@@ -74,7 +74,7 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
74
74
|
fieldOptions: undefined
|
|
75
75
|
})
|
|
76
76
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
77
|
-
const { __ } = useMyth()
|
|
77
|
+
const { __, props: pluginOptions } = useMyth()
|
|
78
78
|
const helper = useBindInput<P>(() => props, 'file', () => ({ choose: !0 }))
|
|
79
79
|
const { hasTopLabel, getLabel, getPlaceholder, accepts, inputRules, attrs } = helper
|
|
80
80
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
@@ -165,7 +165,7 @@ defineOptions({
|
|
|
165
165
|
:model-value="value"
|
|
166
166
|
v-bind="{
|
|
167
167
|
...$attrs,
|
|
168
|
-
...
|
|
168
|
+
...pluginOptions.file as any,
|
|
169
169
|
...( viewMode ? { stackLabel: !0 } : {} )
|
|
170
170
|
}"
|
|
171
171
|
v-on="listeners"
|
|
@@ -70,7 +70,7 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
70
70
|
float: undefined
|
|
71
71
|
})
|
|
72
72
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
73
|
-
const { __ } = useMyth()
|
|
73
|
+
const { __, props: pluginOptions } = useMyth()
|
|
74
74
|
const helper = useBindInput<Props>(() => props, 'input')
|
|
75
75
|
const { theme, hasTopLabel, getLabel, getPlaceholder, getAutocompleteAttribute, inputRules } = helper
|
|
76
76
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
@@ -136,7 +136,7 @@ defineOptions({
|
|
|
136
136
|
v-bind="{
|
|
137
137
|
...$attrs,
|
|
138
138
|
...theme,
|
|
139
|
-
...( viewMode ? { stackLabel: !0 } :
|
|
139
|
+
...( viewMode ? { ...pluginOptions.field, stackLabel: !0 } : pluginOptions.input as any),
|
|
140
140
|
autocomplete: getAutocompleteAttribute,
|
|
141
141
|
clearable: viewMode ? !1 : clearable,
|
|
142
142
|
error: !!errorMessage,
|
|
@@ -144,7 +144,7 @@ defineOptions({
|
|
|
144
144
|
hint: __(hint),
|
|
145
145
|
label: hasTopLabel ? undefined : getLabel,
|
|
146
146
|
modelValue: value,
|
|
147
|
-
placeholder: getPlaceholder
|
|
147
|
+
placeholder: getPlaceholder,
|
|
148
148
|
}"
|
|
149
149
|
v-on="listeners"
|
|
150
150
|
>
|
|
@@ -15,7 +15,10 @@ import type { MInputLabelProps as Props } from '../../types'
|
|
|
15
15
|
import { useMyth } from '../../composable'
|
|
16
16
|
|
|
17
17
|
const { __ } = useMyth()
|
|
18
|
-
defineProps<Props>()
|
|
18
|
+
withDefaults(defineProps<Props>(), {
|
|
19
|
+
field: () => ({} as Props['field']),
|
|
20
|
+
label: undefined
|
|
21
|
+
})
|
|
19
22
|
defineOptions({
|
|
20
23
|
name: 'MInputLabel',
|
|
21
24
|
inheritAttrs: !1
|
|
@@ -181,7 +181,10 @@ defineOptions({
|
|
|
181
181
|
:model-value="value"
|
|
182
182
|
:options="options"
|
|
183
183
|
:type="viewMode ? undefined : type"
|
|
184
|
-
v-bind="{
|
|
184
|
+
v-bind="{
|
|
185
|
+
...$attrs,
|
|
186
|
+
...( viewMode ? { ...pluginProps.field, stackLabel: !0 } : pluginProps.options as any )
|
|
187
|
+
}"
|
|
185
188
|
v-on="listeners"
|
|
186
189
|
>
|
|
187
190
|
<template
|
|
@@ -18,38 +18,39 @@ import type { QFieldSlots } from 'quasar'
|
|
|
18
18
|
import { QDate, QField, QTime } from 'quasar'
|
|
19
19
|
|
|
20
20
|
const defSeparator = ' - '
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
disable
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
21
|
+
|
|
22
|
+
interface P {
|
|
23
|
+
name: Props['name'];
|
|
24
|
+
auto?: Props['auto'];
|
|
25
|
+
col?: Props['col'];
|
|
26
|
+
xs?: Props['xs'];
|
|
27
|
+
sm?: Props['sm'];
|
|
28
|
+
md?: Props['md'];
|
|
29
|
+
lg?: Props['lg'];
|
|
30
|
+
xl?: Props['xl'];
|
|
31
|
+
label?: Props['label'];
|
|
32
|
+
caption?: Props['caption'];
|
|
33
|
+
hint?: Props['hint'];
|
|
34
|
+
placeholder?: Props['placeholder'];
|
|
35
|
+
help?: Props['help'];
|
|
36
|
+
required?: Props['required'];
|
|
37
|
+
rules?: Props['rules'];
|
|
38
|
+
viewMode?: Props['viewMode'];
|
|
39
|
+
viewModeValue?: Props['viewModeValue'];
|
|
40
|
+
autocomplete?: Props['autocomplete'];
|
|
41
|
+
topLabel?: Props['topLabel'];
|
|
42
|
+
type?: Props['type'];
|
|
43
|
+
range?: Props['range'];
|
|
44
|
+
rangeSeparator?: Props['rangeSeparator'];
|
|
45
|
+
multiple?: Props['multiple'];
|
|
46
|
+
btnProps?: Props['btnProps'];
|
|
47
|
+
readonly?: Props['readonly'];
|
|
48
|
+
disable?: Props['disable'];
|
|
49
|
+
fieldOptions?: Props['fieldOptions'];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const props = withDefaults(defineProps<P>(), {
|
|
53
|
+
name: () => '',
|
|
53
54
|
auto: undefined,
|
|
54
55
|
col: undefined,
|
|
55
56
|
xs: undefined,
|
|
@@ -57,32 +58,31 @@ const props = withDefaults(defineProps<Omit<Props, 'prefix'>>(), {
|
|
|
57
58
|
md: undefined,
|
|
58
59
|
lg: undefined,
|
|
59
60
|
xl: undefined,
|
|
61
|
+
label: undefined,
|
|
62
|
+
caption: undefined,
|
|
63
|
+
hint: undefined,
|
|
64
|
+
placeholder: undefined,
|
|
65
|
+
help: undefined,
|
|
60
66
|
required: undefined,
|
|
67
|
+
rules: undefined,
|
|
68
|
+
viewMode: () => !1,
|
|
69
|
+
viewModeValue: undefined,
|
|
61
70
|
autocomplete: undefined,
|
|
62
71
|
topLabel: undefined,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
todayBtn: undefined,
|
|
72
|
-
minimal: undefined,
|
|
73
|
-
multiple: undefined,
|
|
74
|
-
range: undefined,
|
|
75
|
-
emitImmediately: undefined,
|
|
76
|
-
format24h: undefined,
|
|
77
|
-
withSeconds: undefined,
|
|
78
|
-
nowBtn: undefined,
|
|
79
|
-
useChoice: undefined
|
|
72
|
+
type: () => 'date',
|
|
73
|
+
range: () => !1,
|
|
74
|
+
rangeSeparator: () => ' - ',
|
|
75
|
+
multiple: () => !1,
|
|
76
|
+
btnProps: undefined,
|
|
77
|
+
readonly: undefined,
|
|
78
|
+
disable: undefined,
|
|
79
|
+
fieldOptions: undefined
|
|
80
80
|
})
|
|
81
81
|
|
|
82
82
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
83
83
|
const helper = useBindInput<Props>(() => props, 'picker', () => ({ choose: !0 }))
|
|
84
|
-
const { hasTopLabel, getLabel, getPlaceholder, inputRules, getAutocompleteAttribute, getProp } = helper
|
|
85
|
-
const { __, props: pluginOptions
|
|
84
|
+
const { theme, hasTopLabel, getLabel, getPlaceholder, inputRules, getAutocompleteAttribute, getProp } = helper
|
|
85
|
+
const { __, props: pluginOptions } = useMyth()
|
|
86
86
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
87
87
|
syncVModel: !0,
|
|
88
88
|
label: getLabel,
|
|
@@ -168,16 +168,16 @@ defineOptions({
|
|
|
168
168
|
<q-field
|
|
169
169
|
ref="input"
|
|
170
170
|
v-model="value"
|
|
171
|
-
:error="!!errorMessage"
|
|
172
|
-
:error-message="errorMessage"
|
|
173
|
-
:hint="__(hint)"
|
|
174
|
-
:label="hasTopLabel ? undefined : getLabel"
|
|
175
171
|
v-bind="{
|
|
176
172
|
...pluginOptions.input as any,
|
|
177
173
|
...pluginOptions.field as any,
|
|
178
|
-
...theme
|
|
174
|
+
...theme,
|
|
179
175
|
...$attrs,
|
|
180
|
-
|
|
176
|
+
error: !!errorMessage,
|
|
177
|
+
errorMessage,
|
|
178
|
+
hint: hint ? __(hint) : hint,
|
|
179
|
+
label: hasTopLabel ? undefined : getLabel,
|
|
180
|
+
autocomplete: getAutocompleteAttribute,
|
|
181
181
|
stackLabel: !0
|
|
182
182
|
}"
|
|
183
183
|
>
|
|
@@ -227,10 +227,9 @@ defineOptions({
|
|
|
227
227
|
ref="dateElm"
|
|
228
228
|
v-bind="{
|
|
229
229
|
...pluginOptions.date as any,
|
|
230
|
-
...props,
|
|
231
230
|
...$attrs,
|
|
232
231
|
todayBtn: getProp('todayBtn') === undefined ? !0 : getProp('todayBtn'),
|
|
233
|
-
mask:format,
|
|
232
|
+
mask: format,
|
|
234
233
|
multiple,
|
|
235
234
|
range,
|
|
236
235
|
modelValue: dateRef ?? null
|
|
@@ -258,10 +257,9 @@ defineOptions({
|
|
|
258
257
|
v-else
|
|
259
258
|
ref="timeElm"
|
|
260
259
|
v-bind="{
|
|
261
|
-
...$props,
|
|
262
260
|
...pluginOptions.time,
|
|
263
261
|
...$attrs,
|
|
264
|
-
mask:format,
|
|
262
|
+
mask: format,
|
|
265
263
|
nowBtn: getProp('nowBtn') === undefined? !0 : getProp('nowBtn'),
|
|
266
264
|
modelValue: dateRef ?? null
|
|
267
265
|
}"
|
|
@@ -38,6 +38,7 @@ type P = {
|
|
|
38
38
|
colProps?: Props['colProps'];
|
|
39
39
|
viewMode?: Props['viewMode'];
|
|
40
40
|
fieldOptions?: Props['fieldOptions'];
|
|
41
|
+
disable?: Props['disable'];
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
const props = withDefaults(defineProps<P>(), {
|
|
@@ -61,11 +62,12 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
61
62
|
rowProps: undefined,
|
|
62
63
|
colProps: undefined,
|
|
63
64
|
viewMode: () => !1,
|
|
64
|
-
fieldOptions: undefined
|
|
65
|
+
fieldOptions: undefined,
|
|
66
|
+
disable: undefined
|
|
65
67
|
})
|
|
66
68
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
67
69
|
const helper = useBindInput<P>(() => props, 'radio')
|
|
68
|
-
const { getLabel, inputRules,
|
|
70
|
+
const { getLabel, inputRules, getProp, theme } = helper
|
|
69
71
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
70
72
|
syncVModel: !0,
|
|
71
73
|
label: getLabel,
|
|
@@ -121,6 +123,7 @@ defineOptions({
|
|
|
121
123
|
:error-message="errorMessage"
|
|
122
124
|
:hint="__(hint)"
|
|
123
125
|
v-bind="{
|
|
126
|
+
...theme,
|
|
124
127
|
...pluginOptions.input as any,
|
|
125
128
|
...pluginOptions.field,
|
|
126
129
|
...$attrs,
|
|
@@ -132,13 +135,13 @@ defineOptions({
|
|
|
132
135
|
<template #control>
|
|
133
136
|
<q-radio
|
|
134
137
|
ref="input"
|
|
135
|
-
:disable="viewMode"
|
|
136
138
|
:model-value="value"
|
|
137
139
|
:val="val"
|
|
138
140
|
v-bind="{
|
|
141
|
+
...theme,
|
|
139
142
|
...pluginOptions.radio,
|
|
140
143
|
...$attrs,
|
|
141
|
-
|
|
144
|
+
disable: viewMode ? !0 : disable,
|
|
142
145
|
checkedIcon: getProp('checkedIcon'),
|
|
143
146
|
label: undefined
|
|
144
147
|
}"
|
|
@@ -109,9 +109,9 @@ type Emits = {
|
|
|
109
109
|
}
|
|
110
110
|
const emit = defineEmits<Emits>()
|
|
111
111
|
|
|
112
|
-
const { __, props: pluginOptions
|
|
112
|
+
const { __, props: pluginOptions } = useMyth()
|
|
113
113
|
const helper = useBindInput<P & Props>(() => props, 'select', () => ({ choose: !0 }))
|
|
114
|
-
const {
|
|
114
|
+
const { theme, hasTopLabel, getLabel, getPlaceholder, getAutocompleteAttribute, inputRules, getProp } = helper
|
|
115
115
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
116
116
|
syncVModel: !0,
|
|
117
117
|
label: getLabel,
|
|
@@ -217,20 +217,19 @@ defineOptions({
|
|
|
217
217
|
ref="input"
|
|
218
218
|
v-bind="{
|
|
219
219
|
behavior: $q.platform.is.ios === !0 ? 'dialog' : behavior,
|
|
220
|
-
...
|
|
221
|
-
|
|
222
|
-
...( viewMode ? pluginOptions.field :
|
|
220
|
+
...theme,
|
|
221
|
+
...$attrs,
|
|
222
|
+
...( viewMode ? pluginOptions.field : pluginOptions.select as any ),
|
|
223
223
|
emitValue: emitValue,
|
|
224
224
|
error: !!errorMessage,
|
|
225
225
|
errorMessage,
|
|
226
226
|
hideSelected: hideSelected !== undefined ? hideSelected : search.length > 0,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
optionValue: optionValue,
|
|
227
|
+
optionLabel,
|
|
228
|
+
optionValue,
|
|
230
229
|
options: getOptions,
|
|
231
|
-
readonly
|
|
230
|
+
readonly,
|
|
232
231
|
...(viewMode ? { stackLabel: !0 } : { stackLabel: hasTopLabel ? !1 : (
|
|
233
|
-
theme.
|
|
232
|
+
theme.dense !== undefined ? theme.dense : getProp('dense')
|
|
234
233
|
) } ),
|
|
235
234
|
useChips: getProp('useChips') === !0 && !multiple ? !1 : getProp('useChips'),
|
|
236
235
|
multiple,
|
|
@@ -239,8 +238,9 @@ defineOptions({
|
|
|
239
238
|
useInput,
|
|
240
239
|
autocomplete: getAutocompleteAttribute,
|
|
241
240
|
clearable: viewMode ? !1 : clearable,
|
|
242
|
-
hint: __(hint),
|
|
241
|
+
hint: hint ? __(hint) : hint,
|
|
243
242
|
label: viewMode && hasTopLabel ? undefined : (loading ? undefined : getPlaceholder),
|
|
243
|
+
modelValue: value,
|
|
244
244
|
}"
|
|
245
245
|
v-on="listeners"
|
|
246
246
|
>
|
|
@@ -249,7 +249,7 @@ defineOptions({
|
|
|
249
249
|
#no-option
|
|
250
250
|
>
|
|
251
251
|
<slot name="no-option">
|
|
252
|
-
<q-item :dense="theme.
|
|
252
|
+
<q-item :dense="theme.dense !== undefined ? theme.dense : getProp('optionsDense')">
|
|
253
253
|
<q-item-section side>
|
|
254
254
|
<template v-if="loading">
|
|
255
255
|
<q-spinner color="primary" />
|
|
@@ -85,7 +85,7 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
85
85
|
})
|
|
86
86
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
87
87
|
const helper = useBindInput<P>(() => props, 'toggle', () => ({ choose: !0 }))
|
|
88
|
-
const { getLabel: toggleLabel, inputRules, getProp } = helper
|
|
88
|
+
const { getLabel: toggleLabel, inputRules, getProp, theme } = helper
|
|
89
89
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
90
90
|
syncVModel: !0,
|
|
91
91
|
label: toggleLabel,
|
|
@@ -96,7 +96,7 @@ const { value, errorMessage, handleChange } = inputScope
|
|
|
96
96
|
const listeners = {
|
|
97
97
|
'update:modelValue': (v: Props['modelValue']) => handleChange(v, !!errorMessage.value)
|
|
98
98
|
}
|
|
99
|
-
const { __, props: pluginOptions
|
|
99
|
+
const { __, props: pluginOptions } = useMyth()
|
|
100
100
|
const getLabel = computed<string | undefined>(() => {
|
|
101
101
|
const def = undefined
|
|
102
102
|
const v = value.value
|
|
@@ -169,7 +169,7 @@ defineOptions({
|
|
|
169
169
|
...$attrs,
|
|
170
170
|
borderless: !0,
|
|
171
171
|
outlined: !1,
|
|
172
|
-
dense: theme.
|
|
172
|
+
dense: theme.dense !== undefined ? theme.dense : getProp('dense')
|
|
173
173
|
}"
|
|
174
174
|
>
|
|
175
175
|
<q-toggle
|
|
@@ -181,8 +181,9 @@ defineOptions({
|
|
|
181
181
|
:true-value="trueValue"
|
|
182
182
|
v-bind="{
|
|
183
183
|
...pluginOptions.toggle,
|
|
184
|
+
...theme,
|
|
184
185
|
...$attrs,
|
|
185
|
-
dense: theme.
|
|
186
|
+
dense: theme.dense !== undefined ? theme.dense : getProp('dense'),
|
|
186
187
|
checkedIcon: getProp('checkedIcon'),
|
|
187
188
|
uncheckedIcon: getProp('uncheckedIcon'),
|
|
188
189
|
color: !!errorMessage ? 'negative' : getProp('color'),
|
|
@@ -25,7 +25,7 @@ export const useBindInput = <P extends G = G> (Props: MaybeRefOrGetter<P>, key:
|
|
|
25
25
|
})
|
|
26
26
|
|
|
27
27
|
const themeStyle = computed(() => (key === 'btn' ? mTheme.value.buttons : mTheme.value.inputs) ?? {})
|
|
28
|
-
const theme = ref({})
|
|
28
|
+
const theme = ref<Record<string, any>>({})
|
|
29
29
|
for (const k in themeStyle.value) {
|
|
30
30
|
if (props[k] !== undefined) {
|
|
31
31
|
theme.value[k] = props[k]
|
|
@@ -577,7 +577,7 @@ export interface BaseCheckboxProps extends Omit<BaseInputsProps, 'topLabel'> {
|
|
|
577
577
|
colProps?: Record<string, any>;
|
|
578
578
|
}
|
|
579
579
|
|
|
580
|
-
export interface MCheckboxProps extends Omit<QCheckboxProps, 'name' | 'modelValue' | 'label'
|
|
580
|
+
export interface MCheckboxProps extends BaseCheckboxProps, Omit<QCheckboxProps, 'name' | 'modelValue' | 'label'> {
|
|
581
581
|
//
|
|
582
582
|
}
|
|
583
583
|
|