@hostlink/nuxt-light 1.67.1 → 1.67.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 (30) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/L/ActionBtn.d.vue.ts +12 -10
  3. package/dist/runtime/components/L/ActionBtn.vue +8 -2
  4. package/dist/runtime/components/L/ActionBtn.vue.d.ts +12 -10
  5. package/dist/runtime/components/L/DeleteBtn.d.vue.ts +26 -16
  6. package/dist/runtime/components/L/DeleteBtn.vue +7 -3
  7. package/dist/runtime/components/L/DeleteBtn.vue.d.ts +26 -16
  8. package/dist/runtime/components/L/Table.d.vue.ts +6 -6
  9. package/dist/runtime/components/L/Table.vue +8 -11
  10. package/dist/runtime/components/L/Table.vue.d.ts +6 -6
  11. package/dist/runtime/formkit/Checkbox.vue +2 -2
  12. package/dist/runtime/formkit/DatePicker.vue +2 -2
  13. package/dist/runtime/formkit/Editor.vue +2 -2
  14. package/dist/runtime/formkit/File.vue +2 -2
  15. package/dist/runtime/formkit/FilePicker.vue +2 -2
  16. package/dist/runtime/formkit/FileUpload.vue +2 -2
  17. package/dist/runtime/formkit/GroupSelect.vue +2 -2
  18. package/dist/runtime/formkit/Input.vue +5 -3
  19. package/dist/runtime/formkit/InputSelect.vue +2 -2
  20. package/dist/runtime/formkit/InputXlsx.vue +2 -2
  21. package/dist/runtime/formkit/OptionGroup.vue +2 -2
  22. package/dist/runtime/formkit/Radio.vue +2 -2
  23. package/dist/runtime/formkit/Select.vue +2 -2
  24. package/dist/runtime/formkit/Textarea.vue +2 -2
  25. package/dist/runtime/formkit/TimePicker.vue +2 -2
  26. package/dist/runtime/formkit/useErrorMessage.d.ts +3 -0
  27. package/dist/runtime/formkit/useErrorMessage.js +34 -0
  28. package/dist/runtime/models/User.js +3 -1
  29. package/dist/runtime/plugin.js +1 -2
  30. package/package.json +6 -2
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.67.1",
4
+ "version": "1.67.3",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,13 +1,15 @@
1
- declare var __VLS_8: {};
2
- type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_8) => any;
4
- };
5
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
1
  declare const _default: typeof __VLS_export;
8
2
  export default _default;
9
- type __VLS_WithSlots<T, S> = T & {
10
- new (): {
11
- $slots: S;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ tooltip: {
5
+ type: StringConstructor;
6
+ default: string;
12
7
  };
13
- };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ tooltip: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ };
13
+ }>> & Readonly<{}>, {
14
+ tooltip: string;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,5 +1,11 @@
1
1
  <template>
2
2
  <q-btn flat round size="sm">
3
- <slot></slot>
3
+ <q-tooltip v-if="tooltip">{{ tooltip }}</q-tooltip>
4
4
  </q-btn>
5
- </template>
5
+ </template>
6
+
7
+ <script setup>
8
+ defineProps({
9
+ tooltip: { type: String, default: "" }
10
+ });
11
+ </script>
@@ -1,13 +1,15 @@
1
- declare var __VLS_8: {};
2
- type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_8) => any;
4
- };
5
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
1
  declare const _default: typeof __VLS_export;
8
2
  export default _default;
