@alifd/chat 0.3.0-beta.5 → 0.3.0-beta.7

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/es/index.d.ts CHANGED
@@ -14,8 +14,9 @@ export { default as Icon } from './icon';
14
14
  export { default as Balloon } from './balloon';
15
15
  export { default as List } from './list';
16
16
  export { default as ImagePreview } from './image-preview';
17
- export { default as HtmlRenderer } from './html-render';
17
+ export { default as HtmlRender } from './html-render';
18
18
  export { default as Markdown } from './markdown';
19
19
  export { default as CardLoading } from './card-loading';
20
20
  export { default as Origin } from './origin';
21
+ export { default as Loading } from './loading';
21
22
  export declare const version: string;
package/es/index.js CHANGED
@@ -14,8 +14,9 @@ export { default as Icon } from './icon';
14
14
  export { default as Balloon } from './balloon';
15
15
  export { default as List } from './list';
16
16
  export { default as ImagePreview } from './image-preview';
17
- export { default as HtmlRenderer } from './html-render';
17
+ export { default as HtmlRender } from './html-render';
18
18
  export { default as Markdown } from './markdown';
19
19
  export { default as CardLoading } from './card-loading';
20
20
  export { default as Origin } from './origin';
21
- export const version = '0.3.0-beta.5';
21
+ export { default as Loading } from './loading';
22
+ export const version = '0.3.0-beta.7';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @component 加载
3
+ * @en Loading
4
+ * * @remarks 同 Next Loading- Same as Next Loading component.
5
+ * @type 通用 - General
6
+ * @when
7
+ */
8
+ import React from 'react';
9
+ import type { LoadingProps } from './types';
10
+ export * from './types';
11
+ declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<LoadingProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/loading").LoadingProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
12
+ render(): React.JSX.Element | React.ReactNode[];
13
+ context: any;
14
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/loading").LoadingProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
15
+ forceUpdate(callback?: (() => void) | undefined): void;
16
+ readonly props: Readonly<import("@alifd/next/types/loading").LoadingProps> & Readonly<{
17
+ children?: React.ReactNode | undefined;
18
+ }>;
19
+ state: Readonly<{}>;
20
+ refs: {
21
+ [key: string]: React.ReactInstance;
22
+ };
23
+ componentDidMount?(): void;
24
+ shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): boolean;
25
+ componentWillUnmount?(): void;
26
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
27
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, prevState: Readonly<{}>): any;
28
+ componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, prevState: Readonly<{}>, snapshot?: any): void;
29
+ componentWillMount?(): void;
30
+ UNSAFE_componentWillMount?(): void;
31
+ componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextContext: any): void;
32
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextContext: any): void;
33
+ componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): void;
34
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): void;
35
+ }>>, "key" | keyof LoadingProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/loading").LoadingProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
36
+ render(): React.JSX.Element | React.ReactNode[];
37
+ context: any;
38
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/loading").LoadingProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
39
+ forceUpdate(callback?: (() => void) | undefined): void;
40
+ readonly props: Readonly<import("@alifd/next/types/loading").LoadingProps> & Readonly<{
41
+ children?: React.ReactNode | undefined;
42
+ }>;
43
+ state: Readonly<{}>;
44
+ refs: {
45
+ [key: string]: React.ReactInstance;
46
+ };
47
+ componentDidMount?(): void;
48
+ shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): boolean;
49
+ componentWillUnmount?(): void;
50
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
51
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, prevState: Readonly<{}>): any;
52
+ componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, prevState: Readonly<{}>, snapshot?: any): void;
53
+ componentWillMount?(): void;
54
+ UNSAFE_componentWillMount?(): void;
55
+ componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextContext: any): void;
56
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextContext: any): void;
57
+ componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): void;
58
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): void;
59
+ }>, {}>;
60
+ export default _default;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @component 加载
3
+ * @en Loading
4
+ * * @remarks 同 Next Loading- Same as Next Loading component.
5
+ * @type 通用 - General
6
+ * @when
7
+ */
8
+ import { __rest } from "tslib";
9
+ import React, { forwardRef } from 'react';
10
+ import { Loading as NextLoading, ConfigProvider } from '@alifd/next';
11
+ import cs from 'classnames';
12
+ import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
13
+ const Loading = forwardRef((_a, ref) => {
14
+ var { className, indicator, shape = 'default', size = 'large' } = _a, props = __rest(_a, ["className", "indicator", "shape", "size"]);
15
+ let indicatorDom = indicator;
16
+ const nextProps = Object.assign(Object.assign({}, props), { size });
17
+ if (!indicator && shape && shape !== 'default') {
18
+ const indicatorClass = `load-container ${shape}`;
19
+ indicatorDom = (React.createElement("div", { className: indicatorClass },
20
+ React.createElement("div", { className: "loader" })));
21
+ nextProps.indicator = indicatorDom;
22
+ }
23
+ return (React.createElement(NextLoading, Object.assign({}, nextProps, { ref: ref, className: cs(`${PREFIX_DEFAULT}loading ${size} ${shape}`, className) })));
24
+ });
25
+ const LoadingWithSub = assignSubComponent(Loading, {
26
+ displayName: 'Loading',
27
+ });
28
+ export * from './types';
29
+ export default ConfigProvider.config(LoadingWithSub);
@@ -0,0 +1,227 @@
1
+ @import "../core/variables.scss";
2
+
3
+ .#{$prefix}loading {
4
+ .load-container {
5
+ margin: 0 auto;
6
+ position: relative;
7
+ }
8
+
9
+ &.medium {
10
+ /* animation 1 */
11
+ .bar .loader,
12
+ .bar .loader:before,
13
+ .bar .loader:after {
14
+ width: 0.5em;
15
+ height: 1em;
16
+ border-radius: 0.5em;
17
+ }
18
+
19
+ .bar .loader:before,
20
+ .bar .loader:after {
21
+ }
22
+ .bar .loader:before {
23
+ left: -0.8em;
24
+ }
25
+ .bar .loader {
26
+ }
27
+ .bar .loader:after {
28
+ left: 0.8em;
29
+ }
30
+ @-webkit-keyframes bar {
31
+ 0%,
32
+ 80%,
33
+ 100% {
34
+ box-shadow: 0 0 ;
35
+ height: 1em;
36
+ }
37
+ 40% {
38
+ box-shadow: 0 -1em ;
39
+ height: 1.2em;
40
+ }
41
+ }
42
+ @keyframes bar {
43
+ 0%,
44
+ 80%,
45
+ 100% {
46
+ box-shadow: 0 0 ;
47
+ height: 1em;
48
+ }
49
+ 40% {
50
+ box-shadow: 0 -1em ;
51
+ height: 1.2em;
52
+ }
53
+ }
54
+ /* animation 2 */
55
+ .dot .loader:before,
56
+ .dot .loader:after,
57
+ .dot .loader {
58
+ width: 1em;
59
+ height: 1em;
60
+ // top: -1em;
61
+ }
62
+ .dot .loader:before {
63
+ left: -1.5em;
64
+ }
65
+ .dot .loader:after {
66
+ left: 1.5em;
67
+ }
68
+
69
+ @-webkit-keyframes dot {
70
+ 0%,
71
+ 80%,
72
+ 100% {
73
+ box-shadow: 0 1 0 -0.5em $color-brand1-6;
74
+ }
75
+ 40% {
76
+ box-shadow: 0 1 0 0 $color-brand1-6;
77
+ }
78
+ }
79
+
80
+ @keyframes dot {
81
+ 0%,
82
+ 80%,
83
+ 100% {
84
+ box-shadow: 0 1em 0 -0.5em $color-brand1-6;
85
+ }
86
+ 40% {
87
+ box-shadow: 0 1em 0 0 $color-brand1-6;
88
+ }
89
+ }
90
+ }
91
+
92
+ /* animation 1 */
93
+ .bar .loader,
94
+ .bar .loader:before,
95
+ .bar .loader:after {
96
+ background: $color-brand1-6;
97
+ color: $color-brand1-6;
98
+ -webkit-animation: bar 1s infinite ease-in-out;
99
+ animation: bar 1s infinite ease-in-out;
100
+ width: 0.8em;
101
+ height: 2em;
102
+ border-radius: 0.8em;
103
+ }
104
+
105
+ .bar .loader:before,
106
+ .bar .loader:after {
107
+ position: absolute;
108
+ top: 0;
109
+ content: '';
110
+ }
111
+ .bar .loader:before {
112
+ left: -1em;
113
+ -webkit-animation-delay: -0.32s;
114
+ animation-delay: -0.32s;
115
+ }
116
+ .bar .loader {
117
+ text-indent: -9999em;
118
+ margin: 0 auto !important;
119
+ position: relative;
120
+ font-size: 11px;
121
+ -webkit-animation-delay: -0.16s;
122
+ animation-delay: -0.16s;
123
+ }
124
+ .bar .loader:after {
125
+ left: 1em;
126
+ }
127
+ @-webkit-keyframes bar {
128
+ 0%,
129
+ 80%,
130
+ 100% {
131
+ box-shadow: 0 0 ;
132
+ height: 2em;
133
+ }
134
+ 40% {
135
+ box-shadow: 0 -1.5em ;
136
+ height: 2.2em;
137
+ }
138
+ }
139
+ @keyframes bar {
140
+ 0%,
141
+ 80%,
142
+ 100% {
143
+ box-shadow: 0 0 ;
144
+ height: 2em;
145
+ }
146
+ 40% {
147
+ box-shadow: 0 -1.5em ;
148
+ height: 2.2em;
149
+ }
150
+ }
151
+ /* animation 2 */
152
+ .dot .loader:before,
153
+ .dot .loader:after,
154
+ .dot .loader {
155
+ border-radius: 50%;
156
+ width: 1.5em;
157
+ height: 1.5em;
158
+ -webkit-animation-fill-mode: both;
159
+ animation-fill-mode: both;
160
+ -webkit-animation: dot 1.8s infinite ease-in-out;
161
+ animation: dot 1.8s infinite ease-in-out;
162
+ top: -1.5em;
163
+
164
+ &.medium {
165
+ width: 1.0em;
166
+ height: 1.0em;
167
+ top: -1.0em;
168
+ }
169
+ }
170
+
171
+ .dot .loader {
172
+ margin: 0 auto !important;
173
+ font-size: 10px;
174
+ position: relative;
175
+ text-indent: -9999em;
176
+ -webkit-animation-delay: -0.16s;
177
+ animation-delay: -0.16s;
178
+ }
179
+
180
+ .dot .loader:before {
181
+ left: -2em;
182
+ -webkit-animation-delay: -0.32s;
183
+ animation-delay: -0.32s;
184
+
185
+ &.medium {
186
+ left: -1.5em;
187
+ }
188
+ }
189
+
190
+ .dot .loader:after {
191
+ left: 2em;
192
+ &.medium {
193
+ left: 1.5em;
194
+ }
195
+ }
196
+
197
+ .dot .loader:before,
198
+ .dot .loader:after {
199
+ content: '';
200
+ position: absolute;
201
+ top: 0;
202
+ }
203
+
204
+ @-webkit-keyframes dot {
205
+ 0%,
206
+ 80%,
207
+ 100% {
208
+ box-shadow: 0 1.5em 0 -0.8em $color-brand1-6;
209
+ }
210
+ 40% {
211
+ box-shadow: 0 1.5em 0 0 $color-brand1-6;
212
+ }
213
+ }
214
+
215
+ @keyframes dot {
216
+ 0%,
217
+ 80%,
218
+ 100% {
219
+ box-shadow: 0 1.5em 0 -0.8em $color-brand1-6;
220
+ }
221
+ 40% {
222
+ box-shadow: 0 1.5em 0 0 $color-brand1-6;
223
+ }
224
+ }
225
+ }
226
+
227
+
@@ -0,0 +1,2 @@
1
+ import '@alifd/next/lib/loading/style2';
2
+ import './main.scss';
@@ -0,0 +1,2 @@
1
+ import '@alifd/next/lib/loading/style2';
2
+ import './main.scss';
@@ -0,0 +1,8 @@
1
+ import { type CommonProps } from '@alifd/next';
2
+ import type { LoadingProps as FusionLoadingProps } from '@alifd/next/types/loading';
3
+ /**
4
+ * @api Loading
5
+ */
6
+ export interface LoadingProps extends FusionLoadingProps, CommonProps {
7
+ shape?: 'default' | 'bar' | 'dot';
8
+ }
@@ -0,0 +1 @@
1
+ export {};
package/lib/index.d.ts CHANGED
@@ -14,8 +14,9 @@ export { default as Icon } from './icon';
14
14
  export { default as Balloon } from './balloon';
