react-layer-stack
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -14,9 +14,14 @@ 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.LayerToggle = exports.Layer = exports.LayerStackMountPoint = undefined;var _react = require('react');var _react2 = _interopRequireDefault(_react); | ||
displaying.length ? displaying.map( | ||
function (id, index) {var _views$id;return _react2.default.createElement('div', { key: id }, (_views$id = views[id]).renderFn.apply(_views$id, [{ | ||
index: index, id: id, show: show, hide: hide, hideAll: hideAll, displaying: displaying, views: views, | ||
showOnlyMe: function showOnlyMe() {for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}return hideAll() || show.apply(undefined, [id].concat(args));}, // TODO: improve | ||
hideMe: function hideMe() {return hide(id);}, | ||
showMe: function showMe() {for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}return show.apply(undefined, [id].concat(args));} // sometimes you may want to change args of the current layer | ||
}].concat(_toConsumableArray(views[id].args))));}) : | ||
function (id, index) {var _views$id;return ( | ||
_react2.default.createElement('div', { key: id }, | ||
(_views$id = views[id]).renderFn.apply(_views$id, [{ | ||
index: index, id: id, show: show, hide: hide, hideAll: hideAll, displaying: displaying, views: views, | ||
showOnlyMe: function showOnlyMe() {for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}return hideAll() || show.apply(undefined, [id].concat(args));}, // TODO: improve | ||
hideMe: function hideMe() {return hide(id);}, | ||
showMe: function showMe() {for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}return show.apply(undefined, [id].concat(args));} // sometimes you may want to change args of the current layer | ||
}].concat(_toConsumableArray(views[id].args)))));}) : | ||
_react2.default.createElement('noscript', null))); | ||
@@ -81,2 +86,3 @@ | ||
show: show, hide: hide, hideAll: hideAll, displaying: displaying, views: views, | ||
isActive: function isActive() {return displaying.indexOf(id) !== -1;}, | ||
showMe: function showMe() {for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {args[_key3] = arguments[_key3];}return show.apply(undefined, [id].concat(args));}, | ||
@@ -83,0 +89,0 @@ showOnlyMe: function showOnlyMe() {for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {args[_key4] = arguments[_key4];}return hideAll() || show.apply(undefined, [id].concat(args));}, |
{ | ||
"name": "react-layer-stack", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Simple but ubiquitously powerful and agnostic layering system for React. Useful for any kind of windowing/popover/modals/tooltip application", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/AlexeyFrolov/react-layer-stack.git", |
### TODO: | ||
* examples | ||
* tests | ||
* events support | ||
### Description | ||
Library especially designed for all sorts of layers (modals, popovers, popups, windows). The best part - you can both use variables from closure (which will propagate automatically if you'll provide it to "use" property of Layer), Layer state info, useful callbacks and also you can set event data from your toggle to that Layer. It's possible to have "stack" of layers with zIndex, one on another as well. | ||
### Real-world usage example | ||
@@ -8,0 +10,0 @@ |
@@ -14,8 +14,13 @@ import React, { PropTypes } from 'react' | ||
: (displaying.length ? displaying.map ( | ||
(id, index) => <div key={id}>{ views[id].renderFn({ | ||
index, id, show, hide, hideAll, displaying, views, | ||
showOnlyMe: (...args) => hideAll() || show(id, ...args), // TODO: improve | ||
hideMe: () => hide(id), | ||
showMe: (...args) => show(id, ...args) // sometimes you may want to change args of the current layer | ||
}, ...views[id].args) }</div> | ||
(id, index) => | ||
<div key={id}> | ||
{ | ||
views[id].renderFn({ // TODO: check that renderFn is a function | ||
index, id, show, hide, hideAll, displaying, views, | ||
showOnlyMe: (...args) => hideAll() || show(id, ...args), // TODO: improve | ||
hideMe: () => hide(id), | ||
showMe: (...args) => show(id, ...args) // sometimes you may want to change args of the current layer | ||
}, ...views[id].args) | ||
} | ||
</div> | ||
) | ||
@@ -22,0 +27,0 @@ : <noscript />) } |
Sorry, the diff of this file is not supported yet
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
31763
15
264
73