@eturnity/eturnity_reusable_components 7.24.3-EPDM-11250.0 → 7.24.3-EPDM-11320.0
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/.eslintrc.js +125 -0
- package/package.json +6 -20
- package/src/App.vue +75 -70
- package/src/components/addNewButton/index.vue +24 -27
- package/src/components/banner/actionBanner/index.vue +32 -30
- package/src/components/banner/banner/index.vue +88 -80
- package/src/components/banner/infoBanner/index.vue +36 -44
- package/src/components/buttons/buttonIcon/index.vue +83 -78
- package/src/components/buttons/closeButton/index.vue +26 -26
- package/src/components/buttons/mainButton/index.vue +80 -76
- package/src/components/card/index.vue +56 -52
- package/src/components/collapsableInfoText/index.vue +81 -76
- package/src/components/deleteIcon/index.vue +31 -28
- package/src/components/draggableInputHandle/index.vue +20 -17
- package/src/components/dropdown/Dropdown.stories.js +8 -8
- package/src/components/dropdown/index.vue +75 -72
- package/src/components/errorMessage/index.vue +23 -23
- package/src/components/filter/filterSettings.vue +349 -329
- package/src/components/filter/index.vue +130 -130
- package/src/components/filter/parentDropdown.vue +43 -40
- package/src/components/icon/Icons.stories.js +4 -4
- package/src/components/icon/iconCache.js +1 -1
- package/src/components/icon/iconCollection.vue +40 -37
- package/src/components/icon/index.vue +72 -65
- package/src/components/iconWrapper/index.vue +122 -118
- package/src/components/infoCard/index.vue +20 -17
- package/src/components/infoText/index.vue +88 -82
- package/src/components/inputs/checkbox/index.vue +91 -94
- package/src/components/inputs/inputNumber/index.vue +508 -488
- package/src/components/inputs/inputNumberQuestion/index.vue +127 -124
- package/src/components/inputs/inputText/index.vue +265 -252
- package/src/components/inputs/radioButton/index.vue +135 -120
- package/src/components/inputs/searchInput/index.vue +84 -81
- package/src/components/inputs/select/index.vue +644 -631
- package/src/components/inputs/select/option/index.vue +91 -91
- package/src/components/inputs/select/select.stories.js +7 -7
- package/src/components/inputs/slider/index.vue +46 -46
- package/src/components/inputs/switchField/index.vue +159 -152
- package/src/components/inputs/textAreaInput/index.vue +120 -113
- package/src/components/inputs/toggle/index.vue +137 -127
- package/src/components/label/index.vue +64 -61
- package/src/components/markerItem/index.vue +40 -40
- package/src/components/modals/actionModal/index.vue +32 -29
- package/src/components/modals/infoModal/index.vue +34 -27
- package/src/components/modals/modal/index.vue +88 -80
- package/src/components/navigationTabs/index.vue +50 -47
- package/src/components/pageSubtitle/index.vue +33 -29
- package/src/components/pageTitle/index.vue +47 -39
- package/src/components/pagination/index.vue +64 -62
- package/src/components/progressBar/index.vue +70 -67
- package/src/components/projectMarker/index.vue +172 -163
- package/src/components/rangeSlider/Slider.vue +449 -449
- package/src/components/rangeSlider/index.vue +282 -270
- package/src/components/rangeSlider/utils/dom.js +3 -3
- package/src/components/selectedOptions/index.vue +51 -51
- package/src/components/sideMenu/index.vue +117 -109
- package/src/components/spinner/index.vue +37 -34
- package/src/components/tableDropdown/index.vue +343 -326
- package/src/components/tables/mainTable/index.vue +109 -106
- package/src/components/tables/viewTable/index.vue +105 -92
- package/src/components/threeDots/index.vue +174 -171
- package/src/components/videoThumbnail/index.vue +67 -59
- package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
- package/src/helpers/numberConverter.js +1 -3
- package/src/helpers/translateLang.js +10 -13
- package/.prettierrc +0 -7
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
@@ -1,98 +1,111 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
:
|
5
|
-
:
|
2
|
+
<Container>
|
3
|
+
<InputWrapper
|
4
|
+
:align-items="alignItems"
|
5
|
+
:has-label="!!label && label.length > 0"
|
6
6
|
>
|
7
|
-
<
|
8
|
-
<
|
9
|
-
:labelFontColor="labelFontColor"
|
10
|
-
:fontSize="fontSize"
|
7
|
+
<LabelWrapper v-if="label">
|
8
|
+
<InputLabel
|
11
9
|
:data-id="labelDataId"
|
12
|
-
|
13
|
-
|
14
|
-
>({{ $gettext('Optional') }})</optionalLabel
|
15
|
-
></input-label
|
10
|
+
:font-size="fontSize"
|
11
|
+
:label-font-color="labelFontColor"
|
16
12
|
>
|
17
|
-
|
13
|
+
{{ label }}
|
14
|
+
<OptionalLabel v-if="labelOptional">
|
15
|
+
({{ $gettext('Optional') }})
|
16
|
+
</OptionalLabel>
|
17
|
+
</InputLabel>
|
18
|
+
<InfoText
|
18
19
|
v-if="infoTextMessage"
|
19
|
-
:
|
20
|
+
:align-arrow="infoTextAlign"
|
20
21
|
:size="fontSize ? fontSize : '16px'"
|
21
|
-
:
|
22
|
+
:text="infoTextMessage"
|
22
23
|
/>
|
23
|
-
</
|
24
|
-
<
|
25
|
-
<
|
26
|
-
<
|
24
|
+
</LabelWrapper>
|
25
|
+
<InputErrorWrapper>
|
26
|
+
<IconContainer>
|
27
|
+
<InputContainer
|
27
28
|
ref="inputElement"
|
29
|
+
:background-color="backgroundColor"
|
30
|
+
:data-id="inputDataId"
|
31
|
+
:disabled="disabled"
|
32
|
+
:disabled-background-color="disabledBackgroundColor"
|
33
|
+
:font-color="fontColor"
|
34
|
+
:font-size="fontSize"
|
35
|
+
:has-focus="hasFocus"
|
36
|
+
:input-height="inputHeight"
|
37
|
+
:input-type="inputType"
|
38
|
+
:input-width="inputWidth"
|
39
|
+
:is-disabled="disabled"
|
40
|
+
:is-error="hasError"
|
41
|
+
:min-width="minWidth"
|
42
|
+
:no-border="noBorder"
|
28
43
|
:placeholder="placeholder"
|
29
|
-
:
|
30
|
-
:inputWidth="inputWidth"
|
31
|
-
:minWidth="minWidth"
|
32
|
-
:inputHeight="inputHeight"
|
44
|
+
:type="inputTypeData"
|
33
45
|
:value="value"
|
34
|
-
@input="onChangeHandler"
|
35
46
|
@blur="onInputBlur"
|
47
|
+
@input="onChangeHandler"
|
36
48
|
@keyup.enter="onEnterPress"
|
37
|
-
:noBorder="noBorder"
|
38
|
-
:disabled="disabled"
|
39
|
-
:isDisabled="disabled"
|
40
|
-
:fontSize="fontSize"
|
41
|
-
:inputType="inputType"
|
42
|
-
:type="inputTypeData"
|
43
|
-
:fontColor="fontColor"
|
44
|
-
:hasFocus="hasFocus"
|
45
|
-
:backgroundColor="backgroundColor"
|
46
|
-
:disabledBackgroundColor="disabledBackgroundColor"
|
47
|
-
:data-id="inputDataId"
|
48
49
|
/>
|
49
|
-
<
|
50
|
+
<IconWrapper
|
50
51
|
v-if="inputType === 'password' && !isError"
|
51
|
-
@click="toggleShowPassword()"
|
52
52
|
size="20px"
|
53
|
+
@click="toggleShowPassword()"
|
54
|
+
>
|
55
|
+
<Icon
|
56
|
+
name="current_variant"
|
57
|
+
size="20px"
|
58
|
+
/>
|
59
|
+
</IconWrapper>
|
60
|
+
<IconWrapper
|
61
|
+
v-if="hasError"
|
62
|
+
size="16px"
|
53
63
|
>
|
54
|
-
<
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
64
|
+
<Icon
|
65
|
+
cursor="default"
|
66
|
+
name="warning"
|
67
|
+
size="16px"
|
68
|
+
/>
|
69
|
+
</IconWrapper>
|
70
|
+
</IconContainer>
|
71
|
+
<ErrorMessage v-if="hasError && hasErrorMessage">
|
72
|
+
{{
|
73
|
+
dynamicErrorMessage
|
74
|
+
}}
|
75
|
+
</ErrorMessage>
|
76
|
+
</InputErrorWrapper>
|
77
|
+
</InputWrapper>
|
78
|
+
</Container>
|
66
79
|
</template>
|
67
80
|
|
68
81
|
<script>
|
69
|
-
import styled from 'vue3-styled-components'
|
70
|
-
import InfoText from '../../infoText'
|
71
|
-
import Icon from '../../icon'
|
72
|
-
import ErrorMessage from '../../errorMessage'
|
73
|
-
import InputValidations from '../../../mixins/inputValidations.js'
|
82
|
+
import styled from 'vue3-styled-components'
|
83
|
+
import InfoText from '../../infoText'
|
84
|
+
import Icon from '../../icon'
|
85
|
+
import ErrorMessage from '../../errorMessage'
|
86
|
+
import InputValidations from '../../../mixins/inputValidations.js'
|
74
87
|
|
75
|
-
const Container = styled.div`
|
88
|
+
const Container = styled.div`
|
76
89
|
width: 100%;
|
77
90
|
position: relative;
|
78
91
|
`
|
79
92
|
|
80
|
-
const labelAttrs = { fontSize: String, labelFontColor: String }
|
81
|
-
const InputLabel = styled('div', labelAttrs)`
|
93
|
+
const labelAttrs = { fontSize: String, labelFontColor: String }
|
94
|
+
const InputLabel = styled('div', labelAttrs)`
|
82
95
|
color: ${(props) =>
|
83
96
|
props.theme.colors[props.labelFontColor]
|
84
97
|
? props.theme.colors[props.labelFontColor]
|
85
98
|
: props.labelFontColor
|
86
99
|
? props.labelFontColor
|
87
|
-
|
100
|
+
: props.theme.colors.eturnityGrey};
|
88
101
|
|
89
102
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
90
103
|
font-weight: 700;
|
91
104
|
`
|
92
|
-
const optionalLabel = styled.span`
|
105
|
+
const optionalLabel = styled.span`
|
93
106
|
font-weight: 300;
|
94
107
|
`
|
95
|
-
const LabelWrapper = styled.div`
|
108
|
+
const LabelWrapper = styled.div`
|
96
109
|
display: inline-grid;
|
97
110
|
grid-template-columns: auto auto;
|
98
111
|
grid-gap: 12px;
|
@@ -100,28 +113,28 @@ const LabelWrapper = styled.div`
|
|
100
113
|
justify-content: start;
|
101
114
|
`
|
102
115
|
|
103
|
-
const InputErrorWrapper = styled.div`
|
116
|
+
const InputErrorWrapper = styled.div`
|
104
117
|
display: inline-grid;
|
105
118
|
grid-template-row: auto auto;
|
106
119
|
grid-gap: 0px;
|
107
120
|
align-items: center;
|
108
121
|
`
|
109
122
|
|
110
|
-
const inputProps = {
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
}
|
124
|
-
const InputContainer = styled('input', inputProps)`
|
123
|
+
const inputProps = {
|
124
|
+
isError: Boolean,
|
125
|
+
inputWidth: String,
|
126
|
+
minWidth: String,
|
127
|
+
noBorder: Boolean,
|
128
|
+
isDisabled: Boolean,
|
129
|
+
fontSize: String,
|
130
|
+
inputType: String,
|
131
|
+
fontColor: String,
|
132
|
+
backgroundColor: String,
|
133
|
+
borderColor: String,
|
134
|
+
inputHeight: String,
|
135
|
+
disabledBackgroundColor: String
|
136
|
+
}
|
137
|
+
const InputContainer = styled('input', inputProps)`
|
125
138
|
border: ${(props) =>
|
126
139
|
props.isError
|
127
140
|
? '1px solid ' + props.theme.colors.red
|
@@ -131,13 +144,13 @@ const InputContainer = styled('input', inputProps)`
|
|
131
144
|
? props.theme.colors[props.borderColor]
|
132
145
|
? '1px solid ' + props.theme.colors[props.borderColor]
|
133
146
|
: '1px solid ' + props.borderColor
|
134
|
-
|
147
|
+
: '1px solid ' + props.theme.colors.grey4};
|
135
148
|
padding: ${(props) =>
|
136
149
|
props.isError
|
137
150
|
? '11px 25px 11px 10px'
|
138
151
|
: props.inputType === 'password'
|
139
152
|
? '11px 25px 11px 10px'
|
140
|
-
|
153
|
+
: '11px 5px 11px 10px'};
|
141
154
|
border-radius: 4px;
|
142
155
|
position: relative;
|
143
156
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
@@ -148,7 +161,7 @@ const InputContainer = styled('input', inputProps)`
|
|
148
161
|
? props.theme.colors.grey2
|
149
162
|
: props.fontColor
|
150
163
|
? props.fontColor + ' !important'
|
151
|
-
|
164
|
+
: props.theme.colors.black};
|
152
165
|
|
153
166
|
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
154
167
|
min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
|
@@ -163,7 +176,7 @@ const InputContainer = styled('input', inputProps)`
|
|
163
176
|
: props.theme.colors.grey5
|
164
177
|
: props.backgroundColor
|
165
178
|
? props.backgroundColor + ' !important'
|
166
|
-
|
179
|
+
: props.theme.colors.white};
|
167
180
|
&::placeholder {
|
168
181
|
color: ${(props) => props.theme.colors.grey2};
|
169
182
|
}
|
@@ -173,18 +186,18 @@ const InputContainer = styled('input', inputProps)`
|
|
173
186
|
}
|
174
187
|
`
|
175
188
|
|
176
|
-
const inputAttrs = { alignItems: String, hasLabel: Boolean }
|
177
|
-
const InputWrapper = styled('div', inputAttrs)`
|
189
|
+
const inputAttrs = { alignItems: String, hasLabel: Boolean }
|
190
|
+
const InputWrapper = styled('div', inputAttrs)`
|
178
191
|
position: relative;
|
179
192
|
display: grid;
|
180
193
|
align-items: center;
|
181
194
|
gap: 8px;
|
182
195
|
grid-template-columns: ${(props) =>
|
183
|
-
|
196
|
+
props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
|
184
197
|
`
|
185
198
|
|
186
|
-
const IconAttrs = { size: String }
|
187
|
-
const IconWrapper = styled('div', IconAttrs)`
|
199
|
+
const IconAttrs = { size: String }
|
200
|
+
const IconWrapper = styled('div', IconAttrs)`
|
188
201
|
position: absolute;
|
189
202
|
top: 0;
|
190
203
|
bottom: 0;
|
@@ -193,183 +206,183 @@ const IconWrapper = styled('div', IconAttrs)`
|
|
193
206
|
height: ${(props) => (props.size ? props.size : 'auto')};
|
194
207
|
`
|
195
208
|
|
196
|
-
const IconContainer = styled.div`
|
209
|
+
const IconContainer = styled.div`
|
197
210
|
position: relative;
|
198
211
|
`
|
199
212
|
|
200
|
-
export default {
|
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
|
-
mixins: [InputValidations],
|
234
|
-
data() {
|
235
|
-
return {
|
236
|
-
inputTypeData: 'text'
|
237
|
-
}
|
238
|
-
},
|
239
|
-
computed: {
|
240
|
-
hasError() {
|
241
|
-
return this.isError || this.error
|
242
|
-
},
|
243
|
-
hasErrorMessage() {
|
244
|
-
return (
|
245
|
-
(this.errorMessage && this.errorMessage.length > 0) || this.errMessage
|
246
|
-
)
|
247
|
-
},
|
248
|
-
dynamicErrorMessage() {
|
249
|
-
return this.errMessage || this.errorMessage
|
250
|
-
}
|
251
|
-
},
|
252
|
-
props: {
|
253
|
-
placeholder: {
|
254
|
-
required: false,
|
255
|
-
default: ''
|
256
|
-
},
|
257
|
-
alignItems: {
|
258
|
-
required: false,
|
259
|
-
default: 'horizontal'
|
260
|
-
},
|
261
|
-
isError: {
|
262
|
-
required: false,
|
263
|
-
default: false
|
264
|
-
},
|
265
|
-
inputWidth: {
|
266
|
-
required: false,
|
267
|
-
default: null
|
268
|
-
},
|
269
|
-
inputHeight: {
|
270
|
-
required: false,
|
271
|
-
default: null
|
213
|
+
export default {
|
214
|
+
// import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
|
215
|
+
// To use:
|
216
|
+
// <input-text
|
217
|
+
// placeholder="Company name"
|
218
|
+
// :value="companyName"
|
219
|
+
// @input-change="onInputChange({ value: $event, type: 'companyName' })"
|
220
|
+
// @input-blur="onInputBlur($event)"
|
221
|
+
// :isError="checkErrors()"
|
222
|
+
// :errorMessage="This is my error message"
|
223
|
+
// infoTextAlign="right" // left by default
|
224
|
+
// infoTextMessage="My info message"
|
225
|
+
// label="Question 5"
|
226
|
+
// alignItems="horizontal" // horizontal, vertical
|
227
|
+
// inputWidth="250px"
|
228
|
+
// minWidth="100px"
|
229
|
+
// fontSize="13px"
|
230
|
+
// />
|
231
|
+
name: 'InputText',
|
232
|
+
components: {
|
233
|
+
Container,
|
234
|
+
InputContainer,
|
235
|
+
InputWrapper,
|
236
|
+
ErrorMessage,
|
237
|
+
InfoText,
|
238
|
+
InputLabel,
|
239
|
+
LabelWrapper,
|
240
|
+
Icon,
|
241
|
+
IconWrapper,
|
242
|
+
IconContainer,
|
243
|
+
InputErrorWrapper,
|
244
|
+
optionalLabel
|
272
245
|
},
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
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
|
-
|
246
|
+
mixins: [InputValidations],
|
247
|
+
props: {
|
248
|
+
placeholder: {
|
249
|
+
required: false,
|
250
|
+
default: ''
|
251
|
+
},
|
252
|
+
alignItems: {
|
253
|
+
required: false,
|
254
|
+
default: 'horizontal'
|
255
|
+
},
|
256
|
+
isError: {
|
257
|
+
required: false,
|
258
|
+
default: false
|
259
|
+
},
|
260
|
+
inputWidth: {
|
261
|
+
required: false,
|
262
|
+
default: null
|
263
|
+
},
|
264
|
+
inputHeight: {
|
265
|
+
required: false,
|
266
|
+
default: null
|
267
|
+
},
|
268
|
+
minWidth: {
|
269
|
+
required: false,
|
270
|
+
default: null
|
271
|
+
},
|
272
|
+
value: {
|
273
|
+
required: true,
|
274
|
+
default: null
|
275
|
+
},
|
276
|
+
errorMessage: {
|
277
|
+
required: false,
|
278
|
+
default: ''
|
279
|
+
},
|
280
|
+
infoTextMessage: {
|
281
|
+
required: false
|
282
|
+
},
|
283
|
+
infoTextAlign: {
|
284
|
+
required: false
|
285
|
+
},
|
286
|
+
label: {
|
287
|
+
required: false
|
288
|
+
},
|
289
|
+
labelOptional: {
|
290
|
+
required: false,
|
291
|
+
default: false
|
292
|
+
},
|
293
|
+
noBorder: {
|
294
|
+
required: false,
|
295
|
+
default: false
|
296
|
+
},
|
297
|
+
disabled: {
|
298
|
+
required: false,
|
299
|
+
default: false
|
300
|
+
},
|
301
|
+
fontSize: {
|
302
|
+
required: false,
|
303
|
+
default: null
|
304
|
+
},
|
305
|
+
inputType: {
|
306
|
+
required: false,
|
307
|
+
default: 'text'
|
308
|
+
},
|
309
|
+
labelFontColor: {
|
310
|
+
required: false,
|
311
|
+
default: 'black'
|
312
|
+
},
|
313
|
+
backgroundColor: {
|
314
|
+
required: false
|
315
|
+
},
|
316
|
+
disabledBackgroundColor: {
|
317
|
+
required: false,
|
318
|
+
default: null
|
319
|
+
},
|
320
|
+
fontColor: {
|
321
|
+
required: false,
|
322
|
+
default: 'black'
|
323
|
+
},
|
324
|
+
hasFocus: {
|
325
|
+
required: false,
|
326
|
+
default: false
|
327
|
+
},
|
328
|
+
borderColor: {
|
329
|
+
required: false
|
330
|
+
},
|
331
|
+
labelDataId: {
|
332
|
+
required: false,
|
333
|
+
default: ''
|
334
|
+
},
|
335
|
+
inputDataId: {
|
336
|
+
required: false,
|
337
|
+
default: ''
|
338
|
+
}
|
335
339
|
},
|
336
|
-
|
337
|
-
|
338
|
-
|
340
|
+
data() {
|
341
|
+
return {
|
342
|
+
inputTypeData: 'text'
|
343
|
+
}
|
339
344
|
},
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
345
|
+
computed: {
|
346
|
+
hasError() {
|
347
|
+
return this.isError || this.error
|
348
|
+
},
|
349
|
+
hasErrorMessage() {
|
350
|
+
return (
|
351
|
+
(this.errorMessage && this.errorMessage.length > 0) || this.errMessage
|
352
|
+
)
|
353
|
+
},
|
354
|
+
dynamicErrorMessage() {
|
355
|
+
return this.errMessage || this.errorMessage
|
356
|
+
}
|
349
357
|
},
|
350
|
-
|
351
|
-
|
358
|
+
watch: {
|
359
|
+
hasFocus(newVal) {
|
360
|
+
if (newVal) {
|
361
|
+
this.$nextTick(() => {
|
362
|
+
this.$refs.inputElement.$el.focus()
|
363
|
+
})
|
364
|
+
}
|
365
|
+
}
|
352
366
|
},
|
353
|
-
|
354
|
-
this.
|
355
|
-
this.$emit('input-blur', $event.target.value)
|
367
|
+
created() {
|
368
|
+
this.inputTypeData = this.inputType
|
356
369
|
},
|
357
|
-
|
358
|
-
|
359
|
-
this
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
370
|
+
methods: {
|
371
|
+
onEnterPress() {
|
372
|
+
this.$emit('on-enter-click')
|
373
|
+
this.$refs.inputElement.$el.blur()
|
374
|
+
},
|
375
|
+
onChangeHandler(event) {
|
376
|
+
this.$emit('input-change', event.target.value)
|
377
|
+
},
|
378
|
+
onInputBlur($event) {
|
379
|
+
this.validateInput($event.target.value)
|
380
|
+
this.$emit('input-blur', $event.target.value)
|
381
|
+
},
|
382
|
+
toggleShowPassword() {
|
383
|
+
this.inputTypeData =
|
384
|
+
this.inputTypeData === 'password' ? 'text' : 'password'
|
371
385
|
}
|
372
386
|
}
|
373
387
|
}
|
374
|
-
}
|
375
388
|
</script>
|