diff --git a/content/start/changelog/index-en-US.md b/content/start/changelog/index-en-US.md index b49e88e1cf..79139c745e 100644 --- a/content/start/changelog/index-en-US.md +++ b/content/start/changelog/index-en-US.md @@ -15,6 +15,14 @@ Version:Major.Minor.Patch (follow the **Semver** specification) - **Patch version**: Only include bug fix, the release time is not limited --- + +#### 🎉 2.45.0 (2023-10-20) +- 【Fix】 + - resizable Table width reset to initial bug(Affected v2.32~v2.44) + - Fixed the problem of incorrect update of select ellipsisTrigger under certain boundary conditions + - Fixed the problem of asynchronous loading of data in Tree/TreeSelect where checkRelation is unRelated, causing the selected status to be lost. + - Fix the issue of selecting ellipsisTrigger displaying more quantities incorrectly [#1560](https://github.com/DouyinFE/semi-design/issues/1560) [@Jon-Millent](https://github.com/Jon-Millent) + #### 🎉 2.45.0-beta.0 (2023-10-13) - 【Fix】 - Fixed the problem that when Select virtualization and renderCreateItem are used at the same time, the display position of custom creation options is incorrect. [#1856](https://github.com/DouyinFE/semi-design/issues/1856) diff --git a/content/start/changelog/index.md b/content/start/changelog/index.md index 223bfceb28..15c2a7ddc0 100644 --- a/content/start/changelog/index.md +++ b/content/start/changelog/index.md @@ -13,6 +13,13 @@ Semi 版本号遵循 **Semver** 规范(主版本号-次版本号-修订版本 - 修订版本号(patch):仅会进行 bugfix,发布时间不限 - 不同版本间的详细关系,可查阅 [FAQ](/zh-CN/start/faq) +#### 🎉 2.45.0 (2023-10-20) +- 【Fix】 + - 修复 resizable Table 宽度在行选择时错误设置为初始值问题(影响 v2.32~v2.44) + - 修复 select ellipsisTrigger 在某些边界条件下更新不正确的问题 + - 修复 checkRelation 为 unRelated 的 Tree/TreeSelect 中,异步加载数据导致已选状态丢失问题 + - 修复 select ellipsisTrigger 更多数量显示错误的问题 [#1560](https://github.com/DouyinFE/semi-design/issues/1560) [@Jon-Millent](https://github.com/Jon-Millent) + #### 🎉 2.45.0-beta.0 (2023-10-13) - 【Fix】 - 修复 Select 虚拟化与 renderCreateItem 同时使用时,自定义创建选项显示位置不正确的问题 [#1856](https://github.com/DouyinFE/semi-design/issues/1856) diff --git a/content/start/introduction/index-en-US.md b/content/start/introduction/index-en-US.md index efec448145..f4591d819b 100644 --- a/content/start/introduction/index-en-US.md +++ b/content/start/introduction/index-en-US.md @@ -32,7 +32,7 @@ In addition, a good design system must be "live", it needs to be able to develop How does Semi become flexible and changeable on the basis of coherence and unity? The answer is a powerful theming program. By layering and sorting out thousands of design variables (Design Token), designers and developers can deeply customize the presentation layer at the global and even component level-even if you don’t know CSS, you can use the theme editor (DSM), to create a style that meets the diverse visual needs of the business and brand. Developers can publish and replace with one click through the npm package, which is easy to customize and easy to manage. -You can check Semi's official sample themes in different brand scenarios such as Douyin, Cut Ying, Feishu, Volcano Engine, etc. in [Semi DSM](https://semi.design/dsm/store) +You can check Semi's official sample themes in different brand scenarios such as Douyin, Cut Ying, Feishu, Volcano Engine, etc. in [Semi DSM](https://semi.design/dsm_store) Within this year, we will also realize real-time synchronization of themes from online to design tools-while improving efficiency, we will further ensure the continuous alignment of design and R&D, and reduce the cost of communication between production and research. diff --git a/content/start/introduction/index.md b/content/start/introduction/index.md index 69e2466c5f..ab5f198dd3 100644 --- a/content/start/introduction/index.md +++ b/content/start/introduction/index.md @@ -34,7 +34,7 @@ Semi 是如何在连贯统一的基础上,做到灵活多变的?答案是强 通过对数千个设计变量 (Design Token) 的分层和梳理,设计师和开发者可在全局、乃至组件级别,对 表现层进行深度定制 —— 即使你不了解 CSS,也可以**通过主题编辑器(DSM),打造符合业务和品牌多样化视觉需求的风格**。开发者则可通过 npm 包一键发布并替换,轻松定制,易于管理。 -你可以在[Semi DSM](https://semi.design/dsm/store),查看 Semi 在抖音、剪映、飞书、火山引擎等不同品牌场景下的官方示例主题。 +你可以在[Semi DSM](https://semi.design/dsm_store),查看 Semi 在抖音、剪映、飞书、火山引擎等不同品牌场景下的官方示例主题。 ![全面覆盖的设计变量用例、文档与编辑器](https://lf3-static.bytednsdoc.com/obj/eden-cn/ptlz_zlp/ljhwZthlaukjlkulzlp/tech-doc/p3.gif) diff --git a/cypress/e2e/inputNumber.spec.js b/cypress/e2e/inputNumber.spec.js index fc2b3f3a6c..a7ad9c39f1 100644 --- a/cypress/e2e/inputNumber.spec.js +++ b/cypress/e2e/inputNumber.spec.js @@ -58,4 +58,18 @@ describe('inputNumber', () => { cy.get('.semi-input-number .semi-input-number-button-down').click(); cy.get('.semi-input-number .semi-input').should('have.value', '60000'); }); + + it('fixed formatter error in controlled mode + focus and click add button', () => { + cy.visit('http://localhost:6006/iframe.html?id=inputnumber--fix-1772&viewMode=story'); + cy.get('.semi-input-number .semi-input').should('have.value', '60000'); + cy.get('.semi-input-number .semi-input').click(); + cy.get('.semi-input-number .semi-input-number-button-up').click(); + cy.get('.semi-input-number .semi-input').should('have.value', '60001'); + cy.get('.semi-input-number .semi-input-number-button-up').click(); + cy.get('.semi-input-number .semi-input').should('have.value', '60002'); + cy.get('.semi-input-number .semi-input-number-button-down').click(); + cy.get('.semi-input-number .semi-input').should('have.value', '60001'); + cy.get('.semi-input-number .semi-input-number-button-down').click(); + cy.get('.semi-input-number .semi-input').should('have.value', '60000'); + }); }); \ No newline at end of file diff --git a/cypress/e2e/select.spec.js b/cypress/e2e/select.spec.js index c2878dbb7f..fd0a39149b 100644 --- a/cypress/e2e/select.spec.js +++ b/cypress/e2e/select.spec.js @@ -62,6 +62,34 @@ describe('Select', () => { cy.wait(500); cy.get('.semi-select-option').should('have.text', 'Design'); }); + + // it('ellipsisTrigger', () => { + // cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/select--fix-1560'); + + // // add option + // cy.get('.semi-select-arrow').eq(0).click(); + // cy.get('.semi-select-option').contains('剪映').click(); + // cy.get('.semi-tag-grey-light').eq(0).contains('+2'); + + // // reduce option + // cy.get('.semi-select-arrow').eq(0).click(); + // cy.get('.semi-select-option').contains('抖音').click(); + // cy.get('.semi-tag-large').eq(2).contains('剪映'); + + // cy.get('body').click('right'); + + // // reduce option + // cy.get('.semi-select-arrow').eq(1).click(); + // cy.get('.semi-select-option').contains('西瓜视频').click(); + // cy.get('.semi-tag-grey-light').eq(0).contains('+1'); + + // // add option + // cy.get('.semi-select-arrow').eq(1).click(); + // cy.get('.semi-select-option').contains('西瓜视频').click(); + // cy.get('.semi-tag-grey-light').eq(0).contains('+2'); + + // }); + // it('should trigger onSearch when click x icon', () => { // cy.visit('http://127.0.0.1:6006/iframe.html?path=/story/select--select-filter-single'); // cy.get('.semi-select').eq(0).click(); diff --git a/cypress/e2e/tree.spec.js b/cypress/e2e/tree.spec.js index 4c21131fdb..05ae209ab5 100644 --- a/cypress/e2e/tree.spec.js +++ b/cypress/e2e/tree.spec.js @@ -32,5 +32,13 @@ describe('tree', () => { cy.get('.semi-tree-option-expand-icon'); }); + it("unRelated + async load", () => { + cy.visit('http://127.0.0.1:6006/iframe.html?id=tree--un-related-and-async-load&args=&viewMode=story'); + cy.get('.semi-checkbox').eq(0).get('.semi-checkbox-inner-checked').should("exist"); + cy.get('.semi-icon-tree_triangle_down').eq(0).trigger('click'); + // sync load, 1000ms + cy.wait(1000); + cy.get('.semi-checkbox').eq(0).get('.semi-checkbox-inner-checked').should("exist"); + }); }); \ No newline at end of file diff --git a/cypress/e2e/treeSelect.spec.js b/cypress/e2e/treeSelect.spec.js index fb525bf02d..119eea0711 100644 --- a/cypress/e2e/treeSelect.spec.js +++ b/cypress/e2e/treeSelect.spec.js @@ -108,5 +108,14 @@ describe('treeSelect', () => { cy.get('.semi-tree-select').eq(1).click(); cy.get('.semi-tree-select-popover').should('exist'); }); + + it("unRelated + async load", () => { + cy.visit('http://127.0.0.1:6006/iframe.html?id=treeselect--un-related-and-async-load'); + cy.get('.semi-checkbox').eq(0).get('.semi-checkbox-inner-checked').should("exist"); + cy.get('.semi-icon-tree_triangle_down').eq(0).trigger('click'); + // sync load, 1000ms + cy.wait(1000); + cy.get('.semi-checkbox').eq(0).get('.semi-checkbox-inner-checked').should("exist"); + }); }); diff --git a/gatsby-node.js b/gatsby-node.js index 953c7f5e29..29628e3b2b 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -99,6 +99,7 @@ exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => alias: { 'semi-site-header': process.env.SEMI_SITE_HEADER || '@douyinfe/semi-site-header', 'semi-site-banner': process.env.SEMI_SITE_BANNER || '@douyinfe/semi-site-banner', + 'univers-webview': process.env.SEMI_SITE_UNIVERS_WEBVIEW || resolve('packages/semi-ui'), '@douyinfe/semi-ui': resolve('packages/semi-ui'), '@douyinfe/semi-foundation': resolve('packages/semi-foundation'), '@douyinfe/semi-icons': resolve('packages/semi-icons/src/'), @@ -170,6 +171,7 @@ exports.onCreateWebpackConfig = ({ stage, rules, loaders, plugins, actions }) => "DSM_URL": JSON.stringify(process.env['DSM_URL']), 'process.env.SEMI_SITE_HEADER': JSON.stringify(process.env.SEMI_SITE_HEADER), 'process.env.SEMI_SITE_BANNER': JSON.stringify(process.env.SEMI_SITE_BANNER), + "process.env.SEMI_SITE_UNIVERS_WEBVIEW": JSON.stringify(process.env.SEMI_SITE_UNIVERS_WEBVIEW), 'process.env.D2C_URL': JSON.stringify(process.env.D2C_URL), "ASSET_PREFIX":JSON.stringify((process.env['CDN_OUTER_CN'] || process.env['CDN_INNER_CN']) ? `https://${(process.env['CDN_OUTER_CN'] || process.env['CDN_INNER_CN'])}/${process.env['CDN_PATH_PREFIX']}`: ""), })], diff --git a/lerna.json b/lerna.json index 6cc3467bc5..da2fc686b1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { "useWorkspaces": true, "npmClient": "yarn", - "version": "2.45.0-beta.0" -} + "version": "2.45.2" +} \ No newline at end of file diff --git a/packages/semi-animation-react/package.json b/packages/semi-animation-react/package.json index 45779e25d9..ea054f9103 100644 --- a/packages/semi-animation-react/package.json +++ b/packages/semi-animation-react/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-animation-react", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "motion library for semi-ui-react", "keywords": [ "motion", @@ -25,8 +25,8 @@ "prepublishOnly": "npm run build:lib" }, "dependencies": { - "@douyinfe/semi-animation": "2.45.0-beta.0", - "@douyinfe/semi-animation-styled": "2.45.0-beta.0", + "@douyinfe/semi-animation": "2.45.2", + "@douyinfe/semi-animation-styled": "2.45.2", "classnames": "^2.2.6" }, "devDependencies": { diff --git a/packages/semi-animation-styled/package.json b/packages/semi-animation-styled/package.json index 82c2f2f6f9..49bdc248bb 100644 --- a/packages/semi-animation-styled/package.json +++ b/packages/semi-animation-styled/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-animation-styled", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "semi styled animation", "keywords": [ "semi", diff --git a/packages/semi-animation/package.json b/packages/semi-animation/package.json index 7586d36e1f..6bdc4cab5b 100644 --- a/packages/semi-animation/package.json +++ b/packages/semi-animation/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-animation", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "animation base library for semi-ui", "keywords": [ "animation", diff --git a/packages/semi-eslint-plugin/package.json b/packages/semi-eslint-plugin/package.json index aafc862764..cbb524020a 100644 --- a/packages/semi-eslint-plugin/package.json +++ b/packages/semi-eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-semi-design", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "semi ui eslint plugin", "keywords": [ "semi", diff --git a/packages/semi-foundation/package.json b/packages/semi-foundation/package.json index d945207747..f66aa28d96 100644 --- a/packages/semi-foundation/package.json +++ b/packages/semi-foundation/package.json @@ -1,13 +1,13 @@ { "name": "@douyinfe/semi-foundation", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "", "scripts": { "build:lib": "node ./scripts/compileLib.js", "prepublishOnly": "npm run build:lib" }, "dependencies": { - "@douyinfe/semi-animation": "2.45.0-beta.0", + "@douyinfe/semi-animation": "2.45.2", "async-validator": "^3.5.0", "classnames": "^2.2.6", "date-fns": "^2.29.3", diff --git a/packages/semi-foundation/select/option.scss b/packages/semi-foundation/select/option.scss index 8d7a3d35ad..62727233ef 100644 --- a/packages/semi-foundation/select/option.scss +++ b/packages/semi-foundation/select/option.scss @@ -73,7 +73,7 @@ $multiple: #{$module}-multiple; &-selected { font-weight: $font-weight-bold; - + background: $color-select-option-bg-selected; .#{$module}-option-icon { color: $color-select_option-icon-active; } diff --git a/packages/semi-foundation/select/variables.scss b/packages/semi-foundation/select/variables.scss index 2cffdd6912..ee7444b956 100644 --- a/packages/semi-foundation/select/variables.scss +++ b/packages/semi-foundation/select/variables.scss @@ -44,6 +44,7 @@ $color-select_option_disabled-text: var(--semi-color-disabled-text); // 禁用 $color-select_option_disabled-bg: transparent; // 禁用选择器菜单选项背景颜色 $color-select_option-icon-active: var(--semi-color-text-2); // 禁用选择器菜单选项图标颜色 - 选中态 $color-select_option-border-default: var(--semi-color-border); // 分组选择器菜单项描边颜色 +$color-select-option-bg-selected: transparent; // 选择器菜单选项背景颜色 - 选中态 $color-select_inset_label-text: var(--semi-color-text-2); // 分组选择器菜单项辅助文本颜色 $color-select_create_tips-text: var(--semi-color-text-2); // 分组选择器菜单项提示文本颜色 $color-select_group-text: var(--semi-color-text-2); // 分组选择器菜单项分组标题文本颜色 diff --git a/packages/semi-foundation/table/utils.ts b/packages/semi-foundation/table/utils.ts index ae3d960b8f..c70410d1d6 100644 --- a/packages/semi-foundation/table/utils.ts +++ b/packages/semi-foundation/table/utils.ts @@ -393,7 +393,7 @@ export function mergeQueries(query: Record, queries: Record[], newColumns: Record[]) { - const _newColumns = { ...newColumns }; + const _newColumns = [ ...newColumns ]; for (const column of columns) { if (!isNullOrUndefined(column.width)) { const currentColumn = column.key; diff --git a/packages/semi-icons-lab/package.json b/packages/semi-icons-lab/package.json index 9b658994ec..8eccfab220 100644 --- a/packages/semi-icons-lab/package.json +++ b/packages/semi-icons-lab/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-icons-lab", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "semi icons lab", "keywords": [ "semi", diff --git a/packages/semi-icons/package.json b/packages/semi-icons/package.json index 02ff68bf97..6c0fd9a1f0 100644 --- a/packages/semi-icons/package.json +++ b/packages/semi-icons/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-icons", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "semi icons", "keywords": [ "semi", diff --git a/packages/semi-illustrations/package.json b/packages/semi-illustrations/package.json index 2b43a932dd..ac8b583152 100644 --- a/packages/semi-illustrations/package.json +++ b/packages/semi-illustrations/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-illustrations", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "semi illustrations", "keywords": [ "semi", diff --git a/packages/semi-next/package.json b/packages/semi-next/package.json index 8b48f58306..73701e79fb 100644 --- a/packages/semi-next/package.json +++ b/packages/semi-next/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-next", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "Plugin that support Semi Design in Next.js", "author": "伍浩威 ", "homepage": "", @@ -23,7 +23,7 @@ "typescript": "^4" }, "dependencies": { - "@douyinfe/semi-webpack-plugin": "2.45.0-beta.0" + "@douyinfe/semi-webpack-plugin": "2.45.2" }, "gitHead": "eb34a4f25f002bb4cbcfa51f3df93bed868c831a" } diff --git a/packages/semi-rspack/package.json b/packages/semi-rspack/package.json index 9d3d8a4cfd..abfa10b654 100644 --- a/packages/semi-rspack/package.json +++ b/packages/semi-rspack/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-rspack-plugin", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "", "homepage": "", "license": "MIT", diff --git a/packages/semi-scss-compile/package.json b/packages/semi-scss-compile/package.json index 69dd2f6ca8..2b07ed3fe8 100644 --- a/packages/semi-scss-compile/package.json +++ b/packages/semi-scss-compile/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-scss-compile", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "compile semi scss to css", "author": "daiqiang@bytedance.com", "license": "MIT", diff --git a/packages/semi-theme-default/package.json b/packages/semi-theme-default/package.json index bc30a6a03a..95bee4eff2 100644 --- a/packages/semi-theme-default/package.json +++ b/packages/semi-theme-default/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-theme-default", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "semi-theme-default", "keywords": [ "semi-theme", diff --git a/packages/semi-ui/inputNumber/index.tsx b/packages/semi-ui/inputNumber/index.tsx index e0d45fe7df..8dca2b5fd1 100644 --- a/packages/semi-ui/inputNumber/index.tsx +++ b/packages/semi-ui/inputNumber/index.tsx @@ -303,7 +303,7 @@ class InputNumber extends BaseComponent { * We need to set the status to false after trigger focus event */ if (this.clickUpOrDown) { - obj.value = this.foundation.doFormat(valueStr, true); + obj.value = this.foundation.doFormat(obj.number, true); newValue = obj.value; } this.foundation.updateStates(obj, () => this.adapter.restoreCursor()); @@ -313,8 +313,7 @@ class InputNumber extends BaseComponent { this.foundation.updateStates({ value: newValue }); } else { // Update input content when controlled input NaN - newValue = this.foundation.doFormat(valueStr, false); - this.foundation.updateStates({ value: newValue }); + this.foundation.updateStates({ value: valueStr }); } } else if (this.foundation.isValidNumber(parsedNum)) { newValue = this.foundation.doFormat(parsedNum); diff --git a/packages/semi-ui/package.json b/packages/semi-ui/package.json index 26c66d455c..94a8564686 100644 --- a/packages/semi-ui/package.json +++ b/packages/semi-ui/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-ui", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.", "main": "lib/cjs/index.js", "module": "lib/es/index.js", @@ -20,12 +20,12 @@ "@dnd-kit/core": "^6.0.8", "@dnd-kit/sortable": "^7.0.2", "@dnd-kit/utilities": "^3.2.1", - "@douyinfe/semi-animation": "2.45.0-beta.0", - "@douyinfe/semi-animation-react": "2.45.0-beta.0", - "@douyinfe/semi-foundation": "2.45.0-beta.0", - "@douyinfe/semi-icons": "2.45.0-beta.0", - "@douyinfe/semi-illustrations": "2.45.0-beta.0", - "@douyinfe/semi-theme-default": "2.45.0-beta.0", + "@douyinfe/semi-animation": "2.45.2", + "@douyinfe/semi-animation-react": "2.45.2", + "@douyinfe/semi-foundation": "2.45.2", + "@douyinfe/semi-icons": "2.45.2", + "@douyinfe/semi-illustrations": "2.45.2", + "@douyinfe/semi-theme-default": "2.45.2", "async-validator": "^3.5.0", "classnames": "^2.2.6", "copy-text-to-clipboard": "^2.1.1", diff --git a/packages/semi-ui/select/_story/select.stories.jsx b/packages/semi-ui/select/_story/select.stories.jsx index 3d8f198bdf..0004e07b53 100644 --- a/packages/semi-ui/select/_story/select.stories.jsx +++ b/packages/semi-ui/select/_story/select.stories.jsx @@ -3289,6 +3289,44 @@ export const Fix1584 = () => { } +export const Fix1560 = () => { + return ( +
+

