@douyinfe/semi-foundation 2.51.4 → 2.52.0-beta.0

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.
Files changed (70) hide show
  1. package/avatar/animation.scss +19 -0
  2. package/avatar/avatar.scss +313 -0
  3. package/avatar/variables.scss +66 -10
  4. package/cascader/foundation.ts +7 -13
  5. package/cascader/util.ts +0 -13
  6. package/datePicker/foundation.ts +7 -7
  7. package/input/input.scss +12 -3
  8. package/input/variables.scss +5 -0
  9. package/lib/cjs/avatar/animation.scss +19 -0
  10. package/lib/cjs/avatar/avatar.css +261 -0
  11. package/lib/cjs/avatar/avatar.scss +313 -0
  12. package/lib/cjs/avatar/variables.scss +66 -10
  13. package/lib/cjs/cascader/foundation.d.ts +11 -4
  14. package/lib/cjs/cascader/foundation.js +14 -22
  15. package/lib/cjs/cascader/util.d.ts +0 -1
  16. package/lib/cjs/cascader/util.js +0 -14
  17. package/lib/cjs/datePicker/foundation.d.ts +2 -2
  18. package/lib/cjs/datePicker/foundation.js +4 -5
  19. package/lib/cjs/input/input.css +12 -0
  20. package/lib/cjs/input/input.scss +12 -3
  21. package/lib/cjs/input/variables.scss +5 -0
  22. package/lib/cjs/modal/modal.css +3 -0
  23. package/lib/cjs/modal/modal.scss +5 -1
  24. package/lib/cjs/modal/modalFoundation.d.ts +1 -0
  25. package/lib/cjs/modal/variables.scss +4 -0
  26. package/lib/cjs/slider/constants.d.ts +1 -0
  27. package/lib/cjs/slider/constants.js +2 -1
  28. package/lib/cjs/slider/foundation.d.ts +7 -0
  29. package/lib/cjs/slider/slider.css +9 -0
  30. package/lib/cjs/slider/slider.scss +10 -0
  31. package/lib/cjs/slider/variables.scss +2 -0
  32. package/lib/cjs/tooltip/foundation.js +0 -11
  33. package/lib/cjs/treeSelect/foundation.d.ts +1 -0
  34. package/lib/cjs/treeSelect/foundation.js +1 -0
  35. package/lib/es/avatar/animation.scss +19 -0
  36. package/lib/es/avatar/avatar.css +261 -0
  37. package/lib/es/avatar/avatar.scss +313 -0
  38. package/lib/es/avatar/variables.scss +66 -10
  39. package/lib/es/cascader/foundation.d.ts +11 -4
  40. package/lib/es/cascader/foundation.js +15 -23
  41. package/lib/es/cascader/util.d.ts +0 -1
  42. package/lib/es/cascader/util.js +0 -13
  43. package/lib/es/datePicker/foundation.d.ts +2 -2
  44. package/lib/es/datePicker/foundation.js +4 -5
  45. package/lib/es/input/input.css +12 -0
  46. package/lib/es/input/input.scss +12 -3
  47. package/lib/es/input/variables.scss +5 -0
  48. package/lib/es/modal/modal.css +3 -0
  49. package/lib/es/modal/modal.scss +5 -1
  50. package/lib/es/modal/modalFoundation.d.ts +1 -0
  51. package/lib/es/modal/variables.scss +4 -0
  52. package/lib/es/slider/constants.d.ts +1 -0
  53. package/lib/es/slider/constants.js +2 -1
  54. package/lib/es/slider/foundation.d.ts +7 -0
  55. package/lib/es/slider/slider.css +9 -0
  56. package/lib/es/slider/slider.scss +10 -0
  57. package/lib/es/slider/variables.scss +2 -0
  58. package/lib/es/tooltip/foundation.js +0 -11
  59. package/lib/es/treeSelect/foundation.d.ts +1 -0
  60. package/lib/es/treeSelect/foundation.js +1 -0
  61. package/modal/modal.scss +5 -1
  62. package/modal/modalFoundation.ts +2 -1
  63. package/modal/variables.scss +4 -0
  64. package/package.json +3 -3
  65. package/slider/constants.ts +1 -0
  66. package/slider/foundation.ts +8 -1
  67. package/slider/slider.scss +10 -0
  68. package/slider/variables.scss +2 -0
  69. package/tooltip/foundation.ts +2 -12
  70. package/treeSelect/foundation.ts +2 -0
@@ -24,29 +24,85 @@ $font-avatar_extra_large-lineHeight: 77px; // 文本行高 - 超大
24
24
 
25
25
  $radius-avatar: var(--semi-border-radius-circle); // 头像圆角
26
26
 
