@eturnity/eturnity_reusable_components 8.37.1-dev-03-elisee-8.37.3 → 8.40.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.
@@ -1,85 +1,77 @@
1
1
  <template>
2
- <FlexRadioContainer>
3
- <ComponentWrapper :color-mode="colorMode" :layout="layout">
4
- <RadioWrapper
5
- v-for="(item, index) in options"
6
- :key="item.value"
7
- :data-test-id="'radioWrapper_' + item.value"
2
+ <ComponentWrapper :color-mode="colorMode" :layout="layout">
3
+ <RadioWrapper
4
+ v-for="(item, index) in options"
5
+ :key="item.value"
6
+ :data-test-id="'radioWrapper_' + item.value"
7
+ >
8
+ <LabelContainer
9
+ :checkmark-color="checkmarkColor"
10
+ :color-mode="colorMode"
11
+ :has-label="!!item.label"
12
+ :has-slots="!!$slots[`input-${item.value}`]"
13
+ :is-checked="selectedOption === item.value"
14
+ :is-disabled="isItemDisabled(item)"
15
+ :size="size"
8
16
  >
9
- <LabelContainer
10
- :checkmark-color="checkmarkColor"
17
+ <Radio
18
+ :checked="selectedOption === item.value"
19
+ :data-id="`radio_button_${dataId}_option_${item.value}`"
20
+ :data-qa-id="dataQaId"
21
+ :data-test-id="'radioInput_' + item.value"
22
+ :disabled="isItemDisabled(item)"
23
+ :name="'radioButtons_' + radioName"
24
+ type="radio"
25
+ :value="selectedOption"
26
+ @click="onInputHandler(item.value)"
27
+ />
28
+ <span class="checkmark"></span>
29
+ <LabelText
30
+ v-if="item.label"
11
31
  :color-mode="colorMode"
12
- :has-label="!!item.label"
13
- :has-slots="!!$slots[`input-${item.value}`]"
14
- :is-checked="selectedOption === item.value"
32
+ :data-test-id="'radioLabel_' + item.value"
15
33
  :is-disabled="isItemDisabled(item)"
16
- :size="size"
17
34
  >
18
- <Radio
19
- :checked="selectedOption === item.value"
20
- :data-id="`radio_button_${dataId}_option_${item.value}`"
21
- :data-qa-id="dataQaId"
22
- :data-test-id="'radioInput_' + item.value"
23
- :disabled="isItemDisabled(item)"
24
- :name="'radioButtons_' + radioName"
25
- type="radio"
26
- :value="selectedOption"
27
- @click="onInputHandler(item.value)"
28
- />
29
- <span class="checkmark"></span>
30
- <LabelText
31
- v-if="item.label"
32
- :color-mode="colorMode"
33
- :data-test-id="'radioLabel_' + item.value"
34
- :is-disabled="isItemDisabled(item)"
35
- >
36
- {{ item.label }}
37
- <IsRequiredLabelStar v-if="isRequiredLabel" />
38
- </LabelText>
39
- <InfoText
40
- v-if="item.infoText"
41
- :data-test-id="'radioInfo_' + item.value"
42
- size="16px"
43
- :text="item.infoText"
44
- />
45
- <slot :name="`input-${item.value}`"></slot>
46
- </LabelContainer>
47
- <ImageContainer v-if="item.img">
48
- <RadioImage
49
- :data-test-id="'radioImage_' + item.value"
50
- :src="item.img"
51
- />
52
- <div
53
- class="search-icn-container"
54
- :data-test-id="'radioOpenImage_' + item.value"
55
- @click="toggleImageModal(index)"
56
- >
57
- <img
58
- alt=""
59
- class="search-icn"
60
- :src="require('../../../assets/icons/search_icon.png')"
61
- />
62
- </div>
63
- </ImageContainer>
64
- <Modal
65
- v-if="item.img"
66
- :data-test-id="'radioModal_' + item.value"
67
- :is-open="isImageOpen(index)"
68
- @on-close="toggleImageModal(null)"
35
+ {{ item.label }}
36
+ <IsRequiredLabelStar v-if="isRequiredLabel" />
37
+ </LabelText>
38
+ <InfoText
39
+ v-if="item.infoText"
40
+ :data-test-id="'radioInfo_' + item.value"
41
+ size="16px"
42
+ :text="item.infoText"
43
+ />
44
+ <slot :name="`input-${item.value}`"></slot>
45
+ </LabelContainer>
46
+ <ImageContainer v-if="item.img">
47
+ <RadioImage
48
+ :data-test-id="'radioImage_' + item.value"
49
+ :src="item.img"
50
+ />
51
+ <div
52
+ class="search-icn-container"
53
+ :data-test-id="'radioOpenImage_' + item.value"
54
+ @click="toggleImageModal(index)"
69
55
  >
70
- <ModalImageContainer>
71
- <ModalImage :src="item.img" />
72
- </ModalImageContainer>
73
- </Modal>
74
- </RadioWrapper>
75
- </ComponentWrapper>
76
- <ErrorMessage
77
- v-if="hasError && errorMessage"
78
- data-test-id="error_message_wrapper"
79
- >
80
- {{ errorMessage }}
81
- </ErrorMessage>
82
- </FlexRadioContainer>
56
+ <img
57
+ alt=""
58
+ class="search-icn"
59
+ :src="require('../../../assets/icons/search_icon.png')"
60
+ />
61
+ </div>
62
+ </ImageContainer>
63
+ <Modal
64
+ v-if="item.img"
65
+ :data-test-id="'radioModal_' + item.value"
66
+ :is-open="isImageOpen(index)"
67
+ @on-close="toggleImageModal(null)"
68
+ >
69
+ <ModalImageContainer>
70
+ <ModalImage :src="item.img" />
71
+ </ModalImageContainer>
72
+ </Modal>
73
+ </RadioWrapper>
74
+ </ComponentWrapper>
83
75
  </template>
