@eturnity/eturnity_reusable_components 7.4.4-EPDM-7260.22 → 7.4.4-EPDM-7260.24

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.4.4-EPDM-7260.22",
3
+ "version": "7.4.4-EPDM-7260.24",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -79,12 +79,7 @@
79
79
  :selectWidth="selectWidth"
80
80
  :paddingLeft="paddingLeft"
81
81
  >
82
- <slot
83
- v-if="!simpleDropdown"
84
- name="selector"
85
- :selectedValue="selectedValue"
86
- ></slot>
87
- <select-text v-else>{{ selectedValue[OptionKey] }}</select-text>
82
+ <slot name="selector" :selectedValue="selectedValue"></slot>
88
83
  </selector>
89
84
  <Caret @click.stop="toggleCaretDropdown" v-if="dropDownArrowVisible">
90
85
  <icon
@@ -133,19 +128,7 @@
133
128
  @option-selected="optionSelected"
134
129
  @option-hovered="optionHovered"
135
130
  >
136
- <slot v-if="!simpleDropdown" name="dropdown"></slot>
137
- <template v-else>
138
- <Option
139
- v-for="item of dropdownOptions"
140
- :key="item.id"
141
- :value="item"
142
- :data-id="`dropdown_option_${dataId}_${value.id}`"
143
- >
144
- <SelectText>
145
- {{ item[OptionKey] }}
146
- </SelectText>
147
- </Option>
148
- </template>
131
+ <slot name="dropdown"></slot>
149
132
  </selectDropdown>
150
133
  </Teleport>
151
134
  </DropdownWrapper>
@@ -183,7 +166,6 @@ import styled from 'vue3-styled-components'
183
166
  import InfoText from '../../infoText'
184
167
  import icon from '../../icon'
185
168
  import inputText from '../inputText'
186
- import Option from './option'
187
169
  import draggableInputHandle from '../../draggableInputHandle'
188
170
 
189
171
  const CARET_WIDTH = '30px'
@@ -201,10 +183,6 @@ const Caret = styled.div`
201
183
  margin-left: auto;
202
184
  `
203
185
 
204
- const SelectText = styled.span`
205
- font-size: 13px;
206
- `
207
-
208
186
  const selectorProps = {
209
187
  selectWidth: String,
210
188
  paddingLeft: String,
@@ -357,7 +335,7 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
357
335
  : props.fontColor};
358
336
  max-height: 300px;
359
337
  overflow-y: auto;
