@eturnity/eturnity_reusable_components 7.24.3-EPDM-10576.1 → 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.
Files changed (66) hide show
  1. package/.eslintrc.js +125 -0
  2. package/package.json +6 -20
  3. package/src/App.vue +75 -70
  4. package/src/components/addNewButton/index.vue +24 -27
  5. package/src/components/banner/actionBanner/index.vue +32 -30
  6. package/src/components/banner/banner/index.vue +88 -80
  7. package/src/components/banner/infoBanner/index.vue +36 -44
  8. package/src/components/buttons/buttonIcon/index.vue +83 -78
  9. package/src/components/buttons/closeButton/index.vue +26 -26
  10. package/src/components/buttons/mainButton/index.vue +80 -76
  11. package/src/components/card/index.vue +56 -52
  12. package/src/components/collapsableInfoText/index.vue +81 -76
  13. package/src/components/deleteIcon/index.vue +31 -28
  14. package/src/components/draggableInputHandle/index.vue +20 -17
  15. package/src/components/dropdown/Dropdown.stories.js +8 -8
  16. package/src/components/dropdown/index.vue +75 -72
  17. package/src/components/errorMessage/index.vue +23 -23
  18. package/src/components/filter/filterSettings.vue +349 -333
  19. package/src/components/filter/index.vue +130 -130
  20. package/src/components/filter/parentDropdown.vue +43 -40
  21. package/src/components/icon/Icons.stories.js +4 -4
  22. package/src/components/icon/iconCache.js +1 -1
  23. package/src/components/icon/iconCollection.vue +40 -37
  24. package/src/components/icon/index.vue +72 -65
  25. package/src/components/iconWrapper/index.vue +122 -118
  26. package/src/components/infoCard/index.vue +20 -17
  27. package/src/components/infoText/index.vue +88 -82
  28. package/src/components/inputs/checkbox/index.vue +91 -94
  29. package/src/components/inputs/inputNumber/index.vue +508 -488
  30. package/src/components/inputs/inputNumberQuestion/index.vue +127 -124
  31. package/src/components/inputs/inputText/index.vue +265 -252
  32. package/src/components/inputs/radioButton/index.vue +135 -120
  33. package/src/components/inputs/searchInput/index.vue +84 -81
  34. package/src/components/inputs/select/index.vue +644 -631
  35. package/src/components/inputs/select/option/index.vue +91 -91
  36. package/src/components/inputs/select/select.stories.js +7 -7
  37. package/src/components/inputs/slider/index.vue +46 -46
  38. package/src/components/inputs/switchField/index.vue +159 -152
  39. package/src/components/inputs/textAreaInput/index.vue +120 -113
  40. package/src/components/inputs/toggle/index.vue +137 -127
  41. package/src/components/label/index.vue +64 -61
  42. package/src/components/markerItem/index.vue +40 -40
  43. package/src/components/modals/actionModal/index.vue +32 -29
  44. package/src/components/modals/infoModal/index.vue +34 -27
  45. package/src/components/modals/modal/index.vue +88 -80
  46. package/src/components/navigationTabs/index.vue +50 -47
  47. package/src/components/pageSubtitle/index.vue +33 -29
  48. package/src/components/pageTitle/index.vue +47 -39
  49. package/src/components/pagination/index.vue +64 -62
  50. package/src/components/progressBar/index.vue +70 -67
  51. package/src/components/projectMarker/index.vue +172 -163
  52. package/src/components/rangeSlider/Slider.vue +449 -449
  53. package/src/components/rangeSlider/index.vue +282 -270
  54. package/src/components/rangeSlider/utils/dom.js +3 -3
  55. package/src/components/selectedOptions/index.vue +51 -51
  56. package/src/components/sideMenu/index.vue +117 -109
  57. package/src/components/spinner/index.vue +37 -34
  58. package/src/components/tableDropdown/index.vue +343 -326
  59. package/src/components/tables/mainTable/index.vue +109 -106
  60. package/src/components/tables/viewTable/index.vue +105 -92
  61. package/src/components/threeDots/index.vue +174 -171
  62. package/src/components/videoThumbnail/index.vue +67 -59
  63. package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
  64. package/.prettierrc +0 -7
  65. package/public/favicon.ico +0 -0
  66. package/public/index.html +0 -17
@@ -1,98 +1,111 @@
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()"
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
- <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>
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
- : props.theme.colors.eturnityGrey};
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
- 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)`
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
- : '1px solid ' + props.theme.colors.grey4};
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
- : '11px 5px 11px 10px'};
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
- : props.theme.colors.black};
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
- : props.theme.colors.white};
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
- props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
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
- // 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
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
- 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'
328
- },
329
- hasFocus: {
330
- required: false,
331
- default: false
332
- },
333
- borderColor: {
334
- required: false
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
- labelDataId: {
337
- required: false,
338
- default: ''
340
+ data() {
341
+ return {
342
+ inputTypeData: 'text'
343
+ }
339
344
  },
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()
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
- onChangeHandler(event) {
351
- this.$emit('input-change', event.target.value)
358
+ watch: {
359
+ hasFocus(newVal) {
360
+ if (newVal) {
361
+ this.$nextTick(() => {
362
+ this.$refs.inputElement.$el.focus()
363
+ })
364
+ }
365
+ }
352
366
  },
353
- onInputBlur($event) {
354
- this.validateInput($event.target.value)
355
- this.$emit('input-blur', $event.target.value)
367
+ created() {
368
+ this.inputTypeData = this.inputType
356
369
  },
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
- })
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>