react-split-grid
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -206,3 +206,3 @@ import React from 'react'; | ||
: !(React.Children.count(children) === 0) | ||
? React.Chidren.only(children) | ||
? React.Children.only(children) | ||
: null | ||
@@ -209,0 +209,0 @@ : null |
@@ -1,2 +0,2 @@ | ||
/*! react-split-grid - v1.0.2 */ | ||
/*! react-split-grid - v1.0.3 */ | ||
@@ -6,8 +6,8 @@ (function (global, factory) { | ||
typeof define === 'function' && define.amd ? define(['react', 'prop-types', 'split-grid'], factory) : | ||
(global.ReactSplitGrid = factory(global.React,global.PropTypes,global.Split)); | ||
}(this, (function (React,PropTypes,Split) { 'use strict'; | ||
(global = global || self, global.ReactSplitGrid = factory(global.React, global.PropTypes, global.Split)); | ||
}(this, (function (React, PropTypes, Split) { 'use strict'; | ||
React = React && React.hasOwnProperty('default') ? React['default'] : React; | ||
PropTypes = PropTypes && PropTypes.hasOwnProperty('default') ? PropTypes['default'] : PropTypes; | ||
Split = Split && Split.hasOwnProperty('default') ? Split['default'] : Split; | ||
React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React; | ||
PropTypes = PropTypes && Object.prototype.hasOwnProperty.call(PropTypes, 'default') ? PropTypes['default'] : PropTypes; | ||
Split = Split && Object.prototype.hasOwnProperty.call(Split, 'default') ? Split['default'] : Split; | ||
@@ -215,3 +215,3 @@ function objectWithoutProperties (obj, exclude) { var target = {}; for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) target[k] = obj[k]; return target; } | ||
: !(React.Children.count(children) === 0) | ||
? React.Chidren.only(children) | ||
? React.Children.only(children) | ||
: null | ||
@@ -218,0 +218,0 @@ : null |
@@ -1,3 +0,3 @@ | ||
/*! react-split-grid - v1.0.2 */ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("prop-types"),require("split-grid")):"function"==typeof define&&define.amd?define(["react","prop-types","split-grid"],e):t.ReactSplitGrid=e(t.React,t.PropTypes,t.Split)}(this,function(n,t,a){"use strict";function u(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&-1===e.indexOf(i)&&(r[i]=t[i]);return r}n=n&&n.hasOwnProperty("default")?n.default:n,t=t&&t.hasOwnProperty("default")?t.default:t,a=a&&a.hasOwnProperty("default")?a.default:a;var e=function(e){function t(t){e.call(this,t),this.columnGutters={},this.rowGutters={},this.state={gridTemplateColumns:t.gridTemplateColumns?t.gridTemplateColumns:null,gridTemplateRows:t.gridTemplateRows?t.gridTemplateRows:null},this.getGridProps=this.getGridProps.bind(this),this.getGutterProps=this.getGutterProps.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.writeStyle=this.writeStyle.bind(this),this.onDrag=this.onDrag.bind(this)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.componentDidMount=function(){var t=this.props,e=(t.children,u(t,["children"]));e.writeStyle=this.writeStyle,e.onDrag=this.onDrag,this.split=a(e)},t.prototype.componentDidUpdate=function(e){var r=this,t=this.props,i=t.columnMinSizes,o=t.rowMinSizes,n=(t.children,u(t,["columnMinSizes","rowMinSizes","children"])),s=e.columnMinSizes,p=e.rowMinSizes,l=["minSize","columnMinSize","rowMinSize","columnMinSizes","rowMinSizes","snapOffset","columnSnapOffset","rowSnapOffset","dragInterval","columnDragInterval","rowDragInterval","cursor","columnCursor","rowCursor"].map(function(t){return r.props[t]!==e[t]}).reduce(function(t,e){return t||e},!1);i!==s&&(l=!0),o!==p&&(l=!0),l&&(n.columnMinSizes=i,n.rowMinSizes=o,this.split.destroy(!1),this.split=a(n))},t.prototype.componentWillUnmount=function(){this.split.destroy(),delete this.split},t.getDerivedStateFromProps=function(t,e){var r={},i=!1;return t.gridTemplateColumns&&t.gridTemplateColumns!==e.gridTemplateColumns&&(r.gridTemplateColumns=t.gridTemplateColumns,i=!0),t.gridTemplateRows&&t.gridTemplateRows!==e.prevGridTemplateRows&&(r.gridTemplateRows=t.gridTemplateRows,i=!0),i?r:null},t.prototype.onDrag=function(t,e,r){var i=this.props.onDrag;i&&i(t,e,r)},t.prototype.getGridProps=function(){var t=this.state,e=t.gridTemplateColumns,r=t.gridTemplateRows,i={};return e&&(i.gridTemplateColumns=e),r&&(i.gridTemplateRows=r),{style:i}},t.prototype.getGutterProps=function(t,e){return{onMouseDown:this.handleDragStart(t,e),onTouchStart:this.handleDragStart(t,e)}},t.prototype.handleDragStart=function(e,r){var i=this;return function(t){i.split.handleDragStart(t,e,r)}},t.prototype.writeStyle=function(t,e,r){var i={};"grid-template-columns"===e?i.gridTemplateColumns=r:"grid-template-rows"===e&&(i.gridTemplateRows=r),this.setState(i)},t.prototype.render=function(){var t=this.props,e=t.component,r=t.render,i=t.children,o={getGridProps:this.getGridProps,getGutterProps:this.getGutterProps};return e?n.createElement(e,o):r?r(o):i?"function"==typeof i?i(o):0!==n.Children.count(i)?n.Chidren.only(i):null:null},t}(n.Component);return e.propTypes={component:t.element,render:t.func,children:t.element,gridTemplateColumns:t.string,gridTemplateRows:t.string,columnMinSizes:t.arrayOf(t.number),rowMinSizes:t.arrayOf(t.number),onDrag:t.func},e.defaultProps={component:void 0,render:void 0,children:void 0,gridTemplateColumns:void 0,gridTemplateRows:void 0,columnMinSizes:void 0,rowMinSizes:void 0,onDrag:void 0},e}); | ||
/*! react-split-grid - v1.0.3 */ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("react"),require("prop-types"),require("split-grid")):"function"==typeof define&&define.amd?define(["react","prop-types","split-grid"],e):(t=t||self).ReactSplitGrid=e(t.React,t.PropTypes,t.Split)}(this,(function(t,e,r){"use strict";function o(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&-1===e.indexOf(o)&&(r[o]=t[o]);return r}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t,e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e,r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;var i=function(e){function i(t){e.call(this,t),this.columnGutters={},this.rowGutters={},this.state={gridTemplateColumns:t.gridTemplateColumns?t.gridTemplateColumns:null,gridTemplateRows:t.gridTemplateRows?t.gridTemplateRows:null},this.getGridProps=this.getGridProps.bind(this),this.getGutterProps=this.getGutterProps.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.writeStyle=this.writeStyle.bind(this),this.onDrag=this.onDrag.bind(this)}return e&&(i.__proto__=e),i.prototype=Object.create(e&&e.prototype),i.prototype.constructor=i,i.prototype.componentDidMount=function(){var t=this.props,e=(t.children,o(t,["children"]));e.writeStyle=this.writeStyle,e.onDrag=this.onDrag,this.split=r(e)},i.prototype.componentDidUpdate=function(t){var e=this,i=this.props,n=i.columnMinSizes,s=i.rowMinSizes,p=(i.children,o(i,["columnMinSizes","rowMinSizes","children"])),l=t.columnMinSizes,a=t.rowMinSizes,u=["minSize","columnMinSize","rowMinSize","columnMinSizes","rowMinSizes","snapOffset","columnSnapOffset","rowSnapOffset","dragInterval","columnDragInterval","rowDragInterval","cursor","columnCursor","rowCursor"].map((function(r){return e.props[r]!==t[r]})).reduce((function(t,e){return t||e}),!1);n!==l&&(u=!0),s!==a&&(u=!0),u&&(p.columnMinSizes=n,p.rowMinSizes=s,this.split.destroy(!1),this.split=r(p))},i.prototype.componentWillUnmount=function(){this.split.destroy(),delete this.split},i.getDerivedStateFromProps=function(t,e){var r={},o=!1;return t.gridTemplateColumns&&t.gridTemplateColumns!==e.gridTemplateColumns&&(r.gridTemplateColumns=t.gridTemplateColumns,o=!0),t.gridTemplateRows&&t.gridTemplateRows!==e.prevGridTemplateRows&&(r.gridTemplateRows=t.gridTemplateRows,o=!0),o?r:null},i.prototype.onDrag=function(t,e,r){var o=this.props.onDrag;o&&o(t,e,r)},i.prototype.getGridProps=function(){var t=this.state,e=t.gridTemplateColumns,r=t.gridTemplateRows,o={};return e&&(o.gridTemplateColumns=e),r&&(o.gridTemplateRows=r),{style:o}},i.prototype.getGutterProps=function(t,e){return{onMouseDown:this.handleDragStart(t,e),onTouchStart:this.handleDragStart(t,e)}},i.prototype.handleDragStart=function(t,e){var r=this;return function(o){r.split.handleDragStart(o,t,e)}},i.prototype.writeStyle=function(t,e,r){var o={};"grid-template-columns"===e?o.gridTemplateColumns=r:"grid-template-rows"===e&&(o.gridTemplateRows=r),this.setState(o)},i.prototype.render=function(){var e=this.props,r=e.component,o=e.render,i=e.children,n={getGridProps:this.getGridProps,getGutterProps:this.getGutterProps};return r?t.createElement(r,n):o?o(n):i?"function"==typeof i?i(n):0!==t.Children.count(i)?t.Children.only(i):null:null},i}(t.Component);return i.propTypes={component:e.element,render:e.func,children:e.element,gridTemplateColumns:e.string,gridTemplateRows:e.string,columnMinSizes:e.arrayOf(e.number),rowMinSizes:e.arrayOf(e.number),onDrag:e.func},i.defaultProps={component:void 0,render:void 0,children:void 0,gridTemplateColumns:void 0,gridTemplateRows:void 0,columnMinSizes:void 0,rowMinSizes:void 0,onDrag:void 0},i})); | ||
//# sourceMappingURL=react-split-grid.min.js.map |
@@ -1,2 +0,2 @@ | ||
Copyright (c) 2018 Nathan Cahill | ||
Copyright (c) 2020 Nathan Cahill | ||
@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "react-split-grid", | ||
"version": "1.0.2", | ||
"description": "React component for Split Grid", | ||
"main": "dist/react-split-grid.js", | ||
"minified:main": "dist/react-split-grid.min.js", | ||
"module": "dist/react-split-grid.es.js", | ||
"scripts": { | ||
"build": "rollup -c && npm run size", | ||
"watch": "rollup -cw", | ||
"test": "jest", | ||
"lint": "eslint src", | ||
"size": "echo \"gzip size: $(gzip-size --raw $npm_package_minified_main) bytes\"" | ||
}, | ||
"repository": "https://github.com/nathancahill/split", | ||
"author": "Nathan Cahill <nathan@nathancahill.com>", | ||
"homepage": "https://split.js.org/", | ||
"files": ["dist"], | ||
"license": "MIT", | ||
"dependencies": { | ||
"prop-types": "^15.5.7", | ||
"split-grid": "^1.0.9" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=15.4.2 || >= 16.0.0" | ||
}, | ||
"collective": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/splitjs" | ||
} | ||
"name": "react-split-grid", | ||
"version": "1.0.3", | ||
"description": "React component for Split Grid", | ||
"main": "dist/react-split-grid.js", | ||
"minified:main": "dist/react-split-grid.min.js", | ||
"module": "dist/react-split-grid.es.js", | ||
"scripts": { | ||
"build": "rollup -c && npm run size", | ||
"watch": "rollup -cw", | ||
"test": "jest", | ||
"size": "echo \"gzip size: $(gzip-size --raw $npm_package_minified_main) bytes\"" | ||
}, | ||
"repository": "https://github.com/nathancahill/split", | ||
"author": "Nathan Cahill <nathan@nathancahill.com>", | ||
"homepage": "https://split.js.org/", | ||
"files": [ | ||
"dist" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"prop-types": "^15.5.7", | ||
"split-grid": "^1.0.9" | ||
}, | ||
"peerDependencies": { | ||
"react": ">=15.4.2 || >= 16.0.0" | ||
}, | ||
"collective": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/splitjs" | ||
} | ||
} |
@@ -1,4 +0,4 @@ | ||
# React Split Grid [![CI](https://img.shields.io/circleci/project/github/nathancahill/split/master.svg)](https://circleci.com/gh/nathancahill/split) ![Dependencies](https://david-dm.org/nathancahill/split/status.svg) ![](https://img.badgesize.io/https://unpkg.com/react-split-grid/dist/react-split-grid.min.js?compression=gzip&label=size) | ||
# React Split Grid [![CI](https://img.shields.io/circleci/project/github/nathancahill/split/master.svg)](https://circleci.com/gh/nathancahill/split) ![Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen) ![](https://img.badgesize.io/https://unpkg.com/react-split-grid/dist/react-split-grid.min.js?compression=gzip&label=size) | ||
React component for [Split Grid](https://github.com/nathancahill/split-grid/) | ||
React component for [Split Grid](https://github.com/nathancahill/split/tree/master/packages/split-grid) | ||
@@ -39,3 +39,3 @@ ## Installation | ||
`<Split>` is a light component wrapper around the [Split Grid](https://github.com/nathancahill/split-grid/) library. | ||
`<Split>` is a light component wrapper around the [Split Grid](https://github.com/nathancahill/split/tree/master/packages/split-grid) library. | ||
It uses the render prop pattern, but also supports calling the `children` prop or | ||
@@ -79,3 +79,3 @@ the `component` prop. | ||
Refer to [Split Grid documentation](https://github.com/nathancahill/split-grid/#reference) for the options the component accepts as props. | ||
Refer to [Split Grid documentation](https://github.com/nathancahill/split/tree/master/packages/split-grid#reference) for the options the component accepts as props. | ||
@@ -219,3 +219,3 @@ Here's the full list: | ||
Copyright (c) 2018 Nathan Cahill | ||
Copyright (c) 2019 Nathan Cahill | ||
@@ -222,0 +222,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
Sorry, the diff of this file is not supported yet
37270
410