ratchet_design 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/ratchet/base/_form.scss +1 -1
- data/lib/ratchet_design/version.rb +1 -1
- data/public/assets/ratchet/{core-0.1.2.js → core-0.1.3.js} +2 -2
- data/public/assets/ratchet/{core-0.1.2.js.gz → core-0.1.3.js.gz} +0 -0
- data/public/assets/ratchet/{core-0.1.2.map.json → core-0.1.3.map.json} +1 -1
- data/public/assets/ratchet/{fonts-woff-0.1.2.css → fonts-woff-0.1.3.css} +0 -0
- data/public/assets/ratchet/{fonts-woff-0.1.2.css.gz → fonts-woff-0.1.3.css.gz} +0 -0
- data/public/assets/ratchet/{fonts-woff2-0.1.2.css → fonts-woff2-0.1.3.css} +0 -0
- data/public/assets/ratchet/{fonts-woff2-0.1.2.css.gz → fonts-woff2-0.1.3.css.gz} +0 -0
- metadata +9 -10
- data/public/assets/ratchet/core-0.1.20.js +0 -20472
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fc2311dc5080095eb03f2876cb7686e0794990d
|
4
|
+
data.tar.gz: ec3de307313bbfc214f314d2bb7e4fa711c14cc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78e33fe9a6155c349c6b881c495a2e8ac68a76d8e8e67a4edcb865e142b03ebfa94bd814e7d6e2159c05c100eed2cd4adf1257ad7a59bf01c4b1e32d64b7300d
|
7
|
+
data.tar.gz: ed6ea44d5c4e7b1d62cf0375fa1f9fe7f89c3e6d39e0a3e511aae628b7206debbbad7753184071f1467fed7331ef07f229e4860180adcb855de720b90bc77cb2
|
@@ -99,7 +99,7 @@ var validation=require("./lib/validation"),progressive=require("./lib/progressiv
|
|
99
99
|
},{"./lib/progressive":48,"./lib/validation":49}],48:[function(require,module,exports){
|
100
100
|
function reset(){formCallbacks={next:[]},registerdForms=[]}function newForm(e){function t(){return l[s]}function o(){return l[s+1]}function n(){return t()&&!t().disabled}function r(e){return n()?c(function(){r(e)}):void(o()&&(s+=1,e?Event.delay(a,e):a()))}function i(e){e?Event.delay(a,e):a()}function c(e){t().classList.remove("step-visited","arrived"),t().classList.add("departed"),Event.afterAnimation(t(),function(){f(),"function"==typeof e&&e()})}function a(){t().disabled=!1,t().classList.add("arrived");var e=t().querySelector("input:not([hidden])");e&&e.focus()}function f(){t().disabled=!0,t().classList.add("step-visited"),t().classList.remove("departed","arrived")}if(e){var l=toolbox.slice(e.querySelectorAll(".form-step")),s=-1;0!=l.length&&(l.forEach(function(e){e.disabled=!0}),r(),registerdForms.push(function(n){if(e==n.target&&!t().querySelector(":invalid")){o()&&n.preventDefault();var a=getCallbacks(e);a?(n.preventDefault(),c(function(){a(n,{fieldset:t(),form:e,forward:r,back:i,complete:!!o(),formData:toolbox.formData(t())})})):r()}}))}}function fire(e){registerdForms.forEach(function(t){t(e)})}function getCallbacks(e,t){t=t||"next";var o,n=[];return formCallbacks[t].forEach(function(t){(o=t(e))&&n.push(o)}),!!n.length&&function(){var e=toolbox.slice(arguments);n.forEach(function(t){t.apply(t,e)})}}function next(e,t){on(e,"next",t)}function on(e,t,o){if("object"==typeof t)for(type in t)on(e,type,t[type]);else if(formCallbacks[t]){var n=function(t){if(t==e)return o};formCallbacks[t].push(n)}}var toolbox=require("compose-toolbox"),Event=toolbox.event,Callback=toolbox.event.callback,formSelector="form.progressive",watching=!1,formCallbacks,registerdForms;Event.ready(function(){reset(),Event.bubbleFormEvents(),Event.on(document,"submit",formSelector,fire),Event.change(function(){reset(),toolbox.each(document.querySelectorAll(formSelector),function(e){newForm(e)})})}),module.exports={next:next,new:newForm};
|
101
101
|
},{"compose-toolbox":51}],49:[function(require,module,exports){
|
102
|
-
function supported(){return"function"==typeof document.createElement("input").checkValidity}function validateForm(e){var t=e.querySelector("input:invalid, textarea:invalid");return!t||(checkInput(t),showMessage(t),focus(t),!1)}function checkInput(e,t){var
|
102
|
+
function supported(){return"function"==typeof document.createElement("input").checkValidity}function validateForm(e){var t=e.querySelector("input:invalid, textarea:invalid, select:invalid");return!t||(checkInput(t),showMessage(t),focus(t),!1)}function checkInput(e,t){var a=statusEl(e),n=isValid(e),o=!n&&"input"==t;o&&e==document.activeElement?a.classList.remove("invalid","valid"):(a.classList.toggle("invalid",!n),a.classList.toggle("valid",n))}function isValid(e){return e.value.replace(/\s/g,"").length||(e.value=""),e.dataset.minWords&&checkCount(e,"min"),e.dataset.maxWords&&checkCount(e,"max"),e.checkValidity()}function checkCount(e,t){var a=e.dataset[t+"Words"],n=wordCount(e.value)<a,o="min"==t?"at least ":"no more than ",i="min"==t?!n:n,s="";e.value&&!i&&(s="Please write "+o+a+" words."),e.setCustomValidity(s)}function statusEl(e){return getClosest(e,"label")||e}function focus(e){e="none"!==e.style.display?e:e.nextSibling,e.focus()}function submit(e){validateForm(e.target)||(checkValidation.stop(),Event.delay(checkValidation.start,500),e.preventDefault())}function hideMessage(e){var t=getClosest(e,"form"),a=t.querySelector(".validation-message");a&&a.parentNode.removeChild(a)}function showMessage(e){hideMessage(e);var t=getClosest(e,"label"),a=e.dataset.message||e.validationMessage;t&&t.insertAdjacentHTML("beforeend",'<aside class="validation-message"><p>'+a+"</p></aside>")}var toolbox=require("compose-toolbox"),Event=toolbox.event,matches=toolbox.matches,getClosest=toolbox.getClosest,wordCount=toolbox.wordCount,textSelectors="[required]";Event.ready(function(){supported()&&(Event.bubbleFormEvents(),Event.on(document.body,{invalid:function(e){e.preventDefault()},submit:submit}),Event.on(document,"blur","[required]",checkValidation),Event.on(document,"input","[required]",Event.debounce(checkValidation,200)))});var checkValidation=Event.callback.new(function(e){hideMessage(e.target),checkInput(e.target,e.type)});module.exports={validate:validateForm};
|
103
103
|
},{"compose-toolbox":51}],50:[function(require,module,exports){
|
104
104
|
var classify=function(e){return"."+e.replace(/\s/g,".")},Loader={options:{className:"loader"},init:function(){return Loader.element()||document.body.insertAdjacentHTML("afterbegin",'<div class="'+Loader.options.className+'"></div>'),Loader.element()},element:function(){return document.querySelector(classify(Loader.options.className))},loading:function(e){Loader.show(e||"Hang tight…","loading")},success:function(e){Loader.show(e||"Got it!","success")},failure:function(e){Loader.show(e||"Hold up!","failure")},show:function(e,o){el=Loader.init(),el.textContent=e,el.className=Loader.options.className,el.classList.add(o)},remove:function(){var e=Loader.element();e.parentNode.removeChild(e)}};module.exports=Loader;
|
105
105
|
},{}],51:[function(require,module,exports){
|
@@ -130,4 +130,4 @@ function request(e,n,t){return"function"==typeof t?new e("GET",n).end(t):2==argu
|
|
130
130
|
});
|
131
131
|
|
132
132
|
|
133
|
-
//# sourceMappingURL=/assets/ratchet/core-0.1.
|
133
|
+
//# sourceMappingURL=/assets/ratchet/core-0.1.3.map.json
|
Binary file
|