@eturnity/eturnity_reusable_components 7.24.3-EPDM-11320.0 → 7.24.3-EPDM-11143.1

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.
Files changed (67) hide show
  1. package/.prettierrc +7 -0
  2. package/package.json +20 -6
  3. package/public/favicon.ico +0 -0
  4. package/public/index.html +17 -0
  5. package/src/App.vue +70 -75
  6. package/src/assets/svgIcons/copy.svg +10 -0
  7. package/src/components/addNewButton/index.vue +27 -24
  8. package/src/components/banner/actionBanner/index.vue +30 -32
  9. package/src/components/banner/banner/index.vue +80 -88
  10. package/src/components/banner/infoBanner/index.vue +44 -36
  11. package/src/components/buttons/buttonIcon/index.vue +78 -83
  12. package/src/components/buttons/closeButton/index.vue +26 -26
  13. package/src/components/buttons/mainButton/index.vue +76 -80
  14. package/src/components/card/index.vue +52 -56
  15. package/src/components/collapsableInfoText/index.vue +76 -81
  16. package/src/components/deleteIcon/index.vue +28 -31
  17. package/src/components/draggableInputHandle/index.vue +17 -20
  18. package/src/components/dropdown/Dropdown.stories.js +8 -8
  19. package/src/components/dropdown/index.vue +72 -75
  20. package/src/components/errorMessage/index.vue +23 -23
  21. package/src/components/filter/filterSettings.vue +329 -349
  22. package/src/components/filter/index.vue +130 -130
  23. package/src/components/filter/parentDropdown.vue +40 -43
  24. package/src/components/icon/Icons.stories.js +4 -4
  25. package/src/components/icon/iconCache.js +1 -1
  26. package/src/components/icon/iconCollection.vue +37 -40
  27. package/src/components/icon/index.vue +65 -72
  28. package/src/components/iconWrapper/index.vue +118 -122
  29. package/src/components/infoCard/index.vue +17 -20
  30. package/src/components/infoText/index.vue +82 -88
  31. package/src/components/inputs/checkbox/index.vue +94 -91
  32. package/src/components/inputs/inputNumber/index.vue +488 -508
  33. package/src/components/inputs/inputNumberQuestion/index.vue +124 -127
  34. package/src/components/inputs/inputText/index.vue +252 -265
  35. package/src/components/inputs/radioButton/index.vue +120 -135
  36. package/src/components/inputs/searchInput/index.vue +81 -84
  37. package/src/components/inputs/select/index.vue +631 -644
  38. package/src/components/inputs/select/option/index.vue +91 -91
  39. package/src/components/inputs/select/select.stories.js +7 -7
  40. package/src/components/inputs/slider/index.vue +46 -46
  41. package/src/components/inputs/switchField/index.vue +152 -159
  42. package/src/components/inputs/textAreaInput/index.vue +113 -120
  43. package/src/components/inputs/toggle/index.vue +127 -137
  44. package/src/components/label/index.vue +61 -64
  45. package/src/components/markerItem/index.vue +40 -40
  46. package/src/components/modals/actionModal/index.vue +29 -32
  47. package/src/components/modals/infoModal/index.vue +27 -34
  48. package/src/components/modals/modal/index.vue +80 -88
  49. package/src/components/navigationTabs/index.vue +47 -50
  50. package/src/components/pageSubtitle/index.vue +29 -33
  51. package/src/components/pageTitle/index.vue +39 -47
  52. package/src/components/pagination/index.vue +62 -64
  53. package/src/components/progressBar/index.vue +67 -70
  54. package/src/components/projectMarker/index.vue +163 -172
  55. package/src/components/rangeSlider/Slider.vue +449 -449
  56. package/src/components/rangeSlider/index.vue +270 -282
  57. package/src/components/rangeSlider/utils/dom.js +3 -3
  58. package/src/components/selectedOptions/index.vue +51 -51
  59. package/src/components/sideMenu/index.vue +109 -117
  60. package/src/components/spinner/index.vue +34 -37
  61. package/src/components/tableDropdown/index.vue +326 -343
  62. package/src/components/tables/mainTable/index.vue +106 -109
  63. package/src/components/tables/viewTable/index.vue +92 -105
  64. package/src/components/threeDots/index.vue +171 -174
  65. package/src/components/videoThumbnail/index.vue +59 -67
  66. package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
  67. package/.eslintrc.js +0 -125
