@eturnity/eturnity_reusable_components 7.22.1 → 7.22.3-EPDM-10647.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.22.1",
3
+ "version": "7.22.3-EPDM-10647.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -0,0 +1,8 @@
1
+ <svg width="10" height="16" viewBox="0 0 10 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M4 2C4 3.10457 3.10457 4 2 4C0.89543 4 0 3.10457 0 2C0 0.89543 0.89543 0 2 0C3.10457 0 4 0.89543 4 2Z" fill="#B2B9C5"/>
3
+ <path d="M10 2C10 3.10457 9.10457 4 8 4C6.89543 4 6 3.10457 6 2C6 0.89543 6.89543 0 8 0C9.10457 0 10 0.89543 10 2Z" fill="#B2B9C5"/>
4
+ <path d="M4 8C4 9.10457 3.10457 10 2 10C0.89543 10 0 9.10457 0 8C0 6.89543 0.89543 6 2 6C3.10457 6 4 6.89543 4 8Z" fill="#B2B9C5"/>
5
+ <path d="M10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z" fill="#B2B9C5"/>
6
+ <path d="M4 14C4 15.1046 3.10457 16 2 16C0.89543 16 0 15.1046 0 14C0 12.8954 0.89543 12 2 12C3.10457 12 4 12.8954 4 14Z" fill="#B2B9C5"/>
7
+ <path d="M10 14C10 15.1046 9.10457 16 8 16C6.89543 16 6 15.1046 6 14C6 12.8954 6.89543 12 8 12C9.10457 12 10 12.8954 10 14Z" fill="#B2B9C5"/>
8
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="12" viewBox="0 0 14 12" fill="none">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9.09548 3.62522L10.8209 1.59974L9.53978 0.508423L0.199219 11.4916H13.7992V9.80865H11.9546C11.7571 7.4083 10.7198 5.25339 9.09548 3.62522ZM10.2648 9.80859C10.0777 7.91689 9.26383 6.22054 8.00053 4.91205L3.83843 9.80864L10.2648 9.80859Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10" fill="none">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M0.199219 9.85718V0.142822H1.75351L1.75352 9.85718H0.199219ZM5.38021 8.20572L2.14209 4.99999L5.38021 1.79425V4.19855L8.61833 4.19855V1.79425L11.8564 4.99999L8.61832 8.20572L8.61833 5.80142L5.38021 5.80142V8.20572ZM12.2449 0.142822V9.85718H13.7992V0.142822H12.2449Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
2
+ <path d="M5.33336 14L0 8.66664L1.06667 7.59997L6.40003 12.9333L5.33336 14Z" fill="white"/>
3
+ <path d="M8.42227 9.97776L4.00002 9.99998L4.02224 5.57774L5.67225 7.22775L7.22781 5.67219L5.57781 4.02218L10.0001 3.99996L9.97783 8.4222L8.32782 6.7722L6.77226 8.32776L8.42227 9.97776Z" fill="white"/>
4
+ <path d="M7.59997 1.06667L12.9333 6.40003L14 5.33336L8.66664 0L7.59997 1.06667Z" fill="white"/>
5
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
2
+ <path d="M12.4444 0H1.55556C0.7 0 0 0.7 0 1.55556V12.4444C0 13.3 0.7 14 1.55556 14H12.4444C13.3 14 14 13.3 14 12.4444V1.55556C14 0.7 13.3 0 12.4444 0ZM7.80111 3.15778L8.62556 2.33333L9.72222 3.43L10.8189 2.33333L11.6433 3.15778L10.5467 4.25444L11.6433 5.35111L10.8189 6.17556L9.72222 5.08667L8.62556 6.18333L7.80111 5.35889L8.89778 4.26222L7.80111 3.15778ZM2.52778 3.67111H6.41667V4.83778H2.52778V3.67111ZM6.61111 10.1111H5.05556V11.6667H3.88889V10.1111H2.33333V8.94444H3.88889V7.38889H5.05556V8.94444H6.61111V10.1111ZM11.6667 11.0833H7.77778V9.91667H11.6667V11.0833ZM11.6667 9.13889H7.77778V7.97222H11.6667V9.13889Z" fill="#263238"/>
3
+ </svg>
@@ -1,9 +1,13 @@
1
1
  <template>
