@fluentui/react-utilities 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230321-0440.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.
Files changed (160) hide show
  1. package/CHANGELOG.json +5 -5
  2. package/CHANGELOG.md +5 -5
  3. package/lib/compose/getSlots.js +7 -6
  4. package/lib/compose/getSlots.js.map +1 -1
  5. package/lib/compose/index.js +4 -4
  6. package/lib/compose/index.js.map +1 -1
  7. package/lib/compose/isResolvedShorthand.js +2 -2
  8. package/lib/compose/isResolvedShorthand.js.map +1 -1
  9. package/lib/compose/resolveShorthand.js +3 -3
  10. package/lib/compose/resolveShorthand.js.map +1 -1
  11. package/lib/compose/types.js +1 -1
  12. package/lib/compose/types.js.map +1 -1
  13. package/lib/events/index.js +1 -1
  14. package/lib/events/index.js.map +1 -1
  15. package/lib/events/mouseTouchHelpers.js +4 -5
  16. package/lib/events/mouseTouchHelpers.js.map +1 -1
  17. package/lib/hooks/index.js +12 -12
  18. package/lib/hooks/index.js.map +1 -1
  19. package/lib/hooks/useControllableState.js +7 -7
  20. package/lib/hooks/useControllableState.js.map +1 -1
  21. package/lib/hooks/useEventCallback.js +3 -3
  22. package/lib/hooks/useEventCallback.js.map +1 -1
  23. package/lib/hooks/useFirstMount.js +1 -1
  24. package/lib/hooks/useFirstMount.js.map +1 -1
  25. package/lib/hooks/useForceUpdate.js +1 -1
  26. package/lib/hooks/useForceUpdate.js.map +1 -1
  27. package/lib/hooks/useId.js +6 -6
  28. package/lib/hooks/useId.js.map +1 -1
  29. package/lib/hooks/useIsomorphicLayoutEffect.js +4 -3
  30. package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  31. package/lib/hooks/useMergedRefs.js +2 -2
  32. package/lib/hooks/useMergedRefs.js.map +1 -1
  33. package/lib/hooks/useOnClickOutside.js +23 -20
  34. package/lib/hooks/useOnClickOutside.js.map +1 -1
  35. package/lib/hooks/useOnScrollOutside.js +7 -7
  36. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  37. package/lib/hooks/usePrevious.js +1 -1
  38. package/lib/hooks/usePrevious.js.map +1 -1
  39. package/lib/hooks/useScrollbarWidth.js +5 -5
  40. package/lib/hooks/useScrollbarWidth.js.map +1 -1
  41. package/lib/hooks/useTimeout.js +1 -1
  42. package/lib/hooks/useTimeout.js.map +1 -1
  43. package/lib/index.js +6 -6
  44. package/lib/index.js.map +1 -1
  45. package/lib/ssr/SSRContext.js +6 -5
  46. package/lib/ssr/SSRContext.js.map +1 -1
  47. package/lib/ssr/canUseDOM.js +3 -2
  48. package/lib/ssr/canUseDOM.js.map +1 -1
  49. package/lib/ssr/index.js +2 -2
  50. package/lib/ssr/index.js.map +1 -1
  51. package/lib/trigger/applyTriggerPropsToChildren.js +4 -4
  52. package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
  53. package/lib/trigger/getTriggerChild.js +2 -2
  54. package/lib/trigger/getTriggerChild.js.map +1 -1
  55. package/lib/trigger/index.js +4 -4
  56. package/lib/trigger/index.js.map +1 -1
  57. package/lib/trigger/isFluentTrigger.js +0 -1
  58. package/lib/trigger/isFluentTrigger.js.map +1 -1
  59. package/lib/trigger/types.js +1 -1
  60. package/lib/trigger/types.js.map +1 -1
  61. package/lib/utils/clamp.js +2 -1
  62. package/lib/utils/clamp.js.map +1 -1
  63. package/lib/utils/getNativeElementProps.js +4 -4
  64. package/lib/utils/getNativeElementProps.js.map +1 -1
  65. package/lib/utils/getRTLSafeKey.js +7 -6
  66. package/lib/utils/getRTLSafeKey.js.map +1 -1
  67. package/lib/utils/getReactCallbackName.js +2 -3
  68. package/lib/utils/getReactCallbackName.js.map +1 -1
  69. package/lib/utils/index.js +8 -8
  70. package/lib/utils/index.js.map +1 -1
  71. package/lib/utils/isHTMLElement.js +4 -2
  72. package/lib/utils/isHTMLElement.js.map +1 -1
  73. package/lib/utils/isInteractiveHTMLElement.js +5 -5
  74. package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
  75. package/lib/utils/mergeCallbacks.js +4 -3
  76. package/lib/utils/mergeCallbacks.js.map +1 -1
  77. package/lib/utils/omit.js +2 -1
  78. package/lib/utils/omit.js.map +1 -1
  79. package/lib/utils/properties.js +55 -28
  80. package/lib/utils/properties.js.map +1 -1
  81. package/lib-commonjs/compose/getSlots.js +55 -47
  82. package/lib-commonjs/compose/getSlots.js.map +1 -1
  83. package/lib-commonjs/compose/index.js +7 -8
  84. package/lib-commonjs/compose/index.js.map +1 -1
  85. package/lib-commonjs/compose/isResolvedShorthand.js +37 -9
  86. package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
  87. package/lib-commonjs/compose/resolveShorthand.js +32 -25
  88. package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
  89. package/lib-commonjs/compose/types.js +2 -5
  90. package/lib-commonjs/compose/types.js.map +1 -1
  91. package/lib-commonjs/events/index.js +4 -5
  92. package/lib-commonjs/events/index.js.map +1 -1
  93. package/lib-commonjs/events/mouseTouchHelpers.js +37 -40
  94. package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
  95. package/lib-commonjs/hooks/index.js +15 -16
  96. package/lib-commonjs/hooks/index.js.map +1 -1
  97. package/lib-commonjs/hooks/useControllableState.js +64 -63
  98. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  99. package/lib-commonjs/hooks/useEventCallback.js +31 -25
  100. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  101. package/lib-commonjs/hooks/useFirstMount.js +23 -15
  102. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  103. package/lib-commonjs/hooks/useForceUpdate.js +11 -9
  104. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  105. package/lib-commonjs/hooks/useId.js +47 -48
  106. package/lib-commonjs/hooks/useId.js.map +1 -1
  107. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js +16 -10
  108. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  109. package/lib-commonjs/hooks/useMergedRefs.js +27 -25
  110. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  111. package/lib-commonjs/hooks/useOnClickOutside.js +115 -109
  112. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  113. package/lib-commonjs/hooks/useOnScrollOutside.js +36 -33
  114. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  115. package/lib-commonjs/hooks/usePrevious.js +15 -17
  116. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  117. package/lib-commonjs/hooks/useScrollbarWidth.js +32 -32
  118. package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
  119. package/lib-commonjs/hooks/useTimeout.js +30 -30
  120. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  121. package/lib-commonjs/index.js +214 -52
  122. package/lib-commonjs/index.js.map +1 -1
  123. package/lib-commonjs/ssr/SSRContext.js +59 -56
  124. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  125. package/lib-commonjs/ssr/canUseDOM.js +12 -12
  126. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  127. package/lib-commonjs/ssr/index.js +5 -6
  128. package/lib-commonjs/ssr/index.js.map +1 -1
  129. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js +31 -29
  130. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
  131. package/lib-commonjs/trigger/getTriggerChild.js +36 -16
  132. package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
  133. package/lib-commonjs/trigger/index.js +7 -8
  134. package/lib-commonjs/trigger/index.js.map +1 -1
  135. package/lib-commonjs/trigger/isFluentTrigger.js +11 -10
  136. package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
  137. package/lib-commonjs/trigger/types.js +2 -5
  138. package/lib-commonjs/trigger/types.js.map +1 -1
  139. package/lib-commonjs/utils/clamp.js +9 -10
  140. package/lib-commonjs/utils/clamp.js.map +1 -1
  141. package/lib-commonjs/utils/getNativeElementProps.js +61 -54
  142. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  143. package/lib-commonjs/utils/getRTLSafeKey.js +21 -22
  144. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  145. package/lib-commonjs/utils/getReactCallbackName.js +24 -24
  146. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
  147. package/lib-commonjs/utils/index.js +11 -12
  148. package/lib-commonjs/utils/index.js.map +1 -1
  149. package/lib-commonjs/utils/isHTMLElement.js +12 -12
  150. package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
  151. package/lib-commonjs/utils/isInteractiveHTMLElement.js +24 -20
  152. package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
  153. package/lib-commonjs/utils/mergeCallbacks.js +13 -14
  154. package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
  155. package/lib-commonjs/utils/omit.js +17 -18
  156. package/lib-commonjs/utils/omit.js.map +1 -1
  157. package/lib-commonjs/utils/properties.js +223 -327
  158. package/lib-commonjs/utils/properties.js.map +1 -1
  159. package/package.json +5 -4
  160. package/.swcrc +0 -39
