fleetcor-lwc 3.5.0 → 3.5.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
@@ -246,13 +246,19 @@ Add / update `lwc.config.json` file in your project
246
246
  ### Modal
247
247
 
248
248
  ```html
249
- <flt-modal>
249
+ <flt-modal deactive-glass>
250
250
  <flt-icon icon="arrow-left"></flt-icon>
251
251
  </flt-modal>
252
252
 
253
253
  ...
254
254
  ```
255
255
 
256
+ #### Modal variables
257
+
258
+ | @api variables | type | values | required | description |
259
+ | -------------- | ---- | ------ | -------- | --------------------------------------- |
260
+ | deactiveGlass | bool | | - | Depricate close modal by clicking glass |
261
+
256
262
  #### Modal slot
257
263
 
258
264
  | slot | description |
@@ -408,7 +414,7 @@ This component fully extends from `Input Text`
408
414
 
409
415
  #### ModalViewer
410
416
 
411
- - `ModalViewer.showModalWithComponent(element)` - to show modal window with element inside
417
+ - `ModalViewer.showModalWithComponent(element, options)` - to show modal window with element inside
412
418
  - `ModalViewer.hideModals()` - remove all modals
413
419
 
414
420
  ```js
@@ -422,7 +428,7 @@ btn.onclick = () => {
422
428
  ModalViewer.hideModals();
423
429
  };
424
430
 
425
- ModalViewer.showModalWithComponent(btn);
431
+ ModalViewer.showModalWithComponent(btn, { duration: 700, deactiveGlass: true });
426
432
  ```
427
433
 
428
434
  ## Override styles
@@ -509,6 +515,14 @@ You can override them as you wish by global css variables as priority.
509
515
 
510
516
  ## Release Notes:
511
517
 
518
+ - v.3.5.2
519
+
520
+ - Update modal component with option `deactiveGlass`
521
+
522
+ - v.3.5.1
523
+
524
+ - Bug fix with progress component
525
+
512
526
  - v.3.5.0
513
527
 
514
528
  - Added new component `flt-card`
@@ -29,4 +29,26 @@ describe('flt-modal', () => {
29
29
  expect(removedModalElement).toBeFalsy()
30
30
  }, 1000)
31
31
  })
32
+
33
+ it('deactiveGlass test', () => {
34
+ const progressStep = createElement('flt-progress-step', { is: ProgressStep })
35
+ progressStep.total = 9
36
+ progressStep.current = 2
37
+ progressStep.title = 'Good job'
38
+ ModalViewer.showModalWithComponent(progressStep, { deactiveGlass: true })
39
+
40
+ const modalElement = document.body.querySelector('flt-modal')
41
+ expect(modalElement.firstChild.classList).toContain('flt-modal')
42
+ const progressStepElemet = modalElement.querySelector('flt-progress-step')
43
+ expect(progressStepElemet.total).toBe(9)
44
+ expect(progressStepElemet.current).toBe(2)
45
+ expect(progressStepElemet.title).toBe('Good job')
46
+
47
+ const glassEl = modalElement.querySelector('.flt-modal__glass')
48
+ glassEl.click()
49
+ setTimeout(() => {
50
+ const removedModalElement = document.body.querySelector('flt-modal')
51
+ expect(removedModalElement).toBeTruthy()
52
+ }, 1000)
53
+ })
32
54
  })
@@ -1,8 +1,13 @@
1
1
  import { BaseElement, ModalViewer } from 'fleetcor-lwc'
2
+ import { api } from 'lwc'
2
3
  import './modal.scss'
3
4
 
4
5
  export default class Modal extends BaseElement {
6
+ @api deactiveGlass
7
+
5
8
  handleCloseButton() {
6
- ModalViewer.hideModals()
9
+ if (!this.deactiveGlass) {
10
+ ModalViewer.hideModals()
11
+ }
7
12
  }
8
13
  }
@@ -8,6 +8,7 @@
8
8
  display: flex;
9
9
  align-items: center;
10
10
  justify-content: center;
11
+ overflow-y: auto;
11
12
 
