@unovis/react 1.5.1-xplg.1 → 1.5.1-xplg.2

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/components.d.ts CHANGED
@@ -19,5 +19,6 @@ export * from './components/xy-labels';
19
19
  export * from './components/annotations';
20
20
  export * from './components/treemap';
21
21
  export * from './html-components/bullet-legend';
22
+ export * from './html-components/rolling-pin-legend';
22
23
  export * from './html-components/leaflet-map';
23
24
  export * from './html-components/leaflet-flow-map';
@@ -0,0 +1,11 @@
1
+ import { Ref } from 'react';
2
+ import { RollingPinLegend, RollingPinLegendConfigInterface } from '@unovis/ts';
3
+ export declare type VisRollingPinLegendRef = {
4
+ component?: RollingPinLegend;
5
+ };
6
+ export declare type VisRollingPinLegendProps = RollingPinLegendConfigInterface & {
7
+ ref?: Ref<VisRollingPinLegendRef>;
8
+ className?: string;
9
+ };
10
+ export declare const VisRollingPinLegendSelectors: typeof import("@unovis/ts/lib/components/rolling-pin-legend/style");
11
+ export declare const VisRollingPinLegend: ((props: VisRollingPinLegendProps) => JSX.Element | null);
@@ -0,0 +1,23 @@
1
+ import React, { useRef, useState, useEffect, useImperativeHandle } from 'react';
2
+ import { RollingPinLegend } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
4
+
5
+ const VisRollingPinLegendSelectors = RollingPinLegend.selectors;
6
+ function VisRollingPinLegendFC(props, fRef) {
7
+ const ref = useRef(null);
8
+ const [component, setComponent] = useState();
9
+ useEffect(() => {
10
+ const c = new RollingPinLegend(ref.current, props);
11
+ setComponent(c);
12
+ return () => c === null || c === void 0 ? void 0 : c.destroy();
13
+ }, []);
14
+ useEffect(() => {
15
+ component === null || component === void 0 ? void 0 : component.setConfig(props);
16
+ });
17
+ useImperativeHandle(fRef, () => ({ get component() { return component; } }), []);
18
+ return React.createElement("div", { className: props.className, ref: ref });
19
+ }
20
+ const VisRollingPinLegend = React.memo(React.forwardRef(VisRollingPinLegendFC), arePropsEqual);
21
+
22
+ export { VisRollingPinLegend, VisRollingPinLegendSelectors };
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/html-components/rolling-pin-legend/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { RollingPinLegend, RollingPinLegendConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\nexport type VisRollingPinLegendRef = {\n component?: RollingPinLegend;\n}\n\nexport type VisRollingPinLegendProps = RollingPinLegendConfigInterface & {\n ref?: Ref<VisRollingPinLegendRef>;\n className?: string;\n}\n\nexport const VisRollingPinLegendSelectors = RollingPinLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisRollingPinLegendFC (props: VisRollingPinLegendProps, fRef: ForwardedRef<VisRollingPinLegendRef>): JSX.Element {\n const ref = useRef<HTMLDivElement>(null)\n const [component, setComponent] = useState<RollingPinLegend>()\n\n // On Mount\n useEffect(() => {\n const c = new RollingPinLegend(ref.current as HTMLDivElement, props)\n setComponent(c)\n\n return () => c?.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return component } }), [])\n return <div className={props.className} ref={ref} />\n}\n\n// We export a memoized component to avoid unnecessary re-renders\n// and define its type explicitly to help react-docgen-typescript to extract information about props\nexport const VisRollingPinLegend: ((props: VisRollingPinLegendProps) => JSX.Element | null) = React.memo(React.forwardRef(VisRollingPinLegendFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAgBa,MAAA,4BAA4B,GAAG,gBAAgB,CAAC,UAAS;AAGtE,SAAS,qBAAqB,CAAE,KAA+B,EAAE,IAA0C,EAAA;AACzG,IAAA,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IACxC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAoB,CAAA;IAG9D,SAAS,CAAC,MAAK;QACb,MAAM,CAAC,GAAG,IAAI,gBAAgB,CAAC,GAAG,CAAC,OAAyB,EAAE,KAAK,CAAC,CAAA;QACpE,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,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,KAAC,CAAC,CAAA;IAEF,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,KAAM,OAAO,SAAS,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;IAChF,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,EAAA,CAAI,CAAA;AACtD,CAAC;AAIY,MAAA,mBAAmB,GAA8D,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,EAAE,aAAa;;;;"}
package/index.js CHANGED
@@ -21,6 +21,7 @@ export { VisXYLabels, VisXYLabelsSelectors } from './components/xy-labels/index.
21
21
  export { VisAnnotations, VisAnnotationsSelectors } from './components/annotations/index.js';
22
22
  export { VisTreemap, VisTreemapSelectors } from './components/treemap/index.js';
23
23
  export { VisBulletLegend, VisBulletLegendSelectors } from './html-components/bullet-legend/index.js';
24
+ export { VisRollingPinLegend, VisRollingPinLegendSelectors } from './html-components/rolling-pin-legend/index.js';
24
25
  export { VisLeafletMap, VisLeafletMapSelectors } from './html-components/leaflet-map/index.js';
25
26
  export { VisLeafletFlowMap, VisLeafletFlowMapSelectors } from './html-components/leaflet-flow-map/index.js';
26
27
  export { VisTimeSeries } from './composites/time-series/index.js';
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
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, Vue, Solid, and vanilla TypeScript or JavaScript",
4
- "version": "1.5.1-xplg.1",
4
+ "version": "1.5.1-xplg.2",
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.5.1-xplg.1",
38
+ "@unovis/ts": "1.5.1-xplg.2",
39
39
  "react": ">=16.8.0 || ^17 || ^18 || ^19",
40
40
  "react-dom": ">=16.8.0 || ^17 || ^18 || ^19"
41
41
  },