New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cfpb/cfpb-design-system

Package Overview
Dependencies
Maintainers
8
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cfpb/cfpb-design-system - npm Package Compare versions

Comparing version 0.7.10 to 0.8.0

2

cfpb-design-system.js

@@ -1,1 +0,1 @@

!function(){var t,e,n={852:function(t){"use strict";function e(t){this.listenerMap=[{},{}],t&&this.root(t),this.handle=e.prototype.handle.bind(this),this._removedListeners=[]}t.exports=e,e.prototype.root=function(t){var e,n=this.listenerMap;if(this.rootElement){for(e in n[1])n[1].hasOwnProperty(e)&&this.rootElement.removeEventListener(e,this.handle,!0);for(e in n[0])n[0].hasOwnProperty(e)&&this.rootElement.removeEventListener(e,this.handle,!1)}if(!t||!t.addEventListener)return this.rootElement&&delete this.rootElement,this;for(e in this.rootElement=t,n[1])n[1].hasOwnProperty(e)&&this.rootElement.addEventListener(e,this.handle,!0);for(e in n[0])n[0].hasOwnProperty(e)&&this.rootElement.addEventListener(e,this.handle,!1);return this},e.prototype.captureForType=function(t){return-1!==["blur","error","focus","load","resize","scroll"].indexOf(t)},e.prototype.on=function(t,e,o,a){var l,c,h,u;if(!t)throw new TypeError("Invalid event type: "+t);if("function"==typeof e&&(a=o,o=e,e=null),void 0===a&&(a=this.captureForType(t)),"function"!=typeof o)throw new TypeError("Handler must be a type of Function");return l=this.rootElement,(c=this.listenerMap[a?1:0])[t]||(l&&l.addEventListener(t,this.handle,a),c[t]=[]),e?/^[a-z]+$/i.test(e)?(u=e,h=i):/^#[a-z0-9\-_]+$/i.test(e)?(u=e.slice(1),h=r):(u=e,h=n):(u=null,h=s.bind(this)),c[t].push({selector:e,handler:o,matcher:h,matcherParam:u}),this},e.prototype.off=function(t,e,n,i){var s,r,o,a,l;if("function"==typeof e&&(i=n,n=e,e=null),void 0===i)return this.off(t,e,n,!0),this.off(t,e,n,!1),this;if(o=this.listenerMap[i?1:0],!t){for(l in o)o.hasOwnProperty(l)&&this.off(l,e,n);return this}if(!(a=o[t])||!a.length)return this;for(s=a.length-1;s>=0;s--)r=a[s],e&&e!==r.selector||n&&n!==r.handler||(this._removedListeners.push(r),a.splice(s,1));return a.length||(delete o[t],this.rootElement&&this.rootElement.removeEventListener(t,this.handle,i)),this},e.prototype.handle=function(t){var e,n,i,s,r,o=t.type,a=[],l="ftLabsDelegateIgnore";if(!0!==t[l]){switch(3===(r=t.target).nodeType&&(r=r.parentNode),r.correspondingUseElement&&(r=r.correspondingUseElement),i=this.rootElement,t.eventPhase||(t.target!==t.currentTarget?3:2)){case 1:a=this.listenerMap[1][o];break;case 2:this.listenerMap[0]&&this.listenerMap[0][o]&&(a=a.concat(this.listenerMap[0][o])),this.listenerMap[1]&&this.listenerMap[1][o]&&(a=a.concat(this.listenerMap[1][o]));break;case 3:a=this.listenerMap[0][o]}var c,h=[];for(n=a.length;r&&n;){for(e=0;e<n&&(s=a[e]);e++)r.tagName&&["button","input","select","textarea"].indexOf(r.tagName.toLowerCase())>-1&&r.hasAttribute("disabled")?h=[]:s.matcher.call(r,s.matcherParam,r)&&h.push([t,r,s]);if(r===i)break;if(n=a.length,(r=r.parentElement||r.parentNode)instanceof HTMLDocument)break}for(e=0;e<h.length;e++)if(!(this._removedListeners.indexOf(h[e][2])>-1)&&!1===this.fire.apply(this,h[e])){h[e][0][l]=!0,h[e][0].preventDefault(),c=!1;break}return c}},e.prototype.fire=function(t,e,n){return n.handler.call(e,t,e)};var n=function(t){if(t){var e=t.prototype;return e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector}}(Element);function i(t,e){return t.toLowerCase()===e.tagName.toLowerCase()}function s(t,e){return this.rootElement===window?e===document||e===document.documentElement||e===window:this.rootElement===e}function r(t,e){return t===e.id}e.prototype.destroy=function(){this.off(),this.root()}},161:function(t,e,n){"use strict";var i=n(852);t.exports=function(t){return new i(t)},t.exports.Delegate=i},186:function(t,e,n){"use strict";n.d(e,{Z:function(){return p}});var i=n(752);function s(t,e){if(!t)return!1;var n=t.getAttribute(i.kQ);return!!n&&(n=n.split(" ")).indexOf(e)>-1}var r=i.uJ+"atomic_init";function o(t){return!s(t,r)&&(function(t,e){if(-1!==e.indexOf(" ")){var n=i.kQ+" values cannot contain spaces!";throw new Error(n)}var s=t.getAttribute(i.kQ);null!==s&&(e=s+" "+e),t.setAttribute(i.kQ,e)}(t,r),!0)}function a(t){return"[object Object]"===Object.prototype.toString.call(t)}function l(t){t=t||{};for(var e=1,n=arguments.length;e<n;e++){var i=arguments[e]||{},s=void 0;for(s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var r=i[s];a(r)?l(t[s]||(t[s]={}),r):t[s]=r}}return t}var c=n(147),h=n(291),u=n(161).Delegate;function d(t,e){this.element=t,this.initializers=[],this.uId=this.uniqueId("ac"),l(this,e),this.processModifiers(),this.ensureElement(),this.setCachedElements(),this.initializers.push(this.initialize)}l(d.prototype,new c.Z,{init:function(){return this.initializers.forEach((function(t){h.Z.isFunction(t)&&t.apply(this,arguments)}),this),this.dispatchEvent("component:initialized"),this},processModifiers:function(){this.modifiers&&this.modifiers.forEach((function(t){var e=t.ui.base.substring(1);this.element.classList.contains(e)&&(t.initialize&&(this.initializers.push(t.initialize),delete t.initialize),l(this,t))}),this)},render:function(){return this},ensureElement:function(){if(this.element)this.setElement(this.element);else{var t=l({},this.attributes);t.id=this.id||this.u_id,this.className&&(t.class=this.className),this.setElement(document.createElement("div")),this.setElementAttributes(t)}o(this.element)},setElement:function(t){return this.element&&this.undelegateEvents(),this.element=t,this.delegateEvents(),this},setCachedElements:function(){var t,e,n=l({},this.ui);for(t in n)n.hasOwnProperty(t)&&(1===(e=this.element.querySelectorAll(n[t])).length?n[t]=e[0]:e.length>1?n[t]=e:n[t]=null);return this.ui=n,n},destroy:function(){return this.element&&(this.element.parentNode.removeChild(this.element),this.element.view&&delete this.element.view,delete this.element),this.undelegateEvents(),this.dispatchEvent("component:destroyed"),!0},setElementAttributes:function(t){var e;for(e in t)t.hasOwnProperty(e)&&this.element.setAttribute(e,t[e])},delegateEvents:function(t){var e,n,i,s=/^(\S+)\s*(.*)$/;if(!(t=t||(t=this.events)))return this;for(e in this.undelegateEvents(),this._delegate=new u(this.element),t)({}).hasOwnProperty.call(t,e)&&(n=t[e],h.Z.isFunction(this[n])&&(n=this[n]),n&&(i=e.match(s),this.delegate(i[1],i[2],n.bind(this))));return this.dispatchEvent("component:bound"),this},delegate:function(t,e,n){return this._delegate.on(t,e,n),this},undelegateEvents:function(){return this._delegate&&this._delegate.destroy(),this.element.removeAttribute("data-js-hook"),this},uniqueId:function(t){return t+"_"+Math.random().toString(36).substr(2,9)}}),d.init=function(t){return function(t,e,n){for(var i,o,a=(n||document).querySelectorAll(t),l=[],c=0,h=a.length;c<h;c++)!1===s(o=a[c],r)&&((i=new e(o)).init(),l.push(i));return l}(this.selector,this,t)},d.extend=function(t){function e(){return this._super=d.prototype,d.apply(this,arguments)}return e.prototype=Object.create(d.prototype),l(e.prototype,t),l(e,d),t.hasOwnProperty("ui")&&t.ui.hasOwnProperty("base")&&(e.selector=t.ui.base),e.constants={},e};var p=d},147:function(t,e){"use strict";e.Z=function(){var t={};return this.addEventListener=function(e,n){return t.hasOwnProperty(e)?t[e].push(n):t[e]=[n],this},this.removeEventListener=function(e,n){if(!t.hasOwnProperty(e))return this;var i=t[e].indexOf(n);return-1!==i&&t[e].splice(i,1),this},this.dispatchEvent=function(e,n){if(!t.hasOwnProperty(e))return this;n=n||{};for(var i=t[e],s=0,r=i.length;s<r;s++)i[s].call(this,n);return this},this.getRegisteredEvents=function(){return t},this}},928:function(t,e,n){"use strict";n.d(e,{o:function(){return i}});n(291);function i(t,e){if("closest"in t)return t.closest(e);var n=function(t){return t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector}(t);try{for(var i,s=t;s;)if(n.bind(s)(e)?i=s:s=s.parentNode,i)return s}catch(t){return null}return null}},752:function(t,e,n){"use strict";n.d(e,{kQ:function(){return i},uJ:function(){return s},mQ:function(){return r}});var i="data-js-hook",s="state_";var r={UP:0,RIGHT:1,DOWN:-1,LEFT:-2}},291:function(t,e){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=Object.prototype.toString;function s(t){return void 0===t}function r(t){return"[object String]"===i.call(t)}var o=Array.isArray||function(t){return"[object Array]"===i.call(t)};e.Z={isUndefined:s,isDefined:function(t){return void 0!==t},isObject:function(t){return null!==t&&"object"===n(t)},isString:r,isNumber:function(t){return"[object Number]"===i.call(t)},isDate:function(t){return"[object Date]"===i.call(t)},isArray:o,isFunction:function(t){return"[object Function]"===i.call(t)},isEmpty:function(t){return s(t)||null===t||r(t)&&t.length<=0||/^\s*$/.test(t)}}},270:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return m}});var i=n(186),s=n(147);function r(t,e){var n,i,o,a,l,c=e,h=!1,u=!1;if(void 0===c.CSS_PROPERTY||void 0===c.BASE_CLASS)throw new Error("Transitions require CSS_PROPERTY and BASE_CLASS to be passed into BaseTransition.");function d(t){n&&(g(),p()),(n=t).classList.add(c.BASE_CLASS),o=function(t){if(!t){throw new Error("Element does not have TransitionEnd event. It may be null!")}var e,n,i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(n in i)if(i.hasOwnProperty(n)&&void 0!==t.style[n]){e=i[n];break}return e}(n)}function p(){return n?(n.classList.remove(r.NO_ANIMATION_CLASS),this):this}function f(){h&&(n.style.webkitTransitionDuration="0",n.style.mozTransitionDuration="0",n.style.oTransitionDuration="0",n.style.transitionDuration="0",n.removeEventListener(o,a),a(),n.style.webkitTransitionDuration="",n.style.mozTransitionDuration="",n.style.oTransitionDuration="",n.style.transitionDuration="")}function m(){n.classList.add(r.ANIMATING_CLASS),h=!0,o&&!n.classList.contains(r.NO_ANIMATION_CLASS)?(n.addEventListener(o,a),this.dispatchEvent(r.BEGIN_EVENT,{target:this})):(this.dispatchEvent(r.BEGIN_EVENT,{target:this}),a())}function v(){n.removeEventListener(o,a)}function E(t){return(!t||t.propertyName===c.CSS_PROPERTY)&&(v(),n.classList.remove(r.ANIMATING_CLASS),this.dispatchEvent(r.END_EVENT,{target:this}),h=!1,!0)}function b(){var t;for(t in c)c.hasOwnProperty(t)&&c[t]!==c.BASE_CLASS&&n.classList.contains(c[t])&&n.classList.remove(c[t])}function g(){return!!n&&(f(),n.classList.remove(c.BASE_CLASS),b(),!0)}var y=new s.Z;return this.addEventListener=y.addEventListener,this.dispatchEvent=y.dispatchEvent,this.removeEventListener=y.removeEventListener,this.animateOff=function(){return n?(n.classList.add(r.NO_ANIMATION_CLASS),this):this},this.animateOn=p,this.applyClass=function(t){return!!n&&(u||(b(),u=!0),!n.classList.contains(t)&&(v(),n.classList.remove(i),i=t,l(),n.classList.add(i),!0))},this.halt=f,this.init=function(){return a=E.bind(this),l=m.bind(this),d(t),this},this.isAnimated=function(){return!!n&&!n.classList.contains(r.NO_ANIMATION_CLASS)},this.remove=g,this.setElement=d,this}r.BEGIN_EVENT="transitionBegin",r.END_EVENT="transitionEnd",r.NO_ANIMATION_CLASS="u-no-animation",r.ANIMATING_CLASS="u-is-animating";var o=r,a={CSS_PROPERTY:"max-height",BASE_CLASS:"o-expandable_content__transition",EXPANDED:"o-expandable_content__expanded",COLLAPSED:"o-expandable_content__collapsed",OPEN_DEFAULT:"o-expandable_content__onload-open"};function l(t){var e,n=new o(t,a);function i(){t.classList.contains(a.EXPANDED)?(this.dispatchEvent("expandEnd",{target:this}),t.scrollHeight>e&&(t.style.maxHeight=t.scrollHeight+"px")):t.classList.contains(a.COLLAPSED)&&this.dispatchEvent("collapseEnd",{target:this})}var r=new s.Z;return this.addEventListener=r.addEventListener,this.dispatchEvent=r.dispatchEvent,this.removeEventListener=r.removeEventListener,this.animateOff=n.animateOff,this.animateOn=n.animateOn,this.halt=n.halt,this.isAnimated=n.isAnimated,this.setElement=n.setElement,this.remove=n.remove,this.init=function(){return n.init(),n.addEventListener(o.END_EVENT,i.bind(this)),t.classList.contains(a.OPEN_DEFAULT)?this.expand():this.collapse(),this},this.toggleExpandable=function(){return t.classList.contains(a.COLLAPSED)?this.expand():this.collapse(),this},this.collapse=function(){return this.dispatchEvent("collapseBegin",{target:this}),e=t.scrollHeight,t.style.maxHeight="0",n.applyClass(a.COLLAPSED),this},this.expand=function(){return this.dispatchEvent("expandBegin",{target:this}),(!e||t.scrollHeight>e)&&(e=t.scrollHeight),t.style.maxHeight=e+"px",n.applyClass(a.EXPANDED),this},this}l.CLASSES=a;var c=l,h=n(928),u=new s.Z;function d(){this.activeAccordion&&(this.transition.toggleExpandable(),this.toggleTargetState(this.ui.target),this.activeAccordion=!1)}function p(){this.ui.content.classList.remove("u-hidden")}function f(){this.ui.content.classList.add("u-hidden")}var m=i.Z.extend({ui:{base:".o-expandable",target:".o-expandable_target",content:".o-expandable_content",header:".o-expandable_header",label:".o-expandable_label"},classes:{targetExpanded:"o-expandable_target__expanded",targetCollapsed:"o-expandable_target__collapsed",group:"o-expandable-group",groupAccordion:"o-expandable-group__accordion"},events:{"click .o-expandable_target":"expandableClickHandler"},transition:null,isAccordionGroup:!1,activeAccordion:!1,initialize:function(){var t=new c(this.ui.content);this.transition=t.init(),this.transition.addEventListener("expandBegin",p.bind(this)),this.transition.addEventListener("collapseEnd",f.bind(this)),this.ui.content.classList.contains(c.CLASSES.EXPANDED)?this.ui.target.classList.add(this.classes.targetExpanded):(this.ui.target.classList.add(this.classes.targetCollapsed),this.ui.content.classList.add("u-hidden"));var e=(0,h.o)(this.ui.target,"."+this.classes.group);this.isAccordionGroup=null!==e&&e.classList.contains(this.classes.groupAccordion),this.isAccordionGroup&&u.addEventListener("accordionActivated",d.bind(this))},expandableClickHandler:function(){this.transition.toggleExpandable(),this.toggleTargetState(this.ui.target),this.isAccordionGroup&&(this.activeAccordion?this.activeAccordion=!1:(u.dispatchEvent("accordionActivated",{target:this}),this.activeAccordion=!0))},toggleTargetState:function(t){t.classList.contains(this.classes.targetExpanded)?(this.ui.target.classList.add(this.classes.targetCollapsed),this.ui.target.classList.remove(this.classes.targetExpanded)):(this.ui.target.classList.add(this.classes.targetExpanded),this.ui.target.classList.remove(this.classes.targetCollapsed))},getLabelText:function(){return this.ui.label.textContent.trim()}})},681:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return h}});var i=n(186),s=n(928);var r,o={ui:{base:".o-table__row-links"},events:{"click tbody tr":"onRowLinkClick"},onRowLinkClick:function(t){var e=t.target;if(e&&"A"===e.tagName)return;var n=(e=(0,s.o)(t.target,"tr")).querySelector("a");n&&(window.location=n.getAttribute("href"))}},a=n(752);var l={ui:{base:".o-table__sortable",tableBody:"tbody",sortButton:".sorted-up, .sorted-down"},classes:{sortDown:"sorted-down",sortUp:"sorted-up"},events:{"click .sortable":"onSortableClick"},initialize:function(){this.sortClass=r,this.sortColumnIndex=r,this.sortDirection=r,this.tableData=[],this.bindProperties(),this.ui.sortButton&&(this.sortColumnIndex=this.getColumnIndex(),this.sortDirection=a.mQ.UP,this.ui.sortButton.classList.contains(this.classes.sortDown)&&(this.sortDirection=a.mQ.DOWN),this.updateTable())},bindProperties:function(){var t;Object.defineProperty(this,"sortDirection",{configurable:!0,get:function(){return t},set:function(e){e===a.mQ.UP?this.sortClass=this.classes.sortUp:e===a.mQ.DOWN&&(this.sortClass=this.classes.sortDown),t=e}})},getColumnIndex:function(t){return(0,s.o)(t||this.ui.sortButton,"td, th").cellIndex},updateTable:function(){return this.updateTableData()&&this.updateTableDom()},updateTableData:function(t){var e,n=this.ui.tableBody.querySelectorAll("tr");this.tableData=[],t=t||this.sortColumnIndex;for(var i=0,s=n.length;i<s;++i)(e=n[i].cells[t])&&(e=e.textContent.trim()),this.tableData.push([e,n[i]]);var r=this.ui.sortButton.getAttribute("data-sort_type");return this.tableData.sort(this.tableDataSorter(this.sortDirection,r)),this.tableData},updateTableDom:function(){var t=this.ui.tableBody;for(;t.lastChild;)t.removeChild(t.lastChild);for(var e=document.createDocumentFragment(),n=0;n<this.tableData.length;n++)e.appendChild(this.tableData[n][1]);return t.appendChild(e),this.dispatchEvent("table:updated"),t},tableDataSorter:function(t,e){return function(n,i){var s=t===a.mQ.DOWN?-1:1,r=0,o=/[^\d.-]/g;return n=n[0],i=i[0],"number"===e&&(n=Number(n.replace(o,"")),i=Number(i.replace(o,""))),n<i?r=-1*s:n>i&&(r=s),r}},onSortableClick:function(t){this.ui.sortButton&&this.ui.sortButton.classList.remove(this.sortClass);this.ui.sortButton===t.target?this.sortDirection=~this.sortDirection:(this.ui.sortButton=t.target,this.sortColumnIndex=this.getColumnIndex(),this.sortDirection=a.mQ.UP);return this.ui.sortButton.classList.add(this.sortClass),this.updateTable(),this}},c=i.Z.extend({ui:{base:".o-table"},modifiers:[l,o]});c.constants.DIRECTIONS=a.mQ;var h=c}},i={};function s(t){if(i[t])return i[t].exports;var e=i[t]={exports:{}};return n[t](e,e.exports,s),e.exports}s.d=function(t,e){for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t=s(270),e=s(681),t.init(),e.init()}();
!function(){"use strict";var t={852:function(t){function e(t){this.listenerMap=[{},{}],t&&this.root(t),this.handle=e.prototype.handle.bind(this),this._removedListeners=[]}t.exports=e,e.prototype.root=function(t){var e,i=this.listenerMap;if(this.rootElement){for(e in i[1])i[1].hasOwnProperty(e)&&this.rootElement.removeEventListener(e,this.handle,!0);for(e in i[0])i[0].hasOwnProperty(e)&&this.rootElement.removeEventListener(e,this.handle,!1)}if(!t||!t.addEventListener)return this.rootElement&&delete this.rootElement,this;for(e in this.rootElement=t,i[1])i[1].hasOwnProperty(e)&&this.rootElement.addEventListener(e,this.handle,!0);for(e in i[0])i[0].hasOwnProperty(e)&&this.rootElement.addEventListener(e,this.handle,!1);return this},e.prototype.captureForType=function(t){return-1!==["blur","error","focus","load","resize","scroll"].indexOf(t)},e.prototype.on=function(t,e,o,a){var l,h,c,u;if(!t)throw new TypeError("Invalid event type: "+t);if("function"==typeof e&&(a=o,o=e,e=null),void 0===a&&(a=this.captureForType(t)),"function"!=typeof o)throw new TypeError("Handler must be a type of Function");return l=this.rootElement,(h=this.listenerMap[a?1:0])[t]||(l&&l.addEventListener(t,this.handle,a),h[t]=[]),e?/^[a-z]+$/i.test(e)?(u=e,c=n):/^#[a-z0-9\-_]+$/i.test(e)?(u=e.slice(1),c=r):(u=e,c=i):(u=null,c=s.bind(this)),h[t].push({selector:e,handler:o,matcher:c,matcherParam:u}),this},e.prototype.off=function(t,e,i,n){var s,r,o,a,l;if("function"==typeof e&&(n=i,i=e,e=null),void 0===n)return this.off(t,e,i,!0),this.off(t,e,i,!1),this;if(o=this.listenerMap[n?1:0],!t){for(l in o)o.hasOwnProperty(l)&&this.off(l,e,i);return this}if(!(a=o[t])||!a.length)return this;for(s=a.length-1;s>=0;s--)r=a[s],e&&e!==r.selector||i&&i!==r.handler||(this._removedListeners.push(r),a.splice(s,1));return a.length||(delete o[t],this.rootElement&&this.rootElement.removeEventListener(t,this.handle,n)),this},e.prototype.handle=function(t){var e,i,n,s,r,o=t.type,a=[],l="ftLabsDelegateIgnore";if(!0!==t[l]){switch(3===(r=t.target).nodeType&&(r=r.parentNode),r.correspondingUseElement&&(r=r.correspondingUseElement),n=this.rootElement,t.eventPhase||(t.target!==t.currentTarget?3:2)){case 1:a=this.listenerMap[1][o];break;case 2:this.listenerMap[0]&&this.listenerMap[0][o]&&(a=a.concat(this.listenerMap[0][o])),this.listenerMap[1]&&this.listenerMap[1][o]&&(a=a.concat(this.listenerMap[1][o]));break;case 3:a=this.listenerMap[0][o]}var h,c=[];for(i=a.length;r&&i;){for(e=0;e<i&&(s=a[e]);e++)r.tagName&&["button","input","select","textarea"].indexOf(r.tagName.toLowerCase())>-1&&r.hasAttribute("disabled")?c=[]:s.matcher.call(r,s.matcherParam,r)&&c.push([t,r,s]);if(r===n)break;if(i=a.length,(r=r.parentElement||r.parentNode)instanceof HTMLDocument)break}for(e=0;e<c.length;e++)if(!(this._removedListeners.indexOf(c[e][2])>-1)&&!1===this.fire.apply(this,c[e])){c[e][0][l]=!0,c[e][0].preventDefault(),h=!1;break}return h}},e.prototype.fire=function(t,e,i){return i.handler.call(e,t,e)};var i=function(t){if(t){var e=t.prototype;return e.matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector}}(Element);function n(t,e){return t.toLowerCase()===e.tagName.toLowerCase()}function s(t,e){return this.rootElement===window?e===document||e===document.documentElement||e===window:this.rootElement===e}function r(t,e){return t===e.id}e.prototype.destroy=function(){this.off(),this.root()}},161:function(t,e,i){var n=i(852);t.exports=function(t){return new n(t)},t.exports.Delegate=n}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}!function(){var t="data-js-hook";var e={UP:0,RIGHT:1,DOWN:-1,LEFT:-2};function n(e,i){if(!e)return!1;var n=e.getAttribute(t);return!!n&&(n=n.split(" ")).indexOf(i)>-1}var s="state_atomic_init";function r(e){return!n(e,s)&&(function(e,i){if(-1!==i.indexOf(" "))throw new Error("data-js-hook values cannot contain spaces!");var n=e.getAttribute(t);null!==n&&(i=n+" "+i),e.setAttribute(t,i)}(e,s),!0)}function o(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(t){t=t||{};for(var e=1,i=arguments.length;e<i;e++){var n=arguments[e]||{},s=void 0;for(s in n)if(Object.prototype.hasOwnProperty.call(n,s)){var r=n[s];o(r)?a(t[s]||(t[s]={}),r):t[s]=r}}return t}var l=function(){var t={};return this.addEventListener=function(e,i){return t.hasOwnProperty(e)?t[e].push(i):t[e]=[i],this},this.removeEventListener=function(e,i){if(!t.hasOwnProperty(e))return this;var n=t[e].indexOf(i);return-1!==n&&t[e].splice(n,1),this},this.dispatchEvent=function(e,i){if(!t.hasOwnProperty(e))return this;i=i||{};for(var n=t[e],s=0,r=n.length;s<r;s++)n[s].call(this,i);return this},this.getRegisteredEvents=function(){return t},this};function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var c=Object.prototype.toString;function u(t){return void 0===t}function d(t){return"[object String]"===c.call(t)}var p={isUndefined:u,isDefined:function(t){return void 0!==t},isObject:function(t){return null!==t&&"object"===h(t)},isString:d,isNumber:function(t){return"[object Number]"===c.call(t)},isDate:function(t){return"[object Date]"===c.call(t)},isArray:Array.isArray||function(t){return"[object Array]"===c.call(t)},isFunction:function(t){return"[object Function]"===c.call(t)},isEmpty:function(t){return u(t)||null===t||d(t)&&t.length<=0||/^\s*$/.test(t)}},f=i(161).Delegate;function v(t,e){this.element=t,this.initializers=[],this.uId=this.uniqueId("ac"),a(this,e),this.processModifiers(),this.ensureElement(),this.setCachedElements(),this.initializers.push(this.initialize)}a(v.prototype,new l,{init:function(){return this.initializers.forEach((function(t){p.isFunction(t)&&t.apply(this,arguments)}),this),this.dispatchEvent("component:initialized"),this},processModifiers:function(){this.modifiers&&this.modifiers.forEach((function(t){var e=t.ui.base.substring(1);this.element.classList.contains(e)&&(t.initialize&&(this.initializers.push(t.initialize),delete t.initialize),a(this,t))}),this)},render:function(){return this},ensureElement:function(){if(this.element)this.setElement(this.element);else{var t=a({},this.attributes);t.id=this.id||this.u_id,this.className&&(t.class=this.className),this.setElement(document.createElement("div")),this.setElementAttributes(t)}r(this.element)},setElement:function(t){return this.element&&this.undelegateEvents(),this.element=t,this.delegateEvents(),this},setCachedElements:function(){var t,e,i=a({},this.ui);for(t in i)i.hasOwnProperty(t)&&(1===(e=this.element.querySelectorAll(i[t])).length?i[t]=e[0]:e.length>1?i[t]=e:i[t]=null);return this.ui=i,i},destroy:function(){return this.element&&(this.element.parentNode.removeChild(this.element),this.element.view&&delete this.element.view,delete this.element),this.undelegateEvents(),this.dispatchEvent("component:destroyed"),!0},setElementAttributes:function(t){var e;for(e in t)t.hasOwnProperty(e)&&this.element.setAttribute(e,t[e])},delegateEvents:function(t){var e,i,n,s=/^(\S+)\s*(.*)$/;if(!(t=t||(t=this.events)))return this;for(e in this.undelegateEvents(),this._delegate=new f(this.element),t)({}).hasOwnProperty.call(t,e)&&(i=t[e],p.isFunction(this[i])&&(i=this[i]),i&&(n=e.match(s),this.delegate(n[1],n[2],i.bind(this))));return this.dispatchEvent("component:bound"),this},delegate:function(t,e,i){return this._delegate.on(t,e,i),this},undelegateEvents:function(){return this._delegate&&this._delegate.destroy(),this.element.removeAttribute("data-js-hook"),this},uniqueId:function(t){return t+"_"+Math.random().toString(36).substr(2,9)}}),v.init=function(t){return function(t,e,i){for(var r,o,a=(i||document).querySelectorAll(t),l=[],h=0,c=a.length;h<c;h++)!1===n(o=a[h],s)&&((r=new e(o)).init(),l.push(r));return l}(this.selector,this,t)},v.extend=function(t){function e(){return this._super=v.prototype,v.apply(this,arguments)}return e.prototype=Object.create(v.prototype),a(e.prototype,t),a(e,v),t.hasOwnProperty("ui")&&t.ui.hasOwnProperty("base")&&(e.selector=t.ui.base),e.constants={},e};var m=v;function E(t,e){var i,n,s,r,o,a=e,h=!1,c=!1;if(void 0===a.CSS_PROPERTY||void 0===a.BASE_CLASS)throw new Error("Transitions require CSS_PROPERTY and BASE_CLASS to be passed into BaseTransition.");function u(t){i&&(g(),d()),(i=t).classList.add(a.BASE_CLASS),s=function(t){if(!t){throw new Error("Element does not have TransitionEnd event. It may be null!")}var e,i,n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(i in n)if(n.hasOwnProperty(i)&&void 0!==t.style[i]){e=n[i];break}return e}(i)}function d(){return i?(i.classList.remove(E.NO_ANIMATION_CLASS),this):this}function p(){h&&(i.style.webkitTransitionDuration="0",i.style.mozTransitionDuration="0",i.style.oTransitionDuration="0",i.style.transitionDuration="0",i.removeEventListener(s,r),r(),i.style.webkitTransitionDuration="",i.style.mozTransitionDuration="",i.style.oTransitionDuration="",i.style.transitionDuration="")}function f(){i.classList.add(E.ANIMATING_CLASS),h=!0,s&&!i.classList.contains(E.NO_ANIMATION_CLASS)?(i.addEventListener(s,r),this.dispatchEvent(E.BEGIN_EVENT,{target:this})):(this.dispatchEvent(E.BEGIN_EVENT,{target:this}),r())}function v(){i.removeEventListener(s,r)}function m(t){return(!t||t.propertyName===a.CSS_PROPERTY)&&(v(),i.classList.remove(E.ANIMATING_CLASS),this.dispatchEvent(E.END_EVENT,{target:this}),h=!1,!0)}function b(){var t;for(t in a)a.hasOwnProperty(t)&&a[t]!==a.BASE_CLASS&&i.classList.contains(a[t])&&i.classList.remove(a[t])}function g(){return!!i&&(p(),i.classList.remove(a.BASE_CLASS),b(),!0)}var y=new l;return this.addEventListener=y.addEventListener,this.dispatchEvent=y.dispatchEvent,this.removeEventListener=y.removeEventListener,this.animateOff=function(){return i?(i.classList.add(E.NO_ANIMATION_CLASS),this):this},this.animateOn=d,this.applyClass=function(t){return!!i&&(c||(b(),c=!0),!i.classList.contains(t)&&(v(),i.classList.remove(n),n=t,o(),i.classList.add(n),!0))},this.halt=p,this.init=function(){return r=m.bind(this),o=f.bind(this),u(t),this},this.isAnimated=function(){return!!i&&!i.classList.contains(E.NO_ANIMATION_CLASS)},this.remove=g,this.setElement=u,this}E.BEGIN_EVENT="transitionBegin",E.END_EVENT="transitionEnd",E.NO_ANIMATION_CLASS="u-no-animation",E.ANIMATING_CLASS="u-is-animating";var b=E,g={CSS_PROPERTY:"max-height",BASE_CLASS:"o-expandable_content__transition",EXPANDED:"o-expandable_content__expanded",COLLAPSED:"o-expandable_content__collapsed",OPEN_DEFAULT:"o-expandable_content__onload-open"};function y(t){var e,i=new b(t,g);function n(){t.classList.contains(g.EXPANDED)?(this.dispatchEvent("expandEnd",{target:this}),t.scrollHeight>e&&(t.style.maxHeight=t.scrollHeight+"px")):t.classList.contains(g.COLLAPSED)&&this.dispatchEvent("collapseEnd",{target:this})}var s=new l;return this.addEventListener=s.addEventListener,this.dispatchEvent=s.dispatchEvent,this.removeEventListener=s.removeEventListener,this.animateOff=i.animateOff,this.animateOn=i.animateOn,this.halt=i.halt,this.isAnimated=i.isAnimated,this.setElement=i.setElement,this.remove=i.remove,this.init=function(){return i.init(),i.addEventListener(b.END_EVENT,n.bind(this)),t.classList.contains(g.OPEN_DEFAULT)?this.expand():this.collapse(),this},this.toggleExpandable=function(){return t.classList.contains(g.COLLAPSED)?this.expand():this.collapse(),this},this.collapse=function(){return this.dispatchEvent("collapseBegin",{target:this}),e=t.scrollHeight,t.style.maxHeight="0",i.applyClass(g.COLLAPSED),this},this.expand=function(){return this.dispatchEvent("expandBegin",{target:this}),(!e||t.scrollHeight>e)&&(e=t.scrollHeight),t.style.maxHeight=e+"px",i.applyClass(g.EXPANDED),this},this}y.CLASSES=g;var L=y;function A(t,e){if("closest"in t)return t.closest(e);var i=function(t){return t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector}(t);try{for(var n,s=t;s;)if(i.bind(s)(e)?n=s:s=s.parentNode,n)return s}catch(t){return null}return null}var S=new l;function _(){this.activeAccordion&&(this.transition.toggleExpandable(),this.toggleTargetState(this.ui.target),this.activeAccordion=!1)}function x(){this.ui.content.classList.remove("u-hidden")}function C(){this.ui.content.classList.add("u-hidden")}var D=m.extend({ui:{base:".o-expandable",target:".o-expandable_target",content:".o-expandable_content",header:".o-expandable_header",label:".o-expandable_label"},classes:{targetExpanded:"o-expandable_target__expanded",targetCollapsed:"o-expandable_target__collapsed",group:"o-expandable-group",groupAccordion:"o-expandable-group__accordion"},events:{"click .o-expandable_target":"expandableClickHandler"},transition:null,isAccordionGroup:!1,activeAccordion:!1,initialize:function(){var t=new L(this.ui.content);this.transition=t.init(),this.transition.addEventListener("expandBegin",x.bind(this)),this.transition.addEventListener("collapseEnd",C.bind(this)),this.ui.content.classList.contains(L.CLASSES.EXPANDED)?this.ui.target.classList.add(this.classes.targetExpanded):(this.ui.target.classList.add(this.classes.targetCollapsed),this.ui.content.classList.add("u-hidden"));var e=A(this.ui.target,"."+this.classes.group);this.isAccordionGroup=null!==e&&e.classList.contains(this.classes.groupAccordion),this.isAccordionGroup&&S.addEventListener("accordionActivated",_.bind(this))},expandableClickHandler:function(){this.transition.toggleExpandable(),this.toggleTargetState(this.ui.target),this.isAccordionGroup&&(this.activeAccordion?this.activeAccordion=!1:(S.dispatchEvent("accordionActivated",{target:this}),this.activeAccordion=!0))},toggleTargetState:function(t){t.classList.contains(this.classes.targetExpanded)?(this.ui.target.classList.add(this.classes.targetCollapsed),this.ui.target.classList.remove(this.classes.targetExpanded)):(this.ui.target.classList.add(this.classes.targetExpanded),this.ui.target.classList.remove(this.classes.targetCollapsed))},getLabelText:function(){return this.ui.label.textContent.trim()}});var O,w={ui:{base:".o-table__row-links"},events:{"click tbody tr":"onRowLinkClick"},onRowLinkClick:function(t){var e=t.target;if(e&&"A"===e.tagName)return;var i=(e=A(t.target,"tr")).querySelector("a");i&&(window.location=i.getAttribute("href"))}};var N={ui:{base:".o-table__sortable",tableBody:"tbody",sortButton:".sorted-up, .sorted-down"},classes:{sortDown:"sorted-down",sortUp:"sorted-up"},events:{"click .sortable":"onSortableClick"},initialize:function(){this.sortClass=O,this.sortColumnIndex=O,this.sortDirection=O,this.tableData=[],this.bindProperties(),this.ui.sortButton&&(this.sortColumnIndex=this.getColumnIndex(),this.sortDirection=e.UP,this.ui.sortButton.classList.contains(this.classes.sortDown)&&(this.sortDirection=e.DOWN),this.updateTable())},bindProperties:function(){var t;Object.defineProperty(this,"sortDirection",{configurable:!0,get:function(){return t},set:function(i){i===e.UP?this.sortClass=this.classes.sortUp:i===e.DOWN&&(this.sortClass=this.classes.sortDown),t=i}})},getColumnIndex:function(t){return A(t||this.ui.sortButton,"td, th").cellIndex},updateTable:function(){return this.updateTableData()&&this.updateTableDom()},updateTableData:function(t){var e,i=this.ui.tableBody.querySelectorAll("tr");this.tableData=[],t=t||this.sortColumnIndex;for(var n=0,s=i.length;n<s;++n)(e=i[n].cells[t])&&(e=e.textContent.trim()),this.tableData.push([e,i[n]]);var r=this.ui.sortButton.getAttribute("data-sort_type");return this.tableData.sort(this.tableDataSorter(this.sortDirection,r)),this.tableData},updateTableDom:function(){var t=this.ui.tableBody;for(;t.lastChild;)t.removeChild(t.lastChild);for(var e=document.createDocumentFragment(),i=0;i<this.tableData.length;i++)e.appendChild(this.tableData[i][1]);return t.appendChild(e),this.dispatchEvent("table:updated"),t},tableDataSorter:function(t,i){return function(n,s){var r=t===e.DOWN?-1:1,o=0,a=/[^\d.-]/g;return n=n[0],s=s[0],"number"===i&&(n=Number(n.replace(a,"")),s=Number(s.replace(a,""))),n<s?o=-1*r:n>s&&(o=r),o}},onSortableClick:function(t){this.ui.sortButton&&this.ui.sortButton.classList.remove(this.sortClass);this.ui.sortButton===t.target?this.sortDirection=~this.sortDirection:(this.ui.sortButton=t.target,this.sortColumnIndex=this.getColumnIndex(),this.sortDirection=e.UP);return this.ui.sortButton.classList.add(this.sortClass),this.updateTable(),this}},T=m.extend({ui:{base:".o-table"},modifiers:[N,w]});T.constants.DIRECTIONS=e;var P=T;D.init(),P.init()}()}();
{
"name": "@cfpb/cfpb-design-system",
"version": "0.7.10",
"version": "0.8.0",
"description": "CFPB's UI framework",

@@ -24,16 +24,16 @@ "main": "src/cfpb-design-system.js",

"dependencies": {
"@cfpb/cfpb-atomic-component": "^0.7.9",
"@cfpb/cfpb-buttons": "^0.7.9",
"@cfpb/cfpb-core": "^0.7.7",
"@cfpb/cfpb-expandables": "^0.7.9",
"@cfpb/cfpb-forms": "^0.7.9",
"@cfpb/cfpb-grid": "^0.7.2",
"@cfpb/cfpb-icons": "^0.7.9",
"@cfpb/cfpb-layout": "^0.7.7",
"@cfpb/cfpb-notifications": "^0.7.9",
"@cfpb/cfpb-pagination": "^0.7.9",
"@cfpb/cfpb-tables": "^0.7.9",
"@cfpb/cfpb-typography": "^0.7.10"
"@cfpb/cfpb-atomic-component": "^0.8.0",
"@cfpb/cfpb-buttons": "^0.8.0",
"@cfpb/cfpb-core": "^0.8.0",
"@cfpb/cfpb-expandables": "^0.8.0",
"@cfpb/cfpb-forms": "^0.8.0",
"@cfpb/cfpb-grid": "^0.8.0",
"@cfpb/cfpb-icons": "^0.8.0",
"@cfpb/cfpb-layout": "^0.8.0",
"@cfpb/cfpb-notifications": "^0.8.0",
"@cfpb/cfpb-pagination": "^0.8.0",
"@cfpb/cfpb-tables": "^0.8.0",
"@cfpb/cfpb-typography": "^0.8.0"
},
"gitHead": "f67f9d280fdcd3ac7e92536f5a58cd8a830cfeac"
"gitHead": "1dba6077d31b11e5db08dfb1e97592e61880a74d"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc