@alifd/chat 0.1.16 → 0.2.0-beta.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.
Files changed (65) hide show
  1. package/es/card/view/collapsable.d.ts +1 -1
  2. package/es/card-loading/index.d.ts +11 -0
  3. package/es/card-loading/index.js +18 -0
  4. package/es/card-loading/main.scss +5 -0
  5. package/es/card-loading/style.d.ts +2 -0
  6. package/es/card-loading/style.js +2 -0
  7. package/es/card-loading/types.d.ts +10 -0
  8. package/es/card-loading/types.js +1 -0
  9. package/es/feedback/types.d.ts +13 -0
  10. package/es/float-button/hooks/useAutoHide.d.ts +0 -1
  11. package/es/float-button/hooks/useDragable.d.ts +0 -1
  12. package/es/float-button/index.d.ts +0 -1
  13. package/es/index.d.ts +2 -0
  14. package/es/index.js +3 -1
  15. package/es/list/index.d.ts +8 -0
  16. package/es/list/index.js +8 -0
  17. package/es/list/style.d.ts +1 -0
  18. package/es/list/style.js +1 -0
  19. package/es/list/types.d.ts +93 -0
  20. package/es/list/types.js +1 -0
  21. package/es/message/index.d.ts +8 -8
  22. package/es/person-picker/index.d.ts +90 -90
  23. package/es/person-picker/index.js +2 -2
  24. package/es/tag/index.d.ts +18 -18
  25. package/lib/card/view/card.js +2 -3
  26. package/lib/card/view/collapsable.d.ts +1 -1
  27. package/lib/card-loading/index.d.ts +11 -0
  28. package/lib/card-loading/index.js +21 -0
  29. package/lib/card-loading/main.scss +5 -0
  30. package/lib/card-loading/style.d.ts +2 -0
  31. package/lib/card-loading/style.js +4 -0
  32. package/lib/card-loading/types.d.ts +10 -0
  33. package/lib/card-loading/types.js +2 -0
  34. package/lib/feedback/types.d.ts +13 -0
  35. package/lib/float-button/hooks/useAutoAlign.js +1 -2
  36. package/lib/float-button/hooks/useAutoHide.d.ts +0 -1
  37. package/lib/float-button/hooks/useAutoHide.js +1 -2
  38. package/lib/float-button/hooks/useDragable.d.ts +0 -1
  39. package/lib/float-button/hooks/useDragable.js +1 -2
  40. package/lib/float-button/hooks/useNestleEdge.js +1 -2
  41. package/lib/float-button/hooks/useTriggerType.js +1 -2
  42. package/lib/float-button/index.d.ts +0 -1
  43. package/lib/float-button/util.js +4 -5
  44. package/lib/float-button/view/balloon.js +1 -2
  45. package/lib/float-button/view/drawer.js +1 -2
  46. package/lib/float-button/view/inner-drawer.js +1 -2
  47. package/lib/index.d.ts +2 -0
  48. package/lib/index.js +21 -19
  49. package/lib/list/index.d.ts +8 -0
  50. package/lib/list/index.js +12 -0
  51. package/lib/list/style.d.ts +1 -0
  52. package/lib/list/style.js +3 -0
  53. package/lib/list/types.d.ts +93 -0
  54. package/lib/list/types.js +2 -0
  55. package/lib/message/index.d.ts +8 -8
  56. package/lib/person-picker/index.d.ts +90 -90
  57. package/lib/person-picker/index.js +2 -2
  58. package/lib/tag/index.d.ts +18 -18
  59. package/lib/utils/common.js +1 -2
  60. package/lib/utils/dingtalk.js +3 -4
  61. package/lib/utils/func.js +2 -3
  62. package/lib/utils/hooks/useControlable.js +1 -2
  63. package/lib/utils/hooks/useDebounce.js +1 -2
  64. package/lib/utils/hooks/useThrottle.js +1 -2
  65. package/package.json +25 -1
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { CollapsableCardProps } from '../types';
3
- declare function CollapsableCard({ components, visible, defaultVisible, onVisibleChange, triggerType, mode, renderContent, ...props }: CollapsableCardProps): React.JSX.Element;
3
+ declare function CollapsableCard({ components, visible: _v, defaultVisible: _dv, onVisibleChange: _onVC, triggerType, mode, renderContent, ...props }: CollapsableCardProps): React.JSX.Element;
4
4
  declare namespace CollapsableCard {
5
5
  var displayName: string;
6
6
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @component CardLoading
3
+ * @en CardLoading
4
+ * @type 通用 - General
5
+ * @when CardLoading
6
+ */
7
+ import React from 'react';
8
+ import type { CardLoadingRef, CardLoadingProps } from './types';
9
+ export * from './types';
10
+ declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<CardLoadingProps & React.RefAttributes<CardLoadingRef>, "key" | keyof CardLoadingProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, CardLoadingRef, {}>;
11
+ export default _default;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @component CardLoading
3
+ * @en CardLoading
4
+ * @type 通用 - General
5
+ * @when CardLoading
6
+ */
7
+ import React, { forwardRef } from 'react';
8
+ import { ConfigProvider } from '@alifd/next';
9
+ import cs from 'classnames';
10
+ import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
11
+ const CardLoading = forwardRef(({ className }, ref) => {
12
+ return (React.createElement("div", { className: cs(`${PREFIX_DEFAULT}card-loading`, className) }, "\u5361\u7247\u52A0\u8F7D\u4E2D"));
13
+ });
14
+ const CardLoadingWithSub = assignSubComponent(CardLoading, {
15
+ displayName: 'CardLoading',
16
+ });
17
+ export * from './types';
18
+ export default ConfigProvider.config(CardLoadingWithSub);
@@ -0,0 +1,5 @@
1
+ @import "../core/variables.scss";
2
+
3
+ .#{$prefix}card-loading {
4
+
5
+ }
@@ -0,0 +1,2 @@
1
+ import '@alifd/next/lib/button/style2';
2
+ import './main.scss';
@@ -0,0 +1,2 @@
1
+ import '@alifd/next/lib/button/style2';
2
+ import './main.scss';
@@ -0,0 +1,10 @@
1
+ import type * as React from 'react';
2
+ import { type CommonProps } from '@alifd/next';
3
+ export interface CardLoadingRef {
4
+ }
5
+ /**
6
+ * @api CardLoading
7
+ */
8
+ export interface CardLoadingProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
9
+ className?: string;
10
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -8,6 +8,15 @@ export type FeedbackStatus = 'good' | 'stale' | 'bad';
8
8
  * @api