27
- $width-avatar_extra_large-border: 3px; // 头像描边尺寸 - 超大
28
- $spacing-avatar_extra_large-marginLeft: -32px; // 头像左侧外边距 - 超大
27
+ $width-avatar_extra_large-border: 3px; // 头像组头像描边尺寸 - 超大
28
+ $spacing-avatar_extra_large-marginLeft: -32px; // 头像组头像左侧外边距 - 超大
29
29
 
30
- $width-avatar_large-border: 3px; // 头像描边尺寸 - 大
30
+ $width-avatar_large-border: 3px; // 头像组头像描边尺寸 - 大
31
31
  $spacing-avatar_large-marginLeft: -18px; // 头像左侧外边距 - 大
32
32
 
33
- $width-avatar_medium-border: 2px; // 头像描边尺寸 - 中
33
+ $width-avatar_medium-border: 2px; // 头像组头像描边尺寸 - 中
34
34
  $spacing-avatar_medium-marginLeft: -12px; // 头像左侧外边距 - 中
35
35
 
36
- $width-avatar_default-border: 2px; // 头像描边尺寸 - 默认
36
+ $width-avatar_default-border: 2px; // 头像组头像描边尺寸 - 默认
37
37
  $spacing-avatar_default-marginLeft: -12px; // 头像左侧外边距 - 默认
38
38
 
39
- $width-avatar_small-border: 2px; // 头像描边尺寸 - 小
39
+ $width-avatar_small-border: 2px; // 头像组头像描边尺寸 - 小
40
40
  $spacing-avatar_small-marginLeft: -12px; // 头像左侧外边距 - 小
41
41
 
42
- $width-avatar_extra_small-border: 1px; // 头像描边尺寸 - 超小
42
+ $width-avatar_extra_small-border: 1px; // 头像组头像描边尺寸 - 超小
43
43
  $spacing-avatar_extra_small-marginLeft: -10px; // 头像左侧外边距 - 超小
44
44
 
45
- $width-avatar_extra_extra_small-border: 1px; // 头像描边尺寸 - 极小
45
+ $width-avatar_extra_extra_small-border: 1px; // 头像组头像描边尺寸 - 极小
46
46
  $spacing-avatar_extra_extra_small-marginLeft: -4px; // 头像左侧外边距 - 极小
47
-
48
47
  $width-avatar-outline: 2px; //头像聚焦轮廓宽度
49
48
 
49
+ $width-avatar_additional-border: 1.5px; // 额外描边尺寸
50
+ $color-avatar_additional-border: var(--semi-color-primary); // 额外描边颜色
51
+ $spacing-avatar_additional-borderGap: 2px; // 额外描边与内侧间距
52
+
53
+ $width-avatar-bottom_slot_circle_small: 12px; // small 头像底部 slot 圆形半径
54
+ $width-avatar-bottom_slot_circle_default: 16px; // default 头像底部 slot 圆形半径
55
+ $width-avatar-bottom_slot_circle_medium: 18px; // medium 头像底部 slot 圆形半径
56
+ $width-avatar-bottom_slot_circle_large: 28px; // large 头像底部 slot 圆形半径
57
+ $width-avatar-bottom_slot_circle_extra_large: 28px; // extra large 头像底部 slot 圆形半径
58
+ $color-avatar-bottom_slot_bg:var(--semi-color-primary); // 头像底部 slot 背景色
59
+
60
+ $radius-avatar-bottom_slot_square:4px; // 底部 slot square 圆角
61
+ $font-avatar_bottom_slot-small-fontSize: 5px; // small 底部 slot 文字大小
62
+ $font-avatar_bottom_slot-default-fontSize: 12px; // default 底部 slot 文字大小
63
+ $font-avatar_bottom_slot-medium-fontSize: 12px; // medium 底部 slot 文字大小
64
+ $font-avatar_bottom_slot-large-fontSize: 12px; // large 底部 slot 文字大小
65
+ $font-avatar_bottom_slot-extra_large-fontSize: 14px; // extra large 底部 slot 文字大小
66
+ $spacing-avatar-bottom_slot_square-paddingX:4px; // 底部 slot square 形状左边距
67
+ $spacing-avatar-bottom_slot_square-paddingY:1px; //底部 slot square 形状右边距
68
+
69
+ $font-avatar_top_slot-small-fontSize: 5px; // small 顶部 slot 文字大小
70
+ $font-avatar_top_slot-default-fontSize: 6px; // default 顶部 slot 文字大小
71
+ $font-avatar_top_slot-medium-fontSize: 8px; // medium 顶部 slot 文字大小
72
+ $font-avatar_top_slot-large-fontSize: 14px; // large 顶部 slot 文字大小
73
+ $font-avatar_top_slot-extra_large-fontSize: 16px; // extra large 顶部 slot 文字大小
74
+
75
+ $spacing-avatar-top_slot_small-content-marginTop: 0px; // small 顶部文字 marginTop
76
+ $spacing-avatar-top_slot_default-content-marginTop: -2px; // default 顶部文字 marginTop
77
+ $spacing-avatar-top_slot_medium-content-marginTop: 0px; // medium 顶部文字 marginTop
78
+ $spacing-avatar-top_slot_large-content-marginTop: 0px; // large 顶部文字 marginTop
79
+ $spacing-avatar-top_slot_extra_large-content-marginTop: 0px; // extra large 顶部文字 marginTop
80
+
81
+ $color-avatar-bottom_slot_square-border:var(--semi-color-bg-0); // 底部 square 边框颜色
82
+ $width-avatar-bottom_slot_square_small-border:2px; // small 头像底部 square 边框宽度
83
+ $width-avatar-bottom_slot_square_default-border:2px; // default 头像底部 square 边框宽度
84
+ $width-avatar-bottom_slot_square_medium-border:2px; // medium 头像底部 square 边框宽度
85
+ $width-avatar-bottom_slot_square_large-border:2px; // large 头像底部 square 边框宽度
86
+ $width-avatar-bottom_slot_square_extra_large-border:2px; // extra large 头像底部 square 边框宽度
87
+
88
+ $color-avatar-top_slot_text:var(--semi-color-bg-0); //顶部 Slot 文字颜色
89
+ $color-avatar-top_slot_gradient_start: var(--semi-color-primary); // 顶部 slot 渐变起始色
90
+ $color-avatar-top_slot_gradient_end: var(--semi-color-primary); // 顶部 slot 渐变结束色
91
+
92
+
93
+ $spacing-avatar-top_slot_small-shift: -28px; // small 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
94
+ $spacing-avatar-top_slot_default-shift: -32px; // default 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
95
+ $spacing-avatar-top_slot_medium-shift: -30px; // medium 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
96
+ $spacing-avatar-top_slot_large-shift: -30px; // large 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
97
+ $spacing-avatar-top_slot_extra_large-shift: -32px; // extra large 顶部 slot 偏移量, 和 scale 一起控制 slot 的位置
98
+
99
+ $spacing-avatar-top_slot_small-scale: 0.4; // small 顶部 slot 缩放比例
100
+ $spacing-avatar-top_slot_default-scale: 0.7; // default 顶部 slot 缩放比例
101
+ $spacing-avatar-top_slot_medium-scale: 0.8; // medium 顶部 slot 缩放比例
102
+ $spacing-avatar-top_slot_large-scale: 1.1; // large 顶部 slot 缩放比例
103
+ $spacing-avatar-top_slot_extra_large-scale: 1.4; // large 顶部 slot 缩放比例
104
+
105
+
50
106
  // radius
