@aloudata/aloudata-design 2.0.2 → 2.0.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.
@@ -16,6 +16,10 @@
16
16
  text-shadow: none;
17
17
  text-decoration: none;
18
18
 
19
+ .ald-icon {
20
+ color: #fff;
21
+ }
22
+
19
23
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
20
24
  &:focus-visible {
21
25
  outline: none;
@@ -127,6 +131,10 @@
127
131
  border-color: @button-secondary-border-color;
128
132
  box-shadow: none;
129
133
 
134
+ .ald-icon {
135
+ color: #6b7280;
136
+ }
137
+
130
138
  &:focus {
131
139
  color: @button-secondary-color;
132
140
  //text-shadow: @text-shadow;
@@ -172,6 +180,10 @@
172
180
  border-color: @button-text-border-color;
173
181
  box-shadow: none;
174
182
 
183
+ .ald-icon {
184
+ color: #6b7280;
185
+ }
186
+
175
187
  &:focus {
176
188
  color: @button-text-color;
177
189
  background-color: @button-text-bg-color;
@@ -183,6 +195,10 @@
183
195
  color: @button-text-color-hover;
184
196
  background-color: @button-text-bg-color-hover;
185
197
  border-color: @button-text-border-color-hover;
198
+
199
+ .ald-icon {
200
+ color: #2986f4;
201
+ }
186
202
  }
187
203
 
188
204
  &:active {
@@ -190,6 +206,10 @@
190
206
  background-color: @button-text-bg-color-active;
191
207
  border-color: @button-text-border-color-active;
192
208
  box-shadow: none;
209
+
210
+ .ald-icon {
211
+ color: #2986f4;
212
+ }
193
213
  }
194
214
 
195
215
  &[disabled],
@@ -361,14 +361,46 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
361
361
  updatedRef.current = true;
362
362
  }
363
363
  }, [value, innerOptions, isMultiple, defaultValue]);
364
+ var wrapRef = useRef(null);
365
+ useEffect(function () {
366
+ var observer = new MutationObserver(function m(mutations) {
367
+ mutations.forEach(function (m) {
368
+ var target = m.target;
369
+ var classList = target.classList;
370
+ if (classList.contains('ant-select')) {
371
+ if (classList.contains('ant-select-focused')) {
372
+ console.log(222, JSON.stringify(classList));
373
+ setIsFocus(true);
374
+ } else {
375
+ console.log(111);
376
+ console.log(JSON.stringify(classList));
377
+ setIsFocus(false);
378
+ }
379
+ }
380
+ return;
381
+ });
382
+ });
383
+ // 以上述配置开始观察目标节点
384
+ if (wrapRef && wrapRef.current) {
385
+ observer.observe(wrapRef.current, {
386
+ attributeFilter: ['class'],
387
+ subtree: true,
388
+ attributeOldValue: true
389
+ });
390
+ }
391
+ return function () {
392
+ observer.disconnect();
393
+ };
394
+ }, [selectRef]);
364
395
  return /*#__PURE__*/React.createElement("div", {
396
+ ref: wrapRef,
365
397
  onMouseDown: function onMouseDown() {
366
398
  if (disabled) return;
367
399
  if (!isOpen && Date.now() - dropDownTimeRef.current > 300) {
368
400
  setIsOpen(!isOpen);
369
401
  }
370
402
  },
371
- 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),
403
+ 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-focused', 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),
372
404
  spellCheck: false,
373
405
  style: Object.assign(styleVar, style)
374
406
  }, !!prefix && /*#__PURE__*/React.createElement("span", {
@@ -380,7 +412,7 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
380
412
  placeholder: placeholder,
381
413
  showSearch: showSearch,
382
414
  options: innerOptions,
383
- showArrow: isMultiple ? false : showArrow,
415
+ showArrow: isMultiple && type === 'primary' ? false : showArrow,
384
416
  mode: isMultiple ? 'multiple' : undefined,
385
417
  bordered: false,
386
418
  open: typeof _open === 'boolean' ? _open : isOpen,
@@ -418,8 +450,9 @@ var Select = /*#__PURE__*/forwardRef(function (props, ref) {
418
450
  onFocus: function onFocus() {
419
451
  setIsFocus(true);
420
452
  },
421
- onBlur: function onBlur() {
422
- setIsFocus(false);
453
+ onBlur: function onBlur(e) {
454
+ var _props$onBlur;
455
+ (_props$onBlur = props.onBlur) === null || _props$onBlur === void 0 ? void 0 : _props$onBlur.call(props, e);
423
456
  }
424
457
  })));
425
458
  });
@@ -8,3 +8,20 @@
8
8
  }
9
9
  }
10
10
  }
11
+
12
+ .ald-select.ald-select-empty-show-all:not(.ald-select-has-value) {
13
+ .ant-select {
14
+ .ant-select-selector {
15
+ .ant-select-selection-placeholder {
16
+ right: auto;
17
+ padding-right: 0;
18
+ }
19
+
20
+ .ant-select-selection-overflow {
21
+ right: auto;
22
+ min-width: 24px;
23
+ padding-right: 0;
24
+ }
25
+ }
26
+ }
27
+ }
@@ -35,6 +35,10 @@
35
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));
36
36
  }
37
37
 
38
+ &.ald-select-focused {
39
+ .select-color(var(--alias-colors-border-selected, #126fdd), var(--alias-colors-bg-accent-gray-subtler-default, #F9FAFB),var(--alias-colors-text-default, #1f2937));
40
+ }
41
+
38
42
  &:active {
39
43
  .select-color(var(--alias-colors-border-accent-gray-subtle-default, #D1D5DB),var(--alias-colors-bg-skeleton-strong, #F3F4F6),var(--alias-colors-text-default, #1f2937));
40
44
  }
@@ -93,6 +97,10 @@
93
97
  .select-color(var(--alias-colors-border-accent-gray-subtle-hover, #9ca3af),var(--alias-colors-bg-skeleton-subtler, #FFF),var(--alias-colors-text-default, #1f2937));
94
98
  }
95
99
 
100
+ &.ald-select-focused {
101
+ .select-color(var(--alias-colors-border-selected, #126fdd),var(--alias-colors-bg-skeleton-subtler, #FFF),var(--alias-colors-text-default, #1f2937));
102
+ }
103
+
96
104
  &:active {
97
105
  .select-color(var(--alias-colors-border-accent-gray-subtle-default, #D1D5DB),var(--alias-colors-bg-skeleton-subtler, #FFF),var(--alias-colors-text-default, #1f2937));
98
106
  }