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 @@