@eturnity/eturnity_reusable_components 7.24.3-EPDM-11250.0 → 7.24.3-EPDM-11320.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.
Files changed (68) hide show
  1. package/.eslintrc.js +125 -0
  2. package/package.json +6 -20
  3. package/src/App.vue +75 -70
  4. package/src/components/addNewButton/index.vue +24 -27
  5. package/src/components/banner/actionBanner/index.vue +32 -30
  6. package/src/components/banner/banner/index.vue +88 -80
  7. package/src/components/banner/infoBanner/index.vue +36 -44
  8. package/src/components/buttons/buttonIcon/index.vue +83 -78
  9. package/src/components/buttons/closeButton/index.vue +26 -26
  10. package/src/components/buttons/mainButton/index.vue +80 -76
  11. package/src/components/card/index.vue +56 -52
  12. package/src/components/collapsableInfoText/index.vue +81 -76
  13. package/src/components/deleteIcon/index.vue +31 -28
  14. package/src/components/draggableInputHandle/index.vue +20 -17
  15. package/src/components/dropdown/Dropdown.stories.js +8 -8
  16. package/src/components/dropdown/index.vue +75 -72
  17. package/src/components/errorMessage/index.vue +23 -23
  18. package/src/components/filter/filterSettings.vue +349 -329
  19. package/src/components/filter/index.vue +130 -130
  20. package/src/components/filter/parentDropdown.vue +43 -40
  21. package/src/components/icon/Icons.stories.js +4 -4
  22. package/src/components/icon/iconCache.js +1 -1
  23. package/src/components/icon/iconCollection.vue +40 -37
  24. package/src/components/icon/index.vue +72 -65
  25. package/src/components/iconWrapper/index.vue +122 -118
  26. package/src/components/infoCard/index.vue +20 -17
  27. package/src/components/infoText/index.vue +88 -82
  28. package/src/components/inputs/checkbox/index.vue +91 -94
  29. package/src/components/inputs/inputNumber/index.vue +508 -488
  30. package/src/components/inputs/inputNumberQuestion/index.vue +127 -124
  31. package/src/components/inputs/inputText/index.vue +265 -252
  32. package/src/components/inputs/radioButton/index.vue +135 -120
  33. package/src/components/inputs/searchInput/index.vue +84 -81
  34. package/src/components/inputs/select/index.vue +644 -631
  35. package/src/components/inputs/select/option/index.vue +91 -91
  36. package/src/components/inputs/select/select.stories.js +7 -7
  37. package/src/components/inputs/slider/index.vue +46 -46
  38. package/src/components/inputs/switchField/index.vue +159 -152
  39. package/src/components/inputs/textAreaInput/index.vue +120 -113
  40. package/src/components/inputs/toggle/index.vue +137 -127
  41. package/src/components/label/index.vue +64 -61
  42. package/src/components/markerItem/index.vue +40 -40
  43. package/src/components/modals/actionModal/index.vue +32 -29
  44. package/src/components/modals/infoModal/index.vue +34 -27
  45. package/src/components/modals/modal/index.vue +88 -80
  46. package/src/components/navigationTabs/index.vue +50 -47
  47. package/src/components/pageSubtitle/index.vue +33 -29
  48. package/src/components/pageTitle/index.vue +47 -39
  49. package/src/components/pagination/index.vue +64 -62
  50. package/src/components/progressBar/index.vue +70 -67
  51. package/src/components/projectMarker/index.vue +172 -163
  52. package/src/components/rangeSlider/Slider.vue +449 -449
  53. package/src/components/rangeSlider/index.vue +282 -270
  54. package/src/components/rangeSlider/utils/dom.js +3 -3
  55. package/src/components/selectedOptions/index.vue +51 -51
  56. package/src/components/sideMenu/index.vue +117 -109
  57. package/src/components/spinner/index.vue +37 -34
  58. package/src/components/tableDropdown/index.vue +343 -326
  59. package/src/components/tables/mainTable/index.vue +109 -106
  60. package/src/components/tables/viewTable/index.vue +105 -92
  61. package/src/components/threeDots/index.vue +174 -171
  62. package/src/components/videoThumbnail/index.vue +67 -59
  63. package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
  64. package/src/helpers/numberConverter.js +1 -3
  65. package/src/helpers/translateLang.js +10 -13
  66. package/.prettierrc +0 -7
  67. package/public/favicon.ico +0 -0
  68. package/public/index.html +0 -17