@@ -2,21 +2,17 @@
2
2
  <Wrapper
3
3
  v-show="!isLoading"
4
4
  :class="viewCardClass"
5
- :min-width="minWidth"
6
5
  :width="width"
6
+ :minWidth="minWidth"
7
7
  >
8
- <Spinner
9
- v-if="isLoading"
10
- :limited-to-modal="true"
11
- size="50px"
12
- />
8
+ <Spinner v-if="isLoading" size="50px" :limitedToModal="true" />
13
9
  <CardWrapper v-else>
14
10
  <CardTitle :class="titleClass">
15
11
  {{ $gettext(title) }}
16
- <EtPopover
12
+ <et-popover
17
13
  v-if="showPopover && popoverText !== ''"
18
14
  :text="popoverText"
19
- />
15
+ ></et-popover>
20
16
  </CardTitle>
21
17
  <slot></slot>
22
18
  </CardWrapper>
@@ -24,11 +20,11 @@
24
20
  </template>
25
21
 
26
22
  <script>
27
- import styled from 'vue3-styled-components'
28
- import Spinner from '../spinner'
23
+ import styled from 'vue3-styled-components'
24
+ import Spinner from '../spinner'
29
25
 
30
- const WrapperProps = { width: [Number, String], minWidth: [Number, String] }
31
- const Wrapper = styled('div', WrapperProps)`
26
+ const WrapperProps = { width: [Number, String], minWidth: [Number, String] }
27
+ const Wrapper = styled('div', WrapperProps)`
32
28
  max-width: ${(props) => props.width};
33
29
  min-width: ${(props) => props.minWidth};
34
30
  padding: 20px;
@@ -39,12 +35,12 @@
39
35
  height: 100%;
40
36
  `
41
37
 
42
- const CardWrapper = styled('div')`
38
+ const CardWrapper = styled('div')`
43
39
  height: 100%;
44
40
  width: auto;
45
41
  `
46
42
 
47
- const CardTitle = styled('p')`
43
+ const CardTitle = styled('p')`
48
44
  font-size: 14px;
49
45
  line-height: 1;
50
46
  color: ${(props) => props.theme.colors.black};
@@ -52,49 +48,49 @@
52
48
  margin-bottom: 10px;
