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.
package/package.json
CHANGED
|
@@ -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
|
+
}
|
package/src/styles/styles.scss
CHANGED
|
@@ -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
|
+
}
|