aloha-vue 2.49.0 → 2.49.2
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/CHANGELOG.md +8 -0
- package/dist/aloha-vue.es.js +11253 -11079
- package/dist/aloha-vue.umd.js +54 -54
- package/package.json +1 -1
- package/src/plugins/ASelectStylesPlugin.js +61 -0
- package/src/ui/AInput/AInput.js +483 -476
- package/src/ui/AInput/compositionAPI/FocusAPI.js +16 -0
- package/src/ui/AInput/compositionAPI/ModelAPI.js +2 -3
- package/src/ui/ASelectStyle/i18n/ar.json +16 -4
- package/src/ui/ASelectStyle/i18n/de.json +16 -4
- package/src/ui/ASelectStyle/i18n/en.json +16 -4
- package/src/ui/ASelectStyle/i18n/es.json +16 -4
- package/src/ui/ASelectStyle/i18n/fr.json +16 -4
- package/src/ui/ASelectStyle/i18n/hr.json +16 -4
- package/src/ui/ASelectStyle/i18n/it.json +16 -4
- package/src/ui/ASelectStyle/i18n/ru.json +16 -4
- package/src/ui/compositionApi/UiAPI.js +6 -1
package/src/ui/AInput/AInput.js
CHANGED
|
@@ -1,476 +1,483 @@
|
|
|
1
|
-
import {
|
|
2
|
-
h,
|
|
3
|
-
toRef,
|
|
4
|
-
watch,
|
|
5
|
-
} from "vue";
|
|
6
|
-
import {
|
|
7
|
-
AButton,
|
|
8
|
-
AErrorsText,
|
|
9
|
-
AFormElementBtnClear,
|
|
10
|
-
AFormHelpText,
|
|
11
|
-
AFormLabelDescription,
|
|
12
|
-
AFormReadonly,
|
|
13
|
-
AIcon,
|
|
14
|
-
ALabel,
|
|
15
|
-
UiAPI,
|
|
16
|
-
UiClearButtonAPI,
|
|
17
|
-
UiDisabledAPI,
|
|
18
|
-
UIExcludeRenderAttributesAPI,
|
|
19
|
-
UiInputAutofillAPI,
|
|
20
|
-
UiStyleHideAPI,
|
|
21
|
-
} from "../../index";
|
|
22
|
-
|
|
23
|
-
import ClassAPI from "./compositionAPI/ClassAPI";
|
|
24
|
-
import ColorAPI from "./compositionAPI/ColorAPI";
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
"
|
|
226
|
-
"
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
const {
|
|
242
|
-
attributesToExcludeFromRender,
|
|
243
|
-
} = UIExcludeRenderAttributesAPI(props);
|
|
244
|
-
|
|
245
|
-
const {
|
|
246
|
-
componentStyleHide,
|
|
247
|
-
} = UiStyleHideAPI(props);
|
|
248
|
-
|
|
249
|
-
const {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
} =
|
|
273
|
-
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
const {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
} =
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
const {
|
|
298
|
-
|
|
299
|
-
} =
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
h(
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
this.
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
disabled: this.disabled,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
1
|
+
import {
|
|
2
|
+
h,
|
|
3
|
+
toRef,
|
|
4
|
+
watch,
|
|
5
|
+
} from "vue";
|
|
6
|
+
import {
|
|
7
|
+
AButton,
|
|
8
|
+
AErrorsText,
|
|
9
|
+
AFormElementBtnClear,
|
|
10
|
+
AFormHelpText,
|
|
11
|
+
AFormLabelDescription,
|
|
12
|
+
AFormReadonly,
|
|
13
|
+
AIcon,
|
|
14
|
+
ALabel,
|
|
15
|
+
UiAPI,
|
|
16
|
+
UiClearButtonAPI,
|
|
17
|
+
UiDisabledAPI,
|
|
18
|
+
UIExcludeRenderAttributesAPI,
|
|
19
|
+
UiInputAutofillAPI,
|
|
20
|
+
UiStyleHideAPI,
|
|
21
|
+
} from "../../index";
|
|
22
|
+
|
|
23
|
+
import ClassAPI from "./compositionAPI/ClassAPI";
|
|
24
|
+
import ColorAPI from "./compositionAPI/ColorAPI";
|
|
25
|
+
import FocusAPI from "./compositionAPI/FocusAPI";
|
|
26
|
+
import ModelAPI from "./compositionAPI/ModelAPI";
|
|
27
|
+
import PasswordAPI from "./compositionAPI/PasswordAPI";
|
|
28
|
+
import PlaceholderAPI from "../../ATranslation/compositionAPI/PlaceholderAPI";
|
|
29
|
+
import ReadonlyAPI from "./compositionAPI/ReadonlyAPI";
|
|
30
|
+
import TypeAPI from "./compositionAPI/TypeAPI";
|
|
31
|
+
|
|
32
|
+
import {
|
|
33
|
+
isInteger,
|
|
34
|
+
uniqueId,
|
|
35
|
+
} from "lodash-es";
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: "AInput",
|
|
39
|
+
inheritAttrs: false,
|
|
40
|
+
props: {
|
|
41
|
+
alwaysTranslate: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
required: false,
|
|
44
|
+
},
|
|
45
|
+
autocomplete: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: false,
|
|
48
|
+
default: undefined,
|
|
49
|
+
},
|
|
50
|
+
change: {
|
|
51
|
+
type: Function,
|
|
52
|
+
required: false,
|
|
53
|
+
default: () => {},
|
|
54
|
+
},
|
|
55
|
+
clearButtonClass: {
|
|
56
|
+
type: [String, Object],
|
|
57
|
+
required: false,
|
|
58
|
+
default: undefined,
|
|
59
|
+
},
|
|
60
|
+
dependencies: {
|
|
61
|
+
type: [Array, Object],
|
|
62
|
+
required: false,
|
|
63
|
+
default: undefined,
|
|
64
|
+
},
|
|
65
|
+
disabled: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
required: false,
|
|
68
|
+
},
|
|
69
|
+
errors: {
|
|
70
|
+
type: [String, Array],
|
|
71
|
+
required: false,
|
|
72
|
+
default: undefined,
|
|
73
|
+
},
|
|
74
|
+
excludeRenderAttributes: {
|
|
75
|
+
type: Array,
|
|
76
|
+
required: false,
|
|
77
|
+
default: () => [],
|
|
78
|
+
},
|
|
79
|
+
extra: {
|
|
80
|
+
type: Object,
|
|
81
|
+
required: false,
|
|
82
|
+
default: undefined,
|
|
83
|
+
},
|
|
84
|
+
helpText: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: false,
|
|
87
|
+
default: undefined,
|
|
88
|
+
},
|
|
89
|
+
htmlId: {
|
|
90
|
+
type: String,
|
|
91
|
+
required: false,
|
|
92
|
+
default: undefined,
|
|
93
|
+
},
|
|
94
|
+
iconPrepend: {
|
|
95
|
+
type: String,
|
|
96
|
+
required: false,
|
|
97
|
+
default: undefined,
|
|
98
|
+
},
|
|
99
|
+
id: {
|
|
100
|
+
type: [String, Number],
|
|
101
|
+
required: false,
|
|
102
|
+
default: () => uniqueId("a_input_"),
|
|
103
|
+
},
|
|
104
|
+
idPrefix: {
|
|
105
|
+
type: String,
|
|
106
|
+
required: false,
|
|
107
|
+
default: undefined,
|
|
108
|
+
},
|
|
109
|
+
inputAttributes: {
|
|
110
|
+
type: Object,
|
|
111
|
+
required: false,
|
|
112
|
+
default: () => ({}),
|
|
113
|
+
},
|
|
114
|
+
inputClass: {
|
|
115
|
+
type: [String, Object],
|
|
116
|
+
required: false,
|
|
117
|
+
default: undefined,
|
|
118
|
+
},
|
|
119
|
+
isClearButton: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
required: false,
|
|
122
|
+
default: true,
|
|
123
|
+
},
|
|
124
|
+
isHide: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
required: false,
|
|
127
|
+
},
|
|
128
|
+
isLabelFloat: {
|
|
129
|
+
type: Boolean,
|
|
130
|
+
required: false,
|
|
131
|
+
default: true,
|
|
132
|
+
},
|
|
133
|
+
isRender: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
required: false,
|
|
136
|
+
default: true,
|
|
137
|
+
},
|
|
138
|
+
label: {
|
|
139
|
+
type: [String, Number],
|
|
140
|
+
required: false,
|
|
141
|
+
default: undefined,
|
|
142
|
+
},
|
|
143
|
+
labelClass: {
|
|
144
|
+
type: [String, Object],
|
|
145
|
+
required: false,
|
|
146
|
+
default: undefined,
|
|
147
|
+
},
|
|
148
|
+
labelDescription: {
|
|
149
|
+
type: String,
|
|
150
|
+
required: false,
|
|
151
|
+
default: undefined,
|
|
152
|
+
},
|
|
153
|
+
labelScreenReader: {
|
|
154
|
+
type: [String, Number],
|
|
155
|
+
required: false,
|
|
156
|
+
default: undefined,
|
|
157
|
+
},
|
|
158
|
+
maxlength: {
|
|
159
|
+
type: [String, Number],
|
|
160
|
+
required: false,
|
|
161
|
+
default: undefined,
|
|
162
|
+
},
|
|
163
|
+
modelDependencies: {
|
|
164
|
+
type: Object,
|
|
165
|
+
required: false,
|
|
166
|
+
default: () => ({}),
|
|
167
|
+
},
|
|
168
|
+
modelUndefined: {
|
|
169
|
+
type: [String, Number, Object, Array, Boolean],
|
|
170
|
+
required: false,
|
|
171
|
+
default: "",
|
|
172
|
+
},
|
|
173
|
+
modelValue: {
|
|
174
|
+
type: [String, Number],
|
|
175
|
+
required: false,
|
|
176
|
+
default: undefined,
|
|
177
|
+
},
|
|
178
|
+
placeholder: {
|
|
179
|
+
type: [String, Number, Object],
|
|
180
|
+
required: false,
|
|
181
|
+
default: undefined,
|
|
182
|
+
},
|
|
183
|
+
readonly: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
required: false,
|
|
186
|
+
},
|
|
187
|
+
readonlyDefault: {
|
|
188
|
+
type: String,
|
|
189
|
+
required: false,
|
|
190
|
+
default: "",
|
|
191
|
+
},
|
|
192
|
+
readonlyPasswordLength: {
|
|
193
|
+
type: Number,
|
|
194
|
+
required: false,
|
|
195
|
+
default: 8,
|
|
196
|
+
validator: value => value > 0 && isInteger(value),
|
|
197
|
+
},
|
|
198
|
+
readonlyPasswordSymbol: {
|
|
199
|
+
type: String,
|
|
200
|
+
required: false,
|
|
201
|
+
default: "*",
|
|
202
|
+
},
|
|
203
|
+
required: {
|
|
204
|
+
type: Boolean,
|
|
205
|
+
required: false,
|
|
206
|
+
default: false,
|
|
207
|
+
},
|
|
208
|
+
showPassword: {
|
|
209
|
+
type: Boolean,
|
|
210
|
+
required: false,
|
|
211
|
+
default: true,
|
|
212
|
+
},
|
|
213
|
+
step: {
|
|
214
|
+
type: [String, Number],
|
|
215
|
+
required: false,
|
|
216
|
+
default: undefined,
|
|
217
|
+
},
|
|
218
|
+
type: {
|
|
219
|
+
type: String,
|
|
220
|
+
required: false,
|
|
221
|
+
default: "text",
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
emits: [
|
|
225
|
+
"update:modelValue",
|
|
226
|
+
"focus",
|
|
227
|
+
"blur",
|
|
228
|
+
],
|
|
229
|
+
setup(props, context) {
|
|
230
|
+
const type = toRef(props, "type");
|
|
231
|
+
|
|
232
|
+
const {
|
|
233
|
+
disabledAttribut,
|
|
234
|
+
} = UiDisabledAPI(props);
|
|
235
|
+
|
|
236
|
+
const {
|
|
237
|
+
setTypeLocal,
|
|
238
|
+
typeForInput,
|
|
239
|
+
} = TypeAPI(props);
|
|
240
|
+
|
|
241
|
+
const {
|
|
242
|
+
attributesToExcludeFromRender,
|
|
243
|
+
} = UIExcludeRenderAttributesAPI(props);
|
|
244
|
+
|
|
245
|
+
const {
|
|
246
|
+
componentStyleHide,
|
|
247
|
+
} = UiStyleHideAPI(props);
|
|
248
|
+
|
|
249
|
+
const {
|
|
250
|
+
inputRef,
|
|
251
|
+
setFocusToInput,
|
|
252
|
+
} = FocusAPI();
|
|
253
|
+
|
|
254
|
+
const {
|
|
255
|
+
ariaDescribedbyLocal,
|
|
256
|
+
changeModel,
|
|
257
|
+
clearModel,
|
|
258
|
+
errorsId,
|
|
259
|
+
helpTextId,
|
|
260
|
+
htmlIdLocal,
|
|
261
|
+
isErrors,
|
|
262
|
+
isModel,
|
|
263
|
+
labelDescriptionId,
|
|
264
|
+
onBlur,
|
|
265
|
+
onFocus,
|
|
266
|
+
} = UiAPI(props, context, {
|
|
267
|
+
setFocus: setFocusToInput,
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
const {
|
|
271
|
+
isClearButtonLocal,
|
|
272
|
+
} = UiClearButtonAPI(props, {
|
|
273
|
+
isModel,
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
const {
|
|
277
|
+
onInput,
|
|
278
|
+
} = ModelAPI(props, {
|
|
279
|
+
changeModel,
|
|
280
|
+
inputRef,
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
const {
|
|
284
|
+
iconBtnShowPassword,
|
|
285
|
+
isBtnShowPasswordVisible,
|
|
286
|
+
titleBtnShowPassword,
|
|
287
|
+
toggleTypePassword,
|
|
288
|
+
} = PasswordAPI(props, {
|
|
289
|
+
setTypeLocal,
|
|
290
|
+
typeForInput,
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
const {
|
|
294
|
+
isAutofill,
|
|
295
|
+
} = UiInputAutofillAPI({ inputRef });
|
|
296
|
+
|
|
297
|
+
const {
|
|
298
|
+
inputClassBtns,
|
|
299
|
+
} = ClassAPI({
|
|
300
|
+
isBtnShowPasswordVisible,
|
|
301
|
+
isClearButtonLocal,
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
const {
|
|
305
|
+
placeholderAttributes,
|
|
306
|
+
} = PlaceholderAPI(props);
|
|
307
|
+
|
|
308
|
+
const {
|
|
309
|
+
modelValueLocal,
|
|
310
|
+
} = ColorAPI(props);
|
|
311
|
+
|
|
312
|
+
const {
|
|
313
|
+
modelValueReadonly,
|
|
314
|
+
} = ReadonlyAPI(props);
|
|
315
|
+
|
|
316
|
+
watch(type, () => {
|
|
317
|
+
setTypeLocal();
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
setTypeLocal();
|
|
321
|
+
|
|
322
|
+
return {
|
|
323
|
+
ariaDescribedbyLocal,
|
|
324
|
+
attributesToExcludeFromRender,
|
|
325
|
+
clearModel,
|
|
326
|
+
componentStyleHide,
|
|
327
|
+
disabledAttribut,
|
|
328
|
+
errorsId,
|
|
329
|
+
helpTextId,
|
|
330
|
+
htmlIdLocal,
|
|
331
|
+
iconBtnShowPassword,
|
|
332
|
+
inputClassBtns,
|
|
333
|
+
inputRef,
|
|
334
|
+
isAutofill,
|
|
335
|
+
isBtnShowPasswordVisible,
|
|
336
|
+
isClearButtonLocal,
|
|
337
|
+
isErrors,
|
|
338
|
+
isModel,
|
|
339
|
+
labelDescriptionId,
|
|
340
|
+
modelValueLocal,
|
|
341
|
+
modelValueReadonly,
|
|
342
|
+
onBlur,
|
|
343
|
+
onFocus,
|
|
344
|
+
onInput,
|
|
345
|
+
placeholderAttributes,
|
|
346
|
+
titleBtnShowPassword,
|
|
347
|
+
toggleTypePassword,
|
|
348
|
+
typeForInput,
|
|
349
|
+
};
|
|
350
|
+
},
|
|
351
|
+
render() {
|
|
352
|
+
if (!this.isRender) {
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (this.readonly) {
|
|
357
|
+
return h(AFormReadonly, {
|
|
358
|
+
...this.$attrs,
|
|
359
|
+
id: this.htmlIdLocal,
|
|
360
|
+
alwaysTranslate: this.alwaysTranslate,
|
|
361
|
+
excludeRenderAttributes: this.excludeRenderAttributes,
|
|
362
|
+
extra: this.extra,
|
|
363
|
+
helpText: this.helpText,
|
|
364
|
+
label: this.label,
|
|
365
|
+
labelClass: this.labelClass,
|
|
366
|
+
labelScreenReader: this.labelScreenReader,
|
|
367
|
+
modelValue: this.modelValueReadonly,
|
|
368
|
+
readonlyDefault: this.readonlyDefault,
|
|
369
|
+
required: this.required,
|
|
370
|
+
style: this.componentStyleHide,
|
|
371
|
+
type: this.type,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return h("div", {
|
|
376
|
+
...this.$attrs,
|
|
377
|
+
style: this.componentStyleHide,
|
|
378
|
+
...this.attributesToExcludeFromRender,
|
|
379
|
+
}, [
|
|
380
|
+
h("div", {
|
|
381
|
+
class: ["a_form_element__parent", {
|
|
382
|
+
a_form_element__parent_float: this.isLabelFloat,
|
|
383
|
+
a_form_element__parent_not_empty: this.isModel || this.isAutofill,
|
|
384
|
+
a_form_element__parent_float_has_icon_prepend: this.iconPrepend,
|
|
385
|
+
}],
|
|
386
|
+
}, [
|
|
387
|
+
(this.label || this.labelScreenReader) ?
|
|
388
|
+
h(ALabel, {
|
|
389
|
+
id: this.htmlIdLocal,
|
|
390
|
+
alwaysTranslate: this.alwaysTranslate,
|
|
391
|
+
extra: this.extra,
|
|
392
|
+
isError: this.isErrors,
|
|
393
|
+
isLabelFloat: this.isLabelFloat,
|
|
394
|
+
label: this.label,
|
|
395
|
+
labelClass: this.labelClass,
|
|
396
|
+
labelScreenReader: this.labelScreenReader,
|
|
397
|
+
required: this.required,
|
|
398
|
+
type: this.type,
|
|
399
|
+
}) :
|
|
400
|
+
"",
|
|
401
|
+
h(AFormLabelDescription, {
|
|
402
|
+
id: this.labelDescriptionId,
|
|
403
|
+
alwaysTranslate: this.alwaysTranslate,
|
|
404
|
+
html: this.labelDescription,
|
|
405
|
+
extra: this.extra,
|
|
406
|
+
isLabelFloat: this.isLabelFloat,
|
|
407
|
+
}),
|
|
408
|
+
h("div", {
|
|
409
|
+
class: "a_form_element",
|
|
410
|
+
}, [
|
|
411
|
+
this.iconPrepend && h(AIcon, {
|
|
412
|
+
icon: this.iconPrepend,
|
|
413
|
+
class: "a_input__icon_prepend",
|
|
414
|
+
}),
|
|
415
|
+
h("input", {
|
|
416
|
+
ref: "inputRef",
|
|
417
|
+
id: this.htmlIdLocal,
|
|
418
|
+
key: `${ this.htmlIdLocal }_${ this.typeForInput }`,
|
|
419
|
+
autocomplete: this.autocomplete,
|
|
420
|
+
value: this.modelValueLocal,
|
|
421
|
+
type: this.typeForInput,
|
|
422
|
+
class: [
|
|
423
|
+
"a_form_control a_input",
|
|
424
|
+
this.inputClass,
|
|
425
|
+
this.inputClassBtns,
|
|
426
|
+
{
|
|
427
|
+
a_form_control_invalid: this.isErrors,
|
|
428
|
+
},
|
|
429
|
+
],
|
|
430
|
+
disabled: this.disabledAttribut,
|
|
431
|
+
ariaRequired: this.required,
|
|
432
|
+
ariaInvalid: this.isErrors,
|
|
433
|
+
"aria-describedby": this.ariaDescribedbyLocal,
|
|
434
|
+
maxlength: this.maxlength,
|
|
435
|
+
step: this.step,
|
|
436
|
+
...this.placeholderAttributes,
|
|
437
|
+
...this.inputAttributes,
|
|
438
|
+
onInput: this.onInput,
|
|
439
|
+
onFocus: this.onFocus,
|
|
440
|
+
onBlur: this.onBlur,
|
|
441
|
+
}),
|
|
442
|
+
(this.isBtnShowPasswordVisible || this.isClearButtonLocal) ?
|
|
443
|
+
h("div", {
|
|
444
|
+
class: "a_form_control__actions",
|
|
445
|
+
}, [
|
|
446
|
+
this.isBtnShowPasswordVisible ?
|
|
447
|
+
h(AButton, {
|
|
448
|
+
alwaysTranslate: this.alwaysTranslate,
|
|
449
|
+
class: "a_btn a_btn_transparent_dark a_btn_small a_form_control__actions__btn",
|
|
450
|
+
iconLeft: this.iconBtnShowPassword,
|
|
451
|
+
type: "button",
|
|
452
|
+
title: this.titleBtnShowPassword,
|
|
453
|
+
textScreenReader: this.titleBtnShowPassword,
|
|
454
|
+
disabled: this.disabled,
|
|
455
|
+
onClick: this.toggleTypePassword,
|
|
456
|
+
}) :
|
|
457
|
+
"",
|
|
458
|
+
this.isClearButtonLocal ?
|
|
459
|
+
h(AFormElementBtnClear, {
|
|
460
|
+
alwaysTranslate: this.alwaysTranslate,
|
|
461
|
+
disabled: this.disabled,
|
|
462
|
+
class: this.clearButtonClass,
|
|
463
|
+
onClear: this.clearModel,
|
|
464
|
+
}) :
|
|
465
|
+
"",
|
|
466
|
+
]) :
|
|
467
|
+
"",
|
|
468
|
+
]),
|
|
469
|
+
h(AFormHelpText, {
|
|
470
|
+
id: this.helpTextId,
|
|
471
|
+
alwaysTranslate: this.alwaysTranslate,
|
|
472
|
+
html: this.helpText,
|
|
473
|
+
extra: this.extra,
|
|
474
|
+
}),
|
|
475
|
+
this.isErrors && h(AErrorsText, {
|
|
476
|
+
id: this.errorsId,
|
|
477
|
+
alwaysTranslate: this.alwaysTranslate,
|
|
478
|
+
errors: this.errors,
|
|
479
|
+
}),
|
|
480
|
+
]),
|
|
481
|
+
]);
|
|
482
|
+
},
|
|
483
|
+
};
|