@eturnity/eturnity_reusable_components 7.20.0--EPDM-10564.2 → 7.20.0--EPDM-5518.4

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/babel.config.js CHANGED
@@ -1,3 +1,5 @@
1
1
  module.exports = {
2
- presets: ['@vue/cli-plugin-babel/preset']
3
- }
2
+ presets: [
3
+ '@vue/cli-plugin-babel/preset'
4
+ ]
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.20.0--EPDM-10564.2",
3
+ "version": "7.20.0--EPDM-5518.4",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -23,6 +23,7 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@babel/core": "7.12.16",
26
+ "@babel/eslint-parser": "7.12.16",
26
27
  "@vue/cli-plugin-babel": "5.0.8",
27
28
  "@vue/cli-plugin-eslint": "5.0.8",
28
29
  "@vue/cli-service": "5.0.8",
@@ -0,0 +1,3 @@
1
+ <svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5 10C7.76142 10 10 7.76142 10 5C10 2.23858 7.76142 0 5 0C2.23858 0 0 2.23858 0 5C0 7.76142 2.23858 10 5 10ZM5.875 5.05243V2.125H4.125V5.92743L6.19061 7.47663L7.24061 6.07663L5.875 5.05243Z" fill="white"/>
3
+ </svg>
@@ -268,6 +268,12 @@
268
268
  :text="buttonText.cancel"
269
269
  @click="$emit('on-cancel-view')"
270
270
  />
271
+ <reset-container v-if="!filterViews || !filterViews.length">
272
+ <reset-button @click="$emit('on-reset-filters')">
273
+ <icon :name="'update'" size="14px" :color="theme.colors.blue" />
274
+ <div>{{ $gettext('reset_filters') }}</div>
275
+ </reset-button>
276
+ </reset-container>
271
277
  </button-container>
272
278
  </container-wrapper>
273
279
  </template>
@@ -329,6 +335,16 @@ const ButtonContainer = styled.div`
329
335
  padding: 15px;
330
336
  `
331
337
 
338
+ const ResetContainer = styled.div`
339
+ display: grid;
340
+ align-content: center;
341
+ margin-left: auto;
342
+ div {
343
+ margin-top: 0;
344
+ align-self: center;
345
+ }
346
+ `
347
+
332
348
  const ColumnContainer = styled.div``
333
349
 
334
350
  const DragContainer = styled.div`
@@ -455,6 +471,7 @@ export default {
455
471
  DeleteIcon,
456
472
  UpperContainer,
457
473
  ResetButton,
474
+ ResetContainer,
458
475
  VueDatePicker
459
476
  },
460
477
  props: {
@@ -26,7 +26,7 @@
26
26
  //To use:
27
27
  // <info-text
28
28
  // text="Veritatis et quasi architecto beatae vitae"
29
- // size="20px"
29
+ // size="20"
30
30
  // alignArrow="right" // which side the arrow should be on
31
31
  // />
32
32
  import theme from '../../assets/theme.js'
@@ -3,10 +3,11 @@
3
3
  <container
4
4
  :checkColor="checkColor"
5
5
  :size="size"
6
- :hasLabel="hasLabel"
6
+ :hasLabel="label && !!label.length"
7
7
  :backgroundColor="backgroundColor"
8
8
  :isChecked="isChecked"
9
9
  :isDisabled="isDisabled"
10
+ :cursorType="cursorType"
10
11
  >
11
12
  <input-checkbox
12
13
  type="checkbox"
@@ -17,7 +18,7 @@
17
18
  <check-wrapper :hasLabel="hasLabel">
18
19
  <span class="checkmark"></span>
19
20
  </check-wrapper>
20
- <label-text v-if="hasLabel">{{ label }}</label-text>
21
+ <label-text v-if="label && !!label.length">{{ label }}</label-text>
21
22
  </container>
22
23
  </component-wrapper>
23
24
  </template>
@@ -33,6 +34,7 @@
33
34
  // size="small"
34
35
  // backgroundColor="red"
35
36
  // :isDisabled="true"
37
+ // cursorType="default"
36
38
  // />
37
39
  import styled from 'vue3-styled-components'
38
40
 
@@ -55,7 +57,8 @@ const containerAttrs = {
55
57
  hasLabel: Boolean,
56
58
  backgroundColor: String,
57
59
  isChecked: Boolean,
58
- isDisabled: Boolean
60
+ isDisabled: Boolean,
61
+ cursorType: String
59
62
  }
60
63
  const Container = styled('label', containerAttrs)`
