@simsustech/quasar-components 0.1.3 → 0.2.0
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/CHANGELOG.md +6 -0
- package/dist/{QSubmitButton.vue_vue_type_script_setup_true_lang.1d0c06eb.js → QSubmitButton.vue_vue_type_script_setup_true_lang.65d6ac94.js} +6 -2
- package/dist/authentication.js +3 -3
- package/dist/en-US.d5751f99.js +217 -0
- package/dist/flags.js +5 -215
- package/dist/form.js +492 -0
- package/dist/general.js +341 -12
- package/dist/icons.js +2 -2
- package/dist/{nl.6b0aedb7.js → nl.1df15493.js} +1 -1
- package/dist/nl.7a710ba4.js +35 -0
- package/dist/style.css +2 -2
- package/dist/types/ui/form/BooleanItem.vue.d.ts +57 -0
- package/dist/types/ui/form/BooleanSelect.vue.d.ts +66 -0
- package/dist/types/ui/form/DateInput.vue.d.ts +61 -0
- package/dist/types/ui/form/FormInput.vue.d.ts +60 -0
- package/dist/types/ui/form/FormItem.vue.d.ts +64 -0
- package/dist/types/ui/form/GenderItem.vue.d.ts +57 -0
- package/dist/types/ui/form/GenderSelect.vue.d.ts +66 -0
- package/dist/types/ui/form/PostalCodeInput.vue.d.ts +67 -0
- package/dist/types/ui/form/TelephoneNumberInput.vue.d.ts +65 -0
- package/dist/types/ui/form/index.d.ts +9 -0
- package/dist/types/ui/form/lang/en-US.d.ts +3 -0
- package/dist/types/ui/form/lang/index.d.ts +68 -0
- package/dist/types/ui/form/lang/nl.d.ts +3 -0
- package/dist/types/ui/general/QLanguageSelect.vue.d.ts +58 -0
- package/dist/types/ui/general/QSubmitButton.vue.d.ts +21 -1
- package/dist/types/ui/general/ResourcePage.vue.d.ts +159 -0
- package/dist/types/ui/general/ResponsiveDialog.vue.d.ts +108 -0
- package/dist/types/ui/general/index.d.ts +3 -0
- package/dist/types/virtualModules.d.ts +1 -0
- package/dist/virtualModules.d.ts +1 -0
- package/dist/virtualModules.js +3 -2
- package/dist/vite-plugin.js +26 -5
- package/package.json +6 -1
- package/src/ui/authentication/lang/en-US.ts +1 -2
- package/src/ui/authentication/lang/nl.ts +1 -2
- package/src/ui/flags/README.md +1 -1
- package/src/ui/form/BooleanItem.vue +34 -0
- package/src/ui/form/BooleanSelect.vue +55 -0
- package/src/ui/form/DateInput.vue +70 -0
- package/src/ui/form/FormInput.vue +44 -0
- package/src/ui/form/FormItem.vue +50 -0
- package/src/ui/form/GenderItem.vue +35 -0
- package/src/ui/form/GenderSelect.vue +59 -0
- package/src/ui/form/PostalCodeInput.vue +47 -0
- package/src/ui/form/TelephoneNumberInput.vue +35 -0
- package/src/ui/form/index.ts +9 -0
- package/src/ui/form/lang/en-US.ts +36 -0
- package/src/ui/form/lang/index.ts +70 -0
- package/src/ui/form/lang/nl.ts +36 -0
- package/src/ui/general/QLanguageSelect.vue +86 -0
- package/src/ui/general/QStyledCard.vue +1 -1
- package/src/ui/general/QSubmitButton.vue +6 -1
- package/src/ui/general/ResourcePage.vue +121 -0
- package/src/ui/general/ResponsiveDialog.vue +94 -0
- package/src/ui/general/index.ts +3 -0
- package/src/ui/icons/README.md +2 -0
- package/src/virtualModules.ts +48 -5
- package/src/vite-plugin.ts +26 -6
- package/vite.config.ts +30 -30
- package/dist/types/ui/index.d.ts +0 -1
- package/src/ui/index.ts +0 -1
- /package/dist/types/ui/icons/{icons.d.ts → labels.d.ts} +0 -0
- /package/src/ui/icons/{icons.ts → labels.ts} +0 -0
package/src/virtualModules.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const FlagIcon = (locale: string) => `
|
|
2
2
|
import { computed, ref, watch, h } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import { useQuasar, QIcon } from 'quasar'
|
|
4
4
|
import { useLang, loadLang } from '${
|
|
5
5
|
new URL(`../src/ui/flags/lang`, import.meta.url).pathname
|
|
6
6
|
}'
|
|
@@ -20,6 +20,7 @@ export const FlagIcon = (locale: string) => `
|
|
|
20
20
|
() => lang.value.countries['${locale}']
|
|
21
21
|
)
|
|
22
22
|
// @ts-ignore
|
|
23
|
+
// const language = computed(() => lang.value.languages['${locale}'])
|
|
23
24
|
const language = computed(() => lang.value.languages['${locale}'])
|
|
24
25
|
const variables = ref({
|
|
25
26
|
country,
|
|
@@ -42,18 +43,18 @@ export const FlagIcon = (locale: string) => `
|
|
|
42
43
|
|
|
43
44
|
export const Icon = (icon: string) => `
|
|
44
45
|
import { computed, ref, watch, h } from 'vue'
|
|
45
|
-
import {
|
|
46
|
+
import { useQuasar, QIcon } from 'quasar'
|
|
46
47
|
import icon from '${
|
|
47
48
|
new URL(`../src/ui/icons/assets/${icon}.svg`, import.meta.url).pathname
|
|
48
49
|
}'
|
|
49
|
-
import
|
|
50
|
-
new URL(`../src/ui/icons/
|
|
50
|
+
import labels from '${
|
|
51
|
+
new URL(`../src/ui/icons/labels.ts`, import.meta.url).pathname
|
|
51
52
|
}'
|
|
52
53
|
export default {
|
|
53
54
|
setup(props, context) {
|
|
54
55
|
const $q = useQuasar()
|
|
55
56
|
|
|
56
|
-
const variables = ref(
|
|
57
|
+
const variables = ref(labels['${icon}'])
|
|
57
58
|
|
|
58
59
|
const functions = ref({
|
|
59
60
|
// submit
|
|
@@ -68,3 +69,45 @@ export const Icon = (icon: string) => `
|
|
|
68
69
|
return () => h(QIcon, { name: \`img:\${icon}\` })
|
|
69
70
|
}}
|
|
70
71
|
`
|
|
72
|
+
|
|
73
|
+
export const FormItem = (field: string) => `
|
|
74
|
+
import { ref, watch, useAttrs, h } from 'vue'
|
|
75
|
+
import { QItem, QItemLabel, QItemSection, useQuasar } from 'quasar'
|
|
76
|
+
import { useLang, loadLang } from '${
|
|
77
|
+
new URL(`../src/ui/form/lang/index.ts`, import.meta.url).pathname
|
|
78
|
+
}'
|
|
79
|
+
|
|
80
|
+
export default {
|
|
81
|
+
setup(props, context) {
|
|
82
|
+
const $q = useQuasar()
|
|
83
|
+
const attrs = useAttrs()
|
|
84
|
+
|
|
85
|
+
const lang = useLang()
|
|
86
|
+
|
|
87
|
+
if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
|
|
88
|
+
watch($q.lang, (val) => {
|
|
89
|
+
loadLang($q.lang.isoName)
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
const variables = ref({})
|
|
93
|
+
|
|
94
|
+
const functions = ref({
|
|
95
|
+
// submit
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
context.expose({
|
|
99
|
+
variables,
|
|
100
|
+
functions
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// return the render function
|
|
104
|
+
return () =>
|
|
105
|
+
h(QItem, { attrs }, [
|
|
106
|
+
h(QItemSection, {}, [
|
|
107
|
+
h(QItemLabel, { overline: true }, 'field'),
|
|
108
|
+
h(QItemLabel, {}, 'field')
|
|
109
|
+
])
|
|
110
|
+
])
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
`
|
package/src/vite-plugin.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Plugin } from 'vite'
|
|
2
2
|
import { promises } from 'fs'
|
|
3
|
+
import { Icon, FlagIcon } from './virtualModules.js'
|
|
3
4
|
const { readFile } = promises
|
|
4
5
|
|
|
5
6
|
export default async function ({
|
|
@@ -25,20 +26,39 @@ export default async function ({
|
|
|
25
26
|
|
|
26
27
|
return {
|
|
27
28
|
name: `${name}-plugin`,
|
|
29
|
+
enforce: 'pre',
|
|
30
|
+
resolveId: (id) => {
|
|
31
|
+
if (id.includes('.flag')) return id
|
|
32
|
+
else if (id.includes('.icon')) return id
|
|
33
|
+
},
|
|
34
|
+
load: (id) => {
|
|
35
|
+
if (id.includes('.flag')) {
|
|
36
|
+
const locale = id.slice(0, -5)
|
|
37
|
+
const flag = FlagIcon(locale)
|
|
38
|
+
return flag
|
|
39
|
+
} else if (id.includes('.icon')) {
|
|
40
|
+
const iconId = id.slice(0, -5)
|
|
41
|
+
const icon = Icon(iconId)
|
|
42
|
+
return icon
|
|
43
|
+
}
|
|
44
|
+
},
|
|
28
45
|
config(config, { mode }) {
|
|
29
46
|
if (mode === 'development' || buildFromSrc) {
|
|
30
47
|
const alias = Object.entries(exports)
|
|
48
|
+
.filter(([key, val]) => {
|
|
49
|
+
return val.src
|
|
50
|
+
})
|
|
31
51
|
.map(([key, val]) => {
|
|
32
52
|
return {
|
|
33
|
-
find:
|
|
53
|
+
find: new RegExp(
|
|
54
|
+
`^${
|
|
55
|
+
name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + key.slice(1)
|
|
56
|
+
}$`
|
|
57
|
+
),
|
|
58
|
+
// name: name + key.slice(1),
|
|
34
59
|
replacement: new URL('.' + val.src, import.meta.url).pathname
|
|
35
60
|
}
|
|
36
61
|
})
|
|
37
|
-
.sort(
|
|
38
|
-
(a, b) =>
|
|
39
|
-
(b.find.match(/\//g) || []).length -
|
|
40
|
-
(a.find.match(/\//g) || []).length
|
|
41
|
-
)
|
|
42
62
|
|
|
43
63
|
return {
|
|
44
64
|
resolve: {
|
package/vite.config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
1
|
+
import { defineConfig, Plugin } from 'vite'
|
|
2
2
|
import vue from '@vitejs/plugin-vue'
|
|
3
3
|
import Components from 'unplugin-vue-components/vite'
|
|
4
4
|
import { QuasarResolver } from 'unplugin-vue-components/resolvers'
|
|
@@ -74,34 +74,30 @@ import { FlagIcon, Icon } from './src/virtualModules.js'
|
|
|
74
74
|
// }}
|
|
75
75
|
// `
|
|
76
76
|
|
|
77
|
+
export const moduleTransformPlugin: Plugin = {
|
|
78
|
+
name: 'module-tranform-plugin',
|
|
79
|
+
enforce: 'pre',
|
|
80
|
+
resolveId: (id) => {
|
|
81
|
+
if (id.includes('.flag')) return id
|
|
82
|
+
else if (id.includes('.icon')) return id
|
|
83
|
+
},
|
|
84
|
+
load: (id) => {
|
|
85
|
+
if (id.includes('.flag')) {
|
|
86
|
+
const locale = id.slice(0, -5)
|
|
87
|
+
console.log(locale)
|
|
88
|
+
const flag = FlagIcon(locale)
|
|
89
|
+
return flag
|
|
90
|
+
} else if (id.includes('.icon')) {
|
|
91
|
+
const iconId = id.slice(0, -5)
|
|
92
|
+
const icon = Icon(iconId)
|
|
93
|
+
return icon
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
77
98
|
export default defineConfig(async ({ command, mode }) => ({
|
|
78
99
|
plugins: [
|
|
79
|
-
|
|
80
|
-
name: 'module-tranform-plugin',
|
|
81
|
-
enforce: 'pre',
|
|
82
|
-
resolveId: (id) => {
|
|
83
|
-
if (id.includes('.flag')) return id
|
|
84
|
-
else if (id.includes('.icon')) return id
|
|
85
|
-
},
|
|
86
|
-
load: (id) => {
|
|
87
|
-
if (id.includes('.flag')) {
|
|
88
|
-
const locale = id.slice(0, -5)
|
|
89
|
-
const flag = FlagIcon(locale)
|
|
90
|
-
return flag
|
|
91
|
-
} else if (id.includes('.icon')) {
|
|
92
|
-
const iconId = id.slice(0, -5)
|
|
93
|
-
const icon = Icon(iconId)
|
|
94
|
-
return icon
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// resolveId: (source) => {
|
|
98
|
-
// if (source.includes('FlagIcon.vue')) {
|
|
99
|
-
// const split = source.split('FlagIcon.vue')
|
|
100
|
-
// split[0].slice(2)
|
|
101
|
-
// return { id: './FlagIcon.vue' }
|
|
102
|
-
// }
|
|
103
|
-
// }
|
|
104
|
-
},
|
|
100
|
+
moduleTransformPlugin,
|
|
105
101
|
Components({
|
|
106
102
|
resolvers: [QuasarResolver()]
|
|
107
103
|
}),
|
|
@@ -111,7 +107,9 @@ export default defineConfig(async ({ command, mode }) => ({
|
|
|
111
107
|
// minify: false,
|
|
112
108
|
lib: {
|
|
113
109
|
// UMD not supported for code-splitting builds
|
|
114
|
-
fileName:
|
|
110
|
+
fileName: (format, entryName) => {
|
|
111
|
+
return entryName + '.js'
|
|
112
|
+
},
|
|
115
113
|
formats: ['es'],
|
|
116
114
|
entry: './src/ui/index.ts'
|
|
117
115
|
},
|
|
@@ -125,10 +123,12 @@ export default defineConfig(async ({ command, mode }) => ({
|
|
|
125
123
|
).pathname,
|
|
126
124
|
general: new URL('./src/ui/general/index.ts', import.meta.url).pathname,
|
|
127
125
|
flags: new URL('./src/ui/flags/index.ts', import.meta.url).pathname,
|
|
128
|
-
icons: new URL('./src/ui/icons/index.ts', import.meta.url).pathname
|
|
126
|
+
icons: new URL('./src/ui/icons/index.ts', import.meta.url).pathname,
|
|
127
|
+
form: new URL('./src/ui/form/index.ts', import.meta.url).pathname
|
|
129
128
|
},
|
|
130
129
|
output: {
|
|
131
|
-
entryFileNames: '[name].js'
|
|
130
|
+
// entryFileNames: '[name].js',
|
|
131
|
+
// assetFileNames: '[name].[ext]'
|
|
132
132
|
},
|
|
133
133
|
external: ['vue', 'vue-router', 'quasar']
|
|
134
134
|
}
|
package/dist/types/ui/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './general/index';
|
package/src/ui/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './general/index'
|
|
File without changes
|
|
File without changes
|