@eturnity/eturnity_reusable_components 7.18.0--EPDM-9013.1 → 7.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.18.0--EPDM-9013.1",
3
+ "version": "7.18.0--EPDM-5518.4",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -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>
@@ -261,6 +261,12 @@
261
261
  :text="buttonText.cancel"
262
262
  @click.native="$emit('on-cancel-view')"
263
263
  />
264
+ <reset-container v-if="!filterViews || !filterViews.length">
265
+ <reset-button @click="$emit('on-reset-filters')">
266
+ <icon :name="'update'" size="14px" :color="theme.colors.blue" />
267
+ <div>{{ $gettext('reset_filters') }}</div>
268
+ </reset-button>
269
+ </reset-container>
264
270
  </button-container>
265
271
  </container-wrapper>
266
272
  </template>
@@ -328,6 +334,16 @@ const ButtonContainer = styled.div`
328
334
  padding: 15px;
329
335
  `
330
336
 
337
+ const ResetContainer = styled.div`
338
+ display: grid;
339
+ align-content: center;
340
+ margin-left: auto;
341
+ div {
342
+ margin-top: 0;
343
+ align-self: center;
344
+ }
345
+ `
346
+
331
347
  const ColumnContainer = styled.div``
332
348
 
333
349
  const DragContainer = styled.div`
@@ -493,7 +509,8 @@ export default {
493
509
  ViewContainer,
494
510
  DeleteIcon,
495
511
  UpperContainer,
496
- ResetButton
512
+ ResetButton,
513
+ ResetContainer
497
514
  },
498
515
  props: {
499
516
  filterData: {
@@ -3,10 +3,11 @@
3
3
  <container
4
4
  :checkColor="checkColor"
5
5
  :size="size"
6
- :hasLabel="!!label.length"
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
  <div>
18
19
  <span class="checkmark"></span>
19
20
  </div>
20
- <label-text v-if="!!label.length">{{ 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 'vue-styled-components'
38
40
 
@@ -46,7 +48,8 @@ const containerAttrs = {
46
48
  hasLabel: Boolean,
47
49
  backgroundColor: String,
48
50
  isChecked: Boolean,
49
- isDisabled: Boolean
51
+ isDisabled: Boolean,
52
+ cursorType: String
50
53
  }
51
54
  const Container = styled('label', containerAttrs)`
52
55
  display: grid;
@@ -55,7 +58,7 @@ const Container = styled('label', containerAttrs)`
55
58
  align-content: center;
56
59
  color: ${(props) => props.theme.colors.black};
57
60
  position: relative;
58
- cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
61
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursorType)};
59
62
  font-size: 16px;
60
63
  user-select: none;
61
64
 
@@ -80,7 +83,7 @@ const Container = styled('label', containerAttrs)`
80
83
  : props.theme.colors.green
81
84
  : props.isDisabled
82
85
  ? props.theme.colors.lightGray
83
- : '#fff'};
86
+ : props.theme.colors.white};
84
87
  border-radius: 4px;
85
88
  border: 1px solid
