@antscorp/antsomi-ui 1.3.3-beta.50 → 1.3.3-beta.52

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.
@@ -1,5 +1,6 @@
1
- /// <reference types="react" />
2
- export declare const Empty: import("react").FC<import("antd").EmptyProps> & {
3
- PRESENTED_IMAGE_DEFAULT: import("react").ReactNode;
4
- PRESENTED_IMAGE_SIMPLE: import("react").ReactNode;
5
- };
1
+ import React from 'react';
2
+ import { EmptyProps } from 'antd';
3
+ export interface IEmpty extends EmptyProps {
4
+ loading?: boolean;
5
+ }
6
+ export declare const Empty: React.FC<IEmpty>;
@@ -1,2 +1,8 @@
1
+ import React from 'react';
1
2
  import { Empty as AntdEmpty } from 'antd';
2
- export const Empty = AntdEmpty;
3
+ import { Spin } from '../Spin';
4
+ import { LoadingOutlined } from '@ant-design/icons';
5
+ export const Empty = props => {
6
+ const { loading, description } = props;
7
+ return (React.createElement(AntdEmpty, Object.assign({}, props, { description: loading ? (React.createElement(Spin, { indicator: React.createElement(LoadingOutlined, { style: { fontSize: 24 }, spin: true }) })) : (description) })));
8
+ };
@@ -1,5 +1,5 @@
1
1
  var _a;
2
- import { THEME } from 'src/constants';
2
+ import { THEME } from '@antscorp/antsomi-ui/es/constants';
3
3
  import styled from 'styled-components';
