armtek-uikit-react 1.0.46 → 1.0.49

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.
@@ -12,7 +12,7 @@
12
12
  font-family: inherit;
13
13
  font-size: 16px;
14
14
  height: $size-elarge;
15
- display: flex;
15
+ display: inline-flex;
16
16
  align-items: center;
17
17
  justify-content: center;
18
18
  &:disabled{
@@ -1,4 +1,4 @@
1
- 'use client';
1
+ "use client";
2
2
 
3
3
  import * as React from 'react';
4
4
 
@@ -1,16 +1,14 @@
1
- 'use client';
1
+ "use client";
2
2
 
3
3
  import * as React from 'react';
4
4
  import useEnhancedEffect from "./useEnhancedEffect";
5
- function useEventCallback<Fn extends (...args: any[]) => any = (...args: unknown[]) => unknown>(fn: Fn): Fn;
6
- function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
7
- function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return {
5
+ function useEventCallback(fn) {
8
6
  const ref = React.useRef(fn);
9
7
  useEnhancedEffect(() => {
10
8
  ref.current = fn;
11
9
  });
12
- return React.useRef((...args: Args) =>
10
+ return React.useRef((...args) =>
13
11
  // @ts-expect-error hide `this`
14
- (0, ref.current!)(...args)).current;
12
+ (0, ref.current)(...args)).current;
15
13
  }
16
14
  export default useEventCallback;
@@ -1,9 +1,9 @@
1
- 'use client';
1
+ "use client";
2
2
 
3
3
  import { useRef } from 'react';
4
4
  const UNINITIALIZED = {};
5
- export default function useLazyRef<T, U>(init: (arg?: U) => T, initArg?: U) {
6
- const ref = useRef(((UNINITIALIZED as unknown) as T));
5
+ export default function useLazyRef(init, initArg) {
6
+ const ref = useRef(UNINITIALIZED);
7
7
  if (ref.current === UNINITIALIZED) {
8
8
  ref.current = init(initArg);
9
9
  }
@@ -1,32 +1,33 @@
1
- 'use client';
1
+ "use client";
2
2
 
3
3
  import useLazyRef from "./useLazyRef";
4
4
  import { useEffect } from 'react';
5
5
  export class Timeout {
6
+ constructor() {
7
+ this.currentId = 0;
8
+ this.clear = () => {
9
+ if (this.currentId !== 0) {
10
+ clearTimeout(this.currentId);
11
+ this.currentId = 0;
12
+ }
13
+ };
14
+ this.disposeEffect = () => {
15
+ return this.clear;
16
+ };
17
+ }
6
18
  static create() {
7
19
  return new Timeout();
8
20
  }
9
- currentId: number = 0;
10
-
11
21
  /**
12
22
  * Executes `fn` after `delay`, clearing any previously scheduled call.
13
23
  */
14
- start(delay: number, fn: Function) {
24
+ start(delay, fn) {
15
25
  this.clear();
16
- this.currentId = ((setTimeout(() => {
26
+ this.currentId = setTimeout(() => {
17
27
  this.currentId = 0;
18
28
  fn();
19
- }, delay) as unknown) as number);
29
+ }, delay);
20
30
  }
21
- clear = () => {
22
- if (this.currentId !== 0) {
23
- clearTimeout(this.currentId);
24
- this.currentId = 0;
25
- }
26
- };
27
- disposeEffect = () => {
28
- return this.clear;
29
- };
30
31
  }
31
32
  export default function useTimeout() {
32
33
  const timeout = useLazyRef(Timeout.create).current;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"armtek-uikit-react","version":"1.0.46","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":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
1
+ {"name":"armtek-uikit-react","version":"1.0.49","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":"*"},"peerDependencies":{"react":"*","react-dom":"*"},"scripts":{"pub":"npm version patch && npm publish"}}
@@ -28,7 +28,7 @@ function Tooltip(props) {
28
28
  let {
29
29
  text,
30
30
  children: childrenProp,
31
- placement
31
+ placement = 'top'
32
32
  } = props;
33
33
  const children = /*#__PURE__*/isValidElement(childrenProp) ? childrenProp : /*#__PURE__*/_jsx("span", {
34
34
  children: childrenProp