@simsustech/quasar-components 0.1.2 → 0.1.3

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 (40) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{QSubmitButton.vue_vue_type_script_setup_true_lang.fe90878f.js → QSubmitButton.vue_vue_type_script_setup_true_lang.1d0c06eb.js} +2 -2
  3. package/dist/authentication.js +24 -6
  4. package/dist/general.js +2 -2
  5. package/dist/types/ui/authentication/ConsentList.vue.d.ts +2 -2
  6. package/dist/types/ui/authentication/EmailChangeForm.vue.d.ts +3 -3
  7. package/dist/types/ui/authentication/EmailChangeStepper.vue.d.ts +2 -2
  8. package/dist/types/ui/authentication/LoginButton.vue.d.ts +2 -2
  9. package/dist/types/ui/authentication/LoginForm.vue.d.ts +3 -3
  10. package/dist/types/ui/authentication/OtpInput.vue.d.ts +2 -2
  11. package/dist/types/ui/authentication/PasswordChangeForm.vue.d.ts +10 -10
  12. package/dist/types/ui/authentication/PasswordChangeStepper.vue.d.ts +2 -2
  13. package/dist/types/ui/authentication/RegisterForm.vue.d.ts +10 -10
  14. package/dist/types/ui/authentication/RequestOtpForm.vue.d.ts +3 -3
  15. package/dist/types/ui/authentication/UserMenuButton.vue.d.ts +2 -2
  16. package/dist/types/ui/authentication/VerificationSlider.vue.d.ts +2 -2
  17. package/dist/types/ui/general/QStyledCard.vue.d.ts +2 -2
  18. package/dist/types/ui/general/QStyledLayout.vue.d.ts +2 -2
  19. package/dist/types/ui/index.d.ts +0 -1
  20. package/dist/types/virtualModules.d.ts +2 -0
  21. package/dist/types/vite-plugin.d.ts +3 -1
  22. package/dist/virtualModules.d.ts +2 -0
  23. package/dist/virtualModules.js +2 -0
  24. package/dist/vite-plugin.d.ts +3 -1
  25. package/dist/vite-plugin.js +40 -25
  26. package/package.json +8 -5
  27. package/src/ui/authentication/EmailChangeForm.vue +7 -2
  28. package/src/ui/authentication/EmailChangeStepper.vue +4 -0
  29. package/src/ui/authentication/LoginForm.vue +7 -2
  30. package/src/ui/authentication/PasswordChangeForm.vue +7 -2
  31. package/src/ui/authentication/PasswordChangeStepper.vue +4 -0
  32. package/src/ui/authentication/RegisterForm.vue +7 -2
  33. package/src/ui/authentication/RequestOtpForm.vue +2 -2
  34. package/src/ui/general/QSubmitButton.vue +1 -1
  35. package/src/ui/index.ts +0 -1
  36. package/src/virtualModules.ts +70 -0
  37. package/src/vite-plugin.ts +40 -17
  38. package/tsconfig.build.plugin.json +1 -1
  39. package/tsconfig.node.json +1 -1
  40. package/vite.config.ts +63 -63
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @simsustech/quasar-components
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 0926b41: Bind submit button to forms
8
+
3
9
  ## 0.1.2
4
10
 
5
11
  ### Patch Changes
@@ -80,9 +80,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
80
80
  label: __props.isNextButton ? unref(lang2).next : unref(lang2).submit,
81
81
  color: "primary",
82
82
  loading: __props.loading || unref(loadingInternal),
83
- type: __props.useForm ? "submit" : void 0,
83
+ type: "submit",
84
84
  onClick: submit
85
- }), null, 16, ["label", "loading", "type"]);
85
+ }), null, 16, ["label", "loading"]);
86
86
  };
87
87
  }
88
88
  });
@@ -1,6 +1,6 @@
1
1
  import { useQuasar, QForm, QInput, QStep, QStepperNavigation, QStepper, QIcon, QBtn, QSlider, QItemSection, QItem, QList, QMenu } from "quasar";
2
2
  import { ref, defineComponent, watch, computed, openBlock, createBlock, unref, mergeProps, withCtx, createVNode, renderSlot, toRef, createCommentVNode, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString } from "vue";
