@alifd/chat 0.1.15-beta.2 → 0.1.15-beta.4
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/card/view/collapsable.d.ts +1 -1
- package/es/date-picker/index.js +1 -1
- package/es/index.js +1 -1
- package/es/input/index.js +1 -1
- package/es/person-picker/index.js +35 -9
- package/es/tag/index.d.ts +1769 -2
- package/es/time-picker/index.js +2 -2
- package/lib/card/view/collapsable.d.ts +1 -1
- package/lib/date-picker/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/input/index.js +1 -1
- package/lib/person-picker/index.js +32 -6
- package/lib/tag/index.d.ts +1769 -2
- package/lib/time-picker/index.js +2 -2
- package/package.json +2 -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
|
}
|
package/es/date-picker/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import { DatePicker2 as NextDatePicker2, ConfigProvider } from '@alifd/next';
|
|
|
23
23
|
import cs from 'classnames';
|
|
24
24
|
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
25
25
|
const DatePicker = forwardRef((_a, ref) => {
|
|
26
|
-
var { className, size = '
|
|
26
|
+
var { className, size = 'medium' } = _a, props = __rest(_a, ["className", "size"]);
|
|
27
27
|
return (React.createElement(NextDatePicker2, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}date-picker2`, className), size: size, ref: ref })));
|
|
28
28
|
});
|
|
29
29
|
const DatePickerWithSub = assignSubComponent(DatePicker, {
|
package/es/index.js
CHANGED
|
@@ -9,4 +9,4 @@ export { default as Input } from './input';
|
|
|
9
9
|
export { default as DatePicker } from './date-picker';
|
|
10
10
|
export { default as TimePicker } from './time-picker';
|
|
11
11
|
export { default as PersonPicker } from './person-picker';
|
|
12
|
-
export const version = '0.1.15-beta.
|
|
12
|
+
export const version = '0.1.15-beta.4';
|
package/es/input/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import { Input as NextInput, ConfigProvider } from '@alifd/next';
|
|
|
23
23
|
import cs from 'classnames';
|
|
24
24
|
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
25
25
|
const Input = forwardRef((_a, ref) => {
|
|
26
|
-
var { className, size = '
|
|
26
|
+
var { className, size = 'medium' } = _a, props = __rest(_a, ["className", "size"]);
|
|
27
27
|
return (React.createElement(NextInput, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}input`, className), size: size, ref: ref })));
|
|
28
28
|
});
|
|
29
29
|
const InputWithSub = assignSubComponent(Input, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __rest } from "tslib";
|
|
1
|
+
import { __awaiter, __rest } from "tslib";
|
|
2
2
|
/**
|
|
3
3
|
* @component 人员选择
|
|
4
4
|
* @en PersonSelect
|
|
@@ -18,20 +18,46 @@ import { __rest } from "tslib";
|
|
|
18
18
|
* | Enter | Trigger the onClick event |
|
|
19
19
|
* | SPACE | Trigger the onClick event |
|
|
20
20
|
*/
|
|
21
|
-
import React, { forwardRef } from 'react';
|
|
22
|
-
import { Select as NextSelect, Tag as NextTag, Avatar as NextAvatar,
|
|
21
|
+
import React, { useState, forwardRef } from 'react';
|
|
22
|
+
import { Select as NextSelect, Tag as NextTag, Avatar as NextAvatar, ConfigProvider } from '@alifd/next';
|
|
23
23
|
import cs from 'classnames';
|
|
24
|
+
import axios from 'axios';
|
|
24
25
|
import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
|
|
25
26
|
const PersonPicker = forwardRef((_a, ref) => {
|
|
26
|
-
var { className, size = '
|
|
27
|
+
var { className, size = 'medium', defaultValue, readOnly } = _a, props = __rest(_a, ["className", "size", "defaultValue", "readOnly"]);
|
|
28
|
+
const [dataSource, setDataSource] = useState([]);
|
|
27
29
|
const tagRender = (selectItem) => {
|
|
28
|
-
|
|
29
|
-
return React.createElement(NextTag.Closeable, { onClose: onClose, className: "h-6 px-1 mt-1 mr-1" },
|
|
30
|
+
return React.createElement(NextTag, { className: "h-6 px-1 mt-1 mr-1" },
|
|
30
31
|
React.createElement("div", { className: "flex items-center" },
|
|
31
|
-
React.createElement(NextAvatar, {
|
|
32
|
-
React.createElement("span",
|
|
32
|
+
React.createElement(NextAvatar, { shape: "square", size: "medium", src: `//work.alibaba-inc.com/photo/${selectItem.value}.40x40.jpg` }),
|
|
33
|
+
React.createElement("span", null, selectItem.label)));
|
|
33
34
|
};
|
|
34
|
-
|
|
35
|
+
const handleUserSearch = (keyword) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
var _b, _c;
|
|
37
|
+
if (readOnly) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const queryParams = {
|
|
41
|
+
key: keyword,
|
|
42
|
+
pageSize: (props === null || props === void 0 ? void 0 : props.pageSize) || 5
|
|
43
|
+
};
|
|
44
|
+
try {
|
|
45
|
+
const response = yield axios.get('/_gw/employee360Service/searchEmpInfo.json', {
|
|
46
|
+
params: queryParams,
|
|
47
|
+
});
|
|
48
|
+
const newDataSource = (_c = (_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.map((item) => {
|
|
49
|
+
return {
|
|
50
|
+
label: item.nickName,
|
|
51
|
+
value: item.workNo
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
setDataSource(newDataSource);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
setDataSource([]);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return (React.createElement(NextSelect, Object.assign({}, props, { className: cs(`${PREFIX_DEFAULT}person-picker`, className), itemRender: tagRender, mode: "multiple", showSearch: true, filterLocal: false, hiddenSelected: true, dataSource: dataSource, onSearch: handleUserSearch, size: size, ref: ref, readOnly: readOnly })));
|
|
35
61
|
});
|
|
36
62
|
const PersonPickerWithSub = assignSubComponent(PersonPicker, {
|
|
37
63
|
displayName: 'PersonPicker',
|