@eturnity/eturnity_reusable_components 7.30.3-EPDM-10647.0 → 7.30.3-EPDM-10576.2

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 (82) hide show
  1. package/.eslintrc.js +184 -0
  2. package/.prettierrc +8 -6
  3. package/package.json +9 -21
  4. package/src/App.vue +79 -78
  5. package/src/assets/theme.js +3 -3
  6. package/src/components/addNewButton/AddNewButton.stories.js +2 -2
  7. package/src/components/addNewButton/index.vue +48 -51
  8. package/src/components/banner/actionBanner/index.vue +54 -55
  9. package/src/components/banner/banner/banner.stories.js +5 -5
  10. package/src/components/banner/banner/index.vue +159 -159
  11. package/src/components/banner/infoBanner/index.vue +41 -53
  12. package/src/components/buttons/buttonIcon/index.vue +125 -122
  13. package/src/components/buttons/closeButton/CloseButton.stories.js +3 -3
  14. package/src/components/buttons/closeButton/index.vue +49 -49
  15. package/src/components/buttons/mainButton/index.vue +108 -108
  16. package/src/components/card/index.vue +70 -70
  17. package/src/components/collapsableInfoText/index.vue +96 -94
  18. package/src/components/deleteIcon/DeleteIcon.stories.js +4 -4
  19. package/src/components/deleteIcon/index.vue +54 -54
  20. package/src/components/draggableInputHandle/index.vue +37 -37
  21. package/src/components/dropdown/Dropdown.stories.js +9 -10
  22. package/src/components/dropdown/index.vue +106 -106
  23. package/src/components/errorMessage/index.vue +52 -52
  24. package/src/components/filter/filterSettings.vue +486 -452
  25. package/src/components/filter/index.vue +135 -135
  26. package/src/components/filter/parentDropdown.vue +73 -73
  27. package/src/components/icon/Icons.stories.js +7 -7
  28. package/src/components/icon/iconCollection.vue +53 -53
  29. package/src/components/icon/index.vue +122 -122
  30. package/src/components/iconWrapper/index.vue +156 -156
  31. package/src/components/infoCard/index.vue +30 -32
  32. package/src/components/infoText/index.vue +142 -137
  33. package/src/components/inputs/checkbox/Checkbox.stories.js +8 -8
  34. package/src/components/inputs/checkbox/index.vue +190 -180
  35. package/src/components/inputs/inputNumber/InputNumber.stories.js +41 -41
  36. package/src/components/inputs/inputNumber/index.vue +696 -701
  37. package/src/components/inputs/inputNumberQuestion/index.vue +185 -182
  38. package/src/components/inputs/inputText/InputText.stories.js +22 -22
  39. package/src/components/inputs/inputText/index.vue +337 -336
  40. package/src/components/inputs/radioButton/RadioButton.stories.js +16 -16
  41. package/src/components/inputs/radioButton/index.vue +222 -219
  42. package/src/components/inputs/searchInput/SearchInput.stories.js +8 -8
  43. package/src/components/inputs/searchInput/index.vue +127 -126
  44. package/src/components/inputs/select/index.vue +792 -792
  45. package/src/components/inputs/select/option/index.vue +124 -124
  46. package/src/components/inputs/select/select.stories.js +31 -32
  47. package/src/components/inputs/slider/index.vue +99 -99
  48. package/src/components/inputs/switchField/index.vue +220 -222
  49. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +57 -57
  50. package/src/components/inputs/textAreaInput/index.vue +171 -173
  51. package/src/components/inputs/toggle/Toggle.stories.js +14 -14
  52. package/src/components/inputs/toggle/index.vue +214 -217
  53. package/src/components/label/index.vue +82 -82
  54. package/src/components/markerItem/index.vue +68 -66
  55. package/src/components/modals/actionModal/index.vue +54 -54
  56. package/src/components/modals/infoModal/index.vue +39 -36
  57. package/src/components/modals/modal/index.vue +134 -134
  58. package/src/components/modals/modal/modal.stories.js +5 -5
  59. package/src/components/navigationTabs/index.vue +96 -94
  60. package/src/components/pageSubtitle/index.vue +55 -49
  61. package/src/components/pageTitle/index.vue +56 -56
  62. package/src/components/pagination/index.vue +92 -89
  63. package/src/components/progressBar/index.vue +107 -107
  64. package/src/components/projectMarker/index.vue +246 -244
  65. package/src/components/rangeSlider/Slider.vue +491 -465
  66. package/src/components/rangeSlider/index.vue +410 -410
  67. package/src/components/rangeSlider/utils/dom.js +5 -5
  68. package/src/components/selectedOptions/index.vue +119 -119
  69. package/src/components/sideMenu/index.vue +199 -199
  70. package/src/components/spinner/index.vue +57 -57
  71. package/src/components/tableDropdown/index.vue +520 -520
  72. package/src/components/tables/mainTable/index.vue +417 -400
  73. package/src/components/tables/viewTable/index.vue +171 -171
  74. package/src/components/threeDots/index.vue +340 -334
  75. package/src/components/videoThumbnail/index.vue +86 -86
  76. package/src/components/videoThumbnail/videoThumbnail.stories.js +14 -16
  77. package/src/helpers/numberConverter.js +2 -2
  78. package/src/helpers/translateLang.js +9 -9
  79. package/src/mixins/inputValidations.js +5 -5
  80. package/public/favicon.ico +0 -0
  81. package/public/index.html +0 -17
  82. package/src/utils/index.js +0 -12
