@eturnity/eturnity_reusable_components 8.19.8-EPDM-12618.6 → 8.19.8-EPDM-14690.2

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.
@@ -15,37 +15,40 @@
15
15
  :is-disabled="isDisabled"
16
16
  :padding="padding"
17
17
  >
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>
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>
46
49
  </IconWrapper>
47
50
  </div>
48
- <Teleport v-if="isVisible" to="body">
51
+ <Teleport v-if="isVisible && !!text" to="body">
49
52
  <TextWrapper data-test-id="info_text_wrapper" :style="wrapperStyle">
50
53
  <TextOverlay
51
54
  ref="infoBox"
@@ -227,7 +230,7 @@
227
230
  },
228
231
  infoPosition: {
229
232
  required: false,
230
- default: 'bottom',
233
+ default: null,
231
234
  type: String,
232
235
  },
233
236
  maxWidth: {
@@ -363,7 +366,9 @@
363
366
  { position: 'left', space: spaceLeft },
364
367
  ].sort((a, b) => b.space - a.space)
365
368
 
366
- const bestPosition = positions[0].position
369
+ const bestPosition = props.infoPosition
370
+ ? props.infoPosition
371
+ : positions[0].position
367
372
 
368
373
  let top, left, arrowPosition
369
374
 
@@ -30,7 +30,61 @@
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"
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
+
33
86
  <InputContainer
87
+ v-else
34
88
  v-bind="$attrs"
35
89
  ref="inputField1"
36
90
  :align-items="alignItems"
@@ -50,13 +104,16 @@
50
104
  :has-slot="hasSlot"
51
105
  :has-unit="unitName && !!unitName.length"
52
106
  :input-height="inputHeight"
107
+ :is-border-error-only="isBorderErrorOnly"
53
108
  :is-disabled="disabled"
54
109
  :is-error="isError"
110
+ :is-info-border="isInfoBorder"
55
111
  :is-interactive="isInteractive"
56
112
  :min-width="minWidth"
57
113
  :no-border="noBorder"
58
114
  :placeholder="displayedPlaceholder"
59
115
  :read-only="isReadOnly"
116
+ :readonly="isReadOnly"
60
117
  :show-arrow-controls="showArrowControls"
61
118
  :show-linear-unit-name="showLinearUnitName"
62
119
  :slot-size="slotSize"
@@ -69,6 +126,7 @@
69
126
  @keydown.up="incrementValue"
70
127
  @keyup.enter="onEnterPress"
71
128
  />
129
+
72
130
  <SlotContainer v-if="hasSlot" :is-error="isError" :slot-size="slotSize">
73
131
  <slot></slot>
74
132
  </SlotContainer>
@@ -80,7 +138,7 @@
80
138
  >{{ unitName }}</UnitContainer
81
139
  >
82
140
  <IconWrapper
83
- v-if="isError && !showLinearUnitName"
141
+ v-if="isError && !showLinearUnitName && !isBorderErrorOnly"
84
142
  :margin-right="showSelect ? selectWidth : 0"
85
143
  size="16px"
86
144
  >
@@ -134,7 +192,9 @@
134
192
  </ArrowButton>
135
193
  </ArrowControls>
136
194
  </InputWrapper>
137
- <ErrorMessage v-if="isError">{{ errorMessage }}</ErrorMessage>
195
+ <ErrorMessage v-if="isError && errorMessage">{{
196
+ errorMessage
197
+ }}</ErrorMessage>
138
198
  </Container>
139
199
  </template>
140
200
 
@@ -205,6 +265,8 @@
205
265
  colorMode: String,
206
266
  showArrowControls: Boolean,
207
267
  readOnly: Boolean,
268
+ isBorderErrorOnly: Boolean,
269
+ isInfoBorder: Boolean,
208
270
  }
209
271
 
210
272
  const Container = styled('div', inputProps)`
@@ -217,7 +279,9 @@
217
279
 
218
280
  const InputContainer = styled('input', inputProps)`
219
281
  border: ${(props) =>
220
- props.isError
282
+ props.isInfoBorder
283
+ ? '1px solid ' + props.theme.semanticColors.blue[500]
284
+ : props.isError
221
285
  ? '1px solid ' + props.theme.colors.red
222
286
  : props.noBorder
223
287
  ? 'none'
@@ -236,16 +300,17 @@
236
300
  showLinearUnitName,
237
301
  colorMode,
238
302
  showArrowControls,
303
+ isBorderErrorOnly,
239
304
  }) =>
