fleetcor-lwc 2.7.1 → 2.7.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.
package/README.md CHANGED
@@ -415,6 +415,11 @@ $FLT_RADIO_GROUP_CIRCLE_DISABLED_SELECTED_BG_COLOR: var(
415
415
 
416
416
  ## Release Notes:
417
417
 
418
+ - v.2.7.2
419
+ - Added variant for the RadioGroupIcon: 'hide-checkbox'
420
+
421
+ ---
422
+
418
423
  - v.2.7.1
419
424
  - Added icons: 'world', 'map-pin'
420
425
 
@@ -2,11 +2,13 @@
2
2
  <div class="flt-radio-group-icon">
3
3
  <template for:each={optionsToDisplay} for:item="option">
4
4
  <flt-radio-item-icon
5
- key={option.key}
6
- class="flt-radio-group-icon__item"
7
- size={size}
8
- option={option}
9
- onchange={handleChange}></flt-radio-item-icon>
5
+ key={option.key}
6
+ class="flt-radio-group-icon__item"
7
+ size={size}
8
+ option={option}
9
+ variant={variant}
10
+ onchange={handleChange}
11
+ ></flt-radio-item-icon>
10
12
  </template>
11
13
  </div>
12
14
  <div class={computedErrorMessage}>{errorMessage}</div>
@@ -3,6 +3,15 @@ import './radioGroupIcon.scss'
3
3
  import { api } from 'lwc'
4
4
  import { SelectElement } from 'fleetcor-lwc'
5
5
 
6
+ const VARIANTS = {
7
+ DEFAULT: 'default',
8
+ HIDE_CHECKBOX: 'hide-checkbox',
9
+ };
10
+
11
+ const SIZES = {
12
+ SMALL: 's'
13
+ }
14
+
6
15
  /**
7
16
  * @class RadioGroupIcon
8
17
  * @extends SelectElement
@@ -11,21 +20,18 @@ import { SelectElement } from 'fleetcor-lwc'
11
20
  export default class RadioGroupIcon extends SelectElement {
12
21
  error
13
22
 
14
- @api size = SIZES.SMALL
15
- @api errorMessage
23
+ @api variant = VARIANTS.DEFAULT;
24
+ @api size = SIZES.SMALL;
25
+ @api errorMessage;
16
26
 
17
27
  @api validate() {
18
- this.error = !this.isValid()
28
+ this.error = !this.isValid();
19
29
  }
20
30
 
21
31
  get computedErrorMessage() {
22
32
  return this.generateClassNameList({
23
33
  'flt-radio-group-icon__error-message': true,
24
- 'flt-radio-group-icon__error-message_active': this.error
34
+ 'flt-radio-group-icon__error-message_active': this.error,
25
35
  })
26
36
  }
27
- }
28
-
29
- const SIZES = {
30
- SMALL: 's'
31
- }
37
+ }
@@ -1,6 +1,6 @@
1
1
  <template lwc:render-mode="light">
2
2
  <div onclick={handleClick} class={styleClass} autotests-value={option.value}>
3
3
  <span class="flt-radio-item-icon__circle"></span>
4
- <img class="flt-radio-item-icon__icon" src={option.icon} alt={option.label} />
4
+ <img class="flt-radio-item-icon__icon" src={option.icon} alt={option.label}/>
5
5
  </div>
6
6
  </template>
@@ -3,18 +3,29 @@ import './radioItemIcon.scss'
3
3
  import { api } from 'lwc'
4
4
  import { BaseElement } from 'fleetcor-lwc'
5
5
 
6
+ const VARIANTS = {
7
+ DEFAULT: 'default',
8
+ HIDE_CHECKBOX: 'hide-checkbox',
9
+ };
10
+
11
+ const SIZES = {
12
+ SMALL: 's'
13
+ }
14
+
6
15
  /**
7
16
  * @class RadioItemIcon
8
17
  * @extends BaseElement
9
18
  * @description Flt Radio Item Icon component
10
19
  */
11
20
  export default class RadioItemIcon extends BaseElement {
12
- @api option
13
- @api size = SIZES.SMALL
21
+ @api option;
22
+ @api size = SIZES.SMALL;
23
+ @api variant = VARIANTS.DEFAULT;
14
24
 
15
25
  get styleClass() {
16
26
  return this.generateClassNameList({
17
27
  'flt-radio-item-icon': true,
28
+ 'flt-radio-item-icon_hide-checkbox': this.variant === VARIANTS.HIDE_CHECKBOX,
18
29
  [`flt-radio-item-icon_size_${this.size}`]: true,
19
30
  'flt-radio-item-icon_selected': this.option.selected,
20
31
  'flt-radio-item-icon_disabled': this.option.disabled
@@ -23,11 +34,7 @@ export default class RadioItemIcon extends BaseElement {
23
34
 
24
35
  handleClick() {
25
36
  if (!this.option.disabled || !this.option.selected) {
26
- this.dispatchEvent(new CustomEvent('change', { detail: { ...this.option } }))
37
+ this.dispatchEvent(new CustomEvent('change', { detail: { ...this.option } }));
27
38
  }
28
39
  }
29
- }
30
-
31
- const SIZES = {
32
- SMALL: 's'
33
- }
40
+ }
@@ -18,14 +18,25 @@
18
18
  border: 5px solid $FLT_RADIO_GROUP_CIRCLE_SELECTED_COLOR;
19
19
  }
20
20
 
21
+ &_hide-checkbox &__circle{
22
+ display: none;
23
+ }
24
+
25
+ &_hide-checkbox &__icon{
26
+ border: 1px solid $FLT_RADIO_GROUP_CIRCLE_COLOR;
27
+ border-radius: 6px;
28
+ padding: 3px 5px;
29
+ transition: border-color 0.3s;
30
+ }
31
+
32
+ &_hide-checkbox.flt-radio-item-icon_selected &__icon{
33
+ border: 1px solid $FLT_RADIO_GROUP_CIRCLE_SELECTED_COLOR;
34
+ }
35
+
21
36
  &_disabled {
22
37
  cursor: not-allowed;
23
38
  }
24
39
 
25
- // &_disabled &__label {
26
- // color: $FLT_RADIO_GROUP_DISABLED_COLOR;
27
- // }
28
-
29
40
  &_disabled &__circle {
30
41
  border-color: $FLT_RADIO_GROUP_CIRCLE_DISABLED_COLOR;
31
42
  background-color: $FLT_RADIO_GROUP_CIRCLE_DISABLED_BG_COLOR;
@@ -36,12 +47,6 @@
36
47
  background-color: $FLT_RADIO_GROUP_CIRCLE_DISABLED_SELECTED_BG_COLOR;
37
48
  }
38
49
 
39
- // &__label {
40
- // line-height: 20px;
41
- // font-size: 15px;
42
- // color: $FLT_RADIO_GROUP_COLOR;
43
- // }
44
-
45
50
  &__circle {
46
51
  box-sizing: border-box;
47
52
  border: 1px solid $FLT_RADIO_GROUP_CIRCLE_COLOR;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetcor-lwc",
3
- "version": "2.7.1",
3
+ "version": "2.7.2",
4
4
  "description": "LWC framework by Fleetcor",
5
5
  "repository": {
6
6
  "type": "git",