@mythpe/quasar-ui-qui 0.0.25 → 0.0.26-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/index.d.ts +17 -0
  2. package/package.json +14 -8
  3. package/src/boot/register.ts +14 -0
  4. package/src/components/form/MAvatarViewer.vue +324 -0
  5. package/src/components/form/MAxios.vue +141 -0
  6. package/src/components/form/MBtn.vue +271 -93
  7. package/src/components/form/MCheckbox.vue +126 -0
  8. package/src/components/form/MColor.vue +122 -0
  9. package/src/components/form/MDate.vue +47 -0
  10. package/src/components/form/MEditor.vue +285 -0
  11. package/src/components/form/MEmail.vue +40 -0
  12. package/src/components/form/MField.vue +145 -0
  13. package/src/components/form/MFile.vue +212 -0
  14. package/src/components/form/MForm.vue +86 -0
  15. package/src/components/form/MHidden.vue +86 -0
  16. package/src/components/form/MHiddenInput.vue +55 -0
  17. package/src/components/form/MInput.vue +178 -0
  18. package/src/components/form/MInputFieldControl.vue +27 -0
  19. package/src/components/form/MInputLabel.vue +35 -0
  20. package/src/components/form/MMobile.vue +40 -0
  21. package/src/components/form/MPassword.vue +73 -0
  22. package/src/components/form/MPicker.vue +313 -0
  23. package/src/components/form/MRadio.vue +178 -0
  24. package/src/components/form/MSelect.vue +349 -0
  25. package/src/components/form/MTime.vue +45 -0
  26. package/src/components/form/index.ts +55 -0
  27. package/src/components/grid/MBlock.vue +39 -18
  28. package/src/components/grid/MCol.vue +11 -15
  29. package/src/components/grid/MColumn.vue +8 -0
  30. package/src/components/grid/MContainer.vue +22 -13
  31. package/src/components/grid/MHelpRow.vue +9 -12
  32. package/src/components/grid/MRow.vue +31 -10
  33. package/src/components/grid/index.ts +16 -0
  34. package/src/components/index.ts +12 -0
  35. package/src/components/transition/MFadeTransition.vue +27 -0
  36. package/src/components/transition/MFadeXTransition.vue +26 -0
  37. package/src/components/transition/MTransition.vue +41 -0
  38. package/src/components/transition/index.ts +13 -0
  39. package/src/components/typography/MTypingString.vue +8 -0
  40. package/src/components/typography/index.ts +11 -0
  41. package/src/composable/index.ts +12 -0
  42. package/src/composable/useBindInput.ts +209 -0
  43. package/src/composable/useError.ts +11 -0
  44. package/src/composable/useMyth.ts +302 -0
  45. package/src/composable/useValue.ts +12 -0
  46. package/src/index.common.js +19 -1
  47. package/src/index.esm.js +18 -3
  48. package/src/index.js +19 -0
  49. package/src/index.sass +8 -26
  50. package/src/index.ts +18 -4
  51. package/src/index.umd.js +17 -2
  52. package/src/style/m-container.sass +13 -0
  53. package/src/style/main.sass +42 -0
  54. package/src/types/api-helpers.d.ts +123 -0
  55. package/src/types/components.d.ts +769 -27
  56. package/src/types/dt.d.ts +144 -0
  57. package/src/types/index.d.ts +155 -1
  58. package/src/types/lodash.d.ts +26 -0
  59. package/src/types/quasar-helpers.d.ts +7 -0
  60. package/src/types/theme.d.ts +12 -0
  61. package/src/utils/Helpers.ts +293 -0
  62. package/src/utils/Str.ts +211 -0
  63. package/src/utils/index.ts +13 -0
  64. package/src/utils/myth.ts +95 -0
  65. package/src/utils/vee-rules.ts +32 -0
  66. package/src/utils/vue-plugin.ts +129 -0
  67. package/tsconfig.json +9 -13
  68. package/src/myth.ts +0 -30
  69. package/src/types/myth.ts +0 -42
  70. package/src/vue-plugin.ts +0 -41
  71. package/types.d.ts +0 -1
