@aloudata/aloudata-design 2.0.0-beta.12 → 2.0.0-beta.14
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/dist/Checkbox/style/index.less +1 -1
- package/dist/Icon/components/ArrowRightLightLine.d.ts +11 -0
- package/dist/Icon/components/ArrowRightLightLine.js +35 -0
- package/dist/Icon/index.d.ts +1 -0
- package/dist/Icon/index.js +1 -0
- package/dist/Icon/svg/Arrow-Right-light-line.svg +5 -0
- package/dist/MemberPicker/index.js +24 -21
- package/dist/MemberPicker/interface.d.ts +1 -1
- package/dist/MemberPicker/style/index.less +6 -0
- package/dist/Modal/index.js +26 -7
- package/dist/Select/index.js +11 -4
- package/dist/Select/style/emptyShowAll.less +10 -0
- package/dist/Select/style/index.less +13 -7
- package/dist/Select/style/status.less +28 -1
- package/dist/Tree/Tree.d.ts +1 -0
- package/dist/Tree/Tree.js +32 -36
- package/dist/Tree/demo/basic/index.js +1 -0
- package/dist/Tree/demo/filter/index.js +1 -0
- package/dist/Tree/style/checkbox.less +57 -36
- package/dist/Tree/style/index.less +25 -5
- package/dist/Tree/style/mixin.less +4 -4
- package/dist/Tree/style/var.less +1 -1
- package/dist/ald.min.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SVGProps } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface SVGRProps {
|
|
4
|
+
size?: number | string;
|
|
5
|
+
title?: string;
|
|
6
|
+
titleId?: string;
|
|
7
|
+
desc?: string;
|
|
8
|
+
descId?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const Memo: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<SVGProps<SVGSVGElement> & SVGRProps, "ref"> & React.RefAttributes<SVGSVGElement>>>;
|
|
11
|
+
export default Memo;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var _excluded = ["title", "titleId", "desc", "descId"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { forwardRef, memo } from 'react';
|
|
7
|
+
var ArrowRightLightLine = function ArrowRightLightLine(_ref, ref) {
|
|
8
|
+
var title = _ref.title,
|
|
9
|
+
titleId = _ref.titleId,
|
|
10
|
+
desc = _ref.desc,
|
|
11
|
+
descId = _ref.descId,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
14
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
+
width: props.width || props.size || 16,
|
|
16
|
+
height: props.height || props.size || 16,
|
|
17
|
+
fill: "none",
|
|
18
|
+
viewBox: "0 0 24 24",
|
|
19
|
+
ref: ref,
|
|
20
|
+
"aria-labelledby": titleId,
|
|
21
|
+
"aria-describedby": descId
|
|
22
|
+
}, props), desc ? /*#__PURE__*/React.createElement("desc", {
|
|
23
|
+
id: descId
|
|
24
|
+
}, desc) : null, title ? /*#__PURE__*/React.createElement("title", {
|
|
25
|
+
id: titleId
|
|
26
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
27
|
+
fill: props.color || 'currentColor',
|
|
28
|
+
fillRule: "evenodd",
|
|
29
|
+
d: "M9.47 6.47a.75.75 0 0 1 1.06 0l5 5a.75.75 0 0 1 0 1.06l-5 5a.75.75 0 1 1-1.06-1.06L13.94 12 9.47 7.53a.75.75 0 0 1 0-1.06Z",
|
|
30
|
+
clipRule: "evenodd"
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
var ForwardRef = /*#__PURE__*/forwardRef(ArrowRightLightLine);
|
|
34
|
+
var Memo = /*#__PURE__*/memo(ForwardRef);
|
|
35
|
+
export default Memo;
|
package/dist/Icon/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as AlertTriangleDuotone } from './components/AlertTriangleDuotone';
|
|
2
2
|
export { default as AlertTriangleLine } from './components/AlertTriangleLine';
|
|
3
3
|
export { default as ArrowDownFill } from './components/ArrowDownFill';
|
|
4
|
+
export { default as ArrowRightLightLine } from './components/ArrowRightLightLine';
|
|
4
5
|
export { default as AttentionCircleFill } from './components/AttentionCircleFill';
|
|
5
6
|
export { default as AttentionTriangleFill } from './components/AttentionTriangleFill';
|
|
6
7
|
export { default as AttentionTriangleLightLine } from './components/AttentionTriangleLightLine';
|
package/dist/Icon/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as AlertTriangleDuotone } from "./components/AlertTriangleDuotone";
|
|
2
2
|
export { default as AlertTriangleLine } from "./components/AlertTriangleLine";
|
|
3
3
|
export { default as ArrowDownFill } from "./components/ArrowDownFill";
|
|
4
|
+
export { default as ArrowRightLightLine } from "./components/ArrowRightLightLine";
|
|
4
5
|
export { default as AttentionCircleFill } from "./components/AttentionCircleFill";
|
|
5
6
|
export { default as AttentionTriangleFill } from "./components/AttentionTriangleFill";
|
|
6
7
|
export { default as AttentionTriangleLightLine } from "./components/AttentionTriangleLightLine";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g id=" Icon / Light / Arrow / Arrow-Right-light-line">
|
|
3
|
+
<path id="Icon" fill-rule="evenodd" clip-rule="evenodd" d="M9.46967 6.46967C9.76256 6.17678 10.2374 6.17678 10.5303 6.46967L15.5303 11.4697C15.8232 11.7626 15.8232 12.2374 15.5303 12.5303L10.5303 17.5303C10.2374 17.8232 9.76256 17.8232 9.46967 17.5303C9.17678 17.2374 9.17678 16.7626 9.46967 16.4697L13.9393 12L9.46967 7.53033C9.17678 7.23744 9.17678 6.76256 9.46967 6.46967Z" fill="black"/>
|
|
4
|
+
</g>
|
|
5
|
+
</svg>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
var _excluded = ["value", "type", "onChange", "multiple", "dropdownWidth", "open", "onOpenChange", "placeholder", "className", "allowClear", "disabled", "onClear", "size", "selectType", "prefix", "lockedIds"];
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
1
3
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
2
4
|
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
3
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -6,6 +8,8 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
6
8
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
9
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
8
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
9
13
|
import { useRequest } from 'ahooks';
|
|
10
14
|
import classNames from 'classnames';
|
|
11
15
|
import _ from 'lodash';
|
|
@@ -40,7 +44,8 @@ var Component = function Component(_ref) {
|
|
|
40
44
|
selectType = _ref$selectType === void 0 ? 'secondary' : _ref$selectType,
|
|
41
45
|
propPrefix = _ref.prefix,
|
|
42
46
|
_ref$lockedIds = _ref.lockedIds,
|
|
43
|
-
lockedIds = _ref$lockedIds === void 0 ? [] : _ref$lockedIds
|
|
47
|
+
lockedIds = _ref$lockedIds === void 0 ? [] : _ref$lockedIds,
|
|
48
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
44
49
|
var _ConfigProvider$useGe = ConfigProvider.useGetUserList(),
|
|
45
50
|
getUsersByIds = _ConfigProvider$useGe.getUsersByIds,
|
|
46
51
|
getUsersByKeywords = _ConfigProvider$useGe.getUsersByKeywords;
|
|
@@ -186,22 +191,9 @@ var Component = function Component(_ref) {
|
|
|
186
191
|
setDropdownOpen(open);
|
|
187
192
|
onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(open);
|
|
188
193
|
}, [onOpenChange]);
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
var user = searchUserList[0];
|
|
193
|
-
return /*#__PURE__*/React.createElement(Avatar, {
|
|
194
|
-
src: user === null || user === void 0 ? void 0 : user.photo,
|
|
195
|
-
size: 20
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
if (type === EMemberPicker.GROUP) return /*#__PURE__*/React.createElement(UserGroup, {
|
|
199
|
-
size: 20
|
|
200
|
-
});
|
|
201
|
-
return propPrefix;
|
|
202
|
-
}, [multiple, propPrefix, searchUserList, type]);
|
|
203
|
-
return /*#__PURE__*/React.createElement(Select, {
|
|
204
|
-
prefix: prefix,
|
|
194
|
+
return /*#__PURE__*/React.createElement(Select, _extends({
|
|
195
|
+
prefix: propPrefix
|
|
196
|
+
}, restProps, {
|
|
205
197
|
size: size,
|
|
206
198
|
type: selectType,
|
|
207
199
|
className: classNames('ald-member-picker-select', className),
|
|
@@ -228,14 +220,25 @@ var Component = function Component(_ref) {
|
|
|
228
220
|
options: selectedUserList.map(function (item) {
|
|
229
221
|
if (item.type === EUserType.USER_GROUP) return {
|
|
230
222
|
label: item.name,
|
|
231
|
-
value: item.groupId
|
|
223
|
+
value: item.groupId,
|
|
224
|
+
tag: /*#__PURE__*/React.createElement("div", {
|
|
225
|
+
className: 'ald-member-picker-tag'
|
|
226
|
+
}, /*#__PURE__*/React.createElement(UserGroup, {
|
|
227
|
+
size: 20
|
|
228
|
+
}), item.name)
|
|
232
229
|
};
|
|
233
230
|
return {
|
|
234
231
|
label: item.nickname || item.name,
|
|
235
|
-
value: item.userId
|
|
232
|
+
value: item.userId,
|
|
233
|
+
tag: /*#__PURE__*/React.createElement("div", {
|
|
234
|
+
className: 'ald-member-picker-tag'
|
|
235
|
+
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
236
|
+
size: 20,
|
|
237
|
+
src: item.photo
|
|
238
|
+
}), item.nickname || item.name)
|
|
236
239
|
};
|
|
237
240
|
}),
|
|
238
|
-
optionLabelProp:
|
|
241
|
+
optionLabelProp: multiple ? 'label' : 'tag',
|
|
239
242
|
open: dropdownOpen,
|
|
240
243
|
onDropdownVisibleChange: onDropdownOpenChange,
|
|
241
244
|
dropdownMatchSelectWidth: false,
|
|
@@ -256,7 +259,7 @@ var Component = function Component(_ref) {
|
|
|
256
259
|
onCancel: setDropdownOpen.bind(null, false)
|
|
257
260
|
}));
|
|
258
261
|
}
|
|
259
|
-
});
|
|
262
|
+
}));
|
|
260
263
|
};
|
|
261
264
|
var MemberSelector = Component;
|
|
262
265
|
MemberSelector.MemberPanel = MemberPanel;
|
|
@@ -9,7 +9,7 @@ export declare enum EMemberPicker {
|
|
|
9
9
|
USER = "USER",
|
|
10
10
|
BOTH = "BOTH"
|
|
11
11
|
}
|
|
12
|
-
export interface IBaseMemberSelectorProps extends
|
|
12
|
+
export interface IBaseMemberSelectorProps extends Omit<ISelectProps, 'type'> {
|
|
13
13
|
value?: TMemberPickerValue;
|
|
14
14
|
dropdownWidth?: number;
|
|
15
15
|
open?: boolean;
|
package/dist/Modal/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var _excluded = ["className", "type", "loading", "size", "disabled", "shape"],
|
|
|
5
5
|
_excluded4 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
6
6
|
_excluded5 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
7
7
|
_excluded6 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
8
|
-
_excluded7 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "className", "okText", "cancelText"];
|
|
8
|
+
_excluded7 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "className", "okText", "cancelText", "type"];
|
|
9
9
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -65,6 +65,27 @@ var ModalTitle = function ModalTitle(_ref, type) {
|
|
|
65
65
|
className: 'ald-modal-text-sub-title'
|
|
66
66
|
}, subTitle)));
|
|
67
67
|
};
|
|
68
|
+
function getIcon(type) {
|
|
69
|
+
if (type === 'success') return /*#__PURE__*/React.createElement(CheckCircleLightLine, {
|
|
70
|
+
fill: "#fff",
|
|
71
|
+
color: "#22C55E",
|
|
72
|
+
size: 24
|
|
73
|
+
});
|
|
74
|
+
if (type === 'error') return /*#__PURE__*/React.createElement(AttentionTriangleLightLine, {
|
|
75
|
+
color: "#EF4444",
|
|
76
|
+
fill: '#fff',
|
|
77
|
+
size: 24
|
|
78
|
+
});
|
|
79
|
+
if (type === 'warning') return /*#__PURE__*/React.createElement(AttentionTriangleLightLine, {
|
|
80
|
+
color: "#EAB308",
|
|
81
|
+
size: 24
|
|
82
|
+
});
|
|
83
|
+
return /*#__PURE__*/React.createElement(InformationCircleLightLine, {
|
|
84
|
+
size: 24,
|
|
85
|
+
color: '#2986F4',
|
|
86
|
+
className: "ald-modal-close"
|
|
87
|
+
});
|
|
88
|
+
}
|
|
68
89
|
var OriginModal = function OriginModal(props) {
|
|
69
90
|
var className = props.className,
|
|
70
91
|
children = props.children,
|
|
@@ -260,6 +281,8 @@ Modal.confirm = function confirmFn(props) {
|
|
|
260
281
|
okText = _props$okText6 === void 0 ? '确定' : _props$okText6,
|
|
261
282
|
_props$cancelText6 = props.cancelText,
|
|
262
283
|
cancelText = _props$cancelText6 === void 0 ? '取消' : _props$cancelText6,
|
|
284
|
+
_props$type = props.type,
|
|
285
|
+
type = _props$type === void 0 ? 'confirm' : _props$type,
|
|
263
286
|
restProps = _objectWithoutProperties(props, _excluded7);
|
|
264
287
|
return AntdModal.confirm(_objectSpread({
|
|
265
288
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
@@ -267,14 +290,10 @@ Modal.confirm = function confirmFn(props) {
|
|
|
267
290
|
width: width || DEFAULT_WIDTH,
|
|
268
291
|
className: classNames('ald-modal', className),
|
|
269
292
|
title: ModalTitle({
|
|
270
|
-
icon:
|
|
271
|
-
size: 24,
|
|
272
|
-
color: '#2986F4',
|
|
273
|
-
className: "ald-modal-close"
|
|
274
|
-
}),
|
|
293
|
+
icon: getIcon(type),
|
|
275
294
|
title: title,
|
|
276
295
|
subTitle: subTitle
|
|
277
|
-
},
|
|
296
|
+
}, type),
|
|
278
297
|
okText: okText,
|
|
279
298
|
cancelText: cancelText
|
|
280
299
|
}, restProps));
|
package/dist/Select/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
var _excluded = ["mode", "options", "dropdownRender", "onDropdownVisibleChange", "defaultValue", "onChange", "open", "defaultOpen", "prefix", "prefixWidth", "className", "popupClassName", "listHeight", "notFoundContent", "value", "type", "tagRender", "style", "autoFocus", "showSearch", "showAllOption", "size", "status", "disabled", "prefixCls"];
|
|
2
|
+
var _excluded = ["mode", "options", "dropdownRender", "onDropdownVisibleChange", "defaultValue", "onChange", "open", "defaultOpen", "prefix", "prefixWidth", "className", "popupClassName", "listHeight", "notFoundContent", "value", "type", "tagRender", "style", "autoFocus", "showSearch", "showAllOption", "size", "status", "disabled", "prefixCls", "placeholder", "dropdownStyle"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
@@ -32,6 +32,9 @@ import Empty from "../Empty";
|
|
|
32
32
|
import { ArrowDownFill, TimesLightLine } from "../Icon";
|
|
33
33
|
import Option from "./components/Option";
|
|
34
34
|
var DEFAULT_ALL_OPTION_VALUE = 'default_all_option_value';
|
|
35
|
+
var defaultDropdownStyle = {
|
|
36
|
+
minWidth: 192
|
|
37
|
+
};
|
|
35
38
|
var DEFAULT_LIST_ITEM_HEIGHT = 36;
|
|
36
39
|
var getSelectedOptionsFromValue = function getSelectedOptionsFromValue(isMultiple, options, value, defaultValue) {
|
|
37
40
|
if (typeof value !== 'undefined') {
|
|
@@ -103,7 +106,10 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
103
106
|
customStatus = props.status,
|
|
104
107
|
customDisabled = props.disabled,
|
|
105
108
|
customizePrefixCls = props.prefixCls,
|
|
109
|
+
propsPlaceholder = props.placeholder,
|
|
110
|
+
dropdownStyle = props.dropdownStyle,
|
|
106
111
|
restProps = _objectWithoutProperties(props, _excluded);
|
|
112
|
+
var placeholder = type === 'primary' ? '全部' : propsPlaceholder;
|
|
107
113
|
var contentSize = useContext(SizeContext);
|
|
108
114
|
var _React$useContext = React.useContext(ConfigContext),
|
|
109
115
|
getPrefixCls = _React$useContext.getPrefixCls,
|
|
@@ -371,7 +377,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
371
377
|
setIsOpen(!isOpen);
|
|
372
378
|
}
|
|
373
379
|
},
|
|
374
|
-
className: classNames('ald-select', className, (_classNames = {}, _defineProperty(_classNames, "ald-select-".concat(type), type === 'primary' || type === 'secondary'), _defineProperty(_classNames, 'ald-select-multiple', isMultiple), _defineProperty(_classNames, 'ald-select-single', !isMultiple), _defineProperty(_classNames, 'ald-select-large', size === 'large'), _defineProperty(_classNames, 'ald-select-small', size === 'small'), _defineProperty(_classNames, 'ald-select-disabled', mergedDisabled), _defineProperty(_classNames, 'ald-select-middle', size !== 'large' && size !== 'small'), _defineProperty(_classNames, 'ald-select-open', typeof _open === 'boolean' ? _open : isOpen), _defineProperty(_classNames, 'ald-select-focus', isFocus), _defineProperty(_classNames, "ald-select-status-".concat(mergedStatus), mergedStatus), _defineProperty(_classNames, 'ald-select-has-value', !_.isEmpty(value) || !_.isEmpty(currentValue)), _classNames), compactItemClassnames, hashId),
|
|
380
|
+
className: classNames('ald-select', className, (_classNames = {}, _defineProperty(_classNames, "ald-select-".concat(type), type === 'primary' || type === 'secondary'), _defineProperty(_classNames, 'ald-select-multiple', isMultiple), _defineProperty(_classNames, 'ald-select-single', !isMultiple), _defineProperty(_classNames, 'ald-select-large', size === 'large'), _defineProperty(_classNames, 'ald-select-small', size === 'small'), _defineProperty(_classNames, 'ald-select-disabled', mergedDisabled), _defineProperty(_classNames, 'ald-select-middle', size !== 'large' && size !== 'small'), _defineProperty(_classNames, 'ald-select-open', typeof _open === 'boolean' ? _open : isOpen), _defineProperty(_classNames, 'ald-select-focus', isFocus), _defineProperty(_classNames, "ald-select-status-".concat(mergedStatus), mergedStatus), _defineProperty(_classNames, 'ald-select-empty-show-all', type === 'primary'), _defineProperty(_classNames, 'ald-select-has-value', !_.isEmpty(value) || !_.isEmpty(currentValue)), _classNames), compactItemClassnames, hashId),
|
|
375
381
|
spellCheck: false,
|
|
376
382
|
style: Object.assign(styleVar, style)
|
|
377
383
|
}, !!prefix && /*#__PURE__*/React.createElement("span", {
|
|
@@ -380,13 +386,14 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
380
386
|
}, prefix), /*#__PURE__*/React.createElement(AntdSelect, _extends({}, restProps, {
|
|
381
387
|
// @ts-ignore
|
|
382
388
|
status: mergedStatus,
|
|
389
|
+
placeholder: placeholder,
|
|
383
390
|
showSearch: showSearch,
|
|
384
391
|
options: innerOptions,
|
|
385
392
|
mode: isMultiple ? 'multiple' : undefined,
|
|
386
393
|
bordered: false,
|
|
387
394
|
open: typeof _open === 'boolean' ? _open : isOpen,
|
|
388
395
|
disabled: mergedDisabled,
|
|
389
|
-
maxTagCount: 1,
|
|
396
|
+
maxTagCount: type === 'secondary' ? 'responsive' : 1,
|
|
390
397
|
ref: selectRef,
|
|
391
398
|
tagRender: tagRender || defaultTagRender,
|
|
392
399
|
onChange: onChange,
|
|
@@ -395,6 +402,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
395
402
|
className: classNames({
|
|
396
403
|
'ald-select-prefix-select': !!prefix || prefix === 0
|
|
397
404
|
}),
|
|
405
|
+
dropdownStyle: dropdownStyle || defaultDropdownStyle,
|
|
398
406
|
clearIcon: /*#__PURE__*/React.createElement(TimesLightLine, {
|
|
399
407
|
className: "ald-select-clear-icon",
|
|
400
408
|
color: "#9CA3AF"
|
|
@@ -406,7 +414,6 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
406
414
|
className: "ald-select-suffix-icon"
|
|
407
415
|
}),
|
|
408
416
|
onDropdownVisibleChange: function onDropdownVisibleChange(open) {
|
|
409
|
-
console.log(open, 'open');
|
|
410
417
|
setIsOpen(open);
|
|
411
418
|
if (!open) {
|
|
412
419
|
dropDownTimeRef.current = Date.now();
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@import './selectDropdown.less';
|
|
8
8
|
@import './option.less';
|
|
9
9
|
@import './layout.less';
|
|
10
|
+
@import './emptyShowAll.less';
|
|
10
11
|
|
|
11
12
|
.ald-select.ald-select {
|
|
12
13
|
display: inline-block;
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
cursor: pointer;
|
|
17
18
|
border-width: 1px;
|
|
18
19
|
border-style: solid;
|
|
19
|
-
min-width: 192px;
|
|
20
20
|
|
|
21
21
|
.ald-select-prefix {
|
|
22
22
|
color: var(--alias-colors-text-subtle, #4b5563);
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
.ant-select-selection-overflow-item {
|
|
72
72
|
align-items: center;
|
|
73
73
|
line-height: inherit;
|
|
74
|
-
flex: 1;
|
|
74
|
+
// flex: 1;
|
|
75
75
|
min-width: 0;
|
|
76
76
|
// height: 100%;
|
|
77
77
|
|
|
@@ -114,11 +114,6 @@
|
|
|
114
114
|
height: 16px;
|
|
115
115
|
padding: 0 var(--alias-spacing-50, 4px);
|
|
116
116
|
border-radius: var(--alias-radius-100, 8px);
|
|
117
|
-
background: var(
|
|
118
|
-
--alias-colors-bg-accent-blue-subtle-default,
|
|
119
|
-
#d4e7fd
|
|
120
|
-
);
|
|
121
|
-
color: var(--alias-colors-text-information, #0f59b1);
|
|
122
117
|
font-size: 12px;
|
|
123
118
|
}
|
|
124
119
|
}
|
|
@@ -134,6 +129,17 @@
|
|
|
134
129
|
white-space: nowrap;
|
|
135
130
|
text-overflow: ellipsis;
|
|
136
131
|
overflow: hidden;
|
|
132
|
+
// position: relative;;
|
|
133
|
+
|
|
134
|
+
&::before {
|
|
135
|
+
content: ',';
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:first-of-type {
|
|
140
|
+
.ald-select-multiple-tag-default::before {
|
|
141
|
+
content: '';
|
|
142
|
+
}
|
|
137
143
|
}
|
|
138
144
|
|
|
139
145
|
.ant-select-selection-search-input {
|
|
@@ -11,12 +11,28 @@
|
|
|
11
11
|
.ald-select.ald-select-primary {
|
|
12
12
|
.select-color(var(--alias-colors-border-accent-gray-subtle-default, #D1D5DB),var(--alias-colors-bg-skeleton-subtle, #F9FAFB),var(--alias-colors-text-default, #1f2937));
|
|
13
13
|
|
|
14
|
+
&.ald-select-multiple .ant-select {
|
|
15
|
+
.ant-select-selector {
|
|
16
|
+
color: var(--alias-colors-text-selected, #126fdd);
|
|
17
|
+
|
|
18
|
+
.ant-select-selection-overflow-item-rest {
|
|
19
|
+
.ant-select-selection-item-content {
|
|
20
|
+
background: var(
|
|
21
|
+
--alias-colors-bg-accent-blue-subtle-default,
|
|
22
|
+
#d4e7fd
|
|
23
|
+
);
|
|
24
|
+
color: var(--alias-colors-text-information, #0f59b1);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
14
30
|
&.ald-select-fitted {
|
|
15
31
|
.select-color(var(--alias-colors-border-accent-gray-subtle-default, #D1D5DB),var(--alias-colors-bg-skeleton-subtle, #F9FAFB),var(--alias-colors-text-default, #1f2937));
|
|
16
32
|
}
|
|
17
33
|
|
|
18
34
|
&:hover {
|
|
19
|
-
.select-color(var(--alias-colors-border-accent-gray-subtle-hover, #9ca3af),var(--alias-colors-bg-
|
|
35
|
+
.select-color(var(--alias-colors-border-accent-gray-subtle-hover, #9ca3af), var(--alias-colors-bg-accent-gray-subtler-default, #F9FAFB),var(--alias-colors-text-default, #1f2937));
|
|
20
36
|
}
|
|
21
37
|
|
|
22
38
|
&:active {
|
|
@@ -56,6 +72,17 @@
|
|
|
56
72
|
&.ald-select-secondary {
|
|
57
73
|
.select-color(var(--alias-colors-border-accent-gray-subtle-default, #D1D5DB),var(--alias-colors-bg-skeleton-subtler, #FFF),var(--alias-colors-text-default, #1f2937));
|
|
58
74
|
|
|
75
|
+
&.ald-select-multiple .ant-select {
|
|
76
|
+
.ant-select-selector {
|
|
77
|
+
.ant-select-selection-overflow-item-rest {
|
|
78
|
+
.ant-select-selection-item-content {
|
|
79
|
+
background: transparent;
|
|
80
|
+
color: var(--alias-colors-text-subtle, #4b5563);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
59
86
|
&.ald-select-fitted {
|
|
60
87
|
.select-color(var(--alias-colors-border-accent-gray-subtle-default, #D1D5DB),var(--alias-colors-bg-skeleton-subtler, #FFF),var(--alias-colors-text-default, #1f2937));
|
|
61
88
|
}
|
package/dist/Tree/Tree.d.ts
CHANGED
|
@@ -131,6 +131,7 @@ export interface TreeProps<T extends BasicDataNode = DataNode> extends Omit<RcTr
|
|
|
131
131
|
titleRender?: (node: T) => React.ReactNode;
|
|
132
132
|
showTabLeader?: boolean;
|
|
133
133
|
handlerRender?: (node: T) => React.ReactNode;
|
|
134
|
+
highlightFilteredTitle?: boolean;
|
|
134
135
|
}
|
|
135
136
|
declare const Tree: React.ForwardRefExoticComponent<TreeProps<DataNode> & React.RefAttributes<RcTree<DataNode>>>;
|
|
136
137
|
export default Tree;
|
package/dist/Tree/Tree.js
CHANGED
|
@@ -9,16 +9,16 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
9
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
10
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
11
|
import classNames from 'classnames';
|
|
12
|
-
import { noop } from 'lodash';
|
|
12
|
+
import { cloneDeep, noop } from 'lodash';
|
|
13
13
|
import RcTree from 'rc-tree';
|
|
14
14
|
import * as React from 'react';
|
|
15
15
|
import { ConfigContext } from "../ConfigProvider";
|
|
16
|
-
import {
|
|
16
|
+
import { ArrowRightLightLine, DragLine } from "../Icon";
|
|
17
17
|
import collapseMotion from "../_utils/motion";
|
|
18
18
|
import dropIndicatorRender from "./utils/dropIndicator";
|
|
19
19
|
import renderSwitcherIcon from "./utils/iconUtil";
|
|
20
|
-
var TREE_SWITCH_LARGE_ICON_SIZE = 20;
|
|
21
20
|
var TREE_SWITCH_CION_SIZE = 16;
|
|
21
|
+
var NODE_DISABLE_CLASS_NAME = 'ald-tree-node-disabled';
|
|
22
22
|
|
|
23
23
|
// [Legacy] Compatible for v3
|
|
24
24
|
|
|
@@ -47,6 +47,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
47
47
|
handlerRender = _props$handlerRender === void 0 ? noop : _props$handlerRender,
|
|
48
48
|
filterTreeNode = props.filterTreeNode,
|
|
49
49
|
treeData = props.treeData,
|
|
50
|
+
highlightFilteredTitle = props.highlightFilteredTitle,
|
|
50
51
|
_props$motion = props.motion,
|
|
51
52
|
motion = _props$motion === void 0 ? _objectSpread(_objectSpread({}, collapseMotion), {}, {
|
|
52
53
|
motionAppear: false
|
|
@@ -100,7 +101,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
100
101
|
keyEntities = nodeProps.context.keyEntities,
|
|
101
102
|
isLeaf = nodeProps.isLeaf;
|
|
102
103
|
var level = ((_keyEntities = keyEntities[eventKey]) === null || _keyEntities === void 0 ? void 0 : _keyEntities.level) || 0;
|
|
103
|
-
var iconSize =
|
|
104
|
+
var iconSize = TREE_SWITCH_CION_SIZE;
|
|
104
105
|
var indentWidth = isLeaf ? iconSize : 0;
|
|
105
106
|
indentWidth += level * (iconSize / 2);
|
|
106
107
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -112,51 +113,46 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
112
113
|
};
|
|
113
114
|
var newTreeData = React.useMemo(function () {
|
|
114
115
|
if (!filterTreeNode) return treeData;
|
|
115
|
-
var
|
|
116
|
-
|
|
116
|
+
var treeDataClone = cloneDeep(treeData);
|
|
117
|
+
var shouldNodeDisabled = function shouldNodeDisabled(node) {
|
|
118
|
+
// 初始化一个标志来表示是否需要为当前节点添加className
|
|
117
119
|
var shouldAddDisabled = true;
|
|
118
|
-
// 检查当前节点的title是否包含目标字符串,包含则不需要添加className
|
|
119
120
|
if (filterTreeNode(node)) {
|
|
120
121
|
shouldAddDisabled = false;
|
|
121
122
|
}
|
|
122
123
|
if (node.children) {
|
|
123
|
-
//
|
|
124
|
-
var
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var child = _step.value;
|
|
129
|
-
// 递归调用processNode函数来处理子节点,判断子节点是否需要添加className
|
|
130
|
-
var childShouldAddDisabled = processNode(child);
|
|
131
|
-
shouldAddDisabled = shouldAddDisabled && childShouldAddDisabled;
|
|
132
|
-
}
|
|
133
|
-
} catch (err) {
|
|
134
|
-
_iterator.e(err);
|
|
135
|
-
} finally {
|
|
136
|
-
_iterator.f();
|
|
137
|
-
}
|
|
124
|
+
// 遍历当前节点的子节点,只要有一个子节点不disable,则该不需要添加className
|
|
125
|
+
var allChildrenShouldAddDisabled = node.children.reduce(function (pre, child) {
|
|
126
|
+
return shouldNodeDisabled(child) && pre;
|
|
127
|
+
}, shouldAddDisabled);
|
|
128
|
+
shouldAddDisabled = allChildrenShouldAddDisabled;
|
|
138
129
|
}
|
|
139
130
|
|
|
140
131
|
// 如果shouldAddDisabled为true,就为当前节点添加className
|
|
141
132
|
if (shouldAddDisabled) {
|
|
142
|
-
|
|
133
|
+
var _node$className;
|
|
134
|
+
node.className = (_node$className = node.className) !== null && _node$className !== void 0 && _node$className.includes(NODE_DISABLE_CLASS_NAME) ? node.className : classNames(node.className, NODE_DISABLE_CLASS_NAME);
|
|
135
|
+
} else {
|
|
136
|
+
var _node$className2;
|
|
137
|
+
var reg = /ald-tree-node-disabled/g;
|
|
138
|
+
(_node$className2 = node.className) === null || _node$className2 === void 0 ? void 0 : _node$className2.replace(reg, ' ');
|
|
143
139
|
}
|
|
144
140
|
return shouldAddDisabled;
|
|
145
141
|
};
|
|
146
|
-
if (!
|
|
147
|
-
var
|
|
148
|
-
|
|
142
|
+
if (!treeDataClone) return treeDataClone;
|
|
143
|
+
var _iterator = _createForOfIteratorHelper(treeDataClone),
|
|
144
|
+
_step;
|
|
149
145
|
try {
|
|
150
|
-
for (
|
|
151
|
-
var rootNode =
|
|
152
|
-
|
|
146
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
147
|
+
var rootNode = _step.value;
|
|
148
|
+
shouldNodeDisabled(rootNode);
|
|
153
149
|
}
|
|
154
150
|
} catch (err) {
|
|
155
|
-
|
|
151
|
+
_iterator.e(err);
|
|
156
152
|
} finally {
|
|
157
|
-
|
|
153
|
+
_iterator.f();
|
|
158
154
|
}
|
|
159
|
-
return
|
|
155
|
+
return treeDataClone;
|
|
160
156
|
}, [filterTreeNode, treeData]);
|
|
161
157
|
var noChildren = React.useMemo(function () {
|
|
162
158
|
if (newTreeData !== null && newTreeData !== void 0 && newTreeData.length) {
|
|
@@ -174,7 +170,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
174
170
|
}, newProps, {
|
|
175
171
|
prefixCls: prefixCls,
|
|
176
172
|
treeData: newTreeData,
|
|
177
|
-
className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-icon-hide"), !showIcon), _defineProperty(_classNames, "".concat(prefixCls, "-block-node"), blockNode), _defineProperty(_classNames, "".concat(prefixCls, "-unselectable"), !selectable), _defineProperty(_classNames, "".concat(prefixCls, "-large"), size === 'large'), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _defineProperty(_classNames, 'ald-draggable-tree', draggable), _defineProperty(_classNames, "".concat(prefixCls, "-no-children"), noChildren), _classNames), className),
|
|
173
|
+
className: classNames((_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-icon-hide"), !showIcon), _defineProperty(_classNames, "".concat(prefixCls, "-block-node"), blockNode), _defineProperty(_classNames, "".concat(prefixCls, "-unselectable"), !selectable), _defineProperty(_classNames, "".concat(prefixCls, "-large"), size === 'large'), _defineProperty(_classNames, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _defineProperty(_classNames, 'ald-draggable-tree', draggable), _defineProperty(_classNames, "".concat(prefixCls, "-no-children"), noChildren), _defineProperty(_classNames, 'ald-tree-highlight-filtered-title', highlightFilteredTitle), _classNames), className),
|
|
178
174
|
direction: direction,
|
|
179
175
|
checkable: checkable ? /*#__PURE__*/React.createElement("span", {
|
|
180
176
|
className: "".concat(prefixCls, "-checkbox-inner")
|
|
@@ -183,10 +179,10 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
183
179
|
// @ts-ignore
|
|
184
180
|
,
|
|
185
181
|
switcherIcon: function switcherIcon(nodeProps) {
|
|
186
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, renderIndent(nodeProps), renderSwitcherIcon(prefixCls, /*#__PURE__*/React.createElement(
|
|
187
|
-
size:
|
|
182
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderIndent(nodeProps), renderSwitcherIcon(prefixCls, /*#__PURE__*/React.createElement(ArrowRightLightLine, {
|
|
183
|
+
size: TREE_SWITCH_CION_SIZE,
|
|
188
184
|
color: '#9CA3AF'
|
|
189
|
-
}, "\u5C55\u5F00"), showLine, nodeProps,
|
|
185
|
+
}, "\u5C55\u5F00"), showLine, nodeProps, TREE_SWITCH_CION_SIZE));
|
|
190
186
|
},
|
|
191
187
|
draggable: draggableConfig
|
|
192
188
|
}), children);
|