@unovis/react 1.4.1-beta.0 → 1.4.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.
@@ -4,7 +4,7 @@ export declare type VisAnnotationsRef = {
4
4
  component?: Annotations;
5
5
  };
6
6
  export declare type VisAnnotationsProps = AnnotationsConfigInterface & {
7
- data?: null;
8
7
  ref?: Ref<VisAnnotationsRef>;
9
8
  };
9
+ export declare const VisAnnotationsSelectors: typeof import("@unovis/ts/lib/components/annotations/style");
10
10
  export declare const VisAnnotations: ((props: VisAnnotationsProps) => JSX.Element | null);
@@ -2,6 +2,7 @@ import React, { useRef, useEffect, useImperativeHandle } from 'react';
2
2
  import { Annotations } from '@unovis/ts';
3
3
  import { arePropsEqual } from '../../utils/react.js';
4
4
 
5
+ const VisAnnotationsSelectors = Annotations.selectors;
5
6
  function VisAnnotationsFC(props, fRef) {
6
7
  const ref = useRef(null);
7
8
  const componentRef = useRef(undefined);
@@ -19,10 +20,10 @@ function VisAnnotationsFC(props, fRef) {
19
20
  const component = componentRef.current;
20
21
  component === null || component === void 0 ? void 0 : component.setConfig(props);
21
22
  });
22
- useImperativeHandle(fRef, () => ({ component: componentRef.current }), [componentRef.current]);
23
+ useImperativeHandle(fRef, () => ({ get component() { return componentRef.current; } }), []);
23
24
  return React.createElement("vis-annotations", { ref: ref });
24
25
  }
25
26
  const VisAnnotations = React.memo(React.forwardRef(VisAnnotationsFC), arePropsEqual);
26
27
 
