Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-expand

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-expand - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

build/src/Components/Modal/ModalOpenButton.d.ts

124

build/index.js

@@ -129,3 +129,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

_this.controlElement = function () {
_this.props.controlElement({
return _this.props.controlElement({
state: _this.context.isExpanded(_this.props.collapseId),

@@ -360,2 +360,11 @@ onClick: _this.context.changeExpandState(_this.props.collapseId)

var __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
}if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
}return t;
};
var Modal = exports.Modal = function (_React$Component) {

@@ -369,2 +378,3 @@ _inherits(Modal, _React$Component);

_this.overlayStyle = Object.assign({ top: 0, left: 0, right: 0, bottom: 0, position: "fixed" }, _this.props.style);
_this.setBodyClassName = function () {

@@ -412,4 +422,9 @@ if (document.body.classList.contains("modal-open") && !_this.context.isExpanded(_this.props.modalId)) {

value: function render() {
var dataAttr = "data-expand" + (!this.props.closeOnOutside ? "-keep" : "");
return ReactDOM.createPortal(this.context.isExpanded(this.props.modalId) && React.createElement("div", Object.assign({}, this.props.wrapperProps, _defineProperty({}, dataAttr, this.props.modalId)), this.props.children), this.container);
var _a = this.props,
modalId = _a.modalId,
closeOnOutside = _a.closeOnOutside,
defaultOpened = _a.defaultOpened,
childProps = __rest(_a, ["modalId", "closeOnOutside", "defaultOpened"]);
var dataAttr = "data-expand" + (!closeOnOutside ? "-keep" : "");
return ReactDOM.createPortal(this.context.isExpanded(modalId) && React.createElement("div", Object.assign({}, childProps, { style: this.overlayStyle }, _defineProperty({}, dataAttr, modalId), closeOnOutside ? { onClick: this.context.changeExpandState(modalId, false) } : {}), this.props.children), this.container);
}

@@ -476,3 +491,3 @@ }]);

value: function render() {
return React.createElement("button", Object.assign({}, this.props, { onClick: this.handleClose }), this.props.children);
return React.createElement("button", Object.assign({}, this.props, { onClick: this.handleClose, type: "button" }), this.props.children);
}

@@ -488,2 +503,80 @@ }]);

/***/ "./src/Components/Modal/ModalOpenButton.tsx":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ModalOpenButton = exports.ModalOpenButtonPropTypes = undefined;
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 _react = __webpack_require__("react");
var React = _interopRequireWildcard(_react);
var _propTypes = __webpack_require__("prop-types");
var PropTypes = _interopRequireWildcard(_propTypes);
var _ExpandController = __webpack_require__("./src/Components/ExpandController/index.ts");
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
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 __rest = undefined && undefined.__rest || function (s, e) {
var t = {};
for (var p in s) {
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
}if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
}return t;
};
var ModalOpenButtonPropTypes = exports.ModalOpenButtonPropTypes = {
modalId: PropTypes.string.isRequired
};
var ModalOpenButton = exports.ModalOpenButton = function (_React$Component) {
_inherits(ModalOpenButton, _React$Component);
function ModalOpenButton() {
_classCallCheck(this, ModalOpenButton);
var _this = _possibleConstructorReturn(this, (ModalOpenButton.__proto__ || Object.getPrototypeOf(ModalOpenButton)).apply(this, arguments));
_this.handleOpen = function (event) {
_this.props.onClick && _this.props.onClick(event);
if (!event.defaultPrevented) {
_this.context.changeExpandState(_this.props.modalId, true)();
}
};
return _this;
}
_createClass(ModalOpenButton, [{
key: "render",
value: function render() {
var _a = this.props,
modalId = _a.modalId,
childProps = __rest(_a, ["modalId"]);
return React.createElement("button", Object.assign({}, childProps, { type: "button", onClick: this.handleOpen, "data-expand": modalId }), this.props.children);
}
}]);
return ModalOpenButton;
}(React.Component);
ModalOpenButton.propTypes = ModalOpenButtonPropTypes;
ModalOpenButton.contextTypes = _ExpandController.ExpandContextTypes;
/***/ }),
/***/ "./src/Components/Modal/ModalProps.ts":

@@ -507,10 +600,7 @@ /***/ (function(module, exports, __webpack_require__) {

var ModalPropTypes = exports.ModalPropTypes = {
wrapperProps: PropTypes.object,
closeOnOutside: PropTypes.bool,
defaultOpened: PropTypes.bool
defaultOpened: PropTypes.bool,
modalId: PropTypes.string
};
var ModalDefaultProps = exports.ModalDefaultProps = {
wrapperProps: {
className: "modal-overlay"
},
modalId: "modal-" + (Date.now().toString() + Math.random().toString())

@@ -558,2 +648,14 @@ };

var _ModalOpenButton = __webpack_require__("./src/Components/Modal/ModalOpenButton.tsx");
Object.keys(_ModalOpenButton).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _ModalOpenButton[key];
}
});
});
var _ModalCloseButton = __webpack_require__("./src/Components/Modal/ModalCloseButton.tsx");

