@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.
Files changed (63) hide show
  1. package/README.md +9 -6
  2. package/dist/components/MBtn/MBtn.d.ts +35 -0
  3. package/dist/components/grid/MColumn/MColumn.d.ts +28 -0
  4. package/dist/components/grid/MContainer/MContainer.d.ts +23 -0
  5. package/dist/components/grid/MGrid.d.ts +12 -0
  6. package/dist/components/grid/MRow/MRow.d.ts +11 -0
  7. package/dist/components/index.d.ts +19 -0
  8. package/dist/composables/useMyth.d.ts +6765 -0
  9. package/dist/composables/useMythMeta.d.ts +30 -0
  10. package/dist/config/config.d.ts +3411 -0
  11. package/dist/config/grid.d.ts +6 -0
  12. package/dist/config/index.d.ts +2 -0
  13. package/dist/index.common.js +1 -0
  14. package/dist/index.css +2 -0
  15. package/dist/index.d.ts +3 -0
  16. package/dist/index.js +2 -0
  17. package/dist/index.umd.js +1 -0
  18. package/dist/types/config.d.ts +69 -0
  19. package/dist/types/helpers.d.ts +14 -0
  20. package/dist/types/index.d.ts +6 -0
  21. package/dist/types/vue-prop-types.d.ts +5 -0
  22. package/dist/utils/helpers.d.ts +40 -0
  23. package/dist/utils/icons.d.ts +4 -0
  24. package/dist/utils/index.d.ts +21 -0
  25. package/dist/utils/str.d.ts +67 -0
  26. package/dist/utils/vee-rules.d.ts +17 -0
  27. package/dist/vue-plugin.d.ts +16 -0
  28. package/package.json +31 -20
  29. package/rREADME.md +0 -147
  30. package/src/components/MBtn/MBtn.ts +0 -38
  31. package/src/components/MBtn/MBtn.vue +0 -142
  32. package/src/components/grid/MColumn/MColumn.ts +0 -15
  33. package/src/components/grid/MColumn/MColumn.vue +0 -28
  34. package/src/components/grid/MContainer/MContainer.ts +0 -39
  35. package/src/components/grid/MContainer/MContainer.vue +0 -66
  36. package/src/components/grid/MGrid.ts +0 -16
  37. package/src/components/grid/MGrid.vue +0 -47
  38. package/src/components/grid/MRow/MRow.ts +0 -15
  39. package/src/components/grid/MRow/MRow.vue +0 -28
  40. package/src/components/index.ts +0 -30
  41. package/src/composables/useMyth.ts +0 -93
  42. package/src/composables/useMythMeta.ts +0 -40
  43. package/src/config/config.ts +0 -16
  44. package/src/config/grid.ts +0 -10
  45. package/src/config/index.ts +0 -2
  46. package/src/css/components/m-btn.scss +0 -13
  47. package/src/css/index.scss +0 -9
  48. package/src/env.d.ts +0 -14
  49. package/src/index.common.js +0 -1
  50. package/src/index.ts +0 -4
  51. package/src/index.umd.js +0 -2
  52. package/src/shims-myth.d.ts +0 -6
  53. package/src/shims-vue.d.ts +0 -22
  54. package/src/types/config.ts +0 -136
  55. package/src/types/helpers.ts +0 -21
  56. package/src/types/index.ts +0 -9
  57. package/src/types/vue-prop-types.ts +0 -13
  58. package/src/utils/helpers.ts +0 -446
  59. package/src/utils/icons.ts +0 -4
  60. package/src/utils/index.ts +0 -77
  61. package/src/utils/str.ts +0 -237
  62. package/src/utils/vee-rules.ts +0 -40
  63. package/src/vue-plugin.ts +0 -76