@@ -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,55 @@
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 MAxios from './MAxios.vue'
10
+ import MAvatarViewer from './MAvatarViewer.vue'
11
+ import MBtn from './MBtn.vue'
12
+ import MCheckbox from './MCheckbox.vue'
13
+ import MColor from './MColor.vue'
14
+ import MDate from './MDate.vue'
15
+ import MEditor from './MEditor.vue'
16
+ import MEmail from './MEmail.vue'
17
+ import MField from './MField.vue'
18
+ import MFile from './MFile.vue'
19
+ import MForm from './MForm.vue'
20
+ import MHidden from './MHidden.vue'
21
+ import MHiddenInput from './MHiddenInput.vue'
22
+ import MInput from './MInput.vue'
23
+ import MInputFieldControl from './MInputFieldControl.vue'
24
+ import MInputLabel from './MInputLabel.vue'
25
+ import MMobile from './MMobile.vue'
26
+ import MPassword from './MPassword.vue'
27
+ import MPicker from './MPicker.vue'
28
+ import MRadio from './MRadio.vue'
29
+ import MSelect from './MSelect.vue'
30
+ import MTime from './MTime.vue'
31
+
32
+ export {
33
+ MAxios,
34
+ MAvatarViewer,
35
+ MBtn,
36
+ MCheckbox,
37
+ MColor,
38
+ MDate,
39
+ MEditor,
40
+ MField,
41
+ MFile,
42
+ MForm,
43
+ MHidden,
44
+ MHiddenInput,
45
+ MEmail,
46
+ MInput,
47
+ MInputFieldControl,
48
+ MInputLabel,
49
+ MMobile,
50
+ MPassword,
51
+ MPicker,
52
+ MRadio,
53
+ MSelect,
54
+ MTime
55
+ }
@@ -1,22 +1,43 @@
1
- <script lang="ts" setup>
2
- import type { MBlockProps } from '../../types'
3
- import { computed } from 'vue'
4
- import MythOptions from '../../myth'
5
- import { extend } from 'quasar'
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
- interface Props {
8
- size?: MBlockProps['size'];
9
- rounded?: MBlockProps['rounded'];
10
- shadow?: MBlockProps['shadow'];
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: 'md',
15
- rounded: !1,
16
- shadow: 'none'
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 block = computed(() => MythOptions.options.value.block ?? {})
19
- const options = computed<Props>(() => extend(!0, { ...props }, block.value))
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,9 +48,9 @@ defineOptions({
27
48
  <div
28
49
  :class="{
29
50
  'm---block' : !0,
30
- [`q-pa-${options.size}`] : options.size && options.size !== 'none',
31
- 'rounded-borders' : options.rounded === !0,
32
- [`shadow-${options.shadow}`] : options.shadow && options.shadow !== 'none'
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
  >
@@ -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="name??undefined"
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 lang="ts" setup>
9
+ <script
10
+ lang="ts"
11
+ setup
12
+ >
10
13
  import type { MContainerProps } from '../../types'
11
- import MythOptions from '../../myth'
14
+ import { myth } from '../../utils'
12
15
  import { computed } from 'vue'
13
16
 
14
- interface Props {
15
- size?: MContainerProps['size'];
16
- fluid?: MContainerProps['fluid'];
17
- dense?: MContainerProps['dense'];
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
- return styles.value.gutters
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' : (fluid !== !1 && fluid !== undefined) || (styles.fluid === !0 && (fluid !== !1 && fluid !== undefined)),
39
- 'm--container__dense' : dense !== !1 && dense !== undefined,
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 { useI18n } from 'vue-i18n'
13
+ import { useMyth } from '../../composable'
14
+ import type { MHelpRowProps } from '../../types'
14
15
 
15
- interface Props {
16
- text?: string | undefined;
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 class="row">
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
  >