armtek-uikit-react 1.0.104 → 1.0.105

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/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.104","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
1
+ {"name":"armtek-uikit-react","version":"1.0.105","description":"Armtek UIKit for React","repository":{"type":"git","url":"ssh://git@gl.corp:10022/int/uikit/uikit_react.git"},"author":"","license":"ISC","dependencies":{"build":"^0.1.4","clsx":"^2.0.0","rc-slider":"^10.2.1","react":"*","react-datepicker":"^4.16.0","react-dom":"*","react-transition-group":"^4.4.5"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
@@ -3,6 +3,10 @@ export type PopperBaseProps = {
3
3
  children: ReactNode;
4
4
  anchorEl: Element;
5
5
  open?: boolean;
6
+ anchorPosition?: {
7
+ x: number;
8
+ y: number;
9
+ };
6
10
  placement?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
7
11
  };
8
12
  export declare const PopperBase: (props: PopperBaseProps) => import("react/jsx-runtime").JSX.Element;
@@ -9,18 +9,33 @@ export const PopperBase = props => {
9
9
  anchorEl,
10
10
  children,
11
11
  placement,
12
+ anchorPosition,
12
13
  open
13
14
  } = props;
14
15
  const tooltipRef = useRef(null);
15
16
  useEffect(() => {
16
- const popper = createPopper(anchorEl, tooltipRef.current, {
17
- placement: placement,
18
- modifiers: [{
19
- name: 'offset',
17
+ let modifiers = [{
18
+ name: 'offset',
19
+ options: {
20
+ offset: [0, 5]
21
+ }
22
+ }];
23
+ if (anchorPosition) {
24
+ modifiers.push({
25
+ name: 'computeStyles',
20
26
  options: {
21
- offset: [0, 5]
27
+ gpuAcceleration: false,
28
+ // true by default
29
+ roundOffsets: () => ({
30
+ x: anchorPosition.x,
31
+ y: anchorPosition.y
32
+ })
22
33
  }
23
- }]
34
+ });
35
+ }
36
+ const popper = createPopper(anchorEl, tooltipRef.current, {
37
+ placement: placement,
38
+ modifiers: modifiers
24
39
  });
25
40
  return () => {
26
41
  popper.destroy();