@@ -1,21 +1,25 @@
1
1
  <template>
2
- <page-container>
3
- <button-container
2
+ <PageContainer>
3
+ <ButtonContainer
4
4
  :id="id"
5
- :type="type"
6
- :minWidth="minWidth"
7
- :isDisabled="isDisabled"
8
- :customColor="customColor"
9
- :noWrap="noWrap"
5
+ :custom-color="customColor"
10
6
  :data-id="dataId"
11
- :fontColor="fontColor"
7
+ :font-color="fontColor"
8
+ :is-disabled="isDisabled"
9
+ :min-width="minWidth"
10
+ :no-wrap="noWrap"
11
+ :type="type"
12
12
  >
13
- <Label :hasIcon="Boolean(icon)">
14
- <icon v-if="icon" :name="icon" size="14px" />
13
+ <Label :has-icon="Boolean(icon)">
14
+ <Icon
15
+ v-if="icon"
16
+ :name="icon"
17
+ size="14px"
18
+ />
15
19
  {{ text }}
16
20
  </Label>
17
- </button-container>
18
- </page-container>
21
+ </ButtonContainer>
22
+ </PageContainer>
19
23
  </template>
20
24
 
21
25
  <script>
@@ -31,24 +35,24 @@
31
35
  // :data-id="test_data_id"
32
36
  // />
33
37
 
34
- import styled from 'vue3-styled-components'
35
- import Icon from '../../icon'
38
+ import styled from 'vue3-styled-components'
39
+ import Icon from '../../icon'
36
40
 
37
- const PageContainer = styled.div``
41
+ const PageContainer = styled.div``
38
42
 
39
- const ButtonAttrs = {
40
- type: String,
41
- isDisabled: Boolean,
42
- minWidth: String,
43
- customColor: String,
44
- fontColor: String,
45
- noWrap: Boolean
46
- }
47
- const ButtonContainer = styled('div', ButtonAttrs)`
43
+ const ButtonAttrs = {
44
+ type: String,
45
+ isDisabled: Boolean,
46
+ minWidth: String,
47
+ customColor: String,
48
+ fontColor: String,
49
+ noWrap: Boolean
50
+ }
51
+ const ButtonContainer = styled('div', ButtonAttrs)`
48
52
  padding: 7px 15px;
49
53
  font-size: 13px;
50
54
  color: ${(props) =>
51
- props.fontColor ? props.fontColor : props.theme.colors.white};
55
+ props.fontColor ? props.fontColor : props.theme.colors.white};
52
56
  background-color: ${(props) =>
53
57
  props.isDisabled
54
58
  ? props.theme.colors.disabled
@@ -60,7 +64,7 @@ const ButtonContainer = styled('div', ButtonAttrs)`
60
64
  ? props.theme.colors.grey3
61
65
  : props.type === 'cancel'
62
66
  ? props.theme.colors.red
63
- : props.theme.colors.black};
67
+ : props.theme.colors.black};
64
68
  border-radius: 4px;
65
69
  text-align: center;
66
70
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
@@ -77,64 +81,64 @@ const ButtonContainer = styled('div', ButtonAttrs)`
77
81
  }
78
82
  `
79
83
 
80
- const LabelAttrs = {
81
- hasIcon: Boolean
82
- }
84
+ const LabelAttrs = {
85
+ hasIcon: Boolean
86
+ }
83
87
 
84
- const Label = styled('span', LabelAttrs)`
88
+ const Label = styled('span', LabelAttrs)`
85
89
  display: flex;
86
90
  align-items: center;
87
91
  justify-content: center;
88
92
  gap: ${(props) => (props.hasIcon ? '5px' : '0')};
89
93
  `
