terra-slide-panel-manager
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -7,2 +7,10 @@ Changelog | ||
5.1.0 - (June 12, 2019) | ||
------------------ | ||
### Removed | ||
* Removed node_modules from .npmignore | ||
### Changed | ||
* Update tests for terra-toolkit v5 and terra-dev-site v5 changes | ||
5.0.0 - (May 13, 2019) | ||
@@ -9,0 +17,0 @@ ------------------ |
@@ -1,50 +0,44 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.disclosureType = undefined; | ||
exports.default = exports.disclosureType = void 0; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
var _disclosureSizeToPane; | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _react = require('react'); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _propTypes = require('prop-types'); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _terraDisclosureManager = require('terra-disclosure-manager'); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _terraDisclosureManager2 = _interopRequireDefault(_terraDisclosureManager); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _terraSlideGroup = require('terra-slide-group'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _terraSlideGroup2 = _interopRequireDefault(_terraSlideGroup); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _terraSlidePanel = require('terra-slide-panel'); | ||
var _terraDisclosureManager = _interopRequireWildcard(require("terra-disclosure-manager")); | ||
var _terraSlidePanel2 = _interopRequireDefault(_terraSlidePanel); | ||
var _terraSlideGroup = _interopRequireDefault(require("terra-slide-group")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _terraSlidePanel = _interopRequireDefault(require("terra-slide-panel")); | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
var _disclosureSizeToPane; | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var disclosureType = 'panel'; | ||
exports.disclosureType = disclosureType; | ||
var propTypes = { | ||
@@ -55,13 +49,12 @@ /** | ||
*/ | ||
children: _propTypes2.default.node, | ||
children: _propTypes.default.node, | ||
/** | ||
* The desired panel behavior. Either 'squish' or 'overlay'. | ||
*/ | ||
panelBehavior: _propTypes2.default.oneOf(['overlay', 'squish']) | ||
panelBehavior: _propTypes.default.oneOf(['overlay', 'squish']) | ||
}; | ||
var defaultProps = { | ||
panelBehavior: 'overlay' | ||
}; | ||
/** | ||
@@ -71,4 +64,5 @@ * The SlidePanel component does not support the full range of DisclosureManager sizes in its API. The potential sizes are mapped to the | ||
*/ | ||
var disclosureSizeToPanelSize = (_disclosureSizeToPane = {}, _defineProperty(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.TINY, 'small'), _defineProperty(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.SMALL, 'small'), _defineProperty(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.MEDIUM, 'large'), _defineProperty(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.LARGE, 'large'), _defineProperty(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.HUGE, 'large'), _disclosureSizeToPane); | ||
var disclosureSizeToPanelSize = (_disclosureSizeToPane = {}, (0, _defineProperty2.default)(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.TINY, 'small'), (0, _defineProperty2.default)(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.SMALL, 'small'), (0, _defineProperty2.default)(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.MEDIUM, 'large'), (0, _defineProperty2.default)(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.LARGE, 'large'), (0, _defineProperty2.default)(_disclosureSizeToPane, _terraDisclosureManager.availableDisclosureSizes.HUGE, 'large'), _disclosureSizeToPane); | ||
var disclosureDimensionsToPanelSize = function disclosureDimensionsToPanelSize(dimensions) { | ||
@@ -78,26 +72,29 @@ if (dimensions.width > 480 || dimensions.height > 600) { | ||
} | ||
return 'small'; | ||
}; | ||
var SlidePanelManager = function (_React$Component) { | ||
_inherits(SlidePanelManager, _React$Component); | ||
var SlidePanelManager = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
(0, _inherits2.default)(SlidePanelManager, _React$Component); | ||
function SlidePanelManager(props) { | ||
_classCallCheck(this, SlidePanelManager); | ||
var _this; | ||
var _this = _possibleConstructorReturn(this, (SlidePanelManager.__proto__ || Object.getPrototypeOf(SlidePanelManager)).call(this, props)); | ||
_this.renderSlidePanel = _this.renderSlidePanel.bind(_this); | ||
(0, _classCallCheck2.default)(this, SlidePanelManager); | ||
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(SlidePanelManager).call(this, props)); | ||
_this.renderSlidePanel = _this.renderSlidePanel.bind((0, _assertThisInitialized2.default)(_this)); | ||
return _this; | ||
} | ||
_createClass(SlidePanelManager, [{ | ||
key: 'renderSlidePanel', | ||
(0, _createClass2.default)(SlidePanelManager, [{ | ||
key: "renderSlidePanel", | ||
value: function renderSlidePanel(manager) { | ||
var _props = this.props, | ||
children = _props.children, | ||
panelBehavior = _props.panelBehavior, | ||
customProps = _objectWithoutProperties(_props, ['children', 'panelBehavior']); | ||
var _this$props = this.props, | ||
children = _this$props.children, | ||
panelBehavior = _this$props.panelBehavior, | ||
customProps = (0, _objectWithoutProperties2.default)(_this$props, ["children", "panelBehavior"]); | ||
var isFullscreen; | ||
var isFullscreen = void 0; | ||
if (manager.disclosure.size === _terraDisclosureManager.availableDisclosureSizes.FULLSCREEN || manager.disclosure.isMaximized) { | ||
@@ -107,3 +104,4 @@ isFullscreen = true; | ||
var panelSize = void 0; | ||
var panelSize; | ||
if (manager.disclosure.dimensions) { | ||
@@ -115,3 +113,3 @@ panelSize = disclosureDimensionsToPanelSize(manager.disclosure.dimensions); | ||
return _react2.default.createElement(_terraSlidePanel2.default, _extends({}, customProps, { | ||
return _react.default.createElement(_terraSlidePanel.default, (0, _extends2.default)({}, customProps, { | ||
fill: true, | ||
@@ -122,3 +120,6 @@ panelBehavior: panelBehavior, | ||
isOpen: manager.disclosure.isOpen, | ||
panelContent: _react2.default.createElement(_terraSlideGroup2.default, { items: manager.disclosure.components, isAnimated: true }), | ||
panelContent: _react.default.createElement(_terraSlideGroup.default, { | ||
items: manager.disclosure.components, | ||
isAnimated: true | ||
}), | ||
mainContent: manager.children.components | ||
@@ -128,24 +129,17 @@ })); | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
var children = this.props.children; | ||
return _react2.default.createElement( | ||
_terraDisclosureManager2.default, | ||
{ | ||
supportedDisclosureTypes: [disclosureType], | ||
render: this.renderSlidePanel | ||
}, | ||
children | ||
); | ||
return _react.default.createElement(_terraDisclosureManager.default, { | ||
supportedDisclosureTypes: [disclosureType], | ||
render: this.renderSlidePanel | ||
}, children); | ||
} | ||
}]); | ||
return SlidePanelManager; | ||
}(_react2.default.Component); | ||
}(_react.default.Component); | ||
SlidePanelManager.propTypes = propTypes; | ||
SlidePanelManager.defaultProps = defaultProps; | ||
exports.default = SlidePanelManager; | ||
var _default = SlidePanelManager; | ||
exports.default = _default; |
@@ -1,61 +0,49 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _react = require('react'); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _propTypes = require('prop-types'); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _bind = require('classnames/bind'); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _bind2 = _interopRequireDefault(_bind); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _terraButton = require('terra-button'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _terraButton2 = _interopRequireDefault(_terraButton); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _terraContentContainer = require('terra-content-container'); | ||
var _bind = _interopRequireDefault(require("classnames/bind")); | ||
var _terraContentContainer2 = _interopRequireDefault(_terraContentContainer); | ||
var _terraButton = _interopRequireDefault(require("terra-button")); | ||
var _terraActionHeader = require('terra-action-header'); | ||
var _terraContentContainer = _interopRequireDefault(require("terra-content-container")); | ||
var _terraActionHeader2 = _interopRequireDefault(_terraActionHeader); | ||
var _terraActionHeader = _interopRequireDefault(require("terra-action-header")); | ||
var _terraDisclosureManager = require('terra-disclosure-manager'); | ||
var _terraDisclosureManager = require("terra-disclosure-manager"); | ||
var _DisclosureComponent = require('./DisclosureComponent'); | ||
var _DisclosureComponent = _interopRequireDefault(require("./DisclosureComponent")); | ||
var _DisclosureComponent2 = _interopRequireDefault(_DisclosureComponent); | ||
var _exampleStyles = _interopRequireDefault(require("./example-styles.scss")); | ||
var _exampleStyles = require('./example-styles.scss'); | ||
var cx = _bind.default.bind(_exampleStyles.default); | ||
var _exampleStyles2 = _interopRequireDefault(_exampleStyles); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var cx = _bind2.default.bind(_exampleStyles2.default); | ||
var propTypes = { | ||
disclosureType: _propTypes2.default.string, | ||
disclosureType: _propTypes.default.string, | ||
disclosureManager: _terraDisclosureManager.disclosureManagerShape, | ||
panelBehavior: _propTypes2.default.oneOf(['overlay', 'squish']) | ||
panelBehavior: _propTypes.default.oneOf(['overlay', 'squish']) | ||
}; | ||
var HEIGHT_KEYS = Object.keys(_terraDisclosureManager.availableDisclosureHeights); | ||
@@ -67,28 +55,32 @@ var WIDTH_KEYS = Object.keys(_terraDisclosureManager.availableDisclosureWidths); | ||
var keyValue = index; | ||
return _react2.default.createElement( | ||
'option', | ||
{ key: keyValue, value: currentValue }, | ||
currentValue | ||
); | ||
return _react.default.createElement("option", { | ||
key: keyValue, | ||
value: currentValue | ||
}, currentValue); | ||
}); | ||
}; | ||
var ContentComponent = function (_React$Component) { | ||
_inherits(ContentComponent, _React$Component); | ||
var ContentComponent = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
(0, _inherits2.default)(ContentComponent, _React$Component); | ||
function ContentComponent(props) { | ||
_classCallCheck(this, ContentComponent); | ||
var _this; | ||
var _this = _possibleConstructorReturn(this, (ContentComponent.__proto__ || Object.getPrototypeOf(ContentComponent)).call(this, props)); | ||
_this.renderButton = _this.renderButton.bind(_this); | ||
_this.handleSelectChange = _this.handleSelectChange.bind(_this); | ||
_this.getId = _this.getId.bind(_this); | ||
_this.state = { id: 'dimensions', disclosureHeight: HEIGHT_KEYS[0], disclosureWidth: WIDTH_KEYS[0] }; | ||
(0, _classCallCheck2.default)(this, ContentComponent); | ||
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(ContentComponent).call(this, props)); | ||
_this.renderButton = _this.renderButton.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.handleSelectChange = _this.handleSelectChange.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.getId = _this.getId.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.state = { | ||
id: 'dimensions', | ||
disclosureHeight: HEIGHT_KEYS[0], | ||
disclosureWidth: WIDTH_KEYS[0] | ||
}; | ||
return _this; | ||
} | ||
_createClass(ContentComponent, [{ | ||
key: 'getId', | ||
(0, _createClass2.default)(ContentComponent, [{ | ||
key: "getId", | ||
value: function getId(name) { | ||
@@ -98,16 +90,14 @@ return name + this.state.id; | ||
}, { | ||
key: 'handleSelectChange', | ||
key: "handleSelectChange", | ||
value: function handleSelectChange(event) { | ||
this.setState(_defineProperty({}, event.target.name, event.target.value)); | ||
this.setState((0, _defineProperty2.default)({}, event.target.name, event.target.value)); | ||
} | ||
}, { | ||
key: 'renderButton', | ||
key: "renderButton", | ||
value: function renderButton(size) { | ||
var _props = this.props, | ||
disclosureManager = _props.disclosureManager, | ||
disclosureType = _props.disclosureType; | ||
return _react2.default.createElement(_terraButton2.default, { | ||
text: 'Disclose (' + size + ')', | ||
var _this$props = this.props, | ||
disclosureManager = _this$props.disclosureManager, | ||
disclosureType = _this$props.disclosureType; | ||
return _react.default.createElement(_terraButton.default, { | ||
text: "Disclose (".concat(size, ")"), | ||
onClick: function onClick() { | ||
@@ -118,4 +108,7 @@ disclosureManager.disclose({ | ||
content: { | ||
key: 'Content-Disclosure-' + size, | ||
component: _react2.default.createElement(_DisclosureComponent2.default, { name: 'Disclosure Component (' + size + ')', disclosureType: disclosureType }) | ||
key: "Content-Disclosure-".concat(size), | ||
component: _react.default.createElement(_DisclosureComponent.default, { | ||
name: "Disclosure Component (".concat(size, ")"), | ||
disclosureType: disclosureType | ||
}) | ||
} | ||
@@ -127,13 +120,11 @@ }); | ||
}, { | ||
key: 'renderFormButton', | ||
key: "renderFormButton", | ||
value: function renderFormButton() { | ||
var _this2 = this; | ||
var _props2 = this.props, | ||
disclosureManager = _props2.disclosureManager, | ||
disclosureType = _props2.disclosureType; | ||
var name = 'Disclose (' + this.state.disclosureHeight + ') x (' + this.state.disclosureWidth + ')'; | ||
return _react2.default.createElement(_terraButton2.default, { | ||
var _this$props2 = this.props, | ||
disclosureManager = _this$props2.disclosureManager, | ||
disclosureType = _this$props2.disclosureType; | ||
var name = "Disclose (".concat(this.state.disclosureHeight, ") x (").concat(this.state.disclosureWidth, ")"); | ||
return _react.default.createElement(_terraButton.default, { | ||
text: name, | ||
@@ -143,6 +134,12 @@ onClick: function onClick() { | ||
preferredType: disclosureType, | ||
dimensions: { height: _this2.state.disclosureHeight, width: _this2.state.disclosureWidth }, | ||
dimensions: { | ||
height: _this2.state.disclosureHeight, | ||
width: _this2.state.disclosureWidth | ||
}, | ||
content: { | ||
key: 'Content-Disclosure-Dimensions', | ||
component: _react2.default.createElement(_DisclosureComponent2.default, { name: 'Disclosure Component (' + name + ')', disclosureType: disclosureType }) | ||
component: _react.default.createElement(_DisclosureComponent.default, { | ||
name: "Disclosure Component (".concat(name, ")"), | ||
disclosureType: disclosureType | ||
}) | ||
} | ||
@@ -154,75 +151,41 @@ }); | ||
}, { | ||
key: 'renderForm', | ||
key: "renderForm", | ||
value: function renderForm() { | ||
return _react2.default.createElement( | ||
'form', | ||
null, | ||
_react2.default.createElement( | ||
'label', | ||
{ htmlFor: this.getId('disclosureHeight' + this.props.panelBehavior) }, | ||
'Pop Content Height' | ||
), | ||
_react2.default.createElement( | ||
'select', | ||
{ id: this.getId('disclosureHeight' + this.props.panelBehavior), name: 'disclosureHeight', value: this.state.disclosureHeight, onChange: this.handleSelectChange }, | ||
generateOptions(HEIGHT_KEYS) | ||
), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement( | ||
'label', | ||
{ htmlFor: this.getId('disclosureWidth' + this.props.panelBehavior) }, | ||
'Pop Content Width' | ||
), | ||
_react2.default.createElement( | ||
'select', | ||
{ id: this.getId('disclosureWidth' + this.props.panelBehavior), name: 'disclosureWidth', value: this.state.disclosureWidth, onChange: this.handleSelectChange }, | ||
generateOptions(WIDTH_KEYS) | ||
), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement('br', null) | ||
); | ||
return _react.default.createElement("form", null, _react.default.createElement("label", { | ||
htmlFor: this.getId("disclosureHeight".concat(this.props.panelBehavior)) | ||
}, "Pop Content Height"), _react.default.createElement("select", { | ||
id: this.getId("disclosureHeight".concat(this.props.panelBehavior)), | ||
name: "disclosureHeight", | ||
value: this.state.disclosureHeight, | ||
onChange: this.handleSelectChange | ||
}, generateOptions(HEIGHT_KEYS)), _react.default.createElement("br", null), _react.default.createElement("br", null), _react.default.createElement("label", { | ||
htmlFor: this.getId("disclosureWidth".concat(this.props.panelBehavior)) | ||
}, "Pop Content Width"), _react.default.createElement("select", { | ||
id: this.getId("disclosureWidth".concat(this.props.panelBehavior)), | ||
name: "disclosureWidth", | ||
value: this.state.disclosureWidth, | ||
onChange: this.handleSelectChange | ||
}, generateOptions(WIDTH_KEYS)), _react.default.createElement("br", null), _react.default.createElement("br", null)); | ||
} | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
return _react2.default.createElement( | ||
_terraContentContainer2.default, | ||
{ | ||
header: _react2.default.createElement(_terraActionHeader2.default, { | ||
title: 'Manager Child' | ||
}) | ||
}, | ||
_react2.default.createElement( | ||
'div', | ||
{ className: cx('content-wrapper') }, | ||
this.renderButton('default'), | ||
this.renderButton('tiny'), | ||
this.renderButton('small'), | ||
this.renderButton('medium'), | ||
this.renderButton('large'), | ||
this.renderButton('huge'), | ||
this.renderButton('fullscreen'), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement( | ||
'p', | ||
null, | ||
'The child components can disclose content in the panel at various sizes.' | ||
) | ||
), | ||
_react2.default.createElement( | ||
'div', | ||
{ className: cx('content-wrapper') }, | ||
this.renderForm(), | ||
this.renderFormButton() | ||
) | ||
); | ||
return _react.default.createElement(_terraContentContainer.default, { | ||
header: _react.default.createElement(_terraActionHeader.default, { | ||
title: "Manager Child" | ||
}) | ||
}, _react.default.createElement("div", { | ||
className: cx('content-wrapper') | ||
}, this.renderButton('default'), this.renderButton('tiny'), this.renderButton('small'), this.renderButton('medium'), this.renderButton('large'), this.renderButton('huge'), this.renderButton('fullscreen'), _react.default.createElement("br", null), _react.default.createElement("p", null, "The child components can disclose content in the panel at various sizes.")), _react.default.createElement("div", { | ||
className: cx('content-wrapper') | ||
}, this.renderForm(), this.renderFormButton())); | ||
} | ||
}]); | ||
return ContentComponent; | ||
}(_react2.default.Component); | ||
}(_react.default.Component); | ||
ContentComponent.propTypes = propTypes; | ||
exports.default = (0, _terraDisclosureManager.withDisclosureManager)(ContentComponent); | ||
var _default = (0, _terraDisclosureManager.withDisclosureManager)(ContentComponent); | ||
exports.default = _default; |
@@ -1,59 +0,47 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _react = require('react'); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _propTypes = require('prop-types'); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _bind = require('classnames/bind'); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _bind2 = _interopRequireDefault(_bind); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _terraButton = require('terra-button'); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _terraButton2 = _interopRequireDefault(_terraButton); | ||
var _bind = _interopRequireDefault(require("classnames/bind")); | ||
var _terraContentContainer = require('terra-content-container'); | ||
var _terraButton = _interopRequireDefault(require("terra-button")); | ||
var _terraContentContainer2 = _interopRequireDefault(_terraContentContainer); | ||
var _terraContentContainer = _interopRequireDefault(require("terra-content-container")); | ||
var _terraFormInput = require('terra-form-input'); | ||
var _terraFormInput = _interopRequireDefault(require("terra-form-input")); | ||
var _terraFormInput2 = _interopRequireDefault(_terraFormInput); | ||
var _terraActionHeader = _interopRequireDefault(require("terra-action-header")); | ||
var _terraActionHeader = require('terra-action-header'); | ||
var _terraDisclosureManager = require("terra-disclosure-manager"); | ||
var _terraActionHeader2 = _interopRequireDefault(_terraActionHeader); | ||
var _exampleStyles = _interopRequireDefault(require("./example-styles.scss")); | ||
var _terraDisclosureManager = require('terra-disclosure-manager'); | ||
var cx = _bind.default.bind(_exampleStyles.default); | ||
var _exampleStyles = require('./example-styles.scss'); | ||
var _exampleStyles2 = _interopRequireDefault(_exampleStyles); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var cx = _bind2.default.bind(_exampleStyles2.default); | ||
var propTypes = { | ||
name: _propTypes2.default.string, | ||
disclosureType: _propTypes2.default.string, | ||
name: _propTypes.default.string, | ||
disclosureType: _propTypes.default.string, | ||
disclosureManager: _terraDisclosureManager.disclosureManagerShape | ||
}; | ||
var defaultProps = { | ||
@@ -63,12 +51,13 @@ name: 'Disclosure Component' | ||
var DisclosureComponent = function (_React$Component) { | ||
_inherits(DisclosureComponent, _React$Component); | ||
var DisclosureComponent = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
(0, _inherits2.default)(DisclosureComponent, _React$Component); | ||
function DisclosureComponent(props) { | ||
_classCallCheck(this, DisclosureComponent); | ||
var _this; | ||
var _this = _possibleConstructorReturn(this, (DisclosureComponent.__proto__ || Object.getPrototypeOf(DisclosureComponent)).call(this, props)); | ||
_this.checkLockState = _this.checkLockState.bind(_this); | ||
(0, _classCallCheck2.default)(this, DisclosureComponent); | ||
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(DisclosureComponent).call(this, props)); | ||
_this.checkLockState = _this.checkLockState.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.state = { | ||
@@ -80,8 +69,7 @@ text: undefined | ||
_createClass(DisclosureComponent, [{ | ||
key: 'componentDidMount', | ||
(0, _createClass2.default)(DisclosureComponent, [{ | ||
key: "componentDidMount", | ||
value: function componentDidMount() { | ||
var disclosureManager = this.props.disclosureManager; | ||
if (disclosureManager && disclosureManager.registerDismissCheck) { | ||
@@ -92,3 +80,3 @@ disclosureManager.registerDismissCheck(this.checkLockState); | ||
}, { | ||
key: 'checkLockState', | ||
key: "checkLockState", | ||
value: function checkLockState() { | ||
@@ -100,3 +88,3 @@ var _this2 = this; | ||
// eslint-disable-next-line no-restricted-globals | ||
if (!confirm(_this2.props.name + ' has unsaved changes that will be lost. Do you wish to continue?')) { | ||
if (!confirm("".concat(_this2.props.name, " has unsaved changes that will be lost. Do you wish to continue?"))) { | ||
// eslint-disable-line no-alert | ||
@@ -114,96 +102,62 @@ reject(); | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
var _this3 = this; | ||
var _props = this.props, | ||
disclosureManager = _props.disclosureManager, | ||
name = _props.name, | ||
disclosureType = _props.disclosureType; | ||
return _react2.default.createElement( | ||
_terraContentContainer2.default, | ||
{ | ||
fill: true, | ||
header: _react2.default.createElement(_terraActionHeader2.default, { | ||
title: 'Disclosure - ' + name, | ||
onClose: disclosureManager.closeDisclosure, | ||
onBack: disclosureManager.goBack, | ||
onMaximize: disclosureManager.maximize, | ||
onMinimize: disclosureManager.minimize | ||
}) | ||
}, | ||
_react2.default.createElement( | ||
'div', | ||
{ className: cx('content-wrapper') }, | ||
_react2.default.createElement( | ||
'h3', | ||
null, | ||
name | ||
), | ||
_react2.default.createElement( | ||
'p', | ||
null, | ||
'The disclosed component can disclose content within the same panel.' | ||
), | ||
_react2.default.createElement( | ||
'p', | ||
null, | ||
'It can also render a header (like above) that implements the various DisclosureManager control functions.' | ||
), | ||
_react2.default.createElement(_terraButton2.default, { | ||
text: 'Dismiss', | ||
onClick: function onClick() { | ||
disclosureManager.dismiss().catch(function () { | ||
console.log('Dismiss failed. A lock must be in place.'); // eslint-disable-line no-console | ||
}); | ||
var _this$props = this.props, | ||
disclosureManager = _this$props.disclosureManager, | ||
name = _this$props.name, | ||
disclosureType = _this$props.disclosureType; | ||
return _react.default.createElement(_terraContentContainer.default, { | ||
fill: true, | ||
header: _react.default.createElement(_terraActionHeader.default, { | ||
title: "Disclosure - ".concat(name), | ||
onClose: disclosureManager.closeDisclosure, | ||
onBack: disclosureManager.goBack, | ||
onMaximize: disclosureManager.maximize, | ||
onMinimize: disclosureManager.minimize | ||
}) | ||
}, _react.default.createElement("div", { | ||
className: cx('content-wrapper') | ||
}, _react.default.createElement("h3", null, name), _react.default.createElement("p", null, "The disclosed component can disclose content within the same panel."), _react.default.createElement("p", null, "It can also render a header (like above) that implements the various DisclosureManager control functions."), _react.default.createElement(_terraButton.default, { | ||
text: "Dismiss", | ||
onClick: function onClick() { | ||
disclosureManager.dismiss().catch(function () { | ||
console.log('Dismiss failed. A lock must be in place.'); // eslint-disable-line no-console | ||
}); | ||
} | ||
}), _react.default.createElement(_terraButton.default, { | ||
text: "Disclose Again", | ||
onClick: function onClick() { | ||
disclosureManager.disclose({ | ||
preferredType: disclosureType, | ||
size: 'small', | ||
content: { | ||
key: "Nested ".concat(name), | ||
component: _react.default.createElement(WrappedDisclosureComponent, { | ||
name: "Nested ".concat(name), | ||
disclosureType: disclosureType | ||
}) | ||
} | ||
}), | ||
_react2.default.createElement(_terraButton2.default, { | ||
text: 'Disclose Again', | ||
onClick: function onClick() { | ||
disclosureManager.disclose({ | ||
preferredType: disclosureType, | ||
size: 'small', | ||
content: { | ||
key: 'Nested ' + name, | ||
component: _react2.default.createElement(WrappedDisclosureComponent, { name: 'Nested ' + name, disclosureType: disclosureType }) | ||
} | ||
}); | ||
} | ||
}), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement( | ||
'p', | ||
null, | ||
'The disclosed component can register a dismiss check function that can interrupt and prevent dismissal. This component will prompt the user if text is detected in the input field below.' | ||
), | ||
_react2.default.createElement(_terraFormInput2.default, { | ||
value: this.state.text || '', | ||
onChange: function onChange(event) { | ||
_this3.setState({ | ||
text: event.target.value | ||
}); | ||
} | ||
}), | ||
this.state.text && this.state.text.length ? _react2.default.createElement( | ||
'p', | ||
null, | ||
'Component has unsaved changes!' | ||
) : null | ||
) | ||
); | ||
}); | ||
} | ||
}), _react.default.createElement("br", null), _react.default.createElement("br", null), _react.default.createElement("p", null, "The disclosed component can register a dismiss check function that can interrupt and prevent dismissal. This component will prompt the user if text is detected in the input field below."), _react.default.createElement(_terraFormInput.default, { | ||
value: this.state.text || '', | ||
onChange: function onChange(event) { | ||
_this3.setState({ | ||
text: event.target.value | ||
}); | ||
} | ||
}), this.state.text && this.state.text.length ? _react.default.createElement("p", null, "Component has unsaved changes!") : null)); | ||
} | ||
}]); | ||
return DisclosureComponent; | ||
}(_react2.default.Component); | ||
}(_react.default.Component); | ||
DisclosureComponent.propTypes = propTypes; | ||
DisclosureComponent.defaultProps = defaultProps; | ||
var WrappedDisclosureComponent = (0, _terraDisclosureManager.withDisclosureManager)(DisclosureComponent); | ||
exports.default = (0, _terraDisclosureManager.withDisclosureManager)(WrappedDisclosureComponent); | ||
var _default = (0, _terraDisclosureManager.withDisclosureManager)(WrappedDisclosureComponent); | ||
exports.default = _default; |
@@ -1,41 +0,29 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _react = require('react'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
var _propTypes = require('prop-types'); | ||
var _bind = _interopRequireDefault(require("classnames/bind")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _SlidePanelManager = _interopRequireDefault(require("terra-slide-panel-manager/lib/SlidePanelManager")); | ||
var _bind = require('classnames/bind'); | ||
var _exampleStyles = _interopRequireDefault(require("terra-slide-panel-manager/lib/terra-dev-site/doc/example/example-styles.scss")); | ||
var _bind2 = _interopRequireDefault(_bind); | ||
var _ContentComponent = _interopRequireDefault(require("./ContentComponent")); | ||
var _SlidePanelManager = require('terra-slide-panel-manager/lib/SlidePanelManager'); | ||
/* eslint-disable import/no-unresolved, import/extensions */ | ||
var _SlidePanelManager2 = _interopRequireDefault(_SlidePanelManager); | ||
var _exampleStyles = require('terra-slide-panel-manager/lib/terra-dev-site/doc/example/example-styles.scss'); | ||
var _exampleStyles2 = _interopRequireDefault(_exampleStyles); | ||
var _ContentComponent = require('./ContentComponent'); | ||
var _ContentComponent2 = _interopRequireDefault(_ContentComponent); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var cx = _bind2.default.bind(_exampleStyles2.default); | ||
/* eslint-enable import/no-unresolved, import/extensions */ | ||
var cx = _bind.default.bind(_exampleStyles.default); | ||
/* eslint-disable import/no-unresolved, import/extensions */ | ||
var propTypes = { | ||
behavior: _propTypes2.default.string | ||
behavior: _propTypes.default.string | ||
}; | ||
@@ -45,15 +33,14 @@ | ||
var behavior = _ref.behavior; | ||
return _react2.default.createElement( | ||
'div', | ||
{ className: cx('example-wrapper') }, | ||
_react2.default.createElement( | ||
_SlidePanelManager2.default, | ||
{ panelBehavior: behavior }, | ||
_react2.default.createElement(_ContentComponent2.default, { panelBehavior: behavior, disclosureType: 'panel' }) | ||
) | ||
); | ||
return _react.default.createElement("div", { | ||
className: cx('example-wrapper') | ||
}, _react.default.createElement(_SlidePanelManager.default, { | ||
panelBehavior: behavior | ||
}, _react.default.createElement(_ContentComponent.default, { | ||
panelBehavior: behavior, | ||
disclosureType: "panel" | ||
}))); | ||
}; | ||
SlidePanelManagerExample.propTypes = propTypes; | ||
exports.default = SlidePanelManagerExample; | ||
var _default = SlidePanelManagerExample; | ||
exports.default = _default; |
@@ -1,29 +0,25 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _react = require('react'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _terraDocTemplate = _interopRequireDefault(require("terra-doc-template")); | ||
var _terraDocTemplate = require('terra-doc-template'); | ||
var _CHANGELOG = _interopRequireDefault(require("../../../../CHANGELOG.md")); | ||
var _terraDocTemplate2 = _interopRequireDefault(_terraDocTemplate); | ||
var _CHANGELOG = require('../../../../CHANGELOG.md'); | ||
var _CHANGELOG2 = _interopRequireDefault(_CHANGELOG); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var DocPage = function DocPage() { | ||
return _react2.default.createElement(_terraDocTemplate2.default, { | ||
packageName: 'terra-slide-panel-manager', | ||
srcPath: 'https://github.com/cerner/terra-framework/tree/master/packages/terra-slide-panel-manager', | ||
readme: _CHANGELOG2.default | ||
return _react.default.createElement(_terraDocTemplate.default, { | ||
packageName: "terra-slide-panel-manager", | ||
srcPath: "https://github.com/cerner/terra-framework/tree/master/packages/terra-slide-panel-manager", | ||
readme: _CHANGELOG.default | ||
}); | ||
}; | ||
exports.default = DocPage; | ||
var _default = DocPage; | ||
exports.default = _default; |
@@ -1,55 +0,50 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _react = require('react'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _terraDocTemplate = _interopRequireDefault(require("terra-doc-template")); | ||
var _terraDocTemplate = require('terra-doc-template'); | ||
var _package = require("../../../../package.json"); | ||
var _terraDocTemplate2 = _interopRequireDefault(_terraDocTemplate); | ||
var _README = _interopRequireDefault(require("../../../../docs/README.md")); | ||
var _package = require('../../../../package.json'); | ||
var _SlidePanelManager = _interopRequireDefault(require("!raw-loader!../../../../src/SlidePanelManager.jsx")); | ||
var _README = require('../../../../docs/README.md'); | ||
var _SlidePanelManagerExample = _interopRequireDefault(require("../example/SlidePanelManagerExample")); | ||
var _README2 = _interopRequireDefault(_README); | ||
var _SlidePanelManagerExample2 = _interopRequireDefault(require("!raw-loader!../../../../src/terra-dev-site/doc/example/SlidePanelManagerExample.jsx")); | ||
var _SlidePanelManager = require('!raw-loader!../../../../src/SlidePanelManager.jsx'); | ||
/* eslint-disable import/no-webpack-loader-syntax, import/first, import/extensions, import/no-unresolved, import/no-duplicates */ | ||
// Component Source | ||
// Examples | ||
var _SlidePanelManager2 = _interopRequireDefault(_SlidePanelManager); | ||
var _SlidePanelManagerExample = require('../example/SlidePanelManagerExample'); | ||
var _SlidePanelManagerExample2 = _interopRequireDefault(_SlidePanelManagerExample); | ||
var _SlidePanelManagerExample3 = require('!raw-loader!../../../../src/terra-dev-site/doc/example/SlidePanelManagerExample.jsx'); | ||
var _SlidePanelManagerExample4 = _interopRequireDefault(_SlidePanelManagerExample3); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* eslint-enable import/no-webpack-loader-syntax, import/first, import/extensions, import/no-unresolved, import/no-duplicates */ | ||
// Examples | ||
var DocPage = function DocPage() { | ||
return _react2.default.createElement(_terraDocTemplate2.default, { | ||
return _react.default.createElement(_terraDocTemplate.default, { | ||
packageName: _package.name, | ||
readme: _README2.default, | ||
srcPath: 'https://github.com/cerner/terra-framework/tree/master/packages/' + _package.name, | ||
readme: _README.default, | ||
srcPath: "https://github.com/cerner/terra-framework/tree/master/packages/".concat(_package.name), | ||
examples: [{ | ||
title: 'Overlay Example', | ||
example: _react2.default.createElement(_SlidePanelManagerExample2.default, { behavior: 'overlay' }), | ||
source: _SlidePanelManagerExample4.default | ||
example: _react.default.createElement(_SlidePanelManagerExample.default, { | ||
behavior: "overlay" | ||
}), | ||
source: _SlidePanelManagerExample2.default | ||
}, { | ||
title: 'Squish Example', | ||
example: _react2.default.createElement(_SlidePanelManagerExample2.default, { behavior: 'squish' }), | ||
source: _SlidePanelManagerExample4.default | ||
example: _react.default.createElement(_SlidePanelManagerExample.default, { | ||
behavior: "squish" | ||
}), | ||
source: _SlidePanelManagerExample2.default | ||
}], | ||
propsTables: [{ | ||
componentSrc: _SlidePanelManager2.default, | ||
source: _SlidePanelManagerExample4.default | ||
componentSrc: _SlidePanelManager.default, | ||
source: _SlidePanelManagerExample2.default | ||
}] | ||
@@ -59,4 +54,3 @@ }); | ||
/* eslint-disable import/no-webpack-loader-syntax, import/first, import/extensions, import/no-unresolved, import/no-duplicates */ | ||
// Component Source | ||
exports.default = DocPage; | ||
var _default = DocPage; | ||
exports.default = _default; |
@@ -1,31 +0,27 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _react = require('react'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _terraDocTemplate = _interopRequireDefault(require("terra-doc-template")); | ||
var _terraDocTemplate = require('terra-doc-template'); | ||
var _package = require("../../../../package.json"); | ||
var _terraDocTemplate2 = _interopRequireDefault(_terraDocTemplate); | ||
var _UPGRADEGUIDE = _interopRequireDefault(require("../../../../docs/UPGRADEGUIDE.md")); | ||
var _package = require('../../../../package.json'); | ||
var _UPGRADEGUIDE = require('../../../../docs/UPGRADEGUIDE.md'); | ||
var _UPGRADEGUIDE2 = _interopRequireDefault(_UPGRADEGUIDE); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var UpgradeGuidePage = function UpgradeGuidePage() { | ||
return _react2.default.createElement(_terraDocTemplate2.default, { | ||
return _react.default.createElement(_terraDocTemplate.default, { | ||
packageName: _package.name, | ||
readme: _UPGRADEGUIDE2.default, | ||
srcPath: 'https://github.com/cerner/terra-framework/tree/master/packages/' + _package.name | ||
readme: _UPGRADEGUIDE.default, | ||
srcPath: "https://github.com/cerner/terra-framework/tree/master/packages/".concat(_package.name) | ||
}); | ||
}; | ||
exports.default = UpgradeGuidePage; | ||
var _default = UpgradeGuidePage; | ||
exports.default = _default; |
@@ -1,67 +0,71 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _react = require('react'); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _propTypes = require('prop-types'); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _terraContentContainer = require('terra-content-container'); | ||
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized")); | ||
var _terraContentContainer2 = _interopRequireDefault(_terraContentContainer); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _terraDisclosureManager = require('terra-disclosure-manager'); | ||
var _react = _interopRequireDefault(require("react")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _propTypes = _interopRequireDefault(require("prop-types")); | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
var _terraContentContainer = _interopRequireDefault(require("terra-content-container")); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
var _terraDisclosureManager = require("terra-disclosure-manager"); | ||
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var HEIGHT_KEYS = Object.keys(_terraDisclosureManager.availableDisclosureHeights); | ||
var WIDTH_KEYS = Object.keys(_terraDisclosureManager.availableDisclosureWidths); | ||
var DisclosureComponent = function (_React$Component) { | ||
_inherits(DisclosureComponent, _React$Component); | ||
var DisclosureComponent = | ||
/*#__PURE__*/ | ||
function (_React$Component) { | ||
(0, _inherits2.default)(DisclosureComponent, _React$Component); | ||
function DisclosureComponent(props) { | ||
_classCallCheck(this, DisclosureComponent); | ||
var _this; | ||
var _this = _possibleConstructorReturn(this, (DisclosureComponent.__proto__ || Object.getPrototypeOf(DisclosureComponent)).call(this, props)); | ||
_this.disclose = _this.disclose.bind(_this); | ||
_this.dismiss = _this.dismiss.bind(_this); | ||
_this.closeDisclosure = _this.closeDisclosure.bind(_this); | ||
_this.goBack = _this.goBack.bind(_this); | ||
_this.maximize = _this.maximize.bind(_this); | ||
_this.minimize = _this.minimize.bind(_this); | ||
_this.generateOptions = _this.generateOptions.bind(_this); | ||
_this.handleSelectChange = _this.handleSelectChange.bind(_this); | ||
_this.renderFormButton = _this.renderFormButton.bind(_this); | ||
_this.renderForm = _this.renderForm.bind(_this); | ||
_this.getId = _this.getId.bind(_this); | ||
_this.state = { id: 'disclosureDimensions', disclosureHeight: HEIGHT_KEYS[0], disclosureWidth: WIDTH_KEYS[0] }; | ||
(0, _classCallCheck2.default)(this, DisclosureComponent); | ||
_this = (0, _possibleConstructorReturn2.default)(this, (0, _getPrototypeOf2.default)(DisclosureComponent).call(this, props)); | ||
_this.disclose = _this.disclose.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.dismiss = _this.dismiss.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.closeDisclosure = _this.closeDisclosure.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.goBack = _this.goBack.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.maximize = _this.maximize.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.minimize = _this.minimize.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.generateOptions = _this.generateOptions.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.handleSelectChange = _this.handleSelectChange.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.renderFormButton = _this.renderFormButton.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.renderForm = _this.renderForm.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.getId = _this.getId.bind((0, _assertThisInitialized2.default)(_this)); | ||
_this.state = { | ||
id: 'disclosureDimensions', | ||
disclosureHeight: HEIGHT_KEYS[0], | ||
disclosureWidth: WIDTH_KEYS[0] | ||
}; | ||
return _this; | ||
} | ||
_createClass(DisclosureComponent, [{ | ||
key: 'getId', | ||
(0, _createClass2.default)(DisclosureComponent, [{ | ||
key: "getId", | ||
value: function getId(name) { | ||
return this.state.id + '-' + name + '-' + this.props.nestedIndex; | ||
return "".concat(this.state.id, "-").concat(name, "-").concat(this.props.nestedIndex); | ||
} | ||
}, { | ||
key: 'generateOptions', | ||
key: "generateOptions", | ||
value: function generateOptions(values, name) { | ||
@@ -72,24 +76,22 @@ var _this2 = this; | ||
var keyValue = index; | ||
return _react2.default.createElement( | ||
'option', | ||
{ id: name + '-' + currentValue + '-' + _this2.props.nestedIndex, key: keyValue, value: currentValue }, | ||
currentValue | ||
); | ||
return _react.default.createElement("option", { | ||
id: "".concat(name, "-").concat(currentValue, "-").concat(_this2.props.nestedIndex), | ||
key: keyValue, | ||
value: currentValue | ||
}, currentValue); | ||
}); | ||
} | ||
}, { | ||
key: 'handleSelectChange', | ||
key: "handleSelectChange", | ||
value: function handleSelectChange(event) { | ||
this.setState(_defineProperty({}, event.target.name, event.target.value)); | ||
this.setState((0, _defineProperty2.default)({}, event.target.name, event.target.value)); | ||
} | ||
}, { | ||
key: 'disclose', | ||
key: "disclose", | ||
value: function disclose(size, dimensions) { | ||
var _this3 = this; | ||
var _props = this.props, | ||
disclosureType = _props.disclosureType, | ||
nestedIndex = _props.nestedIndex; | ||
var _this$props = this.props, | ||
disclosureType = _this$props.disclosureType, | ||
nestedIndex = _this$props.nestedIndex; | ||
var newIndex = nestedIndex + 1; | ||
@@ -102,4 +104,7 @@ return function () { | ||
content: { | ||
key: 'DemoContainer-' + newIndex, | ||
component: _react2.default.createElement(WrappedDisclosureComponent, { identifier: 'DemoContainer-' + newIndex, nestedIndex: newIndex }) | ||
key: "DemoContainer-".concat(newIndex), | ||
component: _react.default.createElement(WrappedDisclosureComponent, { | ||
identifier: "DemoContainer-".concat(newIndex), | ||
nestedIndex: newIndex | ||
}) | ||
} | ||
@@ -110,3 +115,3 @@ }); | ||
}, { | ||
key: 'dismiss', | ||
key: "dismiss", | ||
value: function dismiss() { | ||
@@ -116,3 +121,3 @@ this.props.disclosureManager.dismiss(); | ||
}, { | ||
key: 'closeDisclosure', | ||
key: "closeDisclosure", | ||
value: function closeDisclosure() { | ||
@@ -122,3 +127,3 @@ this.props.disclosureManager.closeDisclosure(); | ||
}, { | ||
key: 'goBack', | ||
key: "goBack", | ||
value: function goBack() { | ||
@@ -128,3 +133,3 @@ this.props.disclosureManager.goBack(); | ||
}, { | ||
key: 'maximize', | ||
key: "maximize", | ||
value: function maximize() { | ||
@@ -134,3 +139,3 @@ this.props.disclosureManager.maximize(); | ||
}, { | ||
key: 'minimize', | ||
key: "minimize", | ||
value: function minimize() { | ||
@@ -140,156 +145,118 @@ this.props.disclosureManager.minimize(); | ||
}, { | ||
key: 'renderFormButton', | ||
key: "renderFormButton", | ||
value: function renderFormButton() { | ||
var name = 'Disclose (' + this.state.disclosureHeight + ') x (' + this.state.disclosureWidth + ')'; | ||
return _react2.default.createElement( | ||
'button', | ||
{ | ||
type: 'button', | ||
id: 'disclose-dimension-' + this.props.nestedIndex, | ||
onClick: this.disclose(undefined, { height: this.state.disclosureHeight, width: this.state.disclosureWidth }) | ||
}, | ||
name | ||
); | ||
var name = "Disclose (".concat(this.state.disclosureHeight, ") x (").concat(this.state.disclosureWidth, ")"); | ||
return _react.default.createElement("button", { | ||
type: "button", | ||
id: "disclose-dimension-".concat(this.props.nestedIndex), | ||
onClick: this.disclose(undefined, { | ||
height: this.state.disclosureHeight, | ||
width: this.state.disclosureWidth | ||
}) | ||
}, name); | ||
} | ||
}, { | ||
key: 'renderForm', | ||
key: "renderForm", | ||
value: function renderForm() { | ||
return _react2.default.createElement( | ||
'form', | ||
null, | ||
_react2.default.createElement( | ||
'label', | ||
{ htmlFor: this.getId('height') }, | ||
'Pop Content Height' | ||
), | ||
_react2.default.createElement( | ||
'select', | ||
{ id: this.getId('height'), name: 'disclosureHeight', value: this.state.disclosureHeight, onChange: this.handleSelectChange }, | ||
this.generateOptions(HEIGHT_KEYS, 'height') | ||
), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement( | ||
'label', | ||
{ htmlFor: this.getId('width') }, | ||
'Pop Content Width' | ||
), | ||
_react2.default.createElement( | ||
'select', | ||
{ id: this.getId('width'), name: 'disclosureWidth', value: this.state.disclosureWidth, onChange: this.handleSelectChange }, | ||
this.generateOptions(WIDTH_KEYS, 'width') | ||
), | ||
_react2.default.createElement('br', null), | ||
_react2.default.createElement('br', null) | ||
); | ||
return _react.default.createElement("form", null, _react.default.createElement("label", { | ||
htmlFor: this.getId('height') | ||
}, "Pop Content Height"), _react.default.createElement("select", { | ||
id: this.getId('height'), | ||
name: "disclosureHeight", | ||
value: this.state.disclosureHeight, | ||
onChange: this.handleSelectChange | ||
}, this.generateOptions(HEIGHT_KEYS, 'height')), _react.default.createElement("br", null), _react.default.createElement("br", null), _react.default.createElement("label", { | ||
htmlFor: this.getId('width') | ||
}, "Pop Content Width"), _react.default.createElement("select", { | ||
id: this.getId('width'), | ||
name: "disclosureWidth", | ||
value: this.state.disclosureWidth, | ||
onChange: this.handleSelectChange | ||
}, this.generateOptions(WIDTH_KEYS, 'width')), _react.default.createElement("br", null), _react.default.createElement("br", null)); | ||
} | ||
}, { | ||
key: 'render', | ||
key: "render", | ||
value: function render() { | ||
var _props2 = this.props, | ||
disclosureManager = _props2.disclosureManager, | ||
identifier = _props2.identifier; | ||
return _react2.default.createElement( | ||
_terraContentContainer2.default, | ||
{ id: identifier, className: 'nested-component', fill: true, header: _react2.default.createElement( | ||
'h2', | ||
{ style: { margin: '0', borderBottom: '1px solid black' } }, | ||
'Content Component' | ||
) }, | ||
_react2.default.createElement( | ||
'p', | ||
null, | ||
'id:', | ||
' ', | ||
identifier | ||
), | ||
_react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'disclose', onClick: this.disclose() }, | ||
'Disclose' | ||
), | ||
_react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'disclose-tiny', onClick: this.disclose('tiny') }, | ||
'Disclose Tiny' | ||
), | ||
_react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'disclose-small', onClick: this.disclose('small') }, | ||
'Disclose Small' | ||
), | ||
_react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'disclose-medium', onClick: this.disclose('medium') }, | ||
'Disclose Medium' | ||
), | ||
_react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'disclose-large', onClick: this.disclose('large') }, | ||
'Disclose Large' | ||
), | ||
_react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'disclose-huge', onClick: this.disclose('huge') }, | ||
'Disclose Huge' | ||
), | ||
_react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'disclose-fullscreen', onClick: this.disclose('fullscreen') }, | ||
'Disclose Fullscreen' | ||
), | ||
_react2.default.createElement( | ||
'div', | ||
{ style: { padding: '0.7rem' } }, | ||
this.renderForm(), | ||
this.renderFormButton() | ||
), | ||
disclosureManager && disclosureManager.dismiss ? _react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'dismiss', onClick: this.dismiss }, | ||
'Dismiss' | ||
) : null, | ||
disclosureManager && disclosureManager.closeDisclosure ? _react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'close-disclosure', onClick: this.closeDisclosure }, | ||
'Close Disclosure' | ||
) : null, | ||
disclosureManager && disclosureManager.goBack ? _react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'go-back', onClick: this.goBack }, | ||
'Go Back' | ||
) : null, | ||
disclosureManager && disclosureManager.maximize ? _react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'maximize', onClick: this.maximize }, | ||
'Maximize' | ||
) : null, | ||
disclosureManager && disclosureManager.minimize ? _react2.default.createElement( | ||
'button', | ||
{ type: 'button', className: 'minimize', onClick: this.minimize }, | ||
'Minimize' | ||
) : null | ||
); | ||
var _this$props2 = this.props, | ||
disclosureManager = _this$props2.disclosureManager, | ||
identifier = _this$props2.identifier; | ||
return _react.default.createElement(_terraContentContainer.default, { | ||
id: identifier, | ||
className: "nested-component", | ||
fill: true, | ||
header: _react.default.createElement("h2", { | ||
style: { | ||
margin: '0', | ||
borderBottom: '1px solid black' | ||
} | ||
}, "Content Component") | ||
}, _react.default.createElement("p", null, "id:", ' ', identifier), _react.default.createElement("button", { | ||
type: "button", | ||
className: "disclose", | ||
onClick: this.disclose() | ||
}, "Disclose"), _react.default.createElement("button", { | ||
type: "button", | ||
className: "disclose-tiny", | ||
onClick: this.disclose('tiny') | ||
}, "Disclose Tiny"), _react.default.createElement("button", { | ||
type: "button", | ||
className: "disclose-small", | ||
onClick: this.disclose('small') | ||
}, "Disclose Small"), _react.default.createElement("button", { | ||
type: "button", | ||
className: "disclose-medium", | ||
onClick: this.disclose('medium') | ||
}, "Disclose Medium"), _react.default.createElement("button", { | ||
type: "button", | ||
className: "disclose-large", | ||
onClick: this.disclose('large') | ||
}, "Disclose Large"), _react.default.createElement("button", { | ||
type: "button", | ||
className: "disclose-huge", | ||
onClick: this.disclose('huge') | ||
}, "Disclose Huge"), _react.default.createElement("button", { | ||
type: "button", | ||
className: "disclose-fullscreen", | ||
onClick: this.disclose('fullscreen') | ||
}, "Disclose Fullscreen"), _react.default.createElement("div", { | ||
style: { | ||
padding: '0.7rem' | ||
} | ||
}, this.renderForm(), this.renderFormButton()), disclosureManager && disclosureManager.dismiss ? _react.default.createElement("button", { | ||
type: "button", | ||
className: "dismiss", | ||
onClick: this.dismiss | ||
}, "Dismiss") : null, disclosureManager && disclosureManager.closeDisclosure ? _react.default.createElement("button", { | ||
type: "button", | ||
className: "close-disclosure", | ||
onClick: this.closeDisclosure | ||
}, "Close Disclosure") : null, disclosureManager && disclosureManager.goBack ? _react.default.createElement("button", { | ||
type: "button", | ||
className: "go-back", | ||
onClick: this.goBack | ||
}, "Go Back") : null, disclosureManager && disclosureManager.maximize ? _react.default.createElement("button", { | ||
type: "button", | ||
className: "maximize", | ||
onClick: this.maximize | ||
}, "Maximize") : null, disclosureManager && disclosureManager.minimize ? _react.default.createElement("button", { | ||
type: "button", | ||
className: "minimize", | ||
onClick: this.minimize | ||
}, "Minimize") : null); | ||
} | ||
}]); | ||
return DisclosureComponent; | ||
}(_react2.default.Component); | ||
}(_react.default.Component); | ||
DisclosureComponent.propTypes = { | ||
disclosureManager: _terraDisclosureManager.disclosureManagerShape, | ||
identifier: _propTypes2.default.string, | ||
disclosureType: _propTypes2.default.string, | ||
nestedIndex: _propTypes2.default.number | ||
identifier: _propTypes.default.string, | ||
disclosureType: _propTypes.default.string, | ||
nestedIndex: _propTypes.default.number | ||
}; | ||
DisclosureComponent.defaultProps = { | ||
nestedIndex: 0 | ||
}; | ||
var WrappedDisclosureComponent = (0, _terraDisclosureManager.withDisclosureManager)(DisclosureComponent); | ||
exports.default = WrappedDisclosureComponent; | ||
var _default = WrappedDisclosureComponent; | ||
exports.default = _default; |
@@ -1,33 +0,29 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _react = require('react'); | ||
var _react = _interopRequireDefault(require("react")); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _DisclosureComponent = _interopRequireDefault(require("./DisclosureComponent")); | ||
var _DisclosureComponent = require('./DisclosureComponent'); | ||
var _SlidePanelManager = _interopRequireDefault(require("../../../SlidePanelManager")); | ||
var _DisclosureComponent2 = _interopRequireDefault(_DisclosureComponent); | ||
var _SlidePanelManager = require('../../../SlidePanelManager'); | ||
var _SlidePanelManager2 = _interopRequireDefault(_SlidePanelManager); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var SlidePanelManagerDefault = function SlidePanelManagerDefault() { | ||
return _react2.default.createElement( | ||
'div', | ||
{ role: 'main', style: { height: '100%' } }, | ||
_react2.default.createElement( | ||
_SlidePanelManager2.default, | ||
null, | ||
_react2.default.createElement(_DisclosureComponent2.default, { identifier: 'root-component', disclosureType: 'panel' }) | ||
) | ||
); | ||
return _react.default.createElement("div", { | ||
role: "main", | ||
style: { | ||
height: '100%' | ||
} | ||
}, _react.default.createElement(_SlidePanelManager.default, null, _react.default.createElement(_DisclosureComponent.default, { | ||
identifier: "root-component", | ||
disclosureType: "panel" | ||
}))); | ||
}; | ||
exports.default = SlidePanelManagerDefault; | ||
var _default = SlidePanelManagerDefault; | ||
exports.default = _default; |
{ | ||
"name": "terra-slide-panel-manager", | ||
"main": "lib/SlidePanelManager.js", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"description": "A DisclosureManager implementation that presents disclosed content using a SlidePanel.", | ||
@@ -33,4 +33,4 @@ "repository": { | ||
"prop-types": "^15.5.8", | ||
"terra-slide-group": "^4.0.0", | ||
"terra-slide-panel": "^3.5.0" | ||
"terra-slide-group": "^4.1.0", | ||
"terra-slide-panel": "^3.6.0" | ||
}, | ||
@@ -45,12 +45,12 @@ "devDependencies": { | ||
"scripts": { | ||
"compile": "npm run compile:clean && npm run compile:build", | ||
"compile:clean": "rm -rf lib", | ||
"compile:build": "babel src --out-dir lib --copy-files", | ||
"compile": "babel --root-mode upward src --out-dir lib --copy-files", | ||
"lint": "npm run lint:js && npm run lint:scss", | ||
"lint:js": "eslint --ext .js,.jsx . --ignore-path ../../.eslintignore", | ||
"lint:scss": "stylelint src/**/*.scss", | ||
"precompile": "rm -rf lib", | ||
"test": "npm run test:jest && npm run test:wdio", | ||
"test:jest": "jest --config ../../jestconfig.js", | ||
"test:wdio": "../../node_modules/.bin/wdio ../../node_modules/terra-dev-site/config/wdio/wdio.conf.js" | ||
} | ||
}, | ||
"gitHead": "55d4739caab6f5a19edb8daaabd83dd2579851de" | ||
} |
# Terra SlidePanel Manager | ||
[![NPM version](https://badgen.net/npm/v/terra-slide-panel-manager)](https://www.npmjs.org/package/terra-slide-panel-manager) | ||
[![Build Status](https://badgen.net/travis/cerner/terra-framework)](https://travis-ci.org/cerner/terra-framework) | ||
[![Build Status](https://badgen.net/travis/cerner/terra-framework)](https://travis-ci.com/cerner/terra-framework) | ||
@@ -6,0 +6,0 @@ The SlidePanelManager is a DisclosureManager implementation that presents disclosed content using a SlidePanel. |
@@ -1,84 +0,41 @@ | ||
const viewports = Terra.viewports('tiny', 'large'); | ||
viewports.forEach((viewport) => { | ||
describe('SlidePanelManager- Sizes', () => { | ||
before(() => { | ||
browser.setViewportSize(viewport); | ||
}); | ||
Terra.describeViewports('SlidePanelManager', ['tiny', 'large'], () => { | ||
before(() => browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default') | ||
.refresh()); | ||
afterEach(() => { | ||
Terra.validates.element({ selector: '#site' }); | ||
browser.click('[class*="slide-group"] #DemoContainer-1 .dismiss'); | ||
}); | ||
describe('Sizes', () => { | ||
describe('Disclose Default', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
browser.click('#root-component .disclose'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
Terra.should.beAccessible(); | ||
it('Disclose Default', () => browser.click('#root-component .disclose')); | ||
}); | ||
describe('Disclose Tiny', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
browser.click('#root-component .disclose-tiny'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
it('Disclose Tiny', () => browser.click('#root-component .disclose-tiny')); | ||
}); | ||
describe('Disclose Small', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
browser.click('#root-component .disclose-small'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
it('Disclose Small', () => browser.click('#root-component .disclose-small')); | ||
}); | ||
describe('Disclose Medium', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
browser.click('#root-component .disclose-medium'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
it('Disclose Medium', () => browser.click('#root-component .disclose-medium')); | ||
}); | ||
describe('Disclose Large', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
browser.click('#root-component .disclose-large'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
it('Disclose Large', () => browser.click('#root-component .disclose-large')); | ||
}); | ||
describe('Disclose Huge', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
browser.click('#root-component .disclose-huge'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
it('Disclose Huge', () => browser.click('#root-component .disclose-huge')); | ||
}); | ||
describe('Disclose Fullscreen', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
browser.click('#root-component .disclose-fullscreen'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
it('Disclose Fullscreen', () => browser.click('#root-component .disclose-fullscreen')); | ||
}); | ||
}); | ||
}); | ||
viewports.forEach((viewport) => { | ||
describe('SlidePanelManager- Dimensions', () => { | ||
before(() => { | ||
browser.setViewportSize(viewport); | ||
}); | ||
describe('Dimensions', () => { | ||
describe('Disclose Width-320', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclose Width-320', () => { | ||
browser.click('#disclosureDimensions-width-0'); | ||
@@ -90,9 +47,6 @@ browser.click('#width-320-0'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclose Width-480', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclose Width-480', () => { | ||
browser.click('#disclosureDimensions-width-0'); | ||
@@ -104,9 +58,6 @@ browser.click('#width-480-0'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclose Width-560', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclose Width-560', () => { | ||
browser.click('#disclosureDimensions-width-0'); | ||
@@ -118,9 +69,6 @@ browser.click('#width-560-0'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclose Width-640', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclose Width-640', () => { | ||
browser.click('#disclosureDimensions-width-0'); | ||
@@ -132,9 +80,9 @@ browser.click('#width-640-0'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclose Height-240', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclose Height-240', () => { | ||
browser.click('#disclosureDimensions-width-0'); | ||
browser.click('#width-320-0'); | ||
browser.click('#disclosureDimensions-height-0'); | ||
@@ -146,9 +94,6 @@ browser.click('#height-240-0'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclose Height-420', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclose Height-420', () => { | ||
browser.click('#disclosureDimensions-height-0'); | ||
@@ -160,9 +105,6 @@ browser.click('#height-420-0'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclose Height-600', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclose Height-600', () => { | ||
browser.click('#disclosureDimensions-height-0'); | ||
@@ -174,9 +116,6 @@ browser.click('#height-600-0'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclose Height-690', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclose Height-690', () => { | ||
browser.click('#disclosureDimensions-height-0'); | ||
@@ -188,4 +127,2 @@ browser.click('#height-690-0'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
@@ -195,11 +132,8 @@ }); | ||
describe('SlidePanelManager- Behaviors', () => { | ||
before(() => { | ||
browser.setViewportSize(Terra.viewports('large')[0]); | ||
}); | ||
Terra.describeViewports('SlidePanelManager- Behaviors', ['large'], () => { | ||
before(() => browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default') | ||
.refresh()); | ||
describe('Nested Disclose', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Nested Disclose', () => { | ||
browser.click('#root-component .disclose-large'); | ||
@@ -209,11 +143,10 @@ | ||
browser.click('[class*="slide-group"] #DemoContainer-1 .disclose-tiny'); | ||
Terra.validates.element({ selector: '#site' }); | ||
browser.click('[class*="slide-group"] #DemoContainer-2 .close-disclosure'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclosure - Dismiss', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclosure - Dismiss', () => { | ||
browser.click('#root-component .disclose-large'); | ||
@@ -223,11 +156,8 @@ | ||
browser.click('[class*="slide-group"] #DemoContainer-1 .dismiss'); | ||
Terra.validates.element({ selector: '#site' }); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclosure - Close Disclosure', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclosure - Close Disclosure', () => { | ||
browser.click('#root-component .disclose-large'); | ||
@@ -237,11 +167,8 @@ | ||
browser.click('[class*="slide-group"] #DemoContainer-1 .close-disclosure'); | ||
Terra.validates.element({ selector: '#site' }); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclosure - Maximize', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclosure - Maximize', () => { | ||
browser.click('#root-component .disclose-large'); | ||
@@ -251,11 +178,10 @@ | ||
browser.click('[class*="slide-group"] #DemoContainer-1 .maximize'); | ||
Terra.validates.element({ selector: '#site' }); | ||
browser.click('[class*="slide-group"] #DemoContainer-1 .dismiss'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
describe('Disclosure - Minimize', () => { | ||
beforeEach(() => { | ||
browser.url('/#/raw/tests/terra-slide-panel-manager/slide-panel-manager/slide-panel-manager-default'); | ||
it('Disclosure - Minimize', () => { | ||
browser.click('#root-component .disclose-large'); | ||
@@ -271,6 +197,6 @@ | ||
browser.waitForVisible('[class*="slide-group"] #DemoContainer-1 .maximize', 1000); | ||
Terra.validates.element({ selector: '#site' }); | ||
browser.click('[class*="slide-group"] #DemoContainer-1 .dismiss'); | ||
}); | ||
Terra.should.matchScreenshot({ selector: '#site' }); | ||
}); | ||
}); |
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
89302
1514
Updatedterra-slide-group@^4.1.0
Updatedterra-slide-panel@^3.6.0