@simsustech/quasar-components 0.11.9 → 0.11.11

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 (75) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/LocaleSelect.vue_vue_type_script_setup_true_lang-Du4fNbTV.js +573 -0
  3. package/dist/authentication.js +218 -106
  4. package/dist/form.js +164 -305
  5. package/dist/general.js +51 -95
  6. package/dist/md3.js +435 -0
  7. package/dist/{nl-BTgHOvpQ.js → nl-BJwNz421.js} +70 -0
  8. package/dist/{nl-jHKPHlmh.js → nl-CneFq5NZ.js} +4 -0
  9. package/dist/nl-NLgZUAKl.js +6 -0
  10. package/dist/types/ui/authentication/AccountsTable.vue.d.ts +5 -0
  11. package/dist/types/ui/authentication/ConsentList.vue.d.ts +3 -0
  12. package/dist/types/ui/authentication/EmailChangeForm.vue.d.ts +2 -2
  13. package/dist/types/ui/authentication/LoginButton.vue.d.ts +1 -1
  14. package/dist/types/ui/authentication/LoginForm.vue.d.ts +6 -2
  15. package/dist/types/ui/authentication/LogoutButton.vue.d.ts +12 -0
  16. package/dist/types/ui/authentication/LogoutForm.vue.d.ts +18 -0
  17. package/dist/types/ui/authentication/PasswordChangeForm.vue.d.ts +10 -2
  18. package/dist/types/ui/authentication/RegisterForm.vue.d.ts +10 -2
  19. package/dist/types/ui/authentication/RequestOtpForm.vue.d.ts +2 -2
  20. package/dist/types/ui/authentication/UserMenuButton.vue.d.ts +4 -1
  21. package/dist/types/ui/authentication/index.d.ts +2 -0
  22. package/dist/types/ui/authentication/lang/index.d.ts +12 -0
  23. package/dist/types/ui/form/DateInput.vue.d.ts +19 -1
  24. package/dist/types/ui/form/FormInput.vue.d.ts +2 -15
  25. package/dist/types/ui/form/FormItem.vue.d.ts +2 -19
  26. package/dist/types/ui/form/LocaleSelect.vue.d.ts +6 -4
  27. package/dist/types/ui/form/lang/index.d.ts +1131 -0
  28. package/dist/types/ui/general/QDrawerList.vue.d.ts +2 -7
  29. package/dist/types/ui/general/QLanguageSelect.vue.d.ts +7 -4
  30. package/dist/types/ui/general/QStyledCard.vue.d.ts +9 -5
  31. package/dist/types/ui/general/QStyledLayout.vue.d.ts +1 -1
  32. package/dist/types/ui/general/QSubmitButton.vue.d.ts +1 -1
  33. package/dist/types/ui/general/ResourcePage.vue.d.ts +17 -5
  34. package/dist/types/ui/general/ResponsiveDialog.vue.d.ts +9 -4
  35. package/dist/types/ui/md3/Md3Layout.vue.d.ts +31 -0
  36. package/dist/types/ui/md3/NavigationRailFabs.vue.d.ts +14 -0
  37. package/dist/types/ui/md3/index.d.ts +3 -0
  38. package/dist/types/ui/md3/lang/en-US.d.ts +3 -0
  39. package/dist/types/ui/md3/lang/index.d.ts +12 -0
  40. package/dist/types/ui/md3/lang/nl.d.ts +3 -0
  41. package/package.json +21 -14
  42. package/src/ui/authentication/AccountsTable.vue +18 -9
  43. package/src/ui/authentication/ConsentList.vue +13 -18
  44. package/src/ui/authentication/LoginForm.vue +12 -3
  45. package/src/ui/authentication/LogoutButton.vue +31 -0
  46. package/src/ui/authentication/LogoutForm.vue +49 -0
  47. package/src/ui/authentication/PasswordChangeForm.vue +11 -3
  48. package/src/ui/authentication/RegisterForm.vue +11 -3
  49. package/src/ui/authentication/UserMenuButton.vue +9 -3
  50. package/src/ui/authentication/index.ts +2 -0
  51. package/src/ui/authentication/lang/en-US.ts +4 -0
  52. package/src/ui/authentication/lang/index.ts +4 -0
  53. package/src/ui/authentication/lang/nl.ts +4 -0
  54. package/src/ui/form/DateInput.vue +53 -26
  55. package/src/ui/form/LocaleSelect.vue +29 -43
  56. package/src/ui/form/lang/en-US.ts +377 -0
  57. package/src/ui/form/lang/index.ts +377 -0
  58. package/src/ui/form/lang/nl.ts +377 -0
  59. package/src/ui/general/QLanguageSelect.vue +30 -105
  60. package/src/ui/general/QLanguageSelectBtn.vue.bak +99 -0
  61. package/src/ui/general/QStyledCard.vue +2 -2
  62. package/src/ui/general/ResourcePage.vue +13 -5
  63. package/src/ui/general/ResponsiveDialog.vue +23 -6
  64. package/src/ui/general/index.ts +1 -0
  65. package/src/ui/md3/Md3Layout.vue +139 -0
  66. package/src/ui/md3/NavigationRailFabs.vue +68 -0
  67. package/src/ui/md3/index.ts +3 -0
  68. package/src/ui/md3/lang/en-US.ts +7 -0
  69. package/src/ui/md3/lang/index.ts +41 -0
  70. package/src/ui/md3/lang/nl.ts +7 -0
  71. package/vite.config.ts +4 -73
  72. package/dist/flags.js +0 -255
  73. package/dist/icons.js +0 -25
  74. package/dist/index-DnmJt2wP.js +0 -7921
  75. package/dist/nl-BL9hHEHL.js +0 -76
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <q-btn icon="person">
2
+ <q-btn :icon="personIcon">
3
3
  <q-menu>