@@ -1 +1 @@
1
- {"version":3,"names":["React","isFluentTrigger","element","Boolean","type","isFluentTriggerComponent"],"sources":["../../src/trigger/isFluentTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport type { FluentTriggerComponent, TriggerProps } from './types';\n\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: React.ReactElement): element is React.ReactElement<TriggerProps> {\n return Boolean((element.type as FluentTriggerComponent).isFluentTriggerComponent);\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAGvB;;;;;AAKA,OAAO,SAASC,gBAAgBC,OAA2B,EAA+C;EACxG,OAAOC,OAAA,CAAQD,OAAC,CAAQE,IAAI,CAA4BC,wBAAwB;AAClF"}
1
+ {"version":3,"names":["isFluentTrigger","element","Boolean","type","isFluentTriggerComponent"],"sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/isFluentTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport type { FluentTriggerComponent, TriggerProps } from './types';\n\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: React.ReactElement): element is React.ReactElement<TriggerProps> {\n return Boolean((element.type as FluentTriggerComponent).isFluentTriggerComponent);\n}\n"],"mappings":"AAGA;;;;;AAKA,OAAM,SAAUA,eAAeA,CAACC,OAA2B;EACzD,OAAOC,OAAO,CAAED,OAAO,CAACE,IAA+B,CAACC,wBAAwB,CAAC;AACnF"}
@@ -1,2 +1,2 @@
1
- import * as React from "react";
1
+ export {};
2
2
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React"],"sources":["../../src/trigger/types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * Allows a component to be tagged as a FluentUI trigger component.\n *\n * Triggers are special-case components: they attach event listeners and other props on their child,\n * and use them to trigger another component to show. Examples include `MenuTrigger` and `Tooltip`.\n *\n * A component can be tagged as a trigger as follows:\n * ```ts\n * const MyComponent: React.FC<MyComponentProps> & FluentTriggerComponent = ...;\n *\n * MyComponent.isFluentTriggerComponent = true; // MUST also set this to true\n * ```\n */\nexport type FluentTriggerComponent = {\n isFluentTriggerComponent?: boolean;\n};\n\n/**\n * A trigger may have a children that could be either:\n * 1. A single element\n * 2. A render function that will receive properties and must return a valid element or null\n * 3. null or undefined\n */\nexport type TriggerProps<TriggerChildProps = unknown> = {\n children?: React.ReactElement | ((props: TriggerChildProps) => React.ReactElement | null) | null;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/trigger/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * Allows a component to be tagged as a FluentUI trigger component.\n *\n * Triggers are special-case components: they attach event listeners and other props on their child,\n * and use them to trigger another component to show. Examples include `MenuTrigger` and `Tooltip`.\n *\n * A component can be tagged as a trigger as follows:\n * ```ts\n * const MyComponent: React.FC<MyComponentProps> & FluentTriggerComponent = ...;\n *\n * MyComponent.isFluentTriggerComponent = true; // MUST also set this to true\n * ```\n */\nexport type FluentTriggerComponent = {\n isFluentTriggerComponent?: boolean;\n};\n\n/**\n * A trigger may have a children that could be either:\n * 1. A single element\n * 2. A render function that will receive properties and must return a valid element or null\n * 3. null or undefined\n */\nexport type TriggerProps<TriggerChildProps = unknown> = {\n children?: React.ReactElement | ((props: TriggerChildProps) => React.ReactElement | null) | null;\n};\n"]}
@@ -5,5 +5,6 @@
5
5
  * @param value - the value to be clamped
6
6
  * @param min - the lowest valid value
7
7
  * @param max - the highest valid value
8
- */export const clamp = (value, min, max) => Math.max(min, Math.min(max, value || 0));
8
+ */
9
+ export const clamp = (value, min, max) => Math.max(min, Math.min(max, value || 0));
9
10
  //# sourceMappingURL=clamp.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["clamp","value","min","max","Math"],"sources":["../../src/utils/clamp.ts"],"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 */\nexport const clamp = (value: number, min: number, max: number): number => Math.max(min, Math.min(max, value || 0));\n"],"mappings":"AAAA;;;;;;;GAQA,OAAO,MAAMA,KAAA,GAAQA,CAACC,KAAA,EAAeC,GAAA,EAAaC,GAAA,KAAwBC,IAAA,CAAKD,GAAG,CAACD,GAAA,EAAKE,IAAA,CAAKF,GAAG,CAACC,GAAA,EAAKF,KAAA,IAAS"}
1
+ {"version":3,"file":"clamp.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/clamp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,GAAW,EAAE,GAAW,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC","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 */\nexport const clamp = (value: number, min: number, max: number): number => Math.max(min, Math.min(max, value || 0));\n"]}
@@ -1,5 +1,4 @@
1
- import * as React from "react";
2
- import { 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";
1
+ import { 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';
3
2
  const nativeElementMap = {
4
3
  label: labelProperties,
5
4
  audio: audioProperties,
@@ -31,7 +30,8 @@ const nativeElementMap = {
31
30
  * @param tagName - Tag name (e.g. "div")
32
31
  * @param props - Props object
33
32
  * @param excludedPropNames - List of props to disallow
34
- */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ */
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
35
  export function getNativeElementProps(tagName, props, excludedPropNames) {
36
36
  const allowedPropNames = tagName && nativeElementMap[tagName] || htmlElementProperties;
37
37
  allowedPropNames.as = 1;
@@ -55,7 +55,7 @@ export const getPartitionedNativeProps = ({
55
55
  style: props.style,
56
56
  className: props.className
57
57
  },
58
- primary: getNativeElementProps(primarySlotTagName, props, [...(excludedPropNames || []), "style", "className"])
58
+ primary: getNativeElementProps(primarySlotTagName, props, [...(excludedPropNames || []), 'style', 'className'])
59
59
  };
60
60
  };
61
61
  //# sourceMappingURL=getNativeElementProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","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","nativeElementMap","label","audio","video","ol","li","a","button","input","textarea","select","option","table","tr","th","td","colGroup","col","fieldset","form","iframe","img","time","dialog","getNativeElementProps","tagName","props","excludedPropNames","allowedPropNames","as","getPartitionedNativeProps","primarySlotTagName","root","style","className","primary"],"sources":["../../src/utils/getNativeElementProps.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n labelProperties,\n audioProperties,\n videoProperties,\n olProperties,\n liProperties,\n anchorProperties,\n buttonProperties,\n inputProperties,\n textAreaProperties,\n selectProperties,\n optionProperties,\n tableProperties,\n trProperties,\n thProperties,\n tdProperties,\n colGroupProperties,\n colProperties,\n fieldsetProperties,\n formProperties,\n iframeProperties,\n imgProperties,\n htmlElementProperties,\n getNativeProps,\n timeProperties,\n dialogProperties,\n} from './properties';\n\nconst nativeElementMap: Record<string, Record<string, number>> = {\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/**\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 */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(\n tagName: string,\n props: {},\n excludedPropNames?: string[],\n): TAttributes {\n const allowedPropNames = (tagName && nativeElementMap[tagName]) || htmlElementProperties;\n allowedPropNames.as = 1;\n\n return getNativeProps(props, allowedPropNames, excludedPropNames);\n}\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 Props extends Pick<React.HTMLAttributes<HTMLElement>, 'style' | 'className'>,\n ExcludedPropKeys extends Extract<keyof Props, string> = never,\n>({\n primarySlotTagName,\n props,\n excludedPropNames,\n}: {\n /** The primary slot's element type (e.g. 'div') */\n primarySlotTagName: keyof JSX.IntrinsicElements;\n\n /** The component's props object */\n props: Props;\n\n /** List of native props to exclude from the returned value */\n excludedPropNames?: ExcludedPropKeys[];\n}) => {\n return {\n root: { style: props.style, className: props.className },\n primary: getNativeElementProps<Omit<Props, ExcludedPropKeys>>(primarySlotTagName, props, [\n ...(excludedPropNames || []),\n 'style',\n 'className',\n ]),\n };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,eAAe,EACfC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,kBAAkB,EAClBC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,kBAAkB,EAClBC,aAAa,EACbC,kBAAkB,EAClBC,cAAc,EACdC,gBAAgB,EAChBC,aAAa,EACbC,qBAAqB,EACrBC,cAAc,EACdC,cAAc,EACdC,gBAAgB,QACX;AAEP,MAAMC,gBAAA,GAA2D;EAC/DC,KAAA,EAAO1B,eAAA;EACP2B,KAAA,EAAO1B,eAAA;EACP2B,KAAA,EAAO1B,eAAA;EACP2B,EAAA,EAAI1B,YAAA;EACJ2B,EAAA,EAAI1B,YAAA;EACJ2B,CAAA,EAAG1B,gBAAA;EACH2B,MAAA,EAAQ1B,gBAAA;EACR2B,KAAA,EAAO1B,eAAA;EACP2B,QAAA,EAAU1B,kBAAA;EACV2B,MAAA,EAAQ1B,gBAAA;EACR2B,MAAA,EAAQ1B,gBAAA;EACR2B,KAAA,EAAO1B,eAAA;EACP2B,EAAA,EAAI1B,YAAA;EACJ2B,EAAA,EAAI1B,YAAA;EACJ2B,EAAA,EAAI1B,YAAA;EACJ2B,QAAA,EAAU1B,kBAAA;EACV2B,GAAA,EAAK1B,aAAA;EACL2B,QAAA,EAAU1B,kBAAA;EACV2B,IAAA,EAAM1B,cAAA;EACN2B,MAAA,EAAQ1B,gBAAA;EACR2B,GAAA,EAAK1B,aAAA;EACL2B,IAAA,EAAMxB,cAAA;EACNyB,MAAA,EAAQxB;AACV;AAEA;;;;;;GAAA,CAOA;AACA,OAAO,SAASyB,sBACdC,OAAe,EACfC,KAAS,EACTC,iBAA4B,EACf;EACb,MAAMC,gBAAA,GAAmBH,OAAC,IAAWzB,gBAAgB,CAACyB,OAAA,CAAQ,IAAK7B,qBAAA;EACnEgC,gBAAA,CAAiBC,EAAE,GAAG;EAEtB,OAAOhC,cAAA,CAAe6B,KAAA,EAAOE,gBAAA,EAAkBD,iBAAA;AACjD;AAEA;;;;;;;;AAQA,OAAO,MAAMG,yBAAA,GAA4BA,CAGvC;EACAC,kBAAA;EACAL,KAAA;EACAC;AAAiB,CAUlB,KAAK;EACJ,OAAO;IACLK,IAAA,EAAM;MAAEC,KAAA,EAAOP,KAAA,CAAMO,KAAK;MAAEC,SAAA,EAAWR,KAAA,CAAMQ;IAAU;IACvDC,OAAA,EAASX,qBAAA,CAAqDO,kBAAA,EAAoBL,KAAA,EAAO,C,IACnFC,iBAAA,IAAqB,EAAE,GAC3B,SACA,YACD;EACH;AACF"}
1
+ {"version":3,"names":["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","nativeElementMap","label","audio","video","ol","li","a","button","input","textarea","select","option","table","tr","th","td","colGroup","col","fieldset","form","iframe","img","time","dialog","getNativeElementProps","tagName","props","excludedPropNames","allowedPropNames","as","getPartitionedNativeProps","primarySlotTagName","root","style","className","primary"],"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/getNativeElementProps.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n labelProperties,\n audioProperties,\n videoProperties,\n olProperties,\n liProperties,\n anchorProperties,\n buttonProperties,\n inputProperties,\n textAreaProperties,\n selectProperties,\n optionProperties,\n tableProperties,\n trProperties,\n thProperties,\n tdProperties,\n colGroupProperties,\n colProperties,\n fieldsetProperties,\n formProperties,\n iframeProperties,\n imgProperties,\n htmlElementProperties,\n getNativeProps,\n timeProperties,\n dialogProperties,\n} from './properties';\n\nconst nativeElementMap: Record<string, Record<string, number>> = {\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/**\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 */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(\n tagName: string,\n props: {},\n excludedPropNames?: string[],\n): TAttributes {\n const allowedPropNames = (tagName && nativeElementMap[tagName]) || htmlElementProperties;\n allowedPropNames.as = 1;\n\n return getNativeProps(props, allowedPropNames, excludedPropNames);\n}\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 Props extends Pick<React.HTMLAttributes<HTMLElement>, 'style' | 'className'>,\n ExcludedPropKeys extends Extract<keyof Props, string> = never,\n>({\n primarySlotTagName,\n props,\n excludedPropNames,\n}: {\n /** The primary slot's element type (e.g. 'div') */\n primarySlotTagName: keyof JSX.IntrinsicElements;\n\n /** The component's props object */\n props: Props;\n\n /** List of native props to exclude from the returned value */\n excludedPropNames?: ExcludedPropKeys[];\n}) => {\n return {\n root: { style: props.style, className: props.className },\n primary: getNativeElementProps<Omit<Props, ExcludedPropKeys>>(primarySlotTagName, props, [\n ...(excludedPropNames || []),\n 'style',\n 'className',\n ]),\n };\n};\n"],"mappings":"AACA,SACEA,eAAe,EACfC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,kBAAkB,EAClBC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,YAAY,EACZC,kBAAkB,EAClBC,aAAa,EACbC,kBAAkB,EAClBC,cAAc,EACdC,gBAAgB,EAChBC,aAAa,EACbC,qBAAqB,EACrBC,cAAc,EACdC,cAAc,EACdC,gBAAgB,QACX,cAAc;AAErB,MAAMC,gBAAgB,GAA2C;EAC/DC,KAAK,EAAE1B,eAAe;EACtB2B,KAAK,EAAE1B,eAAe;EACtB2B,KAAK,EAAE1B,eAAe;EACtB2B,EAAE,EAAE1B,YAAY;EAChB2B,EAAE,EAAE1B,YAAY;EAChB2B,CAAC,EAAE1B,gBAAgB;EACnB2B,MAAM,EAAE1B,gBAAgB;EACxB2B,KAAK,EAAE1B,eAAe;EACtB2B,QAAQ,EAAE1B,kBAAkB;EAC5B2B,MAAM,EAAE1B,gBAAgB;EACxB2B,MAAM,EAAE1B,gBAAgB;EACxB2B,KAAK,EAAE1B,eAAe;EACtB2B,EAAE,EAAE1B,YAAY;EAChB2B,EAAE,EAAE1B,YAAY;EAChB2B,EAAE,EAAE1B,YAAY;EAChB2B,QAAQ,EAAE1B,kBAAkB;EAC5B2B,GAAG,EAAE1B,aAAa;EAClB2B,QAAQ,EAAE1B,kBAAkB;EAC5B2B,IAAI,EAAE1B,cAAc;EACpB2B,MAAM,EAAE1B,gBAAgB;EACxB2B,GAAG,EAAE1B,aAAa;EAClB2B,IAAI,EAAExB,cAAc;EACpByB,MAAM,EAAExB;CACT;AAED;;;;;;;AAOA;AACA,OAAM,SAAUyB,qBAAqBA,CACnCC,OAAe,EACfC,KAAS,EACTC,iBAA4B;EAE5B,MAAMC,gBAAgB,GAAIH,OAAO,IAAIzB,gBAAgB,CAACyB,OAAO,CAAC,IAAK7B,qBAAqB;EACxFgC,gBAAgB,CAACC,EAAE,GAAG,CAAC;EAEvB,OAAOhC,cAAc,CAAC6B,KAAK,EAAEE,gBAAgB,EAAED,iBAAiB,CAAC;AACnE;AAEA;;;;;;;;AAQA,OAAO,MAAMG,yBAAyB,GAAGA,CAGvC;EACAC,kBAAkB;EAClBL,KAAK;EACLC;AAAiB,CAUlB,KAAI;EACH,OAAO;IACLK,IAAI,EAAE;MAAEC,KAAK,EAAEP,KAAK,CAACO,KAAK;MAAEC,SAAS,EAAER,KAAK,CAACQ;IAAS,CAAE;IACxDC,OAAO,EAAEX,qBAAqB,CAAgCO,kBAAkB,EAAEL,KAAK,EAAE,CACvF,IAAIC,iBAAiB,IAAI,EAAE,CAAC,EAC5B,OAAO,EACP,WAAW,CACZ;GACF;AACH,CAAC"}
@@ -1,16 +1,17 @@
1
1
  /**
2
2
  * @internal
3
3
  * Finds and swaps a provided key for it's right to left format.
4
- */export const getRTLSafeKey = (key, dir) => {
5
- if (dir === "rtl") {
4
+ */
5
+ export const getRTLSafeKey = (key, dir) => {
6
+ if (dir === 'rtl') {
6
7
  switch (key) {
7
- case "ArrowLeft":
8
+ case 'ArrowLeft':
8
9
  {
9
- return "ArrowRight";
10
+ return 'ArrowRight';
10
11
  }
11
- case "ArrowRight":
12
+ case 'ArrowRight':
12
13
  {
13
- return "ArrowLeft";
14
+ return 'ArrowLeft';
14
15
  }
15
16
  }
16
17
  }
@@ -1 +1 @@
1
- {"version":3,"names":["getRTLSafeKey","key","dir"],"sources":["../../src/utils/getRTLSafeKey.ts"],"sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */\nexport const getRTLSafeKey = (key: string, dir: 'ltr' | 'rtl') => {\n if (dir === 'rtl') {\n switch (key) {\n case 'ArrowLeft': {\n return 'ArrowRight';\n }\n\n case 'ArrowRight': {\n return 'ArrowLeft';\n }\n }\n }\n\n return key;\n};\n"],"mappings":"AAAA;;;GAIA,OAAO,MAAMA,aAAA,GAAgBA,CAACC,GAAA,EAAaC,GAAA,KAAuB;EAChE,IAAIA,GAAA,KAAQ,OAAO;IACjB,QAAQD,GAAA;MACN,KAAK;QAAa;UAChB,OAAO;QACT;MAEA,KAAK;QAAc;UACjB,OAAO;QACT;IAAA;EAEJ;EAEA,OAAOA,GAAA;AACT"}
1
+ {"version":3,"names":["getRTLSafeKey","key","dir"],"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/getRTLSafeKey.ts"],"sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */\nexport const getRTLSafeKey = (key: string, dir: 'ltr' | 'rtl') => {\n if (dir === 'rtl') {\n switch (key) {\n case 'ArrowLeft': {\n return 'ArrowRight';\n }\n\n case 'ArrowRight': {\n return 'ArrowLeft';\n }\n }\n }\n\n return key;\n};\n"],"mappings":"AAAA;;;;AAIA,OAAO,MAAMA,aAAa,GAAGA,CAACC,GAAW,EAAEC,GAAkB,KAAI;EAC/D,IAAIA,GAAG,KAAK,KAAK,EAAE;IACjB,QAAQD,GAAG;MACT,KAAK,WAAW;QAAE;UAChB,OAAO,YAAY;;MAGrB,KAAK,YAAY;QAAE;UACjB,OAAO,WAAW;;IACnB;;EAIL,OAAOA,GAAG;AACZ,CAAC"}
@@ -1,4 +1,3 @@
1
- import * as React from "react";
2
1
  /**
3
2
  * React.SyntheticEvent contains name of a callback that should be fired, this function returns it.
4
3
  *
@@ -16,9 +15,9 @@ export function getReactCallbackName(event) {
16
15
  }
17
16
  return event.dispatchConfig.phasedRegistrationNames.bubbled;
18
17
  }
19
- if (process.env.NODE_ENV !== "production") {
18
+ if (process.env.NODE_ENV !== 'production') {
20
19
  // eslint-disable-next-line no-console
21
- console.error(['Passed React.SyntheticEvent does not contain ".dispatchConfig" or "._reactName".', "This should not happen, please report it to https://github.com/microsoft/fluentui"]);
20
+ console.error(['Passed React.SyntheticEvent does not contain ".dispatchConfig" or "._reactName".', 'This should not happen, please report it to https://github.com/microsoft/fluentui']);
22
21
  }
23
22
  }
24
23
  //# sourceMappingURL=getReactCallbackName.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getReactCallbackName","event","_reactName","dispatchConfig","registrationName","phasedRegistrationNames","bubbled","process","env","NODE_ENV","console","error"],"sources":["../../src/utils/getReactCallbackName.ts"],"sourcesContent":["import * as React from 'react';\n\ninterface ReactSyntheticEvent extends React.SyntheticEvent<unknown> {\n // React 17/18\n // See https://github.com/facebook/react/pull/19236\n _reactName?: string;\n\n // React 16\n dispatchConfig?: {\n registrationName: string;\n phasedRegistrationNames: {\n bubbled: string;\n captured: string;\n };\n };\n}\n\ntype NonUndefined<A> = A extends undefined ? never : A;\ntype FunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends Function ? K : never;\n}[keyof T];\n\nexport type ReactCallbackName = FunctionKeys<React.DOMAttributes<unknown>>;\n\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: ReactSyntheticEvent): ReactCallbackName | undefined {\n if (event._reactName) {\n return event._reactName as ReactCallbackName;\n }\n\n if (event.dispatchConfig) {\n if (event.dispatchConfig.registrationName) {\n return event.dispatchConfig.registrationName as ReactCallbackName;\n }\n\n return event.dispatchConfig.phasedRegistrationNames.bubbled as ReactCallbackName;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error([\n 'Passed React.SyntheticEvent does not contain \".dispatchConfig\" or \"._reactName\".',\n 'This should not happen, please report it to https://github.com/microsoft/fluentui',\n ]);\n }\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAwBvB;;;;;;;AAOA,OAAO,SAASC,qBAAqBC,KAA0B,EAAiC;EAC9F,IAAIA,KAAA,CAAMC,UAAU,EAAE;IACpB,OAAOD,KAAA,CAAMC,UAAU;EACzB;EAEA,IAAID,KAAA,CAAME,cAAc,EAAE;IACxB,IAAIF,KAAA,CAAME,cAAc,CAACC,gBAAgB,EAAE;MACzC,OAAOH,KAAA,CAAME,cAAc,CAACC,gBAAgB;IAC9C;IAEA,OAAOH,KAAA,CAAME,cAAc,CAACE,uBAAuB,CAACC,OAAO;EAC7D;EAEA,IAAIC,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzC;IACAC,OAAA,CAAQC,KAAK,CAAC,CACZ,oFACA,oFACD;EACH;AACF"}
1
+ {"version":3,"names":["getReactCallbackName","event","_reactName","dispatchConfig","registrationName","phasedRegistrationNames","bubbled","process","env","NODE_ENV","console","error"],"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/getReactCallbackName.ts"],"sourcesContent":["import * as React from 'react';\n\ninterface ReactSyntheticEvent extends React.SyntheticEvent<unknown> {\n // React 17/18\n // See https://github.com/facebook/react/pull/19236\n _reactName?: string;\n\n // React 16\n dispatchConfig?: {\n registrationName: string;\n phasedRegistrationNames: {\n bubbled: string;\n captured: string;\n };\n };\n}\n\ntype NonUndefined<A> = A extends undefined ? never : A;\ntype FunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends Function ? K : never;\n}[keyof T];\n\nexport type ReactCallbackName = FunctionKeys<React.DOMAttributes<unknown>>;\n\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: ReactSyntheticEvent): ReactCallbackName | undefined {\n if (event._reactName) {\n return event._reactName as ReactCallbackName;\n }\n\n if (event.dispatchConfig) {\n if (event.dispatchConfig.registrationName) {\n return event.dispatchConfig.registrationName as ReactCallbackName;\n }\n\n return event.dispatchConfig.phasedRegistrationNames.bubbled as ReactCallbackName;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error([\n 'Passed React.SyntheticEvent does not contain \".dispatchConfig\" or \"._reactName\".',\n 'This should not happen, please report it to https://github.com/microsoft/fluentui',\n ]);\n }\n}\n"],"mappings":"AAwBA;;;;;;;AAOA,OAAM,SAAUA,oBAAoBA,CAACC,KAA0B;EAC7D,IAAIA,KAAK,CAACC,UAAU,EAAE;IACpB,OAAOD,KAAK,CAACC,UAA+B;;EAG9C,IAAID,KAAK,CAACE,cAAc,EAAE;IACxB,IAAIF,KAAK,CAACE,cAAc,CAACC,gBAAgB,EAAE;MACzC,OAAOH,KAAK,CAACE,cAAc,CAACC,gBAAqC;;IAGnE,OAAOH,KAAK,CAACE,cAAc,CAACE,uBAAuB,CAACC,OAA4B;;EAGlF,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC;IACAC,OAAO,CAACC,KAAK,CAAC,CACZ,kFAAkF,EAClF,mFAAmF,CACpF,CAAC;;AAEN"}
@@ -1,9 +1,9 @@
1
- export * from "./clamp";
2
- export * from "./getNativeElementProps";
3
- export * from "./getRTLSafeKey";
4
- export * from "./mergeCallbacks";
5
- export * from "./omit";
6
- export * from "./properties";
7
- export * from "./isHTMLElement";
8
- export * from "./isInteractiveHTMLElement";
1
+ export * from './clamp';
2
+ export * from './getNativeElementProps';
3
+ export * from './getRTLSafeKey';
4
+ export * from './mergeCallbacks';
5
+ export * from './omit';
6
+ export * from './properties';
7
+ export * from './isHTMLElement';
8
+ export * from './isInteractiveHTMLElement';
9
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './clamp';\nexport * from './getNativeElementProps';\nexport * from './getRTLSafeKey';\nexport * from './mergeCallbacks';\nexport * from './omit';\nexport * from './properties';\nexport * from './isHTMLElement';\nexport * from './isInteractiveHTMLElement';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './clamp';\nexport * from './getNativeElementProps';\nexport * from './getRTLSafeKey';\nexport * from './mergeCallbacks';\nexport * from './omit';\nexport * from './properties';\nexport * from './isHTMLElement';\nexport * from './isInteractiveHTMLElement';\n"]}
@@ -11,8 +11,10 @@
11
11
  * isHTMLElement(event.target, {constructorName: 'HTMLInputElement'}) && event.target.value // some value
12
12
  * ```
13
13
  *
14
- */export function isHTMLElement(element, options) {
14
+ */
15
+ export function isHTMLElement(element, options) {
16
+ var _a, _b;
15
17
  const typedElement = element;
16
- return Boolean(typedElement?.ownerDocument?.defaultView && typedElement instanceof typedElement.ownerDocument.defaultView[options?.constructorName ?? "HTMLElement"]);
18
+ return Boolean(((_a = typedElement === null || typedElement === void 0 ? void 0 : typedElement.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_b = options === null || options === void 0 ? void 0 : options.constructorName) !== null && _b !== void 0 ? _b : 'HTMLElement']);
17
19
  }
18
20
  //# sourceMappingURL=isHTMLElement.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["isHTMLElement","element","options","typedElement","Boolean","ownerDocument","defaultView","constructorName"],"sources":["../../src/utils/isHTMLElement.ts"],"sourcesContent":["/**\n * Verifies if a given node is an HTMLElement,\n * this method works seamlessly with frames and elements from different documents\n *\n * This is preferred over simply using `instanceof`.\n * Since `instanceof` might be problematic while operating with [multiple realms](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms)\n *\n * @example\n * ```ts\n * isHTMLElement(event.target) && event.target.focus()\n * isHTMLElement(event.target, {constructorName: 'HTMLInputElement'}) && event.target.value // some value\n * ```\n *\n */\nexport function isHTMLElement<ConstructorName extends HTMLElementConstructorName = 'HTMLElement'>(\n element?: unknown,\n options?: {\n /**\n * Can be used to provide a custom constructor instead of `HTMLElement`,\n * Like `HTMLInputElement` for example.\n */\n constructorName?: ConstructorName;\n },\n): element is InstanceType<(typeof globalThis)[ConstructorName]> {\n const typedElement = element as Node | null | undefined;\n return Boolean(\n typedElement?.ownerDocument?.defaultView &&\n typedElement instanceof typedElement.ownerDocument.defaultView[options?.constructorName ?? 'HTMLElement'],\n );\n}\n\n/**\n * @internal\n */\nexport type HTMLElementConstructorName =\n | 'HTMLElement'\n | 'HTMLAnchorElement'\n | 'HTMLAreaElement'\n | 'HTMLAudioElement'\n | 'HTMLBaseElement'\n | 'HTMLBodyElement'\n | 'HTMLBRElement'\n | 'HTMLButtonElement'\n | 'HTMLCanvasElement'\n | 'HTMLDataElement'\n | 'HTMLDataListElement'\n | 'HTMLDetailsElement'\n | 'HTMLDialogElement'\n | 'HTMLDivElement'\n | 'HTMLDListElement'\n | 'HTMLEmbedElement'\n | 'HTMLFieldSetElement'\n | 'HTMLFormElement'\n | 'HTMLHeadingElement'\n | 'HTMLHeadElement'\n | 'HTMLHRElement'\n | 'HTMLHtmlElement'\n | 'HTMLIFrameElement'\n | 'HTMLImageElement'\n | 'HTMLInputElement'\n | 'HTMLModElement'\n | 'HTMLLabelElement'\n | 'HTMLLegendElement'\n | 'HTMLLIElement'\n | 'HTMLLinkElement'\n | 'HTMLMapElement'\n | 'HTMLMetaElement'\n | 'HTMLMeterElement'\n | 'HTMLObjectElement'\n | 'HTMLOListElement'\n | 'HTMLOptGroupElement'\n | 'HTMLOptionElement'\n | 'HTMLOutputElement'\n | 'HTMLParagraphElement'\n | 'HTMLParamElement'\n | 'HTMLPreElement'\n | 'HTMLProgressElement'\n | 'HTMLQuoteElement'\n | 'HTMLSlotElement'\n | 'HTMLScriptElement'\n | 'HTMLSelectElement'\n | 'HTMLSourceElement'\n | 'HTMLSpanElement'\n | 'HTMLStyleElement'\n | 'HTMLTableElement'\n | 'HTMLTableColElement'\n | 'HTMLTableRowElement'\n | 'HTMLTableSectionElement'\n | 'HTMLTemplateElement'\n | 'HTMLTextAreaElement'\n | 'HTMLTimeElement'\n | 'HTMLTitleElement'\n | 'HTMLTrackElement'\n | 'HTMLUListElement'\n | 'HTMLVideoElement';\n"],"mappings":"AAAA;;;;;;;;;;;;;GAcA,OAAO,SAASA,cACdC,OAAiB,EACjBC,OAMC,EAC8D;EAC/D,MAAMC,YAAA,GAAeF,OAAA;EACrB,OAAOG,OAAA,CACLD,YAAA,EAAcE,aAAA,EAAeC,WAAA,IAC3BH,YAAA,YAAwBA,YAAA,CAAaE,aAAa,CAACC,WAAW,CAACJ,OAAA,EAASK,eAAA,IAAmB,cAAc;AAE/G"}
1
+ {"version":3,"names":["isHTMLElement","element","options","typedElement","Boolean","_a","ownerDocument","defaultView","_b","constructorName"],"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/isHTMLElement.ts"],"sourcesContent":["/**\n * Verifies if a given node is an HTMLElement,\n * this method works seamlessly with frames and elements from different documents\n *\n * This is preferred over simply using `instanceof`.\n * Since `instanceof` might be problematic while operating with [multiple realms](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms)\n *\n * @example\n * ```ts\n * isHTMLElement(event.target) && event.target.focus()\n * isHTMLElement(event.target, {constructorName: 'HTMLInputElement'}) && event.target.value // some value\n * ```\n *\n */\nexport function isHTMLElement<ConstructorName extends HTMLElementConstructorName = 'HTMLElement'>(\n element?: unknown,\n options?: {\n /**\n * Can be used to provide a custom constructor instead of `HTMLElement`,\n * Like `HTMLInputElement` for example.\n */\n constructorName?: ConstructorName;\n },\n): element is InstanceType<(typeof globalThis)[ConstructorName]> {\n const typedElement = element as Node | null | undefined;\n return Boolean(\n typedElement?.ownerDocument?.defaultView &&\n typedElement instanceof typedElement.ownerDocument.defaultView[options?.constructorName ?? 'HTMLElement'],\n );\n}\n\n/**\n * @internal\n */\nexport type HTMLElementConstructorName =\n | 'HTMLElement'\n | 'HTMLAnchorElement'\n | 'HTMLAreaElement'\n | 'HTMLAudioElement'\n | 'HTMLBaseElement'\n | 'HTMLBodyElement'\n | 'HTMLBRElement'\n | 'HTMLButtonElement'\n | 'HTMLCanvasElement'\n | 'HTMLDataElement'\n | 'HTMLDataListElement'\n | 'HTMLDetailsElement'\n | 'HTMLDialogElement'\n | 'HTMLDivElement'\n | 'HTMLDListElement'\n | 'HTMLEmbedElement'\n | 'HTMLFieldSetElement'\n | 'HTMLFormElement'\n | 'HTMLHeadingElement'\n | 'HTMLHeadElement'\n | 'HTMLHRElement'\n | 'HTMLHtmlElement'\n | 'HTMLIFrameElement'\n | 'HTMLImageElement'\n | 'HTMLInputElement'\n | 'HTMLModElement'\n | 'HTMLLabelElement'\n | 'HTMLLegendElement'\n | 'HTMLLIElement'\n | 'HTMLLinkElement'\n | 'HTMLMapElement'\n | 'HTMLMetaElement'\n | 'HTMLMeterElement'\n | 'HTMLObjectElement'\n | 'HTMLOListElement'\n | 'HTMLOptGroupElement'\n | 'HTMLOptionElement'\n | 'HTMLOutputElement'\n | 'HTMLParagraphElement'\n | 'HTMLParamElement'\n | 'HTMLPreElement'\n | 'HTMLProgressElement'\n | 'HTMLQuoteElement'\n | 'HTMLSlotElement'\n | 'HTMLScriptElement'\n | 'HTMLSelectElement'\n | 'HTMLSourceElement'\n | 'HTMLSpanElement'\n | 'HTMLStyleElement'\n | 'HTMLTableElement'\n | 'HTMLTableColElement'\n | 'HTMLTableRowElement'\n | 'HTMLTableSectionElement'\n | 'HTMLTemplateElement'\n | 'HTMLTextAreaElement'\n | 'HTMLTimeElement'\n | 'HTMLTitleElement'\n | 'HTMLTrackElement'\n | 'HTMLUListElement'\n | 'HTMLVideoElement';\n"],"mappings":"AAAA;;;;;;;;;;;;;;AAcA,OAAM,SAAUA,aAAaA,CAC3BC,OAAiB,EACjBC,OAMC;;EAED,MAAMC,YAAY,GAAGF,OAAkC;EACvD,OAAOG,OAAO,CACZ,EAAAC,EAAA,GAAAF,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEG,aAAa,cAAAD,EAAA,uBAAAA,EAAA,CAAEE,WAAW,KACtCJ,YAAY,YAAYA,YAAY,CAACG,aAAa,CAACC,WAAW,CAAC,CAAAC,EAAA,GAAAN,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEO,eAAe,cAAAD,EAAA,cAAAA,EAAA,GAAI,aAAa,CAAC,CAC5G;AACH"}
@@ -1,4 +1,4 @@
1
- import { isHTMLElement } from "./isHTMLElement";
1
+ import { isHTMLElement } from './isHTMLElement';
2
2
  /**
3
3
  * @internal
4
4
  * Checks that the element has default behaviour from user input on click or 'Enter'/'Space' keys
@@ -11,10 +11,10 @@ export function isInteractiveHTMLElement(element) {
11
11
  tagName
12
12
  } = element;
13
13
  switch (tagName) {
14
- case "BUTTON":
15
- case "A":
16
- case "INPUT":
17
- case "TEXTAREA":
14
+ case 'BUTTON':
15
+ case 'A':
16
+ case 'INPUT':
17
+ case 'TEXTAREA':
18
18
  return true;
19
19
  }
20
20
  return element.isContentEditable;
@@ -1 +1 @@
1
- {"version":3,"names":["isHTMLElement","isInteractiveHTMLElement","element","tagName","isContentEditable"],"sources":["../../src/utils/isInteractiveHTMLElement.ts"],"sourcesContent":["import { isHTMLElement } from './isHTMLElement';\n\n/**\n * @internal\n * Checks that the element has default behaviour from user input on click or 'Enter'/'Space' keys\n */\nexport function isInteractiveHTMLElement(element: unknown) {\n if (!isHTMLElement(element)) {\n return false;\n }\n\n const { tagName } = element;\n switch (tagName) {\n case 'BUTTON':\n case 'A':\n case 'INPUT':\n case 'TEXTAREA':\n return true;\n }\n\n return element.isContentEditable;\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ;AAE9B;;;;AAIA,OAAO,SAASC,yBAAyBC,OAAgB,EAAE;EACzD,IAAI,CAACF,aAAA,CAAcE,OAAA,GAAU;IAC3B,OAAO,KAAK;EACd;EAEA,MAAM;IAAEC;EAAO,CAAE,GAAGD,OAAA;EACpB,QAAQC,OAAA;IACN,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;MACH,OAAO,IAAI;EAAA;EAGf,OAAOD,OAAA,CAAQE,iBAAiB;AAClC"}
1
+ {"version":3,"names":["isHTMLElement","isInteractiveHTMLElement","element","tagName","isContentEditable"],"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/isInteractiveHTMLElement.ts"],"sourcesContent":["import { isHTMLElement } from './isHTMLElement';\n\n/**\n * @internal\n * Checks that the element has default behaviour from user input on click or 'Enter'/'Space' keys\n */\nexport function isInteractiveHTMLElement(element: unknown) {\n if (!isHTMLElement(element)) {\n return false;\n }\n\n const { tagName } = element;\n switch (tagName) {\n case 'BUTTON':\n case 'A':\n case 'INPUT':\n case 'TEXTAREA':\n return true;\n }\n\n return element.isContentEditable;\n}\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,iBAAiB;AAE/C;;;;AAIA,OAAM,SAAUC,wBAAwBA,CAACC,OAAgB;EACvD,IAAI,CAACF,aAAa,CAACE,OAAO,CAAC,EAAE;IAC3B,OAAO,KAAK;;EAGd,MAAM;IAAEC;EAAO,CAAE,GAAGD,OAAO;EAC3B,QAAQC,OAAO;IACb,KAAK,QAAQ;IACb,KAAK,GAAG;IACR,KAAK,OAAO;IACZ,KAAK,UAAU;MACb,OAAO,IAAI;EAAC;EAGhB,OAAOD,OAAO,CAACE,iBAAiB;AAClC"}
@@ -20,10 +20,11 @@
20
20
  * @param callback2 - The second callback to be called, or undefined
21
21
  *
22
22
  * @returns A function that that calls the provided functions in order
23
- */export function mergeCallbacks(callback1, callback2) {
23
+ */
24
+ export function mergeCallbacks(callback1, callback2) {
24
25
  return (...args) => {
25
- callback1?.(...args);
26
- callback2?.(...args);
26
+ callback1 === null || callback1 === void 0 ? void 0 : callback1(...args);
27
+ callback2 === null || callback2 === void 0 ? void 0 : callback2(...args);
27
28
  };
28
29
  }
29
30
  //# sourceMappingURL=mergeCallbacks.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["mergeCallbacks","callback1","callback2","args"],"sources":["../../src/utils/mergeCallbacks.ts"],"sourcesContent":["/**\n * @internal\n * Combine two event callbacks into a single callback function that calls each one in order.\n *\n * Usage example:\n * ```ts\n * state.slot.onChange = mergeCallbacks(state.slot.onChange, ev => {\n * // Handle onChange\n * });\n * ```\n *\n * The primary use is to avoid the need to capture an existing callback (`state.slot.onChange` in the example) to a\n * local variable before replacing with a new listener that calls the existing one. This helps avoid bugs like:\n * * Infinite recursion by calling the re-assigned state.slot.onChange if it's not captured to a local variable.\n * * Missing a call to the original onChange due to an early return or other conditional.\n *\n * If you need a callback that is stable between renders, wrap the result in {@link useEventCallback}.\n *\n * @param callback1 - The first callback to be called, or undefined\n * @param callback2 - The second callback to be called, or undefined\n *\n * @returns A function that that calls the provided functions in order\n */\nexport function mergeCallbacks<Args extends unknown[]>(\n callback1: ((...args: Args) => void) | undefined,\n callback2: ((...args: Args) => void) | undefined,\n) {\n return (...args: Args) => {\n callback1?.(...args);\n callback2?.(...args);\n };\n}\n"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAuBA,OAAO,SAASA,eACdC,SAAgD,EAChDC,SAAgD,EAChD;EACA,OAAO,CAAC,GAAGC,IAAA,KAAe;IACxBF,SAAA,MAAeE,IAAA;IACfD,SAAA,MAAeC,IAAA;EACjB;AACF"}
1
+ {"version":3,"names":["mergeCallbacks","callback1","callback2","args"],"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/mergeCallbacks.ts"],"sourcesContent":["/**\n * @internal\n * Combine two event callbacks into a single callback function that calls each one in order.\n *\n * Usage example:\n * ```ts\n * state.slot.onChange = mergeCallbacks(state.slot.onChange, ev => {\n * // Handle onChange\n * });\n * ```\n *\n * The primary use is to avoid the need to capture an existing callback (`state.slot.onChange` in the example) to a\n * local variable before replacing with a new listener that calls the existing one. This helps avoid bugs like:\n * * Infinite recursion by calling the re-assigned state.slot.onChange if it's not captured to a local variable.\n * * Missing a call to the original onChange due to an early return or other conditional.\n *\n * If you need a callback that is stable between renders, wrap the result in {@link useEventCallback}.\n *\n * @param callback1 - The first callback to be called, or undefined\n * @param callback2 - The second callback to be called, or undefined\n *\n * @returns A function that that calls the provided functions in order\n */\nexport function mergeCallbacks<Args extends unknown[]>(\n callback1: ((...args: Args) => void) | undefined,\n callback2: ((...args: Args) => void) | undefined,\n) {\n return (...args: Args) => {\n callback1?.(...args);\n callback2?.(...args);\n };\n}\n"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAM,SAAUA,cAAcA,CAC5BC,SAAgD,EAChDC,SAAgD;EAEhD,OAAO,CAAC,GAAGC,IAAU,KAAI;IACvBF,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAG,GAAGE,IAAI,CAAC;IACpBD,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAG,GAAGC,IAAI,CAAC;EACtB,CAAC;AACH"}
package/lib/utils/omit.js CHANGED
@@ -10,7 +10,8 @@
10
10
  *
11
11
  * @param obj - The object to clone
12
12
  * @param exclusions - The array of keys to exclude
13
- */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
+ */
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
15
  export function omit(obj, exclusions) {
15
16
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
17
  const result = {};
@@ -1 +1 @@
1
- {"version":3,"names":["omit","obj","exclusions","result","key","indexOf","hasOwnProperty"],"sources":["../../src/utils/omit.ts"],"sourcesContent":["/**\n * Tiny helper to do the minimal amount of work in duplicating an object but omitting some\n * props. This ends up faster than using object ...rest or reduce to filter.\n *\n * This behaves very much like filteredAssign, but does not merge many objects together,\n * uses an exclusion object map, and avoids spreads all for optimal performance.\n *\n * See perf test for background:\n * https://jsperf.com/omit-vs-rest-vs-reduce/1\n *\n * @param obj - The object to clone\n * @param exclusions - The array of keys to exclude\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function omit<TObj extends Record<string, any>, Exclusions extends (keyof TObj)[]>(\n obj: TObj,\n exclusions: Exclusions,\n): Omit<TObj, Exclusions[number]> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n\n for (const key in obj) {\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n\n return result as TObj;\n}\n"],"mappings":"AAAA;;;;;;;;;;;;GAAA,CAaA;AACA,OAAO,SAASA,KACdC,GAAS,EACTC,UAAsB,EACU;EAChC;EACA,MAAMC,MAAA,GAA8B,CAAC;EAErC,KAAK,MAAMC,GAAA,IAAOH,GAAA,EAAK;IACrB,IAAIC,UAAA,CAAWG,OAAO,CAACD,GAAA,MAAS,CAAC,KAAKH,GAAA,CAAIK,cAAc,CAACF,GAAA,GAAM;MAC7DD,MAAM,CAACC,GAAA,CAAI,GAAGH,GAAG,CAACG,GAAA,CAAI;IACxB;EACF;EAEA,OAAOD,MAAA;AACT"}
1
+ {"version":3,"names":["omit","obj","exclusions","result","key","indexOf","hasOwnProperty"],"sources":["../../../../../../../../packages/react-components/react-utilities/src/utils/omit.ts"],"sourcesContent":["/**\n * Tiny helper to do the minimal amount of work in duplicating an object but omitting some\n * props. This ends up faster than using object ...rest or reduce to filter.\n *\n * This behaves very much like filteredAssign, but does not merge many objects together,\n * uses an exclusion object map, and avoids spreads all for optimal performance.\n *\n * See perf test for background:\n * https://jsperf.com/omit-vs-rest-vs-reduce/1\n *\n * @param obj - The object to clone\n * @param exclusions - The array of keys to exclude\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function omit<TObj extends Record<string, any>, Exclusions extends (keyof TObj)[]>(\n obj: TObj,\n exclusions: Exclusions,\n): Omit<TObj, Exclusions[number]> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n\n for (const key in obj) {\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n\n return result as TObj;\n}\n"],"mappings":"AAAA;;;;;;;;;;;;;AAaA;AACA,OAAM,SAAUA,IAAIA,CAClBC,GAAS,EACTC,UAAsB;EAEtB;EACA,MAAMC,MAAM,GAAwB,EAAE;EAEtC,KAAK,MAAMC,GAAG,IAAIH,GAAG,EAAE;IACrB,IAAIC,UAAU,CAACG,OAAO,CAACD,GAAG,CAAC,KAAK,CAAC,CAAC,IAAIH,GAAG,CAACK,cAAc,CAACF,GAAG,CAAC,EAAE;MAC7DD,MAAM,CAACC,GAAG,CAAC,GAAGH,GAAG,CAACG,GAAG,CAAC;;;EAI1B,OAAOD,MAAc;AACvB"}
@@ -13,19 +13,21 @@ const toObjectMap = (...items) => {
13
13
  *
14
14
  * @public
15
15
  */
16
- 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"]);
16
+ 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']);
17
17
  /**
18
18
  * An array of element attributes which are allowed on every html element type.
19
19
  *
20
20
  * @public
21
21
  */
22
- export const baseElementProperties = /*#__PURE__*/toObjectMap(["accessKey", "children", "className", "contentEditable", "dir", "draggable", "hidden", "htmlFor", "id", "lang", "ref", "role", "style", "tabIndex", "title", "translate", "spellCheck", "name"]);
22
+ export const baseElementProperties = /*#__PURE__*/toObjectMap(['accessKey', 'children', 'className', 'contentEditable', 'dir', 'draggable', 'hidden', 'htmlFor', 'id', 'lang', 'ref', 'role', 'style', 'tabIndex', 'title', 'translate', 'spellCheck', 'name' // global
23
+ ]);
23
24
  /**
24
25
  * An array of microdata attributes that are allowed on every html element type.
25
26
  *
26
27
  * @public
27
28
  */
28
- export const microdataProperties = /*#__PURE__*/toObjectMap(["itemID", "itemProp", "itemRef", "itemScope", "itemType"]);
29
+ export const microdataProperties = /*#__PURE__*/toObjectMap(['itemID', 'itemProp', 'itemRef', 'itemScope', 'itemType' // global
30
+ ]);
29
31
  /**
30
32
  * An array of HTML element properties and events.
31
33
  *
@@ -37,74 +39,88 @@ export const htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementPropert
37
39
  *
38
40
  * @public
39
41
  */
40
- export const labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["form"]);
42
+ export const labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['form' // button, fieldset, input, label, meter, object, output, select, textarea
43
+ ]);
41
44
  /**
42
45
  * An array of AUDIO tag properties and events.
43
46
 
44
47
  * @public
45
48
  */
46
- export const audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["height", "loop", "muted", "preload", "src", "width"]);
49
+ export const audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['height', 'loop', 'muted', 'preload', 'src', 'width' // canvas, embed, iframe, img, input, object, video
50
+ ]);
47
51
  /**
48
52
  * An array of VIDEO tag properties and events.
49
53
  *
50
54
  * @public
51
55
  */
52
- export const videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ["poster"]);
56
+ export const videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ['poster' // video
57
+ ]);
53
58
  /**
54
59
  * An array of OL tag properties and events.
55
60
  *
56
61
  * @public
57
62
  */
58
- export const olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["start"]);
63
+ export const olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['start' // ol
64
+ ]);
59
65
  /**
60
66
  * An array of LI tag properties and events.
61
67
  *
62
68
  * @public
63
69
  */
