@handsontable/react-wrapper 18.1.2 → 19.0.0-rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -17
- package/commonjs/react-handsontable.js +877 -190
- package/dist/react-handsontable.js +880 -193
- package/dist/react-handsontable.js.map +1 -1
- package/dist/react-handsontable.min.js +2 -2
- package/dist/react-handsontable.min.js.map +1 -1
- package/es/react-handsontable.mjs +878 -191
- package/helpers.d.ts +125 -12
- package/hotColumnContext.d.ts +6 -0
- package/hotEditor.d.ts +24 -6
- package/hotTableContext.d.ts +10 -8
- package/package.json +15 -4
- package/settingsMapper.d.ts +27 -4
- package/types.d.ts +41 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-handsontable.js","sources":["../src/helpers.tsx","../src/settingsMapper.ts","../src/hotTableContext.tsx","../src/hotColumnContext.tsx","../src/hotEditor.tsx","../src/hotColumn.tsx","../src/renderersPortalManager.tsx","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js","../src/hotTableInner.tsx","../src/hotTable.tsx"],"sourcesContent":["import React, {\n ComponentType,\n CSSProperties,\n DependencyList,\n EffectCallback,\n ReactNode,\n ReactPortal,\n useEffect,\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport { HotTableProps } from './types';\n\nlet bulkComponentContainer: DocumentFragment | null = null;\n\n/**\n * Warning message for the `autoRowSize`/`autoColumnSize` compatibility check.\n */\nexport const AUTOSIZE_WARNING = 'Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with ' +\n ' the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.';\n\n/**\n * Warning message for the `hot-renderer` obsolete renderer passing method.\n */\nexport const OBSOLETE_HOTRENDERER_WARNING = 'Providing a component-based renderer using `hot-renderer`-annotated component is no longer supported. ' +\n 'Pass your component using `renderer` prop of the `HotTable` or `HotColumn` component instead.';\n\n/**\n * Warning message for the `hot-editor` obsolete editor passing method.\n */\nexport const OBSOLETE_HOTEDITOR_WARNING = 'Providing a component-based editor using `hot-editor`-annotated component is no longer supported. ' +\n 'Pass your component using `editor` prop of the `HotTable` or `HotColumn` component instead.';\n\n/**\n * Warning message for the unexpected children of HotTable component.\n */\nexport const UNEXPECTED_HOTTABLE_CHILDREN_WARNING = 'Unexpected children nodes found in HotTable component. ' +\n 'Only HotColumn components are allowed.';\n\n/**\n * Warning message for the unexpected children of HotColumn component.\n */\nexport const UNEXPECTED_HOTCOLUMN_CHILDREN_WARNING = 'Unexpected children nodes found in HotColumn component. ' +\n 'HotColumn components do not support any children.';\n\n/**\n * Message for the warning thrown if the Handsontable instance has been destroyed.\n */\nexport const HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' +\n ' used properly.';\n\n/**\n * Default classname given to the wrapper container.\n */\nexport const DEFAULT_CLASSNAME = 'hot-wrapper-editor-container';\n\n/**\n * Logs warn to the console if the `console` object is exposed.\n *\n * @param {...*} args Values which will be logged.\n */\nexport function warn(...args: any[]) {\n if (typeof console !== 'undefined') {\n console.warn(...args);\n }\n}\n\n/**\n * Detect if `hot-renderer` or `hot-editor` is defined, and if so, throw an incompatibility warning.\n *\n * @returns {boolean} 'true' if the warning was issued\n */\nexport function displayObsoleteRenderersEditorsWarning(children: ReactNode): boolean {\n if (hasChildElementOfType(children, 'hot-renderer')) {\n warn(OBSOLETE_HOTRENDERER_WARNING);\n return true;\n }\n if (hasChildElementOfType(children, 'hot-editor')) {\n warn(OBSOLETE_HOTEDITOR_WARNING);\n return true;\n }\n\n return false\n}\n\n/**\n * Detect if children of specified type are defined, and if so, throw an incompatibility warning.\n *\n * @param {ReactNode} children Component children nodes\n * @param {ComponentType} Component Component type to check\n * @returns {boolean} 'true' if the warning was issued\n */\nexport function displayChildrenOfTypeWarning(children: ReactNode, Component: ComponentType): boolean {\n const childrenArray: ReactNode[] = React.Children.toArray(children);\n\n if (childrenArray.some((child) => (child as React.ReactElement).type !== Component)) {\n warn(UNEXPECTED_HOTTABLE_CHILDREN_WARNING);\n return true;\n }\n\n return false\n}\n\n/**\n * Detect if children is defined, and if so, throw an incompatibility warning.\n *\n * @param {ReactNode} children Component children nodes\n * @returns {boolean} 'true' if the warning was issued\n */\nexport function displayAnyChildrenWarning(children: ReactNode): boolean {\n const childrenArray: ReactNode[] = React.Children.toArray(children);\n\n if (childrenArray.length) {\n warn(UNEXPECTED_HOTCOLUMN_CHILDREN_WARNING);\n return true;\n }\n\n return false\n}\n\n/**\n * Check the existence of elements of the provided `type` from the `HotColumn` component's children.\n *\n * @param {ReactNode} children HotTable children array.\n * @param {String} type Either `'hot-renderer'` or `'hot-editor'`.\n * @returns {boolean} `true` if the child of that type was found, `false` otherwise.\n */\nfunction hasChildElementOfType(children: ReactNode, type: 'hot-renderer' | 'hot-editor'): boolean {\n const childrenArray: ReactNode[] = React.Children.toArray(children);\n\n return childrenArray.some((child) => {\n return (child as React.ReactElement).props[type] !== void 0;\n });\n}\n\n/**\n * Create an editor portal.\n *\n * @param {Document} doc Document to be used.\n * @param {ComponentType} Editor Editor component or render function.\n * @returns {ReactPortal} The portal for the editor.\n */\nexport function createEditorPortal(doc: Document | null, Editor: HotTableProps['editor'] | undefined | boolean): ReactPortal | null {\n if (!doc || !Editor || typeof Editor === 'boolean') {\n return null;\n }\n\n const editorElement = <Editor />;\n const containerProps = getContainerAttributesProps({}, false);\n\n containerProps.className = `${DEFAULT_CLASSNAME} ${containerProps.className}`;\n\n return ReactDOM.createPortal(\n <div {...containerProps}>\n {editorElement}\n </div>\n , doc.body);\n}\n\n/**\n * Render a cell component to an external DOM node.\n *\n * @param {React.ReactElement} rElement React element to be used as a base for the component.\n * @param {Document} [ownerDocument] The owner document to set the portal up into.\n * @param {String} portalKey The key to be used for the portal.\n * @param {HTMLElement} [cachedContainer] The cached container to be used for the portal.\n * @returns {{portal: ReactPortal, portalContainer: HTMLElement}} An object containing the portal and its container.\n */\nexport function createPortal(rElement: React.ReactElement, ownerDocument: Document | null = document, portalKey: string, cachedContainer?: HTMLElement): {\n portal: ReactPortal,\n portalContainer: HTMLElement,\n} {\n if (!ownerDocument) {\n ownerDocument = document;\n }\n\n let portalContainer = cachedContainer;\n\n // A new container needs an anchor before React mounts into it. A cached\n // container is already attached (typically inside its TD) and must be\n // left in place to avoid wiping the DOM on every grid render.\n if (!portalContainer) {\n if (!bulkComponentContainer) {\n bulkComponentContainer = ownerDocument.createDocumentFragment();\n }\n portalContainer = ownerDocument.createElement('DIV');\n bulkComponentContainer.appendChild(portalContainer);\n }\n\n return {\n portal: ReactDOM.createPortal(rElement, portalContainer, portalKey),\n portalContainer,\n };\n}\n\n/**\n * Get an object containing the `id`, `className` and `style` keys, representing the corresponding props passed to the\n * component.\n *\n * @param {HotTableProps} props Object containing the React element props.\n * @param {Boolean} randomizeId If set to `true`, the function will randomize the `id` property when no `id` was present in the `prop` object.\n * @returns An object containing the `id`, `className` and `style` keys, representing the corresponding props passed to the\n * component.\n */\nexport function getContainerAttributesProps(props: HotTableProps, randomizeId: boolean = true): {id?: string, className: string, style: CSSProperties} {\n return {\n id: props.id || (randomizeId ? 'hot-' + Math.random().toString(36).substring(5) : undefined),\n className: props.className || '',\n style: props.style || {},\n };\n}\n\n/**\n * Checks if the environment that the code runs in is a browser.\n *\n * @returns {boolean}\n */\nexport function isCSR(): boolean {\n return typeof window !== 'undefined';\n}\n\nfunction isObjectLike(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (!isObjectLike(value)) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction isArray(value: unknown): value is unknown[] {\n return Array.isArray(value);\n}\n\n/**\n * Deep-compare plain objects and arrays used by wrapper settings.\n *\n * @param {unknown} previousValue Previous value.\n * @param {unknown} currentValue Current value.\n * @returns {boolean} `true` if values are equivalent.\n */\nexport function areEquivalentSettingsValue(previousValue: unknown, currentValue: unknown): boolean {\n if (previousValue === currentValue) {\n return true;\n }\n\n if (previousValue instanceof RegExp || currentValue instanceof RegExp) {\n if (!(previousValue instanceof RegExp) || !(currentValue instanceof RegExp)) {\n return false;\n }\n\n return previousValue.source === currentValue.source &&\n previousValue.flags === currentValue.flags;\n }\n\n if (isArray(previousValue) && isArray(currentValue)) {\n if (previousValue.length !== currentValue.length) {\n return false;\n }\n\n for (let index = 0; index < previousValue.length; index++) {\n if (!areEquivalentSettingsValue(previousValue[index], currentValue[index])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (isArray(previousValue) || isArray(currentValue)) {\n return false;\n }\n\n if (!isObjectLike(previousValue) || !isObjectLike(currentValue)) {\n return false;\n }\n\n if (!isPlainObject(previousValue) || !isPlainObject(currentValue)) {\n return false;\n }\n\n const previousKeys = Object.keys(previousValue);\n const currentKeys = Object.keys(currentValue);\n\n if (previousKeys.length !== currentKeys.length) {\n return false;\n }\n\n for (const key of previousKeys) {\n if (!Object.prototype.hasOwnProperty.call(currentValue, key)) {\n return false;\n }\n\n if (!areEquivalentSettingsValue(previousValue[key], currentValue[key])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * A variant of useEffect hook that does not trigger on initial mount, only updates\n *\n * @param effect Effect function\n * @param deps Effect dependencies\n */\nexport function useUpdateEffect(effect: EffectCallback, deps?: DependencyList): void {\n const notInitialRender = React.useRef(false);\n\n useEffect(() => {\n if (notInitialRender.current) {\n return effect();\n } else {\n notInitialRender.current = true;\n }\n }, deps);\n}\n","import Handsontable from 'handsontable/base';\nimport { HotTableProps } from './types';\nimport { areEquivalentSettingsValue } from './helpers';\n\n/**\n * Only `dataSchema` and `columns` use deep comparison when diffing props for `updateSettings(false)`.\n * Other object settings (for example `mergeCells`, `cell`, `nestedHeaders`, hooks) stay on strict\n * reference equality so we avoid expensive deep walks and accidental false positives where functions\n * or class instances would not compare meaningfully by keys alone.\n */\nconst DEEP_COMPARABLE_SETTINGS: Array<keyof Handsontable.GridSettings> = ['dataSchema', 'columns'];\n\nexport class SettingsMapper {\n /**\n * Parse component settings into Handsontable-compatible settings.\n *\n * @param {Object} properties Object containing properties from the HotTable object.\n * @param {Object} additionalSettings Additional settings.\n * @param {boolean} additionalSettings.isInit Flag determining whether the settings are being set during initialization.\n * @param {string[]} additionalSettings.initOnlySettingKeys Array of keys that can be set only during initialization.\n * @returns {Object} Handsontable-compatible settings object.\n */\n static getSettings(\n properties: HotTableProps,\n {\n prevProps = {},\n isInit = false,\n initOnlySettingKeys = []\n }: {\n prevProps?: HotTableProps;\n isInit?: boolean;\n initOnlySettingKeys?: Array<keyof Handsontable.GridSettings>\n } = {}): Handsontable.GridSettings {\n const shouldSkipProp = (key: keyof Handsontable.GridSettings) => {\n if (!isInit && DEEP_COMPARABLE_SETTINGS.includes(key)) {\n return areEquivalentSettingsValue(prevProps[key], properties[key]);\n }\n\n if (!isInit && initOnlySettingKeys.includes(key)) {\n return true;\n }\n return false;\n };\n let newSettings: Handsontable.GridSettings = {};\n\n for (const key in properties) {\n if (\n key !== 'children' &&\n !shouldSkipProp(key as keyof Handsontable.GridSettings) &&\n properties.hasOwnProperty(key)\n ) {\n (newSettings as any)[key] = properties[key as keyof HotTableProps];\n }\n }\n\n return newSettings;\n }\n}\n","import Handsontable from 'handsontable/base';\nimport React, {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactPortal,\n createContext,\n useCallback,\n useRef,\n useMemo,\n useContext,\n} from 'react';\nimport { ScopeIdentifier, HotRendererProps } from './types'\nimport { createPortal } from './helpers'\nimport { RenderersPortalManagerRef } from './renderersPortalManager'\n\nexport interface HotTableContextImpl {\n /**\n * Map with column indexes (or a string = 'global') as keys, and booleans as values. Each key represents a component-based editor\n * declared for the used column index, or a global one, if the key is the `global` string.\n */\n readonly componentRendererColumns: Map<ScopeIdentifier, boolean>;\n\n /**\n * Array of object containing the column settings.\n */\n readonly columnsSettings: Handsontable.ColumnSettings[];\n\n /**\n * Sets the column settings based on information received from HotColumn.\n *\n * @param {HotTableProps} columnSettings Column settings object.\n * @param {Number} columnIndex Column index.\n */\n readonly emitColumnSettings: (columnSettings: Handsontable.ColumnSettings, columnIndex: number) => void;\n\n /**\n * Trim the column settings array to the given length. Used to drop slots\n * left over from HotColumn children that have unmounted.\n *\n * @param {Number} length Target length for the column settings array.\n */\n readonly trimColumnSettings: (length: number) => void;\n\n /**\n * Return a renderer wrapper function for the provided renderer component.\n *\n * @param {ComponentType<HotRendererProps>} Renderer React renderer component.\n * @returns {Handsontable.renderers.BaseRenderer} The Handsontable rendering function.\n */\n readonly getRendererWrapper: (Renderer: ComponentType<HotRendererProps>) => typeof Handsontable.renderers.BaseRenderer;\n\n /**\n * Clears portals cache.\n */\n readonly clearPortalCache: () => void;\n\n /**\n * Clears rendered cells cache.\n */\n readonly clearRenderedCellCache: () => void;\n\n /**\n * Returns the number of portal containers currently retained by the cache.\n * Diagnostic hook used to assert the cache stays bounded to the viewport\n * (it must not grow with the total scrolled row/column count).\n *\n * @returns {number} The portal container cache size.\n */\n readonly getPortalContainerCacheSize: () => number;\n\n /**\n * Set the renderers portal manager dispatch function.\n *\n * @param {RenderersPortalManagerRef} pm The PortalManager dispatch function.\n */\n readonly setRenderersPortalManagerRef: (pm: RenderersPortalManagerRef) => void;\n\n /**\n * Puts cell portals into portal manager and purges portals cache.\n */\n readonly pushCellPortalsIntoPortalManager: () => void;\n}\n\nconst HotTableContext = createContext<HotTableContextImpl | undefined>(undefined);\n\nconst HotTableContextProvider: FC<PropsWithChildren> = ({ children }) => {\n const columnsSettings = useRef<Handsontable.ColumnSettings[]>([]);\n\n const setHotColumnSettings = useCallback((columnSettings: Handsontable.ColumnSettings, columnIndex: number) => {\n columnsSettings.current[columnIndex] = columnSettings;\n }, [])\n\n const trimColumnSettings = useCallback((length: number) => {\n columnsSettings.current.length = length;\n }, [])\n\n const componentRendererColumns = useRef<Map<number | 'global', boolean>>(new Map());\n const renderedCellCache = useRef<Map<string, HTMLTableCellElement>>(new Map());\n const clearRenderedCellCache = useCallback(() => renderedCellCache.current.clear(), []);\n const portalCache = useRef<Map<string, ReactPortal>>(new Map());\n const portalContainerCache = useRef<Map<string, HTMLElement>>(new Map());\n // Keys of the portal containers rendered in the current view-render pass.\n // Reset every `beforeViewRender` and used after the render to evict\n // containers whose cells left the viewport (see pushCellPortalsIntoPortalManager).\n const renderedPortalContainerKeys = useRef<Set<string>>(new Set());\n const clearPortalCache = useCallback(() => {\n portalCache.current.clear();\n renderedPortalContainerKeys.current.clear();\n }, []);\n const getPortalContainerCacheSize = useCallback(() => portalContainerCache.current.size, []);\n\n const getRendererWrapper = useCallback((Renderer: ComponentType<HotRendererProps>): typeof Handsontable.renderers.BaseRenderer => {\n return function __internalRenderer(instance, TD, row, col, prop, value, cellProperties) {\n const key = `${row}-${col}`;\n\n // Handsontable.Core type is missing guid\n const instanceGuid = (instance as unknown as { guid: string }).guid;\n\n const portalContainerKey = `${instanceGuid}-${key}`;\n const portalKey = `${key}-${instanceGuid}`;\n\n if (TD && !TD.getAttribute('ghost-table')) {\n const cachedPortalContainer = portalContainerCache.current.get(portalContainerKey);\n // When the cached portal container is still attached to the same\n // TD as the previous render, the DOM is already correct and must\n // not be wiped. Wiping detaches the React-managed children, which\n // forces a full remount of the renderer component on every grid\n // render (see issue #10800).\n const containerInPlace = !!cachedPortalContainer && cachedPortalContainer.parentNode === TD;\n\n const rendererElement = (\n <Renderer instance={instance}\n TD={TD}\n row={row}\n col={col}\n prop={prop}\n value={value}\n cellProperties={cellProperties}/>\n );\n\n const { portal, portalContainer } = createPortal(\n rendererElement, TD.ownerDocument, portalKey, cachedPortalContainer\n );\n\n if (!containerInPlace) {\n while (TD.firstChild) {\n TD.removeChild(TD.firstChild);\n }\n TD.appendChild(portalContainer);\n }\n\n portalContainerCache.current.set(portalContainerKey, portalContainer);\n renderedPortalContainerKeys.current.add(portalContainerKey);\n portalCache.current.set(portalKey, portal);\n }\n\n renderedCellCache.current.set(key, TD);\n return TD;\n };\n }, []);\n\n const renderersPortalManager = useRef<RenderersPortalManagerRef>(() => undefined);\n\n const setRenderersPortalManagerRef = useCallback((pmComponent: RenderersPortalManagerRef) => {\n renderersPortalManager.current = pmComponent;\n }, []);\n\n const pushCellPortalsIntoPortalManager = useCallback(() => {\n // Evict portal containers whose cells were not rendered in this pass (e.g.\n // scrolled out of the viewport). Their container DIVs are already detached\n // from the DOM, so without this they would be retained forever, leaking\n // O(rows × cols) detached nodes for component-based renderers. Containers\n // still in the viewport stay cached, preserving the in-place reuse that\n // avoids remounting renderer components on every grid render (#10800).\n const liveKeys = renderedPortalContainerKeys.current;\n\n portalContainerCache.current.forEach((_, cacheKey) => {\n if (!liveKeys.has(cacheKey)) {\n portalContainerCache.current.delete(cacheKey);\n }\n });\n\n renderersPortalManager.current!([...portalCache.current.values()]);\n }, []);\n\n const contextImpl: HotTableContextImpl = useMemo(() => ({\n componentRendererColumns: componentRendererColumns.current,\n columnsSettings: columnsSettings.current,\n emitColumnSettings: setHotColumnSettings,\n trimColumnSettings,\n getRendererWrapper,\n clearPortalCache,\n clearRenderedCellCache,\n getPortalContainerCacheSize,\n setRenderersPortalManagerRef,\n pushCellPortalsIntoPortalManager\n }), [setHotColumnSettings, trimColumnSettings, getRendererWrapper, clearRenderedCellCache, getPortalContainerCacheSize, setRenderersPortalManagerRef, pushCellPortalsIntoPortalManager]);\n\n return (\n <HotTableContext.Provider value={contextImpl}>{children}</HotTableContext.Provider>\n );\n};\n\n/**\n * Exposes the table context object to components\n *\n * @returns HotTableContext\n */\nfunction useHotTableContext(): HotTableContextImpl {\n return useContext(HotTableContext)!;\n}\n\nexport { HotTableContextProvider, useHotTableContext };\n","import React, {\n FC,\n PropsWithChildren,\n createContext,\n useContext,\n useMemo,\n} from 'react';\n\nexport interface HotColumnContextImpl {\n /**\n * Column index within a HotTable.\n */\n readonly columnIndex: number;\n\n /**\n * Get the `Document` object corresponding to the main component element.\n *\n * @returns The `Document` object used by the component.\n */\n readonly getOwnerDocument: () => Document | null;\n}\n\nconst HotColumnContext = createContext<HotColumnContextImpl | undefined>(undefined);\n\nconst HotColumnContextProvider: FC<PropsWithChildren<HotColumnContextImpl>> = ({ columnIndex, getOwnerDocument, children }) => {\n\n const contextImpl: HotColumnContextImpl = useMemo(() => ({\n columnIndex,\n getOwnerDocument\n }), [columnIndex, getOwnerDocument]);\n\n return (\n <HotColumnContext.Provider value={contextImpl}>{children}</HotColumnContext.Provider>\n );\n};\n\nconst useHotColumnContext = () => useContext(HotColumnContext)!;\n\nexport { useHotColumnContext, HotColumnContextProvider };\n","import React, {\n DependencyList,\n FC,\n MutableRefObject,\n ReactNode,\n Ref,\n RefObject,\n createContext,\n useContext,\n useDeferredValue,\n useImperativeHandle,\n useMemo,\n useState,\n useRef,\n useCallback,\n useEffect,\n Dispatch,\n} from 'react';\nimport Handsontable from 'handsontable/base';\nimport { HotEditorHooks, UseHotEditorImpl } from './types';\n\ntype HookPropName = keyof Handsontable.editors.BaseEditor | 'constructor';\n\nconst AbstractMethods: (keyof Handsontable.editors.BaseEditor)[] = [\n 'close',\n 'focus',\n 'open',\n];\nconst ExcludedMethods: (keyof Handsontable.editors.BaseEditor)[] = [\n 'getValue',\n 'setValue',\n];\n\nconst MethodsMap: Partial<\n Record<keyof Handsontable.editors.BaseEditor, keyof HotEditorHooks>\n> = {\n open: 'onOpen',\n close: 'onClose',\n prepare: 'onPrepare',\n focus: 'onFocus',\n};\n\n/**\n * Create a class to be passed to the Handsontable's settings.\n *\n * @param {RefObject<HotEditorHooks>} hooksRef Reference to component-based editor overridden hooks object.\n * @param {RefObject} instanceRef Reference to Handsontable-native custom editor class instance.\n * @returns {Function} A class to be passed to the Handsontable editor settings.\n */\nexport function makeEditorClass(\n hooksRef: MutableRefObject<HotEditorHooks | null>,\n instanceRef: MutableRefObject<Handsontable.editors.BaseEditor | null>\n): typeof Handsontable.editors.BaseEditor {\n return class CustomEditor\n extends Handsontable.editors.BaseEditor\n implements Handsontable.editors.BaseEditor {\n private value: any;\n\n constructor(hotInstance: Handsontable.Core) {\n super(hotInstance);\n instanceRef.current = this;\n\n (\n Object.getOwnPropertyNames(\n Handsontable.editors.BaseEditor.prototype\n ) as HookPropName[]\n ).forEach((propName) => {\n if (propName === 'constructor' || ExcludedMethods.includes(propName)) {\n return;\n }\n\n const baseMethod = Handsontable.editors.BaseEditor.prototype[propName];\n (CustomEditor.prototype as any)[propName] = function (\n this: CustomEditor,\n ...args: any[]\n ) {\n let result;\n\n if (!AbstractMethods.includes(propName)) {\n result = (baseMethod as (...a: any[]) => unknown).call(this, ...args); // call super\n }\n\n if (\n MethodsMap[propName] &&\n hooksRef.current?.[MethodsMap[propName]!]\n ) {\n result = (hooksRef.current[MethodsMap[propName]!] as any).call(\n this,\n ...args\n );\n }\n\n return result;\n }.bind(this);\n });\n }\n\n focus() { }\n\n getValue() {\n return this.value;\n }\n\n setValue(newValue: any) {\n this.value = newValue;\n }\n\n open() { }\n\n close() { }\n };\n}\n\ninterface EditorContextType {\n hooksRef: Ref<HotEditorHooks>;\n hotCustomEditorInstanceRef: RefObject<Handsontable.editors.BaseEditor>;\n}\n\n/**\n * Context to provide Handsontable-native custom editor class instance to overridden hooks object.\n */\nexport const EditorContext = createContext<EditorContextType | undefined>(\n undefined\n);\n\ninterface EditorContextProviderProps {\n hooksRef: Ref<HotEditorHooks>;\n hotCustomEditorInstanceRef: RefObject<Handsontable.editors.BaseEditor>;\n children: ReactNode;\n}\n\n/**\n * Provider of the context that exposes Handsontable-native editor instance and passes hooks object\n * for custom editor components.\n *\n * @param {Ref} hooksRef Reference for component-based editor overridden hooks object.\n * @param {RefObject} hotCustomEditorInstanceRef Reference to Handsontable-native editor instance.\n */\nexport const EditorContextProvider: FC<EditorContextProviderProps> = ({\n hooksRef,\n hotCustomEditorInstanceRef,\n children,\n}) => {\n return (\n <EditorContext.Provider value={{ hooksRef, hotCustomEditorInstanceRef }}>\n {children}\n </EditorContext.Provider>\n );\n};\n\ntype EditorWithPosition = Handsontable.editors.BaseEditor & { position?: string };\n\n/**\n * Applies editor overlay position/dimensions to an element.\n * @returns true if position was applied, false if editor should close (e.g. cell no longer available).\n */\nfunction applyEditorPosition(\n el: HTMLElement,\n editor: EditorWithPosition,\n hot: Handsontable.Core,\n td: Element | null | undefined\n): boolean {\n const rootWindow = hot.rootWindow || window;\n const pageX = rootWindow.pageXOffset ?? 0;\n const pageY = rootWindow.pageYOffset ?? 0;\n const isRtl = typeof hot.isRtl === 'function' && hot.isRtl();\n const position = editor.position;\n\n const applyTdRect = (rect: DOMRect) => {\n el.style.top = `${pageY + rect.top - 1}px`;\n el.style.width = `${rect.width + 1}px`;\n el.style.height = `${rect.height + 1}px`;\n\n if (isRtl) {\n el.style.right = `${pageX + rect.right}px`;\n el.style.left = 'auto';\n } else {\n el.style.left = `${pageX + rect.left - 1}px`;\n el.style.right = 'auto';\n }\n };\n\n if (position === 'portal') {\n const cell = td ?? (typeof editor.getEditedCell === 'function' ? editor.getEditedCell.call(editor) : null);\n\n if (!cell?.getBoundingClientRect) {\n return false;\n }\n\n applyTdRect(cell.getBoundingClientRect());\n\n return true;\n }\n\n const getEditedCellRect = editor.getEditedCellRect;\n const rect = typeof getEditedCellRect === 'function' ? getEditedCellRect.call(editor) : null;\n\n if (rect) {\n const rootElement = hot.rootElement;\n\n if (rootElement?.getBoundingClientRect) {\n const rootRect = rootElement.getBoundingClientRect();\n\n el.style.top = `${pageY + rootRect.top + rect.top}px`;\n el.style.width = `${rect.width}px`;\n el.style.height = `${rect.height}px`;\n\n if (isRtl) {\n el.style.right = `${pageX + rootRect.right - rect.start}px`;\n el.style.left = 'auto';\n } else {\n el.style.left = `${pageX + rootRect.left + rect.start}px`;\n el.style.right = 'auto';\n }\n\n return true;\n }\n }\n\n if (td?.getBoundingClientRect) {\n applyTdRect(td.getBoundingClientRect());\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Hook that allows encapsulating custom behaviours of component-based editor by customizing passed ref with overridden hooks object.\n *\n * @param {HotEditorHooks} overriddenHooks Overrides specific for the custom editor.\n * @param {DependencyList} deps Overridden hooks object React dependency list.\n * @returns {UseHotEditorImpl} Editor API methods\n */\nexport function useHotEditor<T>(\n overriddenHooks?: HotEditorHooks,\n deps?: DependencyList\n): UseHotEditorImpl<T> {\n const { hooksRef, hotCustomEditorInstanceRef } =\n useContext(EditorContext)!;\n const [rerenderTrigger, setRerenderTrigger] = useState(0);\n const [editorValue, setEditorValue] = useState<T>();\n\n // return a deferred value that allows for optimizing performance by delaying the update of a value until the next render.\n const deferredValue = useDeferredValue(editorValue);\n\n useImperativeHandle(\n hooksRef,\n () => ({\n ...overriddenHooks,\n onOpen() {\n setEditorValue(hotCustomEditorInstanceRef.current?.getValue() as T | undefined);\n overriddenHooks?.onOpen?.();\n setRerenderTrigger((t) => t + 1);\n },\n }),\n deps\n );\n\n return useMemo(\n () => ({\n get value(): T | undefined {\n return deferredValue;\n },\n setValue(newValue) {\n setEditorValue(newValue);\n hotCustomEditorInstanceRef.current?.setValue(newValue);\n },\n get isOpen() {\n return hotCustomEditorInstanceRef.current?.isOpened() ?? false;\n },\n finishEditing() {\n hotCustomEditorInstanceRef.current?.finishEditing();\n },\n get row() {\n const row = hotCustomEditorInstanceRef.current?.row;\n return row ?? undefined;\n },\n get col() {\n const col = hotCustomEditorInstanceRef.current?.col;\n return col ?? undefined;\n },\n }),\n [rerenderTrigger, hotCustomEditorInstanceRef, deferredValue]\n );\n}\n\n\ntype EditorChildrenProps<T> = {\n value: T;\n setValue: Dispatch<T>;\n finishEditing: () => void;\n isOpen: boolean;\n row: number | undefined;\n col: number | undefined;\n mainElementRef: React.RefObject<HTMLDivElement>;\n}\n\n// Render prop function type\ntype EditorRenderProp<T> = (props: EditorChildrenProps<T>) => React.ReactNode;\n\n// EditorComponent props - children typed to work with JSX syntax\ntype EditorComponentProps = {\n onPrepare?: (row: number, column: number, prop: string | number, TD: HTMLTableCellElement, originalValue: any, cellProperties: Handsontable.CellProperties) => void;\n onOpen?: () => void;\n onClose?: () => void;\n onFocus?: () => void;\n shortcutsGroup?: string;\n shortcuts?: {\n keys: string[][];\n callback: (props: any, event: KeyboardEvent) => boolean | void;\n group?: string;\n runOnlyIf?: () => boolean;\n captureCtrl?: boolean;\n preventDefault?: boolean;\n stopPropagation?: boolean;\n relativeToGroup?: string;\n position?: \"before\" | \"after\";\n forwardToContext?: any;\n }[];\n}\n\n\nexport function EditorComponent<T = any>({\n onPrepare,\n onClose,\n onOpen,\n onFocus,\n children,\n shortcutsGroup = \"custom-editor\",\n shortcuts,\n}: EditorComponentProps & { children?: EditorRenderProp<T> }): React.ReactElement {\n const mainElementRef = useRef<HTMLDivElement>(null);\n const currentValue = useRef<T>(undefined);\n const [themeClassName, setThemeClassName] = useState<string | undefined>();\n const { hotCustomEditorInstanceRef } = useContext(EditorContext)!;\n\n const registerShortcuts = useCallback(() => {\n if (!hotCustomEditorInstanceRef.current?.hot) return;\n\n hotCustomEditorInstanceRef.current?.hot?.getShortcutManager().setActiveContextName(\"editor\");\n\n const shortcutManager = hotCustomEditorInstanceRef.current?.hot?.getShortcutManager();\n const editorContext = shortcutManager.getContext('editor');\n const contextConfig = {\n group: shortcutsGroup,\n };\n\n if (shortcuts) {\n editorContext?.addShortcuts(shortcuts.map(shortcut => ({\n ...shortcut,\n group: shortcut.group || shortcutsGroup,\n relativeToGroup: shortcut.relativeToGroup ||\n 'editorManager.handlingEditor',\n position: shortcut.position || 'before',\n callback: (event: KeyboardEvent) =>\n shortcut.callback({ value: currentValue.current, setValue, finishEditing }, event),\n })),\n //@ts-ignore\n contextConfig\n );\n }\n }, [shortcuts]);\n\n\n const unRegisterShortcuts = useCallback(() => {\n if (!hotCustomEditorInstanceRef.current?.hot) return;\n\n const shortcutManager = hotCustomEditorInstanceRef.current?.hot?.getShortcutManager();\n const editorContext = shortcutManager.getContext(\"editor\")!;\n editorContext.removeShortcutsByGroup(shortcutsGroup);\n }, [shortcuts]);\n\n const refreshDimensions = useCallback(() => {\n const editor = hotCustomEditorInstanceRef.current as EditorWithPosition | null;\n const el = mainElementRef.current;\n\n if (!editor || !el) return;\n\n const hot = editor.hot;\n\n if (!hot) return;\n\n if (typeof editor.isOpened !== 'function' || !editor.isOpened()) return;\n\n if (!applyEditorPosition(el, editor, hot, null) && typeof editor.close === 'function') {\n editor.close();\n }\n }, []);\n\n const unRegisterScrollHooks = useCallback(() => {\n const editor = hotCustomEditorInstanceRef.current;\n const hot = editor?.hot;\n\n if (!hot || typeof hot.removeHook !== 'function') return;\n\n hot.removeHook('afterScrollHorizontally', refreshDimensions);\n hot.removeHook('afterScrollVertically', refreshDimensions);\n }, [refreshDimensions]);\n\n const registerScrollHooks = useCallback(() => {\n const editor = hotCustomEditorInstanceRef.current;\n const hot = editor?.hot;\n\n if (!hot || typeof hot.addHook !== 'function') return;\n\n hot.addHook('afterScrollHorizontally', refreshDimensions);\n hot.addHook('afterScrollVertically', refreshDimensions);\n }, [refreshDimensions]);\n\n const { value, setValue, finishEditing, isOpen, col, row } = useHotEditor<T>({\n onOpen: () => {\n if (!mainElementRef.current) return;\n\n const themeName = hotCustomEditorInstanceRef.current?.hot.getCurrentThemeName();\n\n if (themeName) setThemeClassName(themeName);\n \n mainElementRef.current.style.display = 'block';\n \n onOpen?.();\n\n const el = mainElementRef.current;\n const editor = hotCustomEditorInstanceRef.current as EditorWithPosition | null;\n\n if (el && editor?.hot) {\n applyEditorPosition(el, editor, editor.hot, null);\n }\n\n registerShortcuts();\n registerScrollHooks();\n },\n onClose: () => {\n if (!mainElementRef.current) return;\n \n mainElementRef.current.style.display = 'none';\n\n onClose?.();\n unRegisterShortcuts();\n unRegisterScrollHooks();\n },\n onPrepare: (_row, _column, _prop, TD, _originalValue, _cellProperties) => {\n onPrepare?.(_row, _column, _prop, TD, _originalValue, _cellProperties);\n },\n onFocus: () => {\n onFocus?.();\n },\n });\n\n useEffect(() => {\n currentValue.current = value;\n }, [value]);\n\n const stopMousedownPropagation = (e: React.MouseEvent) => {\n e.stopPropagation();\n };\n\n\n return (\n <div\n ref={mainElementRef}\n className={themeClassName}\n style={{\n display: 'none',\n position: 'absolute',\n background: '#fff',\n border: '0px',\n padding: '0px',\n zIndex: 100,\n }}\n onMouseDown={stopMousedownPropagation}\n >\n {(children as EditorRenderProp<T>)({ value: value as T, setValue, finishEditing, mainElementRef: mainElementRef as React.RefObject<HTMLDivElement>, isOpen, col, row })}\n </div>\n );\n};","import React, {\n FC,\n ReactElement,\n useEffect,\n useRef,\n} from 'react';\nimport { HotTableProps, HotColumnProps, HotEditorHooks } from './types';\nimport {\n createEditorPortal,\n displayAnyChildrenWarning,\n displayObsoleteRenderersEditorsWarning\n} from './helpers';\nimport { SettingsMapper } from './settingsMapper';\nimport Handsontable from 'handsontable/base';\nimport { useHotTableContext } from './hotTableContext'\nimport { useHotColumnContext } from './hotColumnContext'\nimport { EditorContextProvider, makeEditorClass } from './hotEditor';\n\nconst isHotColumn = (childNode: any): childNode is ReactElement => childNode.type === HotColumn;\n\nconst internalProps = ['_columnIndex', '_getOwnerDocument', 'children'];\n\nconst HotColumn: FC<HotColumnProps> = (props) => {\n const { componentRendererColumns, emitColumnSettings, getRendererWrapper } = useHotTableContext();\n const { columnIndex, getOwnerDocument } = useHotColumnContext();\n\n /**\n * Reference to component-based editor overridden hooks object.\n */\n const localEditorHooksRef = useRef<HotEditorHooks | null>(null);\n\n /**\n * Reference to HOT-native custom editor class instance.\n */\n const localEditorClassInstance = useRef<Handsontable.editors.BaseEditor | null>(null);\n\n /**\n * Logic performed after mounting & updating of the HotColumn component.\n */\n useEffect(() => {\n\n /**\n * Filter out all the internal properties and return an object with just the Handsontable-related props.\n *\n * @returns {Object}\n */\n const getSettingsProps = (): HotTableProps => {\n return Object.keys(props)\n .filter(key => !internalProps.includes(key))\n .reduce<HotTableProps>((obj, key) => {\n (obj as any)[key] = props[key];\n return obj;\n }, {});\n };\n\n /**\n * Create the column settings based on the data provided to the `HotColumn` component and its child components.\n */\n const createColumnSettings = (): Handsontable.ColumnSettings => {\n const columnSettings = SettingsMapper.getSettings(getSettingsProps()) as unknown as Handsontable.ColumnSettings;\n\n if (props.renderer) {\n columnSettings.renderer = getRendererWrapper(props.renderer);\n componentRendererColumns.set(columnIndex, true);\n } else if (props.hotRenderer) {\n columnSettings.renderer = props.hotRenderer;\n }\n\n if (props.editor) {\n columnSettings.editor = makeEditorClass(localEditorHooksRef, localEditorClassInstance);\n } else if (props.hotEditor) {\n columnSettings.editor = props.hotEditor;\n }\n\n return columnSettings\n };\n\n const columnSettings = createColumnSettings();\n emitColumnSettings(columnSettings, columnIndex);\n\n if (!displayObsoleteRenderersEditorsWarning(props.children)) {\n displayAnyChildrenWarning(props.children);\n }\n });\n\n const editorPortal = createEditorPortal(getOwnerDocument(), props.editor);\n\n /**\n * Render the portals of the editors, if there are any.\n *\n * @returns {ReactElement}\n */\n return (\n <EditorContextProvider hooksRef={localEditorHooksRef}\n hotCustomEditorInstanceRef={localEditorClassInstance}>\n {editorPortal}\n </EditorContextProvider>\n )\n}\n\nexport { HotColumn, isHotColumn };\n","import React, {\n Dispatch,\n ReactPortal,\n forwardRef,\n Fragment,\n useImperativeHandle,\n useState,\n} from 'react';\n\nexport type RenderersPortalManagerRef = Dispatch<ReactPortal[]>;\n\n/**\n * Component used to manage the renderer component portals.\n */\nexport const RenderersPortalManager = forwardRef<RenderersPortalManagerRef, {}>((_, ref) => {\n const [portals, setPortals] = useState<ReactPortal[]>([]);\n useImperativeHandle(ref, () => setPortals);\n\n return (\n <Fragment>\n {portals}\n </Fragment>\n );\n});\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","import React, {\n Children,\n Fragment,\n useEffect,\n useCallback,\n useImperativeHandle,\n useRef,\n forwardRef\n} from 'react';\nimport Handsontable from 'handsontable/base';\nimport { SettingsMapper } from './settingsMapper';\nimport { RenderersPortalManager } from './renderersPortalManager';\nimport { HotColumn, isHotColumn } from './hotColumn';\nimport { HotEditorHooks, HotTableProps, HotTableRef } from './types';\nimport {\n HOT_DESTROYED_WARNING,\n AUTOSIZE_WARNING,\n createEditorPortal,\n getContainerAttributesProps,\n isCSR,\n warn,\n displayObsoleteRenderersEditorsWarning,\n useUpdateEffect,\n displayChildrenOfTypeWarning\n} from './helpers';\nimport PropTypes from 'prop-types';\nimport { getRenderer } from 'handsontable/renderers/registry';\nimport { getEditor } from 'handsontable/editors/registry';\nimport { useHotTableContext } from './hotTableContext'\nimport { HotColumnContextProvider } from './hotColumnContext'\nimport { EditorContextProvider, makeEditorClass } from './hotEditor';\n\nconst HotTableInner = forwardRef<\n HotTableRef,\n HotTableProps\n>((props, ref) => {\n\n /**\n * Reference to the Handsontable instance.\n */\n const __hotInstance = useRef<Handsontable | null>(null);\n\n /**\n * Reference to the main Handsontable DOM element.\n */\n const hotElementRef = useRef<HTMLDivElement>(null);\n\n /**\n * Reference to component-based editor overridden hooks object.\n */\n const globalEditorHooksRef = useRef<HotEditorHooks | null>(null);\n\n /**\n * Reference to HOT-native custom editor class instance.\n */\n const globalEditorClassInstance = useRef<Handsontable.editors.BaseEditor | null>(null);\n\n /**\n * Reference to the previous props object.\n */\n const prevProps = useRef<HotTableProps>();\n\n /**\n * HotTable context exposing helper functions.\n */\n const context = useHotTableContext();\n\n /**\n * Getter for the property storing the Handsontable instance.\n */\n const getHotInstance = useCallback((): Handsontable | null => {\n if (!__hotInstance.current || !__hotInstance.current.isDestroyed) {\n\n // Will return the Handsontable instance or `null` if it's not yet been created.\n return __hotInstance.current;\n\n } else {\n console.warn(HOT_DESTROYED_WARNING);\n\n return null;\n }\n }, [__hotInstance]);\n\n const isHotInstanceDestroyed = useCallback((): boolean => {\n return !__hotInstance.current || __hotInstance.current.isDestroyed;\n }, [__hotInstance]);\n\n /**\n * Clear both the editor and the renderer cache.\n */\n const clearCache = useCallback((): void => {\n context.clearRenderedCellCache();\n context.componentRendererColumns.clear();\n }, [context]);\n\n /**\n * Get the `Document` object corresponding to the main component element.\n *\n * @returns The `Document` object used by the component.\n */\n const getOwnerDocument = useCallback((): Document | null => {\n if (isCSR()) {\n return hotElementRef.current ? hotElementRef.current.ownerDocument : document;\n }\n\n return null;\n }, [hotElementRef]);\n\n /**\n * Create a new settings object containing the column settings and global editors and renderers.\n *\n * @returns {Handsontable.GridSettings} New global set of settings for Handsontable.\n */\n const createNewGlobalSettings = (init: boolean = false, prevProps: HotTableProps = {}): Handsontable.GridSettings => {\n const initOnlySettingKeys = !isHotInstanceDestroyed() ? // Needed for React's double-rendering.\n ((getHotInstance()?.getSettings() as any)?._initOnlySettings || []) :\n [];\n const newSettings = SettingsMapper.getSettings(\n props, {\n prevProps,\n isInit: init,\n initOnlySettingKeys\n }\n );\n\n if (context.columnsSettings.length) {\n newSettings.columns = context.columnsSettings;\n }\n\n if (props.renderer) {\n newSettings.renderer = context.getRendererWrapper(props.renderer);\n context.componentRendererColumns.set('global', true);\n } else {\n newSettings.renderer = props.hotRenderer || getRenderer('text');\n }\n\n if (props.editor) {\n newSettings.editor = makeEditorClass(globalEditorHooksRef, globalEditorClassInstance);\n } else {\n newSettings.editor = props.hotEditor || getEditor('text');\n }\n\n return newSettings;\n };\n\n /**\n * Detect if `autoRowSize` or `autoColumnSize` is defined, and if so, throw an incompatibility warning.\n */\n const displayAutoSizeWarning = (hotInstance: Handsontable | null): void => {\n if (\n hotInstance &&\n (\n hotInstance.getPlugin('autoRowSize')?.enabled ||\n hotInstance.getPlugin('autoColumnSize')?.enabled\n )\n ) {\n if (context.componentRendererColumns.size > 0) {\n warn(AUTOSIZE_WARNING);\n }\n }\n };\n\n /**\n * Initialize Handsontable after the component has mounted.\n */\n useEffect(() => {\n // React guarantees child effects run before parent effects on each\n // commit, so by the time this parent useEffect runs, every HotColumn\n // has already written its slot. Trim to drop any leftover slots from\n // a previous mount (e.g. StrictMode's double-invoke or HMR).\n const hotColumnCount = Children.toArray(props.children).filter(isHotColumn).length;\n\n context.trimColumnSettings(hotColumnCount);\n\n const newGlobalSettings = createNewGlobalSettings(true);\n\n // Update prevProps with the current props\n prevProps.current = props;\n\n __hotInstance.current = new Handsontable.Core(hotElementRef.current!, newGlobalSettings);\n\n /**\n * Handsontable's `beforeViewRender` hook callback.\n */\n __hotInstance.current.addHook('beforeViewRender', () => {\n context.clearPortalCache();\n context.clearRenderedCellCache();\n });\n\n /**\n * Handsontable's `afterViewRender` hook callback.\n */\n __hotInstance.current.addHook('afterViewRender', () => {\n context.pushCellPortalsIntoPortalManager();\n });\n\n __hotInstance.current.init();\n\n displayAutoSizeWarning(__hotInstance.current);\n\n if (!displayObsoleteRenderersEditorsWarning(props.children)) {\n displayChildrenOfTypeWarning(props.children, HotColumn);\n }\n\n /**\n * Destroy the Handsontable instance when the parent component unmounts.\n */\n return () => {\n clearCache();\n getHotInstance()?.destroy();\n }\n }, []);\n\n /**\n * Logic performed after the component update.\n */\n useUpdateEffect((): void => {\n clearCache();\n\n const hotInstance = getHotInstance();\n\n // React guarantees child effects run before parent effects on each\n // commit, so by the time this parent useUpdateEffect runs, every\n // surviving HotColumn has already written its slot. Trim to drop\n // stale entries left behind by HotColumns that unmounted.\n const hotColumnCount = Children.toArray(props.children).filter(isHotColumn).length;\n\n context.trimColumnSettings(hotColumnCount);\n\n const newGlobalSettings = createNewGlobalSettings(false, prevProps.current);\n\n // Update prevProps with the current props\n prevProps.current = props;\n\n hotInstance?.updateSettings(newGlobalSettings, false);\n\n displayAutoSizeWarning(hotInstance);\n displayObsoleteRenderersEditorsWarning(props.children);\n });\n\n /**\n * Interface exposed to parent components by HotTable instance via React ref\n */\n useImperativeHandle(ref, () => ({\n get hotElementRef() {\n return hotElementRef.current!;\n },\n get hotInstance() {\n return getHotInstance();\n }\n }));\n\n /**\n * Render the component.\n */\n const hotColumnWrapped = Children.toArray(props.children)\n .filter(isHotColumn)\n .map((childNode, columnIndex) => (\n <HotColumnContextProvider columnIndex={columnIndex}\n getOwnerDocument={getOwnerDocument}\n key={columnIndex}>\n {childNode}\n </HotColumnContextProvider>\n ));\n\n const containerProps = getContainerAttributesProps(props);\n const editorPortal = createEditorPortal(getOwnerDocument(), props.editor);\n\n return (\n <Fragment>\n <div\n ref={hotElementRef}\n {...containerProps}\n style={{ height: '100%', ...containerProps.style }}\n >\n {hotColumnWrapped}\n </div>\n <RenderersPortalManager ref={context.setRenderersPortalManagerRef} />\n <EditorContextProvider hooksRef={globalEditorHooksRef}\n hotCustomEditorInstanceRef={globalEditorClassInstance}>\n {editorPortal}\n </EditorContextProvider>\n </Fragment>\n );\n});\n\n/**\n * Prop types to be checked at runtime.\n */\nHotTableInner.propTypes = {\n style: PropTypes.object,\n id: PropTypes.string,\n className: PropTypes.string\n};\n\nexport default HotTableInner;\nexport { HotTableInner };\n","import React, {\n ForwardRefExoticComponent,\n RefAttributes,\n useId,\n forwardRef,\n} from 'react';\nimport * as packageJson from '../package.json';\nimport { HotTableInner } from './hotTableInner';\nimport { HotTableProps, HotTableRef } from './types';\nimport { HotTableContextProvider } from './hotTableContext';\n\ninterface Version {\n version?: string;\n}\n\ntype HotTable = ForwardRefExoticComponent<HotTableProps & RefAttributes<HotTableRef>> & Version;\n\n/**\n * A Handsontable-ReactJS wrapper.\n *\n * To implement, use the `HotTable` tag with properties corresponding to Handsontable options.\n * For example:\n *\n * ```js\n * <HotTable id=\"hot\" data={dataObject} contextMenu={true} colHeaders={true} width={600} height={300} stretchH=\"all\" />\n *\n * // is analogous to\n * let hot = new Handsontable(document.getElementById('hot'), {\n * data: dataObject,\n * contextMenu: true,\n * colHeaders: true,\n * width: 600\n * height: 300\n * });\n *\n * ```\n */\nconst HotTable: HotTable = forwardRef<HotTableRef, HotTableProps>(({ children, ...props }, ref) => {\n const componentId = props.id ?? useId();\n\n return (\n <HotTableContextProvider>\n <HotTableInner id={componentId} {...props} ref={ref}>\n {children}\n </HotTableInner>\n </HotTableContextProvider>\n );\n})\n\n/**\n * Package version.\n *\n * @returns The version number of the package.\n */\nHotTable.version = (packageJson as any).version;\n\nexport default HotTable;\nexport { HotTable };\n"],"names":["bulkComponentContainer","AUTOSIZE_WARNING","OBSOLETE_HOTRENDERER_WARNING","OBSOLETE_HOTEDITOR_WARNING","UNEXPECTED_HOTTABLE_CHILDREN_WARNING","UNEXPECTED_HOTCOLUMN_CHILDREN_WARNING","HOT_DESTROYED_WARNING","DEFAULT_CLASSNAME","warn","console","_console","apply","arguments","displayObsoleteRenderersEditorsWarning","children","hasChildElementOfType","displayChildrenOfTypeWarning","Component","childrenArray","React","Children","toArray","some","child","type","displayAnyChildrenWarning","length","props","createEditorPortal","doc","Editor","editorElement","createElement","containerProps","getContainerAttributesProps","className","concat","ReactDOM","createPortal","body","rElement","ownerDocument","undefined","document","portalKey","cachedContainer","portalContainer","createDocumentFragment","appendChild","portal","randomizeId","id","Math","random","toString","substring","style","isCSR","window","isObjectLike","value","_typeof","isPlainObject","prototype","Object","getPrototypeOf","isArray","Array","areEquivalentSettingsValue","previousValue","currentValue","RegExp","source","flags","index","previousKeys","keys","currentKeys","_i","_previousKeys","key","hasOwnProperty","call","useUpdateEffect","effect","deps","notInitialRender","useRef","useEffect","current","DEEP_COMPARABLE_SETTINGS","SettingsMapper","_classCallCheck","_createClass","getSettings","properties","_ref","_ref$prevProps","prevProps","_ref$isInit","isInit","_ref$initOnlySettingK","initOnlySettingKeys","shouldSkipProp","includes","newSettings","HotTableContext","createContext","HotTableContextProvider","columnsSettings","setHotColumnSettings","useCallback","columnSettings","columnIndex","trimColumnSettings","componentRendererColumns","Map","renderedCellCache","clearRenderedCellCache","clear","portalCache","portalContainerCache","renderedPortalContainerKeys","Set","clearPortalCache","getPortalContainerCacheSize","size","getRendererWrapper","Renderer","__internalRenderer","instance","TD","row","col","prop","cellProperties","instanceGuid","guid","portalContainerKey","getAttribute","cachedPortalContainer","get","containerInPlace","parentNode","rendererElement","_createPortal","firstChild","removeChild","set","add","renderersPortalManager","setRenderersPortalManagerRef","pmComponent","pushCellPortalsIntoPortalManager","liveKeys","forEach","_","cacheKey","has","_toConsumableArray","values","contextImpl","useMemo","emitColumnSettings","Provider","useHotTableContext","useContext","HotColumnContext","HotColumnContextProvider","getOwnerDocument","useHotColumnContext","AbstractMethods","ExcludedMethods","MethodsMap","open","close","prepare","focus","makeEditorClass","hooksRef","instanceRef","_Handsontable$editors","CustomEditor","hotInstance","_this","_callSuper","getOwnPropertyNames","Handsontable","editors","BaseEditor","propName","baseMethod","_hooksRef$current","result","_len","args","_key","_ref2","bind","_inherits","getValue","setValue","newValue","EditorContext","EditorContextProvider","_ref3","hotCustomEditorInstanceRef","applyEditorPosition","el","editor","hot","td","_rootWindow$pageXOffs","_rootWindow$pageYOffs","rootWindow","pageX","pageXOffset","pageY","pageYOffset","isRtl","position","applyTdRect","rect","top","width","height","right","left","cell","getEditedCell","getBoundingClientRect","getEditedCellRect","rootElement","rootRect","start","useHotEditor","overriddenHooks","_ref4","_useState","useState","_useState2","_slicedToArray","rerenderTrigger","setRerenderTrigger","_useState3","_useState4","editorValue","setEditorValue","deferredValue","useDeferredValue","useImperativeHandle","_objectSpread","onOpen","_hotCustomEditorInsta","_overriddenHooks$onOp","t","_hotCustomEditorInsta2","isOpen","_hotCustomEditorInsta3","_hotCustomEditorInsta4","isOpened","finishEditing","_hotCustomEditorInsta5","_hotCustomEditorInsta6","_hotCustomEditorInsta7","EditorComponent","_ref5","onPrepare","onClose","onFocus","_ref5$shortcutsGroup","shortcutsGroup","shortcuts","mainElementRef","_useState5","_useState6","themeClassName","setThemeClassName","_ref6","registerShortcuts","_hotCustomEditorInsta8","_hotCustomEditorInsta9","_hotCustomEditorInsta0","getShortcutManager","setActiveContextName","shortcutManager","editorContext","getContext","contextConfig","group","addShortcuts","map","shortcut","relativeToGroup","callback","event","unRegisterShortcuts","_hotCustomEditorInsta1","_hotCustomEditorInsta10","removeShortcutsByGroup","refreshDimensions","unRegisterScrollHooks","removeHook","registerScrollHooks","addHook","_useHotEditor","_hotCustomEditorInsta11","themeName","getCurrentThemeName","display","_row","_column","_prop","_originalValue","_cellProperties","stopMousedownPropagation","e","stopPropagation","ref","background","border","padding","zIndex","onMouseDown","isHotColumn","childNode","HotColumn","internalProps","_useHotTableContext","_useHotColumnContext","localEditorHooksRef","localEditorClassInstance","getSettingsProps","filter","reduce","obj","createColumnSettings","renderer","hotRenderer","hotEditor","editorPortal","RenderersPortalManager","forwardRef","portals","setPortals","Fragment","ReactPropTypesSecret","ReactPropTypesSecret_1","require$$0","emptyFunction","emptyFunctionWithReset","resetWarningCache","factoryWithThrowingShims","shim","componentName","location","propFullName","secret","err","Error","name","isRequired","getShim","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","propTypesModule","exports","require$$2","HotTableInner","__hotInstance","hotElementRef","globalEditorHooksRef","globalEditorClassInstance","context","getHotInstance","isDestroyed","isHotInstanceDestroyed","clearCache","createNewGlobalSettings","_getHotInstance","init","_initOnlySettings","columns","getRenderer","getEditor","displayAutoSizeWarning","_hotInstance$getPlugi","_hotInstance$getPlugi2","getPlugin","enabled","hotColumnCount","newGlobalSettings","Core","_getHotInstance2","destroy","updateSettings","hotColumnWrapped","_extends","propTypes","HotTable","_props$id","_objectWithoutProperties","_excluded","componentId","useId","version","packageJson"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;","x_google_ignoreList":[7,8,9]}
|
|
1
|
+
{"version":3,"file":"react-handsontable.js","sources":["../src/helpers.tsx","../src/settingsMapper.ts","../src/hotTableContext.tsx","../src/hotColumnContext.tsx","../src/hotEditor.tsx","../src/hotColumn.tsx","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js","../../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js","../src/renderersPortalManager.tsx","../src/hotTableInner.tsx","../src/hotTable.tsx"],"sourcesContent":["import React, {\n ComponentType,\n CSSProperties,\n DependencyList,\n EffectCallback,\n ReactNode,\n ReactPortal,\n useEffect,\n} from 'react';\nimport ReactDOM from 'react-dom';\nimport Handsontable from 'handsontable/base';\nimport { getEditor } from 'handsontable/editors/registry';\nimport { HotRendererProps, HotTableProps } from './types';\n\nlet bulkComponentContainer: DocumentFragment | null = null;\n\n/**\n * Warning message for the `autoRowSize`/`autoColumnSize` compatibility check.\n */\nexport const AUTOSIZE_WARNING = 'Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, ' +\n 'which are not compatible with the component-based renderers. Disable `autoRowSize` and `autoColumnSize` to ' +\n 'prevent row and column misalignment.';\n\n/**\n * Warning message for the `hot-renderer` obsolete renderer passing method.\n */\nexport const OBSOLETE_HOTRENDERER_WARNING = 'Providing a component-based renderer using `hot-renderer`-annotated ' +\n 'component is no longer supported. Pass your component using `renderer` prop of the `HotTable` or `HotColumn` ' +\n 'component instead.';\n\n/**\n * Warning message for the `hot-editor` obsolete editor passing method.\n */\nexport const OBSOLETE_HOTEDITOR_WARNING = 'Providing a component-based editor using `hot-editor`-annotated ' +\n 'component is no longer supported. Pass your component using `editor` prop of the `HotTable` or `HotColumn` ' +\n 'component instead.';\n\n/**\n * Warning message for the unexpected children of HotTable component.\n */\nexport const UNEXPECTED_HOTTABLE_CHILDREN_WARNING = 'Unexpected children nodes found in HotTable component. ' +\n 'Only HotColumn components are allowed.';\n\n/**\n * Warning message for the unexpected children of HotColumn component.\n */\nexport const UNEXPECTED_HOTCOLUMN_CHILDREN_WARNING = 'Unexpected children nodes found in HotColumn component. ' +\n 'HotColumn components do not support any children.';\n\n/**\n * Warning when a Handsontable function renderer is passed to the React `renderer` prop.\n *\n * That prop is a React component. A classic function renderer belongs on `hotRenderer`.\n */\nexport const CLASSIC_FUNCTION_RENDERER_WARNING = 'The `renderer` prop expects a React component. ' +\n 'Pass a Handsontable function renderer to `hotRenderer` instead.';\n\n/**\n * Warning when a Handsontable editor (an editor class or a registered editor name) is passed to the\n * React `editor` prop.\n *\n * That prop is a React component. A Handsontable editor belongs on `hotEditor`.\n */\nexport const NATIVE_EDITOR_IN_EDITOR_PROP_WARNING = 'The `editor` prop expects a React component. ' +\n 'Pass a Handsontable editor class or editor name to `hotEditor` instead.';\n\n/**\n * Message for the warning thrown if the Handsontable instance has been destroyed.\n */\nexport const HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' +\n ' used properly.';\n\n/**\n * Default classname given to the wrapper container.\n */\nexport const DEFAULT_CLASSNAME = 'hot-wrapper-editor-container';\n\n/**\n * Classname for the stable host that holds React editor portals.\n * Distinct from `DEFAULT_CLASSNAME` so page CSS and `querySelector` do not hit both nodes.\n */\nexport const EDITOR_PORTAL_HOST_CLASSNAME = 'hot-wrapper-editor-portal-host';\n\n/**\n * Warning when the editor portal host cannot be moved into `rootPortalElement`.\n */\nexport const MISSING_ROOT_PORTAL_WARNING = 'The React editor portal host could not be attached to ' +\n '`rootPortalElement`. The editor stays on `document.body` and clicks on it may fail to commit.';\n\n/**\n * Logs warn to the console if the `console` object is exposed.\n *\n * @param {...*} args Values which will be logged.\n */\nexport function warn(...args: any[]) {\n if (typeof console !== 'undefined') {\n console.warn(...args);\n }\n}\n\n/**\n * Function renderers that already produced `CLASSIC_FUNCTION_RENDERER_WARNING`.\n * Keyed by the function, so one function warns once no matter how many cells render it.\n */\nconst warnedClassicFunctionRenderers = new WeakSet<object>();\n\n/**\n * Warn when `renderer` holds a Handsontable function renderer.\n *\n * A React component is called with one props object, so its `length` stays below 3.\n * A classic renderer declares `(instance, td, row, col, prop, value, cellProperties)`,\n * so its `length` is at least 3. The prop is still rendered as a component. Picking\n * the call style from `length` would change behavior, because a component with default\n * parameters reports `length` 0.\n *\n * @param {ComponentType} renderer Component passed through the `renderer` prop.\n */\nexport function warnAboutClassicFunctionRenderer(renderer: ComponentType<HotRendererProps>): void {\n if (typeof renderer !== 'function' || renderer.length < 3) {\n return;\n }\n\n if (warnedClassicFunctionRenderers.has(renderer)) {\n return;\n }\n\n warnedClassicFunctionRenderers.add(renderer);\n warn(CLASSIC_FUNCTION_RENDERER_WARNING);\n}\n\n/**\n * Detect if `hot-renderer` or `hot-editor` is defined, and if so, throw an incompatibility warning.\n *\n * @param {ReactNode} children Component children nodes.\n * @returns {boolean} 'true' if the warning was issued\n */\nexport function displayObsoleteRenderersEditorsWarning(children: ReactNode): boolean {\n if (hasChildElementOfType(children, 'hot-renderer')) {\n warn(OBSOLETE_HOTRENDERER_WARNING);\n\n return true;\n }\n if (hasChildElementOfType(children, 'hot-editor')) {\n warn(OBSOLETE_HOTEDITOR_WARNING);\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Detect if children of specified type are defined, and if so, throw an incompatibility warning.\n *\n * @param {ReactNode} children Component children nodes\n * @param {ComponentType} Component Component type to check\n * @returns {boolean} 'true' if the warning was issued\n */\nexport function displayChildrenOfTypeWarning(children: ReactNode, Component: ComponentType): boolean {\n const childrenArray: ReactNode[] = React.Children.toArray(children);\n\n if (childrenArray.some(child => (child as React.ReactElement).type !== Component)) {\n warn(UNEXPECTED_HOTTABLE_CHILDREN_WARNING);\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Detect if children is defined, and if so, throw an incompatibility warning.\n *\n * @param {ReactNode} children Component children nodes\n * @returns {boolean} 'true' if the warning was issued\n */\nexport function displayAnyChildrenWarning(children: ReactNode): boolean {\n const childrenArray: ReactNode[] = React.Children.toArray(children);\n\n if (childrenArray.length) {\n warn(UNEXPECTED_HOTCOLUMN_CHILDREN_WARNING);\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Check the existence of elements of the provided `type` from the `HotColumn` component's children.\n *\n * @param {ReactNode} children HotTable children array.\n * @param {string} type Either `'hot-renderer'` or `'hot-editor'`.\n * @returns {boolean} `true` if the child of that type was found, `false` otherwise.\n */\nfunction hasChildElementOfType(children: ReactNode, type: 'hot-renderer' | 'hot-editor'): boolean {\n const childrenArray: ReactNode[] = React.Children.toArray(children);\n\n return childrenArray.some((child) => {\n return (child as React.ReactElement).props[type] !== undefined;\n });\n}\n\n/**\n * Check whether the `editor` prop holds a component editor, as opposed to a boolean flag or a\n * Handsontable editor passed there by mistake.\n *\n * Both editor props accept a boolean, so a truthy check alone is not enough to tell a component\n * apart from a bare `editor={true}`. An editor class or editor name is not a component either (see\n * `isNativeEditor()`).\n *\n * @param {HotTableProps['editor']} editor The `editor` prop.\n * @returns {boolean} `true` when the prop carries a React component to render.\n */\nexport function isComponentEditor(editor: HotTableProps['editor']): boolean {\n return !!editor && typeof editor !== 'boolean' && !isNativeEditor(editor);\n}\n\n/**\n * Methods every Handsontable editor class inherits from `BaseEditor`.\n */\nconst NATIVE_EDITOR_METHODS = ['prepare', 'beginEditing', 'getValue', 'setValue', 'open', 'close'];\n\n/**\n * Check whether a value is a Handsontable editor: a registered editor name or an editor class.\n *\n * A class is recognized by the `BaseEditor` methods on its prototype rather than with `instanceof`,\n * so a class built on another copy of Handsontable is still recognized. A React class component\n * carries `prototype.isReactComponent`, and a function component does not have these methods, so\n * neither one matches.\n *\n * @param {*} editor The value to check.\n * @returns {boolean} `true` when the value is a Handsontable editor.\n */\nexport function isNativeEditor(editor: unknown): boolean {\n if (typeof editor === 'string') {\n return editor !== '';\n }\n\n if (typeof editor !== 'function') {\n return false;\n }\n\n const prototype = editor.prototype;\n\n if (!prototype || prototype.isReactComponent) {\n return false;\n }\n\n return NATIVE_EDITOR_METHODS.every(method => typeof prototype[method] === 'function');\n}\n\n/**\n * Check whether an editor is registered under a name.\n *\n * It asks `getEditor()`, which throws for an unknown name, instead of `hasEditor()`: the UMD build\n * maps the editor registry to `Handsontable.editors`, which exposes `getEditor()` only.\n *\n * @param {string} name The editor name.\n * @returns {boolean} `true` when an editor is registered under the name.\n */\nfunction isRegisteredEditorName(name: string): boolean {\n try {\n getEditor(name);\n\n return true;\n\n } catch {\n return false;\n }\n}\n\n/**\n * Editor classes that already produced `NATIVE_EDITOR_IN_EDITOR_PROP_WARNING`.\n */\nconst warnedNativeEditorClasses = new WeakSet<object>();\n\n/**\n * Editor names that already produced `NATIVE_EDITOR_IN_EDITOR_PROP_WARNING`.\n */\nconst warnedNativeEditorNames = new Set<string>();\n\n/**\n * Warn once per value that a Handsontable editor was passed to the `editor` prop.\n *\n * @param {Function|string} editor The editor class or editor name.\n */\nfunction warnAboutNativeEditorInEditorProp(editor: object | string): void {\n if (typeof editor === 'string') {\n if (warnedNativeEditorNames.has(editor)) {\n return;\n }\n\n warnedNativeEditorNames.add(editor);\n\n } else {\n if (warnedNativeEditorClasses.has(editor)) {\n return;\n }\n\n warnedNativeEditorClasses.add(editor);\n }\n\n warn(NATIVE_EDITOR_IN_EDITOR_PROP_WARNING);\n}\n\n/**\n * Resolve the Handsontable `editor` setting from the two editor props.\n *\n * `editor` carries the component editor and `hotEditor` the Handsontable-native one, but both accept\n * a boolean:\n *\n * - `false` disables editing.\n * - `true` names no editor, so it is treated as if the prop were not provided. It must never reach\n * the core, which accepts only a string or a constructor and throws on anything else.\n * - Any other nullish or falsy value (`null`, `0`, `''`) is also treated as \"not provided\", so a\n * column written as `editor={cond ? MyEditor : null}` inherits instead of locking.\n *\n * `hotEditor` is resolved before a falsy `editor`, so an editor named there still wins over a bare\n * `editor={false}` — the behavior in every released version, where `editor={false}` fell through to\n * the `hotEditor` value. A component `editor` outranks both: it is picked by `isComponentEditor()`\n * before this function is reached, so `editor={MyComponent} hotEditor={false}` keeps the component.\n *\n * A Handsontable editor (a class or a registered name) passed to `editor` is a mistake: that prop\n * renders a React component. It is used as if it were passed to `hotEditor`, with a one-time\n * warning. A `hotEditor` value that names an editor or disables editing still wins over it. A name\n * that no editor is registered under is dropped after the warning, so a typo does not make the core\n * throw.\n *\n * @param {HotTableProps['editor']} editor The `editor` prop.\n * @param {HotTableProps['hotEditor']} hotEditor The `hotEditor` prop.\n * @returns {*} The editor setting, or `undefined` when neither prop names one.\n */\nexport function resolveEditorSetting(\n editor: HotTableProps['editor'],\n hotEditor: HotTableProps['hotEditor']\n): Handsontable.GridSettings['editor'] | undefined {\n if (hotEditor === false) {\n return false;\n }\n\n // `true` names no editor, so it must fall through to \"not provided\" rather than hard-setting the\n // default one — otherwise it would override the editor a column's `type` or the grid supplies.\n if (hotEditor && hotEditor !== true) {\n return hotEditor as Handsontable.GridSettings['editor'];\n }\n\n if (isNativeEditor(editor)) {\n warnAboutNativeEditorInEditorProp(editor as unknown as object | string);\n\n // An unregistered name (a typo) would make the core throw on every selection of the cell, so\n // it is dropped and the cell keeps the editor its column type or the grid supplies.\n if (typeof editor === 'string' && !isRegisteredEditorName(editor)) {\n return undefined;\n }\n\n return editor as unknown as Handsontable.GridSettings['editor'];\n }\n\n return editor === false ? false : undefined;\n}\n\n/**\n * Create an editor portal.\n *\n * @param {Document} doc Document to be used.\n * @param {ComponentType} Editor Editor component or render function.\n * @param {HTMLElement} portalHost Host element to portal into. Required – do not fall back to `doc.body`.\n * @returns {ReactPortal} The portal for the editor.\n */\nexport function createEditorPortal(\n doc: Document | null,\n Editor: HotTableProps['editor'] | undefined | boolean,\n portalHost?: HTMLElement | null\n): ReactPortal | null {\n if (!doc || !portalHost || !isComponentEditor(Editor)) {\n return null;\n }\n\n const EditorComponent = Editor as ComponentType;\n const editorElement = <EditorComponent />;\n const containerProps = getContainerAttributesProps({}, false);\n\n containerProps.className = `${DEFAULT_CLASSNAME} ${containerProps.className}`;\n\n return ReactDOM.createPortal(\n <div {...containerProps}>\n {editorElement}\n </div>,\n portalHost);\n}\n\n/**\n * Render a cell component to an external DOM node.\n *\n * @param {React.ReactElement} rElement React element to be used as a base for the component.\n * @param {Document} [ownerDocument] The owner document to set the portal up into.\n * @param {string} portalKey The key to be used for the portal.\n * @param {HTMLElement} [cachedContainer] The cached container to be used for the portal.\n * @returns {{portal: ReactPortal, portalContainer: HTMLElement}} An object containing the portal and its\n * container.\n */\nexport function createPortal(\n rElement: React.ReactElement,\n ownerDocument: Document | null = document,\n portalKey: string,\n cachedContainer?: HTMLElement\n): {\n portal: ReactPortal,\n portalContainer: HTMLElement,\n} {\n if (!ownerDocument) {\n ownerDocument = document;\n }\n\n let portalContainer = cachedContainer;\n\n // A new container needs an anchor before React mounts into it. A cached\n // container is already attached (typically inside its TD) and must be\n // left in place to avoid wiping the DOM on every grid render.\n if (!portalContainer) {\n if (!bulkComponentContainer) {\n bulkComponentContainer = ownerDocument.createDocumentFragment();\n }\n portalContainer = ownerDocument.createElement('DIV');\n bulkComponentContainer.appendChild(portalContainer);\n }\n\n return {\n portal: ReactDOM.createPortal(rElement, portalContainer, portalKey),\n portalContainer,\n };\n}\n\n/**\n * Get an object containing the `id`, `className` and `style` keys, representing the corresponding props passed to the\n * component.\n *\n * @param {HotTableProps} props Object containing the React element props.\n * @param {boolean} randomizeId If set to `true`, the function will randomize the `id` property when no `id` was\n * present in the `prop` object.\n * @returns {{id?: string, className: string, style: CSSProperties}} An object containing the `id`, `className`\n * and `style` keys, representing the corresponding props passed to the component.\n */\nexport function getContainerAttributesProps(\n props: HotTableProps,\n randomizeId = true\n): { id?: string, className: string, style: CSSProperties } {\n return {\n id: props.id || (randomizeId ? `hot-${Math.random().toString(36).substring(5)}` : undefined),\n className: props.className || '',\n style: props.style || {},\n };\n}\n\n/**\n * Checks if the environment that the code runs in is a browser.\n *\n * @returns {boolean} `true` when running in a browser environment.\n */\nexport function isCSR(): boolean {\n return typeof window !== 'undefined';\n}\n\n/**\n * Checks whether the value is an object or `null`.\n *\n * @param {unknown} value Value to check.\n * @returns {boolean} `true` when the value is an object.\n */\nfunction isObjectLike(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * Checks whether the value is a plain object (an object literal or one created with `Object.create(null)`).\n *\n * @param {unknown} value Value to check.\n * @returns {boolean} `true` when the value is a plain object.\n */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (!isObjectLike(value)) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n\n/**\n * Checks whether the value is an array.\n *\n * @param {unknown} value Value to check.\n * @returns {boolean} `true` when the value is an array.\n */\nfunction isArray(value: unknown): value is unknown[] {\n return Array.isArray(value);\n}\n\n/**\n * Deep-compare plain objects and arrays used by wrapper settings. Functions, class instances and any\n * other value are compared by reference, and a `RegExp` by its source and flags. A pair of objects\n * already being compared higher up reads as equal, so a value with a cycle (tree rows with a `parent`\n * link) ends instead of overflowing the stack.\n *\n * @param {unknown} previousValue Previous value.\n * @param {unknown} currentValue Current value.\n * @param {WeakMap<object, WeakSet<object>>} [visited] The object pairs on the current comparison path.\n * @returns {boolean} `true` if values are equivalent.\n */\nexport function areEquivalentSettingsValue(\n previousValue: unknown,\n currentValue: unknown,\n visited: WeakMap<object, WeakSet<object>> = new WeakMap(),\n): boolean {\n if (previousValue === currentValue) {\n return true;\n }\n\n if (previousValue instanceof RegExp || currentValue instanceof RegExp) {\n if (!(previousValue instanceof RegExp) || !(currentValue instanceof RegExp)) {\n return false;\n }\n\n return previousValue.source === currentValue.source &&\n previousValue.flags === currentValue.flags;\n }\n\n const bothArrays = isArray(previousValue) && isArray(currentValue);\n const bothPlainObjects = !isArray(previousValue) && !isArray(currentValue) &&\n isPlainObject(previousValue) && isPlainObject(currentValue);\n\n if (!bothArrays && !bothPlainObjects) {\n return false;\n }\n\n const previousObject = previousValue as Record<string, unknown>;\n const currentObject = currentValue as Record<string, unknown>;\n const comparedWith = visited.get(previousObject);\n\n if (comparedWith?.has(currentObject)) {\n return true;\n }\n\n if (comparedWith) {\n comparedWith.add(currentObject);\n } else {\n visited.set(previousObject, new WeakSet([currentObject]));\n }\n\n const previousKeys = Object.keys(previousObject);\n\n return previousKeys.length === Object.keys(currentObject).length &&\n previousKeys.every(key => Object.prototype.hasOwnProperty.call(currentObject, key) &&\n areEquivalentSettingsValue(previousObject[key], currentObject[key], visited));\n}\n\n/**\n * Copies the plain objects and arrays of a settings value, keeping every other value (functions, class\n * instances) by reference. The copy is what an update compares the next value with, so a value the app\n * changes in place reads as changed. A value with a cycle is copied with the same cycle.\n *\n * @param {unknown} value The value to copy.\n * @param {WeakMap<object, unknown>} [copies] The copies made so far, by original.\n * @returns {unknown} The copy.\n */\nexport function copySettingsValue(value: unknown, copies: WeakMap<object, unknown> = new WeakMap()): unknown {\n if (!isArray(value) && !isPlainObject(value)) {\n return value;\n }\n\n if (copies.has(value)) {\n return copies.get(value);\n }\n\n if (isArray(value)) {\n const copy: unknown[] = [];\n\n copies.set(value, copy);\n value.forEach((item) => {\n copy.push(copySettingsValue(item, copies));\n });\n\n return copy;\n }\n\n const copy: Record<string, unknown> = {};\n\n copies.set(value, copy);\n Object.keys(value).forEach((key) => {\n copy[key] = copySettingsValue(value[key], copies);\n });\n\n return copy;\n}\n\n/**\n * A variant of useEffect hook that does not trigger on initial mount, only updates\n *\n * @param {EffectCallback} effect Effect function\n * @param {DependencyList} [deps] Effect dependencies\n */\nexport function useUpdateEffect(effect: EffectCallback, deps?: DependencyList): void {\n const notInitialRender = React.useRef(false);\n\n useEffect(() => {\n if (notInitialRender.current) {\n return effect();\n } else {\n notInitialRender.current = true;\n }\n }, deps);\n}\n\n/**\n * The class of the wrapper the grid puts around a cell's content in a row rendered at an exact height.\n */\nconst CELL_CLIP_CLASS = 'htCellClip';\n\n/**\n * Returns the element a cell's content belongs in: the grid's clipping wrapper when the cell holds\n * exactly that wrapper, and the cell itself otherwise.\n *\n * @param {HTMLElement} TD The table cell.\n * @returns {Element}\n */\nexport function getCellContentRoot(TD: HTMLElement): Element {\n const firstChild = TD.firstElementChild;\n\n if (firstChild !== null && TD.childNodes.length === 1 && firstChild.classList.contains(CELL_CLIP_CLASS)) {\n return firstChild;\n }\n\n return TD;\n}\n","import Handsontable from 'handsontable/base';\nimport { HotTableProps } from './types';\nimport { areEquivalentSettingsValue, copySettingsValue } from './helpers';\n\n/**\n * These settings are compared with the previous props, or for the size settings with the grid's live\n * value, by the rules below. Every other setting but `data` is compared with a copy of the value last\n * passed to the grid (`isSameAsForwarded()`).\n *\n * `rowHeights`, `minRowHeights` (the row height floor) and `colWidths` are here because passing any\n * of them re-declares the sizes and discards the ones the user produced by dragging\n * (`ManualRowResize` / `ManualColumnResize`). A re-render must not do that, and a React app commonly\n * writes the value inline (`rowHeights={[50, 50]}`), which is a new array on every render and never\n * reference-equal. All three hold plain numbers, strings or arrays of them, so the deep walk is\n * cheap. The Vue wrapper already skips unchanged keys this way.\n */\nconst DEEP_COMPARABLE_SETTINGS: Array<keyof Handsontable.GridSettings> = [\n 'dataSchema', 'columns', 'rowHeights', 'minRowHeights', 'colWidths'\n];\n\n/**\n * The size settings are compared against the grid's live settings rather than the previous props,\n * which is what the Angular and Vue wrappers already do. Comparing against props alone would stop\n * re-asserting the prop after anything changed the size through the instance ref.\n */\nconst COMPARED_AGAINST_LIVE_SETTINGS: Array<keyof Handsontable.GridSettings> = [\n 'rowHeights', 'minRowHeights', 'colWidths'\n];\n\n/**\n * Settings that core resets only on `null`. For these, core reads `undefined` as \"leave the current\n * value\", so forwarding the `undefined` default would keep the old size on the root element. `null`\n * restores the root element's initial inline size, which is what a fresh mount without the prop gives.\n */\nconst CLEARED_BY_NULL_SETTINGS = new Set<string>(['height', 'width']);\n\n/**\n * Settings forwarded on every update, changed or not. An app may change the rows of its `data` array\n * in place and re-render to show them, and passing the array again is what reloads them.\n */\nconst ALWAYS_FORWARDED_SETTINGS: Array<keyof Handsontable.GridSettings> = ['data'];\n\n/**\n * Settings compared by reference only. The sheets bar writes renames and added sheets into the\n * `sheets` array it was given, so a new array is a new workbook even when its content matches, and\n * walking every sheet's rows on each render would cost as much as the data itself. The Vue wrapper\n * compares `sheets` the same way.\n */\nconst REFERENCE_COMPARED_SETTINGS: Array<keyof Handsontable.GridSettings> = ['sheetsBar'];\n\n/**\n * Copies of the values last passed to the grid, by setting name. The component keeps one per grid\n * instance and passes it to every update.\n */\nexport type ForwardedSettings = Map<string, unknown>;\n\n/**\n * Checks whether an update would pass a setting with the value it passed last time. Passing it again\n * is not a no-op: core re-applies the plugins it names, and a plugin re-applied with its own settings\n * drops the state the user gave it (Filters' conditions, Pagination's page, the server total of a\n * `dataProvider` grid, and a refetch). A React app passes every prop on each render, often as an\n * inline object, so the value is compared by content (`areEquivalentSettingsValue()`: functions and\n * class instances by reference). The comparison is with a copy of the value last passed, not with the\n * grid's live value: an object the app changed in place is the same reference the grid holds, so only\n * the copy shows the change, and with the sheets bar on the live value is the visible sheet's own.\n *\n * @param {string} key The setting name.\n * @param {*} value The value the update would pass.\n * @param {ForwardedSettings} [forwardedSettings] The values last passed to the grid.\n * @returns {boolean}\n */\nfunction isSameAsForwarded(\n key: keyof Handsontable.GridSettings,\n value: unknown,\n forwardedSettings?: ForwardedSettings,\n): boolean {\n if (!forwardedSettings?.has(key) || ALWAYS_FORWARDED_SETTINGS.includes(key)) {\n return false;\n }\n\n const forwardedValue = forwardedSettings.get(key);\n\n return REFERENCE_COMPARED_SETTINGS.includes(key) ?\n forwardedValue === value :\n areEquivalentSettingsValue(forwardedValue, value);\n}\n\n/**\n * Records the value an update passes to the grid, for the next update to compare with.\n *\n * @param {string} key The setting name.\n * @param {*} value The value passed.\n * @param {ForwardedSettings} [forwardedSettings] The values last passed to the grid.\n */\nfunction recordForwarded(\n key: keyof Handsontable.GridSettings,\n value: unknown,\n forwardedSettings?: ForwardedSettings,\n): void {\n if (!forwardedSettings || ALWAYS_FORWARDED_SETTINGS.includes(key)) {\n return;\n }\n\n forwardedSettings.set(key, REFERENCE_COMPARED_SETTINGS.includes(key) ? value : copySettingsValue(value));\n}\n\n/**\n * Checks whether a setting is a hook, by the rule core's `updateSettings()` uses in `core.ts`: a\n * registered or a deprecated hook name.\n *\n * @param {string} key The setting name.\n * @returns {boolean}\n */\nfunction isHookKey(key: string): boolean {\n return Handsontable.hooks.isRegistered(key) || Handsontable.hooks.isDeprecated(key);\n}\n\n/**\n * Returns the value that clears a setting whose prop went from a value to `undefined`: `null` for a\n * hook (it removes the callback) and for `height` and `width` (it resets the root element's size),\n * and the option's default for anything else.\n *\n * @param {string} key The setting name.\n * @returns {*} The value to forward to `updateSettings()`.\n */\nfunction getClearedValue(key: string): unknown {\n if (isHookKey(key) || CLEARED_BY_NULL_SETTINGS.has(key)) {\n return null;\n }\n\n return (Handsontable.DefaultSettings as any)[key];\n}\n\n/**\n * Checks whether a hook value holds a callback core registers: a function or an array of them. Core\n * ignores any other value for a hook, so `false` from `afterChange={on && logChange}` would leave the\n * previous callback running.\n *\n * @param {*} value The hook value.\n * @returns {boolean}\n */\nfunction isHookCallback(value: unknown): boolean {\n return typeof value === 'function' || Array.isArray(value);\n}\n\n/**\n * Returns the value to forward for a prop that is passed: the option's cleared value for `undefined`,\n * `null` for a hook prop that holds no callback on an update, and the prop value otherwise.\n *\n * @param {string} key The setting name.\n * @param {*} value The prop value.\n * @param {boolean} isInit Whether the grid is being initialized.\n * @returns {*} The value to forward to `updateSettings()`.\n */\nfunction getForwardedValue(key: string, value: unknown, isInit: boolean): unknown {\n if (value === undefined) {\n return getClearedValue(key);\n }\n\n if (!isInit && isHookKey(key) && !isHookCallback(value)) {\n return null;\n }\n\n return value;\n}\n\nexport class SettingsMapper {\n /**\n * Parse component settings into Handsontable-compatible settings.\n *\n * A prop whose value is `undefined` counts as not passed and is left out, so the option keeps its\n * default. An own `undefined` key would shadow that default in the settings cascade. On an update\n * of a prop that had a value in the previous props, the option's default is forwarded instead, so\n * the grid matches a fresh mount with the same props (`copyPaste={on ? false : undefined}` turns\n * copy and paste back on). `height` and `width` are forwarded as `null`, because core leaves the\n * size in place for `undefined` (`height={full ? undefined : 400}` clears the height).\n * A hook has no default to fall back to, so a hook prop that had a callback and is now `undefined`\n * is forwarded as `null`, which removes the callback (`afterChange={on ? logChange : undefined}`).\n * So is a hook prop that had a callback and is no longer passed at all, and, on an update, a hook\n * prop that holds anything but a callback (`afterChange={on && logChange}` gives `false`).\n * For an option that is not a hook, `null` and `false` are real values and are forwarded.\n *\n * @param {object} properties Object containing properties from the HotTable object.\n * @param {object} additionalSettings Additional settings.\n * @param {boolean} additionalSettings.isInit Flag determining whether the settings are being set during initialization.\n * @param {string[]} additionalSettings.initOnlySettingKeys Array of keys that can be set only during initialization.\n * @param {HotTableProps} additionalSettings.prevProps The component's props before the current update.\n * @param {Handsontable.GridSettings} additionalSettings.currentSettings The grid's current live settings.\n * @param {ForwardedSettings} additionalSettings.forwardedSettings The values last passed to the grid. A\n * setting whose value equals the one recorded there is left out, and every setting passed is recorded.\n * @returns {object} Handsontable-compatible settings object.\n */\n static getSettings(\n properties: HotTableProps,\n {\n prevProps = {},\n isInit = false,\n initOnlySettingKeys = [],\n currentSettings,\n forwardedSettings,\n }: {\n prevProps?: HotTableProps;\n isInit?: boolean;\n initOnlySettingKeys?: Array<keyof Handsontable.GridSettings>;\n currentSettings?: Handsontable.GridSettings;\n forwardedSettings?: ForwardedSettings;\n } = {}): Handsontable.GridSettings {\n const shouldSkipProp = (key: keyof Handsontable.GridSettings) => {\n if (isInit) {\n return false;\n }\n\n // Checked before the value comparison below. The two lists do not overlap today, but a\n // changed deep-comparable key used to return early and skip this guard entirely, which would\n // have forwarded an init-only key to `updateSettings` as soon as one joined both lists.\n if (initOnlySettingKeys.includes(key)) {\n return true;\n }\n\n if (DEEP_COMPARABLE_SETTINGS.includes(key)) {\n const comparedValue = currentSettings && COMPARED_AGAINST_LIVE_SETTINGS.includes(key) ?\n currentSettings[key] :\n prevProps[key];\n\n return areEquivalentSettingsValue(comparedValue, properties[key]);\n }\n\n return false;\n };\n const isNotPassed = (key: keyof HotTableProps) => {\n return properties[key] === undefined && (isInit || prevProps[key] === undefined);\n };\n const newSettings: Handsontable.GridSettings = {};\n\n Object.keys(properties).forEach((key) => {\n if (\n key !== 'children' &&\n !isNotPassed(key as keyof HotTableProps) &&\n !shouldSkipProp(key as keyof Handsontable.GridSettings)\n ) {\n const settingKey = key as keyof Handsontable.GridSettings;\n const value = getForwardedValue(key, properties[key as keyof HotTableProps], isInit);\n\n if (\n isInit ||\n DEEP_COMPARABLE_SETTINGS.includes(settingKey) ||\n !isSameAsForwarded(settingKey, value, forwardedSettings)\n ) {\n (newSettings as any)[key] = value;\n recordForwarded(settingKey, value, forwardedSettings);\n }\n }\n });\n\n if (!isInit) {\n Object.keys(prevProps).forEach((key) => {\n if (\n !Object.hasOwn(properties, key) &&\n prevProps[key as keyof HotTableProps] !== undefined &&\n isHookKey(key)\n ) {\n (newSettings as any)[key] = null;\n recordForwarded(key as keyof Handsontable.GridSettings, null, forwardedSettings);\n }\n });\n }\n\n return newSettings;\n }\n}\n","import Handsontable from 'handsontable/base';\nimport React, {\n ComponentType,\n FC,\n PropsWithChildren,\n ReactPortal,\n createContext,\n useCallback,\n useRef,\n useMemo,\n useContext,\n} from 'react';\nimport { ScopeIdentifier, HotRendererProps } from './types';\nimport { createPortal, getCellContentRoot, warnAboutClassicFunctionRenderer } from './helpers';\nimport { RenderersPortalManagerRef } from './renderersPortalManager';\n\nexport interface HotTableContextImpl {\n /**\n * Map with column indexes (or a string = 'global') as keys, and booleans as values. Each key represents a component-based editor\n * declared for the used column index, or a global one, if the key is the `global` string.\n */\n readonly componentRendererColumns: Map<ScopeIdentifier, boolean>;\n\n /**\n * Array of object containing the column settings.\n */\n readonly columnsSettings: Handsontable.ColumnSettings[];\n\n /**\n * Sets the column settings based on information received from HotColumn.\n *\n * @param {HotTableProps} columnSettings Column settings object.\n * @param {number} columnIndex Column index.\n */\n readonly emitColumnSettings: (columnSettings: Handsontable.ColumnSettings, columnIndex: number) => void;\n\n /**\n * Trim the column settings array to the given length. Used to drop slots\n * left over from HotColumn children that have unmounted.\n *\n * @param {number} length Target length for the column settings array.\n */\n readonly trimColumnSettings: (length: number) => void;\n\n /**\n * Return a renderer wrapper function for the provided renderer component.\n *\n * @param {ComponentType<HotRendererProps>} Renderer React renderer component.\n * @returns {Handsontable.renderers.BaseRenderer} The Handsontable rendering function.\n */\n readonly getRendererWrapper:\n (Renderer: ComponentType<HotRendererProps>) => typeof Handsontable.renderers.BaseRenderer;\n\n /**\n * Starts a view-render pass: forgets which portal containers the previous pass rendered.\n */\n readonly resetRenderedPortals: () => void;\n\n /**\n * Records a cell element the grid painted in the current view-render pass, whatever its renderer.\n *\n * @param {HTMLTableCellElement} TD The painted cell element.\n */\n readonly markCellPainted: (TD: HTMLTableCellElement) => void;\n\n /**\n * Returns the number of portal containers currently retained by the cache.\n * Diagnostic hook used to assert the cache stays bounded to the viewport\n * (it must not grow with the total scrolled row/column count).\n *\n * @returns {number} The portal container cache size.\n */\n readonly getPortalContainerCacheSize: () => number;\n\n /**\n * Set the renderers portal manager dispatch function.\n *\n * @param {RenderersPortalManagerRef} pm The PortalManager dispatch function.\n */\n readonly setRenderersPortalManagerRef: (pm: RenderersPortalManagerRef) => void;\n\n /**\n * Evicts the portals of the cells that left the grid and puts the rest into the portal manager.\n */\n readonly pushCellPortalsIntoPortalManager: () => void;\n}\n\nconst HotTableContext = createContext<HotTableContextImpl | undefined>(undefined);\n\nconst HotTableContextProvider: FC<PropsWithChildren> = ({ children }) => {\n const columnsSettings = useRef<Handsontable.ColumnSettings[]>([]);\n\n const setHotColumnSettings = useCallback((columnSettings: Handsontable.ColumnSettings, columnIndex: number) => {\n columnsSettings.current[columnIndex] = columnSettings;\n }, []);\n\n const trimColumnSettings = useCallback((length: number) => {\n columnsSettings.current.length = length;\n }, []);\n\n const componentRendererColumns = useRef<Map<number | 'global', boolean>>(new Map());\n // One entry per cell the grid shows with a component renderer: the cell element, the container in\n // it, and the portal that renders the component into the container. Keyed by the portal container key.\n const cellPortals = useRef<Map<string, {\n TD: HTMLTableCellElement,\n container: HTMLElement,\n portal: ReactPortal,\n }>>(new Map());\n\n /**\n * The renderer function made for each renderer component. It reads everything else through refs, so\n * one function serves every render, and an update that passes the same `<HotColumn>` settings again\n * finds them unchanged and leaves `columns` out.\n */\n const rendererWrappers = useRef<WeakMap<ComponentType<HotRendererProps>, typeof Handsontable.renderers.BaseRenderer>>(\n new WeakMap()\n );\n // Keys of the portal containers rendered in the current view-render pass.\n // Reset every `beforeViewRender` and used after the render to tell the cells\n // the pass painted from the ones it did not (see pushCellPortalsIntoPortalManager).\n const renderedPortalContainerKeys = useRef<Set<string>>(new Set());\n // Cell elements the grid painted in the current view-render pass, with any renderer. A cell element\n // the grid reuses for another cell keeps a component container when the new renderer does not clear\n // the element, so a connected container alone does not prove its cell is still shown.\n const paintedCells = useRef<Set<HTMLTableCellElement>>(new Set());\n const resetRenderedPortals = useCallback(() => {\n renderedPortalContainerKeys.current.clear();\n paintedCells.current.clear();\n }, []);\n const markCellPainted = useCallback((TD: HTMLTableCellElement) => {\n if (cellPortals.current.size > 0) {\n paintedCells.current.add(TD);\n }\n }, []);\n const getPortalContainerCacheSize = useCallback(() => cellPortals.current.size, []);\n\n // Stable id per table element the grid draws into. Handsontable renders the\n // same cell once per table it appears in — the master table plus an overlay\n // table for every fixed row/column edge — and each draw gets its own TD.\n const tableIds = useRef<WeakMap<Element, number>>(new WeakMap());\n const nextTableId = useRef(0);\n\n /**\n * Identify the table a rendered cell belongs to, so the master table and the\n * overlay tables get separate portal containers for the same cell.\n *\n * @param {HTMLTableCellElement} TD The cell being rendered.\n * @returns {number} The id of the table the cell belongs to.\n */\n const getTableId = useCallback((TD: HTMLTableCellElement): number => {\n // TD -> TR -> TBODY. The section belongs to exactly one table, and the\n // overlay tables are built once and never hand their cells to another\n // table, so it is a stable identity for the draw. Two property hops rather\n // than a selector walk, because this runs for every component-rendered\n // cell on every render.\n const tableSection: Element = TD.parentElement?.parentElement ?? TD;\n const cachedId = tableIds.current.get(tableSection);\n\n if (cachedId !== undefined) {\n return cachedId;\n }\n\n const id = nextTableId.current;\n\n nextTableId.current += 1;\n tableIds.current.set(tableSection, id);\n\n return id;\n }, []);\n\n const getRendererWrapper = useCallback((\n Renderer: ComponentType<HotRendererProps>\n ): typeof Handsontable.renderers.BaseRenderer => {\n const cachedWrapper = rendererWrappers.current.get(Renderer);\n\n if (cachedWrapper) {\n return cachedWrapper;\n }\n\n warnAboutClassicFunctionRenderer(Renderer);\n\n const wrapper = function __internalRenderer(instance, TD, row, col, prop, value, cellProperties) {\n const key = `${row}-${col}`;\n\n // Handsontable.Core type is missing guid\n const instanceGuid = (instance as unknown as { guid: string }).guid;\n\n if (TD && !TD.getAttribute('ghost-table')) {\n // The table has to be part of the key. A cell that sits in a fixed\n // column is drawn both in the master table and in the inline-start\n // overlay; keyed by coordinates alone, both draws share one container,\n // which then moves into whichever table rendered last and leaves the\n // other cell empty. The two tables then size their rows from different\n // content and stop lining up (see issue #9063).\n const tableId = getTableId(TD);\n const portalContainerKey = `${instanceGuid}-${tableId}-${key}`;\n const portalKey = `${key}-${tableId}-${instanceGuid}`;\n const cachedPortalContainer = cellPortals.current.get(portalContainerKey)?.container;\n // When the cached portal container is still attached to the same\n // TD as the previous render, the DOM is already correct and must\n // not be wiped. Wiping detaches the React-managed children, which\n // forces a full remount of the renderer component on every grid\n // render (see issue #10800).\n // A row rendered at an exact height (the `rowHeights` option) keeps the cell's content inside a\n // `div.htCellClip` wrapper that the grid adds after this renderer ran. The container then sits in\n // the wrapper, and wiping the cell on the next render would detach it all over again.\n const contentRoot = getCellContentRoot(TD);\n const containerInPlace = !!cachedPortalContainer && cachedPortalContainer.parentNode === contentRoot;\n\n const rendererElement = (\n <Renderer instance={instance}\n TD={TD}\n row={row}\n col={col}\n prop={prop}\n value={value}\n cellProperties={cellProperties}/>\n );\n\n const { portal, portalContainer } = createPortal(\n rendererElement, TD.ownerDocument, portalKey, cachedPortalContainer\n );\n\n if (!containerInPlace) {\n while (contentRoot.firstChild) {\n contentRoot.removeChild(contentRoot.firstChild);\n }\n contentRoot.appendChild(portalContainer);\n }\n\n cellPortals.current.set(portalContainerKey, { TD, container: portalContainer, portal });\n renderedPortalContainerKeys.current.add(portalContainerKey);\n }\n\n return TD;\n };\n\n rendererWrappers.current.set(Renderer, wrapper);\n\n return wrapper;\n }, [getTableId]);\n\n const renderersPortalManager = useRef<RenderersPortalManagerRef>(() => undefined);\n\n const setRenderersPortalManagerRef = useCallback((pmComponent: RenderersPortalManagerRef) => {\n renderersPortalManager.current = pmComponent;\n }, []);\n\n const pushCellPortalsIntoPortalManager = useCallback(() => {\n // A cell this pass did not paint with its component either left the grid or\n // was skipped. The grid skips a cell that did not change (`renderMode:\n // 'onChange'`) and leaves its element as it is, so the portal must stay or\n // React unmounts the component and the cell goes blank. A cell that left the\n // grid had its element removed (the container is detached), or its element\n // was painted for another cell this pass (with a renderer that may not clear\n // the element): evict those, or the cache leaks O(rows × cols) nodes and a\n // stale component stays visible. Kept entries also preserve the in-place\n // reuse that avoids remounting renderer components on every grid render\n // (#10800).\n const paintedKeys = renderedPortalContainerKeys.current;\n const portals: ReactPortal[] = [];\n\n cellPortals.current.forEach(({ TD, container, portal }, cacheKey) => {\n if (!paintedKeys.has(cacheKey) && (!container.isConnected || paintedCells.current.has(TD))) {\n cellPortals.current.delete(cacheKey);\n\n return;\n }\n\n portals.push(portal);\n });\n\n renderersPortalManager.current!(portals);\n }, []);\n\n const contextImpl: HotTableContextImpl = useMemo(() => ({\n componentRendererColumns: componentRendererColumns.current,\n columnsSettings: columnsSettings.current,\n emitColumnSettings: setHotColumnSettings,\n trimColumnSettings,\n getRendererWrapper,\n resetRenderedPortals,\n markCellPainted,\n getPortalContainerCacheSize,\n setRenderersPortalManagerRef,\n pushCellPortalsIntoPortalManager\n }), [\n setHotColumnSettings,\n trimColumnSettings,\n getRendererWrapper,\n resetRenderedPortals,\n markCellPainted,\n getPortalContainerCacheSize,\n setRenderersPortalManagerRef,\n pushCellPortalsIntoPortalManager,\n ]);\n\n return (\n <HotTableContext.Provider value={contextImpl}>{children}</HotTableContext.Provider>\n );\n};\n\n/**\n * Exposes the table context object to components\n *\n * @returns {HotTableContextImpl} HotTableContext\n */\nfunction useHotTableContext(): HotTableContextImpl {\n return useContext(HotTableContext)!;\n}\n\nexport { HotTableContextProvider, useHotTableContext };\n","import React, {\n FC,\n PropsWithChildren,\n createContext,\n useContext,\n useMemo,\n} from 'react';\n\nexport interface HotColumnContextImpl {\n /**\n * Column index within a HotTable.\n */\n readonly columnIndex: number;\n\n /**\n * Get the `Document` object corresponding to the main component element.\n *\n * @returns The `Document` object used by the component.\n */\n readonly getOwnerDocument: () => Document | null;\n\n /**\n * Get the stable host element for React editor portals.\n *\n * @returns The host element, or `null` before a document is available.\n */\n readonly getEditorPortalHost: () => HTMLElement | null;\n}\n\nconst HotColumnContext = createContext<HotColumnContextImpl | undefined>(undefined);\n\nconst HotColumnContextProvider: FC<PropsWithChildren<HotColumnContextImpl>> = ({\n columnIndex,\n getOwnerDocument,\n getEditorPortalHost,\n children\n}) => {\n\n const contextImpl: HotColumnContextImpl = useMemo(() => ({\n columnIndex,\n getOwnerDocument,\n getEditorPortalHost\n }), [columnIndex, getOwnerDocument, getEditorPortalHost]);\n\n return (\n <HotColumnContext.Provider value={contextImpl}>{children}</HotColumnContext.Provider>\n );\n};\n\nconst useHotColumnContext = () => useContext(HotColumnContext)!;\n\nexport { useHotColumnContext, HotColumnContextProvider };\n","import React, {\n DependencyList,\n FC,\n MutableRefObject,\n ReactNode,\n Ref,\n RefObject,\n createContext,\n useContext,\n useImperativeHandle,\n useMemo,\n useState,\n useRef,\n useCallback,\n useEffect,\n Dispatch,\n} from 'react';\nimport Handsontable from 'handsontable/base';\nimport { HotEditorHooks, UseHotEditorImpl } from './types';\n\ntype HookPropName = keyof Handsontable.editors.BaseEditor | 'constructor';\n\nconst AbstractMethods: (keyof Handsontable.editors.BaseEditor)[] = [\n 'close',\n 'focus',\n 'open',\n];\nconst ExcludedMethods: (keyof Handsontable.editors.BaseEditor)[] = [\n 'getValue',\n 'setValue',\n];\n\nconst MethodsMap: Partial<\n Record<keyof Handsontable.editors.BaseEditor, keyof HotEditorHooks>\n> = {\n open: 'onOpen',\n close: 'onClose',\n prepare: 'onPrepare',\n focus: 'onFocus',\n};\n\n/**\n * The editor class made for each component's hooks reference. The class reads the hooks and the instance\n * through those references when it runs, so one class serves every render of the component, and an\n * update that passes the same class is left out like any other unchanged setting.\n */\nconst editorClasses = new WeakMap<MutableRefObject<HotEditorHooks | null>, typeof Handsontable.editors.BaseEditor>();\n\n/**\n * Create a class to be passed to the Handsontable's settings, or return the one made for the same hooks\n * reference.\n *\n * @param {RefObject<HotEditorHooks>} hooksRef Reference to component-based editor overridden hooks object.\n * @param {RefObject} instanceRef Reference to Handsontable-native custom editor class instance.\n * @returns {Function} A class to be passed to the Handsontable editor settings.\n */\nexport function makeEditorClass(\n hooksRef: MutableRefObject<HotEditorHooks | null>,\n instanceRef: MutableRefObject<Handsontable.editors.BaseEditor | null>\n): typeof Handsontable.editors.BaseEditor {\n const cachedEditorClass = editorClasses.get(hooksRef);\n\n if (cachedEditorClass) {\n return cachedEditorClass;\n }\n\n const EditorClass = class CustomEditor\n extends Handsontable.editors.BaseEditor\n implements Handsontable.editors.BaseEditor {\n private value: any;\n\n constructor(hotInstance: Handsontable.Core) {\n super(hotInstance);\n instanceRef.current = this;\n\n (\n Object.getOwnPropertyNames(\n Handsontable.editors.BaseEditor.prototype\n ) as HookPropName[]\n ).forEach((propName) => {\n if (propName === 'constructor' || ExcludedMethods.includes(propName)) {\n return;\n }\n\n const baseMethod = Handsontable.editors.BaseEditor.prototype[propName];\n\n (CustomEditor.prototype as any)[propName] = function(\n this: CustomEditor,\n ...args: any[]\n ) {\n let result;\n\n if (!AbstractMethods.includes(propName)) {\n result = (baseMethod as (...a: any[]) => unknown).call(this, ...args); // call super\n }\n\n if (\n MethodsMap[propName] &&\n hooksRef.current?.[MethodsMap[propName]!]\n ) {\n result = (hooksRef.current[MethodsMap[propName]!] as any).call(\n this,\n ...args\n );\n }\n\n return result;\n }.bind(this);\n });\n }\n\n focus() { }\n\n getValue() {\n return this.value;\n }\n\n setValue(newValue: any) {\n this.value = newValue;\n }\n\n open() { }\n\n close() { }\n };\n\n editorClasses.set(hooksRef, EditorClass);\n\n return EditorClass;\n}\n\ninterface EditorContextType {\n hooksRef: Ref<HotEditorHooks>;\n hotCustomEditorInstanceRef: RefObject<Handsontable.editors.BaseEditor>;\n}\n\n/**\n * Context to provide Handsontable-native custom editor class instance to overridden hooks object.\n */\nexport const EditorContext = createContext<EditorContextType | undefined>(\n undefined\n);\n\ninterface EditorContextProviderProps {\n hooksRef: Ref<HotEditorHooks>;\n hotCustomEditorInstanceRef: RefObject<Handsontable.editors.BaseEditor>;\n children: ReactNode;\n}\n\n/**\n * Provider of the context that exposes Handsontable-native editor instance and passes hooks object\n * for custom editor components.\n *\n * @param {object} root0 The provider props.\n * @param {Ref} root0.hooksRef Reference for component-based editor overridden hooks object.\n * @param {RefObject} root0.hotCustomEditorInstanceRef Reference to Handsontable-native editor instance.\n * @param {ReactNode} root0.children The provider's children.\n * @returns {ReactElement} The provider component.\n */\nexport const EditorContextProvider: FC<EditorContextProviderProps> = ({\n hooksRef,\n hotCustomEditorInstanceRef,\n children,\n}) => {\n return (\n <EditorContext.Provider value={{ hooksRef, hotCustomEditorInstanceRef }}>\n {children}\n </EditorContext.Provider>\n );\n};\n\ntype EditorWithPosition = Handsontable.editors.BaseEditor & {\n position?: string;\n /**\n * Set when an `EditorComponent` editor opens. Core calls it to move an open editor onto its cell, for\n * example after the grid changes size, once `EditorManager` has scrolled the cell into view.\n */\n refreshDimensions?: () => void;\n};\n\n/**\n * Applies editor overlay position/dimensions to an element.\n *\n * @param {HTMLElement} el The editor's main element.\n * @param {EditorWithPosition} editor The editor instance.\n * @param {Handsontable.Core} hot The Handsontable instance.\n * @param {Element | null | undefined} td The edited cell's TD element.\n * @returns {boolean} `true` if position was applied, `false` if editor should close (e.g. cell no longer\n * available).\n */\nfunction applyEditorPosition(\n el: HTMLElement,\n editor: EditorWithPosition,\n hot: Handsontable.Core,\n td: Element | null | undefined\n): boolean {\n const rootWindow = hot.rootWindow || window;\n const pageX = rootWindow.pageXOffset ?? 0;\n const pageY = rootWindow.pageYOffset ?? 0;\n const isRtl = typeof hot.isRtl === 'function' && hot.isRtl();\n const position = editor.position;\n\n const applyTdRect = (rect: DOMRect) => {\n el.style.top = `${pageY + rect.top - 1}px`;\n el.style.width = `${rect.width + 1}px`;\n el.style.height = `${rect.height + 1}px`;\n\n if (isRtl) {\n el.style.right = `${pageX + rect.right}px`;\n el.style.left = 'auto';\n } else {\n el.style.left = `${pageX + rect.left - 1}px`;\n el.style.right = 'auto';\n }\n };\n\n if (position === 'portal') {\n const cell = td ?? (typeof editor.getEditedCell === 'function' ? editor.getEditedCell.call(editor) : null);\n\n if (!cell?.getBoundingClientRect) {\n return false;\n }\n\n applyTdRect(cell.getBoundingClientRect());\n\n return true;\n }\n\n const getEditedCellRect = editor.getEditedCellRect;\n const rect = typeof getEditedCellRect === 'function' ? getEditedCellRect.call(editor) : null;\n\n if (rect) {\n const rootElement = hot.rootElement;\n\n if (rootElement?.getBoundingClientRect) {\n const rootRect = rootElement.getBoundingClientRect();\n\n el.style.top = `${pageY + rootRect.top + rect.top}px`;\n el.style.width = `${rect.width}px`;\n el.style.height = `${rect.height}px`;\n\n if (isRtl) {\n el.style.right = `${pageX + rootRect.right - rect.start}px`;\n el.style.left = 'auto';\n } else {\n el.style.left = `${pageX + rootRect.left + rect.start}px`;\n el.style.right = 'auto';\n }\n\n return true;\n }\n }\n\n if (td?.getBoundingClientRect) {\n applyTdRect(td.getBoundingClientRect());\n\n return true;\n }\n\n return false;\n}\n\n/**\n * Hook that allows encapsulating custom behaviors of component-based editor by customizing passed ref with overridden hooks object.\n *\n * @param {HotEditorHooks} overriddenHooks Overrides specific for the custom editor.\n * @param {DependencyList} deps Overridden hooks object React dependency list.\n * @returns {UseHotEditorImpl} Editor API methods\n */\nexport function useHotEditor<T>(\n overriddenHooks?: HotEditorHooks,\n deps?: DependencyList\n): UseHotEditorImpl<T> {\n const { hooksRef, hotCustomEditorInstanceRef } =\n useContext(EditorContext)!;\n const [rerenderTrigger, setRerenderTrigger] = useState(0);\n const [editorValue, setEditorValue] = useState<T>();\n\n useImperativeHandle(\n hooksRef,\n () => ({\n ...overriddenHooks,\n onOpen(event?: Event) {\n setEditorValue(hotCustomEditorInstanceRef.current?.getValue() as T | undefined);\n overriddenHooks?.onOpen?.(event);\n setRerenderTrigger(t => t + 1);\n },\n }),\n deps\n );\n\n return useMemo(\n () => ({\n get value(): T | undefined {\n return editorValue;\n },\n setValue(newValue) {\n setEditorValue(newValue);\n hotCustomEditorInstanceRef.current?.setValue(newValue);\n },\n get isOpen() {\n return hotCustomEditorInstanceRef.current?.isOpened() ?? false;\n },\n finishEditing() {\n hotCustomEditorInstanceRef.current?.finishEditing();\n },\n get row() {\n const row = hotCustomEditorInstanceRef.current?.row;\n\n return row ?? undefined;\n },\n get col() {\n const col = hotCustomEditorInstanceRef.current?.col;\n\n return col ?? undefined;\n },\n }),\n [rerenderTrigger, hotCustomEditorInstanceRef, editorValue]\n );\n}\n\ntype EditorChildrenProps<T> = {\n value: T;\n setValue: Dispatch<T>;\n finishEditing: () => void;\n isOpen: boolean;\n row: number | undefined;\n col: number | undefined;\n mainElementRef: React.RefObject<HTMLDivElement>;\n}\n\n// Render prop function type\ntype EditorRenderProp<T> = (props: EditorChildrenProps<T>) => React.ReactNode;\n\n// EditorComponent props - children typed to work with JSX syntax\ntype EditorComponentProps = {\n onPrepare?: (\n row: number,\n column: number,\n prop: string | number,\n TD: HTMLTableCellElement,\n originalValue: any,\n cellProperties: Handsontable.CellProperties\n ) => void;\n onOpen?(event?: Event): void;\n onClose?: () => void;\n onFocus?: () => void;\n shortcutsGroup?: string;\n shortcuts?: {\n keys: string[][];\n callback: (props: any, event: KeyboardEvent) => boolean | void;\n group?: string;\n runOnlyIf?: () => boolean;\n captureCtrl?: boolean;\n preventDefault?: boolean;\n stopPropagation?: boolean;\n relativeToGroup?: string;\n position?: 'before' | 'after';\n forwardToContext?: any;\n }[];\n}\n\n/**\n * Component-based editor. Renders the `children` render prop inside the editor's positioned overlay\n * and wires up its shortcuts and scroll-repositioning.\n *\n * @param {object} root0 The component props.\n * @param {Function} [root0.onPrepare] Called when the editor is prepared for a cell.\n * @param {Function} [root0.onClose] Called when the editor closes.\n * @param {Function} [root0.onOpen] Called when the editor opens. Receives the DOM event that opened the editor. It is `undefined` when you call `beginEditing()`.\n * @param {Function} [root0.onFocus] Called when the editor is focused.\n * @param {EditorRenderProp} [root0.children] Render prop returning the editor's UI.\n * @param {string} [root0.shortcutsGroup] The shortcuts group name to register under.\n * @param {Array} [root0.shortcuts] The editor's keyboard shortcuts.\n * @returns {React.ReactElement} The editor overlay element.\n */\nexport function EditorComponent<T = any>({\n onPrepare,\n onClose,\n onOpen,\n onFocus,\n children,\n shortcutsGroup = 'custom-editor',\n shortcuts,\n}: EditorComponentProps & { children?: EditorRenderProp<T> }): React.ReactElement {\n const mainElementRef = useRef<HTMLDivElement>(null);\n const currentValue = useRef<T>(undefined);\n const [themeClassName, setThemeClassName] = useState<string | undefined>();\n const { hotCustomEditorInstanceRef } = useContext(EditorContext)!;\n\n const registerShortcuts = useCallback(() => {\n if (!hotCustomEditorInstanceRef.current?.hot) {\n return;\n }\n\n hotCustomEditorInstanceRef.current?.hot?.getShortcutManager().setActiveContextName('editor');\n\n const shortcutManager = hotCustomEditorInstanceRef.current?.hot?.getShortcutManager();\n const editorContext = shortcutManager.getContext('editor');\n const contextConfig = {\n group: shortcutsGroup,\n };\n\n if (shortcuts) {\n editorContext?.addShortcuts(shortcuts.map(shortcut => ({\n ...shortcut,\n group: shortcut.group || shortcutsGroup,\n relativeToGroup: shortcut.relativeToGroup ||\n 'editorManager.handlingEditor',\n position: shortcut.position || 'before',\n callback: (event: KeyboardEvent) =>\n shortcut.callback({ value: currentValue.current, setValue, finishEditing }, event),\n })),\n contextConfig\n );\n }\n }, [shortcuts]);\n\n const unRegisterShortcuts = useCallback(() => {\n if (!hotCustomEditorInstanceRef.current?.hot) {\n return;\n }\n\n const shortcutManager = hotCustomEditorInstanceRef.current?.hot?.getShortcutManager();\n const editorContext = shortcutManager.getContext('editor')!;\n\n editorContext.removeShortcutsByGroup(shortcutsGroup);\n }, [shortcuts]);\n\n const refreshDimensions = useCallback(() => {\n const editor = hotCustomEditorInstanceRef.current as EditorWithPosition | null;\n const el = mainElementRef.current;\n\n if (!editor || !el) {\n return;\n }\n\n const hot = editor.hot;\n\n if (!hot) {\n return;\n }\n\n if (typeof editor.isOpened !== 'function' || !editor.isOpened()) {\n return;\n }\n\n // Leave an editor that waits for an async validator alone, as core `TextEditor` does. The scroll\n // hooks call this without core's wait, and a cancel here would not stop the pending validation:\n // a rejected value then put the editor back in edit mode while it was closed.\n if (editor.state !== 'STATE_EDITING') {\n return;\n }\n\n // The edited cell is not rendered (it scrolled out of view). End the edit without saving and reset\n // the editor, so the next key starts a new edit. A bare `close()` hid the element but left the\n // editor open, so it never showed again and kept the keyboard.\n if (!applyEditorPosition(el, editor, hot, null)) {\n editor.cancelChanges();\n }\n }, []);\n\n const unRegisterScrollHooks = useCallback(() => {\n const editor = hotCustomEditorInstanceRef.current;\n const hot = editor?.hot;\n\n if (!hot || typeof hot.removeHook !== 'function') {\n return;\n }\n\n hot.removeHook('afterScrollHorizontally', refreshDimensions);\n hot.removeHook('afterScrollVertically', refreshDimensions);\n }, [refreshDimensions]);\n\n const registerScrollHooks = useCallback(() => {\n const editor = hotCustomEditorInstanceRef.current;\n const hot = editor?.hot;\n\n if (!hot || typeof hot.addHook !== 'function') {\n return;\n }\n\n hot.addHook('afterScrollHorizontally', refreshDimensions);\n hot.addHook('afterScrollVertically', refreshDimensions);\n }, [refreshDimensions]);\n\n const { value, setValue, finishEditing, isOpen, col, row } = useHotEditor<T>({\n onOpen: (event?: Event) => {\n if (!mainElementRef.current) {\n return;\n }\n\n const themeName = hotCustomEditorInstanceRef.current?.hot.getCurrentThemeName();\n\n if (themeName) {\n setThemeClassName(themeName);\n }\n\n mainElementRef.current.style.display = 'block';\n\n const el = mainElementRef.current;\n const editor = hotCustomEditorInstanceRef.current as EditorWithPosition | null;\n\n if (el && editor?.hot) {\n applyEditorPosition(el, editor, editor.hot, null);\n editor.refreshDimensions = refreshDimensions;\n }\n\n onOpen?.(event);\n\n registerShortcuts();\n registerScrollHooks();\n },\n onClose: () => {\n if (!mainElementRef.current) {\n return;\n }\n\n mainElementRef.current.style.display = 'none';\n\n onClose?.();\n unRegisterShortcuts();\n unRegisterScrollHooks();\n },\n onPrepare: (_row, _column, _prop, TD, _originalValue, _cellProperties) => {\n onPrepare?.(_row, _column, _prop, TD, _originalValue, _cellProperties);\n },\n onFocus: () => {\n onFocus?.();\n },\n });\n\n useEffect(() => {\n currentValue.current = value;\n }, [value]);\n\n const stopMousedownPropagation = (e: React.MouseEvent) => {\n e.stopPropagation();\n };\n\n return (\n <div\n ref={mainElementRef}\n className={themeClassName}\n style={{\n display: 'none',\n position: 'absolute',\n background: '#fff',\n border: '0px',\n padding: '0px',\n zIndex: 100,\n }}\n onMouseDown={stopMousedownPropagation}\n >\n {(children as EditorRenderProp<T>)({\n value: value as T,\n setValue,\n finishEditing,\n mainElementRef: mainElementRef as React.RefObject<HTMLDivElement>,\n isOpen,\n col,\n row,\n })}\n </div>\n );\n}\n","import React, {\n FC,\n ReactElement,\n useEffect,\n useRef,\n} from 'react';\nimport Handsontable from 'handsontable/base';\nimport { HotTableProps, HotColumnProps, HotEditorHooks } from './types';\nimport {\n createEditorPortal,\n displayAnyChildrenWarning,\n displayObsoleteRenderersEditorsWarning,\n isComponentEditor,\n resolveEditorSetting\n} from './helpers';\nimport { SettingsMapper } from './settingsMapper';\nimport { useHotTableContext } from './hotTableContext';\nimport { useHotColumnContext } from './hotColumnContext';\nimport { EditorContextProvider, makeEditorClass } from './hotEditor';\n\nconst isHotColumn = (childNode: any): childNode is ReactElement => childNode.type === HotColumn;\n\nconst internalProps = ['_columnIndex', '_getOwnerDocument', 'children'];\n\nconst HotColumn: FC<HotColumnProps> = (props) => {\n const { componentRendererColumns, emitColumnSettings, getRendererWrapper } = useHotTableContext();\n const { columnIndex, getOwnerDocument, getEditorPortalHost } = useHotColumnContext();\n\n /**\n * Reference to component-based editor overridden hooks object.\n */\n const localEditorHooksRef = useRef<HotEditorHooks | null>(null);\n\n /**\n * Reference to HOT-native custom editor class instance.\n */\n const localEditorClassInstance = useRef<Handsontable.editors.BaseEditor | null>(null);\n\n /**\n * Logic performed after mounting & updating of the HotColumn component.\n */\n useEffect(() => {\n\n /**\n * Filter out all the internal properties and return an object with just the Handsontable-related props.\n *\n * @returns {object}\n */\n const getSettingsProps = (): HotTableProps => {\n return Object.keys(props)\n .filter(key => !internalProps.includes(key))\n .reduce<HotTableProps>((obj, key) => {\n (obj as any)[key] = props[key];\n\n return obj;\n }, {});\n };\n\n /**\n * Create the column settings based on the data provided to the `HotColumn` component and its child components.\n *\n * @returns {object} The column settings object.\n */\n const createColumnSettings = (): Handsontable.ColumnSettings => {\n const columnSettings = SettingsMapper.getSettings(getSettingsProps()) as unknown as Handsontable.ColumnSettings;\n\n if (props.renderer) {\n columnSettings.renderer = getRendererWrapper(props.renderer);\n componentRendererColumns.set(columnIndex, true);\n } else if (props.hotRenderer) {\n columnSettings.renderer = props.hotRenderer;\n }\n\n if (isComponentEditor(props.editor)) {\n columnSettings.editor = makeEditorClass(localEditorHooksRef, localEditorClassInstance);\n } else {\n const editorSetting = resolveEditorSetting(props.editor, props.hotEditor);\n\n if (editorSetting === undefined) {\n // Neither prop named an editor. Drop whatever the settings mapper copied over — it can be\n // a bare `true`, which the core rejects — and let the column inherit the grid editor.\n delete columnSettings.editor;\n } else {\n columnSettings.editor = editorSetting;\n }\n }\n\n return columnSettings;\n };\n\n const columnSettings = createColumnSettings();\n\n emitColumnSettings(columnSettings, columnIndex);\n\n if (!displayObsoleteRenderersEditorsWarning(props.children)) {\n displayAnyChildrenWarning(props.children);\n }\n });\n\n const editorPortal = createEditorPortal(getOwnerDocument(), props.editor, getEditorPortalHost());\n\n /**\n * Render the portals of the editors, if there are any.\n *\n * @returns {ReactElement}\n */\n return (\n <EditorContextProvider hooksRef={localEditorHooksRef}\n hotCustomEditorInstanceRef={localEditorClassInstance}>\n {editorPortal}\n </EditorContextProvider>\n );\n};\n\nexport { HotColumn, isHotColumn };\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","import React, {\n Dispatch,\n ReactPortal,\n forwardRef,\n Fragment,\n useImperativeHandle,\n useState,\n} from 'react';\n\nexport type RenderersPortalManagerRef = Dispatch<ReactPortal[]>;\n\n/**\n * Component used to manage the renderer component portals.\n */\nexport const RenderersPortalManager = forwardRef<RenderersPortalManagerRef>((_, ref) => {\n const [portals, setPortals] = useState<ReactPortal[]>([]);\n\n useImperativeHandle(ref, () => setPortals);\n\n return (\n <Fragment>\n {portals}\n </Fragment>\n );\n});\n","import React, {\n Children,\n Fragment,\n useEffect,\n useCallback,\n useImperativeHandle,\n useRef,\n forwardRef\n} from 'react';\nimport Handsontable from 'handsontable/base';\nimport PropTypes from 'prop-types';\nimport { ForwardedSettings, SettingsMapper } from './settingsMapper';\nimport { RenderersPortalManager } from './renderersPortalManager';\nimport { HotColumn, isHotColumn } from './hotColumn';\nimport { HotEditorHooks, HotTableProps, HotTableRef } from './types';\nimport {\n HOT_DESTROYED_WARNING,\n AUTOSIZE_WARNING,\n areEquivalentSettingsValue,\n copySettingsValue,\n EDITOR_PORTAL_HOST_CLASSNAME,\n MISSING_ROOT_PORTAL_WARNING,\n createEditorPortal,\n getContainerAttributesProps,\n isComponentEditor,\n isCSR,\n resolveEditorSetting,\n warn,\n displayObsoleteRenderersEditorsWarning,\n useUpdateEffect,\n displayChildrenOfTypeWarning\n} from './helpers';\nimport { useHotTableContext } from './hotTableContext';\nimport { HotColumnContextProvider } from './hotColumnContext';\nimport { EditorContextProvider, makeEditorClass } from './hotEditor';\n\nconst HotTableInner = forwardRef<\n HotTableRef,\n HotTableProps\n>((props, ref) => {\n\n /**\n * Reference to the Handsontable instance.\n */\n const __hotInstance = useRef<Handsontable | null>(null);\n\n /**\n * Reference to the main Handsontable DOM element.\n */\n const hotElementRef = useRef<HTMLDivElement>(null);\n\n /**\n * Reference to component-based editor overridden hooks object.\n */\n const globalEditorHooksRef = useRef<HotEditorHooks | null>(null);\n\n /**\n * Reference to HOT-native custom editor class instance.\n */\n const globalEditorClassInstance = useRef<Handsontable.editors.BaseEditor | null>(null);\n\n /**\n * Stable host for React editor portals. Appended to `rootPortalElement` after init\n * so core treats editor UI as inside the grid (see `#isPathWithinGrid`).\n */\n const editorPortalHostRef = useRef<HTMLElement | null>(null);\n\n /**\n * Reference to the previous props object.\n */\n const prevProps = useRef<HotTableProps>();\n\n /**\n * A copy of the `HotColumn` settings last passed to the grid. The children write their settings\n * into one array that the grid also holds, so the array itself cannot tell whether they changed.\n */\n const forwardedColumnsSettings = useRef<unknown>(null);\n\n /**\n * Copies of the settings last passed to the grid, compared with on every update so an unchanged prop\n * is left out (`SettingsMapper.getSettings()`). Started again for every new instance.\n */\n const forwardedSettings = useRef<ForwardedSettings>(new Map());\n\n /**\n * Whether the settings last passed to the grid named a grid-level editor (`editor`, `hotEditor`) and a\n * grid-level renderer (`renderer`, `hotRenderer`).\n */\n const namedGlobalEditor = useRef(false);\n const namedGlobalRenderer = useRef(false);\n\n /**\n * HotTable context exposing helper functions.\n */\n const context = useHotTableContext();\n\n /**\n * Getter for the property storing the Handsontable instance.\n */\n const getHotInstance = useCallback((): Handsontable | null => {\n if (!__hotInstance.current || !__hotInstance.current.isDestroyed) {\n\n // Will return the Handsontable instance or `null` if it's not yet been created.\n return __hotInstance.current;\n\n } else {\n console.warn(HOT_DESTROYED_WARNING);\n\n return null;\n }\n }, [__hotInstance]);\n\n const isHotInstanceDestroyed = useCallback((): boolean => {\n return !__hotInstance.current || __hotInstance.current.isDestroyed;\n }, [__hotInstance]);\n\n /**\n * Clear both the editor and the renderer cache.\n */\n const clearCache = useCallback((): void => {\n context.componentRendererColumns.clear();\n }, [context]);\n\n /**\n * Get the `Document` object corresponding to the main component element.\n *\n * @returns The `Document` object used by the component.\n */\n const getOwnerDocument = useCallback((): Document | null => {\n if (isCSR()) {\n return hotElementRef.current ? hotElementRef.current.ownerDocument : document;\n }\n\n return null;\n }, [hotElementRef]);\n\n /**\n * Get or create the stable editor portal host.\n *\n * @returns {HTMLElement | null} The host element, or `null` before a document is available.\n */\n const getEditorPortalHost = useCallback((): HTMLElement | null => {\n const doc = getOwnerDocument();\n\n if (!doc) {\n return null;\n }\n\n if (!editorPortalHostRef.current) {\n const host = doc.createElement('div');\n\n host.className = EDITOR_PORTAL_HOST_CLASSNAME;\n doc.body.appendChild(host);\n editorPortalHostRef.current = host;\n } else if (!editorPortalHostRef.current.isConnected) {\n doc.body.appendChild(editorPortalHostRef.current);\n }\n\n return editorPortalHostRef.current;\n }, [getOwnerDocument]);\n\n /**\n * Create a new settings object containing the column settings and global editors and renderers.\n *\n * @param {boolean} init `true` when called during the initial mount.\n * @param {HotTableProps} previousProps The component's props before the current update.\n * @returns {Handsontable.GridSettings} New global set of settings for Handsontable.\n */\n const createNewGlobalSettings = (init = false, previousProps: HotTableProps = {}): Handsontable.GridSettings => {\n const liveSettings = !isHotInstanceDestroyed() ? getHotInstance()?.getSettings() : undefined;\n const initOnlySettingKeys = (liveSettings as any)?._initOnlySettings || [];\n\n if (init) {\n forwardedSettings.current = new Map();\n }\n\n const newSettings = SettingsMapper.getSettings(\n props, {\n prevProps: previousProps,\n isInit: init,\n initOnlySettingKeys,\n currentSettings: liveSettings,\n forwardedSettings: forwardedSettings.current,\n }\n );\n\n if (context.columnsSettings.length) {\n if (init || !areEquivalentSettingsValue(forwardedColumnsSettings.current, context.columnsSettings)) {\n newSettings.columns = context.columnsSettings;\n forwardedColumnsSettings.current = copySettingsValue(context.columnsSettings);\n } else {\n delete newSettings.columns;\n }\n }\n\n // The grid-level `type` supplies the editor and the renderer no prop names, so an unnamed one is left out\n // of the payload. When the prop that named one is removed, `undefined` is sent: core reads it as \"unset\"\n // and the current `type` supplies the editor or the renderer again.\n const applyUnnamedSetting = (key: 'editor' | 'renderer', wasNamed: boolean) => {\n if (wasNamed) {\n newSettings[key] = undefined;\n\n } else {\n delete newSettings[key];\n }\n };\n\n if (props.renderer) {\n newSettings.renderer = context.getRendererWrapper(props.renderer);\n context.componentRendererColumns.set('global', true);\n } else if (props.hotRenderer) {\n newSettings.renderer = props.hotRenderer;\n } else {\n applyUnnamedSetting('renderer', namedGlobalRenderer.current);\n }\n\n namedGlobalRenderer.current = Boolean(props.renderer || props.hotRenderer);\n\n const editorSetting = isComponentEditor(props.editor) ?\n makeEditorClass(globalEditorHooksRef, globalEditorClassInstance) :\n resolveEditorSetting(props.editor, props.hotEditor);\n\n // `undefined` means neither prop named an editor.\n if (editorSetting === undefined) {\n applyUnnamedSetting('editor', namedGlobalEditor.current);\n } else {\n newSettings.editor = editorSetting;\n }\n\n namedGlobalEditor.current = editorSetting !== undefined;\n\n return newSettings;\n };\n\n /**\n * Detect if `autoRowSize` or `autoColumnSize` is defined, and if so, throw an incompatibility warning.\n *\n * @param {Handsontable | null} hotInstance The Handsontable instance to check.\n */\n const displayAutoSizeWarning = (hotInstance: Handsontable | null): void => {\n if (\n hotInstance &&\n (\n hotInstance.getPlugin('autoRowSize')?.enabled ||\n hotInstance.getPlugin('autoColumnSize')?.enabled\n )\n ) {\n if (context.componentRendererColumns.size > 0) {\n warn(AUTOSIZE_WARNING);\n }\n }\n };\n\n /**\n * Initialize Handsontable after the component has mounted.\n */\n useEffect(() => {\n // React guarantees child effects run before parent effects on each\n // commit, so by the time this parent useEffect runs, every HotColumn\n // has already written its slot. Trim to drop any leftover slots from\n // a previous mount (e.g. StrictMode's double-invoke or HMR).\n const hotColumnCount = Children.toArray(props.children).filter(isHotColumn).length;\n\n context.trimColumnSettings(hotColumnCount);\n\n const newGlobalSettings = createNewGlobalSettings(true);\n\n // Update prevProps with the current props\n prevProps.current = props;\n\n __hotInstance.current = new Handsontable.Core(hotElementRef.current!, newGlobalSettings);\n\n /**\n * Handsontable's `beforeViewRender` hook callback.\n */\n __hotInstance.current.addHook('beforeViewRender', () => {\n context.resetRenderedPortals();\n });\n\n /**\n * Handsontable's `beforeRenderer` hook callback. It runs for every cell the grid paints, whatever\n * the cell's renderer.\n */\n __hotInstance.current.addHook('beforeRenderer', (TD) => {\n context.markCellPainted(TD);\n });\n\n /**\n * Handsontable's `afterViewRender` hook callback.\n */\n __hotInstance.current.addHook('afterViewRender', () => {\n context.pushCellPortalsIntoPortalManager();\n });\n\n __hotInstance.current.init();\n\n const portalHost = editorPortalHostRef.current;\n const rootPortalElement = __hotInstance.current.rootPortalElement;\n\n if (portalHost && rootPortalElement) {\n if (portalHost.parentNode !== rootPortalElement) {\n rootPortalElement.appendChild(portalHost);\n }\n } else if (portalHost && !rootPortalElement) {\n warn(MISSING_ROOT_PORTAL_WARNING);\n }\n\n displayAutoSizeWarning(__hotInstance.current);\n\n if (!displayObsoleteRenderersEditorsWarning(props.children)) {\n displayChildrenOfTypeWarning(props.children, HotColumn);\n }\n\n /**\n * Destroy the Handsontable instance when the parent component unmounts.\n */\n return () => {\n editorPortalHostRef.current?.remove();\n clearCache();\n getHotInstance()?.destroy();\n };\n }, []);\n\n /**\n * Logic performed after the component update.\n */\n useUpdateEffect((): void => {\n clearCache();\n\n const hotInstance = getHotInstance();\n\n // React guarantees child effects run before parent effects on each\n // commit, so by the time this parent useUpdateEffect runs, every\n // surviving HotColumn has already written its slot. Trim to drop\n // stale entries left behind by HotColumns that unmounted.\n const hotColumnCount = Children.toArray(props.children).filter(isHotColumn).length;\n\n context.trimColumnSettings(hotColumnCount);\n\n const newGlobalSettings = createNewGlobalSettings(false, prevProps.current);\n\n // Update prevProps with the current props\n prevProps.current = props;\n\n hotInstance?.updateSettings(newGlobalSettings, false);\n\n displayAutoSizeWarning(hotInstance);\n displayObsoleteRenderersEditorsWarning(props.children);\n });\n\n /**\n * Interface exposed to parent components by HotTable instance via React ref\n */\n useImperativeHandle(ref, () => ({\n get hotElementRef() {\n return hotElementRef.current!;\n },\n get hotInstance() {\n return getHotInstance();\n }\n }));\n\n /**\n * Render the component.\n */\n const hotColumnWrapped = Children.toArray(props.children)\n .filter(isHotColumn)\n .map((childNode, columnIndex) => (\n <HotColumnContextProvider columnIndex={columnIndex}\n getOwnerDocument={getOwnerDocument}\n getEditorPortalHost={getEditorPortalHost}\n key={columnIndex}>\n {childNode}\n </HotColumnContextProvider>\n ));\n\n const containerProps = getContainerAttributesProps(props);\n const editorPortal = createEditorPortal(getOwnerDocument(), props.editor, getEditorPortalHost());\n\n return (\n <Fragment>\n <div\n ref={hotElementRef}\n {...containerProps}\n style={{ height: '100%', ...containerProps.style }}\n >\n {hotColumnWrapped}\n </div>\n <RenderersPortalManager ref={context.setRenderersPortalManagerRef} />\n <EditorContextProvider hooksRef={globalEditorHooksRef}\n hotCustomEditorInstanceRef={globalEditorClassInstance}>\n {editorPortal}\n </EditorContextProvider>\n </Fragment>\n );\n});\n\n/**\n * Prop types to be checked at runtime.\n */\nHotTableInner.propTypes = {\n style: PropTypes.object,\n id: PropTypes.string,\n className: PropTypes.string\n};\n\nexport default HotTableInner;\nexport { HotTableInner };\n","import React, {\n ForwardRefExoticComponent,\n RefAttributes,\n useId,\n forwardRef,\n} from 'react';\nimport * as packageJson from '../package.json';\nimport { HotTableInner } from './hotTableInner';\nimport { HotTableProps, HotTableRef } from './types';\nimport { HotTableContextProvider } from './hotTableContext';\n\ninterface Version {\n version?: string;\n}\n\ntype HotTable = ForwardRefExoticComponent<HotTableProps & RefAttributes<HotTableRef>> & Version;\n\n/**\n * A Handsontable-ReactJS wrapper.\n *\n * To implement, use the `HotTable` tag with properties corresponding to Handsontable options.\n * For example:\n *\n * ```js\n * <HotTable id=\"hot\" data={dataObject} contextMenu={true} colHeaders={true} width={600} height={300} stretchH=\"all\" />\n *\n * // is analogous to\n * let hot = new Handsontable(document.getElementById('hot'), {\n * data: dataObject,\n * contextMenu: true,\n * colHeaders: true,\n * width: 600\n * height: 300\n * });\n *\n * ```\n */\nconst HotTable: HotTable = forwardRef<HotTableRef, HotTableProps>(({ children, ...props }, ref) => {\n // `useId()` must run unconditionally on every render (never only when `id` is missing), or React\n // sees a different hook count between renders and throws \"Rendered fewer hooks than expected\".\n const generatedId = useId();\n const componentId = props.id ?? generatedId;\n\n return (\n <HotTableContextProvider>\n <HotTableInner id={componentId} {...props} ref={ref}>\n {children}\n </HotTableInner>\n </HotTableContextProvider>\n );\n});\n\n/**\n * Package version.\n *\n * @returns The version number of the package.\n */\nHotTable.version = (packageJson as any).version;\n\nexport default HotTable;\nexport { HotTable };\n"],"names":["bulkComponentContainer","AUTOSIZE_WARNING","OBSOLETE_HOTRENDERER_WARNING","OBSOLETE_HOTEDITOR_WARNING","UNEXPECTED_HOTTABLE_CHILDREN_WARNING","UNEXPECTED_HOTCOLUMN_CHILDREN_WARNING","CLASSIC_FUNCTION_RENDERER_WARNING","NATIVE_EDITOR_IN_EDITOR_PROP_WARNING","HOT_DESTROYED_WARNING","DEFAULT_CLASSNAME","EDITOR_PORTAL_HOST_CLASSNAME","MISSING_ROOT_PORTAL_WARNING","warn","console","_console","apply","arguments","warnedClassicFunctionRenderers","WeakSet","warnAboutClassicFunctionRenderer","renderer","length","has","add","displayObsoleteRenderersEditorsWarning","children","hasChildElementOfType","displayChildrenOfTypeWarning","Component","childrenArray","React","Children","toArray","some","child","type","displayAnyChildrenWarning","props","undefined","isComponentEditor","editor","isNativeEditor","NATIVE_EDITOR_METHODS","prototype","isReactComponent","every","method","isRegisteredEditorName","name","getEditor","_unused","warnedNativeEditorClasses","warnedNativeEditorNames","Set","warnAboutNativeEditorInEditorProp","resolveEditorSetting","hotEditor","createEditorPortal","doc","Editor","portalHost","EditorComponent","editorElement","createElement","containerProps","getContainerAttributesProps","className","concat","ReactDOM","createPortal","rElement","ownerDocument","document","portalKey","cachedContainer","portalContainer","createDocumentFragment","appendChild","portal","randomizeId","id","Math","random","toString","substring","style","isCSR","window","isObjectLike","value","_typeof","isPlainObject","Object","getPrototypeOf","isArray","Array","areEquivalentSettingsValue","previousValue","currentValue","visited","WeakMap","RegExp","source","flags","bothArrays","bothPlainObjects","previousObject","currentObject","comparedWith","get","set","previousKeys","keys","key","hasOwnProperty","call","copySettingsValue","copies","copy","forEach","item","push","useUpdateEffect","effect","deps","notInitialRender","useRef","useEffect","current","CELL_CLIP_CLASS","getCellContentRoot","TD","firstChild","firstElementChild","childNodes","classList","contains","DEEP_COMPARABLE_SETTINGS","COMPARED_AGAINST_LIVE_SETTINGS","CLEARED_BY_NULL_SETTINGS","ALWAYS_FORWARDED_SETTINGS","REFERENCE_COMPARED_SETTINGS","isSameAsForwarded","forwardedSettings","includes","forwardedValue","recordForwarded","isHookKey","Handsontable","hooks","isRegistered","isDeprecated","getClearedValue","DefaultSettings","isHookCallback","getForwardedValue","isInit","SettingsMapper","_classCallCheck","_createClass","getSettings","properties","_ref","_ref$prevProps","prevProps","_ref$isInit","_ref$initOnlySettingK","initOnlySettingKeys","currentSettings","shouldSkipProp","comparedValue","isNotPassed","newSettings","settingKey","hasOwn","HotTableContext","createContext","HotTableContextProvider","columnsSettings","setHotColumnSettings","useCallback","columnSettings","columnIndex","trimColumnSettings","componentRendererColumns","Map","cellPortals","rendererWrappers","renderedPortalContainerKeys","paintedCells","resetRenderedPortals","clear","markCellPainted","size","getPortalContainerCacheSize","tableIds","nextTableId","getTableId","_TD$parentElement$par","_TD$parentElement","tableSection","parentElement","cachedId","getRendererWrapper","Renderer","cachedWrapper","wrapper","__internalRenderer","instance","row","col","prop","cellProperties","instanceGuid","guid","getAttribute","_cellPortals$current$","tableId","portalContainerKey","cachedPortalContainer","container","contentRoot","containerInPlace","parentNode","rendererElement","_createPortal","removeChild","renderersPortalManager","setRenderersPortalManagerRef","pmComponent","pushCellPortalsIntoPortalManager","paintedKeys","portals","_ref2","cacheKey","isConnected","contextImpl","useMemo","emitColumnSettings","Provider","useHotTableContext","useContext","HotColumnContext","HotColumnContextProvider","getOwnerDocument","getEditorPortalHost","useHotColumnContext","AbstractMethods","ExcludedMethods","MethodsMap","open","close","prepare","focus","editorClasses","makeEditorClass","hooksRef","instanceRef","cachedEditorClass","EditorClass","_Handsontable$editors","CustomEditor","hotInstance","_this","_callSuper","getOwnPropertyNames","editors","BaseEditor","propName","baseMethod","_hooksRef$current","result","_len","args","_key","bind","_inherits","getValue","setValue","newValue","EditorContext","EditorContextProvider","_ref3","hotCustomEditorInstanceRef","applyEditorPosition","el","hot","td","_rootWindow$pageXOffs","_rootWindow$pageYOffs","rootWindow","pageX","pageXOffset","pageY","pageYOffset","isRtl","position","applyTdRect","rect","top","width","height","right","left","cell","getEditedCell","getBoundingClientRect","getEditedCellRect","rootElement","rootRect","start","useHotEditor","overriddenHooks","_ref4","_useState","useState","_useState2","_slicedToArray","rerenderTrigger","setRerenderTrigger","_useState3","_useState4","editorValue","setEditorValue","useImperativeHandle","_objectSpread","onOpen","event","_hotCustomEditorInsta","_overriddenHooks$onOp","t","_hotCustomEditorInsta2","isOpen","_hotCustomEditorInsta3","_hotCustomEditorInsta4","isOpened","finishEditing","_hotCustomEditorInsta5","_hotCustomEditorInsta6","_hotCustomEditorInsta7","_ref5","onPrepare","onClose","onFocus","_ref5$shortcutsGroup","shortcutsGroup","shortcuts","mainElementRef","_useState5","_useState6","themeClassName","setThemeClassName","_ref6","registerShortcuts","_hotCustomEditorInsta8","_hotCustomEditorInsta9","_hotCustomEditorInsta0","getShortcutManager","setActiveContextName","shortcutManager","editorContext","getContext","contextConfig","group","addShortcuts","map","shortcut","relativeToGroup","callback","unRegisterShortcuts","_hotCustomEditorInsta1","_hotCustomEditorInsta10","removeShortcutsByGroup","refreshDimensions","state","cancelChanges","unRegisterScrollHooks","removeHook","registerScrollHooks","addHook","_useHotEditor","_onOpen","_x","_hotCustomEditorInsta11","themeName","getCurrentThemeName","display","_row","_column","_prop","_originalValue","_cellProperties","stopMousedownPropagation","e","stopPropagation","ref","background","border","padding","zIndex","onMouseDown","isHotColumn","childNode","HotColumn","internalProps","_useHotTableContext","_useHotColumnContext","localEditorHooksRef","localEditorClassInstance","getSettingsProps","filter","reduce","obj","createColumnSettings","hotRenderer","editorSetting","editorPortal","ReactPropTypesSecret","ReactPropTypesSecret_1","require$$0","emptyFunction","emptyFunctionWithReset","resetWarningCache","factoryWithThrowingShims","shim","componentName","location","propFullName","secret","err","Error","isRequired","getShim","ReactPropTypes","array","bigint","bool","func","number","object","string","symbol","any","arrayOf","element","elementType","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","propTypesModule","exports","require$$2","RenderersPortalManager","forwardRef","_","setPortals","Fragment","HotTableInner","__hotInstance","hotElementRef","globalEditorHooksRef","globalEditorClassInstance","editorPortalHostRef","forwardedColumnsSettings","namedGlobalEditor","namedGlobalRenderer","context","getHotInstance","isDestroyed","isHotInstanceDestroyed","clearCache","host","body","createNewGlobalSettings","_getHotInstance","init","previousProps","liveSettings","_initOnlySettings","columns","applyUnnamedSetting","wasNamed","Boolean","displayAutoSizeWarning","_hotInstance$getPlugi","_hotInstance$getPlugi2","getPlugin","enabled","hotColumnCount","newGlobalSettings","Core","rootPortalElement","_editorPortalHostRef$","_getHotInstance2","remove","destroy","updateSettings","hotColumnWrapped","_extends","propTypes","HotTable","_props$id","_objectWithoutProperties","_excluded","generatedId","useId","componentId","version","packageJson"],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