UNPKG

@times-components/slice-layout

Version:
1 lines 7.77 kB
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=5)}([function(e,t){e.exports=require("@times-components/ts-styleguide/rnw")},function(e,t){e.exports=require("styled-components")},function(e,t){e.exports=require("@times-components/utils/rnw")},function(e,t){e.exports=require("react")},function(e,t){e.exports=require("prop-types")},function(e,t,n){"use strict";n.r(t);var r=n(3),o=n.n(r),i=(n(4),n(2)),a=n(1),c=n.n(a),s=n(0),l=c()(i.TcView).withConfig({displayName:"responsive__SliceContainer",componentId:"sc-1kirgpc-0"})(["align-items:center;border-bottom-color:",";border-bottom-width:",";border-style:solid;flex:1;justify-content:center;",";@media (-webkit-min-device-pixel-ratio:2){border-bottom-width:",";}"],s.colours.functional.keyline,(function(e){return e.hideBorder?0:"1px"}),(function(e){return e.hideBorder&&"margin-bottom: 12px"}),(function(e){return e.hideBorder?0:"0.5px"})),u=c()(i.TcView).withConfig({displayName:"responsive__ChildContainer",componentId:"sc-1lqbq6a-0"})(["flex:1;padding-left:",";padding-right:",";@media (min-width:","px){flex-basis:0 !important;padding-left:0;padding-right:0;}"],Object(s.spacing)(2),Object(s.spacing)(2),s.breakpoints.medium),p={1:[125],2:[125],3:[125,145]};function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function f(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function b(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=w(e);if(t){var o=w(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return h(this,n)}}function h(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function w(e){return(w=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var C,x=(C={hasLeftRightMargin:!0}.hasLeftRightMargin,c()(i.TcView).withConfig({displayName:"responsive",componentId:"sc-1kirgpc-1"})(["border-bottom-color:",";border-bottom-style:solid;border-bottom-width:1px;flex:1;margin-bottom:",";margin-top:",";min-width:auto;@media (min-width:","px){border-bottom:none;border-right-color:",";border-right-style:solid;border-right-width:1px;flex:0 !important;margin:",";}"],s.colours.functional.keyline,Object(s.spacing)(2),Object(s.spacing)(2),s.breakpoints.medium,s.colours.functional.keyline,C?"0 ".concat(Object(s.spacing)(2)):"0")),v=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(d,e);var t,n,r,a=g(d);function d(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d);var n,r,o=(t=a.call(this,e)).props.itemCount;return t.ConfigWrapper=function(e){var t=e.itemCount,n=c()(i.TcView).withConfig({displayName:"config__Base",componentId:"bs1997-0"})([".imageContainerClass{display:",";}.summaryHidden{display:none;}.summary125Class{display:block;}@media (min-width:","px){.imageContainerClass{display:block;}.headlineClass{font-size:25px;line-height:28px;margin-top:",";}}"],t>=3?"none":"block",s.breakpoints.medium,Object(s.spacing)(1));return 1===t&&(n=c()(n).withConfig({displayName:"config__Base",componentId:"bs1997-1"})(["@media (min-width:","px){.imageContainerClass{flex:1;margin-bottom:0;min-width:auto;padding-right:",";}.contentContainerClass{flex-basis:0 !important;flex-grow:1;min-width:300px;}}"],s.breakpoints.medium,Object(s.spacing)(2))),n=c()(n).withConfig({displayName:"config__Base",componentId:"bs1997-2"})(["@media (min-width:","px){.summary125Class{display:",";}.summary145Class{display:",";}}"],s.breakpoints.wide,3===t?"none":"block",3===t?"block":"none")}({itemCount:o}),t.config=function(e){var t=e.itemCount;return{contentContainerClass:"contentContainerClass",headlineClass:"headlineClass",imageContainerClass:"imageContainerClass",summaryConfig:{lengths:p[t]}}}({itemCount:o}),t.ChildrenContainer=(n={childCount:o}.childCount,r=c()(i.TcView).withConfig({displayName:"responsive__Base",componentId:"sc-1lqbq6a-1"})(["flex:1;flex-direction:column;flex-wrap:wrap;padding-bottom:",";padding-top:",";width:100%;@media (min-width:","px){flex-direction:row;}"],Object(s.spacing)(2),Object(s.spacing)(2),s.breakpoints.medium),r=n>=3?c()(r).withConfig({displayName:"responsive__Base",componentId:"sc-1lqbq6a-2"})(["@media (min-width:","px){padding-left:",";padding-right:",";width:100%;}"],s.breakpoints.medium,Object(s.spacing)(4),Object(s.spacing)(4)):c()(r).withConfig({displayName:"responsive__Base",componentId:"sc-1lqbq6a-3"})(["@media (min-width:","px){width:80.8%;}"],s.breakpoints.medium),r=c()(r).withConfig({displayName:"responsive__Base",componentId:"sc-1lqbq6a-4"})(["@media (min-width:","px){width:",";}"],s.breakpoints.wide,n>=3?"100%":"56.2%")),t}return t=d,(n=[{key:"render",value:function(){var e=this.props,t=e.renderItems,n=e.hideBorder,r=t(this.config);if(0===r.length)return null;var i=this.ChildrenContainer,a=this.ConfigWrapper;return o.a.createElement(a,null,o.a.createElement(l,{hideBorder:n},o.a.createElement(i,null,r.map((function(e){return o.a.createElement(u,{key:e.props.id},e)})).reduce((function(e,t){return[].concat(f(e.length>0?e:[e]),[o.a.createElement(x,{key:"separator-".concat(t.key)}),t])})))))}}])&&b(t.prototype,n),r&&b(t,r),d}(r.Component);v.defaultProps={hideBorder:!1};var _=v;n.d(t,"StandardSlice",(function(){return _}))}]);