@zohodesk/components 1.2.60 → 1.2.61
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/README.md +5 -1
- package/es/Textarea/Textarea.js +1 -1
- package/es/Textarea/__tests__/Textarea.spec.js +18 -0
- package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +66 -42
- package/lib/Textarea/Textarea.js +1 -1
- package/lib/Textarea/__tests__/Textarea.spec.js +20 -2
- package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +66 -42
- package/package.json +1 -1
- package/result.json +1 -1
package/README.md
CHANGED
|
@@ -32,9 +32,13 @@ In this Package, we Provide Some Basic Components to Build Web App
|
|
|
32
32
|
- TextBoxIcon
|
|
33
33
|
- Tooltip
|
|
34
34
|
|
|
35
|
+
# 1.2.61
|
|
36
|
+
|
|
37
|
+
- **Textarea** - Handled the default height and width appropriately based on the rows and cols props.
|
|
38
|
+
|
|
35
39
|
# 1.2.60
|
|
36
40
|
|
|
37
|
-
- **Textarea** -
|
|
41
|
+
- **Textarea** - Handled the default height and width appropriately based on the rows and cols props.
|
|
38
42
|
|
|
39
43
|
# 1.2.59
|
|
40
44
|
|
package/es/Textarea/Textarea.js
CHANGED
|
@@ -89,7 +89,7 @@ export default class Textarea extends React.Component {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
const isEditable = !(isReadOnly || isDisabled);
|
|
92
|
-
let classList = needAppearance ? `${style.container} ${size !== 'default' ? style[size] : ''} ${!rows ? style.defaultHeight : ''} ${!cols ? style.defaultWidth : ''} ${style[variant]} ${needBorder ? style.needBorder : style.noBorder} ${resize ? style[resizes[resize]] : style[resizes.none]} ${animated && size !== 'default' ? `${style[`${size}animated`]}` : ''} ${isDisabled && !needEffect || isReadOnly && !needEffect ? '' : style.effect} ${isEditable && isFocus ? style.active : ''}` : `${style.basic}`;
|
|
92
|
+
let classList = needAppearance ? `${style.container} ${size !== 'default' ? style[size] : ''} ${!rows && size === 'default' ? style.defaultHeight : ''} ${!cols ? style.defaultWidth : ''} ${style[variant]} ${needBorder ? style.needBorder : style.noBorder} ${resize ? style[resizes[resize]] : style[resizes.none]} ${animated && size !== 'default' ? `${style[`${size}animated`]}` : ''} ${isDisabled && !needEffect || isReadOnly && !needEffect ? '' : style.effect} ${isEditable && isFocus ? style.active : ''}` : `${style.basic}`;
|
|
93
93
|
return /*#__PURE__*/React.createElement("textarea", {
|
|
94
94
|
"aria-label": ariaLabel,
|
|
95
95
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -235,6 +235,24 @@ describe('Textarea component', () => {
|
|
|
235
235
|
}));
|
|
236
236
|
expect(asFragment()).toMatchSnapshot();
|
|
237
237
|
});
|
|
238
|
+
test('Should be render rows only ', () => {
|
|
239
|
+
const {
|
|
240
|
+
asFragment
|
|
241
|
+
} = render( /*#__PURE__*/React.createElement(Textarea, {
|
|
242
|
+
size: "default",
|
|
243
|
+
rows: "3"
|
|
244
|
+
}));
|
|
245
|
+
expect(asFragment()).toMatchSnapshot();
|
|
246
|
+
});
|
|
247
|
+
test('Should be render cols only ', () => {
|
|
248
|
+
const {
|
|
249
|
+
asFragment
|
|
250
|
+
} = render( /*#__PURE__*/React.createElement(Textarea, {
|
|
251
|
+
size: "default",
|
|
252
|
+
cols: "3"
|
|
253
|
+
}));
|
|
254
|
+
expect(asFragment()).toMatchSnapshot();
|
|
255
|
+
});
|
|
238
256
|
test('Should be render custom Attributes ', () => {
|
|
239
257
|
const {
|
|
240
258
|
asFragment
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`Textarea component Should be render cols only 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<textarea
|
|
6
|
+
class=" container defaultHeight default needBorder noresize effect borderColor_default"
|
|
7
|
+
cols="3"
|
|
8
|
+
data-id="TextareaComp"
|
|
9
|
+
data-selector-id="textarea"
|
|
10
|
+
data-test-id="TextareaComp"
|
|
11
|
+
/>
|
|
12
|
+
</DocumentFragment>
|
|
13
|
+
`;
|
|
14
|
+
|
|
3
15
|
exports[`Textarea component Should be render autofocus true 1`] = `
|
|
4
16
|
<DocumentFragment>
|
|
5
17
|
<textarea
|
|
6
|
-
class=" container small
|
|
18
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
7
19
|
data-id="TextareaComp"
|
|
8
20
|
data-selector-id="textarea"
|
|
9
21
|
data-test-id="TextareaComp"
|
|
@@ -14,7 +26,7 @@ exports[`Textarea component Should be render autofocus true 1`] = `
|
|
|
14
26
|
exports[`Textarea component Should be render custom Attributes 1`] = `
|
|
15
27
|
<DocumentFragment>
|
|
16
28
|
<textarea
|
|
17
|
-
class=" container small
|
|
29
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
18
30
|
data-id="TextareaComp"
|
|
19
31
|
data-selector-id="textarea"
|
|
20
32
|
data-test-id="TextareaComp"
|
|
@@ -26,7 +38,7 @@ exports[`Textarea component Should be render custom Attributes 1`] = `
|
|
|
26
38
|
exports[`Textarea component Should be render customClass 1`] = `
|
|
27
39
|
<DocumentFragment>
|
|
28
40
|
<textarea
|
|
29
|
-
class="textAreaCustomClass container small
|
|
41
|
+
class="textAreaCustomClass container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
30
42
|
data-id="TextareaComp"
|
|
31
43
|
data-selector-id="textarea"
|
|
32
44
|
data-test-id="TextareaComp"
|
|
@@ -37,7 +49,7 @@ exports[`Textarea component Should be render customClass 1`] = `
|
|
|
37
49
|
exports[`Textarea component Should be render htmlId 1`] = `
|
|
38
50
|
<DocumentFragment>
|
|
39
51
|
<textarea
|
|
40
|
-
class=" container small
|
|
52
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
41
53
|
data-id="TextareaComp"
|
|
42
54
|
data-selector-id="textarea"
|
|
43
55
|
data-test-id="TextareaComp"
|
|
@@ -49,7 +61,7 @@ exports[`Textarea component Should be render htmlId 1`] = `
|
|
|
49
61
|
exports[`Textarea component Should be render isDisabled is false and needEffect is false 1`] = `
|
|
50
62
|
<DocumentFragment>
|
|
51
63
|
<textarea
|
|
52
|
-
class=" container small
|
|
64
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
53
65
|
data-id="TextareaComp"
|
|
54
66
|
data-selector-id="textarea"
|
|
55
67
|
data-test-id="TextareaComp"
|
|
@@ -60,7 +72,7 @@ exports[`Textarea component Should be render isDisabled is false and needEffect
|
|
|
60
72
|
exports[`Textarea component Should be render isDisabled is true 1`] = `
|
|
61
73
|
<DocumentFragment>
|
|
62
74
|
<textarea
|
|
63
|
-
class=" container small
|
|
75
|
+
class=" container small defaultWidth default needBorder noresize borderColor_default"
|
|
64
76
|
data-id="TextareaComp"
|
|
65
77
|
data-selector-id="textarea"
|
|
66
78
|
data-test-id="TextareaComp"
|
|
@@ -72,7 +84,7 @@ exports[`Textarea component Should be render isDisabled is true 1`] = `
|
|
|
72
84
|
exports[`Textarea component Should be render isDisabled is true and needEffect is false 1`] = `
|
|
73
85
|
<DocumentFragment>
|
|
74
86
|
<textarea
|
|
75
|
-
class=" container small
|
|
87
|
+
class=" container small defaultWidth default needBorder noresize borderColor_default"
|
|
76
88
|
data-id="TextareaComp"
|
|
77
89
|
data-selector-id="textarea"
|
|
78
90
|
data-test-id="TextareaComp"
|
|
@@ -84,7 +96,7 @@ exports[`Textarea component Should be render isDisabled is true and needEffect i
|
|
|
84
96
|
exports[`Textarea component Should be render isDisabled is true and needEffect is true 1`] = `
|
|
85
97
|
<DocumentFragment>
|
|
86
98
|
<textarea
|
|
87
|
-
class=" container small
|
|
99
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
88
100
|
data-id="TextareaComp"
|
|
89
101
|
data-selector-id="textarea"
|
|
90
102
|
data-test-id="TextareaComp"
|
|
@@ -96,7 +108,7 @@ exports[`Textarea component Should be render isDisabled is true and needEffect i
|
|
|
96
108
|
exports[`Textarea component Should be render isReadOnly is false and needEffect is false 1`] = `
|
|
97
109
|
<DocumentFragment>
|
|
98
110
|
<textarea
|
|
99
|
-
class=" container small
|
|
111
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
100
112
|
data-id="TextareaComp"
|
|
101
113
|
data-selector-id="textarea"
|
|
102
114
|
data-test-id="TextareaComp"
|
|
@@ -107,7 +119,7 @@ exports[`Textarea component Should be render isReadOnly is false and needEffect
|
|
|
107
119
|
exports[`Textarea component Should be render isReadOnly is true and needEffect is false 1`] = `
|
|
108
120
|
<DocumentFragment>
|
|
109
121
|
<textarea
|
|
110
|
-
class=" readonly container small
|
|
122
|
+
class=" readonly container small defaultWidth default needBorder noresize borderColor_default"
|
|
111
123
|
data-id="TextareaComp"
|
|
112
124
|
data-selector-id="textarea"
|
|
113
125
|
data-test-id="TextareaComp"
|
|
@@ -119,7 +131,7 @@ exports[`Textarea component Should be render isReadOnly is true and needEffect i
|
|
|
119
131
|
exports[`Textarea component Should be render isReadOnly is true and needEffect is true 1`] = `
|
|
120
132
|
<DocumentFragment>
|
|
121
133
|
<textarea
|
|
122
|
-
class=" readonly container small
|
|
134
|
+
class=" readonly container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
123
135
|
data-id="TextareaComp"
|
|
124
136
|
data-selector-id="textarea"
|
|
125
137
|
data-test-id="TextareaComp"
|
|
@@ -131,7 +143,7 @@ exports[`Textarea component Should be render isReadOnly is true and needEffect i
|
|
|
131
143
|
exports[`Textarea component Should be render maxLength in number 1`] = `
|
|
132
144
|
<DocumentFragment>
|
|
133
145
|
<textarea
|
|
134
|
-
class=" container small
|
|
146
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
135
147
|
data-id="TextareaComp"
|
|
136
148
|
data-selector-id="textarea"
|
|
137
149
|
data-test-id="TextareaComp"
|
|
@@ -143,7 +155,7 @@ exports[`Textarea component Should be render maxLength in number 1`] = `
|
|
|
143
155
|
exports[`Textarea component Should be render maxLength in string 1`] = `
|
|
144
156
|
<DocumentFragment>
|
|
145
157
|
<textarea
|
|
146
|
-
class=" container small
|
|
158
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
147
159
|
data-id="TextareaComp"
|
|
148
160
|
data-selector-id="textarea"
|
|
149
161
|
data-test-id="TextareaComp"
|
|
@@ -166,7 +178,7 @@ exports[`Textarea component Should be render needAppearance is false 1`] = `
|
|
|
166
178
|
exports[`Textarea component Should be render needBorder is false 1`] = `
|
|
167
179
|
<DocumentFragment>
|
|
168
180
|
<textarea
|
|
169
|
-
class=" container small
|
|
181
|
+
class=" container small defaultWidth default noBorder noresize effect borderColor_default"
|
|
170
182
|
data-id="TextareaComp"
|
|
171
183
|
data-selector-id="textarea"
|
|
172
184
|
data-test-id="TextareaComp"
|
|
@@ -177,7 +189,7 @@ exports[`Textarea component Should be render needBorder is false 1`] = `
|
|
|
177
189
|
exports[`Textarea component Should be render needReadOnlyStyle is false 1`] = `
|
|
178
190
|
<DocumentFragment>
|
|
179
191
|
<textarea
|
|
180
|
-
class=" container small
|
|
192
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
181
193
|
data-id="TextareaComp"
|
|
182
194
|
data-selector-id="textarea"
|
|
183
195
|
data-test-id="TextareaComp"
|
|
@@ -188,7 +200,7 @@ exports[`Textarea component Should be render needReadOnlyStyle is false 1`] = `
|
|
|
188
200
|
exports[`Textarea component Should be render placeholder 1`] = `
|
|
189
201
|
<DocumentFragment>
|
|
190
202
|
<textarea
|
|
191
|
-
class=" container small
|
|
203
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
192
204
|
data-id="TextareaComp"
|
|
193
205
|
data-selector-id="textarea"
|
|
194
206
|
data-test-id="TextareaComp"
|
|
@@ -210,10 +222,22 @@ exports[`Textarea component Should be render rows and cols 1`] = `
|
|
|
210
222
|
</DocumentFragment>
|
|
211
223
|
`;
|
|
212
224
|
|
|
225
|
+
exports[`Textarea component Should be render rows only 1`] = `
|
|
226
|
+
<DocumentFragment>
|
|
227
|
+
<textarea
|
|
228
|
+
class=" container defaultWidth default needBorder noresize effect borderColor_default"
|
|
229
|
+
data-id="TextareaComp"
|
|
230
|
+
data-selector-id="textarea"
|
|
231
|
+
data-test-id="TextareaComp"
|
|
232
|
+
rows="3"
|
|
233
|
+
/>
|
|
234
|
+
</DocumentFragment>
|
|
235
|
+
`;
|
|
236
|
+
|
|
213
237
|
exports[`Textarea component Should be render text 1`] = `
|
|
214
238
|
<DocumentFragment>
|
|
215
239
|
<textarea
|
|
216
|
-
class=" container small
|
|
240
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
217
241
|
data-id="TextareaComp"
|
|
218
242
|
data-selector-id="textarea"
|
|
219
243
|
data-test-id="TextareaComp"
|
|
@@ -226,7 +250,7 @@ exports[`Textarea component Should be render text 1`] = `
|
|
|
226
250
|
exports[`Textarea component Should be render with the basic set of default props 1`] = `
|
|
227
251
|
<DocumentFragment>
|
|
228
252
|
<textarea
|
|
229
|
-
class=" container small
|
|
253
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
230
254
|
data-id="TextareaComp"
|
|
231
255
|
data-selector-id="textarea"
|
|
232
256
|
data-test-id="TextareaComp"
|
|
@@ -237,7 +261,7 @@ exports[`Textarea component Should be render with the basic set of default props
|
|
|
237
261
|
exports[`Textarea component Should render Varient - default 1`] = `
|
|
238
262
|
<DocumentFragment>
|
|
239
263
|
<textarea
|
|
240
|
-
class=" container small
|
|
264
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
241
265
|
data-id="TextareaComp"
|
|
242
266
|
data-selector-id="textarea"
|
|
243
267
|
data-test-id="TextareaComp"
|
|
@@ -248,7 +272,7 @@ exports[`Textarea component Should render Varient - default 1`] = `
|
|
|
248
272
|
exports[`Textarea component Should render Varient - primary 1`] = `
|
|
249
273
|
<DocumentFragment>
|
|
250
274
|
<textarea
|
|
251
|
-
class=" container small
|
|
275
|
+
class=" container small defaultWidth primary needBorder noresize effect borderColor_default"
|
|
252
276
|
data-id="TextareaComp"
|
|
253
277
|
data-selector-id="textarea"
|
|
254
278
|
data-test-id="TextareaComp"
|
|
@@ -259,7 +283,7 @@ exports[`Textarea component Should render Varient - primary 1`] = `
|
|
|
259
283
|
exports[`Textarea component Should render animated is false - large 1`] = `
|
|
260
284
|
<DocumentFragment>
|
|
261
285
|
<textarea
|
|
262
|
-
class=" container large
|
|
286
|
+
class=" container large defaultWidth default needBorder noresize effect borderColor_default"
|
|
263
287
|
data-id="TextareaComp"
|
|
264
288
|
data-selector-id="textarea"
|
|
265
289
|
data-test-id="TextareaComp"
|
|
@@ -270,7 +294,7 @@ exports[`Textarea component Should render animated is false - large 1`] = `
|
|
|
270
294
|
exports[`Textarea component Should render animated is false - medium 1`] = `
|
|
271
295
|
<DocumentFragment>
|
|
272
296
|
<textarea
|
|
273
|
-
class=" container medium
|
|
297
|
+
class=" container medium defaultWidth default needBorder noresize effect borderColor_default"
|
|
274
298
|
data-id="TextareaComp"
|
|
275
299
|
data-selector-id="textarea"
|
|
276
300
|
data-test-id="TextareaComp"
|
|
@@ -281,7 +305,7 @@ exports[`Textarea component Should render animated is false - medium 1`] = `
|
|
|
281
305
|
exports[`Textarea component Should render animated is false - small 1`] = `
|
|
282
306
|
<DocumentFragment>
|
|
283
307
|
<textarea
|
|
284
|
-
class=" container small
|
|
308
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
285
309
|
data-id="TextareaComp"
|
|
286
310
|
data-selector-id="textarea"
|
|
287
311
|
data-test-id="TextareaComp"
|
|
@@ -292,7 +316,7 @@ exports[`Textarea component Should render animated is false - small 1`] = `
|
|
|
292
316
|
exports[`Textarea component Should render animated is false - xmedium 1`] = `
|
|
293
317
|
<DocumentFragment>
|
|
294
318
|
<textarea
|
|
295
|
-
class=" container xmedium
|
|
319
|
+
class=" container xmedium defaultWidth default needBorder noresize effect borderColor_default"
|
|
296
320
|
data-id="TextareaComp"
|
|
297
321
|
data-selector-id="textarea"
|
|
298
322
|
data-test-id="TextareaComp"
|
|
@@ -303,7 +327,7 @@ exports[`Textarea component Should render animated is false - xmedium 1`] = `
|
|
|
303
327
|
exports[`Textarea component Should render animated is false - xsmall 1`] = `
|
|
304
328
|
<DocumentFragment>
|
|
305
329
|
<textarea
|
|
306
|
-
class=" container xsmall
|
|
330
|
+
class=" container xsmall defaultWidth default needBorder noresize effect borderColor_default"
|
|
307
331
|
data-id="TextareaComp"
|
|
308
332
|
data-selector-id="textarea"
|
|
309
333
|
data-test-id="TextareaComp"
|
|
@@ -314,7 +338,7 @@ exports[`Textarea component Should render animated is false - xsmall 1`] = `
|
|
|
314
338
|
exports[`Textarea component Should render animated is true - large 1`] = `
|
|
315
339
|
<DocumentFragment>
|
|
316
340
|
<textarea
|
|
317
|
-
class=" container large
|
|
341
|
+
class=" container large defaultWidth default needBorder noresize largeanimated effect borderColor_default"
|
|
318
342
|
data-id="TextareaComp"
|
|
319
343
|
data-selector-id="textarea"
|
|
320
344
|
data-test-id="TextareaComp"
|
|
@@ -325,7 +349,7 @@ exports[`Textarea component Should render animated is true - large 1`] = `
|
|
|
325
349
|
exports[`Textarea component Should render animated is true - medium 1`] = `
|
|
326
350
|
<DocumentFragment>
|
|
327
351
|
<textarea
|
|
328
|
-
class=" container medium
|
|
352
|
+
class=" container medium defaultWidth default needBorder noresize undefined effect borderColor_default"
|
|
329
353
|
data-id="TextareaComp"
|
|
330
354
|
data-selector-id="textarea"
|
|
331
355
|
data-test-id="TextareaComp"
|
|
@@ -336,7 +360,7 @@ exports[`Textarea component Should render animated is true - medium 1`] = `
|
|
|
336
360
|
exports[`Textarea component Should render animated is true - small 1`] = `
|
|
337
361
|
<DocumentFragment>
|
|
338
362
|
<textarea
|
|
339
|
-
class=" container small
|
|
363
|
+
class=" container small defaultWidth default needBorder noresize smallanimated effect borderColor_default"
|
|
340
364
|
data-id="TextareaComp"
|
|
341
365
|
data-selector-id="textarea"
|
|
342
366
|
data-test-id="TextareaComp"
|
|
@@ -347,7 +371,7 @@ exports[`Textarea component Should render animated is true - small 1`] = `
|
|
|
347
371
|
exports[`Textarea component Should render animated is true - xmedium 1`] = `
|
|
348
372
|
<DocumentFragment>
|
|
349
373
|
<textarea
|
|
350
|
-
class=" container xmedium
|
|
374
|
+
class=" container xmedium defaultWidth default needBorder noresize xmediumanimated effect borderColor_default"
|
|
351
375
|
data-id="TextareaComp"
|
|
352
376
|
data-selector-id="textarea"
|
|
353
377
|
data-test-id="TextareaComp"
|
|
@@ -358,7 +382,7 @@ exports[`Textarea component Should render animated is true - xmedium 1`] = `
|
|
|
358
382
|
exports[`Textarea component Should render animated is true - xsmall 1`] = `
|
|
359
383
|
<DocumentFragment>
|
|
360
384
|
<textarea
|
|
361
|
-
class=" container xsmall
|
|
385
|
+
class=" container xsmall defaultWidth default needBorder noresize xsmallanimated effect borderColor_default"
|
|
362
386
|
data-id="TextareaComp"
|
|
363
387
|
data-selector-id="textarea"
|
|
364
388
|
data-test-id="TextareaComp"
|
|
@@ -369,7 +393,7 @@ exports[`Textarea component Should render animated is true - xsmall 1`] = `
|
|
|
369
393
|
exports[`Textarea component Should render borderColor - default 1`] = `
|
|
370
394
|
<DocumentFragment>
|
|
371
395
|
<textarea
|
|
372
|
-
class=" container small
|
|
396
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
373
397
|
data-id="TextareaComp"
|
|
374
398
|
data-selector-id="textarea"
|
|
375
399
|
data-test-id="TextareaComp"
|
|
@@ -380,7 +404,7 @@ exports[`Textarea component Should render borderColor - default 1`] = `
|
|
|
380
404
|
exports[`Textarea component Should render borderColor - transparent 1`] = `
|
|
381
405
|
<DocumentFragment>
|
|
382
406
|
<textarea
|
|
383
|
-
class=" container small
|
|
407
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_transparent"
|
|
384
408
|
data-id="TextareaComp"
|
|
385
409
|
data-selector-id="textarea"
|
|
386
410
|
data-test-id="TextareaComp"
|
|
@@ -391,7 +415,7 @@ exports[`Textarea component Should render borderColor - transparent 1`] = `
|
|
|
391
415
|
exports[`Textarea component Should render resize - both 1`] = `
|
|
392
416
|
<DocumentFragment>
|
|
393
417
|
<textarea
|
|
394
|
-
class=" container small
|
|
418
|
+
class=" container small defaultWidth default needBorder resizeboth effect borderColor_default"
|
|
395
419
|
data-id="TextareaComp"
|
|
396
420
|
data-selector-id="textarea"
|
|
397
421
|
data-test-id="TextareaComp"
|
|
@@ -402,7 +426,7 @@ exports[`Textarea component Should render resize - both 1`] = `
|
|
|
402
426
|
exports[`Textarea component Should render resize - horizontal 1`] = `
|
|
403
427
|
<DocumentFragment>
|
|
404
428
|
<textarea
|
|
405
|
-
class=" container small
|
|
429
|
+
class=" container small defaultWidth default needBorder resizeX effect borderColor_default"
|
|
406
430
|
data-id="TextareaComp"
|
|
407
431
|
data-selector-id="textarea"
|
|
408
432
|
data-test-id="TextareaComp"
|
|
@@ -413,7 +437,7 @@ exports[`Textarea component Should render resize - horizontal 1`] = `
|
|
|
413
437
|
exports[`Textarea component Should render resize - none 1`] = `
|
|
414
438
|
<DocumentFragment>
|
|
415
439
|
<textarea
|
|
416
|
-
class=" container small
|
|
440
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
417
441
|
data-id="TextareaComp"
|
|
418
442
|
data-selector-id="textarea"
|
|
419
443
|
data-test-id="TextareaComp"
|
|
@@ -424,7 +448,7 @@ exports[`Textarea component Should render resize - none 1`] = `
|
|
|
424
448
|
exports[`Textarea component Should render resize - vertical 1`] = `
|
|
425
449
|
<DocumentFragment>
|
|
426
450
|
<textarea
|
|
427
|
-
class=" container small
|
|
451
|
+
class=" container small defaultWidth default needBorder resizeY effect borderColor_default"
|
|
428
452
|
data-id="TextareaComp"
|
|
429
453
|
data-selector-id="textarea"
|
|
430
454
|
data-test-id="TextareaComp"
|
|
@@ -435,7 +459,7 @@ exports[`Textarea component Should render resize - vertical 1`] = `
|
|
|
435
459
|
exports[`Textarea component Should render size - large 1`] = `
|
|
436
460
|
<DocumentFragment>
|
|
437
461
|
<textarea
|
|
438
|
-
class=" container large
|
|
462
|
+
class=" container large defaultWidth default needBorder noresize largeanimated effect borderColor_default"
|
|
439
463
|
data-id="TextareaComp"
|
|
440
464
|
data-selector-id="textarea"
|
|
441
465
|
data-test-id="TextareaComp"
|
|
@@ -446,7 +470,7 @@ exports[`Textarea component Should render size - large 1`] = `
|
|
|
446
470
|
exports[`Textarea component Should render size - medium 1`] = `
|
|
447
471
|
<DocumentFragment>
|
|
448
472
|
<textarea
|
|
449
|
-
class=" container medium
|
|
473
|
+
class=" container medium defaultWidth default needBorder noresize undefined effect borderColor_default"
|
|
450
474
|
data-id="TextareaComp"
|
|
451
475
|
data-selector-id="textarea"
|
|
452
476
|
data-test-id="TextareaComp"
|
|
@@ -457,7 +481,7 @@ exports[`Textarea component Should render size - medium 1`] = `
|
|
|
457
481
|
exports[`Textarea component Should render size - small 1`] = `
|
|
458
482
|
<DocumentFragment>
|
|
459
483
|
<textarea
|
|
460
|
-
class=" container small
|
|
484
|
+
class=" container small defaultWidth default needBorder noresize smallanimated effect borderColor_default"
|
|
461
485
|
data-id="TextareaComp"
|
|
462
486
|
data-selector-id="textarea"
|
|
463
487
|
data-test-id="TextareaComp"
|
|
@@ -468,7 +492,7 @@ exports[`Textarea component Should render size - small 1`] = `
|
|
|
468
492
|
exports[`Textarea component Should render size - xmedium 1`] = `
|
|
469
493
|
<DocumentFragment>
|
|
470
494
|
<textarea
|
|
471
|
-
class=" container xmedium
|
|
495
|
+
class=" container xmedium defaultWidth default needBorder noresize xmediumanimated effect borderColor_default"
|
|
472
496
|
data-id="TextareaComp"
|
|
473
497
|
data-selector-id="textarea"
|
|
474
498
|
data-test-id="TextareaComp"
|
|
@@ -479,7 +503,7 @@ exports[`Textarea component Should render size - xmedium 1`] = `
|
|
|
479
503
|
exports[`Textarea component Should render size - xsmall 1`] = `
|
|
480
504
|
<DocumentFragment>
|
|
481
505
|
<textarea
|
|
482
|
-
class=" container xsmall
|
|
506
|
+
class=" container xsmall defaultWidth default needBorder noresize xsmallanimated effect borderColor_default"
|
|
483
507
|
data-id="TextareaComp"
|
|
484
508
|
data-selector-id="textarea"
|
|
485
509
|
data-test-id="TextareaComp"
|
|
@@ -492,7 +516,7 @@ exports[`Textarea component rendering ally clearLabel 1`] = `
|
|
|
492
516
|
<textarea
|
|
493
517
|
aria-label="TextAreaAriaLabel"
|
|
494
518
|
aria-labelledby="TexareaAriaLabelledby"
|
|
495
|
-
class=" container small
|
|
519
|
+
class=" container small defaultWidth default needBorder noresize effect borderColor_default"
|
|
496
520
|
data-id="TextareaComp"
|
|
497
521
|
data-selector-id="textarea"
|
|
498
522
|
data-test-id="TextareaComp"
|
package/lib/Textarea/Textarea.js
CHANGED
|
@@ -129,7 +129,7 @@ var Textarea = /*#__PURE__*/function (_React$Component) {
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
var isEditable = !(isReadOnly || isDisabled);
|
|
132
|
-
var classList = needAppearance ? "".concat(_TextareaModule["default"].container, " ").concat(size !== 'default' ? _TextareaModule["default"][size] : '', " ").concat(!rows ? _TextareaModule["default"].defaultHeight : '', " ").concat(!cols ? _TextareaModule["default"].defaultWidth : '', " ").concat(_TextareaModule["default"][variant], " ").concat(needBorder ? _TextareaModule["default"].needBorder : _TextareaModule["default"].noBorder, " ").concat(resize ? _TextareaModule["default"][resizes[resize]] : _TextareaModule["default"][resizes.none], " ").concat(animated && size !== 'default' ? "".concat(_TextareaModule["default"]["".concat(size, "animated")]) : '', " ").concat(isDisabled && !needEffect || isReadOnly && !needEffect ? '' : _TextareaModule["default"].effect, " ").concat(isEditable && isFocus ? _TextareaModule["default"].active : '') : "".concat(_TextareaModule["default"].basic);
|
|
132
|
+
var classList = needAppearance ? "".concat(_TextareaModule["default"].container, " ").concat(size !== 'default' ? _TextareaModule["default"][size] : '', " ").concat(!rows && size === 'default' ? _TextareaModule["default"].defaultHeight : '', " ").concat(!cols ? _TextareaModule["default"].defaultWidth : '', " ").concat(_TextareaModule["default"][variant], " ").concat(needBorder ? _TextareaModule["default"].needBorder : _TextareaModule["default"].noBorder, " ").concat(resize ? _TextareaModule["default"][resizes[resize]] : _TextareaModule["default"][resizes.none], " ").concat(animated && size !== 'default' ? "".concat(_TextareaModule["default"]["".concat(size, "animated")]) : '', " ").concat(isDisabled && !needEffect || isReadOnly && !needEffect ? '' : _TextareaModule["default"].effect, " ").concat(isEditable && isFocus ? _TextareaModule["default"].active : '') : "".concat(_TextareaModule["default"].basic);
|
|
133
133
|
return /*#__PURE__*/_react["default"].createElement("textarea", _extends({
|
|
134
134
|
"aria-label": ariaLabel,
|
|
135
135
|
"aria-labelledby": ariaLabelledby,
|
|
@@ -242,13 +242,31 @@ describe('Textarea component', function () {
|
|
|
242
242
|
|
|
243
243
|
expect(asFragment()).toMatchSnapshot();
|
|
244
244
|
});
|
|
245
|
-
test('Should be render
|
|
245
|
+
test('Should be render rows only ', function () {
|
|
246
246
|
var _render27 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
247
|
+
size: "default",
|
|
248
|
+
rows: "3"
|
|
249
|
+
})),
|
|
250
|
+
asFragment = _render27.asFragment;
|
|
251
|
+
|
|
252
|
+
expect(asFragment()).toMatchSnapshot();
|
|
253
|
+
});
|
|
254
|
+
test('Should be render cols only ', function () {
|
|
255
|
+
var _render28 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
256
|
+
size: "default",
|
|
257
|
+
cols: "3"
|
|
258
|
+
})),
|
|
259
|
+
asFragment = _render28.asFragment;
|
|
260
|
+
|
|
261
|
+
expect(asFragment()).toMatchSnapshot();
|
|
262
|
+
});
|
|
263
|
+
test('Should be render custom Attributes ', function () {
|
|
264
|
+
var _render29 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_Textarea["default"], {
|
|
247
265
|
customAttributes: {
|
|
248
266
|
disabled: true
|
|
249
267
|
}
|
|
250
268
|
})),
|
|
251
|
-
asFragment =
|
|
269
|
+
asFragment = _render29.asFragment;
|
|
252
270
|
|
|
253
271
|
expect(asFragment()).toMatchSnapshot();
|
|
254
272
|
});
|