@eturnity/eturnity_reusable_components 8.19.8-EPDM-13664.1 → 8.19.8-EPDM-12618.7
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/components/infoText/index.vue +1 -9
- package/src/components/infoText/infoText.spec.js +20 -39
- package/src/components/infoText/infoText.stories.js +0 -28
- package/src/components/inputs/inputText/index.vue +1 -3
- package/src/components/tableDropdown/index.vue +7 -5
- package/src/components/infoText/defaultProps.js +0 -16
- package/src/components/infoText/templates/iconTextContent.vue +0 -105
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<PageContainer
|
|
3
3
|
ref="container"
|
|
4
|
-
data-test-id="infoText_container"
|
|
5
4
|
:type="type"
|
|
6
5
|
@click=";(isMobile || openTrigger === 'onClick') && toggleInfo()"
|
|
7
6
|
@mouseenter="!isMobile && openTrigger === 'onHover' && showInfo()"
|
|
@@ -288,11 +287,6 @@
|
|
|
288
287
|
default: '',
|
|
289
288
|
required: false,
|
|
290
289
|
},
|
|
291
|
-
contentBackgroundColor: {
|
|
292
|
-
type: String,
|
|
293
|
-
default: '',
|
|
294
|
-
required: false,
|
|
295
|
-
},
|
|
296
290
|
borderRadius: {
|
|
297
291
|
type: String,
|
|
298
292
|
default: '',
|
|
@@ -472,9 +466,7 @@
|
|
|
472
466
|
width: '100%',
|
|
473
467
|
maxWidth: props.maxWidth,
|
|
474
468
|
overflowY: 'auto',
|
|
475
|
-
backgroundColor: props.
|
|
476
|
-
? props.contentBackgroundColor
|
|
477
|
-
: props.image
|
|
469
|
+
backgroundColor: props.image
|
|
478
470
|
? theme.colors.white
|
|
479
471
|
: props.appTheme === 'light'
|
|
480
472
|
? theme.colors.black
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import { mount } from '@vue/test-utils'
|
|
3
3
|
import InfoText from '@/components/infoText'
|
|
4
|
-
import
|
|
5
|
-
import IconTextContent from './templates/iconTextContent.vue'
|
|
4
|
+
import theme from '@/assets/theme'
|
|
6
5
|
|
|
7
6
|
jest.mock('@/components/icon/iconCache.mjs', () => ({
|
|
8
7
|
// need to mock this due to how jest handles import.meta
|
|
@@ -14,19 +13,31 @@ describe('InfoText Component', () => {
|
|
|
14
13
|
|
|
15
14
|
beforeEach(() => {
|
|
16
15
|
wrapper = mount(InfoText, {
|
|
17
|
-
props:
|
|
16
|
+
props: {
|
|
17
|
+
text: 'default text',
|
|
18
|
+
size: '14px',
|
|
19
|
+
infoPosition: 'bottom',
|
|
20
|
+
alignArrow: 'center',
|
|
21
|
+
openTrigger: 'onHover',
|
|
22
|
+
width: '165px',
|
|
23
|
+
maxWidth: '165px',
|
|
24
|
+
shouldUseTeleport: false,
|
|
25
|
+
dotColor: '#00009f',
|
|
26
|
+
type: 'info',
|
|
27
|
+
},
|
|
18
28
|
global: {
|
|
19
|
-
|
|
20
|
-
|
|
29
|
+
provide: {
|
|
30
|
+
theme,
|
|
21
31
|
},
|
|
32
|
+
stubs: {
|
|
33
|
+
teleport: true
|
|
34
|
+
}
|
|
22
35
|
},
|
|
23
36
|
})
|
|
24
37
|
})
|
|
25
38
|
|
|
26
39
|
test('renders InfoText component with default props', () => {
|
|
27
|
-
expect(wrapper.find('[data-test-id="
|
|
28
|
-
true
|
|
29
|
-
)
|
|
40
|
+
expect(wrapper.find('[data-test-id="infoText_info"]').exists()).toBe(true)
|
|
30
41
|
expect(wrapper.vm.text).toContain('default text')
|
|
31
42
|
expect(wrapper.vm.size).toContain('14px')
|
|
32
43
|
expect(wrapper.vm.infoPosition).toContain('bottom')
|
|
@@ -41,7 +52,7 @@ describe('InfoText Component', () => {
|
|
|
41
52
|
)
|
|
42
53
|
|
|
43
54
|
//should see text upon click
|
|
44
|
-
await wrapper.trigger('click')
|
|
55
|
+
await wrapper.find('[data-test-id="infoText_trigger"]').trigger('click')
|
|
45
56
|
expect(wrapper.vm.isVisible).toBe(true)
|
|
46
57
|
|
|
47
58
|
expect(wrapper.find('[data-test-id="info_text_wrapper"]').exists()).toBe(
|
|
@@ -53,34 +64,4 @@ describe('InfoText Component', () => {
|
|
|
53
64
|
await wrapper.setProps({ type: 'dot' })
|
|
54
65
|
expect(wrapper.find('[data-test-id="infoText_dot"]').exists()).toBe(true)
|
|
55
66
|
})
|
|
56
|
-
|
|
57
|
-
test('iconTextContent slot is correctly rendered', async () => {
|
|
58
|
-
// override
|
|
59
|
-
const props = defaultProps.iconTextContent
|
|
60
|
-
wrapper = mount(InfoText, {
|
|
61
|
-
props: defaultProps,
|
|
62
|
-
slots: {
|
|
63
|
-
default: `<IconTextContent icon-name="${props.iconName}" text="${props.text}" />`,
|
|
64
|
-
},
|
|
65
|
-
global: {
|
|
66
|
-
stubs: {
|
|
67
|
-
teleport: true,
|
|
68
|
-
},
|
|
69
|
-
components: {
|
|
70
|
-
IconTextContent,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
await wrapper.trigger('mouseenter')
|
|
76
|
-
expect(wrapper.vm.isVisible).toBe(true)
|
|
77
|
-
|
|
78
|
-
const container = wrapper.find('[data-test-id="iconTextContent_container"]')
|
|
79
|
-
const icon = container.find('[data-test-id="iconTextContent_icon"]')
|
|
80
|
-
const text = container.find('[data-test-id="iconTextContent_text"]')
|
|
81
|
-
expect(container.exists()).toBe(true)
|
|
82
|
-
expect(icon.exists()).toBe(true)
|
|
83
|
-
expect(text.exists()).toBe(true)
|
|
84
|
-
expect(text.text()).toBe(props.text)
|
|
85
|
-
})
|
|
86
67
|
})
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import theme from '../../assets/theme'
|
|
2
1
|
import InfoText from './index.vue'
|
|
3
|
-
import IconTextContent from './templates/iconTextContent.vue'
|
|
4
2
|
|
|
5
3
|
export default {
|
|
6
4
|
title: 'infoText',
|
|
@@ -48,29 +46,3 @@ export const OnClick = {
|
|
|
48
46
|
openTrigger: 'onClick',
|
|
49
47
|
},
|
|
50
48
|
}
|
|
51
|
-
|
|
52
|
-
export const IconTextContentTemplate = {
|
|
53
|
-
args: {
|
|
54
|
-
...Default.args,
|
|
55
|
-
contentBackgroundColor: 'black',
|
|
56
|
-
iconName: 'warning_triangle',
|
|
57
|
-
iconColor: theme.colors.yellow,
|
|
58
|
-
size: '18px',
|
|
59
|
-
},
|
|
60
|
-
render: (args) => ({
|
|
61
|
-
components: { InfoText, IconTextContent },
|
|
62
|
-
setup() {
|
|
63
|
-
return { args }
|
|
64
|
-
},
|
|
65
|
-
template: `
|
|
66
|
-
<InfoText v-bind="args">
|
|
67
|
-
<IconTextContent
|
|
68
|
-
icon-name="warning_triangle"
|
|
69
|
-
text="This is a sample text with an icon"
|
|
70
|
-
icon-size="${args.size}"
|
|
71
|
-
icon-color="${args.iconColor}"
|
|
72
|
-
/>
|
|
73
|
-
</InfoText>
|
|
74
|
-
`,
|
|
75
|
-
}),
|
|
76
|
-
}
|
|
@@ -179,9 +179,7 @@
|
|
|
179
179
|
position: relative;
|
|
180
180
|
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
|
181
181
|
color: ${(props) =>
|
|
182
|
-
props.
|
|
183
|
-
? props.theme.colors.grey6
|
|
184
|
-
: props.isDisabled
|
|
182
|
+
props.isDisabled
|
|
185
183
|
? props.theme.colors.grey2
|
|
186
184
|
: props.fontColor
|
|
187
185
|
? props.fontColor + ' !important'
|
|
@@ -78,10 +78,13 @@
|
|
|
78
78
|
v-else
|
|
79
79
|
class="inputField"
|
|
80
80
|
:disabled="customInputDisabled"
|
|
81
|
+
:error-message="item.errorMessage"
|
|
81
82
|
:font-color="showArchived ? theme.colors.red : 'black'"
|
|
83
|
+
:is-error="item.isError"
|
|
82
84
|
:min-width="item.value.length + 'ch'"
|
|
83
|
-
:no-border="
|
|
85
|
+
:no-border="item.noBorder || item.noBorder === undefined"
|
|
84
86
|
:value="item.value"
|
|
87
|
+
@input-blur="onCustomInputChange($event.trim())"
|
|
85
88
|
@input-change="onCustomInputChange($event)"
|
|
86
89
|
/>
|
|
87
90
|
</InputContainer>
|
|
@@ -162,7 +165,7 @@
|
|
|
162
165
|
</OptionsItem>
|
|
163
166
|
</OptionsWrapper>
|
|
164
167
|
<CustomContainer
|
|
165
|
-
v-if="
|
|
168
|
+
v-if="getCustomName.length && allowFreeInputs"
|
|
166
169
|
@click="onCustomNameClick()"
|
|
167
170
|
>
|
|
168
171
|
<CustomName>{{ getCustomName }}</CustomName>
|
|
@@ -226,7 +229,6 @@
|
|
|
226
229
|
const ItemAttrs = { isNested: Boolean, showArchived: Boolean }
|
|
227
230
|
const ComponentItem = styled('td', ItemAttrs)`
|
|
228
231
|
padding-left: ${(props) => (props.isNested ? '14px !important' : '0')};
|
|
229
|
-
overflow: hidden;
|
|
230
232
|
text-overflow: ellipsis;
|
|
231
233
|
padding-right: 0 !important;
|
|
232
234
|
color: ${(props) =>
|
|
@@ -558,7 +560,7 @@
|
|
|
558
560
|
},
|
|
559
561
|
computed: {
|
|
560
562
|
getCustomName() {
|
|
561
|
-
return this.inputText
|
|
563
|
+
return this.inputText.trim()
|
|
562
564
|
},
|
|
563
565
|
theme() {
|
|
564
566
|
return theme
|
|
@@ -652,7 +654,7 @@
|
|
|
652
654
|
},
|
|
653
655
|
onCustomNameClick() {
|
|
654
656
|
this.wasClicked = true
|
|
655
|
-
this.$emit('on-custom-input-name', this.
|
|
657
|
+
this.$emit('on-custom-input-name', this.getCustomName)
|
|
656
658
|
this.$emit('toggle-dropdown-open', { close: true })
|
|
657
659
|
this.inputText = ''
|
|
658
660
|
},
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
text: 'default text',
|
|
3
|
-
size: '14px',
|
|
4
|
-
infoPosition: 'bottom',
|
|
5
|
-
alignArrow: 'center',
|
|
6
|
-
openTrigger: 'onHover',
|
|
7
|
-
width: '165px',
|
|
8
|
-
maxWidth: '165px',
|
|
9
|
-
shouldUseTeleport: false,
|
|
10
|
-
dotColor: '#00009f',
|
|
11
|
-
type: 'info',
|
|
12
|
-
iconTextContent: {
|
|
13
|
-
iconName: 'error',
|
|
14
|
-
text: 'Sample Text',
|
|
15
|
-
},
|
|
16
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Container data-test-id="iconTextContent_container">
|
|
3
|
-
<RCIcon
|
|
4
|
-
:color="iconColor"
|
|
5
|
-
data-test-id="iconTextContent_icon"
|
|
6
|
-
:name="iconName"
|
|
7
|
-
:size="iconSize"
|
|
8
|
-
/>
|
|
9
|
-
<TextWrapper
|
|
10
|
-
data-test-id="iconTextContent_text"
|
|
11
|
-
:font-color="fontColor"
|
|
12
|
-
:font-size="fontSize"
|
|
13
|
-
>
|
|
14
|
-
{{ text }}
|
|
15
|
-
<slot data-test-id="iconTextContent_slot"></slot>
|
|
16
|
-
</TextWrapper>
|
|
17
|
-
</Container>
|
|
18
|
-
</template>
|
|
19
|
-
|
|
20
|
-
<script>
|
|
21
|
-
// import InfoText from "@eturnity/eturnity_reusable_components/src/components/infoText"
|
|
22
|
-
// import IconTextContent from "@eturnity/eturnity_reusable_components/src/components/infoText/templates/iconTextContent"
|
|
23
|
-
//To use:
|
|
24
|
-
// <InfoText
|
|
25
|
-
// icon-color="red"
|
|
26
|
-
// icon-name="error"
|
|
27
|
-
// size="20px"
|
|
28
|
-
// open-trigger="onClick"
|
|
29
|
-
// >
|
|
30
|
-
// <IconTextContent
|
|
31
|
-
// icon-name="error"
|
|
32
|
-
// text="Text"
|
|
33
|
-
// icon-size="18px"
|
|
34
|
-
// icon-color="red"
|
|
35
|
-
// />
|
|
36
|
-
// </InfoText>
|
|
37
|
-
|
|
38
|
-
import styled from 'vue3-styled-components'
|
|
39
|
-
import theme from '../../../assets/theme.js'
|
|
40
|
-
import RCIcon from '../../icon'
|
|
41
|
-
|
|
42
|
-
const Container = styled('div')`
|
|
43
|
-
display: flex;
|
|
44
|
-
flex-direction: row;
|
|
45
|
-
align-items: flex-start;
|
|
46
|
-
gap: 8px;
|
|
47
|
-
`
|
|
48
|
-
|
|
49
|
-
const TextAttrs = {
|
|
50
|
-
fontSize: String,
|
|
51
|
-
fontColor: String,
|
|
52
|
-
}
|
|
53
|
-
const TextWrapper = styled('div', TextAttrs)`
|
|
54
|
-
font-size: ${(props) => props.fontSize};
|
|
55
|
-
color: ${(props) => props.fontColor};
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
display: flex;
|
|
58
|
-
flex-direction: column;
|
|
59
|
-
align-items: center;
|
|
60
|
-
gap: 8px;
|
|
61
|
-
font-weight: 400;
|
|
62
|
-
line-height: 150%;
|
|
63
|
-
letter-spacing: 0%;
|
|
64
|
-
vertical-align: middle;
|
|
65
|
-
`
|
|
66
|
-
|
|
67
|
-
export default {
|
|
68
|
-
name: 'IconTextContent',
|
|
69
|
-
components: {
|
|
70
|
-
Container,
|
|
71
|
-
TextWrapper,
|
|
72
|
-
RCIcon,
|
|
73
|
-
},
|
|
74
|
-
props: {
|
|
75
|
-
iconName: {
|
|
76
|
-
type: String,
|
|
77
|
-
required: true,
|
|
78
|
-
},
|
|
79
|
-
text: {
|
|
80
|
-
type: String,
|
|
81
|
-
required: true,
|
|
82
|
-
},
|
|
83
|
-
iconSize: {
|
|
84
|
-
type: String,
|
|
85
|
-
required: false,
|
|
86
|
-
default: '18px',
|
|
87
|
-
},
|
|
88
|
-
iconColor: {
|
|
89
|
-
type: String,
|
|
90
|
-
required: false,
|
|
91
|
-
default: '',
|
|
92
|
-
},
|
|
93
|
-
fontSize: {
|
|
94
|
-
type: String,
|
|
95
|
-
required: false,
|
|
96
|
-
default: '11px',
|
|
97
|
-
},
|
|
98
|
-
fontColor: {
|
|
99
|
-
type: String,
|
|
100
|
-
required: false,
|
|
101
|
-
default: theme.colors.white,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
}
|
|
105
|
-
</script>
|