@eturnity/eturnity_reusable_components 6.42.2-EPDM-6921.0 → 6.42.2-qa-16-10.23.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": "6.42.2-EPDM-6921.0",
3
+ "version": "6.42.2-qa-16-10.23.0",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
package/src/App.vue CHANGED
@@ -1,109 +1,107 @@
1
1
  <template>
2
2
  <ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
3
3
  <page-container>
4
+ <br />
4
5
 
5
- <br/>
6
- <input-number
7
- :value="value"
8
- :minNumber="0"
9
- unitName="mm"
10
- :numberPrecision="0"
11
- backgroundColor="transparent"
12
- borderColor="eturnityGrey"
13
- inputHeight="34px"
14
- inputWidth="420px"
15
- textAlign="left"
16
- :isInteractive="true"
17
- :interactionStep="1"
18
- @on-input="value = $event"
19
- @input-change="changeHandler"
20
- @input-focus="focusHandler"
21
- @input-blur="blurHandler"
22
- >
23
- <template v-slot:label>
24
- <div>Interactive Label</div>
25
- </template>
26
- </input-number>
27
-
28
- <dropdown-component openingMode="hover" gap="30px">
29
- <template #trigger><i>Click Me</i></template>
30
- <template #dropdown>
31
- <div>
32
- <a href="">test1</a>
33
- <button href="">test2</button>
34
- <br>
35
- <p>Text</p>
36
- </div>
37
- </template>
38
- </dropdown-component>
39
-
40
- <videoThumbnail
41
- src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
42
- playIconColor="red"
43
- playIconSize="20px"
44
- width="400px"
45
- height="600px"
46
- />
6
+ {{ alignItems }}
7
+ <input-number
8
+ :value="value"
9
+ :minNumber="0"
10
+ unitName="mm"
11
+ :numberPrecision="0"
12
+ backgroundColor="transparent"
13
+ borderColor="eturnityGrey"
14
+ inputHeight="34px"
15
+ inputWidth="420px"
16
+ textAlign="left"
17
+ :isInteractive="true"
18
+ :interactionStep="1"
19
+ @on-input="value = $event"
20
+ @input-change="changeHandler"
21
+ @input-focus="focusHandler"
22
+ @input-blur="blurHandler"
23
+ >
24
+ <template v-slot:label>
25
+ <div>Interactive Label</div>
26
+ </template>
27
+ </input-number>
28
+
29
+ <dropdown-component openingMode="hover" gap="30px">
30
+ <template #trigger><i>Click Me</i></template>
31
+ <template #dropdown>
32
+ <div>
33
+ <a href="">test1</a>
34
+ <button href="">test2</button><br>
35
+ <p>Text</p>
36
+ </div>
37
+ </template>
38
+ </dropdown-component>
39
+
40
+ <videoThumbnail src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
41
+ playIconColor="red"
42
+ playIconSize="20px"
43
+ width="400px"
44
+ height="600px"
45
+ />
47
46
 
48
- <SwitchField
49
- @on-switch-change="onInputChange($event)"
50
- :options="[
47
+ <SwitchField
48
+ @on-switch-change="onInputChange($event)"
49
+ :options="[
51
50
  { value: 0, content: 'zero' },
52
51
  { value: 1, content: 'one' },
53
52
  { value: 2, content: 'two' }
54
53
  ]"
55
- :value="value"
56
- label="label"
57
- toggleColor="red"
58
- size="large"
59
- backgroundColor="blue"
60
- labelAlign="left"
61
- fontColor="black"
62
- :disabled="false"
63
- />
64
- <icon
65
- name="opacity"
66
- color="red"
67
- hoveredColor="blue"
68
- size="60px"
69
- cursor="default"
70
- isStriked="true"
71
- />
72
- <Select
73
- :value="value"
74
- selectWidth="100%"
75
- optionWidth="50%"
76
- label="that is a label"
77
- alignItems="vertical"
78
- colorMode="dark"
79
- isSearchable="true"
80
- @input-change="value = $event"
81
- @search-change="searchValue = $event"
82
- >
83
- <template #selector="{ selectedValue }">
84
- value selected: {{ selectedValue }}
85
- </template>
86
- <template #dropdown>
87
- <Option
88
- v-for="opt in filteredOptionList"
89
- :key="opt.id"
90
- :value="opt.val"
91
- >{{ opt.lookFor }}
92
- </Option
54
+ :value="value"
55
+ label="label"
56
+ toggleColor="red"
57
+ size="large"
58
+ backgroundColor="blue"
59
+ labelAlign="left"
60
+ fontColor="black"
61
+ :disabled="false"
62
+ />
63
+ <icon
64
+ name="opacity"
65
+ color="red"
66
+ hoveredColor="blue"
67
+ size="60px"
68
+ cursor="default"
69
+ isStriked = "true"
70
+ />
71
+ <Select
72
+ :value="value"
73
+ selectWidth="100%"
74
+ optionWidth="50%"
75
+ label="that is a label"
76
+ alignItems="vertical"
77
+ colorMode="dark"
78
+ isSearchable="true"
79
+ @input-change="value = $event"
80
+ @search-change="searchValue = $event"
93
81
  >
