@aloudata/aloudata-design 2.13.5 → 2.13.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.
@@ -38,26 +38,27 @@
38
38
  transition: background 0.3s;
39
39
 
40
40
  &:hover {
41
- background: var(--alias-colors-bg-interaction-hover, rgba(0, 0, 0, 0.05));
41
+ background: rgba(31, 41, 55, 0.1);
42
42
  }
43
43
 
44
44
  &.ald-icon-button-focus {
45
- background: var(--alias-colors-bg-interaction-hover, rgba(0, 0, 0, 0.05));
45
+ background: rgba(31, 41, 55, 0.1);
46
46
  }
47
47
 
48
48
  &.ant-dropdown-open {
49
- background: var(--alias-colors-bg-interaction-hover, rgba(0, 0, 0, 0.05));
49
+ background: rgba(31, 41, 55, 0.1);
50
50
  }
51
51
 
52
52
  &:active {
53
53
  // mouse down
54
- background: var(--alias-colors-bg-interaction-press, rgba(0, 0, 0, 0.1));
54
+ background: rgba(31, 41, 55, 0.05);
55
55
  }
56
56
 
57
57
  &-disabled {
58
58
  color: var(--alias-colors-icon-disabled, rgba(0, 0, 0, 0.25));
59
59
  cursor: default;
60
60
  background-color: var(--alias-colors-bg-transp, rgba(0, 0, 0, 0));
61
+ opacity: 0.5;
61
62
 
62
63
  .ald-icon {
63
64
  color: var(--alias-colors-icon-disabled, rgba(0, 0, 0, 0.25));
@@ -76,33 +77,20 @@
76
77
  }
77
78
 
78
79
  &.ald-icon-button-dark {
79
- color: var(--alias-colors-icon-inverse-subtle, rgba(0, 0, 0, 0.55));
80
+ color: var(--alias-colors-text-inverse-default, rgba(255, 255, 255, 0.88));
80
81
 
81
82
  &:hover {
82
- background: var(
83
- --alias-colors-bg-interaction-inverse-hover,
84
- rgba(255, 255, 255, 0.1)
85
- );
83
+ background: rgba(255, 255, 255, 0.1);
86
84
  }
87
85
 
88
86
  &.ant-dropdown-open {
89
- background: var(
90
- --alias-colors-bg-interaction-inverse-hover,
91
- rgba(255, 255, 255, 0.1)
92
- );
87
+ background: rgba(255, 255, 255, 0.1);
93
88
  }
94
89
 
95
90
  &:active {
96
- background: var(
97
- --alias-colors-bg-interaction-inverse-press,
98
- rgba(255, 255, 255, 0.15)
99
- );
91
+ background: rgba(255, 255, 255, 0.05);
100
92
  }
101
93
  }
102
-
103
- &:not(.ald-icon-button-dark) {
104
- mix-blend-mode: multiply;
105
- }
106
94
  }
107
95
 
