@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.
Files changed (99) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/LocaleSelect-BqkjbcKS.js +460 -0
  3. package/dist/QSubmitButton-Chc7dndx.js +101 -0
  4. package/dist/authentication.js +1935 -2031
  5. package/dist/form.js +1093 -1118
  6. package/dist/general.js +319 -361
  7. package/dist/md3.js +406 -395
  8. package/dist/nl-DIfqXZG_.js +354 -0
  9. package/dist/nl-DWmQiCdO.js +12 -0
  10. package/dist/nl-DbV07Lx7.js +106 -0
  11. package/dist/nl-ZpgX9FUw.js +4 -0
  12. package/dist/quasar-components.css +5 -4
  13. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  14. package/dist/types/{ui → src/ui}/authentication/LoginForm.vue.d.ts +5 -0
  15. package/dist/types/{ui/form/LocaleSelect.vue.d.ts → src/ui/form/CountrySelect.vue.d.ts} +8 -5
  16. package/dist/types/src/ui/form/LocaleSelect.vue.d.ts +28 -0
  17. package/dist/types/{ui → src/ui}/form/index.d.ts +2 -1
  18. package/dist/types/src/ui/form/lang/index.d.ts +817 -0
  19. package/dist/types/{ui → src/ui}/general/QLanguageSelect.vue.d.ts +4 -4
  20. package/dist/virtualModules.js +62 -2
  21. package/dist/vite-plugin.js +50 -101
  22. package/package.json +34 -34
  23. package/src/ui/authentication/LoginForm.vue +9 -4
  24. package/src/ui/form/CountrySelect.vue +83 -0
  25. package/src/ui/form/LocaleSelect.vue +27 -8
  26. package/src/ui/form/index.ts +9 -1
  27. package/src/ui/form/lang/en-US.ts +112 -356
  28. package/src/ui/form/lang/index.ts +173 -377
  29. package/src/ui/form/lang/nl.ts +108 -352
  30. package/src/ui/general/QLanguageSelect.vue +20 -16
  31. package/tsconfig.json +1 -0
  32. package/tsconfig.node.json +2 -1
  33. package/tsconfig.types.json +2 -1
  34. package/dist/LocaleSelect.vue_vue_type_script_setup_true_lang-DFwcmPnu.js +0 -584
  35. package/dist/QSubmitButton.vue_vue_type_script_setup_true_lang-D-I0Gws4.js +0 -109
  36. package/dist/nl-BJwNz421.js +0 -453
  37. package/dist/nl-CneFq5NZ.js +0 -112
  38. package/dist/nl-NLgZUAKl.js +0 -6
  39. package/dist/nl-X50pmfG-.js +0 -12
  40. package/dist/types/ui/form/lang/index.d.ts +0 -1353
  41. package/eslint.config.js +0 -29
  42. package/dist/types/{ui → src/ui}/authentication/AccountsTable.vue.d.ts +0 -0
  43. package/dist/types/{ui → src/ui}/authentication/ConsentList.vue.d.ts +0 -0
  44. package/dist/types/{ui → src/ui}/authentication/EmailChangeForm.vue.d.ts +0 -0
  45. package/dist/types/{ui → src/ui}/authentication/EmailChangeStepper.vue.d.ts +0 -0
  46. package/dist/types/{ui → src/ui}/authentication/LoginButton.vue.d.ts +0 -0
  47. package/dist/types/{ui → src/ui}/authentication/LogoutButton.vue.d.ts +0 -0
  48. package/dist/types/{ui → src/ui}/authentication/LogoutForm.vue.d.ts +0 -0
  49. package/dist/types/{ui → src/ui}/authentication/OtpInput.vue.d.ts +0 -0
  50. package/dist/types/{ui → src/ui}/authentication/PasswordChangeForm.vue.d.ts +0 -0
  51. package/dist/types/{ui → src/ui}/authentication/PasswordChangeStepper.vue.d.ts +0 -0
  52. package/dist/types/{ui → src/ui}/authentication/RegisterForm.vue.d.ts +0 -0
  53. package/dist/types/{ui → src/ui}/authentication/RequestOtpForm.vue.d.ts +0 -0
  54. package/dist/types/{ui → src/ui}/authentication/UserMenuButton.vue.d.ts +0 -0
  55. package/dist/types/{ui → src/ui}/authentication/VerificationSlider.vue.d.ts +0 -0
  56. package/dist/types/{ui → src/ui}/authentication/index.d.ts +0 -0
  57. package/dist/types/{ui → src/ui}/authentication/lang/en-US.d.ts +0 -0
  58. package/dist/types/{ui → src/ui}/authentication/lang/index.d.ts +0 -0
  59. package/dist/types/{ui → src/ui}/authentication/lang/nl.d.ts +0 -0
  60. package/dist/types/{ui → src/ui}/flags/index.d.ts +0 -0
  61. package/dist/types/{ui → src/ui}/flags/lang/en-US.d.ts +0 -0
  62. package/dist/types/{ui → src/ui}/flags/lang/index.d.ts +0 -0
  63. package/dist/types/{ui → src/ui}/flags/lang/nl.d.ts +0 -0
  64. package/dist/types/{ui → src/ui}/form/BooleanItem.vue.d.ts +0 -0
  65. package/dist/types/{ui → src/ui}/form/BooleanSelect.vue.d.ts +0 -0
  66. package/dist/types/{ui → src/ui}/form/CronScheduleInput.vue.d.ts +0 -0
  67. package/dist/types/{ui → src/ui}/form/CurrencySelect.vue.d.ts +0 -0
  68. package/dist/types/{ui → src/ui}/form/DateInput.vue.d.ts +1 -1
  69. package/dist/types/{ui → src/ui}/form/DatePicker.vue.d.ts +0 -0
  70. package/dist/types/{ui → src/ui}/form/EmailInput.vue.d.ts +0 -0
  71. package/dist/types/{ui → src/ui}/form/FilteredModelSelect.vue.d.ts +0 -0
  72. package/dist/types/{ui → src/ui}/form/FormInput.vue.d.ts +0 -0
  73. package/dist/types/{ui → src/ui}/form/FormItem.vue.d.ts +0 -0
  74. package/dist/types/{ui → src/ui}/form/GenderItem.vue.d.ts +0 -0
  75. package/dist/types/{ui → src/ui}/form/GenderSelect.vue.d.ts +0 -0
  76. package/dist/types/{ui → src/ui}/form/PostalCodeInput.vue.d.ts +0 -0
  77. package/dist/types/{ui → src/ui}/form/TelephoneNumberInput.vue.d.ts +0 -0
  78. package/dist/types/{ui → src/ui}/form/lang/en-US.d.ts +0 -0
  79. package/dist/types/{ui → src/ui}/form/lang/nl.d.ts +0 -0
  80. package/dist/types/{ui → src/ui}/general/QDrawerList.vue.d.ts +0 -0
  81. package/dist/types/{ui → src/ui}/general/QStyledCard.vue.d.ts +0 -0
  82. package/dist/types/{ui → src/ui}/general/QStyledLayout.vue.d.ts +0 -0
  83. package/dist/types/{ui → src/ui}/general/QSubmitButton.vue.d.ts +1 -1
  84. package/dist/types/{ui → src/ui}/general/ResourcePage.vue.d.ts +1 -1
  85. /package/dist/types/{ui → src/ui}/general/ResponsiveDialog.vue.d.ts +0 -0
  86. /package/dist/types/{ui → src/ui}/general/index.d.ts +0 -0
  87. /package/dist/types/{ui → src/ui}/general/lang/en-US.d.ts +0 -0
  88. /package/dist/types/{ui → src/ui}/general/lang/index.d.ts +0 -0
  89. /package/dist/types/{ui → src/ui}/general/lang/nl.d.ts +0 -0
  90. /package/dist/types/{ui → src/ui}/icons/index.d.ts +0 -0
  91. /package/dist/types/{ui → src/ui}/icons/labels.d.ts +0 -0
  92. /package/dist/types/{ui → src/ui}/md3/Md3Layout.vue.d.ts +0 -0
  93. /package/dist/types/{ui → src/ui}/md3/NavigationRailFabs.vue.d.ts +0 -0
  94. /package/dist/types/{ui → src/ui}/md3/index.d.ts +0 -0
  95. /package/dist/types/{ui → src/ui}/md3/lang/en-US.d.ts +0 -0
  96. /package/dist/types/{ui → src/ui}/md3/lang/index.d.ts +0 -0
  97. /package/dist/types/{ui → src/ui}/md3/lang/nl.d.ts +0 -0
  98. /package/dist/types/{virtualModules.d.ts → src/virtualModules.d.ts} +0 -0
  99. /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 { Language as FormLanguage } from '../form/lang/index.js';
