mod-build 3.6.71 → 4.0.0-alpha.1
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/.eslintignore +3 -0
- package/.eslintrc +18 -0
- package/CHANGELOG.md +2 -240
- package/README.md +16 -263
- package/gulp-tasks/build.js +1 -1
- package/package.json +21 -69
- package/siteconfig.js +38 -0
- package/src/accessible-components/button/_button.scss +195 -0
- package/src/accessible-components/button/back-button.html +4 -0
- package/src/accessible-components/button/button.html +17 -0
- package/src/accessible-components/carousel/_carousel.scss +112 -0
- package/src/accessible-components/carousel/carousel.html +25 -0
- package/src/accessible-components/checkbox/_checkbox.scss +96 -0
- package/src/accessible-components/checkbox/checkbox.html +8 -0
- package/src/accessible-components/expand-collapse/_expand-collapse.scss +122 -0
- package/src/accessible-components/expand-collapse/expand-collapse.html +8 -0
- package/src/accessible-components/expand-collapse/expand-collapse.js +52 -0
- package/src/accessible-components/expand-collapse/expand-collapse.min.js +2 -0
- package/src/accessible-components/expand-collapse/expand-collapse.min.js.map +1 -0
- package/src/accessible-components/featured-block/_featured-block.scss +219 -0
- package/src/accessible-components/featured-block/featured-block.html +54 -0
- package/src/accessible-components/foot-assets/foot-assets.html +92 -0
- package/src/accessible-components/footer/footer.html +2 -0
- package/src/{templates/_partials/scripts/gtm-editorials/body/google-tag-manager-body.html → accessible-components/gtm-body/gtm-body.html} +1 -2
- package/src/accessible-components/head/head.html +188 -0
- package/src/accessible-components/header/_header.scss +289 -0
- package/src/accessible-components/header/header.html +66 -0
- package/src/accessible-components/hero/_hero.scss +371 -0
- package/src/accessible-components/hero/hero.html +53 -0
- package/src/accessible-components/how-it-works/_how-it-works.scss +217 -0
- package/src/accessible-components/how-it-works/how-it-works-carousel.html +12 -0
- package/src/accessible-components/how-it-works/how-it-works-static.html +12 -0
- package/src/accessible-components/how-it-works/how-it-works.html +14 -0
- package/src/accessible-components/information/_information.scss +92 -0
- package/src/accessible-components/information/information.html +26 -0
- package/src/accessible-components/input/_input.scss +202 -0
- package/src/accessible-components/input/input.html +22 -0
- package/src/accessible-components/input/textarea.html +9 -0
- package/src/accessible-components/partners/_partners.scss +232 -0
- package/src/accessible-components/partners/partners.html +56 -0
- package/src/accessible-components/picture/picture.html +19 -0
- package/src/accessible-components/preloader/_preloader.scss +61 -0
- package/src/accessible-components/preloader/preloader.html +23 -0
- package/src/accessible-components/progress-bar/_progress-bar.scss +119 -0
- package/src/accessible-components/progress-bar/progress-bar.html +21 -0
- package/src/accessible-components/progress-bar/progress-bar.js +37 -0
- package/src/accessible-components/progress-bar/progress-bar.min.js +2 -0
- package/src/accessible-components/progress-bar/progress-bar.min.js.map +1 -0
- package/src/accessible-components/radio-button/_radio-button.scss +537 -0
- package/src/accessible-components/radio-button/radio-button.html +34 -0
- package/src/accessible-components/reviews/_reviews.scss +175 -0
- package/src/accessible-components/reviews/reviews-carousel.html +12 -0
- package/src/accessible-components/reviews/reviews-static.html +12 -0
- package/src/accessible-components/reviews/reviews.html +37 -0
- package/src/accessible-components/select/_select.scss +69 -0
- package/src/accessible-components/select/select.html +10 -0
- package/src/accessible-components/steps/_steps.scss +524 -0
- package/src/accessible-components/steps/defaultFormFieldConfig.json +109 -0
- package/src/accessible-components/steps/step-fields.html +33 -0
- package/src/accessible-components/steps/steps.html +150 -0
- package/src/accessible-components/tcpa/_tcpa.scss +49 -0
- package/src/accessible-components/tcpa/tcpa.html +9 -0
- package/src/accessible-components/tile/_tile.scss +117 -0
- package/src/accessible-components/tile/tile.html +14 -0
- package/src/accessible-components/value-props/_value-props.scss +100 -0
- package/src/accessible-components/value-props/value-props.html +17 -0
- package/src/accessible-components/zip-control/_zip-control.scss +78 -0
- package/src/accessible-components/zip-control/zip-control.html +10 -0
- package/src/data/footer.js +117 -0
- package/src/data/seasons.js +5 -7
- package/src/data/theme.json +164 -0
- package/src/index.html +18 -0
- package/src/main.js +45 -0
- package/src/resources/scripts/abandonment/abandonment-1df90ee155f6c0893d90.min.js +2 -0
- package/src/resources/scripts/abandonment/abandonment.min.js +2 -0
- package/src/resources/scripts/footer/footer-component-7b5e263f64568573ecc0.min.js +2 -0
- package/src/resources/scripts/footer/footer-component.min.js +2 -0
- package/src/resources/scripts/helpers/initNumericOnlyFields.min.js +2 -0
- package/src/resources/scripts/helpers/initNumericOnlyFields.min.js.map +1 -0
- package/src/resources/scripts/helpers/isZipCodeValid.min.js +2 -0
- package/src/resources/scripts/helpers/isZipCodeValid.min.js.map +1 -0
- package/src/resources/scripts/mod-alytics/modalytics-0ac7d7a5a72ea67a0f47.min.js +2 -0
- package/src/resources/scripts/mod-alytics/modalytics.min.js +2 -0
- package/src/resources/scripts/mod-form/form/homeowner-77a4dd439b8db412678b.min.js +2 -0
- package/src/resources/scripts/mod-form/form/homeowner.min.js +2 -0
- package/src/resources/scripts/mod-utils/modutils-8ba40d21f559171ddd36.min.js +2 -0
- package/src/resources/scripts/mod-utils/modutils.min.js +2 -0
- package/src/resources/styles/components/abandonment/abandonment-ae63aca828944411eff7.min.css +1 -0
- package/src/resources/styles/components/abandonment/abandonment.min.css +1 -0
- package/src/resources/styles/components/footer/mod-footer-3717faf57147c62c1777.min.css +1 -0
- package/src/resources/styles/components/footer/mod-footer.min.css +1 -0
- package/src/resources/styles/components/footer/qs-footer-12bf078dc614ff221c3c.min.css +1 -0
- package/src/resources/styles/components/footer/qs-footer.min.css +1 -0
- package/src/resources/templates/modals/about/index.html +9 -0
- package/src/resources/templates/modals/contact-us/index.html +348 -0
- package/src/resources/templates/modals/faq/index.html +9 -0
- package/src/resources/templates/modals/privacy/index.html +236 -0
- package/src/resources/templates/modals/terms/index.html +166 -0
- package/src/scripts/has-qs-params.js +6 -5
- package/src/scripts/url-cleaner.js +3 -3
- package/src/scripts/utils.js +178 -0
- package/src/styles/home.scss +1 -0
- package/src/temp/scripts/maxmind-geoip2.js +104 -0
- package/src/templates/_partials/scripts/deferred-styles.html +16 -16
- package/src/templates/_partials/scripts/vwo-redirect-callback.html +43 -45
- package/src/templates/components/head.html +70 -0
- package/tasks/clean.js +13 -0
- package/tasks/grab-cdn.js +107 -0
- package/tasks/grab-form-helpers.js +94 -0
- package/tasks/grab-shared-components.js +81 -0
- package/tasks/grab-shared-scripts.js +267 -0
- package/tasks/serve.js +15 -0
- package/tasks/templates.js +168 -0
- package/template.js +801 -0
- package/vite.config.js +56 -0
- package/.eslintrc.yml +0 -59
- package/src/data/common.js +0 -704
- package/src/data/components/qs-footer.js +0 -55
- package/src/data/components/quote-footer.js +0 -73
- package/src/scripts/apt-block.js +0 -919
- package/src/scripts/components/custom-selects.js +0 -48
- package/src/scripts/components/radio-panels.js +0 -45
- package/src/scripts/es6-1.js +0 -6
- package/src/scripts/es6-2.js +0 -2
- package/src/scripts/qs-form.js +0 -839
- package/src/scripts/vendor/maxmind-geoip2.js +0 -2
- package/src/scripts/vendor/swiper.min.js +0 -13
- package/src/styles/apt-block.scss +0 -888
- package/src/templates/_partials/apt-block.html +0 -30
- package/src/templates/_partials/scripts/analytics.html +0 -4
- package/src/templates/_partials/scripts/go-page-hiding-snippet.html +0 -8
- package/src/templates/_partials/scripts/google-maps.html +0 -1
- package/src/templates/_partials/scripts/google-optimize.html +0 -12
- package/src/templates/_partials/scripts/gtm-editorials/head/google-tag-manager-head.html +0 -10
- package/src/templates/_partials/scripts/gtm-hil/body/google-tag-manager-body.html +0 -5
- package/src/templates/_partials/scripts/gtm-hil/head/google-tag-manager-head.html +0 -10
- package/src/templates/_partials/scripts/gtm-pro/body/google-tag-manager-body.html +0 -5
- package/src/templates/_partials/scripts/gtm-pro/head/google-tag-manager-head.html +0 -10
- package/src/templates/_partials/scripts/gtm-quote/body/google-tag-manager-body.html +0 -5
- package/src/templates/_partials/scripts/gtm-quote/head/google-tag-manager-head.html +0 -9
- package/src/templates/_partials/scripts/gtm-whitelabel/body/mod-google-tag-manager-body.html +0 -5
- package/src/templates/_partials/scripts/gtm-whitelabel/body/non-mod-google-tag-manager-body.html +0 -5
- package/src/templates/_partials/scripts/gtm-whitelabel/head/mod-google-tag-manager-head.html +0 -10
- package/src/templates/_partials/scripts/gtm-whitelabel/head/non-mod-google-tag-manager-head.html +0 -9
- package/src/templates/_partials/scripts/gtm-wordpress/body/google-tag-manager-body.html +0 -5
- package/src/templates/_partials/scripts/gtm-wordpress/head/google-tag-manager-head.html +0 -9
- package/src/templates/_partials/scripts/visual-website-optimizer.html +0 -5
- package/src/templates/index.html +0 -46
- /package/{src → public}/favicon.ico +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@keyframes fadeOut {
|
|
2
|
+
from {
|
|
3
|
+
opacity: 1;
|
|
4
|
+
z-index: 9;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
to {
|
|
8
|
+
opacity: 0;
|
|
9
|
+
z-index: -1;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes animateArrowUp {
|
|
14
|
+
0% {
|
|
15
|
+
opacity: 0;
|
|
16
|
+
padding-top: 150px;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
40% {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
padding-top: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
100% {
|
|
25
|
+
opacity: 1;
|
|
26
|
+
padding-top: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.preloader {
|
|
31
|
+
animation: fadeOut 250ms 1250ms ease forwards;
|
|
32
|
+
background-color: $color-white;
|
|
33
|
+
display: block;
|
|
34
|
+
height: 100%;
|
|
35
|
+
opacity: 1;
|
|
36
|
+
position: fixed;
|
|
37
|
+
width: 100%;
|
|
38
|
+
z-index: 9;
|
|
39
|
+
|
|
40
|
+
&__text {
|
|
41
|
+
color: $color-charcoal5;
|
|
42
|
+
font-size: 22px;
|
|
43
|
+
font-weight: 700;
|
|
44
|
+
padding-bottom: 30px;
|
|
45
|
+
padding-top: 200px;
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&__logo {
|
|
50
|
+
margin: 0 auto;
|
|
51
|
+
max-width: 310px;
|
|
52
|
+
padding-bottom: 30px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&__arrow {
|
|
56
|
+
animation: animateArrowUp 1000ms 450ms ease-out forwards;
|
|
57
|
+
opacity: 0;
|
|
58
|
+
margin: 0 auto;
|
|
59
|
+
max-width: 72px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<div class="preloader{{#if this.preloader.attributes.class}} {{this.preloader.attributes.class}}{{/if}}" {{{addAttributes this.preloader 'class'}}}>
|
|
2
|
+
<div class="preloader__text">{{this.preloader.text}}</div>
|
|
3
|
+
<div class="preloader__logo{{#if this.preloader.logo.attributes.class}} {{this.preloader.logo.attributes.class}}{{/if}}" {{{addAttributes this.preloader.logo 'class'}}}>
|
|
4
|
+
{{#if this.preloader.logo}}
|
|
5
|
+
{{ fileInclude 'src/accessible-components/picture/picture.html'
|
|
6
|
+
picture = this.preloader.logo.picture
|
|
7
|
+
}}
|
|
8
|
+
{{/if}}
|
|
9
|
+
</div>
|
|
10
|
+
{{#if this.preloader.showArrows}}
|
|
11
|
+
<div class="preloader__arrow"><img src="https://{{x 'process.env.NODE_ENV'}}/quote/resources/assets/images/illustrations/misc/pre-landing-page-arrow.svg" alt=""></div>
|
|
12
|
+
{{/if}}
|
|
13
|
+
</div>
|
|
14
|
+
<script>
|
|
15
|
+
if (!window.localStorage.getItem('pr')) {
|
|
16
|
+
window.localStorage.setItem('pr', true);
|
|
17
|
+
setTimeout(function() {
|
|
18
|
+
window.document.querySelector('.preloader').remove();
|
|
19
|
+
}, 1500);
|
|
20
|
+
} else {
|
|
21
|
+
window.document.querySelector('.preloader').remove();
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
$progress-bar-background-color: $color-charcoal1 !default;
|
|
2
|
+
$progress-bar-border-radius: 0 !default;
|
|
3
|
+
$progress-bar-border-radius-desktop: 4px !default;
|
|
4
|
+
$progress-bar-display: none !default;
|
|
5
|
+
$progress-bar-height: 5px !default;
|
|
6
|
+
$progress-bar-margin: 0 !default;
|
|
7
|
+
$progress-bar-margin-desktop: 0 0 15px !default;
|
|
8
|
+
$progress-bar-position-top: unset !default;
|
|
9
|
+
$progress-bar-position-left: unset !default;
|
|
10
|
+
$progress-bar-position: relative !default;
|
|
11
|
+
$progress-bar-width: 100% !default;
|
|
12
|
+
|
|
13
|
+
$progress-bar-fill-border-radius: $progress-bar-border-radius !default;
|
|
14
|
+
$progress-bar-fill-color: $color-charcoal6 !default;
|
|
15
|
+
$progress-bar-fill-percentage-color: $color-white !default;
|
|
16
|
+
$progress-bar-fill-percentage-height: 28px !default;
|
|
17
|
+
$progress-bar-fill-percentage-font-size: 1rem !default;
|
|
18
|
+
$progress-bar-fill-transition: width .65s !default;
|
|
19
|
+
|
|
20
|
+
$progress-bar-title-color: $color-charcoal4 !default;
|
|
21
|
+
$progress-bar-title-letter-spacing: .03rem !default;
|
|
22
|
+
$progress-bar-title-font-size: .75rem !default;
|
|
23
|
+
$progress-bar-title-margin: 0 0 4px !default;
|
|
24
|
+
$progress-bar-title-text-transform: none !default;
|
|
25
|
+
|
|
26
|
+
$progress-bar-inprogress-display: block !default;
|
|
27
|
+
|
|
28
|
+
.progress-bar {
|
|
29
|
+
display: $progress-bar-display;
|
|
30
|
+
left: $progress-bar-position-left;
|
|
31
|
+
margin: $progress-bar-margin;
|
|
32
|
+
position: $progress-bar-position;
|
|
33
|
+
top: $progress-bar-position-top;
|
|
34
|
+
width: $progress-bar-width;
|
|
35
|
+
z-index: 2;
|
|
36
|
+
|
|
37
|
+
&__title {
|
|
38
|
+
color: $progress-bar-title-color;
|
|
39
|
+
display: block;
|
|
40
|
+
font-size: $progress-bar-title-font-size;
|
|
41
|
+
letter-spacing: $progress-bar-title-letter-spacing;
|
|
42
|
+
margin: $progress-bar-title-margin;
|
|
43
|
+
position: relative;
|
|
44
|
+
text-transform: $progress-bar-title-text-transform;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__percentage {
|
|
49
|
+
position: absolute;
|
|
50
|
+
right: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&__background,
|
|
54
|
+
&__fill {
|
|
55
|
+
background-color: $progress-bar-background-color;
|
|
56
|
+
border-radius: $progress-bar-border-radius;
|
|
57
|
+
height: $progress-bar-height;
|
|
58
|
+
position: relative;
|
|
59
|
+
width: 100%;
|
|
60
|
+
z-index: 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&__fill {
|
|
64
|
+
background-color: $progress-bar-fill-color;
|
|
65
|
+
border-radius: $progress-bar-fill-border-radius;
|
|
66
|
+
position: absolute;
|
|
67
|
+
top: 0;
|
|
68
|
+
transition: $progress-bar-fill-transition;
|
|
69
|
+
width: 0;
|
|
70
|
+
z-index: 2;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&__percentage {
|
|
74
|
+
display: none;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.form-in-progress {
|
|
79
|
+
.progress-bar {
|
|
80
|
+
display: $progress-bar-inprogress-display;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@include breakpoint-md {
|
|
85
|
+
.progress-bar {
|
|
86
|
+
margin: $progress-bar-margin-desktop;
|
|
87
|
+
|
|
88
|
+
&__background,
|
|
89
|
+
&__fill {
|
|
90
|
+
border-radius: $progress-bar-border-radius-desktop;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&--includes-fill-percentage {
|
|
94
|
+
.progress-bar {
|
|
95
|
+
&__background,
|
|
96
|
+
&__fill {
|
|
97
|
+
height: auto;
|
|
98
|
+
line-height: $progress-bar-fill-percentage-height;
|
|
99
|
+
min-height: $progress-bar-fill-percentage-height;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__fill {
|
|
103
|
+
position: relative;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__percentage {
|
|
107
|
+
color: $progress-bar-fill-percentage-color;
|
|
108
|
+
display: block;
|
|
109
|
+
font-size: $progress-bar-fill-percentage-font-size;
|
|
110
|
+
position: relative;
|
|
111
|
+
right: auto;
|
|
112
|
+
text-align: center;
|
|
113
|
+
width: 100%;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div class="progress-bar{{#xif 'this.bar && this.bar.attributes && this.bar.attributes.class'}} {{this.bar.attributes.class}}{{/xif}}{{#xif "this.bar && this.bar.includePercentage && this.bar.includePercentage === 'fill'"}} progress-bar--includes-fill-percentage{{/xif}}" {{#if this.bar}}{{{addAttributes this.bar 'class'}}}{{/if}}>
|
|
2
|
+
{{#if this.bar.title}}
|
|
3
|
+
<div class="progress-bar__title">
|
|
4
|
+
{{{this.bar.title}}}
|
|
5
|
+
{{#xif "this.bar.includePercentage === 'title'"}}
|
|
6
|
+
<span class="progress-bar__percentage"></span>
|
|
7
|
+
{{/xif}}
|
|
8
|
+
</div>
|
|
9
|
+
{{/if}}
|
|
10
|
+
{{#if this.bar.includeStepCount}}
|
|
11
|
+
<div class="progress-bar__title">Step <span class="progress-bar__current"></span> of <span class="progress-bar__total"></span></div>
|
|
12
|
+
{{/if}}
|
|
13
|
+
<div class="progress-bar__background">
|
|
14
|
+
<div class="progress-bar__fill">
|
|
15
|
+
{{#xif "this.bar && this.bar.includePercentage && this.bar.includePercentage === 'fill'"}}
|
|
16
|
+
<span class="visually-hidden">Form Progress</span>
|
|
17
|
+
<span class="progress-bar__percentage"></span>
|
|
18
|
+
{{/xif}}
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* global modForm */
|
|
4
|
+
function updateProgressBar(index) {
|
|
5
|
+
var showStepCountOnStep1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
6
|
+
var stepCount = modForm.opts.steps.length,
|
|
7
|
+
fillElement = document.querySelectorAll('.progress-bar__fill'),
|
|
8
|
+
percentageElement = document.querySelectorAll('.progress-bar__percentage'),
|
|
9
|
+
totalStepsElement = document.querySelectorAll('.progress-bar__total'),
|
|
10
|
+
currentStepElement = document.querySelectorAll('.progress-bar__current'),
|
|
11
|
+
width = Math.min(100, 100 * index / stepCount - 1);
|
|
12
|
+
fillElement.forEach(function (fill) {
|
|
13
|
+
fill.style.width = width + '%';
|
|
14
|
+
});
|
|
15
|
+
if (percentageElement) {
|
|
16
|
+
percentageElement.forEach(function (percent) {
|
|
17
|
+
percent.textContent = Math.round(width) + '%';
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
if (currentStepElement) {
|
|
21
|
+
if (showStepCountOnStep1 === true) {
|
|
22
|
+
totalStepsElement.forEach(function (total) {
|
|
23
|
+
total.textContent = stepCount;
|
|
24
|
+
});
|
|
25
|
+
currentStepElement.forEach(function (current) {
|
|
26
|
+
current.textContent = index;
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
totalStepsElement.forEach(function (total) {
|
|
30
|
+
total.textContent = stepCount - 1;
|
|
31
|
+
});
|
|
32
|
+
currentStepElement.forEach(function (current) {
|
|
33
|
+
current.textContent = index - 1;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";function updateProgressBar(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=modForm.opts.steps.length,r=document.querySelectorAll(".progress-bar__fill"),n=document.querySelectorAll(".progress-bar__percentage"),c=document.querySelectorAll(".progress-bar__total"),u=document.querySelectorAll(".progress-bar__current"),l=Math.min(100,100*t/o-1);r.forEach(function(t){t.style.width=l+"%"}),n&&n.forEach(function(t){t.textContent=Math.round(l)+"%"}),u&&(!0===e?(c.forEach(function(t){t.textContent=o}),u.forEach(function(e){e.textContent=t})):(c.forEach(function(t){t.textContent=o-1}),u.forEach(function(e){e.textContent=t-1})))}
|
|
2
|
+
//# sourceMappingURL=progress-bar.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["accessible-components/progress-bar/progress-bar.js"],"names":["updateProgressBar","index","showStepCountOnStep1","arguments","length","undefined","stepCount","modForm","opts","steps","fillElement","document","querySelectorAll","percentageElement","totalStepsElement","currentStepElement","width","Math","min","forEach","fill","style","percent","textContent","round","total","current"],"mappings":"YACA,SAASA,mBAAmBC,GAAqC,GAA9BC,GAAoBC,UAAAC,OAAA,OAAAC,KAAAF,UAAA,IAAAA,UAAA,GAChDG,EAAaC,QAAQC,KAAKC,MAAML,OACrCM,EAAcC,SAASC,iBAAiB,uBACxCC,EAAoBF,SAASC,iBAAiB,6BAC9CE,EAAoBH,SAASC,iBAAiB,wBAC9CG,EAAqBJ,SAASC,iBAAiB,0BAC/CI,EAAQC,KAAKC,IAAI,IAAK,IAAOjB,EAASK,EAAY,EAEnDI,GAAYS,QAAQ,SAACC,GACpBA,EAAKC,MAAML,MAAQA,EAAQ,MAExBH,GACHA,EAAkBM,QAAQ,SAACG,GAC1BA,EAAQC,YAAcN,KAAKO,MAAMR,GAAS,MAGxCD,KAC0B,IAAzBb,GACHY,EAAkBK,QAAQ,SAACM,GAC1BA,EAAMF,YAAcjB,IAErBS,EAAmBI,QAAQ,SAACO,GAC3BA,EAAQH,YAActB,MAGvBa,EAAkBK,QAAQ,SAACM,GAC1BA,EAAMF,YAAcjB,EAAY,IAEjCS,EAAmBI,QAAQ,SAACO,GAC3BA,EAAQH,YAActB,EAAQ","file":"progress-bar.min.js","sourcesContent":["/* global modForm */\nfunction updateProgressBar (index, showStepCountOnStep1 = false) {\n\tconst stepCount = modForm.opts.steps.length,\n\t\tfillElement = document.querySelectorAll('.progress-bar__fill'),\n\t\tpercentageElement = document.querySelectorAll('.progress-bar__percentage'),\n\t\ttotalStepsElement = document.querySelectorAll('.progress-bar__total'),\n\t\tcurrentStepElement = document.querySelectorAll('.progress-bar__current'),\n\t\twidth = Math.min(100, 100 * (index) / stepCount - 1);\n\n\tfillElement.forEach((fill) => {\n\t\tfill.style.width = width + '%';\n\t});\n\tif (percentageElement) {\n\t\tpercentageElement.forEach((percent) => {\n\t\t\tpercent.textContent = Math.round(width) + '%';\n\t\t});\n\t}\n\tif (currentStepElement) {\n\t\tif (showStepCountOnStep1 === true) {\n\t\t\ttotalStepsElement.forEach((total) => {\n\t\t\t\ttotal.textContent = stepCount;\n\t\t\t});\n\t\t\tcurrentStepElement.forEach((current) => {\n\t\t\t\tcurrent.textContent = index;\n\t\t\t});\n\t\t} else {\n\t\t\ttotalStepsElement.forEach((total) => {\n\t\t\t\ttotal.textContent = stepCount - 1;\n\t\t\t});\n\t\t\tcurrentStepElement.forEach((current) => {\n\t\t\t\tcurrent.textContent = index - 1;\n\t\t\t});\n\t\t}\n\t}\n}\n"]}
|