@mythpe/quasar-ui-qui 0.0.8 → 0.0.10

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/.eslintrc.cjs ADDED
@@ -0,0 +1,103 @@
1
+ module.exports = {
2
+ // https://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
3
+ // This option interrupts the configuration hierarchy at this file
4
+ // Remove this if you have an higher level ESLint config file (it usually happens into a monorepos)
5
+ root: true,
6
+
7
+ // https://eslint.vuejs.org/user-guide/#how-to-use-a-custom-parser
8
+ // Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
9
+ // `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
10
+ parserOptions: {
11
+ parser: require.resolve('@typescript-eslint/parser'),
12
+ extraFileExtensions: ['.vue']
13
+ },
14
+
15
+ env: {
16
+ browser: true,
17
+ es2021: true,
18
+ node: true
19
+ },
20
+
21
+ // Rules order is important, please avoid shuffling them
22
+ extends: [
23
+ // Base ESLint recommended rules
24
+ // 'eslint:recommended',
25
+
26
+ // https://typescript-eslint.io/getting-started/legacy-eslint-setup
27
+ // ESLint typescript rules
28
+ 'plugin:@typescript-eslint/recommended',
29
+
30
+ // Uncomment any of the lines below to choose desired strictness,
31
+ // but leave only one uncommented!
32
+ // See https://eslint.vuejs.org/rules/#available-rules
33
+ // 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
34
+ 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
35
+ // 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
36
+ 'standard'
37
+ ],
38
+
39
+ plugins: [
40
+ // required to apply rules which need type information
41
+ '@typescript-eslint',
42
+
43
+ // https://eslint.vuejs.org/user-guide/#why-doesn-t-it-work-on-vue-files
44
+ // required to lint *.vue files
45
+ 'vue'
46
+
47
+ ],
48
+
49
+ globals: {
50
+ ga: 'readonly', // Google Analytics
51
+ cordova: 'readonly',
52
+ __statics: 'readonly',
53
+ __QUASAR_SSR__: 'readonly',
54
+ __QUASAR_SSR_SERVER__: 'readonly',
55
+ __QUASAR_SSR_CLIENT__: 'readonly',
56
+ __QUASAR_SSR_PWA__: 'readonly',
57
+ process: 'readonly',
58
+ Capacitor: 'readonly',
59
+ chrome: 'readonly'
60
+ },
61
+
62
+ // add your custom rules here
63
+ rules: {
64
+
65
+ // allow async-await
66
+ 'generator-star-spacing': 'off',
67
+ // allow paren-less arrow functions
68
+ 'arrow-parens': 'off',
69
+ 'one-var': 'off',
70
+ 'no-void': 'off',
71
+ 'multiline-ternary': 'off',
72
+
73
+ 'import/first': 'off',
74
+ 'import/namespace': 'error',
75
+ 'import/default': 'error',
76
+ 'import/export': 'error',
77
+ 'import/extensions': 'off',
78
+ 'import/no-unresolved': 'off',
79
+ 'import/no-extraneous-dependencies': 'off',
80
+
81
+ // The core 'import/named' rules
82
+ // does not work with type definitions
83
+ 'import/named': 'off',
84
+
85
+ 'prefer-promise-reject-errors': 'off',
86
+
87
+ quotes: ['warn', 'single', { avoidEscape: true }],
88
+
89
+ // this rule, if on, would require explicit return type on the `render` function
90
+ '@typescript-eslint/explicit-function-return-type': 'off',
91
+
92
+ // in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
93
+ '@typescript-eslint/no-var-requires': 'off',
94
+
95
+ // The core 'no-unused-vars' rules (in the eslint:recommended ruleset)
96
+ // does not work with type definitions
97
+ 'no-unused-vars': 'off',
98
+
99
+ // allow debugger during development only
100
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
101
+ '@typescript-eslint/no-explicit-any': 'off'
102
+ }
103
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": "MyTh Ahmed Faiz <mythpe@gmail.com>",
6
6
  "email": "mythpe@gmail.com",
@@ -20,6 +20,12 @@
20
20
  "build:js": "node build/script.javascript.js",
21
21
  "build:css": "node build/script.css.js"
22
22
  },
