fleetcor-lwc 3.20.0 → 3.20.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
|
@@ -851,6 +851,39 @@ This component fully extends from `Input Text`
|
|
|
851
851
|
|
|
852
852
|
</details>
|
|
853
853
|
|
|
854
|
+
#### Collapsible Section Css
|
|
855
|
+
|
|
856
|
+
```css
|
|
857
|
+
/* this is aquamarine variables */
|
|
858
|
+
|
|
859
|
+
:root {
|
|
860
|
+
/* Collapsible Section */
|
|
861
|
+
--flt-collapsible-section-background: initial;
|
|
862
|
+
--flt-collapsible-section-padding: initial;
|
|
863
|
+
--flt-collapsible-section-border: initial;
|
|
864
|
+
--flt-collapsible-section-border-radius: initial;
|
|
865
|
+
--flt-collapsible-section-box-shadow: initial;
|
|
866
|
+
--flt-collapsible-section-opened-header-base-icon-transform: rotate(180deg) scale(
|
|
867
|
+
-1
|
|
868
|
+
);
|
|
869
|
+
--flt-collapsible-section-body-animation-duration: 0.5s;
|
|
870
|
+
--flt-collapsible-section-body-animation-type: ease;
|
|
871
|
+
--flt-collapsible-section-header-base-padding: initial;
|
|
872
|
+
--flt-collapsible-section-header-base-border: initial;
|
|
873
|
+
--flt-collapsible-section-header-base-border-radius: initial;
|
|
874
|
+
--flt-collapsible-section-header-base-background: initial;
|
|
875
|
+
--flt-collapsible-section-header-base-cursor: pointer;
|
|
876
|
+
--flt-collapsible-section-header-base-title-color: #1a1a1a;
|
|
877
|
+
--flt-collapsible-section-header-base-font-size: 16px;
|
|
878
|
+
--flt-collapsible-section-header-base-line-height: 24px;
|
|
879
|
+
--flt-collapsible-section-header-base-font-weight: 700;
|
|
880
|
+
--flt-collapsible-section-body-animation-duration: 0.5s;
|
|
881
|
+
--flt-collapsible-section-body-animation-type: ease;
|
|
882
|
+
--flt-collapsible-section-header-base-icon-transform: rotate(180deg);
|
|
883
|
+
--flt-collapsible-section-header-base-icon-fill: #1a1a1a;
|
|
884
|
+
}
|
|
885
|
+
```
|
|
886
|
+
|
|
854
887
|
---
|
|
855
888
|
|
|
856
889
|
## Interfaces
|
|
@@ -1006,29 +1039,6 @@ You can override them as you wish by global css variables as priority.
|
|
|
1006
1039
|
--flt-input-phone-border-color-error: #ed123d;
|
|
1007
1040
|
--flt-input-with-picklist-border-color-success: #59eb9c;
|
|
1008
1041
|
--flt-input-with-picklist-border-color-error: #ed123d;
|
|
1009
|
-
--flt-collapsible-section-background: initial;
|
|
1010
|
-
--flt-collapsible-section-padding: initial;
|
|
1011
|
-
--flt-collapsible-section-border: initial;
|
|
1012
|
-
--flt-collapsible-section-border-radius: initial;
|
|
1013
|
-
--flt-collapsible-section-box-shadow: initial;
|
|
1014
|
-
--flt-collapsible-section-opened-header-base-icon-transform: rotate(180deg) scale(
|
|
1015
|
-
-1
|
|
1016
|
-
);
|
|
1017
|
-
--flt-collapsible-section-body-animation-duration: 0.5s;
|
|
1018
|
-
--flt-collapsible-section-body-animation-type: ease;
|
|
1019
|
-
--flt-collapsible-section-header-base-padding: initial;
|
|
1020
|
-
--flt-collapsible-section-header-base-border: initial;
|
|
1021
|
-
--flt-collapsible-section-header-base-border-radius: initial;
|
|
1022
|
-
--flt-collapsible-section-header-base-background: initial;
|
|
1023
|
-
--flt-collapsible-section-header-base-cursor: pointer;
|
|
1024
|
-
--flt-collapsible-section-header-base-title-color: #1a1a1a;
|
|
1025
|
-
--flt-collapsible-section-header-base-font-size: 16px;
|
|
1026
|
-
--flt-collapsible-section-header-base-line-height: 24px;
|
|
1027
|
-
--flt-collapsible-section-header-base-font-weight: 700;
|
|
1028
|
-
--flt-collapsible-section-body-animation-duration: 0.5s;
|
|
1029
|
-
--flt-collapsible-section-body-animation-type: ease;
|
|
1030
|
-
--flt-collapsible-section-header-base-icon-transform: rotate(180deg);
|
|
1031
|
-
--flt-collapsible-section-header-base-icon-fill: #1a1a1a;
|
|
1032
1042
|
}
|
|
1033
1043
|
```
|
|
1034
1044
|
|
|
@@ -1041,6 +1051,19 @@ You can override them as you wish by global css variables as priority.
|
|
|
1041
1051
|
<details>
|
|
1042
1052
|
<summary>Click to expand/collapse</summary>
|
|
1043
1053
|
|
|
1054
|
+
v.3.20.2
|
|
1055
|
+
|
|
1056
|
+
- Bug fix `flt-picklist`
|
|
1057
|
+
|
|
1058
|
+
---
|
|
1059
|
+
|
|
1060
|
+
v.3.20.1
|
|
1061
|
+
|
|
1062
|
+
- Bug fix `flt-input-phone`
|
|
1063
|
+
- Collapsible section component documentation updated
|
|
1064
|
+
|
|
1065
|
+
---
|
|
1066
|
+
|
|
1044
1067
|
v.3.20.0
|
|
1045
1068
|
|
|
1046
1069
|
- Added Btn component
|
|
@@ -9,6 +9,12 @@ const CODE_BY_DEFAULT = 'GB'
|
|
|
9
9
|
const CODE_VALUE_SB = '+44'
|
|
10
10
|
|
|
11
11
|
export default class InputPhone extends UserDataValidator {
|
|
12
|
+
codeValue = ''
|
|
13
|
+
phoneNumber = ''
|
|
14
|
+
touched
|
|
15
|
+
focused
|
|
16
|
+
mask
|
|
17
|
+
|
|
12
18
|
@api errorMessage
|
|
13
19
|
@api inputLabel
|
|
14
20
|
@api placeholder
|
|
@@ -42,26 +48,6 @@ export default class InputPhone extends UserDataValidator {
|
|
|
42
48
|
}
|
|
43
49
|
}
|
|
44
50
|
|
|
45
|
-
get maskOptions() {
|
|
46
|
-
let settings = {
|
|
47
|
-
mask: /[1-9]/,
|
|
48
|
-
overwrite: false,
|
|
49
|
-
lazy: false
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
if (this.codeValue == CODE_VALUE_SB) {
|
|
53
|
-
settings = {
|
|
54
|
-
mask: '#000000000',
|
|
55
|
-
definitions: {
|
|
56
|
-
'#': /[1-9]/
|
|
57
|
-
},
|
|
58
|
-
overwrite: false,
|
|
59
|
-
lazy: false
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return settings
|
|
63
|
-
}
|
|
64
|
-
|
|
65
51
|
@api getData(silent) {
|
|
66
52
|
return {
|
|
67
53
|
...super.getData(silent),
|
|
@@ -99,8 +85,6 @@ export default class InputPhone extends UserDataValidator {
|
|
|
99
85
|
return result
|
|
100
86
|
}
|
|
101
87
|
|
|
102
|
-
phoneNumber = ''
|
|
103
|
-
|
|
104
88
|
@api setCode(countryCode) {
|
|
105
89
|
const restore = !this.touched
|
|
106
90
|
this.codeValue = COUNTRIES.find((c) => c.code === countryCode)?.dialCode || this.codeValue
|
|
@@ -119,22 +103,28 @@ export default class InputPhone extends UserDataValidator {
|
|
|
119
103
|
}
|
|
120
104
|
}
|
|
121
105
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return this.codeValue === CODE_VALUE_SB ? CODE_VALUE_SB + '(0)' : this.codeValue
|
|
129
|
-
}
|
|
106
|
+
get maskOptions() {
|
|
107
|
+
let settings = {
|
|
108
|
+
mask: /^[1-9]\d*$/,
|
|
109
|
+
overwrite: false,
|
|
110
|
+
lazy: false
|
|
111
|
+
}
|
|
130
112
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
113
|
+
if (this.codeValue == CODE_VALUE_SB) {
|
|
114
|
+
settings = {
|
|
115
|
+
mask: '#000000000',
|
|
116
|
+
definitions: {
|
|
117
|
+
'#': /[1-9]/
|
|
118
|
+
},
|
|
119
|
+
overwrite: false,
|
|
120
|
+
lazy: false
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return settings
|
|
134
124
|
}
|
|
135
125
|
|
|
136
|
-
|
|
137
|
-
this.
|
|
126
|
+
get prefix() {
|
|
127
|
+
return this.codeValue === CODE_VALUE_SB ? CODE_VALUE_SB + '(0)' : this.codeValue
|
|
138
128
|
}
|
|
139
129
|
|
|
140
130
|
get inputStyle() {
|
|
@@ -171,6 +161,22 @@ export default class InputPhone extends UserDataValidator {
|
|
|
171
161
|
this.codeValue = this.codeValue || this.codePrefixByCountryCode
|
|
172
162
|
}
|
|
173
163
|
|
|
164
|
+
renderedCallback() {
|
|
165
|
+
super.renderedCallback()
|
|
166
|
+
if (!this.mask) {
|
|
167
|
+
this.reInitIMask()
|
|
168
|
+
this.querySelector('input').onpaste = (event) => {
|
|
169
|
+
let value = event.clipboardData.getData('text/plain').replace(/[^\w\\s]/gi, '')
|
|
170
|
+
if (value?.at(0) == '0') {
|
|
171
|
+
value = CODE_VALUE_SB + value.slice(1)
|
|
172
|
+
} else {
|
|
173
|
+
value = '+' + value
|
|
174
|
+
}
|
|
175
|
+
this.querySelector('input').value = ''
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
174
180
|
reInitIMask() {
|
|
175
181
|
this.mask?.destroy()
|
|
176
182
|
this.mask = null
|
|
@@ -208,22 +214,6 @@ export default class InputPhone extends UserDataValidator {
|
|
|
208
214
|
})
|
|
209
215
|
}
|
|
210
216
|
|
|
211
|
-
renderedCallback() {
|
|
212
|
-
super.renderedCallback()
|
|
213
|
-
if (!this.mask) {
|
|
214
|
-
this.reInitIMask()
|
|
215
|
-
this.querySelector('input').onpaste = (event) => {
|
|
216
|
-
let value = event.clipboardData.getData('text/plain').replace(/[^\w\\s]/gi, '')
|
|
217
|
-
if (value?.at(0) == '0') {
|
|
218
|
-
value = CODE_VALUE_SB + value.slice(1)
|
|
219
|
-
} else {
|
|
220
|
-
value = '+' + value
|
|
221
|
-
}
|
|
222
|
-
this.querySelector('input').value = ''
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
|
|
227
217
|
handleFlagChanged(event) {
|
|
228
218
|
this.codeValue = event.detail.value
|
|
229
219
|
this.reInitIMask()
|
|
@@ -237,4 +227,13 @@ export default class InputPhone extends UserDataValidator {
|
|
|
237
227
|
})
|
|
238
228
|
)
|
|
239
229
|
}
|
|
230
|
+
|
|
231
|
+
handleFocus() {
|
|
232
|
+
this.focused = true
|
|
233
|
+
this.touched = true
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
handleBlur() {
|
|
237
|
+
this.focused = false
|
|
238
|
+
}
|
|
240
239
|
}
|
|
@@ -76,15 +76,10 @@ export default class Picklist extends SelectElement {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
handleMousedownView(event) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
event.
|
|
83
|
-
!classList.contains('flt-picklist__dropdown') &&
|
|
84
|
-
!classList.contains('flt-picklist__dropdown-container')
|
|
85
|
-
) {
|
|
86
|
-
event.currentTarget.blur();
|
|
87
|
-
event.preventDefault();
|
|
79
|
+
const dropdown = event.target.closest('.flt-picklist__dropdown')
|
|
80
|
+
if (event.currentTarget === document.activeElement && !dropdown) {
|
|
81
|
+
event.currentTarget.blur()
|
|
82
|
+
event.preventDefault()
|
|
88
83
|
}
|
|
89
84
|
}
|
|
90
85
|
|