86
89
  ${(props) =>
@@ -173,6 +176,10 @@ export default {
173
176
  dataId: {
174
177
  type: String,
175
178
  default: ''
179
+ },
180
+ cursorType: {
181
+ type: String,
182
+ default: 'pointer'
176
183
  }
177
184
  },
178
185
  methods: {
@@ -469,7 +469,7 @@ export default {
469
469
  }
470
470
  },
471
471
  methods: {
472
- onEnterPress(){
472
+ onEnterPress() {
473
473
  this.$emit('on-enter-click')
474
474
  this.$refs.inputField1.$el.blur()
475
475
  },
@@ -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
  },
@@ -8,7 +8,11 @@
8
8
  :hasLabel="!!label && label.length > 0"
9
9
  :alignItems="alignItems"
10
10
  >
11
- <label-wrapper v-if="label" :data-id="labelDataId">
11
+ <label-wrapper
12
+ v-if="label"
13
+ :data-id="labelDataId"
14
+ :shownDropdown="shownDropdown"
15
+ >
12
16
  <input-label
13
17
  :fontColor="
14
18
  labelFontColor || colorMode == 'dark' ? 'white' : 'eturnityGrey'
@@ -45,6 +49,7 @@
45
49
  :showBorder="showBorder"
46
50
  :data-id="dataId"
47
51
  :paddingLeft="paddingLeft"
52
+ :shownDropdown="shownDropdown"
48
53
  >
49
54
  <draggableInputHandle
50
55
  v-if="isDraggable && !isSearchBarVisible"
@@ -68,9 +73,10 @@
68
73
  />
69
74
  <selector
70
75
  v-else
71
- :showBorder="showBorder"
72
76
  :selectWidth="selectWidth"
73
77
  :paddingLeft="paddingLeft"
78
+ :noMaxWidth="noMaxWidth"
79
+ :showBorder="showBorder"
74
80
  >
75
81
  <slot name="selector" :selectedValue="selectedValue"></slot>
76
82
  </selector>
@@ -169,20 +175,17 @@ const Caret = styled.div`
169
175
  const selectorProps = {
170
176
  selectWidth: String,
171
177
  paddingLeft: String,
172
- showBorder: Boolean
178
+ showBorder: Boolean,
179
+ noMaxWidth: Boolean
173
180
  }
174
181
  const Selector = styled('div', selectorProps)`
175
- ${(props) => props.selectWidth === '100%' ? 'width: 100%;' : `width: calc(${props.selectWidth} -
176
- (
177
- ${CARET_WIDTH} +
178
- ${props.paddingLeft}
179
- ${props.showBorder ? `+ (${BORDER_WIDTH} * 2)` : ''}
180
- )
181
- );
182
- white-space: nowrap;
183
- text-overflow: ellipsis;
184
- overflow: hidden;`
185
- }
182
+ max-width: ${(props) =>
183
+ props.noMaxWidth
184
+ ? '100%'
185
+ : `calc(${props.selectWidth} - (${CARET_WIDTH} + ${props.paddingLeft} + (${BORDER_WIDTH} * 2)))`};
186
+ white-space: nowrap;
187
+ text-overflow: ellipsis;
188
+ overflow: hidden;
186
189
  `
187
190
 
188
191
  const labelAttrs = { fontSize: String, fontColor: String }
@@ -203,10 +206,12 @@ const Container = styled('div', inputProps)`
203
206
  position: relative;
204
207
  display: inline-block;
205
208
  `
206
- const LabelWrapper = styled.div`
209
+
210
+ const LabelAttrs = { shownDropdown: Boolean }
211
+ const LabelWrapper = styled('div', LabelAttrs)`
207
212
  display: inline-grid;
208
213
  grid-template-columns: auto auto;
209
- grid-gap: 12px;
214
+ grid-gap: ${(props) => (props.shownDropdown ? '0' : '12px')};
210
215
  align-items: center;
211
216
  justify-content: start;
212
217
  `
@@ -228,14 +233,17 @@ const selectButtonAttrs = {
228
233
  selectMinHeight: String,
229
234
  isSearchBarVisible: Boolean,
230
235
  showBorder: Boolean,
231
- paddingLeft: String
236
+ paddingLeft: String,
237
+ shownDropdown: Boolean
232
238
  }
233
239
  const selectButton = styled('div', selectButtonAttrs)`
234
240
  position: relative;
235
241
  box-sizing: border-box;
236
242
  border-radius: 4px;
237
243
  ${(props) =>
238
- props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}`};
244
+ props.isSearchBarVisible
245
+ ? ''
246
+ : `padding-left: ${props.shownDropdown ? '0' : props.paddingLeft}`};
239
247
  text-align: left;
