dta_rapid 0.7.4 → 0.7.5
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.
- checksums.yaml +4 -4
- data/_includes/forms/date-field.html +14 -1
- data/_includes/forms/item-table.html +23 -3
- data/_layouts/default.html +1 -1
- data/assets/css/style.min.css +1 -1
- data/assets/js/vendor/main.js +0 -77
- data/assets/js/vendor/parsley.js +2462 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbfed5506a1d9ab96c72a2f58b66de84160ea2ae
|
4
|
+
data.tar.gz: da60ceb9d4d648a20720f1f318b34ad9f4e14c86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee506bd8c9596f8a248c47e71ffe7970612e60e2d6c8b5d3e8dd5a133081b07f6e80e43e78f681b138e72647b3accaa147bb4be889ec9cfa67e07ee321f448b2
|
7
|
+
data.tar.gz: fdae7c670bf26ce580de620b70f6ee1faabc283bab93f454488b3762fc3676561364e91423319fb9111880ddd833aca523e951d34e51b0700938a015c79ff83c
|
@@ -7,5 +7,18 @@
|
|
7
7
|
name="{{ include.id }}"
|
8
8
|
{% if include.required %}data-parsley-required{% endif %}
|
9
9
|
{% if include.validation_message %}data-parsley-error-message="{{ include.validation_message }}"{% endif %}
|
10
|
-
|
10
|
+
{% if include.pattern %}data-parsley-pattern="{{ include.pattern }}"{% endif %}
|
11
|
+
{% if include.past_date %}data-parsley-past-date{% endif %}
|
12
|
+
>
|
11
13
|
</p>
|
14
|
+
|
15
|
+
<script type="text/javascript">
|
16
|
+
document.addEventListener("DOMContentLoaded", function(event) {
|
17
|
+
window.Parsley.addValidator('pastDate', {
|
18
|
+
validateString: function(value) { return new Date() > new Date(value) },
|
19
|
+
messages: {
|
20
|
+
en: 'Please enter a date in the past',
|
21
|
+
}
|
22
|
+
});
|
23
|
+
});
|
24
|
+
</script>
|
@@ -10,9 +10,29 @@
|
|
10
10
|
<tbody>
|
11
11
|
{% for i in (1..3) %}
|
12
12
|
<tr class="item-row">
|
13
|
-
<td data-label="Date">
|
14
|
-
|
15
|
-
|
13
|
+
<td data-label="Date">
|
14
|
+
{% include forms/date-field.html
|
15
|
+
pattern="\d{4}-\d{2}-\d{2}"
|
16
|
+
required="true"
|
17
|
+
past_date="true"
|
18
|
+
%}
|
19
|
+
</td>
|
20
|
+
|
21
|
+
<td data-label="Item number">
|
22
|
+
{% include forms/text-field.html
|
23
|
+
pattern="[0-9]*"
|
24
|
+
required="true"
|
25
|
+
%}
|
26
|
+
</td>
|
27
|
+
|
28
|
+
<td data-label="Amount">
|
29
|
+
{% include forms/text-field.html placeholder="$"
|
30
|
+
pattern="[0-9]*"
|
31
|
+
type="number"
|
32
|
+
step="0.01"
|
33
|
+
required="true"
|
34
|
+
%}
|
35
|
+
</td>
|
16
36
|
</tr>
|
17
37
|
{% endfor %}
|
18
38
|
</tbody>
|
data/_layouts/default.html
CHANGED
@@ -48,7 +48,7 @@
|
|
48
48
|
</div>
|
49
49
|
</main>
|
50
50
|
<script src="/assets/js/vendor/jquery-3.1.1.min.js"></script>
|
51
|
-
<script src="/assets/js/vendor/parsley.
|
51
|
+
<script src="/assets/js/vendor/parsley.js"></script>
|
52
52
|
<script src="/assets/js/vendor/list.min.js"></script>
|
53
53
|
</body>
|
54
54
|
|
data/assets/css/style.min.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
/*! PANCAKE v1.1.0 PANCAKE-SASS v1.1.0 *//*! @gov.au/core v0.1.0 *//*! @gov.au/body v0.1.1 */@media print{.uikit-body *{text-shadow:none !important;color:#000 !important;background:#fff !important;box-shadow:none !important;border-color:#000 !important}.uikit-body a,.uikit-body a:visited{text-decoration:underline}.uikit-body a[href]:after{content:" (" attr(href) ")"}.uikit-body abbr[title]:after{content:" (" attr(title) ")"}.uikit-body a[href^="javascript:"]:after,.uikit-body a[href^="#"]:after{content:""}.uikit-body a[rel~='external']:after{display:none !important}.uikit-body pre,.uikit-body blockquote{border:1px solid #000;padding:6px;page-break-inside:avoid}.uikit-body thead{display:table-header-group}.uikit-body tr,.uikit-body img{page-break-inside:avoid}.uikit-body img{max-width:100% !important}.uikit-body p,.uikit-body h2,.uikit-body h3{orphans:3;widows:3}.uikit-body h2,.uikit-body h3{page-break-after:avoid}.uikit-body p a{word-wrap:break-word}.uikit-body select{background:#fff !important}}.uikit-body{margin:0;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.6;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131}.uikit-body a{-webkit-text-decoration-skip:objects;color:#313131;text-decoration:none;border-bottom:solid 1px #008752;transition:background-color 0.1s ease-in-out, border-color 0.1s ease-in-out}.uikit-body a:hover,.uikit-body a:focus{background-color:#07b470;border-color:transparent}.uikit-body a:focus{outline:1px solid #313131;outline-offset:1px}.uikit-body a[rel~='external']:after{content:' ';display:inline-block;width:0.7em;height:0.8em;margin:0 0.1em 0 0.25em;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23008752' d='M24.002 8C15.155 8 8 15.164 8 24.002v79.996C8 112.845 15.164 120 24.002 120h79.996c8.847 0 16.002-7.164\a 16.002-16.002V82.005c0-1.107-.895-2.005-1.994-2.005h-12.012c-1.1 0-1.994.893-1.994 1.995v16.008c0 3.312-2.685 5.997-5.997 5.997H29.997C26.685\a 104 24 101.315 24 98.003V29.997C24 26.685 26.685 24 29.997 24h16.008C47.107 24 48 23.105 48 22.006V9.994C48 8.894 47.103 8 45.995 8H24.002z'/%3E\a %3Cpath fill='%23008752' d='M127.416.584c-.36-.36-.86-.584-1.41-.584H73.994C72.904 0 72 .893 72 1.994v12.012c0 1.1.892 1.994 1.993 1.994H96L49.41\a 62.59c-.777.777-.774 2.046.01 2.83l13.16 13.16c.793.793 2.052.788 2.83.01L112 32v22.007c0 1.09.893 1.993 1.994 1.993h12.012c1.1 0 1.994-.892\a 1.994-1.993V1.993c0-.545-.223-1.043-.584-1.405V.584z'/%3E\a %3C/svg%3E");background-repeat:no-repeat;background-position-y:0.12em}.ie8 .uikit-body a[rel~='external']:after,.lt-ie8 .uikit-body a[rel~='external']:after{content:'⇗';color:#008752}.uikit-body [tabindex="0"]:focus,.uikit-body :target{outline:1px solid #313131;outline-offset:1px}.uikit-body mark,.uikit-body ::selection{background-color:rgba(250,194,102,0.5)}.uikit-body p{max-width:42em;margin:0 0 1.6em 0}.uikit-body ul,.uikit-body ol,.uikit-body dl,.uikit-body pre{margin-top:0;margin-bottom:1.6em}.uikit-body ul,.uikit-body ol,.uikit-body dd{margin-left:0;padding-left:1.6em}.uikit-body ul>li,.uikit-body ol>li{margin-bottom:.4em}.uikit-body ul>li>ul,.uikit-body ul>li>ol,.uikit-body ol>li>ul,.uikit-body ol>li>ol{margin-top:.4em;margin-bottom:.8em}.uikit-body ul>ul,.uikit-body ol>ul{list-style-type:disc}.uikit-body dl>dd{margin-bottom:1.6em}.uikit-body dl>dt{font-weight:bold;margin-top:.8em;margin-bottom:.8em}.uikit-body dl>dt:first-of-type{margin-top:0}.uikit-body em,.uikit-body i{font-style:italic}.uikit-body strong{font-weight:bold}.uikit-body small{font-size:87.5%;color:#464646}.uikit-body s{text-decoration:line-through}.uikit-body del{text-decoration:line-through;color:#5a5a5a}.uikit-body ins{text-decoration-line:underline;text-decoration-style:dashed}.uikit-body dfn{font-style:normal}.uikit-body abbr,.uikit-body abbr[title]{font-size:18px;font-variant:small-caps;text-transform:lowercase;letter-spacing:1px;text-decoration:none;border-bottom:1px dotted #555;cursor:help}.uikit-body a abbr{padding-bottom:1px}.uikit-body var{padding:0 1px;font-style:italic;font-family:serif}.uikit-body var sup,.uikit-body var sub{font-family:"Open Sans",Verdana,"Bitstream Vera Sans",sans-serif;font-style:normal;padding:0 1px}.uikit-body sub,.uikit-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.uikit-body sub{bottom:-0.25em}.uikit-body sup{top:-0.5em}.uikit-body code,.uikit-body kbd,.uikit-body pre{font-family:"Lucida Sans Typewriter","Lucida Console",Monaco,"Bitstream Vera Sans Mono",monospace}.uikit-body pre code,.uikit-body pre samp,.uikit-body pre kbd{font-size:14px}.uikit-body kbd{display:inline-block;font-size:14px;border:solid 1px #008752;border-radius:3px;box-shadow:0 1px 0 0 #008752;background-color:#fefefe;text-align:center;padding:0 .8em;margin:0 2px}.uikit-body hr{box-sizing:content-box;height:0;overflow:visible;border:none;border-top:1px solid #555;margin-bottom:1.6em}/*! @gov.au/link-list v0.1.0 */.uikit-link-list{display:block;list-style-type:none}.uikit-body .uikit-link-list{margin:0;padding:.4em 0}.uikit-link-list>li{display:block;margin:.4em}.uikit-link-list.uikit-link-list--inline{display:inline-block}.uikit-link-list.uikit-link-list--inline>li{display:inline-block}.uikit-link-list.uikit-link-list--inverted{background-color:#313131;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.uikit-link-list.uikit-link-list--inverted>li>a{color:#fff;border-color:#07b470;transition:color 0.1s ease-in-out}.uikit-link-list.uikit-link-list--inverted>li>a:hover,.uikit-link-list.uikit-link-list--inverted>li>a:focus{background-color:#07b470;color:#313131}/*! @gov.au/breadcrumbs v0.1.0 */@media print{.uikit-breadcrumbs>.uikit-link-list>li:after{border-color:#000 !important}}.uikit-breadcrumbs{display:none;width:100%;margin:0;color:#313131;font-size:14px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif}@media (min-width: 768px){.uikit-breadcrumbs{display:inline-block}}.uikit-breadcrumbs>.uikit-link-list>li{margin:0}.uikit-breadcrumbs>.uikit-link-list>li:after{content:' ';display:inline-block;width:0.8em;height:0.8em;margin:0 .8em;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23555' d='M128 64l-64 64-16-16 64-64'/%3E\a %3Cpath fill='%23555' d='M128 64l-16 16-64-64L64 0'/%3E\a %3C/svg%3E")}.uikit-breadcrumbs>.uikit-link-list>li:last-child:after{display:none}.ie8 .uikit-breadcrumbs>.uikit-link-list>li:after,.lt-ie8 .uikit-breadcrumbs>.uikit-link-list>li:after{content:' > ';display:inline-block;border:none}.uikit-breadcrumbs.uikit-breadcrumbs--inverted{color:#fff}.uikit-breadcrumbs.uikit-breadcrumbs--inverted>.uikit-link-list>li:not(:last-child):after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23fff' d='M128 64l-64 64-16-16 64-64'/%3E\a %3Cpath fill='%23fff' d='M128 64l-16 16-64-64L64 0'/%3E\a %3C/svg%3E")}/*! @gov.au/buttons v0.3.0 */@media print{.uikit-btn{background-color:#fff !important;border:2px solid #000 !important;color:#000 !important}.uikit-btn:disabled{background-color:#ccc !important}}.uikit-btn{display:inline-block;-webkit-appearance:none;border:none;background:none;font-size:17px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-weight:bold;color:#fff;text-decoration:none;border-radius:3px;background-color:#008752;padding:.8em 1.2em;cursor:pointer;transition:background 0.1s ease}.uikit-btn:focus,.uikit-btn:hover{background-color:#005f39}.uikit-btn:focus{outline:1px solid #313131;outline-offset:1px}.uikit-btn:disabled{background-color:#ccc;font-weight:normal;color:#313131;border:1px dotted #313131;cursor:not-allowed}.uikit-btn:disabled:focus,.uikit-btn:disabled:hover{background-color:#ccc}.uikit-btn--secondary{background-color:#313131}.uikit-btn--secondary:focus,.uikit-btn--secondary:hover{background-color:#6f6f6f}.uikit-btn--tertiary{background-color:#fff;color:#313131;border:1px solid #008752}.uikit-btn--tertiary:focus,.uikit-btn--tertiary:hover{background-color:#e6f3ee}.uikit-btn--block{display:block;width:100%;box-sizing:border-box;text-align:center}.uikit-btn--block+.uikit-btn--block{margin-top:.4em}/*! @gov.au/callout v0.1.1 */@media print{.uikit-callout{border-top:1px solid #000 !important;border-right:1px solid #000 !important;border-bottom:1px solid #000 !important}}.uikit-callout{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131;line-height:1.6;margin:1.6em .4em;padding:1.2em 1.2em 1.2em .8em;border-left:6px solid #008752;border-radius:3px;box-shadow:2px 0 6px rgba(49,49,49,0.7);max-width:42em}.uikit-callout :first-child{margin-top:0}.uikit-callout :last-child{margin-bottom:0}.ie8 .uikit-callout,.lt-ie8 .uikit-callout{border-top:1px solid #555;border-right:1px solid #555;border-bottom:1px solid #555}.uikit-callout--calendar-event{background-color:#f0f3f5}.uikit-callout--calendar-event__lede,.uikit-callout--calendar-event__time,.uikit-callout--calendar-event__name{display:block}.uikit-callout--calendar-event__lede,.uikit-callout--calendar-event__time,.uikit-callout--calendar-event__name{margin-bottom:.8em}.uikit-callout--calendar-event__lede{font-size:18px}.uikit-callout--calendar-event__time,.uikit-callout--calendar-event__name{font-size:32px}.uikit-callout--calendar-event__time{font-weight:bold;margin-bottom:0}/*! @gov.au/control-input v0.1.0 */@media print{.uikit-control-input__text:after{display:none !important}}.uikit-control-input{display:inline-block;position:relative}.uikit-control-input__input{display:inline-block;line-height:1.6;margin:0 0px 0 7px}.uikit-control-input__input:hover{cursor:pointer}.uikit-control-input__input:hover+.uikit-control-input__text{cursor:pointer}.uikit-control-input__input[type=checkbox]+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23313131' d='M0 0h128v128H0z'/%3E\a %3Cpath fill='%23fff' d='M8 8h112v112H8z'/%3E\a %3C/svg%3E")}.uikit-control-input__input[type=checkbox]:checked+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23313131' d='M0 0h128v128H0z'/%3E\a %3Cpath fill='%23fff' d='M8 8h112v112H8z'/%3E\a %3Cpath fill='%23313131' d='M16 16h96v96H16z'/%3E\a %3Cpath fill='%23fff' d='M102.59 45.41c.778-.778.782-2.038-.002-2.822l-9.176-9.176c-.78-.78-2.052-.772-2.823 0L56 68 41.42\a 53.42c-.784-.784-2.048-.792-2.832-.008l-9.176 9.176c-.78.78-.775 2.05-.004 2.82l25.184 25.184c.778.778 2.04.775 2.82-.003l45.177-45.18z'/%3E\a %3C/svg%3E")}.uikit-control-input--full>.uikit-control-input__input[type=checkbox]+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23313131' d='M0 0h128v128H0z'/%3E\a %3Cpath fill='%23fff' d='M8 8h112v112H8z'/%3E\a %3C/svg%3E")}.uikit-control-input--full>.uikit-control-input__input[type=checkbox]:checked+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23313131' d='M0 0h128v128H0z'/%3E\a %3Cpath fill='%23fff' d='M8 8h112v112H8z'/%3E\a %3Cpath fill='%23313131' d='M16 16h96v96H16z'/%3E\a %3C/svg%3E")}.uikit-control-input__input[type=radio]+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E\a %3Ccircle fill='%23fff' cx='64' cy='64' r='56'/%3E\a %3C/svg%3E")}.uikit-control-input__input[type=radio]:checked+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E\a %3Ccircle fill='%23fff' cx='64' cy='64' r='56'/%3E\a %3Ccircle fill='%23313131' cx='64' cy='64' r='44'/%3E\a %3Cpath fill='%23fff' fill-rule='nonzero' d='M94.588 53.412c.78-.78.784-2.04 0-2.824l-9.176-9.176c-.78-.78-2.05-.775-2.82-.004L56 68 45.412\a 57.412c-.78-.78-2.04-.784-2.824 0l-9.176 9.176c-.78.78-.782 2.042 0 2.824l21.176 21.176c.78.78 2.04.784 2.824 0l37.176-37.176z'/%3E\a %3C/svg%3E")}.uikit-control-input--full>.uikit-control-input__input[type=radio]+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E\a %3Ccircle fill='%23fff' cx='64' cy='64' r='56'/%3E\a %3C/svg%3E")}.uikit-control-input--full>.uikit-control-input__input[type=radio]:checked+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E\a %3Ccircle fill='%23fff' cx='64' cy='64' r='56'/%3E\a %3Ccircle fill='%23313131' cx='64' cy='64' r='44'/%3E\a %3C/svg%3E")}.uikit-control-input__input:checked+.uikit-control-input__text{font-weight:bold}.uikit-control-input__input:focus+.uikit-control-input__text{outline:1px solid #313131;outline-offset:1px}.uikit-control-input__input:disabled+.uikit-control-input__text{color:#6f6f6f}.uikit-control-input__input:disabled+.uikit-control-input__text:before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='rgba(255, 255, 255, 0.3)' d='M0 0h128v128H0z'/%3E\a %3C/svg%3E");z-index:2}.uikit-control-input__input:disabled:hover{cursor:not-allowed}.uikit-control-input__input:disabled:hover+.uikit-control-input__text{cursor:not-allowed}.uikit-control-input__text{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131;line-height:1.6;font-size:17px;margin-left:12px}.uikit-control-input__text:before,.uikit-control-input__text:after{content:' ';display:block;position:absolute;left:0;top:0;width:27px;height:27px;background-repeat:no-repeat;z-index:1}/*! @gov.au/footer v0.1.0 */@media print{.uikit-footer{background:#fff !important;border-color:#000 !important}}.uikit-footer{background-color:#f0f3f5;border-top:6px solid #555;padding:1.6em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131}.uikit-footer p:last-child{margin:0}.uikit-footer__navigation .uikit-link-list>li{margin-left:0}.uikit-footer__navigation+.uikit-footer__end{padding-top:1.6em;border-top:1px solid #555;margin-top:1.6em}/*! @gov.au/grid-12 v0.1.0 */.uikit-grid .container{box-sizing:border-box}@media (min-width: 768px){.uikit-grid .container{width:744px}}@media (min-width: 992px){.uikit-grid .container{width:968px}}@media (min-width: 1200px){.uikit-grid .container{width:1176px}}.uikit-grid .container,.uikit-grid .container-fluid{box-sizing:border-box;margin-right:auto;margin-left:auto;padding-left:12px;padding-right:12px}.uikit-grid .container:before,.uikit-grid .container:after,.uikit-grid .container-fluid:before,.uikit-grid .container-fluid:after{content:" ";display:table}.uikit-grid .container:after,.uikit-grid .container-fluid:after{clear:both}.uikit-grid .row{margin-left:-12px;margin-right:-12px}.uikit-grid .row:before,.uikit-grid .row:after{content:" ";display:table}.uikit-grid .row:after{clear:both}.uikit-grid .col-xs-1,.uikit-grid .col-sm-1,.uikit-grid .col-md-1,.uikit-grid .col-lg-1,.uikit-grid .col-xs-2,.uikit-grid .col-sm-2,.uikit-grid .col-md-2,.uikit-grid .col-lg-2,.uikit-grid .col-xs-3,.uikit-grid .col-sm-3,.uikit-grid .col-md-3,.uikit-grid .col-lg-3,.uikit-grid .col-xs-4,.uikit-grid .col-sm-4,.uikit-grid .col-md-4,.uikit-grid .col-lg-4,.uikit-grid .col-xs-5,.uikit-grid .col-sm-5,.uikit-grid .col-md-5,.uikit-grid .col-lg-5,.uikit-grid .col-xs-6,.uikit-grid .col-sm-6,.uikit-grid .col-md-6,.uikit-grid .col-lg-6,.uikit-grid .col-xs-7,.uikit-grid .col-sm-7,.uikit-grid .col-md-7,.uikit-grid .col-lg-7,.uikit-grid .col-xs-8,.uikit-grid .col-sm-8,.uikit-grid .col-md-8,.uikit-grid .col-lg-8,.uikit-grid .col-xs-9,.uikit-grid .col-sm-9,.uikit-grid .col-md-9,.uikit-grid .col-lg-9,.uikit-grid .col-xs-10,.uikit-grid .col-sm-10,.uikit-grid .col-md-10,.uikit-grid .col-lg-10,.uikit-grid .col-xs-11,.uikit-grid .col-sm-11,.uikit-grid .col-md-11,.uikit-grid .col-lg-11,.uikit-grid .col-xs-12,.uikit-grid .col-sm-12,.uikit-grid .col-md-12,.uikit-grid .col-lg-12{box-sizing:border-box;position:relative;min-height:1px;padding-left:12px;padding-right:12px}.uikit-grid .col-xs-1,.uikit-grid .col-xs-2,.uikit-grid .col-xs-3,.uikit-grid .col-xs-4,.uikit-grid .col-xs-5,.uikit-grid .col-xs-6,.uikit-grid .col-xs-7,.uikit-grid .col-xs-8,.uikit-grid .col-xs-9,.uikit-grid .col-xs-10,.uikit-grid .col-xs-11,.uikit-grid .col-xs-12{float:left}.uikit-grid .col-xs-1{width:8.33333%}.uikit-grid .col-xs-2{width:16.66667%}.uikit-grid .col-xs-3{width:25%}.uikit-grid .col-xs-4{width:33.33333%}.uikit-grid .col-xs-5{width:41.66667%}.uikit-grid .col-xs-6{width:50%}.uikit-grid .col-xs-7{width:58.33333%}.uikit-grid .col-xs-8{width:66.66667%}.uikit-grid .col-xs-9{width:75%}.uikit-grid .col-xs-10{width:83.33333%}.uikit-grid .col-xs-11{width:91.66667%}.uikit-grid .col-xs-12{width:100%}.uikit-grid .col-xs-pull-0{right:auto}.uikit-grid .col-xs-pull-1{right:8.33333%}.uikit-grid .col-xs-pull-2{right:16.66667%}.uikit-grid .col-xs-pull-3{right:25%}.uikit-grid .col-xs-pull-4{right:33.33333%}.uikit-grid .col-xs-pull-5{right:41.66667%}.uikit-grid .col-xs-pull-6{right:50%}.uikit-grid .col-xs-pull-7{right:58.33333%}.uikit-grid .col-xs-pull-8{right:66.66667%}.uikit-grid .col-xs-pull-9{right:75%}.uikit-grid .col-xs-pull-10{right:83.33333%}.uikit-grid .col-xs-pull-11{right:91.66667%}.uikit-grid .col-xs-pull-12{right:100%}.uikit-grid .col-xs-push-0{left:auto}.uikit-grid .col-xs-push-1{left:8.33333%}.uikit-grid .col-xs-push-2{left:16.66667%}.uikit-grid .col-xs-push-3{left:25%}.uikit-grid .col-xs-push-4{left:33.33333%}.uikit-grid .col-xs-push-5{left:41.66667%}.uikit-grid .col-xs-push-6{left:50%}.uikit-grid .col-xs-push-7{left:58.33333%}.uikit-grid .col-xs-push-8{left:66.66667%}.uikit-grid .col-xs-push-9{left:75%}.uikit-grid .col-xs-push-10{left:83.33333%}.uikit-grid .col-xs-push-11{left:91.66667%}.uikit-grid .col-xs-push-12{left:100%}.uikit-grid .col-xs-offset-0{margin-left:0%}.uikit-grid .col-xs-offset-1{margin-left:8.33333%}.uikit-grid .col-xs-offset-2{margin-left:16.66667%}.uikit-grid .col-xs-offset-3{margin-left:25%}.uikit-grid .col-xs-offset-4{margin-left:33.33333%}.uikit-grid .col-xs-offset-5{margin-left:41.66667%}.uikit-grid .col-xs-offset-6{margin-left:50%}.uikit-grid .col-xs-offset-7{margin-left:58.33333%}.uikit-grid .col-xs-offset-8{margin-left:66.66667%}.uikit-grid .col-xs-offset-9{margin-left:75%}.uikit-grid .col-xs-offset-10{margin-left:83.33333%}.uikit-grid .col-xs-offset-11{margin-left:91.66667%}.uikit-grid .col-xs-offset-12{margin-left:100%}@media (min-width: 768px){.uikit-grid .col-sm-1,.uikit-grid .col-sm-2,.uikit-grid .col-sm-3,.uikit-grid .col-sm-4,.uikit-grid .col-sm-5,.uikit-grid .col-sm-6,.uikit-grid .col-sm-7,.uikit-grid .col-sm-8,.uikit-grid .col-sm-9,.uikit-grid .col-sm-10,.uikit-grid .col-sm-11,.uikit-grid .col-sm-12{float:left}.uikit-grid .col-sm-1{width:8.33333%}.uikit-grid .col-sm-2{width:16.66667%}.uikit-grid .col-sm-3{width:25%}.uikit-grid .col-sm-4{width:33.33333%}.uikit-grid .col-sm-5{width:41.66667%}.uikit-grid .col-sm-6{width:50%}.uikit-grid .col-sm-7{width:58.33333%}.uikit-grid .col-sm-8{width:66.66667%}.uikit-grid .col-sm-9{width:75%}.uikit-grid .col-sm-10{width:83.33333%}.uikit-grid .col-sm-11{width:91.66667%}.uikit-grid .col-sm-12{width:100%}.uikit-grid .col-sm-pull-0{right:auto}.uikit-grid .col-sm-pull-1{right:8.33333%}.uikit-grid .col-sm-pull-2{right:16.66667%}.uikit-grid .col-sm-pull-3{right:25%}.uikit-grid .col-sm-pull-4{right:33.33333%}.uikit-grid .col-sm-pull-5{right:41.66667%}.uikit-grid .col-sm-pull-6{right:50%}.uikit-grid .col-sm-pull-7{right:58.33333%}.uikit-grid .col-sm-pull-8{right:66.66667%}.uikit-grid .col-sm-pull-9{right:75%}.uikit-grid .col-sm-pull-10{right:83.33333%}.uikit-grid .col-sm-pull-11{right:91.66667%}.uikit-grid .col-sm-pull-12{right:100%}.uikit-grid .col-sm-push-0{left:auto}.uikit-grid .col-sm-push-1{left:8.33333%}.uikit-grid .col-sm-push-2{left:16.66667%}.uikit-grid .col-sm-push-3{left:25%}.uikit-grid .col-sm-push-4{left:33.33333%}.uikit-grid .col-sm-push-5{left:41.66667%}.uikit-grid .col-sm-push-6{left:50%}.uikit-grid .col-sm-push-7{left:58.33333%}.uikit-grid .col-sm-push-8{left:66.66667%}.uikit-grid .col-sm-push-9{left:75%}.uikit-grid .col-sm-push-10{left:83.33333%}.uikit-grid .col-sm-push-11{left:91.66667%}.uikit-grid .col-sm-push-12{left:100%}.uikit-grid .col-sm-offset-0{margin-left:0%}.uikit-grid .col-sm-offset-1{margin-left:8.33333%}.uikit-grid .col-sm-offset-2{margin-left:16.66667%}.uikit-grid .col-sm-offset-3{margin-left:25%}.uikit-grid .col-sm-offset-4{margin-left:33.33333%}.uikit-grid .col-sm-offset-5{margin-left:41.66667%}.uikit-grid .col-sm-offset-6{margin-left:50%}.uikit-grid .col-sm-offset-7{margin-left:58.33333%}.uikit-grid .col-sm-offset-8{margin-left:66.66667%}.uikit-grid .col-sm-offset-9{margin-left:75%}.uikit-grid .col-sm-offset-10{margin-left:83.33333%}.uikit-grid .col-sm-offset-11{margin-left:91.66667%}.uikit-grid .col-sm-offset-12{margin-left:100%}}@media (min-width: 992px){.uikit-grid .col-md-1,.uikit-grid .col-md-2,.uikit-grid .col-md-3,.uikit-grid .col-md-4,.uikit-grid .col-md-5,.uikit-grid .col-md-6,.uikit-grid .col-md-7,.uikit-grid .col-md-8,.uikit-grid .col-md-9,.uikit-grid .col-md-10,.uikit-grid .col-md-11,.uikit-grid .col-md-12{float:left}.uikit-grid .col-md-1{width:8.33333%}.uikit-grid .col-md-2{width:16.66667%}.uikit-grid .col-md-3{width:25%}.uikit-grid .col-md-4{width:33.33333%}.uikit-grid .col-md-5{width:41.66667%}.uikit-grid .col-md-6{width:50%}.uikit-grid .col-md-7{width:58.33333%}.uikit-grid .col-md-8{width:66.66667%}.uikit-grid .col-md-9{width:75%}.uikit-grid .col-md-10{width:83.33333%}.uikit-grid .col-md-11{width:91.66667%}.uikit-grid .col-md-12{width:100%}.uikit-grid .col-md-pull-0{right:auto}.uikit-grid .col-md-pull-1{right:8.33333%}.uikit-grid .col-md-pull-2{right:16.66667%}.uikit-grid .col-md-pull-3{right:25%}.uikit-grid .col-md-pull-4{right:33.33333%}.uikit-grid .col-md-pull-5{right:41.66667%}.uikit-grid .col-md-pull-6{right:50%}.uikit-grid .col-md-pull-7{right:58.33333%}.uikit-grid .col-md-pull-8{right:66.66667%}.uikit-grid .col-md-pull-9{right:75%}.uikit-grid .col-md-pull-10{right:83.33333%}.uikit-grid .col-md-pull-11{right:91.66667%}.uikit-grid .col-md-pull-12{right:100%}.uikit-grid .col-md-push-0{left:auto}.uikit-grid .col-md-push-1{left:8.33333%}.uikit-grid .col-md-push-2{left:16.66667%}.uikit-grid .col-md-push-3{left:25%}.uikit-grid .col-md-push-4{left:33.33333%}.uikit-grid .col-md-push-5{left:41.66667%}.uikit-grid .col-md-push-6{left:50%}.uikit-grid .col-md-push-7{left:58.33333%}.uikit-grid .col-md-push-8{left:66.66667%}.uikit-grid .col-md-push-9{left:75%}.uikit-grid .col-md-push-10{left:83.33333%}.uikit-grid .col-md-push-11{left:91.66667%}.uikit-grid .col-md-push-12{left:100%}.uikit-grid .col-md-offset-0{margin-left:0%}.uikit-grid .col-md-offset-1{margin-left:8.33333%}.uikit-grid .col-md-offset-2{margin-left:16.66667%}.uikit-grid .col-md-offset-3{margin-left:25%}.uikit-grid .col-md-offset-4{margin-left:33.33333%}.uikit-grid .col-md-offset-5{margin-left:41.66667%}.uikit-grid .col-md-offset-6{margin-left:50%}.uikit-grid .col-md-offset-7{margin-left:58.33333%}.uikit-grid .col-md-offset-8{margin-left:66.66667%}.uikit-grid .col-md-offset-9{margin-left:75%}.uikit-grid .col-md-offset-10{margin-left:83.33333%}.uikit-grid .col-md-offset-11{margin-left:91.66667%}.uikit-grid .col-md-offset-12{margin-left:100%}}@media (min-width: 1200px){.uikit-grid .col-lg-1,.uikit-grid .col-lg-2,.uikit-grid .col-lg-3,.uikit-grid .col-lg-4,.uikit-grid .col-lg-5,.uikit-grid .col-lg-6,.uikit-grid .col-lg-7,.uikit-grid .col-lg-8,.uikit-grid .col-lg-9,.uikit-grid .col-lg-10,.uikit-grid .col-lg-11,.uikit-grid .col-lg-12{float:left}.uikit-grid .col-lg-1{width:8.33333%}.uikit-grid .col-lg-2{width:16.66667%}.uikit-grid .col-lg-3{width:25%}.uikit-grid .col-lg-4{width:33.33333%}.uikit-grid .col-lg-5{width:41.66667%}.uikit-grid .col-lg-6{width:50%}.uikit-grid .col-lg-7{width:58.33333%}.uikit-grid .col-lg-8{width:66.66667%}.uikit-grid .col-lg-9{width:75%}.uikit-grid .col-lg-10{width:83.33333%}.uikit-grid .col-lg-11{width:91.66667%}.uikit-grid .col-lg-12{width:100%}.uikit-grid .col-lg-pull-0{right:auto}.uikit-grid .col-lg-pull-1{right:8.33333%}.uikit-grid .col-lg-pull-2{right:16.66667%}.uikit-grid .col-lg-pull-3{right:25%}.uikit-grid .col-lg-pull-4{right:33.33333%}.uikit-grid .col-lg-pull-5{right:41.66667%}.uikit-grid .col-lg-pull-6{right:50%}.uikit-grid .col-lg-pull-7{right:58.33333%}.uikit-grid .col-lg-pull-8{right:66.66667%}.uikit-grid .col-lg-pull-9{right:75%}.uikit-grid .col-lg-pull-10{right:83.33333%}.uikit-grid .col-lg-pull-11{right:91.66667%}.uikit-grid .col-lg-pull-12{right:100%}.uikit-grid .col-lg-push-0{left:auto}.uikit-grid .col-lg-push-1{left:8.33333%}.uikit-grid .col-lg-push-2{left:16.66667%}.uikit-grid .col-lg-push-3{left:25%}.uikit-grid .col-lg-push-4{left:33.33333%}.uikit-grid .col-lg-push-5{left:41.66667%}.uikit-grid .col-lg-push-6{left:50%}.uikit-grid .col-lg-push-7{left:58.33333%}.uikit-grid .col-lg-push-8{left:66.66667%}.uikit-grid .col-lg-push-9{left:75%}.uikit-grid .col-lg-push-10{left:83.33333%}.uikit-grid .col-lg-push-11{left:91.66667%}.uikit-grid .col-lg-push-12{left:100%}.uikit-grid .col-lg-offset-0{margin-left:0%}.uikit-grid .col-lg-offset-1{margin-left:8.33333%}.uikit-grid .col-lg-offset-2{margin-left:16.66667%}.uikit-grid .col-lg-offset-3{margin-left:25%}.uikit-grid .col-lg-offset-4{margin-left:33.33333%}.uikit-grid .col-lg-offset-5{margin-left:41.66667%}.uikit-grid .col-lg-offset-6{margin-left:50%}.uikit-grid .col-lg-offset-7{margin-left:58.33333%}.uikit-grid .col-lg-offset-8{margin-left:66.66667%}.uikit-grid .col-lg-offset-9{margin-left:75%}.uikit-grid .col-lg-offset-10{margin-left:83.33333%}.uikit-grid .col-lg-offset-11{margin-left:91.66667%}.uikit-grid .col-lg-offset-12{margin-left:100%}}/*! @gov.au/header v1.0.0 */.uikit-header{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#fff;background:#008752;padding:1.6em 0 2em 0;margin-bottom:1.6em}.uikit-header.uikit-header--hero{padding:3.2em 0 4em 0}@media (min-width: 768px){.uikit-header{padding:3.2em 0 4.8em 0}.uikit-header.uikit-header--hero{padding:7.2em 0 13.6em 0}}.uikit-header.uikit-header--light{background-color:#f0f3f5;color:#313131}.uikit-header.uikit-header--dark{background-color:#313131}.uikit-header-heading{font-size:20px;line-height:1.6;font-weight:bold;margin:0;padding:0}@media (min-width: 768px){.uikit-header-heading{font-size:36px}}.uikit-header-subline{font-size:18px;line-height:1.6;max-width:42em}@media (min-width: 768px){.uikit-header-subline{font-size:20px}}/*! @gov.au/page-alerts v0.1.1 */@media print{.uikit-page-alerts{border-color:#000 !important;background-color:#fff !important;border-left:2px solid #000 !important;padding-top:3em !important}.uikit-page-alerts:after{background:none !important;content:'info' !important;top:1em !important;left:0 !important;font-size:12px !important;border-right:1px solid #000 !important;border-bottom:1px solid #000 !important;padding:0.5em !important;width:auto !important}.uikit-page-alerts--success:after{content:'success' !important}.uikit-page-alerts--warning:after{content:'warning' !important}.uikit-page-alerts--error:after{content:'error' !important}}.uikit-page-alerts{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131;line-height:1.6;position:relative;margin:1.6em 0;padding:1.2em .8em 1.2em .8em;border:solid 2px #00bfe9;border-left:48px solid #00bfe9;border-radius:3px;max-width:42em}.uikit-page-alerts :first-child{margin-top:0}.uikit-page-alerts :last-child{margin-bottom:0}.uikit-page-alerts:after{content:' ';position:absolute;display:block;left:-36px;top:50%;margin-top:-12px;width:24px;height:24px;background-repeat:no-repeat;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E\a %3Crect fill='%23fff' width='16' height='16' x='56' y='20' rx='2'/%3E\a %3Crect fill='%23fff' width='16' height='56' x='56' y='44' rx='2'/%3E\a %3Crect fill='%23fff' width='40' height='16' x='44' y='84' rx='2'/%3E\a %3Crect fill='%23fff' width='28' height='16' x='44' y='44' rx='2'/%3E\a %3C/svg%3E")}.ie8 .uikit-page-alerts:after,.lt-ie8 .uikit-page-alerts:after{background:none;text-align:center;background-color:#313131;color:#fff;font-weight:bold;content:'i'}.uikit-page-alerts--success{border-color:#3dbd93}.uikit-page-alerts--success:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E\a %3Cpath fill='%23fff' d='M102.59 45.41c.778-.778.782-2.038-.002-2.822l-9.176-9.176c-.78-.78-2.052-.772-2.823 0L56 68\a 41.42 53.42c-.784-.784-2.048-.792-2.832-.008l-9.176 9.176c-.78.78-.775 2.05-.004 2.82l25.184 25.184c.778.778 2.04.775 2.82-.003l45.177-45.18z'/%3E\a %3C/svg%3E")}.ie8 .uikit-page-alerts--success:after,.lt-ie8 .uikit-page-alerts--success:after{content:'✓'}.uikit-page-alerts--warning{border-color:#f69900}.uikit-page-alerts--warning:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23313131' d='M71.99 12.78l54.796 99.458c1.665 2.997 1.617 7.993-.143 10.99-.808 1.38-1.914 2.473-3.317\a 3.282-1.403.808-2.914 1.213-4.53 1.213H9.206c-1.62 0-3.13-.405-4.533-1.213-1.403-.81-2.51-1.903-3.317-3.282-1.76-2.997-1.808-7.993-.143-10.99L56.01\a 12.78c.808-1.474 1.925-2.64 3.352-3.496C60.79 8.428 62.335 8 64 8s3.21.428 4.638 1.284c1.427.856 2.544 2.022 3.353 3.496z'/%3E\a %3Crect fill='%23fff' width='16' height='16' x='56' y='96' rx='2'/%3E\a %3Cpath fill='%23fff' d='M52.167 42c-.092-1.104.73-2 1.838-2h19.99c1.107 0 1.93.895 1.838 2l-3.666 44c-.092 1.104-1.062 2-2.16 2H57.993c-1.1\a 0-2.07-.895-2.16-2l-3.667-44z'/%3E\a %3C/svg%3E")}.ie8 .uikit-page-alerts--warning:after,.lt-ie8 .uikit-page-alerts--warning:after{content:'!'}.uikit-page-alerts--error{border-color:#ff635c}.uikit-page-alerts--error:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E\a %3Cpath fill='%23313131' d='M71.99 12.78l54.796 99.458c1.665 2.997 1.617 7.993-.143 10.99-.808 1.38-1.914 2.473-3.317\a 3.282-1.403.808-2.914 1.213-4.53 1.213H9.206c-1.62 0-3.13-.405-4.533-1.213-1.403-.81-2.51-1.903-3.317-3.282-1.76-2.997-1.808-7.993-.143-10.99L56.01\a 12.78c.808-1.474 1.925-2.64 3.352-3.496C60.79 8.428 62.335 8 64 8s3.21.428 4.638 1.284c1.427.856 2.544 2.022 3.353 3.496z'/%3E\a %3Crect fill='%23fff' width='16' height='16' x='56' y='96' rx='2'/%3E\a %3Cpath fill='%23fff' d='M52.167 42c-.092-1.104.73-2 1.838-2h19.99c1.107 0 1.93.895 1.838 2l-3.666 44c-.092 1.104-1.062 2-2.16 2H57.993c-1.1\a 0-2.07-.895-2.16-2l-3.667-44z'/%3E\a %3C/svg%3E")}.ie8 .uikit-page-alerts--error:after,.lt-ie8 .uikit-page-alerts--error:after{content:'!'}.uikit-page-alerts__sronly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}/*! @gov.au/progress-indicator v0.1.0 */@media print{.progress-indicator{border-top-color:#000 !important}.uikit-body .progress-indicator__link,.progress-indicator__link{border-bottom-color:#000 !important;border-left-color:transparent !important;padding-left:6px !important}.uikit-body .progress-indicator__link.progress-indicator--doing,.progress-indicator__link.progress-indicator--doing{border-left-color:#000 !important}.uikit-body .progress-indicator__link:after,.progress-indicator__link:after{display:none}}.uikit-body .progress-indicator,.progress-indicator{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;list-style:none;padding:0;margin:0 0 1.6em 0;border-top:1px solid #bbb}.uikit-body .progress-indicator>li,.progress-indicator>li{margin:0}.uikit-body .progress-indicator__link,.progress-indicator__link{position:relative;display:block;padding:.4em 0 .4em 41px;font-size:17px;color:#313131;text-decoration:none;line-height:1.45;border-bottom:1px solid #bbb;border-left:3px solid transparent;transition:background-color 0.1s ease-in-out}.uikit-body .progress-indicator__link:hover,.uikit-body .progress-indicator__link:focus,.progress-indicator__link:hover,.progress-indicator__link:focus{background-color:#cdf0e2;border-bottom-color:#bbb}.uikit-body .progress-indicator__link:focus,.progress-indicator__link:focus{outline:1px solid #313131;outline-offset:1px}.uikit-body .progress-indicator__link:after,.progress-indicator__link:after{content:'';position:absolute;left:6px;top:0;bottom:0;width:24px;background:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E\a %3Cpath fill='%235a5a5a' d='M24,12 C24,18.6251859 18.6251859,24 12,24 C5.37481408,24 0,18.6251859 0,12 C0,5.37481408 5.37481408,0 12,0 C18.6251859,0\a 24,5.37481408 24,12 Z'%3E%3C/path%3E\a %3Cpath fill='%23fff' d='M22,12 C22,6.47916667 17.5208333,2 12,2 C6.47916667,2 2,6.47916667 2,12 C2,17.5208333 6.47916667,22 12,22 C17.5208333,22\a 22,17.5208333 22,12 Z'%3E%3C/path%3E\a %3C/svg%3E");background-repeat:no-repeat;background-position:0 center}.ie8 .uikit-body .progress-indicator__link:after,.lt-ie8 .uikit-body .progress-indicator__link:after,.ie8 .progress-indicator__link:after,.lt-ie8 .progress-indicator__link:after{top:6px;content:'-'}.uikit-body .progress-indicator__link.progress-indicator--doing,.progress-indicator__link.progress-indicator--doing{border-left-color:#115361;font-weight:bold}.uikit-body .progress-indicator__link.progress-indicator--doing:after,.progress-indicator__link.progress-indicator--doing:after{background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E\a %3Cpath fill='%23115361' d='M24,12 C24,18.6251859 18.6251859,24 12,24 C5.37481408,24 0,18.6251859 0,12 C0,5.37481408 5.37481408,0 12,0 C18.6251859,0\a 24,5.37481408 24,12 Z'%3E%3C/path%3E\a %3Cpath fill='%23fff' d='M22,12 C22,6.47916667 17.5208333,2 12,2 C6.47916667,2 2,6.47916667 2,12 C2,17.5208333 6.47916667,22 12,22 C17.5208333,22\a 22,17.5208333 22,12 Z'%3E%3C/path%3E\a %3Ccircle fill='%23115361' cx='6.5' cy='12' r='1.5'%3E%3C/circle%3E\a %3Ccircle fill='%23115361' cx='12' cy='12' r='1.5'%3E%3C/circle%3E\a %3Ccircle fill='%23115361' cx='17.5' cy='12' r='1.5'%3E%3C/circle%3E\a %3C/svg%3E")}.ie8 .uikit-body .progress-indicator__link.progress-indicator--doing:after,.lt-ie8 .uikit-body .progress-indicator__link.progress-indicator--doing:after,.ie8 .progress-indicator__link.progress-indicator--doing:after,.lt-ie8 .progress-indicator__link.progress-indicator--doing:after{content:'...'}.uikit-body .progress-indicator__link.progress-indicator--done:after,.progress-indicator__link.progress-indicator--done:after{background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E\a %3Cpath fill='%23115361' d='M24,12 C24,18.6251859 18.6251859,24 12,24 C5.37481408,24 0,18.6251859 0,12 C0,5.37481408 5.37481408,0 12,0 C18.6251859,0\a 24,5.37481408 24,12 Z'%3E%3C/path%3E\a %3Cpath fill='%23fff' d='M22,12 C22,6.47916667 17.5208333,2 12,2 C6.47916667,2 2,6.47916667 2,12 C2,17.5208333 6.47916667,22 12,22 C17.5208333,22\a 22,17.5208333 22,12 Z'%3E%3C/path%3E\a %3Cpath fill='%23115361' d='M18.744186,9.23753281 C18.744186,9.48293963 18.6627907,9.71391076 18.5,9.88713911 L11.3895349,17.7257218\a C11.2267442,17.8989501 10.996124,18 10.7655039,18 C10.5484496,18 10.3178295,17.8989501 10.1550388,17.7257218 L5.24418605,12.5\a C5.08139535,12.3267717 5,12.0958005 5,11.8503937 C5,11.6049869 5.08139535,11.3595801 5.24418605,11.1863517 L6.47868217,9.88713911\a C6.64147287,9.71391076 6.85852713,9.61286089 7.08914729,9.61286089 C7.31976744,9.61286089 7.53682171,9.71391076 7.6996124,9.88713911\a L10.7655039,13.1496063 L16.0445736,7.27427822 C16.2073643,7.10104987 16.4244186,7 16.6550388,7 C16.8856589,7 17.1027132,7.10104987\a 17.2655039,7.27427822 L18.5,8.57349081 C18.6627907,8.74671916 18.744186,8.99212598 18.744186,9.23753281 Z'%3E%3C/path%3E\a %3C/svg%3E")}.ie8 .uikit-body .progress-indicator__link.progress-indicator--done:after,.lt-ie8 .uikit-body .progress-indicator__link.progress-indicator--done:after,.ie8 .progress-indicator__link.progress-indicator--done:after,.lt-ie8 .progress-indicator__link.progress-indicator--done:after{content:'✓'}.progress-indicator__status{display:block;font-size:14px;font-weight:normal;color:#5a5a5a}/*! @gov.au/text-inputs v0.1.1 */@media print{.uikit-text-input{border-color:#000 !important}:disabled{background-color:#f0f3f5 !important;border-color:transparent}[disabled]{background-color:#f0f3f5 !important}}.uikit-text-input__label{display:block;margin-bottom:.8em}.uikit-text-input__label>.uikit-text-input{margin-top:.8em}.uikit-text-input{border:2px solid #777;padding:.4em;font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131}.uikit-text-input:focus{outline:1px solid #313131;outline-offset:1px}.uikit-text-input:focus{background-color:#e6f8f1}.uikit-text-input::selection{background-color:rgba(250,194,102,0.5)}.uikit-text-input:invalid{border:2px solid #ff635c}.uikit-text-input:invalid:focus{background-color:#ffefef}.uikit-text-input.uikit-text-input--invalid,.uikit-text-input.invalid{border:2px solid #ff635c}.uikit-text-input.uikit-text-input--invalid:focus,.uikit-text-input.invalid:focus{background-color:#ffefef}.uikit-text-input.uikit-text-input--valid{border:2px solid #0cac78}.uikit-text-input.uikit-text-input--valid:focus{background-color:#e7f7f2}.uikit-text-input:disabled{cursor:not-allowed;background:#f0f3f5;color:#5a5a5a}.uikit-text-input[disabled]{cursor:not-allowed;background:#f0f3f5;color:#5a5a5a}.uikit-text-input--block{display:block;width:100%;box-sizing:border-box}.uikit-text-input--textarea{line-height:1.6}.uikit-text-input--number{font-family:"Lucida Sans Typewriter","Lucida Console",Monaco,"Bitstream Vera Sans Mono",monospace;letter-spacing:2px}.uikit-text-input__hint{display:block;margin-bottom:.4em;font-size:87.5%}.uikit-text-input__label>.uikit-text-input__hint,.uikit-text-input+.uikit-text-input__hint{margin-top:.4em}.uikit-grid .container:before,.uikit-grid .container:after,.uikit-grid .container-fluid:before,.uikit-grid .container-fluid:after{content:none}.uikit-body p{margin-bottom:.8em;max-width:none}.uikit-body h1{line-height:1.25}.uikit-body h3{margin:1.8em 0 .8em;letter-spacing:-0.05em}.uikit-body h3:first-of-type{margin:.8em 0 .8em}.uikit-body .uikit-text-input{padding:.8em .4em}.uikit-text-input__label{margin-bottom:.8em}.uikit-header{margin-bottom:0;font-weight:bold}.uikit-header--light{padding:.8em 0;text-align:center}.uikit-fileupload input[type="file"]{width:0.1px;height:0.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}a.uikit-btn,a.uikit-btn.uikit-btn--primary{color:#fff}a.uikit-btn:hover,a.uikit-btn:focus,a.uikit-btn.uikit-btn--primary:hover,a.uikit-btn.uikit-btn--primary:focus{background-color:#005f39}a.uikit-btn.uikit-btn--secondary{border-bottom:1px solid #313131}a.uikit-btn.uikit-btn--secondary:hover,a.uikit-btn.uikit-btn--secondary:focus{background-color:#222}a.uikit-btn.uikit-btn--tertiary{color:#313131}a.uikit-btn.uikit-btn--tertiary:hover,a.uikit-btn.uikit-btn--tertiary:focus{background-color:#e6f3ee;border:1px solid #008752}.uikit-btn{text-align:center}@media (max-width: 640px){.uikit-btn{display:block}}.uikit-control-input{display:block}@media (max-width: 640px){input.uikit-btn,button.uikit-btn{width:100%}}.uikit-table{border-collapse:collapse;border-spacing:0;table-layout:fixed;width:100%;margin:0;padding:0}.uikit-table tr{padding:.4em}.uikit-table th,.uikit-table td{text-align:left;vertical-align:middle}.uikit-table td{padding:0}.uikit-table td:first-child{padding-left:0}.uikit-table td:last-child{padding-right:0}.uikit-currency-input__root{position:relative}.uikit-currency-input__prefix{display:none;width:2em;line-height:1.4;position:absolute;text-align:center;padding:0.4em 0;top:0;bottom:0;left:0}#drop-zone{border:2px dashed #777;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;padding:25px;text-align:center}#file-list ul{margin-top:1.6em}#file-input{display:none}@media (max-width: 640px){#drop-zone{display:none}#file-input{display:inline-block}}.uikit-body ul.parsley-errors-list,.uikit-body ol.parsley-errors-list,.uikit-body dl.parsley-errors-list,.uikit-body pre.parsley-errors-list{transition:max-height 500ms 300ms ease-in-out;max-height:0em;padding:0;margin:0;color:#b34540;list-style:none;overflow:hidden}.uikit-body ul.parsley-errors-list.filled,.uikit-body ol.parsley-errors-list.filled,.uikit-body dl.parsley-errors-list.filled,.uikit-body pre.parsley-errors-list.filled{transition:max-height 500ms 300ms ease-in-out;max-height:10em}.search-list--input-container{padding-bottom:1em}.search-list--input-label{position:absolute;z-index:10;line-height:2.8;cursor:auto;padding-left:0.6em}.step-indicator{display:flex;width:100%;margin:3.2em 0 2.4em !important;list-style:none;padding-left:0 !important;font-size:65%}.step-indicator>li{position:relative;text-align:center;flex:1}.step-indicator>li::after{content:' ';border-top:0.6em #ccc solid;position:absolute;display:block;width:100%;left:-50%;top:0.75em;z-index:1}.step-indicator>li:first-child::after{content:none;display:none}.step-indicator>li.completed::after{border-color:#008752}.step-indicator>li.completed .bubble{border-color:#008752;background:#008752}.step-indicator>li .bubble{position:relative;box-sizing:border-box;background:#f0f3f5;border:0.6em #ccc solid;border-radius:100%;display:block;margin:0 auto;height:2em;width:2em;z-index:4}@media (min-width: 640px){.step-indicator{font-size:90%}}@media (min-width: 320px){body{font-size:90%}}@media (max-width: 640px) and (min-height: 666px){.footer--fixed-bottom{position:fixed;box-sizing:border-box;padding:0.6em;width:100%;bottom:0;right:0;left:0}}.js-hidden{display:none}.mobile-hidden{display:none}@media (min-width: 769px){.mobile-hidden{display:inherit}}.date-field{box-sizing:border-box;display:block;width:100%}.date-field::-webkit-clear-button{display:none;-webkit-appearance:none}.date-field::-webkit-datetime-edit-text{color:#555;padding:0 .2em}.date-field::-webkit-datetime-edit-month-field,.date-field::-webkit-datetime-edit-day-field,.date-field::-webkit-datetime-edit-year-field{text-transform:uppercase;padding:0}.date-field::-webkit-inner-spin-button{display:none}.date-field::-webkit-calendar-picker-indicator{background-color:transparent}
|
1
|
+
/*! PANCAKE v1.1.0 PANCAKE-SASS v1.1.0 *//*! @gov.au/core v0.1.2 *//*! @gov.au/body v0.1.1 */@media print{.uikit-body *{text-shadow:none !important;color:#000 !important;background:#fff !important;box-shadow:none !important;border-color:#000 !important}.uikit-body a,.uikit-body a:visited{text-decoration:underline}.uikit-body a[href]:after{content:" (" attr(href) ")"}.uikit-body abbr[title]:after{content:" (" attr(title) ")"}.uikit-body a[href^="javascript:"]:after,.uikit-body a[href^="#"]:after{content:""}.uikit-body a[rel~='external']:after{display:none !important}.uikit-body pre,.uikit-body blockquote{border:1px solid #000;padding:6px;page-break-inside:avoid}.uikit-body thead{display:table-header-group}.uikit-body tr,.uikit-body img{page-break-inside:avoid}.uikit-body img{max-width:100% !important}.uikit-body p,.uikit-body h2,.uikit-body h3{orphans:3;widows:3}.uikit-body h2,.uikit-body h3{page-break-after:avoid}.uikit-body p a{word-wrap:break-word}.uikit-body select{background:#fff !important}}.uikit-body{margin:0;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.6;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131}.uikit-body a{-webkit-text-decoration-skip:objects;color:#313131;text-decoration:none;border-bottom:solid 1px #008752;transition:background-color 0.1s ease-in-out, border-color 0.1s ease-in-out}.uikit-body a:hover,.uikit-body a:focus{background-color:#07b470;border-color:transparent}.uikit-body a:focus{outline:1px solid #313131;outline-offset:1px}.uikit-body a[rel~='external']:after{content:' ';display:inline-block;width:0.7em;height:0.8em;margin:0 0.1em 0 0.25em;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Cpath fill='%23008752' d='M24.002 8C15.155 8 8 15.164 8 24.002v79.996C8 112.845 15.164 120 24.002 120h79.996c8.847 0 16.002-7.164 16.002-16.002V82.005c0-1.107-.895-2.005-1.994-2.005h-12.012c-1.1 0-1.994.893-1.994 1.995v16.008c0 3.312-2.685 5.997-5.997 5.997H29.997C26.685 104 24 101.315 24 98.003V29.997C24 26.685 26.685 24 29.997 24h16.008C47.107 24 48 23.105 48 22.006V9.994C48 8.894 47.103 8 45.995 8H24.002z'/%3E %3Cpath fill='%23008752' d='M127.416.584c-.36-.36-.86-.584-1.41-.584H73.994C72.904 0 72 .893 72 1.994v12.012c0 1.1.892 1.994 1.993 1.994H96L49.41 62.59c-.777.777-.774 2.046.01 2.83l13.16 13.16c.793.793 2.052.788 2.83.01L112 32v22.007c0 1.09.893 1.993 1.994 1.993h12.012c1.1 0 1.994-.892 1.994-1.993V1.993c0-.545-.223-1.043-.584-1.405V.584z'/%3E %3C/svg%3E");background-repeat:no-repeat;background-position-y:0.12em}.ie8 .uikit-body a[rel~='external']:after,.lt-ie8 .uikit-body a[rel~='external']:after{content:'⇗';color:#008752}.uikit-body [tabindex="0"]:focus,.uikit-body :target{outline:1px solid #313131;outline-offset:1px}.uikit-body mark,.uikit-body ::selection{background-color:rgba(250,194,102,0.5)}.uikit-body p{max-width:42em;margin:0 0 1.6em 0}.uikit-body ul,.uikit-body ol,.uikit-body dl,.uikit-body pre{margin-top:0;margin-bottom:1.6em}.uikit-body ul,.uikit-body ol,.uikit-body dd{margin-left:0;padding-left:1.6em}.uikit-body ul>li,.uikit-body ol>li{margin-bottom:.4em}.uikit-body ul>li>ul,.uikit-body ul>li>ol,.uikit-body ol>li>ul,.uikit-body ol>li>ol{margin-top:.4em;margin-bottom:.8em}.uikit-body ul>ul,.uikit-body ol>ul{list-style-type:disc}.uikit-body dl>dd{margin-bottom:1.6em}.uikit-body dl>dt{font-weight:bold;margin-top:.8em;margin-bottom:.8em}.uikit-body dl>dt:first-of-type{margin-top:0}.uikit-body em,.uikit-body i{font-style:italic}.uikit-body strong{font-weight:bold}.uikit-body small{font-size:87.5%;color:#464646}.uikit-body s{text-decoration:line-through}.uikit-body del{text-decoration:line-through;color:#5a5a5a}.uikit-body ins{text-decoration-line:underline;text-decoration-style:dashed}.uikit-body dfn{font-style:normal}.uikit-body abbr,.uikit-body abbr[title]{font-size:18px;font-variant:small-caps;text-transform:lowercase;letter-spacing:1px;text-decoration:none;border-bottom:1px dotted #555;cursor:help}.uikit-body a abbr{padding-bottom:1px}.uikit-body var{padding:0 1px;font-style:italic;font-family:serif}.uikit-body var sup,.uikit-body var sub{font-family:"Open Sans",Verdana,"Bitstream Vera Sans",sans-serif;font-style:normal;padding:0 1px}.uikit-body sub,.uikit-body sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.uikit-body sub{bottom:-0.25em}.uikit-body sup{top:-0.5em}.uikit-body code,.uikit-body kbd,.uikit-body pre{font-family:"Lucida Sans Typewriter","Lucida Console",Monaco,"Bitstream Vera Sans Mono",monospace}.uikit-body pre code,.uikit-body pre samp,.uikit-body pre kbd{font-size:14px}.uikit-body kbd{display:inline-block;font-size:14px;border:solid 1px #008752;border-radius:3px;box-shadow:0 1px 0 0 #008752;background-color:#fefefe;text-align:center;padding:0 .8em;margin:0 2px}.uikit-body hr{box-sizing:content-box;height:0;overflow:visible;border:none;border-top:1px solid #555;margin-bottom:1.6em}/*! @gov.au/buttons v0.3.0 */@media print{.uikit-btn{background-color:#fff !important;border:2px solid #000 !important;color:#000 !important}.uikit-btn:disabled{background-color:#ccc !important}}.uikit-btn{display:inline-block;-webkit-appearance:none;border:none;background:none;font-size:17px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-weight:bold;color:#fff;text-decoration:none;border-radius:3px;background-color:#008752;padding:.8em 1.2em;cursor:pointer;transition:background 0.1s ease}.uikit-btn:focus,.uikit-btn:hover{background-color:#005f39}.uikit-btn:focus{outline:1px solid #313131;outline-offset:1px}.uikit-btn:disabled{background-color:#ccc;font-weight:normal;color:#313131;border:1px dotted #313131;cursor:not-allowed}.uikit-btn:disabled:focus,.uikit-btn:disabled:hover{background-color:#ccc}.uikit-btn--secondary{background-color:#313131}.uikit-btn--secondary:focus,.uikit-btn--secondary:hover{background-color:#6f6f6f}.uikit-btn--tertiary{background-color:#fff;color:#313131;border:1px solid #008752}.uikit-btn--tertiary:focus,.uikit-btn--tertiary:hover{background-color:#e6f3ee}.uikit-btn--block{display:block;width:100%;box-sizing:border-box;text-align:center}.uikit-btn--block+.uikit-btn--block{margin-top:.4em}/*! @gov.au/callout v0.1.1 */@media print{.uikit-callout{border-top:1px solid #000 !important;border-right:1px solid #000 !important;border-bottom:1px solid #000 !important}}.uikit-callout{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131;line-height:1.6;margin:1.6em .4em;padding:1.2em 1.2em 1.2em .8em;border-left:6px solid #008752;border-radius:3px;box-shadow:2px 0 6px rgba(49,49,49,0.7);max-width:42em}.uikit-callout :first-child{margin-top:0}.uikit-callout :last-child{margin-bottom:0}.ie8 .uikit-callout,.lt-ie8 .uikit-callout{border-top:1px solid #555;border-right:1px solid #555;border-bottom:1px solid #555}.uikit-callout--calendar-event{background-color:#f0f3f5}.uikit-callout--calendar-event__lede,.uikit-callout--calendar-event__time,.uikit-callout--calendar-event__name{display:block}.uikit-callout--calendar-event__lede,.uikit-callout--calendar-event__time,.uikit-callout--calendar-event__name{margin-bottom:.8em}.uikit-callout--calendar-event__lede{font-size:18px}.uikit-callout--calendar-event__time,.uikit-callout--calendar-event__name{font-size:32px}.uikit-callout--calendar-event__time{font-weight:bold;margin-bottom:0}/*! @gov.au/control-input v0.1.0 */@media print{.uikit-control-input__text:after{display:none !important}}.uikit-control-input{display:inline-block;position:relative}.uikit-control-input__input{display:inline-block;line-height:1.6;margin:0 0px 0 7px}.uikit-control-input__input:hover{cursor:pointer}.uikit-control-input__input:hover+.uikit-control-input__text{cursor:pointer}.uikit-control-input__input[type=checkbox]+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Cpath fill='%23313131' d='M0 0h128v128H0z'/%3E %3Cpath fill='%23fff' d='M8 8h112v112H8z'/%3E %3C/svg%3E")}.uikit-control-input__input[type=checkbox]:checked+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Cpath fill='%23313131' d='M0 0h128v128H0z'/%3E %3Cpath fill='%23fff' d='M8 8h112v112H8z'/%3E %3Cpath fill='%23313131' d='M16 16h96v96H16z'/%3E %3Cpath fill='%23fff' d='M102.59 45.41c.778-.778.782-2.038-.002-2.822l-9.176-9.176c-.78-.78-2.052-.772-2.823 0L56 68 41.42 53.42c-.784-.784-2.048-.792-2.832-.008l-9.176 9.176c-.78.78-.775 2.05-.004 2.82l25.184 25.184c.778.778 2.04.775 2.82-.003l45.177-45.18z'/%3E %3C/svg%3E")}.uikit-control-input--full>.uikit-control-input__input[type=checkbox]+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Cpath fill='%23313131' d='M0 0h128v128H0z'/%3E %3Cpath fill='%23fff' d='M8 8h112v112H8z'/%3E %3C/svg%3E")}.uikit-control-input--full>.uikit-control-input__input[type=checkbox]:checked+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Cpath fill='%23313131' d='M0 0h128v128H0z'/%3E %3Cpath fill='%23fff' d='M8 8h112v112H8z'/%3E %3Cpath fill='%23313131' d='M16 16h96v96H16z'/%3E %3C/svg%3E")}.uikit-control-input__input[type=radio]+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E %3Ccircle fill='%23fff' cx='64' cy='64' r='56'/%3E %3C/svg%3E")}.uikit-control-input__input[type=radio]:checked+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E %3Ccircle fill='%23fff' cx='64' cy='64' r='56'/%3E %3Ccircle fill='%23313131' cx='64' cy='64' r='44'/%3E %3Cpath fill='%23fff' fill-rule='nonzero' d='M94.588 53.412c.78-.78.784-2.04 0-2.824l-9.176-9.176c-.78-.78-2.05-.775-2.82-.004L56 68 45.412 57.412c-.78-.78-2.04-.784-2.824 0l-9.176 9.176c-.78.78-.782 2.042 0 2.824l21.176 21.176c.78.78 2.04.784 2.824 0l37.176-37.176z'/%3E %3C/svg%3E")}.uikit-control-input--full>.uikit-control-input__input[type=radio]+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E %3Ccircle fill='%23fff' cx='64' cy='64' r='56'/%3E %3C/svg%3E")}.uikit-control-input--full>.uikit-control-input__input[type=radio]:checked+.uikit-control-input__text:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E %3Ccircle fill='%23fff' cx='64' cy='64' r='56'/%3E %3Ccircle fill='%23313131' cx='64' cy='64' r='44'/%3E %3C/svg%3E")}.uikit-control-input__input:checked+.uikit-control-input__text{font-weight:bold}.uikit-control-input__input:focus+.uikit-control-input__text{outline:1px solid #313131;outline-offset:1px}.uikit-control-input__input:disabled+.uikit-control-input__text{color:#6f6f6f}.uikit-control-input__input:disabled+.uikit-control-input__text:before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Cpath fill='rgba(255, 255, 255, 0.3)' d='M0 0h128v128H0z'/%3E %3C/svg%3E");z-index:2}.uikit-control-input__input:disabled:hover{cursor:not-allowed}.uikit-control-input__input:disabled:hover+.uikit-control-input__text{cursor:not-allowed}.uikit-control-input__text{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131;line-height:1.6;font-size:17px;margin-left:12px}.uikit-control-input__text:before,.uikit-control-input__text:after{content:' ';display:block;position:absolute;left:0;top:0;width:27px;height:27px;background-repeat:no-repeat;z-index:1}/*! @gov.au/footer v0.1.0 */@media print{.uikit-footer{background:#fff !important;border-color:#000 !important}}.uikit-footer{background-color:#f0f3f5;border-top:6px solid #555;padding:1.6em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131}.uikit-footer p:last-child{margin:0}.uikit-footer__navigation .uikit-link-list>li{margin-left:0}.uikit-footer__navigation+.uikit-footer__end{padding-top:1.6em;border-top:1px solid #555;margin-top:1.6em}/*! @gov.au/grid-12 v0.1.0 */.uikit-grid .container{box-sizing:border-box}@media (min-width: 768px){.uikit-grid .container{width:744px}}@media (min-width: 992px){.uikit-grid .container{width:968px}}@media (min-width: 1200px){.uikit-grid .container{width:1176px}}.uikit-grid .container,.uikit-grid .container-fluid{box-sizing:border-box;margin-right:auto;margin-left:auto;padding-left:12px;padding-right:12px}.uikit-grid .container:before,.uikit-grid .container:after,.uikit-grid .container-fluid:before,.uikit-grid .container-fluid:after{content:" ";display:table}.uikit-grid .container:after,.uikit-grid .container-fluid:after{clear:both}.uikit-grid .row{margin-left:-12px;margin-right:-12px}.uikit-grid .row:before,.uikit-grid .row:after{content:" ";display:table}.uikit-grid .row:after{clear:both}.uikit-grid .col-xs-1,.uikit-grid .col-sm-1,.uikit-grid .col-md-1,.uikit-grid .col-lg-1,.uikit-grid .col-xs-2,.uikit-grid .col-sm-2,.uikit-grid .col-md-2,.uikit-grid .col-lg-2,.uikit-grid .col-xs-3,.uikit-grid .col-sm-3,.uikit-grid .col-md-3,.uikit-grid .col-lg-3,.uikit-grid .col-xs-4,.uikit-grid .col-sm-4,.uikit-grid .col-md-4,.uikit-grid .col-lg-4,.uikit-grid .col-xs-5,.uikit-grid .col-sm-5,.uikit-grid .col-md-5,.uikit-grid .col-lg-5,.uikit-grid .col-xs-6,.uikit-grid .col-sm-6,.uikit-grid .col-md-6,.uikit-grid .col-lg-6,.uikit-grid .col-xs-7,.uikit-grid .col-sm-7,.uikit-grid .col-md-7,.uikit-grid .col-lg-7,.uikit-grid .col-xs-8,.uikit-grid .col-sm-8,.uikit-grid .col-md-8,.uikit-grid .col-lg-8,.uikit-grid .col-xs-9,.uikit-grid .col-sm-9,.uikit-grid .col-md-9,.uikit-grid .col-lg-9,.uikit-grid .col-xs-10,.uikit-grid .col-sm-10,.uikit-grid .col-md-10,.uikit-grid .col-lg-10,.uikit-grid .col-xs-11,.uikit-grid .col-sm-11,.uikit-grid .col-md-11,.uikit-grid .col-lg-11,.uikit-grid .col-xs-12,.uikit-grid .col-sm-12,.uikit-grid .col-md-12,.uikit-grid .col-lg-12{box-sizing:border-box;position:relative;min-height:1px;padding-left:12px;padding-right:12px}.uikit-grid .col-xs-1,.uikit-grid .col-xs-2,.uikit-grid .col-xs-3,.uikit-grid .col-xs-4,.uikit-grid .col-xs-5,.uikit-grid .col-xs-6,.uikit-grid .col-xs-7,.uikit-grid .col-xs-8,.uikit-grid .col-xs-9,.uikit-grid .col-xs-10,.uikit-grid .col-xs-11,.uikit-grid .col-xs-12{float:left}.uikit-grid .col-xs-1{width:8.33333%}.uikit-grid .col-xs-2{width:16.66667%}.uikit-grid .col-xs-3{width:25%}.uikit-grid .col-xs-4{width:33.33333%}.uikit-grid .col-xs-5{width:41.66667%}.uikit-grid .col-xs-6{width:50%}.uikit-grid .col-xs-7{width:58.33333%}.uikit-grid .col-xs-8{width:66.66667%}.uikit-grid .col-xs-9{width:75%}.uikit-grid .col-xs-10{width:83.33333%}.uikit-grid .col-xs-11{width:91.66667%}.uikit-grid .col-xs-12{width:100%}.uikit-grid .col-xs-pull-0{right:auto}.uikit-grid .col-xs-pull-1{right:8.33333%}.uikit-grid .col-xs-pull-2{right:16.66667%}.uikit-grid .col-xs-pull-3{right:25%}.uikit-grid .col-xs-pull-4{right:33.33333%}.uikit-grid .col-xs-pull-5{right:41.66667%}.uikit-grid .col-xs-pull-6{right:50%}.uikit-grid .col-xs-pull-7{right:58.33333%}.uikit-grid .col-xs-pull-8{right:66.66667%}.uikit-grid .col-xs-pull-9{right:75%}.uikit-grid .col-xs-pull-10{right:83.33333%}.uikit-grid .col-xs-pull-11{right:91.66667%}.uikit-grid .col-xs-pull-12{right:100%}.uikit-grid .col-xs-push-0{left:auto}.uikit-grid .col-xs-push-1{left:8.33333%}.uikit-grid .col-xs-push-2{left:16.66667%}.uikit-grid .col-xs-push-3{left:25%}.uikit-grid .col-xs-push-4{left:33.33333%}.uikit-grid .col-xs-push-5{left:41.66667%}.uikit-grid .col-xs-push-6{left:50%}.uikit-grid .col-xs-push-7{left:58.33333%}.uikit-grid .col-xs-push-8{left:66.66667%}.uikit-grid .col-xs-push-9{left:75%}.uikit-grid .col-xs-push-10{left:83.33333%}.uikit-grid .col-xs-push-11{left:91.66667%}.uikit-grid .col-xs-push-12{left:100%}.uikit-grid .col-xs-offset-0{margin-left:0%}.uikit-grid .col-xs-offset-1{margin-left:8.33333%}.uikit-grid .col-xs-offset-2{margin-left:16.66667%}.uikit-grid .col-xs-offset-3{margin-left:25%}.uikit-grid .col-xs-offset-4{margin-left:33.33333%}.uikit-grid .col-xs-offset-5{margin-left:41.66667%}.uikit-grid .col-xs-offset-6{margin-left:50%}.uikit-grid .col-xs-offset-7{margin-left:58.33333%}.uikit-grid .col-xs-offset-8{margin-left:66.66667%}.uikit-grid .col-xs-offset-9{margin-left:75%}.uikit-grid .col-xs-offset-10{margin-left:83.33333%}.uikit-grid .col-xs-offset-11{margin-left:91.66667%}.uikit-grid .col-xs-offset-12{margin-left:100%}@media (min-width: 768px){.uikit-grid .col-sm-1,.uikit-grid .col-sm-2,.uikit-grid .col-sm-3,.uikit-grid .col-sm-4,.uikit-grid .col-sm-5,.uikit-grid .col-sm-6,.uikit-grid .col-sm-7,.uikit-grid .col-sm-8,.uikit-grid .col-sm-9,.uikit-grid .col-sm-10,.uikit-grid .col-sm-11,.uikit-grid .col-sm-12{float:left}.uikit-grid .col-sm-1{width:8.33333%}.uikit-grid .col-sm-2{width:16.66667%}.uikit-grid .col-sm-3{width:25%}.uikit-grid .col-sm-4{width:33.33333%}.uikit-grid .col-sm-5{width:41.66667%}.uikit-grid .col-sm-6{width:50%}.uikit-grid .col-sm-7{width:58.33333%}.uikit-grid .col-sm-8{width:66.66667%}.uikit-grid .col-sm-9{width:75%}.uikit-grid .col-sm-10{width:83.33333%}.uikit-grid .col-sm-11{width:91.66667%}.uikit-grid .col-sm-12{width:100%}.uikit-grid .col-sm-pull-0{right:auto}.uikit-grid .col-sm-pull-1{right:8.33333%}.uikit-grid .col-sm-pull-2{right:16.66667%}.uikit-grid .col-sm-pull-3{right:25%}.uikit-grid .col-sm-pull-4{right:33.33333%}.uikit-grid .col-sm-pull-5{right:41.66667%}.uikit-grid .col-sm-pull-6{right:50%}.uikit-grid .col-sm-pull-7{right:58.33333%}.uikit-grid .col-sm-pull-8{right:66.66667%}.uikit-grid .col-sm-pull-9{right:75%}.uikit-grid .col-sm-pull-10{right:83.33333%}.uikit-grid .col-sm-pull-11{right:91.66667%}.uikit-grid .col-sm-pull-12{right:100%}.uikit-grid .col-sm-push-0{left:auto}.uikit-grid .col-sm-push-1{left:8.33333%}.uikit-grid .col-sm-push-2{left:16.66667%}.uikit-grid .col-sm-push-3{left:25%}.uikit-grid .col-sm-push-4{left:33.33333%}.uikit-grid .col-sm-push-5{left:41.66667%}.uikit-grid .col-sm-push-6{left:50%}.uikit-grid .col-sm-push-7{left:58.33333%}.uikit-grid .col-sm-push-8{left:66.66667%}.uikit-grid .col-sm-push-9{left:75%}.uikit-grid .col-sm-push-10{left:83.33333%}.uikit-grid .col-sm-push-11{left:91.66667%}.uikit-grid .col-sm-push-12{left:100%}.uikit-grid .col-sm-offset-0{margin-left:0%}.uikit-grid .col-sm-offset-1{margin-left:8.33333%}.uikit-grid .col-sm-offset-2{margin-left:16.66667%}.uikit-grid .col-sm-offset-3{margin-left:25%}.uikit-grid .col-sm-offset-4{margin-left:33.33333%}.uikit-grid .col-sm-offset-5{margin-left:41.66667%}.uikit-grid .col-sm-offset-6{margin-left:50%}.uikit-grid .col-sm-offset-7{margin-left:58.33333%}.uikit-grid .col-sm-offset-8{margin-left:66.66667%}.uikit-grid .col-sm-offset-9{margin-left:75%}.uikit-grid .col-sm-offset-10{margin-left:83.33333%}.uikit-grid .col-sm-offset-11{margin-left:91.66667%}.uikit-grid .col-sm-offset-12{margin-left:100%}}@media (min-width: 992px){.uikit-grid .col-md-1,.uikit-grid .col-md-2,.uikit-grid .col-md-3,.uikit-grid .col-md-4,.uikit-grid .col-md-5,.uikit-grid .col-md-6,.uikit-grid .col-md-7,.uikit-grid .col-md-8,.uikit-grid .col-md-9,.uikit-grid .col-md-10,.uikit-grid .col-md-11,.uikit-grid .col-md-12{float:left}.uikit-grid .col-md-1{width:8.33333%}.uikit-grid .col-md-2{width:16.66667%}.uikit-grid .col-md-3{width:25%}.uikit-grid .col-md-4{width:33.33333%}.uikit-grid .col-md-5{width:41.66667%}.uikit-grid .col-md-6{width:50%}.uikit-grid .col-md-7{width:58.33333%}.uikit-grid .col-md-8{width:66.66667%}.uikit-grid .col-md-9{width:75%}.uikit-grid .col-md-10{width:83.33333%}.uikit-grid .col-md-11{width:91.66667%}.uikit-grid .col-md-12{width:100%}.uikit-grid .col-md-pull-0{right:auto}.uikit-grid .col-md-pull-1{right:8.33333%}.uikit-grid .col-md-pull-2{right:16.66667%}.uikit-grid .col-md-pull-3{right:25%}.uikit-grid .col-md-pull-4{right:33.33333%}.uikit-grid .col-md-pull-5{right:41.66667%}.uikit-grid .col-md-pull-6{right:50%}.uikit-grid .col-md-pull-7{right:58.33333%}.uikit-grid .col-md-pull-8{right:66.66667%}.uikit-grid .col-md-pull-9{right:75%}.uikit-grid .col-md-pull-10{right:83.33333%}.uikit-grid .col-md-pull-11{right:91.66667%}.uikit-grid .col-md-pull-12{right:100%}.uikit-grid .col-md-push-0{left:auto}.uikit-grid .col-md-push-1{left:8.33333%}.uikit-grid .col-md-push-2{left:16.66667%}.uikit-grid .col-md-push-3{left:25%}.uikit-grid .col-md-push-4{left:33.33333%}.uikit-grid .col-md-push-5{left:41.66667%}.uikit-grid .col-md-push-6{left:50%}.uikit-grid .col-md-push-7{left:58.33333%}.uikit-grid .col-md-push-8{left:66.66667%}.uikit-grid .col-md-push-9{left:75%}.uikit-grid .col-md-push-10{left:83.33333%}.uikit-grid .col-md-push-11{left:91.66667%}.uikit-grid .col-md-push-12{left:100%}.uikit-grid .col-md-offset-0{margin-left:0%}.uikit-grid .col-md-offset-1{margin-left:8.33333%}.uikit-grid .col-md-offset-2{margin-left:16.66667%}.uikit-grid .col-md-offset-3{margin-left:25%}.uikit-grid .col-md-offset-4{margin-left:33.33333%}.uikit-grid .col-md-offset-5{margin-left:41.66667%}.uikit-grid .col-md-offset-6{margin-left:50%}.uikit-grid .col-md-offset-7{margin-left:58.33333%}.uikit-grid .col-md-offset-8{margin-left:66.66667%}.uikit-grid .col-md-offset-9{margin-left:75%}.uikit-grid .col-md-offset-10{margin-left:83.33333%}.uikit-grid .col-md-offset-11{margin-left:91.66667%}.uikit-grid .col-md-offset-12{margin-left:100%}}@media (min-width: 1200px){.uikit-grid .col-lg-1,.uikit-grid .col-lg-2,.uikit-grid .col-lg-3,.uikit-grid .col-lg-4,.uikit-grid .col-lg-5,.uikit-grid .col-lg-6,.uikit-grid .col-lg-7,.uikit-grid .col-lg-8,.uikit-grid .col-lg-9,.uikit-grid .col-lg-10,.uikit-grid .col-lg-11,.uikit-grid .col-lg-12{float:left}.uikit-grid .col-lg-1{width:8.33333%}.uikit-grid .col-lg-2{width:16.66667%}.uikit-grid .col-lg-3{width:25%}.uikit-grid .col-lg-4{width:33.33333%}.uikit-grid .col-lg-5{width:41.66667%}.uikit-grid .col-lg-6{width:50%}.uikit-grid .col-lg-7{width:58.33333%}.uikit-grid .col-lg-8{width:66.66667%}.uikit-grid .col-lg-9{width:75%}.uikit-grid .col-lg-10{width:83.33333%}.uikit-grid .col-lg-11{width:91.66667%}.uikit-grid .col-lg-12{width:100%}.uikit-grid .col-lg-pull-0{right:auto}.uikit-grid .col-lg-pull-1{right:8.33333%}.uikit-grid .col-lg-pull-2{right:16.66667%}.uikit-grid .col-lg-pull-3{right:25%}.uikit-grid .col-lg-pull-4{right:33.33333%}.uikit-grid .col-lg-pull-5{right:41.66667%}.uikit-grid .col-lg-pull-6{right:50%}.uikit-grid .col-lg-pull-7{right:58.33333%}.uikit-grid .col-lg-pull-8{right:66.66667%}.uikit-grid .col-lg-pull-9{right:75%}.uikit-grid .col-lg-pull-10{right:83.33333%}.uikit-grid .col-lg-pull-11{right:91.66667%}.uikit-grid .col-lg-pull-12{right:100%}.uikit-grid .col-lg-push-0{left:auto}.uikit-grid .col-lg-push-1{left:8.33333%}.uikit-grid .col-lg-push-2{left:16.66667%}.uikit-grid .col-lg-push-3{left:25%}.uikit-grid .col-lg-push-4{left:33.33333%}.uikit-grid .col-lg-push-5{left:41.66667%}.uikit-grid .col-lg-push-6{left:50%}.uikit-grid .col-lg-push-7{left:58.33333%}.uikit-grid .col-lg-push-8{left:66.66667%}.uikit-grid .col-lg-push-9{left:75%}.uikit-grid .col-lg-push-10{left:83.33333%}.uikit-grid .col-lg-push-11{left:91.66667%}.uikit-grid .col-lg-push-12{left:100%}.uikit-grid .col-lg-offset-0{margin-left:0%}.uikit-grid .col-lg-offset-1{margin-left:8.33333%}.uikit-grid .col-lg-offset-2{margin-left:16.66667%}.uikit-grid .col-lg-offset-3{margin-left:25%}.uikit-grid .col-lg-offset-4{margin-left:33.33333%}.uikit-grid .col-lg-offset-5{margin-left:41.66667%}.uikit-grid .col-lg-offset-6{margin-left:50%}.uikit-grid .col-lg-offset-7{margin-left:58.33333%}.uikit-grid .col-lg-offset-8{margin-left:66.66667%}.uikit-grid .col-lg-offset-9{margin-left:75%}.uikit-grid .col-lg-offset-10{margin-left:83.33333%}.uikit-grid .col-lg-offset-11{margin-left:91.66667%}.uikit-grid .col-lg-offset-12{margin-left:100%}}/*! @gov.au/header v1.0.0 */.uikit-header{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#fff;background:#008752;padding:1.6em 0 2em 0;margin-bottom:1.6em}.uikit-header.uikit-header--hero{padding:3.2em 0 4em 0}@media (min-width: 768px){.uikit-header{padding:3.2em 0 4.8em 0}.uikit-header.uikit-header--hero{padding:7.2em 0 13.6em 0}}.uikit-header.uikit-header--light{background-color:#f0f3f5;color:#313131}.uikit-header.uikit-header--dark{background-color:#313131}.uikit-header-heading{font-size:20px;line-height:1.6;font-weight:bold;margin:0;padding:0}@media (min-width: 768px){.uikit-header-heading{font-size:36px}}.uikit-header-subline{font-size:18px;line-height:1.6;max-width:42em}@media (min-width: 768px){.uikit-header-subline{font-size:20px}}/*! @gov.au/page-alerts v0.1.1 */@media print{.uikit-page-alerts{border-color:#000 !important;background-color:#fff !important;border-left:2px solid #000 !important;padding-top:3em !important}.uikit-page-alerts:after{background:none !important;content:'info' !important;top:1em !important;left:0 !important;font-size:12px !important;border-right:1px solid #000 !important;border-bottom:1px solid #000 !important;padding:0.5em !important;width:auto !important}.uikit-page-alerts--success:after{content:'success' !important}.uikit-page-alerts--warning:after{content:'warning' !important}.uikit-page-alerts--error:after{content:'error' !important}}.uikit-page-alerts{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131;line-height:1.6;position:relative;margin:1.6em 0;padding:1.2em .8em 1.2em .8em;border:solid 2px #00bfe9;border-left:48px solid #00bfe9;border-radius:3px;max-width:42em}.uikit-page-alerts :first-child{margin-top:0}.uikit-page-alerts :last-child{margin-bottom:0}.uikit-page-alerts:after{content:' ';position:absolute;display:block;left:-36px;top:50%;margin-top:-12px;width:24px;height:24px;background-repeat:no-repeat;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E %3Crect fill='%23fff' width='16' height='16' x='56' y='20' rx='2'/%3E %3Crect fill='%23fff' width='16' height='56' x='56' y='44' rx='2'/%3E %3Crect fill='%23fff' width='40' height='16' x='44' y='84' rx='2'/%3E %3Crect fill='%23fff' width='28' height='16' x='44' y='44' rx='2'/%3E %3C/svg%3E")}.ie8 .uikit-page-alerts:after,.lt-ie8 .uikit-page-alerts:after{background:none;text-align:center;background-color:#313131;color:#fff;font-weight:bold;content:'i'}.uikit-page-alerts--success{border-color:#3dbd93}.uikit-page-alerts--success:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Ccircle fill='%23313131' cx='64' cy='64' r='64'/%3E %3Cpath fill='%23fff' d='M102.59 45.41c.778-.778.782-2.038-.002-2.822l-9.176-9.176c-.78-.78-2.052-.772-2.823 0L56 68 41.42 53.42c-.784-.784-2.048-.792-2.832-.008l-9.176 9.176c-.78.78-.775 2.05-.004 2.82l25.184 25.184c.778.778 2.04.775 2.82-.003l45.177-45.18z'/%3E %3C/svg%3E")}.ie8 .uikit-page-alerts--success:after,.lt-ie8 .uikit-page-alerts--success:after{content:'✓'}.uikit-page-alerts--warning{border-color:#f69900}.uikit-page-alerts--warning:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Cpath fill='%23313131' d='M71.99 12.78l54.796 99.458c1.665 2.997 1.617 7.993-.143 10.99-.808 1.38-1.914 2.473-3.317 3.282-1.403.808-2.914 1.213-4.53 1.213H9.206c-1.62 0-3.13-.405-4.533-1.213-1.403-.81-2.51-1.903-3.317-3.282-1.76-2.997-1.808-7.993-.143-10.99L56.01 12.78c.808-1.474 1.925-2.64 3.352-3.496C60.79 8.428 62.335 8 64 8s3.21.428 4.638 1.284c1.427.856 2.544 2.022 3.353 3.496z'/%3E %3Crect fill='%23fff' width='16' height='16' x='56' y='96' rx='2'/%3E %3Cpath fill='%23fff' d='M52.167 42c-.092-1.104.73-2 1.838-2h19.99c1.107 0 1.93.895 1.838 2l-3.666 44c-.092 1.104-1.062 2-2.16 2H57.993c-1.1 0-2.07-.895-2.16-2l-3.667-44z'/%3E %3C/svg%3E")}.ie8 .uikit-page-alerts--warning:after,.lt-ie8 .uikit-page-alerts--warning:after{content:'!'}.uikit-page-alerts--error{border-color:#ff635c}.uikit-page-alerts--error:after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'%3E %3Cpath fill='%23313131' d='M71.99 12.78l54.796 99.458c1.665 2.997 1.617 7.993-.143 10.99-.808 1.38-1.914 2.473-3.317 3.282-1.403.808-2.914 1.213-4.53 1.213H9.206c-1.62 0-3.13-.405-4.533-1.213-1.403-.81-2.51-1.903-3.317-3.282-1.76-2.997-1.808-7.993-.143-10.99L56.01 12.78c.808-1.474 1.925-2.64 3.352-3.496C60.79 8.428 62.335 8 64 8s3.21.428 4.638 1.284c1.427.856 2.544 2.022 3.353 3.496z'/%3E %3Crect fill='%23fff' width='16' height='16' x='56' y='96' rx='2'/%3E %3Cpath fill='%23fff' d='M52.167 42c-.092-1.104.73-2 1.838-2h19.99c1.107 0 1.93.895 1.838 2l-3.666 44c-.092 1.104-1.062 2-2.16 2H57.993c-1.1 0-2.07-.895-2.16-2l-3.667-44z'/%3E %3C/svg%3E")}.ie8 .uikit-page-alerts--error:after,.lt-ie8 .uikit-page-alerts--error:after{content:'!'}.uikit-page-alerts__sronly{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}/*! @gov.au/progress-indicator v0.1.0 */@media print{.progress-indicator{border-top-color:#000 !important}.uikit-body .progress-indicator__link,.progress-indicator__link{border-bottom-color:#000 !important;border-left-color:transparent !important;padding-left:6px !important}.uikit-body .progress-indicator__link.progress-indicator--doing,.progress-indicator__link.progress-indicator--doing{border-left-color:#000 !important}.uikit-body .progress-indicator__link:after,.progress-indicator__link:after{display:none}}.uikit-body .progress-indicator,.progress-indicator{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;list-style:none;padding:0;margin:0 0 1.6em 0;border-top:1px solid #bbb}.uikit-body .progress-indicator>li,.progress-indicator>li{margin:0}.uikit-body .progress-indicator__link,.progress-indicator__link{position:relative;display:block;padding:.4em 0 .4em 41px;font-size:17px;color:#313131;text-decoration:none;line-height:1.45;border-bottom:1px solid #bbb;border-left:3px solid transparent;transition:background-color 0.1s ease-in-out}.uikit-body .progress-indicator__link:hover,.uikit-body .progress-indicator__link:focus,.progress-indicator__link:hover,.progress-indicator__link:focus{background-color:#cdf0e2;border-bottom-color:#bbb}.uikit-body .progress-indicator__link:focus,.progress-indicator__link:focus{outline:1px solid #313131;outline-offset:1px}.uikit-body .progress-indicator__link:after,.progress-indicator__link:after{content:'';position:absolute;left:6px;top:0;bottom:0;width:24px;background:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='%235a5a5a' d='M24,12 C24,18.6251859 18.6251859,24 12,24 C5.37481408,24 0,18.6251859 0,12 C0,5.37481408 5.37481408,0 12,0 C18.6251859,0 24,5.37481408 24,12 Z'%3E%3C/path%3E %3Cpath fill='%23fff' d='M22,12 C22,6.47916667 17.5208333,2 12,2 C6.47916667,2 2,6.47916667 2,12 C2,17.5208333 6.47916667,22 12,22 C17.5208333,22 22,17.5208333 22,12 Z'%3E%3C/path%3E %3C/svg%3E");background-repeat:no-repeat;background-position:0 center}.ie8 .uikit-body .progress-indicator__link:after,.lt-ie8 .uikit-body .progress-indicator__link:after,.ie8 .progress-indicator__link:after,.lt-ie8 .progress-indicator__link:after{top:6px;content:'-'}.uikit-body .progress-indicator__link.progress-indicator--doing,.progress-indicator__link.progress-indicator--doing{border-left-color:#115361;font-weight:bold}.uikit-body .progress-indicator__link.progress-indicator--doing:after,.progress-indicator__link.progress-indicator--doing:after{background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='%23115361' d='M24,12 C24,18.6251859 18.6251859,24 12,24 C5.37481408,24 0,18.6251859 0,12 C0,5.37481408 5.37481408,0 12,0 C18.6251859,0 24,5.37481408 24,12 Z'%3E%3C/path%3E %3Cpath fill='%23fff' d='M22,12 C22,6.47916667 17.5208333,2 12,2 C6.47916667,2 2,6.47916667 2,12 C2,17.5208333 6.47916667,22 12,22 C17.5208333,22 22,17.5208333 22,12 Z'%3E%3C/path%3E %3Ccircle fill='%23115361' cx='6.5' cy='12' r='1.5'%3E%3C/circle%3E %3Ccircle fill='%23115361' cx='12' cy='12' r='1.5'%3E%3C/circle%3E %3Ccircle fill='%23115361' cx='17.5' cy='12' r='1.5'%3E%3C/circle%3E %3C/svg%3E")}.ie8 .uikit-body .progress-indicator__link.progress-indicator--doing:after,.lt-ie8 .uikit-body .progress-indicator__link.progress-indicator--doing:after,.ie8 .progress-indicator__link.progress-indicator--doing:after,.lt-ie8 .progress-indicator__link.progress-indicator--doing:after{content:'...'}.uikit-body .progress-indicator__link.progress-indicator--done:after,.progress-indicator__link.progress-indicator--done:after{background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E %3Cpath fill='%23115361' d='M24,12 C24,18.6251859 18.6251859,24 12,24 C5.37481408,24 0,18.6251859 0,12 C0,5.37481408 5.37481408,0 12,0 C18.6251859,0 24,5.37481408 24,12 Z'%3E%3C/path%3E %3Cpath fill='%23fff' d='M22,12 C22,6.47916667 17.5208333,2 12,2 C6.47916667,2 2,6.47916667 2,12 C2,17.5208333 6.47916667,22 12,22 C17.5208333,22 22,17.5208333 22,12 Z'%3E%3C/path%3E %3Cpath fill='%23115361' d='M18.744186,9.23753281 C18.744186,9.48293963 18.6627907,9.71391076 18.5,9.88713911 L11.3895349,17.7257218 C11.2267442,17.8989501 10.996124,18 10.7655039,18 C10.5484496,18 10.3178295,17.8989501 10.1550388,17.7257218 L5.24418605,12.5 C5.08139535,12.3267717 5,12.0958005 5,11.8503937 C5,11.6049869 5.08139535,11.3595801 5.24418605,11.1863517 L6.47868217,9.88713911 C6.64147287,9.71391076 6.85852713,9.61286089 7.08914729,9.61286089 C7.31976744,9.61286089 7.53682171,9.71391076 7.6996124,9.88713911 L10.7655039,13.1496063 L16.0445736,7.27427822 C16.2073643,7.10104987 16.4244186,7 16.6550388,7 C16.8856589,7 17.1027132,7.10104987 17.2655039,7.27427822 L18.5,8.57349081 C18.6627907,8.74671916 18.744186,8.99212598 18.744186,9.23753281 Z'%3E%3C/path%3E %3C/svg%3E")}.ie8 .uikit-body .progress-indicator__link.progress-indicator--done:after,.lt-ie8 .uikit-body .progress-indicator__link.progress-indicator--done:after,.ie8 .progress-indicator__link.progress-indicator--done:after,.lt-ie8 .progress-indicator__link.progress-indicator--done:after{content:'✓'}.progress-indicator__status{display:block;font-size:14px;font-weight:normal;color:#5a5a5a}/*! @gov.au/text-inputs v0.1.1 */@media print{.uikit-text-input{border-color:#000 !important}:disabled{background-color:#f0f3f5 !important;border-color:transparent}[disabled]{background-color:#f0f3f5 !important}}.uikit-text-input__label{display:block;margin-bottom:.8em}.uikit-text-input__label>.uikit-text-input{margin-top:.8em}.uikit-text-input{border:2px solid #777;padding:.4em;font-size:16px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;color:#313131}.uikit-text-input:focus{outline:1px solid #313131;outline-offset:1px}.uikit-text-input:focus{background-color:#e6f8f1}.uikit-text-input::selection{background-color:rgba(250,194,102,0.5)}.uikit-text-input:invalid{border:2px solid #ff635c}.uikit-text-input:invalid:focus{background-color:#ffefef}.uikit-text-input.uikit-text-input--invalid,.uikit-text-input.invalid{border:2px solid #ff635c}.uikit-text-input.uikit-text-input--invalid:focus,.uikit-text-input.invalid:focus{background-color:#ffefef}.uikit-text-input.uikit-text-input--valid{border:2px solid #0cac78}.uikit-text-input.uikit-text-input--valid:focus{background-color:#e7f7f2}.uikit-text-input:disabled{cursor:not-allowed;background:#f0f3f5;color:#5a5a5a}.uikit-text-input[disabled]{cursor:not-allowed;background:#f0f3f5;color:#5a5a5a}.uikit-text-input--block{display:block;width:100%;box-sizing:border-box}.uikit-text-input--textarea{line-height:1.6}.uikit-text-input--number{font-family:"Lucida Sans Typewriter","Lucida Console",Monaco,"Bitstream Vera Sans Mono",monospace;letter-spacing:2px}.uikit-text-input__hint{display:block;margin-bottom:.4em;font-size:87.5%}.uikit-text-input__label>.uikit-text-input__hint,.uikit-text-input+.uikit-text-input__hint{margin-top:.4em}.uikit-grid .container:before,.uikit-grid .container:after,.uikit-grid .container-fluid:before,.uikit-grid .container-fluid:after{content:none}.uikit-body p{margin-bottom:.8em;max-width:none}.uikit-body h1{line-height:1.25}.uikit-body h3{margin:1.8em 0 .8em;letter-spacing:-0.05em}.uikit-body h3:first-of-type{margin:.8em 0 .8em}.uikit-body .uikit-text-input{padding:.8em .4em}.uikit-text-input__label{margin-bottom:.8em}.uikit-header{margin-bottom:0;font-weight:bold}.uikit-header--light{padding:.8em 0;text-align:center}.uikit-fileupload input[type="file"]{width:0.1px;height:0.1px;opacity:0;overflow:hidden;position:absolute;z-index:-1}a.uikit-btn,a.uikit-btn.uikit-btn--primary{color:#fff}a.uikit-btn:hover,a.uikit-btn:focus,a.uikit-btn.uikit-btn--primary:hover,a.uikit-btn.uikit-btn--primary:focus{background-color:#005f39}a.uikit-btn.uikit-btn--secondary{border-bottom:1px solid #313131}a.uikit-btn.uikit-btn--secondary:hover,a.uikit-btn.uikit-btn--secondary:focus{background-color:#222}a.uikit-btn.uikit-btn--tertiary{color:#313131}a.uikit-btn.uikit-btn--tertiary:hover,a.uikit-btn.uikit-btn--tertiary:focus{background-color:#e6f3ee;border:1px solid #008752}.uikit-btn{text-align:center}@media (max-width: 640px){.uikit-btn{display:block}}.uikit-control-input{display:block}@media (max-width: 640px){input.uikit-btn,button.uikit-btn{width:100%}}.uikit-table{border-collapse:collapse;border-spacing:0;table-layout:fixed;width:100%;margin:0;padding:0}.uikit-table tr{padding:.4em}.uikit-table th,.uikit-table td{text-align:left;vertical-align:middle}.uikit-table td{padding:0}.uikit-table td:first-child{padding-left:0}.uikit-table td:last-child{padding-right:0}.uikit-currency-input__root{position:relative}.uikit-currency-input__prefix{display:none;width:2em;line-height:1.4;position:absolute;text-align:center;padding:0.4em 0;top:0;bottom:0;left:0}#drop-zone{border:2px dashed #777;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;padding:25px;text-align:center}#file-list ul{margin-top:1.6em}#file-input{display:none}@media (max-width: 640px){#drop-zone{display:none}#file-input{display:inline-block}}.uikit-body ul.parsley-errors-list,.uikit-body ol.parsley-errors-list,.uikit-body dl.parsley-errors-list,.uikit-body pre.parsley-errors-list{transition:max-height 500ms 300ms ease-in-out;max-height:0em;padding:0;margin:0;color:#b34540;list-style:none;overflow:hidden}.uikit-body ul.parsley-errors-list.filled,.uikit-body ol.parsley-errors-list.filled,.uikit-body dl.parsley-errors-list.filled,.uikit-body pre.parsley-errors-list.filled{transition:max-height 500ms 300ms ease-in-out;max-height:10em}.search-list--input-container{padding-bottom:1em}.search-list--input-label{position:absolute;z-index:10;line-height:2.8;cursor:auto;padding-left:0.6em}.step-indicator{display:flex;width:100%;margin:3.2em 0 2.4em !important;list-style:none;padding-left:0 !important;font-size:65%}.step-indicator>li{position:relative;text-align:center;flex:1}.step-indicator>li::after{content:' ';border-top:0.6em #ccc solid;position:absolute;display:block;width:100%;left:-50%;top:0.75em;z-index:1}.step-indicator>li:first-child::after{content:none;display:none}.step-indicator>li.completed::after{border-color:#008752}.step-indicator>li.completed .bubble{border-color:#008752;background:#008752}.step-indicator>li .bubble{position:relative;box-sizing:border-box;background:#f0f3f5;border:0.6em #ccc solid;border-radius:100%;display:block;margin:0 auto;height:2em;width:2em;z-index:4}@media (min-width: 640px){.step-indicator{font-size:90%}}@media (min-width: 320px){body{font-size:90%}}@media (max-width: 640px) and (min-height: 666px){.footer--fixed-bottom{position:fixed;box-sizing:border-box;padding:0.6em;width:100%;bottom:0;right:0;left:0}}.js-hidden{display:none}.mobile-hidden{display:none}@media (min-width: 769px){.mobile-hidden{display:inherit}}.date-field{box-sizing:border-box;display:block;width:100%}.date-field::-webkit-clear-button{display:none;-webkit-appearance:none}.date-field::-webkit-datetime-edit-text{color:#555;padding:0 .2em}.date-field::-webkit-datetime-edit-month-field,.date-field::-webkit-datetime-edit-day-field,.date-field::-webkit-datetime-edit-year-field{text-transform:uppercase;padding:0}.date-field::-webkit-inner-spin-button{display:none}.date-field::-webkit-calendar-picker-indicator{background-color:transparent}
|
data/assets/js/vendor/main.js
CHANGED
@@ -1,78 +1 @@
|
|
1
1
|
|
2
|
-
let radioSaver = elm => elm.checked ? 1 : 0;
|
3
|
-
let textSaver = elm => elm.value;
|
4
|
-
|
5
|
-
let saver = function(selector, key, savingFunction) {
|
6
|
-
let elements = document.querySelectorAll(selector);
|
7
|
-
let values = Array.prototype.map.call(elements, savingFunction);
|
8
|
-
|
9
|
-
localStorage.setItem(key, JSON.stringify(values));
|
10
|
-
};
|
11
|
-
|
12
|
-
let radioLoader = elements => (val, ind) => elements[ind].checked = val === 1 ? true : false;
|
13
|
-
let textLoader = elements => (val, ind) => elements[ind].value = val;
|
14
|
-
|
15
|
-
let loader = function(selector, localKey, loadingFunction) {
|
16
|
-
let elements = document.querySelectorAll(selector);
|
17
|
-
let stringifiedValues = localStorage.getItem(localKey);
|
18
|
-
try {
|
19
|
-
let values = JSON.parse(stringifiedValues);
|
20
|
-
values.forEach(loadingFunction(elements));
|
21
|
-
} catch (e) {
|
22
|
-
console.log(`No local data for ${localKey}`);
|
23
|
-
}
|
24
|
-
};
|
25
|
-
|
26
|
-
let saveRadioValues = function() {
|
27
|
-
saver('input[type=radio]', 'radioValues', radioSaver);
|
28
|
-
};
|
29
|
-
|
30
|
-
let saveCheckBoxValues = function() {
|
31
|
-
saver('input[type=checkbox]', 'checkBoxValues', radioSaver);
|
32
|
-
};
|
33
|
-
|
34
|
-
let saveTextInputValues = function() {
|
35
|
-
saver('input[type=text]', 'textInputValues', textSaver);
|
36
|
-
};
|
37
|
-
|
38
|
-
let saveDateInputValues = function() {
|
39
|
-
saver('input[type=date]', 'dateInputValues', textSaver);
|
40
|
-
};
|
41
|
-
|
42
|
-
let loadRadioValues = function() {
|
43
|
-
loader('input[type=radio]', 'radioValues', radioLoader);
|
44
|
-
};
|
45
|
-
|
46
|
-
let loadCheckBoxValues = function() {
|
47
|
-
loader('input[type=checkbox]', 'checkBoxValues', radioLoader);
|
48
|
-
};
|
49
|
-
|
50
|
-
let loadTextInputValues = function() {
|
51
|
-
loader('input[type=text]', 'textInputValues', textLoader);
|
52
|
-
};
|
53
|
-
|
54
|
-
let loadDateInputValues = function() {
|
55
|
-
loader('input[type=date]', 'dateInputValues', textLoader);
|
56
|
-
};
|
57
|
-
|
58
|
-
let saveForm = () => {
|
59
|
-
saveRadioValues();
|
60
|
-
saveCheckBoxValues();
|
61
|
-
saveTextInputValues();
|
62
|
-
saveDateInputValues();
|
63
|
-
}
|
64
|
-
|
65
|
-
let loadForm = function() {
|
66
|
-
loadRadioValues();
|
67
|
-
loadCheckBoxValues();
|
68
|
-
loadTextInputValues();
|
69
|
-
loadDateInputValues();
|
70
|
-
};
|
71
|
-
|
72
|
-
window.onbeforeunload = (e) => {
|
73
|
-
saveForm();
|
74
|
-
}
|
75
|
-
|
76
|
-
window.onload = (e) => {
|
77
|
-
loadForm();
|
78
|
-
}
|
@@ -0,0 +1,2462 @@
|
|
1
|
+
/*!
|
2
|
+
* Parsley.js
|
3
|
+
* Version 2.7.2 - built Tue, May 9th 2017, 11:21 am
|
4
|
+
* http://parsleyjs.org
|
5
|
+
* Guillaume Potier - <guillaume@wisembly.com>
|
6
|
+
* Marc-Andre Lafortune - <petroselinum@marc-andre.ca>
|
7
|
+
* MIT Licensed
|
8
|
+
*/
|
9
|
+
|
10
|
+
// The source code below is generated by babel as
|
11
|
+
// Parsley is written in ECMAScript 6
|
12
|
+
//
|
13
|
+
var _slice = Array.prototype.slice;
|
14
|
+
|
15
|
+
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
|
16
|
+
|
17
|
+
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
|
18
|
+
|
19
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
|
20
|
+
|
21
|
+
(function (global, factory) {
|
22
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) : typeof define === 'function' && define.amd ? define(['jquery'], factory) : global.parsley = factory(global.jQuery);
|
23
|
+
})(this, function ($) {
|
24
|
+
'use strict';
|
25
|
+
|
26
|
+
var globalID = 1;
|
27
|
+
var pastWarnings = {};
|
28
|
+
|
29
|
+
var Utils = {
|
30
|
+
// Parsley DOM-API
|
31
|
+
// returns object from dom attributes and values
|
32
|
+
attr: function attr(element, namespace, obj) {
|
33
|
+
var i;
|
34
|
+
var attribute;
|
35
|
+
var attributes;
|
36
|
+
var regex = new RegExp('^' + namespace, 'i');
|
37
|
+
|
38
|
+
if ('undefined' === typeof obj) obj = {};else {
|
39
|
+
// Clear all own properties. This won't affect prototype's values
|
40
|
+
for (i in obj) {
|
41
|
+
if (obj.hasOwnProperty(i)) delete obj[i];
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
if (!element) return obj;
|
46
|
+
|
47
|
+
attributes = element.attributes;
|
48
|
+
for (i = attributes.length; i--;) {
|
49
|
+
attribute = attributes[i];
|
50
|
+
|
51
|
+
if (attribute && attribute.specified && regex.test(attribute.name)) {
|
52
|
+
obj[this.camelize(attribute.name.slice(namespace.length))] = this.deserializeValue(attribute.value);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
return obj;
|
57
|
+
},
|
58
|
+
|
59
|
+
checkAttr: function checkAttr(element, namespace, _checkAttr) {
|
60
|
+
return element.hasAttribute(namespace + _checkAttr);
|
61
|
+
},
|
62
|
+
|
63
|
+
setAttr: function setAttr(element, namespace, attr, value) {
|
64
|
+
element.setAttribute(this.dasherize(namespace + attr), String(value));
|
65
|
+
},
|
66
|
+
|
67
|
+
generateID: function generateID() {
|
68
|
+
return '' + globalID++;
|
69
|
+
},
|
70
|
+
|
71
|
+
/** Third party functions **/
|
72
|
+
// Zepto deserialize function
|
73
|
+
deserializeValue: function deserializeValue(value) {
|
74
|
+
var num;
|
75
|
+
|
76
|
+
try {
|
77
|
+
return value ? value == "true" || (value == "false" ? false : value == "null" ? null : !isNaN(num = Number(value)) ? num : /^[\[\{]/.test(value) ? $.parseJSON(value) : value) : value;
|
78
|
+
} catch (e) {
|
79
|
+
return value;
|
80
|
+
}
|
81
|
+
},
|
82
|
+
|
83
|
+
// Zepto camelize function
|
84
|
+
camelize: function camelize(str) {
|
85
|
+
return str.replace(/-+(.)?/g, function (match, chr) {
|
86
|
+
return chr ? chr.toUpperCase() : '';
|
87
|
+
});
|
88
|
+
},
|
89
|
+
|
90
|
+
// Zepto dasherize function
|
91
|
+
dasherize: function dasherize(str) {
|
92
|
+
return str.replace(/::/g, '/').replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\d])([A-Z])/g, '$1_$2').replace(/_/g, '-').toLowerCase();
|
93
|
+
},
|
94
|
+
|
95
|
+
warn: function warn() {
|
96
|
+
var _window$console;
|
97
|
+
|
98
|
+
if (window.console && 'function' === typeof window.console.warn) (_window$console = window.console).warn.apply(_window$console, arguments);
|
99
|
+
},
|
100
|
+
|
101
|
+
warnOnce: function warnOnce(msg) {
|
102
|
+
if (!pastWarnings[msg]) {
|
103
|
+
pastWarnings[msg] = true;
|
104
|
+
this.warn.apply(this, arguments);
|
105
|
+
}
|
106
|
+
},
|
107
|
+
|
108
|
+
_resetWarnings: function _resetWarnings() {
|
109
|
+
pastWarnings = {};
|
110
|
+
},
|
111
|
+
|
112
|
+
trimString: function trimString(string) {
|
113
|
+
return string.replace(/^\s+|\s+$/g, '');
|
114
|
+
},
|
115
|
+
|
116
|
+
parse: {
|
117
|
+
date: function date(string) {
|
118
|
+
var parsed = string.match(/^(\d{4,})-(\d\d)-(\d\d)$/);
|
119
|
+
if (!parsed) return null;
|
120
|
+
|
121
|
+
var _parsed$map = parsed.map(function (x) {
|
122
|
+
return parseInt(x, 10);
|
123
|
+
});
|
124
|
+
|
125
|
+
var _parsed$map2 = _slicedToArray(_parsed$map, 4);
|
126
|
+
|
127
|
+
var _ = _parsed$map2[0];
|
128
|
+
var year = _parsed$map2[1];
|
129
|
+
var month = _parsed$map2[2];
|
130
|
+
var day = _parsed$map2[3];
|
131
|
+
|
132
|
+
var date = new Date(year, month - 1, day);
|
133
|
+
if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) return null;
|
134
|
+
return date;
|
135
|
+
},
|
136
|
+
string: function string(_string) {
|
137
|
+
return _string;
|
138
|
+
},
|
139
|
+
integer: function integer(string) {
|
140
|
+
if (isNaN(string)) return null;
|
141
|
+
return parseInt(string, 10);
|
142
|
+
},
|
143
|
+
number: function number(string) {
|
144
|
+
if (isNaN(string)) throw null;
|
145
|
+
return parseFloat(string);
|
146
|
+
},
|
147
|
+
'boolean': function _boolean(string) {
|
148
|
+
return !/^\s*false\s*$/i.test(string);
|
149
|
+
},
|
150
|
+
object: function object(string) {
|
151
|
+
return Utils.deserializeValue(string);
|
152
|
+
},
|
153
|
+
regexp: function regexp(_regexp) {
|
154
|
+
var flags = '';
|
155
|
+
|
156
|
+
// Test if RegExp is literal, if not, nothing to be done, otherwise, we need to isolate flags and pattern
|
157
|
+
if (/^\/.*\/(?:[gimy]*)$/.test(_regexp)) {
|
158
|
+
// Replace the regexp literal string with the first match group: ([gimy]*)
|
159
|
+
// If no flag is present, this will be a blank string
|
160
|
+
flags = _regexp.replace(/.*\/([gimy]*)$/, '$1');
|
161
|
+
// Again, replace the regexp literal string with the first match group:
|
162
|
+
// everything excluding the opening and closing slashes and the flags
|
163
|
+
_regexp = _regexp.replace(new RegExp('^/(.*?)/' + flags + '$'), '$1');
|
164
|
+
} else {
|
165
|
+
// Anchor regexp:
|
166
|
+
_regexp = '^' + _regexp + '$';
|
167
|
+
}
|
168
|
+
return new RegExp(_regexp, flags);
|
169
|
+
}
|
170
|
+
},
|
171
|
+
|
172
|
+
parseRequirement: function parseRequirement(requirementType, string) {
|
173
|
+
var converter = this.parse[requirementType || 'string'];
|
174
|
+
if (!converter) throw 'Unknown requirement specification: "' + requirementType + '"';
|
175
|
+
var converted = converter(string);
|
176
|
+
if (converted === null) throw 'Requirement is not a ' + requirementType + ': "' + string + '"';
|
177
|
+
return converted;
|
178
|
+
},
|
179
|
+
|
180
|
+
namespaceEvents: function namespaceEvents(events, namespace) {
|
181
|
+
events = this.trimString(events || '').split(/\s+/);
|
182
|
+
if (!events[0]) return '';
|
183
|
+
return $.map(events, function (evt) {
|
184
|
+
return evt + '.' + namespace;
|
185
|
+
}).join(' ');
|
186
|
+
},
|
187
|
+
|
188
|
+
difference: function difference(array, remove) {
|
189
|
+
// This is O(N^2), should be optimized
|
190
|
+
var result = [];
|
191
|
+
$.each(array, function (_, elem) {
|
192
|
+
if (remove.indexOf(elem) == -1) result.push(elem);
|
193
|
+
});
|
194
|
+
return result;
|
195
|
+
},
|
196
|
+
|
197
|
+
// Alter-ego to native Promise.all, but for jQuery
|
198
|
+
all: function all(promises) {
|
199
|
+
// jQuery treats $.when() and $.when(singlePromise) differently; let's avoid that and add spurious elements
|
200
|
+
return $.when.apply($, _toConsumableArray(promises).concat([42, 42]));
|
201
|
+
},
|
202
|
+
|
203
|
+
// Object.create polyfill, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create#Polyfill
|
204
|
+
objectCreate: Object.create || (function () {
|
205
|
+
var Object = function Object() {};
|
206
|
+
return function (prototype) {
|
207
|
+
if (arguments.length > 1) {
|
208
|
+
throw Error('Second argument not supported');
|
209
|
+
}
|
210
|
+
if (typeof prototype != 'object') {
|
211
|
+
throw TypeError('Argument must be an object');
|
212
|
+
}
|
213
|
+
Object.prototype = prototype;
|
214
|
+
var result = new Object();
|
215
|
+
Object.prototype = null;
|
216
|
+
return result;
|
217
|
+
};
|
218
|
+
})(),
|
219
|
+
|
220
|
+
_SubmitSelector: 'input[type="submit"], button:submit'
|
221
|
+
};
|
222
|
+
|
223
|
+
// All these options could be overriden and specified directly in DOM using
|
224
|
+
// `data-parsley-` default DOM-API
|
225
|
+
// eg: `inputs` can be set in DOM using `data-parsley-inputs="input, textarea"`
|
226
|
+
// eg: `data-parsley-stop-on-first-failing-constraint="false"`
|
227
|
+
|
228
|
+
var Defaults = {
|
229
|
+
// ### General
|
230
|
+
|
231
|
+
// Default data-namespace for DOM API
|
232
|
+
namespace: 'data-parsley-',
|
233
|
+
|
234
|
+
// Supported inputs by default
|
235
|
+
inputs: 'input, textarea, select',
|
236
|
+
|
237
|
+
// Excluded inputs by default
|
238
|
+
excluded: 'input[type=button], input[type=submit], input[type=reset], input[type=hidden]',
|
239
|
+
|
240
|
+
// Stop validating field on highest priority failing constraint
|
241
|
+
priorityEnabled: true,
|
242
|
+
|
243
|
+
// ### Field only
|
244
|
+
|
245
|
+
// identifier used to group together inputs (e.g. radio buttons...)
|
246
|
+
multiple: null,
|
247
|
+
|
248
|
+
// identifier (or array of identifiers) used to validate only a select group of inputs
|
249
|
+
group: null,
|
250
|
+
|
251
|
+
// ### UI
|
252
|
+
// Enable\Disable error messages
|
253
|
+
uiEnabled: true,
|
254
|
+
|
255
|
+
// Key events threshold before validation
|
256
|
+
validationThreshold: 3,
|
257
|
+
|
258
|
+
// Focused field on form validation error. 'first'|'last'|'none'
|
259
|
+
focus: 'first',
|
260
|
+
|
261
|
+
// event(s) that will trigger validation before first failure. eg: `input`...
|
262
|
+
trigger: false,
|
263
|
+
|
264
|
+
// event(s) that will trigger validation after first failure.
|
265
|
+
triggerAfterFailure: 'input',
|
266
|
+
|
267
|
+
// Class that would be added on every failing validation Parsley field
|
268
|
+
errorClass: 'parsley-error',
|
269
|
+
|
270
|
+
// Same for success validation
|
271
|
+
successClass: 'parsley-success',
|
272
|
+
|
273
|
+
// Return the `$element` that will receive these above success or error classes
|
274
|
+
// Could also be (and given directly from DOM) a valid selector like `'#div'`
|
275
|
+
classHandler: function classHandler(Field) {},
|
276
|
+
|
277
|
+
// Return the `$element` where errors will be appended
|
278
|
+
// Could also be (and given directly from DOM) a valid selector like `'#div'`
|
279
|
+
errorsContainer: function errorsContainer(Field) {},
|
280
|
+
|
281
|
+
// ul elem that would receive errors' list
|
282
|
+
errorsWrapper: '<ul class="parsley-errors-list"></ul>',
|
283
|
+
|
284
|
+
// li elem that would receive error message
|
285
|
+
errorTemplate: '<li></li>'
|
286
|
+
};
|
287
|
+
|
288
|
+
var Base = function Base() {
|
289
|
+
this.__id__ = Utils.generateID();
|
290
|
+
};
|
291
|
+
|
292
|
+
Base.prototype = {
|
293
|
+
asyncSupport: true, // Deprecated
|
294
|
+
|
295
|
+
_pipeAccordingToValidationResult: function _pipeAccordingToValidationResult() {
|
296
|
+
var _this = this;
|
297
|
+
|
298
|
+
var pipe = function pipe() {
|
299
|
+
var r = $.Deferred();
|
300
|
+
if (true !== _this.validationResult) r.reject();
|
301
|
+
return r.resolve().promise();
|
302
|
+
};
|
303
|
+
return [pipe, pipe];
|
304
|
+
},
|
305
|
+
|
306
|
+
actualizeOptions: function actualizeOptions() {
|
307
|
+
Utils.attr(this.element, this.options.namespace, this.domOptions);
|
308
|
+
if (this.parent && this.parent.actualizeOptions) this.parent.actualizeOptions();
|
309
|
+
return this;
|
310
|
+
},
|
311
|
+
|
312
|
+
_resetOptions: function _resetOptions(initOptions) {
|
313
|
+
this.domOptions = Utils.objectCreate(this.parent.options);
|
314
|
+
this.options = Utils.objectCreate(this.domOptions);
|
315
|
+
// Shallow copy of ownProperties of initOptions:
|
316
|
+
for (var i in initOptions) {
|
317
|
+
if (initOptions.hasOwnProperty(i)) this.options[i] = initOptions[i];
|
318
|
+
}
|
319
|
+
this.actualizeOptions();
|
320
|
+
},
|
321
|
+
|
322
|
+
_listeners: null,
|
323
|
+
|
324
|
+
// Register a callback for the given event name
|
325
|
+
// Callback is called with context as the first argument and the `this`
|
326
|
+
// The context is the current parsley instance, or window.Parsley if global
|
327
|
+
// A return value of `false` will interrupt the calls
|
328
|
+
on: function on(name, fn) {
|
329
|
+
this._listeners = this._listeners || {};
|
330
|
+
var queue = this._listeners[name] = this._listeners[name] || [];
|
331
|
+
queue.push(fn);
|
332
|
+
|
333
|
+
return this;
|
334
|
+
},
|
335
|
+
|
336
|
+
// Deprecated. Use `on` instead
|
337
|
+
subscribe: function subscribe(name, fn) {
|
338
|
+
$.listenTo(this, name.toLowerCase(), fn);
|
339
|
+
},
|
340
|
+
|
341
|
+
// Unregister a callback (or all if none is given) for the given event name
|
342
|
+
off: function off(name, fn) {
|
343
|
+
var queue = this._listeners && this._listeners[name];
|
344
|
+
if (queue) {
|
345
|
+
if (!fn) {
|
346
|
+
delete this._listeners[name];
|
347
|
+
} else {
|
348
|
+
for (var i = queue.length; i--;) if (queue[i] === fn) queue.splice(i, 1);
|
349
|
+
}
|
350
|
+
}
|
351
|
+
return this;
|
352
|
+
},
|
353
|
+
|
354
|
+
// Deprecated. Use `off`
|
355
|
+
unsubscribe: function unsubscribe(name, fn) {
|
356
|
+
$.unsubscribeTo(this, name.toLowerCase());
|
357
|
+
},
|
358
|
+
|
359
|
+
// Trigger an event of the given name
|
360
|
+
// A return value of `false` interrupts the callback chain
|
361
|
+
// Returns false if execution was interrupted
|
362
|
+
trigger: function trigger(name, target, extraArg) {
|
363
|
+
target = target || this;
|
364
|
+
var queue = this._listeners && this._listeners[name];
|
365
|
+
var result;
|
366
|
+
var parentResult;
|
367
|
+
if (queue) {
|
368
|
+
for (var i = queue.length; i--;) {
|
369
|
+
result = queue[i].call(target, target, extraArg);
|
370
|
+
if (result === false) return result;
|
371
|
+
}
|
372
|
+
}
|
373
|
+
if (this.parent) {
|
374
|
+
return this.parent.trigger(name, target, extraArg);
|
375
|
+
}
|
376
|
+
return true;
|
377
|
+
},
|
378
|
+
|
379
|
+
asyncIsValid: function asyncIsValid(group, force) {
|
380
|
+
Utils.warnOnce("asyncIsValid is deprecated; please use whenValid instead");
|
381
|
+
return this.whenValid({ group: group, force: force });
|
382
|
+
},
|
383
|
+
|
384
|
+
_findRelated: function _findRelated() {
|
385
|
+
return this.options.multiple ? $(this.parent.element.querySelectorAll('[' + this.options.namespace + 'multiple="' + this.options.multiple + '"]')) : this.$element;
|
386
|
+
}
|
387
|
+
};
|
388
|
+
|
389
|
+
var convertArrayRequirement = function convertArrayRequirement(string, length) {
|
390
|
+
var m = string.match(/^\s*\[(.*)\]\s*$/);
|
391
|
+
if (!m) throw 'Requirement is not an array: "' + string + '"';
|
392
|
+
var values = m[1].split(',').map(Utils.trimString);
|
393
|
+
if (values.length !== length) throw 'Requirement has ' + values.length + ' values when ' + length + ' are needed';
|
394
|
+
return values;
|
395
|
+
};
|
396
|
+
|
397
|
+
var convertExtraOptionRequirement = function convertExtraOptionRequirement(requirementSpec, string, extraOptionReader) {
|
398
|
+
var main = null;
|
399
|
+
var extra = {};
|
400
|
+
for (var key in requirementSpec) {
|
401
|
+
if (key) {
|
402
|
+
var value = extraOptionReader(key);
|
403
|
+
if ('string' === typeof value) value = Utils.parseRequirement(requirementSpec[key], value);
|
404
|
+
extra[key] = value;
|
405
|
+
} else {
|
406
|
+
main = Utils.parseRequirement(requirementSpec[key], string);
|
407
|
+
}
|
408
|
+
}
|
409
|
+
return [main, extra];
|
410
|
+
};
|
411
|
+
|
412
|
+
// A Validator needs to implement the methods `validate` and `parseRequirements`
|
413
|
+
|
414
|
+
var Validator = function Validator(spec) {
|
415
|
+
$.extend(true, this, spec);
|
416
|
+
};
|
417
|
+
|
418
|
+
Validator.prototype = {
|
419
|
+
// Returns `true` iff the given `value` is valid according the given requirements.
|
420
|
+
validate: function validate(value, requirementFirstArg) {
|
421
|
+
if (this.fn) {
|
422
|
+
// Legacy style validator
|
423
|
+
|
424
|
+
if (arguments.length > 3) // If more args then value, requirement, instance...
|
425
|
+
requirementFirstArg = [].slice.call(arguments, 1, -1); // Skip first arg (value) and last (instance), combining the rest
|
426
|
+
return this.fn(value, requirementFirstArg);
|
427
|
+
}
|
428
|
+
|
429
|
+
if (Array.isArray(value)) {
|
430
|
+
if (!this.validateMultiple) throw 'Validator `' + this.name + '` does not handle multiple values';
|
431
|
+
return this.validateMultiple.apply(this, arguments);
|
432
|
+
} else {
|
433
|
+
var instance = arguments[arguments.length - 1];
|
434
|
+
if (this.validateDate && instance._isDateInput()) {
|
435
|
+
arguments[0] = Utils.parse.date(arguments[0]);
|
436
|
+
if (arguments[0] === null) return false;
|
437
|
+
return this.validateDate.apply(this, arguments);
|
438
|
+
}
|
439
|
+
if (this.validateNumber) {
|
440
|
+
if (isNaN(value)) return false;
|
441
|
+
arguments[0] = parseFloat(arguments[0]);
|
442
|
+
return this.validateNumber.apply(this, arguments);
|
443
|
+
}
|
444
|
+
if (this.validateString) {
|
445
|
+
return this.validateString.apply(this, arguments);
|
446
|
+
}
|
447
|
+
throw 'Validator `' + this.name + '` only handles multiple values';
|
448
|
+
}
|
449
|
+
},
|
450
|
+
|
451
|
+
// Parses `requirements` into an array of arguments,
|
452
|
+
// according to `this.requirementType`
|
453
|
+
parseRequirements: function parseRequirements(requirements, extraOptionReader) {
|
454
|
+
if ('string' !== typeof requirements) {
|
455
|
+
// Assume requirement already parsed
|
456
|
+
// but make sure we return an array
|
457
|
+
return Array.isArray(requirements) ? requirements : [requirements];
|
458
|
+
}
|
459
|
+
var type = this.requirementType;
|
460
|
+
if (Array.isArray(type)) {
|
461
|
+
var values = convertArrayRequirement(requirements, type.length);
|
462
|
+
for (var i = 0; i < values.length; i++) values[i] = Utils.parseRequirement(type[i], values[i]);
|
463
|
+
return values;
|
464
|
+
} else if ($.isPlainObject(type)) {
|
465
|
+
return convertExtraOptionRequirement(type, requirements, extraOptionReader);
|
466
|
+
} else {
|
467
|
+
return [Utils.parseRequirement(type, requirements)];
|
468
|
+
}
|
469
|
+
},
|
470
|
+
// Defaults:
|
471
|
+
requirementType: 'string',
|
472
|
+
|
473
|
+
priority: 2
|
474
|
+
|
475
|
+
};
|
476
|
+
|
477
|
+
var ValidatorRegistry = function ValidatorRegistry(validators, catalog) {
|
478
|
+
this.__class__ = 'ValidatorRegistry';
|
479
|
+
|
480
|
+
// Default Parsley locale is en
|
481
|
+
this.locale = 'en';
|
482
|
+
|
483
|
+
this.init(validators || {}, catalog || {});
|
484
|
+
};
|
485
|
+
|
486
|
+
var typeTesters = {
|
487
|
+
email: /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,
|
488
|
+
|
489
|
+
// Follow https://www.w3.org/TR/html5/infrastructure.html#floating-point-numbers
|
490
|
+
number: /^-?(\d*\.)?\d+(e[-+]?\d+)?$/i,
|
491
|
+
|
492
|
+
integer: /^-?\d+$/,
|
493
|
+
|
494
|
+
digits: /^\d+$/,
|
495
|
+
|
496
|
+
alphanum: /^\w+$/i,
|
497
|
+
|
498
|
+
date: {
|
499
|
+
test: function test(value) {
|
500
|
+
return Utils.parse.date(value) !== null;
|
501
|
+
}
|
502
|
+
},
|
503
|
+
|
504
|
+
url: new RegExp("^" +
|
505
|
+
// protocol identifier
|
506
|
+
"(?:(?:https?|ftp)://)?" + // ** mod: make scheme optional
|
507
|
+
// user:pass authentication
|
508
|
+
"(?:\\S+(?::\\S*)?@)?" + "(?:" +
|
509
|
+
// IP address exclusion
|
510
|
+
// private & local networks
|
511
|
+
// "(?!(?:10|127)(?:\\.\\d{1,3}){3})" + // ** mod: allow local networks
|
512
|
+
// "(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})" + // ** mod: allow local networks
|
513
|
+
// "(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})" + // ** mod: allow local networks
|
514
|
+
// IP address dotted notation octets
|
515
|
+
// excludes loopback network 0.0.0.0
|
516
|
+
// excludes reserved space >= 224.0.0.0
|
517
|
+
// excludes network & broacast addresses
|
518
|
+
// (first & last IP address of each class)
|
519
|
+
"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])" + "(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}" + "(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))" + "|" +
|
520
|
+
// host name
|
521
|
+
'(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)' +
|
522
|
+
// domain name
|
523
|
+
'(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*' +
|
524
|
+
// TLD identifier
|
525
|
+
'(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))' + ")" +
|
526
|
+
// port number
|
527
|
+
"(?::\\d{2,5})?" +
|
528
|
+
// resource path
|
529
|
+
"(?:/\\S*)?" + "$", 'i')
|
530
|
+
};
|
531
|
+
typeTesters.range = typeTesters.number;
|
532
|
+
|
533
|
+
// See http://stackoverflow.com/a/10454560/8279
|
534
|
+
var decimalPlaces = function decimalPlaces(num) {
|
535
|
+
var match = ('' + num).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);
|
536
|
+
if (!match) {
|
537
|
+
return 0;
|
538
|
+
}
|
539
|
+
return Math.max(0,
|
540
|
+
// Number of digits right of decimal point.
|
541
|
+
(match[1] ? match[1].length : 0) - (
|
542
|
+
// Adjust for scientific notation.
|
543
|
+
match[2] ? +match[2] : 0));
|
544
|
+
};
|
545
|
+
|
546
|
+
// parseArguments('number', ['1', '2']) => [1, 2]
|
547
|
+
var ValidatorRegistry__parseArguments = function ValidatorRegistry__parseArguments(type, args) {
|
548
|
+
return args.map(Utils.parse[type]);
|
549
|
+
};
|
550
|
+
// operatorToValidator returns a validating function for an operator function, applied to the given type
|
551
|
+
var ValidatorRegistry__operatorToValidator = function ValidatorRegistry__operatorToValidator(type, operator) {
|
552
|
+
return function (value) {
|
553
|
+
for (var _len = arguments.length, requirementsAndInput = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
554
|
+
requirementsAndInput[_key - 1] = arguments[_key];
|
555
|
+
}
|
556
|
+
|
557
|
+
requirementsAndInput.pop(); // Get rid of `input` argument
|
558
|
+
return operator.apply(undefined, [value].concat(_toConsumableArray(ValidatorRegistry__parseArguments(type, requirementsAndInput))));
|
559
|
+
};
|
560
|
+
};
|
561
|
+
|
562
|
+
var ValidatorRegistry__comparisonOperator = function ValidatorRegistry__comparisonOperator(operator) {
|
563
|
+
return {
|
564
|
+
validateDate: ValidatorRegistry__operatorToValidator('date', operator),
|
565
|
+
validateNumber: ValidatorRegistry__operatorToValidator('number', operator),
|
566
|
+
requirementType: operator.length <= 2 ? 'string' : ['string', 'string'], // Support operators with a 1 or 2 requirement(s)
|
567
|
+
priority: 30
|
568
|
+
};
|
569
|
+
};
|
570
|
+
|
571
|
+
ValidatorRegistry.prototype = {
|
572
|
+
init: function init(validators, catalog) {
|
573
|
+
this.catalog = catalog;
|
574
|
+
// Copy prototype's validators:
|
575
|
+
this.validators = _extends({}, this.validators);
|
576
|
+
|
577
|
+
for (var name in validators) this.addValidator(name, validators[name].fn, validators[name].priority);
|
578
|
+
|
579
|
+
window.Parsley.trigger('parsley:validator:init');
|
580
|
+
},
|
581
|
+
|
582
|
+
// Set new messages locale if we have dictionary loaded in ParsleyConfig.i18n
|
583
|
+
setLocale: function setLocale(locale) {
|
584
|
+
if ('undefined' === typeof this.catalog[locale]) throw new Error(locale + ' is not available in the catalog');
|
585
|
+
|
586
|
+
this.locale = locale;
|
587
|
+
|
588
|
+
return this;
|
589
|
+
},
|
590
|
+
|
591
|
+
// Add a new messages catalog for a given locale. Set locale for this catalog if set === `true`
|
592
|
+
addCatalog: function addCatalog(locale, messages, set) {
|
593
|
+
if ('object' === typeof messages) this.catalog[locale] = messages;
|
594
|
+
|
595
|
+
if (true === set) return this.setLocale(locale);
|
596
|
+
|
597
|
+
return this;
|
598
|
+
},
|
599
|
+
|
600
|
+
// Add a specific message for a given constraint in a given locale
|
601
|
+
addMessage: function addMessage(locale, name, message) {
|
602
|
+
if ('undefined' === typeof this.catalog[locale]) this.catalog[locale] = {};
|
603
|
+
|
604
|
+
this.catalog[locale][name] = message;
|
605
|
+
|
606
|
+
return this;
|
607
|
+
},
|
608
|
+
|
609
|
+
// Add messages for a given locale
|
610
|
+
addMessages: function addMessages(locale, nameMessageObject) {
|
611
|
+
for (var name in nameMessageObject) this.addMessage(locale, name, nameMessageObject[name]);
|
612
|
+
|
613
|
+
return this;
|
614
|
+
},
|
615
|
+
|
616
|
+
// Add a new validator
|
617
|
+
//
|
618
|
+
// addValidator('custom', {
|
619
|
+
// requirementType: ['integer', 'integer'],
|
620
|
+
// validateString: function(value, from, to) {},
|
621
|
+
// priority: 22,
|
622
|
+
// messages: {
|
623
|
+
// en: "Hey, that's no good",
|
624
|
+
// fr: "Aye aye, pas bon du tout",
|
625
|
+
// }
|
626
|
+
// })
|
627
|
+
//
|
628
|
+
// Old API was addValidator(name, function, priority)
|
629
|
+
//
|
630
|
+
addValidator: function addValidator(name, arg1, arg2) {
|
631
|
+
if (this.validators[name]) Utils.warn('Validator "' + name + '" is already defined.');else if (Defaults.hasOwnProperty(name)) {
|
632
|
+
Utils.warn('"' + name + '" is a restricted keyword and is not a valid validator name.');
|
633
|
+
return;
|
634
|
+
}
|
635
|
+
return this._setValidator.apply(this, arguments);
|
636
|
+
},
|
637
|
+
|
638
|
+
updateValidator: function updateValidator(name, arg1, arg2) {
|
639
|
+
if (!this.validators[name]) {
|
640
|
+
Utils.warn('Validator "' + name + '" is not already defined.');
|
641
|
+
return this.addValidator.apply(this, arguments);
|
642
|
+
}
|
643
|
+
return this._setValidator.apply(this, arguments);
|
644
|
+
},
|
645
|
+
|
646
|
+
removeValidator: function removeValidator(name) {
|
647
|
+
if (!this.validators[name]) Utils.warn('Validator "' + name + '" is not defined.');
|
648
|
+
|
649
|
+
delete this.validators[name];
|
650
|
+
|
651
|
+
return this;
|
652
|
+
},
|
653
|
+
|
654
|
+
_setValidator: function _setValidator(name, validator, priority) {
|
655
|
+
if ('object' !== typeof validator) {
|
656
|
+
// Old style validator, with `fn` and `priority`
|
657
|
+
validator = {
|
658
|
+
fn: validator,
|
659
|
+
priority: priority
|
660
|
+
};
|
661
|
+
}
|
662
|
+
if (!validator.validate) {
|
663
|
+
validator = new Validator(validator);
|
664
|
+
}
|
665
|
+
this.validators[name] = validator;
|
666
|
+
|
667
|
+
for (var locale in validator.messages || {}) this.addMessage(locale, name, validator.messages[locale]);
|
668
|
+
|
669
|
+
return this;
|
670
|
+
},
|
671
|
+
|
672
|
+
getErrorMessage: function getErrorMessage(constraint) {
|
673
|
+
var message;
|
674
|
+
|
675
|
+
// Type constraints are a bit different, we have to match their requirements too to find right error message
|
676
|
+
if ('type' === constraint.name) {
|
677
|
+
var typeMessages = this.catalog[this.locale][constraint.name] || {};
|
678
|
+
message = typeMessages[constraint.requirements];
|
679
|
+
} else message = this.formatMessage(this.catalog[this.locale][constraint.name], constraint.requirements);
|
680
|
+
|
681
|
+
return message || this.catalog[this.locale].defaultMessage || this.catalog.en.defaultMessage;
|
682
|
+
},
|
683
|
+
|
684
|
+
// Kind of light `sprintf()` implementation
|
685
|
+
formatMessage: function formatMessage(string, parameters) {
|
686
|
+
if ('object' === typeof parameters) {
|
687
|
+
for (var i in parameters) string = this.formatMessage(string, parameters[i]);
|
688
|
+
|
689
|
+
return string;
|
690
|
+
}
|
691
|
+
|
692
|
+
return 'string' === typeof string ? string.replace(/%s/i, parameters) : '';
|
693
|
+
},
|
694
|
+
|
695
|
+
// Here is the Parsley default validators list.
|
696
|
+
// A validator is an object with the following key values:
|
697
|
+
// - priority: an integer
|
698
|
+
// - requirement: 'string' (default), 'integer', 'number', 'regexp' or an Array of these
|
699
|
+
// - validateString, validateMultiple, validateNumber: functions returning `true`, `false` or a promise
|
700
|
+
// Alternatively, a validator can be a function that returns such an object
|
701
|
+
//
|
702
|
+
validators: {
|
703
|
+
notblank: {
|
704
|
+
validateString: function validateString(value) {
|
705
|
+
return (/\S/.test(value)
|
706
|
+
);
|
707
|
+
},
|
708
|
+
priority: 2
|
709
|
+
},
|
710
|
+
required: {
|
711
|
+
validateMultiple: function validateMultiple(values) {
|
712
|
+
return values.length > 0;
|
713
|
+
},
|
714
|
+
validateString: function validateString(value) {
|
715
|
+
return (/\S/.test(value)
|
716
|
+
);
|
717
|
+
},
|
718
|
+
priority: 512
|
719
|
+
},
|
720
|
+
type: {
|
721
|
+
validateString: function validateString(value, type) {
|
722
|
+
var _ref = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
|
723
|
+
|
724
|
+
var _ref$step = _ref.step;
|
725
|
+
var step = _ref$step === undefined ? 'any' : _ref$step;
|
726
|
+
var _ref$base = _ref.base;
|
727
|
+
var base = _ref$base === undefined ? 0 : _ref$base;
|
728
|
+
|
729
|
+
var tester = typeTesters[type];
|
730
|
+
if (!tester) {
|
731
|
+
throw new Error('validator type `' + type + '` is not supported');
|
732
|
+
}
|
733
|
+
if (!tester.test(value)) return false;
|
734
|
+
if ('number' === type) {
|
735
|
+
if (!/^any$/i.test(step || '')) {
|
736
|
+
var nb = Number(value);
|
737
|
+
var decimals = Math.max(decimalPlaces(step), decimalPlaces(base));
|
738
|
+
if (decimalPlaces(nb) > decimals) // Value can't have too many decimals
|
739
|
+
return false;
|
740
|
+
// Be careful of rounding errors by using integers.
|
741
|
+
var toInt = function toInt(f) {
|
742
|
+
return Math.round(f * Math.pow(10, decimals));
|
743
|
+
};
|
744
|
+
if ((toInt(nb) - toInt(base)) % toInt(step) != 0) return false;
|
745
|
+
}
|
746
|
+
}
|
747
|
+
return true;
|
748
|
+
},
|
749
|
+
requirementType: {
|
750
|
+
'': 'string',
|
751
|
+
step: 'string',
|
752
|
+
base: 'number'
|
753
|
+
},
|
754
|
+
priority: 256
|
755
|
+
},
|
756
|
+
pattern: {
|
757
|
+
validateString: function validateString(value, regexp) {
|
758
|
+
return regexp.test(value);
|
759
|
+
},
|
760
|
+
requirementType: 'regexp',
|
761
|
+
priority: 64
|
762
|
+
},
|
763
|
+
minlength: {
|
764
|
+
validateString: function validateString(value, requirement) {
|
765
|
+
return value.length >= requirement;
|
766
|
+
},
|
767
|
+
requirementType: 'integer',
|
768
|
+
priority: 30
|
769
|
+
},
|
770
|
+
maxlength: {
|
771
|
+
validateString: function validateString(value, requirement) {
|
772
|
+
return value.length <= requirement;
|
773
|
+
},
|
774
|
+
requirementType: 'integer',
|
775
|
+
priority: 30
|
776
|
+
},
|
777
|
+
length: {
|
778
|
+
validateString: function validateString(value, min, max) {
|
779
|
+
return value.length >= min && value.length <= max;
|
780
|
+
},
|
781
|
+
requirementType: ['integer', 'integer'],
|
782
|
+
priority: 30
|
783
|
+
},
|
784
|
+
mincheck: {
|
785
|
+
validateMultiple: function validateMultiple(values, requirement) {
|
786
|
+
return values.length >= requirement;
|
787
|
+
},
|
788
|
+
requirementType: 'integer',
|
789
|
+
priority: 30
|
790
|
+
},
|
791
|
+
maxcheck: {
|
792
|
+
validateMultiple: function validateMultiple(values, requirement) {
|
793
|
+
return values.length <= requirement;
|
794
|
+
},
|
795
|
+
requirementType: 'integer',
|
796
|
+
priority: 30
|
797
|
+
},
|
798
|
+
check: {
|
799
|
+
validateMultiple: function validateMultiple(values, min, max) {
|
800
|
+
return values.length >= min && values.length <= max;
|
801
|
+
},
|
802
|
+
requirementType: ['integer', 'integer'],
|
803
|
+
priority: 30
|
804
|
+
},
|
805
|
+
min: ValidatorRegistry__comparisonOperator(function (value, requirement) {
|
806
|
+
return value >= requirement;
|
807
|
+
}),
|
808
|
+
max: ValidatorRegistry__comparisonOperator(function (value, requirement) {
|
809
|
+
return value <= requirement;
|
810
|
+
}),
|
811
|
+
range: ValidatorRegistry__comparisonOperator(function (value, min, max) {
|
812
|
+
return value >= min && value <= max;
|
813
|
+
}),
|
814
|
+
equalto: {
|
815
|
+
validateString: function validateString(value, refOrValue) {
|
816
|
+
var $reference = $(refOrValue);
|
817
|
+
if ($reference.length) return value === $reference.val();else return value === refOrValue;
|
818
|
+
},
|
819
|
+
priority: 256
|
820
|
+
}
|
821
|
+
}
|
822
|
+
};
|
823
|
+
|
824
|
+
var UI = {};
|
825
|
+
|
826
|
+
var diffResults = function diffResults(newResult, oldResult, deep) {
|
827
|
+
var added = [];
|
828
|
+
var kept = [];
|
829
|
+
|
830
|
+
for (var i = 0; i < newResult.length; i++) {
|
831
|
+
var found = false;
|
832
|
+
|
833
|
+
for (var j = 0; j < oldResult.length; j++) if (newResult[i].assert.name === oldResult[j].assert.name) {
|
834
|
+
found = true;
|
835
|
+
break;
|
836
|
+
}
|
837
|
+
|
838
|
+
if (found) kept.push(newResult[i]);else added.push(newResult[i]);
|
839
|
+
}
|
840
|
+
|
841
|
+
return {
|
842
|
+
kept: kept,
|
843
|
+
added: added,
|
844
|
+
removed: !deep ? diffResults(oldResult, newResult, true).added : []
|
845
|
+
};
|
846
|
+
};
|
847
|
+
|
848
|
+
UI.Form = {
|
849
|
+
|
850
|
+
_actualizeTriggers: function _actualizeTriggers() {
|
851
|
+
var _this2 = this;
|
852
|
+
|
853
|
+
this.$element.on('submit.Parsley', function (evt) {
|
854
|
+
_this2.onSubmitValidate(evt);
|
855
|
+
});
|
856
|
+
this.$element.on('click.Parsley', Utils._SubmitSelector, function (evt) {
|
857
|
+
_this2.onSubmitButton(evt);
|
858
|
+
});
|
859
|
+
|
860
|
+
// UI could be disabled
|
861
|
+
if (false === this.options.uiEnabled) return;
|
862
|
+
|
863
|
+
this.element.setAttribute('novalidate', '');
|
864
|
+
},
|
865
|
+
|
866
|
+
focus: function focus() {
|
867
|
+
this._focusedField = null;
|
868
|
+
|
869
|
+
if (true === this.validationResult || 'none' === this.options.focus) return null;
|
870
|
+
|
871
|
+
for (var i = 0; i < this.fields.length; i++) {
|
872
|
+
var field = this.fields[i];
|
873
|
+
if (true !== field.validationResult && field.validationResult.length > 0 && 'undefined' === typeof field.options.noFocus) {
|
874
|
+
this._focusedField = field.$element;
|
875
|
+
if ('first' === this.options.focus) break;
|
876
|
+
}
|
877
|
+
}
|
878
|
+
|
879
|
+
if (null === this._focusedField) return null;
|
880
|
+
|
881
|
+
return this._focusedField.focus();
|
882
|
+
},
|
883
|
+
|
884
|
+
_destroyUI: function _destroyUI() {
|
885
|
+
// Reset all event listeners
|
886
|
+
this.$element.off('.Parsley');
|
887
|
+
}
|
888
|
+
|
889
|
+
};
|
890
|
+
|
891
|
+
UI.Field = {
|
892
|
+
|
893
|
+
_reflowUI: function _reflowUI() {
|
894
|
+
this._buildUI();
|
895
|
+
|
896
|
+
// If this field doesn't have an active UI don't bother doing something
|
897
|
+
if (!this._ui) return;
|
898
|
+
|
899
|
+
// Diff between two validation results
|
900
|
+
var diff = diffResults(this.validationResult, this._ui.lastValidationResult);
|
901
|
+
|
902
|
+
// Then store current validation result for next reflow
|
903
|
+
this._ui.lastValidationResult = this.validationResult;
|
904
|
+
|
905
|
+
// Handle valid / invalid / none field class
|
906
|
+
this._manageStatusClass();
|
907
|
+
|
908
|
+
// Add, remove, updated errors messages
|
909
|
+
this._manageErrorsMessages(diff);
|
910
|
+
|
911
|
+
// Triggers impl
|
912
|
+
this._actualizeTriggers();
|
913
|
+
|
914
|
+
// If field is not valid for the first time, bind keyup trigger to ease UX and quickly inform user
|
915
|
+
if ((diff.kept.length || diff.added.length) && !this._failedOnce) {
|
916
|
+
this._failedOnce = true;
|
917
|
+
this._actualizeTriggers();
|
918
|
+
}
|
919
|
+
},
|
920
|
+
|
921
|
+
// Returns an array of field's error message(s)
|
922
|
+
getErrorsMessages: function getErrorsMessages() {
|
923
|
+
// No error message, field is valid
|
924
|
+
if (true === this.validationResult) return [];
|
925
|
+
|
926
|
+
var messages = [];
|
927
|
+
|
928
|
+
for (var i = 0; i < this.validationResult.length; i++) messages.push(this.validationResult[i].errorMessage || this._getErrorMessage(this.validationResult[i].assert));
|
929
|
+
|
930
|
+
return messages;
|
931
|
+
},
|
932
|
+
|
933
|
+
// It's a goal of Parsley that this method is no longer required [#1073]
|
934
|
+
addError: function addError(name) {
|
935
|
+
var _ref2 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
936
|
+
|
937
|
+
var message = _ref2.message;
|
938
|
+
var assert = _ref2.assert;
|
939
|
+
var _ref2$updateClass = _ref2.updateClass;
|
940
|
+
var updateClass = _ref2$updateClass === undefined ? true : _ref2$updateClass;
|
941
|
+
|
942
|
+
this._buildUI();
|
943
|
+
this._addError(name, { message: message, assert: assert });
|
944
|
+
|
945
|
+
if (updateClass) this._errorClass();
|
946
|
+
},
|
947
|
+
|
948
|
+
// It's a goal of Parsley that this method is no longer required [#1073]
|
949
|
+
updateError: function updateError(name) {
|
950
|
+
var _ref3 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
951
|
+
|
952
|
+
var message = _ref3.message;
|
953
|
+
var assert = _ref3.assert;
|
954
|
+
var _ref3$updateClass = _ref3.updateClass;
|
955
|
+
var updateClass = _ref3$updateClass === undefined ? true : _ref3$updateClass;
|
956
|
+
|
957
|
+
this._buildUI();
|
958
|
+
this._updateError(name, { message: message, assert: assert });
|
959
|
+
|
960
|
+
if (updateClass) this._errorClass();
|
961
|
+
},
|
962
|
+
|
963
|
+
// It's a goal of Parsley that this method is no longer required [#1073]
|
964
|
+
removeError: function removeError(name) {
|
965
|
+
var _ref4 = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
966
|
+
|
967
|
+
var _ref4$updateClass = _ref4.updateClass;
|
968
|
+
var updateClass = _ref4$updateClass === undefined ? true : _ref4$updateClass;
|
969
|
+
|
970
|
+
this._buildUI();
|
971
|
+
this._removeError(name);
|
972
|
+
|
973
|
+
// edge case possible here: remove a standard Parsley error that is still failing in this.validationResult
|
974
|
+
// but highly improbable cuz' manually removing a well Parsley handled error makes no sense.
|
975
|
+
if (updateClass) this._manageStatusClass();
|
976
|
+
},
|
977
|
+
|
978
|
+
_manageStatusClass: function _manageStatusClass() {
|
979
|
+
if (this.hasConstraints() && this.needsValidation() && true === this.validationResult) this._successClass();else if (this.validationResult.length > 0) this._errorClass();else this._resetClass();
|
980
|
+
},
|
981
|
+
|
982
|
+
_manageErrorsMessages: function _manageErrorsMessages(diff) {
|
983
|
+
if ('undefined' !== typeof this.options.errorsMessagesDisabled) return;
|
984
|
+
|
985
|
+
// Case where we have errorMessage option that configure an unique field error message, regardless failing validators
|
986
|
+
if ('undefined' !== typeof this.options.errorMessage) {
|
987
|
+
if (diff.added.length || diff.kept.length) {
|
988
|
+
this._insertErrorWrapper();
|
989
|
+
|
990
|
+
if (0 === this._ui.$errorsWrapper.find('.parsley-custom-error-message').length) this._ui.$errorsWrapper.append($(this.options.errorTemplate).addClass('parsley-custom-error-message'));
|
991
|
+
|
992
|
+
return this._ui.$errorsWrapper.addClass('filled').find('.parsley-custom-error-message').html(this.options.errorMessage);
|
993
|
+
}
|
994
|
+
|
995
|
+
return this._ui.$errorsWrapper.removeClass('filled').find('.parsley-custom-error-message').remove();
|
996
|
+
}
|
997
|
+
|
998
|
+
// Show, hide, update failing constraints messages
|
999
|
+
for (var i = 0; i < diff.removed.length; i++) this._removeError(diff.removed[i].assert.name);
|
1000
|
+
|
1001
|
+
for (i = 0; i < diff.added.length; i++) this._addError(diff.added[i].assert.name, { message: diff.added[i].errorMessage, assert: diff.added[i].assert });
|
1002
|
+
|
1003
|
+
for (i = 0; i < diff.kept.length; i++) this._updateError(diff.kept[i].assert.name, { message: diff.kept[i].errorMessage, assert: diff.kept[i].assert });
|
1004
|
+
},
|
1005
|
+
|
1006
|
+
_addError: function _addError(name, _ref5) {
|
1007
|
+
var message = _ref5.message;
|
1008
|
+
var assert = _ref5.assert;
|
1009
|
+
|
1010
|
+
this._insertErrorWrapper();
|
1011
|
+
this._ui.$errorsWrapper.addClass('filled').append($(this.options.errorTemplate).addClass('parsley-' + name).html(message || this._getErrorMessage(assert)));
|
1012
|
+
},
|
1013
|
+
|
1014
|
+
_updateError: function _updateError(name, _ref6) {
|
1015
|
+
var message = _ref6.message;
|
1016
|
+
var assert = _ref6.assert;
|
1017
|
+
|
1018
|
+
this._ui.$errorsWrapper.addClass('filled').find('.parsley-' + name).html(message || this._getErrorMessage(assert));
|
1019
|
+
},
|
1020
|
+
|
1021
|
+
_removeError: function _removeError(name) {
|
1022
|
+
this._ui.$errorsWrapper.removeClass('filled').find('.parsley-' + name).remove();
|
1023
|
+
},
|
1024
|
+
|
1025
|
+
_getErrorMessage: function _getErrorMessage(constraint) {
|
1026
|
+
var customConstraintErrorMessage = constraint.name + 'Message';
|
1027
|
+
|
1028
|
+
if ('undefined' !== typeof this.options[customConstraintErrorMessage]) return window.Parsley.formatMessage(this.options[customConstraintErrorMessage], constraint.requirements);
|
1029
|
+
|
1030
|
+
return window.Parsley.getErrorMessage(constraint);
|
1031
|
+
},
|
1032
|
+
|
1033
|
+
_buildUI: function _buildUI() {
|
1034
|
+
// UI could be already built or disabled
|
1035
|
+
if (this._ui || false === this.options.uiEnabled) return;
|
1036
|
+
|
1037
|
+
var _ui = {};
|
1038
|
+
|
1039
|
+
// Give field its Parsley id in DOM
|
1040
|
+
this.element.setAttribute(this.options.namespace + 'id', this.__id__);
|
1041
|
+
|
1042
|
+
/** Generate important UI elements and store them in this **/
|
1043
|
+
// $errorClassHandler is the $element that woul have parsley-error and parsley-success classes
|
1044
|
+
_ui.$errorClassHandler = this._manageClassHandler();
|
1045
|
+
|
1046
|
+
// $errorsWrapper is a div that would contain the various field errors, it will be appended into $errorsContainer
|
1047
|
+
_ui.errorsWrapperId = 'parsley-id-' + (this.options.multiple ? 'multiple-' + this.options.multiple : this.__id__);
|
1048
|
+
_ui.$errorsWrapper = $(this.options.errorsWrapper).attr('id', _ui.errorsWrapperId);
|
1049
|
+
|
1050
|
+
// ValidationResult UI storage to detect what have changed bwt two validations, and update DOM accordingly
|
1051
|
+
_ui.lastValidationResult = [];
|
1052
|
+
_ui.validationInformationVisible = false;
|
1053
|
+
|
1054
|
+
// Store it in this for later
|
1055
|
+
this._ui = _ui;
|
1056
|
+
},
|
1057
|
+
|
1058
|
+
// Determine which element will have `parsley-error` and `parsley-success` classes
|
1059
|
+
_manageClassHandler: function _manageClassHandler() {
|
1060
|
+
// An element selector could be passed through DOM with `data-parsley-class-handler=#foo`
|
1061
|
+
if ('string' === typeof this.options.classHandler) {
|
1062
|
+
if ($(this.options.classHandler).length === 0) ParsleyUtils.warn('No elements found that match the selector `' + this.options.classHandler + '` set in options.classHandler or data-parsley-class-handler');
|
1063
|
+
|
1064
|
+
//return element or empty set
|
1065
|
+
return $(this.options.classHandler);
|
1066
|
+
}
|
1067
|
+
|
1068
|
+
// Class handled could also be determined by function given in Parsley options
|
1069
|
+
if ('function' === typeof this.options.classHandler) var $handler = this.options.classHandler.call(this, this);
|
1070
|
+
|
1071
|
+
// If this function returned a valid existing DOM element, go for it
|
1072
|
+
if ('undefined' !== typeof $handler && $handler.length) return $handler;
|
1073
|
+
|
1074
|
+
return this._inputHolder();
|
1075
|
+
},
|
1076
|
+
|
1077
|
+
_inputHolder: function _inputHolder() {
|
1078
|
+
// if simple element (input, texatrea, select...) it will perfectly host the classes and precede the error container
|
1079
|
+
if (!this.options.multiple || this.element.nodeName === 'SELECT') return this.$element;
|
1080
|
+
|
1081
|
+
// But if multiple element (radio, checkbox), that would be their parent
|
1082
|
+
return this.$element.parent();
|
1083
|
+
},
|
1084
|
+
|
1085
|
+
_insertErrorWrapper: function _insertErrorWrapper() {
|
1086
|
+
var $errorsContainer;
|
1087
|
+
|
1088
|
+
// Nothing to do if already inserted
|
1089
|
+
if (0 !== this._ui.$errorsWrapper.parent().length) return this._ui.$errorsWrapper.parent();
|
1090
|
+
|
1091
|
+
if ('string' === typeof this.options.errorsContainer) {
|
1092
|
+
if ($(this.options.errorsContainer).length) return $(this.options.errorsContainer).append(this._ui.$errorsWrapper);else Utils.warn('The errors container `' + this.options.errorsContainer + '` does not exist in DOM');
|
1093
|
+
} else if ('function' === typeof this.options.errorsContainer) $errorsContainer = this.options.errorsContainer.call(this, this);
|
1094
|
+
|
1095
|
+
if ('undefined' !== typeof $errorsContainer && $errorsContainer.length) return $errorsContainer.append(this._ui.$errorsWrapper);
|
1096
|
+
|
1097
|
+
return this._inputHolder().after(this._ui.$errorsWrapper);
|
1098
|
+
},
|
1099
|
+
|
1100
|
+
_actualizeTriggers: function _actualizeTriggers() {
|
1101
|
+
var _this3 = this;
|
1102
|
+
|
1103
|
+
var $toBind = this._findRelated();
|
1104
|
+
var trigger;
|
1105
|
+
|
1106
|
+
// Remove Parsley events already bound on this field
|
1107
|
+
$toBind.off('.Parsley');
|
1108
|
+
if (this._failedOnce) $toBind.on(Utils.namespaceEvents(this.options.triggerAfterFailure, 'Parsley'), function () {
|
1109
|
+
_this3._validateIfNeeded();
|
1110
|
+
});else if (trigger = Utils.namespaceEvents(this.options.trigger, 'Parsley')) {
|
1111
|
+
$toBind.on(trigger, function (event) {
|
1112
|
+
_this3._validateIfNeeded(event);
|
1113
|
+
});
|
1114
|
+
}
|
1115
|
+
},
|
1116
|
+
|
1117
|
+
_validateIfNeeded: function _validateIfNeeded(event) {
|
1118
|
+
var _this4 = this;
|
1119
|
+
|
1120
|
+
// For keyup, keypress, keydown, input... events that could be a little bit obstrusive
|
1121
|
+
// do not validate if val length < min threshold on first validation. Once field have been validated once and info
|
1122
|
+
// about success or failure have been displayed, always validate with this trigger to reflect every yalidation change.
|
1123
|
+
if (event && /key|input/.test(event.type)) if (!(this._ui && this._ui.validationInformationVisible) && this.getValue().length <= this.options.validationThreshold) return;
|
1124
|
+
|
1125
|
+
if (this.options.debounce) {
|
1126
|
+
window.clearTimeout(this._debounced);
|
1127
|
+
this._debounced = window.setTimeout(function () {
|
1128
|
+
return _this4.validate();
|
1129
|
+
}, this.options.debounce);
|
1130
|
+
} else this.validate();
|
1131
|
+
},
|
1132
|
+
|
1133
|
+
_resetUI: function _resetUI() {
|
1134
|
+
// Reset all event listeners
|
1135
|
+
this._failedOnce = false;
|
1136
|
+
this._actualizeTriggers();
|
1137
|
+
|
1138
|
+
// Nothing to do if UI never initialized for this field
|
1139
|
+
if ('undefined' === typeof this._ui) return;
|
1140
|
+
|
1141
|
+
// Reset all errors' li
|
1142
|
+
this._ui.$errorsWrapper.removeClass('filled').children().remove();
|
1143
|
+
|
1144
|
+
// Reset validation class
|
1145
|
+
this._resetClass();
|
1146
|
+
|
1147
|
+
// Reset validation flags and last validation result
|
1148
|
+
this._ui.lastValidationResult = [];
|
1149
|
+
this._ui.validationInformationVisible = false;
|
1150
|
+
},
|
1151
|
+
|
1152
|
+
_destroyUI: function _destroyUI() {
|
1153
|
+
this._resetUI();
|
1154
|
+
|
1155
|
+
if ('undefined' !== typeof this._ui) this._ui.$errorsWrapper.remove();
|
1156
|
+
|
1157
|
+
delete this._ui;
|
1158
|
+
},
|
1159
|
+
|
1160
|
+
_successClass: function _successClass() {
|
1161
|
+
this._ui.validationInformationVisible = true;
|
1162
|
+
this._ui.$errorClassHandler.removeClass(this.options.errorClass).addClass(this.options.successClass);
|
1163
|
+
},
|
1164
|
+
_errorClass: function _errorClass() {
|
1165
|
+
this._ui.validationInformationVisible = true;
|
1166
|
+
this._ui.$errorClassHandler.removeClass(this.options.successClass).addClass(this.options.errorClass);
|
1167
|
+
},
|
1168
|
+
_resetClass: function _resetClass() {
|
1169
|
+
this._ui.$errorClassHandler.removeClass(this.options.successClass).removeClass(this.options.errorClass);
|
1170
|
+
}
|
1171
|
+
};
|
1172
|
+
|
1173
|
+
var Form = function Form(element, domOptions, options) {
|
1174
|
+
this.__class__ = 'Form';
|
1175
|
+
|
1176
|
+
this.element = element;
|
1177
|
+
this.$element = $(element);
|
1178
|
+
this.domOptions = domOptions;
|
1179
|
+
this.options = options;
|
1180
|
+
this.parent = window.Parsley;
|
1181
|
+
|
1182
|
+
this.fields = [];
|
1183
|
+
this.validationResult = null;
|
1184
|
+
};
|
1185
|
+
|
1186
|
+
var Form__statusMapping = { pending: null, resolved: true, rejected: false };
|
1187
|
+
|
1188
|
+
Form.prototype = {
|
1189
|
+
onSubmitValidate: function onSubmitValidate(event) {
|
1190
|
+
var _this5 = this;
|
1191
|
+
|
1192
|
+
// This is a Parsley generated submit event, do not validate, do not prevent, simply exit and keep normal behavior
|
1193
|
+
if (true === event.parsley) return;
|
1194
|
+
|
1195
|
+
// If we didn't come here through a submit button, use the first one in the form
|
1196
|
+
var submitSource = this._submitSource || this.$element.find(Utils._SubmitSelector)[0];
|
1197
|
+
this._submitSource = null;
|
1198
|
+
this.$element.find('.parsley-synthetic-submit-button').prop('disabled', true);
|
1199
|
+
if (submitSource && null !== submitSource.getAttribute('formnovalidate')) return;
|
1200
|
+
|
1201
|
+
window.Parsley._remoteCache = {};
|
1202
|
+
|
1203
|
+
var promise = this.whenValidate({ event: event });
|
1204
|
+
|
1205
|
+
if ('resolved' === promise.state() && false !== this._trigger('submit')) {
|
1206
|
+
// All good, let event go through. We make this distinction because browsers
|
1207
|
+
// differ in their handling of `submit` being called from inside a submit event [#1047]
|
1208
|
+
} else {
|
1209
|
+
// Rejected or pending: cancel this submit
|
1210
|
+
event.stopImmediatePropagation();
|
1211
|
+
event.preventDefault();
|
1212
|
+
if ('pending' === promise.state()) promise.done(function () {
|
1213
|
+
_this5._submit(submitSource);
|
1214
|
+
});
|
1215
|
+
}
|
1216
|
+
},
|
1217
|
+
|
1218
|
+
onSubmitButton: function onSubmitButton(event) {
|
1219
|
+
this._submitSource = event.currentTarget;
|
1220
|
+
},
|
1221
|
+
// internal
|
1222
|
+
// _submit submits the form, this time without going through the validations.
|
1223
|
+
// Care must be taken to "fake" the actual submit button being clicked.
|
1224
|
+
_submit: function _submit(submitSource) {
|
1225
|
+
if (false === this._trigger('submit')) return;
|
1226
|
+
// Add submit button's data
|
1227
|
+
if (submitSource) {
|
1228
|
+
var $synthetic = this.$element.find('.parsley-synthetic-submit-button').prop('disabled', false);
|
1229
|
+
if (0 === $synthetic.length) $synthetic = $('<input class="parsley-synthetic-submit-button" type="hidden">').appendTo(this.$element);
|
1230
|
+
$synthetic.attr({
|
1231
|
+
name: submitSource.getAttribute('name'),
|
1232
|
+
value: submitSource.getAttribute('value')
|
1233
|
+
});
|
1234
|
+
}
|
1235
|
+
|
1236
|
+
this.$element.trigger(_extends($.Event('submit'), { parsley: true }));
|
1237
|
+
},
|
1238
|
+
|
1239
|
+
// Performs validation on fields while triggering events.
|
1240
|
+
// @returns `true` if all validations succeeds, `false`
|
1241
|
+
// if a failure is immediately detected, or `null`
|
1242
|
+
// if dependant on a promise.
|
1243
|
+
// Consider using `whenValidate` instead.
|
1244
|
+
validate: function validate(options) {
|
1245
|
+
if (arguments.length >= 1 && !$.isPlainObject(options)) {
|
1246
|
+
Utils.warnOnce('Calling validate on a parsley form without passing arguments as an object is deprecated.');
|
1247
|
+
|
1248
|
+
var _arguments = _slice.call(arguments);
|
1249
|
+
|
1250
|
+
var group = _arguments[0];
|
1251
|
+
var force = _arguments[1];
|
1252
|
+
var event = _arguments[2];
|
1253
|
+
|
1254
|
+
options = { group: group, force: force, event: event };
|
1255
|
+
}
|
1256
|
+
return Form__statusMapping[this.whenValidate(options).state()];
|
1257
|
+
},
|
1258
|
+
|
1259
|
+
whenValidate: function whenValidate() {
|
1260
|
+
var _Utils$all$done$fail$always,
|
1261
|
+
_this6 = this;
|
1262
|
+
|
1263
|
+
var _ref7 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
1264
|
+
|
1265
|
+
var group = _ref7.group;
|
1266
|
+
var force = _ref7.force;
|
1267
|
+
var event = _ref7.event;
|
1268
|
+
|
1269
|
+
this.submitEvent = event;
|
1270
|
+
if (event) {
|
1271
|
+
this.submitEvent = _extends({}, event, { preventDefault: function preventDefault() {
|
1272
|
+
Utils.warnOnce("Using `this.submitEvent.preventDefault()` is deprecated; instead, call `this.validationResult = false`");
|
1273
|
+
_this6.validationResult = false;
|
1274
|
+
} });
|
1275
|
+
}
|
1276
|
+
this.validationResult = true;
|
1277
|
+
|
1278
|
+
// fire validate event to eventually modify things before every validation
|
1279
|
+
this._trigger('validate');
|
1280
|
+
|
1281
|
+
// Refresh form DOM options and form's fields that could have changed
|
1282
|
+
this._refreshFields();
|
1283
|
+
|
1284
|
+
var promises = this._withoutReactualizingFormOptions(function () {
|
1285
|
+
return $.map(_this6.fields, function (field) {
|
1286
|
+
return field.whenValidate({ force: force, group: group });
|
1287
|
+
});
|
1288
|
+
});
|
1289
|
+
|
1290
|
+
return (_Utils$all$done$fail$always = Utils.all(promises).done(function () {
|
1291
|
+
_this6._trigger('success');
|
1292
|
+
}).fail(function () {
|
1293
|
+
_this6.validationResult = false;
|
1294
|
+
_this6.focus();
|
1295
|
+
_this6._trigger('error');
|
1296
|
+
}).always(function () {
|
1297
|
+
_this6._trigger('validated');
|
1298
|
+
})).pipe.apply(_Utils$all$done$fail$always, _toConsumableArray(this._pipeAccordingToValidationResult()));
|
1299
|
+
},
|
1300
|
+
|
1301
|
+
// Iterate over refreshed fields, and stop on first failure.
|
1302
|
+
// Returns `true` if all fields are valid, `false` if a failure is detected
|
1303
|
+
// or `null` if the result depends on an unresolved promise.
|
1304
|
+
// Prefer using `whenValid` instead.
|
1305
|
+
isValid: function isValid(options) {
|
1306
|
+
if (arguments.length >= 1 && !$.isPlainObject(options)) {
|
1307
|
+
Utils.warnOnce('Calling isValid on a parsley form without passing arguments as an object is deprecated.');
|
1308
|
+
|
1309
|
+
var _arguments2 = _slice.call(arguments);
|
1310
|
+
|
1311
|
+
var group = _arguments2[0];
|
1312
|
+
var force = _arguments2[1];
|
1313
|
+
|
1314
|
+
options = { group: group, force: force };
|
1315
|
+
}
|
1316
|
+
return Form__statusMapping[this.whenValid(options).state()];
|
1317
|
+
},
|
1318
|
+
|
1319
|
+
// Iterate over refreshed fields and validate them.
|
1320
|
+
// Returns a promise.
|
1321
|
+
// A validation that immediately fails will interrupt the validations.
|
1322
|
+
whenValid: function whenValid() {
|
1323
|
+
var _this7 = this;
|
1324
|
+
|
1325
|
+
var _ref8 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
1326
|
+
|
1327
|
+
var group = _ref8.group;
|
1328
|
+
var force = _ref8.force;
|
1329
|
+
|
1330
|
+
this._refreshFields();
|
1331
|
+
|
1332
|
+
var promises = this._withoutReactualizingFormOptions(function () {
|
1333
|
+
return $.map(_this7.fields, function (field) {
|
1334
|
+
return field.whenValid({ group: group, force: force });
|
1335
|
+
});
|
1336
|
+
});
|
1337
|
+
return Utils.all(promises);
|
1338
|
+
},
|
1339
|
+
|
1340
|
+
// Reset UI
|
1341
|
+
reset: function reset() {
|
1342
|
+
// Form case: emit a reset event for each field
|
1343
|
+
for (var i = 0; i < this.fields.length; i++) this.fields[i].reset();
|
1344
|
+
|
1345
|
+
this._trigger('reset');
|
1346
|
+
},
|
1347
|
+
|
1348
|
+
// Destroy Parsley instance (+ UI)
|
1349
|
+
destroy: function destroy() {
|
1350
|
+
// Field case: emit destroy event to clean UI and then destroy stored instance
|
1351
|
+
this._destroyUI();
|
1352
|
+
|
1353
|
+
// Form case: destroy all its fields and then destroy stored instance
|
1354
|
+
for (var i = 0; i < this.fields.length; i++) this.fields[i].destroy();
|
1355
|
+
|
1356
|
+
this.$element.removeData('Parsley');
|
1357
|
+
this._trigger('destroy');
|
1358
|
+
},
|
1359
|
+
|
1360
|
+
_refreshFields: function _refreshFields() {
|
1361
|
+
return this.actualizeOptions()._bindFields();
|
1362
|
+
},
|
1363
|
+
|
1364
|
+
_bindFields: function _bindFields() {
|
1365
|
+
var _this8 = this;
|
1366
|
+
|
1367
|
+
var oldFields = this.fields;
|
1368
|
+
|
1369
|
+
this.fields = [];
|
1370
|
+
this.fieldsMappedById = {};
|
1371
|
+
|
1372
|
+
this._withoutReactualizingFormOptions(function () {
|
1373
|
+
_this8.$element.find(_this8.options.inputs).not(_this8.options.excluded).each(function (_, element) {
|
1374
|
+
var fieldInstance = new window.Parsley.Factory(element, {}, _this8);
|
1375
|
+
|
1376
|
+
// Only add valid and not excluded `Field` and `FieldMultiple` children
|
1377
|
+
if (('Field' === fieldInstance.__class__ || 'FieldMultiple' === fieldInstance.__class__) && true !== fieldInstance.options.excluded) {
|
1378
|
+
var uniqueId = fieldInstance.__class__ + '-' + fieldInstance.__id__;
|
1379
|
+
if ('undefined' === typeof _this8.fieldsMappedById[uniqueId]) {
|
1380
|
+
_this8.fieldsMappedById[uniqueId] = fieldInstance;
|
1381
|
+
_this8.fields.push(fieldInstance);
|
1382
|
+
}
|
1383
|
+
}
|
1384
|
+
});
|
1385
|
+
|
1386
|
+
$.each(Utils.difference(oldFields, _this8.fields), function (_, field) {
|
1387
|
+
field.reset();
|
1388
|
+
});
|
1389
|
+
});
|
1390
|
+
return this;
|
1391
|
+
},
|
1392
|
+
|
1393
|
+
// Internal only.
|
1394
|
+
// Looping on a form's fields to do validation or similar
|
1395
|
+
// will trigger reactualizing options on all of them, which
|
1396
|
+
// in turn will reactualize the form's options.
|
1397
|
+
// To avoid calling actualizeOptions so many times on the form
|
1398
|
+
// for nothing, _withoutReactualizingFormOptions temporarily disables
|
1399
|
+
// the method actualizeOptions on this form while `fn` is called.
|
1400
|
+
_withoutReactualizingFormOptions: function _withoutReactualizingFormOptions(fn) {
|
1401
|
+
var oldActualizeOptions = this.actualizeOptions;
|
1402
|
+
this.actualizeOptions = function () {
|
1403
|
+
return this;
|
1404
|
+
};
|
1405
|
+
var result = fn();
|
1406
|
+
this.actualizeOptions = oldActualizeOptions;
|
1407
|
+
return result;
|
1408
|
+
},
|
1409
|
+
|
1410
|
+
// Internal only.
|
1411
|
+
// Shortcut to trigger an event
|
1412
|
+
// Returns true iff event is not interrupted and default not prevented.
|
1413
|
+
_trigger: function _trigger(eventName) {
|
1414
|
+
return this.trigger('form:' + eventName);
|
1415
|
+
}
|
1416
|
+
|
1417
|
+
};
|
1418
|
+
|
1419
|
+
var Constraint = function Constraint(parsleyField, name, requirements, priority, isDomConstraint) {
|
1420
|
+
var validatorSpec = window.Parsley._validatorRegistry.validators[name];
|
1421
|
+
var validator = new Validator(validatorSpec);
|
1422
|
+
priority = priority || parsleyField.options[name + 'Priority'] || validator.priority;
|
1423
|
+
isDomConstraint = true === isDomConstraint;
|
1424
|
+
|
1425
|
+
_extends(this, {
|
1426
|
+
validator: validator,
|
1427
|
+
name: name,
|
1428
|
+
requirements: requirements,
|
1429
|
+
priority: priority,
|
1430
|
+
isDomConstraint: isDomConstraint
|
1431
|
+
});
|
1432
|
+
this._parseRequirements(parsleyField.options);
|
1433
|
+
};
|
1434
|
+
|
1435
|
+
var capitalize = function capitalize(str) {
|
1436
|
+
var cap = str[0].toUpperCase();
|
1437
|
+
return cap + str.slice(1);
|
1438
|
+
};
|
1439
|
+
|
1440
|
+
Constraint.prototype = {
|
1441
|
+
validate: function validate(value, instance) {
|
1442
|
+
var _validator;
|
1443
|
+
|
1444
|
+
return (_validator = this.validator).validate.apply(_validator, [value].concat(_toConsumableArray(this.requirementList), [instance]));
|
1445
|
+
},
|
1446
|
+
|
1447
|
+
_parseRequirements: function _parseRequirements(options) {
|
1448
|
+
var _this9 = this;
|
1449
|
+
|
1450
|
+
this.requirementList = this.validator.parseRequirements(this.requirements, function (key) {
|
1451
|
+
return options[_this9.name + capitalize(key)];
|
1452
|
+
});
|
1453
|
+
}
|
1454
|
+
};
|
1455
|
+
|
1456
|
+
var Field = function Field(field, domOptions, options, parsleyFormInstance) {
|
1457
|
+
this.__class__ = 'Field';
|
1458
|
+
|
1459
|
+
this.element = field;
|
1460
|
+
this.$element = $(field);
|
1461
|
+
|
1462
|
+
// Set parent if we have one
|
1463
|
+
if ('undefined' !== typeof parsleyFormInstance) {
|
1464
|
+
this.parent = parsleyFormInstance;
|
1465
|
+
}
|
1466
|
+
|
1467
|
+
this.options = options;
|
1468
|
+
this.domOptions = domOptions;
|
1469
|
+
|
1470
|
+
// Initialize some properties
|
1471
|
+
this.constraints = [];
|
1472
|
+
this.constraintsByName = {};
|
1473
|
+
this.validationResult = true;
|
1474
|
+
|
1475
|
+
// Bind constraints
|
1476
|
+
this._bindConstraints();
|
1477
|
+
};
|
1478
|
+
|
1479
|
+
var parsley_field__statusMapping = { pending: null, resolved: true, rejected: false };
|
1480
|
+
|
1481
|
+
Field.prototype = {
|
1482
|
+
// # Public API
|
1483
|
+
// Validate field and trigger some events for mainly `UI`
|
1484
|
+
// @returns `true`, an array of the validators that failed, or
|
1485
|
+
// `null` if validation is not finished. Prefer using whenValidate
|
1486
|
+
validate: function validate(options) {
|
1487
|
+
if (arguments.length >= 1 && !$.isPlainObject(options)) {
|
1488
|
+
Utils.warnOnce('Calling validate on a parsley field without passing arguments as an object is deprecated.');
|
1489
|
+
options = { options: options };
|
1490
|
+
}
|
1491
|
+
var promise = this.whenValidate(options);
|
1492
|
+
if (!promise) // If excluded with `group` option
|
1493
|
+
return true;
|
1494
|
+
switch (promise.state()) {
|
1495
|
+
case 'pending':
|
1496
|
+
return null;
|
1497
|
+
case 'resolved':
|
1498
|
+
return true;
|
1499
|
+
case 'rejected':
|
1500
|
+
return this.validationResult;
|
1501
|
+
}
|
1502
|
+
},
|
1503
|
+
|
1504
|
+
// Validate field and trigger some events for mainly `UI`
|
1505
|
+
// @returns a promise that succeeds only when all validations do
|
1506
|
+
// or `undefined` if field is not in the given `group`.
|
1507
|
+
whenValidate: function whenValidate() {
|
1508
|
+
var _whenValid$always$done$fail$always,
|
1509
|
+
_this10 = this;
|
1510
|
+
|
1511
|
+
var _ref9 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
1512
|
+
|
1513
|
+
var force = _ref9.force;
|
1514
|
+
var group = _ref9.group;
|
1515
|
+
|
1516
|
+
// do not validate a field if not the same as given validation group
|
1517
|
+
this.refreshConstraints();
|
1518
|
+
if (group && !this._isInGroup(group)) return;
|
1519
|
+
|
1520
|
+
this.value = this.getValue();
|
1521
|
+
|
1522
|
+
// Field Validate event. `this.value` could be altered for custom needs
|
1523
|
+
this._trigger('validate');
|
1524
|
+
|
1525
|
+
return (_whenValid$always$done$fail$always = this.whenValid({ force: force, value: this.value, _refreshed: true }).always(function () {
|
1526
|
+
_this10._reflowUI();
|
1527
|
+
}).done(function () {
|
1528
|
+
_this10._trigger('success');
|
1529
|
+
}).fail(function () {
|
1530
|
+
_this10._trigger('error');
|
1531
|
+
}).always(function () {
|
1532
|
+
_this10._trigger('validated');
|
1533
|
+
})).pipe.apply(_whenValid$always$done$fail$always, _toConsumableArray(this._pipeAccordingToValidationResult()));
|
1534
|
+
},
|
1535
|
+
|
1536
|
+
hasConstraints: function hasConstraints() {
|
1537
|
+
return 0 !== this.constraints.length;
|
1538
|
+
},
|
1539
|
+
|
1540
|
+
// An empty optional field does not need validation
|
1541
|
+
needsValidation: function needsValidation(value) {
|
1542
|
+
if ('undefined' === typeof value) value = this.getValue();
|
1543
|
+
|
1544
|
+
// If a field is empty and not required, it is valid
|
1545
|
+
// Except if `data-parsley-validate-if-empty` explicitely added, useful for some custom validators
|
1546
|
+
if (!value.length && !this._isRequired() && 'undefined' === typeof this.options.validateIfEmpty) return false;
|
1547
|
+
|
1548
|
+
return true;
|
1549
|
+
},
|
1550
|
+
|
1551
|
+
_isInGroup: function _isInGroup(group) {
|
1552
|
+
if (Array.isArray(this.options.group)) return -1 !== $.inArray(group, this.options.group);
|
1553
|
+
return this.options.group === group;
|
1554
|
+
},
|
1555
|
+
|
1556
|
+
// Just validate field. Do not trigger any event.
|
1557
|
+
// Returns `true` iff all constraints pass, `false` if there are failures,
|
1558
|
+
// or `null` if the result can not be determined yet (depends on a promise)
|
1559
|
+
// See also `whenValid`.
|
1560
|
+
isValid: function isValid(options) {
|
1561
|
+
if (arguments.length >= 1 && !$.isPlainObject(options)) {
|
1562
|
+
Utils.warnOnce('Calling isValid on a parsley field without passing arguments as an object is deprecated.');
|
1563
|
+
|
1564
|
+
var _arguments3 = _slice.call(arguments);
|
1565
|
+
|
1566
|
+
var force = _arguments3[0];
|
1567
|
+
var value = _arguments3[1];
|
1568
|
+
|
1569
|
+
options = { force: force, value: value };
|
1570
|
+
}
|
1571
|
+
var promise = this.whenValid(options);
|
1572
|
+
if (!promise) // Excluded via `group`
|
1573
|
+
return true;
|
1574
|
+
return parsley_field__statusMapping[promise.state()];
|
1575
|
+
},
|
1576
|
+
|
1577
|
+
// Just validate field. Do not trigger any event.
|
1578
|
+
// @returns a promise that succeeds only when all validations do
|
1579
|
+
// or `undefined` if the field is not in the given `group`.
|
1580
|
+
// The argument `force` will force validation of empty fields.
|
1581
|
+
// If a `value` is given, it will be validated instead of the value of the input.
|
1582
|
+
whenValid: function whenValid() {
|
1583
|
+
var _this11 = this;
|
1584
|
+
|
1585
|
+
var _ref10 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
|
1586
|
+
|
1587
|
+
var _ref10$force = _ref10.force;
|
1588
|
+
var force = _ref10$force === undefined ? false : _ref10$force;
|
1589
|
+
var value = _ref10.value;
|
1590
|
+
var group = _ref10.group;
|
1591
|
+
var _refreshed = _ref10._refreshed;
|
1592
|
+
|
1593
|
+
// Recompute options and rebind constraints to have latest changes
|
1594
|
+
if (!_refreshed) this.refreshConstraints();
|
1595
|
+
// do not validate a field if not the same as given validation group
|
1596
|
+
if (group && !this._isInGroup(group)) return;
|
1597
|
+
|
1598
|
+
this.validationResult = true;
|
1599
|
+
|
1600
|
+
// A field without constraint is valid
|
1601
|
+
if (!this.hasConstraints()) return $.when();
|
1602
|
+
|
1603
|
+
// Value could be passed as argument, needed to add more power to 'field:validate'
|
1604
|
+
if ('undefined' === typeof value || null === value) value = this.getValue();
|
1605
|
+
|
1606
|
+
if (!this.needsValidation(value) && true !== force) return $.when();
|
1607
|
+
|
1608
|
+
var groupedConstraints = this._getGroupedConstraints();
|
1609
|
+
var promises = [];
|
1610
|
+
$.each(groupedConstraints, function (_, constraints) {
|
1611
|
+
// Process one group of constraints at a time, we validate the constraints
|
1612
|
+
// and combine the promises together.
|
1613
|
+
var promise = Utils.all($.map(constraints, function (constraint) {
|
1614
|
+
return _this11._validateConstraint(value, constraint);
|
1615
|
+
}));
|
1616
|
+
promises.push(promise);
|
1617
|
+
if (promise.state() === 'rejected') return false; // Interrupt processing if a group has already failed
|
1618
|
+
});
|
1619
|
+
return Utils.all(promises);
|
1620
|
+
},
|
1621
|
+
|
1622
|
+
// @returns a promise
|
1623
|
+
_validateConstraint: function _validateConstraint(value, constraint) {
|
1624
|
+
var _this12 = this;
|
1625
|
+
|
1626
|
+
var result = constraint.validate(value, this);
|
1627
|
+
// Map false to a failed promise
|
1628
|
+
if (false === result) result = $.Deferred().reject();
|
1629
|
+
// Make sure we return a promise and that we record failures
|
1630
|
+
return Utils.all([result]).fail(function (errorMessage) {
|
1631
|
+
if (!(_this12.validationResult instanceof Array)) _this12.validationResult = [];
|
1632
|
+
_this12.validationResult.push({
|
1633
|
+
assert: constraint,
|
1634
|
+
errorMessage: 'string' === typeof errorMessage && errorMessage
|
1635
|
+
});
|
1636
|
+
});
|
1637
|
+
},
|
1638
|
+
|
1639
|
+
// @returns Parsley field computed value that could be overrided or configured in DOM
|
1640
|
+
getValue: function getValue() {
|
1641
|
+
var value;
|
1642
|
+
|
1643
|
+
// Value could be overriden in DOM or with explicit options
|
1644
|
+
if ('function' === typeof this.options.value) value = this.options.value(this);else if ('undefined' !== typeof this.options.value) value = this.options.value;else value = this.$element.val();
|
1645
|
+
|
1646
|
+
// Handle wrong DOM or configurations
|
1647
|
+
if ('undefined' === typeof value || null === value) return '';
|
1648
|
+
|
1649
|
+
return this._handleWhitespace(value);
|
1650
|
+
},
|
1651
|
+
|
1652
|
+
// Reset UI
|
1653
|
+
reset: function reset() {
|
1654
|
+
this._resetUI();
|
1655
|
+
return this._trigger('reset');
|
1656
|
+
},
|
1657
|
+
|
1658
|
+
// Destroy Parsley instance (+ UI)
|
1659
|
+
destroy: function destroy() {
|
1660
|
+
// Field case: emit destroy event to clean UI and then destroy stored instance
|
1661
|
+
this._destroyUI();
|
1662
|
+
this.$element.removeData('Parsley');
|
1663
|
+
this.$element.removeData('FieldMultiple');
|
1664
|
+
this._trigger('destroy');
|
1665
|
+
},
|
1666
|
+
|
1667
|
+
// Actualize options that could have change since previous validation
|
1668
|
+
// Re-bind accordingly constraints (could be some new, removed or updated)
|
1669
|
+
refreshConstraints: function refreshConstraints() {
|
1670
|
+
return this.actualizeOptions()._bindConstraints();
|
1671
|
+
},
|
1672
|
+
|
1673
|
+
/**
|
1674
|
+
* Add a new constraint to a field
|
1675
|
+
*
|
1676
|
+
* @param {String} name
|
1677
|
+
* @param {Mixed} requirements optional
|
1678
|
+
* @param {Number} priority optional
|
1679
|
+
* @param {Boolean} isDomConstraint optional
|
1680
|
+
*/
|
1681
|
+
addConstraint: function addConstraint(name, requirements, priority, isDomConstraint) {
|
1682
|
+
|
1683
|
+
if (window.Parsley._validatorRegistry.validators[name]) {
|
1684
|
+
var constraint = new Constraint(this, name, requirements, priority, isDomConstraint);
|
1685
|
+
|
1686
|
+
// if constraint already exist, delete it and push new version
|
1687
|
+
if ('undefined' !== this.constraintsByName[constraint.name]) this.removeConstraint(constraint.name);
|
1688
|
+
|
1689
|
+
this.constraints.push(constraint);
|
1690
|
+
this.constraintsByName[constraint.name] = constraint;
|
1691
|
+
}
|
1692
|
+
|
1693
|
+
return this;
|
1694
|
+
},
|
1695
|
+
|
1696
|
+
// Remove a constraint
|
1697
|
+
removeConstraint: function removeConstraint(name) {
|
1698
|
+
for (var i = 0; i < this.constraints.length; i++) if (name === this.constraints[i].name) {
|
1699
|
+
this.constraints.splice(i, 1);
|
1700
|
+
break;
|
1701
|
+
}
|
1702
|
+
delete this.constraintsByName[name];
|
1703
|
+
return this;
|
1704
|
+
},
|
1705
|
+
|
1706
|
+
// Update a constraint (Remove + re-add)
|
1707
|
+
updateConstraint: function updateConstraint(name, parameters, priority) {
|
1708
|
+
return this.removeConstraint(name).addConstraint(name, parameters, priority);
|
1709
|
+
},
|
1710
|
+
|
1711
|
+
// # Internals
|
1712
|
+
|
1713
|
+
// Internal only.
|
1714
|
+
// Bind constraints from config + options + DOM
|
1715
|
+
_bindConstraints: function _bindConstraints() {
|
1716
|
+
var constraints = [];
|
1717
|
+
var constraintsByName = {};
|
1718
|
+
|
1719
|
+
// clean all existing DOM constraints to only keep javascript user constraints
|
1720
|
+
for (var i = 0; i < this.constraints.length; i++) if (false === this.constraints[i].isDomConstraint) {
|
1721
|
+
constraints.push(this.constraints[i]);
|
1722
|
+
constraintsByName[this.constraints[i].name] = this.constraints[i];
|
1723
|
+
}
|
1724
|
+
|
1725
|
+
this.constraints = constraints;
|
1726
|
+
this.constraintsByName = constraintsByName;
|
1727
|
+
|
1728
|
+
// then re-add Parsley DOM-API constraints
|
1729
|
+
for (var name in this.options) this.addConstraint(name, this.options[name], undefined, true);
|
1730
|
+
|
1731
|
+
// finally, bind special HTML5 constraints
|
1732
|
+
return this._bindHtml5Constraints();
|
1733
|
+
},
|
1734
|
+
|
1735
|
+
// Internal only.
|
1736
|
+
// Bind specific HTML5 constraints to be HTML5 compliant
|
1737
|
+
_bindHtml5Constraints: function _bindHtml5Constraints() {
|
1738
|
+
// html5 required
|
1739
|
+
if (null !== this.element.getAttribute('required')) this.addConstraint('required', true, undefined, true);
|
1740
|
+
|
1741
|
+
// html5 pattern
|
1742
|
+
if (null !== this.element.getAttribute('pattern')) this.addConstraint('pattern', this.element.getAttribute('pattern'), undefined, true);
|
1743
|
+
|
1744
|
+
// range
|
1745
|
+
var min = this.element.getAttribute('min');
|
1746
|
+
var max = this.element.getAttribute('max');
|
1747
|
+
if (null !== min && null !== max) this.addConstraint('range', [min, max], undefined, true);
|
1748
|
+
|
1749
|
+
// HTML5 min
|
1750
|
+
else if (null !== min) this.addConstraint('min', min, undefined, true);
|
1751
|
+
|
1752
|
+
// HTML5 max
|
1753
|
+
else if (null !== max) this.addConstraint('max', max, undefined, true);
|
1754
|
+
|
1755
|
+
// length
|
1756
|
+
if (null !== this.element.getAttribute('minlength') && null !== this.element.getAttribute('maxlength')) this.addConstraint('length', [this.element.getAttribute('minlength'), this.element.getAttribute('maxlength')], undefined, true);
|
1757
|
+
|
1758
|
+
// HTML5 minlength
|
1759
|
+
else if (null !== this.element.getAttribute('minlength')) this.addConstraint('minlength', this.element.getAttribute('minlength'), undefined, true);
|
1760
|
+
|
1761
|
+
// HTML5 maxlength
|
1762
|
+
else if (null !== this.element.getAttribute('maxlength')) this.addConstraint('maxlength', this.element.getAttribute('maxlength'), undefined, true);
|
1763
|
+
|
1764
|
+
// html5 types
|
1765
|
+
var type = this.element.type;
|
1766
|
+
|
1767
|
+
// Small special case here for HTML5 number: integer validator if step attribute is undefined or an integer value, number otherwise
|
1768
|
+
if ('number' === type) {
|
1769
|
+
return this.addConstraint('type', ['number', {
|
1770
|
+
step: this.element.getAttribute('step') || '1',
|
1771
|
+
base: min || this.element.getAttribute('value')
|
1772
|
+
}], undefined, true);
|
1773
|
+
// Regular other HTML5 supported types
|
1774
|
+
} else if (/^(email|url|range|date)$/i.test(type)) {
|
1775
|
+
return this.addConstraint('type', type, undefined, true);
|
1776
|
+
}
|
1777
|
+
return this;
|
1778
|
+
},
|
1779
|
+
|
1780
|
+
// Internal only.
|
1781
|
+
// Field is required if have required constraint without `false` value
|
1782
|
+
_isRequired: function _isRequired() {
|
1783
|
+
if ('undefined' === typeof this.constraintsByName.required) return false;
|
1784
|
+
|
1785
|
+
return false !== this.constraintsByName.required.requirements;
|
1786
|
+
},
|
1787
|
+
|
1788
|
+
// Internal only.
|
1789
|
+
// Shortcut to trigger an event
|
1790
|
+
_trigger: function _trigger(eventName) {
|
1791
|
+
return this.trigger('field:' + eventName);
|
1792
|
+
},
|
1793
|
+
|
1794
|
+
// Internal only
|
1795
|
+
// Handles whitespace in a value
|
1796
|
+
// Use `data-parsley-whitespace="squish"` to auto squish input value
|
1797
|
+
// Use `data-parsley-whitespace="trim"` to auto trim input value
|
1798
|
+
_handleWhitespace: function _handleWhitespace(value) {
|
1799
|
+
if (true === this.options.trimValue) Utils.warnOnce('data-parsley-trim-value="true" is deprecated, please use data-parsley-whitespace="trim"');
|
1800
|
+
|
1801
|
+
if ('squish' === this.options.whitespace) value = value.replace(/\s{2,}/g, ' ');
|
1802
|
+
|
1803
|
+
if ('trim' === this.options.whitespace || 'squish' === this.options.whitespace || true === this.options.trimValue) value = Utils.trimString(value);
|
1804
|
+
|
1805
|
+
return value;
|
1806
|
+
},
|
1807
|
+
|
1808
|
+
_isDateInput: function _isDateInput() {
|
1809
|
+
var c = this.constraintsByName.type;
|
1810
|
+
return c && c.requirements === 'date';
|
1811
|
+
},
|
1812
|
+
|
1813
|
+
// Internal only.
|
1814
|
+
// Returns the constraints, grouped by descending priority.
|
1815
|
+
// The result is thus an array of arrays of constraints.
|
1816
|
+
_getGroupedConstraints: function _getGroupedConstraints() {
|
1817
|
+
if (false === this.options.priorityEnabled) return [this.constraints];
|
1818
|
+
|
1819
|
+
var groupedConstraints = [];
|
1820
|
+
var index = {};
|
1821
|
+
|
1822
|
+
// Create array unique of priorities
|
1823
|
+
for (var i = 0; i < this.constraints.length; i++) {
|
1824
|
+
var p = this.constraints[i].priority;
|
1825
|
+
if (!index[p]) groupedConstraints.push(index[p] = []);
|
1826
|
+
index[p].push(this.constraints[i]);
|
1827
|
+
}
|
1828
|
+
// Sort them by priority DESC
|
1829
|
+
groupedConstraints.sort(function (a, b) {
|
1830
|
+
return b[0].priority - a[0].priority;
|
1831
|
+
});
|
1832
|
+
|
1833
|
+
return groupedConstraints;
|
1834
|
+
}
|
1835
|
+
|
1836
|
+
};
|
1837
|
+
|
1838
|
+
var parsley_field = Field;
|
1839
|
+
|
1840
|
+
var Multiple = function Multiple() {
|
1841
|
+
this.__class__ = 'FieldMultiple';
|
1842
|
+
};
|
1843
|
+
|
1844
|
+
Multiple.prototype = {
|
1845
|
+
// Add new `$element` sibling for multiple field
|
1846
|
+
addElement: function addElement($element) {
|
1847
|
+
this.$elements.push($element);
|
1848
|
+
|
1849
|
+
return this;
|
1850
|
+
},
|
1851
|
+
|
1852
|
+
// See `Field.refreshConstraints()`
|
1853
|
+
refreshConstraints: function refreshConstraints() {
|
1854
|
+
var fieldConstraints;
|
1855
|
+
|
1856
|
+
this.constraints = [];
|
1857
|
+
|
1858
|
+
// Select multiple special treatment
|
1859
|
+
if (this.element.nodeName === 'SELECT') {
|
1860
|
+
this.actualizeOptions()._bindConstraints();
|
1861
|
+
|
1862
|
+
return this;
|
1863
|
+
}
|
1864
|
+
|
1865
|
+
// Gather all constraints for each input in the multiple group
|
1866
|
+
for (var i = 0; i < this.$elements.length; i++) {
|
1867
|
+
|
1868
|
+
// Check if element have not been dynamically removed since last binding
|
1869
|
+
if (!$('html').has(this.$elements[i]).length) {
|
1870
|
+
this.$elements.splice(i, 1);
|
1871
|
+
continue;
|
1872
|
+
}
|
1873
|
+
|
1874
|
+
fieldConstraints = this.$elements[i].data('FieldMultiple').refreshConstraints().constraints;
|
1875
|
+
|
1876
|
+
for (var j = 0; j < fieldConstraints.length; j++) this.addConstraint(fieldConstraints[j].name, fieldConstraints[j].requirements, fieldConstraints[j].priority, fieldConstraints[j].isDomConstraint);
|
1877
|
+
}
|
1878
|
+
|
1879
|
+
return this;
|
1880
|
+
},
|
1881
|
+
|
1882
|
+
// See `Field.getValue()`
|
1883
|
+
getValue: function getValue() {
|
1884
|
+
// Value could be overriden in DOM
|
1885
|
+
if ('function' === typeof this.options.value) return this.options.value(this);else if ('undefined' !== typeof this.options.value) return this.options.value;
|
1886
|
+
|
1887
|
+
// Radio input case
|
1888
|
+
if (this.element.nodeName === 'INPUT') {
|
1889
|
+
if (this.element.type === 'radio') return this._findRelated().filter(':checked').val() || '';
|
1890
|
+
|
1891
|
+
// checkbox input case
|
1892
|
+
if (this.element.type === 'checkbox') {
|
1893
|
+
var values = [];
|
1894
|
+
|
1895
|
+
this._findRelated().filter(':checked').each(function () {
|
1896
|
+
values.push($(this).val());
|
1897
|
+
});
|
1898
|
+
|
1899
|
+
return values;
|
1900
|
+
}
|
1901
|
+
}
|
1902
|
+
|
1903
|
+
// Select multiple case
|
1904
|
+
if (this.element.nodeName === 'SELECT' && null === this.$element.val()) return [];
|
1905
|
+
|
1906
|
+
// Default case that should never happen
|
1907
|
+
return this.$element.val();
|
1908
|
+
},
|
1909
|
+
|
1910
|
+
_init: function _init() {
|
1911
|
+
this.$elements = [this.$element];
|
1912
|
+
|
1913
|
+
return this;
|
1914
|
+
}
|
1915
|
+
};
|
1916
|
+
|
1917
|
+
var Factory = function Factory(element, options, parsleyFormInstance) {
|
1918
|
+
this.element = element;
|
1919
|
+
this.$element = $(element);
|
1920
|
+
|
1921
|
+
// If the element has already been bound, returns its saved Parsley instance
|
1922
|
+
var savedparsleyFormInstance = this.$element.data('Parsley');
|
1923
|
+
if (savedparsleyFormInstance) {
|
1924
|
+
|
1925
|
+
// If the saved instance has been bound without a Form parent and there is one given in this call, add it
|
1926
|
+
if ('undefined' !== typeof parsleyFormInstance && savedparsleyFormInstance.parent === window.Parsley) {
|
1927
|
+
savedparsleyFormInstance.parent = parsleyFormInstance;
|
1928
|
+
savedparsleyFormInstance._resetOptions(savedparsleyFormInstance.options);
|
1929
|
+
}
|
1930
|
+
|
1931
|
+
if ('object' === typeof options) {
|
1932
|
+
_extends(savedparsleyFormInstance.options, options);
|
1933
|
+
}
|
1934
|
+
|
1935
|
+
return savedparsleyFormInstance;
|
1936
|
+
}
|
1937
|
+
|
1938
|
+
// Parsley must be instantiated with a DOM element or jQuery $element
|
1939
|
+
if (!this.$element.length) throw new Error('You must bind Parsley on an existing element.');
|
1940
|
+
|
1941
|
+
if ('undefined' !== typeof parsleyFormInstance && 'Form' !== parsleyFormInstance.__class__) throw new Error('Parent instance must be a Form instance');
|
1942
|
+
|
1943
|
+
this.parent = parsleyFormInstance || window.Parsley;
|
1944
|
+
return this.init(options);
|
1945
|
+
};
|
1946
|
+
|
1947
|
+
Factory.prototype = {
|
1948
|
+
init: function init(options) {
|
1949
|
+
this.__class__ = 'Parsley';
|
1950
|
+
this.__version__ = '2.7.2';
|
1951
|
+
this.__id__ = Utils.generateID();
|
1952
|
+
|
1953
|
+
// Pre-compute options
|
1954
|
+
this._resetOptions(options);
|
1955
|
+
|
1956
|
+
// A Form instance is obviously a `<form>` element but also every node that is not an input and has the `data-parsley-validate` attribute
|
1957
|
+
if (this.element.nodeName === 'FORM' || Utils.checkAttr(this.element, this.options.namespace, 'validate') && !this.$element.is(this.options.inputs)) return this.bind('parsleyForm');
|
1958
|
+
|
1959
|
+
// Every other element is bound as a `Field` or `FieldMultiple`
|
1960
|
+
return this.isMultiple() ? this.handleMultiple() : this.bind('parsleyField');
|
1961
|
+
},
|
1962
|
+
|
1963
|
+
isMultiple: function isMultiple() {
|
1964
|
+
return this.element.type === 'radio' || this.element.type === 'checkbox' || this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple');
|
1965
|
+
},
|
1966
|
+
|
1967
|
+
// Multiples fields are a real nightmare :(
|
1968
|
+
// Maybe some refactoring would be appreciated here...
|
1969
|
+
handleMultiple: function handleMultiple() {
|
1970
|
+
var _this13 = this;
|
1971
|
+
|
1972
|
+
var name;
|
1973
|
+
var multiple;
|
1974
|
+
var parsleyMultipleInstance;
|
1975
|
+
|
1976
|
+
// Handle multiple name
|
1977
|
+
this.options.multiple = this.options.multiple || (name = this.element.getAttribute('name')) || this.element.getAttribute('id');
|
1978
|
+
|
1979
|
+
// Special select multiple input
|
1980
|
+
if (this.element.nodeName === 'SELECT' && null !== this.element.getAttribute('multiple')) {
|
1981
|
+
this.options.multiple = this.options.multiple || this.__id__;
|
1982
|
+
return this.bind('parsleyFieldMultiple');
|
1983
|
+
|
1984
|
+
// Else for radio / checkboxes, we need a `name` or `data-parsley-multiple` to properly bind it
|
1985
|
+
} else if (!this.options.multiple) {
|
1986
|
+
Utils.warn('To be bound by Parsley, a radio, a checkbox and a multiple select input must have either a name or a multiple option.', this.$element);
|
1987
|
+
return this;
|
1988
|
+
}
|
1989
|
+
|
1990
|
+
// Remove special chars
|
1991
|
+
this.options.multiple = this.options.multiple.replace(/(:|\.|\[|\]|\{|\}|\$)/g, '');
|
1992
|
+
|
1993
|
+
// Add proper `data-parsley-multiple` to siblings if we have a valid multiple name
|
1994
|
+
if (name) {
|
1995
|
+
$('input[name="' + name + '"]').each(function (i, input) {
|
1996
|
+
if (input.type === 'radio' || input.type === 'checkbox') input.setAttribute(_this13.options.namespace + 'multiple', _this13.options.multiple);
|
1997
|
+
});
|
1998
|
+
}
|
1999
|
+
|
2000
|
+
// Check here if we don't already have a related multiple instance saved
|
2001
|
+
var $previouslyRelated = this._findRelated();
|
2002
|
+
for (var i = 0; i < $previouslyRelated.length; i++) {
|
2003
|
+
parsleyMultipleInstance = $($previouslyRelated.get(i)).data('Parsley');
|
2004
|
+
if ('undefined' !== typeof parsleyMultipleInstance) {
|
2005
|
+
|
2006
|
+
if (!this.$element.data('FieldMultiple')) {
|
2007
|
+
parsleyMultipleInstance.addElement(this.$element);
|
2008
|
+
}
|
2009
|
+
|
2010
|
+
break;
|
2011
|
+
}
|
2012
|
+
}
|
2013
|
+
|
2014
|
+
// Create a secret Field instance for every multiple field. It will be stored in `data('FieldMultiple')`
|
2015
|
+
// And will be useful later to access classic `Field` stuff while being in a `FieldMultiple` instance
|
2016
|
+
this.bind('parsleyField', true);
|
2017
|
+
|
2018
|
+
return parsleyMultipleInstance || this.bind('parsleyFieldMultiple');
|
2019
|
+
},
|
2020
|
+
|
2021
|
+
// Return proper `Form`, `Field` or `FieldMultiple`
|
2022
|
+
bind: function bind(type, doNotStore) {
|
2023
|
+
var parsleyInstance;
|
2024
|
+
|
2025
|
+
switch (type) {
|
2026
|
+
case 'parsleyForm':
|
2027
|
+
parsleyInstance = $.extend(new Form(this.element, this.domOptions, this.options), new Base(), window.ParsleyExtend)._bindFields();
|
2028
|
+
break;
|
2029
|
+
case 'parsleyField':
|
2030
|
+
parsleyInstance = $.extend(new parsley_field(this.element, this.domOptions, this.options, this.parent), new Base(), window.ParsleyExtend);
|
2031
|
+
break;
|
2032
|
+
case 'parsleyFieldMultiple':
|
2033
|
+
parsleyInstance = $.extend(new parsley_field(this.element, this.domOptions, this.options, this.parent), new Multiple(), new Base(), window.ParsleyExtend)._init();
|
2034
|
+
break;
|
2035
|
+
default:
|
2036
|
+
throw new Error(type + 'is not a supported Parsley type');
|
2037
|
+
}
|
2038
|
+
|
2039
|
+
if (this.options.multiple) Utils.setAttr(this.element, this.options.namespace, 'multiple', this.options.multiple);
|
2040
|
+
|
2041
|
+
if ('undefined' !== typeof doNotStore) {
|
2042
|
+
this.$element.data('FieldMultiple', parsleyInstance);
|
2043
|
+
|
2044
|
+
return parsleyInstance;
|
2045
|
+
}
|
2046
|
+
|
2047
|
+
// Store the freshly bound instance in a DOM element for later access using jQuery `data()`
|
2048
|
+
this.$element.data('Parsley', parsleyInstance);
|
2049
|
+
|
2050
|
+
// Tell the world we have a new Form or Field instance!
|
2051
|
+
parsleyInstance._actualizeTriggers();
|
2052
|
+
parsleyInstance._trigger('init');
|
2053
|
+
|
2054
|
+
return parsleyInstance;
|
2055
|
+
}
|
2056
|
+
};
|
2057
|
+
|
2058
|
+
var vernums = $.fn.jquery.split('.');
|
2059
|
+
if (parseInt(vernums[0]) <= 1 && parseInt(vernums[1]) < 8) {
|
2060
|
+
throw "The loaded version of jQuery is too old. Please upgrade to 1.8.x or better.";
|
2061
|
+
}
|
2062
|
+
if (!vernums.forEach) {
|
2063
|
+
Utils.warn('Parsley requires ES5 to run properly. Please include https://github.com/es-shims/es5-shim');
|
2064
|
+
}
|
2065
|
+
// Inherit `on`, `off` & `trigger` to Parsley:
|
2066
|
+
var Parsley = _extends(new Base(), {
|
2067
|
+
element: document,
|
2068
|
+
$element: $(document),
|
2069
|
+
actualizeOptions: null,
|
2070
|
+
_resetOptions: null,
|
2071
|
+
Factory: Factory,
|
2072
|
+
version: '2.7.2'
|
2073
|
+
});
|
2074
|
+
|
2075
|
+
// Supplement Field and Form with Base
|
2076
|
+
// This way, the constructors will have access to those methods
|
2077
|
+
_extends(parsley_field.prototype, UI.Field, Base.prototype);
|
2078
|
+
_extends(Form.prototype, UI.Form, Base.prototype);
|
2079
|
+
// Inherit actualizeOptions and _resetOptions:
|
2080
|
+
_extends(Factory.prototype, Base.prototype);
|
2081
|
+
|
2082
|
+
// ### jQuery API
|
2083
|
+
// `$('.elem').parsley(options)` or `$('.elem').psly(options)`
|
2084
|
+
$.fn.parsley = $.fn.psly = function (options) {
|
2085
|
+
if (this.length > 1) {
|
2086
|
+
var instances = [];
|
2087
|
+
|
2088
|
+
this.each(function () {
|
2089
|
+
instances.push($(this).parsley(options));
|
2090
|
+
});
|
2091
|
+
|
2092
|
+
return instances;
|
2093
|
+
}
|
2094
|
+
|
2095
|
+
// Return undefined if applied to non existing DOM element
|
2096
|
+
if (!$(this).length) {
|
2097
|
+
Utils.warn('You must bind Parsley on an existing element.');
|
2098
|
+
|
2099
|
+
return;
|
2100
|
+
}
|
2101
|
+
|
2102
|
+
return new Factory(this[0], options);
|
2103
|
+
};
|
2104
|
+
|
2105
|
+
// ### Field and Form extension
|
2106
|
+
// Ensure the extension is now defined if it wasn't previously
|
2107
|
+
if ('undefined' === typeof window.ParsleyExtend) window.ParsleyExtend = {};
|
2108
|
+
|
2109
|
+
// ### Parsley config
|
2110
|
+
// Inherit from ParsleyDefault, and copy over any existing values
|
2111
|
+
Parsley.options = _extends(Utils.objectCreate(Defaults), window.ParsleyConfig);
|
2112
|
+
window.ParsleyConfig = Parsley.options; // Old way of accessing global options
|
2113
|
+
|
2114
|
+
// ### Globals
|
2115
|
+
window.Parsley = window.psly = Parsley;
|
2116
|
+
Parsley.Utils = Utils;
|
2117
|
+
window.ParsleyUtils = {};
|
2118
|
+
$.each(Utils, function (key, value) {
|
2119
|
+
if ('function' === typeof value) {
|
2120
|
+
window.ParsleyUtils[key] = function () {
|
2121
|
+
Utils.warnOnce('Accessing `window.ParsleyUtils` is deprecated. Use `window.Parsley.Utils` instead.');
|
2122
|
+
return Utils[key].apply(Utils, arguments);
|
2123
|
+
};
|
2124
|
+
}
|
2125
|
+
});
|
2126
|
+
|
2127
|
+
// ### Define methods that forward to the registry, and deprecate all access except through window.Parsley
|
2128
|
+
var registry = window.Parsley._validatorRegistry = new ValidatorRegistry(window.ParsleyConfig.validators, window.ParsleyConfig.i18n);
|
2129
|
+
window.ParsleyValidator = {};
|
2130
|
+
$.each('setLocale addCatalog addMessage addMessages getErrorMessage formatMessage addValidator updateValidator removeValidator'.split(' '), function (i, method) {
|
2131
|
+
window.Parsley[method] = function () {
|
2132
|
+
return registry[method].apply(registry, arguments);
|
2133
|
+
};
|
2134
|
+
window.ParsleyValidator[method] = function () {
|
2135
|
+
var _window$Parsley;
|
2136
|
+
|
2137
|
+
Utils.warnOnce('Accessing the method \'' + method + '\' through Validator is deprecated. Simply call \'window.Parsley.' + method + '(...)\'');
|
2138
|
+
return (_window$Parsley = window.Parsley)[method].apply(_window$Parsley, arguments);
|
2139
|
+
};
|
2140
|
+
});
|
2141
|
+
|
2142
|
+
// ### UI
|
2143
|
+
// Deprecated global object
|
2144
|
+
window.Parsley.UI = UI;
|
2145
|
+
window.ParsleyUI = {
|
2146
|
+
removeError: function removeError(instance, name, doNotUpdateClass) {
|
2147
|
+
var updateClass = true !== doNotUpdateClass;
|
2148
|
+
Utils.warnOnce('Accessing UI is deprecated. Call \'removeError\' on the instance directly. Please comment in issue 1073 as to your need to call this method.');
|
2149
|
+
return instance.removeError(name, { updateClass: updateClass });
|
2150
|
+
},
|
2151
|
+
getErrorsMessages: function getErrorsMessages(instance) {
|
2152
|
+
Utils.warnOnce('Accessing UI is deprecated. Call \'getErrorsMessages\' on the instance directly.');
|
2153
|
+
return instance.getErrorsMessages();
|
2154
|
+
}
|
2155
|
+
};
|
2156
|
+
$.each('addError updateError'.split(' '), function (i, method) {
|
2157
|
+
window.ParsleyUI[method] = function (instance, name, message, assert, doNotUpdateClass) {
|
2158
|
+
var updateClass = true !== doNotUpdateClass;
|
2159
|
+
Utils.warnOnce('Accessing UI is deprecated. Call \'' + method + '\' on the instance directly. Please comment in issue 1073 as to your need to call this method.');
|
2160
|
+
return instance[method](name, { message: message, assert: assert, updateClass: updateClass });
|
2161
|
+
};
|
2162
|
+
});
|
2163
|
+
|
2164
|
+
// ### PARSLEY auto-binding
|
2165
|
+
// Prevent it by setting `ParsleyConfig.autoBind` to `false`
|
2166
|
+
if (false !== window.ParsleyConfig.autoBind) {
|
2167
|
+
$(function () {
|
2168
|
+
// Works only on `data-parsley-validate`.
|
2169
|
+
if ($('[data-parsley-validate]').length) $('[data-parsley-validate]').parsley();
|
2170
|
+
});
|
2171
|
+
}
|
2172
|
+
|
2173
|
+
var o = $({});
|
2174
|
+
var deprecated = function deprecated() {
|
2175
|
+
Utils.warnOnce("Parsley's pubsub module is deprecated; use the 'on' and 'off' methods on parsley instances or window.Parsley");
|
2176
|
+
};
|
2177
|
+
|
2178
|
+
// Returns an event handler that calls `fn` with the arguments it expects
|
2179
|
+
function adapt(fn, context) {
|
2180
|
+
// Store to allow unbinding
|
2181
|
+
if (!fn.parsleyAdaptedCallback) {
|
2182
|
+
fn.parsleyAdaptedCallback = function () {
|
2183
|
+
var args = Array.prototype.slice.call(arguments, 0);
|
2184
|
+
args.unshift(this);
|
2185
|
+
fn.apply(context || o, args);
|
2186
|
+
};
|
2187
|
+
}
|
2188
|
+
return fn.parsleyAdaptedCallback;
|
2189
|
+
}
|
2190
|
+
|
2191
|
+
var eventPrefix = 'parsley:';
|
2192
|
+
// Converts 'parsley:form:validate' into 'form:validate'
|
2193
|
+
function eventName(name) {
|
2194
|
+
if (name.lastIndexOf(eventPrefix, 0) === 0) return name.substr(eventPrefix.length);
|
2195
|
+
return name;
|
2196
|
+
}
|
2197
|
+
|
2198
|
+
// $.listen is deprecated. Use Parsley.on instead.
|
2199
|
+
$.listen = function (name, callback) {
|
2200
|
+
var context;
|
2201
|
+
deprecated();
|
2202
|
+
if ('object' === typeof arguments[1] && 'function' === typeof arguments[2]) {
|
2203
|
+
context = arguments[1];
|
2204
|
+
callback = arguments[2];
|
2205
|
+
}
|
2206
|
+
|
2207
|
+
if ('function' !== typeof callback) throw new Error('Wrong parameters');
|
2208
|
+
|
2209
|
+
window.Parsley.on(eventName(name), adapt(callback, context));
|
2210
|
+
};
|
2211
|
+
|
2212
|
+
$.listenTo = function (instance, name, fn) {
|
2213
|
+
deprecated();
|
2214
|
+
if (!(instance instanceof parsley_field) && !(instance instanceof Form)) throw new Error('Must give Parsley instance');
|
2215
|
+
|
2216
|
+
if ('string' !== typeof name || 'function' !== typeof fn) throw new Error('Wrong parameters');
|
2217
|
+
|
2218
|
+
instance.on(eventName(name), adapt(fn));
|
2219
|
+
};
|
2220
|
+
|
2221
|
+
$.unsubscribe = function (name, fn) {
|
2222
|
+
deprecated();
|
2223
|
+
if ('string' !== typeof name || 'function' !== typeof fn) throw new Error('Wrong arguments');
|
2224
|
+
window.Parsley.off(eventName(name), fn.parsleyAdaptedCallback);
|
2225
|
+
};
|
2226
|
+
|
2227
|
+
$.unsubscribeTo = function (instance, name) {
|
2228
|
+
deprecated();
|
2229
|
+
if (!(instance instanceof parsley_field) && !(instance instanceof Form)) throw new Error('Must give Parsley instance');
|
2230
|
+
instance.off(eventName(name));
|
2231
|
+
};
|
2232
|
+
|
2233
|
+
$.unsubscribeAll = function (name) {
|
2234
|
+
deprecated();
|
2235
|
+
window.Parsley.off(eventName(name));
|
2236
|
+
$('form,input,textarea,select').each(function () {
|
2237
|
+
var instance = $(this).data('Parsley');
|
2238
|
+
if (instance) {
|
2239
|
+
instance.off(eventName(name));
|
2240
|
+
}
|
2241
|
+
});
|
2242
|
+
};
|
2243
|
+
|
2244
|
+
// $.emit is deprecated. Use jQuery events instead.
|
2245
|
+
$.emit = function (name, instance) {
|
2246
|
+
var _instance;
|
2247
|
+
|
2248
|
+
deprecated();
|
2249
|
+
var instanceGiven = instance instanceof parsley_field || instance instanceof Form;
|
2250
|
+
var args = Array.prototype.slice.call(arguments, instanceGiven ? 2 : 1);
|
2251
|
+
args.unshift(eventName(name));
|
2252
|
+
if (!instanceGiven) {
|
2253
|
+
instance = window.Parsley;
|
2254
|
+
}
|
2255
|
+
(_instance = instance).trigger.apply(_instance, _toConsumableArray(args));
|
2256
|
+
};
|
2257
|
+
|
2258
|
+
var pubsub = {};
|
2259
|
+
|
2260
|
+
$.extend(true, Parsley, {
|
2261
|
+
asyncValidators: {
|
2262
|
+
'default': {
|
2263
|
+
fn: function fn(xhr) {
|
2264
|
+
// By default, only status 2xx are deemed successful.
|
2265
|
+
// Note: we use status instead of state() because responses with status 200
|
2266
|
+
// but invalid messages (e.g. an empty body for content type set to JSON) will
|
2267
|
+
// result in state() === 'rejected'.
|
2268
|
+
return xhr.status >= 200 && xhr.status < 300;
|
2269
|
+
},
|
2270
|
+
url: false
|
2271
|
+
},
|
2272
|
+
reverse: {
|
2273
|
+
fn: function fn(xhr) {
|
2274
|
+
// If reverse option is set, a failing ajax request is considered successful
|
2275
|
+
return xhr.status < 200 || xhr.status >= 300;
|
2276
|
+
},
|
2277
|
+
url: false
|
2278
|
+
}
|
2279
|
+
},
|
2280
|
+
|
2281
|
+
addAsyncValidator: function addAsyncValidator(name, fn, url, options) {
|
2282
|
+
Parsley.asyncValidators[name] = {
|
2283
|
+
fn: fn,
|
2284
|
+
url: url || false,
|
2285
|
+
options: options || {}
|
2286
|
+
};
|
2287
|
+
|
2288
|
+
return this;
|
2289
|
+
}
|
2290
|
+
|
2291
|
+
});
|
2292
|
+
|
2293
|
+
Parsley.addValidator('remote', {
|
2294
|
+
requirementType: {
|
2295
|
+
'': 'string',
|
2296
|
+
'validator': 'string',
|
2297
|
+
'reverse': 'boolean',
|
2298
|
+
'options': 'object'
|
2299
|
+
},
|
2300
|
+
|
2301
|
+
validateString: function validateString(value, url, options, instance) {
|
2302
|
+
var data = {};
|
2303
|
+
var ajaxOptions;
|
2304
|
+
var csr;
|
2305
|
+
var validator = options.validator || (true === options.reverse ? 'reverse' : 'default');
|
2306
|
+
|
2307
|
+
if ('undefined' === typeof Parsley.asyncValidators[validator]) throw new Error('Calling an undefined async validator: `' + validator + '`');
|
2308
|
+
|
2309
|
+
url = Parsley.asyncValidators[validator].url || url;
|
2310
|
+
|
2311
|
+
// Fill current value
|
2312
|
+
if (url.indexOf('{value}') > -1) {
|
2313
|
+
url = url.replace('{value}', encodeURIComponent(value));
|
2314
|
+
} else {
|
2315
|
+
data[instance.element.getAttribute('name') || instance.element.getAttribute('id')] = value;
|
2316
|
+
}
|
2317
|
+
|
2318
|
+
// Merge options passed in from the function with the ones in the attribute
|
2319
|
+
var remoteOptions = $.extend(true, options.options || {}, Parsley.asyncValidators[validator].options);
|
2320
|
+
|
2321
|
+
// All `$.ajax(options)` could be overridden or extended directly from DOM in `data-parsley-remote-options`
|
2322
|
+
ajaxOptions = $.extend(true, {}, {
|
2323
|
+
url: url,
|
2324
|
+
data: data,
|
2325
|
+
type: 'GET'
|
2326
|
+
}, remoteOptions);
|
2327
|
+
|
2328
|
+
// Generate store key based on ajax options
|
2329
|
+
instance.trigger('field:ajaxoptions', instance, ajaxOptions);
|
2330
|
+
|
2331
|
+
csr = $.param(ajaxOptions);
|
2332
|
+
|
2333
|
+
// Initialise querry cache
|
2334
|
+
if ('undefined' === typeof Parsley._remoteCache) Parsley._remoteCache = {};
|
2335
|
+
|
2336
|
+
// Try to retrieve stored xhr
|
2337
|
+
var xhr = Parsley._remoteCache[csr] = Parsley._remoteCache[csr] || $.ajax(ajaxOptions);
|
2338
|
+
|
2339
|
+
var handleXhr = function handleXhr() {
|
2340
|
+
var result = Parsley.asyncValidators[validator].fn.call(instance, xhr, url, options);
|
2341
|
+
if (!result) // Map falsy results to rejected promise
|
2342
|
+
result = $.Deferred().reject();
|
2343
|
+
return $.when(result);
|
2344
|
+
};
|
2345
|
+
|
2346
|
+
return xhr.then(handleXhr, handleXhr);
|
2347
|
+
},
|
2348
|
+
|
2349
|
+
priority: -1
|
2350
|
+
});
|
2351
|
+
|
2352
|
+
Parsley.on('form:submit', function () {
|
2353
|
+
Parsley._remoteCache = {};
|
2354
|
+
});
|
2355
|
+
|
2356
|
+
Base.prototype.addAsyncValidator = function () {
|
2357
|
+
Utils.warnOnce('Accessing the method `addAsyncValidator` through an instance is deprecated. Simply call `Parsley.addAsyncValidator(...)`');
|
2358
|
+
return Parsley.addAsyncValidator.apply(Parsley, arguments);
|
2359
|
+
};
|
2360
|
+
|
2361
|
+
// This is included with the Parsley library itself,
|
2362
|
+
// thus there is no use in adding it to your project.
|
2363
|
+
Parsley.addMessages('en', {
|
2364
|
+
defaultMessage: "This value seems to be invalid.",
|
2365
|
+
type: {
|
2366
|
+
email: "This value should be a valid email.",
|
2367
|
+
url: "This value should be a valid url.",
|
2368
|
+
number: "This value should be a valid number.",
|
2369
|
+
integer: "This value should be a valid integer.",
|
2370
|
+
digits: "This value should be digits.",
|
2371
|
+
alphanum: "This value should be alphanumeric."
|
2372
|
+
},
|
2373
|
+
notblank: "This value should not be blank.",
|
2374
|
+
required: "This value is required.",
|
2375
|
+
pattern: "This value seems to be invalid.",
|
2376
|
+
min: "This value should be greater than or equal to %s.",
|
2377
|
+
max: "This value should be lower than or equal to %s.",
|
2378
|
+
range: "This value should be between %s and %s.",
|
2379
|
+
minlength: "This value is too short. It should have %s characters or more.",
|
2380
|
+
maxlength: "This value is too long. It should have %s characters or fewer.",
|
2381
|
+
length: "This value length is invalid. It should be between %s and %s characters long.",
|
2382
|
+
mincheck: "You must select at least %s choices.",
|
2383
|
+
maxcheck: "You must select %s choices or fewer.",
|
2384
|
+
check: "You must select between %s and %s choices.",
|
2385
|
+
equalto: "This value should be the same."
|
2386
|
+
});
|
2387
|
+
|
2388
|
+
Parsley.setLocale('en');
|
2389
|
+
|
2390
|
+
/**
|
2391
|
+
* inputevent - Alleviate browser bugs for input events
|
2392
|
+
* https://github.com/marcandre/inputevent
|
2393
|
+
* @version v0.0.3 - (built Thu, Apr 14th 2016, 5:58 pm)
|
2394
|
+
* @author Marc-Andre Lafortune <github@marc-andre.ca>
|
2395
|
+
* @license MIT
|
2396
|
+
*/
|
2397
|
+
|
2398
|
+
function InputEvent() {
|
2399
|
+
var _this14 = this;
|
2400
|
+
|
2401
|
+
var globals = window || global;
|
2402
|
+
|
2403
|
+
// Slightly odd way construct our object. This way methods are force bound.
|
2404
|
+
// Used to test for duplicate library.
|
2405
|
+
_extends(this, {
|
2406
|
+
|
2407
|
+
// For browsers that do not support isTrusted, assumes event is native.
|
2408
|
+
isNativeEvent: function isNativeEvent(evt) {
|
2409
|
+
return evt.originalEvent && evt.originalEvent.isTrusted !== false;
|
2410
|
+
},
|
2411
|
+
|
2412
|
+
fakeInputEvent: function fakeInputEvent(evt) {
|
2413
|
+
if (_this14.isNativeEvent(evt)) {
|
2414
|
+
$(evt.target).trigger('input');
|
2415
|
+
}
|
2416
|
+
},
|
2417
|
+
|
2418
|
+
misbehaves: function misbehaves(evt) {
|
2419
|
+
if (_this14.isNativeEvent(evt)) {
|
2420
|
+
_this14.behavesOk(evt);
|
2421
|
+
$(document).on('change.inputevent', evt.data.selector, _this14.fakeInputEvent);
|
2422
|
+
_this14.fakeInputEvent(evt);
|
2423
|
+
}
|
2424
|
+
},
|
2425
|
+
|
2426
|
+
behavesOk: function behavesOk(evt) {
|
2427
|
+
if (_this14.isNativeEvent(evt)) {
|
2428
|
+
$(document) // Simply unbinds the testing handler
|
2429
|
+
.off('input.inputevent', evt.data.selector, _this14.behavesOk).off('change.inputevent', evt.data.selector, _this14.misbehaves);
|
2430
|
+
}
|
2431
|
+
},
|
2432
|
+
|
2433
|
+
// Bind the testing handlers
|
2434
|
+
install: function install() {
|
2435
|
+
if (globals.inputEventPatched) {
|
2436
|
+
return;
|
2437
|
+
}
|
2438
|
+
globals.inputEventPatched = '0.0.3';
|
2439
|
+
var _arr = ['select', 'input[type="checkbox"]', 'input[type="radio"]', 'input[type="file"]'];
|
2440
|
+
for (var _i = 0; _i < _arr.length; _i++) {
|
2441
|
+
var selector = _arr[_i];
|
2442
|
+
$(document).on('input.inputevent', selector, { selector: selector }, _this14.behavesOk).on('change.inputevent', selector, { selector: selector }, _this14.misbehaves);
|
2443
|
+
}
|
2444
|
+
},
|
2445
|
+
|
2446
|
+
uninstall: function uninstall() {
|
2447
|
+
delete globals.inputEventPatched;
|
2448
|
+
$(document).off('.inputevent');
|
2449
|
+
}
|
2450
|
+
|
2451
|
+
});
|
2452
|
+
};
|
2453
|
+
|
2454
|
+
var inputevent = new InputEvent();
|
2455
|
+
|
2456
|
+
inputevent.install();
|
2457
|
+
|
2458
|
+
var parsley = Parsley;
|
2459
|
+
|
2460
|
+
return parsley;
|
2461
|
+
});
|
2462
|
+
//# sourceMappingURL=parsley.js.map
|