@@ -632,3 +734,3 @@

childProps = __rest(_a, ["tabId"]);
return React.createElement("div", Object.assign({}, childProps, { onClick: this.handleTabActivate, "data-expand-keep": tabId, className: "header" }), this.props.children);
return React.createElement("div", Object.assign({}, childProps, { onClick: this.handleTabActivate, "data-expand-keep": tabId }), this.props.children);
}

@@ -708,3 +810,3 @@ }]);

childProps = __rest(_a, ["tabId"]);
return React.createElement("div", Object.assign({}, childProps, { className: "tab", "data-expand-keep": tabId }), this.context.isExpanded(tabId) && this.props.children);
return React.createElement("div", Object.assign({}, childProps, { "data-expand-keep": tabId }), this.context.isExpanded(tabId) && this.props.children);
}

@@ -711,0 +813,0 @@ }]);

2

build/src/Components/Collapse/Collapse.d.ts

@@ -44,3 +44,3 @@ /// <reference types="react" />

render(): JSX.Element;
protected controlElement: () => void;
protected controlElement: () => JSX.Element;
}
export * from "./Modal";
export * from "./ModalProps";
export * from "./ModalOpenButton";
export * from "./ModalCloseButton";

@@ -16,12 +16,680 @@ /// <reference types="react" />

