@eturnity/eturnity_reusable_components 7.8.6-EPDM-7779.4 → 7.8.6-EPDM-9865.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
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="3" d="M245.7,232.4c1,7.7-2.4,11.3-10.3,10.8l-62.1-6.9c-4.9-0.5-8-1.9-9.3-4.1c-1.3-2.2-0.6-4.7,2.3-7.5c1.9-1.6,4.1-3.9,6.8-6.8c2.7-2.9,5-5.2,6.8-7c1.9-2,2.4-3.8,1.8-5.4c-0.7-1.6-2-3.5-4-5.7c-4.7-4.4-9-8.5-12.9-12.1c-3.9-3.6-8.2-7.8-12.9-12.6c-1-1-2-2-3-3.2c-1-1.2-1.8-2.4-2.3-3.8c-0.5-1.4-0.6-2.9-0.2-4.4c0.3-1.6,1.4-3.3,3.3-5.1c1-1,1.9-1.9,2.5-2.6c0.7-0.7,1.3-1.4,2-2c0.7-0.6,1.4-1.2,2.1-2c0.7-0.7,1.7-1.8,2.9-3.1c3.4-3.3,6.5-4.7,9.3-4.2c2.9,0.5,6,2.4,9.3,5.7c3.4,3.3,6.8,6.6,10.3,10c3.5,3.4,7.5,7.2,11.8,11.5c3.2,3,5.9,5,8.2,6.2c2.3,1.2,4.5,0.6,6.7-1.5c1.5-1.5,3.4-3.3,5.7-5.3c2.3-2,4.2-3.9,5.9-5.5c2.9-2.8,5.4-3.9,7.7-3.2c2.3,0.7,3.7,3.1,4.2,7.4L245.7,232.4L245.7,232.4L245.7,232.4z M11.1,24c-0.5-4.3,0-7.2,1.6-8.9c1.6-1.6,4.4-2.3,8.5-2L83.2,20c5.1,0.5,8.2,1.9,9.5,4.1c1.3,2.2,0.5,4.7-2.4,7.5c-1.7,1.6-3.7,3.8-6.2,6.4c-2.4,2.6-4.6,4.8-6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11.3c3.2-3,5.4-5.6,6.6-7.9c1.2-2.3,0.6-4.4-1.8-6.4c-1.5-1.5-3.4-3.5-5.8-6c-2.4-2.6-4.4-4.6-6-6.3c-2.9-2.8-3.9-5.2-3.3-7.4c0.7-2.1,3.2-3.4,7.6-3.9L234.8,12.9L234.8,12.9L234.8,12.9z M21.2,241.7c-4.2,0.3-7.2-0.3-9-1.9c-1.8-1.6-2.5-4.3-2.1-8.3l7.1-60.6c0.5-4.9,1.9-8,4.2-9.2c2.3-1.2,4.8-0.5,7.7,2.3c1.7,1.6,4,3.8,6.9,6.4c2.9,2.6,5.3,4.8,7.2,6.6c2,2,3.7,2.8,5,2.6c1.3-0.2,3-1.4,5-3.6c2.2-2.1,4.3-4.2,6.3-6.3c2-2,4-4.1,6-6c2-2,4.1-4,6.2-6.2c2.1-2.1,4.3-4.4,6.7-6.6c1-1,2.1-2,3.3-3c1.2-1,2.5-1.7,3.9-2.2s2.9-0.5,4.5-0.1c1.6,0.4,3.3,1.5,5.2,3.3c1,1,1.9,1.8,2.6,2.5c0.7,0.7,1.5,1.3,2.1,2l2,2.2l3,2.7c3.4,3.3,4.8,6.3,4.4,9c-0.4,2.7-2.4,5.8-5.9,9.2c-3.2,3.1-6.5,6.5-10.1,10c-3.5,3.5-7.5,7.4-11.8,11.7c-3,3-4.9,5.4-5.7,7.3c-0.7,1.9,0,3.9,2.1,6c1.7,1.5,3.6,3.3,5.7,5.5c2.1,2.2,4,4.1,5.7,5.8c2.9,2.8,3.9,5.2,3.2,7.4c-0.7,2.1-3.3,3.4-7.7,3.9L21.2,241.7L21.2,241.7L21.2,241.7z" style="stroke-dasharray: 1461, 1461;stroke-dashoffset: 0;fill-opacity: 1;"></path></svg>
|
@@ -46,8 +46,8 @@
|
|
46
46
|
@keydown.native="onKeyDown"
|
47
47
|
:showBorder="showBorder"
|
48
48
|
:data-id="dataId"
|
49
|
-
:
|
50
|
-
>
|
49
|
+
:isDraggable="isDraggable"
|
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>
|
69
69
|
<slot name="selector" :selectedValue="selectedValue"></slot>
|
70
70
|
</selector>
|
71
71
|
<Caret @click.stop="toggleCaretDropdown">
|
@@ -145,26 +145,20 @@ 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
|
-
|
151
148
|
const Caret = styled.div`
|
152
149
|
display: flex;
|
153
150
|
align-items: center;
|
154
151
|
justify-content: center;
|
155
|
-
width:
|
156
|
-
min-width:
|
152
|
+
width: 30px;
|
153
|
+
min-width: 30px;
|
157
154
|
height: 100%;
|
158
|
-
align-items: stretch
|
155
|
+
align-items: stretch
|
159
156
|
cursor: pointer;
|
160
157
|
margin-left: auto;
|
161
158
|
`
|
162
159
|
|
163
|
-
const Selector = styled
|
164
|
-
|
165
|
-
white-space: nowrap;
|
166
|
-
text-overflow: ellipsis;
|
167
|
-
overflow: hidden;
|
160
|
+
const Selector = styled.div`
|
161
|
+
width: 100%;
|
168
162
|
`
|
169
163
|
|
170
164
|
const labelAttrs = { fontSize: String, fontColor: String }
|
@@ -173,7 +167,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
173
167
|
props.theme.colors[props.fontColor]
|
174
168
|
? props.theme.colors[props.fontColor]
|
175
169
|
: props.fontColor};
|
176
|
-
font-size: ${(props) => props.fontSize};
|
170
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
177
171
|
font-weight: 700;
|
178
172
|
`
|
179
173
|
const optionalLabel = styled.span`
|
@@ -181,7 +175,7 @@ const optionalLabel = styled.span`
|
|
181
175
|
`
|
182
176
|
const inputProps = { selectWidth: String, optionWidth: String }
|
183
177
|
const Container = styled('div', inputProps)`
|
184
|
-
width: ${(props) => props.selectWidth};
|
178
|
+
width: ${(props) => (props.selectWidth ? props.selectWidth : '100%')};
|
185
179
|
position: relative;
|
186
180
|
display: inline-block;
|
187
181
|
`
|
@@ -210,14 +204,15 @@ const selectButtonAttrs = {
|
|
210
204
|
selectMinHeight: String,
|
211
205
|
isSearchBarVisible: Boolean,
|
212
206
|
showBorder: Boolean,
|
213
|
-
|
207
|
+
isDraggable: Boolean,
|
214
208
|
}
|
215
209
|
const selectButton = styled('div', selectButtonAttrs)`
|
216
210
|
position: relative;
|
217
211
|
box-sizing: border-box;
|
218
212
|
border-radius: 4px;
|
219
|
-
|
213
|
+
padding-left:${(props) => (props.isSearchBarVisible ? '0' : props.isDraggable?'30px':'15px')};
|
220
214
|
text-align: left;
|
215
|
+
border-radius: 4px;
|
221
216
|
min-height: ${(props) =>
|
222
217
|
props.selectHeight
|
223
218
|
? props.selectHeight
|
@@ -232,7 +227,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
232
227
|
${({ showBorder, theme, hasError }) =>
|
233
228
|
showBorder &&
|
234
229
|
`
|
235
|
-
border:
|
230
|
+
border:1px solid ${hasError ? theme.colors.red : theme.colors.grey4}
|
236
231
|
`}
|
237
232
|
background-color:${(props) =>
|
238
233
|
props.disabled
|
@@ -254,6 +249,7 @@ const selectDropdownAttrs = {
|
|
254
249
|
hoveredBgColor: String,
|
255
250
|
bgColor: String,
|
256
251
|
fontColor: String,
|
252
|
+
selectWidth: String,
|
257
253
|
optionWidth: String,
|
258
254
|
hoveredIndex: Number,
|
259
255
|
hoveredValue: Number | String,
|
@@ -264,7 +260,7 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
264
260
|
z-index:${(props) => (props.isActive ? '2' : '1')};
|
265
261
|
position:absolute;
|
266
262
|
top:5px;
|
267
|
-
border:
|
263
|
+
border:1px solid ${(props) => props.theme.colors.grey4}
|
268
264
|
border-radius:4px;
|
269
265
|
display: flex;
|
270
266
|
flex-direction: column;
|
@@ -311,7 +307,7 @@ export default {
|
|
311
307
|
},
|
312
308
|
fontSize: {
|
313
309
|
required: false,
|
314
|
-
default:
|
310
|
+
default: null
|
315
311
|
},
|
316
312
|
label: {
|
317
313
|
required: false
|
@@ -331,9 +327,8 @@ export default {
|
|
331
327
|
required: false
|
332
328
|
},
|
333
329
|
selectWidth: {
|
334
|
-
type: String,
|
335
330
|
required: false,
|
336
|
-
default:
|
331
|
+
default: null
|
337
332
|
},
|
338
333
|
selectHeight: {
|
339
334
|
type: String,
|
@@ -442,7 +437,6 @@ export default {
|
|
442
437
|
data() {
|
443
438
|
return {
|
444
439
|
selectedValue: null,
|
445
|
-
paddingLeft: this.isDraggable ? '30px' : '15px',
|
446
440
|
isDropdownOpen: false,
|
447
441
|
isActive: false,
|
448
442
|
textSearch: '',
|
@@ -517,6 +511,9 @@ export default {
|
|
517
511
|
}
|
518
512
|
})
|
519
513
|
},
|
514
|
+
onSelectSlotClick() {
|
515
|
+
this.toggleDropdown()
|
516
|
+
},
|
520
517
|
clickOutside(event) {
|
521
518
|
const dropdownRef = this.$refs.dropdown
|
522
519
|
// we need to prevent closing on selecting an option, because in the case of
|
@@ -562,21 +559,26 @@ export default {
|
|
562
559
|
this.$refs.dropdown.$el.scrollTop = topPos
|
563
560
|
}
|
564
561
|
}
|
565
|
-
},
|
566
|
-
clearSearch() {
|
567
|
-
this.textSearch = ''
|
568
562
|
}
|
569
563
|
},
|
570
564
|
computed: {
|
571
565
|
optionLength() {
|
572
566
|
if (this.isDropdownOpen) {
|
573
|
-
|
567
|
+
// this filterRef is needed to check for the # of children on Filter dropdowns
|
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
|
574
578
|
}
|
575
|
-
|
576
|
-
return 0
|
577
579
|
},
|
578
580
|
isSearchBarVisible() {
|
579
|
-
return this.isSearchable && this.isDropdownOpen
|
581
|
+
return this.isSearchable && this.optionLength >= 5 && this.isDropdownOpen
|
580
582
|
}
|
581
583
|
},
|
582
584
|
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.stop>
|
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">
|
30
30
|
// <div>Data....</div>
|
31
31
|
// </modal>
|
32
32
|
|
@@ -151,10 +151,6 @@ export default {
|
|
151
151
|
position: {
|
152
152
|
required: false,
|
153
153
|
default: 'fixed'
|
154
|
-
},
|
155
|
-
stopPropagation: {
|
156
|
-
type: Boolean,
|
157
|
-
default: true
|
158
154
|
}
|
159
155
|
},
|
160
156
|
beforeDestroy() {
|
@@ -168,11 +164,6 @@ export default {
|
|
168
164
|
if (key === 'Escape') {
|
169
165
|
this.onCloseModal()
|
170
166
|
}
|
171
|
-
},
|
172
|
-
onClickModalContainer(event) {
|
173
|
-
if (this.stopPropagation) {
|
174
|
-
event.stopPropagation()
|
175
|
-
}
|
176
167
|
}
|
177
168
|
},
|
178
169
|
watch: {
|
package/.eslintrc
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": ["plugin:prettier/recommended", "plugin:vue/essential"],
|
3
|
-
|
4
|
-
"plugins": ["prettier"],
|
5
|
-
|
6
|
-
"rules": {
|
7
|
-
"prettier/prettier": "error",
|
8
|
-
"vue/no-parsing-error": "off",
|
9
|
-
"vue/no-side-effects-in-computed-properties": "off",
|
10
|
-
"vue/invalid-first-character-of-tag-name": "off"
|
11
|
-
},
|
12
|
-
|
13
|
-
"parserOptions": {
|
14
|
-
"ecmaVersion": 6,
|
15
|
-
"parser": "babel-eslint",
|
16
|
-
"sourceType": "module"
|
17
|
-
}
|
18
|
-
}
|