108
96
  .ald-icon-button-wrap-content(@size) {
@@ -25,7 +25,9 @@ export default function SingleOption(params) {
25
25
  showUserId = params.showUserId;
26
26
  var onClick = function onClick() {
27
27
  if (disabled) return;
28
- onChange === null || onChange === void 0 ? void 0 : onChange(!selected, user);
28
+ if (selected) {
29
+ onChange === null || onChange === void 0 ? void 0 : onChange(selected, user);
30
+ } else onChange === null || onChange === void 0 ? void 0 : onChange(!selected, user);
29
31
  };
30
32
  return /*#__PURE__*/React.createElement("div", {
31
33
  className: classnames('ald-member-picker-option', className, _defineProperty({}, 'ald-member-picker-option-disabled', disabled)),
@@ -79,6 +79,10 @@
79
79
  }
80
80
  }
81
81
 
82
+ .ald-member-picker-breadcrumb-scroll + .ald-member-picker-member-list {
83
+ height: 260px;
84
+ }
85
+
82
86
  .ald-member-picker-selected-member-tags-wrap {
83
87
  width: 50%;
84
88
  max-height: 377px;
@@ -1,6 +1,6 @@
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
2
  var _excluded = ["className", "type", "loading", "size", "disabled", "shape"],
3
- _excluded2 = ["className", "children", "okType", "width", "closeIcon", "subTitle", "okButtonProps", "cancelButtonProps", "okText", "cancelText", "icon", "title", "paddingLess", "responsiveBounds", "hideHeaderBottomBorder", "virtualScrollBar", "style"],
3
+ _excluded2 = ["className", "children", "okType", "width", "closeIcon", "subTitle", "okButtonProps", "cancelButtonProps", "okText", "cancelText", "icon", "title", "paddingLess", "responsiveBounds", "hideHeaderBottomBorder", "virtualScrollBar", "style", "maskClosable"],
4
4
  _excluded3 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
5
5
  _excluded4 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
6
6
  _excluded5 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
@@ -114,6 +114,8 @@ var OriginModal = function OriginModal(props) {
114
114
  hideHeaderBottomBorder = props.hideHeaderBottomBorder,
115
115
  virtualScrollBar = props.virtualScrollBar,
116
116
  style = props.style,
117
+ _props$maskClosable = props.maskClosable,
118
+ maskClosable = _props$maskClosable === void 0 ? false : _props$maskClosable,
117
119
  restProps = _objectWithoutProperties(props, _excluded2);
118
120
  var responsiveBoundsStyle = useMemo(function () {
119
121
  if (!responsiveBounds) {
@@ -158,6 +160,7 @@ var OriginModal = function OriginModal(props) {
158
160
  cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary'),
159
161
  okText: okText,
160
162
  cancelText: cancelText,
163
+ maskClosable: maskClosable,
161
164
  closeIcon: closeIcon || /*#__PURE__*/React.createElement(IconButton, {
162
165
  icon: /*#__PURE__*/React.createElement(CloseLLine, {
163
166
  size: 20
@@ -36,20 +36,35 @@ var defaultDropdownStyle = {
36
36
  minWidth: 192
37
37
  };
38
38
  var DEFAULT_LIST_ITEM_HEIGHT = 36;
39
- var getSelectedOptionsFromValue = function getSelectedOptionsFromValue(isMultiple, options, value, defaultValue) {
40
- if (typeof value !== 'undefined') {
39
+ var getSelectedOptionsFromValue = function getSelectedOptionsFromValue(isMultiple, options, value, defaultValue, prevSelectOptions) {
40
+ if (typeof value !== 'undefined' || prevSelectOptions !== null && prevSelectOptions !== void 0 && prevSelectOptions.length) {
41
41
  if (isMultiple) {
42
42
  if (Array.isArray(value)) {
43
- var newOptions = options === null || options === void 0 ? void 0 : options.filter(function (option) {
44
- return value.includes(option.value);
43
+ var _newOptions = [];
44
+ value.forEach(function (currentValue) {
45
+ var newOption = options === null || options === void 0 ? void 0 : options.find(function (option) {
46
+ return option.value === currentValue;
47
+ });
48
+ if (newOption) {
49
+ _newOptions.push(newOption);
50
+ } else {
51
+ var prevOption = prevSelectOptions === null || prevSelectOptions === void 0 ? void 0 : prevSelectOptions.find(function (option) {
52
+ return option.value === currentValue;
53
+ });
54
+ if (prevOption) {
55
+ _newOptions.push(prevOption);
56
+ }
57
+ }
45
58
  });
46
- return newOptions || [];
59
+ return _newOptions;
60
+ } else {
61
+ return prevSelectOptions || [];
47
62
  }
48
63
  } else {
49
- var _newOptions = options === null || options === void 0 ? void 0 : options.filter(function (option) {
64
+ var newOptions = options === null || options === void 0 ? void 0 : options.filter(function (option) {
50
65
  return option.value === value;
51
66
  });
52
- return _newOptions || [];
67
+ return newOptions || [];
53
68
  }
54
69
  return [];
55
70
  }
@@ -116,6 +131,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
116
131
  restProps = _objectWithoutProperties(props, _excluded);
117
132
  var placeholder = type === 'primary' ? t.Select.all : propsPlaceholder;
118
133
  var contentSize = useContext(SizeContext);
134
+ var defaultValueRef = React.useRef(defaultValue);
119
135
  var _React$useContext = React.useContext(ConfigContext),
120
136
  getPrefixCls = _React$useContext.getPrefixCls,
121
137
  direction = _React$useContext.direction;
@@ -137,7 +153,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
137
153
  var isMultiple = mode === 'multiple';
138
154
  var listItemHeight = typeof props.listItemHeight === 'number' ? props.listItemHeight : DEFAULT_LIST_ITEM_HEIGHT;
139
155
  var innerOptions = options;
140
- var _React$useState = React.useState(getSelectedOptionsFromValue(isMultiple, innerOptions, value, defaultValue)),
156
+ var _React$useState = React.useState(getSelectedOptionsFromValue(isMultiple, innerOptions, value, defaultValueRef.current)),
141
157
  _React$useState2 = _slicedToArray(_React$useState, 2),
142
158
  selectedOptions = _React$useState2[0],
143
159
  setSelectedOptions = _React$useState2[1];
@@ -365,11 +381,13 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
365
381
  };
366
382
  useEffect(function () {
367
383
  if (updatedRef.current) {
368
- setSelectedOptions(getSelectedOptionsFromValue(isMultiple, innerOptions, value, defaultValue));
384
+ setSelectedOptions(function (prev) {
385
+ return getSelectedOptionsFromValue(isMultiple, innerOptions, value, undefined, prev);
386
+ });
369
387
  } else {
370
388
  updatedRef.current = true;
371
389
  }
372
- }, [value, innerOptions, isMultiple, defaultValue]);
390
+ }, [value, innerOptions, isMultiple]);
373
391
  var wrapRef = useRef(null);
374
392
  useEffect(function () {
375
393
  var observer = new MutationObserver(function m(mutations) {
@@ -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 = ["size", "className", "popupClassName", "adaptHeight", "style", "monospace", "tabPosition", "padding", "compact", "hasDividing"];
2
+ var _excluded = ["size", "className", "popupClassName", "adaptHeight", "style", "monospace", "tabPosition", "padding", "compact", "hasDividing", "type"];
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 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; }
5
5
  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; }
@@ -29,6 +29,7 @@ export default function Tabs(props) {
29
29
  compact = props.compact,
30
30
  _props$hasDividing = props.hasDividing,
31
31
  hasDividing = _props$hasDividing === void 0 ? true : _props$hasDividing,
32
+ type = props.type,
32
33
  otherProps = _objectWithoutProperties(props, _excluded);
33
34
  var headerBackgroundColor = props.headerBackgroundColor;
34
35
  var tabsProps = _objectSpread({}, otherProps);
@@ -47,6 +48,7 @@ export default function Tabs(props) {
47
48
  return 0;
48
49
  }, [propsPadding, tabPosition]);
49
50
  var getTabBarGutter = function getTabBarGutter() {
51
+ if (type === 'editable-card') return 4;
50
52
  if (tabPosition === 'top' && !monospace) {
51
53
  return 24;
52
54
  }
@@ -61,6 +63,7 @@ export default function Tabs(props) {
61
63
  '--tabs-padding': "".concat(padding, "px")
62
64
  }),
63
65
  tabPosition: tabPosition,
66
+ type: type,
64
67
  tabBarGutter: getTabBarGutter(),
65
68
  popupClassName: classNames(popupClassName, 'ald-tabs-dropdown'),
66
69
  className: classNames('ald-tabs', className, {
@@ -219,3 +219,43 @@
219
219
  border-bottom: 0;
220
220
  }
221
221
  }
222
+
223
+ .ant-tabs.ald-tabs.ant-tabs-editable-card {
224
+ .ant-tabs-tab {
225
+ display: flex;
226
+ height: 40px;
227
+ padding: 0 16px;
228
+ justify-content: center;
229
+ align-items: center;
230
+ gap: var(--alias-spacing-75, 6px);
231
+ border-radius: 6px 6px 0 0;
232
+ border-top: 1px solid var(--alias-colors-border-default, #e5e7eb);
233
+ border-right: 1px solid var(--alias-colors-border-default, #e5e7eb);
234
+ border-left: 1px solid var(--alias-colors-border-default, #e5e7eb);
235
+ background: var(--alias-colors-bg-skeleton-subtler, #fff);
236
+ }
237
+
238
+ .ant-tabs-tab-remove {
239
+ margin: 0;
240
+ width: 16px;
241
+ padding: 0;
242
+ padding-inline: 0;
243
+ display: grid;
244
+ place-items: center;
245
+ }
246
+
247
+ .ant-tabs-tab-active .ant-tabs-tab-btn {
248
+ color: @tabs-color-active;
249
+ font-weight: @tabs-fontWeight-active;
250
+ text-shadow: none;
251
+ }
252
+
253
+ .anticon-close,
254
+ .anticon-plus {
255
+ color: #6b7280;
256
+
257
+ &:hover {
258
+ color: #374151;
259
+ }
260
+ }
261
+ }
@@ -16,9 +16,13 @@ export interface TagProps {
16
16
  */
17
17
  color?: string;
18
18
  /**
19
- * icon 图标
19
+ * 前置 icon 图标
20
20
  */
21
21
  icon?: React.ReactNode;
22
+ /**
23
+ * 后置 icon 图标
24
+ */
25
+ suffixIcon?: React.ReactNode;
22
26
  /**
23
27
  * 大小
24
28
  */
package/dist/Tag/index.js CHANGED
@@ -13,6 +13,7 @@ export default function Tag(props) {
13
13
  onClose = props.onClose,
14
14
  color = props.color,
15
15
  icon = props.icon,
16
+ suffixIcon = props.suffixIcon,
16
17
  _props$size = props.size,
17
18
  size = _props$size === void 0 ? 'middle' : _props$size,
18
19
  status = props.status,
@@ -49,7 +50,9 @@ export default function Tag(props) {
49
50
  }, icon), /*#__PURE__*/React.createElement("span", {
50
51
  className: prefixCls('content'),
51
52
  title: typeof children === 'string' ? children : ''
52
- }, children), closable ? /*#__PURE__*/React.createElement("span", {
53
+ }, children), suffixIcon && /*#__PURE__*/React.createElement("span", {
54
+ className: prefixCls('suffix-icon')
55
+ }, suffixIcon), closable ? /*#__PURE__*/React.createElement("span", {
53
56
  className: prefixCls('close-btn'),
54
57
  onClick: onCloseBtnClick
55
58
  }, /*#__PURE__*/React.createElement(CloseLightLine, {
@@ -54,6 +54,12 @@
54
54
  align-items: center;
55
55
  }
56
56
 
57
+ .ald-tag-suffix-icon {
58
+ flex: 0 0 auto;
59
+ display: inline-flex;
60
+ align-items: center;
61
+ }
62
+
57
63
  /** 禁用 **/
58
64
  &.ald-tag-disabled {
59
65
  cursor: initial;