2
- <wrapper>
3
- <icon-image>
2
+ <wrapper :disabled="disabled" :size="size" :cursor="cursor">
3
+ <icon-image
4
+ :color="color"
5
+ :background-color="backgroundColor"
6
+ :hovered-color="hoveredColor"
7
+ >
4
8
  <i v-html="icon.html" />
5
9
  </icon-image>
6
- <striked-line v-if="isStriked"></striked-line>
10
+ <striked-line v-if="isStriked" :color="color"></striked-line>
7
11
  </wrapper>
8
12
  </template>
9
13
 
@@ -48,27 +52,31 @@ const props = defineProps({
48
52
  isStriked: {
49
53
  required: false,
50
54
  default: false
55
+ },
56
+ backgroundColor: {
57
+ required: false,
58
+ default: null
51
59
  }
52
60
  })
53
61
 
54
- const Wrapper = styled('div')`
62
+ const Wrapper = styled('div', {
63
+ size: String,
64
+ disabled: Boolean,
65
+ cursor: String
66
+ })`
55
67
  display: flex;
56
68
  position: relative;
57
69
  align-content: center;
58
70
  justify-content: center;
59
- width: ${props.size};
60
- height: ${props.size};
61
- min-width: ${props.size};
62
- min-height: ${props.size};
63
- cursor: ${props.disabled ? 'not-allowed' : props.cursor};
71
+ width: ${(props) => props.size};
72
+ height: ${(props) => props.size};
73
+ min-width: ${(props) => props.size};
74
+ min-height: ${(props) => props.size};
75
+ cursor: ${(props) => (props.disabled ? 'not-allowed' : props.cursor)};
64
76
  line-height: 0;
65
77
  `
66
- const strikedAttrs = {
67
- isDisabled: Boolean,
68
- color: String,
69
- hoveredColor: String
70
- }
71
- const StrikedLine = styled.div`
78
+
79
+ const StrikedLine = styled('div', { color: String })`
72
80
  display: flex;
73
81
  position: absolute;
74
82
  bottom: 0;
@@ -77,29 +85,33 @@ const StrikedLine = styled.div`
77
85
  justify-content: center;
78
86
  width: 143%;
79
87
  height: 8%;
80
- background-color: ${({ theme }) => theme.colors[props.color] || props.color};
88
+ background-color: ${({ theme, color }) => theme.colors[color] || color};
81
89
  min-height: 0;
82
90
  line-height: 0;
83
91
  transform-origin: 0% 100%;
84
92
  transform: rotate(-45deg);
85
93
  `
86
- const IconImage = styled.div`
94
+ const IconImage = styled('div', {
95
+ color: String,
96
+ backgroundColor: String,
97
+ hoveredColor: String
98
+ })`
87
99
  width: 100%;
88
100
  svg {
89
101
  width: 100%;
90
102
  height: 100%;
91
- background-color: ${(props) => props.backgroundColor};
92
- padding: ${(props) => props.backgroundColor ? '3px' : '0'};
103
+ background-color: ${(props) =>
104
+ props.backgroundColor ? props.backgroundColor : 'transparent'};
105
+ padding: ${(props) => (props.backgroundColor ? '3px' : '0')};
93
106
  }
94
107
  svg path {
95
- ${({ theme }) =>
96
- props.color && `fill: ${theme.colors[props.color] || props.color};`}
108
+ ${({ theme, color }) => color && `fill: ${theme.colors[color] || color};`}
97
109
  }
98
110
  &:hover > svg path {
99
- ${props.hoveredColor && `fill: ${props.hoveredColor};`}
111
+ ${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
100
112
  }
101
113
  &:hover + div {
102
- background-color: ${props.hoveredColor};
114
+ background-color: ${(props) => props.hoveredColor};
103
115
  }
104
116
  `
