@eturnity/eturnity_reusable_components 7.24.3-EPDM-11143.0 → 7.24.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.24.3-EPDM-11143.0",
3
+ "version": "7.24.3-EPDM-10647.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -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,7 +352,12 @@ 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() {
@@ -450,6 +501,22 @@ export default {
450
501
  inputDataId: {
451
502
  required: false,
452
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
453
520
  }
454
521
  },
455
522
  computed: {
@@ -464,6 +531,13 @@ export default {
464
531
  },
465
532
  hasLabelSlot() {
466
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 : '-'
467
541
  }
468
542
  },
469
543
  methods: {
@@ -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
@@ -547,6 +552,14 @@ export default {
547
552
  dropdownMenuPosition: {
548
553
  type: String,
549
554
  default: DROPDOWN_MENU_POSITIONS.Automatic // options: ['automatic', bottom]
555
+ },
556
+ infoTextWidth: {
557
+ type: String,
558
+ required: false
559
+ },
560
+ infoTextAlignArrow: {
561
+ type: String,
562
+ required: false
550
563
  }
551
564
  },
552
565
 
@@ -1,11 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
3
- <svg width="800px" height="800px" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
4
- <title>copy</title>
5
- <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
6
- <g id="copy" fill="none" transform="translate(85.333333, 42.666667)">
7
- <path d="M341.333333,85.3333333 L341.333333,405.333333 L85.3333333,405.333333 L85.3333333,85.3333333 L341.333333,85.3333333 Z M298.666667,128 L128,128 L128,362.666667 L298.666667,362.666667 L298.666667,128 Z M234.666667,7.10542736e-15 L234.666667,42.6666667 L42.6666667,42.6666667 L42.6666667,298.666667 L1.42108547e-14,298.666667 L1.42108547e-14,7.10542736e-15 L234.666667,7.10542736e-15 Z">
8
- </path>
9
- </g>
10
- </g>
11
- </svg>