@eturnity/eturnity_reusable_components 7.48.1-EPDM-12680.10 → 7.48.1-EPDM-10964.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.
@@ -13,11 +13,7 @@
13
13
  </LabelSlotWrapper>
14
14
 
15
15
  <LabelWrapper v-if="labelText">
16
- <LabelText
17
- :data-id="labelDataId"
18
- :label-font-color="labelFontColor"
19
- :label-font-weight="labelFontWeight"
20
- >
16
+ <LabelText :data-id="labelDataId" :label-font-color="labelFontColor">
21
17
  {{ labelText }}
22
18
  </LabelText>
23
19
 
@@ -32,14 +28,11 @@
32
28
  v-bind="$attrs"
33
29
  ref="inputField1"
34
30
  :align-items="alignItems"
35
- :background-color="
36
- colorMode === 'transparent' ? 'transparent' : backgroundColor
37
- "
38
- :border-color="colorMode === 'transparent' ? 'white' : borderColor"
39
- :color-mode="colorMode"
31
+ :background-color="backgroundColor"
32
+ :border-color="borderColor"
40
33
  :data-id="inputDataId"
41
34
  :disabled="disabled"
42
- :font-color="colorMode === 'transparent' ? 'white' : fontColor"
35
+ :font-color="fontColor"
43
36
  :font-size="fontSize"
44
37
  :has-label-slot="hasLabelSlot"
45
38
  :has-slot="hasSlot"
@@ -58,8 +51,6 @@
58
51
  @blur="onInputBlur($event)"
59
52
  @focus="focusInput()"
60
53
  @input="onInput($event)"
61
- @keydown.down="decrementValue"
62
- @keydown.up="incrementValue"
63
54
  @keyup.enter="onEnterPress"
64
55
  />
65
56
  <SlotContainer v-if="hasSlot" :is-error="isError" :slot-size="slotSize">
@@ -101,31 +92,6 @@
101
92
  </template>
102
93
  </RCSelect>
103
94
  </SelectWrapper>
104
-
105
- <ArrowControls
106
- v-if="!disabled && showArrowControls"
107
- :color-mode="colorMode"
108
- >
109
- <ArrowButton @click="incrementValue">
110
- <Icon
111
- :color="colorMode === 'transparent' ? 'white' : undefined"
112
- name="arrow_up"
113
- size="8px"
114
- />
115
- </ArrowButton>
116
- <ArrowDivider :color-mode="colorMode" />
117
- <ArrowButton
118
- :is-disabled="textInput <= minNumber"
119
- @click="decrementValue"
120
- >
121
- <Icon
122
- :color="colorMode === 'transparent' ? 'white' : undefined"
123
- :disabled="textInput <= minNumber"
124
- name="arrow_down"
125
- size="8px"
126
- />
127
- </ArrowButton>
128
- </ArrowControls>
129
95
  </InputWrapper>
130
96
  <ErrorMessage v-if="isError">{{ errorMessage }}</ErrorMessage>
131
97
  </Container>
@@ -157,7 +123,6 @@
157
123
  // labelInfoAlign="left"
158
124
  // :minNumber="0"
159
125
  // fontColor="blue"
160
- // colorMode="transparent" // Makes background transparent, border white, and font white
161
126
  // >
162
127
  //<template name=label><img>....</template>
163
128
  //</inputNumber>
@@ -191,10 +156,8 @@
191
156
  isInteractive: Boolean,
192
157
  alignItems: String,
193
158
  labelFontColor: String,
194
- labelFontWeight: String,
195
159
  borderColor: String,
196
160
  showLinearUnitName: Boolean,
197
- colorMode: String,
198
161
  }
199
162
 
