@unovis/react 1.4.0 → 1.4.1-alpha.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.
@@ -1,4 +1,6 @@
1
1
  import { BulletLegendConfigInterface } from '@unovis/ts';
2
- export declare type VisBulletLegendProps = BulletLegendConfigInterface;
2
+ export declare type VisBulletLegendProps = BulletLegendConfigInterface & {
3
+ className?: string;
4
+ };
3
5
  export declare const VisBulletLegendSelectors: typeof import("@unovis/ts/lib/components/bullet-legend/style");
4
6
  export declare function VisBulletLegend(props: VisBulletLegendProps): JSX.Element;
@@ -6,14 +6,14 @@ function VisBulletLegend(props) {
6
6
  const container = useRef(null);
7
7
  const [component, setComponent] = useState();
8
8
  useEffect(() => {
9
- const c = new BulletLegend(container.current, props);
9
+ const c = new BulletLegend(container.current, Object.assign(Object.assign({}, props), { renderIntoProvidedDomNode: true }));
10
10
  setComponent(c);
11
11
  return () => c === null || c === void 0 ? void 0 : c.destroy();
12
12
  }, []);
13
13
  useEffect(() => {
14
14
  component === null || component === void 0 ? void 0 : component.update(props);
15
15
  });
16
- return React.createElement("div", { ref: container });
16
+ return React.createElement("div", { ref: container, className: props.className });
17
17
  }
18
18
 
19
19
  export { VisBulletLegend, VisBulletLegendSelectors };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/html-components/bullet-legend/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\nimport { BulletLegend, BulletLegendConfigInterface } from '@unovis/ts'\n\nexport type VisBulletLegendProps = BulletLegendConfigInterface\n\nexport const VisBulletLegendSelectors = BulletLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function VisBulletLegend (props: VisBulletLegendProps): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const [component, setComponent] = useState<BulletLegend>()\n\n // On Mount\n useEffect(() => {\n const c = new BulletLegend(container.current as HTMLDivElement, props)\n setComponent(c)\n\n return () => c?.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n component?.update(props)\n })\n\n return <div ref={container} />\n}\n"],"names":[],"mappings":";;;AAKa,MAAA,wBAAwB,GAAG,YAAY,CAAC,UAAS;AAGxD,SAAU,eAAe,CAAE,KAA2B,EAAA;AAC1D,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAgB,CAAA;IAG1D,SAAS,CAAC,MAAK;QACb,MAAM,CAAC,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,OAAyB,EAAE,KAAK,CAAC,CAAA;QACtE,YAAY,CAAC,CAAC,CAAC,CAAA;QAEf,OAAO,MAAM,CAAC,KAAA,IAAA,IAAD,CAAC,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAD,CAAC,CAAE,OAAO,EAAE,CAAA;KAC1B,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;QACb,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,MAAM,CAAC,KAAK,CAAC,CAAA;AAC1B,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,SAAS,GAAI,CAAA;AAChC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/html-components/bullet-legend/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\nimport { BulletLegend, BulletLegendConfigInterface } from '@unovis/ts'\n\nexport type VisBulletLegendProps = BulletLegendConfigInterface & {\n className?: string;\n}\n\nexport const VisBulletLegendSelectors = BulletLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function VisBulletLegend (props: VisBulletLegendProps): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const [component, setComponent] = useState<BulletLegend>()\n\n // On Mount\n useEffect(() => {\n const c = new BulletLegend(container.current as HTMLDivElement, { ...props, renderIntoProvidedDomNode: true })\n setComponent(c)\n\n return () => c?.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n component?.update(props)\n })\n\n return <div ref={container} className={props.className} />\n}\n"],"names":[],"mappings":";;;AAOa,MAAA,wBAAwB,GAAG,YAAY,CAAC,UAAS;AAGxD,SAAU,eAAe,CAAE,KAA2B,EAAA;AAC1D,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAgB,CAAA;IAG1D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,CAAC,GAAG,IAAI,YAAY,CAAC,SAAS,CAAC,OAAyB,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,MAAA,CAAA,EAAA,EAAO,KAAK,CAAE,EAAA,EAAA,yBAAyB,EAAE,IAAI,IAAG,CAAA;QAC9G,YAAY,CAAC,CAAC,CAAC,CAAA;QAEf,OAAO,MAAM,CAAC,KAAA,IAAA,IAAD,CAAC,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAD,CAAC,CAAE,OAAO,EAAE,CAAA;KAC1B,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;QACb,SAAS,KAAA,IAAA,IAAT,SAAS,KAAT,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,SAAS,CAAE,MAAM,CAAC,KAAK,CAAC,CAAA;AAC1B,KAAC,CAAC,CAAA;IAEF,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAA,CAAI,CAAA;AAC5D;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unovis/react",
3
3
  "description": "Modular data visualization framework for React, Angular, Svelte, and vanilla TypeScript or JavaScript",
4
- "version": "1.4.0",
4
+ "version": "1.4.1-alpha.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/f5/unovis.git",
@@ -35,7 +35,7 @@
35
35
  "publish:dist": "rm -rf dist/.cache; cp ./{LICENSE,README.md,package.json} ./dist; cd ./dist; npm publish"
36
36
  },
37
37
  "peerDependencies": {
38
- "@unovis/ts": "1.4.0",
38
+ "@unovis/ts": "1.4.1-alpha.1",
39
39
  "react": ">=16.8.0 || ^17 || ^18",
40
40
  "react-dom": ">=16.8.0 || ^17 || ^18"
41
41
  },