4
4
  export const StyledGeneralAccessRoot = styled.div `
5
5
  display: flex;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import React, { useEffect, useState } from 'react';
11
11
  import { Avatar, Select } from 'antd';
12
- import { useDebounce } from 'use-debounce';
12
+ import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounceV2';
13
13
  import { StyledSearchUserRoot, StyledSelectItem } from './styled';
14
14
  import { isEmail } from '@antscorp/antsomi-ui/es/utils';
15
15
  import { useShareAccess } from '../../hooks';
@@ -23,7 +23,7 @@ export const SearchUser = (props) => {
23
23
  const [users, setUsers] = useState([]);
24
24
  const [isFetching, setIsFetching] = useState(false);
25
25
  const [searchTerm, setSearchTerm] = useState('');
26
- const [debounceSearchTerm] = useDebounce(searchTerm, 700);
26
+ const debounceSearchTerm = useDebounce(searchTerm, 700);
27
27
  useEffect(() => {
28
28
  if (!isEmail(debounceSearchTerm) || !getUserInfo)
29
29
  return;
@@ -18,12 +18,13 @@ export { IconSelection } from './IconSelection';
18
18
  export { IconSelectionRenderer } from './IconSelection/components/Icon';
19
19
  export { AlignSetting } from './AlignSetting';
20
20
  export { EdgeSetting } from './EdgeSetting';
21
+ export { ShareAccess } from './ShareAccess';
22
+ export { Collapse } from './Collapse';
21
23
  export { TreeSelect } from './TreeSelect';
22
24
  export { Result } from './Result';
23
25
  export { Card } from './Card';
24
26
  export { InputNumberWithUnit } from './InputNumberWithUnit';
25
27
  export { GradientSetting } from './GradientSetting';
26
- export { Collapse } from './Collapse';
27
28
  export { SettingWrapperPopover } from './SettingWrapperPopover';
28
29
  export { FontWeightSelect } from './FontWeightSelect';
29
30
  export { FontFamilySelect } from './FontFamilySelect';
@@ -35,7 +36,6 @@ export { ResizeGrid } from './ResizeGrid';
35
36
  export * from './RichMenu';
36
37
  export { ModalV2 } from './ModalV2';
37
38
  export * from './PreviewModal';
38
- export { ShareAccess } from './ShareAccess';
39
39
  export * from './Drawer';
40
40
  export type { AdvancedPickerProps, TAdvancedPickerOption, TAdvancedRangePickerTimeRange, } from './DatePicker';
41
41
  export type { ColorPickerProps } from './ColorPicker';
@@ -18,12 +18,13 @@ export { IconSelection } from './IconSelection';
18
18
  export { IconSelectionRenderer } from './IconSelection/components/Icon';
19
19
  export { AlignSetting } from './AlignSetting';
20
20
  export { EdgeSetting } from './EdgeSetting';
21
+ export { ShareAccess } from './ShareAccess';
22
+ export { Collapse } from './Collapse';
21
23
  export { TreeSelect } from './TreeSelect';
22
24
  export { Result } from './Result';
23
25
  export { Card } from './Card';
24
26
  export { InputNumberWithUnit } from './InputNumberWithUnit';
25
27
  export { GradientSetting } from './GradientSetting';
26
- export { Collapse } from './Collapse';
27
28
  export { SettingWrapperPopover } from './SettingWrapperPopover';
28
29
  export { FontWeightSelect } from './FontWeightSelect';
29
30
  export { FontFamilySelect } from './FontFamilySelect';
@@ -35,5 +36,4 @@ export { ResizeGrid } from './ResizeGrid';
35
36
  export * from './RichMenu';
36
37
  export { ModalV2 } from './ModalV2';
37
38
  export * from './PreviewModal';
38
- export { ShareAccess } from './ShareAccess';
39
39
  export * from './Drawer';
@@ -0,0 +1 @@
1
+ export declare function useDebounceCallback<T extends (...args: any[]) => any>(callback: T, delay?: number): T;
@@ -0,0 +1,5 @@
1
+ import { useDebounce } from './useDebounceV2';
2
+ export function useDebounceCallback(callback, delay = 500) {
3
+ const debouncedCallback = useDebounce(callback, delay);
4
+ return debouncedCallback;
5
+ }
@@ -0,0 +1 @@
1
+ export declare function useDebounce<T>(value: T, delay?: number): T;
@@ -0,0 +1,11 @@
1
+ import { useEffect, useState } from 'react';
2
+ export function useDebounce(value, delay) {
3
+ const [debouncedValue, setDebouncedValue] = useState(value);
4
+ useEffect(() => {
5
+ const timer = setTimeout(() => setDebouncedValue(value), delay || 500);
6
+ return () => {
7
+ clearTimeout(timer);
8
+ };
9
+ }, [value, delay]);
10
+ return debouncedValue;
11
+ }
@@ -47,10 +47,10 @@ export declare function getEntriesV2(res: any, def: any): {
47
47
  messageAPI?: undefined;
48
48
  };
49
49
  export declare const getNumberFromString: (str: string) => number;
50
+ export declare const isEmail: (email: string) => boolean;
50
51
  /**
51
52
  * Maps a number to its corresponding ordinal text representation.
52
53
  * @param {number} num - The number to be mapped.
53
54
  * @return {string} The ordinal text representation of the number.
54
55
  */
55
56
  export declare function mapNumberToOrdinalText(num: number): string;
56
- export declare const isEmail: (email: string) => boolean;
@@ -336,6 +336,10 @@ export const getNumberFromString = (str) => {
336
336
  return 0;
337
337
  }
338
338
  };
339
+ export const isEmail = (email) => {
340
+ const emailRegex = /^[A-Za-z0-9_!#$%&'*+\/=?`{|}~^.-]+@[A-Za-z0-9.-]+$/gm;
341
+ return emailRegex.test(email);
342
+ };
339
343
  /**
340
344
  * Maps a number to its corresponding ordinal text representation.
341
345
  * @param {number} num - The number to be mapped.
@@ -369,7 +373,3 @@ export function mapNumberToOrdinalText(num) {
369
373
  return '';
370
374
  }
371
375
  }
372
- export const isEmail = (email) => {
373
- const emailRegex = /^[A-Za-z0-9_!#$%&'*+\/=?`{|}~^.-]+@[A-Za-z0-9.-]+$/gm;
374
- return emailRegex.test(email);
375
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.3-beta.50",
3
+ "version": "1.3.3-beta.52",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -75,9 +75,9 @@
75
75
  "html-entities": "^2.0.2",
76
76
  "html-to-image": "^1.11.11",
77
77
  "html2canvas": "^1.4.1",
78
+ "immer": "^10.0.3",
78
79
  "i18next": "21.6.16",
79
80
  "i18next-browser-languagedetector": "6.1.2",
80
- "immer": "^10.0.3",
81
81
  "lodash": "^4.17.21",
82
82
  "moment": "2.29.2",
83
83
  "qs": "6.10.3",
@@ -88,12 +88,12 @@
88
88
  "rehype-highlight": "^6.0.0",
89
89
  "remark-gfm": "^3.0.1",
90
90
  "ts-dedent": "^2.2.0",
91
- "tui-image-editor": "^3.15.3",
92
- "use-debounce": "^10.0.0"
91
+ "tui-image-editor": "^3.15.3"
93
92
  },
94
93
  "devDependencies": {
95
94
  "@ant-design/cssinjs": "^1.6.2",
96
95
  "@antscorp/eslint-config-antsomi": "1.0.4",
96
+ "@antscorp/icons": "0.27.4",
97
97
  "@babel/cli": "^7.23.4",
98
98
  "@babel/core": "^7.21.3",
99
99
  "@babel/plugin-proposal-class-properties": "^7.18.6",