@mythpe/quasar-ui-qui 0.0.45 → 0.0.47
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/package.json +1 -1
- package/src/components/form/MInput.vue +6 -1
- package/src/components/form/MUploader.vue +2 -2
- package/src/components/parials/{UploaderItem.vue → MUploaderItem.vue} +1 -1
- package/src/components/parials/index.ts +2 -2
- package/src/plugin/defineAsyncComponents.ts +59 -0
- package/src/plugin/defineComponents.ts +8 -0
- package/src/plugin/defineOptions.ts +38 -0
- package/src/types/install-options.d.ts +1 -0
- package/src/utils/Str.ts +3 -3
- package/src/utils/vue-plugin.ts +8 -92
package/package.json
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
lang="ts"
|
|
11
11
|
setup
|
|
12
12
|
>
|
|
13
|
-
|
|
14
13
|
import { useField } from 'vee-validate'
|
|
15
14
|
import { reactive, toValue, useTemplateRef } from 'vue'
|
|
16
15
|
import type { MInputProps as Props } from '../../types'
|
|
@@ -170,5 +169,11 @@ defineOptions({
|
|
|
170
169
|
name="bottom-input"
|
|
171
170
|
v-bind="scopes"
|
|
172
171
|
/>
|
|
172
|
+
<div>
|
|
173
|
+
<div>theme</div>
|
|
174
|
+
<pre>{{ theme }}</pre>
|
|
175
|
+
<div>attrs</div>
|
|
176
|
+
<pre>{{ attrs }}</pre>
|
|
177
|
+
</div>
|
|
173
178
|
</MCol>
|
|
174
179
|
</template>
|
|
@@ -458,7 +458,7 @@ defineOptions({
|
|
|
458
458
|
v-for="(file,i) in scope.files"
|
|
459
459
|
:key="`fi-${i}`"
|
|
460
460
|
>
|
|
461
|
-
<
|
|
461
|
+
<MUploaderItem
|
|
462
462
|
:collection="collection"
|
|
463
463
|
:default-file-icon="defaultFileIcon"
|
|
464
464
|
:delete-media-icon="deleteMediaIcon"
|
|
@@ -482,7 +482,7 @@ defineOptions({
|
|
|
482
482
|
v-for="f in attachments"
|
|
483
483
|
:key="f.key"
|
|
484
484
|
>
|
|
485
|
-
<
|
|
485
|
+
<MUploaderItem
|
|
486
486
|
:collection="collection"
|
|
487
487
|
:default-file-icon="defaultFileIcon"
|
|
488
488
|
:delete-media-icon="deleteMediaIcon"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MUploaderItem from './MUploaderItem.vue'
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { MUploaderItem }
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type App, defineAsyncComponent } from 'vue'
|
|
2
|
+
|
|
3
|
+
export const defineAsyncComponents = function (app: App) {
|
|
4
|
+
// Form.
|
|
5
|
+
app.component('MAvatarViewer', defineAsyncComponent(() => import('../components/form/MAvatarViewer.vue')))
|
|
6
|
+
app.component('MAxios', defineAsyncComponent(() => import('../components/form/MAxios.vue')))
|
|
7
|
+
app.component('MBtn', defineAsyncComponent(() => import('../components/form/MBtn.vue')))
|
|
8
|
+
app.component('MCheckbox', defineAsyncComponent(() => import('../components/form/MCheckbox.vue')))
|
|
9
|
+
app.component('MCkeditor', defineAsyncComponent(() => import('../components/form/MCkeditor.vue')))
|
|
10
|
+
app.component('MColor', defineAsyncComponent(() => import('../components/form/MColor.vue')))
|
|
11
|
+
app.component('MDate', defineAsyncComponent(() => import('../components/form/MDate.vue')))
|
|
12
|
+
app.component('MEditor', defineAsyncComponent(() => import('../components/form/MEditor.vue')))
|
|
13
|
+
app.component('MEmail', defineAsyncComponent(() => import('../components/form/MEmail.vue')))
|
|
14
|
+
app.component('MField', defineAsyncComponent(() => import('../components/form/MField.vue')))
|
|
15
|
+
app.component('MFile', defineAsyncComponent(() => import('../components/form/MFile.vue')))
|
|
16
|
+
app.component('MForm', defineAsyncComponent(() => import('../components/form/MForm.vue')))
|
|
17
|
+
app.component('MHidden', defineAsyncComponent(() => import('../components/form/MHidden.vue')))
|
|
18
|
+
app.component('MHiddenInput', defineAsyncComponent(() => import('../components/form/MHiddenInput.vue')))
|
|
19
|
+
app.component('MInput', defineAsyncComponent(() => import('../components/form/MInput.vue')))
|
|
20
|
+
app.component('MInputFieldControl', defineAsyncComponent(() => import('../components/form/MInputFieldControl.vue')))
|
|
21
|
+
app.component('MInputLabel', defineAsyncComponent(() => import('../components/form/MInputLabel.vue')))
|
|
22
|
+
app.component('MMobile', defineAsyncComponent(() => import('../components/form/MMobile.vue')))
|
|
23
|
+
app.component('MOptions', defineAsyncComponent(() => import('../components/form/MOptions.vue')))
|
|
24
|
+
app.component('MOtp', defineAsyncComponent(() => import('../components/form/MOtp.vue')))
|
|
25
|
+
app.component('MPassword', defineAsyncComponent(() => import('../components/form/MPassword.vue')))
|
|
26
|
+
app.component('MPicker', defineAsyncComponent(() => import('../components/form/MPicker.vue')))
|
|
27
|
+
app.component('MRadio', defineAsyncComponent(() => import('../components/form/MRadio.vue')))
|
|
28
|
+
app.component('MSelect', defineAsyncComponent(() => import('../components/form/MSelect.vue')))
|
|
29
|
+
app.component('MTime', defineAsyncComponent(() => import('../components/form/MTime.vue')))
|
|
30
|
+
app.component('MToggle', defineAsyncComponent(() => import('../components/form/MToggle.vue')))
|
|
31
|
+
app.component('MUploader', defineAsyncComponent(() => import('../components/form/MUploader.vue')))
|
|
32
|
+
|
|
33
|
+
// Grid.
|
|
34
|
+
app.component('MBlock', defineAsyncComponent(() => import('../components/grid/MBlock.vue')))
|
|
35
|
+
app.component('MCol', defineAsyncComponent(() => import('../components/grid/MCol.vue')))
|
|
36
|
+
app.component('MColumn', defineAsyncComponent(() => import('../components/grid/MColumn.vue')))
|
|
37
|
+
app.component('MContainer', defineAsyncComponent(() => import('../components/grid/MContainer.vue')))
|
|
38
|
+
app.component('MHelpRow', defineAsyncComponent(() => import('../components/grid/MHelpRow.vue')))
|
|
39
|
+
app.component('MRow', defineAsyncComponent(() => import('../components/grid/MRow.vue')))
|
|
40
|
+
|
|
41
|
+
// Typography.
|
|
42
|
+
app.component('MTypingString', defineAsyncComponent(() => import('../components/typography/MTypingString.vue')))
|
|
43
|
+
|
|
44
|
+
// Transitions.
|
|
45
|
+
app.component('MTransition', defineAsyncComponent(() => import('../components/transition/MTransition.vue')))
|
|
46
|
+
app.component('MFadeTransition', defineAsyncComponent(() => import('../components/transition/MFadeTransition.vue')))
|
|
47
|
+
app.component('MFadeXTransition', defineAsyncComponent(() => import('../components/transition/MFadeXTransition.vue')))
|
|
48
|
+
|
|
49
|
+
// Modals.
|
|
50
|
+
app.component('MDialog', defineAsyncComponent(() => import('../components/modal/MDialog.vue')))
|
|
51
|
+
app.component('MModalMenu', defineAsyncComponent(() => import('../components/modal/MModalMenu.vue')))
|
|
52
|
+
app.component('MTooltip', defineAsyncComponent(() => import('../components/modal/MTooltip.vue')))
|
|
53
|
+
|
|
54
|
+
// Datatable
|
|
55
|
+
app.component('MDatatable', defineAsyncComponent(() => import('../components/datatable/MDatatable.vue')))
|
|
56
|
+
app.component('MDtAvatar', defineAsyncComponent(() => import('../components/datatable/MDtAvatar.vue')))
|
|
57
|
+
app.component('MDtBtn', defineAsyncComponent(() => import('../components/datatable/MDtBtn.vue')))
|
|
58
|
+
app.component('MDtContextmenuItems', defineAsyncComponent(() => import('../components/datatable/MDtContextmenuItems.vue')))
|
|
59
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { myth } from '../utils'
|
|
2
|
+
import type { InstallOptions } from '../types'
|
|
3
|
+
|
|
4
|
+
export const defineOptions = (options: InstallOptions) => {
|
|
5
|
+
if (options.rounded !== undefined) {
|
|
6
|
+
myth.rounded.value = options.rounded
|
|
7
|
+
}
|
|
8
|
+
if (options.shadow !== undefined) {
|
|
9
|
+
myth.shadow.value = options.shadow
|
|
10
|
+
}
|
|
11
|
+
if (options.fluid !== undefined) {
|
|
12
|
+
myth.setFluid(options.fluid)
|
|
13
|
+
}
|
|
14
|
+
if (options.size !== undefined) {
|
|
15
|
+
myth.setSize(options.size)
|
|
16
|
+
}
|
|
17
|
+
if (options.props !== undefined) {
|
|
18
|
+
myth.withProps(options.props)
|
|
19
|
+
}
|
|
20
|
+
if (options.rules !== undefined) {
|
|
21
|
+
myth.withRules(options.rules)
|
|
22
|
+
}
|
|
23
|
+
if (options.themeBtn !== undefined) {
|
|
24
|
+
myth.themeBtn.value = options.themeBtn
|
|
25
|
+
}
|
|
26
|
+
if (options.themeInput !== undefined) {
|
|
27
|
+
myth.setThemeInput(options.themeInput)
|
|
28
|
+
}
|
|
29
|
+
if (options.baseUrl !== undefined) {
|
|
30
|
+
myth.baseUrl.value = options.baseUrl
|
|
31
|
+
}
|
|
32
|
+
if (options.api !== undefined) {
|
|
33
|
+
myth.setApi(options.api)
|
|
34
|
+
}
|
|
35
|
+
if (options.mAxios !== undefined) {
|
|
36
|
+
myth.mAxios.value = options.mAxios
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/utils/Str.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import lodash from 'lodash'
|
|
10
|
-
import inflection from 'lodash-inflection'
|
|
11
|
-
lodash.mixin(inflection)
|
|
10
|
+
// import inflection from 'lodash-inflection'
|
|
11
|
+
// lodash.mixin(inflection)
|
|
12
12
|
|
|
13
13
|
export const Str = {
|
|
14
14
|
/**
|
|
@@ -81,7 +81,7 @@ export const Str = {
|
|
|
81
81
|
return lodash.pascalCase(string)
|
|
82
82
|
},
|
|
83
83
|
pluralize (string?: string): string {
|
|
84
|
-
return lodash.pluralize(string)
|
|
84
|
+
return lodash.pluralize?.(string)
|
|
85
85
|
},
|
|
86
86
|
singular (string?: string): string {
|
|
87
87
|
return lodash.singularize(string)
|
package/src/utils/vue-plugin.ts
CHANGED
|
@@ -7,48 +7,20 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { App } from 'vue'
|
|
10
|
-
import { defineAsyncComponent } from 'vue'
|
|
11
10
|
import { name, version } from '../../package.json'
|
|
12
|
-
import { myth } from './myth'
|
|
13
11
|
|
|
14
12
|
import type { InstallOptions } from '../types'
|
|
13
|
+
import { defineOptions } from '../plugin/defineOptions'
|
|
14
|
+
import { defineAsyncComponents } from '../plugin/defineAsyncComponents'
|
|
15
|
+
import { defineComponents } from '../plugin/defineComponents'
|
|
15
16
|
|
|
16
17
|
function install (app: App, options: InstallOptions = {}) {
|
|
17
|
-
|
|
18
|
-
if (options
|
|
19
|
-
|
|
18
|
+
defineOptions(options)
|
|
19
|
+
if (options?.asyncComponents) {
|
|
20
|
+
defineAsyncComponents(app)
|
|
21
|
+
} else {
|
|
22
|
+
defineComponents(app)
|
|
20
23
|
}
|
|
21
|
-
if (options.shadow !== undefined) {
|
|
22
|
-
myth.shadow.value = options.shadow
|
|
23
|
-
}
|
|
24
|
-
if (options.fluid !== undefined) {
|
|
25
|
-
myth.setFluid(options.fluid)
|
|
26
|
-
}
|
|
27
|
-
if (options.size !== undefined) {
|
|
28
|
-
myth.setSize(options.size)
|
|
29
|
-
}
|
|
30
|
-
if (options.props !== undefined) {
|
|
31
|
-
myth.withProps(options.props)
|
|
32
|
-
}
|
|
33
|
-
if (options.rules !== undefined) {
|
|
34
|
-
myth.withRules(options.rules)
|
|
35
|
-
}
|
|
36
|
-
if (options.themeBtn !== undefined) {
|
|
37
|
-
myth.themeBtn.value = options.themeBtn
|
|
38
|
-
}
|
|
39
|
-
if (options.themeInput !== undefined) {
|
|
40
|
-
myth.setThemeInput(options.themeInput)
|
|
41
|
-
}
|
|
42
|
-
if (options.baseUrl !== undefined) {
|
|
43
|
-
myth.baseUrl.value = options.baseUrl
|
|
44
|
-
}
|
|
45
|
-
if (options.api !== undefined) {
|
|
46
|
-
myth.setApi(options.api)
|
|
47
|
-
}
|
|
48
|
-
if (options.mAxios !== undefined) {
|
|
49
|
-
myth.mAxios.value = options.mAxios
|
|
50
|
-
}
|
|
51
|
-
|
|
52
24
|
// const importList = import.meta.glob('./components/**/*.vue')
|
|
53
25
|
// const startIndex = '/components/'.length
|
|
54
26
|
// const routes = Object.keys(importList).map(key => {
|
|
@@ -61,62 +33,6 @@ function install (app: App, options: InstallOptions = {}) {
|
|
|
61
33
|
// for (const routesKey in routes) {
|
|
62
34
|
// console.log(routesKey)
|
|
63
35
|
// }
|
|
64
|
-
|
|
65
|
-
// Form.
|
|
66
|
-
app.component('MAvatarViewer', defineAsyncComponent(() => import('../components/form/MAvatarViewer.vue')))
|
|
67
|
-
app.component('MAxios', defineAsyncComponent(() => import('../components/form/MAxios.vue')))
|
|
68
|
-
app.component('MBtn', defineAsyncComponent(() => import('../components/form/MBtn.vue')))
|
|
69
|
-
app.component('MCheckbox', defineAsyncComponent(() => import('../components/form/MCheckbox.vue')))
|
|
70
|
-
app.component('MCkeditor', defineAsyncComponent(() => import('../components/form/MCkeditor.vue')))
|
|
71
|
-
app.component('MColor', defineAsyncComponent(() => import('../components/form/MColor.vue')))
|
|
72
|
-
app.component('MDate', defineAsyncComponent(() => import('../components/form/MDate.vue')))
|
|
73
|
-
app.component('MEditor', defineAsyncComponent(() => import('../components/form/MEditor.vue')))
|
|
74
|
-
app.component('MEmail', defineAsyncComponent(() => import('../components/form/MEmail.vue')))
|
|
75
|
-
app.component('MField', defineAsyncComponent(() => import('../components/form/MField.vue')))
|
|
76
|
-
app.component('MFile', defineAsyncComponent(() => import('../components/form/MFile.vue')))
|
|
77
|
-
app.component('MForm', defineAsyncComponent(() => import('../components/form/MForm.vue')))
|
|
78
|
-
app.component('MHidden', defineAsyncComponent(() => import('../components/form/MHidden.vue')))
|
|
79
|
-
app.component('MHiddenInput', defineAsyncComponent(() => import('../components/form/MHiddenInput.vue')))
|
|
80
|
-
app.component('MInput', defineAsyncComponent(() => import('../components/form/MInput.vue')))
|
|
81
|
-
app.component('MInputFieldControl', defineAsyncComponent(() => import('../components/form/MInputFieldControl.vue')))
|
|
82
|
-
app.component('MInputLabel', defineAsyncComponent(() => import('../components/form/MInputLabel.vue')))
|
|
83
|
-
app.component('MMobile', defineAsyncComponent(() => import('../components/form/MMobile.vue')))
|
|
84
|
-
app.component('MOptions', defineAsyncComponent(() => import('../components/form/MOptions.vue')))
|
|
85
|
-
app.component('MOtp', defineAsyncComponent(() => import('../components/form/MOtp.vue')))
|
|
86
|
-
app.component('MPassword', defineAsyncComponent(() => import('../components/form/MPassword.vue')))
|
|
87
|
-
app.component('MPicker', defineAsyncComponent(() => import('../components/form/MPicker.vue')))
|
|
88
|
-
app.component('MRadio', defineAsyncComponent(() => import('../components/form/MRadio.vue')))
|
|
89
|
-
app.component('MSelect', defineAsyncComponent(() => import('../components/form/MSelect.vue')))
|
|
90
|
-
app.component('MTime', defineAsyncComponent(() => import('../components/form/MTime.vue')))
|
|
91
|
-
app.component('MToggle', defineAsyncComponent(() => import('../components/form/MToggle.vue')))
|
|
92
|
-
app.component('MUploader', defineAsyncComponent(() => import('../components/form/MUploader.vue')))
|
|
93
|
-
|
|
94
|
-
// Grid.
|
|
95
|
-
app.component('MBlock', defineAsyncComponent(() => import('../components/grid/MBlock.vue')))
|
|
96
|
-
app.component('MCol', defineAsyncComponent(() => import('../components/grid/MCol.vue')))
|
|
97
|
-
app.component('MColumn', defineAsyncComponent(() => import('../components/grid/MColumn.vue')))
|
|
98
|
-
app.component('MContainer', defineAsyncComponent(() => import('../components/grid/MContainer.vue')))
|
|
99
|
-
app.component('MHelpRow', defineAsyncComponent(() => import('../components/grid/MHelpRow.vue')))
|
|
100
|
-
app.component('MRow', defineAsyncComponent(() => import('../components/grid/MRow.vue')))
|
|
101
|
-
|
|
102
|
-
// Typography.
|
|
103
|
-
app.component('MTypingString', defineAsyncComponent(() => import('../components/typography/MTypingString.vue')))
|
|
104
|
-
|
|
105
|
-
// Transitions.
|
|
106
|
-
app.component('MTransition', defineAsyncComponent(() => import('../components/transition/MTransition.vue')))
|
|
107
|
-
app.component('MFadeTransition', defineAsyncComponent(() => import('../components/transition/MFadeTransition.vue')))
|
|
108
|
-
app.component('MFadeXTransition', defineAsyncComponent(() => import('../components/transition/MFadeXTransition.vue')))
|
|
109
|
-
|
|
110
|
-
// Modals.
|
|
111
|
-
app.component('MDialog', defineAsyncComponent(() => import('../components/modal/MDialog.vue')))
|
|
112
|
-
app.component('MModalMenu', defineAsyncComponent(() => import('../components/modal/MModalMenu.vue')))
|
|
113
|
-
app.component('MTooltip', defineAsyncComponent(() => import('../components/modal/MTooltip.vue')))
|
|
114
|
-
|
|
115
|
-
// Datatable
|
|
116
|
-
app.component('MDatatable', defineAsyncComponent(() => import('../components/datatable/MDatatable.vue')))
|
|
117
|
-
app.component('MDtAvatar', defineAsyncComponent(() => import('../components/datatable/MDtAvatar.vue')))
|
|
118
|
-
app.component('MDtBtn', defineAsyncComponent(() => import('../components/datatable/MDtBtn.vue')))
|
|
119
|
-
app.component('MDtContextmenuItems', defineAsyncComponent(() => import('../components/datatable/MDtContextmenuItems.vue')))
|
|
120
36
|
}
|
|
121
37
|
|
|
122
38
|
export {
|