@mythpe/quasar-ui-qui 0.0.16 → 0.0.18

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/jsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": ".",
4
+ "paths": {
5
+ "ui/*": [
6
+ "src/*"
7
+ ]
8
+ }
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": "MyTh Ahmed Faiz <mythpe@gmail.com>",
6
6
  "email": "mythpe@gmail.com",
7
7
  "mobile": "+966590470092",
8
8
  "license": "MIT",
9
- "module": "src/index.esm.js",
9
+ "module": "src/index.aaaesm.js",
10
10
  "main": "src/index.common.js",
11
11
  "type": "module",
12
12
  "scripts": {
@@ -23,10 +23,13 @@
23
23
  "dependencies": {
24
24
  "lodash": "^4.17.21",
25
25
  "typed.js": "^2.1.0",
26
- "vee-validate": "^4.14.7",
27
- "vue-i18n": "^10.0.4"
26
+ "vee-validate": "^4.14.0",
27
+ "@vee-validate/i18n": "^4.14.0",
28
+ "@vee-validate/rules": "^4.14.0",
29
+ "vue-i18n": "^10.0.0"
28
30
  },
29
31
  "devDependencies": {
32
+ "lodash": "^4.17.21",
30
33
  "@quasar/app-webpack": "^3.13.0",
31
34
  "@quasar/extras": "^1.16.4",
32
35
  "@rollup/plugin-buble": "^0.21.3",
@@ -3,10 +3,10 @@ import type { MBtnProps } from '../../types'
3
3
  import { useI18n } from 'vue-i18n'
4
4
  import { computed } from 'vue'
5
5
  import { extend } from 'quasar'
6
- import { MythOptions } from '../../utils'
6
+ import { myth } from '../../myth'
7
7
 
8
8
  const props = defineProps<MBtnProps>()
9
- const options = computed(() => MythOptions.defaults.value.btn ?? {})
9
+ const options = computed(() => myth.options.value.btn ?? {})
10
10
  const { t, te } = useI18n({ useScope: 'global' })
11
11
  const getLabel = computed(() => {
12
12
  if (props.label !== undefined) {
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import type { MBlockProps } from '../../types'
3
3
  import { computed } from 'vue'
4
- import MythOptions from '../../utils'
4
+ import MythOptions from '../../myth'
5
5
  import { extend } from 'quasar'
6
6
 
7
7
  interface Props {
@@ -15,7 +15,7 @@ const props = withDefaults(defineProps<Props>(), {
15
15
  rounded: !1,
16
16
  shadow: 'none'
17
17
  })
18
- const block = computed(() => MythOptions.defaults.value.block ?? {})
18
+ const block = computed(() => MythOptions.options.value.block ?? {})
19
19
  const options = computed<Props>(() => extend(!0, { ...props }, block.value))
20
20
  defineOptions({
21
21
  name: 'MBlock',
@@ -45,6 +45,7 @@ const classes = computed(() => {
45
45
  list.push('col')
46
46
  }
47
47
  return uniq(list)
48
+ // return list
48
49
  })
49
50
  defineOptions({
50
51
  name: 'MCol',
@@ -8,7 +8,7 @@
8
8
 
9
9
  <script lang="ts" setup>
10
10
  import type { MContainerProps } from '../../types'
11
- import MythOptions from '../../utils'
11
+ import MythOptions from '../../myth'
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.defaults.value?.style ?? {})
21
+ const styles = computed(() => MythOptions.options.value?.style ?? {})
22
22
  const sizeProp = computed(() => {
23
23
  if (props.size !== undefined) {
24
24
  return props.size
@@ -4,7 +4,7 @@
4
4
  >
5
5
  import type { MRowProps } from '../../types'
6
6
  import { computed } from 'vue'
7
- import MythOptions from '../../utils'
7
+ import MythOptions from '../../myth'
8
8
 
9
9
  interface Props {
10
10
  gutter?: MRowProps['gutter'];
@@ -12,7 +12,7 @@ interface Props {
12
12
  }
13
13
 
14
14
  const props = defineProps<Props>()
15
- const defSize = computed<string>(() => MythOptions.defaults.value.style?.gutters || '')
15
+ const defSize = computed<string>(() => MythOptions.options.value.style?.gutters || '')
16
16
  const gutterSize = computed<string>(() => props.gutter === !0 ? defSize.value : (props.gutter || defSize.value))
17
17
  const colSize = computed<string>(() => props.gutter === !0 ? defSize.value : (props.gutter || defSize.value))
18
18
  defineOptions({
@@ -1,6 +1,5 @@
1
1
  export * from './vue-plugin'
2
- export * from './utils'
2
+ export * from './types'
3
3
 
4
4
  import * as VuePlugin from './vue-plugin'
5
-
6
5
  export default VuePlugin
package/src/myth.ts ADDED
@@ -0,0 +1,30 @@
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
@@ -1,2 +1,2 @@
1
1
  export * from './components'
2
- export * from './VuePlugin'
2
+ export * from './myth'
@@ -2,7 +2,7 @@ import type { QBtnProps } from 'quasar'
2
2
  import type { Ref } from 'vue'
3
3
  import type { MBlockProps, StyleSize } from './components'
4
4
 
5
- export interface UiOptions {
5
+ export interface UiOptionsContext {
6
6
  /**
7
7
  * Style of the components.
8
8
  */
@@ -34,11 +34,9 @@ export interface UiOptions {
34
34
  block?: Partial<MBlockProps>;
35
35
  }
36
36
 
37
- export interface MythOptionsContext {
38
- defaults: Ref<UiOptions>;
39
- getDefaults: () => UiOptions;
40
- setDefaults: (values: Partial<UiOptions>) => void;
41
- withDefaults: (values: Partial<UiOptions>) => void;
42
- withBtnDefaults: (values: Partial<QBtnProps>) => void;
43
- btnDefaults: () => UiOptions;
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;
44
42
  }
@@ -1,5 +1,5 @@
1
- import js from '../package.json'
2
- import { MythOptions } from './utils'
1
+ import js from './../package.json'
2
+ import myth from './myth'
3
3
  import MBtn from './components/form/MBtn.vue'
4
4
  import MBlock from './components/grid/MBlock.vue'
5
5
  import MCol from './components/grid/MCol.vue'
@@ -8,12 +8,14 @@ import MContainer from './components/grid/MContainer.vue'
8
8
  import MHelpRow from './components/grid/MHelpRow.vue'
9
9
  import MRow from './components/grid/MRow.vue'
10
10
  import MTypingString from './components/typography/MTypingString.vue'
11
+ import type { App } from 'vue'
11
12
 
12
13
  const name = js.name
13
14
  const version = js.version
14
15
 
15
- function install (app, options = {}) {
16
- MythOptions.withDefaults(options)
16
+ function install (app: App, options = {}) {
17
+ myth.withOptions(options)
18
+
17
19
  // Form.
18
20
  app.component('MBtn', MBtn)
19
21
 
@@ -29,15 +31,11 @@ function install (app, options = {}) {
29
31
  app.component('MTypingString', MTypingString)
30
32
  }
31
33
 
32
- export {
33
- name,
34
- version,
35
- install
36
- }
37
-
38
- export default {
34
+ export const e = {
39
35
  name,
40
36
  version,
41
37
  install,
42
- MythOptions
38
+ myth
43
39
  }
40
+
41
+ export default e
package/tsconfig.json CHANGED
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
+ "baseUrl": "./",
4
+ "rootDir": ".",
5
+ "outDir": "./dist",
3
6
  "esModuleInterop": true,
4
7
  "skipLibCheck": true,
5
8
  "target": "esnext",
@@ -20,9 +23,12 @@
20
23
  "allowUnusedLabels": false,
21
24
  "noImplicitOverride": true,
22
25
  "exactOptionalPropertyTypes": true,
23
- "noUncheckedIndexedAccess": true,
26
+ "noUncheckedIndexedAccess": true
24
27
  },
25
28
  "exclude": [
26
29
  "./build"
30
+ ],
31
+ "include": [
32
+ "src/**/*"
27
33
  ]
28
34
  }
package/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export * from './src/vue-plugin'
2
- export * from './src/types'
3
- export * from './src/utils'
4
-
5
- import * as VuePlugin from './src/vue-plugin'
6
- export default VuePlugin
package/src/index.esm.js DELETED
@@ -1,6 +0,0 @@
1
- export * from './vue-plugin'
2
- export * from './utils'
3
-
4
- import * as VuePlugin from './vue-plugin'
5
-
6
- export default VuePlugin
package/src/index.umd.js DELETED
@@ -1,6 +0,0 @@
1
- export * from './vue-plugin'
2
- export * from './utils'
3
-
4
- import * as VuePlugin from './vue-plugin'
5
-
6
- export default VuePlugin
package/src/utils.ts DELETED
@@ -1,33 +0,0 @@
1
- import { ref } from 'vue'
2
- import type { QBtnProps } from 'quasar'
3
- import { extend } from 'quasar'
4
- import type { UiOptions } from './types'
5
-
6
- const defGutters = 'md'
7
- const defaultOptions: UiOptions = {
8
- style: {
9
- gutters: defGutters
10
- }
11
- }
12
- const cmDefaults = ref<UiOptions>({ ...defaultOptions })
13
- const MythOptions = {
14
- defaults: cmDefaults,
15
- setDefaults (values: Partial<UiOptions>) {
16
- cmDefaults.value = extend(!0, defaultOptions, values)
17
- },
18
- withDefaults (values: Partial<UiOptions>) {
19
- cmDefaults.value = extend(!0, defaultOptions, cmDefaults.value, values)
20
- },
21
- withBtnDefaults (values: Partial<QBtnProps>) {
22
- cmDefaults.value = {
23
- ...cmDefaults.value,
24
- btn: {
25
- ...cmDefaults.value.btn,
26
- props: { ...values }
27
- }
28
- }
29
- }
30
- }
31
-
32
- export default MythOptions
33
- export { MythOptions }