@simsustech/quasar-components 0.1.3 → 0.2.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 (64) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{QSubmitButton.vue_vue_type_script_setup_true_lang.1d0c06eb.js → QSubmitButton.vue_vue_type_script_setup_true_lang.65d6ac94.js} +6 -2
  3. package/dist/authentication.js +3 -3
  4. package/dist/en-US.d5751f99.js +217 -0
  5. package/dist/flags.js +5 -215
  6. package/dist/form.js +492 -0
  7. package/dist/general.js +341 -12
  8. package/dist/icons.js +2 -2
  9. package/dist/{nl.6b0aedb7.js → nl.1df15493.js} +1 -1
  10. package/dist/nl.7a710ba4.js +35 -0
  11. package/dist/style.css +2 -2
  12. package/dist/types/ui/form/BooleanItem.vue.d.ts +57 -0
  13. package/dist/types/ui/form/BooleanSelect.vue.d.ts +66 -0
  14. package/dist/types/ui/form/DateInput.vue.d.ts +61 -0
  15. package/dist/types/ui/form/FormInput.vue.d.ts +60 -0
  16. package/dist/types/ui/form/FormItem.vue.d.ts +64 -0
  17. package/dist/types/ui/form/GenderItem.vue.d.ts +57 -0
  18. package/dist/types/ui/form/GenderSelect.vue.d.ts +66 -0
  19. package/dist/types/ui/form/PostalCodeInput.vue.d.ts +67 -0
  20. package/dist/types/ui/form/TelephoneNumberInput.vue.d.ts +65 -0
  21. package/dist/types/ui/form/index.d.ts +9 -0
  22. package/dist/types/ui/form/lang/en-US.d.ts +3 -0
  23. package/dist/types/ui/form/lang/index.d.ts +68 -0
  24. package/dist/types/ui/form/lang/nl.d.ts +3 -0
  25. package/dist/types/ui/general/QLanguageSelect.vue.d.ts +58 -0
  26. package/dist/types/ui/general/QSubmitButton.vue.d.ts +21 -1
  27. package/dist/types/ui/general/ResourcePage.vue.d.ts +159 -0
  28. package/dist/types/ui/general/ResponsiveDialog.vue.d.ts +108 -0
  29. package/dist/types/ui/general/index.d.ts +3 -0
  30. package/dist/types/virtualModules.d.ts +1 -0
  31. package/dist/virtualModules.d.ts +1 -0
  32. package/dist/virtualModules.js +3 -2
  33. package/dist/vite-plugin.js +26 -5
  34. package/package.json +6 -1
  35. package/src/ui/authentication/lang/en-US.ts +1 -2
  36. package/src/ui/authentication/lang/nl.ts +1 -2
  37. package/src/ui/flags/README.md +1 -1
  38. package/src/ui/form/BooleanItem.vue +34 -0
  39. package/src/ui/form/BooleanSelect.vue +55 -0
  40. package/src/ui/form/DateInput.vue +70 -0
  41. package/src/ui/form/FormInput.vue +44 -0
  42. package/src/ui/form/FormItem.vue +50 -0
  43. package/src/ui/form/GenderItem.vue +35 -0
  44. package/src/ui/form/GenderSelect.vue +59 -0
  45. package/src/ui/form/PostalCodeInput.vue +47 -0
  46. package/src/ui/form/TelephoneNumberInput.vue +35 -0
  47. package/src/ui/form/index.ts +9 -0
  48. package/src/ui/form/lang/en-US.ts +36 -0
  49. package/src/ui/form/lang/index.ts +70 -0
  50. package/src/ui/form/lang/nl.ts +36 -0
  51. package/src/ui/general/QLanguageSelect.vue +86 -0
  52. package/src/ui/general/QStyledCard.vue +1 -1
  53. package/src/ui/general/QSubmitButton.vue +6 -1
  54. package/src/ui/general/ResourcePage.vue +121 -0
  55. package/src/ui/general/ResponsiveDialog.vue +94 -0
  56. package/src/ui/general/index.ts +3 -0
  57. package/src/ui/icons/README.md +2 -0
  58. package/src/virtualModules.ts +48 -5
  59. package/src/vite-plugin.ts +26 -6
  60. package/vite.config.ts +30 -30
  61. package/dist/types/ui/index.d.ts +0 -1
  62. package/src/ui/index.ts +0 -1
  63. /package/dist/types/ui/icons/{icons.d.ts → labels.d.ts} +0 -0
  64. /package/src/ui/icons/{icons.ts → labels.ts} +0 -0
