@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.
- 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/MAxios.vue +141 -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/MPassword.vue +73 -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 +55 -0
- package/src/components/grid/MBlock.vue +39 -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 +302 -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 +123 -0
- package/src/types/components.d.ts +769 -27
- package/src/types/dt.d.ts +144 -0
- package/src/types/index.d.ts +155 -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 +293 -0
- package/src/utils/Str.ts +211 -0
- package/src/utils/index.ts +13 -0
- package/src/utils/myth.ts +95 -0
- package/src/utils/vee-rules.ts +32 -0
- package/src/utils/vue-plugin.ts +129 -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
package/src/utils/Str.ts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
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 _ from 'lodash'
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
import inflection from 'lodash-inflection'
|
|
13
|
+
|
|
14
|
+
_.mixin(inflection)
|
|
15
|
+
|
|
16
|
+
export const Str = {
|
|
17
|
+
/**
|
|
18
|
+
* Str vue3
|
|
19
|
+
* @param str
|
|
20
|
+
* @param needle
|
|
21
|
+
*/
|
|
22
|
+
strBefore (str: string, needle = '_to_string'): string {
|
|
23
|
+
if (!str) {
|
|
24
|
+
return ''
|
|
25
|
+
}
|
|
26
|
+
if (str.slice(-needle.length) === needle) {
|
|
27
|
+
str = str.slice(0, str.length - needle.length)
|
|
28
|
+
}
|
|
29
|
+
return str
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Str to number format
|
|
33
|
+
* @param num
|
|
34
|
+
* @param c
|
|
35
|
+
*/
|
|
36
|
+
toNumberFormat (num = null, c: any) {
|
|
37
|
+
if (!num) {
|
|
38
|
+
// console.log(num)
|
|
39
|
+
return num
|
|
40
|
+
}
|
|
41
|
+
const splitArray: any = Str.toNumber(num).split('.')
|
|
42
|
+
const rgx = /(\d+)(\d{3})/
|
|
43
|
+
while (rgx.test(splitArray[0])) {
|
|
44
|
+
splitArray[0] = splitArray[0].replace(rgx, '$1' + ',' + '$2')
|
|
45
|
+
}
|
|
46
|
+
let t = splitArray.join('.')
|
|
47
|
+
if (c) t = `${t} ${c}`
|
|
48
|
+
return t
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Convert To string
|
|
52
|
+
* @param value
|
|
53
|
+
*/
|
|
54
|
+
fromArabicNumber (value: any): string {
|
|
55
|
+
if (!value) return ''
|
|
56
|
+
value = value?.toString().replace(/٠/g, 0).replace(/١/g, 1).replace(/٢/g, 2).replace(/٣/g, 3).replace(/٤/g, 4).replace(/٥/g, 5).replace(/٦/g,
|
|
57
|
+
6).replace(/٧/g, 7).replace(/٨/g, 8).replace(/٩/g, 9)
|
|
58
|
+
|
|
59
|
+
return '' + (value || '')
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* Str to number 'return string'
|
|
63
|
+
* @param n
|
|
64
|
+
*/
|
|
65
|
+
toNumber (n: string | null | undefined | number): string {
|
|
66
|
+
if (!n) return ''
|
|
67
|
+
n = '' + n
|
|
68
|
+
n = Str.fromArabicNumber(n)
|
|
69
|
+
n = n.replace(/,/g, '')
|
|
70
|
+
return '' + n
|
|
71
|
+
},
|
|
72
|
+
isKsaMobile (mobile: string | null) {
|
|
73
|
+
mobile = Str.fromArabicNumber(mobile) || ''
|
|
74
|
+
if (!mobile) return !1
|
|
75
|
+
const c1 = mobile.slice(0, 2)
|
|
76
|
+
// const c2 = parseInt(mobile.substr(0, 1))
|
|
77
|
+
return mobile && (mobile.length === 10 && (c1 === '05' || parseInt(c1) === 5))
|
|
78
|
+
// return mobile && ((mobile.length === 10 && (c1 === '05' || parseInt(c1) === 5)) || (mobile.length === 9 && c2 === 5))
|
|
79
|
+
},
|
|
80
|
+
pascalCase (string?: string): string {
|
|
81
|
+
if (!_.pascalCase) {
|
|
82
|
+
_.mixin({ pascalCase: _.flow(_.camelCase, _.upperFirst) })
|
|
83
|
+
}
|
|
84
|
+
return _.pascalCase(string)
|
|
85
|
+
},
|
|
86
|
+
pluralize (string?: string): string {
|
|
87
|
+
return _.pluralize(string)
|
|
88
|
+
},
|
|
89
|
+
singular (string?: string): string {
|
|
90
|
+
return _.singularize(string)
|
|
91
|
+
},
|
|
92
|
+
flipChoice (data: Record<any, any>) {
|
|
93
|
+
const f: Record<any, any> = {}
|
|
94
|
+
for (const a in data) {
|
|
95
|
+
let c
|
|
96
|
+
c = data[a].split('|')
|
|
97
|
+
c = [c[1], c[0]].join('|')
|
|
98
|
+
f[a] = c
|
|
99
|
+
}
|
|
100
|
+
return f
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
*
|
|
104
|
+
* Remove 'الـ' from words
|
|
105
|
+
* Example: الغرب => غرب
|
|
106
|
+
*
|
|
107
|
+
* @param words
|
|
108
|
+
* @param locale
|
|
109
|
+
*/
|
|
110
|
+
wordsWithoutThe<T extends string = any> (words: any, locale: string): string | T {
|
|
111
|
+
if (words && locale?.toString()?.toLowerCase() === 'ar') {
|
|
112
|
+
const e = words.split(' ')
|
|
113
|
+
for (const i in e) {
|
|
114
|
+
if (e[i].slice(0, 2) === 'ال') {
|
|
115
|
+
e[i] = e[i].slice(2)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
words = e.join(' ')
|
|
119
|
+
}
|
|
120
|
+
return words
|
|
121
|
+
},
|
|
122
|
+
/**
|
|
123
|
+
*
|
|
124
|
+
* Add 'الـ' to words
|
|
125
|
+
*
|
|
126
|
+
* Example: غرب => الغرب
|
|
127
|
+
*
|
|
128
|
+
* @param words
|
|
129
|
+
* @param locale
|
|
130
|
+
*/
|
|
131
|
+
wordsWithThe<T extends string = any> (words: any, locale: string): string | T {
|
|
132
|
+
if (words && locale?.toString()?.toLowerCase() === 'ar') {
|
|
133
|
+
let i
|
|
134
|
+
const e = words.split(' ')
|
|
135
|
+
if (e[e.length - 1].slice(0, 2) === 'ال') {
|
|
136
|
+
return words
|
|
137
|
+
}
|
|
138
|
+
for (i in e) {
|
|
139
|
+
if (e[i].slice(0, 2) !== 'ال') {
|
|
140
|
+
e[i] = 'ال' + e[i]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
words = e.join(' ')
|
|
144
|
+
}
|
|
145
|
+
return words
|
|
146
|
+
},
|
|
147
|
+
/**
|
|
148
|
+
* Example: غرب => 'الغربي'
|
|
149
|
+
* @param words
|
|
150
|
+
* @param locale
|
|
151
|
+
*/
|
|
152
|
+
wordsToSingle<T extends string = any> (words: any, locale: string): string | T {
|
|
153
|
+
if (words && locale?.toString()?.toLowerCase() === 'ar') {
|
|
154
|
+
let i
|
|
155
|
+
const e = words.split(' ')
|
|
156
|
+
for (i in e) {
|
|
157
|
+
if (e[i].slice(0, 2) !== 'ال') {
|
|
158
|
+
e[i] = 'ال' + e[i]
|
|
159
|
+
}
|
|
160
|
+
if (e[i].slice(-1) !== 'ي') {
|
|
161
|
+
e[i] += 'ي'
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
words = e.join(' ')
|
|
165
|
+
}
|
|
166
|
+
return words
|
|
167
|
+
},
|
|
168
|
+
/**
|
|
169
|
+
* Custom helper
|
|
170
|
+
* @param a
|
|
171
|
+
* @param b
|
|
172
|
+
*/
|
|
173
|
+
sortNumberFormatted (a: any, b: any) {
|
|
174
|
+
const f = parseFloat(Str.toNumber(a).replace(/[^\d]/g, '')) || 0
|
|
175
|
+
const s = parseFloat(Str.toNumber(b).replace(/[^\d]/g, '')) || 0
|
|
176
|
+
return f - s
|
|
177
|
+
},
|
|
178
|
+
/**
|
|
179
|
+
* Convert string new line to BR
|
|
180
|
+
* @param str
|
|
181
|
+
* @param isXhtml
|
|
182
|
+
*/
|
|
183
|
+
nl2br<T extends string = any> (str: any, isXhtml: (boolean | null | undefined) = !1): string | T {
|
|
184
|
+
if (!str) {
|
|
185
|
+
return str
|
|
186
|
+
}
|
|
187
|
+
const breakTag = (isXhtml || typeof isXhtml === 'undefined') ? '<br />' : '<br>'
|
|
188
|
+
return str?.toString?.()?.replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, `$1${breakTag}$2`) || str
|
|
189
|
+
},
|
|
190
|
+
prettyPrint (string: any) {
|
|
191
|
+
const jsonLine = /^( *)("[\w]+": )?("[^"]*"|[\w.+-]*)?([,[{])?$/mg
|
|
192
|
+
return JSON.stringify(string, null, 3)
|
|
193
|
+
.replace(/&/g, '&').replace(/\\"/g, '"')
|
|
194
|
+
.replace(/</g, '<').replace(/>/g, '>')
|
|
195
|
+
.replace(jsonLine, (match, pIndent, pKey, pVal, pEnd) => {
|
|
196
|
+
const key = '<span class="json-key" style="color: brown">'
|
|
197
|
+
const val = '<span class="json-value" style="color: navy">'
|
|
198
|
+
const str = '<span class="json-string" style="color: olive">'
|
|
199
|
+
let r = pIndent || ''
|
|
200
|
+
if (pKey) {
|
|
201
|
+
r = r + key + pKey.replace(/[": ]/g, '') + '</span>: '
|
|
202
|
+
}
|
|
203
|
+
if (pVal) {
|
|
204
|
+
r = r + (pVal[0] === '"' ? str : val) + pVal + '</span>'
|
|
205
|
+
}
|
|
206
|
+
return r + (pEnd || '')
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export default {}
|
|
@@ -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 './myth'
|
|
10
|
+
export * from './Str'
|
|
11
|
+
export * from './Helpers'
|
|
12
|
+
export * from './vee-rules'
|
|
13
|
+
export * from './vue-plugin'
|
|
@@ -0,0 +1,95 @@
|
|
|
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 { ref } from 'vue'
|
|
10
|
+
import { extend } from 'quasar'
|
|
11
|
+
import type { BtnLoading, HelpersStubSchema, PropsContext, ThemeBtn, ThemeInput, ThemeRounded, ThemeShadow, ThemeSize } from '../types'
|
|
12
|
+
|
|
13
|
+
const props = ref<PropsContext>({})
|
|
14
|
+
const size = ref<ThemeSize>('md')
|
|
15
|
+
const rounded = ref<ThemeRounded>(!1)
|
|
16
|
+
const shadow = ref<ThemeShadow>(2)
|
|
17
|
+
const fluid = ref<boolean>(!1)
|
|
18
|
+
const rules = ref<string[]>([])
|
|
19
|
+
const btnLoading = ref<BtnLoading>({
|
|
20
|
+
type: 'spinner'
|
|
21
|
+
})
|
|
22
|
+
const themeBtn = ref<ThemeBtn>({})
|
|
23
|
+
const themeInput = ref<ThemeInput>({})
|
|
24
|
+
const api = ref<HelpersStubSchema>({} as HelpersStubSchema)
|
|
25
|
+
export const myth = {
|
|
26
|
+
/**
|
|
27
|
+
* Apply Padding on all sides of components.
|
|
28
|
+
*/
|
|
29
|
+
// size: computed({
|
|
30
|
+
// get: () => size.value,
|
|
31
|
+
// set: v => (size.value = v)
|
|
32
|
+
// }),
|
|
33
|
+
size,
|
|
34
|
+
setSize (v: ThemeSize) {
|
|
35
|
+
size.value = v
|
|
36
|
+
},
|
|
37
|
+
/**
|
|
38
|
+
* Apply Fluid on all sides of containers.
|
|
39
|
+
*/
|
|
40
|
+
fluid,
|
|
41
|
+
setFluid (v: boolean) {
|
|
42
|
+
fluid.value = v
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Components Props.
|
|
46
|
+
*/
|
|
47
|
+
props,
|
|
48
|
+
setProps (values: Partial<PropsContext> | undefined) {
|
|
49
|
+
props.value = values ?? {}
|
|
50
|
+
},
|
|
51
|
+
withProps (values: Partial<PropsContext> | undefined) {
|
|
52
|
+
props.value = extend(!0, {}, props.value, values)
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Rules keys that can be added to Input Rules as Vue Attr
|
|
56
|
+
*/
|
|
57
|
+
rules,
|
|
58
|
+
setRules (v: string[]) {
|
|
59
|
+
rules.value = v
|
|
60
|
+
},
|
|
61
|
+
withRules (v: string[]) {
|
|
62
|
+
rules.value = [...rules.value, ...v]
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Default loading q-btn loading slot.
|
|
66
|
+
*/
|
|
67
|
+
// btnLoading: computed({
|
|
68
|
+
// get: () => btnLoading.value,
|
|
69
|
+
// set: v => (btnLoading.value = v)
|
|
70
|
+
// }),
|
|
71
|
+
btnLoading,
|
|
72
|
+
setBtnLoading (v: BtnLoading) {
|
|
73
|
+
btnLoading.value = v
|
|
74
|
+
},
|
|
75
|
+
/**
|
|
76
|
+
* Default Buttons style.
|
|
77
|
+
*/
|
|
78
|
+
themeBtn,
|
|
79
|
+
/**
|
|
80
|
+
* Default Inputs style.
|
|
81
|
+
*/
|
|
82
|
+
themeInput,
|
|
83
|
+
/**
|
|
84
|
+
* Theme Rounded.
|
|
85
|
+
*/
|
|
86
|
+
rounded,
|
|
87
|
+
/**
|
|
88
|
+
* Theme Shadow.
|
|
89
|
+
*/
|
|
90
|
+
shadow,
|
|
91
|
+
api,
|
|
92
|
+
setApi (v: HelpersStubSchema) {
|
|
93
|
+
api.value = v
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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 lodash from 'lodash'
|
|
10
|
+
import { patterns } from 'quasar'
|
|
11
|
+
|
|
12
|
+
const { testPattern } = patterns
|
|
13
|
+
|
|
14
|
+
export const veeRules = {
|
|
15
|
+
float: (v: any) => lodash.isNumber(parseInt(v)) && !isNaN(parseInt(v)) && v?.toString()
|
|
16
|
+
.split('.')?.length <= 2 && (/(\d)+/g.test(v) && !/[a-zA-Z]/.test(
|
|
17
|
+
v)),
|
|
18
|
+
date: (v: any) => /^-?[\d]+-[0-1]\d-[0-3]\d$/.test(v),
|
|
19
|
+
time: (v: any) => testPattern.time(v),
|
|
20
|
+
fulltime: (v: any) => testPattern.fulltime(v),
|
|
21
|
+
timeOrFulltime: (v: any) => testPattern.timeOrFulltime(v),
|
|
22
|
+
hexColor: (v: any) => testPattern.hexColor(v),
|
|
23
|
+
hexaColor: (v: any) => testPattern.hexaColor(v),
|
|
24
|
+
hexOrHexaColor: (v: any) => testPattern.hexOrHexaColor(v),
|
|
25
|
+
rgbColor: (v: any) => testPattern.rgbColor(v),
|
|
26
|
+
rgbaColor: (v: any) => testPattern.rgbaColor(v),
|
|
27
|
+
rgbOrRgbaColor: (v: any) => testPattern.rgbOrRgbaColor(v),
|
|
28
|
+
hexOrRgbColor: (v: any) => testPattern.hexOrRgbColor(v),
|
|
29
|
+
hexaOrRgbaColor: (v: any) => testPattern.hexaOrRgbaColor(v),
|
|
30
|
+
color: (v: any) => !v ? !0 : testPattern.anyColor(v),
|
|
31
|
+
requiredColor: (v: any) => testPattern.anyColor(v)
|
|
32
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
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 type { App } from 'vue'
|
|
10
|
+
import { name, version } from '../../package.json'
|
|
11
|
+
import { myth } from './myth'
|
|
12
|
+
import {
|
|
13
|
+
MAvatarViewer,
|
|
14
|
+
MAxios,
|
|
15
|
+
MBlock,
|
|
16
|
+
MBtn,
|
|
17
|
+
MCheckbox,
|
|
18
|
+
MCol,
|
|
19
|
+
MColor,
|
|
20
|
+
MColumn,
|
|
21
|
+
MContainer,
|
|
22
|
+
MDate,
|
|
23
|
+
MEditor,
|
|
24
|
+
MEmail,
|
|
25
|
+
MFadeTransition,
|
|
26
|
+
MFadeXTransition,
|
|
27
|
+
MField,
|
|
28
|
+
MFile,
|
|
29
|
+
MForm,
|
|
30
|
+
MHelpRow,
|
|
31
|
+
MHidden,
|
|
32
|
+
MHiddenInput,
|
|
33
|
+
MInput,
|
|
34
|
+
MInputFieldControl,
|
|
35
|
+
MInputLabel,
|
|
36
|
+
MMobile,
|
|
37
|
+
MPassword,
|
|
38
|
+
MPicker,
|
|
39
|
+
MRadio,
|
|
40
|
+
MRow,
|
|
41
|
+
MSelect,
|
|
42
|
+
MTime,
|
|
43
|
+
MTransition,
|
|
44
|
+
MTypingString
|
|
45
|
+
} from '../components'
|
|
46
|
+
|
|
47
|
+
import type { InstallOptions } from '../types'
|
|
48
|
+
|
|
49
|
+
function install (app: App, options: InstallOptions = {}) {
|
|
50
|
+
if (options.rounded !== undefined) {
|
|
51
|
+
myth.rounded.value = options.rounded
|
|
52
|
+
}
|
|
53
|
+
if (options.shadow !== undefined) {
|
|
54
|
+
myth.shadow.value = options.shadow
|
|
55
|
+
}
|
|
56
|
+
if (options.fluid !== undefined) {
|
|
57
|
+
myth.setFluid(options.fluid)
|
|
58
|
+
}
|
|
59
|
+
if (options.size !== undefined) {
|
|
60
|
+
myth.setSize(options.size)
|
|
61
|
+
}
|
|
62
|
+
if (options.props !== undefined) {
|
|
63
|
+
myth.withProps(options.props)
|
|
64
|
+
}
|
|
65
|
+
if (options.rules !== undefined) {
|
|
66
|
+
myth.withRules(options.rules)
|
|
67
|
+
}
|
|
68
|
+
if (options.themeBtn !== undefined) {
|
|
69
|
+
myth.themeBtn.value = options.themeBtn
|
|
70
|
+
}
|
|
71
|
+
if (options.themeInput !== undefined) {
|
|
72
|
+
myth.themeInput.value = options.themeInput
|
|
73
|
+
}
|
|
74
|
+
if (options.api !== undefined) {
|
|
75
|
+
myth.setApi(options.api)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Form.
|
|
79
|
+
app.component('MAvatarViewer', MAvatarViewer)
|
|
80
|
+
app.component('MAxios', MAxios)
|
|
81
|
+
app.component('MBtn', MBtn)
|
|
82
|
+
app.component('MCheckbox', MCheckbox)
|
|
83
|
+
app.component('MColor', MColor)
|
|
84
|
+
app.component('MDate', MDate)
|
|
85
|
+
app.component('MEditor', MEditor)
|
|
86
|
+
app.component('MEmail', MEmail)
|
|
87
|
+
app.component('MField', MField)
|
|
88
|
+
app.component('MFile', MFile)
|
|
89
|
+
app.component('MForm', MForm)
|
|
90
|
+
app.component('MHidden', MHidden)
|
|
91
|
+
app.component('MHiddenInput', MHiddenInput)
|
|
92
|
+
app.component('MInput', MInput)
|
|
93
|
+
app.component('MInputFieldControl', MInputFieldControl)
|
|
94
|
+
app.component('MInputLabel', MInputLabel)
|
|
95
|
+
app.component('MMobile', MMobile)
|
|
96
|
+
app.component('MPassword', MPassword)
|
|
97
|
+
app.component('MPicker', MPicker)
|
|
98
|
+
app.component('MRadio', MRadio)
|
|
99
|
+
app.component('MSelect', MSelect)
|
|
100
|
+
app.component('MTime', MTime)
|
|
101
|
+
|
|
102
|
+
// Grid.
|
|
103
|
+
app.component('MBlock', MBlock)
|
|
104
|
+
app.component('MCol', MCol)
|
|
105
|
+
app.component('MColumn', MColumn)
|
|
106
|
+
app.component('MContainer', MContainer)
|
|
107
|
+
app.component('MHelpRow', MHelpRow)
|
|
108
|
+
app.component('MRow', MRow)
|
|
109
|
+
|
|
110
|
+
// Typography.
|
|
111
|
+
app.component('MTypingString', MTypingString)
|
|
112
|
+
|
|
113
|
+
// Transitions.
|
|
114
|
+
app.component('MTransition', MTransition)
|
|
115
|
+
app.component('MFadeTransition', MFadeTransition)
|
|
116
|
+
app.component('MFadeXTransition', MFadeXTransition)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
name,
|
|
121
|
+
version,
|
|
122
|
+
install
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export default {
|
|
126
|
+
name,
|
|
127
|
+
version,
|
|
128
|
+
install
|
|
129
|
+
}
|
package/tsconfig.json
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"baseUrl": "./",
|
|
4
|
-
"rootDir": ".",
|
|
5
|
-
"outDir": "./dist",
|
|
6
3
|
"esModuleInterop": true,
|
|
7
4
|
"skipLibCheck": true,
|
|
8
5
|
"target": "esnext",
|
|
@@ -10,7 +7,6 @@
|
|
|
10
7
|
"resolveJsonModule": true,
|
|
11
8
|
"moduleDetection": "force",
|
|
12
9
|
"isolatedModules": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
10
|
"module": "preserve",
|
|
15
11
|
"noEmit": true,
|
|
16
12
|
"lib": [
|
|
@@ -22,13 +18,13 @@
|
|
|
22
18
|
"allowUnreachableCode": false,
|
|
23
19
|
"allowUnusedLabels": false,
|
|
24
20
|
"noImplicitOverride": true,
|
|
25
|
-
"exactOptionalPropertyTypes":
|
|
26
|
-
"noUncheckedIndexedAccess": true
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
|
|
21
|
+
"exactOptionalPropertyTypes": false,
|
|
22
|
+
"noUncheckedIndexedAccess": true,
|
|
23
|
+
"types": [
|
|
24
|
+
"vite/client"
|
|
25
|
+
],
|
|
26
|
+
"noImplicitAny": false,
|
|
27
|
+
"moduleResolution": "Bundler",
|
|
28
|
+
"newLine": "lf"
|
|
29
|
+
}
|
|
34
30
|
}
|
package/src/myth.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ref } from 'vue'
|
|
2
|
-
import type { QBtnProps } from 'quasar'
|
|
3
|
-
import { extend } from 'quasar'
|
|
4
|
-
import type { MythContext, UiOptionsContext } from './types'
|
|
5
|
-
|
|
6
|
-
const defGutters = 'md'
|
|
7
|
-
const defaultOptions: UiOptionsContext = {
|
|
8
|
-
style: {
|
|
9
|
-
gutters: defGutters
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const optionsRef = ref<UiOptionsContext>({ ...defaultOptions })
|
|
13
|
-
|
|
14
|
-
export const myth : MythContext = {
|
|
15
|
-
options: optionsRef,
|
|
16
|
-
setOptions (values: Partial<UiOptionsContext>) {
|
|
17
|
-
optionsRef.value = extend(!0, defaultOptions, values)
|
|
18
|
-
},
|
|
19
|
-
withOptions (values: Partial<UiOptionsContext>) {
|
|
20
|
-
optionsRef.value = extend(!0, defaultOptions, optionsRef.value, values)
|
|
21
|
-
},
|
|
22
|
-
withBtnOptions (values: Partial<QBtnProps>) {
|
|
23
|
-
this.withOptions({
|
|
24
|
-
btn: {
|
|
25
|
-
props: values
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export default myth
|
package/src/types/myth.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { QBtnProps } from 'quasar'
|
|
2
|
-
import type { Ref } from 'vue'
|
|
3
|
-
import type { MBlockProps, StyleSize } from './components'
|
|
4
|
-
|
|
5
|
-
export interface UiOptionsContext {
|
|
6
|
-
/**
|
|
7
|
-
* Style of the components.
|
|
8
|
-
*/
|
|
9
|
-
style?: {
|
|
10
|
-
/**
|
|
11
|
-
* Apply Padding on all sides of components.
|
|
12
|
-
*/
|
|
13
|
-
gutters?: StyleSize | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* Apply Fluid on all sides of containers.
|
|
16
|
-
*/
|
|
17
|
-
fluid?: boolean | undefined;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* MBtn component.
|
|
21
|
-
*/
|
|
22
|
-
btn?: {
|
|
23
|
-
props?: Partial<QBtnProps>;
|
|
24
|
-
loading?: {
|
|
25
|
-
type: 'audio' | 'ball' | 'bars' | 'box' | 'clock' | 'comment' | 'cube' | 'dots' | 'facebook' | 'gears' | 'grid' | 'hearts' | 'hourglass' | 'infinity' | 'ios' | 'orbit' | 'oval' | 'pie' | 'puff' | 'radio' | 'rings' | 'tail';
|
|
26
|
-
color?: string | undefined;
|
|
27
|
-
size?: string | undefined;
|
|
28
|
-
label?: boolean | undefined;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* MBlock component.
|
|
33
|
-
*/
|
|
34
|
-
block?: Partial<MBlockProps>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface MythContext {
|
|
38
|
-
options: Ref<UiOptionsContext>;
|
|
39
|
-
setOptions: (values: Partial<UiOptionsContext>) => void;
|
|
40
|
-
withOptions: (values: Partial<UiOptionsContext>) => void;
|
|
41
|
-
withBtnOptions: (values: Partial<QBtnProps>) => void;
|
|
42
|
-
}
|
package/src/vue-plugin.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import js from './../package.json'
|
|
2
|
-
import myth from './myth'
|
|
3
|
-
import MBtn from './components/form/MBtn.vue'
|
|
4
|
-
import MBlock from './components/grid/MBlock.vue'
|
|
5
|
-
import MCol from './components/grid/MCol.vue'
|
|
6
|
-
import MColumn from './components/grid/MColumn.vue'
|
|
7
|
-
import MContainer from './components/grid/MContainer.vue'
|
|
8
|
-
import MHelpRow from './components/grid/MHelpRow.vue'
|
|
9
|
-
import MRow from './components/grid/MRow.vue'
|
|
10
|
-
import MTypingString from './components/typography/MTypingString.vue'
|
|
11
|
-
import type { App } from 'vue'
|
|
12
|
-
|
|
13
|
-
const name = js.name
|
|
14
|
-
const version = js.version
|
|
15
|
-
|
|
16
|
-
function install (app: App, options = {}) {
|
|
17
|
-
myth.withOptions(options)
|
|
18
|
-
|
|
19
|
-
// Form.
|
|
20
|
-
app.component('MBtn', MBtn)
|
|
21
|
-
|
|
22
|
-
// Grid.
|
|
23
|
-
app.component('MBlock', MBlock)
|
|
24
|
-
app.component('MCol', MCol)
|
|
25
|
-
app.component('MColumn', MColumn)
|
|
26
|
-
app.component('MContainer', MContainer)
|
|
27
|
-
app.component('MHelpRow', MHelpRow)
|
|
28
|
-
app.component('MRow', MRow)
|
|
29
|
-
|
|
30
|
-
// Typography.
|
|
31
|
-
app.component('MTypingString', MTypingString)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const e = {
|
|
35
|
-
name,
|
|
36
|
-
version,
|
|
37
|
-
install,
|
|
38
|
-
myth
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export default e
|
package/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/types'
|