@@ -1,7 +1,7 @@
1
- import RadioButton from "./index.vue"
1
+ import RadioButton from './index.vue'
2
2
 
3
3
  export default {
4
- title: "RadioButton",
4
+ title: 'RadioButton',
5
5
  component: RadioButton,
6
6
  // argTypes: {},
7
7
  }
@@ -34,25 +34,25 @@ const Template = (args, { argTypes }) => ({
34
34
  export const Default = Template.bind({})
35
35
  Default.args = {
36
36
  options: [
37
- { label: "Button 1", value: "button_1", infoText: "my info text" },
38
- { label: "Button 2", value: "button_2", infoText: "my info text 2" },
39
- { label: "Button 3", value: "button_3", disabled: true },
40
- { label: "Button 4", value: "button_4", disabled: true },
37
+ { label: 'Button 1', value: 'button_1', infoText: 'my info text' },
38
+ { label: 'Button 2', value: 'button_2', infoText: 'my info text 2' },
39
+ { label: 'Button 3', value: 'button_3', disabled: true },
40
+ { label: 'Button 4', value: 'button_4', disabled: true },
41
41
  ],
42
- selectedOption: "button_2",
43
- layout: "horizontal",
44
- size: "medium",
42
+ selectedOption: 'button_2',
43
+ layout: 'horizontal',
44
+ size: 'medium',
45
45
  }
46
46
 
47
47
  export const VerticalLayout = Template.bind({})
48
48
  VerticalLayout.args = {
49
49
  options: [
50
- { label: "Button 1", value: "button_1" },
51
- { label: "Button 2", value: "button_2" },
52
- { label: "Button 3", value: "button_3" },
53
- { label: "Button 4", value: "button_4", disabled: true },
50
+ { label: 'Button 1', value: 'button_1' },
51
+ { label: 'Button 2', value: 'button_2' },
52
+ { label: 'Button 3', value: 'button_3' },
53
+ { label: 'Button 4', value: 'button_4', disabled: true },
54
54
  ],
55
- selectedOption: "button_2",
56
- layout: "vertical",
57
- size: "medium",
55
+ selectedOption: 'button_2',
56
+ layout: 'vertical',
57
+ size: 'medium',
58
58
  }
@@ -1,270 +1,273 @@
1
1
  <template>
2
- <component-wrapper :layout="layout">
3
- <radio-wrapper v-for="(item, index) in options" :key="item.value">
4
- <label-container
2
+ <ComponentWrapper :layout="layout">
3
+ <RadioWrapper v-for="(item, index) in options" :key="item.value">
4
+ <LabelContainer
5
+ :checkmark-color="checkmarkColor"
6
+ :has-label="!!item.label"
7
+ :is-checked="selectedOption === item.value"
8
+ :is-disabled="item.disabled"
5
9
  :size="size"
6
- :hasLabel="item.label"
7
- :isDisabled="item.disabled"
8
- :isChecked="selectedOption === item.value"
9
- :checkmarkColor="checkmarkColor"
10
10
  >
11
- <radio
11
+ <Radio
12
+ :checked="selectedOption === item.value"
13
+ :data-id="`radio_button_${dataId}_option_${item.value}`"
14
+ :disabled="item.disabled"
15
+ :name="'radioButtons_' + radioName"
12
16
  type="radio"
13
17
  :value="selectedOption"
14
18
  @click="onInputHandler(item.value)"
15
- :name="'radioButtons_' + radioName"
16
- :checked="selectedOption === item.value"
17
- :disabled="item.disabled"
18
- :data-id="`radio_button_${dataId}_option_${item.value}`"
19
19
  />
20
20
  <span class="checkmark"></span>
21
- <label-text :isDisabled="item.disabled" v-if="item.label">{{ item.label }}</label-text>
22
- <info-text v-if="item.infoText" :text="item.infoText" size="16px" />
23
- </label-container>
24
- <image-container v-if="item.img">
25
- <radio-image :src="item.img" />
21
+ <LabelText v-if="item.label" :is-disabled="item.disabled">
22
+ {{ item.label }}
23
+ </LabelText>
24
+ <InfoText v-if="item.infoText" size="16px" :text="item.infoText" />
25
+ </LabelContainer>
26
+ <ImageContainer v-if="item.img">
27
+ <RadioImage :src="item.img" />
26
28
  <div class="search-icn-container" @click="toggleImageModal(index)">
27
29
  <img
28
30
  class="search-icn"
29
31
  :src="require('../../../assets/icons/search_icon.png')"
30
32
  />
31
33
  </div>
32
- </image-container>
33
- <modal
34
+ </ImageContainer>
35
+ <Modal
34
36
  v-if="item.img"
35
- :isOpen="isImageOpen(index)"
37
+ :is-open="isImageOpen(index)"
36
38
  @on-close="toggleImageModal(null)"
37
39
  >
38
- <modal-image-container>
39
- <modal-image :src="item.img" />
40
- </modal-image-container>
41
- </modal>
42
- </radio-wrapper>
43
- </component-wrapper>
40
+ <ModalImageContainer>
41
+ <ModalImage :src="item.img" />
42
+ </ModalImageContainer>
43
+ </Modal>
44
+ </RadioWrapper>
45
+ </ComponentWrapper>
44
46
  </template>
45
47
 
46
48
  <script>
47
- // import RadioButton from "@eturnity/eturnity_reusable_components/src/components/inputs/radioButton"
48
- // To use:
49
- // <radio-button
50
- // :options="radioOptions"
51
- // :selectedOption="checkedOption"
52
- // @on-radio-change="onInputChange($event)"
53
- // layout="vertical"
54
- // size="large"
55
- // />
56
- // Data being passed should look like:
57
- // radioOptions: [
58
- // { label: 'Button 1', value: 'button_1', img: 'www.imagesrc.com', infoText: 'my info text' },
59
- // { label: 'Button 2', value: 'button_2', img: 'www.imagesrc.com', infoText: 'my info text 2' },
60
- // { label: 'Button 3', value: 'button_3', img: 'www.imagesrc.com', disabled: true },
61
- // { label: 'Button 4', value: 'button_4', disabled: true }
62
- // ]
49
+ // import RadioButton from "@eturnity/eturnity_reusable_components/src/components/inputs/radioButton"
50
+ // To use:
51
+ // <radio-button
52
+ // :options="radioOptions"
53
+ // :selectedOption="checkedOption"
54
+ // @on-radio-change="onInputChange($event)"
55
+ // layout="vertical"
56
+ // size="large"
57
+ // />
58
+ // Data being passed should look like:
59
+ // radioOptions: [
60
+ // { label: 'Button 1', value: 'button_1', img: 'www.imagesrc.com', infoText: 'my info text' },
61
+ // { label: 'Button 2', value: 'button_2', img: 'www.imagesrc.com', infoText: 'my info text 2' },
62
+ // { label: 'Button 3', value: 'button_3', img: 'www.imagesrc.com', disabled: true },
63
+ // { label: 'Button 4', value: 'button_4', disabled: true }
64
+ // ]
63
65
 
64
- import styled from 'vue3-styled-components'
65
- import Modal from '../../modals/modal'
66
- import InfoText from '../../infoText'
66
+ import styled from 'vue3-styled-components'
67
+ import Modal from '../../modals/modal'
68
+ import InfoText from '../../infoText'
67
69
 
68
- const wrapperProps = {
69
- layout: String
70
- }
71
- const ComponentWrapper = styled('div', wrapperProps)`
72
- display: flex;
73
- flex-direction: ${(props) =>
74
- props.layout === 'vertical' ? 'column' : 'row'};
75
- grid-gap: 10px 5px;
76
- flex-wrap: wrap;
77
- `
78
-
79
- const Radio = styled.input`
80
- cursor: pointer;
81
- position: absolute;
82
- opacity: 0;
83
- cursor: pointer;
84
- height: 0;
85
- width: 0;
86
- `
70
+ const wrapperProps = {
71
+ layout: String,
72
+ }
73
+ const ComponentWrapper = styled('div', wrapperProps)`
74
+ display: flex;
75
+ flex-direction: ${(props) =>
76
+ props.layout === 'vertical' ? 'column' : 'row'};
77
+ grid-gap: 10px 5px;
78
+ flex-wrap: wrap;
79
+ `
87
80
 
88
- const RadioWrapper = styled.div`
89
- display: grid;
90
- grid-gap: 10px;
91
- `
81
+ const Radio = styled.input`
82
+ cursor: pointer;
83
+ position: absolute;
84
+ opacity: 0;
85
+ cursor: pointer;
86
+ height: 0;
87
+ width: 0;
88
+ `
92
89
 
93
- const containerProps = {
94
- size: String,
95
- isDisabled: Boolean,
96
- isChecked: Boolean,
97
- checkmarkColor: String
98
- }
99
- const LabelContainer = styled('label', containerProps)`
100
- display: grid;
101
- grid-template-columns: auto 1fr auto;
102
- grid-gap: ${(props) =>
103
- props.hasLabel
104
- ? '15px' : 0 };
105
- align-items: center;
106
- color: ${(props) =>
107
- props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
108
- position: relative;
109
- cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
110
- font-size: ${(props) =>
111
- props.size === 'large'
112
- ? '16px'
113
- : props.size === 'medium'
114
- ? '13px'
115
- : '10px'};
116
- user-select: none;
117
- flex: auto;
118
- align-self: baseline;
90
+ const RadioWrapper = styled.div`
91
+ display: grid;
92
+ grid-gap: 10px;
93
+ `
119
94
 
120
- .checkmark {
121
- height: ${(props) =>
95
+ const containerProps = {
96
+ size: String,
97
+ isDisabled: Boolean,
98
+ isChecked: Boolean,
99
+ checkmarkColor: String,
100
+ hasLabel: Boolean,
101
+ }
102
+ const LabelContainer = styled('label', containerProps)`
103
+ display: grid;
104
+ grid-template-columns: auto 1fr auto;
105
+ grid-gap: ${(props) => (props.hasLabel ? '15px' : 0)};
106
+ align-items: center;
107
+ color: ${(props) =>
108
+ props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
109
+ position: relative;
110
+ cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
111
+ font-size: ${(props) =>
122
112
  props.size === 'large'
123
- ? '23px'
124
- : props.size === 'medium'
125
113
  ? '16px'
126
- : '12px'};
127
- width: ${(props) =>
128
- props.size === 'large'
129
- ? '23px'
130
114
  : props.size === 'medium'
131
- ? '16px'
132
- : '12px'};
133
- background-color: #fff;
134
- border-radius: 100%;
135
- border: 1px solid ${(props) => props.theme.colors.mediumGray};
136
- display: flex;
137
- align-items: center;
138
- justify-content: center;
115
+ ? '13px'
116
+ : '10px'};
117
+ user-select: none;
118
+ flex: auto;
119
+ align-self: baseline;
139
120
 
140
- &:after {
141
- content: '';
142
- display: ${(props) => (props.isChecked ? 'block' : 'none')};
143
- width: ${(props) =>
121
+ .checkmark {
122
+ height: ${(props) =>
144
123
  props.size === 'large'
145
- ? '10px'
124
+ ? '23px'
146
125
  : props.size === 'medium'
147
- ? '8px'
148
- : '6px'};
149
- height: ${(props) =>
126
+ ? '16px'
127
+ : '12px'};
128
+ width: ${(props) =>
150
129
  props.size === 'large'
151
- ? '10px'
130
+ ? '23px'
152
131
  : props.size === 'medium'
153
- ? '8px'
154
- : '6px'};
132
+ ? '16px'
133
+ : '12px'};
134
+ background-color: #fff;
155
135
  border-radius: 100%;
156
- background: ${(props) =>
157
- props.checkmarkColor ? props.checkmarkColor : props.theme.colors.green};
158
- }
159
- }
160
- `
136
+ border: 1px solid ${(props) => props.theme.colors.mediumGray};
137
+ display: flex;
138
+ align-items: center;
139
+ justify-content: center;
161
140
 
162
- const textAttrs = { isDisabled: Boolean }
163
- const LabelText = styled('div', textAttrs)`
164
- color: ${(props) =>
165
- props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
166
- `
141
+ &:after {
142
+ content: '';
143
+ display: ${(props) => (props.isChecked ? 'block' : 'none')};
144
+ width: ${(props) =>
145
+ props.size === 'large'
146
+ ? '10px'
147
+ : props.size === 'medium'
148
+ ? '8px'
149
+ : '6px'};
150
+ height: ${(props) =>
151
+ props.size === 'large'
152
+ ? '10px'
153
+ : props.size === 'medium'
154
+ ? '8px'
155
+ : '6px'};
156
+ border-radius: 100%;
157
+ background: ${(props) =>
158
+ props.checkmarkColor
159
+ ? props.checkmarkColor
160
+ : props.theme.colors.green};
161
+ }
162
+ }
163
+ `
167
164
 
168
- const RadioImage = styled.img`
169
- max-width: 100px;
170
- `
165
+ const textAttrs = { isDisabled: Boolean }
166
+ const LabelText = styled('div', textAttrs)`
167
+ color: ${(props) =>
168
+ props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
169
+ `
171
170
 
172
- const ImageContainer = styled.div`
173
- border-radius: 4px;
174
- cursor: pointer;
175
- display: grid;
176
- align-items: center;
177
- justify-items: center;
178
- position: relative;
171
+ const RadioImage = styled.img`
172
+ max-width: 100px;
173
+ `
179
174
 
180
- .search-icn-container {
181
- display: none;
182
- }
175
+ const ImageContainer = styled.div`
176
+ border-radius: 4px;
177
+ cursor: pointer;
178
+ display: grid;
179
+ align-items: center;
180
+ justify-items: center;
181
+ position: relative;
183
182
 
184
- &:hover {
185
183
  .search-icn-container {
186
- display: grid;
187
- position: absolute;
188
- background: rgba(0, 0, 0, 0.4);
189
- width: 100%;
190
- height: 100%;
191
- align-items: center;
192
- justify-items: center;
184
+ display: none;
193
185
  }
194
- }
195
- `
196
186
 
197
- const ModalImage = styled.img``
187
+ &:hover {
188
+ .search-icn-container {
189
+ display: grid;
190
+ position: absolute;
191
+ background: rgba(0, 0, 0, 0.4);
192
+ width: 100%;
193
+ height: 100%;
194
+ align-items: center;
195
+ justify-items: center;
196
+ }
197
+ }
198
+ `
198
199
 
199
- const ModalImageContainer = styled.div`
200
- padding: 40px;
201
- `
200
+ const ModalImage = styled.img``
202
201
 
203
- export default {
204
- name: 'radio-button',
205
- components: {
206
- Radio,
207
- ComponentWrapper,
208
- LabelContainer,
209
- RadioWrapper,
210
- RadioImage,
211
- ImageContainer,
212
- Modal,
213
- ModalImage,
214
- ModalImageContainer,
215
- InfoText,
216
- LabelText
217
- },
218
- props: {
219
- selectedOption: {
220
- required: true,
221
- default: false
222
- },
223
- options: {
224
- required: true,
225
- default: []
226
- },
227
- layout: {
228
- required: false,
229
- default: 'horizontal' //2 options: 'vertical' (only 1 per row) & 'horizontal' (many per row)
230
- },
231
- size: {
232
- required: false,
233
- default: 'medium' // small, medium, large
202
+ const ModalImageContainer = styled.div`
203
+ padding: 40px;
204
+ `
205
+
206
+ export default {
207
+ name: 'RadioButton',
208
+ components: {
209
+ Radio,
210
+ ComponentWrapper,
211
+ LabelContainer,
212
+ RadioWrapper,
213
+ RadioImage,
214
+ ImageContainer,
215
+ Modal,
216
+ ModalImage,
217
+ ModalImageContainer,
218
+ InfoText,
219
+ LabelText,
234
220
  },
235
- name: {
236
- required: false,
237
- default: ''
221
+ props: {
222
+ selectedOption: {
223
+ required: true,
224
+ default: false,
225
+ },
226
+ options: {
227
+ required: true,
228
+ default: [],
229
+ },
230
+ layout: {
231
+ required: false,
232
+ default: 'horizontal', //2 options: 'vertical' (only 1 per row) & 'horizontal' (many per row)
233
+ },
234
+ size: {
235
+ required: false,
236
+ default: 'medium', // small, medium, large
237
+ },
238
+ name: {
239
+ required: false,
240
+ default: '',
241
+ },
242
+ checkmarkColor: {
243
+ required: false,
244
+ default: '',
245
+ },
246
+ dataId: {
247
+ type: String,
248
+ default: 'key',
249
+ },
238
250
  },
239
- checkmarkColor: {
240
- required: false,
241
- default: ''
251
+ data() {
252
+ return {
253
+ selectedImage: null,
254
+ radioName: '',
255
+ }
242
256
  },
243
- dataId: {
244
- type: String,
245
- default: 'key'
246
- }
247
- },
248
- data() {
249
- return {
250
- selectedImage: null,
251
- radioName: ''
252
- }
253
- },
254
- methods: {
255
- onInputHandler(value) {
256
- this.$emit('on-radio-change', value)
257
+ created() {
258
+ this.radioName =
259
+ this.name.length === 0 ? Math.round(Math.random() * 10000) : this.name
257
260
  },
258
- isImageOpen(index) {
259
- return this.selectedImage === index
261
+ methods: {
262
+ onInputHandler(value) {
263
+ this.$emit('on-radio-change', value)
264
+ },
265
+ isImageOpen(index) {
266
+ return this.selectedImage === index
267
+ },
268
+ toggleImageModal(value) {
269
+ this.selectedImage = value
270
+ },
260
271
  },
261
- toggleImageModal(value) {
262
- this.selectedImage = value
263
- }
264
- },
265
- created() {
266
- this.radioName =
267
- this.name.length === 0 ? Math.round(Math.random() * 10000) : this.name
268
272
  }
269
- }
270
273
  </script>
@@ -1,7 +1,7 @@
1
- import SearchInput from "./index.vue"
1
+ import SearchInput from './index.vue'
2
2
 
3
3
  export default {
4
- title: "SearchInput",
4
+ title: 'SearchInput',
5
5
  component: SearchInput,
6
6
  // argTypes: {},
7
7
  }
@@ -25,16 +25,16 @@ const Template = (args, { argTypes }) => ({
25
25
 
26
26
  export const Default = Template.bind({})
27
27
  Default.args = {
28
- placeholder: "Search...",
28
+ placeholder: 'Search...',
29
29
  disabled: false,
30
- value: "",
31
- inputWidth: "250px",
30
+ value: '',
31
+ inputWidth: '250px',
32
32
  }
33
33
 
34
34
  export const Disabled = Template.bind({})
35
35
  Disabled.args = {
36
- placeholder: "Search...",
36
+ placeholder: 'Search...',
37
37
  disabled: true,
38
- value: "",
39
- inputWidth: "250px",
38
+ value: '',
39
+ inputWidth: '250px',
40
40
  }