@eturnity/eturnity_reusable_components 8.19.8-EPDM-14690.4 → 8.19.8-EPDM-15590.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.
@@ -17,18 +17,18 @@ export const LabelsColumn = styled('div', { width: String })`
17
17
 
18
18
  export const LabelRow = styled.div`
19
19
  height: 32px;
20
- padding-top: 5px;
21
20
  font-size: 12px;
22
21
  font-weight: 500;
23
22
  color: ${(props) => props.theme.semanticColors.teal[600]};
24
23
  display: flex;
25
- align-items: center;
24
+ align-items: flex-start;
26
25
  `
27
26
 
28
27
  export const TotalRow = styled(LabelRow)``
29
28
 
30
29
  export const FieldsContainer = styled.div`
31
30
  flex: 1;
31
+ overflow-x: auto;
32
32
  scrollbar-width: none;
33
33
 
34
34
  &::-webkit-scrollbar {
@@ -59,22 +59,8 @@ export const InputGroup = styled('div', {
59
59
  barWidth: Number,
60
60
  isScrollable: Boolean,
61
61
  })`
62
- ${(props) => (props.isScrollable ? 'min-width' : 'width')}: 70px;
62
+ ${(props) => (props.isScrollable ? 'min-width' : 'width')}:${(props) =>
63
+ props.barWidth}px;
63
64
  display: flex;
64
65
  justify-content: center;
65
- position: relative;
66
-
67
- input[readonly] {
68
- border: 1px solid ${(props) => props.theme.colors.grey4} !important;
69
- }
70
- `
71
-
72
- export const InfoCardContainer = styled('div', { yAxisWidth: String })`
73
- margin-left: ${(props) => props.yAxisWidth};
74
- padding: 12px;
75
- margin-top: 12px;
76
- `
77
-
78
- export const InfoCardBody = styled.div`
79
- padding: 8px 0;
80
66
  `
@@ -127,7 +127,6 @@ export const BarWrapper = styled.div`
127
127
  height: 100%;
128
128
  width: 100%;
129
129
  position: relative;
130
- overflow: hidden;
131
130
  `
132
131
 
133
132
  export const BarSegment = styled('div', {
@@ -240,8 +240,6 @@
240
240
  return this.isDisabled
241
241
  ? this.theme.mainButton[this.appTheme][this.type][this.variant]
242
242
  .disabled.textColor
243
- : this.iconColor
244
- ? this.iconColor
245
243
  : this.theme.mainButton[this.appTheme][this.type][this.variant]
246
244
  .default.textColor
247
245
  },
@@ -19,7 +19,7 @@
19
19
  background: ${(props) => props.theme.colors.red};
20
20
  padding: 10px;
21
21
  width: max-content;
22
- /* max-width: 100%; */
22
+ max-width: 100%;
23
23
  min-width: min-content;
24
24
  font-size: 11px;
25
25
  font-weight: 400;
@@ -208,11 +208,9 @@
208
208
  !props.disableHover &&
209
209
  `
210
210
  &:hover svg path:not(.fix, .isStrokePath) {
211
- ${`${props.fillType}: ${
212
- props.theme.colors[props.hoveredColor] || props.color
213
- };`}
211
+ ${`${props.fillType}: ${props.hoveredColor || props.color};`}
214
212
  &:hover svg isStrokePath:not(.fix) {
215
- ${`stroke: ${props.theme.colors[props.hoveredColor] || props.color};`}
213
+ ${`stroke: ${props.hoveredColor || props.color};`}
216
214
  }
217
215
  &:hover + div {
218
216
  background-color: ${props.hoveredColor};
@@ -73,12 +73,7 @@
73
73
  type: {
74
74
  required: false,
75
75
  type: String,
76
- default: 'info_simple',
77
- validator(value) {
78
- return ['info_simple', 'warning', 'error_minor', 'info'].includes(
79
- value
80
- )
81
- },
76
+ default: 'info',
82
77
  },
83
78
  minWidth: {
84
79
  required: false,
@@ -117,11 +112,8 @@
117
112
  },
118
113
  },
119
114
  computed: {
120
- isInfoSimple() {
121
- // this property is used for tests
122
- return this.type === 'info_simple'
123
- },
124
115
  isInfo() {
116
+ // this property is used for tests
125
117
  return this.type === 'info'
126
118
  },
127
119
  isWarning() {
@@ -156,13 +148,9 @@
156
148
  stylesCollection.borderStyle = 'dashed'
157
149
  stylesCollection.borderColor = theme.colors.grey4
158
150
  stylesCollection.iconColor = theme.colors.red
159
- } else if (this.isInfoSimple) {
151
+ } else {
160
152
  stylesCollection.borderStyle = 'dashed'
161
153
  stylesCollection.borderColor = theme.colors.grey4
162
- } else {
163
- stylesCollection.color = theme.semanticColors.teal[800]
164
- stylesCollection.backgroundColor = theme.semanticColors.blue[300]
165
- stylesCollection.iconColor = theme.semanticColors.teal[800]
166
154
  }
167
155
 
168
156
  return stylesCollection
@@ -45,19 +45,19 @@ describe('RCInfoCard.vue', () => {
45
45
  },
46
46
  })
47
47
 
48
- expect(wrapper.vm.isInfoSimple).toBe(true)
48
+ expect(wrapper.vm.isInfo).toBe(true)
49
49
  expect(wrapper.vm.isWarning).toBe(false)
50
50
  expect(wrapper.vm.isErrorMinor).toBe(false)
51
51
 
52
52
  await wrapper.setProps({ type: 'warning' })
53
53
 
54
- expect(wrapper.vm.isInfoSimple).toBe(false)
54
+ expect(wrapper.vm.isInfo).toBe(false)
55
55
  expect(wrapper.vm.isWarning).toBe(true)
56
56
  expect(wrapper.vm.isErrorMinor).toBe(false)
57
57
 
58
58
  await wrapper.setProps({ type: 'error_minor' })
59
59
 
60
- expect(wrapper.vm.isInfoSimple).toBe(false)
60
+ expect(wrapper.vm.isInfo).toBe(false)
61
61
  expect(wrapper.vm.isWarning).toBe(false)
62
62
  expect(wrapper.vm.isErrorMinor).toBe(true)
63
63
  })
@@ -15,40 +15,37 @@
15
15
  :is-disabled="isDisabled"
16
16
  :padding="padding"
17
17
  >
18
- <template v-if="!$slots.trigger">
19
- <LabelWrapper
20
- v-if="labelText && labelAlign === 'left'"
21
- :color="iconColor || computedIconColor"
22
- :size="labelSize"
23
- >
24
- {{ labelText }}
25
- </LabelWrapper>
26
- <Dot
27
- v-if="type === 'dot'"
28
- :color="dotColor"
29
- data-test-id="infoText_dot"
30
- />
31
- <IconComponent
32
- v-else-if="!noIcon"
33
- :color="iconColor || computedIconColor"
34
- :cursor="isDisabled ? 'not-allowed' : 'pointer'"
35
- :disabled="isDisabled"
36
- :hovered-color="iconColor || computedIconColor"
37
- :name="iconName"
38
- :size="size"
39
- />
40
- <LabelWrapper
41
- v-if="labelText && labelAlign === 'right'"
42
- :color="iconColor || computedIconColor"
43
- :size="labelSize"
44
- >
45
- {{ labelText }}
46
- </LabelWrapper>
47
- </template>
48
- <slot name="trigger"></slot>
18
+ <LabelWrapper
19
+ v-if="labelText && labelAlign === 'left'"
20
+ :color="iconColor || computedIconColor"
21
+ :size="labelSize"
22
+ >
23
+ {{ labelText }}
24
+ </LabelWrapper>
25
+ <Dot
26
+ v-if="type === 'dot'"
27
+ :color="dotColor"
28
+ data-test-id="infoText_dot"
29
+ />
30
+ <IconComponent
31
+ v-else-if="!noIcon"
32
+ :color="iconColor || computedIconColor"
33
+ :cursor="isDisabled ? 'not-allowed' : 'pointer'"
34
+ :disabled="isDisabled"
35
+ :hovered-color="iconColor || computedIconColor"
36
+ :name="iconName"
37
+ :size="size"
38
+ />
39
+ <LabelWrapper
40
+ v-if="labelText && labelAlign === 'right'"
41
+ :color="iconColor || computedIconColor"
42
+ :size="labelSize"
43
+ >
44
+ {{ labelText }}
45
+ </LabelWrapper>
49
46
  </IconWrapper>
50
47
  </div>
51
- <Teleport v-if="isVisible && !!text" to="body">
48
+ <Teleport v-if="isVisible" to="body">
52
49
  <TextWrapper data-test-id="info_text_wrapper" :style="wrapperStyle">
53
50
  <TextOverlay
54
51
  ref="infoBox"
@@ -230,7 +227,7 @@
230
227
  },
231
228
  infoPosition: {
232
229
  required: false,
233
- default: null,
230
+ default: 'bottom',
234
231
  type: String,
235
232
  },
236
233
  maxWidth: {
@@ -366,9 +363,7 @@
366
363
  { position: 'left', space: spaceLeft },
367
364
  ].sort((a, b) => b.space - a.space)
368
365
 
369
- const bestPosition = props.infoPosition
370
- ? props.infoPosition
371
- : positions[0].position
366
+ const bestPosition = positions[0].position
372
367
 
373
368
  let top, left, arrowPosition
374
369
 
@@ -30,61 +30,7 @@
30
30
  />
31
31
  </LabelWrapper>
32
32
  <InputWrapper>
33
- <InputInfoText
34
- v-if="!!inputInfoText"
35
- info-position="bottom"
36
- :text="inputInfoText"
37
- >
38
- <template #trigger>
39
- <InputContainer
40
- v-bind="$attrs"
41
- ref="inputField1"
42
- :align-items="alignItems"
43
- :background-color="
44
- colorMode === 'transparent' ? 'transparent' : backgroundColor
45
- "
46
- :border-color="
47
- colorMode === 'transparent' && !borderColor
48
- ? 'white'
49
- : borderColor
50
- "
51
- :color-mode="colorMode"
52
- :data-id="inputDataId"
53
- :data-qa-id="dataQaId"
54
- :disabled="disabled && !isDisabledStyledOnly"
55
- :font-color="colorMode === 'transparent' ? 'white' : fontColor"
56
- :font-size="fontSize"
57
- :has-label-slot="hasLabelSlot"
58
- :has-slot="hasSlot"
59
- :has-unit="unitName && !!unitName.length"
60
- :input-height="inputHeight"
61
- :is-border-error-only="isBorderErrorOnly"
62
- :is-disabled="disabled"
63
- :is-error="isError"
64
- :is-info-border="isInfoBorder"
65
- :is-interactive="isInteractive"
66
- :min-width="minWidth"
67
- :no-border="noBorder"
68
- :placeholder="displayedPlaceholder"
69
- :read-only="isReadOnly"
70
- :readonly="isReadOnly"
71
- :show-arrow-controls="showArrowControls"
72
- :show-linear-unit-name="showLinearUnitName"
73
- :slot-size="slotSize"
74
- :text-align="textAlign"
75
- :value="formatWithCurrency(value)"
76
- @blur="onInputBlur($event)"
77
- @focus="focusInput()"
78
- @input="onInput($event)"
79
- @keydown.down="decrementValue"
80
- @keydown.up="incrementValue"
81
- @keyup.enter="onEnterPress"
82
- />
83
- </template>
84
- </InputInfoText>
85
-
86
33
  <InputContainer
87
- v-else
88
34
  v-bind="$attrs"
89
35
  ref="inputField1"
90
36
  :align-items="alignItems"
@@ -97,23 +43,20 @@
97
43
  :color-mode="colorMode"
98
44
  :data-id="inputDataId"
99
45
  :data-qa-id="dataQaId"
100
- :disabled="disabled && !isDisabledStyledOnly"
46
+ :disabled="disabled"
101
47
  :font-color="colorMode === 'transparent' ? 'white' : fontColor"
102
48
  :font-size="fontSize"
103
49
  :has-label-slot="hasLabelSlot"
104
50
  :has-slot="hasSlot"
105
51
  :has-unit="unitName && !!unitName.length"
106
52
  :input-height="inputHeight"
107
- :is-border-error-only="isBorderErrorOnly"
108
53
  :is-disabled="disabled"
109
54
  :is-error="isError"
110
- :is-info-border="isInfoBorder"
111
55
  :is-interactive="isInteractive"
112
56
  :min-width="minWidth"
113
57
  :no-border="noBorder"
114
58
  :placeholder="displayedPlaceholder"
115
59
  :read-only="isReadOnly"
116
- :readonly="isReadOnly"
117
60
  :show-arrow-controls="showArrowControls"
118
61
  :show-linear-unit-name="showLinearUnitName"
119
62
  :slot-size="slotSize"
@@ -126,7 +69,6 @@
126
69
  @keydown.up="incrementValue"
127
70
  @keyup.enter="onEnterPress"
128
71
  />
129
-
130
72
  <SlotContainer v-if="hasSlot" :is-error="isError" :slot-size="slotSize">
131
73
  <slot></slot>
132
74
  </SlotContainer>
@@ -138,7 +80,7 @@
138
80
  >{{ unitName }}</UnitContainer
139
81
  >
140
82
  <IconWrapper
141
- v-if="isError && !showLinearUnitName && !isBorderErrorOnly"
83
+ v-if="isError && !showLinearUnitName"
142
84
  :margin-right="showSelect ? selectWidth : 0"
143
85
  size="16px"
144
86
  >
@@ -192,9 +134,7 @@
192
134
  </ArrowButton>
193
135
  </ArrowControls>
194
136
  </InputWrapper>
195
- <ErrorMessage v-if="isError && errorMessage">{{
196
- errorMessage
197
- }}</ErrorMessage>
137
+ <ErrorMessage v-if="isError">{{ errorMessage }}</ErrorMessage>
198
138
  </Container>
199
139
  </template>
200
140
 
@@ -265,8 +205,6 @@
265
205
  colorMode: String,
266
206
  showArrowControls: Boolean,
267
207
  readOnly: Boolean,
268
- isBorderErrorOnly: Boolean,
269
- isInfoBorder: Boolean,
270
208
  }
271
209
 
272
210
  const Container = styled('div', inputProps)`
@@ -279,9 +217,7 @@
279
217
 
280
218
  const InputContainer = styled('input', inputProps)`
281
219
  border: ${(props) =>
282
- props.isInfoBorder
283
- ? '1px solid ' + props.theme.semanticColors.blue[500]
284
- : props.isError
220
+ props.isError
285
221
  ? '1px solid ' + props.theme.colors.red
286
222
  : props.noBorder
287
223
  ? 'none'
@@ -300,17 +236,16 @@
300
236
  showLinearUnitName,
301
237
  colorMode,
302
238
  showArrowControls,
303
- isBorderErrorOnly,
304
239
  }) =>
305
240
  showArrowControls
306
241
  ? '40px'
307
242
  : colorMode === 'transparent'
308
243
  ? '0'
309
244
  : slotSize
310
- ? isError && !showLinearUnitName && !isBorderErrorOnly
245
+ ? isError && !showLinearUnitName
311
246
  ? 'calc(' + slotSize + ' + 24px)'
312
247
  : 'calc(' + slotSize + ' + 10px)'
313
- : isError && !showLinearUnitName && !isBorderErrorOnly
248
+ : isError && !showLinearUnitName
314
249
  ? '24px'
315
250
  : '5px'};
316
251
  border-radius: ${(props) =>
@@ -522,10 +457,6 @@
522
457
  background-color: ${({ theme }) => theme.colors.grey4};
523
458
  `
524
459
 
525
- const InputInfoText = styled(InfoText)`
526
- width: 100%;
527
- `
528
-
529
460
  export default {
530
461
  name: 'InputNumber',
531
462
  components: {
@@ -549,7 +480,6 @@
549
480
  ArrowControls,
550
481
  ArrowButton,
551
482
  ArrowDivider,
552
- InputInfoText,
553
483
  },
554
484
  inheritAttrs: false,
555
485
  props: {
@@ -769,22 +699,6 @@
769
699
  type: Boolean,
770
700
  default: false,
771
701
  },
772
- isBorderErrorOnly: {
773
- type: Boolean,
774
- default: false,
775
- },
776
- isInfoBorder: {
777
- type: Boolean,
778
- default: false,
779
- },
780
- inputInfoText: {
781
- type: String,
782
- default: '',
783
- },
784
- isDisabledStyledOnly: {
785
- type: Boolean,
786
- default: false,
787
- },
788
702
  },
789
703
  data() {
790
704
  return {
@@ -58,6 +58,12 @@ Default.args = {
58
58
  ...defaultProps,
59
59
  }
60
60
 
61
+ export const Disabled = Template.bind({})
62
+ Disabled.args = {
63
+ ...defaultProps,
64
+ disabled: true,
65
+ }
66
+
61
67
  export const BlueCheckmark = Template.bind({})
62
68
  BlueCheckmark.args = {
63
69
  ...defaultProps,
@@ -11,7 +11,7 @@
11
11
  :has-label="!!item.label"
12
12
  :has-slots="!!$slots[`input-${item.value}`]"
13
13
  :is-checked="selectedOption === item.value"
14
- :is-disabled="item.disabled"
14
+ :is-disabled="isItemDisabled(item)"
15
15
  :size="size"
16
16
  >
17
17
  <Radio
@@ -19,7 +19,7 @@
19
19
  :data-id="`radio_button_${dataId}_option_${item.value}`"
20
20
  :data-qa-id="dataQaId"
21
21
  :data-test-id="'radioInput_' + item.value"
22
- :disabled="item.disabled"
22
+ :disabled="isItemDisabled(item)"
23
23
  :name="'radioButtons_' + radioName"
24
24
  type="radio"
25
25
  :value="selectedOption"
@@ -30,7 +30,7 @@
30
30
  v-if="item.label"
31
31
  :color-mode="colorMode"
32
32
  :data-test-id="'radioLabel_' + item.value"
33
- :is-disabled="item.disabled"
33
+ :is-disabled="isItemDisabled(item)"
34
34
  >
35
35
  {{ item.label }}
36
36
  </LabelText>
@@ -261,6 +261,11 @@
261
261
  LabelText,
262
262
  },
263
263
  props: {
264
+ disabled: {
265
+ default: false,
266
+ required: false,
267
+ type: Boolean,
268
+ },
264
269
  selectedOption: {
265
270
  required: true,
266
271
  type: [String, Number],
@@ -328,6 +333,9 @@
328
333
  isImageOpen(index) {
329
334
  return this.selectedImage === index
330
335
  },
336
+ isItemDisabled(item) {
337
+ return this.disabled || item.disabled
338
+ },
331
339
  toggleImageModal(value) {
332
340
  this.selectedImage = value
333
341
  },
@@ -46,6 +46,7 @@
46
46
  color: ${(props) => (props.color ? props.color : props.theme.colors.black)};
47
47
  font-weight: 600;
48
48
  font-size: ${(props) => (props.fontSize ? props.fontSize : '20px')};
49
+ text-transform: ${(props) => (props.uppercase ? 'uppercase' : 'none')};
49
50
  `
50
51
 
51
52
  export default {