@eturnity/eturnity_reusable_components 7.8.6-EPDM-7779.3 → 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,7 +46,8 @@
|
|
46
46
|
@keydown.native="onKeyDown"
|
47
47
|
:showBorder="showBorder"
|
48
48
|
:data-id="dataId"
|
49
|
-
|
49
|
+
:isDraggable="isDraggable"
|
50
|
+
>
|
50
51
|
<draggableInputHandle v-if="isDraggable && !isSearchBarVisible" :height="selectHeight" />
|
51
52
|
<inputText
|
52
53
|
v-if="isSearchBarVisible"
|
@@ -64,7 +65,7 @@
|
|
64
65
|
@input-change="searchChange"
|
65
66
|
@click.native.stop
|
66
67
|
/>
|
67
|
-
<selector
|
68
|
+
<selector v-else>
|
68
69
|
<slot name="selector" :selectedValue="selectedValue"></slot>
|
69
70
|
</selector>
|
70
71
|
<Caret @click.stop="toggleCaretDropdown">
|
@@ -144,27 +145,20 @@ import icon from '../../icon'
|
|
144
145
|
import inputText from '../inputText'
|
145
146
|
import draggableInputHandle from '../../draggableInputHandle'
|
146
147
|
|
147
|
-
const CARET_WIDTH = '30px'
|
148
|
-
const PADDING = this.isDraggable ? '30px' : '15px'
|
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
|
`
|
@@ -209,14 +203,16 @@ const selectButtonAttrs = {
|
|
209
203
|
height: String,
|
210
204
|
selectMinHeight: String,
|
211
205
|
isSearchBarVisible: Boolean,
|
212
|
-
showBorder: Boolean
|
206
|
+
showBorder: Boolean,
|
207
|
+
isDraggable: Boolean,
|
213
208
|
}
|
214
209
|
const selectButton = styled('div', selectButtonAttrs)`
|
215
210
|
position: relative;
|
216
211
|
box-sizing: border-box;
|
217
212
|
border-radius: 4px;
|
218
|
-
|
213
|
+
padding-left:${(props) => (props.isSearchBarVisible ? '0' : props.isDraggable?'30px':'15px')};
|
219
214
|
text-align: left;
|
215
|
+
border-radius: 4px;
|
220
216
|
min-height: ${(props) =>
|
221
217
|
props.selectHeight
|
222
218
|
? props.selectHeight
|
@@ -231,7 +227,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
231
227
|
${({ showBorder, theme, hasError }) =>
|
232
228
|
showBorder &&
|
233
229
|
`
|
234
|
-
border:
|
230
|
+
border:1px solid ${hasError ? theme.colors.red : theme.colors.grey4}
|
235
231
|
`}
|
236
232
|
background-color:${(props) =>
|
237
233
|
props.disabled
|
@@ -253,6 +249,7 @@ const selectDropdownAttrs = {
|
|
253
249
|
hoveredBgColor: String,
|
254
250
|
bgColor: String,
|
255
251
|
fontColor: String,
|
252
|
+
selectWidth: String,
|
256
253
|
optionWidth: String,
|
257
254
|
hoveredIndex: Number,
|
258
255
|
hoveredValue: Number | String,
|
@@ -263,7 +260,7 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
263
260
|
z-index:${(props) => (props.isActive ? '2' : '1')};
|
264
261
|
position:absolute;
|
265
262
|
top:5px;
|
266
|
-
border:
|
263
|
+
border:1px solid ${(props) => props.theme.colors.grey4}
|
267
264
|
border-radius:4px;
|
268
265
|
display: flex;
|
269
266
|
flex-direction: column;
|
@@ -310,7 +307,7 @@ export default {
|
|
310
307
|
},
|
311
308
|
fontSize: {
|
312
309
|
required: false,
|
313
|
-
default:
|
310
|
+
default: null
|
314
311
|
},
|
315
312
|
label: {
|
316
313
|
required: false
|
@@ -330,9 +327,8 @@ export default {
|
|
330
327
|
required: false
|
331
328
|
},
|
332
329
|
selectWidth: {
|
333
|
-
type: String,
|
334
330
|
required: false,
|
335
|
-
default:
|
331
|
+
default: null
|
336
332
|
},
|
337
333
|
selectHeight: {
|
338
334
|
type: String,
|
@@ -515,6 +511,9 @@ export default {
|
|
515
511
|
}
|
516
512
|
})
|
517
513
|
},
|
514
|
+
onSelectSlotClick() {
|
515
|
+
this.toggleDropdown()
|
516
|
+
},
|
518
517
|
clickOutside(event) {
|
519
518
|
const dropdownRef = this.$refs.dropdown
|
520
519
|
// we need to prevent closing on selecting an option, because in the case of
|
@@ -560,21 +559,26 @@ export default {
|
|
560
559
|
this.$refs.dropdown.$el.scrollTop = topPos
|
561
560
|
}
|
562
561
|
}
|
563
|
-
},
|
564
|
-
clearSearch() {
|
565
|
-
this.textSearch = ''
|
566
562
|
}
|
567
563
|
},
|
568
564
|
computed: {
|
569
565
|
optionLength() {
|
570
566
|
if (this.isDropdownOpen) {
|
571
|
-
|
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
|
572
578
|
}
|
573
|
-
|
574
|
-
return 0
|
575
579
|
},
|
576
580
|
isSearchBarVisible() {
|
577
|
-
return this.isSearchable && this.isDropdownOpen
|
581
|
+
return this.isSearchable && this.optionLength >= 5 && this.isDropdownOpen
|
578
582
|
}
|
579
583
|
},
|
580
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
|
-
}
|