react-layout-views
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-native")):"function"==typeof define&&define.amd?define("react-layout-views",["react","react-native"],e):"object"==typeof exports?exports["react-layout-views"]=e(require("react"),require("react-native")):t["react-layout-views"]=e(t.react,t["react-native"])}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=21)}({0:function(e,n){e.exports=t},11:function(t,n){t.exports=e},21:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"Layout",function(){return c}),n.d(e,"Section",function(){return f});var r=n(0),o=(n.n(r),n(11)),i=(n.n(o),this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),a=this&&this.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},s=this&&this.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]]);return n},c=function(t){function e(){var e=t.call(this)||this;return e.handleBasis=e.handleBasis.bind(e),e}return i(e,t),e.prototype.render=function(){var t=this.props,e=t.basis,i=t.bottom,c=t.center,f=t.centerVertical,p=t.centerHorizontal,y=t.grow,m=t.horizontal,g=t.left,h=t.right,d=t.spacing,x=t.style,b=t.top,v=t.wrapEven,w=s(t,["basis","bottom","center","centerVertical","centerHorizontal","grow","horizontal","left","right","spacing","style","top","wrapEven"]),j={basis:e,bottom:i,center:c,centerVertical:f,centerHorizontal:p,grow:y,horizontal:m,left:g,right:h,spacing:d,top:b,wrapEven:v};return r.createElement(o.View,a({style:[l(j),x]},w),r.createElement(o.View,{style:u(j)},r.Children.map(w.children,function(t){return t?n.i(r.cloneElement)(t,{parentProps:j}):null}),e&&v&&this.handleBasis(j)))},e.prototype.handleBasis=function(t){var e=this.props,n=e.children,o=e.basis;if(n instanceof Array){n&&n.length;return n.map(function(e,n){return r.createElement(f,{key:n,basis:o,parentProps:t,style:{marginTop:0,marginBottom:0}})})}return null},e.displayName="Layout",e.defaultProps={spacing:0},e}(r.PureComponent),l=function(t){var e=t.grow;return a({},e&&{flex:"number"==typeof e?e:1},e&&{alignSelf:"stretch"})},u=function(t){var e=t.noWrap,n=t.horizontal,r=t.spacing,o=t.grow,i=t.center,s=t.centerVertical,c=t.centerHorizontal,l=t.top,u=t.right,f=t.bottom,p=t.left;return a({},n&&{flexWrap:"wrap"},e&&{flexWrap:"nowrap"},{flexDirection:n?"row":"column"},o&&{flex:"number"==typeof o?o:1},{margin:-r/2},n?a({},i&&{alignItems:"center",justifyContent:"center"},s&&{alignItems:"center"},c&&{justifyContent:"center"},l&&{alignItems:"flex-start"},u&&{justifyContent:"flex-end"},f&&{alignItems:"flex-end"},p&&{justifyContent:"flex-start"}):a({},i&&{alignItems:"center",justifyContent:"center"},s&&{justifyContent:"center"},c&&{alignItems:"center"},l&&{justifyContent:"flex-start"},u&&{alignItems:"flex-end"},f&&{justifyContent:"flex-end"},p&&{alignItems:"flex-start"}))},f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.render=function(){var t=this.props,e=t.style,n=s(t,["style"]);return r.createElement(o.View,{style:[p(n),e]},n.children)},e.displayName="Section",e}(r.PureComponent),p=function(t){var e=t.basis,n=t.grow,r=t.center,o=t.centerVertical,i=t.centerHorizontal,s=t.top,c=t.right,l=t.bottom,u=t.left,f=t.parentProps,p=f.spacing,y=e||f&&f.basis;return a({margin:p/2},y&&{flexBasis:y,flexGrow:1},n&&{flex:"number"==typeof n?n:1},r&&{alignItems:"center",justifyContent:"center"},o&&{justifyContent:"center"},i&&{alignItems:"center"},s&&{justifyContent:"flex-start"},c&&{alignItems:"flex-end"},l&&{justifyContent:"flex-end"},u&&{alignItems:"flex-start"})}}})}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-native")):"function"==typeof define&&define.amd?define("react-layout-views",["react","react-native"],e):"object"==typeof exports?exports["react-layout-views"]=e(require("react"),require("react-native")):t["react-layout-views"]=e(t.react,t["react-native"])}(this,function(t,e){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=21)}({0:function(e,n){e.exports=t},11:function(t,n){t.exports=e},21:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"Layout",function(){return c}),n.d(e,"Section",function(){return f});var r=n(0),o=(n.n(r),n(11)),i=(n.n(o),this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),a=this&&this.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},s=this&&this.__rest||function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&(n[r[o]]=t[r[o]]);return n},c=function(t){function e(){var e=t.call(this)||this;return e.handleBasis=e.handleBasis.bind(e),e}return i(e,t),e.prototype.render=function(){var t=this.props,e=t.basis,i=t.bottom,c=t.center,f=t.centerHorizontal,p=t.centerVertical,y=t.grow,g=t.horizontal,d=t.left,h=t.right,m=t.spacing,b=t.style,w=t.top,x=t.wrapEven,v=s(t,["basis","bottom","center","centerHorizontal","centerVertical","grow","horizontal","left","right","spacing","style","top","wrapEven"]),j={basis:e,bottom:i,center:c,centerHorizontal:f,centerVertical:p,grow:y,horizontal:g,left:d,right:h,spacing:m,top:w,wrapEven:x};return r.createElement(o.View,a({style:[l(j),b]},v),r.createElement(o.View,{style:u(j)},r.Children.map(v.children,function(t){return t?n.i(r.cloneElement)(t,{parentProps:j}):null}),e&&x&&this.handleBasis(j)))},e.prototype.handleBasis=function(t){var e=this.props,n=e.children,o=e.basis;if(n instanceof Array){n&&n.length;return n.map(function(e,n){return r.createElement(f,{key:n,basis:o,parentProps:t,wrapperStyle:{paddingTop:0,paddingBottom:0}})})}return null},e.displayName="Layout",e.defaultProps={spacing:0},e}(r.PureComponent),l=function(t){var e=t.grow;return a({},e&&{flexGrow:"number"==typeof e?e:1})},u=function(t){var e=t.noWrap,n=t.horizontal,r=t.spacing,o=t.grow,i=t.center,s=t.centerVertical,c=t.centerHorizontal,l=t.top,u=t.right,f=t.bottom,p=t.left;return a({},o&&{flexGrow:"number"==typeof o?o:1},n&&{flexWrap:"wrap"},e&&{flexWrap:"nowrap"},{flexDirection:n?"row":"column",margin:-r/2},n?a({},i&&{alignItems:"center",justifyContent:"center"},c&&{justifyContent:"center"},s&&{alignItems:"center"},f&&{alignItems:"flex-end"},p&&{justifyContent:"flex-start"},u&&{justifyContent:"flex-end"},l&&{alignItems:"flex-start"},{alignContent:"stretch"}):a({},i&&{alignItems:"center",justifyContent:"center"},c&&{alignItems:"center"},s&&{justifyContent:"center"},f&&{justifyContent:"flex-end"},p&&{alignItems:"flex-start"},u&&{alignItems:"flex-end"},l&&{justifyContent:"flex-start"}))},f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.render=function(){var t=this.props,e=t.style,n=t.wrapperStyle,i=t.children,a=s(t,["style","wrapperStyle","children"]);return r.createElement(o.View,{style:[p(a),n]},r.createElement(o.View,{style:[y(a),e]},i))},e.displayName="Section",e}(r.PureComponent),p=function(t){var e=t.basis,n=t.grow,r=(t.center,t.centerVertical,t.centerHorizontal,t.top,t.right,t.bottom,t.left,t.parentProps),o=r.spacing,i=e||r&&r.basis;return a({},r.horizontal&&!i?{flexDirection:"row"}:{},{padding:o/2,alignItems:"stretch"},i&&{flexBasis:i,flexGrow:1},n&&{flexGrow:"number"==typeof n?n:1})},y=function(t){var e=t.basis,n=t.grow,r=t.center,o=t.centerVertical,i=t.centerHorizontal,s=t.top,c=t.right,l=t.bottom,u=t.left,f=t.parentProps,p=(f.spacing,e||f&&f.basis),y=n;return a({},(y||p)&&{flexGrow:"number"==typeof y?y:1},o&&{justifyContent:"center"},i&&{alignItems:"center"},r&&{alignItems:"center",justifyContent:"center"},s&&{justifyContent:"flex-start"},c&&{alignItems:"flex-end"},l&&{justifyContent:"flex-end"},u&&{alignItems:"flex-start"})}}})}); |
{ | ||
"name": "react-layout-views", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"main": "./web/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./web/index.d.ts", |
@@ -1,16 +0,16 @@ | ||
import { ViewProperties } from 'react-native' | ||
import { ViewProperties, ViewStyle } from 'react-native' | ||
export interface LayoutProps extends ViewProperties { | ||
basis?: string | number | ||
bottom?: boolean | ||
center?: boolean | ||
centerHorizontal?: boolean | ||
centerVertical?: boolean | ||
grow?: boolean | number | ||
spacing: number | ||
horizontal?: boolean | ||
center?: boolean | ||
centerVertical?: boolean | ||
centerHorizontal?: boolean | ||
top?: boolean | ||
right?: boolean | ||
bottom?: boolean | ||
left?: boolean | ||
noWrap?: boolean | ||
right?: boolean | ||
spacing: number | ||
top?: boolean | ||
wrapEven?: boolean | ||
@@ -21,11 +21,12 @@ } | ||
basis?: string | number | ||
parentProps: LayoutProps | ||
grow?: boolean | number | ||
bottom?: boolean | ||
center?: boolean | ||
centerHorizontal?: boolean | ||
centerVertical?: boolean | ||
centerHorizontal?: boolean | ||
grow?: boolean | number | ||
left?: boolean | ||
parentProps: LayoutProps | ||
right?: boolean | ||
top?: boolean | ||
right?: boolean | ||
bottom?: boolean | ||
left?: boolean | ||
wrapperStyle?: ViewStyle | ||
} |
@@ -5,16 +5,16 @@ import * as React from 'react' | ||
basis?: string | ||
bottom?: boolean | ||
center?: boolean | ||
centerHorizontal?: boolean | ||
centerVertical?: boolean | ||
grow?: boolean | number | ||
horizontal?: boolean | ||
left?: boolean | ||
noWrap?: boolean | ||
right?: boolean | ||
spacing?: string | ||
spacingUnit?: string | ||
spacingValue?: number | ||
spacingUnit?: string | ||
styleString?: string | ||
horizontal?: boolean | ||
center?: boolean | ||
centerVertical?: boolean | ||
centerHorizontal?: boolean | ||
top?: boolean | ||
right?: boolean | ||
bottom?: boolean | ||
left?: boolean | ||
noWrap?: boolean | ||
wrapEven?: boolean | ||
@@ -25,12 +25,13 @@ } | ||
basis?: string | ||
bottom?: boolean | ||
center?: boolean | ||
centerHorizontal?: boolean | ||
centerVertical?: boolean | ||
grow?: boolean | number | ||
left?: boolean | ||
parentProps?: LayoutProps | ||
right?: boolean | ||
styleString?: string | ||
grow?: boolean | number | ||
center?: boolean | ||
centerVertical?: boolean | ||
centerHorizontal?: boolean | ||
top?: boolean | ||
right?: boolean | ||
bottom?: boolean | ||
left?: boolean | ||
wrapperStyle?: React.CSSProperties | ||
} |
@@ -10,3 +10,3 @@ /// <reference types="react" /> | ||
render(): JSX.Element; | ||
handleBasis(trimmedProps: object): JSX.Element[] | null; | ||
handleBasis(trimmedProps: LayoutProps): JSX.Element[] | null; | ||
} | ||
@@ -13,0 +13,0 @@ export declare type SectionProps = SectionProps; |
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("css-length"),require("styled-components")):"function"==typeof define&&define.amd?define("react-layout-views",["react","css-length","styled-components"],t):"object"==typeof exports?exports["react-layout-views"]=t(require("react"),require("css-length"),require("styled-components")):n["react-layout-views"]=t(n.react,n["css-length"],n["styled-components"])}(this,function(n,t,e){return function(n){function t(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return n[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var e={};return t.m=n,t.c=e,t.i=function(n){return n},t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=22)}([function(t,e){t.exports=n},function(n,t){"use exports";n.exports={animation:1,"column-count":1,columns:1,"font-weight":1,opacity:1,"order ":1,"z-index":1,zoom:1,flex:1,"box-flex":1,transform:1,perspective:1,"box-pack":1,"box-align":1,colspan:1,rowspan:1}},function(n,t,e){"use strict";var r=Object.prototype.hasOwnProperty;n.exports=function(n,t){return r.call(n,t)}},function(n,t,e){"use strict";var r=e(7),i=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,o="undefined"==typeof document?{}:document.documentElement.style,s=function(){var n=function(){for(var n in o)if(i.test(n))return n.match(i)[0];return"WebkitOpacity"in o?"Webkit":"KhtmlOpacity"in o?"Khtml":""}();return{style:n,css:"-"+n.toLowerCase()+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[n]||r(n)}}();n.exports=s},function(n,t){n.exports={"border-radius":1,"border-top-left-radius":1,"border-top-right-radius":1,"border-bottom-left-radius":1,"border-bottom-right-radius":1,"box-shadow":1,order:1,flex:function(n,t){return[t+"box-flex"]},"box-flex":1,"box-align":1,animation:1,"animation-duration":1,"animation-name":1,transition:1,"transition-duration":1,transform:1,"transform-style":1,"transform-origin":1,"backface-visibility":1,perspective:1,"box-pack":1}},function(n,t,e){"use strict";var r=function(n,t){return t?t.toUpperCase():""},i=e(17);n.exports=function(n){return n?n.replace(i,r):""}},function(n,t,e){"use strict";var r=e(18);n.exports=function(n){return r(n).toLowerCase()}},function(n,t,e){"use strict";n.exports=function(n){return n.length?n.charAt(0).toUpperCase()+n.substring(1):n}},function(n,t,e){"use strict";var r=(e(3),e(13)),i=e(6),o=e(5),s=e(2),c=e(15),a=e(14),u=function(n,t,e,i){r(t).forEach(function(t){n[i?i(t):t]=e})},l=function(n){n=(n||"").split(";");var t={};return n.forEach(function(n){var e=n.split(":");2==e.length&&(t[e[0].trim()]=e[1].trim())}),t},f={cssUnitless:e(1)},p=function(n,t,e,r){"string"==typeof n&&(n=l(n)),t=t||f,t.cssUnitless=t.cssUnitless||f.cssUnitless,r=r||{};var d,g,y,m,x,b,h,v,w=t.scope||{},j=null!=t.addUnits?t.addUnits:!w||null==w.addUnits||w.addUnits,O=(null!=t.cssUnitless?t.cssUnitless:w?w.cssUnitless:null)||{},_=(t.cssUnit||w?w.cssUnit:null)||"px",P=t.prefixProperties||(w?w.prefixProperties:null)||{},U=t.camelize,z=U?o:i;for(y in n)if(s(n,y)){if(m=n[y],g=i(e?e+y:y),d=!1,v=!1,a(m)&&(h=m.call(w||n,m,y,g,n),c(h)&&null!=h.value?(m=h.value,v=h.prefix,g=h.name?i(h.name):g):m=h),x=typeof m,b="number"==x||"string"==x&&""!=m&&1*m==m,null==m||null==g||""===g)continue;if((b||"string"==x)&&(d=!0),!d&&null!=m.value&&m.prefix&&(d=!0,v=m.prefix,m=m.value),d){if(v=v||!!P[g],b&&(m=!j||g in O?m+"":m+_),"border"!=g&&(g.indexOf("border")||~g.indexOf("radius")||~g.indexOf("width"))||!b||(g+="-width"),!g.indexOf("border-radius-")&&(g.replace(/border(-radius)(-(.*))/,function(n,t,e){var r={"-top":["-top-left","-top-right"],"-left":["-top-left","-bottom-left"],"-right":["-top-right","-bottom-right"],"-bottom":["-bottom-left","-bottom-right"]};e in r?(g=[],r[e].forEach(function(n){g.push("border"+n+t)})):g="border"+e+t}),Array.isArray(g))){g.forEach(function(n){v?u(r,n,m,z):r[z(n)]=m});continue}v?u(r,g,m,z):r[z(g)]=m}else p(m,t,g+"-",r)}return r};n.exports=p},function(n,t,e){"use strict";n.exports={prefixProperties:e(4),cssUnitless:e(1),object:e(8),string:e(20)}},function(n,e){n.exports=t},,function(n,t){n.exports=e},function(n,t,e){n.exports=e(16)()},function(n,t,e){"use strict";var r=Object.prototype.toString;n.exports=function(n){return"[object Function]"===r.apply(n)}},function(n,t,e){"use strict";var r=Object.prototype.toString;n.exports=function(n){return!!n&&"[object Object]"===r.call(n)}},function(n,t,e){"use strict";var r=e(5),i=e(6),o=e(19),s=e(7),c=e(3),a=e(4),u="undefined"==typeof document?{}:document.documentElement.style;n.exports=function(n){return function(t,e){e=e||{};var l=o(r(t)),f=i(t),p=n?l:f,d=c.style?n?c.style:c.css:"";if(l in u)return e.asString?p:[p];var g=p,y=a[f],m=[];if(n&&(g=s(p)),"function"==typeof y){var x=y(p,d)||[];x&&!Array.isArray(x)&&(x=[x]),x.length&&(x=x.map(function(t){return n?o(r(t)):i(t)})),m=m.concat(x)}return d&&m.push(d+g),m.push(p),e.asString||1==m.length?m[0]:m}}},function(n,t){n.exports=/[-\s]+(.)?/g},function(n,t,e){"use strict";var r=/::/g,i=/([A-Z]+)([A-Z][a-z])/g,o=/([a-z\d])([A-Z])/g,s=/_/g;n.exports=function(n,t){return n?n.replace(r,"/").replace(i,"$1_$2").replace(o,"$1_$2").replace(s,t||"-"):""}},function(n,t,e){"use strict";n.exports=function(n){return n.length?n.charAt(0).toLowerCase()+n.substring(1):n}},function(n,t,e){"use strict";var r=e(8),i=e(2);n.exports=function(n,t){n=r(n,t);var e,o=[];for(e in n)i(n,e)&&o.push(e+": "+n[e]);return o.join("; ")}},,function(n,t,e){"use strict";function r(){return function(n){return n}}Object.defineProperty(t,"__esModule",{value:!0}),e.d(t,"Layout",function(){return j}),e.d(t,"Section",function(){return P});var i,o,s,c,a,u,l,f,p=e(0),d=(e.n(p),e(12)),g=e.n(d),y=e(10),m=(e.n(y),e(9)),x=(e.n(m),this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])};return function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}()),b=this&&this.__makeTemplateObject||function(n,t){return Object.defineProperty?Object.defineProperty(n,"raw",{value:t}):n.raw=t,n},h=this&&this.__assign||Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},v=this&&this.__rest||function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&(e[r[i]]=n[r[i]]);return e},w=function(n,t){return n?t||"":""},j=function(n){function t(){var t=n.call(this)||this;return t.handleBasis=t.handleBasis.bind(t),t}return x(t,n),t.prototype.render=function(){var n=this.props,t=n.basis,r=n.bottom,i=n.center,o=n.centerVertical,s=n.centerHorizontal,c=n.grow,a=n.horizontal,u=n.left,l=n.noWrap,f=n.right,d=(n.spacing,n.style,n.top),g=n.wrapEven,x=v(n,["basis","bottom","center","centerVertical","centerHorizontal","grow","horizontal","left","noWrap","right","spacing","style","top","wrapEven"]),b=e.i(m.string)(this.props.style),w=new y(this.props.spacing),j=w.value,P=w.unit,U={basis:t,bottom:r,center:i,centerVertical:o,centerHorizontal:s,grow:c,horizontal:a,left:u,noWrap:l,right:f,spacingValue:j,spacingUnit:P,styleString:b,top:d,wrapEven:g};return p.createElement(O,h({},U,x),p.createElement(_,h({},U),p.Children.map(x.children,function(n){return n?e.i(p.cloneElement)(n,{parentProps:U}):null}),t&&g&&this.handleBasis(U)))},t.prototype.handleBasis=function(n){var t=this.props,e=t.children,r=t.basis;if(e instanceof Array){e&&e.length;return e.map(function(t){return p.createElement(P,{basis:r,parentProps:n,style:{marginTop:0,marginBottom:0}})})}return null},t.displayName="Layout",t.defaultProps={spacing:"0px",spacingValue:0,spacingUnit:"px"},t}(p.PureComponent),O=r()(g.a.div)(o||(o=b(["\n ","\n"],["\n ","\n"])),function(n){var t=n.grow,r=(n.horizontal,n.styleString);return e.i(d.css)(i||(i=b(["\n overflow: hidden;\n display: flex;\n ","\n ","\n ","\n "],["\n overflow: hidden;\n display: flex;\n ","\n ","\n ","\n "])),w(t,"flex: "+("number"==typeof t?t:1)+";"),w(t,"align-self: stretch;"),w(r,r))}),_=r()(g.a.div)(u||(u=b(["\n ","\n"],["\n ","\n"])),function(n){var t=n.noWrap,r=n.horizontal,i=n.grow,o=n.spacingValue,u=n.spacingUnit,l=n.center,f=n.centerVertical,p=n.centerHorizontal,g=n.top,y=n.right,m=n.bottom,x=n.left;return e.i(d.css)(a||(a=b(["\n display: flex;\n flex: 1;\n ","\n ","\n ","\n flex-direction: ",";\n ","\n ","\n "],["\n display: flex;\n flex: 1;\n ","\n ","\n ","\n flex-direction: ",";\n ","\n ","\n "])),w(r,"flex-wrap: wrap;"),w(t,"flex-wrap: nowrap;"),w(i||r,"align-self: stretch;"),r?"row":"column",w(o&&u,"margin: "+((-(o||0)/2).toString()+u)+";"),r?e.i(d.css)(s||(s=b(["\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n "],["\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n "])),w(l,"align-items: center; justify-content: center;"),w(f,"align-items: center;"),w(p,"justify-content: center;"),w(g,"align-items: flex-start;"),w(y,"justify-content: flex-end;"),w(m,"align-items: flex-end;"),w(x,"justify-content: flex-start;")):e.i(d.css)(c||(c=b(["\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n "],["\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n "])),w(l,"align-items: center; justify-content: center;"),w(f,"justify-content: center;"),w(p,"align-items: center;"),w(g,"justify-content: flex-start;"),w(y,"align-items: flex-end;"),w(m,"justify-content: flex-end;"),w(x,"align-items: flex-start;")))}),P=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return x(t,n),t.prototype.render=function(){var n=this.props,t=n.style,r=v(n,["style"]),i=e.i(m.string)(t);return p.createElement(U,h({},r,{styleString:i}),r.children)},t.displayName="Section",t}(p.PureComponent),U=r()(g.a.div)(f||(f=b(["\n ","\n"],["\n ","\n"])),function(n){var t=n.basis,r=n.grow,i=n.center,o=n.centerVertical,s=n.centerHorizontal,c=n.top,a=n.right,u=n.bottom,f=n.left,p=n.parentProps,g=n.styleString,y=t||p&&p.basis;return e.i(d.css)(l||(l=b(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n margin: ",";\n ","\n ","\n ","\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n ","\n ","\n "],["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n margin: ",";\n ","\n ","\n ","\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n ","\n ","\n "])),((p&&p.spacingValue||0)/2).toString()+(p&&p.spacingUnit),w(y,"flex-basis: "+y+";"),w(y,"flex-grow: 1;"),w(r,"flex: "+("number"==typeof r?r:1)+";"),w(i,"align-items: center; justify-content: center;"),w(o,"justify-content: center;"),w(s,"align-items: center;"),w(i,"align-items: center; justify-content: center;"),w(c,"justify-content: flex-start;"),w(a,"align-items: flex-end;"),w(u,"justify-content: flex-end;"),w(f,"align-items: flex-start;"),w(g,g))})}])}); | ||
!function(n,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("css-length"),require("styled-components")):"function"==typeof define&&define.amd?define("react-layout-views",["react","css-length","styled-components"],t):"object"==typeof exports?exports["react-layout-views"]=t(require("react"),require("css-length"),require("styled-components")):n["react-layout-views"]=t(n.react,n["css-length"],n["styled-components"])}(this,function(n,t,e){return function(n){function t(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return n[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var e={};return t.m=n,t.c=e,t.i=function(n){return n},t.d=function(n,e,r){t.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:r})},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=22)}([function(t,e){t.exports=n},function(n,t){"use exports";n.exports={animation:1,"column-count":1,columns:1,"font-weight":1,opacity:1,"order ":1,"z-index":1,zoom:1,flex:1,"box-flex":1,transform:1,perspective:1,"box-pack":1,"box-align":1,colspan:1,rowspan:1}},function(n,t,e){"use strict";var r=Object.prototype.hasOwnProperty;n.exports=function(n,t){return r.call(n,t)}},function(n,t,e){"use strict";var r=e(7),i=/^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,o="undefined"==typeof document?{}:document.documentElement.style,s=function(){var n=function(){for(var n in o)if(i.test(n))return n.match(i)[0];return"WebkitOpacity"in o?"Webkit":"KhtmlOpacity"in o?"Khtml":""}();return{style:n,css:"-"+n.toLowerCase()+"-",dom:{Webkit:"WebKit",ms:"MS",o:"WebKit"}[n]||r(n)}}();n.exports=s},function(n,t){n.exports={"border-radius":1,"border-top-left-radius":1,"border-top-right-radius":1,"border-bottom-left-radius":1,"border-bottom-right-radius":1,"box-shadow":1,order:1,flex:function(n,t){return[t+"box-flex"]},"box-flex":1,"box-align":1,animation:1,"animation-duration":1,"animation-name":1,transition:1,"transition-duration":1,transform:1,"transform-style":1,"transform-origin":1,"backface-visibility":1,perspective:1,"box-pack":1}},function(n,t,e){"use strict";var r=function(n,t){return t?t.toUpperCase():""},i=e(17);n.exports=function(n){return n?n.replace(i,r):""}},function(n,t,e){"use strict";var r=e(18);n.exports=function(n){return r(n).toLowerCase()}},function(n,t,e){"use strict";n.exports=function(n){return n.length?n.charAt(0).toUpperCase()+n.substring(1):n}},function(n,t,e){"use strict";var r=(e(3),e(13)),i=e(6),o=e(5),s=e(2),c=e(15),a=e(14),l=function(n,t,e,i){r(t).forEach(function(t){n[i?i(t):t]=e})},u=function(n){n=(n||"").split(";");var t={};return n.forEach(function(n){var e=n.split(":");2==e.length&&(t[e[0].trim()]=e[1].trim())}),t},f={cssUnitless:e(1)},p=function(n,t,e,r){"string"==typeof n&&(n=u(n)),t=t||f,t.cssUnitless=t.cssUnitless||f.cssUnitless,r=r||{};var d,x,g,y,b,m,h,v,w=t.scope||{},j=null!=t.addUnits?t.addUnits:!w||null==w.addUnits||w.addUnits,O=(null!=t.cssUnitless?t.cssUnitless:w?w.cssUnitless:null)||{},_=(t.cssUnit||w?w.cssUnit:null)||"px",P=t.prefixProperties||(w?w.prefixProperties:null)||{},z=t.camelize,S=z?o:i;for(g in n)if(s(n,g)){if(y=n[g],x=i(e?e+g:g),d=!1,v=!1,a(y)&&(h=y.call(w||n,y,g,x,n),c(h)&&null!=h.value?(y=h.value,v=h.prefix,x=h.name?i(h.name):x):y=h),b=typeof y,m="number"==b||"string"==b&&""!=y&&1*y==y,null==y||null==x||""===x)continue;if((m||"string"==b)&&(d=!0),!d&&null!=y.value&&y.prefix&&(d=!0,v=y.prefix,y=y.value),d){if(v=v||!!P[x],m&&(y=!j||x in O?y+"":y+_),"border"!=x&&(x.indexOf("border")||~x.indexOf("radius")||~x.indexOf("width"))||!m||(x+="-width"),!x.indexOf("border-radius-")&&(x.replace(/border(-radius)(-(.*))/,function(n,t,e){var r={"-top":["-top-left","-top-right"],"-left":["-top-left","-bottom-left"],"-right":["-top-right","-bottom-right"],"-bottom":["-bottom-left","-bottom-right"]};e in r?(x=[],r[e].forEach(function(n){x.push("border"+n+t)})):x="border"+e+t}),Array.isArray(x))){x.forEach(function(n){v?l(r,n,y,S):r[S(n)]=y});continue}v?l(r,x,y,S):r[S(x)]=y}else p(y,t,x+"-",r)}return r};n.exports=p},function(n,t,e){"use strict";n.exports={prefixProperties:e(4),cssUnitless:e(1),object:e(8),string:e(20)}},function(n,e){n.exports=t},,function(n,t){n.exports=e},function(n,t,e){n.exports=e(16)()},function(n,t,e){"use strict";var r=Object.prototype.toString;n.exports=function(n){return"[object Function]"===r.apply(n)}},function(n,t,e){"use strict";var r=Object.prototype.toString;n.exports=function(n){return!!n&&"[object Object]"===r.call(n)}},function(n,t,e){"use strict";var r=e(5),i=e(6),o=e(19),s=e(7),c=e(3),a=e(4),l="undefined"==typeof document?{}:document.documentElement.style;n.exports=function(n){return function(t,e){e=e||{};var u=o(r(t)),f=i(t),p=n?u:f,d=c.style?n?c.style:c.css:"";if(u in l)return e.asString?p:[p];var x=p,g=a[f],y=[];if(n&&(x=s(p)),"function"==typeof g){var b=g(p,d)||[];b&&!Array.isArray(b)&&(b=[b]),b.length&&(b=b.map(function(t){return n?o(r(t)):i(t)})),y=y.concat(b)}return d&&y.push(d+x),y.push(p),e.asString||1==y.length?y[0]:y}}},function(n,t){n.exports=/[-\s]+(.)?/g},function(n,t,e){"use strict";var r=/::/g,i=/([A-Z]+)([A-Z][a-z])/g,o=/([a-z\d])([A-Z])/g,s=/_/g;n.exports=function(n,t){return n?n.replace(r,"/").replace(i,"$1_$2").replace(o,"$1_$2").replace(s,t||"-"):""}},function(n,t,e){"use strict";n.exports=function(n){return n.length?n.charAt(0).toLowerCase()+n.substring(1):n}},function(n,t,e){"use strict";var r=e(8),i=e(2);n.exports=function(n,t){n=r(n,t);var e,o=[];for(e in n)i(n,e)&&o.push(e+": "+n[e]);return o.join("; ")}},,function(n,t,e){"use strict";function r(){return function(n){return n}}Object.defineProperty(t,"__esModule",{value:!0}),e.d(t,"Layout",function(){return _}),e.d(t,"Section",function(){return S});var i,o,s,c,a,l,u,f,p,d,x=e(0),g=(e.n(x),e(12)),y=e.n(g),b=e(10),m=(e.n(b),e(9)),h=(e.n(m),this&&this.__extends||function(){var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])};return function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}}()),v=this&&this.__makeTemplateObject||function(n,t){return Object.defineProperty?Object.defineProperty(n,"raw",{value:t}):n.raw=t,n},w=this&&this.__assign||Object.assign||function(n){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},j=this&&this.__rest||function(n,t){var e={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.indexOf(r)<0&&(e[r]=n[r]);if(null!=n&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)t.indexOf(r[i])<0&&(e[r[i]]=n[r[i]]);return e},O=function(n,t){return n?t||"":""},_=function(n){function t(){var t=n.call(this)||this;return t.handleBasis=t.handleBasis.bind(t),t}return h(t,n),t.prototype.render=function(){var n=this.props,t=n.basis,r=n.bottom,i=n.center,o=n.centerHorizontal,s=n.centerVertical,c=n.grow,a=n.horizontal,l=n.left,u=n.noWrap,f=n.right,p=(n.spacing,n.style,n.top),d=n.wrapEven,g=j(n,["basis","bottom","center","centerHorizontal","centerVertical","grow","horizontal","left","noWrap","right","spacing","style","top","wrapEven"]),y=e.i(m.string)(this.props.style),h=new b(this.props.spacing),v=h.value,O=h.unit,_={basis:t,bottom:r,center:i,centerHorizontal:o,centerVertical:s,grow:c,horizontal:a,left:l,noWrap:u,right:f,spacingUnit:O,spacingValue:v,styleString:y,top:p,wrapEven:d};return x.createElement(P,w({},_,g),x.createElement(z,w({},_),x.Children.map(g.children,function(n){return n?e.i(x.cloneElement)(n,{parentProps:_}):null}),t&&d&&this.handleBasis(_)))},t.prototype.handleBasis=function(n){var t=this.props,e=t.children,r=t.basis;if(e instanceof Array){e&&e.length;return e.map(function(t){return x.createElement(S,{basis:r,parentProps:n,wrapperStyle:{paddingTop:0,paddingBottom:0}})})}return null},t.displayName="Layout",t.defaultProps={spacing:"0px",spacingValue:0,spacingUnit:"px"},t}(x.PureComponent),P=r()(y.a.div)(o||(o=v(["\n ","\n"],["\n ","\n"])),function(n){var t=n.grow,r=(n.horizontal,n.styleString);return e.i(g.css)(i||(i=v(["\n overflow: hidden;\n display: flex;\n ","\n ","\n ","\n "],["\n overflow: hidden;\n display: flex;\n ","\n ","\n ","\n "])),O(t,"flex: "+("number"==typeof t?t:1)+";"),O(t,"align-self: stretch;"),O(r,r))}),z=r()(y.a.div)(l||(l=v(["\n ","\n"],["\n ","\n"])),function(n){var t=n.noWrap,r=n.horizontal,i=n.grow,o=n.spacingValue,l=n.spacingUnit,u=n.center,f=n.centerVertical,p=n.centerHorizontal,d=n.top,x=n.right,y=n.bottom,b=n.left;return e.i(g.css)(a||(a=v(["\n display: flex;\n flex: 1;\n ","\n ","\n ","\n flex-direction: ",";\n ","\n ","\n "],["\n display: flex;\n flex: 1;\n ","\n ","\n ","\n flex-direction: ",";\n ","\n ","\n "])),O(r,"flex-wrap: wrap;"),O(t,"flex-wrap: nowrap;"),O(i||r,"align-self: stretch;"),r?"row":"column",O(o&&l,"margin: "+((-(o||0)/2).toString()+l)+";"),r?e.i(g.css)(s||(s=v(["\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n "],["\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n "])),O(u,"align-items: center; justify-content: center;"),O(f,"align-items: center;"),O(p,"justify-content: center;"),O(d,"align-items: flex-start;"),O(x,"justify-content: flex-end;"),O(y,"align-items: flex-end;"),O(b,"justify-content: flex-start;")):e.i(g.css)(c||(c=v(["\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n "],["\n ","\n "," \n "," \n ","\n ","\n ","\n ","\n "])),O(u,"align-items: center; justify-content: center;"),O(f,"justify-content: center;"),O(p,"align-items: center;"),O(d,"justify-content: flex-start;"),O(x,"align-items: flex-end;"),O(y,"justify-content: flex-end;"),O(b,"align-items: flex-start;")))}),S=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return h(t,n),t.prototype.render=function(){var n=this.props,t=n.style,r=n.wrapperStyle,i=n.children,o=j(n,["style","wrapperStyle","children"]),s=e.i(m.string)(r),c=e.i(m.string)(t);return x.createElement(U,w({},o,{styleString:s}),x.createElement(E,w({},o,{styleString:c}),i))},t.displayName="Section",t}(x.PureComponent),U=r()(y.a.div)(f||(f=v(["\n ","\n"],["\n ","\n"])),function(n){var t=n.basis,r=n.grow,i=n.parentProps,o=n.styleString,s=t||i&&i.basis;return e.i(g.css)(u||(u=v(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: ",";\n ","\n ","\n ","\n "],["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n padding: ",";\n ","\n ","\n ","\n "])),((i&&i.spacingValue||0)/2).toString()+(i&&i.spacingUnit),O(s,"flex-basis: "+s+"; flex-grow: 1;"),O(r,"flex: "+("number"==typeof r?r:1)+";"),O(o,o))}),E=r()(y.a.div)(d||(d=v(["\n ","\n"],["\n ","\n"])),function(n){var t=n.center,r=n.centerVertical,i=n.centerHorizontal,o=n.top,s=n.right,c=n.bottom,a=n.left,l=(n.parentProps,n.styleString);return e.i(g.css)(p||(p=v(["\n display: flex;\n flex: 1;\n flex-direction: column;\n box-sizing: border-box;\n "," \n "," \n ","\n ","\n ","\n ","\n ","\n ","\n "],["\n display: flex;\n flex: 1;\n flex-direction: column;\n box-sizing: border-box;\n "," \n "," \n ","\n ","\n ","\n ","\n ","\n ","\n "])),O(r,"justify-content: center;"),O(i,"align-items: center;"),O(t,"align-items: center; justify-content: center;"),O(o,"justify-content: flex-start;"),O(s,"align-items: flex-end;"),O(c,"justify-content: flex-end;"),O(a,"align-items: flex-start;"),O(l,l))})}])}); |
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
25410
93