@mythpe/quasar-ui-qui 0.0.26 → 0.0.27-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 (92) hide show
  1. package/index.d.ts +13 -0
  2. package/package.json +15 -8
  3. package/src/boot/register.ts +14 -0
  4. package/src/components/datatable/MDatatable.vue +2305 -0
  5. package/src/components/datatable/MDtAvatar.vue +49 -0
  6. package/src/components/datatable/MDtBtn.vue +153 -0
  7. package/src/components/datatable/MDtContextmenuItems.vue +54 -0
  8. package/src/components/datatable/index.ts +6 -0
  9. package/src/components/form/MAvatarViewer.vue +327 -0
  10. package/src/components/form/MAxios.vue +144 -0
  11. package/src/components/form/MBtn.vue +271 -93
  12. package/src/components/form/MCheckbox.vue +150 -0
  13. package/src/components/form/MColor.vue +122 -0
  14. package/src/components/form/MDate.vue +50 -0
  15. package/src/components/form/MEditor.vue +285 -0
  16. package/src/components/form/MEmail.vue +43 -0
  17. package/src/components/form/MField.vue +148 -0
  18. package/src/components/form/MFile.vue +215 -0
  19. package/src/components/form/MForm.vue +89 -0
  20. package/src/components/form/MHidden.vue +86 -0
  21. package/src/components/form/MHiddenInput.vue +58 -0
  22. package/src/components/form/MInput.vue +178 -0
  23. package/src/components/form/MInputFieldControl.vue +27 -0
  24. package/src/components/form/MInputLabel.vue +38 -0
  25. package/src/components/form/MMobile.vue +43 -0
  26. package/src/components/form/MOptions.vue +255 -0
  27. package/src/components/form/MOtp.vue +292 -0
  28. package/src/components/form/MPassword.vue +73 -0
  29. package/src/components/form/MPicker.vue +313 -0
  30. package/src/components/form/MRadio.vue +181 -0
  31. package/src/components/form/MSelect.vue +352 -0
  32. package/src/components/form/MTime.vue +48 -0
  33. package/src/components/form/MToggle.vue +211 -0
  34. package/src/components/form/MUploader.vue +511 -0
  35. package/src/components/form/index.ts +63 -0
  36. package/src/components/grid/MBlock.vue +39 -18
  37. package/src/components/grid/MCol.vue +11 -15
  38. package/src/components/grid/MColumn.vue +12 -1
  39. package/src/components/grid/MContainer.vue +22 -13
  40. package/src/components/grid/MHelpRow.vue +13 -12
  41. package/src/components/grid/MRow.vue +31 -10
  42. package/src/components/grid/index.ts +16 -0
  43. package/src/components/index.ts +15 -0
  44. package/src/components/modal/MDialog.vue +58 -0
  45. package/src/components/modal/MModalMenu.vue +62 -0
  46. package/src/components/modal/MTooltip.vue +39 -0
  47. package/src/components/modal/index.ts +5 -0
  48. package/src/components/parials/UploaderItem.vue +298 -0
  49. package/src/components/parials/index.ts +3 -0
  50. package/src/components/transition/MFadeTransition.vue +27 -0
  51. package/src/components/transition/MFadeXTransition.vue +26 -0
  52. package/src/components/transition/MTransition.vue +44 -0
  53. package/src/components/transition/index.ts +13 -0
  54. package/src/components/typography/MTypingString.vue +8 -0
  55. package/src/components/typography/index.ts +11 -0
  56. package/src/composable/index.ts +12 -0
  57. package/src/composable/useBindInput.ts +209 -0
  58. package/src/composable/useError.ts +11 -0
  59. package/src/composable/useMyth.ts +311 -0
  60. package/src/composable/useValue.ts +12 -0
  61. package/src/index.common.js +19 -1
  62. package/src/index.esm.js +18 -3
  63. package/src/index.js +19 -0
  64. package/src/index.sass +9 -26
  65. package/src/index.ts +18 -4
  66. package/src/index.umd.js +17 -2
  67. package/src/style/m-container.sass +13 -0
  68. package/src/style/main.sass +146 -0
  69. package/src/style/print.sass +14 -0
  70. package/src/style/transition.sass +40 -0
  71. package/src/types/api-helpers.d.ts +62 -0
  72. package/src/types/components.d.ts +1075 -27
  73. package/src/types/index.d.ts +21 -1
  74. package/src/types/install-options.d.ts +19 -0
  75. package/src/types/lodash.d.ts +26 -0
  76. package/src/types/m-datatable.d.ts +316 -0
  77. package/src/types/m-geolocation.d.ts +16 -0
  78. package/src/types/m-helpers.d.ts +97 -0
  79. package/src/types/plugin-props-option.d.ts +301 -0
  80. package/src/types/quasar-helpers.d.ts +7 -0
  81. package/src/types/theme.d.ts +12 -0
  82. package/src/utils/Helpers.ts +293 -0
  83. package/src/utils/Str.ts +211 -0
  84. package/src/utils/index.ts +13 -0
  85. package/src/utils/myth.ts +109 -0
  86. package/src/utils/vee-rules.ts +32 -0
  87. package/src/utils/vue-plugin.ts +161 -0
  88. package/tsconfig.json +9 -13
  89. package/src/myth.ts +0 -30
  90. package/src/types/myth.ts +0 -42
  91. package/src/vue-plugin.ts +0 -41
  92. package/types.d.ts +0 -1
