From b96d6e0372eab5495243a28cfa70a7486b4003cf Mon Sep 17 00:00:00 2001 From: yunfei <59595216+itmier@users.noreply.github.com> Date: Tue, 7 Feb 2023 10:41:25 +0800 Subject: [PATCH 01/28] Docs: repair document links (#22370) Co-authored-by: Tmier <1042970366@qq.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7abad78f3..1cdf1f575 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ For Vue 3.0, we recommend using [Element Plus](https://github.com/element-plus/e ## Links - Homepage and documentation - [International users](http://element.eleme.io/#/en-US) - - [Chinese users](http://element-cn.eleme.io/#/zh-CN) + - [Chinese users](http://element.eleme.io/#/zh-CN) - [Spanish users](http://element.eleme.io/#/es) - [French users](http://element.eleme.io/#/fr-FR) - [awesome-element](https://github.com/ElementUI/awesome-element) From c56f1d6c8c31a160ff4aec2c0088116dc246249c Mon Sep 17 00:00:00 2001 From: yang <30883395+webvs2@users.noreply.github.com> Date: Tue, 7 Feb 2023 15:21:13 +0800 Subject: [PATCH 02/28] Statistic: Update code and doc (#22276) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modifying Spaces Modifying Spaces * statistic:Updated countdown feature to localize lodash * statistic: optimize * Statistic:优化代码逻辑 修改中文文档 * statistic:Optimize the code logic and adjust the style --- examples/docs/zh-CN/statistic.md | 30 ++++++------ packages/statistic/src/main.vue | 39 ++++++++-------- packages/theme-chalk/src/statistic.scss | 61 +++++++++++++------------ 3 files changed, 64 insertions(+), 66 deletions(-) diff --git a/examples/docs/zh-CN/statistic.md b/examples/docs/zh-CN/statistic.md index 62402f986..308e3d3f8 100644 --- a/examples/docs/zh-CN/statistic.md +++ b/examples/docs/zh-CN/statistic.md @@ -81,8 +81,6 @@ export default { ### 倒计时 :::warning -suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为value指向的是未来的时间节点**。 - 如果需要在原基础上添加时间,请注意:整体的时间(添加的时间量和原定时间)必须是**未来**的时间节点,否则依旧是倒计时结束 ::: :::demo 通过 `value` 提供未来的时间,将开启倒计时功能 @@ -99,7 +97,7 @@ suspend 暂定,它**只是暂停倒计时,并非暂停了时间,因为valu
- + @@ -136,7 +134,8 @@ export default { deadline: Date.now() + 1000 * 60 * 60 * 24 * 2, deadline2: Date.now() + 1000 * 60 * 60 * 8, deadline3: Date.now() + 1000 * 60 *30, - deadline4: Date.now() + (new Date().setHours(23,59,59)-Date.now()) , + deadline4: Date.now() + (new Date().setHours(23,59,59)-Date.now()) , + stop:true }; }, methods: { @@ -144,7 +143,8 @@ export default { this.$notify({ title: '提示', message: '时间已到,你可知寸金难买寸光阴?', - duration: 0 + duration: 0, + }); }, clickFn(){ @@ -174,16 +174,16 @@ export default { | 参数 | 说明 | 类型 | 可选值 | 默认值 | |------------- |---------------- |---------------- |---------------------- |-------- | -| value | 数值内容 | string \| number | - | - | -| decimal-separator | 设置小数点 | string | - | . | -| formatter | 自定义数值展示| v-slot \|({value}) => VNode | - | - | -| group-separator | 设置千分位标识符 | string | - | , | -| precision | 数值精度 | number | - | 0 | -| prefix | 设置数值的前缀 | string \| v-slot | - | - | -| suffix |设置数值的后缀 | string \| v-slot | - | - | -| title | 数值的标题 | string \| v-slot | - | - | -| value-style | 设置数值的样式 | style | - | - | -| rate | 设置倍率 | number | - | 1000 | +| value | 数值内容 | string \| number |— | — | +| decimal-separator | 设置小数点 | string | — | . | +| formatter | 自定义数值展示| v-slot \|({value}) => VNode |— | — | +| group-separator | 设置千分位标识符 | string | — | , | +| precision | 数值精度 | number | — | 0 | +| prefix | 设置数值的前缀 | string \| v-slot | — | — | +| suffix |设置数值的后缀 | string \| v-slot | — | — | +| title | 数值的标题 | string \| v-slot | — | — | +| value-style | 设置数值的样式 | object | — | — | +| rate | 设置倍率 | number | — | 1000 | ### Statistic Slots diff --git a/packages/statistic/src/main.vue b/packages/statistic/src/main.vue index 1d7a6130c..2bf868f95 100644 --- a/packages/statistic/src/main.vue +++ b/packages/statistic/src/main.vue @@ -1,6 +1,6 @@ \ No newline at end of file + From 027291907cce382c11096996ebe1706c55422803 Mon Sep 17 00:00:00 2001 From: mrsai <147237749@qq.com> Date: Thu, 9 Feb 2023 20:33:34 +0800 Subject: [PATCH 05/28] InputNumber: fix touch one click trigger twice on the window touch pad (#21760) * fix touch one click trigger twice on the window touch pad * change var bane --- .gitignore | 1 + src/directives/repeat-click.js | 6 ++++-- src/utils/util.js | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index a9b3749c7..e9a3f06ee 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ coverage waiter.config.js build/bin/algolia-key.js .envrc +.history/ \ No newline at end of file diff --git a/src/directives/repeat-click.js b/src/directives/repeat-click.js index 9aaef3add..ae7ad9772 100644 --- a/src/directives/repeat-click.js +++ b/src/directives/repeat-click.js @@ -1,12 +1,14 @@ import { once, on } from 'element-ui/src/utils/dom'; +import { isMac } from 'element-ui/src/utils/util'; export default { bind(el, binding, vnode) { let interval = null; let startTime; + const maxIntervals = isMac() ? 100 : 300; const handler = () => vnode.context[binding.expression].apply(); const clear = () => { - if (Date.now() - startTime < 100) { + if (Date.now() - startTime < maxIntervals) { handler(); } clearInterval(interval); @@ -18,7 +20,7 @@ export default { startTime = Date.now(); once(document, 'mouseup', clear); clearInterval(interval); - interval = setInterval(handler, 100); + interval = setInterval(handler, maxIntervals); }); } }; diff --git a/src/utils/util.js b/src/utils/util.js index eab95814a..a9634d7ad 100644 --- a/src/utils/util.js +++ b/src/utils/util.js @@ -239,3 +239,7 @@ export function objToArray(obj) { } return isEmpty(obj) ? [] : [obj]; } + +export const isMac = function() { + return !Vue.prototype.$isServer && /macintosh|mac os x/i.test(navigator.userAgent); +}; From ac73dcc6b88493199fb9cf9d05d75d369fd9d737 Mon Sep 17 00:00:00 2001 From: xujintai123 <66779465+xujintai123@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:42:02 +0800 Subject: [PATCH 06/28] =?UTF-8?q?Docs:=20=E4=BF=AE=E5=A4=8Dlayout=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E7=9A=84siezs=E5=B1=9E=E6=80=A7=E5=80=BC=E5=9C=A8?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E4=B8=AA=E7=A4=BA=E4=BE=8B=E4=B8=AD=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=94=99=E8=AF=AF=20issue(#22220)=20(#22288)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/docs/zh-CN/pagination.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/docs/zh-CN/pagination.md b/examples/docs/zh-CN/pagination.md index f9a2b4163..d5170905f 100644 --- a/examples/docs/zh-CN/pagination.md +++ b/examples/docs/zh-CN/pagination.md @@ -4,7 +4,7 @@ ### 基础用法 -:::demo 设置`layout`,表示需要显示的内容,用逗号分隔,布局元素会依次显示。`prev`表示上一页,`next`为下一页,`pager`表示页码列表,除此以外还提供了`jumper`和`total`,`size`和特殊的布局符号`->`,`->`后的元素会靠右显示,`jumper`表示跳页元素,`total`表示总条目数,`size`用于设置每页显示的页码数量。 +:::demo 设置`layout`,表示需要显示的内容,用逗号分隔,布局元素会依次显示。`prev`表示上一页,`next`为下一页,`pager`表示页码列表,除此以外还提供了`jumper`和`total`,`sizes`和特殊的布局符号`->`,`->`后的元素会靠右显示,`jumper`表示跳页元素,`total`表示总条目数,`sizes`用于设置每页显示的页码数量。 ```html
页数较少时的效果 From e7d6893cdf23f2c3643822c0c6b5491f80993b4b Mon Sep 17 00:00:00 2001 From: inkroom Date: Thu, 9 Feb 2023 20:50:13 +0800 Subject: [PATCH 07/28] Image: add initialIndex prop (#22346) --- examples/docs/en-US/image.md | 1 + examples/docs/es/image.md | 1 + examples/docs/fr-FR/image.md | 1 + examples/docs/zh-CN/image.md | 1 + packages/image/src/image-viewer.vue | 1 + packages/image/src/main.vue | 5 +++-- types/image.d.ts | 2 ++ 7 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/docs/en-US/image.md b/examples/docs/en-US/image.md index 92dc90a82..637511200 100644 --- a/examples/docs/en-US/image.md +++ b/examples/docs/en-US/image.md @@ -147,6 +147,7 @@ Besides the native features of img, support lazy load, custom placeholder and lo | scroll-container | The container to add scroll listener when using lazy load | string / HTMLElement | — | The nearest parent container whose overflow property is auto or scroll | | preview-src-list | allow big image preview | Array | — | - | | z-index | set image preview z-index | Number | — | 2000 | +| initial-index | set image preview array index | Number | — | - | ### Events | Event Name | Description | Parameters | diff --git a/examples/docs/es/image.md b/examples/docs/es/image.md index 7d8d78d76..18e6b534e 100644 --- a/examples/docs/es/image.md +++ b/examples/docs/es/image.md @@ -149,6 +149,7 @@ Además de las características nativas de img, soporte de carga perezosa, marca | scroll-container | El contenedor para añadir el scroll listener cuando se utiliza lazy load | string / HTMLElement | — | El contenedor padre más cercano cuya propiedad de desbordamiento es auto o scroll | | preview-src-list | permitir una vista previa grande de la imagen | Array | — | - | | z-index | establecer el z-index de la vista previa de la imagen | Number | — | 2000 | +| initial-index | set image preview array index | Number | — | - | ### Eventos | Nombre del evento | Descripción | Parámetros | diff --git a/examples/docs/fr-FR/image.md b/examples/docs/fr-FR/image.md index 569f91a17..9f37ad91f 100644 --- a/examples/docs/fr-FR/image.md +++ b/examples/docs/fr-FR/image.md @@ -148,6 +148,7 @@ En plus des propriétés natives de img, ce composant supporte le lazy loading, | scroll-container | Le conteneur auquel ajouter le listener du scroll en mode lazy loading. | string / HTMLElement | — | Le conteneur parent le plus proche avec la propriété overflow à auto ou scroll. | | preview-src-list | allow big image preview | Array | — | - | | z-index | set image preview z-index | Number | — | 2000 | +| initial-index | set image preview array index | Number | — | - | ### Évènements | Nom | Description | Paramètres | diff --git a/examples/docs/zh-CN/image.md b/examples/docs/zh-CN/image.md index 7698798b6..d01d3eede 100644 --- a/examples/docs/zh-CN/image.md +++ b/examples/docs/zh-CN/image.md @@ -147,6 +147,7 @@ | scroll-container | 开启懒加载后,监听 scroll 事件的容器 | string / HTMLElement | — | 最近一个 overflow 值为 auto 或 scroll 的父元素 | | preview-src-list | 开启图片预览功能 | Array | — | - | | z-index | 设置图片预览的 z-index | Number | — | 2000 | +| initial-index | 图片预览初始图片index | Number | — | - | ### Events | 事件名称 | 说明 | 回调参数 | diff --git a/packages/image/src/image-viewer.vue b/packages/image/src/image-viewer.vue index 63c85dade..17433feca 100644 --- a/packages/image/src/image-viewer.vue +++ b/packages/image/src/image-viewer.vue @@ -43,6 +43,7 @@ :key="url" :src="currentImg" :style="imgStyle" + referrerpolicy='no-referrer' @load="handleImgLoad" @error="handleImgError" @mousedown="handleMouseDown"> diff --git a/packages/image/src/main.vue b/packages/image/src/main.vue index 5598bde8a..894a9873a 100644 --- a/packages/image/src/main.vue +++ b/packages/image/src/main.vue @@ -16,7 +16,7 @@ :style="imageStyle" :class="{ 'el-image__inner--center': alignCenter, 'el-image__preview': preview }">
@@ -62,7 +62,8 @@ zIndex: { type: Number, default: 2000 - } + }, + initialIndex: Number }, data() { diff --git a/types/image.d.ts b/types/image.d.ts index 82b18dce9..8640e4bd7 100644 --- a/types/image.d.ts +++ b/types/image.d.ts @@ -38,4 +38,6 @@ export declare class ElImage extends ElementUIComponent { previewSrcList: string[] zIndex: number + + initialIndex: number } From a14ad2a6f69b6f7ff4183e34466f13a120b97f2b Mon Sep 17 00:00:00 2001 From: Hazel <52577448+Hazel-Lin@users.noreply.github.com> Date: Thu, 9 Feb 2023 20:52:04 +0800 Subject: [PATCH 08/28] Docs(en-US): [DateTimePicker] (#22270) --- examples/docs/en-US/datetime-picker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/docs/en-US/datetime-picker.md b/examples/docs/en-US/datetime-picker.md index ef14e13ee..f6914e54b 100644 --- a/examples/docs/en-US/datetime-picker.md +++ b/examples/docs/en-US/datetime-picker.md @@ -210,7 +210,7 @@ DateTimePicker is derived from DatePicker and TimePicker. For a more detailed ex | default-time | the default time value after picking a date | non-range: string / range: string[] | non-range: a string like `12:00:00`, range: array of two strings, and the first item is for the start date and second for the end date. `00:00:00` will be used if not specified | — | | value-format | optional, format of binding value. If not specified, the binding value will be a Date object | string | see [date formats](#/en-US/component/date-picker#date-formats) | — | | name | same as `name` in native input | string | — | — | -| unlink-panels | unllink two date-panels in range-picker | boolean | — | false | +| unlink-panels | unlink two date-panels in range-picker | boolean | — | false | | prefix-icon | Custom prefix icon class | string | — | el-icon-date | | clear-icon | Custom clear icon class | string | — | el-icon-circle-close | From 5ab93421b4d24be000ed562ff014291224db3348 Mon Sep 17 00:00:00 2001 From: Hazel <52577448+Hazel-Lin@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:11:04 +0800 Subject: [PATCH 09/28] Docs(en-US): [Calendar] (#22269) --- examples/docs/en-US/calendar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/docs/en-US/calendar.md b/examples/docs/en-US/calendar.md index 46302f4c1..8b2b13e6e 100644 --- a/examples/docs/en-US/calendar.md +++ b/examples/docs/en-US/calendar.md @@ -57,7 +57,7 @@ Display date. |-----------------|------------------- |---------- |---------------------- |--------- | | value / v-model | binding value | Date/string/number | — | — | | range | time range, including start time and end time. Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months. | Array | — | — | -| first-day-of-week | fisrt day of week| Number | 1 to 7 | 1 | +| first-day-of-week | first day of week| Number | 1 to 7 | 1 | ### dateCell Scoped Slot Parameters | Attribute | Description | Type | Accepted Values | Default | From 3dd2a885f44778d1e41ea0f32f64739e650c8331 Mon Sep 17 00:00:00 2001 From: Hazel <52577448+Hazel-Lin@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:11:44 +0800 Subject: [PATCH 10/28] Docs(en-US): [Form] (#22268) --- examples/docs/en-US/form.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/docs/en-US/form.md b/examples/docs/en-US/form.md index ffd85b6fa..6aa00bf9f 100644 --- a/examples/docs/en-US/form.md +++ b/examples/docs/en-US/form.md @@ -520,7 +520,7 @@ When an `el-form-item` is nested in another `el-form-item`, its label width will All components in a Form inherit their `size` attribute from that Form. Similarly, FormItem also has a `size` attribute. -:::demo Still you can fine tune each component's `size` if you don't want that component to inherit its size from From or FormIten. +:::demo Still you can fine tune each component's `size` if you don't want that component to inherit its size from From or FormItem. ```html From 796a2238ccc32a7dde5a250b0c0d022d2e0a0c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Thu, 9 Feb 2023 22:05:27 +0800 Subject: [PATCH 11/28] chore: optimize code and fix bugs --- packages/image/src/main.vue | 8 +- src/directives/repeat-click.js | 2 +- types/element-ui.d.ts | 353 +-------------------------------- types/statistic.d.ts | 52 +++-- 4 files changed, 43 insertions(+), 372 deletions(-) diff --git a/packages/image/src/main.vue b/packages/image/src/main.vue index 894a9873a..c6786b848 100644 --- a/packages/image/src/main.vue +++ b/packages/image/src/main.vue @@ -16,7 +16,7 @@ :style="imageStyle" :class="{ 'el-image__inner--center': alignCenter, 'el-image__preview': preview }">
@@ -96,9 +96,15 @@ }, imageIndex() { let previewIndex = 0; + const initialIndex = this.initialIndex; + if (initialIndex >= 0) { + previewIndex = initialIndex; + return previewIndex; + } const srcIndex = this.previewSrcList.indexOf(this.src); if (srcIndex >= 0) { previewIndex = srcIndex; + return previewIndex; } return previewIndex; } diff --git a/src/directives/repeat-click.js b/src/directives/repeat-click.js index ae7ad9772..f80d4cb48 100644 --- a/src/directives/repeat-click.js +++ b/src/directives/repeat-click.js @@ -5,7 +5,7 @@ export default { bind(el, binding, vnode) { let interval = null; let startTime; - const maxIntervals = isMac() ? 100 : 300; + const maxIntervals = isMac() ? 100 : 200; const handler = () => vnode.context[binding.expression].apply(); const clear = () => { if (Date.now() - startTime < maxIntervals) { diff --git a/types/element-ui.d.ts b/types/element-ui.d.ts index 1521ae69e..62c4f2ad4 100644 --- a/types/element-ui.d.ts +++ b/types/element-ui.d.ts @@ -1,352 +1,3 @@ - -import Vue, { PluginObject } from 'vue' -import { ElementUIComponent, ElementUIComponentSize, ElementUIHorizontalAlignment } from './component' - -import { ElAlert } from './alert' -import { ElAside } from './aside' -import { ElAutocomplete } from './autocomplete' -import { ElBadge } from './badge' -import { ElBreadcrumb } from './breadcrumb' -import { ElBreadcrumbItem } from './breadcrumb-item' -import { ElButton } from './button' -import { ElButtonGroup } from './button-group' -import { ElCard } from './card' -import { ElCarousel } from './carousel' -import { ElCarouselItem } from './carousel-item' -import { ElCascader } from './cascader' -import { ElCheckbox } from './checkbox' -import { ElCheckboxButton } from './checkbox-button' -import { ElCheckboxGroup } from './checkbox-group' -import { ElCol } from './col' -import { ElCollapse } from './collapse' -import { ElCollapseItem } from './collapse-item' -import { ElColorPicker } from './color-picker' -import { ElContainer } from './container' -import { ElDatePicker } from './date-picker' -import { ElDialog } from './dialog' -import { ElDropdown } from './dropdown' -import { ElDropdownItem } from './dropdown-item' -import { ElDropdownMenu } from './dropdown-menu' -import { ElFooter } from './footer' -import { ElForm } from './form' -import { ElFormItem } from './form-item' -import { ElHeader } from './header' -import { ElInput } from './input' -import { ElInputNumber } from './input-number' -import { ElLoading } from './loading' -import { ElMain } from './main' -import { ElMenu } from './menu' -import { ElMenuItem } from './menu-item' -import { ElMenuItemGroup } from './menu-item-group' -import { ElMessage } from './message' -import { ElMessageBox } from './message-box' -import { ElNotification } from './notification' -import { ElOption } from './option' -import { ElOptionGroup } from './option-group' -import { ElPagination } from './pagination' -import { ElPopover } from './popover' -import { ElProgress } from './progress' -import { ElRate } from './rate' -import { ElRadio } from './radio' -import { ElRadioButton } from './radio-button' -import { ElRadioGroup } from './radio-group' -import { ElRow } from './row' -import { ElSelect } from './select' -import { ElSlider } from './slider' -import { ElStep } from './step' -import { ElSteps } from './steps' -import { ElSubmenu } from './submenu' -import { ElSwitch } from './switch' -import { ElTable } from './table' -import { ElTableColumn } from './table-column' -import { ElTag } from './tag' -import { ElTabs } from './tabs' -import { ElTabPane } from './tab-pane' -import { ElTimeline } from './timeline' -import { ElTimelineItem } from './timeline-item' -import { ElTimePicker } from './time-picker' -import { ElTimeSelect } from './time-select' -import { ElTooltip } from './tooltip' -import { ElTransfer } from './transfer' -import { ElTree, TreeData } from './tree' -import { ElUpload } from './upload' -import { ElLink } from './link' -import { ElDivider } from './divider' -import { ElIcon } from './icon' -import { ElCalendar } from './calendar' -import { ElImage } from './image' -import { ElBacktop } from './backtop' -import { ElInfiniteScroll } from './infinite-scroll' -import { ElPageHeader } from './page-header' -import { ElAvatar } from './avatar' -import { ElDrawer } from './drawer' - -import { ElStatistic } from './statistic' - -export interface InstallationOptions { - locale: any, - i18n: any, - size: string -} - -/** The version of element-ui */ -export const version: string - -/** - * Install all element-ui components into Vue. - * Please do not invoke this method directly. - * Call `Vue.use(ElementUI)` to install. - */ -export function install (vue: typeof Vue, options: InstallationOptions): void - -/** ElementUI component common definition */ -export type Component = ElementUIComponent - -/** Component size definition for button, input, etc */ -export type ComponentSize = ElementUIComponentSize - -/** Horizontal alignment */ -export type HorizontalAlignment = ElementUIHorizontalAlignment - -/** Show animation while loading data */ -export const Loading: ElLoading - -/** Used to show feedback after an activity. The difference with Notification is that the latter is often used to show a system level passive notification. */ -export const Message: ElMessage - -/** A set of modal boxes simulating system message box, mainly for message prompt, success tips, error messages and query information */ -export const MessageBox: ElMessageBox - -/** Displays a global notification message at the upper right corner of the page */ -export const Notification: ElNotification - -// TS cannot merge imported class with namespace, so declare subclasses instead - -/** Alert Component */ -export class Alert extends ElAlert {} - -/** Aside Component */ -export class Aside extends ElAside {} - -/** Autocomplete Component */ -export class Autocomplete extends ElAutocomplete {} - -/** Bagde Component */ -export class Badge extends ElBadge {} - -/** Breadcrumb Component */ -export class Breadcrumb extends ElBreadcrumb {} - -/** Breadcrumb Item Component */ -export class BreadcrumbItem extends ElBreadcrumbItem {} - -/** Button Component */ -export class Button extends ElButton {} - -/** Button Group Component */ -export class ButtonGroup extends ElButtonGroup {} - -/** Card Component */ -export class Card extends ElCard {} - -/** Cascader Component */ -export class Cascader extends ElCascader {} - -/** Carousel Component */ -export class Carousel extends ElCarousel {} - -/** Carousel Item Component */ -export class CarouselItem extends ElCarouselItem {} - -/** Checkbox Component */ -export class Checkbox extends ElCheckbox {} - -/** Checkbox Button Component */ -export class CheckboxButton extends ElCheckboxButton {} - -/** Checkbox Group Component */ -export class CheckboxGroup extends ElCheckboxGroup {} - -/** Colunm Layout Component */ -export class Col extends ElCol {} - -/** Collapse Component */ -export class Collapse extends ElCollapse {} - -/** Collapse Item Component */ -export class CollapseItem extends ElCollapseItem {} - -/** Color Picker Component */ -export class ColorPicker extends ElColorPicker {} - -/** Container Component */ -export class Container extends ElContainer {} - -/** Date Picker Component */ -export class DatePicker extends ElDatePicker {} - -/** Dialog Component */ -export class Dialog extends ElDialog {} - -/** Dropdown Component */ -export class Dropdown extends ElDropdown {} - -/** Dropdown Item Component */ -export class DropdownItem extends ElDropdownItem {} - -/** Dropdown Menu Component */ -export class DropdownMenu extends ElDropdownMenu {} - -/** Footer Component */ -export class Footer extends ElFooter {} - -/** Form Component */ -export class Form extends ElForm {} - -/** Form Item Component */ -export class FormItem extends ElFormItem {} - -/** Header Component */ -export class Header extends ElHeader {} - -/** Input Component */ -export class Input extends ElInput {} - -/** Input Number Component */ -export class InputNumber extends ElInputNumber {} - -/** Main Component */ -export class Main extends ElMain {} - -/** Menu that provides navigation for your website */ -export class Menu extends ElMenu {} - -/** Menu Item Component */ -export class MenuItem extends ElMenuItem {} - -/** Menu Item Group Component */ -export class MenuItemGroup extends ElMenuItemGroup {} - -/** Dropdown Select Option Component */ -export class Option extends ElOption {} - -/** Dropdown Select Option Group Component */ -export class OptionGroup extends ElOptionGroup {} - -/** Pagination Component */ -export class Pagination extends ElPagination {} - -/** Popover Component */ -export class Popover extends ElPopover {} - -/** Progress Component */ -export class Progress extends ElProgress {} - -/** Rate Component */ -export class Rate extends ElRate {} - -/** Radio Component */ -export class Radio extends ElRadio {} - -/** Radio Button Component */ -export class RadioButton extends ElRadioButton {} - -/** Radio Group Component */ -export class RadioGroup extends ElRadioGroup {} - -/** Row Layout Component */ -export class Row extends ElRow {} - -/** Dropdown Select Component */ -export class Select extends ElSelect {} - -/** Slider Component */ -export class Slider extends ElSlider {} - -/** Step Component */ -export class Step extends ElStep {} - -/** Steps Component */ -export class Steps extends ElSteps {} - -/** Submenu Component */ -export class Submenu extends ElSubmenu {} - -/** Switch Component */ -export class Switch extends ElSwitch {} - -/** Table Component */ -export class Table extends ElTable {} - -/** Table Column Component */ -export class TableColumn extends ElTableColumn {} - -/** Tabs Component */ -export class Tabs extends ElTabs {} - -/** Tab Pane Component */ -export class TabPane extends ElTabPane {} - -/** Tag Component */ -export class Tag extends ElTag {} - -/** Timeline Component */ -export class Timeline extends ElTimeline {} - -/** Timeline Item Component */ -export class TimelineItem extends ElTimelineItem {} - -/** TimePicker Component */ -export class TimePicker extends ElTimePicker {} - -/** TimeSelect Component */ -export class TimeSelect extends ElTimeSelect {} - -/** Tooltip Component */ -export class Tooltip extends ElTooltip {} - -/** Transfer Component */ -export class Transfer extends ElTransfer {} - -/** Tree Component */ -export class Tree extends ElTree {} - -/** Upload Component */ -export class Upload extends ElUpload {} - -/** Divider Component */ -export class Divider extends ElDivider {} - -/** Link Component */ -export class Link extends ElLink {} - -/** Image Component */ -export class Image extends ElImage {} - -/** Icon Component */ -export class Icon extends ElIcon {} - -/** Calendar Component */ -export class Calendar extends ElCalendar {} - -/** Backtop Component */ -export class Backtop extends ElBacktop {} - -/** InfiniteScroll Directive */ -export const InfiniteScroll: PluginObject; - -/** PageHeader Component */ -export class PageHeader extends ElPageHeader {} - -/** Avatar Component */ -export class Avatar extends ElAvatar {} - -/** Drawer Component */ -export class Drawer extends ElDrawer {} - -/** Statistic Component */ -export class Statistic extends ElStatistic {} - import Vue, { PluginObject } from 'vue' import { ElementUIComponent, ElementUIComponentSize, ElementUIHorizontalAlignment } from './component' @@ -437,6 +88,7 @@ import { ElSpinner } from './spinner' import { ElDescriptions } from './descriptions' import { ElDescriptionsItem } from './descriptions-item' import { ElResult } from './result' +import { ElStatistic } from './statistic' export interface InstallationOptions { locale: any, @@ -725,3 +377,6 @@ export class DescriptionsItem extends ElDescriptionsItem {} /** Result Component */ export class Result extends ElResult {} + +/** Statistic Component */ +export class Statistic extends ElStatistic {} \ No newline at end of file diff --git a/types/statistic.d.ts b/types/statistic.d.ts index 9f9b1fbc7..1221a4c92 100644 --- a/types/statistic.d.ts +++ b/types/statistic.d.ts @@ -2,26 +2,36 @@ import { ElementUIComponent } from './component' /** Statistic Component */ export declare class ElStatistic extends ElementUIComponent { - /** Set the decimal point */ - decimalSeparator:string - /** Sets the thousandth identifier */ - groupSeparator:string - /** numerical precision */ - precision:number + /** Set the decimal point */ + decimalSeparator: string + + /** Sets the thousandth identifier */ + groupSeparator: string + + /** numerical precision */ + precision: number + /** Numerical content */ - value:string|number - /** Title of numerical value */ - title:string|number - /**Whether to enable the countdown function */ - timeIndices:boolean - /** Sets the style of the value */ - valueStyle:object - /** Numeric content formatting countdown display*/ - format:string - /** Set the ratio */ - rate:number - /** Set the suffix of the value*/ - suffix:string - /** Set the prefix of the value*/ - prefix:string + value: string | number + + /** Title of numerical value */ + title: string | number + + /** Whether to enable the countdown function */ + timeIndices: boolean + + /** Sets the style of the value */ + valueStyle: object + + /** Numeric content formatting countdown display */ + format: string + + /** Set the ratio */ + rate: number + + /** Set the suffix of the value */ + suffix: string + + /** Set the prefix of the value */ + prefix: string } From d3f88b2406cead2baffcde621550dea93457fad9 Mon Sep 17 00:00:00 2001 From: Hao <47264468+whzxc@users.noreply.github.com> Date: Thu, 9 Feb 2023 22:24:21 +0800 Subject: [PATCH 12/28] Button: fix web-types type props (#22281) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit type属性少了个引号,会导致webstorm无法识别type="text"的情况 --- web-types.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web-types.json b/web-types.json index 22c289d9b..5b6201b27 100644 --- a/web-types.json +++ b/web-types.json @@ -371,7 +371,7 @@ { "name": "type", "description": "Button type", - "type": "'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text" + "type": "'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'" }, { "name": "plain", From 43a955a2803b5dce9c62feb18765ffc13a854528 Mon Sep 17 00:00:00 2001 From: liangmiao <45762508+lm312@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:10:01 +0800 Subject: [PATCH 13/28] docs: Input Events Table remove repeated input event. (#22093) Co-authored-by: CaoKun <2296986296@qq.com> --- examples/docs/es/input.md | 1 - examples/docs/fr-FR/input.md | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/docs/es/input.md b/examples/docs/es/input.md index f88a9deff..ded0e86e5 100644 --- a/examples/docs/es/input.md +++ b/examples/docs/es/input.md @@ -617,7 +617,6 @@ export default { | ------ | ------------------------------------------------------------ | ------------------------- | | blur | Se dispara cuando se pierde el foco | (event: Event) | | focus | Se dispara cuando se obtiene el foco | (event: Event) | -| change | se activa cuando cambia el valor de entrada | (value: string \| number) | | change | se activa solo cuando el cuadro de entrada pierde el foco o el usuario presiona Enter | (value: string \| number) | | input | se activa cuando cambia el valor de entrada | (value: string \| number) | | clear | se dispara cuando la entrada es borrada por el botón generado por el atributo `clearable`. | — | diff --git a/examples/docs/fr-FR/input.md b/examples/docs/fr-FR/input.md index 661b72b3e..21ce6573d 100644 --- a/examples/docs/fr-FR/input.md +++ b/examples/docs/fr-FR/input.md @@ -603,7 +603,6 @@ export default { |----| ----| ----| | blur | Se déclenche quand Input perds le focus. | (event: Event) | | focus | Se déclenche quand Input a le focus. | (event: Event) | -| change | Se déclenche quand la valeur change. | (value: string \ number) | | change | Déclenché uniquement lorsque la zone de saisie perd le focus ou que l'utilisateur appuie sur Entrée. | (value: string \| number) | | input | Déclenché lorsque la valeur d'entrée change. | (value: string \| number) | | clear | Se déclenche quand le champ est effacé par le bouton de reset. | — | From daf1349af0f593f87a7f295558244dade15a2082 Mon Sep 17 00:00:00 2001 From: Limbo <49612796+JUST-Limbo@users.noreply.github.com> Date: Sun, 12 Feb 2023 18:43:32 +0800 Subject: [PATCH 14/28] Docs:[Statistic] update docs and fix bugs (#22383) --- examples/docs/en-US/statistic.md | 312 +++++++++++++++--------------- examples/docs/es/statistic.md | 311 +++++++++++++++--------------- examples/docs/fr-FR/statistic.md | 312 +++++++++++++++--------------- examples/docs/zh-CN/statistic.md | 315 +++++++++++++++---------------- 4 files changed, 599 insertions(+), 651 deletions(-) diff --git a/examples/docs/en-US/statistic.md b/examples/docs/en-US/statistic.md index d4072a124..1d25019a2 100644 --- a/examples/docs/en-US/statistic.md +++ b/examples/docs/en-US/statistic.md @@ -1,85 +1,82 @@ -## Statistic +## Statistic Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc. Countdown mode - ### Basic usage + The component provides a thousandth place display, but you can use rate to set the 10,000th place, and so on :::demo ```html - ``` + ::: - ### 倒计时 + :::warning Suspend is tentative, it ** just pauses the countdown, not the time, because value points to a future time node ** @@ -88,129 +85,120 @@ If you need to add time to the original, please note that the overall time (the :::demo Providing a future time via 'value' will enable the countdown function ```html - ``` ::: - - - ### Statistic Attributes -| Attribute | Description | Type | Accepted Values | Default | -|------------- |---------------- |---------------- |---------------------- |-------- | -| value | Numerical content | string \| number | - | - | -| decimal-separator | Setting the decimal point | string | - | . | -| formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | -| group-separator | Sets the thousandth identifier | string | - | , | -| precision | numerical precision | number | - | 0 | -| prefix | Sets the prefix of a number | string \| v-slot | - | - | -| suffix |Sets the suffix of a number | string \| v-slot | - | - | -| title | Numeric titles | string \| v-slot | - | - | -| value-style | Styles numeric values | style | - | - | -| rate | Set the ratio | number | - | 1000 | - +| Attribute | Description | Type | Accepted Values | Default | +| ----------------- | ------------------------------ | --------------------------- | --------------- | ------- | +| value | Numerical content | string \| number | - | - | +| decimal-separator | Setting the decimal point | string | - | . | +| formatter | Custom numerical presentation | v-slot \|({value}) => VNode | - | - | +| group-separator | Sets the thousandth identifier | string | - | , | +| precision | numerical precision | number | - | 0 | +| prefix | Sets the prefix of a number | string \| v-slot | - | - | +| suffix | Sets the suffix of a number | string \| v-slot | - | - | +| title | Numeric titles | string \| v-slot | - | - | +| value-style | Styles numeric values | style | - | - | +| rate | Set the ratio | number | - | 1000 | ### Statistic Slots -| Name | Description | -|------|--------| -| prefix | Numeric prefix | -| suffix | Suffixes for numeric values | -| formatter | Numerical content | -| title | Numeric titles | +| Name | Description | +| --------- | --------------------------- | +| prefix | Numeric prefix | +| suffix | Suffixes for numeric values | +| formatter | Numerical content | +| title | Numeric titles | -### Statistic.Countdown Attributes +### Statistic.Countdown Attributes + +| Attribute | Description | Type | Options | Default | +| ------------ | ---------------------------------------- | ------- | ----------- | ---------- | +| time-indices | Whether to enable the countdown function | boolean | true\|false | false | +| value | Required value, enter the bound value | string | — | — | +| format | Formatting the countdown display | string | — | 'HH:mm:ss' | -| Attribute | Description | Type | Options | Default | -|------------- |---------------- |---------------- |---------------------- |-------- | -| time-indices | Whether to enable the countdown function | boolean | true\|false | false | -| value | Required value, enter the bound value | string | — | — | -| format | Formatting the countdown display | string | — | 'HH:mm:ss' | ### Statistic.Countdown Events -| Method | Description | Parameters | -|---------|--------|---------| -| change | Enable in the 'countdown' function | (value: Date) | + +| Method | Description | Parameters | +| ------ | ------------------------------------------ | ---------------- | +| change | Enable in the 'countdown' function | (value: Date) | | finish | Launched after the 'countdown' is complete | (value: boolean) | ### Statistic Methods -| Method | Description | Parameters |CallBack| -| ---- | ---- | ---- |---- | -| suspend | Pause the countdown|(value:boolean) |(value: Date) | - +| Method | Description | Parameters | CallBack | +| ------- | ------------------- | --------------- | ------------- | +| suspend | Pause the countdown | (value:boolean) | (value: Date) | diff --git a/examples/docs/es/statistic.md b/examples/docs/es/statistic.md index ed8405daf..07be86f99 100644 --- a/examples/docs/es/statistic.md +++ b/examples/docs/es/statistic.md @@ -1,85 +1,81 @@ -## Statistic +## Statistic Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc. Countdown mode - ### Basic usage + The component provides a thousandth place display, but you can use rate to set the 10,000th place, and so on :::demo ```html - ``` ::: - ### 倒计时 + :::warning Suspend is tentative, it ** just pauses the countdown, not the time, because value points to a future time node ** @@ -88,129 +84,120 @@ If you need to add time to the original, please note that the overall time (the :::demo Providing a future time via 'value' will enable the countdown function ```html - ``` ::: - - - ### Statistic Attributes -| Attribute | Description | Type | Accepted Values | Default | -|------------- |---------------- |---------------- |---------------------- |-------- | -| value | Numerical content | string \| number | - | - | -| decimal-separator | Setting the decimal point | string | - | . | -| formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | -| group-separator | Sets the thousandth identifier | string | - | , | -| precision | numerical precision | number | - | 0 | -| prefix | Sets the prefix of a number | string \| v-slot | - | - | -| suffix |Sets the suffix of a number | string \| v-slot | - | - | -| title | Numeric titles | string \| v-slot | - | - | -| value-style | Styles numeric values | style | - | - | -| rate | Set the ratio | number | - | 1000 | - +| Attribute | Description | Type | Accepted Values | Default | +| ----------------- | ------------------------------ | --------------------------- | --------------- | ------- | +| value | Numerical content | string \| number | - | - | +| decimal-separator | Setting the decimal point | string | - | . | +| formatter | Custom numerical presentation | v-slot \|({value}) => VNode | - | - | +| group-separator | Sets the thousandth identifier | string | - | , | +| precision | numerical precision | number | - | 0 | +| prefix | Sets the prefix of a number | string \| v-slot | - | - | +| suffix | Sets the suffix of a number | string \| v-slot | - | - | +| title | Numeric titles | string \| v-slot | - | - | +| value-style | Styles numeric values | style | - | - | +| rate | Set the ratio | number | - | 1000 | ### Statistic Slots -| Name | Description | -|------|--------| -| prefix | Numeric prefix | -| suffix | Suffixes for numeric values | -| formatter | Numerical content | -| title | Numeric titles | +| Name | Description | +| --------- | --------------------------- | +| prefix | Numeric prefix | +| suffix | Suffixes for numeric values | +| formatter | Numerical content | +| title | Numeric titles | -### Statistic.Countdown Attributes +### Statistic.Countdown Attributes + +| Attribute | Description | Type | Options | Default | +| ------------ | ---------------------------------------- | ------- | ----------- | ---------- | +| time-indices | Whether to enable the countdown function | boolean | true\|false | false | +| value | Required value, enter the bound value | string | — | — | +| format | Formatting the countdown display | string | — | 'HH:mm:ss' | -| Attribute | Description | Type | Options | Default | -|------------- |---------------- |---------------- |---------------------- |-------- | -| time-indices | Whether to enable the countdown function | boolean | true\|false | false | -| value | Required value, enter the bound value | string | — | — | -| format | Formatting the countdown display | string | — | 'HH:mm:ss' | ### Statistic.Countdown Events -| Method | Description | Parameters | -|---------|--------|---------| -| change | Enable in the 'countdown' function | (value: Date) | + +| Method | Description | Parameters | +| ------ | ------------------------------------------ | ---------------- | +| change | Enable in the 'countdown' function | (value: Date) | | finish | Launched after the 'countdown' is complete | (value: boolean) | ### Statistic Methods -| Method | Description | Parameters |CallBack| -| ---- | ---- | ---- |---- | -| suspend | Pause the countdown|(value:boolean) |(value: Date) | - +| Method | Description | Parameters | CallBack | +| ------- | ------------------- | --------------- | ------------- | +| suspend | Pause the countdown | (value:boolean) | (value: Date) | diff --git a/examples/docs/fr-FR/statistic.md b/examples/docs/fr-FR/statistic.md index d4072a124..1d25019a2 100644 --- a/examples/docs/fr-FR/statistic.md +++ b/examples/docs/fr-FR/statistic.md @@ -1,85 +1,82 @@ -## Statistic +## Statistic Used to highlight a certain number or group of numbers, such as showing a numerical value, such as a dollar amount, ranking, etc. Countdown mode - ### Basic usage + The component provides a thousandth place display, but you can use rate to set the 10,000th place, and so on :::demo ```html - ``` + ::: - ### 倒计时 + :::warning Suspend is tentative, it ** just pauses the countdown, not the time, because value points to a future time node ** @@ -88,129 +85,120 @@ If you need to add time to the original, please note that the overall time (the :::demo Providing a future time via 'value' will enable the countdown function ```html - ``` ::: - - - ### Statistic Attributes -| Attribute | Description | Type | Accepted Values | Default | -|------------- |---------------- |---------------- |---------------------- |-------- | -| value | Numerical content | string \| number | - | - | -| decimal-separator | Setting the decimal point | string | - | . | -| formatter | Custom numerical presentation| v-slot \|({value}) => VNode | - | - | -| group-separator | Sets the thousandth identifier | string | - | , | -| precision | numerical precision | number | - | 0 | -| prefix | Sets the prefix of a number | string \| v-slot | - | - | -| suffix |Sets the suffix of a number | string \| v-slot | - | - | -| title | Numeric titles | string \| v-slot | - | - | -| value-style | Styles numeric values | style | - | - | -| rate | Set the ratio | number | - | 1000 | - +| Attribute | Description | Type | Accepted Values | Default | +| ----------------- | ------------------------------ | --------------------------- | --------------- | ------- | +| value | Numerical content | string \| number | - | - | +| decimal-separator | Setting the decimal point | string | - | . | +| formatter | Custom numerical presentation | v-slot \|({value}) => VNode | - | - | +| group-separator | Sets the thousandth identifier | string | - | , | +| precision | numerical precision | number | - | 0 | +| prefix | Sets the prefix of a number | string \| v-slot | - | - | +| suffix | Sets the suffix of a number | string \| v-slot | - | - | +| title | Numeric titles | string \| v-slot | - | - | +| value-style | Styles numeric values | style | - | - | +| rate | Set the ratio | number | - | 1000 | ### Statistic Slots -| Name | Description | -|------|--------| -| prefix | Numeric prefix | -| suffix | Suffixes for numeric values | -| formatter | Numerical content | -| title | Numeric titles | +| Name | Description | +| --------- | --------------------------- | +| prefix | Numeric prefix | +| suffix | Suffixes for numeric values | +| formatter | Numerical content | +| title | Numeric titles | -### Statistic.Countdown Attributes +### Statistic.Countdown Attributes + +| Attribute | Description | Type | Options | Default | +| ------------ | ---------------------------------------- | ------- | ----------- | ---------- | +| time-indices | Whether to enable the countdown function | boolean | true\|false | false | +| value | Required value, enter the bound value | string | — | — | +| format | Formatting the countdown display | string | — | 'HH:mm:ss' | -| Attribute | Description | Type | Options | Default | -|------------- |---------------- |---------------- |---------------------- |-------- | -| time-indices | Whether to enable the countdown function | boolean | true\|false | false | -| value | Required value, enter the bound value | string | — | — | -| format | Formatting the countdown display | string | — | 'HH:mm:ss' | ### Statistic.Countdown Events -| Method | Description | Parameters | -|---------|--------|---------| -| change | Enable in the 'countdown' function | (value: Date) | + +| Method | Description | Parameters | +| ------ | ------------------------------------------ | ---------------- | +| change | Enable in the 'countdown' function | (value: Date) | | finish | Launched after the 'countdown' is complete | (value: boolean) | ### Statistic Methods -| Method | Description | Parameters |CallBack| -| ---- | ---- | ---- |---- | -| suspend | Pause the countdown|(value:boolean) |(value: Date) | - +| Method | Description | Parameters | CallBack | +| ------- | ------------------- | --------------- | ------------- | +| suspend | Pause the countdown | (value:boolean) | (value: Date) | diff --git a/examples/docs/zh-CN/statistic.md b/examples/docs/zh-CN/statistic.md index 308e3d3f8..b1feb0c49 100644 --- a/examples/docs/zh-CN/statistic.md +++ b/examples/docs/zh-CN/statistic.md @@ -1,216 +1,201 @@ -## Statistic 统计数值 +## Statistic 统计数值 用于突出某个或某组数字时,如显示数值,如金额,排名等。 倒计时模式 +### 基础用法 -### 基础用法 - 组件提供千分位的展示,不过可以通过rate来设置相应万分位等 +组件提供千分位的展示,不过可以通过 rate 来设置相应万分位等 :::demo ```html - ``` ::: - ### 倒计时 + :::warning 如果需要在原基础上添加时间,请注意:整体的时间(添加的时间量和原定时间)必须是**未来**的时间节点,否则依旧是倒计时结束 ::: :::demo 通过 `value` 提供未来的时间,将开启倒计时功能 ```html - ``` ::: - - - ### Statistic Attributes -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|------------- |---------------- |---------------- |---------------------- |-------- | -| value | 数值内容 | string \| number |— | — | -| decimal-separator | 设置小数点 | string | — | . | -| formatter | 自定义数值展示| v-slot \|({value}) => VNode |— | — | -| group-separator | 设置千分位标识符 | string | — | , | -| precision | 数值精度 | number | — | 0 | -| prefix | 设置数值的前缀 | string \| v-slot | — | — | -| suffix |设置数值的后缀 | string \| v-slot | — | — | -| title | 数值的标题 | string \| v-slot | — | — | -| value-style | 设置数值的样式 | object | — | — | -| rate | 设置倍率 | number | — | 1000 | - +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ----------------- | ---------------- | --------------------------- | ------ | ------ | +| value | 数值内容 | string \| number | — | — | +| decimal-separator | 设置小数点 | string | — | . | +| formatter | 自定义数值展示 | v-slot \|({value}) => VNode | — | — | +| group-separator | 设置千分位标识符 | string | — | , | +| precision | 数值精度 | number | — | 0 | +| prefix | 设置数值的前缀 | string \| v-slot | — | — | +| suffix | 设置数值的后缀 | string \| v-slot | — | — | +| title | 数值的标题 | string \| v-slot | — | — | +| value-style | 设置数值的样式 | object | — | — | +| rate | 设置倍率 | number | — | 1000 | ### Statistic Slots -| name | 说明 | -|------|--------| -| prefix | 数值的前缀 | -| suffix | 数值的后缀 | -| formatter | 数值内容 | -| title | 数值的标题 | +| name | 说明 | +| --------- | ---------- | +| prefix | 数值的前缀 | +| suffix | 数值的后缀 | +| formatter | 数值内容 | +| title | 数值的标题 | -### Statistic.Countdown Attributes +### Statistic.Countdown Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ------------ | ------------------ | ------- | ----------- | ---------- | +| time-indices | 是否开启倒计时功能 | boolean | true\|false | false | +| value | 必填值,输入绑定值 | string | — | — | +| format | 格式化倒计时展示 | string | — | 'HH:mm:ss' | -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -|------------- |---------------- |---------------- |---------------------- |-------- | -| time-indices | 是否开启倒计时功能 | boolean | true\|false | false | -| value | 必填值,输入绑定值 | string | — | — | -| format | 格式化倒计时展示 | string | — | 'HH:mm:ss' | ### Statistic.Countdown Events -| 事件名称 | 说明 | 回调参数 | -|---------|--------|---------| -| change | 在`倒计时`的功能中开启 | (value: Date) | -| finish | 在`倒计时` 完成后启动 | (value: boolean) | + +| 事件名称 | 说明 | 回调参数 | +| -------- | ---------------------- | ---------------- | +| change | 在`倒计时`的功能中开启 | (value: Date) | +| finish | 在`倒计时` 完成后启动 | (value: boolean) | ### Statistic Methods -| 方法名 | 说明 | 参数 |回调参数| -| ---- | ---- | ---- |---- | -| suspend | 暂停倒计时|(value:boolean) |(value: Date) | - +| 方法名 | 说明 | 参数 | 回调参数 | +| ------- | ---------- | --------------- | ------------- | +| suspend | 暂停倒计时 | (value:boolean) | (value: Date) | From d81260302424be3411cdd55fc4b16bfd12d3f884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Sun, 12 Feb 2023 21:38:28 +0800 Subject: [PATCH 15/28] chore: add changelog --- CHANGELOG.en-US.md | 26 ++++++++++++++++++++++++++ CHANGELOG.es.md | 26 ++++++++++++++++++++++++++ CHANGELOG.fr-FR.md | 26 ++++++++++++++++++++++++++ CHANGELOG.zh-CN.md | 26 ++++++++++++++++++++++++++ 4 files changed, 104 insertions(+) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 449dcbf85..3b389e523 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -1,5 +1,31 @@ ## Changelog +### 2.15.13 + +*2023-02-12* + +#### Bug fixes +- Docs + - Fix Statistic docs (#22383 by @JUST-Limbo) + - Fix Input docs (#22093 by @lm312) + - Fix en-US docs (#22268 #22269 #22270 by @Hazel-Lin) + - Fix Pagination docs (#22288 by @xujintai123) + - Fix: Links docs (#22370 by @itmier) +- Statistics + - fix slot display bug (#22375 by @webvs2) +- Chore + - missing web-type after publishing (#22271 by @loosheng) +#### Optimization +- InputNumber + - Fix touch one click trigger twice on the window touch pad (#22185 by @mrsai) +- Image + - Add initialIndex prop (#22346 by @inkroom) +- Statistics + - Updated countdown feature to localize lodash Closes (#22260 by @webvs2) + - Update code and doc (#22276 by @webvs2) +- Other + - fix web-types type props (#22281 by @whzxc) + ### 2.15.12 *2022-11-16* diff --git a/CHANGELOG.es.md b/CHANGELOG.es.md index 5bfd57b70..d0ca940dc 100644 --- a/CHANGELOG.es.md +++ b/CHANGELOG.es.md @@ -1,5 +1,31 @@ ## Changelog +### 2.15.13 + +*2023-02-12* + +#### Bug fixes +- Docs + - Fix Statistic docs (#22383 by @JUST-Limbo) + - Fix Input docs (#22093 by @lm312) + - Fix en-US docs (#22268 #22269 #22270 by @Hazel-Lin) + - Fix Pagination docs (#22288 by @xujintai123) + - Fix: Links docs (#22370 by @itmier) +- Statistics + - fix slot display bug (#22375 by @webvs2) +- Chore + - missing web-type after publishing (#22271 by @loosheng) +#### Optimization +- InputNumber + - Fix touch one click trigger twice on the window touch pad (#22185 by @mrsai) +- Image + - Add initialIndex prop (#22346 by @inkroom) +- Statistics + - Updated countdown feature to localize lodash Closes (#22260 by @webvs2) + - Update code and doc (#22276 by @webvs2) +- Other + - fix web-types type props (#22281 by @whzxc) + ### 2.15.12 *2022-11-16* diff --git a/CHANGELOG.fr-FR.md b/CHANGELOG.fr-FR.md index 0a9f29d94..13efa33e2 100644 --- a/CHANGELOG.fr-FR.md +++ b/CHANGELOG.fr-FR.md @@ -1,5 +1,31 @@ ## Changelog +### 2.15.13 + +*2023-02-12* + +#### Bug fixes +- Docs + - Fix Statistic docs (#22383 by @JUST-Limbo) + - Fix Input docs (#22093 by @lm312) + - Fix en-US docs (#22268 #22269 #22270 by @Hazel-Lin) + - Fix Pagination docs (#22288 by @xujintai123) + - Fix: Links docs (#22370 by @itmier) +- Statistics + - fix slot display bug (#22375 by @webvs2) +- Chore + - missing web-type after publishing (#22271 by @loosheng) +#### Optimization +- InputNumber + - Fix touch one click trigger twice on the window touch pad (#22185 by @mrsai) +- Image + - Add initialIndex prop (#22346 by @inkroom) +- Statistics + - Updated countdown feature to localize lodash Closes (#22260 by @webvs2) + - Update code and doc (#22276 by @webvs2) +- Other + - fix web-types type props (#22281 by @whzxc) + ### 2.15.12 *2022-11-16* diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 5c75e2364..3bd8b6585 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -1,5 +1,31 @@ ## 更新日志 +### 2.15.13 + +*2023-02-12* + +#### Bug 修复 +- Docs + - 修复 Statistic 文案 (#22383 by @JUST-Limbo) + - 修复 Input 文案 (#22093 by @lm312) + - 修复 en-US 文案 (#22268 #22269 #22270 by @Hazel-Lin) + - 修复 Pagination 文案 (#22288 by @xujintai123) + - 修复 Links 文案 (#22370 by @itmier) +- Statistics + - 修复 slot 显示问题 (#22375 by @webvs2) +- Chore + - 修复 web-type 文件丢失问题 (#22271 by @loosheng) +#### 优化 +- InputNumber + - windows触摸屏响应优化 (#22185 by @mrsai) +- Image + - 新增 initialIndex 属性 (#22346 by @inkroom) +- Statistics + - countdown 特性更新 (#22260 by @webvs2) + - 代码优化及doc更新 (#22276 by @webvs2) +- 其他 + - web-type代码优化 (#22281 by @whzxc) + ### 2.15.12 *2022-11-16* From 03f53ae4e99023ab1b6f19e1602c29d58487daf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Mon, 13 Feb 2023 08:08:26 +0800 Subject: [PATCH 16/28] [build] 2.15.13 --- examples/versions.json | 2 +- packages/theme-chalk/package.json | 2 +- src/index.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/versions.json b/examples/versions.json index fc2abfae8..75b7ece67 100644 --- a/examples/versions.json +++ b/examples/versions.json @@ -1 +1 @@ -{"1.4.13":"1.4","2.0.11":"2.0","2.1.0":"2.1","2.2.2":"2.2","2.3.9":"2.3","2.4.11":"2.4","2.5.4":"2.5","2.6.3":"2.6","2.7.2":"2.7","2.8.2":"2.8","2.9.2":"2.9","2.10.1":"2.10","2.11.1":"2.11","2.12.0":"2.12","2.13.2":"2.13","2.14.1":"2.14","2.15.12":"2.15"} \ No newline at end of file +{"1.4.13":"1.4","2.0.11":"2.0","2.1.0":"2.1","2.2.2":"2.2","2.3.9":"2.3","2.4.11":"2.4","2.5.4":"2.5","2.6.3":"2.6","2.7.2":"2.7","2.8.2":"2.8","2.9.2":"2.9","2.10.1":"2.10","2.11.1":"2.11","2.12.0":"2.12","2.13.2":"2.13","2.14.1":"2.14","2.15.13":"2.15"} \ No newline at end of file diff --git a/packages/theme-chalk/package.json b/packages/theme-chalk/package.json index 7797ba453..659fc9550 100644 --- a/packages/theme-chalk/package.json +++ b/packages/theme-chalk/package.json @@ -1,6 +1,6 @@ { "name": "element-theme-chalk", - "version": "2.15.12", + "version": "2.15.13", "description": "Element component chalk theme.", "main": "lib/index.css", "style": "lib/index.css", diff --git a/src/index.js b/src/index.js index 55b2922e6..b5d91bccd 100644 --- a/src/index.js +++ b/src/index.js @@ -212,7 +212,7 @@ if (typeof window !== 'undefined' && window.Vue) { } export default { - version: '2.15.12', + version: '2.15.13', locale: locale.use, i18n: locale.i18n, install, From 41508acbda81e3b595c70fba5ac6bab947a7f62f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9A=E9=A3=8E?= Date: Mon, 13 Feb 2023 08:08:27 +0800 Subject: [PATCH 17/28] [release] 2.15.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 961b468b2..c4cdc83f0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "element-ui", - "version": "2.15.12", + "version": "2.15.13", "description": "A Component Library for Vue.js.", "main": "lib/element-ui.common.js", "files": [ From f14b5ba5406b0f682499663fc5d6fb10864b3146 Mon Sep 17 00:00:00 2001 From: Fayzullo Saidakbarov <34656195+akahon@users.noreply.github.com> Date: Tue, 21 Feb 2023 14:50:34 +0300 Subject: [PATCH 18/28] i18n: Update Uzbek translation (#22390) I have fixed some incorrectly translated words on uzbek language --- src/locale/lang/uz-UZ.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/locale/lang/uz-UZ.js b/src/locale/lang/uz-UZ.js index de06bf1ef..fb5924b52 100644 --- a/src/locale/lang/uz-UZ.js +++ b/src/locale/lang/uz-UZ.js @@ -62,7 +62,7 @@ export default { loading: 'Yuklanmoqda', noMatch: 'Mos maʼlumot yoʻq', noData: 'Maʼlumot yoʻq', - placeholder: 'Tanladizngiz' + placeholder: 'Tanlang' }, cascader: { noMatch: 'Mos maʼlumot topilmadi', @@ -85,8 +85,8 @@ export default { upload: { deleteTip: 'Oʻchirish tugmasini bosib oʻchiring', delete: 'Oʻchirish', - preview: 'Oldin koʻrish', - continue: 'Davom qilish' + preview: 'Oldindan koʻrish', + continue: 'Davom etish' }, table: { emptyText: 'Boʻsh', @@ -113,8 +113,8 @@ export default { title: 'Orqaga' }, popconfirm: { - confirmButtonText: 'Yes', // to be translated - cancelButtonText: 'No' // to be translated + confirmButtonText: 'Tasdiqlash', + cancelButtonText: 'Bekor qilish' }, empty: { description: 'Boʻsh' From 041227db4d14167e5345402993c28fc30a10de31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8F=A8=E5=8F=A8?= Date: Mon, 14 Aug 2023 17:58:41 +0800 Subject: [PATCH 19/28] Table: table add highlight selection row (#22382) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Table: table add highlight selection row * chore: 调整高亮类名 --- examples/docs/en-US/table.md | 1 + examples/docs/es/table.md | 1 + examples/docs/fr-FR/table.md | 1 + examples/docs/zh-CN/table.md | 1 + packages/table/src/table-body.js | 11 ++++++++++- packages/table/src/table.vue | 5 +++++ packages/table/src/util.js | 18 ++++++++++++++++++ packages/theme-chalk/src/table.scss | 6 +++--- types/table.d.ts | 3 +++ 9 files changed, 43 insertions(+), 4 deletions(-) diff --git a/examples/docs/en-US/table.md b/examples/docs/en-US/table.md index 173309633..3d78fe665 100644 --- a/examples/docs/en-US/table.md +++ b/examples/docs/en-US/table.md @@ -1817,6 +1817,7 @@ You can customize row index in `type=index` columns. | fit | whether width of column automatically fits its container | boolean | — | true | | show-header | whether Table header is visible | boolean | — | true | | highlight-current-row | whether current row is highlighted | boolean | — | false | +| highlight-selection-row | whether selection row is highlighted | boolean | — | false | | current-row-key | key of current row, a set only prop | string,number | — | — | | row-class-name | function that returns custom class names for a row, or a string assigning class names for every row | Function({row, rowIndex})/String | — | — | | row-style | function that returns custom style for a row, or an object assigning custom style for every row | Function({row, rowIndex})/Object | — | — | diff --git a/examples/docs/es/table.md b/examples/docs/es/table.md index 36f32ffd8..140b05e81 100644 --- a/examples/docs/es/table.md +++ b/examples/docs/es/table.md @@ -1822,6 +1822,7 @@ Puede personalizar el índice de la fila con la propiedad `type=index` de las co | fit | especifica si el ancho de la columna se adapta automáticamente a su contenedor | boolean | — | true | | show-header | especifica si la cabecera de la tabla es visible | boolean | — | true | | highlight-current-row | especifica si la fila actual es resaltado | boolean | — | false | +| highlight-selection-row | resaltar la selección de líneas de verificación | boolean | — | false | | current-row-key | clave de la fila actual, un ajuste de propiedad única | string,number | — | — | | row-class-name | función que devuelve nombres de clases personalizadas para una fila, o una cadena asignando nombres de clases para cada fila | Function({row, rowIndex})/String | — | — | | row-style | función que devuelve el estilo personalizado para una fila, o un objeto asignando estilos personalizado para cada fila | Function({row, rowIndex})/Object | — | — | diff --git a/examples/docs/fr-FR/table.md b/examples/docs/fr-FR/table.md index a9d873ac1..1142df6ea 100644 --- a/examples/docs/fr-FR/table.md +++ b/examples/docs/fr-FR/table.md @@ -1824,6 +1824,7 @@ Vous pouvez personnaliser les indices des colonnes de type `index`. | fit | Si la largeur des colonnes s'adapte au conteneur. | boolean | — | true | | show-header | Si le header de la table est visible. | boolean | — | true | | highlight-current-row | Si la ligne courante est mise en valeur. | boolean | — | false | +| highlight-selection-row | Sélectionner la ligne à cocher en surbrillance | boolean | — | false | | current-row-key | Clé de la ligne actuelle. Propriété set-only. | string,number | — | — | | row-class-name | Fonction qui retourne un nom de classe pour chaque ligne. Peut aussi être une simple chaîne de caractères assignant une classe à chaque ligne. | Function({row, rowIndex})/String | — | — | | row-style | Fonction qui retourne un style pour chaque ligne. Peut aussi être un objet assignant un style à chaque ligne. | Function({row, rowIndex})/Object | — | — | diff --git a/examples/docs/zh-CN/table.md b/examples/docs/zh-CN/table.md index 21eb413f4..5a99dde39 100644 --- a/examples/docs/zh-CN/table.md +++ b/examples/docs/zh-CN/table.md @@ -1860,6 +1860,7 @@ | fit | 列的宽度是否自撑开 | boolean | — | true | | show-header | 是否显示表头 | boolean | — | true | | highlight-current-row | 是否要高亮当前行 | boolean | — | false | +| highlight-selection-row | 是否要高亮复选框选中行(仅针对开启 `selection` 有效) | boolean | — | false | | current-row-key | 当前行的 key,只写属性 | String,Number | — | — | | row-class-name | 行的 className 的回调方法,也可以使用字符串为所有行设置一个固定的 className。 | Function({row, rowIndex})/String | — | — | | row-style | 行的 style 的回调方法,也可以使用一个固定的 Object 为所有行设置一样的 Style。 | Function({row, rowIndex})/Object | — | — | diff --git a/packages/table/src/table-body.js b/packages/table/src/table-body.js index cd22348ff..4aea1e6b1 100644 --- a/packages/table/src/table-body.js +++ b/packages/table/src/table-body.js @@ -1,5 +1,5 @@ import { arrayFindIndex } from 'element-ui/src/utils/util'; -import { getCell, getColumnByCell, getRowIdentity } from './util'; +import { getCell, getColumnByCell, getRowIdentity, objectEquals } from './util'; import { getStyle, hasClass, removeClass, addClass } from 'element-ui/src/utils/dom'; import ElCheckbox from 'element-ui/packages/checkbox'; import ElTooltip from 'element-ui/packages/tooltip'; @@ -168,11 +168,20 @@ export default { }, getRowClass(row, rowIndex) { + let selection = this.store.states.selection; const classes = ['el-table__row']; if (this.table.highlightCurrentRow && row === this.store.states.currentRow) { classes.push('current-row'); } + if (this.table.highlightSelectionRow) { + for (let i = 0; i < selection.length; i++) { + if (objectEquals(row, selection[i])) { + classes.push('selection-row'); + } + }; + } + if (this.stripe && rowIndex % 2 === 1) { classes.push('el-table__row--striped'); } diff --git a/packages/table/src/table.vue b/packages/table/src/table.vue index 2fa3c93ad..6fe658e9e 100644 --- a/packages/table/src/table.vue +++ b/packages/table/src/table.vue @@ -295,6 +295,11 @@ highlightCurrentRow: Boolean, + highlightSelectionRow: { + type: Boolean, + default: false + }, + currentRowKey: [String, Number], emptyText: String, diff --git a/packages/table/src/util.js b/packages/table/src/util.js index 7bbec8d64..995784216 100644 --- a/packages/table/src/util.js +++ b/packages/table/src/util.js @@ -253,3 +253,21 @@ export function walkTreeNode(root, cb, childrenKey = 'children', lazyKey = 'hasC } }); } + +export const objectEquals = function(objectA, objectB) { + // 取对象a和b的属性名 + let aProps = Object.getOwnPropertyNames(objectA); + let bProps = Object.getOwnPropertyNames(objectB); + // 判断属性名的length是否一致 + if (aProps.length !== bProps.length) { + return false; + } + // 循环取出属性名,再判断属性值是否一致 + for (let i = 0; i < aProps.length; i++) { + let propName = aProps[i]; + if (objectA[propName] !== objectB[propName]) { + return false; + } + } + return true; +}; diff --git a/packages/theme-chalk/src/table.scss b/packages/theme-chalk/src/table.scss index b7e66d5a1..876702981 100644 --- a/packages/theme-chalk/src/table.scss +++ b/packages/theme-chalk/src/table.scss @@ -486,7 +486,7 @@ background: #FAFAFA; } - &.current-row td.el-table__cell { + &.current-row td.el-table__cell, &.selection-row td.el-table__cell { background-color: $--table-current-row-background-color; } } @@ -496,7 +496,7 @@ @include e(body) { tr.hover-row { &, &.el-table__row--striped { - &, &.current-row { + &, &.current-row, &.selection-row { > td.el-table__cell { background-color: $--table-row-hover-background-color; } @@ -504,7 +504,7 @@ } } - tr.current-row > td.el-table__cell { + tr.current-row > td.el-table__cell, tr.selection-row > td.el-table__cell { background-color: $--table-current-row-background-color; } } diff --git a/types/table.d.ts b/types/table.d.ts index da5bb3806..860c2f9af 100644 --- a/types/table.d.ts +++ b/types/table.d.ts @@ -63,6 +63,9 @@ export declare class ElTable extends ElementUIComponent { /** Whether current row is highlighted */ highlightCurrentRow: boolean + /** Whether selection row is highlighted */ + highlightSelectionRow: boolean + /** Key of current row, a set only prop */ currentRowKey: string | number From 68e8c86d4048390370cdf2621a732b2f38a03fef Mon Sep 17 00:00:00 2001 From: yang <30883395+webvs2@users.noreply.github.com> Date: Mon, 14 Aug 2023 17:59:47 +0800 Subject: [PATCH 20/28] Statistic :fix doc; Optimized code; (#22384) * [statistic]: doc conflict modification * [statistic]:doc Modify text * [statistic]:Optimized code --- examples/docs/en-US/statistic.md | 102 ++++++++++++++++++++++-------- examples/docs/es/statistic.md | 105 ++++++++++++++++++++++--------- examples/docs/fr-FR/statistic.md | 102 ++++++++++++++++++++++-------- examples/docs/zh-CN/statistic.md | 101 ++++++++++++++++++++++------- examples/nav.config.json | 24 +++---- packages/statistic/src/main.vue | 47 +++++++------- 6 files changed, 338 insertions(+), 143 deletions(-) diff --git a/examples/docs/en-US/statistic.md b/examples/docs/en-US/statistic.md index 1d25019a2..11e25af62 100644 --- a/examples/docs/en-US/statistic.md +++ b/examples/docs/en-US/statistic.md @@ -8,25 +8,39 @@ Countdown mode The component provides a thousandth place display, but you can use rate to set the 10,000th place, and so on :::demo + ```html