2
+ import type { ISO639, Locales } from '../form/lang/index.js';
3
3
  export interface Props {
4
- modelValue: keyof FormLanguage['countries'];
5
- languageImports: Record<keyof FormLanguage['countries'], () => Promise<{
4
+ modelValue: Locales;
5
+ languageImports: Record<ISO639 | Locales, () => Promise<{
6
6
  default: QuasarLanguage;
7
7
  }>>;
8
8
  locales: {
9
9
  icon: string;
10
- isoName: keyof FormLanguage['languages'];
10
+ bcp47: Locales;
11
11
  }[];
12
12
  }
13
13
  declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1,5 +1,65 @@
1
- export var FlagIcon = function (locale) { return "\n import { computed, ref, watch, h } from 'vue'\n import { useQuasar, QIcon } from 'quasar'\n import { useLang, loadLang } from '".concat(new URL("../src/ui/flags/lang", import.meta.url).pathname, "'\n import icon from '").concat(new URL("../src/ui/flags/assets/".concat(locale, ".svg"), import.meta.url).pathname, "'\n export default {\n setup(props, context) {\n const $q = useQuasar()\n const lang = useLang()\n if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)\n watch($q.lang, (val) => {\n loadLang($q.lang.isoName)\n })\n \n const country = computed(\n () => lang.value.countries['").concat(locale, "']\n )\n // @ts-ignore\n // const language = computed(() => lang.value.languages['").concat(locale, "'])\n const language = computed(() => lang.value.languages['").concat(locale, "'])\n const variables = ref({\n country,\n language\n // header: lang.value.some.nested.prop\n })\n const functions = ref({\n // submit\n })\n\n context.expose({\n variables,\n functions\n })\n\n // return the render function\n return () => h(QIcon, { name: `img:${icon}` })\n }}\n"); };
2
- export var Icon = function (icon) { return "\n import { computed, ref, watch, h } from 'vue'\n import { useQuasar, QIcon } from 'quasar'\n import icon from '".concat(new URL("../src/ui/icons/assets/".concat(icon, ".svg"), import.meta.url).pathname, "'\n import labels from '").concat(new URL("../src/ui/icons/labels.ts", import.meta.url).pathname, "'\n export default {\n setup(props, context) {\n const $q = useQuasar()\n\n const variables = ref(labels['").concat(icon, "'])\n\n const functions = ref({\n // submit\n })\n\n context.expose({\n variables,\n functions\n })\n\n // return the render function\n return () => h(QIcon, { name: `img:${icon}` })\n }}\n"); };
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'
@@ -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
- var readFile = promises.readFile;
3
+ const { readFile } = promises;
40
4
  import { fileURLToPath } from 'node:url';
41
- export default function () {
42
- return __awaiter(this, arguments, void 0, function (_a) {
43
- var pkgJson, _b, _c, exports, name;
44
- var _d = _a === void 0 ? {} : _a, buildFromSrc = _d.buildFromSrc;
45
- return __generator(this, function (_e) {
46
- switch (_e.label) {
47
- case 0:
48
- _c = (_b = JSON).parse;
49
- return [4 /*yield*/, readFile(fileURLToPath(new URL('../package.json', import.meta.url)), 'utf-8')];
50
- case 1:
51
- pkgJson = _c.apply(_b, [_e.sent()]);
52
- exports = pkgJson.exports;
53
- name = pkgJson.name;
54
- return [2 /*return*/, {
55
- name: "".concat(name, "-plugin"),
56
- enforce: 'pre',
57
- resolveId: function (id) {
58
- if (id.includes('.flag'))
59
- return id;
60
- else if (id.includes('.icon'))
61
- return id;
62
- },
63
- load: function (id) {
64
- if (id.includes('.flag')) {
65
- var locale = id.slice(0, -5);
66
- var flag = FlagIcon(locale);
67
- return flag;
68
- }
69
- else if (id.includes('.icon')) {
70
- var iconId = id.slice(0, -5);
71
- var icon = Icon(iconId);
72
- return icon;
73
- }
74
- },
75
- config: function (config, _a) {
76
- var mode = _a.mode;
77
- if (mode === 'development' || buildFromSrc) {
78
- var alias = Object.entries(exports)
79
- .filter(function (_a) {
80
- var val = _a[1];
81
- return val.src;
82
- })
83
- .map(function (_a) {
84
- var key = _a[0], val = _a[1];
85
- return {
86
- find: new RegExp("^".concat(name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + key.slice(1), "$")),
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.11.26",
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.2.1",
55
- "validator": "^13.15.26"
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.3.0",
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.56.0",
66
- "@typescript-eslint/parser": "^8.56.0",
67
- "@vitejs/plugin-vue": "^6.0.4",
68
- "@vue/server-renderer": "^3.5.28",
69
- "eslint": "^10.0.0",
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.8.0",
74
- "glob": "^13.0.5",
75
- "local-pkg": "^1.1.2",
76
- "prettier": "^3.8.1",
77
- "quasar": "^2.18.6",
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": "5.9.3",
80
- "typescript-eslint": "^8.56.0",
81
- "unplugin-vue-components": "^31.0.0",
82
- "vite": "^7.3.1",
83
- "vue": "^3.5.28",
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.2",
86
- "vue-tsc": "^3.2.4"
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": "eslint src",
94
- "lint:fix": "eslint src --fix",
95
- "format:check": "prettier --check .",
96
- "format:write": "prettier --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="languageOptions"
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: keyof Language['countries']
48
+ modelValue: Locales
49
49
  locales: {
50
50
  icon: string
51
- isoName: keyof Language['languages']
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 languageOptions = computed(() => {
62
+ const localeOptions = computed(() => {
63
63
  const options = locales.value.map((locale) => ({
64
- label: lang.value.languages[locale.isoName],
65
- value: locale.isoName,
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>
@@ -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 { useLang, loadLang } from './lang/index.js'
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'