@douyinfe/semi-foundation 2.63.1 → 2.63.2-alpha.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 (55) hide show
  1. package/chat/foundation.ts +18 -23
  2. package/datePicker/foundation.ts +1 -1
  3. package/image/image.scss +6 -1
  4. package/image/previewImageFoundation.ts +233 -150
  5. package/image/previewInnerFoundation.ts +11 -6
  6. package/lib/cjs/base/foundation.js +1 -1
  7. package/lib/cjs/chat/foundation.d.ts +1 -2
  8. package/lib/cjs/chat/foundation.js +2 -7
  9. package/lib/cjs/checkbox/checkboxGroupFoundation.js +1 -1
  10. package/lib/cjs/datePicker/foundation.js +1 -1
  11. package/lib/cjs/image/image.css +5 -1
  12. package/lib/cjs/image/image.scss +6 -1
  13. package/lib/cjs/image/previewImageFoundation.d.ts +46 -13
  14. package/lib/cjs/image/previewImageFoundation.js +207 -181
  15. package/lib/cjs/image/previewInnerFoundation.d.ts +4 -3
  16. package/lib/cjs/image/previewInnerFoundation.js +5 -2
  17. package/lib/cjs/navigation/foundation.d.ts +8 -8
  18. package/lib/cjs/navigation/itemFoundation.d.ts +5 -4
  19. package/lib/cjs/radio/radioInnerFoundation.js +1 -1
  20. package/lib/cjs/table/utils.d.ts +1 -1
  21. package/lib/cjs/tabs/constants.d.ts +1 -0
  22. package/lib/cjs/tabs/constants.js +2 -1
  23. package/lib/cjs/tabs/tabs.css +28 -199
  24. package/lib/cjs/tabs/tabs.scss +336 -297
  25. package/lib/cjs/tabs/variables.scss +21 -2
  26. package/lib/cjs/tree/treeUtil.d.ts +1 -1
  27. package/lib/cjs/upload/constants.d.ts +1 -1
  28. package/lib/es/base/foundation.js +1 -1
  29. package/lib/es/chat/foundation.d.ts +1 -2
  30. package/lib/es/chat/foundation.js +2 -7
  31. package/lib/es/checkbox/checkboxGroupFoundation.js +1 -1
  32. package/lib/es/datePicker/foundation.js +1 -1
  33. package/lib/es/image/image.css +5 -1
  34. package/lib/es/image/image.scss +6 -1
  35. package/lib/es/image/previewImageFoundation.d.ts +46 -13
  36. package/lib/es/image/previewImageFoundation.js +207 -181
  37. package/lib/es/image/previewInnerFoundation.d.ts +4 -3
  38. package/lib/es/image/previewInnerFoundation.js +5 -2
  39. package/lib/es/navigation/foundation.d.ts +8 -8
  40. package/lib/es/navigation/itemFoundation.d.ts +5 -4
  41. package/lib/es/radio/radioInnerFoundation.js +1 -1
  42. package/lib/es/table/utils.d.ts +1 -1
  43. package/lib/es/tabs/constants.d.ts +1 -0
  44. package/lib/es/tabs/constants.js +2 -1
  45. package/lib/es/tabs/tabs.css +28 -199
  46. package/lib/es/tabs/tabs.scss +336 -297
  47. package/lib/es/tabs/variables.scss +21 -2
  48. package/lib/es/tree/treeUtil.d.ts +1 -1
  49. package/lib/es/upload/constants.d.ts +1 -1
  50. package/navigation/foundation.ts +8 -8
  51. package/navigation/itemFoundation.ts +6 -4
  52. package/package.json +3 -3
  53. package/tabs/constants.ts +2 -1
  54. package/tabs/tabs.scss +336 -297
  55. package/tabs/variables.scss +21 -2
@@ -26,9 +26,13 @@ $color-tabs_tab_line_disabled-text-hover: var(--semi-color-disabled-text); //
26
26
 
27
27
  $color-tabs_tab_card_default-border-default: var(--semi-color-border); // 卡片式页签描边颜色 - 默认
28
28
 
29
+ $color-tabs_tab_button-bg-default: transparent; // 按钮式页签背景颜色 - 默认
29
30
  $color-tabs_tab_button_selected-bg-default: var(--semi-color-primary-light-default); // 按钮式页签背景颜色 - 选中