9
9
  */
10
10
  export type FeedbackActiveStatus = 'good' | 'bad';
11
+ export interface TranslateInfo {
12
+ targetLang?: string;
13
+ icon?: string;
14
+ isTranslate?: boolean;
15
+ }
16
+ export interface TranslateConfig {
17
+ needTranslate?: boolean;
18
+ translateInfo?: TranslateInfo;
19
+ }
11
20
  /**
12
21
  * @api Feedback
13
22
  */
@@ -47,6 +56,10 @@ export interface FeedbackProps extends HTMLAttributesWeek {
47
56
  * @defaultValue 'hoz'
48
57
  */
49
58
  direction?: 'ver' | 'hoz';
59
+ /**
60
+ * 底部左侧插槽
61
+ */
62
+ renderLeftSlot?: () => ReactNode;
50
63
  }
51
64
  /**
52
65
  * @api Feedback.Good
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Edge, Position } from '../types';
3
2
  /**
4
3
  * 自动隐藏悬浮球逻辑
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { DragableOption } from '../types';
3
2
  /**
4
3
  * 拖拽逻辑
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const FloatButtonWithSub: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").FloatButtonProps & import("react").RefAttributes<import("./types").FloatButtonRef>, "key" | keyof import("./types").FloatButtonProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("./types").FloatButtonRef, {}> & {
3
2
  Backtop: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").BacktopProps & import("react").RefAttributes<import("./types").BacktopRef>, "key" | keyof import("./types").BacktopProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("./types").BacktopRef, {}>;
4
3
  Drawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
package/es/index.d.ts CHANGED
@@ -12,4 +12,6 @@ export { default as PersonPicker } from './person-picker';
12
12
  export { default as Message } from './message';
13
13
  export { default as Icon } from './icon';
14
14
  export { default as Balloon } from './balloon';
15
+ export { default as List } from './list';
16
+ export { default as CardLoading } from './card-loading';
15
17
  export declare const version: string;
package/es/index.js CHANGED
@@ -12,4 +12,6 @@ export { default as PersonPicker } from './person-picker';
12
12
  export { default as Message } from './message';
13
13
  export { default as Icon } from './icon';
14
14
  export { default as Balloon } from './balloon';
15
- export const version = '0.1.16';
15
+ export { default as List } from './list';
16
+ export { default as CardLoading } from './card-loading';
17
+ export const version = '0.2.0-beta.1';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @component 列表
3
+ * @en List
4
+ * * @remarks 同 Next List,列表组件。- Same as Next List component.
5
+ * @type 通用 - General
6
+ * @when 最基础的列表展示,可承载文字、列表、图片、段落。
7
+ */
8
+ export { List as default } from '@alifd/next';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @component 列表
3
+ * @en List
4
+ * * @remarks 同 Next List,列表组件。- Same as Next List component.
5
+ * @type 通用 - General
6
+ * @when 最基础的列表展示,可承载文字、列表、图片、段落。
7
+ */
8
+ export { List as default } from '@alifd/next';
@@ -0,0 +1 @@
1
+ import '@alifd/next/lib/list/style2';
@@ -0,0 +1 @@
1
+ import '@alifd/next/lib/list/style2';
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ import type { ReactElement, ReactNode } from 'react';
3
+ import type { LoadingProps } from '@alifd/next/types/loading';
4
+ import { type CommonProps } from '@alifd/next';
5
+ type HTMLAttributesWeak = Omit<React.HTMLAttributes<HTMLElement>, 'title'>;
6
+ /**
7
+ * @api List
8
+ */
9
+ export interface ListProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
10
+ /**
11
+ * 列表头部
12
+ * @en List header
13
+ */
14
+ header?: ReactNode;
15
+ /**
16
+ * 列表尾部
17
+ * @en List footer
18
+ */
19
+ footer?: ReactNode;
20
+ /**
21
+ * 列表尺寸
22
+ * @en List size
23
+ * @defaultValue 'medium'
24
+ */
25
+ size?: 'medium' | 'small';
26
+ /**
27
+ * 是否显示分割线
28
+ * @en Whether to show the divider
29
+ * @defaultValue true
30
+ */
31
+ divider?: boolean;
32
+ /**
33
+ * children
34
+ */
35
+ children?: ReactNode;
36
+ /**
37
+ * 列表项数据源
38
+ * @en List item data source
39
+ */
40
+ dataSource?: unknown[];
41
+ /**
42
+ * 当使用 dataSource 时,可以用 renderItem 自定义渲染列表项
43
+ * @param current - 当前遍历的项 - The current item
44
+ * @param index - 当前遍历的项的索引 - The index of the current item
45
+ * @returns - 自定义渲染的 ReactElement - The ReactElement be customized
46
+ */
47
+ renderItem?: (current: unknown, index: number) => ReactElement;
48
+ /**
49
+ * loading 状态控制
50
+ * @en Loading state control
51
+ * @defaultValue false
52
+ */
53
+ loading?: boolean;
54
+ /**
55
+ * 自定义 Loading 组件
56
+ * @en Custom Loading component
57
+ * @param props - 透传 props - Pass through props
58
+ * @returns - 自定义的 Loading 组件 - Custom Loading component
59
+ * @remarks 请务必透传 props, 使用方式:loadingComponent=\{props =\> \<Loading \{...props\}/\>\}
60
+ */
61
+ loadingComponent?: (props: LoadingProps) => ReactElement;
62
+ /**
63
+ * 当列表为空时显示的内容
64
+ * @en The content displayed when the list is empty
65
+ */
66
+ emptyContent?: ReactNode;
67
+ }
68
+ /**
69
+ * @api List.Item
70
+ */
71
+ export interface ListItemProps extends HTMLAttributesWeak, CommonProps {
72
+ /**
73
+ * 列表元素的标题
74
+ * @en The title of the list item
75
+ */
76
+ title?: ReactNode;
77
+ /**
78
+ * 列表元素的描述内容
79
+ * @en The description of the list item
80
+ */
81
+ description?: ReactNode;
82
+ /**
83
+ * 列表元素的头像 / 图标 / 图片内容
84
+ * @en The avatar / icon / image content of the list item
85
+ */
86
+ media?: ReactNode;
87
+ /**
88
+ * 额外内容
89
+ * @en Extra content
90
+ */
91
+ extra?: ReactNode;
92
+ }
93
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -13,20 +13,20 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
13
13
  visible: boolean | undefined;