15
15
  export { default as List } from './list';
16
16
  export { default as ImagePreview } from './image-preview';
17
- export { default as HtmlRenderer } from './html-render';
17
+ export { default as HtmlRender } from './html-render';
18
18
  export { default as Markdown } from './markdown';
19
19
  export { default as CardLoading } from './card-loading';
20
20
  export { default as Origin } from './origin';
21
+ export { default as Loading } from './loading';
21
22
  export declare const version: string;
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.version = exports.Origin = exports.CardLoading = exports.Markdown = exports.HtmlRenderer = exports.ImagePreview = exports.List = exports.Balloon = exports.Icon = exports.Message = exports.PersonPicker = exports.TimePicker = exports.DatePicker = exports.Input = exports.Tab = exports.Tag = exports.Text = exports.FloatButton = exports.Feedback = exports.Card = exports.Button = void 0;
3
+ exports.version = exports.Loading = exports.Origin = exports.CardLoading = exports.Markdown = exports.HtmlRender = exports.ImagePreview = exports.List = exports.Balloon = exports.Icon = exports.Message = exports.PersonPicker = exports.TimePicker = exports.DatePicker = exports.Input = exports.Tab = exports.Tag = exports.Text = exports.FloatButton = exports.Feedback = exports.Card = exports.Button = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  var button_1 = require("./button");
6
6
  Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return tslib_1.__importDefault(button_1).default; } });
