fleetcor-lwc 3.9.6 → 3.9.8
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
|
@@ -31,6 +31,9 @@ Add / update `lwc.config.json` file in your project
|
|
|
31
31
|
|
|
32
32
|
## Components
|
|
33
33
|
|
|
34
|
+
<details open>
|
|
35
|
+
<summary>Click to expand/collapse Components</summary>
|
|
36
|
+
|
|
34
37
|
### Radio Group Icon
|
|
35
38
|
|
|
36
39
|
```html
|
|
@@ -43,9 +46,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
43
46
|
options="[{icon:'///icon-path', value:'London'}, {icon:'///icon-path', value:'Leon'}]"
|
|
44
47
|
value="London"
|
|
45
48
|
></flt-radio-group-icon>
|
|
46
|
-
...
|
|
47
49
|
```
|
|
48
50
|
|
|
51
|
+
<details>
|
|
52
|
+
<summary>Details</summary>
|
|
53
|
+
|
|
49
54
|
#### Radio Group Icon variables
|
|
50
55
|
|
|
51
56
|
| @api | type | values | required | description |
|
|
@@ -72,6 +77,9 @@ Add / update `lwc.config.json` file in your project
|
|
|
72
77
|
| name | handle | return | description |
|
|
73
78
|
| ------ | ------------ | ------ | ------------------------------------- |
|
|
74
79
|
| change | event.detail | object | Return full data of component's state |
|
|
80
|
+
</details>
|
|
81
|
+
|
|
82
|
+
---
|
|
75
83
|
|
|
76
84
|
### Radio Group
|
|
77
85
|
|
|
@@ -87,9 +95,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
87
95
|
value="London"
|
|
88
96
|
label="City"
|
|
89
97
|
></flt-radio-group>
|
|
90
|
-
...
|
|
91
98
|
```
|
|
92
99
|
|
|
100
|
+
<details>
|
|
101
|
+
<summary>Details</summary>
|
|
102
|
+
|
|
93
103
|
#### Radio Group variables
|
|
94
104
|
|
|
95
105
|
| @api variables | type | values | required | description |
|
|
@@ -118,6 +128,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
118
128
|
| name | handle | return | description |
|
|
119
129
|
| ------ | ------------ | ------ | ------------------------------------- |
|
|
120
130
|
| change | event.detail | object | Return full data of component's state |
|
|
131
|
+
</details>
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
|
|
121
136
|
|
|
122
137
|
### Checkbox
|
|
123
138
|
|
|
@@ -131,9 +146,12 @@ Add / update `lwc.config.json` file in your project
|
|
|
131
146
|
value="true"
|
|
132
147
|
label="Next"
|
|
133
148
|
></flt-checkbox>
|
|
134
|
-
...
|
|
135
149
|
```
|
|
136
150
|
|
|
151
|
+
|
|
152
|
+
<details>
|
|
153
|
+
<summary>Details</summary>
|
|
154
|
+
|
|
137
155
|
#### Checkbox variables
|
|
138
156
|
|
|
139
157
|
| @api variables | type | values | required | description |
|
|
@@ -160,6 +178,10 @@ Add / update `lwc.config.json` file in your project
|
|
|
160
178
|
| name | handle | return | description |
|
|
161
179
|
| ------ | ------------ | ------ | ------------------------------------- |
|
|
162
180
|
| change | event.detail | object | Return full data of component's state |
|
|
181
|
+
</details>
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
163
185
|
|
|
164
186
|
### Button
|
|
165
187
|
|
|
@@ -174,9 +196,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
174
196
|
>
|
|
175
197
|
<!-- Any html element -->
|
|
176
198
|
</flt-button>
|
|
177
|
-
...
|
|
178
199
|
```
|
|
179
200
|
|
|
201
|
+
<details>
|
|
202
|
+
<summary>Details</summary>
|
|
203
|
+
|
|
180
204
|
#### Button variables
|
|
181
205
|
|
|
182
206
|
| @api variables | type | values | required | description |
|
|
@@ -195,6 +219,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
195
219
|
| default | any html element can be there |
|
|
196
220
|
| iconLeft | any html element can override left icon place |
|
|
197
221
|
| iconRight | any html element can override right icon place |
|
|
222
|
+
</details>
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
|
|
198
227
|
|
|
199
228
|
### Icon
|
|
200
229
|
|
|
@@ -202,11 +231,18 @@ Add / update `lwc.config.json` file in your project
|
|
|
202
231
|
<flt-icon icon="arrow-left"></flt-icon>
|
|
203
232
|
```
|
|
204
233
|
|
|
234
|
+
<details>
|
|
235
|
+
<summary>Details</summary>
|
|
236
|
+
|
|
205
237
|
#### Icon variables
|
|
206
238
|
|
|
207
239
|
| @api variables | type | values | required | description |
|
|
208
240
|
| -------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ----------- |
|
|
209
241
|
| icon | string | `arrow-left, ev, carwash, car, van, unleaded, fuel, driver, vehicle, both, shared-card, ev-and-fuel, oil, key, blocked, multiple-users,arrow-right, diesel, hydrogen, signature, plus, plus-small, document, close, hgv, eye, sign, check,discount,pin-drop,credit-card,receipt,gear-wheel,app-shortcut,drug-indicator,sell,parking-sign,headset-mic,gas-station,directions-car,local-shipping,public,place` | - | |
|
|
242
|
+
</details>
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
210
246
|
|
|
211
247
|
### Card
|
|
212
248
|
|
|
@@ -214,11 +250,18 @@ Add / update `lwc.config.json` file in your project
|
|
|
214
250
|
<flt-card></flt-card>
|
|
215
251
|
```
|
|
216
252
|
|
|
253
|
+
<details>
|
|
254
|
+
<summary>Details</summary>
|
|
255
|
+
|
|
217
256
|
#### Card slot
|
|
218
257
|
|
|
219
258
|
| slot | description |
|
|
220
259
|
| ------- | ----------------------------- |
|
|
221
260
|
| default | any html element can be there |
|
|
261
|
+
</details>
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
222
265
|
|
|
223
266
|
### Tooltip
|
|
224
267
|
|
|
@@ -227,10 +270,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
227
270
|
<!-- Any html element -->
|
|
228
271
|
<flt-icon icon="arrow-left"></flt-icon>
|
|
229
272
|
</flt-tooltip>
|
|
230
|
-
|
|
231
|
-
...
|
|
232
273
|
```
|
|
233
274
|
|
|
275
|
+
<details>
|
|
276
|
+
<summary>Details</summary>
|
|
277
|
+
|
|
234
278
|
#### Tooltip variables
|
|
235
279
|
|
|
236
280
|
| @api variables | type | values | required | description |
|
|
@@ -243,6 +287,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
243
287
|
| slot | description |
|
|
244
288
|
| ------- | ----------------------------- |
|
|
245
289
|
| default | any html element can be there |
|
|
290
|
+
</details>
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
|
|
246
295
|
|
|
247
296
|
### Loader
|
|
248
297
|
|
|
@@ -250,14 +299,20 @@ Add / update `lwc.config.json` file in your project
|
|
|
250
299
|
<flt-loader>
|
|
251
300
|
<flt-icon icon="arrow-left"></flt-icon>
|
|
252
301
|
</flt-loader>
|
|
253
|
-
...
|
|
254
302
|
```
|
|
255
303
|
|
|
304
|
+
<details>
|
|
305
|
+
<summary>Details</summary>
|
|
306
|
+
|
|
256
307
|
#### Loader slot
|
|
257
308
|
|
|
258
309
|
| slot | description |
|
|
259
310
|
| ------- | ----------------------------- |
|
|
260
311
|
| default | any html element can be there |
|
|
312
|
+
</details>
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
261
316
|
|
|
262
317
|
### Modal
|
|
263
318
|
|
|
@@ -265,10 +320,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
265
320
|
<flt-modal deactive-glass>
|
|
266
321
|
<flt-icon icon="arrow-left"></flt-icon>
|
|
267
322
|
</flt-modal>
|
|
268
|
-
|
|
269
|
-
...
|
|
270
323
|
```
|
|
271
324
|
|
|
325
|
+
<details>
|
|
326
|
+
<summary>Details</summary>
|
|
327
|
+
|
|
272
328
|
#### Modal variables
|
|
273
329
|
|
|
274
330
|
| @api variables | type | values | required | description |
|
|
@@ -280,14 +336,20 @@ Add / update `lwc.config.json` file in your project
|
|
|
280
336
|
| slot | description |
|
|
281
337
|
| ------- | ----------------------------- |
|
|
282
338
|
| default | any html element can be there |
|
|
339
|
+
</details>
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
283
343
|
|
|
284
344
|
### Progress Step
|
|
285
345
|
|
|
286
346
|
```html
|
|
287
347
|
<flt-progress-step title="Contacts" total="8" current="1"></flt-progress-step>
|
|
288
|
-
...
|
|
289
348
|
```
|
|
290
349
|
|
|
350
|
+
<details>
|
|
351
|
+
<summary>Details</summary>
|
|
352
|
+
|
|
291
353
|
#### Progress Step variables
|
|
292
354
|
|
|
293
355
|
| @api variables | type | values | required | description |
|
|
@@ -295,6 +357,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
295
357
|
| title | string | | + | title for component |
|
|
296
358
|
| total | int | | + | right number position |
|
|
297
359
|
| current | int | | + | left part of position (always less then total) |
|
|
360
|
+
</details>
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
|
|
298
365
|
|
|
299
366
|
### Radio Group Chips
|
|
300
367
|
|
|
@@ -308,9 +375,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
308
375
|
options="[{label:'London', value:'London'}, {label:'Leon', value:'Leon'}]"
|
|
309
376
|
>
|
|
310
377
|
</flt-radio-group-chips>
|
|
311
|
-
...
|
|
312
378
|
```
|
|
313
379
|
|
|
380
|
+
<details>
|
|
381
|
+
<summary>Details</summary>
|
|
382
|
+
|
|
314
383
|
#### Radio Group Chips variables
|
|
315
384
|
|
|
316
385
|
| @api variables | type | values | required | description |
|
|
@@ -338,6 +407,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
338
407
|
| name | handle | return | description |
|
|
339
408
|
| ------ | ------------ | ------ | ------------------------------------- |
|
|
340
409
|
| change | event.detail | object | Return full data of component's state |
|
|
410
|
+
</details>
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
|
|
341
415
|
|
|
342
416
|
### Picklist Chips
|
|
343
417
|
|
|
@@ -352,9 +426,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
352
426
|
options="[{label:'London', value:'London'}, {label:'Leon', value:'Leon'}]"
|
|
353
427
|
>
|
|
354
428
|
</flt-picklist>
|
|
355
|
-
...
|
|
356
429
|
```
|
|
357
430
|
|
|
431
|
+
<details>
|
|
432
|
+
<summary>Details</summary>
|
|
433
|
+
|
|
358
434
|
#### Picklist variables
|
|
359
435
|
|
|
360
436
|
| @api variables | type | values | required | description |
|
|
@@ -385,6 +461,10 @@ Add / update `lwc.config.json` file in your project
|
|
|
385
461
|
| name | handle | return | description |
|
|
386
462
|
| ------ | ------------ | ------ | ------------------------------------- |
|
|
387
463
|
| change | event.detail | object | Return full data of component's state |
|
|
464
|
+
</details>
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
388
468
|
|
|
389
469
|
### Input Text
|
|
390
470
|
|
|
@@ -417,9 +497,11 @@ Add / update `lwc.config.json` file in your project
|
|
|
417
497
|
type="text"
|
|
418
498
|
placeholde-visible
|
|
419
499
|
></flt-input-text>
|
|
420
|
-
...
|
|
421
500
|
```
|
|
422
501
|
|
|
502
|
+
<details>
|
|
503
|
+
<summary>Details</summary>
|
|
504
|
+
|
|
423
505
|
#### Input Text variables
|
|
424
506
|
|
|
425
507
|
| @api variables | type | values | required | description |
|
|
@@ -454,6 +536,10 @@ Add / update `lwc.config.json` file in your project
|
|
|
454
536
|
| focus | event | object | Return common Event object |
|
|
455
537
|
| blur | event | object | Return common Event object |
|
|
456
538
|
| change | event.detail | object | Return full data of component's state |
|
|
539
|
+
</details>
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
457
543
|
|
|
458
544
|
### Input Email
|
|
459
545
|
|
|
@@ -470,7 +556,6 @@ This component fully extends from `Input Text`
|
|
|
470
556
|
type="email"
|
|
471
557
|
placeholde-visible
|
|
472
558
|
></flt-input-email>
|
|
473
|
-
...
|
|
474
559
|
```
|
|
475
560
|
|
|
476
561
|
### Input Phone
|
|
@@ -484,9 +569,11 @@ This component fully extends from `Input Text`
|
|
|
484
569
|
placeholder="Phone Number"
|
|
485
570
|
error-message="Please enter a valid phone"
|
|
486
571
|
></flt-input-phone>
|
|
487
|
-
...
|
|
488
572
|
```
|
|
489
573
|
|
|
574
|
+
<details>
|
|
575
|
+
<summary>Details</summary>
|
|
576
|
+
|
|
490
577
|
#### Input Phone variables
|
|
491
578
|
|
|
492
579
|
| @api variables | type | values | required | description |
|
|
@@ -517,6 +604,9 @@ This component fully extends from `Input Text`
|
|
|
517
604
|
| focus | event | object | Return common Event object |
|
|
518
605
|
| blur | event | object | Return common Event object |
|
|
519
606
|
| change | event.detail | object | Return full data of component's state |
|
|
607
|
+
</details>
|
|
608
|
+
|
|
609
|
+
---
|
|
520
610
|
|
|
521
611
|
### Input With Picklist
|
|
522
612
|
|
|
@@ -537,9 +627,11 @@ This component fully extends from `Input Text`
|
|
|
537
627
|
error-message="Error message Mounthly Sequrity"
|
|
538
628
|
options="[{label:'Label 1', value:'val_1'}, {label:'Label 2', value:'val_2'}]"
|
|
539
629
|
></flt-input-with-picklist>
|
|
540
|
-
...
|
|
541
630
|
```
|
|
542
631
|
|
|
632
|
+
<details>
|
|
633
|
+
<summary>Details</summary>
|
|
634
|
+
|
|
543
635
|
#### Input With Picklist variables
|
|
544
636
|
|
|
545
637
|
| @api variables | type | values | required | description |
|
|
@@ -574,6 +666,12 @@ This component fully extends from `Input Text`
|
|
|
574
666
|
| name | handle | return | description |
|
|
575
667
|
| ------ | ------------ | ------ | ------------------------------------- |
|
|
576
668
|
| change | event.detail | object | Return full data of component's state |
|
|
669
|
+
</details>
|
|
670
|
+
|
|
671
|
+
</details>
|
|
672
|
+
|
|
673
|
+
---
|
|
674
|
+
|
|
577
675
|
|
|
578
676
|
## Interfaces
|
|
579
677
|
|
|
@@ -596,10 +694,15 @@ btn.onclick = () => {
|
|
|
596
694
|
ModalViewer.showModalWithComponent(btn, { duration: 700, deactiveGlass: true });
|
|
597
695
|
```
|
|
598
696
|
|
|
697
|
+
---
|
|
698
|
+
|
|
599
699
|
## Override styles
|
|
600
700
|
|
|
601
701
|
You can override them as you wish by global css variables as priority.
|
|
602
702
|
|
|
703
|
+
<details>
|
|
704
|
+
<summary>Click to expand/collapse</summary>
|
|
705
|
+
|
|
603
706
|
```css
|
|
604
707
|
/* this is aquamarine variables */
|
|
605
708
|
|
|
@@ -724,103 +827,173 @@ You can override them as you wish by global css variables as priority.
|
|
|
724
827
|
--flt-input-with-picklist-border-color-error: #ed123d;
|
|
725
828
|
}
|
|
726
829
|
```
|
|
830
|
+
</details>
|
|
831
|
+
|
|
832
|
+
---
|
|
727
833
|
|
|
728
834
|
## Release Notes:
|
|
729
835
|
|
|
836
|
+
<details>
|
|
837
|
+
<summary>Click to expand/collapse</summary>
|
|
838
|
+
|
|
839
|
+
v.3.9.8
|
|
840
|
+
|
|
841
|
+
- Updates for `Readme.md`
|
|
842
|
+
|
|
843
|
+
---
|
|
844
|
+
|
|
845
|
+
- v.3.9.7
|
|
846
|
+
|
|
847
|
+
- Icon component updates to use `--flt-icon-color`
|
|
848
|
+
|
|
849
|
+
---
|
|
850
|
+
|
|
851
|
+
- v.3.9.6
|
|
852
|
+
|
|
853
|
+
- Added ability to use `iconLeft` and `iconRight` parameters in options (`flt-radio-group-chips`)
|
|
854
|
+
|
|
855
|
+
---
|
|
856
|
+
|
|
730
857
|
- v.3.9.5
|
|
731
858
|
|
|
732
859
|
- Added new icons: 'discount', 'pin-drop','credit-card','receipt','gear-wheel','app-shortcut','drug-indicator','sell','parking-sign','headset-mic','gas-station','directions-car','local-shipping','public','place'
|
|
733
860
|
|
|
861
|
+
---
|
|
862
|
+
|
|
734
863
|
- v.3.9.4
|
|
735
864
|
|
|
736
865
|
- Bug fix `flt-input-text`
|
|
737
866
|
|
|
867
|
+
---
|
|
868
|
+
|
|
738
869
|
- v.3.9.3
|
|
739
870
|
|
|
740
871
|
- Bug fix `flt-picklist`
|
|
741
872
|
|
|
873
|
+
---
|
|
874
|
+
|
|
742
875
|
- v.3.9.2
|
|
743
876
|
|
|
744
877
|
- Bug fix `Readmi.md`
|
|
745
878
|
|
|
879
|
+
---
|
|
880
|
+
|
|
746
881
|
- v.3.9.1
|
|
747
882
|
|
|
748
883
|
- Bug fix `flt-input-with-picklist` and `flt-picklist`
|
|
749
884
|
|
|
885
|
+
---
|
|
886
|
+
|
|
750
887
|
- v.3.8.6
|
|
751
888
|
|
|
752
889
|
- Bug fix visiability of `flt-input-phone`
|
|
753
890
|
|
|
891
|
+
---
|
|
892
|
+
|
|
754
893
|
- v.3.8.5
|
|
755
894
|
|
|
756
895
|
- Bug fix visiability of `flt-input-phone`
|
|
757
896
|
|
|
897
|
+
---
|
|
898
|
+
|
|
758
899
|
- v.3.8.4
|
|
759
900
|
|
|
760
901
|
- Bug fix visiability of `flt-input-text`
|
|
761
902
|
|
|
903
|
+
---
|
|
904
|
+
|
|
762
905
|
- v.3.8.3
|
|
763
906
|
|
|
764
907
|
- Bug fix visiability of `flt-picklist`
|
|
765
908
|
|
|
909
|
+
---
|
|
910
|
+
|
|
766
911
|
- v.3.8.2
|
|
767
912
|
|
|
768
913
|
- Bug fix visiability of `flt-input-phone`
|
|
769
914
|
|
|
915
|
+
---
|
|
916
|
+
|
|
770
917
|
- v.3.8.1
|
|
771
918
|
|
|
772
919
|
- Bug fix visiability of `flt-picklist`
|
|
773
920
|
|
|
921
|
+
---
|
|
922
|
+
|
|
774
923
|
- v.3.8.0
|
|
775
924
|
|
|
776
925
|
- Added new component `flt-input-phone`
|
|
777
926
|
- Updated: `flt-input-text`, `flt-picklist`
|
|
778
927
|
|
|
928
|
+
---
|
|
929
|
+
|
|
779
930
|
- v.3.7.0
|
|
780
931
|
|
|
781
932
|
- Added new component `flt-picklist`
|
|
782
933
|
|
|
934
|
+
---
|
|
935
|
+
|
|
783
936
|
- v.3.6.3
|
|
784
937
|
|
|
785
938
|
- Updated `flt-button` componentm styles
|
|
786
939
|
|
|
940
|
+
---
|
|
941
|
+
|
|
787
942
|
- v.3.6.2
|
|
788
943
|
|
|
789
944
|
- Updated `flt-radio-group-chips` componentm styles
|
|
790
945
|
|
|
946
|
+
---
|
|
947
|
+
|
|
791
948
|
- v.3.6.1
|
|
792
949
|
|
|
793
950
|
- Bug fix visiability of `flt-loader`
|
|
794
951
|
|
|
952
|
+
---
|
|
953
|
+
|
|
795
954
|
- v.3.6.0
|
|
796
955
|
|
|
797
956
|
- Added new component `flt-loader`
|
|
798
957
|
|
|
958
|
+
---
|
|
959
|
+
|
|
799
960
|
- v.3.5.2
|
|
800
961
|
|
|
801
962
|
- Update modal component with option `deactiveGlass`
|
|
802
963
|
|
|
964
|
+
---
|
|
965
|
+
|
|
803
966
|
- v.3.5.1
|
|
804
967
|
|
|
805
968
|
- Bug fix with progress component
|
|
806
969
|
|
|
970
|
+
---
|
|
971
|
+
|
|
807
972
|
- v.3.5.0
|
|
808
973
|
|
|
809
974
|
- Added new component `flt-card`
|
|
810
975
|
|
|
976
|
+
---
|
|
977
|
+
|
|
811
978
|
- v.3.4.2
|
|
812
979
|
|
|
813
980
|
- Bug fix with modal component
|
|
814
981
|
|
|
982
|
+
---
|
|
983
|
+
|
|
815
984
|
- v.3.4.1
|
|
816
985
|
|
|
817
986
|
- Bug fix with modal component
|
|
818
987
|
|
|
988
|
+
---
|
|
989
|
+
|
|
819
990
|
- v.3.4.0
|
|
820
991
|
|
|
821
992
|
- Added `Animation` util class
|
|
822
993
|
- Updated `Modal` view animation with `fadeIn` and `fadeOut`
|
|
823
994
|
|
|
995
|
+
---
|
|
996
|
+
|
|
824
997
|
- v.3.3.0
|
|
825
998
|
- Added components `flt-input-text`, `flt-input-email`, `flt-modal`
|
|
826
999
|
- For modal added new interface `ModalViewer` for dynamically creation modals
|
|
@@ -1028,3 +1201,5 @@ You can override them as you wish by global css variables as priority.
|
|
|
1028
1201
|
- Added CheckboxElement class
|
|
1029
1202
|
- Added hgv icon
|
|
1030
1203
|
- Added $FLT_BUTTON_LABEL_PADDING constant
|
|
1204
|
+
|
|
1205
|
+
</details>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { api } from 'lwc';
|
|
2
|
+
import { BaseElement } from 'fleetcor-lwc'
|
|
3
|
+
import { UTILS } from 'c/utils';
|
|
4
|
+
import './collapsibleSection.scss';
|
|
5
|
+
|
|
6
|
+
export default class CollapsibleSection extends BaseElement {
|
|
7
|
+
titleSlotNonEmpty;
|
|
8
|
+
|
|
9
|
+
@api isClosed = false;
|
|
10
|
+
@api disableTitleSlotStyle = false;
|
|
11
|
+
|
|
12
|
+
get containerWrapperClass() {
|
|
13
|
+
return this.generateClassNameList({
|
|
14
|
+
'collapsing-section__container-wrapper': true,
|
|
15
|
+
'collapsing-section__container-wrapper_expanded': !this.isClosed
|
|
16
|
+
})
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
get titleClass() {
|
|
20
|
+
if (this.disableTitleSlotStyle) {
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
return UTILS.configToString({
|
|
24
|
+
'collapsing-section_title': this.titleSlotNonEmpty,
|
|
25
|
+
'collapsing-section_title-active': !this.isClosed && this.titleSlotNonEmpty
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
renderedCallback() {
|
|
31
|
+
const titleEmptySlot = this.querySelector('.title-empty-slot');
|
|
32
|
+
if (titleEmptySlot) {
|
|
33
|
+
this.titleSlotNonEmpty = false;
|
|
34
|
+
} else {
|
|
35
|
+
this.titleSlotNonEmpty = true;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
toggleWrapper() {
|
|
40
|
+
if (this.titleSlotNonEmpty) {
|
|
41
|
+
this.isClosed = !this.isClosed;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
.collapsing-section {
|
|
2
|
+
&__container {
|
|
3
|
+
animation: fadeOut 0.5s ease-in;
|
|
4
|
+
|
|
5
|
+
&-wrapper {
|
|
6
|
+
display: grid;
|
|
7
|
+
grid-template-rows: 0fr;
|
|
8
|
+
transition: grid-template-rows 500ms, margin-top 500ms;
|
|
9
|
+
|
|
10
|
+
&_expanded {
|
|
11
|
+
grid-template-rows: 1fr;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&-wrapper > div {
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
margin-top: 0px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&_title {
|
|
22
|
+
font-size: 16px;
|
|
23
|
+
font-weight: 700;
|
|
24
|
+
padding-bottom: 12px;
|
|
25
|
+
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
align-items: center;
|
|
30
|
+
|
|
31
|
+
&:after{
|
|
32
|
+
content:'';
|
|
33
|
+
display: inline-block;
|
|
34
|
+
margin-left: .75rem;
|
|
35
|
+
width: 10px;
|
|
36
|
+
height: 10px;
|
|
37
|
+
border-bottom: 2px solid #111827;
|
|
38
|
+
border-left: 2px solid #111827;
|
|
39
|
+
transform: rotate(-45deg);
|
|
40
|
+
margin-top: -8px;
|
|
41
|
+
transition: all .4s ease-out;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&-active{
|
|
45
|
+
&:after{
|
|
46
|
+
transform: rotate(135deg);
|
|
47
|
+
margin-top: 2px;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|