static readonly defaultProps: {
wrapperProps?: React.HTMLProps<HTMLDivElement>;
closeOnOutside?: boolean;
defaultOpened?: boolean;
modalId?: string;
accept?: string;
acceptCharset?: string;
action?: string;
allowFullScreen?: boolean;
allowTransparency?: boolean;
alt?: string;
as?: string;
async?: boolean;
autoComplete?: string;
autoFocus?: boolean;
autoPlay?: boolean;
capture?: boolean;
cellPadding?: string | number;
cellSpacing?: string | number;
charSet?: string;
challenge?: string;
checked?: boolean;
cite?: string;
classID?: string;
cols?: number;
colSpan?: number;
content?: string;
controls?: boolean;
coords?: string;
crossOrigin?: string;
data?: string;
dateTime?: string;
default?: boolean;
defer?: boolean;
disabled?: boolean;
download?: any;
encType?: string;
form?: string;
formAction?: string;
formEncType?: string;
formMethod?: string;
formNoValidate?: boolean;
formTarget?: string;
frameBorder?: string | number;
headers?: string;
height?: string | number;
high?: number;
href?: string;
hrefLang?: string;
htmlFor?: string;
httpEquiv?: string;
integrity?: string;
keyParams?: string;
keyType?: string;
kind?: string;
label?: string;
list?: string;
loop?: boolean;
low?: number;
manifest?: string;
marginHeight?: number;
marginWidth?: number;
max?: string | number;
maxLength?: number;
media?: string;
mediaGroup?: string;
method?: string;
min?: string | number;
minLength?: number;
multiple?: boolean;
muted?: boolean;
name?: string;
nonce?: string;
noValidate?: boolean;
open?: boolean;
optimum?: number;
pattern?: string;
placeholder?: string;
playsInline?: boolean;
poster?: string;
preload?: string;
readOnly?: boolean;
rel?: string;
required?: boolean;
reversed?: boolean;
rows?: number;
rowSpan?: number;
sandbox?: string;
scope?: string;
scoped?: boolean;
scrolling?: string;
seamless?: boolean;
selected?: boolean;
shape?: string;
size?: number;
sizes?: string;
span?: number;
src?: string;
srcDoc?: string;
srcLang?: string;
srcSet?: string;
start?: number;
step?: string | number;
summary?: string;
target?: string;
type?: string;
useMap?: string;
value?: string | number | string[];
width?: string | number;
wmode?: string;
wrap?: string;
defaultChecked?: boolean;
defaultValue?: string | string[];
suppressContentEditableWarning?: boolean;
accessKey?: string;
className?: string;
contentEditable?: boolean;
contextMenu?: string;
dir?: string;
draggable?: boolean;
hidden?: boolean;
id?: string;
lang?: string;
slot?: string;
spellCheck?: boolean;
style?: React.CSSProperties;
tabIndex?: number;
title?: string;
inputMode?: string;
is?: string;
radioGroup?: string;
role?: string;
about?: string;
datatype?: string;
inlist?: any;
prefix?: string;
property?: string;
resource?: string;
typeof?: string;
vocab?: string;
autoCapitalize?: string;
autoCorrect?: string;
autoSave?: string;
color?: string;
itemProp?: string;
itemScope?: boolean;
itemType?: string;
itemID?: string;
itemRef?: string;
results?: number;
security?: string;
unselectable?: boolean;
'aria-activedescendant'?: string;
'aria-atomic'?: boolean | "false" | "true";
'aria-autocomplete'?: "list" | "none" | "inline" | "both";
'aria-busy'?: boolean | "false" | "true";
'aria-checked'?: boolean | "false" | "true" | "mixed";
'aria-colcount'?: number;
'aria-colindex'?: number;
'aria-colspan'?: number;
'aria-current'?: boolean | "step" | "false" | "true" | "page" | "location" | "date" | "time";
'aria-describedby'?: string;
'aria-details'?: string;
'aria-disabled'?: boolean | "false" | "true";
'aria-dropeffect'?: "none" | "copy" | "execute" | "link" | "move" | "popup";
'aria-errormessage'?: string;
'aria-expanded'?: boolean | "false" | "true";
'aria-flowto'?: string;
'aria-grabbed'?: boolean | "false" | "true";
'aria-haspopup'?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog";
'aria-hidden'?: boolean | "false" | "true";
'aria-invalid'?: boolean | "false" | "true" | "grammar" | "spelling";
'aria-keyshortcuts'?: string;
'aria-label'?: string;
'aria-labelledby'?: string;
'aria-level'?: number;
'aria-live'?: "off" | "assertive" | "polite";
'aria-modal'?: boolean | "false" | "true";
'aria-multiline'?: boolean | "false" | "true";
'aria-multiselectable'?: boolean | "false" | "true";
'aria-orientation'?: "horizontal" | "vertical";
'aria-owns'?: string;
'aria-placeholder'?: string;
'aria-posinset'?: number;
'aria-pressed'?: boolean | "false" | "true" | "mixed";
'aria-readonly'?: boolean | "false" | "true";
'aria-relevant'?: "additions" | "additions text" | "all" | "removals" | "text";
'aria-required'?: boolean | "false" | "true";
'aria-roledescription'?: string;
'aria-rowcount'?: number;
'aria-rowindex'?: number;
'aria-rowspan'?: number;
'aria-selected'?: boolean | "false" | "true";
'aria-setsize'?: number;
'aria-sort'?: "none" | "ascending" | "descending" | "other";
'aria-valuemax'?: number;
'aria-valuemin'?: number;
'aria-valuenow'?: number;
'aria-valuetext'?: string;
children?: React.ReactNode;
dangerouslySetInnerHTML?: {
__html: string;
};
onCopy?: (event: React.ClipboardEvent<HTMLDivElement>) => void;
onCopyCapture?: (event: React.ClipboardEvent<HTMLDivElement>) => void;
onCut?: (event: React.ClipboardEvent<HTMLDivElement>) => void;
onCutCapture?: (event: React.ClipboardEvent<HTMLDivElement>) => void;
onPaste?: (event: React.ClipboardEvent<HTMLDivElement>) => void;
onPasteCapture?: (event: React.ClipboardEvent<HTMLDivElement>) => void;
onCompositionEnd?: (event: React.CompositionEvent<HTMLDivElement>) => void;
onCompositionEndCapture?: (event: React.CompositionEvent<HTMLDivElement>) => void;
onCompositionStart?: (event: React.CompositionEvent<HTMLDivElement>) => void;
onCompositionStartCapture?: (event: React.CompositionEvent<HTMLDivElement>) => void;
onCompositionUpdate?: (event: React.CompositionEvent<HTMLDivElement>) => void;
onCompositionUpdateCapture?: (event: React.CompositionEvent<HTMLDivElement>) => void;
onFocus?: (event: React.FocusEvent<HTMLDivElement>) => void;
onFocusCapture?: (event: React.FocusEvent<HTMLDivElement>) => void;
onBlur?: (event: React.FocusEvent<HTMLDivElement>) => void;
onBlurCapture?: (event: React.FocusEvent<HTMLDivElement>) => void;
onChange?: (event: React.FormEvent<HTMLDivElement>) => void;
onChangeCapture?: (event: React.FormEvent<HTMLDivElement>) => void;
onInput?: (event: React.FormEvent<HTMLDivElement>) => void;
onInputCapture?: (event: React.FormEvent<HTMLDivElement>) => void;
onReset?: (event: React.FormEvent<HTMLDivElement>) => void;
onResetCapture?: (event: React.FormEvent<HTMLDivElement>) => void;
onSubmit?: (event: React.FormEvent<HTMLDivElement>) => void;
onSubmitCapture?: (event: React.FormEvent<HTMLDivElement>) => void;
onInvalid?: (event: React.FormEvent<HTMLDivElement>) => void;
onInvalidCapture?: (event: React.FormEvent<HTMLDivElement>) => void;
onLoad?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onLoadCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onError?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onErrorCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onKeyDown?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
onKeyDownCapture?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
onKeyPress?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
onKeyPressCapture?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
onKeyUp?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
onKeyUpCapture?: (event: React.KeyboardEvent<HTMLDivElement>) => void;
onAbort?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onAbortCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onCanPlay?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onCanPlayCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onCanPlayThrough?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onCanPlayThroughCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onDurationChange?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onDurationChangeCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onEmptied?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onEmptiedCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onEncrypted?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onEncryptedCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onEnded?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onEndedCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onLoadedData?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onLoadedDataCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onLoadedMetadata?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onLoadedMetadataCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onLoadStart?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onLoadStartCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onPause?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onPauseCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onPlay?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onPlayCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onPlaying?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onPlayingCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onProgress?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onProgressCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onRateChange?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onRateChangeCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onSeeked?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onSeekedCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onSeeking?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onSeekingCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onStalled?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onStalledCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onSuspend?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onSuspendCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onTimeUpdate?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onTimeUpdateCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onVolumeChange?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onVolumeChangeCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onWaiting?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onWaitingCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
onClickCapture?: (event: React.MouseEvent<HTMLDivElement>) => void;
onContextMenu?: (event: React.MouseEvent<HTMLDivElement>) => void;
onContextMenuCapture?: (event: React.MouseEvent<HTMLDivElement>) => void;
onDoubleClick?: (event: React.MouseEvent<HTMLDivElement>) => void;
onDoubleClickCapture?: (event: React.MouseEvent<HTMLDivElement>) => void;
onDrag?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragCapture?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragEnd?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragEndCapture?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragEnter?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragEnterCapture?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragExit?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragExitCapture?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragLeave?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragLeaveCapture?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragOver?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragOverCapture?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragStart?: (event: React.DragEvent<HTMLDivElement>) => void;
onDragStartCapture?: (event: React.DragEvent<HTMLDivElement>) => void;
onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;
onDropCapture?: (event: React.DragEvent<HTMLDivElement>) => void;
onMouseDown?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseDownCapture?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseEnter?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseLeave?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseMove?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseMoveCapture?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseOut?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseOutCapture?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseOver?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseOverCapture?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseUp?: (event: React.MouseEvent<HTMLDivElement>) => void;
onMouseUpCapture?: (event: React.MouseEvent<HTMLDivElement>) => void;
onSelect?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onSelectCapture?: (event: React.SyntheticEvent<HTMLDivElement>) => void;
onTouchCancel?: (event: React.TouchEvent<HTMLDivElement>) => void;
onTouchCancelCapture?: (event: React.TouchEvent<HTMLDivElement>) => void;
onTouchEnd?: (event: React.TouchEvent<HTMLDivElement>) => void;
onTouchEndCapture?: (event: React.TouchEvent<HTMLDivElement>) => void;
onTouchMove?: (event: React.TouchEvent<HTMLDivElement>) => void;
onTouchMoveCapture?: (event: React.TouchEvent<HTMLDivElement>) => void;
onTouchStart?: (event: React.TouchEvent<HTMLDivElement>) => void;
onTouchStartCapture?: (event: React.TouchEvent<HTMLDivElement>) => void;
onScroll?: (event: React.UIEvent<HTMLDivElement>) => void;
onScrollCapture?: (event: React.UIEvent<HTMLDivElement>) => void;
onWheel?: (event: React.WheelEvent<HTMLDivElement>) => void;
onWheelCapture?: (event: React.WheelEvent<HTMLDivElement>) => void;
onAnimationStart?: (event: React.AnimationEvent<HTMLDivElement>) => void;
onAnimationStartCapture?: (event: React.AnimationEvent<HTMLDivElement>) => void;
onAnimationEnd?: (event: React.AnimationEvent<HTMLDivElement>) => void;
onAnimationEndCapture?: (event: React.AnimationEvent<HTMLDivElement>) => void;
onAnimationIteration?: (event: React.AnimationEvent<HTMLDivElement>) => void;
onAnimationIterationCapture?: (event: React.AnimationEvent<HTMLDivElement>) => void;
onTransitionEnd?: (event: React.TransitionEvent<HTMLDivElement>) => void;
onTransitionEndCapture?: (event: React.TransitionEvent<HTMLDivElement>) => void;
ref?: React.Ref<HTMLDivElement>;
key?: string | number;
};
static readonly propTypes: {
wrapperProps?: PropTypes.Validator<any>;
closeOnOutside?: PropTypes.Validator<any>;
defaultOpened?: PropTypes.Validator<any>;
modalId?: PropTypes.Validator<any>;
accept?: PropTypes.Validator<any>;
acceptCharset?: PropTypes.Validator<any>;
action?: PropTypes.Validator<any>;
allowFullScreen?: PropTypes.Validator<any>;
allowTransparency?: PropTypes.Validator<any>;
alt?: PropTypes.Validator<any>;
as?: PropTypes.Validator<any>;
async?: PropTypes.Validator<any>;
autoComplete?: PropTypes.Validator<any>;
autoFocus?: PropTypes.Validator<any>;
autoPlay?: PropTypes.Validator<any>;
capture?: PropTypes.Validator<any>;
cellPadding?: PropTypes.Validator<any>;
cellSpacing?: PropTypes.Validator<any>;
charSet?: PropTypes.Validator<any>;
challenge?: PropTypes.Validator<any>;
checked?: PropTypes.Validator<any>;
cite?: PropTypes.Validator<any>;
classID?: PropTypes.Validator<any>;
cols?: PropTypes.Validator<any>;
colSpan?: PropTypes.Validator<any>;
content?: PropTypes.Validator<any>;
controls?: PropTypes.Validator<any>;
coords?: PropTypes.Validator<any>;
crossOrigin?: PropTypes.Validator<any>;
data?: PropTypes.Validator<any>;
dateTime?: PropTypes.Validator<any>;
default?: PropTypes.Validator<any>;
defer?: PropTypes.Validator<any>;
disabled?: PropTypes.Validator<any>;
download?: PropTypes.Validator<any>;
encType?: PropTypes.Validator<any>;
form?: PropTypes.Validator<any>;
formAction?: PropTypes.Validator<any>;
formEncType?: PropTypes.Validator<any>;
formMethod?: PropTypes.Validator<any>;
formNoValidate?: PropTypes.Validator<any>;
formTarget?: PropTypes.Validator<any>;
frameBorder?: PropTypes.Validator<any>;
headers?: PropTypes.Validator<any>;
height?: PropTypes.Validator<any>;
high?: PropTypes.Validator<any>;
href?: PropTypes.Validator<any>;
hrefLang?: PropTypes.Validator<any>;
htmlFor?: PropTypes.Validator<any>;
httpEquiv?: PropTypes.Validator<any>;
integrity?: PropTypes.Validator<any>;
keyParams?: PropTypes.Validator<any>;
keyType?: PropTypes.Validator<any>;
kind?: PropTypes.Validator<any>;
label?: PropTypes.Validator<any>;
list?: PropTypes.Validator<any>;
loop?: PropTypes.Validator<any>;
low?: PropTypes.Validator<any>;
manifest?: PropTypes.Validator<any>;
marginHeight?: PropTypes.Validator<any>;
marginWidth?: PropTypes.Validator<any>;
max?: PropTypes.Validator<any>;
maxLength?: PropTypes.Validator<any>;
media?: PropTypes.Validator<any>;
mediaGroup?: PropTypes.Validator<any>;
method?: PropTypes.Validator<any>;
min?: PropTypes.Validator<any>;
minLength?: PropTypes.Validator<any>;
multiple?: PropTypes.Validator<any>;
muted?: PropTypes.Validator<any>;
name?: PropTypes.Validator<any>;
nonce?: PropTypes.Validator<any>;
noValidate?: PropTypes.Validator<any>;
open?: PropTypes.Validator<any>;
optimum?: PropTypes.Validator<any>;
pattern?: PropTypes.Validator<any>;
placeholder?: PropTypes.Validator<any>;
playsInline?: PropTypes.Validator<any>;
poster?: PropTypes.Validator<any>;
preload?: PropTypes.Validator<any>;
readOnly?: PropTypes.Validator<any>;
rel?: PropTypes.Validator<any>;
required?: PropTypes.Validator<any>;
reversed?: PropTypes.Validator<any>;
rows?: PropTypes.Validator<any>;
rowSpan?: PropTypes.Validator<any>;
sandbox?: PropTypes.Validator<any>;
scope?: PropTypes.Validator<any>;
scoped?: PropTypes.Validator<any>;
scrolling?: PropTypes.Validator<any>;
seamless?: PropTypes.Validator<any>;
selected?: PropTypes.Validator<any>;
shape?: PropTypes.Validator<any>;
size?: PropTypes.Validator<any>;
sizes?: PropTypes.Validator<any>;
span?: PropTypes.Validator<any>;
src?: PropTypes.Validator<any>;
srcDoc?: PropTypes.Validator<any>;
srcLang?: PropTypes.Validator<any>;
srcSet?: PropTypes.Validator<any>;
start?: PropTypes.Validator<any>;
step?: PropTypes.Validator<any>;
summary?: PropTypes.Validator<any>;
target?: PropTypes.Validator<any>;
type?: PropTypes.Validator<any>;
useMap?: PropTypes.Validator<any>;
value?: PropTypes.Validator<any>;
width?: PropTypes.Validator<any>;
wmode?: PropTypes.Validator<any>;
wrap?: PropTypes.Validator<any>;
defaultChecked?: PropTypes.Validator<any>;
defaultValue?: PropTypes.Validator<any>;
suppressContentEditableWarning?: PropTypes.Validator<any>;
accessKey?: PropTypes.Validator<any>;
className?: PropTypes.Validator<any>;
contentEditable?: PropTypes.Validator<any>;
contextMenu?: PropTypes.Validator<any>;
dir?: PropTypes.Validator<any>;
draggable?: PropTypes.Validator<any>;
hidden?: PropTypes.Validator<any>;
id?: PropTypes.Validator<any>;
lang?: PropTypes.Validator<any>;
slot?: PropTypes.Validator<any>;
spellCheck?: PropTypes.Validator<any>;
style?: PropTypes.Validator<any>;
tabIndex?: PropTypes.Validator<any>;
title?: PropTypes.Validator<any>;
inputMode?: PropTypes.Validator<any>;
is?: PropTypes.Validator<any>;
radioGroup?: PropTypes.Validator<any>;
role?: PropTypes.Validator<any>;
about?: PropTypes.Validator<any>;
datatype?: PropTypes.Validator<any>;
inlist?: PropTypes.Validator<any>;
prefix?: PropTypes.Validator<any>;
property?: PropTypes.Validator<any>;
resource?: PropTypes.Validator<any>;
typeof?: PropTypes.Validator<any>;
vocab?: PropTypes.Validator<any>;
autoCapitalize?: PropTypes.Validator<any>;
autoCorrect?: PropTypes.Validator<any>;
autoSave?: PropTypes.Validator<any>;
color?: PropTypes.Validator<any>;
itemProp?: PropTypes.Validator<any>;
itemScope?: PropTypes.Validator<any>;
itemType?: PropTypes.Validator<any>;
itemID?: PropTypes.Validator<any>;
itemRef?: PropTypes.Validator<any>;
results?: PropTypes.Validator<any>;
security?: PropTypes.Validator<any>;
unselectable?: PropTypes.Validator<any>;
'aria-activedescendant'?: PropTypes.Validator<any>;
'aria-atomic'?: PropTypes.Validator<any>;
'aria-autocomplete'?: PropTypes.Validator<any>;
'aria-busy'?: PropTypes.Validator<any>;
'aria-checked'?: PropTypes.Validator<any>;
'aria-colcount'?: PropTypes.Validator<any>;
'aria-colindex'?: PropTypes.Validator<any>;
'aria-colspan'?: PropTypes.Validator<any>;
'aria-current'?: PropTypes.Validator<any>;
'aria-describedby'?: PropTypes.Validator<any>;
'aria-details'?: PropTypes.Validator<any>;
'aria-disabled'?: PropTypes.Validator<any>;
'aria-dropeffect'?: PropTypes.Validator<any>;
'aria-errormessage'?: PropTypes.Validator<any>;
'aria-expanded'?: PropTypes.Validator<any>;
'aria-flowto'?: PropTypes.Validator<any>;
'aria-grabbed'?: PropTypes.Validator<any>;
'aria-haspopup'?: PropTypes.Validator<any>;
'aria-hidden'?: PropTypes.Validator<any>;
'aria-invalid'?: PropTypes.Validator<any>;
'aria-keyshortcuts'?: PropTypes.Validator<any>;
'aria-label'?: PropTypes.Validator<any>;
'aria-labelledby'?: PropTypes.Validator<any>;
'aria-level'?: PropTypes.Validator<any>;
'aria-live'?: PropTypes.Validator<any>;
'aria-modal'?: PropTypes.Validator<any>;
'aria-multiline'?: PropTypes.Validator<any>;
'aria-multiselectable'?: PropTypes.Validator<any>;
'aria-orientation'?: PropTypes.Validator<any>;
'aria-owns'?: PropTypes.Validator<any>;
'aria-placeholder'?: PropTypes.Validator<any>;
'aria-posinset'?: PropTypes.Validator<any>;
'aria-pressed'?: PropTypes.Validator<any>;
'aria-readonly'?: PropTypes.Validator<any>;
'aria-relevant'?: PropTypes.Validator<any>;
'aria-required'?: PropTypes.Validator<any>;
'aria-roledescription'?: PropTypes.Validator<any>;
'aria-rowcount'?: PropTypes.Validator<any>;
'aria-rowindex'?: PropTypes.Validator<any>;
'aria-rowspan'?: PropTypes.Validator<any>;
'aria-selected'?: PropTypes.Validator<any>;
'aria-setsize'?: PropTypes.Validator<any>;
'aria-sort'?: PropTypes.Validator<any>;
'aria-valuemax'?: PropTypes.Validator<any>;
'aria-valuemin'?: PropTypes.Validator<any>;
'aria-valuenow'?: PropTypes.Validator<any>;
'aria-valuetext'?: PropTypes.Validator<any>;
children?: PropTypes.Validator<any>;
dangerouslySetInnerHTML?: PropTypes.Validator<any>;
onCopy?: PropTypes.Validator<any>;
onCopyCapture?: PropTypes.Validator<any>;
onCut?: PropTypes.Validator<any>;
onCutCapture?: PropTypes.Validator<any>;
onPaste?: PropTypes.Validator<any>;
onPasteCapture?: PropTypes.Validator<any>;
onCompositionEnd?: PropTypes.Validator<any>;
onCompositionEndCapture?: PropTypes.Validator<any>;
onCompositionStart?: PropTypes.Validator<any>;
onCompositionStartCapture?: PropTypes.Validator<any>;
onCompositionUpdate?: PropTypes.Validator<any>;
onCompositionUpdateCapture?: PropTypes.Validator<any>;
onFocus?: PropTypes.Validator<any>;
onFocusCapture?: PropTypes.Validator<any>;
onBlur?: PropTypes.Validator<any>;
onBlurCapture?: PropTypes.Validator<any>;
onChange?: PropTypes.Validator<any>;
onChangeCapture?: PropTypes.Validator<any>;
onInput?: PropTypes.Validator<any>;
onInputCapture?: PropTypes.Validator<any>;
onReset?: PropTypes.Validator<any>;
onResetCapture?: PropTypes.Validator<any>;
onSubmit?: PropTypes.Validator<any>;
onSubmitCapture?: PropTypes.Validator<any>;
onInvalid?: PropTypes.Validator<any>;
onInvalidCapture?: PropTypes.Validator<any>;
onLoad?: PropTypes.Validator<any>;
onLoadCapture?: PropTypes.Validator<any>;
onError?: PropTypes.Validator<any>;
onErrorCapture?: PropTypes.Validator<any>;
onKeyDown?: PropTypes.Validator<any>;
onKeyDownCapture?: PropTypes.Validator<any>;
onKeyPress?: PropTypes.Validator<any>;
onKeyPressCapture?: PropTypes.Validator<any>;
onKeyUp?: PropTypes.Validator<any>;
onKeyUpCapture?: PropTypes.Validator<any>;
onAbort?: PropTypes.Validator<any>;
onAbortCapture?: PropTypes.Validator<any>;
onCanPlay?: PropTypes.Validator<any>;
onCanPlayCapture?: PropTypes.Validator<any>;
onCanPlayThrough?: PropTypes.Validator<any>;
onCanPlayThroughCapture?: PropTypes.Validator<any>;
onDurationChange?: PropTypes.Validator<any>;
onDurationChangeCapture?: PropTypes.Validator<any>;
onEmptied?: PropTypes.Validator<any>;
onEmptiedCapture?: PropTypes.Validator<any>;
onEncrypted?: PropTypes.Validator<any>;
onEncryptedCapture?: PropTypes.Validator<any>;
onEnded?: PropTypes.Validator<any>;
onEndedCapture?: PropTypes.Validator<any>;
onLoadedData?: PropTypes.Validator<any>;
onLoadedDataCapture?: PropTypes.Validator<any>;
onLoadedMetadata?: PropTypes.Validator<any>;
onLoadedMetadataCapture?: PropTypes.Validator<any>;
onLoadStart?: PropTypes.Validator<any>;
onLoadStartCapture?: PropTypes.Validator<any>;
onPause?: PropTypes.Validator<any>;
onPauseCapture?: PropTypes.Validator<any>;
onPlay?: PropTypes.Validator<any>;
onPlayCapture?: PropTypes.Validator<any>;
onPlaying?: PropTypes.Validator<any>;
onPlayingCapture?: PropTypes.Validator<any>;
onProgress?: PropTypes.Validator<any>;
onProgressCapture?: PropTypes.Validator<any>;
onRateChange?: PropTypes.Validator<any>;
onRateChangeCapture?: PropTypes.Validator<any>;
onSeeked?: PropTypes.Validator<any>;
onSeekedCapture?: PropTypes.Validator<any>;
onSeeking?: PropTypes.Validator<any>;
onSeekingCapture?: PropTypes.Validator<any>;
onStalled?: PropTypes.Validator<any>;
onStalledCapture?: PropTypes.Validator<any>;
onSuspend?: PropTypes.Validator<any>;
onSuspendCapture?: PropTypes.Validator<any>;
onTimeUpdate?: PropTypes.Validator<any>;
onTimeUpdateCapture?: PropTypes.Validator<any>;
onVolumeChange?: PropTypes.Validator<any>;
onVolumeChangeCapture?: PropTypes.Validator<any>;
onWaiting?: PropTypes.Validator<any>;
onWaitingCapture?: PropTypes.Validator<any>;
onClick?: PropTypes.Validator<any>;
onClickCapture?: PropTypes.Validator<any>;
onContextMenu?: PropTypes.Validator<any>;
onContextMenuCapture?: PropTypes.Validator<any>;
onDoubleClick?: PropTypes.Validator<any>;
onDoubleClickCapture?: PropTypes.Validator<any>;
onDrag?: PropTypes.Validator<any>;
onDragCapture?: PropTypes.Validator<any>;
onDragEnd?: PropTypes.Validator<any>;
onDragEndCapture?: PropTypes.Validator<any>;
onDragEnter?: PropTypes.Validator<any>;
onDragEnterCapture?: PropTypes.Validator<any>;
onDragExit?: PropTypes.Validator<any>;
onDragExitCapture?: PropTypes.Validator<any>;
onDragLeave?: PropTypes.Validator<any>;
onDragLeaveCapture?: PropTypes.Validator<any>;
onDragOver?: PropTypes.Validator<any>;
onDragOverCapture?: PropTypes.Validator<any>;
onDragStart?: PropTypes.Validator<any>;
onDragStartCapture?: PropTypes.Validator<any>;
onDrop?: PropTypes.Validator<any>;
onDropCapture?: PropTypes.Validator<any>;
onMouseDown?: PropTypes.Validator<any>;
onMouseDownCapture?: PropTypes.Validator<any>;
onMouseEnter?: PropTypes.Validator<any>;
onMouseLeave?: PropTypes.Validator<any>;
onMouseMove?: PropTypes.Validator<any>;
onMouseMoveCapture?: PropTypes.Validator<any>;
onMouseOut?: PropTypes.Validator<any>;
onMouseOutCapture?: PropTypes.Validator<any>;
onMouseOver?: PropTypes.Validator<any>;
onMouseOverCapture?: PropTypes.Validator<any>;
onMouseUp?: PropTypes.Validator<any>;
onMouseUpCapture?: PropTypes.Validator<any>;
onSelect?: PropTypes.Validator<any>;
onSelectCapture?: PropTypes.Validator<any>;
onTouchCancel?: PropTypes.Validator<any>;
onTouchCancelCapture?: PropTypes.Validator<any>;
onTouchEnd?: PropTypes.Validator<any>;
onTouchEndCapture?: PropTypes.Validator<any>;
onTouchMove?: PropTypes.Validator<any>;
onTouchMoveCapture?: PropTypes.Validator<any>;
onTouchStart?: PropTypes.Validator<any>;
onTouchStartCapture?: PropTypes.Validator<any>;
onScroll?: PropTypes.Validator<any>;
onScrollCapture?: PropTypes.Validator<any>;
onWheel?: PropTypes.Validator<any>;
onWheelCapture?: PropTypes.Validator<any>;
onAnimationStart?: PropTypes.Validator<any>;
onAnimationStartCapture?: PropTypes.Validator<any>;
onAnimationEnd?: PropTypes.Validator<any>;
onAnimationEndCapture?: PropTypes.Validator<any>;
onAnimationIteration?: PropTypes.Validator<any>;
onAnimationIterationCapture?: PropTypes.Validator<any>;
onTransitionEnd?: PropTypes.Validator<any>;
onTransitionEndCapture?: PropTypes.Validator<any>;
ref?: PropTypes.Validator<any>;
key?: PropTypes.Validator<any>;
};

