diff --git a/.github/workflows/lint-commit-message.yml b/.github/workflows/lint-commit-message.yml index dde7c0338b669e..6cef82ffd45e06 100644 --- a/.github/workflows/lint-commit-message.yml +++ b/.github/workflows/lint-commit-message.yml @@ -22,7 +22,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache diff --git a/.github/workflows/pr-docs-build.yml b/.github/workflows/pr-docs-build.yml index 732027c319704a..9a7e9c6450d325 100644 --- a/.github/workflows/pr-docs-build.yml +++ b/.github/workflows/pr-docs-build.yml @@ -13,10 +13,10 @@ jobs: strategy: matrix: - node-version: [16] + node-version: [18] os: [ubuntu-latest, windows-latest] include: - - node-version: 16 + - node-version: 18 node-name: LTS # - node-version: 18 # node-name: Current diff --git a/.github/workflows/publish-build-product.yml b/.github/workflows/publish-build-product.yml index 4a82d41a051e4a..fc537f07402cd4 100644 --- a/.github/workflows/publish-build-product.yml +++ b/.github/workflows/publish-build-product.yml @@ -25,7 +25,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache diff --git a/.github/workflows/publish-docs-deploy-manual.yml b/.github/workflows/publish-docs-deploy-manual.yml index fd1c6a63296482..6e00af6d4022eb 100644 --- a/.github/workflows/publish-docs-deploy-manual.yml +++ b/.github/workflows/publish-docs-deploy-manual.yml @@ -16,7 +16,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache diff --git a/.github/workflows/publish-docs-deploy.yml b/.github/workflows/publish-docs-deploy.yml index 503d45443b2157..f154aadd7cabfa 100644 --- a/.github/workflows/publish-docs-deploy.yml +++ b/.github/workflows/publish-docs-deploy.yml @@ -23,7 +23,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache diff --git a/.github/workflows/publish-npm-nightly.yml b/.github/workflows/publish-npm-nightly.yml index 305497d232a9c5..a97a1ef63b1d25 100644 --- a/.github/workflows/publish-npm-nightly.yml +++ b/.github/workflows/publish-npm-nightly.yml @@ -22,7 +22,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache @@ -58,7 +58,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: '16' + node-version: '18' registry-url: https://registry.npmjs.com/ - name: Setup pnpm diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index deace57840a887..fafdedee3037c8 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -21,7 +21,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 registry-url: https://registry.npmjs.com/ - name: Get pnpm store directory @@ -57,7 +57,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 registry-url: https://registry.npmjs.com/ - name: Setup pnpm diff --git a/.github/workflows/publish-size-report.yml b/.github/workflows/publish-size-report.yml index 0002284ffe726c..d5f1ee596e3b7e 100644 --- a/.github/workflows/publish-size-report.yml +++ b/.github/workflows/publish-size-report.yml @@ -22,7 +22,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache diff --git a/.github/workflows/staging-docs.yml b/.github/workflows/staging-docs.yml index 065276dd784eee..2a0184fe1774c1 100644 --- a/.github/workflows/staging-docs.yml +++ b/.github/workflows/staging-docs.yml @@ -25,7 +25,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 2bcd5dd6dd1962..4f33e4420ea45e 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -27,7 +27,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache diff --git a/.github/workflows/test-ssr.yml b/.github/workflows/test-ssr.yml index 2b1673416f474a..8baf6fa9685331 100644 --- a/.github/workflows/test-ssr.yml +++ b/.github/workflows/test-ssr.yml @@ -25,7 +25,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml index 167064975e19f5..f37a6c6c27dbc4 100644 --- a/.github/workflows/test-unit.yml +++ b/.github/workflows/test-unit.yml @@ -27,7 +27,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 - name: Get pnpm store directory id: pnpm-cache @@ -57,9 +57,9 @@ jobs: strategy: matrix: - node-version: [16] + node-version: [18] include: - - node-version: 16 + - node-version: 18 node-name: LTS # - node-version: 18 # node-name: Current diff --git a/.npmrc b/.npmrc index e2ad808f8d487c..435b4ffd077e8d 100644 --- a/.npmrc +++ b/.npmrc @@ -1,3 +1,4 @@ shamefully-hoist=true strict-peer-dependencies=false shell-emulator=true +package-manager-strict=false \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index 6f7f377bf5148f..3f430af82b3dfa 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16 +v18 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 42c4e8a6c67bba..fc61b81e0b1764 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,7 @@ "vue.volar", "dbaeumer.vscode-eslint", "esbenp.prettier-vscode", - "antfu.vite", + "antfu.unocss", "lokalise.i18n-ally" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 79b43c476d3ec8..098ed37c7340d4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,9 @@ "cSpell.words": ["Element Plus", "element-plus"], "typescript.tsdk": "node_modules/typescript/lib", "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, "npm.packageManager": "pnpm", "eslint.probe": [ "javascript", diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 9cc49a82e56f52..79b913ce9ba6d2 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -1,5 +1,73 @@ ## Changelog +### 2.7.2 + +_2024-04-26_ + +#### Features + +- Hooks add use-aria hooks (#16598 by @kooriookami) +- Components [color-picker] add `teleported` prop (#16634 by @zhixiaotong) +- Components [form] add validate callback promise type (#16652 by @warmthsea) + +#### Bug fixes + +- 🐛 update autocomplete default width (#16633 by @xxholly32) +- Components [select] group error when custom option component (#16621 by @Liao-js) +- Components [table] return type of function summary-method supports VNode (#16648 by @FrontEndDog) +- Test-utils fix main export error (#16504 by @wzc520pyfm) +- Components Add missing export (#16323 by @zzh948498) +- Components [table-v2] fix scrolling fail (#16470 by @Tsong-LC) +- Components [select] `isDisabled` is not fresh (#16419 by @makedopamine) +- Components [progress] bar background support gradient (#16666 by @btea) +- Components [select-v2] custom options init error in multiple (#16664 by @Liao-js) + +### 2.7.1 + +_2024-04-20_ + +#### Features + +- Components [badge] Add badge-style and badge-class (#16585 by @kooriookami) + +#### Bug fixes + +- Hooks [empty-values] warning on modifying computead value (#16508 by @btea) +- Components [input-number] fix binding wheel event warning (#16495 by @Canroc) +- Components [table] fix cell tooltip display error (#16449 by @electroluxcode) +- Components [table] hover style error (#16517 by @dowinweb) +- Components [table] fix grouping head when dynamic column (#16433 by @Liao-js) +- Components [select-v2] fix has existing option when allow create (#16590 by @Liao-js) +- Components [table] table body rerendered when use row-key (#16544 by @Liao-js) + +### 2.7.0 + +_2024-04-12_ + +#### Breaking changes + +- See #15834 + +#### Features + +- Components [segmented] new component (#16258 by @kooriookami) +- Components add empty-values and value-on-clear props (#16361 by @kooriookami) +- Components [badge] add dotClass、dotStyle、offset props (#16434 by @lxw15337674) +- Support node 18+ & update tsx and vitest (#16190 by @btea) + +#### Bug fixes + +- Components [input-number] wrapper padding style is overridden (#16310 by @betavs) +- Components [input-number] fix cascading style order (#16308 by @makedopamine) +- Components [table-v2] fixed mode hovering rerender cell (#12378 by @chenxch) +- Components [select-v2] manually set object type modelValue error (#16473 by @Fuphoenixes) +- Components [select & select-v2] fix filterable double click error (#16456 by @Fuphoenixes) +- Components [table] fixed hover on colSpan > 2 background is error (#16443 by @Liao-js) + +#### Refactors + +- Components [button] use buttonkls (#16090 by @wzc520pyfm) + ### 2.6.3 _2024-03-29_ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ee215e943f2be7..9765c078dbf774 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,11 +17,11 @@ Next section is for those who wants to help develop Element Plus. You should be having: -NodeJS >= 16 +NodeJS >= 18 Git > v2.20 -Some of our compiling code used syntax that introduced in NodeJS>16.0 so you will be need to install that in advance. +Some of our compiling code used syntax that introduced in NodeJS>18 so you will be need to install that in advance. ## Clone the repository diff --git a/README.md b/README.md index d7282b77f80994..cbd67dc3211256 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - + @@ -28,7 +28,7 @@ Alright, for you to get started if you are looking for making Element Plus better you should keep reading. For developers that uses Element Plus to develop your website you should go ahead visit [Getting Started](https://element-plus.org/). -- 中国大陆[加速镜像站点](https://element-plus.gitee.io/) +- 中国大陆[加速镜像站点](https://cn.element-plus.org/zh-CN/) ## Breaking change list @@ -67,8 +67,8 @@ You can also try Element Plus out with the components built-in playground. - - + + @@ -78,12 +78,12 @@ You can also try Element Plus out with the components built-in playground. - + - + @@ -96,10 +96,15 @@ You can also try Element Plus out with the components built-in playground. - + + + + + + diff --git a/docs/.vitepress/config/head.ts b/docs/.vitepress/config/head.ts index 9864ba916a702a..0d8fd0dedf297d 100644 --- a/docs/.vitepress/config/head.ts +++ b/docs/.vitepress/config/head.ts @@ -116,18 +116,6 @@ gtag('config', 'UA-175337989-1');`, gtag('config', 'G-M74ZHEQ1M1'); `, ], - [ - 'script', - {}, - `(function(h,o,t,j,a,r){ - h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; - h._hjSettings={hjid:2894908,hjsv:6}; - a=o.getElementsByTagName('head')[0]; - r=o.createElement('script');r.async=1; - r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; - a.appendChild(r); - })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');`, - ], [ 'script', { diff --git a/docs/.vitepress/config/sponsors.ts b/docs/.vitepress/config/sponsors.ts index 7140175b401bdf..d48f2e97ed1191 100644 --- a/docs/.vitepress/config/sponsors.ts +++ b/docs/.vitepress/config/sponsors.ts @@ -17,10 +17,18 @@ export const rightLogoSmallSponsors = [ name: 'BuildAdmin', img: '/images/sponsors/buildadmin.png', imgL: '/images/sponsors/buildadmin-l.png', - url: 'https://wonderful-code.gitee.io/?from=element-plus', + url: 'https://doc.buildadmin.com/?from=element-plus', slogan: 'Vue3 opensource admin system', slogan_cn: 'Vue3企业级开源后台管理系统', }, + { + name: 'Fantastic-admin', + img: '/images/sponsors/fantastic-admin.png', + imgL: '/images/sponsors/fantastic-admin-l.png', + url: 'https://fantastic-admin.github.io/', + slogan: 'Out-of-the-box Vue3 management system framework', + slogan_cn: '一款开箱即用的 Vue3 中后台管理系统框架', + }, { name: 'bit', img: '/images/bit.svg', @@ -33,13 +41,12 @@ export const rightLogoSmallSponsors = [ export const leftCustomImgSponsors = [ { - name: 'JSDesign', - name_cn: '即时设计', - img: '/images/js-design.png', - url: 'https://js.design/?source=element-plus&plan=sy', - slogan: 'Professional online UI design tool', - slogan_cn: '专业在线UI设计工具', - banner_img: '/images/js-design-banner.jpg', + name: '美乐', + img: '/images/sponsors/mele.png', + url: 'https://melecode.com/', + slogan: 'Enterprise-level low-code development platform', + slogan_cn: '企业级全栈低代码开发平台', + banner_img: '/images/sponsors/mele-banner.png', }, { name: 'VForm', diff --git a/docs/.vitepress/crowdin/en-US/pages/component.json b/docs/.vitepress/crowdin/en-US/pages/component.json index 360ae409814b7a..a9ad8276fe8540 100644 --- a/docs/.vitepress/crowdin/en-US/pages/component.json +++ b/docs/.vitepress/crowdin/en-US/pages/component.json @@ -246,6 +246,11 @@ "link": "/statistic", "text": "Statistic", "promotion": "2.2.30" + }, + { + "link": "/segmented", + "text": "Segmented", + "promotion": "2.7.0" } ] }, diff --git a/docs/.vitepress/crowdin/en-US/pages/resource.json b/docs/.vitepress/crowdin/en-US/pages/resource.json index 96021b4adb21e8..d89eb9fca66c1a 100644 --- a/docs/.vitepress/crowdin/en-US/pages/resource.json +++ b/docs/.vitepress/crowdin/en-US/pages/resource.json @@ -12,5 +12,7 @@ "figmaVariables": "Figma Variables", "figmaVariablesIntro": "Components all use variables to quickly switch between dark and light modes.", "figma2023": "2023 Figma UI Kit", - "figma2023Intro": "Components designed using Figma's latest variable configuration provide Light/Dark/Dark Alpha theme switching to help you quickly build interface designs." + "figma2023Intro": "Components designed using Figma's latest variable configuration provide Light/Dark/Dark Alpha theme switching to help you quickly build interface designs.", + "masterGo2024": "2024 MasterGo UI Kit", + "masterGo2024Intro": "MasterGo component library with optimized adaptive layouts, more complete component states, and variant switching." } diff --git a/docs/.vitepress/vitepress/components/globals/icons.vue b/docs/.vitepress/vitepress/components/globals/icons.vue index 4ad30754bbdccf..fa98143a0ca2f5 100644 --- a/docs/.vitepress/vitepress/components/globals/icons.vue +++ b/docs/.vitepress/vitepress/components/globals/icons.vue @@ -16,6 +16,7 @@ type CategoriesItem = { const lang = useLang() const locale = computed(() => localeData[lang.value]) const copyIcon = ref(true) +const query = ref('') const copyContent = async (content) => { try { @@ -39,7 +40,10 @@ const copySvgIcon = async (name, refs) => { if (copyIcon.value) { await copyContent(`<${name} />`) } else { - const content = refs[name]?.[0].querySelector('svg')?.outerHTML ?? '' + let content = refs[name]?.[0].querySelector('svg')?.outerHTML ?? '' + if (content) { + content = content.replace(/data-v-\w+=""/, '') + } await copyContent(content) } } @@ -63,6 +67,17 @@ IconCategories.categories.forEach((o) => { }) categories.value.push({ name: 'Other', icons: Array.from(iconMap.values()) }) + +const filterCategories = computed(() => { + return categories.value + .map((category) => { + const icons = category.icons.filter((icon) => { + return icon.name.toLowerCase().includes(query.value.toLowerCase()) + }) + return { ...category, icons } + }) + .filter((category) => category.icons.length) +}) diff --git a/docs/examples/button/text.vue b/docs/examples/button/text.vue index a07ade91e843b6..2bedd706f100c4 100644 --- a/docs/examples/button/text.vue +++ b/docs/examples/button/text.vue @@ -6,8 +6,9 @@ :key="button.text" :type="button.type" text - >{{ button.text }} + {{ button.text }} +