30
31
  $color-tabs_tab_button_selected-text-default: var(--semi-color-primary); // 按钮式页签文本颜色 - 选中
31
32
  $color-tabs_tab_button-text-default: var(--semi-color-text-2); // 按钮式页签文本颜色 - 默认
33
+ $color-tabs_tab_button-text-active: var(--semi-color-text-0); // 按钮式页签文本颜色 - 按下
34
+ $color-tabs_tab_button-text-hover: var(--semi-color-text-0); // 按钮式页签文本颜色 - 按下
35
+
32
36
  $color-tabs_tab_button-bg-hover: var(--semi-color-fill-0); // 按钮式页签背景颜色 - 悬浮
33
37
  $color-tabs_tab_button-bg-active: var(--semi-color-fill-1); // 按钮式页签背景颜色 - 按下
34
38
 
@@ -65,6 +69,10 @@ $color-tabs_tab-pane_arrow_disabled-bg-hover: transparent;
65
69
  $color-tabs_tab-pane_arrow_disabled-text-default: var(--semi-color-disabled-text);
66
70
  $color-tabs_tab-pane_arrow_disabled-text-hover: var(--semi-color-disabled-text);
67
71
 
72
+ $color-tabs_tab_slash_line: var(--semi-color-text-2); //斜线式页签分割线字体颜色
73
+ // $font-tabs_tab_slash_line-fontWeight: $font-weight-regular; //斜线式页签分割线字重
74
+ $font-tabs_tab_slash_line-fontSize: $font-size-regular; //斜线式页签分割线字体大小
75
+
68
76
  $font-tabs_tab-fontWeight: $font-weight-regular; // 页签文本字重 - 默认
69
77
  $font-tabs_tab_active-fontWeight: $font-weight-bold; // 页签文本字重 - 选中
70
78
 
@@ -118,6 +126,11 @@ $spacing-tabs_bar_line_tab_left-padding: 12px; // 垂直线条式页签左侧内
118
126
  $spacing-tabs_bar_line_tab_left_small-padding: $spacing-tight - 2px; // 小尺寸垂直线条式页签左侧内边距
119
127
  $spacing-tabs_bar_line_tab_left_medium-padding: $spacing-base-tight - 2px; // 中等尺寸垂直线条式页签左侧内边距
120
128
 
129
+ $spacing-tabs_bar_slash_tab-paddingY: 12px; // 斜线式页签上下内边距
130
+ $spacing-tabs_bar_slash_tab-paddingX: 4px; // 斜线式页签水平内边距
131
+ $spacing-tabs_bar_slash-marginRight: 16px; // 斜线式页签右侧外边距
132
+ $spacing-tabs_bar_slash_line_marginLeft: 16px; // 斜线式页签斜线左侧外边距
133
+
121
134
  $spacing-tabs_content-paddingY: 5px; // 页签内容区垂直方向内边距
122
135
  $spacing-tabs_content-paddingX: 0; // 页签内容区水平方向内边距
123
136
 
@@ -148,5 +161,11 @@ $radius-tabs_tab_button: var(--semi-border-radius-small); // 按钮式页签圆
148
161
  $font-tabs_bar_large-fontSize: $font-size-regular; // 大号模式 字体大小
149
162
  $font-tabs_bar_small-fontSize: $font-size-regular; // 小号模式 字体大小
150
163
  $font-tabs_bar_medium-fontSize: $font-size-regular; // 中等模式 字体大小
151
-
152
-
164
+ $font-tabs_bar_button-fontSize: $font-size-regular; // 按钮式页签 字体大小
165
+ $font-tabs_bar_slash-fontSize: $font-size-regular; // 斜线式页签 字体大小
166
+
167
+ $font-tabs_bar_large-lineHeight: 20px; // 线条式页签大号模式 行高
168
+ $font-tabs_bar_small-lineHeight: 20px; // 线条式页签小号模式 行高
169
+ $font-tabs_bar_medium-lineHeight: 20px; // 线条式页签中等模式 行高
170
+ $font-tabs_bar_button-lineHeight: 20px; // 按钮式页签 行高
171
+ $font-tabs_bar_slash-lineHeight: 20px; // 卡片式页签 行高
@@ -83,6 +83,6 @@ export declare function getValueOrKey(data: any, keyMaps?: KeyMapProps): any;
83
83
  export declare function normalizeValue(value: any, withObject: boolean, keyMaps?: KeyMapProps): any;
