From 554e544ac212d16559d67797b5468df29b3f55a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?w=C5=AB=20y=C4=81ng?= Date: Mon, 24 Feb 2025 18:38:24 +0800 Subject: [PATCH] chore: release 1.11.0-naruto (#3502) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(drawer): sizeDraggable支持SizeDragLimit类型 (#3465) * feat(drawer): sizeDraggable支持SizeDragLimit类型 * fix: delete comments * chore: update tdesign-icons-vue to 0.3.3 (#3468) Co-authored-by: tdesign-bot * chore(submodule): update _common (#3472) * chore(submodule): update _common (#3476) * chore(submodule): update _common (#3477) * fix(auto-complete): options is an empty array, empty is not effective (#3474) * fix(auto-complete): options is an empty array, empty is not effective * chore: revert code * chore: fix cr * fix(transfer): ensure filterTransferData returns only valid items (#3487) perf(transfer): optimize filterTransferData for better performance * refactor: lodash-es instead of lodash (#3486) * refactor: lodash-es instead of lodash * chore: fix * chore: fix * chore: fix * chore: fix * chore: fix * chore: fix * chore: fix * feat(form): add `status` and `tips` rendering in `form-item` component (#3490) * feat(form): add `status` function * feat(form): add tips rendering in form-item component * fix(dialog): incorrect node attachment when `mode = "normal"` (#3493) * fix(dialog): dialog should be in the document flow when `mode = "normal"` chore(config-provider): improve globalAttach method to handle string and object types * chore: update snapshot * chore: update `globalAttach` type * chore: add typeof globalConfigAttach is function * chore: 直接调用 globalConfigAttach 内的 `componentName` --------- Co-authored-by: github-actions[bot] * fix(Menu): fix function usage of menu group title (#3497) * fix(statistic): fix decimalPlaces setting 0 is invalid (#3496) * fix(statistic): fix decimalPlaces setting 0 is invalid * chore: format code * chore: del comment * chore: release 1.11.0 (#3499) * chore: release 1.11.0 * chore: changelog's changes --------- Co-authored-by: github-actions[bot] * chore: release 1.11.0-naruto * chore: release 1.11.0-naruto --------- Co-authored-by: huangchen1031 Co-authored-by: TDesign bot <93915689+tdesign-bot@users.noreply.github.com> Co-authored-by: tdesign-bot Co-authored-by: liweijie0812 <674416404@qq.com> Co-authored-by: 阿菜 Cai --- .eslintrc | 8 +- CHANGELOG.md | 18 + package.json | 12 +- script/init/index.js | 4 +- script/rollup.config.js | 4 +- site/src/components/codesandbox/content.js | 2 + site/src/components/stackblitz/content.js | 2 + src/_common | 2 +- src/affix/affix.tsx | 2 +- src/anchor/__tests__/anchor-link.test.jsx | 2 +- src/anchor/anchor-item.tsx | 2 +- src/anchor/anchor.tsx | 2 +- .../_example-composition/filter.vue | 2 +- src/auto-complete/_example/filter.vue | 2 +- src/auto-complete/auto-complete.tsx | 7 +- src/auto-complete/highlight-option.tsx | 2 +- src/auto-complete/option-list.tsx | 10 +- src/calendar/calendar.tsx | 2 +- src/cascader/cascader.tsx | 2 +- src/cascader/core/effect.ts | 4 +- src/cascader/core/helper.ts | 2 +- src/cascader/hooks.ts | 3 +- src/checkbox/group.tsx | 5 +- src/color-picker/panel/format/index.tsx | 2 +- src/color-picker/panel/format/inputs.tsx | 2 +- src/color-picker/panel/linear-gradient.tsx | 2 +- src/color-picker/panel/swatches.tsx | 2 +- .../_example-composition/calendar.vue | 2 +- .../_example-composition/date-picker.vue | 2 +- .../_example-composition/global.vue | 2 +- .../_example-composition/others.vue | 2 +- .../_example-composition/pagination.vue | 2 +- .../_example-composition/table.vue | 2 +- src/config-provider/_example/calendar.vue | 2 +- src/config-provider/_example/date-picker.vue | 2 +- src/config-provider/_example/global.vue | 2 +- src/config-provider/_example/others.vue | 2 +- src/config-provider/_example/pagination.vue | 2 +- src/config-provider/_example/table.vue | 2 +- src/config-provider/config-provider.tsx | 2 +- src/config-provider/config-receiver.ts | 15 +- src/config-provider/context.ts | 3 +- src/config-provider/type.ts | 7 +- src/date-picker/DatePicker.tsx | 2 +- src/date-picker/hooks/useDisableDate.ts | 2 +- src/date-picker/hooks/useRangeValue.ts | 2 +- src/date-picker/hooks/useSingle.ts | 5 +- src/date-picker/hooks/useSingleValue.ts | 2 +- src/date-picker/panel/RangePanel.tsx | 2 +- src/date-picker/panel/SinglePanel.tsx | 2 +- src/date-picker/utils.ts | 2 +- src/descriptions/descriptions.tsx | 3 +- src/descriptions/utils/index.tsx | 3 +- src/dialog/actions.tsx | 3 +- src/dialog/dialog.tsx | 5 +- src/drawer/drawer.tsx | 37 +- src/dropdown/dropdown-menu.tsx | 2 +- src/dropdown/dropdown.tsx | 2 +- src/dropdown/hooks/useDropdownOptions.ts | 2 +- src/empty/empty.tsx | 4 +- src/form/form-item.tsx | 19 +- src/form/form-model.ts | 5 +- src/form/form.en-US.md | 2 +- src/form/form.md | 2 +- src/form/form.tsx | 3 +- src/form/type.ts | 2 +- src/grid/col.tsx | 2 +- src/grid/row.tsx | 2 +- src/guide/guide.tsx | 4 +- src/hooks/render-tnode.ts | 3 +- src/hooks/slots.ts | 2 +- src/hooks/tnode.ts | 7 +- src/hooks/useVModel.ts | 2 +- src/image/image.tsx | 4 +- src/input-adornment/input-adornment.tsx | 3 +- src/input/input.tsx | 3 +- src/list/list.tsx | 4 +- src/loading/directive.ts | 4 +- src/menu/menu-group.tsx | 3 +- src/menu/submenu.tsx | 2 +- src/notification/notification.tsx | 2 +- src/pagination/pagination-mini.tsx | 2 +- src/popup/container.tsx | 2 +- src/popup/popup.tsx | 4 +- src/radio/group.tsx | 3 +- src/select-input/useMultiple.tsx | 4 +- src/select-input/useOverlayInnerStyle.ts | 4 +- src/select-input/useSingle.tsx | 4 +- src/select/hooks/useSelectOptions.ts | 2 +- src/select/select-panel.tsx | 2 +- src/select/select.tsx | 9 +- src/select/util.ts | 2 +- src/skeleton/skeleton.tsx | 2 +- src/statistic/statistic.tsx | 18 +- src/steps/step-item.tsx | 2 +- src/swiper/swiper.tsx | 2 +- .../filter-controlled.vue | 2 +- .../_example-composition/tree-select.vue | 2 +- src/table/_example/filter-controlled.vue | 2 +- src/table/_example/tree-select.vue | 2 +- src/table/base-table.tsx | 5 +- src/table/column-checkbox-group.tsx | 2 +- src/table/editable-cell.tsx | 7 +- src/table/ellipsis.tsx | 2 +- src/table/enhanced-table.tsx | 2 +- src/table/filter-controller.tsx | 10 +- src/table/hooks/useAffix.ts | 2 +- src/table/hooks/useAsyncLoading.tsx | 3 +- src/table/hooks/useColumnController.tsx | 2 +- src/table/hooks/useColumnResize.ts | 2 +- src/table/hooks/useDragSort.ts | 3 +- src/table/hooks/useEditableRow.ts | 7 +- src/table/hooks/useFilter.tsx | 2 +- src/table/hooks/useFixed.ts | 7 +- src/table/hooks/useHoverKeyboardEvent.ts | 2 +- src/table/hooks/useRowExpand.tsx | 2 +- src/table/hooks/useRowHighlight.ts | 2 +- src/table/hooks/useRowSelect.tsx | 5 +- src/table/hooks/useRowspanAndColspan.ts | 2 +- src/table/hooks/useSorter.tsx | 3 +- src/table/hooks/useTableHeader.tsx | 4 +- src/table/hooks/useTreeData.tsx | 2 +- src/table/hooks/useTreeSelect.tsx | 3 +- src/table/primary-table.tsx | 4 +- src/table/tbody.tsx | 5 +- src/table/tfoot.tsx | 5 +- src/table/thead.tsx | 2 +- src/table/tr.tsx | 8 +- src/table/utils.ts | 4 +- src/tabs/tab-nav.tsx | 2 +- src/tag-input/hooks/useTagScroll.ts | 2 +- src/tag/check-tag-group.tsx | 2 +- src/tag/tag.tsx | 2 +- src/textarea/textarea.tsx | 5 +- src/time-picker/panel/single-panel.tsx | 5 +- src/tooltip/tooltip.tsx | 2 +- src/transfer/transfer.tsx | 2 +- src/transfer/utils.ts | 6 +- src/tree-select/tree-select.tsx | 4 +- src/tree-select/useTreeSelect.ts | 4 +- src/tree-select/utils.ts | 4 +- src/tree/hooks/useDraggable.ts | 2 +- src/tree/hooks/useRenderLabel.tsx | 2 +- src/tree/hooks/useTreeNodes.tsx | 2 +- src/tree/hooks/useTreeScroll.ts | 2 +- src/tree/hooks/useTreeStore.ts | 2 +- src/tree/tree.tsx | 3 +- src/tree/util.ts | 2 +- src/upload/hooks/useUpload.ts | 2 +- src/upload/themes/custom-file.tsx | 2 +- src/upload/themes/multiple-flow-list.tsx | 3 +- src/utils/dom.ts | 2 +- src/utils/helper.ts | 2 +- src/utils/render-tnode.ts | 3 +- src/utils/ripple.ts | 2 +- src/utils/withInstall.ts | 2 +- test/snap/__snapshots__/csr.test.js.snap | 1044 +++++++++++++++-- 157 files changed, 1218 insertions(+), 398 deletions(-) diff --git a/.eslintrc b/.eslintrc index 7e1bf202d..2ec787afe 100644 --- a/.eslintrc +++ b/.eslintrc @@ -108,7 +108,13 @@ { "checkLoops": false } - ] + ], + "no-restricted-imports": ["error", { + "paths": [{ + "name": "lodash", + "message": "Please use lodash-es instead." + }] + }] }, "overrides": [ { diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ff050387..dac3c3c0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,24 @@ toc: false docClass: timeline --- +## 🌈 1.11.0 `2025-02-21` +### 🚀 Features +- `Drawer`: sizeDraggable支持SizeDragLimit类型 @huangchen1031 ([#3465](https://github.com/Tencent/tdesign-vue/pull/3465)) +- `Form`: `FormItem` 新增 `status` 和 `tips` API @RSS1102 ([#3490](https://github.com/Tencent/tdesign-vue/pull/3490)) +- `Icon`: 新增`logo-alipay`、`logo-behance-filled`等图标,修改`logo-wecom`图标,移除不合理的`logo-wecom-filled`图标 @uyarn([#3468](https://github.com/Tencent/tdesign-vue/pull/3468)) + +### 🐞 Bug Fixes +- `AutoComplete`: 修复 `options` 为空数组,empty 节点没显示的问题 @liweijie0812 ([#3474](https://github.com/Tencent/tdesign-vue/pull/3474)) +- `Dialog`: 修复 `1.10.8` 版本后当 mode 为 "normal" 时渲染不符合预期的问题 @RSS1102 ([#3493](https://github.com/Tencent/tdesign-vue/pull/3493)) +- `ImageViewer`: 修复开启`closeOnOverlay`时,点击蒙层关闭存在闪烁情况的问题 @huangchen1031([#3472](https://github.com/Tencent/tdesign-vue/pull/3472)) +- `Menu`: 修复`MenuGroup`的 title 不支持使用函数渲染的问题 @uyarn ([#3497](https://github.com/Tencent/tdesign-vue/pull/3497)) +- `Statistic`: 修复 `decimalPlaces=0` 时数值动画期间精度错误的问题 @liweijie0812 ([#3496](https://github.com/Tencent/tdesign-vue/pull/3496)) +- `Tabs`: 修复可滑动`Tabs`配合`action`使用的样式问题 @Wesley-0808([#3477](https://github.com/Tencent/tdesign-vue/pull/3477)) +- `Transfer`: 确保 `filterTransferData` 仅返回有效值 @RSS1102 ([#3487](https://github.com/Tencent/tdesign-vue/pull/3487)) + +### 🚧 Others +- 调整组件依赖 `lodash` 为`lodash-es` @liweijie0812 ([#3486](https://github.com/Tencent/tdesign-vue/pull/3486)) + ## 🌈 1.10.9 `2025-01-10` ### 🚀 Features - `AutoComplete`: 新增`empty` API,用于配置空状态下的下拉内容展示 @liweijie0812 ([#3462](https://github.com/Tencent/tdesign-vue/pull/3462)) diff --git a/package.json b/package.json index d0be1974a..74837a0db 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tdesign-vue", "purename": "tdesign", - "version": "1.10.9-naruto", + "version": "1.11.0-naruto", "description": "tdesign-vue", "title": "tdesign-vue", "keywords": [ @@ -86,18 +86,17 @@ "@babel/runtime": "^7.14.8", "@popperjs/core": "^2.4.0", "@types/clipboard": "^2.0.1", - "@types/lodash": "4.14.182", "@types/raf": "^3.4.0", "@types/sortablejs": "^1.10.7", "@types/tinycolor2": "^1.4.3", "@types/validator": "^13.1.3", "clipboard": "^2.0.8", "dayjs": "1.11.10", - "lodash": "^4.17.21", + "lodash-es": "^4.17.21", "mitt": "^3.0.0", "raf": "^3.4.1", "sortablejs": "^1.15.0", - "tdesign-icons-vue": "^0.3.2", + "tdesign-icons-vue": "^0.3.3", "tinycolor2": "^1.4.2", "validator": "^13.5.1" }, @@ -107,8 +106,8 @@ "devDependencies": { "@babel/cli": "^7.5.5", "@babel/core": "~7.22.5", - "@babel/helper-module-imports": "7.24.7", "@babel/eslint-parser": "~7.23.10", + "@babel/helper-module-imports": "7.24.7", "@babel/plugin-transform-class-properties": "^7.22.3", "@babel/plugin-transform-modules-commonjs": "^7.9.6", "@babel/plugin-transform-object-assign": "^7.2.0", @@ -124,6 +123,7 @@ "@rollup/plugin-url": "^5.0.1", "@testing-library/dom": "^8.20.0", "@types/estree": "^1.0.1", + "@types/lodash-es": "^4.17.12", "@typescript-eslint/eslint-plugin": "^5.4.0", "@typescript-eslint/experimental-utils": "^5.4.0", "@typescript-eslint/parser": "^5.4.0", @@ -178,7 +178,7 @@ "rollup-plugin-styles": "^4.0.0", "rollup-plugin-terser": "~7.0.2", "rollup-plugin-vue": "^5.1.9", - "tdesign-icons-view": "^0.3.0", + "tdesign-icons-view": "^0.3.4", "tdesign-publish-cli": "^0.0.12", "tdesign-site-components": "^0.13.0", "tdesign-theme-generator": "^1.0.5", diff --git a/script/init/index.js b/script/init/index.js index c2c97682f..d2dde27f4 100644 --- a/script/init/index.js +++ b/script/init/index.js @@ -27,7 +27,7 @@ const fs = require('fs'); const path = require('path'); -const _ = require('lodash'); +const { template } = require('lodash-es'); const utils = require('../utils'); const config = require('./config'); @@ -75,7 +75,7 @@ function deleteComponent(toBeCreatedFiles, component) { function outputFileWithTemplate(item, component, desc, _d) { const tplPath = path.resolve(__dirname, `./tpl/${item.template}`); let data = fs.readFileSync(tplPath).toString(); - const compiled = _.template(data); + const compiled = template(data); data = compiled({ component, upperComponent: getFirstLetterUpper(component), diff --git a/script/rollup.config.js b/script/rollup.config.js index a65f9a00d..61eb3269b 100644 --- a/script/rollup.config.js +++ b/script/rollup.config.js @@ -207,7 +207,7 @@ const umdConfig = { banner, format: 'umd', exports: 'named', - globals: { vue: 'Vue', lodash: '_' }, + globals: { vue: 'Vue' }, sourcemap: true, file: `dist/${name}.js`, }, @@ -227,7 +227,7 @@ const umdMinConfig = { banner, format: 'umd', exports: 'named', - globals: { vue: 'Vue', lodash: '_' }, + globals: { vue: 'Vue' }, sourcemap: true, file: `dist/${name}.min.js`, }, diff --git a/site/src/components/codesandbox/content.js b/site/src/components/codesandbox/content.js index d9acbade5..110a65428 100644 --- a/site/src/components/codesandbox/content.js +++ b/site/src/components/codesandbox/content.js @@ -90,12 +90,14 @@ export const packageJSONContent = JSON.stringify( 'tdesign-vue': orgPkg.version, 'tdesign-icons-vue': orgPkg.dependencies['tdesign-icons-vue'], vue: orgPkg.devDependencies.vue, + 'lodash-es': orgPkg.dependencies['lodash-es'], }, devDependencies: { vite: orgPkg.devDependencies.vite, less: orgPkg.devDependencies.less, 'vite-plugin-vue2': orgPkg.devDependencies['vite-plugin-vue2'], 'vue-template-compiler': orgPkg.devDependencies['vue-template-compiler'], + '@types/lodash-es': orgPkg.devDependencies['@types/lodash-es'], }, }, null, diff --git a/site/src/components/stackblitz/content.js b/site/src/components/stackblitz/content.js index d38cc0a4d..7b17f59a7 100644 --- a/site/src/components/stackblitz/content.js +++ b/site/src/components/stackblitz/content.js @@ -116,6 +116,7 @@ export const packageJSONContentForComposition = JSON.stringify( 'tdesign-vue': orgPkg.version + '-naruto', 'tdesign-icons-vue': orgPkg.dependencies['tdesign-icons-vue'], vue: '2.7.14', + 'lodash-es': orgPkg.dependencies['lodash-es'], }, devDependencies: { vite: '^2.9.6', @@ -123,6 +124,7 @@ export const packageJSONContentForComposition = JSON.stringify( '@vitejs/plugin-vue2': '^1.1.2', 'vue-template-compiler': '2.7.14', '@vitejs/plugin-vue2-jsx': '^1.1.0', + '@types/lodash-es': orgPkg.devDependencies['@types/lodash-es'], }, }, null, diff --git a/src/_common b/src/_common index c569a218e..b7935cb3e 160000 --- a/src/_common +++ b/src/_common @@ -1 +1 @@ -Subproject commit c569a218ec1547b4924c429337237ebdcf3b23d3 +Subproject commit b7935cb3e86877dd68091d1d24fd93f55be3f1e7 diff --git a/src/affix/affix.tsx b/src/affix/affix.tsx index b69ce0722..492cfba18 100644 --- a/src/affix/affix.tsx +++ b/src/affix/affix.tsx @@ -1,5 +1,5 @@ import Vue, { VueConstructor } from 'vue'; -import isFunction from 'lodash/isFunction'; +import { isFunction } from 'lodash-es'; import { on, off, getScrollContainer } from '../utils/dom'; import affixProps from './props'; import { ScrollContainerElement } from '../common'; diff --git a/src/anchor/__tests__/anchor-link.test.jsx b/src/anchor/__tests__/anchor-link.test.jsx index c9adc963a..de3a24f1d 100644 --- a/src/anchor/__tests__/anchor-link.test.jsx +++ b/src/anchor/__tests__/anchor-link.test.jsx @@ -1,6 +1,6 @@ import { mount } from '@vue/test-utils'; import Vue from 'vue'; -import omit from 'lodash/omit'; +import { omit } from 'lodash-es'; import { AnchorItem } from '@/src/anchor/index.ts'; const defaultProvide = { diff --git a/src/anchor/anchor-item.tsx b/src/anchor/anchor-item.tsx index ad5e9c591..bdb5a0229 100644 --- a/src/anchor/anchor-item.tsx +++ b/src/anchor/anchor-item.tsx @@ -1,6 +1,6 @@ import Vue, { VueConstructor } from 'vue'; import { ScopedSlotReturnValue } from 'vue/types/vnode'; -import isEmpty from 'lodash/isEmpty'; +import { isEmpty } from 'lodash-es'; import { VNode } from 'vue/types/umd'; import { ANCHOR_SHARP_REGEXP } from './utils'; import props from './anchor-item-props'; diff --git a/src/anchor/anchor.tsx b/src/anchor/anchor.tsx index 0f306fdfd..bcaac313f 100644 --- a/src/anchor/anchor.tsx +++ b/src/anchor/anchor.tsx @@ -1,6 +1,6 @@ import Vue, { VueConstructor } from 'vue'; import { ScopedSlotReturnValue } from 'vue/types/vnode'; -import isFunction from 'lodash/isFunction'; +import { isFunction } from 'lodash-es'; import { ANCHOR_SHARP_REGEXP, ANCHOR_CONTAINER, getOffsetTop } from './utils'; import { on, off, getScroll, scrollTo, getScrollContainer, diff --git a/src/auto-complete/_example-composition/filter.vue b/src/auto-complete/_example-composition/filter.vue index d60d5bed9..52dffe734 100644 --- a/src/auto-complete/_example-composition/filter.vue +++ b/src/auto-complete/_example-composition/filter.vue @@ -24,7 +24,7 @@