@@ -31,2 +699,3 @@ static readonly containerName: string;

private container;
private overlayStyle;
constructor(props: any);

@@ -33,0 +702,0 @@ getChildContext(): ModalContext;

@@ -1,5 +0,3 @@

/// <reference types="react" />
import * as PropTypes from "prop-types";
export interface ModalProps {
wrapperProps?: React.HTMLProps<HTMLDivElement>;
export interface ModalProps extends React.HTMLProps<HTMLDivElement> {
closeOnOutside?: boolean;

@@ -6,0 +4,0 @@ defaultOpened?: boolean;

{
"name": "react-expand",
"version": "1.0.1",
"version": "1.1.0",
"description": "Simple element expand state controlling",

@@ -5,0 +5,0 @@ "main": "build/index.js",

@@ -32,2 +32,7 @@ # React Expand

<React.Fragment>
<button
onClick={this.context.changeExpandState("custom-expand-string")}
// Highly recommended use data attribute for elements outside controlled element
data-expand="custom-expand-string"
/>
// In this case expand state changing on click button

@@ -54,3 +59,4 @@ // and click on zone without data attribute "custom-expand-string"

```JavaScript
<Modal defaultOpened closeOnOutside wrapperProps={...HTMLDivElementProps}>
<ModalOpenButton modalId="some-id" {...HTMLButtonElementProps}/>
<Modal modalId="some-id" defaultOpened closeOnOutside wrapperProps={...HTMLDivElementProps}>
...

@@ -57,0 +63,0 @@ <ModalCloseButton {...HTMLButtonElementProps}/>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc