aloha-vue 1.0.240 → 1.0.241

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.
@@ -56,6 +56,13 @@ export default {
56
56
  computed: {
57
57
  data() {
58
58
  return [
59
+ {
60
+ type: "textarea",
61
+ label: "Aloha tiny",
62
+ id: "aloha_textarea",
63
+ classColumn: "a_column a_column_8",
64
+ required: true,
65
+ },
59
66
  {
60
67
  type: "tinymce",
61
68
  label: "Aloha tiny",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aloha-vue",
3
3
  "description": "Project aloha",
4
- "version": "1.0.240",
4
+ "version": "1.0.241",
5
5
  "author": "Ilia Brykin",
6
6
  "scripts": {
7
7
  "build-icons": "node scriptsNode/iconsSvgToJs.js bootstrap3 && node scriptsNode/iconsSvgToJs.js bootstrap-1-9-1"
@@ -4,3 +4,15 @@
4
4
  max-height: none;
5
5
  min-height: auto;
6
6
  }
7
+ .a_textarea_resize_v {
8
+ resize: vertical;
9
+ }
10
+ .a_textarea_resize_h {
11
+ resize: horizontal;
12
+ }
13
+ .a_textarea_resize_none {
14
+ resize: none;
15
+ }
16
+ .a_form_element_textarea > .a_form_element__btn_close {
17
+ right: 1.2rem;
18
+ }
@@ -20,6 +20,7 @@
20
20
  @import "components/ALink";
21
21
  @import "components/AWizard";
22
22
  @import "components/AGroupButtonDropdown";
23
+ @import "components/AFormElement/ATextarea";
23
24
 
24
25
  .a_dropdown__caret {
25
26
  margin: 0;
@@ -18,6 +18,7 @@ import ASafeHtml from "../../directives/ASafeHtml";
18
18
  import UiClearButtonMixinProps from "../mixins/UiClearButtonMixinProps";
19
19
  import UiMixinProps from "../mixins/UiMixinProps";
20
20
 
21
+ import ResizeClass from "./compositionAPI/ResizeClass";
21
22
  import UiAPI from "../compositionApi/UiAPI";
22
23
  import UiClearButtonAPI from "../compositionApi/UiClearButtonAPI";
23
24
  import UiStyleHideAPI from "../compositionApi/UiStyleHideAPI";
@@ -53,6 +54,12 @@ export default {
53
54
  required: false,
54
55
  default: "",
55
56
  },
57
+ resize: {
58
+ type: String,
59
+ required: false,
60
+ default: "v",
61
+ validator: value => ["v", "h", "none", "auto"].indexOf(value) !== -1,
62
+ },
56
63
  },
57
64
  setup(props, context) {
58
65
  const {
@@ -77,6 +84,10 @@ export default {
77
84
  isModel,
78
85
  });
79
86
 
87
+ const {
88
+ resizeClass,
89
+ } = ResizeClass(props);
90
+
80
91
  const isAutosizeStarted = ref(undefined);
81
92
 
82
93
  const rows = toRef(props, "rows");
@@ -138,23 +149,21 @@ export default {
138
149
  });
139
150
 
140
151
  return {
141
- componentStyleHide,
142
-
143
152
  ariaDescribedbyLocal,
144
153
  changeModel,
154
+ clearModel,
155
+ componentStyleHide,
145
156
  errorsId,
146
157
  helpTextId,
147
158
  htmlIdLocal,
159
+ isAutosizeStarted,
160
+ isClearButtonLocal,
148
161
  isErrors,
149
162
  isModel,
150
163
  onBlur,
151
164
  onFocus,
152
-
153
- isClearButtonLocal,
154
-
155
- clearModel,
156
- isAutosizeStarted,
157
165
  onInput,
166
+ resizeClass,
158
167
  rowsLocal,
159
168
  textareaRef,
160
169
  };
@@ -177,7 +186,7 @@ export default {
177
186
  isLabelFloat: this.isLabelFloat,
178
187
  }),
179
188
  h("div", {
180
- class: "a_form_element",
189
+ class: "a_form_element a_form_element_textarea",
181
190
  }, [
182
191
  h("textarea", {
183
192
  ref: "textareaRef",
@@ -192,6 +201,7 @@ export default {
192
201
  a_form_element_with_btn_close: this.isClearButton,
193
202
  a_form_control_invalid: this.isErrors,
194
203
  },
204
+ this.resizeClass,
195
205
  ],
196
206
  disabled: this.disabled,
197
207
  ariaRequired: this.required,
@@ -0,0 +1,23 @@
1
+ import {
2
+ computed,
3
+ toRef,
4
+ } from "vue";
5
+
6
+ export default function ResizeClass(props) {
7
+ const resize = toRef(props, "resize");
8
+
9
+ const RESIZE_CLASS_MAPPING = {
10
+ v: "a_textarea_resize_v",
11
+ h: "a_textarea_resize_h",
12
+ none: "a_textarea_resize_none",
13
+ auto: "",
14
+ };
15
+
16
+ const resizeClass = computed(() => {
17
+ return RESIZE_CLASS_MAPPING[resize.value];
18
+ });
19
+
20
+ return {
21
+ resizeClass,
22
+ };
23
+ }