@@ -0,0 +1,159 @@
1
+ export interface Props {
2
+ type?: 'create' | 'update';
3
+ disabled?: boolean;
4
+ }
5
+ declare const _default: {
6
+ new (...args: any[]): {
7
+ $: import("vue").ComponentInternalInstance;
8
+ $data: {};
9
+ $props: Partial<{
10
+ type: "create" | "update";
11
+ disabled: boolean;
12
+ }> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
13
+ type: string;
14
+ disabled: boolean;
15
+ }>>> & {
16
+ onCreate?: ((args_0: {
17
+ data?: any;
18
+ done: (success?: boolean) => void;
19
+ }) => any) | undefined;
20
+ onUpdate?: ((args_0: {
21
+ data?: any;
22
+ done: (success?: boolean) => void;
23
+ }) => any) | undefined;
24
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "type" | "disabled">;
25
+ $attrs: {
26
+ [x: string]: unknown;
27
+ };
28
+ $refs: {
29
+ [x: string]: unknown;
30
+ };
31
+ $slots: Readonly<{
32
+ [name: string]: import("vue").Slot | undefined;
33
+ }>;
34
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
35
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
36
+ $emit: ((event: "create", args_0: {
37
+ data?: any;
38
+ done: (success?: boolean) => void;
39
+ }) => void) & ((event: "update", args_0: {
40
+ data?: any;
41
+ done: (success?: boolean) => void;
42
+ }) => void);
43
+ $el: any;
44
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
45
+ type: string;
46
+ disabled: boolean;
47
+ }>>> & {
48
+ onCreate?: ((args_0: {
49
+ data?: any;
50
+ done: (success?: boolean) => void;
51
+ }) => any) | undefined;
52
+ onUpdate?: ((args_0: {
53
+ data?: any;
54
+ done: (success?: boolean) => void;
55
+ }) => any) | undefined;
56
+ }, {
57
+ variables: import("vue").Ref<{}>;
58
+ functions: import("vue").Ref<{}>;
59
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
60
+ create: (payload_0: {
61
+ data?: any;
62
+ done: (success?: boolean) => void;
63
+ }) => void;
64
+ } & {
65
+ update: (payload_0: {
66
+ data?: any;
67
+ done: (success?: boolean) => void;
68
+ }) => void;
69
+ }, string, {
70
+ type: "create" | "update";
71
+ disabled: boolean;
72
+ }, {}, string> & {
73
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
74
+ created?: ((() => void) | (() => void)[]) | undefined;
75
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
76
+ mounted?: ((() => void) | (() => void)[]) | undefined;
77
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
78
+ updated?: ((() => void) | (() => void)[]) | undefined;
79
+ activated?: ((() => void) | (() => void)[]) | undefined;
80
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
81
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
82
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
83
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
84
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
85
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
86
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
87
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
88
+ };
89
+ $forceUpdate: () => void;
90
+ $nextTick: typeof import("vue").nextTick;
91
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
92
+ } & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
93
+ type: string;
94
+ disabled: boolean;
95
+ }>>> & {
96
+ onCreate?: ((args_0: {
97
+ data?: any;
98
+ done: (success?: boolean) => void;
99
+ }) => any) | undefined;
100
+ onUpdate?: ((args_0: {
101
+ data?: any;
102
+ done: (success?: boolean) => void;
103
+ }) => any) | undefined;
104
+ } & import("vue").ShallowUnwrapRef<{
105
+ variables: import("vue").Ref<{}>;
106
+ functions: import("vue").Ref<{}>;
107
+ }> & {} & import("vue").ComponentCustomProperties & {};
108
+ __isFragment?: undefined;
109
+ __isTeleport?: undefined;
110
+ __isSuspense?: undefined;
111
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
112
+ type: string;
113
+ disabled: boolean;
114
+ }>>> & {
115
+ onCreate?: ((args_0: {
116
+ data?: any;
117
+ done: (success?: boolean) => void;
118
+ }) => any) | undefined;
119
+ onUpdate?: ((args_0: {
120
+ data?: any;
121
+ done: (success?: boolean) => void;
122
+ }) => any) | undefined;
123
+ }, {
124
+ variables: import("vue").Ref<{}>;
125
+ functions: import("vue").Ref<{}>;
126
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
127
+ create: (payload_0: {
128
+ data?: any;
129
+ done: (success?: boolean) => void;
130
+ }) => void;
131
+ } & {
132
+ update: (payload_0: {
133
+ data?: any;
134
+ done: (success?: boolean) => void;
135
+ }) => void;
136
+ }, string, {
137
+ type: "create" | "update";
138
+ disabled: boolean;
139
+ }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
140
+ $slots: {
141
+ default: (_: {}) => any;
142
+ header: (_: {}) => any;
143
+ };
144
+ });
145
+ export default _default;
146
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
147
+ type __VLS_TypePropsToRuntimeProps<T> = {
148
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
149
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
150
+ } : {
151
+ type: import('vue').PropType<T[K]>;
152
+ required: true;
153
+ };
154
+ };
155
+ type __VLS_WithDefaults<P, D> = {
156
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
157
+ default: D[K];
158
+ } : P[K];
159
+ };
@@ -0,0 +1,108 @@
1
+ export interface Props {
2
+ display?: boolean;
3
+ }
4
+ declare const _default: {
5
+ new (...args: any[]): {
6
+ $: import("vue").ComponentInternalInstance;
7
+ $data: {};
8
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
9
+ onSubmit?: ((args_0: {
10
+ done: (success?: boolean) => void;
11
+ }) => any) | undefined;
12
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
13
+ $attrs: {
14
+ [x: string]: unknown;
15
+ };
16
+ $refs: {
17
+ [x: string]: unknown;
18
+ };
19
+ $slots: Readonly<{
20
+ [name: string]: import("vue").Slot | undefined;
21
+ }>;
22
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
23
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null;
24
+ $emit: (event: "submit", args_0: {
25
+ done: (success?: boolean) => void;
26
+ }) => void;
27
+ $el: any;
28
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
29
+ onSubmit?: ((args_0: {
30
+ done: (success?: boolean) => void;
31
+ }) => any) | undefined;
32
+ }, {
33
+ variables: import("vue").Ref<{}>;
34
+ functions: import("vue").Ref<{
35
+ open: () => boolean;
36
+ close: () => boolean;
37
+ toggle: () => boolean;
38
+ }>;
39
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
40
+ submit: (payload_0: {
41
+ done: (success?: boolean) => void;
42
+ }) => void;
43
+ }, string, {}, {}, string> & {
44
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
45
+ created?: ((() => void) | (() => void)[]) | undefined;
46
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
47
+ mounted?: ((() => void) | (() => void)[]) | undefined;
48
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
49
+ updated?: ((() => void) | (() => void)[]) | undefined;
50
+ activated?: ((() => void) | (() => void)[]) | undefined;
51
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
52
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
53
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
54
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
55
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
56
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
57
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
58
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string>, {}> | null, info: string) => boolean | void)[]) | undefined;
59
+ };
60
+ $forceUpdate: () => void;
61
+ $nextTick: typeof import("vue").nextTick;
62
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => any : (...args: any) => any, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
63
+ } & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
64
+ onSubmit?: ((args_0: {
65
+ done: (success?: boolean) => void;
66
+ }) => any) | undefined;
67
+ } & import("vue").ShallowUnwrapRef<{
68
+ variables: import("vue").Ref<{}>;
69
+ functions: import("vue").Ref<{
70
+ open: () => boolean;
71
+ close: () => boolean;
72
+ toggle: () => boolean;
73
+ }>;
74
+ }> & {} & import("vue").ComponentCustomProperties & {};
75
+ __isFragment?: undefined;
76
+ __isTeleport?: undefined;
77
+ __isSuspense?: undefined;
78
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & {
79
+ onSubmit?: ((args_0: {
80
+ done: (success?: boolean) => void;
81
+ }) => any) | undefined;
82
+ }, {
83
+ variables: import("vue").Ref<{}>;
84
+ functions: import("vue").Ref<{
85
+ open: () => boolean;
86
+ close: () => boolean;
87
+ toggle: () => boolean;
88
+ }>;
89
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
90
+ submit: (payload_0: {
91
+ done: (success?: boolean) => void;
92
+ }) => void;
93
+ }, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
94
+ $slots: {
95
+ title: (_: {}) => any;
96
+ default: (_: {}) => any;
97
+ };
98
+ });
99
+ export default _default;
100
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
101
+ type __VLS_TypePropsToRuntimeProps<T> = {
102
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
103
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
104
+ } : {
105
+ type: import('vue').PropType<T[K]>;
106
+ required: true;
107
+ };
108
+ };
@@ -1,2 +1,5 @@
1
1
  export { default as QSubmitButton } from './QSubmitButton.vue';
