@eturnity/eturnity_reusable_components 1.2.86-EPDM-7509.1 → 1.2.86-EPDM-7435-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
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" ?><svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3.5 13H12v5l6-6-6-6v5H4V2H2v11z"/></svg>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<label-wrapper v-if="label">
|
8
8
|
<input-label :labelFontColor="labelFontColor" :fontSize="fontSize">{{
|
9
9
|
label
|
10
|
-
}}</input-label>
|
10
|
+
}} <optionalLabel v-if="labelOptional">({{ $gettext('Optional') }})</optionalLabel></input-label>
|
11
11
|
<info-text
|
12
12
|
v-if="infoTextMessage"
|
13
13
|
:text="infoTextMessage"
|
@@ -81,7 +81,9 @@ const InputLabel = styled('div', labelAttrs)`
|
|
81
81
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
82
82
|
font-weight: 700;
|
83
83
|
`
|
84
|
-
|
84
|
+
const optionalLabel = styled.span`
|
85
|
+
font-weight: 300;
|
86
|
+
`
|
85
87
|
const LabelWrapper = styled.div`
|
86
88
|
display: inline-grid;
|
87
89
|
grid-template-columns: auto auto;
|
@@ -217,7 +219,8 @@ export default {
|
|
217
219
|
Icon,
|
218
220
|
IconWrapper,
|
219
221
|
IconContainer,
|
220
|
-
InputErrorWrapper
|
222
|
+
InputErrorWrapper,
|
223
|
+
optionalLabel
|
221
224
|
},
|
222
225
|
data() {
|
223
226
|
return {
|
@@ -266,6 +269,10 @@ export default {
|
|
266
269
|
label: {
|
267
270
|
required: false
|
268
271
|
},
|
272
|
+
labelOptional: {
|
273
|
+
required: false,
|
274
|
+
default: false
|
275
|
+
},
|
269
276
|
noBorder: {
|
270
277
|
required: false,
|
271
278
|
default: false
|
@@ -14,7 +14,8 @@
|
|
14
14
|
labelFontColor || colorMode == 'dark' ? 'white' : 'eturnityGrey'
|
15
15
|
"
|
16
16
|
:fontSize="fontSize"
|
17
|
-
>{{ label }}</
|
17
|
+
>{{ label }} <optionalLabel v-if="labelOptional"> ({{ $gettext('Optional') }})</optionalLabel>
|
18
|
+
</input-label
|
18
19
|
>
|
19
20
|
<info-text
|
20
21
|
v-if="infoTextMessage"
|
@@ -158,6 +159,10 @@ const InputLabel = styled('div', labelAttrs)`
|
|
158
159
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '13px')};
|
159
160
|
font-weight: 700;
|
160
161
|
`
|
162
|
+
const optionalLabel = styled.span`
|
163
|
+
font-weight: 300;
|
164
|
+
|
165
|
+
`
|
161
166
|
const inputProps = { selectWidth: String, optionWidth: String }
|
162
167
|
const Container = styled('div', inputProps)`
|
163
168
|
width: ${(props) => (props.selectWidth ? props.selectWidth : '100%')};
|
@@ -193,7 +198,7 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
193
198
|
box-sizing: border-box;
|
194
199
|
border-radius: 4px;
|
195
200
|
padding: ${(props) =>
|
196
|
-
props.isSearchBarVisible ? '0
|
201
|
+
props.isSearchBarVisible ? '0' : '0px 0px 0 15px'};
|
197
202
|
text-align: left;
|
198
203
|
border-radius: 4px;
|
199
204
|
min-height: 36px;
|
@@ -230,7 +235,6 @@ const selectDropdown = styled('div', selectDropdownAttrs)`
|
|
230
235
|
z-index:${(props) => (props.isActive ? '2' : '1')};
|
231
236
|
position:absolute;
|
232
237
|
top:5px;
|
233
|
-
padding:10px;
|
234
238
|
border:1px solid ${(props) => props.theme.colors.grey4}
|
235
239
|
border-radius:4px;
|
236
240
|
display: flex;
|
@@ -283,6 +287,10 @@ export default {
|
|
283
287
|
label: {
|
284
288
|
required: false
|
285
289
|
},
|
290
|
+
labelOptional: {
|
291
|
+
required: false,
|
292
|
+
default: false
|
293
|
+
},
|
286
294
|
infoTextMessage: {
|
287
295
|
required: false
|
288
296
|
},
|
@@ -360,6 +368,7 @@ export default {
|
|
360
368
|
Container,
|
361
369
|
InputLabel,
|
362
370
|
LabelWrapper,
|
371
|
+
optionalLabel,
|
363
372
|
InfoText,
|
364
373
|
InputWrapper,
|
365
374
|
DropdownWrapper,
|
@@ -12,8 +12,6 @@
|
|
12
12
|
v-else
|
13
13
|
:cellPaddings="cellPaddings"
|
14
14
|
:tableCursor="tableCursor"
|
15
|
-
@mouseover="setHovers($event)"
|
16
|
-
@mouseleave="setHovers($event)"
|
17
15
|
>
|
18
16
|
<slot />
|
19
17
|
</table-container>
|
@@ -89,8 +87,8 @@ const TableContainer = styled('table', containerAttrs)`
|
|
89
87
|
}
|
90
88
|
|
91
89
|
tbody {
|
92
|
-
tr
|
93
|
-
&:hover
|
90
|
+
tr {
|
91
|
+
&:hover {
|
94
92
|
background-color: ${(props) => props.theme.colors.white};
|
95
93
|
cursor: ${(props) => (props.tableCursor ? props.tableCursor : 'auto')};
|
96
94
|
|
@@ -380,33 +378,6 @@ export default {
|
|
380
378
|
tableCursor: {
|
381
379
|
required: false
|
382
380
|
}
|
383
|
-
},
|
384
|
-
methods: {
|
385
|
-
setHovers(event) {
|
386
|
-
if (event.target.tagName !== 'TABLE') {
|
387
|
-
console.log('over', event)
|
388
|
-
let hoveredCell = event.target
|
389
|
-
console.log(hoveredCell.tagName)
|
390
|
-
|
391
|
-
if (hoveredCell.tagName !== 'TD') {
|
392
|
-
let currentParentElement = hoveredCell.parentElement
|
393
|
-
while (currentParentElement.tagName !== 'TR') {
|
394
|
-
console.log(currentParentElement.tagName)
|
395
|
-
if (currentParentElement.tagName === 'TD') hoveredCell = currentParentElement
|
396
|
-
currentParentElement = currentParentElement.parentElement
|
397
|
-
}
|
398
|
-
}
|
399
|
-
|
400
|
-
if (hoveredCell) {
|
401
|
-
const rowChildren = Array.from(hoveredCell.parentElement.children)
|
402
|
-
const rowList = Array.from(document.querySelectorAll('tr'))
|
403
|
-
rowList.forEach((el) => {
|
404
|
-
const cells = Array.from(el.children)
|
405
|
-
cells[rowChildren.indexOf(hoveredCell)].classList.add('hover')
|
406
|
-
})
|
407
|
-
}
|
408
|
-
}
|
409
|
-
}
|
410
381
|
}
|
411
382
|
}
|
412
383
|
</script>
|