@@ -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, '&amp;').replace(/\\"/g, '&quot;')
194
+ .replace(/</g, '&lt;').replace(/>/g, '&gt;')
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,109 @@
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
+ import type { AxiosInstance } from 'axios'
13
+
14
+ const props = ref<PropsContext>({})
15
+ const size = ref<ThemeSize>('md')
16
+ const rounded = ref<ThemeRounded>(!1)
17
+ const shadow = ref<ThemeShadow>(2)
18
+ const fluid = ref<boolean>(!1)
19
+ const rules = ref<string[]>([])
20
+ const btnLoading = ref<BtnLoading>({
21
+ type: 'spinner'
22
+ })
23
+ const themeBtn = ref<ThemeBtn>({})
24
+ const themeInput = ref<ThemeInput>({})
25
+ const baseUrl = ref<string>('')
26
+ const api = ref<HelpersStubSchema>({} as HelpersStubSchema)
27
+ const mAxios = ref<AxiosInstance>({} as AxiosInstance)
28
+ export const myth = {
29
+ /**
30
+ * Apply Padding on all sides of components.
31
+ */
32
+ // size: computed({
33
+ // get: () => size.value,
34
+ // set: v => (size.value = v)
35
+ // }),
36
+ size,
37
+ setSize (v: ThemeSize) {
38
+ size.value = v
39
+ },
40
+ /**
41
+ * Apply Fluid on all sides of containers.
42
+ */
43
+ fluid,
44
+ setFluid (v: boolean) {
45
+ fluid.value = v
46
+ },
47
+ /**
48
+ * Components Props.
49
+ */
50
+ props,
51
+ setProps (values: Partial<PropsContext> | undefined) {
52
+ props.value = values ?? {}
53
+ },
54
+ withProps (values: Partial<PropsContext> | undefined) {
55
+ props.value = extend(!0, {}, props.value, values)
56
+ },
57
+ /**
58
+ * Rules keys that can be added to Input Rules as Vue Attr
59
+ */
60
+ rules,
61
+ setRules (v: string[]) {
62
+ rules.value = v
63
+ },
64
+ withRules (v: string[]) {
65
+ rules.value = [...rules.value, ...v]
66
+ },
67
+ /**
68
+ * Default loading q-btn loading slot.
69
+ */
70
+ // btnLoading: computed({
71
+ // get: () => btnLoading.value,
72
+ // set: v => (btnLoading.value = v)
73
+ // }),
74
+ btnLoading,
75
+ setBtnLoading (v: BtnLoading) {
76
+ btnLoading.value = v
77
+ },
78
+ /**
79
+ * Default Buttons style.
80
+ */
81
+ themeBtn,
82
+ /**
83
+ * Default Inputs style.
84
+ */
85
+ themeInput,
86
+ /**
87
+ * Theme Rounded.
88
+ */
89
+ rounded,
90
+ /**
91
+ * Theme Shadow.
92
+ */
93
+ shadow,
94
+ /**
95
+ * Axios instance.
96
+ */
97
+ mAxios,
98
+ /**
99
+ * Api stubs.
100
+ */
101
+ api,
102
+ setApi (v: HelpersStubSchema) {
103
+ api.value = v
104
+ },
105
+ /**
106
+ * Base API Url.
107
+ */
108
+ baseUrl
109
+ }
@@ -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,161 @@
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
+ MOptions,
38
+ MOtp,
39
+ MPassword,
40
+ MPicker,
41
+ MRadio,
42
+ MRow,
43
+ MSelect,
44
+ MTime,
45
+ MToggle,
46
+ MTransition,
47
+ MTypingString,
48
+ MUploader,
49
+ MDialog,
50
+ MModalMenu,
51
+ MTooltip,
52
+ MDatatable,
53
+ MDtAvatar,
54
+ MDtBtn,
55
+ MDtContextmenuItems
56
+ } from '../components'
57
+
58
+ import { InstallOptions } from '../types/install-options'
59
+
60
+ function install (app: App, options: InstallOptions = {}) {
61
+ if (options.rounded !== undefined) {
62
+ myth.rounded.value = options.rounded
63
+ }
64
+ if (options.shadow !== undefined) {
65
+ myth.shadow.value = options.shadow
66
+ }
67
+ if (options.fluid !== undefined) {
68
+ myth.setFluid(options.fluid)
69
+ }
70
+ if (options.size !== undefined) {
71
+ myth.setSize(options.size)
72
+ }
73
+ if (options.props !== undefined) {
74
+ myth.withProps(options.props)
75
+ }
76
+ if (options.rules !== undefined) {
77
+ myth.withRules(options.rules)
78
+ }
79
+ if (options.themeBtn !== undefined) {
80
+ myth.themeBtn.value = options.themeBtn
81
+ }
82
+ if (options.themeInput !== undefined) {
83
+ myth.themeInput.value = options.themeInput
84
+ }
85
+ if (options.baseUrl !== undefined) {
86
+ myth.baseUrl.value = options.baseUrl
87
+ }
88
+ if (options.api !== undefined) {
89
+ myth.setApi(options.api)
90
+ }
91
+ if (options.mAxios !== undefined) {
92
+ myth.mAxios.value = options.mAxios
93
+ }
94
+
95
+ // Form.
96
+ app.component('MAvatarViewer', MAvatarViewer)
97
+ app.component('MAxios', MAxios)
98
+ app.component('MBtn', MBtn)
99
+ app.component('MCheckbox', MCheckbox)
100
+ app.component('MColor', MColor)
101
+ app.component('MDate', MDate)
102
+ app.component('MEditor', MEditor)
103
+ app.component('MEmail', MEmail)
104
+ app.component('MField', MField)
105
+ app.component('MFile', MFile)
106
+ app.component('MForm', MForm)
107
+ app.component('MHidden', MHidden)
108
+ app.component('MHiddenInput', MHiddenInput)
109
+ app.component('MInput', MInput)
110
+ app.component('MInputFieldControl', MInputFieldControl)
111
+ app.component('MInputLabel', MInputLabel)
112
+ app.component('MMobile', MMobile)
113
+ app.component('MOptions', MOptions)
114
+ app.component('MOtp', MOtp)
115
+ app.component('MPassword', MPassword)
116
+ app.component('MPicker', MPicker)
117
+ app.component('MRadio', MRadio)
118
+ app.component('MSelect', MSelect)
119
+ app.component('MTime', MTime)
120
+ app.component('MToggle', MToggle)
121
+ app.component('MUploader', MUploader)
122
+
123
+ // Grid.
124
+ app.component('MBlock', MBlock)
125
+ app.component('MCol', MCol)
126
+ app.component('MColumn', MColumn)
127
+ app.component('MContainer', MContainer)
128
+ app.component('MHelpRow', MHelpRow)
129
+ app.component('MRow', MRow)
130
+
131
+ // Typography.
132
+ app.component('MTypingString', MTypingString)
133
+
134
+ // Transitions.
135
+ app.component('MTransition', MTransition)
136
+ app.component('MFadeTransition', MFadeTransition)
137
+ app.component('MFadeXTransition', MFadeXTransition)
138
+
139
+ // Modals.
140
+ app.component('MDialog', MDialog)
141
+ app.component('MModalMenu', MModalMenu)
142
+ app.component('MTooltip', MTooltip)
143
+
144
+ // Datatable
145
+ app.component('MDatatable', MDatatable)
146
+ app.component('MDtAvatar', MDtAvatar)
147
+ app.component('MDtBtn', MDtBtn)
148
+ app.component('MDtContextmenuItems', MDtContextmenuItems)
149
+ }
150
+
151
+ export {
152
+ name,
153
+ version,
154
+ install
155
+ }
156
+
157
+ export default {
158
+ name,
159
+ version,
160
+ install
161
+ }
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": true,
26
- "noUncheckedIndexedAccess": true
27
- },
28
- "exclude": [
29
- "./build"
30
- ],
31
- "include": [
32
- "src/**/*"
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'