94
- </template>
95
- </Select>
96
-
97
-
98
- {{ filteredOptionList }}
99
-
100
- <iconCollection color="red"/>
82
+ <template #selector="{ selectedValue }">
83
+ value selected: {{ selectedValue }}
84
+ </template>
85
+ <template #dropdown>
86
+ <Option
87
+ v-for="opt in filteredOptionList"
88
+ :key="opt.id"
89
+ :value="opt.val"
90
+ >{{ opt.lookFor }}</Option
91
+ >
92
+ </template>
93
+ </Select>
94
+
95
+
96
+ {{ filteredOptionList }}
97
+
98
+ <iconCollection color="red" />
101
99
  </page-container>
102
100
  </ThemeProvider>
103
101
  </template>
104
102
 
105
103
  <script>
106
- import {ThemeProvider} from 'vue-styled-components'
104
+ import { ThemeProvider } from 'vue-styled-components'
107
105
  import theme from './assets/theme'
108
106
  import styled from 'vue-styled-components'
109
107
  import InputNumber from '@/components/inputs/inputNumber'
@@ -146,14 +144,14 @@ export default {
146
144
  value2: 42,
147
145
  companyName: 'toto',
148
146
  optionList: [
149
- {id: 'a', val: 'A', lookFor: 'babababa'},
150
- {id: 'b', val: 'B', lookFor: 'abab'},
151
- {id: 'c', val: 'C', lookFor: 'ccc'},
152
- {id: 'd', val: 'D', lookFor: 'ddd'},
153
- {id: 'e', val: 'E', lookFor: 'dddee'},
154
- {id: 'f', val: 'F', lookFor: 'ddfff'},
155
- {id: 'g', val: 'G', lookFor: 'dggg'},
156
- {id: 'h', val: 'H', lookFor: 'dddhhh'},
147
+ { id: 'a', val: 'A', lookFor: 'babababa' },
148
+ { id: 'b', val: 'B', lookFor: 'abab' },
149
+ { id: 'c', val: 'C', lookFor: 'ccc' },
150
+ { id: 'd', val: 'D', lookFor: 'ddd' },
151
+ { id: 'e', val: 'E', lookFor: 'dddee' },
152
+ { id: 'f', val: 'F', lookFor: 'ddfff' },
153
+ { id: 'g', val: 'G', lookFor: 'dggg' },
154
+ { id: 'h', val: 'H', lookFor: 'dddhhh' },
157
155
  ],
158
156
  searchValue: ''
159
157
  }
@@ -161,7 +159,7 @@ export default {
161
159
  computed: {
162
160
  filteredOptionList() {
163
161
  return this.optionList.filter((opt) =>
164
- opt.lookFor.includes(this.searchValue)
162
+ opt.lookFor.includes(this.searchValue)
165
163
  )
166
164
  }
167
165
  },
@@ -224,7 +222,7 @@ export default {
224
222
  ]
225
223
  return items
226
224
  },
