@eturnity/eturnity_reusable_components 8.13.3-EPDM-14657.2 → 8.13.3-EPDM-14657.3
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/package.json +1 -1
- package/src/TestChart.vue +29 -34
- package/src/assets/icons/collapse_arrow_icon_white.svg +1 -0
- package/src/assets/svgIcons/ac_power.svg +4 -0
- package/src/assets/svgIcons/arrow_long_left.svg +3 -0
- package/src/assets/svgIcons/arrow_long_right.svg +3 -0
- package/src/assets/svgIcons/chassis_ground_symbol.svg +27 -0
- package/src/assets/svgIcons/dc_power.svg +8 -0
- package/src/assets/svgIcons/double_arrow_long.svg +4 -0
- package/src/assets/svgIcons/ed_ac.svg +3 -0
- package/src/assets/svgIcons/ed_acgrid.svg +4 -0
- package/src/assets/svgIcons/ed_arrow_both.svg +7 -0
- package/src/assets/svgIcons/ed_arrow_left.svg +7 -0
- package/src/assets/svgIcons/ed_arrow_right.svg +7 -0
- package/src/assets/svgIcons/ed_battery.svg +10 -0
- package/src/assets/svgIcons/ed_batteryacinverter.svg +16 -0
- package/src/assets/svgIcons/ed_batteryintegratedinverter.svg +19 -0
- package/src/assets/svgIcons/ed_cirquitbreaker.svg +4 -0
- package/src/assets/svgIcons/ed_cirquitbreaker_magnetic.svg +6 -0
- package/src/assets/svgIcons/ed_cirquitbreaker_thermal.svg +4 -0
- package/src/assets/svgIcons/ed_cirquitbreaker_thermal_magnetic.svg +5 -0
- package/src/assets/svgIcons/ed_consumption.svg +3 -0
- package/src/assets/svgIcons/ed_dc.svg +6 -0
- package/src/assets/svgIcons/ed_disconnector.svg +4 -0
- package/src/assets/svgIcons/ed_disconnector_fuse.svg +4 -0
- package/src/assets/svgIcons/ed_disconnector_fuse_switch.svg +4 -0
- package/src/assets/svgIcons/ed_disconnector_loadbreak switch.svg +4 -0
- package/src/assets/svgIcons/ed_disconnector_switch.svg +4 -0
- package/src/assets/svgIcons/ed_disconnector_switch_auto_release.svg +5 -0
- package/src/assets/svgIcons/ed_energymanagement_rectangle.svg +3 -0
- package/src/assets/svgIcons/ed_evcharger.svg +19 -0
- package/src/assets/svgIcons/ed_flexiblecomponent_circle.svg +3 -0
- package/src/assets/svgIcons/ed_flexiblecomponent_square.svg +3 -0
- package/src/assets/svgIcons/ed_fuse.svg +3 -0
- package/src/assets/svgIcons/ed_ground.svg +5 -0
- package/src/assets/svgIcons/ed_heatpump.svg +4 -0
- package/src/assets/svgIcons/ed_icon_battery.svg +9 -0
- package/src/assets/svgIcons/ed_icon_circle.svg +3 -0
- package/src/assets/svgIcons/ed_icon_heatpump.svg +3 -0
- package/src/assets/svgIcons/ed_icon_inverter.svg +8 -0
- package/src/assets/svgIcons/ed_icon_optimizer.svg +11 -0
- package/src/assets/svgIcons/ed_integratedbatteryinverter.svg +10 -0
- package/src/assets/svgIcons/ed_inverter-blank.svg +3 -0
- package/src/assets/svgIcons/ed_mainsconnection.svg +3 -0
- package/src/assets/svgIcons/ed_meter_arrowleft.svg +4 -0
- package/src/assets/svgIcons/ed_meter_arrowright.svg +4 -0
- package/src/assets/svgIcons/ed_meter_bidirectional.svg +5 -0
- package/src/assets/svgIcons/ed_networkandsystemprotection_double.svg +14 -0
- package/src/assets/svgIcons/ed_networkandsystemprotection_single.svg +7 -0
- package/src/assets/svgIcons/ed_pvpanel.svg +7 -0
- package/src/assets/svgIcons/ed_rcd.svg +5 -0
- package/src/assets/svgIcons/ed_rcd_simple.svg +3 -0
- package/src/assets/svgIcons/ed_spd.svg +6 -0
- package/src/assets/svgIcons/ed_stringwithoptimizer.svg +33 -0
- package/src/assets/svgIcons/ed_stringwithoutoptimizer.svg +17 -0
- package/src/assets/svgIcons/ed_transformer.svg +3 -0
- package/src/assets/svgIcons/ground_symbol.svg +28 -0
- package/src/assets/svgIcons/house_sun.svg +3 -0
- package/src/assets/svgIcons/move_left.svg +3 -0
- package/src/assets/svgIcons/move_right.svg +3 -0
- package/src/assets/svgIcons/rectangle.svg +3 -0
- package/src/assets/svgIcons/text_icon.svg +3 -0
- package/src/assets/theme.js +1 -0
- package/src/components/banner/infoBanner/InfoBanner.spec.js +29 -42
- package/src/components/buttons/buttonIcon/index.vue +1 -1
- package/src/components/draggableCard/defaultProps.js +16 -0
- package/src/components/draggableCard/draggableCard.spec.js +99 -0
- package/src/components/draggableCard/draggableCard.stories.js +79 -0
- package/src/components/draggableCard/index.vue +363 -0
- package/src/components/errorMessage/errorMessage.spec.js +34 -0
- package/src/components/errorMessage/errorMessage.stories.js +35 -0
- package/src/components/filter/filterSettings.vue +2 -0
- package/src/components/icon/index.vue +18 -6
- package/src/components/infoText/index.vue +3 -3
- package/src/components/infoText/infoText.spec.js +6 -1
- package/src/components/inputs/checkbox/index.vue +2 -2
- package/src/components/inputs/select/index.vue +105 -18
- package/src/components/modals/actionModal/actionModal.spec.js +52 -0
- package/src/components/modals/actionModal/actionModal.stories.js +53 -0
- package/src/components/modals/actionModal/index.vue +6 -6
- package/src/components/modals/infoModal/index.vue +49 -19
- package/src/components/modals/infoModal/infoModal.spec.js +55 -0
- package/src/components/modals/infoModal/infoModal.stories.js +47 -0
- package/src/components/modals/modal/index.vue +21 -6
- package/src/components/pageSubtitle/PageSubtitle.stories.js +0 -1
- package/src/components/pageTitle/index.vue +3 -4
- package/src/components/spinner/index.vue +2 -2
- package/src/components/spinnerGif/index.vue +3 -3
- package/src/components/tableDropdown/index.vue +17 -9
- package/src/components/tables/mainTable/index.vue +4 -2
- package/src/helpers/dateTimeFormatting.js +51 -0
- package/src/main.js +0 -7
- package/src/router/dynamicRoutes.js +0 -12
- package/src/DemoCharts.vue +0 -424
@@ -0,0 +1,363 @@
|
|
1
|
+
<template>
|
2
|
+
<CardContainer
|
3
|
+
data-test-id="draggable_card_container"
|
4
|
+
:initial-position="initialPosition"
|
5
|
+
:width="width"
|
6
|
+
>
|
7
|
+
<HeaderContainer data-test-id="draggable_card_header">
|
8
|
+
<SubHeaderWrapper>
|
9
|
+
<LeftIconsContainer>
|
10
|
+
<DragHandleWrapper :class="{ dragging: isDragging }">
|
11
|
+
<RCIcon
|
12
|
+
:color="theme.colors.grey3"
|
13
|
+
data-test-id="draggable_card_drag_icon"
|
14
|
+
name="drag_icon"
|
15
|
+
size="14px"
|
16
|
+
:title="$gettext('drag_drop')"
|
17
|
+
@mousedown="(event) => onDragStart(event, false)"
|
18
|
+
@touchstart="
|
19
|
+
(event) => {
|
20
|
+
onDragStart(event, true)
|
21
|
+
}
|
22
|
+
"
|
23
|
+
/>
|
24
|
+
</DragHandleWrapper>
|
25
|
+
<ArrowIconWrapper
|
26
|
+
v-if="isCollapsible"
|
27
|
+
data-test-id="draggable_card_collapse_button"
|
28
|
+
:is-collapsed="isCollapsed"
|
29
|
+
@click="toggleCollapse"
|
30
|
+
>
|
31
|
+
<img :src="CollapseArrowIconUrl" />
|
32
|
+
</ArrowIconWrapper>
|
33
|
+
</LeftIconsContainer>
|
34
|
+
<TitleContainer :data-id="titleDataId">
|
35
|
+
<TextContainer>{{ title }}</TextContainer>
|
36
|
+
<InfoText v-if="infoText?.length" :text="infoText" />
|
37
|
+
</TitleContainer>
|
38
|
+
</SubHeaderWrapper>
|
39
|
+
<CloseButton
|
40
|
+
class="close"
|
41
|
+
data-test-id="draggable_card_close_button"
|
42
|
+
@click="$emit('on-close')"
|
43
|
+
/>
|
44
|
+
</HeaderContainer>
|
45
|
+
<BodyContainer v-if="!isCollapsed" data-test-id="draggable_card_body">
|
46
|
+
<slot name="body"></slot>
|
47
|
+
</BodyContainer>
|
48
|
+
<FooterContainer v-if="$slots.footer" data-test-id="draggable_card_footer">
|
49
|
+
<slot name="footer"></slot>
|
50
|
+
</FooterContainer>
|
51
|
+
</CardContainer>
|
52
|
+
</template>
|
53
|
+
|
54
|
+
<script>
|
55
|
+
import styled from 'vue3-styled-components'
|
56
|
+
import theme from '../../assets/theme.js'
|
57
|
+
import RCIcon from '../icon'
|
58
|
+
import CloseButton from '../buttons/closeButton'
|
59
|
+
import InfoText from '../infoText'
|
60
|
+
import CollapseArrowIconUrl from '../../assets/icons/collapse_arrow_icon_white.svg?url'
|
61
|
+
|
62
|
+
const CardContainerAttr = {
|
63
|
+
initialPosition: Object,
|
64
|
+
width: String,
|
65
|
+
}
|
66
|
+
const CardContainer = styled('div', CardContainerAttr)`
|
67
|
+
position: absolute;
|
68
|
+
display: flex;
|
69
|
+
flex-direction: column;
|
70
|
+
border-radius: 4px;
|
71
|
+
width: ${(props) => props.width};
|
72
|
+
background: ${theme.colors.transparentBlack2};
|
73
|
+
z-index: 5;
|
74
|
+
${(props) =>
|
75
|
+
props.initialPosition?.top && `top: ${props.initialPosition.top};`}
|
76
|
+
${(props) =>
|
77
|
+
props.initialPosition?.right && `right: ${props.initialPosition.right};`}
|
78
|
+
${(props) =>
|
79
|
+
props.initialPosition?.left && `left: ${props.initialPosition.left};`}
|
80
|
+
${(props) =>
|
81
|
+
props.initialPosition?.bottom &&
|
82
|
+
`bottom: ${props.initialPosition.bottom};`}
|
83
|
+
`
|
84
|
+
|
85
|
+
const HeaderContainer = styled.div`
|
86
|
+
display: flex;
|
87
|
+
align-items: center;
|
88
|
+
justify-content: space-between;
|
89
|
+
padding: 8px;
|
90
|
+
`
|
91
|
+
|
92
|
+
const SubHeaderWrapper = styled.div`
|
93
|
+
display: flex;
|
94
|
+
min-width: 180px;
|
95
|
+
align-items: center;
|
96
|
+
height: fit-content;
|
97
|
+
margin-right: 30px;
|
98
|
+
`
|
99
|
+
|
100
|
+
const LeftIconsContainer = styled.div`
|
101
|
+
display: flex;
|
102
|
+
align-items: center;
|
103
|
+
gap: 4px;
|
104
|
+
margin-right: 14px;
|
105
|
+
`
|
106
|
+
|
107
|
+
const TitleContainer = styled.div`
|
108
|
+
display: flex;
|
109
|
+
align-items: center;
|
110
|
+
gap: 8px;
|
111
|
+
`
|
112
|
+
|
113
|
+
const TextContainer = styled.div`
|
114
|
+
font-family: ${theme.fonts.mainFont};
|
115
|
+
font-weight: 600;
|
116
|
+
font-size: 14px;
|
117
|
+
line-height: 19.6px;
|
118
|
+
letter-spacing: -1%;
|
119
|
+
color: ${theme.colors.white};
|
120
|
+
word-break: break-word;
|
121
|
+
overflow-wrap: break-word;
|
122
|
+
white-space: normal;
|
123
|
+
`
|
124
|
+
|
125
|
+
const DragHandleWrapper = styled.div`
|
126
|
+
display: grid;
|
127
|
+
align-items: center;
|
128
|
+
justify-items: center;
|
129
|
+
width: 26px;
|
130
|
+
height: 26px;
|
131
|
+
cursor: grab;
|
132
|
+
&.dragging {
|
133
|
+
cursor: grabbing;
|
134
|
+
}
|
135
|
+
`
|
136
|
+
|
137
|
+
const collapsedAttrs = {
|
138
|
+
isCollapsed: Boolean,
|
139
|
+
}
|
140
|
+
const ArrowIconWrapper = styled('div', collapsedAttrs)`
|
141
|
+
display: flex;
|
142
|
+
align-items: center;
|
143
|
+
justify-content: center;
|
144
|
+
width: 8px;
|
145
|
+
height: 26px;
|
146
|
+
cursor: pointer;
|
147
|
+
transition: transform 0.3s ease;
|
148
|
+
${(props) => props.isCollapsed && 'transform: rotate(-180deg);'}
|
149
|
+
`
|
150
|
+
|
151
|
+
const BodyContainer = styled.div`
|
152
|
+
display: flex;
|
153
|
+
flex-direction: column;
|
154
|
+
gap: 16px;
|
155
|
+
padding-top: 8px;
|
156
|
+
padding-right: 16px;
|
157
|
+
padding-bottom: 8px;
|
158
|
+
padding-left: 16px;
|
159
|
+
word-break: break-word;
|
160
|
+
overflow-wrap: break-word;
|
161
|
+
white-space: normal;
|
162
|
+
`
|
163
|
+
|
164
|
+
const FooterContainer = styled.div`
|
165
|
+
display: flex;
|
166
|
+
border-radius: 4px;
|
167
|
+
align-items: center;
|
168
|
+
justify-content: space-between;
|
169
|
+
padding: 8px;
|
170
|
+
background: ${theme.colors.eturnityGrey};
|
171
|
+
word-break: break-word;
|
172
|
+
overflow-wrap: break-word;
|
173
|
+
white-space: normal;
|
174
|
+
`
|
175
|
+
|
176
|
+
export default {
|
177
|
+
name: 'DraggableCard',
|
178
|
+
components: {
|
179
|
+
CardContainer,
|
180
|
+
HeaderContainer,
|
181
|
+
SubHeaderWrapper,
|
182
|
+
LeftIconsContainer,
|
183
|
+
TextContainer,
|
184
|
+
DragHandleWrapper,
|
185
|
+
ArrowIconWrapper,
|
186
|
+
RCIcon,
|
187
|
+
CloseButton,
|
188
|
+
InfoText,
|
189
|
+
TitleContainer,
|
190
|
+
BodyContainer,
|
191
|
+
FooterContainer,
|
192
|
+
},
|
193
|
+
props: {
|
194
|
+
width: {
|
195
|
+
required: true,
|
196
|
+
type: String,
|
197
|
+
},
|
198
|
+
initialPosition: {
|
199
|
+
required: true,
|
200
|
+
type: Object,
|
201
|
+
},
|
202
|
+
title: {
|
203
|
+
required: true,
|
204
|
+
type: String,
|
205
|
+
},
|
206
|
+
titleDataId: {
|
207
|
+
required: false,
|
208
|
+
type: String,
|
209
|
+
default: '',
|
210
|
+
},
|
211
|
+
isCollapsible: {
|
212
|
+
required: false,
|
213
|
+
type: Boolean,
|
214
|
+
default: true,
|
215
|
+
},
|
216
|
+
infoText: {
|
217
|
+
required: false,
|
218
|
+
type: String,
|
219
|
+
default: '',
|
220
|
+
},
|
221
|
+
dragTargets: {
|
222
|
+
required: false,
|
223
|
+
type: Array,
|
224
|
+
default: () => ['document'],
|
225
|
+
},
|
226
|
+
dragBounds: {
|
227
|
+
required: false,
|
228
|
+
type: Object,
|
229
|
+
default: () => {},
|
230
|
+
},
|
231
|
+
},
|
232
|
+
emits: ['on-close'],
|
233
|
+
data() {
|
234
|
+
return {
|
235
|
+
isCollapsed: false,
|
236
|
+
isDragging: false,
|
237
|
+
isTouchStart: false,
|
238
|
+
eventCoordinates: {
|
239
|
+
x: 0,
|
240
|
+
y: 0,
|
241
|
+
},
|
242
|
+
CollapseArrowIconUrl,
|
243
|
+
}
|
244
|
+
},
|
245
|
+
computed: {
|
246
|
+
dragBoundsEnabled() {
|
247
|
+
const minPosition = this.dragBounds?.min
|
248
|
+
const maxPosition = this.dragBounds?.max
|
249
|
+
return (
|
250
|
+
Number.isFinite(minPosition?.top) &&
|
251
|
+
Number.isFinite(minPosition?.left) &&
|
252
|
+
Number.isFinite(maxPosition?.top) &&
|
253
|
+
Number.isFinite(maxPosition?.left)
|
254
|
+
)
|
255
|
+
},
|
256
|
+
theme() {
|
257
|
+
return theme
|
258
|
+
},
|
259
|
+
},
|
260
|
+
watch: {
|
261
|
+
dragBounds() {
|
262
|
+
this.clampElementPosition()
|
263
|
+
},
|
264
|
+
},
|
265
|
+
beforeUnmount() {
|
266
|
+
this.removeEvents()
|
267
|
+
},
|
268
|
+
methods: {
|
269
|
+
toggleCollapse() {
|
270
|
+
this.isCollapsed = !this.isCollapsed
|
271
|
+
},
|
272
|
+
onDragStart(e, isTouchStart) {
|
273
|
+
e.preventDefault()
|
274
|
+
this.isDragging = true
|
275
|
+
this.isTouchStart = isTouchStart
|
276
|
+
this.eventCoordinates.x = isTouchStart
|
277
|
+
? e.touches[0].clientX
|
278
|
+
: e.clientX
|
279
|
+
this.eventCoordinates.y = isTouchStart
|
280
|
+
? e.touches[0].clientY
|
281
|
+
: e.clientY
|
282
|
+
this.dragTargets.forEach((id) => {
|
283
|
+
const target =
|
284
|
+
id === 'document' ? document : document.getElementById(id)
|
285
|
+
if (target && target.addEventListener) {
|
286
|
+
target.addEventListener(
|
287
|
+
isTouchStart ? 'touchend' : 'mouseup',
|
288
|
+
this.onDragEnd
|
289
|
+
)
|
290
|
+
target.addEventListener(
|
291
|
+
isTouchStart ? 'touchmove' : 'mousemove',
|
292
|
+
this.onDrag
|
293
|
+
)
|
294
|
+
}
|
295
|
+
})
|
296
|
+
document.addEventListener(
|
297
|
+
isTouchStart ? 'touchend' : 'mouseup',
|
298
|
+
this.onDragEnd
|
299
|
+
)
|
300
|
+
},
|
301
|
+
onDrag(e) {
|
302
|
+
e.preventDefault()
|
303
|
+
const eventX = this.isTouchStart ? e.touches[0].clientX : e.clientX
|
304
|
+
const eventY = this.isTouchStart ? e.touches[0].clientY : e.clientY
|
305
|
+
const deltaX = this.eventCoordinates.x - eventX
|
306
|
+
const deltaY = this.eventCoordinates.y - eventY
|
307
|
+
this.eventCoordinates.x = eventX
|
308
|
+
this.eventCoordinates.y = eventY
|
309
|
+
const element = this.$el
|
310
|
+
let positionY = element.offsetTop - deltaY
|
311
|
+
let positionX = element.offsetLeft - deltaX
|
312
|
+
element.style.top = positionY + 'px'
|
313
|
+
element.style.left = positionX + 'px'
|
314
|
+
if (this.dragBoundsEnabled) {
|
315
|
+
this.clampElementPosition()
|
316
|
+
}
|
317
|
+
},
|
318
|
+
onDragEnd() {
|
319
|
+
this.isDragging = false
|
320
|
+
this.removeEvents()
|
321
|
+
},
|
322
|
+
clampElementPosition() {
|
323
|
+
if (!this.dragBoundsEnabled) return
|
324
|
+
|
325
|
+
const element = this.$el
|
326
|
+
const rect = element.getBoundingClientRect()
|
327
|
+
const computedStyle = window.getComputedStyle(element)
|
328
|
+
const currentX = parseFloat(computedStyle.left) || 0
|
329
|
+
const currentY = parseFloat(computedStyle.top) || 0
|
330
|
+
|
331
|
+
const minPosition = this.dragBounds.min
|
332
|
+
const maxPosition = this.dragBounds.max
|
333
|
+
|
334
|
+
const y = Math.min(
|
335
|
+
Math.max(currentY, minPosition.top),
|
336
|
+
maxPosition.top - rect.height
|
337
|
+
)
|
338
|
+
|
339
|
+
const x = Math.min(
|
340
|
+
Math.max(currentX, minPosition.left),
|
341
|
+
maxPosition.left - rect.width
|
342
|
+
)
|
343
|
+
|
344
|
+
element.style.top = y + 'px'
|
345
|
+
element.style.left = x + 'px'
|
346
|
+
},
|
347
|
+
removeEvents() {
|
348
|
+
this.dragTargets.forEach((id) => {
|
349
|
+
const target =
|
350
|
+
id === 'document' ? document : document.getElementById(id)
|
351
|
+
if (target && target.removeEventListener) {
|
352
|
+
target.removeEventListener('mouseup', this.onDragEnd)
|
353
|
+
target.removeEventListener('touchend', this.onDragEnd)
|
354
|
+
target.removeEventListener('mousemove', this.onDrag)
|
355
|
+
target.removeEventListener('touchmove', this.onDrag)
|
356
|
+
}
|
357
|
+
})
|
358
|
+
document.removeEventListener('mouseup', this.onDragEnd)
|
359
|
+
document.removeEventListener('touchend', this.onDragEnd)
|
360
|
+
},
|
361
|
+
},
|
362
|
+
}
|
363
|
+
</script>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
2
|
+
import ErrorMessage from '@/components/errorMessage'
|
3
|
+
import theme from '@/assets/theme'
|
4
|
+
|
5
|
+
/* eslint-disable */
|
6
|
+
|
7
|
+
describe('ErrorMessage Component', () => {
|
8
|
+
let wrapper
|
9
|
+
|
10
|
+
beforeEach(() => {
|
11
|
+
wrapper = mount(ErrorMessage, {
|
12
|
+
props: {},
|
13
|
+
slots: {
|
14
|
+
default: '<div data-test-id="fake-msg">testing</div>',
|
15
|
+
},
|
16
|
+
global: {
|
17
|
+
provide: {
|
18
|
+
theme,
|
19
|
+
},
|
20
|
+
},
|
21
|
+
})
|
22
|
+
})
|
23
|
+
|
24
|
+
test('renders ErrorMessage component with default props', () => {
|
25
|
+
expect(wrapper.findAll('[data-test-id="fake-msg"]').length).toBe(1)
|
26
|
+
})
|
27
|
+
|
28
|
+
test('applies the correct CSS class for styling', async () => {
|
29
|
+
wrapper.setProps({ marginTop: '20px' })
|
30
|
+
|
31
|
+
await wrapper.vm.$nextTick()
|
32
|
+
expect(wrapper.props().marginTop).toBe('20px')
|
33
|
+
})
|
34
|
+
})
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import ErrorMessage from './index.vue'
|
2
|
+
|
3
|
+
export default {
|
4
|
+
title: 'ErrorMessage',
|
5
|
+
component: ErrorMessage,
|
6
|
+
tags: ['autodocs'],
|
7
|
+
parameters: {
|
8
|
+
layout: 'centered',
|
9
|
+
},
|
10
|
+
}
|
11
|
+
|
12
|
+
// import ErrorMessage from "@eturnity/eturnity_reusable_components/src/components/errorMessage"
|
13
|
+
//
|
14
|
+
//To use:
|
15
|
+
// <error-message>
|
16
|
+
// <span>
|
17
|
+
// testing error message
|
18
|
+
// </span>
|
19
|
+
// </error-message>
|
20
|
+
|
21
|
+
const Template = (args, { argTypes }) => ({
|
22
|
+
components: { ErrorMessage },
|
23
|
+
props: Object.keys(argTypes),
|
24
|
+
template: `
|
25
|
+
<ErrorMessage v-bind="$props">
|
26
|
+
<span>
|
27
|
+
testing error message
|
28
|
+
</span>
|
29
|
+
</ErrorMessage>`,
|
30
|
+
})
|
31
|
+
|
32
|
+
export const Default = Template.bind({})
|
33
|
+
Default.args = {
|
34
|
+
marginTop: '13px',
|
35
|
+
}
|
@@ -100,6 +100,7 @@
|
|
100
100
|
:min-option-length="1"
|
101
101
|
select-height="36px"
|
102
102
|
select-width="100%"
|
103
|
+
:should-use-teleport="false"
|
103
104
|
>
|
104
105
|
<template #selector>
|
105
106
|
<OptionTitle> {{ filter.selectedText }} </OptionTitle>
|
@@ -255,6 +256,7 @@
|
|
255
256
|
:label="filter.label"
|
256
257
|
select-height="36px"
|
257
258
|
select-width="100%"
|
259
|
+
:should-use-teleport="false"
|
258
260
|
>
|
259
261
|
<template #selector="{ selectedValue }">
|
260
262
|
<OptionTitle>
|
@@ -3,7 +3,8 @@
|
|
3
3
|
:cursor="cursor"
|
4
4
|
data-test-id="icon_wrapper"
|
5
5
|
:disabled="disabled"
|
6
|
-
:
|
6
|
+
:height="height ? height : size"
|
7
|
+
:width="width ? width : size"
|
7
8
|
>
|
8
9
|
<IconImage
|
9
10
|
:animation="animation"
|
@@ -68,6 +69,16 @@
|
|
68
69
|
default: '30px',
|
69
70
|
type: String,
|
70
71
|
},
|
72
|
+
width: {
|
73
|
+
type: String,
|
74
|
+
required: false,
|
75
|
+
default: '',
|
76
|
+
},
|
77
|
+
height: {
|
78
|
+
type: String,
|
79
|
+
required: false,
|
80
|
+
default: '',
|
81
|
+
},
|
71
82
|
cursor: {
|
72
83
|
required: false,
|
73
84
|
default: null,
|
@@ -105,7 +116,8 @@
|
|
105
116
|
})
|
106
117
|
|
107
118
|
const Wrapper = styled('div', {
|
108
|
-
|
119
|
+
height: String,
|
120
|
+
width: String,
|
109
121
|
disabled: Boolean,
|
110
122
|
cursor: String,
|
111
123
|
})`
|
@@ -113,10 +125,10 @@
|
|
113
125
|
position: relative;
|
114
126
|
align-content: center;
|
115
127
|
justify-content: center;
|
116
|
-
width: ${(props) => props.
|
117
|
-
height: ${(props) => props.
|
118
|
-
min-width: ${(props) => props.
|
119
|
-
min-height: ${(props) => props.
|
128
|
+
width: ${(props) => props.width};
|
129
|
+
height: ${(props) => props.height};
|
130
|
+
min-width: ${(props) => props.width};
|
131
|
+
min-height: ${(props) => props.height};
|
120
132
|
cursor: ${(props) => (props.disabled ? 'not-allowed' : props.cursor)};
|
121
133
|
line-height: 0;
|
122
134
|
`
|
@@ -46,7 +46,7 @@
|
|
46
46
|
</IconWrapper>
|
47
47
|
</div>
|
48
48
|
<Teleport v-if="isVisible" to="body">
|
49
|
-
<TextWrapper :style="wrapperStyle">
|
49
|
+
<TextWrapper data-test-id="info_text_wrapper" :style="wrapperStyle">
|
50
50
|
<TextOverlay
|
51
51
|
ref="infoBox"
|
52
52
|
:app-theme="appTheme"
|
@@ -137,7 +137,7 @@
|
|
137
137
|
`
|
138
138
|
|
139
139
|
const TextWrapper = styled('div')`
|
140
|
-
z-index:
|
140
|
+
z-index: 9999999999;
|
141
141
|
position: absolute;
|
142
142
|
`
|
143
143
|
|
@@ -265,7 +265,7 @@
|
|
265
265
|
dotColor: {
|
266
266
|
type: String,
|
267
267
|
required: false,
|
268
|
-
default: theme.
|
268
|
+
default: theme.semanticColors.blue[400],
|
269
269
|
},
|
270
270
|
type: {
|
271
271
|
type: String,
|
@@ -29,6 +29,9 @@ describe('InfoText Component', () => {
|
|
29
29
|
provide: {
|
30
30
|
theme,
|
31
31
|
},
|
32
|
+
stubs: {
|
33
|
+
teleport: true
|
34
|
+
}
|
32
35
|
},
|
33
36
|
})
|
34
37
|
})
|
@@ -38,7 +41,6 @@ describe('InfoText Component', () => {
|
|
38
41
|
expect(wrapper.vm.text).toContain('default text')
|
39
42
|
expect(wrapper.vm.size).toContain('14px')
|
40
43
|
expect(wrapper.vm.infoPosition).toContain('bottom')
|
41
|
-
expect(wrapper.vm.alignArrow).toContain('center')
|
42
44
|
})
|
43
45
|
|
44
46
|
test('openTrigger prop is set to onClick', async () => {
|
@@ -48,8 +50,11 @@ describe('InfoText Component', () => {
|
|
48
50
|
expect(wrapper.find('[data-test-id="info_text_wrapper"]').exists()).toBe(
|
49
51
|
false
|
50
52
|
)
|
53
|
+
|
51
54
|
//should see text upon click
|
52
55
|
await wrapper.find('[data-test-id="infoText_trigger"]').trigger('click')
|
56
|
+
expect(wrapper.vm.isVisible).toBe(true)
|
57
|
+
|
53
58
|
expect(wrapper.find('[data-test-id="info_text_wrapper"]').exists()).toBe(
|
54
59
|
true
|
55
60
|
)
|
@@ -44,7 +44,7 @@
|
|
44
44
|
import styled from 'vue3-styled-components'
|
45
45
|
|
46
46
|
const ComponentWrapper = styled.div`
|
47
|
-
min-height:
|
47
|
+
min-height: 16px;
|
48
48
|
`
|
49
49
|
|
50
50
|
const CheckWrapper = styled('div', { hasLabel: Boolean })`
|
@@ -179,7 +179,7 @@
|
|
179
179
|
font-size: 13px;
|
180
180
|
display: grid;
|
181
181
|
align-items: center;
|
182
|
-
min-height:
|
182
|
+
min-height: 16px;
|
183
183
|
color: ${(props) =>
|
184
184
|
props.isDisabled ? props.theme.colors.grey2 : 'unset'};
|
185
185
|
`
|