@handsontable/react 12.3.1 → 12.3.2-next-e75de58-20230322

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/helpers.d.ts CHANGED
@@ -12,6 +12,10 @@ export declare const HOT_DESTROYED_WARNING: string;
12
12
  * String identifier for the global-scoped editor components.
13
13
  */
14
14
  export declare const GLOBAL_EDITOR_SCOPE = "global";
15
+ /**
16
+ * Default classname given to the wrapper container.
17
+ */
18
+ export declare const DEFAULT_CLASSNAME = "hot-wrapper-editor-container";
15
19
  /**
16
20
  * Logs warn to the console if the `console` object is exposed.
17
21
  *
@@ -33,22 +37,14 @@ export declare function getChildElementByType(children: React.ReactNode, type: s
33
37
  * @returns {Function} Original class of the editor component.
34
38
  */
35
39
  export declare function getOriginalEditorClass(editorElement: HotEditorElement): any;
36
- /**
37
- * Remove editor containers from DOM.
38
- *
39
- * @param {Document} [doc] Document to be used.
40
- * @param {Map} editorCache The editor cache reference.
41
- */
42
- export declare function removeEditorContainers(doc?: Document): void;
43
40
  /**
44
41
  * Create an editor portal.
45
42
  *
46
43
  * @param {Document} [doc] Document to be used.
47
44
  * @param {React.ReactElement} editorElement Editor's element.
48
- * @param {Map} editorCache The editor cache reference.
49
45
  * @returns {React.ReactPortal} The portal for the editor.
50
46
  */
51
- export declare function createEditorPortal(doc: Document, editorElement: HotEditorElement, editorCache: HotEditorCache): React.ReactPortal;
47
+ export declare function createEditorPortal(doc: Document, editorElement: HotEditorElement): React.ReactPortal | null;
52
48
  /**
53
49
  * Get an editor element extended with a instance-emitting method.
54
50
  *
@@ -64,11 +60,10 @@ export declare function getExtendedEditorElement(children: React.ReactNode, edit
64
60
  *
65
61
  * @param {React.ReactElement} rElement React element to be used as a base for the component.
66
62
  * @param {Object} props Props to be passed to the cloned element.
67
- * @param {Function} callback Callback to be called after the component has been mounted.
68
63
  * @param {Document} [ownerDocument] The owner document to set the portal up into.
69
64
  * @returns {{portal: React.ReactPortal, portalContainer: HTMLElement}} An object containing the portal and its container.
70
65
  */
