@eturnity/eturnity_reusable_components 7.24.3-EPDM-10647.1 → 7.24.3-EPDM-11320.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 +119 -119
  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 +439 -433
  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 +121 -121
  30. package/src/components/iconWrapper/index.vue +156 -156
  31. package/src/components/infoCard/index.vue +26 -26
  32. package/src/components/infoText/index.vue +133 -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 +647 -723
  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 +221 -219
  42. package/src/components/inputs/searchInput/SearchInput.stories.js +8 -8
  43. package/src/components/inputs/searchInput/index.vue +126 -126
  44. package/src/components/inputs/select/index.vue +780 -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 +366 -362
  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,272 @@
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
+ }
101
+ const LabelContainer = styled('label', containerProps)`
102
+ display: grid;
103
+ grid-template-columns: auto 1fr auto;
104
+ grid-gap: ${(props) => (props.hasLabel ? '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) =>
122
111
  props.size === 'large'
123
- ? '23px'
124
- : props.size === 'medium'
125
112
  ? '16px'
126
- : '12px'};
127
- width: ${(props) =>
128
- props.size === 'large'
129
- ? '23px'
130
113
  : 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;
114
+ ? '13px'
115
+ : '10px'};
116
+ user-select: none;
117
+ flex: auto;
118
+ align-self: baseline;
139
119
 
140
- &:after {
141
- content: '';
142
- display: ${(props) => (props.isChecked ? 'block' : 'none')};
143
- width: ${(props) =>
120
+ .checkmark {
121
+ height: ${(props) =>
144
122
  props.size === 'large'
145
- ? '10px'
123
+ ? '23px'
146
124
  : props.size === 'medium'
147
- ? '8px'
148
- : '6px'};
149
- height: ${(props) =>
125
+ ? '16px'
126
+ : '12px'};
127
+ width: ${(props) =>
150
128
  props.size === 'large'
151
- ? '10px'
129
+ ? '23px'
152
130
  : props.size === 'medium'
153
- ? '8px'
154
- : '6px'};
131
+ ? '16px'
132
+ : '12px'};
133
+ background-color: #fff;
155
134
  border-radius: 100%;
156
- background: ${(props) =>
157
- props.checkmarkColor ? props.checkmarkColor : props.theme.colors.green};
158
- }
159
- }
160
- `
135
+ border: 1px solid ${(props) => props.theme.colors.mediumGray};
136
+ display: flex;
137
+ align-items: center;
138
+ justify-content: center;
161
139
 
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
- `
140
+ &:after {
141
+ content: '';
142
+ display: ${(props) => (props.isChecked ? 'block' : 'none')};
143
+ width: ${(props) =>
144
+ props.size === 'large'
145
+ ? '10px'
146
+ : props.size === 'medium'
147
+ ? '8px'
148
+ : '6px'};
149
+ height: ${(props) =>
150
+ props.size === 'large'
151
+ ? '10px'
152
+ : props.size === 'medium'
153
+ ? '8px'
154
+ : '6px'};
155
+ border-radius: 100%;
156
+ background: ${(props) =>
157
+ props.checkmarkColor
158
+ ? props.checkmarkColor
159
+ : props.theme.colors.green};
160
+ }
161
+ }
162
+ `
167
163
 
168
- const RadioImage = styled.img`
169
- max-width: 100px;
170
- `
164
+ const textAttrs = { isDisabled: Boolean }
165
+ const LabelText = styled('div', textAttrs)`
166
+ color: ${(props) =>
167
+ props.isDisabled ? props.theme.colors.grey2 : props.theme.colors.black};
168
+ `
171
169
 
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;
170
+ const RadioImage = styled.img`
171
+ max-width: 100px;
172
+ `
179
173
 
180
- .search-icn-container {
181
- display: none;
182
- }
174
+ const ImageContainer = styled.div`
175
+ border-radius: 4px;
176
+ cursor: pointer;
177
+ display: grid;
178
+ align-items: center;
179
+ justify-items: center;
180
+ position: relative;
183
181
 
184
- &:hover {
185
182
  .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;
183
+ display: none;
193
184
  }
194
- }
195
- `
196
185
 
197
- const ModalImage = styled.img``
186
+ &:hover {
187
+ .search-icn-container {
188
+ display: grid;
189
+ position: absolute;
190
+ background: rgba(0, 0, 0, 0.4);
191
+ width: 100%;
192
+ height: 100%;
193
+ align-items: center;
194
+ justify-items: center;
195
+ }
196
+ }
197
+ `
198
198
 
199
- const ModalImageContainer = styled.div`
200
- padding: 40px;
201
- `
199
+ const ModalImage = styled.img``
202
200
 
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
201
+ const ModalImageContainer = styled.div`
202
+ padding: 40px;
203
+ `
204
+
205
+ export default {
206
+ name: 'RadioButton',
207
+ components: {
208
+ Radio,
209
+ ComponentWrapper,
210
+ LabelContainer,
211
+ RadioWrapper,
212
+ RadioImage,
213
+ ImageContainer,
214
+ Modal,
215
+ ModalImage,
216
+ ModalImageContainer,
217
+ InfoText,
218
+ LabelText,
234
219
  },
235
- name: {
236
- required: false,
237
- default: ''
220
+ props: {
221
+ selectedOption: {
222
+ required: true,
223
+ default: false,
224
+ },
225
+ options: {
226
+ required: true,
227
+ default: [],
228
+ },
229
+ layout: {
230
+ required: false,
231
+ default: 'horizontal', //2 options: 'vertical' (only 1 per row) & 'horizontal' (many per row)
232
+ },
233
+ size: {
234
+ required: false,
235
+ default: 'medium', // small, medium, large
236
+ },
237
+ name: {
238
+ required: false,
239
+ default: '',
240
+ },
241
+ checkmarkColor: {
242
+ required: false,
243
+ default: '',
244
+ },
245
+ dataId: {
246
+ type: String,
247
+ default: 'key',
248
+ },
238
249
  },
239
- checkmarkColor: {
240
- required: false,
241
- default: ''
250
+ data() {
251
+ return {
252
+ selectedImage: null,
253
+ radioName: '',
254
+ }
242
255
  },
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)
256
+ created() {
257
+ this.radioName =
258
+ this.name.length === 0 ? Math.round(Math.random() * 10000) : this.name
257
259
  },
258
- isImageOpen(index) {
259
- return this.selectedImage === index
260
+ methods: {
261
+ onInputHandler(value) {
262
+ this.$emit('on-radio-change', value)
263
+ },
264
+ isImageOpen(index) {
265
+ return this.selectedImage === index
266
+ },
267
+ toggleImageModal(value) {
268
+ this.selectedImage = value
269
+ },
260
270
  },
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
271
  }
269
- }
270
272
  </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
  }