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

@fluentui/react-utilities

Package Overview
Dependencies
Maintainers
12
Versions
853
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluentui/react-utilities - npm Package Compare versions

Comparing version 0.0.0-nightlya372ad979820211103.1 to 0.0.0-nightlybc5ff01fb020211104.1

18

CHANGELOG.json

@@ -5,5 +5,5 @@ {

{
"date": "Wed, 03 Nov 2021 08:24:07 GMT",
"tag": "@fluentui/react-utilities_v0.0.0-nightlya372ad979820211103.1",
"version": "0.0.0-nightlya372ad979820211103.1",
"date": "Thu, 04 Nov 2021 04:20:37 GMT",
"tag": "@fluentui/react-utilities_v0.0.0-nightlybc5ff01fb020211104.1",
"version": "0.0.0-nightlybc5ff01fb020211104.1",
"comments": {

@@ -14,10 +14,16 @@ "prerelease": [

"package": "@fluentui/react-utilities",
"commit": "ff9c0a60767a2dbd1afdc71659a5daee5f2068dd",
"commit": "112d5b8815c25532184ed7c1407ba9a777e2f48d",
"comment": "Release nightly v9"
},
{
"author": "gcox@microsoft.com",
"package": "@fluentui/react-utilities",
"commit": "c9bd5b5a02ae94a8239ce1b56cac2f0d0dbd3586",
"comment": "Updated beta and RC components to ES2019"
},
{
"author": "beachball",
"package": "@fluentui/react-utilities",
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightlya372ad979820211103.1",
"commit": "ff9c0a60767a2dbd1afdc71659a5daee5f2068dd"
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightlybc5ff01fb020211104.1",
"commit": "112d5b8815c25532184ed7c1407ba9a777e2f48d"
}

@@ -24,0 +30,0 @@ ]

# Change Log - @fluentui/react-utilities
This log was last generated on Wed, 03 Nov 2021 08:24:07 GMT and should not be manually modified.
This log was last generated on Thu, 04 Nov 2021 04:20:37 GMT and should not be manually modified.
<!-- Start content -->
## [0.0.0-nightlya372ad979820211103.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v0.0.0-nightlya372ad979820211103.1)
## [0.0.0-nightlybc5ff01fb020211104.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v0.0.0-nightlybc5ff01fb020211104.1)
Wed, 03 Nov 2021 08:24:07 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-beta.2..@fluentui/react-utilities_v0.0.0-nightlya372ad979820211103.1)
Thu, 04 Nov 2021 04:20:37 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-beta.2..@fluentui/react-utilities_v0.0.0-nightlybc5ff01fb020211104.1)
### Changes
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/ff9c0a60767a2dbd1afdc71659a5daee5f2068dd) by email not defined)
- Bump @fluentui/keyboard-keys to v0.0.0-nightlya372ad979820211103.1 ([commit](https://github.com/microsoft/fluentui/commit/ff9c0a60767a2dbd1afdc71659a5daee5f2068dd) by beachball)
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/112d5b8815c25532184ed7c1407ba9a777e2f48d) by email not defined)
- Updated beta and RC components to ES2019 ([PR #20405](https://github.com/microsoft/fluentui/pull/20405) by gcox@microsoft.com)
- Bump @fluentui/keyboard-keys to v0.0.0-nightlybc5ff01fb020211104.1 ([commit](https://github.com/microsoft/fluentui/commit/112d5b8815c25532184ed7c1407ba9a777e2f48d) by beachball)

@@ -17,0 +18,0 @@ ## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-beta.2)

@@ -8,9 +8,7 @@ "use strict";

var tslib_1 = /*#__PURE__*/require("tslib");
const React = /*#__PURE__*/require("react");
var React = /*#__PURE__*/require("react");
const nullRender_1 = /*#__PURE__*/require("./nullRender");
var nullRender_1 = /*#__PURE__*/require("./nullRender");
var omit_1 = /*#__PURE__*/require("../utils/omit");
const omit_1 = /*#__PURE__*/require("../utils/omit");
/**

@@ -34,17 +32,8 @@ * Given the state and an array of slot names, will break out `slots` and `slotProps`

function getSlots(state, slotNames) {
if (slotNames === void 0) {
slotNames = ['root'];
}
function getSlots(state, slotNames = ['root']) {
const slots = {};
const slotProps = {};
var slots = {};
var slotProps = {};
for (var _i = 0, slotNames_1 = slotNames; _i < slotNames_1.length; _i++) {
var slotName = slotNames_1[_i];
var _a = getSlot(state, slotName),
slot = _a[0],
props = _a[1];
for (const slotName of slotNames) {
const [slot, props] = getSlot(state, slotName);
slots[slotName] = slot;

@@ -55,3 +44,3 @@ slotProps[slotName] = props;

return {
slots: slots,
slots,
slotProps: slotProps

@@ -70,11 +59,11 @@ };

var _d = state[slotName],
children = _d.children,
asProp = _d.as,
rest = tslib_1.__rest(_d, ["children", "as"]);
const {
children,
as: asProp,
...rest
} = state[slotName];
const slot = ((_a = state.components) === null || _a === void 0 ? void 0 : _a[slotName]) === undefined || typeof state.components[slotName] === 'string' ? asProp || ((_b = state.components) === null || _b === void 0 ? void 0 : _b[slotName]) || 'div' : state.components[slotName];
var slot = ((_a = state.components) === null || _a === void 0 ? void 0 : _a[slotName]) === undefined || typeof state.components[slotName] === 'string' ? asProp || ((_b = state.components) === null || _b === void 0 ? void 0 : _b[slotName]) || 'div' : state.components[slotName];
if (typeof children === 'function') {
var render = children;
const render = children;
return [React.Fragment, {

@@ -85,6 +74,6 @@ children: render(slot, rest)

var shouldOmitAsProp = typeof slot === 'string' && ((_c = state[slotName]) === null || _c === void 0 ? void 0 : _c.as);
var slotProps = shouldOmitAsProp ? omit_1.omit(state[slotName], ['as']) : state[slotName];
const shouldOmitAsProp = typeof slot === 'string' && ((_c = state[slotName]) === null || _c === void 0 ? void 0 : _c.as);
const slotProps = shouldOmitAsProp ? omit_1.omit(state[slotName], ['as']) : state[slotName];
return [slot, slotProps];
}
//# sourceMappingURL=getSlots.js.map

@@ -7,3 +7,3 @@ "use strict";

var tslib_1 = /*#__PURE__*/require("tslib");
const tslib_1 = /*#__PURE__*/require("tslib");

@@ -10,0 +10,0 @@ tslib_1.__exportStar(require("./getSlots"), exports);

@@ -11,7 +11,5 @@ "use strict";

var nullRender = function () {
return null;
};
const nullRender = () => null;
exports.nullRender = nullRender;
//# sourceMappingURL=nullRender.js.map

@@ -8,5 +8,3 @@ "use strict";

var tslib_1 = /*#__PURE__*/require("tslib");
var react_1 = /*#__PURE__*/require("react");
const react_1 = /*#__PURE__*/require("react");
/**

@@ -21,6 +19,6 @@ * Resolves ShorthandProps into ObjectShorthandProps, to ensure normalization of the signature

function resolveShorthand(value, options) {
var _a = options || {},
_b = _a.required,
required = _b === void 0 ? false : _b,
defaultProps = _a.defaultProps;
const {
required = false,
defaultProps
} = options || {};

@@ -31,3 +29,3 @@ if (value === null || value === undefined && !required) {

var resolvedShorthand = {};
let resolvedShorthand = {};

@@ -40,3 +38,5 @@ if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || react_1.isValidElement(value)) {

return defaultProps ? tslib_1.__assign(tslib_1.__assign({}, defaultProps), resolvedShorthand) : resolvedShorthand;
return defaultProps ? { ...defaultProps,
...resolvedShorthand
} : resolvedShorthand;
}

@@ -43,0 +43,0 @@

@@ -7,3 +7,3 @@ "use strict";

var tslib_1 = /*#__PURE__*/require("tslib");
const tslib_1 = /*#__PURE__*/require("tslib");

@@ -10,0 +10,0 @@ tslib_1.__exportStar(require("./useControllableState"), exports);

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var useConst_1 = /*#__PURE__*/require("./useConst");
const useConst_1 = /*#__PURE__*/require("./useConst");
/**

@@ -22,27 +22,16 @@ * Hook to store a value and generate callbacks for setting the value to true or false.

function useBoolean(initialState) {
var _a = React.useState(initialState),
value = _a[0],
setValue = _a[1];
var setTrue = useConst_1.useConst(function () {
return function () {
setValue(true);
};
const [value, setValue] = React.useState(initialState);
const setTrue = useConst_1.useConst(() => () => {
setValue(true);
});
var setFalse = useConst_1.useConst(function () {
return function () {
setValue(false);
};
const setFalse = useConst_1.useConst(() => () => {
setValue(false);
});
var toggle = useConst_1.useConst(function () {
return function () {
setValue(function (currentValue) {
return !currentValue;
});
};
const toggle = useConst_1.useConst(() => () => {
setValue(currentValue => !currentValue);
});
return [value, {
setTrue: setTrue,
setFalse: setFalse,
toggle: toggle
setTrue,
setFalse,
toggle
}];

@@ -49,0 +38,0 @@ }

@@ -8,3 +8,3 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
/**

@@ -27,3 +27,3 @@ * Hook to initialize and return a constant value. Unlike `React.useMemo`, this is guaranteed to

// internally due to reducer handling which we don't need)
var ref = React.useRef();
const ref = React.useRef();

@@ -30,0 +30,0 @@ if (ref.current === undefined) {

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var useConst_1 = /*#__PURE__*/require("./useConst");
const useConst_1 = /*#__PURE__*/require("./useConst");

@@ -27,13 +27,9 @@ function isUndefined(state) {

var useControllableState = function (options) {
var isControlled = useIsControlled(options.state);
var initialState = isUndefined(options.defaultState) ? options.initialState : options.defaultState;
var _a = React.useState(initialState),
internalState = _a[0],
setInternalState = _a[1];
var state = isControlled ? options.state : internalState;
var stateRef = React.useRef(state);
React.useEffect(function () {
const useControllableState = options => {
const isControlled = useIsControlled(options.state);
const initialState = isUndefined(options.defaultState) ? options.initialState : options.defaultState;
const [internalState, setInternalState] = React.useState(initialState);
const state = isControlled ? options.state : internalState;
const stateRef = React.useRef(state);
React.useEffect(() => {
stateRef.current = state;

@@ -43,3 +39,3 @@ }, [state]); // To match the behavior of the setter returned by React.useState, this callback's identity

var setState = React.useCallback(function (newState) {
const setState = React.useCallback(newState => {
// React dispatch can use a factory

@@ -65,4 +61,4 @@ // https://reactjs.org/docs/hooks-reference.html#functional-updates

var useIsControlled = function (controlledValue) {
var isControlled = useConst_1.useConst(controlledValue !== undefined);
const useIsControlled = controlledValue => {
const isControlled = useConst_1.useConst(controlledValue !== undefined);

@@ -72,7 +68,7 @@ if (process.env.NODE_ENV !== 'production') {

// eslint-disable-next-line react-hooks/rules-of-hooks
React.useEffect(function () {
React.useEffect(() => {
if (isControlled !== (controlledValue !== undefined)) {
var error = new Error();
var controlWarning = isControlled ? 'a controlled value to be uncontrolled' : 'an uncontrolled value to be controlled';
var undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined'; // eslint-disable-next-line no-console
const error = new Error();
const controlWarning = isControlled ? 'a controlled value to be uncontrolled' : 'an uncontrolled value to be controlled';
const undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined'; // eslint-disable-next-line no-console

@@ -79,0 +75,0 @@ console.error([// Default react error

@@ -8,18 +8,15 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var useConst_1 = /*#__PURE__*/require("./useConst");
const useConst_1 = /*#__PURE__*/require("./useConst");
function useControllableValue(controlledValue, defaultUncontrolledValue, onChange) {
var _a = React.useState(defaultUncontrolledValue),
value = _a[0],
setValue = _a[1];
var isControlled = useIsControlled(controlledValue);
var currentValue = isControlled ? controlledValue : value; // Duplicate the current value and onChange in refs so they're accessible from
const [value, setValue] = React.useState(defaultUncontrolledValue);
const isControlled = useIsControlled(controlledValue);
const currentValue = isControlled ? controlledValue : value; // Duplicate the current value and onChange in refs so they're accessible from
// setValueOrCallOnChange without creating a new callback every time
var valueRef = React.useRef(currentValue);
var onChangeRef = React.useRef(onChange);
React.useEffect(function () {
const valueRef = React.useRef(currentValue);
const onChangeRef = React.useRef(onChange);
React.useEffect(() => {
valueRef.current = currentValue;

@@ -30,16 +27,14 @@ onChangeRef.current = onChange;

var setValueOrCallOnChange = useConst_1.useConst(function () {
return function (update, ev) {
// Assuming here that TValue is not a function, because a controllable value will typically
// be something a user can enter as input
var newValue = typeof update === 'function' ? update(valueRef.current) : update;
const setValueOrCallOnChange = useConst_1.useConst(() => (update, ev) => {
// Assuming here that TValue is not a function, because a controllable value will typically
// be something a user can enter as input
const newValue = typeof update === 'function' ? update(valueRef.current) : update;
if (onChangeRef.current) {
onChangeRef.current(ev, newValue);
}
if (onChangeRef.current) {
onChangeRef.current(ev, newValue);
}
if (!isControlled) {
setValue(newValue);
}
};
if (!isControlled) {
setValue(newValue);
}
});

@@ -55,4 +50,4 @@ return [currentValue, setValueOrCallOnChange];

var useIsControlled = function (controlledValue) {
var isControlled = useConst_1.useConst(controlledValue !== undefined);
const useIsControlled = controlledValue => {
const isControlled = useConst_1.useConst(controlledValue !== undefined);

@@ -62,7 +57,7 @@ if (process.env.NODE_ENV !== 'production') {

// eslint-disable-next-line react-hooks/rules-of-hooks
React.useEffect(function () {
React.useEffect(() => {
if (isControlled !== (controlledValue !== undefined)) {
var error = new Error();
var controlWarning = isControlled ? 'a controlled value to be uncontrolled' : 'an uncontrolled value to be controlled';
var undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined'; // eslint-disable-next-line no-console
const error = new Error();
const controlWarning = isControlled ? 'a controlled value to be uncontrolled' : 'an uncontrolled value to be controlled';
const undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined'; // eslint-disable-next-line no-console

@@ -69,0 +64,0 @@ console.error([// Default react error

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var useIsomorphicLayoutEffect_1 = /*#__PURE__*/require("./useIsomorphicLayoutEffect");
const useIsomorphicLayoutEffect_1 = /*#__PURE__*/require("./useIsomorphicLayoutEffect");
/**

@@ -26,18 +26,12 @@ * https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback

var useEventCallback = function (fn) {
var callbackRef = React.useRef(function () {
const useEventCallback = fn => {
const callbackRef = React.useRef(() => {
throw new Error('Cannot call an event handler while rendering');
});
useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(function () {
useIsomorphicLayoutEffect_1.useIsomorphicLayoutEffect(() => {
callbackRef.current = fn;
}, [fn]);
return React.useCallback(function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var callback = callbackRef.current;
return callback.apply(void 0, args);
return React.useCallback((...args) => {
const callback = callbackRef.current;
return callback(...args);
}, [callbackRef]);

@@ -44,0 +38,0 @@ };

@@ -8,3 +8,3 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
/**

@@ -23,3 +23,3 @@ * Checks if components was mounted the first time.

function useFirstMount() {
var isFirst = React.useRef(true);
const isFirst = React.useRef(true);

@@ -26,0 +26,0 @@ if (isFirst.current) {

@@ -8,3 +8,3 @@ "use strict";

var react_1 = /*#__PURE__*/require("react");
const react_1 = /*#__PURE__*/require("react");
/**

@@ -16,5 +16,3 @@ * Forces a re-render, similar to `forceUpdate` in class components.

function useForceUpdate() {
return react_1.useReducer(function (x) {
return x + 1;
}, 0)[1];
return react_1.useReducer(x => x + 1, 0)[1];
}

@@ -21,0 +19,0 @@

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var index_1 = /*#__PURE__*/require("../ssr/index");
const index_1 = /*#__PURE__*/require("../ssr/index");
/**

@@ -34,6 +34,4 @@ * Resets generated IDs, should be used only in tests.

function useId(prefix, providedId) {
var contextValue = index_1.useSSRContext();
return React.useMemo(function () {
return providedId || "" + prefix + ++contextValue.current;
}, [prefix, providedId, contextValue]);
const contextValue = index_1.useSSRContext();
return React.useMemo(() => providedId || `${prefix}${++contextValue.current}`, [prefix, providedId, contextValue]);
}

@@ -40,0 +38,0 @@

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var index_1 = /*#__PURE__*/require("../ssr/index");
const index_1 = /*#__PURE__*/require("../ssr/index");
/**

@@ -13,0 +13,0 @@ * React currently throws a warning when using useLayoutEffect on the server. To get around it, we can conditionally

@@ -8,5 +8,3 @@ "use strict";

var tslib_1 = /*#__PURE__*/require("tslib");
var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
/**

@@ -20,16 +18,8 @@ * React hook to merge multiple React refs (either MutableRefObjects or ref callbacks) into a single ref callback that

function useMergedRefs() {
var refs = [];
for (var _i = 0; _i < arguments.length; _i++) {
refs[_i] = arguments[_i];
}
var mergedCallback = React.useCallback(function (value) {
function useMergedRefs(...refs) {
const mergedCallback = React.useCallback(value => {
// Update the "current" prop hanging on the function.
mergedCallback.current = value;
for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) {
var ref = refs_1[_i];
for (const ref of refs) {
if (typeof ref === 'function') {

@@ -42,3 +32,4 @@ ref(value);

}
}, tslib_1.__spreadArrays(refs));
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- already exhaustive
[...refs]);
return mergedCallback;

@@ -45,0 +36,0 @@ }

@@ -8,3 +8,3 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
/**

@@ -17,6 +17,6 @@ * Hook which asynchronously executes a callback once the component has been mounted.

var useMount = function (callback) {
var mountRef = React.useRef(callback);
const useMount = callback => {
const mountRef = React.useRef(callback);
mountRef.current = callback;
React.useEffect(function () {
React.useEffect(() => {
var _a;

@@ -23,0 +23,0 @@

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var useEventCallback_1 = /*#__PURE__*/require("./useEventCallback");
const useEventCallback_1 = /*#__PURE__*/require("./useEventCallback");
/**

@@ -17,18 +17,16 @@ * Utility to perform checks where a click/touch event was made outside a component

var useOnClickOutside = function (options) {
var refs = options.refs,
callback = options.callback,
element = options.element,
disabled = options.disabled,
containsProp = options.contains;
var timeoutId = React.useRef(undefined);
const useOnClickOutside = options => {
const {
refs,
callback,
element,
disabled,
contains: containsProp
} = options;
const timeoutId = React.useRef(undefined);
useIFrameFocus(!disabled, element, callback);
var listener = useEventCallback_1.useEventCallback(function (ev) {
var contains = containsProp || function (parent, child) {
return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));
};
const listener = useEventCallback_1.useEventCallback(ev => {
const contains = containsProp || ((parent, child) => !!(parent === null || parent === void 0 ? void 0 : parent.contains(child)));
var isOutside = refs.every(function (ref) {
return !contains(ref.current || null, ev.target);
});
const isOutside = refs.every(ref => !contains(ref.current || null, ev.target));

@@ -39,9 +37,9 @@ if (isOutside && !disabled) {

});
React.useEffect(function () {
React.useEffect(() => {
// Store the current event to avoid triggering handlers immediately
// Note this depends on a deprecated but extremely well supported quirk of the web platform
// https://github.com/facebook/react/issues/20074
var currentEvent = getWindowEvent(window);
let currentEvent = getWindowEvent(window);
var conditionalHandler = function (event) {
const conditionalHandler = event => {
// Skip if this event is the same as the one running when we added the handlers

@@ -64,6 +62,6 @@ if (event === currentEvent) {

timeoutId.current = window.setTimeout(function () {
timeoutId.current = window.setTimeout(() => {
currentEvent = undefined;
}, 1);
return function () {
return () => {
element === null || element === void 0 ? void 0 : element.removeEventListener('click', conditionalHandler, true);

@@ -80,3 +78,3 @@ element === null || element === void 0 ? void 0 : element.removeEventListener('touchstart', conditionalHandler, true);

var getWindowEvent = function (target) {
const getWindowEvent = target => {
var _a, _b, _c;

@@ -97,3 +95,3 @@

var FUI_FRAME_EVENT = 'fuiframefocus';
const FUI_FRAME_EVENT = 'fuiframefocus';
/**

@@ -114,9 +112,5 @@ * Since click events do not propagate past iframes, we use focus to detect if a

var useIFrameFocus = function (enableFrameFocusDispatch, targetDocument, callback, pollDuration) {
if (pollDuration === void 0) {
pollDuration = 1000;
}
var timeoutRef = React.useRef();
var listener = useEventCallback_1.useEventCallback(function (e) {
const useIFrameFocus = (enableFrameFocusDispatch, targetDocument, callback, pollDuration = 1000) => {
const timeoutRef = React.useRef();
const listener = useEventCallback_1.useEventCallback(e => {
if (callback) {

@@ -127,3 +121,3 @@ callback(e);

React.useEffect(function () {
React.useEffect(() => {
if (enableFrameFocusDispatch) {

@@ -133,3 +127,3 @@ targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener(FUI_FRAME_EVENT, listener, true);

return function () {
return () => {
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener(FUI_FRAME_EVENT, listener, true);

@@ -139,14 +133,14 @@ };

React.useEffect(function () {
React.useEffect(() => {
var _a;
if (enableFrameFocusDispatch) {
timeoutRef.current = (_a = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) === null || _a === void 0 ? void 0 : _a.setInterval(function () {
var activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
timeoutRef.current = (_a = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) === null || _a === void 0 ? void 0 : _a.setInterval(() => {
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === 'IFRAME') {
var event_1 = new CustomEvent(FUI_FRAME_EVENT, {
const event = new CustomEvent(FUI_FRAME_EVENT, {
bubbles: true
});
activeElement.dispatchEvent(event_1);
activeElement.dispatchEvent(event);
}

@@ -156,3 +150,3 @@ }, pollDuration);

return function () {
return () => {
var _a;

@@ -159,0 +153,0 @@

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var useEventCallback_1 = /*#__PURE__*/require("./useEventCallback");
const useEventCallback_1 = /*#__PURE__*/require("./useEventCallback");
/**

@@ -17,16 +17,14 @@ * Utility to perform checks where a click/touch event was made outside a component

var useOnScrollOutside = function (options) {
var refs = options.refs,
callback = options.callback,
element = options.element,
disabled = options.disabled,
containsProp = options.contains;
var listener = useEventCallback_1.useEventCallback(function (ev) {
var contains = containsProp || function (parent, child) {
return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));
};
const useOnScrollOutside = options => {
const {
refs,
callback,
element,
disabled,
contains: containsProp
} = options;
const listener = useEventCallback_1.useEventCallback(ev => {
const contains = containsProp || ((parent, child) => !!(parent === null || parent === void 0 ? void 0 : parent.contains(child)));
var isOutside = refs.every(function (ref) {
return !contains(ref.current || null, ev.target);
});
const isOutside = refs.every(ref => !contains(ref.current || null, ev.target));

@@ -37,3 +35,3 @@ if (isOutside && !disabled) {

});
React.useEffect(function () {
React.useEffect(() => {
if (!disabled) {

@@ -44,3 +42,3 @@ element === null || element === void 0 ? void 0 : element.addEventListener('wheel', listener);

return function () {
return () => {
element === null || element === void 0 ? void 0 : element.removeEventListener('wheel', listener);

@@ -47,0 +45,0 @@ element === null || element === void 0 ? void 0 : element.removeEventListener('touchmove', listener);

@@ -8,7 +8,7 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var usePrevious = function (value) {
var ref = React.useRef(null);
React.useEffect(function () {
const usePrevious = value => {
const ref = React.useRef(null);
React.useEffect(() => {
ref.current = value;

@@ -15,0 +15,0 @@ }, [value]);

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var useConst_1 = /*#__PURE__*/require("./useConst");
const useConst_1 = /*#__PURE__*/require("./useConst");
/**

@@ -22,21 +22,17 @@ * Helper to manage a browser timeout.

function useTimeout() {
var timeout = useConst_1.useConst(function () {
return {
id: undefined,
set: function (fn, delay) {
timeout.clear();
timeout.id = setTimeout(fn, delay);
},
clear: function () {
if (timeout.id !== undefined) {
clearTimeout(timeout.id);
timeout.id = undefined;
}
const timeout = useConst_1.useConst(() => ({
id: undefined,
set: (fn, delay) => {
timeout.clear();
timeout.id = setTimeout(fn, delay);
},
clear: () => {
if (timeout.id !== undefined) {
clearTimeout(timeout.id);
timeout.id = undefined;
}
};
}); // Clean up the timeout when the component is unloaded
}
})); // Clean up the timeout when the component is unloaded
React.useEffect(function () {
return timeout.clear;
}, [timeout]);
React.useEffect(() => timeout.clear, [timeout]);
return [timeout.set, timeout.clear];

@@ -43,0 +39,0 @@ }

@@ -8,3 +8,3 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
/**

@@ -17,11 +17,9 @@ * Hook which synchronously executes a callback when the component is about to unmount.

var useUnmount = function (callback) {
var unmountRef = React.useRef(callback);
const useUnmount = callback => {
const unmountRef = React.useRef(callback);
unmountRef.current = callback;
React.useEffect(function () {
return function () {
var _a;
React.useEffect(() => () => {
var _a;
(_a = unmountRef.current) === null || _a === void 0 ? void 0 : _a.call(unmountRef);
};
(_a = unmountRef.current) === null || _a === void 0 ? void 0 : _a.call(unmountRef);
}, []);

@@ -28,0 +26,0 @@ };

@@ -7,3 +7,3 @@ "use strict";

var tslib_1 = /*#__PURE__*/require("tslib");
const tslib_1 = /*#__PURE__*/require("tslib");

@@ -10,0 +10,0 @@ tslib_1.__exportStar(require("./compose/index"), exports);

@@ -7,3 +7,3 @@ "use strict";

var tslib_1 = /*#__PURE__*/require("tslib");
const tslib_1 = /*#__PURE__*/require("tslib");

@@ -10,0 +10,0 @@ tslib_1.__exportStar(require("./canUseDOM"), exports);

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var canUseDOM_1 = /*#__PURE__*/require("./canUseDOM");
const canUseDOM_1 = /*#__PURE__*/require("./canUseDOM");
/**

@@ -39,8 +39,6 @@ * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.

var SSRProvider = function (props) {
var value = React.useState(function () {
return {
current: 0
};
})[0];
const SSRProvider = props => {
const [value] = React.useState(() => ({
current: 0
}));
return React.createElement(exports.SSRContext.Provider, {

@@ -58,10 +56,6 @@ value: value

function useIsSSR() {
var isInSSRContext = useSSRContext() !== exports.defaultSSRContextValue;
var _a = React.useState(isInSSRContext),
isSSR = _a[0],
setIsSSR = _a[1]; // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the
const isInSSRContext = useSSRContext() !== exports.defaultSSRContextValue;
const [isSSR, setIsSSR] = React.useState(isInSSRContext); // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the
// developer to add one.
if (process.env.NODE_ENV !== 'production') {

@@ -80,3 +74,3 @@ if (!isInSSRContext && !canUseDOM_1.canUseDOM()) {

// eslint-disable-next-line
React.useLayoutEffect(function () {
React.useLayoutEffect(() => {
setIsSSR(false);

@@ -83,0 +77,0 @@ }, []);

@@ -8,5 +8,5 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
var onlyChild_1 = /*#__PURE__*/require("./onlyChild");
const onlyChild_1 = /*#__PURE__*/require("./onlyChild");
/**

@@ -17,3 +17,3 @@ * Apply the trigger props to the children, either by calling the render function, or cloning with the new props.

var applyTriggerPropsToChildren = function (children, triggerProps) {
const applyTriggerPropsToChildren = (children, triggerProps) => {
if (typeof children === 'function') {

@@ -20,0 +20,0 @@ return children(triggerProps);

@@ -15,7 +15,5 @@ "use strict";

var clamp = function (value, min, max) {
return Math.max(min, Math.min(max, value || 0));
};
const clamp = (value, min, max) => Math.max(min, Math.min(max, value || 0));
exports.clamp = clamp;
//# sourceMappingURL=clamp.js.map

@@ -8,5 +8,5 @@ "use strict";

var properties_1 = /*#__PURE__*/require("./properties");
const properties_1 = /*#__PURE__*/require("./properties");
var nativeElementMap = {
const nativeElementMap = {
label: properties_1.labelProperties,

@@ -43,3 +43,3 @@ audio: properties_1.audioProperties,

function getNativeElementProps(tagName, props, excludedPropNames) {
var allowedPropNames = tagName && nativeElementMap[tagName] || properties_1.htmlElementProperties;
const allowedPropNames = tagName && nativeElementMap[tagName] || properties_1.htmlElementProperties;
allowedPropNames.as = 1;

@@ -46,0 +46,0 @@ return properties_1.getNativeProps(props, allowedPropNames, excludedPropNames);

@@ -11,3 +11,3 @@ "use strict";

var getRTLSafeKey = function (key, dir) {
const getRTLSafeKey = (key, dir) => {
if (dir === 'rtl') {

@@ -14,0 +14,0 @@ switch (key) {

@@ -7,3 +7,3 @@ "use strict";

var tslib_1 = /*#__PURE__*/require("tslib");
const tslib_1 = /*#__PURE__*/require("tslib");

@@ -10,0 +10,0 @@ tslib_1.__exportStar(require("./applyTriggerPropsToChildren"), exports);

@@ -24,5 +24,5 @@ "use strict";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
var result = {};
const result = {};
for (var key in obj) {
for (const key in obj) {
if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {

@@ -29,0 +29,0 @@ result[key] = obj[key];

@@ -8,3 +8,3 @@ "use strict";

var React = /*#__PURE__*/require("react");
const React = /*#__PURE__*/require("react");
/**

@@ -15,5 +15,5 @@ * Similar to React.Children.only, but drills into fragments rather than treating them as a single child

var onlyChild = function (child) {
const onlyChild = child => {
if (!React.isValidElement(child)) {
throw new Error("Component's child must be a single element");
throw new Error(`Component's child must be a single element`);
}

@@ -20,0 +20,0 @@

@@ -8,17 +8,9 @@ "use strict";

var toObjectMap = function () {
var items = [];
const toObjectMap = (...items) => {
const result = {};
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
for (const item of items) {
const keys = Array.isArray(item) ? item : Object.keys(item);
var result = {};
for (var _a = 0, items_1 = items; _a < items_1.length; _a++) {
var item = items_1[_a];
var keys = Array.isArray(item) ? item : Object.keys(item);
for (var _b = 0, keys_1 = keys; _b < keys_1.length; _b++) {
var key = keys_1[_b];
for (const key of keys) {
result[key] = 1;

@@ -209,10 +201,9 @@ }

// We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797
var isArray = Array.isArray(allowedPropNames); // eslint-disable-next-line @typescript-eslint/no-explicit-any
const isArray = Array.isArray(allowedPropNames); // eslint-disable-next-line @typescript-eslint/no-explicit-any
var result = {};
var keys = Object.keys(props);
const result = {};
const keys = Object.keys(props);
for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {
var key = keys_2[_i];
var isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;
for (const key of keys) {
const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;

@@ -219,0 +210,0 @@ if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {

@@ -8,3 +8,3 @@ "use strict";

var keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
const keyboard_keys_1 = /*#__PURE__*/require("@fluentui/keyboard-keys");
/**

@@ -18,5 +18,5 @@ * Checks if the keyboard event should preventDefault() for Enter and Spacebar keys

function shouldPreventDefaultOnKeyDown(e) {
var key = e.key;
var target = e.target;
var matchesByKey = key === keyboard_keys_1.Space || key === keyboard_keys_1.Enter;
const key = e.key;
const target = e.target;
const matchesByKey = key === keyboard_keys_1.Space || key === keyboard_keys_1.Enter;

@@ -27,3 +27,3 @@ if ((target === null || target === void 0 ? void 0 : target.tagName) === 'A') {

var ignoredByTag = (target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT' || (target === null || target === void 0 ? void 0 : target.tagName) === 'TEXTAREA' || (target === null || target === void 0 ? void 0 : target.isContentEditable) === true;
const ignoredByTag = (target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT' || (target === null || target === void 0 ? void 0 : target.tagName) === 'TEXTAREA' || (target === null || target === void 0 ? void 0 : target.isContentEditable) === true;
return matchesByKey && !ignoredByTag;

@@ -30,0 +30,0 @@ }

@@ -1,2 +0,1 @@

import { __rest } from "tslib";
import * as React from 'react';

@@ -22,17 +21,8 @@ import { nullRender } from './nullRender';

export function getSlots(state, slotNames) {
if (slotNames === void 0) {
slotNames = ['root'];
}
export function getSlots(state, slotNames = ['root']) {
const slots = {};
const slotProps = {};
var slots = {};
var slotProps = {};
for (var _i = 0, slotNames_1 = slotNames; _i < slotNames_1.length; _i++) {
var slotName = slotNames_1[_i];
var _a = getSlot(state, slotName),
slot = _a[0],
props = _a[1];
for (const slotName of slotNames) {
const [slot, props] = getSlot(state, slotName);
slots[slotName] = slot;

@@ -43,3 +33,3 @@ slotProps[slotName] = props;

return {
slots: slots,
slots,
slotProps: slotProps

@@ -56,11 +46,11 @@ };

var _d = state[slotName],
children = _d.children,
asProp = _d.as,
rest = __rest(_d, ["children", "as"]);
const {
children,
as: asProp,
...rest
} = state[slotName];
const slot = ((_a = state.components) === null || _a === void 0 ? void 0 : _a[slotName]) === undefined || typeof state.components[slotName] === 'string' ? asProp || ((_b = state.components) === null || _b === void 0 ? void 0 : _b[slotName]) || 'div' : state.components[slotName];
var slot = ((_a = state.components) === null || _a === void 0 ? void 0 : _a[slotName]) === undefined || typeof state.components[slotName] === 'string' ? asProp || ((_b = state.components) === null || _b === void 0 ? void 0 : _b[slotName]) || 'div' : state.components[slotName];
if (typeof children === 'function') {
var render = children;
const render = children;
return [React.Fragment, {

@@ -71,6 +61,6 @@ children: render(slot, rest)

var shouldOmitAsProp = typeof slot === 'string' && ((_c = state[slotName]) === null || _c === void 0 ? void 0 : _c.as);
var slotProps = shouldOmitAsProp ? omit(state[slotName], ['as']) : state[slotName];
const shouldOmitAsProp = typeof slot === 'string' && ((_c = state[slotName]) === null || _c === void 0 ? void 0 : _c.as);
const slotProps = shouldOmitAsProp ? omit(state[slotName], ['as']) : state[slotName];
return [slot, slotProps];
}
//# sourceMappingURL=getSlots.js.map
/**
* Simple constant function for returning null, used to render empty templates in JSX.
*/
export var nullRender = function () {
return null;
};
export const nullRender = () => null;
//# sourceMappingURL=nullRender.js.map

@@ -1,2 +0,1 @@

import { __assign } from "tslib";
import { isValidElement } from 'react';

@@ -11,6 +10,6 @@ /**

export function resolveShorthand(value, options) {
var _a = options || {},
_b = _a.required,
required = _b === void 0 ? false : _b,
defaultProps = _a.defaultProps;
const {
required = false,
defaultProps
} = options || {};

@@ -21,3 +20,3 @@ if (value === null || value === undefined && !required) {

var resolvedShorthand = {};
let resolvedShorthand = {};

@@ -30,4 +29,6 @@ if (typeof value === 'string' || typeof value === 'number' || Array.isArray(value) || /*#__PURE__*/isValidElement(value)) {

return defaultProps ? __assign(__assign({}, defaultProps), resolvedShorthand) : resolvedShorthand;
return defaultProps ? { ...defaultProps,
...resolvedShorthand
} : resolvedShorthand;
}
//# sourceMappingURL=resolveShorthand.js.map

@@ -12,29 +12,18 @@ import * as React from 'react';

export function useBoolean(initialState) {
var _a = React.useState(initialState),
value = _a[0],
setValue = _a[1];
var setTrue = useConst(function () {
return function () {
setValue(true);
};
const [value, setValue] = React.useState(initialState);
const setTrue = useConst(() => () => {
setValue(true);
});
var setFalse = useConst(function () {
return function () {
setValue(false);
};
const setFalse = useConst(() => () => {
setValue(false);
});
var toggle = useConst(function () {
return function () {
setValue(function (currentValue) {
return !currentValue;
});
};
const toggle = useConst(() => () => {
setValue(currentValue => !currentValue);
});
return [value, {
setTrue: setTrue,
setFalse: setFalse,
toggle: toggle
setTrue,
setFalse,
toggle
}];
}
//# sourceMappingURL=useBoolean.js.map

@@ -18,3 +18,3 @@ import * as React from 'react';

// internally due to reducer handling which we don't need)
var ref = React.useRef();
const ref = React.useRef();

@@ -21,0 +21,0 @@ if (ref.current === undefined) {

@@ -18,13 +18,9 @@ import * as React from 'react';

export var useControllableState = function (options) {
var isControlled = useIsControlled(options.state);
var initialState = isUndefined(options.defaultState) ? options.initialState : options.defaultState;
var _a = React.useState(initialState),
internalState = _a[0],
setInternalState = _a[1];
var state = isControlled ? options.state : internalState;
var stateRef = React.useRef(state);
React.useEffect(function () {
export const useControllableState = options => {
const isControlled = useIsControlled(options.state);
const initialState = isUndefined(options.defaultState) ? options.initialState : options.defaultState;
const [internalState, setInternalState] = React.useState(initialState);
const state = isControlled ? options.state : internalState;
const stateRef = React.useRef(state);
React.useEffect(() => {
stateRef.current = state;

@@ -34,3 +30,3 @@ }, [state]); // To match the behavior of the setter returned by React.useState, this callback's identity

var setState = React.useCallback(function (newState) {
const setState = React.useCallback(newState => {
// React dispatch can use a factory

@@ -54,4 +50,4 @@ // https://reactjs.org/docs/hooks-reference.html#functional-updates

var useIsControlled = function (controlledValue) {
var isControlled = useConst(controlledValue !== undefined);
const useIsControlled = controlledValue => {
const isControlled = useConst(controlledValue !== undefined);

@@ -61,7 +57,7 @@ if (process.env.NODE_ENV !== 'production') {

// eslint-disable-next-line react-hooks/rules-of-hooks
React.useEffect(function () {
React.useEffect(() => {
if (isControlled !== (controlledValue !== undefined)) {
var error = new Error();
var controlWarning = isControlled ? 'a controlled value to be uncontrolled' : 'an uncontrolled value to be controlled';
var undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined'; // eslint-disable-next-line no-console
const error = new Error();
const controlWarning = isControlled ? 'a controlled value to be uncontrolled' : 'an uncontrolled value to be controlled';
const undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined'; // eslint-disable-next-line no-console

@@ -68,0 +64,0 @@ console.error([// Default react error

import * as React from 'react';
import { useConst } from './useConst';
export function useControllableValue(controlledValue, defaultUncontrolledValue, onChange) {
var _a = React.useState(defaultUncontrolledValue),
value = _a[0],
setValue = _a[1];
var isControlled = useIsControlled(controlledValue);
var currentValue = isControlled ? controlledValue : value; // Duplicate the current value and onChange in refs so they're accessible from
const [value, setValue] = React.useState(defaultUncontrolledValue);
const isControlled = useIsControlled(controlledValue);
const currentValue = isControlled ? controlledValue : value; // Duplicate the current value and onChange in refs so they're accessible from
// setValueOrCallOnChange without creating a new callback every time
var valueRef = React.useRef(currentValue);
var onChangeRef = React.useRef(onChange);
React.useEffect(function () {
const valueRef = React.useRef(currentValue);
const onChangeRef = React.useRef(onChange);
React.useEffect(() => {
valueRef.current = currentValue;

@@ -20,16 +17,14 @@ onChangeRef.current = onChange;

var setValueOrCallOnChange = useConst(function () {
return function (update, ev) {
// Assuming here that TValue is not a function, because a controllable value will typically
// be something a user can enter as input
var newValue = typeof update === 'function' ? update(valueRef.current) : update;
const setValueOrCallOnChange = useConst(() => (update, ev) => {
// Assuming here that TValue is not a function, because a controllable value will typically
// be something a user can enter as input
const newValue = typeof update === 'function' ? update(valueRef.current) : update;
if (onChangeRef.current) {
onChangeRef.current(ev, newValue);
}
if (onChangeRef.current) {
onChangeRef.current(ev, newValue);
}
if (!isControlled) {
setValue(newValue);
}
};
if (!isControlled) {
setValue(newValue);
}
});

@@ -43,4 +38,4 @@ return [currentValue, setValueOrCallOnChange];

var useIsControlled = function (controlledValue) {
var isControlled = useConst(controlledValue !== undefined);
const useIsControlled = controlledValue => {
const isControlled = useConst(controlledValue !== undefined);

@@ -50,7 +45,7 @@ if (process.env.NODE_ENV !== 'production') {

// eslint-disable-next-line react-hooks/rules-of-hooks
React.useEffect(function () {
React.useEffect(() => {
if (isControlled !== (controlledValue !== undefined)) {
var error = new Error();
var controlWarning = isControlled ? 'a controlled value to be uncontrolled' : 'an uncontrolled value to be controlled';
var undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined'; // eslint-disable-next-line no-console
const error = new Error();
const controlWarning = isControlled ? 'a controlled value to be uncontrolled' : 'an uncontrolled value to be controlled';
const undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined'; // eslint-disable-next-line no-console

@@ -57,0 +52,0 @@ console.error([// Default react error

@@ -16,20 +16,14 @@ import * as React from 'react';

export var useEventCallback = function (fn) {
var callbackRef = React.useRef(function () {
export const useEventCallback = fn => {
const callbackRef = React.useRef(() => {
throw new Error('Cannot call an event handler while rendering');
});
useIsomorphicLayoutEffect(function () {
useIsomorphicLayoutEffect(() => {
callbackRef.current = fn;
}, [fn]);
return React.useCallback(function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
var callback = callbackRef.current;
return callback.apply(void 0, args);
return React.useCallback((...args) => {
const callback = callbackRef.current;
return callback(...args);
}, [callbackRef]);
};
//# sourceMappingURL=useEventCallback.js.map

@@ -14,3 +14,3 @@ import * as React from 'react';

export function useFirstMount() {
var isFirst = React.useRef(true);
const isFirst = React.useRef(true);

@@ -17,0 +17,0 @@ if (isFirst.current) {

@@ -7,6 +7,4 @@ import { useReducer } from 'react';

export function useForceUpdate() {
return useReducer(function (x) {
return x + 1;
}, 0)[1];
return useReducer(x => x + 1, 0)[1];
}
//# sourceMappingURL=useForceUpdate.js.map

@@ -22,7 +22,5 @@ import * as React from 'react';

export function useId(prefix, providedId) {
var contextValue = useSSRContext();
return React.useMemo(function () {
return providedId || "" + prefix + ++contextValue.current;
}, [prefix, providedId, contextValue]);
const contextValue = useSSRContext();
return React.useMemo(() => providedId || `${prefix}${++contextValue.current}`, [prefix, providedId, contextValue]);
}
//# sourceMappingURL=useId.js.map

@@ -14,3 +14,3 @@ import * as React from 'react';

export var useIsomorphicLayoutEffect = /*#__PURE__*/canUseDOM() ? React.useLayoutEffect : React.useEffect;
export const useIsomorphicLayoutEffect = /*#__PURE__*/canUseDOM() ? React.useLayoutEffect : React.useEffect;
//# sourceMappingURL=useIsomorphicLayoutEffect.js.map

@@ -1,2 +0,1 @@

import { __spreadArrays } from "tslib";
import * as React from 'react';

@@ -10,16 +9,8 @@ /**

export function useMergedRefs() {
var refs = [];
for (var _i = 0; _i < arguments.length; _i++) {
refs[_i] = arguments[_i];
}
var mergedCallback = React.useCallback(function (value) {
export function useMergedRefs(...refs) {
const mergedCallback = React.useCallback(value => {
// Update the "current" prop hanging on the function.
mergedCallback.current = value;
for (var _i = 0, refs_1 = refs; _i < refs_1.length; _i++) {
var ref = refs_1[_i];
for (const ref of refs) {
if (typeof ref === 'function') {

@@ -32,5 +23,6 @@ ref(value);

}
}, __spreadArrays(refs));
}, // eslint-disable-next-line react-hooks/exhaustive-deps -- already exhaustive
[...refs]);
return mergedCallback;
}
//# sourceMappingURL=useMergedRefs.js.map

@@ -8,6 +8,6 @@ import * as React from 'react';

export var useMount = function (callback) {
var mountRef = React.useRef(callback);
export const useMount = callback => {
const mountRef = React.useRef(callback);
mountRef.current = callback;
React.useEffect(function () {
React.useEffect(() => {
var _a;

@@ -14,0 +14,0 @@

@@ -7,18 +7,16 @@ import * as React from 'react';

export var useOnClickOutside = function (options) {
var refs = options.refs,
callback = options.callback,
element = options.element,
disabled = options.disabled,
containsProp = options.contains;
var timeoutId = React.useRef(undefined);
export const useOnClickOutside = options => {
const {
refs,
callback,
element,
disabled,
contains: containsProp
} = options;
const timeoutId = React.useRef(undefined);
useIFrameFocus(!disabled, element, callback);
var listener = useEventCallback(function (ev) {
var contains = containsProp || function (parent, child) {
return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));
};
const listener = useEventCallback(ev => {
const contains = containsProp || ((parent, child) => !!(parent === null || parent === void 0 ? void 0 : parent.contains(child)));
var isOutside = refs.every(function (ref) {
return !contains(ref.current || null, ev.target);
});
const isOutside = refs.every(ref => !contains(ref.current || null, ev.target));

@@ -29,9 +27,9 @@ if (isOutside && !disabled) {

});
React.useEffect(function () {
React.useEffect(() => {
// Store the current event to avoid triggering handlers immediately
// Note this depends on a deprecated but extremely well supported quirk of the web platform
// https://github.com/facebook/react/issues/20074
var currentEvent = getWindowEvent(window);
let currentEvent = getWindowEvent(window);
var conditionalHandler = function (event) {
const conditionalHandler = event => {
// Skip if this event is the same as the one running when we added the handlers

@@ -54,6 +52,6 @@ if (event === currentEvent) {

timeoutId.current = window.setTimeout(function () {
timeoutId.current = window.setTimeout(() => {
currentEvent = undefined;
}, 1);
return function () {
return () => {
element === null || element === void 0 ? void 0 : element.removeEventListener('click', conditionalHandler, true);

@@ -68,3 +66,3 @@ element === null || element === void 0 ? void 0 : element.removeEventListener('touchstart', conditionalHandler, true);

var getWindowEvent = function (target) {
const getWindowEvent = target => {
var _a, _b, _c;

@@ -85,3 +83,3 @@

var FUI_FRAME_EVENT = 'fuiframefocus';
const FUI_FRAME_EVENT = 'fuiframefocus';
/**

@@ -102,9 +100,5 @@ * Since click events do not propagate past iframes, we use focus to detect if a

var useIFrameFocus = function (enableFrameFocusDispatch, targetDocument, callback, pollDuration) {
if (pollDuration === void 0) {
pollDuration = 1000;
}
var timeoutRef = React.useRef();
var listener = useEventCallback(function (e) {
const useIFrameFocus = (enableFrameFocusDispatch, targetDocument, callback, pollDuration = 1000) => {
const timeoutRef = React.useRef();
const listener = useEventCallback(e => {
if (callback) {

@@ -115,3 +109,3 @@ callback(e);

React.useEffect(function () {
React.useEffect(() => {
if (enableFrameFocusDispatch) {

@@ -121,3 +115,3 @@ targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener(FUI_FRAME_EVENT, listener, true);

return function () {
return () => {
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener(FUI_FRAME_EVENT, listener, true);

@@ -127,14 +121,14 @@ };

React.useEffect(function () {
React.useEffect(() => {
var _a;
if (enableFrameFocusDispatch) {
timeoutRef.current = (_a = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) === null || _a === void 0 ? void 0 : _a.setInterval(function () {
var activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
timeoutRef.current = (_a = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.defaultView) === null || _a === void 0 ? void 0 : _a.setInterval(() => {
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
if ((activeElement === null || activeElement === void 0 ? void 0 : activeElement.tagName) === 'IFRAME') {
var event_1 = new CustomEvent(FUI_FRAME_EVENT, {
const event = new CustomEvent(FUI_FRAME_EVENT, {
bubbles: true
});
activeElement.dispatchEvent(event_1);
activeElement.dispatchEvent(event);
}

@@ -144,3 +138,3 @@ }, pollDuration);

return function () {
return () => {
var _a;

@@ -147,0 +141,0 @@

@@ -7,16 +7,14 @@ import * as React from 'react';

export var useOnScrollOutside = function (options) {
var refs = options.refs,
callback = options.callback,
element = options.element,
disabled = options.disabled,
containsProp = options.contains;
var listener = useEventCallback(function (ev) {
var contains = containsProp || function (parent, child) {
return !!(parent === null || parent === void 0 ? void 0 : parent.contains(child));
};
export const useOnScrollOutside = options => {
const {
refs,
callback,
element,
disabled,
contains: containsProp
} = options;
const listener = useEventCallback(ev => {
const contains = containsProp || ((parent, child) => !!(parent === null || parent === void 0 ? void 0 : parent.contains(child)));
var isOutside = refs.every(function (ref) {
return !contains(ref.current || null, ev.target);
});
const isOutside = refs.every(ref => !contains(ref.current || null, ev.target));

@@ -27,3 +25,3 @@ if (isOutside && !disabled) {

});
React.useEffect(function () {
React.useEffect(() => {
if (!disabled) {

@@ -34,3 +32,3 @@ element === null || element === void 0 ? void 0 : element.addEventListener('wheel', listener);

return function () {
return () => {
element === null || element === void 0 ? void 0 : element.removeEventListener('wheel', listener);

@@ -37,0 +35,0 @@ element === null || element === void 0 ? void 0 : element.removeEventListener('touchmove', listener);

import * as React from 'react';
export var usePrevious = function (value) {
var ref = React.useRef(null);
React.useEffect(function () {
export const usePrevious = value => {
const ref = React.useRef(null);
React.useEffect(() => {
ref.current = value;

@@ -6,0 +6,0 @@ }, [value]);

@@ -12,23 +12,19 @@ import * as React from 'react';

export function useTimeout() {
var timeout = useConst(function () {
return {
id: undefined,
set: function (fn, delay) {
timeout.clear();
timeout.id = setTimeout(fn, delay);
},
clear: function () {
if (timeout.id !== undefined) {
clearTimeout(timeout.id);
timeout.id = undefined;
}
const timeout = useConst(() => ({
id: undefined,
set: (fn, delay) => {
timeout.clear();
timeout.id = setTimeout(fn, delay);
},
clear: () => {
if (timeout.id !== undefined) {
clearTimeout(timeout.id);
timeout.id = undefined;
}
};
}); // Clean up the timeout when the component is unloaded
}
})); // Clean up the timeout when the component is unloaded
React.useEffect(function () {
return timeout.clear;
}, [timeout]);
React.useEffect(() => timeout.clear, [timeout]);
return [timeout.set, timeout.clear];
}
//# sourceMappingURL=useTimeout.js.map

@@ -8,13 +8,11 @@ import * as React from 'react';

export var useUnmount = function (callback) {
var unmountRef = React.useRef(callback);
export const useUnmount = callback => {
const unmountRef = React.useRef(callback);
unmountRef.current = callback;
React.useEffect(function () {
return function () {
var _a;
React.useEffect(() => () => {
var _a;
(_a = unmountRef.current) === null || _a === void 0 ? void 0 : _a.call(unmountRef);
};
(_a = unmountRef.current) === null || _a === void 0 ? void 0 : _a.call(unmountRef);
}, []);
};
//# sourceMappingURL=useUnmount.js.map

@@ -9,6 +9,6 @@ import * as React from 'react';

export var defaultSSRContextValue = {
export const defaultSSRContextValue = {
current: 0
};
export var SSRContext = /*#__PURE__*/React.createContext(defaultSSRContextValue);
export const SSRContext = /*#__PURE__*/React.createContext(defaultSSRContextValue);
/**

@@ -28,8 +28,6 @@ * @internal

export var SSRProvider = function (props) {
var value = React.useState(function () {
return {
current: 0
};
})[0];
export const SSRProvider = props => {
const [value] = React.useState(() => ({
current: 0
}));
return /*#__PURE__*/React.createElement(SSRContext.Provider, {

@@ -45,10 +43,6 @@ value: value

export function useIsSSR() {
var isInSSRContext = useSSRContext() !== defaultSSRContextValue;
var _a = React.useState(isInSSRContext),
isSSR = _a[0],
setIsSSR = _a[1]; // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the
const isInSSRContext = useSSRContext() !== defaultSSRContextValue;
const [isSSR, setIsSSR] = React.useState(isInSSRContext); // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the
// developer to add one.
if (process.env.NODE_ENV !== 'production') {

@@ -67,3 +61,3 @@ if (!isInSSRContext && !canUseDOM()) {

// eslint-disable-next-line
React.useLayoutEffect(function () {
React.useLayoutEffect(() => {
setIsSSR(false);

@@ -70,0 +64,0 @@ }, []);

@@ -7,3 +7,3 @@ import * as React from 'react';

export var applyTriggerPropsToChildren = function (children, triggerProps) {
export const applyTriggerPropsToChildren = (children, triggerProps) => {
if (typeof children === 'function') {

@@ -10,0 +10,0 @@ return children(triggerProps);

@@ -8,5 +8,3 @@ /**

*/
export var clamp = function (value, min, max) {
return Math.max(min, Math.min(max, value || 0));
};
export const clamp = (value, min, max) => Math.max(min, Math.min(max, value || 0));
//# sourceMappingURL=clamp.js.map
import { labelProperties, audioProperties, videoProperties, olProperties, liProperties, anchorProperties, buttonProperties, inputProperties, textAreaProperties, selectProperties, optionProperties, tableProperties, trProperties, thProperties, tdProperties, colGroupProperties, colProperties, formProperties, iframeProperties, imgProperties, htmlElementProperties, getNativeProps } from './properties';
var nativeElementMap = {
const nativeElementMap = {
label: labelProperties,

@@ -34,3 +34,3 @@ audio: audioProperties,

export function getNativeElementProps(tagName, props, excludedPropNames) {
var allowedPropNames = tagName && nativeElementMap[tagName] || htmlElementProperties;
const allowedPropNames = tagName && nativeElementMap[tagName] || htmlElementProperties;
allowedPropNames.as = 1;

@@ -37,0 +37,0 @@ return getNativeProps(props, allowedPropNames, excludedPropNames);

/**
* Finds and swaps a provided key for it's right to left format.
*/
export var getRTLSafeKey = function (key, dir) {
export const getRTLSafeKey = (key, dir) => {
if (dir === 'rtl') {

@@ -6,0 +6,0 @@ switch (key) {

@@ -17,5 +17,5 @@ /**

// eslint-disable-next-line @typescript-eslint/no-explicit-any
var result = {};
const result = {};
for (var key in obj) {
for (const key in obj) {
if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {

@@ -22,0 +22,0 @@ result[key] = obj[key];

@@ -6,5 +6,5 @@ import * as React from 'react';

export var onlyChild = function (child) {
export const onlyChild = child => {
if (! /*#__PURE__*/React.isValidElement(child)) {
throw new Error("Component's child must be a single element");
throw new Error(`Component's child must be a single element`);
}

@@ -11,0 +11,0 @@

@@ -1,16 +0,8 @@

var toObjectMap = function () {
var items = [];
const toObjectMap = (...items) => {
const result = {};
for (var _i = 0; _i < arguments.length; _i++) {
items[_i] = arguments[_i];
}
for (const item of items) {
const keys = Array.isArray(item) ? item : Object.keys(item);
var result = {};
for (var _a = 0, items_1 = items; _a < items_1.length; _a++) {
var item = items_1[_a];
var keys = Array.isArray(item) ? item : Object.keys(item);
for (var _b = 0, keys_1 = keys; _b < keys_1.length; _b++) {
var key = keys_1[_b];
for (const key of keys) {
result[key] = 1;

@@ -29,3 +21,3 @@ }

export var baseElementEvents = /*#__PURE__*/toObjectMap(['onAuxClick', 'onCopy', 'onCut', 'onPaste', 'onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate', 'onFocus', 'onFocusCapture', 'onBlur', 'onBlurCapture', 'onChange', 'onInput', 'onSubmit', 'onLoad', 'onError', 'onKeyDown', 'onKeyDownCapture', 'onKeyPress', 'onKeyUp', 'onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting', 'onClick', 'onClickCapture', 'onContextMenu', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseDownCapture', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onMouseUpCapture', 'onSelect', 'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'onScroll', 'onWheel', 'onPointerCancel', 'onPointerDown', 'onPointerEnter', 'onPointerLeave', 'onPointerMove', 'onPointerOut', 'onPointerOver', 'onPointerUp', 'onGotPointerCapture', 'onLostPointerCapture']);
export const baseElementEvents = /*#__PURE__*/toObjectMap(['onAuxClick', 'onCopy', 'onCut', 'onPaste', 'onCompositionEnd', 'onCompositionStart', 'onCompositionUpdate', 'onFocus', 'onFocusCapture', 'onBlur', 'onBlurCapture', 'onChange', 'onInput', 'onSubmit', 'onLoad', 'onError', 'onKeyDown', 'onKeyDownCapture', 'onKeyPress', 'onKeyUp', 'onAbort', 'onCanPlay', 'onCanPlayThrough', 'onDurationChange', 'onEmptied', 'onEncrypted', 'onEnded', 'onLoadedData', 'onLoadedMetadata', 'onLoadStart', 'onPause', 'onPlay', 'onPlaying', 'onProgress', 'onRateChange', 'onSeeked', 'onSeeking', 'onStalled', 'onSuspend', 'onTimeUpdate', 'onVolumeChange', 'onWaiting', 'onClick', 'onClickCapture', 'onContextMenu', 'onDoubleClick', 'onDrag', 'onDragEnd', 'onDragEnter', 'onDragExit', 'onDragLeave', 'onDragOver', 'onDragStart', 'onDrop', 'onMouseDown', 'onMouseDownCapture', 'onMouseEnter', 'onMouseLeave', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onMouseUpCapture', 'onSelect', 'onTouchCancel', 'onTouchEnd', 'onTouchMove', 'onTouchStart', 'onScroll', 'onWheel', 'onPointerCancel', 'onPointerDown', 'onPointerEnter', 'onPointerLeave', 'onPointerMove', 'onPointerOut', 'onPointerOver', 'onPointerUp', 'onGotPointerCapture', 'onLostPointerCapture']);
/**

@@ -37,3 +29,3 @@ * An array of element attributes which are allowed on every html element type.

export var baseElementProperties = /*#__PURE__*/toObjectMap(['accessKey', 'children', 'className', 'contentEditable', 'dir', 'draggable', 'hidden', 'htmlFor', 'id', 'lang', 'ref', 'role', 'style', 'tabIndex', 'title', 'translate', 'spellCheck', 'name']);
export const baseElementProperties = /*#__PURE__*/toObjectMap(['accessKey', 'children', 'className', 'contentEditable', 'dir', 'draggable', 'hidden', 'htmlFor', 'id', 'lang', 'ref', 'role', 'style', 'tabIndex', 'title', 'translate', 'spellCheck', 'name']);
/**

@@ -45,3 +37,3 @@ * An array of HTML element properties and events.

export var htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementProperties, baseElementEvents);
export const htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementProperties, baseElementEvents);
/**

@@ -53,3 +45,3 @@ * An array of LABEL tag properties and events.

export var labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['form']);
export const labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['form']);
/**

@@ -61,3 +53,3 @@ * An array of AUDIO tag properties and events.

export var audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['height', 'loop', 'muted', 'preload', 'src', 'width']);
export const audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['height', 'loop', 'muted', 'preload', 'src', 'width']);
/**

@@ -69,3 +61,3 @@ * An array of VIDEO tag properties and events.

export var videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ['poster']);
export const videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ['poster']);
/**

@@ -77,3 +69,3 @@ * An array of OL tag properties and events.

export var olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['start']);
export const olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['start']);
/**

@@ -85,3 +77,3 @@ * An array of LI tag properties and events.

export var liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['value']);
export const liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['value']);
/**

@@ -93,3 +85,3 @@ * An array of A tag properties and events.

export var anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type']);
export const anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type']);
/**

@@ -101,3 +93,3 @@ * An array of BUTTON tag properties and events.

export var buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'type', 'value']);
export const buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'type', 'value']);
/**

@@ -109,3 +101,3 @@ * An array of INPUT tag properties and events.

export var inputProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['accept', 'alt', 'autoCapitalize', 'autoComplete', 'checked', 'dirname', 'form', 'height', 'inputMode', 'list', 'max', 'maxLength', 'min', 'multiple', 'pattern', 'placeholder', 'readOnly', 'required', 'src', 'step', 'size', 'type', 'value', 'width']);
export const inputProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['accept', 'alt', 'autoCapitalize', 'autoComplete', 'checked', 'dirname', 'form', 'height', 'inputMode', 'list', 'max', 'maxLength', 'min', 'multiple', 'pattern', 'placeholder', 'readOnly', 'required', 'src', 'step', 'size', 'type', 'value', 'width']);
/**

@@ -117,3 +109,3 @@ * An array of TEXTAREA tag properties and events.

export var textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['autoCapitalize', 'cols', 'dirname', 'form', 'maxLength', 'placeholder', 'readOnly', 'required', 'rows', 'wrap']);
export const textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['autoCapitalize', 'cols', 'dirname', 'form', 'maxLength', 'placeholder', 'readOnly', 'required', 'rows', 'wrap']);
/**

@@ -125,4 +117,4 @@ * An array of SELECT tag properties and events.

export var selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['form', 'multiple', 'required']);
export var optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['selected', 'value']);
export const selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['form', 'multiple', 'required']);
export const optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['selected', 'value']);
/**

@@ -134,3 +126,3 @@ * An array of TABLE tag properties and events.

export var tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['cellPadding', 'cellSpacing']);
export const tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['cellPadding', 'cellSpacing']);
/**

@@ -142,3 +134,3 @@ * An array of TR tag properties and events.

export var trProperties = htmlElementProperties;
export const trProperties = htmlElementProperties;
/**

@@ -150,3 +142,3 @@ * An array of TH tag properties and events.

export var thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['rowSpan', 'scope']);
export const thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['rowSpan', 'scope']);
/**

@@ -158,5 +150,5 @@ * An array of TD tag properties and events.

export var tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'headers', 'rowSpan', 'scope']);
export var colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);
export var colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);
export const tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'headers', 'rowSpan', 'scope']);
export const colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);
export const colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span']);
/**

@@ -168,3 +160,3 @@ * An array of FORM tag properties and events.

export var formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['acceptCharset', 'action', 'encType', 'encType', 'method', 'noValidate', 'target']);
export const formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['acceptCharset', 'action', 'encType', 'encType', 'method', 'noValidate', 'target']);
/**

@@ -176,3 +168,3 @@ * An array of IFRAME tag properties and events.

export var iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['allow', 'allowFullScreen', 'allowPaymentRequest', 'allowTransparency', 'csp', 'height', 'importance', 'referrerPolicy', 'sandbox', 'src', 'srcDoc', 'width']);
export const iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['allow', 'allowFullScreen', 'allowPaymentRequest', 'allowTransparency', 'csp', 'height', 'importance', 'referrerPolicy', 'sandbox', 'src', 'srcDoc', 'width']);
/**

@@ -184,3 +176,3 @@ * An array of IMAGE tag properties and events.

export var imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['alt', 'crossOrigin', 'height', 'src', 'srcSet', 'useMap', 'width']);
export const imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['alt', 'crossOrigin', 'height', 'src', 'srcSet', 'useMap', 'width']);
/**

@@ -190,3 +182,3 @@ * @deprecated Use imgProperties for img elements.

export var imageProperties = imgProperties;
export const imageProperties = imgProperties;
/**

@@ -198,3 +190,3 @@ * An array of DIV tag properties and events.

export var divProperties = htmlElementProperties;
export const divProperties = htmlElementProperties;
/**

@@ -223,10 +215,9 @@ * Gets native supported props for an html element provided the allowance set. Use one of the property

// We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797
var isArray = Array.isArray(allowedPropNames); // eslint-disable-next-line @typescript-eslint/no-explicit-any
const isArray = Array.isArray(allowedPropNames); // eslint-disable-next-line @typescript-eslint/no-explicit-any
var result = {};
var keys = Object.keys(props);
const result = {};
const keys = Object.keys(props);
for (var _i = 0, keys_2 = keys; _i < keys_2.length; _i++) {
var key = keys_2[_i];
var isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;
for (const key of keys) {
const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;

@@ -233,0 +224,0 @@ if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {

@@ -9,5 +9,5 @@ import { Space, Enter } from '@fluentui/keyboard-keys';

export function shouldPreventDefaultOnKeyDown(e) {
var key = e.key;
var target = e.target;
var matchesByKey = key === Space || key === Enter;
const key = e.key;
const target = e.target;
const matchesByKey = key === Space || key === Enter;

@@ -18,5 +18,5 @@ if ((target === null || target === void 0 ? void 0 : target.tagName) === 'A') {

var ignoredByTag = (target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT' || (target === null || target === void 0 ? void 0 : target.tagName) === 'TEXTAREA' || (target === null || target === void 0 ? void 0 : target.isContentEditable) === true;
const ignoredByTag = (target === null || target === void 0 ? void 0 : target.tagName) === 'INPUT' || (target === null || target === void 0 ? void 0 : target.tagName) === 'TEXTAREA' || (target === null || target === void 0 ? void 0 : target.isContentEditable) === true;
return matchesByKey && !ignoredByTag;
}
//# sourceMappingURL=shouldPreventDefaultOnKeyDown.js.map
{
"name": "@fluentui/react-utilities",
"version": "0.0.0-nightlya372ad979820211103.1",
"version": "0.0.0-nightlybc5ff01fb020211104.1",
"description": "A set of general React-specific utilities.",

@@ -40,3 +40,3 @@ "main": "lib-commonjs/index.js",

"dependencies": {
"@fluentui/keyboard-keys": "0.0.0-nightlya372ad979820211103.1",
"@fluentui/keyboard-keys": "0.0.0-nightlybc5ff01fb020211104.1",
"tslib": "^2.1.0"

@@ -43,0 +43,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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