2
2
  export { default as QStyledCard } from './QStyledCard.vue';
3
+ export { default as ResponsiveDialog } from './ResponsiveDialog.vue';
4
+ export { default as ResourcePage } from './ResourcePage.vue';
5
+ export { default as QLanguageSelect } from './QLanguageSelect.vue';
@@ -1,2 +1,3 @@
1
1
  export declare const FlagIcon: (locale: string) => string;
2
2
  export declare const Icon: (icon: string) => string;
3
+ export declare const FormItem: (field: string) => string;
@@ -1,2 +1,3 @@
1
1
  export declare const FlagIcon: (locale: string) => string;
2
2
  export declare const Icon: (icon: string) => string;
3
+ export declare const FormItem: (field: string) => string;
@@ -1,2 +1,3 @@
1
- export var FlagIcon = function (locale) { return "\n import { computed, ref, watch, h } from 'vue'\n import { QuasarLanguageCodes, 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 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 { QuasarLanguageCodes, useQuasar, QIcon } from 'quasar'\n import icon from '".concat(new URL("../src/ui/icons/assets/".concat(icon, ".svg"), import.meta.url).pathname, "'\n import icons from '").concat(new URL("../src/ui/icons/icons.ts", import.meta.url).pathname, "'\n export default {\n setup(props, context) {\n const $q = useQuasar()\n\n const variables = ref(icons['").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 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"); };
3
+ export var FormItem = function (field) { return "\nimport { ref, watch, useAttrs, h } from 'vue'\nimport { QItem, QItemLabel, QItemSection, useQuasar } from 'quasar'\nimport { useLang, loadLang } from '".concat(new URL("../src/ui/form/lang/index.ts", import.meta.url).pathname, "'\n\nexport default {\n setup(props, context) {\n const $q = useQuasar()\n const attrs = useAttrs()\n\n const lang = useLang()\n\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 variables = ref({})\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 () =>\n h(QItem, { attrs }, [\n h(QItemSection, {}, [\n h(QItemLabel, { overline: true }, 'field'),\n h(QItemLabel, {}, 'field')\n ])\n ])\n }\n}\n"); };
@@ -35,6 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import { promises } from 'fs';
38
+ import { Icon, FlagIcon } from './virtualModules.js';
38
39
  var readFile = promises.readFile;
39
40
  export default function (_a) {
40
41
  var _b = _a === void 0 ? {} : _a, buildFromSrc = _b.buildFromSrc;
@@ -51,20 +52,40 @@ export default function (_a) {
51
52
  name = pkgJson.name;
52
53
  return [2 /*return*/, {
53
54
  name: "".concat(name, "-plugin"),
55
+ enforce: 'pre',
56
+ resolveId: function (id) {
57
+ if (id.includes('.flag'))
58
+ return id;
59
+ else if (id.includes('.icon'))
60
+ return id;
61
+ },
62
+ load: function (id) {
63
+ if (id.includes('.flag')) {
64
+ var locale = id.slice(0, -5);
65
+ var flag = FlagIcon(locale);
66
+ return flag;
67
+ }
68
+ else if (id.includes('.icon')) {
69
+ var iconId = id.slice(0, -5);
70
+ var icon = Icon(iconId);
71
+ return icon;
72
+ }
73
+ },
54
74
  config: function (config, _a) {
55
75
  var mode = _a.mode;
56
76
  if (mode === 'development' || buildFromSrc) {
57
77
  var alias = Object.entries(exports)
78
+ .filter(function (_a) {
79
+ var key = _a[0], val = _a[1];
80
+ return val.src;
81
+ })
58
82
  .map(function (_a) {
59
83
  var key = _a[0], val = _a[1];
60
84
  return {
61
- find: name + key.slice(1),
85
+ find: new RegExp("^".concat(name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + key.slice(1), "$")),
86
+ // name: name + key.slice(1),
62
87
  replacement: new URL('.' + val.src, import.meta.url).pathname
63
88
  };
64
- })
65
- .sort(function (a, b) {
66
- return (b.find.match(/\//g) || []).length -
67
- (a.find.match(/\//g) || []).length;
68
89
  });
69
90
  return {
70
91
  resolve: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simsustech/quasar-components",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "author": "Stefan van Herwijnen",
5
5
  "description": "High level components for Quasar Framework",
6
6
  "license": "MIT",
@@ -27,6 +27,11 @@
27
27
  "import": "./dist/icons.js",
28
28
  "src": "./src/ui/icons/index.ts"
29
29
  },
30
+ "./form": {
31
+ "types": "./dist/types/ui/form/index.d.ts",
32
+ "import": "./dist/form.js",
33
+ "src": "./src/ui/form/index.ts"
34
+ },
30
35
  "./css": {
31
36
  "import": "./dist/style.css"
32
37
  },
@@ -86,8 +86,7 @@ const lang: Language = {
86
86
  alreadyRegistered: 'Email address is already registered.'
87
87
  },
88
88
  verification: {
89
- slider:
90
- 'Sleep a.u.b. de onderstaande balk helemaal naar rechts tot deze groen wordt.'
89
+ slider: 'Please drag the slider below all the way to the right.'
91
90
  }
92
91
  }
93
92
 
@@ -86,8 +86,7 @@ const lang: Language = {
86
86
  alreadyRegistered: 'Email adres is al geregistreerd.'
87
87
  },
88
88
  verification: {
89
- slider:
90
- 'Please drag the slider all the way to the right until it turns green.'
89
+ slider: 'Sleep a.u.b. het onderstaande bolletje helemaal naar rechts.'
91
90
  }
92
91
  }
93
92
 
@@ -16,7 +16,7 @@ Tree-shakeable flag icons for Quasar Framework built with Vite.
16
16
  </template>
17
17
 
18
18
  <script setup>
19
- import {enUsIcon} from '@simsustech/quasar-components/flags'
19
+ import {enUS} from '@simsustech/quasar-components/flags'
20
20
  ...
21
21
  </script>
22
22
  ```
@@ -0,0 +1,34 @@
1
+ <template>
2
+ <q-item v-bind="attrs">
3
+ <q-item-section>
4
+ <q-item-label overline>
5
+ {{ label }}
6
+ </q-item-label>
7
+ <q-item-label>
8
+ {{ modelValue ? lang.yes : lang.no }}
9
+ </q-item-label>
10
+ </q-item-section>
11
+ </q-item>
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+ import { watch, useAttrs } from 'vue'
16
+ import { QItem, QItemLabel, QItemSection, useQuasar } from 'quasar'
17
+ import { useLang, loadLang } from './lang'
18
+
19
+ export interface Props {
20
+ modelValue: boolean
21
+ label: string
22
+ }
23
+ defineProps<Props>()
24
+
25
+ const attrs = useAttrs()
26
+
27
+ const lang = useLang()
28
+
29
+ const $q = useQuasar()
30
+ if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
31
+ watch($q.lang, (val) => {
32
+ loadLang($q.lang.isoName)
33
+ })
34
+ </script>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <q-select
3
+ v-bind="attrs"
4
+ :rules="validations"
5
+ :model-value="modelValue"
6
+ :options="booleanOptions"
7
+ :label="`${label}${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 { watch, useAttrs, ref } from 'vue'
16
+ import { QSelect, useQuasar, ValidationRule } from 'quasar'
17
+ import { useLang, loadLang } from './lang'
18
+
19
+ export interface Props {
20
+ modelValue: boolean
21
+ label?: string
22
+ required?: boolean
23
+ }
24
+ const props = defineProps<Props>()
25
+
26
+ const attrs = useAttrs()
27
+
28
+ const lang = useLang()
29
+
30
+ const $q = useQuasar()
31
+ if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
32
+ watch($q.lang, (val) => {
33
+ loadLang($q.lang.isoName)
34
+ })
35
+
36
+ const booleanOptions = [
37
+ {
38
+ label: lang.value.yes,
39
+ value: true
40
+ },
41
+ {
42
+ label: lang.value.no,
43
+ value: false
44
+ }
45
+ ]
46
+
47
+ const validations = ref<ValidationRule[]>([])
48
+
49
+ if (props.required)
50
+ validations.value.push(
51
+ (val: { label: string; value: string }) =>
52
+ !!val || lang.value.validations.fieldRequired
53
+ )
54
+ defineEmits(['update:modelValue'])
55
+ </script>
@@ -0,0 +1,70 @@
1
+ <template>
2
+ <q-input
3
+ v-bind="attrs"
4
+ :rules="validations"
5
+ :model-value="modelValue"
6
+ :label="`${label}${required ? '*' : ''}`"
7
+ mask="date"
8
+ class="q-pr-md"
9
+ @update:model-value="$emit('update:modelValue', $event)"
10
+ >
11
+ <template v-slot:append>
12
+ <q-icon
13
+ v-if="clearable"
14
+ name="clear"
15
+ class="cursor-pointer"
16
+ @click="$emit('update:modelValue', '')"
17
+ />
18
+ <q-icon name="event" class="cursor-pointer">
19
+ <q-popup-proxy cover transition-show="scale" transition-hide="scale">
20
+ <q-date
21
+ v-bind="date"
22
+ :model-value="modelValue"
23
+ @update:model-value="$emit('update:modelValue', $event)"
24
+ >
25
+ <div class="row items-center justify-end">
26
+ <q-btn
27
+ v-close-popup
28
+ :label="lang.buttons.close"
29
+ color="primary"
30
+ flat
31
+ />
32
+ </div>
33
+ </q-date>
34
+ </q-popup-proxy>
35
+ </q-icon>
36
+ </template>
37
+ </q-input>
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import { ref, watch, useAttrs } from 'vue'
42
+ import { QDateProps, QInput, useQuasar } from 'quasar'
43
+ import { useLang, loadLang } from './lang'
44
+
45
+ export interface Props {
46
+ modelValue?: string | null
47
+ label?: string
48
+ required?: boolean
49
+ clearable?: boolean
50
+ date?: Partial<QDateProps>
51
+ }
52
+ const props = defineProps<Props>()
53
+
54
+ const attrs = useAttrs()
55
+
56
+ const lang = useLang()
57
+
58
+ const $q = useQuasar()
59
+ if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
60
+ watch($q.lang, (val) => {
61
+ loadLang($q.lang.isoName)
62
+ })
63
+
64
+ const validations = ref<((val: string) => boolean | string)[]>([])
65
+
66
+ if (props.required)
67
+ validations.value.push(
68
+ (val: string) => !!val || lang.value.validations.fieldRequired
69
+ )
70
+ </script>
@@ -0,0 +1,44 @@
1
+ <template>
2
+ <q-input
3
+ v-bind="attrs"
4
+ :rules="validations"
5
+ :model-value="modelValue"
6
+ :label="`${field ? lang.fields[field] : label ? label : ''}${
7
+ required ? '*' : ''
8
+ }`"
9
+ @update:model-value="$emit('update:modelValue', $event)"
10
+ ></q-input>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import { ref, watch, useAttrs } from 'vue'
15
+ import { QInput, useQuasar, ValidationRule } from 'quasar'
16
+ import { useLang, loadLang } from './lang'
17
+
18
+ export type FormItems = 'name' | 'firstName' | 'surname' | 'address' | 'city'
19
+
20
+ export interface Props {
21
+ modelValue?: string | null
22
+ field?: FormItems
23
+ label?: string
24
+ required?: boolean
25
+ }
26
+ const props = defineProps<Props>()
27
+
28
+ const attrs = useAttrs()
29
+
30
+ const lang = useLang()
31
+
32
+ const $q = useQuasar()
33
+ if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
34
+ watch($q.lang, (val) => {
35
+ loadLang($q.lang.isoName)
36
+ })
37
+
38
+ const validations = ref<ValidationRule[]>([])
39
+
40
+ if (props.required)
41
+ validations.value.push(
42
+ (val: string) => !!val || lang.value.validations.fieldRequired
43
+ )
44
+ </script>
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <q-item v-bind="attrs">
3
+ <q-item-section v-if="slots.avatar" avatar>
4
+ <slot name="avatar" />
5
+ </q-item-section>
6
+ <q-item-section>
7
+ <q-item-label overline>
8
+ {{ label ? label : field ? lang.fields[field] : '' }}
9
+ </q-item-label>
10
+ <q-item-label>
11
+ {{ modelValue || '-' }}
12
+ </q-item-label>
13
+ </q-item-section>
14
+ <q-item-section v-if="slots.side" side>
15
+ <slot name="side" />
16
+ </q-item-section>
17
+ </q-item>
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ import { watch, useAttrs, useSlots } from 'vue'
22
+ import { QItem, QItemLabel, QItemSection, useQuasar } from 'quasar'
23
+ import { useLang, loadLang } from './lang'
24
+
25
+ export type FormItems =
26
+ | 'name'
27
+ | 'firstName'
28
+ | 'surname'
29
+ | 'address'
30
+ | 'city'
31
+ | 'postalCode'
32
+
33
+ export interface Props {
34
+ modelValue?: string
35
+ label?: string
36
+ field?: FormItems
37
+ }
38
+ defineProps<Props>()
39
+
40
+ const attrs = useAttrs()
41
+ const slots = useSlots()
42
+
43
+ const lang = useLang()
44
+
45
+ const $q = useQuasar()
46
+ if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
47
+ watch($q.lang, (val) => {
48
+ loadLang($q.lang.isoName)
49
+ })
50
+ </script>