27
- export { VisAnnotations };
28
+ export { VisAnnotations, VisAnnotationsSelectors };
28
29
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/annotations/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Annotations, AnnotationsConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisAnnotationsRef = {\n component?: Annotations;\n}\n\nexport type VisAnnotationsProps = AnnotationsConfigInterface & {\n data?: null;\n ref?: Ref<VisAnnotationsRef>;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAnnotationsFC (props: VisAnnotationsProps, fRef: ForwardedRef<VisAnnotationsRef>): JSX.Element {\n const ref = useRef<VisComponentElement<Annotations>>(null)\n const componentRef = useRef<Annotations | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Annotations>)\n\n const c = new Annotations(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ component: componentRef.current }), [componentRef.current])\n return <vis-annotations 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 VisAnnotations: ((props: VisAnnotationsProps) => JSX.Element | null) = React.memo(React.forwardRef(VisAnnotationsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAoBA,SAAS,gBAAgB,CAAE,KAA0B,EAAE,IAAqC,EAAA;AAC1F,IAAA,MAAM,GAAG,GAAG,MAAM,CAAmC,IAAI,CAAC,CAAA;AAC1D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAA;IAG/D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA4C,CAAA;AAEjE,QAAA,MAAM,CAAC,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAA;AAChC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QACtC,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,SAAS,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAA;AAC9F,IAAA,OAAO,KAAiB,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACtC,CAAC;AAIY,MAAA,cAAc,GAAyD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/annotations/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Annotations, AnnotationsConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisAnnotationsRef = {\n component?: Annotations;\n}\n\nexport type VisAnnotationsProps = AnnotationsConfigInterface & {\n ref?: Ref<VisAnnotationsRef>;\n}\n\nexport const VisAnnotationsSelectors = Annotations.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisAnnotationsFC (props: VisAnnotationsProps, fRef: ForwardedRef<VisAnnotationsRef>): JSX.Element {\n const ref = useRef<VisComponentElement<Annotations>>(null)\n const componentRef = useRef<Annotations | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Annotations>)\n\n const c = new Annotations(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-annotations 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 VisAnnotations: ((props: VisAnnotationsProps) => JSX.Element | null) = React.memo(React.forwardRef(VisAnnotationsFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAkBa,MAAA,uBAAuB,GAAG,WAAW,CAAC,UAAS;AAG5D,SAAS,gBAAgB,CAAE,KAA0B,EAAE,IAAqC,EAAA;AAC1F,IAAA,MAAM,GAAG,GAAG,MAAM,CAAmC,IAAI,CAAC,CAAA;AAC1D,IAAA,MAAM,YAAY,GAAG,MAAM,CAA0B,SAAS,CAAC,CAAA;IAG/D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAA4C,CAAA;AAEjE,QAAA,MAAM,CAAC,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAA;AAChC,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QAEtC,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,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAiB,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AACtC,CAAC;AAIY,MAAA,cAAc,GAAyD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,aAAa;;;;"}
@@ -4,7 +4,6 @@ export declare type VisTooltipRef = {
4
4
  component?: Tooltip;
5
5
  };
6
6
  export declare type VisTooltipProps = TooltipConfigInterface & {
7
- data?: null;
8
7
  ref?: Ref<VisTooltipRef>;
9
8
  };
10
9
  export declare const VisTooltipSelectors: typeof import("@unovis/ts/lib/components/tooltip/style");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/tooltip/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Tooltip, TooltipConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTooltipRef = {\n component?: Tooltip;\n}\n\nexport type VisTooltipProps = TooltipConfigInterface & {\n data?: null;\n ref?: Ref<VisTooltipRef>;\n}\n\nexport const VisTooltipSelectors = Tooltip.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTooltipFC (props: VisTooltipProps, fRef: ForwardedRef<VisTooltipRef>): JSX.Element {\n const ref = useRef<VisComponentElement<Tooltip>>(null)\n const componentRef = useRef<Tooltip | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Tooltip>)\n\n const c = new Tooltip(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-tooltip 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 VisTooltip: ((props: VisTooltipProps) => JSX.Element | null) = React.memo(React.forwardRef(VisTooltipFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAmBa,MAAA,mBAAmB,GAAG,OAAO,CAAC,UAAS;AAGpD,SAAS,YAAY,CAAE,KAAsB,EAAE,IAAiC,EAAA;AAC9E,IAAA,MAAM,GAAG,GAAG,MAAM,CAA+B,IAAI,CAAC,CAAA;AACtD,IAAA,MAAM,YAAY,GAAG,MAAM,CAAsB,SAAS,CAAC,CAAA;IAG3D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAwC,CAAA;AAE7D,QAAA,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;AAC5B,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QAEtC,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,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAa,CAAA,aAAA,CAAA,aAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AAClC,CAAC;AAIY,MAAA,UAAU,GAAqD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/tooltip/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { Tooltip, TooltipConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\n// Types\nimport { VisComponentElement } from 'src/types/dom'\n\nexport type VisTooltipRef = {\n component?: Tooltip;\n}\n\nexport type VisTooltipProps = TooltipConfigInterface & {\n ref?: Ref<VisTooltipRef>;\n}\n\nexport const VisTooltipSelectors = Tooltip.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisTooltipFC (props: VisTooltipProps, fRef: ForwardedRef<VisTooltipRef>): JSX.Element {\n const ref = useRef<VisComponentElement<Tooltip>>(null)\n const componentRef = useRef<Tooltip | undefined>(undefined)\n\n // On Mount\n useEffect(() => {\n const element = (ref.current as VisComponentElement<Tooltip>)\n\n const c = new Tooltip(props)\n componentRef.current = c\n element.__component__ = c\n\n return () => {\n componentRef.current = undefined\n c.destroy()\n }\n }, [])\n\n // On Props Update\n useEffect(() => {\n const component = componentRef.current\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(fRef, () => ({ get component () { return componentRef.current } }), [])\n return <vis-tooltip 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 VisTooltip: ((props: VisTooltipProps) => JSX.Element | null) = React.memo(React.forwardRef(VisTooltipFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAkBa,MAAA,mBAAmB,GAAG,OAAO,CAAC,UAAS;AAGpD,SAAS,YAAY,CAAE,KAAsB,EAAE,IAAiC,EAAA;AAC9E,IAAA,MAAM,GAAG,GAAG,MAAM,CAA+B,IAAI,CAAC,CAAA;AACtD,IAAA,MAAM,YAAY,GAAG,MAAM,CAAsB,SAAS,CAAC,CAAA;IAG3D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,OAAO,GAAI,GAAG,CAAC,OAAwC,CAAA;AAE7D,QAAA,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,KAAK,CAAC,CAAA;AAC5B,QAAA,YAAY,CAAC,OAAO,GAAG,CAAC,CAAA;AACxB,QAAA,OAAO,CAAC,aAAa,GAAG,CAAC,CAAA;AAEzB,QAAA,OAAO,MAAK;AACV,YAAA,YAAY,CAAC,OAAO,GAAG,SAAS,CAAA;YAChC,CAAC,CAAC,OAAO,EAAE,CAAA;AACb,SAAC,CAAA;KACF,EAAE,EAAE,CAAC,CAAA;IAGN,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAA;QAEtC,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,GAAA,EAAM,OAAO,YAAY,CAAC,OAAO,CAAA,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAA;AAC3F,IAAA,OAAO,KAAa,CAAA,aAAA,CAAA,aAAA,EAAA,EAAA,GAAG,EAAE,GAAG,GAAI,CAAA;AAClC,CAAC;AAIY,MAAA,UAAU,GAAqD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,aAAa;;;;"}
@@ -1,4 +1,11 @@
1
- import { BulletLegendConfigInterface } from '@unovis/ts';
2
- export declare type VisBulletLegendProps = BulletLegendConfigInterface;
1
+ import { Ref } from 'react';
2
+ import { BulletLegend, BulletLegendConfigInterface } from '@unovis/ts';
3
+ export declare type VisBulletLegendRef = {
4
+ component?: BulletLegend;
5
+ };
6
+ export declare type VisBulletLegendProps = BulletLegendConfigInterface & {
7
+ ref?: Ref<VisBulletLegendRef>;
8
+ className?: string;
9
+ };
3
10
  export declare const VisBulletLegendSelectors: typeof import("@unovis/ts/lib/components/bullet-legend/style");
4
- export declare function VisBulletLegend(props: VisBulletLegendProps): JSX.Element;
11
+ export declare const VisBulletLegend: ((props: VisBulletLegendProps) => JSX.Element | null);
@@ -1,20 +1,23 @@
1
- import React, { useRef, useState, useEffect } from 'react';
1
+ import React, { useRef, useState, useEffect, useImperativeHandle } from 'react';
2
2
  import { BulletLegend } from '@unovis/ts';
3
+ import { arePropsEqual } from '../../utils/react.js';
3
4
 
4
5
  const VisBulletLegendSelectors = BulletLegend.selectors;
5
- function VisBulletLegend(props) {
6
- const container = useRef(null);
6
+ function VisBulletLegendFC(props, fRef) {
7
+ const ref = useRef(null);
7
8
  const [component, setComponent] = useState();
8
9
  useEffect(() => {
9
- const c = new BulletLegend(container.current, props);
10
+ const c = new BulletLegend(ref.current, props);
10
11
  setComponent(c);
11
12
  return () => c === null || c === void 0 ? void 0 : c.destroy();
12
13
  }, []);
13
14
  useEffect(() => {
14
15
  component === null || component === void 0 ? void 0 : component.update(props);
15
16
  });
16
- return React.createElement("div", { ref: container });
17
- }
17
+ useImperativeHandle(fRef, () => ({ get component() { return component; } }), []);
18
+ return React.createElement("div", { className: props.className, ref: ref });
19
+ }
20
+ const VisBulletLegend = React.memo(React.forwardRef(VisBulletLegendFC), arePropsEqual);
18
21
 
19
22
  export { VisBulletLegend, VisBulletLegendSelectors };
20
23
  //# sourceMappingURL=index.js.map
@@ -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":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { BulletLegend, BulletLegendConfigInterface } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\nexport type VisBulletLegendRef = {\n component?: BulletLegend;\n}\n\nexport type VisBulletLegendProps = BulletLegendConfigInterface & {\n ref?: Ref<VisBulletLegendRef>;\n className?: string;\n}\n\nexport const VisBulletLegendSelectors = BulletLegend.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisBulletLegendFC (props: VisBulletLegendProps, fRef: ForwardedRef<VisBulletLegendRef>): JSX.Element {\n const ref = useRef<HTMLDivElement>(null)\n const [component, setComponent] = useState<BulletLegend>()\n\n // On Mount\n useEffect(() => {\n const c = new BulletLegend(ref.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 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 VisBulletLegend: ((props: VisBulletLegendProps) => JSX.Element | null) = React.memo(React.forwardRef(VisBulletLegendFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAgBa,MAAA,wBAAwB,GAAG,YAAY,CAAC,UAAS;AAG9D,SAAS,iBAAiB,CAAE,KAA2B,EAAE,IAAsC,EAAA;AAC7F,IAAA,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IACxC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAgB,CAAA;IAG1D,SAAS,CAAC,MAAK;QACb,MAAM,CAAC,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC,OAAyB,EAAE,KAAK,CAAC,CAAA;QAChE,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,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,eAAe,GAA0D,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,aAAa;;;;"}
@@ -1,16 +1,15 @@
1
- import { ForwardedRef, Ref } from 'react';
2
- import { LeafletFlowMap, LeafletFlowMapConfigInterface } from '@unovis/ts';
3
- export declare const VisLeafletFlowMapSelectors: typeof import("@unovis/ts/lib/components/leaflet-map/style");
4
- export declare type VisLeafletFlowMapProps<PointDatum extends Record<string, unknown>, FlowDatum extends Record<string, unknown>> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {
1
+ import { Ref } from 'react';
2
+ import { LeafletFlowMap, LeafletFlowMapConfigInterface, GenericDataRecord } from '@unovis/ts';
3
+ export declare type VisLeafletFlowMapRef<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = {
4
+ component?: LeafletFlowMap<PointDatum, FlowDatum>;
5
+ };
6
+ export declare type VisLeafletFlowMapProps<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {
5
7
  data?: {
6
8
  points: PointDatum[];
7
- flows: FlowDatum[];
9
+ flows?: FlowDatum[];
8
10
  };
9
11
  ref?: Ref<VisLeafletFlowMapRef<PointDatum, FlowDatum>>;
10
12
  className?: string;
11
13
  };
12
- export declare type VisLeafletFlowMapRef<PointDatum extends Record<string, unknown>, FlowDatum extends Record<string, unknown>> = {
13
- component: LeafletFlowMap<PointDatum, FlowDatum> | undefined;
14
- };
15
- export declare function VisLeafletFlowMapFC<PointDatum extends Record<string, unknown>, FlowDatum extends Record<string, unknown>>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>, ref: ForwardedRef<VisLeafletFlowMapRef<PointDatum, FlowDatum>>): JSX.Element;
16
- export declare const VisLeafletFlowMap: (<PointDatum extends Record<string, unknown>, FlowDatum extends Record<string, unknown>>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null);
14
+ export declare const VisLeafletFlowMapSelectors: typeof import("@unovis/ts/lib/components/leaflet-map/style");
15
+ export declare const VisLeafletFlowMap: (<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null);
@@ -3,11 +3,11 @@ import { LeafletFlowMap } from '@unovis/ts';
3
3
  import { arePropsEqual } from '../../utils/react.js';
4
4
 
5
5
  const VisLeafletFlowMapSelectors = LeafletFlowMap.selectors;
6
- function VisLeafletFlowMapFC(props, ref) {
7
- const container = useRef(null);
6
+ function VisLeafletFlowMapFC(props, fRef) {
7
+ const ref = useRef(null);
8
8
  const [component, setComponent] = useState();
9
9
  useEffect(() => {
10
- const c = new LeafletFlowMap(container.current, props, props.data);
10
+ const c = new LeafletFlowMap(ref.current, props, props.data);
11
11
  setComponent(c);
12
12
  return () => c === null || c === void 0 ? void 0 : c.destroy();
13
13
  }, []);
@@ -16,10 +16,10 @@ function VisLeafletFlowMapFC(props, ref) {
16
16
  component === null || component === void 0 ? void 0 : component.setData(props.data);
17
17
  component === null || component === void 0 ? void 0 : component.setConfig(props);
18
18
  });
19
- useImperativeHandle(ref, () => ({ get component() { return component; } }), [component]);
20
- return React.createElement("div", { ref: container, className: props.className });
19
+ useImperativeHandle(fRef, () => ({ get component() { return component; } }), []);
20
+ return React.createElement("div", { className: props.className, ref: ref });
21
21
  }
22
22
  const VisLeafletFlowMap = React.memo(React.forwardRef(VisLeafletFlowMapFC), arePropsEqual);
23
23
 
24
- export { VisLeafletFlowMap, VisLeafletFlowMapFC, VisLeafletFlowMapSelectors };
24
+ export { VisLeafletFlowMap, VisLeafletFlowMapSelectors };
25
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-flow-map/index.tsx"],"sourcesContent":["import React, { ForwardedRef, Ref, useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { LeafletFlowMap, LeafletFlowMapConfigInterface } from '@unovis/ts'\nimport { arePropsEqual } from '../../utils/react'\n\nexport const VisLeafletFlowMapSelectors = LeafletFlowMap.selectors\n\nexport type VisLeafletFlowMapProps<\n PointDatum extends Record<string, unknown>,\n FlowDatum extends Record<string, unknown>,\n> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {\n data?: { points: PointDatum[]; flows: FlowDatum[] };\n ref?: Ref<VisLeafletFlowMapRef<PointDatum, FlowDatum>>;\n className?: string;\n}\n\nexport type VisLeafletFlowMapRef<\n PointDatum extends Record<string, unknown>,\n FlowDatum extends Record<string, unknown>,\n> = {\n component: LeafletFlowMap<PointDatum, FlowDatum> | undefined;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function VisLeafletFlowMapFC<\n PointDatum extends Record<string, unknown>,\n FlowDatum extends Record<string, unknown>,\n> (\n props: VisLeafletFlowMapProps<PointDatum, FlowDatum>,\n ref: ForwardedRef<VisLeafletFlowMapRef<PointDatum, FlowDatum>>\n): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const [component, setComponent] = useState<LeafletFlowMap<PointDatum, FlowDatum>>()\n\n // On Mount\n useEffect(() => {\n const c = new LeafletFlowMap(container.current as HTMLDivElement, props, props.data)\n setComponent(c)\n\n return () => c?.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n if (props.data) component?.setData(props.data)\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(ref, () => ({ get component () { return component } }), [component])\n return <div ref={container} className={props.className} />\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 VisLeafletFlowMap: (<\n PointDatum extends Record<string, unknown>,\n FlowDatum extends Record<string, unknown>,\n>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null) =\n React.memo(React.forwardRef(VisLeafletFlowMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAIa,MAAA,0BAA0B,GAAG,cAAc,CAAC,UAAS;AAmBlD,SAAA,mBAAmB,CAIjC,KAAoD,EACpD,GAA8D,EAAA;AAE9D,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAyC,CAAA;IAGnF,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,CAAC,GAAG,IAAI,cAAc,CAAC,SAAS,CAAC,OAAyB,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACpF,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,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAE9C,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,GAAG,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,SAAS,CAAA,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IACxF,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAA,CAAI,CAAA;AAC5D,CAAC;AAIY,MAAA,iBAAiB,GAI5B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-flow-map/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { LeafletFlowMap, LeafletFlowMapConfigInterface, GenericDataRecord } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\nexport type VisLeafletFlowMapRef<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = {\n component?: LeafletFlowMap<PointDatum, FlowDatum>;\n}\n\nexport type VisLeafletFlowMapProps<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> = LeafletFlowMapConfigInterface<PointDatum, FlowDatum> & {\n data?: { points: PointDatum[]; flows?: FlowDatum[] };\n ref?: Ref<VisLeafletFlowMapRef<PointDatum, FlowDatum>>;\n className?: string;\n}\n\nexport const VisLeafletFlowMapSelectors = LeafletFlowMap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLeafletFlowMapFC<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord> (props: VisLeafletFlowMapProps<PointDatum, FlowDatum>, fRef: ForwardedRef<VisLeafletFlowMapRef<PointDatum, FlowDatum>>): JSX.Element {\n const ref = useRef<HTMLDivElement>(null)\n const [component, setComponent] = useState<LeafletFlowMap<PointDatum, FlowDatum>>()\n\n // On Mount\n useEffect(() => {\n const c = new LeafletFlowMap<PointDatum, FlowDatum>(ref.current as HTMLDivElement, props, props.data)\n setComponent(c)\n\n return () => c?.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n if (props.data) component?.setData(props.data)\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 VisLeafletFlowMap: (<PointDatum extends GenericDataRecord, FlowDatum extends GenericDataRecord>(props: VisLeafletFlowMapProps<PointDatum, FlowDatum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLeafletFlowMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAiBa,MAAA,0BAA0B,GAAG,cAAc,CAAC,UAAS;AAGlE,SAAS,mBAAmB,CAA6E,KAAoD,EAAE,IAA+D,EAAA;AAC5N,IAAA,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IACxC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAyC,CAAA;IAGnF,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,CAAC,GAAG,IAAI,cAAc,CAAwB,GAAG,CAAC,OAAyB,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACrG,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,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,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,iBAAiB,GAA8J,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,aAAa;;;;"}
@@ -1,13 +1,12 @@
1
- import { ForwardedRef, Ref } from 'react';
2
- import { LeafletMap, LeafletMapConfigInterface } from '@unovis/ts';
3
- export declare const VisLeafletMapSelectors: typeof import("@unovis/ts/lib/components/leaflet-map/style");
4
- export declare type VisLeafletMapProps<Datum extends Record<string, unknown>> = LeafletMapConfigInterface<Datum> & {
1
+ import { Ref } from 'react';
2
+ import { LeafletMap, LeafletMapConfigInterface, GenericDataRecord } from '@unovis/ts';
3
+ export declare type VisLeafletMapRef<Datum extends GenericDataRecord> = {
4
+ component?: LeafletMap<Datum>;
5
+ };
6
+ export declare type VisLeafletMapProps<Datum extends GenericDataRecord> = LeafletMapConfigInterface<Datum> & {
5
7
  data?: Datum[];
6
8
  ref?: Ref<VisLeafletMapRef<Datum>>;
7
9
  className?: string;
8
10
  };
9
- export declare type VisLeafletMapRef<Datum extends Record<string, unknown>> = {
10
- component: LeafletMap<Datum> | undefined;
11
- };
12
- export declare function VisLeafletMapFC<Datum extends Record<string, unknown>>(props: VisLeafletMapProps<Datum>, ref: ForwardedRef<VisLeafletMapRef<Datum>>): JSX.Element;
13
- export declare const VisLeafletMap: (<Datum extends Record<string, unknown>>(props: VisLeafletMapProps<Datum>) => JSX.Element | null);
11
+ export declare const VisLeafletMapSelectors: typeof import("@unovis/ts/lib/components/leaflet-map/style");
12
+ export declare const VisLeafletMap: (<Datum extends GenericDataRecord>(props: VisLeafletMapProps<Datum>) => JSX.Element | null);
@@ -3,11 +3,11 @@ import { LeafletMap } from '@unovis/ts';
3
3
  import { arePropsEqual } from '../../utils/react.js';
4
4
 
5
5
  const VisLeafletMapSelectors = LeafletMap.selectors;
6
- function VisLeafletMapFC(props, ref) {
7
- const container = useRef(null);
6
+ function VisLeafletMapFC(props, fRef) {
7
+ const ref = useRef(null);
8
8
  const [component, setComponent] = useState();
9
9
  useEffect(() => {
10
- const c = new LeafletMap(container.current, props, props.data);
10
+ const c = new LeafletMap(ref.current, props, props.data);
11
11
  setComponent(c);
12
12
  return () => c === null || c === void 0 ? void 0 : c.destroy();
13
13
  }, []);
@@ -16,10 +16,10 @@ function VisLeafletMapFC(props, ref) {
16
16
  component === null || component === void 0 ? void 0 : component.setData(props.data);
17
17
  component === null || component === void 0 ? void 0 : component.setConfig(props);
18
18
  });
19
- useImperativeHandle(ref, () => ({ get component() { return component; } }), [component]);
20
- return React.createElement("div", { ref: container, className: props.className });
19
+ useImperativeHandle(fRef, () => ({ get component() { return component; } }), []);
20
+ return React.createElement("div", { className: props.className, ref: ref });
21
21
  }
22
22
  const VisLeafletMap = React.memo(React.forwardRef(VisLeafletMapFC), arePropsEqual);
23
23
 
24
- export { VisLeafletMap, VisLeafletMapFC, VisLeafletMapSelectors };
24
+ export { VisLeafletMap, VisLeafletMapSelectors };
25
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-map/index.tsx"],"sourcesContent":["import React, { ForwardedRef, Ref, useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { LeafletMap, LeafletMapConfigInterface } from '@unovis/ts'\nimport { arePropsEqual } from '../../utils/react'\n\nexport const VisLeafletMapSelectors = LeafletMap.selectors\n\nexport type VisLeafletMapProps<Datum extends Record<string, unknown>> = LeafletMapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisLeafletMapRef<Datum>>;\n className?: string;\n}\n\nexport type VisLeafletMapRef<Datum extends Record<string, unknown>> = {\n component: LeafletMap<Datum> | undefined;\n}\n\nexport function VisLeafletMapFC<Datum extends Record<string, unknown>> (props: VisLeafletMapProps<Datum>, ref: ForwardedRef<VisLeafletMapRef<Datum>>): JSX.Element {\n const container = useRef<HTMLDivElement>(null)\n const [component, setComponent] = useState<LeafletMap<Datum>>()\n\n // On Mount\n useEffect(() => {\n const c = new LeafletMap(container.current as HTMLDivElement, props, props.data)\n setComponent(c)\n\n return () => c?.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n if (props.data) component?.setData(props.data)\n\n component?.setConfig(props)\n })\n\n useImperativeHandle(ref, () => ({ get component () { return component } }), [component])\n return <div ref={container} className={props.className} />\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 VisLeafletMap: (<Datum extends Record<string, unknown>>(props: VisLeafletMapProps<Datum>) => JSX.Element | null) =\n React.memo(React.forwardRef(VisLeafletMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAIa,MAAA,sBAAsB,GAAG,UAAU,CAAC,UAAS;AAY1C,SAAA,eAAe,CAAyC,KAAgC,EAAE,GAA0C,EAAA;AAClJ,IAAA,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAC9C,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAqB,CAAA;IAG/D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,SAAS,CAAC,OAAyB,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QAChF,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,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAE9C,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,GAAG,EAAE,OAAO,EAAE,IAAI,SAAS,GAAA,EAAM,OAAO,SAAS,CAAA,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IACxF,OAAO,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAA,CAAI,CAAA;AAC5D,CAAC;AAIY,MAAA,aAAa,GACxB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,aAAa;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/html-components/leaflet-map/index.tsx"],"sourcesContent":["// !!! This code was automatically generated. You should not change it !!!\nimport React, { ForwardedRef, Ref, useImperativeHandle, useEffect, useRef, useState } from 'react'\nimport { LeafletMap, LeafletMapConfigInterface, GenericDataRecord } from '@unovis/ts'\n\n// Utils\nimport { arePropsEqual } from 'src/utils/react'\n\nexport type VisLeafletMapRef<Datum extends GenericDataRecord> = {\n component?: LeafletMap<Datum>;\n}\n\nexport type VisLeafletMapProps<Datum extends GenericDataRecord> = LeafletMapConfigInterface<Datum> & {\n data?: Datum[];\n ref?: Ref<VisLeafletMapRef<Datum>>;\n className?: string;\n}\n\nexport const VisLeafletMapSelectors = LeafletMap.selectors\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nfunction VisLeafletMapFC<Datum extends GenericDataRecord> (props: VisLeafletMapProps<Datum>, fRef: ForwardedRef<VisLeafletMapRef<Datum>>): JSX.Element {\n const ref = useRef<HTMLDivElement>(null)\n const [component, setComponent] = useState<LeafletMap<Datum>>()\n\n // On Mount\n useEffect(() => {\n const c = new LeafletMap<Datum>(ref.current as HTMLDivElement, props, props.data)\n setComponent(c)\n\n return () => c?.destroy()\n }, [])\n\n // On Props Update\n useEffect(() => {\n if (props.data) component?.setData(props.data)\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 VisLeafletMap: (<Datum extends GenericDataRecord>(props: VisLeafletMapProps<Datum>) => JSX.Element | null) = React.memo(React.forwardRef(VisLeafletMapFC), arePropsEqual)\n"],"names":[],"mappings":";;;;AAiBa,MAAA,sBAAsB,GAAG,UAAU,CAAC,UAAS;AAG1D,SAAS,eAAe,CAAmC,KAAgC,EAAE,IAA2C,EAAA;AACtI,IAAA,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IACxC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,EAAqB,CAAA;IAG/D,SAAS,CAAC,MAAK;AACb,QAAA,MAAM,CAAC,GAAG,IAAI,UAAU,CAAQ,GAAG,CAAC,OAAyB,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACjF,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,IAAI,KAAK,CAAC,IAAI;YAAE,SAAS,KAAA,IAAA,IAAT,SAAS,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAT,SAAS,CAAE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAC9C,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,aAAa,GAAgG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,aAAa;;;;"}
package/index.js CHANGED
@@ -18,9 +18,9 @@ export { VisTooltip, VisTooltipSelectors } from './components/tooltip/index.js';
18
18
  export { VisTimeline, VisTimelineSelectors } from './components/timeline/index.js';
19
19
  export { VisTopoJSONMap, VisTopoJSONMapSelectors } from './components/topojson-map/index.js';
20
20
  export { VisXYLabels, VisXYLabelsSelectors } from './components/xy-labels/index.js';
21
- export { VisAnnotations } from './components/annotations/index.js';
21
+ export { VisAnnotations, VisAnnotationsSelectors } from './components/annotations/index.js';
22
22
  export { VisBulletLegend, VisBulletLegendSelectors } from './html-components/bullet-legend/index.js';
23
- export { VisLeafletMap, VisLeafletMapFC, VisLeafletMapSelectors } from './html-components/leaflet-map/index.js';
24
- export { VisLeafletFlowMap, VisLeafletFlowMapFC, VisLeafletFlowMapSelectors } from './html-components/leaflet-flow-map/index.js';
23
+ export { VisLeafletMap, VisLeafletMapSelectors } from './html-components/leaflet-map/index.js';
24
+ export { VisLeafletFlowMap, VisLeafletFlowMapSelectors } from './html-components/leaflet-flow-map/index.js';
25
25
  export { VisTimeSeries } from './composites/time-series/index.js';
26
26
  //# sourceMappingURL=index.js.map
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.1-beta.0",
4
+ "version": "1.4.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.1-beta.0",
38
+ "@unovis/ts": "1.4.1",
39
39
  "react": ">=16.8.0 || ^17 || ^18",
40
40
  "react-dom": ">=16.8.0 || ^17 || ^18"
41
41
  },