53
49
  `
54
50
 
55
- export default {
56
- name: 'Card',
57
- components: {
58
- Spinner,
59
- Wrapper,
60
- CardTitle,
61
- CardWrapper
51
+ export default {
52
+ name: 'Card',
53
+ props: {
54
+ title: {
55
+ type: String,
56
+ default: ''
62
57
  },
63
- props: {
64
- title: {
65
- type: String,
66
- default: ''
67
- },
68
- width: {
69
- type: [Number, String],
70
- required: false,
71
- default: '400px'
72
- },
73
- minWidth: {
74
- type: [Number, String],
75
- required: false,
76
- default: null
77
- },
78
- titleClass: {
79
- type: String,
80
- default: ''
81
- },
82
- showPopover: {
83
- type: Boolean,
84
- default: false
85
- },
86
- viewCardClass: {
87
- type: String,
88
- default: ''
89
- },
90
- popoverText: {
91
- type: String,
92
- default: ''
93
- },
94
- isLoading: {
95
- type: Boolean,
96
- default: false
97
- }
58
+ width: {
59
+ type: [Number, String],
60
+ required: false,
61
+ default: '400px'
62
+ },
63
+ minWidth: {
64
+ type: [Number, String],
65
+ required: false,
66
+ default: null
67
+ },
68
+ titleClass: {
69
+ type: String,
70
+ default: ''
71
+ },
72
+ showPopover: {
73
+ type: Boolean,
74
+ default: false
75
+ },
76
+ viewCardClass: {
77
+ type: String,
78
+ default: ''
79
+ },
80
+ popoverText: {
81
+ type: String,
82
+ default: ''
83
+ },
84
+ isLoading: {
85
+ type: Boolean,
86
+ default: false
98
87
  }
88
+ },
89
+ components: {
90
+ Spinner,
91
+ Wrapper,
92
+ CardTitle,
93
+ CardWrapper
99
94
  }
95
+ }
100
96
  </script>
@@ -1,23 +1,18 @@
1
1
  <template>
2
2
  <div>
3
- <Text
4
- :expand="showButton && showAll"
5
- :font-size="fontSize"
6
- >
7
- {{ text }}
8
- </Text>
3
+ <Text :expand="showButton && showAll" :fontSize="fontSize">{{ text }}</Text>
9
4
  <ToggleContainer>
10
5
  <ToggleButton
11
- v-if="showButton && !showAll"
12
- :font-size="fontSize"
13
6
  @click="toggleHandler"
7
+ v-if="showButton && !showAll"
8
+ :fontSize="fontSize"
14
9
  >
15
10
  {{ $gettext('Show more') }}
16
11
  </ToggleButton>
17
12
  <ToggleButton
18
- v-if="showButton && showAll"
19
- :font-size="fontSize"
20
13
  @click="toggleHandler"
14
+ v-if="showButton && showAll"
15
+ :fontSize="fontSize"
21
16
  >
22
17
  {{ $gettext('Show less') }}
23
18
  </ToggleButton>
@@ -26,14 +21,14 @@
26
21
  </template>
27
22
 
28
23
  <script>
29
- import styled from 'vue3-styled-components'
30
- import theme from '@/assets/theme.js'
24
+ import styled from 'vue3-styled-components'
25
+ import theme from '@/assets/theme.js'
31
26
 
32
- const TextAttrs = {
33
- expand: Boolean,
34
- fontSize: String
35
- }
36
- const Text = styled('p', TextAttrs)`
27
+ const TextAttrs = {
28
+ expand: Boolean,
29
+ fontSize: String
30
+ }
31
+ const Text = styled('p', TextAttrs)`
37
32
  display: block;
38
33
  display: -webkit-box;
39
34
  line-height: 1.3em;
@@ -44,87 +39,87 @@
44
39
  text-overflow: ellipsis;
45
40
  `
46
41
 
47
- const ToggleContainer = styled.div`
42
+ const ToggleContainer = styled.div`
48
43
  display: flex;
49
44
  width: 100%;
50
45
  `
51
46
 
52
- const ToggleButton = styled('p', TextAttrs)`
47
+ const ToggleButton = styled('p', TextAttrs)`
53
48
  font-size: ${(props) => props.fontSize}px;
54
49
  cursor: pointer;
55
50
  color: ${(props) => props.theme.colors.blue};
56
51
  `
57
52
 