23
+ "dependencies": {
24
+ "lodash": "^4.17.21",
25
+ "typed.js": "^2.1.0",
26
+ "vee-validate": "^4.14.7",
27
+ "vue-i18n": "^10.0.4"
28
+ },
23
29
  "devDependencies": {
24
30
  "@quasar/app-webpack": "^3.13.0",
25
31
  "@quasar/extras": "^1.16.4",
@@ -27,10 +33,20 @@
27
33
  "@rollup/plugin-json": "^4.0.0",
28
34
  "@rollup/plugin-node-resolve": "^11.2.1",
29
35
  "@rollup/plugin-replace": "^2.4.2",
36
+ "@types/lodash": "^4.17.13",
37
+ "@types/node": "^20.5.9",
38
+ "@typescript-eslint/eslint-plugin": "^7.16.0",
39
+ "@typescript-eslint/parser": "^7.16.0",
30
40
  "autoprefixer": "^10.0.2",
31
41
  "chalk": "^4.1.0",
32
42
  "core-js": "^3.0.0",
33
43
  "cssnano": "^4.1.10",
44
+ "eslint": "^8.57.0",
45
+ "eslint-config-standard": "^17.0.0",
46
+ "eslint-plugin-import": "^2.19.1",
47
+ "eslint-plugin-n": "^15.0.0",
48
+ "eslint-plugin-promise": "^6.0.0",
49
+ "eslint-plugin-vue": "^9.0.0",
34
50
  "fs-extra": "^8.1.0",
35
51
  "open": "^7.3.0",
36
52
  "postcss": "^8.1.9",
@@ -54,7 +70,9 @@
54
70
  "last 4 FirefoxAndroid versions",
55
71
  "last 4 iOS versions"
56
72
  ],
57
- "dependencies": {
58
- "vue-i18n": "^10.0.4"
73
+ "engines": {
74
+ "node": "^24 || ^22 || ^20 || ^18",
75
+ "npm": ">= 6.13.4",
76
+ "yarn": ">= 1.21.1"
59
77
  }
60
78
  }
@@ -1,15 +1,11 @@
1
1
  <script lang="ts" setup>
2
- import type { MBtnProps } from '../types'
2
+ 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 { MythOptions } from '../../utils'
7
7
 
8
8
  const props = defineProps<MBtnProps>()
9
- defineOptions({
10
- name: 'MBtn',
11
- inheritAttrs: !1
12
- })
13
9
  const options = computed(() => MythOptions.defaults.value.btn ?? {})
14
10
  const { t, te } = useI18n({ useScope: 'global' })
