formed.css
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.formed=e():t.formed=e()}(this,function(){return function(t){function e(r){if(i[r])return i[r].exports;var s=i[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.element.classList.remove(f.IS_FOCUSED)}function e(){o.call(this)}function i(t){this.element.classList.add(f.IS_FOCUSED)}function r(r){r.control.addEventListener("blur",t.bind(r)),r.control.addEventListener("change",e.bind(r)),r.control.addEventListener("focus",i.bind(r))}function s(){var t=this.control.disabled?"add":"remove";this.element.classList[t](f.IS_DISABLED)}function n(){var t=this.control.checked?"add":"remove";this.element.classList[t](f.IS_CHECKED)}function a(t,e){t.classList.add(f.IS_CUSTOM);var i=document.createElement("span");return i.classList.add(f.BOX),t.insertBefore(i,e.nextSibling),i}function o(){s.call(this),n.call(this)}function l(){this.control.checked=!0,o()}function d(){this.control.checked=!1,o()}function c(){this.control.disabled=!0,o()}function u(){this.control.disabled=!1,o()}function h(t){if(t&&1!==t.nodeType)throw new TypeError("Element passed in is not a HTML node.");var e=Object.create(E);return e.element=t,e.control=t.querySelector("."+f.CONTROL),e.label=t.querySelector("."+f.LABEL),e.box=a(e.element,e.control),r(e),o.call(e),e}var f={CHECKBOX:"Checkbox",CONTROL:"Checkbox-control",BOX:"Checkbox-box",LABEL:"Checkbox-label",IS_CHECKED:"is-checked",IS_CUSTOM:"is-custom",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused"},E={check:l,uncheck:d,disable:c,enable:u};return h}();e.default=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){return this.controlEl.disabled=!0,this.refreshState()}function e(){return this.controlEl.disabled=!1,this.refreshState()}function i(t){var e=Object.create(L);if(t&&1!==t.nodeType)throw new TypeError("Element passed in is not a HTML node.");return e.editorEl=t,e.controlEl=e.editorEl.querySelector("."+v.CONTROL),e.iconEl=e.editorEl.querySelector("."+v.ICON),e.labelEl=e.editorEl.querySelector("."+v.LABEL),n.call(e),u.call(e),e.refreshState(),e.controlEl.hasAttribute("autofocus")&&(e.editorEl.focus(),o.call(e)),e}function r(){this.controlEl.removeEventListener("blur",h.bind(this)),this.controlEl.removeEventListener("focus",f.bind(this)),this.controlEl.removeEventListener("input",E.bind(this)),this.controlEl.removeEventListener("reset",b.bind(this))}function s(){return l.call(this),a.call(this),o.call(this),d.call(this),c.call(this),this}function n(){this.controlEl.addEventListener("blur",h.bind(this)),this.controlEl.addEventListener("focus",f.bind(this)),this.controlEl.addEventListener("input",E.bind(this)),this.controlEl.addEventListener("reset",b.bind(this))}function a(){var t=this.controlEl.hasAttribute("disabled"),e=t?"add":"remove";this.editorEl.classList[e](v.IS_DISABLED)}function o(){var t=!!this.editorEl.querySelector(":focus"),e=t?"add":"remove";this.editorEl.classList[e](v.IS_FOCUSED)}function l(){var t=this.controlEl.value&&this.controlEl.value.length>0,e=t?"add":"remove";this.editorEl.classList[e](v.IS_DIRTY)}function d(){var t=this.controlEl.hasAttribute("readonly"),e=t?"add":"remove";this.editorEl.classList[e](v.IS_READONLY)}function c(){if(this.controlEl.validity){var t=this.controlEl.validity.valid,e=t?"remove":"add";this.editorEl.classList[e](v.IS_INVALID)}}function u(){this.controlEl&&this.controlEl.hasAttribute("placeholder")&&this.editorEl.classList.add(v.HAS_PLACEHOLDER)}function h(){this.editorEl.classList.remove(v.IS_FOCUSED)}function f(){this.editorEl.classList.add(v.IS_FOCUSED)}function E(){this.refreshState()}function b(){this.refreshState()}var v={CONTROL:"Editor-control",LABEL:"Editor-label",ICON:"Editor-icon",HAS_ICON:"has-icon",HAS_PLACEHOLDER:"has-placeholder",IS_DIRTY:"is-dirty",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused",IS_INVALID:"is-invalid",IS_READONLY:"is-readonly"},L={disable:t,enable:e,refreshState:s,destroy:r};return i}();e.default=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){return this.drawer&&this.drawer.classList.contains(h.isDrawerActiveClass)}function e(){return this.drawer&&this.element.classList.contains("Layout--drawerFixed")}function i(){this.drawer.classList.toggle(h.isDrawerActiveClass),this.mask.classList.toggle(h.isDrawerActiveClass),this.hasActiveDrawer()?(this.drawer.setAttribute("aria-hidden","false"),this.drawerBtn.setAttribute("aria-expanded","true")):(this.drawer.setAttribute("aria-hidden","true"),this.drawerBtn.setAttribute("aria-expanded","false"))}function r(t){var e=Object.create(E);return e.element=t,l.call(e),d.call(e),e.drawer&&c.call(e),e.breakpoint=window.matchMedia(h.breakpoint),a.call(e),o.call(e),e}function s(t){var e=f.SPACE,i=f.ENTER;if(t&&"keydown"===t.type){if(t.keyCode!==e&&t.keyCode!==i)return;t.preventDefault()}this.toggleDrawer()}function n(t){t.keyCode===f.ESCAPE&&this.hasActiveDrawer()&&this.toggleDrawer()}function a(){this.breakpoint.matches&&this.drawer?(this.drawer.setAttribute("aria-hidden",(!this.hasDrawerFixed()).toString()),this.drawerBtn.setAttribute("aria-expanded","false"),this.drawer.classList.remove(h.isDrawerActiveClass),this.mask.classList.remove(h.isDrawerActiveClass)):this.hasDrawerFixed()&&this.drawer.setAttribute("aria-hidden","true")}function o(){return this.drawer&&(this.drawerBtn.addEventListener("click",s.bind(this)),this.drawerBtn.addEventListener("keydown",s.bind(this)),this.drawer.addEventListener("keydown",n.bind(this)),this.mask.addEventListener("click",s.bind(this))),this.breakpoint.addListener(a.bind(this)),this}function l(){var t=document.createElement("div");t.classList.add("layout-absoluteViewport");var e=document.querySelector(":focus");return this.element.parentNode.insertBefore(t,this.element),this.element.parentNode.removeChild(this.element),t.appendChild(this.element),e&&e.focus(),this}function d(){for(var t=this.element.childNodes,e=t.length,i=0;i<e;i++){var r=t[i];r.classList&&r.classList.contains(h.headerClass)&&(this.header=r),r.classList&&r.classList.contains(h.drawerClass)&&(this.drawer=r),r.classList&&r.classList.contains(h.mainClass)&&(this.main=r)}return this}function c(){return this.drawerBtn=this.element.querySelector("."+h.drawerBtnClass),this.drawer.setAttribute("aria-hidden","true"),this.drawerBtn.setAttribute("aria-expanded","false"),this.drawerBtn.setAttribute("tabindex","0"),this.drawerBtn.setAttribute("type","button"),"button"!==this.drawerBtn.tagName.toLowerCase()&&this.drawerBtn.setAttribute("role","button"),u.call(this),this}function u(){return this.mask=document.createElement("div"),this.mask.classList.add(h.maskClass),this.element.appendChild(this.mask),this}var h={headerClass:"Layout-header",drawerClass:"Layout-drawer",drawerBtnClass:"Layout-header-menu",mainClass:"Layout-main",maskClass:"Layout-mask",isDrawerActiveClass:"is-active",breakpoint:"(min-width: 992px)"},f={ENTER:13,ESCAPE:27,SPACE:32},E={hasActiveDrawer:t,hasDrawerFixed:e,toggleDrawer:i};return r}();e.default=r},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var s=i(0),n=r(s),a=i(1),o=r(a),l=i(2),d=r(l);e.default={checkbox:n.default,editor:o.default,layout:d.default}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.formed=t():e.formed=t()}(this,function(){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.element.classList.remove(f.IS_FOCUSED)}function t(){o.call(this)}function i(e){this.element.classList.add(f.IS_FOCUSED)}function r(r){r.control.addEventListener("blur",e.bind(r)),r.control.addEventListener("change",t.bind(r)),r.control.addEventListener("focus",i.bind(r))}function n(){var e=this.control.disabled?"add":"remove";this.element.classList[e](f.IS_DISABLED)}function s(){var e=this.control.checked?"add":"remove";this.element.classList[e](f.IS_CHECKED)}function a(e,t){e.classList.add(f.IS_CUSTOM);var i=document.createElement("span");return i.classList.add(f.BOX),e.insertBefore(i,t.nextSibling),i}function o(){n.call(this),s.call(this)}function l(){this.control.checked=!0,o()}function d(){this.control.checked=!1,o()}function c(){this.control.disabled=!0,o()}function u(){this.control.disabled=!1,o()}function h(e){if(e&&1!==e.nodeType)throw new TypeError("Element passed in is not a HTML node.");var t=Object.create(E);return t.element=e,t.control=e.querySelector("."+f.CONTROL),t.label=e.querySelector("."+f.LABEL),t.box=a(t.element,t.control),r(t),o.call(t),t}var f={CHECKBOX:"Checkbox",CONTROL:"Checkbox-control",BOX:"Checkbox-box",LABEL:"Checkbox-label",IS_CHECKED:"is-checked",IS_CUSTOM:"is-custom",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused"},E={check:l,uncheck:d,disable:c,enable:u};return h}();t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){return this.controlEl.disabled=!0,this.refreshState()}function t(){return this.controlEl.disabled=!1,this.refreshState()}function i(e){var t=Object.create(v);if(e&&1!==e.nodeType)throw new TypeError("Element passed in is not a HTML node.");return t.editorEl=e,t.controlEl=t.editorEl.querySelector("."+b.CONTROL),t.iconEl=t.editorEl.querySelector("."+b.ICON),t.labelEl=t.editorEl.querySelector("."+b.LABEL),s.call(t),u.call(t),t.refreshState(),t.controlEl.hasAttribute("autofocus")&&(t.editorEl.focus(),o.call(t)),t}function r(){this.controlEl.removeEventListener("blur",h.bind(this)),this.controlEl.removeEventListener("focus",f.bind(this)),this.controlEl.removeEventListener("input",E.bind(this)),this.controlEl.removeEventListener("reset",L.bind(this))}function n(){return l.call(this),a.call(this),o.call(this),d.call(this),c.call(this),this}function s(){this.controlEl.addEventListener("blur",h.bind(this)),this.controlEl.addEventListener("focus",f.bind(this)),this.controlEl.addEventListener("input",E.bind(this)),this.controlEl.addEventListener("reset",L.bind(this))}function a(){var e=this.controlEl.hasAttribute("disabled"),t=e?"add":"remove";this.editorEl.classList[t](b.IS_DISABLED)}function o(){var e=!!this.editorEl.querySelector(":focus"),t=e?"add":"remove";this.editorEl.classList[t](b.IS_FOCUSED)}function l(){var e=this.controlEl.value&&this.controlEl.value.length>0,t=e?"add":"remove";this.editorEl.classList[t](b.IS_DIRTY)}function d(){var e=this.controlEl.hasAttribute("readonly"),t=e?"add":"remove";this.editorEl.classList[t](b.IS_READONLY)}function c(){if(this.controlEl.validity){var e=this.controlEl.validity.valid,t=e?"remove":"add";this.editorEl.classList[t](b.IS_INVALID)}}function u(){this.controlEl&&this.controlEl.hasAttribute("placeholder")&&this.editorEl.classList.add(b.HAS_PLACEHOLDER)}function h(){this.editorEl.classList.remove(b.IS_FOCUSED)}function f(){this.editorEl.classList.add(b.IS_FOCUSED)}function E(){this.refreshState()}function L(){this.refreshState()}var b={CONTROL:"Editor-control",LABEL:"Editor-label",ICON:"Editor-icon",HAS_ICON:"has-icon",HAS_PLACEHOLDER:"has-placeholder",IS_DIRTY:"is-dirty",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused",IS_INVALID:"is-invalid",IS_READONLY:"is-readonly"},v={disable:e,enable:t,refreshState:n,destroy:r};return i}();t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){return this.drawer&&this.drawer.classList.contains(h.isDrawerActiveClass)}function t(){return this.drawer&&this.element.classList.contains("Layout--drawerFixed")}function i(){this.drawer.classList.toggle(h.isDrawerActiveClass),this.mask.classList.toggle(h.isDrawerActiveClass),this.hasActiveDrawer()?(this.drawer.setAttribute("aria-hidden","false"),this.drawerBtn.setAttribute("aria-expanded","true")):(this.drawer.setAttribute("aria-hidden","true"),this.drawerBtn.setAttribute("aria-expanded","false"))}function r(e){var t=Object.create(E);return t.element=e,l.call(t),d.call(t),t.drawer&&c.call(t),t.breakpoint=window.matchMedia(h.breakpoint),a.call(t),o.call(t),t}function n(e){var t=f.SPACE,i=f.ENTER;if(e&&"keydown"===e.type){if(e.keyCode!==t&&e.keyCode!==i)return;e.preventDefault()}this.toggleDrawer()}function s(e){e.keyCode===f.ESCAPE&&this.hasActiveDrawer()&&this.toggleDrawer()}function a(){this.breakpoint.matches&&this.drawer?(this.drawer.setAttribute("aria-hidden",(!this.hasDrawerFixed()).toString()),this.drawerBtn.setAttribute("aria-expanded","false"),this.drawer.classList.remove(h.isDrawerActiveClass),this.mask.classList.remove(h.isDrawerActiveClass)):this.hasDrawerFixed()&&this.drawer.setAttribute("aria-hidden","true")}function o(){return this.drawer&&(this.drawerBtn.addEventListener("click",n.bind(this)),this.drawerBtn.addEventListener("keydown",n.bind(this)),this.drawer.addEventListener("keydown",s.bind(this)),this.mask.addEventListener("click",n.bind(this))),this.breakpoint.addListener(a.bind(this)),this}function l(){var e=document.createElement("div");e.classList.add("layout-absoluteViewport");var t=document.querySelector(":focus");return this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element),e.appendChild(this.element),t&&t.focus(),this}function d(){for(var e=this.element.childNodes,t=e.length,i=0;i<t;i++){var r=e[i];r.classList&&r.classList.contains(h.headerClass)&&(this.header=r),r.classList&&r.classList.contains(h.drawerClass)&&(this.drawer=r),r.classList&&r.classList.contains(h.mainClass)&&(this.main=r)}return this}function c(){return this.drawerBtn=this.element.querySelector("."+h.drawerBtnClass),this.drawer.setAttribute("aria-hidden","true"),this.drawerBtn.setAttribute("aria-expanded","false"),this.drawerBtn.setAttribute("tabindex","0"),this.drawerBtn.setAttribute("type","button"),"button"!==this.drawerBtn.tagName.toLowerCase()&&this.drawerBtn.setAttribute("role","button"),u.call(this),this}function u(){return this.mask=document.createElement("div"),this.mask.classList.add(h.maskClass),this.element.appendChild(this.mask),this}var h={headerClass:"Layout-header",drawerClass:"Layout-drawer",drawerBtnClass:"Layout-header-menu",mainClass:"Layout-main",maskClass:"Layout-mask",isDrawerActiveClass:"is-active",breakpoint:"(min-width: 992px)"},f={ENTER:13,ESCAPE:27,SPACE:32},E={hasActiveDrawer:e,hasDrawerFixed:t,toggleDrawer:i};return r}();t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.element.classList.remove(L.IS_FOCUSED)}function t(){this.radioSet.forEach(function(e){var t=new Event("radio:update");e.dispatchEvent(t)})}function i(e){this.element.classList.add(L.IS_FOCUSED)}function r(){this.element.classList.add(L.IS_PRESSED)}function n(){this.element.classList.remove(L.IS_PRESSED)}function s(s){s.control.addEventListener("blur",e.bind(s)),s.control.addEventListener("change",t.bind(s)),s.control.addEventListener("focus",i.bind(s)),s.element.addEventListener("radio:update",d.bind(s)),s.element.addEventListener("mousedown",r.bind(s)),s.element.addEventListener("mouseup",n.bind(s))}function a(){var e=this.control.disabled?"add":"remove";this.element.classList[e](L.IS_DISABLED)}function o(){var e=this.control.checked?"add":"remove";this.element.classList[e](L.IS_CHECKED)}function l(e,t){e.classList.add(L.IS_CUSTOM);var i=document.createElement("span");return i.classList.add(L.CIRCLE),e.insertBefore(i,t.nextSibling),i}function d(){a.call(this),o.call(this)}function c(){this.control.checked=!0,d()}function u(){this.control.checked=!1,d()}function h(){this.control.disabled=!0,d()}function f(){this.control.disabled=!1,d()}function E(e){if(e&&1!==e.nodeType)throw new TypeError("Element passed in is not a HTML node.");var t=Object.create(b);return t.element=e,t.control=e.querySelector("."+L.CONTROL),t.label=e.querySelector("."+L.LABEL),t.circle=l(t.element,t.control),t.radioSet=Array.from(e.parentNode.getElementsByClassName(L.RADIO)),s(t),d.call(t),t}var L={RADIO:"Radio",CONTROL:"Radio-control",CIRCLE:"Radio-circle",LABEL:"Radio-label",IS_CHECKED:"is-checked",IS_CUSTOM:"is-custom",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused",IS_PRESSED:"is-pressed"},b={check:c,uncheck:u,disable:h,enable:f};return E}();t.default=r},function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),s=r(n),a=i(1),o=r(a),l=i(2),d=r(l),c=i(3),u=r(c);t.default={checkbox:s.default,editor:o.default,layout:d.default,radio:u.default}}])}); | ||
//# sourceMappingURL=formed.min.js.map |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.formed=e():t.formed=e()}(this,function(){return function(t){function e(r){if(i[r])return i[r].exports;var s=i[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this.element.classList.remove(f.IS_FOCUSED)}function e(){o.call(this)}function i(t){this.element.classList.add(f.IS_FOCUSED)}function r(r){r.control.addEventListener("blur",t.bind(r)),r.control.addEventListener("change",e.bind(r)),r.control.addEventListener("focus",i.bind(r))}function s(){var t=this.control.disabled?"add":"remove";this.element.classList[t](f.IS_DISABLED)}function n(){var t=this.control.checked?"add":"remove";this.element.classList[t](f.IS_CHECKED)}function a(t,e){t.classList.add(f.IS_CUSTOM);var i=document.createElement("span");return i.classList.add(f.BOX),t.insertBefore(i,e.nextSibling),i}function o(){s.call(this),n.call(this)}function l(){this.control.checked=!0,o()}function d(){this.control.checked=!1,o()}function c(){this.control.disabled=!0,o()}function u(){this.control.disabled=!1,o()}function h(t){if(t&&1!==t.nodeType)throw new TypeError("Element passed in is not a HTML node.");var e=Object.create(E);return e.element=t,e.control=t.querySelector("."+f.CONTROL),e.label=t.querySelector("."+f.LABEL),e.box=a(e.element,e.control),r(e),o.call(e),e}var f={CHECKBOX:"Checkbox",CONTROL:"Checkbox-control",BOX:"Checkbox-box",LABEL:"Checkbox-label",IS_CHECKED:"is-checked",IS_CUSTOM:"is-custom",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused"},E={check:l,uncheck:d,disable:c,enable:u};return h}();e.default=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){return this.controlEl.disabled=!0,this.refreshState()}function e(){return this.controlEl.disabled=!1,this.refreshState()}function i(t){var e=Object.create(L);if(t&&1!==t.nodeType)throw new TypeError("Element passed in is not a HTML node.");return e.editorEl=t,e.controlEl=e.editorEl.querySelector("."+v.CONTROL),e.iconEl=e.editorEl.querySelector("."+v.ICON),e.labelEl=e.editorEl.querySelector("."+v.LABEL),n.call(e),u.call(e),e.refreshState(),e.controlEl.hasAttribute("autofocus")&&(e.editorEl.focus(),o.call(e)),e}function r(){this.controlEl.removeEventListener("blur",h.bind(this)),this.controlEl.removeEventListener("focus",f.bind(this)),this.controlEl.removeEventListener("input",E.bind(this)),this.controlEl.removeEventListener("reset",b.bind(this))}function s(){return l.call(this),a.call(this),o.call(this),d.call(this),c.call(this),this}function n(){this.controlEl.addEventListener("blur",h.bind(this)),this.controlEl.addEventListener("focus",f.bind(this)),this.controlEl.addEventListener("input",E.bind(this)),this.controlEl.addEventListener("reset",b.bind(this))}function a(){var t=this.controlEl.hasAttribute("disabled"),e=t?"add":"remove";this.editorEl.classList[e](v.IS_DISABLED)}function o(){var t=!!this.editorEl.querySelector(":focus"),e=t?"add":"remove";this.editorEl.classList[e](v.IS_FOCUSED)}function l(){var t=this.controlEl.value&&this.controlEl.value.length>0,e=t?"add":"remove";this.editorEl.classList[e](v.IS_DIRTY)}function d(){var t=this.controlEl.hasAttribute("readonly"),e=t?"add":"remove";this.editorEl.classList[e](v.IS_READONLY)}function c(){if(this.controlEl.validity){var t=this.controlEl.validity.valid,e=t?"remove":"add";this.editorEl.classList[e](v.IS_INVALID)}}function u(){this.controlEl&&this.controlEl.hasAttribute("placeholder")&&this.editorEl.classList.add(v.HAS_PLACEHOLDER)}function h(){this.editorEl.classList.remove(v.IS_FOCUSED)}function f(){this.editorEl.classList.add(v.IS_FOCUSED)}function E(){this.refreshState()}function b(){this.refreshState()}var v={CONTROL:"Editor-control",LABEL:"Editor-label",ICON:"Editor-icon",HAS_ICON:"has-icon",HAS_PLACEHOLDER:"has-placeholder",IS_DIRTY:"is-dirty",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused",IS_INVALID:"is-invalid",IS_READONLY:"is-readonly"},L={disable:t,enable:e,refreshState:s,destroy:r};return i}();e.default=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){return this.drawer&&this.drawer.classList.contains(h.isDrawerActiveClass)}function e(){return this.drawer&&this.element.classList.contains("Layout--drawerFixed")}function i(){this.drawer.classList.toggle(h.isDrawerActiveClass),this.mask.classList.toggle(h.isDrawerActiveClass),this.hasActiveDrawer()?(this.drawer.setAttribute("aria-hidden","false"),this.drawerBtn.setAttribute("aria-expanded","true")):(this.drawer.setAttribute("aria-hidden","true"),this.drawerBtn.setAttribute("aria-expanded","false"))}function r(t){var e=Object.create(E);return e.element=t,l.call(e),d.call(e),e.drawer&&c.call(e),e.breakpoint=window.matchMedia(h.breakpoint),a.call(e),o.call(e),e}function s(t){var e=f.SPACE,i=f.ENTER;if(t&&"keydown"===t.type){if(t.keyCode!==e&&t.keyCode!==i)return;t.preventDefault()}this.toggleDrawer()}function n(t){t.keyCode===f.ESCAPE&&this.hasActiveDrawer()&&this.toggleDrawer()}function a(){this.breakpoint.matches&&this.drawer?(this.drawer.setAttribute("aria-hidden",(!this.hasDrawerFixed()).toString()),this.drawerBtn.setAttribute("aria-expanded","false"),this.drawer.classList.remove(h.isDrawerActiveClass),this.mask.classList.remove(h.isDrawerActiveClass)):this.hasDrawerFixed()&&this.drawer.setAttribute("aria-hidden","true")}function o(){return this.drawer&&(this.drawerBtn.addEventListener("click",s.bind(this)),this.drawerBtn.addEventListener("keydown",s.bind(this)),this.drawer.addEventListener("keydown",n.bind(this)),this.mask.addEventListener("click",s.bind(this))),this.breakpoint.addListener(a.bind(this)),this}function l(){var t=document.createElement("div");t.classList.add("layout-absoluteViewport");var e=document.querySelector(":focus");return this.element.parentNode.insertBefore(t,this.element),this.element.parentNode.removeChild(this.element),t.appendChild(this.element),e&&e.focus(),this}function d(){for(var t=this.element.childNodes,e=t.length,i=0;i<e;i++){var r=t[i];r.classList&&r.classList.contains(h.headerClass)&&(this.header=r),r.classList&&r.classList.contains(h.drawerClass)&&(this.drawer=r),r.classList&&r.classList.contains(h.mainClass)&&(this.main=r)}return this}function c(){return this.drawerBtn=this.element.querySelector("."+h.drawerBtnClass),this.drawer.setAttribute("aria-hidden","true"),this.drawerBtn.setAttribute("aria-expanded","false"),this.drawerBtn.setAttribute("tabindex","0"),this.drawerBtn.setAttribute("type","button"),"button"!==this.drawerBtn.tagName.toLowerCase()&&this.drawerBtn.setAttribute("role","button"),u.call(this),this}function u(){return this.mask=document.createElement("div"),this.mask.classList.add(h.maskClass),this.element.appendChild(this.mask),this}var h={headerClass:"Layout-header",drawerClass:"Layout-drawer",drawerBtnClass:"Layout-header-menu",mainClass:"Layout-main",maskClass:"Layout-mask",isDrawerActiveClass:"is-active",breakpoint:"(min-width: 992px)"},f={ENTER:13,ESCAPE:27,SPACE:32},E={hasActiveDrawer:t,hasDrawerFixed:e,toggleDrawer:i};return r}();e.default=r},function(t,e,i){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var s=i(0),n=r(s),a=i(1),o=r(a),l=i(2),d=r(l);e.default={checkbox:n.default,editor:o.default,layout:d.default}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.formed=t():e.formed=t()}(this,function(){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.i=function(e){return e},t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.element.classList.remove(f.IS_FOCUSED)}function t(){o.call(this)}function i(e){this.element.classList.add(f.IS_FOCUSED)}function r(r){r.control.addEventListener("blur",e.bind(r)),r.control.addEventListener("change",t.bind(r)),r.control.addEventListener("focus",i.bind(r))}function n(){var e=this.control.disabled?"add":"remove";this.element.classList[e](f.IS_DISABLED)}function s(){var e=this.control.checked?"add":"remove";this.element.classList[e](f.IS_CHECKED)}function a(e,t){e.classList.add(f.IS_CUSTOM);var i=document.createElement("span");return i.classList.add(f.BOX),e.insertBefore(i,t.nextSibling),i}function o(){n.call(this),s.call(this)}function l(){this.control.checked=!0,o()}function d(){this.control.checked=!1,o()}function c(){this.control.disabled=!0,o()}function u(){this.control.disabled=!1,o()}function h(e){if(e&&1!==e.nodeType)throw new TypeError("Element passed in is not a HTML node.");var t=Object.create(E);return t.element=e,t.control=e.querySelector("."+f.CONTROL),t.label=e.querySelector("."+f.LABEL),t.box=a(t.element,t.control),r(t),o.call(t),t}var f={CHECKBOX:"Checkbox",CONTROL:"Checkbox-control",BOX:"Checkbox-box",LABEL:"Checkbox-label",IS_CHECKED:"is-checked",IS_CUSTOM:"is-custom",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused"},E={check:l,uncheck:d,disable:c,enable:u};return h}();t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){return this.controlEl.disabled=!0,this.refreshState()}function t(){return this.controlEl.disabled=!1,this.refreshState()}function i(e){var t=Object.create(v);if(e&&1!==e.nodeType)throw new TypeError("Element passed in is not a HTML node.");return t.editorEl=e,t.controlEl=t.editorEl.querySelector("."+b.CONTROL),t.iconEl=t.editorEl.querySelector("."+b.ICON),t.labelEl=t.editorEl.querySelector("."+b.LABEL),s.call(t),u.call(t),t.refreshState(),t.controlEl.hasAttribute("autofocus")&&(t.editorEl.focus(),o.call(t)),t}function r(){this.controlEl.removeEventListener("blur",h.bind(this)),this.controlEl.removeEventListener("focus",f.bind(this)),this.controlEl.removeEventListener("input",E.bind(this)),this.controlEl.removeEventListener("reset",L.bind(this))}function n(){return l.call(this),a.call(this),o.call(this),d.call(this),c.call(this),this}function s(){this.controlEl.addEventListener("blur",h.bind(this)),this.controlEl.addEventListener("focus",f.bind(this)),this.controlEl.addEventListener("input",E.bind(this)),this.controlEl.addEventListener("reset",L.bind(this))}function a(){var e=this.controlEl.hasAttribute("disabled"),t=e?"add":"remove";this.editorEl.classList[t](b.IS_DISABLED)}function o(){var e=!!this.editorEl.querySelector(":focus"),t=e?"add":"remove";this.editorEl.classList[t](b.IS_FOCUSED)}function l(){var e=this.controlEl.value&&this.controlEl.value.length>0,t=e?"add":"remove";this.editorEl.classList[t](b.IS_DIRTY)}function d(){var e=this.controlEl.hasAttribute("readonly"),t=e?"add":"remove";this.editorEl.classList[t](b.IS_READONLY)}function c(){if(this.controlEl.validity){var e=this.controlEl.validity.valid,t=e?"remove":"add";this.editorEl.classList[t](b.IS_INVALID)}}function u(){this.controlEl&&this.controlEl.hasAttribute("placeholder")&&this.editorEl.classList.add(b.HAS_PLACEHOLDER)}function h(){this.editorEl.classList.remove(b.IS_FOCUSED)}function f(){this.editorEl.classList.add(b.IS_FOCUSED)}function E(){this.refreshState()}function L(){this.refreshState()}var b={CONTROL:"Editor-control",LABEL:"Editor-label",ICON:"Editor-icon",HAS_ICON:"has-icon",HAS_PLACEHOLDER:"has-placeholder",IS_DIRTY:"is-dirty",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused",IS_INVALID:"is-invalid",IS_READONLY:"is-readonly"},v={disable:e,enable:t,refreshState:n,destroy:r};return i}();t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){return this.drawer&&this.drawer.classList.contains(h.isDrawerActiveClass)}function t(){return this.drawer&&this.element.classList.contains("Layout--drawerFixed")}function i(){this.drawer.classList.toggle(h.isDrawerActiveClass),this.mask.classList.toggle(h.isDrawerActiveClass),this.hasActiveDrawer()?(this.drawer.setAttribute("aria-hidden","false"),this.drawerBtn.setAttribute("aria-expanded","true")):(this.drawer.setAttribute("aria-hidden","true"),this.drawerBtn.setAttribute("aria-expanded","false"))}function r(e){var t=Object.create(E);return t.element=e,l.call(t),d.call(t),t.drawer&&c.call(t),t.breakpoint=window.matchMedia(h.breakpoint),a.call(t),o.call(t),t}function n(e){var t=f.SPACE,i=f.ENTER;if(e&&"keydown"===e.type){if(e.keyCode!==t&&e.keyCode!==i)return;e.preventDefault()}this.toggleDrawer()}function s(e){e.keyCode===f.ESCAPE&&this.hasActiveDrawer()&&this.toggleDrawer()}function a(){this.breakpoint.matches&&this.drawer?(this.drawer.setAttribute("aria-hidden",(!this.hasDrawerFixed()).toString()),this.drawerBtn.setAttribute("aria-expanded","false"),this.drawer.classList.remove(h.isDrawerActiveClass),this.mask.classList.remove(h.isDrawerActiveClass)):this.hasDrawerFixed()&&this.drawer.setAttribute("aria-hidden","true")}function o(){return this.drawer&&(this.drawerBtn.addEventListener("click",n.bind(this)),this.drawerBtn.addEventListener("keydown",n.bind(this)),this.drawer.addEventListener("keydown",s.bind(this)),this.mask.addEventListener("click",n.bind(this))),this.breakpoint.addListener(a.bind(this)),this}function l(){var e=document.createElement("div");e.classList.add("layout-absoluteViewport");var t=document.querySelector(":focus");return this.element.parentNode.insertBefore(e,this.element),this.element.parentNode.removeChild(this.element),e.appendChild(this.element),t&&t.focus(),this}function d(){for(var e=this.element.childNodes,t=e.length,i=0;i<t;i++){var r=e[i];r.classList&&r.classList.contains(h.headerClass)&&(this.header=r),r.classList&&r.classList.contains(h.drawerClass)&&(this.drawer=r),r.classList&&r.classList.contains(h.mainClass)&&(this.main=r)}return this}function c(){return this.drawerBtn=this.element.querySelector("."+h.drawerBtnClass),this.drawer.setAttribute("aria-hidden","true"),this.drawerBtn.setAttribute("aria-expanded","false"),this.drawerBtn.setAttribute("tabindex","0"),this.drawerBtn.setAttribute("type","button"),"button"!==this.drawerBtn.tagName.toLowerCase()&&this.drawerBtn.setAttribute("role","button"),u.call(this),this}function u(){return this.mask=document.createElement("div"),this.mask.classList.add(h.maskClass),this.element.appendChild(this.mask),this}var h={headerClass:"Layout-header",drawerClass:"Layout-drawer",drawerBtnClass:"Layout-header-menu",mainClass:"Layout-main",maskClass:"Layout-mask",isDrawerActiveClass:"is-active",breakpoint:"(min-width: 992px)"},f={ENTER:13,ESCAPE:27,SPACE:32},E={hasActiveDrawer:e,hasDrawerFixed:t,toggleDrawer:i};return r}();t.default=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.element.classList.remove(L.IS_FOCUSED)}function t(){this.radioSet.forEach(function(e){var t=new Event("radio:update");e.dispatchEvent(t)})}function i(e){this.element.classList.add(L.IS_FOCUSED)}function r(){this.element.classList.add(L.IS_PRESSED)}function n(){this.element.classList.remove(L.IS_PRESSED)}function s(s){s.control.addEventListener("blur",e.bind(s)),s.control.addEventListener("change",t.bind(s)),s.control.addEventListener("focus",i.bind(s)),s.element.addEventListener("radio:update",d.bind(s)),s.element.addEventListener("mousedown",r.bind(s)),s.element.addEventListener("mouseup",n.bind(s))}function a(){var e=this.control.disabled?"add":"remove";this.element.classList[e](L.IS_DISABLED)}function o(){var e=this.control.checked?"add":"remove";this.element.classList[e](L.IS_CHECKED)}function l(e,t){e.classList.add(L.IS_CUSTOM);var i=document.createElement("span");return i.classList.add(L.CIRCLE),e.insertBefore(i,t.nextSibling),i}function d(){a.call(this),o.call(this)}function c(){this.control.checked=!0,d()}function u(){this.control.checked=!1,d()}function h(){this.control.disabled=!0,d()}function f(){this.control.disabled=!1,d()}function E(e){if(e&&1!==e.nodeType)throw new TypeError("Element passed in is not a HTML node.");var t=Object.create(b);return t.element=e,t.control=e.querySelector("."+L.CONTROL),t.label=e.querySelector("."+L.LABEL),t.circle=l(t.element,t.control),t.radioSet=Array.from(e.parentNode.getElementsByClassName(L.RADIO)),s(t),d.call(t),t}var L={RADIO:"Radio",CONTROL:"Radio-control",CIRCLE:"Radio-circle",LABEL:"Radio-label",IS_CHECKED:"is-checked",IS_CUSTOM:"is-custom",IS_DISABLED:"is-disabled",IS_FOCUSED:"is-focused",IS_PRESSED:"is-pressed"},b={check:c,uncheck:u,disable:h,enable:f};return E}();t.default=r},function(e,t,i){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),s=r(n),a=i(1),o=r(a),l=i(2),d=r(l),c=i(3),u=r(c);t.default={checkbox:s.default,editor:o.default,layout:d.default,radio:u.default}}])}); | ||
//# sourceMappingURL=formed.min.js.map |
{ | ||
"name": "formed.css", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Formed solutions visual style and component-based library.", | ||
@@ -5,0 +5,0 @@ "style": "dist/css/formed.css", |
import checkbox from './components/checkbox'; | ||
import editor from './components/editor'; | ||
import layout from './components/layout'; | ||
import radio from './components/radio'; | ||
@@ -8,3 +9,4 @@ export default { | ||
editor, | ||
layout | ||
layout, | ||
radio | ||
}; |
@@ -20,3 +20,4 @@ const { join } = require('path'); | ||
editor: `${COMPONENTS}/editor`, | ||
layout: `${COMPONENTS}/layout` | ||
layout: `${COMPONENTS}/layout`, | ||
radio: `${COMPONENTS}/radio` | ||
}, | ||
@@ -23,0 +24,0 @@ output: { |
@@ -21,3 +21,4 @@ const webpack = require('webpack'); | ||
editor: `${COMPONENTS}/editor`, | ||
layout: `${COMPONENTS}/layout` | ||
layout: `${COMPONENTS}/layout`, | ||
radio: `${COMPONENTS}/radio` | ||
}, | ||
@@ -24,0 +25,0 @@ output: { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
991717
126
1625