51
107
  $radius-avatar_extra_extra_small: 3px; // 极小尺寸头像的圆角
52
108
  $radius-avatar_extra_small: 3px; // 超小尺寸头像的圆角
@@ -54,4 +110,4 @@ $radius-avatar_small: 3px; // 小尺寸头像的圆角
54
110
  $radius-avatar_default: 3px; // 默认尺寸头像的圆角
55
111
  $radius-avatar_medium: 3px; // 中尺寸头像的圆角
56
112
  $radius-avatar_large: 6px; // 大尺寸头像的圆角
57
- $radius-avatar_extra_large: 12px; // 超大尺寸头像的圆角
113
+ $radius-avatar_extra_large: 12px; // 超大尺寸头像的圆角
@@ -24,7 +24,6 @@ export interface BasicEntity {
24
24
  parent?: BasicEntity;
25
25
  parentKey?: string;
26
26
  path: Array<string>;
27
- pos: string;
28
27
  valuePath: Array<string>;
29
28
  }
30
29
  export interface BasicCascaderData {
@@ -240,7 +239,16 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
240
239
  * @param {boolean} curCheckedStatus checked status of node
241
240
  */
242
241
  calcCheckedKeys(key: string, curCheckedStatus: boolean): {
243
- checkedKeys: Set<string>;
242
+ checkedKeys: Set<string>; /**
243
+ * If selectedKeys does not meet the update conditions,
244
+ * and state.selectedKeys is the same as selectedKeys
245
+ * at this time, state.selectedKeys should be cleared.
246
+ * A typical scenario is:
247
+ * The originally selected node is the leaf node, but
248
+ * after props.treeData is dynamically updated, the node
249
+ * is a non-leaf node. At this point, selectedKeys should
250
+ * be cleared.
251
+ */
244
252
  halfCheckedKeys: Set<string>;
245
253
  };
246
254
  handleInputChange(sugInput: string): void;
@@ -252,6 +260,5 @@ export default class CascaderFoundation extends BaseFoundation<CascaderAdapter,
252
260
  getRenderData(): BasicEntity[] | BasicData[];
253
261
  getFilteredData(): BasicData[];
254
262
  handleListScroll(e: any, ind: number): void;
255
- handleTagRemoveByKey: (key: string) => void;
256
- handleTagRemoveInTrigger: (pos: string) => void;
263
+ handleTagRemove(e: any, tagValuePath: string[]): void;
257
264
  }
