@heartlandone/vega-react 1.32.0 → 1.34.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.
@@ -5,6 +5,7 @@ export declare const VegaAppFooter: import("react").ForwardRefExoticComponent<JS
5
5
  export declare const VegaAppHeaderButton: import("react").ForwardRefExoticComponent<JSX.VegaAppHeaderButton & Omit<import("react").HTMLAttributes<HTMLVegaAppHeaderButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaAppHeaderButtonElement>>;
6
6
  export declare const VegaBadge: import("react").ForwardRefExoticComponent<JSX.VegaBadge & Omit<import("react").HTMLAttributes<HTMLVegaBadgeElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaBadgeElement>>;
7
7
  export declare const VegaBanner: import("react").ForwardRefExoticComponent<JSX.VegaBanner & Omit<import("react").HTMLAttributes<HTMLVegaBannerElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaBannerElement>>;
8
+ export declare const VegaBarChart: import("react").ForwardRefExoticComponent<JSX.VegaBarChart & Omit<import("react").HTMLAttributes<HTMLVegaBarChartElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaBarChartElement>>;
8
9
  export declare const VegaBox: import("react").ForwardRefExoticComponent<JSX.VegaBox & Omit<import("react").HTMLAttributes<HTMLVegaBoxElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaBoxElement>>;
9
10
  export declare const VegaButton: import("react").ForwardRefExoticComponent<JSX.VegaButton & Omit<import("react").HTMLAttributes<HTMLVegaButtonElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaButtonElement>>;
10
11
  export declare const VegaButtonCircle: import("react").ForwardRefExoticComponent<JSX.VegaButtonCircle & Omit<import("react").HTMLAttributes<HTMLVegaButtonCircleElement>, "style"> & import("./react-component-lib/interfaces").StyleReactProps & import("react").RefAttributes<HTMLVegaButtonCircleElement>>;
@@ -9,6 +9,7 @@ export const VegaAppFooter = /*@__PURE__*/ createReactComponent('vega-app-footer
9
9
  export const VegaAppHeaderButton = /*@__PURE__*/ createReactComponent('vega-app-header-button');
10
10
  export const VegaBadge = /*@__PURE__*/ createReactComponent('vega-badge');
11
11
  export const VegaBanner = /*@__PURE__*/ createReactComponent('vega-banner');
12
+ export const VegaBarChart = /*@__PURE__*/ createReactComponent('vega-bar-chart');
12
13
  export const VegaBox = /*@__PURE__*/ createReactComponent('vega-box');
13
14
  export const VegaButton = /*@__PURE__*/ createReactComponent('vega-button');
14
15
  export const VegaButtonCircle = /*@__PURE__*/ createReactComponent('vega-button-circle');
@@ -24,18 +24,25 @@ export const attachProps = (node, newProps, oldProps = {}) => {
24
24
  }
25
25
  }
26
26
  else {
27
- // TODO: this test case will be added in https://gethired.atlassian.net/browse/VD-859
28
- node.componentOnReady().then(() => {
29
- node[name] = newProps[name];
30
- const propType = typeof newProps[name];
31
- if (propType === 'string') {
32
- node.setAttribute(camelToDashCase(name), newProps[name]);
33
- }
34
- });
27
+ // For Next, the node have componentOnReady method in prototype of node, but no exist in React.
28
+ // so we attach props while componentOnReady in Next, and directly attach in React.
29
+ const hasOnReadyMethod = Boolean(node.componentOnReady);
30
+ hasOnReadyMethod ?
31
+ node.componentOnReady().then(() => {
32
+ attachProp(node, newProps, name);
33
+ }) :
34
+ attachProp(node, newProps, name);
35
35
  }
36
36
  });
37
37
  }
38
38
  };
39
+ function attachProp(node, newProps, name) {
40
+ node[name] = newProps[name];
41
+ const propType = typeof newProps[name];
42
+ if (propType === 'string') {
43
+ node.setAttribute(camelToDashCase(name), newProps[name]);
44
+ }
45
+ }
39
46
  export const getClassName = (classList, newProps, oldProps) => {
40
47
  const newClassProp = newProps.className || newProps.class;
41
48
  const oldClassProp = oldProps.className || oldProps.class;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@heartlandone/vega-react",
3
3
  "sideEffects": false,
4
- "version": "1.32.0",
4
+ "version": "1.34.0",
5
5
  "description": "React specific wrapper for @heartlandone/vega",
6
6
  "scripts": {
7
7
  "stencil-postbuild": "node ./src/scripts/stencil-post-build-script.js",
@@ -38,7 +38,7 @@
38
38
  "typescript": "^4.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@heartlandone/vega": "1.32.0"
41
+ "@heartlandone/vega": "1.34.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.7.0",