@mythpe/quasar-ui-qui 0.0.21 → 0.0.22-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 ADDED
@@ -0,0 +1,13 @@
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
+ export * from './src/types'
10
+
11
+ export * from './src/components'
12
+ export * from './src/composable'
13
+ export * from './src/utils'
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.0.21",
3
+ "version": "0.0.22-dev",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
- "author": "MyTh Ahmed Faiz <mythpe@gmail.com>",
6
- "email": "mythpe@gmail.com",
7
- "mobile": "+966590470092",
5
+ "author": {
6
+ "name": "MyTh Ahmed Faiz",
7
+ "mobile": "+966590470092",
8
+ "email": "mythpe@gmail.com",
9
+ "url": "https://www.4myth.com"
10
+ },
8
11
  "license": "MIT",
12
+ "type": "module",
9
13
  "module": "src/index.esm.js",
10
14
  "main": "src/index.common.js",
11
- "type": "module",
12
15
  "scripts": {
13
16
  "dev": "cd ../dev && yarn dev && cd ..",
14
17
  "dev:umd": "yarn build && node build/script.open-umd.js",
@@ -21,15 +24,14 @@
21
24
  "build:css": "node build/script.css.js"
22
25
  },
23
26
  "dependencies": {
24
- "lodash": "^4.17.21",
25
27
  "typed.js": "^2.1.0",
26
28
  "vee-validate": "^4.14.0",
27
29
  "@vee-validate/i18n": "^4.14.0",
28
30
  "@vee-validate/rules": "^4.14.0",
29
- "vue-i18n": "^10.0.0"
31
+ "vue-i18n": "^10.0.0",
32
+ "lodash": "^4.17.0"
30
33
  },