12
13
  &__glass {
13
14
  position: absolute;
@@ -16,12 +16,12 @@ describe('flt-progress-step', () => {
16
16
  progressStep.title = 'Good job'
17
17
  document.body.appendChild(progressStep)
18
18
 
19
- expect(progressStep.firstChild.classList).toContain('progress-step')
19
+ expect(progressStep.firstChild.classList).toContain('flt-progress-step')
20
20
 
21
- const position = progressStep.firstChild.querySelector('.progress-step__number-propotion')
21
+ const position = progressStep.firstChild.querySelector('.flt-progress-step__number-propotion')
22
22
  expect(position.textContent).toBe('2/9')
23
23
 
24
- const title = progressStep.firstChild.querySelector('.progress-step__current-title')
24
+ const title = progressStep.firstChild.querySelector('.flt-progress-step__current-title')
25
25
  expect(title.textContent).toBe('Good job')
26
26
  })
27
27
 
@@ -32,12 +32,12 @@ describe('flt-progress-step', () => {
32
32
  progressStep.title = 'Good job'
33
33
  document.body.appendChild(progressStep)
34
34
 
35
- expect(progressStep.firstChild.classList).toContain('progress-step')
35
+ expect(progressStep.firstChild.classList).toContain('flt-progress-step')
36
36
 
37
- const position = progressStep.firstChild.querySelector('.progress-step__number-propotion')
37
+ const position = progressStep.firstChild.querySelector('.flt-progress-step__number-propotion')
38
38
  expect(position.textContent).toBe('8/9')
39
39
 
40
- const title = progressStep.firstChild.querySelector('.progress-step__current-title')
40
+ const title = progressStep.firstChild.querySelector('.flt-progress-step__current-title')
41
41
  expect(title.textContent).toBe('Good job')
42
42
  })
43
43
  })
@@ -1,7 +1,7 @@
1
1
  <template lwc:render-mode="light">
2
- <div class="progress-step">
3
- <div class="progress-step__number-wrapp">
4
- <svg class="progress-step__circle" width="36px" height="36px" viewBox="0 0 36 36">
2
+ <div class="flt-progress-step">
3
+ <div class="flt-progress-step__number-wrapp">
4
+ <svg class="flt-progress-step__circle" width="36px" height="36px" viewBox="0 0 36 36">
5
5
  <circle cx="18" cy="18" r="16" fill="transparent" stroke-width="4" />
6
6
  <path
7
7
  d={forFirstPathD}
@@ -15,8 +15,8 @@
15
15
  stroke-linecap="round"
16
16
  fill="transparent"></path>
17
17
  </svg>
18
- <div class="progress-step__number-propotion">{current}/{total}</div>
18
+ <div class="flt-progress-step__number-propotion">{current}/{total}</div>
19
19
  </div>
20
- <div class="progress-step__current-title">{title}</div>
20
+ <div class="flt-progress-step__current-title">{title}</div>
21
21
  </div>
22
22
  </template>
@@ -8,7 +8,7 @@ $FLT_STEP_POSITION_NUMBER_COLOR: var(--flt-step-position-number-color, #111827);
8
8
  $FLT_STEP_POSITION_CIRCLE_COLOR: var(--flt-step-position-circle-color, #0a7db8);
9
9
  $FLT_STEP_POSITION_CIRCLE_BACKGROUND: var(--flt-step-position-circle-background, #bbe6fb);
10
10
 
11
- .progress-step {
11
+ .flt-progress-step {
12
12
  position: relative;
13
13
  display: flex;
14
14
  gap: 16px;
@@ -41,9 +41,8 @@ $FLT_STEP_POSITION_CIRCLE_BACKGROUND: var(--flt-step-position-circle-background,
41
41
 
42
42
  &__number-propotion {
43
43
  font-size: 12px;
44
- line-height: 16;
44
+ line-height: 16px;
45
45
  font-weight: $FLT_STEP_POSITION_NUMBER_PROPOTION_FONT_WEIGHT;
46
- letter-spacing: 1px;
47
46
  color: $FLT_STEP_POSITION_NUMBER_COLOR;
48
47
  }
49
48
 
@@ -8,8 +8,9 @@ import Modal from 'flt/modal'
8
8
  * @description This class is used to show and hide modal view
9
9
  */
10
10
  export default class ModalViewer {
11
- static showModalWithComponent(cmp, options = { duration: 300 }) {
11
+ static showModalWithComponent(cmp, options = { duration: 300, deactiveGlass: false }) {
12
12
  const appEl = createElement('flt-modal', { is: Modal })
13
+ appEl.deactiveGlass = options?.deactiveGlass
13
14
  document.body.appendChild(appEl)
14
15
  appEl.querySelector('.flt-modal__container').appendChild(cmp)
15
16
  Animation.fadeIn({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetcor-lwc",
3
- "version": "3.5.0",
3
+ "version": "3.5.2",
4
4
  "description": "LWC framework by Fleetcor",
5
5
  "repository": {
6
6
  "type": "git",