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