adminforth 2.4.0-next.97 → 2.4.0-next.99

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.
@@ -0,0 +1,31 @@
1
+ <template>
2
+
3
+ <textarea
4
+ ref="input"
5
+ class="bg-lightInputBackground border border-lightInputBorder text-lightInputText placeholder-lightInputPlaceholderText text-sm rounded-lg block w-full p-2.5 dark:bg-darkInputBackground dark:border-darkInputBorder dark:placeholder-darkInputPlaceholderText dark:text-darkInputText dark:border-darkInputBorder focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder"
6
+ :placeholder="placeholder"
7
+ :value="modelValue"
8
+ @input="$emit('update:modelValue', ($event.target as HTMLInputElement).value)"
9
+ :readonly="readonly"
10
+ />
11
+
12
+ </template>
13
+
14
+ <script setup lang="ts">
15
+
16
+ import { ref } from 'vue';
17
+
18
+ const props = defineProps<{
19
+ modelValue: string,
20
+ readonly?: boolean,
21
+ placeholder?: string,
22
+ }>()
23
+
24
+ const input = ref<HTMLInputElement | null>(null)
25
+
26
+ defineExpose({
27
+ focus: () => input.value?.focus(),
28
+ });
29
+
30
+ </script>
31
+
@@ -22,4 +22,4 @@ export { default as CountryFlag } from './CountryFlag.vue';
22
22
  export { default as JsonViewer } from './JsonViewer.vue';
23
23
  export { default as Toggle } from './Toggle.vue';
24
24
  export { default as DatePicker } from './DatePicker.vue';
25
-
25
+ export { default as Textarea } from './Textarea.vue';
@@ -100,22 +100,18 @@
100
100
  @update:modelValue="$emit('update:modelValue', $event)"
101
101
  :readonly="(column.editReadonly && source === 'edit') || readonly"
102
102
  />
103
- <textarea
103
+ <Textarea
104
104
  v-else-if="['text', 'richtext'].includes(type || column.type)"
105
- ref="input"
106
- class="bg-lightInputBackground border border-lightInputBorder text-lightInputText placeholder-lightInputPlaceholderText text-sm rounded-lg block w-full p-2.5 dark:bg-darkInputBackground dark:border-darkInputBorder dark:placeholder-darkInputPlaceholderText dark:text-darkInputText dark:border-darkInputBorder focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder"
107
105
  :placeholder="$t('Text')"
108
- :value="value"
109
- @input="$emit('update:modelValue', ($event.target as HTMLInputElement).value)"
106
+ :modelValue="value"
107
+ @update:modelValue="$emit('update:modelValue', $event)"
110
108
  :readonly="(column.editReadonly && source === 'edit') || readonly"
111
109
  />
112
- <textarea
110
+ <Textarea
113
111
  v-else-if="['json'].includes(type || column.type)"
114
- ref="input"
115
- class="bg-lightInputBackground border border-lightInputBorder text-lightInputText placeholder-lightInputPlaceholderText text-sm rounded-lg block w-full p-2.5 dark:bg-darkInputBackground dark:border-darkInputBorder dark:placeholder-darkInputPlaceholderText dark:text-darkInputText dark:border-darkInputBorder focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder"
116
112
  :placeholder="$t('Text')"
117
- :value="value"
118
- @input="$emit('update:modelValue', ($event.target as HTMLInputElement).value)"
113
+ :modelValue="value"
114
+ @update:modelValue="$emit('update:modelValue', $event)"
119
115
  />
120
116
  <Input
121
117
  v-else
@@ -160,6 +156,7 @@
160
156
  import Select from '@/afcl/Select.vue';
161
157
  import Input from '@/afcl/Input.vue';
162
158
  import Spinner from '@/afcl/Spinner.vue';
159
+ import Textarea from '@/afcl/Textarea.vue';
163
160
  import { ref, inject } from 'vue';
164
161
  import { getCustomComponent } from '@/utils';
165
162
  import { useI18n } from 'vue-i18n';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "2.4.0-next.97",
3
+ "version": "2.4.0-next.99",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",