84
76
 
85
77
  <script>
@@ -107,7 +99,6 @@
107
99
  import Modal from '../../modals/modal'
108
100
  import InfoText from '../../infoText'
109
101
  import IsRequiredLabelStar from '../isRequiredLabelStar'
110
- import ErrorMessage from '../../errorMessage'
111
102
 
112
103
  const wrapperProps = {
113
104
  layout: String,
@@ -255,11 +246,7 @@
255
246
  const ModalImageContainer = styled.div`
256
247
  padding: 40px;
257
248
  `
258
- const FlexRadioContainer = styled.div`
259
- display: flex;
260
- flex-direction: column;
261
- position: relative;
262
- `
249
+
263
250
  export default {
264
251
  name: 'RadioButton',
265
252
  components: {
@@ -275,8 +262,6 @@
275
262
  InfoText,
276
263
  LabelText,
277
264
  IsRequiredLabelStar,
278
- ErrorMessage,
279
- FlexRadioContainer,
280
265
  },
281
266
  props: {
282
267
  disabled: {
@@ -335,16 +320,6 @@
335
320
  default: false,
336
321
  type: Boolean,
337
322
  },
338
- hasError: {
339
- required: false,
340
- default: false,
341
- type: Boolean,
342
- },
343
- errorMessage: {
344
- required: false,
345
- default: '',
346
- type: String,
347
- },
348
323
  },
349
324
  emits: ['on-radio-change'],
350
325
  data() {
@@ -201,12 +201,6 @@
201
201
  </SelectDropdown>
202
202
  </Component>
203
203
  </DropdownWrapper>
204
- <ErrorMessage
205
- v-if="hasError && hasErrorMessage"
206
- data-test-id="error_message_wrapper"
207
- >
208
- {{ errorMessage }}
209
- </ErrorMessage>
210
204
  </SelectButtonWrapper>
211
205
  </InputWrapper>
212
206
  </Container>
@@ -239,7 +233,6 @@
239
233
  import { Teleport, inject } from 'vue'
240
234
  import styled from 'vue3-styled-components'
241
235
  import InfoText from '../../infoText'
242
- import ErrorMessage from '../../errorMessage'
243
236
  import Icon from '../../icon'
244
237
  import InputText from '../inputText'
245
238
  import DraggableInputHandle from '../../draggableInputHandle'
@@ -309,6 +302,7 @@
309
302
  const Container = styled('div', inputProps)`
310
303
  width: ${(props) => props.selectWidth};
311
304
  position: ${(props) => (props.noRelative ? 'static' : 'relative')};
305
+ display: inline-block;
312
306
  text-align: ${(props) => (props.textCenter ? 'center' : 'left')};
313
307
  `
314
308
 
@@ -520,7 +514,6 @@
520
514
  Teleport,
521
515
  DraggableInputHandle,
522
516
  IsRequiredLabelStar,
523
- ErrorMessage,
524
517
  },
525
518
 
526
519
  props: {
@@ -627,14 +620,9 @@
627
620
  default: true,
628
621
  },
629
622
  hasError: {
630
- type: Boolean,
631
623
  required: false,
632
624
  default: false,
633
625
  },
634
- errorMessage: {
635
- type: String,
636
- default: '',
637
- },
638
626
  disabled: {
639
627
  required: false,
640
628
  type: Boolean,
@@ -747,9 +735,6 @@
747
735
  }
748
736
  },
749
737
  computed: {
750
- hasErrorMessage() {
751
- return this.errorMessage && this.errorMessage.length > 0
752
- },
753
738
  optionLength() {
754
739
  if (this.isDropdownOpen) {
755
740
  return this.$refs.dropdown.$el.childElementCount > 1
@@ -25,8 +25,6 @@
25
25
  :resize="resize"
26
26
  :rows="rowHeight"
27
27
  :value="value"
28
- @blur="onInputBlur"
29
- @focus="onInputFocus"
30
28
  @input="onChangeHandler"
31
29
  ></textarea>
32
30
  </InputContainer>
@@ -210,12 +208,6 @@
210
208
  }
211
209
  this.$emit('input-change', $event.target.value)
212
210
  },
213
- onInputBlur($event) {
214
- this.$emit('input-blur', $event.target.value)
215
- },
216
- onInputFocus($event) {
217
- this.$emit('input-focus', $event.target.value)
218
- },
219
211
  },
220
212
  }
221
213
  </script>
@@ -59,8 +59,6 @@
59
59
 
60
60
  const getSpinnerSize = (size) => {
61
61
  switch (size) {
62
- case 'tiny':
63
- return '16px'
64
62
  case 'small':
65
63
  return '24px'
66
64
  case 'large':
@@ -16,17 +16,17 @@
16
16
 
17
17
  const TagContainer = styled.div`
18
18
  display: inline-flex;
19
- align-items: baseline;
19
+ align-items: center;
20
20
  justify-content: center;
21
21
  gap: 4px;
22
22
  border-radius: 4px;
23
- padding: 4px;
23
+ padding: 2px 4px;
24
24
  background-color: ${(props) => props.theme.semanticColors.yellow[200]};
25
25
  cursor: pointer;
26
26
  `
27
27
 
28
28
  const TextContainer = styled.div`
29
- font-size: 12px;
29
+ font-size: 10px;
30
30
  font-weight: 700;
31
31
  color: ${(props) => props.theme.semanticColors.teal[800]};
32
32
  `