package/rREADME.md DELETED
@@ -1,147 +0,0 @@
1
- # MyTh Quasar UI Kit Extintion
2
-
3
- [![npm](https://img.shields.io/npm/v/@mythpe/quasar-ui-qui.svg?label=quasar-ui-qui)](https://www.npmjs.com/package/@mythpe/quasar-ui-qui)
4
- [![npm](https://img.shields.io/npm/dt/@mythpe/quasar-ui-qui.svg)](https://www.npmjs.com/package/@mythpe/quasar-ui-qui)
5
-
6
- **Compatible with Quasar UI v2 and Vue 3**.
7
-
8
- # Usage
9
-
10
- ## Quasar CLI project
11
-
12
- Install the [App Extension](https://www.npmjs.com/package/@mythpe/quasar-app-extension-qui).
13
-
14
- **OR**:
15
-
16
- Create and register a boot file:
17
-
18
- ```js
19
- import Vue from 'vue'
20
- import Plugin from '@mythpe/quasar-ui-qui'
21
- import '@mythpe/quasar-ui-qui/dist/index.css'
22
-
23
- Vue.use(Plugin)
24
- ```
25
-
26
- **OR**:
27
-
28
- ```html
29
- <style src="@mythpe/quasar-ui-qui/dist/index.css"></style>
30
-
31
- <script>
32
- import { Component as MyComponent, Directive } from '@mythpe/quasar-ui-qui'
33
-
34
- export default {
35
- components: {
36
- MyComponent
37
- },
38
- directives: {
39
- Directive
40
- }
41
- }
42
- </script>
43
- ```
44
-
45
- ## Vue CLI project
46
-
47
- ```js
48
- import Vue from 'vue'
49
- import Plugin from '@mythpe/quasar-ui-qui'
50
- import '@mythpe/quasar-ui-qui/dist/index.css'
51
-
52
- Vue.use(Plugin)
53
- ```
54
-
55
- **OR**:
56
-
57
- ```html
58
- <style src="@mythpe/quasar-ui-qui/dist/index.css"></style>
59
-
60
- <script>
61
- import { Component as MyComponent, Directive } from '@mythpe/quasar-ui-qui'
62
-
63
- export default {
64
- components: {
65
- MyComponent
66
- },
67
- directives: {
68
- Directive
69
- }
70
- }
71
- </script>
72
- ```
73
-
74
- ## UMD variant
75
-
76
- Exports `window.Myth`.
77
-
78
- Add the following tag(s) after the Quasar ones:
79
-
80
- ```html
81
- <head>
82
- <!-- AFTER the Quasar stylesheet tags: -->
83
- <link
84
- href="https://cdn.jsdelivr.net/npm/@mythpe/quasar-ui-qui/dist/index.min.css"
85
- rel="stylesheet"
86
- type="text/css"
87
- />
88
- </head>
89
- <body>
90
- <!-- at end of body, AFTER Quasar script(s): -->
91
- <script src="https://cdn.jsdelivr.net/npm/@mythpe/quasar-ui-qui/dist/index.umd.min.js"></script>
92
- </body>
93
- ```
94
-
95
- If you need the RTL variant of the CSS, then go for the following (instead of the above stylesheet link):
96
-
97
- ```html
98
- <link
99
- href="https://cdn.jsdelivr.net/npm/@mythpe/quasar-ui-qui/dist/index.rtl.min.css"
100
- rel="stylesheet"
101
- type="text/css"
102
- />
103
- ```
104
-
105
- # Setup
106
-
107
- ```bash
108
- $ yarn
109
- ```
110
-
111
- # Developing
112
-
113
- ```bash
114
- # start dev in SPA mode
115
- $ yarn dev
116
-
117
- # start dev in UMD mode
118
- $ yarn dev:umd
119
-
120
- # start dev in SSR mode
121
- $ yarn dev:ssr
122
-
123
- # start dev in Cordova iOS mode
124
- $ yarn dev:ios
125
-
126
- # start dev in Cordova Android mode
127
- $ yarn dev:android
128
-
129
- # start dev in Electron mode
130
- $ yarn dev:electron
131
- ```
132
-
133
- # Building package
134
-
135
- ```bash
136
- $ yarn build
137
- ```
138
-
139
- # Adding Assets
140
-
141
- If you have a component that has assets, like language or icon-sets, you will need to provide these for UMD. In the `ui/build/script.javascript.js`
142
- file, you will find a couple of commented out commands that call `addAssets`. Uncomment what you need and add your assets to have them be built and
143
- put into the `ui/dist` folder.
144
-
145
- # License
146
-
147
- MIT (c) MyTh <mythpe@gmail.com>
@@ -1,38 +0,0 @@
1
- import type { QBtnProps } from 'quasar'
2
- import type { ComponentPublicInstance, VNode } from 'vue'
3
- import type { SpinnerType } from '../../types/config'
4
-
5
- export interface MBtnProps extends Omit<QBtnProps, 'label'> {
6
- /**
7
- * The text that will be shown on the button
8
- */
9
- label?: string | number | undefined | null
10
- /**
11
- * Removes the default button styles
12
- */
13
- noStyle?: boolean
14
- nativeLabel?: boolean | undefined
15
- /**
16
- * Type of loading indicator
17
- */
18
- spinner?: SpinnerType
19
- }
20
-
21
- export interface MBtnSlots {
22
- /**
23
- * Use for custom content, instead of relying on 'icon' and 'label' props
24
- */
25
- default: () => VNode[]
26
- /**
27
- * Override the default QSpinner when in 'loading' state
28
- */
29
- loading: () => VNode[]
30
- }
31
-
32
- export interface MBtn extends ComponentPublicInstance<MBtnProps> {
33
- /**
34
- * Emulate click on MBtn
35
- * @param evt JS event object
36
- */
37
- click: (evt?: Event) => void
38
- }
@@ -1,142 +0,0 @@
1
- <script lang="ts" setup>
2
- import {
3
- QBtn,
4
- QSpinner,
5
- QSpinnerAudio,
6
- QSpinnerBall,
7
- QSpinnerBars,
8
- QSpinnerBox,
9
- QSpinnerClock,
10
- QSpinnerComment,
11
- QSpinnerCube,
12
- QSpinnerDots,
13
- QSpinnerFacebook,
14
- QSpinnerGears,
15
- QSpinnerGrid,
16
- QSpinnerHearts,
17
- QSpinnerHourglass,
18
- QSpinnerInfinity,
19
- QSpinnerIos,
20
- QSpinnerOrbit,
21
- QSpinnerOval,
22
- QSpinnerPie,
23
- QSpinnerPuff,
24
- QSpinnerRadio,
25
- QSpinnerRings,
26
- QSpinnerTail
27
- } from 'quasar'
28
- import { computed } from 'vue'
29
- import type { MBtnProps } from './MBtn'
30
- import { useMyth } from '../../vue-plugin'
31
- import { pascalCase } from 'change-case'
32
-
33
- interface Props {
34
- label?: MBtnProps['label']
35
- spinner?: MBtnProps['spinner']
36
- loading?: boolean
37
- nativeLabel?: boolean
38
- noStyle?: boolean
39
- }
40
-
41
- const spinners = {
42
- QSpinner,
43
- QSpinnerAudio,
44
- QSpinnerBall,
45
- QSpinnerBars,
46
- QSpinnerBox,
47
- QSpinnerClock,
48
- QSpinnerComment,
49
- QSpinnerCube,
50
- QSpinnerDots,
51
- QSpinnerFacebook,
52
- QSpinnerGears,
53
- QSpinnerGrid,
54
- QSpinnerHearts,
55
- QSpinnerHourglass,
56
- QSpinnerInfinity,
57
- QSpinnerIos,
58
- QSpinnerOrbit,
59
- QSpinnerOval,
60
- QSpinnerPie,
61
- QSpinnerPuff,
62
- QSpinnerRadio,
63
- QSpinnerRings,
64
- QSpinnerTail
65
- }
66
- const {
67
- noStyle = !1,
68
- label = undefined,
69
- loading = false,
70
- nativeLabel = false,
71
- spinner = undefined
72
- } = defineProps<Props>()
73
- const { __, loadingOptions, componentProps, btnStyle } = useMyth()
74
- const loadingType = computed(() => {
75
- if (spinner !== undefined) {
76
- return spinner
77
- }
78
- return loadingOptions.value?.type
79
- })
80
- const spinnerComponent = computed(() => {
81
- if (!loadingType.value) {
82
- return undefined
83
- }
84
- if (loadingType.value === 'spinner') {
85
- return spinners.QSpinner
86
- }
87
- const k = pascalCase(`q-spinner-${loadingType.value}`) as keyof typeof spinners
88
- return spinners[k]
89
- })
90
- const loadingSize = computed(() => loadingOptions.value?.size)
91
- const loadingColor = computed(() => loadingOptions.value?.color)
92
- const DEFAULT_LABEL = undefined
93
- const computedLabel = computed<string | undefined>(() => {
94
- if (nativeLabel === !0) {
95
- return label === null || label === undefined ? DEFAULT_LABEL : String(label)
96
- }
97
- if (label === undefined || label === null) {
98
- return DEFAULT_LABEL
99
- }
100
- return __(label)
101
- })
102
- const computedAttrs = computed(() => ({
103
- ...(noStyle ? {} : btnStyle.value),
104
- ...(componentProps.value.btn || {}),
105
- ariaLabel: computedLabel.value
106
- }))
107
- defineOptions({
108
- name: 'MBtn'
109
- })
110
- </script>
111
-
112
- <template>
113
- <q-btn
114
- :loading="loading"
115
- :label="computedLabel"
116
- v-bind="computedAttrs"
117
- >
118
- <template
119
- v-if="!!$slots.loading"
120
- #loading
121
- >
122
- <slot name="loading" />
123
- </template>
124
- <template
125
- v-else-if="!!loadingType && spinnerComponent"
126
- #loading
127
- >
128
- <component
129
- :is="spinnerComponent"
130
- :color="loadingColor"
131
- :size="loadingSize"
132
- />
133
- </template>
134
-
135
- <template
136
- v-if="!!$slots.default"
137
- #default
138
- >
139
- <slot />
140
- </template>
141
- </q-btn>
142
- </template>
@@ -1,15 +0,0 @@
1
- import type { ComponentPublicInstance, VNode } from 'vue'
2
- import type { MGridProps } from '../MGrid'
3
-
4
- export interface MColumnProps {
5
- size?: MGridProps['size']
6
- type?: MGridProps['type']
7
- }
8
-
9
- export interface MColumnSlots {
10
- default?: () => VNode[]
11
- }
12
-
13
- export interface MColumn extends ComponentPublicInstance<MColumnProps> {
14
- //
15
- }
@@ -1,28 +0,0 @@
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 MGrid from '../MGrid.vue'
11
- import type { MColumnProps } from './MColumn'
12
-
13
- const { size = undefined, type = undefined } = defineProps<MColumnProps>()
14
-
15
- defineOptions({
16
- name: 'MColumn'
17
- })
18
- </script>
19
-
20
- <template>
21
- <MGrid
22
- grid-type="column"
23
- :size="size"
24
- :type="type"
25
- >
26
- <slot />
27
- </MGrid>
28
- </template>
@@ -1,39 +0,0 @@
1
- import type { ComponentPublicInstance, VNode } from 'vue'
2
- import type { MGridProps } from '../MGrid'
3
-
4
- export type MContainerProps = {
5
- /**
6
- * Defines the spacing size (gutter) between rows and columns.
7
- * Matches the design system global theme sizes.
8
- * @default 'md'
9
- */
10
- size?: MGridProps['size']
11
-
12
- /**
13
- * Determines the Quasar gutter implementation behavior.
14
- * - 'col': Uses 'q-col-gutter' (adds negative margins, ideal for layout grids).
15
- * - 'gutter': Uses 'q-gutter' (adds standard margins between direct children).
16
- * @default 'gutter'
17
- */
18
- type?: MGridProps['type']
19
-
20
- /**
21
- * Reduces the inner padding or vertical spacing of the container for a more compact layout.
22
- * @default false
23
- */
24
- dense?: boolean | undefined
25
-
26
- /**
27
- * If true, the container spans the full width of the viewport, removing maximum width constraints.
28
- * @default false
29
- */
30
- fluid?: boolean | undefined
31
- }
32
-
33
- export type MContainerSlots = {
34
- default?: () => VNode[]
35
- }
36
-
37
- export interface MContainer extends ComponentPublicInstance<MContainerProps> {
38
- //
39
- }
@@ -1,66 +0,0 @@
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 { computed, provide, reactive } from 'vue'
11
- import type { MContainerProps } from './MContainer'
12
- import useMyth from '../../../composables/useMyth'
13
- import { DEFAULT_GRID_SIZE, DEFAULT_GRID_TYPE, MContainerInjectionKey } from '../../../config'
14
-
15
- const {
16
- size = DEFAULT_GRID_SIZE,
17
- type = DEFAULT_GRID_TYPE,
18
- dense = undefined,
19
- fluid = undefined
20
- } = defineProps<MContainerProps>()
21
-
22
- const { theme } = useMyth()
23
-
24
- const computedGutterSize = computed(() => {
25
- return size !== DEFAULT_GRID_SIZE ? size : (theme.gutterSize ?? DEFAULT_GRID_SIZE)
26
- })
27
- const computedGutterType = computed(() => {
28
- return type !== DEFAULT_GRID_TYPE ? type : (theme.gutterType ?? DEFAULT_GRID_TYPE)
29
- })
30
- const computedDense = computed(() => dense ?? theme.dense ?? false)
31
- const computedFluid = computed(() => fluid ?? theme.fluid ?? false)
32
- provide(
33
- MContainerInjectionKey,
34
- reactive({
35
- gutterSize: computedGutterSize,
36
- gutterType: computedGutterType,
37
- dense: computedDense,
38
- fluid: computedFluid
39
- })
40
- )
41
- defineOptions({
42
- name: 'MContainer'
43
- })
44
- </script>
45
-
46
- <template>
47
- <div
48
- :class="{
49
- 'm-container__fluid': !!computedFluid,
50
- 'm-container__dense': !!computedDense,
51
- 'q-pa-none': computedGutterSize === 'none',
52
- [`q-pa-${computedGutterSize || ''}`]: computedGutterSize && computedGutterSize !== 'none'
53
- }"
54
- class="m-container"
55
- >
56
- <slot />
57
- </div>
58
- </template>
59
-
60
- <style lang="scss" scoped>
61
- .m-container {
62
- width: 100%;
63
- min-height: 400px;
64
- background-color: red;
65
- }
66
- </style>
@@ -1,16 +0,0 @@
1
- import type { ComponentPublicInstance, VNode } from 'vue'
2
- import type { GridGutterSize, GridGutterType, GridType } from '../../types/config'
3
-
4
- export interface MGridProps {
5
- gridType: GridType
6
- size?: GridGutterSize
7
- type?: GridGutterType
8
- }
9
-
10
- export interface MGridSlots {
11
- default?: () => VNode[]
12
- }
13
-
14
- export interface MGrid extends ComponentPublicInstance<MGridProps> {
15
- //
16
- }
@@ -1,47 +0,0 @@
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 { computed, inject } from 'vue'
11
- import useMyth from '../../composables/useMyth'
12
- import { DEFAULT_GRID_SIZE, DEFAULT_GRID_TYPE, MContainerInjectionKey } from '../../config'
13
- import type { MGridProps } from './MGrid'
14
-
15
- const { size = undefined, type = undefined, gridType = 'row' } = defineProps<MGridProps>()
16
- const parent = inject(MContainerInjectionKey)
17
- const { theme } = useMyth()
18
-
19
- const computedGutterSize = computed<string>(() => {
20
- if (size !== undefined) {
21
- return size
22
- }
23
- return parent?.size ?? theme.gutterSize ?? DEFAULT_GRID_SIZE
24
- })
25
- const computedGutterType = computed<string>(() => {
26
- if (type !== undefined) {
27
- return type
28
- }
29
- return parent?.type ?? theme.gutterType ?? DEFAULT_GRID_TYPE
30
- })
31
- const gutterKey = computed(() => `q${type === 'col' ? '-col' : ''}-gutter`)
32
- defineOptions({
33
- name: 'MGrid'
34
- })
35
- </script>
36
-
37
- <template>
38
- <div
39
- :class="{
40
- 'm-row row': gridType === 'row',
41
- 'm-column column': gridType === 'column',
42
- [`${gutterKey}-${computedGutterSize}`]: !!computedGutterType && computedGutterType !== 'none'
43
- }"
44
- >
45
- <slot />
46
- </div>
47
- </template>
@@ -1,15 +0,0 @@
1
- import type { ComponentPublicInstance, VNode } from 'vue'
2
- import type { MGridProps } from '../MGrid'
3
-
4
- export interface MRowProps {
5
- size?: MGridProps['size']
6
- type?: MGridProps['type']
7
- }
8
-
9
- export interface MRowSlots {
10
- default?: () => VNode[]
11
- }
12
-
13
- export interface MRow extends ComponentPublicInstance<MRowProps> {
14
- //
15
- }
@@ -1,28 +0,0 @@
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 MGrid from '../MGrid.vue'
11
- import type { MRowProps } from './MRow'
12
-
13
- const { size = undefined, type = undefined } = defineProps<MRowProps>()
14
-
15
- defineOptions({
16
- name: 'MRow'
17
- })
18
- </script>
19
-
20
- <template>
21
- <MGrid
22
- grid-type="row"
23
- :size="size"
24
- :type="type"
25
- >
26
- <slot />
27
- </MGrid>
28
- </template>
@@ -1,30 +0,0 @@
1
- import MBtn from './MBtn/MBtn.vue'
2
- import MContainer from './grid/MContainer/MContainer.vue'
3
- import MGrid from './grid/MGrid.vue'
4
- import MColumn from './grid/MColumn/MColumn.vue'
5
- import MRow from './grid/MRow/MRow.vue'
6
- import type { GlobalComponentConstructor } from 'quasar'
7
- import type { MContainerProps, MContainerSlots } from './grid/MContainer/MContainer'
8
- import type { MGridProps, MGridSlots } from './grid/MGrid'
9
- import type { MColumnProps, MColumnSlots } from './grid/MColumn/MColumn'
10
- import type { MRowProps, MRowSlots } from './grid/MRow/MRow'
11
- import type { MBtnProps, MBtnSlots } from './MBtn/MBtn'
12
-
13
- export * from './grid/MGrid'
14
- export * from './grid/MColumn/MColumn'
15
- export * from './grid/MContainer/MContainer'
16
- export * from './grid/MRow/MRow'
17
-
18
- export * from './MBtn/MBtn'
19
-
20
- export { MBtn, MContainer, MGrid, MColumn, MRow }
21
-
22
- export interface MythGlobalComponents {
23
- // Grid.
24
- MContainer: GlobalComponentConstructor<MContainerProps, MContainerSlots>
25
- MGrid: GlobalComponentConstructor<MGridProps, MGridSlots>
26
- MColumn: GlobalComponentConstructor<MColumnProps, MColumnSlots>
27
- MRow: GlobalComponentConstructor<MRowProps, MRowSlots>
28
-
29
- MBtn: GlobalComponentConstructor<MBtnProps, MBtnSlots>
30
- }