64
- export const liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["value"]);
70
+ export const liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['value' // button, input, li, option, meter, progress, param
71
+ ]);
65
72
  /**
66
73
  * An array of A tag properties and events.
67
74
  *
68
75
  * @public
69
76
  */
70
- export const anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["download", "href", "hrefLang", "media", "rel", "target", "type"]);
77
+ export const anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type' // a, button, input, link, menu, object, script, source, style
78
+ ]);
71
79
  /**
72
80
  * An array of TIME tag properties and events.
73
81
  *
74
82
  * @public
75
83
  */
76
- export const timeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["dateTime"]);
84
+ export const timeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['dateTime' // time
85
+ ]);
77
86
  /**
78
87
  * An array of BUTTON tag properties and events.
79
88
  *
80
89
  * @public
81
90
  */
82
- export const buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["autoFocus", "disabled", "form", "formAction", "formEncType", "formMethod", "formNoValidate", "formTarget", "type", "value"]);
91
+ export const buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'type', 'value' // button, input, li, option, meter, progress, param,
92
+ ]);
83
93
  /**
84
94
  * An array of INPUT tag properties and events.
85
95
  *
86
96
  * @public
87
97
  */
88
- 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"]);
98
+ 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' // canvas, embed, iframe, img, input, object, video
99
+ ]);
89
100
  /**
90
101
  * An array of TEXTAREA tag properties and events.
91
102
  *
92
103
  * @public
93
104
  */