200
163
  const Container = styled('div', inputProps)`
@@ -218,18 +181,15 @@
218
181
  : '1px solid ' + props.theme.colors.grey4};
219
182
  height: ${(props) => props.inputHeight};
220
183
  max-height: ${(props) => props.inputHeight};
221
- padding: ${({ colorMode }) =>
222
- colorMode === 'transparent' ? '10px 15px' : '0 10px'};
223
- padding-right: ${({ slotSize, isError, showLinearUnitName, colorMode }) =>
224
- colorMode === 'transparent'
225
- ? '0'
226
- : slotSize
184
+ padding: 0 10px;
185
+ padding-right: ${({ slotSize, isError, showLinearUnitName }) =>
186
+ slotSize
227
187
  ? isError && !showLinearUnitName
228
188
  ? 'calc(' + slotSize + ' + 24px)'
229
189
  : 'calc(' + slotSize + ' + 10px)'
230
190
  : isError && !showLinearUnitName
231
191
  ? '24px'
232
- : '40px'};
192
+ : '5px'};
233
193
  border-radius: ${(props) =>
234
194
  props.isInteractive && props.alignItems != 'vertical'
235
195
  ? '0 4px 4px 0'
@@ -246,16 +206,14 @@
246
206
  ? props.fontColor + ' !important'
247
207
  : props.theme.colors.black};
248
208
  background-color: ${(props) =>
249
- props.isDisabled
250
- ? props.theme.colors.disabled + ' !important'
251
- : props.backgroundColor
209
+ props.backgroundColor
252
210
  ? props.backgroundColor + ' !important'
253
211
  : props.theme.colors.white};
254
212
  width: ${(props) =>
255
213
  props.inputWidth && !props.hasLabelSlot ? props.inputWidth : '100%'};
256
214
  min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
257
215
  background-color: ${(props) =>
258
- props.isDisabled ? props.theme.colors.grey5 : props.theme.colors.white};
216
+ props.isDisabled ? props.theme.colors.grey5 : '#fff'};
259
217
  box-sizing: border-box;
260
218
 
261
219
  &::placeholder {
@@ -267,55 +225,6 @@
267
225
  }
268
226
  `
269
227
 
270
- const ArrowControlsProps = {
271
- colorMode: String,
272
- }
273
- const ArrowControls = styled('div', ArrowControlsProps)`
274
- position: absolute;
275
- right: 0;
276
- top: 0;
277
- bottom: 0;
278
- display: grid;
279
- grid-template-rows: 1fr auto 1fr;
280
- align-items: center;
281
- justify-items: center;
282
- cursor: pointer;
283
- width: 30px;
284
- background-color: ${(props) =>
285
- props.colorMode === 'transparent'
286
- ? 'transparent'
287
- : props.theme.colors.white};
288
- border-left: 1px solid
289
- ${(props) =>
290
- props.colorMode === 'transparent'
291
- ? props.theme.colors.white
292
- : props.theme.colors.black};
293
- `
294
-
295
- const ArrowButtonProps = {
296
- isDisabled: Boolean,
297
- }
298
- const ArrowButton = styled('button', ArrowButtonProps)`
299
- background: transparent;
300
- opacity: ${(props) => (props.isDisabled ? '0.2' : '1')};
301
- cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
302
- display: flex;
303
- align-items: center;
304
- justify-content: center;
305
- padding: 0;
306
- width: 100%;
307
- height: 100%;
308
- `
309
-
310
- const ArrowDivider = styled('div', ArrowControlsProps)`
311
- width: 100%;
312
- height: 1px;
313
- background-color: ${(props) =>
314
- props.colorMode === 'transparent'
315
- ? props.theme.colors.white
316
- : props.theme.colors.black};
317
- `
318
-
319
228
  const InputWrapper = styled.span`
320
229
  position: relative;
321
230
  `
@@ -398,7 +307,7 @@
398
307
  props.theme.colors[props.labelFontColor]
399
308
  ? props.theme.colors[props.labelFontColor]
400
309
  : props.labelFontColor};