Background color always on

@@ -18,8 +19,9 @@ :type="button.type" text bg - >{{ button.text }} + {{ button.text }} +

Disabled text button

@@ -30,8 +32,9 @@ :type="button.type" text disabled - >{{ button.text }} + {{ button.text }} + diff --git a/docs/examples/carousel/basic.vue b/docs/examples/carousel/basic.vue index aea24afc0c0062..278ab98f9c5ec4 100644 --- a/docs/examples/carousel/basic.vue +++ b/docs/examples/carousel/basic.vue @@ -1,8 +1,8 @@ diff --git a/docs/examples/checkbox/intermediate.vue b/docs/examples/checkbox/intermediate.vue index 59ab671746ea03..76f6705f8b945b 100644 --- a/docs/examples/checkbox/intermediate.vue +++ b/docs/examples/checkbox/intermediate.vue @@ -3,19 +3,16 @@ v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange" - >Check all + Check all + - {{ city }} + + {{ city }} + diff --git a/docs/examples/checkbox/limitation.vue b/docs/examples/checkbox/limitation.vue index a1e5d4c9b27430..71fbec4c516880 100644 --- a/docs/examples/checkbox/limitation.vue +++ b/docs/examples/checkbox/limitation.vue @@ -1,12 +1,8 @@ diff --git a/docs/examples/config-provider/button.vue b/docs/examples/config-provider/button.vue index 0786365c386ca7..32ce9a3d7a2d17 100644 --- a/docs/examples/config-provider/button.vue +++ b/docs/examples/config-provider/button.vue @@ -1,9 +1,9 @@