@genesislcap/rapid-grid-tabulator 14.424.1 → 14.426.0

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.
@@ -43,5 +43,6 @@ export declare const RapidGridTabulator: React.ForwardRefExoticComponent<
43
43
  }
44
44
  > & React.RefAttributes<RapidGridTabulatorWC>
45
45
  >;
46
+ export type RapidGridTabulatorRef = RapidGridTabulatorWC;
46
47
 
47
48
  export {};
package/dist/react.cjs CHANGED
@@ -5,16 +5,33 @@
5
5
 
6
6
  'use strict';
7
7
 
8
- const { provideReactWrapper } = require('@microsoft/fast-react-wrapper');
9
8
  const React = require('react');
10
9
  const { RapidGridTabulator: RapidGridTabulatorWC } = require('./esm/grid-tabulator.js');
11
10
 
12
- const { wrap } = provideReactWrapper(React);
11
+ function _mergeRefs(...refs) {
12
+ return (value) => {
13
+ for (const ref of refs) {
14
+ if (typeof ref === 'function') ref(value);
15
+ else if (ref != null) ref.current = value;
16
+ }
17
+ };
18
+ }
13
19
 
14
- const RapidGridTabulator = wrap(RapidGridTabulatorWC, {
15
- events: {
16
- onGridReady: 'gridReady',
17
- },
20
+ const RapidGridTabulator = React.forwardRef(function RapidGridTabulator(props, ref) {
21
+ const { onGridReady, children, ...rest } = props;
22
+ const _innerRef = React.useRef(null);
23
+ const _onGridReadyRef = React.useRef(onGridReady);
24
+ _onGridReadyRef.current = onGridReady;
25
+ React.useLayoutEffect(() => {
26
+ const el = _innerRef.current;
27
+ if (!el) return;
28
+ const _onGridReadyFn = (e) => _onGridReadyRef.current?.(e);
29
+ el.addEventListener('gridReady', _onGridReadyFn);
30
+ return () => {
31
+ el.removeEventListener('gridReady', _onGridReadyFn);
32
+ };
33
+ }, []);
34
+ return React.createElement(customElements.getName(RapidGridTabulatorWC) ?? '%%prefix%%-grid-tabulator', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
18
35
  });
19
36
 
20
37
  module.exports = {
package/dist/react.mjs CHANGED
@@ -3,14 +3,31 @@
3
3
  * Generated from custom-elements manifest.
4
4
  */
5
5
 
6
- import { provideReactWrapper } from '@microsoft/fast-react-wrapper';
7
6
  import React from 'react';
8
7
  import { RapidGridTabulator as RapidGridTabulatorWC } from './esm/grid-tabulator.js';
9
8
 
10
- const { wrap } = provideReactWrapper(React);
9
+ function _mergeRefs(...refs) {
10
+ return (value) => {
11
+ for (const ref of refs) {
12
+ if (typeof ref === 'function') ref(value);
13
+ else if (ref != null) ref.current = value;
14
+ }
15
+ };
16
+ }
11
17
 
12
- export const RapidGridTabulator = wrap(RapidGridTabulatorWC, {
13
- events: {
14
- onGridReady: 'gridReady',
15
- },
18
+ export const RapidGridTabulator = React.forwardRef(function RapidGridTabulator(props, ref) {
19
+ const { onGridReady, children, ...rest } = props;
20
+ const _innerRef = React.useRef(null);
21
+ const _onGridReadyRef = React.useRef(onGridReady);
22
+ _onGridReadyRef.current = onGridReady;
23
+ React.useLayoutEffect(() => {
24
+ const el = _innerRef.current;
25
+ if (!el) return;
26
+ const _onGridReadyFn = (e) => _onGridReadyRef.current?.(e);
27
+ el.addEventListener('gridReady', _onGridReadyFn);
28
+ return () => {
29
+ el.removeEventListener('gridReady', _onGridReadyFn);
30
+ };
31
+ }, []);
32
+ return React.createElement(customElements.getName(RapidGridTabulatorWC) ?? '%%prefix%%-grid-tabulator', { ...rest, ref: _mergeRefs(_innerRef, ref) }, children);
16
33
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/rapid-grid-tabulator",
3
3
  "description": "Genesis Rapid Grid Tabulator",
4
- "version": "14.424.1",
4
+ "version": "14.426.0",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "license": "SEE LICENSE IN license.txt",
@@ -35,19 +35,19 @@
35
35
  }
36
36
  },
37
37
  "devDependencies": {
38
- "@genesislcap/genx": "14.424.1",
39
- "@genesislcap/rollup-builder": "14.424.1",
40
- "@genesislcap/ts-builder": "14.424.1",
41
- "@genesislcap/uvu-playwright-builder": "14.424.1",
42
- "@genesislcap/vite-builder": "14.424.1",
43
- "@genesislcap/webpack-builder": "14.424.1"
38
+ "@genesislcap/genx": "14.426.0",
39
+ "@genesislcap/rollup-builder": "14.426.0",
40
+ "@genesislcap/ts-builder": "14.426.0",
41
+ "@genesislcap/uvu-playwright-builder": "14.426.0",
42
+ "@genesislcap/vite-builder": "14.426.0",
43
+ "@genesislcap/webpack-builder": "14.426.0"
44
44
  },
45
45
  "dependencies": {
46
- "@genesislcap/foundation-comms": "14.424.1",
47
- "@genesislcap/foundation-ui": "14.424.1",
48
- "@genesislcap/foundation-utils": "14.424.1",
49
- "@genesislcap/grid-tabulator": "14.424.1",
50
- "@genesislcap/rapid-design-system": "14.424.1",
46
+ "@genesislcap/foundation-comms": "14.426.0",
47
+ "@genesislcap/foundation-ui": "14.426.0",
48
+ "@genesislcap/foundation-utils": "14.426.0",
49
+ "@genesislcap/grid-tabulator": "14.426.0",
50
+ "@genesislcap/rapid-design-system": "14.426.0",
51
51
  "@microsoft/fast-colors": "5.3.1",
52
52
  "@microsoft/fast-components": "2.30.6",
53
53
  "@microsoft/fast-element": "1.14.0",
@@ -66,5 +66,5 @@
66
66
  "access": "public"
67
67
  },
68
68
  "customElements": "dist/custom-elements.json",
69
- "gitHead": "04bb18a6f0b26506a9d87ab252ce9e2329219a5e"
69
+ "gitHead": "fdf222ae3a2e4b9ea03dea45e0f7207cc096ef40"
70
70
  }