cf-component-card
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -743,3 +743,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var _cfComponentLink = __webpack_require__(97); | ||
var _cfComponentLink = __webpack_require__(98); | ||
@@ -871,3 +871,3 @@ var _cfComponentLink2 = _interopRequireDefault(_cfComponentLink); | ||
/***/ 53: | ||
/***/ 55: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -910,3 +910,3 @@ | ||
/***/ 83: | ||
/***/ 85: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -922,3 +922,3 @@ | ||
var _routeHandler = __webpack_require__(53); | ||
var _routeHandler = __webpack_require__(55); | ||
@@ -931,3 +931,3 @@ exports.handleRoutes = _routeHandler.handleRoutes; | ||
/***/ 87: | ||
/***/ 89: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -948,3 +948,3 @@ | ||
var _cfUtilRouteHandler = __webpack_require__(83); | ||
var _cfUtilRouteHandler = __webpack_require__(85); | ||
@@ -1064,3 +1064,3 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/***/ 97: | ||
/***/ 98: | ||
/***/ (function(module, exports, __webpack_require__) { | ||
@@ -1075,3 +1075,3 @@ | ||
var _Link = __webpack_require__(87); | ||
var _Link = __webpack_require__(89); | ||
@@ -1078,0 +1078,0 @@ var _Link2 = _interopRequireDefault(_Link); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var r=t("object"==typeof exports?require("react"):e.React);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=368)}({0:function(t,r){t.exports=e},206:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=(n(o),o.PropTypes.shape({id:o.PropTypes.string.isRequired,name:o.PropTypes.string.isRequired,content:o.PropTypes.any.isRequired})),i=o.PropTypes.arrayOf(a);t.default={cardDrawer:a,cardDrawers:i}},207:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__section cf-card__section--"+this.props.status},this.props.children)}}]),t}(l.default.Component);s.propTypes={status:c.PropTypes.oneOf(["default","error"]),children:c.PropTypes.node},s.defaultProps={status:"default"},t.default=s},265:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("section",{className:"cf-card"},this.props.children)}}]),t}(l.default.Component);s.propTypes={children:c.PropTypes.node},t.default=s},266:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__block"},this.props.children)}}]),t}(l.default.Component);s.propTypes={children:c.PropTypes.node},t.default=s},267:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__content"},l.default.createElement("h3",{className:"cf-card__title"},this.props.title),this.props.children,this.props.footerMessage?l.default.createElement("div",{className:"cf-card__footer_message"},this.props.footerMessage):null)}}]),t}(l.default.Component);s.propTypes={title:c.PropTypes.any.isRequired,footerMessage:c.PropTypes.string,children:c.PropTypes.node},t.default=s},268:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){var e="cf-card__control"+(this.props.wide?" cf-card__control--wide":"");return l.default.createElement("div",{className:e},this.props.children)}}]),t}(l.default.Component);s.propTypes={children:c.PropTypes.node,wide:c.PropTypes.bool},t.default=s},269:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=r(207),f=n(s),p=r(304),d=n(p),y=r(305),b=n(y),_=r(206),h=n(_),v=0,m=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r._cardId=v++,r}return i(t,e),u(t,[{key:"render",value:function(){var e=this,t=[],r=[];this.props.drawers.forEach(function(n){var o=n.id===e.props.active,a="card-"+e._cardId+"-drawer-"+n.id;t.push(l.default.createElement(b.default,{key:n.id,id:a,isActive:o,onClick:e.props.onClick.bind(null,n.id)},n.name));var i="cf-card__drawer";o&&(i+=" cf-card__drawer--active"),r.push(l.default.createElement("div",{key:n.id,role:"tabpanel","aria-labelledby":a,"aria-hidden":o?"false":"true",className:i},o&&n.content))});var n="cf-card__drawers_container";return this.props.active&&(n+=" cf-card__drawers_container--open"),l.default.createElement(f.default,null,l.default.createElement(d.default,{controls:this.props.controls,links:t}),l.default.createElement("div",{className:n},r))}}]),t}(l.default.Component);m.propTypes={onClick:c.PropTypes.func.isRequired,active:c.PropTypes.string,drawers:h.default.cardDrawers.isRequired,controls:c.PropTypes.any},t.default=m},270:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__loading_text"})}}]),t}(l.default.Component);t.default=s},271:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__messages"},this.props.messages.map(function(e,t){return l.default.createElement("div",{key:t,role:"alert",className:"cf-card__message cf-card__message--"+e.type},e.content)}))}}]),t}(l.default.Component);s.propTypes={messages:c.PropTypes.arrayOf(c.PropTypes.shape({type:c.PropTypes.oneOf(["info","success","error","warning"]),content:c.PropTypes.any.isRequired})).isRequired},t.default=s},304:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__toolbar"},l.default.createElement("div",{className:"cf-card__toolbar_controls"},this.props.controls),l.default.createElement("div",{className:"cf-card__toolbar_links",role:"tablist"},this.props.links))}}]),t}(l.default.Component);s.propTypes={controls:c.PropTypes.any,links:c.PropTypes.any},t.default=s},305:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=r(97),f=n(s),p=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.handleClick=r.handleClick.bind(r),r}return i(t,e),u(t,[{key:"handleClick",value:function(e){e.preventDefault(),this.props.onClick()}},{key:"render",value:function(){var e="cf-card__toolbar_link";return this.props.isActive&&(e+=" cf-card__toolbar_link--open"),l.default.createElement(f.default,{role:"tab",id:this.props.id,className:e,onClick:this.handleClick},this.props.children)}}]),t}(l.default.Component);p.propTypes={onClick:c.PropTypes.func.isRequired,isActive:c.PropTypes.bool.isRequired,id:c.PropTypes.string,children:c.PropTypes.node},t.default=p},368:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CardBlock=t.CardSection=t.CardPropTypes=t.CardMessages=t.CardLoadingText=t.CardDrawers=t.CardControl=t.CardContent=t.Card=void 0;var o=r(265),a=n(o),i=r(267),u=n(i),c=r(268),l=n(c),s=r(269),f=n(s),p=r(270),d=n(p),y=r(271),b=n(y),_=r(206),h=n(_),v=r(207),m=n(v),O=r(266),w=n(O);t.Card=a.default,t.CardContent=u.default,t.CardControl=l.default,t.CardDrawers=f.default,t.CardLoadingText=d.default,t.CardMessages=b.default,t.CardPropTypes=h.default,t.CardSection=m.default,t.CardBlock=w.default},53:function(e,t,r){"use strict";function n(e){if(i)return void console.error("Warning: Route Handler: Only one handler is allowed at a time");i=e}function o(e){if(!i)return void console.error("Warning: Route Handler: A handler needs to be setup before you can route");i(e)}function a(){i=null}Object.defineProperty(t,"__esModule",{value:!0}),t.handleRoutes=n,t.routeTo=o,t.__resetRouteHandler=a;var i=void 0},83:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__resetRouteHandler=t.routeTo=t.handleRoutes=void 0;var n=r(53);t.handleRoutes=n.handleRoutes,t.routeTo=n.routeTo,t.__resetRouteHandler=n.__resetRouteHandler},87:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(0),s=n(l),f=r(83),p=function(e){function t(e,r){if(a(this,t),!e.to&&!e.onClick)throw new Error("<Link/> requires either a `to` or `onClick` prop");var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n.handleClick=n.handleClick.bind(n),n.focus=n.focus.bind(n),n}return u(t,e),c(t,[{key:"focus",value:function(){this.link.focus()}},{key:"handleClick",value:function(e){e.preventDefault(),this.props.disabled||(this.props.to?(0,f.routeTo)(this.props.to):this.props.onClick(e))}},{key:"render",value:function(){var e=this,t=this.props,r=t.tagName,n=t.to,a=t.children,i=t.className,u=t.disabled,c=o(t,["tagName","to","children","className","disabled"]);return c.href||"a"!==r||(c.href=n||"#!"),c.role||(n&&"a"!==r?c.role="link":n||(c.role="button")),c.className="cf-link",u&&(c.className+=" cf-link--disabled",c.disabled=!0),i&&(c.className+=" "+i),c.onClick=this.handleClick,c.ref=function(t){return e.link=t},s.default.createElement(r,c,a)}}]),t}(s.default.Component);p.propTypes={to:l.PropTypes.string,onClick:l.PropTypes.func,tagName:l.PropTypes.string,disabled:l.PropTypes.bool,className:l.PropTypes.string,children:l.PropTypes.node},p.defaultProps={tagName:"a"},t.default=p},97:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(87),a=n(o);t.default=a.default}})}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"));else if("function"==typeof define&&define.amd)define(["react"],t);else{var r=t("object"==typeof exports?require("react"):e.React);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=368)}({0:function(t,r){t.exports=e},206:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),a=(n(o),o.PropTypes.shape({id:o.PropTypes.string.isRequired,name:o.PropTypes.string.isRequired,content:o.PropTypes.any.isRequired})),i=o.PropTypes.arrayOf(a);t.default={cardDrawer:a,cardDrawers:i}},207:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__section cf-card__section--"+this.props.status},this.props.children)}}]),t}(l.default.Component);s.propTypes={status:c.PropTypes.oneOf(["default","error"]),children:c.PropTypes.node},s.defaultProps={status:"default"},t.default=s},265:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("section",{className:"cf-card"},this.props.children)}}]),t}(l.default.Component);s.propTypes={children:c.PropTypes.node},t.default=s},266:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__block"},this.props.children)}}]),t}(l.default.Component);s.propTypes={children:c.PropTypes.node},t.default=s},267:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__content"},l.default.createElement("h3",{className:"cf-card__title"},this.props.title),this.props.children,this.props.footerMessage?l.default.createElement("div",{className:"cf-card__footer_message"},this.props.footerMessage):null)}}]),t}(l.default.Component);s.propTypes={title:c.PropTypes.any.isRequired,footerMessage:c.PropTypes.string,children:c.PropTypes.node},t.default=s},268:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){var e="cf-card__control"+(this.props.wide?" cf-card__control--wide":"");return l.default.createElement("div",{className:e},this.props.children)}}]),t}(l.default.Component);s.propTypes={children:c.PropTypes.node,wide:c.PropTypes.bool},t.default=s},269:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=r(207),f=n(s),p=r(304),d=n(p),y=r(305),b=n(y),_=r(206),h=n(_),v=0,m=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r._cardId=v++,r}return i(t,e),u(t,[{key:"render",value:function(){var e=this,t=[],r=[];this.props.drawers.forEach(function(n){var o=n.id===e.props.active,a="card-"+e._cardId+"-drawer-"+n.id;t.push(l.default.createElement(b.default,{key:n.id,id:a,isActive:o,onClick:e.props.onClick.bind(null,n.id)},n.name));var i="cf-card__drawer";o&&(i+=" cf-card__drawer--active"),r.push(l.default.createElement("div",{key:n.id,role:"tabpanel","aria-labelledby":a,"aria-hidden":o?"false":"true",className:i},o&&n.content))});var n="cf-card__drawers_container";return this.props.active&&(n+=" cf-card__drawers_container--open"),l.default.createElement(f.default,null,l.default.createElement(d.default,{controls:this.props.controls,links:t}),l.default.createElement("div",{className:n},r))}}]),t}(l.default.Component);m.propTypes={onClick:c.PropTypes.func.isRequired,active:c.PropTypes.string,drawers:h.default.cardDrawers.isRequired,controls:c.PropTypes.any},t.default=m},270:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__loading_text"})}}]),t}(l.default.Component);t.default=s},271:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__messages"},this.props.messages.map(function(e,t){return l.default.createElement("div",{key:t,role:"alert",className:"cf-card__message cf-card__message--"+e.type},e.content)}))}}]),t}(l.default.Component);s.propTypes={messages:c.PropTypes.arrayOf(c.PropTypes.shape({type:c.PropTypes.oneOf(["info","success","error","warning"]),content:c.PropTypes.any.isRequired})).isRequired},t.default=s},304:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=function(e){function t(){return o(this,t),a(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return i(t,e),u(t,[{key:"render",value:function(){return l.default.createElement("div",{className:"cf-card__toolbar"},l.default.createElement("div",{className:"cf-card__toolbar_controls"},this.props.controls),l.default.createElement("div",{className:"cf-card__toolbar_links",role:"tablist"},this.props.links))}}]),t}(l.default.Component);s.propTypes={controls:c.PropTypes.any,links:c.PropTypes.any},t.default=s},305:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),c=r(0),l=n(c),s=r(98),f=n(s),p=function(e){function t(e){o(this,t);var r=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return r.handleClick=r.handleClick.bind(r),r}return i(t,e),u(t,[{key:"handleClick",value:function(e){e.preventDefault(),this.props.onClick()}},{key:"render",value:function(){var e="cf-card__toolbar_link";return this.props.isActive&&(e+=" cf-card__toolbar_link--open"),l.default.createElement(f.default,{role:"tab",id:this.props.id,className:e,onClick:this.handleClick},this.props.children)}}]),t}(l.default.Component);p.propTypes={onClick:c.PropTypes.func.isRequired,isActive:c.PropTypes.bool.isRequired,id:c.PropTypes.string,children:c.PropTypes.node},t.default=p},368:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CardBlock=t.CardSection=t.CardPropTypes=t.CardMessages=t.CardLoadingText=t.CardDrawers=t.CardControl=t.CardContent=t.Card=void 0;var o=r(265),a=n(o),i=r(267),u=n(i),c=r(268),l=n(c),s=r(269),f=n(s),p=r(270),d=n(p),y=r(271),b=n(y),_=r(206),h=n(_),v=r(207),m=n(v),O=r(266),w=n(O);t.Card=a.default,t.CardContent=u.default,t.CardControl=l.default,t.CardDrawers=f.default,t.CardLoadingText=d.default,t.CardMessages=b.default,t.CardPropTypes=h.default,t.CardSection=m.default,t.CardBlock=w.default},55:function(e,t,r){"use strict";function n(e){if(i)return void console.error("Warning: Route Handler: Only one handler is allowed at a time");i=e}function o(e){if(!i)return void console.error("Warning: Route Handler: A handler needs to be setup before you can route");i(e)}function a(){i=null}Object.defineProperty(t,"__esModule",{value:!0}),t.handleRoutes=n,t.routeTo=o,t.__resetRouteHandler=a;var i=void 0},85:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.__resetRouteHandler=t.routeTo=t.handleRoutes=void 0;var n=r(55);t.handleRoutes=n.handleRoutes,t.routeTo=n.routeTo,t.__resetRouteHandler=n.__resetRouteHandler},89:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),l=r(0),s=n(l),f=r(85),p=function(e){function t(e,r){if(a(this,t),!e.to&&!e.onClick)throw new Error("<Link/> requires either a `to` or `onClick` prop");var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,r));return n.handleClick=n.handleClick.bind(n),n.focus=n.focus.bind(n),n}return u(t,e),c(t,[{key:"focus",value:function(){this.link.focus()}},{key:"handleClick",value:function(e){e.preventDefault(),this.props.disabled||(this.props.to?(0,f.routeTo)(this.props.to):this.props.onClick(e))}},{key:"render",value:function(){var e=this,t=this.props,r=t.tagName,n=t.to,a=t.children,i=t.className,u=t.disabled,c=o(t,["tagName","to","children","className","disabled"]);return c.href||"a"!==r||(c.href=n||"#!"),c.role||(n&&"a"!==r?c.role="link":n||(c.role="button")),c.className="cf-link",u&&(c.className+=" cf-link--disabled",c.disabled=!0),i&&(c.className+=" "+i),c.onClick=this.handleClick,c.ref=function(t){return e.link=t},s.default.createElement(r,c,a)}}]),t}(s.default.Component);p.propTypes={to:l.PropTypes.string,onClick:l.PropTypes.func,tagName:l.PropTypes.string,disabled:l.PropTypes.bool,className:l.PropTypes.string,children:l.PropTypes.node},p.defaultProps={tagName:"a"},t.default=p},98:function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(89),a=n(o);t.default=a.default}})}); |
{ | ||
"name": "cf-component-card", | ||
"description": "Cloudflare Card Component", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "module": "es/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
121334
29
1751
1