@heartlandone/vega-react 1.45.0 → 1.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/components.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare const VegaDropdown: import("react").ForwardRefExoticComponent<JSX
|
|
|
25
25
|
export declare const VegaFieldError: import("react").ForwardRefExoticComponent<JSX.VegaFieldError & Omit<import("react").HTMLAttributes<HTMLVegaFieldErrorElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaFieldErrorElement>>;
|
|
26
26
|
export declare const VegaFieldLabel: import("react").ForwardRefExoticComponent<JSX.VegaFieldLabel & Omit<import("react").HTMLAttributes<HTMLVegaFieldLabelElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaFieldLabelElement>>;
|
|
27
27
|
export declare const VegaFlex: import("react").ForwardRefExoticComponent<JSX.VegaFlex & Omit<import("react").HTMLAttributes<HTMLVegaFlexElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaFlexElement>>;
|
|
28
|
+
export declare const VegaFont: import("react").ForwardRefExoticComponent<JSX.VegaFont & Omit<import("react").HTMLAttributes<HTMLVegaFontElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaFontElement>>;
|
|
28
29
|
export declare const VegaFooter: import("react").ForwardRefExoticComponent<JSX.VegaFooter & Omit<import("react").HTMLAttributes<HTMLVegaFooterElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaFooterElement>>;
|
|
29
30
|
export declare const VegaForm: import("react").ForwardRefExoticComponent<JSX.VegaForm & Omit<import("react").HTMLAttributes<HTMLVegaFormElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaFormElement>>;
|
|
30
31
|
export declare const VegaGrid: import("react").ForwardRefExoticComponent<JSX.VegaGrid & Omit<import("react").HTMLAttributes<HTMLVegaGridElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaGridElement>>;
|
package/dist/components.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
/* auto-generated react proxies */
|
|
4
4
|
import { createReactComponent } from './react-component-lib';
|
|
5
5
|
import { defineCustomElements } from '@heartlandone/vega/loader';
|
|
6
|
+
import { setVegaEnv } from '@heartlandone/vega';
|
|
7
|
+
setVegaEnv({ framework: "react" });
|
|
6
8
|
defineCustomElements();
|
|
7
9
|
export const VegaAccordion = /*@__PURE__*/ createReactComponent('vega-accordion');
|
|
8
10
|
export const VegaAppFooter = /*@__PURE__*/ createReactComponent('vega-app-footer');
|
|
@@ -29,6 +31,7 @@ export const VegaDropdown = /*@__PURE__*/ createReactComponent('vega-dropdown');
|
|
|
29
31
|
export const VegaFieldError = /*@__PURE__*/ createReactComponent('vega-field-error');
|
|
30
32
|
export const VegaFieldLabel = /*@__PURE__*/ createReactComponent('vega-field-label');
|
|
31
33
|
export const VegaFlex = /*@__PURE__*/ createReactComponent('vega-flex');
|
|
34
|
+
export const VegaFont = /*@__PURE__*/ createReactComponent('vega-font');
|
|
32
35
|
export const VegaFooter = /*@__PURE__*/ createReactComponent('vega-footer');
|
|
33
36
|
export const VegaForm = /*@__PURE__*/ createReactComponent('vega-form');
|
|
34
37
|
export const VegaGrid = /*@__PURE__*/ createReactComponent('vega-grid');
|
|
@@ -10,6 +10,7 @@ export declare type VegaRef<T> = {
|
|
|
10
10
|
* See more info here: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
|
|
11
11
|
* Link issue: https://gethired.atlassian.net/browse/VD-1297
|
|
12
12
|
*
|
|
13
|
+
* @param {() => void} callback - The `callback` parameter is a function that will be called when the `vegaRef` is available.
|
|
13
14
|
* @returns {VegaRef} a callback function of type `VegaRef<T>`.
|
|
14
15
|
*/
|
|
15
|
-
export declare function useVegaRef<T>(): VegaRef<T>;
|
|
16
|
+
export declare function useVegaRef<T>(callback?: (ref: T) => void): VegaRef<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useState } from "react";
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* useVegaRef returns a callback that can be used to store a reference to a DOM node.
|
|
4
4
|
* It will be overridden to type {@link VegaRef} which value is stored by the callback
|
|
@@ -8,13 +8,21 @@ import { useCallback, useState } from "react";
|
|
|
8
8
|
* See more info here: https://medium.com/@teh_builder/ref-objects-inside-useeffect-hooks-eb7c15198780
|
|
9
9
|
* Link issue: https://gethired.atlassian.net/browse/VD-1297
|
|
10
10
|
*
|
|
11
|
+
* @param {() => void} callback - The `callback` parameter is a function that will be called when the `vegaRef` is available.
|
|
11
12
|
* @returns {VegaRef} a callback function of type `VegaRef<T>`.
|
|
12
13
|
*/
|
|
13
|
-
export function useVegaRef() {
|
|
14
|
+
export function useVegaRef(callback) {
|
|
14
15
|
const [refState, setRefState] = useState(undefined);
|
|
15
16
|
const refCallback = useCallback((node) => {
|
|
16
17
|
setRefState(node);
|
|
17
18
|
}, []);
|
|
18
19
|
refCallback.current = refState;
|
|
20
|
+
if (callback) {
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (refState) {
|
|
23
|
+
callback(refState);
|
|
24
|
+
}
|
|
25
|
+
}, [refState]);
|
|
26
|
+
}
|
|
19
27
|
return refCallback;
|
|
20
28
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heartlandone/vega-react",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.46.1",
|
|
5
5
|
"description": "React specific wrapper for @heartlandone/vega",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"stencil-postbuild": "node ./src/scripts/stencil-post-build-script.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"typescript": "^4.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@heartlandone/vega": "1.
|
|
42
|
+
"@heartlandone/vega": "1.46.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": ">=16.7.0",
|