94
- export const textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ["autoCapitalize", "cols", "dirname", "form", "maxLength", "placeholder", "readOnly", "required", "rows", "wrap"]);
105
+ export const textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['autoCapitalize', 'cols', 'dirname', 'form', 'maxLength', 'placeholder', 'readOnly', 'required', 'rows', 'wrap' // textarea
106
+ ]);
95
107
  /**
96
108
  * An array of SELECT tag properties and events.
97
109
  *
98
110
  * @public
99
111
  */
100
- export const selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ["form", "multiple", "required"]);
101
- export const optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["selected", "value"]);
112
+ export const selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['form', 'multiple', 'required' // input, select, textarea
113
+ ]);
114
+
115
+ export const optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['selected', 'value' // button, input, li, option, meter, progress, param
116
+ ]);
102
117
  /**
103
118
  * An array of TABLE tag properties and events.
104
119
  *
105
120
  * @public
106
121
  */
107
- export const tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["cellPadding", "cellSpacing"]);
122
+ export const tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['cellPadding', 'cellSpacing' // table
123
+ ]);
108
124
  /**
109
125
  * An array of TR tag properties and events.
110
126
  *
@@ -116,45 +132,55 @@ export const trProperties = htmlElementProperties;
116
132
  *
117
133
  * @public
118
134
  */
