@eturnity/eturnity_reusable_components 7.12.6 → 7.12.7--EPDM-5518.1

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.12.6",
3
+ "version": "7.12.7--EPDM-5518.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -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
  },
@@ -46,7 +46,10 @@
46
46
  :data-id="dataId"
47
47
  :paddingLeft="paddingLeft"
48
48
  >
49
- <draggableInputHandle v-if="isDraggable && !isSearchBarVisible" :height="selectHeight" />
49
+ <draggableInputHandle
50
+ v-if="isDraggable && !isSearchBarVisible"
51
+ :height="selectHeight"
52
+ />
50
53
  <inputText
51
54
  v-if="isSearchBarVisible"
52
55
  ref="searchInput"
@@ -63,7 +66,13 @@
63
66
  @input-change="searchChange"
64
67
  @click.native.stop
65
68
  />
66
- <selector v-else :selectWidth="selectWidth" :paddingLeft="paddingLeft">
69
+ <selector
70
+ v-else
71
+ :selectWidth="selectWidth"
72
+ :paddingLeft="paddingLeft"
73
+ :noMaxWidth="noMaxWidth"
74
+ :showBorder="showBorder"
75
+ >
67
76
  <slot name="selector" :selectedValue="selectedValue"></slot>
68
77
  </selector>
69
78
  <Caret @click.stop="toggleCaretDropdown">
@@ -158,8 +167,17 @@ const Caret = styled.div`
158
167
  margin-left: auto;
159
168
  `
160
169
 
161
- const Selector = styled('div', { selectWidth: String, paddingLeft: String })`
162
- width: ${(props) => `calc(${props.selectWidth} - (${CARET_WIDTH} + ${props.paddingLeft} + (${BORDER_WIDTH} * 2)))`};
170
+ const selectorProps = {
171
+ selectWidth: String,
172
+ paddingLeft: String,
173
+ showBorder: Boolean,
174
+ noMaxWidth: Boolean
175
+ }
176
+ const Selector = styled('div', selectorProps)`
177
+ max-width: ${(props) =>
178
+ props.noMaxWidth
179
+ ? '100%'
180
+ : `calc(${props.selectWidth} - (${CARET_WIDTH} + ${props.paddingLeft} + (${BORDER_WIDTH} * 2)))`};
163
181
  white-space: nowrap;
164
182
  text-overflow: ellipsis;
165
183
  overflow: hidden;
@@ -214,7 +232,8 @@ const selectButton = styled('div', selectButtonAttrs)`
214
232
  position: relative;
215
233
  box-sizing: border-box;
216
234
  border-radius: 4px;
217
- ${(props) => (props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}` )};
235
+ ${(props) =>
236
+ props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}`};
218
237
  text-align: left;
219
238
  min-height: ${(props) =>
220
239
  props.selectHeight
@@ -230,7 +249,9 @@ const selectButton = styled('div', selectButtonAttrs)`
230
249
  ${({ showBorder, theme, hasError }) =>
231
250
  showBorder &&
232
251
  `
233
- border: ${BORDER_WIDTH} solid ${hasError ? theme.colors.red : theme.colors.grey4}
252
+ border: ${BORDER_WIDTH} solid ${
253
+ hasError ? theme.colors.red : theme.colors.grey4
254
+ }
234
255
  `}
235
256
  background-color:${(props) =>
236
257
  props.disabled
@@ -244,8 +265,10 @@ const selectButton = styled('div', selectButtonAttrs)`
244
265
  : props.fontColor};
245
266
  ${(props) => (props.disabled ? 'pointer-events: none' : '')};
246
267
  overflow: hidden;
247
- & >.handle{
248
- border-right:${(props) =>props.hasError ? props.theme.colors.red : props.theme.colors.grey4} 1px solid;
268
+ & > .handle {
269
+ border-right: ${(props) =>
270
+ props.hasError ? props.theme.colors.red : props.theme.colors.grey4}
271
+ 1px solid;
249
272
  }
250
273
  `
251
274
  const selectDropdownAttrs = {
@@ -258,34 +281,34 @@ const selectDropdownAttrs = {
258
281
  selectedValue: Number | String
259
282
  }
260
283
  const selectDropdown = styled('div', selectDropdownAttrs)`
261
- box-sizing: border-box;
262
- z-index:${(props) => (props.isActive ? '2' : '1')};
263
- position:absolute;
264
- top:5px;
265
- border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
266
- border-radius:4px;
267
- display: flex;
268
- flex-direction: column;
269
- align-items: flex-start;
270
- padding: 0px;
271
- box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
272
- width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
273
- background-color:${(props) =>
274
- props.theme.colors[props.bgColor]
275
- ? props.theme.colors[props.bgColor]
276
- : props.bgColor};
277
- color:${(props) =>
278
- props.theme.colors[props.fontColor]
279
- ? props.theme.colors[props.fontColor]
280
- : props.fontColor};
281
- max-height:300px;
282
- overflow-y:auto;
283
- &>div[data-value="${(props) => props.hoveredValue}"]{
284
- background-color:${(props) =>
285
- props.theme.colors[props.hoveredBgColor]
286
- ? props.theme.colors[props.hoveredBgColor]
287
- : props.hoveredBgColor};
288
- }
284
+ box-sizing: border-box;
285
+ z-index: ${(props) => (props.isActive ? '2' : '1')};
286
+ position: absolute;
287
+ top: 5px;
288
+ border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
289
+ border-radius: 4px;
290
+ display: flex;
291
+ flex-direction: column;
292
+ align-items: flex-start;
293
+ padding: 0px;
294
+ box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
295
+ width: ${(props) => (props.optionWidth ? props.optionWidth : '100%')};
296
+ background-color: ${(props) =>
297
+ props.theme.colors[props.bgColor]
298
+ ? props.theme.colors[props.bgColor]
299
+ : props.bgColor};
300
+ color: ${(props) =>
301
+ props.theme.colors[props.fontColor]
302
+ ? props.theme.colors[props.fontColor]
303
+ : props.fontColor};
304
+ max-height: 300px;
305
+ overflow-y: auto;
306
+ & > div[data-value='${(props) => props.hoveredValue}'] {
307
+ background-color: ${(props) =>
308
+ props.theme.colors[props.hoveredBgColor]
309
+ ? props.theme.colors[props.hoveredBgColor]
310
+ : props.hoveredBgColor};
311
+ }
289
312
  `
290
313
  const DropdownWrapper = styled('div')`
291
314
  position: relative;
@@ -413,6 +436,10 @@ export default {
413
436
  isDraggable: {
414
437
  type: Boolean,
415
438
  default: false
439
+ },
440
+ noMaxWidth: {
441
+ type: Boolean,
442
+ default: false
416
443
  }
417
444
  },
418
445
 
@@ -508,7 +535,7 @@ export default {
508
535
  if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
509
536
  el.style.display = 'none'
510
537
  } else {
511
- el.style.display = 'inherit'
538
+ el.style.display = 'grid'
512
539
  }
513
540
  })
514
541
  },
@@ -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;
@@ -94,8 +92,8 @@ const paginationLink = styled.div`
94
92
  cursor: pointer;
95
93
 
96
94
  &.active {
97
- color: #fff;
98
- background-color: ${(props) => props.theme.brightBlue};
95
+ color: ${(props) => props.theme.colors.white};
96
+ background-color: ${(props) => props.theme.colors.brightBlue};
99
97
  padding: 7px 12px;
100
98
  border-radius: 4px;
101
99
  }
@@ -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>