84
84
  export declare function updateKeys(keySet: Set<string> | string[], keyEntities: KeyEntities): string[];
85
85
  export declare function calcDisabledKeys(keyEntities: KeyEntities, keyMaps?: KeyMapProps): Set<string>;
86
- export declare function calcDropRelativePosition(event: any, treeNode: any): 1 | -1 | 0;
86
+ export declare function calcDropRelativePosition(event: any, treeNode: any): 0 | 1 | -1;
87
87
  export declare function getDragNodesKeys(key: string, keyEntities: KeyEntities): string[];
88
88
  export declare function calcDropActualPosition(pos: string, relativeDropPos: any): any;
@@ -18,7 +18,7 @@ declare const strings: {
18
18
  DRAG_AREA_ILLEGAL: string;
19
19
  TRIGGER_AUTO: "auto";
20
20
  TRIGGER_CUSTOM: "custom";
21
- UPLOAD_TRIGGER: ("auto" | "custom")[];
21
+ UPLOAD_TRIGGER: ("custom" | "auto")[];
22
22
  VALIDATE_STATUS: readonly ["default", "error", "warning", "success"];
23
23
  PROMPT_POSITION: readonly ["left", "right", "bottom"];
24
24
  };
@@ -1,6 +1,6 @@
1
1
  import BaseFoundation, { DefaultAdapter } from '../base/foundation';
2
2
  import NavItem from './NavItem';
3
- import { ItemProps } from './itemFoundation';
3
+ import { ItemProps, ItemKey } from './itemFoundation';
4
4
  import { strings } from './constants';
5
5
  import { get } from 'lodash';
6
6
  import isNullOrUndefined from '../utils/isNullOrUndefined';
@@ -10,18 +10,18 @@ export interface ItemKey2ParentKeysMap {
10
10
  }
11
11
 
12
12
  export interface OnClickData {
13
- itemKey: string | number;
13
+ itemKey: ItemKey;
14
14
  domEvent: any;
15
15
  isOpen: boolean
16
16
  }
17
17
 
18
18
  export interface OnSelectData extends OnClickData {
19
- selectedKeys: (string | number)[];
19
+ selectedKeys: ItemKey[];
20
20
  selectedItems: ItemProps[]
21
21
  }
22
22
 
23
23
  export interface OnOpenChangeData extends OnClickData {
24
- openKeys: (string | number)[]
24
+ openKeys: ItemKey[]
25
25
  }
26
26
 
27
27
  export interface NavItemType {
@@ -52,7 +52,7 @@ export default class NavigationFoundation<P = Record<string, any>, S = Record<st
52
52
  }
53
53
 
54
54
  /* istanbul ignore next */
