@fluentui/react-utilities 0.0.0-nightly-20230317-0436.1 → 0.0.0-nightly-20230317-1454.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.swcrc +39 -0
- package/CHANGELOG.json +5 -5
- package/CHANGELOG.md +5 -5
- package/lib/compose/getSlots.js +6 -7
- package/lib/compose/getSlots.js.map +1 -1
- package/lib/compose/index.js +4 -4
- package/lib/compose/index.js.map +1 -1
- package/lib/compose/isResolvedShorthand.js +2 -2
- package/lib/compose/isResolvedShorthand.js.map +1 -1
- package/lib/compose/resolveShorthand.js +3 -3
- package/lib/compose/resolveShorthand.js.map +1 -1
- package/lib/compose/types.js +1 -1
- package/lib/compose/types.js.map +1 -1
- package/lib/events/index.js +1 -1
- package/lib/events/index.js.map +1 -1
- package/lib/events/mouseTouchHelpers.js +5 -4
- package/lib/events/mouseTouchHelpers.js.map +1 -1
- package/lib/hooks/index.js +12 -12
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useControllableState.js +7 -7
- package/lib/hooks/useControllableState.js.map +1 -1
- package/lib/hooks/useEventCallback.js +3 -3
- package/lib/hooks/useEventCallback.js.map +1 -1
- package/lib/hooks/useFirstMount.js +1 -1
- package/lib/hooks/useFirstMount.js.map +1 -1
- package/lib/hooks/useForceUpdate.js +1 -1
- package/lib/hooks/useForceUpdate.js.map +1 -1
- package/lib/hooks/useId.js +6 -6
- package/lib/hooks/useId.js.map +1 -1
- package/lib/hooks/useIsomorphicLayoutEffect.js +3 -4
- package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/lib/hooks/useMergedRefs.js +2 -2
- package/lib/hooks/useMergedRefs.js.map +1 -1
- package/lib/hooks/useOnClickOutside.js +20 -23
- package/lib/hooks/useOnClickOutside.js.map +1 -1
- package/lib/hooks/useOnScrollOutside.js +7 -7
- package/lib/hooks/useOnScrollOutside.js.map +1 -1
- package/lib/hooks/usePrevious.js +1 -1
- package/lib/hooks/usePrevious.js.map +1 -1
- package/lib/hooks/useScrollbarWidth.js +5 -5
- package/lib/hooks/useScrollbarWidth.js.map +1 -1
- package/lib/hooks/useTimeout.js +1 -1
- package/lib/hooks/useTimeout.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/index.js.map +1 -1
- package/lib/ssr/SSRContext.js +5 -6
- package/lib/ssr/SSRContext.js.map +1 -1
- package/lib/ssr/canUseDOM.js +2 -3
- package/lib/ssr/canUseDOM.js.map +1 -1
- package/lib/ssr/index.js +2 -2
- package/lib/ssr/index.js.map +1 -1
- package/lib/trigger/applyTriggerPropsToChildren.js +4 -4
- package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
- package/lib/trigger/getTriggerChild.js +2 -2
- package/lib/trigger/getTriggerChild.js.map +1 -1
- package/lib/trigger/index.js +4 -4
- package/lib/trigger/index.js.map +1 -1
- package/lib/trigger/isFluentTrigger.js +1 -0
- package/lib/trigger/isFluentTrigger.js.map +1 -1
- package/lib/trigger/types.js +1 -1
- package/lib/trigger/types.js.map +1 -1
- package/lib/utils/clamp.js +1 -2
- package/lib/utils/clamp.js.map +1 -1
- package/lib/utils/getNativeElementProps.js +4 -4
- package/lib/utils/getNativeElementProps.js.map +1 -1
- package/lib/utils/getRTLSafeKey.js +6 -7
- package/lib/utils/getRTLSafeKey.js.map +1 -1
- package/lib/utils/getReactCallbackName.js +3 -2
- package/lib/utils/getReactCallbackName.js.map +1 -1
- package/lib/utils/index.js +8 -8
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/isHTMLElement.js +2 -4
- package/lib/utils/isHTMLElement.js.map +1 -1
- package/lib/utils/isInteractiveHTMLElement.js +5 -5
- package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
- package/lib/utils/mergeCallbacks.js +3 -4
- package/lib/utils/mergeCallbacks.js.map +1 -1
- package/lib/utils/omit.js +1 -2
- package/lib/utils/omit.js.map +1 -1
- package/lib/utils/properties.js +28 -55
- package/lib/utils/properties.js.map +1 -1
- package/lib-commonjs/compose/getSlots.js +47 -55
- package/lib-commonjs/compose/getSlots.js.map +1 -1
- package/lib-commonjs/compose/index.js +8 -7
- package/lib-commonjs/compose/index.js.map +1 -1
- package/lib-commonjs/compose/isResolvedShorthand.js +9 -37
- package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
- package/lib-commonjs/compose/resolveShorthand.js +25 -32
- package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
- package/lib-commonjs/compose/types.js +5 -2
- package/lib-commonjs/compose/types.js.map +1 -1
- package/lib-commonjs/events/index.js +5 -4
- package/lib-commonjs/events/index.js.map +1 -1
- package/lib-commonjs/events/mouseTouchHelpers.js +40 -37
- package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
- package/lib-commonjs/hooks/index.js +16 -15
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useControllableState.js +63 -64
- package/lib-commonjs/hooks/useControllableState.js.map +1 -1
- package/lib-commonjs/hooks/useEventCallback.js +25 -31
- package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
- package/lib-commonjs/hooks/useFirstMount.js +15 -23
- package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
- package/lib-commonjs/hooks/useForceUpdate.js +9 -11
- package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
- package/lib-commonjs/hooks/useId.js +48 -47
- package/lib-commonjs/hooks/useId.js.map +1 -1
- package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js +10 -16
- package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
- package/lib-commonjs/hooks/useMergedRefs.js +25 -27
- package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
- package/lib-commonjs/hooks/useOnClickOutside.js +109 -115
- package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
- package/lib-commonjs/hooks/useOnScrollOutside.js +33 -36
- package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
- package/lib-commonjs/hooks/usePrevious.js +17 -15
- package/lib-commonjs/hooks/usePrevious.js.map +1 -1
- package/lib-commonjs/hooks/useScrollbarWidth.js +32 -32
- package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
- package/lib-commonjs/hooks/useTimeout.js +30 -30
- package/lib-commonjs/hooks/useTimeout.js.map +1 -1
- package/lib-commonjs/index.js +52 -214
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/ssr/SSRContext.js +56 -59
- package/lib-commonjs/ssr/SSRContext.js.map +1 -1
- package/lib-commonjs/ssr/canUseDOM.js +12 -12
- package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
- package/lib-commonjs/ssr/index.js +6 -5
- package/lib-commonjs/ssr/index.js.map +1 -1
- package/lib-commonjs/trigger/applyTriggerPropsToChildren.js +29 -31
- package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
- package/lib-commonjs/trigger/getTriggerChild.js +16 -36
- package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
- package/lib-commonjs/trigger/index.js +8 -7
- package/lib-commonjs/trigger/index.js.map +1 -1
- package/lib-commonjs/trigger/isFluentTrigger.js +10 -11
- package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
- package/lib-commonjs/trigger/types.js +5 -2
- package/lib-commonjs/trigger/types.js.map +1 -1
- package/lib-commonjs/utils/clamp.js +10 -9
- package/lib-commonjs/utils/clamp.js.map +1 -1
- package/lib-commonjs/utils/getNativeElementProps.js +54 -61
- package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
- package/lib-commonjs/utils/getRTLSafeKey.js +22 -21
- package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
- package/lib-commonjs/utils/getReactCallbackName.js +24 -24
- package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
- package/lib-commonjs/utils/index.js +12 -11
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/isHTMLElement.js +12 -12
- package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
- package/lib-commonjs/utils/isInteractiveHTMLElement.js +20 -24
- package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
- package/lib-commonjs/utils/mergeCallbacks.js +14 -13
- package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
- package/lib-commonjs/utils/omit.js +18 -17
- package/lib-commonjs/utils/omit.js.map +1 -1
- package/lib-commonjs/utils/properties.js +327 -223
- package/lib-commonjs/utils/properties.js.map +1 -1
- package/package.json +4 -4
@@ -1,40 +1,38 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
exports
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
Object.defineProperty(exports, "applyTriggerPropsToChildren", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>applyTriggerPropsToChildren
|
8
|
+
});
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _isFluentTrigger = require("./isFluentTrigger");
|
13
12
|
function applyTriggerPropsToChildren(children, triggerChildProps) {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
13
|
+
if (typeof children === "function") {
|
14
|
+
return children(triggerChildProps);
|
15
|
+
} else if (children) {
|
16
|
+
return cloneTriggerTree(children, triggerChildProps);
|
17
|
+
}
|
18
|
+
// Components in React should return either JSX elements or "null", otherwise React will throw:
|
19
|
+
// Nothing was returned from render.
|
20
|
+
// This usually means a return statement is missing. Or, to render nothing, return null.
|
21
|
+
return children || null;
|
23
22
|
}
|
24
|
-
exports.applyTriggerPropsToChildren = applyTriggerPropsToChildren;
|
25
23
|
/**
|
26
24
|
* Clones a React element tree, and applies the given props to the first grandchild that is not
|
27
25
|
* a FluentTriggerComponent or React Fragment (the same element returned by {@link getTriggerChild}).
|
28
|
-
*/
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
26
|
+
*/ function cloneTriggerTree(child, triggerProps) {
|
27
|
+
if (!/*#__PURE__*/ _react.isValidElement(child) || child.type === _react.Fragment) {
|
28
|
+
throw new Error("A trigger element must be a single element for this component. " + "Please ensure that you're not using React Fragments.");
|
29
|
+
}
|
30
|
+
if ((0, _isFluentTrigger.isFluentTrigger)(child)) {
|
31
|
+
const grandchild = cloneTriggerTree(child.props.children, triggerProps);
|
32
|
+
return /*#__PURE__*/ _react.cloneElement(child, undefined, grandchild);
|
33
|
+
} else {
|
34
|
+
return /*#__PURE__*/ _react.cloneElement(child, triggerProps);
|
35
|
+
}
|
36
|
+
} //# sourceMappingURL=applyTriggerPropsToChildren.js.map
|
37
|
+
|
40
38
|
//# sourceMappingURL=applyTriggerPropsToChildren.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/trigger/applyTriggerPropsToChildren.js"],"sourcesContent":["import * as React from \"react\";\nimport { isFluentTrigger } from \"./isFluentTrigger\";\n/**\n * @internal\n * resolve the trigger props to the children, either by calling the render function, or cloning with the new props.\n */\nexport function applyTriggerPropsToChildren(children, triggerChildProps) {\n if (typeof children === \"function\") {\n return children(triggerChildProps);\n } else if (children) {\n return cloneTriggerTree(children, triggerChildProps);\n }\n // Components in React should return either JSX elements or \"null\", otherwise React will throw:\n // Nothing was returned from render.\n // This usually means a return statement is missing. Or, to render nothing, return null.\n return children || null;\n}\n/**\n * Clones a React element tree, and applies the given props to the first grandchild that is not\n * a FluentTriggerComponent or React Fragment (the same element returned by {@link getTriggerChild}).\n */\nfunction cloneTriggerTree(child, triggerProps) {\n if (! /*#__PURE__*/React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error(\"A trigger element must be a single element for this component. \" + \"Please ensure that you're not using React Fragments.\");\n }\n if (isFluentTrigger(child)) {\n const grandchild = cloneTriggerTree(child.props.children, triggerProps);\n return /*#__PURE__*/React.cloneElement(child, undefined, grandchild);\n } else {\n return /*#__PURE__*/React.cloneElement(child, triggerProps);\n }\n}\n//# sourceMappingURL=applyTriggerPropsToChildren.js.map"],"names":["applyTriggerPropsToChildren","children","triggerChildProps","cloneTriggerTree","child","triggerProps","React","isValidElement","type","Fragment","Error","isFluentTrigger","grandchild","props","cloneElement","undefined"],"mappings":";;;;+BAMgBA;;aAAAA;;;6DANO;iCACS;AAKzB,SAASA,4BAA4BC,QAAQ,EAAEC,iBAAiB,EAAE;IACvE,IAAI,OAAOD,aAAa,YAAY;QAClC,OAAOA,SAASC;IAClB,OAAO,IAAID,UAAU;QACnB,OAAOE,iBAAiBF,UAAUC;IACpC,CAAC;IACD,+FAA+F;IAC/F,sCAAsC;IACtC,0FAA0F;IAC1F,OAAOD,YAAY,IAAI;AACzB;AACA;;;CAGC,GACD,SAASE,iBAAiBC,KAAK,EAAEC,YAAY,EAAE;IAC7C,IAAI,CAAE,WAAW,GAAEC,OAAMC,cAAc,CAACH,UAAUA,MAAMI,IAAI,KAAKF,OAAMG,QAAQ,EAAE;QAC/E,MAAM,IAAIC,MAAM,oEAAoE,wDAAwD;IAC9I,CAAC;IACD,IAAIC,IAAAA,gCAAe,EAACP,QAAQ;QAC1B,MAAMQ,aAAaT,iBAAiBC,MAAMS,KAAK,CAACZ,QAAQ,EAAEI;QAC1D,OAAO,WAAW,GAAEC,OAAMQ,YAAY,CAACV,OAAOW,WAAWH;IAC3D,OAAO;QACL,OAAO,WAAW,GAAEN,OAAMQ,YAAY,CAACV,OAAOC;IAChD,CAAC;AACH,EACA,uDAAuD"}
|
@@ -1,41 +1,21 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "getTriggerChild", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>getTriggerChild
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
/**
|
10
|
-
* @internal
|
11
|
-
* Gets the trigger element of a FluentTriggerComponent (such as Tooltip or MenuTrigger).
|
12
|
-
*
|
13
|
-
* In the case where the immediate child is itself a FluentTriggerComponent and/or React Fragment,
|
14
|
-
* it returns the first descendant that is _not_ a FluentTriggerComponent or Fragment.
|
15
|
-
* This allows multiple triggers to be stacked, and still apply their props to the actual trigger element.
|
16
|
-
*
|
17
|
-
* For example, the following returns `<div id="child" />`:
|
18
|
-
* ```jsx
|
19
|
-
* getTriggerChild(
|
20
|
-
* <Tooltip>
|
21
|
-
* <MenuTrigger>
|
22
|
-
* <div id="child" />
|
23
|
-
* </MenuTrigger>
|
24
|
-
* </Tooltip>
|
25
|
-
* );
|
26
|
-
* ```
|
27
|
-
*
|
28
|
-
* In the case where the immediate child is not a valid element,
|
29
|
-
* null is returned
|
30
|
-
*/
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _isFluentTrigger = require("./isFluentTrigger");
|
31
12
|
function getTriggerChild(children) {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
exports.getTriggerChild = getTriggerChild;
|
13
|
+
if (!/*#__PURE__*/ _react.isValidElement(children)) {
|
14
|
+
return null;
|
15
|
+
}
|
16
|
+
return (0, _isFluentTrigger.isFluentTrigger)(children) ? getTriggerChild(// FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method,
|
17
|
+
// but for some reason it's failing on build
|
18
|
+
children.props.children) : children;
|
19
|
+
} //# sourceMappingURL=getTriggerChild.js.map
|
20
|
+
|
41
21
|
//# sourceMappingURL=getTriggerChild.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/trigger/getTriggerChild.js"],"sourcesContent":["import * as React from \"react\";\nimport { isFluentTrigger } from \"./isFluentTrigger\";\n/**\n * @internal\n * Gets the trigger element of a FluentTriggerComponent (such as Tooltip or MenuTrigger).\n *\n * In the case where the immediate child is itself a FluentTriggerComponent and/or React Fragment,\n * it returns the first descendant that is _not_ a FluentTriggerComponent or Fragment.\n * This allows multiple triggers to be stacked, and still apply their props to the actual trigger element.\n *\n * For example, the following returns `<div id=\"child\" />`:\n * ```jsx\n * getTriggerChild(\n * <Tooltip>\n * <MenuTrigger>\n * <div id=\"child\" />\n * </MenuTrigger>\n * </Tooltip>\n * );\n * ```\n *\n * In the case where the immediate child is not a valid element,\n * null is returned\n */\nexport function getTriggerChild(children) {\n if (! /*#__PURE__*/React.isValidElement(children)) {\n return null;\n }\n return isFluentTrigger(children) ? getTriggerChild(\n // FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method,\n // but for some reason it's failing on build\n children.props.children) : children;\n}\n//# sourceMappingURL=getTriggerChild.js.map"],"names":["getTriggerChild","children","React","isValidElement","isFluentTrigger","props"],"mappings":";;;;+BAwBgBA;;aAAAA;;;6DAxBO;iCACS;AAuBzB,SAASA,gBAAgBC,QAAQ,EAAE;IACxC,IAAI,CAAE,WAAW,GAAEC,OAAMC,cAAc,CAACF,WAAW;QACjD,OAAO,IAAI;IACb,CAAC;IACD,OAAOG,IAAAA,gCAAe,EAACH,YAAYD,gBACnC,uFAAuF;IACvF,4CAA4C;IAC5CC,SAASI,KAAK,CAACJ,QAAQ,IAAIA,QAAQ;AACrC,EACA,2CAA2C"}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
const
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
6
|
+
_exportStar(require("./applyTriggerPropsToChildren"), exports);
|
7
|
+
_exportStar(require("./getTriggerChild"), exports);
|
8
|
+
_exportStar(require("./isFluentTrigger"), exports);
|
9
|
+
_exportStar(require("./types"), exports);
|
10
|
+
//# sourceMappingURL=index.js.map
|
11
|
+
|
11
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/trigger/index.js"],"sourcesContent":["export * from \"./applyTriggerPropsToChildren\";\nexport * from \"./getTriggerChild\";\nexport * from \"./isFluentTrigger\";\nexport * from \"./types\";\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
@@ -1,16 +1,15 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "isFluentTrigger", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>isFluentTrigger
|
5
8
|
});
|
6
|
-
|
7
|
-
|
8
|
-
* @internal
|
9
|
-
* Checks if a given element is a FluentUI trigger (e.g. `MenuTrigger` or `Tooltip`).
|
10
|
-
* See the {@link FluentTriggerComponent} type for more info.
|
11
|
-
*/
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
12
11
|
function isFluentTrigger(element) {
|
13
|
-
|
14
|
-
}
|
15
|
-
|
12
|
+
return Boolean(element.type.isFluentTriggerComponent);
|
13
|
+
} //# sourceMappingURL=isFluentTrigger.js.map
|
14
|
+
|
16
15
|
//# sourceMappingURL=isFluentTrigger.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/trigger/isFluentTrigger.js"],"sourcesContent":["import * as React from \"react\";\n/**\n * @internal\n * Checks if a given element is a FluentUI trigger (e.g. `MenuTrigger` or `Tooltip`).\n * See the {@link FluentTriggerComponent} type for more info.\n */\nexport function isFluentTrigger(element) {\n return Boolean(element.type.isFluentTriggerComponent);\n}\n//# sourceMappingURL=isFluentTrigger.js.map"],"names":["isFluentTrigger","element","Boolean","type","isFluentTriggerComponent"],"mappings":";;;;+BAMgBA;;aAAAA;;;6DANO;AAMhB,SAASA,gBAAgBC,OAAO,EAAE;IACvC,OAAOC,QAAQD,QAAQE,IAAI,CAACC,wBAAwB;AACtD,EACA,2CAA2C"}
|
@@ -1,6 +1,9 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
5
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
6
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
7
|
+
//# sourceMappingURL=types.js.map
|
8
|
+
|
6
9
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/trigger/types.js"],"sourcesContent":["import * as React from \"react\";\n//# sourceMappingURL=types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,iCAAiC"}
|
@@ -1,9 +1,3 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.clamp = void 0;
|
7
1
|
/**
|
8
2
|
* @internal
|
9
3
|
* Clamps `value` to a number between the min and max.
|
@@ -11,7 +5,14 @@ exports.clamp = void 0;
|
|
11
5
|
* @param value - the value to be clamped
|
12
6
|
* @param min - the lowest valid value
|
13
7
|
* @param max - the highest valid value
|
14
|
-
*/
|
15
|
-
|
16
|
-
|
8
|
+
*/ "use strict";
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
10
|
+
value: true
|
11
|
+
});
|
12
|
+
Object.defineProperty(exports, "clamp", {
|
13
|
+
enumerable: true,
|
14
|
+
get: ()=>clamp
|
15
|
+
});
|
16
|
+
const clamp = (value, min, max)=>Math.max(min, Math.min(max, value || 0)); //# sourceMappingURL=clamp.js.map
|
17
|
+
|
17
18
|
//# sourceMappingURL=clamp.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/utils/clamp.js"],"sourcesContent":["/**\n * @internal\n * Clamps `value` to a number between the min and max.\n *\n * @param value - the value to be clamped\n * @param min - the lowest valid value\n * @param max - the highest valid value\n */export const clamp = (value, min, max) => Math.max(min, Math.min(max, value || 0));\n//# sourceMappingURL=clamp.js.map"],"names":["clamp","value","min","max","Math"],"mappings":"AAAA;;;;;;;CAOC;;;;+BAAeA;;aAAAA;;AAAN,MAAMA,QAAQ,CAACC,OAAOC,KAAKC,MAAQC,KAAKD,GAAG,CAACD,KAAKE,KAAKF,GAAG,CAACC,KAAKF,SAAS,KAClF,iCAAiC"}
|
@@ -1,69 +1,62 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
getNativeElementProps: ()=>getNativeElementProps,
|
13
|
+
getPartitionedNativeProps: ()=>getPartitionedNativeProps
|
5
14
|
});
|
6
|
-
|
7
|
-
const
|
15
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
16
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
17
|
+
const _properties = require("./properties");
|
8
18
|
const nativeElementMap = {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
19
|
+
label: _properties.labelProperties,
|
20
|
+
audio: _properties.audioProperties,
|
21
|
+
video: _properties.videoProperties,
|
22
|
+
ol: _properties.olProperties,
|
23
|
+
li: _properties.liProperties,
|
24
|
+
a: _properties.anchorProperties,
|
25
|
+
button: _properties.buttonProperties,
|
26
|
+
input: _properties.inputProperties,
|
27
|
+
textarea: _properties.textAreaProperties,
|
28
|
+
select: _properties.selectProperties,
|
29
|
+
option: _properties.optionProperties,
|
30
|
+
table: _properties.tableProperties,
|
31
|
+
tr: _properties.trProperties,
|
32
|
+
th: _properties.thProperties,
|
33
|
+
td: _properties.tdProperties,
|
34
|
+
colGroup: _properties.colGroupProperties,
|
35
|
+
col: _properties.colProperties,
|
36
|
+
fieldset: _properties.fieldsetProperties,
|
37
|
+
form: _properties.formProperties,
|
38
|
+
iframe: _properties.iframeProperties,
|
39
|
+
img: _properties.imgProperties,
|
40
|
+
time: _properties.timeProperties,
|
41
|
+
dialog: _properties.dialogProperties
|
32
42
|
};
|
33
|
-
/**
|
34
|
-
* Given an element tagname and user props, filters the props to only allowed props for the given
|
35
|
-
* element type.
|
36
|
-
* @param tagName - Tag name (e.g. "div")
|
37
|
-
* @param props - Props object
|
38
|
-
* @param excludedPropNames - List of props to disallow
|
39
|
-
*/
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
41
43
|
function getNativeElementProps(tagName, props, excludedPropNames) {
|
42
|
-
|
43
|
-
|
44
|
-
|
44
|
+
const allowedPropNames = tagName && nativeElementMap[tagName] || _properties.htmlElementProperties;
|
45
|
+
allowedPropNames.as = 1;
|
46
|
+
return (0, _properties.getNativeProps)(props, allowedPropNames, excludedPropNames);
|
45
47
|
}
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
return {
|
61
|
-
root: {
|
62
|
-
style: props.style,
|
63
|
-
className: props.className
|
64
|
-
},
|
65
|
-
primary: getNativeElementProps(primarySlotTagName, props, [...(excludedPropNames || []), 'style', 'className'])
|
66
|
-
};
|
67
|
-
};
|
68
|
-
exports.getPartitionedNativeProps = getPartitionedNativeProps;
|
48
|
+
const getPartitionedNativeProps = ({ primarySlotTagName , props , excludedPropNames })=>{
|
49
|
+
return {
|
50
|
+
root: {
|
51
|
+
style: props.style,
|
52
|
+
className: props.className
|
53
|
+
},
|
54
|
+
primary: getNativeElementProps(primarySlotTagName, props, [
|
55
|
+
...excludedPropNames || [],
|
56
|
+
"style",
|
57
|
+
"className"
|
58
|
+
])
|
59
|
+
};
|
60
|
+
}; //# sourceMappingURL=getNativeElementProps.js.map
|
61
|
+
|
69
62
|
//# sourceMappingURL=getNativeElementProps.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/utils/getNativeElementProps.js"],"sourcesContent":["import * as React from \"react\";\nimport { labelProperties, audioProperties, videoProperties, olProperties, liProperties, anchorProperties, buttonProperties, inputProperties, textAreaProperties, selectProperties, optionProperties, tableProperties, trProperties, thProperties, tdProperties, colGroupProperties, colProperties, fieldsetProperties, formProperties, iframeProperties, imgProperties, htmlElementProperties, getNativeProps, timeProperties, dialogProperties } from \"./properties\";\nconst nativeElementMap = {\n label: labelProperties,\n audio: audioProperties,\n video: videoProperties,\n ol: olProperties,\n li: liProperties,\n a: anchorProperties,\n button: buttonProperties,\n input: inputProperties,\n textarea: textAreaProperties,\n select: selectProperties,\n option: optionProperties,\n table: tableProperties,\n tr: trProperties,\n th: thProperties,\n td: tdProperties,\n colGroup: colGroupProperties,\n col: colProperties,\n fieldset: fieldsetProperties,\n form: formProperties,\n iframe: iframeProperties,\n img: imgProperties,\n time: timeProperties,\n dialog: dialogProperties\n};\n/**\n * Given an element tagname and user props, filters the props to only allowed props for the given\n * element type.\n * @param tagName - Tag name (e.g. \"div\")\n * @param props - Props object\n * @param excludedPropNames - List of props to disallow\n */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps(tagName, props, excludedPropNames) {\n const allowedPropNames = tagName && nativeElementMap[tagName] || htmlElementProperties;\n allowedPropNames.as = 1;\n return getNativeProps(props, allowedPropNames, excludedPropNames);\n}\n/**\n * Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot.\n *\n * This function is only for use with components that have a primary slot other than `root`.\n * Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot.\n *\n * @returns An object containing the native props for the `root` and primary slots.\n */\nexport const getPartitionedNativeProps = ({\n primarySlotTagName,\n props,\n excludedPropNames\n}) => {\n return {\n root: {\n style: props.style,\n className: props.className\n },\n primary: getNativeElementProps(primarySlotTagName, props, [...(excludedPropNames || []), \"style\", \"className\"])\n };\n};\n//# sourceMappingURL=getNativeElementProps.js.map"],"names":["getNativeElementProps","getPartitionedNativeProps","nativeElementMap","label","labelProperties","audio","audioProperties","video","videoProperties","ol","olProperties","li","liProperties","a","anchorProperties","button","buttonProperties","input","inputProperties","textarea","textAreaProperties","select","selectProperties","option","optionProperties","table","tableProperties","tr","trProperties","th","thProperties","td","tdProperties","colGroup","colGroupProperties","col","colProperties","fieldset","fieldsetProperties","form","formProperties","iframe","iframeProperties","img","imgProperties","time","timeProperties","dialog","dialogProperties","tagName","props","excludedPropNames","allowedPropNames","htmlElementProperties","as","getNativeProps","primarySlotTagName","root","style","className","primary"],"mappings":";;;;;;;;;;;IAkCgBA,qBAAqB,MAArBA;IAaHC,yBAAyB,MAAzBA;;;6DA/CU;4BACga;AACvb,MAAMC,mBAAmB;IACvBC,OAAOC,2BAAe;IACtBC,OAAOC,2BAAe;IACtBC,OAAOC,2BAAe;IACtBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,GAAGC,4BAAgB;IACnBC,QAAQC,4BAAgB;IACxBC,OAAOC,2BAAe;IACtBC,UAAUC,8BAAkB;IAC5BC,QAAQC,4BAAgB;IACxBC,QAAQC,4BAAgB;IACxBC,OAAOC,2BAAe;IACtBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,UAAUC,8BAAkB;IAC5BC,KAAKC,yBAAa;IAClBC,UAAUC,8BAAkB;IAC5BC,MAAMC,0BAAc;IACpBC,QAAQC,4BAAgB;IACxBC,KAAKC,yBAAa;IAClBC,MAAMC,0BAAc;IACpBC,QAAQC,4BAAgB;AAC1B;AAQO,SAAShD,sBAAsBiD,OAAO,EAAEC,KAAK,EAAEC,iBAAiB,EAAE;IACvE,MAAMC,mBAAmBH,WAAW/C,gBAAgB,CAAC+C,QAAQ,IAAII,iCAAqB;IACtFD,iBAAiBE,EAAE,GAAG;IACtB,OAAOC,IAAAA,0BAAc,EAACL,OAAOE,kBAAkBD;AACjD;AASO,MAAMlD,4BAA4B,CAAC,EACxCuD,mBAAkB,EAClBN,MAAK,EACLC,kBAAiB,EAClB,GAAK;IACJ,OAAO;QACLM,MAAM;YACJC,OAAOR,MAAMQ,KAAK;YAClBC,WAAWT,MAAMS,SAAS;QAC5B;QACAC,SAAS5D,sBAAsBwD,oBAAoBN,OAAO;eAAKC,qBAAqB,EAAE;YAAG;YAAS;SAAY;IAChH;AACF,GACA,iDAAiD"}
|
@@ -1,27 +1,28 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.getRTLSafeKey = void 0;
|
7
1
|
/**
|
8
2
|
* @internal
|
9
3
|
* Finds and swaps a provided key for it's right to left format.
|
10
|
-
*/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
*/ "use strict";
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
Object.defineProperty(exports, "getRTLSafeKey", {
|
9
|
+
enumerable: true,
|
10
|
+
get: ()=>getRTLSafeKey
|
11
|
+
});
|
12
|
+
const getRTLSafeKey = (key, dir)=>{
|
13
|
+
if (dir === "rtl") {
|
14
|
+
switch(key){
|
15
|
+
case "ArrowLeft":
|
16
|
+
{
|
17
|
+
return "ArrowRight";
|
18
|
+
}
|
19
|
+
case "ArrowRight":
|
20
|
+
{
|
21
|
+
return "ArrowLeft";
|
22
|
+
}
|
21
23
|
}
|
22
24
|
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
exports.getRTLSafeKey = getRTLSafeKey;
|
25
|
+
return key;
|
26
|
+
}; //# sourceMappingURL=getRTLSafeKey.js.map
|
27
|
+
|
27
28
|
//# sourceMappingURL=getRTLSafeKey.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/utils/getRTLSafeKey.js"],"sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */export const getRTLSafeKey = (key, dir) => {\n if (dir === \"rtl\") {\n switch (key) {\n case \"ArrowLeft\":\n {\n return \"ArrowRight\";\n }\n case \"ArrowRight\":\n {\n return \"ArrowLeft\";\n }\n }\n }\n return key;\n};\n//# sourceMappingURL=getRTLSafeKey.js.map"],"names":["getRTLSafeKey","key","dir"],"mappings":"AAAA;;;CAGC;;;;+BAAeA;;aAAAA;;AAAN,MAAMA,gBAAgB,CAACC,KAAKC,MAAQ;IAC5C,IAAIA,QAAQ,OAAO;QACjB,OAAQD;YACN,KAAK;gBACH;oBACE,OAAO;gBACT;YACF,KAAK;gBACH;oBACE,OAAO;gBACT;QACJ;IACF,CAAC;IACD,OAAOA;AACT,GACA,yCAAyC"}
|
@@ -1,30 +1,30 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "getReactCallbackName", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>getReactCallbackName
|
5
8
|
});
|
6
|
-
|
7
|
-
|
8
|
-
* React.SyntheticEvent contains name of a callback that should be fired, this function returns it.
|
9
|
-
*
|
10
|
-
* Ideally, it should also distinguish regular and "capture" callbacks, but it's possible only with React 17 as
|
11
|
-
* ".eventPhase" there has proper value, see https://github.com/facebook/react/pull/19244. In React 16 all events
|
12
|
-
* are handled in bubble phase.
|
13
|
-
*/
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
14
11
|
function getReactCallbackName(event) {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
12
|
+
if (event._reactName) {
|
13
|
+
return event._reactName;
|
14
|
+
}
|
15
|
+
if (event.dispatchConfig) {
|
16
|
+
if (event.dispatchConfig.registrationName) {
|
17
|
+
return event.dispatchConfig.registrationName;
|
18
|
+
}
|
19
|
+
return event.dispatchConfig.phasedRegistrationNames.bubbled;
|
21
20
|
}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
}
|
29
|
-
|
21
|
+
if (process.env.NODE_ENV !== "production") {
|
22
|
+
// eslint-disable-next-line no-console
|
23
|
+
console.error([
|
24
|
+
'Passed React.SyntheticEvent does not contain ".dispatchConfig" or "._reactName".',
|
25
|
+
"This should not happen, please report it to https://github.com/microsoft/fluentui"
|
26
|
+
]);
|
27
|
+
}
|
28
|
+
} //# sourceMappingURL=getReactCallbackName.js.map
|
29
|
+
|
30
30
|
//# sourceMappingURL=getReactCallbackName.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../lib/utils/getReactCallbackName.js"],"sourcesContent":["import * as React from \"react\";\n/**\n * React.SyntheticEvent contains name of a callback that should be fired, this function returns it.\n *\n * Ideally, it should also distinguish regular and \"capture\" callbacks, but it's possible only with React 17 as\n * \".eventPhase\" there has proper value, see https://github.com/facebook/react/pull/19244. In React 16 all events\n * are handled in bubble phase.\n */\nexport function getReactCallbackName(event) {\n if (event._reactName) {\n return event._reactName;\n }\n if (event.dispatchConfig) {\n if (event.dispatchConfig.registrationName) {\n return event.dispatchConfig.registrationName;\n }\n return event.dispatchConfig.phasedRegistrationNames.bubbled;\n }\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.error(['Passed React.SyntheticEvent does not contain \".dispatchConfig\" or \"._reactName\".', \"This should not happen, please report it to https://github.com/microsoft/fluentui\"]);\n }\n}\n//# sourceMappingURL=getReactCallbackName.js.map"],"names":["getReactCallbackName","event","_reactName","dispatchConfig","registrationName","phasedRegistrationNames","bubbled","process","env","NODE_ENV","console","error"],"mappings":";;;;+BAQgBA;;aAAAA;;;6DARO;AAQhB,SAASA,qBAAqBC,KAAK,EAAE;IAC1C,IAAIA,MAAMC,UAAU,EAAE;QACpB,OAAOD,MAAMC,UAAU;IACzB,CAAC;IACD,IAAID,MAAME,cAAc,EAAE;QACxB,IAAIF,MAAME,cAAc,CAACC,gBAAgB,EAAE;YACzC,OAAOH,MAAME,cAAc,CAACC,gBAAgB;QAC9C,CAAC;QACD,OAAOH,MAAME,cAAc,CAACE,uBAAuB,CAACC,OAAO;IAC7D,CAAC;IACD,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,sCAAsC;QACtCC,QAAQC,KAAK,CAAC;YAAC;YAAoF;SAAoF;IACzL,CAAC;AACH,EACA,gDAAgD"}
|
@@ -1,15 +1,16 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
5
4
|
});
|
6
|
-
const
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
6
|
+
_exportStar(require("./clamp"), exports);
|
7
|
+
_exportStar(require("./getNativeElementProps"), exports);
|
8
|
+
_exportStar(require("./getRTLSafeKey"), exports);
|
9
|
+
_exportStar(require("./mergeCallbacks"), exports);
|
10
|
+
_exportStar(require("./omit"), exports);
|
11
|
+
_exportStar(require("./properties"), exports);
|
12
|
+
_exportStar(require("./isHTMLElement"), exports);
|
13
|
+
_exportStar(require("./isInteractiveHTMLElement"), exports);
|
14
|
+
//# sourceMappingURL=index.js.map
|
15
|
+
|
15
16
|
//# sourceMappingURL=index.js.map
|