105
117
 
@@ -14,6 +14,7 @@
14
14
  :halfComputedTextInfoWidth="halfComputedTextInfoWidth"
15
15
  :alignArrow="alignArrow"
16
16
  :iconSize="size"
17
+ :maxWidth="maxWidth"
17
18
  ><slot />
18
19
  <span v-html="text"></span>
19
20
  </text-overlay>
@@ -52,7 +53,7 @@ const TextOverlay = styled('div', textAttrs)`
52
53
  background: ${(props) => props.theme.colors.black};
53
54
  padding: 10px;
54
55
  width: ${(props) => props.width};
55
- max-width: 400px;
56
+ max-width: ${(props) => props.maxWidth};
56
57
  font-size: 13px;
57
58
  font-weight: 400;
58
59
  line-height: normal;
@@ -124,6 +125,10 @@ export default {
124
125
  width: {
125
126
  required: false,
126
127
  default: '165px'
128
+ },
129
+ maxWidth: {
130
+ type: String,
131
+ default: '400px'
127
132
  }
128
133
  },
129
134
  methods: {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <component-wrapper>
2
+ <component-wrapper @click.stop>
3
3
  <container
4
4
  :checkColor="checkColor"
5
5
  :size="size"
@@ -63,9 +63,34 @@
63
63
  :isError="isError"
64
64
  >{{ unitName }}</unit-container
65
65
  >
66
- <icon-wrapper v-if="isError && !showLinearUnitName" size="16px">
66
+ <icon-wrapper
67
+ v-if="isError && !showLinearUnitName"
68
+ size="16px"
69
+ :marginRight="showSelect ? selectWidth : 0"
70
+ >
67
71
  <icon name="warning" size="16px" cursor="default" />
68
72
  </icon-wrapper>
73
+ <select-wrapper v-if="showSelect">
74
+ <divider />
75
+ <Select
76
+ :showBorder="false"
77
+ :selectWidth="`${selectWidth}px`"
78
+ @input-change="$emit('select-change', $event)"
79
+ >
80
+ <template #selector>
81
+ <select-text>{{ getSelectValue }}</select-text>
82
+ </template>
83
+ <template #dropdown>
84
+ <Option
85
+ v-for="item in selectOptions"
86
+ :key="item.value"
87
+ :value="item.value"
88
+ >
89
+ {{ item.label }}
90
+ </Option>
91
+ </template>
92
+ </Select>
93
+ </select-wrapper>
69
94
  </input-wrapper>
70
95
  <error-message v-if="isError">{{ errorMessage }}</error-message>
71
96
  </container>
@@ -107,6 +132,8 @@ import {
107
132
  } from '../../../helpers/numberConverter'
108
133
  import InfoText from '../../infoText'
109
134
  import ErrorMessage from '../../errorMessage'
135
+ import Select from '../select'
136
+ import Option from '../select/option'
110
137
  import warningIcon from '../../../assets/icons/error_icon.png'
111
138
  import Icon from '../../icon'
112
139
 
@@ -282,16 +309,35 @@ const LabelText = styled('div', inputProps)`
282
309
  font-weight: 700;
283
310
  `
284
311
 
285
- const IconAttrs = { size: String }
312
+ const IconAttrs = { size: String, marginRight: Number }
286
313
  const IconWrapper = styled('div', IconAttrs)`
287
314
  position: absolute;
288
315
  top: 0;
289
316
  bottom: 0;
290
317
  margin: auto;
291
- right: 5px;
318
+ right: ${(props) => props.marginRight + 10}px;
292
319
  height: ${(props) => (props.size ? props.size : 'auto')};