@@ -11,7 +11,7 @@ import _get from "lodash/get";
11
11
  import _isEqual from "lodash/isEqual";
12
12
  import BaseFoundation from '../base/foundation';
13
13
  import { filter, findAncestorKeys, calcCheckedKeysForUnchecked, calcCheckedKeysForChecked, calcCheckedKeys, findDescendantKeys, normalizeKeyList } from '../tree/treeUtil';
14
- import { convertDataToEntities, normalizedArr, isValid, calcMergeType, getKeysByValuePath, getKeyByPos } from './util';
14
+ import { convertDataToEntities, normalizedArr, isValid, calcMergeType, getKeysByValuePath } from './util';
15
15
  import { strings } from './constants';
16
16
  import isEnterPress from '../utils/isEnterPress';
17
17
  export default class CascaderFoundation extends BaseFoundation {
@@ -22,28 +22,6 @@ export default class CascaderFoundation extends BaseFoundation {
22
22
  isSearching: false
23
23
  });
24
24
  };
25
- this.handleTagRemoveByKey = key => {
26
- var _a, _b;
27
- const {
28
- keyEntities
29
- } = this.getStates();
30
- const {
31
- disabled
32
- } = this.getProps();
33
- if (disabled) {
34
- /* istanbul ignore next */
35
- return;
36
- }
37
- const removedItem = (_a = keyEntities[key]) !== null && _a !== void 0 ? _a : {};
38
- !((_b = removedItem === null || removedItem === void 0 ? void 0 : removedItem.data) === null || _b === void 0 ? void 0 : _b.disable) && this._handleMultipleSelect(removedItem);
39
- };
40
- this.handleTagRemoveInTrigger = pos => {
41
- const {
42
- treeData
43
- } = this.getStates();
44
- const key = getKeyByPos(pos, treeData);
45
- this.handleTagRemoveByKey(key);
46
- };
47
25
  }
48
26
  init() {
49
27
  const isOpen = this.getProp('open') || this.getProp('defaultOpen');
@@ -877,4 +855,18 @@ export default class CascaderFoundation extends BaseFoundation {
877
855
  activeNode: data
878
856
  });
879
857
  }
858
+ handleTagRemove(e, tagValuePath) {
859
+ const {
860
+ keyEntities
861
+ } = this.getStates();
862
+ const {
863
+ disabled
864
+ } = this.getProps();
865
+ if (disabled) {
866
+ /* istanbul ignore next */
867
+ return;
868
+ }
869
+ const removedItem = Object.values(keyEntities).filter(item => _isEqual(item.valuePath, tagValuePath))[0];
870
+ !_isEmpty(removedItem) && !removedItem.data.disabled && this._handleMultipleSelect(removedItem);
871
+ }
880
872
  }
@@ -3,6 +3,5 @@ export declare function normalizedArr(val: any): any[];
3
3
  export declare function getKeysByValuePath(valuePath: (string | number)[][] | (string | number)[]): string[];
4
4
  export declare function getKeyByValuePath(valuePath: (string | number)[]): string;
5
5
  export declare function getValuePathByKey(key: string): string[];
6
- export declare function getKeyByPos(pos: string, treeData: any): string;
7
6
  export declare function convertDataToEntities(dataNodes: any): any;
8
7
  export declare function calcMergeType(autoMergeValue: boolean, leafOnly: boolean): string;
