@eturnity/eturnity_reusable_components 7.10.0-EPDM-10163.0 → 7.12.0-EPDM-9944.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,8 +1,9 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
2
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
3
|
+
|
3
4
|
<svg
|
4
5
|
version="1.1"
|
5
|
-
id="
|
6
|
+
id="svg438"
|
6
7
|
width="838"
|
7
8
|
height="833"
|
8
9
|
viewBox="0 0 838 833"
|
@@ -13,9 +14,26 @@
|
|
13
14
|
xmlns="http://www.w3.org/2000/svg"
|
14
15
|
xmlns:svg="http://www.w3.org/2000/svg">
|
15
16
|
<defs
|
16
|
-
id="
|
17
|
+
id="defs442">
|
18
|
+
<linearGradient
|
19
|
+
id="linearGradient7383"
|
20
|
+
inkscape:swatch="solid">
|
21
|
+
<stop
|
22
|
+
style="stop-color:#ffffff;stop-opacity:1;"
|
23
|
+
offset="0"
|
24
|
+
id="stop7381" />
|
25
|
+
</linearGradient>
|
26
|
+
<linearGradient
|
27
|
+
id="linearGradient6933"
|
28
|
+
inkscape:swatch="solid">
|
29
|
+
<stop
|
30
|
+
style="stop-color:#000000;stop-opacity:1;"
|
31
|
+
offset="0"
|
32
|
+
id="stop6931" />
|
33
|
+
</linearGradient>
|
34
|
+
</defs>
|
17
35
|
<sodipodi:namedview
|
18
|
-
id="
|
36
|
+
id="namedview440"
|
19
37
|
pagecolor="#ffffff"
|
20
38
|
bordercolor="#666666"
|
21
39
|
borderopacity="1.0"
|
@@ -24,22 +42,53 @@
|
|
24
42
|
inkscape:pagecheckerboard="0"
|
25
43
|
showgrid="false"
|
26
44
|
inkscape:zoom="0.95078031"
|
27
|
-
inkscape:cx="
|
28
|
-
inkscape:cy="
|
45
|
+
inkscape:cx="466.45896"
|
46
|
+
inkscape:cy="549.02273"
|
29
47
|
inkscape:window-width="1920"
|
30
48
|
inkscape:window-height="1007"
|
31
|
-
inkscape:window-x="
|
32
|
-
inkscape:window-y="
|
49
|
+
inkscape:window-x="0"
|
50
|
+
inkscape:window-y="0"
|
33
51
|
inkscape:window-maximized="1"
|
34
|
-
inkscape:current-layer="
|
52
|
+
inkscape:current-layer="g444" />
|
35
53
|
<g
|
36
54
|
inkscape:groupmode="layer"
|
37
55
|
inkscape:label="Image"
|
38
|
-
id="
|
39
|
-
<
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
56
|
+
id="g444">
|
57
|
+
<circle
|
58
|
+
id="path5141"
|
59
|
+
style="fill:none;stroke:#fffeff;stroke-opacity:1"
|
60
|
+
cx="0.66903824"
|
61
|
+
cy="263.65976"
|
62
|
+
r="0.52949077" />
|
63
|
+
<circle
|
64
|
+
id="path5143"
|
65
|
+
style="fill:none;stroke:#fffeff;stroke-opacity:1"
|
66
|
+
cx="0.66903824"
|
67
|
+
cy="263.65976"
|
68
|
+
r="0.52949077" />
|
69
|
+
<g
|
70
|
+
id="path5184"
|
71
|
+
style="stroke:#fffeff;stroke-opacity:1;fill:none">
|
72
|
+
<path
|
73
|
+
style="color:#000000;fill:none;stroke-width:154.42;-inkscape-stroke:none;stroke:#fffeff;stroke-opacity:1"
|
74
|
+
d="m -156.35359,113.32885 348.76355,221.92361 744.6236,-498.85799"
|
75
|
+
id="path6861" />
|
76
|
+
<path
|
77
|
+
style="color:#000000;fill:none;-inkscape-stroke:none;stroke:#fffeff;stroke-opacity:1"
|
78
|
+
d="M 894.06055,-227.75 191.32227,243.04492 -114.9043,48.1875 -197.80273,178.46875 193.49609,427.45898 980.00781,-99.460937 Z"
|
79
|
+
id="path6863" />
|
80
|
+
</g>
|
81
|
+
<g
|
82
|
+
id="path5186"
|
83
|
+
style="stroke:#fffeff;stroke-opacity:1;fill:none">
|
84
|
+
<path
|
85
|
+
style="color:#000000;fill:none;stroke-width:166.34;-inkscape-stroke:none;stroke:#fffeff;stroke-opacity:1"
|
86
|
+
d="M 816.06617,905.68984 357.97591,628.01443 1035.7943,176.14788"
|
87
|
+
id="path6855" />
|
88
|
+
<path
|
89
|
+
style="color:#000000;fill:none;-inkscape-stroke:none;stroke:#fffeff;stroke-opacity:1"
|
90
|
+
d="M 989.66016,106.94531 203.03125,631.34961 772.95312,976.81445 859.17773,834.56641 512.91992,624.67773 1081.9277,245.34961 Z"
|
91
|
+
id="path6857" />
|
92
|
+
</g>
|
44
93
|
</g>
|
45
94
|
</svg>
|
@@ -46,8 +46,8 @@
|
|
46
46
|
@keydown.native="onKeyDown"
|
47
47
|
:showBorder="showBorder"
|
48
48
|
:data-id="dataId"
|
49
|
-
:
|
50
|
-
>
|
49
|
+
:paddingLeft="paddingLeft"
|
50
|
+
>
|
51
51
|
<draggableInputHandle v-if="isDraggable && !isSearchBarVisible" :height="selectHeight" />
|
52
52
|
<inputText
|
53
53
|
v-if="isSearchBarVisible"
|
@@ -65,7 +65,7 @@
|
|
65
65
|
@input-change="searchChange"
|
66
66
|
@click.native.stop
|
67
67
|
/>
|
68
|
-
<selector v-else>
|
68
|
+
<selector v-else :selectWidth="selectWidth" :paddingLeft="paddingLeft">
|
69
69
|
<slot name="selector" :selectedValue="selectedValue"></slot>
|
70
70
|
</selector>
|
71
71
|
<Caret @click.stop="toggleCaretDropdown">
|
@@ -145,20 +145,26 @@ import icon from '../../icon'
|
|
145
145
|
import inputText from '../inputText'
|
146
146
|
import draggableInputHandle from '../../draggableInputHandle'
|
147
147
|
|
148
|
+
const CARET_WIDTH = '30px'
|
149
|
+
const BORDER_WIDTH = '1px'
|
150
|
+
|
148
151
|
const Caret = styled.div`
|
149
152
|
display: flex;
|
150
153
|
align-items: center;
|
151
154
|
justify-content: center;
|
152
|
-
width:
|
153
|
-
min-width:
|
155
|
+
width: ${CARET_WIDTH};
|
156
|
+
min-width: ${CARET_WIDTH};
|
154
157
|
height: 100%;
|
155
|
-
align-items: stretch
|
158
|
+
align-items: stretch;
|
156
159
|
cursor: pointer;
|
157
160
|
margin-left: auto;
|
158
161
|
`
|
159
162
|
|
160
|
-
const Selector = styled
|
161
|
-
width:
|
163
|
+
const Selector = styled('div', { selectWidth: String, paddingLeft: String })`
|
164
|
+
max-width: ${(props) => `calc(${props.selectWidth} - (${CARET_WIDTH} + ${props.paddingLeft} + (${BORDER_WIDTH} * 2)))`};
|
165
|
+
white-space: nowrap;
|
166
|
+
text-overflow: ellipsis;
|
167
|
+
overflow: hidden;
|
162
168
|
`
|
163
169
|
|
164
170
|
const labelAttrs = { fontSize: String, fontColor: String }
|
@@ -167,7 +173,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
167
173
|
props.theme.colors[props.fontColor]
|
168
174
|
? props.theme.colors[props.fontColor]
|
169
175
|
: props.fontColor};
|
170
|
-
font-size: ${(props) =>
|
176
|
+
font-size: ${(props) => props.fontSize};
|
171
177
|
font-weight: 700;
|
172
178
|
`
|
173
179
|
const optionalLabel = styled.span`
|
@@ -175,7 +181,7 @@ const optionalLabel = styled.span`
|
|
175
181
|
`
|
176
182
|
const inputProps = { selectWidth: String, optionWidth: String }
|
177
183
|
const Container = styled('div', inputProps)`
|
178
|
-
width: ${(props) =>
|
184
|
+
width: ${(props) => props.selectWidth};
|
179
185
|
position: relative;
|
180
186
|
display: inline-block;
|
181
187
|
`
|
@@ -204,15 +210,14 @@ const selectButtonAttrs = {
|
|
204
210
|
selectMinHeight: String,
|
205
211
|
isSearchBarVisible: Boolean,
|
206
212
|
showBorder: Boolean,
|
207
|
-
|
213
|
+
paddingLeft: String
|
208
214
|
}
|
209
215
|
const selectButton = styled('div', selectButtonAttrs)`
|
210
216
|
position: relative;
|
211
217
|
box-sizing: border-box;
|
212
218
|
border-radius: 4px;
|
213
|
-
|
219
|
+
${(props) => (props.isSearchBarVisible ? '' : `padding-left: ${props.paddingLeft}` )};
|
214
220
|
text-align: left;
|
215
|
-
border-radius: 4px;
|
216
221
|
min-height: ${(props) =>
|
217
222
|
props.selectHeight
|
218
223
|
? props.selectHeight
|
@@ -227,7 +232,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
227
232
|
${({ showBorder, theme, hasError }) =>
|
228
233
|
showBorder &&
|
229
234
|
`
|
230
|
-
border:
|
235
|
+
border: ${BORDER_WIDTH} solid ${hasError ? theme.colors.red : theme.colors.grey4}
|
231
236
|
`}
|
232
237
|
background-color:${(props) =>
|
233
238
|
props.disabled
|
@@ -249,7 +254,6 @@ const selectDropdownAttrs = {
|
|
249
254
|
hoveredBgColor: String,
|
250
255
|
bgColor: String,
|
251
256
|
fontColor: String,
|
252
|
-
selectWidth: String,
|
253
257
|
optionWidth: String,
|
254
258
|
hoveredIndex: Number,
|
255
259
|
hoveredValue: Number | String,
|
@@ -260,7 +264,7 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
260
264
|
z-index:${(props) => (props.isActive ? '2' : '1')};
|
261
265
|
position:absolute;
|
262
266
|
top:5px;
|
263
|
-
border:
|
267
|
+
border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
|
264
268
|
border-radius:4px;
|
265
269
|
display: flex;
|
266
270
|
flex-direction: column;
|
@@ -307,7 +311,7 @@ export default {
|
|
307
311
|
},
|
308
312
|
fontSize: {
|
309
313
|
required: false,
|
310
|
-
default:
|
314
|
+
default: '13px'
|
311
315
|
},
|
312
316
|
label: {
|
313
317
|
required: false
|
@@ -327,8 +331,9 @@ export default {
|
|
327
331
|
required: false
|
328
332
|
},
|
329
333
|
selectWidth: {
|
334
|
+
type: String,
|
330
335
|
required: false,
|
331
|
-
default:
|
336
|
+
default: '100%'
|
332
337
|
},
|
333
338
|
selectHeight: {
|
334
339
|
type: String,
|
@@ -437,6 +442,7 @@ export default {
|
|
437
442
|
data() {
|
438
443
|
return {
|
439
444
|
selectedValue: null,
|
445
|
+
paddingLeft: this.isDraggable ? '30px' : '15px',
|
440
446
|
isDropdownOpen: false,
|
441
447
|
isActive: false,
|
442
448
|
textSearch: '',
|
@@ -511,9 +517,6 @@ export default {
|
|
511
517
|
}
|
512
518
|
})
|
513
519
|
},
|
514
|
-
onSelectSlotClick() {
|
515
|
-
this.toggleDropdown()
|
516
|
-
},
|
517
520
|
clickOutside(event) {
|
518
521
|
const dropdownRef = this.$refs.dropdown
|
519
522
|
// we need to prevent closing on selecting an option, because in the case of
|
@@ -559,26 +562,21 @@ export default {
|
|
559
562
|
this.$refs.dropdown.$el.scrollTop = topPos
|
560
563
|
}
|
561
564
|
}
|
565
|
+
},
|
566
|
+
clearSearch() {
|
567
|
+
this.textSearch = ''
|
562
568
|
}
|
563
569
|
},
|
564
570
|
computed: {
|
565
571
|
optionLength() {
|
566
572
|
if (this.isDropdownOpen) {
|
567
|
-
|
568
|
-
const filterRef =
|
569
|
-
this.$refs.dropdown.$children &&
|
570
|
-
this.$refs.dropdown.$children.length > 1
|
571
|
-
? this.$refs.dropdown.$children
|
572
|
-
: this.$refs.dropdown.$children[0].$children
|
573
|
-
? this.$refs.dropdown.$children[0].$children
|
574
|
-
: this.$refs.dropdown.$children
|
575
|
-
return filterRef.length
|
576
|
-
} else {
|
577
|
-
return 0
|
573
|
+
return this.$refs.dropdown.$el.childElementCount
|
578
574
|
}
|
575
|
+
|
576
|
+
return 0
|
579
577
|
},
|
580
578
|
isSearchBarVisible() {
|
581
|
-
return this.isSearchable && this.
|
579
|
+
return this.isSearchable && this.isDropdownOpen
|
582
580
|
}
|
583
581
|
},
|
584
582
|
watch: {
|
@@ -5,7 +5,7 @@
|
|
5
5
|
:class="{ visible: isOpen, hidden: !isOpen }"
|
6
6
|
:backdrop="backdrop"
|
7
7
|
>
|
8
|
-
<modal-container @click
|
8
|
+
<modal-container @click="onClickModalContainer">
|
9
9
|
<spinner v-if="isLoading" size="50px" :limitedToModal="true" />
|
10
10
|
<content-container :visible="!isLoading">
|
11
11
|
<slot />
|
@@ -26,7 +26,7 @@
|
|
26
26
|
// import Modal from "@eturnity/eturnity_reusable_components/src/components/modals/modal"
|
27
27
|
// This is a more flexible modal box, where the parent can decide how the body of the modal looks
|
28
28
|
// To use:
|
29
|
-
// <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :isLoading="true" :hideClose="true">
|
29
|
+
// <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :isLoading="true" :hideClose="true" :stopPropagation="false">
|
30
30
|
// <div>Data....</div>
|
31
31
|
// </modal>
|
32
32
|
|
@@ -151,6 +151,10 @@ export default {
|
|
151
151
|
position: {
|
152
152
|
required: false,
|
153
153
|
default: 'fixed'
|
154
|
+
},
|
155
|
+
stopPropagation: {
|
156
|
+
type: Boolean,
|
157
|
+
default: true
|
154
158
|
}
|
155
159
|
},
|
156
160
|
beforeDestroy() {
|
@@ -164,6 +168,11 @@ export default {
|
|
164
168
|
if (key === 'Escape') {
|
165
169
|
this.onCloseModal()
|
166
170
|
}
|
171
|
+
},
|
172
|
+
onClickModalContainer(event) {
|
173
|
+
if (this.stopPropagation) {
|
174
|
+
event.stopPropagation()
|
175
|
+
}
|
167
176
|
}
|
168
177
|
},
|
169
178
|
watch: {
|