119
- export const thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["colSpan", "rowSpan", "scope"]);
135
+ export const thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'rowSpan', 'scope' // th
136
+ ]);
120
137
  /**
121
138
  * An array of TD tag properties and events.
122
139
  *
123
140
  * @public
124
141
  */
125
- export const tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["colSpan", "headers", "rowSpan", "scope"]);
126
- export const colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["span"]);
127
- export const colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["span"]);
142
+ export const tdProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'headers', 'rowSpan', 'scope' // th
143
+ ]);
144
+
145
+ export const colGroupProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span' // col, colgroup
146
+ ]);
147
+
148
+ export const colProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['span' // col, colgroup
149
+ ]);
128
150
  /**
129
151
  * An array of FIELDSET tag properties and events.
130
152
  *
131
153
  * @public
132
154
  */
133
- export const fieldsetProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["disabled", "form"]);
155
+ export const fieldsetProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['disabled', 'form' // button, fieldset, input, label, meter, object, output, select, textarea
156
+ ]);
134
157
  /**
135
158
  * An array of FORM tag properties and events.
136
159
  *
137
160
  * @public
138
161
  */
139
- export const formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["acceptCharset", "action", "encType", "encType", "method", "noValidate", "target"]);
162
+ export const formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['acceptCharset', 'action', 'encType', 'encType', 'method', 'noValidate', 'target' // form
163
+ ]);
140
164
  /**
141
165
  * An array of IFRAME tag properties and events.
142
166
  *
143
167
  * @public
144
168
  */
