@eturnity/eturnity_reusable_components 7.48.1-qa-elisee-7.51.1 → 7.51.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/package.json +1 -1
- package/src/assets/svgIcons/lock.svg +1 -1
- package/src/components/icon/Icons.stories.js +19 -9
- package/src/components/icon/iconCollection.vue +3 -4
- package/src/components/icon/index.vue +3 -13
- package/src/components/inputs/inputNumber/index.vue +3 -14
- package/src/components/inputs/select/index.vue +3 -9
- package/src/components/tables/mainTable/index.vue +12 -4
- package/src/components/icon/icon.spec.js +0 -66
package/package.json
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
<svg fill="none" height="16" viewbox="14 12 12 16" width="
|
1
|
+
<svg fill="none" height="16" viewbox="14 12 12 16" width="12" xmlns="http://www.w3.org/2000/svg">
|
2
2
|
<path clip-rule="evenodd" d="M16.5 18.25V16.5C16.5 14.567 18.067 13 20 13C21.933 13 23.5 14.567 23.5 16.5V18.25H25.25V27H14.75V18.25H16.5ZM18.25 16.5C18.25 15.5335 19.0335 14.75 20 14.75C20.9665 14.75 21.75 15.5335 21.75 16.5V18.25H18.25V16.5ZM19.125 24.375V20.875H20.875V24.375H19.125Z" fill="#263238" fill-rule="evenodd"></path>
|
3
3
|
</svg>
|
@@ -3,14 +3,24 @@ import IconCollection from './iconCollection.vue'
|
|
3
3
|
export default {
|
4
4
|
title: 'icon',
|
5
5
|
component: IconCollection,
|
6
|
+
// argTypes: {},
|
6
7
|
}
|
7
8
|
|
8
|
-
const Template = (args) => ({
|
9
|
+
const Template = (args, { argTypes }) => ({
|
10
|
+
// Components used in your story `template` are defined in the `components` object
|
9
11
|
components: { IconCollection },
|
10
|
-
setup()
|
11
|
-
|
12
|
-
|
13
|
-
|
12
|
+
// The story's `args` need to be mapped into the template through the `setup()` method
|
13
|
+
props: Object.keys(argTypes),
|
14
|
+
template: '<IconCollection v-bind="$props" />',
|
15
|
+
|
16
|
+
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
17
|
+
// How to use:
|
18
|
+
//<icon
|
19
|
+
// name="House" //required. a svg file named [name].svg should be present in /assets/svgIcons
|
20
|
+
// color="red"
|
21
|
+
// hoveredColor="blue"
|
22
|
+
// size="60px" by default, this is 30px
|
23
|
+
// />
|
14
24
|
})
|
15
25
|
|
16
26
|
export const Default = Template.bind({})
|
@@ -18,14 +28,14 @@ Default.args = {
|
|
18
28
|
size: '30px',
|
19
29
|
}
|
20
30
|
|
21
|
-
export const
|
22
|
-
|
31
|
+
export const withColor = Template.bind({})
|
32
|
+
withColor.args = {
|
23
33
|
size: '30px',
|
24
34
|
color: 'red',
|
25
35
|
hoveredColor: 'crimson',
|
26
36
|
}
|
27
37
|
|
28
|
-
export const
|
29
|
-
|
38
|
+
export const large = Template.bind({})
|
39
|
+
large.args = {
|
30
40
|
size: '60px',
|
31
41
|
}
|
@@ -2,7 +2,6 @@
|
|
2
2
|
<Wrapper>
|
3
3
|
<IconWrapper v-for="iconItem in iconList" :key="iconItem.name">
|
4
4
|
<div>
|
5
|
-
color:{{ color }}
|
6
5
|
<RCIcon
|
7
6
|
:color="color"
|
8
7
|
:hovered-color="hoveredColor"
|
@@ -40,9 +39,9 @@
|
|
40
39
|
name: 'CollectionComponent',
|
41
40
|
components: { RCIcon, IconWrapper, Wrapper },
|
42
41
|
props: {
|
43
|
-
size: { required: false
|
44
|
-
color: { required: false
|
45
|
-
hoveredColor: { required: false
|
42
|
+
size: { required: false },
|
43
|
+
color: { required: false },
|
44
|
+
hoveredColor: { required: false },
|
46
45
|
},
|
47
46
|
data() {
|
48
47
|
return {
|
@@ -1,24 +1,14 @@
|
|
1
1
|
<template>
|
2
|
-
<Wrapper
|
3
|
-
:cursor="cursor"
|
4
|
-
data-test-id="icon_wrapper"
|
5
|
-
:disabled="disabled"
|
6
|
-
:size="size"
|
7
|
-
>
|
2
|
+
<Wrapper :cursor="cursor" :disabled="disabled" :size="size">
|
8
3
|
<IconImage
|
9
4
|
:animation="animation"
|
10
5
|
:background-color="backgroundColor"
|
11
6
|
:color="color"
|
12
|
-
data-test-id="icon_image"
|
13
7
|
:hovered-color="hoveredColor"
|
14
8
|
>
|
15
|
-
<i
|
9
|
+
<i v-html="icon.html"></i>
|
16
10
|
</IconImage>
|
17
|
-
<StrikedLine
|
18
|
-
v-if="isStriked"
|
19
|
-
:color="color"
|
20
|
-
data-test-id="icon_striked_line"
|
21
|
-
/>
|
11
|
+
<StrikedLine v-if="isStriked" :color="color" />
|
22
12
|
</Wrapper>
|
23
13
|
</template>
|
24
14
|
|
@@ -4,7 +4,6 @@
|
|
4
4
|
v-if="hasLabelSlot"
|
5
5
|
:align-items="alignItems"
|
6
6
|
:border-color="borderColor"
|
7
|
-
:is-disabled="disabled"
|
8
7
|
:is-error="isError"
|
9
8
|
:is-interactive="isInteractive"
|
10
9
|
:no-border="noBorder"
|
@@ -274,22 +273,18 @@
|
|
274
273
|
: props.theme.colors.mediumGray};
|
275
274
|
`
|
276
275
|
|
277
|
-
const LabelWrapper = styled('div')`
|
276
|
+
const LabelWrapper = styled('div', inputProps)`
|
278
277
|
display: flex;
|
279
278
|
align-items: center;
|
280
279
|
gap: 10px;
|
281
280
|
margin-bottom: 8px;
|
281
|
+
cursor: ${(props) => (props.isInteractive ? 'ew-resize' : 'auto')};
|
282
282
|
`
|
283
283
|
const LabelSlotWrapper = styled('div', inputProps)`
|
284
284
|
display: flex;
|
285
285
|
gap: 10px;
|
286
286
|
align-items: center;
|
287
|
-
cursor: ${(props) =>
|
288
|
-
props.isDisabled
|
289
|
-
? 'not-allowed'
|
290
|
-
: props.isInteractive
|
291
|
-
? 'ew-resize'
|
292
|
-
: 'auto'};
|
287
|
+
cursor: ${(props) => (props.isInteractive ? 'ew-resize' : 'auto')};
|
293
288
|
border: ${(props) =>
|
294
289
|
props.alignItems == 'vertical'
|
295
290
|
? 'none'
|
@@ -765,18 +760,12 @@
|
|
765
760
|
}
|
766
761
|
},
|
767
762
|
initInteraction(e) {
|
768
|
-
if (this.disabled) {
|
769
|
-
return
|
770
|
-
}
|
771
763
|
this.focusInput()
|
772
764
|
e.preventDefault()
|
773
765
|
window.addEventListener('mousemove', this.interact, false)
|
774
766
|
window.addEventListener('mouseup', this.stopInteract, false)
|
775
767
|
},
|
776
768
|
interact(e) {
|
777
|
-
if (this.disabled) {
|
778
|
-
return
|
779
|
-
}
|
780
769
|
e.preventDefault()
|
781
770
|
let value = parseFloat(this.value || 0)
|
782
771
|
value += parseFloat(this.interactionStep) * parseInt(e.movementX)
|
@@ -43,7 +43,6 @@
|
|
43
43
|
buttonBgColor || colorMode == 'dark' ? 'transparentBlack1' : 'white'
|
44
44
|
"
|
45
45
|
class="select-button"
|
46
|
-
:color-mode="colorMode"
|
47
46
|
:data-id="dataId"
|
48
47
|
:disabled="disabled"
|
49
48
|
:font-color="
|
@@ -275,7 +274,6 @@
|
|
275
274
|
noRelative: Boolean,
|
276
275
|
tablePaddingLeft: String,
|
277
276
|
showDisabledBackground: Boolean,
|
278
|
-
colorMode: String,
|
279
277
|
}
|
280
278
|
const SelectButton = styled('div', selectButtonAttrs)`
|
281
279
|
position: ${(props) => (props.noRelative ? 'static' : 'relative')};
|
@@ -313,16 +311,12 @@
|
|
313
311
|
`}
|
314
312
|
background-color:${(props) =>
|
315
313
|
props.disabled && props.showDisabledBackground
|
316
|
-
? props.
|
317
|
-
? props.theme.transparentBlack1
|
318
|
-
: props.theme.colors.grey5
|
314
|
+
? props.theme.colors.grey5
|
319
315
|
: props.theme.colors[props.bgColor]
|
320
316
|
? props.theme.colors[props.bgColor]
|
321
317
|
: props.bgColor};
|
322
318
|
color: ${(props) =>
|
323
|
-
props.
|
324
|
-
? props.theme.colors.grey2
|
325
|
-
: props.theme.colors[props.fontColor]
|
319
|
+
props.theme.colors[props.fontColor]
|
326
320
|
? props.theme.colors[props.fontColor]
|
327
321
|
: props.fontColor};
|
328
322
|
${(props) => (props.disabled ? 'pointer-events: none' : '')};
|
@@ -619,7 +613,7 @@
|
|
619
613
|
if (this.isDropdownOpen) {
|
620
614
|
return this.$refs.dropdown.$el.childElementCount > 1
|
621
615
|
? this.$refs.dropdown.$el.childElementCount
|
622
|
-
: this.$refs.dropdown.$el.children[0]
|
616
|
+
: !!this.$refs.dropdown.$el.children[0]
|
623
617
|
? this.$refs.dropdown.$el.children[0].childElementCount
|
624
618
|
: 0
|
625
619
|
}
|
@@ -10,7 +10,11 @@
|
|
10
10
|
ref="tableRef"
|
11
11
|
:is-position-absolute="doesTableContainDraggables"
|
12
12
|
>
|
13
|
-
<TableWrapper
|
13
|
+
<TableWrapper
|
14
|
+
class="main-table-wrapper"
|
15
|
+
:full-width="fullWidth"
|
16
|
+
:is-overflow-hidden="isOverflowHidden"
|
17
|
+
>
|
14
18
|
<SpinnerWrapper v-if="isLoading">
|
15
19
|
<Spinner />
|
16
20
|
</SpinnerWrapper>
|
@@ -70,12 +74,12 @@
|
|
70
74
|
`}
|
71
75
|
`
|
72
76
|
|
73
|
-
const wrapperAttrs = { fullWidth: Boolean }
|
77
|
+
const wrapperAttrs = { fullWidth: Boolean, isOverflowHidden: Boolean }
|
74
78
|
const TableWrapper = styled('div', wrapperAttrs)`
|
75
79
|
width: ${(props) => (props.fullWidth ? '100%' : 'fit-content')};
|
76
80
|
max-width: 100%;
|
77
|
-
|
78
|
-
|
81
|
+
${(props) =>
|
82
|
+
props.isOverflowHidden ? 'overflow-x: auto; overflow-y: hidden;' : ''}
|
79
83
|
|
80
84
|
::-webkit-scrollbar {
|
81
85
|
height: 10px; //height of the whole scrollbar area
|
@@ -409,6 +413,10 @@
|
|
409
413
|
required: false,
|
410
414
|
default: false,
|
411
415
|
},
|
416
|
+
isOverflowHidden: {
|
417
|
+
required: false,
|
418
|
+
default: true,
|
419
|
+
},
|
412
420
|
titleText: {
|
413
421
|
required: false,
|
414
422
|
default: null,
|
@@ -1,66 +0,0 @@
|
|
1
|
-
import { mount } from '@vue/test-utils'
|
2
|
-
import RCIcon from '@/components/icon'
|
3
|
-
import theme from '@/assets/theme'
|
4
|
-
import 'jest-styled-components'
|
5
|
-
jest.mock('@/components/icon/iconCache.mjs', () => ({
|
6
|
-
fetchIcon: jest.fn(() => Promise.resolve('mocked-icon-url.svg')),
|
7
|
-
}))
|
8
|
-
|
9
|
-
describe('RCIcon.vue', () => {
|
10
|
-
it('renders icon with default props', async () => {
|
11
|
-
const wrapper = mount(RCIcon, {
|
12
|
-
props: { name: 'House' },
|
13
|
-
global: {
|
14
|
-
provide: {
|
15
|
-
theme,
|
16
|
-
},
|
17
|
-
},
|
18
|
-
})
|
19
|
-
|
20
|
-
const iconWrapper = wrapper.find('[data-test-id="icon_wrapper"]')
|
21
|
-
const iconImage = wrapper.find('[data-test-id="icon_image"]')
|
22
|
-
|
23
|
-
expect(iconWrapper.exists()).toBe(true)
|
24
|
-
expect(iconImage.exists()).toBe(true)
|
25
|
-
expect(wrapper.props('size')).toBe('30px')
|
26
|
-
})
|
27
|
-
|
28
|
-
it('renders striked line when isStriked is true', async () => {
|
29
|
-
const wrapper = mount(RCIcon, {
|
30
|
-
props: {
|
31
|
-
name: 'House',
|
32
|
-
isStriked: true,
|
33
|
-
color: 'red',
|
34
|
-
},
|
35
|
-
global: {
|
36
|
-
provide: {
|
37
|
-
theme,
|
38
|
-
},
|
39
|
-
},
|
40
|
-
})
|
41
|
-
|
42
|
-
const strikedLine = wrapper.find('[data-test-id="icon_striked_line"]')
|
43
|
-
expect(strikedLine.exists()).toBe(true)
|
44
|
-
})
|
45
|
-
|
46
|
-
it('applies correct styling based on props', async () => {
|
47
|
-
const wrapper = mount(RCIcon, {
|
48
|
-
props: {
|
49
|
-
name: 'House',
|
50
|
-
size: '60px',
|
51
|
-
color: 'red',
|
52
|
-
hoveredColor: 'blue',
|
53
|
-
backgroundColor: 'yellow',
|
54
|
-
},
|
55
|
-
global: {
|
56
|
-
provide: {
|
57
|
-
theme,
|
58
|
-
},
|
59
|
-
},
|
60
|
-
})
|
61
|
-
|
62
|
-
const iconImage = wrapper.find('[data-test-id="icon_image"]')
|
63
|
-
expect(iconImage.exists()).toBe(true)
|
64
|
-
// Add assertions for styling if needed
|
65
|
-
})
|
66
|
-
})
|