227
- getComponentInfo({row, value}) {
225
+ getComponentInfo({ row, value }) {
228
226
  let item
229
227
  if (row.selectedValue && row.selectedValue[value]) {
230
228
  item = row.selectedValue[value]
@@ -32,7 +32,6 @@
32
32
  ref="select"
33
33
  @click="toggleDropdown"
34
34
  :selectHeight="selectHeight"
35
- :height="height"
36
35
  :selectMinHeight="selectMinHeight"
37
36
  :bgColor="
38
37
  buttonBgColor || colorMode == 'dark' ? 'transparentBlack1' : 'white'
@@ -144,7 +143,9 @@ const Caret = styled.div`
144
143
  justify-content: center;
145
144
  width: 30px;
146
145
  min-width: 30px;
147
- padding-top: 3px;
146
+ height: 100%;
147
+ align-items: stretch
148
+ padding-top: 5px;
148
149
  cursor: pointer;
149
150
  margin-left: auto;
150
151
  `
@@ -192,7 +193,6 @@ const selectButtonAttrs = {
192
193
  hasError: Boolean,
193
194
  disabled: Boolean,
194
195
  selectHeight: String,
195
- height: String,
196
196
  selectMinHeight: String,
197
197
  isSearchBarVisible: Boolean,
198
198
  showBorder: Boolean
@@ -208,7 +208,6 @@ const selectButton = styled('div', selectButtonAttrs)`
208
208
  display: flex;
209
209
  align-items: center;
210
210
  max-height: ${(props) => props.selectHeight};
211
- ${(props) => (props.height ? `height: ${props.height}` : '')};
212
211
  ${({ showBorder, theme, hasError }) =>
213
212
  showBorder &&
214
213
  `
@@ -310,10 +309,6 @@ export default {
310
309
  required: false,
311
310
  default: null
312
311
  },
313
- height: {
314
- required: false,
315
- default: null
316
- },
317
312
  selectMinHeight: {
318
313
  required: false,
319
314
  default: '36px'
@@ -104,12 +104,7 @@
104
104
  :src="require('../../assets/icons/collapse_arrow_icon.svg')"
105
105
  />
106
106
  </arrow-wrapper>
107
- <options-container
108
- v-if="isOpen"
109
- :top="getItemLocation('top')"
110
- :left="getItemLocation('left')"
111
- ref="optionsContainer"
112
- >
107
+ <options-container v-if="isOpen" ref="optionsContainer">
113
108
  <options-wrapper @click.prevent.stop>
114
109
  <search-container @click.prevent.stop>
115
110
  <search-input
@@ -288,8 +283,7 @@ const OptionsContainer = styled('div', optionsAttrs)`
288
283
  position: absolute;
289
284
  display: grid;
290
285
  grid-template-rows: 1fr auto;
291
- top: ${(props) => props.top + 'px'};
292
- left: ${(props) => props.left + 'px'};
286
+ left: 20px;
293
287
  width: auto;
294
288
  max-height: 360px;
295
289
  min-height: 200px;
@@ -510,8 +504,13 @@ export default {
510
504
  }
511
505
  },
512
506
  methods: {
513
- toggleOpen() {
514
- if (this.disabled) {
507
+ toggleOpen(event) {
508
+ if (
509
+ this.isDisabled ||
510
+ (event &&
511
+ !(event.target === this.$el) &&
512
+ !this.$el.contains(event.target))
513
+ ) {
515
514
  return
516
515
  }
517
516
  this.wasClicked = false
@@ -558,14 +557,6 @@ export default {
558
557
  this.inputText = value
559
558
  this.$emit('dropdown-search', value)
560
559
  },
561
- getItemLocation(value) {
562
- let ref = this.$refs.dropdownItem[0]
563
- let location = ref.$el.getBoundingClientRect()[value]
564
- if (value === 'top') {
565
- location = location + window.scrollY + 40
566
- }
567
- return location
568
- },
569
560
  clickOutside(event) {
570
561
  if (event.target === this.$el || this.$el.contains(event.target)) {
571
562
  return
@@ -1,9 +1,15 @@
1
1
  <template>
2
- <page-container>
2
+ <page-container
3
+ :tableHeight="tableHeight"
4
+ :shouldSetCustomHeight="doesTableContainDraggables"
5
+ >
3
6
  <table-title v-if="titleText">
4
7
  {{ titleText }}
5
8
  </table-title>
6
- <table-scroll>
9
+ <table-scroll
10
+ ref="tableRef"
11
+ :isPositionAbsolute="doesTableContainDraggables"
12
+ >
7
13
  <table-wrapper :fullWidth="fullWidth">
8
14
  <spinner-wrapper v-if="isLoading">
9
15
  <spinner />
@@ -26,7 +32,15 @@
26
32
  import styled from 'vue-styled-components'
27
33
  import Spinner from '../../spinner'
28
34
 
29
- const PageContainer = styled.div``
35
+ const pageContainerProps = {
36
+ tableHeight: String,
37
+ shouldSetCustomHeight: Boolean
38
+ }
39
+ const PageContainer = styled('div', pageContainerProps)`
40
+ position: relative;
41
+ height: ${(props) =>
42
+ props.shouldSetCustomHeight ? props.tableHeight : 'auto'};
43
+ `
30
44
 
31
45
  const TableTitle = styled.div`
32
46
  margin-bottom: 16px;
@@ -35,15 +49,27 @@ const TableTitle = styled.div`
35
49
  text-transform: uppercase;
36
50
  `
37
51
 
38
- const TableScroll = styled.div`
52
+ const tableScrollProps = {
53
+ isPositionAbsolute: Boolean
54
+ }
55
+
56
+ const TableScroll = styled('div', tableScrollProps)`
39
57
  max-width: 100%;
58
+ height: auto;
59
+ ${(props) =>
60
+ props.isPositionAbsolute &&
61
+ `
62
+ position: absolute;
63
+ left: -20px;
64
+ `}
40
65
  `
41
66
 
42
67
  const wrapperAttrs = { fullWidth: Boolean }
43
68
  const TableWrapper = styled('div', wrapperAttrs)`
44
69
  width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
45
70
  max-width: 100%;
46
- overflow: auto;
71
+ overflow-x: auto;
72
+ overflow-y: hidden;
47
73
 
48
74
  ::-webkit-scrollbar {
49
75
  height: 5px; //height of the whole scrollbar area
@@ -67,7 +93,11 @@ const SpinnerWrapper = styled.div`
67
93
  justify-items: center;
68
94
  `
69
95
 
70
- const containerAttrs = { cellPaddings: String, tableCursor: String }
96
+ const containerAttrs = {
97
+ cellPaddings: String,
98
+ tableCursor: String
99
+ }
100
+
71
101
  const TableContainer = styled('table', containerAttrs)`
72
102
  width: 100%;
73
103
  border-collapse: collapse;
@@ -378,6 +408,39 @@ export default {
378
408
  tableCursor: {
379
409
  required: false
380
410
  }
411
+ },
412
+ data() {
413
+ return {
414
+ tableHeight: 'auto',
415
+ doesTableContainDraggables: false
416
+ }
417
+ },
418
+ mounted() {
419
+ this.observeTableHeight()
420
+ },
421
+ beforeDestroy() {
422
+ if (this.resizeObserver) {
423
+ this.resizeObserver.disconnect()
424
+ }
425
+ },
426
+ methods: {
427
+ observeTableHeight() {
428
+ if (!this.$refs.tableRef) return
429
+
430
+ const tableElement = this.$refs.tableRef.$el
431
+
432
+ this.resizeObserver = new ResizeObserver(() => {
433
+ const newTableHeight = this.titleText
434
+ ? tableElement.offsetHeight + 33
435
+ : tableElement.offsetHeight
436
+ this.tableHeight = `${newTableHeight}px`
437
+ this.doesTableContainDraggables = Boolean(
438
+ tableElement.querySelector('.drag-container')
439
+ )
440
+ })
441
+
442
+ this.resizeObserver.observe(tableElement)
443
+ }
381
444
  }
382
445
  }
383
446
  </script>
@@ -8,8 +8,6 @@
8
8
  <dropdown-container
9
9
  v-if="isOpen"
10
10
  @click.stop
11
- :top="getItemLocation('top')"
12
- :right="getItemLocation('right')"
13
11
  :containerWidth="childOpen ? 440 : 240"
14
12
  ref="dropdownContainer"
15
13
  >
@@ -130,6 +128,7 @@ const PageContainer = styled.div`
130
128
  justify-items: center;
131
129
  width: 30px;
132
130
  height: 30px;
131
+ position: relative;
133
132
 
134
133
  &:hover {
135
134
  background-color: ${(props) => props.theme.colors.grey5};
@@ -158,12 +157,15 @@ const DotItem = styled.div`
158
157
  border-radius: 50%;
159
158
  `
160
159
 
161
- const dropdownAttrs = { top: Number, right: Number, containerWidth: Number }
160
+ const dropdownAttrs = {
161
+ containerWidth: Number
162
+ }
162
163
  const DropdownContainer = styled('div', dropdownAttrs)`
163
164
  z-index: 99;
164
165
  height: 200px;
165
- top: ${(props) => props.top + 'px'};
166
- left: ${(props) => props.right - props.containerWidth + 'px'};
166
+ top: 0;
167
+ right: 27px;
168
+
167
169
  position: absolute;
168
170
  display: grid;
169
171
  grid-template-columns: auto auto;
@@ -299,14 +301,6 @@ export default {
299
301
  document.removeEventListener('click', this.clickOutside)
300
302
  }
301
303
  },
302
- getItemLocation(value) {
303
- let ref = this.$refs.dropdownItem
304
- let location = ref.$el.getBoundingClientRect()[value]
305
- if (value === 'top') {
306
- location = location + window.scrollY
307
- }
308
- return location
309
- },
310
304
  hasChildren(item) {
311
305
  return !!item.children && !!item.children.length
312
306
  },