@fluentui/react-utilities 0.0.0-nightly-20230427-0418.1 → 0.0.0-nightly-20230428-0419.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 (86) hide show
  1. package/CHANGELOG.json +5 -5
  2. package/CHANGELOG.md +5 -5
  3. package/package.json +2 -2
  4. package/dist/index.d.ts +0 -710
  5. package/lib/compose/constants.js +0 -5
  6. package/lib/compose/constants.js.map +0 -1
  7. package/lib/compose/getSlots.js +0 -58
  8. package/lib/compose/getSlots.js.map +0 -1
  9. package/lib/compose/getSlotsNext.js +0 -34
  10. package/lib/compose/getSlotsNext.js.map +0 -1
  11. package/lib/compose/index.js +0 -7
  12. package/lib/compose/index.js.map +0 -1
  13. package/lib/compose/isResolvedShorthand.js +0 -35
  14. package/lib/compose/isResolvedShorthand.js.map +0 -1
  15. package/lib/compose/resolveShorthand.js +0 -34
  16. package/lib/compose/resolveShorthand.js.map +0 -1
  17. package/lib/compose/types.js +0 -2
  18. package/lib/compose/types.js.map +0 -1
  19. package/lib/events/index.js +0 -2
  20. package/lib/events/index.js.map +0 -1
  21. package/lib/events/mouseTouchHelpers.js +0 -39
  22. package/lib/events/mouseTouchHelpers.js.map +0 -1
  23. package/lib/hooks/index.js +0 -13
  24. package/lib/hooks/index.js.map +0 -1
  25. package/lib/hooks/useControllableState.js +0 -49
  26. package/lib/hooks/useControllableState.js.map +0 -1
  27. package/lib/hooks/useEventCallback.js +0 -28
  28. package/lib/hooks/useEventCallback.js.map +0 -1
  29. package/lib/hooks/useFirstMount.js +0 -21
  30. package/lib/hooks/useFirstMount.js.map +0 -1
  31. package/lib/hooks/useForceUpdate.js +0 -9
  32. package/lib/hooks/useForceUpdate.js.map +0 -1
  33. package/lib/hooks/useId.js +0 -48
  34. package/lib/hooks/useId.js.map +0 -1
  35. package/lib/hooks/useIsomorphicLayoutEffect.js +0 -13
  36. package/lib/hooks/useIsomorphicLayoutEffect.js.map +0 -1
  37. package/lib/hooks/useMergedRefs.js +0 -25
  38. package/lib/hooks/useMergedRefs.js.map +0 -1
  39. package/lib/hooks/useOnClickOutside.js +0 -135
  40. package/lib/hooks/useOnClickOutside.js.map +0 -1
  41. package/lib/hooks/useOnScrollOutside.js +0 -36
  42. package/lib/hooks/useOnScrollOutside.js.map +0 -1
  43. package/lib/hooks/usePrevious.js +0 -12
  44. package/lib/hooks/usePrevious.js.map +0 -1
  45. package/lib/hooks/useScrollbarWidth.js +0 -30
  46. package/lib/hooks/useScrollbarWidth.js.map +0 -1
  47. package/lib/hooks/useTimeout.js +0 -28
  48. package/lib/hooks/useTimeout.js.map +0 -1
  49. package/lib/index.js +0 -7
  50. package/lib/index.js.map +0 -1
  51. package/lib/ssr/SSRContext.js +0 -60
  52. package/lib/ssr/SSRContext.js.map +0 -1
  53. package/lib/ssr/canUseDOM.js +0 -8
  54. package/lib/ssr/canUseDOM.js.map +0 -1
  55. package/lib/ssr/index.js +0 -3
  56. package/lib/ssr/index.js.map +0 -1
  57. package/lib/trigger/applyTriggerPropsToChildren.js +0 -33
  58. package/lib/trigger/applyTriggerPropsToChildren.js.map +0 -1
  59. package/lib/trigger/getTriggerChild.js +0 -34
  60. package/lib/trigger/getTriggerChild.js.map +0 -1
  61. package/lib/trigger/index.js +0 -5
  62. package/lib/trigger/index.js.map +0 -1
  63. package/lib/trigger/isFluentTrigger.js +0 -10
  64. package/lib/trigger/isFluentTrigger.js.map +0 -1
  65. package/lib/trigger/types.js +0 -2
  66. package/lib/trigger/types.js.map +0 -1
  67. package/lib/utils/clamp.js +0 -9
  68. package/lib/utils/clamp.js.map +0 -1
  69. package/lib/utils/getNativeElementProps.js +0 -61
  70. package/lib/utils/getNativeElementProps.js.map +0 -1
  71. package/lib/utils/getRTLSafeKey.js +0 -19
  72. package/lib/utils/getRTLSafeKey.js.map +0 -1
  73. package/lib/utils/getReactCallbackName.js +0 -24
  74. package/lib/utils/getReactCallbackName.js.map +0 -1
  75. package/lib/utils/index.js +0 -9
  76. package/lib/utils/index.js.map +0 -1
  77. package/lib/utils/isHTMLElement.js +0 -20
  78. package/lib/utils/isHTMLElement.js.map +0 -1
  79. package/lib/utils/isInteractiveHTMLElement.js +0 -22
  80. package/lib/utils/isInteractiveHTMLElement.js.map +0 -1
  81. package/lib/utils/mergeCallbacks.js +0 -29
  82. package/lib/utils/mergeCallbacks.js.map +0 -1
  83. package/lib/utils/omit.js +0 -24
  84. package/lib/utils/omit.js.map +0 -1
  85. package/lib/utils/properties.js +0 -200
  86. package/lib/utils/properties.js.map +0 -1