9
- type __VLS_WithSlots<T, S> = T & {
10
- new (): {
11
- $slots: S;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ tooltip: {
5
+ type: StringConstructor;
6
+ default: string;
12
7
  };
13
- };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ tooltip: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ };
13
+ }>> & Readonly<{}>, {
14
+ tooltip: string;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,20 +1,30 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4
- type __VLS_WithSlots<T, S> = T & (new () => {
5
- $slots: S;
6
- });
7
- declare const __VLS_base: import("vue").DefineComponent<{
8
- icon?: any;
9
- to?: any;
10
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ to: (ObjectConstructor | StringConstructor)[];
5
+ icon: {
6
+ type: StringConstructor;
7
+ default: string;
8
+ };
9
+ tooltip: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ };
13
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
14
  submit: (...args: any[]) => void;
12
- }, string, import("vue").PublicProps, Readonly<{
13
- icon?: any;
14
- to?: any;
15
- }> & Readonly<{
15
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ to: (ObjectConstructor | StringConstructor)[];
17
+ icon: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ tooltip: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ }>> & Readonly<{
16
26
  onSubmit?: ((...args: any[]) => any) | undefined;
17
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
18
- type __VLS_Slots = {
19
- default?: ((props: {}) => any) | undefined;
20
- };
27
+ }>, {
28
+ icon: string;
29
+ tooltip: string;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -2,7 +2,11 @@
2
2
  import { useQuasar } from "quasar";
3
3
  import { useI18n } from "vue-i18n";
4
4
  const { t } = useI18n();
5
- const props = defineProps(["to", "icon"]);
5
+ const props = defineProps({
6
+ to: [String, Object],
7
+ icon: { type: String, default: "sym_o_delete" },
8
+ tooltip: { type: String, default: "" }
9
+ });
6
10
  const emit = defineEmits(["submit"]);
7
11
  const qua = useQuasar();
8
12
  const onDelete = () => {
@@ -19,7 +23,7 @@ const onDelete = () => {
19
23
  </script>
20
24
 
21
25
  <template>
22
- <q-btn flat round :icon="icon || 'sym_o_delete'" @click="onDelete">
23
- <slot></slot>
26
+ <q-btn flat round :icon="icon" @click="onDelete">
27
+ <q-tooltip v-if="tooltip">{{ tooltip }}</q-tooltip>
24
28
  </q-btn>
25
29
  </template>
@@ -1,20 +1,30 @@
1
1
  declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4
- type __VLS_WithSlots<T, S> = T & (new () => {
5
- $slots: S;
6
- });
7
- declare const __VLS_base: import("vue").DefineComponent<{
8
- icon?: any;
9
- to?: any;
10
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ to: (ObjectConstructor | StringConstructor)[];
5
+ icon: {
6
+ type: StringConstructor;
7
+ default: string;
8
+ };
9
+ tooltip: {
10
+ type: StringConstructor;
11
+ default: string;
12
+ };
13
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
14
  submit: (...args: any[]) => void;
12
- }, string, import("vue").PublicProps, Readonly<{
13
- icon?: any;
14
- to?: any;
15
- }> & Readonly<{
15
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ to: (ObjectConstructor | StringConstructor)[];
17
+ icon: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ tooltip: {
22
+ type: StringConstructor;
23
+ default: string;
24
+ };
25
+ }>> & Readonly<{
16
26
  onSubmit?: ((...args: any[]) => any) | undefined;
17
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
18
- type __VLS_Slots = {
19
- default?: ((props: {}) => any) | undefined;
20
- };
27
+ }>, {
28
+ icon: string;
29
+ tooltip: string;
30
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -79,17 +79,17 @@ export interface LTableRequest {
79
79
  }) => void;
80
80
  }
81
81
  declare function requestServerInteraction(): void;
82
- declare var __VLS_135: any, __VLS_138: string, __VLS_139: any, __VLS_170: any, __VLS_173: any, __VLS_343: string, __VLS_344: any;
82
+ declare var __VLS_114: any, __VLS_117: string, __VLS_118: any, __VLS_149: any, __VLS_152: any, __VLS_322: string, __VLS_323: any;
83
83
  type __VLS_Slots = {} & {
84
- [K in NonNullable<typeof __VLS_138>]?: (props: typeof __VLS_139) => any;
84
+ [K in NonNullable<typeof __VLS_117>]?: (props: typeof __VLS_118) => any;
85
85
  } & {
86
- [K in NonNullable<typeof __VLS_343>]?: (props: typeof __VLS_344) => any;
86
+ [K in NonNullable<typeof __VLS_322>]?: (props: typeof __VLS_323) => any;
87
87
  } & {
88
- actions?: (props: typeof __VLS_135) => any;
88
+ actions?: (props: typeof __VLS_114) => any;
89
89
  } & {
90
- 'row-expand'?: (props: typeof __VLS_170) => any;
90
+ 'row-expand'?: (props: typeof __VLS_149) => any;
91
91
  } & {
92
- 'top-right'?: (props: typeof __VLS_173) => any;
92
+ 'top-right'?: (props: typeof __VLS_152) => any;
93
93
  };
94
94
  declare const __VLS_base: import("vue").DefineComponent<LTableProps, {
95
95
  requestServerInteraction: typeof requestServerInteraction;
@@ -597,21 +597,18 @@ const hasFilters = computed(() => {
597
597
 
598
598
  <l-action-btn v-if="actionView && props.row.canView"
599
599
  :to="`/${modelName}/${props.row[primaryKey]}/view`"
600
- :icon="light.styles.table.actionIcons.view">
601
- <q-tooltip>{{ $t("View") }}</q-tooltip>
602
- </l-action-btn>
600
+ :icon="light.styles.table.actionIcons.view"
601
+ :tooltip="$t('View')" />
603
602
 
604
603
  <l-action-btn v-if="activeEdit && props.row.canUpdate"
605
604
  :to="`/${modelName}/${props.row[primaryKey]}/edit`"
606
- :icon="light.styles.table.actionIcons.edit">
607
- <q-tooltip>{{ $t("Edit") }}</q-tooltip>
608
- </l-action-btn>
605
+ :icon="light.styles.table.actionIcons.edit"
606
+ :tooltip="$t('Edit')" />
609
607
 
610
608
  <l-delete-btn v-if="actionDelete && props.row.canDelete"
611
609
  :icon="light.styles.table.actionIcons.delete"
612
- @submit="onDelete(props.row[primaryKey])" size="sm">
613
- <q-tooltip>{{ $t("Delete") }}</q-tooltip>
614
- </l-delete-btn>
610
+ :tooltip="$t('Delete')"
611
+ @submit="onDelete(props.row[primaryKey])" size="sm" />
615
612
 
616
613
  <slot name="actions" v-bind="props"></slot>
617
614
  </div>
@@ -724,12 +721,12 @@ const hasFilters = computed(() => {
724
721
  :options="localSearchOptions[col.name]" emit-value map-options
725
722
  :multiple="col.searchMultiple" use-input input-debounce="0" @filter="(val, update) => {
726
723
  searchSelectFilter(val, update, col.name);
727
- }" :style="col.searchStyle" />
724
+ }" :style="col.searchStyle" :placeholder="col.searchPlaceholder" />
728
725
  </template>
729
726
 
730
727
  <template v-if="col.searchType == 'date'">
731
728
  <l-date-picker dense clearable filled square :outlined="false" hide-bottom-space
732
- v-model="filters[col.name]" range :style="col.searchStyle" />
729
+ v-model="filters[col.name]" range :style="col.searchStyle" :placeholder="col.searchPlaceholder" />
733
730
  </template>
734
731
 
735
732
  <template v-if="col.searchType == 'boolean'">
@@ -79,17 +79,17 @@ export interface LTableRequest {
79
79
  }) => void;
80
80
  }
81
81
  declare function requestServerInteraction(): void;
82
- declare var __VLS_135: any, __VLS_138: string, __VLS_139: any, __VLS_170: any, __VLS_173: any, __VLS_343: string, __VLS_344: any;
82
+ declare var __VLS_114: any, __VLS_117: string, __VLS_118: any, __VLS_149: any, __VLS_152: any, __VLS_322: string, __VLS_323: any;
83
83
  type __VLS_Slots = {} & {
84
- [K in NonNullable<typeof __VLS_138>]?: (props: typeof __VLS_139) => any;
84
+ [K in NonNullable<typeof __VLS_117>]?: (props: typeof __VLS_118) => any;
85
85
  } & {
86
- [K in NonNullable<typeof __VLS_343>]?: (props: typeof __VLS_344) => any;
86
+ [K in NonNullable<typeof __VLS_322>]?: (props: typeof __VLS_323) => any;
87
87
  } & {
88
- actions?: (props: typeof __VLS_135) => any;
88
+ actions?: (props: typeof __VLS_114) => any;
89
89
  } & {
90
- 'row-expand'?: (props: typeof __VLS_170) => any;
90
+ 'row-expand'?: (props: typeof __VLS_149) => any;
91
91
  } & {
92
- 'top-right'?: (props: typeof __VLS_173) => any;
92
+ 'top-right'?: (props: typeof __VLS_152) => any;
93
93
  };
94
94
  declare const __VLS_base: import("vue").DefineComponent<LTableProps, {
95
95
  requestServerInteraction: typeof requestServerInteraction;
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { getErrorMessage } from "formkit-quasar";
2
+ import { useErrorMessage } from "./useErrorMessage";
3
3
  import { computed } from "vue";
4
4
  const props = defineProps({
5
5
  context: Object
@@ -8,7 +8,7 @@ const value = computed({
8
8
  get: () => props.context.value,
9
9
  set: (val) => props.context.node.input(val)
10
10
  });
11
- const { error, errorMessage } = getErrorMessage(props.context.node);
11
+ const { error, errorMessage } = useErrorMessage(props.context.node);
12
12
  </script>
13
13
 
14
14
  <template>
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  import { useLight } from "#imports";
5
5
  const props = defineProps({
6
6
  context: Object
7
7
  });
8
- const { error, errorMessage } = getErrorMessage(props.context.node);
8
+ const { error, errorMessage } = useErrorMessage(props.context.node);
9
9
  const value = computed({
10
10
  get: () => props.context.value,
11
11
  set: (val) => props.context.node.input(val)
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
- import { getErrorMessage } from "formkit-quasar";
2
+ import { useErrorMessage } from "./useErrorMessage";
3
3
  import { computed } from "vue";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
- import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
2
+ import { computed, ref } from "vue";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  import { useI18n } from "vue-i18n";
5
5
  const props = defineProps({
6
6
  context: {
@@ -9,7 +9,9 @@ const props = defineProps({
9
9
  }
10
10
  });
11
11
  const { t } = useI18n();
12
- const { error, errorMessage } = getErrorMessage(props.context.node);
12
+ const error = ref(false);
13
+ const errorMessage = ref("");
14
+ useErrorMessage(props.context.node, error, errorMessage);
13
15
  const value = computed({
14
16
  get: () => props.context?.value,
15
17
  set: (val) => {
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  import { useI18n } from "vue-i18n";
5
5
  const props = defineProps({
6
6
  context: {
@@ -9,7 +9,7 @@ const props = defineProps({
9
9
  }
10
10
  });
11
11
  const { t } = useI18n();
12
- const { error, errorMessage } = getErrorMessage(props.context.node);
12
+ const { error, errorMessage } = useErrorMessage(props.context.node);
13
13
  const value = computed({
14
14
  get: () => props.context?.value,
15
15
  set: (val) => props.context.node.input(val)
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -1,12 +1,12 @@
1
1
  <script setup>
2
2
  import { useLight } from "#imports";
3
3
  import { computed } from "vue";
4
- import { getErrorMessage } from "formkit-quasar";
4
+ import { useErrorMessage } from "./useErrorMessage";
5
5
  const light = useLight();
6
6
  const props = defineProps({
7
7
  context: Object
8
8
  });
9
- const { error, errorMessage } = getErrorMessage(props.context.node);
9
+ const { error, errorMessage } = useErrorMessage(props.context.node);
10
10
  const value = computed({
11
11
  get: () => props.context.value,
12
12
  set: (val) => props.context.node.input(val)
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
- import { getErrorMessage } from "formkit-quasar";
2
+ import { useErrorMessage } from "./useErrorMessage";
3
3
  import { computed } from "vue";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  import { useI18n } from "vue-i18n";
5
5
  const props = defineProps({
6
6
  context: {
@@ -9,7 +9,7 @@ const props = defineProps({
9
9
  }
10
10
  });
11
11
  const { t } = useI18n();
12
- const { error, errorMessage } = getErrorMessage(props.context.node);
12
+ const { error, errorMessage } = useErrorMessage(props.context.node);
13
13
  const value = computed({
14
14
  get: () => props.context?.value,
15
15
  set: (val) => {
@@ -1,10 +1,10 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { getErrorMessage } from "formkit-quasar";
3
+ import { useErrorMessage } from "./useErrorMessage";
4
4
  const props = defineProps({
5
5
  context: Object
6
6
  });
7
- const { error, errorMessage } = getErrorMessage(props.context.node);
7
+ const { error, errorMessage } = useErrorMessage(props.context.node);
8
8
  const value = computed({
9
9
  get: () => props.context.value,
10
10
  set: (val) => props.context.node.input(val)
@@ -0,0 +1,3 @@
1
+ import type { Ref } from 'vue';
2
+ import type { FormKitNode } from '@formkit/core';
3
+ export declare function useErrorMessage(node: FormKitNode, error: Ref<boolean>, errorMessage: Ref<string>): () => void;
@@ -0,0 +1,34 @@
1
+ import { getValidationMessages } from "@formkit/validation";
2
+ export function useErrorMessage(node, error, errorMessage) {
3
+ const showErrorMessage = (msg) => {
4
+ if (msg.name === "message-updated") {
5
+ if (msg.payload.type === "validation") {
6
+ errorMessage.value = msg.payload.value;
7
+ }
8
+ }
9
+ if (msg.name === "message-removed") {
10
+ if (msg.payload.type === "validation") {
11
+ errorMessage.value = "";
12
+ error.value = false;
13
+ }
14
+ if (msg.payload.type === "state") {
15
+ error.value = false;
16
+ }
17
+ }
18
+ if (msg.name === "message-added") {
19
+ errorMessage.value = "";
20
+ error.value = false;
21
+ const messages = getValidationMessages(node);
22
+ for (const message of messages) {
23
+ if (message[0]) {
24
+ errorMessage.value = message[1][0].value;
25
+ error.value = true;
26
+ break;
27
+ }
28
+ }
29
+ }
30
+ };
31
+ const events = ["message-added", "message-removed", "message-updated"];
32
+ const receipts = events.map((event) => node.on(event, showErrorMessage));
33
+ return () => receipts.forEach((receipt) => node.off(receipt));
34
+ }
@@ -44,7 +44,8 @@ export default defineLightModel({
44
44
  label: "Join date",
45
45
  sortable: true,
46
46
  searchable: true,
47
- searchType: "date"
47
+ searchType: "date",
48
+ searchPlaceholder: "Pick a date range..."
48
49
  },
49
50
  roles: {
50
51
  label: "Roles"
@@ -53,6 +54,7 @@ export default defineLightModel({
53
54
  label: "Status",
54
55
  searchable: true,
55
56
  searchType: "select",
57
+ searchPlaceholder: "Filter by status...",
56
58
  searchOptions: [
57
59
  { label: "Active", value: 0 },
58
60
  { label: "Inactive", value: 1 }
@@ -8,7 +8,6 @@ import "./assets/main.css";
8
8
  import message_en from "./locales/en.json";
9
9
  import message_zh from "./locales/zh-hk.json";
10
10
  localStorage.getItem("locale") || localStorage.setItem("locale", "en");
11
- import { createQuasarPlugin } from "formkit-quasar";
12
11
  import { createLightPlugin } from "./formkit/index.js";
13
12
  import { plugin, defaultConfig } from "@formkit/vue";
14
13
  import getApiBase from "./composables/getApiBase.js";
@@ -61,7 +60,7 @@ export default defineNuxtPlugin((nuxtApp) => {
61
60
  locale = "zhTW";
62
61
  }
63
62
  nuxtApp.vueApp.use(plugin, defaultConfig({
64
- plugins: [createQuasarPlugin(), createLightPlugin()],
63
+ plugins: [createLightPlugin()],
65
64
  locales: {
66
65
  zhTW
67
66
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.67.1",
3
+ "version": "1.67.3",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,7 +32,12 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@azure/msal-browser": "^4.26.2",
35
+ "@formkit/core": "^1.7.2",
35
36
  "@formkit/drag-and-drop": "^0.5.3",
37
+ "@formkit/i18n": "^1.7.2",
38
+ "@formkit/inputs": "^1.7.2",
39
+ "@formkit/validation": "^1.7.2",
40
+ "@formkit/vue": "^1.7.2",
36
41
  "@hostlink/light": "^3.2.7",
37
42
  "@nuxt/module-builder": "^1.0.1",
38
43
  "@quasar/extras": "^1.17.0",
@@ -42,7 +47,6 @@
42
47
  "defu": "^6.1.4",
43
48
  "diff2html": "^3.4.47",
44
49
  "dompurify": "^3.3.1",
45
- "formkit-quasar": "^0.0.15",
46
50
  "json-to-graphql-query": "^2.3.0",
47
51
  "nuxt-quasar-ui": "^3.0.0",
48
52
  "quasar": "^2.18.5",