@@ -24,12 +24,10 @@ function traverseDataNodes(treeNodes, callback) {
24
24
  // Process node if is not root
25
25
  if (node) {
26
26
  const key = parent ? `${parent.key}${VALUE_SPLIT}${node.value}` : node.value;
27
- const pos = parent ? getPosition(parent.pos, ind) : `${ind}`;
28
27
  item = {
29
28
  data: Object.assign({}, node),
30
29
  ind,
31
30
  key,
32
- pos,
33
31
  level: parent ? parent.level + 1 : 0,
34
32
  parentKey: parent ? parent.key : null,
35
33
  path: parent ? [...parent.path, key] : [key],
@@ -62,17 +60,6 @@ export function getKeyByValuePath(valuePath) {
62
60
  export function getValuePathByKey(key) {
63
61
  return key.split(VALUE_SPLIT);
64
62
  }
65
- export function getKeyByPos(pos, treeData) {
66
- const posArr = pos.split('-').map(item => Number(item));
67
- let resultData = treeData;
68
- let valuePath = [];
69
- posArr.forEach((item, index) => {
70
- var _a;
71
- resultData = index === 0 ? resultData[item] : (_a = resultData === null || resultData === void 0 ? void 0 : resultData.children) === null || _a === void 0 ? void 0 : _a[item];
72
- valuePath.push(resultData === null || resultData === void 0 ? void 0 : resultData.value);
73
- });
74
- return getKeyByValuePath(valuePath);
75
- }
76
63
  export function convertDataToEntities(dataNodes) {
77
64
  const keyEntities = {};
78
65
  traverseDataNodes(dataNodes, data => {
@@ -30,8 +30,8 @@ export type DisabledDateOptions = {
30
30
  rangeInputFocus?: 'rangeStart' | 'rangeEnd' | false;
31
31
  };
32
32
  export type PresetType = {
33
- start?: string | Date | number;
34
- end?: string | Date | number;
33
+ start?: BaseValueType | (() => BaseValueType);
34
+ end?: BaseValueType | (() => BaseValueType);
35
35
  text?: string;
36
36
  };
37
37
  export type TriggerRenderProps = {
@@ -15,7 +15,6 @@ import { strings as inputStrings } from '../input/constants';
15
15
  import getInsetInputFormatToken from './_utils/getInsetInputFormatToken';
16
16
  import getInsetInputValueFromInsetInputStr from './_utils/getInsetInputValueFromInsetInputStr';
17
17
  import isValidTimeZone from './_utils/isValidTimeZone';
18
- import warning from '../utils/warning';
19
18
  /**
20
19
  * The datePicker foundation.js is responsible for maintaining the date value and the input box value, as well as the callback of both
21
20
  * task 1. Accept the selected date change, update the date value, and update the input box value according to the date = > Notify the change
@@ -119,8 +118,6 @@ export default class DatePickerFoundation extends BaseFoundation {
119
118
  parsedV = zonedTimeToUtc(parsedV, prevTimeZone);
120
119
  }
121
120
  result.push(isValidTimeZone(timeZone) ? utcToZonedTime(parsedV, timeZone) : parsedV);
122
- } else {
123
- warning(true, `[Semi DatePicker] value cannot be parsed, value: ${String(v)}`);
124
121
  }
125
122
  }
126
123
  }
@@ -880,17 +877,19 @@ export default class DatePickerFoundation extends BaseFoundation {
880
877
  timeZone
881
878
  } = this.getProps();
882
879
  const prevTimeZone = this.getState('prevTimezone');
880
+ const start = typeof item.start === 'function' ? item.start() : item.start;
881
+ const end = typeof item.end === 'function' ? item.end() : item.end;
883
882
  let value;
884
883
  switch (type) {
885
884
  case 'month':
886
885
  case 'dateTime':
887
886
  case 'date':
888
- value = this.parseWithTimezone([item.start], timeZone, prevTimeZone);
887
+ value = this.parseWithTimezone([start], timeZone, prevTimeZone);
889
888
  this.handleSelectedChange(value);
890
889
  break;
891
890
  case 'dateTimeRange':
892
891
  case 'dateRange':
893
- value = this.parseWithTimezone([item.start, item.end], timeZone, prevTimeZone);
892
+ value = this.parseWithTimezone([start, end], timeZone, prevTimeZone);
894
893
  this.handleSelectedChange(value, {
895
894
  needCheckFocusRecord: false
896
895
  });
@@ -553,6 +553,18 @@
553
553
  margin-bottom: 0;
554
554
  }
555
555
 
556
+ .semi-input-only_border {
557
+ background: transparent;
558
+ border-color: var(--semi-color-border);
559
+ }
560
+ .semi-input-only_border:hover {
561
+ background: transparent;
562
+ border-color: var(--semi-color-border);
563
+ }
564
+ .semi-input-only_border:focus-within {
565
+ background: transparent;
566
+ }
567
+
556
568
  .semi-input-borderless:not(:focus-within):not(:hover) {
557
569
  background-color: transparent;
558
570
  border-color: transparent;
@@ -85,7 +85,7 @@ $module: #{$prefix}-input;
85
85
  border: $color-input_default-border-focus solid $width-input_wrapper_focus-border;
86
86
 
87
87
  &:hover {
88
- background-color: $color-input_default-bg-focus;
88
+ background-color: $color-input_default-bg-focus-hover;
89
89
  border-color: $color-input_default-border-focus;
90
90
  }
91
91
 
@@ -690,7 +690,18 @@ $module: #{$prefix}-input;
690
690
  }
691
691
  }
692
692
 
693
+ .#{$module}-only_border{
694
+ background: transparent;
695
+ &:hover{
696
+ background: transparent;
697
+ border-color: $color_input-default-border-only_border-hover;
698
+ }
699
+ &:focus-within{
700
+ background: transparent;
701
+ }
702
+ border-color: $color_input-default-border-only_border-default;
693
703
 
704
+ }
694
705
 
695
706
  .#{$module}-borderless{
696
707
 
@@ -713,8 +724,6 @@ $module: #{$prefix}-input;
713
724
  }
714
725
 
715
726
 
716
-
717
-
718
727
  }
719
728
 
720
729
  @import "./rtl.scss";
@@ -13,6 +13,8 @@ $color-input_default-bg-focus: var(--semi-color-fill-0); // 输入框背景颜
13
13
  $color-input_default-border-focus: var(--semi-color-focus-border); // 输入框描边颜色 - 选中
14
14
  $color-input_icon-outline: var(--semi-color-primary-light-active); // 输入框 icon outline 颜色
15
15
 
16
+ $color-input_default-bg-focus-hover: $color-input_default-bg-focus; // 输入框背景颜色 - 选中悬浮
17
+
16
18
  // error
17
19
  $color-input_danger-bg-default: var(--semi-color-danger-light-default); // 错误输入框背景颜色 - 默认
18
20
  $color-input_danger-border-default: var(--semi-color-danger-light-default); // 错误输入框描边颜色 - 默认
@@ -57,6 +59,9 @@ $color-input_counter_danger-text-default: var(--semi-color-danger); // 多行文
57
59
 
58
60
  $color-input_group-border-default: var(--semi-color-border); // 输入框组合分割线颜色
59
61
 
62
+ $color_input-default-border-only_border-default: var(--semi-color-border); // 只有描边的输入框描边颜色 - 默认
63
+ $color_input-default-border-only_border-hover: var(--semi-color-border); // 只有描边的输入框描边颜色 - 默认
64
+
60
65
  $height-input_large: $height-control-large - 2px; // 输入框高度 & 行高 - 大尺寸
61
66
  $height-input_small: $height-control-small - 2px; // 输入框高度 & 行高 - 小尺寸
62
67
  $height-input_default: $height-control-default - 2px; // 输入框高度 & 行高 - 默认尺寸
@@ -64,6 +64,9 @@
64
64
  overflow: hidden;
65
65
  box-shadow: var(--semi-shadow-elevated);
66
66
  }
67
+ .semi-modal-footerfill {
68
+ display: flex;
69
+ }
67
70
  .semi-modal-content-fullScreen {
68
71
  border-radius: 0;
69
72
  border: none;
@@ -70,7 +70,11 @@ $module: #{$prefix}-modal;
70
70
  padding: $spacing-modal_content-paddingY $spacing-modal_content-paddingX;
71
71
  background-clip: padding-box;
72
72
  overflow: hidden;
73
- @include shadow-elevated;
73
+ box-shadow: $shadow-modal_content;
74
+ }
75
+
76
+ &-footerfill{
77
+ display: flex;
74
78
  }
75
79
 
76
80
  &-content-fullScreen {
@@ -51,6 +51,7 @@ export interface ModalProps {
51
51
  direction?: any;
52
52
  fullScreen?: boolean;
53
53
  preventScroll?: boolean;
54
+ footerFill?: boolean;
54
55
  }
55
56
  export interface ModalState {
56
57
  displayNone: boolean;
@@ -71,3 +71,7 @@ $color-modal_footer-border:transparent; // 模态框 footer 顶部描边颜色
71
71
  $width-modal_footer-border:0; // 模态框 footer 顶部描边宽度
72
72
 
73
73
 
74
+ //shadow
75
+ $shadow-modal_content: var(--semi-shadow-elevated)
76
+
77
+
@@ -6,6 +6,7 @@ declare const cssClasses: {
6
6
  DOTS: string;
7
7
  MARKS: string;
8
8
  HANDLE: string;
9
+ HANDLE_DOT: string;
9
10
  };
10
11
  declare const strings: {
11
12
  SIZE: string[];
@@ -6,7 +6,8 @@ const cssClasses = {
6
6
  TRACK: `${BASE_CLASS_PREFIX}-slider-track`,
7
7
  DOTS: `${BASE_CLASS_PREFIX}-slider-dots`,
8
8
  MARKS: `${BASE_CLASS_PREFIX}-slider-marks`,
9
- HANDLE: `${BASE_CLASS_PREFIX}-slider-handle`
9
+ HANDLE: `${BASE_CLASS_PREFIX}-slider-handle`,
10
+ HANDLE_DOT: `${BASE_CLASS_PREFIX}-slider-handle-dot`
10
11
  };
11
12
  const strings = {
12
13
  SIZE: ['small', 'large', 'default'],
@@ -31,6 +31,13 @@ export interface SliderProps {
31
31
  'aria-labelledby'?: string;
32
32
  'aria-valuetext'?: string;
33
33
  getAriaValueText?: (value: number, index?: number) => string;
34
+ handleDot?: {
35
+ size?: string;
36
+ color?: string;
37
+ } & ({
38
+ size?: string;
39
+ color?: string;
40
+ }[]);
34
41
  }
35
42
  export interface SliderState {
36
43
  currentValue: number | number[];
@@ -46,10 +46,19 @@
46
46
  cursor: pointer;
47
47
  transition: background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);
48
48
  transform: var(--semi-transform_scale-small) translateX(-50%) translateY(0px);
49
+ display: inline-flex;
50
+ justify-content: center;
51
+ align-items: center;
49
52
  }
50
53
  .semi-slider-handle:focus-visible {
51
54
  outline: 2px solid var(--semi-color-primary-light-active);
52
55
  }
56
+ .semi-slider-handle-dot {
57
+ background: var(--semi-color-primary);
58
+ width: 4px;
59
+ height: 4px;
60
+ border-radius: var(--semi-border-radius-circle);
61
+ }
53
62
  .semi-slider-handle:hover {
54
63
  background-color: var(--semi-color-white);
55
64
  }
@@ -58,9 +58,19 @@ $module: #{$prefix}-slider;
58
58
  cursor: pointer;
59
59
  transition: background-color $transition_duration_slider_handle-bg $transition_function-slider-handle-bg $transition_delay-slider_handle-bg;
60
60
  transform: $transform_scale-slider_handle translateX(-50%) translateY($spacing-slider_handle-translateY);
61
+ display: inline-flex;
62
+ justify-content: center;
63
+ align-items: center;
61
64
  &:focus-visible {
62
65
  outline: $width-slider_handle-focus solid $color-slider_handle-focus;
63
66
  }
67
+
68
+ &-dot{
69
+ background:$color-slider_handle_dot;
70
+ width:$width-slider_handle_dot;
71
+ height: $width-slider_handle_dot;
72
+ border-radius: var(--semi-border-radius-circle);
73
+ }
64
74
  }
65
75
 
66
76
  &-handle:hover {
@@ -15,6 +15,7 @@ $color-slider_rail: rgba(0, 0, 0, 0.65);
15
15
  $color-slider_track-bg-default: var(--semi-color-primary); // 滑动条轨道颜色 - 已填充
16
16
  $color-slider_track_disabled-bg: var(--semi-color-primary-disabled); // 禁用滑动条轨道颜色 - 已填充
17
17
  $color-slider_handle-focus: var(--semi-color-primary-light-active); // 圆形按钮轮廓 - 聚焦
18
+ $color-slider_handle_dot: var(--semi-color-primary); // 圆形按钮内部圆点颜色
18
19
 
19
20
  // Spacing
20
21
  $spacing-slider-paddingX: 13px; // 滑动条整体水平内边距
@@ -57,6 +58,7 @@ $height-slider_track: 4px; // 滚动条已填充轨道高度
57
58
  $width-slider_dot: 4px; // 滚动条圆形刻度点宽度
58
59
  $width-slider_handle_border_disabled: 1px; // 禁用滚动条圆形按钮按下后描边宽度
59
60
  $width-slider_handle-focus: 2px; // 圆形按钮轮廓 - 聚焦
61
+ $width-slider_handle_dot: 4px; // 圆形按钮内部圆点宽度
60
62
 
61
63
  // Font
62
64
  $font-slider_rail-fontSize: 14px; // 滚动条轨道文本字号
@@ -420,7 +420,6 @@ export default class Tooltip extends BaseFoundation {
420
420
  return null;
421
421
  }
422
422
  calcPosStyle(props) {
423
- var _a;
424
423
  const {
425
424
  spacing,
426
425
  isOverFlow
@@ -471,10 +470,6 @@ export default class Tooltip extends BaseFoundation {
471
470
  const isTriggerNearLeft = middleX - containerRect.left < containerRect.right - middleX;
472
471
  const isTriggerNearTop = middleY - containerRect.top < containerRect.bottom - middleY;
473
472
  const isWrapperWidthOverflow = wrapperRect.width > innerWidth;
474
- const scaled = Math.abs((wrapperRect === null || wrapperRect === void 0 ? void 0 : wrapperRect.width) - ((_a = this._adapter.getContainer()) === null || _a === void 0 ? void 0 : _a.clientWidth)) > 1;
475
- if (scaled) {
476
- SPACING = SPACING * wrapperRect.width / this._adapter.getContainer().clientWidth;
477
- }
478
473
  switch (position) {
479
474
  case 'top':
480
475
  // left = middleX;
@@ -591,12 +586,6 @@ export default class Tooltip extends BaseFoundation {
591
586
  // Calculate container positioning relative to window
592
587
  left = left - containerRect.left;
593
588
  top = top - containerRect.top;
594
- if (scaled) {
595
- left /= wrapperRect.width / this._adapter.getContainer().clientWidth;
596
- }
597
- if (scaled) {
598
- top /= wrapperRect.height / this._adapter.getContainer().clientHeight;
599
- }
600
589
  /**
601
590
  * container为body时,如果position不为relative或absolute,这时trigger计算出的top/left会根据html定位(initial containing block)
602
591
  * 此时如果body有margin,则计算出的位置相对于body会有问题 fix issue #1368
@@ -96,6 +96,7 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
96
96
  closeMenu: (cb?: () => void) => void;
97
97
  getTriggerWidth: () => boolean | number;
98
98
  setOptionWrapperWidth: (width: null | number) => void;
99
+ notifyClear: (e: any) => void;
99
100
  notifyChange: BasicOnChangeWithBasic;
100
101
  notifyChangeWithObject: BasicOnChangeWithObject;
101
102
  notifyExpand: (expandedKeys: Set<string>, expandedOtherProps: BasicExpandedOtherProps) => void;
@@ -378,6 +378,7 @@ export default class TreeSelectFoundation extends BaseFoundation {
378
378
  }
379
379
  }
380
380
  }
381
+ this._adapter.notifyClear(e);
381
382
  }
382
383
  /**
383
384
  * A11y: simulate clear button click
package/modal/modal.scss CHANGED
@@ -70,7 +70,11 @@ $module: #{$prefix}-modal;
70
70
  padding: $spacing-modal_content-paddingY $spacing-modal_content-paddingX;
71
71
  background-clip: padding-box;
72
72
  overflow: hidden;
73
- @include shadow-elevated;
73
+ box-shadow: $shadow-modal_content;
74
+ }
75
+
76
+ &-footerfill{
77
+ display: flex;
74
78
  }
75
79
 
76
80
  &-content-fullScreen {
@@ -54,7 +54,8 @@ export interface ModalProps {
54
54
  keepDOM?: boolean;
55
55
  direction?: any;
56
56
  fullScreen?: boolean;
57
- preventScroll?: boolean
57
+ preventScroll?: boolean;
58
+ footerFill?: boolean
58
59
  }
59
60
 
60
61
  export interface ModalState {
@@ -71,3 +71,7 @@ $color-modal_footer-border:transparent; // 模态框 footer 顶部描边颜色
71
71
  $width-modal_footer-border:0; // 模态框 footer 顶部描边宽度
72
72
 
73
73
 
74
+ //shadow
75
+ $shadow-modal_content: var(--semi-shadow-elevated)
76
+
77
+
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.51.4",
3
+ "version": "2.52.0-beta.0",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build:lib": "node ./scripts/compileLib.js",
7
7
  "prepublishOnly": "npm run build:lib"
8
8
  },
9
9
  "dependencies": {
10
- "@douyinfe/semi-animation": "2.51.4",
10
+ "@douyinfe/semi-animation": "2.52.0-beta.0",
11
11
  "async-validator": "^3.5.0",
12
12
  "classnames": "^2.2.6",
13
13
  "date-fns": "^2.29.3",
@@ -23,7 +23,7 @@
23
23
  "*.scss",
24
24
  "*.css"
25
25
  ],
26
- "gitHead": "b8cad87796be9b6b10409a95d3a5b4cb8b9592e6",
26
+ "gitHead": "92b9e3fc80cd5a352f6b9a1ffcb8f5191c688d95",
27
27
  "devDependencies": {
28
28
  "@babel/plugin-transform-runtime": "^7.15.8",
29
29
  "@babel/preset-env": "^7.15.8",
@@ -8,6 +8,7 @@ const cssClasses = {
8
8
  DOTS: `${BASE_CLASS_PREFIX}-slider-dots`,
9
9
  MARKS: `${BASE_CLASS_PREFIX}-slider-marks`,
10
10
  HANDLE: `${BASE_CLASS_PREFIX}-slider-handle`,
11
+ HANDLE_DOT: `${BASE_CLASS_PREFIX}-slider-handle-dot`,
11
12
  };
12
13
 
13
14
  const strings = {
@@ -36,7 +36,14 @@ export interface SliderProps{
36
36
  'aria-label'?: string;
37
37
  'aria-labelledby'?: string;
38
38
  'aria-valuetext'?: string;
39
- getAriaValueText?: (value: number, index?: number) => string
39
+ getAriaValueText?: (value: number, index?: number) => string;
40
+ handleDot?: {
41
+ size?: string;
42
+ color?: string
43
+ } & ({
44
+ size?: string;
45
+ color?: string
46
+ }[])
40
47
  }
41
48
 
42
49
  export interface SliderState {
@@ -58,9 +58,19 @@ $module: #{$prefix}-slider;
58
58
  cursor: pointer;
59
59
  transition: background-color $transition_duration_slider_handle-bg $transition_function-slider-handle-bg $transition_delay-slider_handle-bg;
60
60
  transform: $transform_scale-slider_handle translateX(-50%) translateY($spacing-slider_handle-translateY);
61
+ display: inline-flex;
62
+ justify-content: center;
63
+ align-items: center;
61
64
  &:focus-visible {
62
65
  outline: $width-slider_handle-focus solid $color-slider_handle-focus;
63
66
  }
67
+
68
+ &-dot{
69
+ background:$color-slider_handle_dot;
70
+ width:$width-slider_handle_dot;
71
+ height: $width-slider_handle_dot;
72
+ border-radius: var(--semi-border-radius-circle);
73
+ }
64
74
  }
65
75
 
66
76
  &-handle:hover {