293
320
  `
294
321
 
322
+ const SelectText = styled.div`
323
+ font-size: 13px;
324
+ `
325
+
326
+ const SelectWrapper = styled.div`
327
+ position: absolute;
328
+ top: 2px;
329
+ right: 2px;
330
+ display: flex;
331
+ height: 100%;
332
+ `
333
+
334
+ const Divider = styled.div`
335
+ margin-top: 6px;
336
+ height: calc(100% - 16px);
337
+ width: 1px;
338
+ background-color: ${({ theme }) => theme.colors.grey4};
339
+ `
340
+
295
341
  export default {
296
342
  name: 'input-number',
297
343
  components: {
@@ -306,15 +352,19 @@ export default {
306
352
  InfoText,
307
353
  Icon,
308
354
  SlotContainer,
309
- IconWrapper
355
+ IconWrapper,
356
+ Select,
357
+ Option,
358
+ SelectWrapper,
359
+ SelectText,
360
+ Divider
310
361
  },
311
362
  inheritAttrs: false,
312
363
  data() {
313
364
  return {
314
365
  textInput: '',
315
366
  isFocused: false,
316
- warningIcon: warningIcon,
317
- isBlurred: false
367
+ warningIcon: warningIcon
318
368
  }
319
369
  },
320
370
  props: {
@@ -451,6 +501,22 @@ export default {
451
501
  inputDataId: {
452
502
  required: false,
453
503
  default: ''
504
+ },
505
+ showSelect: {
506
+ type: Boolean,
507
+ default: false
508
+ },
509
+ selectWidth: {
510
+ type: Number,
511
+ default: 70
512
+ },
513
+ selectOptions: {
514
+ type: Array,
515
+ default: () => []
516
+ },
517
+ selectValue: {
518
+ type: [String, Number],
519
+ default: null
454
520
  }
455
521
  },
456
522
  computed: {
@@ -465,6 +531,13 @@ export default {
465
531
  },
466
532
  hasLabelSlot() {
467
533
  return !!this.$slots.label
534
+ },
535
+ getSelectValue() {
536
+ const item = this.selectOptions.find(
537
+ ({ value }) => value === this.selectValue
538
+ )
539
+
540
+ return item ? item.label : '-'
468
541
  }
469
542
  },
470
543
  methods: {
@@ -549,8 +622,7 @@ export default {
549
622
  return array
550
623
  },
551
624
  onInput(event) {
552
- if (this.isBlurred) {
553
- this.isBlurred = false
625
+ if (!this.isFocused) {
554
626
  return
555
627
  }
556
628
  if (event.target.value === '') {
@@ -567,8 +639,6 @@ export default {
567
639
  },
568
640
  onInputBlur(e) {
569
641
  this.isFocused = false
570
- // setting isBlurred so we don't trigger onInput as well
571
- this.isBlurred = true
572
642
  let value = e.target.value
573
643
  let evaluatedInput = this.onEvaluateCode(e)
574
644
  this.onChangeHandler(evaluatedInput ? evaluatedInput : value)
@@ -22,10 +22,15 @@
22
22
  >
23
23
  </input-label>
24
24
  <info-text
25
- v-if="infoTextMessage"
25
+ v-if="infoTextMessage || !!this.$slots.infoText"
26
26
  :text="infoTextMessage"
27
27
  :size="infoTextSize"
28
- />
28
+ :alignArrow="infoTextAlignArrow"
29
+ :width="infoTextWidth"
30
+ :max-width="infoTextWidth"
31
+ >
32
+ <slot name="infoText" />
33
+ </info-text>
29
34
  </label-wrapper>
30
35
  <select-button-wrapper :disabled="disabled">
31
36
  <selectButton
@@ -531,6 +536,14 @@ export default {
531
536
  dropdownMenuPosition: {
532
537
  type: String,
533
538
  default: DROPDOWN_MENU_POSITIONS.Automatic // options: ['automatic', bottom]
539
+ },
540
+ infoTextWidth: {
541
+ type: String,
542
+ required: false
543
+ },
544
+ infoTextAlignArrow: {
545
+ type: String,
546
+ required: false
534
547
  }
535
548
  },
536
549