31
34
  "devDependencies": {
32
- "lodash": "^4.17.21",
33
35
  "@quasar/app-webpack": "^3.13.0",
34
36
  "@quasar/extras": "^1.16.4",
35
37
  "@rollup/plugin-buble": "^0.21.3",
@@ -0,0 +1,14 @@
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 { boot } from 'quasar/wrappers'
10
+ import Plugin from '../utils/vue-plugin'
11
+
12
+ export default boot(({ app }) => {
13
+ app.use(Plugin)
14
+ })
@@ -1,9 +1,20 @@
1
- <script lang="ts" setup>
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
10
+ lang="ts"
11
+ setup
12
+ >
2
13
  import type { MBtnProps } from '../../types'
3
14
  import { useI18n } from 'vue-i18n'
4
15
  import { computed } from 'vue'
5
16
  import { extend } from 'quasar'
6
- import { myth } from '../../myth'
17
+ import { myth } from '../../utils'
7
18
 
8
19
  const props = defineProps<MBtnProps>()
9
20
  const options = computed(() => myth.options.value.btn ?? {})
@@ -0,0 +1,181 @@
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
10
+ lang="ts"
11
+ setup
12
+ >
13
+
14
+ import { useField } from 'vee-validate'
15
+ import { computed, reactive, ref, toValue } from 'vue'
16
+ import type { MInputProps as Props } from '../../types'
17
+ import { QField, QInput, type QInputSlots } from 'quasar'
18
+ import { useInputHelper, useMyth } from '../../composable'
19
+ import { myth } from '../../utils'
20
+
21
+ type P = {
22
+ name: Props['name'];
23
+ auto?: Props['auto'];
24
+ col?: Props['col'];
25
+ xs?: Props['xs'];
26
+ sm?: Props['sm'];
27
+ md?: Props['md'];
28
+ lg?: Props['lg'];
29
+ xl?: Props['xl'];
30
+ label?: Props['label'];
31
+ caption?: Props['caption'];
32
+ hint?: Props['hint'];
33
+ placeholder?: Props['placeholder'];
34
+ help?: Props['help'];
35
+ required?: Props['required'];
36
+ rules?: Props['rules'];
37
+ viewMode?: Props['viewMode'];
38
+ viewModeValue?: Props['viewModeValue'];
39
+ autocomplete?: Props['autocomplete'];
40
+ topLabel?: Props['topLabel'];
41
+ fieldOptions?: Props['fieldOptions'];
42
+ clearable?: Props['clearable'];
43
+ }
44
+
45
+ // const props = withDefaults(defineProps<P>(), {
46
+ // name: () => '',
47
+ // auto: undefined,
48
+ // col: undefined,
49
+ // xs: undefined,
50
+ // sm: undefined,
51
+ // md: undefined,
52
+ // lg: undefined,
53
+ // xl: undefined,
54
+ // label: undefined,
55
+ // caption: undefined,
56
+ // hint: undefined,
57
+ // placeholder: undefined,
58
+ // help: undefined,
59
+ // required: undefined,
60
+ // rules: undefined,
61
+ // viewMode: () => !1,
62
+ // viewModeValue: undefined,
63
+ // autocomplete: undefined,
64
+ // topLabel: undefined,
65
+ // fieldOptions: undefined,
66
+ // clearable: undefined
67
+ // })
68
+ const props = defineProps<Props>()
69
+ defineModel<Props['modelValue']>({ required: !1, default: undefined })
70
+ const { __ } = useMyth()
71
+ const options = computed(() => myth.options.value)
72
+ const helper = useInputHelper<P>(() => props, 'input')
73
+ const { hasTopLabel, getLabel, getPlaceholder, getAutocompleteAttribute, getRules } = helper
74
+ const inputScope = useField<Props['modelValue']>(() => props.name, getRules, {
75
+ syncVModel: !0,
76
+ label: getLabel,
77
+ ...toValue<any>(props.fieldOptions)
78
+ })
79
+ const { value, errorMessage, handleChange, handleBlur } = inputScope
80
+ const listeners = {
81
+ blur: (v: any) => handleBlur(v, !0),
82
+ 'update:modelValue': (v: Props['modelValue']) => handleChange(v, !!errorMessage.value)
83
+ }
84
+ const input = ref<InstanceType<typeof QInput | typeof QField> | null>(null)
85
+ const scopes = reactive(inputScope)
86
+ defineExpose<typeof scopes & { input: typeof input }>({ input, ...scopes })
87
+ defineOptions({
88
+ name: 'MInput',
89
+ inheritAttrs: !1
90
+ })
91
+ </script>
92
+
93
+ <template>
94
+ <MCol
95
+ :auto="auto"
96
+ :class="[$attrs.class,{'m--input__required':getRules?.required!==undefined,'m--input__error':!!errorMessage,'m--input__view':viewMode}]"
97
+ :col="col"
98
+ :lg="lg"
99
+ :md="md"
100
+ :name="name"
101
+ :sm="sm"
102
+ :xs="xs"
103
+ >
104
+ <slot
105
+ name="top-input"
106
+ v-bind="scopes"
107
+ />
108
+ <slot
109
+ name="top-label"
110
+ v-bind="scopes"
111
+ >
112
+ <MInputLabel
113
+ v-if="hasTopLabel"
114
+ :field="scopes"
115
+ >
116
+ <MHelpRow
117
+ :text="help"
118
+ tooltip
119
+ />
120
+ </MInputLabel>
121
+ </slot>
122
+ <slot name="caption">
123
+ <div
124
+ v-if="!!caption"
125
+ class="m--input__caption"
126
+ >
127
+ {{ __(caption) }}
128
+ </div>
129
+ </slot>
130
+ <component
131
+ :is="viewMode ? QField : QInput"
132
+ ref="input"
133
+ :error="!!errorMessage"
134
+ :error-message="errorMessage"
135
+ :hint="hint ? __(hint) : hint"
136
+ :label="hasTopLabel ? undefined : getLabel"
137
+ :model-value="value"
138
+ :placeholder="getPlaceholder"
139
+ v-bind="{
140
+ ...options.input as any,
141
+ ...( viewMode ? options.field : {} ),
142
+ ...$attrs,
143
+ ...( viewMode ? { stackLabel: !0 } : {} ),
144
+ autocomplete:getAutocompleteAttribute,
145
+ clearable: viewMode ? !1 : clearable
146
+ }"
147
+ v-on="listeners"
148
+ >
149
+ <template
150
+ v-for="(_,slot) in $slots as Readonly<QInputSlots>"
151
+ :key="slot"
152
+ #[slot]
153
+ >
154
+ <slot :name="slot" />
155
+ </template>
156
+ <template
157
+ v-if="viewMode"
158
+ #control
159
+ >
160
+ <slot name="control">
161
+ <MInputFieldControl>
162
+ {{ viewModeValue ?? value }}
163
+ </MInputFieldControl>
164
+ </slot>
165
+ </template>
166
+ </component>
167
+ <slot
168
+ name="help"
169
+ v-bind="scopes"
170
+ >
171
+ <MHelpRow
172
+ v-if="!hasTopLabel"
173
+ :text="help"
174
+ />
175
+ </slot>
176
+ <slot
177
+ name="bottom-input"
178
+ v-bind="scopes"
179
+ />
180
+ </MCol>
181
+ </template>
@@ -0,0 +1,24 @@
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
10
+ lang="ts"
11
+ setup
12
+ >
13
+ defineOptions({ name: 'MInputFieldControl', inheritAttrs: !1 })
14
+ </script>
15
+
16
+ <template>
17
+ <div
18
+ class="self-center full-width no-outline ellipsis"
19
+ tabindex="0"
20
+ v-bind="$attrs"
21
+ >
22
+ <slot />
23
+ </div>
24
+ </template>
@@ -0,0 +1,31 @@
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 { MInputLabelProps as Props } from '../../types'
12
+ import { useMyth } from '../../composable'
13
+
14
+ const { __ } = useMyth()
15
+ defineProps<Props>()
16
+ defineOptions({ name: 'MInputLabel' })
17
+ </script>
18
+
19
+ <template>
20
+ <div
21
+ :class="{
22
+ 'row items-center m--input__top-label' : !0,
23
+ 'm--input__top-label__invalid' : !field?.meta?.valid && field?.meta?.dirty
24
+ }"
25
+ >
26
+ <div class="m--input__top-label__content">
27
+ {{ label !== undefined ? __(label) : field?.label }}
28
+ </div>
29
+ <slot />
30
+ </div>
31
+ </template>
@@ -0,0 +1,14 @@
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 MBtn from './MBtn.vue'
10
+ import MInput from './MInput.vue'
11
+ import MInputFieldControl from './MInputFieldControl.vue'
12
+ import MInputLabel from './MInputLabel.vue'
13
+
14
+ export { MBtn, MInput, MInputFieldControl, MInputLabel }
@@ -1,7 +1,15 @@
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
  import type { MBlockProps } from '../../types'
