@material-ui/unstyled
Advanced tools
Comparing version 5.0.0-alpha.35 to 5.0.0-alpha.37
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
const _excluded = ["classes", "className", "invisible", "component", "components", "componentsProps", "theme"]; | ||
import * as React from 'react'; | ||
@@ -34,3 +35,3 @@ import PropTypes from 'prop-types'; | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, ["classes", "className", "invisible", "component", "components", "componentsProps", "theme"]); | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
@@ -37,0 +38,0 @@ const styleProps = _extends({}, props, { |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
const _excluded = ["anchorOrigin", "classes", "badgeContent", "component", "children", "className", "components", "componentsProps", "invisible", "max", "overlap", "showZero", "variant", "theme"]; | ||
import * as React from 'react'; | ||
@@ -50,3 +51,3 @@ import PropTypes from 'prop-types'; | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, ["anchorOrigin", "classes", "badgeContent", "component", "children", "className", "components", "componentsProps", "invisible", "max", "overlap", "showZero", "variant", "theme"]); | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
@@ -53,0 +54,0 @@ const prevProps = usePreviousProps({ |
@@ -1,2 +0,2 @@ | ||
/** @license Material-UI v5.0.0-alpha.35 | ||
/** @license Material-UI v5.0.0-alpha.37 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -1,2 +0,2 @@ | ||
/** @license Material-UI v5.0.0-alpha.35 | ||
/** @license Material-UI v5.0.0-alpha.37 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -275,3 +275,2 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
disableRestoreFocus: disableRestoreFocus, | ||
getDoc: getDoc, | ||
isEnabled: isTopModal, | ||
@@ -278,0 +277,0 @@ open: open, |
@@ -263,4 +263,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
componentsProps = _props$componentsProp === void 0 ? {} : _props$componentsProp, | ||
theme = props.theme, | ||
other = _objectWithoutProperties(props, ["aria-label", "aria-labelledby", "aria-valuetext", "className", "component", "classes", "defaultValue", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps", "theme"]); | ||
other = _objectWithoutProperties(props, ["aria-label", "aria-labelledby", "aria-valuetext", "className", "component", "classes", "defaultValue", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps"]); | ||
@@ -732,14 +731,11 @@ var touchId = React.useRef(); // We can't use the :active browser pseudo-classes. | ||
as: component, | ||
styleProps: _extends({}, styleProps, rootProps.styleProps), | ||
theme: theme | ||
styleProps: _extends({}, styleProps, rootProps.styleProps) | ||
}, other, { | ||
className: clsx(classes.root, rootProps.className, className), | ||
children: [/*#__PURE__*/_jsx(Rail, _extends({}, railProps, !isHostComponent(Rail) && { | ||
styleProps: _extends({}, styleProps, railProps.styleProps), | ||
theme: theme | ||
styleProps: _extends({}, styleProps, railProps.styleProps) | ||
}, { | ||
className: clsx(classes.rail, railProps.className) | ||
})), /*#__PURE__*/_jsx(Track, _extends({}, trackProps, !isHostComponent(Track) && { | ||
styleProps: _extends({}, styleProps, trackProps.styleProps), | ||
theme: theme | ||
styleProps: _extends({}, styleProps, trackProps.styleProps) | ||
}, { | ||
@@ -765,4 +761,3 @@ className: clsx(classes.track, trackProps.className), | ||
markActive: markActive | ||
}), | ||
theme: theme | ||
}) | ||
}, { | ||
@@ -777,4 +772,3 @@ style: _extends({}, style, markProps.style), | ||
markLabelActive: markActive | ||
}), | ||
theme: theme | ||
}) | ||
}, { | ||
@@ -801,4 +795,3 @@ style: _extends({}, style, markLabelProps.style), | ||
}, !isHostComponent(ValueLabel) && { | ||
styleProps: _extends({}, styleProps, valueLabelProps.styleProps), | ||
theme: theme | ||
styleProps: _extends({}, styleProps, valueLabelProps.styleProps) | ||
}, { | ||
@@ -812,4 +805,3 @@ children: /*#__PURE__*/_jsx(Thumb, _extends({ | ||
}, !isHostComponent(Thumb) && { | ||
styleProps: _extends({}, styleProps, thumbProps.styleProps), | ||
theme: theme | ||
styleProps: _extends({}, styleProps, thumbProps.styleProps) | ||
}, { | ||
@@ -816,0 +808,0 @@ style: _extends({}, style, { |
@@ -89,6 +89,2 @@ /* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */ | ||
function defaultGetDoc() { | ||
return document; | ||
} | ||
function defaultIsEnabled() { | ||
@@ -110,4 +106,2 @@ return true; | ||
disableRestoreFocus = _props$disableRestore === void 0 ? false : _props$disableRestore, | ||
_props$getDoc = props.getDoc, | ||
getDoc = _props$getDoc === void 0 ? defaultGetDoc : _props$getDoc, | ||
_props$getTabbable = props.getTabbable, | ||
@@ -121,3 +115,3 @@ getTabbable = _props$getTabbable === void 0 ? defaultGetTabbable : _props$getTabbable, | ||
var sentinelEnd = React.useRef(null); | ||
var nodeToRestore = React.useRef(); | ||
var nodeToRestore = React.useRef(null); | ||
var reactFocusEventTarget = React.useRef(null); // This variable is useful when disableAutoFocus is true. | ||
@@ -130,20 +124,3 @@ // It waits for the active element to move into the component to activate. | ||
var lastKeydown = React.useRef(null); | ||
var prevOpenRef = React.useRef(); | ||
React.useEffect(function () { | ||
prevOpenRef.current = open; | ||
}, [open]); | ||
if (!prevOpenRef.current && open && typeof window !== 'undefined' && !disableAutoFocus) { | ||
// WARNING: Potentially unsafe in concurrent mode. | ||
// The way the read on `nodeToRestore` is setup could make this actually safe. | ||
// Say we render `open={false}` -> `open={true}` but never commit. | ||
// We have now written a state that wasn't committed. But no committed effect | ||
// will read this wrong value. We only read from `nodeToRestore` in effects | ||
// that were committed on `open={true}` | ||
// WARNING: Prevents the instance from being garbage collected. Should only | ||
// hold a weak ref. | ||
nodeToRestore.current = getDoc().activeElement; | ||
} | ||
React.useEffect(function () { | ||
// We might render an empty child. | ||
@@ -291,3 +268,3 @@ if (!open || !rootRef.current) { | ||
var onFocus = function onFocus(event) { | ||
if (!activated.current) { | ||
if (nodeToRestore.current === null) { | ||
nodeToRestore.current = event.relatedTarget; | ||
@@ -306,3 +283,3 @@ } | ||
var handleFocusSentinel = function handleFocusSentinel(event) { | ||
if (!activated.current) { | ||
if (nodeToRestore.current === null) { | ||
nodeToRestore.current = event.relatedTarget; | ||
@@ -373,11 +350,2 @@ } | ||
/** | ||
* Return the document the trap focus is mounted into. | ||
* Provide the prop if you need the restore focus to work between different documents. | ||
* @default function defaultGetDoc() { | ||
* return document; | ||
* } | ||
*/ | ||
getDoc: PropTypes.func, | ||
/** | ||
* Returns an array of ordered tabbable nodes (i.e. in tab order) within the root. | ||
@@ -384,0 +352,0 @@ * For instance, you can provide the "tabbable" npm dependency. |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
const _excluded = ["BackdropComponent", "BackdropProps", "children", "classes", "className", "closeAfterTransition", "component", "components", "componentsProps", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "theme", "onTransitionEnter", "onTransitionExited"]; | ||
import * as React from 'react'; | ||
@@ -86,3 +87,3 @@ import PropTypes from 'prop-types'; | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, ["BackdropComponent", "BackdropProps", "children", "classes", "className", "closeAfterTransition", "component", "components", "componentsProps", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "theme", "onTransitionEnter", "onTransitionExited"]); | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
@@ -264,3 +265,2 @@ const [exited, setExited] = React.useState(true); | ||
disableRestoreFocus: disableRestoreFocus, | ||
getDoc: getDoc, | ||
isEnabled: isTopModal, | ||
@@ -267,0 +267,0 @@ open: open, |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
const _excluded = ["classes", "className", "invisible", "component", "components", "componentsProps", "theme"]; | ||
import * as React from 'react'; | ||
@@ -34,3 +35,3 @@ import PropTypes from 'prop-types'; | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, ["classes", "className", "invisible", "component", "components", "componentsProps", "theme"]); | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
@@ -37,0 +38,0 @@ const styleProps = _extends({}, props, { |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
const _excluded = ["anchorOrigin", "classes", "badgeContent", "component", "children", "className", "components", "componentsProps", "invisible", "max", "overlap", "showZero", "variant", "theme"]; | ||
import * as React from 'react'; | ||
@@ -50,3 +51,3 @@ import PropTypes from 'prop-types'; | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, ["anchorOrigin", "classes", "badgeContent", "component", "children", "className", "components", "componentsProps", "invisible", "max", "overlap", "showZero", "variant", "theme"]); | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
@@ -53,0 +54,0 @@ const prevProps = usePreviousProps({ |
@@ -1,2 +0,2 @@ | ||
/** @license Material-UI v5.0.0-alpha.35 | ||
/** @license Material-UI v5.0.0-alpha.37 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
const _excluded = ["BackdropComponent", "BackdropProps", "children", "classes", "className", "closeAfterTransition", "component", "components", "componentsProps", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "theme", "onTransitionEnter", "onTransitionExited"]; | ||
import * as React from 'react'; | ||
@@ -86,3 +87,3 @@ import PropTypes from 'prop-types'; | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, ["BackdropComponent", "BackdropProps", "children", "classes", "className", "closeAfterTransition", "component", "components", "componentsProps", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "theme", "onTransitionEnter", "onTransitionExited"]); | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
@@ -264,3 +265,2 @@ const [exited, setExited] = React.useState(true); | ||
disableRestoreFocus: disableRestoreFocus, | ||
getDoc: getDoc, | ||
isEnabled: isTopModal, | ||
@@ -267,0 +267,0 @@ open: open, |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
const _excluded = ["aria-label", "aria-labelledby", "aria-valuetext", "className", "component", "classes", "defaultValue", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps"]; | ||
import * as React from 'react'; | ||
@@ -234,8 +235,5 @@ import PropTypes from 'prop-types'; | ||
components = {}, | ||
componentsProps = {}, | ||
/* eslint-disable-next-line react/prop-types */ | ||
theme | ||
componentsProps = {} | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, ["aria-label", "aria-labelledby", "aria-valuetext", "className", "component", "classes", "defaultValue", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps", "theme"]); | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
@@ -679,14 +677,11 @@ const touchId = React.useRef(); // We can't use the :active browser pseudo-classes. | ||
as: component, | ||
styleProps: _extends({}, styleProps, rootProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, rootProps.styleProps) | ||
}, other, { | ||
className: clsx(classes.root, rootProps.className, className), | ||
children: [/*#__PURE__*/_jsx(Rail, _extends({}, railProps, !isHostComponent(Rail) && { | ||
styleProps: _extends({}, styleProps, railProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, railProps.styleProps) | ||
}, { | ||
className: clsx(classes.rail, railProps.className) | ||
})), /*#__PURE__*/_jsx(Track, _extends({}, trackProps, !isHostComponent(Track) && { | ||
styleProps: _extends({}, styleProps, trackProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, trackProps.styleProps) | ||
}, { | ||
@@ -712,4 +707,3 @@ className: clsx(classes.track, trackProps.className), | ||
markActive | ||
}), | ||
theme | ||
}) | ||
}, { | ||
@@ -724,4 +718,3 @@ style: _extends({}, style, markProps.style), | ||
markLabelActive: markActive | ||
}), | ||
theme | ||
}) | ||
}, { | ||
@@ -748,4 +741,3 @@ style: _extends({}, style, markLabelProps.style), | ||
}, !isHostComponent(ValueLabel) && { | ||
styleProps: _extends({}, styleProps, valueLabelProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, valueLabelProps.styleProps) | ||
}, { | ||
@@ -759,4 +751,3 @@ children: /*#__PURE__*/_jsx(Thumb, _extends({ | ||
}, !isHostComponent(Thumb) && { | ||
styleProps: _extends({}, styleProps, thumbProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, thumbProps.styleProps) | ||
}, { | ||
@@ -763,0 +754,0 @@ style: _extends({}, style, { |
@@ -83,6 +83,2 @@ /* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */ | ||
function defaultGetDoc() { | ||
return document; | ||
} | ||
function defaultIsEnabled() { | ||
@@ -102,3 +98,2 @@ return true; | ||
disableRestoreFocus = false, | ||
getDoc = defaultGetDoc, | ||
getTabbable = defaultGetTabbable, | ||
@@ -111,3 +106,3 @@ isEnabled = defaultIsEnabled, | ||
const sentinelEnd = React.useRef(null); | ||
const nodeToRestore = React.useRef(); | ||
const nodeToRestore = React.useRef(null); | ||
const reactFocusEventTarget = React.useRef(null); // This variable is useful when disableAutoFocus is true. | ||
@@ -120,20 +115,3 @@ // It waits for the active element to move into the component to activate. | ||
const lastKeydown = React.useRef(null); | ||
const prevOpenRef = React.useRef(); | ||
React.useEffect(() => { | ||
prevOpenRef.current = open; | ||
}, [open]); | ||
if (!prevOpenRef.current && open && typeof window !== 'undefined' && !disableAutoFocus) { | ||
// WARNING: Potentially unsafe in concurrent mode. | ||
// The way the read on `nodeToRestore` is setup could make this actually safe. | ||
// Say we render `open={false}` -> `open={true}` but never commit. | ||
// We have now written a state that wasn't committed. But no committed effect | ||
// will read this wrong value. We only read from `nodeToRestore` in effects | ||
// that were committed on `open={true}` | ||
// WARNING: Prevents the instance from being garbage collected. Should only | ||
// hold a weak ref. | ||
nodeToRestore.current = getDoc().activeElement; | ||
} | ||
React.useEffect(() => { | ||
// We might render an empty child. | ||
@@ -281,3 +259,3 @@ if (!open || !rootRef.current) { | ||
const onFocus = event => { | ||
if (!activated.current) { | ||
if (nodeToRestore.current === null) { | ||
nodeToRestore.current = event.relatedTarget; | ||
@@ -296,3 +274,3 @@ } | ||
const handleFocusSentinel = event => { | ||
if (!activated.current) { | ||
if (nodeToRestore.current === null) { | ||
nodeToRestore.current = event.relatedTarget; | ||
@@ -363,11 +341,2 @@ } | ||
/** | ||
* Return the document the trap focus is mounted into. | ||
* Provide the prop if you need the restore focus to work between different documents. | ||
* @default function defaultGetDoc() { | ||
* return document; | ||
* } | ||
*/ | ||
getDoc: PropTypes.func, | ||
/** | ||
* Returns an array of ordered tabbable nodes (i.e. in tab order) within the root. | ||
@@ -374,0 +343,0 @@ * For instance, you can provide the "tabbable" npm dependency. |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -30,2 +28,8 @@ | ||
const _excluded = ["classes", "className", "invisible", "component", "components", "componentsProps", "theme"]; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const useUtilityClasses = styleProps => { | ||
@@ -54,3 +58,3 @@ const { | ||
} = props, | ||
other = (0, _objectWithoutPropertiesLoose2.default)(props, ["classes", "className", "invisible", "component", "components", "componentsProps", "theme"]); | ||
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded); | ||
const styleProps = (0, _extends2.default)({}, props, { | ||
@@ -57,0 +61,0 @@ classes: classesProp, |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -31,2 +29,6 @@ | ||
var _backdropUnstyledClasses = _interopRequireWildcard(require("./backdropUnstyledClasses")); | ||
var _backdropUnstyledClasses = _interopRequireWildcard(require("./backdropUnstyledClasses")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -32,2 +30,8 @@ | ||
const _excluded = ["anchorOrigin", "classes", "badgeContent", "component", "children", "className", "components", "componentsProps", "invisible", "max", "overlap", "showZero", "variant", "theme"]; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const useUtilityClasses = styleProps => { | ||
@@ -70,3 +74,3 @@ const { | ||
} = props, | ||
other = (0, _objectWithoutPropertiesLoose2.default)(props, ["anchorOrigin", "classes", "badgeContent", "component", "children", "className", "components", "componentsProps", "invisible", "max", "overlap", "showZero", "variant", "theme"]); | ||
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded); | ||
const prevProps = (0, _utils.usePreviousProps)({ | ||
@@ -73,0 +77,0 @@ anchorOrigin: anchorOriginProp, |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -31,2 +29,6 @@ | ||
var _badgeUnstyledClasses = _interopRequireWildcard(require("./badgeUnstyledClasses")); | ||
var _badgeUnstyledClasses = _interopRequireWildcard(require("./badgeUnstyledClasses")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } |
@@ -1,2 +0,2 @@ | ||
/** @license Material-UI v5.0.0-alpha.35 | ||
/** @license Material-UI v5.0.0-alpha.37 | ||
* | ||
@@ -10,4 +10,2 @@ * This source code is licensed under the MIT license found in the | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -160,2 +158,6 @@ value: true | ||
}); | ||
}); | ||
}); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -39,2 +37,6 @@ | ||
var _modalUnstyledClasses = _interopRequireWildcard(require("./modalUnstyledClasses")); | ||
var _modalUnstyledClasses = _interopRequireWildcard(require("./modalUnstyledClasses")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -38,2 +36,8 @@ | ||
const _excluded = ["BackdropComponent", "BackdropProps", "children", "classes", "className", "closeAfterTransition", "component", "components", "componentsProps", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "theme", "onTransitionEnter", "onTransitionExited"]; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const useUtilityClasses = styleProps => { | ||
@@ -109,3 +113,3 @@ const { | ||
} = props, | ||
other = (0, _objectWithoutPropertiesLoose2.default)(props, ["BackdropComponent", "BackdropProps", "children", "classes", "className", "closeAfterTransition", "component", "components", "componentsProps", "container", "disableAutoFocus", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onKeyDown", "open", "theme", "onTransitionEnter", "onTransitionExited"]); | ||
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded); | ||
const [exited, setExited] = React.useState(true); | ||
@@ -284,3 +288,2 @@ const modal = React.useRef({}); | ||
disableRestoreFocus: disableRestoreFocus, | ||
getDoc: getDoc, | ||
isEnabled: isTopModal, | ||
@@ -287,0 +290,0 @@ open: open, |
@@ -5,4 +5,2 @@ "use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -21,2 +19,6 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function getContainer(container) { | ||
@@ -23,0 +25,0 @@ return typeof container === 'function' ? container() : container; |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -49,2 +47,6 @@ | ||
}); | ||
}); | ||
}); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } |
"use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
@@ -34,2 +32,8 @@ | ||
const _excluded = ["aria-label", "aria-labelledby", "aria-valuetext", "className", "component", "classes", "defaultValue", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps"]; | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const INTENTIONAL_DRAG_COUNT_THRESHOLD = 2; | ||
@@ -256,8 +260,5 @@ | ||
components = {}, | ||
componentsProps = {}, | ||
/* eslint-disable-next-line react/prop-types */ | ||
theme | ||
componentsProps = {} | ||
} = props, | ||
other = (0, _objectWithoutPropertiesLoose2.default)(props, ["aria-label", "aria-labelledby", "aria-valuetext", "className", "component", "classes", "defaultValue", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps", "theme"]); | ||
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded); | ||
const touchId = React.useRef(); // We can't use the :active browser pseudo-classes. | ||
@@ -697,14 +698,11 @@ // - The active state isn't triggered when clicking on the rail. | ||
as: component, | ||
styleProps: (0, _extends2.default)({}, styleProps, rootProps.styleProps), | ||
theme | ||
styleProps: (0, _extends2.default)({}, styleProps, rootProps.styleProps) | ||
}, other, { | ||
className: (0, _clsx.default)(classes.root, rootProps.className, className), | ||
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Rail, (0, _extends2.default)({}, railProps, !(0, _isHostComponent.default)(Rail) && { | ||
styleProps: (0, _extends2.default)({}, styleProps, railProps.styleProps), | ||
theme | ||
styleProps: (0, _extends2.default)({}, styleProps, railProps.styleProps) | ||
}, { | ||
className: (0, _clsx.default)(classes.rail, railProps.className) | ||
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(Track, (0, _extends2.default)({}, trackProps, !(0, _isHostComponent.default)(Track) && { | ||
styleProps: (0, _extends2.default)({}, styleProps, trackProps.styleProps), | ||
theme | ||
styleProps: (0, _extends2.default)({}, styleProps, trackProps.styleProps) | ||
}, { | ||
@@ -730,4 +728,3 @@ className: (0, _clsx.default)(classes.track, trackProps.className), | ||
markActive | ||
}), | ||
theme | ||
}) | ||
}, { | ||
@@ -742,4 +739,3 @@ style: (0, _extends2.default)({}, style, markProps.style), | ||
markLabelActive: markActive | ||
}), | ||
theme | ||
}) | ||
}, { | ||
@@ -766,4 +762,3 @@ style: (0, _extends2.default)({}, style, markLabelProps.style), | ||
}, !(0, _isHostComponent.default)(ValueLabel) && { | ||
styleProps: (0, _extends2.default)({}, styleProps, valueLabelProps.styleProps), | ||
theme | ||
styleProps: (0, _extends2.default)({}, styleProps, valueLabelProps.styleProps) | ||
}, { | ||
@@ -777,4 +772,3 @@ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Thumb, (0, _extends2.default)({ | ||
}, !(0, _isHostComponent.default)(Thumb) && { | ||
styleProps: (0, _extends2.default)({}, styleProps, thumbProps.styleProps), | ||
theme | ||
styleProps: (0, _extends2.default)({}, styleProps, thumbProps.styleProps) | ||
}, { | ||
@@ -781,0 +775,0 @@ style: (0, _extends2.default)({}, style, { |
@@ -5,4 +5,2 @@ "use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -23,2 +21,6 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
const useValueLabelClasses = props => { | ||
@@ -25,0 +27,0 @@ const { |
@@ -5,4 +5,2 @@ "use strict"; | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -21,2 +19,6 @@ value: true | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
/* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */ | ||
@@ -99,6 +101,2 @@ // Inspired by https://github.com/focus-trap/tabbable | ||
function defaultGetDoc() { | ||
return document; | ||
} | ||
function defaultIsEnabled() { | ||
@@ -118,3 +116,2 @@ return true; | ||
disableRestoreFocus = false, | ||
getDoc = defaultGetDoc, | ||
getTabbable = defaultGetTabbable, | ||
@@ -127,3 +124,3 @@ isEnabled = defaultIsEnabled, | ||
const sentinelEnd = React.useRef(null); | ||
const nodeToRestore = React.useRef(); | ||
const nodeToRestore = React.useRef(null); | ||
const reactFocusEventTarget = React.useRef(null); // This variable is useful when disableAutoFocus is true. | ||
@@ -136,20 +133,3 @@ // It waits for the active element to move into the component to activate. | ||
const lastKeydown = React.useRef(null); | ||
const prevOpenRef = React.useRef(); | ||
React.useEffect(() => { | ||
prevOpenRef.current = open; | ||
}, [open]); | ||
if (!prevOpenRef.current && open && typeof window !== 'undefined' && !disableAutoFocus) { | ||
// WARNING: Potentially unsafe in concurrent mode. | ||
// The way the read on `nodeToRestore` is setup could make this actually safe. | ||
// Say we render `open={false}` -> `open={true}` but never commit. | ||
// We have now written a state that wasn't committed. But no committed effect | ||
// will read this wrong value. We only read from `nodeToRestore` in effects | ||
// that were committed on `open={true}` | ||
// WARNING: Prevents the instance from being garbage collected. Should only | ||
// hold a weak ref. | ||
nodeToRestore.current = getDoc().activeElement; | ||
} | ||
React.useEffect(() => { | ||
// We might render an empty child. | ||
@@ -299,3 +279,3 @@ if (!open || !rootRef.current) { | ||
const onFocus = event => { | ||
if (!activated.current) { | ||
if (nodeToRestore.current === null) { | ||
nodeToRestore.current = event.relatedTarget; | ||
@@ -314,3 +294,3 @@ } | ||
const handleFocusSentinel = event => { | ||
if (!activated.current) { | ||
if (nodeToRestore.current === null) { | ||
nodeToRestore.current = event.relatedTarget; | ||
@@ -381,11 +361,2 @@ } | ||
/** | ||
* Return the document the trap focus is mounted into. | ||
* Provide the prop if you need the restore focus to work between different documents. | ||
* @default function defaultGetDoc() { | ||
* return document; | ||
* } | ||
*/ | ||
getDoc: _propTypes.default.func, | ||
/** | ||
* Returns an array of ordered tabbable nodes (i.e. in tab order) within the root. | ||
@@ -392,0 +363,0 @@ * For instance, you can provide the "tabbable" npm dependency. |
{ | ||
"name": "@material-ui/unstyled", | ||
"version": "5.0.0-alpha.35", | ||
"version": "5.0.0-alpha.37", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "author": "Material-UI Team", |
import { OverridableComponent, OverridableTypeMap, OverrideProps } from '@material-ui/types'; | ||
import { SliderUnstyledClasses } from './sliderUnstyledClasses'; | ||
export interface SliderStylePropsOverrides {} | ||
export interface Mark { | ||
@@ -54,16 +56,20 @@ value: number; | ||
root?: { | ||
as: React.ElementType; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'>; | ||
as?: React.ElementType; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'> & | ||
SliderStylePropsOverrides; | ||
}; | ||
track?: { | ||
as?: React.ElementType; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'>; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'> & | ||
SliderStylePropsOverrides; | ||
}; | ||
rail?: { | ||
as?: React.ElementType; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'>; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'> & | ||
SliderStylePropsOverrides; | ||
}; | ||
thumb?: { | ||
as?: React.ElementType; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'>; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'> & | ||
SliderStylePropsOverrides; | ||
}; | ||
@@ -75,3 +81,3 @@ mark?: { | ||
'components' | 'componentsProps' | ||
> & { markActive?: boolean }; | ||
> & { markActive?: boolean } & SliderStylePropsOverrides; | ||
}; | ||
@@ -83,7 +89,8 @@ markLabel?: { | ||
'components' | 'componentsProps' | ||
> & { markLabelActive?: boolean }; | ||
> & { markLabelActive?: boolean } & SliderStylePropsOverrides; | ||
}; | ||
valueLabel?: { | ||
as?: React.ElementType; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'>; | ||
styleProps?: Omit<SliderUnstyledTypeMap<P, D>['props'], 'components' | 'componentsProps'> & | ||
SliderStylePropsOverrides; | ||
}; | ||
@@ -90,0 +97,0 @@ }; |
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; | ||
const _excluded = ["aria-label", "aria-labelledby", "aria-valuetext", "className", "component", "classes", "defaultValue", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps"]; | ||
import * as React from 'react'; | ||
@@ -234,8 +235,5 @@ import PropTypes from 'prop-types'; | ||
components = {}, | ||
componentsProps = {}, | ||
/* eslint-disable-next-line react/prop-types */ | ||
theme | ||
componentsProps = {} | ||
} = props, | ||
other = _objectWithoutPropertiesLoose(props, ["aria-label", "aria-labelledby", "aria-valuetext", "className", "component", "classes", "defaultValue", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "onMouseDown", "orientation", "scale", "step", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat", "isRtl", "components", "componentsProps", "theme"]); | ||
other = _objectWithoutPropertiesLoose(props, _excluded); | ||
@@ -679,14 +677,11 @@ const touchId = React.useRef(); // We can't use the :active browser pseudo-classes. | ||
as: component, | ||
styleProps: _extends({}, styleProps, rootProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, rootProps.styleProps) | ||
}, other, { | ||
className: clsx(classes.root, rootProps.className, className), | ||
children: [/*#__PURE__*/_jsx(Rail, _extends({}, railProps, !isHostComponent(Rail) && { | ||
styleProps: _extends({}, styleProps, railProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, railProps.styleProps) | ||
}, { | ||
className: clsx(classes.rail, railProps.className) | ||
})), /*#__PURE__*/_jsx(Track, _extends({}, trackProps, !isHostComponent(Track) && { | ||
styleProps: _extends({}, styleProps, trackProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, trackProps.styleProps) | ||
}, { | ||
@@ -712,4 +707,3 @@ className: clsx(classes.track, trackProps.className), | ||
markActive | ||
}), | ||
theme | ||
}) | ||
}, { | ||
@@ -724,4 +718,3 @@ style: _extends({}, style, markProps.style), | ||
markLabelActive: markActive | ||
}), | ||
theme | ||
}) | ||
}, { | ||
@@ -748,4 +741,3 @@ style: _extends({}, style, markLabelProps.style), | ||
}, !isHostComponent(ValueLabel) && { | ||
styleProps: _extends({}, styleProps, valueLabelProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, valueLabelProps.styleProps) | ||
}, { | ||
@@ -759,4 +751,3 @@ children: /*#__PURE__*/_jsx(Thumb, _extends({ | ||
}, !isHostComponent(Thumb) && { | ||
styleProps: _extends({}, styleProps, thumbProps.styleProps), | ||
theme | ||
styleProps: _extends({}, styleProps, thumbProps.styleProps) | ||
}, { | ||
@@ -763,0 +754,0 @@ style: _extends({}, style, { |
@@ -10,10 +10,2 @@ /* eslint-disable @typescript-eslint/naming-convention */ | ||
/** | ||
* Return the document the trap focus is mounted into. | ||
* Provide the prop if you need the restore focus to work between different documents. | ||
* @default function defaultGetDoc() { | ||
* return document; | ||
* } | ||
*/ | ||
getDoc?: () => Document; | ||
/** | ||
* Returns an array of ordered tabbable nodes (i.e. in tab order) within the root. | ||
@@ -20,0 +12,0 @@ * For instance, you can provide the "tabbable" npm dependency. |
@@ -83,6 +83,2 @@ /* eslint-disable @typescript-eslint/naming-convention, consistent-return, jsx-a11y/no-noninteractive-tabindex */ | ||
function defaultGetDoc() { | ||
return document; | ||
} | ||
function defaultIsEnabled() { | ||
@@ -102,3 +98,2 @@ return true; | ||
disableRestoreFocus = false, | ||
getDoc = defaultGetDoc, | ||
getTabbable = defaultGetTabbable, | ||
@@ -111,3 +106,3 @@ isEnabled = defaultIsEnabled, | ||
const sentinelEnd = React.useRef(null); | ||
const nodeToRestore = React.useRef(); | ||
const nodeToRestore = React.useRef(null); | ||
const reactFocusEventTarget = React.useRef(null); // This variable is useful when disableAutoFocus is true. | ||
@@ -120,20 +115,3 @@ // It waits for the active element to move into the component to activate. | ||
const lastKeydown = React.useRef(null); | ||
const prevOpenRef = React.useRef(); | ||
React.useEffect(() => { | ||
prevOpenRef.current = open; | ||
}, [open]); | ||
if (!prevOpenRef.current && open && typeof window !== 'undefined' && !disableAutoFocus) { | ||
// WARNING: Potentially unsafe in concurrent mode. | ||
// The way the read on `nodeToRestore` is setup could make this actually safe. | ||
// Say we render `open={false}` -> `open={true}` but never commit. | ||
// We have now written a state that wasn't committed. But no committed effect | ||
// will read this wrong value. We only read from `nodeToRestore` in effects | ||
// that were committed on `open={true}` | ||
// WARNING: Prevents the instance from being garbage collected. Should only | ||
// hold a weak ref. | ||
nodeToRestore.current = getDoc().activeElement; | ||
} | ||
React.useEffect(() => { | ||
// We might render an empty child. | ||
@@ -283,3 +261,3 @@ if (!open || !rootRef.current) { | ||
const onFocus = event => { | ||
if (!activated.current) { | ||
if (nodeToRestore.current === null) { | ||
nodeToRestore.current = event.relatedTarget; | ||
@@ -298,3 +276,3 @@ } | ||
const handleFocusSentinel = event => { | ||
if (!activated.current) { | ||
if (nodeToRestore.current === null) { | ||
nodeToRestore.current = event.relatedTarget; | ||
@@ -365,11 +343,2 @@ } | ||
/** | ||
* Return the document the trap focus is mounted into. | ||
* Provide the prop if you need the restore focus to work between different documents. | ||
* @default function defaultGetDoc() { | ||
* return document; | ||
* } | ||
*/ | ||
getDoc: PropTypes.func, | ||
/** | ||
* Returns an array of ordered tabbable nodes (i.e. in tab order) within the root. | ||
@@ -376,0 +345,0 @@ * For instance, you can provide the "tabbable" npm dependency. |
Sorry, the diff of this file is too big to display
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
1203114
10354