@eturnity/eturnity_reusable_components 9.22.2 → 9.25.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/dist/index.es3.js +268 -156
- package/package.json +3 -3
- package/src/assets/theme.js +202 -90
- package/src/components/accordion/Accordion.stories.js +1 -1
- package/src/components/addNewButton/AddNewButton.stories.js +40 -8
- package/src/components/banner/actionBanner/ActionBanner.stories.js +1 -1
- package/src/components/banner/actionBanner/index.vue +4 -2
- package/src/components/banner/banner/Banner.stories.js +1 -1
- package/src/components/banner/infoBanner/InfoBanner.stories.js +1 -1
- package/src/components/banner/infoBanner/index.vue +4 -2
- package/src/components/banner/notificationBanner/notificationBanner.stories.js +81 -0
- package/src/components/buttons/buttonIcon/index.vue +216 -80
- package/src/components/buttons/closeButton/CloseButton.stories.js +1 -1
- package/src/components/buttons/collection/index.vue +1 -3
- package/src/components/buttons/mainButton/index.vue +98 -44
- package/src/components/buttons/splitButtons/splitButtons.stories.js +70 -0
- package/src/components/card/Card.stories.js +16 -4
- package/src/components/card/index.vue +1 -1
- package/src/components/collapsableInfoText/collapsableInfoText.stories.js +52 -0
- package/src/components/deleteIcon/DeleteIcon.stories.js +1 -1
- package/src/components/draggableCard/draggableCard.stories.js +1 -1
- package/src/components/draggableInputHandle/draggableInputHandle.stories.js +43 -0
- package/src/components/dropdown/Dropdown.stories.js +1 -1
- package/src/components/errorMessage/errorMessage.stories.js +31 -17
- package/src/components/filter/filterSettings.vue +1 -1
- package/src/components/icon/Icon.stories.js +1 -1
- package/src/components/iconWrapper/iconWrapper.stories.js +78 -0
- package/src/components/infoCard/InfoCard.stories.js +1 -1
- package/src/components/infoLabel/infoLabel.stories.js +61 -0
- package/src/components/infoText/infoText.stories.js +1 -1
- package/src/components/inputs/checkbox/Checkbox.stories.js +1 -1
- package/src/components/inputs/checkbox/index.vue +10 -1
- package/src/components/inputs/inputNumber/InputNumber.stories.js +1 -1
- package/src/components/inputs/inputNumber/index.vue +15 -5
- package/src/components/inputs/inputNumberQuestion/inputNumberQuestion.stories.js +77 -0
- package/src/components/inputs/inputText/InputText.stories.js +1 -1
- package/src/components/inputs/inputText/index.vue +29 -20
- package/src/components/inputs/isRequiredLabelStar/isRequiredLabelStar.stories.js +26 -0
- package/src/components/inputs/radioButton/RadioButton.stories.js +1 -1
- package/src/components/inputs/radioButton/index.vue +21 -7
- package/src/components/inputs/searchInput/SearchInput.stories.js +1 -1
- package/src/components/inputs/select/index.vue +33 -21
- package/src/components/inputs/select/option/index.vue +1 -1
- package/src/components/inputs/select/select.stories.js +4 -25
- package/src/components/inputs/shared/inputLabelTypography.js +7 -0
- package/src/components/inputs/slider/index.vue +9 -12
- package/src/components/inputs/slider/slider.stories.js +71 -0
- package/src/components/inputs/switchField/index.vue +37 -10
- package/src/components/inputs/switchField/switchField.stories.js +71 -0
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +1 -1
- package/src/components/inputs/textAreaInput/index.vue +19 -6
- package/src/components/inputs/toggle/Toggle.stories.js +1 -1
- package/src/components/inputs/toggle/index.vue +10 -6
- package/src/components/label/index.vue +39 -11
- package/src/components/label/label.stories.js +69 -0
- package/src/components/markerItem/markerItem.stories.js +46 -0
- package/src/components/modals/actionModal/actionModal.stories.js +1 -1
- package/src/components/modals/actionModal/index.vue +1 -1
- package/src/components/modals/infoModal/index.vue +1 -10
- package/src/components/modals/infoModal/infoModal.stories.js +1 -1
- package/src/components/modals/modal/modal.spec.js +168 -0
- package/src/components/modals/modal/modal.stories.js +287 -26
- package/src/components/modals/modalBody/index.vue +30 -0
- package/src/components/modals/modalButtonContainer/index.vue +42 -0
- package/src/components/modals/modalButtonContainer/modalButtonContainer.stories.js +59 -0
- package/src/components/modals/modalContent/index.vue +125 -0
- package/src/components/modals/modalTitle/index.vue +34 -0
- package/src/components/navigationTabs/navigationTabs.stories.js +58 -0
- package/src/components/pageSubtitle/PageSubtitle.stories.js +1 -1
- package/src/components/pageTitle/PageTitle.stories.js +1 -1
- package/src/components/pagination/pagination.stories.js +79 -0
- package/src/components/paginationV2/paginationV2.spec.js +132 -0
- package/src/components/paginationV2/paginationV2.stories.js +68 -0
- package/src/components/panelRangeInfo/panelRangeInfo.stories.js +60 -0
- package/src/components/progressBar/ProgressBar.stories.js +1 -1
- package/src/components/progressStep/progressStep.stories.js +1 -1
- package/src/components/projectMarker/ProjectMarker.stories.js +1 -1
- package/src/components/rangeSlider/RangeSlider.stories.js +1 -1
- package/src/components/roundTabs/roundTabs.stories.js +54 -0
- package/src/components/selectedOptions/selectedOptions.stories.js +1 -1
- package/src/components/sideMenu/sideMenu.stories.js +53 -0
- package/src/components/spinner/Spinner.stories.js +1 -1
- package/src/components/spinnerGif/SpinnerGif.stories.js +1 -1
- package/src/components/statusIndicator/statusIndicator.stories.js +101 -0
- package/src/components/tableDropdown/TableDropdown.stories.js +1 -1
- package/src/components/tables/viewTable/viewTable.stories.js +85 -0
- package/src/components/tabsHeader/TabsHeader.stories.js +1 -1
- package/src/components/tag/conversionTag/conversionTag.stories.js +47 -0
- package/src/components/tag/freeTrialTag/freeTrialTag.stories.js +42 -0
- package/src/components/threeDots/index.vue +20 -3
- package/src/components/threeDots/threeDots.stories.js +59 -0
- package/src/components/videoThumbnail/videoThumbnail.stories.js +1 -1
|
@@ -45,6 +45,12 @@
|
|
|
45
45
|
// />
|
|
46
46
|
import styled from 'vue3-styled-components'
|
|
47
47
|
import IsRequiredLabelStar from '../isRequiredLabelStar'
|
|
48
|
+
import {
|
|
49
|
+
inputLabelFontSize,
|
|
50
|
+
inputLabelFontWeight,
|
|
51
|
+
inputLabelLetterSpacing,
|
|
52
|
+
inputLabelLineHeight,
|
|
53
|
+
} from '../shared/inputLabelTypography'
|
|
48
54
|
const ComponentWrapper = styled.div`
|
|
49
55
|
min-height: 16px;
|
|
50
56
|
`
|
|
@@ -178,7 +184,10 @@
|
|
|
178
184
|
isDisabled: Boolean,
|
|
179
185
|
}
|
|
180
186
|
const LabelText = styled('div', LabelTextAttrs)`
|
|
181
|
-
font-size:
|
|
187
|
+
font-size: ${inputLabelFontSize};
|
|
188
|
+
font-weight: ${inputLabelFontWeight};
|
|
189
|
+
line-height: ${inputLabelLineHeight};
|
|
190
|
+
letter-spacing: ${inputLabelLetterSpacing};
|
|
182
191
|
display: flex;
|
|
183
192
|
align-items: center;
|
|
184
193
|
min-height: 16px;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"
|
|
51
51
|
:border-color="
|
|
52
52
|
colorMode === 'transparent' && !borderColor
|
|
53
|
-
? '
|
|
53
|
+
? 'grey4'
|
|
54
54
|
: borderColor
|
|
55
55
|
"
|
|
56
56
|
:color-mode="colorMode"
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
colorMode === 'transparent' ? 'transparent' : backgroundColor
|
|
98
98
|
"
|
|
99
99
|
:border-color="
|
|
100
|
-
colorMode === 'transparent' && !borderColor ? '
|
|
100
|
+
colorMode === 'transparent' && !borderColor ? 'grey4' : borderColor
|
|
101
101
|
"
|
|
102
102
|
:color-mode="colorMode"
|
|
103
103
|
:data-id="inputDataId"
|
|
@@ -250,6 +250,12 @@
|
|
|
250
250
|
import IsRequiredLabelStar from '../isRequiredLabelStar'
|
|
251
251
|
import warningIcon from '../../../assets/icons/error_icon.png'
|
|
252
252
|
import Icon from '../../icon'
|
|
253
|
+
import {
|
|
254
|
+
inputLabelFontSize,
|
|
255
|
+
inputLabelFontWeight,
|
|
256
|
+
inputLabelLetterSpacing,
|
|
257
|
+
inputLabelLineHeight,
|
|
258
|
+
} from '../shared/inputLabelTypography'
|
|
253
259
|
|
|
254
260
|
const inputProps = {
|
|
255
261
|
isError: Boolean,
|
|
@@ -496,12 +502,16 @@
|
|
|
496
502
|
`
|
|
497
503
|
|
|
498
504
|
const LabelText = styled('div', inputProps)`
|
|
499
|
-
font-size:
|
|
505
|
+
font-size: ${(props) =>
|
|
506
|
+
props.fontSize ? props.fontSize : inputLabelFontSize};
|
|
507
|
+
font-weight: ${(props) =>
|
|
508
|
+
props.labelFontWeight ? props.labelFontWeight : inputLabelFontWeight};
|
|
509
|
+
line-height: ${inputLabelLineHeight};
|
|
510
|
+
letter-spacing: ${inputLabelLetterSpacing};
|
|
500
511
|
color: ${(props) =>
|
|
501
512
|
props.theme.colors[props.labelFontColor]
|
|
502
513
|
? props.theme.colors[props.labelFontColor]
|
|
503
514
|
: props.labelFontColor};
|
|
504
|
-
font-weight: ${(props) => props.labelFontWeight};
|
|
505
515
|
`
|
|
506
516
|
|
|
507
517
|
const IconAttrs = { size: String, marginRight: Number }
|
|
@@ -737,7 +747,7 @@
|
|
|
737
747
|
labelFontWeight: {
|
|
738
748
|
type: String,
|
|
739
749
|
required: false,
|
|
740
|
-
default: '
|
|
750
|
+
default: '500',
|
|
741
751
|
},
|
|
742
752
|
focus: {
|
|
743
753
|
type: Boolean,
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
import InputNumberQuestion from './index.vue'
|
|
3
|
+
import theme from '@/assets/theme'
|
|
4
|
+
|
|
5
|
+
const questionWithUnit = {
|
|
6
|
+
number_format_precision: 2,
|
|
7
|
+
number_min_allowed: 0,
|
|
8
|
+
number_max_allowed: 500,
|
|
9
|
+
unit_short_name: 'kWh',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const questionPlain = {
|
|
13
|
+
number_format_precision: 0,
|
|
14
|
+
number_min_allowed: 1,
|
|
15
|
+
number_max_allowed: 99,
|
|
16
|
+
unit_short_name: '',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
title: 'Components/Inputs/InputNumberQuestion',
|
|
21
|
+
component: InputNumberQuestion,
|
|
22
|
+
tags: ['autodocs'],
|
|
23
|
+
parameters: {
|
|
24
|
+
layout: 'centered',
|
|
25
|
+
},
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const Template = (args) => ({
|
|
29
|
+
components: { InputNumberQuestion },
|
|
30
|
+
setup() {
|
|
31
|
+
const val = ref(args.value)
|
|
32
|
+
return { args, val }
|
|
33
|
+
},
|
|
34
|
+
template: `
|
|
35
|
+
<div data-test-id="input-number-question-story" style="min-width: 280px; padding: 16px;">
|
|
36
|
+
<InputNumberQuestion
|
|
37
|
+
:question="args.question"
|
|
38
|
+
:value="val"
|
|
39
|
+
:placeholder="args.placeholder"
|
|
40
|
+
:is-error="args.isError"
|
|
41
|
+
:input-width="args.inputWidth"
|
|
42
|
+
:error-message="args.errorMessage"
|
|
43
|
+
@input-change="val = $event"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
`,
|
|
47
|
+
provide: {
|
|
48
|
+
theme,
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
export const WithUnit = Template.bind({})
|
|
53
|
+
WithUnit.args = {
|
|
54
|
+
question: questionWithUnit,
|
|
55
|
+
value: '120',
|
|
56
|
+
placeholder: 'Annual consumption',
|
|
57
|
+
isError: false,
|
|
58
|
+
inputWidth: '200px',
|
|
59
|
+
errorMessage: 'Enter a number between 0 and 500',
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const PlainInteger = Template.bind({})
|
|
63
|
+
PlainInteger.args = {
|
|
64
|
+
question: questionPlain,
|
|
65
|
+
value: '',
|
|
66
|
+
placeholder: 'Floor number',
|
|
67
|
+
isError: false,
|
|
68
|
+
inputWidth: '160px',
|
|
69
|
+
errorMessage: 'Enter a number between 1 and 99',
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const WithError = Template.bind({})
|
|
73
|
+
WithError.args = {
|
|
74
|
+
...PlainInteger.args,
|
|
75
|
+
value: 'abc',
|
|
76
|
+
isError: true,
|
|
77
|
+
}
|
|
@@ -107,6 +107,12 @@
|
|
|
107
107
|
import ErrorMessage from '../../errorMessage'
|
|
108
108
|
import InputValidations from '../../../mixins/inputValidations.js'
|
|
109
109
|
import IsRequiredLabelStar from '../isRequiredLabelStar'
|
|
110
|
+
import {
|
|
111
|
+
inputLabelFontSize,
|
|
112
|
+
inputLabelFontWeight,
|
|
113
|
+
inputLabelLetterSpacing,
|
|
114
|
+
inputLabelLineHeight,
|
|
115
|
+
} from '../shared/inputLabelTypography'
|
|
110
116
|
|
|
111
117
|
const Container = styled.div`
|
|
112
118
|
width: 100%;
|
|
@@ -119,14 +125,17 @@
|
|
|
119
125
|
props.theme.colors[props.labelFontColor]
|
|
120
126
|
? props.theme.colors[props.labelFontColor]
|
|
121
127
|
: props.labelFontColor
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
? props.labelFontColor
|
|
129
|
+
: props.theme.colors.eturnityGrey};
|
|
124
130
|
|
|
125
|
-
font-size: ${(props) =>
|
|
126
|
-
|
|
131
|
+
font-size: ${(props) =>
|
|
132
|
+
props.fontSize ? props.fontSize : inputLabelFontSize};
|
|
133
|
+
font-weight: ${inputLabelFontWeight};
|
|
134
|
+
line-height: ${inputLabelLineHeight};
|
|
135
|
+
letter-spacing: ${inputLabelLetterSpacing};
|
|
127
136
|
`
|
|
128
137
|
const OptionalLabel = styled.span`
|
|
129
|
-
font-weight:
|
|
138
|
+
font-weight: 400;
|
|
130
139
|
`
|
|
131
140
|
const LabelWrapper = styled.div`
|
|
132
141
|
display: inline-grid;
|
|
@@ -163,29 +172,29 @@
|
|
|
163
172
|
props.noBorder
|
|
164
173
|
? 'none'
|
|
165
174
|
: props.isError
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
? '1px solid ' + props.theme.colors.red
|
|
176
|
+
: props.borderColor
|
|
177
|
+
? props.theme.colors[props.borderColor]
|
|
178
|
+
? '1px solid ' + props.theme.colors[props.borderColor]
|
|
179
|
+
: '1px solid ' + props.borderColor
|
|
180
|
+
: '1px solid ' + props.theme.colors.grey4};
|
|
172
181
|
padding: ${(props) =>
|
|
173
182
|
props.isError
|
|
174
183
|
? '11px 25px 11px 10px'
|
|
175
184
|
: props.inputType === 'password'
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
185
|
+
? '11px 25px 11px 10px'
|
|
186
|
+
: props.defaultPadding
|
|
187
|
+
? '10px 35px 10px 15px'
|
|
188
|
+
: '11px 5px 11px 10px'};
|
|
180
189
|
border-radius: 4px;
|
|
181
190
|
position: relative;
|
|
182
|
-
font-size: ${(props) => (props.fontSize ? props.fontSize : '
|
|
191
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '14px')};
|
|
183
192
|
color: ${(props) =>
|
|
184
193
|
props.isDisabled
|
|
185
194
|
? props.theme.colors.grey2
|
|
186
195
|
: props.fontColor
|
|
187
|
-
|
|
188
|
-
|
|
196
|
+
? props.fontColor + ' !important'
|
|
197
|
+
: props.theme.colors.black};
|
|
189
198
|
|
|
190
199
|
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
|
191
200
|
min-width: ${(props) => (props.minWidth ? props.minWidth : 'unset')};
|
|
@@ -199,8 +208,8 @@
|
|
|
199
208
|
? props.disabledBackgroundColor + ' !important'
|
|
200
209
|
: props.theme.colors.grey5
|
|
201
210
|
: props.backgroundColor
|
|
202
|
-
|
|
203
|
-
|
|
211
|
+
? props.backgroundColor + ' !important'
|
|
212
|
+
: props.theme.colors.white};
|
|
204
213
|
&::placeholder {
|
|
205
214
|
color: ${(props) => props.theme.colors.grey2};
|
|
206
215
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import IsRequiredLabelStar from './index.vue'
|
|
2
|
+
import theme from '@/assets/theme'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Inputs/IsRequiredLabelStar',
|
|
6
|
+
component: IsRequiredLabelStar,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'centered',
|
|
10
|
+
},
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const Template = () => ({
|
|
14
|
+
components: { IsRequiredLabelStar },
|
|
15
|
+
template: `
|
|
16
|
+
<span data-test-id="required-star-story" style="font-size: 14px;">
|
|
17
|
+
Required field
|
|
18
|
+
<IsRequiredLabelStar />
|
|
19
|
+
</span>
|
|
20
|
+
`,
|
|
21
|
+
provide: {
|
|
22
|
+
theme,
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
export const Default = Template.bind({})
|
|
@@ -110,6 +110,12 @@
|
|
|
110
110
|
import InfoText from '../../infoText'
|
|
111
111
|
import IsRequiredLabelStar from '../isRequiredLabelStar'
|
|
112
112
|
import ErrorMessage from '../../errorMessage'
|
|
113
|
+
import {
|
|
114
|
+
inputLabelFontSize,
|
|
115
|
+
inputLabelFontWeight,
|
|
116
|
+
inputLabelLetterSpacing,
|
|
117
|
+
inputLabelLineHeight,
|
|
118
|
+
} from '../shared/inputLabelTypography'
|
|
113
119
|
|
|
114
120
|
const wrapperProps = {
|
|
115
121
|
layout: String,
|
|
@@ -159,12 +165,6 @@
|
|
|
159
165
|
: props.theme.colors.black};
|
|
160
166
|
position: relative;
|
|
161
167
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
|
162
|
-
font-size: ${(props) =>
|
|
163
|
-
props.size === 'large'
|
|
164
|
-
? '16px'
|
|
165
|
-
: props.size === 'medium'
|
|
166
|
-
? '13px'
|
|
167
|
-
: '10px'};
|
|
168
168
|
user-select: none;
|
|
169
169
|
flex: auto;
|
|
170
170
|
align-self: baseline;
|
|
@@ -213,8 +213,22 @@
|
|
|
213
213
|
}
|
|
214
214
|
`
|
|
215
215
|
|
|
216
|
-
const textAttrs = {
|
|
216
|
+
const textAttrs = {
|
|
217
|
+
isDisabled: Boolean,
|
|
218
|
+
colorMode: String,
|
|
219
|
+
fontSize: String,
|
|
220
|
+
fontWeight: String,
|
|
221
|
+
labelFontWeight: String,
|
|
222
|
+
}
|
|
217
223
|
const LabelText = styled('div', textAttrs)`
|
|
224
|
+
font-size: ${(props) =>
|
|
225
|
+
props.fontSize ? props.fontSize : inputLabelFontSize};
|
|
226
|
+
font-weight: ${(props) =>
|
|
227
|
+
props.fontWeight || props.labelFontWeight
|
|
228
|
+
? props.fontWeight || props.labelFontWeight
|
|
229
|
+
: inputLabelFontWeight};
|
|
230
|
+
line-height: ${inputLabelLineHeight};
|
|
231
|
+
letter-spacing: ${inputLabelLetterSpacing};
|
|
218
232
|
color: ${(props) =>
|
|
219
233
|
props.isDisabled
|
|
220
234
|
? props.theme.colors.grey2
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
? 'white'
|
|
25
25
|
: 'eturnityGrey'
|
|
26
26
|
"
|
|
27
|
-
:font-size="fontSize"
|
|
28
27
|
:font-weight="labelFontWeight"
|
|
29
28
|
>{{ label }}
|
|
30
29
|
<IsRequiredLabelStar v-if="isRequiredLabel" />
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
buttonBgColor
|
|
51
50
|
? buttonBgColor
|
|
52
51
|
: colorMode == 'dark'
|
|
53
|
-
? '
|
|
52
|
+
? 'transparent'
|
|
54
53
|
: colorMode == 'transparent'
|
|
55
54
|
? 'transparent'
|
|
56
55
|
: 'white'
|
|
@@ -155,6 +154,7 @@
|
|
|
155
154
|
: 'white'
|
|
156
155
|
"
|
|
157
156
|
class="rc-select-dropdown"
|
|
157
|
+
:color-mode="colorMode"
|
|
158
158
|
:dropdown-match-max-content="dropdownMatchMaxContent"
|
|
159
159
|
:dropdown-position="dropdownPosition"
|
|
160
160
|
:font-color="
|
|
@@ -233,9 +233,9 @@
|
|
|
233
233
|
></slot>
|
|
234
234
|
<slot
|
|
235
235
|
v-if="isCustomOptionVisible"
|
|
236
|
-
name="customOption"
|
|
237
236
|
:custom-option-value="customOptionValue"
|
|
238
|
-
|
|
237
|
+
name="customOption"
|
|
238
|
+
></slot>
|
|
239
239
|
</SelectDropdown>
|
|
240
240
|
</Component>
|
|
241
241
|
</DropdownWrapper>
|
|
@@ -287,6 +287,12 @@
|
|
|
287
287
|
import InputText from '../inputText'
|
|
288
288
|
import DraggableInputHandle from '../../draggableInputHandle'
|
|
289
289
|
import IsRequiredLabelStar from '../isRequiredLabelStar'
|
|
290
|
+
import {
|
|
291
|
+
inputLabelFontSize,
|
|
292
|
+
inputLabelFontWeight,
|
|
293
|
+
inputLabelLetterSpacing,
|
|
294
|
+
inputLabelLineHeight,
|
|
295
|
+
} from '../shared/inputLabelTypography'
|
|
290
296
|
import { debounce } from '../../../utils'
|
|
291
297
|
|
|
292
298
|
const CARET_WIDTH = '30px'
|
|
@@ -323,6 +329,7 @@
|
|
|
323
329
|
showBorder: Boolean,
|
|
324
330
|
}
|
|
325
331
|
const Selector = styled('div', selectorProps)`
|
|
332
|
+
font-size: 14px;
|
|
326
333
|
color: ${(props) => (props.disabled ? props.theme.colors.grey2 : '')};
|
|
327
334
|
${(props) =>
|
|
328
335
|
props.selectWidth === '100%'
|
|
@@ -357,8 +364,12 @@
|
|
|
357
364
|
props.theme.colors[props.fontColor]
|
|
358
365
|
? props.theme.colors[props.fontColor]
|
|
359
366
|
: props.fontColor};
|
|
360
|
-
font-size: ${(props) =>
|
|
361
|
-
|
|
367
|
+
font-size: ${(props) =>
|
|
368
|
+
props.fontSize ? props.fontSize : inputLabelFontSize};
|
|
369
|
+
font-weight: ${(props) =>
|
|
370
|
+
props.fontWeight ? props.fontWeight : inputLabelFontWeight};
|
|
371
|
+
line-height: ${inputLabelLineHeight};
|
|
372
|
+
letter-spacing: ${inputLabelLetterSpacing};
|
|
362
373
|
`
|
|
363
374
|
const OptionalLabel = styled.span`
|
|
364
375
|
font-weight: 300;
|
|
@@ -443,7 +454,7 @@
|
|
|
443
454
|
display: flex;
|
|
444
455
|
align-items: center;
|
|
445
456
|
${(props) => (props.selectHeight ? `height: ${props.selectHeight};` : '')}
|
|
446
|
-
${({ showBorder, theme, hasError }) =>
|
|
457
|
+
${({ showBorder, theme, hasError, colorMode }) =>
|
|
447
458
|
showBorder &&
|
|
448
459
|
`
|
|
449
460
|
border: ${BORDER_WIDTH} solid ${
|
|
@@ -472,7 +483,11 @@
|
|
|
472
483
|
overflow: hidden;
|
|
473
484
|
& > .handle {
|
|
474
485
|
border-right: ${(props) =>
|
|
475
|
-
props.hasError
|
|
486
|
+
props.hasError
|
|
487
|
+
? props.theme.colors.red
|
|
488
|
+
: props.colorMode === 'light'
|
|
489
|
+
? props.theme.colors.grey4
|
|
490
|
+
: props.theme.colors.white}
|
|
476
491
|
1px solid;
|
|
477
492
|
}
|
|
478
493
|
`
|
|
@@ -492,6 +507,7 @@
|
|
|
492
507
|
isFixedDropdownPosition: Boolean,
|
|
493
508
|
isTeleport: Boolean,
|
|
494
509
|
dropdownMatchMaxContent: Boolean,
|
|
510
|
+
colorMode: String,
|
|
495
511
|
}
|
|
496
512
|
const SelectDropdown = styled('div', selectDropdownAttrs)`
|
|
497
513
|
box-sizing: border-box;
|
|
@@ -564,7 +580,7 @@
|
|
|
564
580
|
gap: 8px;
|
|
565
581
|
box-sizing: border-box;
|
|
566
582
|
width: 100%;
|
|
567
|
-
border: 1px solid ${(p) => p.theme.semanticColors.
|
|
583
|
+
border: 1px solid ${(p) => p.theme.semanticColors.teal[600]};
|
|
568
584
|
border-radius: 8px;
|
|
569
585
|
background-color: ${(p) => p.theme.colors.white};
|
|
570
586
|
`
|
|
@@ -648,7 +664,7 @@
|
|
|
648
664
|
},
|
|
649
665
|
labelFontWeight: {
|
|
650
666
|
required: false,
|
|
651
|
-
default: '
|
|
667
|
+
default: '500',
|
|
652
668
|
type: String,
|
|
653
669
|
},
|
|
654
670
|
isRequiredLabel: {
|
|
@@ -715,7 +731,7 @@
|
|
|
715
731
|
},
|
|
716
732
|
dropdownBgColor: {
|
|
717
733
|
required: false,
|
|
718
|
-
default: '
|
|
734
|
+
default: 'transparent',
|
|
719
735
|
},
|
|
720
736
|
dropdownFontColor: {
|
|
721
737
|
required: false,
|
|
@@ -925,12 +941,9 @@
|
|
|
925
941
|
isSearchBarVisible() {
|
|
926
942
|
return (
|
|
927
943
|
(this.isCustomizable ||
|
|
928
|
-
(
|
|
929
|
-
this.searchPlacement !== 'dropdown' &&
|
|
944
|
+
(this.searchPlacement !== 'dropdown' &&
|
|
930
945
|
this.isSearchable &&
|
|
931
|
-
this.optionLength >= this.minOptionLength
|
|
932
|
-
)
|
|
933
|
-
) &&
|
|
946
|
+
this.optionLength >= this.minOptionLength)) &&
|
|
934
947
|
this.isDropdownOpen
|
|
935
948
|
)
|
|
936
949
|
},
|
|
@@ -967,10 +980,7 @@
|
|
|
967
980
|
return this.dropdownWidth
|
|
968
981
|
},
|
|
969
982
|
isSelectDropdownShown() {
|
|
970
|
-
return
|
|
971
|
-
this.isDropdownOpen &&
|
|
972
|
-
this.dropdownPosition.left !== null
|
|
973
|
-
)
|
|
983
|
+
return this.isDropdownOpen && this.dropdownPosition.left !== null
|
|
974
984
|
},
|
|
975
985
|
isMobileDevice() {
|
|
976
986
|
const userAgent =
|
|
@@ -1230,7 +1240,9 @@
|
|
|
1230
1240
|
}
|
|
1231
1241
|
|
|
1232
1242
|
nodes.forEach((el) => {
|
|
1233
|
-
let show =
|
|
1243
|
+
let show =
|
|
1244
|
+
el.textContent.toLowerCase().includes(q) ||
|
|
1245
|
+
el.hasAttribute('data-custom-option')
|
|
1234
1246
|
if (
|
|
1235
1247
|
show &&
|
|
1236
1248
|
hideUnassignedWhenOthers &&
|
|
@@ -10,7 +10,7 @@ const SELECT_SAMPLE_OPTIONS = [
|
|
|
10
10
|
]
|
|
11
11
|
|
|
12
12
|
export default {
|
|
13
|
-
title: '
|
|
13
|
+
title: 'Components/Inputs/Select',
|
|
14
14
|
component: Select,
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -35,28 +35,6 @@ const Template = (args) => ({
|
|
|
35
35
|
</Option>
|
|
36
36
|
</template>
|
|
37
37
|
</Select>`,
|
|
38
|
-
|
|
39
|
-
// import Select from "@eturnity/eturnity_reusable_components/src/components/inputs/select"
|
|
40
|
-
// import Option from "@eturnity/eturnity_reusable_components/src/components/inputs/select/option"
|
|
41
|
-
// To use:
|
|
42
|
-
// How to use it
|
|
43
|
-
// <Select
|
|
44
|
-
// hoverDropdown="true"
|
|
45
|
-
// selectWidth="100%"
|
|
46
|
-
// optionWidth="50%"
|
|
47
|
-
// label="that is a label"
|
|
48
|
-
// alignItems="vertical"
|
|
49
|
-
// >
|
|
50
|
-
// <template #selector="{selectedValue}">
|
|
51
|
-
// value selected: {{selectedValue}}
|
|
52
|
-
// </template>
|
|
53
|
-
// <template #dropdown>
|
|
54
|
-
// <Option value="1">value one</Option>
|
|
55
|
-
// <Option value="2">value two</Option>
|
|
56
|
-
// <Option value="3">value three</Option>
|
|
57
|
-
// <Option value="4">value four</Option>
|
|
58
|
-
// </template>
|
|
59
|
-
// </Select>
|
|
60
38
|
})
|
|
61
39
|
|
|
62
40
|
export const Default = Template.bind({})
|
|
@@ -64,7 +42,7 @@ Default.args = {
|
|
|
64
42
|
hoverDropdown: false,
|
|
65
43
|
selectWidth: '100%',
|
|
66
44
|
optionWidth: '50%',
|
|
67
|
-
label: '
|
|
45
|
+
label: 'Service territory',
|
|
68
46
|
alignItems: 'vertical',
|
|
69
47
|
value: SELECT_SAMPLE_OPTIONS[1],
|
|
70
48
|
}
|
|
@@ -88,7 +66,8 @@ const CustomizableTemplate = (args) => ({
|
|
|
88
66
|
}
|
|
89
67
|
return options.filter(
|
|
90
68
|
(item, index, self) =>
|
|
91
|
-
self.findIndex((candidate) => candidate.label === item.label) ===
|
|
69
|
+
self.findIndex((candidate) => candidate.label === item.label) ===
|
|
70
|
+
index
|
|
92
71
|
)
|
|
93
72
|
})
|
|
94
73
|
const onInputChange = (value) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Container>
|
|
3
|
-
<
|
|
3
|
+
<VueformSlider
|
|
4
4
|
:max="maxValue"
|
|
5
5
|
:min="minValue"
|
|
6
6
|
:tooltips="false"
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// :minValue="10" //default is 0 if not specified
|
|
22
22
|
// :maxValue="500" //default is 100 if not specified
|
|
23
23
|
// />
|
|
24
|
-
import
|
|
24
|
+
import VueformSlider from '@vueform/slider'
|
|
25
25
|
import styled from 'vue3-styled-components'
|
|
26
26
|
|
|
27
27
|
const Container = styled.div`
|
|
@@ -81,9 +81,9 @@
|
|
|
81
81
|
`
|
|
82
82
|
|
|
83
83
|
export default {
|
|
84
|
-
name: '
|
|
84
|
+
name: 'RcSlider',
|
|
85
85
|
components: {
|
|
86
|
-
|
|
86
|
+
VueformSlider,
|
|
87
87
|
Container,
|
|
88
88
|
NumberText,
|
|
89
89
|
},
|
|
@@ -106,14 +106,11 @@
|
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
108
|
mounted() {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
slider.appendChild(span1)
|
|
115
|
-
slider.appendChild(span2)
|
|
116
|
-
slider.appendChild(span3)
|
|
109
|
+
const slider = this.$el?.querySelector?.('.slider-touch-area')
|
|
110
|
+
if (!slider) return
|
|
111
|
+
;[1, 2, 3].forEach(() => {
|
|
112
|
+
slider.appendChild(document.createElement('span'))
|
|
113
|
+
})
|
|
117
114
|
},
|
|
118
115
|
methods: {
|
|
119
116
|
onChange(value) {
|