4
4
  <q-list>
5
5
  <q-item :to="userRoute">
@@ -21,15 +21,19 @@ export default {
21
21
  </script>
22
22
 
23
23
  <script setup lang="ts">
24
- import { ref, watch } from 'vue'
24
+ import { ref, toRefs, watch } from 'vue'
25
25
  import { useQuasar } from 'quasar'
26
26
  import { useLang, loadLang } from './lang'
27
27
  import type { RouteLocationRaw } from 'vue-router'
28
28
 
29
29
  export interface Props {
30
30
  userRoute: RouteLocationRaw
31
+ icons?: {
32
+ person: string
33
+ }
31
34
  }
32
- defineProps<Props>()
35
+ const props = defineProps<Props>()
36
+ const { icons } = toRefs(props)
33
37
  // const attrs = useAttrs();
34
38
  const emit = defineEmits<{
35
39
  (e: 'signOut'): void
@@ -41,6 +45,8 @@ watch($q.lang, (val) => {
41
45
  loadLang($q.lang.isoName)
42
46
  })
43
47
 
48
+ const personIcon = icons.value?.person ?? 'person'
49
+
44
50
  const variables = ref({
45
51
  // header: lang.value.some.nested.prop
46
52
  })
@@ -11,4 +11,6 @@ export { default as ConsentList } from './ConsentList.vue'
11
11
  export { default as UserMenuButton } from './UserMenuButton.vue'
12
12
  export { default as LoginButton } from './LoginButton.vue'
13
13
  export { default as AccountsTable } from './AccountsTable.vue'
14
+ export { default as LogoutForm } from './LogoutForm.vue'
15
+ export { default as LogoutButton } from './LogoutButton.vue'
14
16
  export { useLang, loadLang } from './lang/index.js'
@@ -108,6 +108,10 @@ const lang: Language = {
108
108
  removeRole: ({ email }) =>
109
109
  `Select the role which you want to remove from ${email}.`
110
110
  }
111
+ },
112
+ logout: {
113
+ confirmation: 'Are you sure you want to log out?',
114
+ logout: 'Log out'
111
115
  }
112
116
  }
113
117
 
@@ -102,6 +102,10 @@ export interface Language {
102
102
  removeRole: ({ email }: { email: string }) => string
103
103
  }
104
104
  }
105
+ logout: {
106
+ confirmation: string
107
+ logout: string
108
+ }
105
109
  }
106
110
 
107
111
  import type { Ref } from 'vue'
@@ -108,6 +108,10 @@ const lang: Language = {
108
108
  removeRole: ({ email }) =>
109
109
  `Selecteer de rol die u wilt verwijderen van ${email}.`
110
110
  }
111
+ },
112
+ logout: {
113
+ confirmation: 'Weet u zeker dat u wilt uitloggen?',
114
+ logout: 'Log uit'
111
115
  }
112
116
  }
113
117
 
@@ -7,30 +7,36 @@
7
7
  stack-label
8
8
  >
9
9
  <template #control>