145
- export const iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["allow", "allowFullScreen", "allowPaymentRequest", "allowTransparency", "csp", "height", "importance", "referrerPolicy", "sandbox", "src", "srcDoc", "width"]);
169
+ export const iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['allow', 'allowFullScreen', 'allowPaymentRequest', 'allowTransparency', 'csp', 'height', 'importance', 'referrerPolicy', 'sandbox', 'src', 'srcDoc', 'width' // canvas, embed, iframe, img, input, object, video,
170
+ ]);
146
171
  /**
147
172
  * An array of IMAGE tag properties and events.
148
173
  *
149
174
  * @public
150
175
  */
151
- export const imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["alt", "crossOrigin", "height", "src", "srcSet", "useMap", "width"]);
176
+ export const imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['alt', 'crossOrigin', 'height', 'src', 'srcSet', 'useMap', 'width' // canvas, embed, iframe, img, input, object, video
177
+ ]);
152
178
  /**
153
179
  * An array of DIALOG tag properties and events.
154
180
  *
155
181
  * @public
156
182
  */
157
- export const dialogProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ["open", "onCancel", "onClose"]);
183
+ export const dialogProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);
158
184
  /**
159
185
  * An array of DIV tag properties and events.
160
186
  *
@@ -175,7 +201,8 @@ export const divProperties = htmlElementProperties;
175
201
  * @param allowedPropNames - The array or record of allowed prop names.
176
202
  * @param excludedPropNames
177
203
  * @returns The filtered props
178
- */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
204
+ */
205
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
179
206
  export function getNativeProps(
180
207
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
181
208
  props, allowedPropNames, excludedPropNames) {
@@ -189,8 +216,8 @@ props, allowedPropNames, excludedPropNames) {
189
216
  const result = {};
190
217
  const keys = Object.keys(props);
191
218
  for (const key of keys) {
192
- const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf("data-") === 0 || key.indexOf("aria-") === 0;
193
- if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {
219
+ const isNativeProp = !isArray && allowedPropNames[key] || isArray && allowedPropNames.indexOf(key) >= 0 || key.indexOf('data-') === 0 || key.indexOf('aria-') === 0;
220
+ if (isNativeProp && (!excludedPropNames || (excludedPropNames === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {
194
221
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
195
222
  result[key] = props[key];
196
223
  }