@hostlink/nuxt-light 1.34.0 → 1.35.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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "light",
3
3
  "configKey": "light",
4
- "version": "1.34.0",
4
+ "version": "1.35.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
7
7
  "unbuild": "3.5.0"
@@ -0,0 +1,47 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { getErrorMessage } from "formkit-quasar";
4
+ import { useI18n } from "vue-i18n";
5
+ const props = defineProps({
6
+ context: {
7
+ type: Object,
8
+ required: true
9
+ }
10
+ });
11
+ const { t } = useI18n();
12
+ const { error, errorMessage } = getErrorMessage(props.context.node);
13
+ const value = computed({
14
+ get: () => props.context?.value,
15
+ set: (val) => {
16
+ props.context.node.input(val);
17
+ }
18
+ });
19
+ const onBlur = () => {
20
+ if (errorMessage.value) {
21
+ error.value = true;
22
+ } else {
23
+ error.value = false;
24
+ }
25
+ };
26
+ const label = computed(() => {
27
+ let l = t(props.context.label);
28
+ if (props.context.state.required) {
29
+ l = "* " + l;
30
+ }
31
+ return l;
32
+ });
33
+ </script>
34
+
35
+ <template>
36
+ <l-input v-model="value" v-bind="context?.attrs" :label="label" :error="error" type="textarea"
37
+ :error-message="errorMessage" @blur="onBlur" :disable="context.disabled">
38
+
39
+ <template v-for="(s, name) in $slots" v-slot:[name]="props" :key="name">
40
+ <slot :name="name" v-bind="props ?? {}"></slot>
41
+ </template>
42
+
43
+ <template v-if="context.help" #hint>
44
+ {{ context.help }}
45
+ </template>
46
+ </l-input>
47
+ </template>
@@ -0,0 +1,22 @@
1
+ declare var __VLS_11: string | number, __VLS_12: any;
2
+ type __VLS_Slots = {} & {
3
+ [K in NonNullable<typeof __VLS_11>]?: (props: typeof __VLS_12) => any;
4
+ };
5
+ declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ context: {
7
+ type: ObjectConstructor;
8
+ required: true;
9
+ };
10
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ context: {
12
+ type: ObjectConstructor;
13
+ required: true;
14
+ };
15
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
16
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -15,6 +15,7 @@ import FileUploadVue from "./FileUpload.vue";
15
15
  import EditorVue from "./Editor.vue";
16
16
  import ToggleVue from "./Toggle.vue";
17
17
  import GroupSelect from "./GroupSelect.vue";
18
+ import TextareaVue from "./Textarea.vue";
18
19
  export const createLightPlugin = () => {
19
20
  return (node) => {
20
21
  let type = node.props.type + "";
@@ -75,6 +76,11 @@ export const createLightPlugin = () => {
75
76
  props: ["inputType", "number"],
76
77
  component: Input
77
78
  });
79
+ case "l-textarea":
80
+ return node.define({
81
+ type: "input",
82
+ component: TextareaVue
83
+ });
78
84
  case "l-select":
79
85
  return node.define({
80
86
  type: "input",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostlink/nuxt-light",
3
- "version": "1.34.0",
3
+ "version": "1.35.0",
4
4
  "description": "HostLink Nuxt Light Framework",
5
5
  "repository": {
6
6
  "type": "git",