401
- font-weight: ${(props) => props.labelFontWeight};
310
+ font-weight: 700;
402
311
  `
403
312
 
404
313
  const IconAttrs = { size: String, marginRight: Number }
@@ -450,184 +359,140 @@
450
359
  SelectWrapper,
451
360
  SelectText,
452
361
  Divider,
453
- ArrowControls,
454
- ArrowButton,
455
- ArrowDivider,
456
362
  },
457
363
  inheritAttrs: false,
458
364
  props: {
459
365
  placeholder: {
460
- type: String,
461
366
  required: false,
462
367
  default: '',
463
368
  },
464
369
  isError: {
465
- type: Boolean,
466
370
  required: false,
467
371
  default: false,
468
372
  },
469
373
  inputWidth: {
470
- type: String,
471
374
  required: false,
472
375
  default: null,
473
376
  },
474
377
  minWidth: {
475
- type: String,
476
378
  required: false,
477
379
  default: null,
478
380
  },
479
381
  inputHeight: {
480
- type: String,
481
382
  required: false,
482
383
  default: '40px',
483
384
  },
484
385
  value: {
485
- type: [String, Number],
486
386
  required: true,
487
387
  default: null,
488
388
  },
489
389
  clearInput: {
490
- type: Boolean,
491
390
  required: false,
492
391
  default: false,
493
392
  },
494
393
  alignItems: {
495
- type: String,
496
394
  required: false,
497
395
  default: 'vertical',
498
396
  },
499
397
  errorMessage: {
500
- type: String,
501
398
  required: false,
502
399
  default: 'Please insert a correct number',
503
400
  },
504
401
  numberPrecision: {
505
- type: Number,
506
402
  required: false,
507
403
  default: 0,
508
404
  },
509
405
  minDecimals: {
510
- type: Number,
511
406
  required: false,
512
407
  default: 0,
513
408
  },
514
409
  unitName: {
515
- type: String,
516
410
  required: false,
517
411
  default: '',
518
412
  },
519
413
  showLinearUnitName: {
520
- type: Boolean,
521
414
  required: false,
522
415
  default: false,
523
416
  },
524
417
  disabled: {
525
- type: Boolean,
526
418
  required: false,
527
419
  default: false,
528
420
  },
529
421
  noBorder: {
530
- type: Boolean,
531
422
  required: false,
532
423
  default: false,
533
424
  },
534
425
  borderColor: {
535
- type: String,
536
426
  required: false,
537
- default: null,
538
427
  },
539
428
  textAlign: {
540
- type: String,
541
429
  required: false,
542
430
  default: 'left',
543
431
  },
544
432
  fontSize: {
545
- type: String,
546
433
  required: false,
547
434
  default: '13px',
548
435
  },
549
436
  isInteractive: {
550
- type: Boolean,
551
437
  required: false,
552
438
  default: false,
553
439
  },
554
440
  interactionStep: {
555
- type: Number,
556
441
  required: false,
557
442
  default: 1,
558
443
  },
559
444
  labelText: {
560
- type: String,
561
445
  required: false,
562
446
  default: null,
563
447
  },
564
448
  labelInfoText: {
565
- type: String,
566
449
  required: false,
567
450
  default: null,
568
451
  },
569
452
  labelInfoAlign: {
570
- type: String,
571
453
  required: false,
572
454
  default: 'left',
573
455
  },
574
456
  defaultNumber: {
575
- type: Number,
576
457
  required: false,
577
458
  default: null,
578
459
  },
579
460
  minNumber: {
580
- type: Number,
581
461
  required: false,
582
462
  default: null,
583
463
  },
584
464
  fontColor: {
585
- type: String,
586
465
  required: false,
587
466
  default: null,
588
467
  },
589
468
  backgroundColor: {
590
- type: String,
591
469
  required: false,
592
470
  default: null,
593
471
  },
594
472
  numberToStringEnabled: {
595
- type: Boolean,
596
473
  required: false,
597
474
  default: true,
598
475
  },
599
476
  allowNegative: {
600
- type: Boolean,
601
477
  required: false,
602
478
  default: true,
603
479
  },
604
480
  slotSize: {
605
- type: String,
606
481
  required: false,
607
- default: null,
608
482
  },
609
483
  labelFontColor: {
610
- type: String,
611
484
  required: false,
612
485
  default: 'eturnityGrey',
613
486
  },
614
- labelFontWeight: {
615
- type: String,
616
- required: false,
617
- default: '700',
618
- },
619
487
  focus: {
620
- type: Boolean,
621
488
  required: false,
622
489
  default: false,
623
490
  },
624
491
  labelDataId: {
625
- type: String,
626
492
  required: false,
627
493
  default: '',
628
494
  },
629
495
  inputDataId: {
630
- type: String,
631
496
  required: false,
632
497
  default: '',
633
498
  },
@@ -651,14 +516,6 @@
651
516
  type: Boolean,
652
517
  default: false,
653
518
  },
654
- colorMode: {
655
- type: String,
656
- default: '',
657
- },
658
- showArrowControls: {
659
- type: Boolean,
660
- default: false,
661
- },
662
519
  },
663
520
  data() {
664
521
  return {
@@ -728,36 +585,6 @@
728
585
  }
729
586
  },
730
587
  methods: {
731
- incrementValue() {
732
- const currentValue = Math.max(
733
- parseFloat(this.textInput || 0),
734
- this.minNumber || 0
735
- )
736
- const newValue = currentValue + this.interactionStep
737
- this.textInput = numberToString({
738
- value: newValue,
739
- numberPrecision: this.numberPrecision,
740
- minDecimals: this.minDecimals,
741
- })
742
- this.$emit('on-input', newValue)
743
- this.$emit('input-change', newValue)
744
- },
745
- decrementValue() {
746
- const currentValue = Math.max(
747
- parseFloat(this.textInput || 0),
748
- this.minNumber || 0
749
- )
750
- const newValue = currentValue - this.interactionStep
751
- if (this.allowNegative || newValue >= 0) {
752
- this.textInput = numberToString({
753
- value: newValue,
754
- numberPrecision: this.numberPrecision,
755
- minDecimals: this.minDecimals,
756
- })
757
- this.$emit('on-input', newValue)
758
- this.$emit('input-change', newValue)
759
- }
760
- },
761
588
  onEnterPress() {
762
589
  this.$emit('on-enter-click')
763
590
  this.$refs.inputField1.$el.blur()
@@ -853,7 +680,6 @@
853
680
  this.$emit('on-input', evaluatedVal)
854
681
  }
855
682
  }
856
- this.textInput = evaluatedVal
857
683
  },
858
684
  onInputBlur(e) {
859
685
  this.isFocused = false
@@ -31,10 +31,8 @@
31
31
  <InputContainer
32
32
  ref="inputElement"
33
33
  :background-color="backgroundColor"
34
- :border-color="borderColor"
35
34
  :data-id="inputDataId"
36
35
  data-test-id="input"
37
- :default-padding="defaultPadding"
38
36
  :disabled="disabled"
39
37
  :disabled-background-color="disabledBackgroundColor"
40
38
  :font-color="fontColor"
@@ -66,13 +64,6 @@
66
64
  <IconWrapper v-if="hasError" data-test-id="error_wrapper" size="16px">
67
65
  <Icon cursor="default" name="warning" size="16px" />
68
66
  </IconWrapper>
69
- <IconWrapper
70
- v-if="iconName && !hasError && inputType !== 'password'"
71
- :default-padding="defaultPadding"
72
- size="16px"
73
- >
74
- <Icon color="white" cursor="default" :name="iconName" size="16px" />
75
- </IconWrapper>
76
67
  </IconContainer>
77
68
  <ErrorMessage
78
69
  v-if="hasError && hasErrorMessage"
@@ -140,7 +131,6 @@
140
131
  borderColor: String,
141
132
  inputHeight: String,
142
133
  disabledBackgroundColor: String,
143
- defaultPadding: Boolean,
144
134
  }
145
135
  const InputContainer = styled('input', inputProps)`