58
- export default {
59
- name: 'CollapsableInfoText',
60
- components: {
61
- Text,
62
- ToggleButton,
63
- ToggleContainer
53
+ export default {
54
+ name: 'collapsable-info-text',
55
+ props: {
56
+ text: {
57
+ type: String,
58
+ required: true
64
59
  },
65
- props: {
66
- text: {
67
- type: String,
68
- required: true
69
- },
70
- fontSize: {
71
- type: String,
72
- default: '16px'
73
- },
74
- lineCount: {
75
- type: Number,
76
- default: 3
77
- },
78
- minWidth: {
79
- type: String,
80
- default: '100%'
81
- }
60
+ fontSize: {
61
+ type: String,
62
+ default: '16px'
82
63
  },
83
- data() {
84
- return {
85
- showButton: true,
86
- showAll: false,
87
- lineBreaks: []
88
- }
64
+ lineCount: {
65
+ type: Number,
66
+ default: 3
89
67
  },
90
- computed: {
91
- theme() {
92
- return theme
68
+ minWidth: {
69
+ type: String,
70
+ default: '100%'
71
+ }
72
+ },
73
+ components: {
74
+ Text,
75
+ ToggleButton,
76
+ ToggleContainer
77
+ },
78
+ data() {
79
+ return {
80
+ showButton: true,
81
+ showAll: false,
82
+ lineBreaks: []
83
+ }
84
+ },
85
+ computed: {
86
+ theme() {
87
+ return theme
88
+ }
89
+ },
90
+ methods: {
91
+ displayText() {
92
+ if (!this.showButton) {
93
+ return this.text
93
94
  }
94
- },
95
- created() {
96
- // TODO: this should divide the text into lines based on with. Currently it's just splitting by line breaks
97
- // this.lineBreaks = this.text.split('\n')
98
-
99
- // if (this.lineBreaks.length <= this.lineCount) {
100
- // this.showButton = false
101
- // }
95
+ if (!this.showAll) {
96
+ let countIndex = 0
97
+ this.lineBreaks.forEach((el, index) => {
98
+ if (index < this.lineCount) {
99
+ countIndex += el.length
100
+ }
101
+ })
102
102
 
103
- if (this.text.length <= 170) {
104
- this.showButton = false
103
+ return this.text.slice(0, countIndex + 2) + '...'
104
+ } else {
105
+ return this.text
105
106
  }
106
107
  },
107
- methods: {
108
- displayText() {
109
- if (!this.showButton) {
110
- return this.text
111
- }
112
- if (!this.showAll) {
113
- let countIndex = 0
114
- this.lineBreaks.forEach((el, index) => {
115
- if (index < this.lineCount) {
116
- countIndex += el.length
117
- }
118
- })
108
+ toggleHandler() {
109
+ this.showAll = !this.showAll
110
+ }
111
+ },
112
+ created() {
113
+ // TODO: this should divide the text into lines based on with. Currently it's just splitting by line breaks
114
+ // this.lineBreaks = this.text.split('\n')
119
115
 
120
- return this.text.slice(0, countIndex + 2) + '...'
121
- } else {
122
- return this.text
123
- }
124
- },
125
- toggleHandler() {
126
- this.showAll = !this.showAll
127
- }
116
+ // if (this.lineBreaks.length <= this.lineCount) {
117
+ // this.showButton = false
118
+ // }
119
+
120
+ if (this.text.length <= 170) {
121
+ this.showButton = false
128
122
  }
129
123
  }
124
+ }
130
125
  </script>
@@ -1,22 +1,19 @@
1
1
  <template>
2
- <Wrapper :is-disabled="isDisabled">
3
- <DeleteIconRed
4
- class="icon-red"
5
- :hover-bg="hoverBg"
6
- />
7
- <DeleteIconGray class="icon-gray" />
8
- </Wrapper>
2
+ <wrapper :isDisabled="isDisabled">
3
+ <delete-icon-red class="icon-red" :hoverBg="hoverBg" />
4
+ <delete-icon-gray class="icon-gray" />
5
+ </wrapper>
9
6
  </template>
10
7
 
11
8
  <script>
12
9
  // To use:
13
10
  // <delete-icon @click="onDeleteItem(item)" :isDisabled="true" />
14
- import styled from 'vue3-styled-components'
15
- import SvgDelete from '../../assets/icons/delete_icon.svg'
16
- import SvgDeleteGray from '../../assets/icons/delete_icon_gray.svg'
11
+ import styled from 'vue3-styled-components'
12
+ import SvgDelete from '../../assets/icons/delete_icon.svg'
13
+ import SvgDeleteGray from '../../assets/icons/delete_icon_gray.svg'
17
14
 
18
- const wrapperAttrs = { isDisabled: Boolean }
19
- const Wrapper = styled('div', wrapperAttrs)`
15
+ const wrapperAttrs = { isDisabled: Boolean }
16
+ const Wrapper = styled('div', wrapperAttrs)`
20
17
  width: 30px;
21
18
  height: 30px;
22
19
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
@@ -44,38 +41,38 @@
44
41
  `}
45
42
  `
46
43
 
47
- const IconImageAttrs = { hoverBg: String }
48
- const DeleteIconRed = styled(SvgDelete, IconImageAttrs)`
44
+ const IconImageAttrs = { hoverBg: String }
45
+ const DeleteIconRed = styled(SvgDelete, IconImageAttrs)`
49
46
  &:hover {
50
47
  background-color: ${(props) =>
51
- props.hoverBg ? props.hoverBg : props.theme.colors.grey5};
48
+ props.hoverBg ? props.hoverBg : props.theme.colors.grey5};
52
49
  border-radius: 4px;
53
50
  }
54
51
  `
55
52
 
56
- const DeleteIconGray = styled(SvgDeleteGray, IconImageAttrs)`
53
+ const DeleteIconGray = styled(SvgDeleteGray, IconImageAttrs)`
57
54
  &:hover {
58
55
  background-color: ${(props) => props.theme.colors.grey5};
59
56
  border-radius: 4px;
60
57
  }
61
58
  `
62
59
 
63
- export default {
64
- name: 'DeleteIcon',
65
- components: {
66
- Wrapper,
67
- DeleteIconRed,
68
- DeleteIconGray
60
+ export default {
61
+ name: 'delete-icon',
62
+ components: {
63
+ Wrapper,
64
+ DeleteIconRed,
65
+ DeleteIconGray
66
+ },
67
+ props: {
68
+ isDisabled: {
69
+ required: false,
70
+ default: false
69
71
  },
70
- props: {
71
- isDisabled: {
72
- required: false,
73
- default: false
74
- },
75
- hoverBg: {
76
- required: false,
77
- default: ''
78
- }
72
+ hoverBg: {
73
+ required: false,
74
+ default: ''
79
75
  }
80
76
  }
77
+ }
81
78
  </script>
@@ -1,18 +1,15 @@
1
1
  <template>
2
- <Handle
3
- class="handle"
4
- :height="height"
5
- >
6
- <Dot />
7
- <Dot />
8
- <Dot />
2
+ <Handle :height="height" class="handle">
3
+ <Dot></Dot>
4
+ <Dot></Dot>
5
+ <Dot></Dot>
9
6
  </Handle>
10
7
  </template>
11
8
 
12
9
  <script>
13
- import styled from 'vue3-styled-components'
10
+ import styled from 'vue3-styled-components'
14
11
 
15
- const Handle = styled('div', { height: String })`
12
+ const Handle = styled('div', { height: String })`
16
13
  position: absolute;
17
14
  left: 0;
18
15
  margin-right: 10px;
@@ -27,7 +24,7 @@
27
24
  cursor: pointer;
28
25
  align-items: center;
29
26
  `
30
- const Dot = styled.div`
27
+ const Dot = styled.div`
31
28
  display: inline-block;
32
29
  width: 4px;
33
30
  height: 4px;
@@ -35,15 +32,15 @@
35
32
  background-color: #0068de;
36
33
  `
37
34
 
38
- export default {
39
- name: 'DraggableInputHandle',
40
- components: {
41
- Handle,
42
- Dot
43
- },
44
- props: ['height'],
45
- data() {
46
- return {}
47
- }
35
+ export default {
36
+ name: 'draggableInputHandle',
37
+ props: ['height'],
38
+ components: {
39
+ Handle,
40
+ Dot
41
+ },
42
+ data() {
43
+ return {}
48
44
  }
45
+ }
49
46
  </script>
@@ -38,17 +38,17 @@ const Template = (args, { argTypes }) => ({
38
38
 
39
39
  export const Default = Template.bind({})
40
40
  Default.args = {
41
- openingMode: "click",
42
- gap: "0px",
43
- justify: "left",
44
- width: "150px"
41
+ openingMode:"click",
42
+ gap:"0px",
43
+ justify:"left",
44
+ width:"150px"
45
45
  }
46
46
 
47
47
  export const withHover = Template.bind({})
48
48
  withHover.args = {
49
- openingMode: "hover",
50
- gap: "20px",
51
- justify: "right",
52
- width: "250px"
49
+ openingMode:"hover",
50
+ gap:"20px",
51
+ justify:"right",
52
+ width:"250px"
53
53
  }
54
54