fleetcor-lwc 2.7.0 → 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 +10 -0
- package/frontend/components/flt/icon/icon.js +30 -24
- package/frontend/components/flt/icon/icons/tmpl-map-pin.html +6 -0
- package/frontend/components/flt/icon/icons/tmpl-world.html +12 -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 +2 -2
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.2
|
|
419
|
+
- Added variant for the RadioGroupIcon: 'hide-checkbox'
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
- v.2.7.1
|
|
424
|
+
- Added icons: 'world', 'map-pin'
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
418
428
|
- v.2.7.0
|
|
419
429
|
- Added size `medium` for checkbox component
|
|
420
430
|
|
|
@@ -30,6 +30,8 @@ import TMPL_SMALL_PLUS from './icons/tmpl-small-plus.html'
|
|
|
30
30
|
import TMPL_DOCUMENT from './icons/tmpl-document.html'
|
|
31
31
|
import TMPL_CLOSE from './icons/tmpl-close.html'
|
|
32
32
|
import TMPL_HGV from './icons/tmpl-hgv.html'
|
|
33
|
+
import TMPL_WORLD from './icons/tmpl-world.html'
|
|
34
|
+
import TMPL_MAP_PIN from './icons/tmpl-map-pin.html'
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* @class Icon
|
|
@@ -37,43 +39,47 @@ import TMPL_HGV from './icons/tmpl-hgv.html'
|
|
|
37
39
|
* @description Flt icon component
|
|
38
40
|
*/
|
|
39
41
|
export default class Icon extends LightningDomElement {
|
|
40
|
-
@api icon
|
|
42
|
+
@api icon;
|
|
41
43
|
|
|
42
|
-
connectedCallback() {
|
|
44
|
+
connectedCallback () {
|
|
43
45
|
if (!ICONS[this.icon]) {
|
|
44
|
-
console.error(`FltError: Icon '${this.icon}' is not available!`)
|
|
46
|
+
console.error(`FltError: Icon '${this.icon}' is not available!`);
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
render() {
|
|
49
|
-
return ICONS[this.icon] || TMPL_EMPTY
|
|
50
|
+
render () {
|
|
51
|
+
return ICONS[this.icon] || TMPL_EMPTY;
|
|
50
52
|
}
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
const ICONS = {
|
|
54
|
-
plus: TMPL_PLUS,
|
|
56
|
+
'plus': TMPL_PLUS,
|
|
55
57
|
'plus-small': TMPL_SMALL_PLUS,
|
|
56
|
-
document: TMPL_DOCUMENT,
|
|
57
|
-
close: TMPL_CLOSE,
|
|
58
|
-
ev: TMPL_EV,
|
|
59
|
-
carwash: TMPL_CARWASH,
|
|
60
|
-
car: TMPL_CAR,
|
|
61
|
-
van: TMPL_VAN,
|
|
62
|
-
unleaded: TMPL_UNLIDEAD,
|
|
63
|
-
diesel: TMPL_DIESEL,
|
|
64
|
-
hydrogen: TMPL_HYDROGEN,
|
|
65
|
-
signature: TMPL_SIGNATURE,
|
|
66
|
-
fuel: TMPL_FUEL,
|
|
67
|
-
driver: TMPL_DRIVER,
|
|
68
|
-
vehicle: TMPL_VEHICLE,
|
|
69
|
-
both: TMPL_BOTH,
|
|
58
|
+
'document': TMPL_DOCUMENT,
|
|
59
|
+
'close': TMPL_CLOSE,
|
|
60
|
+
'ev': TMPL_EV,
|
|
61
|
+
'carwash': TMPL_CARWASH,
|
|
62
|
+
'car': TMPL_CAR,
|
|
63
|
+
'van': TMPL_VAN,
|
|
64
|
+
'unleaded': TMPL_UNLIDEAD,
|
|
65
|
+
'diesel': TMPL_DIESEL,
|
|
66
|
+
'hydrogen': TMPL_HYDROGEN,
|
|
67
|
+
'signature': TMPL_SIGNATURE,
|
|
68
|
+
'fuel': TMPL_FUEL,
|
|
69
|
+
'driver': TMPL_DRIVER,
|
|
70
|
+
'vehicle': TMPL_VEHICLE,
|
|
71
|
+
'both': TMPL_BOTH,
|
|
70
72
|
'shared-card': TMPL_SHARED_CARD,
|
|
71
73
|
'ev-and-fuel': TMPL_EV_AND_FUEL,
|
|
72
|
-
oil: TMPL_OIL,
|
|
73
|
-
key: TMPL_KEY,
|
|
74
|
-
blocked: TMPL_BLOCKED,
|
|
74
|
+
'oil': TMPL_OIL,
|
|
75
|
+
'key': TMPL_KEY,
|
|
76
|
+
'blocked': TMPL_BLOCKED,
|
|
75
77
|
'arrow-left': TMPL_ARROW_LEFT,
|
|
76
78
|
'multiple-users': TMPL_MULTIPLE_USERS,
|
|
77
79
|
'arrow-right': TMPL_ARROW_RIGHT,
|
|
78
|
-
hgv: TMPL_HGV,
|
|
80
|
+
'hgv': TMPL_HGV,
|
|
81
|
+
'world': TMPL_WORLD,
|
|
82
|
+
'map-pin': TMPL_MAP_PIN,
|
|
79
83
|
}
|
|
84
|
+
|
|
85
|
+
export const ICONS_LIST = Object.keys(ICONS);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<template lwc:render-mode="light">
|
|
2
|
+
<svg class="flt-icon flt-icon__map-pin" width="20" height="21" viewBox="0 0 20 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<path class="flt-icon__path" d="M12.5 9.31982C12.5 10.7005 11.3807 11.8198 10 11.8198C8.61929 11.8198 7.5 10.7005 7.5 9.31982C7.5 7.93911 8.61929 6.81982 10 6.81982C11.3807 6.81982 12.5 7.93911 12.5 9.31982Z" stroke="#2E3036" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
4
|
+
<path class="flt-icon__path" d="M16.25 9.31982C16.25 15.2716 10 18.6948 10 18.6948C10 18.6948 3.75 15.2716 3.75 9.31982C3.75 5.86804 6.54822 3.06982 10 3.06982C13.4518 3.06982 16.25 5.86804 16.25 9.31982Z" stroke="#2E3036" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
5
|
+
</svg>
|
|
6
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template lwc:render-mode="light">
|
|
2
|
+
<svg
|
|
3
|
+
class="flt-icon flt-icon__world"
|
|
4
|
+
width="20"
|
|
5
|
+
height="21"
|
|
6
|
+
viewBox="0 0 20 21"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
>
|
|
10
|
+
<path class="flt-icon__path" d="M17.4107 11.7305L16.4652 10.785C16.3226 10.6425 16.2041 10.4779 16.1139 10.2977L15.2139 8.49758C15.1087 8.28714 14.8282 8.24163 14.6618 8.40799C14.4848 8.58503 14.2257 8.65217 13.985 8.58339L12.9242 8.28032C12.5214 8.16522 12.1033 8.40669 12.0017 8.81315C11.9257 9.117 12.049 9.43579 12.3095 9.60952L12.7985 9.93549C13.2907 10.2637 13.3597 10.9601 12.9414 11.3784L12.7746 11.5452C12.5988 11.7211 12.5 11.9595 12.5 12.2081V12.5505C12.5 12.8903 12.4076 13.2238 12.2328 13.5152L11.1373 15.341C10.8195 15.8707 10.247 16.1948 9.6293 16.1948C9.14368 16.1948 8.75 15.8011 8.75 15.3155V14.3393C8.75 13.5726 8.28322 12.8831 7.57136 12.5984L7.02624 12.3803C6.20812 12.0531 5.72825 11.2003 5.87311 10.3312L5.87897 10.296C5.91765 10.064 5.99964 9.84127 6.12066 9.63955L6.19517 9.51537C6.60286 8.83589 7.39368 8.48606 8.17069 8.64146L9.15223 8.83777C9.63113 8.93355 10.1033 8.64562 10.2375 8.17603L10.4113 7.56794C10.5352 7.13416 10.3326 6.67362 9.92909 6.47187L9.375 6.19482L9.29917 6.27065C8.94754 6.62228 8.47063 6.81982 7.97335 6.81982H7.82258C7.61603 6.81982 7.41746 6.90236 7.27141 7.04841C7.03519 7.28464 6.67345 7.34405 6.37465 7.19465C5.97027 6.99246 5.82361 6.48881 6.05622 6.10113L7.2328 4.14016C7.3502 3.9445 7.43041 3.72988 7.47044 3.50711M17.4107 11.7305C17.4695 11.3523 17.5 10.9646 17.5 10.5698C17.5 6.42769 14.1421 3.06982 10 3.06982C9.11236 3.06982 8.26073 3.22403 7.47044 3.50711M17.4107 11.7305C16.8528 15.3215 13.7474 18.0698 10 18.0698C5.85786 18.0698 2.5 14.712 2.5 10.5698C2.5 7.31533 4.57291 4.545 7.47044 3.50711" stroke="#2E3036" stroke-linecap="round" stroke-linejoin="round"></path>
|
|
11
|
+
</svg>
|
|
12
|
+
</template>
|
|
@@ -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;
|
package/package.json
CHANGED