@aloudata/aloudata-design 2.0.0-beta.14 → 2.0.0-beta.15

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.
@@ -118,8 +118,8 @@
118
118
  }
119
119
 
120
120
  .ant-checkbox-inner {
121
- width: 16px;
122
- height: 16px;
121
+ width: 14px;
122
+ height: 14px;
123
123
  background-color: @checkbox-inner-bgc-normal;
124
124
  border-color: @checkbox-border-color-normal;
125
125
  border-radius: 2px;
@@ -20,6 +20,7 @@ var AldCustomConfigProvider = function AldCustomConfigProvider(props) {
20
20
  }, children);
21
21
  }
22
22
  return /*#__PURE__*/React.createElement(ConfigProvider, _extends({
23
+ autoInsertSpaceInButton: false,
23
24
  theme: {
24
25
  token: {
25
26
  fontFamily: "Inter,'PingFang SC', system-ui, -apple-system, blinkmacsystemfont,\n 'Helvetica Neue', 'Segoe UI', helvetica, arial, 'Microsoft YaHei',\n 'WenQuanYi Micro Hei', sans-serif;"
@@ -38,12 +38,12 @@
38
38
  padding: 4px 13px 3px 20px;
39
39
  height: 100%;
40
40
  width: 100%;
41
- line-height: 20px;
41
+ line-height: 25px;
42
42
  background: var(--alias-colors-bg-skeleton-subtle, #f9fafb);
43
43
 
44
44
  .ald-data-preview-header-left {
45
45
  width: 20px;
46
- height: 20px;
46
+ height: 100%;
47
47
  display: flex;
48
48
  align-items: center;
49
49
  justify-content: center;
@@ -52,6 +52,8 @@
52
52
  left: 4px;
53
53
  z-index: 1;
54
54
  color: #575757;
55
+ top: 0;
56
+ bottom: 0;
55
57
  // background:rgb(0 0 0 / 0%)
56
58
  }
57
59
 
@@ -1,2 +1,3 @@
1
1
  import '../../style';
2
+ import '../../Tooltip/style/index';
2
3
  import './index.less';
@@ -1,2 +1,3 @@
1
1
  import "../../style";
2
+ import "../../Tooltip/style/index";
2
3
  import "./index.less";
@@ -191,6 +191,11 @@ var Component = function Component(_ref) {
191
191
  setDropdownOpen(open);
192
192
  onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(open);
193
193
  }, [onOpenChange]);
194
+ var panelKey = useMemo(function () {
195
+ if (dropdownOpen) {
196
+ return _.sampleSize('abcdefghijklmnopqrstuvwxyz0123456789', 8).join('');
197
+ }
198
+ }, [dropdownOpen]);
194
199
  return /*#__PURE__*/React.createElement(Select, _extends({
195
200
  prefix: propPrefix
196
201
  }, restProps, {
@@ -252,6 +257,7 @@ var Component = function Component(_ref) {
252
257
  dataList: totalUserList,
253
258
  lockedIds: lockedIds,
254
259
  multiple: multiple,
260
+ key: panelKey,
255
261
  loading: loading,
256
262
  dropdownWidth: dropdownContentWidth,
257
263
  onSearchValueChange: onSearchValueChange,
@@ -9,7 +9,6 @@ import _ from 'lodash';
9
9
  import React, { useContext, useEffect, useRef } from 'react';
10
10
  import { getUUID } from "../../../_utils/hooks/useId";
11
11
  import { RadioGroupContext } from "../Group";
12
- var FILL_BUTTON_MARGIN = 4;
13
12
  export default function Radio(props) {
14
13
  var groupContext = useContext(RadioGroupContext);
15
14
  var labelRef = useRef(null);
@@ -63,8 +62,8 @@ export default function Radio(props) {
63
62
  useEffect(function () {
64
63
  var _groupContext$sliderR;
65
64
  if (radioProps.checked && groupContext !== null && groupContext !== void 0 && (_groupContext$sliderR = groupContext.sliderRef) !== null && _groupContext$sliderR !== void 0 && _groupContext$sliderR.current && labelRef !== null && labelRef !== void 0 && labelRef.current) {
66
- groupContext.sliderRef.current.style.left = "".concat(labelRef.current.offsetLeft, "px");
67
- groupContext.sliderRef.current.style.width = "".concat(labelRef.current.offsetWidth - FILL_BUTTON_MARGIN, "px");
65
+ groupContext.sliderRef.current.style.left = "".concat(labelRef.current.offsetLeft - 2, "px");
66
+ groupContext.sliderRef.current.style.width = "".concat(labelRef.current.offsetWidth, "px");
68
67
  }
69
68
  }, [groupContext.sliderRef, radioProps.checked]);
70
69
  var onChange = function onChange() {
@@ -90,6 +89,29 @@ export default function Radio(props) {
90
89
  }), /*#__PURE__*/React.createElement("span", {
91
90
  className: "ald-radio-inner"
92
91
  })), /*#__PURE__*/React.createElement("span", {
93
- className: "ald-radio-desc"
92
+ className: "ald-radio-desc",
93
+ onMouseEnter: function onMouseEnter() {
94
+ if (radioProps.checked) {
95
+ var _groupContext$sliderR2, _groupContext$sliderR3;
96
+ (_groupContext$sliderR2 = groupContext.sliderRef) === null || _groupContext$sliderR2 === void 0 ? void 0 : (_groupContext$sliderR3 = _groupContext$sliderR2.current) === null || _groupContext$sliderR3 === void 0 ? void 0 : _groupContext$sliderR3.classList.add('ald-radio-fill-slider-hover');
97
+ }
98
+ },
99
+ onMouseLeave: function onMouseLeave() {
100
+ if (radioProps.checked) {
101
+ var _groupContext$sliderR4, _groupContext$sliderR5, _groupContext$sliderR6, _groupContext$sliderR7;
102
+ (_groupContext$sliderR4 = groupContext.sliderRef) === null || _groupContext$sliderR4 === void 0 ? void 0 : (_groupContext$sliderR5 = _groupContext$sliderR4.current) === null || _groupContext$sliderR5 === void 0 ? void 0 : _groupContext$sliderR5.classList.remove('ald-radio-fill-slider-hover');
103
+ (_groupContext$sliderR6 = groupContext.sliderRef) === null || _groupContext$sliderR6 === void 0 ? void 0 : (_groupContext$sliderR7 = _groupContext$sliderR6.current) === null || _groupContext$sliderR7 === void 0 ? void 0 : _groupContext$sliderR7.classList.remove('ald-radio-fill-slider-active');
104
+ }
105
+ },
106
+ onMouseDown: function onMouseDown() {
107
+ if (radioProps.checked) {
108
+ var _groupContext$sliderR8, _groupContext$sliderR9;
109
+ (_groupContext$sliderR8 = groupContext.sliderRef) === null || _groupContext$sliderR8 === void 0 ? void 0 : (_groupContext$sliderR9 = _groupContext$sliderR8.current) === null || _groupContext$sliderR9 === void 0 ? void 0 : _groupContext$sliderR9.classList.add('ald-radio-fill-slider-active');
110
+ }
111
+ },
112
+ onMouseUp: function onMouseUp() {
113
+ var _groupContext$sliderR10, _groupContext$sliderR11;
114
+ if (radioProps.checked) (_groupContext$sliderR10 = groupContext.sliderRef) === null || _groupContext$sliderR10 === void 0 ? void 0 : (_groupContext$sliderR11 = _groupContext$sliderR10.current) === null || _groupContext$sliderR11 === void 0 ? void 0 : _groupContext$sliderR11.classList.remove('ald-radio-fill-slider-active');
115
+ }
94
116
  }, props.children));
95
117
  }
@@ -183,12 +183,17 @@
183
183
  // transition: width, left, height 0.3s, 0.3s, 0.3s ease;
184
184
  cursor: pointer;
185
185
 
186
- &:hover {
186
+ &:hover,
187
+ &.ald-radio-fill-slider-hover {
188
+ border-radius: var(--alias-radius-75, 6px);
187
189
  border: 1px solid
188
190
  var(--alias-colors-border-accent-gray-subtle-hover, #9ca3af);
191
+ background: var(--alias-colors-bg-skeleton-subtler, #fff);
189
192
  }
190
193
 
191
- &:active {
194
+ &:active,
195
+ &.ald-radio-fill-slider-active {
196
+ border-radius: var(--alias-radius-75, 6px);
192
197
  border: 1px solid
193
198
  var(--alias-colors-border-accent-gray-subtle-default, #d1d5db);
194
199
  background: var(--alias-colors-bg-skeleton-subtle, #f9fafb);
@@ -202,7 +207,6 @@
202
207
  align-items: flex-start;
203
208
  box-sizing: border-box;
204
209
  width: min-content;
205
- width: auto;
206
210
  padding: 0;
207
211
  overflow: hidden;
208
212
 
@@ -368,6 +372,11 @@
368
372
  // 各种大小
369
373
  &.ald-radio-group-middle {
370
374
  height: @radio-group-height-middle;
375
+ border-radius: @border-radius-middle;
376
+
377
+ .ald-radio-filled-slider {
378
+ border-radius: var(--alias-radius-50, 4px);
379
+ }
371
380
 
372
381
  .ald-radio-label {
373
382
  .ald-radio-desc {
@@ -375,6 +384,12 @@
375
384
  }
376
385
  }
377
386
 
387
+ .ald-radio-label.ald-radio-button-wrapper-filled {
388
+ height: 28px;
389
+ border-radius: @border-radius-middle;
390
+ margin-top: 2px;
391
+ }
392
+
378
393
  .ald-radio-icon-button-wrapper-filled,
379
394
  .ald-radio-icon-button-wrapper-filter {
380
395
  padding: 0 @radio-icon-button-padding-middle;
@@ -409,6 +424,11 @@
409
424
 
410
425
  &.ald-radio-group-small {
411
426
  height: @radio-group-height-small;
427
+ border-radius: @border-radius-small;
428
+
429
+ .ald-radio-filled-slider {
430
+ border-radius: var(--alias-radius-25, 2px);
431
+ }
412
432
 
413
433
  .ald-radio-label {
414
434
  .ald-radio-desc {
@@ -416,6 +436,12 @@
416
436
  }
417
437
  }
418
438
 
439
+ .ald-radio-label.ald-radio-button-wrapper-filled {
440
+ height: 24px;
441
+ margin-top: 2px;
442
+ border-radius: @border-radius-small;
443
+ }
444
+
419
445
  .ald-radio-icon-button-wrapper-filled,
420
446
  .ald-radio-icon-button-wrapper-filter {
421
447
  padding: 0 @radio-icon-button-padding-small;
@@ -469,6 +495,17 @@
469
495
 
470
496
  &.ald-radio-group.ald-radio-group-large {
471
497
  height: @radio-group-height-large;
498
+ border-radius: @border-radius-large;
499
+
500
+ .ald-radio-filled-slider {
501
+ border-radius: var(--alias-radius-75, 6px);
502
+ }
503
+
504
+ .ald-radio-label.ald-radio-button-wrapper-filled {
505
+ height: 32px;
506
+ margin-top: 2px;
507
+ border-radius: @border-radius-large!important;
508
+ }
472
509
 
473
510
  .ald-radio-label {
474
511
  .ald-radio-desc {
@@ -527,3 +564,20 @@
527
564
  }
528
565
  }
529
566
  }
567
+
568
+ .ald-radio-group-filled {
569
+ display: flex;
570
+ gap: 2px;
571
+ background: var(--alias-colors-bg-skeleton-strong, #f3f4f6);
572
+ padding: 0 2px;
573
+
574
+ .ald-radio-label:not(.ald-radio-wrapper-disabled) {
575
+ &:hover {
576
+ background: var(--alias-colors-bg-interaction-hover, rgba(0, 0, 0, 0.05));
577
+ }
578
+
579
+ &:active {
580
+ background: var(--alias-colors-bg-interaction-press, rgba(0, 0, 0, 0.1));
581
+ }
582
+ }
583
+ }
@@ -34,6 +34,10 @@
34
34
  &.ald-select-prefix-multiple {
35
35
  cursor: default;
36
36
  }
37
+
38
+ .ant-select-selection-overflow {
39
+ margin-left: 6px;
40
+ }
37
41
  }
38
42
 
39
43
  .ant-select {
@@ -64,7 +68,6 @@
64
68
  .ant-select-selection-overflow {
65
69
  align-self: normal;
66
70
  flex-wrap: nowrap;
67
- margin-left: 6px;
68
71
  min-width: 52px;
69
72
  height: 100%;
70
73
 
@@ -1,25 +1,25 @@
1
1
  @import '../../style/index.less';
2
2
 
3
- .ald-tooltip-overlay.ald-tooltip-overlay {
3
+ .ant-tooltip.ant-tooltip {
4
4
  .ant-tooltip-inner {
5
5
  padding: 6px 8px;
6
6
  line-height: 16px;
7
- background: @BG10;
8
- border-radius: 2px;
7
+ background: var(--alias-colors-bg-skeleton-inverse-subtler, #111827);
8
+ border-radius: var(--alias-radius-50, 4px);
9
9
  box-shadow: none;
10
- color: @ND0;
11
10
  font-weight: 400;
12
11
  font-size: 12px;
13
12
  min-height: 28px;
13
+ color: var(--alias-colors-text-inverse-strong, #fff);
14
14
  }
15
15
 
16
16
  .ant-tooltip-arrow {
17
17
  &::before {
18
- background-color: @BG10;
18
+ background: var(--alias-colors-bg-skeleton-inverse-subtler, #111827);
19
19
  }
20
20
  }
21
21
 
22
22
  .ant-tooltip-arrow-content {
23
- background: @BG10;
23
+ background: var(--alias-colors-bg-skeleton-inverse-subtler, #111827);
24
24
  }
25
25
  }
package/dist/Tree/Tree.js CHANGED
@@ -1,3 +1,4 @@
1
+ var _excluded = ["className", "showIcon", "showLine", "blockNode", "children", "checkable", "selectable", "draggable", "titleRender", "showTabLeader", "handlerRender", "filterTreeNode", "treeData", "highlightFilteredTitle", "motion"];
1
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); }
2
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(_e) { throw _e; }, 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(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3
4
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -8,8 +9,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
8
9
  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; }
9
10
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
11
  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); }
12
+ 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; }
13
+ 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; }
11
14
  import classNames from 'classnames';
12
- import { cloneDeep, noop } from 'lodash';
15
+ import { produce } from 'immer';
16
+ import { noop } from 'lodash';
13
17
  import RcTree from 'rc-tree';
14
18
  import * as React from 'react';
15
19
  import { ConfigContext } from "../ConfigProvider";
@@ -51,14 +55,15 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
51
55
  _props$motion = props.motion,
52
56
  motion = _props$motion === void 0 ? _objectSpread(_objectSpread({}, collapseMotion), {}, {
53
57
  motionAppear: false
54
- }) : _props$motion;
58
+ }) : _props$motion,
59
+ rest = _objectWithoutProperties(props, _excluded);
55
60
  var prefixCls = getPrefixCls('tree', 'ald-tree');
56
61
  var customTitleRender = React.useCallback(function (node) {
57
62
  return /*#__PURE__*/React.createElement(React.Fragment, null, titleRender ? titleRender(node) : node.title, showTabLeader && /*#__PURE__*/React.createElement("div", {
58
63
  className: "ald-tree-tab-leader"
59
64
  }), handlerRender && handlerRender(node));
60
65
  }, [titleRender, showTabLeader, handlerRender]);
61
- var newProps = _objectSpread(_objectSpread({}, props), {}, {
66
+ var newProps = _objectSpread(_objectSpread({}, rest), {}, {
62
67
  checkable: checkable,
63
68
  selectable: selectable,
64
69
  showIcon: showIcon,
@@ -112,8 +117,7 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
112
117
  });
113
118
  };
114
119
  var newTreeData = React.useMemo(function () {
115
- if (!filterTreeNode) return treeData;
116
- var treeDataClone = cloneDeep(treeData);
120
+ if (!filterTreeNode || !treeData) return treeData;
117
121
  var shouldNodeDisabled = function shouldNodeDisabled(node) {
118
122
  // 初始化一个标志来表示是否需要为当前节点添加className
119
123
  var shouldAddDisabled = true;
@@ -139,20 +143,21 @@ var Tree = /*#__PURE__*/React.forwardRef(function (props, ref) {
139
143
  }
140
144
  return shouldAddDisabled;
141
145
  };
142
- if (!treeDataClone) return treeDataClone;
143
- var _iterator = _createForOfIteratorHelper(treeDataClone),
144
- _step;
145
- try {
146
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
147
- var rootNode = _step.value;
148
- shouldNodeDisabled(rootNode);
146
+ var newTreeData = produce(treeData, function (draft) {
147
+ var _iterator = _createForOfIteratorHelper(draft),
148
+ _step;
149
+ try {
150
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
151
+ var rootNode = _step.value;
152
+ shouldNodeDisabled(rootNode);
153
+ }
154
+ } catch (err) {
155
+ _iterator.e(err);
156
+ } finally {
157
+ _iterator.f();
149
158
  }
150
- } catch (err) {
151
- _iterator.e(err);
152
- } finally {
153
- _iterator.f();
154
- }
155
- return treeDataClone;
159
+ });
160
+ return newTreeData;
156
161
  }, [filterTreeNode, treeData]);
157
162
  var noChildren = React.useMemo(function () {
158
163
  if (newTreeData !== null && newTreeData !== void 0 && newTreeData.length) {
@@ -60,5 +60,46 @@ export default (function () {
60
60
  }]
61
61
  }]
62
62
  }]
63
+ }), /*#__PURE__*/React.createElement("p", null), /*#__PURE__*/React.createElement(Tree, {
64
+ size: "large",
65
+ showIcon: true,
66
+ icon: 'icon',
67
+ filterTreeNode: function filterTreeNode(node) {
68
+ var title = node.title;
69
+ if (typeof title === 'string') {
70
+ return title.includes('2');
71
+ }
72
+ return false;
73
+ },
74
+ highlightFilteredTitle: true,
75
+ expandedKeys: expandedKeys,
76
+ onExpand: function onExpand(keys) {
77
+ setExpandedKeys(keys);
78
+ },
79
+ treeData: [{
80
+ title: 'Parent 1',
81
+ key: '0-0',
82
+ children: [{
83
+ title: 'parent 1-0',
84
+ key: '0-0-0',
85
+ children: [{
86
+ title: 'leaf',
87
+ key: '0-0-0-0',
88
+ isLeaf: true
89
+ }, {
90
+ title: 'leaf',
91
+ key: '0-0-0-1',
92
+ isLeaf: true
93
+ }]
94
+ }, {
95
+ title: 'parent 1-1',
96
+ key: '0-0-1',
97
+ children: [{
98
+ title: 'ssss',
99
+ key: '0-0-1-0',
100
+ disabled: true
101
+ }]
102
+ }]
103
+ }]
63
104
  }));
64
105
  });