@eturnity/eturnity_reusable_components 7.30.3 → 7.32.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/.eslintrc.js +184 -0
- package/.prettierrc +8 -6
- package/package.json +9 -21
- package/src/App.vue +79 -78
- package/src/assets/theme.js +3 -3
- package/src/components/addNewButton/AddNewButton.stories.js +2 -2
- package/src/components/addNewButton/index.vue +48 -51
- package/src/components/banner/actionBanner/index.vue +54 -55
- package/src/components/banner/banner/banner.stories.js +5 -5
- package/src/components/banner/banner/index.vue +159 -159
- package/src/components/banner/infoBanner/index.vue +41 -53
- package/src/components/buttons/buttonIcon/index.vue +125 -122
- package/src/components/buttons/closeButton/CloseButton.stories.js +3 -3
- package/src/components/buttons/closeButton/index.vue +49 -49
- package/src/components/buttons/mainButton/index.vue +108 -108
- package/src/components/card/index.vue +70 -70
- package/src/components/collapsableInfoText/index.vue +96 -94
- package/src/components/deleteIcon/DeleteIcon.stories.js +4 -4
- package/src/components/deleteIcon/index.vue +54 -54
- package/src/components/draggableInputHandle/index.vue +37 -37
- package/src/components/dropdown/Dropdown.stories.js +9 -10
- package/src/components/dropdown/index.vue +106 -106
- package/src/components/errorMessage/index.vue +52 -52
- package/src/components/filter/filterSettings.vue +428 -422
- package/src/components/filter/index.vue +135 -135
- package/src/components/filter/parentDropdown.vue +73 -73
- package/src/components/icon/Icons.stories.js +7 -7
- package/src/components/icon/iconCollection.vue +53 -53
- package/src/components/icon/index.vue +122 -122
- package/src/components/iconWrapper/index.vue +156 -156
- package/src/components/infoCard/index.vue +30 -32
- package/src/components/infoText/index.vue +142 -137
- package/src/components/inputs/checkbox/Checkbox.stories.js +8 -8
- package/src/components/inputs/checkbox/index.vue +190 -180
- package/src/components/inputs/inputNumber/InputNumber.stories.js +41 -41
- package/src/components/inputs/inputNumber/index.vue +696 -696
- package/src/components/inputs/inputNumberQuestion/index.vue +185 -182
- package/src/components/inputs/inputText/InputText.stories.js +22 -22
- package/src/components/inputs/inputText/index.vue +337 -336
- package/src/components/inputs/radioButton/RadioButton.stories.js +16 -16
- package/src/components/inputs/radioButton/index.vue +222 -219
- package/src/components/inputs/searchInput/SearchInput.stories.js +8 -8
- package/src/components/inputs/searchInput/index.vue +127 -126
- package/src/components/inputs/select/index.vue +792 -791
- package/src/components/inputs/select/option/index.vue +124 -124
- package/src/components/inputs/select/select.stories.js +31 -32
- package/src/components/inputs/slider/index.vue +99 -99
- package/src/components/inputs/switchField/index.vue +220 -222
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +57 -57
- package/src/components/inputs/textAreaInput/index.vue +171 -173
- package/src/components/inputs/toggle/Toggle.stories.js +14 -14
- package/src/components/inputs/toggle/index.vue +214 -217
- package/src/components/label/index.vue +82 -82
- package/src/components/markerItem/index.vue +68 -66
- package/src/components/modals/actionModal/index.vue +54 -54
- package/src/components/modals/infoModal/index.vue +39 -36
- package/src/components/modals/modal/index.vue +134 -134
- package/src/components/modals/modal/modal.stories.js +5 -5
- package/src/components/navigationTabs/index.vue +96 -94
- package/src/components/pageSubtitle/index.vue +55 -49
- package/src/components/pageTitle/index.vue +56 -56
- package/src/components/pagination/index.vue +92 -89
- package/src/components/progressBar/index.vue +107 -107
- package/src/components/projectMarker/index.vue +246 -244
- package/src/components/rangeSlider/Slider.vue +491 -465
- package/src/components/rangeSlider/index.vue +410 -410
- package/src/components/rangeSlider/utils/dom.js +5 -5
- package/src/components/selectedOptions/index.vue +119 -119
- package/src/components/sideMenu/index.vue +199 -199
- package/src/components/spinner/index.vue +57 -57
- package/src/components/tableDropdown/index.vue +520 -520
- package/src/components/tables/mainTable/index.vue +417 -400
- package/src/components/tables/viewTable/index.vue +171 -171
- package/src/components/threeDots/index.vue +340 -334
- package/src/components/videoThumbnail/index.vue +86 -86
- package/src/components/videoThumbnail/videoThumbnail.stories.js +14 -16
- package/src/helpers/numberConverter.js +2 -2
- package/src/helpers/translateLang.js +9 -9
- package/src/mixins/inputValidations.js +5 -5
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
@@ -1,200 +1,198 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
:
|
5
|
-
:
|
2
|
+
<Container :input-width="inputWidth">
|
3
|
+
<InputWrapper
|
4
|
+
:align-items="alignItems"
|
5
|
+
:has-label="label && label.length > 0"
|
6
6
|
>
|
7
|
-
<
|
8
|
-
<
|
9
|
-
label
|
10
|
-
|
11
|
-
<
|
12
|
-
|
13
|
-
|
14
|
-
size="16px"
|
15
|
-
/>
|
16
|
-
</label-wrapper>
|
17
|
-
<input-container
|
18
|
-
:inputWidth="inputWidth"
|
19
|
-
:isError="isError"
|
20
|
-
:fontSize="fontSize"
|
7
|
+
<LabelWrapper v-if="label">
|
8
|
+
<InputLabel :data-id="labelDataId" :font-size="fontSize">
|
9
|
+
{{ label }}
|
10
|
+
</InputLabel>
|
11
|
+
<InfoText v-if="infoTextMessage" size="16px" :text="infoTextMessage" />
|
12
|
+
</LabelWrapper>
|
13
|
+
<InputContainer
|
21
14
|
:disabled="isDisabled"
|
15
|
+
:font-size="fontSize"
|
16
|
+
:input-width="inputWidth"
|
17
|
+
:is-error="isError"
|
22
18
|
>
|
23
19
|
<textarea
|
20
|
+
:data-id="inputDataId"
|
21
|
+
:disabled="isDisabled"
|
24
22
|
:placeholder="placeholder"
|
23
|
+
:resize="resize"
|
25
24
|
:rows="rowHeight"
|
26
25
|
:value="value"
|
27
|
-
:disabled="isDisabled"
|
28
26
|
@input="onChangeHandler"
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
</
|
27
|
+
></textarea>
|
28
|
+
</InputContainer>
|
29
|
+
</InputWrapper>
|
30
|
+
<ErrorMessage v-if="isError && errorText">
|
31
|
+
{{ errorText }}
|
32
|
+
</ErrorMessage>
|
33
|
+
</Container>
|
36
34
|
</template>
|
37
35
|
|
38
36
|
<script>
|
39
|
-
// import TextAreaInput from "@eturnity/eturnity_reusable_components/src/components/inputs/textAreaInput"
|
40
|
-
// To use:
|
41
|
-
// <text-area-input
|
42
|
-
// placeholder="Comments"
|
43
|
-
// @input-change="onInputChange({ value: $event, type: 'note' })"
|
44
|
-
// :value="form.note"
|
45
|
-
// rowHeight="4" //optional
|
46
|
-
// :isError="false"
|
47
|
-
// :errorText="$gettext('field_required')"
|
48
|
-
// infoTextMessage="My info message"
|
49
|
-
// label="Question 5"
|
50
|
-
// alignItems="horizontal" // horizontal, vertical
|
51
|
-
// :isDisabled="true"
|
52
|
-
// fontSize="13px"
|
53
|
-
// />
|
54
|
-
import styled from 'vue3-styled-components'
|
55
|
-
import InfoText from '../../infoText'
|
56
|
-
import ErrorMessage from '../../errorMessage'
|
37
|
+
// import TextAreaInput from "@eturnity/eturnity_reusable_components/src/components/inputs/textAreaInput"
|
38
|
+
// To use:
|
39
|
+
// <text-area-input
|
40
|
+
// placeholder="Comments"
|
41
|
+
// @input-change="onInputChange({ value: $event, type: 'note' })"
|
42
|
+
// :value="form.note"
|
43
|
+
// rowHeight="4" //optional
|
44
|
+
// :isError="false"
|
45
|
+
// :errorText="$gettext('field_required')"
|
46
|
+
// infoTextMessage="My info message"
|
47
|
+
// label="Question 5"
|
48
|
+
// alignItems="horizontal" // horizontal, vertical
|
49
|
+
// :isDisabled="true"
|
50
|
+
// fontSize="13px"
|
51
|
+
// />
|
52
|
+
import styled from 'vue3-styled-components'
|
53
|
+
import InfoText from '../../infoText'
|
54
|
+
import ErrorMessage from '../../errorMessage'
|
57
55
|
|
58
|
-
const containerProps = { inputWidth: String }
|
59
|
-
const Container = styled('div', containerProps)`
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
`
|
56
|
+
const containerProps = { inputWidth: String }
|
57
|
+
const Container = styled('div', containerProps)`
|
58
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
59
|
+
position: relative;
|
60
|
+
margin-bottom: 20px;
|
61
|
+
`
|
64
62
|
|
65
|
-
const LabelWrapper = styled.div`
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
`
|
63
|
+
const LabelWrapper = styled.div`
|
64
|
+
display: inline-grid;
|
65
|
+
grid-template-columns: auto 1fr;
|
66
|
+
grid-gap: 12px;
|
67
|
+
align-items: center;
|
68
|
+
`
|
71
69
|
|
72
|
-
const inputProps = {
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
}
|
70
|
+
const inputProps = {
|
71
|
+
isError: Boolean,
|
72
|
+
disabled: Boolean,
|
73
|
+
fontSize: String,
|
74
|
+
inputWidth: String,
|
75
|
+
}
|
78
76
|
|
79
|
-
const InputContainer = styled('div', inputProps)`
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
77
|
+
const InputContainer = styled('div', inputProps)`
|
78
|
+
textarea {
|
79
|
+
border: ${(props) =>
|
80
|
+
props.isError
|
81
|
+
? `1px solid ${props.theme.colors.red} !important`
|
82
|
+
: `1px solid ${props.theme.colors.grey4} !important`};
|
83
|
+
padding: ${(props) =>
|
84
|
+
props.hasUnit ? '11px 40px 11px 10px !important' : '15px !important'};
|
85
|
+
border-radius: 4px !important;
|
86
|
+
font-size: ${(props) => `${props.fontSize} !important`};
|
87
|
+
color: ${(props) => `${props.theme.colors.grey1} !important`};
|
88
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
89
|
+
max-width: 100%;
|
90
|
+
box-sizing: border-box; // to allow width of 100% with padding
|
91
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'inherit')};
|
94
92
|
|
95
|
-
|
96
|
-
|
97
|
-
|
93
|
+
&::placeholder {
|
94
|
+
color: ${(props) => `${props.theme.colors.grey2} !important`};
|
95
|
+
}
|
98
96
|
|
99
|
-
|
100
|
-
|
97
|
+
&:focus {
|
98
|
+
outline: none;
|
99
|
+
}
|
101
100
|
}
|
102
|
-
|
103
|
-
`
|
101
|
+
`
|
104
102
|
|
105
|
-
const inputAttrs = { alignItems: String, hasLabel: Boolean }
|
106
|
-
const InputWrapper = styled('div', inputAttrs)`
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
`
|
103
|
+
const inputAttrs = { alignItems: String, hasLabel: Boolean }
|
104
|
+
const InputWrapper = styled('div', inputAttrs)`
|
105
|
+
position: relative;
|
106
|
+
display: grid;
|
107
|
+
align-items: center;
|
108
|
+
gap: 8px;
|
109
|
+
grid-template-columns: ${(props) =>
|
110
|
+
!props.hasLabel
|
111
|
+
? '1fr'
|
112
|
+
: props.alignItems === 'vertical'
|
113
|
+
? '1fr'
|
114
|
+
: 'auto 1fr'};
|
115
|
+
`
|
118
116
|
|
119
|
-
const labelAttrs = { fontSize: String }
|
120
|
-
const InputLabel = styled('div', labelAttrs)`
|
121
|
-
|
122
|
-
|
123
|
-
`
|
117
|
+
const labelAttrs = { fontSize: String }
|
118
|
+
const InputLabel = styled('div', labelAttrs)`
|
119
|
+
font-weight: bold;
|
120
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
121
|
+
`
|
124
122
|
|
125
|
-
export default {
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
},
|
136
|
-
props: {
|
137
|
-
placeholder: {
|
138
|
-
required: false,
|
139
|
-
default: ''
|
123
|
+
export default {
|
124
|
+
name: 'TextAreaInput',
|
125
|
+
components: {
|
126
|
+
Container,
|
127
|
+
InputContainer,
|
128
|
+
InputWrapper,
|
129
|
+
ErrorMessage,
|
130
|
+
InfoText,
|
131
|
+
LabelWrapper,
|
132
|
+
InputLabel,
|
140
133
|
},
|
141
|
-
|
142
|
-
|
143
|
-
|
134
|
+
props: {
|
135
|
+
placeholder: {
|
136
|
+
required: false,
|
137
|
+
default: '',
|
138
|
+
},
|
139
|
+
isError: {
|
140
|
+
required: false,
|
141
|
+
default: false,
|
142
|
+
},
|
143
|
+
rowHeight: {
|
144
|
+
required: false,
|
145
|
+
default: '2',
|
146
|
+
},
|
147
|
+
value: {
|
148
|
+
required: true,
|
149
|
+
default: null,
|
150
|
+
},
|
151
|
+
errorText: {
|
152
|
+
required: false,
|
153
|
+
},
|
154
|
+
isDisabled: {
|
155
|
+
required: false,
|
156
|
+
default: false,
|
157
|
+
},
|
158
|
+
alignItems: {
|
159
|
+
required: false,
|
160
|
+
default: 'horizontal',
|
161
|
+
},
|
162
|
+
infoTextMessage: {
|
163
|
+
required: false,
|
164
|
+
},
|
165
|
+
label: {
|
166
|
+
required: false,
|
167
|
+
},
|
168
|
+
fontSize: {
|
169
|
+
required: false,
|
170
|
+
default: '13px',
|
171
|
+
},
|
172
|
+
inputWidth: {
|
173
|
+
required: false,
|
174
|
+
default: null,
|
175
|
+
},
|
176
|
+
resize: {
|
177
|
+
required: false,
|
178
|
+
default: 'none',
|
179
|
+
},
|
180
|
+
labelDataId: {
|
181
|
+
required: false,
|
182
|
+
default: '',
|
183
|
+
},
|
184
|
+
inputDataId: {
|
185
|
+
required: false,
|
186
|
+
default: '',
|
187
|
+
},
|
144
188
|
},
|
145
|
-
|
146
|
-
|
147
|
-
|
189
|
+
methods: {
|
190
|
+
onChangeHandler($event) {
|
191
|
+
if (this.isDisabled) {
|
192
|
+
return
|
193
|
+
}
|
194
|
+
this.$emit('input-change', $event.target.value)
|
195
|
+
},
|
148
196
|
},
|
149
|
-
value: {
|
150
|
-
required: true,
|
151
|
-
default: null
|
152
|
-
},
|
153
|
-
errorText: {
|
154
|
-
required: false
|
155
|
-
},
|
156
|
-
isDisabled: {
|
157
|
-
required: false,
|
158
|
-
default: false
|
159
|
-
},
|
160
|
-
alignItems: {
|
161
|
-
required: false,
|
162
|
-
default: 'horizontal'
|
163
|
-
},
|
164
|
-
infoTextMessage: {
|
165
|
-
required: false
|
166
|
-
},
|
167
|
-
label: {
|
168
|
-
required: false
|
169
|
-
},
|
170
|
-
fontSize: {
|
171
|
-
required: false,
|
172
|
-
default: '13px'
|
173
|
-
},
|
174
|
-
inputWidth: {
|
175
|
-
required: false,
|
176
|
-
default: null
|
177
|
-
},
|
178
|
-
resize: {
|
179
|
-
required: false,
|
180
|
-
default: 'none'
|
181
|
-
},
|
182
|
-
labelDataId: {
|
183
|
-
required: false,
|
184
|
-
default: ''
|
185
|
-
},
|
186
|
-
inputDataId: {
|
187
|
-
required: false,
|
188
|
-
default: ''
|
189
|
-
}
|
190
|
-
},
|
191
|
-
methods: {
|
192
|
-
onChangeHandler($event) {
|
193
|
-
if (this.isDisabled) {
|
194
|
-
return
|
195
|
-
}
|
196
|
-
this.$emit('input-change', $event.target.value)
|
197
|
-
}
|
198
197
|
}
|
199
|
-
}
|
200
198
|
</script>
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import Toggle from
|
1
|
+
import Toggle from './index.vue'
|
2
2
|
|
3
3
|
export default {
|
4
|
-
title:
|
4
|
+
title: 'Toggle',
|
5
5
|
component: Toggle,
|
6
6
|
// argTypes: {},
|
7
7
|
}
|
@@ -31,47 +31,47 @@ const Template = (args, { argTypes }) => ({
|
|
31
31
|
export const Default = Template.bind({})
|
32
32
|
Default.args = {
|
33
33
|
isChecked: true,
|
34
|
-
size:
|
34
|
+
size: 'small', // "small" or "medium"
|
35
35
|
disabled: false,
|
36
36
|
}
|
37
37
|
|
38
38
|
export const Medium = Template.bind({})
|
39
39
|
Medium.args = {
|
40
40
|
isChecked: true,
|
41
|
-
size:
|
41
|
+
size: 'medium', // "small" or "medium"
|
42
42
|
disabled: false,
|
43
43
|
}
|
44
44
|
|
45
45
|
export const CustomColor = Template.bind({})
|
46
46
|
CustomColor.args = {
|
47
47
|
isChecked: true,
|
48
|
-
size:
|
48
|
+
size: 'small', // "small" or "medium"
|
49
49
|
disabled: false,
|
50
|
-
toggleColor:
|
51
|
-
backgroundColor:
|
50
|
+
toggleColor: 'red',
|
51
|
+
backgroundColor: 'blue',
|
52
52
|
}
|
53
53
|
|
54
54
|
export const LabelLeft = Template.bind({})
|
55
55
|
LabelLeft.args = {
|
56
56
|
isChecked: true,
|
57
|
-
size:
|
58
|
-
label:
|
57
|
+
size: 'small', // "small" or "medium"
|
58
|
+
label: 'My Label Text',
|
59
59
|
disabled: false,
|
60
|
-
labelAlign:
|
60
|
+
labelAlign: 'left',
|
61
61
|
}
|
62
62
|
|
63
63
|
export const LabelRight = Template.bind({})
|
64
64
|
LabelRight.args = {
|
65
65
|
isChecked: true,
|
66
|
-
size:
|
67
|
-
label:
|
66
|
+
size: 'small', // "small" or "medium"
|
67
|
+
label: 'My Label Text',
|
68
68
|
disabled: false,
|
69
|
-
labelAlign:
|
69
|
+
labelAlign: 'right',
|
70
70
|
}
|
71
71
|
|
72
72
|
export const Disabled = Template.bind({})
|
73
73
|
Disabled.args = {
|
74
74
|
isChecked: false,
|
75
|
-
size:
|
75
|
+
size: 'small', // "small" or "medium"
|
76
76
|
disabled: true,
|
77
77
|
}
|