@antscorp/antsomi-ui 1.3.3-beta.11 → 1.3.3-beta.13

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.
Files changed (38) hide show
  1. package/es/components/atoms/SliderV2/index.d.ts +3 -2
  2. package/es/components/atoms/SliderV2/index.js +9 -11
  3. package/es/components/atoms/Spin/Spin.d.ts +1 -2
  4. package/es/components/icons/ArrowGrowIcon.d.ts +1 -2
  5. package/es/components/icons/AudioRecordIcon.d.ts +1 -2
  6. package/es/components/icons/BugIcon.d.ts +1 -2
  7. package/es/components/icons/CameraIcon.d.ts +1 -2
  8. package/es/components/icons/CaptureIcon.d.ts +1 -2
  9. package/es/components/icons/CheckSlimIcon.d.ts +1 -2
  10. package/es/components/icons/CloseIcon.d.ts +1 -2
  11. package/es/components/icons/CommentIcon.d.ts +1 -2
  12. package/es/components/icons/EventIcon.d.ts +1 -2
  13. package/es/components/icons/FreeDrawIcon.d.ts +1 -2
  14. package/es/components/icons/GPTIcon.d.ts +1 -2
  15. package/es/components/icons/GPTIconV2.d.ts +1 -2
  16. package/es/components/icons/GPTIconV3.d.ts +1 -2
  17. package/es/components/icons/HighlightIcon.d.ts +1 -2
  18. package/es/components/icons/IdeaIcon.d.ts +1 -2
  19. package/es/components/icons/InvisibleIcon.d.ts +1 -2
  20. package/es/components/icons/MuteIcon.d.ts +1 -2
  21. package/es/components/icons/OpenUrlIcon.d.ts +1 -2
  22. package/es/components/icons/PauseIcon.d.ts +1 -2
  23. package/es/components/icons/PlaneIcon.d.ts +1 -2
  24. package/es/components/icons/RequestIcon.d.ts +1 -2
  25. package/es/components/icons/StopRecordIcon.d.ts +1 -2
  26. package/es/components/icons/UserIcon.d.ts +1 -2
  27. package/es/components/icons/VerticalDotsIcon.d.ts +1 -2
  28. package/es/components/icons/WarningIcon.d.ts +1 -2
  29. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +1 -2
  30. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +1 -2
  31. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +1 -2
  32. package/es/components/molecules/Modal/styled.d.ts +1 -1
  33. package/es/components/molecules/Select/Test.d.ts +1 -2
  34. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +1 -1
  35. package/es/components/molecules/UploadImage/MediaIcon.d.ts +1 -2
  36. package/es/constants/storybook.d.ts +1 -2
  37. package/es/test.d.ts +1 -2
  38. package/package.json +1 -1
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { SliderRangeProps, SliderSingleProps } from 'antd/es/slider';
3
- export interface SliderProps extends SliderSingleProps {
3
+ export interface SliderProps {
4
+ defaultSliderTrack?: boolean;
4
5
  }
5
- export declare const SliderV2: React.FC<SliderProps | SliderRangeProps>;
6
+ export declare const SliderV2: React.FC<(SliderSingleProps & SliderProps) | (SliderRangeProps & SliderProps)>;
@@ -4,20 +4,18 @@ import React, { useState } from 'react';
4
4
  import { Slider as AntdSlider } from 'antd';
5
5
  // React.FC<SliderProps>
6
6
  export const SliderV2 = props => {
7
- const [value, setValue] = useState(0);
8
- // console.log('sliderRef:: ', sliderRef);
9
- // const min = props.min || 0;
10
- // const max = props.max || 100;
11
- const { min, max, onChange, styles, range } = props;
12
- if (min && max && min < 0 && max > 0 && !range) {
7
+ const { min, max, onChange, styles, range, value, defaultValue, marks, defaultSliderTrack } = props;
8
+ const [valueInternal, setValueInternal] = useState(defaultValue || min || 0);
9
+ if (min && max && min < 0 && max > 0 && !range && !defaultSliderTrack) {
13
10
  const sliderWidth = max - min;
14
- const leftTrackPosition = `${(Math.abs(value > 0 ? min : min - value) / sliderWidth) * 100}%`;
15
- const sliderTrackWidth = `${(Math.abs(value) / sliderWidth) * 100}%`;
16
- return (React.createElement(AntdSlider, Object.assign({ value: value, onChange: value => {
17
- setValue(value);
11
+ const calcValue = value || valueInternal;
12
+ const leftTrackPosition = `${(Math.abs(calcValue > 0 ? min : min - calcValue) / sliderWidth) * 100}%`;
13
+ const sliderTrackWidth = `${(Math.abs(calcValue) / sliderWidth) * 100}%`;
14
+ return (React.createElement(AntdSlider, Object.assign({ value: value || valueInternal, onChange: value => {
15
+ setValueInternal(value);
18
16
  if (onChange)
19
17
  onChange(value);
20
- }, styles: Object.assign({ track: Object.assign({ left: leftTrackPosition, width: sliderTrackWidth }, styles === null || styles === void 0 ? void 0 : styles.track) }, styles), marks: { 0: ' ' } }, props)));
18
+ }, styles: Object.assign({ track: Object.assign({ left: leftTrackPosition, width: sliderTrackWidth }, styles === null || styles === void 0 ? void 0 : styles.track) }, styles), marks: marks || { 0: ' ' } }, props)));
21
19
  }
22
20
  return React.createElement(AntdSlider, Object.assign({}, props));
23
21
  };
@@ -1,10 +1,9 @@
1
- import React from 'react';
2
1
  import { SpinProps as AntdSpinProps } from 'antd';
3
2
  export interface TSpinProps extends AntdSpinProps {
4
3
  indicatorSize?: number;
5
4
  children?: any;
6
5
  }
7
6
  export declare const Spin: {
8
- (props: TSpinProps): React.JSX.Element;
7
+ (props: TSpinProps): JSX.Element;
9
8
  defaultProps: {};
10
9
  };
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const ArrowGrowIcon: (props: any) => React.JSX.Element;
1
+ export declare const ArrowGrowIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const AudioRecordIcon: (props: any) => React.JSX.Element;
1
+ export declare const AudioRecordIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const BugIcon: (props: any) => React.JSX.Element;
1
+ export declare const BugIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const CameraIcon: (props: any) => React.JSX.Element;
1
+ export declare const CameraIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const CaptureIcon: (props: any) => React.JSX.Element;
1
+ export declare const CaptureIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const CheckSlimIcon: (props: any) => React.JSX.Element;
1
+ export declare const CheckSlimIcon: (props: any) => JSX.Element;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  export declare const CloseIcon: ({ ...props }: {
3
2
  [x: string]: any;
4
- }) => React.JSX.Element;
3
+ }) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const CommentIcon: (props: any) => React.JSX.Element;
1
+ export declare const CommentIcon: (props: any) => JSX.Element;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  export declare const EventIcon: ({ ...props }: {
3
2
  [x: string]: any;
4
- }) => React.JSX.Element;
3
+ }) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const FreeDrawIcon: (props: any) => React.JSX.Element;
1
+ export declare const FreeDrawIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const GPTIcon: () => React.JSX.Element;
1
+ export declare const GPTIcon: () => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const GPTIconV2: () => React.JSX.Element;
1
+ export declare const GPTIconV2: () => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const GPTIconV3: (props: any) => React.JSX.Element;
1
+ export declare const GPTIconV3: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const HighlightIcon: (props: any) => React.JSX.Element;
1
+ export declare const HighlightIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const IdeaIcon: (props: any) => React.JSX.Element;
1
+ export declare const IdeaIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const InvisibleIcon: (props: any) => React.JSX.Element;
1
+ export declare const InvisibleIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const MuteIcon: (props: any) => React.JSX.Element;
1
+ export declare const MuteIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const OpenUrlIcon: (props: any) => React.JSX.Element;
1
+ export declare const OpenUrlIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const PauseIcon: (props: any) => React.JSX.Element;
1
+ export declare const PauseIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const PlaneIcon: (props: any) => React.JSX.Element;
1
+ export declare const PlaneIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const RequestIcon: (props: any) => React.JSX.Element;
1
+ export declare const RequestIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const StopRecordIcon: (props: any) => React.JSX.Element;
1
+ export declare const StopRecordIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const UserIcon: (props: any) => React.JSX.Element;
1
+ export declare const UserIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const VerticalDotsIcon: (props: any) => React.JSX.Element;
1
+ export declare const VerticalDotsIcon: (props: any) => JSX.Element;
@@ -1,2 +1 @@
1
- import React from 'react';
2
- export declare const WarningIcon: (props: any) => React.JSX.Element;
1
+ export declare const WarningIcon: (props: any) => JSX.Element;
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  import { IImageEditorProps } from './types';
3
2
  declare const CaptureScreen: {
4
- (props: IImageEditorProps): React.JSX.Element;
3
+ (props: IImageEditorProps): JSX.Element;
5
4
  defaultProps: {
6
5
  isOpen: boolean;
7
6
  src: string;
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
1
  import { CommentBoxProps } from './types';
3
2
  declare const CommentBox: {
4
- (props: CommentBoxProps): React.JSX.Element;
3
+ (props: CommentBoxProps): JSX.Element;
5
4
  defaultProps: {
6
5
  info: {
7
6
  id: string;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { CursorProps } from './types';
3
- declare const Cursor: (props: CursorProps) => React.JSX.Element | null;
2
+ declare const Cursor: (props: CursorProps) => JSX.Element | null;
4
3
  export { Cursor };
@@ -10,6 +10,6 @@ export declare const StyledModal: import("styled-components").StyledComponent<im
10
10
  useModal: typeof import("antd/es/modal/useModal").default;
11
11
  destroyAll: () => void;
12
12
  config: typeof import("antd/es/modal/confirm").modalGlobalConfig;
13
- _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) => import("react").JSX.Element;
13
+ _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/modal/PurePanel").PurePanelProps) => React.JSX.Element;
14
14
  }, any, CustomModalProps, never>;
15
15
  export declare const WrapperSpin: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
- declare const SelectTest: () => React.JSX.Element;
1
+ declare const SelectTest: () => JSX.Element;
3
2
  export default SelectTest;
@@ -7,5 +7,5 @@ export declare const TreeSelect: (<ValueType = any, OptionType extends import("r
7
7
  SHOW_ALL: "SHOW_ALL";
8
8
  SHOW_PARENT: "SHOW_PARENT";
9
9
  SHOW_CHILD: "SHOW_CHILD";
10
- _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => import("react").JSX.Element;
10
+ _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => React.JSX.Element;
11
11
  };
@@ -1,3 +1,2 @@
1
- import React from 'react';
2
- declare const MediaIcon: (_props: any) => React.JSX.Element;
1
+ declare const MediaIcon: (_props: any) => JSX.Element;
3
2
  export default MediaIcon;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  export declare const TABLE_API_COLUMNS: ({
3
2
  title: string;
4
3
  dataIndex: string;
@@ -8,5 +7,5 @@ export declare const TABLE_API_COLUMNS: ({
8
7
  title: string;
9
8
  dataIndex: string;
10
9
  key: string;
11
- render: (text: any) => React.JSX.Element;
10
+ render: (text: any) => JSX.Element;
12
11
  })[];
package/es/test.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import '@antscorp/icons/main.css';
3
2
  export declare const BACKGROUND_COLOR_STYLE: {
4
3
  SOLID: {
@@ -11,4 +10,4 @@ export declare const BACKGROUND_COLOR_STYLE: {
11
10
  };
12
11
  };
13
12
  export declare const customColors: string[];
14
- export declare const App: () => React.JSX.Element;
13
+ export declare const App: () => JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.3-beta.11",
3
+ "version": "1.3.3-beta.13",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",