146
136
  border: ${(props) =>
@@ -158,8 +148,6 @@
158
148
  ? '11px 25px 11px 10px'
159
149
  : props.inputType === 'password'
160
150
  ? '11px 25px 11px 10px'
161
- : props.defaultPadding
162
- ? '10px 35px 10px 15px'
163
151
  : '11px 5px 11px 10px'};
164
152
  border-radius: 4px;
165
153
  position: relative;
@@ -206,13 +194,13 @@
206
194
  props.alignItems === 'vertical' || !props.hasLabel ? '1fr' : 'auto 1fr'};
207
195
  `
208
196
 
209
- const IconAttrs = { size: String, defaultPadding: Boolean }
197
+ const IconAttrs = { size: String }
210
198
  const IconWrapper = styled('div', IconAttrs)`
211
199
  position: absolute;
212
200
  top: 0;
213
201
  bottom: 0;
214
202
  margin: auto;
215
- right: ${(props) => (props.defaultPadding ? '15px' : '5px')};
203
+ right: 5px;
216
204
  height: ${(props) => (props.size ? props.size : 'auto')};
217
205
  `
218
206
 
@@ -376,15 +364,6 @@
376
364
  default: '',
377
365
  type: String,
378
366
  },
379
- iconName: {
380
- required: false,
381
- default: null,
382
- type: String,
383
- },
384
- defaultPadding: {
385
- required: false,
386
- default: false,
387
- },
388
367
  },
389
368
  data() {
390
369
  return {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <ComponentWrapper :color-mode="colorMode" :layout="layout">
2
+ <ComponentWrapper :layout="layout">
3
3
  <RadioWrapper
4
4
  v-for="(item, index) in options"
5
5
  :key="item.value"
@@ -7,9 +7,7 @@
7
7
  >
8
8
  <LabelContainer
9
9
  :checkmark-color="checkmarkColor"
10
- :color-mode="colorMode"
11
10
  :has-label="!!item.label"
12
- :has-slots="!!$slots[`input-${item.value}`]"
13
11
  :is-checked="selectedOption === item.value"
14
12
  :is-disabled="item.disabled"
15
13
  :size="size"
@@ -27,7 +25,6 @@
27
25
  <span class="checkmark"></span>
28
26
  <LabelText
29
27
  v-if="item.label"
30
- :color-mode="colorMode"
31
28
  :data-test-id="'radioLabel_' + item.value"
32
29
  :is-disabled="item.disabled"
33
30
  >
@@ -39,7 +36,6 @@
39
36
  size="16px"
40
37
  :text="item.infoText"
41
38
  />
42
- <slot :name="`input-${item.value}`"></slot>
43
39
  </LabelContainer>
44
40
  <ImageContainer v-if="item.img">
45
41
  <RadioImage
@@ -99,14 +95,12 @@
99
95
 
100
96
  const wrapperProps = {
101
97
  layout: String,
102
- colorMode: String,
103
98
  }
104
99
  const ComponentWrapper = styled('div', wrapperProps)`
