fleetcor-lwc 2.7.1 → 2.7.3
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 +10 -0
- package/frontend/components/flt/checkbox/checkbox.html +22 -17
- package/frontend/components/flt/checkbox/checkbox.js +1 -0
- package/frontend/components/flt/radioGroupIcon/radioGroupIcon.html +7 -5
- package/frontend/components/flt/radioGroupIcon/radioGroupIcon.js +15 -9
- package/frontend/components/flt/radioItemIcon/radioItemIcon.html +1 -1
- package/frontend/components/flt/radioItemIcon/radioItemIcon.js +15 -8
- package/frontend/components/flt/radioItemIcon/radioItemIcon.scss +15 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -415,6 +415,16 @@ $FLT_RADIO_GROUP_CIRCLE_DISABLED_SELECTED_BG_COLOR: var(
|
|
|
415
415
|
|
|
416
416
|
## Release Notes:
|
|
417
417
|
|
|
418
|
+
- v.2.7.3
|
|
419
|
+
- Added required class marker for the checkbox component
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
- v.2.7.2
|
|
424
|
+
- Added variant for the RadioGroupIcon: 'hide-checkbox'
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
418
428
|
- v.2.7.1
|
|
419
429
|
- Added icons: 'world', 'map-pin'
|
|
420
430
|
|
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
<template lwc:render-mode="light">
|
|
2
2
|
<label class={computedLabelClass}>
|
|
3
3
|
<input
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
class="flt-checkbox__input"
|
|
5
|
+
type="checkbox"
|
|
6
|
+
checked={value}
|
|
7
|
+
disabled={disabled}
|
|
8
|
+
onchange={handleChange}
|
|
9
|
+
/>
|
|
10
|
+
|
|
9
11
|
<span class={computedSpanClass}>
|
|
10
12
|
<svg
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
if:true={value}
|
|
14
|
+
class="flt-checkbox__icon-agree"
|
|
15
|
+
width="20"
|
|
16
|
+
height="20"
|
|
17
|
+
viewBox="0 0 20 20"
|
|
18
|
+
fill="none"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
>
|
|
18
21
|
<path
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
class="flt-checkbox__icon-agree-path"
|
|
23
|
+
d="M3.75 10.625L8.75 15.625L16.25 4.375"
|
|
24
|
+
stroke-width="2"
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round"
|
|
27
|
+
></path>
|
|
24
28
|
</svg>
|
|
25
29
|
</span>
|
|
30
|
+
|
|
26
31
|
<div class="flt-checkbox__label"></div>
|
|
27
32
|
</label>
|
|
28
33
|
<div class={computedErrorMessage}>{errorMessage}</div>
|
|
@@ -33,6 +33,7 @@ export default class Checkbox extends CheckboxElement {
|
|
|
33
33
|
get computedLabelClass() {
|
|
34
34
|
return this.generateClassNameList({
|
|
35
35
|
'flt-checkbox': true,
|
|
36
|
+
'flt-checkbox_required': this.required,
|
|
36
37
|
'flt-checkbox_active': this.value,
|
|
37
38
|
'flt-checkbox_disabled': this.disabled,
|
|
38
39
|
'flt-checkbox_error': this.error,
|
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
|
15
|
-
@api
|
|
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;
|