@eturnity/eturnity_reusable_components 8.26.4--EPDM-15979.0 → 8.26.4--EPDM-15979.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.
package/dist/main.es15.js CHANGED
@@ -10,11 +10,13 @@ const ButtonAttrs = {
10
10
  type: String,
11
11
  isDisabled: Boolean,
12
12
  minWidth: String,
13
+ width: String,
13
14
  noWrap: Boolean,
14
15
  height: String,
15
16
  variant: String,
16
17
  buttonSize: String,
17
- appTheme: String
18
+ appTheme: String,
19
+ isActive: Boolean
18
20
  };
19
21
  const ButtonContainer = styled("div", ButtonAttrs)`
20
22
  display: flex;
@@ -28,7 +30,7 @@ const ButtonContainer = styled("div", ButtonAttrs)`
28
30
  return (_d = (_c = (_b = (_a = props.theme) == null ? void 0 : _a.mainButton) == null ? void 0 : _b.size) == null ? void 0 : _c[props.buttonSize]) == null ? void 0 : _d.fontSize;
29
31
  }};
30
32
  color: ${(props) => props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.textColor : props.theme.mainButton[props.appTheme][props.type][props.variant].default.textColor};
31
- background-color: ${(props) => props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.backgroundColor : props.theme.mainButton[props.appTheme][props.type][props.variant].default.backgroundColor};
33
+ background-color: ${(props) => props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.backgroundColor : props.isActive ? props.theme.mainButton[props.appTheme][props.type][props.variant].active.backgroundColor : props.theme.mainButton[props.appTheme][props.type][props.variant].default.backgroundColor};
32
34
  border: ${(props) => {
33
35
  const borderValue = props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.borderColor : props.theme.mainButton[props.appTheme][props.type][props.variant].default.borderColor;
34
36
  return borderValue ? "1px solid " + borderValue : "none";
@@ -41,7 +43,7 @@ const ButtonContainer = styled("div", ButtonAttrs)`
41
43
  ${(props) => props.noWrap ? `white-space: nowrap;` : ""};
42
44
  height: ${(props) => props.height};
43
45
  line-height: 1;
44
-
46
+ width: ${(props) => props.width};
45
47
  &:hover {
46
48
  background-color: ${(props) => props.isDisabled ? props.theme.mainButton[props.appTheme][props.type][props.variant].disabled.backgroundColor : props.theme.mainButton[props.appTheme][props.type][props.variant].hover.backgroundColor};
47
49
  }
@@ -105,6 +107,11 @@ const _sfc_main = {
105
107
  default: false,
106
108
  type: Boolean
107
109
  },
110
+ isActive: {
111
+ required: false,
112
+ default: false,
113
+ type: Boolean
114
+ },
108
115
  icon: {
109
116
  required: false,
110
117
  default: null,
@@ -139,6 +146,11 @@ const _sfc_main = {
139
146
  default: null,
140
147
  type: String
141
148
  },
149
+ width: {
150
+ required: false,
151
+ default: "auto",
152
+ type: String
153
+ },
142
154
  height: {
143
155
  required: false,
144
156
  default: "auto",
@@ -189,11 +201,13 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
189
201
  "data-id": $props.dataId,
190
202
  "data-qa-id": $props.dataQaId,
191
203
  height: $props.height,
204
+ "is-active": $props.isActive,
192
205
  "is-disabled": $props.isDisabled,
193
206
  "min-width": $props.minWidth,
194
207
  "no-wrap": $props.noWrap,
195
208
  type: $props.type,
196
- variant: $props.variant
209
+ variant: $props.variant,
210
+ width: $props.width
197
211
  }, {
198
212
  default: withCtx(() => [createVNode(_component_LabelComponent, {
199
213
  "has-icon": Boolean($props.icon)
@@ -208,7 +222,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
208
222
  _: 1
209
223
  }, 8, ["has-icon"])]),
210
224
  _: 1
211
- }, 8, ["id", "app-theme", "button-size", "data-id", "data-qa-id", "height", "is-disabled", "min-width", "no-wrap", "type", "variant"])]),
225
+ }, 8, ["id", "app-theme", "button-size", "data-id", "data-qa-id", "height", "is-active", "is-disabled", "min-width", "no-wrap", "type", "variant", "width"])]),
212
226
  _: 1
213
227
  });
214
228
  }
package/dist/main.es21.js CHANGED
@@ -503,7 +503,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
503
503
  _: 1
504
504
  }, 8, ["color", "size"])) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), createTextVNode(), renderSlot(_ctx.$slots, "trigger")]),
505
505
  _: 3
506
- }, 8, ["background-color", "border-radius", "hovered-icon", "is-active", "is-disabled", "padding"])], 512), createTextVNode(), $setup.isVisible && (!!$props.text || _ctx.$slots.default) ? (openBlock(), createBlock(Teleport, {
506
+ }, 8, ["background-color", "border-radius", "hovered-icon", "is-active", "is-disabled", "padding"])], 512), createTextVNode(), !$props.hideInfoText && $setup.isVisible && (!!$props.text || _ctx.$slots.default) ? (openBlock(), createBlock(Teleport, {
507
507
  key: 0,
508
508
  to: "body"
509
509
  }, [createVNode(_component_TextWrapper, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "8.26.4--EPDM-15979.0",
3
+ "version": "8.26.4--EPDM-15979.2",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -22,7 +22,7 @@
22
22
  <!-- For stacked bar chart -->
23
23
  <template v-if="seriesData.length">
24
24
  <InputRow
25
- v-for="series in seriesData"
25
+ v-for="(series, seriesIndex) in seriesData"
26
26
  :key="series.name"
27
27
  :data-series-name="series.name"
28
28
  >
@@ -36,8 +36,10 @@
36
36
  :allow-negative="false"
37
37
  :default-number="0"
38
38
  :disabled="isInputsDisabled"
39
+ :error-message="getInputErrorMessage(series.data, item.label)"
39
40
  input-height="36px"
40
41
  :is-disabled-styled-only="true"
42
+ :is-error="getIsError(series.data, item.label)"
41
43
  :is-info-border="
42
44
  fieldMode === 'percentage'
43
45
  ? calculatePercentageTotal(item.label) !== 100
@@ -117,8 +119,10 @@
117
119
  <InputNumber
118
120
  :allow-negative="false"
119
121
  :disabled="isInputsDisabled"
122
+ :error-message="item.errorMessage"
120
123
  input-height="36px"
121
124
  :is-disabled-styled-only="true"
125
+ :is-error="item.isError"
122
126
  :min-decimals="0"
123
127
  :number-precision="0"
124
128
  text-align="center"
@@ -142,6 +146,11 @@
142
146
  </InfoCardBody>
143
147
  </InfoCard>
144
148
  </InfoCardContainer>
149
+ <InfoCardContainer v-if="hasInputErrors" :y-axis-width="yAxisWidth">
150
+ <InfoCard align-items="center" type="error_minor">
151
+ <InfoCardBody> {{ inputErrorMessage }} </InfoCardBody>
152
+ </InfoCard>
153
+ </InfoCardContainer>
145
154
  </template>
146
155
 
147
156
  <script setup>
@@ -204,6 +213,10 @@
204
213
  type: String,
205
214
  default: '',
206
215
  },
216
+ inputErrorMessage: {
217
+ type: String,
218
+ default: '',
219
+ },
207
220
  })
208
221
 
209
222
  const seriesData = ref([])
@@ -229,6 +242,8 @@
229
242
  label: d.label,
230
243
  value: d.value,
231
244
  percentage: d.percentage,
245
+ isError: d.isError,
246
+ errorMessage: d.errorMessage,
232
247
  originalValue: currentSeriesData.length
233
248
  ? currentSeriesData[itemIndex].data[dIndex].originalValue
234
249
  : d.value,
@@ -275,7 +290,7 @@
275
290
  }
276
291
  }
277
292
 
278
- const getDisplayValue = (data, label, shouldRound = true) => {
293
+ const getDisplayValue = (data, label) => {
279
294
  if (props.fieldMode === 'absolute') {
280
295
  return data.find((d) => d.label === label)?.value
281
296
  }
@@ -283,6 +298,13 @@
283
298
  return data.find((d) => d.label === label)?.percentage
284
299
  }
285
300
 
301
+ const getIsError = (data, label) => {
302
+ return data.find((d) => d.label === label)?.isError
303
+ }
304
+ const getInputErrorMessage = (data, label) => {
305
+ return data.find((d) => d.label === label)?.errorMessage
306
+ }
307
+
286
308
  const calculatePercentageTotal = (label) => {
287
309
  const percentageTotal = seriesData.value.reduce((sum, series) => {
288
310
  const percentage =
@@ -336,6 +358,14 @@
336
358
  return calculatePercentageTotal(d.label) !== 100
337
359
  })
338
360
  })
361
+ const hasInputErrors = computed(() => {
362
+ if (seriesData.value.length) {
363
+ return seriesData.value.some((serie) =>
364
+ serie.data.some((item) => item.isError)
365
+ )
366
+ }
367
+ return props.data.some((item) => item.isError)
368
+ })
339
369
 
340
370
  const handleFieldsScroll = (event) => {
341
371
  emit('sync-scroll', event.target.scrollLeft)
@@ -166,6 +166,7 @@
166
166
  :is-inputs-disabled="isLoading"
167
167
  :is-scrollable="isScrollable"
168
168
  :percentage-error-message="percentageErrorMessage"
169
+ :input-error-message="inputErrorMessage"
169
170
  :series="series"
170
171
  :y-axis-width="yAxisWidth"
171
172
  @input-blur="handleInputBlur"
@@ -307,6 +308,10 @@
307
308
  type: String,
308
309
  default: '',
309
310
  },
311
+ inputErrorMessage: {
312
+ type: String,
313
+ default: '',
314
+ },
310
315
  })
311
316
 
312
317
  const generateChartId = () =>
@@ -7,11 +7,13 @@
7
7
  :data-id="dataId"
8
8
  :data-qa-id="dataQaId"
9
9
  :height="height"
10
+ :is-active="isActive"
10
11
  :is-disabled="isDisabled"
11
12
  :min-width="minWidth"
12
13
  :no-wrap="noWrap"
13
14
  :type="type"
14
15
  :variant="variant"
16
+ :width="width"
15
17
  >
16
18
  <LabelComponent :has-icon="Boolean(icon)">
17
19
  <Icon
@@ -50,11 +52,13 @@
50
52
  type: String,
51
53
  isDisabled: Boolean,
52
54
  minWidth: String,
55
+ width: String,
53
56
  noWrap: Boolean,
54
57
  height: String,
55
58
  variant: String,
56
59
  buttonSize: String,
57
60
  appTheme: String,
61
+ isActive: Boolean,
58
62
  }
59
63
  const ButtonContainer = styled('div', ButtonAttrs)`
60
64
  display: flex;
@@ -73,6 +77,9 @@
73
77
  props.isDisabled
74
78
  ? props.theme.mainButton[props.appTheme][props.type][props.variant]
75
79
  .disabled.backgroundColor
80
+ : props.isActive
81
+ ? props.theme.mainButton[props.appTheme][props.type][props.variant]
82
+ .active.backgroundColor
76
83
  : props.theme.mainButton[props.appTheme][props.type][props.variant]
77
84
  .default.backgroundColor};
78
85
  border: ${(props) => {
@@ -91,7 +98,7 @@
91
98
  ${(props) => (props.noWrap ? `white-space: nowrap;` : '')};
92
99
  height: ${(props) => props.height};
93
100
  line-height: 1;
94
-
101
+ width: ${(props) => props.width};
95
102
  &:hover {
96
103
  background-color: ${(props) =>
97
104
  props.isDisabled
@@ -170,6 +177,11 @@
170
177
  default: false,
171
178
  type: Boolean,
172
179
  },
180
+ isActive: {
181
+ required: false,
182
+ default: false,
183
+ type: Boolean,
184
+ },
173
185
  icon: {
174
186
  required: false,
175
187
  default: null,
@@ -204,6 +216,11 @@
204
216
  default: null,
205
217
  type: String,
206
218
  },
219
+ width: {
220
+ required: false,
221
+ default: 'auto',
222
+ type: String,
223
+ },
207
224
  height: {
208
225
  required: false,
209
226
  default: 'auto',
@@ -49,7 +49,10 @@
49
49
  <slot name="trigger"></slot>
50
50
  </IconWrapper>
51
51
  </div>
52
- <Teleport v-if="isVisible && (!!text || $slots.default)" to="body">
52
+ <Teleport
53
+ v-if="!hideInfoText && isVisible && (!!text || $slots.default)"
54
+ to="body"
55
+ >
53
56
  <TextWrapper data-test-id="info_text_wrapper" :style="wrapperStyle">
54
57
  <TextOverlay
55
58
  ref="infoBox"
@@ -799,6 +799,10 @@
799
799
  type: Boolean,
800
800
  default: false,
801
801
  },
802
+ hasSpaceBetweenUnit: {
803
+ type: Boolean,
804
+ default: true,
805
+ },
802
806
  },
803
807
  data() {
804
808
  return {
@@ -812,8 +816,12 @@
812
816
  displayedPlaceholder() {
813
817
  if (this.placeholder) return this.placeholder
814
818
  if (this.defaultNumber)
815
- return `${this.defaultNumber} ${this.unitName ? this.unitName : ''}`
816
- return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
819
+ return `${this.defaultNumber}${this.hasSpaceBetweenUnit ? ' ' : ''}${
820
+ this.unitName ? this.unitName : ''
821
+ }`
822
+ return `${this.minNumber || 0}${this.hasSpaceBetweenUnit ? ' ' : ''}${
823
+ this.unitName ? this.unitName : ''
824
+ }`
817
825
  },
818
826
  hasSlot() {
819
827
  return !!this.$slots.default
@@ -1027,8 +1035,9 @@
1027
1035
  return
1028
1036
  }
1029
1037
  this.textInput = this.formatWithCurrency(this.value)
1038
+ const textInputWithoutUnit = this.formatWithoutUnit(this.value)
1030
1039
  this.enteredValue = stringToNumber({
1031
- value: this.textInput,
1040
+ value: textInputWithoutUnit,
1032
1041
  numberPrecision: this.numberPrecision,
1033
1042
  minDecimals: this.minDecimals,
1034
1043
  })
@@ -1049,6 +1058,38 @@
1049
1058
  this.$refs.inputField1.$el.blur()
1050
1059
  })
1051
1060
  },
1061
+ formatWithoutUnit(value) {
1062
+ let adjustedMinValue =
1063
+ value || value === 0
1064
+ ? value
1065
+ : this.defaultNumber
1066
+ ? this.defaultNumber
1067
+ : this.minNumber || this.minNumber === 0
1068
+ ? this.minNumber
1069
+ : ''
1070
+ if (adjustedMinValue || adjustedMinValue === 0) {
1071
+ let input = this.numberToStringEnabled
1072
+ ? numberToString({
1073
+ value: adjustedMinValue,
1074
+ numberPrecision: this.numberPrecision,
1075
+ minDecimals: this.minDecimals,
1076
+ })
1077
+ : adjustedMinValue
1078
+ return input
1079
+ } else if (!adjustedMinValue && adjustedMinValue !== 0) {
1080
+ return ''
1081
+ } else if (this.isFocused) {
1082
+ return value
1083
+ } else {
1084
+ return this.numberToStringEnabled
1085
+ ? numberToString({
1086
+ value: adjustedMinValue,
1087
+ numberPrecision: this.numberPrecision,
1088
+ minDecimals: this.minDecimals,
1089
+ })
1090
+ : adjustedMinValue
1091
+ }
1092
+ },
1052
1093
  formatWithCurrency(value) {
1053
1094
  let adjustedMinValue =
1054
1095
  value || value === 0
@@ -1069,7 +1110,7 @@
1069
1110
  let unit = this.showLinearUnitName ? '' : this.unitName
1070
1111
  //return input + ' ' + unit
1071
1112
  if (unit) {
1072
- return input + ' ' + unit
1113
+ return `${input}${this.hasSpaceBetweenUnit ? ' ' : ''}${unit}`
1073
1114
  }
1074
1115
  return input
1075
1116
  } else if (!adjustedMinValue && adjustedMinValue !== 0) {
@@ -10,7 +10,8 @@
10
10
  data-test-id="tab-item"
11
11
  :full-size="fullSize"
12
12
  :is-active="activeTab === item.id"
13
- @click="onTabClick({ id: item.id })"
13
+ :is-disabled="item.isDisabled"
14
+ @click="onTabClick({ id: item.id, isDisabled: item.isDisabled })"
14
15
  >
15
16
  <RCIcon
16
17
  v-if="item.icon"
@@ -28,7 +29,12 @@
28
29
  :name="item.icon"
29
30
  size="14px"
30
31
  />
31
- <div data-test-id="tab-text">{{ item.text }}</div>
32
+ <TabText
33
+ data-test-id="tab-text"
34
+ :is-active="activeTab === item.id"
35
+ :is-disabled="item.isDisabled"
36
+ >{{ item.text }}</TabText
37
+ >
32
38
  <DotIcon
33
39
  v-if="item.subText"
34
40
  data-test-id="dot-icon"
@@ -43,6 +49,16 @@
43
49
  name="warning"
44
50
  size="14px"
45
51
  />
52
+ <ConversionTag
53
+ v-if="item.showUpgradeTag"
54
+ :data-id="
55
+ item.isTrialEnded || item.isTrialActive
56
+ ? `${item.upgradeName}_upgrade_only`
57
+ : `conversion_tag_import_${item.upgradeName}_available_trial_${item.isTrialAvailable}`
58
+ "
59
+ :is-capitalized="true"
60
+ :text="item.upgradeTagText"
61
+ />
46
62
  </TabItem>
47
63
  </TabsContainer>
48
64
  </PageContainer>
@@ -69,13 +85,7 @@
69
85
  import styled from 'vue3-styled-components'
70
86
  import RCIcon from '../icon'
71
87
  import theme from '@/assets/theme'
72
-
73
- const NameContainer = styled.div`
74
- display: flex;
75
- align-items: center;
76
- justify-content: center;
77
- gap: 8px;
78
- `
88
+ import ConversionTag from '../tag/conversionTag'
79
89
 
80
90
  const DotIconAttrs = { isActive: Boolean }
81
91
  const DotIcon = styled('div', DotIconAttrs)`
@@ -101,7 +111,7 @@
101
111
  border-bottom: 1px solid ${(props) => props.theme.colors.purple7};
102
112
  `
103
113
 
104
- const TabAttrs = { isActive: Boolean, fullSize: Boolean }
114
+ const TabAttrs = { isActive: Boolean, fullSize: Boolean, isDisabled: Boolean }
105
115
  const TabItem = styled('div', TabAttrs)`
106
116
  display: flex;
107
117
  align-items: center;
@@ -109,6 +119,7 @@
109
119
  gap: 8px;
110
120
  padding: 10px 25px;
111
121
  font-size: 14px;
122
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
112
123
  font-weight: ${(props) => (props.isActive ? '500' : '400')};
113
124
  color: ${(props) =>
114
125
  props.isActive
@@ -122,6 +133,19 @@
122
133
  : '1px solid' + props.theme.semanticColors.grey[400]};
123
134
  `
124
135
 
136
+ const TabTextAttrs = { isActive: Boolean, isDisabled: Boolean }
137
+ const TabText = styled('div', TabTextAttrs)`
138
+ font-size: 14px;
139
+ font-weight: 400;
140
+ color: ${(props) =>
141
+ props.isActive
142
+ ? props.theme.semanticColors.purple[500]
143
+ : props.isDisabled
144
+ ? props.theme.semanticColors.grey[600]
145
+ : props.theme.semanticColors.teal[700]};
146
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
147
+ `
148
+
125
149
  export default {
126
150
  name: 'RCTabsHeader',
127
151
  components: {
@@ -131,6 +155,8 @@
131
155
  SubText,
132
156
  DotIcon,
133
157
  RCIcon,
158
+ ConversionTag,
159
+ TabText,
134
160
  },
135
161
  props: {
136
162
  tabsData: {
@@ -153,8 +179,8 @@
153
179
  }
154
180
  },
155
181
  methods: {
156
- onTabClick({ id }) {
157
- if (id === this.activeTab) {
182
+ onTabClick({ id, isDisabled }) {
183
+ if (id === this.activeTab || isDisabled) {
158
184
  return
159
185
  }
160
186
  this.$emit('on-tab-change', id)