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