@eturnity/eturnity_reusable_components 7.8.6-EPDM-7951.0 → 7.10.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 -18
- package/src/App.vue +2 -2
- package/src/assets/svgIcons/expand.svg +1 -0
- package/src/assets/svgIcons/split.svg +94 -0
- package/src/assets/theme.js +2 -0
- 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/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 +1 -1
- package/src/components/filter/filterSettings.vue +97 -55
- 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 +55 -57
- package/src/components/iconWrapper/index.vue +5 -2
- package/src/components/infoCard/index.vue +3 -2
- package/src/components/infoText/index.vue +6 -2
- package/src/components/inputs/checkbox/index.vue +6 -21
- package/src/components/inputs/inputNumber/index.vue +12 -8
- package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
- package/src/components/inputs/inputText/index.vue +8 -3
- package/src/components/inputs/radioButton/index.vue +1 -1
- package/src/components/inputs/searchInput/index.vue +8 -7
- package/src/components/inputs/select/index.vue +72 -213
- package/src/components/inputs/select/option/index.vue +5 -5
- 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 +32 -27
- package/src/components/modals/modal/index.vue +8 -13
- package/src/components/navigationTabs/index.vue +30 -37
- package/src/components/pageSubtitle/index.vue +1 -1
- package/src/components/pageTitle/index.vue +19 -20
- package/src/components/pagination/index.vue +1 -1
- package/src/components/progressBar/index.vue +1 -1
- package/src/components/projectMarker/index.vue +7 -10
- package/src/components/sideMenu/index.vue +1 -1
- package/src/components/spinner/index.vue +11 -6
- package/src/components/tableDropdown/index.vue +26 -21
- package/src/components/tables/mainTable/exampleNested.vue +1 -1
- package/src/components/tables/mainTable/index.vue +1 -2
- 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
@@ -1,18 +1,19 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<icon-image
|
4
|
-
<i v-html="icon.html" />
|
5
|
-
</icon-image>
|
6
|
-
<striked-line
|
7
|
-
v-if="isStriked"
|
8
|
-
:color="color"
|
2
|
+
<Wrapper :isDisabled="disabled" :size="size" :cursor="cursor">
|
3
|
+
<icon-image
|
9
4
|
:disabled="disabled"
|
5
|
+
:size="size"
|
6
|
+
:color="color"
|
10
7
|
:hoveredColor="hoveredColor"
|
11
|
-
|
12
|
-
|
8
|
+
v-html="
|
9
|
+
require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
|
10
|
+
"
|
11
|
+
></icon-image>
|
12
|
+
<striked-line v-if="isStriked" :color="color" :disabled="disabled" :hoveredColor="hoveredColor"></striked-line>
|
13
|
+
</Wrapper>
|
13
14
|
</template>
|
14
15
|
|
15
|
-
<script
|
16
|
+
<script>
|
16
17
|
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
17
18
|
// How to use:
|
18
19
|
//<icon
|
@@ -24,8 +25,8 @@
|
|
24
25
|
// isStriked = "true"
|
25
26
|
// />
|
26
27
|
|
27
|
-
import
|
28
|
-
|
28
|
+
import styled from 'vue-styled-components'
|
29
|
+
|
29
30
|
const wrapperAttrs = { isDisabled: Boolean, size: String, cursor: String }
|
30
31
|
const Wrapper = styled('div', wrapperAttrs)`
|
31
32
|
display: flex;
|
@@ -39,22 +40,17 @@ const Wrapper = styled('div', wrapperAttrs)`
|
|
39
40
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursor)};
|
40
41
|
line-height: 0;
|
41
42
|
`
|
42
|
-
const strikedAttrs = {
|
43
|
-
|
44
|
-
color: String,
|
45
|
-
hoveredColor: String
|
46
|
-
}
|
47
|
-
const StrikedLine = styled('div', strikedAttrs)`
|
43
|
+
const strikedAttrs = { isDisabled: Boolean, color: String, hoveredColor: String }
|
44
|
+
const strikedLine = styled('div', strikedAttrs)`
|
48
45
|
display: flex;
|
49
46
|
position: absolute;
|
50
|
-
bottom:
|
51
|
-
left:
|
47
|
+
bottom:0;
|
48
|
+
left:0;
|
52
49
|
align-content: center;
|
53
50
|
justify-content: center;
|
54
51
|
width: 143%;
|
55
|
-
height:
|
56
|
-
background-color: ${(props)
|
57
|
-
props.theme.colors[props.color] || props.color};
|
52
|
+
height:8%;
|
53
|
+
background-color: ${(props)=>props.theme.colors[props.color] || props.color};
|
58
54
|
min-height: 0;
|
59
55
|
line-height: 0;
|
60
56
|
transform-origin: 0% 100%;
|
@@ -75,44 +71,46 @@ const IconImage = styled('div', IconImageProps)`
|
|
75
71
|
${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
|
76
72
|
}
|
77
73
|
&:hover + div {
|
78
|
-
background-color: ${(props)
|
74
|
+
background-color: ${(props)=>props.hoveredColor};
|
79
75
|
}
|
80
76
|
`
|
81
77
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
required: true
|
89
|
-
},
|
90
|
-
color: {
|
91
|
-
required: false
|
78
|
+
export default {
|
79
|
+
name: 'icon',
|
80
|
+
components: {
|
81
|
+
IconImage,
|
82
|
+
Wrapper,
|
83
|
+
strikedLine
|
92
84
|
},
|
93
|
-
|
94
|
-
|
85
|
+
props: {
|
86
|
+
disabled: {
|
87
|
+
required: false,
|
88
|
+
default: false
|
89
|
+
},
|
90
|
+
name: {
|
91
|
+
required: true
|
92
|
+
},
|
93
|
+
color: {
|
94
|
+
required: false
|
95
|
+
},
|
96
|
+
hoveredColor: {
|
97
|
+
required: false
|
98
|
+
},
|
99
|
+
size: {
|
100
|
+
required: false,
|
101
|
+
default: '30px'
|
102
|
+
},
|
103
|
+
cursor: {
|
104
|
+
required: false,
|
105
|
+
default: null
|
106
|
+
},
|
107
|
+
isStriked: {
|
108
|
+
required: false,
|
109
|
+
default: false
|
110
|
+
}
|
95
111
|
},
|
96
|
-
|
97
|
-
|
98
|
-
default: '30px'
|
99
|
-
},
|
100
|
-
cursor: {
|
101
|
-
required: false,
|
102
|
-
default: null
|
103
|
-
},
|
104
|
-
isStriked: {
|
105
|
-
required: false,
|
106
|
-
default: false
|
112
|
+
data() {
|
113
|
+
return {}
|
107
114
|
}
|
108
|
-
}
|
109
|
-
|
110
|
-
const icon = reactive({ html: '' })
|
111
|
-
|
112
|
-
onMounted(async () => {
|
113
|
-
const iconPath = `../../assets/svgIcons/${props.name.toLowerCase()}.svg?raw`
|
114
|
-
const module = await import(/* @vite-ignore */ iconPath)
|
115
|
-
|
116
|
-
icon.html = module.default
|
117
|
-
})
|
115
|
+
}
|
118
116
|
</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,
|
@@ -118,7 +118,7 @@ export default {
|
|
118
118
|
},
|
119
119
|
hoveredBackgroundColor: {
|
120
120
|
required: false,
|
121
|
-
default: '
|
121
|
+
default: 'transparentWhite2'
|
122
122
|
},
|
123
123
|
size: {
|
124
124
|
required: false,
|
@@ -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>
|
@@ -32,7 +32,7 @@
|
|
32
32
|
// alignArrow="right" // which side the arrow should be on
|
33
33
|
// />
|
34
34
|
import theme from '../../assets/theme.js'
|
35
|
-
import styled from '
|
35
|
+
import styled from 'vue-styled-components'
|
36
36
|
import icon from '../icon'
|
37
37
|
|
38
38
|
const textAttrs = {
|
@@ -157,7 +157,11 @@ export default {
|
|
157
157
|
},
|
158
158
|
computed: {
|
159
159
|
iconColor() {
|
160
|
-
return
|
160
|
+
return this.isActive
|
161
|
+
? this.borderColor
|
162
|
+
? this.borderColor
|
163
|
+
: theme.colors.secondary
|
164
|
+
: theme.colors.mediumGray
|
161
165
|
},
|
162
166
|
halfComputedTextInfoWidth() {
|
163
167
|
return parseInt(this.width) / 2
|
@@ -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) {
|
@@ -38,7 +38,7 @@
|
|
38
38
|
:value="formatWithCurrency(value)"
|
39
39
|
@blur="onInputBlur($event)"
|
40
40
|
@focus="focusInput()"
|
41
|
-
@keyup.enter="
|
41
|
+
@keyup.enter="onEnterPress"
|
42
42
|
@input="onInput($event)"
|
43
43
|
:disabled="disabled"
|
44
44
|
:isDisabled="disabled"
|
@@ -49,6 +49,7 @@
|
|
49
49
|
:fontSize="fontSize"
|
50
50
|
:fontColor="fontColor"
|
51
51
|
:backgroundColor="backgroundColor"
|
52
|
+
v-on="$listeners"
|
52
53
|
:hasSlot="hasSlot"
|
53
54
|
:hasLabelSlot="hasLabelSlot"
|
54
55
|
:slotSize="slotSize"
|
@@ -100,7 +101,7 @@
|
|
100
101
|
// :minNumber="0"
|
101
102
|
// fontColor="blue"
|
102
103
|
// />
|
103
|
-
import styled from '
|
104
|
+
import styled from 'vue-styled-components'
|
104
105
|
import {
|
105
106
|
stringToNumber,
|
106
107
|
numberToString
|
@@ -468,6 +469,10 @@ export default {
|
|
468
469
|
}
|
469
470
|
},
|
470
471
|
methods: {
|
472
|
+
onEnterPress(event){
|
473
|
+
this.$emit('on-enter-click')
|
474
|
+
this.$refs.inputField1.$el.blur()
|
475
|
+
},
|
471
476
|
onChangeHandler(event) {
|
472
477
|
if (isNaN(event) || event === '') {
|
473
478
|
event = this.defaultNumber
|
@@ -483,10 +488,9 @@ export default {
|
|
483
488
|
// Need to return an integer rather than a string
|
484
489
|
this.$emit('input-change', event)
|
485
490
|
},
|
486
|
-
onEvaluateCode(
|
491
|
+
onEvaluateCode(val) {
|
487
492
|
// function to perform math on the code
|
488
493
|
// filter the string in case of any malicious content
|
489
|
-
const val = event.target.value
|
490
494
|
let filtered = val.replace('(auto)', '').replace(/[^-()\d/*+.,]/g, '')
|
491
495
|
filtered = filtered.split(/([-+*/()])/)
|
492
496
|
let formatted = filtered.map((item) => {
|
@@ -544,17 +548,17 @@ export default {
|
|
544
548
|
}
|
545
549
|
return array
|
546
550
|
},
|
547
|
-
onInput(
|
551
|
+
onInput(value) {
|
548
552
|
if (this.isBlurred) {
|
549
553
|
this.isBlurred = false
|
550
554
|
return
|
551
555
|
}
|
552
|
-
if (
|
556
|
+
if (value === '') {
|
553
557
|
this.$emit('on-input', '')
|
554
558
|
}
|
555
559
|
let evaluatedVal
|
556
560
|
try {
|
557
|
-
evaluatedVal = this.onEvaluateCode(
|
561
|
+
evaluatedVal = this.onEvaluateCode(value)
|
558
562
|
} finally {
|
559
563
|
if (evaluatedVal) {
|
560
564
|
this.$emit('on-input', evaluatedVal)
|
@@ -566,7 +570,7 @@ export default {
|
|
566
570
|
// setting isBlurred so we don't trigger onInput as well
|
567
571
|
this.isBlurred = true
|
568
572
|
let value = e.target.value
|
569
|
-
let evaluatedInput = this.onEvaluateCode(
|
573
|
+
let evaluatedInput = this.onEvaluateCode(value)
|
570
574
|
this.onChangeHandler(evaluatedInput ? evaluatedInput : value)
|
571
575
|
if ((evaluatedInput && value.length) || this.minNumber !== null) {
|
572
576
|
this.textInput = numberToString({
|
@@ -34,6 +34,7 @@
|
|
34
34
|
:value="value"
|
35
35
|
@input="onChangeHandler"
|
36
36
|
@blur="onInputBlur"
|
37
|
+
@keyup.enter="onEnterPress"
|
37
38
|
:noBorder="noBorder"
|
38
39
|
:disabled="disabled"
|
39
40
|
:isDisabled="disabled"
|
@@ -66,7 +67,7 @@
|
|
66
67
|
</template>
|
67
68
|
|
68
69
|
<script>
|
69
|
-
import styled from '
|
70
|
+
import styled from 'vue-styled-components'
|
70
71
|
import InfoText from '../../infoText'
|
71
72
|
import Icon from '../../icon'
|
72
73
|
import ErrorMessage from '../../errorMessage'
|
@@ -328,8 +329,12 @@ export default {
|
|
328
329
|
}
|
329
330
|
},
|
330
331
|
methods: {
|
331
|
-
|
332
|
-
this.$emit('
|
332
|
+
onEnterPress(event){
|
333
|
+
this.$emit('on-enter-click')
|
334
|
+
this.$refs.inputElement.$el.blur()
|
335
|
+
},
|
336
|
+
onChangeHandler($event) {
|
337
|
+
this.$emit('input-change', $event)
|
333
338
|
},
|
334
339
|
onInputBlur($event) {
|
335
340
|
this.$emit('input-blur', $event.target.value)
|
@@ -13,7 +13,10 @@
|
|
13
13
|
:hasFocus="hasFocus"
|
14
14
|
:data-id="dataId"
|
15
15
|
/>
|
16
|
-
<
|
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>
|
@@ -30,8 +33,7 @@
|
|
30
33
|
// :isFilter="true" // to set the height at 30px
|
31
34
|
// data-id="test-data-id"
|
32
35
|
// />
|
33
|
-
import styled from '
|
34
|
-
import SearchIconSvg from '../../../assets/icons/search_icon_black.svg'
|
36
|
+
import styled from 'vue-styled-components'
|
35
37
|
|
36
38
|
const inputAttrs = {
|
37
39
|
isDisabled: Boolean,
|
@@ -66,7 +68,7 @@ const InputContainer = styled('input', inputAttrs)`
|
|
66
68
|
const InputWrapper = styled.span`
|
67
69
|
position: relative;
|
68
70
|
|
69
|
-
|
71
|
+
img {
|
70
72
|
position: absolute;
|
71
73
|
right: 10px;
|
72
74
|
top: 50%;
|
@@ -79,8 +81,7 @@ export default {
|
|
79
81
|
components: {
|
80
82
|
InputContainer,
|
81
83
|
InputWrapper,
|
82
|
-
Container
|
83
|
-
SearchIconSvg
|
84
|
+
Container
|
84
85
|
},
|
85
86
|
props: {
|
86
87
|
value: {
|
@@ -113,7 +114,7 @@ export default {
|
|
113
114
|
},
|
114
115
|
methods: {
|
115
116
|
onChangeHandler(event) {
|
116
|
-
this.$emit('on-change', event
|
117
|
+
this.$emit('on-change', event)
|
117
118
|
},
|
118
119
|
focusInputElement() {
|
119
120
|
this.$nextTick(() => {
|