240
248
  min-height: ${(props) =>
241
249
  props.selectHeight
@@ -438,6 +446,14 @@ export default {
438
446
  isDraggable: {
439
447
  type: Boolean,
440
448
  default: false
449
+ },
450
+ noMaxWidth: {
451
+ type: Boolean,
452
+ default: false
453
+ },
454
+ shownDropdown: {
455
+ type: Boolean,
456
+ default: false
441
457
  }
442
458
  },
443
459
 
@@ -527,13 +543,20 @@ export default {
527
543
  searchChange(value) {
528
544
  this.textSearch = value
529
545
  this.$emit('search-change', value)
530
- this.$refs.dropdown.$children
546
+ const children =
547
+ this.$refs.dropdown.$children &&
548
+ this.$refs.dropdown.$children[0] &&
549
+ this.$refs.dropdown.$children.length === 1 &&
550
+ this.$refs.dropdown.$children[0].$children.length
551
+ ? this.$refs.dropdown.$children[0].$children
552
+ : this.$refs.dropdown.$children
553
+ children
531
554
  .map((component) => component.$el)
532
555
  .forEach((el) => {
533
556
  if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
534
557
  el.style.display = 'none'
535
558
  } else {
536
- el.style.display = 'inherit'
559
+ el.style.display = 'grid'
537
560
  }
538
561
  })
539
562
  },
@@ -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 'vue-styled-components'
55
55
  import InfoText from '../../infoText'
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <page-container>
3
+ <marker-container
4
+ :backgroundColor="backgroundColor"
5
+ :hasIcon="!!iconName"
6
+ :cursor="cursor"
7
+ >
8
+ <icon
9
+ v-if="!!iconName"
10
+ :name="iconName"
11
+ color="white"
12
+ size="10px"
13
+ :cursor="cursor"
14
+ />
15
+ <span>{{ label }}</span>
16
+ </marker-container>
17
+ </page-container>
18
+ </template>
19
+
20
+ <script>
21
+ // import MarkerItem from "@eturnity/eturnity_reusable_components/src/components/markerItem"
22
+ // To use:
23
+ // <marker-item
24
+ // label="Label"
25
+ // backgroundColor="#ab5348"
26
+ // iconName="icon_name"
27
+ // cursor="pointer"
28
+ // />
29
+
30
+ import styled from 'vue-styled-components'
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'
37
+
38
+ const PageContainer = styled.div`
39
+ display: flex;
40
+ align-items: center;
41
+ font-size: 12px;
42
+ line-height: 14px;
43
+ `
44
+
45
+ const MarkerAttrs = {
46
+ backgroundColor: String,
47
+ hasIcon: Boolean,
48
+ cursor: String
49
+ }
50
+ const MarkerContainer = styled('div', MarkerAttrs)`
51
+ display: grid;
52
+ grid-template-columns: ${(props) => (props.hasIcon ? 'auto 1fr' : '1fr')};
53
+ grid-gap: 5px;
54
+ position: relative;
55
+ align-items: center;
56
+ padding: 2px 7px;
57
+ color: ${(props) => props.theme.colors.white};
58
+ background-color: ${(props) =>
59
+ props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
60
+ border: 1px solid
61
+ ${(props) =>
62
+ props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
63
+ border-radius: 4px;
64
+ white-space: nowrap;
65
+ cursor: ${(props) => (props.isEditionAllowed ? 'pointer' : props.cursor)};
66
+ `
67
+
68
+ // const IconContainer = styled.div`
69
+ // padding: 8px;
70
+ // line-height: 0;
71
+ // `
72
+
73
+ export default {
74
+ name: 'project-marker',
75
+ components: {
76
+ PageContainer,
77
+ MarkerContainer,
78
+ Icon
79
+ },
80
+ props: {
81
+ backgroundColor: {
82
+ required: false
83
+ },
84
+ iconName: {
85
+ required: false
86
+ },
87
+ label: {
88
+ required: true
89
+ },
90
+ cursor: {
91
+ required: false,
92
+ default: 'default'
93
+ }
94
+ }
95
+ }
96
+ </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;
98
- background-color: ${(props) => props.theme.brightBlue};
96
+ color: ${(props) => props.theme.colors.white};
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;
@@ -65,7 +65,7 @@
65
65
  </template>
66
66
 
67
67
  <script>
68
- // import ThreeDots from "@eturnity/eturnity_reusable_components/src/components/projectMarker"
68
+ // import ProjectMarker from "@eturnity/eturnity_reusable_components/src/components/projectMarker"
69
69
  // To use:
70
70
  // <project-marker
71
71
  // :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>
@@ -1,4 +0,0 @@
1
- <svg width="15" height="9" viewBox="0 0 15 9" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M14.462 8.46H12.894C12.7848 8.46 12.697 8.4327 12.6307 8.37809C12.5683 8.32349 12.5176 8.26108 12.4786 8.19087L10.5186 4.94378C10.4874 5.04129 10.4504 5.12514 10.4075 5.19535L8.52943 8.19087C8.48263 8.25718 8.42802 8.31958 8.36562 8.37809C8.30711 8.4327 8.2291 8.46 8.13159 8.46H6.66309L9.47138 4.10714L6.77425 0H8.34221C8.45143 0 8.52943 0.0156017 8.57624 0.0468051C8.62694 0.0741079 8.67375 0.120913 8.71665 0.18722L10.6415 3.28805C10.6805 3.19054 10.7273 3.09303 10.7819 2.99552L12.5488 0.216473C12.5917 0.142365 12.6385 0.0877595 12.6892 0.052656C12.7399 0.017552 12.8043 0 12.8823 0H14.3859L11.6654 4.04278L14.462 8.46Z" fill="#263238"/>
3
- <path d="M3.16519 7.23137C3.45772 7.23137 3.70344 7.19627 3.90237 7.12606C4.10129 7.05585 4.25925 6.96224 4.37627 6.84523C4.49718 6.72822 4.58299 6.5917 4.63369 6.43569C4.6883 6.27967 4.7156 6.1139 4.7156 5.93838C4.7156 5.75506 4.68635 5.59124 4.62784 5.44693C4.56934 5.29871 4.47768 5.1739 4.35286 5.07249C4.22805 4.96718 4.06618 4.88722 3.86726 4.83261C3.67224 4.77801 3.43627 4.75071 3.15934 4.75071H1.57382V7.23137H3.16519ZM1.57382 1.21693V3.66249H2.82585C3.36411 3.66249 3.76975 3.56498 4.04278 3.36996C4.31971 3.17494 4.45817 2.86486 4.45817 2.43971C4.45817 1.99896 4.33336 1.68498 4.08373 1.49776C3.83411 1.31054 3.44407 1.21693 2.91361 1.21693H1.57382ZM2.91361 0C3.46747 0 3.94137 0.0526557 4.33531 0.157967C4.72925 0.263278 5.05104 0.413444 5.30066 0.608465C5.55419 0.803486 5.73946 1.03946 5.85647 1.31639C5.97349 1.59332 6.03199 1.90535 6.03199 2.25249C6.03199 2.45141 6.00274 2.64253 5.94423 2.82585C5.88573 3.00527 5.79407 3.17494 5.66925 3.33485C5.54834 3.49087 5.39232 3.63324 5.2012 3.76195C5.01398 3.89066 4.78971 3.99988 4.52838 4.08959C5.69071 4.35091 6.27187 4.97888 6.27187 5.97349C6.27187 6.33232 6.20361 6.66386 6.0671 6.96809C5.93058 7.27232 5.73166 7.5356 5.47033 7.75793C5.209 7.97635 4.88722 8.14797 4.50498 8.27278C4.12274 8.39759 3.68589 8.46 3.19444 8.46H0V0H2.91361Z" fill="#263238"/>
4
- </svg>
@@ -1,3 +0,0 @@
1
- <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M16 0H2C0.89 0 0 0.9 0 2V16C0 17.1 0.89 18 2 18H6V16H2V2H16V16H12V18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.11 0 16 0ZM9 6L5 10H8V18H10V10H13L9 6Z" fill="#263238"/>
3
- </svg>