240
305
  showArrowControls
241
306
  ? '40px'
242
307
  : colorMode === 'transparent'
243
308
  ? '0'
244
309
  : slotSize
245
- ? isError && !showLinearUnitName
310
+ ? isError && !showLinearUnitName && !isBorderErrorOnly
246
311
  ? 'calc(' + slotSize + ' + 24px)'
247
312
  : 'calc(' + slotSize + ' + 10px)'
248
- : isError && !showLinearUnitName
313
+ : isError && !showLinearUnitName && !isBorderErrorOnly
249
314
  ? '24px'
250
315
  : '5px'};
251
316
  border-radius: ${(props) =>
@@ -457,6 +522,10 @@
457
522
  background-color: ${({ theme }) => theme.colors.grey4};
458
523
  `
459
524
 
525
+ const InputInfoText = styled(InfoText)`
526
+ width: 100%;
527
+ `
528
+
460
529
  export default {
461
530
  name: 'InputNumber',
462
531
  components: {
@@ -480,6 +549,7 @@
480
549
  ArrowControls,
481
550
  ArrowButton,
482
551
  ArrowDivider,
552
+ InputInfoText,
483
553
  },
484
554
  inheritAttrs: false,
485
555
  props: {
@@ -699,6 +769,18 @@
699
769
  type: Boolean,
700
770
  default: false,
701
771
  },
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
+ },
702
784
  },
703
785
  data() {
704
786
  return {
@@ -179,7 +179,9 @@
179
179
  position: relative;
180
180
  font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
181
181
  color: ${(props) =>
182
- props.isDisabled
182
+ props.isError
183
+ ? props.theme.colors.grey6
184
+ : props.isDisabled
183
185
  ? props.theme.colors.grey2
184
186
  : props.fontColor
185
187
  ? props.fontColor + ' !important'
@@ -46,7 +46,6 @@
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')};
50
49
  `
51
50
 
52
51
  export default {
@@ -78,13 +78,10 @@
78
78
  v-else
79
79
  class="inputField"
80
80
  :disabled="customInputDisabled"
81
- :error-message="item.errorMessage"
82
81
  :font-color="showArchived ? theme.colors.red : 'black'"
83
- :is-error="item.isError"
84
82
  :min-width="item.value.length + 'ch'"
85
83
  :no-border="true"
86
84
  :value="item.value"
87
- @input-blur="onCustomInputChange($event.trim())"
88
85
  @input-change="onCustomInputChange($event)"
89
86
  />
90
87
  </InputContainer>
@@ -165,7 +162,7 @@
165
162
  </OptionsItem>
166
163
  </OptionsWrapper>
167
164
  <CustomContainer
168
- v-if="getCustomName.length && allowFreeInputs"
165
+ v-if="inputText.length && allowFreeInputs"
169
166
  @click="onCustomNameClick()"
170
167
  >
171
168
  <CustomName>{{ getCustomName }}</CustomName>
@@ -229,6 +226,7 @@
229
226
  const ItemAttrs = { isNested: Boolean, showArchived: Boolean }
230
227
  const ComponentItem = styled('td', ItemAttrs)`
231
228
  padding-left: ${(props) => (props.isNested ? '14px !important' : '0')};
229
+ overflow: hidden;
232
230
  text-overflow: ellipsis;
233
231
  padding-right: 0 !important;
234
232
  color: ${(props) =>
@@ -560,7 +558,7 @@
560
558
  },
561
559
  computed: {
562
560
  getCustomName() {
563
- return this.inputText.trim()
561
+ return this.inputText
564
562
  },
565
563
  theme() {
566
564
  return theme
@@ -654,7 +652,7 @@
654
652
  },
655
653
  onCustomNameClick() {
656
654
  this.wasClicked = true
657
- this.$emit('on-custom-input-name', this.getCustomName)
655
+ this.$emit('on-custom-input-name', this.inputText)
658
656
  this.$emit('toggle-dropdown-open', { close: true })
659
657
  this.inputText = ''
660
658
  },