55
- static getZeroParentKeys(itemKeysMap = {}, ...itemKeys: (string | number)[]) {
55
+ static getZeroParentKeys(itemKeysMap = {}, ...itemKeys: ItemKey[]) {
56
56
  const willAddKeys = [];
57
57
  if (itemKeys.length) {
58
58
  for (const itemKey of itemKeys) {
@@ -182,7 +182,7 @@ export default class NavigationFoundation<P = Record<string, any>, S = Record<st
182
182
  return [...willOpenKeys];
183
183
  }
184
184
 
185
- getShouldOpenKeys(itemKeysMap: ItemKey2ParentKeysMap = {}, selectedKeys: (string | number)[] = []) {
185
+ getShouldOpenKeys(itemKeysMap: ItemKey2ParentKeysMap = {}, selectedKeys: ItemKey[] = []) {
186
186
  const willOpenKeySet = new Set();
187
187
 
188
188
  if (Array.isArray(selectedKeys) && selectedKeys.length) {
@@ -202,7 +202,7 @@ export default class NavigationFoundation<P = Record<string, any>, S = Record<st
202
202
 
203
203
  destroy() {}
204
204
 
205
- selectLevelZeroParentKeys(itemKeysMap: ItemKey2ParentKeysMap, itemKeys: (string | number)[]) {
205
+ selectLevelZeroParentKeys(itemKeysMap: ItemKey2ParentKeysMap, itemKeys: ItemKey[]) {
206
206
  const _itemKeysMap = isNullOrUndefined(itemKeysMap) ? this.getState('itemKeysMap') : itemKeysMap;
207
207
  // console.log(itemKeysMap);
208
208
 
@@ -236,7 +236,7 @@ export default class NavigationFoundation<P = Record<string, any>, S = Record<st
236
236
  }
237
237
 
238
238
  /* istanbul ignore next */
239
- judgeIfOpen(openKeys: (string | number)[], items: NavItemType[]): boolean {
239
+ judgeIfOpen(openKeys: ItemKey[], items: NavItemType[]): boolean {
240
240
  let shouldBeOpen = false;
241
241
 
242
242
  const _openKeys = Array.isArray(openKeys) ? openKeys : openKeys && [openKeys];
@@ -17,10 +17,12 @@ export interface ItemProps {
17
17
  children?: any
18
18
  }
19
19
 
20
+ export type ItemKey = string | number;
21
+
20
22
  export interface SelectedItemProps<Props = ItemProps> {
21
- itemKey: string | number;
23
+ itemKey: ItemKey;
22
24
  text?: any;
23
- selectedKeys?: string | number[];
25
+ selectedKeys?: ItemKey[];
24
26
  selectedItems?: Props[];
25
27
  domEvent?: any
26
28
  }
@@ -29,8 +31,8 @@ export interface ItemAdapter<P = Record<string, any>, S = Record<string, any>> e
29
31
  cloneDeep(value: any, customizer?: (value: any) => void): any;
30
32
  updateTooltipShow(showTooltip: boolean): void;
31
33
  updateSelected(selected: boolean): void;
32
- updateGlobalSelectedKeys(keys: string[]): void;
33
- getSelectedKeys(): string[];
34
+ updateGlobalSelectedKeys(keys: ItemKey[]): void;
35
+ getSelectedKeys(): ItemKey[];
34
36
  getSelectedKeysIsControlled(): boolean;
35
37
  notifyGlobalOnSelect(item: SelectedItemProps): void;
36
38
  notifyGlobalOnClick(item: SelectedItemProps): void;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@douyinfe/semi-foundation",
3
- "version": "2.63.1",
3
+ "version": "2.63.2-alpha.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.63.1",
10
+ "@douyinfe/semi-animation": "2.63.2-alpha.0",
11
11
  "@mdx-js/mdx": "^3.0.1",
12
12
  "async-validator": "^3.5.0",
13
13
  "classnames": "^2.2.6",
@@ -28,7 +28,7 @@
28
28
  "*.scss",
29
29
  "*.css"
30
30
  ],
31
- "gitHead": "fe089777be38c7efc3c939e1fcad6bc22fd6ca30",
31
+ "gitHead": "da3c8fa2fd069e2eaf585659a6df12016483e236",
32
32
  "devDependencies": {
33
33
  "@babel/plugin-transform-runtime": "^7.15.8",
34
34
  "@babel/preset-env": "^7.15.8",
package/tabs/constants.ts CHANGED
@@ -6,6 +6,7 @@ const cssClasses = {
6
6
  TABS_BAR_LINE: `${BASE_CLASS_PREFIX}-tabs-bar-line`,
7
7
  TABS_BAR_CARD: `${BASE_CLASS_PREFIX}-tabs-bar-card`,
8
8
  TABS_BAR_BUTTON: `${BASE_CLASS_PREFIX}-tabs-bar-button`,
9
+ TABS_BAR_SLASH: `${BASE_CLASS_PREFIX}-tabs-bar-slash`,
9
10
  TABS_BAR_EXTRA: `${BASE_CLASS_PREFIX}-tabs-bar-extra`,
10
11
  TABS_TAB: `${BASE_CLASS_PREFIX}-tabs-tab`,
11
12
  TABS_TAB_ACTIVE: `${BASE_CLASS_PREFIX}-tabs-tab-active`,
@@ -29,7 +30,7 @@ const numbers = {
29
30
  };
30
31
 
31
32
  const strings = {
32
- TYPE_MAP: ['line', 'card', 'button'],
33
+ TYPE_MAP: ['line', 'card', 'button', 'slash'],
33
34
  SIZE: ['small', 'medium', 'large'],
34
35
  POSITION_MAP: ['top', 'left']
35
36
  };