@mythpe/quasar-ui-qui 0.5.0 → 0.5.2
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/README.md +9 -6
- package/dist/components/MBtn/MBtn.d.ts +35 -0
- package/dist/components/grid/MColumn/MColumn.d.ts +28 -0
- package/dist/components/grid/MContainer/MContainer.d.ts +23 -0
- package/dist/components/grid/MGrid.d.ts +12 -0
- package/dist/components/grid/MRow/MRow.d.ts +11 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/composables/useMyth.d.ts +6765 -0
- package/dist/composables/useMythMeta.d.ts +30 -0
- package/dist/config/config.d.ts +3411 -0
- package/dist/config/grid.d.ts +6 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/index.common.js +1 -0
- package/dist/index.css +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/index.umd.js +1 -0
- package/dist/types/config.d.ts +69 -0
- package/dist/types/helpers.d.ts +14 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/vue-prop-types.d.ts +5 -0
- package/dist/utils/helpers.d.ts +40 -0
- package/dist/utils/icons.d.ts +4 -0
- package/dist/utils/index.d.ts +21 -0
- package/dist/utils/str.d.ts +67 -0
- package/dist/utils/vee-rules.d.ts +17 -0
- package/dist/vue-plugin.d.ts +16 -0
- package/package.json +31 -20
- package/rREADME.md +0 -147
- package/src/components/MBtn/MBtn.ts +0 -38
- package/src/components/MBtn/MBtn.vue +0 -142
- package/src/components/grid/MColumn/MColumn.ts +0 -15
- package/src/components/grid/MColumn/MColumn.vue +0 -28
- package/src/components/grid/MContainer/MContainer.ts +0 -39
- package/src/components/grid/MContainer/MContainer.vue +0 -66
- package/src/components/grid/MGrid.ts +0 -16
- package/src/components/grid/MGrid.vue +0 -47
- package/src/components/grid/MRow/MRow.ts +0 -15
- package/src/components/grid/MRow/MRow.vue +0 -28
- package/src/components/index.ts +0 -30
- package/src/composables/useMyth.ts +0 -93
- package/src/composables/useMythMeta.ts +0 -40
- package/src/config/config.ts +0 -16
- package/src/config/grid.ts +0 -10
- package/src/config/index.ts +0 -2
- package/src/css/components/m-btn.scss +0 -13
- package/src/css/index.scss +0 -9
- package/src/env.d.ts +0 -14
- package/src/index.common.js +0 -1
- package/src/index.ts +0 -4
- package/src/index.umd.js +0 -2
- package/src/shims-myth.d.ts +0 -6
- package/src/shims-vue.d.ts +0 -22
- package/src/types/config.ts +0 -136
- package/src/types/helpers.ts +0 -21
- package/src/types/index.ts +0 -9
- package/src/types/vue-prop-types.ts +0 -13
- package/src/utils/helpers.ts +0 -446
- package/src/utils/icons.ts +0 -4
- package/src/utils/index.ts +0 -77
- package/src/utils/str.ts +0 -237
- package/src/utils/vee-rules.ts +0 -40
- package/src/vue-plugin.ts +0 -76
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { computed, inject, reactive, readonly, ref } from 'vue'
|
|
2
|
-
import { mythConfig, MythInjectionKey } from '../config/config'
|
|
3
|
-
import { useI18n } from 'vue-i18n'
|
|
4
|
-
import type { MythConfig } from '../types/config'
|
|
5
|
-
import * as str from '../utils/str'
|
|
6
|
-
import * as helpers from '../utils/helpers'
|
|
7
|
-
|
|
8
|
-
export function useMyth() {
|
|
9
|
-
const { t, te } = useI18n({ useScope: 'global' })
|
|
10
|
-
const MythConfig = inject<MythConfig>(MythInjectionKey, mythConfig)
|
|
11
|
-
const config = readonly(MythConfig)
|
|
12
|
-
const name = ref('MyTh')
|
|
13
|
-
const version = computed(() => MythConfig.version)
|
|
14
|
-
const loadingOptions = computed(() => MythConfig.loadingOptions)
|
|
15
|
-
|
|
16
|
-
const theme = reactive(MythConfig.theme)
|
|
17
|
-
const btnStyle = computed(() => MythConfig.theme.btn)
|
|
18
|
-
const inputStyle = computed(() => MythConfig.theme.input)
|
|
19
|
-
const componentProps = computed(() => MythConfig.component)
|
|
20
|
-
const __ = (key: any, ...rest: any[]): string => {
|
|
21
|
-
key = key ?? ''
|
|
22
|
-
const m1 = key.startsWith(':') && key.endsWith(':')
|
|
23
|
-
const m2 = key.startsWith("{'") && key.endsWith("'}")
|
|
24
|
-
if ((m1 || m2) && key.length > 2) {
|
|
25
|
-
if (m1) {
|
|
26
|
-
return key.slice(1, -1)
|
|
27
|
-
}
|
|
28
|
-
return key.slice(2, -2)
|
|
29
|
-
}
|
|
30
|
-
const attrKey = `attributes.${key}`
|
|
31
|
-
if (te(attrKey)) {
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
33
|
-
// @ts-ignore
|
|
34
|
-
return t(attrKey, ...rest)
|
|
35
|
-
}
|
|
36
|
-
if (te(key)) {
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
return t(key, ...rest)
|
|
40
|
-
}
|
|
41
|
-
return t(key)
|
|
42
|
-
}
|
|
43
|
-
const pageTitle = (name: string, num?: number) => {
|
|
44
|
-
num ??= 2
|
|
45
|
-
const singular = str.singular(name)
|
|
46
|
-
const pascalSingular = str.pascalCase(name)
|
|
47
|
-
const snakeSingular = str.snakeCase(name)
|
|
48
|
-
const camelSingular = str.camelCase(name)
|
|
49
|
-
const kebabSingular = str.kebabCase(name)
|
|
50
|
-
const plural = str.plural(name)
|
|
51
|
-
const pascalPlural = str.pascalCase(plural)
|
|
52
|
-
const snakePlural = str.snakeCase(plural)
|
|
53
|
-
const camelPlural = str.camelCase(plural)
|
|
54
|
-
const kebabPlural = str.kebabCase(plural)
|
|
55
|
-
const names = helpers.uniq<string>([
|
|
56
|
-
name,
|
|
57
|
-
singular,
|
|
58
|
-
pascalSingular,
|
|
59
|
-
snakeSingular,
|
|
60
|
-
camelSingular,
|
|
61
|
-
kebabSingular,
|
|
62
|
-
plural,
|
|
63
|
-
pascalPlural,
|
|
64
|
-
snakePlural,
|
|
65
|
-
camelPlural,
|
|
66
|
-
kebabPlural
|
|
67
|
-
])
|
|
68
|
-
const keys = helpers.uniq<string>(['routes', 'attributes'])
|
|
69
|
-
for (const k of keys) {
|
|
70
|
-
for (const n of names) {
|
|
71
|
-
if (te(`${k}.${n}`)) {
|
|
72
|
-
return __(`${k}.${n}`, num)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return __(name)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
config,
|
|
81
|
-
name,
|
|
82
|
-
version,
|
|
83
|
-
loadingOptions,
|
|
84
|
-
theme,
|
|
85
|
-
btnStyle,
|
|
86
|
-
inputStyle,
|
|
87
|
-
componentProps,
|
|
88
|
-
__,
|
|
89
|
-
pageTitle
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default useMyth
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useMeta } from 'quasar'
|
|
2
|
-
import type { MaybeRefOrGetter } from 'vue'
|
|
3
|
-
import { toValue } from 'vue'
|
|
4
|
-
|
|
5
|
-
type MetaTagOptions = Record<string, any> & {
|
|
6
|
-
template?: (attributeValue: string) => string
|
|
7
|
-
}
|
|
8
|
-
export interface MetaOptions {
|
|
9
|
-
meta?: { [name: string]: MetaTagOptions }
|
|
10
|
-
link?: { [name: string]: Record<string, string> }
|
|
11
|
-
script?: { [name: string]: Record<string, string> }
|
|
12
|
-
htmlAttr?: { [name: string]: string | undefined }
|
|
13
|
-
bodyAttr?: { [name: string]: string | undefined }
|
|
14
|
-
noscript?: { [name: string]: string }
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Initializes global meta tags that bind dynamically to your mythConfig state.
|
|
18
|
-
* Use all the variables and store them in one place for the application.
|
|
19
|
-
*/
|
|
20
|
-
export function useMythMeta(
|
|
21
|
-
appName?: MaybeRefOrGetter<string>,
|
|
22
|
-
pageTitle?: MaybeRefOrGetter<string>,
|
|
23
|
-
metaOptions?: MaybeRefOrGetter<MetaOptions>
|
|
24
|
-
): void {
|
|
25
|
-
useMeta(() => {
|
|
26
|
-
const rawAppName = toValue(appName) || 'MyTh'
|
|
27
|
-
const rawPageTitle = toValue(pageTitle) || ''
|
|
28
|
-
const rawOptions = toValue(metaOptions) || {}
|
|
29
|
-
return {
|
|
30
|
-
title: rawPageTitle,
|
|
31
|
-
titleTemplate: (title: string) => {
|
|
32
|
-
if (!title || title === rawAppName) {
|
|
33
|
-
return rawAppName
|
|
34
|
-
}
|
|
35
|
-
return `${rawAppName} | ${title}`
|
|
36
|
-
},
|
|
37
|
-
...rawOptions
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
}
|
package/src/config/config.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type InjectionKey, reactive } from 'vue'
|
|
2
|
-
import { version } from '../../package.json'
|
|
3
|
-
import type { MythConfig } from '../types/config'
|
|
4
|
-
|
|
5
|
-
export const mythConfig = reactive<MythConfig>({
|
|
6
|
-
version,
|
|
7
|
-
theme: {
|
|
8
|
-
btn: {
|
|
9
|
-
noCaps: true
|
|
10
|
-
},
|
|
11
|
-
input: {}
|
|
12
|
-
},
|
|
13
|
-
component: {},
|
|
14
|
-
loadingOptions: undefined
|
|
15
|
-
})
|
|
16
|
-
export const MythInjectionKey = Symbol.for('_m_') as unknown as InjectionKey<MythConfig>
|
package/src/config/grid.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { InjectionKey } from 'vue'
|
|
2
|
-
import type { MContainerProps } from '../components/grid/MContainer/MContainer'
|
|
3
|
-
import type { GridGutterSize, GridGutterType } from '../types/config'
|
|
4
|
-
|
|
5
|
-
export const MContainerInjectionKey = Symbol.for(
|
|
6
|
-
'_m__m-container'
|
|
7
|
-
) as unknown as InjectionKey<MContainerProps>
|
|
8
|
-
|
|
9
|
-
export const DEFAULT_GRID_SIZE: GridGutterSize = 'md'
|
|
10
|
-
export const DEFAULT_GRID_TYPE: GridGutterType = 'gutter'
|
package/src/config/index.ts
DELETED
package/src/css/index.scss
DELETED
package/src/env.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
declare namespace NodeJS {
|
|
2
|
-
interface ProcessEnv {
|
|
3
|
-
DEV: boolean
|
|
4
|
-
PROD: boolean
|
|
5
|
-
DEBUGGING: boolean
|
|
6
|
-
CLIENT: boolean
|
|
7
|
-
SERVER: boolean
|
|
8
|
-
MODE: 'spa' | 'ssr' | 'pwa' | 'cordova' | 'capacitor'
|
|
9
|
-
NODE_ENV: 'development' | 'production'
|
|
10
|
-
TARGET: 'ios' | 'android' | 'chrome' | 'firefox' | undefined
|
|
11
|
-
VUE_ROUTER_MODE: 'hash' | 'history' | 'abstract' | undefined
|
|
12
|
-
VUE_ROUTER_BASE: string | undefined
|
|
13
|
-
}
|
|
14
|
-
}
|
package/src/index.common.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './vue-plugin'
|
package/src/index.ts
DELETED
package/src/index.umd.js
DELETED
package/src/shims-myth.d.ts
DELETED
package/src/shims-vue.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import 'quasar'
|
|
2
|
-
import 'vue'
|
|
3
|
-
import '@vue/runtime-core'
|
|
4
|
-
import type { MythGlobalComponents } from './components'
|
|
5
|
-
|
|
6
|
-
declare module '*.vue' {
|
|
7
|
-
import type { DefineComponent } from 'vue'
|
|
8
|
-
const component: DefineComponent
|
|
9
|
-
export default component
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
declare module 'vue' {
|
|
13
|
-
export interface GlobalComponents extends MythGlobalComponents {}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare module '@vue/runtime-dom' {
|
|
17
|
-
export interface GlobalComponents extends MythGlobalComponents {}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
declare module '@vue/runtime-core' {
|
|
21
|
-
export interface GlobalComponents extends MythGlobalComponents {}
|
|
22
|
-
}
|
package/src/types/config.ts
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import type { MBtnProps } from '../components'
|
|
2
|
-
import type { NamedColor, QBtnProps, QInputProps } from 'quasar'
|
|
3
|
-
import type { ClassProp, StyleProp } from './vue-prop-types'
|
|
4
|
-
|
|
5
|
-
export type GridType = 'column' | 'row'
|
|
6
|
-
/**
|
|
7
|
-
* Standard size options with string extension capability
|
|
8
|
-
*/
|
|
9
|
-
export type GridGutterSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'none' | string
|
|
10
|
-
export type GridGutterType = 'col' | 'gutter'
|
|
11
|
-
|
|
12
|
-
export type ThemeBtn = Partial<
|
|
13
|
-
Pick<
|
|
14
|
-
QBtnProps,
|
|
15
|
-
| 'size'
|
|
16
|
-
| 'outline'
|
|
17
|
-
| 'flat'
|
|
18
|
-
| 'unelevated'
|
|
19
|
-
| 'rounded'
|
|
20
|
-
| 'push'
|
|
21
|
-
| 'square'
|
|
22
|
-
| 'glossy'
|
|
23
|
-
| 'padding'
|
|
24
|
-
| 'color'
|
|
25
|
-
| 'textColor'
|
|
26
|
-
| 'dense'
|
|
27
|
-
| 'ripple'
|
|
28
|
-
| 'round'
|
|
29
|
-
| 'noCaps'
|
|
30
|
-
>
|
|
31
|
-
>
|
|
32
|
-
|
|
33
|
-
export type ThemeInput = Partial<
|
|
34
|
-
Pick<
|
|
35
|
-
QInputProps,
|
|
36
|
-
| 'labelColor'
|
|
37
|
-
| 'color'
|
|
38
|
-
| 'bgColor'
|
|
39
|
-
| 'dark'
|
|
40
|
-
| 'filled'
|
|
41
|
-
| 'outlined'
|
|
42
|
-
| 'borderless'
|
|
43
|
-
| 'standout'
|
|
44
|
-
| 'hideBottomSpace'
|
|
45
|
-
| 'rounded'
|
|
46
|
-
| 'square'
|
|
47
|
-
| 'dense'
|
|
48
|
-
| 'itemAligned'
|
|
49
|
-
// | 'inputClass'
|
|
50
|
-
// | 'inputStyle'
|
|
51
|
-
>
|
|
52
|
-
> & {
|
|
53
|
-
/**
|
|
54
|
-
* Class definitions to be attributed to the underlying input tag
|
|
55
|
-
*/
|
|
56
|
-
inputClass?: ClassProp | undefined
|
|
57
|
-
/**
|
|
58
|
-
* Style definitions to be attributed to the underlying input tag
|
|
59
|
-
*/
|
|
60
|
-
inputStyle?: StyleProp | undefined
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface ThemeConfig {
|
|
64
|
-
fluid?: boolean
|
|
65
|
-
dense?: boolean
|
|
66
|
-
gutterSize?: GridGutterSize | undefined
|
|
67
|
-
gutterType?: GridGutterType | undefined
|
|
68
|
-
btn: ThemeBtn
|
|
69
|
-
input: ThemeInput
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface ComponentConfig {
|
|
73
|
-
btn?: Omit<MBtnProps, 'onClick' | keyof ThemeBtn | 'label' | 'href' | 'to' | 'type' | 'target'>
|
|
74
|
-
input?: Omit<MBtnProps, 'onClick' | keyof ThemeInput>
|
|
75
|
-
}
|
|
76
|
-
export type SpinnerType =
|
|
77
|
-
| 'audio'
|
|
78
|
-
| 'ball'
|
|
79
|
-
| 'bars'
|
|
80
|
-
| 'box'
|
|
81
|
-
| 'clock'
|
|
82
|
-
| 'comment'
|
|
83
|
-
| 'cube'
|
|
84
|
-
| 'dots'
|
|
85
|
-
| 'facebook'
|
|
86
|
-
| 'gears'
|
|
87
|
-
| 'grid'
|
|
88
|
-
| 'hearts'
|
|
89
|
-
| 'hourglass'
|
|
90
|
-
| 'infinity'
|
|
91
|
-
| 'ios'
|
|
92
|
-
| 'orbit'
|
|
93
|
-
| 'oval'
|
|
94
|
-
| 'pie'
|
|
95
|
-
| 'puff'
|
|
96
|
-
| 'radio'
|
|
97
|
-
| 'rings'
|
|
98
|
-
| 'tail'
|
|
99
|
-
| 'spinner'
|
|
100
|
-
export type LoadingOptions = {
|
|
101
|
-
/**
|
|
102
|
-
* Type of loading indicator
|
|
103
|
-
*/
|
|
104
|
-
type: SpinnerType
|
|
105
|
-
/**
|
|
106
|
-
* Color of the loading indicator
|
|
107
|
-
*/
|
|
108
|
-
color?: NamedColor
|
|
109
|
-
/**
|
|
110
|
-
* Size of the loading indicator
|
|
111
|
-
*/
|
|
112
|
-
size?: string
|
|
113
|
-
/**
|
|
114
|
-
* Whether to show loading text
|
|
115
|
-
*/
|
|
116
|
-
label?: boolean
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface MythConfig {
|
|
120
|
-
/**
|
|
121
|
-
* Version.
|
|
122
|
-
*/
|
|
123
|
-
readonly version: string
|
|
124
|
-
/**
|
|
125
|
-
* Theme configuration.
|
|
126
|
-
*/
|
|
127
|
-
theme: ThemeConfig
|
|
128
|
-
/**
|
|
129
|
-
* Component props.
|
|
130
|
-
*/
|
|
131
|
-
component: ComponentConfig
|
|
132
|
-
/**
|
|
133
|
-
* q-btn loading slot.
|
|
134
|
-
*/
|
|
135
|
-
loadingOptions?: LoadingOptions
|
|
136
|
-
}
|
package/src/types/helpers.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { AxiosRequestConfig, AxiosResponse } from 'axios'
|
|
2
|
-
|
|
3
|
-
export type UrlType = string | number | any
|
|
4
|
-
export type ParamsType = Record<string, any> | FormData | object
|
|
5
|
-
export type ConfigType = AxiosRequestConfig
|
|
6
|
-
export type DownloadFromResponse = {
|
|
7
|
-
status: boolean
|
|
8
|
-
response: AxiosResponse
|
|
9
|
-
}
|
|
10
|
-
export type DownloadFromResponseCode =
|
|
11
|
-
| 'no_response'
|
|
12
|
-
| 'no_file_name'
|
|
13
|
-
| 'no_file_url'
|
|
14
|
-
| 'unknown'
|
|
15
|
-
| string
|
|
16
|
-
export type DownloadFromResponseError = {
|
|
17
|
-
code: DownloadFromResponseCode
|
|
18
|
-
status: boolean
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export type HelpersStubSchema = object
|
package/src/types/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'vue'
|
|
2
|
-
|
|
3
|
-
export type ClassValueNoArray = false | null | undefined | string | Record<string, any>
|
|
4
|
-
export type ClassProp =
|
|
5
|
-
| false
|
|
6
|
-
| null
|
|
7
|
-
| undefined
|
|
8
|
-
| string
|
|
9
|
-
| Record<string, any>
|
|
10
|
-
| Array<ClassValueNoArray>
|
|
11
|
-
|
|
12
|
-
export type StyleValueNoArray = false | null | undefined | string | CSSProperties
|
|
13
|
-
export type StyleProp = false | null | undefined | string | CSSProperties | StyleValueNoArray[]
|