@simsustech/quasar-components 0.7.1 → 0.8.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 (53) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/form.js +216 -37
  3. package/dist/general.js +14 -11
  4. package/dist/{nl-DF7uv7-9.js → nl-DvM_wB4u.js} +9 -0
  5. package/dist/types/ui/authentication/ConsentList.vue.d.ts +4 -3
  6. package/dist/types/ui/authentication/EmailChangeForm.vue.d.ts +8 -8
  7. package/dist/types/ui/authentication/EmailChangeStepper.vue.d.ts +3 -3
  8. package/dist/types/ui/authentication/LoginButton.vue.d.ts +7 -7
  9. package/dist/types/ui/authentication/LoginForm.vue.d.ts +8 -8
  10. package/dist/types/ui/authentication/OtpInput.vue.d.ts +3 -3
  11. package/dist/types/ui/authentication/PasswordChangeForm.vue.d.ts +12 -12
  12. package/dist/types/ui/authentication/PasswordChangeStepper.vue.d.ts +3 -3
  13. package/dist/types/ui/authentication/RegisterForm.vue.d.ts +12 -12
  14. package/dist/types/ui/authentication/RequestOtpForm.vue.d.ts +8 -8
  15. package/dist/types/ui/authentication/UserMenuButton.vue.d.ts +8 -8
  16. package/dist/types/ui/authentication/VerificationSlider.vue.d.ts +3 -3
  17. package/dist/types/ui/form/BooleanItem.vue.d.ts +2 -2
  18. package/dist/types/ui/form/BooleanSelect.vue.d.ts +3 -3
  19. package/dist/types/ui/form/CurrencySelect.vue.d.ts +20 -0
  20. package/dist/types/ui/form/DateInput.vue.d.ts +12 -12
  21. package/dist/types/ui/form/DatePicker.vue.d.ts +7 -7
  22. package/dist/types/ui/form/EmailInput.vue.d.ts +3 -3
  23. package/dist/types/ui/form/FilteredModelSelect.vue.d.ts +27 -24
  24. package/dist/types/ui/form/FormInput.vue.d.ts +2 -2
  25. package/dist/types/ui/form/FormItem.vue.d.ts +7 -7
  26. package/dist/types/ui/form/GenderItem.vue.d.ts +2 -2
  27. package/dist/types/ui/form/GenderSelect.vue.d.ts +3 -3
  28. package/dist/types/ui/form/LocaleSelect.vue.d.ts +15 -0
  29. package/dist/types/ui/form/PostalCodeInput.vue.d.ts +3 -3
  30. package/dist/types/ui/form/TelephoneNumberInput.vue.d.ts +3 -3
  31. package/dist/types/ui/form/index.d.ts +2 -0
  32. package/dist/types/ui/form/lang/index.d.ts +18 -0
  33. package/dist/types/ui/general/QLanguageSelect.vue.d.ts +5 -3
  34. package/dist/types/ui/general/QStyledCard.vue.d.ts +8 -8
  35. package/dist/types/ui/general/QStyledLayout.vue.d.ts +8 -8
  36. package/dist/types/ui/general/ResourcePage.vue.d.ts +11 -26
  37. package/dist/types/ui/general/ResponsiveDialog.vue.d.ts +8 -8
  38. package/eslint.config.js +29 -0
  39. package/package.json +20 -17
  40. package/src/ui/flags/index.ts +2 -1
  41. package/src/ui/form/CurrencySelect.vue +49 -0
  42. package/src/ui/form/DateInput.vue +1 -1
  43. package/src/ui/form/FilteredModelSelect.vue +37 -11
  44. package/src/ui/form/LocaleSelect.vue +68 -0
  45. package/src/ui/form/index.ts +2 -0
  46. package/src/ui/form/lang/en-US.ts +9 -0
  47. package/src/ui/form/lang/index.ts +10 -1
  48. package/src/ui/form/lang/nl.ts +9 -0
  49. package/src/ui/general/QLanguageSelect.vue +1 -2
  50. package/src/ui/general/ResourcePage.vue +10 -11
  51. package/src/ui/icons/index.ts +1 -1
  52. package/.eslintignore +0 -2
  53. package/.eslintrc.cjs +0 -19