14
14
  };
15
15
  onClose: () => void;
16
- render(): React.JSX.Element | null;
16
+ render(): import("react").JSX.Element | null;
17
17
  context: any;
18
18
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/message").MessageProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
19
19
  forceUpdate(callback?: (() => void) | undefined): void;
20
20
  readonly props: Readonly<import("@alifd/next/types/message").MessageProps> & Readonly<{
21
- children?: React.ReactNode;
21
+ children?: import("react").ReactNode;
22
22
  }>;
23
23
  refs: {
24
- [key: string]: React.ReactInstance;
24
+ [key: string]: import("react").ReactInstance;
25
25
  };
26
26
  componentDidMount?(): void;
27
27
  shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/message").MessageProps>, nextState: Readonly<{}>, nextContext: any): boolean;
28
28
  componentWillUnmount?(): void;
29
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
29
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
30
30
  getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/message").MessageProps>, prevState: Readonly<{}>): any;
31
31
  componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/message").MessageProps>, prevState: Readonly<{}>, snapshot?: any): void;
32
32
  componentWillMount?(): void;
@@ -40,20 +40,20 @@ declare const _default: import("@alifd/next/types/config-provider/types").Config
40
40
  visible: boolean | undefined;
41
41
  };
42
42
  onClose: () => void;
43
- render(): React.JSX.Element | null;
43
+ render(): import("react").JSX.Element | null;
44
44
  context: any;
45
45
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/message").MessageProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
46
46
  forceUpdate(callback?: (() => void) | undefined): void;
47
47
  readonly props: Readonly<import("@alifd/next/types/message").MessageProps> & Readonly<{
48
- children?: React.ReactNode;
48
+ children?: import("react").ReactNode;
49
49
  }>;
50
50
  refs: {
51
- [key: string]: React.ReactInstance;
51
+ [key: string]: import("react").ReactInstance;
52
52
  };
53
53
  componentDidMount?(): void;
54
54
  shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/message").MessageProps>, nextState: Readonly<{}>, nextContext: any): boolean;
55
55
  componentWillUnmount?(): void;
56
- componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
56
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
57
57
  getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/message").MessageProps>, prevState: Readonly<{}>): any;
58
58
  componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/message").MessageProps>, prevState: Readonly<{}>, snapshot?: any): void;
59
59
  componentWillMount?(): void;