10
- <component
11
- :is="QInput"
12
- v-for="(part, index) in format.split('-')"
13
- :key="part"
14
- borderless
15
- v-bind="dateProps[part]"
16
- inputmode="numeric"
17
- >
18
- <template #after>
19
- <a v-if="index < 2" style="margin-left: -0.75em; margin-top: 0.75em"
20
- >-</a
21
- >
22
- </template>
23
- </component>
10
+ <div class="row">
11
+ <component
12
+ :is="QInput"
13
+ v-for="(part, index) in format.split('-')"
14
+ :key="part"
15
+ class="col-auto"
16
+ borderless
17
+ :filled="false"
18
+ :outlined="false"
19
+ :standout="false"
20
+ :rounded="false"
21
+ v-bind="dateProps[part]"
22
+ inputmode="numeric"
23
+ dense
24
+ >
25
+ <template #after>
26
+ <a v-if="index < 2" style="margin-top: 1em; width: 1ch">-</a>
27
+ </template>
28
+ </component>
29
+ </div>
24
30
  </template>
25
31
 
26
32
  <template #append>
27
33
  <q-icon
28
34
  v-if="clearable"
29
- name="clear"
35
+ :name="icons.clear"
30
36
  class="cursor-pointer"
31
37
  @click="emit('update:modelValue', null)"
32
38
  />
33
- <q-icon name="event" class="cursor-pointer">
39
+ <q-icon :name="icons.event" class="cursor-pointer">
34
40
  <q-tooltip v-if="formattedDate">
35
41
  {{ formattedDate }}
36
42
  </q-tooltip>
@@ -52,6 +58,10 @@
52
58
  </q-popup-proxy>
53
59
  </q-icon>
54
60
  </template>
61
+
62
+ <template v-for="(_, slot) in $slots" #[slot]="scope">
63
+ <slot :name="slot" v-bind="scope || {}" />
64
+ </template>
55
65
  </q-field>
56
66
  </template>
57
67
 
@@ -74,12 +84,20 @@ export interface Props {
74
84
  required?: boolean
75
85
  clearable?: boolean
76
86
  date?: Partial<QDateProps>
87
+ icons?: {
88
+ event: string
89
+ clear: string
90
+ }
77
91
  }
78
92
  const props = withDefaults(defineProps<Props>(), {
79
93
  format: 'YYYY-MM-DD',
80
94
  locale: 'en-US',
81
95
  label: '',
82
- date: () => ({})
96
+ date: () => ({}),
97
+ icons: () => ({
98
+ event: 'event',
99
+ clear: 'clear'
100
+ })
83
101
  })