71
- export declare function createPortal(rElement: React.ReactElement, props: any, callback: Function, ownerDocument?: Document): {
66
+ export declare function createPortal(rElement: React.ReactElement, props: any, ownerDocument?: Document): {
72
67
  portal: React.ReactPortal;
73
68
  portalContainer: HTMLElement;
74
69
  };
@@ -86,14 +81,3 @@ export declare function getContainerAttributesProps(props: any, randomizeId?: bo
86
81
  className: string;
87
82
  style: object;
88
83
  };
89
- /**
90
- * Add the `UNSAFE_` prefixes to the deprecated lifecycle methods for React >= 16.3.
91
- *
92
- * @param {Object} instance Instance to have the methods renamed.
93
- */
94
- export declare function addUnsafePrefixes(instance: {
95
- UNSAFE_componentWillUpdate?: Function;
96
- componentWillUpdate: Function;
97
- UNSAFE_componentWillMount?: Function;
98
- componentWillMount: Function;
99
- }): void;
package/hotColumn.d.ts CHANGED
@@ -1,35 +1,21 @@
1
- import React, { ReactPortal } from 'react';
1
+ import React from 'react';
2
2
  import { HotTableProps, HotColumnProps } from './types';
3
3
  import Handsontable from 'handsontable/base';
4
4
  declare class HotColumn extends React.Component<HotColumnProps, {}> {
5
5
  internalProps: string[];
6
6
  columnSettings: Handsontable.ColumnSettings;
7
7
  /**
8
- * Local editor portal cache.
8
+ * Component used to manage the editor portals.
9
9
  *
10
- * @private
11
- * @type {ReactPortal}
10
+ * @type {React.Component}
12
11
  */
13
- private localEditorPortal;
12
+ private editorsPortalManager;
14
13
  /**
15
- * HotColumn class constructor.
14
+ * Set the editors portal manager ref.
16
15
  *
17
- * @param {HotColumnProps} props Component props.
18
- * @param {*} [context] Component context.
16
+ * @param {React.ReactComponent} pmComponent The PortalManager component.
19
17
  */
20
- constructor(props: HotColumnProps, context?: any);
21
- /**
22
- * Get the local editor portal cache property.
23
- *
24
- * @return {ReactPortal} Local editor portal.
25
- */
26
- getLocalEditorPortal(): ReactPortal;
27
- /**
28
- * Set the local editor portal cache property.
29
- *
30
- * @param {ReactPortal} portal Local editor portal.
31
- */
32
- setLocalEditorPortal(portal: any): void;
18
+ private setEditorsPortalManagerRef;
33
19
  /**
34
20
  * Filter out all the internal properties and return an object with just the Handsontable-related props.
35
21
  *
@@ -47,27 +33,19 @@ declare class HotColumn extends React.Component<HotColumnProps, {}> {
47
33
  */
48
34
  createColumnSettings(): void;
49
35
  /**
50
- * Create the local editor portal and its destination HTML element if needed.
36
+ * Creates the local editor portal and renders it within the editors portal manager component.
51
37
  *
52
- * @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
38
+ * @param {Function} callback Callback to call which is triggered after the editors portal is rendered.
53
39
  */
54
- createLocalEditorPortal(children?: React.ReactNode): void;
40
+ renderLocalEditorPortal(callback: () => void): void;
55
41
  /**
56
42
  * Emit the column settings to the parent using a prop passed from the parent.
57
43
  */
58
44
  emitColumnSettings(): void;
59
- /**
60
- * Logic performed before the mounting of the HotColumn component.
61
- */
62
- componentWillMount(): void;
63
45
  /**
64
46
  * Logic performed after the mounting of the HotColumn component.
65
47
  */
66
48
  componentDidMount(): void;
67
- /**
68
- * Logic performed before the updating of the HotColumn component.
69
- */
70
- componentWillUpdate(nextProps: Readonly<HotColumnProps>, nextState: Readonly<{}>, nextContext: any): void;
71
49
  /**
72
50
  * Logic performed after the updating of the HotColumn component.
73
51
  */
package/hotTable.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Handsontable from 'handsontable/base';
3
- import { PortalManager } from './portalManager';
3
+ import { RenderersPortalManager } from './renderersPortalManager';
4
4
  import { HotTableProps, HotEditorElement, HotEditorCache, EditorScopeIdentifier } from './types';
5
5
  /**
6
6
  * A Handsontable-ReactJS wrapper.
@@ -67,18 +67,17 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
67
67
  *
68
68
  * @type {React.Component}
69
69
  */
70
- portalManager: PortalManager;
70
+ renderersPortalManager: RenderersPortalManager;
71
71
  /**
72
- * Array containing the portals cashed to be rendered in bulk after Handsontable's render cycle.
72
+ * Component used to manage the editor portals.
73
+ *
74
+ * @type {React.Component}
73
75
  */
74
- portalCacheArray: React.ReactPortal[];
76
+ private editorsPortalManager;
75
77
  /**
76
- * Global editor portal cache.
77
- *
78
- * @private
79
- * @type {React.ReactPortal}
78
+ * Array containing the portals cashed to be rendered in bulk after Handsontable's render cycle.
80
79
  */
81
- private globalEditorPortal;
80
+ portalCacheArray: React.ReactPortal[];
82
81
  /**
83
82
  * The rendered cells cache.
84
83
  *
@@ -101,13 +100,6 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
101
100
  * @type {Map}
102
101
  */
103
102
  private componentRendererColumns;
104
- /**
105
- * HotTable class constructor.
106
- *
107
- * @param {HotTableProps} props Component props.
108
- * @param {*} [context] Component context.
109
- */
110
- constructor(props: HotTableProps, context?: any);
111
103
  /**
112
104
  * Package version getter.
113
105
  *
@@ -139,18 +131,6 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
139
131
  * @returns {Map}
140
132
  */
141
133
  getEditorCache(): HotEditorCache;
142
- /**
143
- * Get the global editor portal property.
144
- *
145
- * @return {React.ReactPortal} The global editor portal.
146
- */
147
- getGlobalEditorPortal(): React.ReactPortal;
148
- /**
149
- * Set the private editor portal cache property.
150
- *
151
- * @param {React.ReactPortal} portal Global editor portal.
152
- */
153
- setGlobalEditorPortal(portal: React.ReactPortal): void;
154
134
  /**
155
135
  * Clear both the editor and the renderer cache.
156
136
  */
@@ -202,13 +182,13 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
202
182
  * @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
203
183
  * @returns {React.ReactElement} React editor component element.
204
184
  */
205
- getGlobalEditorElement(children?: React.ReactNode): HotEditorElement | null;
185
+ getGlobalEditorElement(): HotEditorElement | null;
206
186
  /**
207
- * Create the global editor portal and its destination HTML element if needed.
187
+ * Creates the global editor portal and renders it within the editors portal manager component.
208
188
  *
209
- * @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
189
+ * @param {Function} callback Callback to call which is triggered after the editors portal is rendered.
210
190
  */
211
- createGlobalEditorPortal(children?: React.ReactNode): void;
191
+ renderGlobalEditorPortal(callback: () => void): void;
212
192
  /**
213
193
  * Create a new settings object containing the column settings and global editors and renderers.
214
194
  *
@@ -243,23 +223,21 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
243
223
  */
244
224
  private updateHot;
245
225
  /**
246
- * Set the portal manager ref.
226
+ * Set the renderers portal manager ref.
247
227
  *
248
228
  * @param {React.ReactComponent} pmComponent The PortalManager component.
249
229
  */
250
- private setPortalManagerRef;
230
+ private setRenderersPortalManagerRef;
251
231
  /**
252
- * Logic performed before the mounting of the component.
232
+ * Set the editors portal manager ref.
233
+ *
234
+ * @param {React.ReactComponent} pmComponent The PortalManager component.
253
235
  */
254
- componentWillMount(): void;
236
+ private setEditorsPortalManagerRef;
255
237
  /**
256
238
  * Initialize Handsontable after the component has mounted.
257
239
  */
258
240
  componentDidMount(): void;
259
- /**
260
- * Logic performed before the component update.
261
- */
262
- componentWillUpdate(nextProps: Readonly<HotTableProps>, nextState: Readonly<{}>, nextContext: any): void;
263
241
  /**
264
242
  * Logic performed after the component update.
265
243
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsontable/react",
3
- "version": "12.3.1",
3
+ "version": "12.3.2-next-e75de58-20230322",
4
4
  "description": "Best Data Grid for React with Spreadsheet Look and Feel.",
5
5
  "author": "Handsoncode <hello@handsoncode.net> (https://handsoncode.net)",
6
6
  "homepage": "https://handsontable.com",
@@ -60,21 +60,20 @@
60
60
  "@babel/preset-react": "^7.9.4",
61
61
  "@babel/preset-typescript": "^7.9.0",
62
62
  "@babel/runtime": "^7.9.2",
63
- "@types/react": "^16.9.5",
64
63
  "@types/react-dom": "^16.9.1",
65
64
  "@types/react-redux": "^7.1.7",
65
+ "@types/react": "^16.9.5",
66
66
  "babel-core": "^7.0.0-bridge.0",
67
67
  "cpy-cli": "^3.1.1",
68
- "cross-env": "^5.2.0",
69
- "del-cli": "^3.0.1",
70
- "handsontable": "^12.0.0",
68
+ "cross-env": "^7.0.3",
69
+ "handsontable": "12.3.2-next-e75de58-20230322",
71
70
  "jest": "^25.1.0",
72
71
  "prop-types": "^15.7.2",
73
- "react": "^16.10.2",
74
72
  "react-dom": "^16.10.2",
75
73
  "react-redux": "^7.1.1",
74
+ "react": "^16.10.2",
76
75
  "redux": "^4.0.4",
77
- "rollup": "^2.58.0",
76
+ "rimraf": "^3.0.2",
78
77
  "rollup-plugin-alias": "^1.5.2",
79
78
  "rollup-plugin-babel": "^4.3.3",
80
79
  "rollup-plugin-commonjs": "^10.0.1",
@@ -83,11 +82,12 @@
83
82
  "rollup-plugin-replace": "^2.2.0",
84
83
  "rollup-plugin-terser": "^7.0.2",
85
84
  "rollup-plugin-typescript2": "^0.22.1",
85
+ "rollup": "^2.58.0",
86
86
  "typescript": "3.8.2",
87
87
  "uglify-js": "^3.4.9"
88
88
  },
89
89
  "peerDependencies": {
90
- "handsontable": ">=12.0.0"
90
+ "handsontable": "12.3.2-next-e75de58-20230322"
91
91
  },
92
92
  "scripts": {
93
93
  "build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:min",
@@ -95,7 +95,7 @@
95
95
  "build:umd": "cross-env NODE_ENV=umd rollup -c",
96
96
  "build:es": "cross-env NODE_ENV=es rollup -c",
97
97
  "build:min": "cross-env NODE_ENV=min rollup -c",
98
- "clean": "del-cli ./es/ && del-cli ./commonjs/ && del-cli ./dist/ && del-cli ./*.d.ts",
98
+ "clean": "rimraf ./es/ && rimraf ./commonjs/ && rimraf ./dist/ && rimraf ./*.d.ts",
99
99
  "publish-package": "npm publish",
100
100
  "test": "jest",
101
101
  "watch:commonjs": "cross-env NODE_ENV=cjs rollup -c --watch",
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ /**
3
+ * Component class used to manage the renderer component portals.
4
+ */
5
+ export declare class RenderersPortalManager extends React.Component<{}, {
6
+ portals?: React.ReactPortal[];
7
+ }> {
8
+ state: {
9
+ portals: any[];
10
+ };
11
+ render(): JSX.Element;
12
+ }
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * Component class used to manage the renderer component portals.
4
- */
5
- export declare class PortalManager extends React.Component<{}, {
6
- portals?: React.ReactPortal[];
7
- }> {
8
- constructor(props: any);
9
- render(): React.ReactNode;
10
- }