@@ -4,14 +4,14 @@ export interface Props {
4
4
  disableOther?: boolean;
5
5
  required?: boolean;
6
6
  }
7
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
8
  "update:modelValue": (...args: any[]) => void;
9
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
9
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>> & {
10
10
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
11
11
  }, {}, {}>;
12
12
  export default _default;
13
13
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
- type __VLS_TypePropsToRuntimeProps<T> = {
14
+ type __VLS_TypePropsToOption<T> = {
15
15
  [K in keyof T]-?: {} extends Pick<T, K> ? {
16
16
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
17
  } : {
@@ -0,0 +1,15 @@
1
+ export interface Props {
2
+ modelValue?: string | null;
3
+ required?: boolean;
4
+ }
5
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}, {}>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToOption<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
@@ -4,14 +4,14 @@ export interface Props {
4
4
  locale: PostalCodeLocales;
5
5
  required?: boolean;
6
6
  }
7
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
8
  "update:modelValue": (...args: any[]) => void;
9
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
9
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>> & {
10
10
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
11
11
  }, {}, {}>;
12
12
  export default _default;
13
13
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
- type __VLS_TypePropsToRuntimeProps<T> = {
14
+ type __VLS_TypePropsToOption<T> = {
15
15
  [K in keyof T]-?: {} extends Pick<T, K> ? {
16
16
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
17
  } : {
@@ -2,14 +2,14 @@ export interface Props {
2
2
  modelValue: string;
3
3
  required?: boolean;
4
4
  }
5
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
6
  "update:modelValue": (...args: any[]) => void;
7
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
7
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>> & {
8
8
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
9
9
  }, {}, {}>;
10
10
  export default _default;
11
11
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
- type __VLS_TypePropsToRuntimeProps<T> = {
12
+ type __VLS_TypePropsToOption<T> = {
13
13
  [K in keyof T]-?: {} extends Pick<T, K> ? {
14
14
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
15
  } : {
@@ -9,5 +9,7 @@ export { default as BooleanSelect } from './BooleanSelect.vue';
9
9
  export { default as BooleanItem } from './BooleanItem.vue';
10
10
  export { default as EmailInput } from './EmailInput.vue';
11
11
  export { default as DatePicker } from './DatePicker.vue';
12
+ export { default as CurrencySelect } from './CurrencySelect.vue';
13
+ export { default as LocaleSelect } from './LocaleSelect.vue';
12
14
  export { default as FilteredModelSelect } from './FilteredModelSelect.vue';
13
15
  export { useLang, loadLang } from './lang/index.js';
@@ -34,6 +34,7 @@ export interface Language {
34
34
  };
35
35
  };
36
36
  datePicker: {
37
+ date: string;
37
38
  placeholder: string;
38
39
  YYYY: string;
39
40
  MM: string;
@@ -42,6 +43,14 @@ export interface Language {
42
43
  unavailableRange: string;
43
44
  };
44
45
  };
46
+ currency: {
47
+ currency: string;
48
+ EUR: string;
49
+ USD: string;
50
+ };
51
+ locale: {
52
+ locale: string;
53
+ };
45
54
  }
46
55
  import type { Ref } from 'vue';
47
56
  export declare const lang: Ref<{
@@ -80,6 +89,7 @@ export declare const lang: Ref<{
80
89
  };
81
90
  };
82
91
  datePicker: {
92
+ date: string;
83
93
  placeholder: string;
84
94
  YYYY: string;
85
95
  MM: string;
@@ -88,6 +98,14 @@ export declare const lang: Ref<{
88
98
  unavailableRange: string;
89
99
  };
90
100
  };
101
+ currency: {
102
+ currency: string;
103
+ EUR: string;
104
+ USD: string;
105
+ };
106
+ locale: {
107
+ locale: string;
108
+ };
91
109
  }>;
92
110
  export declare const defineLang: (lang: Language) => Language;
93
111
  export declare const useLang: () => Ref<Language>;
@@ -1,12 +1,14 @@
1
1
  import { QuasarLanguage } from 'quasar';
2
2
  export interface Props {
3
3
  modelValue: string;
4
- languageImports: Record<string, () => Promise<QuasarLanguage>>;
4
+ languageImports: Record<string, () => Promise<{
5
+ default: QuasarLanguage;
6
+ }>>;
5
7
  }
6
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>;
8
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}, {}>;
7
9
  export default _default;
8
10
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
- type __VLS_TypePropsToRuntimeProps<T> = {
11
+ type __VLS_TypePropsToOption<T> = {
10
12
  [K in keyof T]-?: {} extends Pick<T, K> ? {
11
13
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
12
14
  } : {
@@ -2,10 +2,10 @@ import { QCardActionsProps } from 'quasar';
2
2
  export interface Props {
3
3
  actions?: QCardActionsProps;
4
4
  }
5
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {
5
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {
6
6
  variables: import("vue").Ref<{}>;
7
7
  functions: import("vue").Ref<{}>;
8
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
8
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}, {}>, {
9
9
  image?(_: {}): any;
10
10
  title?(_: {}): any;
11
11
  subtitle?(_: {}): any;
@@ -13,8 +13,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
13
13
  actions?(_: {}): any;
14
14
  }>;
15
15
  export default _default;
16
+ type __VLS_WithTemplateSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
16
21
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
17
- type __VLS_TypePropsToRuntimeProps<T> = {
22
+ type __VLS_TypePropsToOption<T> = {
18
23
  [K in keyof T]-?: {} extends Pick<T, K> ? {
19
24
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
20
25
  } : {
@@ -22,8 +27,3 @@ type __VLS_TypePropsToRuntimeProps<T> = {
22
27
  required: true;
23
28
  };
24
29
  };
25
- type __VLS_WithTemplateSlots<T, S> = T & {
26
- new (): {
27
- $slots: S;
28
- };
29
- };
@@ -1,15 +1,20 @@
1
1
  export interface Props {
2
2
  title: string;
3
3
  }
4
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {
4
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {
5
5
  variables: import("vue").Ref<{}>;
6
6
  functions: import("vue").Ref<{}>;
7
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
7
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>>, {}, {}>, {
8
8
  leftDrawerItems?(_: {}): any;
9
9
  }>;
10
10
  export default _default;
11
+ type __VLS_WithTemplateSlots<T, S> = T & {
12
+ new (): {
13
+ $slots: S;
14
+ };
15
+ };
11
16
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
- type __VLS_TypePropsToRuntimeProps<T> = {
17
+ type __VLS_TypePropsToOption<T> = {
13
18
  [K in keyof T]-?: {} extends Pick<T, K> ? {
14
19
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
20
  } : {
@@ -17,8 +22,3 @@ type __VLS_TypePropsToRuntimeProps<T> = {
17
22
  required: true;
18
23
  };
19
24
  };
20
- type __VLS_WithTemplateSlots<T, S> = T & {
21
- new (): {
22
- $slots: S;
23
- };
24
- };
@@ -2,10 +2,7 @@ export interface Props {
2
2
  type?: 'create' | 'update';
3
3
  disabled?: boolean;
4
4
  }
5
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
6
- type: string;
7
- disabled: boolean;
8
- }>, {
5
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {
9
6
  variables: import("vue").Ref<{}>;
10
7
  functions: import("vue").Ref<{}>;
11
8
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -17,10 +14,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
17
14
  data?: unknown;
18
15
  done: (success?: boolean) => void;
19
16
  }) => void;
20
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
21
- type: string;
22
- disabled: boolean;
23
- }>>> & {
17
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>> & {
24
18
  onUpdate?: ((args_0: {
25
19
  data?: unknown;
26
20
  done: (success?: boolean) => void;
@@ -29,16 +23,20 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
29
23
  data?: unknown;
30
24
  done: (success?: boolean) => void;
31
25
  }) => any) | undefined;
32
- }, {
33
- type: "update" | "create";
34
- disabled: boolean;
35
- }, {}>, {
26
+ }, {}, {}>, {
36
27
  default?(_: {}): any;
28
+ fab?(_: {}): any;
37
29
  header?(_: {}): any;
30
+ "header-side"?(_: {}): any;
38
31
  }>;
39
32
  export default _default;
33
+ type __VLS_WithTemplateSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
40
38
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
41
- type __VLS_TypePropsToRuntimeProps<T> = {
39
+ type __VLS_TypePropsToOption<T> = {
42
40
  [K in keyof T]-?: {} extends Pick<T, K> ? {
43
41
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
44
42
  } : {
@@ -46,16 +44,3 @@ type __VLS_TypePropsToRuntimeProps<T> = {
46
44
  required: true;
47
45
  };
48
46
  };
49
- type __VLS_WithDefaults<P, D> = {
50
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
51
- default: D[K];
52
- }> : P[K];
53
- };
54
- type __VLS_Prettify<T> = {
55
- [K in keyof T]: T[K];
56
- } & {};
57
- type __VLS_WithTemplateSlots<T, S> = T & {
58
- new (): {
59
- $slots: S;
60
- };
61
- };
@@ -1,7 +1,7 @@
1
1
  export interface Props {
2
2
  display?: boolean;
3
3
  }
4
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {
4
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToOption<Props>, {
5
5
  variables: import("vue").Ref<{}>;
6
6
  functions: import("vue").Ref<{
7
7
  open: () => void | undefined;
@@ -12,7 +12,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
12
12
  submit: (args_0: {
13
13
  done: (success?: boolean) => void;
14
14
  }) => void;
15
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
15
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<Props>>> & {
16
16
  onSubmit?: ((args_0: {
17
17
  done: (success?: boolean) => void;
18
18
  }) => any) | undefined;
@@ -21,8 +21,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
21
21
  default?(_: {}): any;
22
22
  }>;
23
23
  export default _default;
24
+ type __VLS_WithTemplateSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };
24
29
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
25
- type __VLS_TypePropsToRuntimeProps<T> = {
30
+ type __VLS_TypePropsToOption<T> = {
26
31
  [K in keyof T]-?: {} extends Pick<T, K> ? {
27
32
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
28
33
  } : {
@@ -30,8 +35,3 @@ type __VLS_TypePropsToRuntimeProps<T> = {
30
35
  required: true;
31
36
  };
32
37
  };
33
- type __VLS_WithTemplateSlots<T, S> = T & {
34
- new (): {
35
- $slots: S;
36
- };
37
- };
@@ -0,0 +1,29 @@
1
+ import eslintConfigPrettier from 'eslint-config-prettier'
2
+ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
3
+ import pluginVue from 'eslint-plugin-vue'
4
+ import typescriptEslint from 'typescript-eslint'
5
+ import vueParser from 'vue-eslint-parser'
6
+
7
+ export default typescriptEslint.config(
8
+ ...typescriptEslint.configs.recommended,
9
+ ...pluginVue.configs['flat/recommended'],
10
+
11
+ {
12
+ files: ['**/*.vue'],
13
+ languageOptions: {
14
+ parser: vueParser,
15
+ parserOptions: {
16
+ sourceType: 'module',
17
+ parser: {
18
+ ts: typescriptEslint.parser
19
+ }
20
+ }
21
+ }
22
+ },
23
+
24
+ /**
25
+ * end
26
+ */
27
+ eslintConfigPrettier,
28
+ eslintPluginPrettierRecommended
29
+ )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simsustech/quasar-components",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "author": "Stefan van Herwijnen",
5
5
  "description": "High level components for Quasar Framework",
6
6
  "license": "MIT",
@@ -49,39 +49,42 @@
49
49
  "validator": "^13.11.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "quasar": "^2.9.2"
52
+ "quasar": "^2.15.2"
53
53
  },
54
54
  "devDependencies": {
55
- "@types/node": "^20.11.19",
55
+ "@types/node": "^20.12.7",
56
56
  "@types/validator": "^13.11.9",
57
57
  "@types/ws": "^8.5.10",
58
- "@typescript-eslint/eslint-plugin": "^7.0.1",
59
- "@typescript-eslint/parser": "^7.0.1",
58
+ "@typescript-eslint/eslint-plugin": "^7.7.0",
59
+ "@typescript-eslint/parser": "^7.7.0",
60
60
  "@vitejs/plugin-vue": "^5.0.4",
61
- "@vue/server-renderer": "^3.4.19",
62
- "eslint": "^8.56.0",
61
+ "@vue/server-renderer": "^3.4.23",
62
+ "eslint": "^9.0.0",
63
63
  "eslint-config-prettier": "^9.1.0",
64
+ "eslint-plugin-prettier": "^5.1.3",
64
65
  "eslint-plugin-prettier-vue": "^5.0.0",
65
- "eslint-plugin-vue": "^9.21.1",
66
- "glob": "^10.3.10",
66
+ "eslint-plugin-vue": "^9.25.0",
67
+ "glob": "^10.3.12",
67
68
  "local-pkg": "^0.5.0",
68
69
  "prettier": "^3.2.5",
69
- "quasar": "^2.14.4",
70
+ "quasar": "^2.15.2",
70
71
  "rimraf": "^5.0.5",
71
- "typescript": "^5.3.3",
72
+ "typescript": "^5.4.5",
73
+ "typescript-eslint": "^7.7.0",
72
74
  "unplugin-vue-components": "^0.26.0",
73
- "vite": "^5.1.3",
74
- "vue": "^3.4.19",
75
- "vue-router": "^4.2.5",
76
- "vue-tsc": "^1.8.27"
75
+ "vite": "^5.2.9",
76
+ "vue": "^3.4.23",
77
+ "vue-eslint-parser": "^9.4.2",
78
+ "vue-router": "^4.3.2",
79
+ "vue-tsc": "^2.0.13"
77
80
  },
78
81
  "scripts": {
79
82
  "build:plugin": "vite build",
80
83
  "build:vite-plugin": "rimraf tsconfig.build.plugin.tsbuildinfo && tsc -p tsconfig.build.plugin.json",
81
84
  "generate:types": "vue-tsc -p tsconfig.types.json",
82
85
  "build": "run-s build:plugin build:vite-plugin generate:types",
83
- "lint": "eslint --ext .vue --ext .ts src",
84
- "lint:fix": "eslint --ext .vue --ext .ts src --fix",
86
+ "lint": "eslint src",
87
+ "lint:fix": "eslint src --fix",
85
88
  "format:check": "prettier --check .",
86
89
  "format:write": "prettier --write .",
87
90
  "test": "echo \"Error: no test specified\" && exit 0"
@@ -1,5 +1,6 @@
1
- // @ts-nocheck
1
+ // @ts-expect-error vite only
2
2
  import nl from 'nl.flag'
3
+ // @ts-expect-error vite only
3
4
  import enUs from 'en-US.flag'
4
5
  export { nl, enUs }
5
6
  export { useLang, loadLang } from './lang/index.js'
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <q-select
3
+ v-bind="attrs"
4
+ :rules="validations"
5
+ :model-value="modelValue"
6
+ :options="currencyOptions"
7
+ :label="`${lang.currency.currency}${required ? '*' : ''}`"
8
+ emit-value
9
+ map-options
10
+ @update:model-value="$emit('update:modelValue', $event)"
11
+ ></q-select>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import { useAttrs, ref } from 'vue'
16
+ import { QSelect, ValidationRule } from 'quasar'
17
+ import { useLang } from './lang'
18
+
19
+ export type Currency = 'EUR' | 'USD'
20
+ export interface Props {
21
+ modelValue: Currency | null
22
+ required?: boolean
23
+ }
24
+ const props = defineProps<Props>()
25
+
26
+ const attrs = useAttrs()
27
+
28
+ const lang = useLang()
29
+
30
+ const currencyOptions = ref([
31
+ {
32
+ label: lang.value.currency.EUR,
33
+ value: 'EUR'
34
+ },
35
+ {
36
+ label: lang.value.currency.USD,
37
+ value: 'USD'
38
+ }
39
+ ])
40
+
41
+ const validations = ref<ValidationRule[]>([])
42
+
43
+ if (props.required)
44
+ validations.value.push(
45
+ (val: { label: string; value: string }) =>
46
+ !!val || lang.value.validations.fieldRequired
47
+ )
48
+ defineEmits(['update:modelValue'])
49
+ </script>
@@ -3,7 +3,7 @@
3
3
  :model-value="modelValue"
4
4
  bottom-slots
5
5
  :rules="validations"
6
- :label="label"
6
+ :label="`${label}${required ? '*' : ''}`"
7
7
  stack-label
8
8
  >
9
9
  <template #control>
@@ -19,12 +19,8 @@
19
19
  @update:model-value="$emit('update:model-value', $event)"
20
20
  >
21
21
  <template #hint> {{ hint }} </template>
22
- <template
23
- v-for="(slot, index) of Object.keys($slots)"
24
- :key="index"
25
- #[slot]="scope"
26
- >
27
- <slot :scope="scope" :name="slot"></slot>
22
+ <template v-for="(_, slot) in $slots" v-slot:[slot]="scope">
23
+ <slot :name="slot" v-bind="scope || {}" />
28
24
  </template>
29
25
  </q-select>
30
26
  </template>
@@ -41,13 +37,15 @@ export default {
41
37
  generic="T extends { id: number; [key: string]: unknown }"
42
38
  >
43
39
  import { QSelect } from 'quasar'
44
- import { computed, ref, toRefs, useAttrs, watch } from 'vue'
40
+ import { computed, ref, toRefs, useAttrs, watch, onMounted } from 'vue'
45
41
  import { useLang } from './lang/index.js'
46
42
 
47
43
  interface Props {
48
44
  modelValue?: number | number[] | null
49
45
  labelKey: string
46
+ labelFunction?: (option: unknown) => string
50
47
  valueKey?: string
48
+ extraFields?: string[]
51
49
  filteredOptions: T[]
52
50
  required?: boolean
53
51
  onFilter?: unknown
@@ -76,13 +74,32 @@ const emit = defineEmits<{
76
74
 
77
75
  const lang = useLang()
78
76
 
79
- const { modelValue, onFilter, filteredOptions, labelKey, valueKey } =
80
- toRefs(props)
77
+ const {
78
+ modelValue,
79
+ onFilter,
80
+ filteredOptions,
81
+ labelKey,
82
+ valueKey,
83
+ labelFunction,
84
+ extraFields
85
+ } = toRefs(props)
86
+
81
87
  const options = computed(() => {
82
88
  if (filteredOptions.value.length) {
83
89
  return filteredOptions.value?.map((option) => ({
84
- label: option[labelKey.value],
85
- value: option[valueKey.value || 'id']
90
+ label: labelFunction.value
91
+ ? labelFunction.value(option)
92
+ : option[labelKey.value],
93
+ value: option[valueKey.value || 'id'],
94
+ extraFields: extraFields.value?.reduce(
95
+ (result, key) => {
96
+ if (option.hasOwnProperty(key)) {
97
+ result[key] = option[key]
98
+ }
99
+ return result
100
+ },
101
+ {} as Record<string, unknown>
102
+ )
86
103
  }))
87
104
  }
88
105
  return []
@@ -122,4 +139,13 @@ watch(modelValue, () => {
122
139
  done: () => {}
123
140
  })
124
141
  })
142
+
143
+ onMounted(() => {
144
+ if (!options.value.length)
145
+ emit('filter', {
146
+ ids: selectedIds.value,
147
+ searchPhrase: '',
148
+ done: () => {}
149
+ })
150
+ })
125
151
  </script>
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <q-select
3
+ v-bind="attrs"
4
+ :options="languageOptions"
5
+ :model-value="modelValue"
6
+ :label="`${lang.locale.locale}${required ? '*' : ''}`"
7
+ emit-value
8
+ map-options
9
+ >
10
+ <template #selected>
11
+ <div v-if="modelValue === 'en-US'">
12
+ <en-us /> {{ flagsLang.languages['en-US'] }}
13
+ </div>
14
+ <div v-if="modelValue === 'nl'"><nl /> {{ flagsLang.languages.nl }}</div>
15
+ </template>
16
+ <template #option="scope">
17
+ <q-item v-if="scope.opt.value === 'en-US'" v-bind="scope.itemProps">
18
+ <q-item-section avatar>
19
+ <en-us />
20
+ </q-item-section>
21
+ <q-item-section>
22
+ <q-item-label>
23
+ {{ flagsLang.languages['en-US'] }}
24
+ </q-item-label>
25
+ </q-item-section>
26
+ </q-item>
27
+ <q-item v-if="scope.opt.value === 'nl'" v-bind="scope.itemProps">
28
+ <q-item-section avatar>
29
+ <nl />
30
+ </q-item-section>
31
+ <q-item-section>
32
+ <q-item-label>
33
+ {{ flagsLang.languages.nl }}
34
+ </q-item-label>
35
+ </q-item-section>
36
+ </q-item>
37
+ </template>
38
+ </q-select>
39
+ </template>
40
+
41
+ <script setup lang="ts">
42
+ import { useAttrs, toRefs } from 'vue'
43
+ import { QSelect } from 'quasar'
44
+ import { nl, enUs } from '../flags/index.js'
45
+ import { useLang as useFlagsLang } from '../flags/lang/index.js'
46
+ import { useLang } from './lang/index.js'
47
+
48
+ export interface Props {
49
+ modelValue?: string | null
50
+ required?: boolean
51
+ }
52
+ const props = defineProps<Props>()
53
+ const { modelValue } = toRefs(props)
54
+ const attrs = useAttrs()
55
+
56
+ const lang = useLang()
57
+ const flagsLang = useFlagsLang()
58
+ const languageOptions = [
59
+ {
60
+ label: flagsLang.value.languages['en-US'],
61
+ value: 'en-US'
62
+ },
63
+ {
64
+ label: flagsLang.value.languages.nl,
65
+ value: 'nl'
66
+ }
67
+ ]
68
+ </script>
@@ -9,5 +9,7 @@ export { default as BooleanSelect } from './BooleanSelect.vue'
9
9
  export { default as BooleanItem } from './BooleanItem.vue'
10
10
  export { default as EmailInput } from './EmailInput.vue'
11
11
  export { default as DatePicker } from './DatePicker.vue'
12
+ export { default as CurrencySelect } from './CurrencySelect.vue'
13
+ export { default as LocaleSelect } from './LocaleSelect.vue'
12
14
  export { default as FilteredModelSelect } from './FilteredModelSelect.vue'
13
15
  export { useLang, loadLang } from './lang/index.js'