84
102
  const emit = defineEmits<{
85
103
  (e: 'update:modelValue', val: string | null): void
@@ -187,12 +205,15 @@ const dateProps = computed<Record<string, QInputProps>>(() => ({
187
205
  modelValue: year.value,
188
206
  placeholder: lang.value.datePicker.YYYY,
189
207
  style: {
190
- width: format.value === 'YYYY-MM-DD' ? '8ch' : '6ch',
191
- 'margin-top': '-2em',
192
- 'margin-bottom': '-0.5em'
208
+ 'max-width': format.value === 'YYYY-MM-DD' ? '8ch' : '7ch',
209
+ 'margin-top': '-1.75em',
210
+ 'margin-bottom': '-0.5em',
211
+ background: 'transparent',
212
+ border: 0
193
213
  },
194
214
  // suffix: format.value === 'YYYY-MM-DD' ? '-' : undefined,
195
215
  class: format.value !== 'YYYY-MM-DD' ? 'q-mb-none q-ml-none' : undefined,
216
+ inputClass: 'text-center',
196
217
  'onUpdate:modelValue': setYear,
197
218
  onKeydown: goToNextElement
198
219
  },
@@ -200,12 +221,15 @@ const dateProps = computed<Record<string, QInputProps>>(() => ({
200
221
  modelValue: month.value ? String(month.value).padStart(2, '0') : '',
201
222
  placeholder: lang.value.datePicker.MM,
202
223
  style: {
203
- width: '6ch',
204
- 'margin-top': '-2em',
205
- 'margin-bottom': '-0.5em'
224
+ 'max-width': '7ch',
225
+ 'margin-top': '-1.75em',
226
+ 'margin-bottom': '-0.5em',
227
+ background: 'transparent',
228
+ border: 0
206
229
  },
207
230
  // suffix: '-',
208
231
  class: 'q-ml-none',
232
+ inputClass: 'text-center',
209
233
  'onUpdate:modelValue': setMonth,
210
234
  onKeydown: goToNextElement
211
235
  },
@@ -213,12 +237,15 @@ const dateProps = computed<Record<string, QInputProps>>(() => ({
213
237
  modelValue: day.value ? String(day.value).padStart(2, '0') : '',
214
238
  placeholder: lang.value.datePicker.DD,
215
239
  style: {
216
- width: format.value === 'DD-MM-YYYY' ? '6ch' : '4ch',
217
- 'margin-top': '-2em',
218
- 'margin-bottom': '-0.5em'
240
+ 'max-width': format.value === 'DD-MM-YYYY' ? '7ch' : '4ch',
241
+ 'margin-top': '-1.75em',
242
+ 'margin-bottom': '-0.5em',
243
+ background: 'transparent',
244
+ border: 0
219
245
  },
220
246
  // suffix: format.value === 'DD-MM-YYYY' ? '-' : undefined,
221
247
  class: format.value === 'YYYY-MM-DD' ? 'q-ml-none' : undefined,
248
+ inputClass: 'text-center',
222
249
  'onUpdate:modelValue': setDay,
223
250
  onKeydown: goToNextElement
224
251
  }
@@ -3,32 +3,27 @@
3
3
  v-bind="attrs"
4
4
  :options="languageOptions"
5
5
  :model-value="modelValue"
6
- :label="`${lang.locale.locale}${required ? '*' : ''}`"
6
+ :filled="false"
7
+ borderless
7
8
  emit-value
8
9
  map-options
9
10
  >
10
- <template #selected>
11
- <div v-if="modelValue">
12
- <component
13
- :is="flags[modelValue.slice(-2).toLowerCase() as keyof typeof flags]"
14
- />
15
- {{
16
- flagsLang.languages[
17
- modelValue as keyof (typeof flagsLang)['languages']
18
- ]
19
- }}
11
+ <template #selected-item="scope">
12
+ <div v-if="scope.opt">
13
+ <q-item>
14
+ <q-item-section avatar>
15
+ <q-icon :name="scope.opt.icon" />
16
+ </q-item-section>
17
+ <q-item-section label>
18
+ {{ scope.opt.label }}
19
+ </q-item-section>
20
+ </q-item>
20
21
  </div>
21
22
  </template>
22
23
  <template #option="scope">
23
24
  <q-item v-bind="scope.itemProps">
24
25
  <q-item-section avatar>
25
- <component
26
- :is="
27
- flags[
28
- scope.opt.value.slice(-2).toLowerCase() as keyof typeof flags
29
- ]
30
- "
31
- />
26
+ <q-icon :name="scope.opt.icon" />
32
27
  </q-item-section>
33
28
  <q-item-section>
34
29
  <q-item-label>
@@ -41,39 +36,30 @@
41
36
  </template>
42
37
 
43
38
  <script setup lang="ts">
44
- import { useAttrs, computed } from 'vue'
39
+ import { useAttrs, computed, toRefs } from 'vue'
45
40
  import { QSelect } from 'quasar'
46
- import * as flags from '../flags/index.js'
47
- import { useLang as useFlagsLang } from '../flags/lang/index.js'
48
- import { useLang } from './lang/index.js'
41
+ import { Language, useLang } from './lang/index.js'
49
42
 
50
43
  export interface Props {
51
- modelValue?: string | null
52
- required?: boolean
53
- allowedCodes?: [keyof ReturnType<typeof useFlagsLang>['value']['languages']]
44
+ modelValue: keyof Language['countries']
45
+ locales: {
46
+ icon: string
47
+ isoName: keyof Language['languages']
48
+ }[]
54
49
  }
55
- const {
56
- modelValue,
57
- required,
58
- allowedCodes = ['en-US', 'nl']
59
- } = defineProps<Props>()
60
- const attrs = useAttrs()
50
+ const props = defineProps<Props>()
51
+ const { modelValue, locales } = toRefs(props)
61
52
 
62
53
  const lang = useLang()
63
- const flagsLang = useFlagsLang()
54
+ const attrs = useAttrs()
64
55
 
65
56
  const languageOptions = computed(() => {
66
- const options = []
67
- for (let lang of Object.keys(flagsLang.value.languages) as Array<
68
- keyof (typeof flagsLang.value)['languages']
69
- >) {
70
- if (!allowedCodes?.length || allowedCodes.includes(lang)) {
71
- options.push({
72
- label: flagsLang.value.languages[lang],
73
- value: lang
74
- })
75
- }
76
- }
57
+ const options = locales.value.map((locale) => ({
58
+ label: lang.value.languages[locale.isoName],
59
+ value: locale.isoName,
60
+ icon: locale.icon
61
+ }))
62
+
77
63
  return options
78
64
  })
79
65
  </script>