@@ -1 +0,0 @@
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,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A4BA,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,19 +0,0 @@
1
- /**
2
- * @internal
3
- * Finds and swaps a provided key for it's right to left format.
4
- */export const getRTLSafeKey = (key, dir) => {
5
- if (dir === 'rtl') {
6
- switch (key) {
7
- case 'ArrowLeft':
8
- {
9
- return 'ArrowRight';
10
- }
11
- case 'ArrowRight':
12
- {
13
- return 'ArrowLeft';
14
- }
15
- }
16
- }
17
- return key;
18
- };
19
- //# sourceMappingURL=getRTLSafeKey.js.map
@@ -1 +0,0 @@
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,24 +0,0 @@
1
- import * as React from 'react';
2
- /**
3
- * React.SyntheticEvent contains name of a callback that should be fired, this function returns it.
4
- *
5
- * Ideally, it should also distinguish regular and "capture" callbacks, but it's possible only with React 17 as
6
- * ".eventPhase" there has proper value, see https://github.com/facebook/react/pull/19244. In React 16 all events
7
- * are handled in bubble phase.
8
- */
9
- export function getReactCallbackName(event) {
10
- if (event._reactName) {
11
- return event._reactName;
12
- }
13
- if (event.dispatchConfig) {
14
- if (event.dispatchConfig.registrationName) {
15
- return event.dispatchConfig.registrationName;
16
- }
17
- return event.dispatchConfig.phasedRegistrationNames.bubbled;
18
- }
19
- if (process.env.NODE_ENV !== 'production') {
20
- // 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']);
22
- }
23
- }
24
- //# sourceMappingURL=getReactCallbackName.js.map
@@ -1 +0,0 @@
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,9 +0,0 @@
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
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,20 +0,0 @@
1
- /**
2
- * Verifies if a given node is an HTMLElement,
3
- * this method works seamlessly with frames and elements from different documents
4
- *
5
- * This is preferred over simply using `instanceof`.
6
- * 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)
7
- *
8
- * @example
9
- * ```ts
10
- * isHTMLElement(event.target) && event.target.focus()
11
- * isHTMLElement(event.target, {constructorName: 'HTMLInputElement'}) && event.target.value // some value
12
- * ```
13
- *
14
- */export function isHTMLElement(element, options) {
15
- var _typedElement_ownerDocument;
16
- const typedElement = element;
17
- var _options_constructorName;
18
- return Boolean((typedElement === null || typedElement === void 0 ? void 0 : (_typedElement_ownerDocument = typedElement.ownerDocument) === null || _typedElement_ownerDocument === void 0 ? void 0 : _typedElement_ownerDocument.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options_constructorName = options === null || options === void 0 ? void 0 : options.constructorName) !== null && _options_constructorName !== void 0 ? _options_constructorName : 'HTMLElement']);
19
- }
20
- //# sourceMappingURL=isHTMLElement.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["isHTMLElement","element","options","_typedElement_ownerDocument","typedElement","_options_constructorName","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;MAG7DC,2BAAA;EAFF,MAAMC,YAAA,GAAeH,OAAA;MAG8CI,wBAAA;EAFnE,OAAOC,OAAA,CACL,CAAAF,YAAA,aAAAA,YAAA,wBAAAD,2BAAA,GAAAC,YAAA,CAAcG,aAAa,cAA3BJ,2BAAA,uBAAAA,2BAAA,CAA6BK,WAAF,KACzBJ,YAAA,YAAwBA,YAAA,CAAaG,aAAa,CAACC,WAAW,CAAC,CAAAH,wBAAA,GAAAH,OAAA,aAAAA,OAAA,uBAAAA,OAAA,CAASO,eAAe,cAAxBJ,wBAAA,cAAAA,wBAAA,GAA4B,aAAa,CAAC;AAE/G"}
@@ -1,22 +0,0 @@
1
- import { isHTMLElement } from './isHTMLElement';
2
- /**
3
- * @internal
4
- * Checks that the element has default behaviour from user input on click or 'Enter'/'Space' keys
5
- */
6
- export function isInteractiveHTMLElement(element) {
7
- if (!isHTMLElement(element)) {
8
- return false;
9
- }
10
- const {
11
- tagName
12
- } = element;
13
- switch (tagName) {
14
- case 'BUTTON':
15
- case 'A':
16
- case 'INPUT':
17
- case 'TEXTAREA':
18
- return true;
19
- }
20
- return element.isContentEditable;
21
- }
22
- //# sourceMappingURL=isInteractiveHTMLElement.js.map
@@ -1 +0,0 @@
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,29 +0,0 @@
1
- /**
2
- * @internal
3
- * Combine two event callbacks into a single callback function that calls each one in order.
4
- *
5
- * Usage example:
6
- * ```ts
7
- * state.slot.onChange = mergeCallbacks(state.slot.onChange, ev => {
8
- * // Handle onChange
9
- * });
10
- * ```
11
- *
12
- * The primary use is to avoid the need to capture an existing callback (`state.slot.onChange` in the example) to a
13
- * local variable before replacing with a new listener that calls the existing one. This helps avoid bugs like:
14
- * * Infinite recursion by calling the re-assigned state.slot.onChange if it's not captured to a local variable.
15
- * * Missing a call to the original onChange due to an early return or other conditional.
16
- *
17
- * If you need a callback that is stable between renders, wrap the result in {@link useEventCallback}.
18
- *
19
- * @param callback1 - The first callback to be called, or undefined
20
- * @param callback2 - The second callback to be called, or undefined
21
- *
22
- * @returns A function that that calls the provided functions in order
23
- */export function mergeCallbacks(callback1, callback2) {
24
- return (...args) => {
25
- callback1 === null || callback1 === void 0 ? void 0 : callback1(...args);
26
- callback2 === null || callback2 === void 0 ? void 0 : callback2(...args);
27
- };
28
- }
29
- //# sourceMappingURL=mergeCallbacks.js.map
@@ -1 +0,0 @@
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,aAAAA,SAAA,uBAAAA,SAAA,IAAeE,IAAA;IACfD,SAAA,aAAAA,SAAA,uBAAAA,SAAA,IAAeC,IAAA;EACjB;AACF"}
package/lib/utils/omit.js DELETED
@@ -1,24 +0,0 @@
1
- /**
2
- * Tiny helper to do the minimal amount of work in duplicating an object but omitting some
3
- * props. This ends up faster than using object ...rest or reduce to filter.
4
- *
5
- * This behaves very much like filteredAssign, but does not merge many objects together,
6
- * uses an exclusion object map, and avoids spreads all for optimal performance.
7
- *
8
- * See perf test for background:
9
- * https://jsperf.com/omit-vs-rest-vs-reduce/1
10
- *
11
- * @param obj - The object to clone
12
- * @param exclusions - The array of keys to exclude
13
- */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
- export function omit(obj, exclusions) {
15
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
- const result = {};
17
- for (const key in obj) {
18
- if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {
19
- result[key] = obj[key];
20
- }
21
- }
22
- return result;
23
- }
24
- //# sourceMappingURL=omit.js.map
@@ -1 +0,0 @@
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,200 +0,0 @@
1
- const toObjectMap = (...items) => {
2
- const result = {};
3
- for (const item of items) {
4
- const keys = Array.isArray(item) ? item : Object.keys(item);
5
- for (const key of keys) {
6
- result[key] = 1;
7
- }
8
- }
9
- return result;
10
- };
11
- /**
12
- * An array of events that are allowed on every html element type.
13
- *
14
- * @public
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']);
17
- /**
18
- * An array of element attributes which are allowed on every html element type.
19
- *
20
- * @public
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']);
23
- /**
24
- * An array of microdata attributes that are allowed on every html element type.
25
- *
26
- * @public
27
- */
28
- export const microdataProperties = /*#__PURE__*/toObjectMap(['itemID', 'itemProp', 'itemRef', 'itemScope', 'itemType']);
29
- /**
30
- * An array of HTML element properties and events.
31
- *
32
- * @public
33
- */
34
- export const htmlElementProperties = /*#__PURE__*/toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);
35
- /**
36
- * An array of LABEL tag properties and events.
37
- *
38
- * @public
39
- */
40
- export const labelProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['form']);
41
- /**
42
- * An array of AUDIO tag properties and events.
43
-
44
- * @public
45
- */
46
- export const audioProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['height', 'loop', 'muted', 'preload', 'src', 'width']);
47
- /**
48
- * An array of VIDEO tag properties and events.
49
- *
50
- * @public
51
- */
52
- export const videoProperties = /*#__PURE__*/toObjectMap(audioProperties, ['poster']);
53
- /**
54
- * An array of OL tag properties and events.
55
- *
56
- * @public
57
- */
58
- export const olProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['start']);
59
- /**
60
- * An array of LI tag properties and events.
61
- *
62
- * @public
63
- */
64
- export const liProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['value']);
65
- /**
66
- * An array of A tag properties and events.
67
- *
68
- * @public
69
- */
70
- export const anchorProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type']);
71
- /**
72
- * An array of TIME tag properties and events.
73
- *
74
- * @public
75
- */
76
- export const timeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['dateTime']);
77
- /**
78
- * An array of BUTTON tag properties and events.
79
- *
80
- * @public
81
- */
82
- export const buttonProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['autoFocus', 'disabled', 'form', 'formAction', 'formEncType', 'formMethod', 'formNoValidate', 'formTarget', 'type', 'value']);
83
- /**
84
- * An array of INPUT tag properties and events.
85
- *
86
- * @public
87
- */
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']);
89
- /**
90
- * An array of TEXTAREA tag properties and events.
91
- *
92
- * @public
93
- */
94
- export const textAreaProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['autoCapitalize', 'cols', 'dirname', 'form', 'maxLength', 'placeholder', 'readOnly', 'required', 'rows', 'wrap']);
95
- /**
96
- * An array of SELECT tag properties and events.
97
- *
98
- * @public
99
- */
100
- export const selectProperties = /*#__PURE__*/toObjectMap(buttonProperties, ['form', 'multiple', 'required']);
101
- export const optionProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['selected', 'value']);
102
- /**
103
- * An array of TABLE tag properties and events.
104
- *
105
- * @public
106
- */
107
- export const tableProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['cellPadding', 'cellSpacing']);
108
- /**
109
- * An array of TR tag properties and events.
110
- *
111
- * @public
112
- */
113
- export const trProperties = htmlElementProperties;
114
- /**
115
- * An array of TH tag properties and events.
116
- *
117
- * @public
118
- */
119
- export const thProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['colSpan', 'rowSpan', 'scope']);
120
- /**
121
- * An array of TD tag properties and events.
122
- *
123
- * @public
124
- */
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']);
128
- /**
129
- * An array of FIELDSET tag properties and events.
130
- *
131
- * @public
132
- */
133
- export const fieldsetProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['disabled', 'form']);
134
- /**
135
- * An array of FORM tag properties and events.
136
- *
137
- * @public
138
- */
139
- export const formProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['acceptCharset', 'action', 'encType', 'encType', 'method', 'noValidate', 'target']);
140
- /**
141
- * An array of IFRAME tag properties and events.
142
- *
143
- * @public
144
- */
145
- export const iframeProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['allow', 'allowFullScreen', 'allowPaymentRequest', 'allowTransparency', 'csp', 'height', 'importance', 'referrerPolicy', 'sandbox', 'src', 'srcDoc', 'width']);
146
- /**
147
- * An array of IMAGE tag properties and events.
148
- *
149
- * @public
150
- */
151
- export const imgProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['alt', 'crossOrigin', 'height', 'src', 'srcSet', 'useMap', 'width']);
152
- /**
153
- * An array of DIALOG tag properties and events.
154
- *
155
- * @public
156
- */
157
- export const dialogProperties = /*#__PURE__*/toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);
158
- /**
159
- * An array of DIV tag properties and events.
160
- *
161
- * @public
162
- */
163
- export const divProperties = htmlElementProperties;
164
- /**
165
- * Gets native supported props for an html element provided the allowance set. Use one of the property
166
- * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given
167
- * props set. Note that all data- and aria- prefixed attributes will be allowed.
168
- * NOTE: getNativeProps should always be applied first when adding props to a react component. The
169
- * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.
170
- * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to
171
- * the component after an onClick function is added, then the getNativeProps onClick will override it.
172
- *
173
- * @public
174
- * @param props - The unfiltered input props
175
- * @param allowedPropNames - The array or record of allowed prop names.
176
- * @param excludedPropNames
177
- * @returns The filtered props
178
- */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
179
- export function getNativeProps(
180
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
181
- props, allowedPropNames, excludedPropNames) {
182
- // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for
183
- // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.
184
- // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then
185
- // return native props.
186
- // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797
187
- const isArray = Array.isArray(allowedPropNames);
188
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
189
- const result = {};
190
- const keys = Object.keys(props);
191
- 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 === null || excludedPropNames === void 0 ? void 0 : excludedPropNames.indexOf(key)) === -1)) {
194
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
195
- result[key] = props[key];
196
- }
197
- }
198
- return result;
199
- }
200
- //# sourceMappingURL=properties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["toObjectMap","items","result","item","keys","Array","isArray","Object","key","baseElementEvents","baseElementProperties","microdataProperties","htmlElementProperties","labelProperties","audioProperties","videoProperties","olProperties","liProperties","anchorProperties","timeProperties","buttonProperties","inputProperties","textAreaProperties","selectProperties","optionProperties","tableProperties","trProperties","thProperties","tdProperties","colGroupProperties","colProperties","fieldsetProperties","formProperties","iframeProperties","imgProperties","dialogProperties","divProperties","getNativeProps","props","allowedPropNames","excludedPropNames","isNativeProp","indexOf"],"sources":["../../src/utils/properties.ts"],"sourcesContent":["const toObjectMap = (...items: (string[] | Record<string, number>)[]) => {\n const result: Record<string, number> = {};\n\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n\n for (const key of keys) {\n result[key] = 1;\n }\n }\n\n return result;\n};\n\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = toObjectMap([\n 'onAuxClick',\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n]);\n\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = toObjectMap([\n 'accessKey', // global\n 'children', // global\n 'className', // global\n 'contentEditable', // global\n 'dir', // global\n 'draggable', // global\n 'hidden', // global\n 'htmlFor', // global\n 'id', // global\n 'lang', // global\n 'ref', // global\n 'role', // global\n 'style', // global\n 'tabIndex', // global\n 'title', // global\n 'translate', // global\n 'spellCheck', // global\n 'name', // global\n]);\n\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */\nexport const microdataProperties = toObjectMap([\n 'itemID', // global\n 'itemProp', // global\n 'itemRef', // global\n 'itemScope', // global\n 'itemType', // global\n]);\n\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = toObjectMap(htmlElementProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = toObjectMap(htmlElementProperties, [\n 'height', // canvas, embed, iframe, img, input, object, video\n 'loop', // audio, video\n 'muted', // audio, video\n 'preload', // audio, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = toObjectMap(audioProperties, [\n 'poster', // video\n]);\n\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = toObjectMap(htmlElementProperties, [\n 'start', // ol\n]);\n\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = toObjectMap(htmlElementProperties, [\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download', // a, area\n 'href', // a, area, base, link\n 'hrefLang', // a, area, link\n 'media', // a, area, link, source, style\n 'rel', // a, area, link\n 'target', // a, area, base, form\n 'type', // a, button, input, link, menu, object, script, source, style\n]);\n\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */\nexport const timeProperties = toObjectMap(htmlElementProperties, [\n 'dateTime', // time\n]);\n\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus', // button, input, select, textarea\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'formAction', // input, button\n 'formEncType', // input, button\n 'formMethod', // input, button\n 'formNoValidate', // input, button\n 'formTarget', // input, button\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param,\n]);\n\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = toObjectMap(buttonProperties, [\n 'accept', // input\n 'alt', // area, img, input\n 'autoCapitalize', // input, textarea\n 'autoComplete', // form, input\n 'checked', // input\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'height', // canvas, embed, iframe, img, input, object, video\n 'inputMode', // input\n 'list', // input\n 'max', // input, meter\n 'maxLength', // input, textarea\n 'min', // input, meter\n 'multiple', // input, select\n 'pattern', // input\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'step', // input\n 'size', // input\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize', // input, textarea\n 'cols', // textarea\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'maxLength', // input, textarea\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'rows', // textarea\n 'wrap', // textarea\n]);\n\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = toObjectMap(buttonProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'multiple', // input, select\n 'required', // input, select, textarea\n]);\n\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected', // option\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding', // table\n 'cellSpacing', // table\n]);\n\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td, th\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td\n 'headers', // td\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */\nexport const fieldsetProperties = toObjectMap(htmlElementProperties, [\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset', // form\n 'action', // form\n 'encType', // form\n 'encType', // form\n 'method', // form\n 'noValidate', // form\n 'target', // form\n]);\n\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow', // iframe\n 'allowFullScreen', // iframe\n 'allowPaymentRequest', // iframe\n 'allowTransparency', // iframe\n 'csp', // iframe\n 'height', // canvas, embed, iframe, img, input, object, video\n 'importance', // iframe\n 'referrerPolicy', // iframe\n 'sandbox', // iframe\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcDoc', // iframe\n 'width', // canvas, embed, iframe, img, input, object, video,\n]);\n\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt', // area, img, input\n 'crossOrigin', // img\n 'height', // canvas, embed, iframe, img, input, object, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcSet', // img, source\n 'useMap', // img, object,\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */\nexport const dialogProperties = toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);\n\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps<T extends Record<string, any>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: Record<string, any>,\n allowedPropNames: string[] | Record<string, number>,\n excludedPropNames?: string[],\n): T {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n const keys = Object.keys(props);\n\n for (const key of keys) {\n const isNativeProp =\n (!isArray && (allowedPropNames as Record<string, number>)[key]) ||\n (isArray && (allowedPropNames as string[]).indexOf(key) >= 0) ||\n key.indexOf('data-') === 0 ||\n key.indexOf('aria-') === 0;\n\n if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props![key] as any;\n }\n }\n\n return result as T;\n}\n"],"mappings":"AAAA,MAAMA,WAAA,GAAcA,CAAC,GAAGC,KAAA,KAAiD;EACvE,MAAMC,MAAA,GAAiC,CAAC;EAExC,KAAK,MAAMC,IAAA,IAAQF,KAAA,EAAO;IACxB,MAAMG,IAAA,GAAOC,KAAA,CAAMC,OAAO,CAACH,IAAA,IAAQA,IAAA,GAAOI,MAAA,CAAOH,IAAI,CAACD,IAAA,CAAK;IAE3D,KAAK,MAAMK,GAAA,IAAOJ,IAAA,EAAM;MACtBF,MAAM,CAACM,GAAA,CAAI,GAAG;IAChB;EACF;EAEA,OAAON,MAAA;AACT;AAEA;;;;;AAKA,OAAO,MAAMO,iBAAA,gBAAoBT,WAAA,CAAY,CAC3C,cACA,UACA,SACA,WACA,oBACA,sBACA,uBACA,WACA,kBACA,UACA,iBACA,YACA,WACA,YACA,UACA,WACA,aACA,oBACA,cACA,WACA,WACA,aACA,oBACA,oBACA,aACA,eACA,WACA,gBACA,oBACA,eACA,WACA,UACA,aACA,cACA,gBACA,YACA,aACA,aACA,aACA,gBACA,kBACA,aACA,WACA,kBACA,iBACA,iBACA,UACA,aACA,eACA,cACA,eACA,cACA,eACA,UACA,eACA,sBACA,gBACA,gBACA,eACA,cACA,eACA,aACA,oBACA,YACA,iBACA,cACA,eACA,gBACA,YACA,WACA,mBACA,iBACA,kBACA,kBACA,iBACA,gBACA,iBACA,eACA,uBACA,uBACD;AAED;;;;;AAKA,OAAO,MAAMU,qBAAA,gBAAwBV,WAAA,CAAY,CAC/C,aACA,YACA,aACA,mBACA,OACA,aACA,UACA,WACA,MACA,QACA,OACA,QACA,SACA,YACA,SACA,aACA,cACA,OACD;AAED;;;;;AAKA,OAAO,MAAMW,mBAAA,gBAAsBX,WAAA,CAAY,CAC7C,UACA,YACA,WACA,aACA,WACD;AAED;;;;;AAKA,OAAO,MAAMY,q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