@simsustech/quasar-components 0.11.26 → 0.12.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/CHANGELOG.md +12 -0
- package/dist/LocaleSelect-BqkjbcKS.js +460 -0
- package/dist/QSubmitButton-Chc7dndx.js +101 -0
- package/dist/authentication.js +1935 -2031
- package/dist/form.js +1093 -1118
- package/dist/general.js +319 -361
- package/dist/md3.js +406 -395
- package/dist/nl-DIfqXZG_.js +354 -0
- package/dist/nl-DWmQiCdO.js +12 -0
- package/dist/nl-DbV07Lx7.js +106 -0
- package/dist/nl-ZpgX9FUw.js +4 -0
- package/dist/quasar-components.css +5 -4
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/types/{ui → src/ui}/authentication/LoginForm.vue.d.ts +5 -0
- package/dist/types/{ui/form/LocaleSelect.vue.d.ts → src/ui/form/CountrySelect.vue.d.ts} +8 -5
- package/dist/types/src/ui/form/LocaleSelect.vue.d.ts +28 -0
- package/dist/types/{ui → src/ui}/form/index.d.ts +2 -1
- package/dist/types/src/ui/form/lang/index.d.ts +817 -0
- package/dist/types/{ui → src/ui}/general/QLanguageSelect.vue.d.ts +4 -4
- package/dist/virtualModules.js +62 -2
- package/dist/vite-plugin.js +50 -101
- package/package.json +34 -34
- package/src/ui/authentication/LoginForm.vue +9 -4
- package/src/ui/form/CountrySelect.vue +83 -0
- package/src/ui/form/LocaleSelect.vue +27 -8
- package/src/ui/form/index.ts +9 -1
- package/src/ui/form/lang/en-US.ts +112 -356
- package/src/ui/form/lang/index.ts +173 -377
- package/src/ui/form/lang/nl.ts +108 -352
- package/src/ui/general/QLanguageSelect.vue +20 -16
- package/tsconfig.json +1 -0
- package/tsconfig.node.json +2 -1
- package/tsconfig.types.json +2 -1
- package/dist/LocaleSelect.vue_vue_type_script_setup_true_lang-DFwcmPnu.js +0 -584
- package/dist/QSubmitButton.vue_vue_type_script_setup_true_lang-D-I0Gws4.js +0 -109
- package/dist/nl-BJwNz421.js +0 -453
- package/dist/nl-CneFq5NZ.js +0 -112
- package/dist/nl-NLgZUAKl.js +0 -6
- package/dist/nl-X50pmfG-.js +0 -12
- package/dist/types/ui/form/lang/index.d.ts +0 -1353
- package/eslint.config.js +0 -29
- package/dist/types/{ui → src/ui}/authentication/AccountsTable.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/ConsentList.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/EmailChangeForm.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/EmailChangeStepper.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/LoginButton.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/LogoutButton.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/LogoutForm.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/OtpInput.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/PasswordChangeForm.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/PasswordChangeStepper.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/RegisterForm.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/RequestOtpForm.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/UserMenuButton.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/VerificationSlider.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/index.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/lang/en-US.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/lang/index.d.ts +0 -0
- package/dist/types/{ui → src/ui}/authentication/lang/nl.d.ts +0 -0
- package/dist/types/{ui → src/ui}/flags/index.d.ts +0 -0
- package/dist/types/{ui → src/ui}/flags/lang/en-US.d.ts +0 -0
- package/dist/types/{ui → src/ui}/flags/lang/index.d.ts +0 -0
- package/dist/types/{ui → src/ui}/flags/lang/nl.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/BooleanItem.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/BooleanSelect.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/CronScheduleInput.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/CurrencySelect.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/DateInput.vue.d.ts +1 -1
- package/dist/types/{ui → src/ui}/form/DatePicker.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/EmailInput.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/FilteredModelSelect.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/FormInput.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/FormItem.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/GenderItem.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/GenderSelect.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/PostalCodeInput.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/TelephoneNumberInput.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/lang/en-US.d.ts +0 -0
- package/dist/types/{ui → src/ui}/form/lang/nl.d.ts +0 -0
- package/dist/types/{ui → src/ui}/general/QDrawerList.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/general/QStyledCard.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/general/QStyledLayout.vue.d.ts +0 -0
- package/dist/types/{ui → src/ui}/general/QSubmitButton.vue.d.ts +1 -1
- package/dist/types/{ui → src/ui}/general/ResourcePage.vue.d.ts +1 -1
- /package/dist/types/{ui → src/ui}/general/ResponsiveDialog.vue.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/general/index.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/general/lang/en-US.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/general/lang/index.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/general/lang/nl.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/icons/index.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/icons/labels.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/md3/Md3Layout.vue.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/md3/NavigationRailFabs.vue.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/md3/index.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/md3/lang/en-US.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/md3/lang/index.d.ts +0 -0
- /package/dist/types/{ui → src/ui}/md3/lang/nl.d.ts +0 -0
- /package/dist/types/{virtualModules.d.ts → src/virtualModules.d.ts} +0 -0
- /package/dist/types/{vite-plugin.d.ts → src/vite-plugin.d.ts} +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { QuasarLanguage } from 'quasar';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ISO639, Locales } from '../form/lang/index.js';
|
|
3
3
|
export interface Props {
|
|
4
|
-
modelValue:
|
|
5
|
-
languageImports: Record<
|
|
4
|
+
modelValue: Locales;
|
|
5
|
+
languageImports: Record<ISO639 | Locales, () => Promise<{
|
|
6
6
|
default: QuasarLanguage;
|
|
7
7
|
}>>;
|
|
8
8
|
locales: {
|
|
9
9
|
icon: string;
|
|
10
|
-
|
|
10
|
+
bcp47: Locales;
|
|
11
11
|
}[];
|
|
12
12
|
}
|
|
13
13
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
package/dist/virtualModules.js
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export const FlagIcon = (locale) => `
|
|
2
|
+
import { computed, ref, watch, h } from 'vue'
|
|
3
|
+
import { useQuasar, QIcon } from 'quasar'
|
|
4
|
+
import { useLang, loadLang } from '${new URL(`../src/ui/flags/lang`, import.meta.url).pathname}'
|
|
5
|
+
import icon from '${new URL(`../src/ui/flags/assets/${locale}.svg`, import.meta.url).pathname}'
|
|
6
|
+
export default {
|
|
7
|
+
setup(props, context) {
|
|
8
|
+
const $q = useQuasar()
|
|
9
|
+
const lang = useLang()
|
|
10
|
+
if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
|
|
11
|
+
watch($q.lang, (val) => {
|
|
12
|
+
loadLang($q.lang.isoName)
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const country = computed(
|
|
16
|
+
() => lang.value.countries['${locale}']
|
|
17
|
+
)
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
// const language = computed(() => lang.value.languages['${locale}'])
|
|
20
|
+
const language = computed(() => lang.value.languages['${locale}'])
|
|
21
|
+
const variables = ref({
|
|
22
|
+
country,
|
|
23
|
+
language
|
|
24
|
+
// header: lang.value.some.nested.prop
|
|
25
|
+
})
|
|
26
|
+
const functions = ref({
|
|
27
|
+
// submit
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
context.expose({
|
|
31
|
+
variables,
|
|
32
|
+
functions
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// return the render function
|
|
36
|
+
return () => h(QIcon, { name: \`img:\${icon}\` })
|
|
37
|
+
}}
|
|
38
|
+
`;
|
|
39
|
+
export const Icon = (icon) => `
|
|
40
|
+
import { computed, ref, watch, h } from 'vue'
|
|
41
|
+
import { useQuasar, QIcon } from 'quasar'
|
|
42
|
+
import icon from '${new URL(`../src/ui/icons/assets/${icon}.svg`, import.meta.url).pathname}'
|
|
43
|
+
import labels from '${new URL(`../src/ui/icons/labels.ts`, import.meta.url).pathname}'
|
|
44
|
+
export default {
|
|
45
|
+
setup(props, context) {
|
|
46
|
+
const $q = useQuasar()
|
|
47
|
+
|
|
48
|
+
const variables = ref(labels['${icon}'])
|
|
49
|
+
|
|
50
|
+
const functions = ref({
|
|
51
|
+
// submit
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
context.expose({
|
|
55
|
+
variables,
|
|
56
|
+
functions
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
// return the render function
|
|
60
|
+
return () => h(QIcon, { name: \`img:\${icon}\` })
|
|
61
|
+
}}
|
|
62
|
+
`;
|
|
3
63
|
// export const FormItem = (field: string) => `
|
|
4
64
|
// import { ref, watch, useAttrs, h } from 'vue'
|
|
5
65
|
// import { QItem, QItemLabel, QItemSection, useQuasar } from 'quasar'
|
package/dist/vite-plugin.js
CHANGED
|
@@ -1,106 +1,55 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
-
function step(op) {
|
|
15
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
-
switch (op[0]) {
|
|
20
|
-
case 0: case 1: t = op; break;
|
|
21
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
-
default:
|
|
25
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
-
if (t[2]) _.ops.pop();
|
|
30
|
-
_.trys.pop(); continue;
|
|
31
|
-
}
|
|
32
|
-
op = body.call(thisArg, _);
|
|
33
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
1
|
import { promises } from 'fs';
|
|
38
2
|
import { Icon, FlagIcon } from './virtualModules.js';
|
|
39
|
-
|
|
3
|
+
const { readFile } = promises;
|
|
40
4
|
import { fileURLToPath } from 'node:url';
|
|
41
|
-
export default function () {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// name: name + key.slice(1),
|
|
88
|
-
replacement: new URL('.' + val.src, import.meta.url).pathname
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
return {
|
|
92
|
-
resolve: {
|
|
93
|
-
alias: alias
|
|
94
|
-
},
|
|
95
|
-
optimizeDeps: {
|
|
96
|
-
exclude: ['@simsustech/quasar-components']
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
return {};
|
|
101
|
-
}
|
|
102
|
-
}];
|
|
5
|
+
export default async function ({ buildFromSrc } = {}) {
|
|
6
|
+
const pkgJson = JSON.parse(await readFile(fileURLToPath(new URL('../package.json', import.meta.url)), 'utf-8'));
|
|
7
|
+
const exports = pkgJson.exports;
|
|
8
|
+
const name = pkgJson.name;
|
|
9
|
+
return {
|
|
10
|
+
name: `${name}-plugin`,
|
|
11
|
+
enforce: 'pre',
|
|
12
|
+
resolveId: (id) => {
|
|
13
|
+
if (id.includes('.flag'))
|
|
14
|
+
return id;
|
|
15
|
+
else if (id.includes('.icon'))
|
|
16
|
+
return id;
|
|
17
|
+
},
|
|
18
|
+
load: (id) => {
|
|
19
|
+
if (id.includes('.flag')) {
|
|
20
|
+
const locale = id.slice(0, -5);
|
|
21
|
+
const flag = FlagIcon(locale);
|
|
22
|
+
return flag;
|
|
23
|
+
}
|
|
24
|
+
else if (id.includes('.icon')) {
|
|
25
|
+
const iconId = id.slice(0, -5);
|
|
26
|
+
const icon = Icon(iconId);
|
|
27
|
+
return icon;
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
config(config, { mode }) {
|
|
31
|
+
if (mode === 'development' || buildFromSrc) {
|
|
32
|
+
const alias = Object.entries(exports)
|
|
33
|
+
.filter(([, val]) => {
|
|
34
|
+
return val.src;
|
|
35
|
+
})
|
|
36
|
+
.map(([key, val]) => {
|
|
37
|
+
return {
|
|
38
|
+
find: new RegExp(`^${name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + key.slice(1)}$`),
|
|
39
|
+
// name: name + key.slice(1),
|
|
40
|
+
replacement: new URL('.' + val.src, import.meta.url).pathname
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
resolve: {
|
|
45
|
+
alias
|
|
46
|
+
},
|
|
47
|
+
optimizeDeps: {
|
|
48
|
+
exclude: ['@simsustech/quasar-components']
|
|
49
|
+
}
|
|
50
|
+
};
|
|
103
51
|
}
|
|
104
|
-
|
|
105
|
-
|
|
52
|
+
return {};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
106
55
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simsustech/quasar-components",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"author": "Stefan van Herwijnen",
|
|
3
|
+
"version": "0.12.1",
|
|
5
4
|
"description": "High level components for Quasar Framework",
|
|
5
|
+
"bugs": "https://github.com/simsusech/quasar-components/issues",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"author": "Stefan van Herwijnen",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/simsustech/quasar-components"
|
|
11
|
+
},
|
|
7
12
|
"type": "module",
|
|
8
13
|
"types": "./dist/types/ui/index.d.ts",
|
|
9
14
|
"exports": {
|
|
@@ -45,55 +50,50 @@
|
|
|
45
50
|
"import": "./dist/vite-plugin.js"
|
|
46
51
|
}
|
|
47
52
|
},
|
|
48
|
-
"repository": {
|
|
49
|
-
"type": "git",
|
|
50
|
-
"url": "https://github.com/simsustech/quasar-components"
|
|
51
|
-
},
|
|
52
|
-
"bugs": "https://github.com/simsusech/quasar-components/issues",
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@vueuse/core": "^14.
|
|
55
|
-
"validator": "^13.15.
|
|
56
|
-
},
|
|
57
|
-
"peerDependencies": {
|
|
58
|
-
"quasar": "^2.18.6"
|
|
54
|
+
"@vueuse/core": "^14.3.0",
|
|
55
|
+
"validator": "^13.15.35"
|
|
59
56
|
},
|
|
60
57
|
"devDependencies": {
|
|
61
58
|
"@iconify-json/flagpack": "^1.2.7",
|
|
62
|
-
"@types/node": "^25.
|
|
59
|
+
"@types/node": "^25.9.1",
|
|
63
60
|
"@types/validator": "^13.15.10",
|
|
64
61
|
"@types/ws": "^8.18.1",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
66
|
-
"@typescript-eslint/parser": "^8.
|
|
67
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
68
|
-
"@vue/server-renderer": "^3.5.
|
|
69
|
-
"eslint": "^10.
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.60.0",
|
|
63
|
+
"@typescript-eslint/parser": "^8.60.0",
|
|
64
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
65
|
+
"@vue/server-renderer": "^3.5.35",
|
|
66
|
+
"eslint": "^10.4.0",
|
|
70
67
|
"eslint-config-prettier": "^10.1.8",
|
|
71
68
|
"eslint-plugin-prettier": "^5.5.5",
|
|
72
69
|
"eslint-plugin-prettier-vue": "^5.0.0",
|
|
73
|
-
"eslint-plugin-vue": "^10.
|
|
74
|
-
"glob": "^13.0.
|
|
75
|
-
"local-pkg": "^1.1
|
|
76
|
-
"prettier": "^3.8.
|
|
77
|
-
"quasar": "^2.
|
|
70
|
+
"eslint-plugin-vue": "^10.9.1",
|
|
71
|
+
"glob": "^13.0.6",
|
|
72
|
+
"local-pkg": "^1.2.1",
|
|
73
|
+
"prettier": "^3.8.3",
|
|
74
|
+
"quasar": "^2.19.3",
|
|
78
75
|
"rimraf": "^6.1.3",
|
|
79
|
-
"typescript": "
|
|
80
|
-
"typescript-eslint": "^8.
|
|
81
|
-
"unplugin-vue-components": "^
|
|
82
|
-
"vite": "^
|
|
83
|
-
"vue": "^3.5.
|
|
76
|
+
"typescript": "6.0.3",
|
|
77
|
+
"typescript-eslint": "^8.60.0",
|
|
78
|
+
"unplugin-vue-components": "^32.1.0",
|
|
79
|
+
"vite": "^8.0.14",
|
|
80
|
+
"vue": "^3.5.35",
|
|
84
81
|
"vue-eslint-parser": "^10.4.0",
|
|
85
|
-
"vue-router": "^5.0.
|
|
86
|
-
"vue-tsc": "^3.2
|
|
82
|
+
"vue-router": "^5.0.7",
|
|
83
|
+
"vue-tsc": "^3.3.2"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"quasar": "^2.19.3"
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
89
|
"build:plugin": "vite build",
|
|
90
90
|
"build:vite-plugin": "rimraf tsconfig.build.plugin.tsbuildinfo && tsc -p tsconfig.build.plugin.json",
|
|
91
91
|
"generate:types": "vue-tsc -p tsconfig.types.json",
|
|
92
92
|
"build": "run-s build:plugin build:vite-plugin generate:types",
|
|
93
|
-
"lint": "
|
|
94
|
-
"lint:fix": "
|
|
95
|
-
"format:check": "
|
|
96
|
-
"format:write": "
|
|
93
|
+
"lint": "oxlint src",
|
|
94
|
+
"lint:fix": "oxlint src --fix",
|
|
95
|
+
"format:check": "oxfmt --check .",
|
|
96
|
+
"format:write": "oxfmt --write .",
|
|
97
97
|
"test": "echo \"Error: no test specified\" && exit 0"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -96,9 +96,14 @@ export interface Props {
|
|
|
96
96
|
visibility: string
|
|
97
97
|
visibilifyOff: string
|
|
98
98
|
}
|
|
99
|
+
defaultCredentials?: {
|
|
100
|
+
username?: string
|
|
101
|
+
email: string
|
|
102
|
+
password: string
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
const props = defineProps<Props>()
|
|
101
|
-
const { icons } = toRefs(props)
|
|
106
|
+
const { icons, defaultCredentials } = toRefs(props)
|
|
102
107
|
|
|
103
108
|
// const attrs = useAttrs();
|
|
104
109
|
const emit = defineEmits<{
|
|
@@ -124,9 +129,9 @@ watch($q.lang, (val) => {
|
|
|
124
129
|
loadLang($q.lang.isoName)
|
|
125
130
|
})
|
|
126
131
|
|
|
127
|
-
const email = ref('')
|
|
128
|
-
const password = ref('')
|
|
129
|
-
const username = ref('')
|
|
132
|
+
const email = ref(defaultCredentials.value?.email ?? '')
|
|
133
|
+
const password = ref(defaultCredentials.value?.password ?? '')
|
|
134
|
+
const username = ref(defaultCredentials.value?.username ?? '')
|
|
130
135
|
const showPassword = ref(false)
|
|
131
136
|
const header = computed(() => lang.value.login.login)
|
|
132
137
|
const createAccount = computed(() => lang.value.login.createAccount)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-select
|
|
3
|
+
v-bind="attrs"
|
|
4
|
+
:options="countryOptions"
|
|
5
|
+
:model-value="modelValue"
|
|
6
|
+
:filled="false"
|
|
7
|
+
emit-value
|
|
8
|
+
map-options
|
|
9
|
+
@update:model-value="(val: string) => emit('update:modelValue', val)"
|
|
10
|
+
>
|
|
11
|
+
<template #selected-item="scope">
|
|
12
|
+
<q-item v-if="scope.opt && isItem">
|
|
13
|
+
<q-item-section avatar>
|
|
14
|
+
<q-icon :name="scope.opt.icon" />
|
|
15
|
+
</q-item-section>
|
|
16
|
+
<q-item-section>
|
|
17
|
+
<q-item-label>
|
|
18
|
+
{{ scope.opt.label }}
|
|
19
|
+
</q-item-label>
|
|
20
|
+
</q-item-section>
|
|
21
|
+
</q-item>
|
|
22
|
+
<div v-else-if="scope.opt">
|
|
23
|
+
<q-icon :name="scope.opt.icon" />
|
|
24
|
+
{{ scope.opt.label }}
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<template #option="scope">
|
|
28
|
+
<q-item v-bind="scope.itemProps">
|
|
29
|
+
<q-item-section avatar>
|
|
30
|
+
<q-icon :name="scope.opt.icon" />
|
|
31
|
+
</q-item-section>
|
|
32
|
+
<q-item-section>
|
|
33
|
+
<q-item-label>
|
|
34
|
+
{{ scope.opt.label }}
|
|
35
|
+
</q-item-label>
|
|
36
|
+
</q-item-section>
|
|
37
|
+
</q-item>
|
|
38
|
+
</template>
|
|
39
|
+
</q-select>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup lang="ts">
|
|
43
|
+
import { useAttrs, computed, toRefs, ref } from 'vue'
|
|
44
|
+
import { QSelect } from 'quasar'
|
|
45
|
+
import { ISO3166, useLang } from './lang/index.js'
|
|
46
|
+
|
|
47
|
+
export interface Props {
|
|
48
|
+
modelValue: ISO3166
|
|
49
|
+
countries: {
|
|
50
|
+
icon: string
|
|
51
|
+
iso3166: ISO3166
|
|
52
|
+
}[]
|
|
53
|
+
isItem?: boolean
|
|
54
|
+
}
|
|
55
|
+
const props = defineProps<Props>()
|
|
56
|
+
const emit = defineEmits(['update:modelValue'])
|
|
57
|
+
const { modelValue, countries } = toRefs(props)
|
|
58
|
+
|
|
59
|
+
const lang = useLang()
|
|
60
|
+
const attrs = useAttrs()
|
|
61
|
+
|
|
62
|
+
const countryOptions = computed(() => {
|
|
63
|
+
const options = countries.value.map((country) => ({
|
|
64
|
+
label: lang.value.countries[country.iso3166],
|
|
65
|
+
value: country.iso3166,
|
|
66
|
+
icon: country.icon
|
|
67
|
+
}))
|
|
68
|
+
|
|
69
|
+
return options
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const variables = ref({
|
|
73
|
+
//
|
|
74
|
+
})
|
|
75
|
+
const functions = ref({
|
|
76
|
+
//
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
defineExpose({
|
|
80
|
+
variables,
|
|
81
|
+
functions
|
|
82
|
+
})
|
|
83
|
+
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<q-select
|
|
3
3
|
v-bind="attrs"
|
|
4
|
-
:options="
|
|
4
|
+
:options="localeOptions"
|
|
5
5
|
:model-value="modelValue"
|
|
6
6
|
:filled="false"
|
|
7
7
|
emit-value
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<script setup lang="ts">
|
|
43
|
-
import { useAttrs, computed, toRefs } from 'vue'
|
|
43
|
+
import { useAttrs, computed, toRefs, ref } from 'vue'
|
|
44
44
|
import { QSelect } from 'quasar'
|
|
45
|
-
import { Language, useLang } from './lang/index.js'
|
|
45
|
+
import { type Language, type Locales, useLang } from './lang/index.js'
|
|
46
46
|
|
|
47
47
|
export interface Props {
|
|
48
|
-
modelValue:
|
|
48
|
+
modelValue: Locales
|
|
49
49
|
locales: {
|
|
50
50
|
icon: string
|
|
51
|
-
|
|
51
|
+
bcp47: Locales
|
|
52
52
|
}[]
|
|
53
53
|
isItem?: boolean
|
|
54
54
|
}
|
|
@@ -59,13 +59,32 @@ const { modelValue, locales } = toRefs(props)
|
|
|
59
59
|
const lang = useLang()
|
|
60
60
|
const attrs = useAttrs()
|
|
61
61
|
|
|
62
|
-
const
|
|
62
|
+
const localeOptions = computed(() => {
|
|
63
63
|
const options = locales.value.map((locale) => ({
|
|
64
|
-
label:
|
|
65
|
-
value: locale.
|
|
64
|
+
label: getLanguageLabel(locale.bcp47),
|
|
65
|
+
value: locale.bcp47,
|
|
66
66
|
icon: locale.icon
|
|
67
67
|
}))
|
|
68
68
|
|
|
69
69
|
return options
|
|
70
70
|
})
|
|
71
|
+
|
|
72
|
+
const getCountryLabel = (v: keyof Language['bcp47']) =>
|
|
73
|
+
lang.value.bcp47[v]?.country
|
|
74
|
+
|
|
75
|
+
const getLanguageLabel = (v: keyof Language['bcp47']) =>
|
|
76
|
+
lang.value.bcp47[v]?.language
|
|
77
|
+
|
|
78
|
+
const variables = ref({
|
|
79
|
+
//
|
|
80
|
+
})
|
|
81
|
+
const functions = ref({
|
|
82
|
+
getCountryLabel,
|
|
83
|
+
getLanguageLabel
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
defineExpose({
|
|
87
|
+
variables,
|
|
88
|
+
functions
|
|
89
|
+
})
|
|
71
90
|
</script>
|
package/src/ui/form/index.ts
CHANGED
|
@@ -13,4 +13,12 @@ export { default as CurrencySelect } from './CurrencySelect.vue'
|
|
|
13
13
|
export { default as LocaleSelect } from './LocaleSelect.vue'
|
|
14
14
|
export { default as FilteredModelSelect } from './FilteredModelSelect.vue'
|
|
15
15
|
export { default as CronScheduleInput } from './CronScheduleInput.vue'
|
|
16
|
-
export {
|
|
16
|
+
export { default as CountrySelect } from './CountrySelect.vue'
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
useLang,
|
|
20
|
+
loadLang,
|
|
21
|
+
type Locales,
|
|
22
|
+
type ISO3166,
|
|
23
|
+
type ISO639
|
|
24
|
+
} from './lang/index.js'
|