@simsustech/quasar-components 0.4.5 → 0.4.6

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @simsustech/quasar-components
2
2
 
3
+ ## 0.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 255d957: fix(components): make LoginButton extend QSubmitButton
8
+
3
9
  ## 0.4.5
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import { useQuasar, QBtn } from "quasar";
2
- import { ref, defineComponent, useAttrs, watch, openBlock, createBlock, mergeProps, unref } from "vue";
2
+ import { ref, defineComponent, useAttrs, watch, openBlock, createBlock, mergeProps, unref, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue";
3
3
  const lang$1 = {
4
4
  isoName: "en-US",
5
5
  submit: "Submit",
@@ -85,12 +85,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
85
85
  return (_ctx, _cache) => {
86
86
  const _component_q_btn = QBtn;
87
87
  return openBlock(), createBlock(_component_q_btn, mergeProps(unref(attrs), {
88
- label: __props.isNextButton ? unref(lang2).next : unref(lang2).submit,
89
88
  color: __props.color,
90
89
  loading: __props.loading || unref(loadingInternal),
91
90
  type: "submit",
92
91
  onClick: submit
93
- }), null, 16, ["label", "color", "loading"]);
92
+ }), {
93
+ default: withCtx(() => [
94
+ renderSlot(_ctx.$slots, "default", {}, () => [
95
+ createTextVNode(toDisplayString(__props.isNextButton ? unref(lang2).next : unref(lang2).submit), 1)
96
+ ])
97
+ ]),
98
+ _: 3
99
+ }, 16, ["color", "loading"]);
94
100
  };
95
101
  }
96
102
  });