360
- & > div[data-value='${(props) => JSON.stringify(props.hoveredValue)}'] {
338
+ & > div[data-value='${(props) => props.hoveredValue}'] {
361
339
  background-color: ${(props) =>
362
340
  props.theme.colors[props.hoveredBgColor]
363
341
  ? props.theme.colors[props.hoveredBgColor]
@@ -373,7 +351,7 @@ const inputAttrs = { alignItems: String, hasLabel: Boolean, minWidth: String }
373
351
  const InputWrapper = styled('div', inputAttrs)`
374
352
  position: relative;
375
353
  display: grid;
376
- width: max-content;
354
+ width: 100%;
377
355
  min-width: ${(props) => (props.minWidth ? props.minWidth : '150px')};
378
356
  align-items: center;
379
357
  gap: 8px;
@@ -530,20 +508,6 @@ export default {
530
508
  dropdownMenuPosition: {
531
509
  type: String,
532
510
  default: DROPDOWN_MENU_POSITIONS.Automatic // options: ['automatic', bottom]
533
- },
534
-
535
- // This prop is used to enable the simple dropdown mode, we needed a key inorder to display desired properties
536
- simpleDropdown: {
537
- type: Boolean,
538
- default: false
539
- },
540
- Options: {
541
- type: Array,
542
- default: () => []
543
- },
544
- OptionKey: {
545
- type: String,
546
- default: 'value'
547
511
  }
548
512
  },
549
513
 
@@ -556,8 +520,6 @@ export default {
556
520
  LabelWrapper,
557
521
  optionalLabel,
558
522
  InfoText,
559
- Option,
560
- SelectText,
561
523
  InputWrapper,
562
524
  DropdownWrapper,
563
525
  icon,
@@ -571,11 +533,7 @@ export default {
571
533
  data() {
572
534
  return {
573
535
  selectedValue: null,
574
- paddingLeft: this.isDraggable
575
- ? '30px'
576
- : this.leftPadding
577
- ? this.leftPadding
578
- : '15px',
536
+ paddingLeft: this.isDraggable ? '30px' : this.leftPadding,
579
537
  isDropdownOpen: false,
580
538
  isActive: false,
581
539
  textSearch: '',
@@ -585,15 +543,11 @@ export default {
585
543
  left: null,
586
544
  top: null
587
545
  },
588
- dropdownOptions: [],
589
546
  dropdownWidth: null,
590
547
  hoveredValue: null
591
548
  }
592
549
  },
593
550
  mounted() {
594
- if (this.Options.length > 0) {
595
- this.dropdownOptions = this.Options
596
- }
597
551
  this.observeDropdownHeight()
598
552
  this.observeSelectWidth()
599
553
  window.addEventListener('resize', this.handleSetDropdownOffet)
@@ -639,7 +593,6 @@ export default {
639
593
  this.$emit('input-change', e)
640
594
  },
641
595
  optionHovered(e) {
642
- console.log(e)
643
596
  this.hoveredValue = e
644
597
  },
645
598
  mouseEnterHandler() {
@@ -661,23 +614,16 @@ export default {
661
614
  searchChange(value) {
662
615
  this.textSearch = value
663
616
  this.$emit('search-change', value)
617
+ const dropdownChildren = [...this.$refs.dropdown.$el.children]
618
+ dropdownChildren.forEach((el) => {
619
+ if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
620
+ el.style.display = 'none'
664
621
 
665
- if (this.simpleDropdown) {
666
- this.dropdownOptions = this.Options.filter((option) =>
667
- option[this.OptionKey].toLowerCase().includes(value.toLowerCase())
668
- )
669
- } else {
670
- const dropdownChildren = [...this.$refs.dropdown.$el.children]
671
- dropdownChildren.forEach((el) => {
672
- if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
673
- el.style.display = 'none'
674
-
675
- return
676
- }
622
+ return
623
+ }
677
624
 
678
- el.style.display = 'inherit'
679
- })
680
- }
625
+ el.style.display = 'inherit'
626
+ })
681
627
  },
682
628
  clickOutside(event) {
683
629
  const dropdownRef = this.$refs.dropdown
@@ -838,12 +784,9 @@ export default {
838
784
  return Number(item.replace('px', ''))
839
785
  }
840
786
 
841
- const value =
842
- this.selectWidth === '100%'
843
- ? '100%'
844
- : removePX(this.selectWidth) - removePX(CARET_WIDTH)
845
-
846
- return value + 'px'
787
+ return this.selectWidth === '100%'
788
+ ? '100%'
789
+ : removePX(this.selectWidth) - removePX(CARET_WIDTH) + 'px'
847
790
  },
848
791
  getOptionWidth() {
849
792
  if (this.optionWidth) return this.optionWidth
@@ -528,15 +528,15 @@ export default {
528
528
  const existing = this.OverlapId.find((id) => id === label.id)
529
529
 
530
530
  if (!existing) this.OverlapId.push(label.id)
531
- return
532
- } else
533
- this.OverlapId = this.OverlapId
534
- ? this.OverlapId.filter((id) => id !== label.id)
535
- : []
531
+ }
536
532
  })
537
533
  })
538
534
  }
539
535
 
536
+ if (!overlapContainer.includes(true)) {
537
+ this.OverlapId = []
538
+ }
539
+
540
540
  this.hasOverlap = overlapContainer.includes(true)
541
541
  this.$emit('has-overlap', overlapContainer.includes(true))
542
542
  }