15
11
  const getLabel = computed(() => {
@@ -23,12 +19,13 @@ const getLabel = computed(() => {
23
19
  }
24
20
  return props.label
25
21
  })
22
+ defineOptions({
23
+ name: 'MBtn',
24
+ inheritAttrs: !1
25
+ })
26
26
  </script>
27
27
 
28
28
  <template>
29
- <div>
30
- <pre>{{ options }}</pre>
31
- </div>
32
29
  <q-btn v-bind="extend(!0,{...$attrs},options.props,{...$props},{label: getLabel})">
33
30
  <template
34
31
  v-if="!!options.loading && !$slots.loading"
@@ -0,0 +1,39 @@
1
+ <script lang="ts" setup>
2
+ import type { MBlockProps } from '../../types'
3
+ import { computed } from 'vue'
4
+ import MythOptions from '../../utils'
5
+ import { extend } from 'quasar'
6
+
7
+ interface Props {
8
+ size?: MBlockProps['size'];
9
+ rounded?: MBlockProps['rounded'];
10
+ shadow?: MBlockProps['shadow'];
11
+ }
12
+
13
+ const props = withDefaults(defineProps<Props>(), {
14
+ size: 'md',
15
+ rounded: !1,
16
+ shadow: 'none'
17
+ })
18
+ const block = computed(() => MythOptions.defaults.value.block ?? {})
19
+ const options = computed<Props>(() => extend(!0, { ...props }, block.value))
20
+ defineOptions({
21
+ name: 'MBlock',
22
+ inheritAttrs: !1
23
+ })
24
+ </script>
25
+
26
+ <template>
27
+ <div
28
+ :class="{
29
+ 'm---block' : !0,
30
+ [`q-pa-${options.size}`] : !!options.size && options.size !== 'none',
31
+ 'rounded-borders' : options.rounded === !0,
32
+ [`shadow-${options.shadow}`] : !!options.shadow && options.shadow !== 'none'
33
+ }"
34
+ v-bind="$attrs"
35
+ >
36
+ <pre style="direction: ltr;">{{ options }}</pre>
37
+ <slot />
38
+ </div>
39
+ </template>
@@ -0,0 +1,73 @@
1
+ <script
2
+ lang="ts"
3
+ setup
4
+ >
5
+ import { computed } from 'vue'
6
+ import type { MColProps } from '../../types'
7
+ import lodash from 'lodash'
8
+
9
+ interface Props {
10
+ name?: MColProps['name']
11
+ auto?: MColProps['auto']
12
+ col?: MColProps['col']
13
+ xs?: MColProps['xs']
14
+ sm?: MColProps['sm']
15
+ md?: MColProps['md']
16
+ lg?: MColProps['lg']
17
+ xl?: MColProps['xl']
18
+ }
19
+
20
+ const props = withDefaults(defineProps<Props>(), {
21
+ name: undefined,
22
+ auto: undefined,
23
+ col: undefined,
24
+ xs: undefined,
25
+ sm: undefined,
26
+ md: undefined,
27
+ lg: undefined,
28
+ xl: undefined
29
+ })
30
+ const classes = computed(() => {
31
+ const list: string[] = ['m--col']
32
+ if (props.auto === !0) {
33
+ list.push('col-auto')
34
+ }
35
+ if (props.col === 'grow') {
36
+ list.push('col-grow')
37
+ } else if (props.col === 'shrink') {
38
+ list.push('col-shrink')
39
+ } else if (typeof props.col === 'string') {
40
+ if (props.col?.toString()?.trim()?.length > 0 && !list.includes(`col-${props.col}`)) {
41
+ list.push(`col-${props.col}`)
42
+ }
43
+ }
44
+
45
+ for (const k of (['xs', 'sm', 'md', 'lg', 'xl'] as (keyof Props)[])) {
46
+ if (props[k] && typeof props[k] !== 'boolean') {
47
+ if (!list.includes(`col-${k}-${props[k]}`)) {
48
+ list.push(`col-${k}-${props[k]}`)
49
+ }
50
+ }
51
+ }
52
+
53
+ if (list.length === 1 && props.col !== !1) {
54
+ list.push('col')
55
+ }
56
+
57
+ return lodash.uniq(list)
58
+ })
59
+ defineOptions({
60
+ name: 'MCol',
61
+ inheritAttrs: !1
62
+ })
63
+ </script>
64
+
65
+ <template>
66
+ <div
67
+ :class="classes"
68
+ :data-input-name="name??undefined"
69
+ v-bind="$attrs"
70
+ >
71
+ <slot />
72
+ </div>
73
+ </template>
@@ -0,0 +1,15 @@
1
+ <script lang="ts" setup>
2
+ defineOptions({
3
+ name: 'MColumn',
4
+ inheritAttrs: !1
5
+ })
6
+ </script>
7
+
8
+ <template>
9
+ <div
10
+ class="m--column column"
11
+ v-bind="$attrs"
12
+ >
13
+ <slot />
14
+ </div>
15
+ </template>
@@ -0,0 +1,46 @@
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
+ <script lang="ts" setup>
10
+ import type { MContainerProps } from '../../types'
11
+ import MythOptions from '../../utils'
12
+ import { computed } from 'vue'
13
+
14
+ interface Props {
15
+ size?: MContainerProps['size'];
16
+ fluid?: MContainerProps['fluid'];
17
+ dense?: MContainerProps['dense'];
18
+ }
19
+
20
+ const props = defineProps<Props>()
21
+ const styles = computed(() => MythOptions.defaults.value?.style ?? {})
22
+ const sizeProp = computed(() => {
23
+ if (props.size !== undefined) {
24
+ return props.size
25
+ }
26
+ return styles.value.gutters
27
+ })
28
+ defineOptions({
29
+ name: 'MContainer',
30
+ inheritAttrs: !1
31
+ })
32
+ </script>
33
+
34
+ <template>
35
+ <div
36
+ :class="{
37
+ 'm--container' : !0,
38
+ 'm--container__fluid' : (fluid !== !1 && fluid !== undefined) || (styles.fluid === !0 && (fluid !== !1 && fluid !== undefined)),
39
+ 'm--container__dense' : dense !== !1 && dense !== undefined,
40
+ [`q-pa-${sizeProp||''}`]: sizeProp && sizeProp !== 'none'
41
+ }"
42
+ v-bind="$attrs"
43
+ >
44
+ <slot />
45
+ </div>
46
+ </template>
@@ -0,0 +1,62 @@
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
+ <script
10
+ lang="ts"
11
+ setup
12
+ >
13
+ import { useI18n } from 'vue-i18n'
14
+
15
+ interface Props {
16
+ text?: string | undefined;
17
+ icon?: string | undefined;
18
+ tooltip?: boolean | undefined;
19
+ }
20
+
21
+ defineProps<Props>()
22
+ const { t, te } = useI18n({ useScope: 'global' })
23
+ const __ = (s: any) => !s ? '' : te(`attributes.${s}`) ? t(`attributes.${s}`) : te(s) ? t(s) : s
24
+ defineOptions({
25
+ name: 'MHelpRow',
26
+ inheritAttrs: !1
27
+ })
28
+ </script>
29
+
30
+ <template>
31
+ <div class="row">
32
+ <div class="col-auto">
33
+ <q-icon
34
+ :left="!!text && !tooltip"
35
+ class="cursor-pointer"
36
+ name="ion-ios-information-circle-outline"
37
+ size="19px"
38
+ >
39
+ <q-tooltip
40
+ v-if="!!tooltip"
41
+ anchor="center end"
42
+ class="bg-transparent text-black text-justify"
43
+ self="center start"
44
+ transition-hide="jump-right"
45
+ transition-show="jump-left"
46
+ >
47
+ <q-card style="max-width: 280px">
48
+ <q-card-section style="font-size: 13px">
49
+ {{ __(text) }}
50
+ </q-card-section>
51
+ </q-card>
52
+ </q-tooltip>
53
+ </q-icon>
54
+ </div>
55
+ <div
56
+ v-if="!tooltip && !!text"
57
+ class="col"
58
+ >
59
+ <div v-text="__(text)" />
60
+ </div>
61
+ </div>
62
+ </template>
@@ -0,0 +1,35 @@
1
+ <script
2
+ lang="ts"
3
+ setup
4
+ >
5
+ import type { MRowProps } from '../../types'
6
+ import { computed } from 'vue'
7
+ import MythOptions from '../../utils'
8
+
9
+ interface Props {
10
+ gutter?: MRowProps['gutter'];
11
+ col?: MRowProps['col'];
12
+ }
13
+
14
+ const props = defineProps<Props>()
15
+ const defSize = computed<string>(() => MythOptions.defaults.value.style?.gutters || '')
16
+ const gutterSize = computed<string>(() => props.gutter === !0 ? defSize.value : (props.gutter || defSize.value))
17
+ const colSize = computed<string>(() => props.gutter === !0 ? defSize.value : (props.gutter || defSize.value))
18
+ defineOptions({
19
+ name: 'MRow',
20
+ inheritAttrs: !1
21
+ })
22
+ </script>
23
+
24
+ <template>
25
+ <div
26
+ :class="{
27
+ 'm--row row': !0,
28
+ [`q-gutter-${gutterSize}`]: gutter !== !1 && gutter !== undefined,
29
+ [`q-col-gutter-${colSize}`]: col !== !1 && col !== undefined,
30
+ }"
31
+ v-bind="$attrs"
32
+ >
33
+ <slot />
34
+ </div>
35
+ </template>
@@ -0,0 +1,78 @@
1
+ <script
2
+ lang="ts"
3
+ setup
4
+ >
5
+
6
+ import Typed, { type TypedOptions } from 'typed.js'
7
+ import { computed, onBeforeUnmount, onMounted, watch } from 'vue'
8
+ import type { MTypingStringProps } from '../../types'
9
+
10
+ interface Props {
11
+ name: MTypingStringProps['name'];
12
+ tag?: MTypingStringProps['tag'];
13
+ string: MTypingStringProps['string'];
14
+ loop?: MTypingStringProps['loop'];
15
+ typeSpeed?: MTypingStringProps['typeSpeed'];
16
+ backDelay?: MTypingStringProps['backDelay'];
17
+ fadeOut?: MTypingStringProps['fadeOut'];
18
+ options?: MTypingStringProps['options'];
19
+ }
20
+
21
+ const props = defineProps<Props>()
22
+
23
+ const elmId = computed(() => `typed-content-${props.name}`)
24
+ const computedOptions = computed(() => ({
25
+ loop: props.loop === undefined ? !1 : props.loop,
26
+ typeSpeed: props.typeSpeed === undefined ? 300 : props.typeSpeed,
27
+ backDelay: props.backDelay,
28
+ fadeOut: props.fadeOut,
29
+ strings: typeof props.string === 'string' ? [props.string] : props.string,
30
+ ...props.options
31
+ } as TypedOptions))
32
+ let typed: Typed | undefined
33
+ const iniTyped = () => {
34
+ try {
35
+ typed = new Typed(`#${elmId.value}`, computedOptions.value)
36
+ } catch (e) {
37
+ console.log(e)
38
+ }
39
+ }
40
+ const destroy = () => {
41
+ if (typed) {
42
+ try {
43
+ typed.destroy()
44
+ } catch (e) {
45
+
46
+ }
47
+ }
48
+ }
49
+ watch(() => props.string, () => {
50
+ destroy()
51
+ iniTyped()
52
+ })
53
+ onMounted(() => {
54
+ if (props.string) {
55
+ try {
56
+ iniTyped()
57
+ } catch (e) {
58
+ console.log(e)
59
+ const a = document.getElementById(elmId.value)
60
+ a && (a.innerHTML = typeof props.string === 'string' ? props.string : props.string.join('<br />'))
61
+ }
62
+ }
63
+ })
64
+ onBeforeUnmount(() => destroy())
65
+ defineExpose({ typed })
66
+ defineOptions({
67
+ name: 'MTypingString',
68
+ inheritAttrs: !1
69
+ })
70
+ </script>
71
+
72
+ <template>
73
+ <component
74
+ :is="tag || 'span'"
75
+ :id="elmId"
76
+ v-bind="$attrs"
77
+ />
78
+ </template>
@@ -2,4 +2,5 @@ export * from './vue-plugin'
2
2
  export * from './utils'
