@mythpe/quasar-ui-qui 0.0.1

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 ADDED
@@ -0,0 +1,156 @@
1
+ # Component MyComponent and Directive v-my-directive
2
+
3
+ [![npm](https://img.shields.io/npm/v/@mythpe/quasar-ui-qui.svg?label=@mythpe/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
+
9
+ # Component MyComponent
10
+ > Short description of the component
11
+
12
+
13
+
14
+ # Directive v-my-directive
15
+ > Short description of the directive
16
+
17
+
18
+ # Usage
19
+
20
+ ## Quasar CLI project
21
+
22
+
23
+ Install the [App Extension](../app-extension).
24
+
25
+ **OR**:
26
+
27
+
28
+ Create and register a boot file:
29
+
30
+ ```js
31
+ import Vue from 'vue'
32
+ import Plugin from '@mythpe/quasar-ui-qui'
33
+ import '@mythpe/quasar-ui-qui/dist/index.css'
34
+
35
+ Vue.use(Plugin)
36
+ ```
37
+
38
+ **OR**:
39
+
40
+ ```html
41
+ <style src="@mythpe/quasar-ui-qui/dist/index.css"></style>
42
+
43
+ <script>
44
+ import { Component as MyComponent, Directive } from '@mythpe/quasar-ui-qui'
45
+
46
+ export default {
47
+
48
+ components: {
49
+ MyComponent
50
+ },
51
+
52
+
53
+ directives: {
54
+ Directive
55
+ }
56
+
57
+ }
58
+ </script>
59
+ ```
60
+
61
+ ## Vue CLI project
62
+
63
+ ```js
64
+ import Vue from 'vue'
65
+ import Plugin from '@mythpe/quasar-ui-qui'
66
+ import '@mythpe/quasar-ui-qui/dist/index.css'
67
+
68
+ Vue.use(Plugin)
69
+ ```
70
+
71
+ **OR**:
72
+
73
+ ```html
74
+ <style src="@mythpe/quasar-ui-qui/dist/index.css"></style>
75
+
76
+ <script>
77
+ import { Component as MyComponent, Directive } from '@mythpe/quasar-ui-qui'
78
+
79
+ export default {
80
+
81
+ components: {
82
+ MyComponent
83
+ },
84
+
85
+
86
+ directives: {
87
+ Directive
88
+ }
89
+
90
+ }
91
+ </script>
92
+ ```
93
+
94
+ ## UMD variant
95
+
96
+ Exports `window.mythUi`.
97
+
98
+ Add the following tag(s) after the Quasar ones:
99
+
100
+ ```html
101
+ <head>
102
+ <!-- AFTER the Quasar stylesheet tags: -->
103
+ <link href="https://cdn.jsdelivr.net/npm/@mythpe/quasar-ui-qui/dist/index.min.css" rel="stylesheet" type="text/css">
104
+ </head>
105
+ <body>
106
+ <!-- at end of body, AFTER Quasar script(s): -->
107
+ <script src="https://cdn.jsdelivr.net/npm/@mythpe/quasar-ui-qui/dist/index.umd.min.js"></script>
108
+ </body>
109
+ ```
110
+ If you need the RTL variant of the CSS, then go for the following (instead of the above stylesheet link):
111
+ ```html
112
+ <link href="https://cdn.jsdelivr.net/npm/@mythpe/quasar-ui-qui/dist/index.rtl.min.css" rel="stylesheet" type="text/css">
113
+ ```
114
+
115
+ # Setup
116
+ ```bash
117
+ $ yarn
118
+ ```
119
+
120
+ # Developing
121
+ ```bash
122
+ # start dev in SPA mode
123
+ $ yarn dev
124
+
125
+ # start dev in UMD mode
126
+ $ yarn dev:umd
127
+
128
+ # start dev in SSR mode
129
+ $ yarn dev:ssr
130
+
131
+ # start dev in Cordova iOS mode
132
+ $ yarn dev:ios
133
+
134
+ # start dev in Cordova Android mode
135
+ $ yarn dev:android
136
+
137
+ # start dev in Electron mode
138
+ $ yarn dev:electron
139
+ ```
140
+
141
+ # Building package
142
+ ```bash
143
+ $ yarn build
144
+ ```
145
+
146
+ # Adding Testing Components
147
+ in the `ui/dev/src/pages` you can add Vue files to test your component/directive. When using `yarn dev` to build the UI, any pages in that location will automatically be picked up by dynamic routing and added to the test page.
148
+
149
+ # Adding Assets
150
+ 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` 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 put into the `ui/dist` folder.
151
+
152
+ # Donate
153
+ If you appreciate the work that went into this, please consider [donating to Quasar](https://donate.quasar.dev).
154
+
155
+ # License
156
+ MIT (c) MyTh <mythpe@gmail.com>
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@mythpe/quasar-ui-qui",
3
+ "version": "0.0.1",
4
+ "author": "MyTh <mythpe@gmail.com>",
5
+ "description": "MyTh Quasar UI Kit App Extension",
6
+ "license": "MIT",
7
+ "module": "src/index.esm.js",
8
+ "main": "src/index.common.js",
9
+ "scripts": {
10
+ "dev": "cd ../dev && yarn dev && cd ..",
11
+ "dev:umd": "yarn build && node build/script.open-umd.js",
12
+ "dev:ssr": "cd ../dev && yarn 'dev:ssr' && cd ..",
13
+ "dev:ios": "cd ../dev && yarn 'dev:ios' && cd ..",
14
+ "dev:android": "cd ../dev && yarn 'dev:android' && cd ..",
15
+ "dev:electron": "cd ../dev && yarn 'dev:electron' && cd ..",
16
+ "build": "node build/index.js",
17
+ "build:js": "node build/script.javascript.js",
18
+ "build:css": "node build/script.css.js"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": ""
23
+ },
24
+ "bugs": "",
25
+ "homepage": "",
26
+ "devDependencies": {
27
+ "@quasar/app-webpack": "^3.13.0",
28
+ "@quasar/extras": "^1.16.4",
29
+ "@rollup/plugin-buble": "^0.21.3",
30
+ "@rollup/plugin-json": "^4.0.0",
31
+ "@rollup/plugin-node-resolve": "^11.2.1",
32
+ "@rollup/plugin-replace": "^2.4.2",
33
+ "autoprefixer": "^10.0.2",
34
+ "chalk": "^4.1.0",
35
+ "core-js": "^3.0.0",
36
+ "cssnano": "^4.1.10",
37
+ "fs-extra": "^8.1.0",
38
+ "open": "^7.3.0",
39
+ "postcss": "^8.1.9",
40
+ "quasar": "^2.16.0",
41
+ "rimraf": "^3.0.0",
42
+ "rollup": "^2.45.0",
43
+ "rtlcss": "^2.6.1",
44
+ "sass": "^1.33.0",
45
+ "uglify-js": "^3.13.3",
46
+ "vue": "^3.0.0",
47
+ "vue-router": "^4.0.0",
48
+ "zlib": "^1.0.5"
49
+ },
50
+ "browserslist": [
51
+ "last 4 Chrome versions",
52
+ "last 4 Firefox versions",
53
+ "last 2 Edge versions",
54
+ "last 4 Safari versions",
55
+ "last 4 Android versions",
56
+ "last 4 ChromeAndroid versions",
57
+ "last 4 FirefoxAndroid versions",
58
+ "last 4 iOS versions"
59
+ ],
60
+ "dependencies": {
61
+ "vue-i18n": "^11.0.0-beta.1"
62
+ }
63
+ }
@@ -0,0 +1,168 @@
1
+ <script lang="ts" setup>
2
+ import { PLUGIN_OPTIONS } from '../utils'
3
+ import type { MBtnProps } from '../types/MBtn'
4
+ import { useI18n } from 'vue-i18n'
5
+ import { computed } from 'vue'
6
+ import { extend } from 'quasar'
7
+
8
+ const props = defineProps<MBtnProps>()
9
+ defineOptions({
10
+ name: 'MBtn',
11
+ inheritAttrs: !1
12
+ })
13
+ const options = PLUGIN_OPTIONS
14
+ const { t, te } = useI18n({ useScope: 'global' })
15
+ const getLabel = computed(() => {
16
+ if (props.label !== undefined) {
17
+ if (te(`attributes.${props.label}`)) {
18
+ return t(`attributes.${props.label}`)
19
+ }
20
+ if (te(`${props.label}`)) {
21
+ return t(`${props.label}`)
22
+ }
23
+ }
24
+ return props.label
25
+ })
26
+ </script>
27
+
28
+ <template>
29
+ <q-btn v-bind="extend(!0,{...$attrs},options.components?.btn,{...$props},{label: getLabel})">
30
+ <template
31
+ v-if="!!options.style?.btn?.loading && !$slots.loading"
32
+ #loading
33
+ >
34
+ <q-spinner-audio
35
+ v-if="options.style.btn.loading.type === 'audio'"
36
+ :color="options.style.btn.loading.color"
37
+ :size="options.style.btn.loading.size"
38
+ class="on-left"
39
+ />
40
+ <q-spinner-ball
41
+ v-if="options.style.btn.loading.type === 'ball'"
42
+ :color="options.style.btn.loading.color"
43
+ :size="options.style.btn.loading.size"
44
+ class="on-left"
45
+ />
46
+ <q-spinner-bars
47
+ v-if="options.style.btn.loading.type === 'bars'"
48
+ :color="options.style.btn.loading.color"
49
+ class="on-left"
50
+ />
51
+ <q-spinner-box
52
+ v-if="options.style.btn.loading.type === 'box'"
53
+ :color="options.style.btn.loading.color"
54
+ class="on-left"
55
+ />
56
+ <q-spinner-clock
57
+ v-if="options.style.btn.loading.type === 'clock'"
58
+ :color="options.style.btn.loading.color"
59
+ class="on-left"
60
+ />
61
+ <q-spinner-comment
62
+ v-if="options.style.btn.loading.type === 'comment'"
63
+ :color="options.style.btn.loading.color"
64
+ class="on-left"
65
+ />
66
+ <q-spinner-cube
67
+ v-if="options.style.btn.loading.type === 'cube'"
68
+ :color="options.style.btn.loading.color"
69
+ class="on-left"
70
+ />
71
+ <q-spinner-dots
72
+ v-if="options.style.btn.loading.type === 'dots'"
73
+ :color="options.style.btn.loading.color"
74
+ class="on-left"
75
+ />
76
+ <q-spinner-facebook
77
+ v-if="options.style.btn.loading.type === 'facebook'"
78
+ :color="options.style.btn.loading.color"
79
+ class="on-left"
80
+ />
81
+ <q-spinner-gears
82
+ v-if="options.style.btn.loading.type === 'gears'"
83
+ :color="options.style.btn.loading.color"
84
+ class="on-left"
85
+ />
86
+ <q-spinner-grid
87
+ v-if="options.style.btn.loading.type === 'grid'"
88
+ :color="options.style.btn.loading.color"
89
+ class="on-left"
90
+ />
91
+ <q-spinner-hearts
92
+ v-if="options.style.btn.loading.type === 'hearts'"
93
+ :color="options.style.btn.loading.color"
94
+ class="on-left"
95
+ />
96
+ <q-spinner-hearts
97
+ v-if="options.style.btn.loading.type === 'hearts'"
98
+ :color="options.style.btn.loading.color"
99
+ class="on-left"
100
+ />
101
+ <q-spinner-hourglass
102
+ v-if="options.style.btn.loading.type === 'hourglass'"
103
+ :color="options.style.btn.loading.color"
104
+ class="on-left"
105
+ />
106
+ <q-spinner-infinity
107
+ v-if="options.style.btn.loading.type === 'infinity'"
108
+ :color="options.style.btn.loading.color"
109
+ class="on-left"
110
+ />
111
+ <q-spinner-ios
112
+ v-if="options.style.btn.loading.type === 'ios'"
113
+ :color="options.style.btn.loading.color"
114
+ class="on-left"
115
+ />
116
+ <q-spinner-orbit
117
+ v-if="options.style.btn.loading.type === 'orbit'"
118
+ :color="options.style.btn.loading.color"
119
+ class="on-left"
120
+ />
121
+ <q-spinner-oval
122
+ v-if="options.style.btn.loading.type === 'oval'"
123
+ :color="options.style.btn.loading.color"
124
+ class="on-left"
125
+ />
126
+ <q-spinner-pie
127
+ v-if="options.style.btn.loading.type === 'pie'"
128
+ :color="options.style.btn.loading.color"
129
+ class="on-left"
130
+ />
131
+ <q-spinner-puff
132
+ v-if="options.style.btn.loading.type === 'puff'"
133
+ :color="options.style.btn.loading.color"
134
+ class="on-left"
135
+ />
136
+ <q-spinner-radio
137
+ v-if="options.style.btn.loading.type === 'radio'"
138
+ :color="options.style.btn.loading.color"
139
+ class="on-left"
140
+ />
141
+ <q-spinner-rings
142
+ v-if="options.style.btn.loading.type === 'rings'"
143
+ :color="options.style.btn.loading.color"
144
+ class="on-left"
145
+ />
146
+ <q-spinner-tail
147
+ v-if="options.style.btn.loading.type === 'tail'"
148
+ :color="options.style.btn.loading.color"
149
+ class="on-left"
150
+ />
151
+ <template v-if="options.style.btn.loading.label === !0">
152
+ {{ getLabel }}
153
+ </template>
154
+ </template>
155
+ <template
156
+ v-else-if="!!$slots.loading"
157
+ #loading
158
+ >
159
+ <slot name="loading" />
160
+ </template>
161
+ <template
162
+ v-if="!!$slots.default"
163
+ #default
164
+ >
165
+ <slot name="default" />
166
+ </template>
167
+ </q-btn>
168
+ </template>
@@ -0,0 +1,4 @@
1
+
2
+ export * from './vue-plugin'
3
+ import * as VuePlugin from './vue-plugin'
4
+ export default VuePlugin
@@ -0,0 +1,5 @@
1
+
2
+ import * as VuePlugin from './vue-plugin'
3
+
4
+ export * from './vue-plugin'
5
+ export default VuePlugin
package/src/index.sass ADDED
@@ -0,0 +1,7 @@
1
+ @import 'quasar/src/css/variables.sass'
2
+
3
+ @import './components/Component.sass'
4
+
5
+
6
+ @import './directives/Directive.sass'
7
+
@@ -0,0 +1,3 @@
1
+
2
+ import * as VuePlugin from './vue-plugin'
3
+ export default VuePlugin
@@ -0,0 +1,5 @@
1
+ import type { QBtnProps } from 'quasar'
2
+
3
+ export interface MBtnProps extends QBtnProps {
4
+ //
5
+ }
@@ -0,0 +1,17 @@
1
+ import type { QBtnProps } from 'quasar'
2
+
3
+ export interface PluginOptions {
4
+ components?: {
5
+ btn?: QBtnProps;
6
+ };
7
+ style?: {
8
+ btn?: {
9
+ loading?: {
10
+ type: 'audio' | 'ball' | 'bars' | 'box' | 'clock' | 'comment' | 'cube' | 'dots' | 'facebook' | 'gears' | 'grid' | 'hearts' | 'hourglass' | 'infinity' | 'ios' | 'orbit' | 'oval' | 'pie' | 'puff' | 'radio' | 'rings' | 'tail';
11
+ color?: string | undefined;
12
+ size?: string | undefined;
13
+ label?: boolean | undefined;
14
+ }
15
+ }
16
+ }
17
+ }
package/src/utils.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { ref } from 'vue'
2
+ import type { PluginOptions } from './types/VuePlugin'
3
+
4
+ export const PLUGIN_OPTIONS = ref<PluginOptions>({
5
+ //props: {}
6
+ })
@@ -0,0 +1,16 @@
1
+ import MBtn from './components/MBtn.vue'
2
+ import js from '../package.json'
3
+ import { PLUGIN_OPTIONS } from './utils'
4
+
5
+ const version = js.version
6
+
7
+ function install (app, options = {}) {
8
+ PLUGIN_OPTIONS.value = options
9
+ app.component(MBtn.name, MBtn)
10
+ }
11
+
12
+ export {
13
+ version,
14
+ PLUGIN_OPTIONS,
15
+ install
16
+ }