@eturnity/eturnity_reusable_components 7.18.0-EPDM-10335.1 → 7.18.0-qa-dev03.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/.storybook/preview.js +1 -1
- package/package.json +23 -19
- package/src/App.vue +2 -2
- package/src/assets/svgIcons/anchor.svg +18 -0
- package/src/assets/svgIcons/flatten_roof.svg +20 -0
- package/src/assets/svgIcons/split.svg +6 -88
- package/src/components/addNewButton/index.vue +3 -5
- package/src/components/buttons/buttonIcon/index.vue +1 -1
- package/src/components/buttons/closeButton/index.vue +1 -1
- package/src/components/buttons/mainButton/index.vue +1 -6
- package/src/components/card/index.vue +24 -25
- package/src/components/deleteIcon/DeleteIcon.stories.js +7 -7
- package/src/components/deleteIcon/index.vue +21 -25
- package/src/components/draggableInputHandle/index.vue +25 -24
- package/src/components/dropdown/index.vue +110 -129
- package/src/components/errorMessage/index.vue +5 -10
- package/src/components/filter/filterSettings.vue +97 -58
- package/src/components/filter/index.vue +3 -3
- package/src/components/filter/parentDropdown.vue +2 -2
- package/src/components/icon/iconCollection.vue +2 -2
- package/src/components/icon/index.vue +75 -67
- package/src/components/iconWrapper/index.vue +4 -1
- package/src/components/infoCard/index.vue +3 -2
- package/src/components/infoText/index.vue +1 -1
- package/src/components/inputs/checkbox/index.vue +6 -21
- package/src/components/inputs/inputNumber/index.vue +10 -10
- package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
- package/src/components/inputs/inputText/index.vue +3 -3
- package/src/components/inputs/radioButton/index.vue +1 -1
- package/src/components/inputs/searchInput/index.vue +11 -28
- package/src/components/inputs/select/index.vue +55 -199
- package/src/components/inputs/select/option/index.vue +11 -36
- package/src/components/inputs/slider/index.vue +16 -16
- package/src/components/inputs/switchField/index.vue +2 -2
- package/src/components/inputs/textAreaInput/index.vue +1 -1
- package/src/components/inputs/toggle/index.vue +2 -2
- package/src/components/label/index.vue +31 -27
- package/src/components/modals/modal/index.vue +6 -2
- package/src/components/navigationTabs/index.vue +20 -27
- package/src/components/pageSubtitle/index.vue +1 -1
- package/src/components/pageTitle/index.vue +4 -4
- package/src/components/pagination/index.vue +1 -1
- package/src/components/progressBar/index.vue +1 -1
- package/src/components/projectMarker/index.vue +9 -16
- package/src/components/sideMenu/index.vue +1 -1
- package/src/components/spinner/index.vue +11 -7
- package/src/components/tableDropdown/index.vue +37 -30
- package/src/components/tables/mainTable/exampleNested.vue +1 -1
- package/src/components/tables/mainTable/index.vue +9 -10
- package/src/components/tables/viewTable/index.vue +2 -2
- package/src/components/threeDots/index.vue +1 -1
- package/src/components/videoThumbnail/index.vue +100 -95
- package/src/main.js +11 -4
- package/src/components/icon/iconCache.js +0 -23
@@ -1,13 +1,20 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<icon-image
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
<Wrapper :isDisabled="disabled" :size="size" :cursor="cursor">
|
3
|
+
<icon-image
|
4
|
+
:disabled="disabled"
|
5
|
+
:size="size"
|
6
|
+
:color="color"
|
7
|
+
:hoveredColor="hoveredColor"
|
8
|
+
:backgroundColor="backgroundColor"
|
9
|
+
v-html="
|
10
|
+
require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
|
11
|
+
"
|
12
|
+
></icon-image>
|
13
|
+
<striked-line v-if="isStriked" :color="color" :disabled="disabled" :hoveredColor="hoveredColor"></striked-line>
|
14
|
+
</Wrapper>
|
8
15
|
</template>
|
9
16
|
|
10
|
-
<script
|
17
|
+
<script>
|
11
18
|
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
12
19
|
// How to use:
|
13
20
|
//<icon
|
@@ -19,71 +26,40 @@
|
|
19
26
|
// isStriked = "true"
|
20
27
|
// />
|
21
28
|
|
22
|
-
import
|
23
|
-
import styled from 'vue3-styled-components'
|
24
|
-
import { fetchIcon } from './iconCache'
|
29
|
+
import styled from 'vue-styled-components'
|
25
30
|
|
26
|
-
const
|
27
|
-
|
28
|
-
required: false,
|
29
|
-
default: false
|
30
|
-
},
|
31
|
-
name: {
|
32
|
-
required: true
|
33
|
-
},
|
34
|
-
color: {
|
35
|
-
required: false
|
36
|
-
},
|
37
|
-
hoveredColor: {
|
38
|
-
required: false
|
39
|
-
},
|
40
|
-
size: {
|
41
|
-
required: false,
|
42
|
-
default: '30px'
|
43
|
-
},
|
44
|
-
cursor: {
|
45
|
-
required: false,
|
46
|
-
default: null
|
47
|
-
},
|
48
|
-
isStriked: {
|
49
|
-
required: false,
|
50
|
-
default: false
|
51
|
-
}
|
52
|
-
})
|
53
|
-
|
54
|
-
const Wrapper = styled('div')`
|
31
|
+
const wrapperAttrs = { isDisabled: Boolean, size: String, cursor: String }
|
32
|
+
const Wrapper = styled('div', wrapperAttrs)`
|
55
33
|
display: flex;
|
56
34
|
position: relative;
|
57
35
|
align-content: center;
|
58
36
|
justify-content: center;
|
59
|
-
width: ${props.size};
|
60
|
-
height: ${props.size};
|
61
|
-
min-width: ${props.size};
|
62
|
-
min-height: ${props.size};
|
63
|
-
cursor: ${props.
|
37
|
+
width: ${(props) => props.size};
|
38
|
+
height: ${(props) => props.size};
|
39
|
+
min-width: ${(props) => props.size};
|
40
|
+
min-height: ${(props) => props.size};
|
41
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursor)};
|
64
42
|
line-height: 0;
|
65
43
|
`
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
hoveredColor: String
|
70
|
-
}
|
71
|
-
const StrikedLine = styled.div`
|
44
|
+
|
45
|
+
const strikedAttrs = { isDisabled: Boolean, color: String, hoveredColor: String }
|
46
|
+
const strikedLine = styled('div', strikedAttrs)`
|
72
47
|
display: flex;
|
73
48
|
position: absolute;
|
74
|
-
bottom:
|
75
|
-
left:
|
49
|
+
bottom:0;
|
50
|
+
left:0;
|
76
51
|
align-content: center;
|
77
52
|
justify-content: center;
|
78
53
|
width: 143%;
|
79
|
-
height:
|
80
|
-
background-color: ${(
|
54
|
+
height:8%;
|
55
|
+
background-color: ${(props)=>props.theme.colors[props.color] || props.color};
|
81
56
|
min-height: 0;
|
82
57
|
line-height: 0;
|
83
58
|
transform-origin: 0% 100%;
|
84
59
|
transform: rotate(-45deg);
|
85
60
|
`
|
86
|
-
const
|
61
|
+
const IconImageProps = { color: String, hoveredColor: String, size: String, backgroundColor: String}
|
62
|
+
const IconImage = styled('div', IconImageProps)`
|
87
63
|
width: 100%;
|
88
64
|
svg {
|
89
65
|
width: 100%;
|
@@ -92,24 +68,56 @@ const IconImage = styled.div`
|
|
92
68
|
padding: ${(props) => props.backgroundColor ? '3px' : '0'};
|
93
69
|
}
|
94
70
|
svg path {
|
95
|
-
${(
|
96
|
-
props.color && `fill: ${theme.colors[props.color] || props.color};`}
|
71
|
+
${(props) =>
|
72
|
+
props.color && `fill: ${props.theme.colors[props.color] || props.color};`}
|
97
73
|
}
|
98
74
|
&:hover > svg path {
|
99
|
-
${props.hoveredColor && `fill: ${props.hoveredColor};`}
|
75
|
+
${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
|
100
76
|
}
|
101
77
|
&:hover + div {
|
102
|
-
background-color: ${props.hoveredColor};
|
78
|
+
background-color: ${(props)=>props.hoveredColor};
|
103
79
|
}
|
104
80
|
`
|
105
81
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
82
|
+
export default {
|
83
|
+
name: 'icon',
|
84
|
+
components: {
|
85
|
+
IconImage,
|
86
|
+
Wrapper,
|
87
|
+
strikedLine
|
88
|
+
},
|
89
|
+
props: {
|
90
|
+
disabled: {
|
91
|
+
required: false,
|
92
|
+
default: false
|
93
|
+
},
|
94
|
+
name: {
|
95
|
+
required: true
|
96
|
+
},
|
97
|
+
color: {
|
98
|
+
required: false
|
99
|
+
},
|
100
|
+
backgroundColor: {
|
101
|
+
required: false
|
102
|
+
},
|
103
|
+
hoveredColor: {
|
104
|
+
required: false
|
105
|
+
},
|
106
|
+
size: {
|
107
|
+
required: false,
|
108
|
+
default: '30px'
|
109
|
+
},
|
110
|
+
cursor: {
|
111
|
+
required: false,
|
112
|
+
default: null
|
113
|
+
},
|
114
|
+
isStriked: {
|
115
|
+
required: false,
|
116
|
+
default: false
|
117
|
+
}
|
118
|
+
},
|
119
|
+
data() {
|
120
|
+
return {}
|
121
|
+
}
|
110
122
|
}
|
111
|
-
|
112
|
-
onMounted(() => loadSvg())
|
113
|
-
|
114
|
-
watch(() => props.name, loadSvg)
|
115
123
|
</script>
|
@@ -42,7 +42,7 @@
|
|
42
42
|
// size="60px" by default, this is 30px
|
43
43
|
// />
|
44
44
|
|
45
|
-
import styled from '
|
45
|
+
import styled from 'vue-styled-components'
|
46
46
|
import icon from '../icon'
|
47
47
|
const wrapperAttrs = {
|
48
48
|
color: String,
|
@@ -148,6 +148,9 @@ export default {
|
|
148
148
|
required: false,
|
149
149
|
default: false
|
150
150
|
}
|
151
|
+
},
|
152
|
+
data() {
|
153
|
+
return {}
|
151
154
|
}
|
152
155
|
}
|
153
156
|
</script>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
</template>
|
9
9
|
|
10
10
|
<script>
|
11
|
-
import styled from '
|
11
|
+
import styled from 'vue-styled-components'
|
12
12
|
import Icon from '../icon'
|
13
13
|
|
14
14
|
const InfoContainer = styled.div`
|
@@ -24,6 +24,7 @@ const TextContainer = styled.div`
|
|
24
24
|
width: 100%;
|
25
25
|
`
|
26
26
|
|
27
|
+
|
27
28
|
export default {
|
28
29
|
name: 'InfoCard',
|
29
30
|
components: {
|
@@ -32,4 +33,4 @@ export default {
|
|
32
33
|
TextContainer
|
33
34
|
}
|
34
35
|
}
|
35
|
-
</script>
|
36
|
+
</script>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
// alignArrow="right" // which side the arrow should be on
|
31
31
|
// />
|
32
32
|
import theme from '../../assets/theme.js'
|
33
|
-
import styled from '
|
33
|
+
import styled from 'vue-styled-components'
|
34
34
|
import icon from '../icon'
|
35
35
|
|
36
36
|
const textAttrs = {
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<container
|
4
4
|
:checkColor="checkColor"
|
5
5
|
:size="size"
|
6
|
-
:hasLabel="
|
6
|
+
:hasLabel="!!label.length"
|
7
7
|
:backgroundColor="backgroundColor"
|
8
8
|
:isChecked="isChecked"
|
9
9
|
:isDisabled="isDisabled"
|
@@ -14,10 +14,10 @@
|
|
14
14
|
:data-id="dataId"
|
15
15
|
@change="onChangeHandler(!isChecked)"
|
16
16
|
/>
|
17
|
-
<
|
17
|
+
<div>
|
18
18
|
<span class="checkmark"></span>
|
19
|
-
</
|
20
|
-
<label-text v-if="
|
19
|
+
</div>
|
20
|
+
<label-text v-if="!!label.length">{{ label }}</label-text>
|
21
21
|
</container>
|
22
22
|
</component-wrapper>
|
23
23
|
</template>
|
@@ -34,21 +34,12 @@
|
|
34
34
|
// backgroundColor="red"
|
35
35
|
// :isDisabled="true"
|
36
36
|
// />
|
37
|
-
import styled from '
|
37
|
+
import styled from 'vue-styled-components'
|
38
38
|
|
39
39
|
const ComponentWrapper = styled.div`
|
40
40
|
min-height: 18px;
|
41
41
|
`
|
42
42
|
|
43
|
-
const CheckWrapper = styled('div', { hasLabel: Boolean })`
|
44
|
-
${(props) =>
|
45
|
-
props.hasLabel &&
|
46
|
-
`
|
47
|
-
display: flex;
|
48
|
-
align-items: center;
|
49
|
-
`}
|
50
|
-
`
|
51
|
-
|
52
43
|
const containerAttrs = {
|
53
44
|
checkColor: String,
|
54
45
|
size: String,
|
@@ -154,8 +145,7 @@ export default {
|
|
154
145
|
ComponentWrapper,
|
155
146
|
Container,
|
156
147
|
InputCheckbox,
|
157
|
-
LabelText
|
158
|
-
CheckWrapper
|
148
|
+
LabelText
|
159
149
|
},
|
160
150
|
props: {
|
161
151
|
label: {
|
@@ -185,11 +175,6 @@ export default {
|
|
185
175
|
default: ''
|
186
176
|
}
|
187
177
|
},
|
188
|
-
computed: {
|
189
|
-
hasLabel() {
|
190
|
-
return !!this.label.length
|
191
|
-
}
|
192
|
-
},
|
193
178
|
methods: {
|
194
179
|
onChangeHandler(value) {
|
195
180
|
if (this.isDisabled) {
|
@@ -47,6 +47,7 @@
|
|
47
47
|
:fontSize="fontSize"
|
48
48
|
:fontColor="fontColor"
|
49
49
|
:backgroundColor="backgroundColor"
|
50
|
+
v-on="$listeners"
|
50
51
|
:hasSlot="hasSlot"
|
51
52
|
:hasLabelSlot="hasLabelSlot"
|
52
53
|
:slotSize="slotSize"
|
@@ -100,7 +101,7 @@
|
|
100
101
|
// >
|
101
102
|
//<template name=label><img>....</template>
|
102
103
|
//</inputNumber>
|
103
|
-
import styled from '
|
104
|
+
import styled from 'vue-styled-components'
|
104
105
|
import {
|
105
106
|
stringToNumber,
|
106
107
|
numberToString
|
@@ -487,10 +488,9 @@ export default {
|
|
487
488
|
// Need to return an integer rather than a string
|
488
489
|
this.$emit('input-change', event)
|
489
490
|
},
|
490
|
-
onEvaluateCode(
|
491
|
+
onEvaluateCode(val) {
|
491
492
|
// function to perform math on the code
|
492
493
|
// filter the string in case of any malicious content
|
493
|
-
const val = event.target.value
|
494
494
|
let filtered = val.replace('(auto)', '').replace(/[^-()\d/*+.,]/g, '')
|
495
495
|
filtered = filtered.split(/([-+*/()])/)
|
496
496
|
let formatted = filtered.map((item) => {
|
@@ -548,19 +548,19 @@ export default {
|
|
548
548
|
}
|
549
549
|
return array
|
550
550
|
},
|
551
|
-
onInput(
|
551
|
+
onInput(value) {
|
552
552
|
if (this.isBlurred) {
|
553
553
|
this.isBlurred = false
|
554
554
|
return
|
555
555
|
}
|
556
|
-
if (
|
556
|
+
if (value === '' && this.isFocused) {
|
557
557
|
this.$emit('on-input', '')
|
558
558
|
}
|
559
559
|
let evaluatedVal
|
560
560
|
try {
|
561
|
-
evaluatedVal = this.onEvaluateCode(
|
561
|
+
evaluatedVal = this.onEvaluateCode(value)
|
562
562
|
} finally {
|
563
|
-
if (evaluatedVal) {
|
563
|
+
if (evaluatedVal && this.isFocused && this.value != evaluatedVal) {
|
564
564
|
this.$emit('on-input', evaluatedVal)
|
565
565
|
}
|
566
566
|
}
|
@@ -570,7 +570,7 @@ export default {
|
|
570
570
|
// setting isBlurred so we don't trigger onInput as well
|
571
571
|
this.isBlurred = true
|
572
572
|
let value = e.target.value
|
573
|
-
let evaluatedInput = this.onEvaluateCode(
|
573
|
+
let evaluatedInput = this.onEvaluateCode(value)
|
574
574
|
this.onChangeHandler(evaluatedInput ? evaluatedInput : value)
|
575
575
|
if ((evaluatedInput && value.length) || this.minNumber !== null) {
|
576
576
|
this.textInput = numberToString({
|
@@ -646,10 +646,10 @@ export default {
|
|
646
646
|
}
|
647
647
|
},
|
648
648
|
initInteraction(e) {
|
649
|
+
this.focusInput()
|
650
|
+
e.preventDefault()
|
649
651
|
window.addEventListener('mousemove', this.interact, false)
|
650
652
|
window.addEventListener('mouseup', this.stopInteract, false)
|
651
|
-
e.preventDefault()
|
652
|
-
this.focusInput()
|
653
653
|
},
|
654
654
|
interact(e) {
|
655
655
|
e.preventDefault()
|
@@ -66,7 +66,7 @@
|
|
66
66
|
</template>
|
67
67
|
|
68
68
|
<script>
|
69
|
-
import styled from '
|
69
|
+
import styled from 'vue-styled-components'
|
70
70
|
import InfoText from '../../infoText'
|
71
71
|
import Icon from '../../icon'
|
72
72
|
import ErrorMessage from '../../errorMessage'
|
@@ -332,8 +332,8 @@ export default {
|
|
332
332
|
this.$emit('on-enter-click')
|
333
333
|
this.$refs.inputElement.$el.blur()
|
334
334
|
},
|
335
|
-
onChangeHandler(event) {
|
336
|
-
this.$emit('input-change', event
|
335
|
+
onChangeHandler($event) {
|
336
|
+
this.$emit('input-change', $event)
|
337
337
|
},
|
338
338
|
onInputBlur($event) {
|
339
339
|
this.$emit('input-blur', $event.target.value)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<container :inputWidth="inputWidth">
|
3
|
-
<input-wrapper
|
4
|
-
<SearchIconSvg class="search-icn" />
|
3
|
+
<input-wrapper>
|
5
4
|
<input-container
|
6
5
|
ref="inputElement"
|
7
6
|
:placeholder="placeholder"
|
@@ -14,6 +13,10 @@
|
|
14
13
|
:hasFocus="hasFocus"
|
15
14
|
:data-id="dataId"
|
16
15
|
/>
|
16
|
+
<img
|
17
|
+
class="search-icn"
|
18
|
+
:src="require('../../../assets/icons/search_icon_black.svg')"
|
19
|
+
/>
|
17
20
|
</input-wrapper>
|
18
21
|
</container>
|
19
22
|
</template>
|
@@ -29,11 +32,8 @@
|
|
29
32
|
// @on-change="function($event)"
|
30
33
|
// :isFilter="true" // to set the height at 30px
|
31
34
|
// data-id="test-data-id"
|
32
|
-
// iconPosition="left"
|
33
|
-
// iconColor="grey2"
|
34
35
|
// />
|
35
|
-
import styled from '
|
36
|
-
import SearchIconSvg from '../../../assets/icons/search_icon_black.svg'
|
36
|
+
import styled from 'vue-styled-components'
|
37
37
|
|
38
38
|
const inputAttrs = {
|
39
39
|
isDisabled: Boolean,
|
@@ -68,18 +68,11 @@ const InputContainer = styled('input', inputAttrs)`
|
|
68
68
|
const InputWrapper = styled.span`
|
69
69
|
position: relative;
|
70
70
|
|
71
|
-
|
71
|
+
img {
|
72
72
|
position: absolute;
|
73
|
-
|
73
|
+
right: 10px;
|
74
74
|
top: 50%;
|
75
|
-
|
76
|
-
|
77
|
-
path {
|
78
|
-
fill: ${(props) =>
|
79
|
-
props.theme.colors[props.iconColor]
|
80
|
-
? props.theme.colors[props.iconColor]
|
81
|
-
: props.iconColor};
|
82
|
-
}
|
75
|
+
transform: translateY(-50%);
|
83
76
|
}
|
84
77
|
`
|
85
78
|
|
@@ -88,8 +81,7 @@ export default {
|
|
88
81
|
components: {
|
89
82
|
InputContainer,
|
90
83
|
InputWrapper,
|
91
|
-
Container
|
92
|
-
SearchIconSvg
|
84
|
+
Container
|
93
85
|
},
|
94
86
|
props: {
|
95
87
|
value: {
|
@@ -118,20 +110,11 @@ export default {
|
|
118
110
|
dataId: {
|
119
111
|
required: false,
|
120
112
|
default: ''
|
121
|
-
},
|
122
|
-
iconPosition: {
|
123
|
-
type: String,
|
124
|
-
default: 'right'
|
125
|
-
},
|
126
|
-
iconColor: {
|
127
|
-
type: String,
|
128
|
-
default: 'black'
|
129
113
|
}
|
130
114
|
},
|
131
|
-
emits: ['on-change'],
|
132
115
|
methods: {
|
133
116
|
onChangeHandler(event) {
|
134
|
-
this.$emit('on-change', event
|
117
|
+
this.$emit('on-change', event)
|
135
118
|
},
|
136
119
|
focusInputElement() {
|
137
120
|
this.$nextTick(() => {
|