3
- import { _ as _sfc_main$c } from "./QSubmitButton.vue_vue_type_script_setup_true_lang.fe90878f.js";
3
+ import { _ as _sfc_main$c } from "./QSubmitButton.vue_vue_type_script_setup_true_lang.1d0c06eb.js";
4
4
  const lang$1 = {
5
5
  isoName: "en-US",
6
6
  myAccount: "Account",
@@ -422,7 +422,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
422
422
  return openBlock(), createBlock(unref(QForm), mergeProps({
423
423
  ref_key: "formRef",
424
424
  ref: formRef
425
- }, __props.form), {
425
+ }, __props.form, {
426
+ onSubmit: _cache[1] || (_cache[1] = (e) => submit)
427
+ }), {
426
428
  default: withCtx(() => [
427
429
  createVNode(_component_q_input, mergeProps(__props.input, {
428
430
  id: "email",
@@ -534,7 +536,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
534
536
  ref_key: "formRef",
535
537
  ref: formRef,
536
538
  class: "q-gutter-md"
537
- }, __props.form), {
539
+ }, __props.form, {
540
+ onSubmit: _cache[3] || (_cache[3] = (e) => submit)
541
+ }), {
538
542
  default: withCtx(() => [
539
543
  createVNode(_sfc_main$a, mergeProps(__props.input, {
540
544
  modelValue: otp.value,
@@ -655,10 +659,12 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
655
659
  step.value === "requestOtp" ? (openBlock(), createBlock(_sfc_main$c, {
656
660
  key: 0,
657
661
  "is-next-button": "",
662
+ form: "requestOtpForm",
658
663
  onSubmit: (_a = requestOtpFormRef.value) == null ? void 0 : _a.functions.submit
659
664
  }, null, 8, ["onSubmit"])) : createCommentVNode("", true),
660
665
  step.value === "changeEmail" ? (openBlock(), createBlock(_sfc_main$c, {
661
666
  key: 1,
667
+ form: "emailChangeForm",
662
668
  onSubmit: (_b = emailChangeFormRef.value) == null ? void 0 : _b.functions.submit
663
669
  }, null, 8, ["onSubmit"])) : createCommentVNode("", true)
664
670
  ];
@@ -675,6 +681,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
675
681
  createVNode(_sfc_main$b, {
676
682
  ref_key: "requestOtpFormRef",
677
683
  ref: requestOtpFormRef,
684
+ form: { id: "requestOtpForm" },
678
685
  input: __props.input,
679
686
  onSubmit: requestOtp
680
687
  }, null, 8, ["input"])
@@ -689,6 +696,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
689
696
  createVNode(_sfc_main$9, {
690
697
  ref_key: "emailChangeFormRef",
691
698
  ref: emailChangeFormRef,
699
+ form: { id: "emailChangeForm" },
692
700
  email: email.value,
693
701
  input: __props.input,
694
702
  onSubmit: changeEmail
@@ -779,7 +787,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
779
787
  ref_key: "formRef",
780
788
  ref: formRef,
781
789
  class: "q-gutter-md"
782
- }, __props.form), {
790
+ }, __props.form, {
791
+ onSubmit: _cache[5] || (_cache[5] = (e) => submit)
792
+ }), {
783
793
  default: withCtx(() => [
784
794
  createVNode(_sfc_main$a, mergeProps(__props.input, {
785
795
  modelValue: otp.value,
@@ -920,10 +930,12 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
920
930
  step.value === "requestOtp" ? (openBlock(), createBlock(_sfc_main$c, {
921
931
  key: 0,
922
932
  "is-next-button": "",
933
+ form: "requestOtpForm",
923
934
  onSubmit: (_a = requestOtpFormRef.value) == null ? void 0 : _a.functions.submit
924
935
  }, null, 8, ["onSubmit"])) : createCommentVNode("", true),
925
936
  step.value === "changePassword" ? (openBlock(), createBlock(_sfc_main$c, {
926
937
  key: 1,
938
+ form: "passwordChangeForm",
927
939
  onSubmit: (_b = passwordChangeFormRef.value) == null ? void 0 : _b.functions.submit
928
940
  }, null, 8, ["onSubmit"])) : createCommentVNode("", true)
929
941
  ];
@@ -940,6 +952,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
940
952
  createVNode(_sfc_main$b, {
941
953
  ref_key: "requestOtpFormRef",
942
954
  ref: requestOtpFormRef,
955
+ form: { id: "requestOtpForm" },
943
956
  input: __props.input,
944
957
  onSubmit: requestOtp
945
958
  }, null, 8, ["input"])
@@ -954,6 +967,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
954
967
  createVNode(_sfc_main$7, {
955
968
  ref_key: "passwordChangeFormRef",
956
969
  ref: passwordChangeFormRef,
970
+ form: { id: "passwordChangeForm" },
957
971
  email: email.value,
958
972
  input: __props.input,
959
973
  onSubmit: changePassword
@@ -1039,7 +1053,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
1039
1053
  ref_key: "formRef",
1040
1054
  ref: formRef,
1041
1055
  class: "q-gutter-md"
1042
- }, __props.form), {
1056
+ }, __props.form, {
1057
+ onSubmit: _cache[4] || (_cache[4] = (e) => submit)
1058
+ }), {
1043
1059
  default: withCtx(() => [
1044
1060
  !__props.useUsername ? (openBlock(), createBlock(_component_q_input, mergeProps({ key: 0 }, __props.input, {
1045
1061
  id: "email",
@@ -1261,7 +1277,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
1261
1277
  ref_key: "formRef",
1262
1278
  ref: formRef,
1263
1279
  class: "q-gutter-md"
1264
- }, __props.form), {
1280
+ }, __props.form, {
1281
+ onSubmit: _cache[6] || (_cache[6] = (e) => submit)
1282
+ }), {
1265
1283
  default: withCtx(() => [
1266
1284
  !__props.useUsername ? (openBlock(), createBlock(_component_q_input, mergeProps({ key: 0 }, __props.input, {
1267
1285
  id: "email",
package/dist/general.js CHANGED
@@ -1,5 +1,5 @@
1
- import { l as loadLang, u as useLang } from "./QSubmitButton.vue_vue_type_script_setup_true_lang.fe90878f.js";
2
- import { _ } from "./QSubmitButton.vue_vue_type_script_setup_true_lang.fe90878f.js";
1
+ import { l as loadLang, u as useLang } from "./QSubmitButton.vue_vue_type_script_setup_true_lang.1d0c06eb.js";
2
+ import { _ } from "./QSubmitButton.vue_vue_type_script_setup_true_lang.1d0c06eb.js";
3
3
  import { useQuasar, QCard, QCardSection, QCardActions } from "quasar";
4
4
  import { defineComponent, watch, ref, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, createElementVNode, normalizeProps, guardReactiveProps } from "vue";
5
5
  const _hoisted_1 = { class: "text-h6" };
@@ -74,8 +74,8 @@ declare const _default: {
74
74
  functions: import("vue").Ref<{}>;
75
75
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
76
76
  export default _default;
77
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
78
- declare type __VLS_TypePropsToRuntimeProps<T> = {
77
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
78
+ type __VLS_TypePropsToRuntimeProps<T> = {
79
79
  [K in keyof T]-?: {} extends Pick<T, K> ? {
80
80
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
81
81
  } : {
@@ -1,7 +1,7 @@
1
1
  import { QFormProps, QInputProps } from 'quasar';
2
2
  export interface Props {
3
3
  email: string;
4
- form?: QFormProps & HTMLFormElement;
4
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
5
5
  input?: Omit<QInputProps, 'id' | 'name' | 'modelValue' | 'label' | 'rules' | 'type' | 'lazy-rules' | 'autofocus' | ('label' & {
6
6
  style?: Partial<CSSStyleDeclaration>;
7
7
  })>;
@@ -136,8 +136,8 @@ declare const _default: {
136
136
  };
137
137
  });
138
138
  export default _default;
139
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
140
- declare type __VLS_TypePropsToRuntimeProps<T> = {
139
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
140
+ type __VLS_TypePropsToRuntimeProps<T> = {
141
141
  [K in keyof T]-?: {} extends Pick<T, K> ? {
142
142
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
143
143
  } : {
@@ -157,8 +157,8 @@ declare const _default: {
157
157
  }) => void;
158
158
  }, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
159
159
  export default _default;
160
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
161
- declare type __VLS_TypePropsToRuntimeProps<T> = {
160
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
161
+ type __VLS_TypePropsToRuntimeProps<T> = {
162
162
  [K in keyof T]-?: {} extends Pick<T, K> ? {
163
163
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
164
164
  } : {
@@ -58,8 +58,8 @@ declare const _default: {
58
58
  };
59
59
  });
60
60
  export default _default;
61
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
62
- declare type __VLS_TypePropsToRuntimeProps<T> = {
61
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
62
+ type __VLS_TypePropsToRuntimeProps<T> = {
63
63
  [K in keyof T]-?: {} extends Pick<T, K> ? {
64
64
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
65
65
  } : {
@@ -2,7 +2,7 @@ import { QFormProps, QInputProps } from 'quasar';
2
2
  export interface Props {
3
3
  useUsername?: boolean;
4
4
  passwordForgotUrl?: string;
5
- form?: QFormProps & HTMLFormElement;
5
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
6
6
  input?: Omit<QInputProps, 'id' | 'name' | 'modelValue' | 'label' | 'rules' | 'type' | 'lazy-rules' | 'autofocus' | ('label' & {
7
7
  style?: Partial<CSSStyleDeclaration>;
8
8
  })>;
@@ -146,8 +146,8 @@ declare const _default: {
146
146
  };
147
147
  });
148
148
  export default _default;
149
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
150
- declare type __VLS_TypePropsToRuntimeProps<T> = {
149
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
150
+ type __VLS_TypePropsToRuntimeProps<T> = {
151
151
  [K in keyof T]-?: {} extends Pick<T, K> ? {
152
152
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
153
153
  } : {
@@ -58,8 +58,8 @@ declare const _default: {
58
58
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
59
59
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
60
60
  export default _default;
61
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
62
- declare type __VLS_TypePropsToRuntimeProps<T> = {
61
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
62
+ type __VLS_TypePropsToRuntimeProps<T> = {
63
63
  [K in keyof T]-?: {} extends Pick<T, K> ? {
64
64
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
65
65
  } : {
@@ -2,7 +2,7 @@ import { QFormProps, QInputProps } from 'quasar';
2
2
  export interface Props {
3
3
  email: string;
4
4
  minimumPasswordLength?: number;
5
- form?: QFormProps & HTMLFormElement;
5
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
6
6
  input?: Omit<QInputProps, 'id' | 'name' | 'modelValue' | 'label' | 'rules' | 'type' | 'lazy-rules' | 'autofocus' | ('label' & {
7
7
  style?: Partial<CSSStyleDeclaration>;
8
8
  })>;
@@ -13,8 +13,8 @@ declare const _default: {
13
13
  $data: {};
14
14
  $props: Partial<{
15
15
  minimumPasswordLength: number;
16
- form: QFormProps & HTMLFormElement;
17
- input: Omit<QInputProps, "label" | "name" | "type" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
16
+ form: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
17
+ input: Omit<QInputProps, "name" | "type" | "label" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
18
18
  style?: Partial<CSSStyleDeclaration> | undefined;
19
19
  })>;
20
20
  }> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
@@ -77,8 +77,8 @@ declare const _default: {
77
77
  }) => void;
78
78
  }, string, {
79
79
  minimumPasswordLength: number;
80
- form: QFormProps & HTMLFormElement;
81
- input: Omit<QInputProps, "label" | "name" | "type" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
80
+ form: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
81
+ input: Omit<QInputProps, "name" | "type" | "label" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
82
82
  style?: Partial<CSSStyleDeclaration> | undefined;
83
83
  })>;
84
84
  }, {}, string> & {
@@ -156,8 +156,8 @@ declare const _default: {
156
156
  }) => void;
157
157
  }, string, {
158
158
  minimumPasswordLength: number;
159
- form: QFormProps & HTMLFormElement;
160
- input: Omit<QInputProps, "label" | "name" | "type" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
159
+ form: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
160
+ input: Omit<QInputProps, "name" | "type" | "label" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
161
161
  style?: Partial<CSSStyleDeclaration> | undefined;
162
162
  })>;
163
163
  }, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
@@ -171,8 +171,8 @@ declare const _default: {
171
171
  };
172
172
  });
173
173
  export default _default;
174
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
175
- declare type __VLS_TypePropsToRuntimeProps<T> = {
174
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
175
+ type __VLS_TypePropsToRuntimeProps<T> = {
176
176
  [K in keyof T]-?: {} extends Pick<T, K> ? {
177
177
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
178
178
  } : {
@@ -180,7 +180,7 @@ declare type __VLS_TypePropsToRuntimeProps<T> = {
180
180
  required: true;
181
181
  };
182
182
  };
183
- declare type __VLS_WithDefaults<P, D> = {
183
+ type __VLS_WithDefaults<P, D> = {
184
184
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
185
185
  default: D[K];
186
186
  } : P[K];
@@ -157,8 +157,8 @@ declare const _default: {
157
157
  }) => void;
158
158
  }, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
159
159
  export default _default;
160
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
161
- declare type __VLS_TypePropsToRuntimeProps<T> = {
160
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
161
+ type __VLS_TypePropsToRuntimeProps<T> = {
162
162
  [K in keyof T]-?: {} extends Pick<T, K> ? {
163
163
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
164
164
  } : {
@@ -7,7 +7,7 @@ export interface Props {
7
7
  rules?: ((val: string) => boolean)[];
8
8
  }[];
9
9
  minimumPasswordLength?: number;
10
- form?: QFormProps & HTMLFormElement;
10
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
11
11
  input?: Omit<QInputProps, 'id' | 'name' | 'modelValue' | 'label' | 'rules' | 'type' | 'lazy-rules' | 'autofocus' | ('label' & {
12
12
  style?: Partial<CSSStyleDeclaration>;
13
13
  })>;
@@ -18,8 +18,8 @@ declare const _default: {
18
18
  $data: {};
19
19
  $props: Partial<{
20
20
  minimumPasswordLength: number;
21
- form: QFormProps & HTMLFormElement;
22
- input: Omit<QInputProps, "label" | "name" | "type" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
21
+ form: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
22
+ input: Omit<QInputProps, "name" | "type" | "label" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
23
23
  style?: Partial<CSSStyleDeclaration> | undefined;
24
24
  })>;
25
25
  extraFields: {
@@ -97,8 +97,8 @@ declare const _default: {
97
97
  }) => void;
98
98
  }, string, {
99
99
  minimumPasswordLength: number;
100
- form: QFormProps & HTMLFormElement;
101
- input: Omit<QInputProps, "label" | "name" | "type" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
100
+ form: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
101
+ input: Omit<QInputProps, "name" | "type" | "label" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
102
102
  style?: Partial<CSSStyleDeclaration> | undefined;
103
103
  })>;
104
104
  extraFields: {
@@ -194,8 +194,8 @@ declare const _default: {
194
194
  }) => void;
195
195
  }, string, {
196
196
  minimumPasswordLength: number;
197
- form: QFormProps & HTMLFormElement;
198
- input: Omit<QInputProps, "label" | "name" | "type" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
197
+ form: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
198
+ input: Omit<QInputProps, "name" | "type" | "label" | "modelValue" | "id" | "lazy-rules" | "rules" | "autofocus" | ("label" & {
199
199
  style?: Partial<CSSStyleDeclaration> | undefined;
200
200
  })>;
201
201
  extraFields: {
@@ -214,8 +214,8 @@ declare const _default: {
214
214
  };
215
215
  });
216
216
  export default _default;
217
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
218
- declare type __VLS_TypePropsToRuntimeProps<T> = {
217
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
218
+ type __VLS_TypePropsToRuntimeProps<T> = {
219
219
  [K in keyof T]-?: {} extends Pick<T, K> ? {
220
220
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
221
221
  } : {
@@ -223,7 +223,7 @@ declare type __VLS_TypePropsToRuntimeProps<T> = {
223
223
  required: true;
224
224
  };
225
225
  };
226
- declare type __VLS_WithDefaults<P, D> = {
226
+ type __VLS_WithDefaults<P, D> = {
227
227
  [K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
228
228
  default: D[K];
229
229
  } : P[K];
@@ -1,6 +1,6 @@
1
1
  import { QFormProps, QInputProps } from 'quasar';
2
2
  export interface Props {
3
- form?: QFormProps & HTMLFormElement;
3
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>;
4
4
  input?: Omit<QInputProps, 'id' | 'name' | 'modelValue' | 'label' | 'rules' | 'type' | 'lazy-rules' | 'autofocus' | ('label' & {
5
5
  style?: Partial<CSSStyleDeclaration>;
6
6
  })>;
@@ -121,8 +121,8 @@ declare const _default: {
121
121
  };
122
122
  });
123
123
  export default _default;
124
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
125
- declare type __VLS_TypePropsToRuntimeProps<T> = {
124
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
125
+ type __VLS_TypePropsToRuntimeProps<T> = {
126
126
  [K in keyof T]-?: {} extends Pick<T, K> ? {
127
127
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
128
128
  } : {
@@ -71,8 +71,8 @@ declare const _default: {
71
71
  };
72
72
  });
73
73
  export default _default;
74
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
75
- declare type __VLS_TypePropsToRuntimeProps<T> = {
74
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
75
+ type __VLS_TypePropsToRuntimeProps<T> = {
76
76
  [K in keyof T]-?: {} extends Pick<T, K> ? {
77
77
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
78
78
  } : {
@@ -66,8 +66,8 @@ declare const _default: {
66
66
  verified: () => void;
67
67
  }, string, {}, {}, string> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
68
68
  export default _default;
69
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
70
- declare type __VLS_TypePropsToRuntimeProps<T> = {
69
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
70
+ type __VLS_TypePropsToRuntimeProps<T> = {
71
71
  [K in keyof T]-?: {} extends Pick<T, K> ? {
72
72
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
73
73
  } : {
@@ -63,8 +63,8 @@ declare const _default: {
63
63
  };
64
64
  });
65
65
  export default _default;
66
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
67
- declare type __VLS_TypePropsToRuntimeProps<T> = {
66
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
67
+ type __VLS_TypePropsToRuntimeProps<T> = {
68
68
  [K in keyof T]-?: {} extends Pick<T, K> ? {
69
69
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
70
70
  } : {
@@ -58,8 +58,8 @@ declare const _default: {
58
58
  };
59
59
  });
60
60
  export default _default;
61
- declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
62
- declare type __VLS_TypePropsToRuntimeProps<T> = {
61
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
62
+ type __VLS_TypePropsToRuntimeProps<T> = {
63
63
  [K in keyof T]-?: {} extends Pick<T, K> ? {
64
64
  type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
65
65
  } : {
@@ -1,2 +1 @@
1
- export * from './authentication/index';
2
1
  export * from './general/index';
@@ -0,0 +1,2 @@
1
+ export declare const FlagIcon: (locale: string) => string;
2
+ export declare const Icon: (icon: string) => string;
@@ -1,2 +1,4 @@
1
1
  import type { Plugin } from 'vite';
2
- export default function (): Promise<Plugin>;
2
+ export default function ({ buildFromSrc }?: {
3
+ buildFromSrc?: boolean;
4
+ }): Promise<Plugin>;
@@ -0,0 +1,2 @@
1
+ export declare const FlagIcon: (locale: string) => string;
2
+ export declare const Icon: (icon: string) => string;
@@ -0,0 +1,2 @@
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,2 +1,4 @@
1
1
  import type { Plugin } from 'vite';
2
- export default function (): Promise<Plugin>;
2
+ export default function ({ buildFromSrc }?: {
3
+ buildFromSrc?: boolean;
4
+ }): Promise<Plugin>;
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
13
13
  function verb(n) { return function (v) { return step([n, v]); }; }
14
14
  function step(op) {
15
15
  if (f) throw new TypeError("Generator is already executing.");
16
- while (_) try {
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
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
18
  if (y = 0, t) op = [op[0] & 2, t.value];
19
19
  switch (op[0]) {
@@ -34,33 +34,48 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
34
34
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
35
  }
36
36
  };
37
- export default function () {
37
+ import { promises } from 'fs';
38
+ var readFile = promises.readFile;
39
+ export default function (_a) {
40
+ var _b = _a === void 0 ? {} : _a, buildFromSrc = _b.buildFromSrc;
38
41
  return __awaiter(this, void 0, void 0, function () {
39
- return __generator(this, function (_a) {
40
- return [2 /*return*/, {
41
- name: '@simsustech/quasar-components-plugin',
42
- config: function (config, _a) {
43
- var mode = _a.mode;
44
- if (mode === 'development') {
45
- return {
46
- resolve: {
47
- alias: [
48
- {
49
- find: '@simsustech/quasar-components/flags',
50
- replacement: new URL('../src/ui/flags/index.ts', import.meta.url).pathname
51
- },
52
- {
53
- find: '@simsustech/quasar-components',
54
- replacement: new URL('../src/ui/index.ts', import.meta.url)
55
- .pathname
42
+ var pkgJson, _c, _d, exports, name;
43
+ return __generator(this, function (_e) {
44
+ switch (_e.label) {
45
+ case 0:
46
+ _d = (_c = JSON).parse;
47
+ return [4 /*yield*/, readFile(new URL('../package.json', import.meta.url).pathname, 'utf-8')];
48
+ case 1:
49
+ pkgJson = _d.apply(_c, [_e.sent()]);
50
+ exports = pkgJson.exports;
51
+ name = pkgJson.name;
52
+ return [2 /*return*/, {
53
+ name: "".concat(name, "-plugin"),
54
+ config: function (config, _a) {
55
+ var mode = _a.mode;
56
+ if (mode === 'development' || buildFromSrc) {
57
+ var alias = Object.entries(exports)
58
+ .map(function (_a) {
59
+ var key = _a[0], val = _a[1];
60
+ return {
61
+ find: name + key.slice(1),
62
+ replacement: new URL('.' + val.src, import.meta.url).pathname
63
+ };
64
+ })
65
+ .sort(function (a, b) {
66
+ return (b.find.match(/\//g) || []).length -
67
+ (a.find.match(/\//g) || []).length;
68
+ });
69
+ return {
70
+ resolve: {
71
+ alias: alias
56
72
  }
57
- ]
73
+ };
58
74
  }
59
- };
60
- }
61
- return {};
62
- }
63
- }];
75
+ return {};
76
+ }
77
+ }];
78
+ }
64
79
  });
65
80
  });
66
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simsustech/quasar-components",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "author": "Stefan van Herwijnen",
5
5
  "description": "High level components for Quasar Framework",
6
6
  "license": "MIT",
@@ -14,21 +14,24 @@
14
14
  },
15
15
  "./authentication": {
16
16
  "types": "./dist/types/ui/authentication/index.d.ts",
17
- "import": "./dist/authentication.js"
17
+ "import": "./dist/authentication.js",
18
+ "src": "./src/ui/authentication/index.ts"
18
19
  },
19
20
  "./flags": {
20
21
  "types": "./dist/types/ui/flags/index.d.ts",
21
- "import": "./dist/flags.js"
22
+ "import": "./dist/flags.js",
23
+ "src": "./src/ui/flags/index.ts"
22
24
  },
23
25
  "./icons": {
24
26
  "types": "./dist/types/ui/icons/index.d.ts",
25
- "import": "./dist/icons.js"
27
+ "import": "./dist/icons.js",
28
+ "src": "./src/ui/icons/index.ts"
26
29
  },
27
30
  "./css": {
28
31
  "import": "./dist/style.css"
29
32
  },
30
33
  "./vite-plugin": {
31
- "types": "./dist/vite-plugin.d.ts",
34
+ "types": "./dist/types/vite-plugin.d.ts",
32
35
  "import": "./dist/vite-plugin.js"
33
36
  }
34
37
  },
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <q-form ref="formRef" class="q-gutter-md" v-bind="form">
2
+ <q-form
3
+ ref="formRef"
4
+ class="q-gutter-md"
5
+ v-bind="form"
6
+ @submit="(e) => submit"
7
+ >
3
8
  <otp-input v-bind="input" v-model="otp" />
4
9
  <q-input
5
10
  v-bind="input"
@@ -41,7 +46,7 @@ import OtpInput from './OtpInput.vue'
41
46
 
42
47
  export interface Props {
43
48
  email: string
44
- form?: QFormProps & HTMLFormElement
49
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>
45
50
  input?: Omit<
46
51
  QInputProps,
47
52
  | 'id'
@@ -3,6 +3,7 @@
3
3
  <q-step name="requestOtp" :title="requestOtpHeader">
4
4
  <request-otp-form
5
5
  ref="requestOtpFormRef"
6
+ :form="{ id: 'requestOtpForm' }"
6
7
  :input="input"
7
8
  @submit="requestOtp"
8
9
  ></request-otp-form>
@@ -11,6 +12,7 @@
11
12
  <q-step name="changeEmail" :title="emailChangeHeader">
12
13
  <email-change-form
13
14
  ref="emailChangeFormRef"
15
+ :form="{ id: 'emailChangeForm' }"
14
16
  :email="email"
15
17
  :input="input"
16
18
  @submit="changeEmail"
@@ -22,10 +24,12 @@
22
24
  <q-submit-button
23
25
  v-if="step === 'requestOtp'"
24
26
  is-next-button
27
+ form="requestOtpForm"
25
28
  @submit="requestOtpFormRef?.functions.submit"
26
29
  ></q-submit-button>
27
30
  <q-submit-button
28
31
  v-if="step === 'changeEmail'"
32
+ form="emailChangeForm"
29
33
  @submit="emailChangeFormRef?.functions.submit"
30
34
  ></q-submit-button>
31
35
  </q-stepper-navigation>
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <q-form ref="formRef" class="q-gutter-md" v-bind="form">
2
+ <q-form
3
+ ref="formRef"
4
+ class="q-gutter-md"
5
+ v-bind="form"
6
+ @submit="(e) => submit"
7
+ >
3
8
  <q-input
4
9
  v-if="!useUsername"
5
10
  v-bind="input"
@@ -71,7 +76,7 @@ import QSubmitButton from '../general/QSubmitButton.vue'
71
76
  export interface Props {
72
77
  useUsername?: boolean
73
78
  passwordForgotUrl?: string
74
- form?: QFormProps & HTMLFormElement
79
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>
75
80
  input?: Omit<
76
81
  QInputProps,
77
82
  | 'id'
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <q-form ref="formRef" class="q-gutter-md" v-bind="form">
2
+ <q-form
3
+ ref="formRef"
4
+ class="q-gutter-md"
5
+ v-bind="form"
6
+ @submit="(e) => submit"
7
+ >
3
8
  <otp-input v-bind="input" v-model="otp" />
4
9
  <q-input
5
10
  v-bind="input"
@@ -61,7 +66,7 @@ import OtpInput from './OtpInput.vue'
61
66
  export interface Props {
62
67
  email: string
63
68
  minimumPasswordLength?: number
64
- form?: QFormProps & HTMLFormElement
69
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>
65
70
  input?: Omit<
66
71
  QInputProps,
67
72
  | 'id'
@@ -3,6 +3,7 @@
3
3
  <q-step name="requestOtp" :title="requestOtpHeader">
4
4
  <request-otp-form
5
5
  ref="requestOtpFormRef"
6
+ :form="{ id: 'requestOtpForm' }"
6
7
  :input="input"
7
8
  @submit="requestOtp"
8
9
  ></request-otp-form>
@@ -11,6 +12,7 @@
11
12
  <q-step name="changePassword" :title="passwordChangeHeader">
12
13
  <password-change-form
13
14
  ref="passwordChangeFormRef"
15
+ :form="{ id: 'passwordChangeForm' }"
14
16
  :email="email"
15
17
  :input="input"
16
18
  @submit="changePassword"
@@ -22,10 +24,12 @@
22
24
  <q-submit-button
23
25
  v-if="step === 'requestOtp'"
24
26
  is-next-button
27
+ form="requestOtpForm"
25
28
  @submit="requestOtpFormRef?.functions.submit"
26
29
  ></q-submit-button>
27
30
  <q-submit-button
28
31
  v-if="step === 'changePassword'"
32
+ form="passwordChangeForm"
29
33
  @submit="passwordChangeFormRef?.functions.submit"
30
34
  ></q-submit-button>
31
35
  </q-stepper-navigation>
@@ -1,5 +1,10 @@
1
1
  <template>
2
- <q-form ref="formRef" class="q-gutter-md" v-bind="form">
2
+ <q-form
3
+ ref="formRef"
4
+ class="q-gutter-md"
5
+ v-bind="form"
6
+ @submit="(e) => submit"
7
+ >
3
8
  <q-input
4
9
  v-if="!useUsername"
5
10
  v-bind="input"
@@ -97,7 +102,7 @@ export interface Props {
97
102
  rules?: ((val: string) => boolean)[]
98
103
  }[]
99
104
  minimumPasswordLength?: number
100
- form?: QFormProps & HTMLFormElement
105
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>
101
106
  input?: Omit<
102
107
  QInputProps,
103
108
  | 'id'
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <q-form ref="formRef" v-bind="form">
2
+ <q-form ref="formRef" v-bind="form" @submit="(e) => submit">
3
3
  <q-input
4
4
  v-bind="input"
5
5
  id="email"
@@ -29,7 +29,7 @@ import isEmail from 'validator/es/lib/isEmail.js'
29
29
  import QSubmitButton from '../general/QSubmitButton.vue'
30
30
 
31
31
  export interface Props {
32
- form?: QFormProps & HTMLFormElement
32
+ form?: QFormProps & Partial<HTMLFormElement> & Partial<HTMLDivElement>
33
33
  input?: Omit<
34
34
  QInputProps,
35
35
  | 'id'
@@ -4,7 +4,7 @@
4
4
  :label="isNextButton ? lang.next : lang.submit"
5
5
  color="primary"
6
6
  :loading="loading || loadingInternal"
7
- :type="useForm ? 'submit' : undefined"
7
+ type="submit"
8
8
  @click="submit"
9
9
  />
10
10
  </template>
package/src/ui/index.ts CHANGED
@@ -1,2 +1 @@
1
- export * from './authentication/index'
2
1
  export * from './general/index'
@@ -0,0 +1,70 @@
1
+ export const FlagIcon = (locale: string) => `
2
+ import { computed, ref, watch, h } from 'vue'
3
+ import { QuasarLanguageCodes, useQuasar, QIcon } from 'quasar'
4
+ import { useLang, loadLang } from '${
5
+ new URL(`../src/ui/flags/lang`, import.meta.url).pathname
6
+ }'
7
+ import icon from '${
8
+ new URL(`../src/ui/flags/assets/${locale}.svg`, import.meta.url).pathname
9
+ }'
10
+ export default {
11
+ setup(props, context) {
12
+ const $q = useQuasar()
13
+ const lang = useLang()
14
+ if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
15
+ watch($q.lang, (val) => {
16
+ loadLang($q.lang.isoName)
17
+ })
18
+
19
+ const country = computed(
20
+ () => lang.value.countries['${locale}']
21
+ )
22
+ // @ts-ignore
23
+ const language = computed(() => lang.value.languages['${locale}'])
24
+ const variables = ref({
25
+ country,
26
+ language
27
+ // header: lang.value.some.nested.prop
28
+ })
29
+ const functions = ref({
30
+ // submit
31
+ })
32
+
33
+ context.expose({
34
+ variables,
35
+ functions
36
+ })
37
+
38
+ // return the render function
39
+ return () => h(QIcon, { name: \`img:\${icon}\` })
40
+ }}
41
+ `
42
+
43
+ export const Icon = (icon: string) => `
44
+ import { computed, ref, watch, h } from 'vue'
45
+ import { QuasarLanguageCodes, useQuasar, QIcon } from 'quasar'
46
+ import icon from '${
47
+ new URL(`../src/ui/icons/assets/${icon}.svg`, import.meta.url).pathname
48
+ }'
49
+ import icons from '${
50
+ new URL(`../src/ui/icons/icons.ts`, import.meta.url).pathname
51
+ }'
52
+ export default {
53
+ setup(props, context) {
54
+ const $q = useQuasar()
55
+
56
+ const variables = ref(icons['${icon}'])
57
+
58
+ const functions = ref({
59
+ // submit
60
+ })
61
+
62
+ context.expose({
63
+ variables,
64
+ functions
65
+ })
66
+
67
+ // return the render function
68
+ return () => h(QIcon, { name: \`img:\${icon}\` })
69
+ }}
70
+ `
@@ -1,29 +1,52 @@
1
1
  import type { Plugin } from 'vite'
2
+ import { promises } from 'fs'
3
+ const { readFile } = promises
4
+
5
+ export default async function ({
6
+ buildFromSrc
7
+ }: {
8
+ buildFromSrc?: boolean
9
+ } = {}): Promise<Plugin> {
10
+ const pkgJson = JSON.parse(
11
+ await readFile(
12
+ new URL('../package.json', import.meta.url).pathname,
13
+ 'utf-8'
14
+ )
15
+ )
16
+ const exports = pkgJson.exports as Record<
17
+ string,
18
+ {
19
+ types: string
20
+ import: string
21
+ src: string
22
+ }
23
+ >[]
24
+ const name = pkgJson.name
2
25
 
3
- export default async function (): Promise<Plugin> {
4
26
  return {
5
- name: '@simsustech/quasar-components-plugin',
27
+ name: `${name}-plugin`,
6
28
  config(config, { mode }) {
7
- if (mode === 'development') {
29
+ if (mode === 'development' || buildFromSrc) {
30
+ const alias = Object.entries(exports)
31
+ .map(([key, val]) => {
32
+ return {
33
+ find: name + key.slice(1),
34
+ replacement: new URL('.' + val.src, import.meta.url).pathname
35
+ }
36
+ })
37
+ .sort(
38
+ (a, b) =>
39
+ (b.find.match(/\//g) || []).length -
40
+ (a.find.match(/\//g) || []).length
41
+ )
42
+
8
43
  return {
9
44
  resolve: {
10
- alias: [
11
- {
12
- find: '@simsustech/quasar-components/flags',
13
- replacement: new URL(
14
- '../src/ui/flags/index.ts',
15
- import.meta.url
16
- ).pathname
17
- },
18
- {
19
- find: '@simsustech/quasar-components',
20
- replacement: new URL('../src/ui/index.ts', import.meta.url)
21
- .pathname
22
- }
23
- ]
45
+ alias
24
46
  }
25
47
  }
26
48
  }
49
+
27
50
  return {}
28
51
  }
29
52
  }
@@ -3,5 +3,5 @@
3
3
  "rootDir": "src/"
4
4
  },
5
5
  "extends": "./tsconfig.node.json",
6
- "include": ["./src/vite-plugin.ts"]
6
+ "include": ["./src/vite-plugin.ts", "./src/virtualModules.ts"]
7
7
  }
@@ -6,5 +6,5 @@
6
6
  "outDir": "./dist",
7
7
  "declaration": true
8
8
  },
9
- "include": ["vite.config.ts"]
9
+ "include": ["vite.config.ts", "src/virtualModules.ts"]
10
10
  }
package/vite.config.ts CHANGED
@@ -2,77 +2,77 @@ import { defineConfig } from 'vite'
2
2
  import vue from '@vitejs/plugin-vue'
3
3
  import Components from 'unplugin-vue-components/vite'
4
4
  import { QuasarResolver } from 'unplugin-vue-components/resolvers'
5
+ import { FlagIcon, Icon } from './src/virtualModules.js'
6
+ // export const FlagIcon = (locale) => `
7
+ // import { computed, ref, watch, h } from 'vue'
8
+ // import { QuasarLanguageCodes, useQuasar, QIcon } from 'quasar'
9
+ // import { useLang, loadLang } from '${
10
+ // new URL(`./src/ui/flags/lang`, import.meta.url).pathname
11
+ // }'
12
+ // import icon from '${
13
+ // new URL(`./src/ui/flags/assets/${locale}.svg`, import.meta.url).pathname
14
+ // }'
15
+ // export default {
16
+ // setup(props, context) {
17
+ // const $q = useQuasar()
18
+ // const lang = useLang()
19
+ // if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
20
+ // watch($q.lang, (val) => {
21
+ // loadLang($q.lang.isoName)
22
+ // })
5
23
 
6
- const FlagIcon = (locale) => `
7
- import { computed, ref, watch, h } from 'vue'
8
- import { QuasarLanguageCodes, useQuasar, QIcon } from 'quasar'
9
- import { useLang, loadLang } from '${
10
- new URL(`./src/ui/flags/lang`, import.meta.url).pathname
11
- }'
12
- import icon from '${
13
- new URL(`./src/ui/flags/assets/${locale}.svg`, import.meta.url).pathname
14
- }'
15
- export default {
16
- setup(props, context) {
17
- const $q = useQuasar()
18
- const lang = useLang()
19
- if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
20
- watch($q.lang, (val) => {
21
- loadLang($q.lang.isoName)
22
- })
23
-
24
- const country = computed(
25
- () => lang.value.countries['${locale}']
26
- )
27
- // @ts-ignore
28
- const language = computed(() => lang.value.languages['${locale}'])
29
- const variables = ref({
30
- country,
31
- language
32
- // header: lang.value.some.nested.prop
33
- })
34
- const functions = ref({
35
- // submit
36
- })
24
+ // const country = computed(
25
+ // () => lang.value.countries['${locale}']
26
+ // )
27
+ // // @ts-ignore
28
+ // const language = computed(() => lang.value.languages['${locale}'])
29
+ // const variables = ref({
30
+ // country,
31
+ // language
32
+ // // header: lang.value.some.nested.prop
33
+ // })
34
+ // const functions = ref({
35
+ // // submit
36
+ // })
37
37
 
38
- context.expose({
39
- variables,
40
- functions
41
- })
38
+ // context.expose({
39
+ // variables,
40
+ // functions
41
+ // })
42
42
 
43
- // return the render function
44
- return () => h(QIcon, { name: \`img:\${icon}\` })
45
- }}
46
- `
43
+ // // return the render function
44
+ // return () => h(QIcon, { name: \`img:\${icon}\` })
45
+ // }}
46
+ // `
47
47
 
48
- const Icon = (icon) => `
49
- import { computed, ref, watch, h } from 'vue'
50
- import { QuasarLanguageCodes, useQuasar, QIcon } from 'quasar'
51
- import icon from '${
52
- new URL(`./src/ui/icons/assets/${icon}.svg`, import.meta.url).pathname
53
- }'
54
- import icons from '${
55
- new URL(`./src/ui/icons/icons.ts`, import.meta.url).pathname
56
- }'
57
- export default {
58
- setup(props, context) {
59
- const $q = useQuasar()
48
+ // export const Icon = (icon) => `
49
+ // import { computed, ref, watch, h } from 'vue'
50
+ // import { QuasarLanguageCodes, useQuasar, QIcon } from 'quasar'
51
+ // import icon from '${
52
+ // new URL(`./src/ui/icons/assets/${icon}.svg`, import.meta.url).pathname
53
+ // }'
54
+ // import icons from '${
55
+ // new URL(`./src/ui/icons/icons.ts`, import.meta.url).pathname
56
+ // }'
57
+ // export default {
58
+ // setup(props, context) {
59
+ // const $q = useQuasar()
60
60
 
61
- const variables = ref(icons['${icon}'])
61
+ // const variables = ref(icons['${icon}'])
62
62
 
63
- const functions = ref({
64
- // submit
65
- })
63
+ // const functions = ref({
64
+ // // submit
65
+ // })
66
66
 
67
- context.expose({
68
- variables,
69
- functions
70
- })
67
+ // context.expose({
68
+ // variables,
69
+ // functions
70
+ // })
71
71
 
72
- // return the render function
73
- return () => h(QIcon, { name: \`img:\${icon}\` })
74
- }}
75
- `
72
+ // // return the render function
73
+ // return () => h(QIcon, { name: \`img:\${icon}\` })
74
+ // }}
75
+ // `
76
76
 
77
77
  export default defineConfig(async ({ command, mode }) => ({
78
78
  plugins: [