3
11
  import { computed } from 'vue'
4
- import MythOptions from '../../myth'
12
+ import { myth } from '../../utils'
5
13
  import { extend } from 'quasar'
6
14
 
7
15
  interface Props {
@@ -15,7 +23,7 @@ const props = withDefaults(defineProps<Props>(), {
15
23
  rounded: !1,
16
24
  shadow: 'none'
17
25
  })
18
- const block = computed(() => MythOptions.options.value.block ?? {})
26
+ const block = computed(() => myth.options.value.block ?? {})
19
27
  const options = computed<Props>(() => extend(!0, { ...props }, block.value))
20
28
  defineOptions({
21
29
  name: 'MBlock',
@@ -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
2
10
  lang="ts"
3
11
  setup
@@ -45,8 +53,8 @@ const classes = computed(() => {
45
53
  list.push('col')
46
54
  }
47
55
  return uniq(list)
48
- // return list
49
56
  })
57
+
50
58
  defineOptions({
51
59
  name: 'MCol',
52
60
  inheritAttrs: !1
@@ -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',
@@ -8,7 +8,7 @@
8
8
 
9
9
  <script lang="ts" setup>
10
10
  import type { MContainerProps } from '../../types'
11
- import MythOptions from '../../myth'
11
+ import { myth } from '../../utils'
12
12
  import { computed } from 'vue'
13
13
 
14
14
  interface Props {
@@ -18,7 +18,7 @@ interface Props {
18
18
  }
19
19
 
20
20
  const props = defineProps<Props>()
21
- const styles = computed(() => MythOptions.options.value?.style ?? {})
21
+ const styles = computed(() => myth.options.value?.style ?? {})
22
22
  const sizeProp = computed(() => {
23
23
  if (props.size !== undefined) {
24
24
  return props.size
@@ -10,7 +10,7 @@
10
10
  lang="ts"
11
11
  setup
12
12
  >
13
- import { useI18n } from 'vue-i18n'
13
+ import { useMyth } from '../../composable'
14
14
 
15
15
  interface Props {
16
16
  text?: string | undefined;
@@ -19,8 +19,7 @@ interface Props {
19
19
  }
20
20
 
21
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
22
+ const { __ } = useMyth()
24
23
  defineOptions({
25
24
  name: 'MHelpRow',
26
25
  inheritAttrs: !1
@@ -28,7 +27,10 @@ defineOptions({
28
27
  </script>
29
28
 
30
29
  <template>
31
- <div class="row">
30
+ <div
31
+ class="row"
32
+ v-if="text || tooltip"
33
+ >
32
34
  <div class="col-auto">
33
35
  <q-icon
34
36
  :left="!!text && !tooltip"
@@ -1,10 +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 type { MRowProps } from '../../types'
6
14
  import { computed } from 'vue'
7
- import MythOptions from '../../myth'
15
+ import { myth } from '../../utils'
8
16
 
9
17
  interface Props {
10
18
  gutter?: MRowProps['gutter'];
@@ -12,7 +20,7 @@ interface Props {
12
20
  }
13
21
 
14
22
  const props = defineProps<Props>()
15
- const defSize = computed<string>(() => MythOptions.options.value.style?.gutters || '')
23
+ const defSize = computed<string>(() => myth.options.value.style?.gutters || '')
16
24
  const gutterSize = computed<string>(() => props.gutter === !0 ? defSize.value : (props.gutter || defSize.value))
17
25
  const colSize = computed<string>(() => props.gutter === !0 ? defSize.value : (props.gutter || defSize.value))
18
26
  defineOptions({
@@ -0,0 +1,16 @@
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 MBlock from './MBlock.vue'
10
+ import MCol from './MCol.vue'
11
+ import MColumn from './MColumn.vue'
12
+ import MContainer from './MContainer.vue'
13
+ import MHelpRow from './MHelpRow.vue'
14
+ import MRow from './MRow.vue'
15
+
16
+ export { MBlock, MCol, MColumn, MContainer, MHelpRow, MRow }
@@ -0,0 +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
+
9
+ export * from './form'
10
+ export * from './grid'
11
+ export * from './typography'
@@ -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
2
10
  lang="ts"
3
11
  setup
@@ -0,0 +1,10 @@
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 MTypingString from './MTypingString.vue'
10
+ export { MTypingString }
@@ -0,0 +1,10 @@
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
+ export * from './useHelpersMyth'
10
+ export * from './useMyth'