3
3
 
4
4
  import * as VuePlugin from './vue-plugin'
5
+
5
6
  export default VuePlugin
package/src/index.esm.js CHANGED
@@ -2,4 +2,5 @@ export * from './vue-plugin'
2
2
  export * from './utils'
3
3
 
4
4
  import * as VuePlugin from './vue-plugin'
5
+
5
6
  export default VuePlugin
package/src/index.sass CHANGED
@@ -1,2 +1,27 @@
1
1
  @import 'quasar/src/css/variables.sass'
2
+ $m--container-padding: $space-base !default
3
+ $m--container-fluid-width: 1440px !default
4
+ $m--row-margin-top: $m--container-padding !default
2
5
 
6
+ .flex-break
7
+ flex: 1 0 100% !important
8
+
9
+ .row
10
+ .flex-break
11
+ height: 0 !important
12
+
13
+ .column
14
+ .flex-break
15
+ width: 0 !important
16
+
17
+ .m--container
18
+ &__dense
19
+ padding: 0 !important
20
+
21
+ &__fluid
22
+ max-width: $m--container-fluid-width
23
+ margin-left: auto
24
+ margin-right: auto
25
+
26
+ .m--row + .m--row
27
+ margin-top: $m--row-margin-top
package/src/index.umd.js CHANGED
@@ -2,4 +2,5 @@ export * from './vue-plugin'
2
2
  export * from './utils'
3
3
 
4
4
  import * as VuePlugin from './vue-plugin'
5
+
5
6
  export default VuePlugin
@@ -1,7 +1,24 @@
1
1
  import type { QBtnProps } from 'quasar'
2
2
  import type { Ref } from 'vue'
3
+ import type { MBlockProps, StyleSize } from './components'
3
4
 
4
5
  export interface UiOptions {
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
+ */
5
22
  btn?: {
6
23
  props?: Partial<QBtnProps>;
7
24
  loading?: {
@@ -11,7 +28,12 @@ export interface UiOptions {
11
28
  label?: boolean | undefined;
12
29
  }
13
30
  };
31
+ /**
32
+ * MBlock component.
33
+ */
34
+ block?: Partial<MBlockProps>;
14
35
  }
36
+
15
37
  export interface MythOptionsContext {
16
38
  defaults: Ref<UiOptions>;
17
39
  getDefaults: () => UiOptions;