边界 case 测试

+

maxTagCount = 3,截断最后一个 tag, 加减项正常

+ +

+

maxTagCount = 3,最大宽度只展示 2 个 Tag,加减项正常

+ +
+ ); +} class VirtualizeAllowCreate extends React.Component { constructor(props) { @@ -3328,4 +3366,4 @@ class VirtualizeAllowCreate extends React.Component { } // virtualize allowCreate + renderCreateItem, optionList render not as expected -export const Fix1856 = () => (); \ No newline at end of file +export const Fix1856 = () => (); diff --git a/packages/semi-ui/select/index.tsx b/packages/semi-ui/select/index.tsx index 9731324c9f..7e4eda4568 100644 --- a/packages/semi-ui/select/index.tsx +++ b/packages/semi-ui/select/index.tsx @@ -181,14 +181,14 @@ export type SelectProps = { showRestTagsPopover?: boolean; restTagsPopoverProps?: PopoverProps } & Pick< -TooltipProps, -| 'spacing' -| 'getPopupContainer' -| 'motion' -| 'autoAdjustOverflow' -| 'mouseLeaveDelay' -| 'mouseEnterDelay' -| 'stopPropagation' + TooltipProps, + | 'spacing' + | 'getPopupContainer' + | 'motion' + | 'autoAdjustOverflow' + | 'mouseLeaveDelay' + | 'mouseEnterDelay' + | 'stopPropagation' > & React.RefAttributes; export interface SelectState { @@ -1092,11 +1092,8 @@ class Select extends BaseComponent { handleOverflow(items: [React.ReactNode, any][]) { const { overflowItemCount, selections } = this.state; const { maxTagCount } = this.props; - const maxVisibleCount = selections.size - maxTagCount; - const newOverFlowItemCount = maxVisibleCount > 0 ? maxVisibleCount + items.length - 1 : items.length - 1; - - // fix: issues 1560 - if (items.length >= 1 && overflowItemCount !== newOverFlowItemCount) { + const newOverFlowItemCount = selections.size - maxTagCount > 0 ? selections.size - maxTagCount + items.length - 1 : items.length - 1; + if (overflowItemCount !== newOverFlowItemCount) { this.foundation.updateOverflowItemCount(selections.size, newOverFlowItemCount); } } @@ -1109,6 +1106,7 @@ class Select extends BaseComponent {
this.renderOverflow(overflowItems as [React.ReactNode, any][], length - 1)} onOverflow={overflowItems => this.handleOverflow(overflowItems as [React.ReactNode, any][])} visibleItemRenderer={(item, index) => this.renderTag(item as [React.ReactNode, any], index)} diff --git a/packages/semi-ui/table/_story/table.stories.jsx b/packages/semi-ui/table/_story/table.stories.jsx index defac76b18..cd4f61f20c 100644 --- a/packages/semi-ui/table/_story/table.stories.jsx +++ b/packages/semi-ui/table/_story/table.stories.jsx @@ -100,7 +100,8 @@ export { Fixed1556, FixedColumnAlign, FixOnChange, - ColumnResize + ColumnResize, + FixedResizableRowSelection } from './v2'; export { default as FixSelectAll325 } from './Demos/rowSelection'; diff --git a/packages/semi-ui/table/_story/v2/FixedResizableRowSelection/index.jsx b/packages/semi-ui/table/_story/v2/FixedResizableRowSelection/index.jsx new file mode 100644 index 0000000000..82f07c143f --- /dev/null +++ b/packages/semi-ui/table/_story/v2/FixedResizableRowSelection/index.jsx @@ -0,0 +1,200 @@ +import React, { useMemo, useState, useCallback } from "react"; +import { get, union, pullAll } from "lodash-es"; +import { Table } from "@douyinfe/semi-ui"; + +const childrenRecordName = "children"; +const rowKey = "key"; +const getKey = (record) => get(record, rowKey, "key"); + +const Demo = () => { + const [selectedRowKeys, setSelectedRowKeys] = useState([]); + + const columns = useMemo( + () => [ + { + title: "Key", + dataIndex: "dataKey", + key: "dataKey" + }, + { + title: "名称", + dataIndex: "name", + key: "name", + width: 200 + }, + { + title: "数据类型", + dataIndex: "type", + key: "type", + width: 400 + }, + { + title: "描述", + dataIndex: "description", + key: "description" + }, + { + title: "默认值", + dataIndex: "default", + key: "default", + width: 100 + } + ], + [] + ); + + const data = useMemo( + () => [ + { + key: 1, + dataKey: "videos_info", + name: "视频信息", + type: "Object 对象", + description: "视频的元信息", + default: "无", + children: [ + { + key: 11, + dataKey: "status", + name: "视频状态", + type: "Enum 枚举", + description: "视频的可见、推荐状态", + default: "1" + }, + { + key: 12, + dataKey: "vid", + name: "视频 ID", + type: "String 字符串", + description: "标识视频的唯一 ID", + default: "无", + children: [ + { + key: 121, + dataKey: "video_url", + name: "视频地址", + type: "String 字符串", + description: "视频的唯一链接", + default: "无" + } + ] + } + ] + }, + { + key: 2, + dataKey: "text_info", + name: "文本信息", + type: "Object 对象", + description: "视频的元信息", + default: "无", + children: [ + { + key: 21, + dataKey: "title", + name: "视频标题", + type: "String 字符串", + description: "视频的标题", + default: "无" + }, + { + key: 22, + dataKey: "video_description", + name: "视频描述", + type: "String 字符串", + description: "视频的描述", + default: "无" + } + ] + } + ], + [] + ); + + // 自定义禁用逻辑 + const isRecordDisabled = (record) => { + return false; + }; + + const traverse = (data, res) => { + for (let record of data) { + const children = get(record, "children"); + const disabled = isRecordDisabled(record); + if (!disabled) { + const key = getKey(record); + res.push(key); + } + if (Array.isArray(children)) { + traverse(children, res); + } + } + }; + + const getAllRowKeys = (data) => { + const allRowKeys = []; + traverse(data, allRowKeys); + console.log("allRowKeys", allRowKeys); + return allRowKeys; + }; + + const findShouldSelectRowKeys = (record, selected) => { + let shouldSelectRowKeys; + const children = get(record, "children"); + let childrenRowKeys = []; + if (Array.isArray(children)) { + traverse(children, childrenRowKeys); + } + + const key = getKey(record); + if (!selected) { + shouldSelectRowKeys = [...selectedRowKeys]; + pullAll(shouldSelectRowKeys, [key, ...childrenRowKeys]); + } else { + shouldSelectRowKeys = union(selectedRowKeys, [key, ...childrenRowKeys]); + } + return shouldSelectRowKeys; + }; + + // 选中一行时需要选中自己可选行 + const doSelect = useCallback( + (record, selected) => { + const rowKeys = findShouldSelectRowKeys(record, selected); + setSelectedRowKeys(rowKeys); + console.log("select", record, rowKeys); + }, + [selectedRowKeys, rowKey, childrenRecordName] + ); + + // 找出所有可选的行 + const doSelectAll = useCallback((selected, selectedRows) => { + console.log(selected); + let rowKeys = []; + if (selected) { + rowKeys = getAllRowKeys(data); + } + setSelectedRowKeys(rowKeys); + }, []); + + const rowSelection = useMemo( + () => ({ + selectedRowKeys, + onSelect: doSelect, + onSelectAll: doSelectAll + }), + [selectedRowKeys, doSelect, doSelectAll] + ); + + return ( + + ); +}; + +export default Demo; diff --git a/packages/semi-ui/table/_story/v2/index.js b/packages/semi-ui/table/_story/v2/index.js index f8d6a43e01..2a18019f07 100644 --- a/packages/semi-ui/table/_story/v2/index.js +++ b/packages/semi-ui/table/_story/v2/index.js @@ -21,3 +21,4 @@ export { default as Fixed1556 } from './Fixed1556'; export { default as FixedColumnAlign } from './FixedColumnAlign'; export { default as FixOnChange } from './FixOnChange'; export { default as ColumnResize } from './ColumnResize'; +export { default as FixedResizableRowSelection } from './FixedResizableRowSelection'; diff --git a/packages/semi-ui/tree/_story/tree.stories.jsx b/packages/semi-ui/tree/_story/tree.stories.jsx index 69356a8eb0..8ae00acaa2 100644 --- a/packages/semi-ui/tree/_story/tree.stories.jsx +++ b/packages/semi-ui/tree/_story/tree.stories.jsx @@ -2693,4 +2693,74 @@ export const SearchableAndExpandedKeys = () => { /> ) -} \ No newline at end of file +} + +export const UnRelatedAndAsyncLoad = () => { + const initialData = [ + { + label: 'Expand to load0', + value: '0', + key: '0', + }, + { + label: 'Expand to load1', + value: '1', + key: '1', + }, + { + label: 'Leaf Node', + value: '2', + key: '2', + isLeaf: true, + }, + ]; + const [treeData, setTreeData] = useState(initialData); + + function updateTreeData(list, key, children) { + return list.map(node => { + if (node.key === key) { + return { ...node, children }; + } + if (node.children) { + return { ...node, children: updateTreeData(node.children, key, children) }; + } + return node; + }); + } + + function onLoadData({ key, children }) { + return new Promise(resolve => { + if (children) { + resolve(); + return; + } + setTimeout(() => { + setTreeData(origin => + updateTreeData(origin, key, [ + { + label: `Child Node${key}-0`, + key: `${key}-0`, + }, + { + label: `Child Node${key}-1`, + key: `${key}-1`, + }, + ]), + ); + resolve(); + }, 1000); + }); + } + return ( + <> + issue 1852: checkRelation='unRelated', 异步加载数据 + + + ); +}; \ No newline at end of file diff --git a/packages/semi-ui/tree/index.tsx b/packages/semi-ui/tree/index.tsx index 5fa7f11f73..a6e57b106d 100644 --- a/packages/semi-ui/tree/index.tsx +++ b/packages/semi-ui/tree/index.tsx @@ -431,7 +431,7 @@ class Tree extends BaseComponent { isMultiple ); } else { - checkedKeyValues = updateKeys(prevState.checkedKeys, keyEntities); + checkedKeyValues = updateKeys(props.checkRelation === 'related' ? prevState.checkedKeys : prevState.realCheckedKeys, keyEntities); } } diff --git a/packages/semi-ui/treeSelect/_story/treeSelect.stories.jsx b/packages/semi-ui/treeSelect/_story/treeSelect.stories.jsx index cab4d5f7e6..9bcc907104 100644 --- a/packages/semi-ui/treeSelect/_story/treeSelect.stories.jsx +++ b/packages/semi-ui/treeSelect/_story/treeSelect.stories.jsx @@ -2346,3 +2346,74 @@ export const LongLabel = () => { ); } + +export const UnRelatedAndAsyncLoad = () => { + const initialData = [ + { + label: 'Expand to load0', + value: '0', + key: '0', + }, + { + label: 'Expand to load1', + value: '1', + key: '1', + }, + { + label: 'Leaf Node', + value: '2', + key: '2', + isLeaf: true, + }, + ]; + const [treeData, setTreeData] = useState(initialData); + + function updateTreeData(list, key, children) { + return list.map(node => { + if (node.key === key) { + return { ...node, children }; + } + if (node.children) { + return { ...node, children: updateTreeData(node.children, key, children) }; + } + return node; + }); + } + + function onLoadData({ key, children }) { + return new Promise(resolve => { + if (children) { + resolve(); + return; + } + setTimeout(() => { + setTreeData(origin => + updateTreeData(origin, key, [ + { + label: `Child Node${key}-0`, + key: `${key}-0`, + }, + { + label: `Child Node${key}-1`, + key: `${key}-1`, + }, + ]), + ); + resolve(); + }, 1000); + }); + } + return ( + <> + issue 1852: checkRelation='unRelated', 异步加载数据 + + + ); +}; \ No newline at end of file diff --git a/packages/semi-ui/treeSelect/index.tsx b/packages/semi-ui/treeSelect/index.tsx index ed9072267f..54de0e31df 100644 --- a/packages/semi-ui/treeSelect/index.tsx +++ b/packages/semi-ui/treeSelect/index.tsx @@ -491,7 +491,7 @@ class TreeSelect extends BaseComponent { isMultiple ); } else { - checkedKeyValues = updateKeys(prevState.checkedKeys, keyEntities); + checkedKeyValues = updateKeys(props.checkRelation === 'related' ? prevState.checkedKeys : prevState.realCheckedKeys, keyEntities); } } @@ -794,7 +794,7 @@ class TreeSelect extends BaseComponent { }; const { content, isRenderInTag } = (item && treeNodeLabelProp in item) ? (renderSelectedItem as RenderSelectedItemInMultiple)(item, { index, onClose }) : - null; + ({} as any); if (isNull(content) || isUndefined(content)) { return; } @@ -1109,7 +1109,7 @@ class TreeSelect extends BaseComponent { if (isFunction(renderSelectedItem)) { const { content, isRenderInTag } = item && treeNodeLabelProp in item ? (renderSelectedItem as RenderSelectedItemInMultiple)(item, { index: idx, onClose }) : - null; + ({} as any); if (isRenderInTag) { return {content}; } else { diff --git a/packages/semi-webpack/package.json b/packages/semi-webpack/package.json index ac0a369ad7..63e8333c50 100644 --- a/packages/semi-webpack/package.json +++ b/packages/semi-webpack/package.json @@ -1,6 +1,6 @@ { "name": "@douyinfe/semi-webpack-plugin", - "version": "2.45.0-beta.0", + "version": "2.45.2", "description": "", "author": "伍浩威 ", "homepage": "", diff --git a/sitemap.xml b/sitemap.xml index 5f93fc7214..1094c4f376 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,333 +2,333 @@ https://juejin.cn/post/7267418854124699702 - 2023-10-13T09:53:07.764Z + 2023-10-25T03:57:27.890Z weekly https://medium.com/front-end-weekly/how-we-test-semi-design-component-libraries-64b854f63b65 - 2023-10-13T09:53:08.227Z + 2023-10-25T03:57:28.131Z weekly https://mp.weixin.qq.com/s/noHoWRuA25PgqFNcurhIUA - 2023-10-13T09:53:10.090Z + 2023-10-25T03:57:30.296Z weekly https://mp.weixin.qq.com/s/O3js-SZDNPEOjGxh-aAkbw - 2023-10-13T09:53:10.149Z + 2023-10-25T03:57:30.019Z weekly https://semi.design/code/en-US - 2023-10-13T09:53:08.283Z + 2023-10-20T07:12:03.463Z weekly 1.0.0.84 https://semi.design/code/en-US/about/contact - 2023-10-13T09:53:08.263Z + 2023-10-20T07:12:02.873Z weekly 1.0.0.84 https://semi.design/code/en-US/about/known-issues - 2023-10-13T09:53:08.996Z + 2023-10-20T07:12:03.495Z weekly 1.0.0.84 https://semi.design/code/en-US/about/roadmap - 2023-10-13T09:53:08.568Z + 2023-10-20T07:12:03.380Z weekly 1.0.0.84 https://semi.design/code/en-US/about/schema - 2023-10-13T09:53:09.407Z + 2023-10-20T07:12:03.847Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/inspect - 2023-10-13T09:53:08.760Z + 2023-10-20T07:12:03.618Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/mark - 2023-10-13T09:53:09.039Z + 2023-10-20T07:12:04.014Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/mark-icon - 2023-10-13T09:53:09.067Z + 2023-10-20T07:12:04.316Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/mark-library - 2023-10-13T09:53:09.115Z + 2023-10-20T07:12:04.051Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/mark-table - 2023-10-13T09:53:09.371Z + 2023-10-20T07:12:04.197Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/settings - 2023-10-13T09:53:09.325Z + 2023-10-20T07:12:04.789Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/support-list - 2023-10-13T09:53:09.377Z + 2023-10-20T07:12:04.493Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/transform-plugin - 2023-10-13T09:53:09.321Z + 2023-10-20T07:12:05.083Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/translate-logic - 2023-10-13T09:53:09.570Z + 2023-10-20T07:12:05.679Z weekly 1.0.0.84 https://semi.design/code/en-US/d2c/translate-page - 2023-10-13T09:53:09.654Z + 2023-10-20T07:12:05.417Z weekly 1.0.0.84 https://semi.design/code/en-US/start/changelog - 2023-10-13T09:53:09.550Z + 2023-10-20T07:12:05.274Z weekly 1.0.0.84 https://semi.design/code/en-US/start/faq - 2023-10-13T09:53:10.023Z + 2023-10-20T07:12:06.066Z weekly 1.0.0.84 https://semi.design/code/en-US/start/introduction - 2023-10-13T09:53:09.871Z + 2023-10-20T07:12:05.314Z weekly 1.0.0.84 https://semi.design/code/en-US/start/quick-start - 2023-10-13T09:53:09.955Z + 2023-10-20T07:12:05.709Z weekly 1.0.0.84 https://semi.design/code/en-US/start/terms - 2023-10-13T09:53:09.901Z + 2023-10-20T07:12:05.629Z weekly 1.0.0.84 https://semi.design/code/en-US/uikit/create - 2023-10-13T09:53:09.981Z + 2023-10-20T07:12:06.003Z weekly 1.0.0.84 https://semi.design/code/en-US/uikit/figma-usage - 2023-10-13T09:53:10.515Z + 2023-10-20T07:12:06.169Z weekly 1.0.0.84 https://semi.design/code/en-US/uikit/form-usage - 2023-10-13T09:53:10.323Z + 2023-10-20T07:12:05.769Z weekly 1.0.0.84 https://semi.design/code/en-US/uikit/migrate - 2023-10-13T09:53:10.197Z + 2023-10-20T07:12:05.986Z weekly 1.0.0.84 https://semi.design/code/en-US/uikit/rules - 2023-10-13T09:53:10.463Z + 2023-10-20T07:12:05.900Z weekly 1.0.0.84 https://semi.design/code/en-US/uikit/table-usage - 2023-10-13T09:53:10.338Z + 2023-10-20T07:12:05.909Z weekly 1.0.0.84 https://semi.design/code/zh-CN - 2023-10-13T09:53:10.689Z + 2023-10-20T07:12:06.015Z weekly 1.0.0.84 https://semi.design/code/zh-CN/about/contact - 2023-10-13T09:53:10.775Z + 2023-10-20T07:12:05.915Z weekly 1.0.0.84 https://semi.design/code/zh-CN/about/known-issues - 2023-10-13T09:53:10.864Z + 2023-10-20T07:12:06.038Z weekly 1.0.0.84 https://semi.design/code/zh-CN/about/roadmap - 2023-10-13T09:53:10.886Z + 2023-10-20T07:12:05.784Z weekly 1.0.0.84 https://semi.design/code/zh-CN/about/schema - 2023-10-13T09:53:11.107Z + 2023-10-20T07:12:06.338Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/inspect - 2023-10-13T09:53:11.034Z + 2023-10-20T07:12:06.377Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/mark - 2023-10-13T09:53:11.440Z + 2023-10-20T07:12:06.420Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/mark-icon - 2023-10-13T09:53:11.042Z + 2023-10-20T07:12:06.741Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/mark-library - 2023-10-13T09:53:11.028Z + 2023-10-20T07:12:06.594Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/mark-table - 2023-10-13T09:53:11.128Z + 2023-10-20T07:12:07.269Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/settings - 2023-10-13T09:53:11.200Z + 2023-10-20T07:12:06.458Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/support-list - 2023-10-13T09:53:11.241Z + 2023-10-20T07:12:06.459Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/transform-plugin - 2023-10-13T09:53:11.487Z + 2023-10-20T07:12:06.726Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/translate-logic - 2023-10-13T09:53:11.890Z + 2023-10-20T07:12:06.929Z weekly 1.0.0.84 https://semi.design/code/zh-CN/d2c/translate-page - 2023-10-13T09:53:11.448Z + 2023-10-20T07:12:06.437Z weekly 1.0.0.84 https://semi.design/code/zh-CN/start/changelog - 2023-10-13T09:53:11.447Z + 2023-10-20T07:12:06.435Z weekly 1.0.0.84 https://semi.design/code/zh-CN/start/faq - 2023-10-13T09:53:11.535Z + 2023-10-20T07:12:06.733Z weekly 1.0.0.84 https://semi.design/code/zh-CN/start/introduction - 2023-10-13T09:53:11.718Z + 2023-10-20T07:12:06.782Z weekly 1.0.0.84 https://semi.design/code/zh-CN/start/quick-start - 2023-10-13T09:53:11.822Z + 2023-10-20T07:12:06.910Z weekly 1.0.0.84 https://semi.design/code/zh-CN/start/terms - 2023-10-13T09:53:12.062Z + 2023-10-20T07:12:06.630Z weekly 1.0.0.84 https://semi.design/code/zh-CN/uikit/create - 2023-10-13T09:53:11.806Z + 2023-10-20T07:12:06.764Z weekly 1.0.0.84 https://semi.design/code/zh-CN/uikit/figma-usage - 2023-10-13T09:53:12.677Z + 2023-10-20T07:12:06.980Z weekly 1.0.0.84 https://semi.design/code/zh-CN/uikit/form-usage - 2023-10-13T09:53:12.019Z + 2023-10-20T07:12:06.758Z weekly 1.0.0.84 https://semi.design/code/zh-CN/uikit/migrate - 2023-10-13T09:53:12.271Z + 2023-10-20T07:12:06.994Z weekly 1.0.0.84 https://semi.design/code/zh-CN/uikit/rules - 2023-10-13T09:53:12.181Z + 2023-10-20T07:12:06.882Z weekly 1.0.0.84 https://semi.design/code/zh-CN/uikit/table-usage - 2023-10-13T09:53:12.082Z + 2023-10-20T07:12:07.187Z weekly 1.0.0.84 @@ -784,738 +784,738 @@ https://semi.design/dsm/landing - 2023-10-13T09:53:16.270Z + 2023-10-25T03:57:36.763Z weekly - 1.0.0.150 + 1.0.0.152 https://semi.design/en-US/basic/divider - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/basic/grid - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/basic/icon - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/basic/layout - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/basic/space - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/basic/tokens - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/basic/typography - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/feedback/banner - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/feedback/notification - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/feedback/popconfirm - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/feedback/progress - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/feedback/skeleton - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/feedback/spin - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/feedback/toast - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/autocomplete - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/button - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/cascader - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/checkbox - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/datepicker - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/form - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/input - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/inputnumber - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/radio - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/rating - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/select - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/slider - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/switch - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/taginput - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/timepicker - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/transfer - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/treeselect - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/input/upload - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/navigation/anchor - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/navigation/backtop - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/navigation/breadcrumb - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/navigation/navigation - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/navigation/pagination - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/navigation/steps - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/navigation/tabs - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/navigation/tree - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/other/configprovider - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/other/locale - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/avatar - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/badge - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/calendar - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/card - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/carousel - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/collapse - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/collapsible - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/descriptions - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/dropdown - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/empty - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/highlight - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/image - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/list - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/modal - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/overflowlist - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/popover - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/scrolllist - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/sidesheet - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/table - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/tag - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/timeline - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/show/tooltip - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/accessibility - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/changelog - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/customize-theme - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/dark-mode - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/faq - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/getting-started - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/introduction - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/overview - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/en-US/start/update-to-v2 - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/basic/divider - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/basic/grid - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/basic/icon - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/basic/layout - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/basic/space - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/basic/tokens - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/basic/typography - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/feedback/banner - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/feedback/notification - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/feedback/popconfirm - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/feedback/progress - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/feedback/skeleton - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/feedback/spin - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/feedback/toast - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/autocomplete - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/button - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/cascader - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/checkbox - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/datepicker - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/form - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/input - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/inputnumber - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/radio - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/rating - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/select - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/slider - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/switch - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/taginput - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/timepicker - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/transfer - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/treeselect - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/input/upload - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/navigation/anchor - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/navigation/backtop - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/navigation/breadcrumb - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/navigation/navigation - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/navigation/pagination - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/navigation/steps - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/navigation/tabs - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/navigation/tree - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/other/configprovider - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/other/locale - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/avatar - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/badge - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/calendar - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/card - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/carousel - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/collapse - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/collapsible - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/descriptions - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/dropdown - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/empty - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/highlight - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/image - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/list - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/modal - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/overflowlist - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/popover - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/scrolllist - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/sidesheet - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/table - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/tag - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/timeline - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/show/tooltip - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/accessibility - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/changelog - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/customize-theme - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/dark-mode - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/faq - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/getting-started - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/introduction - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/overview - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly https://semi.design/zh-CN/start/update-to-v2 - 2023-10-13T09:35:39.000Z + 2023-10-25T03:49:28.000Z weekly diff --git a/src/components/Footer/index.jsx b/src/components/Footer/index.jsx index ed86c43f39..c6fb903570 100644 --- a/src/components/Footer/index.jsx +++ b/src/components/Footer/index.jsx @@ -1,24 +1,79 @@ /* eslint-disable max-lines-per-function */ import React, { Component } from 'react'; -import UserContext from 'context/context'; -import './footer.scss'; -import { _t } from 'src/utils/locale'; -import { getLocale } from '../../utils/locale'; -import { IconBytedanceLogo } from '@douyinfe/semi-icons'; +import { FormattedMessage } from 'react-intl'; + +import './index.scss'; +import { getLocale } from "../../utils/locale"; +const _t = id => ; export class Footer extends Component { - static contextType = UserContext; + render() { + const locale = getLocale(); + const { style } = this.props; return ( -