@simsustech/quasar-components 0.7.1 → 0.8.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/form.js +167 -27
  3. package/dist/{nl-DF7uv7-9.js → nl-CZsfRA99.js} +5 -0
  4. package/dist/types/ui/authentication/ConsentList.vue.d.ts +3 -3
  5. package/dist/types/ui/authentication/EmailChangeForm.vue.d.ts +8 -8
  6. package/dist/types/ui/authentication/EmailChangeStepper.vue.d.ts +3 -3
  7. package/dist/types/ui/authentication/LoginButton.vue.d.ts +7 -7
  8. package/dist/types/ui/authentication/LoginForm.vue.d.ts +8 -8
  9. package/dist/types/ui/authentication/OtpInput.vue.d.ts +3 -3
  10. package/dist/types/ui/authentication/PasswordChangeForm.vue.d.ts +12 -12
  11. package/dist/types/ui/authentication/PasswordChangeStepper.vue.d.ts +3 -3
  12. package/dist/types/ui/authentication/RegisterForm.vue.d.ts +12 -12
  13. package/dist/types/ui/authentication/RequestOtpForm.vue.d.ts +8 -8
  14. package/dist/types/ui/authentication/UserMenuButton.vue.d.ts +8 -8
  15. package/dist/types/ui/authentication/VerificationSlider.vue.d.ts +3 -3
  16. package/dist/types/ui/form/BooleanItem.vue.d.ts +2 -2
  17. package/dist/types/ui/form/BooleanSelect.vue.d.ts +3 -3
  18. package/dist/types/ui/form/CurrencySelect.vue.d.ts +20 -0
  19. package/dist/types/ui/form/DateInput.vue.d.ts +11 -11
  20. package/dist/types/ui/form/DatePicker.vue.d.ts +3 -3
  21. package/dist/types/ui/form/EmailInput.vue.d.ts +3 -3
  22. package/dist/types/ui/form/FilteredModelSelect.vue.d.ts +7 -3
  23. package/dist/types/ui/form/FormInput.vue.d.ts +2 -2
  24. package/dist/types/ui/form/FormItem.vue.d.ts +7 -7
  25. package/dist/types/ui/form/GenderItem.vue.d.ts +2 -2
  26. package/dist/types/ui/form/GenderSelect.vue.d.ts +3 -3
  27. package/dist/types/ui/form/LocaleSelect.vue.d.ts +14 -0
  28. package/dist/types/ui/form/PostalCodeInput.vue.d.ts +3 -3
  29. package/dist/types/ui/form/TelephoneNumberInput.vue.d.ts +3 -3
  30. package/dist/types/ui/form/index.d.ts +2 -0
  31. package/dist/types/ui/form/lang/index.d.ts +10 -0
  32. package/dist/types/ui/general/QLanguageSelect.vue.d.ts +5 -3
  33. package/dist/types/ui/general/QStyledCard.vue.d.ts +8 -8
  34. package/dist/types/ui/general/QStyledLayout.vue.d.ts +8 -8
  35. package/dist/types/ui/general/ResourcePage.vue.d.ts +11 -11
  36. package/dist/types/ui/general/ResponsiveDialog.vue.d.ts +8 -8
  37. package/eslint.config.js +29 -0
  38. package/package.json +20 -17
  39. package/src/ui/flags/index.ts +2 -1
  40. package/src/ui/form/CurrencySelect.vue +49 -0
  41. package/src/ui/form/LocaleSelect.vue +63 -0
  42. package/src/ui/form/index.ts +2 -0
  43. package/src/ui/form/lang/en-US.ts +5 -0
  44. package/src/ui/form/lang/index.ts +6 -1
  45. package/src/ui/form/lang/nl.ts +5 -0
  46. package/src/ui/general/QLanguageSelect.vue +1 -2
  47. package/src/ui/icons/index.ts +1 -1
  48. package/.eslintignore +0 -2
  49. package/.eslintrc.cjs +0 -19