@@ -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-17dddb76.js";
3
+ import { _ as _sfc_main$c } from "./QSubmitButton.vue_vue_type_script_setup_true_lang-62670a79.js";
4
4
  const lang$1 = {
5
5
  isoName: "en-US",
6
6
  myAccount: "Account",
@@ -1643,7 +1643,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1643
1643
  props: {
1644
1644
  withNetwork: {}
1645
1645
  },
1646
- setup(__props, { expose: __expose }) {
1646
+ setup(__props) {
1647
1647
  const $q = useQuasar();
1648
1648
  const lang2 = useLang();
1649
1649
  if (lang2.value.isoName !== $q.lang.isoName)
@@ -1651,19 +1651,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
1651
1651
  watch($q.lang, (val) => {
1652
1652
  loadLang($q.lang.isoName);
1653
1653
  });
1654
- const variables = ref({
1655
- // header: lang.value.some.nested.prop
1656
- });
1657
- const functions = ref({
1658
- // submit
1659
- });
1660
- __expose({
1661
- variables,
1662
- functions
1663
- });
1664
1654
  return (_ctx, _cache) => {
1665
- const _component_q_btn = QBtn;
1666
- return openBlock(), createBlock(_component_q_btn, null, {
1655
+ return openBlock(), createBlock(_sfc_main$c, null, {
1667
1656
  default: withCtx(() => [
1668
1657
  renderSlot(_ctx.$slots, "icon"),
1669
1658
  _ctx.withNetwork ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(unref(lang2).login.loginWith) + " " + toDisplayString(_ctx.withNetwork), 1)) : (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(unref(lang2).login.login), 1))
package/dist/form.js CHANGED
@@ -347,7 +347,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
347
347
  });
348
348
  const { modelValue } = toRefs(props);
349
349
  const update = (val) => {
350
- if (typeof val === "string")
350
+ if (typeof val === "string" || val === null)
351
351
  emit("update:modelValue", val);
352
352
  };
353
353
  watch(
package/dist/general.js CHANGED
@@ -1,4 +1,4 @@
1
- import { l as loadLang, u as useLang, _ as _sfc_main$4 } from "./QSubmitButton.vue_vue_type_script_setup_true_lang-17dddb76.js";
1
+ import { l as loadLang, u as useLang, _ as _sfc_main$4 } from "./QSubmitButton.vue_vue_type_script_setup_true_lang-62670a79.js";
2
2
  import { useQuasar, QCard, QCardSection, QCardActions, QDialog, QBtn, QToolbarTitle, QToolbar, QHeader, QPage, QPageContainer, QLayout, QSpace, QPageSticky, QSelect, QItemSection, QItemLabel, QItem } from "quasar";
3
3
  import { defineComponent, watch, ref, openBlock, createBlock, unref, withCtx, renderSlot, createVNode, createElementVNode, normalizeProps, guardReactiveProps, normalizeClass, createCommentVNode, toRefs, useAttrs, computed, mergeProps, createTextVNode, toDisplayString } from "vue";
4
4
  import { enUs, nl } from "./flags.js";
@@ -1,10 +1,7 @@
1
1
  export interface Props {
2
2
  withNetwork?: string;
3
3
  }
4
- declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {
5
- variables: import("vue").Ref<{}>;
6
- functions: import("vue").Ref<{}>;
7
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
4
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<Props>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>>, {}, {}>, {
8
5
  icon?(_: {}): any;
9
6
  }>;
10
7
  export default _default;
@@ -4,7 +4,7 @@ export interface Props {
4
4
  isNextButton?: boolean;
5
5
  color?: string;
6
6
  }
7
- declare const _default: import("vue").DefineComponent<{
7
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
8
8
  loading: {
9
9
  type: BooleanConstructor;
10
10
  default: undefined;
@@ -49,5 +49,12 @@ declare const _default: import("vue").DefineComponent<{
49
49
  loading: boolean;
50
50
  useForm: boolean;
51
51
  isNextButton: boolean;
52
- }, {}>;
52
+ }, {}>, {
53
+ default?(_: {}): any;
54
+ }>;
53
55
  export default _default;
56
+ type __VLS_WithTemplateSlots<T, S> = T & {
57
+ new (): {
58
+ $slots: S;
59
+ };
60
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simsustech/quasar-components",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "author": "Stefan van Herwijnen",
5
5
  "description": "High level components for Quasar Framework",
6
6
  "license": "MIT",
@@ -1,11 +1,9 @@
1
1
  <template>
2
- <q-btn>
2
+ <q-submit-button>
3
3
  <slot name="icon" />
4
4
  <div v-if="withNetwork">{{ lang.login.loginWith }} {{ withNetwork }}</div>
5
- <div v-else>
6
- {{ lang.login.login }}
7
- </div>
8
- </q-btn>
5
+ <div v-else>{{ lang.login.login }}</div>
6
+ </q-submit-button>
9
7
  </template>
10
8
 
11
9
  <script lang="ts">
@@ -15,42 +13,20 @@ export default {
15
13
  </script>
16
14
 
17
15
  <script setup lang="ts">
18
- import { ref, watch } from 'vue'
16
+ import { watch } from 'vue'
19
17
  import { useQuasar } from 'quasar'
20
- import { useLang, loadLang } from './lang'
18
+ import { useLang, loadLang } from './lang/index.js'
19
+ import QSubmitButton from '../general/QSubmitButton.vue'
21
20
 
22
21
  export interface Props {
23
22
  withNetwork?: string
24
23
  }
25
24
  defineProps<Props>()
26
- // const attrs = useAttrs();
27
- // const emit = defineEmits<{
28
- // (
29
- // e: "asyncEmit",
30
- // {
31
- // value,
32
- // done,
33
- // }: {
34
- // value: string;
35
- // done: () => void;
36
- // }
37
- // ): void;
38
- // }>();
25
+
39
26
  const $q = useQuasar()
40
27
  const lang = useLang()
41
28
  if (lang.value.isoName !== $q.lang.isoName) loadLang($q.lang.isoName)
42
29
  watch($q.lang, (val) => {
43
30
  loadLang($q.lang.isoName)
44
31
  })
45
-
46
- const variables = ref({
47
- // header: lang.value.some.nested.prop
48
- })
49
- const functions = ref({
50
- // submit
51
- })
52
- defineExpose({
53
- variables,
54
- functions
55
- })
56
32
  </script>
@@ -67,7 +67,7 @@ watch($q.lang, () => {
67
67
  const { modelValue } = toRefs(props)
68
68
 
69
69
  const update = (val: string | number | null) => {
70
- if (typeof val === 'string') emit('update:modelValue', val)
70
+ if (typeof val === 'string' || val === null) emit('update:modelValue', val)
71
71
  }
72
72
  watch(
73
73
  () => modelValue?.value,
@@ -1,12 +1,15 @@
1
1
  <template>
2
2
  <q-btn
3
3
  v-bind="attrs"
4
- :label="isNextButton ? lang.next : lang.submit"
5
4
  :color="color"
6
5
  :loading="loading || loadingInternal"
7
6
  type="submit"
8
7
  @click="submit"
9
- />
8
+ >
9
+ <slot>
10
+ {{ isNextButton ? lang.next : lang.submit }}
11
+ </slot>
12
+ </q-btn>
10
13
  </template>
11
14
 
12
15
  <script lang="ts">