61
64
  display: grid;
@@ -64,7 +67,7 @@ const Container = styled('label', containerAttrs)`
64
67
  align-content: center;
65
68
  color: ${(props) => props.theme.colors.black};
66
69
  position: relative;
67
- cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
70
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursorType)};
68
71
  font-size: 16px;
69
72
  user-select: none;
70
73
 
@@ -89,7 +92,7 @@ const Container = styled('label', containerAttrs)`
89
92
  : props.theme.colors.green
90
93
  : props.isDisabled
91
94
  ? props.theme.colors.lightGray
92
- : '#fff'};
95
+ : props.theme.colors.white};
93
96
  border-radius: 4px;
94
97
  border: 1px solid
95
98
  ${(props) =>
@@ -183,6 +186,10 @@ export default {
183
186
  dataId: {
184
187
  type: String,
185
188
  default: ''
189
+ },
190
+ cursorType: {
191
+ type: String,
192
+ default: 'pointer'
186
193
  }
187
194
  },
188
195
  computed: {
@@ -328,7 +328,7 @@ export default {
328
328
  }
329
329
  },
330
330
  methods: {
331
- onEnterPress(event){
331
+ onEnterPress() {
332
332
  this.$emit('on-enter-click')
333
333
  this.$refs.inputElement.$el.blur()
334
334
  },
@@ -1,16 +1,18 @@
1
1
  <template>
2
2
  <Container
3
3
  :selectWidth="selectWidth"
4
- :noRelative="noRelative"
5
4
  @mouseenter="mouseEnterHandler"
6
5
  @mouseleave="mouseLeaveHandler"
7
6
  >
8
7
  <input-wrapper
9
8
  :hasLabel="!!label && label.length > 0"
10
9
  :alignItems="alignItems"
11
- :noRelative="noRelative"
12
10
  >
13
- <label-wrapper v-if="label" :data-id="labelDataId">
11
+ <label-wrapper
12
+ v-if="label"
13
+ :data-id="labelDataId"
14
+ :shownDropdown="shownDropdown"
15
+ >
14
16
  <input-label
15
17
  :fontColor="
16
18
  labelFontColor || colorMode == 'dark' ? 'white' : 'eturnityGrey'
@@ -49,9 +51,7 @@
49
51
  :showBorder="showBorder"
50
52
  :data-id="dataId"
51
53
  :paddingLeft="paddingLeft"
52
- :tablePaddingLeft="tablePaddingLeft"
53
- :noRelative="noRelative"
54
- :showDisabledBackground="showDisabledBackground"
54
+ :shownDropdown="shownDropdown"
55
55
  >
56
56
  <draggableInputHandle
57
57
  v-if="isDraggable && !isSearchBarVisible"
@@ -75,13 +75,14 @@
75
75
  />
76
76
  <selector
77
77
  v-else
78
- :showBorder="showBorder"
79
78
  :selectWidth="selectWidth"
80
79
  :paddingLeft="paddingLeft"
80
+ :noMaxWidth="noMaxWidth"
81
+ :showBorder="showBorder"
81
82
  >
82
83
  <slot name="selector" :selectedValue="selectedValue"></slot>
83
84
  </selector>
84
- <Caret @click.stop="toggleCaretDropdown" class="caret_dropdown">
85
+ <Caret @click.stop="toggleCaretDropdown">
85
86
  <icon
86
87
  v-if="isDropdownOpen"
87
88
  name="arrow_up"
@@ -104,7 +105,7 @@
104
105
  />
105
106
  </Caret>
106
107
  </selectButton>
107
- <DropdownWrapper ref="dropdownWrapperRef" :noRelative="noRelative">
108
+ <DropdownWrapper ref="dropdownWrapperRef">
108
109
  <Teleport to="#portal-target">
109
110
  <selectDropdown
110
111
  ref="dropdown"
@@ -123,13 +124,10 @@
123
124
  :fontColor="
124
125
  dropdownFontColor || colorMode == 'dark' ? 'white' : 'black'
125
126
  "
126
- :noRelative="noRelative"
127
127
  :fontSize="fontSize"
128
- :minWidth="minWidth"
129
128
  :selectedValue="selectedValue"
130
129
  @option-selected="optionSelected"
131
130
  @option-hovered="optionHovered"
132
- @mouseleave="optionLeave"
133
131
  >
134
132
  <slot name="dropdown"></slot>
135
133
  </selectDropdown>
@@ -188,22 +186,17 @@ const Caret = styled.div`
188
186
  const selectorProps = {
189
187
  selectWidth: String,
190
188
  paddingLeft: String,
191
- showBorder: Boolean
189
+ showBorder: Boolean,
190
+ noMaxWidth: Boolean
192
191
  }
193
192
  const Selector = styled('div', selectorProps)`
194
- ${(props) =>
195
- props.selectWidth === '100%'
196
- ? 'width: 100%;'
197
- : `width: calc(${props.selectWidth} -
198
- (
199
- ${CARET_WIDTH} +
200
- ${props.paddingLeft}
201
- ${props.showBorder ? `+ (${BORDER_WIDTH} * 2)` : ''}
202
- )
203
- );
204
- white-space: nowrap;
205
- text-overflow: ellipsis;
206
- overflow: hidden;`}
193
+ max-width: ${(props) =>
194
+ props.noMaxWidth
195
+ ? '100%'
196
+ : `calc(${props.selectWidth} - (${CARET_WIDTH} + ${props.paddingLeft} + (${BORDER_WIDTH} * 2)))`};
197
+ white-space: nowrap;
198
+ text-overflow: ellipsis;
199
+ overflow: hidden;
207
200
  `
208
201
 
209
202
  const labelAttrs = { fontSize: String, fontColor: String }
@@ -220,18 +213,19 @@ const optionalLabel = styled.span`
220
213
  `
221
214
  const inputProps = {
222
215
  selectWidth: String,
223
- optionWidth: String,
224
- noRelative: Boolean
216
+ optionWidth: String
225
217
  }
226
218
  const Container = styled('div', inputProps)`
227
219
  width: ${(props) => props.selectWidth};
228
- position: ${(props) => (props.noRelative ? 'static' : 'relative')};
220
+ position: relative;
229
221
  display: inline-block;
230
222
  `
231
- const LabelWrapper = styled.div`
223
+
224
+ const LabelAttrs = { shownDropdown: Boolean }
225
+ const LabelWrapper = styled('div', LabelAttrs)`
232
226
  display: inline-grid;
233
227
  grid-template-columns: auto auto;
234
- grid-gap: 12px;
228
+ grid-gap: ${(props) => (props.shownDropdown ? '0' : '12px')};
235
229
  align-items: center;
236
230
  justify-content: start;
237
231
  `
@@ -255,23 +249,17 @@ const selectButtonAttrs = {
255
249
  hasNoPadding: Boolean,
256
250
  showBorder: Boolean,
257
251
  paddingLeft: String,
258
- noRelative: Boolean,
259
- tablePaddingLeft: String,
260
- showDisabledBackground: Boolean
252
+ shownDropdown: Boolean
261
253
  }
262
254
  const selectButton = styled('div', selectButtonAttrs)`
263
- position: ${(props) => (props.noRelative ? 'static' : 'relative')};
255
+ position: relative;
264
256
  box-sizing: border-box;
265
257
  border-radius: 4px;
266
258
  max-width: ${(props) => (props.selectWidth ? props.selectWidth : '100%')};
267
259
  ${(props) =>
268
- props.isSearchBarVisible
260
+ props.isSearchBarVisible || props.hasNoPadding
269
261
  ? ''
270
- : `padding-left: ${
271
- props.tablePaddingLeft ? props.tablePaddingLeft : props.paddingLeft
272
- }`};
273
- ${(props) =>
274
- props.hasNoPadding ? '' : `padding-left: ${props.paddingLeft}`};
262
+ : `padding-left: ${props.shownDropdown ? '0' : props.paddingLeft}`};
275
263
  text-align: left;
276
264
  min-height: ${(props) =>
277
265
  props.selectHeight
@@ -292,7 +280,7 @@ const selectButton = styled('div', selectButtonAttrs)`
292
280
  }
293
281
  `}
294
282
  background-color:${(props) =>
295
- props.disabled && props.showDisabledBackground
283
+ props.disabled
296
284
  ? props.theme.colors.grey5
297
285
  : props.theme.colors[props.bgColor]
298
286
  ? props.theme.colors[props.bgColor]
@@ -318,16 +306,13 @@ const selectDropdownAttrs = {
318
306
  fontSize: String,
319
307
  dropdownPosition: Object,
320
308
  hoveredValue: Number | String,
321
- selectedValue: Number | String,
322
- noRelative: Boolean,
323
- minWidth: String
309
+ selectedValue: Number | String
324
310
  }
325
311
  const selectDropdown = styled('div', selectDropdownAttrs)`
326
312
  box-sizing: border-box;
327
313
  z-index: ${(props) => (props.isActive ? '2' : '99999')};
328
314
  position: absolute;
329
- top: ${(props) =>
330
- props.noRelative ? 'auto' : props.dropdownPosition?.top + 'px'};
315
+ top: ${(props) => props.dropdownPosition?.top}px;
331
316
  left: ${(props) => props.dropdownPosition?.left}px;
332
317
  border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
333
318
  border-radius: 4px;
@@ -337,7 +322,6 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
337
322
  padding: 0px;
338
323
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
339
324
  width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
340
- min-width: ${(props) => (props.minWidth ? props.minWidth : '100%')};
341
325
  background-color: ${(props) =>
342
326
  props.theme.colors[props.bgColor]
343
327
  ? props.theme.colors[props.bgColor]
@@ -357,17 +341,12 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
357
341
  font-size: ${(props) => props.fontSize};
358
342
  `
359
343
  selectDropdown.emits = ['option-hovered', 'option-selected']
360
- const DropdownAttrs = { noRelative: Boolean }
361
- const DropdownWrapper = styled('div', DropdownAttrs)`
362
- position: ${(props) => (props.noRelative ? 'static' : 'relative')};
344
+ const DropdownWrapper = styled('div')`
345
+ position: relative;
363
346
  `
364
- const inputAttrs = {
365
- alignItems: String,
366
- hasLabel: Boolean,
367
- noRelative: Boolean
368
- }
347
+ const inputAttrs = { alignItems: String, hasLabel: Boolean }
369
348
  const InputWrapper = styled('div', inputAttrs)`
370
- position: ${(props) => (props.noRelative ? 'static' : 'relative')};
349
+ position: relative;
371
350
  display: grid;
372
351
  align-items: center;
373
352
  gap: 8px;
@@ -396,10 +375,6 @@ export default {
396
375
  required: false,
397
376
  default: '13px'
398
377
  },
399
- noRelative: {
400
- required: false,
401
- default: false
402
- },
403
378
  label: {
404
379
  required: false
405
380
  },
@@ -432,9 +407,6 @@ export default {
432
407
  required: false,
433
408
  default: '36px'
434
409
  },
435
- minWidth: {
436
- required: false
437
- },
438
410
  optionWidth: {
439
411
  required: false,
440
412
  default: null
@@ -510,12 +482,13 @@ export default {
510
482
  type: Boolean,
511
483
  default: false
512
484
  },
513
- tablePaddingLeft: {
514
- required: false
485
+ noMaxWidth: {
486
+ type: Boolean,
487
+ default: false
515
488
  },
516
- showDisabledBackground: {
517
- required: false,
518
- default: true
489
+ shownDropdown: {
490
+ type: Boolean,
491
+ default: false
519
492
  },
520
493
  minOptionLength: {
521
494
  type: Number,
@@ -632,15 +605,22 @@ export default {
632
605
  searchChange(value) {
633
606
  this.textSearch = value
634
607
  this.$emit('search-change', value)
635
- const dropdownChildren = [...this.$refs.dropdown.$el.children]
636
- dropdownChildren.forEach((el) => {
637
- if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
638
- el.style.display = 'none'
639
-
640
- return
641
- }
642
- el.style.display = 'inherit'
643
- })
608
+ const children =
609
+ this.$refs.dropdown.$children &&
610
+ this.$refs.dropdown.$children[0] &&
611
+ this.$refs.dropdown.$children.length === 1 &&
612
+ this.$refs.dropdown.$children[0].$children.length
613
+ ? this.$refs.dropdown.$children[0].$children
614
+ : this.$refs.dropdown.$children
615
+ children
616
+ .map((component) => component.$el)
617
+ .forEach((el) => {
618
+ if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
619
+ el.style.display = 'none'
620
+ } else {
621
+ el.style.display = 'grid'
622
+ }
623
+ })
644
624
  },
645
625
  clickOutside(event) {
646
626
  const dropdownRef = this.$refs.dropdown
@@ -16,7 +16,6 @@
16
16
  :disabledTextColor="disabledTextColor"
17
17
  :backgroundColor="colorMode == 'dark' ? '#000000' : backgroundColor"
18
18
  :title="hoverText"
19
- :minWidth="minWidth"
20
19
  :padding="padding"
21
20
  >
22
21
  <slot></slot>
@@ -32,7 +31,6 @@ const optionProps = {
32
31
  hoveredBgColor: String,
33
32
  cursorType: String,
34
33
  backgroundColor: String,
35
- minWidth: String,
36
34
  disabledBgColor: String,
37
35
  disabledTextColor: String,
38
36
  padding: String
@@ -46,7 +44,6 @@ const optionContainer = styled('div', optionProps)`
46
44
  padding: ${(props) => props.padding};
47
45
  gap: 14px;
48
46
  width: 100%;
49
- min-width: ${(props) => (props.minWidth ? props.minWidth : '100%')};
50
47
  background-color: ${(props) =>
51
48
  props.isDisabled
52
49
  ? props.theme.colors[props.disabledBgColor]
@@ -109,9 +106,6 @@ export default {
109
106
  required: false,
110
107
  default: false
111
108
  },
112
- minWidth: {
113
- required: false
114
- },
115
109
  disabledBgColor: {
116
110
  required: false,
117
111
  default: 'white'
@@ -49,7 +49,7 @@
49
49
  // label="Question 5"
50
50
  // alignItems="horizontal" // horizontal, vertical
51
51
  // :isDisabled="true"
52
- // . fontSize="13px"
52
+ // fontSize="13px"
53
53
  // />
54
54
  import styled from 'vue3-styled-components'
55
55
  import InfoText from '../../infoText'
@@ -27,8 +27,13 @@
27
27
  // cursor="pointer"
28
28
  // />
29
29
 
30
- import styled from 'vue3-styled-components'
30
+ import styled from 'vue-styled-components'
31
31
  import Icon from '../icon'
32
+ import Modal from '../modals/modal'
33
+ import PageTitle from '../pageTitle'
34
+ import DeleteIcon from '../deleteIcon'
35
+ import PageSubtitle from '../pageSubtitle'
36
+ import MainButton from '../buttons/mainButton'
32
37
 
33
38
  const PageContainer = styled.div`
34
39
  display: flex;
@@ -60,6 +65,11 @@ const MarkerContainer = styled('div', MarkerAttrs)`
60
65
  cursor: ${(props) => (props.isEditionAllowed ? 'pointer' : props.cursor)};
61
66
  `
62
67
 
68
+ // const IconContainer = styled.div`
69
+ // padding: 8px;
70
+ // line-height: 0;
71
+ // `
72
+
63
73
  export default {
64
74
  name: 'project-marker',
65
75
  components: {
@@ -3,7 +3,11 @@
3
3
  <title-text :color="color" :fontSize="fontSize" :uppercase="uppercase">
4
4
  {{ text }}
5
5
  </title-text>
6
- <info-text v-if="!!infoText" :text="infoText" :alignArrow="infoAlign" />
6
+ <info-text
7
+ v-if="!!infoText"
8
+ :text="infoText"
9
+ :alignArrow="infoAlign"
10
+ />
7
11
  </title-wrap>
8
12
  </template>
9
13
 
@@ -14,16 +18,16 @@
14
18
  // text="My Page Title"
15
19
  // color="red"
16
20
  // />
17
- import styled from 'vue3-styled-components'
18
- import InfoText from '../infoText'
21
+ import styled from "vue3-styled-components"
22
+ import InfoText from "../infoText"
19
23
 
20
24
  const wrapAttrs = { hasInfoText: Boolean }
21
- const TitleWrap = styled('div', wrapAttrs)`
25
+ const TitleWrap = styled("div", wrapAttrs)`
22
26
  display: grid;
23
27
  align-items: center;
24
28
  grid-gap: 12px;
25
29
  grid-template-columns: ${(props) =>
26
- props.hasInfoText ? 'auto auto 1fr' : '1fr'};
30
+ props.hasInfoText ? "auto auto 1fr" : "1fr"};
27
31
  margin-bottom: 20px;
28
32
  `
29
33
 
@@ -31,7 +35,7 @@ const titleAttrs = { color: String, fontSize: String, uppercase: Boolean }
31
35
  const TitleText = styled('span', titleAttrs)`
32
36
  color: ${(props) => (props.color ? props.color : props.theme.colors.black)};
33
37
  font-weight: bold;
34
- font-size: ${(props) => (props.fontSize ? props.fontSize : '18px')};
38
+ font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
35
39
  text-transform: ${(props) => (props.uppercase ? 'uppercase' : 'none')};
36
40
  `
37
41
 
@@ -50,7 +54,8 @@ export default {
50
54
  required: false
51
55
  },
52
56
  fontSize: {
53
- required: false
57
+ required: false,
58
+ default: '16px'
54
59
  },
55
60
  uppercase: {
56
61
  required: false,
@@ -58,11 +63,11 @@ export default {
58
63
  },
59
64
  infoText: {
60
65
  required: false,
61
- default: null
66
+ default: null,
62
67
  },
63
68
  infoAlign: {
64
- required: false
69
+ required: false,
65
70
  }
66
- }
71
+ },
67
72
  }
68
73
  </script>
@@ -81,8 +81,6 @@ const paginationWrapper = styled.nav`
81
81
  flex-wrap: wrap;
82
82
  justify-content: flex-end;
83
83
  align-items: center;
84
- margin-bottom: 2px;
85
- margin-top: 10px;
86
84
  `
87
85
  const paginationLink = styled.div`
88
86
  display: flex;
@@ -92,15 +90,18 @@ const paginationLink = styled.div`
92
90
  border-radius: 3px;
93
91
  white-space: nowrap;
94
92
  cursor: pointer;
93
+ color: ${(props) => props.theme.colors.brightBlue};
95
94
 
96
95
  &.active {
97
- color: #fff;
96
+ color: ${(props) => props.theme.colors.white};
98
97
  background-color: ${(props) => props.theme.colors.brightBlue};
99
98
  padding: 7px 12px;
100
99
  border-radius: 4px;
101
100
  }
102
101
  `
103
- const arrowText = styled.div``
102
+ const arrowText = styled.div`
103
+ color: ${(props) => props.theme.colors.brightBlue};
104
+ `
104
105
  const arrowIconContainer = styled.div`
105
106
  margin: 0 10px;
106
107
  display: flex;
@@ -69,7 +69,7 @@
69
69
  </template>
70
70
 
71
71
  <script>
72
- // import ThreeDots from "@eturnity/eturnity_reusable_components/src/components/projectMarker"
72
+ // import ProjectMarker from "@eturnity/eturnity_reusable_components/src/components/projectMarker"
73
73
  // To use:
74
74
  // <project-marker
75
75
  // :activeLanguage="'en-us'"
@@ -0,0 +1,145 @@
1
+ <template>
2
+ <page-container>
3
+ <box-container>
4
+ <selected-container
5
+ >{{ numberSelected }} {{ $gettext('selected') }}</selected-container
6
+ >
7
+ <list-container v-if="optionsList.length">
8
+ <list-item
9
+ v-for="item in optionsList"
10
+ :key="item.type"
11
+ :hoverColor="item.hoverColor"
12
+ @click="$emit('on-' + item.type)"
13
+ >
14
+ {{ item.name }}
15
+ </list-item>
16
+ </list-container>
17
+ <empty-text v-if="!optionsList.length">
18
+ {{ $gettext('no_batch_actions_available') }}
19
+ </empty-text>
20
+ <icon-container @click="$emit('on-close')">
21
+ <icon
22
+ name="close_for_modals,_tool_tips"
23
+ color="white"
24
+ size="14px"
25
+ cursor="pointer"
26
+ />
27
+ </icon-container>
28
+ </box-container>
29
+ </page-container>
30
+ </template>
31
+
32
+ <script>
33
+ // import SelectedOptions from "@eturnity/eturnity_reusable_components/src/components/selectedOptions"
34
+ // optionsList = [
35
+ // {
36
+ // type: 'export',
37
+ // name: 'Export'
38
+ // },
39
+ // {
40
+ // type: 'delete',
41
+ // name: 'Delete',
42
+ // hoverColor: 'red' // default is green
43
+ // }
44
+ // ]
45
+ // @on-${type}="function" should $emit the callback for the 'type' in the optionsList
46
+ // <selected-options
47
+ // :numberSelected="numberSelected"
48
+ // :optionsList="optionsList"
49
+ // @on-close="onCloseFunction()"
50
+ // @on-export="function()" @on-delete="function()"
51
+ // />
52
+ import styled from 'vue-styled-components'
53
+ import Icon from '../icon'
54
+
55
+ const PageContainer = styled.div`
56
+ position: fixed;
57
+ bottom: 30px;
58
+ left: 50%;
59
+ transform: translateX(-50%);
60
+ `
61
+
62
+ const SelectedContainer = styled.div`
63
+ display: grid;
64
+ align-items: center;
65
+ height: 100%;
66
+ padding-right: 20px;
67
+ border-right: 1px solid rgba(255, 255, 255, 0.2);
68
+ `
69
+
70
+ const BoxContainer = styled.div`
71
+ display: flex;
72
+ align-items: center;
73
+ background-color: ${(props) => props.theme.colors.black};
74
+ opacity: 90%;
75
+ color: ${(props) => props.theme.colors.white};
76
+ border-radius: 4px;
77
+ padding: 8px 10px 8px 20px;
78
+ font-size: 14px;
79
+ height: 40px;
80
+ `
81
+
82
+ const ListContainer = styled.div`
83
+ padding: 0 20px;
84
+ display: flex;
85
+ gap: 20px;
86
+ color: ${(props) => props.theme.colors.white};
87
+ `
88
+
89
+ const ListAttrs = {
90
+ hoverColor: String
91
+ }
92
+ const ListItem = styled('div', ListAttrs)`
93
+ cursor: pointer;
94
+ &:hover {
95
+ color: ${(props) =>
96
+ props.hoverColor
97
+ ? props.theme.colors[props.hoverColor]
98
+ : props.theme.colors.green};
99
+ }
100
+ `
101
+
102
+ const IconContainer = styled.div`
103
+ display: grid;
104
+ align-items: center;
105
+ justify-items: center;
106
+ height: 30px;
107
+ width: 30px;
108
+ cursor: pointer;
109
+ margin-left: 20px;
110
+
111
+ &:hover {
112
+ background: rgba(255, 255, 255, 0.1);
113
+ border-radius: 4px;
114
+ }
115
+ `
116
+
117
+ const EmptyText = styled.div`
118
+ color: ${(props) => props.theme.colors.white};
119
+ font-size: 13px;
120
+ padding-left: 16px;
121
+ `
122
+
123
+ export default {
124
+ name: 'selected-options',
125
+ components: {
126
+ PageContainer,
127
+ BoxContainer,
128
+ SelectedContainer,
129
+ ListContainer,
130
+ ListItem,
131
+ Icon,
132
+ IconContainer,
133
+ EmptyText
134
+ },
135
+ props: {
136
+ optionsList: {
137
+ required: true
138
+ },
139
+ numberSelected: {
140
+ required: true,
141
+ default: 0
142
+ }
143
+ }
144
+ }
145
+ </script>