@@ -35,11 +35,13 @@ Object.defineProperty(exports, "List", { enumerable: true, get: function () { re
35
35
  var image_preview_1 = require("./image-preview");
36
36
  Object.defineProperty(exports, "ImagePreview", { enumerable: true, get: function () { return tslib_1.__importDefault(image_preview_1).default; } });
37
37
  var html_render_1 = require("./html-render");
38
- Object.defineProperty(exports, "HtmlRenderer", { enumerable: true, get: function () { return tslib_1.__importDefault(html_render_1).default; } });
38
+ Object.defineProperty(exports, "HtmlRender", { enumerable: true, get: function () { return tslib_1.__importDefault(html_render_1).default; } });
39
39
  var markdown_1 = require("./markdown");
40
40
  Object.defineProperty(exports, "Markdown", { enumerable: true, get: function () { return tslib_1.__importDefault(markdown_1).default; } });
41
41
  var card_loading_1 = require("./card-loading");
42
42
  Object.defineProperty(exports, "CardLoading", { enumerable: true, get: function () { return tslib_1.__importDefault(card_loading_1).default; } });
43
43
  var origin_1 = require("./origin");
44
44
  Object.defineProperty(exports, "Origin", { enumerable: true, get: function () { return tslib_1.__importDefault(origin_1).default; } });
45
- exports.version = '0.3.0-beta.5';
45
+ var loading_1 = require("./loading");
46
+ Object.defineProperty(exports, "Loading", { enumerable: true, get: function () { return tslib_1.__importDefault(loading_1).default; } });
47
+ exports.version = '0.3.0-beta.7';
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @component 加载
3
+ * @en Loading
4
+ * * @remarks 同 Next Loading- Same as Next Loading component.
5
+ * @type 通用 - General
6
+ * @when
7
+ */
8
+ import React from 'react';
9
+ import type { LoadingProps } from './types';
10
+ export * from './types';
11
+ declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<LoadingProps & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/loading").LoadingProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
12
+ render(): React.JSX.Element | React.ReactNode[];
13
+ context: any;
14
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/loading").LoadingProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
15
+ forceUpdate(callback?: (() => void) | undefined): void;
16
+ readonly props: Readonly<import("@alifd/next/types/loading").LoadingProps> & Readonly<{
17
+ children?: React.ReactNode | undefined;
18
+ }>;
19
+ state: Readonly<{}>;
20
+ refs: {
21
+ [key: string]: React.ReactInstance;
22
+ };
23
+ componentDidMount?(): void;
24
+ shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): boolean;
25
+ componentWillUnmount?(): void;
26
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
27
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, prevState: Readonly<{}>): any;
28
+ componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, prevState: Readonly<{}>, snapshot?: any): void;
29
+ componentWillMount?(): void;
30
+ UNSAFE_componentWillMount?(): void;
31
+ componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextContext: any): void;
32
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextContext: any): void;
33
+ componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): void;
34
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): void;
35
+ }>>, "key" | keyof LoadingProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/loading").LoadingProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, {
36
+ render(): React.JSX.Element | React.ReactNode[];
37
+ context: any;
38
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@alifd/next/types/loading").LoadingProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
39
+ forceUpdate(callback?: (() => void) | undefined): void;
40
+ readonly props: Readonly<import("@alifd/next/types/loading").LoadingProps> & Readonly<{
41
+ children?: React.ReactNode | undefined;
42
+ }>;
43
+ state: Readonly<{}>;
44
+ refs: {
45
+ [key: string]: React.ReactInstance;
46
+ };
47
+ componentDidMount?(): void;
48
+ shouldComponentUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): boolean;
49
+ componentWillUnmount?(): void;
50
+ componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
51
+ getSnapshotBeforeUpdate?(prevProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, prevState: Readonly<{}>): any;
52
+ componentDidUpdate?(prevProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, prevState: Readonly<{}>, snapshot?: any): void;
53
+ componentWillMount?(): void;
54
+ UNSAFE_componentWillMount?(): void;
55
+ componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextContext: any): void;
56
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextContext: any): void;
57
+ componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): void;
58
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@alifd/next/types/loading").LoadingProps>, nextState: Readonly<{}>, nextContext: any): void;
59
+ }>, {}>;
60
+ export default _default;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * @component 加载
4
+ * @en Loading
5
+ * * @remarks 同 Next Loading- Same as Next Loading component.
6
+ * @type 通用 - General
7
+ * @when
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ const tslib_1 = require("tslib");
11
+ const react_1 = tslib_1.__importStar(require("react"));
12
+ const next_1 = require("@alifd/next");
13
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
14
+ const utils_1 = require("../utils");
15
+ const Loading = (0, react_1.forwardRef)((_a, ref) => {
16
+ var { className, indicator, shape = 'default', size = 'large' } = _a, props = tslib_1.__rest(_a, ["className", "indicator", "shape", "size"]);
17
+ let indicatorDom = indicator;
18
+ const nextProps = Object.assign(Object.assign({}, props), { size });
19
+ if (!indicator && shape && shape !== 'default') {
20
+ const indicatorClass = `load-container ${shape}`;
21
+ indicatorDom = (react_1.default.createElement("div", { className: indicatorClass },
22
+ react_1.default.createElement("div", { className: "loader" })));
23
+ nextProps.indicator = indicatorDom;
24
+ }
25
+ return (react_1.default.createElement(next_1.Loading, Object.assign({}, nextProps, { ref: ref, className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}loading ${size} ${shape}`, className) })));
26
+ });
27
+ const LoadingWithSub = (0, utils_1.assignSubComponent)(Loading, {
28
+ displayName: 'Loading',
29
+ });
30
+ tslib_1.__exportStar(require("./types"), exports);
31
+ exports.default = next_1.ConfigProvider.config(LoadingWithSub);
@@ -0,0 +1,227 @@
1
+ @import "../core/variables.scss";
2
+
3
+ .#{$prefix}loading {
4
+ .load-container {
5
+ margin: 0 auto;
6
+ position: relative;
7
+ }
8
+
9
+ &.medium {
10
+ /* animation 1 */
11
+ .bar .loader,
12
+ .bar .loader:before,
13
+ .bar .loader:after {
14
+ width: 0.5em;
15
+ height: 1em;
16
+ border-radius: 0.5em;
17
+ }
18
+
19
+ .bar .loader:before,
20
+ .bar .loader:after {
21
+ }
22
+ .bar .loader:before {
23
+ left: -0.8em;
24
+ }
25
+ .bar .loader {
26
+ }
27
+ .bar .loader:after {
28
+ left: 0.8em;
29
+ }
30
+ @-webkit-keyframes bar {
31
+ 0%,
32
+ 80%,
33
+ 100% {
34
+ box-shadow: 0 0 ;
35
+ height: 1em;
36
+ }
37
+ 40% {
38
+ box-shadow: 0 -1em ;
39
+ height: 1.2em;
40
+ }
41
+ }
42
+ @keyframes bar {
43
+ 0%,
44
+ 80%,
45
+ 100% {
46
+ box-shadow: 0 0 ;
47
+ height: 1em;
48
+ }
49
+ 40% {
50
+ box-shadow: 0 -1em ;
51
+ height: 1.2em;
52
+ }
53
+ }
54
+ /* animation 2 */
55
+ .dot .loader:before,
56
+ .dot .loader:after,
57
+ .dot .loader {
58
+ width: 1em;
59
+ height: 1em;
60
+ // top: -1em;
61
+ }
62
+ .dot .loader:before {
63
+ left: -1.5em;
64
+ }
65
+ .dot .loader:after {
66
+ left: 1.5em;
67
+ }
68
+
69
+ @-webkit-keyframes dot {
70
+ 0%,
71
+ 80%,
72
+ 100% {
73
+ box-shadow: 0 1 0 -0.5em $color-brand1-6;
74
+ }
75
+ 40% {
76
+ box-shadow: 0 1 0 0 $color-brand1-6;
77
+ }
78
+ }
79
+
80
+ @keyframes dot {
81
+ 0%,
82
+ 80%,
83
+ 100% {
84
+ box-shadow: 0 1em 0 -0.5em $color-brand1-6;
85
+ }
86
+ 40% {
87
+ box-shadow: 0 1em 0 0 $color-brand1-6;
88
+ }
89
+ }
90
+ }
91
+
92
+ /* animation 1 */
93
+ .bar .loader,
94
+ .bar .loader:before,
95
+ .bar .loader:after {
96
+ background: $color-brand1-6;
97
+ color: $color-brand1-6;
98
+ -webkit-animation: bar 1s infinite ease-in-out;
99
+ animation: bar 1s infinite ease-in-out;
100
+ width: 0.8em;
101
+ height: 2em;
102
+ border-radius: 0.8em;
103
+ }
104
+
105
+ .bar .loader:before,
106
+ .bar .loader:after {
107
+ position: absolute;
108
+ top: 0;
109
+ content: '';
110
+ }
111
+ .bar .loader:before {
112
+ left: -1em;
113
+ -webkit-animation-delay: -0.32s;
114
+ animation-delay: -0.32s;
115
+ }
116
+ .bar .loader {
117
+ text-indent: -9999em;
118
+ margin: 0 auto !important;
119
+ position: relative;
120
+ font-size: 11px;
121
+ -webkit-animation-delay: -0.16s;
122
+ animation-delay: -0.16s;
123
+ }
124
+ .bar .loader:after {
125
+ left: 1em;
126
+ }
127
+ @-webkit-keyframes bar {
128
+ 0%,
129
+ 80%,
130
+ 100% {
131
+ box-shadow: 0 0 ;
132
+ height: 2em;
133
+ }
134
+ 40% {
135
+ box-shadow: 0 -1.5em ;
136
+ height: 2.2em;
137
+ }
138
+ }
139
+ @keyframes bar {
140
+ 0%,
141
+ 80%,
142
+ 100% {
143
+ box-shadow: 0 0 ;
144
+ height: 2em;
145
+ }
146
+ 40% {
147
+ box-shadow: 0 -1.5em ;
148
+ height: 2.2em;
149
+ }
150
+ }
151
+ /* animation 2 */
152
+ .dot .loader:before,
153
+ .dot .loader:after,
154
+ .dot .loader {
155
+ border-radius: 50%;
156
+ width: 1.5em;
157
+ height: 1.5em;
158
+ -webkit-animation-fill-mode: both;
159
+ animation-fill-mode: both;
160
+ -webkit-animation: dot 1.8s infinite ease-in-out;
161
+ animation: dot 1.8s infinite ease-in-out;
162
+ top: -1.5em;
163
+
164
+ &.medium {
165
+ width: 1.0em;
166
+ height: 1.0em;
167
+ top: -1.0em;
168
+ }
169
+ }
170
+
171
+ .dot .loader {
172
+ margin: 0 auto !important;
173
+ font-size: 10px;
174
+ position: relative;
175
+ text-indent: -9999em;
176
+ -webkit-animation-delay: -0.16s;
177
+ animation-delay: -0.16s;
178
+ }
179
+
180
+ .dot .loader:before {
181
+ left: -2em;
182
+ -webkit-animation-delay: -0.32s;
183
+ animation-delay: -0.32s;
184
+
185
+ &.medium {
186
+ left: -1.5em;
187
+ }
188
+ }
189
+
190
+ .dot .loader:after {
191
+ left: 2em;
192
+ &.medium {
193
+ left: 1.5em;
194
+ }
195
+ }
196
+
197
+ .dot .loader:before,
198
+ .dot .loader:after {
199
+ content: '';
200
+ position: absolute;
201
+ top: 0;
202
+ }
203
+
204
+ @-webkit-keyframes dot {
205
+ 0%,
206
+ 80%,
207
+ 100% {
208
+ box-shadow: 0 1.5em 0 -0.8em $color-brand1-6;
209
+ }
210
+ 40% {
211
+ box-shadow: 0 1.5em 0 0 $color-brand1-6;
212
+ }
213
+ }
214
+
215
+ @keyframes dot {
216
+ 0%,
217
+ 80%,
218
+ 100% {
219
+ box-shadow: 0 1.5em 0 -0.8em $color-brand1-6;
220
+ }
221
+ 40% {
222
+ box-shadow: 0 1.5em 0 0 $color-brand1-6;
223
+ }
224
+ }
225
+ }
226
+
227
+
@@ -0,0 +1,2 @@
1
+ import '@alifd/next/lib/loading/style2';
2
+ import './main.scss';
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("@alifd/next/lib/loading/style2");
4
+ require("./main.scss");
@@ -0,0 +1,8 @@
1
+ import { type CommonProps } from '@alifd/next';
2
+ import type { LoadingProps as FusionLoadingProps } from '@alifd/next/types/loading';
3
+ /**
4
+ * @api Loading
5
+ */
6
+ export interface LoadingProps extends FusionLoadingProps, CommonProps {
7
+ shape?: 'default' | 'bar' | 'dot';
8
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alifd/chat",
3
- "version": "0.3.0-beta.5",
3
+ "version": "0.3.0-beta.7",
4
4
  "description": "A configurable component library for chat built on React.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -301,6 +301,18 @@
301
301
  "./image-preview/style.js": {
302
302
  "import": "./es/image-preview/style.js",
303
303
  "require": "./lib/image-preview/style.js"
304
+ },
305
+ "./loading": {
306
+ "import": "./es/loading/index.js",
307
+ "require": "./lib/loading/index.js"
308
+ },
309
+ "./loading/style": {
310
+ "import": "./es/loading/style.js",
311
+ "require": "./lib/loading/style.js"
312
+ },
313
+ "./loading/style.js": {
314
+ "import": "./es/loading/style.js",
315
+ "require": "./lib/loading/style.js"
304
316
  }
305
317
  },
306
318
  "files": [