@@ -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.0",
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>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <q-select
3
+ v-bind="attrs"
4
+ :options="languageOptions"
5
+ :model-value="modelValue"
6
+ emit-value
7
+ map-options
8
+ >
9
+ <template #selected>
10
+ <div v-if="modelValue === 'en-US'">
11
+ <en-us /> {{ flagsLang.languages['en-US'] }}
12
+ </div>
13
+ <div v-if="modelValue === 'nl'"><nl /> {{ flagsLang.languages.nl }}</div>
14
+ </template>
15
+ <template #option="scope">
16
+ <q-item v-if="scope.opt.value === 'en-US'" v-bind="scope.itemProps">
17
+ <q-item-section avatar>
18
+ <en-us />
19
+ </q-item-section>
20
+ <q-item-section>
21
+ <q-item-label>
22
+ {{ flagsLang.languages['en-US'] }}
23
+ </q-item-label>
24
+ </q-item-section>
25
+ </q-item>
26
+ <q-item v-if="scope.opt.value === 'nl'" v-bind="scope.itemProps">
27
+ <q-item-section avatar>
28
+ <nl />
29
+ </q-item-section>
30
+ <q-item-section>
31
+ <q-item-label>
32
+ {{ flagsLang.languages.nl }}
33
+ </q-item-label>
34
+ </q-item-section>
35
+ </q-item>
36
+ </template>
37
+ </q-select>
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import { useAttrs, toRefs } from 'vue'
42
+ import { QSelect } from 'quasar'
43
+ import { nl, enUs } from '../flags/index.js'
44
+ import { useLang as useFlagsLang } from '../flags/lang/index.js'
45
+ export interface Props {
46
+ modelValue?: string | null
47
+ }
48
+ const props = defineProps<Props>()
49
+ const { modelValue } = toRefs(props)
50
+ const attrs = useAttrs()
51
+
52
+ const flagsLang = useFlagsLang()
53
+ const languageOptions = [
54
+ {
55
+ label: flagsLang.value.languages['en-US'],
56
+ value: 'en-US'
57
+ },
58
+ {
59
+ label: flagsLang.value.languages.nl,
60
+ value: 'nl'
61
+ }
62
+ ]
63
+ </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'
@@ -43,6 +43,11 @@ const lang: Language = {
43
43
  validations: {
44
44
  unavailableRange: 'The selected period contains unavailable dates.'
45
45
  }
46
+ },
47
+ currency: {
48
+ currency: 'Currency',
49
+ EUR: 'Euro',
50
+ USD: 'USD'
46
51
  }
47
52
  }
48
53
 
@@ -42,11 +42,16 @@ export interface Language {
42
42
  unavailableRange: string
43
43
  }
44
44
  }
45
+ currency: {
46
+ currency: string
47
+ EUR: string
48
+ USD: string
49
+ }
45
50
  }
46
51
 
47
52
  import type { Ref } from 'vue'
48
53
  import { ref } from 'vue'
49
- import en from './en-US'
54
+ import en from './en-US.js'
50
55
  export const lang = ref(en)
51
56
 
52
57
  const locales = import.meta.glob<{ default: Language }>([
@@ -43,6 +43,11 @@ const lang: Language = {
43
43
  validations: {
44
44
  unavailableRange: 'De geselecteerde periode bevat ongeschikbare datums.'
45
45
  }
46
+ },
47
+ currency: {
48
+ currency: 'Valuta',
49
+ EUR: 'Euro',
50
+ USD: 'USD'
46
51
  }
47
52
  }
48
53
 
@@ -42,7 +42,7 @@ import { nl, enUs } from '../flags/index.js'
42
42
 
43
43
  export interface Props {
44
44
  modelValue: string
45
- languageImports: Record<string, () => Promise<QuasarLanguage>>
45
+ languageImports: Record<string, () => Promise<{ default: QuasarLanguage }>>
46
46
  }
47
47
  const props = defineProps<Props>()
48
48
  const $q = useQuasar()
@@ -75,7 +75,6 @@ watch(modelValue, (langIso: string) => {
75
75
  props.languageImports[langIso]().then(
76
76
  // langList[`../../../node_modules/quasar/lang/${langIso}.mjs`]().then(
77
77
  (lang) => {
78
- // @ts-ignore
79
78
  $q.lang.set(lang.default)
80
79
  }
81
80
  )
@@ -1,3 +1,3 @@
1
- // @ts-nocheck
1
+ // @ts-expect-error vite only
2
2
  import microsoft from 'microsoft.icon'
3
3
  export { microsoft }
package/.eslintignore DELETED
@@ -1,2 +0,0 @@
1
- .eslintrc.cjs
2
- node_modules/
package/.eslintrc.cjs DELETED
@@ -1,19 +0,0 @@
1
- module.exports = {
2
- ignorePatterns: ['.eslintrc.cjs'],
3
- extends: [
4
- 'eslint:recommended',
5
- 'plugin:@typescript-eslint/recommended',
6
- 'plugin:vue/vue3-recommended',
7
- 'plugin:prettier-vue/recommended'
8
- ],
9
- parser: 'vue-eslint-parser',
10
- parserOptions: {
11
- parser: '@typescript-eslint/parser',
12
- sourceType: 'module'
13
- },
14
- rules: {
15
- '@typescript-eslint/ban-ts-comment': 0
16
- },
17
- plugins: ['@typescript-eslint'],
18
- root: true
19
- }