@mythpe/quasar-ui-qui 0.0.24 → 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/index.d.ts +17 -0
- package/package.json +14 -8
- package/src/boot/register.ts +14 -0
- package/src/components/form/MAvatarViewer.vue +324 -0
- package/src/components/form/MBtn.vue +271 -93
- package/src/components/form/MCheckbox.vue +126 -0
- package/src/components/form/MColor.vue +122 -0
- package/src/components/form/MDate.vue +47 -0
- package/src/components/form/MEditor.vue +285 -0
- package/src/components/form/MEmail.vue +40 -0
- package/src/components/form/MField.vue +145 -0
- package/src/components/form/MFile.vue +212 -0
- package/src/components/form/MForm.vue +86 -0
- package/src/components/form/MHidden.vue +86 -0
- package/src/components/form/MHiddenInput.vue +55 -0
- package/src/components/form/MInput.vue +178 -0
- package/src/components/form/MInputFieldControl.vue +27 -0
- package/src/components/form/MInputLabel.vue +35 -0
- package/src/components/form/MMobile.vue +40 -0
- package/src/components/form/MPicker.vue +313 -0
- package/src/components/form/MRadio.vue +178 -0
- package/src/components/form/MSelect.vue +349 -0
- package/src/components/form/MTime.vue +45 -0
- package/src/components/form/index.ts +51 -0
- package/src/components/grid/MBlock.vue +40 -18
- package/src/components/grid/MCol.vue +11 -15
- package/src/components/grid/MColumn.vue +8 -0
- package/src/components/grid/MContainer.vue +22 -13
- package/src/components/grid/MHelpRow.vue +9 -12
- package/src/components/grid/MRow.vue +31 -10
- package/src/components/grid/index.ts +16 -0
- package/src/components/index.ts +12 -0
- package/src/components/transition/MFadeTransition.vue +27 -0
- package/src/components/transition/MFadeXTransition.vue +26 -0
- package/src/components/transition/MTransition.vue +41 -0
- package/src/components/transition/index.ts +13 -0
- package/src/components/typography/MTypingString.vue +8 -0
- package/src/components/typography/index.ts +11 -0
- package/src/composable/index.ts +12 -0
- package/src/composable/useBindInput.ts +209 -0
- package/src/composable/useError.ts +11 -0
- package/src/composable/useMyth.ts +294 -0
- package/src/composable/useValue.ts +12 -0
- package/src/index.common.js +19 -1
- package/src/index.esm.js +18 -3
- package/src/index.js +19 -0
- package/src/index.sass +8 -26
- package/src/index.ts +18 -4
- package/src/index.umd.js +17 -2
- package/src/style/m-container.sass +13 -0
- package/src/style/main.sass +42 -0
- package/src/types/api-helpers.d.ts +120 -0
- package/src/types/components.d.ts +688 -28
- package/src/types/dt.d.ts +144 -0
- package/src/types/index.d.ts +153 -1
- package/src/types/lodash.d.ts +26 -0
- package/src/types/quasar-helpers.d.ts +7 -0
- package/src/types/theme.d.ts +12 -0
- package/src/utils/Helpers.ts +314 -0
- package/src/utils/Str.ts +211 -0
- package/src/utils/index.ts +13 -0
- package/src/utils/myth.ts +90 -0
- package/src/utils/vee-rules.ts +32 -0
- package/src/utils/vue-plugin.ts +122 -0
- package/tsconfig.json +9 -13
- package/src/myth.ts +0 -30
- package/src/types/myth.ts +0 -42
- package/src/vue-plugin.ts +0 -41
- package/types.d.ts +0 -1
|
@@ -0,0 +1,349 @@
|
|
|
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
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
|
|
11
|
+
import { useField } from 'vee-validate'
|
|
12
|
+
import type { MSelectProps as Props } from '../../types'
|
|
13
|
+
import { computed, reactive, toValue, useTemplateRef } from 'vue'
|
|
14
|
+
import { useBindInput, useMyth } from '../../composable'
|
|
15
|
+
import { QField, QSelect, type QSelectSlots } from 'quasar'
|
|
16
|
+
import { myth } from '../../utils'
|
|
17
|
+
|
|
18
|
+
type P = {
|
|
19
|
+
name: Props['name'];
|
|
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
|
+
label?: Props['label'];
|
|
28
|
+
caption?: Props['caption'];
|
|
29
|
+
hint?: Props['hint'];
|
|
30
|
+
placeholder?: Props['placeholder'];
|
|
31
|
+
help?: Props['help'];
|
|
32
|
+
stackLabel?: Props['stackLabel'];
|
|
33
|
+
required?: Props['required'];
|
|
34
|
+
rules?: Props['rules'];
|
|
35
|
+
viewMode?: Props['viewMode'];
|
|
36
|
+
viewModeValue?: Props['viewModeValue'];
|
|
37
|
+
autocomplete?: Props['autocomplete'];
|
|
38
|
+
topLabel?: Props['topLabel'];
|
|
39
|
+
behavior?: Props['behavior'];
|
|
40
|
+
emitValue?: Props['emitValue'];
|
|
41
|
+
useInput?: Props['useInput'];
|
|
42
|
+
mapOptions?: Props['mapOptions'];
|
|
43
|
+
loading?: Props['loading'];
|
|
44
|
+
multiple?: Props['multiple'];
|
|
45
|
+
options?: Props['options'];
|
|
46
|
+
optionLabel?: Props['optionLabel'];
|
|
47
|
+
optionValue?: Props['optionValue'];
|
|
48
|
+
noFilter?: Props['noFilter'];
|
|
49
|
+
hideEmptyList?: Props['hideEmptyList'];
|
|
50
|
+
readonly?: Props['readonly'];
|
|
51
|
+
useChips?: Props['useChips'];
|
|
52
|
+
searchLength?: Props['searchLength'];
|
|
53
|
+
axiosMode?: Props['axiosMode'];
|
|
54
|
+
hideSelected?: Props['hideSelected'];
|
|
55
|
+
onFilter?: Props['onFilter'];
|
|
56
|
+
fieldOptions?: Props['fieldOptions'];
|
|
57
|
+
clearable?: Props['clearable'];
|
|
58
|
+
useChoice?: Props['useChoice'];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const props = withDefaults(defineProps<P>(), {
|
|
62
|
+
name: () => '',
|
|
63
|
+
auto: undefined,
|
|
64
|
+
col: undefined,
|
|
65
|
+
xs: undefined,
|
|
66
|
+
sm: undefined,
|
|
67
|
+
md: undefined,
|
|
68
|
+
lg: undefined,
|
|
69
|
+
xl: undefined,
|
|
70
|
+
label: undefined,
|
|
71
|
+
caption: undefined,
|
|
72
|
+
hint: undefined,
|
|
73
|
+
placeholder: undefined,
|
|
74
|
+
help: undefined,
|
|
75
|
+
stackLabel: undefined,
|
|
76
|
+
required: undefined,
|
|
77
|
+
rules: undefined,
|
|
78
|
+
viewMode: () => !1,
|
|
79
|
+
viewModeValue: undefined,
|
|
80
|
+
autocomplete: undefined,
|
|
81
|
+
topLabel: undefined,
|
|
82
|
+
behavior: undefined,
|
|
83
|
+
emitValue: () => !0,
|
|
84
|
+
useInput: () => !0,
|
|
85
|
+
mapOptions: () => !0,
|
|
86
|
+
loading: undefined,
|
|
87
|
+
multiple: undefined,
|
|
88
|
+
options: () => ([]),
|
|
89
|
+
optionLabel: () => 'label',
|
|
90
|
+
optionValue: () => 'value',
|
|
91
|
+
noFilter: undefined,
|
|
92
|
+
hideEmptyList: undefined,
|
|
93
|
+
readonly: undefined,
|
|
94
|
+
useChips: undefined,
|
|
95
|
+
searchLength: () => 1,
|
|
96
|
+
axiosMode: undefined,
|
|
97
|
+
hideSelected: undefined,
|
|
98
|
+
onFilter: undefined,
|
|
99
|
+
fieldOptions: undefined,
|
|
100
|
+
clearable: undefined,
|
|
101
|
+
useChoice: undefined
|
|
102
|
+
})
|
|
103
|
+
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
104
|
+
|
|
105
|
+
type Emits = {
|
|
106
|
+
(e: 'model', value: { value: any; model: object | null }): void;
|
|
107
|
+
}
|
|
108
|
+
const emit = defineEmits<Emits>()
|
|
109
|
+
|
|
110
|
+
const { __ } = useMyth()
|
|
111
|
+
const { props: pluginOptions, themeInput } = myth
|
|
112
|
+
const helper = useBindInput<P & Props>(() => props, 'select', () => ({ choose: !0 }))
|
|
113
|
+
const { hasTopLabel, getLabel, getPlaceholder, getAutocompleteAttribute, inputRules, getProp } = helper
|
|
114
|
+
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
115
|
+
syncVModel: !0,
|
|
116
|
+
label: getLabel,
|
|
117
|
+
...toValue<any>(props.fieldOptions)
|
|
118
|
+
})
|
|
119
|
+
const { value, errorMessage, handleChange, handleBlur } = inputScope
|
|
120
|
+
const minLength = computed(() => parseInt(props.searchLength?.toString()))
|
|
121
|
+
const search = defineModel<string>('search', { required: !1, default: '' })
|
|
122
|
+
const getOptions = computed(() => {
|
|
123
|
+
if (!props.axiosMode && !props.noFilter && search.value?.length >= minLength.value) {
|
|
124
|
+
return props.options.filter((v: any) => {
|
|
125
|
+
if (typeof v !== 'object') {
|
|
126
|
+
return v.toString().toLowerCase().indexOf(search.value) > -1
|
|
127
|
+
}
|
|
128
|
+
let labelKey = 'label'
|
|
129
|
+
if (props.optionLabel) {
|
|
130
|
+
labelKey = typeof props.optionLabel === 'function' ? props.optionLabel(v) : props.optionLabel
|
|
131
|
+
}
|
|
132
|
+
let valueKey = 'value'
|
|
133
|
+
if (props.optionValue) {
|
|
134
|
+
valueKey = typeof props.optionValue === 'function' ? props.optionValue(v) : props.optionValue
|
|
135
|
+
}
|
|
136
|
+
return v[labelKey]?.toString().toLowerCase().indexOf(search.value) > -1 || v[valueKey]?.toString().toLowerCase().indexOf(search.value) > -1
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
return props.options
|
|
140
|
+
})
|
|
141
|
+
const filterFn: Props['onFilter'] = (val: string, update, abortFn) => {
|
|
142
|
+
if (props.onFilter) {
|
|
143
|
+
return props.onFilter(val, update, abortFn)
|
|
144
|
+
}
|
|
145
|
+
update(() => void 0)
|
|
146
|
+
}
|
|
147
|
+
const onDoneOptions = () => {
|
|
148
|
+
const e = input.value as QSelect
|
|
149
|
+
e?.updateInputValue('', !0)
|
|
150
|
+
e?.hidePopup()
|
|
151
|
+
}
|
|
152
|
+
const listeners = {
|
|
153
|
+
blur: (v: any) => handleBlur(v, !0),
|
|
154
|
+
'update:modelValue': (v: Props['modelValue']) => {
|
|
155
|
+
handleChange(v, !!errorMessage.value)
|
|
156
|
+
if (!props.emitValue) {
|
|
157
|
+
emit('model', { value: v, model: v })
|
|
158
|
+
} else {
|
|
159
|
+
const k = typeof props.optionValue === 'function' ? props.optionValue(v) : props.optionValue
|
|
160
|
+
const model = props.options.find(e => e[k] === v)
|
|
161
|
+
emit('model', { value: v, model: model ?? null })
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
inputValue: (v: string) => (search.value = v?.toString() || ''),
|
|
165
|
+
filter: filterFn
|
|
166
|
+
}
|
|
167
|
+
const input = useTemplateRef<InstanceType<typeof QSelect> | InstanceType<typeof QField>>('input')
|
|
168
|
+
const scopes = reactive(inputScope)
|
|
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
|
+
})
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<template>
|
|
180
|
+
<MCol
|
|
181
|
+
:auto="auto"
|
|
182
|
+
:class="[$attrs.class,{'m--input__required':inputRules?.required!==undefined,'m--input__is-top-label':hasTopLabel,'m--input__error':!!errorMessage,'m--input__view':viewMode}]"
|
|
183
|
+
:col="col"
|
|
184
|
+
:lg="lg"
|
|
185
|
+
:md="md"
|
|
186
|
+
:name="name"
|
|
187
|
+
:sm="sm"
|
|
188
|
+
:xs="xs"
|
|
189
|
+
>
|
|
190
|
+
<slot
|
|
191
|
+
name="top-input"
|
|
192
|
+
v-bind="scopes"
|
|
193
|
+
/>
|
|
194
|
+
<slot name="top-label">
|
|
195
|
+
<MInputLabel
|
|
196
|
+
v-if="hasTopLabel"
|
|
197
|
+
:field="scopes"
|
|
198
|
+
>
|
|
199
|
+
<MHelpRow
|
|
200
|
+
:text="help"
|
|
201
|
+
tooltip
|
|
202
|
+
/>
|
|
203
|
+
</MInputLabel>
|
|
204
|
+
</slot>
|
|
205
|
+
<slot name="caption">
|
|
206
|
+
<div
|
|
207
|
+
v-if="!!caption"
|
|
208
|
+
class="m--input__caption"
|
|
209
|
+
>
|
|
210
|
+
{{ __(caption) }}
|
|
211
|
+
</div>
|
|
212
|
+
</slot>
|
|
213
|
+
<component
|
|
214
|
+
:is="viewMode ? QField : QSelect"
|
|
215
|
+
ref="input"
|
|
216
|
+
:behavior="$q.platform.is.ios === !0 ? 'dialog' : behavior"
|
|
217
|
+
:emit-value="emitValue"
|
|
218
|
+
:error="!!errorMessage"
|
|
219
|
+
:error-message="errorMessage"
|
|
220
|
+
:hide-selected="hideSelected !== undefined ? hideSelected : search.length > 0"
|
|
221
|
+
:hint="__(hint)"
|
|
222
|
+
:label="viewMode && hasTopLabel ? undefined : (loading ? undefined : getPlaceholder)"
|
|
223
|
+
:model-value="value"
|
|
224
|
+
:option-label="optionLabel"
|
|
225
|
+
:option-value="optionValue"
|
|
226
|
+
:options="getOptions"
|
|
227
|
+
:readonly="readonly"
|
|
228
|
+
v-bind="{
|
|
229
|
+
...pluginOptions.select as any,
|
|
230
|
+
...( viewMode ? pluginOptions.field : {} ),
|
|
231
|
+
...$attrs,
|
|
232
|
+
...(viewMode ? { stackLabel: !0 } : { stackLabel: hasTopLabel ? !1 : (
|
|
233
|
+
themeInput.dense !== undefined ? themeInput.dense : getProp('dense')
|
|
234
|
+
) } ),
|
|
235
|
+
useChips: getProp('useChips') === !0 && !multiple ? !1 : getProp('useChips'),
|
|
236
|
+
multiple,
|
|
237
|
+
mapOptions,
|
|
238
|
+
loading,
|
|
239
|
+
useInput,
|
|
240
|
+
autocomplete:getAutocompleteAttribute,
|
|
241
|
+
clearable: viewMode ? !1 : clearable
|
|
242
|
+
}"
|
|
243
|
+
v-on="listeners"
|
|
244
|
+
>
|
|
245
|
+
<template
|
|
246
|
+
v-if="!hideEmptyList"
|
|
247
|
+
#no-option
|
|
248
|
+
>
|
|
249
|
+
<slot name="no-option">
|
|
250
|
+
<q-item :dense="themeInput.dense !== undefined ? themeInput.dense : getProp('optionsDense')">
|
|
251
|
+
<q-item-section side>
|
|
252
|
+
<template v-if="loading">
|
|
253
|
+
<q-spinner color="primary" />
|
|
254
|
+
</template>
|
|
255
|
+
<template v-else-if="search?.length > 0">
|
|
256
|
+
<q-icon
|
|
257
|
+
color="warning"
|
|
258
|
+
name="ion-ios-warning"
|
|
259
|
+
/>
|
|
260
|
+
</template>
|
|
261
|
+
<template v-else-if="!search?.length">
|
|
262
|
+
<q-icon name="ion-ios-search" />
|
|
263
|
+
</template>
|
|
264
|
+
<template v-else>
|
|
265
|
+
<q-icon name="ion-ios-information-circle-outline" />
|
|
266
|
+
</template>
|
|
267
|
+
</q-item-section>
|
|
268
|
+
<q-item-section>
|
|
269
|
+
<template v-if="loading">
|
|
270
|
+
<q-skeleton
|
|
271
|
+
type="text"
|
|
272
|
+
width="70%"
|
|
273
|
+
/>
|
|
274
|
+
<q-skeleton
|
|
275
|
+
type="text"
|
|
276
|
+
width="50%"
|
|
277
|
+
/>
|
|
278
|
+
</template>
|
|
279
|
+
<template v-else-if="!search?.length && useInput">
|
|
280
|
+
{{ __('myth.select.typeToSearch') }}
|
|
281
|
+
</template>
|
|
282
|
+
<template v-else-if="search?.length > 0">
|
|
283
|
+
{{ __('myth.select.noResult') }}
|
|
284
|
+
</template>
|
|
285
|
+
<template v-else>
|
|
286
|
+
{{ __('myth.select.noData') }}
|
|
287
|
+
</template>
|
|
288
|
+
</q-item-section>
|
|
289
|
+
</q-item>
|
|
290
|
+
</slot>
|
|
291
|
+
</template>
|
|
292
|
+
<template
|
|
293
|
+
v-if="loading"
|
|
294
|
+
#selected
|
|
295
|
+
>
|
|
296
|
+
<q-skeleton width="60%" />
|
|
297
|
+
</template>
|
|
298
|
+
<template
|
|
299
|
+
v-if="multiple"
|
|
300
|
+
#before-options
|
|
301
|
+
>
|
|
302
|
+
<MContainer>
|
|
303
|
+
<MRow class="items-center">
|
|
304
|
+
<MBtn
|
|
305
|
+
:label="__('done')"
|
|
306
|
+
flat
|
|
307
|
+
@click="onDoneOptions()"
|
|
308
|
+
/>
|
|
309
|
+
</MRow>
|
|
310
|
+
</MContainer>
|
|
311
|
+
</template>
|
|
312
|
+
|
|
313
|
+
<template
|
|
314
|
+
v-for="(_,slot) in $slots as Readonly<QSelectSlots>"
|
|
315
|
+
:key="slot"
|
|
316
|
+
#[slot]="inputSlot"
|
|
317
|
+
>
|
|
318
|
+
<slot
|
|
319
|
+
:name="slot"
|
|
320
|
+
v-bind="inputSlot || {}"
|
|
321
|
+
/>
|
|
322
|
+
</template>
|
|
323
|
+
|
|
324
|
+
<template
|
|
325
|
+
v-if="viewMode"
|
|
326
|
+
#control
|
|
327
|
+
>
|
|
328
|
+
<slot name="control">
|
|
329
|
+
<MInputFieldControl>
|
|
330
|
+
{{ viewModeValue ?? value }}
|
|
331
|
+
</MInputFieldControl>
|
|
332
|
+
</slot>
|
|
333
|
+
</template>
|
|
334
|
+
</component>
|
|
335
|
+
<slot
|
|
336
|
+
name="help"
|
|
337
|
+
v-bind="scopes"
|
|
338
|
+
>
|
|
339
|
+
<MHelpRow
|
|
340
|
+
v-if="!hasTopLabel"
|
|
341
|
+
:text="help"
|
|
342
|
+
/>
|
|
343
|
+
</slot>
|
|
344
|
+
<slot
|
|
345
|
+
name="bottom-input"
|
|
346
|
+
v-bind="scopes"
|
|
347
|
+
/>
|
|
348
|
+
</MCol>
|
|
349
|
+
</template>
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import type { MInputSlots, MTimeProps as Props } from '../../types'
|
|
11
|
+
import { useTemplateRef } from 'vue'
|
|
12
|
+
import MPicker from './MPicker.vue'
|
|
13
|
+
|
|
14
|
+
type P = {
|
|
15
|
+
name: Props['name'];
|
|
16
|
+
rules?: Props['rules'];
|
|
17
|
+
}
|
|
18
|
+
withDefaults(defineProps<P>(), {
|
|
19
|
+
name: () => '',
|
|
20
|
+
rules: undefined
|
|
21
|
+
})
|
|
22
|
+
const modelValue = defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
23
|
+
const input = useTemplateRef<InstanceType<typeof MPicker>>('input')
|
|
24
|
+
defineExpose<{ input: typeof input }>({ input })
|
|
25
|
+
defineOptions({
|
|
26
|
+
name: 'MTime',
|
|
27
|
+
inheritAttrs: !1
|
|
28
|
+
})
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<MPicker
|
|
33
|
+
ref="input"
|
|
34
|
+
v-model="modelValue"
|
|
35
|
+
v-bind="{...$attrs,type:'time',name}"
|
|
36
|
+
>
|
|
37
|
+
<template
|
|
38
|
+
v-for="(_,slot) in $slots as Readonly<MInputSlots>"
|
|
39
|
+
:key="slot"
|
|
40
|
+
#[slot]
|
|
41
|
+
>
|
|
42
|
+
<slot :name="slot" />
|
|
43
|
+
</template>
|
|
44
|
+
</MPicker>
|
|
45
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
*/
|
|
8
|
+
|
|
9
|
+
import MAvatarViewer from './MAvatarViewer.vue'
|
|
10
|
+
import MBtn from './MBtn.vue'
|
|
11
|
+
import MCheckbox from './MCheckbox.vue'
|
|
12
|
+
import MColor from './MColor.vue'
|
|
13
|
+
import MDate from './MDate.vue'
|
|
14
|
+
import MEditor from './MEditor.vue'
|
|
15
|
+
import MEmail from './MEmail.vue'
|
|
16
|
+
import MField from './MField.vue'
|
|
17
|
+
import MFile from './MFile.vue'
|
|
18
|
+
import MForm from './MForm.vue'
|
|
19
|
+
import MHidden from './MHidden.vue'
|
|
20
|
+
import MHiddenInput from './MHiddenInput.vue'
|
|
21
|
+
import MInput from './MInput.vue'
|
|
22
|
+
import MInputFieldControl from './MInputFieldControl.vue'
|
|
23
|
+
import MInputLabel from './MInputLabel.vue'
|
|
24
|
+
import MMobile from './MMobile.vue'
|
|
25
|
+
import MPicker from './MPicker.vue'
|
|
26
|
+
import MRadio from './MRadio.vue'
|
|
27
|
+
import MSelect from './MSelect.vue'
|
|
28
|
+
import MTime from './MTime.vue'
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
MAvatarViewer,
|
|
32
|
+
MBtn,
|
|
33
|
+
MCheckbox,
|
|
34
|
+
MColor,
|
|
35
|
+
MDate,
|
|
36
|
+
MEditor,
|
|
37
|
+
MField,
|
|
38
|
+
MFile,
|
|
39
|
+
MForm,
|
|
40
|
+
MHidden,
|
|
41
|
+
MHiddenInput,
|
|
42
|
+
MEmail,
|
|
43
|
+
MInput,
|
|
44
|
+
MInputFieldControl,
|
|
45
|
+
MInputLabel,
|
|
46
|
+
MMobile,
|
|
47
|
+
MPicker,
|
|
48
|
+
MRadio,
|
|
49
|
+
MSelect,
|
|
50
|
+
MTime
|
|
51
|
+
}
|
|
@@ -1,22 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
-->
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
<script
|
|
10
|
+
lang="ts"
|
|
11
|
+
setup
|
|
12
|
+
>
|
|
13
|
+
import type { MBlockProps as Props } from '../../types'
|
|
14
|
+
import { computed } from 'vue'
|
|
15
|
+
import { myth } from '../../utils'
|
|
12
16
|
|
|
13
17
|
const props = withDefaults(defineProps<Props>(), {
|
|
14
|
-
size:
|
|
15
|
-
rounded:
|
|
16
|
-
shadow:
|
|
18
|
+
size: undefined,
|
|
19
|
+
rounded: undefined,
|
|
20
|
+
shadow: undefined
|
|
21
|
+
})
|
|
22
|
+
const getSize = computed(() => {
|
|
23
|
+
if (props.size !== undefined) {
|
|
24
|
+
return props.size
|
|
25
|
+
}
|
|
26
|
+
return myth.props.value.block?.size || myth.size.value
|
|
17
27
|
})
|
|
18
|
-
const
|
|
19
|
-
|
|
28
|
+
const getRounded = computed(() => {
|
|
29
|
+
if (props.rounded !== undefined) {
|
|
30
|
+
return props.rounded
|
|
31
|
+
}
|
|
32
|
+
return myth.props.value.block?.rounded || myth.rounded.value
|
|
33
|
+
})
|
|
34
|
+
const getShadow = computed(() => {
|
|
35
|
+
if (props.shadow !== undefined) {
|
|
36
|
+
return props.shadow
|
|
37
|
+
}
|
|
38
|
+
return myth.props.value.block?.shadow || myth.shadow.value
|
|
39
|
+
})
|
|
40
|
+
|
|
20
41
|
defineOptions({
|
|
21
42
|
name: 'MBlock',
|
|
22
43
|
inheritAttrs: !1
|
|
@@ -27,12 +48,13 @@ defineOptions({
|
|
|
27
48
|
<div
|
|
28
49
|
:class="{
|
|
29
50
|
'm---block' : !0,
|
|
30
|
-
[`q-pa-${
|
|
31
|
-
'rounded-borders' :
|
|
32
|
-
[`shadow-${
|
|
51
|
+
[`q-pa-${getSize}`] : getSize && getSize !== 'none',
|
|
52
|
+
'rounded-borders' : getRounded === !0,
|
|
53
|
+
[`shadow-${getShadow||''}`] : getShadow && getShadow !== 'none'
|
|
33
54
|
}"
|
|
34
55
|
v-bind="$attrs"
|
|
35
56
|
>
|
|
57
|
+
{{ getRounded }}
|
|
36
58
|
<slot />
|
|
37
59
|
</div>
|
|
38
60
|
</template>
|
|
@@ -1,21 +1,18 @@
|
|
|
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
|
+
-->
|
|
8
|
+
|
|
1
9
|
<script
|
|
2
10
|
lang="ts"
|
|
3
11
|
setup
|
|
4
12
|
>
|
|
5
13
|
import { computed } from 'vue'
|
|
6
14
|
import { uniq } from 'lodash'
|
|
7
|
-
import type { MColProps } from '../../types'
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
name?: MColProps['name']
|
|
11
|
-
auto?: MColProps['auto']
|
|
12
|
-
col?: MColProps['col']
|
|
13
|
-
xs?: MColProps['xs']
|
|
14
|
-
sm?: MColProps['sm']
|
|
15
|
-
md?: MColProps['md']
|
|
16
|
-
lg?: MColProps['lg']
|
|
17
|
-
xl?: MColProps['xl']
|
|
18
|
-
}
|
|
15
|
+
import type { MColProps as Props } from '../../types'
|
|
19
16
|
|
|
20
17
|
const props = defineProps<Props>()
|
|
21
18
|
const classes = computed(() => {
|
|
@@ -45,8 +42,8 @@ const classes = computed(() => {
|
|
|
45
42
|
list.push('col')
|
|
46
43
|
}
|
|
47
44
|
return uniq(list)
|
|
48
|
-
// return list
|
|
49
45
|
})
|
|
46
|
+
|
|
50
47
|
defineOptions({
|
|
51
48
|
name: 'MCol',
|
|
52
49
|
inheritAttrs: !1
|
|
@@ -56,8 +53,7 @@ defineOptions({
|
|
|
56
53
|
<template>
|
|
57
54
|
<div
|
|
58
55
|
:class="classes"
|
|
59
|
-
:data-input-name
|
|
60
|
-
v-bind="$attrs"
|
|
56
|
+
v-bind="{...$attrs,':data-input-name': name??undefined}"
|
|
61
57
|
>
|
|
62
58
|
<slot />
|
|
63
59
|
</div>
|
|
@@ -1,3 +1,11 @@
|
|
|
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
|
+
-->
|
|
8
|
+
|
|
1
9
|
<script lang="ts" setup>
|
|
2
10
|
defineOptions({
|
|
3
11
|
name: 'MColumn',
|
|
@@ -6,24 +6,33 @@
|
|
|
6
6
|
- Github: https://github.com/mythpe
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
|
-
<script
|
|
9
|
+
<script
|
|
10
|
+
lang="ts"
|
|
11
|
+
setup
|
|
12
|
+
>
|
|
10
13
|
import type { MContainerProps } from '../../types'
|
|
11
|
-
import
|
|
14
|
+
import { myth } from '../../utils'
|
|
12
15
|
import { computed } from 'vue'
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
size
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const props = defineProps<Props>()
|
|
21
|
-
const styles = computed(() => MythOptions.options.value?.style ?? {})
|
|
17
|
+
const props = withDefaults(defineProps<MContainerProps>(), {
|
|
18
|
+
size: undefined,
|
|
19
|
+
dense: !1,
|
|
20
|
+
fluid: undefined
|
|
21
|
+
})
|
|
22
22
|
const sizeProp = computed(() => {
|
|
23
23
|
if (props.size !== undefined) {
|
|
24
24
|
return props.size
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
if (myth.props.value.container?.size !== undefined) {
|
|
27
|
+
return myth.props.value.container?.size
|
|
28
|
+
}
|
|
29
|
+
return myth.size.value
|
|
30
|
+
})
|
|
31
|
+
const fluidProp = computed(() => {
|
|
32
|
+
if (props.fluid !== undefined) {
|
|
33
|
+
return props.fluid
|
|
34
|
+
}
|
|
35
|
+
return myth.fluid.value === !0
|
|
27
36
|
})
|
|
28
37
|
defineOptions({
|
|
29
38
|
name: 'MContainer',
|
|
@@ -35,8 +44,8 @@ defineOptions({
|
|
|
35
44
|
<div
|
|
36
45
|
:class="{
|
|
37
46
|
'm--container' : !0,
|
|
38
|
-
'm--container__fluid' :
|
|
39
|
-
'm--container__dense' : dense
|
|
47
|
+
'm--container__fluid' : fluidProp === !0,
|
|
48
|
+
'm--container__dense' : dense === !0,
|
|
40
49
|
[`q-pa-${sizeProp||''}`]: sizeProp && sizeProp !== 'none'
|
|
41
50
|
}"
|
|
42
51
|
v-bind="$attrs"
|
|
@@ -10,17 +10,11 @@
|
|
|
10
10
|
lang="ts"
|
|
11
11
|
setup
|
|
12
12
|
>
|
|
13
|
-
import {
|
|
13
|
+
import { useMyth } from '../../composable'
|
|
14
|
+
import type { MHelpRowProps } from '../../types'
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
icon?: string | undefined;
|
|
18
|
-
tooltip?: boolean | undefined;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
defineProps<Props>()
|
|
22
|
-
const { t, te } = useI18n({ useScope: 'global' })
|
|
23
|
-
const __ = (s: any) => !s ? '' : te(`attributes.${s}`) ? t(`attributes.${s}`) : te(s) ? t(s) : s
|
|
16
|
+
defineProps<MHelpRowProps>()
|
|
17
|
+
const { __ } = useMyth()
|
|
24
18
|
defineOptions({
|
|
25
19
|
name: 'MHelpRow',
|
|
26
20
|
inheritAttrs: !1
|
|
@@ -28,11 +22,14 @@ defineOptions({
|
|
|
28
22
|
</script>
|
|
29
23
|
|
|
30
24
|
<template>
|
|
31
|
-
<div
|
|
25
|
+
<div
|
|
26
|
+
v-if="text || tooltip"
|
|
27
|
+
class="row"
|
|
28
|
+
>
|
|
32
29
|
<div class="col-auto">
|
|
33
30
|
<q-icon
|
|
31
|
+
:class="{'cursor-pointer': !!tooltip}"
|
|
34
32
|
:left="!!text && !tooltip"
|
|
35
|
-
class="cursor-pointer"
|
|
36
33
|
name="ion-ios-information-circle-outline"
|
|
37
34
|
size="19px"
|
|
38
35
|
>
|