105
100
  display: flex;
106
101
  flex-direction: ${(props) =>
107
102
  props.layout === 'vertical' ? 'column' : 'row'};
108
- grid-gap: ${(props) =>
109
- props.colorMode === 'transparent' ? '16px 5px' : '10px 5px'};
103
+ grid-gap: 10px 5px;
110
104
  flex-wrap: wrap;
111
105
  `
112
106
 
@@ -129,20 +123,14 @@
129
123
  isChecked: Boolean,
130
124
  checkmarkColor: String,
131
125
  hasLabel: Boolean,
132
- colorMode: String,
133
- hasSlots: Boolean,
134
126
  }
135
127
  const LabelContainer = styled('label', containerProps)`
136
128
  display: grid;
137
129
  grid-template-columns: auto 1fr auto;
138
- grid-gap: ${(props) => (props.hasLabel || props.hasSlots ? '15px' : 0)};
130
+ grid-gap: ${(props) => (props.hasLabel ? '15px' : 0)};
139
131
  align-items: center;
140
132
  color: ${(props) =>
141
- props.isDisabled
142
- ? props.theme.colors.grey2
143
- : props.colorMode === 'transparent'
144
- ? props.theme.colors.white
145
- : props.theme.colors.black};
133
+ props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
146
134
  position: relative;
147
135
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
148
136
  font-size: ${(props) =>
@@ -199,14 +187,10 @@
199
187
  }
200
188
  `
201
189
 
202
- const textAttrs = { isDisabled: Boolean, colorMode: String }
190
+ const textAttrs = { isDisabled: Boolean }
203
191
  const LabelText = styled('div', textAttrs)`
204
192
  color: ${(props) =>
205
- props.isDisabled
206
- ? props.theme.colors.grey2
207
- : props.colorMode === 'transparent'
208
- ? props.theme.colors.white
209
- : props.theme.colors.black};
193
+ props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
210
194
  `
211
195
 
212
196
  const RadioImage = styled.img`
@@ -296,11 +280,6 @@
296
280
  required: false,
297
281
  type: String,
298
282
  },
299
- colorMode: {
300
- default: '',
301
- required: false,
302
- type: String,
303
- },
304
283
  },
305
284
  emits: ['on-radio-change'],
306
285
  data() {