90
94
 
91
- export default {
92
- name: 'main-button',
93
- components: {
94
- Icon,
95
- Label,
96
- PageContainer,
97
- ButtonContainer
98
- },
99
- props: {
100
- type: {
101
- required: false,
102
- default: 'primary'
103
- },
104
- isDisabled: {
105
- required: false,
106
- default: false
107
- },
108
- icon: {
109
- required: false,
110
- default: null
111
- },
112
- text: {
113
- required: true
114
- },
115
- customColor: {
116
- required: false,
117
- default: null
118
- },
119
- fontColor: {
120
- required: false
121
- },
122
- noWrap: {
123
- required: false,
124
- default: false
125
- },
126
- minWidth: {
127
- required: false,
128
- default: null
129
- },
130
- id: {
131
- required: false,
132
- default: null
95
+ export default {
96
+ name: 'MainButton',
97
+ components: {
98
+ Icon,
99
+ Label,
100
+ PageContainer,
101
+ ButtonContainer
133
102
  },
134
- dataId: {
135
- type: String,
136
- default: ''
103
+ props: {
104
+ type: {
105
+ required: false,
106
+ default: 'primary'
107
+ },
108
+ isDisabled: {
109
+ required: false,
110
+ default: false
111
+ },
112
+ icon: {
113
+ required: false,
114
+ default: null
115
+ },
116
+ text: {
117
+ required: true
118
+ },
119
+ customColor: {
120
+ required: false,
121
+ default: null
122
+ },
123
+ fontColor: {
124
+ required: false
125
+ },
126
+ noWrap: {
127
+ required: false,
128
+ default: false
129
+ },
130
+ minWidth: {
131
+ required: false,
132
+ default: null
133
+ },
134
+ id: {
135
+ required: false,
136
+ default: null
137
+ },
138
+ dataId: {
139
+ type: String,
140
+ default: ''
141
+ }
137
142
  }
138
143
  }
139
- }
140
144
  </script>
@@ -2,17 +2,21 @@
2
2
  <Wrapper
3
3
  v-show="!isLoading"
4
4
  :class="viewCardClass"
5
+ :min-width="minWidth"
5
6
  :width="width"
6
- :minWidth="minWidth"
7
7
  >
8
- <Spinner v-if="isLoading" size="50px" :limitedToModal="true" />
8
+ <Spinner
9
+ v-if="isLoading"
10
+ :limited-to-modal="true"
11
+ size="50px"
12
+ />
9
13
  <CardWrapper v-else>
10
14
  <CardTitle :class="titleClass">
11
15
  {{ $gettext(title) }}
12
- <et-popover
16
+ <EtPopover
13
17
  v-if="showPopover && popoverText !== ''"
14
18
  :text="popoverText"
15
- ></et-popover>
19
+ />
16
20
  </CardTitle>
17
21
  <slot></slot>
18
22
  </CardWrapper>
@@ -20,11 +24,11 @@
20
24
  </template>
21
25
 
22
26
  <script>
23
- import styled from 'vue3-styled-components'
24
- import Spinner from '../spinner'
27
+ import styled from 'vue3-styled-components'
28
+ import Spinner from '../spinner'
25
29
 
26
- const WrapperProps = { width: [Number, String], minWidth: [Number, String] }
27
- const Wrapper = styled('div', WrapperProps)`
30
+ const WrapperProps = { width: [Number, String], minWidth: [Number, String] }
31
+ const Wrapper = styled('div', WrapperProps)`
28
32
  max-width: ${(props) => props.width};
29
33
  min-width: ${(props) => props.minWidth};
30
34
  padding: 20px;
@@ -35,12 +39,12 @@ const Wrapper = styled('div', WrapperProps)`
35
39
  height: 100%;
36
40
  `
37
41
 
38
- const CardWrapper = styled('div')`
42
+ const CardWrapper = styled('div')`
39
43
  height: 100%;
40
44
  width: auto;
41
45
  `
42
46
 
43
- const CardTitle = styled('p')`
47
+ const CardTitle = styled('p')`
44
48
  font-size: 14px;
45
49
  line-height: 1;
46
50
  color: ${(props) => props.theme.colors.black};
@@ -48,49 +52,49 @@ const CardTitle = styled('p')`
48
52
  margin-bottom: 10px;
49
53
  `
50
54
 
51
- export default {
52
- name: 'Card',
53
- props: {
54
- title: {
55
- type: String,
56
- default: ''
55
+ export default {
56
+ name: 'Card',
57
+ components: {
58
+ Spinner,
59
+ Wrapper,
60
+ CardTitle,
61
+ CardWrapper
57
62
  },
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
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
+ }
87
98
  }
88
- },
89
- components: {
90
- Spinner,
91
- Wrapper,
92
- CardTitle,
93
- CardWrapper
94
99
  }
95
- }
96
100
  </script>
@@ -1,18 +1,23 @@
1
1
  <template>
2
2
  <div>
3
- <Text :expand="showButton && showAll" :fontSize="fontSize">{{ text }}</Text>
3
+ <Text
4
+ :expand="showButton && showAll"
5
+ :font-size="fontSize"
6
+ >
7
+ {{ text }}
8
+ </Text>
4
9
  <ToggleContainer>
5
10
  <ToggleButton
6
- @click="toggleHandler"
7
11
  v-if="showButton && !showAll"
8
- :fontSize="fontSize"
12
+ :font-size="fontSize"
13
+ @click="toggleHandler"
9
14
  >
10
15
  {{ $gettext('Show more') }}
11
16
  </ToggleButton>
12
17
  <ToggleButton
13
- @click="toggleHandler"
14
18
  v-if="showButton && showAll"
15
- :fontSize="fontSize"
19
+ :font-size="fontSize"
20
+ @click="toggleHandler"
16
21
  >
17
22
  {{ $gettext('Show less') }}
18
23
  </ToggleButton>
@@ -21,14 +26,14 @@
21
26
  </template>
22
27
 
23
28
  <script>
24
- import styled from 'vue3-styled-components'
25
- import theme from '@/assets/theme.js'
29
+ import styled from 'vue3-styled-components'
30
+ import theme from '@/assets/theme.js'
26
31
 
27
- const TextAttrs = {
28
- expand: Boolean,
29
- fontSize: String
30
- }
31
- const Text = styled('p', TextAttrs)`
32
+ const TextAttrs = {
33
+ expand: Boolean,
34
+ fontSize: String
35
+ }
36
+ const Text = styled('p', TextAttrs)`
32
37
  display: block;
33
38
  display: -webkit-box;
34
39
  line-height: 1.3em;
@@ -39,87 +44,87 @@ const Text = styled('p', TextAttrs)`
39
44
  text-overflow: ellipsis;
40
45
  `
41
46
 
42
- const ToggleContainer = styled.div`
47
+ const ToggleContainer = styled.div`
43
48
  display: flex;
44
49
  width: 100%;
45
50
  `
46
51
 
47
- const ToggleButton = styled('p', TextAttrs)`
52
+ const ToggleButton = styled('p', TextAttrs)`
48
53
  font-size: ${(props) => props.fontSize}px;
49
54
  cursor: pointer;
50
55
  color: ${(props) => props.theme.colors.blue};
51
56
  `
52
57
 
53
- export default {
54
- name: 'collapsable-info-text',
55
- props: {
56
- text: {
57
- type: String,
58
- required: true
58
+ export default {
59
+ name: 'CollapsableInfoText',
60
+ components: {
61
+ Text,
62
+ ToggleButton,
63
+ ToggleContainer
59
64
  },
60
- fontSize: {
61
- type: String,
62
- default: '16px'
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
+ }
63
82
  },
64
- lineCount: {
65
- type: Number,
66
- default: 3
83
+ data() {
84
+ return {
85
+ showButton: true,
86
+ showAll: false,
87
+ lineBreaks: []
88
+ }
67
89
  },
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
90
+ computed: {
91
+ theme() {
92
+ return theme
94
93
  }
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
- })
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
+ // }
102
102
 
103
- return this.text.slice(0, countIndex + 2) + '...'
104
- } else {
105
- return this.text
103
+ if (this.text.length <= 170) {
104
+ this.showButton = false
106
105
  }
107
106
  },
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')
115
-
116
- // if (this.lineBreaks.length <= this.lineCount) {
117
- // this.showButton = false
118
- // }
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
+ })
119
119
 
120
- if (this.text.length <= 170) {
121
- this.showButton = false
120
+ return this.text.slice(0, countIndex + 2) + '...'
121
+ } else {
122
+ return this.text
123
+ }
124
+ },
125
+ toggleHandler() {
126
+ this.showAll = !this.showAll
127
+ }
122
128
  }
123
129
  }
124
- }
125
130
  </script>
@@ -1,19 +1,22 @@
1
1
  <template>
2
- <wrapper :isDisabled="isDisabled">
3
- <delete-icon-red class="icon-red" :hoverBg="hoverBg" />
4
- <delete-icon-gray class="icon-gray" />
5
- </wrapper>
2
+ <Wrapper :is-disabled="isDisabled">
3
+ <DeleteIconRed
4
+ class="icon-red"
5
+ :hover-bg="hoverBg"
6
+ />
7
+ <DeleteIconGray class="icon-gray" />
8
+ </Wrapper>
6
9
  </template>
7
10
 
8
11
  <script>
9
12
  // To use:
10
13
  // <delete-icon @click="onDeleteItem(item)" :isDisabled="true" />
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'
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'
14
17
 
15
- const wrapperAttrs = { isDisabled: Boolean }
16
- const Wrapper = styled('div', wrapperAttrs)`
18
+ const wrapperAttrs = { isDisabled: Boolean }
19
+ const Wrapper = styled('div', wrapperAttrs)`
17
20
  width: 30px;
18
21
  height: 30px;
19
22
  cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
@@ -41,38 +44,38 @@ const Wrapper = styled('div', wrapperAttrs)`
41
44
  `}
42
45
  `
43
46
 
44
- const IconImageAttrs = { hoverBg: String }
45
- const DeleteIconRed = styled(SvgDelete, IconImageAttrs)`
47
+ const IconImageAttrs = { hoverBg: String }
48
+ const DeleteIconRed = styled(SvgDelete, IconImageAttrs)`
46
49
  &:hover {
47
50
  background-color: ${(props) =>
48
- props.hoverBg ? props.hoverBg : props.theme.colors.grey5};
51
+ props.hoverBg ? props.hoverBg : props.theme.colors.grey5};
49
52
  border-radius: 4px;
50
53
  }
51
54
  `
52
55
 
53
- const DeleteIconGray = styled(SvgDeleteGray, IconImageAttrs)`
56
+ const DeleteIconGray = styled(SvgDeleteGray, IconImageAttrs)`
54
57
  &:hover {
55
58
  background-color: ${(props) => props.theme.colors.grey5};
56
59
  border-radius: 4px;
57
60
  }
58
61
  `
59
62
 
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
63
+ export default {
64
+ name: 'DeleteIcon',
65
+ components: {
66
+ Wrapper,
67
+ DeleteIconRed,
68
+ DeleteIconGray
71
69
  },
72
- hoverBg: {
73
- required: false,
74
- default: ''
70
+ props: {
71
+ isDisabled: {
72
+ required: false,
73
+ default: false
74
+ },
75
+ hoverBg: {
76
+ required: false,
77
+ default: ''
78
+ }
75
79
  }
76
80
  }
77
- }
78
81
  </script>